diff --git a/software/qsys_tutorial/.cproject b/software/qsys_tutorial/.cproject deleted file mode 100644 index 7f08b3b..0000000 --- a/software/qsys_tutorial/.cproject +++ /dev/null @@ -1,508 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - make - - mem_init_install - true - false - false - - - make - - mem_init_generate - true - false - false - - - make - - help - true - false - false - - - - diff --git a/software/qsys_tutorial/.force_relink b/software/qsys_tutorial/.force_relink deleted file mode 100644 index e69de29..0000000 --- a/software/qsys_tutorial/.force_relink +++ /dev/null diff --git a/software/qsys_tutorial/.project b/software/qsys_tutorial/.project deleted file mode 100644 index 6356557..0000000 --- a/software/qsys_tutorial/.project +++ /dev/null @@ -1,96 +0,0 @@ - - - qsys_tutorial - - - - - - com.altera.sbtgui.project.makefileBuilder - - - - - com.altera.sbtgui.project.makefileBuilder - - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - ?name? - - - - org.eclipse.cdt.make.core.append_environment - true - - - org.eclipse.cdt.make.core.autoBuildTarget - all - - - org.eclipse.cdt.make.core.buildArguments - - - - org.eclipse.cdt.make.core.buildCommand - make - - - org.eclipse.cdt.make.core.buildLocation - ${workspace_loc://qsys_tutorial} - - - org.eclipse.cdt.make.core.cleanBuildTarget - clean - - - org.eclipse.cdt.make.core.contents - org.eclipse.cdt.make.core.activeConfigSettings - - - org.eclipse.cdt.make.core.enableAutoBuild - false - - - org.eclipse.cdt.make.core.enableCleanBuild - true - - - org.eclipse.cdt.make.core.enableFullBuild - true - - - org.eclipse.cdt.make.core.fullBuildTarget - all - - - org.eclipse.cdt.make.core.stopOnError - true - - - org.eclipse.cdt.make.core.useDefaultBuildCmd - true - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - org.eclipse.cdt.core.ccnature - com.altera.sbtgui.project.SBTGUINature - com.altera.sbtgui.project.SBTGUIAppNature - com.altera.sbtgui.project.SBTGUIManagedNature - - diff --git a/software/qsys_tutorial/Makefile b/software/qsys_tutorial/Makefile deleted file mode 100644 index ed51d63..0000000 --- a/software/qsys_tutorial/Makefile +++ /dev/null @@ -1,1086 +0,0 @@ -#------------------------------------------------------------------------------ -# VARIABLES APPENDED TO BY INCLUDED MAKEFILE FRAGMENTS -#------------------------------------------------------------------------------ - -# List of include directories for -I compiler option (-I added when used). -# Includes the BSP. -ALT_INCLUDE_DIRS := - -# List of library directories for -L linker option (-L added when used). -# Includes the BSP. -ALT_LIBRARY_DIRS := - -# List of library names for -l linker option (-l added when used). -# Includes the BSP. -ALT_LIBRARY_NAMES := - -# List of library names for -msys-lib linker option (-msys-lib added when used). -# These are libraries that might be located in the BSP and depend on the BSP -# library, or vice versa -ALT_BSP_DEP_LIBRARY_NAMES := - -# List of dependencies for the linker. This is usually the full pathname -# of each library (*.a) file. -# Includes the BSP. -ALT_LDDEPS := - -# List of root library directories that support running make to build them. -# Includes the BSP and any ALT libraries. -MAKEABLE_LIBRARY_ROOT_DIRS := - -# Generic flags passed to the compiler for different types of input files. -ALT_CFLAGS := -ALT_CXXFLAGS := -ALT_CPPFLAGS := -ALT_ASFLAGS := -ALT_LDFLAGS := - - -#------------------------------------------------------------------------------ -# The adjust-path macro -# -# If COMSPEC/ComSpec is defined, Make is launched from Windows through -# Cygwin. The adjust-path macro converts absolute windows paths into -# unix style paths (Example: c:/dir -> /c/dir). This will ensture -# paths are readable by GNU Make. -# -# If COMSPEC/ComSpec is not defined, Make is launched from linux, and no -# adjustment is necessary -# -#------------------------------------------------------------------------------ - -ifndef COMSPEC -ifdef ComSpec -COMSPEC = $(ComSpec) -endif # ComSpec -endif # COMSPEC - -ifdef COMSPEC # if Windows OS - -ifeq ($(MAKE_VERSION),3.81) -# -# adjust-path/adjust-path-mixed for Mingw Gnu Make on Windows -# -# Example Usage: -# $(call adjust-path,c:/aaa/bbb) => /c/aaa/bbb -# $(call adjust-path-mixed,/c/aaa/bbb) => c:/aaa/bbb -# $(call adjust-path-mixed,/cygdrive/c/aaa/bbb) => c:/aaa/bbb -# - -# -# adjust-path -# - converts back slash characters into forward slashes -# - if input arg ($1) is an empty string then return the empty string -# - if input arg ($1) does not contain the string ":/", then return input arg -# - using sed, convert mixed path [c:/...] into mingw path [/c/...] -define adjust-path -$(strip \ -$(if $1,\ -$(if $(findstring :/,$(subst \,/,$1)),\ -$(shell echo $(subst \,/,$1) | sed -e 's,^\([a-zA-Z]\):/,/\1/,'),\ -$(subst \,/,$1)))) -endef - -# -# adjust-path-mixed -# - converts back slash characters into forward slashes -# - if input arg ($1) is an empty string then return the empty string -# - if input arg ($1) does not begin with a forward slash '/' char, then -# return input arg -# - using sed, convert mingw path [/c/...] or cygwin path [/c/cygdrive/...] -# into a mixed path [c:/...] -define adjust-path-mixed -$(strip \ -$(if $1,\ -$(if $(findstring $(subst \,/,$1),$(patsubst /%,%,$(subst \,/,$1))),\ -$(subst \,/,$1),\ -$(shell echo $(subst \,/,$1) | sed -e 's,^/cygdrive/\([a-zA-Z]\)/,\1:/,' -e 's,^/\([a-zA-Z]\)/,\1:/,')))) -endef - -else # MAKE_VERSION != 3.81 (MAKE_VERSION == 3.80 or MAKE_VERSION == 3.79) -# -# adjust-path for Cygwin Gnu Make -# $(call adjust-path,c:/aaa/bbb) = /cygdrive/c/aaa/bbb -# $(call adjust-path-mixed,/cygdrive/c/aaa/bbb) = c:/aaa/bbb -# -adjust-path = $(if $1,$(shell cygpath -u "$1"),) -adjust-path-mixed = $(if $1,$(shell cygpath -m "$1"),) -endif - -else # !COMSPEC - -adjust-path = $1 -adjust-path-mixed = $1 - -endif # COMSPEC - - -#vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv -# GENERATED SETTINGS START v -#vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv - -#START GENERATED -ACTIVE_BUILD_CONFIG := default -BUILD_CONFIGS := default - -# The following TYPE comment allows tools to identify the 'type' of target this -# makefile is associated with. -# TYPE: APP_MAKEFILE - -# This following VERSION comment indicates the version of the tool used to -# generate this makefile. A makefile variable is provided for VERSION as well. -# ACDS_VERSION: 13.0sp1 -ACDS_VERSION := 13.0sp1 - -# This following BUILD_NUMBER comment indicates the build number of the tool -# used to generate this makefile. -# BUILD_NUMBER: 232 - -# Define path to the application ELF. -# It may be used by the makefile fragments so is defined before including them. -# -ELF := qsys_tutorial.elf - -# Paths to C, C++, and assembly source files. -C_SRCS := -CXX_SRCS := -ASM_SRCS := - - -# Path to root of object file tree. -OBJ_ROOT_DIR := obj - -# Options to control objdump. -CREATE_OBJDUMP := 1 -OBJDUMP_INCLUDE_SOURCE := 1 -OBJDUMP_FULL_CONTENTS := 0 - -# Options to enable/disable optional files. -CREATE_ELF_DERIVED_FILES := 0 -CREATE_LINKER_MAP := 1 - -# Common arguments for ALT_CFLAGSs -APP_CFLAGS_DEFINED_SYMBOLS := -APP_CFLAGS_UNDEFINED_SYMBOLS := -APP_CFLAGS_OPTIMIZATION := -O0 -APP_CFLAGS_DEBUG_LEVEL := -g -APP_CFLAGS_WARNINGS := -Wall -APP_CFLAGS_USER_FLAGS := - -APP_ASFLAGS_USER := -APP_LDFLAGS_USER := - -# Linker options that have default values assigned later if not -# assigned here. -LINKER_SCRIPT := -CRT0 := -SYS_LIB := - -# Define path to the root of the BSP. -BSP_ROOT_DIR := ../qsys_tutorial_bsp/ - -# List of application specific include directories, library directories and library names -APP_INCLUDE_DIRS := -APP_LIBRARY_DIRS := -APP_LIBRARY_NAMES := - -# Pre- and post- processor settings. -BUILD_PRE_PROCESS := -BUILD_POST_PROCESS := - -QUARTUS_PROJECT_DIR := ../../ - - -#END GENERATED - -#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -# GENERATED SETTINGS END ^ -#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - -#------------------------------------------------------------------------------ -# DEFAULT TARGET -#------------------------------------------------------------------------------ - -# Define the variable used to echo output if not already defined. -ifeq ($(ECHO),) -ECHO := echo -endif - -# Put "all" rule before included makefile fragments because they may -# define rules and we don't want one of those to become the default rule. -.PHONY : all - -all: - @$(ECHO) [$(APP_NAME) build complete] - -all : build_pre_process libs app build_post_process - - -#------------------------------------------------------------------------------ -# VARIABLES DEPENDENT ON GENERATED CONTENT -#------------------------------------------------------------------------------ - -# Define object file directory per build configuration -CONFIG_OBJ_DIR := $(OBJ_ROOT_DIR)/$(ACTIVE_BUILD_CONFIG) - -ifeq ($(BSP_ROOT_DIR),) -$(error Edit Makefile and provide a value for BSP_ROOT_DIR) -endif - -ifeq ($(wildcard $(BSP_ROOT_DIR)),) -$(error BSP directory does not exist: $(BSP_ROOT_DIR)) -endif - -# Define absolute path to the root of the BSP. -ABS_BSP_ROOT_DIR := $(call adjust-path-mixed,$(shell cd "$(BSP_ROOT_DIR)"; pwd)) - -# Include makefile fragments. Define variable ALT_LIBRARY_ROOT_DIR before -# including each makefile fragment so that it knows the path to itself. -BSP_INCLUDE_FILE := $(BSP_ROOT_DIR)/public.mk -ALT_LIBRARY_ROOT_DIR := $(BSP_ROOT_DIR) -include $(BSP_INCLUDE_FILE) -# C2H will need this to touch the BSP public.mk and avoid the sopc file -# out-of-date error during a BSP make -ABS_BSP_INCLUDE_FILE := $(ABS_BSP_ROOT_DIR)/public.mk - - -ifneq ($(WARNING.SMALL_STACK_SIZE),) -# This WARNING is here to protect you from unknowingly using a very small stack -# If the warning is set, increase your stack size or enable the BSP small stack -# setting to eliminate the warning -$(warning WARNING: $(WARNING.SMALL_STACK_SIZE)) -endif - - -# If the BSP public.mk indicates that ALT_SIM_OPTIMIZE is set, rename the ELF -# by prefixing it with RUN_ON_HDL_SIMULATOR_ONLY_. -ifneq ($(filter -DALT_SIM_OPTIMIZE,$(ALT_CPPFLAGS)),) -ELF := RUN_ON_HDL_SIMULATOR_ONLY_$(ELF) -endif - -# If the BSP public.mk indicates that ALT_PROVIDE_GMON is set, add option to -# download_elf target -ifneq ($(filter -DALT_PROVIDE_GMON,$(ALT_CPPFLAGS)),) -GMON_OUT_FILENAME := gmon.out -WRITE_GMON_OPTION := --write-gmon $(GMON_OUT_FILENAME) -endif - -# Name of ELF application. -APP_NAME := $(basename $(ELF)) - -# Set to defaults if variables not already defined in settings. -ifeq ($(LINKER_SCRIPT),) -LINKER_SCRIPT := $(BSP_LINKER_SCRIPT) -endif -ifeq ($(CRT0),) -CRT0 := $(BSP_CRT0) -endif -ifeq ($(SYS_LIB),) -SYS_LIB := $(BSP_SYS_LIB) -endif - -OBJDUMP_NAME := $(APP_NAME).objdump -OBJDUMP_FLAGS := --disassemble --syms --all-header -ifeq ($(OBJDUMP_INCLUDE_SOURCE),1) -OBJDUMP_FLAGS += --source -endif -ifeq ($(OBJDUMP_FULL_CONTENTS),1) -OBJDUMP_FLAGS += --full-contents -endif - -# Create list of linker dependencies (*.a files). -APP_LDDEPS := $(ALT_LDDEPS) $(LDDEPS) - -# Take lists and add required prefixes. -APP_INC_DIRS := $(addprefix -I, $(ALT_INCLUDE_DIRS) $(APP_INCLUDE_DIRS) $(INC_DIRS)) -ASM_INC_PREFIX := -Wa,-I -APP_ASM_INC_DIRS := $(addprefix $(ASM_INC_PREFIX), $(ALT_INCLUDE_DIRS) $(APP_INCLUDE_DIRS) $(INC_DIRS)) -APP_LIB_DIRS := $(addprefix -L, $(ALT_LIBRARY_DIRS) $(APP_LIBRARY_DIRS) $(LIB_DIRS)) -APP_LIBS := $(addprefix -l, $(ALT_LIBRARY_NAMES) $(APP_LIBRARY_NAMES) $(LIBS)) - -ifneq ($(AVOID_NIOS2_GCC3_OPTIONS),) - -# -# Avoid Nios II GCC 3.X options. -# - -# Detect if small newlib C library is requested. -# If yes, remove the -msmallc option because it is -# now handled by other means. -ifneq ($(filter -msmallc,$(ALT_LDFLAGS)),) - ALT_LDFLAGS := $(filter-out -msmallc,$(ALT_LDFLAGS)) - ALT_C_LIBRARY := smallc -else - ALT_C_LIBRARY := c -endif - -# Put each BSP dependent library in a group to avoid circular dependencies. -APP_BSP_DEP_LIBS := $(foreach l,$(ALT_BSP_DEP_LIBRARY_NAMES),-Wl,--start-group -l$(ALT_C_LIBRARY) -lgcc -l$(l) -Wl,--end-group) - -else # !AVOID_NIOS2_GCC3_OPTIONS - -# -# Use Nios II GCC 3.X options. -# -APP_BSP_DEP_LIBS := $(addprefix -msys-lib=, $(ALT_BSP_DEP_LIBRARY_NAMES)) - -endif # !AVOID_NIOS2_GCC3_OPTIONS - -# Arguments for the C preprocessor, C/C++ compiler, assembler, and linker. -APP_CFLAGS := $(APP_CFLAGS_DEFINED_SYMBOLS) \ - $(APP_CFLAGS_UNDEFINED_SYMBOLS) \ - $(APP_CFLAGS_OPTIMIZATION) \ - $(APP_CFLAGS_DEBUG_LEVEL) \ - $(APP_CFLAGS_WARNINGS) \ - $(APP_CFLAGS_USER_FLAGS) \ - $(ALT_CFLAGS) \ - $(CFLAGS) - -# Arguments only for the C++ compiler. -APP_CXXFLAGS := $(ALT_CXXFLAGS) $(CXXFLAGS) - -# Arguments only for the C preprocessor. -# Prefix each include directory with -I. -APP_CPPFLAGS := $(APP_INC_DIRS) \ - $(ALT_CPPFLAGS) \ - $(CPPFLAGS) - -# Arguments only for the assembler. -APP_ASFLAGS := $(APP_ASM_INC_DIRS) \ - $(ALT_ASFLAGS) \ - $(APP_ASFLAGS_USER) \ - $(ASFLAGS) - -# Arguments only for the linker. -APP_LDFLAGS := $(APP_LDFLAGS_USER) - -ifneq ($(LINKER_SCRIPT),) -APP_LDFLAGS += -T'$(LINKER_SCRIPT)' -endif - -ifneq ($(AVOID_NIOS2_GCC3_OPTIONS),) - -# Avoid Nios II GCC 3.x options. -ifneq ($(CRT0),) -APP_LDFLAGS += $(CRT0) -endif - -# The equivalent of the -msys-lib option is provided -# by the GROUP() command in the linker script. -# Note this means the SYS_LIB variable is now ignored. - -else # !AVOID_NIOS2_GCC3_OPTIONS - -# Use Nios II GCC 3.x options. -ifneq ($(CRT0),) -APP_LDFLAGS += -msys-crt0='$(CRT0)' -endif -ifneq ($(SYS_LIB),) -APP_LDFLAGS += -msys-lib=$(SYS_LIB) -endif - -endif # !AVOID_NIOS2_GCC3_OPTIONS - -APP_LDFLAGS += \ - $(APP_LIB_DIRS) \ - $(ALT_LDFLAGS) \ - $(LDFLAGS) - -LINKER_MAP_NAME := $(APP_NAME).map -ifeq ($(CREATE_LINKER_MAP), 1) -APP_LDFLAGS += -Wl,-Map=$(LINKER_MAP_NAME) -endif - -# QUARTUS_PROJECT_DIR and SOPC_NAME need to be defined if you want the -# mem_init_install target of the mem_init.mk (located in the associated BSP) -# to know how to copy memory initialization files (e.g. .dat, .hex) into -# directories required for Quartus compilation or RTL simulation. - -# Defining QUARTUS_PROJECT_DIR causes mem_init_install to copy memory -# initialization files into your Quartus project directory. This is required -# to provide the initial memory contents of FPGA memories that can be -# initialized by the programming file (.sof) or Hardcopy ROMs. It is also used -# for VHDL simulation of on-chip memories. - -# Defining SOPC_NAME causes the mem_init_install target to copy memory -# initialization files into your RTL simulation directory. This is required -# to provide the initial memory contents of all memories that can be -# initialized by RTL simulation. This variable should be set to the same name -# as your SOPC Builder system name. For example, if you have a system called -# "foo.sopc", this variable should be set to "foo". - -# If SOPC_NAME is not set and QUARTUS_PROJECT_DIR is set, then derive SOPC_NAME. -ifeq ($(SOPC_NAME),) -ifneq ($(QUARTUS_PROJECT_DIR),) -SOPC_NAME := $(basename $(notdir $(wildcard $(QUARTUS_PROJECT_DIR)/*.sopcinfo))) -endif -endif - -# Defining JDI_FILE is required to specify the JTAG Debug Information File -# path. This file is generated by Quartus, and is needed along with the -# .sopcinfo file to resolve processor instance ID's from names in a multi-CPU -# systems. For multi-CPU systems, the processor instance ID is used to select -# from multiple CPU's during ELF download. - -# Both JDI_FILE and SOPCINFO_FILE are provided by the BSP if they found during -# BSP creation. If JDI_FILE is not set and QUARTUS_PROJECT_DIR is set, then -# derive JDI_FILE. We do not attempt to derive SOPCINFO_FILE since there may be -# multiple .sopcinfo files in a Quartus project. -ifeq ($(JDI_FILE),) -ifneq ($(QUARTUS_PROJECT_DIR),) -JDI_FILE := $(wildcard $(QUARTUS_PROJECT_DIR)/*.jdi) -endif -endif - -# Path to root runtime directory used for hdl simulation -RUNTIME_ROOT_DIR := $(CONFIG_OBJ_DIR)/runtime - - - -#------------------------------------------------------------------------------ -# MAKEFILE INCLUDES DEPENDENT ON GENERATED CONTENT -#------------------------------------------------------------------------------ -# mem_init.mk is a generated makefile fragment. This file defines all targets -# used to generate HDL initialization simulation files and pre-initialized -# onchip memory files. -MEM_INIT_FILE := $(BSP_ROOT_DIR)/mem_init.mk -include $(MEM_INIT_FILE) - -# Create list of object files to be built using the list of source files. -# The source file hierarchy is preserved in the object tree. -# The supported file extensions are: -# -# .c - for C files -# .cxx .cc .cpp - for C++ files -# .S .s - for assembler files -# -# Handle source files specified by --src-dir & --src-rdir differently, to -# save some processing time in calling the adjust-path macro. - -OBJ_LIST_C := $(patsubst %.c,%.o,$(filter %.c,$(C_SRCS))) -OBJ_LIST_CPP := $(patsubst %.cpp,%.o,$(filter %.cpp,$(CXX_SRCS))) -OBJ_LIST_CXX := $(patsubst %.cxx,%.o,$(filter %.cxx,$(CXX_SRCS))) -OBJ_LIST_CC := $(patsubst %.cc,%.o,$(filter %.cc,$(CXX_SRCS))) -OBJ_LIST_S := $(patsubst %.S,%.o,$(filter %.S,$(ASM_SRCS))) -OBJ_LIST_SS := $(patsubst %.s,%.o,$(filter %.s,$(ASM_SRCS))) - -OBJ_LIST := $(sort $(OBJ_LIST_C) $(OBJ_LIST_CPP) $(OBJ_LIST_CXX) \ - $(OBJ_LIST_CC) $(OBJ_LIST_S) $(OBJ_LIST_SS)) - -SDIR_OBJ_LIST_C := $(patsubst %.c,%.o,$(filter %.c,$(SDIR_C_SRCS))) -SDIR_OBJ_LIST_CPP := $(patsubst %.cpp,%.o,$(filter %.cpp,$(SDIR_CXX_SRCS))) -SDIR_OBJ_LIST_CXX := $(patsubst %.cxx,%.o,$(filter %.cxx,$(SDIR_CXX_SRCS))) -SDIR_OBJ_LIST_CC := $(patsubst %.cc,%.o,$(filter %.cc,$(SDIR_CXX_SRCS))) -SDIR_OBJ_LIST_S := $(patsubst %.S,%.o,$(filter %.S,$(SDIR_ASM_SRCS))) -SDIR_OBJ_LIST_SS := $(patsubst %.s,%.o,$(filter %.s,$(SDIR_ASM_SRCS))) - -SDIR_OBJ_LIST := $(sort $(SDIR_OBJ_LIST_C) $(SDIR_OBJ_LIST_CPP) \ - $(SDIR_OBJ_LIST_CXX) $(SDIR_OBJ_LIST_CC) $(SDIR_OBJ_LIST_S) \ - $(SDIR_OBJ_LIST_SS)) - -# Relative-pathed objects that being with "../" are handled differently. -# -# Regular objects are created as -# $(CONFIG_OBJ_DIR)//.o -# where the path structure is maintained under the obj directory. This -# applies for both absolute and relative paths; in the absolute path -# case this means the entire source path will be recreated under the obj -# directory. This is done to allow two source files with the same name -# to be included as part of the project. -# -# Note: On Cygwin, the path recreated under the obj directory will be -# the cygpath -u output path. -# -# Relative-path objects that begin with "../" cause problems under this -# scheme, as $(CONFIG_OBJ_DIR)/..// can potentially put the object -# files anywhere in the system, creating clutter and polluting the source tree. -# As such, their paths are flattened - the object file created will be -# $(CONFIG_OBJ_DIR)/.o. Due to this, two files specified with -# "../" in the beginning cannot have the same name in the project. VPATH -# will be set for these sources to allow make to relocate the source file -# via %.o rules. -# -# The following lines separate the object list into the flatten and regular -# lists, and then handles them as appropriate. - -FLATTEN_OBJ_LIST := $(filter ../%,$(OBJ_LIST)) -FLATTEN_APP_OBJS := $(addprefix $(CONFIG_OBJ_DIR)/,$(notdir $(FLATTEN_OBJ_LIST))) - -REGULAR_OBJ_LIST := $(filter-out $(FLATTEN_OBJ_LIST),$(OBJ_LIST)) -REGULAR_OBJ_LIST_C := $(filter $(OBJ_LIST_C),$(REGULAR_OBJ_LIST)) -REGULAR_OBJ_LIST_CPP := $(filter $(OBJ_LIST_CPP),$(REGULAR_OBJ_LIST)) -REGULAR_OBJ_LIST_CXX := $(filter $(OBJ_LIST_CXX),$(REGULAR_OBJ_LIST)) -REGULAR_OBJ_LIST_CC := $(filter $(OBJ_LIST_CC),$(REGULAR_OBJ_LIST)) -REGULAR_OBJ_LIST_S := $(filter $(OBJ_LIST_S),$(REGULAR_OBJ_LIST)) -REGULAR_OBJ_LIST_SS := $(filter $(OBJ_LIST_SS),$(REGULAR_OBJ_LIST)) - -FLATTEN_SDIR_OBJ_LIST := $(filter ../%,$(SDIR_OBJ_LIST)) -FLATTEN_SDIR_APP_OBJS := $(addprefix $(CONFIG_OBJ_DIR)/,$(notdir $(FLATTEN_SDIR_OBJ_LIST))) - -REGULAR_SDIR_OBJ_LIST := $(filter-out $(FLATTEN_SDIR_OBJ_LIST),$(SDIR_OBJ_LIST)) -REGULAR_SDIR_OBJ_LIST_C := $(filter $(SDIR_OBJ_LIST_C),$(REGULAR_SDIR_OBJ_LIST)) -REGULAR_SDIR_OBJ_LIST_CPP := $(filter $(SDIR_OBJ_LIST_CPP),$(REGULAR_SDIR_OBJ_LIST)) -REGULAR_SDIR_OBJ_LIST_CXX := $(filter $(SDIR_OBJ_LIST_CXX),$(REGULAR_SDIR_OBJ_LIST)) -REGULAR_SDIR_OBJ_LIST_CC := $(filter $(SDIR_OBJ_LIST_CC),$(REGULAR_SDIR_OBJ_LIST)) -REGULAR_SDIR_OBJ_LIST_S := $(filter $(SDIR_OBJ_LIST_S),$(REGULAR_SDIR_OBJ_LIST)) -REGULAR_SDIR_OBJ_LIST_SS := $(filter $(SDIR_OBJ_LIST_SS),$(REGULAR_SDIR_OBJ_LIST)) - -VPATH := $(sort $(dir $(FLATTEN_OBJ_LIST)) $(dir $(FLATTEN_SDIR_OBJ_LIST))) - -APP_OBJS_C := $(addprefix $(CONFIG_OBJ_DIR)/,\ - $(REGULAR_SDIR_OBJ_LIST_C) \ - $(foreach s,$(REGULAR_OBJ_LIST_C),$(call adjust-path,$s))) - -APP_OBJS_CPP := $(addprefix $(CONFIG_OBJ_DIR)/,\ - $(REGULAR_SDIR_OBJ_LIST_CPP) \ - $(foreach s,$(REGULAR_OBJ_LIST_CPP),$(call adjust-path,$s))) - -APP_OBJS_CXX := $(addprefix $(CONFIG_OBJ_DIR)/,\ - $(REGULAR_SDIR_OBJ_LIST_CXX) \ - $(foreach s,$(REGULAR_OBJ_LIST_CXX),$(call adjust-path,$s))) - -APP_OBJS_CC := $(addprefix $(CONFIG_OBJ_DIR)/,\ - $(REGULAR_SDIR_OBJ_LIST_CC) \ - $(foreach s,$(REGULAR_OBJ_LIST_CC),$(call adjust-path,$s))) - -APP_OBJS_S := $(addprefix $(CONFIG_OBJ_DIR)/,\ - $(REGULAR_SDIR_OBJ_LIST_S) \ - $(foreach s,$(REGULAR_OBJ_LIST_S),$(call adjust-path,$s))) - -APP_OBJS_SS := $(addprefix $(CONFIG_OBJ_DIR)/,\ - $(REGULAR_SDIR_OBJ_LIST_SS) \ - $(foreach s,$(REGULAR_OBJ_LIST_SS),$(call adjust-path,$s))) - -APP_OBJS := $(APP_OBJS_C) $(APP_OBJS_CPP) $(APP_OBJS_CXX) $(APP_OBJS_CC) \ - $(APP_OBJS_S) $(APP_OBJS_SS) \ - $(FLATTEN_APP_OBJS) $(FLATTEN_SDIR_APP_OBJS) - -# Add any extra user-provided object files. -APP_OBJS += $(OBJS) - -# Create list of dependancy files for each object file. -APP_DEPS := $(APP_OBJS:.o=.d) - -# Patch the Elf file with system specific information - -# Patch the Elf with the name of the sopc system -ifneq ($(SOPC_NAME),) -ELF_PATCH_FLAG += --sopc_system_name $(SOPC_NAME) -endif - -# Patch the Elf with the absolute path to the Quartus Project Directory -ifneq ($(QUARTUS_PROJECT_DIR),) -ABS_QUARTUS_PROJECT_DIR := $(call adjust-path-mixed,$(shell cd "$(QUARTUS_PROJECT_DIR)"; pwd)) -ELF_PATCH_FLAG += --quartus_project_dir "$(ABS_QUARTUS_PROJECT_DIR)" -endif - -# Patch the Elf and download args with the JDI_FILE if specified -ifneq ($(wildcard $(JDI_FILE)),) -ELF_PATCH_FLAG += --jdi $(JDI_FILE) -DOWNLOAD_JDI_FLAG := --jdi $(JDI_FILE) -endif - -# Patch the Elf with the SOPCINFO_FILE if specified -ifneq ($(wildcard $(SOPCINFO_FILE)),) -ELF_PATCH_FLAG += --sopcinfo $(SOPCINFO_FILE) -endif - -# Use the DOWNLOAD_CABLE variable to specify which JTAG cable to use. -# This is not needed if you only have one cable. -ifneq ($(DOWNLOAD_CABLE),) -DOWNLOAD_CABLE_FLAG := --cable '$(DOWNLOAD_CABLE)' -endif - - -#------------------------------------------------------------------------------ -# BUILD PRE/POST PROCESS -#------------------------------------------------------------------------------ -build_pre_process : - $(BUILD_PRE_PROCESS) - -build_post_process : - $(BUILD_POST_PROCESS) - -.PHONY: build_pre_process build_post_process - - -#------------------------------------------------------------------------------ -# TOOLS -#------------------------------------------------------------------------------ - -# -# Set tool default variables if not already defined. -# If these are defined, they would typically be defined in an -# included makefile fragment. -# -ifeq ($(DEFAULT_CROSS_COMPILE),) -DEFAULT_CROSS_COMPILE := nios2-elf- -endif - -ifeq ($(DEFAULT_STACK_REPORT),) -DEFAULT_STACKREPORT := nios2-stackreport -endif - -ifeq ($(DEFAULT_DOWNLOAD),) -DEFAULT_DOWNLOAD := nios2-download -endif - -ifeq ($(DEFAULT_FLASHPROG),) -DEFAULT_FLASHPROG := nios2-flash-programmer -endif - -ifeq ($(DEFAULT_ELFPATCH),) -DEFAULT_ELFPATCH := nios2-elf-insert -endif - -ifeq ($(DEFAULT_RM),) -DEFAULT_RM := rm -f -endif - -ifeq ($(DEFAULT_CP),) -DEFAULT_CP := cp -f -endif - -ifeq ($(DEFAULT_MKDIR),) -DEFAULT_MKDIR := mkdir -p -endif - -# -# Set tool variables to defaults if not already defined. -# If these are defined, they would typically be defined by a -# setting in the generated portion of this makefile. -# -ifeq ($(CROSS_COMPILE),) -CROSS_COMPILE := $(DEFAULT_CROSS_COMPILE) -endif - -ifeq ($(origin CC),default) -CC := $(CROSS_COMPILE)gcc -xc -endif - -ifeq ($(origin CXX),default) -CXX := $(CROSS_COMPILE)gcc -xc++ -endif - -ifeq ($(origin AS),default) -AS := $(CROSS_COMPILE)gcc -endif - -ifeq ($(origin AR),default) -AR := $(CROSS_COMPILE)ar -endif - -ifeq ($(origin LD),default) -LD := $(CROSS_COMPILE)g++ -endif - -ifeq ($(origin NM),default) -NM := $(CROSS_COMPILE)nm -endif - -ifeq ($(origin RM),default) -RM := $(DEFAULT_RM) -endif - -ifeq ($(origin CP),default) -CP := $(DEFAULT_CP) -endif - -ifeq ($(OBJDUMP),) -OBJDUMP := $(CROSS_COMPILE)objdump -endif - -ifeq ($(OBJCOPY),) -OBJCOPY := $(CROSS_COMPILE)objcopy -endif - -ifeq ($(STACKREPORT),) -ifeq ($(CROSS_COMPILE),nios2-elf-) -STACKREPORT := $(DEFAULT_STACKREPORT) -else -DISABLE_STACKREPORT := 1 -endif -endif - -ifeq ($(DOWNLOAD),) -DOWNLOAD := $(DEFAULT_DOWNLOAD) -endif - -ifeq ($(FLASHPROG),) -FLASHPROG := $(DEFAULT_FLASHPROG) -endif - -ifeq ($(ELFPATCH),) -ELFPATCH := $(DEFAULT_ELFPATCH) -endif - -ifeq ($(MKDIR),) -MKDIR := $(DEFAULT_MKDIR) -endif - -#------------------------------------------------------------------------------ -# PATTERN RULES TO BUILD OBJECTS -#------------------------------------------------------------------------------ - -define compile.c -@$(ECHO) Info: Compiling $< to $@ -@$(MKDIR) $(@D) -$(CC) -MP -MMD -c $(APP_CPPFLAGS) $(APP_CFLAGS) -o $@ $< -$(CC_POST_PROCESS) -endef - -define compile.cpp -@$(ECHO) Info: Compiling $< to $@ -@$(MKDIR) $(@D) -$(CXX) -MP -MMD -c $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< -$(CXX_POST_PROCESS) -endef - -# If assembling with the compiler, ensure "-Wa," is prepended to all APP_ASFLAGS -ifeq ($(AS),$(patsubst %as,%,$(AS))) -COMMA := , -APP_ASFLAGS := $(filter-out $(APP_CFLAGS),$(addprefix -Wa$(COMMA),$(patsubst -Wa$(COMMA)%,%,$(APP_ASFLAGS)))) -endif - -define compile.s -@$(ECHO) Info: Assembling $< to $@ -@$(MKDIR) $(@D) -$(AS) -MP -MMD -c $(APP_CPPFLAGS) $(APP_CFLAGS) $(APP_ASFLAGS) -o $@ $< -$(AS_POST_PROCESS) -endef - -ifeq ($(MAKE_VERSION),3.81) -.SECONDEXPANSION: - -$(APP_OBJS_C): $(CONFIG_OBJ_DIR)/%.o: $$(call adjust-path-mixed,%.c) - $(compile.c) - -$(APP_OBJS_CPP): $(CONFIG_OBJ_DIR)/%.o: $$(call adjust-path-mixed,%.cpp) - $(compile.cpp) - -$(APP_OBJS_CC): $(CONFIG_OBJ_DIR)/%.o: $$(call adjust-path-mixed,%.cc) - $(compile.cpp) - -$(APP_OBJS_CXX): $(CONFIG_OBJ_DIR)/%.o: $$(call adjust-path-mixed,%.cxx) - $(compile.cpp) - -$(APP_OBJS_S): $(CONFIG_OBJ_DIR)/%.o: $$(call adjust-path-mixed,%.S) - $(compile.s) - -$(APP_OBJS_SS): $(CONFIG_OBJ_DIR)/%.o: $$(call adjust-path-mixed,%.s) - $(compile.s) - -endif # MAKE_VERSION != 3.81 - -$(CONFIG_OBJ_DIR)/%.o: %.c - $(compile.c) - -$(CONFIG_OBJ_DIR)/%.o: %.cpp - $(compile.cpp) - -$(CONFIG_OBJ_DIR)/%.o: %.cc - $(compile.cpp) - -$(CONFIG_OBJ_DIR)/%.o: %.cxx - $(compile.cpp) - -$(CONFIG_OBJ_DIR)/%.o: %.S - $(compile.s) - -$(CONFIG_OBJ_DIR)/%.o: %.s - $(compile.s) - - -#------------------------------------------------------------------------------ -# PATTERN RULES TO INTERMEDIATE FILES -#------------------------------------------------------------------------------ - -$(CONFIG_OBJ_DIR)/%.s: %.c - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CC) -S $(APP_CPPFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.s: %.cpp - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CXX) -S $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.s: %.cc - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CXX) -S $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.s: %.cxx - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CXX) -S $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.i: %.c - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CC) -E $(APP_CPPFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.i: %.cpp - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CXX) -E $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.i: %.cc - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CXX) -E $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.i: %.cxx - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CXX) -E $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< - - -#------------------------------------------------------------------------------ -# TARGET RULES -#------------------------------------------------------------------------------ - -.PHONY : help -help : - @$(ECHO) "Summary of Makefile targets" - @$(ECHO) " Build targets:" - @$(ECHO) " all (default) - Application and all libraries (including BSP)" - @$(ECHO) " bsp - Just the BSP" - @$(ECHO) " libs - All libraries (including BSP)" - @$(ECHO) " flash - All flash files" - @$(ECHO) " mem_init_generate - All memory initialization files" -ifeq ($(QSYS),1) - @$(ECHO) " mem_init_install - This target is deprecated for QSys Systems" - @$(ECHO) " --> Use the mem_init_generate target and then" - @$(ECHO) " add the generated meminit.qip file to your" - @$(ECHO) " Quartus II Project." -else # if QSYS != 1 - @$(ECHO) " mem_init_install - Copy memory initialization files to Quartus II project" -endif # QSYS == 1 - @$(ECHO) - @$(ECHO) " Clean targets:" - @$(ECHO) " clean_all - Application and all libraries (including BSP)" - @$(ECHO) " clean - Just the application" - @$(ECHO) " clean_bsp - Just the BSP" - @$(ECHO) " clean_libs - All libraries (including BSP)" - @$(ECHO) - @$(ECHO) " Run targets:" - @$(ECHO) " download-elf - Download and run your elf executable" - @$(ECHO) " program-flash - Program flash contents to the board" - -# Handy rule to skip making libraries and just make application. -.PHONY : app -app : $(ELF) - -ifeq ($(CREATE_OBJDUMP), 1) -app : $(OBJDUMP_NAME) -endif - -ifeq ($(CREATE_ELF_DERIVED_FILES),1) -app : elf_derived_files -endif - -.PHONY: elf_derived_files -elf_derived_files: default_mem_init - -# Handy rule for making just the BSP. -.PHONY : bsp -bsp : - @$(ECHO) Info: Building $(BSP_ROOT_DIR) - @$(MAKE) --no-print-directory -C $(BSP_ROOT_DIR) - - -# Make sure all makeable libraries (including the BSP) are up-to-date. -LIB_TARGETS := $(patsubst %,%-recurs-make-lib,$(MAKEABLE_LIBRARY_ROOT_DIRS)) - -.PHONY : libs -libs : $(LIB_TARGETS) - -ifneq ($(strip $(LIB_TARGETS)),) -$(LIB_TARGETS): %-recurs-make-lib: - @$(ECHO) Info: Building $* - $(MAKE) --no-print-directory -C $* -endif - -ifneq ($(strip $(APP_LDDEPS)),) -$(APP_LDDEPS): libs - @true -endif - -# Rules to force your project to rebuild or relink -# .force_relink file will cause any application that depends on this project to relink -# .force_rebuild file will cause this project to rebuild object files -# .force_rebuild_all file will cause this project and any project that depends on this project to rebuild object files - -FORCE_RELINK_DEP := .force_relink -FORCE_REBUILD_DEP := .force_rebuild -FORCE_REBUILD_ALL_DEP := .force_rebuild_all -FORCE_REBUILD_DEP_LIST := $(CONFIG_OBJ_DIR)/$(FORCE_RELINK_DEP) $(CONFIG_OBJ_DIR)/$(FORCE_REBUILD_DEP) $(FORCE_REBUILD_ALL_DEP) - -$(FORCE_REBUILD_DEP_LIST): - -$(APP_OBJS): $(wildcard $(CONFIG_OBJ_DIR)/$(FORCE_REBUILD_DEP)) $(wildcard $(addsuffix /$(FORCE_REBUILD_ALL_DEP), . $(ALT_LIBRARY_DIRS))) - -$(ELF): $(wildcard $(addsuffix /$(FORCE_RELINK_DEP), $(CONFIG_OBJ_DIR) $(ALT_LIBRARY_DIRS))) - - -# Clean just the application. -.PHONY : clean -ifeq ($(CREATE_ELF_DERIVED_FILES),1) -clean : clean_elf_derived_files -endif - -clean : - @$(RM) -r $(ELF) $(OBJDUMP_NAME) $(LINKER_MAP_NAME) $(OBJ_ROOT_DIR) $(RUNTIME_ROOT_DIR) $(FORCE_REBUILD_DEP_LIST) - @$(ECHO) [$(APP_NAME) clean complete] - -# Clean just the BSP. -.PHONY : clean_bsp -clean_bsp : - @$(ECHO) Info: Cleaning $(BSP_ROOT_DIR) - @$(MAKE) --no-print-directory -C $(BSP_ROOT_DIR) clean - -# Clean all makeable libraries including the BSP. -LIB_CLEAN_TARGETS := $(patsubst %,%-recurs-make-clean-lib,$(MAKEABLE_LIBRARY_ROOT_DIRS)) - -.PHONY : clean_libs -clean_libs : $(LIB_CLEAN_TARGETS) - -ifneq ($(strip $(LIB_CLEAN_TARGETS)),) -$(LIB_CLEAN_TARGETS): %-recurs-make-clean-lib: - @$(ECHO) Info: Cleaning $* - $(MAKE) --no-print-directory -C $* clean -endif - -.PHONY: clean_elf_derived_files -clean_elf_derived_files: mem_init_clean - -# Clean application and all makeable libraries including the BSP. -.PHONY : clean_all -clean_all : clean mem_init_clean clean_libs - -# Include the dependency files unless the make goal is performing a clean -# of the application. -ifneq ($(firstword $(MAKECMDGOALS)),clean) -ifneq ($(firstword $(MAKECMDGOALS)),clean_all) --include $(APP_DEPS) -endif -endif - -.PHONY : download-elf -download-elf : $(ELF) - @if [ "$(DOWNLOAD)" = "none" ]; \ - then \ - $(ECHO) Downloading $(ELF) not supported; \ - else \ - $(ECHO) Info: Downloading $(ELF); \ - $(DOWNLOAD) --go --cpu_name=$(CPU_NAME) $(DOWNLOAD_CABLE_FLAG) $(SOPC_SYSID_FLAG) $(DOWNLOAD_JDI_FLAG) $(WRITE_GMON_OPTION) $(ELF); \ - fi - -# Delete the target of a rule if it has changed and its commands exit -# with a nonzero exit status. -.DELETE_ON_ERROR: - -# Rules for flash programming commands -PROGRAM_FLASH_SUFFIX := -program -PROGRAM_FLASH_TARGET := $(addsuffix $(PROGRAM_FLASH_SUFFIX), $(FLASH_FILES)) - -.PHONY : program-flash -program-flash : $(PROGRAM_FLASH_TARGET) - -.PHONY : $(PROGRAM_FLASH_TARGET) -$(PROGRAM_FLASH_TARGET) : flash - @if [ "$(FLASHPROG)" = "none" ]; \ - then \ - $(ECHO) Programming flash not supported; \ - else \ - $(ECHO) Info: Programming $(basename $@).flash; \ - if [ -z "$($(basename $@)_EPCS_FLAGS)" ]; \ - then \ - $(ECHO) $(FLASHPROG) $(SOPC_SYSID_FLAG) --base=$($(basename $@)_START) $(basename $@).flash; \ - $(FLASHPROG) $(DOWNLOAD_CABLE_FLAG) $(SOPC_SYSID_FLAG) --base=$($(basename $@)_START) $(basename $@).flash; \ - else \ - $(ECHO) $(FLASHPROG) $(SOPC_SYSID_FLAG) --epcs --base=$($(basename $@)_START) $(basename $@).flash; \ - $(FLASHPROG) $(DOWNLOAD_CABLE_FLAG) $(SOPC_SYSID_FLAG) --epcs --base=$($(basename $@)_START) $(basename $@).flash; \ - fi \ - fi - - -# Rules for simulating with an HDL Simulator [QSYS only] -ifeq ($(QSYS),1) -IP_MAKE_SIMSCRIPT := ip-make-simscript - -ifeq ($(VSIM),) -VSIM_EXE := "$(if $(VSIM_DIR),$(VSIM_DIR)/,)vsim" -ifeq ($(ENABLE_VSIM_GUI),1) -VSIM := $(VSIM_EXE) -gui -else -VSIM := $(VSIM_EXE) -c -endif # ENABLE_VSIM_GUI == 1 -endif # VSIM not set - -ifeq ($(SPD),) -ifneq ($(ABS_QUARTUS_PROJECT_DIR),) -ifneq ($(SOPC_NAME),) -SPD := $(ABS_QUARTUS_PROJECT_DIR)/$(SOPC_NAME)_tb.spd -endif # SOPC_NAME set -endif # ABS_QUARTUS_PROJECT_DIR set -endif # SPD == empty string - -ifeq ($(MSIM_SCRIPT),) -SIM_SCRIPT_DIR := $(RUNTIME_ROOT_DIR)/sim -MSIM_SCRIPT := $(SIM_SCRIPT_DIR)/mentor/msim_setup.tcl -endif # MSIM_SCRIPT == empty string - -ifeq ($(MAKE_VERSION),3.81) -ABS_MEM_INIT_DESCRIPTOR_FILE := $(abspath $(MEM_INIT_DESCRIPTOR_FILE)) -else -ABS_MEM_INIT_DESCRIPTOR_FILE := $(call adjust-path-mixed,$(shell pwd))/$(MEM_INIT_DESCRIPTOR_FILE) -endif - -$(MSIM_SCRIPT): $(SPD) $(MEM_INIT_DESCRIPTOR_FILE) -ifeq ($(SPD),) - $(error No SPD file specified. Ensure QUARTUS_PROJECT_DIR variable is set) -endif - @$(MKDIR) $(SIM_SCRIPT_DIR) - $(IP_MAKE_SIMSCRIPT) --spd=$(SPD) --spd=$(MEM_INIT_DESCRIPTOR_FILE) --output-directory=$(SIM_SCRIPT_DIR) - -VSIM_COMMAND = \ - cd $(dir $(MSIM_SCRIPT)) && \ - $(VSIM) -do "do $(notdir $(MSIM_SCRIPT)); ld; $(if $(VSIM_RUN_TIME),run ${VSIM_RUN_TIME};quit;)" - -.PHONY: sim -sim: $(MSIM_SCRIPT) mem_init_generate -ifeq ($(MSIM_SCRIPT),) - $(error MSIM_SCRIPT not set) -endif - $(VSIM_COMMAND) - -endif # QSYS == 1 - - -#------------------------------------------------------------------------------ -# ELF TARGET RULE -#------------------------------------------------------------------------------ -# Rule for constructing the executable elf file. -$(ELF) : $(APP_OBJS) $(LINKER_SCRIPT) $(APP_LDDEPS) - @$(ECHO) Info: Linking $@ - $(LD) $(APP_LDFLAGS) $(APP_CFLAGS) -o $@ $(filter-out $(CRT0),$(APP_OBJS)) $(APP_LIBS) $(APP_BSP_DEP_LIBS) -ifneq ($(DISABLE_ELFPATCH),1) - $(ELFPATCH) $@ $(ELF_PATCH_FLAG) -endif -ifneq ($(DISABLE_STACKREPORT),1) - @bash -c "$(STACKREPORT) $@" -endif - -$(OBJDUMP_NAME) : $(ELF) - @$(ECHO) Info: Creating $@ - $(OBJDUMP) $(OBJDUMP_FLAGS) $< >$@ - -# Rule for printing the name of the elf file -.PHONY: print-elf-name -print-elf-name: - @$(ECHO) $(ELF) - - diff --git a/software/qsys_tutorial/create-this-app b/software/qsys_tutorial/create-this-app deleted file mode 100644 index fb17597..0000000 --- a/software/qsys_tutorial/create-this-app +++ /dev/null @@ -1,114 +0,0 @@ -#!/bin/bash -# -# This script creates the hello_world application in this directory. - - -BSP_DIR=../qsys_tutorial_bsp -QUARTUS_PROJECT_DIR=../../ -NIOS2_APP_GEN_ARGS="--elf-name qsys_tutorial.elf --set OBJDUMP_INCLUDE_SOURCE 1 --src-files hello_world.c" - - -# First, check to see if $SOPC_KIT_NIOS2 environmental variable is set. -# This variable is required for the command line tools to execute correctly. -if [ -z "${SOPC_KIT_NIOS2}" ] -then - echo Required \$SOPC_KIT_NIOS2 Environmental Variable is not set! - exit 1 -fi - - -# Also make sure that the APP has not been created already. Check for -# existence of Makefile in the app directory -if [ -f ./Makefile ] -then - echo Application has already been created! Delete Makefile if you want to create a new application makefile - exit 1 -fi - - -# We are selecting hal_default bsp because it supports this application. -# Check to see if the hal_default has already been generated by checking for -# existence of the public.mk file. If not, we need to run -# create-this-bsp file to generate the bsp. -if [ ! -f ${BSP_DIR}/public.mk ]; then - # Since BSP doesn't exist, create the BSP - # Pass any command line arguments passed to this script to the BSP. - pushd ${BSP_DIR} >> /dev/null - ./create-this-bsp "$@" || { - echo "create-this-bsp failed" - exit 1 - } - popd >> /dev/null -fi - - -# Don't run make if create-this-app script is called with --no-make arg -SKIP_MAKE= -while [ $# -gt 0 ] -do - case "$1" in - --no-make) - SKIP_MAKE=1 - ;; - esac - shift -done - - -# Now we also need to go copy the sources for this application to the -# local directory. -find "${SOPC_KIT_NIOS2}/examples/software/hello_world/" -name '*.c' -or -name '*.h' -or -name 'hostfs*' | xargs -i cp -L {} ./ || { - echo "failed during copying example source files" - exit 1 -} - -find "${SOPC_KIT_NIOS2}/examples/software/hello_world/" -name 'readme.txt' -or -name 'Readme.txt' | xargs -i cp -L {} ./ || { - echo "failed copying readme file" -} - -if [ -d "${SOPC_KIT_NIOS2}/examples/software/hello_world/system" ] -then - cp -RL "${SOPC_KIT_NIOS2}/examples/software/hello_world/system" . || { - echo "failed during copying project support files" - exit 1 - } -fi - -chmod -R +w . || { - echo "failed during changing file permissions" - exit 1 -} - -cmd="nios2-app-generate-makefile --bsp-dir ${BSP_DIR} --set QUARTUS_PROJECT_DIR=${QUARTUS_PROJECT_DIR} ${NIOS2_APP_GEN_ARGS}" - -echo "create-this-app: Running \"${cmd}\"" -$cmd || { - echo "nios2-app-generate-makefile failed" - exit 1 -} - -if [ -z "$SKIP_MAKE" ]; then - cmd="make" - - echo "create-this-app: Running \"$cmd\"" - $cmd || { - echo "make failed" - exit 1 - } - - echo - echo "To download and run the application:" - echo " 1. Make sure the board is connected to the system." - echo " 2. Run 'nios2-configure-sof ' to configure the FPGA with the hardware design." - echo " 3. If you have a stdio device, run 'nios2-terminal' in a different shell." - echo " 4. Run 'make download-elf' from the application directory." - echo - echo "To debug the application:" - echo " Import the project into Nios II Software Build Tools for Eclipse." - echo " Refer to Nios II Software Build Tools for Eclipse Documentation for more information." - echo - echo -e "" -fi - - -exit 0 diff --git a/software/qsys_tutorial/obj/default/.force_relink b/software/qsys_tutorial/obj/default/.force_relink deleted file mode 100644 index e69de29..0000000 --- a/software/qsys_tutorial/obj/default/.force_relink +++ /dev/null diff --git a/software/qsys_tutorial/obj/default/hello_world.d b/software/qsys_tutorial/obj/default/hello_world.d deleted file mode 100644 index 730c57b..0000000 --- a/software/qsys_tutorial/obj/default/hello_world.d +++ /dev/null @@ -1,6 +0,0 @@ -obj/default/hello_world.o: hello_world.c ../qsys_tutorial_bsp/system.h \ - ../qsys_tutorial_bsp/linker.h - -../qsys_tutorial_bsp/system.h: - -../qsys_tutorial_bsp/linker.h: diff --git a/software/qsys_tutorial/obj/default/hello_world.o b/software/qsys_tutorial/obj/default/hello_world.o deleted file mode 100644 index da41161..0000000 --- a/software/qsys_tutorial/obj/default/hello_world.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial/readme.txt b/software/qsys_tutorial/readme.txt deleted file mode 100644 index 7d0742f..0000000 --- a/software/qsys_tutorial/readme.txt +++ /dev/null @@ -1,26 +0,0 @@ -Readme - Hello World Software Example - -DESCRIPTION: -Simple program that prints "Hello from Nios II" - -The memory footprint of this hosted application is intended to be small (under 100 kbytes) by default -using a standard reference deisgn. - -For an even smaller, reduced footprint version of this template, and an explanation of how -to reduce the memory footprint for a given application, see the -"small_hello_world" template. - - -PERIPHERALS USED: -This example exercises the following peripherals: -- STDOUT device (UART or JTAG UART) - -SOFTWARE SOURCE FILES: -This example includes the following software source files: -- hello_world.c: Everyone needs a Hello World program, right? - -BOARD/HOST REQUIREMENTS: -This example requires only a JTAG connection with a Nios Development board. If -the host communication settings are changed from JTAG UART (default) to use a -conventional UART, a serial cable between board DB-9 connector and the host is -required. diff --git a/software/qsys_tutorial_bsp/.cproject b/software/qsys_tutorial_bsp/.cproject deleted file mode 100644 index cad0737..0000000 --- a/software/qsys_tutorial_bsp/.cproject +++ /dev/null @@ -1,481 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/software/qsys_tutorial_bsp/.project b/software/qsys_tutorial_bsp/.project deleted file mode 100644 index cda4152..0000000 --- a/software/qsys_tutorial_bsp/.project +++ /dev/null @@ -1,85 +0,0 @@ - - - qsys_tutorial_bsp - - - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - ?name? - - - - org.eclipse.cdt.make.core.append_environment - true - - - org.eclipse.cdt.make.core.autoBuildTarget - all - - - org.eclipse.cdt.make.core.buildArguments - - - - org.eclipse.cdt.make.core.buildCommand - make - - - org.eclipse.cdt.make.core.buildLocation - ${workspace_loc://qsys_tutorial_bsp} - - - org.eclipse.cdt.make.core.cleanBuildTarget - clean - - - org.eclipse.cdt.make.core.contents - org.eclipse.cdt.make.core.activeConfigSettings - - - org.eclipse.cdt.make.core.enableAutoBuild - false - - - org.eclipse.cdt.make.core.enableCleanBuild - true - - - org.eclipse.cdt.make.core.enableFullBuild - true - - - org.eclipse.cdt.make.core.fullBuildTarget - all - - - org.eclipse.cdt.make.core.stopOnError - true - - - org.eclipse.cdt.make.core.useDefaultBuildCmd - true - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - org.eclipse.cdt.core.ccnature - com.altera.sbtgui.project.SBTGUINature - com.altera.sbtgui.project.SBTGUIBspNature - - diff --git a/software/qsys_tutorial_bsp/HAL/inc/alt_types.h b/software/qsys_tutorial_bsp/HAL/inc/alt_types.h deleted file mode 100644 index d02f171..0000000 --- a/software/qsys_tutorial_bsp/HAL/inc/alt_types.h +++ /dev/null @@ -1,54 +0,0 @@ -#ifndef __ALT_TYPES_H__ -#define __ALT_TYPES_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/* - * Don't declare these typedefs if this file is included by assembly source. - */ -#ifndef ALT_ASM_SRC -typedef signed char alt_8; -typedef unsigned char alt_u8; -typedef signed short alt_16; -typedef unsigned short alt_u16; -typedef signed long alt_32; -typedef unsigned long alt_u32; -typedef long long alt_64; -typedef unsigned long long alt_u64; -#endif - -#define ALT_INLINE __inline__ -#define ALT_ALWAYS_INLINE __attribute__ ((always_inline)) -#define ALT_WEAK __attribute__((weak)) - -#endif /* __ALT_TYPES_H__ */ diff --git a/software/qsys_tutorial_bsp/HAL/inc/altera_nios2_qsys_irq.h b/software/qsys_tutorial_bsp/HAL/inc/altera_nios2_qsys_irq.h deleted file mode 100644 index 6629ec9..0000000 --- a/software/qsys_tutorial_bsp/HAL/inc/altera_nios2_qsys_irq.h +++ /dev/null @@ -1,80 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * Support for the Nios II internal interrupt controller. - */ - -#ifndef __ALT_NIOS2_QSYS_IRQ_H__ -#define __ALT_NIOS2_QSYS_IRQ_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The macro ALTERA_NIOS2_IRQ_INSTANCE is used by the alt_irq_init() - * function in the auto-generated file alt_sys_init.c to create an - * instance of this interrupt controller device driver state if this - * module contains an interrupt controller. - * Only one instance of a Nios II is allowed so this macro is just empty. - */ - -#define ALTERA_NIOS2_QSYS_IRQ_INSTANCE(name, state) - -/* - * altera_nios2_irq_init() is called by the auto-generated function - * alt_irq_init() once for the Nios II if it contains an interrupt controller. - * The altera_nios2_irq_init() routine is called using the - * ALTERA_NIOS2_IRQ_INIT macro given below. - * - * This function initializes the internal interrupt controller - * so is not called if the Nios II contains an external interrupt - * controller port (because the internal interrupt controller - * is removed if this port is present). - */ - -extern void altera_nios2_qsys_irq_init( void ); - -/* - * The macro ALTERA_NIOS2_IRQ_INIT is used by the alt_irq_init() routine - * in the auto-generated file alt_sys_init.c to initialize an instance - * of the interrupt controller device driver state. - */ - -#define ALTERA_NIOS2_QSYS_IRQ_INIT(name, state) altera_nios2_qsys_irq_init() - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_NIOS2_QSYS_IRQ_H__ */ - diff --git a/software/qsys_tutorial_bsp/HAL/inc/io.h b/software/qsys_tutorial_bsp/HAL/inc/io.h deleted file mode 100644 index 362f103..0000000 --- a/software/qsys_tutorial_bsp/HAL/inc/io.h +++ /dev/null @@ -1,81 +0,0 @@ -#ifndef __IO_H__ -#define __IO_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/* IO Header file for Nios II Toolchain */ - -#include "alt_types.h" -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#ifndef SYSTEM_BUS_WIDTH -#error SYSTEM_BUS_WIDTH undefined -#endif - -/* Dynamic bus access functions */ - -#define __IO_CALC_ADDRESS_DYNAMIC(BASE, OFFSET) \ - ((void *)(((alt_u8*)BASE) + (OFFSET))) - -#define IORD_32DIRECT(BASE, OFFSET) \ - __builtin_ldwio (__IO_CALC_ADDRESS_DYNAMIC ((BASE), (OFFSET))) -#define IORD_16DIRECT(BASE, OFFSET) \ - __builtin_ldhuio (__IO_CALC_ADDRESS_DYNAMIC ((BASE), (OFFSET))) -#define IORD_8DIRECT(BASE, OFFSET) \ - __builtin_ldbuio (__IO_CALC_ADDRESS_DYNAMIC ((BASE), (OFFSET))) - -#define IOWR_32DIRECT(BASE, OFFSET, DATA) \ - __builtin_stwio (__IO_CALC_ADDRESS_DYNAMIC ((BASE), (OFFSET)), (DATA)) -#define IOWR_16DIRECT(BASE, OFFSET, DATA) \ - __builtin_sthio (__IO_CALC_ADDRESS_DYNAMIC ((BASE), (OFFSET)), (DATA)) -#define IOWR_8DIRECT(BASE, OFFSET, DATA) \ - __builtin_stbio (__IO_CALC_ADDRESS_DYNAMIC ((BASE), (OFFSET)), (DATA)) - -/* Native bus access functions */ - -#define __IO_CALC_ADDRESS_NATIVE(BASE, REGNUM) \ - ((void *)(((alt_u8*)BASE) + ((REGNUM) * (SYSTEM_BUS_WIDTH/8)))) - -#define IORD(BASE, REGNUM) \ - __builtin_ldwio (__IO_CALC_ADDRESS_NATIVE ((BASE), (REGNUM))) -#define IOWR(BASE, REGNUM, DATA) \ - __builtin_stwio (__IO_CALC_ADDRESS_NATIVE ((BASE), (REGNUM)), (DATA)) - -#ifdef __cplusplus -} -#endif - -#endif /* __IO_H__ */ diff --git a/software/qsys_tutorial_bsp/HAL/inc/nios2.h b/software/qsys_tutorial_bsp/HAL/inc/nios2.h deleted file mode 100644 index 72cefba..0000000 --- a/software/qsys_tutorial_bsp/HAL/inc/nios2.h +++ /dev/null @@ -1,230 +0,0 @@ -#ifndef __NIOS2_H__ -#define __NIOS2_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2008 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * This header provides processor specific macros for accessing the Nios2 - * control registers. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * Macros for accessing selected processor registers - */ - -#define NIOS2_READ_ET(et) \ - do { __asm ("mov %0, et" : "=r" (et) ); } while (0) - -#define NIOS2_WRITE_ET(et) \ - do { __asm volatile ("mov et, %z0" : : "rM" (et)); } while (0) - -#define NIOS2_READ_SP(sp) \ - do { __asm ("mov %0, sp" : "=r" (sp) ); } while (0) - -/* - * Macros for useful processor instructions - */ - -#define NIOS2_BREAK() \ - do { __asm volatile ("break"); } while (0) - -#define NIOS2_REPORT_STACK_OVERFLOW() \ - do { __asm volatile("break 3"); } while (0) - -/* - * Macros for accessing the control registers. - */ - -#define NIOS2_READ_STATUS(dest) \ - do { dest = __builtin_rdctl(0); } while (0) - -#define NIOS2_WRITE_STATUS(src) \ - do { __builtin_wrctl(0, src); } while (0) - -#define NIOS2_READ_ESTATUS(dest) \ - do { dest = __builtin_rdctl(1); } while (0) - -#define NIOS2_READ_BSTATUS(dest) \ - do { dest = __builtin_rdctl(2); } while (0) - -#define NIOS2_READ_IENABLE(dest) \ - do { dest = __builtin_rdctl(3); } while (0) - -#define NIOS2_WRITE_IENABLE(src) \ - do { __builtin_wrctl(3, src); } while (0) - -#define NIOS2_READ_IPENDING(dest) \ - do { dest = __builtin_rdctl(4); } while (0) - -#define NIOS2_READ_CPUID(dest) \ - do { dest = __builtin_rdctl(5); } while (0) - - -/* - * Macros for accessing extra exception registers. These - * are always enabled wit the MPU or MMU, and optionally - * with other advanced exception types/ - */ -#define NIOS2_READ_EXCEPTION(dest) \ - do { dest = __builtin_rdctl(7); } while (0) - -#define NIOS2_READ_BADADDR(dest) \ - do { dest = __builtin_rdctl(12); } while (0) - - -/* - * Macros for accessing control registers for MPU - * operation. These should not be used unless the - * MPU is enabled. - * - * The config register may be augmented for future - * enhancements. For now, only MPU support is provided. - */ -/* Config register */ -#define NIOS2_WRITE_CONFIG(src) \ - do { __builtin_wrctl(13, src); } while (0) - -#define NIOS2_READ_CONFIG(dest) \ - do { dest = __builtin_rdctl(13); } while (0) - -/* MPU Base Address Register */ -#define NIOS2_WRITE_MPUBASE(src) \ - do { __builtin_wrctl(14, src); } while (0) - -#define NIOS2_READ_MPUBASE(dest) \ - do { dest = __builtin_rdctl(14); } while (0) - -/* MPU Access Register */ -#define NIOS2_WRITE_MPUACC(src) \ - do { __builtin_wrctl(15, src); } while (0) - -#define NIOS2_READ_MPUACC(dest) \ - do { dest = __builtin_rdctl(15); } while (0) - - -/* - * Nios II control registers that are always present - */ -#define NIOS2_STATUS status -#define NIOS2_ESTATUS estatus -#define NIOS2_BSTATUS bstatus -#define NIOS2_IENABLE ienable -#define NIOS2_IPENDING ipending -#define NIOS2_CPUID cpuid - -/* - * STATUS, BSTATUS, ESTATUS, and SSTATUS fields. - * The presence of fields is a function of the Nios II configuration. - */ -#define NIOS2_STATUS_PIE_MSK (0x00000001) -#define NIOS2_STATUS_PIE_OFST (0) -#define NIOS2_STATUS_U_MSK (0x00000002) -#define NIOS2_STATUS_U_OFST (1) -#define NIOS2_STATUS_EH_MSK (0x00000004) -#define NIOS2_STATUS_EH_OFST (2) -#define NIOS2_STATUS_IH_MSK (0x00000008) -#define NIOS2_STATUS_IH_OFST (3) -#define NIOS2_STATUS_IL_MSK (0x000003f0) -#define NIOS2_STATUS_IL_OFST (4) -#define NIOS2_STATUS_CRS_MSK (0x0000fc00) -#define NIOS2_STATUS_CRS_OFST (10) -#define NIOS2_STATUS_PRS_MSK (0x003f0000) -#define NIOS2_STATUS_PRS_OFST (16) -#define NIOS2_STATUS_NMI_MSK (0x00400000) -#define NIOS2_STATUS_NMI_OFST (22) -#define NIOS2_STATUS_RSIE_MSK (0x00800000) -#define NIOS2_STATUS_RSIE_OFST (23) -#define NIOS2_STATUS_SRS_MSK (0x80000000) -#define NIOS2_STATUS_SRS_OFST (31) - -/* - * Bit masks & offsets available with extra exceptions support - */ - -/* Exception register */ -#define NIOS2_EXCEPTION_REG_CAUSE_MASK (0x0000007c) -#define NIOS2_EXCEPTION_REG_CAUSE_OFST (2) - -/* - * Bit masks & offsets for MPU support - * - * All bit-masks are expressed relative to the position - * of the data with a register. To read data that is LSB- - * aligned, the register read data should be masked, then - * right-shifted by the designated "OFST" macro value. The - * opposite should be used for register writes when starting - * with LSB-aligned data. - */ - -/* Config register */ -#define NIOS2_CONFIG_REG_PE_MASK (0x00000001) -#define NIOS2_CONFIG_REG_PE_OFST (0) -#define NIOS2_CONFIG_REG_ANI_MASK (0x00000002) -#define NIOS2_CONFIG_REG_ANI_OFST (1) - -/* MPU Base Address Register */ -#define NIOS2_MPUBASE_D_MASK (0x00000001) -#define NIOS2_MPUBASE_D_OFST (0) -#define NIOS2_MPUBASE_INDEX_MASK (0x0000003e) -#define NIOS2_MPUBASE_INDEX_OFST (1) -#define NIOS2_MPUBASE_BASE_ADDR_MASK (0xffffffc0) -#define NIOS2_MPUBASE_BASE_ADDR_OFST (6) - -/* MPU Access Register */ -#define NIOS2_MPUACC_LIMIT_MASK (0xffffffc0) -#define NIOS2_MPUACC_LIMIT_OFST (6) -#define NIOS2_MPUACC_MASK_MASK (0xffffffc0) -#define NIOS2_MPUACC_MASK_OFST (6) -#define NIOS2_MPUACC_C_MASK (0x00000020) -#define NIOS2_MPUACC_C_OFST (5) -#define NIOS2_MPUACC_PERM_MASK (0x0000001c) -#define NIOS2_MPUACC_PERM_OFST (2) -#define NIOS2_MPUACC_RD_MASK (0x00000002) -#define NIOS2_MPUACC_RD_OFST (1) -#define NIOS2_MPUACC_WR_MASK (0x00000001) -#define NIOS2_MPUACC_WR_OFST (0) - -/* - * Number of available IRQs in internal interrupt controller. - */ -#define NIOS2_NIRQ 32 - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __NIOS2_H__ */ diff --git a/software/qsys_tutorial_bsp/HAL/inc/os/alt_flag.h b/software/qsys_tutorial_bsp/HAL/inc/os/alt_flag.h deleted file mode 100644 index b9b4605..0000000 --- a/software/qsys_tutorial_bsp/HAL/inc/os/alt_flag.h +++ /dev/null @@ -1,98 +0,0 @@ -#ifndef __ALT_FLAG_H__ -#define __ALT_FLAG_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * This header provides macro definitions that can be used to create and use - * uc/OS-II style event flags. These macros can be used in both a uC/OS-II based - * environment, and a single threaded HAL based environment. - * - * The motivation for these macros is to allow code to be developed which is - * thread safe under uC/OS-II, but incurs no additional overhead when used in a - * single threaded HAL environment. - * - * In the case of a single threaded HAL environment, they compile to - * "do nothing" directives, which ensures they do not contribute to the final - * executable. - * - * The following macros are available: - * - * ALT_FLAG_GRP - Create a flag group instance. - * ALT_EXTERN_FLAG_GRP - Create a reference to an external flag group instance. - * ALT_STATIC_FLAG_GRP - Create a static flag group instance. - * ALT_FLAG_CREATE - Initialise a flag group. - * ALT_FLAG_PEND - Pend on a flag group. - * ALT_FLAG_POST - Set a flag condition. - - * - * Input arguments and return codes are all consistant with the equivalent - * uC/OS-II function. - * - * It's important to be careful in the use of the macros: ALT_FLAG_GRP, - * ALT_EXTERN_FLAG_GRP, and ALT_STATIC_FLAG_GRP. In these three cases the - * semi-colon is included in the macro definition; so, for example, you should - * use: - * - * ALT_FLAG_GRP(mygroup) - * - * not: - * - * ALT_FLAG_GRP(mygroup); - * - * The inclusion of the semi-colon has been necessary to ensure the macros can - * compile with no warnings when used in a single threaded HAL environment. - * - */ - -#include "priv/alt_no_error.h" - -#define ALT_FLAG_GRP(group) -#define ALT_EXTERN_FLAG_GRP(group) -#define ALT_STATIC_FLAG_GRP(group) - -#define ALT_FLAG_CREATE(group, flags) alt_no_error () -#define ALT_FLAG_PEND(group, flags, wait_type, timeout) alt_no_error () -#define ALT_FLAG_POST(group, flags, opt) alt_no_error () - -#ifndef ALT_SINGLE_THREADED -#define ALT_SINGLE_THREADED -#endif - -#endif /* __ALT_FLAG_H__ */ diff --git a/software/qsys_tutorial_bsp/HAL/inc/os/alt_hooks.h b/software/qsys_tutorial_bsp/HAL/inc/os/alt_hooks.h deleted file mode 100644 index 9054e3f..0000000 --- a/software/qsys_tutorial_bsp/HAL/inc/os/alt_hooks.h +++ /dev/null @@ -1,61 +0,0 @@ -#ifndef __ALT_HOOKS_H__ -#define __ALT_HOOKS_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * This header provides "do-nothing" macro definitions for operating system - * hooks within the HAL. The O/S component can override these to provide it's - * own implementation. - */ - -#define ALT_OS_TIME_TICK() while(0) -#define ALT_OS_INIT() while(0) -#define ALT_OS_STOP() while(0) - -/* Call from assembly code */ -#define ALT_OS_INT_ENTER_ASM -#define ALT_OS_INT_EXIT_ASM - -/* Call from C code */ -#define ALT_OS_INT_ENTER() while(0) -#define ALT_OS_INT_EXIT() while(0) - - -#endif /* __ALT_HOOKS_H__ */ diff --git a/software/qsys_tutorial_bsp/HAL/inc/os/alt_sem.h b/software/qsys_tutorial_bsp/HAL/inc/os/alt_sem.h deleted file mode 100644 index 753943e..0000000 --- a/software/qsys_tutorial_bsp/HAL/inc/os/alt_sem.h +++ /dev/null @@ -1,96 +0,0 @@ -#ifndef __ALT_SEM_H__ -#define __ALT_SEM_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * This header provides macro definitions that can be used to create and use - * semaphores. These macros can be used in both a uC/OS-II based environment, - * and a single threaded HAL based environment. - * - * The motivation for these macros is to allow code to be developed which is - * thread safe under uC/OS-II, but incurs no additional overhead when used in a - * single threaded HAL environment. - * - * In the case of a single threaded HAL environment, they compile to - * "do nothing" directives, which ensures they do not contribute to the final - * executable. - * - * The following macros are available: - * - * ALT_SEM - Create a semaphore instance. - * ALT_EXTERN_SEM - Create a reference to an external semaphore instance. - * ALT_STATIC_SEM - Create a static semaphore instance. - * ALT_SEM_CREATE - Initialise a semaphore. - * ALT_SEM_PEND - Pend on a semaphore. - * ALT_SEM_POST - Increment a semaphore. - * - * Input arguments and return codes are all consistant with the equivalent - * uC/OS-II function. - * - * It's important to be careful in the use of the macros: ALT_SEM, - * ALT_EXTERN_SEM, and ALT_STATIC_SEM. In these three cases the semi-colon is - * included in the macro definition; so, for example, you should use: - * - * ALT_SEM(mysem) - * - * not: - * - * ALT_SEM(mysem); - * - * The inclusion of the semi-colon has been necessary to ensure the macros can - * compile with no warnings when used in a single threaded HAL environment. - * - */ - -#include "priv/alt_no_error.h" - -#define ALT_SEM(sem) -#define ALT_EXTERN_SEM(sem) -#define ALT_STATIC_SEM(sem) - -#define ALT_SEM_CREATE(sem, value) alt_no_error () -#define ALT_SEM_PEND(sem, timeout) alt_no_error () -#define ALT_SEM_POST(sem) alt_no_error () - -#ifndef ALT_SINGLE_THREADED -#define ALT_SINGLE_THREADED -#endif - -#endif /* __ALT_SEM_H__ */ diff --git a/software/qsys_tutorial_bsp/HAL/inc/os/alt_syscall.h b/software/qsys_tutorial_bsp/HAL/inc/os/alt_syscall.h deleted file mode 100644 index 507c6aa..0000000 --- a/software/qsys_tutorial_bsp/HAL/inc/os/alt_syscall.h +++ /dev/null @@ -1,75 +0,0 @@ -#ifndef __ALT_SYSCALL_H__ -#define __ALT_SYSCALL_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * The macros defined in this file are used to provide the function names used - * for the HAL 'UNIX style' interface, e.g. read(), write() etc. - * - * Operating systems which are ported to the HAL can provide their own - * version of this file, which will be used in preference. This allows - * the operating system to provide it's own implementation of the top level - * system calls, while retaining the HAL functions under a different name, - * for example, alt_read(), alt_write() etc. - */ - -#define ALT_CLOSE close -#define ALT_ENVIRON environ -#define ALT_EXECVE execve -#define ALT_EXIT _exit -#define ALT_FCNTL fcntl -#define ALT_FORK fork -#define ALT_FSTAT fstat -#define ALT_GETPID getpid -#define ALT_GETTIMEOFDAY gettimeofday -#define ALT_IOCTL ioctl -#define ALT_ISATTY isatty -#define ALT_KILL kill -#define ALT_LINK link -#define ALT_LSEEK lseek -#define ALT_OPEN open -#define ALT_READ read -#define ALT_RENAME _rename -#define ALT_SBRK sbrk -#define ALT_SETTIMEOFDAY settimeofday -#define ALT_STAT stat -#define ALT_UNLINK unlink -#define ALT_USLEEP usleep -#define ALT_WAIT wait -#define ALT_WRITE write -#define ALT_TIMES times - -/* - * - */ - -#endif /* __ALT_SYSCALL_H__ */ diff --git a/software/qsys_tutorial_bsp/HAL/inc/priv/alt_alarm.h b/software/qsys_tutorial_bsp/HAL/inc/priv/alt_alarm.h deleted file mode 100644 index 45d6a0e..0000000 --- a/software/qsys_tutorial_bsp/HAL/inc/priv/alt_alarm.h +++ /dev/null @@ -1,101 +0,0 @@ -#ifndef __ALT_PRIV_ALARM_H__ -#define __ALT_PRIV_ALARM_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "alt_types.h" - -/* - * This header provides the internal defenitions required by the public - * interface alt_alarm.h. These variables and structures are not guaranteed to - * exist in future implementations of the HAL. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * "alt_alarm_s" is a structure type used to maintain lists of alarm callback - * functions. - */ - -struct alt_alarm_s -{ - alt_llist llist; /* linked list */ - alt_u32 time; /* time in system ticks of the callback */ - alt_u32 (*callback) (void* context); /* callback function. The return - * value is the period for the next callback; where - * zero indicates that the alarm should be removed - * from the list. - */ - alt_u8 rollover; /* set when desired alarm time + current time causes - overflow, to prevent premature alarm */ - void* context; /* Argument for the callback */ -}; - -/* - * "_alt_tick_rate" is a global variable used to store the system clock rate - * in ticks per second. This is initialised to zero, which coresponds to there - * being no system clock available. - * - * It is then set to it's final value by the system clock driver through a call - * to alt_sysclk_init(). - */ - -extern alt_u32 _alt_tick_rate; - -/* - * "_alt_nticks" is a global variable which records the elapsed number of - * system clock ticks since the last call to settimeofday() or since reset if - * settimeofday() has not been called. - */ - -extern volatile alt_u32 _alt_nticks; - -/* The list of registered alarms. */ - -extern alt_llist alt_alarm_list; - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_PRIV_ALARM_H__ */ diff --git a/software/qsys_tutorial_bsp/HAL/inc/priv/alt_busy_sleep.h b/software/qsys_tutorial_bsp/HAL/inc/priv/alt_busy_sleep.h deleted file mode 100644 index b1af849..0000000 --- a/software/qsys_tutorial_bsp/HAL/inc/priv/alt_busy_sleep.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef __ALT_BUSY_SLEEP_H -#define __ALT_BUSY_SLEEP_H - -/* - * Copyright (c) 2003 Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - */ - -/* - * The function alt_busy_sleep provides a busy loop implementation of usleep. - * This is used to provide usleep for the standalone HAL, or when the timer is - * unavailable in uC/OS-II. - */ - -extern unsigned int alt_busy_sleep (unsigned int us); - -#endif /* __ALT_BUSY_SLEEP_H */ diff --git a/software/qsys_tutorial_bsp/HAL/inc/priv/alt_dev_llist.h b/software/qsys_tutorial_bsp/HAL/inc/priv/alt_dev_llist.h deleted file mode 100644 index 451b063..0000000 --- a/software/qsys_tutorial_bsp/HAL/inc/priv/alt_dev_llist.h +++ /dev/null @@ -1,77 +0,0 @@ -#ifndef __ALT_DEV_LLIST_H__ -#define __ALT_DEV_LLIST_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "sys/alt_llist.h" -#include "alt_types.h" - -/* - * This header provides the internal defenitions required to control file - * access. These variables and functions are not guaranteed to exist in - * future implementations of the HAL. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The alt_dev_llist is an internal structure used to form a common base - * class for all device types. The use of this structure allows common code - * to be used to manipulate the various device lists. - */ - -typedef struct { - alt_llist llist; - const char* name; -} alt_dev_llist; - -/* - * - */ - -extern int alt_dev_llist_insert (alt_dev_llist* dev, alt_llist* list); - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_DEV_LLIST_H__ */ diff --git a/software/qsys_tutorial_bsp/HAL/inc/priv/alt_exception_handler_registry.h b/software/qsys_tutorial_bsp/HAL/inc/priv/alt_exception_handler_registry.h deleted file mode 100644 index c6905fa..0000000 --- a/software/qsys_tutorial_bsp/HAL/inc/priv/alt_exception_handler_registry.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef __ALT_EXCEPTION_HANDLER_REGISTRY_H__ -#define __ALT_EXCEPTION_HANDLER_REGISTRY_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2008 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ -#include "sys/alt_exceptions.h" - -/* Function pointer to exception callback routine */ -extern alt_exception_result (*alt_instruction_exception_handler) - (alt_exception_cause, alt_u32, alt_u32); - -#endif /* __ALT_EXCEPTION_HANDLER_REGISTRY_H__ */ diff --git a/software/qsys_tutorial_bsp/HAL/inc/priv/alt_file.h b/software/qsys_tutorial_bsp/HAL/inc/priv/alt_file.h deleted file mode 100644 index 2c3e843..0000000 --- a/software/qsys_tutorial_bsp/HAL/inc/priv/alt_file.h +++ /dev/null @@ -1,179 +0,0 @@ -#ifndef __ALT_FILE_H__ -#define __ALT_FILE_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "sys/alt_dev.h" -#include "sys/alt_llist.h" -#include "os/alt_sem.h" - -#include "alt_types.h" - -/* - * This header provides the internal defenitions required to control file - * access. These variables and functions are not guaranteed to exist in - * future implementations of the HAL. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The function alt_find_dev() is used to search the device list "list" to - * locate a device named "name". If a match is found, then a pointer to the - * device is returned, otherwise NULL is returned. - */ - -extern alt_dev* alt_find_dev (const char* name, alt_llist* list); - -/* - * alt_find_file() is used to search the list of registered file systems to - * find the filesystem that the file named "name" belongs to. If a match is - * found, then a pointer to the filesystems alt_dev structure is returned, - * otherwise NULL is returned. - * - * Note that a match does not indicate that the file exists, only that a - * filesystem exists that is registered for a partition that could contain - * the file. The filesystems open() function would need to be called in order - * to determine if the file exists. - */ - -extern alt_dev* alt_find_file (const char* name); - -/* - * alt_get_fd() is used to allocate a file descriptor for the device or - * filesystem "dev". A negative return value indicates an error, otherwise the - * return value is the index of the file descriptor within the file descriptor - * pool. - */ - -extern int alt_get_fd (alt_dev* dev); - -/* - * alt_release_fd() is called to free the file descriptor with index "fd". - */ - -extern void alt_release_fd (int fd); - -/* - * alt_fd_lock() is called by ioctl() to mark the file descriptor "fd" as - * being open for exclusive access. Subsequent calls to open() for the device - * associated with "fd" will fail. A device is unlocked by either calling - * close() for "fd", or by an alternate call to ioctl() (see ioctl.c for - * details). - */ - -extern int alt_fd_lock (alt_fd* fd); - -/* - * alt_fd_unlock() is called by ioctl() to unlock a descriptor previously - * locked by a call to alt_fd_lock(). - */ - -extern int alt_fd_unlock (alt_fd* fd); - -/* - * "alt_fd_list" is the pool of file descriptors. - */ - -extern alt_fd alt_fd_list[]; - -/* - * flags used by alt_fd. - * - * ALT_FD_EXCL is used to mark a file descriptor as locked for exclusive - * access, i.e. further calls to open() for the associated device should - * fail. - * - * ALT_FD_DEV marks a dile descriptor as belonging to a device as oposed to a - * filesystem. - */ - -#define ALT_FD_EXCL 0x80000000 -#define ALT_FD_DEV 0x40000000 - -#define ALT_FD_FLAGS_MASK (ALT_FD_EXCL | ALT_FD_DEV) - -/* - * "alt_dev_list" is the head of the linked list of registered devices. - */ - -extern alt_llist alt_dev_list; - -/* - * "alt_fs_list" is the head of the linked list of registered filesystems. - */ - -extern alt_llist alt_fs_list; - -/* - * "alt_fd_list_lock" is a semaphore used to ensure that access to the pool - * of file descriptors is thread safe. - */ - -ALT_EXTERN_SEM(alt_fd_list_lock) - -/* - * "alt_max_fd" is a 'high water mark'. It indicates the highest file - * descriptor allocated. Use of this can save searching the entire pool - * for active file descriptors, which helps avoid contention on access - * to the file descriptor pool. - */ - -extern alt_32 alt_max_fd; - -/* - * alt_io_redirect() is called at startup to redirect stdout, stdin, and - * stderr to the devices named in the input arguments. By default these streams - * are directed at /dev/null, and are then redirected using this function once - * all of the devices have been registered within the system. - */ - -extern void alt_io_redirect(const char* stdout_dev, - const char* stdin_dev, - const char* stderr_dev); - - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_FILE_H__ */ diff --git a/software/qsys_tutorial_bsp/HAL/inc/priv/alt_iic_isr_register.h b/software/qsys_tutorial_bsp/HAL/inc/priv/alt_iic_isr_register.h deleted file mode 100644 index a0cb01c..0000000 --- a/software/qsys_tutorial_bsp/HAL/inc/priv/alt_iic_isr_register.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef __ALT_IIC_ISR_REGISTER_H_ -#define __ALT_IIC_ISR_REGISTER_H_ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ -#include "alt_types.h" -#include "sys/alt_irq.h" - -extern int alt_iic_isr_register(alt_u32 ic_id, alt_u32 irq, alt_isr_func isr, - void *isr_context, void *flags); - -#endif /* __ALT_IIC_ISR_REGISTER_H_ */ diff --git a/software/qsys_tutorial_bsp/HAL/inc/priv/alt_irq_table.h b/software/qsys_tutorial_bsp/HAL/inc/priv/alt_irq_table.h deleted file mode 100644 index 694ef06..0000000 --- a/software/qsys_tutorial_bsp/HAL/inc/priv/alt_irq_table.h +++ /dev/null @@ -1,59 +0,0 @@ -#ifndef __ALT_IRQ_TABLE_H__ -#define __ALT_IRQ_TABLE_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * Definition of a table describing each interrupt handler. The index into - * the array is the interrupt id associated with the handler. - * - * When an interrupt occurs, the associated handler is called with - * the argument stored in the context member. - * - * The table is physically created in alt_irq_handler.c - */ -extern struct ALT_IRQ_HANDLER -{ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - void (*handler)(void*); -#else - void (*handler)(void*, alt_u32); -#endif - void *context; -} alt_irq[ALT_NIRQ]; - -#endif diff --git a/software/qsys_tutorial_bsp/HAL/inc/priv/alt_legacy_irq.h b/software/qsys_tutorial_bsp/HAL/inc/priv/alt_legacy_irq.h deleted file mode 100644 index c7aec02..0000000 --- a/software/qsys_tutorial_bsp/HAL/inc/priv/alt_legacy_irq.h +++ /dev/null @@ -1,158 +0,0 @@ -#ifndef __ALT_LEGACY_IRQ_H__ -#define __ALT_LEGACY_IRQ_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * This file provides prototypes and inline implementations of certain routines - * used by the legacy interrupt API. Do not include this in your driver or - * application source files, use "sys/alt_irq.h" instead to access the proper - * public API. - */ - -#include -#include "system.h" - -#ifndef NIOS2_EIC_PRESENT - -#include "nios2.h" -#include "alt_types.h" - -#include "sys/alt_irq.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * alt_irq_register() can be used to register an interrupt handler. If the - * function is succesful, then the requested interrupt will be enabled upon - * return. - */ -extern int alt_irq_register (alt_u32 id, - void* context, - alt_isr_func handler); - -/* - * alt_irq_disable() disables the individual interrupt indicated by "id". - */ -static ALT_INLINE int ALT_ALWAYS_INLINE alt_irq_disable (alt_u32 id) -{ - alt_irq_context status; - extern volatile alt_u32 alt_irq_active; - - status = alt_irq_disable_all (); - - alt_irq_active &= ~(1 << id); - NIOS2_WRITE_IENABLE (alt_irq_active); - - alt_irq_enable_all(status); - - return 0; -} - -/* - * alt_irq_enable() enables the individual interrupt indicated by "id". - */ -static ALT_INLINE int ALT_ALWAYS_INLINE alt_irq_enable (alt_u32 id) -{ - alt_irq_context status; - extern volatile alt_u32 alt_irq_active; - - status = alt_irq_disable_all (); - - alt_irq_active |= (1 << id); - NIOS2_WRITE_IENABLE (alt_irq_active); - - alt_irq_enable_all(status); - - return 0; -} - -#ifndef ALT_EXCEPTION_STACK -/* - * alt_irq_initerruptable() should only be called from within an ISR. It is used - * to allow higer priority interrupts to interrupt the current ISR. The input - * argument, "priority", is the priority, i.e. interrupt number of the current - * interrupt. - * - * If this function is called, then the ISR is required to make a call to - * alt_irq_non_interruptible() before returning. The input argument to - * alt_irq_non_interruptible() is the return value from alt_irq_interruptible(). - * - * Care should be taken when using this pair of functions, since they increasing - * the system overhead associated with interrupt handling. - * - * If you are using an exception stack then nested interrupts won't work, so - * these functions are not available in that case. - */ -static ALT_INLINE alt_u32 ALT_ALWAYS_INLINE alt_irq_interruptible (alt_u32 priority) -{ - extern volatile alt_u32 alt_priority_mask; - extern volatile alt_u32 alt_irq_active; - - alt_u32 old_priority; - - old_priority = alt_priority_mask; - alt_priority_mask = (1 << priority) - 1; - - NIOS2_WRITE_IENABLE (alt_irq_active & alt_priority_mask); - - NIOS2_WRITE_STATUS (1); - - return old_priority; -} - -/* - * See Comments above for alt_irq_interruptible() for an explanation of the use of this - * function. - */ -static ALT_INLINE void ALT_ALWAYS_INLINE alt_irq_non_interruptible (alt_u32 mask) -{ - extern volatile alt_u32 alt_priority_mask; - extern volatile alt_u32 alt_irq_active; - - NIOS2_WRITE_STATUS (0); - - alt_priority_mask = mask; - - NIOS2_WRITE_IENABLE (mask & alt_irq_active); -} -#endif /* ALT_EXCEPTION_STACK */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* NIOS2_EIC_PRESENT */ - -#endif /* __ALT_LEGACY_IRQ_H__ */ diff --git a/software/qsys_tutorial_bsp/HAL/inc/priv/alt_no_error.h b/software/qsys_tutorial_bsp/HAL/inc/priv/alt_no_error.h deleted file mode 100644 index 6143fc9..0000000 --- a/software/qsys_tutorial_bsp/HAL/inc/priv/alt_no_error.h +++ /dev/null @@ -1,77 +0,0 @@ -#ifndef __ALT_NO_ERROR_H__ -#define __ALT_NO_ERROR_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "alt_types.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * alt_no_error() is a dummy function used by alt_sem.h and alt_flag.h. It - * substitutes for functions that have a return code by creating a function - * that always returns zero. - * - * This may seem a little obscure, but what happens is that the compiler can - * then optomise away the call to this function, and any code written which - * handles the error path (i.e. non zero return values). - * - * This allows code to be written which correctly use the uC/OS-II semaphore - * and flag utilities, without the use of those utilities impacting on - * excutables built for a single threaded HAL environment. - * - * This function is considered to be part of the internal implementation of - * the HAL, and should not be called directly by application code or device - * drivers. It is not guaranteed to be preserved in future versions of the - * HAL. - */ - -static ALT_INLINE int ALT_ALWAYS_INLINE alt_no_error (void) -{ - return 0; -} - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_NO_ERROR_H__ */ diff --git a/software/qsys_tutorial_bsp/HAL/inc/priv/nios2_gmon_data.h b/software/qsys_tutorial_bsp/HAL/inc/priv/nios2_gmon_data.h deleted file mode 100644 index 3f43f12..0000000 --- a/software/qsys_tutorial_bsp/HAL/inc/priv/nios2_gmon_data.h +++ /dev/null @@ -1,47 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ -#ifndef NIOS2_GMON_DATA_H -#define NIOS2_GMON_DATA_H - -#define GMON_DATA_SIG 0 -#define GMON_DATA_WORDS 1 -#define GMON_DATA_PROFILE_DATA 2 -#define GMON_DATA_PROFILE_LOWPC 3 -#define GMON_DATA_PROFILE_HIGHPC 4 -#define GMON_DATA_PROFILE_BUCKET 5 -#define GMON_DATA_PROFILE_RATE 6 -#define GMON_DATA_MCOUNT_START 7 -#define GMON_DATA_MCOUNT_LIMIT 8 - -#define GMON_DATA_SIZE 9 - -extern unsigned int alt_gmon_data[GMON_DATA_SIZE]; - -#endif diff --git a/software/qsys_tutorial_bsp/HAL/inc/sys/alt_alarm.h b/software/qsys_tutorial_bsp/HAL/inc/sys/alt_alarm.h deleted file mode 100644 index 68a2f5d..0000000 --- a/software/qsys_tutorial_bsp/HAL/inc/sys/alt_alarm.h +++ /dev/null @@ -1,126 +0,0 @@ -#ifndef __ALT_ALARM_H__ -#define __ALT_ALARM_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "alt_llist.h" -#include "alt_types.h" - -#include "priv/alt_alarm.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * "alt_alarm" is a structure type used by applications to register an alarm - * callback function. An instance of this type must be passed as an input - * argument to alt_alarm_start(). The user is not responsible for initialising - * the contents of the instance. This is done by alt_alarm_start(). - */ - -typedef struct alt_alarm_s alt_alarm; - -/* - * alt_alarm_start() can be called by an application/driver in order to register - * a function for periodic callback at the system clock frequency. Be aware that - * this callback is likely to occur in interrupt context. - */ - -extern int alt_alarm_start (alt_alarm* the_alarm, - alt_u32 nticks, - alt_u32 (*callback) (void* context), - void* context); - -/* - * alt_alarm_stop() is used to unregister a callback. Alternatively the callback - * can return zero to unregister. - */ - -extern void alt_alarm_stop (alt_alarm* the_alarm); - -/* - * Obtain the system clock rate in ticks/s. - */ - -static ALT_INLINE alt_u32 ALT_ALWAYS_INLINE alt_ticks_per_second (void) -{ - return _alt_tick_rate; -} - -/* - * alt_sysclk_init() is intended to be only used by the system clock driver - * in order to initialise the value of the clock frequency. - */ - -static ALT_INLINE int ALT_ALWAYS_INLINE alt_sysclk_init (alt_u32 nticks) -{ - if (! _alt_tick_rate) - { - _alt_tick_rate = nticks; - return 0; - } - else - { - return -1; - } -} - -/* - * alt_nticks() returns the elapsed number of system clock ticks since reset. - */ - -static ALT_INLINE alt_u32 ALT_ALWAYS_INLINE alt_nticks (void) -{ - return _alt_nticks; -} - -/* - * alt_tick() should only be called by the system clock driver. This is used - * to notify the system that the system timer period has expired. - */ - -extern void alt_tick (void); - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_ALARM_H__ */ diff --git a/software/qsys_tutorial_bsp/HAL/inc/sys/alt_cache.h b/software/qsys_tutorial_bsp/HAL/inc/sys/alt_cache.h deleted file mode 100644 index c4d8db9..0000000 --- a/software/qsys_tutorial_bsp/HAL/inc/sys/alt_cache.h +++ /dev/null @@ -1,117 +0,0 @@ -#ifndef __ALT_CACHE_H__ -#define __ALT_CACHE_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003, 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include - -#include "alt_types.h" - -/* - * alt_cache.h defines the processor specific functions for manipulating the - * cache. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * alt_icache_flush() is called to flush the instruction cache for a memory - * region of length "len" bytes, starting at address "start". - */ - -extern void alt_icache_flush (void* start, alt_u32 len); - -/* - * alt_dcache_flush() is called to flush the data cache for a memory - * region of length "len" bytes, starting at address "start". - * Any dirty lines in the data cache are written back to memory. - */ - -extern void alt_dcache_flush (void* start, alt_u32 len); - -/* - * alt_dcache_flush() is called to flush the data cache for a memory - * region of length "len" bytes, starting at address "start". - * Any dirty lines in the data cache are NOT written back to memory. - */ - -extern void alt_dcache_flush_no_writeback (void* start, alt_u32 len); - -/* - * Flush the entire instruction cache. - */ - -extern void alt_icache_flush_all (void); - -/* - * Flush the entire data cache. - */ - -extern void alt_dcache_flush_all (void); - -/* - * Allocate a block of uncached memory. - */ - -extern volatile void* alt_uncached_malloc (size_t size); - -/* - * Free a block of uncached memory. - */ - -extern void alt_uncached_free (volatile void* ptr); - -/* - * Convert a pointer to a block of cached memory, into a block of - * uncached memory. - */ - -extern volatile void* alt_remap_uncached (void* ptr, alt_u32 len); - -/* - * Convert a pointer to a block of uncached memory, into a block of - * cached memory. - */ - -extern void* alt_remap_cached (volatile void* ptr, alt_u32 len); - -/* - * - */ - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_CACHE_H__ */ diff --git a/software/qsys_tutorial_bsp/HAL/inc/sys/alt_debug.h b/software/qsys_tutorial_bsp/HAL/inc/sys/alt_debug.h deleted file mode 100644 index d9f9599..0000000 --- a/software/qsys_tutorial_bsp/HAL/inc/sys/alt_debug.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef __ALT_DEBUG_H__ -#define __ALT_DEBUG_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * The ALT_DEVUG_ASSERT macro can be used to generate a debugger break - * from within software. The break is generated if "condition" evaluates to - * false. - */ - -#define ALT_DEBUG_ASSERT(condition) if (!condition) \ -{ \ - __asm__ volatile ("break"); \ -} - -#endif /* __ALT_DEBUG_H__ */ diff --git a/software/qsys_tutorial_bsp/HAL/inc/sys/alt_dev.h b/software/qsys_tutorial_bsp/HAL/inc/sys/alt_dev.h deleted file mode 100644 index 66c5e41..0000000 --- a/software/qsys_tutorial_bsp/HAL/inc/sys/alt_dev.h +++ /dev/null @@ -1,115 +0,0 @@ -#ifndef __ALT_DEV_H__ -#define __ALT_DEV_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "system.h" -#include "sys/alt_llist.h" -#include "priv/alt_dev_llist.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The value ALT_IRQ_NOT_CONNECTED is used to represent an unconnected - * interrupt line. It cannot evaluate to a valid interrupt number. - */ - -#define ALT_IRQ_NOT_CONNECTED (-1) - -typedef struct alt_dev_s alt_dev; - -struct stat; - -/* - * The file descriptor structure definition. - */ - -typedef struct alt_fd_s -{ - alt_dev* dev; - alt_u8* priv; - int fd_flags; -} alt_fd; - -/* - * The device structure definition. - */ - -struct alt_dev_s { - alt_llist llist; /* for internal use */ - const char* name; - int (*open) (alt_fd* fd, const char* name, int flags, int mode); - int (*close) (alt_fd* fd); - int (*read) (alt_fd* fd, char* ptr, int len); - int (*write) (alt_fd* fd, const char* ptr, int len); - int (*lseek) (alt_fd* fd, int ptr, int dir); - int (*fstat) (alt_fd* fd, struct stat* buf); - int (*ioctl) (alt_fd* fd, int req, void* arg); -}; - -/* - * Functions used to register device for access through the C standard - * library. - * - * The only difference between alt_dev_reg() and alt_fs_reg() is the - * interpretation that open() places on the device name. In the case of - * alt_dev_reg the device is assumed to be a particular character device, - * and so there must be an exact match in the name for open to succeed. - * In the case of alt_fs_reg() the name of the device is treated as the - * mount point for a directory, and so any call to open() where the name - * is the root of the device filename will succeed. - */ - -extern int alt_fs_reg (alt_dev* dev); - -static ALT_INLINE int alt_dev_reg (alt_dev* dev) -{ - extern alt_llist alt_dev_list; - - return alt_dev_llist_insert ((alt_dev_llist*) dev, &alt_dev_list); -} - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_DEV_H__ */ diff --git a/software/qsys_tutorial_bsp/HAL/inc/sys/alt_dma.h b/software/qsys_tutorial_bsp/HAL/inc/sys/alt_dma.h deleted file mode 100644 index 9f9b2ff..0000000 --- a/software/qsys_tutorial_bsp/HAL/inc/sys/alt_dma.h +++ /dev/null @@ -1,226 +0,0 @@ -#ifndef __ALT_DMA_H__ -#define __ALT_DMA_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "sys/alt_dma_dev.h" -#include "alt_types.h" - -#include - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * This header contains the application side interface for accessing DMA - * resources. See alt_dma_dev.h for the dma device driver interface. - * - * The interface model treats a DMA transaction as being composed of two - * halves (read and write). - * - * The application can supply data for transmit using an "alt_dma_txchan" - * descriptor. Alternatively an "alt_dma_rxchan" descriptor can be used to - * receive data. - */ - -/* - * alt_dma_txchan_open() is used to obtain an "alt_dma_txchan" descriptor for - * a DMA transmit device. The name is the name of the associated physical - * device (e.g. "/dev/dma_0"). - * - * The return value will be NULL on failure, and non-NULL otherwise. - */ - -extern alt_dma_txchan alt_dma_txchan_open (const char* name); - -/* - * alt_dma_txchan_close() is provided so that an application can notify the - * system that it has finished with a given DMA transmit channel. This is only - * provided for completness. - */ - -static ALT_INLINE int alt_dma_txchan_close (alt_dma_txchan dma) -{ - return 0; -} - -/* - * alt_dma_txchan_send() posts a transmit request to a DMA transmit channel. - * The input arguments are: - * - * dma: the channel to use. - * from: a pointer to the start of the data to send. - * length: the length of the data to send in bytes. - * done: callback function that will be called once the data has been sent. - * handle: opaque value passed to "done". - * - * The return value will be negative if the request cannot be posted, and - * zero otherwise. - */ - -static ALT_INLINE int alt_dma_txchan_send (alt_dma_txchan dma, - const void* from, - alt_u32 length, - alt_txchan_done* done, - void* handle) -{ - return dma ? dma->dma_send (dma, - from, - length, - done, - handle) : -ENODEV; -} - -/* - * alt_dma_txchan_space() returns the number of tranmit requests that can be - * posted to the specified DMA transmit channel. - * - * A negative value indicates that the value could not be determined. - */ - -static ALT_INLINE int alt_dma_txchan_space (alt_dma_txchan dma) -{ - return dma ? dma->space (dma) : -ENODEV; -} - -/* - * alt_dma_txchan_ioctl() can be used to perform device specific I/O - * operations on the indicated DMA transmit channel. For example some drivers - * support options to control the width of the transfer operations. See - * alt_dma_dev.h for the list of generic requests. - * - * A negative return value indicates failure, otherwise the interpretation - * of the return value is request specific. - */ - -static ALT_INLINE int alt_dma_txchan_ioctl (alt_dma_txchan dma, - int req, - void* arg) -{ - return dma ? dma->ioctl (dma, req, arg) : -ENODEV; -} - -/* - * alt_dma_rxchan_open() is used to obtain an "alt_dma_rxchan" descriptor for - * a DMA receive channel. The name is the name of the associated physical - * device (e.g. "/dev/dma_0"). - * - * The return value will be NULL on failure, and non-NULL otherwise. - */ - -extern alt_dma_rxchan alt_dma_rxchan_open (const char* dev); - -/* - * alt_dma_rxchan_close() is provided so that an application can notify the - * system that it has finished with a given DMA receive channel. This is only - * provided for completness. - */ - -static ALT_INLINE int alt_dma_rxchan_close (alt_dma_rxchan dma) -{ - return 0; -} - -/* - * - */ - -/* - * alt_dma_rxchan_prepare() posts a receive request to a DMA receive channel. - * - * The input arguments are: - * - * dma: the channel to use. - * data: a pointer to the location that data is to be received to. - * len: the maximum length of the data to receive. - * done: callback function that will be called once the data has been - * received. - * handle: opaque value passed to "done". - * - * The return value will be negative if the request cannot be posted, and - * zero otherwise. - */ - -static ALT_INLINE int alt_dma_rxchan_prepare (alt_dma_rxchan dma, - void* data, - alt_u32 len, - alt_rxchan_done* done, - void* handle) -{ - return dma ? dma->prepare (dma, data, len, done, handle) : -ENODEV; -} - -/* - * alt_dma_rxchan_ioctl() can be used to perform device specific I/O - * operations on the indicated DMA receive channel. For example some drivers - * support options to control the width of the transfer operations. See - * alt_dma_dev.h for the list of generic requests. - * - * A negative return value indicates failure, otherwise the interpretation - * of the return value is request specific. - */ - -static ALT_INLINE int alt_dma_rxchan_ioctl (alt_dma_rxchan dma, - int req, - void* arg) -{ - return dma ? dma->ioctl (dma, req, arg) : -ENODEV; -} - -/* - * alt_dma_rxchan_depth() returns the depth of the receive FIFO used to store - * receive requests. - */ - -static ALT_INLINE alt_u32 alt_dma_rxchan_depth(alt_dma_rxchan dma) -{ - return dma->depth; -} - -/* - * - */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_DMA_H__ */ diff --git a/software/qsys_tutorial_bsp/HAL/inc/sys/alt_dma_dev.h b/software/qsys_tutorial_bsp/HAL/inc/sys/alt_dma_dev.h deleted file mode 100644 index 832463d..0000000 --- a/software/qsys_tutorial_bsp/HAL/inc/sys/alt_dma_dev.h +++ /dev/null @@ -1,200 +0,0 @@ -#ifndef __ALT_DMA_DEV_H__ -#define __ALT_DMA_DEV_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "priv/alt_dev_llist.h" - -#include "alt_types.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * This header contains the device driver interface for accessing DMA - * resources. See alt_dma.h for the DMA application side interface. - * - * The interface model treats a DMA transaction as being composed of two - * halves (read and write). - * - * An "alt_dma_txchan_dev" is used to describe the device associated with a - * DMA transmit channel. An "alt_dma_rxchan_dev" is used to describe the - * device associated with a DMA receive channel. - */ - -/* - * List of generic ioctl requests that may be supported by a DMA device. - * - * ALT_DMA_RX_ONLY_ON: This causes a DMA channel to operate in a mode - * where only the receiver is under software control. - * The other side reads continously from a single - * location. The address to read is the argument to - * this request. - * ALT_DMA_RX_ONLY_OFF: Return to the default mode where both the receive - * and transmit sides of the DMA can be under software - * control. - * ALT_DMA_TX_ONLY_ON: This causes a DMA channel to operate in a mode - * where only the transmitter is under software control. - * The other side writes continously to a single - * location. The address to write to is the argument to - * this request. - * ALT_DMA_TX_ONLY_OFF: Return to the default mode where both the receive - * and transmit sides of the DMA can be under software - * control. - * ALT_DMA_SET_MODE_8: Transfer data in units of 8 bits. - * ALT_DMA_SET_MODE_16: Transfer data in units of 16 bits. - * ALT_DMA_SET_MODE_32: Transfer data in units of 32 bits. - * ALT_DMA_SET_MODE_64: Transfer data in units of 64 bits. - * ALT_DMA_SET_MODE_128: Transfer data in units of 128 bits. - * ALT_DMA_GET_MODE: Get the current transfer mode. - * - * The use of the macros: ALT_DMA_TX_STREAM_ON, ALT_DMA_TX_STREAM_OFF - * ALT_DMA_RX_STREAM_OFF and ALT_DMA_RX_STREAM_ON are depreciated. You should - * instead use the macros: ALT_DMA_RX_ONLY_ON, ALT_DMA_RX_ONLY_OFF, - * ALT_DMA_TX_ONLY_ON and ALT_DMA_TX_ONLY_OFF. - */ - -#define ALT_DMA_TX_STREAM_ON (0x1) -#define ALT_DMA_TX_STREAM_OFF (0x2) -#define ALT_DMA_RX_STREAM_ON (0x3) -#define ALT_DMA_RX_STREAM_OFF (0x4) -#define ALT_DMA_SET_MODE_8 (0x5) -#define ALT_DMA_SET_MODE_16 (0x6) -#define ALT_DMA_SET_MODE_32 (0x7) -#define ALT_DMA_SET_MODE_64 (0x8) -#define ALT_DMA_SET_MODE_128 (0x9) -#define ALT_DMA_GET_MODE (0xa) - -#define ALT_DMA_RX_ONLY_ON ALT_DMA_TX_STREAM_ON -#define ALT_DMA_RX_ONLY_OFF ALT_DMA_TX_STREAM_OFF -#define ALT_DMA_TX_ONLY_ON ALT_DMA_RX_STREAM_ON -#define ALT_DMA_TX_ONLY_OFF ALT_DMA_RX_STREAM_OFF - -/* - * - */ - -typedef struct alt_dma_txchan_dev_s alt_dma_txchan_dev; -typedef struct alt_dma_rxchan_dev_s alt_dma_rxchan_dev; - -typedef alt_dma_txchan_dev* alt_dma_txchan; -typedef alt_dma_rxchan_dev* alt_dma_rxchan; - -typedef void (alt_txchan_done)(void* handle); -typedef void (alt_rxchan_done)(void* handle, void* data); - -/* - * devices that provide a DMA transmit channel are required to provide an - * instance of the "alt_dma_txchan_dev" structure. - */ - -struct alt_dma_txchan_dev_s { - alt_llist llist; /* for internal use */ - const char* name; /* name of the device instance - * (e.g. "/dev/dma_0"). - */ - int (*space) (alt_dma_txchan dma); /* returns the maximum number of - * transmit requests that can be posted - */ - int (*dma_send) (alt_dma_txchan dma, - const void* from, - alt_u32 len, - alt_txchan_done* done, - void* handle); /* post a transmit request */ - int (*ioctl) (alt_dma_txchan dma, int req, void* arg); /* perform device - * specific I/O control. - */ -}; - -/* - * devices that provide a DMA receive channel are required to provide an - * instance of the "alt_dma_rxchan_dev" structure. - */ - -struct alt_dma_rxchan_dev_s { - alt_llist list; /* for internal use */ - const char* name; /* name of the device instance - * (e.g. "/dev/dma_0"). - */ - alt_u32 depth; /* maximum number of receive requests that - * can be posted. - */ - int (*prepare) (alt_dma_rxchan dma, - void* data, - alt_u32 len, - alt_rxchan_done* done, - void* handle); /* post a receive request */ - int (*ioctl) (alt_dma_rxchan dma, int req, void* arg); /* perform device - * specific I/O control. - */ -}; - -/* - * Register a DMA transmit channel with the system. - */ - -static ALT_INLINE int alt_dma_txchan_reg (alt_dma_txchan_dev* dev) -{ - extern alt_llist alt_dma_txchan_list; - - return alt_dev_llist_insert((alt_dev_llist*) dev, &alt_dma_txchan_list); -} - -/* - * Register a DMA receive channel with the system. - */ - -static ALT_INLINE int alt_dma_rxchan_reg (alt_dma_rxchan_dev* dev) -{ - extern alt_llist alt_dma_rxchan_list; - - return alt_dev_llist_insert((alt_dev_llist*) dev, &alt_dma_rxchan_list); -} - -/* - * - */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_DMA_DEV_H__ */ diff --git a/software/qsys_tutorial_bsp/HAL/inc/sys/alt_driver.h b/software/qsys_tutorial_bsp/HAL/inc/sys/alt_driver.h deleted file mode 100644 index eb0f23b..0000000 --- a/software/qsys_tutorial_bsp/HAL/inc/sys/alt_driver.h +++ /dev/null @@ -1,168 +0,0 @@ -#ifndef __ALT_DRIVER_H__ -#define __ALT_DRIVER_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/* - * Macros used to access a driver without HAL file descriptors. - */ - -/* - * ALT_MODULE_CLASS - * - * This macro returns the module class name for the specified module instance. - * It uses information in the system.h file. - * Neither the instance name or class name are quoted (so that they can - * be used with other pre-processor macros). - * - * Example: - * Assume the design has an instance of an altera_avalon_uart called uart1. - * Calling ALT_MODULE_CLASS(uart1) returns altera_avalon_uart. - */ - -#define ALT_MODULE_CLASS(instance) ALT_MODULE_CLASS_ ## instance - - -/* - * ALT_DRIVER_FUNC_NAME - * - * --> instance Instance name. - * --> func Function name. - * - * This macro returns the device driver function name of the specified - * module instance for the specified function name. - * - * Example: - * Assume the design has an instance of an altera_avalon_uart called uart1. - * Calling ALT_DRIVER_FUNC_NAME(uart1, write) returns - * altera_avalon_uart_write. - */ - -#define ALT_DRIVER_FUNC_NAME(instance, func) \ - ALT_DRIVER_FUNC_NAME1(ALT_MODULE_CLASS(instance), func) -#define ALT_DRIVER_FUNC_NAME1(module_class, func) \ - ALT_DRIVER_FUNC_NAME2(module_class, func) -#define ALT_DRIVER_FUNC_NAME2(module_class, func) \ - module_class ## _ ## func - -/* - * ALT_DRIVER_STATE_STRUCT - * - * --> instance Instance name. - * - * This macro returns the device driver state type name of the specified - * module instance. - * - * Example: - * Assume the design has an instance of an altera_avalon_uart called uart1. - * Calling ALT_DRIVER_STATE_STRUCT(uart1) returns: - * struct altera_avalon_uart_state_s - * - * Note that the ALT_DRIVER_FUNC_NAME macro is used even though "state" isn't - * really a function but it does match the required naming convention. - */ -#define ALT_DRIVER_STATE_STRUCT(instance) \ - struct ALT_DRIVER_FUNC_NAME(instance, state_s) - -/* - * ALT_DRIVER_STATE - * - * --> instance Instance name. - * - * This macro returns the device driver state name of the specified - * module instance. - * - * Example: - * Assume the design has an instance of an altera_avalon_uart called uart1. - * Calling ALT_DRIVER_STATE(uart1) returns uart1. - */ -#define ALT_DRIVER_STATE(instance) instance - -/* - * ALT_DRIVER_WRITE - * - * --> instance Instance name. - * --> buffer Write buffer. - * --> len Length of write buffer data. - * --> flags Control flags (e.g. O_NONBLOCK) - * - * This macro calls the "write" function of the specified driver instance. - */ - -#define ALT_DRIVER_WRITE_EXTERNS(instance) \ - extern ALT_DRIVER_STATE_STRUCT(instance) ALT_DRIVER_STATE(instance); \ - extern int ALT_DRIVER_FUNC_NAME(instance, write) \ - (ALT_DRIVER_STATE_STRUCT(instance) *, const char *, int, int); - -#define ALT_DRIVER_WRITE(instance, buffer, len, flags) \ - ALT_DRIVER_FUNC_NAME(instance, write)(&ALT_DRIVER_STATE(instance), buffer, len, flags) - - -/* - * ALT_DRIVER_READ - * - * --> instance Instance name. - * <-- buffer Read buffer. - * --> len Length of read buffer. - * --> flags Control flags (e.g. O_NONBLOCK) - * - * This macro calls the "read" function of the specified driver instance. - */ - -#define ALT_DRIVER_READ_EXTERNS(instance) \ - extern ALT_DRIVER_STATE_STRUCT(instance) ALT_DRIVER_STATE(instance); \ - extern int ALT_DRIVER_FUNC_NAME(instance, read) \ - (ALT_DRIVER_STATE_STRUCT(instance) *, const char *, int, int); - -#define ALT_DRIVER_READ(instance, buffer, len, flags) \ - ALT_DRIVER_FUNC_NAME(instance, read)(&ALT_DRIVER_STATE(instance), buffer, len, flags) - -/* - * ALT_DRIVER_IOCTL - * - * --> instance Instance name. - * --> req ioctl request (e.g. TIOCSTIMEOUT) - * --> arg Optional argument (void*) - * - * This macro calls the "ioctl" function of the specified driver instance - */ - -#define ALT_DRIVER_IOCTL_EXTERNS(instance) \ - extern ALT_DRIVER_STATE_STRUCT(instance) ALT_DRIVER_STATE(instance); \ - extern int ALT_DRIVER_FUNC_NAME(instance, ioctl) \ - (ALT_DRIVER_STATE_STRUCT(instance) *, int, void*); - -#define ALT_DRIVER_IOCTL(instance, req, arg) \ - ALT_DRIVER_FUNC_NAME(instance, ioctl)(&ALT_DRIVER_STATE(instance), req, arg) - -#endif /* __ALT_DRIVER_H__ */ diff --git a/software/qsys_tutorial_bsp/HAL/inc/sys/alt_errno.h b/software/qsys_tutorial_bsp/HAL/inc/sys/alt_errno.h deleted file mode 100644 index 4d3e50f..0000000 --- a/software/qsys_tutorial_bsp/HAL/inc/sys/alt_errno.h +++ /dev/null @@ -1,87 +0,0 @@ -#ifndef __ALT_ERRNO_H__ -#define __ALT_ERRNO_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * errno is defined in so that it uses the thread local version - * stored in the location pointed to by "_impure_ptr". This means that the - * accesses to errno within the HAL library can cause the entirety of - * of the structure pointed to by "_impure_ptr" to be added to the - * users application. This can be undesirable in very small footprint systems. - * - * To avoid this happening, the HAL uses the macro ALT_ERRNO, defined below, - * to access errno, rather than accessing it directly. This macro will only - * use the thread local version if some other code has already caused it to be - * included into the system, otherwise it will use the global errno value. - * - * This causes a slight increases in code size where errno is accessed, but - * can lead to significant overall benefits in very small systems. The - * increase is inconsequential when compared to the size of the structure - * pointed to by _impure_ptr. - * - * Note that this macro accesses __errno() using an externally declared - * function pointer (alt_errno). This is done so that the function call uses the - * subroutine call instruction via a register rather than an immediate address. - * This is important in the case that the code has been linked for a high - * address, but __errno() is not being used. In this case the weak linkage - * would have resulted in the instruction: "call 0" which would fail to link. - */ - -extern int* (*alt_errno) (void); - -/* Must define this so that values such as EBADFD are defined in errno.h. */ -#define __LINUX_ERRNO_EXTENSIONS__ - -#include - -#include "alt_types.h" - -#undef errno - -extern int errno; - -static ALT_INLINE int* alt_get_errno(void) -{ - return ((alt_errno) ? alt_errno() : &errno); -} - -#define ALT_ERRNO *alt_get_errno() - -#endif /* __ALT_ERRNO_H__ */ diff --git a/software/qsys_tutorial_bsp/HAL/inc/sys/alt_exceptions.h b/software/qsys_tutorial_bsp/HAL/inc/sys/alt_exceptions.h deleted file mode 100644 index 3576a52..0000000 --- a/software/qsys_tutorial_bsp/HAL/inc/sys/alt_exceptions.h +++ /dev/null @@ -1,127 +0,0 @@ -#ifndef __ALT_EXCEPTIONS_H__ -#define __ALT_EXCEPTIONS_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2008 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ -#include "alt_types.h" -#include "system.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * This file defines instruction-generated exception handling and registry - * API, exception type enumeration, and handler return value enumeration for - * Nios II. - */ - -/* - * The following enumeration describes the value in the CPU EXCEPTION - * register CAUSE bit field. Not all exception types will cause the - * processor to go to the exception vector; these are provided for - * reference. - */ -enum alt_exception_cause_e { - /* Exeption causes that will cause jump to exception vector */ - NIOS2_EXCEPTION_INTERRUPT = 2, - NIOS2_EXCEPTION_TRAP_INST = 3, - NIOS2_EXCEPTION_UNIMPLEMENTED_INST = 4, - NIOS2_EXCEPTION_ILLEGAL_INST = 5, - NIOS2_EXCEPTION_MISALIGNED_DATA_ADDR = 6, - NIOS2_EXCEPTION_MISALIGNED_TARGET_PC = 7, - NIOS2_EXCEPTION_DIVISION_ERROR = 8, - NIOS2_EXCEPTION_SUPERVISOR_ONLY_INST_ADDR = 9, - NIOS2_EXCEPTION_SUPERVISOR_ONLY_INST = 10, - NIOS2_EXCEPTION_SUPERVISOR_ONLY_DATA_ADDR = 11, - NIOS2_EXCEPTION_TLB_MISS = 12, - NIOS2_EXCEPTION_TLB_EXECUTE_PERM_VIOLATION = 13, - NIOS2_EXCEPTION_MPU_INST_REGION_VIOLATION = 16, - - /* Exception causes that will NOT cause a jump to exception vector */ - NIOS2_EXCEPTION_RESET = 0, - NIOS2_EXCEPTION_CPU_ONLY_RESET_REQUEST = 1, - NIOS2_EXCEPTION_TLB_READ_PERM_VIOLATION = 14, - NIOS2_EXCEPTION_TLB_WRITE_PERM_VIOLATION = 15, - NIOS2_EXCEPTION_MPU_DATA_REGION_VIOLATION = 17, - /* - * This value is passed to an exception handler's cause argument if - * "extra exceptions" information (EXECPTION) register is not - * present in the processor hardware configuration. - */ - NIOS2_EXCEPTION_CAUSE_NOT_PRESENT = -1 -}; -typedef enum alt_exception_cause_e alt_exception_cause; - -/* - * These define valid return values for a user-defined instruction-generated - * exception handler. The handler should return one of these to indicate - * whether to re-issue the instruction that triggered the exception, or to - * skip it. - */ -enum alt_exception_result_e { - NIOS2_EXCEPTION_RETURN_REISSUE_INST = 0, - NIOS2_EXCEPTION_RETURN_SKIP_INST = 1 -}; -typedef enum alt_exception_result_e alt_exception_result; - -/* - * alt_instruction_exception_register() can be used to register an exception - * handler for instruction-generated exceptions that are not handled by the - * built-in exception handler (i.e. for interrupts). - * - * The registry API is optionally enabled through the "Enable - * Instruction-related Exception API" HAL BSP setting, which will - * define the macro below. - */ -#ifdef ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API -void alt_instruction_exception_register ( - alt_exception_result (*exception_handler)( - alt_exception_cause cause, - alt_u32 exception_pc, - alt_u32 bad_addr) ); -#endif /*ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API */ - -/* - * alt_exception_cause_generated_bad_addr() indicates whether a particular - * exception cause value was from an exception-type that generated a valid - * address in the BADADDR register. The contents of BADADDR is passed to - * a user-registered exception handler in all cases, whether valid or not. - * This routine should be called to validate the bad_addr argument to - * your exception handler. - */ -int alt_exception_cause_generated_bad_addr(alt_exception_cause cause); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_EXCEPTIONS_H__ */ diff --git a/software/qsys_tutorial_bsp/HAL/inc/sys/alt_flash.h b/software/qsys_tutorial_bsp/HAL/inc/sys/alt_flash.h deleted file mode 100644 index 527328d..0000000 --- a/software/qsys_tutorial_bsp/HAL/inc/sys/alt_flash.h +++ /dev/null @@ -1,166 +0,0 @@ -#ifndef __ALT_FLASH_H__ -#define __ALT_FLASH_H__ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/****************************************************************************** -* * -* Alt_flash.h - User interface for flash code * -* * -* Use this interface to avoid being exposed to the internals of the device * -* driver architecture. If you chose to use the flash driver internal * -* structures we don't guarantee not to change them * -* * -* Author PRR * -* * -******************************************************************************/ - - - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#include "alt_types.h" -#include "alt_flash_types.h" -#include "alt_flash_dev.h" -#include "sys/alt_cache.h" - -alt_flash_fd* alt_flash_open_dev(const char* name); -void alt_flash_close_dev(alt_flash_fd* fd ); - -/* - * alt_write_flash - * - * Program a buffer into flash. - * - * This routine erases all the affected erase blocks (if necessary) - * and then programs the data. However it does not read the data out first - * and preserve and none overwritten data, because this would require very - * large buffers on the target. If you need - * that functionality use the functions below. - */ -static __inline__ int __attribute__ ((always_inline)) alt_write_flash( - alt_flash_fd* fd, - int offset, - const void* src_addr, - int length ) -{ - return fd->write( fd, offset, src_addr, length ); -} - -/* - * alt_read_flash - * - * Read a block of flash for most flashes this is just memcpy - * it's here for completeness in case we need it for some serial flash device - * - */ -static __inline__ int __attribute__ ((always_inline)) alt_read_flash( - alt_flash_fd* fd, int offset, - void* dest_addr, int length ) -{ - return fd->read( fd, offset, dest_addr, length ); -} - -/* - * alt_get_flash_info - * - * Return the information on the flash sectors. - * - */ -static __inline__ int __attribute__ ((always_inline)) alt_get_flash_info( - alt_flash_fd* fd, flash_region** info, - int* number_of_regions) -{ - return fd->get_info( fd, info, number_of_regions); -} - -/* - * alt_erase_flash_block - * - * Erase a particular erase block, pass in the offset to the start of - * the block and it's size - */ -static __inline__ int __attribute__ ((always_inline)) alt_erase_flash_block( - alt_flash_fd* fd, int offset, int length) -{ - int ret_code; - ret_code = fd->erase_block( fd, offset ); - - if(!ret_code) - alt_dcache_flush((alt_u8*)fd->base_addr + offset, length); - - return ret_code; -} - -/* - * alt_write_flash_block - * - * Write a particular flash block, block_offset is the offset - * (from the base of flash) to start of the block - * data_offset is the offset (from the base of flash) - * where you wish to start programming - * - * NB this function DOES NOT check that you are only writing a single - * block of data as that would slow down this function. - * - * Use alt_write_flash if you want that level of error checking. - */ - -static __inline__ int __attribute__ ((always_inline)) alt_write_flash_block( - alt_flash_fd* fd, int block_offset, - int data_offset, - const void *data, int length) -{ - - int ret_code; - ret_code = fd->write_block( fd, block_offset, data_offset, data, length ); - - if(!ret_code) - alt_dcache_flush((alt_u8*)fd->base_addr + data_offset, length); - - return ret_code; -} - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_FLASH_H__ */ diff --git a/software/qsys_tutorial_bsp/HAL/inc/sys/alt_flash_dev.h b/software/qsys_tutorial_bsp/HAL/inc/sys/alt_flash_dev.h deleted file mode 100644 index 8bab601..0000000 --- a/software/qsys_tutorial_bsp/HAL/inc/sys/alt_flash_dev.h +++ /dev/null @@ -1,98 +0,0 @@ -#ifndef __ALT_FLASH_DEV_H__ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/****************************************************************************** -* * -* Alt_flash_dev.h - Generic Flash device interfaces * -* * -* Author PRR * -* * -******************************************************************************/ -#define __ALT_FLASH_DEV_H__ - -#include "alt_flash_types.h" -#include "sys/alt_llist.h" -#include "priv/alt_dev_llist.h" - -#include "alt_types.h" - -typedef struct alt_flash_dev alt_flash_dev; -typedef alt_flash_dev alt_flash_fd; - -static ALT_INLINE int alt_flash_device_register( alt_flash_fd* fd) -{ - extern alt_llist alt_flash_dev_list; - - return alt_dev_llist_insert ((alt_dev_llist*) fd, &alt_flash_dev_list); -} - -typedef alt_flash_dev* (*alt_flash_open)(alt_flash_dev* flash, - const char* name ); -typedef int (*alt_flash_close)(alt_flash_dev* flash_info); - -typedef int (*alt_flash_write)( alt_flash_dev* flash, int offset, - const void* src_addr, int length ); - -typedef int (*alt_flash_get_flash_info)( alt_flash_dev* flash, flash_region** info, - int* number_of_regions); -typedef int (*alt_flash_write_block)( alt_flash_dev* flash, int block_offset, - int data_offset, const void* data, - int length); -typedef int (*alt_flash_erase_block)( alt_flash_dev* flash, int offset); -typedef int (*alt_flash_read)(alt_flash_dev* flash, int offset, - void* dest_addr, int length ); - -struct alt_flash_dev -{ - alt_llist llist; - const char* name; - alt_flash_open open; - alt_flash_close close; - alt_flash_write write; - alt_flash_read read; - alt_flash_get_flash_info get_info; - alt_flash_erase_block erase_block; - alt_flash_write_block write_block; - void* base_addr; - int length; - int number_of_regions; - flash_region region_info[ALT_MAX_NUMBER_OF_FLASH_REGIONS]; -}; - -#endif /* __ALT_FLASH_DEV_H__ */ diff --git a/software/qsys_tutorial_bsp/HAL/inc/sys/alt_flash_types.h b/software/qsys_tutorial_bsp/HAL/inc/sys/alt_flash_types.h deleted file mode 100644 index 884cbf8..0000000 --- a/software/qsys_tutorial_bsp/HAL/inc/sys/alt_flash_types.h +++ /dev/null @@ -1,64 +0,0 @@ -#ifndef __ALT_FLASH_TYPES_H__ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/****************************************************************************** -* * -* Alt_flash_types.h - Some generic types and defines used by the flash code * -* * -* Author PRR * -* * -******************************************************************************/ -#define __ALT_FLASH_TYPES_H__ - -#ifndef ALT_MAX_NUMBER_OF_FLASH_REGIONS -#define ALT_MAX_NUMBER_OF_FLASH_REGIONS 8 -#endif /* ALT_MAX_NUMBER_OF_FLASH_REGIONS */ - -/* - * Description of a single Erase region - */ -typedef struct flash_region -{ - int offset; - int region_size; - int number_of_blocks; - int block_size; -}flash_region; - -#endif /* __ALT_FLASH_TYPES_H__ */ diff --git a/software/qsys_tutorial_bsp/HAL/inc/sys/alt_irq.h b/software/qsys_tutorial_bsp/HAL/inc/sys/alt_irq.h deleted file mode 100644 index 6666e52..0000000 --- a/software/qsys_tutorial_bsp/HAL/inc/sys/alt_irq.h +++ /dev/null @@ -1,245 +0,0 @@ -#ifndef __ALT_IRQ_H__ -#define __ALT_IRQ_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * alt_irq.h is the Nios II specific implementation of the interrupt controller - * interface. - * - * Nios II includes optional support for an external interrupt controller. - * When an external controller is present, the "Enhanced" interrupt API - * must be used to manage individual interrupts. The enhanced API also - * supports the processor's internal interrupt controller. Certain API - * members are accessible from either the "legacy" or "enhanced" interrpt - * API. - * - * Regardless of which API is in use, this file should be included by - * application code and device drivers that register ISRs or manage interrpts. - */ -#include - -#include "nios2.h" -#include "alt_types.h" -#include "system.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * Macros used by alt_irq_enabled - */ -#define ALT_IRQ_ENABLED 1 -#define ALT_IRQ_DISABLED 0 - -/* - * Number of available interrupts in internal interrupt controller. - */ -#define ALT_NIRQ NIOS2_NIRQ - -/* - * Used by alt_irq_disable_all() and alt_irq_enable_all(). - */ -typedef int alt_irq_context; - -/* ISR Prototype */ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT -typedef void (*alt_isr_func)(void* isr_context); -#else -typedef void (*alt_isr_func)(void* isr_context, alt_u32 id); -#endif - -/* - * The following protypes and routines are supported by both - * the enhanced and legacy interrupt APIs - */ - -/* - * alt_irq_enabled can be called to determine if the processor's global - * interrupt enable is asserted. The return value is zero if interrupts - * are disabled, and non-zero otherwise. - * - * Whether the internal or external interrupt controller is present, - * individual interrupts may still be disabled. Use the other API to query - * a specific interrupt. - */ -static ALT_INLINE int ALT_ALWAYS_INLINE alt_irq_enabled (void) -{ - int status; - - NIOS2_READ_STATUS (status); - - return status & NIOS2_STATUS_PIE_MSK; -} - -/* - * alt_irq_disable_all() - * - * This routine inhibits all interrupts by negating the status register PIE - * bit. It returns the previous contents of the CPU status register (IRQ - * context) which can be used to restore the status register PIE bit to its - * state before this routine was called. - */ -static ALT_INLINE alt_irq_context ALT_ALWAYS_INLINE - alt_irq_disable_all (void) -{ - alt_irq_context context; - - NIOS2_READ_STATUS (context); - - NIOS2_WRITE_STATUS (context & ~NIOS2_STATUS_PIE_MSK); - - return context; -} - -/* - * alt_irq_enable_all() - * - * Enable all interrupts that were previously disabled by alt_irq_disable_all() - * - * This routine accepts a context to restore the CPU status register PIE bit - * to the state prior to a call to alt_irq_disable_all(). - - * In the case of nested calls to alt_irq_disable_all()/alt_irq_enable_all(), - * this means that alt_irq_enable_all() does not necessarily re-enable - * interrupts. - * - * This routine will perform a read-modify-write sequence to restore only - * status.PIE if the processor is configured with options that add additional - * writeable status register bits. These include the MMU, MPU, the enhanced - * interrupt controller port, and shadow registers. Otherwise, as a performance - * enhancement, status is overwritten with the prior context. - */ -static ALT_INLINE void ALT_ALWAYS_INLINE - alt_irq_enable_all (alt_irq_context context) -{ -#if (NIOS2_NUM_OF_SHADOW_REG_SETS > 0) || (defined NIOS2_EIC_PRESENT) || \ - (defined NIOS2_MMU_PRESENT) || (defined NIOS2_MPU_PRESENT) - alt_irq_context status; - - NIOS2_READ_STATUS (status); - - status &= ~NIOS2_STATUS_PIE_MSK; - status |= (context & NIOS2_STATUS_PIE_MSK); - - NIOS2_WRITE_STATUS (status); -#else - NIOS2_WRITE_STATUS (context); -#endif -} - -/* - * The function alt_irq_init() is defined within the auto-generated file - * alt_sys_init.c. This function calls the initilization macros for all - * interrupt controllers in the system at config time, before any other - * non-interrupt controller driver is initialized. - * - * The "base" parameter is ignored and only present for backwards-compatibility. - * It is recommended that NULL is passed in for the "base" parameter. - */ -extern void alt_irq_init (const void* base); - -/* - * alt_irq_cpu_enable_interrupts() enables the CPU to start taking interrupts. - */ -static ALT_INLINE void ALT_ALWAYS_INLINE - alt_irq_cpu_enable_interrupts () -{ - NIOS2_WRITE_STATUS(NIOS2_STATUS_PIE_MSK -#if defined(NIOS2_EIC_PRESENT) && (NIOS2_NUM_OF_SHADOW_REG_SETS > 0) - | NIOS2_STATUS_RSIE_MSK -#endif - ); -} - - -/* - * Prototypes for the enhanced interrupt API. - */ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT -/* - * alt_ic_isr_register() can be used to register an interrupt handler. If the - * function is succesful, then the requested interrupt will be enabled upon - * return. - */ -extern int alt_ic_isr_register(alt_u32 ic_id, - alt_u32 irq, - alt_isr_func isr, - void *isr_context, - void *flags); - -/* - * alt_ic_irq_enable() and alt_ic_irq_disable() enable/disable a specific - * interrupt by using IRQ port and interrupt controller instance. - */ -int alt_ic_irq_enable (alt_u32 ic_id, alt_u32 irq); -int alt_ic_irq_disable(alt_u32 ic_id, alt_u32 irq); - - /* - * alt_ic_irq_enabled() indicates whether a specific interrupt, as - * specified by IRQ port and interrupt controller instance is enabled. - */ -alt_u32 alt_ic_irq_enabled(alt_u32 ic_id, alt_u32 irq); - -#else -/* - * Prototypes for the legacy interrupt API. - */ -#include "priv/alt_legacy_irq.h" -#endif - - -/* - * alt_irq_pending() returns a bit list of the current pending interrupts. - * This is used by alt_irq_handler() to determine which registered interrupt - * handlers should be called. - * - * This routine is only available for the Nios II internal interrupt - * controller. - */ -#ifndef NIOS2_EIC_PRESENT -static ALT_INLINE alt_u32 ALT_ALWAYS_INLINE alt_irq_pending (void) -{ - alt_u32 active; - - NIOS2_READ_IPENDING (active); - - return active; -} -#endif - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_IRQ_H__ */ diff --git a/software/qsys_tutorial_bsp/HAL/inc/sys/alt_irq_entry.h b/software/qsys_tutorial_bsp/HAL/inc/sys/alt_irq_entry.h deleted file mode 100644 index e2008d9..0000000 --- a/software/qsys_tutorial_bsp/HAL/inc/sys/alt_irq_entry.h +++ /dev/null @@ -1,39 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * This file pulls in the IRQ entry assembler and C code, which is only - * required if there are any interruptes in the system. - */ - -__asm__( "\n\t.globl alt_irq_entry" ); - -__asm__( "\n\t.globl alt_irq_handler" ); - diff --git a/software/qsys_tutorial_bsp/HAL/inc/sys/alt_license_reminder_ucosii.h b/software/qsys_tutorial_bsp/HAL/inc/sys/alt_license_reminder_ucosii.h deleted file mode 100644 index 2fe649c..0000000 --- a/software/qsys_tutorial_bsp/HAL/inc/sys/alt_license_reminder_ucosii.h +++ /dev/null @@ -1,77 +0,0 @@ -#ifndef __ALT_LICENSE_REMINDER_UCOSII_H__ -#define __ALT_LICENSE_REMINDER_UCOSII_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include - -#define ALT_LICENSE_REMINDER_UCOSII_STRING \ - "============== Software License Reminder ===============\n" \ - "\n" \ - "uC/OS-II is provided in source form for FREE evaluation,\n" \ - "for educational use, or for peaceful research. If you\n" \ - "plan on using uC/OS-II in a commercial product you need\n" \ - "to contact Micrium to properly license its use in your\n" \ - "product. Micrium provides ALL the source code on the\n" \ - "Altera distribution for your convenience and to help you\n" \ - "experience uC/OS-II. The fact that the source is provided\n" \ - "does NOT mean that you can use it without paying a\n" \ - "licensing fee. Please help us continue to provide the\n" \ - "Embedded community with the finest software available.\n" \ - "Your honesty is greatly appreciated.\n" \ - "\n" \ - "Please contact:\n" \ - "\n" \ - "M I C R I U M\n" \ - "949 Crestview Circle\n" \ - "Weston, FL 33327-1848\n" \ - "U.S.A.\n" \ - "\n" \ - "Phone : +1 954 217 2036\n" \ - "FAX : +1 954 217 2037\n" \ - "WEB : www.micrium.com\n" \ - "E-mail: Sales@Micrium.com\n" \ - "\n" \ - "========================================================\n" - -#define alt_license_reminder_ucosii() puts(ALT_LICENSE_REMINDER_UCOSII_STRING) - - -#endif /* __ALT_LICENSE_REMINDER_UCOSII_H__ */ - diff --git a/software/qsys_tutorial_bsp/HAL/inc/sys/alt_llist.h b/software/qsys_tutorial_bsp/HAL/inc/sys/alt_llist.h deleted file mode 100644 index 46f81ce..0000000 --- a/software/qsys_tutorial_bsp/HAL/inc/sys/alt_llist.h +++ /dev/null @@ -1,123 +0,0 @@ -#ifndef __ALT_LIST_H__ -#define __ALT_LIST_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "alt_types.h" - -/* - * alt_llist.h defines structures and functions for use in manipulating linked - * lists. A list is considered to be constructed from a chain of objects of - * type alt_llist, with one object being defined to be the head element. - * - * A list is considered to be empty if it only contains the head element. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * alt_llist is the structure used to represent an element within a linked - * list. - */ - -typedef struct alt_llist_s alt_llist; - -struct alt_llist_s { - alt_llist* next; /* Pointer to the next element in the list. */ - alt_llist* previous; /* Pointer to the previous element in the list. */ -}; - -/* - * ALT_LLIST_HEAD is a macro that can be used to create the head of a new - * linked list. This is named "head". The head element is initialised to - * represent an empty list. - */ - -#define ALT_LLIST_HEAD(head) alt_llist head = {&head, &head} - -/* - * ALT_LLIST_ENTRY is a macro used to define an uninitialised linked list - * entry. This is used to reserve space in structure initialisation for - * structures that inherit form alt_llist. - */ - -#define ALT_LLIST_ENTRY {0, 0} - -/* - * alt_llist_insert() insert adds the linked list entry "entry" as the - * first entry in the linked list "list". "list" is the list head element. - */ - -static ALT_INLINE void ALT_ALWAYS_INLINE alt_llist_insert(alt_llist* list, - alt_llist* entry) -{ - entry->previous = list; - entry->next = list->next; - - list->next->previous = entry; - list->next = entry; -} - -/* - * alt_llist_remove() is called to remove an element from a linked list. The - * input argument is the element to remove. - */ - -static ALT_INLINE void ALT_ALWAYS_INLINE alt_llist_remove(alt_llist* entry) -{ - entry->next->previous = entry->previous; - entry->previous->next = entry->next; - - /* - * Set the entry to point to itself, so that any further calls to - * alt_llist_remove() are harmless. - */ - - entry->previous = entry; - entry->next = entry; -} - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_LLIST_H__ */ diff --git a/software/qsys_tutorial_bsp/HAL/inc/sys/alt_load.h b/software/qsys_tutorial_bsp/HAL/inc/sys/alt_load.h deleted file mode 100644 index 432e9f2..0000000 --- a/software/qsys_tutorial_bsp/HAL/inc/sys/alt_load.h +++ /dev/null @@ -1,78 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "alt_types.h" - -/* - * This macro is used to load code/data from its load address to its - * execution address for a given section. The section name is the input - * argument. Note that a leading '.' is assumed in the name. For example - * to load the section .onchip_ram, use: - * - * ALT_LOAD_SECTION_BY_NAME(onchip_ram); - * - * This requires that the apropriate linker symbols have been generated - * for the section in question. This will be the case if you are using the - * default linker script. - */ - -#define ALT_LOAD_SECTION_BY_NAME(name) \ - { \ - extern void _alt_partition_##name##_start; \ - extern void _alt_partition_##name##_end; \ - extern void _alt_partition_##name##_load_addr; \ - \ - alt_load_section(&_alt_partition_##name##_load_addr, \ - &_alt_partition_##name##_start, \ - &_alt_partition_##name##_end); \ - } - -/* - * Function used to load an individual section from flash to RAM. - * - * There is an implicit assumption here that the linker script will ensure - * that all sections are word aligned. - * - */ - -static void ALT_INLINE alt_load_section (alt_u32* from, - alt_u32* to, - alt_u32* end) -{ - if (to != from) - { - while( to != end ) - { - *to++ = *from++; - } - } -} diff --git a/software/qsys_tutorial_bsp/HAL/inc/sys/alt_log_printf.h b/software/qsys_tutorial_bsp/HAL/inc/sys/alt_log_printf.h deleted file mode 100644 index c15ca05..0000000 --- a/software/qsys_tutorial_bsp/HAL/inc/sys/alt_log_printf.h +++ /dev/null @@ -1,349 +0,0 @@ -/* alt_log_printf.h - * - * ALT_LOG is designed to provide extra logging/debugging messages from HAL - * through a different port than stdout. It is enabled by the ALT_LOG_ENABLE - * define, which needs to supplied at compile time. When logging is turned off, - * code size is unaffected. Thus, this should be transparent to the user - * when it is not actively turned on, and should not affect projects in any way. - * - * There are macros sprinkled within different components, such as the jtag uart - * and timer, in the HAL code. They are always named ALT_LOG_, and can be - * safely ignored if ALT_LOG is turned off. - * - * To turn on ALT_LOG, ALT_LOG_ENABLE must be defined, and ALT_LOG_PORT_TYPE and - * ALT_LOG_PORT_BASE must be set in system.h. This is done through editing - * .ptf, by editing the alt_log_port_type & alt_log_port_base settings. - * See the documentation html file for examples. - * - * When it is turned on, it will output extra HAL messages to a port specified - * in system.h. This can be a UART or JTAG UART port. By default it will - * output boot messages, detailing every step of the boot process. - * - * Extra logging is designed to be enabled by flags, which are defined in - * alt_log_printf.c. The default value is that all flags are off, so only the - * boot up logging messages show up. ALT_LOG_FLAGS can be set to enable certain - * groupings of flags, and that grouping is done in this file. Each flag can - * also be overridden with a -D at compile time. - * - * This header file includes the necessary prototypes for using the alt_log - * functions. It also contains all the macros that are used to remove the code - * from alt log is turned off. Also, the macros in other HAL files are defined - * here at the bottom. These macros all call some C function that is in - * alt_log_printf.c. - * - * The logging has functions for printing in C (ALT_LOG_PRINTF) and in assembly - * (ALT_LOG_PUTS). This was needed because the assembly printing occurs before - * the device is initialized. The assembly function corrupts register R4-R7, - * which are not used in the normal boot process. For this reason, do not call - * the assembly function in C. - * - * author: gkwan - */ - - -#ifndef __ALT_LOG_PRINTF_H__ -#define __ALT_LOG_PRINTF_H__ - -#include - -/* Global switch to turn on logging functions */ -#ifdef ALT_LOG_ENABLE - - /* ALT_LOG_PORT_TYPE values as defined in system.h. They are defined as - * numbers here first becasue the C preprocessor does not handle string - * comparisons. */ - #define ALTERA_AVALON_JTAG_UART 1 - #define ALTERA_AVALON_UART 0 - - /* If this .h file is included by an assembly file, skip over include files - * that won't compile in assembly. */ - #ifndef ALT_ASM_SRC - #include - #include "sys/alt_alarm.h" - #include "sys/alt_dev.h" - #ifdef __ALTERA_AVALON_JTAG_UART - #include "altera_avalon_jtag_uart.h" - #endif - #endif /* ALT_ASM_SRC */ - - /* These are included for the port register offsets and masks, needed - * to write to the port. Only include if the port type is set correctly, - * otherwise error. If alt_log is turned on and the port to output to is - * incorrect or does not exist, then should exit. */ - #if ALT_LOG_PORT_TYPE == ALTERA_AVALON_JTAG_UART - #ifdef __ALTERA_AVALON_JTAG_UART - #include - #else - #error ALT_LOG: JTAG_UART port chosen, but no JTAG_UART in system. - #endif - #elif ALT_LOG_PORT_TYPE == ALTERA_AVALON_UART - #ifdef __ALTERA_AVALON_UART - #include - #else - #error ALT_LOG: UART Port chosen, but no UART in system. - #endif - #else - #error ALT_LOG: alt_log_port_type declaration invalid! - #endif - - /* ALT_LOG_ENABLE turns on the basic printing function */ - #define ALT_LOG_PRINTF(...) do {alt_log_printf_proc(__VA_ARGS__);} while (0) - - /* Assembly macro for printing in assembly, calls tx_log_str - * which is in alt_log_macro.S. - * If alt_log_boot_on_flag is 0, skips the printing */ - #define ALT_LOG_PUTS(str) movhi r4, %hiadj(alt_log_boot_on_flag) ; \ - addi r4, r4, %lo(alt_log_boot_on_flag) ; \ - ldwio r5, 0(r4) ; \ - beq r0, r5, 0f ; \ - movhi r4, %hiadj(str) ; \ - addi r4, r4, %lo(str) ; \ - call tx_log_str ; \ - 0: - - /* These defines are here to faciliate the use of one output function - * (alt_log_txchar) to print to both the JTAG UART or the UART. Depending - * on the port type, the status register, read mask, and output register - * are set to the appropriate value for the port. */ - #if ALT_LOG_PORT_TYPE == ALTERA_AVALON_JTAG_UART - #define ALT_LOG_PRINT_REG_RD IORD_ALTERA_AVALON_JTAG_UART_CONTROL - #define ALT_LOG_PRINT_MSK ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_MSK - #define ALT_LOG_PRINT_TXDATA_WR IOWR_ALTERA_AVALON_JTAG_UART_DATA - #define ALT_LOG_PRINT_REG_OFFSET (ALTERA_AVALON_JTAG_UART_CONTROL_REG*0x4) - #define ALT_LOG_PRINT_TXDATA_REG_OFFSET (ALTERA_AVALON_JTAG_UART_DATA_REG*0x4) - #elif ALT_LOG_PORT_TYPE == ALTERA_AVALON_UART - #define ALT_LOG_PRINT_REG_RD IORD_ALTERA_AVALON_UART_STATUS - #define ALT_LOG_PRINT_MSK ALTERA_AVALON_UART_STATUS_TRDY_MSK - #define ALT_LOG_PRINT_TXDATA_WR IOWR_ALTERA_AVALON_UART_TXDATA - #define ALT_LOG_PRINT_REG_OFFSET (ALTERA_AVALON_UART_STATUS_REG*0x4) - #define ALT_LOG_PRINT_TXDATA_REG_OFFSET (ALTERA_AVALON_UART_TXDATA_REG*0x4) - #endif /* ALT_LOG_PORT */ - - /* Grouping of flags via ALT_LOG_FLAGS. Each specific flag can be set via - * -D at compile time, or else they'll be set to a default value according - * to ALT_LOG_FLAGS. ALT_LOG_FLAGS = 0 or not set is the default, where - * only the boot messages will be printed. As ALT_LOG_FLAGS increase, they - * increase in intrusiveness to the program, and will affect performance. - * - * Flag Level 1 - turns on system clock and JTAG UART startup status - * 2 - turns on write echo and JTAG_UART alarm (periodic report) - * 3 - turns on JTAG UART ISR logging - will slow performance - * significantly. - * -1 - All logging output is off, but if ALT_LOG_ENABLE is - * defined all logging function is built and code size - * remains constant - * - * Flag settings - 1 = on, 0 = off. */ - - /* This flag turns on "boot" messages for printing. This includes messages - * during crt0.S, then alt_main, and finally alt_exit. */ - #ifndef ALT_LOG_BOOT_ON_FLAG_SETTING - #if ALT_LOG_FLAGS == 1 - #define ALT_LOG_BOOT_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 2 - #define ALT_LOG_BOOT_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 3 - #define ALT_LOG_BOOT_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == -1 /* silent mode */ - #define ALT_LOG_BOOT_ON_FLAG_SETTING 0x0 - #else /* default setting */ - #define ALT_LOG_BOOT_ON_FLAG_SETTING 0x1 - #endif - #endif /* ALT_LOG_BOOT_ON_FLAG_SETTING */ - - #ifndef ALT_LOG_SYS_CLK_ON_FLAG_SETTING - #if ALT_LOG_FLAGS == 1 - #define ALT_LOG_SYS_CLK_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 2 - #define ALT_LOG_SYS_CLK_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 3 - #define ALT_LOG_SYS_CLK_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == -1 /* silent mode */ - #define ALT_LOG_SYS_CLK_ON_FLAG_SETTING 0x0 - #else /* default setting */ - #define ALT_LOG_SYS_CLK_ON_FLAG_SETTING 0x0 - #endif - #endif /* ALT_LOG_SYS_CLK_ON_FLAG_SETTING */ - - #ifndef ALT_LOG_WRITE_ON_FLAG_SETTING - #if ALT_LOG_FLAGS == 1 - #define ALT_LOG_WRITE_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 2 - #define ALT_LOG_WRITE_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 3 - #define ALT_LOG_WRITE_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == -1 /* silent mode */ - #define ALT_LOG_WRITE_ON_FLAG_SETTING 0x0 - #else /* default setting */ - #define ALT_LOG_WRITE_ON_FLAG_SETTING 0x0 - #endif - #endif /* ALT_LOG_WRITE_ON_FLAG_SETTING */ - - #ifndef ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING - #ifndef __ALTERA_AVALON_JTAG_UART - #define ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 1 - #define ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 2 - #define ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 3 - #define ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == -1 /* silent mode */ - #define ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING 0x0 - #else /* default setting */ - #define ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING 0x0 - #endif - #endif /* ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING */ - - #ifndef ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING - #ifndef __ALTERA_AVALON_JTAG_UART - #define ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 1 - #define ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 2 - #define ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 3 - #define ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == -1 /* silent mode */ - #define ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING 0x0 - #else /* default setting */ - #define ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING 0x0 - #endif - #endif /* ALT_LOG_JTAG_UART_STARTUP_INFO_FLAG_SETTING */ - - #ifndef ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING - #ifndef __ALTERA_AVALON_JTAG_UART - #define ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 1 - #define ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 2 - #define ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 3 - #define ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == -1 /* silent mode */ - #define ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING 0x0 - #else /* default setting */ - #define ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING 0x0 - #endif - #endif /* ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING */ - -#ifndef ALT_ASM_SRC - /* Function Prototypes */ - void alt_log_txchar(int c,char *uartBase); - void alt_log_private_printf(const char *fmt,int base,va_list args); - void alt_log_repchar(char c,int r,int base); - int alt_log_printf_proc(const char *fmt, ... ); - void alt_log_system_clock(); - #ifdef __ALTERA_AVALON_JTAG_UART - alt_u32 altera_avalon_jtag_uart_report_log(void * context); - void alt_log_jtag_uart_startup_info(altera_avalon_jtag_uart_state* dev, int base); - void alt_log_jtag_uart_print_control_reg(altera_avalon_jtag_uart_state* dev, \ - int base, const char* header); - void alt_log_jtag_uart_isr_proc(int base, altera_avalon_jtag_uart_state* dev); - #endif - void alt_log_write(const void *ptr, size_t len); - - /* extern all global variables */ - extern volatile alt_u32 alt_log_boot_on_flag; - extern volatile alt_u8 alt_log_write_on_flag; - extern volatile alt_u8 alt_log_sys_clk_on_flag; - extern volatile alt_u8 alt_log_jtag_uart_alarm_on_flag; - extern volatile alt_u8 alt_log_jtag_uart_isr_on_flag; - extern volatile alt_u8 alt_log_jtag_uart_startup_info_on_flag; - extern volatile int alt_log_sys_clk_count; - extern volatile int alt_system_clock_in_sec; - extern alt_alarm alt_log_jtag_uart_alarm_1; -#endif /* ALT_ASM_SRC */ - - - /* Below are the MACRO defines used in various HAL files. They check - * if their specific flag is turned on; if it is, then it executes its - * code. - * - * To keep this file reasonable, most of these macros calls functions, - * which are defined in alt_log_printf.c. Look there for implementation - * details. */ - - /* Boot Messages Logging */ - #define ALT_LOG_PRINT_BOOT(...) \ - do { if (alt_log_boot_on_flag==1) {ALT_LOG_PRINTF(__VA_ARGS__);} \ - } while (0) - - /* JTAG UART Logging */ - /* number of ticks before alarm runs logging function */ - #ifndef ALT_LOG_JTAG_UART_TICKS_DIVISOR - #define ALT_LOG_JTAG_UART_TICKS_DIVISOR 10 - #endif - #ifndef ALT_LOG_JTAG_UART_TICKS - #define ALT_LOG_JTAG_UART_TICKS \ - (alt_ticks_per_second()/ALT_LOG_JTAG_UART_TICKS_DIVISOR) - #endif - - /* if there's a JTAG UART defined, then enable these macros */ - #ifdef __ALTERA_AVALON_JTAG_UART - - /* Macro in altera_avalon_jtag_uart.c, to register the alarm function. - * Also, the startup register info is also printed here, as this is - * called within the device driver initialization. */ - #define ALT_LOG_JTAG_UART_ALARM_REGISTER(dev, base) \ - do { if (alt_log_jtag_uart_alarm_on_flag==1) { \ - alt_alarm_start(&alt_log_jtag_uart_alarm_1, \ - ALT_LOG_JTAG_UART_TICKS, &altera_avalon_jtag_uart_report_log,\ - dev);} \ - if (alt_log_jtag_uart_startup_info_on_flag==1) {\ - alt_log_jtag_uart_startup_info(dev, base);} \ - } while (0) - - /* JTAG UART IRQ Logging (when buffer is empty) - * Inserted in the ISR in altera_avalon_jtag_uart.c */ - #define ALT_LOG_JTAG_UART_ISR_FUNCTION(base, dev) \ - do { alt_log_jtag_uart_isr_proc(base, dev); } while (0) - /* else, define macros to nothing. Or else the jtag_uart specific types - * will throw compiler errors */ - #else - #define ALT_LOG_JTAG_UART_ALARM_REGISTER(dev, base) - #define ALT_LOG_JTAG_UART_ISR_FUNCTION(base, dev) - #endif - - /* System clock logging - * How often (in seconds) the system clock logging prints. - * The default value is every 1 second */ - #ifndef ALT_LOG_SYS_CLK_INTERVAL_MULTIPLIER - #define ALT_LOG_SYS_CLK_INTERVAL_MULTIPLIER 1 - #endif - #ifndef ALT_LOG_SYS_CLK_INTERVAL - #define ALT_LOG_SYS_CLK_INTERVAL \ - (alt_ticks_per_second()*ALT_LOG_SYS_CLK_INTERVAL_MULTIPLIER) - #endif - - /* System clock logging - prints a message every interval (set above) - * to show that the system clock is alive. - * This macro is used in altera_avalon_timer_sc.c */ - #define ALT_LOG_SYS_CLK_HEARTBEAT() \ - do { alt_log_system_clock(); } while (0) - - /* alt_write_logging - echos a message every time write() is called, - * displays the first ALT_LOG_WRITE_ECHO_LEN characters. - * This macro is used in alt_write.c */ - #ifndef ALT_LOG_WRITE_ECHO_LEN - #define ALT_LOG_WRITE_ECHO_LEN 15 - #endif - - #define ALT_LOG_WRITE_FUNCTION(ptr,len) \ - do { alt_log_write(ptr,len); } while (0) - -#else /* ALT_LOG_ENABLE not defined */ - - /* logging is off, set all relevant macros to null */ - #define ALT_LOG_PRINT_BOOT(...) - #define ALT_LOG_PRINTF(...) - #define ALT_LOG_JTAG_UART_ISR_FUNCTION(base, dev) - #define ALT_LOG_JTAG_UART_ALARM_REGISTER(dev, base) - #define ALT_LOG_SYS_CLK_HEARTBEAT() - #define ALT_LOG_PUTS(str) - #define ALT_LOG_WRITE_FUNCTION(ptr,len) - -#endif /* ALT_LOG_ENABLE */ - -#endif /* __ALT_LOG_PRINTF_H__ */ - diff --git a/software/qsys_tutorial_bsp/HAL/inc/sys/alt_set_args.h b/software/qsys_tutorial_bsp/HAL/inc/sys/alt_set_args.h deleted file mode 100644 index 3750e67..0000000 --- a/software/qsys_tutorial_bsp/HAL/inc/sys/alt_set_args.h +++ /dev/null @@ -1,71 +0,0 @@ -#ifndef __ALT_SET_ARGS_H__ -#define __ALT_SET_ARGS_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The function alt_set_args() is provided in order to define the input - * arguments to main(). If this function is not called before main() then the - * argument list passed to main() will be empty. - * - * It is expected that this function will only be used by the ihost/iclient - * utility. - */ - -static inline void alt_set_args (int argc, char** argv, char** envp) -{ - extern int alt_argc; - extern char** alt_argv; - extern char** alt_envp; - - alt_argc = argc; - alt_argv = argv; - alt_envp = envp; -} - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_SET_ARGS_H__ */ diff --git a/software/qsys_tutorial_bsp/HAL/inc/sys/alt_sim.h b/software/qsys_tutorial_bsp/HAL/inc/sys/alt_sim.h deleted file mode 100644 index 06bd27a..0000000 --- a/software/qsys_tutorial_bsp/HAL/inc/sys/alt_sim.h +++ /dev/null @@ -1,91 +0,0 @@ -#ifndef __ALT_SIM_H__ -#define __ALT_SIM_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ -#include "system.h" -#include "alt_types.h" - -/* - * Instructions that might mean something special to a simulator. - * These have no special effect on real hardware (they are just nops). - */ -#define ALT_SIM_FAIL() \ - do { __asm volatile ("cmpltui r0, r0, 0xabc1"); } while (0) - -#define ALT_SIM_PASS() \ - do { __asm volatile ("cmpltui r0, r0, 0xabc2"); } while (0) - -#define ALT_SIM_IN_TOP_OF_HOT_LOOP() \ - do { __asm volatile ("cmpltui r0, r0, 0xabc3"); } while (0) - -/* - * Routine called on exit. - */ -static ALT_ALWAYS_INLINE void alt_sim_halt(int exit_code) -{ - int r2 = exit_code; - -#if defined(NIOS2_HAS_DEBUG_STUB) && (defined(ALT_BREAK_ON_EXIT) || defined(ALT_PROVIDE_GMON)) - - int r3 = (1 << 2); - -#ifdef ALT_PROVIDE_GMON - extern unsigned int alt_gmon_data[]; - int r4 = (int)alt_gmon_data; - r3 |= (1 << 4); -#define ALT_GMON_DATA ,"D04"(r4) -#else -#define ALT_GMON_DATA -#endif /* ALT_PROVIDE_GMON */ - - if (r2) { - ALT_SIM_FAIL(); - } else { - ALT_SIM_PASS(); - } - - __asm__ volatile ("\n0:\n\taddi %0,%0, -1\n\tbgt %0,zero,0b" : : "r" (ALT_CPU_FREQ/100) ); /* Delay for >30ms */ - - __asm__ volatile ("break 2" : : "D02"(r2), "D03"(r3) ALT_GMON_DATA ); - -#else /* !DEBUG_STUB */ - if (r2) { - ALT_SIM_FAIL(); - } else { - ALT_SIM_PASS(); - } -#endif /* DEBUG_STUB */ -} - -#define ALT_SIM_HALT(exit_code) \ - alt_sim_halt(exit_code) - -#endif /* __ALT_SIM_H__ */ diff --git a/software/qsys_tutorial_bsp/HAL/inc/sys/alt_stack.h b/software/qsys_tutorial_bsp/HAL/inc/sys/alt_stack.h deleted file mode 100644 index e30652a..0000000 --- a/software/qsys_tutorial_bsp/HAL/inc/sys/alt_stack.h +++ /dev/null @@ -1,126 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#ifndef __ALT_STACK_H__ -#define __ALT_STACK_H__ - -/* - * alt_stack.h is the nios2 specific implementation of functions used by the - * stack overflow code. - */ - -#include "nios2.h" - -#include "alt_types.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - - -extern char * alt_stack_limit_value; - -#ifdef ALT_EXCEPTION_STACK -extern char __alt_exception_stack_pointer[]; /* set by the linker */ -#endif /* ALT_EXCEPTION_STACK */ - - -/* - * alt_stack_limit can be called to determine the current value of the stack - * limit register. - */ - -static ALT_INLINE char * ALT_ALWAYS_INLINE alt_stack_limit (void) -{ - char * limit; - NIOS2_READ_ET(limit); - - return limit; -} - -/* - * alt_stack_pointer can be called to determine the current value of the stack - * pointer register. - */ - -static ALT_INLINE char * ALT_ALWAYS_INLINE alt_stack_pointer (void) -{ - char * pointer; - NIOS2_READ_SP(pointer); - - return pointer; -} - - -#ifdef ALT_EXCEPTION_STACK - -/* - * alt_exception_stack_pointer returns the normal stack pointer from - * where it is stored on the exception stack (uppermost 4 bytes). This - * is really only useful during exception processing, and is only - * available if a separate exception stack has been configured. - */ - -static ALT_INLINE char * ALT_ALWAYS_INLINE alt_exception_stack_pointer (void) -{ - return (char *) *(alt_u32 *)(__alt_exception_stack_pointer - sizeof(alt_u32)); -} - -#endif /* ALT_EXCEPTION_STACK */ - - -/* - * alt_set_stack_limit can be called to update the current value of the stack - * limit register. - */ - -static ALT_INLINE void ALT_ALWAYS_INLINE alt_set_stack_limit (char * limit) -{ - alt_stack_limit_value = limit; - NIOS2_WRITE_ET(limit); -} - -/* - * alt_report_stack_overflow reports that a stack overflow happened. - */ - -static ALT_INLINE void ALT_ALWAYS_INLINE alt_report_stack_overflow (void) -{ - NIOS2_REPORT_STACK_OVERFLOW(); -} - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_STACK_H__ */ - diff --git a/software/qsys_tutorial_bsp/HAL/inc/sys/alt_stdio.h b/software/qsys_tutorial_bsp/HAL/inc/sys/alt_stdio.h deleted file mode 100644 index 1730360..0000000 --- a/software/qsys_tutorial_bsp/HAL/inc/sys/alt_stdio.h +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef __ALT_STDIO_H__ -#define __ALT_STDIO_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * Definitions for ALT stdio routines. - */ - -#include - - -#ifdef __cplusplus -extern "C" { -#endif - -int alt_getchar(); -int alt_putchar(int c); -int alt_putstr(const char* str); -void alt_printf(const char *fmt, ...); - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_STDIO_H__ */ diff --git a/software/qsys_tutorial_bsp/HAL/inc/sys/alt_sys_init.h b/software/qsys_tutorial_bsp/HAL/inc/sys/alt_sys_init.h deleted file mode 100644 index e4abc28..0000000 --- a/software/qsys_tutorial_bsp/HAL/inc/sys/alt_sys_init.h +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef __ALT_SYS_INIT_H__ -#define __ALT_SYS_INIT_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The function alt_sys_init() is defined within the auto-generated file: - * alt_sys_init.c. This function calls the initilisation macros for all - * devices, file systems, and software components within the system. - * - * The list of initilisation macros to use is constructed using the PTF and - * STF files associated with the system. - */ - -extern void alt_sys_init (void); - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_SYS_INIT_H__ */ diff --git a/software/qsys_tutorial_bsp/HAL/inc/sys/alt_sys_wrappers.h b/software/qsys_tutorial_bsp/HAL/inc/sys/alt_sys_wrappers.h deleted file mode 100644 index 044833b..0000000 --- a/software/qsys_tutorial_bsp/HAL/inc/sys/alt_sys_wrappers.h +++ /dev/null @@ -1,100 +0,0 @@ -#ifndef __ALT_SYS_WRAPPERS_H__ -#define __ALT_SYS_WRAPPERS_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * This file provides the prototypes for the HAL 'UNIX style functions. The - * names of these functions are defined in alt_syscall.h. THese are defined to - * be the standard names when running the standalone HAL, e.g. open(), close() - * etc., but the names may be redefined as a part of an operating system port - * in order to avoid name clashes. - */ - -#include "os/alt_syscall.h" - -#include -#include -#include -#include -#include -#include - -extern int ALT_CLOSE (int __fd); -extern int ALT_EXECVE (const char *__path, - char * const __argv[], - char * const __envp[]); -extern void ALT_EXIT (int __status); -extern int ALT_FSTAT (int file, struct stat *st); -extern int ALT_FCNTL (int file, int cmd, ...); -extern pid_t ALT_FORK (void); -extern pid_t ALT_GETPID (void); - -#if defined (__GNUC__) && __GNUC__ >= 4 -extern int ALT_GETTIMEOFDAY (struct timeval *ptimeval, - void *ptimezone); -#else -extern int ALT_GETTIMEOFDAY (struct timeval *ptimeval, - struct timezone *ptimezone); -#endif - -extern int ALT_IOCTL (int file, int req, void* arg); -extern int ALT_ISATTY (int file); -extern int ALT_KILL (int pid, int sig); -extern int ALT_LINK (const char *existing, const char *new); -extern off_t ALT_LSEEK (int file, off_t ptr, int dir); -extern int ALT_OPEN (const char* file, int flags, ...); -extern int ALT_READ (int file, void *ptr, size_t len); -extern int ALT_RENAME (char *existing, char *new); -extern void* ALT_SBRK (ptrdiff_t incr); -extern int ALT_SETTIMEOFDAY (const struct timeval *t, - const struct timezone *tz); -extern int ALT_STAT (const char *file, struct stat *st); -extern clock_t ALT_TIMES (struct tms *buf); -extern int ALT_UNLINK (const char *name); - -#if defined (__GNUC__) && __GNUC__ >= 4 -int ALT_USLEEP (useconds_t us); -#else -unsigned int ALT_USLEEP (unsigned int us); -#endif - -extern int ALT_WAIT (int *status); -extern int ALT_WRITE (int file, const void *ptr, size_t len); - - -extern char** ALT_ENVIRON; - -/* - * - */ - -#endif /* __ALT_SYS_WRAPPERS_H__ */ diff --git a/software/qsys_tutorial_bsp/HAL/inc/sys/alt_timestamp.h b/software/qsys_tutorial_bsp/HAL/inc/sys/alt_timestamp.h deleted file mode 100644 index 8a18da2..0000000 --- a/software/qsys_tutorial_bsp/HAL/inc/sys/alt_timestamp.h +++ /dev/null @@ -1,60 +0,0 @@ -#ifndef __ALT_TIMESTAMP_H__ -#define __ALT_TIMESTAMP_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "alt_types.h" -#include "altera_avalon_timer.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -extern int alt_timestamp_start (void); - -extern alt_timestamp_type alt_timestamp (void); - -extern alt_u32 alt_timestamp_freq (void); - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_TIMESTAMP_H__ */ diff --git a/software/qsys_tutorial_bsp/HAL/inc/sys/alt_warning.h b/software/qsys_tutorial_bsp/HAL/inc/sys/alt_warning.h deleted file mode 100644 index b66e71a..0000000 --- a/software/qsys_tutorial_bsp/HAL/inc/sys/alt_warning.h +++ /dev/null @@ -1,75 +0,0 @@ -#ifndef __WARNING_H__ -#define __WARNING_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * alt_warning.h provides macro definitions that can be used to generate link - * time warnings. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The symbol "__alt_invalid" is used to force a link error. There should be - * no corresponding implementation of this function. - */ - -extern void __alt_invalid (void); - -#define ALT_LINK_WARNING(symbol, msg) \ - __asm__(".ifndef __evoke_link_warning_" #symbol \ - "\n\t .section .gnu.warning." #symbol \ - "\n__evoke_link_warning_" #symbol ":\n\t .string \x22" msg "\x22 \n\t .previous" \ - "\n .endif"); - -/* A canned warning for sysdeps/stub functions. */ - -#define ALT_STUB_WARNING(name) \ - ALT_LINK_WARNING (name, \ - "warning: " #name " is not implemented and will always fail") - -#define ALT_OBSOLETE_FUNCTION_WARNING(name) \ - ALT_LINK_WARNING (name, \ - "warning: " #name " is a deprecated function") - -#define ALT_LINK_ERROR(msg) \ - ALT_LINK_WARNING (__alt_invalid, msg); \ - __alt_invalid() - -#ifdef __cplusplus -} -#endif - -#endif /* __WARNING_H__ */ diff --git a/software/qsys_tutorial_bsp/HAL/inc/sys/ioctl.h b/software/qsys_tutorial_bsp/HAL/inc/sys/ioctl.h deleted file mode 100644 index 4d565df..0000000 --- a/software/qsys_tutorial_bsp/HAL/inc/sys/ioctl.h +++ /dev/null @@ -1,90 +0,0 @@ -#ifndef __IOCTL_H__ -#define __IOCTL_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The ioctl() system call be used to initiate a variety of control operations - * on a file descriptor. For the most part this simply translates to a call to - * the ioctl() function of the associated device driver (TIOCEXCL and - * TIOCNXCL are notable exceptions - see ioctl.c for details). - * - * The interpretation of the ioctl requests are therefore device specific. - * - * This function is equivalent to the standard Posix ioctl() call. - */ - -extern int ioctl (int fd, int req, void* arg); - -/* - * list of ioctl calls handled by the system ioctl implementation. - */ - -#define TIOCEXCL 0x740d /* exclusive use of the device */ -#define TIOCNXCL 0x740e /* allow multiple use of the device */ - -/* - * ioctl calls which can be handled by device drivers. - */ - -#define TIOCOUTQ 0x7472 /* get output queue size */ -#define TIOCMGET 0x741d /* get termios flags */ -#define TIOCMSET 0x741a /* set termios flags */ - -/* - * ioctl calls specific to JTAG UART. - */ - -#define TIOCSTIMEOUT 0x6a01 /* Set Timeout before assuming no host present */ -#define TIOCGCONNECTED 0x6a02 /* Get indication of whether host is connected */ - -/* - * - */ - -#ifdef __cplusplus -} -#endif - -#endif /* __IOCTL_H__ */ diff --git a/software/qsys_tutorial_bsp/HAL/inc/sys/termios.h b/software/qsys_tutorial_bsp/HAL/inc/sys/termios.h deleted file mode 100644 index cd09539..0000000 --- a/software/qsys_tutorial_bsp/HAL/inc/sys/termios.h +++ /dev/null @@ -1,181 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * This is the termios.h file provided with newlib. The only modification has - * been to the baud rate macro definitions, and an increase in the size of the - * termios structure to accomodate this. - */ - - -#ifndef _SYS_TERMIOS_H -# define _SYS_TERMIOS_H - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -# define _XCGETA (('x'<<8)|1) -# define _XCSETA (('x'<<8)|2) -# define _XCSETAW (('x'<<8)|3) -# define _XCSETAF (('x'<<8)|4) -# define _TCSBRK (('T'<<8)|5) -# define _TCFLSH (('T'<<8)|7) -# define _TCXONC (('T'<<8)|6) - -# define TCOOFF 0 -# define TCOON 1 -# define TCIOFF 2 -# define TCION 3 - -# define TCIFLUSH 0 -# define TCOFLUSH 1 -# define TCIOFLUSH 2 - -# define NCCS 13 - -# define TCSAFLUSH _XCSETAF -# define TCSANOW _XCSETA -# define TCSADRAIN _XCSETAW -# define TCSADFLUSH _XCSETAF - -# define IGNBRK 000001 -# define BRKINT 000002 -# define IGNPAR 000004 -# define INPCK 000020 -# define ISTRIP 000040 -# define INLCR 000100 -# define IGNCR 000200 -# define ICRNL 000400 -# define IXON 002000 -# define IXOFF 010000 - -# define OPOST 000001 -# define OCRNL 000004 -# define ONLCR 000010 -# define ONOCR 000020 -# define TAB3 014000 - -# define CLOCAL 004000 -# define CREAD 000200 -# define CSIZE 000060 -# define CS5 0 -# define CS6 020 -# define CS7 040 -# define CS8 060 -# define CSTOPB 000100 -# define HUPCL 002000 -# define PARENB 000400 -# define PAODD 001000 - -#define CCTS_OFLOW 010000 -#define CRTS_IFLOW 020000 -#define CRTSCTS (CCTS_OFLOW | CRTS_IFLOW) - -# define ECHO 0000010 -# define ECHOE 0000020 -# define ECHOK 0000040 -# define ECHONL 0000100 -# define ICANON 0000002 -# define IEXTEN 0000400 /* anybody know *what* this does?! */ -# define ISIG 0000001 -# define NOFLSH 0000200 -# define TOSTOP 0001000 - -# define VEOF 4 /* also VMIN -- thanks, AT&T */ -# define VEOL 5 /* also VTIME -- thanks again */ -# define VERASE 2 -# define VINTR 0 -# define VKILL 3 -# define VMIN 4 /* also VEOF */ -# define VQUIT 1 -# define VSUSP 10 -# define VTIME 5 /* also VEOL */ -# define VSTART 11 -# define VSTOP 12 - -# define B0 0 -# define B50 50 -# define B75 75 -# define B110 110 -# define B134 134 -# define B150 150 -# define B200 200 -# define B300 300 -# define B600 600 -# define B1200 1200 -# define B1800 1800 -# define B2400 2400 -# define B4800 4800 -# define B9600 9600 -# define B19200 19200 -# define B38400 38400 -# define B57600 57600 -# define B115200 115200 - -typedef unsigned char cc_t; -typedef unsigned short tcflag_t; -typedef unsigned long speed_t; - -struct termios { - tcflag_t c_iflag; - tcflag_t c_oflag; - tcflag_t c_cflag; - tcflag_t c_lflag; - char c_line; - cc_t c_cc[NCCS]; - speed_t c_ispeed; - speed_t c_ospeed; -}; - -# ifndef _NO_MACROS - -# define cfgetospeed(tp) ((tp)->c_ospeed) -# define cfgetispeed(tp) ((tp)->c_ispeed) -# define cfsetospeed(tp,s) (((tp)->c_ospeed = (s)), 0) -# define cfsetispeed(tp,s) (((tp)->c_ispeed = (s)), 0) -# define tcdrain(fd) _ioctl (fd, _TCSBRK, 1) -# endif /* _NO_MACROS */ - -#ifdef __cplusplus -} -#endif - -#endif /* _SYS_TERMIOS_H */ - diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_alarm_start.c b/software/qsys_tutorial_bsp/HAL/src/alt_alarm_start.c deleted file mode 100644 index 7739959..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_alarm_start.c +++ /dev/null @@ -1,112 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "sys/alt_alarm.h" -#include "sys/alt_irq.h" - -/* - * alt_alarm_start is called to register an alarm with the system. The - * "alarm" structure passed as an input argument does not need to be - * initialised by the user. This is done within this function. - * - * The remaining input arguments are: - * - * nticks - The time to elapse until the alarm executes. This is specified in - * system clock ticks. - * callback - The function to run when the indicated time has elapsed. - * context - An opaque value, passed to the callback function. -* - * Care should be taken when defining the callback function since it is - * likely to execute in interrupt context. In particular, this mean that - * library calls like printf() should not be made, since they can result in - * deadlock. - * - * The interval to be used for the next callback is the return - * value from the callback function. A return value of zero indicates that the - * alarm should be unregistered. - * - * alt_alarm_start() will fail if the timer facility has not been enabled - * (i.e. there is no system clock). Failure is indicated by a negative return - * value. - */ - -int alt_alarm_start (alt_alarm* alarm, alt_u32 nticks, - alt_u32 (*callback) (void* context), - void* context) -{ - alt_irq_context irq_context; - alt_u32 current_nticks = 0; - - if (alt_ticks_per_second ()) - { - if (alarm) - { - alarm->callback = callback; - alarm->context = context; - - irq_context = alt_irq_disable_all (); - - current_nticks = alt_nticks(); - - alarm->time = nticks + current_nticks + 1; - - /* - * If the desired alarm time causes a roll-over, set the rollover - * flag. This will prevent the subsequent tick event from causing - * an alarm too early. - */ - if(alarm->time < current_nticks) - { - alarm->rollover = 1; - } - else - { - alarm->rollover = 0; - } - - alt_llist_insert (&alt_alarm_list, &alarm->llist); - alt_irq_enable_all (irq_context); - - return 0; - } - else - { - return -EINVAL; - } - } - else - { - return -ENOTSUP; - } -} diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_busy_sleep.c b/software/qsys_tutorial_bsp/HAL/src/alt_busy_sleep.c deleted file mode 100644 index 561c0be..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_busy_sleep.c +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright (c) 2003-2004 Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - * - * ------------ - * - * Altera does not recommend, suggest or require that this reference design - * file be used in conjunction or combination with any other product. - * - * alt_busy_sleep.c - Microsecond delay routine which uses a calibrated busy - * loop to perform the delay. This is used to implement - * usleep for both uC/OS-II and the standalone HAL. - * - * Author PRR - * - * Calibrated delay with no timer required - * - * The ASM instructions in the routine are equivalent to - * - * for (i=0;i -#include - -#include "system.h" -#include "alt_types.h" - -#include "priv/alt_busy_sleep.h" - -unsigned int alt_busy_sleep (unsigned int us) -{ -/* - * Only delay if ALT_SIM_OPTIMIZE is not defined; i.e., if software - * is built targetting ModelSim RTL simulation, the delay will be - * skipped to speed up simulation. - */ -#ifndef ALT_SIM_OPTIMIZE - int i; - int big_loops; - alt_u32 cycles_per_loop; - - if (!strcmp(NIOS2_CPU_IMPLEMENTATION,"tiny")) - { - cycles_per_loop = 9; - } - else - { - cycles_per_loop = 3; - } - - - big_loops = us / (INT_MAX/ - (ALT_CPU_FREQ/(cycles_per_loop * 1000000))); - - if (big_loops) - { - for(i=0;i - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -#ifdef ALT_USE_DIRECT_DRIVERS - -int ALT_CLOSE (int fildes) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(close); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -/* - * close() is called by an application to release a file descriptor. If the - * associated file system/device has a close() callback function registered - * then this called. The file descriptor is then marked as free. - * - * ALT_CLOSE is mapped onto the close() system call in alt_syscall.h - */ - -int ALT_CLOSE (int fildes) -{ - alt_fd* fd; - int rval; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (fildes < 0) ? NULL : &alt_fd_list[fildes]; - - if (fd) - { - /* - * If the associated file system/device has a close function, call it so - * that any necessary cleanup code can run. - */ - - rval = (fd->dev->close) ? fd->dev->close(fd) : 0; - - /* Free the file descriptor structure and return. */ - - alt_release_fd (fildes); - if (rval < 0) - { - ALT_ERRNO = -rval; - return -1; - } - return 0; - } - else - { - ALT_ERRNO = EBADFD; - return -1; - } -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_dcache_flush.c b/software/qsys_tutorial_bsp/HAL/src/alt_dcache_flush.c deleted file mode 100644 index 7ecc91a..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_dcache_flush.c +++ /dev/null @@ -1,97 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "nios2.h" -#include "system.h" - -#include "alt_types.h" -#include "sys/alt_cache.h" - -/* - * Nios II version 1.2 and newer supports the "flush by address" instruction, in - * addition to the "flush by line" instruction provided by older versions of - * the core. This newer instruction is used by preference when it is - * available. - */ - -#ifdef NIOS2_FLUSHDA_SUPPORTED -#define ALT_FLUSH_DATA(i) __asm__ volatile ("flushda (%0)" :: "r" (i)); -#else -#define ALT_FLUSH_DATA(i) __asm__ volatile ("flushd (%0)" :: "r" (i)); -#endif /* NIOS2_FLUSHDA_SUPPORTED */ - -/* - * alt_dcache_flush() is called to flush the data cache for a memory - * region of length "len" bytes, starting at address "start". - * - * Any dirty lines in the data cache are written back to memory. - */ - -void alt_dcache_flush (void* start, alt_u32 len) -{ -#if NIOS2_DCACHE_SIZE > 0 - - char* i; - char* end; - - /* - * This is the most we would ever need to flush. - * - * SPR 196942, 2006.01.13: The cache flush loop below will use the - * 'flushda' instruction if its available; in that case each line - * must be flushed individually, and thus 'len' cannot be trimmed. - */ - #ifndef NIOS2_FLUSHDA_SUPPORTED - if (len > NIOS2_DCACHE_SIZE) - { - len = NIOS2_DCACHE_SIZE; - } - #endif - - end = ((char*) start) + len; - - for (i = start; i < end; i+= NIOS2_DCACHE_LINE_SIZE) - { - ALT_FLUSH_DATA(i); - } - - /* - * For an unaligned flush request, we've got one more line left. - * Note that this is dependent on NIOS2_DCACHE_LINE_SIZE to be a - * multiple of 2 (which it always is). - */ - - if (((alt_u32) start) & (NIOS2_DCACHE_LINE_SIZE - 1)) - { - ALT_FLUSH_DATA(i); - } - -#endif /* NIOS2_DCACHE_SIZE > 0 */ -} diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_dcache_flush_all.c b/software/qsys_tutorial_bsp/HAL/src/alt_dcache_flush_all.c deleted file mode 100644 index 6529231..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_dcache_flush_all.c +++ /dev/null @@ -1,51 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "nios2.h" -#include "system.h" - -#include "alt_types.h" -#include "sys/alt_cache.h" - -/* - * alt_dcache_flush_all() is called to flush the entire data cache. - */ - -void alt_dcache_flush_all (void) -{ -#if NIOS2_DCACHE_SIZE > 0 - char* i; - - for (i = (char*) 0; i < (char*) NIOS2_DCACHE_SIZE; i+= NIOS2_DCACHE_LINE_SIZE) - { - __asm__ volatile ("flushd (%0)" :: "r" (i)); - } -#endif /* NIOS2_DCACHE_SIZE > 0 */ -} diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_dcache_flush_no_writeback.c b/software/qsys_tutorial_bsp/HAL/src/alt_dcache_flush_no_writeback.c deleted file mode 100644 index c65ca7d..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_dcache_flush_no_writeback.c +++ /dev/null @@ -1,88 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "nios2.h" -#include "system.h" - -#include "alt_types.h" -#include "sys/alt_cache.h" - -/* - * The INITDA instruction was added to Nios II in the 8.0 release. - * - * The INITDA instruction has one of the following possible behaviors - * depending on the processor configuration: - * 1) Flushes a line by address but does NOT write back dirty data. - * Occurs when a data cache is present that supports INITDA. - * The macro NIOS2_INITDA_SUPPORTED is defined in system.h. - * 2) Takes an unimplemented instruction exception. - * Occurs when a data cache is present that doesn't support INITDA. - * 3) Performs no operation - * Occurs when there is no data cache present. - * The macro NIOS2_DCACHE_SIZE is 0 in system.h. - */ - -#define ALT_FLUSH_DATA_NO_WRITEBACK(i) \ - __asm__ volatile ("initda (%0)" :: "r" (i)); - -/* - * alt_dcache_flush_no_writeback() is called to flush the data cache for a - * memory region of length "len" bytes, starting at address "start". - * - * Any dirty lines in the data cache are NOT written back to memory. - * Make sure you really want this behavior. If you aren't 100% sure, - * use the alt_dcache_flush() routine instead. - */ - -void alt_dcache_flush_no_writeback (void* start, alt_u32 len) -{ -#if defined(NIOS2_INITDA_SUPPORTED) - - char* i; - char* end = ((char*) start) + len; - - for (i = start; i < end; i+= NIOS2_DCACHE_LINE_SIZE) - { - ALT_FLUSH_DATA_NO_WRITEBACK(i); - } - - /* - * For an unaligned flush request, we've got one more line left. - * Note that this is dependent on NIOS2_DCACHE_LINE_SIZE to be a - * multiple of 2 (which it always is). - */ - - if (((alt_u32) start) & (NIOS2_DCACHE_LINE_SIZE - 1)) - { - ALT_FLUSH_DATA_NO_WRITEBACK(i); - } - -#endif /* NIOS2_INITDA_SUPPORTED */ -} diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_dev.c b/software/qsys_tutorial_bsp/HAL/src/alt_dev.c deleted file mode 100644 index ebc15e5..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_dev.c +++ /dev/null @@ -1,149 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include -#include -#include - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - -#include "alt_types.h" - -#include "system.h" - -/* - * This file contains the data constructs used to control access to device and - * filesytems. - */ - -/* - * "alt_fs_list" is the head of a linked list of registered filesystems. It is - * initialised as an empty list. New entries can be added using the - * alt_fs_reg() function. - */ - -ALT_LLIST_HEAD(alt_fs_list); - - -/* - * "alt_dev_list" is the head of a linked list of registered devices. It is - * configured at startup to include a single device, "alt_dev_null". This - * device is discussed below. - */ - -extern alt_dev alt_dev_null; /* forward declaration */ - -alt_llist alt_dev_list = {&alt_dev_null.llist, &alt_dev_null.llist}; - -/* - * alt_dev_null_write() is the implementation of the write() function used - * by the alt_dev_null device. It simple discards all data passed to it, and - * indicates that the data has been successfully transmitted. - */ - -static int alt_dev_null_write (alt_fd* fd, const char* ptr, int len) -{ - return len; -} - -/* - * "alt_dev_null" is used to allow output to be redirected to nowhere. It is - * the only device registered before the call to alt_sys_init(). At startup - * stin, stdout & stderr are all directed towards this device so that library - * calls like printf() will be safe but inefectual. - */ - -alt_dev alt_dev_null = { - { - &alt_dev_list, - &alt_dev_list - }, - "/dev/null", - NULL, /* open */ - NULL, /* close */ - NULL, /* write */ - alt_dev_null_write, /* write */ - NULL, /* lseek */ - NULL, /* fstat */ - NULL /* ioctl */ - }; - -/* - * "alt_fd_list_lock" is a semaphore used to control access to the file - * descriptor list. This is used to ensure that access to the list is thread - * safe. - */ - -ALT_SEM(alt_fd_list_lock) - -/* - * "alt_max_fd" is used to make access to the file descriptor list more - * efficent. It is set to be the value of the highest allocated file - * descriptor. This saves having to search the entire pool of unallocated - * file descriptors when looking for a match. - */ - -alt_32 alt_max_fd = -1; - -/* - * "alt_fd_list" is the file descriptor pool. The first three entries in the - * array are configured as standard in, standard out, and standard error. These - * are all initialised so that accesses are directed to the alt_dev_null - * device. The remaining file descriptors are initialised as unallocated. - * - * The maximum number of file descriptors within the system is specified by the - * user defined macro "ALT_MAX_FD". This is defined in "system.h", which is - * auto-genereated using the projects PTF and STF files. - */ - -alt_fd alt_fd_list[ALT_MAX_FD] = - { - { - &alt_dev_null, /* standard in */ - 0, - 0 - }, - { - &alt_dev_null, /* standard out */ - 0, - 0 - }, - { - &alt_dev_null, /* standard error */ - 0, - 0 - } - /* all other elements are set to zero */ - }; diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_dev_llist_insert.c b/software/qsys_tutorial_bsp/HAL/src/alt_dev_llist_insert.c deleted file mode 100644 index fa7239d..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_dev_llist_insert.c +++ /dev/null @@ -1,59 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "priv/alt_dev_llist.h" -#include "sys/alt_errno.h" - -/* - * - */ - -int alt_dev_llist_insert (alt_dev_llist* dev, alt_llist* list) -{ - /* - * check that the device exists, and that it has a valid name. - */ - - if (!dev || !dev->name) - { - ALT_ERRNO = EINVAL; - return -EINVAL; - } - - /* - * register the device. - */ - - alt_llist_insert(list, &dev->llist); - - return 0; -} diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_dma_rxchan_open.c b/software/qsys_tutorial_bsp/HAL/src/alt_dma_rxchan_open.c deleted file mode 100644 index 6ea3b78..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_dma_rxchan_open.c +++ /dev/null @@ -1,63 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_dma.h" -#include "sys/alt_errno.h" -#include "priv/alt_file.h" - -/* - * The list of registered DMA receive channels. - */ - -ALT_LLIST_HEAD(alt_dma_rxchan_list); - -/* - * alt_dma_txchan_open() is used to obtain an "alt_dma_txchan" descriptor for - * a DMA transmit device. The name is the name of the associated physical - * device (e.g. "/dev/dma_0"). - * - * The return value will be NULL on failure, and non-NULL otherwise. - */ - -alt_dma_rxchan alt_dma_rxchan_open (const char* name) -{ - alt_dma_rxchan dev; - - dev = (alt_dma_rxchan) alt_find_dev (name, &alt_dma_rxchan_list); - - if (!dev) - { - ALT_ERRNO = ENODEV; - } - - return dev; -} diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_dma_txchan_open.c b/software/qsys_tutorial_bsp/HAL/src/alt_dma_txchan_open.c deleted file mode 100644 index f41fa81..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_dma_txchan_open.c +++ /dev/null @@ -1,63 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_dma.h" -#include "sys/alt_errno.h" -#include "priv/alt_file.h" - -/* - * The list of registered receive channels. - */ - -ALT_LLIST_HEAD(alt_dma_txchan_list); - -/* - * alt_dma_txchan_open() is used to obtain an "alt_dma_txchan" descriptor for - * a DMA transmit device. The name is the name of the associated physical - * device (e.g. "/dev/dma_0"). - * - * The return value will be NULL on failure, and non-NULL otherwise. - */ - -alt_dma_txchan alt_dma_txchan_open (const char* name) -{ - alt_dma_txchan dev; - - dev = (alt_dma_txchan) alt_find_dev (name, &alt_dma_txchan_list); - - if (!dev) - { - ALT_ERRNO = ENODEV; - } - - return dev; -} diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_do_ctors.c b/software/qsys_tutorial_bsp/HAL/src/alt_do_ctors.c deleted file mode 100644 index ff5a1f7..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_do_ctors.c +++ /dev/null @@ -1,64 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT IT DIRECTLY. * -* * -* Overriding HAL Functions * -* * -* To provide your own implementation of a HAL function, include the file in * -* your Nios II IDE application project. When building the executable, the * -* Nios II IDE finds your function first, and uses it in place of the HAL * -* version. * -* * -******************************************************************************/ - -/* - * - */ - -typedef void (*constructor) (void); -extern constructor __CTOR_LIST__[]; -extern constructor __CTOR_END__[]; - -/* - * Run the C++ static constructors. - */ - -void _do_ctors(void) -{ - constructor* ctor; - - for (ctor = &__CTOR_END__[-1]; ctor >= __CTOR_LIST__; ctor--) - (*ctor) (); -} diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_do_dtors.c b/software/qsys_tutorial_bsp/HAL/src/alt_do_dtors.c deleted file mode 100644 index 565c99f..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_do_dtors.c +++ /dev/null @@ -1,64 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT IT DIRECTLY. * -* * -* Overriding HAL Functions * -* * -* To provide your own implementation of a HAL function, include the file in * -* your Nios II IDE application project. When building the executable, the * -* Nios II IDE finds your function first, and uses it in place of the HAL * -* version. * -* * -******************************************************************************/ - -/* - * - */ - -typedef void (*destructor) (void); -extern destructor __DTOR_LIST__[]; -extern destructor __DTOR_END__[]; - -/* - * Run the C++ static destructors. - */ - -void _do_dtors(void) -{ - destructor* dtor; - - for (dtor = &__DTOR_END__[-1]; dtor >= __DTOR_LIST__; dtor--) - (*dtor) (); -} diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_env_lock.c b/software/qsys_tutorial_bsp/HAL/src/alt_env_lock.c deleted file mode 100644 index fc25a0c..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_env_lock.c +++ /dev/null @@ -1,53 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -/* - * These are the empty env lock/unlock stubs required by newlib. These are - * used to make accesses to environment variables thread safe. The default HAL - * configuration is single threaded, so there is nothing to do here. Note that - * this requires that environment variables are never manipulated by an interrupt - * service routine. - */ - -void __env_lock ( struct _reent *_r ) -{ -} - -/* - * - */ - -void __env_unlock ( struct _reent *_r ) -{ -} diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_environ.c b/software/qsys_tutorial_bsp/HAL/src/alt_environ.c deleted file mode 100644 index 404efc4..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_environ.c +++ /dev/null @@ -1,42 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "os/alt_syscall.h" - -/* - * These are the environment variables passed to the C code. By default there - * are no variables registered. An application can manipulate this list using - * getenv() and setenv(). - */ - -char *__env[1] = { 0 }; -char **ALT_ENVIRON = __env; diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_errno.c b/software/qsys_tutorial_bsp/HAL/src/alt_errno.c deleted file mode 100644 index 1d8368d..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_errno.c +++ /dev/null @@ -1,44 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/* - * This file defines the alt_errno global variable. See comments in - * alt_errno.h for the use of this variable. - */ - - -#include "sys/alt_errno.h" -#include "alt_types.h" - -extern int ALT_WEAK *__errno (void); - -int* (*alt_errno) (void) = __errno; diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_exception_entry.S b/software/qsys_tutorial_bsp/HAL/src/alt_exception_entry.S deleted file mode 100644 index 3afab93..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_exception_entry.S +++ /dev/null @@ -1,360 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2008 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "system.h" - -/* - * This is the exception entry point code, which saves all the caller saved - * registers and then handles the appropriate exception. It should be pulled - * in using a .globl from all the exception handler routines. This scheme is - * used so that if an interrupt is never registered, then this code will not - * appear in the generated executable, thereby improving code footprint. - * - * If an external interrpt controller (EIC) is present, it will supply an - * interrupt vector address to the processor when an interrupt occurs. For - * The Altera Vectored Interrupt Controller (VIC) driver will establish a - * vector table and the processor will jump directly to the appropriate - * table entry, funnel routine, and then user ISR. This will bypass this code - * in entirety. This code might still be linked into a system with an EIC, - * but would then be used only for non-interrupt exceptions. - */ - - /* - * Explicitly allow the use of r1 (the assembler temporary register) - * within this code. This register is normally reserved for the use of - * the assembler. - */ - .set noat - - /* - * The top and bottom of the exception stack - */ -#ifdef ALT_EXCEPTION_STACK - - .globl __alt_exception_stack_pointer - -#ifdef ALT_STACK_CHECK - - .globl __alt_exception_stack_limit - - /* - * We need to store the value of the stack limit after interrupt somewhere. - */ - .globl alt_exception_old_stack_limit - -#endif -#endif - - .section .exceptions.entry.label, "xa" - - .globl alt_exception - .type alt_exception, @function -alt_exception: - - .section .exceptions.entry, "xa" - -#ifdef ALT_EXCEPTION_STACK - -#ifdef ALT_STACK_CHECK - stw et, %gprel(alt_exception_old_stack_limit)(gp) -#endif - - movhi et, %hiadj(__alt_exception_stack_pointer - 80) - addi et, et, %lo(__alt_exception_stack_pointer - 80) - stw sp, 76(et) - mov sp, et - -#ifdef ALT_STACK_CHECK - movhi et, %hiadj(__alt_exception_stack_limit) - addi et, et, %lo(__alt_exception_stack_limit) - stw et, %gprel(alt_stack_limit_value)(gp) -#endif - -#else - /* - * Process an exception. For all exceptions we must preserve all - * caller saved registers on the stack (See the Nios2 ABI - * documentation for details). - */ - - addi sp, sp, -76 - -#ifdef ALT_STACK_CHECK - - bltu sp, et, .Lstack_overflow - -#endif - -#endif - - stw ra, 0(sp) - - /* - * Leave a gap in the stack frame at 4(sp) for the muldiv handler to - * store zero into. - */ - - stw r1, 8(sp) - stw r2, 12(sp) - stw r3, 16(sp) - stw r4, 20(sp) - stw r5, 24(sp) - stw r6, 28(sp) - stw r7, 32(sp) - - rdctl r5, estatus - - stw r8, 36(sp) - stw r9, 40(sp) - stw r10, 44(sp) - stw r11, 48(sp) - stw r12, 52(sp) - stw r13, 56(sp) - stw r14, 60(sp) - stw r15, 64(sp) - - /* - * ea-4 contains the address of the instruction being executed - * when the exception occured. For interrupt exceptions, we will - * will be re-issue the isntruction. Store it in 72(sp) - */ - stw r5, 68(sp) /* estatus */ - addi r15, ea, -4 /* instruction that caused exception */ - stw r15, 72(sp) - - /* - * The interrupt testing code (.exceptions.irqtest) will be - * linked here. If the Internal Interrupt Controller (IIC) is - * present (an EIC is not present), the presense of an interrupt - * is determined by examining CPU control registers or an interrupt - * custom instruction, if present. - * - * If the IIC is used and an interrupt is active, the code linked - * here will call the HAL IRQ handler (alt_irq_handler()) which - * successively calls registered interrupt handler(s) until no - * interrupts remain pending. It then jumps to .exceptions.exit. If - * there is no interrupt then it continues to .exception.notirq, below. - */ - - .section .exceptions.notirq, "xa" - - /* - * Prepare to service unimplemtned instructions or traps, - * each of which is optionally inked into section .exceptions.soft, - * which will preceed .exceptions.unknown below. - * - * Unlike interrupts, we want to skip the exception-causing instructon - * upon completion, so we write ea (address of instruction *after* - * the one where the exception occured) into 72(sp). The actual - * instruction that caused the exception is written in r2, which these - * handlers will utilize. - */ - stw ea, 72(sp) /* Don't re-issue */ - ldw r2, -4(ea) /* Instruction that caused exception */ - - /* - * Other exception handling code, if enabled, will be linked here. - * This includes unimplemted (multiply/divide) instruction support - * (a BSP generaton option), and a trap handler (that would typically - * be augmented with user-specific code). These are not linked in by - * default. - */ - - /* - * In the context of linker sections, "unknown" are all exceptions - * not handled by the built-in handlers above (interupt, and trap or - * unimplemented instruction decoding, if enabled). - * - * Advanced exception types can be serviced by registering a handler. - * To do so, enable the "Enable Instruction-related Exception API" HAL - * BSP setting. If this setting is disabled, this handler code will - * either break (if the debug core is present) or enter an infinite - * loop because we don't how how to handle the exception. - */ - .section .exceptions.unknown -#ifdef ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API - /* - * The C-based HAL routine alt_instruction_exception_entry() will - * attempt to service the exception by calling a user-registered - * exception handler using alt_instruction_exception_register(). - * If no handler was registered it will either break (if the - * debugger is present) or go into an infinite loop since the - * handling behavior is undefined; in that case we will not return here. - */ - - /* Load exception-causing address as first argument (r4) */ - addi r4, ea, -4 - - /* Call the instruction-exception entry */ - call alt_instruction_exception_entry - - /* - * If alt_instruction_exception_entry() returned, the exception was - * serviced by a user-registered routine. Its return code (now in r2) - * indicates whether to re-issue or skip the exception-causing - * instruction - * - * Return code was 0: Skip. The instruction after the exception is - * already stored in 72(sp). - */ - bne r2, r0, .Lexception_exit - - /* - * Otherwise, modify 72(sp) to re-issue the instruction that caused the - * exception. - */ - addi r15, ea, -4 /* instruction that caused exception */ - stw r15, 72(sp) - -#else /* ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API disabled */ - - /* - * We got here because an instruction-related exception occured, but the - * handler API was not compiled in. We do not presume to know how to - * handle it. If the debugger is present, break, otherwise hang. - * - * If you get here then one of the following could have happened: - * - * - An instruction-generated exception occured, and the processor - * does not have the extra exceptions feature enabled, or you - * have not registered a handler using - * alt_instruction_exception_register() - * - * Some examples of instruction-generated exceptions and why they - * might occur: - * - * - Your program could have been compiled for a full-featured - * Nios II core, but it is running on a smaller core, and - * instruction emulation has been disabled by defining - * ALT_NO_INSTRUCTION_EMULATION. - * - * You can work around the problem by re-enabling instruction - * emulation, or you can figure out why your program is being - * compiled for a system other than the one that it is running on. - * - * - Your program has executed a trap instruction, but has not - * implemented a handler for this instruction. - * - * - Your program has executed an illegal instruction (one which is - * not defined in the instruction set). - * - * - Your processor includes an MMU or MPU, and you have enabled it - * before registering an exception handler to service exceptions it - * generates. - * - * The problem could also be hardware related: - * - If your hardware is broken and is generating spurious interrupts - * (a peripheral which negates its interrupt output before its - * interrupt handler has been executed will cause spurious - * interrupts) - */ -#ifdef NIOS2_HAS_DEBUG_STUB - /* - * Either tell the user now (if there is a debugger attached) or go into - * the debug monitor which will loop until a debugger is attached. - */ - break -#else - /* - * If there is no debug stub then a BREAK will probably cause a reboot. - * An infinate loop will probably be more useful. - */ -0: - br 0b -#endif /* NIOS2_HAS_DEBUG_STUB */ - -#endif /* ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API */ - - .section .exceptions.exit.label -.Lexception_exit: - - .section .exceptions.exit, "xa" - - /* - * Restore the saved registers, so that all general purpose registers - * have been restored to their state at the time the interrupt occured. - */ - - ldw r5, 68(sp) - ldw ea, 72(sp) /* This becomes the PC once eret is executed */ - ldw ra, 0(sp) - - wrctl estatus, r5 - - ldw r1, 8(sp) - ldw r2, 12(sp) - ldw r3, 16(sp) - ldw r4, 20(sp) - ldw r5, 24(sp) - ldw r6, 28(sp) - ldw r7, 32(sp) - -#ifdef ALT_EXCEPTION_STACK -#ifdef ALT_STACK_CHECK - ldw et, %gprel(alt_exception_old_stack_limit)(gp) -#endif -#endif - - ldw r8, 36(sp) - ldw r9, 40(sp) - ldw r10, 44(sp) - ldw r11, 48(sp) - ldw r12, 52(sp) - ldw r13, 56(sp) - ldw r14, 60(sp) - ldw r15, 64(sp) - -#ifdef ALT_EXCEPTION_STACK - -#ifdef ALT_STACK_CHECK - stw et, %gprel(alt_stack_limit_value)(gp) - stw zero, %gprel(alt_exception_old_stack_limit)(gp) -#endif - - ldw sp, 76(sp) - -#else - addi sp, sp, 76 - -#endif - - /* - * Return to the interrupted instruction. - */ - - eret - -#ifdef ALT_STACK_CHECK - -.Lstack_overflow: - break 3 - -#endif - diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_exception_muldiv.S b/software/qsys_tutorial_bsp/HAL/src/alt_exception_muldiv.S deleted file mode 100644 index 55617a6..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_exception_muldiv.S +++ /dev/null @@ -1,583 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - - /* - * This is the software multiply/divide handler for Nios2. - */ - - /* - * Provide a label which can be used to pull this file in. - */ - - .section .exceptions.start - .globl alt_exception_muldiv -alt_exception_muldiv: - - /* - * Pull in the entry/exit code. - */ - .globl alt_exception - - - .section .exceptions.soft, "xa" - - - /* INSTRUCTION EMULATION - * --------------------- - * - * Nios II processors generate exceptions for unimplemented instructions. - * The routines below emulate these instructions. Depending on the - * processor core, the only instructions that might need to be emulated - * are div, divu, mul, muli, mulxss, mulxsu, and mulxuu. - * - * The emulations match the instructions, except for the following - * limitations: - * - * 1) The emulation routines do not emulate the use of the exception - * temporary register (et) as a source operand because the exception - * handler already has modified it. - * - * 2) The routines do not emulate the use of the stack pointer (sp) or the - * exception return address register (ea) as a destination because - * modifying these registers crashes the exception handler or the - * interrupted routine. - * - * 3) To save code size, the routines do not emulate the use of the - * breakpoint registers (ba and bt) as operands. - * - * Detailed Design - * --------------- - * - * The emulation routines expect the contents of integer registers r0-r31 - * to be on the stack at addresses sp, 4(sp), 8(sp), ... 124(sp). The - * routines retrieve source operands from the stack and modify the - * destination register's value on the stack prior to the end of the - * exception handler. Then all registers except the destination register - * are restored to their previous values. - * - * The instruction that causes the exception is found at address -4(ea). - * The instruction's OP and OPX fields identify the operation to be - * performed. - * - * One instruction, muli, is an I-type instruction that is identified by - * an OP field of 0x24. - * - * muli AAAAA,BBBBB,IIIIIIIIIIIIIIII,-0x24- - * 27 22 6 0 <-- LSB of field - * - * The remaining emulated instructions are R-type and have an OP field - * of 0x3a. Their OPX fields identify them. - * - * R-type AAAAA,BBBBB,CCCCC,XXXXXX,NNNNN,-0x3a- - * 27 22 17 11 6 0 <-- LSB of field - * - * - */ - - - /* - * Split the instruction into its fields. We need 4*A, 4*B, and 4*C as - * offsets to the stack pointer for access to the stored register values. - */ - /* r2 = AAAAA,BBBBB,IIIIIIIIIIIIIIII,PPPPPP */ - roli r3, r2, 7 /* r3 = BBB,IIIIIIIIIIIIIIII,PPPPPP,AAAAA,BB */ - roli r4, r3, 3 /* r4 = IIIIIIIIIIIIIIII,PPPPPP,AAAAA,BBBBB */ - roli r6, r4, 2 /* r6 = IIIIIIIIIIIIII,PPPPPP,AAAAA,BBBBB,II */ - srai r4, r4, 16 /* r4 = (sign-extended) IMM16 */ - xori r6, r6, 0x42 /* r6 = CCC,XXXXXX,NNNNN,PPPPPP,AAAAA,bBBBB,cC */ - roli r7, r6, 5 /* r7 = XXXX,NNNNN,PPPPPP,AAAAA,bBBBB,cCCCC,XX */ - andi r5, r2, 0x3f /* r5 = 00000000000000000000000000,PPPPPP */ - xori r3, r3, 0x40 - andi r3, r3, 0x7c /* r3 = 0000000000000000000000000,aAAAA,00 */ - andi r6, r6, 0x7c /* r6 = 0000000000000000000000000,bBBBB,00 */ - andi r7, r7, 0x7c /* r7 = 0000000000000000000000000,cCCCC,00 */ - - /* Now either - * r5 = OP - * r3 = 4*(A^16) - * r4 = IMM16 (sign extended) - * r6 = 4*(B^16) - * r7 = 4*(C^16) - * or - * r5 = OP - */ - - - /* - * Save everything on the stack to make it easy for the emulation routines - * to retrieve the source register operands. The exception entry code has - * already saved some of this so we don't need to do it all again. - */ - - addi sp, sp, -60 - stw zero, 64(sp) /* Save zero on stack to avoid special case for r0. */ - /* Register at and r2-r15 have already been saved. */ - - stw r16, 0(sp) - stw r17, 4(sp) - stw r18, 8(sp) - stw r19, 12(sp) - stw r20, 16(sp) - stw r21, 20(sp) - stw r22, 24(sp) - stw r23, 28(sp) - /* et @ 32 - Has already been changed.*/ - /* bt @ 36 - Usually isn't an operand. */ - stw gp, 40(sp) - stw sp, 44(sp) - stw fp, 48(sp) - /* ea @ 52 - Don't bother to save - it's already been changed */ - /* ba @ 56 - Breakpoint register usually isn't an operand */ - /* ra @ 60 - Has already been saved */ - - - /* - * Prepare for either multiplication or division loop. - * They both loop 32 times. - */ - movi r14, 32 - - - /* - * Get the operands. - * - * It is necessary to check for muli because it uses an I-type instruction - * format, while the other instructions are have an R-type format. - */ - add r3, r3, sp /* r3 = address of A-operand. */ - ldw r3, 0(r3) /* r3 = A-operand. */ - movi r15, 0x24 /* muli opcode (I-type instruction format) */ - beq r5, r15, .Lmul_immed /* muli doesn't use the B register as a source */ - - add r6, r6, sp /* r6 = address of B-operand. */ - ldw r6, 0(r6) /* r6 = B-operand. */ - /* r4 = SSSSSSSSSSSSSSSS,-----IMM16------ */ - /* IMM16 not needed, align OPX portion */ - /* r4 = SSSSSSSSSSSSSSSS,CCCCC,-OPX--,00000 */ - srli r4, r4, 5 /* r4 = 00000,SSSSSSSSSSSSSSSS,CCCCC,-OPX-- */ - andi r4, r4, 0x3f /* r4 = 00000000000000000000000000,-OPX-- */ - - /* Now - * r5 = OP - * r3 = src1 - * r6 = src2 - * r4 = OPX (no longer can be muli) - * r7 = 4*(C^16) - * r14 = loop counter - */ - - /* ILLEGAL-INSTRUCTION EXCEPTION - * ----------------------------- - * - * This code is for Nios II cores that generate exceptions when attempting - * to execute illegal instructions. Nios II cores that support an - * illegal-instruction exception are identified by the presence of the - * macro definition NIOS2_HAS_ILLEGAL_INSTRUCTION_EXCEPTION in system.h . - * - * Remember that illegal instructions are different than unimplemented - * instructions. Illegal instructions are instruction encodings that - * have not been defined by the Nios II ISA. Unimplemented instructions - * are legal instructions that must be emulated by some Nios II cores. - * - * If we get here, all instructions except multiplies and divides - * are illegal. - * - * This code assumes that OP is not muli (because muli was tested above). - * All other multiplies and divides are legal. Anything else is illegal. - */ - - movi r8, 0x3a /* OP for R-type mul* and div* */ - bne r5, r8, .Lnot_muldiv - - /* r15 already is 0x24 */ /* OPX of divu */ - beq r4, r15, .Ldivide - - movi r15,0x27 /* OPX of mul */ - beq r4, r15, .Lmultiply - - movi r15,0x07 /* OPX of mulxuu */ - beq r4, r15, .Lmultiply - - movi r15,0x17 /* OPX of mulxsu */ - beq r4, r15, .Lmultiply - - movi r15,0x1f /* OPX of mulxss */ - beq r4, r15, .Lmultiply - - movi r15,0x25 /* OPX of div */ - bne r4, r15, .Lnot_muldiv - - - /* DIVISION - * - * Divide an unsigned dividend by an unsigned divisor using - * a shift-and-subtract algorithm. The example below shows - * 43 div 7 = 6 for 8-bit integers. This classic algorithm uses a - * single register to store both the dividend and the quotient, - * allowing both values to be shifted with a single instruction. - * - * remainder dividend:quotient - * --------- ----------------- - * initialize 00000000 00101011: - * shift 00000000 0101011:_ - * remainder >= divisor? no 00000000 0101011:0 - * shift 00000000 101011:0_ - * remainder >= divisor? no 00000000 101011:00 - * shift 00000001 01011:00_ - * remainder >= divisor? no 00000001 01011:000 - * shift 00000010 1011:000_ - * remainder >= divisor? no 00000010 1011:0000 - * shift 00000101 011:0000_ - * remainder >= divisor? no 00000101 011:00000 - * shift 00001010 11:00000_ - * remainder >= divisor? yes 00001010 11:000001 - * remainder -= divisor - 00000111 - * ---------- - * 00000011 11:000001 - * shift 00000111 1:000001_ - * remainder >= divisor? yes 00000111 1:0000011 - * remainder -= divisor - 00000111 - * ---------- - * 00000000 1:0000011 - * shift 00000001 :0000011_ - * remainder >= divisor? no 00000001 :00000110 - * - * The quotient is 00000110. - */ - -.Ldivide: - /* - * Prepare for division by assuming the result - * is unsigned, and storing its "sign" as 0. - */ - movi r17, 0 - - - /* Which division opcode? */ - xori r15, r4, 0x25 /* OPX of div */ - bne r15, zero, .Lunsigned_division - - - /* - * OPX is div. Determine and store the sign of the quotient. - * Then take the absolute value of both operands. - */ - xor r17, r3, r6 /* MSB contains sign of quotient */ - bge r3, zero, 0f - sub r3, zero, r3 /* -r3 */ -0: - bge r6, zero, 0f - sub r6, zero, r6 /* -r6 */ -0: - - -.Lunsigned_division: - /* Initialize the unsigned-division loop. */ - movi r13, 0 /* remainder = 0 */ - - /* Now - * r3 = dividend : quotient - * r4 = 0x25 for div, 0x24 for divu - * r6 = divisor - * r13 = remainder - * r14 = loop counter (already initialized to 32) - * r17 = MSB contains sign of quotient - */ - - - /* - * for (count = 32; count > 0; --count) - * { - */ -.Ldivide_loop: - - /* - * Division: - * - * (remainder:dividend:quotient) <<= 1; - */ - slli r13, r13, 1 - cmplt r15, r3, zero /* r15 = MSB of r3 */ - or r13, r13, r15 - slli r3, r3, 1 - - - /* - * if (remainder >= divisor) - * { - * set LSB of quotient - * remainder -= divisor; - * } - */ - bltu r13, r6, .Ldiv_skip - ori r3, r3, 1 - sub r13, r13, r6 -.Ldiv_skip: - - /* - * } - */ - subi r14, r14, 1 - bne r14, zero, .Ldivide_loop - - mov r9, r3 - - - /* Now - * r9 = quotient - * r4 = 0x25 for div, 0x24 for divu - * r7 = 4*(C^16) - * r17 = MSB contains sign of quotient - */ - - - /* - * Conditionally negate signed quotient. If quotient is unsigned, - * the sign already is initialized to 0. - */ - bge r17, zero, .Lstore_result - sub r9, zero, r9 /* -r9 */ - - br .Lstore_result - - - - - /* MULTIPLICATION - * - * A "product" is the number that one gets by summing a "multiplicand" - * several times. The "multiplier" specifies the number of copies of the - * multiplicand that are summed. - * - * Actual multiplication algorithms don't use repeated addition, however. - * Shift-and-add algorithms get the same answer as repeated addition, and - * they are faster. To compute the lower half of a product (pppp below) - * one shifts the product left before adding in each of the partial products - * (a * mmmm) through (d * mmmm). - * - * To compute the upper half of a product (PPPP below), one adds in the - * partial products (d * mmmm) through (a * mmmm), each time following the - * add by a right shift of the product. - * - * mmmm - * * abcd - * ------ - * #### = d * mmmm - * #### = c * mmmm - * #### = b * mmmm - * #### = a * mmmm - * -------- - * PPPPpppp - * - * The example above shows 4 partial products. Computing actual Nios II - * products requires 32 partials. - * - * It is possible to compute the result of mulxsu from the result of mulxuu - * because the only difference between the results of these two opcodes is - * the value of the partial product associated with the sign bit of rA. - * - * mulxsu = mulxuu - ((rA < 0) ? rB : 0); - * - * It is possible to compute the result of mulxss from the result of mulxsu - * because the only difference between the results of these two opcodes is - * the value of the partial product associated with the sign bit of rB. - * - * mulxss = mulxsu - ((rB < 0) ? rA : 0); - * - */ - -.Lmul_immed: - /* Opcode is muli. Change it into mul for remainder of algorithm. */ - mov r7, r6 /* Field B is dest register, not field C. */ - mov r6, r4 /* Field IMM16 is src2, not field B. */ - movi r4, 0x27 /* OPX of mul is 0x27 */ - -.Lmultiply: - /* Initialize the multiplication loop. */ - movi r9, 0 /* mul_product = 0 */ - movi r10, 0 /* mulxuu_product = 0 */ - mov r11, r6 /* save original multiplier for mulxsu and mulxss */ - mov r12, r6 /* mulxuu_multiplier (will be shifted) */ - movi r16, 1 /* used to create "rori B,A,1" from "ror B,A,r16" */ - - /* Now - * r3 = multiplicand - * r6 = mul_multiplier - * r7 = 4 * dest_register (used later as offset to sp) - * r9 = mul_product - * r10 = mulxuu_product - * r11 = original multiplier - * r12 = mulxuu_multiplier - * r14 = loop counter (already initialized) - * r15 = temp - * r16 = 1 - */ - - - /* - * for (count = 32; count > 0; --count) - * { - */ -.Lmultiply_loop: - - /* - * mul_product <<= 1; - * lsb = multiplier & 1; - */ - slli r9, r9, 1 - andi r15, r12, 1 - - /* - * if (lsb == 1) - * { - * mulxuu_product += multiplicand; - * } - */ - beq r15, zero, .Lmulx_skip - add r10, r10, r3 - cmpltu r15, r10, r3 /* Save the carry from the MSB of mulxuu_product. */ - ror r15, r15, r16 /* r15 = 0x80000000 on carry, or else 0x00000000 */ -.Lmulx_skip: - - /* - * if (MSB of mul_multiplier == 1) - * { - * mul_product += multiplicand; - * } - */ - bge r6, zero, .Lmul_skip - add r9, r9, r3 -.Lmul_skip: - - /* - * mulxuu_product >>= 1; logical shift - * mul_multiplier <<= 1; done with MSB - * mulx_multiplier >>= 1; done with LSB - */ - srli r10, r10, 1 - or r10, r10, r15 /* OR in the saved carry bit. */ - slli r6, r6, 1 - srli r12, r12, 1 - - - /* - * } - */ - subi r14, r14, 1 - bne r14, zero, .Lmultiply_loop - - - /* - * Multiply emulation loop done. - */ - - /* Now - * r3 = multiplicand - * r4 = OPX - * r7 = 4 * dest_register (used later as offset to sp) - * r9 = mul_product - * r10 = mulxuu_product - * r11 = original multiplier - * r15 = temp - */ - - - /* - * Select/compute the result based on OPX. - */ - - - /* OPX == mul? Then store. */ - xori r15, r4, 0x27 - beq r15, zero, .Lstore_result - - /* It's one of the mulx.. opcodes. Move over the result. */ - mov r9, r10 - - /* OPX == mulxuu? Then store. */ - xori r15, r4, 0x07 - beq r15, zero, .Lstore_result - - /* Compute mulxsu - * - * mulxsu = mulxuu - ((rA < 0) ? rB : 0); - */ - bge r3, zero, .Lmulxsu_skip - sub r9, r9, r11 -.Lmulxsu_skip: - - /* OPX == mulxsu? Then store. */ - xori r15, r4, 0x17 - beq r15, zero, .Lstore_result - - /* Compute mulxss - * - * mulxss = mulxsu - ((rB < 0) ? rA : 0); - */ - bge r11, zero, .Lmulxss_skip - sub r9, r9, r3 -.Lmulxss_skip: - /* At this point, assume that OPX is mulxss, so store */ - - -.Lstore_result: - add r7, r7, sp - stw r9, 0(r7) - - ldw r16, 0(sp) - ldw r17, 4(sp) - ldw r18, 8(sp) - ldw r19, 12(sp) - ldw r20, 16(sp) - ldw r21, 20(sp) - ldw r22, 24(sp) - ldw r23, 28(sp) - - /* bt @ 32 - Breakpoint register usually isn't an operand. */ - /* et @ 36 - Don't corrupt et. */ - /* gp @ 40 - Don't corrupt gp. */ - /* sp @ 44 - Don't corrupt sp. */ - ldw fp, 48(sp) - /* ea @ 52 - Don't corrupt ea. */ - /* ba @ 56 - Breakpoint register usually isn't an operand. */ - - addi sp, sp, 60 - - br .Lexception_exit - - -.Lnot_muldiv: - - addi sp, sp, 60 - - - .section .exceptions.exit.label -.Lexception_exit: - diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_exception_trap.S b/software/qsys_tutorial_bsp/HAL/src/alt_exception_trap.S deleted file mode 100644 index 60a3d40..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_exception_trap.S +++ /dev/null @@ -1,81 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - - /* - * This is the trap exception handler for Nios2. - */ - - /* - * Provide a label which can be used to pull this file in. - */ - - .section .exceptions.start - .globl alt_exception_trap -alt_exception_trap: - - /* - * Pull in the entry/exit code. - */ - .globl alt_exception - - .section .exceptions.soft, "xa" - -.Ltrap_handler: - - /* - * Did a trap instruction cause the exception? - * - * The instruction which the exception occurred on has been loaded - * into r2 by code in alt_exception_entry.S - * - */ - - movhi r3,0x003b /* upper half of trap opcode */ - ori r3,r3,0x683a /* lower half of trap opcode */ - bne r2,r3,.Lnot_trap - - /* - * There is no trap handler defined here, and so executing a trap - * instruction causes a software break. If you provide a trap handler, - * then you must replace the break instruction below with your handler. - * Your handler must preserve ea and the usual callee saved registers. - */ - - break - - br .Lexception_exit - -.Lnot_trap: - - - .section .exceptions.exit.label -.Lexception_exit: - - diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_execve.c b/software/qsys_tutorial_bsp/HAL/src/alt_execve.c deleted file mode 100644 index 27b99cf..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_execve.c +++ /dev/null @@ -1,55 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "os/alt_syscall.h" - -/* - * execve() is used by newlib to launch new processes. This is unsupported in - * the HAL environment. However a "do-nothing" implementation is still - * provied for newlib compatability. - * - * ALT_EXECVE is mapped onto the execve() system call in alt_syscall.h - */ - -int ALT_EXECVE (char *name, char ** argv, char** env) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(execve); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_exit.c b/software/qsys_tutorial_bsp/HAL/src/alt_exit.c deleted file mode 100644 index 971b35e..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_exit.c +++ /dev/null @@ -1,71 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_irq.h" -#include "sys/alt_sim.h" -#include "os/alt_hooks.h" -#include "os/alt_syscall.h" - -#include "alt_types.h" -#include "sys/alt_log_printf.h" -/* - * _exit() is called by exit() in order to terminate the current process. - * Typically this is called when main() completes. It should never return. - * Since there is nowhere to go once this process completes, this - * implementation simply blocks forever. - * - * Note that interrupts are not disabled so that execution outside of this - * thread is allowed to continue. - * - * ALT_EXIT is mapped onto the _exit() system call in alt_syscall.h - */ - -void ALT_EXIT (int exit_code) -{ - /* ALT_LOG - please see HAL/inc/alt_log_printf.h for details */ - ALT_LOG_PRINT_BOOT("[alt_exit.c] Entering _exit() function.\r\n"); - ALT_LOG_PRINT_BOOT("[alt_exit.c] Exit code from main was %d.\r\n",exit_code); - /* Stop all other threads */ - - ALT_LOG_PRINT_BOOT("[alt_exit.c] Calling ALT_OS_STOP().\r\n"); - ALT_OS_STOP(); - - /* Provide notification to the simulator that we've stopped */ - - ALT_LOG_PRINT_BOOT("[alt_exit.c] Calling ALT_SIM_HALT().\r\n"); - ALT_SIM_HALT(exit_code); - - /* spin forever, since there's no where to go back to */ - - ALT_LOG_PRINT_BOOT("[alt_exit.c] Spinning forever.\r\n"); - while (1); -} diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_fcntl.c b/software/qsys_tutorial_bsp/HAL/src/alt_fcntl.c deleted file mode 100644 index 69c1544..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_fcntl.c +++ /dev/null @@ -1,101 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include -#include - -#include "sys/alt_errno.h" -#include "priv/alt_file.h" -#include "alt_types.h" -#include "os/alt_syscall.h" - -#define ALT_FCNTL_FLAGS_MASK ((alt_u32) (O_APPEND | O_NONBLOCK)) - -/* - * fcntl() is a limited implementation of the standard fcntl() system call. - * It can be used to change the state of the flags associated with an open - * file descriptor. Normally these flags are set during the call to - * open(). It is anticipated that the main use of this function will be to - * change the state of a device from blocking to non-blocking (where this is - * supported). - * - * The input argument "fd" is the file descriptor to be manipulated. "cmd" - * is the command to execute. This can be either F_GETFL (return the - * current value of the flags) or F_SETFL (set the value of the flags). - * - * If "cmd" is F_SETFL then the argument "arg" is the new value of flags, - * otherwise "arg" is ignored. Only the flags: O_APPEND and O_NONBLOCK - * can be updated by a call to fcntl(). All other flags remain - * unchanged. - * - * ALT_FCNTL is mapped onto the fcntl() system call in alt_syscall.h - */ - -int ALT_FCNTL (int file, int cmd, ...) -{ - alt_fd* fd; - long flags; - va_list argp; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - switch (cmd) - { - case F_GETFL: - return fd->fd_flags & ~((alt_u32) ALT_FD_FLAGS_MASK); - case F_SETFL: - va_start(argp, cmd); - flags = va_arg(argp, long); - fd->fd_flags &= ~ALT_FCNTL_FLAGS_MASK; - fd->fd_flags |= (flags & ALT_FCNTL_FLAGS_MASK); - va_end(argp); - return 0; - default: - ALT_ERRNO = EINVAL; - return -1; - } - } - - ALT_ERRNO = EBADFD; - return -1; -} diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_fd_lock.c b/software/qsys_tutorial_bsp/HAL/src/alt_fd_lock.c deleted file mode 100644 index 0e2a85d..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_fd_lock.c +++ /dev/null @@ -1,75 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "priv/alt_file.h" - -/* - * alt_fd_lock() is called as a consequence of an ioctl call to gain exclusive - * access to a device, i.e.: - * - * ioctl (fd, TIOCEXCL, NULL); - * - * If there are no other open file descriptors which reference the same - * device, then alt_fd_lock() will grant the lock. Further calls to open() - * for this device will fail until the lock is released. - * - * This is done by calling close() for this file descriptor, or by calling: - * - * ioctl (fd, TIOCNXCL, NULL); - * - * The return value is zero for success, or negative in the case of failure. - */ - -int alt_fd_lock (alt_fd* fd) -{ - int i; - int rc = 0; - - ALT_SEM_PEND(alt_fd_list_lock, 0); - - for (i = 0; i < alt_max_fd; i++) - { - if ((&alt_fd_list[i] != fd) && (alt_fd_list[i].dev == fd->dev)) - { - rc = -EACCES; - goto alt_fd_lock_exit; - } - } - fd->fd_flags |= ALT_FD_EXCL; - - alt_fd_lock_exit: - - ALT_SEM_POST(alt_fd_list_lock); - return rc; -} diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_fd_unlock.c b/software/qsys_tutorial_bsp/HAL/src/alt_fd_unlock.c deleted file mode 100644 index fb700dc..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_fd_unlock.c +++ /dev/null @@ -1,56 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "priv/alt_file.h" - -/* - * alt_fd_unlock() is the inverse of alt_fd_lock(). It is called as a - * consequence of a TIOCNXCL ioctl request, e.g: - * - * ioctl (fd, TIOCNXCL, NULL); - * - * It enables multiple file descriptors to exist for the same device. This - * is normally the case, but it may have been disabled by a previous call to - * alt_fd_lock(). - * - * Return zero on sucess, and a negative value on failure. - * - * The current implementation always succeeds. - */ - -int alt_fd_unlock (alt_fd* fd) -{ - fd->fd_flags &= ~ALT_FD_EXCL; - return 0; -} diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_find_dev.c b/software/qsys_tutorial_bsp/HAL/src/alt_find_dev.c deleted file mode 100644 index 37aefa4..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_find_dev.c +++ /dev/null @@ -1,88 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - -#include "alt_types.h" - -/* - * alt_find_dev() is used by open() in order to locate a previously registered - * device with the name "name". The input argument "llist" is a pointer to the - * head of the device list to search. - * - * The return value is a pointer to the matching device, or NULL if there is - * no match. - * - * "name" must be an exact match for the devices registered name for a match to - * be found. - */ - -alt_dev* alt_find_dev(const char* name, alt_llist* llist) -{ - alt_dev* next = (alt_dev*) llist->next; - alt_32 len; - - len = strlen(name) + 1; - - /* - * Check each list entry in turn, until a match is found, or we reach the - * end of the list (i.e. next winds up pointing back to the list head). - */ - - while (next != (alt_dev*) llist) - { - - /* - * memcmp() is used here rather than strcmp() in order to reduce the size - * of the executable. - */ - - if (!memcmp (next->name, name, len)) - { - /* match found */ - - return next; - } - next = (alt_dev*) next->llist.next; - } - - /* No match found */ - - return NULL; -} - - diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_find_file.c b/software/qsys_tutorial_bsp/HAL/src/alt_find_file.c deleted file mode 100644 index 2d97ec2..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_find_file.c +++ /dev/null @@ -1,89 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - -#include "alt_types.h" - -/* - * alt_find_file() is used by open() in order to locate a previously registered - * filesystem that owns that mount point that contains the file named "name". - * - * The return value is a pointer to the matching filesystem, or NULL if there is - * no match. - * - * A match is considered to have been found if the filesystem name followed by - * either '/' or '\0' is the prefix of the filename. For example the filename: - * "/myfilesystem/junk.txt" would match: "/myfilesystem", but not: "/myfile". - */ - -alt_dev* alt_find_file (const char* name) -{ - alt_dev* next = (alt_dev*) alt_fs_list.next; - - alt_32 len; - - /* - * Check each list entry in turn, until a match is found, or we reach the - * end of the list (i.e. next winds up pointing back to the list head). - */ - - while (next != (alt_dev*) &alt_fs_list) - { - len = strlen(next->name); - - if (next->name[len-1] == '/') - { - len -= 1; - } - - if (((name[len] == '/') || (name[len] == '\0')) && - !memcmp (next->name, name, len)) - { - /* match found */ - - return next; - } - next = (alt_dev*) next->llist.next; - } - - /* No match found */ - - return NULL; -} - - diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_flash_dev.c b/software/qsys_tutorial_bsp/HAL/src/alt_flash_dev.c deleted file mode 100644 index 213f721..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_flash_dev.c +++ /dev/null @@ -1,69 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* Alt_flash.c - Functions to register a flash device to the "generic" flash * -* interface * -* * -* Author PRR * -* * -******************************************************************************/ - -#include -#include "sys/alt_llist.h" -#include "sys/alt_flash_dev.h" -#include "priv/alt_file.h" - -ALT_LLIST_HEAD(alt_flash_dev_list); - -alt_flash_fd* alt_flash_open_dev(const char* name) -{ - alt_flash_dev* dev = (alt_flash_dev*)alt_find_dev(name, &alt_flash_dev_list); - - if ((dev) && dev->open) - { - return dev->open(dev, name); - } - - return dev; -} - -void alt_flash_close_dev(alt_flash_fd* fd) -{ - if (fd && fd->close) - { - fd->close(fd); - } - return; -} - diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_fork.c b/software/qsys_tutorial_bsp/HAL/src/alt_fork.c deleted file mode 100644 index ce74df0..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_fork.c +++ /dev/null @@ -1,57 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_warning.h" -#include "sys/alt_errno.h" -#include "os/alt_syscall.h" - -/* - * The fork() system call is used by newlib to create a duplicate copy of the - * curent process. This is unsupported in the HAL environment. However a - * "do-nothing" implementation is still provied for newlib compatability. - * - * ALT_FORK is mapped onto the fork() system call in alt_syscall.h - */ - -int ALT_FORK (void) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(fork); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} - - diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_fs_reg.c b/software/qsys_tutorial_bsp/HAL/src/alt_fs_reg.c deleted file mode 100644 index 13437a1..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_fs_reg.c +++ /dev/null @@ -1,75 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - -/* - * The alt_fs_reg() function is used to register a file system. Once registered - * a device can be accessed using the standard posix calls: open(), read(), - * write() etc. - * - * System behaviour is undefined in the event that a file system is registered - * with a name that conflicts with an existing device or file system. - * - * alt_fs_reg() is not thread safe in the sense that there should be no other - * thread using the file system list at the time that alt_dev_reg() is called. In - * practice this means that alt_fs_reg() should only be called while operating - * in a single threaded mode. The expectation is that it will only be called - * by the file system initilisation functions invoked by alt_sys_init(), which in - * turn should only be called by the single threaded C startup code. - * - * A return value of zero indicates success. A negative return value indicates - * failure. - */ - -int alt_fs_reg (alt_dev* dev) -{ - /* - * check that the device has a name. - */ - - if (!dev->name) - { - return -ENODEV; - } - - /* - * register the file system. - */ - - alt_llist_insert(&alt_fs_list, &dev->llist); - - return 0; -} diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_fstat.c b/software/qsys_tutorial_bsp/HAL/src/alt_fstat.c deleted file mode 100644 index af5d527..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_fstat.c +++ /dev/null @@ -1,128 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include "sys/alt_dev.h" -#include "sys/alt_warning.h" -#include "sys/alt_errno.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -/* - * The fstat() system call is used to obtain information about the capabilities - * of an open file descriptor. By default file descriptors are marked as - * being character devices. If a device or file system wishes to advertise - * alternative capabilities then they can register an fstat() function within - * their associated alt_dev structure. This will be called to fill in the - * entries in the imput "st" structure. - * - * This function is provided for compatability with newlib. - * - * ALT_FSTAT is mapped onto the fstat() system call in alt_syscall.h - */ - -#ifdef ALT_USE_DIRECT_DRIVERS - -#include "system.h" - -/* - * Provide minimal version that just describes all file descriptors - * as character devices for provided stdio devices. - */ -int ALT_FSTAT (int file, struct stat *st) -{ - switch (file) { -#ifdef ALT_STDIN_PRESENT - case 0: /* stdin file descriptor */ -#endif /* ALT_STDIN_PRESENT */ -#ifdef ALT_STDOUT_PRESENT - case 1: /* stdout file descriptor */ -#endif /* ALT_STDOUT_PRESENT */ -#ifdef ALT_STDERR_PRESENT - case 2: /* stderr file descriptor */ -#endif /* ALT_STDERR_PRESENT */ - st->st_mode = _IFCHR; - return 0; - default: - return -1; - } - -#if !defined(ALT_STDIN_PRESENT) && !defined(ALT_STDOUT_PRESENT) && !defined(ALT_STDERR_PRESENT) - /* Generate a link time warning, should this function ever be called. */ - ALT_STUB_WARNING(fstat); -#endif -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -int ALT_FSTAT (int file, struct stat *st) -{ - alt_fd* fd; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - /* Call the drivers fstat() function to fill out the "st" structure. */ - - if (fd->dev->fstat) - { - return fd->dev->fstat(fd, st); - } - - /* - * If no function is provided, mark the fd as belonging to a character - * device. - */ - - else - { - st->st_mode = _IFCHR; - return 0; - } - } - else - { - ALT_ERRNO = EBADFD; - return -1; - } -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_get_fd.c b/software/qsys_tutorial_bsp/HAL/src/alt_get_fd.c deleted file mode 100644 index db17b2c..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_get_fd.c +++ /dev/null @@ -1,105 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - -#include "alt_types.h" - -#include "system.h" - -/* - * alt_get_fd() is called to allocate a new file descriptor from the file - * descriptor pool. If a file descriptor is succesfully allocated, it is - * configured to refer to device "dev". - * - * The return value is the index of the file descriptor structure (i.e. - * the offset of the file descriptor within the file descriptor array). A - * negative value indicates failure. - */ - -int alt_get_fd (alt_dev* dev) -{ - alt_32 i; - int rc = -EMFILE; - - /* - * Take the alt_fd_list_lock semaphore in order to avoid races when - * accessing the file descriptor pool. - */ - - ALT_SEM_PEND(alt_fd_list_lock, 0); - - /* - * Search through the list of file descriptors, and allocate the first - * free descriptor that's found. - * - * If a free descriptor is found, then the value of "alt_max_fd" is - * updated accordingly. "alt_max_fd" is a 'highwater mark' which - * indicates the highest file descriptor ever allocated. This is used to - * improve efficency when searching the file descriptor list, and - * therefore reduce contention on the alt_fd_list_lock semaphore. - */ - - for (i = 0; i < ALT_MAX_FD; i++) - { - if (!alt_fd_list[i].dev) - { - alt_fd_list[i].dev = dev; - if (i > alt_max_fd) - { - alt_max_fd = i; - } - rc = i; - goto alt_get_fd_exit; - } - } - - alt_get_fd_exit: - - /* - * Release the alt_fd_list_lock semaphore now that we are done with the - * file descriptor pool. - */ - - ALT_SEM_POST(alt_fd_list_lock); - - return rc; -} - - - - diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_getchar.c b/software/qsys_tutorial_bsp/HAL/src/alt_getchar.c deleted file mode 100644 index a8f50d5..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_getchar.c +++ /dev/null @@ -1,61 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#ifdef ALT_USE_DIRECT_DRIVERS -#include "system.h" -#include "sys/alt_driver.h" -#include "sys/alt_stdio.h" -#include "priv/alt_file.h" -#include "unistd.h" -#endif - -/* - * Uses the ALT_DRIVER_READ() macro to call directly to driver if available. - * Otherwise, uses newlib provided getchar() routine. - */ -int -alt_getchar(void) -{ -#ifdef ALT_USE_DIRECT_DRIVERS - ALT_DRIVER_READ_EXTERNS(ALT_STDIN_DEV); - char c; - - if (ALT_DRIVER_READ(ALT_STDIN_DEV, &c, 1, alt_fd_list[STDIN_FILENO].fd_flags) <= 0) { - return -1; - } - return c; -#else - return getchar(); -#endif -} diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_getpid.c b/software/qsys_tutorial_bsp/HAL/src/alt_getpid.c deleted file mode 100644 index 2228c7e..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_getpid.c +++ /dev/null @@ -1,47 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "os/alt_syscall.h" - -/* - * The getpid() system call is used by newlib to obtain the current process - * id. Since there is only ever a single process in the HAL environment, - * this just returns a constant. - * - * ALT_GETPID is mapped onto the getpid() system call in alt_syscall.h - */ - -int ALT_GETPID (void) -{ - return 0; -} - diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_gettod.c b/software/qsys_tutorial_bsp/HAL/src/alt_gettod.c deleted file mode 100644 index ed86cba..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_gettod.c +++ /dev/null @@ -1,125 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include - -#include "sys/alt_alarm.h" -#include "alt_types.h" -#include "os/alt_syscall.h" - -/* - * Macro defining the number of micoseconds in a second. - */ - -#define ALT_US (1000000) - -/* - * "alt_timezone" and "alt_resettime" are the values of the the reset time and - * time zone set through the last call to settimeofday(). By default they are - * zero initialised. - */ - -struct timezone alt_timezone = {0, 0}; -struct timeval alt_resettime = {0, 0}; - -/* - * gettimeofday() can be called to obtain a time structure which indicates the - * current "wall clock" time. This is calculated using the elapsed number of - * system clock ticks, and the value of "alt_resettime" and "alt_timezone" set - * through the last call to settimeofday(). - * - * Warning: if this function is called concurrently with a call to - * settimeofday(), the value returned by gettimeofday() will be unreliable. - * - * ALT_GETTIMEOFDAY is mapped onto the gettimeofday() system call in - * alt_syscall.h - */ - - -#if defined (__GNUC__) && (__GNUC__ >= 4) -int ALT_GETTIMEOFDAY (struct timeval *ptimeval, void *ptimezone_vptr) -{ - struct timezone *ptimezone = (struct timezone*)ptimezone_vptr; -#else -int ALT_GETTIMEOFDAY (struct timeval *ptimeval, struct timezone *ptimezone) -{ -#endif - - alt_u32 nticks = alt_nticks (); - alt_u32 tick_rate = alt_ticks_per_second (); - - /* - * Check to see if the system clock is running. This is indicated by a - * non-zero system clock rate. If the system clock is not running, an error - * is generated and the contents of "ptimeval" and "ptimezone" are not - * updated. - */ - - if (tick_rate) - { - ptimeval->tv_sec = alt_resettime.tv_sec + nticks/tick_rate; - ptimeval->tv_usec = alt_resettime.tv_usec + - (alt_u32)(((alt_u64)nticks*(ALT_US/tick_rate))%ALT_US); - - while(ptimeval->tv_usec < 0) { - if (ptimeval->tv_sec <= 0) - { - ptimeval->tv_sec = 0; - ptimeval->tv_usec = 0; - break; - } - else - { - ptimeval->tv_sec--; - ptimeval->tv_usec += ALT_US; - } - } - - while(ptimeval->tv_usec >= ALT_US) { - ptimeval->tv_sec++; - ptimeval->tv_usec -= ALT_US; - } - - if (ptimezone) - { - ptimezone->tz_minuteswest = alt_timezone.tz_minuteswest; - ptimezone->tz_dsttime = alt_timezone.tz_dsttime; - } - - return 0; - } - - return -ENOTSUP; -} - diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_gmon.c b/software/qsys_tutorial_bsp/HAL/src/alt_gmon.c deleted file mode 100644 index 6add9f1..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_gmon.c +++ /dev/null @@ -1,272 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include -#include -#include - -#include "priv/nios2_gmon_data.h" - -#include "sys/alt_irq.h" -#include "sys/alt_alarm.h" - - -/* Macros */ - -/* How large should the bins be which we use to generate the histogram */ -#define PCSAMPLE_BYTES_PER_BUCKET 32 - -#define NIOS2_READ_EA(dest) __asm__ ("mov %0, ea" : "=r" (dest)) - -/* The compiler inserts calls to mcount() at the start of - * every function call. The structure mcount_fn_arc records t - * he return address of the function called (in from_pc) - * and the return address of the mcount function - * (in self_pc). The number of times this arc is executed is - * recorded in the field count. - */ -struct mcount_fn_arc -{ - struct mcount_fn_arc * next; - void * from_pc; - unsigned int count; -}; - -/* We need to maintain a list of pointers to the heads of each adjacency - * list so that we can find them when writing out the gmon.out file. Since - * we don't know at the start of program execution how many functions will - * be called we use a list structure to do this. - */ -struct mcount_fn_entry -{ - struct mcount_fn_entry * next; - void * self_pc; - struct mcount_fn_arc * arc_head; -}; - -/* function prototypes */ - -void __mcount_record(void * self_pc, void * from_pc, struct mcount_fn_entry * fn_entry, struct mcount_fn_entry * * fn_head) __attribute__ ((no_instrument_function)); - -static __inline__ void * mcount_allocate(unsigned int size) __attribute__ ((no_instrument_function)); -static int nios2_pcsample_init(void) __attribute__ ((no_instrument_function)); -static alt_u32 nios2_pcsample(void* alarm) __attribute__ ((no_instrument_function)); - -/* global variables */ - -/* stext and etext are defined in the linker script */ -extern char stext[]; -extern char etext[]; - -/* Is the PC sampling stuff enabled yet? */ -static int pcsample_need_init = 1; - -#define HASH_BUCKETS 64 /* Must be a power of 2 */ - -/* This points to the list of adjacency list pointers. */ -struct mcount_fn_entry * __mcount_fn_head[HASH_BUCKETS]; - -/* pointer to the in-memory buffer containing the histogram */ -static unsigned short* s_pcsamples = 0; - -/* the address of the start and end of text section */ -static const unsigned int s_low_pc = (unsigned int)stext; -static const unsigned int s_high_pc = (unsigned int)etext; - -/* the alarm structure to register for pc sampling */ -static alt_alarm s_nios2_pcsample_alarm; - -unsigned int alt_gmon_data[GMON_DATA_SIZE] = -{ - 0x6e6f6d67, /* "gmon" */ - GMON_DATA_SIZE, - 0, - (unsigned int)stext, - (unsigned int)etext, - PCSAMPLE_BYTES_PER_BUCKET, - 0, - (unsigned int)__mcount_fn_head, - (unsigned int)(__mcount_fn_head + HASH_BUCKETS) -}; - -/* This holds the current slab of memory we're allocating out of */ -static char * mcount_slab_ptr = 0; -static int mcount_slab_size = 0; - -#define MCOUNT_SLAB_INCREMENT 1020 - - -/* - * We can't use malloc to allocate memory because that's too complicated, and - * can't be called at interrupt time. Use the lower level allocator instead - * because that's interrupt safe (and because we never free anything). - * - * For speed, we allocate a block of data at once. - */ -static __inline__ void * mcount_allocate(unsigned int size) -{ - void * data; - - if (size > mcount_slab_size) - { - mcount_slab_ptr = sbrk(MCOUNT_SLAB_INCREMENT); - mcount_slab_size = MCOUNT_SLAB_INCREMENT; - } - - data = mcount_slab_ptr; - mcount_slab_ptr += size; - mcount_slab_size -= size; - - return data; -} - - -/* - * Add the arc with the values of frompc and topc given to the graph. - * This function might be called at interrupt time so must be able to - * cope with reentrancy. - * - * The fast case, where we have already allocated a function arc, has been - * handled by the assmebler code. - */ -void __mcount_record(void * self_pc, void * from_pc, struct mcount_fn_entry * fn_entry, struct mcount_fn_entry * * fn_head) -{ - alt_irq_context context; - struct mcount_fn_arc * arc_entry; - - /* Keep trying to start up the PC sampler until it is running. - * (It can't start until the timer is going). - */ - if (pcsample_need_init) - { - pcsample_need_init = 0; - pcsample_need_init = nios2_pcsample_init(); - } - - /* - * We must disable interrupts around the allocation and the list update to - * prevent corruption if the instrumented function is re-entrant. - * - * It's safe for the code above to be stepping through the chain and be - * interrupted by this code modifying it - there is an edge case which will - * leave two copies of the same arc on the list (both with count=1), but - * this is dealt with on the host. - */ - context = alt_irq_disable_all(); - - if (fn_entry == NULL) - { - /* Add it to the list of functions we must output later. */ - fn_entry = (struct mcount_fn_entry *)mcount_allocate(sizeof(struct mcount_fn_entry)); - - fn_entry->self_pc = self_pc; - fn_entry->arc_head = NULL; - - fn_entry->next = *fn_head; - *fn_head = fn_entry; - } - - /* We will need a new list entry - if there was a list entry before - * then the assembler code would have handled it. */ - arc_entry = (struct mcount_fn_arc *)mcount_allocate(sizeof(struct mcount_fn_arc)); - - arc_entry->from_pc = from_pc; - arc_entry->count = 1; - - arc_entry->next = fn_entry->arc_head; - fn_entry->arc_head = arc_entry; - - alt_irq_enable_all(context); -} - - -/* - * nios2_pcsample_init starts profiling. - * It is called the first time mcount is called, and on subsequent calls to - * mcount until it returns zero. It initializes the pc histogram and turns on - * timer driven pc sampling. - */ -static int nios2_pcsample_init(void) -{ - unsigned int pcsamples_size; - - /* We sample the PC every tick */ - unsigned int prof_rate = alt_ticks_per_second(); - if (prof_rate == 0) - return 1; - - /* allocate the histogram buffer s_pcsamples */ - pcsamples_size = (s_high_pc - s_low_pc)/PCSAMPLE_BYTES_PER_BUCKET; - s_pcsamples = (unsigned short*)sbrk(pcsamples_size * sizeof(unsigned short)); - - if (s_pcsamples != 0) - { - /* initialize the buffer to zero */ - memset(s_pcsamples, 0, pcsamples_size * sizeof(unsigned short)); - - alt_gmon_data[GMON_DATA_PROFILE_DATA] = (int)s_pcsamples; - alt_gmon_data[GMON_DATA_PROFILE_RATE] = prof_rate; - - /* Sample every tick (it's cheap) */ - alt_alarm_start(&s_nios2_pcsample_alarm, 1, nios2_pcsample, 0); - } - - return 0; -} - - -/* - * Sample the PC value and store it in the histogram - */ -static alt_u32 nios2_pcsample(void* context) -{ - unsigned int pc; - unsigned int bucket; - - /* read the exception return address - this will be - * inaccurate if there are nested interrupts but we - * assume that this is rare and the inaccuracy will - * not be great */ - NIOS2_READ_EA(pc); - - /* - * If we're within the profilable range then increment the relevant - * bucket in the histogram - */ - if (pc >= s_low_pc && pc < s_high_pc && s_pcsamples != 0) - { - bucket = (pc - s_low_pc)/PCSAMPLE_BYTES_PER_BUCKET; - s_pcsamples[bucket]++; - } - - /* Sample every tick */ - return 1; -} - diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_icache_flush.c b/software/qsys_tutorial_bsp/HAL/src/alt_icache_flush.c deleted file mode 100644 index 4b706ed..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_icache_flush.c +++ /dev/null @@ -1,84 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "nios2.h" -#include "system.h" - -#include "alt_types.h" -#include "sys/alt_cache.h" - -/* - * alt_icache_flush() is called to flush the instruction cache for a memory - * region of length "len" bytes, starting at address "start". - */ - -void alt_icache_flush (void* start, alt_u32 len) -{ -#if NIOS2_ICACHE_SIZE > 0 - - char* i; - char* end; - - /* - * This is the most we would ever need to flush. - */ - - if (len > NIOS2_ICACHE_SIZE) - { - len = NIOS2_ICACHE_SIZE; - } - - end = ((char*) start) + len; - - for (i = start; i < end; i+= NIOS2_ICACHE_LINE_SIZE) - { - __asm__ volatile ("flushi %0" :: "r" (i)); - } - - /* - * For an unaligned flush request, we've got one more line left. - * Note that this is dependent on NIOS2_ICACHE_LINE_SIZE to be a - * multiple of 2 (which it always is). - */ - - if (((alt_u32) start) & (NIOS2_ICACHE_LINE_SIZE - 1)) - { - __asm__ volatile ("flushi %0" :: "r" (i)); - } - - /* - * Having flushed the cache, flush any stale instructions in the - * pipeline - */ - - __asm__ volatile ("flushp"); - -#endif /* NIOS2_ICACHE_SIZE > 0 */ -} diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_icache_flush_all.c b/software/qsys_tutorial_bsp/HAL/src/alt_icache_flush_all.c deleted file mode 100644 index 5088552..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_icache_flush_all.c +++ /dev/null @@ -1,46 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "nios2.h" -#include "system.h" - -#include "alt_types.h" -#include "sys/alt_cache.h" - -/* - * alt_icache_flush_all() is called to flush the entire instruction cache. - */ - -void alt_icache_flush_all (void) -{ -#if NIOS2_ICACHE_SIZE > 0 - alt_icache_flush (0, NIOS2_ICACHE_SIZE); -#endif -} diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_iic.c b/software/qsys_tutorial_bsp/HAL/src/alt_iic.c deleted file mode 100644 index 1db5afa..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_iic.c +++ /dev/null @@ -1,106 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ -#include "system.h" - -/* - * This file implements the HAL Enhanced interrupt API for Nios II processors - * with an internal interrupt controller (IIC). For most routines, this serves - * as a wrapper layer over the legacy interrupt API (which must be used with - * the IIC only). - * - * Use of the enhanced API is recommended so that application and device - * drivers are compatible with a Nios II system configured with an external - * interrupt controller (EIC), or IIC. This will afford maximum portability. - * - * If an EIC is present, the EIC device driver must provide these routines, - * because their operation will be specific to that EIC type. - */ -#ifndef NIOS2_EIC_PRESENT -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - -#include "sys/alt_irq.h" -#include "priv/alt_iic_isr_register.h" -#include "priv/alt_legacy_irq.h" - -/** @Function Description: This function registers an interrupt handler. - * If the function is succesful, then the requested interrupt will be enabled upon - * return. Registering a NULL handler will disable the interrupt. - * @API Type: External - * @param ic_id Ignored. - * @param irq IRQ number - * @return 0 if successful, else error (-1) - */ -int alt_ic_isr_register(alt_u32 ic_id, alt_u32 irq, alt_isr_func isr, - void *isr_context, void *flags) -{ - return alt_iic_isr_register(ic_id, irq, isr, isr_context, flags); -} - -/** @Function Description: This function enables a single interrupt. - * @API Type: External - * @param ic_id Ignored. - * @param irq IRQ number - * @return 0 if successful, else error (-1) - */ -int alt_ic_irq_enable (alt_u32 ic_id, alt_u32 irq) -{ - return alt_irq_enable(irq); -} - -/** @Function Description: This function disables a single interrupt. - * @API Type: External - * @param ic_id Ignored. - * @param irq IRQ number - * @return 0 if successful, else error (-1) - */ -int alt_ic_irq_disable(alt_u32 ic_id, alt_u32 irq) -{ - return alt_irq_disable(irq); -} - -/** @Function Description: This function to determine if corresponding - * interrupt is enabled. - * @API Type: External - * @param ic_id Ignored. - * @param irq IRQ number - * @return Zero if corresponding interrupt is disabled and - * non-zero otherwise. - */ -alt_u32 alt_ic_irq_enabled(alt_u32 ic_id, alt_u32 irq) -{ - alt_u32 irq_enabled; - - NIOS2_READ_IENABLE(irq_enabled); - - return (irq_enabled & (1 << irq)) ? 1: 0; -} - -#endif /* ALT_ENHANCED_INTERRUPT_API_PRESENT */ -#endif /* NIOS2_EIC_PRESENT */ diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_iic_isr_register.c b/software/qsys_tutorial_bsp/HAL/src/alt_iic_isr_register.c deleted file mode 100644 index b104395..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_iic_isr_register.c +++ /dev/null @@ -1,104 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ -#include -#include "system.h" - -/* - * Provides an interrupt registry mechanism for the any CPUs internal interrupt - * controller (IIC) when the enhanced interrupt API is active. - */ -#ifndef ALT_CPU_EIC_PRESENT -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - -#include "alt_types.h" -#include "sys/alt_irq.h" -#include "priv/alt_iic_isr_register.h" - -/* - * The header, alt_irq_entry.h, contains the exception entry point, and is - * provided by the processor component. It is included here, so that the code - * will be added to the executable only if alt_irq_register() is present, i.e. - * if no interrupts are registered - there's no need to provide any - * interrupt handling. - */ - -#include "sys/alt_irq_entry.h" - -/* - * The header, alt_irq_table.h contains a table describing which function - * handles each interrupt. - */ - -#include "priv/alt_irq_table.h" - -/** @Function Description: This function registers an interrupt handler. - * If the function is succesful, then the requested interrupt will be enabled - * upon return. Registering a NULL handler will disable the interrupt. - * - * @API Type: External - * @param ic_id Interrupt controller ID - * @param irq IRQ ID number - * @param isr Pointer to interrupt service routine - * @param isr_context Opaque pointer passed to ISR - * @param flags - * @return 0 if successful, else error (-1) - */ -int alt_iic_isr_register(alt_u32 ic_id, alt_u32 irq, alt_isr_func isr, - void *isr_context, void *flags) -{ - int rc = -EINVAL; - int id = irq; /* IRQ interpreted as the interrupt ID. */ - alt_irq_context status; - - if (id < ALT_NIRQ) - { - /* - * interrupts are disabled while the handler tables are updated to ensure - * that an interrupt doesn't occur while the tables are in an inconsistant - * state. - */ - - status = alt_irq_disable_all(); - - alt_irq[id].handler = isr; - alt_irq[id].context = isr_context; - - rc = (isr) ? alt_ic_irq_enable(ic_id, id) : alt_ic_irq_disable(ic_id, id); - - alt_irq_enable_all(status); - } - - return rc; -} - -#endif /* ALT_ENHANCED_INTERRUPT_API_PRESENT */ -#endif /* ALT_CPU_EIC_PRESENT */ diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_instruction_exception_entry.c b/software/qsys_tutorial_bsp/HAL/src/alt_instruction_exception_entry.c deleted file mode 100644 index f4f52fc..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_instruction_exception_entry.c +++ /dev/null @@ -1,203 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2008 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ -#include "sys/alt_exceptions.h" -#include "nios2.h" -#include "alt_types.h" -#include "system.h" - -/* - * This file implements support for calling user-registered handlers for - * instruction-generated exceptions. This handler could also be reached - * in the event of a spurious interrupt. - * - * The handler code is optionally enabled through the "Enable - * Instruction-related Exception API" HAL BSP setting, which will - * define the macro below. - */ -#ifdef ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API - -/* Function pointer to exception callback routine */ -alt_exception_result (*alt_instruction_exception_handler) - (alt_exception_cause, alt_u32, alt_u32) = 0x0; - -/* Link entry routine to .exceptions section */ -int alt_instruction_exception_entry (alt_u32 exception_pc) - __attribute__ ((section (".exceptions"))); - -/* - * This is the entry point for instruction-generated exceptions handling. - * This routine will be called by alt_exceptions_entry.S, after it determines - * that an exception could not be handled by handlers that preceed that - * of instruction-generated exceptions (such as interrupts). - * - * For this to function properly, you must register an exception handler - * using alt_instruction_exception_register(). This routine will call - * that handler if it has been registered. Absent a handler, it will - * break break or hang as discussed below. - */ -int alt_instruction_exception_entry (alt_u32 exception_pc) -{ - alt_u32 cause, badaddr; - -/* - * If the processor hardware has the optional EXCEPTIONS & BADADDR registers, - * read them and pass their content to the user handler. These are always - * present if the MMU or MPU is enabled, and optionally for other advanced - * exception types via the "Extra exceptions information" setting in the - * processor (hardware) configuration. - * - * If these registers are not present, the cause field will be set to - * NIOS2_EXCEPTION_CAUSE_NOT_PRESENT. Your handling routine should - * check the validity of the cause argument before proceeding. - */ -#ifdef NIOS2_HAS_EXTRA_EXCEPTION_INFO - /* Get exception cause & "badaddr" */ - NIOS2_READ_EXCEPTION(cause); - cause = ( (cause & NIOS2_EXCEPTION_REG_CAUSE_MASK) >> - NIOS2_EXCEPTION_REG_CAUSE_OFST ); - - NIOS2_READ_BADADDR(badaddr); -#else - cause = NIOS2_EXCEPTION_CAUSE_NOT_PRESENT; - badaddr = 0; -#endif /* NIOS2_HAS_EXTRA_EXCEPTION_INFO */ - - if(alt_instruction_exception_handler) { - /* - * Call handler. Its return value indicates whether the exception-causing - * instruction should be re-issued. The code that called us, - * alt_eceptions_entry.S, will look at this value and adjust the ea - * register as necessary - */ - return alt_instruction_exception_handler(cause, exception_pc, badaddr); - } - /* - * We got here because an instruction-generated exception occured, but no - * handler is present. We do not presume to know how to handle it. If the - * debugger is present, break, otherwise hang. - * - * If you've reached here in the debugger, consider examining the - * EXCEPTIONS register cause bit-field, which was read into the 'cause' - * variable above, and compare it against the exceptions-type enumeration - * in alt_exceptions.h. This register is availabe if the MMU or MPU is - * present, or if the "Extra exceptions information" hardware option is - * selected. - * - * If you get here then one of the following could have happened: - * - * - An instruction-generated exception occured, and the processor - * does not have the extra exceptions feature enabled, or you - * have not registered a handler using - * alt_instruction_exception_register() - * - * Some examples of instruction-generated exceptions and why they - * might occur: - * - * - Your program could have been compiled for a full-featured - * Nios II core, but it is running on a smaller core, and - * instruction emulation has been disabled by defining - * ALT_NO_INSTRUCTION_EMULATION. - * - * You can work around the problem by re-enabling instruction - * emulation, or you can figure out why your program is being - * compiled for a system other than the one that it is running on. - * - * - Your program has executed a trap instruction, but has not - * implemented a handler for this instruction. - * - * - Your program has executed an illegal instruction (one which is - * not defined in the instruction set). - * - * - Your processor includes an MMU or MPU, and you have enabled it - * before registering an exception handler to service exceptions it - * generates. - * - * The problem could also be hardware related: - * - If your hardware is broken and is generating spurious interrupts - * (a peripheral which negates its interrupt output before its - * interrupt handler has been executed will cause spurious interrupts) - */ - else { -#ifdef NIOS2_HAS_DEBUG_STUB - NIOS2_BREAK(); -#else - while(1) - ; -#endif /* NIOS2_HAS_DEBUG_STUB */ - } - - /* // We should not get here. Remove compiler warning. */ - return NIOS2_EXCEPTION_RETURN_REISSUE_INST; -} - -#endif /* ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API */ - -/* - * This routine indicates whether a particular exception cause will have - * set a valid address into the BADADDR register, which is included - * in the arguments to a user-registered instruction-generated exception - * handler. Many exception types do not set valid contents in BADADDR; - * this is a convenience routine to easily test the validity of that - * argument in your handler. - * - * Note that this routine will return false (0) for cause '12', - * TLB miss. This is because there are four exception types that - * share that cause, two of which do not have a valid BADADDR. You - * must determine BADADDR's validity for these. - * - * Arguments: - * cause: The 5-bit exception cause field of the EXCEPTIONS register, - * shifted to the LSB position. You may pass the 'cause' argument - * in a handler you registered directy to this routine. - * - * Return: 1: BADADDR (bad_addr argument to handler) is valid - * 0: BADADDR is not valid - */ -int alt_exception_cause_generated_bad_addr(alt_exception_cause cause) -{ - switch (cause) { - case NIOS2_EXCEPTION_SUPERVISOR_ONLY_DATA_ADDR: - return 1; - case NIOS2_EXCEPTION_MISALIGNED_DATA_ADDR: - return 1; - case NIOS2_EXCEPTION_MISALIGNED_TARGET_PC: - return 1; - case NIOS2_EXCEPTION_TLB_READ_PERM_VIOLATION: - return 1; - case NIOS2_EXCEPTION_TLB_WRITE_PERM_VIOLATION: - return 1; - case NIOS2_EXCEPTION_MPU_DATA_REGION_VIOLATION: - return 1; - default: - return 0; - } -} diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_instruction_exception_register.c b/software/qsys_tutorial_bsp/HAL/src/alt_instruction_exception_register.c deleted file mode 100644 index b059e1d..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_instruction_exception_register.c +++ /dev/null @@ -1,82 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2008 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ -#include "sys/alt_exceptions.h" -#include "alt_types.h" -#include "system.h" - -/* - * This file implements support for calling user-registered handlers for - * instruction-generated exceptions. - * - * The registry API is optionally enabled through the "Enable - * Instruction-related Exception API" HAL BSP setting, which will - * define the macro below. - */ -#ifdef ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API - -/* - * The header, alt_exception_handler_registry.h contains a struct describing - * the registered exception handler - */ -#include "priv/alt_exception_handler_registry.h" - -/* - * Pull in the exception entry assembly code. This will not be linked in - * unless this object is linked into the executable (i.e. only if - * alt_instruction_exception_register() is called). - */ -__asm__( "\n\t.globl alt_exception" ); - -/* - * alt_instruction_exception_register() is called to register a handler to - * service instruction-generated exceptions that are not handled by the - * default exception handler code (interrupts, and optionally unimplemented - * instructions and traps). - * - * Passing null (0x0) in the handler argument will disable a previously- - * registered handler. - * - * Note that if no handler is registered, exceptions that are not processed - * using the built-in handler (interrupts, and optionally unimplemented - * instructions and traps) are treated as unknown exceptions, resulting - * in either a break or an infinite loop. - */ -void alt_instruction_exception_register ( - alt_exception_result (*exception_handler)( - alt_exception_cause cause, - alt_u32 exception_pc, - alt_u32 bad_addr) ) -{ - alt_instruction_exception_handler = exception_handler; -} - -#endif /* ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API */ diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_io_redirect.c b/software/qsys_tutorial_bsp/HAL/src/alt_io_redirect.c deleted file mode 100644 index 8c862f7..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_io_redirect.c +++ /dev/null @@ -1,98 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include -#include - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - - -/* - * alt_open_fd() is similar to open() in that it is used to obtain a file - * descriptor for the file named "name". The "flags" and "mode" arguments are - * identical to the "flags" and "mode" arguments of open(). - * - * The distinction between the two functions is that the file descriptor - * structure to use is passed in as an argument, rather than allocated from the - * list of free file descriptors. - * - * This is used by alt_io_redirect() to redirect the stdin, stdout and stderr - * file descriptors to point to new devices. - * - * If the device can not be succesfully opened, then the input file descriptor - * remains unchanged. - */ - -static void alt_open_fd(alt_fd* fd, const char* name, int flags, int mode) -{ - int old; - - old = open (name, flags, mode); - - if (old >= 0) - { - fd->dev = alt_fd_list[old].dev; - fd->priv = alt_fd_list[old].priv; - fd->fd_flags = alt_fd_list[old].fd_flags; - - alt_release_fd (old); - } -} - -/* - * alt_io_redirect() is called once the device/filesystem lists have been - * initialised, but before main(). Its function is to redirect standard in, - * standard out and standard error so that they point to the devices selected by - * the user (as defined in system.h). - * - * Prior to the call to this function, io is directed towards /dev/null. If - * i/o can not be redirected to the requested device, for example if the device - * does not exist, then it remains directed at /dev/null. - */ - -void alt_io_redirect(const char* stdout_dev, - const char* stdin_dev, - const char* stderr_dev) -{ - /* Redirect the channels */ - - alt_open_fd (&alt_fd_list[STDOUT_FILENO], stdout_dev, O_WRONLY, 0777); - alt_open_fd (&alt_fd_list[STDIN_FILENO], stdin_dev, O_RDONLY, 0777); - alt_open_fd (&alt_fd_list[STDERR_FILENO], stderr_dev, O_WRONLY, 0777); -} - - - - diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_ioctl.c b/software/qsys_tutorial_bsp/HAL/src/alt_ioctl.c deleted file mode 100644 index f5d7ef1..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_ioctl.c +++ /dev/null @@ -1,170 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "sys/ioctl.h" -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -/* - * The ioctl() system call is provided so that application code can manipulate - * the i/o capabilities of a device in device specific ways. This is identical - * to the standard posix ioctl() function. - * - * In general this implementation simply vectors ioctl requests to the - * apropriate drivers ioctl function (as registered in the drivers alt_dev - * structure). - * - * However in the case of devices (as oposed to filesystem), the TIOCEXCL and - * TIOCNXCL requests are handled without reference to the driver. These - * requests are used to lock/release a device for exclusive access. - * - * Handling these requests centrally eases the task of device driver - * development. - * - * ALT_IOCTL is mapped onto the ioctl() system call in alt_syscall.h - */ - -#ifdef ALT_USE_DIRECT_DRIVERS - -#include "system.h" -#include "sys/alt_driver.h" - -/* - * Provide minimal version that calls ioctl routine of provided stdio devices. - */ -int ALT_IOCTL (int file, int req, void* arg) -{ -#ifdef ALT_STDIN_PRESENT - ALT_DRIVER_IOCTL_EXTERNS(ALT_STDIN_DEV); -#endif -#ifdef ALT_STDOUT_PRESENT - ALT_DRIVER_IOCTL_EXTERNS(ALT_STDOUT_DEV); -#endif -#ifdef ALT_STDERR_PRESENT - ALT_DRIVER_IOCTL_EXTERNS(ALT_STDERR_DEV); -#endif - -#if !defined(ALT_STDIN_PRESENT) && !defined(ALT_STDOUT_PRESENT) && !defined(ALT_STDERR_PRESENT) - /* Generate a link time warning, should this function ever be called. */ - ALT_STUB_WARNING(ioctl); -#endif - - switch (file) { -#ifdef ALT_STDIN_PRESENT - case 0: /* stdin file descriptor */ - return ALT_DRIVER_IOCTL(ALT_STDIN_DEV, req, arg); -#endif /* ALT_STDIN_PRESENT */ -#ifdef ALT_STDOUT_PRESENT - case 1: /* stdout file descriptor */ - return ALT_DRIVER_IOCTL(ALT_STDOUT_DEV, req, arg); -#endif /* ALT_STDOUT_PRESENT */ -#ifdef ALT_STDERR_PRESENT - case 2: /* stderr file descriptor */ - return ALT_DRIVER_IOCTL(ALT_STDERR_DEV, req, arg); -#endif /* ALT_STDERR_PRESENT */ - default: - ALT_ERRNO = EBADFD; - return -1; - } -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -int ALT_IOCTL (int file, int req, void* arg) -{ - alt_fd* fd; - int rc; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - - /* - * In the case of device drivers (not file systems) handle the TIOCEXCL - * and TIOCNXCL requests as special cases. - */ - - if (fd->fd_flags & ALT_FD_DEV) - { - if (req == TIOCEXCL) - { - rc = alt_fd_lock (fd); - goto ioctl_done; - } - else if (req == TIOCNXCL) - { - rc = alt_fd_unlock (fd); - goto ioctl_done; - } - } - - /* - * If the driver provides an ioctl() function, call that to handle the - * request, otherwise set the return code to indicate that the request - * could not be processed. - */ - - if (fd->dev->ioctl) - { - rc = fd->dev->ioctl(fd, req, arg); - } - else - { - rc = -ENOTTY; - } - } - else - { - rc = -EBADFD; - } - -ioctl_done: - - if (rc < 0) - { - ALT_ERRNO = -rc; - } - return rc; -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_irq_entry.S b/software/qsys_tutorial_bsp/HAL/src/alt_irq_entry.S deleted file mode 100644 index d3efe7d..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_irq_entry.S +++ /dev/null @@ -1,108 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "system.h" - -/* - * This is the interrupt exception entry point code, which saves all the - * registers and calls the interrupt handler. It should be pulled in using - * a .globl from alt_irq_register.c. This scheme is used so that if an - * interrupt is never registered, then this code will not appear in the - * generated executable, thereby improving code footprint. - */ - - /* - * Explicitly allow the use of r1 (the assembler temporary register) - * within this code. This register is normally reserved for the use of - * the compiler. - */ - .set noat - - /* - * Pull in the exception handler register save code. - */ - .globl alt_exception - - .globl alt_irq_entry - .section .exceptions.entry.label, "xa" -alt_irq_entry: - - /* - * Section .exceptions.entry is in alt_exception_entry.S - * This saves all the caller saved registers and reads estatus into r5 - */ - - .section .exceptions.irqtest, "xa" - -#ifdef ALT_CI_INTERRUPT_VECTOR_N - /* - * Use the interrupt vector custom instruction if present to accelerate - * this code. - * If the interrupt vector custom instruction returns a negative - * value, there are no interrupts active (estatus.pie is 0 - * or ipending is 0) so assume it is a software exception. - */ - custom ALT_CI_INTERRUPT_VECTOR_N, r4, r0, r0 - blt r4, r0, .Lnot_irq -#else - /* - * Test to see if the exception was a software exception or caused - * by an external interrupt, and vector accordingly. - */ - rdctl r4, ipending - andi r2, r5, 1 - beq r2, zero, .Lnot_irq - beq r4, zero, .Lnot_irq -#endif /* ALT_CI_INTERRUPT_VECTOR_N */ - - .section .exceptions.irqhandler, "xa" - /* - * Now that all necessary registers have been preserved, call - * alt_irq_handler() to process the interrupts. - */ - - call alt_irq_handler - - .section .exceptions.irqreturn, "xa" - - br .Lexception_exit - - .section .exceptions.notirq.label, "xa" - -.Lnot_irq: - - /* - * Section .exceptions.exit is in alt_exception_entry.S - * This restores all the caller saved registers - */ - - .section .exceptions.exit.label -.Lexception_exit: - diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_irq_handler.c b/software/qsys_tutorial_bsp/HAL/src/alt_irq_handler.c deleted file mode 100644 index 3253d02..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_irq_handler.c +++ /dev/null @@ -1,169 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include "system.h" - -/* - * This interrupt handler only works with an internal interrupt controller - * (IIC). Processors with an external interrupt controller (EIC) use an - * implementation provided by an EIC driver. - */ -#ifndef ALT_CPU_EIC_PRESENT - -#include "sys/alt_irq.h" -#include "os/alt_hooks.h" - -#include "alt_types.h" - -/* - * A table describing each interrupt handler. The index into the array is the - * interrupt id associated with the handler. - * - * When an interrupt occurs, the associated handler is called with - * the argument stored in the context member. - */ -struct ALT_IRQ_HANDLER -{ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - void (*handler)(void*); -#else - void (*handler)(void*, alt_u32); -#endif - void *context; -} alt_irq[ALT_NIRQ]; - -/* - * alt_irq_handler() is called by the interrupt exception handler in order to - * process any outstanding interrupts. - * - * It is defined here since it is linked in using weak linkage. - * This means that if there is never a call to alt_irq_register() (above) then - * this function will not get linked in to the executable. This is acceptable - * since if no handler is ever registered, then an interrupt can never occur. - * - * If Nios II interrupt vector custom instruction exists, use it to accelerate - * the dispatch of interrupt handlers. The Nios II interrupt vector custom - * instruction is present if the macro ALT_CI_INTERRUPT_VECTOR defined. - */ - -void alt_irq_handler (void) __attribute__ ((section (".exceptions"))); -void alt_irq_handler (void) -{ -#ifdef ALT_CI_INTERRUPT_VECTOR - alt_32 offset; - char* alt_irq_base = (char*)alt_irq; -#else - alt_u32 active; - alt_u32 mask; - alt_u32 i; -#endif /* ALT_CI_INTERRUPT_VECTOR */ - - /* - * Notify the operating system that we are at interrupt level. - */ - - ALT_OS_INT_ENTER(); - -#ifdef ALT_CI_INTERRUPT_VECTOR - /* - * Call the interrupt vector custom instruction using the - * ALT_CI_INTERRUPT_VECTOR macro. - * It returns the offset into the vector table of the lowest-valued pending - * interrupt (corresponds to highest priority) or a negative value if none. - * The custom instruction assumes that each table entry is eight bytes. - */ - while ((offset = ALT_CI_INTERRUPT_VECTOR) >= 0) { - struct ALT_IRQ_HANDLER* handler_entry = - (struct ALT_IRQ_HANDLER*)(alt_irq_base + offset); -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - handler_entry->handler(handler_entry->context); -#else - handler_entry->handler(handler_entry->context, offset >> 3); -#endif - } -#else /* ALT_CI_INTERRUPT_VECTOR */ - /* - * Obtain from the interrupt controller a bit list of pending interrupts, - * and then process the highest priority interrupt. This process loops, - * loading the active interrupt list on each pass until alt_irq_pending() - * return zero. - * - * The maximum interrupt latency for the highest priority interrupt is - * reduced by finding out which interrupts are pending as late as possible. - * Consider the case where the high priority interupt is asserted during - * the interrupt entry sequence for a lower priority interrupt to see why - * this is the case. - */ - - active = alt_irq_pending (); - - do - { - i = 0; - mask = 1; - - /* - * Test each bit in turn looking for an active interrupt. Once one is - * found, the interrupt handler asigned by a call to alt_irq_register() is - * called to clear the interrupt condition. - */ - - do - { - if (active & mask) - { -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - alt_irq[i].handler(alt_irq[i].context); -#else - alt_irq[i].handler(alt_irq[i].context, i); -#endif - break; - } - mask <<= 1; - i++; - - } while (1); - - active = alt_irq_pending (); - - } while (active); -#endif /* ALT_CI_INTERRUPT_VECTOR */ - - /* - * Notify the operating system that interrupt processing is complete. - */ - - ALT_OS_INT_EXIT(); -} - -#endif /* ALT_CPU_EIC_PRESENT */ diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_irq_register.c b/software/qsys_tutorial_bsp/HAL/src/alt_irq_register.c deleted file mode 100644 index b5ea474..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_irq_register.c +++ /dev/null @@ -1,102 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ -#include -#include "system.h" - -/* - * This interrupt registry mechanism works with the Nios II internal interrupt - * controller (IIC) only. Systems with an external interrupt controller (EIC), - * or those with the IIC who are using the enhanced interrupt API will - * utilize the alt_ic_isr_register() routine to register an interrupt. - */ -#ifndef NIOS2_EIC_PRESENT - -#include "sys/alt_irq.h" -#include "priv/alt_legacy_irq.h" -#include "os/alt_hooks.h" - -#include "alt_types.h" - -/* - * The header, alt_irq_entry.h, contains the exception entry point, and is - * provided by the processor component. It is included here, so that the code - * will be added to the executable only if alt_irq_register() is present, i.e. - * if no interrupts are registered - there's no need to provide any - * interrupt handling. - */ - -#include "sys/alt_irq_entry.h" - -/* - * The header, alt_irq_table.h contains a table describing which function - * handles each interrupt. - */ - -#include "priv/alt_irq_table.h" - -/* - * alt_irq_handler() is called to register an interrupt handler. If the - * function is succesful, then the requested interrupt will be enabled upon - * return. Registering a NULL handler will disable the interrupt. - * - * The return value is 0 if the interrupt handler was registered and the - * interrupt was enabled, otherwise it is negative. - */ - -int alt_irq_register (alt_u32 id, - void* context, - alt_isr_func handler) -{ - int rc = -EINVAL; - alt_irq_context status; - - if (id < ALT_NIRQ) - { - /* - * interrupts are disabled while the handler tables are updated to ensure - * that an interrupt doesn't occur while the tables are in an inconsistant - * state. - */ - - status = alt_irq_disable_all (); - - alt_irq[id].handler = handler; - alt_irq[id].context = context; - - rc = (handler) ? alt_irq_enable (id): alt_irq_disable (id); - - alt_irq_enable_all(status); - } - return rc; -} -#endif /* NIOS2_EIC_PRESENT */ - diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_irq_vars.c b/software/qsys_tutorial_bsp/HAL/src/alt_irq_vars.c deleted file mode 100644 index 8c0a18d..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_irq_vars.c +++ /dev/null @@ -1,47 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "alt_types.h" - -#include "system.h" - -/* - * These global variables are used to save the current list of enabled - * interrupts. See alt_irq.h for further details. - */ - -volatile alt_u32 alt_irq_active = 0; - -#ifndef ALT_EXCEPTION_STACK - -volatile alt_u32 alt_priority_mask = (alt_u32) -1; - -#endif - diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_isatty.c b/software/qsys_tutorial_bsp/HAL/src/alt_isatty.c deleted file mode 100644 index 9276472..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_isatty.c +++ /dev/null @@ -1,125 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include "sys/alt_dev.h" -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -#ifdef ALT_USE_DIRECT_DRIVERS - -#include "system.h" - -/* - * Provide minimal version that just describes all file descriptors - * as tty devices for provided stdio devices. - */ -int ALT_ISATTY (int file) -{ - switch (file) { -#ifdef ALT_STDIN_PRESENT - case 0: /* stdin file descriptor */ -#endif /* ALT_STDIN_PRESENT */ -#ifdef ALT_STDOUT_PRESENT - case 1: /* stdout file descriptor */ -#endif /* ALT_STDOUT_PRESENT */ -#ifdef ALT_STDERR_PRESENT - case 2: /* stderr file descriptor */ -#endif /* ALT_STDERR_PRESENT */ - return 1; - default: - return 0; - } - -#if !defined(ALT_STDIN_PRESENT) && !defined(ALT_STDOUT_PRESENT) && !defined(ALT_STDERR_PRESENT) - /* Generate a link time warning, should this function ever be called. */ - ALT_STUB_WARNING(isatty); -#endif -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ -/* - * isatty() can be used to determine whether the input file descriptor "file" - * refers to a terminal device or not. If it is a terminal device then the - * return value is one, otherwise it is zero. - * - * ALT_ISATTY is mapped onto the isatty() system call in alt_syscall.h - */ - -int ALT_ISATTY (int file) -{ - alt_fd* fd; - struct stat stat; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - /* - * If a device driver does not provide an fstat() function, then it is - * treated as a terminal device by default. - */ - - if (!fd->dev->fstat) - { - return 1; - } - - /* - * If a driver does provide an implementation of the fstat() function, then - * this is called so that the device can identify itself. - */ - - else - { - fstat (file, &stat); - return (stat.st_mode == _IFCHR) ? 1 : 0; - } - } - else - { - ALT_ERRNO = EBADFD; - return 0; - } -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_kill.c b/software/qsys_tutorial_bsp/HAL/src/alt_kill.c deleted file mode 100644 index 42c2e1d..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_kill.c +++ /dev/null @@ -1,121 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include "sys/alt_errno.h" -#include "os/alt_syscall.h" - - -/* - * kill() is used by newlib in order to send signals to processes. Since there - * is only a single process in the HAL, the only valid values for pid are - * either the current process id, or the broadcast values, i.e. pid must be - * less than or equal to zero. - * - * ALT_KILL is mapped onto the kill() system call in alt_syscall.h - */ - -int ALT_KILL (int pid, int sig) -{ - int status = 0; - - if (pid <= 0) - { - switch (sig) - { - case 0: - - /* The null signal is used to check that a pid is valid. */ - - break; - - case SIGABRT: - case SIGALRM: - case SIGFPE: - case SIGILL: - case SIGKILL: - case SIGPIPE: - case SIGQUIT: - case SIGSEGV: - case SIGTERM: - case SIGUSR1: - case SIGUSR2: - case SIGBUS: - case SIGPOLL: - case SIGPROF: - case SIGSYS: - case SIGTRAP: - case SIGVTALRM: - case SIGXCPU: - case SIGXFSZ: - - /* - * The Posix standard defines the default behaviour for all these signals - * as being eqivalent to a call to _exit(). No mechanism is provided to - * change this behaviour. - */ - - _exit(0); - case SIGCHLD: - case SIGURG: - - /* - * The Posix standard defines these signals to be ignored by default. No - * mechanism is provided to change this behaviour. - */ - - break; - default: - - /* Tried to send an unsupported signal */ - - status = EINVAL; - } - } - - else if (pid > 0) - { - /* Attempted to signal a non-existant process */ - - status = ESRCH; - } - - if (status) - { - ALT_ERRNO = status; - return -1; - } - - return 0; -} diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_link.c b/software/qsys_tutorial_bsp/HAL/src/alt_link.c deleted file mode 100644 index d796c59..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_link.c +++ /dev/null @@ -1,56 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_warning.h" -#include "sys/alt_errno.h" -#include "os/alt_syscall.h" - -/* - * link() is used by newlib to create a new link to an existing file. This is - * unsupported in the HAL environment. However a "do-nothing" implementation - * is still provied for newlib compatability. - * - * ALT_LINK is mapped onto the link() system call in alt_syscall.h - */ - -int ALT_LINK ( char *existing, char *new) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(link); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} - diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_load.c b/software/qsys_tutorial_bsp/HAL/src/alt_load.c deleted file mode 100644 index ffab4b9..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_load.c +++ /dev/null @@ -1,88 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_load.h" -#include "sys/alt_cache.h" - -/* - * Linker defined symbols. - */ - -extern void __flash_rwdata_start; -extern void __ram_rwdata_start; -extern void __ram_rwdata_end; -extern void __flash_rodata_start; -extern void __ram_rodata_start; -extern void __ram_rodata_end; -extern void __flash_exceptions_start; -extern void __ram_exceptions_start; -extern void __ram_exceptions_end; - -/* - * alt_load() is called when the code is executing from flash. In this case - * there is no bootloader, so this application is responsible for loading to - * RAM any sections that are required. - */ - -void alt_load (void) -{ - /* - * Copy the .rwdata section. - */ - - alt_load_section (&__flash_rwdata_start, - &__ram_rwdata_start, - &__ram_rwdata_end); - - /* - * Copy the exception handler. - */ - - alt_load_section (&__flash_exceptions_start, - &__ram_exceptions_start, - &__ram_exceptions_end); - - /* - * Copy the .rodata section. - */ - - alt_load_section (&__flash_rodata_start, - &__ram_rodata_start, - &__ram_rodata_end); - - /* - * Now ensure that the caches are in synch. - */ - - alt_dcache_flush_all(); - alt_icache_flush_all(); -} diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_log_macro.S b/software/qsys_tutorial_bsp/HAL/src/alt_log_macro.S deleted file mode 100644 index 499c4ad..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_log_macro.S +++ /dev/null @@ -1,56 +0,0 @@ -/* alt_log_macro.S - * - * Implements the function tx_log_str, called by the assembly macro - * ALT_LOG_PUTS(). The macro will be empty when logging is turned off, - * and this function will not be compiled. When logging is on, - * this function is used to print out the strings defined in the beginning - * of alt_log_printf.c, using port information taken from system.h and - * alt_log_printf.h. - * - * This routine only handles strings, and sends a character into the defined - * output device's output buffer when the device is ready. It's intended for - * debugging purposes, where messages can be set to print out at certain - * points in the boot code to indicate the progress of the program. - * - */ - -#ifndef __ALT_LOG_MACROS__ -#define __ALT_LOG_MACROS__ - -/* define this flag to skip assembly-incompatible parts - * of various include files. */ -#define ALT_ASM_SRC - -#ifdef ALT_LOG_ENABLE // only compile this function if this flag is defined. - - #include "system.h" - #include "sys/alt_log_printf.h" - - .global tx_log_str -tx_log_str: - /* load base uart / jtag uart address into r6 */ - movhi r6, %hiadj(ALT_LOG_PORT_BASE) - addi r6, r6, %lo(ALT_LOG_PORT_BASE) -tx_next_char: - /* if pointer points to null, return - * r4 is the pointer to the str to be printed, set by ALT_LOG_PUTS */ - ldb r7, (r4) - beq r0, r7, end_tx - - /* check device transmit ready */ -wait_tx_ready_loop: - ldwio r5, ALT_LOG_PRINT_REG_OFFSET(r6) - andi r5, r5, ALT_LOG_PRINT_MSK - beq r5, r0, wait_tx_ready_loop - /* write char */ - stwio r7, ALT_LOG_PRINT_TXDATA_REG_OFFSET (r6) - /* advance string pointer */ - addi r4, r4, 1 - br tx_next_char -end_tx: - ret - -#endif - -#endif /* __ALT_LOG_MACROS__ */ - diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_log_printf.c b/software/qsys_tutorial_bsp/HAL/src/alt_log_printf.c deleted file mode 100644 index 1f7056d..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_log_printf.c +++ /dev/null @@ -1,479 +0,0 @@ - -/* alt_log_printf.c - * - * This file implements the various C functions used for the - * alt_log logging/debugging print functions. The functions - * sit as is here - the job of hiding them from the compiler - * if logging is disabled is accomplished in the .h file. - * - * All the global variables for alt_log are defined here. - * These include the various flags that turn on additional - * logging options; the strings for assembly printing; and - * other globals needed by different logging options. - * - * There are 4 functions that handle the actual printing: - * alt_log_txchar: Actual function that puts 1 char to UART/JTAG UART. - * alt_log_repchar: Calls alt_log_txchar 'n' times - used by - * alt_log_private_printf for formatting. - * alt_log_private_printf: - * Stripped down implementation of printf - no floats. - * alt_log_printf_proc: - * Wrapper function for private_printf. - * - * The rest of the functions are called by the macros which - * were called by code in the other components. Each function - * is preceded by a comment, about which file it gets called - * in, and what its purpose is. - * - * author: gkwan - */ - -/* skip all code if enable is off */ -#ifdef ALT_LOG_ENABLE - -#include -#include -#include -#ifdef __ALTERA_AVALON_JTAG_UART - #include "altera_avalon_jtag_uart.h" - #include -#endif -#include "sys/alt_log_printf.h" - -/* strings for assembly puts */ -char alt_log_msg_bss[] = "[crt0.S] Clearing BSS \r\n";; -char alt_log_msg_alt_main[] = "[crt0.S] Calling alt_main.\r\n"; -char alt_log_msg_stackpointer[] \ - = "[crt0.S] Setting up stack and global pointers.\r\n"; -char alt_log_msg_cache[] = "[crt0.S] Inst & Data Cache Initialized.\r\n"; -/* char array allocation for alt_write */ -char alt_log_write_buf[ALT_LOG_WRITE_ECHO_LEN+2]; - -/* global variables for all 'on' flags */ - -/* - * The boot message flag is linked into the data (rwdata) section - * because if it is zero, it would otherwise be placed in the bss section. - * alt_log examines this variable before the BSS is cleared in the boot-up - * process. - */ -volatile alt_u32 alt_log_boot_on_flag \ - __attribute__ ((section (".data"))) = ALT_LOG_BOOT_ON_FLAG_SETTING; - -volatile alt_u8 alt_log_write_on_flag = ALT_LOG_WRITE_ON_FLAG_SETTING; - -volatile alt_u8 alt_log_sys_clk_on_flag = ALT_LOG_SYS_CLK_ON_FLAG_SETTING; - -volatile alt_u8 alt_log_jtag_uart_alarm_on_flag = \ - ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING; - -volatile alt_u8 alt_log_jtag_uart_isr_on_flag = \ - ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING; - -volatile alt_u8 alt_log_jtag_uart_startup_info_on_flag = \ - ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING; - -/* Global alarm object for recurrent JTAG UART status printing */ -alt_alarm alt_log_jtag_uart_alarm_1; - -/* Global ints for system clock printing and count */ -volatile int alt_log_sys_clk_count; -volatile int alt_system_clock_in_sec; - -/* enum used by alt_log_private_printf */ -enum -{ - pfState_chars, - pfState_firstFmtChar, - pfState_otherFmtChar -}; - - - - -/* Function to put one char onto the UART/JTAG UART txdata register. */ -void alt_log_txchar(int c,char *base) -{ - /* Wait until the device is ready for a character */ - while((ALT_LOG_PRINT_REG_RD(base) & ALT_LOG_PRINT_MSK) == 0) - ; - /* And pop the character into the register */ - ALT_LOG_PRINT_TXDATA_WR(base,c); -} - - -/* Called by alt_log_private_printf to print out characters repeatedly */ -void alt_log_repchar(char c,int r,int base) -{ - while(r-- > 0) - alt_log_txchar(c,(char*) base); -} - - -/* Stripped down printf function */ -void alt_log_private_printf(const char *fmt,int base,va_list args) - { - const char *w; - char c; - int state; - int fmtLeadingZero = 0; /* init these all to 0 for -W warnings. */ - int fmtLong = 0; - int fmtBeforeDecimal = 0; - int fmtAfterDecimal = 0; - int fmtBase = 0; - int fmtSigned = 0; - int fmtCase = 0; /* For hex format, if 1, A-F, else a-f. */ - - w = fmt; - state = pfState_chars; - - while(0 != (c = *w++)) - { - switch(state) - { - case pfState_chars: - if(c == '%') - { - fmtLeadingZero = 0; - fmtLong = 0; - fmtBase = 10; - fmtSigned = 1; - fmtCase = 0; /* Only %X sets this. */ - fmtBeforeDecimal = -1; - fmtAfterDecimal = -1; - state = pfState_firstFmtChar; - } - else - { - alt_log_txchar(c,(char*)base); - } - break; - - case pfState_firstFmtChar: - if(c == '0') - { - fmtLeadingZero = 1; - state = pfState_otherFmtChar; - } - else if(c == '%') - { - alt_log_txchar(c,(char*)base); - state = pfState_chars; - } - else - { - state = pfState_otherFmtChar; - goto otherFmtChar; - } - break; - - case pfState_otherFmtChar: -otherFmtChar: - if(c == '.') - { - fmtAfterDecimal = 0; - } - else if('0' <= c && c <= '9') - { - c -= '0'; - if(fmtAfterDecimal < 0) /* still before decimal */ - { - if(fmtBeforeDecimal < 0) - { - fmtBeforeDecimal = 0; - } - else - { - fmtBeforeDecimal *= 10; - } - fmtBeforeDecimal += c; - } - else - { - fmtAfterDecimal = (fmtAfterDecimal * 10) + c; - } - } - else if(c == 'l') - { - fmtLong = 1; - } - else /* we're up to the letter which determines type */ - { - switch(c) - { - case 'd': - case 'i': -doIntegerPrint: - { - unsigned long v; - unsigned long p; /* biggest power of fmtBase */ - unsigned long vShrink; /* used to count digits */ - int sign; - int digitCount; - - /* Get the value */ - if(fmtLong) - { - if (fmtSigned) - { - v = va_arg(args,long); - } - else - { - v = va_arg(args,unsigned long); - } - } - else - { - if (fmtSigned) - { - v = va_arg(args,int); - } - else - { - v = va_arg(args,unsigned int); - } - } - - /* Strip sign */ - sign = 0; - /* (assumes sign bit is #31) */ - if( fmtSigned && (v & (0x80000000)) ) - { - v = ~v + 1; - sign = 1; - } - - /* Count digits, and get largest place value */ - vShrink = v; - p = 1; - digitCount = 1; - while( (vShrink = vShrink / fmtBase) > 0 ) - { - digitCount++; - p *= fmtBase; - } - - /* Print leading characters & sign */ - fmtBeforeDecimal -= digitCount; - if(fmtLeadingZero) - { - if(sign) - { - alt_log_txchar('-',(char*)base); - fmtBeforeDecimal--; - } - alt_log_repchar('0',fmtBeforeDecimal,base); - } - else - { - if(sign) - { - fmtBeforeDecimal--; - } - alt_log_repchar(' ',fmtBeforeDecimal,base); - if(sign) - { - alt_log_txchar('-',(char*)base); - } - } - - /* Print numbery parts */ - while(p) - { - unsigned char d; - - d = v / p; - d += '0'; - if(d > '9') - { - d += (fmtCase ? 'A' : 'a') - '0' - 10; - } - alt_log_txchar(d,(char*)base); - - v = v % p; - p = p / fmtBase; - } - } - - state = pfState_chars; - break; - - case 'u': - fmtSigned = 0; - goto doIntegerPrint; - case 'o': - fmtSigned = 0; - fmtBase = 8; - goto doIntegerPrint; - case 'x': - fmtSigned = 0; - fmtBase = 16; - goto doIntegerPrint; - case 'X': - fmtSigned = 0; - fmtBase = 16; - fmtCase = 1; - goto doIntegerPrint; - - case 'c': - alt_log_repchar(' ',fmtBeforeDecimal-1,base); - alt_log_txchar(va_arg(args,int),(char*)base); - break; - - case 's': - { - char *s; - - s = va_arg(args,char *); - alt_log_repchar(' ',fmtBeforeDecimal-strlen(s),base); - - while(*s) - alt_log_txchar(*s++,(char*)base); - } - break; - } /* switch last letter of fmt */ - state=pfState_chars; - } - break; - } /* switch */ - } /* while chars left */ - } /* printf */ - -/* Main logging printf function */ -int alt_log_printf_proc(const char *fmt, ... ) -{ - va_list args; - - va_start (args, fmt); - alt_log_private_printf(fmt,ALT_LOG_PORT_BASE,args); - return (0); -} - -/* Below are the functions called by different macros in various components. */ - -/* If the system has a JTAG_UART, include JTAG_UART debugging functions */ -#ifdef __ALTERA_AVALON_JTAG_UART - -/* The alarm function in altera_avalon_jtag_uart.c. - * This function, when turned on, prints out the status - * of the JTAG UART Control register, every ALT_LOG_JTAG_UART_TICKS. - * If the flag is off, the alarm should never be registered, and this - * function should never run */ -alt_u32 altera_avalon_jtag_uart_report_log(void * context) -{ - if (alt_log_jtag_uart_alarm_on_flag) { - altera_avalon_jtag_uart_state* dev = (altera_avalon_jtag_uart_state*) context; - const char* header="JTAG Alarm:"; - alt_log_jtag_uart_print_control_reg(dev, dev->base, header); - return ALT_LOG_JTAG_UART_TICKS; - } - else - { - /* If flag is not on, return 0 to disable future alarms. - * Should never be here, alarm should not be enabled at all. */ - return 0; - } -} - -void alt_log_jtag_uart_print_control_reg(altera_avalon_jtag_uart_state* dev, int base, const char* header) -{ - unsigned int control, space, ac, wi, ri, we, re; - control = IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base); - space = (control & ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_MSK) >> - ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_OFST; - we= (control & ALTERA_AVALON_JTAG_UART_CONTROL_WE_MSK) >> - ALTERA_AVALON_JTAG_UART_CONTROL_WE_OFST; - re= (control & ALTERA_AVALON_JTAG_UART_CONTROL_RE_MSK) >> - ALTERA_AVALON_JTAG_UART_CONTROL_RE_OFST; - ri= (control & ALTERA_AVALON_JTAG_UART_CONTROL_RI_MSK) >> - ALTERA_AVALON_JTAG_UART_CONTROL_RI_OFST; - wi= (control & ALTERA_AVALON_JTAG_UART_CONTROL_WI_MSK) >> - ALTERA_AVALON_JTAG_UART_CONTROL_WI_OFST; - ac= (control & ALTERA_AVALON_JTAG_UART_CONTROL_AC_MSK) >> - ALTERA_AVALON_JTAG_UART_CONTROL_AC_OFST; - -#ifdef ALTERA_AVALON_JTAG_UART_SMALL - ALT_LOG_PRINTF( - "%s HW FIFO wspace=%d AC=%d WI=%d RI=%d WE=%d RE=%d\r\n", - header,space,ac,wi,ri,we,re); -#else - ALT_LOG_PRINTF( - "%s SW CirBuf = %d, HW FIFO wspace=%d AC=%d WI=%d RI=%d WE=%d RE=%d\r\n", - header,(dev->tx_out-dev->tx_in),space,ac,wi,ri,we,re); -#endif - - return; - -} - -/* In altera_avalon_jtag_uart.c - * Same output as the alarm function above, but this is called in the driver - * init function. Hence, it gives the status of the JTAG UART control register - * right at the initialization of the driver */ -void alt_log_jtag_uart_startup_info(altera_avalon_jtag_uart_state* dev, int base) -{ - const char* header="JTAG Startup Info:"; - alt_log_jtag_uart_print_control_reg(dev, base, header); - return; -} - -/* In altera_avalon_jtag_uart.c - * When turned on, this function will print out the status of the jtag uart - * control register every time there is a jtag uart "almost-empty" interrupt. */ -void alt_log_jtag_uart_isr_proc(int base, altera_avalon_jtag_uart_state* dev) -{ - if (alt_log_jtag_uart_isr_on_flag) { - const char* header="JTAG IRQ:"; - alt_log_jtag_uart_print_control_reg(dev, base, header); - } - return; -} - -#endif /* __ALTERA_AVALON_JTAG_UART */ - -/* In alt_write.c - * When the alt_log_write_on_flag is turned on, this function gets called - * every time alt_write gets called. The first - * ALT_LOG_WRITE_ECHO_LEN characters of every printf command (or any command - * that eventually calls write()) gets echoed to the alt_log output. */ -void alt_log_write(const void *ptr, size_t len) -{ - if (alt_log_write_on_flag) { - int temp_cnt; - int length=(ALT_LOG_WRITE_ECHO_LEN>len) ? len : ALT_LOG_WRITE_ECHO_LEN; - - if (length < 2) return; - - strncpy (alt_log_write_buf,ptr,length); - alt_log_write_buf[length-1]='\n'; - alt_log_write_buf[length]='\r'; - alt_log_write_buf[length+1]='\0'; - - /* Escape Ctrl-D's. If the Ctrl-D gets sent it might kill the terminal - * connection of alt_log. It will get replaced by 'D'. */ - for (temp_cnt=0;temp_cnt < length; temp_cnt++) { - if (alt_log_write_buf[temp_cnt]== 0x4) { - alt_log_write_buf[temp_cnt]='D'; - } - } - ALT_LOG_PRINTF("Write Echo: %s",alt_log_write_buf); - } -} - -/* In altera_avalon_timer_sc - * This function prints out a system clock is alive message - * every ALT_LOG_SYS_CLK_INTERVAL (in ticks). */ -void alt_log_system_clock() -{ - if (alt_log_sys_clk_on_flag) { - alt_log_sys_clk_count++; - if (alt_log_sys_clk_count > ALT_LOG_SYS_CLK_INTERVAL) { - alt_log_sys_clk_count = 0; - ALT_LOG_PRINTF("System Clock On %u\r\n",alt_system_clock_in_sec++); - } - } -} - - -#endif diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_lseek.c b/software/qsys_tutorial_bsp/HAL/src/alt_lseek.c deleted file mode 100644 index 7857b0d..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_lseek.c +++ /dev/null @@ -1,117 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -#ifdef ALT_USE_DIRECT_DRIVERS - -off_t ALT_LSEEK (int file, off_t ptr, int dir) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(lseek); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -/* - * lseek() can be called to move the read/write pointer associated with the - * file descriptor "file". This function simply vectors the call to the lseek() - * function provided by the driver associated with the file descriptor. - * - * If the driver does not provide an implementation of lseek() an error is - * indicated. - * - * lseek() corresponds to the standard lseek() function. - * - * ALT_LSEEK is mapped onto the lseek() system call in alt_syscall.h - * - */ - -off_t ALT_LSEEK (int file, off_t ptr, int dir) -{ - alt_fd* fd; - off_t rc = 0; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - /* - * If the device driver provides an implementation of the lseek() function, - * then call that to process the request. - */ - - if (fd->dev->lseek) - { - rc = fd->dev->lseek(fd, ptr, dir); - } - /* - * Otherwise return an error. - */ - - else - { - rc = -ENOTSUP; - } - } - else - { - rc = -EBADFD; - } - - if (rc < 0) - { - ALT_ERRNO = -rc; - rc = -1; - } - - return rc; -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_main.c b/software/qsys_tutorial_bsp/HAL/src/alt_main.c deleted file mode 100644 index a96229b..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_main.c +++ /dev/null @@ -1,161 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include -#include -#include -#include - -#include "sys/alt_dev.h" -#include "sys/alt_sys_init.h" -#include "sys/alt_irq.h" -#include "sys/alt_dev.h" - -#include "os/alt_hooks.h" - -#include "priv/alt_file.h" -#include "alt_types.h" - -#include "system.h" - -#include "sys/alt_log_printf.h" - -extern void _do_ctors(void); -extern void _do_dtors(void); - -/* - * Standard arguments for main. By default, no arguments are passed to main. - * However a device driver may choose to configure these arguments by calling - * alt_set_args(). The expectation is that this facility will only be used by - * the iclient/ihost utility. - */ - -int alt_argc = 0; -char** alt_argv = {NULL}; -char** alt_envp = {NULL}; - -/* - * Prototype for the entry point to the users application. - */ - -extern int main (int, char **, char **); - -/* - * alt_main is the C entry point for the HAL. It is called by the assembler - * startup code in the processor specific crt0.S. It is responsible for: - * completing the C runtime configuration; configuring all the - * devices/filesystems/components in the system; and call the entry point for - * the users application, i.e. main(). - */ - -void alt_main (void) -{ -#ifndef ALT_NO_EXIT - int result; -#endif - - /* ALT LOG - please see HAL/sys/alt_log_printf.h for details */ - ALT_LOG_PRINT_BOOT("[alt_main.c] Entering alt_main, calling alt_irq_init.\r\n"); - /* Initialize the interrupt controller. */ - alt_irq_init (NULL); - - /* Initialize the operating system */ - ALT_LOG_PRINT_BOOT("[alt_main.c] Done alt_irq_init, calling alt_os_init.\r\n"); - ALT_OS_INIT(); - - /* - * Initialize the semaphore used to control access to the file descriptor - * list. - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Done OS Init, calling alt_sem_create.\r\n"); - ALT_SEM_CREATE (&alt_fd_list_lock, 1); - - /* Initialize the device drivers/software components. */ - ALT_LOG_PRINT_BOOT("[alt_main.c] Calling alt_sys_init.\r\n"); - alt_sys_init(); - ALT_LOG_PRINT_BOOT("[alt_main.c] Done alt_sys_init.\r\n"); - -#if !defined(ALT_USE_DIRECT_DRIVERS) && (defined(ALT_STDIN_PRESENT) || defined(ALT_STDOUT_PRESENT) || defined(ALT_STDERR_PRESENT)) - - /* - * Redirect stdio to the apropriate devices now that the devices have - * been initialized. This is only done if the user has requested these - * devices be present (not equal to /dev/null) and if direct drivers - * aren't being used. - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Redirecting IO.\r\n"); - alt_io_redirect(ALT_STDOUT, ALT_STDIN, ALT_STDERR); -#endif - -#ifndef ALT_NO_C_PLUS_PLUS - /* - * Call the C++ constructors - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Calling C++ constructors.\r\n"); - _do_ctors (); -#endif /* ALT_NO_C_PLUS_PLUS */ - -#if !defined(ALT_NO_C_PLUS_PLUS) && !defined(ALT_NO_CLEAN_EXIT) && !defined(ALT_NO_EXIT) - /* - * Set the C++ destructors to be called at system shutdown. This is only done - * if a clean exit has been requested (i.e. the exit() function has not been - * redefined as _exit()). This is in the interest of reducing code footprint, - * in that the atexit() overhead is removed when it's not needed. - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Calling atexit.\r\n"); - atexit (_do_dtors); -#endif - - /* - * Finally, call main(). The return code is then passed to a subsequent - * call to exit() unless the application is never supposed to exit. - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Calling main.\r\n"); - -#ifdef ALT_NO_EXIT - main (alt_argc, alt_argv, alt_envp); -#else - result = main (alt_argc, alt_argv, alt_envp); - close(STDOUT_FILENO); - exit (result); -#endif - - ALT_LOG_PRINT_BOOT("[alt_main.c] After main - we should not be here?.\r\n"); -} - diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_malloc_lock.c b/software/qsys_tutorial_bsp/HAL/src/alt_malloc_lock.c deleted file mode 100644 index 8c78f46..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_malloc_lock.c +++ /dev/null @@ -1,52 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -/* - * These are the empty malloc lock/unlock stubs required by newlib. These are - * used to make newlib's malloc() function thread safe. The default HAL - * configuration is single threaded, so there is nothing to do here. Note that - * this requires that malloc is never called by an interrupt service routine. - */ - -void __malloc_lock ( struct _reent *_r ) -{ -} - -/* - * - */ - -void __malloc_unlock ( struct _reent *_r ) -{ -} diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_mcount.S b/software/qsys_tutorial_bsp/HAL/src/alt_mcount.S deleted file mode 100644 index 3837523..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_mcount.S +++ /dev/null @@ -1,198 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2010 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* mcount or _mcount is inserted by GCC before the function prologue of every - * function when a program is compiled for profiling. At the start of mcount, - * we guarantee that: - * ra = self_pc (an address in the function which called mcount) - * r8 = from_pc (an address in the function which called mcount's caller) - * - * Because this is always called at the start of a function we can corrupt - * r2,r3 and r11-r15. We must not corrupt r4-r7 (because they might contain - * function arguments for the instrumented function) or r8 (which holds ra - * for the instrumented function). - */ - - .global __mcount_fn_head - - .global mcount - - /* _mcount is used by gcc4 */ - .global _mcount - -_mcount: -mcount: - /* Use a hash to speed up locating fn_entry. We use bits 5 upwards to choose - * the bucket because bits 1:0 will always be 0, and because the distribution - * of values for bits 4:2 won't be even (aligning on cache line boundaries - * will skew it). Higher bits should be fairly random. - */ - /* fn_head = mcount_fn_head + (((unsigned int)self_pc >> 5) & (HASH_BUCKETS - 1)); */ - - srli r2, ra, 3 - movhi r3, %hiadj(__mcount_fn_head) - addi r3, r3, %lo(__mcount_fn_head) - andi r2, r2, 0xFC - add r11, r2, r3 - - /* The fast case is where we have already allocated a function arc, and so - * also a function pointer. - */ - - /* First find the function being called (using self_pc) */ - mov r10, r11 -0: - ldw r10, 0(r10) - beq r10, zero, .Lnew_arc - ldw r2, 4(r10) - bne r2, ra, 0b - - /* Found a function entry for this PC. Now look for an arc with a matching - * from_pc value. There will always be at least one arc. */ - ldw r3, 8(r10) -0: - ldw r2, 4(r3) - beq r2, r8, .Lfound_arc - ldw r3, 0(r3) - bne r3, zero, 0b - -.Lnew_arc: - addi sp, sp, -24 - -.LCFI0: - stw ra, 0(sp) - stw r4, 4(sp) - stw r5, 8(sp) - stw r6, 12(sp) - stw r7, 16(sp) - stw r8, 20(sp) - -.LCFI1: - /* __mcount_record(orig_ra, orig_r8, fn_entry, *fn_head); */ - mov r4, ra - mov r5, r8 - mov r6, r10 - mov r7, r11 - call __mcount_record - - /* restore registers from the stack */ - ldw ra, 0(sp) - ldw r4, 4(sp) - ldw r5, 8(sp) - ldw r6, 12(sp) - ldw r7, 16(sp) - ldw r8, 20(sp) - - addi sp, sp, 24 - -.LCFI2: - ret - -.Lfound_arc: - /* We've found the correct arc record. Increment the count and return */ - ldw r2, 8(r3) - addi r2, r2, 1 - stw r2, 8(r3) - ret - -.Lmcount_end: - - - -/* - * Dwarf2 debug information for the function. This provides GDB with the - * information it needs to backtrace out of this function. - */ - - .section .debug_frame,"",@progbits -.LCIE: - .4byte 2f - 1f /* Length */ -1: - .4byte 0xffffffff /* CIE id */ - .byte 0x1 /* Version */ - .string "" /* Augmentation */ - .uleb128 0x1 /* Code alignment factor */ - .sleb128 -4 /* Data alignment factor */ - .byte 0x1f /* Return address register */ - - .byte 0xc /* Define CFA */ - .uleb128 0x1b /* Register 27 (sp) */ - .uleb128 0x0 /* Offset 0 */ - - .align 2 /* Padding */ -2: - -.LFDE_mcount: - .4byte 2f - 1f /* Length */ -1: - .4byte .LCIE /* Pointer to CIE */ - .4byte mcount /* Start of table entry */ - .4byte .Lmcount_end - mcount /* Size of table entry */ - - .byte 0x4 /* Advance location */ - .4byte .LCFI0 - mcount /* to .LCFI0 */ - .byte 0xe /* Define CFA offset */ - .uleb128 24 /* to 24 */ - - .byte 0x4 /* Advance location */ - .4byte .LCFI1 - .LCFI0 /* to .LCFI1 */ - .byte 0x9f /* Store ra */ - .uleb128 0x6 /* at CFA-24 */ - .byte 0x84 /* Store r4 */ - .uleb128 0x5 /* at CFA-20 */ - .byte 0x85 /* Store r5 */ - .uleb128 0x4 /* at CFA-16 */ - .byte 0x86 /* Store r6 */ - .uleb128 0x3 /* at CFA-12 */ - .byte 0x87 /* Store r7 */ - .uleb128 0x2 /* at CFA-8 */ - .byte 0x88 /* Store r8 */ - .uleb128 0x1 /* at CFA-4 */ - - .byte 0x4 /* Advance location */ - .4byte .LCFI2 - .LCFI1 /* to .LCFI2 */ - .byte 0xe /* Define CFA offset */ - .uleb128 0 /* to 0 */ - .byte 0x8 /* Same value */ - .uleb128 31 /* for ra */ - .byte 0x8 /* Same value */ - .uleb128 4 /* for r4 */ - .byte 0x8 /* Same value */ - .uleb128 5 /* for r5 */ - .byte 0x8 /* Same value */ - .uleb128 6 /* for r6 */ - .byte 0x8 /* Same value */ - .uleb128 7 /* for r7 */ - .byte 0x8 /* Same value */ - .uleb128 8 /* for r8 */ - - .align 2 -2: - diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_open.c b/software/qsys_tutorial_bsp/HAL/src/alt_open.c deleted file mode 100644 index 4790f53..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_open.c +++ /dev/null @@ -1,173 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "alt_types.h" -#include "os/alt_syscall.h" - -#ifdef ALT_USE_DIRECT_DRIVERS - -int ALT_OPEN (const char* file, int flags, int mode) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(open); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -extern alt_llist alt_dev_list; - -/* - * alt_file_locked() is used by open() to ensure that a device has not been - * previously locked for exclusive access using ioctl(). This test is only - * performed for devices. Filesystems are required to handle the ioctl() call - * themselves, and report the error from the filesystems open() function. - */ - -static int alt_file_locked (alt_fd* fd) -{ - alt_u32 i; - - /* - * Mark the file descriptor as belonging to a device. - */ - - fd->fd_flags |= ALT_FD_DEV; - - /* - * Loop through all current file descriptors searching for one that's locked - * for exclusive access. If a match is found, generate an error. - */ - - for (i = 0; i <= alt_max_fd; i++) - { - if ((alt_fd_list[i].dev == fd->dev) && - (alt_fd_list[i].fd_flags & ALT_FD_EXCL) && - (&alt_fd_list[i] != fd)) - { - return -EACCES; - } - } - - /* The device is not locked */ - - return 0; -} - -/* - * open() is called in order to get a file descriptor that reference the file - * or device named "name". This descriptor can then be used to manipulate the - * file/device using the standard system calls, e.g. write(), read(), ioctl() - * etc. - * - * This is equivalent to the standard open() system call. - * - * ALT_OPEN is mapped onto the open() system call in alt_syscall.h - */ - -int ALT_OPEN (const char* file, int flags, int mode) -{ - alt_dev* dev; - alt_fd* fd; - int index = -1; - int status = -ENODEV; - int isafs = 0; - - /* - * Check the device list, to see if a device with a matching name is - * registered. - */ - - if (!(dev = alt_find_dev (file, &alt_dev_list))) - { - /* No matching device, so try the filesystem list */ - - dev = alt_find_file (file); - isafs = 1; - } - - /* - * If a matching device or filesystem is found, allocate a file descriptor. - */ - - if (dev) - { - if ((index = alt_get_fd (dev)) < 0) - { - status = index; - } - else - { - fd = &alt_fd_list[index]; - fd->fd_flags = (flags & ~ALT_FD_FLAGS_MASK); - - /* If this is a device, ensure it isn't already locked */ - - if (isafs || ((status = alt_file_locked (fd)) >= 0)) - { - /* - * If the device or filesystem provides an open() callback function, - * call it now to perform any device/filesystem specific operations. - */ - - status = (dev->open) ? dev->open(fd, file, flags, mode): 0; - } - } - } - else - { - status = -ENODEV; - } - - /* Allocation failed, so clean up and return an error */ - - if (status < 0) - { - alt_release_fd (index); - ALT_ERRNO = -status; - return -1; - } - - /* return the reference upon success */ - - return index; -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_printf.c b/software/qsys_tutorial_bsp/HAL/src/alt_printf.c deleted file mode 100644 index e742b57..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_printf.c +++ /dev/null @@ -1,127 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/* - * This file provides a very minimal printf implementation for use with very - * small applications. Only the following format strings are supported: - * %x - * %s - * %c - * %% - */ - -#include -#include "sys/alt_stdio.h" - -/* - * ALT printf function - */ -void -alt_printf(const char* fmt, ... ) -{ - va_list args; - va_start(args, fmt); - const char *w; - char c; - - /* Process format string. */ - w = fmt; - while ((c = *w++) != 0) - { - /* If not a format escape character, just print */ - /* character. Otherwise, process format string. */ - if (c != '%') - { - alt_putchar(c); - } - else - { - /* Get format character. If none */ - /* available, processing is complete. */ - if ((c = *w++) != 0) - { - if (c == '%') - { - /* Process "%" escape sequence. */ - alt_putchar(c); - } - else if (c == 'c') - { - int v = va_arg(args, int); - alt_putchar(v); - } - else if (c == 'x') - { - /* Process hexadecimal number format. */ - unsigned long v = va_arg(args, unsigned long); - unsigned long digit; - int digit_shift; - - /* If the number value is zero, just print and continue. */ - if (v == 0) - { - alt_putchar('0'); - continue; - } - - /* Find first non-zero digit. */ - digit_shift = 28; - while (!(v & (0xF << digit_shift))) - digit_shift -= 4; - - /* Print digits. */ - for (; digit_shift >= 0; digit_shift -= 4) - { - digit = (v & (0xF << digit_shift)) >> digit_shift; - if (digit <= 9) - c = '0' + digit; - else - c = 'a' + digit - 10; - alt_putchar(c); - } - } - else if (c == 's') - { - /* Process string format. */ - char *s = va_arg(args, char *); - - while(*s) - alt_putchar(*s++); - } - } - else - { - break; - } - } - } -} diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_putchar.c b/software/qsys_tutorial_bsp/HAL/src/alt_putchar.c deleted file mode 100644 index badaa02..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_putchar.c +++ /dev/null @@ -1,59 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#ifdef ALT_USE_DIRECT_DRIVERS -#include "system.h" -#include "sys/alt_driver.h" -#include "sys/alt_stdio.h" -#endif - -/* - * Uses the ALT_DRIVER_WRITE() macro to call directly to driver if available. - * Otherwise, uses newlib provided putchar() routine. - */ -int -alt_putchar(int c) -{ -#ifdef ALT_USE_DIRECT_DRIVERS - ALT_DRIVER_WRITE_EXTERNS(ALT_STDOUT_DEV); - char c1 = (char)(c & 0xff); - - if (ALT_DRIVER_WRITE(ALT_STDOUT_DEV, &c1, 1, 0) == -1) { - return -1; - } - return c; -#else - return putchar(c); -#endif -} diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_putstr.c b/software/qsys_tutorial_bsp/HAL/src/alt_putstr.c deleted file mode 100644 index 5345945..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_putstr.c +++ /dev/null @@ -1,55 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#ifdef ALT_USE_DIRECT_DRIVERS -#include -#include "system.h" -#include "sys/alt_driver.h" -#include "sys/alt_stdio.h" -#endif - -/* - * Uses the ALT_DRIVER_WRITE() macro to call directly to driver if available. - * Otherwise, uses newlib provided fputs() routine. - */ -int -alt_putstr(const char* str) -{ -#ifdef ALT_USE_DIRECT_DRIVERS - ALT_DRIVER_WRITE_EXTERNS(ALT_STDOUT_DEV); - return ALT_DRIVER_WRITE(ALT_STDOUT_DEV, str, strlen(str), 0); -#else - return fputs(str, stdout); -#endif -} diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_read.c b/software/qsys_tutorial_bsp/HAL/src/alt_read.c deleted file mode 100644 index 1c89777..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_read.c +++ /dev/null @@ -1,125 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -/* - * The read() system call is used to read a block of data from a file or device. - * This function simply vectors the request to the device driver associated - * with the input file descriptor "file". - * - * ALT_READ is mapped onto the read() system call in alt_syscall.h - */ - -#ifdef ALT_USE_DIRECT_DRIVERS - -#include "system.h" -#include "sys/alt_driver.h" - -/* - * Provide minimal version that just reads from the stdin device when provided. - */ - -int ALT_READ (int file, void *ptr, size_t len) -{ -#ifdef ALT_STDIN_PRESENT - ALT_DRIVER_READ_EXTERNS(ALT_STDIN_DEV); -#endif - -#if !defined(ALT_STDIN_PRESENT) - /* Generate a link time warning, should this function ever be called. */ - ALT_STUB_WARNING(read); -#endif - - switch (file) { -#ifdef ALT_STDIN_PRESENT - case 0: /* stdin file descriptor */ - return ALT_DRIVER_READ(ALT_STDIN_DEV, ptr, len, 0); -#endif /* ALT_STDIN_PRESENT */ - default: - ALT_ERRNO = EBADFD; - return -1; - } -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -int ALT_READ (int file, void *ptr, size_t len) -{ - alt_fd* fd; - int rval; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - /* - * If the file has not been opened with read access, or if the driver does - * not provide an implementation of read(), generate an error. Otherwise - * call the drivers read() function to process the request. - */ - - if (((fd->fd_flags & O_ACCMODE) != O_WRONLY) && - (fd->dev->read)) - { - if ((rval = fd->dev->read(fd, ptr, len)) < 0) - { - ALT_ERRNO = -rval; - return -1; - } - return rval; - } - else - { - ALT_ERRNO = EACCES; - } - } - else - { - ALT_ERRNO = EBADFD; - } - return -1; -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_release_fd.c b/software/qsys_tutorial_bsp/HAL/src/alt_release_fd.c deleted file mode 100644 index 84733a7..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_release_fd.c +++ /dev/null @@ -1,54 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - -/* - * alt_release_fd() is called to free an allocated file descriptor. This is - * done by setting the device pointer in the file descriptor structure to zero. - * - * File descriptors correcponding to standard in, standard out and standard - * error cannont be released backed to the pool. They are always reserved. - */ - -void alt_release_fd (int fd) -{ - if (fd > 2) - { - alt_fd_list[fd].fd_flags = 0; - alt_fd_list[fd].dev = 0; - } -} - - - diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_remap_cached.c b/software/qsys_tutorial_bsp/HAL/src/alt_remap_cached.c deleted file mode 100644 index f61cb9c..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_remap_cached.c +++ /dev/null @@ -1,50 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003,2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "sys/alt_cache.h" -#include "system.h" - -#ifdef NIOS2_MMU_PRESENT -/* Convert KERNEL region address to IO region address */ -#define BYPASS_DCACHE_MASK (0x1 << 29) -#else -/* Set bit 31 of address to bypass D-cache */ -#define BYPASS_DCACHE_MASK (0x1 << 31) -#endif - -/* - * Convert a pointer to a block of uncached memory, into a block of - * cached memory. - */ - -void* alt_remap_cached (volatile void* ptr, alt_u32 len) -{ - return (void*) (((alt_u32) ptr) & ~BYPASS_DCACHE_MASK); -} diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_remap_uncached.c b/software/qsys_tutorial_bsp/HAL/src/alt_remap_uncached.c deleted file mode 100644 index 7ff6302..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_remap_uncached.c +++ /dev/null @@ -1,51 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003,2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "sys/alt_cache.h" -#include "system.h" - -#ifdef NIOS2_MMU_PRESENT -/* Convert KERNEL region address to IO region address */ -#define BYPASS_DCACHE_MASK (0x1 << 29) -#else -/* Set bit 31 of address to bypass D-cache */ -#define BYPASS_DCACHE_MASK (0x1 << 31) -#endif - -/* - * Convert a pointer to a block of cached memory, into a block of - * uncached memory. - */ - -volatile void* alt_remap_uncached (void* ptr, alt_u32 len) -{ - alt_dcache_flush (ptr, len); - return (volatile void*) (((alt_u32) ptr) | BYPASS_DCACHE_MASK); -} diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_rename.c b/software/qsys_tutorial_bsp/HAL/src/alt_rename.c deleted file mode 100644 index 48afac0..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_rename.c +++ /dev/null @@ -1,55 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "os/alt_syscall.h" - -/* - * _rename() is used by newlib to rename an existing file. This is unsupported - * in the HAL environment. However a "do-nothing" implementation is still - * provied for newlib compatability. - * - * ALT_RENAME is mapped onto the _rename() system call in alt_syscall.h - */ - -int ALT_RENAME (char *existing, char *new) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(_rename); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_sbrk.c b/software/qsys_tutorial_bsp/HAL/src/alt_sbrk.c deleted file mode 100644 index b8c3799..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_sbrk.c +++ /dev/null @@ -1,136 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "os/alt_syscall.h" - -#include "sys/alt_irq.h" -#include "sys/alt_stack.h" - -#include "system.h" - -/* - * sbrk() is called to dynamically extend the data segment for the application. - * Thie input argument "incr" is the size of the block to allocate. - * - * This simple implementation does not perform any bounds checking. Memory will - * be allocated, even if the request region colides with the stack or overflows - * the available physical memory. - * - * ALT_SBRK is mapped onto the sbrk() system call in alt_syscall.h - * - * This function is called by the profiling code to allocate memory so must be - * safe if called from an interrupt context. It must also not be instrumented - * because that would lead to an infinate loop. - */ - -extern char __alt_heap_start[]; /* set by linker */ -extern char __alt_heap_limit[]; /* set by linker */ - -static char *heap_end = __alt_heap_start; - -#if defined(ALT_EXCEPTION_STACK) && defined(ALT_STACK_CHECK) -char * alt_exception_old_stack_limit = NULL; -#endif - -caddr_t ALT_SBRK (int incr) __attribute__ ((no_instrument_function )); - -caddr_t ALT_SBRK (int incr) -{ - alt_irq_context context; - char *prev_heap_end; - - context = alt_irq_disable_all(); - - /* Always return data aligned on a word boundary */ - heap_end = (char *)(((unsigned int)heap_end + 3) & ~3); - -#ifdef ALT_MAX_HEAP_BYTES - /* - * User specified a maximum heap size. Return -1 if it would - * be exceeded by this sbrk call. - */ - if (((heap_end + incr) - __alt_heap_start) > ALT_MAX_HEAP_BYTES) { - alt_irq_enable_all(context); - return (caddr_t)-1; - } -#else - if ((heap_end + incr) > __alt_heap_limit) { - alt_irq_enable_all(context); - return (caddr_t)-1; - } -#endif - - prev_heap_end = heap_end; - heap_end += incr; - -#ifdef ALT_STACK_CHECK - /* - * If the stack and heap are contiguous then extending the heap reduces the - * space available for the stack. If we are still using the default stack - * then adjust the stack limit to note this, while checking for stack - * pointer overflow. - * If the stack limit isn't pointing at the top of the heap then the code - * is using a different stack so none of this needs to be done. - */ - - if (alt_stack_limit() == prev_heap_end) - { - if (alt_stack_pointer() <= heap_end) - alt_report_stack_overflow(); - - alt_set_stack_limit(heap_end); - } - -#ifdef ALT_EXCEPTION_STACK - /* - * If we are executing from the exception stack then compare against the - * stack we switched away from as well. The exception stack is a fixed - * size so doesn't need to be checked. - */ - - if (alt_exception_old_stack_limit == prev_heap_end) - { - if (alt_exception_old_stack_limit <= heap_end) - alt_report_stack_overflow(); - - alt_exception_old_stack_limit = heap_end; - } -#endif - -#endif - - alt_irq_enable_all(context); - - return (caddr_t) prev_heap_end; -} diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_settod.c b/software/qsys_tutorial_bsp/HAL/src/alt_settod.c deleted file mode 100644 index 59db0f8..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_settod.c +++ /dev/null @@ -1,96 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include "sys/alt_errno.h" -#include "sys/alt_alarm.h" -#include "os/alt_syscall.h" - -/* - * "alt_timezone" and "alt_resettime" are the values of the the reset time and - * time zone set through the last call to settimeofday(). By default they are - * zero initialised. - */ - -extern struct timezone alt_timezone; -extern struct timeval alt_resettime; - -/* - * Macro defining the number of micoseconds in a second. - */ - -#define ALT_US (1000000) - - -/* - * settimeofday() can be called to calibrate the system clock, so that - * subsequent calls to gettimeofday() will return the elapsed "wall clock" - * time. - * - * This is done by updating the global structures "alt_resettime" and - * "alt_timezone" so that an immediate call to gettimeofday() would return - * the value specified by "t" and "tz". - * - * Warning: if this function is called concurrently with a call to - * gettimeofday(), the value returned by gettimeofday() will be unreliable. - * - * ALT_SETTIMEOFDAY is mapped onto the settimeofday() system call in - * alt_syscall.h - */ - -int ALT_SETTIMEOFDAY (const struct timeval *t, - const struct timezone *tz) -{ - alt_u32 nticks = alt_nticks (); - alt_u32 tick_rate = alt_ticks_per_second (); - - /* If there is a system clock available, update the current time */ - - if (tick_rate) - { - alt_resettime.tv_sec = t->tv_sec - nticks/tick_rate; - alt_resettime.tv_usec = t->tv_usec - - ((nticks*(ALT_US/tick_rate))%ALT_US); - - alt_timezone.tz_minuteswest = tz->tz_minuteswest; - alt_timezone.tz_dsttime = tz->tz_dsttime; - - return 0; - } - - /* There's no system clock available */ - - ALT_ERRNO = ENOSYS; - return -1; -} diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_software_exception.S b/software/qsys_tutorial_bsp/HAL/src/alt_software_exception.S deleted file mode 100644 index 2142594..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_software_exception.S +++ /dev/null @@ -1,53 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - - /* - * This file provides the global symbol: software_exception. It is provided to - * support legacy code, and should not be used by new software. - * - * It is used by legacy code to invoke the software exception handler as - * defined by version 1.0 of the Nios II kit. It should only be used when you - * are providing your own interrupt entry point, i.e. you are not using - * alt_irq_entry. - */ - -#include "system.h" - - /* - * Pull in the exception handler. - */ - - .globl alt_exception - - .section .exceptions.entry.label, "xa" - - .globl software_exception - .type software_exception, @function -software_exception: diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_stat.c b/software/qsys_tutorial_bsp/HAL/src/alt_stat.c deleted file mode 100644 index 44e207b..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_stat.c +++ /dev/null @@ -1,59 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include -#include - -#include "os/alt_syscall.h" - -/* - * The stat() function is similar to the fstat() function in that it is used to - * obtain status information about a file. Instead of using an open file - * descriptor (like fstat()), stat() takes the name of a file as an input - * argument. - * - * ALT_STAT is mapped onto the stat() system call in alt_syscall.h - */ - -int ALT_STAT (const char *file, struct stat *st) -{ - int fd; - int rc; - - fd = open (file, 0); - rc = fstat (fd, st); - close (fd); - - return rc; -} diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_tick.c b/software/qsys_tutorial_bsp/HAL/src/alt_tick.c deleted file mode 100644 index c73488d..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_tick.c +++ /dev/null @@ -1,149 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_irq.h" -#include "sys/alt_alarm.h" -#include "os/alt_hooks.h" -#include "alt_types.h" - -/* - * "_alt_tick_rate" is used to store the value of the system clock frequency - * in ticks per second. It is initialised to zero, which corresponds to there - * being no system clock facility available. - */ - -alt_u32 _alt_tick_rate = 0; - -/* - * "_alt_nticks" is the number of system clock ticks that have elapsed since - * reset. - */ - -volatile alt_u32 _alt_nticks = 0; - -/* - * "alt_alarm_list" is the head of a linked list of registered alarms. This is - * initialised to be an empty list. - */ - -ALT_LLIST_HEAD(alt_alarm_list); - -/* - * alt_alarm_stop() is called to remove an alarm from the list of registered - * alarms. Alternatively an alarm can unregister itself by returning zero when - * the alarm executes. - */ - -void alt_alarm_stop (alt_alarm* alarm) -{ - alt_irq_context irq_context; - - irq_context = alt_irq_disable_all(); - alt_llist_remove (&alarm->llist); - alt_irq_enable_all (irq_context); -} - -/* - * alt_tick() is periodically called by the system clock driver in order to - * process the registered list of alarms. Each alarm is registed with a - * callback interval, and a callback function, "callback". - * - * The return value of the callback function indicates how many ticks are to - * elapse until the next callback. A return value of zero indicates that the - * alarm should be deactivated. - * - * alt_tick() is expected to run at interrupt level. - */ - -void alt_tick (void) -{ - alt_alarm* next; - alt_alarm* alarm = (alt_alarm*) alt_alarm_list.next; - - alt_u32 next_callback; - - /* update the tick counter */ - - _alt_nticks++; - - /* process the registered callbacks */ - - while (alarm != (alt_alarm*) &alt_alarm_list) - { - next = (alt_alarm*) alarm->llist.next; - - /* - * Upon the tick-counter rolling over it is safe to clear the - * roll-over flag; once the flag is cleared this (or subsequnt) - * tick events are enabled to generate an alarm event. - */ - if ((alarm->rollover) && (_alt_nticks == 0)) - { - alarm->rollover = 0; - } - - /* if the alarm period has expired, make the callback */ - if ((alarm->time <= _alt_nticks) && (alarm->rollover == 0)) - { - next_callback = alarm->callback (alarm->context); - - /* deactivate the alarm if the return value is zero */ - - if (next_callback == 0) - { - alt_alarm_stop (alarm); - } - else - { - alarm->time += next_callback; - - /* - * If the desired alarm time causes a roll-over, set the rollover - * flag. This will prevent the subsequent tick event from causing - * an alarm too early. - */ - if(alarm->time < _alt_nticks) - { - alarm->rollover = 1; - } - } - } - alarm = next; - } - - /* - * Update the operating system specific timer facilities. - */ - - ALT_OS_TIME_TICK(); -} - diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_times.c b/software/qsys_tutorial_bsp/HAL/src/alt_times.c deleted file mode 100644 index 4dd965d..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_times.c +++ /dev/null @@ -1,71 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "sys/alt_errno.h" -#include "sys/alt_alarm.h" -#include "os/alt_syscall.h" - -/* - * The times() function is used by newlib to obtain elapsed time information. - * The return value is the elapsed time since reset in system clock ticks. Note - * that this is distinct from the strict Posix version of times(), which should - * return the time since: 0 hours, 0 minutes, 0 seconds, January 1, 1970, GMT. - * - * The input structure is filled in with time accounting information. This - * implementation attributes all cpu time to the system. - * - * ALT_TIMES is mapped onto the times() system call in alt_syscall.h - */ - -clock_t ALT_TIMES (struct tms *buf) -{ - clock_t ticks = alt_nticks(); - - /* If there is no system clock present, generate an error */ - - if (!alt_ticks_per_second()) - { - ALT_ERRNO = ENOSYS; - return 0; - } - - /* Otherwise return the elapsed time */ - - buf->tms_utime = 0; - buf->tms_stime = ticks; - buf->tms_cutime = 0; - buf->tms_cstime = 0; - - return ticks; -} diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_uncached_free.c b/software/qsys_tutorial_bsp/HAL/src/alt_uncached_free.c deleted file mode 100644 index 6e362ba..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_uncached_free.c +++ /dev/null @@ -1,49 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003,2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "sys/alt_cache.h" -#include "system.h" - -#ifdef NIOS2_MMU_PRESENT -/* Convert KERNEL region address to IO region address */ -#define BYPASS_DCACHE_MASK (0x1 << 29) -#else -/* Set bit 31 of address to bypass D-cache */ -#define BYPASS_DCACHE_MASK (0x1 << 31) -#endif - -/* - * Free a block of uncached memory. - */ - -void alt_uncached_free (volatile void* ptr) -{ - free ((void*) (((alt_u32) ptr) & ~BYPASS_DCACHE_MASK)); -} diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_uncached_malloc.c b/software/qsys_tutorial_bsp/HAL/src/alt_uncached_malloc.c deleted file mode 100644 index ab3416d..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_uncached_malloc.c +++ /dev/null @@ -1,55 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003,2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "sys/alt_cache.h" -#include "system.h" - -#ifdef NIOS2_MMU_PRESENT -/* Convert KERNEL region address to IO region address */ -#define BYPASS_DCACHE_MASK (0x1 << 29) -#else -/* Set bit 31 of address to bypass D-cache */ -#define BYPASS_DCACHE_MASK (0x1 << 31) -#endif - -/* - * Allocate a block of uncached memory. - */ - -volatile void* alt_uncached_malloc (size_t size) -{ - void* ptr; - - ptr = malloc (size); - - alt_dcache_flush (ptr, size); - - return ptr ? (volatile void*) (((alt_u32) ptr) | BYPASS_DCACHE_MASK) : NULL; -} diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_unlink.c b/software/qsys_tutorial_bsp/HAL/src/alt_unlink.c deleted file mode 100644 index 29e35d6..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_unlink.c +++ /dev/null @@ -1,55 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "os/alt_syscall.h" - -/* - * unlink() is used by newlib to delete an existing link to a file. This is - * unsupported in the HAL environment. However a "do-nothing" implementation - * is still provied for newlib compatability. - * - * ALT_UNLINK is mapped onto the unlink() system call in alt_syscall.h - */ - -int ALT_UNLINK (char *name) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(unlink); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_usleep.c b/software/qsys_tutorial_bsp/HAL/src/alt_usleep.c deleted file mode 100644 index 2330eb8..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_usleep.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2003 Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - * - * ------------ - * - * Altera does not recommend, suggest or require that this reference design - * file be used in conjunction or combination with any other product. - * - * usleep.c - Microsecond delay routine - */ - -#include - -#include "priv/alt_busy_sleep.h" -#include "os/alt_syscall.h" - -/* - * This function simply calls alt_busy_sleep() to perform the delay. This - * function implements the delay as a calibrated "busy loop". - * - * ALT_USLEEP is mapped onto the usleep() system call in alt_syscall.h - */ - - - -#if defined (__GNUC__) && __GNUC__ >= 4 -int ALT_USLEEP (useconds_t us) -#else -unsigned int ALT_USLEEP (unsigned int us) -#endif -{ - return alt_busy_sleep(us); -} diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_wait.c b/software/qsys_tutorial_bsp/HAL/src/alt_wait.c deleted file mode 100644 index a42f80f..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_wait.c +++ /dev/null @@ -1,52 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_errno.h" -#include "os/alt_syscall.h" - -/* - * wait() is used by newlib to wait for all child processes to exit. Since the - * HAL does not support spawning child processes, this returns immediately as - * there can't be anythign to wait for. - * - * ALT_WAIT is mapped onto the wait() system call in alt_syscall.h - */ - -int ALT_WAIT (int *status) -{ - *status = 0; - - ALT_ERRNO = ECHILD; - - return -1; -} - diff --git a/software/qsys_tutorial_bsp/HAL/src/alt_write.c b/software/qsys_tutorial_bsp/HAL/src/alt_write.c deleted file mode 100644 index 51debb5..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/alt_write.c +++ /dev/null @@ -1,138 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -#include "sys/alt_log_printf.h" - -/* - * The write() system call is used to write a block of data to a file or - * device. This function simply vectors the request to the device driver - * associated with the input file descriptor "file". - * - * ALT_WRITE is mapped onto the write() system call in alt_syscall.h - */ - -#ifdef ALT_USE_DIRECT_DRIVERS - -#include "system.h" -#include "sys/alt_driver.h" - -/* - * Provide minimal version that just writes to the stdout/stderr devices - * when provided. - */ - -int ALT_WRITE (int file, const void *ptr, size_t len) -{ -#ifdef ALT_STDOUT_PRESENT - ALT_DRIVER_WRITE_EXTERNS(ALT_STDOUT_DEV); -#endif -#ifdef ALT_STDERR_PRESENT - ALT_DRIVER_WRITE_EXTERNS(ALT_STDERR_DEV); -#endif - -#if !defined(ALT_STDOUT_PRESENT) && !defined(ALT_STDERR_PRESENT) - /* Generate a link time warning, should this function ever be called. */ - ALT_STUB_WARNING(write); -#endif - - switch (file) { -#ifdef ALT_STDOUT_PRESENT - case 1: /* stdout file descriptor */ - return ALT_DRIVER_WRITE(ALT_STDOUT_DEV, ptr, len, 0); -#endif /* ALT_STDOUT_PRESENT */ -#ifdef ALT_STDERR_PRESENT - case 2: /* stderr file descriptor */ - return ALT_DRIVER_WRITE(ALT_STDERR_DEV, ptr, len, 0); -#endif /* ALT_STDERR_PRESENT */ - default: - ALT_ERRNO = EBADFD; - return -1; - } -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -int ALT_WRITE (int file, const void *ptr, size_t len) -{ - alt_fd* fd; - int rval; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - /* - * If the file has not been opened with write access, or if the driver does - * not provide an implementation of write(), generate an error. Otherwise - * call the drivers write() function to process the request. - */ - - if (((fd->fd_flags & O_ACCMODE) != O_RDONLY) && fd->dev->write) - { - - /* ALT_LOG - see altera_hal/HAL/inc/sys/alt_log_printf.h */ - ALT_LOG_WRITE_FUNCTION(ptr,len); - - if ((rval = fd->dev->write(fd, ptr, len)) < 0) - { - ALT_ERRNO = -rval; - return -1; - } - return rval; - } - else - { - ALT_ERRNO = EACCES; - } - } - else - { - ALT_ERRNO = EBADFD; - } - return -1; -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_bsp/HAL/src/altera_nios2_qsys_irq.c b/software/qsys_tutorial_bsp/HAL/src/altera_nios2_qsys_irq.c deleted file mode 100644 index c7a4f93..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/altera_nios2_qsys_irq.c +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2009 Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - * - * altera_nios2_irq.c - Support for Nios II internal interrupt controller. - * - */ - -#include "sys/alt_irq.h" -#include "altera_nios2_qsys_irq.h" - -/* - * To initialize the internal interrupt controller, just clear the IENABLE - * register so that all possible IRQs are disabled. - */ -void altera_nios2_qsys_irq_init(void) -{ - NIOS2_WRITE_IENABLE(0); -} diff --git a/software/qsys_tutorial_bsp/HAL/src/crt0.S b/software/qsys_tutorial_bsp/HAL/src/crt0.S deleted file mode 100644 index 582445d..0000000 --- a/software/qsys_tutorial_bsp/HAL/src/crt0.S +++ /dev/null @@ -1,456 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "system.h" -#include "nios2.h" - -/* Setup header files to work with assembler code. */ -#define ALT_ASM_SRC - -/* Debug logging facility */ -#include "sys/alt_log_printf.h" - -/*************************************************************************\ -| MACROS | -\*************************************************************************/ - -/* - * The new build tools explicitly define macros when alt_load() - * must be called. The define ALT_LOAD_EXPLICITLY_CONTROLLED tells us that - * those macros are controlling if alt_load() needs to be called. - */ -#ifdef ALT_LOAD_EXPLICITLY_CONTROLLED - -/* Need to call alt_load() if any of these sections are being copied. */ -#if defined(ALT_LOAD_COPY_RODATA) || defined(ALT_LOAD_COPY_RWDATA) || defined(ALT_LOAD_COPY_EXCEPTIONS) -#define CALL_ALT_LOAD -#endif - -#else /* !ALT_LOAD_EXPLICITLY_CONTROLLED */ - -/* - * The legacy build tools use the following macros to detect when alt_load() - * needs to be called. - */ - -#define __ALT_LOAD_SECTIONS(res, text, rodata, exc) \ - ((res##_BASE != rodata##_BASE) || \ - (res##_BASE != rwdata##_BASE) || \ - (res##_BASE != exc##_BASE)) - -#define _ALT_LOAD_SECTIONS(res, text, rodata, exc) \ - __ALT_LOAD_SECTIONS(res, text, rodata, exc) - -#define ALT_LOAD_SECTIONS _ALT_LOAD_SECTIONS(ALT_RESET_DEVICE, \ - ALT_RODATA_DEVICE, \ - ALT_RWDATA_DEVICE, \ - ALT_EXCEPTIONS_DEVICE) - -/* Call alt_load() if there is no bootloader and ALT_LOAD_SECTIONS isn't 0. */ -#if defined(ALT_NO_BOOTLOADER) && ALT_LOAD_SECTIONS -#define CALL_ALT_LOAD -#endif - -#endif /* !ALT_LOAD_EXPLICITLY_CONTROLLED */ - -/* - * When the legacy build tools define a macro called ALT_NO_BOOTLOADER, - * it indicates that initialization code is allowed at the reset address. - * The new build tools define a macro called ALT_ALLOW_CODE_AT_RESET for - * the same purpose. - */ -#ifdef ALT_NO_BOOTLOADER -#define ALT_ALLOW_CODE_AT_RESET -#endif - -/*************************************************************************\ -| EXTERNAL REFERENCES | -\*************************************************************************/ - -/* - * The entry point for user code is either "main" in hosted mode, or - * "alt_main" in standalone mode. These are explicitly referenced here, - * to ensure they are built into the executable. This allows the user - * to build them into libraries, rather than supplying them in object - * files at link time. - */ - .globl main - .globl alt_main - -/* - * Create a reference to the software multiply/divide and trap handers, - * so that if they are provided, they will appear in the executable. - */ -#ifndef ALT_NO_INSTRUCTION_EMULATION - .globl alt_exception_muldiv -#endif -#ifdef ALT_TRAP_HANDLER - .globl alt_exception_trap -#endif - -/* - * Linker defined symbols used to initialize bss. - */ -.globl __bss_start -.globl __bss_end - -/*************************************************************************\ -| RESET SECTION (.entry) | -\*************************************************************************/ - -/* - * This is the reset entry point for Nios II. - * - * At reset, only the cache line which contain the reset vector is - * initialized by the hardware. The code within the first cache line - * initializes the remainder of the instruction cache. - */ - - .section .entry, "xa" - .align 5 - -/* - * Explicitly allow the use of r1 (the assembler temporary register) - * within this code. This register is normally reserved for the use of - * the assembler. - */ - .set noat - -/* - * Some tools want to know where the reset vector is. - * Code isn't always provided at the reset vector but at least the - * __reset label always contains the reset vector address because - * it is defined at the start of the .entry section. - */ - - .globl __reset - .type __reset, @function -__reset: - -/* - * Initialize the instruction cache if present (i.e. size > 0) and - * reset code is allowed unless optimizing for RTL simulation. - * RTL simulations can ensure the instruction cache is already initialized - * so skipping this loop speeds up RTL simulation. - */ - -#if NIOS2_ICACHE_SIZE > 0 && defined(ALT_ALLOW_CODE_AT_RESET) && !defined(ALT_SIM_OPTIMIZE) - /* Assume the instruction cache size is always a power of two. */ -#if NIOS2_ICACHE_SIZE > 0x8000 - movhi r2, %hi(NIOS2_ICACHE_SIZE) -#else - movui r2, NIOS2_ICACHE_SIZE -#endif - -0: - initi r2 - addi r2, r2, -NIOS2_ICACHE_LINE_SIZE - bgt r2, zero, 0b -1: - - /* - * The following debug information tells the ISS not to run the loop above - * but to perform its actions using faster internal code. - */ - .pushsection .debug_alt_sim_info - .int 1, 1, 0b, 1b - .popsection -#endif /* Initialize Instruction Cache */ - -/* - * Jump to the _start entry point in the .text section if reset code - * is allowed or if optimizing for RTL simulation. - */ -#if defined(ALT_ALLOW_CODE_AT_RESET) || defined(ALT_SIM_OPTIMIZE) - /* Jump to the _start entry point in the .text section. */ - movhi r1, %hi(_start) - ori r1, r1, %lo(_start) - jmp r1 - - .size __reset, . - __reset -#endif /* Jump to _start */ - -/* - * When not using exit, provide an _exit symbol to prevent unresolved - * references to _exit from the linker script. - */ -#ifdef ALT_NO_EXIT - .globl _exit -_exit: -#endif - -/*************************************************************************\ -| TEXT SECTION (.text) | -\*************************************************************************/ - -/* - * Start of the .text section, and also the code entry point when - * the code is executed by a bootloader rather than directly from reset. - */ - .section .text - .align 2 - - .globl _start - .type _start, @function -_start: - -/* - * Initialize the data cache if present (i.e. size > 0) and not - * optimizing for RTL simulation. - * RTL simulations can ensure the data cache is already initialized - * so skipping this loop speeds up RTL simulation. - */ - -#if NIOS2_DCACHE_SIZE > 0 && !defined(ALT_SIM_OPTIMIZE) - - /* Assume the data cache size is always a power of two. */ -#if NIOS2_DCACHE_SIZE > 0x8000 - movhi r2, %hi(NIOS2_DCACHE_SIZE) -#else - movui r2, NIOS2_DCACHE_SIZE -#endif - -0: - initd 0(r2) - addi r2, r2, -NIOS2_DCACHE_LINE_SIZE - bgt r2, zero, 0b -1: - - /* - * The following debug information tells the ISS not to run the loop above - * but to perform its actions using faster internal code. - */ - .pushsection .debug_alt_sim_info - .int 2, 1, 0b, 1b - .popsection - -#endif /* Initialize Data Cache */ - - /* Log that caches have been initialized. */ - ALT_LOG_PUTS(alt_log_msg_cache) - - /* Log that the stack pointer is about to be setup. */ - ALT_LOG_PUTS(alt_log_msg_stackpointer) - -#if (NIOS2_NUM_OF_SHADOW_REG_SETS == 0) - /* - * Now that the caches are initialized, set up the stack pointer. - * The value provided by the linker is assumed to be correctly aligned. - */ - movhi sp, %hi(__alt_stack_pointer) - ori sp, sp, %lo(__alt_stack_pointer) - - /* Set up the global pointer. */ - movhi gp, %hi(_gp) - ori gp, gp, %lo(_gp) - -#else /* NIOS2_NUM_OF_SHADOW_REG_SETS > 0 */ - - /* - * Set up the GP and SP in all shadow register sets. - */ - - /* - * Check current register set number, if CPU resets into a shadow register - * set, switch register set to 0 by writing zero to SSTATUS register and - * execute an ERET instruction that just jumps to the next PC address - * (use the NEXTPC instruction to get this). - */ - - rdctl r2, status - - /* Get the current register set number (STATUS.CRS). */ - andi r3, r2, NIOS2_STATUS_CRS_MSK - - /* Skip switch register set if STATUS.CRS is 0. */ - beq r3, zero, .Lskip_switch_reg_set - - .set nobreak - - /* Current register set is non-zero, set SSTATUS to 0. */ - mov sstatus, zero - - /* Get next pc and store in ea. */ - nextpc ea - - /* Point to instruction after eret. */ - addi ea, ea, 8 - - /* - * Execute ERET instruction that just jumps to the next PC address - */ - eret - -.Lskip_switch_reg_set: - mov r2, zero - - /* Reset STATUS register */ - wrctl status, r2 - - movui r3, NIOS2_NUM_OF_SHADOW_REG_SETS - - /* Set up the stack pointer in register set 0. */ - movhi sp, %hi(__alt_stack_pointer) - ori sp, sp, %lo(__alt_stack_pointer) - - /* Set up the global pointer in register set 0. */ - movhi gp, %hi(_gp) - ori gp, gp, %lo(_gp) - -.Lsetup_sp_and_gp_loop: - /* - * Setup GP and SP for shadow register set - * from NIOS2_NUM_OF_SHADOW_REG_SETS to 0 - */ - - /* Skip if number of register sets is 0. */ - beq r3, zero, .Lno_shadow_register_set - - - /* Add previous register set STATUS.PRS by 1 */ - movhi r4, 1 - add r2, r2, r4 - - /* Write STATUS */ - wrctl status, r2 - - /* Clear r0 in the shadow register set (not done by hardware) */ - wrprs r0, r0 - - /* Write the GP in previous register set */ - wrprs gp, gp - - /* Only write the SP in previous register set - * if using the seperate exception stack. For normal case (single stack), - * funnel code would read the SP from previous register set. - */ -#ifdef ALT_INTERRUPT_STACK - - movhi et, %hiadj(__alt_interrupt_stack_pointer) - addi et, et, %lo(__alt_interrupt_stack_pointer) - wrprs sp, et - -#endif /* ALT_INTERRUPT_STACK */ - - /* Decrease number of register set counter by 1 */ - addi r3, r3, -1 - - br .Lsetup_sp_and_gp_loop -.Lno_shadow_register_set: - -#endif /* NIOS2_NUM_OF_SHADOW_REG_SETS */ -/* - * Clear the BSS if not optimizing for RTL simulation. - * - * This uses the symbols: __bss_start and __bss_end, which are defined - * by the linker script. They mark the begining and the end of the bss - * region. The linker script guarantees that these values are word aligned. - */ -#ifndef ALT_SIM_OPTIMIZE - /* Log that the BSS is about to be cleared. */ - ALT_LOG_PUTS(alt_log_msg_bss) - - movhi r2, %hi(__bss_start) - ori r2, r2, %lo(__bss_start) - - movhi r3, %hi(__bss_end) - ori r3, r3, %lo(__bss_end) - - beq r2, r3, 1f - -0: - stw zero, (r2) - addi r2, r2, 4 - bltu r2, r3, 0b - -1: - - /* - * The following debug information tells the ISS not to run the loop above - * but to perform its actions using faster internal code. - */ - .pushsection .debug_alt_sim_info - .int 3, 1, 0b, 1b - .popsection -#endif /* ALT_SIM_OPTIMIZE */ - -/* - * The alt_load() facility is normally used when there is no bootloader. - * It copies some sections into RAM so it acts like a mini-bootloader. - */ -#ifdef CALL_ALT_LOAD - -#ifdef ALT_STACK_CHECK - /* - * If the user has selected stack checking then we need to set up a safe - * value in the stack limit register so that the relocation functions - * don't think the stack has overflowed (the contents of the rwdata - * section aren't defined until alt_load() has been called). - */ - mov et, zero -#endif - - call alt_load - -#endif /* CALL_ALT_LOAD */ - -#ifdef ALT_STACK_CHECK - /* - * Set up the stack limit (if required). The linker has set up the - * copy of the variable which is in memory. - */ - - ldw et, %gprel(alt_stack_limit_value)(gp) -#endif - - /* Log that alt_main is about to be called. */ - ALT_LOG_PUTS(alt_log_msg_alt_main) - - /* Call the C entry point. It should never return. */ - call alt_main - - /* Wait in infinite loop in case alt_main does return. */ -alt_after_alt_main: - br alt_after_alt_main - - .size _start, . - _start - -/* - * Add information about the stack base if stack overflow checking is enabled. - */ -#ifdef ALT_STACK_CHECK - .globl alt_stack_limit_value - .section .sdata,"aws",@progbits - .align 2 - .type alt_stack_limit_value, @object - .size alt_stack_limit_value, 4 -alt_stack_limit_value: - .long __alt_stack_limit -#endif diff --git a/software/qsys_tutorial_bsp/Makefile b/software/qsys_tutorial_bsp/Makefile deleted file mode 100644 index d170a1f..0000000 --- a/software/qsys_tutorial_bsp/Makefile +++ /dev/null @@ -1,766 +0,0 @@ -#------------------------------------------------------------------------------ -# BSP MAKEFILE -# -# This makefile was automatically generated by the nios2-bsp-generate-files -# command. Its purpose is to build a custom Board Support Package (BSP) -# targeting a specific Nios II processor in an SOPC Builder-based design. -# -# To create an application or library Makefile which uses this BSP, try the -# nios2-app-generate-makefile or nios2-lib-generate-makefile commands. -#------------------------------------------------------------------------------ - -#------------------------------------------------------------------------------ -# TOOLS -#------------------------------------------------------------------------------ - -MKDIR := mkdir -p -ECHO := echo -SPACE := $(empty) $(empty) - -#------------------------------------------------------------------------------ -# The adjust-path macro -# -# If COMSPEC is defined, Make is launched from Windows through -# Cygwin. This adjust-path macro will call 'cygpath -u' on all -# paths to ensure they are readable by Make. -# -# If COMSPEC is not defined, Make is launched from *nix, and no adjustment -# is necessary -#------------------------------------------------------------------------------ - -ifndef COMSPEC -ifdef ComSpec -COMSPEC = $(ComSpec) -endif # ComSpec -endif # !COMSPEC - -ifdef COMSPEC - adjust-path = $(subst $(SPACE),\$(SPACE),$(shell cygpath -u "$1")) - adjust-path-mixed = $(subst $(SPACE),\$(SPACE),$(shell cygpath -m "$1")) -else - adjust-path = $(subst $(SPACE),\$(SPACE),$1) - adjust-path-mixed = $(subst $(SPACE),\$(SPACE),$1) -endif - -#------------------------------------------------------------------------------ -# DEFAULT TARGET -# -# The default target, "all", must appear before any other target in the -# Makefile. Note that extra prerequisites are added to the "all" rule later. -#------------------------------------------------------------------------------ -.PHONY: all -all: - @$(ECHO) [BSP build complete] - - -#------------------------------------------------------------------------------ -# PATHS & DIRECTORY NAMES -# -# Explicitly locate absolute path of the BSP root -#------------------------------------------------------------------------------ - -BSP_ROOT_DIR := . - -# Define absolute path to the root of the BSP. -ABS_BSP_ROOT := $(call adjust-path-mixed,$(shell pwd)) - -# Stash all BSP object files here -OBJ_DIR := ./obj - -NEWLIB_DIR = $(BSP_ROOT_DIR)/newlib - - -#------------------------------------------------------------------------------ -# MANAGED CONTENT -# -# All content between the lines "START MANAGED" and "END MANAGED" below is -# generated based on variables in the BSP settings file when the -# nios2-bsp-generate-files command is invoked. If you wish to persist any -# information pertaining to the build process, it is recomended that you -# utilize the BSP settings mechanism to do so. -# -# Note that most variable assignments in this section have a corresponding BSP -# setting that can be changed by using the nios2-bsp-create-settings or -# nios2-bsp-update-settings command before nios2-bsp-generate-files; if you -# want any variable set to a specific value when this Makefile is re-generated -# (to prevent hand-edits from being over-written), use the BSP settings -# facilities above. -#------------------------------------------------------------------------------ - -#START MANAGED - -# The following TYPE comment allows tools to identify the 'type' of target this -# makefile is associated with. -# TYPE: BSP_PRIVATE_MAKEFILE - -# This following VERSION comment indicates the version of the tool used to -# generate this makefile. A makefile variable is provided for VERSION as well. -# ACDS_VERSION: 13.0sp1 -ACDS_VERSION := 13.0sp1 - -# This following BUILD_NUMBER comment indicates the build number of the tool -# used to generate this makefile. -# BUILD_NUMBER: 232 - -SETTINGS_FILE := settings.bsp -SOPC_FILE := C:/Users/takayun/Desktop/qsys_tutorial/nios_system.sopcinfo - -#------------------------------------------------------------------------------- -# TOOL & COMMAND DEFINITIONS -# -# The base command for each build operation are expressed here. Additional -# switches may be expressed here. They will run for all instances of the -# utility. -#------------------------------------------------------------------------------- - -# Archiver command. Creates library files. -AR = nios2-elf-ar - -# Assembler command. Note that CC is used for .S files. -AS = nios2-elf-gcc - -# Custom flags only passed to the archiver. This content of this variable is -# directly passed to the archiver rather than the more standard "ARFLAGS". The -# reason for this is that GNU Make assumes some default content in ARFLAGS. -# This setting defines the value of BSP_ARFLAGS in Makefile. -BSP_ARFLAGS = -src - -# Custom flags only passed to the assembler. This setting defines the value of -# BSP_ASFLAGS in Makefile. -BSP_ASFLAGS = -Wa,-gdwarf2 - -# C/C++ compiler debug level. '-g' provides the default set of debug symbols -# typically required to debug a typical application. Omitting '-g' removes -# debug symbols from the ELF. This setting defines the value of -# BSP_CFLAGS_DEBUG in Makefile. -BSP_CFLAGS_DEBUG = -g - -# C/C++ compiler optimization level. "-O0" = no optimization,"-O2" = "normal" -# optimization, etc. "-O0" is recommended for code that you want to debug since -# compiler optimization can remove variables and produce non-sequential -# execution of code while debugging. This setting defines the value of -# BSP_CFLAGS_OPTIMIZATION in Makefile. -BSP_CFLAGS_OPTIMIZATION = -O0 - -# C/C++ compiler warning level. "-Wall" is commonly used.This setting defines -# the value of BSP_CFLAGS_WARNINGS in Makefile. -BSP_CFLAGS_WARNINGS = -Wall - -# C compiler command. -CC = nios2-elf-gcc -xc - -# C++ compiler command. -CXX = nios2-elf-gcc -xc++ - -# Command used to remove files during 'clean' target. -RM = rm -f - - -#------------------------------------------------------------------------------- -# BUILD PRE & POST PROCESS COMMANDS -# -# The following variables are treated as shell commands in the rule -# definitions for each file-type associated with the BSP build, as well as -# commands run at the beginning and end of the entire BSP build operation. -# Pre-process commands are executed before the relevant command (for example, -# a command defined in the "CC_PRE_PROCESS" variable executes before the C -# compiler for building .c files), while post-process commands are executed -# immediately afterwards. -# -# You can view each pre/post-process command in the "Build Rules: All & -# Clean", "Pattern Rules to Build Objects", and "Library Rules" sections of -# this Makefile. -#------------------------------------------------------------------------------- - - -#------------------------------------------------------------------------------- -# BSP SOURCE BUILD SETTINGS (FLAG GENERATION) -# -# Software build settings such as compiler optimization, debug level, warning -# flags, etc., may be defined in the following variables. The variables below -# are concatenated together in the 'Flags' section of this Makefile to form -# final variables of flags passed to the build tools. -# -# These settings are considered private to the BSP and apply to all library & -# driver files in it; they do NOT automatically propagate to, for example, the -# build settings for an application. -# # For additional detail and syntax requirements, please refer to GCC help -# (example: "nios2-elf-gcc --help --verbose"). -# -# Unless indicated otherwise, multiple entries in each variable should be -# space-separated. -#------------------------------------------------------------------------------- - -# Altera HAL alt_sys_init.c generated source file -GENERATED_C_FILES := $(ABS_BSP_ROOT)/alt_sys_init.c -GENERATED_C_LIB_SRCS += alt_sys_init.c - - -#------------------------------------------------------------------------------- -# BSP SOURCE FILE LISTING -# -# All source files that comprise the BSP are listed here, along with path -# information to each file expressed relative to the BSP root. The precise -# list and location of each file is derived from the driver, operating system, -# or software package source file declarations. -# -# Following specification of the source files for each component, driver, etc., -# each source file type (C, assembly, etc.) is concatenated together and used -# to construct a list of objects. Pattern rules to build each object are then -# used to build each file. -#------------------------------------------------------------------------------- - -# altera_avalon_jtag_uart_driver sources root -altera_avalon_jtag_uart_driver_SRCS_ROOT := drivers - -# altera_avalon_jtag_uart_driver sources -altera_avalon_jtag_uart_driver_C_LIB_SRCS := \ - $(altera_avalon_jtag_uart_driver_SRCS_ROOT)/src/altera_avalon_jtag_uart_init.c \ - $(altera_avalon_jtag_uart_driver_SRCS_ROOT)/src/altera_avalon_jtag_uart_read.c \ - $(altera_avalon_jtag_uart_driver_SRCS_ROOT)/src/altera_avalon_jtag_uart_write.c \ - $(altera_avalon_jtag_uart_driver_SRCS_ROOT)/src/altera_avalon_jtag_uart_ioctl.c \ - $(altera_avalon_jtag_uart_driver_SRCS_ROOT)/src/altera_avalon_jtag_uart_fd.c - -# altera_avalon_pio_driver sources root -altera_avalon_pio_driver_SRCS_ROOT := drivers - -# altera_avalon_pio_driver sources -# altera_nios2_qsys_hal_driver sources root -altera_nios2_qsys_hal_driver_SRCS_ROOT := HAL - -# altera_nios2_qsys_hal_driver sources -altera_nios2_qsys_hal_driver_C_LIB_SRCS := \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/altera_nios2_qsys_irq.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_usleep.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_busy_sleep.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_irq_vars.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_icache_flush.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_icache_flush_all.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_dcache_flush.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_dcache_flush_all.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_dcache_flush_no_writeback.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_instruction_exception_entry.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_irq_register.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_iic.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_remap_cached.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_remap_uncached.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_uncached_free.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_uncached_malloc.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_do_ctors.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_do_dtors.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_gmon.c - -altera_nios2_qsys_hal_driver_ASM_LIB_SRCS := \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_exception_entry.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_exception_trap.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_exception_muldiv.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_irq_entry.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_software_exception.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_mcount.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_log_macro.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/crt0.S - -# hal sources root -hal_SRCS_ROOT := HAL - -# hal sources -hal_C_LIB_SRCS := \ - $(hal_SRCS_ROOT)/src/alt_alarm_start.c \ - $(hal_SRCS_ROOT)/src/alt_close.c \ - $(hal_SRCS_ROOT)/src/alt_dev.c \ - $(hal_SRCS_ROOT)/src/alt_dev_llist_insert.c \ - $(hal_SRCS_ROOT)/src/alt_dma_rxchan_open.c \ - $(hal_SRCS_ROOT)/src/alt_dma_txchan_open.c \ - $(hal_SRCS_ROOT)/src/alt_environ.c \ - $(hal_SRCS_ROOT)/src/alt_env_lock.c \ - $(hal_SRCS_ROOT)/src/alt_errno.c \ - $(hal_SRCS_ROOT)/src/alt_execve.c \ - $(hal_SRCS_ROOT)/src/alt_exit.c \ - $(hal_SRCS_ROOT)/src/alt_fcntl.c \ - $(hal_SRCS_ROOT)/src/alt_fd_lock.c \ - $(hal_SRCS_ROOT)/src/alt_fd_unlock.c \ - $(hal_SRCS_ROOT)/src/alt_find_dev.c \ - $(hal_SRCS_ROOT)/src/alt_find_file.c \ - $(hal_SRCS_ROOT)/src/alt_flash_dev.c \ - $(hal_SRCS_ROOT)/src/alt_fork.c \ - $(hal_SRCS_ROOT)/src/alt_fs_reg.c \ - $(hal_SRCS_ROOT)/src/alt_fstat.c \ - $(hal_SRCS_ROOT)/src/alt_get_fd.c \ - $(hal_SRCS_ROOT)/src/alt_getchar.c \ - $(hal_SRCS_ROOT)/src/alt_getpid.c \ - $(hal_SRCS_ROOT)/src/alt_gettod.c \ - $(hal_SRCS_ROOT)/src/alt_iic_isr_register.c \ - $(hal_SRCS_ROOT)/src/alt_instruction_exception_register.c \ - $(hal_SRCS_ROOT)/src/alt_ioctl.c \ - $(hal_SRCS_ROOT)/src/alt_io_redirect.c \ - $(hal_SRCS_ROOT)/src/alt_irq_handler.c \ - $(hal_SRCS_ROOT)/src/alt_isatty.c \ - $(hal_SRCS_ROOT)/src/alt_kill.c \ - $(hal_SRCS_ROOT)/src/alt_link.c \ - $(hal_SRCS_ROOT)/src/alt_load.c \ - $(hal_SRCS_ROOT)/src/alt_log_printf.c \ - $(hal_SRCS_ROOT)/src/alt_lseek.c \ - $(hal_SRCS_ROOT)/src/alt_main.c \ - $(hal_SRCS_ROOT)/src/alt_malloc_lock.c \ - $(hal_SRCS_ROOT)/src/alt_open.c \ - $(hal_SRCS_ROOT)/src/alt_printf.c \ - $(hal_SRCS_ROOT)/src/alt_putchar.c \ - $(hal_SRCS_ROOT)/src/alt_putstr.c \ - $(hal_SRCS_ROOT)/src/alt_read.c \ - $(hal_SRCS_ROOT)/src/alt_release_fd.c \ - $(hal_SRCS_ROOT)/src/alt_rename.c \ - $(hal_SRCS_ROOT)/src/alt_sbrk.c \ - $(hal_SRCS_ROOT)/src/alt_settod.c \ - $(hal_SRCS_ROOT)/src/alt_stat.c \ - $(hal_SRCS_ROOT)/src/alt_tick.c \ - $(hal_SRCS_ROOT)/src/alt_times.c \ - $(hal_SRCS_ROOT)/src/alt_unlink.c \ - $(hal_SRCS_ROOT)/src/alt_wait.c \ - $(hal_SRCS_ROOT)/src/alt_write.c - - -# Assemble all component C source files -COMPONENT_C_LIB_SRCS += \ - $(altera_avalon_jtag_uart_driver_C_LIB_SRCS) \ - $(altera_nios2_qsys_hal_driver_C_LIB_SRCS) \ - $(hal_C_LIB_SRCS) - -# Assemble all component assembly source files -COMPONENT_ASM_LIB_SRCS += \ - $(altera_nios2_qsys_hal_driver_ASM_LIB_SRCS) - -# Assemble all component C++ source files -COMPONENT_CPP_LIB_SRCS += \ - -#END MANAGED - -#------------------------------------------------------------------------------ -# PUBLIC.MK -# -# The generated public.mk file contains BSP information that is shared with -# other external makefiles, such as a Nios II application makefile. System- -# dependent information such as hardware-specific compiler flags and -# simulation file generation are stored here. -# -# In addition, public.mk contains include paths that various software, -# such as a device driver, may need for the C compiler. These paths are -# written to public.mk with respect to the BSP root. In public.mk, each -# path is prefixed with a special variable, $(ALT_LIBRARY_ROOT_DIR). The -# purpose of this variable is to allow an external Makefile to append on -# path information to precisely locate paths expressed in public.mk -# Since this is the BSP Makefile, we set ALT_LIBRARY_ROOT_DIR to point right -# here ("."), at the BSP root. -# -# ALT_LIBRARY_ROOT_DIR must always be set before public.mk is included. -#------------------------------------------------------------------------------ -ALT_LIBRARY_ROOT_DIR := . -include public.mk - - -#------------------------------------------------------------------------------ -# FLAGS -# -# Include paths for BSP files are written into the public.mk file and must -# be added to the existing list of pre-processor flags. In addition, "hooks" -# for standard flags left intentionally empty (CFLAGS, CPPFLAGS, ASFLAGS, -# and CXXFLAGS) are provided for conveniently adding to the relevant flags -# on the command-line or via script that calls make. -#------------------------------------------------------------------------------ -# Assemble final list of compiler flags from generated content -BSP_CFLAGS += \ - $(BSP_CFLAGS_DEFINED_SYMBOLS) \ - $(BSP_CFLAGS_UNDEFINED_SYMBOLS) \ - $(BSP_CFLAGS_OPTIMIZATION) \ - $(BSP_CFLAGS_DEBUG) \ - $(BSP_CFLAGS_WARNINGS) \ - $(BSP_CFLAGS_USER_FLAGS) \ - $(ALT_CFLAGS) \ - $(CFLAGS) - -# Make ready the final list of include directories and other C pre-processor -# flags. Each include path is made ready by prefixing it with "-I". -BSP_CPPFLAGS += \ - $(addprefix -I, $(BSP_INC_DIRS)) \ - $(addprefix -I, $(ALT_INCLUDE_DIRS)) \ - $(ALT_CPPFLAGS) \ - $(CPPFLAGS) - -# Finish off assembler flags with any user-provided flags -BSP_ASFLAGS += $(ASFLAGS) - -# Finish off C++ flags with any user-provided flags -BSP_CXXFLAGS += $(CXXFLAGS) - -# And finally, the ordered list -C_SRCS += $(GENERATED_C_LIB_SRCS) \ - $(COMPONENT_C_LIB_SRCS) - -CXX_SRCS += $(GENERATED_CPP_LIB_SRCS) \ - $(COMPONENT_CPP_LIB_SRCS) - -ASM_SRCS += $(GENERATED_ASM_LIB_SRCS) \ - $(COMPONENT_ASM_LIB_SRCS) - - -#------------------------------------------------------------------------------ -# LIST OF GENERATED FILES -# -# A Nios II BSP relies on the generation of several source files used -# by both the BSP and any applications referencing the BSP. -#------------------------------------------------------------------------------ - - -GENERATED_H_FILES := $(ABS_BSP_ROOT)/system.h - -GENERATED_LINKER_SCRIPT := $(ABS_BSP_ROOT)/linker.x - -GENERATED_FILES += $(GENERATED_H_FILES) \ - $(GENERATED_LINKER_SCRIPT) - - -#------------------------------------------------------------------------------ -# SETUP TO BUILD OBJECTS -# -# List of object files which are to be built. This is constructed from the input -# list of C source files (C_SRCS), C++ source files (CXX_SRCS), and assembler -# source file (ASM_SRCS). The permitted file extensions are: -# -# .c .C - for C files -# .cxx .cc .cpp .CXX .CC .CPP - for C++ files -# .S .s - for assembly files -# -# Extended description: The list of objects is a sorted list (duplicates -# removed) of all possible objects, placed beneath the ./obj directory, -# including any path information stored in the "*_SRCS" variable. The -# "patsubst" commands are used to concatenate together multiple file suffix -# types for common files (i.e. c++ as .cxx, .cc, .cpp). -# -# File extensions are case-insensitive in build rules with the exception of -# assembly sources. Nios II assembly sources with the ".S" extension are first -# run through the C preprocessor. Sources with the ".s" extension are not. -#------------------------------------------------------------------------------ -OBJS = $(sort $(addprefix $(OBJ_DIR)/, \ - $(patsubst %.c, %.o, $(patsubst %.C, %.o, $(C_SRCS))) \ - $(patsubst %.cxx, %.o, $(patsubst %.CXX, %.o, \ - $(patsubst %.cc, %.o, $(patsubst %.CC, %.o, \ - $(patsubst %.cpp, %.o, $(patsubst %.CPP, %.o, \ - $(CXX_SRCS) )))))) \ - $(patsubst %.S, %.o, $(patsubst %.s, %.o, $(ASM_SRCS))) )) - -# List of dependancy files for each object file. -DEPS = $(OBJS:.o=.d) - - -# Rules to force your project to rebuild or relink -# .force_relink file will cause any application that depends on this project to relink -# .force_rebuild file will cause this project to rebuild object files -# .force_rebuild_all file will cause this project and any project that depends on this project to rebuild object files - -FORCE_RELINK_DEP := .force_relink -FORCE_REBUILD_DEP := .force_rebuild -FORCE_REBUILD_ALL_DEP := .force_rebuild_all -FORCE_REBUILD_DEP_LIST := $(FORCE_RELINK_DEP) $(FORCE_REBUILD_DEP) $(FORCE_REBUILD_ALL_DEP) - -$(FORCE_REBUILD_DEP_LIST): - -$(OBJS): $(wildcard $(FORCE_REBUILD_DEP)) $(wildcard $(FORCE_REBUILD_ALL_DEP)) - - -#------------------------------------------------------------------------------ -# BUILD RULES: ALL & CLEAN -#------------------------------------------------------------------------------ -.DELETE_ON_ERROR: - -.PHONY: all -all: build_pre_process -all: Makefile $(GENERATED_FILES) $(BSP_LIB) $(NEWLIB_DIR) -all: build_post_process - - -# clean: remove .o/.a/.d -.PHONY: clean -clean: - @$(RM) -r $(BSP_LIB) $(OBJ_DIR) $(FORCE_REBUILD_DEP_LIST) -ifneq ($(wildcard $(NEWLIB_DIR)),) - @$(RM) -r $(NEWLIB_DIR) -endif - @$(ECHO) [BSP clean complete] - - -#------------------------------------------------------------------------------ -# BUILD PRE/POST PROCESS -#------------------------------------------------------------------------------ -build_pre_process : - $(BUILD_PRE_PROCESS) - -build_post_process : - $(BUILD_POST_PROCESS) - -.PHONY: build_pre_process build_post_process - - - -#------------------------------------------------------------------------------ -# MAKEFILE UP TO DATE? -# -# Is this very Makefile up to date? Someone may have changed the BSP settings -# file or the associated target hardware. -#------------------------------------------------------------------------------ -# Skip this check when clean is the only target -ifneq ($(MAKECMDGOALS),clean) - -ifneq ($(wildcard $(SETTINGS_FILE)),$(SETTINGS_FILE)) -$(warning Warning: BSP Settings File $(SETTINGS_FILE) could not be found.) -endif - -Makefile: $(wildcard $(SETTINGS_FILE)) - @$(ECHO) Makefile not up to date. - @$(ECHO) $(SETTINGS_FILE) has been modified since the BSP Makefile was generated. - @$(ECHO) - @$(ECHO) Generate the BSP to update the Makefile, and then build again. - @$(ECHO) - @$(ECHO) To generate from Eclipse: - @$(ECHO) " 1. Right-click the BSP project." - @$(ECHO) " 2. In the Nios II Menu, click Generate BSP." - @$(ECHO) - @$(ECHO) To generate from the command line: - @$(ECHO) " nios2-bsp-generate-files --settings= --bsp-dir=" - @$(ECHO) - @exit 1 - -ifneq ($(wildcard $(SOPC_FILE)),$(SOPC_FILE)) -$(warning Warning: SOPC File $(SOPC_FILE) could not be found.) -endif - -public.mk: $(wildcard $(SOPC_FILE)) - @$(ECHO) Makefile not up to date. - @$(ECHO) $(SOPC_FILE) has been modified since the BSP was generated. - @$(ECHO) - @$(ECHO) Generate the BSP to update the Makefile, and then build again. - @$(ECHO) - @$(ECHO) To generate from Eclipse: - @$(ECHO) " 1. Right-click the BSP project." - @$(ECHO) " 2. In the Nios II Menu, click Generate BSP." - @$(ECHO) - @$(ECHO) To generate from the command line: - @$(ECHO) " nios2-bsp-generate-files --settings= --bsp-dir=" - @$(ECHO) - @exit 1 - -endif # $(MAKECMDGOALS) != clean - -#------------------------------------------------------------------------------ -# PATTERN RULES TO BUILD OBJECTS -#------------------------------------------------------------------------------ -$(OBJ_DIR)/%.o: %.c - @$(ECHO) Compiling $( - -/* - * Device headers - */ - -#include "altera_nios2_qsys_irq.h" -#include "altera_avalon_jtag_uart.h" - -/* - * Allocate the device storage - */ - -ALTERA_NIOS2_QSYS_IRQ_INSTANCE ( NIOS2_PROCESSOR, nios2_processor); -ALTERA_AVALON_JTAG_UART_INSTANCE ( JTAG_UART, jtag_uart); - -/* - * Initialize the interrupt controller devices - * and then enable interrupts in the CPU. - * Called before alt_sys_init(). - * The "base" parameter is ignored and only - * present for backwards-compatibility. - */ - -void alt_irq_init ( const void* base ) -{ - ALTERA_NIOS2_QSYS_IRQ_INIT ( NIOS2_PROCESSOR, nios2_processor); - alt_irq_cpu_enable_interrupts(); -} - -/* - * Initialize the non-interrupt controller devices. - * Called after alt_irq_init(). - */ - -void alt_sys_init( void ) -{ - ALTERA_AVALON_JTAG_UART_INIT ( JTAG_UART, jtag_uart); -} diff --git a/software/qsys_tutorial_bsp/create-this-bsp b/software/qsys_tutorial_bsp/create-this-bsp deleted file mode 100644 index 4b04cc7..0000000 --- a/software/qsys_tutorial_bsp/create-this-bsp +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/bash -# -# This script creates the ucosii_net_zipfs Board Support Package (BSP). - -BSP_TYPE=hal -BSP_DIR=. -SOPC_DIR=../../ -SOPC_FILE=C:/Users/takayun/Desktop/qsys_tutorial/nios_system.sopcinfo -NIOS2_BSP_ARGS="" -CPU_NAME= - - -# Don't run make if create-this-app script is called with --no-make arg -SKIP_MAKE= -while [ $# -gt 0 ] -do - case "$1" in - --no-make) - SKIP_MAKE=1 - ;; - *) - NIOS2_BSP_ARGS="$NIOS2_BSP_ARGS $1" - ;; - esac - shift -done - - -# Run nios2-bsp utility to create a hal BSP in this directory -# for the system with a .sopc file in $SOPC_FILE. -# Deprecating $SOPC_DIR in 10.1. Multiple .sopcinfo files in a directory may exist. - -if [ -z "$SOPC_FILE" ]; then - echo "WARNING: Use of a directory for locating a .sopcinfo file is deprecated in 10.1. Multiple .sopcinfo files may exist. You must specify the full .sopcinfo path." - cmd="nios2-bsp $BSP_TYPE $BSP_DIR $SOPC_DIR $NIOS2_BSP_ARGS $CPU_NAME" -else - cmd="nios2-bsp $BSP_TYPE $BSP_DIR $SOPC_FILE $NIOS2_BSP_ARGS $CPU_NAME" -fi - - -echo "create-this-bsp: Running \"$cmd\"" -$cmd || { - echo "$cmd failed" - exit 1 -} -if [ -z "$SKIP_MAKE" ]; then - echo "create-this-bsp: Running make" - make -fi diff --git a/software/qsys_tutorial_bsp/drivers/inc/altera_avalon_jtag_uart.h b/software/qsys_tutorial_bsp/drivers/inc/altera_avalon_jtag_uart.h deleted file mode 100644 index 95d4a99..0000000 --- a/software/qsys_tutorial_bsp/drivers/inc/altera_avalon_jtag_uart.h +++ /dev/null @@ -1,198 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#ifndef __ALT_AVALON_JTAG_UART_H__ -#define __ALT_AVALON_JTAG_UART_H__ - -#include - -#include "sys/alt_alarm.h" -#include "sys/alt_warning.h" - -#include "os/alt_sem.h" -#include "os/alt_flag.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * If the user wants all drivers to be small rather than fast then make sure - * this one is marked as needing to be small. - */ -#if defined ALT_USE_SMALL_DRIVERS && !defined ALTERA_AVALON_JTAG_UART_SMALL -#define ALTERA_AVALON_JTAG_UART_SMALL -#endif - -/* - * If the user wants to ignore FIFO full error after timeout - */ -#if defined ALT_JTAG_UART_IGNORE_FIFO_FULL_ERROR && !defined ALTERA_AVALON_JTAG_UART_IGNORE_FIFO_FULL_ERROR -#define ALTERA_AVALON_JTAG_UART_IGNORE_FIFO_FULL_ERROR -#endif - -/* - * Constants that can be overriden. - */ -#ifndef ALTERA_AVALON_JTAG_UART_DEFAULT_TIMEOUT -#define ALTERA_AVALON_JTAG_UART_DEFAULT_TIMEOUT 10 -#endif - -#ifndef ALTERA_AVALON_JTAG_UART_BUF_LEN -#define ALTERA_AVALON_JTAG_UART_BUF_LEN 2048 -#endif - -/* - * ALT_JTAG_UART_READ_RDY and ALT_JTAG_UART_WRITE_RDY are the bitmasks - * that define uC/OS-II event flags that are releated to this device. - * - * ALT_JTAG_UART_READ_RDY indicates that there is read data in the buffer - * ready to be processed. ALT_JTAG_UART_WRITE_RDY indicates that the transmitter is - * ready for more data. - */ -#define ALT_JTAG_UART_READ_RDY 0x1 -#define ALT_JTAG_UART_WRITE_RDY 0x2 -#define ALT_JTAG_UART_TIMEOUT 0x4 - -/* - * State structure definition. Each instance of the driver uses one - * of these structures to hold its associated state. - */ - -typedef struct altera_avalon_jtag_uart_state_s -{ - unsigned int base; - -#ifndef ALTERA_AVALON_JTAG_UART_SMALL - - unsigned int timeout; /* Timeout until host is assumed inactive */ - alt_alarm alarm; - unsigned int irq_enable; - unsigned int host_inactive; - - ALT_SEM (read_lock) - ALT_SEM (write_lock) - ALT_FLAG_GRP (events) - - /* The variables below are volatile because they are modified by the - * interrupt routine. Making them volatile and reading them atomically - * means that we don't need any large critical sections. - */ - volatile unsigned int rx_in; - unsigned int rx_out; - unsigned int tx_in; - volatile unsigned int tx_out; - char rx_buf[ALTERA_AVALON_JTAG_UART_BUF_LEN]; - char tx_buf[ALTERA_AVALON_JTAG_UART_BUF_LEN]; - -#endif /* !ALTERA_AVALON_JTAG_UART_SMALL */ - -} altera_avalon_jtag_uart_state; - -/* - * Macros used by alt_sys_init when the ALT file descriptor facility isn't used. - */ - -#ifdef ALTERA_AVALON_JTAG_UART_SMALL - -#define ALTERA_AVALON_JTAG_UART_STATE_INSTANCE(name, state) \ - altera_avalon_jtag_uart_state state = \ - { \ - name##_BASE, \ - } - -#define ALTERA_AVALON_JTAG_UART_STATE_INIT(name, state) - -#else /* !ALTERA_AVALON_JTAG_UART_SMALL */ - -#define ALTERA_AVALON_JTAG_UART_STATE_INSTANCE(name, state) \ - altera_avalon_jtag_uart_state state = \ - { \ - name##_BASE, \ - ALTERA_AVALON_JTAG_UART_DEFAULT_TIMEOUT, \ - } - -/* - * Externally referenced routines - */ -extern void altera_avalon_jtag_uart_init(altera_avalon_jtag_uart_state* sp, - int irq_controller_id, int irq); - -#define ALTERA_AVALON_JTAG_UART_STATE_INIT(name, state) \ - { \ - if (name##_IRQ == ALT_IRQ_NOT_CONNECTED) \ - { \ - ALT_LINK_ERROR ("Error: Interrupt not connected for " #name ". " \ - "You have selected the interrupt driven version of " \ - "the ALTERA Avalon JTAG UART driver, but the " \ - "interrupt is not connected for this device. You can " \ - "select a polled mode driver by checking the 'small " \ - "driver' option in the HAL configuration window, or " \ - "by using the -DALTERA_AVALON_JTAG_UART_SMALL " \ - "preprocessor flag."); \ - } \ - else \ - altera_avalon_jtag_uart_init(&state, \ - name##_IRQ_INTERRUPT_CONTROLLER_ID, \ - name##_IRQ); \ - } - -#endif /* ALTERA_AVALON_JTAG_UART_SMALL */ - -/* - * Include in case non-direct version of driver required. - */ -#include "altera_avalon_jtag_uart_fd.h" - -/* - * Map alt_sys_init macros to direct or non-direct versions. - */ -#ifdef ALT_USE_DIRECT_DRIVERS - -#define ALTERA_AVALON_JTAG_UART_INSTANCE(name, state) \ - ALTERA_AVALON_JTAG_UART_STATE_INSTANCE(name, state) -#define ALTERA_AVALON_JTAG_UART_INIT(name, state) \ - ALTERA_AVALON_JTAG_UART_STATE_INIT(name, state) - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -#define ALTERA_AVALON_JTAG_UART_INSTANCE(name, dev) \ - ALTERA_AVALON_JTAG_UART_DEV_INSTANCE(name, dev) -#define ALTERA_AVALON_JTAG_UART_INIT(name, dev) \ - ALTERA_AVALON_JTAG_UART_DEV_INIT(name, dev) - -#endif /* ALT_USE_DIRECT_DRIVERS */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_AVALON_JTAG_UART_H__ */ diff --git a/software/qsys_tutorial_bsp/drivers/inc/altera_avalon_jtag_uart_fd.h b/software/qsys_tutorial_bsp/drivers/inc/altera_avalon_jtag_uart_fd.h deleted file mode 100644 index b3c3200..0000000 --- a/software/qsys_tutorial_bsp/drivers/inc/altera_avalon_jtag_uart_fd.h +++ /dev/null @@ -1,125 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#ifndef __ALT_AVALON_JTAG_UART_FD_H__ -#define __ALT_AVALON_JTAG_UART_FD_H__ - -#include "sys/alt_dev.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * Externally referenced routines - */ -extern int altera_avalon_jtag_uart_read_fd (alt_fd* fd, char* ptr, int len); -extern int altera_avalon_jtag_uart_write_fd (alt_fd* fd, const char* ptr, - int len); - -/* - * Device structure definition. This is needed by alt_sys_init in order to - * reserve memory for the device instance. - */ - -typedef struct altera_avalon_jtag_uart_dev_s -{ - alt_dev dev; - altera_avalon_jtag_uart_state state; -} altera_avalon_jtag_uart_dev; - -/* - * Macros used by alt_sys_init when the ALT file descriptor facility is used. - */ - -#ifdef ALTERA_AVALON_JTAG_UART_SMALL - -#define ALTERA_AVALON_JTAG_UART_DEV_INSTANCE(name, d) \ - static altera_avalon_jtag_uart_dev d = \ - { \ - { \ - ALT_LLIST_ENTRY, \ - name##_NAME, \ - NULL, /* open */ \ - NULL, /* close */ \ - altera_avalon_jtag_uart_read_fd, \ - altera_avalon_jtag_uart_write_fd, \ - NULL, /* lseek */ \ - NULL, /* fstat */ \ - NULL, /* ioctl */ \ - }, \ - { \ - name##_BASE, \ - } \ - } - -#define ALTERA_AVALON_JTAG_UART_DEV_INIT(name, d) alt_dev_reg (&d.dev) - -#else /* !ALTERA_AVALON_JTAG_UART_SMALL */ - -extern int altera_avalon_jtag_uart_close_fd(alt_fd* fd); -extern int altera_avalon_jtag_uart_ioctl_fd (alt_fd* fd, int req, void* arg); - -#define ALTERA_AVALON_JTAG_UART_DEV_INSTANCE(name, d) \ - static altera_avalon_jtag_uart_dev d = \ - { \ - { \ - ALT_LLIST_ENTRY, \ - name##_NAME, \ - NULL, /* open */ \ - altera_avalon_jtag_uart_close_fd, \ - altera_avalon_jtag_uart_read_fd, \ - altera_avalon_jtag_uart_write_fd, \ - NULL, /* lseek */ \ - NULL, /* fstat */ \ - altera_avalon_jtag_uart_ioctl_fd, \ - }, \ - { \ - name##_BASE, \ - ALTERA_AVALON_JTAG_UART_DEFAULT_TIMEOUT, \ - } \ - } - -#define ALTERA_AVALON_JTAG_UART_DEV_INIT(name, d) \ - { \ - ALTERA_AVALON_JTAG_UART_STATE_INIT(name, d.state); \ - \ - /* make the device available to the system */ \ - alt_dev_reg(&d.dev); \ - } - -#endif /* ALTERA_AVALON_JTAG_UART_SMALL */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_AVALON_JTAG_UART_FD_H__ */ diff --git a/software/qsys_tutorial_bsp/drivers/inc/altera_avalon_jtag_uart_regs.h b/software/qsys_tutorial_bsp/drivers/inc/altera_avalon_jtag_uart_regs.h deleted file mode 100644 index 7f97160..0000000 --- a/software/qsys_tutorial_bsp/drivers/inc/altera_avalon_jtag_uart_regs.h +++ /dev/null @@ -1,73 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#ifndef __ALTERA_AVALON_JTAG_UART_REGS_H__ -#define __ALTERA_AVALON_JTAG_UART_REGS_H__ - -#include - -#define ALTERA_AVALON_JTAG_UART_DATA_REG 0 -#define IOADDR_ALTERA_AVALON_JTAG_UART_DATA(base) \ - __IO_CALC_ADDRESS_NATIVE(base, ALTERA_AVALON_JTAG_UART_DATA_REG) -#define IORD_ALTERA_AVALON_JTAG_UART_DATA(base) \ - IORD(base, ALTERA_AVALON_JTAG_UART_DATA_REG) -#define IOWR_ALTERA_AVALON_JTAG_UART_DATA(base, data) \ - IOWR(base, ALTERA_AVALON_JTAG_UART_DATA_REG, data) - -#define ALTERA_AVALON_JTAG_UART_DATA_DATA_MSK (0x000000FF) -#define ALTERA_AVALON_JTAG_UART_DATA_DATA_OFST (0) -#define ALTERA_AVALON_JTAG_UART_DATA_RVALID_MSK (0x00008000) -#define ALTERA_AVALON_JTAG_UART_DATA_RVALID_OFST (15) -#define ALTERA_AVALON_JTAG_UART_DATA_RAVAIL_MSK (0xFFFF0000) -#define ALTERA_AVALON_JTAG_UART_DATA_RAVAIL_OFST (16) - - -#define ALTERA_AVALON_JTAG_UART_CONTROL_REG 1 -#define IOADDR_ALTERA_AVALON_JTAG_UART_CONTROL(base) \ - __IO_CALC_ADDRESS_NATIVE(base, ALTERA_AVALON_JTAG_UART_CONTROL_REG) -#define IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base) \ - IORD(base, ALTERA_AVALON_JTAG_UART_CONTROL_REG) -#define IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(base, data) \ - IOWR(base, ALTERA_AVALON_JTAG_UART_CONTROL_REG, data) - -#define ALTERA_AVALON_JTAG_UART_CONTROL_RE_MSK (0x00000001) -#define ALTERA_AVALON_JTAG_UART_CONTROL_RE_OFST (0) -#define ALTERA_AVALON_JTAG_UART_CONTROL_WE_MSK (0x00000002) -#define ALTERA_AVALON_JTAG_UART_CONTROL_WE_OFST (1) -#define ALTERA_AVALON_JTAG_UART_CONTROL_RI_MSK (0x00000100) -#define ALTERA_AVALON_JTAG_UART_CONTROL_RI_OFST (8) -#define ALTERA_AVALON_JTAG_UART_CONTROL_WI_MSK (0x00000200) -#define ALTERA_AVALON_JTAG_UART_CONTROL_WI_OFST (9) -#define ALTERA_AVALON_JTAG_UART_CONTROL_AC_MSK (0x00000400) -#define ALTERA_AVALON_JTAG_UART_CONTROL_AC_OFST (10) -#define ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_MSK (0xFFFF0000) -#define ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_OFST (16) - -#endif /* __ALTERA_AVALON_JTAG_UART_REGS_H__ */ diff --git a/software/qsys_tutorial_bsp/drivers/inc/altera_avalon_pio_regs.h b/software/qsys_tutorial_bsp/drivers/inc/altera_avalon_pio_regs.h deleted file mode 100644 index 052439f..0000000 --- a/software/qsys_tutorial_bsp/drivers/inc/altera_avalon_pio_regs.h +++ /dev/null @@ -1,67 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#ifndef __ALTERA_AVALON_PIO_REGS_H__ -#define __ALTERA_AVALON_PIO_REGS_H__ - -#include - -#define IOADDR_ALTERA_AVALON_PIO_DATA(base) __IO_CALC_ADDRESS_NATIVE(base, 0) -#define IORD_ALTERA_AVALON_PIO_DATA(base) IORD(base, 0) -#define IOWR_ALTERA_AVALON_PIO_DATA(base, data) IOWR(base, 0, data) - -#define IOADDR_ALTERA_AVALON_PIO_DIRECTION(base) __IO_CALC_ADDRESS_NATIVE(base, 1) -#define IORD_ALTERA_AVALON_PIO_DIRECTION(base) IORD(base, 1) -#define IOWR_ALTERA_AVALON_PIO_DIRECTION(base, data) IOWR(base, 1, data) - -#define IOADDR_ALTERA_AVALON_PIO_IRQ_MASK(base) __IO_CALC_ADDRESS_NATIVE(base, 2) -#define IORD_ALTERA_AVALON_PIO_IRQ_MASK(base) IORD(base, 2) -#define IOWR_ALTERA_AVALON_PIO_IRQ_MASK(base, data) IOWR(base, 2, data) - -#define IOADDR_ALTERA_AVALON_PIO_EDGE_CAP(base) __IO_CALC_ADDRESS_NATIVE(base, 3) -#define IORD_ALTERA_AVALON_PIO_EDGE_CAP(base) IORD(base, 3) -#define IOWR_ALTERA_AVALON_PIO_EDGE_CAP(base, data) IOWR(base, 3, data) - - -#define IOADDR_ALTERA_AVALON_PIO_SET_BIT(base) __IO_CALC_ADDRESS_NATIVE(base, 4) -#define IORD_ALTERA_AVALON_PIO_SET_BITS(base) IORD(base, 4) -#define IOWR_ALTERA_AVALON_PIO_SET_BITS(base, data) IOWR(base, 4, data) - -#define IOADDR_ALTERA_AVALON_PIO_CLEAR_BITS(base) __IO_CALC_ADDRESS_NATIVE(base, 5) -#define IORD_ALTERA_AVALON_PIO_CLEAR_BITS(base) IORD(base, 5) -#define IOWR_ALTERA_AVALON_PIO_CLEAR_BITS(base, data) IOWR(base, 5, data) - - - -/* Defintions for direction-register operation with bi-directional PIOs */ -#define ALTERA_AVALON_PIO_DIRECTION_INPUT 0 -#define ALTERA_AVALON_PIO_DIRECTION_OUTPUT 1 - -#endif /* __ALTERA_AVALON_PIO_REGS_H__ */ diff --git a/software/qsys_tutorial_bsp/drivers/src/altera_avalon_jtag_uart_fd.c b/software/qsys_tutorial_bsp/drivers/src/altera_avalon_jtag_uart_fd.c deleted file mode 100644 index 53dfc3b..0000000 --- a/software/qsys_tutorial_bsp/drivers/src/altera_avalon_jtag_uart_fd.c +++ /dev/null @@ -1,86 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "alt_types.h" -#include "sys/alt_dev.h" -#include "altera_avalon_jtag_uart.h" - -extern int altera_avalon_jtag_uart_read(altera_avalon_jtag_uart_state* sp, - char* buffer, int space, int flags); -extern int altera_avalon_jtag_uart_write(altera_avalon_jtag_uart_state* sp, - const char* ptr, int count, int flags); -extern int altera_avalon_jtag_uart_ioctl(altera_avalon_jtag_uart_state* sp, - int req, void* arg); -extern int altera_avalon_jtag_uart_close(altera_avalon_jtag_uart_state* sp, - int flags); - -/* ----------------------------------------------------------------------- */ -/* --------------------- WRAPPERS FOR ALT FD SUPPORT --------------------- */ -/* - * - */ - -int -altera_avalon_jtag_uart_read_fd(alt_fd* fd, char* buffer, int space) -{ - altera_avalon_jtag_uart_dev* dev = (altera_avalon_jtag_uart_dev*) fd->dev; - - return altera_avalon_jtag_uart_read(&dev->state, buffer, space, - fd->fd_flags); -} - -int -altera_avalon_jtag_uart_write_fd(alt_fd* fd, const char* buffer, int space) -{ - altera_avalon_jtag_uart_dev* dev = (altera_avalon_jtag_uart_dev*) fd->dev; - - return altera_avalon_jtag_uart_write(&dev->state, buffer, space, - fd->fd_flags); -} - -#ifndef ALTERA_AVALON_JTAG_UART_SMALL - -int -altera_avalon_jtag_uart_close_fd(alt_fd* fd) -{ - altera_avalon_jtag_uart_dev* dev = (altera_avalon_jtag_uart_dev*) fd->dev; - - return altera_avalon_jtag_uart_close(&dev->state, fd->fd_flags); -} - -int -altera_avalon_jtag_uart_ioctl_fd(alt_fd* fd, int req, void* arg) -{ - altera_avalon_jtag_uart_dev* dev = (altera_avalon_jtag_uart_dev*) fd->dev; - - return altera_avalon_jtag_uart_ioctl(&dev->state, req, arg); -} - -#endif /* ALTERA_AVALON_JTAG_UART_SMALL */ diff --git a/software/qsys_tutorial_bsp/drivers/src/altera_avalon_jtag_uart_init.c b/software/qsys_tutorial_bsp/drivers/src/altera_avalon_jtag_uart_init.c deleted file mode 100644 index 7317bec..0000000 --- a/software/qsys_tutorial_bsp/drivers/src/altera_avalon_jtag_uart_init.c +++ /dev/null @@ -1,256 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include -#include -#include -#include - -#include - -#include "sys/alt_irq.h" -#include "sys/alt_alarm.h" -#include "sys/ioctl.h" -#include "alt_types.h" - -#include "altera_avalon_jtag_uart_regs.h" -#include "altera_avalon_jtag_uart.h" - -#include "sys/alt_log_printf.h" - -#ifndef ALTERA_AVALON_JTAG_UART_SMALL - -/* ----------------------------------------------------------- */ -/* ------------------------- FAST DRIVER --------------------- */ -/* ----------------------------------------------------------- */ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT -static void altera_avalon_jtag_uart_irq(void* context); -#else -static void altera_avalon_jtag_uart_irq(void* context, alt_u32 id); -#endif -static alt_u32 altera_avalon_jtag_uart_timeout(void* context); - -/* - * Driver initialization code. Register interrupts and start a timer - * which we can use to check whether the host is there. - * Return 1 on sucessful IRQ register and 0 on failure. - */ - -void altera_avalon_jtag_uart_init(altera_avalon_jtag_uart_state* sp, - int irq_controller_id, int irq) -{ - ALT_FLAG_CREATE(&sp->events, 0); - ALT_SEM_CREATE(&sp->read_lock, 1); - ALT_SEM_CREATE(&sp->write_lock, 1); - - /* enable read interrupts at the device */ - sp->irq_enable = ALTERA_AVALON_JTAG_UART_CONTROL_RE_MSK; - - IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base, sp->irq_enable); - - /* register the interrupt handler */ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - alt_ic_isr_register(irq_controller_id, irq, altera_avalon_jtag_uart_irq, - sp, NULL); -#else - alt_irq_register(irq, sp, altera_avalon_jtag_uart_irq); -#endif - - /* Register an alarm to go off every second to check for presence of host */ - sp->host_inactive = 0; - - if (alt_alarm_start(&sp->alarm, alt_ticks_per_second(), - &altera_avalon_jtag_uart_timeout, sp) < 0) - { - /* If we can't set the alarm then record "don't know if host present" - * and behave as though the host is present. - */ - sp->timeout = INT_MAX; - } - - /* ALT_LOG - see altera_hal/HAL/inc/sys/alt_log_printf.h */ - ALT_LOG_JTAG_UART_ALARM_REGISTER(sp, sp->base); -} - -/* - * Interrupt routine - */ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT -static void altera_avalon_jtag_uart_irq(void* context) -#else -static void altera_avalon_jtag_uart_irq(void* context, alt_u32 id) -#endif -{ - altera_avalon_jtag_uart_state* sp = (altera_avalon_jtag_uart_state*) context; - unsigned int base = sp->base; - - /* ALT_LOG - see altera_hal/HAL/inc/sys/alt_log_printf.h */ - ALT_LOG_JTAG_UART_ISR_FUNCTION(base, sp); - - for ( ; ; ) - { - unsigned int control = IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base); - - /* Return once nothing more to do */ - if ((control & (ALTERA_AVALON_JTAG_UART_CONTROL_RI_MSK | ALTERA_AVALON_JTAG_UART_CONTROL_WI_MSK)) == 0) - break; - - if (control & ALTERA_AVALON_JTAG_UART_CONTROL_RI_MSK) - { - /* process a read irq. Start by assuming that there is data in the - * receive FIFO (otherwise why would we have been interrupted?) - */ - unsigned int data = 1 << ALTERA_AVALON_JTAG_UART_DATA_RAVAIL_OFST; - - for ( ; ; ) - { - /* Check whether there is space in the buffer. If not then we must not - * read any characters from the buffer as they will be lost. - */ - unsigned int next = (sp->rx_in + 1) % ALTERA_AVALON_JTAG_UART_BUF_LEN; - if (next == sp->rx_out) - break; - - /* Try to remove a character from the FIFO and find out whether there - * are any more characters remaining. - */ - data = IORD_ALTERA_AVALON_JTAG_UART_DATA(base); - - if ((data & ALTERA_AVALON_JTAG_UART_DATA_RVALID_MSK) == 0) - break; - - sp->rx_buf[sp->rx_in] = (data & ALTERA_AVALON_JTAG_UART_DATA_DATA_MSK) >> ALTERA_AVALON_JTAG_UART_DATA_DATA_OFST; - sp->rx_in = (sp->rx_in + 1) % ALTERA_AVALON_JTAG_UART_BUF_LEN; - - /* Post an event to notify jtag_uart_read that a character has been read */ - ALT_FLAG_POST (sp->events, ALT_JTAG_UART_READ_RDY, OS_FLAG_SET); - } - - if (data & ALTERA_AVALON_JTAG_UART_DATA_RAVAIL_MSK) - { - /* If there is still data available here then the buffer is full - * so turn off receive interrupts until some space becomes available. - */ - sp->irq_enable &= ~ALTERA_AVALON_JTAG_UART_CONTROL_RE_MSK; - IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(base, sp->irq_enable); - - /* Dummy read to ensure IRQ is cleared prior to ISR completion */ - IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base); - } - } - - if (control & ALTERA_AVALON_JTAG_UART_CONTROL_WI_MSK) - { - /* process a write irq */ - unsigned int space = (control & ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_MSK) >> ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_OFST; - - while (space > 0 && sp->tx_out != sp->tx_in) - { - IOWR_ALTERA_AVALON_JTAG_UART_DATA(base, sp->tx_buf[sp->tx_out]); - - sp->tx_out = (sp->tx_out + 1) % ALTERA_AVALON_JTAG_UART_BUF_LEN; - - /* Post an event to notify jtag_uart_write that a character has been written */ - ALT_FLAG_POST (sp->events, ALT_JTAG_UART_WRITE_RDY, OS_FLAG_SET); - - space--; - } - - if (space > 0) - { - /* If we don't have any more data available then turn off the TX interrupt */ - sp->irq_enable &= ~ALTERA_AVALON_JTAG_UART_CONTROL_WE_MSK; - IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base, sp->irq_enable); - - /* Dummy read to ensure IRQ is cleared prior to ISR completion */ - IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base); - } - } - } -} - -/* - * Timeout routine is called every second - */ - -static alt_u32 -altera_avalon_jtag_uart_timeout(void* context) -{ - altera_avalon_jtag_uart_state* sp = (altera_avalon_jtag_uart_state *) context; - - unsigned int control = IORD_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base); - - if (control & ALTERA_AVALON_JTAG_UART_CONTROL_AC_MSK) - { - IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base, sp->irq_enable | ALTERA_AVALON_JTAG_UART_CONTROL_AC_MSK); - sp->host_inactive = 0; - } - else if (sp->host_inactive < INT_MAX - 2) { - sp->host_inactive++; - - if (sp->host_inactive >= sp->timeout) { - /* Post an event to indicate host is inactive (for jtag_uart_read */ - ALT_FLAG_POST (sp->events, ALT_JTAG_UART_TIMEOUT, OS_FLAG_SET); - } - } - - return alt_ticks_per_second(); -} - -/* - * The close() routine is implemented to drain the JTAG UART transmit buffer - * when not in "small" mode. This routine will wait for transimt data to be - * emptied unless a timeout from host-activity occurs. If the driver flags - * have been set to non-blocking mode, this routine will exit immediately if - * any data remains. This routine should be called indirectly (i.e. though - * the C library close() routine) so that the file descriptor associated - * with the relevant stream (i.e. stdout) can be closed as well. This routine - * does not manage file descriptors. - * - * The close routine is not implemented for the small driver; instead it will - * map to null. This is because the small driver simply waits while characters - * are transmitted; there is no interrupt-serviced buffer to empty - */ -int altera_avalon_jtag_uart_close(altera_avalon_jtag_uart_state* sp, int flags) -{ - /* - * Wait for all transmit data to be emptied by the JTAG UART ISR, or - * for a host-inactivity timeout, in which case transmit data will be lost - */ - while ( (sp->tx_out != sp->tx_in) && (sp->host_inactive < sp->timeout) ) { - if (flags & O_NONBLOCK) { - return -EWOULDBLOCK; - } - } - - return 0; -} - -#endif /* !ALTERA_AVALON_JTAG_UART_SMALL */ diff --git a/software/qsys_tutorial_bsp/drivers/src/altera_avalon_jtag_uart_ioctl.c b/software/qsys_tutorial_bsp/drivers/src/altera_avalon_jtag_uart_ioctl.c deleted file mode 100644 index cf71e6f..0000000 --- a/software/qsys_tutorial_bsp/drivers/src/altera_avalon_jtag_uart_ioctl.c +++ /dev/null @@ -1,86 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include -#include -#include -#include - -#include - -#include "sys/ioctl.h" -#include "alt_types.h" - -#include "altera_avalon_jtag_uart_regs.h" -#include "altera_avalon_jtag_uart.h" - -#include "sys/alt_log_printf.h" - -#ifndef ALTERA_AVALON_JTAG_UART_SMALL - -/* ----------------------------------------------------------- */ -/* ------------------------- FAST DRIVER --------------------- */ -/* ----------------------------------------------------------- */ - -int -altera_avalon_jtag_uart_ioctl(altera_avalon_jtag_uart_state* sp, int req, - void* arg) -{ - int rc = -ENOTTY; - - switch (req) - { - case TIOCSTIMEOUT: - /* Set the time to wait until assuming host is not connected */ - if (sp->timeout != INT_MAX) - { - int timeout = *((int *)arg); - sp->timeout = (timeout >= 2 && timeout < INT_MAX) ? timeout : INT_MAX - 1; - rc = 0; - } - break; - - case TIOCGCONNECTED: - /* Find out whether host is connected */ - if (sp->timeout != INT_MAX) - { - *((int *)arg) = (sp->host_inactive < sp->timeout) ? 1 : 0; - rc = 0; - } - break; - - default: - break; - } - - return rc; -} - -#endif /* !ALTERA_AVALON_JTAG_UART_SMALL */ diff --git a/software/qsys_tutorial_bsp/drivers/src/altera_avalon_jtag_uart_read.c b/software/qsys_tutorial_bsp/drivers/src/altera_avalon_jtag_uart_read.c deleted file mode 100644 index 5657adb..0000000 --- a/software/qsys_tutorial_bsp/drivers/src/altera_avalon_jtag_uart_read.c +++ /dev/null @@ -1,205 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include -#include -#include -#include - -#include - -#include "sys/alt_irq.h" -#include "sys/alt_alarm.h" -#include "sys/ioctl.h" -#include "alt_types.h" - -#include "altera_avalon_jtag_uart_regs.h" -#include "altera_avalon_jtag_uart.h" - -#include "sys/alt_log_printf.h" - -#ifdef __ucosii__ -#include "includes.h" -#endif /* __ucosii__ */ - -#ifdef ALTERA_AVALON_JTAG_UART_SMALL - -/* ----------------------------------------------------------- */ -/* ----------------------- SMALL DRIVER ---------------------- */ -/* ----------------------------------------------------------- */ - -/* Read routine. The small version blocks until it has at least one byte - * available, it then returns as much as is immediately available without - * waiting any more. It's performance will be very poor without - * interrupts. - */ - -int -altera_avalon_jtag_uart_read(altera_avalon_jtag_uart_state* sp, - char* buffer, int space, int flags) -{ - unsigned int base = sp->base; - - char * ptr = buffer; - char * end = buffer + space; - - while (ptr < end) - { - unsigned int data = IORD_ALTERA_AVALON_JTAG_UART_DATA(base); - - if (data & ALTERA_AVALON_JTAG_UART_DATA_RVALID_MSK) - *ptr++ = (data & ALTERA_AVALON_JTAG_UART_DATA_DATA_MSK) >> ALTERA_AVALON_JTAG_UART_DATA_DATA_OFST; - else if (ptr != buffer) - break; - else if(flags & O_NONBLOCK) - break; - - } - - if (ptr != buffer) - return ptr - buffer; - else if (flags & O_NONBLOCK) - return -EWOULDBLOCK; - else - return -EIO; -} - -#else /* !ALTERA_AVALON_JTAG_UART_SMALL */ - -/* ----------------------------------------------------------- */ -/* ----------------------- FAST DRIVER ----------------------- */ -/* ----------------------------------------------------------- */ - -int -altera_avalon_jtag_uart_read(altera_avalon_jtag_uart_state* sp, - char * buffer, int space, int flags) -{ - char * ptr = buffer; - - alt_irq_context context; - unsigned int n; - - /* - * When running in a multi threaded environment, obtain the "read_lock" - * semaphore. This ensures that reading from the device is thread-safe. - */ - ALT_SEM_PEND (sp->read_lock, 0); - - while (space > 0) - { - unsigned int in, out; - - /* Read as much data as possible */ - do - { - in = sp->rx_in; - out = sp->rx_out; - - if (in >= out) - n = in - out; - else - n = ALTERA_AVALON_JTAG_UART_BUF_LEN - out; - - if (n == 0) - break; /* No more data available */ - - if (n > space) - n = space; - - memcpy(ptr, sp->rx_buf + out, n); - ptr += n; - space -= n; - - sp->rx_out = (out + n) % ALTERA_AVALON_JTAG_UART_BUF_LEN; - } - while (space > 0); - - /* If we read any data then return it */ - if (ptr != buffer) - break; - - /* If in non-blocking mode then return error */ - if (flags & O_NONBLOCK) - break; - -#ifdef __ucosii__ - /* OS Present: Pend on a flag if the OS is running, otherwise spin */ - if(OSRunning == OS_TRUE) { - /* - * When running in a multi-threaded mode, we pend on the read event - * flag set and timeout event flag set in the isr. This avoids wasting CPU - * cycles waiting in this thread, when we could be doing something more - * profitable elsewhere. - */ - ALT_FLAG_PEND (sp->events, - ALT_JTAG_UART_READ_RDY | ALT_JTAG_UART_TIMEOUT, - OS_FLAG_WAIT_SET_ANY + OS_FLAG_CONSUME, - 0); - } - else { - /* Spin until more data arrives or until host disconnects */ - while (in == sp->rx_in && sp->host_inactive < sp->timeout) - ; - } -#else - /* No OS: Always spin */ - while (in == sp->rx_in && sp->host_inactive < sp->timeout) - ; -#endif /* __ucosii__ */ - - if (in == sp->rx_in) - break; - } - - /* - * Now that access to the circular buffer is complete, release the read - * semaphore so that other threads can access the buffer. - */ - - ALT_SEM_POST (sp->read_lock); - - if (ptr != buffer) - { - /* If we read any data then there is space in the buffer so enable interrupts */ - context = alt_irq_disable_all(); - sp->irq_enable |= ALTERA_AVALON_JTAG_UART_CONTROL_RE_MSK; - IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base, sp->irq_enable); - alt_irq_enable_all(context); - } - - if (ptr != buffer) - return ptr - buffer; - else if (flags & O_NONBLOCK) - return -EWOULDBLOCK; - else - return -EIO; -} - -#endif /* ALTERA_AVALON_JTAG_UART_SMALL */ diff --git a/software/qsys_tutorial_bsp/drivers/src/altera_avalon_jtag_uart_write.c b/software/qsys_tutorial_bsp/drivers/src/altera_avalon_jtag_uart_write.c deleted file mode 100644 index 11aeca1..0000000 --- a/software/qsys_tutorial_bsp/drivers/src/altera_avalon_jtag_uart_write.c +++ /dev/null @@ -1,217 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include -#include -#include -#include - -#include - -#include "sys/alt_irq.h" -#include "sys/alt_alarm.h" -#include "sys/ioctl.h" -#include "alt_types.h" - -#include "altera_avalon_jtag_uart_regs.h" -#include "altera_avalon_jtag_uart.h" - -#include "sys/alt_log_printf.h" - -#ifdef __ucosii__ -#include "includes.h" -#endif /* __ucosii__ */ - -#ifdef ALTERA_AVALON_JTAG_UART_SMALL - -/* ----------------------------------------------------------- */ -/* ------------------------ SMALL DRIVER --------------------- */ -/* ----------------------------------------------------------- */ - -/* Write routine. The small version blocks when there is no space to write - * into, so it's performance will be very bad if you are writing more than - * one FIFOs worth of data. But you said you didn't want to use interrupts :-) - */ - -int altera_avalon_jtag_uart_write(altera_avalon_jtag_uart_state* sp, - const char * ptr, int count, int flags) -{ - unsigned int base = sp->base; - - const char * end = ptr + count; - - while (ptr < end) - if ((IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base) & ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_MSK) != 0) - IOWR_ALTERA_AVALON_JTAG_UART_DATA(base, *ptr++); - - return count; -} - -#else /* !ALTERA_AVALON_JTAG_UART_SMALL */ - -/* ----------------------------------------------------------- */ -/* ------------------------- FAST DRIVER --------------------- */ -/* ----------------------------------------------------------- */ - -int -altera_avalon_jtag_uart_write(altera_avalon_jtag_uart_state* sp, - const char * ptr, int count, int flags) -{ - /* Remove warning at optimisation level 03 by seting out to 0 */ - unsigned int in, out=0; - unsigned int n; - alt_irq_context context; - - const char * start = ptr; - - /* - * When running in a multi threaded environment, obtain the "write_lock" - * semaphore. This ensures that writing to the device is thread-safe. - */ - ALT_SEM_PEND (sp->write_lock, 0); - - do - { - /* Copy as much as we can into the transmit buffer */ - while (count > 0) - { - /* We need a stable value of the out pointer to calculate the space available */ - in = sp->tx_in; - out = sp->tx_out; - - if (in < out) - n = out - 1 - in; - else if (out > 0) - n = ALTERA_AVALON_JTAG_UART_BUF_LEN - in; - else - n = ALTERA_AVALON_JTAG_UART_BUF_LEN - 1 - in; - - if (n == 0) - break; - - if (n > count) - n = count; - - memcpy(sp->tx_buf + in, ptr, n); - ptr += n; - count -= n; - - sp->tx_in = (in + n) % ALTERA_AVALON_JTAG_UART_BUF_LEN; - } - - /* - * If interrupts are disabled then we could transmit here, we only need - * to enable interrupts if there is no space left in the FIFO - * - * For now kick the interrupt routine every time to make it transmit - * the data - */ - context = alt_irq_disable_all(); - sp->irq_enable |= ALTERA_AVALON_JTAG_UART_CONTROL_WE_MSK; - IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base, sp->irq_enable); - alt_irq_enable_all(context); - - /* - * If there is any data left then either return now or block until - * some has been sent - */ - /* consider: test whether there is anything there while doing this and delay for at most 2s. */ - if (count > 0) - { - if (flags & O_NONBLOCK) - break; - -#ifdef __ucosii__ - /* OS Present: Pend on a flag if the OS is running, otherwise spin */ - if(OSRunning == OS_TRUE) { - /* - * When running in a multi-threaded mode, we pend on the write event - * flag set or the timeout flag in the isr. This avoids wasting CPU - * cycles waiting in this thread, when we could be doing something - * more profitable elsewhere. - */ -#ifdef ALTERA_AVALON_JTAG_UART_IGNORE_FIFO_FULL_ERROR - if(!sp->host_inactive) -#endif - ALT_FLAG_PEND (sp->events, - ALT_JTAG_UART_WRITE_RDY | ALT_JTAG_UART_TIMEOUT, - OS_FLAG_WAIT_SET_ANY + OS_FLAG_CONSUME, - 0); - } - else { - /* - * OS not running: Wait for data to be removed from buffer. - * Once the interrupt routine has removed some data then we - * will be able to insert some more. - */ - while (out == sp->tx_out && sp->host_inactive < sp->timeout) - ; - } -#else - /* - * No OS present: Always wait for data to be removed from buffer. Once - * the interrupt routine has removed some data then we will be able to - * insert some more. - */ - while (out == sp->tx_out && sp->host_inactive < sp->timeout) - ; -#endif /* __ucosii__ */ - - if (out == sp->tx_out) - break; - } - } - while (count > 0); - - /* - * Now that access to the circular buffer is complete, release the write - * semaphore so that other threads can access the buffer. - */ - ALT_SEM_POST (sp->write_lock); - - if (ptr != start) - return ptr - start; - else if (flags & O_NONBLOCK) - return -EWOULDBLOCK; -#ifdef ALTERA_AVALON_JTAG_UART_IGNORE_FIFO_FULL_ERROR - else if (sp->host_inactive >= sp->timeout) { - /* - * Reset the software FIFO, hardware FIFO could not be reset. - * Just throw away characters without reporting error. - */ - sp->tx_out = sp->tx_in = 0; - return ptr - start + count; - } -#endif - else - return -EIO; /* Host not connected */ -} - -#endif /* ALTERA_AVALON_JTAG_UART_SMALL */ diff --git a/software/qsys_tutorial_bsp/linker.h b/software/qsys_tutorial_bsp/linker.h deleted file mode 100644 index 03ce23e..0000000 --- a/software/qsys_tutorial_bsp/linker.h +++ /dev/null @@ -1,101 +0,0 @@ -/* - * linker.h - Linker script mapping information - * - * Machine generated for CPU 'nios2_processor' in SOPC Builder design 'nios_system' - * SOPC Builder design path: C:/Users/takayun/Desktop/qsys_tutorial/nios_system.sopcinfo - * - * Generated: Thu Oct 13 17:08:43 JST 2016 - */ - -/* - * DO NOT MODIFY THIS FILE - * - * Changing this file will have subtle consequences - * which will almost certainly lead to a nonfunctioning - * system. If you do modify this file, be aware that your - * changes will be overwritten and lost when this file - * is generated again. - * - * DO NOT MODIFY THIS FILE - */ - -/* - * License Agreement - * - * Copyright (c) 2008 - * Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - * - * This agreement shall be governed in all respects by the laws of the State - * of California and by the laws of the United States of America. - */ - -#ifndef __LINKER_H_ -#define __LINKER_H_ - - -/* - * BSP controls alt_load() behavior in crt0. - * - */ - -#define ALT_LOAD_EXPLICITLY_CONTROLLED - - -/* - * Base address and span (size in bytes) of each linker region - * - */ - -#define ONCHIP_MEMORY_REGION_BASE 0x20 -#define ONCHIP_MEMORY_REGION_SPAN 4064 -#define RESET_REGION_BASE 0x0 -#define RESET_REGION_SPAN 32 - - -/* - * Devices associated with code sections - * - */ - -#define ALT_EXCEPTIONS_DEVICE ONCHIP_MEMORY -#define ALT_RESET_DEVICE ONCHIP_MEMORY -#define ALT_RODATA_DEVICE ONCHIP_MEMORY -#define ALT_RWDATA_DEVICE ONCHIP_MEMORY -#define ALT_TEXT_DEVICE ONCHIP_MEMORY - - -/* - * Initialization code at the reset address is allowed (e.g. no external bootloader). - * - */ - -#define ALT_ALLOW_CODE_AT_RESET - - -/* - * The alt_load() facility is called from crt0 to copy sections into RAM. - * - */ - -#define ALT_LOAD_COPY_RWDATA - -#endif /* __LINKER_H_ */ diff --git a/software/qsys_tutorial_bsp/linker.x b/software/qsys_tutorial_bsp/linker.x deleted file mode 100644 index 342af30..0000000 --- a/software/qsys_tutorial_bsp/linker.x +++ /dev/null @@ -1,385 +0,0 @@ -/* - * linker.x - Linker script - * - * Machine generated for CPU 'nios2_processor' in SOPC Builder design 'nios_system' - * SOPC Builder design path: C:/Users/takayun/Desktop/qsys_tutorial/nios_system.sopcinfo - * - * Generated: Thu Oct 13 17:08:43 JST 2016 - */ - -/* - * DO NOT MODIFY THIS FILE - * - * Changing this file will have subtle consequences - * which will almost certainly lead to a nonfunctioning - * system. If you do modify this file, be aware that your - * changes will be overwritten and lost when this file - * is generated again. - * - * DO NOT MODIFY THIS FILE - */ - -/* - * License Agreement - * - * Copyright (c) 2008 - * Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - * - * This agreement shall be governed in all respects by the laws of the State - * of California and by the laws of the United States of America. - */ - -MEMORY -{ - reset : ORIGIN = 0x0, LENGTH = 32 - onchip_memory : ORIGIN = 0x20, LENGTH = 4064 -} - -/* Define symbols for each memory base-address */ -__alt_mem_onchip_memory = 0x0; - -OUTPUT_FORMAT( "elf32-littlenios2", - "elf32-littlenios2", - "elf32-littlenios2" ) -OUTPUT_ARCH( nios2 ) -ENTRY( _start ) - -/* - * The alt_load() facility is enabled. This typically happens when there isn't - * an external bootloader (e.g. flash bootloader). - * The LMA (aka physical address) of each loaded section is - * set to the .text memory device. - * The HAL alt_load() routine called from crt0 copies sections from - * the .text memory to RAM as needed. - */ - -SECTIONS -{ - - /* - * Output sections associated with reset and exceptions (they have to be first) - */ - - .entry : - { - KEEP (*(.entry)) - } > reset - - .exceptions : - { - PROVIDE (__ram_exceptions_start = ABSOLUTE(.)); - . = ALIGN(0x20); - KEEP (*(.irq)); - KEEP (*(.exceptions.entry.label)); - KEEP (*(.exceptions.entry.user)); - KEEP (*(.exceptions.entry)); - KEEP (*(.exceptions.irqtest.user)); - KEEP (*(.exceptions.irqtest)); - KEEP (*(.exceptions.irqhandler.user)); - KEEP (*(.exceptions.irqhandler)); - KEEP (*(.exceptions.irqreturn.user)); - KEEP (*(.exceptions.irqreturn)); - KEEP (*(.exceptions.notirq.label)); - KEEP (*(.exceptions.notirq.user)); - KEEP (*(.exceptions.notirq)); - KEEP (*(.exceptions.soft.user)); - KEEP (*(.exceptions.soft)); - KEEP (*(.exceptions.unknown.user)); - KEEP (*(.exceptions.unknown)); - KEEP (*(.exceptions.exit.label)); - KEEP (*(.exceptions.exit.user)); - KEEP (*(.exceptions.exit)); - KEEP (*(.exceptions)); - PROVIDE (__ram_exceptions_end = ABSOLUTE(.)); - } > onchip_memory - - PROVIDE (__flash_exceptions_start = LOADADDR(.exceptions)); - - .text : - { - /* - * All code sections are merged into the text output section, along with - * the read only data sections. - * - */ - - PROVIDE (stext = ABSOLUTE(.)); - - *(.interp) - *(.hash) - *(.dynsym) - *(.dynstr) - *(.gnu.version) - *(.gnu.version_d) - *(.gnu.version_r) - *(.rel.init) - *(.rela.init) - *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) - *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) - *(.rel.fini) - *(.rela.fini) - *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) - *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) - *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) - *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) - *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) - *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) - *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) - *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) - *(.rel.ctors) - *(.rela.ctors) - *(.rel.dtors) - *(.rela.dtors) - *(.rel.got) - *(.rela.got) - *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) - *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) - *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) - *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) - *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) - *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) - *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) - *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) - *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) - *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) - *(.rel.plt) - *(.rela.plt) - *(.rel.dyn) - - KEEP (*(.init)) - *(.plt) - *(.text .stub .text.* .gnu.linkonce.t.*) - - /* .gnu.warning sections are handled specially by elf32.em. */ - - *(.gnu.warning.*) - KEEP (*(.fini)) - PROVIDE (__etext = ABSOLUTE(.)); - PROVIDE (_etext = ABSOLUTE(.)); - PROVIDE (etext = ABSOLUTE(.)); - - *(.eh_frame_hdr) - /* Ensure the __preinit_array_start label is properly aligned. We - could instead move the label definition inside the section, but - the linker would then create the section even if it turns out to - be empty, which isn't pretty. */ - . = ALIGN(4); - PROVIDE (__preinit_array_start = ABSOLUTE(.)); - *(.preinit_array) - PROVIDE (__preinit_array_end = ABSOLUTE(.)); - PROVIDE (__init_array_start = ABSOLUTE(.)); - *(.init_array) - PROVIDE (__init_array_end = ABSOLUTE(.)); - PROVIDE (__fini_array_start = ABSOLUTE(.)); - *(.fini_array) - PROVIDE (__fini_array_end = ABSOLUTE(.)); - SORT(CONSTRUCTORS) - KEEP (*(.eh_frame)) - *(.gcc_except_table) - *(.dynamic) - PROVIDE (__CTOR_LIST__ = ABSOLUTE(.)); - KEEP (*(.ctors)) - KEEP (*(SORT(.ctors.*))) - PROVIDE (__CTOR_END__ = ABSOLUTE(.)); - PROVIDE (__DTOR_LIST__ = ABSOLUTE(.)); - KEEP (*(.dtors)) - KEEP (*(SORT(.dtors.*))) - PROVIDE (__DTOR_END__ = ABSOLUTE(.)); - KEEP (*(.jcr)) - . = ALIGN(4); - } > onchip_memory = 0x3a880100 /* Nios II NOP instruction */ - - .rodata : - { - PROVIDE (__ram_rodata_start = ABSOLUTE(.)); - . = ALIGN(4); - *(.rodata .rodata.* .gnu.linkonce.r.*) - *(.rodata1) - . = ALIGN(4); - PROVIDE (__ram_rodata_end = ABSOLUTE(.)); - } > onchip_memory - - PROVIDE (__flash_rodata_start = LOADADDR(.rodata)); - - /* - * - * This section's LMA is set to the .text region. - * crt0 will copy to this section's specified mapped region virtual memory address (VMA) - * - * .rwdata region equals the .text region, and is set to be loaded into .text region. - * This requires two copies of .rwdata in the .text region. One read writable at VMA. - * and one read-only at LMA. crt0 will copy from LMA to VMA on reset - * - */ - - .rwdata LOADADDR (.rodata) + SIZEOF (.rodata) : AT ( LOADADDR (.rodata) + SIZEOF (.rodata)+ SIZEOF (.rwdata) ) - { - PROVIDE (__ram_rwdata_start = ABSOLUTE(.)); - . = ALIGN(4); - *(.got.plt) *(.got) - *(.data1) - *(.data .data.* .gnu.linkonce.d.*) - - _gp = ABSOLUTE(. + 0x8000); - PROVIDE(gp = _gp); - - *(.rwdata .rwdata.*) - *(.sdata .sdata.* .gnu.linkonce.s.*) - *(.sdata2 .sdata2.* .gnu.linkonce.s2.*) - - . = ALIGN(4); - _edata = ABSOLUTE(.); - PROVIDE (edata = ABSOLUTE(.)); - PROVIDE (__ram_rwdata_end = ABSOLUTE(.)); - } > onchip_memory - - PROVIDE (__flash_rwdata_start = LOADADDR(.rwdata)); - - /* - * - * This section's LMA is set to the .text region. - * crt0 will copy to this section's specified mapped region virtual memory address (VMA) - * - */ - - .bss LOADADDR (.rwdata) + SIZEOF (.rwdata) : AT ( LOADADDR (.rwdata) + SIZEOF (.rwdata) ) - { - __bss_start = ABSOLUTE(.); - PROVIDE (__sbss_start = ABSOLUTE(.)); - PROVIDE (___sbss_start = ABSOLUTE(.)); - - *(.dynsbss) - *(.sbss .sbss.* .gnu.linkonce.sb.*) - *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) - *(.scommon) - - PROVIDE (__sbss_end = ABSOLUTE(.)); - PROVIDE (___sbss_end = ABSOLUTE(.)); - - *(.dynbss) - *(.bss .bss.* .gnu.linkonce.b.*) - *(COMMON) - - . = ALIGN(4); - __bss_end = ABSOLUTE(.); - } > onchip_memory - - /* - * - * One output section mapped to the associated memory device for each of - * the available memory devices. These are not used by default, but can - * be used by user applications by using the .section directive. - * - * The output section used for the heap is treated in a special way, - * i.e. the symbols "end" and "_end" are added to point to the heap start. - * - * Because alt_load() is enabled, these sections have - * their LMA set to be loaded into the .text memory region. - * However, the alt_load() code will NOT automatically copy - * these sections into their mapped memory region. - * - */ - - /* - * - * This section's LMA is set to the .text region. - * crt0 will copy to this section's specified mapped region virtual memory address (VMA) - * - */ - - .onchip_memory LOADADDR (.bss) + SIZEOF (.bss) : AT ( LOADADDR (.bss) + SIZEOF (.bss) ) - { - PROVIDE (_alt_partition_onchip_memory_start = ABSOLUTE(.)); - *(.onchip_memory. onchip_memory.*) - . = ALIGN(4); - PROVIDE (_alt_partition_onchip_memory_end = ABSOLUTE(.)); - _end = ABSOLUTE(.); - end = ABSOLUTE(.); - __alt_stack_base = ABSOLUTE(.); - } > onchip_memory - - PROVIDE (_alt_partition_onchip_memory_load_addr = LOADADDR(.onchip_memory)); - - /* - * Stabs debugging sections. - * - */ - - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - /* DWARF debug sections. - Symbols in the DWARF debugging sections are relative to the beginning - of the section so we begin them at 0. */ - /* DWARF 1 */ - .debug 0 : { *(.debug) } - .line 0 : { *(.line) } - /* GNU DWARF 1 extensions */ - .debug_srcinfo 0 : { *(.debug_srcinfo) } - .debug_sfnames 0 : { *(.debug_sfnames) } - /* DWARF 1.1 and DWARF 2 */ - .debug_aranges 0 : { *(.debug_aranges) } - .debug_pubnames 0 : { *(.debug_pubnames) } - /* DWARF 2 */ - .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_line 0 : { *(.debug_line) } - .debug_frame 0 : { *(.debug_frame) } - .debug_str 0 : { *(.debug_str) } - .debug_loc 0 : { *(.debug_loc) } - .debug_macinfo 0 : { *(.debug_macinfo) } - /* SGI/MIPS DWARF 2 extensions */ - .debug_weaknames 0 : { *(.debug_weaknames) } - .debug_funcnames 0 : { *(.debug_funcnames) } - .debug_typenames 0 : { *(.debug_typenames) } - .debug_varnames 0 : { *(.debug_varnames) } - - /* Altera debug extensions */ - .debug_alt_sim_info 0 : { *(.debug_alt_sim_info) } -} - -/* provide a pointer for the stack */ - -/* - * Don't override this, override the __alt_stack_* symbols instead. - */ -__alt_data_end = 0x1000; - -/* - * The next two symbols define the location of the default stack. You can - * override them to move the stack to a different memory. - */ -PROVIDE( __alt_stack_pointer = __alt_data_end ); -PROVIDE( __alt_stack_limit = __alt_stack_base ); - -/* - * This symbol controls where the start of the heap is. If the stack is - * contiguous with the heap then the stack will contract as memory is - * allocated to the heap. - * Override this symbol to put the heap in a different memory. - */ -PROVIDE( __alt_heap_start = end ); -PROVIDE( __alt_heap_limit = 0x1000 ); diff --git a/software/qsys_tutorial_bsp/mem_init.mk b/software/qsys_tutorial_bsp/mem_init.mk deleted file mode 100644 index 4caaef9..0000000 --- a/software/qsys_tutorial_bsp/mem_init.mk +++ /dev/null @@ -1,322 +0,0 @@ - -######################################################################### -####### M E M I N I T M A K E F I L E C O N T E N T ###### -######################################################################### - -######################################################################### -# This file is intended to be included by public.mk -# -# -# The following variables must be defined before including this file: -# - ELF -# -# The following variables may be defined to override the default behavior: -# - HDL_SIM_DIR -# - HDL_SIM_INSTALL_DIR -# - MEM_INIT_DIR -# - MEM_INIT_INSTALL_DIR -# - QUARTUS_PROJECT_DIR -# - SOPC_NAME -# - SIM_OPTIMIZE -# - RESET_ADDRESS -# -######################################################################### - -ifeq ($(MEM_INIT_FILE),) -# MEM_INIT_FILE should be set equal to the working relative path to this -# mem_init.mk makefile fragment -MEM_INIT_FILE := $(wildcard $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))) -endif - -ifeq ($(ELF2DAT),) -ELF2DAT := elf2dat -endif - -ifeq ($(ELF2HEX),) -ELF2HEX := elf2hex -endif - -ifeq ($(ELF2FLASH),) -ELF2FLASH := elf2flash -endif - -ifeq ($(FLASH2DAT),) -FLASH2DAT := flash2dat -endif - -ifeq ($(NM),) -NM := nios2-elf-nm -endif - -ifeq ($(MKDIR),) -MKDIR := mkdir -p -endif - -ifeq ($(RM),) -RM := rm -f -endif - -ifeq ($(CP),) -CP := cp -endif - -ifeq ($(ECHO),) -ECHO := echo -endif - -MEM_INIT_DIR ?= mem_init -HDL_SIM_DIR ?= $(MEM_INIT_DIR)/hdl_sim - -ifdef QUARTUS_PROJECT_DIR -MEM_INIT_INSTALL_DIR ?= $(patsubst %/,%,$(QUARTUS_PROJECT_DIR)) -ifdef SOPC_NAME -HDL_SIM_INSTALL_DIR ?= $(patsubst %/,%,$(QUARTUS_PROJECT_DIR))/$(SOPC_NAME)_sim -endif -endif - -MEM_INIT_DESCRIPTOR_FILE ?= $(MEM_INIT_DIR)/meminit.spd - -MEM_INIT_QIP_FILE ?= $(MEM_INIT_DIR)/meminit.qip - -#------------------------------------- -# Default Flash Boot Loaders -#------------------------------------- - -BOOT_LOADER_PATH ?= $(SOPC_KIT_NIOS2)/components/altera_nios2 -BOOT_LOADER_CFI ?= $(BOOT_LOADER_PATH)/boot_loader_cfi.srec -BOOT_LOADER_CFI_BE ?= $(BOOT_LOADER_PATH)/boot_loader_cfi_be.srec - - -#------------------------------------- -# Default Target -#------------------------------------- - -.PHONY: default_mem_init -ifeq ($(QSYS),1) -default_mem_init: mem_init_generate -else -default_mem_init: mem_init_install -endif -#------------------------------------- -# Runtime Macros -#------------------------------------- - -define post-process-info - @echo Post-processing to create $@... -endef - -target_stem = $(notdir $(basename $@)) - -mem_start_address = $($(target_stem)_START) -mem_end_address = $($(target_stem)_END) -mem_width = $($(target_stem)_WIDTH) -mem_endianness = $($(target_stem)_ENDIANNESS) -mem_create_lanes = $($(target_stem)_CREATE_LANES) - -mem_pad_flag = $($(target_stem)_PAD_FLAG) -mem_reloc_input_flag = $($(target_stem)_RELOC_INPUT_FLAG) -mem_no_zero_fill_flag = $($(target_stem)_NO_ZERO_FILL_FLAG) - -flash_mem_epcs_flag = $($(target_stem)_EPCS_FLAGS) -flash_mem_cfi_flag = $($(target_stem)_CFI_FLAGS) -flash_mem_boot_loader_flag = $($(target_stem)_BOOT_LOADER_FLAG) - -elf2dat_extra_args = $(mem_pad_flag) -elf2hex_extra_args = $(mem_no_zero_fill_flag) -elf2flash_extra_args = $(flash_mem_cfi_flag) $(flash_mem_epcs_flag) $(flash_mem_boot_loader_flag) -flash2dat_extra_args = $(mem_pad_flag) $(mem_reloc_input_flag) - -#------------------------------------------------------------------------------ -# BSP SPECIFIC CONTENT -# -# The content below is controlled by the BSP and SOPC System -#------------------------------------------------------------------------------ -#START OF BSP SPECIFIC - -#------------------------------------- -# Global Settings -#------------------------------------- - - -# The following TYPE comment allows tools to identify the 'type' of target this -# makefile is associated with. -# TYPE: BSP_MEMINIT_MAKEFILE - -# This following VERSION comment indicates the version of the tool used to -# generate this makefile. A makefile variable is provided for VERSION as well. -# ACDS_VERSION: 13.0sp1 -ACDS_VERSION := 13.0sp1 - -# This following BUILD_NUMBER comment indicates the build number of the tool -# used to generate this makefile. -# BUILD_NUMBER: 232 - -# Optimize for simulation -SIM_OPTIMIZE ?= 0 - -# The CPU reset address as needed by elf2flash -RESET_ADDRESS ?= 0x00000000 - -#------------------------------------- -# Pre-Initialized Memory Descriptions -#------------------------------------- - -# Memory: onchip_memory -MEM_0 := nios_system_onchip_memory -$(MEM_0)_NAME := onchip_memory -$(MEM_0)_MEM_INIT_FILE_PARAM_NAME := INIT_FILE -HEX_FILES += $(MEM_INIT_DIR)/$(MEM_0).hex -MEM_INIT_INSTALL_FILES += $(MEM_INIT_INSTALL_DIR)/$(MEM_0).hex -DAT_FILES += $(HDL_SIM_DIR)/$(MEM_0).dat -HDL_SIM_INSTALL_FILES += $(HDL_SIM_INSTALL_DIR)/$(MEM_0).dat -SYM_FILES += $(HDL_SIM_DIR)/$(MEM_0).sym -HDL_SIM_INSTALL_FILES += $(HDL_SIM_INSTALL_DIR)/$(MEM_0).sym -$(MEM_0)_START := 0x00000000 -$(MEM_0)_END := 0x00000fff -$(MEM_0)_HIERARCHICAL_PATH := onchip_memory -$(MEM_0)_WIDTH := 32 -$(MEM_0)_ENDIANNESS := --little-endian-mem -$(MEM_0)_CREATE_LANES := 0 - -.PHONY: onchip_memory -onchip_memory: check_elf_exists $(MEM_INIT_DIR)/$(MEM_0).hex $(HDL_SIM_DIR)/$(MEM_0).dat $(HDL_SIM_DIR)/$(MEM_0).sym - - -#END OF BSP SPECIFIC - -#------------------------------------- -# Pre-Initialized Memory Targets -#------------------------------------- - -.PHONY: mem_init_install mem_init_generate mem_init_clean - -ifeq ($(QSYS),1) -# Target mem_init_install is deprecated for QSys based systems -# To initialize onchip memories for Quartus II Synthesis with Qsys based systems: -# 1) Use "make mem_init_genearate" -# 2) Add the generated mem_init/meminit.qip file to your Quartus II Project -# -mem_init_install: - $(error Deprecated Makefile Target: '$@'. Use target 'mem_init_generate' and then add $(MEM_INIT_QIP_FILE) to your Quartus II Project) - -else # QSYS != 1, if SopcBuilder based system - -ifneq ($(MEM_INIT_INSTALL_DIR),) -mem_init_install: $(MEM_INIT_INSTALL_FILES) -endif - -ifneq ($(HDL_SIM_INSTALL_DIR),) -mem_init_install: $(HDL_SIM_INSTALL_FILES) -endif - -mem_init_install: mem_init_generate -ifeq ($(MEM_INIT_INSTALL_DIR),) - @echo "WARNING: MEM_INIT_INSTALL_DIR not set. Set your QUARTUS_PROJECT_DIR environment variable." -endif -ifeq ($(HDL_SIM_INSTALL_DIR),) - @echo "WARNING: HDL_SIM_INSTALL_DIR not set. Set your QUARTUS_PROJECT_DIR and SOPC_NAME environment variable." -endif - -$(MEM_INIT_INSTALL_FILES): $(MEM_INIT_INSTALL_DIR)/%: $(MEM_INIT_DIR)/% - @$(MKDIR) $(@D) - @$(CP) -v $< $@ - -$(HDL_SIM_INSTALL_FILES): $(HDL_SIM_INSTALL_DIR)/%: $(HDL_SIM_DIR)/% - @$(MKDIR) $(@D) - @$(CP) -v $< $@ - -endif # QSYS == 1 - - -mem_init_generate: hex dat sym flash $(MEM_INIT_DESCRIPTOR_FILE) $(MEM_INIT_QIP_FILE) - -mem_init_clean: - @$(RM) -r $(MEM_INIT_DIR) $(HDL_SIM_DIR) $(FLASH_FILES) - -.PHONY: hex dat sym flash - -hex: check_elf_exists $(HEX_FILES) - -dat: check_elf_exists $(DAT_FILES) - -sym: check_elf_exists $(SYM_FILES) - -flash: check_elf_exists $(FLASH_FILES) - -#------------------------------------- -# Pre-Initialized Memory Rules -#------------------------------------- - -.PHONY: check_elf_exists -check_elf_exists: $(ELF) -ifeq ($(ELF),) - $(error ELF var not set in mem_init.mk) -endif - -$(filter-out $(FLASH_DAT_FILES),$(DAT_FILES)): %.dat: $(ELF) - $(post-process-info) - @$(MKDIR) $(@D) - bash -c '$(ELF2DAT) --infile=$< --outfile=$@ \ - --base=$(mem_start_address) --end=$(mem_end_address) --width=$(mem_width) \ - $(mem_endianness) --create-lanes=$(mem_create_lanes) $(elf2dat_extra_args)' - -$(foreach i,0 1 2 3 4 5 6 7,%_lane$(i).dat): %.dat - @true - -$(HEX_FILES): %.hex: $(ELF) - $(post-process-info) - @$(MKDIR) $(@D) - bash -c '$(ELF2HEX) $< $(mem_start_address) $(mem_end_address) --width=$(mem_width) \ - $(mem_endianness) --create-lanes=$(mem_create_lanes) $(elf2hex_extra_args) $@' - -$(SYM_FILES): %.sym: $(ELF) - $(post-process-info) - @$(MKDIR) $(@D) - $(NM) -n $< > $@ - -$(FLASH_FILES): %.flash: $(ELF) - $(post-process-info) - @$(MKDIR) $(@D) - bash -c '$(ELF2FLASH) --input=$< --outfile=$@ --sim_optimize=$(SIM_OPTIMIZE) $(mem_endianness) \ - $(elf2flash_extra_args)' - -# -# Function generate_spd_entry -# Arg1: path to the memory initialization file -# Arg2: Type HEX or DAT -# Arg3: Output spd file to append -gen_spd_entry.BASE_FILE = $(basename $(notdir $1)) -gen_spd_entry.PARAM_NAME = $($(gen_spd_entry.BASE_FILE)_MEM_INIT_FILE_PARAM_NAME) -gen_spd_entry.MEM_PATH = $($(gen_spd_entry.BASE_FILE)_HIERARCHICAL_PATH) -gen_spd_entry.SETTINGS = $(strip \ - path=\"$1\" \ - type=\"$2\" \ - $(if $(gen_spd_entry.PARAM_NAME),initParamName=\"$(gen_spd_entry.PARAM_NAME)\") \ - $(if $(gen_spd_entry.MEM_PATH),memoryPath=\"$(gen_spd_entry.MEM_PATH)\") \ -) -define gen_spd_entry -$(ECHO) "" >> $3 -endef - -$(MEM_INIT_DESCRIPTOR_FILE).DAT_FILESET := $(patsubst $(dir $(MEM_INIT_DESCRIPTOR_FILE))%,%,$(DAT_FILES)) -$(MEM_INIT_DESCRIPTOR_FILE).HEX_FILESET := $(patsubst $(dir $(MEM_INIT_DESCRIPTOR_FILE))%,%,$(HEX_FILES)) - -$(MEM_INIT_DESCRIPTOR_FILE): %.spd: $(MEM_INIT_FILE) - $(post-process-info) - @$(MKDIR) $(@D) - @$(RM) $@ - @$(ECHO) "" > $@ - @$(ECHO) "" >> $@ - @$(foreach dat_file,$($@.DAT_FILESET),$(call gen_spd_entry,$(dat_file),DAT,$@) &&)true - @$(foreach hex_file,$($@.HEX_FILESET),$(call gen_spd_entry,$(hex_file),HEX,$@) &&)true - @$(ECHO) "" >> $@ - -.DELETE_ON_ERROR: $(MEM_INIT_DESCRIPTOR_FILE) - -$(MEM_INIT_QIP_FILE): %.qip: $(MEM_INIT_FILE) - $(post-process-info) - @$(MKDIR) $(@D) - @$(RM) $@ - @$(ECHO) "set_global_assignment -name SEARCH_PATH $$::quartus(qip_path)" > $@ - -.DELETE_ON_ERROR: $(MEM_INIT_QIP_FILE) diff --git a/software/qsys_tutorial_bsp/memory.gdb b/software/qsys_tutorial_bsp/memory.gdb deleted file mode 100644 index ca9dafc..0000000 --- a/software/qsys_tutorial_bsp/memory.gdb +++ /dev/null @@ -1,50 +0,0 @@ -# memory.gdb - GDB memory region definitions -# -# Machine generated for CPU 'nios2_processor' in SOPC Builder design 'nios_system' -# SOPC Builder design path: C:/Users/takayun/Desktop/qsys_tutorial/nios_system.sopcinfo -# -# Generated: Thu Oct 13 17:08:43 JST 2016 - -# DO NOT MODIFY THIS FILE -# -# Changing this file will have subtle consequences -# which will almost certainly lead to a nonfunctioning -# system. If you do modify this file, be aware that your -# changes will be overwritten and lost when this file -# is generated again. -# -# DO NOT MODIFY THIS FILE - -# License Agreement -# -# Copyright (c) 2008 -# Altera Corporation, San Jose, California, USA. -# All rights reserved. -# -# 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. -# -# This agreement shall be governed in all respects by the laws of the State -# of California and by the laws of the United States of America. - -# Define memory regions for each memory connected to the CPU. -# The cache attribute is specified which improves GDB performance -# by allowing GDB to cache memory contents on the host. - -# onchip_memory -memory 0x0 0x1000 cache diff --git a/software/qsys_tutorial_bsp/public.mk b/software/qsys_tutorial_bsp/public.mk deleted file mode 100644 index 12f8c43..0000000 --- a/software/qsys_tutorial_bsp/public.mk +++ /dev/null @@ -1,377 +0,0 @@ -#------------------------------------------------------------------------------ -# BSP "PUBLIC" MAKEFILE CONTENT -# -# This file is intended to be included in an application or library -# Makefile that is using this BSP. You can create such a Makefile with -# the nios2-app-generate-makefile or nios2-lib-generate-makefile -# commands. -# -# The following variables must be defined before including this file: -# -# ALT_LIBRARY_ROOT_DIR -# Contains the path to the BSP top-level (aka root) directory -#------------------------------------------------------------------------------ - -#------------------------------------------------------------------------------ -# PATHS -#------------------------------------------------------------------------------ - - - -# Path to the provided linker script. -BSP_LINKER_SCRIPT := $(ALT_LIBRARY_ROOT_DIR)/linker.x - -# Include paths: -# The path to root of all header files that a library wishes to make -# available for an application's use is specified here. Note that this -# may not be *all* folders within a hierarchy. For example, if it is -# desired that the application developer type: -# #include -# #include -# With files laid out like this: -# /inc/sockets.h -# /inc/ip/tcpip.h -# -# Then, only /inc need be added to the list of include -# directories. Alternatively, if you wish to be able to directly include -# all files in a hierarchy, separate paths to each folder in that -# hierarchy must be defined. - -# The following are the "base" set of include paths for a BSP. -# These paths are appended to the list that individual software -# components, drivers, etc., add in the generated portion of this -# file (below). -ALT_INCLUDE_DIRS_TO_APPEND += \ - $(ALT_LIBRARY_ROOT_DIR) \ - $(ALT_LIBRARY_ROOT_DIR)/drivers/inc - -# Additions to linker library search-path: -# Here we provide a path to "our self" for the application to construct a -# "-L " out of. This should contain a list of directories, -# relative to the library root, of all directories with .a files to link -# against. -ALT_LIBRARY_DIRS += $(ALT_LIBRARY_ROOT_DIR) - - -#------------------------------------------------------------------------------ -# COMPILATION FLAGS -#------------------------------------------------------------------------------ -# Default C pre-processor flags for a BSP: -ALT_CPPFLAGS += -DSYSTEM_BUS_WIDTH=32 \ - -pipe - - -#------------------------------------------------------------------------------ -# MANAGED CONTENT -# -# All content between the lines "START MANAGED" and "END MANAGED" below is -# generated based on variables in the BSP settings file when the -# nios2-bsp-generate-files command is invoked. If you wish to persist any -# information pertaining to the build process, it is recomended that you -# utilize the BSP settings mechanism to do so. -#------------------------------------------------------------------------------ -#START MANAGED - -# The following TYPE comment allows tools to identify the 'type' of target this -# makefile is associated with. -# TYPE: BSP_PUBLIC_MAKEFILE - -# This following VERSION comment indicates the version of the tool used to -# generate this makefile. A makefile variable is provided for VERSION as well. -# ACDS_VERSION: 13.0sp1 -ACDS_VERSION := 13.0sp1 - -# This following BUILD_NUMBER comment indicates the build number of the tool -# used to generate this makefile. -# BUILD_NUMBER: 232 - -# Qsys--generated SOPCINFO file. Required for resolving node instance ID's with -# design component names. -SOPCINFO_FILE := C:/Users/takayun/Desktop/qsys_tutorial/nios_system.sopcinfo - -# Big-Endian operation. -# setting BIG_ENDIAN is false -ALT_CFLAGS += -EL - -# Path to the provided C language runtime initialization code. -BSP_CRT0 := $(ALT_LIBRARY_ROOT_DIR)/obj/HAL/src/crt0.o - -# Name of BSP library as provided to linker using the "-msys-lib" flag or -# linker script GROUP command. -# setting BSP_SYS_LIB is hal_bsp -BSP_SYS_LIB := hal_bsp -ELF_PATCH_FLAG += --thread_model hal - -# Type identifier of the BSP library -# setting BSP_TYPE is hal -ALT_CPPFLAGS += -D__hal__ -BSP_TYPE := hal - -# CPU Name -# setting CPU_NAME is nios2_processor -CPU_NAME = nios2_processor -ELF_PATCH_FLAG += --cpu_name $(CPU_NAME) - -# Hardware Divider present. -# setting HARDWARE_DIVIDE is false -ALT_CFLAGS += -mno-hw-div - -# Hardware Multiplier present. -# setting HARDWARE_MULTIPLY is false -ALT_CFLAGS += -mno-hw-mul - -# Hardware Mulx present. -# setting HARDWARE_MULX is false -ALT_CFLAGS += -mno-hw-mulx - -# Debug Core present. -# setting HAS_DEBUG_CORE is true -CPU_HAS_DEBUG_CORE = 1 - -# Qsys generated design -# setting QSYS is 1 -QSYS := 1 -ELF_PATCH_FLAG += --qsys true - -# Design Name -# setting SOPC_NAME is nios_system -SOPC_NAME := nios_system - -# SopcBuilder Simulation Enabled -# setting SOPC_SIMULATION_ENABLED is false -ELF_PATCH_FLAG += --simulation_enabled false - -# Enable JTAG UART driver to recover when host is inactive causing buffer to -# full without returning error. Printf will not fail with this recovery. none -# setting altera_avalon_jtag_uart_driver.enable_jtag_uart_ignore_fifo_full_error is false - -# Small-footprint (polled mode) driver none -# setting altera_avalon_jtag_uart_driver.enable_small_driver is false - -# Build a custom version of newlib with the specified space-separated compiler -# flags. The custom newlib build will be placed in the <bsp root>/newlib -# directory, and will be used only for applications that utilize this BSP. -# setting hal.custom_newlib_flags is none - -# Enable support for a subset of the C++ language. This option increases code -# footprint by adding support for C++ constructors. Certain features, such as -# multiple inheritance and exceptions are not supported. If false, adds -# -DALT_NO_C_PLUS_PLUS to ALT_CPPFLAGS in public.mk, and reduces code -# footprint. none -# setting hal.enable_c_plus_plus is true - -# When your application exits, close file descriptors, call C++ destructors, -# etc. Code footprint can be reduced by disabling clean exit. If disabled, adds -# -DALT_NO_CLEAN_EXIT to ALT_CPPFLAGS and -Wl,--defsym, exit=_exit to -# ALT_LDFLAGS in public.mk. none -# setting hal.enable_clean_exit is true - -# Add exit() support. This option increases code footprint if your "main()" -# routine does "return" or call "exit()". If false, adds -DALT_NO_EXIT to -# ALT_CPPFLAGS in public.mk, and reduces footprint none -# setting hal.enable_exit is true - -# Causes code to be compiled with gprof profiling enabled and the application -# ELF to be linked with the GPROF library. If true, adds -DALT_PROVIDE_GMON to -# ALT_CPPFLAGS and -pg to ALT_CFLAGS in public.mk. none -# setting hal.enable_gprof is false - -# Enables lightweight device driver API. This reduces code and data footprint -# by removing the HAL layer that maps device names (e.g. /dev/uart0) to file -# descriptors. Instead, driver routines are called directly. The open(), -# close(), and lseek() routines will always fail if called. The read(), -# write(), fstat(), ioctl(), and isatty() routines only work for the stdio -# devices. If true, adds -DALT_USE_DIRECT_DRIVERS to ALT_CPPFLAGS in public.mk. -# The Altera Host and read-only ZIP file systems can't be used if -# hal.enable_lightweight_device_driver_api is true. -# setting hal.enable_lightweight_device_driver_api is false - -# Adds code to emulate multiply and divide instructions in case they are -# executed but aren't present in the CPU. Normally this isn't required because -# the compiler won't use multiply and divide instructions that aren't present -# in the CPU. If false, adds -DALT_NO_INSTRUCTION_EMULATION to ALT_CPPFLAGS in -# public.mk. none -# setting hal.enable_mul_div_emulation is false -ALT_CPPFLAGS += -DALT_NO_INSTRUCTION_EMULATION - -# Certain drivers are compiled with reduced functionality to reduce code -# footprint. Not all drivers observe this setting. The altera_avalon_uart and -# altera_avalon_jtag_uart drivers switch from interrupt-driven to polled -# operation. CAUTION: Several device drivers are disabled entirely. These -# include the altera_avalon_cfi_flash, altera_avalon_epcs_flash_controller, and -# altera_avalon_lcd_16207 drivers. This can result in certain API (HAL flash -# access routines) to fail. You can define a symbol provided by each driver to -# prevent it from being removed. If true, adds -DALT_USE_SMALL_DRIVERS to -# ALT_CPPFLAGS in public.mk. none -# setting hal.enable_reduced_device_drivers is false - -# Turns on HAL runtime stack checking feature. Enabling this setting causes -# additional code to be placed into each subroutine call to generate an -# exception if a stack collision occurs with the heap or statically allocated -# data. If true, adds -DALT_STACK_CHECK and -mstack-check to ALT_CPPFLAGS in -# public.mk. none -# setting hal.enable_runtime_stack_checking is false - -# The BSP is compiled with optimizations to speedup HDL simulation such as -# initializing the cache, clearing the .bss section, and skipping long delay -# loops. If true, adds -DALT_SIM_OPTIMIZE to ALT_CPPFLAGS in public.mk. When -# this setting is true, the BSP shouldn't be used to build applications that -# are expected to run real hardware. -# setting hal.enable_sim_optimize is false - -# Causes the small newlib (C library) to be used. This reduces code and data -# footprint at the expense of reduced functionality. Several newlib features -# are removed such as floating-point support in printf(), stdin input routines, -# and buffered I/O. The small C library is not compatible with Micrium -# MicroC/OS-II. If true, adds -msmallc to ALT_LDFLAGS in public.mk. none -# setting hal.enable_small_c_library is false - -# Enable SOPC Builder System ID. If a System ID SOPC Builder component is -# connected to the CPU associated with this BSP, it will be enabled in the -# creation of command-line arguments to download an ELF to the target. -# Otherwise, system ID and timestamp values are left out of public.mk for -# application Makefile "download-elf" target definition. With the system ID -# check disabled, the Nios II EDS tools will not automatically ensure that the -# application .elf file (and BSP it is linked against) corresponds to the -# hardware design on the target. If false, adds --accept-bad-sysid to -# SOPC_SYSID_FLAG in public.mk. none -# setting hal.enable_sopc_sysid_check is true - -# Enable BSP generation to query if SOPC system is big endian. If true ignores -# export of 'ALT_CFLAGS += -EB' to public.mk if big endian system. If true -# ignores export of 'ALT_CFLAGS += -EL' if little endian system. none -# setting hal.make.ignore_system_derived.big_endian is false - -# Enable BSP generation to query if SOPC system has a debug core present. If -# true ignores export of 'CPU_HAS_DEBUG_CORE = 1' to public.mk if a debug core -# is found in the system. If true ignores export of 'CPU_HAS_DEBUG_CORE = 0' if -# no debug core is found in the system. none -# setting hal.make.ignore_system_derived.debug_core_present is false - -# Enable BSP generation to query if SOPC system has FPU present. If true -# ignores export of 'ALT_CFLAGS += -mhard-float' to public.mk if FPU is found -# in the system. If true ignores export of 'ALT_CFLAGS += -mhard-soft' if FPU -# is not found in the system. none -# setting hal.make.ignore_system_derived.fpu_present is false - -# Enable BSP generation to query if SOPC system has hardware divide present. If -# true ignores export of 'ALT_CFLAGS += -mno-hw-div' to public.mk if no -# division is found in system. If true ignores export of 'ALT_CFLAGS += -# -mhw-div' if division is found in the system. none -# setting hal.make.ignore_system_derived.hardware_divide_present is false - -# Enable BSP generation to query if SOPC system floating point custom -# instruction with a divider is present. If true ignores export of 'ALT_CFLAGS -# += -mcustom-fpu-cfg=60-2' and 'ALT_LDFLAGS += -mcustom-fpu-cfg=60-2' to -# public.mk if the custom instruction is found in the system. none -# setting hal.make.ignore_system_derived.hardware_fp_cust_inst_divider_present is false - -# Enable BSP generation to query if SOPC system floating point custom -# instruction without a divider is present. If true ignores export of -# 'ALT_CFLAGS += -mcustom-fpu-cfg=60-1' and 'ALT_LDFLAGS += -# -mcustom-fpu-cfg=60-1' to public.mk if the custom instruction is found in the -# system. none -# setting hal.make.ignore_system_derived.hardware_fp_cust_inst_no_divider_present is false - -# Enable BSP generation to query if SOPC system has multiplier present. If true -# ignores export of 'ALT_CFLAGS += -mno-hw-mul' to public.mk if no multiplier -# is found in the system. If true ignores export of 'ALT_CFLAGS += -mhw-mul' if -# multiplier is found in the system. none -# setting hal.make.ignore_system_derived.hardware_multiplier_present is false - -# Enable BSP generation to query if SOPC system has hardware mulx present. If -# true ignores export of 'ALT_CFLAGS += -mno-hw-mulx' to public.mk if no mulx -# is found in the system. If true ignores export of 'ALT_CFLAGS += -mhw-mulx' -# if mulx is found in the system. none -# setting hal.make.ignore_system_derived.hardware_mulx_present is false - -# Enable BSP generation to query if SOPC system has simulation enabled. If true -# ignores export of 'ELF_PATCH_FLAG += --simulation_enabled' to public.mk. none -# setting hal.make.ignore_system_derived.sopc_simulation_enabled is false - -# Enable BSP generation to query SOPC system for system ID base address. If -# true ignores export of 'SOPC_SYSID_FLAG += --sidp=
' and -# 'ELF_PATCH_FLAG += --sidp=
' to public.mk. none -# setting hal.make.ignore_system_derived.sopc_system_base_address is false - -# Enable BSP generation to query SOPC system for system ID. If true ignores -# export of 'SOPC_SYSID_FLAG += --id=' and 'ELF_PATCH_FLAG += -# --id=' to public.mk. none -# setting hal.make.ignore_system_derived.sopc_system_id is false - -# Enable BSP generation to query SOPC system for system timestamp. If true -# ignores export of 'SOPC_SYSID_FLAG += --timestamp=' and -# 'ELF_PATCH_FLAG += --timestamp=' to public.mk. none -# setting hal.make.ignore_system_derived.sopc_system_timestamp is false - -# Slave descriptor of STDERR character-mode device. This setting is used by the -# ALT_STDERR family of defines in system.h. none -# setting hal.stderr is jtag_uart -ELF_PATCH_FLAG += --stderr_dev jtag_uart - -# Slave descriptor of STDIN character-mode device. This setting is used by the -# ALT_STDIN family of defines in system.h. none -# setting hal.stdin is jtag_uart -ELF_PATCH_FLAG += --stdin_dev jtag_uart - -# Slave descriptor of STDOUT character-mode device. This setting is used by the -# ALT_STDOUT family of defines in system.h. none -# setting hal.stdout is jtag_uart -ELF_PATCH_FLAG += --stdout_dev jtag_uart - - -#------------------------------------------------------------------------------ -# SOFTWARE COMPONENT & DRIVER INCLUDE PATHS -#------------------------------------------------------------------------------ - -ALT_INCLUDE_DIRS += $(ALT_LIBRARY_ROOT_DIR)/HAL/inc - -#------------------------------------------------------------------------------ -# SOFTWARE COMPONENT & DRIVER PRODUCED ALT_CPPFLAGS ADDITIONS -#------------------------------------------------------------------------------ - -ALT_CPPFLAGS += -DALT_SINGLE_THREADED - -#END MANAGED - - -#------------------------------------------------------------------------------ -# LIBRARY INFORMATION -#------------------------------------------------------------------------------ -# Assemble the name of the BSP *.a file using the BSP library name -# (BSP_SYS_LIB) in generated content above. -BSP_LIB := lib$(BSP_SYS_LIB).a - -# Additional libraries to link against: -# An application including this file will prefix each library with "-l". -# For example, to include the Newlib math library "m" is included, which -# becomes "-lm" when linking the application. -ALT_LIBRARY_NAMES += m - -# Additions to linker dependencies: -# An application Makefile will typically add these directly to the list -# of dependencies required to build the executable target(s). The BSP -# library (*.a) file is specified here. -ALT_LDDEPS += $(ALT_LIBRARY_ROOT_DIR)/$(BSP_LIB) - -# Is this library "Makeable"? -# Add to list of root library directories that support running 'make' -# to build them. Because libraries may or may not have a Makefile in their -# root, appending to this variable tells an application to run 'make' in -# the library root to build/update this library. -MAKEABLE_LIBRARY_ROOT_DIRS += $(ALT_LIBRARY_ROOT_DIR) - -# Additional Assembler Flags -# -gdwarf2 flag is required for stepping through assembly code -ALT_ASFLAGS += -gdwarf2 - -#------------------------------------------------------------------------------ -# FINAL INCLUDE PATH LIST -#------------------------------------------------------------------------------ -# Append static include paths to paths specified by OS/driver/sw package -# additions to the BSP thus giving them precedence in case a BSP addition -# is attempting to override BSP sources. -ALT_INCLUDE_DIRS += $(ALT_INCLUDE_DIRS_TO_APPEND) - - - diff --git a/software/qsys_tutorial_bsp/settings.bsp b/software/qsys_tutorial_bsp/settings.bsp deleted file mode 100644 index f23ed4a..0000000 --- a/software/qsys_tutorial_bsp/settings.bsp +++ /dev/null @@ -1,913 +0,0 @@ - - - hal - default - 2016/10/13 17:08:42 - 1476346122316 - C:\Users\takayun\Desktop\qsys_tutorial\software\qsys_tutorial_bsp - .\settings.bsp - C:\Users\takayun\Desktop\qsys_tutorial\nios_system.sopcinfo - default - nios2_processor - 1.9 - - hal.sys_clk_timer - ALT_SYS_CLK - UnquotedString - none - none - system_h_define - Slave descriptor of the system clock timer device. This device provides a periodic interrupt ("tick") and is typically required for RTOS use. This setting defines the value of ALT_SYS_CLK in system.h. - none - false - common - - - hal.timestamp_timer - ALT_TIMESTAMP_CLK - UnquotedString - none - none - system_h_define - Slave descriptor of timestamp timer device. This device is used by Altera HAL timestamp drivers for high-resolution time measurement. This setting defines the value of ALT_TIMESTAMP_CLK in system.h. - none - false - common - - - hal.max_file_descriptors - ALT_MAX_FD - DecimalNumber - 32 - 32 - system_h_define - Determines the number of file descriptors statically allocated. This setting defines the value of ALT_MAX_FD in system.h. - If hal.enable_lightweight_device_driver_api is true, there are no file descriptors so this setting is ignored. If hal.enable_lightweight_device_driver_api is false, this setting must be at least 4 because HAL needs a file descriptor for /dev/null, /dev/stdin, /dev/stdout, and /dev/stderr. - false - - - - hal.enable_instruction_related_exceptions_api - ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API - BooleanDefineOnly - false - false - system_h_define - Enables API for registering handlers to service instruction-related exceptions. Enabling this setting increases the size of the exception entry code. - These exception types can be generated if various processor options are enabled, such as the MMU, MPU, or other advanced exception types. - false - - - - hal.linker.allow_code_at_reset - ALT_ALLOW_CODE_AT_RESET - Boolean - 1 - 0 - none - Indicates if initialization code is allowed at the reset address. If true, defines the macro ALT_ALLOW_CODE_AT_RESET in linker.h. - If true, defines the macro ALT_ALLOW_CODE_AT_RESET in linker.h. This setting is typically false if an external bootloader (e.g. flash bootloader) is present. - false - - - - hal.linker.enable_alt_load - NONE - Boolean - 1 - 0 - none - Enables the alt_load() facility. The alt_load() facility copies sections from the .text memory into RAM. If true, this setting sets up the VMA/LMA of sections in linker.x to allow them to be loaded into the .text memory. - This setting is typically false if an external bootloader (e.g. flash bootloader) is present. - false - - - - hal.linker.enable_alt_load_copy_rodata - NONE - Boolean - 0 - 0 - none - Causes the alt_load() facility to copy the .rodata section. If true, this setting defines the macro ALT_LOAD_COPY_RODATA in linker.h. - none - false - - - - hal.linker.enable_alt_load_copy_rwdata - NONE - Boolean - 1 - 0 - none - Causes the alt_load() facility to copy the .rwdata section. If true, this setting defines the macro ALT_LOAD_COPY_RWDATA in linker.h. - none - false - - - - hal.linker.enable_alt_load_copy_exceptions - NONE - Boolean - 0 - 0 - none - Causes the alt_load() facility to copy the .exceptions section. If true, this setting defines the macro ALT_LOAD_COPY_EXCEPTIONS in linker.h. - none - false - - - - hal.linker.enable_exception_stack - NONE - Boolean - 0 - 0 - none - Enables use of a separate exception stack. If true, defines the macro ALT_EXCEPTION_STACK in linker.h, adds a memory region called exception_stack to linker.x, and provides the symbols __alt_exception_stack_pointer and __alt_exception_stack_limit in linker.x. - The hal.linker.exception_stack_size and hal.linker.exception_stack_memory_region_name settings must also be valid. This setting must be false for MicroC/OS-II BSPs. The exception stack can be used to improve interrupt and other exception performance if the EIC is *not* used. - false - common - - - hal.linker.exception_stack_size - NONE - DecimalNumber - 1024 - 1024 - none - Size of the exception stack in bytes. - Only used if hal.linker.enable_exception_stack is true. - false - common - - - hal.linker.exception_stack_memory_region_name - NONE - UnquotedString - onchip_memory - none - none - Name of the existing memory region that will be divided up to create the 'exception_stack' memory region. The selected region name will be adjusted automatically when the BSP is generated to create the 'exception_stack' memory region. - Only used if hal.linker.enable_exception_stack is true. - false - common - - - hal.linker.enable_interrupt_stack - NONE - Boolean - 0 - 0 - none - Enables use of a separate interrupt stack. If true, defines the macro ALT_INTERRUPT_STACK in linker.h, adds a memory region called interrupt_stack to linker.x, and provides the symbols __alt_interrupt_stack_pointer and __alt_interrupt_stack_limit in linker.x. - The hal.linker.interrupt_stack_size and hal.linker.interrupt_stack_memory_region_name settings must also be valid. This setting must be false for MicroC/OS-II BSPs. Only enable if the EIC is used exclusively. The exception stack can be used to improve interrupt and other exception performance if the EIC is *not* used. - false - common - - - hal.linker.interrupt_stack_size - NONE - DecimalNumber - 1024 - 1024 - none - Size of the interrupt stack in bytes. - Only used if hal.linker.enable_interrupt_stack is true. - false - common - - - hal.linker.interrupt_stack_memory_region_name - NONE - UnquotedString - onchip_memory - none - none - Name of the existing memory region that will be divided up to create the 'interrupt_stack' memory region. The selected region name will be adjusted automatically when the BSP is generated to create the 'interrupt_stack' memory region. - Only used if hal.linker.enable_interrupt_stack is true. - false - common - - - hal.stdin - NONE - UnquotedString - jtag_uart - none - system_h_define - Slave descriptor of STDIN character-mode device. This setting is used by the ALT_STDIN family of defines in system.h. - none - false - common - - - hal.stdout - NONE - UnquotedString - jtag_uart - none - system_h_define - Slave descriptor of STDOUT character-mode device. This setting is used by the ALT_STDOUT family of defines in system.h. - none - false - common - - - hal.stderr - NONE - UnquotedString - jtag_uart - none - system_h_define - Slave descriptor of STDERR character-mode device. This setting is used by the ALT_STDERR family of defines in system.h. - none - false - common - - - hal.log_port - NONE - UnquotedString - none - none - public_mk_define - Slave descriptor of debug logging character-mode device. If defined, it enables extra debug messages in the HAL source. This setting is used by the ALT_LOG_PORT family of defines in system.h. - none - false - none - - - hal.make.build_pre_process - BUILD_PRE_PROCESS - UnquotedString - none - none - makefile_variable - Command executed before BSP built. - none - false - none - - - hal.make.ar_pre_process - AR_PRE_PROCESS - UnquotedString - none - none - makefile_variable - Command executed before archiver execution. - none - false - none - - - hal.make.bsp_cflags_defined_symbols - BSP_CFLAGS_DEFINED_SYMBOLS - UnquotedString - none - none - makefile_variable - Preprocessor macros to define. A macro definition in this setting has the same effect as a "#define" in source code. Adding "-DALT_DEBUG" to this setting has the same effect as "#define ALT_DEBUG" in a souce file. Adding "-DFOO=1" to this setting is equivalent to the macro "#define FOO 1" in a source file. Macros defined with this setting are applied to all .S, .c, and C++ files in the BSP. This setting defines the value of BSP_CFLAGS_DEFINED_SYMBOLS in the BSP Makefile. - none - false - none - - - hal.make.ar_post_process - AR_POST_PROCESS - UnquotedString - none - none - makefile_variable - Command executed after archiver execution. - none - false - none - - - hal.make.as - AS - UnquotedString - nios2-elf-gcc - nios2-elf-gcc - makefile_variable - Assembler command. Note that CC is used for .S files. - none - false - none - - - hal.make.build_post_process - BUILD_POST_PROCESS - UnquotedString - none - none - makefile_variable - Command executed after BSP built. - none - false - none - - - hal.make.bsp_cflags_debug - BSP_CFLAGS_DEBUG - UnquotedString - -g - -g - makefile_variable - C/C++ compiler debug level. '-g' provides the default set of debug symbols typically required to debug a typical application. Omitting '-g' removes debug symbols from the ELF. This setting defines the value of BSP_CFLAGS_DEBUG in Makefile. - none - false - common - - - hal.make.ar - AR - UnquotedString - nios2-elf-ar - nios2-elf-ar - makefile_variable - Archiver command. Creates library files. - none - false - none - - - hal.make.rm - RM - UnquotedString - rm -f - rm -f - makefile_variable - Command used to remove files during 'clean' target. - none - false - none - - - hal.make.cxx_pre_process - CXX_PRE_PROCESS - UnquotedString - none - none - makefile_variable - Command executed before each C++ file is compiled. - none - false - none - - - hal.make.bsp_cflags_warnings - BSP_CFLAGS_WARNINGS - UnquotedString - -Wall - -Wall - makefile_variable - C/C++ compiler warning level. "-Wall" is commonly used.This setting defines the value of BSP_CFLAGS_WARNINGS in Makefile. - none - false - none - - - hal.make.bsp_arflags - BSP_ARFLAGS - UnquotedString - -src - -src - makefile_variable - Custom flags only passed to the archiver. This content of this variable is directly passed to the archiver rather than the more standard "ARFLAGS". The reason for this is that GNU Make assumes some default content in ARFLAGS. This setting defines the value of BSP_ARFLAGS in Makefile. - none - false - none - - - hal.make.bsp_cflags_optimization - BSP_CFLAGS_OPTIMIZATION - UnquotedString - -O0 - -O0 - makefile_variable - C/C++ compiler optimization level. "-O0" = no optimization,"-O2" = "normal" optimization, etc. "-O0" is recommended for code that you want to debug since compiler optimization can remove variables and produce non-sequential execution of code while debugging. This setting defines the value of BSP_CFLAGS_OPTIMIZATION in Makefile. - none - false - common - - - hal.make.as_post_process - AS_POST_PROCESS - UnquotedString - none - none - makefile_variable - Command executed after each assembly file is compiled. - none - false - none - - - hal.make.cc_pre_process - CC_PRE_PROCESS - UnquotedString - none - none - makefile_variable - Command executed before each .c/.S file is compiled. - none - false - none - - - hal.make.bsp_asflags - BSP_ASFLAGS - UnquotedString - -Wa,-gdwarf2 - -Wa,-gdwarf2 - makefile_variable - Custom flags only passed to the assembler. This setting defines the value of BSP_ASFLAGS in Makefile. - none - false - none - - - hal.make.as_pre_process - AS_PRE_PROCESS - UnquotedString - none - none - makefile_variable - Command executed before each assembly file is compiled. - none - false - none - - - hal.make.bsp_cflags_undefined_symbols - BSP_CFLAGS_UNDEFINED_SYMBOLS - UnquotedString - none - none - makefile_variable - Preprocessor macros to undefine. Undefined macros are similar to defined macros, but replicate the "#undef" directive in source code. To undefine the macro FOO use the syntax "-u FOO" in this setting. This is equivalent to "#undef FOO" in a source file. Note: the syntax differs from macro definition (there is a space, i.e. "-u FOO" versus "-DFOO"). Macros defined with this setting are applied to all .S, .c, and C++ files in the BSP. This setting defines the value of BSP_CFLAGS_UNDEFINED_SYMBOLS in the BSP Makefile. - none - false - none - - - hal.make.cc_post_process - CC_POST_PROCESS - UnquotedString - none - none - makefile_variable - Command executed after each .c/.S file is compiled. - none - false - none - - - hal.make.cxx_post_process - CXX_POST_PROCESS - UnquotedString - none - none - makefile_variable - Command executed before each C++ file is compiled. - none - false - none - - - hal.make.cc - CC - UnquotedString - nios2-elf-gcc -xc - nios2-elf-gcc -xc - makefile_variable - C compiler command. - none - false - none - - - hal.make.bsp_cxx_flags - BSP_CXXFLAGS - UnquotedString - none - none - makefile_variable - Custom flags only passed to the C++ compiler. This setting defines the value of BSP_CXXFLAGS in Makefile. - none - false - none - - - hal.make.bsp_inc_dirs - BSP_INC_DIRS - UnquotedString - none - none - makefile_variable - Space separated list of extra include directories to scan for header files. Directories are relative to the top-level BSP directory. The -I prefix's added by the makefile so don't add it here. This setting defines the value of BSP_INC_DIRS in Makefile. - none - false - none - - - hal.make.cxx - CXX - UnquotedString - nios2-elf-gcc -xc++ - nios2-elf-gcc -xc++ - makefile_variable - C++ compiler command. - none - false - none - - - hal.make.bsp_cflags_user_flags - BSP_CFLAGS_USER_FLAGS - UnquotedString - none - none - makefile_variable - Custom flags passed to the compiler when compiling C, C++, and .S files. This setting defines the value of BSP_CFLAGS_USER_FLAGS in Makefile. - none - false - none - - - hal.make.ignore_system_derived.sopc_system_id - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query SOPC system for system ID. If true ignores export of 'SOPC_SYSID_FLAG += --id=<sysid>' and 'ELF_PATCH_FLAG += --id=<sysid>' to public.mk. - none - false - none - - - hal.make.ignore_system_derived.sopc_system_timestamp - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query SOPC system for system timestamp. If true ignores export of 'SOPC_SYSID_FLAG += --timestamp=<timestamp>' and 'ELF_PATCH_FLAG += --timestamp=<timestamp>' to public.mk. - none - false - none - - - hal.make.ignore_system_derived.sopc_system_base_address - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query SOPC system for system ID base address. If true ignores export of 'SOPC_SYSID_FLAG += --sidp=<address>' and 'ELF_PATCH_FLAG += --sidp=<address>' to public.mk. - none - false - none - - - hal.make.ignore_system_derived.sopc_simulation_enabled - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system has simulation enabled. If true ignores export of 'ELF_PATCH_FLAG += --simulation_enabled' to public.mk. - none - false - none - - - hal.make.ignore_system_derived.fpu_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system has FPU present. If true ignores export of 'ALT_CFLAGS += -mhard-float' to public.mk if FPU is found in the system. If true ignores export of 'ALT_CFLAGS += -mhard-soft' if FPU is not found in the system. - none - false - none - - - hal.make.ignore_system_derived.hardware_multiplier_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system has multiplier present. If true ignores export of 'ALT_CFLAGS += -mno-hw-mul' to public.mk if no multiplier is found in the system. If true ignores export of 'ALT_CFLAGS += -mhw-mul' if multiplier is found in the system. - none - false - none - - - hal.make.ignore_system_derived.hardware_mulx_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system has hardware mulx present. If true ignores export of 'ALT_CFLAGS += -mno-hw-mulx' to public.mk if no mulx is found in the system. If true ignores export of 'ALT_CFLAGS += -mhw-mulx' if mulx is found in the system. - none - false - none - - - hal.make.ignore_system_derived.hardware_divide_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system has hardware divide present. If true ignores export of 'ALT_CFLAGS += -mno-hw-div' to public.mk if no division is found in system. If true ignores export of 'ALT_CFLAGS += -mhw-div' if division is found in the system. - none - false - none - - - hal.make.ignore_system_derived.debug_core_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system has a debug core present. If true ignores export of 'CPU_HAS_DEBUG_CORE = 1' to public.mk if a debug core is found in the system. If true ignores export of 'CPU_HAS_DEBUG_CORE = 0' if no debug core is found in the system. - none - false - none - - - hal.make.ignore_system_derived.big_endian - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system is big endian. If true ignores export of 'ALT_CFLAGS += -EB' to public.mk if big endian system. If true ignores export of 'ALT_CFLAGS += -EL' if little endian system. - none - false - none - - - hal.make.ignore_system_derived.hardware_fp_cust_inst_divider_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system floating point custom instruction with a divider is present. If true ignores export of 'ALT_CFLAGS += -mcustom-fpu-cfg=60-2' and 'ALT_LDFLAGS += -mcustom-fpu-cfg=60-2' to public.mk if the custom instruction is found in the system. - none - false - none - - - hal.make.ignore_system_derived.hardware_fp_cust_inst_no_divider_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system floating point custom instruction without a divider is present. If true ignores export of 'ALT_CFLAGS += -mcustom-fpu-cfg=60-1' and 'ALT_LDFLAGS += -mcustom-fpu-cfg=60-1' to public.mk if the custom instruction is found in the system. - none - false - none - - - hal.enable_exit - ALT_NO_EXIT - Boolean - 1 - 1 - public_mk_define - Add exit() support. This option increases code footprint if your "main()" routine does "return" or call "exit()". If false, adds -DALT_NO_EXIT to ALT_CPPFLAGS in public.mk, and reduces footprint - none - false - none - - - hal.enable_small_c_library - NONE - Boolean - 0 - 0 - public_mk_define - Causes the small newlib (C library) to be used. This reduces code and data footprint at the expense of reduced functionality. Several newlib features are removed such as floating-point support in printf(), stdin input routines, and buffered I/O. The small C library is not compatible with Micrium MicroC/OS-II. If true, adds -msmallc to ALT_LDFLAGS in public.mk. - none - false - common - - - hal.enable_clean_exit - ALT_NO_CLEAN_EXIT - Boolean - 1 - 1 - public_mk_define - When your application exits, close file descriptors, call C++ destructors, etc. Code footprint can be reduced by disabling clean exit. If disabled, adds -DALT_NO_CLEAN_EXIT to ALT_CPPFLAGS and -Wl,--defsym, exit=_exit to ALT_LDFLAGS in public.mk. - none - false - none - - - hal.enable_runtime_stack_checking - ALT_STACK_CHECK - Boolean - 0 - 0 - public_mk_define - Turns on HAL runtime stack checking feature. Enabling this setting causes additional code to be placed into each subroutine call to generate an exception if a stack collision occurs with the heap or statically allocated data. If true, adds -DALT_STACK_CHECK and -mstack-check to ALT_CPPFLAGS in public.mk. - none - false - none - - - hal.enable_gprof - ALT_PROVIDE_GMON - Boolean - 0 - 0 - public_mk_define - Causes code to be compiled with gprof profiling enabled and the application ELF to be linked with the GPROF library. If true, adds -DALT_PROVIDE_GMON to ALT_CPPFLAGS and -pg to ALT_CFLAGS in public.mk. - none - false - common - - - hal.enable_c_plus_plus - ALT_NO_C_PLUS_PLUS - Boolean - 1 - 1 - public_mk_define - Enable support for a subset of the C++ language. This option increases code footprint by adding support for C++ constructors. Certain features, such as multiple inheritance and exceptions are not supported. If false, adds -DALT_NO_C_PLUS_PLUS to ALT_CPPFLAGS in public.mk, and reduces code footprint. - none - false - none - - - hal.enable_reduced_device_drivers - ALT_USE_SMALL_DRIVERS - Boolean - 0 - 0 - public_mk_define - Certain drivers are compiled with reduced functionality to reduce code footprint. Not all drivers observe this setting. The altera_avalon_uart and altera_avalon_jtag_uart drivers switch from interrupt-driven to polled operation. CAUTION: Several device drivers are disabled entirely. These include the altera_avalon_cfi_flash, altera_avalon_epcs_flash_controller, and altera_avalon_lcd_16207 drivers. This can result in certain API (HAL flash access routines) to fail. You can define a symbol provided by each driver to prevent it from being removed. If true, adds -DALT_USE_SMALL_DRIVERS to ALT_CPPFLAGS in public.mk. - none - false - common - - - hal.enable_lightweight_device_driver_api - ALT_USE_DIRECT_DRIVERS - Boolean - 0 - 0 - public_mk_define - Enables lightweight device driver API. This reduces code and data footprint by removing the HAL layer that maps device names (e.g. /dev/uart0) to file descriptors. Instead, driver routines are called directly. The open(), close(), and lseek() routines will always fail if called. The read(), write(), fstat(), ioctl(), and isatty() routines only work for the stdio devices. If true, adds -DALT_USE_DIRECT_DRIVERS to ALT_CPPFLAGS in public.mk. - The Altera Host and read-only ZIP file systems can't be used if hal.enable_lightweight_device_driver_api is true. - false - none - - - hal.enable_mul_div_emulation - ALT_NO_INSTRUCTION_EMULATION - Boolean - 0 - 0 - public_mk_define - Adds code to emulate multiply and divide instructions in case they are executed but aren't present in the CPU. Normally this isn't required because the compiler won't use multiply and divide instructions that aren't present in the CPU. If false, adds -DALT_NO_INSTRUCTION_EMULATION to ALT_CPPFLAGS in public.mk. - none - false - none - - - hal.enable_sim_optimize - ALT_SIM_OPTIMIZE - Boolean - 0 - 0 - public_mk_define - The BSP is compiled with optimizations to speedup HDL simulation such as initializing the cache, clearing the .bss section, and skipping long delay loops. If true, adds -DALT_SIM_OPTIMIZE to ALT_CPPFLAGS in public.mk. - When this setting is true, the BSP shouldn't be used to build applications that are expected to run real hardware. - false - common - - - hal.enable_sopc_sysid_check - NONE - Boolean - 1 - 1 - public_mk_define - Enable SOPC Builder System ID. If a System ID SOPC Builder component is connected to the CPU associated with this BSP, it will be enabled in the creation of command-line arguments to download an ELF to the target. Otherwise, system ID and timestamp values are left out of public.mk for application Makefile "download-elf" target definition. With the system ID check disabled, the Nios II EDS tools will not automatically ensure that the application .elf file (and BSP it is linked against) corresponds to the hardware design on the target. If false, adds --accept-bad-sysid to SOPC_SYSID_FLAG in public.mk. - none - false - none - - - hal.custom_newlib_flags - CUSTOM_NEWLIB_FLAGS - UnquotedString - none - none - public_mk_define - Build a custom version of newlib with the specified space-separated compiler flags. - The custom newlib build will be placed in the &lt;bsp root>/newlib directory, and will be used only for applications that utilize this BSP. - false - none - - - hal.log_flags - ALT_LOG_FLAGS - DecimalNumber - 0 - 0 - public_mk_define - The value is assigned to ALT_LOG_FLAGS in the generated public.mk. See hal.log_port setting description. Values can be -1 through 3. - hal.log_port must be set for this to be used. - false - none - - - altera_avalon_jtag_uart_driver.enable_small_driver - ALTERA_AVALON_JTAG_UART_SMALL - BooleanDefineOnly - false - false - public_mk_define - Small-footprint (polled mode) driver - none - false - - - - altera_avalon_jtag_uart_driver.enable_jtag_uart_ignore_fifo_full_error - ALTERA_AVALON_JTAG_UART_IGNORE_FIFO_FULL_ERROR - BooleanDefineOnly - false - false - public_mk_define - Enable JTAG UART driver to recover when host is inactive causing buffer to full without returning error. Printf will not fail with this recovery. - none - false - - - - onchip_memory - 0x00000000 - 0x00000FFF - 4096 - memory - - - switches - 0x00002000 - 0x0000200F - 16 - - - - LEDs - 0x00002010 - 0x0000201F - 16 - - - - jtag_uart - 0x00002020 - 0x00002027 - 8 - printable - - - .text - onchip_memory - - - .rodata - onchip_memory - - - .rwdata - onchip_memory - - - .bss - onchip_memory - - - .heap - onchip_memory - - - .stack - onchip_memory - - \ No newline at end of file diff --git a/software/qsys_tutorial_bsp/summary.html b/software/qsys_tutorial_bsp/summary.html deleted file mode 100644 index 175628c..0000000 --- a/software/qsys_tutorial_bsp/summary.html +++ /dev/null @@ -1,2008 +0,0 @@ - -Altera Nios II BSP Summary - -

BSP Description

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
BSP Type:hal
SOPC Design File:C:\Users\takayun\Desktop\qsys_tutorial\nios_system.sopcinfo
Quartus JDI File:default
CPU:nios2_processor
BSP Settings File:.\settings.bsp
BSP Version:default
BSP Generated On:2016/10/13 17:08:42
BSP Generated Timestamp:1476346122316
BSP Generated Location:C:\Users\takayun\Desktop\qsys_tutorial\software\qsys_tutorial_bsp
-
-

Nios II Memory Map

- - - - - - - - - - - - - - - - -
Slave DescriptorAddress RangeSizeAttributes
jtag_uart0x00002020 - 0x000020278printable
LEDs0x00002010 - 0x0000201F16 
switches0x00002000 - 0x0000200F16 
onchip_memory0x00000000 - 0x00000FFF4096memory
-
-
-

Linker Regions

- - - - -
RegionAddress RangeSizeMemoryOffset
-
-
-

Linker Section Mappings

- - - - - - - - - - - - - - - - - - - - - - -
SectionRegion
.textonchip_memory
.rodataonchip_memory
.rwdataonchip_memory
.bssonchip_memory
.heaponchip_memory
.stackonchip_memory
-

Settings

- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:altera_avalon_jtag_uart_driver.enable_jtag_uart_ignore_fifo_full_error
Identifier:ALTERA_AVALON_JTAG_UART_IGNORE_FIFO_FULL_ERROR
Default Value:false
Value:false
Type:BooleanDefineOnly
Destination:public_mk_define
Description:Enable JTAG UART driver to recover when host is inactive causing buffer to full without returning error. Printf will not fail with this recovery.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:altera_avalon_jtag_uart_driver.enable_small_driver
Identifier:ALTERA_AVALON_JTAG_UART_SMALL
Default Value:false
Value:false
Type:BooleanDefineOnly
Destination:public_mk_define
Description:Small-footprint (polled mode) driver
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.custom_newlib_flags
Identifier:CUSTOM_NEWLIB_FLAGS
Default Value:none
Value:none
Type:UnquotedString
Destination:public_mk_define
Description:Build a custom version of newlib with the specified space-separated compiler flags.
Restrictions:The custom newlib build will be placed in the &lt;bsp root>/newlib directory, and will be used only for applications that utilize this BSP.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_c_plus_plus
Identifier:ALT_NO_C_PLUS_PLUS
Default Value:1
Value:1
Type:Boolean
Destination:public_mk_define
Description:Enable support for a subset of the C++ language. This option increases code footprint by adding support for C++ constructors. Certain features, such as multiple inheritance and exceptions are not supported. If false, adds -DALT_NO_C_PLUS_PLUS to ALT_CPPFLAGS in public.mk, and reduces code footprint.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_clean_exit
Identifier:ALT_NO_CLEAN_EXIT
Default Value:1
Value:1
Type:Boolean
Destination:public_mk_define
Description:When your application exits, close file descriptors, call C++ destructors, etc. Code footprint can be reduced by disabling clean exit. If disabled, adds -DALT_NO_CLEAN_EXIT to ALT_CPPFLAGS and -Wl,--defsym, exit=_exit to ALT_LDFLAGS in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_exit
Identifier:ALT_NO_EXIT
Default Value:1
Value:1
Type:Boolean
Destination:public_mk_define
Description:Add exit() support. This option increases code footprint if your "main()" routine does "return" or call "exit()". If false, adds -DALT_NO_EXIT to ALT_CPPFLAGS in public.mk, and reduces footprint
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_gprof
Identifier:ALT_PROVIDE_GMON
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Causes code to be compiled with gprof profiling enabled and the application ELF to be linked with the GPROF library. If true, adds -DALT_PROVIDE_GMON to ALT_CPPFLAGS and -pg to ALT_CFLAGS in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_instruction_related_exceptions_api
Identifier:ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API
Default Value:false
Value:false
Type:BooleanDefineOnly
Destination:system_h_define
Description:Enables API for registering handlers to service instruction-related exceptions. Enabling this setting increases the size of the exception entry code.
Restrictions:These exception types can be generated if various processor options are enabled, such as the MMU, MPU, or other advanced exception types.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_lightweight_device_driver_api
Identifier:ALT_USE_DIRECT_DRIVERS
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enables lightweight device driver API. This reduces code and data footprint by removing the HAL layer that maps device names (e.g. /dev/uart0) to file descriptors. Instead, driver routines are called directly. The open(), close(), and lseek() routines will always fail if called. The read(), write(), fstat(), ioctl(), and isatty() routines only work for the stdio devices. If true, adds -DALT_USE_DIRECT_DRIVERS to ALT_CPPFLAGS in public.mk.
Restrictions:The Altera Host and read-only ZIP file systems can't be used if hal.enable_lightweight_device_driver_api is true.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_mul_div_emulation
Identifier:ALT_NO_INSTRUCTION_EMULATION
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Adds code to emulate multiply and divide instructions in case they are executed but aren't present in the CPU. Normally this isn't required because the compiler won't use multiply and divide instructions that aren't present in the CPU. If false, adds -DALT_NO_INSTRUCTION_EMULATION to ALT_CPPFLAGS in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_reduced_device_drivers
Identifier:ALT_USE_SMALL_DRIVERS
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Certain drivers are compiled with reduced functionality to reduce code footprint. Not all drivers observe this setting. The altera_avalon_uart and altera_avalon_jtag_uart drivers switch from interrupt-driven to polled operation. CAUTION: Several device drivers are disabled entirely. These include the altera_avalon_cfi_flash, altera_avalon_epcs_flash_controller, and altera_avalon_lcd_16207 drivers. This can result in certain API (HAL flash access routines) to fail. You can define a symbol provided by each driver to prevent it from being removed. If true, adds -DALT_USE_SMALL_DRIVERS to ALT_CPPFLAGS in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_runtime_stack_checking
Identifier:ALT_STACK_CHECK
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Turns on HAL runtime stack checking feature. Enabling this setting causes additional code to be placed into each subroutine call to generate an exception if a stack collision occurs with the heap or statically allocated data. If true, adds -DALT_STACK_CHECK and -mstack-check to ALT_CPPFLAGS in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_sim_optimize
Identifier:ALT_SIM_OPTIMIZE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:The BSP is compiled with optimizations to speedup HDL simulation such as initializing the cache, clearing the .bss section, and skipping long delay loops. If true, adds -DALT_SIM_OPTIMIZE to ALT_CPPFLAGS in public.mk.
Restrictions:When this setting is true, the BSP shouldn't be used to build applications that are expected to run real hardware.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_small_c_library
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Causes the small newlib (C library) to be used. This reduces code and data footprint at the expense of reduced functionality. Several newlib features are removed such as floating-point support in printf(), stdin input routines, and buffered I/O. The small C library is not compatible with Micrium MicroC/OS-II. If true, adds -msmallc to ALT_LDFLAGS in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_sopc_sysid_check
Identifier:NONE
Default Value:1
Value:1
Type:Boolean
Destination:public_mk_define
Description:Enable SOPC Builder System ID. If a System ID SOPC Builder component is connected to the CPU associated with this BSP, it will be enabled in the creation of command-line arguments to download an ELF to the target. Otherwise, system ID and timestamp values are left out of public.mk for application Makefile "download-elf" target definition. With the system ID check disabled, the Nios II EDS tools will not automatically ensure that the application .elf file (and BSP it is linked against) corresponds to the hardware design on the target. If false, adds --accept-bad-sysid to SOPC_SYSID_FLAG in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.allow_code_at_reset
Identifier:ALT_ALLOW_CODE_AT_RESET
Default Value:0
Value:1
Type:Boolean
Destination:none
Description:Indicates if initialization code is allowed at the reset address. If true, defines the macro ALT_ALLOW_CODE_AT_RESET in linker.h.
Restrictions:If true, defines the macro ALT_ALLOW_CODE_AT_RESET in linker.h. This setting is typically false if an external bootloader (e.g. flash bootloader) is present.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.enable_alt_load
Identifier:NONE
Default Value:0
Value:1
Type:Boolean
Destination:none
Description:Enables the alt_load() facility. The alt_load() facility copies sections from the .text memory into RAM. If true, this setting sets up the VMA/LMA of sections in linker.x to allow them to be loaded into the .text memory.
Restrictions:This setting is typically false if an external bootloader (e.g. flash bootloader) is present.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.enable_alt_load_copy_exceptions
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:none
Description:Causes the alt_load() facility to copy the .exceptions section. If true, this setting defines the macro ALT_LOAD_COPY_EXCEPTIONS in linker.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.enable_alt_load_copy_rodata
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:none
Description:Causes the alt_load() facility to copy the .rodata section. If true, this setting defines the macro ALT_LOAD_COPY_RODATA in linker.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.enable_alt_load_copy_rwdata
Identifier:NONE
Default Value:0
Value:1
Type:Boolean
Destination:none
Description:Causes the alt_load() facility to copy the .rwdata section. If true, this setting defines the macro ALT_LOAD_COPY_RWDATA in linker.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.enable_exception_stack
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:none
Description:Enables use of a separate exception stack. If true, defines the macro ALT_EXCEPTION_STACK in linker.h, adds a memory region called exception_stack to linker.x, and provides the symbols __alt_exception_stack_pointer and __alt_exception_stack_limit in linker.x.
Restrictions:The hal.linker.exception_stack_size and hal.linker.exception_stack_memory_region_name settings must also be valid. This setting must be false for MicroC/OS-II BSPs. The exception stack can be used to improve interrupt and other exception performance if the EIC is *not* used.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.enable_interrupt_stack
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:none
Description:Enables use of a separate interrupt stack. If true, defines the macro ALT_INTERRUPT_STACK in linker.h, adds a memory region called interrupt_stack to linker.x, and provides the symbols __alt_interrupt_stack_pointer and __alt_interrupt_stack_limit in linker.x.
Restrictions:The hal.linker.interrupt_stack_size and hal.linker.interrupt_stack_memory_region_name settings must also be valid. This setting must be false for MicroC/OS-II BSPs. Only enable if the EIC is used exclusively. The exception stack can be used to improve interrupt and other exception performance if the EIC is *not* used.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.exception_stack_memory_region_name
Identifier:NONE
Default Value:none
Value:onchip_memory
Type:UnquotedString
Destination:none
Description:Name of the existing memory region that will be divided up to create the 'exception_stack' memory region. The selected region name will be adjusted automatically when the BSP is generated to create the 'exception_stack' memory region.
Restrictions:Only used if hal.linker.enable_exception_stack is true.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.exception_stack_size
Identifier:NONE
Default Value:1024
Value:1024
Type:DecimalNumber
Destination:none
Description:Size of the exception stack in bytes.
Restrictions:Only used if hal.linker.enable_exception_stack is true.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.interrupt_stack_memory_region_name
Identifier:NONE
Default Value:none
Value:onchip_memory
Type:UnquotedString
Destination:none
Description:Name of the existing memory region that will be divided up to create the 'interrupt_stack' memory region. The selected region name will be adjusted automatically when the BSP is generated to create the 'interrupt_stack' memory region.
Restrictions:Only used if hal.linker.enable_interrupt_stack is true.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.interrupt_stack_size
Identifier:NONE
Default Value:1024
Value:1024
Type:DecimalNumber
Destination:none
Description:Size of the interrupt stack in bytes.
Restrictions:Only used if hal.linker.enable_interrupt_stack is true.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.log_flags
Identifier:ALT_LOG_FLAGS
Default Value:0
Value:0
Type:DecimalNumber
Destination:public_mk_define
Description:The value is assigned to ALT_LOG_FLAGS in the generated public.mk. See hal.log_port setting description. Values can be -1 through 3.
Restrictions:hal.log_port must be set for this to be used.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.log_port
Identifier:NONE
Default Value:none
Value:none
Type:UnquotedString
Destination:public_mk_define
Description:Slave descriptor of debug logging character-mode device. If defined, it enables extra debug messages in the HAL source. This setting is used by the ALT_LOG_PORT family of defines in system.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ar
Identifier:AR
Default Value:nios2-elf-ar
Value:nios2-elf-ar
Type:UnquotedString
Destination:makefile_variable
Description:Archiver command. Creates library files.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ar_post_process
Identifier:AR_POST_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed after archiver execution.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ar_pre_process
Identifier:AR_PRE_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed before archiver execution.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.as
Identifier:AS
Default Value:nios2-elf-gcc
Value:nios2-elf-gcc
Type:UnquotedString
Destination:makefile_variable
Description:Assembler command. Note that CC is used for .S files.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.as_post_process
Identifier:AS_POST_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed after each assembly file is compiled.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.as_pre_process
Identifier:AS_PRE_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed before each assembly file is compiled.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_arflags
Identifier:BSP_ARFLAGS
Default Value:-src
Value:-src
Type:UnquotedString
Destination:makefile_variable
Description:Custom flags only passed to the archiver. This content of this variable is directly passed to the archiver rather than the more standard "ARFLAGS". The reason for this is that GNU Make assumes some default content in ARFLAGS. This setting defines the value of BSP_ARFLAGS in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_asflags
Identifier:BSP_ASFLAGS
Default Value:-Wa,-gdwarf2
Value:-Wa,-gdwarf2
Type:UnquotedString
Destination:makefile_variable
Description:Custom flags only passed to the assembler. This setting defines the value of BSP_ASFLAGS in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cflags_debug
Identifier:BSP_CFLAGS_DEBUG
Default Value:-g
Value:-g
Type:UnquotedString
Destination:makefile_variable
Description:C/C++ compiler debug level. '-g' provides the default set of debug symbols typically required to debug a typical application. Omitting '-g' removes debug symbols from the ELF. This setting defines the value of BSP_CFLAGS_DEBUG in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cflags_defined_symbols
Identifier:BSP_CFLAGS_DEFINED_SYMBOLS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Preprocessor macros to define. A macro definition in this setting has the same effect as a "#define" in source code. Adding "-DALT_DEBUG" to this setting has the same effect as "#define ALT_DEBUG" in a souce file. Adding "-DFOO=1" to this setting is equivalent to the macro "#define FOO 1" in a source file. Macros defined with this setting are applied to all .S, .c, and C++ files in the BSP. This setting defines the value of BSP_CFLAGS_DEFINED_SYMBOLS in the BSP Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cflags_optimization
Identifier:BSP_CFLAGS_OPTIMIZATION
Default Value:-O0
Value:-O0
Type:UnquotedString
Destination:makefile_variable
Description:C/C++ compiler optimization level. "-O0" = no optimization,"-O2" = "normal" optimization, etc. "-O0" is recommended for code that you want to debug since compiler optimization can remove variables and produce non-sequential execution of code while debugging. This setting defines the value of BSP_CFLAGS_OPTIMIZATION in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cflags_undefined_symbols
Identifier:BSP_CFLAGS_UNDEFINED_SYMBOLS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Preprocessor macros to undefine. Undefined macros are similar to defined macros, but replicate the "#undef" directive in source code. To undefine the macro FOO use the syntax "-u FOO" in this setting. This is equivalent to "#undef FOO" in a source file. Note: the syntax differs from macro definition (there is a space, i.e. "-u FOO" versus "-DFOO"). Macros defined with this setting are applied to all .S, .c, and C++ files in the BSP. This setting defines the value of BSP_CFLAGS_UNDEFINED_SYMBOLS in the BSP Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cflags_user_flags
Identifier:BSP_CFLAGS_USER_FLAGS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Custom flags passed to the compiler when compiling C, C++, and .S files. This setting defines the value of BSP_CFLAGS_USER_FLAGS in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cflags_warnings
Identifier:BSP_CFLAGS_WARNINGS
Default Value:-Wall
Value:-Wall
Type:UnquotedString
Destination:makefile_variable
Description:C/C++ compiler warning level. "-Wall" is commonly used.This setting defines the value of BSP_CFLAGS_WARNINGS in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cxx_flags
Identifier:BSP_CXXFLAGS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Custom flags only passed to the C++ compiler. This setting defines the value of BSP_CXXFLAGS in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_inc_dirs
Identifier:BSP_INC_DIRS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Space separated list of extra include directories to scan for header files. Directories are relative to the top-level BSP directory. The -I prefix's added by the makefile so don't add it here. This setting defines the value of BSP_INC_DIRS in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.build_post_process
Identifier:BUILD_POST_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed after BSP built.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.build_pre_process
Identifier:BUILD_PRE_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed before BSP built.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.cc
Identifier:CC
Default Value:nios2-elf-gcc -xc
Value:nios2-elf-gcc -xc
Type:UnquotedString
Destination:makefile_variable
Description:C compiler command.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.cc_post_process
Identifier:CC_POST_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed after each .c/.S file is compiled.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.cc_pre_process
Identifier:CC_PRE_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed before each .c/.S file is compiled.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.cxx
Identifier:CXX
Default Value:nios2-elf-gcc -xc++
Value:nios2-elf-gcc -xc++
Type:UnquotedString
Destination:makefile_variable
Description:C++ compiler command.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.cxx_post_process
Identifier:CXX_POST_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed before each C++ file is compiled.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.cxx_pre_process
Identifier:CXX_PRE_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed before each C++ file is compiled.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.big_endian
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system is big endian. If true ignores export of 'ALT_CFLAGS += -EB' to public.mk if big endian system. If true ignores export of 'ALT_CFLAGS += -EL' if little endian system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.debug_core_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system has a debug core present. If true ignores export of 'CPU_HAS_DEBUG_CORE = 1' to public.mk if a debug core is found in the system. If true ignores export of 'CPU_HAS_DEBUG_CORE = 0' if no debug core is found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.fpu_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system has FPU present. If true ignores export of 'ALT_CFLAGS += -mhard-float' to public.mk if FPU is found in the system. If true ignores export of 'ALT_CFLAGS += -mhard-soft' if FPU is not found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.hardware_divide_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system has hardware divide present. If true ignores export of 'ALT_CFLAGS += -mno-hw-div' to public.mk if no division is found in system. If true ignores export of 'ALT_CFLAGS += -mhw-div' if division is found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.hardware_fp_cust_inst_divider_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system floating point custom instruction with a divider is present. If true ignores export of 'ALT_CFLAGS += -mcustom-fpu-cfg=60-2' and 'ALT_LDFLAGS += -mcustom-fpu-cfg=60-2' to public.mk if the custom instruction is found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.hardware_fp_cust_inst_no_divider_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system floating point custom instruction without a divider is present. If true ignores export of 'ALT_CFLAGS += -mcustom-fpu-cfg=60-1' and 'ALT_LDFLAGS += -mcustom-fpu-cfg=60-1' to public.mk if the custom instruction is found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.hardware_multiplier_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system has multiplier present. If true ignores export of 'ALT_CFLAGS += -mno-hw-mul' to public.mk if no multiplier is found in the system. If true ignores export of 'ALT_CFLAGS += -mhw-mul' if multiplier is found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.hardware_mulx_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system has hardware mulx present. If true ignores export of 'ALT_CFLAGS += -mno-hw-mulx' to public.mk if no mulx is found in the system. If true ignores export of 'ALT_CFLAGS += -mhw-mulx' if mulx is found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.sopc_simulation_enabled
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system has simulation enabled. If true ignores export of 'ELF_PATCH_FLAG += --simulation_enabled' to public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.sopc_system_base_address
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query SOPC system for system ID base address. If true ignores export of 'SOPC_SYSID_FLAG += --sidp=<address>' and 'ELF_PATCH_FLAG += --sidp=<address>' to public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.sopc_system_id
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query SOPC system for system ID. If true ignores export of 'SOPC_SYSID_FLAG += --id=<sysid>' and 'ELF_PATCH_FLAG += --id=<sysid>' to public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.sopc_system_timestamp
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query SOPC system for system timestamp. If true ignores export of 'SOPC_SYSID_FLAG += --timestamp=<timestamp>' and 'ELF_PATCH_FLAG += --timestamp=<timestamp>' to public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.rm
Identifier:RM
Default Value:rm -f
Value:rm -f
Type:UnquotedString
Destination:makefile_variable
Description:Command used to remove files during 'clean' target.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.max_file_descriptors
Identifier:ALT_MAX_FD
Default Value:32
Value:32
Type:DecimalNumber
Destination:system_h_define
Description:Determines the number of file descriptors statically allocated. This setting defines the value of ALT_MAX_FD in system.h.
Restrictions:If hal.enable_lightweight_device_driver_api is true, there are no file descriptors so this setting is ignored. If hal.enable_lightweight_device_driver_api is false, this setting must be at least 4 because HAL needs a file descriptor for /dev/null, /dev/stdin, /dev/stdout, and /dev/stderr.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.stderr
Identifier:NONE
Default Value:none
Value:jtag_uart
Type:UnquotedString
Destination:system_h_define
Description:Slave descriptor of STDERR character-mode device. This setting is used by the ALT_STDERR family of defines in system.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.stdin
Identifier:NONE
Default Value:none
Value:jtag_uart
Type:UnquotedString
Destination:system_h_define
Description:Slave descriptor of STDIN character-mode device. This setting is used by the ALT_STDIN family of defines in system.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.stdout
Identifier:NONE
Default Value:none
Value:jtag_uart
Type:UnquotedString
Destination:system_h_define
Description:Slave descriptor of STDOUT character-mode device. This setting is used by the ALT_STDOUT family of defines in system.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.sys_clk_timer
Identifier:ALT_SYS_CLK
Default Value:none
Value:none
Type:UnquotedString
Destination:system_h_define
Description:Slave descriptor of the system clock timer device. This device provides a periodic interrupt ("tick") and is typically required for RTOS use. This setting defines the value of ALT_SYS_CLK in system.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.timestamp_timer
Identifier:ALT_TIMESTAMP_CLK
Default Value:none
Value:none
Type:UnquotedString
Destination:system_h_define
Description:Slave descriptor of timestamp timer device. This device is used by Altera HAL timestamp drivers for high-resolution time measurement. This setting defines the value of ALT_TIMESTAMP_CLK in system.h.
Restrictions:none
-
-
-
- - diff --git a/software/qsys_tutorial_bsp/system.h b/software/qsys_tutorial_bsp/system.h deleted file mode 100644 index ba54e71..0000000 --- a/software/qsys_tutorial_bsp/system.h +++ /dev/null @@ -1,278 +0,0 @@ -/* - * system.h - SOPC Builder system and BSP software package information - * - * Machine generated for CPU 'nios2_processor' in SOPC Builder design 'nios_system' - * SOPC Builder design path: C:/Users/takayun/Desktop/qsys_tutorial/nios_system.sopcinfo - * - * Generated: Thu Oct 13 17:08:43 JST 2016 - */ - -/* - * DO NOT MODIFY THIS FILE - * - * Changing this file will have subtle consequences - * which will almost certainly lead to a nonfunctioning - * system. If you do modify this file, be aware that your - * changes will be overwritten and lost when this file - * is generated again. - * - * DO NOT MODIFY THIS FILE - */ - -/* - * License Agreement - * - * Copyright (c) 2008 - * Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - * - * This agreement shall be governed in all respects by the laws of the State - * of California and by the laws of the United States of America. - */ - -#ifndef __SYSTEM_H_ -#define __SYSTEM_H_ - -/* Include definitions from linker script generator */ -#include "linker.h" - - -/* - * CPU configuration - * - */ - -#define ALT_CPU_ARCHITECTURE "altera_nios2_qsys" -#define ALT_CPU_BIG_ENDIAN 0 -#define ALT_CPU_BREAK_ADDR 0x1820 -#define ALT_CPU_CPU_FREQ 50000000u -#define ALT_CPU_CPU_ID_SIZE 1 -#define ALT_CPU_CPU_ID_VALUE 0x00000000 -#define ALT_CPU_CPU_IMPLEMENTATION "tiny" -#define ALT_CPU_DATA_ADDR_WIDTH 0xe -#define ALT_CPU_DCACHE_LINE_SIZE 0 -#define ALT_CPU_DCACHE_LINE_SIZE_LOG2 0 -#define ALT_CPU_DCACHE_SIZE 0 -#define ALT_CPU_EXCEPTION_ADDR 0x20 -#define ALT_CPU_FLUSHDA_SUPPORTED -#define ALT_CPU_FREQ 50000000 -#define ALT_CPU_HARDWARE_DIVIDE_PRESENT 0 -#define ALT_CPU_HARDWARE_MULTIPLY_PRESENT 0 -#define ALT_CPU_HARDWARE_MULX_PRESENT 0 -#define ALT_CPU_HAS_DEBUG_CORE 1 -#define ALT_CPU_HAS_DEBUG_STUB -#define ALT_CPU_HAS_JMPI_INSTRUCTION -#define ALT_CPU_ICACHE_LINE_SIZE 0 -#define ALT_CPU_ICACHE_LINE_SIZE_LOG2 0 -#define ALT_CPU_ICACHE_SIZE 0 -#define ALT_CPU_INST_ADDR_WIDTH 0xd -#define ALT_CPU_NAME "nios2_processor" -#define ALT_CPU_RESET_ADDR 0x0 - - -/* - * CPU configuration (with legacy prefix - don't use these anymore) - * - */ - -#define NIOS2_BIG_ENDIAN 0 -#define NIOS2_BREAK_ADDR 0x1820 -#define NIOS2_CPU_FREQ 50000000u -#define NIOS2_CPU_ID_SIZE 1 -#define NIOS2_CPU_ID_VALUE 0x00000000 -#define NIOS2_CPU_IMPLEMENTATION "tiny" -#define NIOS2_DATA_ADDR_WIDTH 0xe -#define NIOS2_DCACHE_LINE_SIZE 0 -#define NIOS2_DCACHE_LINE_SIZE_LOG2 0 -#define NIOS2_DCACHE_SIZE 0 -#define NIOS2_EXCEPTION_ADDR 0x20 -#define NIOS2_FLUSHDA_SUPPORTED -#define NIOS2_HARDWARE_DIVIDE_PRESENT 0 -#define NIOS2_HARDWARE_MULTIPLY_PRESENT 0 -#define NIOS2_HARDWARE_MULX_PRESENT 0 -#define NIOS2_HAS_DEBUG_CORE 1 -#define NIOS2_HAS_DEBUG_STUB -#define NIOS2_HAS_JMPI_INSTRUCTION -#define NIOS2_ICACHE_LINE_SIZE 0 -#define NIOS2_ICACHE_LINE_SIZE_LOG2 0 -#define NIOS2_ICACHE_SIZE 0 -#define NIOS2_INST_ADDR_WIDTH 0xd -#define NIOS2_RESET_ADDR 0x0 - - -/* - * Define for each module class mastered by the CPU - * - */ - -#define __ALTERA_AVALON_JTAG_UART -#define __ALTERA_AVALON_ONCHIP_MEMORY2 -#define __ALTERA_AVALON_PIO -#define __ALTERA_NIOS2_QSYS - - -/* - * LEDs configuration - * - */ - -#define ALT_MODULE_CLASS_LEDs altera_avalon_pio -#define LEDS_BASE 0x2010 -#define LEDS_BIT_CLEARING_EDGE_REGISTER 0 -#define LEDS_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define LEDS_CAPTURE 0 -#define LEDS_DATA_WIDTH 8 -#define LEDS_DO_TEST_BENCH_WIRING 0 -#define LEDS_DRIVEN_SIM_VALUE 0 -#define LEDS_EDGE_TYPE "NONE" -#define LEDS_FREQ 50000000 -#define LEDS_HAS_IN 0 -#define LEDS_HAS_OUT 1 -#define LEDS_HAS_TRI 0 -#define LEDS_IRQ -1 -#define LEDS_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define LEDS_IRQ_TYPE "NONE" -#define LEDS_NAME "/dev/LEDs" -#define LEDS_RESET_VALUE 0 -#define LEDS_SPAN 16 -#define LEDS_TYPE "altera_avalon_pio" - - -/* - * System configuration - * - */ - -#define ALT_DEVICE_FAMILY "Cyclone IV E" -#define ALT_ENHANCED_INTERRUPT_API_PRESENT -#define ALT_IRQ_BASE NULL -#define ALT_LOG_PORT "/dev/null" -#define ALT_LOG_PORT_BASE 0x0 -#define ALT_LOG_PORT_DEV null -#define ALT_LOG_PORT_TYPE "" -#define ALT_NUM_EXTERNAL_INTERRUPT_CONTROLLERS 0 -#define ALT_NUM_INTERNAL_INTERRUPT_CONTROLLERS 1 -#define ALT_NUM_INTERRUPT_CONTROLLERS 1 -#define ALT_STDERR "/dev/jtag_uart" -#define ALT_STDERR_BASE 0x2020 -#define ALT_STDERR_DEV jtag_uart -#define ALT_STDERR_IS_JTAG_UART -#define ALT_STDERR_PRESENT -#define ALT_STDERR_TYPE "altera_avalon_jtag_uart" -#define ALT_STDIN "/dev/jtag_uart" -#define ALT_STDIN_BASE 0x2020 -#define ALT_STDIN_DEV jtag_uart -#define ALT_STDIN_IS_JTAG_UART -#define ALT_STDIN_PRESENT -#define ALT_STDIN_TYPE "altera_avalon_jtag_uart" -#define ALT_STDOUT "/dev/jtag_uart" -#define ALT_STDOUT_BASE 0x2020 -#define ALT_STDOUT_DEV jtag_uart -#define ALT_STDOUT_IS_JTAG_UART -#define ALT_STDOUT_PRESENT -#define ALT_STDOUT_TYPE "altera_avalon_jtag_uart" -#define ALT_SYSTEM_NAME "nios_system" - - -/* - * hal configuration - * - */ - -#define ALT_MAX_FD 32 -#define ALT_SYS_CLK none -#define ALT_TIMESTAMP_CLK none - - -/* - * jtag_uart configuration - * - */ - -#define ALT_MODULE_CLASS_jtag_uart altera_avalon_jtag_uart -#define JTAG_UART_BASE 0x2020 -#define JTAG_UART_IRQ 0 -#define JTAG_UART_IRQ_INTERRUPT_CONTROLLER_ID 0 -#define JTAG_UART_NAME "/dev/jtag_uart" -#define JTAG_UART_READ_DEPTH 64 -#define JTAG_UART_READ_THRESHOLD 8 -#define JTAG_UART_SPAN 8 -#define JTAG_UART_TYPE "altera_avalon_jtag_uart" -#define JTAG_UART_WRITE_DEPTH 64 -#define JTAG_UART_WRITE_THRESHOLD 8 - - -/* - * onchip_memory configuration - * - */ - -#define ALT_MODULE_CLASS_onchip_memory altera_avalon_onchip_memory2 -#define ONCHIP_MEMORY_ALLOW_IN_SYSTEM_MEMORY_CONTENT_EDITOR 0 -#define ONCHIP_MEMORY_ALLOW_MRAM_SIM_CONTENTS_ONLY_FILE 0 -#define ONCHIP_MEMORY_BASE 0x0 -#define ONCHIP_MEMORY_CONTENTS_INFO "" -#define ONCHIP_MEMORY_DUAL_PORT 0 -#define ONCHIP_MEMORY_GUI_RAM_BLOCK_TYPE "AUTO" -#define ONCHIP_MEMORY_INIT_CONTENTS_FILE "nios_system_onchip_memory" -#define ONCHIP_MEMORY_INIT_MEM_CONTENT 1 -#define ONCHIP_MEMORY_INSTANCE_ID "NONE" -#define ONCHIP_MEMORY_IRQ -1 -#define ONCHIP_MEMORY_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define ONCHIP_MEMORY_NAME "/dev/onchip_memory" -#define ONCHIP_MEMORY_NON_DEFAULT_INIT_FILE_ENABLED 0 -#define ONCHIP_MEMORY_RAM_BLOCK_TYPE "AUTO" -#define ONCHIP_MEMORY_READ_DURING_WRITE_MODE "DONT_CARE" -#define ONCHIP_MEMORY_SINGLE_CLOCK_OP 0 -#define ONCHIP_MEMORY_SIZE_MULTIPLE 1 -#define ONCHIP_MEMORY_SIZE_VALUE 4096 -#define ONCHIP_MEMORY_SPAN 4096 -#define ONCHIP_MEMORY_TYPE "altera_avalon_onchip_memory2" -#define ONCHIP_MEMORY_WRITABLE 1 - - -/* - * switches configuration - * - */ - -#define ALT_MODULE_CLASS_switches altera_avalon_pio -#define SWITCHES_BASE 0x2000 -#define SWITCHES_BIT_CLEARING_EDGE_REGISTER 0 -#define SWITCHES_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define SWITCHES_CAPTURE 0 -#define SWITCHES_DATA_WIDTH 8 -#define SWITCHES_DO_TEST_BENCH_WIRING 0 -#define SWITCHES_DRIVEN_SIM_VALUE 0 -#define SWITCHES_EDGE_TYPE "NONE" -#define SWITCHES_FREQ 50000000 -#define SWITCHES_HAS_IN 1 -#define SWITCHES_HAS_OUT 0 -#define SWITCHES_HAS_TRI 0 -#define SWITCHES_IRQ -1 -#define SWITCHES_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define SWITCHES_IRQ_TYPE "NONE" -#define SWITCHES_NAME "/dev/switches" -#define SWITCHES_RESET_VALUE 0 -#define SWITCHES_SPAN 16 -#define SWITCHES_TYPE "altera_avalon_pio" - -#endif /* __SYSTEM_H_ */ diff --git a/software/qsys_tutorial_green/.cproject b/software/qsys_tutorial_green/.cproject deleted file mode 100644 index 1a3b800..0000000 --- a/software/qsys_tutorial_green/.cproject +++ /dev/null @@ -1,508 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - make - - mem_init_install - true - false - false - - - make - - mem_init_generate - true - false - false - - - make - - help - true - false - false - - - - diff --git a/software/qsys_tutorial_green/.project b/software/qsys_tutorial_green/.project deleted file mode 100644 index 6fa16ac..0000000 --- a/software/qsys_tutorial_green/.project +++ /dev/null @@ -1,96 +0,0 @@ - - - qsys_tutorial_green - - - - - - com.altera.sbtgui.project.makefileBuilder - - - - - com.altera.sbtgui.project.makefileBuilder - - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - ?name? - - - - org.eclipse.cdt.make.core.append_environment - true - - - org.eclipse.cdt.make.core.autoBuildTarget - all - - - org.eclipse.cdt.make.core.buildArguments - - - - org.eclipse.cdt.make.core.buildCommand - make - - - org.eclipse.cdt.make.core.buildLocation - ${workspace_loc://qsys_tutorial_green} - - - org.eclipse.cdt.make.core.cleanBuildTarget - clean - - - org.eclipse.cdt.make.core.contents - org.eclipse.cdt.make.core.activeConfigSettings - - - org.eclipse.cdt.make.core.enableAutoBuild - false - - - org.eclipse.cdt.make.core.enableCleanBuild - true - - - org.eclipse.cdt.make.core.enableFullBuild - true - - - org.eclipse.cdt.make.core.fullBuildTarget - all - - - org.eclipse.cdt.make.core.stopOnError - true - - - org.eclipse.cdt.make.core.useDefaultBuildCmd - true - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - org.eclipse.cdt.core.ccnature - com.altera.sbtgui.project.SBTGUINature - com.altera.sbtgui.project.SBTGUIAppNature - com.altera.sbtgui.project.SBTGUIManagedNature - - diff --git a/software/qsys_tutorial_green/Makefile b/software/qsys_tutorial_green/Makefile deleted file mode 100644 index f0200d7..0000000 --- a/software/qsys_tutorial_green/Makefile +++ /dev/null @@ -1,1086 +0,0 @@ -#------------------------------------------------------------------------------ -# VARIABLES APPENDED TO BY INCLUDED MAKEFILE FRAGMENTS -#------------------------------------------------------------------------------ - -# List of include directories for -I compiler option (-I added when used). -# Includes the BSP. -ALT_INCLUDE_DIRS := - -# List of library directories for -L linker option (-L added when used). -# Includes the BSP. -ALT_LIBRARY_DIRS := - -# List of library names for -l linker option (-l added when used). -# Includes the BSP. -ALT_LIBRARY_NAMES := - -# List of library names for -msys-lib linker option (-msys-lib added when used). -# These are libraries that might be located in the BSP and depend on the BSP -# library, or vice versa -ALT_BSP_DEP_LIBRARY_NAMES := - -# List of dependencies for the linker. This is usually the full pathname -# of each library (*.a) file. -# Includes the BSP. -ALT_LDDEPS := - -# List of root library directories that support running make to build them. -# Includes the BSP and any ALT libraries. -MAKEABLE_LIBRARY_ROOT_DIRS := - -# Generic flags passed to the compiler for different types of input files. -ALT_CFLAGS := -ALT_CXXFLAGS := -ALT_CPPFLAGS := -ALT_ASFLAGS := -ALT_LDFLAGS := - - -#------------------------------------------------------------------------------ -# The adjust-path macro -# -# If COMSPEC/ComSpec is defined, Make is launched from Windows through -# Cygwin. The adjust-path macro converts absolute windows paths into -# unix style paths (Example: c:/dir -> /c/dir). This will ensture -# paths are readable by GNU Make. -# -# If COMSPEC/ComSpec is not defined, Make is launched from linux, and no -# adjustment is necessary -# -#------------------------------------------------------------------------------ - -ifndef COMSPEC -ifdef ComSpec -COMSPEC = $(ComSpec) -endif # ComSpec -endif # COMSPEC - -ifdef COMSPEC # if Windows OS - -ifeq ($(MAKE_VERSION),3.81) -# -# adjust-path/adjust-path-mixed for Mingw Gnu Make on Windows -# -# Example Usage: -# $(call adjust-path,c:/aaa/bbb) => /c/aaa/bbb -# $(call adjust-path-mixed,/c/aaa/bbb) => c:/aaa/bbb -# $(call adjust-path-mixed,/cygdrive/c/aaa/bbb) => c:/aaa/bbb -# - -# -# adjust-path -# - converts back slash characters into forward slashes -# - if input arg ($1) is an empty string then return the empty string -# - if input arg ($1) does not contain the string ":/", then return input arg -# - using sed, convert mixed path [c:/...] into mingw path [/c/...] -define adjust-path -$(strip \ -$(if $1,\ -$(if $(findstring :/,$(subst \,/,$1)),\ -$(shell echo $(subst \,/,$1) | sed -e 's,^\([a-zA-Z]\):/,/\1/,'),\ -$(subst \,/,$1)))) -endef - -# -# adjust-path-mixed -# - converts back slash characters into forward slashes -# - if input arg ($1) is an empty string then return the empty string -# - if input arg ($1) does not begin with a forward slash '/' char, then -# return input arg -# - using sed, convert mingw path [/c/...] or cygwin path [/c/cygdrive/...] -# into a mixed path [c:/...] -define adjust-path-mixed -$(strip \ -$(if $1,\ -$(if $(findstring $(subst \,/,$1),$(patsubst /%,%,$(subst \,/,$1))),\ -$(subst \,/,$1),\ -$(shell echo $(subst \,/,$1) | sed -e 's,^/cygdrive/\([a-zA-Z]\)/,\1:/,' -e 's,^/\([a-zA-Z]\)/,\1:/,')))) -endef - -else # MAKE_VERSION != 3.81 (MAKE_VERSION == 3.80 or MAKE_VERSION == 3.79) -# -# adjust-path for Cygwin Gnu Make -# $(call adjust-path,c:/aaa/bbb) = /cygdrive/c/aaa/bbb -# $(call adjust-path-mixed,/cygdrive/c/aaa/bbb) = c:/aaa/bbb -# -adjust-path = $(if $1,$(shell cygpath -u "$1"),) -adjust-path-mixed = $(if $1,$(shell cygpath -m "$1"),) -endif - -else # !COMSPEC - -adjust-path = $1 -adjust-path-mixed = $1 - -endif # COMSPEC - - -#vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv -# GENERATED SETTINGS START v -#vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv - -#START GENERATED -ACTIVE_BUILD_CONFIG := default -BUILD_CONFIGS := default - -# The following TYPE comment allows tools to identify the 'type' of target this -# makefile is associated with. -# TYPE: APP_MAKEFILE - -# This following VERSION comment indicates the version of the tool used to -# generate this makefile. A makefile variable is provided for VERSION as well. -# ACDS_VERSION: 13.0sp1 -ACDS_VERSION := 13.0sp1 - -# This following BUILD_NUMBER comment indicates the build number of the tool -# used to generate this makefile. -# BUILD_NUMBER: 232 - -# Define path to the application ELF. -# It may be used by the makefile fragments so is defined before including them. -# -ELF := qsys_tutorial_green.elf - -# Paths to C, C++, and assembly source files. -C_SRCS := hello_world_small.c -CXX_SRCS := -ASM_SRCS := - - -# Path to root of object file tree. -OBJ_ROOT_DIR := obj - -# Options to control objdump. -CREATE_OBJDUMP := 1 -OBJDUMP_INCLUDE_SOURCE := 1 -OBJDUMP_FULL_CONTENTS := 0 - -# Options to enable/disable optional files. -CREATE_ELF_DERIVED_FILES := 0 -CREATE_LINKER_MAP := 1 - -# Common arguments for ALT_CFLAGSs -APP_CFLAGS_DEFINED_SYMBOLS := -APP_CFLAGS_UNDEFINED_SYMBOLS := -APP_CFLAGS_OPTIMIZATION := -Os -APP_CFLAGS_DEBUG_LEVEL := -g -APP_CFLAGS_WARNINGS := -Wall -APP_CFLAGS_USER_FLAGS := - -APP_ASFLAGS_USER := -APP_LDFLAGS_USER := - -# Linker options that have default values assigned later if not -# assigned here. -LINKER_SCRIPT := -CRT0 := -SYS_LIB := - -# Define path to the root of the BSP. -BSP_ROOT_DIR := ../qsys_tutorial_green_bsp/ - -# List of application specific include directories, library directories and library names -APP_INCLUDE_DIRS := -APP_LIBRARY_DIRS := -APP_LIBRARY_NAMES := - -# Pre- and post- processor settings. -BUILD_PRE_PROCESS := -BUILD_POST_PROCESS := - -QUARTUS_PROJECT_DIR := ../../ - - -#END GENERATED - -#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -# GENERATED SETTINGS END ^ -#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - -#------------------------------------------------------------------------------ -# DEFAULT TARGET -#------------------------------------------------------------------------------ - -# Define the variable used to echo output if not already defined. -ifeq ($(ECHO),) -ECHO := echo -endif - -# Put "all" rule before included makefile fragments because they may -# define rules and we don't want one of those to become the default rule. -.PHONY : all - -all: - @$(ECHO) [$(APP_NAME) build complete] - -all : build_pre_process libs app build_post_process - - -#------------------------------------------------------------------------------ -# VARIABLES DEPENDENT ON GENERATED CONTENT -#------------------------------------------------------------------------------ - -# Define object file directory per build configuration -CONFIG_OBJ_DIR := $(OBJ_ROOT_DIR)/$(ACTIVE_BUILD_CONFIG) - -ifeq ($(BSP_ROOT_DIR),) -$(error Edit Makefile and provide a value for BSP_ROOT_DIR) -endif - -ifeq ($(wildcard $(BSP_ROOT_DIR)),) -$(error BSP directory does not exist: $(BSP_ROOT_DIR)) -endif - -# Define absolute path to the root of the BSP. -ABS_BSP_ROOT_DIR := $(call adjust-path-mixed,$(shell cd "$(BSP_ROOT_DIR)"; pwd)) - -# Include makefile fragments. Define variable ALT_LIBRARY_ROOT_DIR before -# including each makefile fragment so that it knows the path to itself. -BSP_INCLUDE_FILE := $(BSP_ROOT_DIR)/public.mk -ALT_LIBRARY_ROOT_DIR := $(BSP_ROOT_DIR) -include $(BSP_INCLUDE_FILE) -# C2H will need this to touch the BSP public.mk and avoid the sopc file -# out-of-date error during a BSP make -ABS_BSP_INCLUDE_FILE := $(ABS_BSP_ROOT_DIR)/public.mk - - -ifneq ($(WARNING.SMALL_STACK_SIZE),) -# This WARNING is here to protect you from unknowingly using a very small stack -# If the warning is set, increase your stack size or enable the BSP small stack -# setting to eliminate the warning -$(warning WARNING: $(WARNING.SMALL_STACK_SIZE)) -endif - - -# If the BSP public.mk indicates that ALT_SIM_OPTIMIZE is set, rename the ELF -# by prefixing it with RUN_ON_HDL_SIMULATOR_ONLY_. -ifneq ($(filter -DALT_SIM_OPTIMIZE,$(ALT_CPPFLAGS)),) -ELF := RUN_ON_HDL_SIMULATOR_ONLY_$(ELF) -endif - -# If the BSP public.mk indicates that ALT_PROVIDE_GMON is set, add option to -# download_elf target -ifneq ($(filter -DALT_PROVIDE_GMON,$(ALT_CPPFLAGS)),) -GMON_OUT_FILENAME := gmon.out -WRITE_GMON_OPTION := --write-gmon $(GMON_OUT_FILENAME) -endif - -# Name of ELF application. -APP_NAME := $(basename $(ELF)) - -# Set to defaults if variables not already defined in settings. -ifeq ($(LINKER_SCRIPT),) -LINKER_SCRIPT := $(BSP_LINKER_SCRIPT) -endif -ifeq ($(CRT0),) -CRT0 := $(BSP_CRT0) -endif -ifeq ($(SYS_LIB),) -SYS_LIB := $(BSP_SYS_LIB) -endif - -OBJDUMP_NAME := $(APP_NAME).objdump -OBJDUMP_FLAGS := --disassemble --syms --all-header -ifeq ($(OBJDUMP_INCLUDE_SOURCE),1) -OBJDUMP_FLAGS += --source -endif -ifeq ($(OBJDUMP_FULL_CONTENTS),1) -OBJDUMP_FLAGS += --full-contents -endif - -# Create list of linker dependencies (*.a files). -APP_LDDEPS := $(ALT_LDDEPS) $(LDDEPS) - -# Take lists and add required prefixes. -APP_INC_DIRS := $(addprefix -I, $(ALT_INCLUDE_DIRS) $(APP_INCLUDE_DIRS) $(INC_DIRS)) -ASM_INC_PREFIX := -Wa,-I -APP_ASM_INC_DIRS := $(addprefix $(ASM_INC_PREFIX), $(ALT_INCLUDE_DIRS) $(APP_INCLUDE_DIRS) $(INC_DIRS)) -APP_LIB_DIRS := $(addprefix -L, $(ALT_LIBRARY_DIRS) $(APP_LIBRARY_DIRS) $(LIB_DIRS)) -APP_LIBS := $(addprefix -l, $(ALT_LIBRARY_NAMES) $(APP_LIBRARY_NAMES) $(LIBS)) - -ifneq ($(AVOID_NIOS2_GCC3_OPTIONS),) - -# -# Avoid Nios II GCC 3.X options. -# - -# Detect if small newlib C library is requested. -# If yes, remove the -msmallc option because it is -# now handled by other means. -ifneq ($(filter -msmallc,$(ALT_LDFLAGS)),) - ALT_LDFLAGS := $(filter-out -msmallc,$(ALT_LDFLAGS)) - ALT_C_LIBRARY := smallc -else - ALT_C_LIBRARY := c -endif - -# Put each BSP dependent library in a group to avoid circular dependencies. -APP_BSP_DEP_LIBS := $(foreach l,$(ALT_BSP_DEP_LIBRARY_NAMES),-Wl,--start-group -l$(ALT_C_LIBRARY) -lgcc -l$(l) -Wl,--end-group) - -else # !AVOID_NIOS2_GCC3_OPTIONS - -# -# Use Nios II GCC 3.X options. -# -APP_BSP_DEP_LIBS := $(addprefix -msys-lib=, $(ALT_BSP_DEP_LIBRARY_NAMES)) - -endif # !AVOID_NIOS2_GCC3_OPTIONS - -# Arguments for the C preprocessor, C/C++ compiler, assembler, and linker. -APP_CFLAGS := $(APP_CFLAGS_DEFINED_SYMBOLS) \ - $(APP_CFLAGS_UNDEFINED_SYMBOLS) \ - $(APP_CFLAGS_OPTIMIZATION) \ - $(APP_CFLAGS_DEBUG_LEVEL) \ - $(APP_CFLAGS_WARNINGS) \ - $(APP_CFLAGS_USER_FLAGS) \ - $(ALT_CFLAGS) \ - $(CFLAGS) - -# Arguments only for the C++ compiler. -APP_CXXFLAGS := $(ALT_CXXFLAGS) $(CXXFLAGS) - -# Arguments only for the C preprocessor. -# Prefix each include directory with -I. -APP_CPPFLAGS := $(APP_INC_DIRS) \ - $(ALT_CPPFLAGS) \ - $(CPPFLAGS) - -# Arguments only for the assembler. -APP_ASFLAGS := $(APP_ASM_INC_DIRS) \ - $(ALT_ASFLAGS) \ - $(APP_ASFLAGS_USER) \ - $(ASFLAGS) - -# Arguments only for the linker. -APP_LDFLAGS := $(APP_LDFLAGS_USER) - -ifneq ($(LINKER_SCRIPT),) -APP_LDFLAGS += -T'$(LINKER_SCRIPT)' -endif - -ifneq ($(AVOID_NIOS2_GCC3_OPTIONS),) - -# Avoid Nios II GCC 3.x options. -ifneq ($(CRT0),) -APP_LDFLAGS += $(CRT0) -endif - -# The equivalent of the -msys-lib option is provided -# by the GROUP() command in the linker script. -# Note this means the SYS_LIB variable is now ignored. - -else # !AVOID_NIOS2_GCC3_OPTIONS - -# Use Nios II GCC 3.x options. -ifneq ($(CRT0),) -APP_LDFLAGS += -msys-crt0='$(CRT0)' -endif -ifneq ($(SYS_LIB),) -APP_LDFLAGS += -msys-lib=$(SYS_LIB) -endif - -endif # !AVOID_NIOS2_GCC3_OPTIONS - -APP_LDFLAGS += \ - $(APP_LIB_DIRS) \ - $(ALT_LDFLAGS) \ - $(LDFLAGS) - -LINKER_MAP_NAME := $(APP_NAME).map -ifeq ($(CREATE_LINKER_MAP), 1) -APP_LDFLAGS += -Wl,-Map=$(LINKER_MAP_NAME) -endif - -# QUARTUS_PROJECT_DIR and SOPC_NAME need to be defined if you want the -# mem_init_install target of the mem_init.mk (located in the associated BSP) -# to know how to copy memory initialization files (e.g. .dat, .hex) into -# directories required for Quartus compilation or RTL simulation. - -# Defining QUARTUS_PROJECT_DIR causes mem_init_install to copy memory -# initialization files into your Quartus project directory. This is required -# to provide the initial memory contents of FPGA memories that can be -# initialized by the programming file (.sof) or Hardcopy ROMs. It is also used -# for VHDL simulation of on-chip memories. - -# Defining SOPC_NAME causes the mem_init_install target to copy memory -# initialization files into your RTL simulation directory. This is required -# to provide the initial memory contents of all memories that can be -# initialized by RTL simulation. This variable should be set to the same name -# as your SOPC Builder system name. For example, if you have a system called -# "foo.sopc", this variable should be set to "foo". - -# If SOPC_NAME is not set and QUARTUS_PROJECT_DIR is set, then derive SOPC_NAME. -ifeq ($(SOPC_NAME),) -ifneq ($(QUARTUS_PROJECT_DIR),) -SOPC_NAME := $(basename $(notdir $(wildcard $(QUARTUS_PROJECT_DIR)/*.sopcinfo))) -endif -endif - -# Defining JDI_FILE is required to specify the JTAG Debug Information File -# path. This file is generated by Quartus, and is needed along with the -# .sopcinfo file to resolve processor instance ID's from names in a multi-CPU -# systems. For multi-CPU systems, the processor instance ID is used to select -# from multiple CPU's during ELF download. - -# Both JDI_FILE and SOPCINFO_FILE are provided by the BSP if they found during -# BSP creation. If JDI_FILE is not set and QUARTUS_PROJECT_DIR is set, then -# derive JDI_FILE. We do not attempt to derive SOPCINFO_FILE since there may be -# multiple .sopcinfo files in a Quartus project. -ifeq ($(JDI_FILE),) -ifneq ($(QUARTUS_PROJECT_DIR),) -JDI_FILE := $(wildcard $(QUARTUS_PROJECT_DIR)/*.jdi) -endif -endif - -# Path to root runtime directory used for hdl simulation -RUNTIME_ROOT_DIR := $(CONFIG_OBJ_DIR)/runtime - - - -#------------------------------------------------------------------------------ -# MAKEFILE INCLUDES DEPENDENT ON GENERATED CONTENT -#------------------------------------------------------------------------------ -# mem_init.mk is a generated makefile fragment. This file defines all targets -# used to generate HDL initialization simulation files and pre-initialized -# onchip memory files. -MEM_INIT_FILE := $(BSP_ROOT_DIR)/mem_init.mk -include $(MEM_INIT_FILE) - -# Create list of object files to be built using the list of source files. -# The source file hierarchy is preserved in the object tree. -# The supported file extensions are: -# -# .c - for C files -# .cxx .cc .cpp - for C++ files -# .S .s - for assembler files -# -# Handle source files specified by --src-dir & --src-rdir differently, to -# save some processing time in calling the adjust-path macro. - -OBJ_LIST_C := $(patsubst %.c,%.o,$(filter %.c,$(C_SRCS))) -OBJ_LIST_CPP := $(patsubst %.cpp,%.o,$(filter %.cpp,$(CXX_SRCS))) -OBJ_LIST_CXX := $(patsubst %.cxx,%.o,$(filter %.cxx,$(CXX_SRCS))) -OBJ_LIST_CC := $(patsubst %.cc,%.o,$(filter %.cc,$(CXX_SRCS))) -OBJ_LIST_S := $(patsubst %.S,%.o,$(filter %.S,$(ASM_SRCS))) -OBJ_LIST_SS := $(patsubst %.s,%.o,$(filter %.s,$(ASM_SRCS))) - -OBJ_LIST := $(sort $(OBJ_LIST_C) $(OBJ_LIST_CPP) $(OBJ_LIST_CXX) \ - $(OBJ_LIST_CC) $(OBJ_LIST_S) $(OBJ_LIST_SS)) - -SDIR_OBJ_LIST_C := $(patsubst %.c,%.o,$(filter %.c,$(SDIR_C_SRCS))) -SDIR_OBJ_LIST_CPP := $(patsubst %.cpp,%.o,$(filter %.cpp,$(SDIR_CXX_SRCS))) -SDIR_OBJ_LIST_CXX := $(patsubst %.cxx,%.o,$(filter %.cxx,$(SDIR_CXX_SRCS))) -SDIR_OBJ_LIST_CC := $(patsubst %.cc,%.o,$(filter %.cc,$(SDIR_CXX_SRCS))) -SDIR_OBJ_LIST_S := $(patsubst %.S,%.o,$(filter %.S,$(SDIR_ASM_SRCS))) -SDIR_OBJ_LIST_SS := $(patsubst %.s,%.o,$(filter %.s,$(SDIR_ASM_SRCS))) - -SDIR_OBJ_LIST := $(sort $(SDIR_OBJ_LIST_C) $(SDIR_OBJ_LIST_CPP) \ - $(SDIR_OBJ_LIST_CXX) $(SDIR_OBJ_LIST_CC) $(SDIR_OBJ_LIST_S) \ - $(SDIR_OBJ_LIST_SS)) - -# Relative-pathed objects that being with "../" are handled differently. -# -# Regular objects are created as -# $(CONFIG_OBJ_DIR)//.o -# where the path structure is maintained under the obj directory. This -# applies for both absolute and relative paths; in the absolute path -# case this means the entire source path will be recreated under the obj -# directory. This is done to allow two source files with the same name -# to be included as part of the project. -# -# Note: On Cygwin, the path recreated under the obj directory will be -# the cygpath -u output path. -# -# Relative-path objects that begin with "../" cause problems under this -# scheme, as $(CONFIG_OBJ_DIR)/..// can potentially put the object -# files anywhere in the system, creating clutter and polluting the source tree. -# As such, their paths are flattened - the object file created will be -# $(CONFIG_OBJ_DIR)/.o. Due to this, two files specified with -# "../" in the beginning cannot have the same name in the project. VPATH -# will be set for these sources to allow make to relocate the source file -# via %.o rules. -# -# The following lines separate the object list into the flatten and regular -# lists, and then handles them as appropriate. - -FLATTEN_OBJ_LIST := $(filter ../%,$(OBJ_LIST)) -FLATTEN_APP_OBJS := $(addprefix $(CONFIG_OBJ_DIR)/,$(notdir $(FLATTEN_OBJ_LIST))) - -REGULAR_OBJ_LIST := $(filter-out $(FLATTEN_OBJ_LIST),$(OBJ_LIST)) -REGULAR_OBJ_LIST_C := $(filter $(OBJ_LIST_C),$(REGULAR_OBJ_LIST)) -REGULAR_OBJ_LIST_CPP := $(filter $(OBJ_LIST_CPP),$(REGULAR_OBJ_LIST)) -REGULAR_OBJ_LIST_CXX := $(filter $(OBJ_LIST_CXX),$(REGULAR_OBJ_LIST)) -REGULAR_OBJ_LIST_CC := $(filter $(OBJ_LIST_CC),$(REGULAR_OBJ_LIST)) -REGULAR_OBJ_LIST_S := $(filter $(OBJ_LIST_S),$(REGULAR_OBJ_LIST)) -REGULAR_OBJ_LIST_SS := $(filter $(OBJ_LIST_SS),$(REGULAR_OBJ_LIST)) - -FLATTEN_SDIR_OBJ_LIST := $(filter ../%,$(SDIR_OBJ_LIST)) -FLATTEN_SDIR_APP_OBJS := $(addprefix $(CONFIG_OBJ_DIR)/,$(notdir $(FLATTEN_SDIR_OBJ_LIST))) - -REGULAR_SDIR_OBJ_LIST := $(filter-out $(FLATTEN_SDIR_OBJ_LIST),$(SDIR_OBJ_LIST)) -REGULAR_SDIR_OBJ_LIST_C := $(filter $(SDIR_OBJ_LIST_C),$(REGULAR_SDIR_OBJ_LIST)) -REGULAR_SDIR_OBJ_LIST_CPP := $(filter $(SDIR_OBJ_LIST_CPP),$(REGULAR_SDIR_OBJ_LIST)) -REGULAR_SDIR_OBJ_LIST_CXX := $(filter $(SDIR_OBJ_LIST_CXX),$(REGULAR_SDIR_OBJ_LIST)) -REGULAR_SDIR_OBJ_LIST_CC := $(filter $(SDIR_OBJ_LIST_CC),$(REGULAR_SDIR_OBJ_LIST)) -REGULAR_SDIR_OBJ_LIST_S := $(filter $(SDIR_OBJ_LIST_S),$(REGULAR_SDIR_OBJ_LIST)) -REGULAR_SDIR_OBJ_LIST_SS := $(filter $(SDIR_OBJ_LIST_SS),$(REGULAR_SDIR_OBJ_LIST)) - -VPATH := $(sort $(dir $(FLATTEN_OBJ_LIST)) $(dir $(FLATTEN_SDIR_OBJ_LIST))) - -APP_OBJS_C := $(addprefix $(CONFIG_OBJ_DIR)/,\ - $(REGULAR_SDIR_OBJ_LIST_C) \ - $(foreach s,$(REGULAR_OBJ_LIST_C),$(call adjust-path,$s))) - -APP_OBJS_CPP := $(addprefix $(CONFIG_OBJ_DIR)/,\ - $(REGULAR_SDIR_OBJ_LIST_CPP) \ - $(foreach s,$(REGULAR_OBJ_LIST_CPP),$(call adjust-path,$s))) - -APP_OBJS_CXX := $(addprefix $(CONFIG_OBJ_DIR)/,\ - $(REGULAR_SDIR_OBJ_LIST_CXX) \ - $(foreach s,$(REGULAR_OBJ_LIST_CXX),$(call adjust-path,$s))) - -APP_OBJS_CC := $(addprefix $(CONFIG_OBJ_DIR)/,\ - $(REGULAR_SDIR_OBJ_LIST_CC) \ - $(foreach s,$(REGULAR_OBJ_LIST_CC),$(call adjust-path,$s))) - -APP_OBJS_S := $(addprefix $(CONFIG_OBJ_DIR)/,\ - $(REGULAR_SDIR_OBJ_LIST_S) \ - $(foreach s,$(REGULAR_OBJ_LIST_S),$(call adjust-path,$s))) - -APP_OBJS_SS := $(addprefix $(CONFIG_OBJ_DIR)/,\ - $(REGULAR_SDIR_OBJ_LIST_SS) \ - $(foreach s,$(REGULAR_OBJ_LIST_SS),$(call adjust-path,$s))) - -APP_OBJS := $(APP_OBJS_C) $(APP_OBJS_CPP) $(APP_OBJS_CXX) $(APP_OBJS_CC) \ - $(APP_OBJS_S) $(APP_OBJS_SS) \ - $(FLATTEN_APP_OBJS) $(FLATTEN_SDIR_APP_OBJS) - -# Add any extra user-provided object files. -APP_OBJS += $(OBJS) - -# Create list of dependancy files for each object file. -APP_DEPS := $(APP_OBJS:.o=.d) - -# Patch the Elf file with system specific information - -# Patch the Elf with the name of the sopc system -ifneq ($(SOPC_NAME),) -ELF_PATCH_FLAG += --sopc_system_name $(SOPC_NAME) -endif - -# Patch the Elf with the absolute path to the Quartus Project Directory -ifneq ($(QUARTUS_PROJECT_DIR),) -ABS_QUARTUS_PROJECT_DIR := $(call adjust-path-mixed,$(shell cd "$(QUARTUS_PROJECT_DIR)"; pwd)) -ELF_PATCH_FLAG += --quartus_project_dir "$(ABS_QUARTUS_PROJECT_DIR)" -endif - -# Patch the Elf and download args with the JDI_FILE if specified -ifneq ($(wildcard $(JDI_FILE)),) -ELF_PATCH_FLAG += --jdi $(JDI_FILE) -DOWNLOAD_JDI_FLAG := --jdi $(JDI_FILE) -endif - -# Patch the Elf with the SOPCINFO_FILE if specified -ifneq ($(wildcard $(SOPCINFO_FILE)),) -ELF_PATCH_FLAG += --sopcinfo $(SOPCINFO_FILE) -endif - -# Use the DOWNLOAD_CABLE variable to specify which JTAG cable to use. -# This is not needed if you only have one cable. -ifneq ($(DOWNLOAD_CABLE),) -DOWNLOAD_CABLE_FLAG := --cable '$(DOWNLOAD_CABLE)' -endif - - -#------------------------------------------------------------------------------ -# BUILD PRE/POST PROCESS -#------------------------------------------------------------------------------ -build_pre_process : - $(BUILD_PRE_PROCESS) - -build_post_process : - $(BUILD_POST_PROCESS) - -.PHONY: build_pre_process build_post_process - - -#------------------------------------------------------------------------------ -# TOOLS -#------------------------------------------------------------------------------ - -# -# Set tool default variables if not already defined. -# If these are defined, they would typically be defined in an -# included makefile fragment. -# -ifeq ($(DEFAULT_CROSS_COMPILE),) -DEFAULT_CROSS_COMPILE := nios2-elf- -endif - -ifeq ($(DEFAULT_STACK_REPORT),) -DEFAULT_STACKREPORT := nios2-stackreport -endif - -ifeq ($(DEFAULT_DOWNLOAD),) -DEFAULT_DOWNLOAD := nios2-download -endif - -ifeq ($(DEFAULT_FLASHPROG),) -DEFAULT_FLASHPROG := nios2-flash-programmer -endif - -ifeq ($(DEFAULT_ELFPATCH),) -DEFAULT_ELFPATCH := nios2-elf-insert -endif - -ifeq ($(DEFAULT_RM),) -DEFAULT_RM := rm -f -endif - -ifeq ($(DEFAULT_CP),) -DEFAULT_CP := cp -f -endif - -ifeq ($(DEFAULT_MKDIR),) -DEFAULT_MKDIR := mkdir -p -endif - -# -# Set tool variables to defaults if not already defined. -# If these are defined, they would typically be defined by a -# setting in the generated portion of this makefile. -# -ifeq ($(CROSS_COMPILE),) -CROSS_COMPILE := $(DEFAULT_CROSS_COMPILE) -endif - -ifeq ($(origin CC),default) -CC := $(CROSS_COMPILE)gcc -xc -endif - -ifeq ($(origin CXX),default) -CXX := $(CROSS_COMPILE)gcc -xc++ -endif - -ifeq ($(origin AS),default) -AS := $(CROSS_COMPILE)gcc -endif - -ifeq ($(origin AR),default) -AR := $(CROSS_COMPILE)ar -endif - -ifeq ($(origin LD),default) -LD := $(CROSS_COMPILE)g++ -endif - -ifeq ($(origin NM),default) -NM := $(CROSS_COMPILE)nm -endif - -ifeq ($(origin RM),default) -RM := $(DEFAULT_RM) -endif - -ifeq ($(origin CP),default) -CP := $(DEFAULT_CP) -endif - -ifeq ($(OBJDUMP),) -OBJDUMP := $(CROSS_COMPILE)objdump -endif - -ifeq ($(OBJCOPY),) -OBJCOPY := $(CROSS_COMPILE)objcopy -endif - -ifeq ($(STACKREPORT),) -ifeq ($(CROSS_COMPILE),nios2-elf-) -STACKREPORT := $(DEFAULT_STACKREPORT) -else -DISABLE_STACKREPORT := 1 -endif -endif - -ifeq ($(DOWNLOAD),) -DOWNLOAD := $(DEFAULT_DOWNLOAD) -endif - -ifeq ($(FLASHPROG),) -FLASHPROG := $(DEFAULT_FLASHPROG) -endif - -ifeq ($(ELFPATCH),) -ELFPATCH := $(DEFAULT_ELFPATCH) -endif - -ifeq ($(MKDIR),) -MKDIR := $(DEFAULT_MKDIR) -endif - -#------------------------------------------------------------------------------ -# PATTERN RULES TO BUILD OBJECTS -#------------------------------------------------------------------------------ - -define compile.c -@$(ECHO) Info: Compiling $< to $@ -@$(MKDIR) $(@D) -$(CC) -MP -MMD -c $(APP_CPPFLAGS) $(APP_CFLAGS) -o $@ $< -$(CC_POST_PROCESS) -endef - -define compile.cpp -@$(ECHO) Info: Compiling $< to $@ -@$(MKDIR) $(@D) -$(CXX) -MP -MMD -c $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< -$(CXX_POST_PROCESS) -endef - -# If assembling with the compiler, ensure "-Wa," is prepended to all APP_ASFLAGS -ifeq ($(AS),$(patsubst %as,%,$(AS))) -COMMA := , -APP_ASFLAGS := $(filter-out $(APP_CFLAGS),$(addprefix -Wa$(COMMA),$(patsubst -Wa$(COMMA)%,%,$(APP_ASFLAGS)))) -endif - -define compile.s -@$(ECHO) Info: Assembling $< to $@ -@$(MKDIR) $(@D) -$(AS) -MP -MMD -c $(APP_CPPFLAGS) $(APP_CFLAGS) $(APP_ASFLAGS) -o $@ $< -$(AS_POST_PROCESS) -endef - -ifeq ($(MAKE_VERSION),3.81) -.SECONDEXPANSION: - -$(APP_OBJS_C): $(CONFIG_OBJ_DIR)/%.o: $$(call adjust-path-mixed,%.c) - $(compile.c) - -$(APP_OBJS_CPP): $(CONFIG_OBJ_DIR)/%.o: $$(call adjust-path-mixed,%.cpp) - $(compile.cpp) - -$(APP_OBJS_CC): $(CONFIG_OBJ_DIR)/%.o: $$(call adjust-path-mixed,%.cc) - $(compile.cpp) - -$(APP_OBJS_CXX): $(CONFIG_OBJ_DIR)/%.o: $$(call adjust-path-mixed,%.cxx) - $(compile.cpp) - -$(APP_OBJS_S): $(CONFIG_OBJ_DIR)/%.o: $$(call adjust-path-mixed,%.S) - $(compile.s) - -$(APP_OBJS_SS): $(CONFIG_OBJ_DIR)/%.o: $$(call adjust-path-mixed,%.s) - $(compile.s) - -endif # MAKE_VERSION != 3.81 - -$(CONFIG_OBJ_DIR)/%.o: %.c - $(compile.c) - -$(CONFIG_OBJ_DIR)/%.o: %.cpp - $(compile.cpp) - -$(CONFIG_OBJ_DIR)/%.o: %.cc - $(compile.cpp) - -$(CONFIG_OBJ_DIR)/%.o: %.cxx - $(compile.cpp) - -$(CONFIG_OBJ_DIR)/%.o: %.S - $(compile.s) - -$(CONFIG_OBJ_DIR)/%.o: %.s - $(compile.s) - - -#------------------------------------------------------------------------------ -# PATTERN RULES TO INTERMEDIATE FILES -#------------------------------------------------------------------------------ - -$(CONFIG_OBJ_DIR)/%.s: %.c - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CC) -S $(APP_CPPFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.s: %.cpp - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CXX) -S $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.s: %.cc - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CXX) -S $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.s: %.cxx - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CXX) -S $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.i: %.c - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CC) -E $(APP_CPPFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.i: %.cpp - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CXX) -E $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.i: %.cc - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CXX) -E $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.i: %.cxx - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CXX) -E $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< - - -#------------------------------------------------------------------------------ -# TARGET RULES -#------------------------------------------------------------------------------ - -.PHONY : help -help : - @$(ECHO) "Summary of Makefile targets" - @$(ECHO) " Build targets:" - @$(ECHO) " all (default) - Application and all libraries (including BSP)" - @$(ECHO) " bsp - Just the BSP" - @$(ECHO) " libs - All libraries (including BSP)" - @$(ECHO) " flash - All flash files" - @$(ECHO) " mem_init_generate - All memory initialization files" -ifeq ($(QSYS),1) - @$(ECHO) " mem_init_install - This target is deprecated for QSys Systems" - @$(ECHO) " --> Use the mem_init_generate target and then" - @$(ECHO) " add the generated meminit.qip file to your" - @$(ECHO) " Quartus II Project." -else # if QSYS != 1 - @$(ECHO) " mem_init_install - Copy memory initialization files to Quartus II project" -endif # QSYS == 1 - @$(ECHO) - @$(ECHO) " Clean targets:" - @$(ECHO) " clean_all - Application and all libraries (including BSP)" - @$(ECHO) " clean - Just the application" - @$(ECHO) " clean_bsp - Just the BSP" - @$(ECHO) " clean_libs - All libraries (including BSP)" - @$(ECHO) - @$(ECHO) " Run targets:" - @$(ECHO) " download-elf - Download and run your elf executable" - @$(ECHO) " program-flash - Program flash contents to the board" - -# Handy rule to skip making libraries and just make application. -.PHONY : app -app : $(ELF) - -ifeq ($(CREATE_OBJDUMP), 1) -app : $(OBJDUMP_NAME) -endif - -ifeq ($(CREATE_ELF_DERIVED_FILES),1) -app : elf_derived_files -endif - -.PHONY: elf_derived_files -elf_derived_files: default_mem_init - -# Handy rule for making just the BSP. -.PHONY : bsp -bsp : - @$(ECHO) Info: Building $(BSP_ROOT_DIR) - @$(MAKE) --no-print-directory -C $(BSP_ROOT_DIR) - - -# Make sure all makeable libraries (including the BSP) are up-to-date. -LIB_TARGETS := $(patsubst %,%-recurs-make-lib,$(MAKEABLE_LIBRARY_ROOT_DIRS)) - -.PHONY : libs -libs : $(LIB_TARGETS) - -ifneq ($(strip $(LIB_TARGETS)),) -$(LIB_TARGETS): %-recurs-make-lib: - @$(ECHO) Info: Building $* - $(MAKE) --no-print-directory -C $* -endif - -ifneq ($(strip $(APP_LDDEPS)),) -$(APP_LDDEPS): libs - @true -endif - -# Rules to force your project to rebuild or relink -# .force_relink file will cause any application that depends on this project to relink -# .force_rebuild file will cause this project to rebuild object files -# .force_rebuild_all file will cause this project and any project that depends on this project to rebuild object files - -FORCE_RELINK_DEP := .force_relink -FORCE_REBUILD_DEP := .force_rebuild -FORCE_REBUILD_ALL_DEP := .force_rebuild_all -FORCE_REBUILD_DEP_LIST := $(CONFIG_OBJ_DIR)/$(FORCE_RELINK_DEP) $(CONFIG_OBJ_DIR)/$(FORCE_REBUILD_DEP) $(FORCE_REBUILD_ALL_DEP) - -$(FORCE_REBUILD_DEP_LIST): - -$(APP_OBJS): $(wildcard $(CONFIG_OBJ_DIR)/$(FORCE_REBUILD_DEP)) $(wildcard $(addsuffix /$(FORCE_REBUILD_ALL_DEP), . $(ALT_LIBRARY_DIRS))) - -$(ELF): $(wildcard $(addsuffix /$(FORCE_RELINK_DEP), $(CONFIG_OBJ_DIR) $(ALT_LIBRARY_DIRS))) - - -# Clean just the application. -.PHONY : clean -ifeq ($(CREATE_ELF_DERIVED_FILES),1) -clean : clean_elf_derived_files -endif - -clean : - @$(RM) -r $(ELF) $(OBJDUMP_NAME) $(LINKER_MAP_NAME) $(OBJ_ROOT_DIR) $(RUNTIME_ROOT_DIR) $(FORCE_REBUILD_DEP_LIST) - @$(ECHO) [$(APP_NAME) clean complete] - -# Clean just the BSP. -.PHONY : clean_bsp -clean_bsp : - @$(ECHO) Info: Cleaning $(BSP_ROOT_DIR) - @$(MAKE) --no-print-directory -C $(BSP_ROOT_DIR) clean - -# Clean all makeable libraries including the BSP. -LIB_CLEAN_TARGETS := $(patsubst %,%-recurs-make-clean-lib,$(MAKEABLE_LIBRARY_ROOT_DIRS)) - -.PHONY : clean_libs -clean_libs : $(LIB_CLEAN_TARGETS) - -ifneq ($(strip $(LIB_CLEAN_TARGETS)),) -$(LIB_CLEAN_TARGETS): %-recurs-make-clean-lib: - @$(ECHO) Info: Cleaning $* - $(MAKE) --no-print-directory -C $* clean -endif - -.PHONY: clean_elf_derived_files -clean_elf_derived_files: mem_init_clean - -# Clean application and all makeable libraries including the BSP. -.PHONY : clean_all -clean_all : clean mem_init_clean clean_libs - -# Include the dependency files unless the make goal is performing a clean -# of the application. -ifneq ($(firstword $(MAKECMDGOALS)),clean) -ifneq ($(firstword $(MAKECMDGOALS)),clean_all) --include $(APP_DEPS) -endif -endif - -.PHONY : download-elf -download-elf : $(ELF) - @if [ "$(DOWNLOAD)" = "none" ]; \ - then \ - $(ECHO) Downloading $(ELF) not supported; \ - else \ - $(ECHO) Info: Downloading $(ELF); \ - $(DOWNLOAD) --go --cpu_name=$(CPU_NAME) $(DOWNLOAD_CABLE_FLAG) $(SOPC_SYSID_FLAG) $(DOWNLOAD_JDI_FLAG) $(WRITE_GMON_OPTION) $(ELF); \ - fi - -# Delete the target of a rule if it has changed and its commands exit -# with a nonzero exit status. -.DELETE_ON_ERROR: - -# Rules for flash programming commands -PROGRAM_FLASH_SUFFIX := -program -PROGRAM_FLASH_TARGET := $(addsuffix $(PROGRAM_FLASH_SUFFIX), $(FLASH_FILES)) - -.PHONY : program-flash -program-flash : $(PROGRAM_FLASH_TARGET) - -.PHONY : $(PROGRAM_FLASH_TARGET) -$(PROGRAM_FLASH_TARGET) : flash - @if [ "$(FLASHPROG)" = "none" ]; \ - then \ - $(ECHO) Programming flash not supported; \ - else \ - $(ECHO) Info: Programming $(basename $@).flash; \ - if [ -z "$($(basename $@)_EPCS_FLAGS)" ]; \ - then \ - $(ECHO) $(FLASHPROG) $(SOPC_SYSID_FLAG) --base=$($(basename $@)_START) $(basename $@).flash; \ - $(FLASHPROG) $(DOWNLOAD_CABLE_FLAG) $(SOPC_SYSID_FLAG) --base=$($(basename $@)_START) $(basename $@).flash; \ - else \ - $(ECHO) $(FLASHPROG) $(SOPC_SYSID_FLAG) --epcs --base=$($(basename $@)_START) $(basename $@).flash; \ - $(FLASHPROG) $(DOWNLOAD_CABLE_FLAG) $(SOPC_SYSID_FLAG) --epcs --base=$($(basename $@)_START) $(basename $@).flash; \ - fi \ - fi - - -# Rules for simulating with an HDL Simulator [QSYS only] -ifeq ($(QSYS),1) -IP_MAKE_SIMSCRIPT := ip-make-simscript - -ifeq ($(VSIM),) -VSIM_EXE := "$(if $(VSIM_DIR),$(VSIM_DIR)/,)vsim" -ifeq ($(ENABLE_VSIM_GUI),1) -VSIM := $(VSIM_EXE) -gui -else -VSIM := $(VSIM_EXE) -c -endif # ENABLE_VSIM_GUI == 1 -endif # VSIM not set - -ifeq ($(SPD),) -ifneq ($(ABS_QUARTUS_PROJECT_DIR),) -ifneq ($(SOPC_NAME),) -SPD := $(ABS_QUARTUS_PROJECT_DIR)/$(SOPC_NAME)_tb.spd -endif # SOPC_NAME set -endif # ABS_QUARTUS_PROJECT_DIR set -endif # SPD == empty string - -ifeq ($(MSIM_SCRIPT),) -SIM_SCRIPT_DIR := $(RUNTIME_ROOT_DIR)/sim -MSIM_SCRIPT := $(SIM_SCRIPT_DIR)/mentor/msim_setup.tcl -endif # MSIM_SCRIPT == empty string - -ifeq ($(MAKE_VERSION),3.81) -ABS_MEM_INIT_DESCRIPTOR_FILE := $(abspath $(MEM_INIT_DESCRIPTOR_FILE)) -else -ABS_MEM_INIT_DESCRIPTOR_FILE := $(call adjust-path-mixed,$(shell pwd))/$(MEM_INIT_DESCRIPTOR_FILE) -endif - -$(MSIM_SCRIPT): $(SPD) $(MEM_INIT_DESCRIPTOR_FILE) -ifeq ($(SPD),) - $(error No SPD file specified. Ensure QUARTUS_PROJECT_DIR variable is set) -endif - @$(MKDIR) $(SIM_SCRIPT_DIR) - $(IP_MAKE_SIMSCRIPT) --spd=$(SPD) --spd=$(MEM_INIT_DESCRIPTOR_FILE) --output-directory=$(SIM_SCRIPT_DIR) - -VSIM_COMMAND = \ - cd $(dir $(MSIM_SCRIPT)) && \ - $(VSIM) -do "do $(notdir $(MSIM_SCRIPT)); ld; $(if $(VSIM_RUN_TIME),run ${VSIM_RUN_TIME};quit;)" - -.PHONY: sim -sim: $(MSIM_SCRIPT) mem_init_generate -ifeq ($(MSIM_SCRIPT),) - $(error MSIM_SCRIPT not set) -endif - $(VSIM_COMMAND) - -endif # QSYS == 1 - - -#------------------------------------------------------------------------------ -# ELF TARGET RULE -#------------------------------------------------------------------------------ -# Rule for constructing the executable elf file. -$(ELF) : $(APP_OBJS) $(LINKER_SCRIPT) $(APP_LDDEPS) - @$(ECHO) Info: Linking $@ - $(LD) $(APP_LDFLAGS) $(APP_CFLAGS) -o $@ $(filter-out $(CRT0),$(APP_OBJS)) $(APP_LIBS) $(APP_BSP_DEP_LIBS) -ifneq ($(DISABLE_ELFPATCH),1) - $(ELFPATCH) $@ $(ELF_PATCH_FLAG) -endif -ifneq ($(DISABLE_STACKREPORT),1) - @bash -c "$(STACKREPORT) $@" -endif - -$(OBJDUMP_NAME) : $(ELF) - @$(ECHO) Info: Creating $@ - $(OBJDUMP) $(OBJDUMP_FLAGS) $< >$@ - -# Rule for printing the name of the elf file -.PHONY: print-elf-name -print-elf-name: - @$(ECHO) $(ELF) - - diff --git a/software/qsys_tutorial_green/create-this-app b/software/qsys_tutorial_green/create-this-app deleted file mode 100644 index 0b739a2..0000000 --- a/software/qsys_tutorial_green/create-this-app +++ /dev/null @@ -1,114 +0,0 @@ -#!/bin/bash -# -# This script creates the hello_world_small application in this directory. - - -BSP_DIR=../qsys_tutorial_green_bsp -QUARTUS_PROJECT_DIR=../../ -NIOS2_APP_GEN_ARGS="--elf-name qsys_tutorial_green.elf --set APP_CFLAGS_OPTIMIZATION -Os --set OBJDUMP_INCLUDE_SOURCE 1 --src-files hello_world_small.c" - - -# First, check to see if $SOPC_KIT_NIOS2 environmental variable is set. -# This variable is required for the command line tools to execute correctly. -if [ -z "${SOPC_KIT_NIOS2}" ] -then - echo Required \$SOPC_KIT_NIOS2 Environmental Variable is not set! - exit 1 -fi - - -# Also make sure that the APP has not been created already. Check for -# existence of Makefile in the app directory -if [ -f ./Makefile ] -then - echo Application has already been created! Delete Makefile if you want to create a new application makefile - exit 1 -fi - - -# We are selecting hal_reduced_footprint bsp because it supports this application. -# Check to see if the hal_reduced_footprint has already been generated by checking for -# existence of the public.mk file. If not, we need to run -# create-this-bsp file to generate the bsp. -if [ ! -f ${BSP_DIR}/public.mk ]; then - # Since BSP doesn't exist, create the BSP - # Pass any command line arguments passed to this script to the BSP. - pushd ${BSP_DIR} >> /dev/null - ./create-this-bsp "$@" || { - echo "create-this-bsp failed" - exit 1 - } - popd >> /dev/null -fi - - -# Don't run make if create-this-app script is called with --no-make arg -SKIP_MAKE= -while [ $# -gt 0 ] -do - case "$1" in - --no-make) - SKIP_MAKE=1 - ;; - esac - shift -done - - -# Now we also need to go copy the sources for this application to the -# local directory. -find "${SOPC_KIT_NIOS2}/examples/software/hello_world_small/" -name '*.c' -or -name '*.h' -or -name 'hostfs*' | xargs -i cp -L {} ./ || { - echo "failed during copying example source files" - exit 1 -} - -find "${SOPC_KIT_NIOS2}/examples/software/hello_world_small/" -name 'readme.txt' -or -name 'Readme.txt' | xargs -i cp -L {} ./ || { - echo "failed copying readme file" -} - -if [ -d "${SOPC_KIT_NIOS2}/examples/software/hello_world_small/system" ] -then - cp -RL "${SOPC_KIT_NIOS2}/examples/software/hello_world_small/system" . || { - echo "failed during copying project support files" - exit 1 - } -fi - -chmod -R +w . || { - echo "failed during changing file permissions" - exit 1 -} - -cmd="nios2-app-generate-makefile --bsp-dir ${BSP_DIR} --set QUARTUS_PROJECT_DIR=${QUARTUS_PROJECT_DIR} ${NIOS2_APP_GEN_ARGS}" - -echo "create-this-app: Running \"${cmd}\"" -$cmd || { - echo "nios2-app-generate-makefile failed" - exit 1 -} - -if [ -z "$SKIP_MAKE" ]; then - cmd="make" - - echo "create-this-app: Running \"$cmd\"" - $cmd || { - echo "make failed" - exit 1 - } - - echo - echo "To download and run the application:" - echo " 1. Make sure the board is connected to the system." - echo " 2. Run 'nios2-configure-sof ' to configure the FPGA with the hardware design." - echo " 3. If you have a stdio device, run 'nios2-terminal' in a different shell." - echo " 4. Run 'make download-elf' from the application directory." - echo - echo "To debug the application:" - echo " Import the project into Nios II Software Build Tools for Eclipse." - echo " Refer to Nios II Software Build Tools for Eclipse Documentation for more information." - echo - echo -e "" -fi - - -exit 0 diff --git a/software/qsys_tutorial_green/hello_world_small.c b/software/qsys_tutorial_green/hello_world_small.c deleted file mode 100644 index cf67858..0000000 --- a/software/qsys_tutorial_green/hello_world_small.c +++ /dev/null @@ -1,110 +0,0 @@ -/* - * "Small Hello World" example. - * - * This example prints 'Hello from Nios II' to the STDOUT stream. It runs on - * the Nios II 'standard', 'full_featured', 'fast', and 'low_cost' example - * designs. It requires a STDOUT device in your system's hardware. - * - * The purpose of this example is to demonstrate the smallest possible Hello - * World application, using the Nios II HAL library. The memory footprint - * of this hosted application is ~332 bytes by default using the standard - * reference design. For a more fully featured Hello World application - * example, see the example titled "Hello World". - * - * The memory footprint of this example has been reduced by making the - * following changes to the normal "Hello World" example. - * Check in the Nios II Software Developers Manual for a more complete - * description. - * - * In the SW Application project (small_hello_world): - * - * - In the C/C++ Build page - * - * - Set the Optimization Level to -Os - * - * In System Library project (small_hello_world_syslib): - * - In the C/C++ Build page - * - * - Set the Optimization Level to -Os - * - * - Define the preprocessor option ALT_NO_INSTRUCTION_EMULATION - * This removes software exception handling, which means that you cannot - * run code compiled for Nios II cpu with a hardware multiplier on a core - * without a the multiply unit. Check the Nios II Software Developers - * Manual for more details. - * - * - In the System Library page: - * - Set Periodic system timer and Timestamp timer to none - * This prevents the automatic inclusion of the timer driver. - * - * - Set Max file descriptors to 4 - * This reduces the size of the file handle pool. - * - * - Check Main function does not exit - * - Uncheck Clean exit (flush buffers) - * This removes the unneeded call to exit when main returns, since it - * won't. - * - * - Check Don't use C++ - * This builds without the C++ support code. - * - * - Check Small C library - * This uses a reduced functionality C library, which lacks - * support for buffering, file IO, floating point and getch(), etc. - * Check the Nios II Software Developers Manual for a complete list. - * - * - Check Reduced device drivers - * This uses reduced functionality drivers if they're available. For the - * standard design this means you get polled UART and JTAG UART drivers, - * no support for the LCD driver and you lose the ability to program - * CFI compliant flash devices. - * - * - Check Access device drivers directly - * This bypasses the device file system to access device drivers directly. - * This eliminates the space required for the device file system services. - * It also provides a HAL version of libc services that access the drivers - * directly, further reducing space. Only a limited number of libc - * functions are available in this configuration. - * - * - Use ALT versions of stdio routines: - * - * Function Description - * =============== ===================================== - * alt_printf Only supports %s, %x, and %c ( < 1 Kbyte) - * alt_putstr Smaller overhead than puts with direct drivers - * Note this function doesn't add a newline. - * alt_putchar Smaller overhead than putchar with direct drivers - * alt_getchar Smaller overhead than getchar with direct drivers - * - */ - -#include "sys/alt_stdio.h" - -#if 0 -int main() -{ - alt_putstr("Hello from Nios II!\n"); - - /* Event loop never exits. */ - while (1); - - return 0; -} -#endif - -#define switches (volatile char *) 0x0002010 -#define ledrs (volatile int *) 0x0002000 -void main() -{ - - unsigned long i = 0; - volatile int j = 0; - while(1){ - *ledrs = i++; - if (i > (unsigned long)1<<18) i = 0; - for (j = 0; j < 100; j++); - } - - //while (1) - //*leds = *switches; -} diff --git a/software/qsys_tutorial_green/obj/default/hello_world_small.d b/software/qsys_tutorial_green/obj/default/hello_world_small.d deleted file mode 100644 index 821f301..0000000 --- a/software/qsys_tutorial_green/obj/default/hello_world_small.d +++ /dev/null @@ -1,4 +0,0 @@ -obj/default/hello_world_small.o: hello_world_small.c \ - ../qsys_tutorial_green_bsp//HAL/inc/sys/alt_stdio.h - -../qsys_tutorial_green_bsp//HAL/inc/sys/alt_stdio.h: diff --git a/software/qsys_tutorial_green/obj/default/hello_world_small.o b/software/qsys_tutorial_green/obj/default/hello_world_small.o deleted file mode 100644 index eba4bf9..0000000 --- a/software/qsys_tutorial_green/obj/default/hello_world_small.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green/qsys_tutorial_green.elf b/software/qsys_tutorial_green/qsys_tutorial_green.elf deleted file mode 100644 index 09d5837..0000000 --- a/software/qsys_tutorial_green/qsys_tutorial_green.elf +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green/qsys_tutorial_green.map b/software/qsys_tutorial_green/qsys_tutorial_green.map deleted file mode 100644 index a48c6f6..0000000 --- a/software/qsys_tutorial_green/qsys_tutorial_green.map +++ /dev/null @@ -1,412 +0,0 @@ -Archive member included because of file (symbol) - -../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_load.o) - ../qsys_tutorial_green_bsp//obj/HAL/src/crt0.o (alt_load) -../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_main.o) - ../qsys_tutorial_green_bsp//obj/HAL/src/crt0.o (alt_main) -../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_sys_init.o) - ../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_main.o) (alt_sys_init) -../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - ../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_load.o) (alt_dcache_flush_all) -../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - ../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_load.o) (alt_icache_flush_all) -../qsys_tutorial_green_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - ../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_sys_init.o) (altera_nios2_qsys_irq_init) - -Memory Configuration - -Name Origin Length Attributes -reset 0x00000000 0x00000020 -onchip_memory 0x00000020 0x00000fe0 -*default* 0x00000000 0xffffffff - -Linker script and memory map - -LOAD ../qsys_tutorial_green_bsp//obj/HAL/src/crt0.o - 0x0000000c exit = _exit -LOAD obj/default/hello_world_small.o -LOAD c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libstdc++.a -LOAD c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libm.a -LOAD c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a -START GROUP -LOAD c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a -LOAD c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a -LOAD ../qsys_tutorial_green_bsp/\libhal_bsp.a -END GROUP -LOAD c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a - 0x00000000 __alt_mem_onchip_memory = 0x0 - -.entry 0x00000000 0x20 - *(.entry) - .entry 0x00000000 0x20 ../qsys_tutorial_green_bsp//obj/HAL/src/crt0.o - 0x00000000 __reset - 0x0000000c _exit - -.exceptions 0x00000020 0x0 - 0x00000020 PROVIDE (__ram_exceptions_start, ABSOLUTE (.)) - 0x00000020 . = ALIGN (0x20) - *(.irq) - *(.exceptions.entry.label) - *(.exceptions.entry.user) - *(.exceptions.entry) - *(.exceptions.irqtest.user) - *(.exceptions.irqtest) - *(.exceptions.irqhandler.user) - *(.exceptions.irqhandler) - *(.exceptions.irqreturn.user) - *(.exceptions.irqreturn) - *(.exceptions.notirq.label) - *(.exceptions.notirq.user) - *(.exceptions.notirq) - *(.exceptions.soft.user) - *(.exceptions.soft) - *(.exceptions.unknown.user) - *(.exceptions.unknown) - *(.exceptions.exit.label) - *(.exceptions.exit.user) - *(.exceptions.exit) - *(.exceptions) - 0x00000020 PROVIDE (__ram_exceptions_end, ABSOLUTE (.)) - 0x00000020 PROVIDE (__flash_exceptions_start, LOADADDR (.exceptions)) - -.text 0x00000020 0x170 - 0x00000020 PROVIDE (stext, ABSOLUTE (.)) - *(.interp) - *(.hash) - *(.dynsym) - *(.dynstr) - *(.gnu.version) - *(.gnu.version_d) - *(.gnu.version_r) - *(.rel.init) - *(.rela.init) - *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) - *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) - *(.rel.fini) - *(.rela.fini) - *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) - *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) - *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) - *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) - *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) - *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) - *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) - *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) - *(.rel.ctors) - *(.rela.ctors) - *(.rel.dtors) - *(.rela.dtors) - *(.rel.got) - *(.rela.got) - *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) - *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) - *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) - *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) - *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) - *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) - *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) - *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) - *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) - *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) - *(.rel.plt) - *(.rela.plt) - *(.rel.dyn) - *(.init) - *(.plt) - *(.text .stub .text.* .gnu.linkonce.t.*) - .text 0x00000020 0x3c ../qsys_tutorial_green_bsp//obj/HAL/src/crt0.o - 0x00000020 _start - .text 0x0000005c 0x48 obj/default/hello_world_small.o - 0x0000005c main - .text 0x000000a4 0x8c ../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_load.o) - 0x000000c4 alt_load - .text 0x00000130 0x2c ../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_main.o) - 0x00000130 alt_main - .text 0x0000015c 0x24 ../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_sys_init.o) - 0x0000015c alt_sys_init - 0x00000160 alt_irq_init - .text 0x00000180 0x4 ../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - 0x00000180 alt_dcache_flush_all - .text 0x00000184 0x4 ../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - 0x00000184 alt_icache_flush_all - .text 0x00000188 0x8 ../qsys_tutorial_green_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - 0x00000188 altera_nios2_qsys_irq_init - *(.gnu.warning.*) - *(.fini) - 0x00000190 PROVIDE (__etext, ABSOLUTE (.)) - 0x00000190 PROVIDE (_etext, ABSOLUTE (.)) - 0x00000190 PROVIDE (etext, ABSOLUTE (.)) - *(.eh_frame_hdr) - 0x00000190 . = ALIGN (0x4) - 0x00000190 PROVIDE (__preinit_array_start, ABSOLUTE (.)) - *(.preinit_array) - 0x00000190 PROVIDE (__preinit_array_end, ABSOLUTE (.)) - 0x00000190 PROVIDE (__init_array_start, ABSOLUTE (.)) - *(.init_array) - 0x00000190 PROVIDE (__init_array_end, ABSOLUTE (.)) - 0x00000190 PROVIDE (__fini_array_start, ABSOLUTE (.)) - *(.fini_array) - 0x00000190 PROVIDE (__fini_array_end, ABSOLUTE (.)) - *(.eh_frame) - *(.gcc_except_table) - *(.dynamic) - 0x00000190 PROVIDE (__CTOR_LIST__, ABSOLUTE (.)) - *(.ctors) - *(SORT(.ctors.*)) - 0x00000190 PROVIDE (__CTOR_END__, ABSOLUTE (.)) - 0x00000190 PROVIDE (__DTOR_LIST__, ABSOLUTE (.)) - *(.dtors) - *(SORT(.dtors.*)) - 0x00000190 PROVIDE (__DTOR_END__, ABSOLUTE (.)) - *(.jcr) - 0x00000190 . = ALIGN (0x4) - -.rodata 0x00000190 0x0 - 0x00000190 PROVIDE (__ram_rodata_start, ABSOLUTE (.)) - 0x00000190 . = ALIGN (0x4) - *(.rodata .rodata.* .gnu.linkonce.r.*) - *(.rodata1) - 0x00000190 . = ALIGN (0x4) - 0x00000190 PROVIDE (__ram_rodata_end, ABSOLUTE (.)) - 0x00000190 PROVIDE (__flash_rodata_start, LOADADDR (.rodata)) - -.rwdata 0x00000190 0x4 load address 0x00000194 - 0x00000190 PROVIDE (__ram_rwdata_start, ABSOLUTE (.)) - 0x00000190 . = ALIGN (0x4) - *(.got.plt) - *(.got) - *(.data1) - *(.data .data.* .gnu.linkonce.d.*) - .data 0x00000190 0x0 ../qsys_tutorial_green_bsp//obj/HAL/src/crt0.o - .data 0x00000190 0x0 obj/default/hello_world_small.o - .data 0x00000190 0x0 ../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_load.o) - .data 0x00000190 0x0 ../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_main.o) - .data 0x00000190 0x0 ../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_sys_init.o) - .data 0x00000190 0x0 ../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .data 0x00000190 0x0 ../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .data 0x00000190 0x0 ../qsys_tutorial_green_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - 0x00008190 _gp = ABSOLUTE ((. + 0x8000)) - 0x00008190 PROVIDE (gp, _gp) - *(.rwdata .rwdata.*) - *(.sdata .sdata.* .gnu.linkonce.s.*) - .sdata 0x00000190 0x4 ../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_sys_init.o) - 0x00000190 jtag_uart - *(.sdata2 .sdata2.* .gnu.linkonce.s2.*) - 0x00000194 . = ALIGN (0x4) - 0x00000194 _edata = ABSOLUTE (.) - 0x00000194 PROVIDE (edata, ABSOLUTE (.)) - 0x00000194 PROVIDE (__ram_rwdata_end, ABSOLUTE (.)) - 0x00000194 PROVIDE (__flash_rwdata_start, LOADADDR (.rwdata)) - -.bss 0x00000198 0xc - 0x00000198 __bss_start = ABSOLUTE (.) - 0x00000198 PROVIDE (__sbss_start, ABSOLUTE (.)) - 0x00000198 PROVIDE (___sbss_start, ABSOLUTE (.)) - *(.dynsbss) - *(.sbss .sbss.* .gnu.linkonce.sb.*) - .sbss 0x00000198 0xc ../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_main.o) - 0x00000198 alt_argc - 0x0000019c alt_argv - 0x000001a0 alt_envp - *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) - *(.scommon) - 0x000001a4 PROVIDE (__sbss_end, ABSOLUTE (.)) - 0x000001a4 PROVIDE (___sbss_end, ABSOLUTE (.)) - *(.dynbss) - *(.bss .bss.* .gnu.linkonce.b.*) - .bss 0x000001a4 0x0 ../qsys_tutorial_green_bsp//obj/HAL/src/crt0.o - .bss 0x000001a4 0x0 obj/default/hello_world_small.o - .bss 0x000001a4 0x0 ../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_load.o) - .bss 0x000001a4 0x0 ../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_main.o) - .bss 0x000001a4 0x0 ../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_sys_init.o) - .bss 0x000001a4 0x0 ../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .bss 0x000001a4 0x0 ../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .bss 0x000001a4 0x0 ../qsys_tutorial_green_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - *(COMMON) - 0x000001a4 . = ALIGN (0x4) - 0x000001a4 __bss_end = ABSOLUTE (.) - -.onchip_memory 0x000001a4 0x0 - 0x000001a4 PROVIDE (_alt_partition_onchip_memory_start, ABSOLUTE (.)) - *(.onchip_memory. onchip_memory.*) - 0x000001a4 . = ALIGN (0x4) - 0x000001a4 PROVIDE (_alt_partition_onchip_memory_end, ABSOLUTE (.)) - 0x000001a4 _end = ABSOLUTE (.) - 0x000001a4 end = ABSOLUTE (.) - 0x000001a4 __alt_stack_base = ABSOLUTE (.) - 0x000001a4 PROVIDE (_alt_partition_onchip_memory_load_addr, LOADADDR (.onchip_memory)) - -.stab - *(.stab) - -.stabstr - *(.stabstr) - -.stab.excl - *(.stab.excl) - -.stab.exclstr - *(.stab.exclstr) - -.stab.index - *(.stab.index) - -.stab.indexstr - *(.stab.indexstr) - -.comment 0x00000000 0x26 - *(.comment) - .comment 0x00000000 0x26 obj/default/hello_world_small.o - 0x27 (size before relaxing) - .comment 0x00000000 0x27 ../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_load.o) - .comment 0x00000000 0x27 ../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_main.o) - .comment 0x00000000 0x27 ../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_sys_init.o) - .comment 0x00000000 0x27 ../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .comment 0x00000000 0x27 ../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .comment 0x00000000 0x27 ../qsys_tutorial_green_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - -.debug - *(.debug) - -.line - *(.line) - -.debug_srcinfo - *(.debug_srcinfo) - -.debug_sfnames - *(.debug_sfnames) - -.debug_aranges 0x00000000 0x108 - *(.debug_aranges) - .debug_aranges - 0x00000000 0x28 ../qsys_tutorial_green_bsp//obj/HAL/src/crt0.o - .debug_aranges - 0x00000028 0x20 obj/default/hello_world_small.o - .debug_aranges - 0x00000048 0x20 ../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_load.o) - .debug_aranges - 0x00000068 0x20 ../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_main.o) - .debug_aranges - 0x00000088 0x20 ../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_sys_init.o) - .debug_aranges - 0x000000a8 0x20 ../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .debug_aranges - 0x000000c8 0x20 ../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .debug_aranges - 0x000000e8 0x20 ../qsys_tutorial_green_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - -.debug_pubnames - 0x00000000 0x149 - *(.debug_pubnames) - .debug_pubnames - 0x00000000 0x1b obj/default/hello_world_small.o - .debug_pubnames - 0x0000001b 0x1f ../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_load.o) - .debug_pubnames - 0x0000003a 0x46 ../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_main.o) - .debug_pubnames - 0x00000080 0x42 ../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_sys_init.o) - .debug_pubnames - 0x000000c2 0x2b ../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .debug_pubnames - 0x000000ed 0x2b ../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .debug_pubnames - 0x00000118 0x31 ../qsys_tutorial_green_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - -.debug_info 0x00000000 0x659 - *(.debug_info .gnu.linkonce.wi.*) - .debug_info 0x00000000 0x79 ../qsys_tutorial_green_bsp//obj/HAL/src/crt0.o - .debug_info 0x00000079 0x69 obj/default/hello_world_small.o - .debug_info 0x000000e2 0x12e ../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_load.o) - .debug_info 0x00000210 0x125 ../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_main.o) - .debug_info 0x00000335 0x17d ../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_sys_init.o) - .debug_info 0x000004b2 0x8d ../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .debug_info 0x0000053f 0x8d ../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .debug_info 0x000005cc 0x8d ../qsys_tutorial_green_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - -.debug_abbrev 0x00000000 0x344 - *(.debug_abbrev) - .debug_abbrev 0x00000000 0x12 ../qsys_tutorial_green_bsp//obj/HAL/src/crt0.o - .debug_abbrev 0x00000012 0x55 obj/default/hello_world_small.o - .debug_abbrev 0x00000067 0x97 ../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_load.o) - .debug_abbrev 0x000000fe 0xa6 ../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_main.o) - .debug_abbrev 0x000001a4 0xe3 ../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_sys_init.o) - .debug_abbrev 0x00000287 0x3f ../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .debug_abbrev 0x000002c6 0x3f ../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .debug_abbrev 0x00000305 0x3f ../qsys_tutorial_green_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - -.debug_line 0x00000000 0xde4 - *(.debug_line) - .debug_line 0x00000000 0x66 ../qsys_tutorial_green_bsp//obj/HAL/src/crt0.o - .debug_line 0x00000066 0xe7 obj/default/hello_world_small.o - .debug_line 0x0000014d 0x217 ../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_load.o) - .debug_line 0x00000364 0x2c2 ../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_main.o) - .debug_line 0x00000626 0x286 ../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_sys_init.o) - .debug_line 0x000008ac 0x1b5 ../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .debug_line 0x00000a61 0x1b5 ../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .debug_line 0x00000c16 0x1ce ../qsys_tutorial_green_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - -.debug_frame 0x00000000 0x11c - *(.debug_frame) - .debug_frame 0x00000000 0x24 obj/default/hello_world_small.o - .debug_frame 0x00000024 0x38 ../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_load.o) - .debug_frame 0x0000005c 0x28 ../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_main.o) - .debug_frame 0x00000084 0x38 ../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_sys_init.o) - .debug_frame 0x000000bc 0x20 ../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .debug_frame 0x000000dc 0x20 ../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .debug_frame 0x000000fc 0x20 ../qsys_tutorial_green_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - -.debug_str 0x00000000 0x3b4 - *(.debug_str) - .debug_str 0x00000000 0x64 obj/default/hello_world_small.o - 0x7b (size before relaxing) - .debug_str 0x00000064 0x189 ../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_load.o) - 0x1ce (size before relaxing) - .debug_str 0x000001ed 0x75 ../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_main.o) - 0x152 (size before relaxing) - .debug_str 0x00000262 0xaf ../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_sys_init.o) - 0x1c5 (size before relaxing) - .debug_str 0x00000311 0x34 ../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - 0x111 (size before relaxing) - .debug_str 0x00000345 0x34 ../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - 0x111 (size before relaxing) - .debug_str 0x00000379 0x3b ../qsys_tutorial_green_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - 0x118 (size before relaxing) - -.debug_loc 0x00000000 0x8f - *(.debug_loc) - .debug_loc 0x00000000 0x1f obj/default/hello_world_small.o - .debug_loc 0x0000001f 0x1f ../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_load.o) - .debug_loc 0x0000003e 0x1f ../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_main.o) - .debug_loc 0x0000005d 0x32 ../qsys_tutorial_green_bsp/\libhal_bsp.a(alt_sys_init.o) - -.debug_macinfo - *(.debug_macinfo) - -.debug_weaknames - *(.debug_weaknames) - -.debug_funcnames - *(.debug_funcnames) - -.debug_typenames - *(.debug_typenames) - -.debug_varnames - *(.debug_varnames) - -.debug_alt_sim_info - 0x00000000 0x10 - *(.debug_alt_sim_info) - .debug_alt_sim_info - 0x00000000 0x10 ../qsys_tutorial_green_bsp//obj/HAL/src/crt0.o - 0x00001000 __alt_data_end = 0x1000 - 0x00001000 PROVIDE (__alt_stack_pointer, __alt_data_end) - 0x000001a4 PROVIDE (__alt_stack_limit, __alt_stack_base) - 0x000001a4 PROVIDE (__alt_heap_start, end) - 0x00001000 PROVIDE (__alt_heap_limit, 0x1000) -OUTPUT(qsys_tutorial_green.elf elf32-littlenios2) - -.debug_ranges 0x00000000 0x20 - .debug_ranges 0x00000000 0x20 ../qsys_tutorial_green_bsp//obj/HAL/src/crt0.o diff --git a/software/qsys_tutorial_green/qsys_tutorial_green.objdump b/software/qsys_tutorial_green/qsys_tutorial_green.objdump deleted file mode 100644 index a1cc211..0000000 --- a/software/qsys_tutorial_green/qsys_tutorial_green.objdump +++ /dev/null @@ -1,474 +0,0 @@ - -qsys_tutorial_green.elf: file format elf32-littlenios2 -qsys_tutorial_green.elf -architecture: nios2, flags 0x00000112: -EXEC_P, HAS_SYMS, D_PAGED -start address 0x00000020 - -Program Header: - LOAD off 0x00001000 vaddr 0x00000000 paddr 0x00000000 align 2**12 - filesz 0x00000020 memsz 0x00000020 flags r-x - LOAD off 0x00001020 vaddr 0x00000020 paddr 0x00000020 align 2**12 - filesz 0x00000170 memsz 0x00000170 flags r-x - LOAD off 0x00001190 vaddr 0x00000190 paddr 0x00000194 align 2**12 - filesz 0x00000004 memsz 0x00000004 flags rw- - LOAD off 0x00001198 vaddr 0x00000198 paddr 0x00000198 align 2**12 - filesz 0x00000000 memsz 0x0000000c flags rw- - -Sections: -Idx Name Size VMA LMA File off Algn - 0 .entry 00000020 00000000 00000000 00001000 2**5 - CONTENTS, ALLOC, LOAD, READONLY, CODE - 1 .text 00000170 00000020 00000020 00001020 2**2 - CONTENTS, ALLOC, LOAD, READONLY, CODE - 2 .rwdata 00000004 00000190 00000194 00001190 2**2 - CONTENTS, ALLOC, LOAD, DATA, SMALL_DATA - 3 .bss 0000000c 00000198 00000198 00001198 2**2 - ALLOC, SMALL_DATA - 4 .comment 00000026 00000000 00000000 00001194 2**0 - CONTENTS, READONLY - 5 .debug_aranges 00000108 00000000 00000000 000011c0 2**3 - CONTENTS, READONLY, DEBUGGING - 6 .debug_pubnames 00000149 00000000 00000000 000012c8 2**0 - CONTENTS, READONLY, DEBUGGING - 7 .debug_info 00000659 00000000 00000000 00001411 2**0 - CONTENTS, READONLY, DEBUGGING - 8 .debug_abbrev 00000344 00000000 00000000 00001a6a 2**0 - CONTENTS, READONLY, DEBUGGING - 9 .debug_line 00000de4 00000000 00000000 00001dae 2**0 - CONTENTS, READONLY, DEBUGGING - 10 .debug_frame 0000011c 00000000 00000000 00002b94 2**2 - CONTENTS, READONLY, DEBUGGING - 11 .debug_str 000003b4 00000000 00000000 00002cb0 2**0 - CONTENTS, READONLY, DEBUGGING - 12 .debug_loc 0000008f 00000000 00000000 00003064 2**0 - CONTENTS, READONLY, DEBUGGING - 13 .debug_alt_sim_info 00000010 00000000 00000000 000030f4 2**2 - CONTENTS, READONLY, DEBUGGING - 14 .debug_ranges 00000020 00000000 00000000 00003108 2**3 - CONTENTS, READONLY, DEBUGGING - 15 .thread_model 00000003 00000000 00000000 00003d3f 2**0 - CONTENTS, READONLY - 16 .cpu 0000000f 00000000 00000000 00003d42 2**0 - CONTENTS, READONLY - 17 .qsys 00000001 00000000 00000000 00003d51 2**0 - CONTENTS, READONLY - 18 .simulation_enabled 00000001 00000000 00000000 00003d52 2**0 - CONTENTS, READONLY - 19 .stderr_dev 00000009 00000000 00000000 00003d53 2**0 - CONTENTS, READONLY - 20 .stdin_dev 00000009 00000000 00000000 00003d5c 2**0 - CONTENTS, READONLY - 21 .stdout_dev 00000009 00000000 00000000 00003d65 2**0 - CONTENTS, READONLY - 22 .sopc_system_name 0000000b 00000000 00000000 00003d6e 2**0 - CONTENTS, READONLY - 23 .quartus_project_dir 00000026 00000000 00000000 00003d79 2**0 - CONTENTS, READONLY - 24 .sopcinfo 0003737c 00000000 00000000 00003d9f 2**0 - CONTENTS, READONLY -SYMBOL TABLE: -00000000 l d .entry 00000000 .entry -00000020 l d .text 00000000 .text -00000190 l d .rwdata 00000000 .rwdata -00000198 l d .bss 00000000 .bss -00000000 l d .comment 00000000 .comment -00000000 l d .debug_aranges 00000000 .debug_aranges -00000000 l d .debug_pubnames 00000000 .debug_pubnames -00000000 l d .debug_info 00000000 .debug_info -00000000 l d .debug_abbrev 00000000 .debug_abbrev -00000000 l d .debug_line 00000000 .debug_line -00000000 l d .debug_frame 00000000 .debug_frame -00000000 l d .debug_str 00000000 .debug_str -00000000 l d .debug_loc 00000000 .debug_loc -00000000 l d .debug_alt_sim_info 00000000 .debug_alt_sim_info -00000000 l d .debug_ranges 00000000 .debug_ranges -00000058 l .text 00000000 alt_after_alt_main -00000000 l df *ABS* 00000000 hello_world_small.c -00000000 l df *ABS* 00000000 alt_load.c -000000a4 l F .text 00000020 alt_load_section -00000000 l df *ABS* 00000000 alt_main.c -00000000 l df *ABS* 00000000 alt_sys_init.c -00000000 l df *ABS* 00000000 alt_dcache_flush_all.c -00000000 l df *ABS* 00000000 alt_icache_flush_all.c -00000000 l df *ABS* 00000000 altera_nios2_qsys_irq.c -00000130 g F .text 0000002c alt_main -00000194 g *ABS* 00000000 __flash_rwdata_start -00000190 g O .rwdata 00000004 jtag_uart -00000000 g F .entry 0000000c __reset -00000020 g *ABS* 00000000 __flash_exceptions_start -0000019c g O .bss 00000004 alt_argv -00008190 g *ABS* 00000000 _gp -000001a4 g *ABS* 00000000 __bss_end -00000180 g F .text 00000004 alt_dcache_flush_all -00000194 g *ABS* 00000000 __ram_rwdata_end -00000000 g *ABS* 00000000 __alt_mem_onchip_memory -00000190 g *ABS* 00000000 __ram_rodata_end -000001a4 g *ABS* 00000000 end -00001000 g *ABS* 00000000 __alt_stack_pointer -00000020 g F .text 0000003c _start -0000015c g F .text 00000004 alt_sys_init -00000190 g *ABS* 00000000 __ram_rwdata_start -00000190 g *ABS* 00000000 __ram_rodata_start -000001a4 g *ABS* 00000000 __alt_stack_base -00000198 g *ABS* 00000000 __bss_start -0000005c g F .text 00000048 main -000001a0 g O .bss 00000004 alt_envp -00000190 g *ABS* 00000000 __flash_rodata_start -00000160 g F .text 00000020 alt_irq_init -00000198 g O .bss 00000004 alt_argc -00000020 g *ABS* 00000000 __ram_exceptions_start -00000194 g *ABS* 00000000 _edata -000001a4 g *ABS* 00000000 _end -00000020 g *ABS* 00000000 __ram_exceptions_end -00000188 g F .text 00000008 altera_nios2_qsys_irq_init -0000000c g .entry 00000000 exit -00001000 g *ABS* 00000000 __alt_data_end -0000000c g .entry 00000000 _exit -00000184 g F .text 00000004 alt_icache_flush_all -000000c4 g F .text 0000006c alt_load - - - -Disassembly of section .entry: - -00000000 <__reset>: - * Jump to the _start entry point in the .text section if reset code - * is allowed or if optimizing for RTL simulation. - */ -#if defined(ALT_ALLOW_CODE_AT_RESET) || defined(ALT_SIM_OPTIMIZE) - /* Jump to the _start entry point in the .text section. */ - movhi r1, %hi(_start) - 0: 00400034 movhi at,0 - ori r1, r1, %lo(_start) - 4: 08400814 ori at,at,32 - jmp r1 - 8: 0800683a jmp at - -0000000c <_exit>: - ... - -Disassembly of section .text: - -00000020 <_start>: -#if (NIOS2_NUM_OF_SHADOW_REG_SETS == 0) - /* - * Now that the caches are initialized, set up the stack pointer. - * The value provided by the linker is assumed to be correctly aligned. - */ - movhi sp, %hi(__alt_stack_pointer) - 20: 06c00034 movhi sp,0 - ori sp, sp, %lo(__alt_stack_pointer) - 24: dec40014 ori sp,sp,4096 - - /* Set up the global pointer. */ - movhi gp, %hi(_gp) - 28: 06800034 movhi gp,0 - ori gp, gp, %lo(_gp) - 2c: d6a06414 ori gp,gp,33168 - */ -#ifndef ALT_SIM_OPTIMIZE - /* Log that the BSS is about to be cleared. */ - ALT_LOG_PUTS(alt_log_msg_bss) - - movhi r2, %hi(__bss_start) - 30: 00800034 movhi r2,0 - ori r2, r2, %lo(__bss_start) - 34: 10806614 ori r2,r2,408 - - movhi r3, %hi(__bss_end) - 38: 00c00034 movhi r3,0 - ori r3, r3, %lo(__bss_end) - 3c: 18c06914 ori r3,r3,420 - - beq r2, r3, 1f - 40: 10c00326 beq r2,r3,50 <_start+0x30> - -0: - stw zero, (r2) - 44: 10000015 stw zero,0(r2) - addi r2, r2, 4 - 48: 10800104 addi r2,r2,4 - bltu r2, r3, 0b - 4c: 10fffd36 bltu r2,r3,44 <_start+0x24> - * section aren't defined until alt_load() has been called). - */ - mov et, zero -#endif - - call alt_load - 50: 00000c40 call c4 - - /* Log that alt_main is about to be called. */ - ALT_LOG_PUTS(alt_log_msg_alt_main) - - /* Call the C entry point. It should never return. */ - call alt_main - 54: 00001300 call 130 - -00000058 : - - /* Wait in infinite loop in case alt_main does return. */ -alt_after_alt_main: - br alt_after_alt_main - 58: 003fff06 br 58 - -0000005c
: -#endif - -#define switches (volatile char *) 0x0002010 -#define ledrs (volatile int *) 0x0002000 -void main() -{ - 5c: deffff04 addi sp,sp,-4 - - unsigned long i = 0; - volatile int j = 0; - 60: d8000015 stw zero,0(sp) - 64: 0007883a mov r3,zero - 68: 01880004 movi r6,8192 - 6c: 01400134 movhi r5,4 - while(1){ - *ledrs = i++; - 70: 30c00015 stw r3,0(r6) - 74: 18c00044 addi r3,r3,1 - if (i > (unsigned long)1<<18) i = 0; - 78: 28c0012e bgeu r5,r3,80 - 7c: 0007883a mov r3,zero - 80: 010018c4 movi r4,99 - for (j = 0; j < 100; j++); - 84: d8000015 stw zero,0(sp) - 88: 00000306 br 98 - 8c: d8800017 ldw r2,0(sp) - 90: 10800044 addi r2,r2,1 - 94: d8800015 stw r2,0(sp) - 98: d8800017 ldw r2,0(sp) - 9c: 20bffb0e bge r4,r2,8c - a0: 003ff306 br 70 - -000000a4 : - -static void ALT_INLINE alt_load_section (alt_u32* from, - alt_u32* to, - alt_u32* end) -{ - if (to != from) - a4: 2900051e bne r5,r4,bc - a8: f800283a ret - { - while( to != end ) - { - *to++ = *from++; - ac: 20800017 ldw r2,0(r4) - b0: 21000104 addi r4,r4,4 - b4: 28800015 stw r2,0(r5) - b8: 29400104 addi r5,r5,4 - alt_u32* to, - alt_u32* end) -{ - if (to != from) - { - while( to != end ) - bc: 29bffb1e bne r5,r6,ac - c0: f800283a ret - -000000c4 : - * there is no bootloader, so this application is responsible for loading to - * RAM any sections that are required. - */ - -void alt_load (void) -{ - c4: deffff04 addi sp,sp,-4 - /* - * Copy the .rwdata section. - */ - - alt_load_section (&__flash_rwdata_start, - c8: 01000034 movhi r4,0 - cc: 21006504 addi r4,r4,404 - d0: 01400034 movhi r5,0 - d4: 29406404 addi r5,r5,400 - d8: 01800034 movhi r6,0 - dc: 31806504 addi r6,r6,404 - * there is no bootloader, so this application is responsible for loading to - * RAM any sections that are required. - */ - -void alt_load (void) -{ - e0: dfc00015 stw ra,0(sp) - /* - * Copy the .rwdata section. - */ - - alt_load_section (&__flash_rwdata_start, - e4: 00000a40 call a4 - - /* - * Copy the exception handler. - */ - - alt_load_section (&__flash_exceptions_start, - e8: 01000034 movhi r4,0 - ec: 21000804 addi r4,r4,32 - f0: 01400034 movhi r5,0 - f4: 29400804 addi r5,r5,32 - f8: 01800034 movhi r6,0 - fc: 31800804 addi r6,r6,32 - 100: 00000a40 call a4 - - /* - * Copy the .rodata section. - */ - - alt_load_section (&__flash_rodata_start, - 104: 01000034 movhi r4,0 - 108: 21006404 addi r4,r4,400 - 10c: 01400034 movhi r5,0 - 110: 29406404 addi r5,r5,400 - 114: 01800034 movhi r6,0 - 118: 31806404 addi r6,r6,400 - 11c: 00000a40 call a4 - - /* - * Now ensure that the caches are in synch. - */ - - alt_dcache_flush_all(); - 120: 00001800 call 180 - alt_icache_flush_all(); -} - 124: dfc00017 ldw ra,0(sp) - 128: dec00104 addi sp,sp,4 - /* - * Now ensure that the caches are in synch. - */ - - alt_dcache_flush_all(); - alt_icache_flush_all(); - 12c: 00001841 jmpi 184 - -00000130 : - * devices/filesystems/components in the system; and call the entry point for - * the users application, i.e. main(). - */ - -void alt_main (void) -{ - 130: deffff04 addi sp,sp,-4 -#endif - - /* ALT LOG - please see HAL/sys/alt_log_printf.h for details */ - ALT_LOG_PRINT_BOOT("[alt_main.c] Entering alt_main, calling alt_irq_init.\r\n"); - /* Initialize the interrupt controller. */ - alt_irq_init (NULL); - 134: 0009883a mov r4,zero - * devices/filesystems/components in the system; and call the entry point for - * the users application, i.e. main(). - */ - -void alt_main (void) -{ - 138: dfc00015 stw ra,0(sp) -#endif - - /* ALT LOG - please see HAL/sys/alt_log_printf.h for details */ - ALT_LOG_PRINT_BOOT("[alt_main.c] Entering alt_main, calling alt_irq_init.\r\n"); - /* Initialize the interrupt controller. */ - alt_irq_init (NULL); - 13c: 00001600 call 160 - ALT_LOG_PRINT_BOOT("[alt_main.c] Done OS Init, calling alt_sem_create.\r\n"); - ALT_SEM_CREATE (&alt_fd_list_lock, 1); - - /* Initialize the device drivers/software components. */ - ALT_LOG_PRINT_BOOT("[alt_main.c] Calling alt_sys_init.\r\n"); - alt_sys_init(); - 140: 000015c0 call 15c - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Calling main.\r\n"); - -#ifdef ALT_NO_EXIT - main (alt_argc, alt_argv, alt_envp); - 144: d1200217 ldw r4,-32760(gp) - 148: d1600317 ldw r5,-32756(gp) - 14c: d1a00417 ldw r6,-32752(gp) - close(STDOUT_FILENO); - exit (result); -#endif - - ALT_LOG_PRINT_BOOT("[alt_main.c] After main - we should not be here?.\r\n"); -} - 150: dfc00017 ldw ra,0(sp) - 154: dec00104 addi sp,sp,4 - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Calling main.\r\n"); - -#ifdef ALT_NO_EXIT - main (alt_argc, alt_argv, alt_envp); - 158: 000005c1 jmpi 5c
- -0000015c : - */ - -void alt_sys_init( void ) -{ - ALTERA_AVALON_JTAG_UART_INIT ( JTAG_UART, jtag_uart); -} - 15c: f800283a ret - -00000160 : - * The "base" parameter is ignored and only - * present for backwards-compatibility. - */ - -void alt_irq_init ( const void* base ) -{ - 160: deffff04 addi sp,sp,-4 - 164: dfc00015 stw ra,0(sp) - ALTERA_NIOS2_QSYS_IRQ_INIT ( NIOS2_PROCESSOR, nios2_processor); - 168: 00001880 call 188 - * alt_irq_cpu_enable_interrupts() enables the CPU to start taking interrupts. - */ -static ALT_INLINE void ALT_ALWAYS_INLINE - alt_irq_cpu_enable_interrupts () -{ - NIOS2_WRITE_STATUS(NIOS2_STATUS_PIE_MSK - 16c: 00800044 movi r2,1 - 170: 1001703a wrctl status,r2 - alt_irq_cpu_enable_interrupts(); -} - 174: dfc00017 ldw ra,0(sp) - 178: dec00104 addi sp,sp,4 - 17c: f800283a ret - -00000180 : - for (i = (char*) 0; i < (char*) NIOS2_DCACHE_SIZE; i+= NIOS2_DCACHE_LINE_SIZE) - { - __asm__ volatile ("flushd (%0)" :: "r" (i)); - } -#endif /* NIOS2_DCACHE_SIZE > 0 */ -} - 180: f800283a ret - -00000184 : -void alt_icache_flush_all (void) -{ -#if NIOS2_ICACHE_SIZE > 0 - alt_icache_flush (0, NIOS2_ICACHE_SIZE); -#endif -} - 184: f800283a ret - -00000188 : - * To initialize the internal interrupt controller, just clear the IENABLE - * register so that all possible IRQs are disabled. - */ -void altera_nios2_qsys_irq_init(void) -{ - NIOS2_WRITE_IENABLE(0); - 188: 000170fa wrctl ienable,zero -} - 18c: f800283a ret diff --git a/software/qsys_tutorial_green/readme.txt b/software/qsys_tutorial_green/readme.txt deleted file mode 100644 index 3dc3186..0000000 --- a/software/qsys_tutorial_green/readme.txt +++ /dev/null @@ -1,67 +0,0 @@ -Readme - Hello World Software Example - -DESCRIPTION: -Simple program that prints "Hello from Nios II" - -The purpose of this example is to demonstrate the smallest possible Hello -World application, using the Nios II HAL BSP. The memory footprint -of this hosted application is intended to be less than 1 kbytes by default using a standard -reference design. For a more fully featured Hello World application -example, see the example titled "Hello World". - -The memory footprint of this example has been reduced by making the -following changes to the normal "Hello World" example. -Check in the Nios II Software Developers Handbook for a more complete -description. - -In the SW Application project: - - In the C/C++ Build page - - Set the Optimization Level to -Os - -In BSP project: - - In the C/C++ Build page - - - Set the Optimization Level to -Os - - - Define the preprocessor option ALT_NO_INSTRUCTION_EMULATION - This removes software exception handling, which means that you cannot - run code compiled for Nios II cpu with a hardware multiplier on a core - without a the multiply unit. Check the Nios II Software Developers - Manual for more details. - - - In the BSP: - - Set Periodic system timer and Timestamp timer to none - This prevents the automatic inclusion of the timer driver. - - - Set Max file descriptors to 4 - This reduces the size of the file handle pool. - - - Uncheck Clean exit (flush buffers) - This removes the call to exit, and when main is exitted instead of - calling exit the software will just spin in a loop. - - - Check Small C library - This uses a reduced functionality C library, which lacks - support for buffering, file IO, floating point and getch(), etc. - Check the Nios II Software Developers Manual for a complete list. - - - Check Reduced device drivers - This uses reduced functionality drivers if they're available. For the - standard design this means you get polled UART and JTAG UART drivers, - no support for the LCD driver and you lose the ability to program - CFI compliant flash devices. - - -PERIPHERALS USED: -This example exercises the following peripherals: -- STDOUT device (UART or JTAG UART) - -SOFTWARE SOURCE FILES: -This example includes the following software source files: -- small_hello_world.c: - -BOARD/HOST REQUIREMENTS: -This example requires only a JTAG connection with a Nios Development board. If -the host communication settings are changed from JTAG UART (default) to use a -conventional UART, a serial cable between board DB-9 connector and the host is -required. diff --git a/software/qsys_tutorial_green/system/template.xml b/software/qsys_tutorial_green/system/template.xml deleted file mode 100644 index b09e912..0000000 --- a/software/qsys_tutorial_green/system/template.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git a/software/qsys_tutorial_green_bsp/.cproject b/software/qsys_tutorial_green_bsp/.cproject deleted file mode 100644 index b67cdf8..0000000 --- a/software/qsys_tutorial_green_bsp/.cproject +++ /dev/null @@ -1,481 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/software/qsys_tutorial_green_bsp/.project b/software/qsys_tutorial_green_bsp/.project deleted file mode 100644 index 4754241..0000000 --- a/software/qsys_tutorial_green_bsp/.project +++ /dev/null @@ -1,85 +0,0 @@ - - - qsys_tutorial_green_bsp - - - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - ?name? - - - - org.eclipse.cdt.make.core.append_environment - true - - - org.eclipse.cdt.make.core.autoBuildTarget - all - - - org.eclipse.cdt.make.core.buildArguments - - - - org.eclipse.cdt.make.core.buildCommand - make - - - org.eclipse.cdt.make.core.buildLocation - ${workspace_loc://qsys_tutorial_green_bsp} - - - org.eclipse.cdt.make.core.cleanBuildTarget - clean - - - org.eclipse.cdt.make.core.contents - org.eclipse.cdt.make.core.activeConfigSettings - - - org.eclipse.cdt.make.core.enableAutoBuild - false - - - org.eclipse.cdt.make.core.enableCleanBuild - true - - - org.eclipse.cdt.make.core.enableFullBuild - true - - - org.eclipse.cdt.make.core.fullBuildTarget - all - - - org.eclipse.cdt.make.core.stopOnError - true - - - org.eclipse.cdt.make.core.useDefaultBuildCmd - true - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - org.eclipse.cdt.core.ccnature - com.altera.sbtgui.project.SBTGUINature - com.altera.sbtgui.project.SBTGUIBspNature - - diff --git a/software/qsys_tutorial_green_bsp/HAL/inc/alt_types.h b/software/qsys_tutorial_green_bsp/HAL/inc/alt_types.h deleted file mode 100644 index d02f171..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/inc/alt_types.h +++ /dev/null @@ -1,54 +0,0 @@ -#ifndef __ALT_TYPES_H__ -#define __ALT_TYPES_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/* - * Don't declare these typedefs if this file is included by assembly source. - */ -#ifndef ALT_ASM_SRC -typedef signed char alt_8; -typedef unsigned char alt_u8; -typedef signed short alt_16; -typedef unsigned short alt_u16; -typedef signed long alt_32; -typedef unsigned long alt_u32; -typedef long long alt_64; -typedef unsigned long long alt_u64; -#endif - -#define ALT_INLINE __inline__ -#define ALT_ALWAYS_INLINE __attribute__ ((always_inline)) -#define ALT_WEAK __attribute__((weak)) - -#endif /* __ALT_TYPES_H__ */ diff --git a/software/qsys_tutorial_green_bsp/HAL/inc/altera_nios2_qsys_irq.h b/software/qsys_tutorial_green_bsp/HAL/inc/altera_nios2_qsys_irq.h deleted file mode 100644 index 6629ec9..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/inc/altera_nios2_qsys_irq.h +++ /dev/null @@ -1,80 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * Support for the Nios II internal interrupt controller. - */ - -#ifndef __ALT_NIOS2_QSYS_IRQ_H__ -#define __ALT_NIOS2_QSYS_IRQ_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The macro ALTERA_NIOS2_IRQ_INSTANCE is used by the alt_irq_init() - * function in the auto-generated file alt_sys_init.c to create an - * instance of this interrupt controller device driver state if this - * module contains an interrupt controller. - * Only one instance of a Nios II is allowed so this macro is just empty. - */ - -#define ALTERA_NIOS2_QSYS_IRQ_INSTANCE(name, state) - -/* - * altera_nios2_irq_init() is called by the auto-generated function - * alt_irq_init() once for the Nios II if it contains an interrupt controller. - * The altera_nios2_irq_init() routine is called using the - * ALTERA_NIOS2_IRQ_INIT macro given below. - * - * This function initializes the internal interrupt controller - * so is not called if the Nios II contains an external interrupt - * controller port (because the internal interrupt controller - * is removed if this port is present). - */ - -extern void altera_nios2_qsys_irq_init( void ); - -/* - * The macro ALTERA_NIOS2_IRQ_INIT is used by the alt_irq_init() routine - * in the auto-generated file alt_sys_init.c to initialize an instance - * of the interrupt controller device driver state. - */ - -#define ALTERA_NIOS2_QSYS_IRQ_INIT(name, state) altera_nios2_qsys_irq_init() - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_NIOS2_QSYS_IRQ_H__ */ - diff --git a/software/qsys_tutorial_green_bsp/HAL/inc/io.h b/software/qsys_tutorial_green_bsp/HAL/inc/io.h deleted file mode 100644 index 362f103..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/inc/io.h +++ /dev/null @@ -1,81 +0,0 @@ -#ifndef __IO_H__ -#define __IO_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/* IO Header file for Nios II Toolchain */ - -#include "alt_types.h" -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#ifndef SYSTEM_BUS_WIDTH -#error SYSTEM_BUS_WIDTH undefined -#endif - -/* Dynamic bus access functions */ - -#define __IO_CALC_ADDRESS_DYNAMIC(BASE, OFFSET) \ - ((void *)(((alt_u8*)BASE) + (OFFSET))) - -#define IORD_32DIRECT(BASE, OFFSET) \ - __builtin_ldwio (__IO_CALC_ADDRESS_DYNAMIC ((BASE), (OFFSET))) -#define IORD_16DIRECT(BASE, OFFSET) \ - __builtin_ldhuio (__IO_CALC_ADDRESS_DYNAMIC ((BASE), (OFFSET))) -#define IORD_8DIRECT(BASE, OFFSET) \ - __builtin_ldbuio (__IO_CALC_ADDRESS_DYNAMIC ((BASE), (OFFSET))) - -#define IOWR_32DIRECT(BASE, OFFSET, DATA) \ - __builtin_stwio (__IO_CALC_ADDRESS_DYNAMIC ((BASE), (OFFSET)), (DATA)) -#define IOWR_16DIRECT(BASE, OFFSET, DATA) \ - __builtin_sthio (__IO_CALC_ADDRESS_DYNAMIC ((BASE), (OFFSET)), (DATA)) -#define IOWR_8DIRECT(BASE, OFFSET, DATA) \ - __builtin_stbio (__IO_CALC_ADDRESS_DYNAMIC ((BASE), (OFFSET)), (DATA)) - -/* Native bus access functions */ - -#define __IO_CALC_ADDRESS_NATIVE(BASE, REGNUM) \ - ((void *)(((alt_u8*)BASE) + ((REGNUM) * (SYSTEM_BUS_WIDTH/8)))) - -#define IORD(BASE, REGNUM) \ - __builtin_ldwio (__IO_CALC_ADDRESS_NATIVE ((BASE), (REGNUM))) -#define IOWR(BASE, REGNUM, DATA) \ - __builtin_stwio (__IO_CALC_ADDRESS_NATIVE ((BASE), (REGNUM)), (DATA)) - -#ifdef __cplusplus -} -#endif - -#endif /* __IO_H__ */ diff --git a/software/qsys_tutorial_green_bsp/HAL/inc/nios2.h b/software/qsys_tutorial_green_bsp/HAL/inc/nios2.h deleted file mode 100644 index 72cefba..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/inc/nios2.h +++ /dev/null @@ -1,230 +0,0 @@ -#ifndef __NIOS2_H__ -#define __NIOS2_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2008 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * This header provides processor specific macros for accessing the Nios2 - * control registers. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * Macros for accessing selected processor registers - */ - -#define NIOS2_READ_ET(et) \ - do { __asm ("mov %0, et" : "=r" (et) ); } while (0) - -#define NIOS2_WRITE_ET(et) \ - do { __asm volatile ("mov et, %z0" : : "rM" (et)); } while (0) - -#define NIOS2_READ_SP(sp) \ - do { __asm ("mov %0, sp" : "=r" (sp) ); } while (0) - -/* - * Macros for useful processor instructions - */ - -#define NIOS2_BREAK() \ - do { __asm volatile ("break"); } while (0) - -#define NIOS2_REPORT_STACK_OVERFLOW() \ - do { __asm volatile("break 3"); } while (0) - -/* - * Macros for accessing the control registers. - */ - -#define NIOS2_READ_STATUS(dest) \ - do { dest = __builtin_rdctl(0); } while (0) - -#define NIOS2_WRITE_STATUS(src) \ - do { __builtin_wrctl(0, src); } while (0) - -#define NIOS2_READ_ESTATUS(dest) \ - do { dest = __builtin_rdctl(1); } while (0) - -#define NIOS2_READ_BSTATUS(dest) \ - do { dest = __builtin_rdctl(2); } while (0) - -#define NIOS2_READ_IENABLE(dest) \ - do { dest = __builtin_rdctl(3); } while (0) - -#define NIOS2_WRITE_IENABLE(src) \ - do { __builtin_wrctl(3, src); } while (0) - -#define NIOS2_READ_IPENDING(dest) \ - do { dest = __builtin_rdctl(4); } while (0) - -#define NIOS2_READ_CPUID(dest) \ - do { dest = __builtin_rdctl(5); } while (0) - - -/* - * Macros for accessing extra exception registers. These - * are always enabled wit the MPU or MMU, and optionally - * with other advanced exception types/ - */ -#define NIOS2_READ_EXCEPTION(dest) \ - do { dest = __builtin_rdctl(7); } while (0) - -#define NIOS2_READ_BADADDR(dest) \ - do { dest = __builtin_rdctl(12); } while (0) - - -/* - * Macros for accessing control registers for MPU - * operation. These should not be used unless the - * MPU is enabled. - * - * The config register may be augmented for future - * enhancements. For now, only MPU support is provided. - */ -/* Config register */ -#define NIOS2_WRITE_CONFIG(src) \ - do { __builtin_wrctl(13, src); } while (0) - -#define NIOS2_READ_CONFIG(dest) \ - do { dest = __builtin_rdctl(13); } while (0) - -/* MPU Base Address Register */ -#define NIOS2_WRITE_MPUBASE(src) \ - do { __builtin_wrctl(14, src); } while (0) - -#define NIOS2_READ_MPUBASE(dest) \ - do { dest = __builtin_rdctl(14); } while (0) - -/* MPU Access Register */ -#define NIOS2_WRITE_MPUACC(src) \ - do { __builtin_wrctl(15, src); } while (0) - -#define NIOS2_READ_MPUACC(dest) \ - do { dest = __builtin_rdctl(15); } while (0) - - -/* - * Nios II control registers that are always present - */ -#define NIOS2_STATUS status -#define NIOS2_ESTATUS estatus -#define NIOS2_BSTATUS bstatus -#define NIOS2_IENABLE ienable -#define NIOS2_IPENDING ipending -#define NIOS2_CPUID cpuid - -/* - * STATUS, BSTATUS, ESTATUS, and SSTATUS fields. - * The presence of fields is a function of the Nios II configuration. - */ -#define NIOS2_STATUS_PIE_MSK (0x00000001) -#define NIOS2_STATUS_PIE_OFST (0) -#define NIOS2_STATUS_U_MSK (0x00000002) -#define NIOS2_STATUS_U_OFST (1) -#define NIOS2_STATUS_EH_MSK (0x00000004) -#define NIOS2_STATUS_EH_OFST (2) -#define NIOS2_STATUS_IH_MSK (0x00000008) -#define NIOS2_STATUS_IH_OFST (3) -#define NIOS2_STATUS_IL_MSK (0x000003f0) -#define NIOS2_STATUS_IL_OFST (4) -#define NIOS2_STATUS_CRS_MSK (0x0000fc00) -#define NIOS2_STATUS_CRS_OFST (10) -#define NIOS2_STATUS_PRS_MSK (0x003f0000) -#define NIOS2_STATUS_PRS_OFST (16) -#define NIOS2_STATUS_NMI_MSK (0x00400000) -#define NIOS2_STATUS_NMI_OFST (22) -#define NIOS2_STATUS_RSIE_MSK (0x00800000) -#define NIOS2_STATUS_RSIE_OFST (23) -#define NIOS2_STATUS_SRS_MSK (0x80000000) -#define NIOS2_STATUS_SRS_OFST (31) - -/* - * Bit masks & offsets available with extra exceptions support - */ - -/* Exception register */ -#define NIOS2_EXCEPTION_REG_CAUSE_MASK (0x0000007c) -#define NIOS2_EXCEPTION_REG_CAUSE_OFST (2) - -/* - * Bit masks & offsets for MPU support - * - * All bit-masks are expressed relative to the position - * of the data with a register. To read data that is LSB- - * aligned, the register read data should be masked, then - * right-shifted by the designated "OFST" macro value. The - * opposite should be used for register writes when starting - * with LSB-aligned data. - */ - -/* Config register */ -#define NIOS2_CONFIG_REG_PE_MASK (0x00000001) -#define NIOS2_CONFIG_REG_PE_OFST (0) -#define NIOS2_CONFIG_REG_ANI_MASK (0x00000002) -#define NIOS2_CONFIG_REG_ANI_OFST (1) - -/* MPU Base Address Register */ -#define NIOS2_MPUBASE_D_MASK (0x00000001) -#define NIOS2_MPUBASE_D_OFST (0) -#define NIOS2_MPUBASE_INDEX_MASK (0x0000003e) -#define NIOS2_MPUBASE_INDEX_OFST (1) -#define NIOS2_MPUBASE_BASE_ADDR_MASK (0xffffffc0) -#define NIOS2_MPUBASE_BASE_ADDR_OFST (6) - -/* MPU Access Register */ -#define NIOS2_MPUACC_LIMIT_MASK (0xffffffc0) -#define NIOS2_MPUACC_LIMIT_OFST (6) -#define NIOS2_MPUACC_MASK_MASK (0xffffffc0) -#define NIOS2_MPUACC_MASK_OFST (6) -#define NIOS2_MPUACC_C_MASK (0x00000020) -#define NIOS2_MPUACC_C_OFST (5) -#define NIOS2_MPUACC_PERM_MASK (0x0000001c) -#define NIOS2_MPUACC_PERM_OFST (2) -#define NIOS2_MPUACC_RD_MASK (0x00000002) -#define NIOS2_MPUACC_RD_OFST (1) -#define NIOS2_MPUACC_WR_MASK (0x00000001) -#define NIOS2_MPUACC_WR_OFST (0) - -/* - * Number of available IRQs in internal interrupt controller. - */ -#define NIOS2_NIRQ 32 - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __NIOS2_H__ */ diff --git a/software/qsys_tutorial_green_bsp/HAL/inc/os/alt_flag.h b/software/qsys_tutorial_green_bsp/HAL/inc/os/alt_flag.h deleted file mode 100644 index b9b4605..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/inc/os/alt_flag.h +++ /dev/null @@ -1,98 +0,0 @@ -#ifndef __ALT_FLAG_H__ -#define __ALT_FLAG_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * This header provides macro definitions that can be used to create and use - * uc/OS-II style event flags. These macros can be used in both a uC/OS-II based - * environment, and a single threaded HAL based environment. - * - * The motivation for these macros is to allow code to be developed which is - * thread safe under uC/OS-II, but incurs no additional overhead when used in a - * single threaded HAL environment. - * - * In the case of a single threaded HAL environment, they compile to - * "do nothing" directives, which ensures they do not contribute to the final - * executable. - * - * The following macros are available: - * - * ALT_FLAG_GRP - Create a flag group instance. - * ALT_EXTERN_FLAG_GRP - Create a reference to an external flag group instance. - * ALT_STATIC_FLAG_GRP - Create a static flag group instance. - * ALT_FLAG_CREATE - Initialise a flag group. - * ALT_FLAG_PEND - Pend on a flag group. - * ALT_FLAG_POST - Set a flag condition. - - * - * Input arguments and return codes are all consistant with the equivalent - * uC/OS-II function. - * - * It's important to be careful in the use of the macros: ALT_FLAG_GRP, - * ALT_EXTERN_FLAG_GRP, and ALT_STATIC_FLAG_GRP. In these three cases the - * semi-colon is included in the macro definition; so, for example, you should - * use: - * - * ALT_FLAG_GRP(mygroup) - * - * not: - * - * ALT_FLAG_GRP(mygroup); - * - * The inclusion of the semi-colon has been necessary to ensure the macros can - * compile with no warnings when used in a single threaded HAL environment. - * - */ - -#include "priv/alt_no_error.h" - -#define ALT_FLAG_GRP(group) -#define ALT_EXTERN_FLAG_GRP(group) -#define ALT_STATIC_FLAG_GRP(group) - -#define ALT_FLAG_CREATE(group, flags) alt_no_error () -#define ALT_FLAG_PEND(group, flags, wait_type, timeout) alt_no_error () -#define ALT_FLAG_POST(group, flags, opt) alt_no_error () - -#ifndef ALT_SINGLE_THREADED -#define ALT_SINGLE_THREADED -#endif - -#endif /* __ALT_FLAG_H__ */ diff --git a/software/qsys_tutorial_green_bsp/HAL/inc/os/alt_hooks.h b/software/qsys_tutorial_green_bsp/HAL/inc/os/alt_hooks.h deleted file mode 100644 index 9054e3f..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/inc/os/alt_hooks.h +++ /dev/null @@ -1,61 +0,0 @@ -#ifndef __ALT_HOOKS_H__ -#define __ALT_HOOKS_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * This header provides "do-nothing" macro definitions for operating system - * hooks within the HAL. The O/S component can override these to provide it's - * own implementation. - */ - -#define ALT_OS_TIME_TICK() while(0) -#define ALT_OS_INIT() while(0) -#define ALT_OS_STOP() while(0) - -/* Call from assembly code */ -#define ALT_OS_INT_ENTER_ASM -#define ALT_OS_INT_EXIT_ASM - -/* Call from C code */ -#define ALT_OS_INT_ENTER() while(0) -#define ALT_OS_INT_EXIT() while(0) - - -#endif /* __ALT_HOOKS_H__ */ diff --git a/software/qsys_tutorial_green_bsp/HAL/inc/os/alt_sem.h b/software/qsys_tutorial_green_bsp/HAL/inc/os/alt_sem.h deleted file mode 100644 index 753943e..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/inc/os/alt_sem.h +++ /dev/null @@ -1,96 +0,0 @@ -#ifndef __ALT_SEM_H__ -#define __ALT_SEM_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * This header provides macro definitions that can be used to create and use - * semaphores. These macros can be used in both a uC/OS-II based environment, - * and a single threaded HAL based environment. - * - * The motivation for these macros is to allow code to be developed which is - * thread safe under uC/OS-II, but incurs no additional overhead when used in a - * single threaded HAL environment. - * - * In the case of a single threaded HAL environment, they compile to - * "do nothing" directives, which ensures they do not contribute to the final - * executable. - * - * The following macros are available: - * - * ALT_SEM - Create a semaphore instance. - * ALT_EXTERN_SEM - Create a reference to an external semaphore instance. - * ALT_STATIC_SEM - Create a static semaphore instance. - * ALT_SEM_CREATE - Initialise a semaphore. - * ALT_SEM_PEND - Pend on a semaphore. - * ALT_SEM_POST - Increment a semaphore. - * - * Input arguments and return codes are all consistant with the equivalent - * uC/OS-II function. - * - * It's important to be careful in the use of the macros: ALT_SEM, - * ALT_EXTERN_SEM, and ALT_STATIC_SEM. In these three cases the semi-colon is - * included in the macro definition; so, for example, you should use: - * - * ALT_SEM(mysem) - * - * not: - * - * ALT_SEM(mysem); - * - * The inclusion of the semi-colon has been necessary to ensure the macros can - * compile with no warnings when used in a single threaded HAL environment. - * - */ - -#include "priv/alt_no_error.h" - -#define ALT_SEM(sem) -#define ALT_EXTERN_SEM(sem) -#define ALT_STATIC_SEM(sem) - -#define ALT_SEM_CREATE(sem, value) alt_no_error () -#define ALT_SEM_PEND(sem, timeout) alt_no_error () -#define ALT_SEM_POST(sem) alt_no_error () - -#ifndef ALT_SINGLE_THREADED -#define ALT_SINGLE_THREADED -#endif - -#endif /* __ALT_SEM_H__ */ diff --git a/software/qsys_tutorial_green_bsp/HAL/inc/os/alt_syscall.h b/software/qsys_tutorial_green_bsp/HAL/inc/os/alt_syscall.h deleted file mode 100644 index 507c6aa..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/inc/os/alt_syscall.h +++ /dev/null @@ -1,75 +0,0 @@ -#ifndef __ALT_SYSCALL_H__ -#define __ALT_SYSCALL_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * The macros defined in this file are used to provide the function names used - * for the HAL 'UNIX style' interface, e.g. read(), write() etc. - * - * Operating systems which are ported to the HAL can provide their own - * version of this file, which will be used in preference. This allows - * the operating system to provide it's own implementation of the top level - * system calls, while retaining the HAL functions under a different name, - * for example, alt_read(), alt_write() etc. - */ - -#define ALT_CLOSE close -#define ALT_ENVIRON environ -#define ALT_EXECVE execve -#define ALT_EXIT _exit -#define ALT_FCNTL fcntl -#define ALT_FORK fork -#define ALT_FSTAT fstat -#define ALT_GETPID getpid -#define ALT_GETTIMEOFDAY gettimeofday -#define ALT_IOCTL ioctl -#define ALT_ISATTY isatty -#define ALT_KILL kill -#define ALT_LINK link -#define ALT_LSEEK lseek -#define ALT_OPEN open -#define ALT_READ read -#define ALT_RENAME _rename -#define ALT_SBRK sbrk -#define ALT_SETTIMEOFDAY settimeofday -#define ALT_STAT stat -#define ALT_UNLINK unlink -#define ALT_USLEEP usleep -#define ALT_WAIT wait -#define ALT_WRITE write -#define ALT_TIMES times - -/* - * - */ - -#endif /* __ALT_SYSCALL_H__ */ diff --git a/software/qsys_tutorial_green_bsp/HAL/inc/priv/alt_alarm.h b/software/qsys_tutorial_green_bsp/HAL/inc/priv/alt_alarm.h deleted file mode 100644 index 45d6a0e..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/inc/priv/alt_alarm.h +++ /dev/null @@ -1,101 +0,0 @@ -#ifndef __ALT_PRIV_ALARM_H__ -#define __ALT_PRIV_ALARM_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "alt_types.h" - -/* - * This header provides the internal defenitions required by the public - * interface alt_alarm.h. These variables and structures are not guaranteed to - * exist in future implementations of the HAL. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * "alt_alarm_s" is a structure type used to maintain lists of alarm callback - * functions. - */ - -struct alt_alarm_s -{ - alt_llist llist; /* linked list */ - alt_u32 time; /* time in system ticks of the callback */ - alt_u32 (*callback) (void* context); /* callback function. The return - * value is the period for the next callback; where - * zero indicates that the alarm should be removed - * from the list. - */ - alt_u8 rollover; /* set when desired alarm time + current time causes - overflow, to prevent premature alarm */ - void* context; /* Argument for the callback */ -}; - -/* - * "_alt_tick_rate" is a global variable used to store the system clock rate - * in ticks per second. This is initialised to zero, which coresponds to there - * being no system clock available. - * - * It is then set to it's final value by the system clock driver through a call - * to alt_sysclk_init(). - */ - -extern alt_u32 _alt_tick_rate; - -/* - * "_alt_nticks" is a global variable which records the elapsed number of - * system clock ticks since the last call to settimeofday() or since reset if - * settimeofday() has not been called. - */ - -extern volatile alt_u32 _alt_nticks; - -/* The list of registered alarms. */ - -extern alt_llist alt_alarm_list; - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_PRIV_ALARM_H__ */ diff --git a/software/qsys_tutorial_green_bsp/HAL/inc/priv/alt_busy_sleep.h b/software/qsys_tutorial_green_bsp/HAL/inc/priv/alt_busy_sleep.h deleted file mode 100644 index b1af849..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/inc/priv/alt_busy_sleep.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef __ALT_BUSY_SLEEP_H -#define __ALT_BUSY_SLEEP_H - -/* - * Copyright (c) 2003 Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - */ - -/* - * The function alt_busy_sleep provides a busy loop implementation of usleep. - * This is used to provide usleep for the standalone HAL, or when the timer is - * unavailable in uC/OS-II. - */ - -extern unsigned int alt_busy_sleep (unsigned int us); - -#endif /* __ALT_BUSY_SLEEP_H */ diff --git a/software/qsys_tutorial_green_bsp/HAL/inc/priv/alt_dev_llist.h b/software/qsys_tutorial_green_bsp/HAL/inc/priv/alt_dev_llist.h deleted file mode 100644 index 451b063..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/inc/priv/alt_dev_llist.h +++ /dev/null @@ -1,77 +0,0 @@ -#ifndef __ALT_DEV_LLIST_H__ -#define __ALT_DEV_LLIST_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "sys/alt_llist.h" -#include "alt_types.h" - -/* - * This header provides the internal defenitions required to control file - * access. These variables and functions are not guaranteed to exist in - * future implementations of the HAL. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The alt_dev_llist is an internal structure used to form a common base - * class for all device types. The use of this structure allows common code - * to be used to manipulate the various device lists. - */ - -typedef struct { - alt_llist llist; - const char* name; -} alt_dev_llist; - -/* - * - */ - -extern int alt_dev_llist_insert (alt_dev_llist* dev, alt_llist* list); - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_DEV_LLIST_H__ */ diff --git a/software/qsys_tutorial_green_bsp/HAL/inc/priv/alt_exception_handler_registry.h b/software/qsys_tutorial_green_bsp/HAL/inc/priv/alt_exception_handler_registry.h deleted file mode 100644 index c6905fa..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/inc/priv/alt_exception_handler_registry.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef __ALT_EXCEPTION_HANDLER_REGISTRY_H__ -#define __ALT_EXCEPTION_HANDLER_REGISTRY_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2008 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ -#include "sys/alt_exceptions.h" - -/* Function pointer to exception callback routine */ -extern alt_exception_result (*alt_instruction_exception_handler) - (alt_exception_cause, alt_u32, alt_u32); - -#endif /* __ALT_EXCEPTION_HANDLER_REGISTRY_H__ */ diff --git a/software/qsys_tutorial_green_bsp/HAL/inc/priv/alt_file.h b/software/qsys_tutorial_green_bsp/HAL/inc/priv/alt_file.h deleted file mode 100644 index 2c3e843..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/inc/priv/alt_file.h +++ /dev/null @@ -1,179 +0,0 @@ -#ifndef __ALT_FILE_H__ -#define __ALT_FILE_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "sys/alt_dev.h" -#include "sys/alt_llist.h" -#include "os/alt_sem.h" - -#include "alt_types.h" - -/* - * This header provides the internal defenitions required to control file - * access. These variables and functions are not guaranteed to exist in - * future implementations of the HAL. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The function alt_find_dev() is used to search the device list "list" to - * locate a device named "name". If a match is found, then a pointer to the - * device is returned, otherwise NULL is returned. - */ - -extern alt_dev* alt_find_dev (const char* name, alt_llist* list); - -/* - * alt_find_file() is used to search the list of registered file systems to - * find the filesystem that the file named "name" belongs to. If a match is - * found, then a pointer to the filesystems alt_dev structure is returned, - * otherwise NULL is returned. - * - * Note that a match does not indicate that the file exists, only that a - * filesystem exists that is registered for a partition that could contain - * the file. The filesystems open() function would need to be called in order - * to determine if the file exists. - */ - -extern alt_dev* alt_find_file (const char* name); - -/* - * alt_get_fd() is used to allocate a file descriptor for the device or - * filesystem "dev". A negative return value indicates an error, otherwise the - * return value is the index of the file descriptor within the file descriptor - * pool. - */ - -extern int alt_get_fd (alt_dev* dev); - -/* - * alt_release_fd() is called to free the file descriptor with index "fd". - */ - -extern void alt_release_fd (int fd); - -/* - * alt_fd_lock() is called by ioctl() to mark the file descriptor "fd" as - * being open for exclusive access. Subsequent calls to open() for the device - * associated with "fd" will fail. A device is unlocked by either calling - * close() for "fd", or by an alternate call to ioctl() (see ioctl.c for - * details). - */ - -extern int alt_fd_lock (alt_fd* fd); - -/* - * alt_fd_unlock() is called by ioctl() to unlock a descriptor previously - * locked by a call to alt_fd_lock(). - */ - -extern int alt_fd_unlock (alt_fd* fd); - -/* - * "alt_fd_list" is the pool of file descriptors. - */ - -extern alt_fd alt_fd_list[]; - -/* - * flags used by alt_fd. - * - * ALT_FD_EXCL is used to mark a file descriptor as locked for exclusive - * access, i.e. further calls to open() for the associated device should - * fail. - * - * ALT_FD_DEV marks a dile descriptor as belonging to a device as oposed to a - * filesystem. - */ - -#define ALT_FD_EXCL 0x80000000 -#define ALT_FD_DEV 0x40000000 - -#define ALT_FD_FLAGS_MASK (ALT_FD_EXCL | ALT_FD_DEV) - -/* - * "alt_dev_list" is the head of the linked list of registered devices. - */ - -extern alt_llist alt_dev_list; - -/* - * "alt_fs_list" is the head of the linked list of registered filesystems. - */ - -extern alt_llist alt_fs_list; - -/* - * "alt_fd_list_lock" is a semaphore used to ensure that access to the pool - * of file descriptors is thread safe. - */ - -ALT_EXTERN_SEM(alt_fd_list_lock) - -/* - * "alt_max_fd" is a 'high water mark'. It indicates the highest file - * descriptor allocated. Use of this can save searching the entire pool - * for active file descriptors, which helps avoid contention on access - * to the file descriptor pool. - */ - -extern alt_32 alt_max_fd; - -/* - * alt_io_redirect() is called at startup to redirect stdout, stdin, and - * stderr to the devices named in the input arguments. By default these streams - * are directed at /dev/null, and are then redirected using this function once - * all of the devices have been registered within the system. - */ - -extern void alt_io_redirect(const char* stdout_dev, - const char* stdin_dev, - const char* stderr_dev); - - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_FILE_H__ */ diff --git a/software/qsys_tutorial_green_bsp/HAL/inc/priv/alt_iic_isr_register.h b/software/qsys_tutorial_green_bsp/HAL/inc/priv/alt_iic_isr_register.h deleted file mode 100644 index a0cb01c..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/inc/priv/alt_iic_isr_register.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef __ALT_IIC_ISR_REGISTER_H_ -#define __ALT_IIC_ISR_REGISTER_H_ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ -#include "alt_types.h" -#include "sys/alt_irq.h" - -extern int alt_iic_isr_register(alt_u32 ic_id, alt_u32 irq, alt_isr_func isr, - void *isr_context, void *flags); - -#endif /* __ALT_IIC_ISR_REGISTER_H_ */ diff --git a/software/qsys_tutorial_green_bsp/HAL/inc/priv/alt_irq_table.h b/software/qsys_tutorial_green_bsp/HAL/inc/priv/alt_irq_table.h deleted file mode 100644 index 694ef06..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/inc/priv/alt_irq_table.h +++ /dev/null @@ -1,59 +0,0 @@ -#ifndef __ALT_IRQ_TABLE_H__ -#define __ALT_IRQ_TABLE_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * Definition of a table describing each interrupt handler. The index into - * the array is the interrupt id associated with the handler. - * - * When an interrupt occurs, the associated handler is called with - * the argument stored in the context member. - * - * The table is physically created in alt_irq_handler.c - */ -extern struct ALT_IRQ_HANDLER -{ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - void (*handler)(void*); -#else - void (*handler)(void*, alt_u32); -#endif - void *context; -} alt_irq[ALT_NIRQ]; - -#endif diff --git a/software/qsys_tutorial_green_bsp/HAL/inc/priv/alt_legacy_irq.h b/software/qsys_tutorial_green_bsp/HAL/inc/priv/alt_legacy_irq.h deleted file mode 100644 index c7aec02..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/inc/priv/alt_legacy_irq.h +++ /dev/null @@ -1,158 +0,0 @@ -#ifndef __ALT_LEGACY_IRQ_H__ -#define __ALT_LEGACY_IRQ_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * This file provides prototypes and inline implementations of certain routines - * used by the legacy interrupt API. Do not include this in your driver or - * application source files, use "sys/alt_irq.h" instead to access the proper - * public API. - */ - -#include -#include "system.h" - -#ifndef NIOS2_EIC_PRESENT - -#include "nios2.h" -#include "alt_types.h" - -#include "sys/alt_irq.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * alt_irq_register() can be used to register an interrupt handler. If the - * function is succesful, then the requested interrupt will be enabled upon - * return. - */ -extern int alt_irq_register (alt_u32 id, - void* context, - alt_isr_func handler); - -/* - * alt_irq_disable() disables the individual interrupt indicated by "id". - */ -static ALT_INLINE int ALT_ALWAYS_INLINE alt_irq_disable (alt_u32 id) -{ - alt_irq_context status; - extern volatile alt_u32 alt_irq_active; - - status = alt_irq_disable_all (); - - alt_irq_active &= ~(1 << id); - NIOS2_WRITE_IENABLE (alt_irq_active); - - alt_irq_enable_all(status); - - return 0; -} - -/* - * alt_irq_enable() enables the individual interrupt indicated by "id". - */ -static ALT_INLINE int ALT_ALWAYS_INLINE alt_irq_enable (alt_u32 id) -{ - alt_irq_context status; - extern volatile alt_u32 alt_irq_active; - - status = alt_irq_disable_all (); - - alt_irq_active |= (1 << id); - NIOS2_WRITE_IENABLE (alt_irq_active); - - alt_irq_enable_all(status); - - return 0; -} - -#ifndef ALT_EXCEPTION_STACK -/* - * alt_irq_initerruptable() should only be called from within an ISR. It is used - * to allow higer priority interrupts to interrupt the current ISR. The input - * argument, "priority", is the priority, i.e. interrupt number of the current - * interrupt. - * - * If this function is called, then the ISR is required to make a call to - * alt_irq_non_interruptible() before returning. The input argument to - * alt_irq_non_interruptible() is the return value from alt_irq_interruptible(). - * - * Care should be taken when using this pair of functions, since they increasing - * the system overhead associated with interrupt handling. - * - * If you are using an exception stack then nested interrupts won't work, so - * these functions are not available in that case. - */ -static ALT_INLINE alt_u32 ALT_ALWAYS_INLINE alt_irq_interruptible (alt_u32 priority) -{ - extern volatile alt_u32 alt_priority_mask; - extern volatile alt_u32 alt_irq_active; - - alt_u32 old_priority; - - old_priority = alt_priority_mask; - alt_priority_mask = (1 << priority) - 1; - - NIOS2_WRITE_IENABLE (alt_irq_active & alt_priority_mask); - - NIOS2_WRITE_STATUS (1); - - return old_priority; -} - -/* - * See Comments above for alt_irq_interruptible() for an explanation of the use of this - * function. - */ -static ALT_INLINE void ALT_ALWAYS_INLINE alt_irq_non_interruptible (alt_u32 mask) -{ - extern volatile alt_u32 alt_priority_mask; - extern volatile alt_u32 alt_irq_active; - - NIOS2_WRITE_STATUS (0); - - alt_priority_mask = mask; - - NIOS2_WRITE_IENABLE (mask & alt_irq_active); -} -#endif /* ALT_EXCEPTION_STACK */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* NIOS2_EIC_PRESENT */ - -#endif /* __ALT_LEGACY_IRQ_H__ */ diff --git a/software/qsys_tutorial_green_bsp/HAL/inc/priv/alt_no_error.h b/software/qsys_tutorial_green_bsp/HAL/inc/priv/alt_no_error.h deleted file mode 100644 index 6143fc9..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/inc/priv/alt_no_error.h +++ /dev/null @@ -1,77 +0,0 @@ -#ifndef __ALT_NO_ERROR_H__ -#define __ALT_NO_ERROR_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "alt_types.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * alt_no_error() is a dummy function used by alt_sem.h and alt_flag.h. It - * substitutes for functions that have a return code by creating a function - * that always returns zero. - * - * This may seem a little obscure, but what happens is that the compiler can - * then optomise away the call to this function, and any code written which - * handles the error path (i.e. non zero return values). - * - * This allows code to be written which correctly use the uC/OS-II semaphore - * and flag utilities, without the use of those utilities impacting on - * excutables built for a single threaded HAL environment. - * - * This function is considered to be part of the internal implementation of - * the HAL, and should not be called directly by application code or device - * drivers. It is not guaranteed to be preserved in future versions of the - * HAL. - */ - -static ALT_INLINE int ALT_ALWAYS_INLINE alt_no_error (void) -{ - return 0; -} - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_NO_ERROR_H__ */ diff --git a/software/qsys_tutorial_green_bsp/HAL/inc/priv/nios2_gmon_data.h b/software/qsys_tutorial_green_bsp/HAL/inc/priv/nios2_gmon_data.h deleted file mode 100644 index 3f43f12..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/inc/priv/nios2_gmon_data.h +++ /dev/null @@ -1,47 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ -#ifndef NIOS2_GMON_DATA_H -#define NIOS2_GMON_DATA_H - -#define GMON_DATA_SIG 0 -#define GMON_DATA_WORDS 1 -#define GMON_DATA_PROFILE_DATA 2 -#define GMON_DATA_PROFILE_LOWPC 3 -#define GMON_DATA_PROFILE_HIGHPC 4 -#define GMON_DATA_PROFILE_BUCKET 5 -#define GMON_DATA_PROFILE_RATE 6 -#define GMON_DATA_MCOUNT_START 7 -#define GMON_DATA_MCOUNT_LIMIT 8 - -#define GMON_DATA_SIZE 9 - -extern unsigned int alt_gmon_data[GMON_DATA_SIZE]; - -#endif diff --git a/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_alarm.h b/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_alarm.h deleted file mode 100644 index 68a2f5d..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_alarm.h +++ /dev/null @@ -1,126 +0,0 @@ -#ifndef __ALT_ALARM_H__ -#define __ALT_ALARM_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "alt_llist.h" -#include "alt_types.h" - -#include "priv/alt_alarm.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * "alt_alarm" is a structure type used by applications to register an alarm - * callback function. An instance of this type must be passed as an input - * argument to alt_alarm_start(). The user is not responsible for initialising - * the contents of the instance. This is done by alt_alarm_start(). - */ - -typedef struct alt_alarm_s alt_alarm; - -/* - * alt_alarm_start() can be called by an application/driver in order to register - * a function for periodic callback at the system clock frequency. Be aware that - * this callback is likely to occur in interrupt context. - */ - -extern int alt_alarm_start (alt_alarm* the_alarm, - alt_u32 nticks, - alt_u32 (*callback) (void* context), - void* context); - -/* - * alt_alarm_stop() is used to unregister a callback. Alternatively the callback - * can return zero to unregister. - */ - -extern void alt_alarm_stop (alt_alarm* the_alarm); - -/* - * Obtain the system clock rate in ticks/s. - */ - -static ALT_INLINE alt_u32 ALT_ALWAYS_INLINE alt_ticks_per_second (void) -{ - return _alt_tick_rate; -} - -/* - * alt_sysclk_init() is intended to be only used by the system clock driver - * in order to initialise the value of the clock frequency. - */ - -static ALT_INLINE int ALT_ALWAYS_INLINE alt_sysclk_init (alt_u32 nticks) -{ - if (! _alt_tick_rate) - { - _alt_tick_rate = nticks; - return 0; - } - else - { - return -1; - } -} - -/* - * alt_nticks() returns the elapsed number of system clock ticks since reset. - */ - -static ALT_INLINE alt_u32 ALT_ALWAYS_INLINE alt_nticks (void) -{ - return _alt_nticks; -} - -/* - * alt_tick() should only be called by the system clock driver. This is used - * to notify the system that the system timer period has expired. - */ - -extern void alt_tick (void); - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_ALARM_H__ */ diff --git a/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_cache.h b/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_cache.h deleted file mode 100644 index c4d8db9..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_cache.h +++ /dev/null @@ -1,117 +0,0 @@ -#ifndef __ALT_CACHE_H__ -#define __ALT_CACHE_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003, 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include - -#include "alt_types.h" - -/* - * alt_cache.h defines the processor specific functions for manipulating the - * cache. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * alt_icache_flush() is called to flush the instruction cache for a memory - * region of length "len" bytes, starting at address "start". - */ - -extern void alt_icache_flush (void* start, alt_u32 len); - -/* - * alt_dcache_flush() is called to flush the data cache for a memory - * region of length "len" bytes, starting at address "start". - * Any dirty lines in the data cache are written back to memory. - */ - -extern void alt_dcache_flush (void* start, alt_u32 len); - -/* - * alt_dcache_flush() is called to flush the data cache for a memory - * region of length "len" bytes, starting at address "start". - * Any dirty lines in the data cache are NOT written back to memory. - */ - -extern void alt_dcache_flush_no_writeback (void* start, alt_u32 len); - -/* - * Flush the entire instruction cache. - */ - -extern void alt_icache_flush_all (void); - -/* - * Flush the entire data cache. - */ - -extern void alt_dcache_flush_all (void); - -/* - * Allocate a block of uncached memory. - */ - -extern volatile void* alt_uncached_malloc (size_t size); - -/* - * Free a block of uncached memory. - */ - -extern void alt_uncached_free (volatile void* ptr); - -/* - * Convert a pointer to a block of cached memory, into a block of - * uncached memory. - */ - -extern volatile void* alt_remap_uncached (void* ptr, alt_u32 len); - -/* - * Convert a pointer to a block of uncached memory, into a block of - * cached memory. - */ - -extern void* alt_remap_cached (volatile void* ptr, alt_u32 len); - -/* - * - */ - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_CACHE_H__ */ diff --git a/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_debug.h b/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_debug.h deleted file mode 100644 index d9f9599..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_debug.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef __ALT_DEBUG_H__ -#define __ALT_DEBUG_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * The ALT_DEVUG_ASSERT macro can be used to generate a debugger break - * from within software. The break is generated if "condition" evaluates to - * false. - */ - -#define ALT_DEBUG_ASSERT(condition) if (!condition) \ -{ \ - __asm__ volatile ("break"); \ -} - -#endif /* __ALT_DEBUG_H__ */ diff --git a/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_dev.h b/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_dev.h deleted file mode 100644 index 66c5e41..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_dev.h +++ /dev/null @@ -1,115 +0,0 @@ -#ifndef __ALT_DEV_H__ -#define __ALT_DEV_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "system.h" -#include "sys/alt_llist.h" -#include "priv/alt_dev_llist.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The value ALT_IRQ_NOT_CONNECTED is used to represent an unconnected - * interrupt line. It cannot evaluate to a valid interrupt number. - */ - -#define ALT_IRQ_NOT_CONNECTED (-1) - -typedef struct alt_dev_s alt_dev; - -struct stat; - -/* - * The file descriptor structure definition. - */ - -typedef struct alt_fd_s -{ - alt_dev* dev; - alt_u8* priv; - int fd_flags; -} alt_fd; - -/* - * The device structure definition. - */ - -struct alt_dev_s { - alt_llist llist; /* for internal use */ - const char* name; - int (*open) (alt_fd* fd, const char* name, int flags, int mode); - int (*close) (alt_fd* fd); - int (*read) (alt_fd* fd, char* ptr, int len); - int (*write) (alt_fd* fd, const char* ptr, int len); - int (*lseek) (alt_fd* fd, int ptr, int dir); - int (*fstat) (alt_fd* fd, struct stat* buf); - int (*ioctl) (alt_fd* fd, int req, void* arg); -}; - -/* - * Functions used to register device for access through the C standard - * library. - * - * The only difference between alt_dev_reg() and alt_fs_reg() is the - * interpretation that open() places on the device name. In the case of - * alt_dev_reg the device is assumed to be a particular character device, - * and so there must be an exact match in the name for open to succeed. - * In the case of alt_fs_reg() the name of the device is treated as the - * mount point for a directory, and so any call to open() where the name - * is the root of the device filename will succeed. - */ - -extern int alt_fs_reg (alt_dev* dev); - -static ALT_INLINE int alt_dev_reg (alt_dev* dev) -{ - extern alt_llist alt_dev_list; - - return alt_dev_llist_insert ((alt_dev_llist*) dev, &alt_dev_list); -} - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_DEV_H__ */ diff --git a/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_dma.h b/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_dma.h deleted file mode 100644 index 9f9b2ff..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_dma.h +++ /dev/null @@ -1,226 +0,0 @@ -#ifndef __ALT_DMA_H__ -#define __ALT_DMA_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "sys/alt_dma_dev.h" -#include "alt_types.h" - -#include - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * This header contains the application side interface for accessing DMA - * resources. See alt_dma_dev.h for the dma device driver interface. - * - * The interface model treats a DMA transaction as being composed of two - * halves (read and write). - * - * The application can supply data for transmit using an "alt_dma_txchan" - * descriptor. Alternatively an "alt_dma_rxchan" descriptor can be used to - * receive data. - */ - -/* - * alt_dma_txchan_open() is used to obtain an "alt_dma_txchan" descriptor for - * a DMA transmit device. The name is the name of the associated physical - * device (e.g. "/dev/dma_0"). - * - * The return value will be NULL on failure, and non-NULL otherwise. - */ - -extern alt_dma_txchan alt_dma_txchan_open (const char* name); - -/* - * alt_dma_txchan_close() is provided so that an application can notify the - * system that it has finished with a given DMA transmit channel. This is only - * provided for completness. - */ - -static ALT_INLINE int alt_dma_txchan_close (alt_dma_txchan dma) -{ - return 0; -} - -/* - * alt_dma_txchan_send() posts a transmit request to a DMA transmit channel. - * The input arguments are: - * - * dma: the channel to use. - * from: a pointer to the start of the data to send. - * length: the length of the data to send in bytes. - * done: callback function that will be called once the data has been sent. - * handle: opaque value passed to "done". - * - * The return value will be negative if the request cannot be posted, and - * zero otherwise. - */ - -static ALT_INLINE int alt_dma_txchan_send (alt_dma_txchan dma, - const void* from, - alt_u32 length, - alt_txchan_done* done, - void* handle) -{ - return dma ? dma->dma_send (dma, - from, - length, - done, - handle) : -ENODEV; -} - -/* - * alt_dma_txchan_space() returns the number of tranmit requests that can be - * posted to the specified DMA transmit channel. - * - * A negative value indicates that the value could not be determined. - */ - -static ALT_INLINE int alt_dma_txchan_space (alt_dma_txchan dma) -{ - return dma ? dma->space (dma) : -ENODEV; -} - -/* - * alt_dma_txchan_ioctl() can be used to perform device specific I/O - * operations on the indicated DMA transmit channel. For example some drivers - * support options to control the width of the transfer operations. See - * alt_dma_dev.h for the list of generic requests. - * - * A negative return value indicates failure, otherwise the interpretation - * of the return value is request specific. - */ - -static ALT_INLINE int alt_dma_txchan_ioctl (alt_dma_txchan dma, - int req, - void* arg) -{ - return dma ? dma->ioctl (dma, req, arg) : -ENODEV; -} - -/* - * alt_dma_rxchan_open() is used to obtain an "alt_dma_rxchan" descriptor for - * a DMA receive channel. The name is the name of the associated physical - * device (e.g. "/dev/dma_0"). - * - * The return value will be NULL on failure, and non-NULL otherwise. - */ - -extern alt_dma_rxchan alt_dma_rxchan_open (const char* dev); - -/* - * alt_dma_rxchan_close() is provided so that an application can notify the - * system that it has finished with a given DMA receive channel. This is only - * provided for completness. - */ - -static ALT_INLINE int alt_dma_rxchan_close (alt_dma_rxchan dma) -{ - return 0; -} - -/* - * - */ - -/* - * alt_dma_rxchan_prepare() posts a receive request to a DMA receive channel. - * - * The input arguments are: - * - * dma: the channel to use. - * data: a pointer to the location that data is to be received to. - * len: the maximum length of the data to receive. - * done: callback function that will be called once the data has been - * received. - * handle: opaque value passed to "done". - * - * The return value will be negative if the request cannot be posted, and - * zero otherwise. - */ - -static ALT_INLINE int alt_dma_rxchan_prepare (alt_dma_rxchan dma, - void* data, - alt_u32 len, - alt_rxchan_done* done, - void* handle) -{ - return dma ? dma->prepare (dma, data, len, done, handle) : -ENODEV; -} - -/* - * alt_dma_rxchan_ioctl() can be used to perform device specific I/O - * operations on the indicated DMA receive channel. For example some drivers - * support options to control the width of the transfer operations. See - * alt_dma_dev.h for the list of generic requests. - * - * A negative return value indicates failure, otherwise the interpretation - * of the return value is request specific. - */ - -static ALT_INLINE int alt_dma_rxchan_ioctl (alt_dma_rxchan dma, - int req, - void* arg) -{ - return dma ? dma->ioctl (dma, req, arg) : -ENODEV; -} - -/* - * alt_dma_rxchan_depth() returns the depth of the receive FIFO used to store - * receive requests. - */ - -static ALT_INLINE alt_u32 alt_dma_rxchan_depth(alt_dma_rxchan dma) -{ - return dma->depth; -} - -/* - * - */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_DMA_H__ */ diff --git a/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_dma_dev.h b/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_dma_dev.h deleted file mode 100644 index 832463d..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_dma_dev.h +++ /dev/null @@ -1,200 +0,0 @@ -#ifndef __ALT_DMA_DEV_H__ -#define __ALT_DMA_DEV_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "priv/alt_dev_llist.h" - -#include "alt_types.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * This header contains the device driver interface for accessing DMA - * resources. See alt_dma.h for the DMA application side interface. - * - * The interface model treats a DMA transaction as being composed of two - * halves (read and write). - * - * An "alt_dma_txchan_dev" is used to describe the device associated with a - * DMA transmit channel. An "alt_dma_rxchan_dev" is used to describe the - * device associated with a DMA receive channel. - */ - -/* - * List of generic ioctl requests that may be supported by a DMA device. - * - * ALT_DMA_RX_ONLY_ON: This causes a DMA channel to operate in a mode - * where only the receiver is under software control. - * The other side reads continously from a single - * location. The address to read is the argument to - * this request. - * ALT_DMA_RX_ONLY_OFF: Return to the default mode where both the receive - * and transmit sides of the DMA can be under software - * control. - * ALT_DMA_TX_ONLY_ON: This causes a DMA channel to operate in a mode - * where only the transmitter is under software control. - * The other side writes continously to a single - * location. The address to write to is the argument to - * this request. - * ALT_DMA_TX_ONLY_OFF: Return to the default mode where both the receive - * and transmit sides of the DMA can be under software - * control. - * ALT_DMA_SET_MODE_8: Transfer data in units of 8 bits. - * ALT_DMA_SET_MODE_16: Transfer data in units of 16 bits. - * ALT_DMA_SET_MODE_32: Transfer data in units of 32 bits. - * ALT_DMA_SET_MODE_64: Transfer data in units of 64 bits. - * ALT_DMA_SET_MODE_128: Transfer data in units of 128 bits. - * ALT_DMA_GET_MODE: Get the current transfer mode. - * - * The use of the macros: ALT_DMA_TX_STREAM_ON, ALT_DMA_TX_STREAM_OFF - * ALT_DMA_RX_STREAM_OFF and ALT_DMA_RX_STREAM_ON are depreciated. You should - * instead use the macros: ALT_DMA_RX_ONLY_ON, ALT_DMA_RX_ONLY_OFF, - * ALT_DMA_TX_ONLY_ON and ALT_DMA_TX_ONLY_OFF. - */ - -#define ALT_DMA_TX_STREAM_ON (0x1) -#define ALT_DMA_TX_STREAM_OFF (0x2) -#define ALT_DMA_RX_STREAM_ON (0x3) -#define ALT_DMA_RX_STREAM_OFF (0x4) -#define ALT_DMA_SET_MODE_8 (0x5) -#define ALT_DMA_SET_MODE_16 (0x6) -#define ALT_DMA_SET_MODE_32 (0x7) -#define ALT_DMA_SET_MODE_64 (0x8) -#define ALT_DMA_SET_MODE_128 (0x9) -#define ALT_DMA_GET_MODE (0xa) - -#define ALT_DMA_RX_ONLY_ON ALT_DMA_TX_STREAM_ON -#define ALT_DMA_RX_ONLY_OFF ALT_DMA_TX_STREAM_OFF -#define ALT_DMA_TX_ONLY_ON ALT_DMA_RX_STREAM_ON -#define ALT_DMA_TX_ONLY_OFF ALT_DMA_RX_STREAM_OFF - -/* - * - */ - -typedef struct alt_dma_txchan_dev_s alt_dma_txchan_dev; -typedef struct alt_dma_rxchan_dev_s alt_dma_rxchan_dev; - -typedef alt_dma_txchan_dev* alt_dma_txchan; -typedef alt_dma_rxchan_dev* alt_dma_rxchan; - -typedef void (alt_txchan_done)(void* handle); -typedef void (alt_rxchan_done)(void* handle, void* data); - -/* - * devices that provide a DMA transmit channel are required to provide an - * instance of the "alt_dma_txchan_dev" structure. - */ - -struct alt_dma_txchan_dev_s { - alt_llist llist; /* for internal use */ - const char* name; /* name of the device instance - * (e.g. "/dev/dma_0"). - */ - int (*space) (alt_dma_txchan dma); /* returns the maximum number of - * transmit requests that can be posted - */ - int (*dma_send) (alt_dma_txchan dma, - const void* from, - alt_u32 len, - alt_txchan_done* done, - void* handle); /* post a transmit request */ - int (*ioctl) (alt_dma_txchan dma, int req, void* arg); /* perform device - * specific I/O control. - */ -}; - -/* - * devices that provide a DMA receive channel are required to provide an - * instance of the "alt_dma_rxchan_dev" structure. - */ - -struct alt_dma_rxchan_dev_s { - alt_llist list; /* for internal use */ - const char* name; /* name of the device instance - * (e.g. "/dev/dma_0"). - */ - alt_u32 depth; /* maximum number of receive requests that - * can be posted. - */ - int (*prepare) (alt_dma_rxchan dma, - void* data, - alt_u32 len, - alt_rxchan_done* done, - void* handle); /* post a receive request */ - int (*ioctl) (alt_dma_rxchan dma, int req, void* arg); /* perform device - * specific I/O control. - */ -}; - -/* - * Register a DMA transmit channel with the system. - */ - -static ALT_INLINE int alt_dma_txchan_reg (alt_dma_txchan_dev* dev) -{ - extern alt_llist alt_dma_txchan_list; - - return alt_dev_llist_insert((alt_dev_llist*) dev, &alt_dma_txchan_list); -} - -/* - * Register a DMA receive channel with the system. - */ - -static ALT_INLINE int alt_dma_rxchan_reg (alt_dma_rxchan_dev* dev) -{ - extern alt_llist alt_dma_rxchan_list; - - return alt_dev_llist_insert((alt_dev_llist*) dev, &alt_dma_rxchan_list); -} - -/* - * - */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_DMA_DEV_H__ */ diff --git a/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_driver.h b/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_driver.h deleted file mode 100644 index eb0f23b..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_driver.h +++ /dev/null @@ -1,168 +0,0 @@ -#ifndef __ALT_DRIVER_H__ -#define __ALT_DRIVER_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/* - * Macros used to access a driver without HAL file descriptors. - */ - -/* - * ALT_MODULE_CLASS - * - * This macro returns the module class name for the specified module instance. - * It uses information in the system.h file. - * Neither the instance name or class name are quoted (so that they can - * be used with other pre-processor macros). - * - * Example: - * Assume the design has an instance of an altera_avalon_uart called uart1. - * Calling ALT_MODULE_CLASS(uart1) returns altera_avalon_uart. - */ - -#define ALT_MODULE_CLASS(instance) ALT_MODULE_CLASS_ ## instance - - -/* - * ALT_DRIVER_FUNC_NAME - * - * --> instance Instance name. - * --> func Function name. - * - * This macro returns the device driver function name of the specified - * module instance for the specified function name. - * - * Example: - * Assume the design has an instance of an altera_avalon_uart called uart1. - * Calling ALT_DRIVER_FUNC_NAME(uart1, write) returns - * altera_avalon_uart_write. - */ - -#define ALT_DRIVER_FUNC_NAME(instance, func) \ - ALT_DRIVER_FUNC_NAME1(ALT_MODULE_CLASS(instance), func) -#define ALT_DRIVER_FUNC_NAME1(module_class, func) \ - ALT_DRIVER_FUNC_NAME2(module_class, func) -#define ALT_DRIVER_FUNC_NAME2(module_class, func) \ - module_class ## _ ## func - -/* - * ALT_DRIVER_STATE_STRUCT - * - * --> instance Instance name. - * - * This macro returns the device driver state type name of the specified - * module instance. - * - * Example: - * Assume the design has an instance of an altera_avalon_uart called uart1. - * Calling ALT_DRIVER_STATE_STRUCT(uart1) returns: - * struct altera_avalon_uart_state_s - * - * Note that the ALT_DRIVER_FUNC_NAME macro is used even though "state" isn't - * really a function but it does match the required naming convention. - */ -#define ALT_DRIVER_STATE_STRUCT(instance) \ - struct ALT_DRIVER_FUNC_NAME(instance, state_s) - -/* - * ALT_DRIVER_STATE - * - * --> instance Instance name. - * - * This macro returns the device driver state name of the specified - * module instance. - * - * Example: - * Assume the design has an instance of an altera_avalon_uart called uart1. - * Calling ALT_DRIVER_STATE(uart1) returns uart1. - */ -#define ALT_DRIVER_STATE(instance) instance - -/* - * ALT_DRIVER_WRITE - * - * --> instance Instance name. - * --> buffer Write buffer. - * --> len Length of write buffer data. - * --> flags Control flags (e.g. O_NONBLOCK) - * - * This macro calls the "write" function of the specified driver instance. - */ - -#define ALT_DRIVER_WRITE_EXTERNS(instance) \ - extern ALT_DRIVER_STATE_STRUCT(instance) ALT_DRIVER_STATE(instance); \ - extern int ALT_DRIVER_FUNC_NAME(instance, write) \ - (ALT_DRIVER_STATE_STRUCT(instance) *, const char *, int, int); - -#define ALT_DRIVER_WRITE(instance, buffer, len, flags) \ - ALT_DRIVER_FUNC_NAME(instance, write)(&ALT_DRIVER_STATE(instance), buffer, len, flags) - - -/* - * ALT_DRIVER_READ - * - * --> instance Instance name. - * <-- buffer Read buffer. - * --> len Length of read buffer. - * --> flags Control flags (e.g. O_NONBLOCK) - * - * This macro calls the "read" function of the specified driver instance. - */ - -#define ALT_DRIVER_READ_EXTERNS(instance) \ - extern ALT_DRIVER_STATE_STRUCT(instance) ALT_DRIVER_STATE(instance); \ - extern int ALT_DRIVER_FUNC_NAME(instance, read) \ - (ALT_DRIVER_STATE_STRUCT(instance) *, const char *, int, int); - -#define ALT_DRIVER_READ(instance, buffer, len, flags) \ - ALT_DRIVER_FUNC_NAME(instance, read)(&ALT_DRIVER_STATE(instance), buffer, len, flags) - -/* - * ALT_DRIVER_IOCTL - * - * --> instance Instance name. - * --> req ioctl request (e.g. TIOCSTIMEOUT) - * --> arg Optional argument (void*) - * - * This macro calls the "ioctl" function of the specified driver instance - */ - -#define ALT_DRIVER_IOCTL_EXTERNS(instance) \ - extern ALT_DRIVER_STATE_STRUCT(instance) ALT_DRIVER_STATE(instance); \ - extern int ALT_DRIVER_FUNC_NAME(instance, ioctl) \ - (ALT_DRIVER_STATE_STRUCT(instance) *, int, void*); - -#define ALT_DRIVER_IOCTL(instance, req, arg) \ - ALT_DRIVER_FUNC_NAME(instance, ioctl)(&ALT_DRIVER_STATE(instance), req, arg) - -#endif /* __ALT_DRIVER_H__ */ diff --git a/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_errno.h b/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_errno.h deleted file mode 100644 index 4d3e50f..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_errno.h +++ /dev/null @@ -1,87 +0,0 @@ -#ifndef __ALT_ERRNO_H__ -#define __ALT_ERRNO_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * errno is defined in so that it uses the thread local version - * stored in the location pointed to by "_impure_ptr". This means that the - * accesses to errno within the HAL library can cause the entirety of - * of the structure pointed to by "_impure_ptr" to be added to the - * users application. This can be undesirable in very small footprint systems. - * - * To avoid this happening, the HAL uses the macro ALT_ERRNO, defined below, - * to access errno, rather than accessing it directly. This macro will only - * use the thread local version if some other code has already caused it to be - * included into the system, otherwise it will use the global errno value. - * - * This causes a slight increases in code size where errno is accessed, but - * can lead to significant overall benefits in very small systems. The - * increase is inconsequential when compared to the size of the structure - * pointed to by _impure_ptr. - * - * Note that this macro accesses __errno() using an externally declared - * function pointer (alt_errno). This is done so that the function call uses the - * subroutine call instruction via a register rather than an immediate address. - * This is important in the case that the code has been linked for a high - * address, but __errno() is not being used. In this case the weak linkage - * would have resulted in the instruction: "call 0" which would fail to link. - */ - -extern int* (*alt_errno) (void); - -/* Must define this so that values such as EBADFD are defined in errno.h. */ -#define __LINUX_ERRNO_EXTENSIONS__ - -#include - -#include "alt_types.h" - -#undef errno - -extern int errno; - -static ALT_INLINE int* alt_get_errno(void) -{ - return ((alt_errno) ? alt_errno() : &errno); -} - -#define ALT_ERRNO *alt_get_errno() - -#endif /* __ALT_ERRNO_H__ */ diff --git a/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_exceptions.h b/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_exceptions.h deleted file mode 100644 index 3576a52..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_exceptions.h +++ /dev/null @@ -1,127 +0,0 @@ -#ifndef __ALT_EXCEPTIONS_H__ -#define __ALT_EXCEPTIONS_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2008 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ -#include "alt_types.h" -#include "system.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * This file defines instruction-generated exception handling and registry - * API, exception type enumeration, and handler return value enumeration for - * Nios II. - */ - -/* - * The following enumeration describes the value in the CPU EXCEPTION - * register CAUSE bit field. Not all exception types will cause the - * processor to go to the exception vector; these are provided for - * reference. - */ -enum alt_exception_cause_e { - /* Exeption causes that will cause jump to exception vector */ - NIOS2_EXCEPTION_INTERRUPT = 2, - NIOS2_EXCEPTION_TRAP_INST = 3, - NIOS2_EXCEPTION_UNIMPLEMENTED_INST = 4, - NIOS2_EXCEPTION_ILLEGAL_INST = 5, - NIOS2_EXCEPTION_MISALIGNED_DATA_ADDR = 6, - NIOS2_EXCEPTION_MISALIGNED_TARGET_PC = 7, - NIOS2_EXCEPTION_DIVISION_ERROR = 8, - NIOS2_EXCEPTION_SUPERVISOR_ONLY_INST_ADDR = 9, - NIOS2_EXCEPTION_SUPERVISOR_ONLY_INST = 10, - NIOS2_EXCEPTION_SUPERVISOR_ONLY_DATA_ADDR = 11, - NIOS2_EXCEPTION_TLB_MISS = 12, - NIOS2_EXCEPTION_TLB_EXECUTE_PERM_VIOLATION = 13, - NIOS2_EXCEPTION_MPU_INST_REGION_VIOLATION = 16, - - /* Exception causes that will NOT cause a jump to exception vector */ - NIOS2_EXCEPTION_RESET = 0, - NIOS2_EXCEPTION_CPU_ONLY_RESET_REQUEST = 1, - NIOS2_EXCEPTION_TLB_READ_PERM_VIOLATION = 14, - NIOS2_EXCEPTION_TLB_WRITE_PERM_VIOLATION = 15, - NIOS2_EXCEPTION_MPU_DATA_REGION_VIOLATION = 17, - /* - * This value is passed to an exception handler's cause argument if - * "extra exceptions" information (EXECPTION) register is not - * present in the processor hardware configuration. - */ - NIOS2_EXCEPTION_CAUSE_NOT_PRESENT = -1 -}; -typedef enum alt_exception_cause_e alt_exception_cause; - -/* - * These define valid return values for a user-defined instruction-generated - * exception handler. The handler should return one of these to indicate - * whether to re-issue the instruction that triggered the exception, or to - * skip it. - */ -enum alt_exception_result_e { - NIOS2_EXCEPTION_RETURN_REISSUE_INST = 0, - NIOS2_EXCEPTION_RETURN_SKIP_INST = 1 -}; -typedef enum alt_exception_result_e alt_exception_result; - -/* - * alt_instruction_exception_register() can be used to register an exception - * handler for instruction-generated exceptions that are not handled by the - * built-in exception handler (i.e. for interrupts). - * - * The registry API is optionally enabled through the "Enable - * Instruction-related Exception API" HAL BSP setting, which will - * define the macro below. - */ -#ifdef ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API -void alt_instruction_exception_register ( - alt_exception_result (*exception_handler)( - alt_exception_cause cause, - alt_u32 exception_pc, - alt_u32 bad_addr) ); -#endif /*ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API */ - -/* - * alt_exception_cause_generated_bad_addr() indicates whether a particular - * exception cause value was from an exception-type that generated a valid - * address in the BADADDR register. The contents of BADADDR is passed to - * a user-registered exception handler in all cases, whether valid or not. - * This routine should be called to validate the bad_addr argument to - * your exception handler. - */ -int alt_exception_cause_generated_bad_addr(alt_exception_cause cause); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_EXCEPTIONS_H__ */ diff --git a/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_flash.h b/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_flash.h deleted file mode 100644 index 527328d..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_flash.h +++ /dev/null @@ -1,166 +0,0 @@ -#ifndef __ALT_FLASH_H__ -#define __ALT_FLASH_H__ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/****************************************************************************** -* * -* Alt_flash.h - User interface for flash code * -* * -* Use this interface to avoid being exposed to the internals of the device * -* driver architecture. If you chose to use the flash driver internal * -* structures we don't guarantee not to change them * -* * -* Author PRR * -* * -******************************************************************************/ - - - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#include "alt_types.h" -#include "alt_flash_types.h" -#include "alt_flash_dev.h" -#include "sys/alt_cache.h" - -alt_flash_fd* alt_flash_open_dev(const char* name); -void alt_flash_close_dev(alt_flash_fd* fd ); - -/* - * alt_write_flash - * - * Program a buffer into flash. - * - * This routine erases all the affected erase blocks (if necessary) - * and then programs the data. However it does not read the data out first - * and preserve and none overwritten data, because this would require very - * large buffers on the target. If you need - * that functionality use the functions below. - */ -static __inline__ int __attribute__ ((always_inline)) alt_write_flash( - alt_flash_fd* fd, - int offset, - const void* src_addr, - int length ) -{ - return fd->write( fd, offset, src_addr, length ); -} - -/* - * alt_read_flash - * - * Read a block of flash for most flashes this is just memcpy - * it's here for completeness in case we need it for some serial flash device - * - */ -static __inline__ int __attribute__ ((always_inline)) alt_read_flash( - alt_flash_fd* fd, int offset, - void* dest_addr, int length ) -{ - return fd->read( fd, offset, dest_addr, length ); -} - -/* - * alt_get_flash_info - * - * Return the information on the flash sectors. - * - */ -static __inline__ int __attribute__ ((always_inline)) alt_get_flash_info( - alt_flash_fd* fd, flash_region** info, - int* number_of_regions) -{ - return fd->get_info( fd, info, number_of_regions); -} - -/* - * alt_erase_flash_block - * - * Erase a particular erase block, pass in the offset to the start of - * the block and it's size - */ -static __inline__ int __attribute__ ((always_inline)) alt_erase_flash_block( - alt_flash_fd* fd, int offset, int length) -{ - int ret_code; - ret_code = fd->erase_block( fd, offset ); - - if(!ret_code) - alt_dcache_flush((alt_u8*)fd->base_addr + offset, length); - - return ret_code; -} - -/* - * alt_write_flash_block - * - * Write a particular flash block, block_offset is the offset - * (from the base of flash) to start of the block - * data_offset is the offset (from the base of flash) - * where you wish to start programming - * - * NB this function DOES NOT check that you are only writing a single - * block of data as that would slow down this function. - * - * Use alt_write_flash if you want that level of error checking. - */ - -static __inline__ int __attribute__ ((always_inline)) alt_write_flash_block( - alt_flash_fd* fd, int block_offset, - int data_offset, - const void *data, int length) -{ - - int ret_code; - ret_code = fd->write_block( fd, block_offset, data_offset, data, length ); - - if(!ret_code) - alt_dcache_flush((alt_u8*)fd->base_addr + data_offset, length); - - return ret_code; -} - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_FLASH_H__ */ diff --git a/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_flash_dev.h b/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_flash_dev.h deleted file mode 100644 index 8bab601..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_flash_dev.h +++ /dev/null @@ -1,98 +0,0 @@ -#ifndef __ALT_FLASH_DEV_H__ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/****************************************************************************** -* * -* Alt_flash_dev.h - Generic Flash device interfaces * -* * -* Author PRR * -* * -******************************************************************************/ -#define __ALT_FLASH_DEV_H__ - -#include "alt_flash_types.h" -#include "sys/alt_llist.h" -#include "priv/alt_dev_llist.h" - -#include "alt_types.h" - -typedef struct alt_flash_dev alt_flash_dev; -typedef alt_flash_dev alt_flash_fd; - -static ALT_INLINE int alt_flash_device_register( alt_flash_fd* fd) -{ - extern alt_llist alt_flash_dev_list; - - return alt_dev_llist_insert ((alt_dev_llist*) fd, &alt_flash_dev_list); -} - -typedef alt_flash_dev* (*alt_flash_open)(alt_flash_dev* flash, - const char* name ); -typedef int (*alt_flash_close)(alt_flash_dev* flash_info); - -typedef int (*alt_flash_write)( alt_flash_dev* flash, int offset, - const void* src_addr, int length ); - -typedef int (*alt_flash_get_flash_info)( alt_flash_dev* flash, flash_region** info, - int* number_of_regions); -typedef int (*alt_flash_write_block)( alt_flash_dev* flash, int block_offset, - int data_offset, const void* data, - int length); -typedef int (*alt_flash_erase_block)( alt_flash_dev* flash, int offset); -typedef int (*alt_flash_read)(alt_flash_dev* flash, int offset, - void* dest_addr, int length ); - -struct alt_flash_dev -{ - alt_llist llist; - const char* name; - alt_flash_open open; - alt_flash_close close; - alt_flash_write write; - alt_flash_read read; - alt_flash_get_flash_info get_info; - alt_flash_erase_block erase_block; - alt_flash_write_block write_block; - void* base_addr; - int length; - int number_of_regions; - flash_region region_info[ALT_MAX_NUMBER_OF_FLASH_REGIONS]; -}; - -#endif /* __ALT_FLASH_DEV_H__ */ diff --git a/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_flash_types.h b/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_flash_types.h deleted file mode 100644 index 884cbf8..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_flash_types.h +++ /dev/null @@ -1,64 +0,0 @@ -#ifndef __ALT_FLASH_TYPES_H__ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/****************************************************************************** -* * -* Alt_flash_types.h - Some generic types and defines used by the flash code * -* * -* Author PRR * -* * -******************************************************************************/ -#define __ALT_FLASH_TYPES_H__ - -#ifndef ALT_MAX_NUMBER_OF_FLASH_REGIONS -#define ALT_MAX_NUMBER_OF_FLASH_REGIONS 8 -#endif /* ALT_MAX_NUMBER_OF_FLASH_REGIONS */ - -/* - * Description of a single Erase region - */ -typedef struct flash_region -{ - int offset; - int region_size; - int number_of_blocks; - int block_size; -}flash_region; - -#endif /* __ALT_FLASH_TYPES_H__ */ diff --git a/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_irq.h b/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_irq.h deleted file mode 100644 index 6666e52..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_irq.h +++ /dev/null @@ -1,245 +0,0 @@ -#ifndef __ALT_IRQ_H__ -#define __ALT_IRQ_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * alt_irq.h is the Nios II specific implementation of the interrupt controller - * interface. - * - * Nios II includes optional support for an external interrupt controller. - * When an external controller is present, the "Enhanced" interrupt API - * must be used to manage individual interrupts. The enhanced API also - * supports the processor's internal interrupt controller. Certain API - * members are accessible from either the "legacy" or "enhanced" interrpt - * API. - * - * Regardless of which API is in use, this file should be included by - * application code and device drivers that register ISRs or manage interrpts. - */ -#include - -#include "nios2.h" -#include "alt_types.h" -#include "system.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * Macros used by alt_irq_enabled - */ -#define ALT_IRQ_ENABLED 1 -#define ALT_IRQ_DISABLED 0 - -/* - * Number of available interrupts in internal interrupt controller. - */ -#define ALT_NIRQ NIOS2_NIRQ - -/* - * Used by alt_irq_disable_all() and alt_irq_enable_all(). - */ -typedef int alt_irq_context; - -/* ISR Prototype */ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT -typedef void (*alt_isr_func)(void* isr_context); -#else -typedef void (*alt_isr_func)(void* isr_context, alt_u32 id); -#endif - -/* - * The following protypes and routines are supported by both - * the enhanced and legacy interrupt APIs - */ - -/* - * alt_irq_enabled can be called to determine if the processor's global - * interrupt enable is asserted. The return value is zero if interrupts - * are disabled, and non-zero otherwise. - * - * Whether the internal or external interrupt controller is present, - * individual interrupts may still be disabled. Use the other API to query - * a specific interrupt. - */ -static ALT_INLINE int ALT_ALWAYS_INLINE alt_irq_enabled (void) -{ - int status; - - NIOS2_READ_STATUS (status); - - return status & NIOS2_STATUS_PIE_MSK; -} - -/* - * alt_irq_disable_all() - * - * This routine inhibits all interrupts by negating the status register PIE - * bit. It returns the previous contents of the CPU status register (IRQ - * context) which can be used to restore the status register PIE bit to its - * state before this routine was called. - */ -static ALT_INLINE alt_irq_context ALT_ALWAYS_INLINE - alt_irq_disable_all (void) -{ - alt_irq_context context; - - NIOS2_READ_STATUS (context); - - NIOS2_WRITE_STATUS (context & ~NIOS2_STATUS_PIE_MSK); - - return context; -} - -/* - * alt_irq_enable_all() - * - * Enable all interrupts that were previously disabled by alt_irq_disable_all() - * - * This routine accepts a context to restore the CPU status register PIE bit - * to the state prior to a call to alt_irq_disable_all(). - - * In the case of nested calls to alt_irq_disable_all()/alt_irq_enable_all(), - * this means that alt_irq_enable_all() does not necessarily re-enable - * interrupts. - * - * This routine will perform a read-modify-write sequence to restore only - * status.PIE if the processor is configured with options that add additional - * writeable status register bits. These include the MMU, MPU, the enhanced - * interrupt controller port, and shadow registers. Otherwise, as a performance - * enhancement, status is overwritten with the prior context. - */ -static ALT_INLINE void ALT_ALWAYS_INLINE - alt_irq_enable_all (alt_irq_context context) -{ -#if (NIOS2_NUM_OF_SHADOW_REG_SETS > 0) || (defined NIOS2_EIC_PRESENT) || \ - (defined NIOS2_MMU_PRESENT) || (defined NIOS2_MPU_PRESENT) - alt_irq_context status; - - NIOS2_READ_STATUS (status); - - status &= ~NIOS2_STATUS_PIE_MSK; - status |= (context & NIOS2_STATUS_PIE_MSK); - - NIOS2_WRITE_STATUS (status); -#else - NIOS2_WRITE_STATUS (context); -#endif -} - -/* - * The function alt_irq_init() is defined within the auto-generated file - * alt_sys_init.c. This function calls the initilization macros for all - * interrupt controllers in the system at config time, before any other - * non-interrupt controller driver is initialized. - * - * The "base" parameter is ignored and only present for backwards-compatibility. - * It is recommended that NULL is passed in for the "base" parameter. - */ -extern void alt_irq_init (const void* base); - -/* - * alt_irq_cpu_enable_interrupts() enables the CPU to start taking interrupts. - */ -static ALT_INLINE void ALT_ALWAYS_INLINE - alt_irq_cpu_enable_interrupts () -{ - NIOS2_WRITE_STATUS(NIOS2_STATUS_PIE_MSK -#if defined(NIOS2_EIC_PRESENT) && (NIOS2_NUM_OF_SHADOW_REG_SETS > 0) - | NIOS2_STATUS_RSIE_MSK -#endif - ); -} - - -/* - * Prototypes for the enhanced interrupt API. - */ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT -/* - * alt_ic_isr_register() can be used to register an interrupt handler. If the - * function is succesful, then the requested interrupt will be enabled upon - * return. - */ -extern int alt_ic_isr_register(alt_u32 ic_id, - alt_u32 irq, - alt_isr_func isr, - void *isr_context, - void *flags); - -/* - * alt_ic_irq_enable() and alt_ic_irq_disable() enable/disable a specific - * interrupt by using IRQ port and interrupt controller instance. - */ -int alt_ic_irq_enable (alt_u32 ic_id, alt_u32 irq); -int alt_ic_irq_disable(alt_u32 ic_id, alt_u32 irq); - - /* - * alt_ic_irq_enabled() indicates whether a specific interrupt, as - * specified by IRQ port and interrupt controller instance is enabled. - */ -alt_u32 alt_ic_irq_enabled(alt_u32 ic_id, alt_u32 irq); - -#else -/* - * Prototypes for the legacy interrupt API. - */ -#include "priv/alt_legacy_irq.h" -#endif - - -/* - * alt_irq_pending() returns a bit list of the current pending interrupts. - * This is used by alt_irq_handler() to determine which registered interrupt - * handlers should be called. - * - * This routine is only available for the Nios II internal interrupt - * controller. - */ -#ifndef NIOS2_EIC_PRESENT -static ALT_INLINE alt_u32 ALT_ALWAYS_INLINE alt_irq_pending (void) -{ - alt_u32 active; - - NIOS2_READ_IPENDING (active); - - return active; -} -#endif - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_IRQ_H__ */ diff --git a/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_irq_entry.h b/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_irq_entry.h deleted file mode 100644 index e2008d9..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_irq_entry.h +++ /dev/null @@ -1,39 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * This file pulls in the IRQ entry assembler and C code, which is only - * required if there are any interruptes in the system. - */ - -__asm__( "\n\t.globl alt_irq_entry" ); - -__asm__( "\n\t.globl alt_irq_handler" ); - diff --git a/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_license_reminder_ucosii.h b/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_license_reminder_ucosii.h deleted file mode 100644 index 2fe649c..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_license_reminder_ucosii.h +++ /dev/null @@ -1,77 +0,0 @@ -#ifndef __ALT_LICENSE_REMINDER_UCOSII_H__ -#define __ALT_LICENSE_REMINDER_UCOSII_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include - -#define ALT_LICENSE_REMINDER_UCOSII_STRING \ - "============== Software License Reminder ===============\n" \ - "\n" \ - "uC/OS-II is provided in source form for FREE evaluation,\n" \ - "for educational use, or for peaceful research. If you\n" \ - "plan on using uC/OS-II in a commercial product you need\n" \ - "to contact Micrium to properly license its use in your\n" \ - "product. Micrium provides ALL the source code on the\n" \ - "Altera distribution for your convenience and to help you\n" \ - "experience uC/OS-II. The fact that the source is provided\n" \ - "does NOT mean that you can use it without paying a\n" \ - "licensing fee. Please help us continue to provide the\n" \ - "Embedded community with the finest software available.\n" \ - "Your honesty is greatly appreciated.\n" \ - "\n" \ - "Please contact:\n" \ - "\n" \ - "M I C R I U M\n" \ - "949 Crestview Circle\n" \ - "Weston, FL 33327-1848\n" \ - "U.S.A.\n" \ - "\n" \ - "Phone : +1 954 217 2036\n" \ - "FAX : +1 954 217 2037\n" \ - "WEB : www.micrium.com\n" \ - "E-mail: Sales@Micrium.com\n" \ - "\n" \ - "========================================================\n" - -#define alt_license_reminder_ucosii() puts(ALT_LICENSE_REMINDER_UCOSII_STRING) - - -#endif /* __ALT_LICENSE_REMINDER_UCOSII_H__ */ - diff --git a/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_llist.h b/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_llist.h deleted file mode 100644 index 46f81ce..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_llist.h +++ /dev/null @@ -1,123 +0,0 @@ -#ifndef __ALT_LIST_H__ -#define __ALT_LIST_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "alt_types.h" - -/* - * alt_llist.h defines structures and functions for use in manipulating linked - * lists. A list is considered to be constructed from a chain of objects of - * type alt_llist, with one object being defined to be the head element. - * - * A list is considered to be empty if it only contains the head element. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * alt_llist is the structure used to represent an element within a linked - * list. - */ - -typedef struct alt_llist_s alt_llist; - -struct alt_llist_s { - alt_llist* next; /* Pointer to the next element in the list. */ - alt_llist* previous; /* Pointer to the previous element in the list. */ -}; - -/* - * ALT_LLIST_HEAD is a macro that can be used to create the head of a new - * linked list. This is named "head". The head element is initialised to - * represent an empty list. - */ - -#define ALT_LLIST_HEAD(head) alt_llist head = {&head, &head} - -/* - * ALT_LLIST_ENTRY is a macro used to define an uninitialised linked list - * entry. This is used to reserve space in structure initialisation for - * structures that inherit form alt_llist. - */ - -#define ALT_LLIST_ENTRY {0, 0} - -/* - * alt_llist_insert() insert adds the linked list entry "entry" as the - * first entry in the linked list "list". "list" is the list head element. - */ - -static ALT_INLINE void ALT_ALWAYS_INLINE alt_llist_insert(alt_llist* list, - alt_llist* entry) -{ - entry->previous = list; - entry->next = list->next; - - list->next->previous = entry; - list->next = entry; -} - -/* - * alt_llist_remove() is called to remove an element from a linked list. The - * input argument is the element to remove. - */ - -static ALT_INLINE void ALT_ALWAYS_INLINE alt_llist_remove(alt_llist* entry) -{ - entry->next->previous = entry->previous; - entry->previous->next = entry->next; - - /* - * Set the entry to point to itself, so that any further calls to - * alt_llist_remove() are harmless. - */ - - entry->previous = entry; - entry->next = entry; -} - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_LLIST_H__ */ diff --git a/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_load.h b/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_load.h deleted file mode 100644 index 432e9f2..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_load.h +++ /dev/null @@ -1,78 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "alt_types.h" - -/* - * This macro is used to load code/data from its load address to its - * execution address for a given section. The section name is the input - * argument. Note that a leading '.' is assumed in the name. For example - * to load the section .onchip_ram, use: - * - * ALT_LOAD_SECTION_BY_NAME(onchip_ram); - * - * This requires that the apropriate linker symbols have been generated - * for the section in question. This will be the case if you are using the - * default linker script. - */ - -#define ALT_LOAD_SECTION_BY_NAME(name) \ - { \ - extern void _alt_partition_##name##_start; \ - extern void _alt_partition_##name##_end; \ - extern void _alt_partition_##name##_load_addr; \ - \ - alt_load_section(&_alt_partition_##name##_load_addr, \ - &_alt_partition_##name##_start, \ - &_alt_partition_##name##_end); \ - } - -/* - * Function used to load an individual section from flash to RAM. - * - * There is an implicit assumption here that the linker script will ensure - * that all sections are word aligned. - * - */ - -static void ALT_INLINE alt_load_section (alt_u32* from, - alt_u32* to, - alt_u32* end) -{ - if (to != from) - { - while( to != end ) - { - *to++ = *from++; - } - } -} diff --git a/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_log_printf.h b/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_log_printf.h deleted file mode 100644 index c15ca05..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_log_printf.h +++ /dev/null @@ -1,349 +0,0 @@ -/* alt_log_printf.h - * - * ALT_LOG is designed to provide extra logging/debugging messages from HAL - * through a different port than stdout. It is enabled by the ALT_LOG_ENABLE - * define, which needs to supplied at compile time. When logging is turned off, - * code size is unaffected. Thus, this should be transparent to the user - * when it is not actively turned on, and should not affect projects in any way. - * - * There are macros sprinkled within different components, such as the jtag uart - * and timer, in the HAL code. They are always named ALT_LOG_, and can be - * safely ignored if ALT_LOG is turned off. - * - * To turn on ALT_LOG, ALT_LOG_ENABLE must be defined, and ALT_LOG_PORT_TYPE and - * ALT_LOG_PORT_BASE must be set in system.h. This is done through editing - * .ptf, by editing the alt_log_port_type & alt_log_port_base settings. - * See the documentation html file for examples. - * - * When it is turned on, it will output extra HAL messages to a port specified - * in system.h. This can be a UART or JTAG UART port. By default it will - * output boot messages, detailing every step of the boot process. - * - * Extra logging is designed to be enabled by flags, which are defined in - * alt_log_printf.c. The default value is that all flags are off, so only the - * boot up logging messages show up. ALT_LOG_FLAGS can be set to enable certain - * groupings of flags, and that grouping is done in this file. Each flag can - * also be overridden with a -D at compile time. - * - * This header file includes the necessary prototypes for using the alt_log - * functions. It also contains all the macros that are used to remove the code - * from alt log is turned off. Also, the macros in other HAL files are defined - * here at the bottom. These macros all call some C function that is in - * alt_log_printf.c. - * - * The logging has functions for printing in C (ALT_LOG_PRINTF) and in assembly - * (ALT_LOG_PUTS). This was needed because the assembly printing occurs before - * the device is initialized. The assembly function corrupts register R4-R7, - * which are not used in the normal boot process. For this reason, do not call - * the assembly function in C. - * - * author: gkwan - */ - - -#ifndef __ALT_LOG_PRINTF_H__ -#define __ALT_LOG_PRINTF_H__ - -#include - -/* Global switch to turn on logging functions */ -#ifdef ALT_LOG_ENABLE - - /* ALT_LOG_PORT_TYPE values as defined in system.h. They are defined as - * numbers here first becasue the C preprocessor does not handle string - * comparisons. */ - #define ALTERA_AVALON_JTAG_UART 1 - #define ALTERA_AVALON_UART 0 - - /* If this .h file is included by an assembly file, skip over include files - * that won't compile in assembly. */ - #ifndef ALT_ASM_SRC - #include - #include "sys/alt_alarm.h" - #include "sys/alt_dev.h" - #ifdef __ALTERA_AVALON_JTAG_UART - #include "altera_avalon_jtag_uart.h" - #endif - #endif /* ALT_ASM_SRC */ - - /* These are included for the port register offsets and masks, needed - * to write to the port. Only include if the port type is set correctly, - * otherwise error. If alt_log is turned on and the port to output to is - * incorrect or does not exist, then should exit. */ - #if ALT_LOG_PORT_TYPE == ALTERA_AVALON_JTAG_UART - #ifdef __ALTERA_AVALON_JTAG_UART - #include - #else - #error ALT_LOG: JTAG_UART port chosen, but no JTAG_UART in system. - #endif - #elif ALT_LOG_PORT_TYPE == ALTERA_AVALON_UART - #ifdef __ALTERA_AVALON_UART - #include - #else - #error ALT_LOG: UART Port chosen, but no UART in system. - #endif - #else - #error ALT_LOG: alt_log_port_type declaration invalid! - #endif - - /* ALT_LOG_ENABLE turns on the basic printing function */ - #define ALT_LOG_PRINTF(...) do {alt_log_printf_proc(__VA_ARGS__);} while (0) - - /* Assembly macro for printing in assembly, calls tx_log_str - * which is in alt_log_macro.S. - * If alt_log_boot_on_flag is 0, skips the printing */ - #define ALT_LOG_PUTS(str) movhi r4, %hiadj(alt_log_boot_on_flag) ; \ - addi r4, r4, %lo(alt_log_boot_on_flag) ; \ - ldwio r5, 0(r4) ; \ - beq r0, r5, 0f ; \ - movhi r4, %hiadj(str) ; \ - addi r4, r4, %lo(str) ; \ - call tx_log_str ; \ - 0: - - /* These defines are here to faciliate the use of one output function - * (alt_log_txchar) to print to both the JTAG UART or the UART. Depending - * on the port type, the status register, read mask, and output register - * are set to the appropriate value for the port. */ - #if ALT_LOG_PORT_TYPE == ALTERA_AVALON_JTAG_UART - #define ALT_LOG_PRINT_REG_RD IORD_ALTERA_AVALON_JTAG_UART_CONTROL - #define ALT_LOG_PRINT_MSK ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_MSK - #define ALT_LOG_PRINT_TXDATA_WR IOWR_ALTERA_AVALON_JTAG_UART_DATA - #define ALT_LOG_PRINT_REG_OFFSET (ALTERA_AVALON_JTAG_UART_CONTROL_REG*0x4) - #define ALT_LOG_PRINT_TXDATA_REG_OFFSET (ALTERA_AVALON_JTAG_UART_DATA_REG*0x4) - #elif ALT_LOG_PORT_TYPE == ALTERA_AVALON_UART - #define ALT_LOG_PRINT_REG_RD IORD_ALTERA_AVALON_UART_STATUS - #define ALT_LOG_PRINT_MSK ALTERA_AVALON_UART_STATUS_TRDY_MSK - #define ALT_LOG_PRINT_TXDATA_WR IOWR_ALTERA_AVALON_UART_TXDATA - #define ALT_LOG_PRINT_REG_OFFSET (ALTERA_AVALON_UART_STATUS_REG*0x4) - #define ALT_LOG_PRINT_TXDATA_REG_OFFSET (ALTERA_AVALON_UART_TXDATA_REG*0x4) - #endif /* ALT_LOG_PORT */ - - /* Grouping of flags via ALT_LOG_FLAGS. Each specific flag can be set via - * -D at compile time, or else they'll be set to a default value according - * to ALT_LOG_FLAGS. ALT_LOG_FLAGS = 0 or not set is the default, where - * only the boot messages will be printed. As ALT_LOG_FLAGS increase, they - * increase in intrusiveness to the program, and will affect performance. - * - * Flag Level 1 - turns on system clock and JTAG UART startup status - * 2 - turns on write echo and JTAG_UART alarm (periodic report) - * 3 - turns on JTAG UART ISR logging - will slow performance - * significantly. - * -1 - All logging output is off, but if ALT_LOG_ENABLE is - * defined all logging function is built and code size - * remains constant - * - * Flag settings - 1 = on, 0 = off. */ - - /* This flag turns on "boot" messages for printing. This includes messages - * during crt0.S, then alt_main, and finally alt_exit. */ - #ifndef ALT_LOG_BOOT_ON_FLAG_SETTING - #if ALT_LOG_FLAGS == 1 - #define ALT_LOG_BOOT_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 2 - #define ALT_LOG_BOOT_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 3 - #define ALT_LOG_BOOT_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == -1 /* silent mode */ - #define ALT_LOG_BOOT_ON_FLAG_SETTING 0x0 - #else /* default setting */ - #define ALT_LOG_BOOT_ON_FLAG_SETTING 0x1 - #endif - #endif /* ALT_LOG_BOOT_ON_FLAG_SETTING */ - - #ifndef ALT_LOG_SYS_CLK_ON_FLAG_SETTING - #if ALT_LOG_FLAGS == 1 - #define ALT_LOG_SYS_CLK_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 2 - #define ALT_LOG_SYS_CLK_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 3 - #define ALT_LOG_SYS_CLK_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == -1 /* silent mode */ - #define ALT_LOG_SYS_CLK_ON_FLAG_SETTING 0x0 - #else /* default setting */ - #define ALT_LOG_SYS_CLK_ON_FLAG_SETTING 0x0 - #endif - #endif /* ALT_LOG_SYS_CLK_ON_FLAG_SETTING */ - - #ifndef ALT_LOG_WRITE_ON_FLAG_SETTING - #if ALT_LOG_FLAGS == 1 - #define ALT_LOG_WRITE_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 2 - #define ALT_LOG_WRITE_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 3 - #define ALT_LOG_WRITE_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == -1 /* silent mode */ - #define ALT_LOG_WRITE_ON_FLAG_SETTING 0x0 - #else /* default setting */ - #define ALT_LOG_WRITE_ON_FLAG_SETTING 0x0 - #endif - #endif /* ALT_LOG_WRITE_ON_FLAG_SETTING */ - - #ifndef ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING - #ifndef __ALTERA_AVALON_JTAG_UART - #define ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 1 - #define ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 2 - #define ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 3 - #define ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == -1 /* silent mode */ - #define ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING 0x0 - #else /* default setting */ - #define ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING 0x0 - #endif - #endif /* ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING */ - - #ifndef ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING - #ifndef __ALTERA_AVALON_JTAG_UART - #define ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 1 - #define ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 2 - #define ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 3 - #define ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == -1 /* silent mode */ - #define ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING 0x0 - #else /* default setting */ - #define ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING 0x0 - #endif - #endif /* ALT_LOG_JTAG_UART_STARTUP_INFO_FLAG_SETTING */ - - #ifndef ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING - #ifndef __ALTERA_AVALON_JTAG_UART - #define ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 1 - #define ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 2 - #define ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 3 - #define ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == -1 /* silent mode */ - #define ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING 0x0 - #else /* default setting */ - #define ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING 0x0 - #endif - #endif /* ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING */ - -#ifndef ALT_ASM_SRC - /* Function Prototypes */ - void alt_log_txchar(int c,char *uartBase); - void alt_log_private_printf(const char *fmt,int base,va_list args); - void alt_log_repchar(char c,int r,int base); - int alt_log_printf_proc(const char *fmt, ... ); - void alt_log_system_clock(); - #ifdef __ALTERA_AVALON_JTAG_UART - alt_u32 altera_avalon_jtag_uart_report_log(void * context); - void alt_log_jtag_uart_startup_info(altera_avalon_jtag_uart_state* dev, int base); - void alt_log_jtag_uart_print_control_reg(altera_avalon_jtag_uart_state* dev, \ - int base, const char* header); - void alt_log_jtag_uart_isr_proc(int base, altera_avalon_jtag_uart_state* dev); - #endif - void alt_log_write(const void *ptr, size_t len); - - /* extern all global variables */ - extern volatile alt_u32 alt_log_boot_on_flag; - extern volatile alt_u8 alt_log_write_on_flag; - extern volatile alt_u8 alt_log_sys_clk_on_flag; - extern volatile alt_u8 alt_log_jtag_uart_alarm_on_flag; - extern volatile alt_u8 alt_log_jtag_uart_isr_on_flag; - extern volatile alt_u8 alt_log_jtag_uart_startup_info_on_flag; - extern volatile int alt_log_sys_clk_count; - extern volatile int alt_system_clock_in_sec; - extern alt_alarm alt_log_jtag_uart_alarm_1; -#endif /* ALT_ASM_SRC */ - - - /* Below are the MACRO defines used in various HAL files. They check - * if their specific flag is turned on; if it is, then it executes its - * code. - * - * To keep this file reasonable, most of these macros calls functions, - * which are defined in alt_log_printf.c. Look there for implementation - * details. */ - - /* Boot Messages Logging */ - #define ALT_LOG_PRINT_BOOT(...) \ - do { if (alt_log_boot_on_flag==1) {ALT_LOG_PRINTF(__VA_ARGS__);} \ - } while (0) - - /* JTAG UART Logging */ - /* number of ticks before alarm runs logging function */ - #ifndef ALT_LOG_JTAG_UART_TICKS_DIVISOR - #define ALT_LOG_JTAG_UART_TICKS_DIVISOR 10 - #endif - #ifndef ALT_LOG_JTAG_UART_TICKS - #define ALT_LOG_JTAG_UART_TICKS \ - (alt_ticks_per_second()/ALT_LOG_JTAG_UART_TICKS_DIVISOR) - #endif - - /* if there's a JTAG UART defined, then enable these macros */ - #ifdef __ALTERA_AVALON_JTAG_UART - - /* Macro in altera_avalon_jtag_uart.c, to register the alarm function. - * Also, the startup register info is also printed here, as this is - * called within the device driver initialization. */ - #define ALT_LOG_JTAG_UART_ALARM_REGISTER(dev, base) \ - do { if (alt_log_jtag_uart_alarm_on_flag==1) { \ - alt_alarm_start(&alt_log_jtag_uart_alarm_1, \ - ALT_LOG_JTAG_UART_TICKS, &altera_avalon_jtag_uart_report_log,\ - dev);} \ - if (alt_log_jtag_uart_startup_info_on_flag==1) {\ - alt_log_jtag_uart_startup_info(dev, base);} \ - } while (0) - - /* JTAG UART IRQ Logging (when buffer is empty) - * Inserted in the ISR in altera_avalon_jtag_uart.c */ - #define ALT_LOG_JTAG_UART_ISR_FUNCTION(base, dev) \ - do { alt_log_jtag_uart_isr_proc(base, dev); } while (0) - /* else, define macros to nothing. Or else the jtag_uart specific types - * will throw compiler errors */ - #else - #define ALT_LOG_JTAG_UART_ALARM_REGISTER(dev, base) - #define ALT_LOG_JTAG_UART_ISR_FUNCTION(base, dev) - #endif - - /* System clock logging - * How often (in seconds) the system clock logging prints. - * The default value is every 1 second */ - #ifndef ALT_LOG_SYS_CLK_INTERVAL_MULTIPLIER - #define ALT_LOG_SYS_CLK_INTERVAL_MULTIPLIER 1 - #endif - #ifndef ALT_LOG_SYS_CLK_INTERVAL - #define ALT_LOG_SYS_CLK_INTERVAL \ - (alt_ticks_per_second()*ALT_LOG_SYS_CLK_INTERVAL_MULTIPLIER) - #endif - - /* System clock logging - prints a message every interval (set above) - * to show that the system clock is alive. - * This macro is used in altera_avalon_timer_sc.c */ - #define ALT_LOG_SYS_CLK_HEARTBEAT() \ - do { alt_log_system_clock(); } while (0) - - /* alt_write_logging - echos a message every time write() is called, - * displays the first ALT_LOG_WRITE_ECHO_LEN characters. - * This macro is used in alt_write.c */ - #ifndef ALT_LOG_WRITE_ECHO_LEN - #define ALT_LOG_WRITE_ECHO_LEN 15 - #endif - - #define ALT_LOG_WRITE_FUNCTION(ptr,len) \ - do { alt_log_write(ptr,len); } while (0) - -#else /* ALT_LOG_ENABLE not defined */ - - /* logging is off, set all relevant macros to null */ - #define ALT_LOG_PRINT_BOOT(...) - #define ALT_LOG_PRINTF(...) - #define ALT_LOG_JTAG_UART_ISR_FUNCTION(base, dev) - #define ALT_LOG_JTAG_UART_ALARM_REGISTER(dev, base) - #define ALT_LOG_SYS_CLK_HEARTBEAT() - #define ALT_LOG_PUTS(str) - #define ALT_LOG_WRITE_FUNCTION(ptr,len) - -#endif /* ALT_LOG_ENABLE */ - -#endif /* __ALT_LOG_PRINTF_H__ */ - diff --git a/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_set_args.h b/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_set_args.h deleted file mode 100644 index 3750e67..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_set_args.h +++ /dev/null @@ -1,71 +0,0 @@ -#ifndef __ALT_SET_ARGS_H__ -#define __ALT_SET_ARGS_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The function alt_set_args() is provided in order to define the input - * arguments to main(). If this function is not called before main() then the - * argument list passed to main() will be empty. - * - * It is expected that this function will only be used by the ihost/iclient - * utility. - */ - -static inline void alt_set_args (int argc, char** argv, char** envp) -{ - extern int alt_argc; - extern char** alt_argv; - extern char** alt_envp; - - alt_argc = argc; - alt_argv = argv; - alt_envp = envp; -} - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_SET_ARGS_H__ */ diff --git a/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_sim.h b/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_sim.h deleted file mode 100644 index 06bd27a..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_sim.h +++ /dev/null @@ -1,91 +0,0 @@ -#ifndef __ALT_SIM_H__ -#define __ALT_SIM_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ -#include "system.h" -#include "alt_types.h" - -/* - * Instructions that might mean something special to a simulator. - * These have no special effect on real hardware (they are just nops). - */ -#define ALT_SIM_FAIL() \ - do { __asm volatile ("cmpltui r0, r0, 0xabc1"); } while (0) - -#define ALT_SIM_PASS() \ - do { __asm volatile ("cmpltui r0, r0, 0xabc2"); } while (0) - -#define ALT_SIM_IN_TOP_OF_HOT_LOOP() \ - do { __asm volatile ("cmpltui r0, r0, 0xabc3"); } while (0) - -/* - * Routine called on exit. - */ -static ALT_ALWAYS_INLINE void alt_sim_halt(int exit_code) -{ - int r2 = exit_code; - -#if defined(NIOS2_HAS_DEBUG_STUB) && (defined(ALT_BREAK_ON_EXIT) || defined(ALT_PROVIDE_GMON)) - - int r3 = (1 << 2); - -#ifdef ALT_PROVIDE_GMON - extern unsigned int alt_gmon_data[]; - int r4 = (int)alt_gmon_data; - r3 |= (1 << 4); -#define ALT_GMON_DATA ,"D04"(r4) -#else -#define ALT_GMON_DATA -#endif /* ALT_PROVIDE_GMON */ - - if (r2) { - ALT_SIM_FAIL(); - } else { - ALT_SIM_PASS(); - } - - __asm__ volatile ("\n0:\n\taddi %0,%0, -1\n\tbgt %0,zero,0b" : : "r" (ALT_CPU_FREQ/100) ); /* Delay for >30ms */ - - __asm__ volatile ("break 2" : : "D02"(r2), "D03"(r3) ALT_GMON_DATA ); - -#else /* !DEBUG_STUB */ - if (r2) { - ALT_SIM_FAIL(); - } else { - ALT_SIM_PASS(); - } -#endif /* DEBUG_STUB */ -} - -#define ALT_SIM_HALT(exit_code) \ - alt_sim_halt(exit_code) - -#endif /* __ALT_SIM_H__ */ diff --git a/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_stack.h b/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_stack.h deleted file mode 100644 index e30652a..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_stack.h +++ /dev/null @@ -1,126 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#ifndef __ALT_STACK_H__ -#define __ALT_STACK_H__ - -/* - * alt_stack.h is the nios2 specific implementation of functions used by the - * stack overflow code. - */ - -#include "nios2.h" - -#include "alt_types.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - - -extern char * alt_stack_limit_value; - -#ifdef ALT_EXCEPTION_STACK -extern char __alt_exception_stack_pointer[]; /* set by the linker */ -#endif /* ALT_EXCEPTION_STACK */ - - -/* - * alt_stack_limit can be called to determine the current value of the stack - * limit register. - */ - -static ALT_INLINE char * ALT_ALWAYS_INLINE alt_stack_limit (void) -{ - char * limit; - NIOS2_READ_ET(limit); - - return limit; -} - -/* - * alt_stack_pointer can be called to determine the current value of the stack - * pointer register. - */ - -static ALT_INLINE char * ALT_ALWAYS_INLINE alt_stack_pointer (void) -{ - char * pointer; - NIOS2_READ_SP(pointer); - - return pointer; -} - - -#ifdef ALT_EXCEPTION_STACK - -/* - * alt_exception_stack_pointer returns the normal stack pointer from - * where it is stored on the exception stack (uppermost 4 bytes). This - * is really only useful during exception processing, and is only - * available if a separate exception stack has been configured. - */ - -static ALT_INLINE char * ALT_ALWAYS_INLINE alt_exception_stack_pointer (void) -{ - return (char *) *(alt_u32 *)(__alt_exception_stack_pointer - sizeof(alt_u32)); -} - -#endif /* ALT_EXCEPTION_STACK */ - - -/* - * alt_set_stack_limit can be called to update the current value of the stack - * limit register. - */ - -static ALT_INLINE void ALT_ALWAYS_INLINE alt_set_stack_limit (char * limit) -{ - alt_stack_limit_value = limit; - NIOS2_WRITE_ET(limit); -} - -/* - * alt_report_stack_overflow reports that a stack overflow happened. - */ - -static ALT_INLINE void ALT_ALWAYS_INLINE alt_report_stack_overflow (void) -{ - NIOS2_REPORT_STACK_OVERFLOW(); -} - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_STACK_H__ */ - diff --git a/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_stdio.h b/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_stdio.h deleted file mode 100644 index 1730360..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_stdio.h +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef __ALT_STDIO_H__ -#define __ALT_STDIO_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * Definitions for ALT stdio routines. - */ - -#include - - -#ifdef __cplusplus -extern "C" { -#endif - -int alt_getchar(); -int alt_putchar(int c); -int alt_putstr(const char* str); -void alt_printf(const char *fmt, ...); - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_STDIO_H__ */ diff --git a/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_sys_init.h b/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_sys_init.h deleted file mode 100644 index e4abc28..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_sys_init.h +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef __ALT_SYS_INIT_H__ -#define __ALT_SYS_INIT_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The function alt_sys_init() is defined within the auto-generated file: - * alt_sys_init.c. This function calls the initilisation macros for all - * devices, file systems, and software components within the system. - * - * The list of initilisation macros to use is constructed using the PTF and - * STF files associated with the system. - */ - -extern void alt_sys_init (void); - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_SYS_INIT_H__ */ diff --git a/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_sys_wrappers.h b/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_sys_wrappers.h deleted file mode 100644 index 044833b..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_sys_wrappers.h +++ /dev/null @@ -1,100 +0,0 @@ -#ifndef __ALT_SYS_WRAPPERS_H__ -#define __ALT_SYS_WRAPPERS_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * This file provides the prototypes for the HAL 'UNIX style functions. The - * names of these functions are defined in alt_syscall.h. THese are defined to - * be the standard names when running the standalone HAL, e.g. open(), close() - * etc., but the names may be redefined as a part of an operating system port - * in order to avoid name clashes. - */ - -#include "os/alt_syscall.h" - -#include -#include -#include -#include -#include -#include - -extern int ALT_CLOSE (int __fd); -extern int ALT_EXECVE (const char *__path, - char * const __argv[], - char * const __envp[]); -extern void ALT_EXIT (int __status); -extern int ALT_FSTAT (int file, struct stat *st); -extern int ALT_FCNTL (int file, int cmd, ...); -extern pid_t ALT_FORK (void); -extern pid_t ALT_GETPID (void); - -#if defined (__GNUC__) && __GNUC__ >= 4 -extern int ALT_GETTIMEOFDAY (struct timeval *ptimeval, - void *ptimezone); -#else -extern int ALT_GETTIMEOFDAY (struct timeval *ptimeval, - struct timezone *ptimezone); -#endif - -extern int ALT_IOCTL (int file, int req, void* arg); -extern int ALT_ISATTY (int file); -extern int ALT_KILL (int pid, int sig); -extern int ALT_LINK (const char *existing, const char *new); -extern off_t ALT_LSEEK (int file, off_t ptr, int dir); -extern int ALT_OPEN (const char* file, int flags, ...); -extern int ALT_READ (int file, void *ptr, size_t len); -extern int ALT_RENAME (char *existing, char *new); -extern void* ALT_SBRK (ptrdiff_t incr); -extern int ALT_SETTIMEOFDAY (const struct timeval *t, - const struct timezone *tz); -extern int ALT_STAT (const char *file, struct stat *st); -extern clock_t ALT_TIMES (struct tms *buf); -extern int ALT_UNLINK (const char *name); - -#if defined (__GNUC__) && __GNUC__ >= 4 -int ALT_USLEEP (useconds_t us); -#else -unsigned int ALT_USLEEP (unsigned int us); -#endif - -extern int ALT_WAIT (int *status); -extern int ALT_WRITE (int file, const void *ptr, size_t len); - - -extern char** ALT_ENVIRON; - -/* - * - */ - -#endif /* __ALT_SYS_WRAPPERS_H__ */ diff --git a/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_timestamp.h b/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_timestamp.h deleted file mode 100644 index 8a18da2..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_timestamp.h +++ /dev/null @@ -1,60 +0,0 @@ -#ifndef __ALT_TIMESTAMP_H__ -#define __ALT_TIMESTAMP_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "alt_types.h" -#include "altera_avalon_timer.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -extern int alt_timestamp_start (void); - -extern alt_timestamp_type alt_timestamp (void); - -extern alt_u32 alt_timestamp_freq (void); - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_TIMESTAMP_H__ */ diff --git a/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_warning.h b/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_warning.h deleted file mode 100644 index b66e71a..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/inc/sys/alt_warning.h +++ /dev/null @@ -1,75 +0,0 @@ -#ifndef __WARNING_H__ -#define __WARNING_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * alt_warning.h provides macro definitions that can be used to generate link - * time warnings. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The symbol "__alt_invalid" is used to force a link error. There should be - * no corresponding implementation of this function. - */ - -extern void __alt_invalid (void); - -#define ALT_LINK_WARNING(symbol, msg) \ - __asm__(".ifndef __evoke_link_warning_" #symbol \ - "\n\t .section .gnu.warning." #symbol \ - "\n__evoke_link_warning_" #symbol ":\n\t .string \x22" msg "\x22 \n\t .previous" \ - "\n .endif"); - -/* A canned warning for sysdeps/stub functions. */ - -#define ALT_STUB_WARNING(name) \ - ALT_LINK_WARNING (name, \ - "warning: " #name " is not implemented and will always fail") - -#define ALT_OBSOLETE_FUNCTION_WARNING(name) \ - ALT_LINK_WARNING (name, \ - "warning: " #name " is a deprecated function") - -#define ALT_LINK_ERROR(msg) \ - ALT_LINK_WARNING (__alt_invalid, msg); \ - __alt_invalid() - -#ifdef __cplusplus -} -#endif - -#endif /* __WARNING_H__ */ diff --git a/software/qsys_tutorial_green_bsp/HAL/inc/sys/ioctl.h b/software/qsys_tutorial_green_bsp/HAL/inc/sys/ioctl.h deleted file mode 100644 index 4d565df..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/inc/sys/ioctl.h +++ /dev/null @@ -1,90 +0,0 @@ -#ifndef __IOCTL_H__ -#define __IOCTL_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The ioctl() system call be used to initiate a variety of control operations - * on a file descriptor. For the most part this simply translates to a call to - * the ioctl() function of the associated device driver (TIOCEXCL and - * TIOCNXCL are notable exceptions - see ioctl.c for details). - * - * The interpretation of the ioctl requests are therefore device specific. - * - * This function is equivalent to the standard Posix ioctl() call. - */ - -extern int ioctl (int fd, int req, void* arg); - -/* - * list of ioctl calls handled by the system ioctl implementation. - */ - -#define TIOCEXCL 0x740d /* exclusive use of the device */ -#define TIOCNXCL 0x740e /* allow multiple use of the device */ - -/* - * ioctl calls which can be handled by device drivers. - */ - -#define TIOCOUTQ 0x7472 /* get output queue size */ -#define TIOCMGET 0x741d /* get termios flags */ -#define TIOCMSET 0x741a /* set termios flags */ - -/* - * ioctl calls specific to JTAG UART. - */ - -#define TIOCSTIMEOUT 0x6a01 /* Set Timeout before assuming no host present */ -#define TIOCGCONNECTED 0x6a02 /* Get indication of whether host is connected */ - -/* - * - */ - -#ifdef __cplusplus -} -#endif - -#endif /* __IOCTL_H__ */ diff --git a/software/qsys_tutorial_green_bsp/HAL/inc/sys/termios.h b/software/qsys_tutorial_green_bsp/HAL/inc/sys/termios.h deleted file mode 100644 index cd09539..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/inc/sys/termios.h +++ /dev/null @@ -1,181 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * This is the termios.h file provided with newlib. The only modification has - * been to the baud rate macro definitions, and an increase in the size of the - * termios structure to accomodate this. - */ - - -#ifndef _SYS_TERMIOS_H -# define _SYS_TERMIOS_H - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -# define _XCGETA (('x'<<8)|1) -# define _XCSETA (('x'<<8)|2) -# define _XCSETAW (('x'<<8)|3) -# define _XCSETAF (('x'<<8)|4) -# define _TCSBRK (('T'<<8)|5) -# define _TCFLSH (('T'<<8)|7) -# define _TCXONC (('T'<<8)|6) - -# define TCOOFF 0 -# define TCOON 1 -# define TCIOFF 2 -# define TCION 3 - -# define TCIFLUSH 0 -# define TCOFLUSH 1 -# define TCIOFLUSH 2 - -# define NCCS 13 - -# define TCSAFLUSH _XCSETAF -# define TCSANOW _XCSETA -# define TCSADRAIN _XCSETAW -# define TCSADFLUSH _XCSETAF - -# define IGNBRK 000001 -# define BRKINT 000002 -# define IGNPAR 000004 -# define INPCK 000020 -# define ISTRIP 000040 -# define INLCR 000100 -# define IGNCR 000200 -# define ICRNL 000400 -# define IXON 002000 -# define IXOFF 010000 - -# define OPOST 000001 -# define OCRNL 000004 -# define ONLCR 000010 -# define ONOCR 000020 -# define TAB3 014000 - -# define CLOCAL 004000 -# define CREAD 000200 -# define CSIZE 000060 -# define CS5 0 -# define CS6 020 -# define CS7 040 -# define CS8 060 -# define CSTOPB 000100 -# define HUPCL 002000 -# define PARENB 000400 -# define PAODD 001000 - -#define CCTS_OFLOW 010000 -#define CRTS_IFLOW 020000 -#define CRTSCTS (CCTS_OFLOW | CRTS_IFLOW) - -# define ECHO 0000010 -# define ECHOE 0000020 -# define ECHOK 0000040 -# define ECHONL 0000100 -# define ICANON 0000002 -# define IEXTEN 0000400 /* anybody know *what* this does?! */ -# define ISIG 0000001 -# define NOFLSH 0000200 -# define TOSTOP 0001000 - -# define VEOF 4 /* also VMIN -- thanks, AT&T */ -# define VEOL 5 /* also VTIME -- thanks again */ -# define VERASE 2 -# define VINTR 0 -# define VKILL 3 -# define VMIN 4 /* also VEOF */ -# define VQUIT 1 -# define VSUSP 10 -# define VTIME 5 /* also VEOL */ -# define VSTART 11 -# define VSTOP 12 - -# define B0 0 -# define B50 50 -# define B75 75 -# define B110 110 -# define B134 134 -# define B150 150 -# define B200 200 -# define B300 300 -# define B600 600 -# define B1200 1200 -# define B1800 1800 -# define B2400 2400 -# define B4800 4800 -# define B9600 9600 -# define B19200 19200 -# define B38400 38400 -# define B57600 57600 -# define B115200 115200 - -typedef unsigned char cc_t; -typedef unsigned short tcflag_t; -typedef unsigned long speed_t; - -struct termios { - tcflag_t c_iflag; - tcflag_t c_oflag; - tcflag_t c_cflag; - tcflag_t c_lflag; - char c_line; - cc_t c_cc[NCCS]; - speed_t c_ispeed; - speed_t c_ospeed; -}; - -# ifndef _NO_MACROS - -# define cfgetospeed(tp) ((tp)->c_ospeed) -# define cfgetispeed(tp) ((tp)->c_ispeed) -# define cfsetospeed(tp,s) (((tp)->c_ospeed = (s)), 0) -# define cfsetispeed(tp,s) (((tp)->c_ispeed = (s)), 0) -# define tcdrain(fd) _ioctl (fd, _TCSBRK, 1) -# endif /* _NO_MACROS */ - -#ifdef __cplusplus -} -#endif - -#endif /* _SYS_TERMIOS_H */ - diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_alarm_start.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_alarm_start.c deleted file mode 100644 index 7739959..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_alarm_start.c +++ /dev/null @@ -1,112 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "sys/alt_alarm.h" -#include "sys/alt_irq.h" - -/* - * alt_alarm_start is called to register an alarm with the system. The - * "alarm" structure passed as an input argument does not need to be - * initialised by the user. This is done within this function. - * - * The remaining input arguments are: - * - * nticks - The time to elapse until the alarm executes. This is specified in - * system clock ticks. - * callback - The function to run when the indicated time has elapsed. - * context - An opaque value, passed to the callback function. -* - * Care should be taken when defining the callback function since it is - * likely to execute in interrupt context. In particular, this mean that - * library calls like printf() should not be made, since they can result in - * deadlock. - * - * The interval to be used for the next callback is the return - * value from the callback function. A return value of zero indicates that the - * alarm should be unregistered. - * - * alt_alarm_start() will fail if the timer facility has not been enabled - * (i.e. there is no system clock). Failure is indicated by a negative return - * value. - */ - -int alt_alarm_start (alt_alarm* alarm, alt_u32 nticks, - alt_u32 (*callback) (void* context), - void* context) -{ - alt_irq_context irq_context; - alt_u32 current_nticks = 0; - - if (alt_ticks_per_second ()) - { - if (alarm) - { - alarm->callback = callback; - alarm->context = context; - - irq_context = alt_irq_disable_all (); - - current_nticks = alt_nticks(); - - alarm->time = nticks + current_nticks + 1; - - /* - * If the desired alarm time causes a roll-over, set the rollover - * flag. This will prevent the subsequent tick event from causing - * an alarm too early. - */ - if(alarm->time < current_nticks) - { - alarm->rollover = 1; - } - else - { - alarm->rollover = 0; - } - - alt_llist_insert (&alt_alarm_list, &alarm->llist); - alt_irq_enable_all (irq_context); - - return 0; - } - else - { - return -EINVAL; - } - } - else - { - return -ENOTSUP; - } -} diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_busy_sleep.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_busy_sleep.c deleted file mode 100644 index 561c0be..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_busy_sleep.c +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright (c) 2003-2004 Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - * - * ------------ - * - * Altera does not recommend, suggest or require that this reference design - * file be used in conjunction or combination with any other product. - * - * alt_busy_sleep.c - Microsecond delay routine which uses a calibrated busy - * loop to perform the delay. This is used to implement - * usleep for both uC/OS-II and the standalone HAL. - * - * Author PRR - * - * Calibrated delay with no timer required - * - * The ASM instructions in the routine are equivalent to - * - * for (i=0;i -#include - -#include "system.h" -#include "alt_types.h" - -#include "priv/alt_busy_sleep.h" - -unsigned int alt_busy_sleep (unsigned int us) -{ -/* - * Only delay if ALT_SIM_OPTIMIZE is not defined; i.e., if software - * is built targetting ModelSim RTL simulation, the delay will be - * skipped to speed up simulation. - */ -#ifndef ALT_SIM_OPTIMIZE - int i; - int big_loops; - alt_u32 cycles_per_loop; - - if (!strcmp(NIOS2_CPU_IMPLEMENTATION,"tiny")) - { - cycles_per_loop = 9; - } - else - { - cycles_per_loop = 3; - } - - - big_loops = us / (INT_MAX/ - (ALT_CPU_FREQ/(cycles_per_loop * 1000000))); - - if (big_loops) - { - for(i=0;i - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -#ifdef ALT_USE_DIRECT_DRIVERS - -int ALT_CLOSE (int fildes) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(close); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -/* - * close() is called by an application to release a file descriptor. If the - * associated file system/device has a close() callback function registered - * then this called. The file descriptor is then marked as free. - * - * ALT_CLOSE is mapped onto the close() system call in alt_syscall.h - */ - -int ALT_CLOSE (int fildes) -{ - alt_fd* fd; - int rval; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (fildes < 0) ? NULL : &alt_fd_list[fildes]; - - if (fd) - { - /* - * If the associated file system/device has a close function, call it so - * that any necessary cleanup code can run. - */ - - rval = (fd->dev->close) ? fd->dev->close(fd) : 0; - - /* Free the file descriptor structure and return. */ - - alt_release_fd (fildes); - if (rval < 0) - { - ALT_ERRNO = -rval; - return -1; - } - return 0; - } - else - { - ALT_ERRNO = EBADFD; - return -1; - } -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_dcache_flush.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_dcache_flush.c deleted file mode 100644 index 7ecc91a..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_dcache_flush.c +++ /dev/null @@ -1,97 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "nios2.h" -#include "system.h" - -#include "alt_types.h" -#include "sys/alt_cache.h" - -/* - * Nios II version 1.2 and newer supports the "flush by address" instruction, in - * addition to the "flush by line" instruction provided by older versions of - * the core. This newer instruction is used by preference when it is - * available. - */ - -#ifdef NIOS2_FLUSHDA_SUPPORTED -#define ALT_FLUSH_DATA(i) __asm__ volatile ("flushda (%0)" :: "r" (i)); -#else -#define ALT_FLUSH_DATA(i) __asm__ volatile ("flushd (%0)" :: "r" (i)); -#endif /* NIOS2_FLUSHDA_SUPPORTED */ - -/* - * alt_dcache_flush() is called to flush the data cache for a memory - * region of length "len" bytes, starting at address "start". - * - * Any dirty lines in the data cache are written back to memory. - */ - -void alt_dcache_flush (void* start, alt_u32 len) -{ -#if NIOS2_DCACHE_SIZE > 0 - - char* i; - char* end; - - /* - * This is the most we would ever need to flush. - * - * SPR 196942, 2006.01.13: The cache flush loop below will use the - * 'flushda' instruction if its available; in that case each line - * must be flushed individually, and thus 'len' cannot be trimmed. - */ - #ifndef NIOS2_FLUSHDA_SUPPORTED - if (len > NIOS2_DCACHE_SIZE) - { - len = NIOS2_DCACHE_SIZE; - } - #endif - - end = ((char*) start) + len; - - for (i = start; i < end; i+= NIOS2_DCACHE_LINE_SIZE) - { - ALT_FLUSH_DATA(i); - } - - /* - * For an unaligned flush request, we've got one more line left. - * Note that this is dependent on NIOS2_DCACHE_LINE_SIZE to be a - * multiple of 2 (which it always is). - */ - - if (((alt_u32) start) & (NIOS2_DCACHE_LINE_SIZE - 1)) - { - ALT_FLUSH_DATA(i); - } - -#endif /* NIOS2_DCACHE_SIZE > 0 */ -} diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_dcache_flush_all.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_dcache_flush_all.c deleted file mode 100644 index 6529231..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_dcache_flush_all.c +++ /dev/null @@ -1,51 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "nios2.h" -#include "system.h" - -#include "alt_types.h" -#include "sys/alt_cache.h" - -/* - * alt_dcache_flush_all() is called to flush the entire data cache. - */ - -void alt_dcache_flush_all (void) -{ -#if NIOS2_DCACHE_SIZE > 0 - char* i; - - for (i = (char*) 0; i < (char*) NIOS2_DCACHE_SIZE; i+= NIOS2_DCACHE_LINE_SIZE) - { - __asm__ volatile ("flushd (%0)" :: "r" (i)); - } -#endif /* NIOS2_DCACHE_SIZE > 0 */ -} diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_dcache_flush_no_writeback.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_dcache_flush_no_writeback.c deleted file mode 100644 index c65ca7d..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_dcache_flush_no_writeback.c +++ /dev/null @@ -1,88 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "nios2.h" -#include "system.h" - -#include "alt_types.h" -#include "sys/alt_cache.h" - -/* - * The INITDA instruction was added to Nios II in the 8.0 release. - * - * The INITDA instruction has one of the following possible behaviors - * depending on the processor configuration: - * 1) Flushes a line by address but does NOT write back dirty data. - * Occurs when a data cache is present that supports INITDA. - * The macro NIOS2_INITDA_SUPPORTED is defined in system.h. - * 2) Takes an unimplemented instruction exception. - * Occurs when a data cache is present that doesn't support INITDA. - * 3) Performs no operation - * Occurs when there is no data cache present. - * The macro NIOS2_DCACHE_SIZE is 0 in system.h. - */ - -#define ALT_FLUSH_DATA_NO_WRITEBACK(i) \ - __asm__ volatile ("initda (%0)" :: "r" (i)); - -/* - * alt_dcache_flush_no_writeback() is called to flush the data cache for a - * memory region of length "len" bytes, starting at address "start". - * - * Any dirty lines in the data cache are NOT written back to memory. - * Make sure you really want this behavior. If you aren't 100% sure, - * use the alt_dcache_flush() routine instead. - */ - -void alt_dcache_flush_no_writeback (void* start, alt_u32 len) -{ -#if defined(NIOS2_INITDA_SUPPORTED) - - char* i; - char* end = ((char*) start) + len; - - for (i = start; i < end; i+= NIOS2_DCACHE_LINE_SIZE) - { - ALT_FLUSH_DATA_NO_WRITEBACK(i); - } - - /* - * For an unaligned flush request, we've got one more line left. - * Note that this is dependent on NIOS2_DCACHE_LINE_SIZE to be a - * multiple of 2 (which it always is). - */ - - if (((alt_u32) start) & (NIOS2_DCACHE_LINE_SIZE - 1)) - { - ALT_FLUSH_DATA_NO_WRITEBACK(i); - } - -#endif /* NIOS2_INITDA_SUPPORTED */ -} diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_dev.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_dev.c deleted file mode 100644 index ebc15e5..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_dev.c +++ /dev/null @@ -1,149 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include -#include -#include - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - -#include "alt_types.h" - -#include "system.h" - -/* - * This file contains the data constructs used to control access to device and - * filesytems. - */ - -/* - * "alt_fs_list" is the head of a linked list of registered filesystems. It is - * initialised as an empty list. New entries can be added using the - * alt_fs_reg() function. - */ - -ALT_LLIST_HEAD(alt_fs_list); - - -/* - * "alt_dev_list" is the head of a linked list of registered devices. It is - * configured at startup to include a single device, "alt_dev_null". This - * device is discussed below. - */ - -extern alt_dev alt_dev_null; /* forward declaration */ - -alt_llist alt_dev_list = {&alt_dev_null.llist, &alt_dev_null.llist}; - -/* - * alt_dev_null_write() is the implementation of the write() function used - * by the alt_dev_null device. It simple discards all data passed to it, and - * indicates that the data has been successfully transmitted. - */ - -static int alt_dev_null_write (alt_fd* fd, const char* ptr, int len) -{ - return len; -} - -/* - * "alt_dev_null" is used to allow output to be redirected to nowhere. It is - * the only device registered before the call to alt_sys_init(). At startup - * stin, stdout & stderr are all directed towards this device so that library - * calls like printf() will be safe but inefectual. - */ - -alt_dev alt_dev_null = { - { - &alt_dev_list, - &alt_dev_list - }, - "/dev/null", - NULL, /* open */ - NULL, /* close */ - NULL, /* write */ - alt_dev_null_write, /* write */ - NULL, /* lseek */ - NULL, /* fstat */ - NULL /* ioctl */ - }; - -/* - * "alt_fd_list_lock" is a semaphore used to control access to the file - * descriptor list. This is used to ensure that access to the list is thread - * safe. - */ - -ALT_SEM(alt_fd_list_lock) - -/* - * "alt_max_fd" is used to make access to the file descriptor list more - * efficent. It is set to be the value of the highest allocated file - * descriptor. This saves having to search the entire pool of unallocated - * file descriptors when looking for a match. - */ - -alt_32 alt_max_fd = -1; - -/* - * "alt_fd_list" is the file descriptor pool. The first three entries in the - * array are configured as standard in, standard out, and standard error. These - * are all initialised so that accesses are directed to the alt_dev_null - * device. The remaining file descriptors are initialised as unallocated. - * - * The maximum number of file descriptors within the system is specified by the - * user defined macro "ALT_MAX_FD". This is defined in "system.h", which is - * auto-genereated using the projects PTF and STF files. - */ - -alt_fd alt_fd_list[ALT_MAX_FD] = - { - { - &alt_dev_null, /* standard in */ - 0, - 0 - }, - { - &alt_dev_null, /* standard out */ - 0, - 0 - }, - { - &alt_dev_null, /* standard error */ - 0, - 0 - } - /* all other elements are set to zero */ - }; diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_dev_llist_insert.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_dev_llist_insert.c deleted file mode 100644 index fa7239d..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_dev_llist_insert.c +++ /dev/null @@ -1,59 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "priv/alt_dev_llist.h" -#include "sys/alt_errno.h" - -/* - * - */ - -int alt_dev_llist_insert (alt_dev_llist* dev, alt_llist* list) -{ - /* - * check that the device exists, and that it has a valid name. - */ - - if (!dev || !dev->name) - { - ALT_ERRNO = EINVAL; - return -EINVAL; - } - - /* - * register the device. - */ - - alt_llist_insert(list, &dev->llist); - - return 0; -} diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_dma_rxchan_open.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_dma_rxchan_open.c deleted file mode 100644 index 6ea3b78..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_dma_rxchan_open.c +++ /dev/null @@ -1,63 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_dma.h" -#include "sys/alt_errno.h" -#include "priv/alt_file.h" - -/* - * The list of registered DMA receive channels. - */ - -ALT_LLIST_HEAD(alt_dma_rxchan_list); - -/* - * alt_dma_txchan_open() is used to obtain an "alt_dma_txchan" descriptor for - * a DMA transmit device. The name is the name of the associated physical - * device (e.g. "/dev/dma_0"). - * - * The return value will be NULL on failure, and non-NULL otherwise. - */ - -alt_dma_rxchan alt_dma_rxchan_open (const char* name) -{ - alt_dma_rxchan dev; - - dev = (alt_dma_rxchan) alt_find_dev (name, &alt_dma_rxchan_list); - - if (!dev) - { - ALT_ERRNO = ENODEV; - } - - return dev; -} diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_dma_txchan_open.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_dma_txchan_open.c deleted file mode 100644 index f41fa81..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_dma_txchan_open.c +++ /dev/null @@ -1,63 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_dma.h" -#include "sys/alt_errno.h" -#include "priv/alt_file.h" - -/* - * The list of registered receive channels. - */ - -ALT_LLIST_HEAD(alt_dma_txchan_list); - -/* - * alt_dma_txchan_open() is used to obtain an "alt_dma_txchan" descriptor for - * a DMA transmit device. The name is the name of the associated physical - * device (e.g. "/dev/dma_0"). - * - * The return value will be NULL on failure, and non-NULL otherwise. - */ - -alt_dma_txchan alt_dma_txchan_open (const char* name) -{ - alt_dma_txchan dev; - - dev = (alt_dma_txchan) alt_find_dev (name, &alt_dma_txchan_list); - - if (!dev) - { - ALT_ERRNO = ENODEV; - } - - return dev; -} diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_do_ctors.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_do_ctors.c deleted file mode 100644 index ff5a1f7..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_do_ctors.c +++ /dev/null @@ -1,64 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT IT DIRECTLY. * -* * -* Overriding HAL Functions * -* * -* To provide your own implementation of a HAL function, include the file in * -* your Nios II IDE application project. When building the executable, the * -* Nios II IDE finds your function first, and uses it in place of the HAL * -* version. * -* * -******************************************************************************/ - -/* - * - */ - -typedef void (*constructor) (void); -extern constructor __CTOR_LIST__[]; -extern constructor __CTOR_END__[]; - -/* - * Run the C++ static constructors. - */ - -void _do_ctors(void) -{ - constructor* ctor; - - for (ctor = &__CTOR_END__[-1]; ctor >= __CTOR_LIST__; ctor--) - (*ctor) (); -} diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_do_dtors.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_do_dtors.c deleted file mode 100644 index 565c99f..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_do_dtors.c +++ /dev/null @@ -1,64 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT IT DIRECTLY. * -* * -* Overriding HAL Functions * -* * -* To provide your own implementation of a HAL function, include the file in * -* your Nios II IDE application project. When building the executable, the * -* Nios II IDE finds your function first, and uses it in place of the HAL * -* version. * -* * -******************************************************************************/ - -/* - * - */ - -typedef void (*destructor) (void); -extern destructor __DTOR_LIST__[]; -extern destructor __DTOR_END__[]; - -/* - * Run the C++ static destructors. - */ - -void _do_dtors(void) -{ - destructor* dtor; - - for (dtor = &__DTOR_END__[-1]; dtor >= __DTOR_LIST__; dtor--) - (*dtor) (); -} diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_env_lock.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_env_lock.c deleted file mode 100644 index fc25a0c..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_env_lock.c +++ /dev/null @@ -1,53 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -/* - * These are the empty env lock/unlock stubs required by newlib. These are - * used to make accesses to environment variables thread safe. The default HAL - * configuration is single threaded, so there is nothing to do here. Note that - * this requires that environment variables are never manipulated by an interrupt - * service routine. - */ - -void __env_lock ( struct _reent *_r ) -{ -} - -/* - * - */ - -void __env_unlock ( struct _reent *_r ) -{ -} diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_environ.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_environ.c deleted file mode 100644 index 404efc4..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_environ.c +++ /dev/null @@ -1,42 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "os/alt_syscall.h" - -/* - * These are the environment variables passed to the C code. By default there - * are no variables registered. An application can manipulate this list using - * getenv() and setenv(). - */ - -char *__env[1] = { 0 }; -char **ALT_ENVIRON = __env; diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_errno.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_errno.c deleted file mode 100644 index 1d8368d..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_errno.c +++ /dev/null @@ -1,44 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/* - * This file defines the alt_errno global variable. See comments in - * alt_errno.h for the use of this variable. - */ - - -#include "sys/alt_errno.h" -#include "alt_types.h" - -extern int ALT_WEAK *__errno (void); - -int* (*alt_errno) (void) = __errno; diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_exception_entry.S b/software/qsys_tutorial_green_bsp/HAL/src/alt_exception_entry.S deleted file mode 100644 index 3afab93..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_exception_entry.S +++ /dev/null @@ -1,360 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2008 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "system.h" - -/* - * This is the exception entry point code, which saves all the caller saved - * registers and then handles the appropriate exception. It should be pulled - * in using a .globl from all the exception handler routines. This scheme is - * used so that if an interrupt is never registered, then this code will not - * appear in the generated executable, thereby improving code footprint. - * - * If an external interrpt controller (EIC) is present, it will supply an - * interrupt vector address to the processor when an interrupt occurs. For - * The Altera Vectored Interrupt Controller (VIC) driver will establish a - * vector table and the processor will jump directly to the appropriate - * table entry, funnel routine, and then user ISR. This will bypass this code - * in entirety. This code might still be linked into a system with an EIC, - * but would then be used only for non-interrupt exceptions. - */ - - /* - * Explicitly allow the use of r1 (the assembler temporary register) - * within this code. This register is normally reserved for the use of - * the assembler. - */ - .set noat - - /* - * The top and bottom of the exception stack - */ -#ifdef ALT_EXCEPTION_STACK - - .globl __alt_exception_stack_pointer - -#ifdef ALT_STACK_CHECK - - .globl __alt_exception_stack_limit - - /* - * We need to store the value of the stack limit after interrupt somewhere. - */ - .globl alt_exception_old_stack_limit - -#endif -#endif - - .section .exceptions.entry.label, "xa" - - .globl alt_exception - .type alt_exception, @function -alt_exception: - - .section .exceptions.entry, "xa" - -#ifdef ALT_EXCEPTION_STACK - -#ifdef ALT_STACK_CHECK - stw et, %gprel(alt_exception_old_stack_limit)(gp) -#endif - - movhi et, %hiadj(__alt_exception_stack_pointer - 80) - addi et, et, %lo(__alt_exception_stack_pointer - 80) - stw sp, 76(et) - mov sp, et - -#ifdef ALT_STACK_CHECK - movhi et, %hiadj(__alt_exception_stack_limit) - addi et, et, %lo(__alt_exception_stack_limit) - stw et, %gprel(alt_stack_limit_value)(gp) -#endif - -#else - /* - * Process an exception. For all exceptions we must preserve all - * caller saved registers on the stack (See the Nios2 ABI - * documentation for details). - */ - - addi sp, sp, -76 - -#ifdef ALT_STACK_CHECK - - bltu sp, et, .Lstack_overflow - -#endif - -#endif - - stw ra, 0(sp) - - /* - * Leave a gap in the stack frame at 4(sp) for the muldiv handler to - * store zero into. - */ - - stw r1, 8(sp) - stw r2, 12(sp) - stw r3, 16(sp) - stw r4, 20(sp) - stw r5, 24(sp) - stw r6, 28(sp) - stw r7, 32(sp) - - rdctl r5, estatus - - stw r8, 36(sp) - stw r9, 40(sp) - stw r10, 44(sp) - stw r11, 48(sp) - stw r12, 52(sp) - stw r13, 56(sp) - stw r14, 60(sp) - stw r15, 64(sp) - - /* - * ea-4 contains the address of the instruction being executed - * when the exception occured. For interrupt exceptions, we will - * will be re-issue the isntruction. Store it in 72(sp) - */ - stw r5, 68(sp) /* estatus */ - addi r15, ea, -4 /* instruction that caused exception */ - stw r15, 72(sp) - - /* - * The interrupt testing code (.exceptions.irqtest) will be - * linked here. If the Internal Interrupt Controller (IIC) is - * present (an EIC is not present), the presense of an interrupt - * is determined by examining CPU control registers or an interrupt - * custom instruction, if present. - * - * If the IIC is used and an interrupt is active, the code linked - * here will call the HAL IRQ handler (alt_irq_handler()) which - * successively calls registered interrupt handler(s) until no - * interrupts remain pending. It then jumps to .exceptions.exit. If - * there is no interrupt then it continues to .exception.notirq, below. - */ - - .section .exceptions.notirq, "xa" - - /* - * Prepare to service unimplemtned instructions or traps, - * each of which is optionally inked into section .exceptions.soft, - * which will preceed .exceptions.unknown below. - * - * Unlike interrupts, we want to skip the exception-causing instructon - * upon completion, so we write ea (address of instruction *after* - * the one where the exception occured) into 72(sp). The actual - * instruction that caused the exception is written in r2, which these - * handlers will utilize. - */ - stw ea, 72(sp) /* Don't re-issue */ - ldw r2, -4(ea) /* Instruction that caused exception */ - - /* - * Other exception handling code, if enabled, will be linked here. - * This includes unimplemted (multiply/divide) instruction support - * (a BSP generaton option), and a trap handler (that would typically - * be augmented with user-specific code). These are not linked in by - * default. - */ - - /* - * In the context of linker sections, "unknown" are all exceptions - * not handled by the built-in handlers above (interupt, and trap or - * unimplemented instruction decoding, if enabled). - * - * Advanced exception types can be serviced by registering a handler. - * To do so, enable the "Enable Instruction-related Exception API" HAL - * BSP setting. If this setting is disabled, this handler code will - * either break (if the debug core is present) or enter an infinite - * loop because we don't how how to handle the exception. - */ - .section .exceptions.unknown -#ifdef ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API - /* - * The C-based HAL routine alt_instruction_exception_entry() will - * attempt to service the exception by calling a user-registered - * exception handler using alt_instruction_exception_register(). - * If no handler was registered it will either break (if the - * debugger is present) or go into an infinite loop since the - * handling behavior is undefined; in that case we will not return here. - */ - - /* Load exception-causing address as first argument (r4) */ - addi r4, ea, -4 - - /* Call the instruction-exception entry */ - call alt_instruction_exception_entry - - /* - * If alt_instruction_exception_entry() returned, the exception was - * serviced by a user-registered routine. Its return code (now in r2) - * indicates whether to re-issue or skip the exception-causing - * instruction - * - * Return code was 0: Skip. The instruction after the exception is - * already stored in 72(sp). - */ - bne r2, r0, .Lexception_exit - - /* - * Otherwise, modify 72(sp) to re-issue the instruction that caused the - * exception. - */ - addi r15, ea, -4 /* instruction that caused exception */ - stw r15, 72(sp) - -#else /* ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API disabled */ - - /* - * We got here because an instruction-related exception occured, but the - * handler API was not compiled in. We do not presume to know how to - * handle it. If the debugger is present, break, otherwise hang. - * - * If you get here then one of the following could have happened: - * - * - An instruction-generated exception occured, and the processor - * does not have the extra exceptions feature enabled, or you - * have not registered a handler using - * alt_instruction_exception_register() - * - * Some examples of instruction-generated exceptions and why they - * might occur: - * - * - Your program could have been compiled for a full-featured - * Nios II core, but it is running on a smaller core, and - * instruction emulation has been disabled by defining - * ALT_NO_INSTRUCTION_EMULATION. - * - * You can work around the problem by re-enabling instruction - * emulation, or you can figure out why your program is being - * compiled for a system other than the one that it is running on. - * - * - Your program has executed a trap instruction, but has not - * implemented a handler for this instruction. - * - * - Your program has executed an illegal instruction (one which is - * not defined in the instruction set). - * - * - Your processor includes an MMU or MPU, and you have enabled it - * before registering an exception handler to service exceptions it - * generates. - * - * The problem could also be hardware related: - * - If your hardware is broken and is generating spurious interrupts - * (a peripheral which negates its interrupt output before its - * interrupt handler has been executed will cause spurious - * interrupts) - */ -#ifdef NIOS2_HAS_DEBUG_STUB - /* - * Either tell the user now (if there is a debugger attached) or go into - * the debug monitor which will loop until a debugger is attached. - */ - break -#else - /* - * If there is no debug stub then a BREAK will probably cause a reboot. - * An infinate loop will probably be more useful. - */ -0: - br 0b -#endif /* NIOS2_HAS_DEBUG_STUB */ - -#endif /* ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API */ - - .section .exceptions.exit.label -.Lexception_exit: - - .section .exceptions.exit, "xa" - - /* - * Restore the saved registers, so that all general purpose registers - * have been restored to their state at the time the interrupt occured. - */ - - ldw r5, 68(sp) - ldw ea, 72(sp) /* This becomes the PC once eret is executed */ - ldw ra, 0(sp) - - wrctl estatus, r5 - - ldw r1, 8(sp) - ldw r2, 12(sp) - ldw r3, 16(sp) - ldw r4, 20(sp) - ldw r5, 24(sp) - ldw r6, 28(sp) - ldw r7, 32(sp) - -#ifdef ALT_EXCEPTION_STACK -#ifdef ALT_STACK_CHECK - ldw et, %gprel(alt_exception_old_stack_limit)(gp) -#endif -#endif - - ldw r8, 36(sp) - ldw r9, 40(sp) - ldw r10, 44(sp) - ldw r11, 48(sp) - ldw r12, 52(sp) - ldw r13, 56(sp) - ldw r14, 60(sp) - ldw r15, 64(sp) - -#ifdef ALT_EXCEPTION_STACK - -#ifdef ALT_STACK_CHECK - stw et, %gprel(alt_stack_limit_value)(gp) - stw zero, %gprel(alt_exception_old_stack_limit)(gp) -#endif - - ldw sp, 76(sp) - -#else - addi sp, sp, 76 - -#endif - - /* - * Return to the interrupted instruction. - */ - - eret - -#ifdef ALT_STACK_CHECK - -.Lstack_overflow: - break 3 - -#endif - diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_exception_muldiv.S b/software/qsys_tutorial_green_bsp/HAL/src/alt_exception_muldiv.S deleted file mode 100644 index 55617a6..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_exception_muldiv.S +++ /dev/null @@ -1,583 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - - /* - * This is the software multiply/divide handler for Nios2. - */ - - /* - * Provide a label which can be used to pull this file in. - */ - - .section .exceptions.start - .globl alt_exception_muldiv -alt_exception_muldiv: - - /* - * Pull in the entry/exit code. - */ - .globl alt_exception - - - .section .exceptions.soft, "xa" - - - /* INSTRUCTION EMULATION - * --------------------- - * - * Nios II processors generate exceptions for unimplemented instructions. - * The routines below emulate these instructions. Depending on the - * processor core, the only instructions that might need to be emulated - * are div, divu, mul, muli, mulxss, mulxsu, and mulxuu. - * - * The emulations match the instructions, except for the following - * limitations: - * - * 1) The emulation routines do not emulate the use of the exception - * temporary register (et) as a source operand because the exception - * handler already has modified it. - * - * 2) The routines do not emulate the use of the stack pointer (sp) or the - * exception return address register (ea) as a destination because - * modifying these registers crashes the exception handler or the - * interrupted routine. - * - * 3) To save code size, the routines do not emulate the use of the - * breakpoint registers (ba and bt) as operands. - * - * Detailed Design - * --------------- - * - * The emulation routines expect the contents of integer registers r0-r31 - * to be on the stack at addresses sp, 4(sp), 8(sp), ... 124(sp). The - * routines retrieve source operands from the stack and modify the - * destination register's value on the stack prior to the end of the - * exception handler. Then all registers except the destination register - * are restored to their previous values. - * - * The instruction that causes the exception is found at address -4(ea). - * The instruction's OP and OPX fields identify the operation to be - * performed. - * - * One instruction, muli, is an I-type instruction that is identified by - * an OP field of 0x24. - * - * muli AAAAA,BBBBB,IIIIIIIIIIIIIIII,-0x24- - * 27 22 6 0 <-- LSB of field - * - * The remaining emulated instructions are R-type and have an OP field - * of 0x3a. Their OPX fields identify them. - * - * R-type AAAAA,BBBBB,CCCCC,XXXXXX,NNNNN,-0x3a- - * 27 22 17 11 6 0 <-- LSB of field - * - * - */ - - - /* - * Split the instruction into its fields. We need 4*A, 4*B, and 4*C as - * offsets to the stack pointer for access to the stored register values. - */ - /* r2 = AAAAA,BBBBB,IIIIIIIIIIIIIIII,PPPPPP */ - roli r3, r2, 7 /* r3 = BBB,IIIIIIIIIIIIIIII,PPPPPP,AAAAA,BB */ - roli r4, r3, 3 /* r4 = IIIIIIIIIIIIIIII,PPPPPP,AAAAA,BBBBB */ - roli r6, r4, 2 /* r6 = IIIIIIIIIIIIII,PPPPPP,AAAAA,BBBBB,II */ - srai r4, r4, 16 /* r4 = (sign-extended) IMM16 */ - xori r6, r6, 0x42 /* r6 = CCC,XXXXXX,NNNNN,PPPPPP,AAAAA,bBBBB,cC */ - roli r7, r6, 5 /* r7 = XXXX,NNNNN,PPPPPP,AAAAA,bBBBB,cCCCC,XX */ - andi r5, r2, 0x3f /* r5 = 00000000000000000000000000,PPPPPP */ - xori r3, r3, 0x40 - andi r3, r3, 0x7c /* r3 = 0000000000000000000000000,aAAAA,00 */ - andi r6, r6, 0x7c /* r6 = 0000000000000000000000000,bBBBB,00 */ - andi r7, r7, 0x7c /* r7 = 0000000000000000000000000,cCCCC,00 */ - - /* Now either - * r5 = OP - * r3 = 4*(A^16) - * r4 = IMM16 (sign extended) - * r6 = 4*(B^16) - * r7 = 4*(C^16) - * or - * r5 = OP - */ - - - /* - * Save everything on the stack to make it easy for the emulation routines - * to retrieve the source register operands. The exception entry code has - * already saved some of this so we don't need to do it all again. - */ - - addi sp, sp, -60 - stw zero, 64(sp) /* Save zero on stack to avoid special case for r0. */ - /* Register at and r2-r15 have already been saved. */ - - stw r16, 0(sp) - stw r17, 4(sp) - stw r18, 8(sp) - stw r19, 12(sp) - stw r20, 16(sp) - stw r21, 20(sp) - stw r22, 24(sp) - stw r23, 28(sp) - /* et @ 32 - Has already been changed.*/ - /* bt @ 36 - Usually isn't an operand. */ - stw gp, 40(sp) - stw sp, 44(sp) - stw fp, 48(sp) - /* ea @ 52 - Don't bother to save - it's already been changed */ - /* ba @ 56 - Breakpoint register usually isn't an operand */ - /* ra @ 60 - Has already been saved */ - - - /* - * Prepare for either multiplication or division loop. - * They both loop 32 times. - */ - movi r14, 32 - - - /* - * Get the operands. - * - * It is necessary to check for muli because it uses an I-type instruction - * format, while the other instructions are have an R-type format. - */ - add r3, r3, sp /* r3 = address of A-operand. */ - ldw r3, 0(r3) /* r3 = A-operand. */ - movi r15, 0x24 /* muli opcode (I-type instruction format) */ - beq r5, r15, .Lmul_immed /* muli doesn't use the B register as a source */ - - add r6, r6, sp /* r6 = address of B-operand. */ - ldw r6, 0(r6) /* r6 = B-operand. */ - /* r4 = SSSSSSSSSSSSSSSS,-----IMM16------ */ - /* IMM16 not needed, align OPX portion */ - /* r4 = SSSSSSSSSSSSSSSS,CCCCC,-OPX--,00000 */ - srli r4, r4, 5 /* r4 = 00000,SSSSSSSSSSSSSSSS,CCCCC,-OPX-- */ - andi r4, r4, 0x3f /* r4 = 00000000000000000000000000,-OPX-- */ - - /* Now - * r5 = OP - * r3 = src1 - * r6 = src2 - * r4 = OPX (no longer can be muli) - * r7 = 4*(C^16) - * r14 = loop counter - */ - - /* ILLEGAL-INSTRUCTION EXCEPTION - * ----------------------------- - * - * This code is for Nios II cores that generate exceptions when attempting - * to execute illegal instructions. Nios II cores that support an - * illegal-instruction exception are identified by the presence of the - * macro definition NIOS2_HAS_ILLEGAL_INSTRUCTION_EXCEPTION in system.h . - * - * Remember that illegal instructions are different than unimplemented - * instructions. Illegal instructions are instruction encodings that - * have not been defined by the Nios II ISA. Unimplemented instructions - * are legal instructions that must be emulated by some Nios II cores. - * - * If we get here, all instructions except multiplies and divides - * are illegal. - * - * This code assumes that OP is not muli (because muli was tested above). - * All other multiplies and divides are legal. Anything else is illegal. - */ - - movi r8, 0x3a /* OP for R-type mul* and div* */ - bne r5, r8, .Lnot_muldiv - - /* r15 already is 0x24 */ /* OPX of divu */ - beq r4, r15, .Ldivide - - movi r15,0x27 /* OPX of mul */ - beq r4, r15, .Lmultiply - - movi r15,0x07 /* OPX of mulxuu */ - beq r4, r15, .Lmultiply - - movi r15,0x17 /* OPX of mulxsu */ - beq r4, r15, .Lmultiply - - movi r15,0x1f /* OPX of mulxss */ - beq r4, r15, .Lmultiply - - movi r15,0x25 /* OPX of div */ - bne r4, r15, .Lnot_muldiv - - - /* DIVISION - * - * Divide an unsigned dividend by an unsigned divisor using - * a shift-and-subtract algorithm. The example below shows - * 43 div 7 = 6 for 8-bit integers. This classic algorithm uses a - * single register to store both the dividend and the quotient, - * allowing both values to be shifted with a single instruction. - * - * remainder dividend:quotient - * --------- ----------------- - * initialize 00000000 00101011: - * shift 00000000 0101011:_ - * remainder >= divisor? no 00000000 0101011:0 - * shift 00000000 101011:0_ - * remainder >= divisor? no 00000000 101011:00 - * shift 00000001 01011:00_ - * remainder >= divisor? no 00000001 01011:000 - * shift 00000010 1011:000_ - * remainder >= divisor? no 00000010 1011:0000 - * shift 00000101 011:0000_ - * remainder >= divisor? no 00000101 011:00000 - * shift 00001010 11:00000_ - * remainder >= divisor? yes 00001010 11:000001 - * remainder -= divisor - 00000111 - * ---------- - * 00000011 11:000001 - * shift 00000111 1:000001_ - * remainder >= divisor? yes 00000111 1:0000011 - * remainder -= divisor - 00000111 - * ---------- - * 00000000 1:0000011 - * shift 00000001 :0000011_ - * remainder >= divisor? no 00000001 :00000110 - * - * The quotient is 00000110. - */ - -.Ldivide: - /* - * Prepare for division by assuming the result - * is unsigned, and storing its "sign" as 0. - */ - movi r17, 0 - - - /* Which division opcode? */ - xori r15, r4, 0x25 /* OPX of div */ - bne r15, zero, .Lunsigned_division - - - /* - * OPX is div. Determine and store the sign of the quotient. - * Then take the absolute value of both operands. - */ - xor r17, r3, r6 /* MSB contains sign of quotient */ - bge r3, zero, 0f - sub r3, zero, r3 /* -r3 */ -0: - bge r6, zero, 0f - sub r6, zero, r6 /* -r6 */ -0: - - -.Lunsigned_division: - /* Initialize the unsigned-division loop. */ - movi r13, 0 /* remainder = 0 */ - - /* Now - * r3 = dividend : quotient - * r4 = 0x25 for div, 0x24 for divu - * r6 = divisor - * r13 = remainder - * r14 = loop counter (already initialized to 32) - * r17 = MSB contains sign of quotient - */ - - - /* - * for (count = 32; count > 0; --count) - * { - */ -.Ldivide_loop: - - /* - * Division: - * - * (remainder:dividend:quotient) <<= 1; - */ - slli r13, r13, 1 - cmplt r15, r3, zero /* r15 = MSB of r3 */ - or r13, r13, r15 - slli r3, r3, 1 - - - /* - * if (remainder >= divisor) - * { - * set LSB of quotient - * remainder -= divisor; - * } - */ - bltu r13, r6, .Ldiv_skip - ori r3, r3, 1 - sub r13, r13, r6 -.Ldiv_skip: - - /* - * } - */ - subi r14, r14, 1 - bne r14, zero, .Ldivide_loop - - mov r9, r3 - - - /* Now - * r9 = quotient - * r4 = 0x25 for div, 0x24 for divu - * r7 = 4*(C^16) - * r17 = MSB contains sign of quotient - */ - - - /* - * Conditionally negate signed quotient. If quotient is unsigned, - * the sign already is initialized to 0. - */ - bge r17, zero, .Lstore_result - sub r9, zero, r9 /* -r9 */ - - br .Lstore_result - - - - - /* MULTIPLICATION - * - * A "product" is the number that one gets by summing a "multiplicand" - * several times. The "multiplier" specifies the number of copies of the - * multiplicand that are summed. - * - * Actual multiplication algorithms don't use repeated addition, however. - * Shift-and-add algorithms get the same answer as repeated addition, and - * they are faster. To compute the lower half of a product (pppp below) - * one shifts the product left before adding in each of the partial products - * (a * mmmm) through (d * mmmm). - * - * To compute the upper half of a product (PPPP below), one adds in the - * partial products (d * mmmm) through (a * mmmm), each time following the - * add by a right shift of the product. - * - * mmmm - * * abcd - * ------ - * #### = d * mmmm - * #### = c * mmmm - * #### = b * mmmm - * #### = a * mmmm - * -------- - * PPPPpppp - * - * The example above shows 4 partial products. Computing actual Nios II - * products requires 32 partials. - * - * It is possible to compute the result of mulxsu from the result of mulxuu - * because the only difference between the results of these two opcodes is - * the value of the partial product associated with the sign bit of rA. - * - * mulxsu = mulxuu - ((rA < 0) ? rB : 0); - * - * It is possible to compute the result of mulxss from the result of mulxsu - * because the only difference between the results of these two opcodes is - * the value of the partial product associated with the sign bit of rB. - * - * mulxss = mulxsu - ((rB < 0) ? rA : 0); - * - */ - -.Lmul_immed: - /* Opcode is muli. Change it into mul for remainder of algorithm. */ - mov r7, r6 /* Field B is dest register, not field C. */ - mov r6, r4 /* Field IMM16 is src2, not field B. */ - movi r4, 0x27 /* OPX of mul is 0x27 */ - -.Lmultiply: - /* Initialize the multiplication loop. */ - movi r9, 0 /* mul_product = 0 */ - movi r10, 0 /* mulxuu_product = 0 */ - mov r11, r6 /* save original multiplier for mulxsu and mulxss */ - mov r12, r6 /* mulxuu_multiplier (will be shifted) */ - movi r16, 1 /* used to create "rori B,A,1" from "ror B,A,r16" */ - - /* Now - * r3 = multiplicand - * r6 = mul_multiplier - * r7 = 4 * dest_register (used later as offset to sp) - * r9 = mul_product - * r10 = mulxuu_product - * r11 = original multiplier - * r12 = mulxuu_multiplier - * r14 = loop counter (already initialized) - * r15 = temp - * r16 = 1 - */ - - - /* - * for (count = 32; count > 0; --count) - * { - */ -.Lmultiply_loop: - - /* - * mul_product <<= 1; - * lsb = multiplier & 1; - */ - slli r9, r9, 1 - andi r15, r12, 1 - - /* - * if (lsb == 1) - * { - * mulxuu_product += multiplicand; - * } - */ - beq r15, zero, .Lmulx_skip - add r10, r10, r3 - cmpltu r15, r10, r3 /* Save the carry from the MSB of mulxuu_product. */ - ror r15, r15, r16 /* r15 = 0x80000000 on carry, or else 0x00000000 */ -.Lmulx_skip: - - /* - * if (MSB of mul_multiplier == 1) - * { - * mul_product += multiplicand; - * } - */ - bge r6, zero, .Lmul_skip - add r9, r9, r3 -.Lmul_skip: - - /* - * mulxuu_product >>= 1; logical shift - * mul_multiplier <<= 1; done with MSB - * mulx_multiplier >>= 1; done with LSB - */ - srli r10, r10, 1 - or r10, r10, r15 /* OR in the saved carry bit. */ - slli r6, r6, 1 - srli r12, r12, 1 - - - /* - * } - */ - subi r14, r14, 1 - bne r14, zero, .Lmultiply_loop - - - /* - * Multiply emulation loop done. - */ - - /* Now - * r3 = multiplicand - * r4 = OPX - * r7 = 4 * dest_register (used later as offset to sp) - * r9 = mul_product - * r10 = mulxuu_product - * r11 = original multiplier - * r15 = temp - */ - - - /* - * Select/compute the result based on OPX. - */ - - - /* OPX == mul? Then store. */ - xori r15, r4, 0x27 - beq r15, zero, .Lstore_result - - /* It's one of the mulx.. opcodes. Move over the result. */ - mov r9, r10 - - /* OPX == mulxuu? Then store. */ - xori r15, r4, 0x07 - beq r15, zero, .Lstore_result - - /* Compute mulxsu - * - * mulxsu = mulxuu - ((rA < 0) ? rB : 0); - */ - bge r3, zero, .Lmulxsu_skip - sub r9, r9, r11 -.Lmulxsu_skip: - - /* OPX == mulxsu? Then store. */ - xori r15, r4, 0x17 - beq r15, zero, .Lstore_result - - /* Compute mulxss - * - * mulxss = mulxsu - ((rB < 0) ? rA : 0); - */ - bge r11, zero, .Lmulxss_skip - sub r9, r9, r3 -.Lmulxss_skip: - /* At this point, assume that OPX is mulxss, so store */ - - -.Lstore_result: - add r7, r7, sp - stw r9, 0(r7) - - ldw r16, 0(sp) - ldw r17, 4(sp) - ldw r18, 8(sp) - ldw r19, 12(sp) - ldw r20, 16(sp) - ldw r21, 20(sp) - ldw r22, 24(sp) - ldw r23, 28(sp) - - /* bt @ 32 - Breakpoint register usually isn't an operand. */ - /* et @ 36 - Don't corrupt et. */ - /* gp @ 40 - Don't corrupt gp. */ - /* sp @ 44 - Don't corrupt sp. */ - ldw fp, 48(sp) - /* ea @ 52 - Don't corrupt ea. */ - /* ba @ 56 - Breakpoint register usually isn't an operand. */ - - addi sp, sp, 60 - - br .Lexception_exit - - -.Lnot_muldiv: - - addi sp, sp, 60 - - - .section .exceptions.exit.label -.Lexception_exit: - diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_exception_trap.S b/software/qsys_tutorial_green_bsp/HAL/src/alt_exception_trap.S deleted file mode 100644 index 60a3d40..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_exception_trap.S +++ /dev/null @@ -1,81 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - - /* - * This is the trap exception handler for Nios2. - */ - - /* - * Provide a label which can be used to pull this file in. - */ - - .section .exceptions.start - .globl alt_exception_trap -alt_exception_trap: - - /* - * Pull in the entry/exit code. - */ - .globl alt_exception - - .section .exceptions.soft, "xa" - -.Ltrap_handler: - - /* - * Did a trap instruction cause the exception? - * - * The instruction which the exception occurred on has been loaded - * into r2 by code in alt_exception_entry.S - * - */ - - movhi r3,0x003b /* upper half of trap opcode */ - ori r3,r3,0x683a /* lower half of trap opcode */ - bne r2,r3,.Lnot_trap - - /* - * There is no trap handler defined here, and so executing a trap - * instruction causes a software break. If you provide a trap handler, - * then you must replace the break instruction below with your handler. - * Your handler must preserve ea and the usual callee saved registers. - */ - - break - - br .Lexception_exit - -.Lnot_trap: - - - .section .exceptions.exit.label -.Lexception_exit: - - diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_execve.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_execve.c deleted file mode 100644 index 27b99cf..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_execve.c +++ /dev/null @@ -1,55 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "os/alt_syscall.h" - -/* - * execve() is used by newlib to launch new processes. This is unsupported in - * the HAL environment. However a "do-nothing" implementation is still - * provied for newlib compatability. - * - * ALT_EXECVE is mapped onto the execve() system call in alt_syscall.h - */ - -int ALT_EXECVE (char *name, char ** argv, char** env) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(execve); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_exit.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_exit.c deleted file mode 100644 index 971b35e..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_exit.c +++ /dev/null @@ -1,71 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_irq.h" -#include "sys/alt_sim.h" -#include "os/alt_hooks.h" -#include "os/alt_syscall.h" - -#include "alt_types.h" -#include "sys/alt_log_printf.h" -/* - * _exit() is called by exit() in order to terminate the current process. - * Typically this is called when main() completes. It should never return. - * Since there is nowhere to go once this process completes, this - * implementation simply blocks forever. - * - * Note that interrupts are not disabled so that execution outside of this - * thread is allowed to continue. - * - * ALT_EXIT is mapped onto the _exit() system call in alt_syscall.h - */ - -void ALT_EXIT (int exit_code) -{ - /* ALT_LOG - please see HAL/inc/alt_log_printf.h for details */ - ALT_LOG_PRINT_BOOT("[alt_exit.c] Entering _exit() function.\r\n"); - ALT_LOG_PRINT_BOOT("[alt_exit.c] Exit code from main was %d.\r\n",exit_code); - /* Stop all other threads */ - - ALT_LOG_PRINT_BOOT("[alt_exit.c] Calling ALT_OS_STOP().\r\n"); - ALT_OS_STOP(); - - /* Provide notification to the simulator that we've stopped */ - - ALT_LOG_PRINT_BOOT("[alt_exit.c] Calling ALT_SIM_HALT().\r\n"); - ALT_SIM_HALT(exit_code); - - /* spin forever, since there's no where to go back to */ - - ALT_LOG_PRINT_BOOT("[alt_exit.c] Spinning forever.\r\n"); - while (1); -} diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_fcntl.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_fcntl.c deleted file mode 100644 index 69c1544..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_fcntl.c +++ /dev/null @@ -1,101 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include -#include - -#include "sys/alt_errno.h" -#include "priv/alt_file.h" -#include "alt_types.h" -#include "os/alt_syscall.h" - -#define ALT_FCNTL_FLAGS_MASK ((alt_u32) (O_APPEND | O_NONBLOCK)) - -/* - * fcntl() is a limited implementation of the standard fcntl() system call. - * It can be used to change the state of the flags associated with an open - * file descriptor. Normally these flags are set during the call to - * open(). It is anticipated that the main use of this function will be to - * change the state of a device from blocking to non-blocking (where this is - * supported). - * - * The input argument "fd" is the file descriptor to be manipulated. "cmd" - * is the command to execute. This can be either F_GETFL (return the - * current value of the flags) or F_SETFL (set the value of the flags). - * - * If "cmd" is F_SETFL then the argument "arg" is the new value of flags, - * otherwise "arg" is ignored. Only the flags: O_APPEND and O_NONBLOCK - * can be updated by a call to fcntl(). All other flags remain - * unchanged. - * - * ALT_FCNTL is mapped onto the fcntl() system call in alt_syscall.h - */ - -int ALT_FCNTL (int file, int cmd, ...) -{ - alt_fd* fd; - long flags; - va_list argp; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - switch (cmd) - { - case F_GETFL: - return fd->fd_flags & ~((alt_u32) ALT_FD_FLAGS_MASK); - case F_SETFL: - va_start(argp, cmd); - flags = va_arg(argp, long); - fd->fd_flags &= ~ALT_FCNTL_FLAGS_MASK; - fd->fd_flags |= (flags & ALT_FCNTL_FLAGS_MASK); - va_end(argp); - return 0; - default: - ALT_ERRNO = EINVAL; - return -1; - } - } - - ALT_ERRNO = EBADFD; - return -1; -} diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_fd_lock.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_fd_lock.c deleted file mode 100644 index 0e2a85d..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_fd_lock.c +++ /dev/null @@ -1,75 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "priv/alt_file.h" - -/* - * alt_fd_lock() is called as a consequence of an ioctl call to gain exclusive - * access to a device, i.e.: - * - * ioctl (fd, TIOCEXCL, NULL); - * - * If there are no other open file descriptors which reference the same - * device, then alt_fd_lock() will grant the lock. Further calls to open() - * for this device will fail until the lock is released. - * - * This is done by calling close() for this file descriptor, or by calling: - * - * ioctl (fd, TIOCNXCL, NULL); - * - * The return value is zero for success, or negative in the case of failure. - */ - -int alt_fd_lock (alt_fd* fd) -{ - int i; - int rc = 0; - - ALT_SEM_PEND(alt_fd_list_lock, 0); - - for (i = 0; i < alt_max_fd; i++) - { - if ((&alt_fd_list[i] != fd) && (alt_fd_list[i].dev == fd->dev)) - { - rc = -EACCES; - goto alt_fd_lock_exit; - } - } - fd->fd_flags |= ALT_FD_EXCL; - - alt_fd_lock_exit: - - ALT_SEM_POST(alt_fd_list_lock); - return rc; -} diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_fd_unlock.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_fd_unlock.c deleted file mode 100644 index fb700dc..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_fd_unlock.c +++ /dev/null @@ -1,56 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "priv/alt_file.h" - -/* - * alt_fd_unlock() is the inverse of alt_fd_lock(). It is called as a - * consequence of a TIOCNXCL ioctl request, e.g: - * - * ioctl (fd, TIOCNXCL, NULL); - * - * It enables multiple file descriptors to exist for the same device. This - * is normally the case, but it may have been disabled by a previous call to - * alt_fd_lock(). - * - * Return zero on sucess, and a negative value on failure. - * - * The current implementation always succeeds. - */ - -int alt_fd_unlock (alt_fd* fd) -{ - fd->fd_flags &= ~ALT_FD_EXCL; - return 0; -} diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_find_dev.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_find_dev.c deleted file mode 100644 index 37aefa4..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_find_dev.c +++ /dev/null @@ -1,88 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - -#include "alt_types.h" - -/* - * alt_find_dev() is used by open() in order to locate a previously registered - * device with the name "name". The input argument "llist" is a pointer to the - * head of the device list to search. - * - * The return value is a pointer to the matching device, or NULL if there is - * no match. - * - * "name" must be an exact match for the devices registered name for a match to - * be found. - */ - -alt_dev* alt_find_dev(const char* name, alt_llist* llist) -{ - alt_dev* next = (alt_dev*) llist->next; - alt_32 len; - - len = strlen(name) + 1; - - /* - * Check each list entry in turn, until a match is found, or we reach the - * end of the list (i.e. next winds up pointing back to the list head). - */ - - while (next != (alt_dev*) llist) - { - - /* - * memcmp() is used here rather than strcmp() in order to reduce the size - * of the executable. - */ - - if (!memcmp (next->name, name, len)) - { - /* match found */ - - return next; - } - next = (alt_dev*) next->llist.next; - } - - /* No match found */ - - return NULL; -} - - diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_find_file.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_find_file.c deleted file mode 100644 index 2d97ec2..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_find_file.c +++ /dev/null @@ -1,89 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - -#include "alt_types.h" - -/* - * alt_find_file() is used by open() in order to locate a previously registered - * filesystem that owns that mount point that contains the file named "name". - * - * The return value is a pointer to the matching filesystem, or NULL if there is - * no match. - * - * A match is considered to have been found if the filesystem name followed by - * either '/' or '\0' is the prefix of the filename. For example the filename: - * "/myfilesystem/junk.txt" would match: "/myfilesystem", but not: "/myfile". - */ - -alt_dev* alt_find_file (const char* name) -{ - alt_dev* next = (alt_dev*) alt_fs_list.next; - - alt_32 len; - - /* - * Check each list entry in turn, until a match is found, or we reach the - * end of the list (i.e. next winds up pointing back to the list head). - */ - - while (next != (alt_dev*) &alt_fs_list) - { - len = strlen(next->name); - - if (next->name[len-1] == '/') - { - len -= 1; - } - - if (((name[len] == '/') || (name[len] == '\0')) && - !memcmp (next->name, name, len)) - { - /* match found */ - - return next; - } - next = (alt_dev*) next->llist.next; - } - - /* No match found */ - - return NULL; -} - - diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_flash_dev.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_flash_dev.c deleted file mode 100644 index 213f721..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_flash_dev.c +++ /dev/null @@ -1,69 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* Alt_flash.c - Functions to register a flash device to the "generic" flash * -* interface * -* * -* Author PRR * -* * -******************************************************************************/ - -#include -#include "sys/alt_llist.h" -#include "sys/alt_flash_dev.h" -#include "priv/alt_file.h" - -ALT_LLIST_HEAD(alt_flash_dev_list); - -alt_flash_fd* alt_flash_open_dev(const char* name) -{ - alt_flash_dev* dev = (alt_flash_dev*)alt_find_dev(name, &alt_flash_dev_list); - - if ((dev) && dev->open) - { - return dev->open(dev, name); - } - - return dev; -} - -void alt_flash_close_dev(alt_flash_fd* fd) -{ - if (fd && fd->close) - { - fd->close(fd); - } - return; -} - diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_fork.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_fork.c deleted file mode 100644 index ce74df0..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_fork.c +++ /dev/null @@ -1,57 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_warning.h" -#include "sys/alt_errno.h" -#include "os/alt_syscall.h" - -/* - * The fork() system call is used by newlib to create a duplicate copy of the - * curent process. This is unsupported in the HAL environment. However a - * "do-nothing" implementation is still provied for newlib compatability. - * - * ALT_FORK is mapped onto the fork() system call in alt_syscall.h - */ - -int ALT_FORK (void) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(fork); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} - - diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_fs_reg.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_fs_reg.c deleted file mode 100644 index 13437a1..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_fs_reg.c +++ /dev/null @@ -1,75 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - -/* - * The alt_fs_reg() function is used to register a file system. Once registered - * a device can be accessed using the standard posix calls: open(), read(), - * write() etc. - * - * System behaviour is undefined in the event that a file system is registered - * with a name that conflicts with an existing device or file system. - * - * alt_fs_reg() is not thread safe in the sense that there should be no other - * thread using the file system list at the time that alt_dev_reg() is called. In - * practice this means that alt_fs_reg() should only be called while operating - * in a single threaded mode. The expectation is that it will only be called - * by the file system initilisation functions invoked by alt_sys_init(), which in - * turn should only be called by the single threaded C startup code. - * - * A return value of zero indicates success. A negative return value indicates - * failure. - */ - -int alt_fs_reg (alt_dev* dev) -{ - /* - * check that the device has a name. - */ - - if (!dev->name) - { - return -ENODEV; - } - - /* - * register the file system. - */ - - alt_llist_insert(&alt_fs_list, &dev->llist); - - return 0; -} diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_fstat.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_fstat.c deleted file mode 100644 index af5d527..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_fstat.c +++ /dev/null @@ -1,128 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include "sys/alt_dev.h" -#include "sys/alt_warning.h" -#include "sys/alt_errno.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -/* - * The fstat() system call is used to obtain information about the capabilities - * of an open file descriptor. By default file descriptors are marked as - * being character devices. If a device or file system wishes to advertise - * alternative capabilities then they can register an fstat() function within - * their associated alt_dev structure. This will be called to fill in the - * entries in the imput "st" structure. - * - * This function is provided for compatability with newlib. - * - * ALT_FSTAT is mapped onto the fstat() system call in alt_syscall.h - */ - -#ifdef ALT_USE_DIRECT_DRIVERS - -#include "system.h" - -/* - * Provide minimal version that just describes all file descriptors - * as character devices for provided stdio devices. - */ -int ALT_FSTAT (int file, struct stat *st) -{ - switch (file) { -#ifdef ALT_STDIN_PRESENT - case 0: /* stdin file descriptor */ -#endif /* ALT_STDIN_PRESENT */ -#ifdef ALT_STDOUT_PRESENT - case 1: /* stdout file descriptor */ -#endif /* ALT_STDOUT_PRESENT */ -#ifdef ALT_STDERR_PRESENT - case 2: /* stderr file descriptor */ -#endif /* ALT_STDERR_PRESENT */ - st->st_mode = _IFCHR; - return 0; - default: - return -1; - } - -#if !defined(ALT_STDIN_PRESENT) && !defined(ALT_STDOUT_PRESENT) && !defined(ALT_STDERR_PRESENT) - /* Generate a link time warning, should this function ever be called. */ - ALT_STUB_WARNING(fstat); -#endif -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -int ALT_FSTAT (int file, struct stat *st) -{ - alt_fd* fd; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - /* Call the drivers fstat() function to fill out the "st" structure. */ - - if (fd->dev->fstat) - { - return fd->dev->fstat(fd, st); - } - - /* - * If no function is provided, mark the fd as belonging to a character - * device. - */ - - else - { - st->st_mode = _IFCHR; - return 0; - } - } - else - { - ALT_ERRNO = EBADFD; - return -1; - } -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_get_fd.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_get_fd.c deleted file mode 100644 index db17b2c..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_get_fd.c +++ /dev/null @@ -1,105 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - -#include "alt_types.h" - -#include "system.h" - -/* - * alt_get_fd() is called to allocate a new file descriptor from the file - * descriptor pool. If a file descriptor is succesfully allocated, it is - * configured to refer to device "dev". - * - * The return value is the index of the file descriptor structure (i.e. - * the offset of the file descriptor within the file descriptor array). A - * negative value indicates failure. - */ - -int alt_get_fd (alt_dev* dev) -{ - alt_32 i; - int rc = -EMFILE; - - /* - * Take the alt_fd_list_lock semaphore in order to avoid races when - * accessing the file descriptor pool. - */ - - ALT_SEM_PEND(alt_fd_list_lock, 0); - - /* - * Search through the list of file descriptors, and allocate the first - * free descriptor that's found. - * - * If a free descriptor is found, then the value of "alt_max_fd" is - * updated accordingly. "alt_max_fd" is a 'highwater mark' which - * indicates the highest file descriptor ever allocated. This is used to - * improve efficency when searching the file descriptor list, and - * therefore reduce contention on the alt_fd_list_lock semaphore. - */ - - for (i = 0; i < ALT_MAX_FD; i++) - { - if (!alt_fd_list[i].dev) - { - alt_fd_list[i].dev = dev; - if (i > alt_max_fd) - { - alt_max_fd = i; - } - rc = i; - goto alt_get_fd_exit; - } - } - - alt_get_fd_exit: - - /* - * Release the alt_fd_list_lock semaphore now that we are done with the - * file descriptor pool. - */ - - ALT_SEM_POST(alt_fd_list_lock); - - return rc; -} - - - - diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_getchar.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_getchar.c deleted file mode 100644 index a8f50d5..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_getchar.c +++ /dev/null @@ -1,61 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#ifdef ALT_USE_DIRECT_DRIVERS -#include "system.h" -#include "sys/alt_driver.h" -#include "sys/alt_stdio.h" -#include "priv/alt_file.h" -#include "unistd.h" -#endif - -/* - * Uses the ALT_DRIVER_READ() macro to call directly to driver if available. - * Otherwise, uses newlib provided getchar() routine. - */ -int -alt_getchar(void) -{ -#ifdef ALT_USE_DIRECT_DRIVERS - ALT_DRIVER_READ_EXTERNS(ALT_STDIN_DEV); - char c; - - if (ALT_DRIVER_READ(ALT_STDIN_DEV, &c, 1, alt_fd_list[STDIN_FILENO].fd_flags) <= 0) { - return -1; - } - return c; -#else - return getchar(); -#endif -} diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_getpid.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_getpid.c deleted file mode 100644 index 2228c7e..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_getpid.c +++ /dev/null @@ -1,47 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "os/alt_syscall.h" - -/* - * The getpid() system call is used by newlib to obtain the current process - * id. Since there is only ever a single process in the HAL environment, - * this just returns a constant. - * - * ALT_GETPID is mapped onto the getpid() system call in alt_syscall.h - */ - -int ALT_GETPID (void) -{ - return 0; -} - diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_gettod.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_gettod.c deleted file mode 100644 index ed86cba..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_gettod.c +++ /dev/null @@ -1,125 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include - -#include "sys/alt_alarm.h" -#include "alt_types.h" -#include "os/alt_syscall.h" - -/* - * Macro defining the number of micoseconds in a second. - */ - -#define ALT_US (1000000) - -/* - * "alt_timezone" and "alt_resettime" are the values of the the reset time and - * time zone set through the last call to settimeofday(). By default they are - * zero initialised. - */ - -struct timezone alt_timezone = {0, 0}; -struct timeval alt_resettime = {0, 0}; - -/* - * gettimeofday() can be called to obtain a time structure which indicates the - * current "wall clock" time. This is calculated using the elapsed number of - * system clock ticks, and the value of "alt_resettime" and "alt_timezone" set - * through the last call to settimeofday(). - * - * Warning: if this function is called concurrently with a call to - * settimeofday(), the value returned by gettimeofday() will be unreliable. - * - * ALT_GETTIMEOFDAY is mapped onto the gettimeofday() system call in - * alt_syscall.h - */ - - -#if defined (__GNUC__) && (__GNUC__ >= 4) -int ALT_GETTIMEOFDAY (struct timeval *ptimeval, void *ptimezone_vptr) -{ - struct timezone *ptimezone = (struct timezone*)ptimezone_vptr; -#else -int ALT_GETTIMEOFDAY (struct timeval *ptimeval, struct timezone *ptimezone) -{ -#endif - - alt_u32 nticks = alt_nticks (); - alt_u32 tick_rate = alt_ticks_per_second (); - - /* - * Check to see if the system clock is running. This is indicated by a - * non-zero system clock rate. If the system clock is not running, an error - * is generated and the contents of "ptimeval" and "ptimezone" are not - * updated. - */ - - if (tick_rate) - { - ptimeval->tv_sec = alt_resettime.tv_sec + nticks/tick_rate; - ptimeval->tv_usec = alt_resettime.tv_usec + - (alt_u32)(((alt_u64)nticks*(ALT_US/tick_rate))%ALT_US); - - while(ptimeval->tv_usec < 0) { - if (ptimeval->tv_sec <= 0) - { - ptimeval->tv_sec = 0; - ptimeval->tv_usec = 0; - break; - } - else - { - ptimeval->tv_sec--; - ptimeval->tv_usec += ALT_US; - } - } - - while(ptimeval->tv_usec >= ALT_US) { - ptimeval->tv_sec++; - ptimeval->tv_usec -= ALT_US; - } - - if (ptimezone) - { - ptimezone->tz_minuteswest = alt_timezone.tz_minuteswest; - ptimezone->tz_dsttime = alt_timezone.tz_dsttime; - } - - return 0; - } - - return -ENOTSUP; -} - diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_gmon.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_gmon.c deleted file mode 100644 index 6add9f1..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_gmon.c +++ /dev/null @@ -1,272 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include -#include -#include - -#include "priv/nios2_gmon_data.h" - -#include "sys/alt_irq.h" -#include "sys/alt_alarm.h" - - -/* Macros */ - -/* How large should the bins be which we use to generate the histogram */ -#define PCSAMPLE_BYTES_PER_BUCKET 32 - -#define NIOS2_READ_EA(dest) __asm__ ("mov %0, ea" : "=r" (dest)) - -/* The compiler inserts calls to mcount() at the start of - * every function call. The structure mcount_fn_arc records t - * he return address of the function called (in from_pc) - * and the return address of the mcount function - * (in self_pc). The number of times this arc is executed is - * recorded in the field count. - */ -struct mcount_fn_arc -{ - struct mcount_fn_arc * next; - void * from_pc; - unsigned int count; -}; - -/* We need to maintain a list of pointers to the heads of each adjacency - * list so that we can find them when writing out the gmon.out file. Since - * we don't know at the start of program execution how many functions will - * be called we use a list structure to do this. - */ -struct mcount_fn_entry -{ - struct mcount_fn_entry * next; - void * self_pc; - struct mcount_fn_arc * arc_head; -}; - -/* function prototypes */ - -void __mcount_record(void * self_pc, void * from_pc, struct mcount_fn_entry * fn_entry, struct mcount_fn_entry * * fn_head) __attribute__ ((no_instrument_function)); - -static __inline__ void * mcount_allocate(unsigned int size) __attribute__ ((no_instrument_function)); -static int nios2_pcsample_init(void) __attribute__ ((no_instrument_function)); -static alt_u32 nios2_pcsample(void* alarm) __attribute__ ((no_instrument_function)); - -/* global variables */ - -/* stext and etext are defined in the linker script */ -extern char stext[]; -extern char etext[]; - -/* Is the PC sampling stuff enabled yet? */ -static int pcsample_need_init = 1; - -#define HASH_BUCKETS 64 /* Must be a power of 2 */ - -/* This points to the list of adjacency list pointers. */ -struct mcount_fn_entry * __mcount_fn_head[HASH_BUCKETS]; - -/* pointer to the in-memory buffer containing the histogram */ -static unsigned short* s_pcsamples = 0; - -/* the address of the start and end of text section */ -static const unsigned int s_low_pc = (unsigned int)stext; -static const unsigned int s_high_pc = (unsigned int)etext; - -/* the alarm structure to register for pc sampling */ -static alt_alarm s_nios2_pcsample_alarm; - -unsigned int alt_gmon_data[GMON_DATA_SIZE] = -{ - 0x6e6f6d67, /* "gmon" */ - GMON_DATA_SIZE, - 0, - (unsigned int)stext, - (unsigned int)etext, - PCSAMPLE_BYTES_PER_BUCKET, - 0, - (unsigned int)__mcount_fn_head, - (unsigned int)(__mcount_fn_head + HASH_BUCKETS) -}; - -/* This holds the current slab of memory we're allocating out of */ -static char * mcount_slab_ptr = 0; -static int mcount_slab_size = 0; - -#define MCOUNT_SLAB_INCREMENT 1020 - - -/* - * We can't use malloc to allocate memory because that's too complicated, and - * can't be called at interrupt time. Use the lower level allocator instead - * because that's interrupt safe (and because we never free anything). - * - * For speed, we allocate a block of data at once. - */ -static __inline__ void * mcount_allocate(unsigned int size) -{ - void * data; - - if (size > mcount_slab_size) - { - mcount_slab_ptr = sbrk(MCOUNT_SLAB_INCREMENT); - mcount_slab_size = MCOUNT_SLAB_INCREMENT; - } - - data = mcount_slab_ptr; - mcount_slab_ptr += size; - mcount_slab_size -= size; - - return data; -} - - -/* - * Add the arc with the values of frompc and topc given to the graph. - * This function might be called at interrupt time so must be able to - * cope with reentrancy. - * - * The fast case, where we have already allocated a function arc, has been - * handled by the assmebler code. - */ -void __mcount_record(void * self_pc, void * from_pc, struct mcount_fn_entry * fn_entry, struct mcount_fn_entry * * fn_head) -{ - alt_irq_context context; - struct mcount_fn_arc * arc_entry; - - /* Keep trying to start up the PC sampler until it is running. - * (It can't start until the timer is going). - */ - if (pcsample_need_init) - { - pcsample_need_init = 0; - pcsample_need_init = nios2_pcsample_init(); - } - - /* - * We must disable interrupts around the allocation and the list update to - * prevent corruption if the instrumented function is re-entrant. - * - * It's safe for the code above to be stepping through the chain and be - * interrupted by this code modifying it - there is an edge case which will - * leave two copies of the same arc on the list (both with count=1), but - * this is dealt with on the host. - */ - context = alt_irq_disable_all(); - - if (fn_entry == NULL) - { - /* Add it to the list of functions we must output later. */ - fn_entry = (struct mcount_fn_entry *)mcount_allocate(sizeof(struct mcount_fn_entry)); - - fn_entry->self_pc = self_pc; - fn_entry->arc_head = NULL; - - fn_entry->next = *fn_head; - *fn_head = fn_entry; - } - - /* We will need a new list entry - if there was a list entry before - * then the assembler code would have handled it. */ - arc_entry = (struct mcount_fn_arc *)mcount_allocate(sizeof(struct mcount_fn_arc)); - - arc_entry->from_pc = from_pc; - arc_entry->count = 1; - - arc_entry->next = fn_entry->arc_head; - fn_entry->arc_head = arc_entry; - - alt_irq_enable_all(context); -} - - -/* - * nios2_pcsample_init starts profiling. - * It is called the first time mcount is called, and on subsequent calls to - * mcount until it returns zero. It initializes the pc histogram and turns on - * timer driven pc sampling. - */ -static int nios2_pcsample_init(void) -{ - unsigned int pcsamples_size; - - /* We sample the PC every tick */ - unsigned int prof_rate = alt_ticks_per_second(); - if (prof_rate == 0) - return 1; - - /* allocate the histogram buffer s_pcsamples */ - pcsamples_size = (s_high_pc - s_low_pc)/PCSAMPLE_BYTES_PER_BUCKET; - s_pcsamples = (unsigned short*)sbrk(pcsamples_size * sizeof(unsigned short)); - - if (s_pcsamples != 0) - { - /* initialize the buffer to zero */ - memset(s_pcsamples, 0, pcsamples_size * sizeof(unsigned short)); - - alt_gmon_data[GMON_DATA_PROFILE_DATA] = (int)s_pcsamples; - alt_gmon_data[GMON_DATA_PROFILE_RATE] = prof_rate; - - /* Sample every tick (it's cheap) */ - alt_alarm_start(&s_nios2_pcsample_alarm, 1, nios2_pcsample, 0); - } - - return 0; -} - - -/* - * Sample the PC value and store it in the histogram - */ -static alt_u32 nios2_pcsample(void* context) -{ - unsigned int pc; - unsigned int bucket; - - /* read the exception return address - this will be - * inaccurate if there are nested interrupts but we - * assume that this is rare and the inaccuracy will - * not be great */ - NIOS2_READ_EA(pc); - - /* - * If we're within the profilable range then increment the relevant - * bucket in the histogram - */ - if (pc >= s_low_pc && pc < s_high_pc && s_pcsamples != 0) - { - bucket = (pc - s_low_pc)/PCSAMPLE_BYTES_PER_BUCKET; - s_pcsamples[bucket]++; - } - - /* Sample every tick */ - return 1; -} - diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_icache_flush.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_icache_flush.c deleted file mode 100644 index 4b706ed..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_icache_flush.c +++ /dev/null @@ -1,84 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "nios2.h" -#include "system.h" - -#include "alt_types.h" -#include "sys/alt_cache.h" - -/* - * alt_icache_flush() is called to flush the instruction cache for a memory - * region of length "len" bytes, starting at address "start". - */ - -void alt_icache_flush (void* start, alt_u32 len) -{ -#if NIOS2_ICACHE_SIZE > 0 - - char* i; - char* end; - - /* - * This is the most we would ever need to flush. - */ - - if (len > NIOS2_ICACHE_SIZE) - { - len = NIOS2_ICACHE_SIZE; - } - - end = ((char*) start) + len; - - for (i = start; i < end; i+= NIOS2_ICACHE_LINE_SIZE) - { - __asm__ volatile ("flushi %0" :: "r" (i)); - } - - /* - * For an unaligned flush request, we've got one more line left. - * Note that this is dependent on NIOS2_ICACHE_LINE_SIZE to be a - * multiple of 2 (which it always is). - */ - - if (((alt_u32) start) & (NIOS2_ICACHE_LINE_SIZE - 1)) - { - __asm__ volatile ("flushi %0" :: "r" (i)); - } - - /* - * Having flushed the cache, flush any stale instructions in the - * pipeline - */ - - __asm__ volatile ("flushp"); - -#endif /* NIOS2_ICACHE_SIZE > 0 */ -} diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_icache_flush_all.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_icache_flush_all.c deleted file mode 100644 index 5088552..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_icache_flush_all.c +++ /dev/null @@ -1,46 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "nios2.h" -#include "system.h" - -#include "alt_types.h" -#include "sys/alt_cache.h" - -/* - * alt_icache_flush_all() is called to flush the entire instruction cache. - */ - -void alt_icache_flush_all (void) -{ -#if NIOS2_ICACHE_SIZE > 0 - alt_icache_flush (0, NIOS2_ICACHE_SIZE); -#endif -} diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_iic.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_iic.c deleted file mode 100644 index 1db5afa..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_iic.c +++ /dev/null @@ -1,106 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ -#include "system.h" - -/* - * This file implements the HAL Enhanced interrupt API for Nios II processors - * with an internal interrupt controller (IIC). For most routines, this serves - * as a wrapper layer over the legacy interrupt API (which must be used with - * the IIC only). - * - * Use of the enhanced API is recommended so that application and device - * drivers are compatible with a Nios II system configured with an external - * interrupt controller (EIC), or IIC. This will afford maximum portability. - * - * If an EIC is present, the EIC device driver must provide these routines, - * because their operation will be specific to that EIC type. - */ -#ifndef NIOS2_EIC_PRESENT -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - -#include "sys/alt_irq.h" -#include "priv/alt_iic_isr_register.h" -#include "priv/alt_legacy_irq.h" - -/** @Function Description: This function registers an interrupt handler. - * If the function is succesful, then the requested interrupt will be enabled upon - * return. Registering a NULL handler will disable the interrupt. - * @API Type: External - * @param ic_id Ignored. - * @param irq IRQ number - * @return 0 if successful, else error (-1) - */ -int alt_ic_isr_register(alt_u32 ic_id, alt_u32 irq, alt_isr_func isr, - void *isr_context, void *flags) -{ - return alt_iic_isr_register(ic_id, irq, isr, isr_context, flags); -} - -/** @Function Description: This function enables a single interrupt. - * @API Type: External - * @param ic_id Ignored. - * @param irq IRQ number - * @return 0 if successful, else error (-1) - */ -int alt_ic_irq_enable (alt_u32 ic_id, alt_u32 irq) -{ - return alt_irq_enable(irq); -} - -/** @Function Description: This function disables a single interrupt. - * @API Type: External - * @param ic_id Ignored. - * @param irq IRQ number - * @return 0 if successful, else error (-1) - */ -int alt_ic_irq_disable(alt_u32 ic_id, alt_u32 irq) -{ - return alt_irq_disable(irq); -} - -/** @Function Description: This function to determine if corresponding - * interrupt is enabled. - * @API Type: External - * @param ic_id Ignored. - * @param irq IRQ number - * @return Zero if corresponding interrupt is disabled and - * non-zero otherwise. - */ -alt_u32 alt_ic_irq_enabled(alt_u32 ic_id, alt_u32 irq) -{ - alt_u32 irq_enabled; - - NIOS2_READ_IENABLE(irq_enabled); - - return (irq_enabled & (1 << irq)) ? 1: 0; -} - -#endif /* ALT_ENHANCED_INTERRUPT_API_PRESENT */ -#endif /* NIOS2_EIC_PRESENT */ diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_iic_isr_register.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_iic_isr_register.c deleted file mode 100644 index b104395..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_iic_isr_register.c +++ /dev/null @@ -1,104 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ -#include -#include "system.h" - -/* - * Provides an interrupt registry mechanism for the any CPUs internal interrupt - * controller (IIC) when the enhanced interrupt API is active. - */ -#ifndef ALT_CPU_EIC_PRESENT -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - -#include "alt_types.h" -#include "sys/alt_irq.h" -#include "priv/alt_iic_isr_register.h" - -/* - * The header, alt_irq_entry.h, contains the exception entry point, and is - * provided by the processor component. It is included here, so that the code - * will be added to the executable only if alt_irq_register() is present, i.e. - * if no interrupts are registered - there's no need to provide any - * interrupt handling. - */ - -#include "sys/alt_irq_entry.h" - -/* - * The header, alt_irq_table.h contains a table describing which function - * handles each interrupt. - */ - -#include "priv/alt_irq_table.h" - -/** @Function Description: This function registers an interrupt handler. - * If the function is succesful, then the requested interrupt will be enabled - * upon return. Registering a NULL handler will disable the interrupt. - * - * @API Type: External - * @param ic_id Interrupt controller ID - * @param irq IRQ ID number - * @param isr Pointer to interrupt service routine - * @param isr_context Opaque pointer passed to ISR - * @param flags - * @return 0 if successful, else error (-1) - */ -int alt_iic_isr_register(alt_u32 ic_id, alt_u32 irq, alt_isr_func isr, - void *isr_context, void *flags) -{ - int rc = -EINVAL; - int id = irq; /* IRQ interpreted as the interrupt ID. */ - alt_irq_context status; - - if (id < ALT_NIRQ) - { - /* - * interrupts are disabled while the handler tables are updated to ensure - * that an interrupt doesn't occur while the tables are in an inconsistant - * state. - */ - - status = alt_irq_disable_all(); - - alt_irq[id].handler = isr; - alt_irq[id].context = isr_context; - - rc = (isr) ? alt_ic_irq_enable(ic_id, id) : alt_ic_irq_disable(ic_id, id); - - alt_irq_enable_all(status); - } - - return rc; -} - -#endif /* ALT_ENHANCED_INTERRUPT_API_PRESENT */ -#endif /* ALT_CPU_EIC_PRESENT */ diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_instruction_exception_entry.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_instruction_exception_entry.c deleted file mode 100644 index f4f52fc..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_instruction_exception_entry.c +++ /dev/null @@ -1,203 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2008 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ -#include "sys/alt_exceptions.h" -#include "nios2.h" -#include "alt_types.h" -#include "system.h" - -/* - * This file implements support for calling user-registered handlers for - * instruction-generated exceptions. This handler could also be reached - * in the event of a spurious interrupt. - * - * The handler code is optionally enabled through the "Enable - * Instruction-related Exception API" HAL BSP setting, which will - * define the macro below. - */ -#ifdef ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API - -/* Function pointer to exception callback routine */ -alt_exception_result (*alt_instruction_exception_handler) - (alt_exception_cause, alt_u32, alt_u32) = 0x0; - -/* Link entry routine to .exceptions section */ -int alt_instruction_exception_entry (alt_u32 exception_pc) - __attribute__ ((section (".exceptions"))); - -/* - * This is the entry point for instruction-generated exceptions handling. - * This routine will be called by alt_exceptions_entry.S, after it determines - * that an exception could not be handled by handlers that preceed that - * of instruction-generated exceptions (such as interrupts). - * - * For this to function properly, you must register an exception handler - * using alt_instruction_exception_register(). This routine will call - * that handler if it has been registered. Absent a handler, it will - * break break or hang as discussed below. - */ -int alt_instruction_exception_entry (alt_u32 exception_pc) -{ - alt_u32 cause, badaddr; - -/* - * If the processor hardware has the optional EXCEPTIONS & BADADDR registers, - * read them and pass their content to the user handler. These are always - * present if the MMU or MPU is enabled, and optionally for other advanced - * exception types via the "Extra exceptions information" setting in the - * processor (hardware) configuration. - * - * If these registers are not present, the cause field will be set to - * NIOS2_EXCEPTION_CAUSE_NOT_PRESENT. Your handling routine should - * check the validity of the cause argument before proceeding. - */ -#ifdef NIOS2_HAS_EXTRA_EXCEPTION_INFO - /* Get exception cause & "badaddr" */ - NIOS2_READ_EXCEPTION(cause); - cause = ( (cause & NIOS2_EXCEPTION_REG_CAUSE_MASK) >> - NIOS2_EXCEPTION_REG_CAUSE_OFST ); - - NIOS2_READ_BADADDR(badaddr); -#else - cause = NIOS2_EXCEPTION_CAUSE_NOT_PRESENT; - badaddr = 0; -#endif /* NIOS2_HAS_EXTRA_EXCEPTION_INFO */ - - if(alt_instruction_exception_handler) { - /* - * Call handler. Its return value indicates whether the exception-causing - * instruction should be re-issued. The code that called us, - * alt_eceptions_entry.S, will look at this value and adjust the ea - * register as necessary - */ - return alt_instruction_exception_handler(cause, exception_pc, badaddr); - } - /* - * We got here because an instruction-generated exception occured, but no - * handler is present. We do not presume to know how to handle it. If the - * debugger is present, break, otherwise hang. - * - * If you've reached here in the debugger, consider examining the - * EXCEPTIONS register cause bit-field, which was read into the 'cause' - * variable above, and compare it against the exceptions-type enumeration - * in alt_exceptions.h. This register is availabe if the MMU or MPU is - * present, or if the "Extra exceptions information" hardware option is - * selected. - * - * If you get here then one of the following could have happened: - * - * - An instruction-generated exception occured, and the processor - * does not have the extra exceptions feature enabled, or you - * have not registered a handler using - * alt_instruction_exception_register() - * - * Some examples of instruction-generated exceptions and why they - * might occur: - * - * - Your program could have been compiled for a full-featured - * Nios II core, but it is running on a smaller core, and - * instruction emulation has been disabled by defining - * ALT_NO_INSTRUCTION_EMULATION. - * - * You can work around the problem by re-enabling instruction - * emulation, or you can figure out why your program is being - * compiled for a system other than the one that it is running on. - * - * - Your program has executed a trap instruction, but has not - * implemented a handler for this instruction. - * - * - Your program has executed an illegal instruction (one which is - * not defined in the instruction set). - * - * - Your processor includes an MMU or MPU, and you have enabled it - * before registering an exception handler to service exceptions it - * generates. - * - * The problem could also be hardware related: - * - If your hardware is broken and is generating spurious interrupts - * (a peripheral which negates its interrupt output before its - * interrupt handler has been executed will cause spurious interrupts) - */ - else { -#ifdef NIOS2_HAS_DEBUG_STUB - NIOS2_BREAK(); -#else - while(1) - ; -#endif /* NIOS2_HAS_DEBUG_STUB */ - } - - /* // We should not get here. Remove compiler warning. */ - return NIOS2_EXCEPTION_RETURN_REISSUE_INST; -} - -#endif /* ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API */ - -/* - * This routine indicates whether a particular exception cause will have - * set a valid address into the BADADDR register, which is included - * in the arguments to a user-registered instruction-generated exception - * handler. Many exception types do not set valid contents in BADADDR; - * this is a convenience routine to easily test the validity of that - * argument in your handler. - * - * Note that this routine will return false (0) for cause '12', - * TLB miss. This is because there are four exception types that - * share that cause, two of which do not have a valid BADADDR. You - * must determine BADADDR's validity for these. - * - * Arguments: - * cause: The 5-bit exception cause field of the EXCEPTIONS register, - * shifted to the LSB position. You may pass the 'cause' argument - * in a handler you registered directy to this routine. - * - * Return: 1: BADADDR (bad_addr argument to handler) is valid - * 0: BADADDR is not valid - */ -int alt_exception_cause_generated_bad_addr(alt_exception_cause cause) -{ - switch (cause) { - case NIOS2_EXCEPTION_SUPERVISOR_ONLY_DATA_ADDR: - return 1; - case NIOS2_EXCEPTION_MISALIGNED_DATA_ADDR: - return 1; - case NIOS2_EXCEPTION_MISALIGNED_TARGET_PC: - return 1; - case NIOS2_EXCEPTION_TLB_READ_PERM_VIOLATION: - return 1; - case NIOS2_EXCEPTION_TLB_WRITE_PERM_VIOLATION: - return 1; - case NIOS2_EXCEPTION_MPU_DATA_REGION_VIOLATION: - return 1; - default: - return 0; - } -} diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_instruction_exception_register.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_instruction_exception_register.c deleted file mode 100644 index b059e1d..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_instruction_exception_register.c +++ /dev/null @@ -1,82 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2008 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ -#include "sys/alt_exceptions.h" -#include "alt_types.h" -#include "system.h" - -/* - * This file implements support for calling user-registered handlers for - * instruction-generated exceptions. - * - * The registry API is optionally enabled through the "Enable - * Instruction-related Exception API" HAL BSP setting, which will - * define the macro below. - */ -#ifdef ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API - -/* - * The header, alt_exception_handler_registry.h contains a struct describing - * the registered exception handler - */ -#include "priv/alt_exception_handler_registry.h" - -/* - * Pull in the exception entry assembly code. This will not be linked in - * unless this object is linked into the executable (i.e. only if - * alt_instruction_exception_register() is called). - */ -__asm__( "\n\t.globl alt_exception" ); - -/* - * alt_instruction_exception_register() is called to register a handler to - * service instruction-generated exceptions that are not handled by the - * default exception handler code (interrupts, and optionally unimplemented - * instructions and traps). - * - * Passing null (0x0) in the handler argument will disable a previously- - * registered handler. - * - * Note that if no handler is registered, exceptions that are not processed - * using the built-in handler (interrupts, and optionally unimplemented - * instructions and traps) are treated as unknown exceptions, resulting - * in either a break or an infinite loop. - */ -void alt_instruction_exception_register ( - alt_exception_result (*exception_handler)( - alt_exception_cause cause, - alt_u32 exception_pc, - alt_u32 bad_addr) ) -{ - alt_instruction_exception_handler = exception_handler; -} - -#endif /* ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API */ diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_io_redirect.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_io_redirect.c deleted file mode 100644 index 8c862f7..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_io_redirect.c +++ /dev/null @@ -1,98 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include -#include - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - - -/* - * alt_open_fd() is similar to open() in that it is used to obtain a file - * descriptor for the file named "name". The "flags" and "mode" arguments are - * identical to the "flags" and "mode" arguments of open(). - * - * The distinction between the two functions is that the file descriptor - * structure to use is passed in as an argument, rather than allocated from the - * list of free file descriptors. - * - * This is used by alt_io_redirect() to redirect the stdin, stdout and stderr - * file descriptors to point to new devices. - * - * If the device can not be succesfully opened, then the input file descriptor - * remains unchanged. - */ - -static void alt_open_fd(alt_fd* fd, const char* name, int flags, int mode) -{ - int old; - - old = open (name, flags, mode); - - if (old >= 0) - { - fd->dev = alt_fd_list[old].dev; - fd->priv = alt_fd_list[old].priv; - fd->fd_flags = alt_fd_list[old].fd_flags; - - alt_release_fd (old); - } -} - -/* - * alt_io_redirect() is called once the device/filesystem lists have been - * initialised, but before main(). Its function is to redirect standard in, - * standard out and standard error so that they point to the devices selected by - * the user (as defined in system.h). - * - * Prior to the call to this function, io is directed towards /dev/null. If - * i/o can not be redirected to the requested device, for example if the device - * does not exist, then it remains directed at /dev/null. - */ - -void alt_io_redirect(const char* stdout_dev, - const char* stdin_dev, - const char* stderr_dev) -{ - /* Redirect the channels */ - - alt_open_fd (&alt_fd_list[STDOUT_FILENO], stdout_dev, O_WRONLY, 0777); - alt_open_fd (&alt_fd_list[STDIN_FILENO], stdin_dev, O_RDONLY, 0777); - alt_open_fd (&alt_fd_list[STDERR_FILENO], stderr_dev, O_WRONLY, 0777); -} - - - - diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_ioctl.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_ioctl.c deleted file mode 100644 index f5d7ef1..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_ioctl.c +++ /dev/null @@ -1,170 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "sys/ioctl.h" -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -/* - * The ioctl() system call is provided so that application code can manipulate - * the i/o capabilities of a device in device specific ways. This is identical - * to the standard posix ioctl() function. - * - * In general this implementation simply vectors ioctl requests to the - * apropriate drivers ioctl function (as registered in the drivers alt_dev - * structure). - * - * However in the case of devices (as oposed to filesystem), the TIOCEXCL and - * TIOCNXCL requests are handled without reference to the driver. These - * requests are used to lock/release a device for exclusive access. - * - * Handling these requests centrally eases the task of device driver - * development. - * - * ALT_IOCTL is mapped onto the ioctl() system call in alt_syscall.h - */ - -#ifdef ALT_USE_DIRECT_DRIVERS - -#include "system.h" -#include "sys/alt_driver.h" - -/* - * Provide minimal version that calls ioctl routine of provided stdio devices. - */ -int ALT_IOCTL (int file, int req, void* arg) -{ -#ifdef ALT_STDIN_PRESENT - ALT_DRIVER_IOCTL_EXTERNS(ALT_STDIN_DEV); -#endif -#ifdef ALT_STDOUT_PRESENT - ALT_DRIVER_IOCTL_EXTERNS(ALT_STDOUT_DEV); -#endif -#ifdef ALT_STDERR_PRESENT - ALT_DRIVER_IOCTL_EXTERNS(ALT_STDERR_DEV); -#endif - -#if !defined(ALT_STDIN_PRESENT) && !defined(ALT_STDOUT_PRESENT) && !defined(ALT_STDERR_PRESENT) - /* Generate a link time warning, should this function ever be called. */ - ALT_STUB_WARNING(ioctl); -#endif - - switch (file) { -#ifdef ALT_STDIN_PRESENT - case 0: /* stdin file descriptor */ - return ALT_DRIVER_IOCTL(ALT_STDIN_DEV, req, arg); -#endif /* ALT_STDIN_PRESENT */ -#ifdef ALT_STDOUT_PRESENT - case 1: /* stdout file descriptor */ - return ALT_DRIVER_IOCTL(ALT_STDOUT_DEV, req, arg); -#endif /* ALT_STDOUT_PRESENT */ -#ifdef ALT_STDERR_PRESENT - case 2: /* stderr file descriptor */ - return ALT_DRIVER_IOCTL(ALT_STDERR_DEV, req, arg); -#endif /* ALT_STDERR_PRESENT */ - default: - ALT_ERRNO = EBADFD; - return -1; - } -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -int ALT_IOCTL (int file, int req, void* arg) -{ - alt_fd* fd; - int rc; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - - /* - * In the case of device drivers (not file systems) handle the TIOCEXCL - * and TIOCNXCL requests as special cases. - */ - - if (fd->fd_flags & ALT_FD_DEV) - { - if (req == TIOCEXCL) - { - rc = alt_fd_lock (fd); - goto ioctl_done; - } - else if (req == TIOCNXCL) - { - rc = alt_fd_unlock (fd); - goto ioctl_done; - } - } - - /* - * If the driver provides an ioctl() function, call that to handle the - * request, otherwise set the return code to indicate that the request - * could not be processed. - */ - - if (fd->dev->ioctl) - { - rc = fd->dev->ioctl(fd, req, arg); - } - else - { - rc = -ENOTTY; - } - } - else - { - rc = -EBADFD; - } - -ioctl_done: - - if (rc < 0) - { - ALT_ERRNO = -rc; - } - return rc; -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_irq_entry.S b/software/qsys_tutorial_green_bsp/HAL/src/alt_irq_entry.S deleted file mode 100644 index d3efe7d..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_irq_entry.S +++ /dev/null @@ -1,108 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "system.h" - -/* - * This is the interrupt exception entry point code, which saves all the - * registers and calls the interrupt handler. It should be pulled in using - * a .globl from alt_irq_register.c. This scheme is used so that if an - * interrupt is never registered, then this code will not appear in the - * generated executable, thereby improving code footprint. - */ - - /* - * Explicitly allow the use of r1 (the assembler temporary register) - * within this code. This register is normally reserved for the use of - * the compiler. - */ - .set noat - - /* - * Pull in the exception handler register save code. - */ - .globl alt_exception - - .globl alt_irq_entry - .section .exceptions.entry.label, "xa" -alt_irq_entry: - - /* - * Section .exceptions.entry is in alt_exception_entry.S - * This saves all the caller saved registers and reads estatus into r5 - */ - - .section .exceptions.irqtest, "xa" - -#ifdef ALT_CI_INTERRUPT_VECTOR_N - /* - * Use the interrupt vector custom instruction if present to accelerate - * this code. - * If the interrupt vector custom instruction returns a negative - * value, there are no interrupts active (estatus.pie is 0 - * or ipending is 0) so assume it is a software exception. - */ - custom ALT_CI_INTERRUPT_VECTOR_N, r4, r0, r0 - blt r4, r0, .Lnot_irq -#else - /* - * Test to see if the exception was a software exception or caused - * by an external interrupt, and vector accordingly. - */ - rdctl r4, ipending - andi r2, r5, 1 - beq r2, zero, .Lnot_irq - beq r4, zero, .Lnot_irq -#endif /* ALT_CI_INTERRUPT_VECTOR_N */ - - .section .exceptions.irqhandler, "xa" - /* - * Now that all necessary registers have been preserved, call - * alt_irq_handler() to process the interrupts. - */ - - call alt_irq_handler - - .section .exceptions.irqreturn, "xa" - - br .Lexception_exit - - .section .exceptions.notirq.label, "xa" - -.Lnot_irq: - - /* - * Section .exceptions.exit is in alt_exception_entry.S - * This restores all the caller saved registers - */ - - .section .exceptions.exit.label -.Lexception_exit: - diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_irq_handler.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_irq_handler.c deleted file mode 100644 index 3253d02..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_irq_handler.c +++ /dev/null @@ -1,169 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include "system.h" - -/* - * This interrupt handler only works with an internal interrupt controller - * (IIC). Processors with an external interrupt controller (EIC) use an - * implementation provided by an EIC driver. - */ -#ifndef ALT_CPU_EIC_PRESENT - -#include "sys/alt_irq.h" -#include "os/alt_hooks.h" - -#include "alt_types.h" - -/* - * A table describing each interrupt handler. The index into the array is the - * interrupt id associated with the handler. - * - * When an interrupt occurs, the associated handler is called with - * the argument stored in the context member. - */ -struct ALT_IRQ_HANDLER -{ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - void (*handler)(void*); -#else - void (*handler)(void*, alt_u32); -#endif - void *context; -} alt_irq[ALT_NIRQ]; - -/* - * alt_irq_handler() is called by the interrupt exception handler in order to - * process any outstanding interrupts. - * - * It is defined here since it is linked in using weak linkage. - * This means that if there is never a call to alt_irq_register() (above) then - * this function will not get linked in to the executable. This is acceptable - * since if no handler is ever registered, then an interrupt can never occur. - * - * If Nios II interrupt vector custom instruction exists, use it to accelerate - * the dispatch of interrupt handlers. The Nios II interrupt vector custom - * instruction is present if the macro ALT_CI_INTERRUPT_VECTOR defined. - */ - -void alt_irq_handler (void) __attribute__ ((section (".exceptions"))); -void alt_irq_handler (void) -{ -#ifdef ALT_CI_INTERRUPT_VECTOR - alt_32 offset; - char* alt_irq_base = (char*)alt_irq; -#else - alt_u32 active; - alt_u32 mask; - alt_u32 i; -#endif /* ALT_CI_INTERRUPT_VECTOR */ - - /* - * Notify the operating system that we are at interrupt level. - */ - - ALT_OS_INT_ENTER(); - -#ifdef ALT_CI_INTERRUPT_VECTOR - /* - * Call the interrupt vector custom instruction using the - * ALT_CI_INTERRUPT_VECTOR macro. - * It returns the offset into the vector table of the lowest-valued pending - * interrupt (corresponds to highest priority) or a negative value if none. - * The custom instruction assumes that each table entry is eight bytes. - */ - while ((offset = ALT_CI_INTERRUPT_VECTOR) >= 0) { - struct ALT_IRQ_HANDLER* handler_entry = - (struct ALT_IRQ_HANDLER*)(alt_irq_base + offset); -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - handler_entry->handler(handler_entry->context); -#else - handler_entry->handler(handler_entry->context, offset >> 3); -#endif - } -#else /* ALT_CI_INTERRUPT_VECTOR */ - /* - * Obtain from the interrupt controller a bit list of pending interrupts, - * and then process the highest priority interrupt. This process loops, - * loading the active interrupt list on each pass until alt_irq_pending() - * return zero. - * - * The maximum interrupt latency for the highest priority interrupt is - * reduced by finding out which interrupts are pending as late as possible. - * Consider the case where the high priority interupt is asserted during - * the interrupt entry sequence for a lower priority interrupt to see why - * this is the case. - */ - - active = alt_irq_pending (); - - do - { - i = 0; - mask = 1; - - /* - * Test each bit in turn looking for an active interrupt. Once one is - * found, the interrupt handler asigned by a call to alt_irq_register() is - * called to clear the interrupt condition. - */ - - do - { - if (active & mask) - { -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - alt_irq[i].handler(alt_irq[i].context); -#else - alt_irq[i].handler(alt_irq[i].context, i); -#endif - break; - } - mask <<= 1; - i++; - - } while (1); - - active = alt_irq_pending (); - - } while (active); -#endif /* ALT_CI_INTERRUPT_VECTOR */ - - /* - * Notify the operating system that interrupt processing is complete. - */ - - ALT_OS_INT_EXIT(); -} - -#endif /* ALT_CPU_EIC_PRESENT */ diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_irq_register.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_irq_register.c deleted file mode 100644 index b5ea474..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_irq_register.c +++ /dev/null @@ -1,102 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ -#include -#include "system.h" - -/* - * This interrupt registry mechanism works with the Nios II internal interrupt - * controller (IIC) only. Systems with an external interrupt controller (EIC), - * or those with the IIC who are using the enhanced interrupt API will - * utilize the alt_ic_isr_register() routine to register an interrupt. - */ -#ifndef NIOS2_EIC_PRESENT - -#include "sys/alt_irq.h" -#include "priv/alt_legacy_irq.h" -#include "os/alt_hooks.h" - -#include "alt_types.h" - -/* - * The header, alt_irq_entry.h, contains the exception entry point, and is - * provided by the processor component. It is included here, so that the code - * will be added to the executable only if alt_irq_register() is present, i.e. - * if no interrupts are registered - there's no need to provide any - * interrupt handling. - */ - -#include "sys/alt_irq_entry.h" - -/* - * The header, alt_irq_table.h contains a table describing which function - * handles each interrupt. - */ - -#include "priv/alt_irq_table.h" - -/* - * alt_irq_handler() is called to register an interrupt handler. If the - * function is succesful, then the requested interrupt will be enabled upon - * return. Registering a NULL handler will disable the interrupt. - * - * The return value is 0 if the interrupt handler was registered and the - * interrupt was enabled, otherwise it is negative. - */ - -int alt_irq_register (alt_u32 id, - void* context, - alt_isr_func handler) -{ - int rc = -EINVAL; - alt_irq_context status; - - if (id < ALT_NIRQ) - { - /* - * interrupts are disabled while the handler tables are updated to ensure - * that an interrupt doesn't occur while the tables are in an inconsistant - * state. - */ - - status = alt_irq_disable_all (); - - alt_irq[id].handler = handler; - alt_irq[id].context = context; - - rc = (handler) ? alt_irq_enable (id): alt_irq_disable (id); - - alt_irq_enable_all(status); - } - return rc; -} -#endif /* NIOS2_EIC_PRESENT */ - diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_irq_vars.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_irq_vars.c deleted file mode 100644 index 8c0a18d..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_irq_vars.c +++ /dev/null @@ -1,47 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "alt_types.h" - -#include "system.h" - -/* - * These global variables are used to save the current list of enabled - * interrupts. See alt_irq.h for further details. - */ - -volatile alt_u32 alt_irq_active = 0; - -#ifndef ALT_EXCEPTION_STACK - -volatile alt_u32 alt_priority_mask = (alt_u32) -1; - -#endif - diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_isatty.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_isatty.c deleted file mode 100644 index 9276472..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_isatty.c +++ /dev/null @@ -1,125 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include "sys/alt_dev.h" -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -#ifdef ALT_USE_DIRECT_DRIVERS - -#include "system.h" - -/* - * Provide minimal version that just describes all file descriptors - * as tty devices for provided stdio devices. - */ -int ALT_ISATTY (int file) -{ - switch (file) { -#ifdef ALT_STDIN_PRESENT - case 0: /* stdin file descriptor */ -#endif /* ALT_STDIN_PRESENT */ -#ifdef ALT_STDOUT_PRESENT - case 1: /* stdout file descriptor */ -#endif /* ALT_STDOUT_PRESENT */ -#ifdef ALT_STDERR_PRESENT - case 2: /* stderr file descriptor */ -#endif /* ALT_STDERR_PRESENT */ - return 1; - default: - return 0; - } - -#if !defined(ALT_STDIN_PRESENT) && !defined(ALT_STDOUT_PRESENT) && !defined(ALT_STDERR_PRESENT) - /* Generate a link time warning, should this function ever be called. */ - ALT_STUB_WARNING(isatty); -#endif -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ -/* - * isatty() can be used to determine whether the input file descriptor "file" - * refers to a terminal device or not. If it is a terminal device then the - * return value is one, otherwise it is zero. - * - * ALT_ISATTY is mapped onto the isatty() system call in alt_syscall.h - */ - -int ALT_ISATTY (int file) -{ - alt_fd* fd; - struct stat stat; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - /* - * If a device driver does not provide an fstat() function, then it is - * treated as a terminal device by default. - */ - - if (!fd->dev->fstat) - { - return 1; - } - - /* - * If a driver does provide an implementation of the fstat() function, then - * this is called so that the device can identify itself. - */ - - else - { - fstat (file, &stat); - return (stat.st_mode == _IFCHR) ? 1 : 0; - } - } - else - { - ALT_ERRNO = EBADFD; - return 0; - } -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_kill.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_kill.c deleted file mode 100644 index 42c2e1d..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_kill.c +++ /dev/null @@ -1,121 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include "sys/alt_errno.h" -#include "os/alt_syscall.h" - - -/* - * kill() is used by newlib in order to send signals to processes. Since there - * is only a single process in the HAL, the only valid values for pid are - * either the current process id, or the broadcast values, i.e. pid must be - * less than or equal to zero. - * - * ALT_KILL is mapped onto the kill() system call in alt_syscall.h - */ - -int ALT_KILL (int pid, int sig) -{ - int status = 0; - - if (pid <= 0) - { - switch (sig) - { - case 0: - - /* The null signal is used to check that a pid is valid. */ - - break; - - case SIGABRT: - case SIGALRM: - case SIGFPE: - case SIGILL: - case SIGKILL: - case SIGPIPE: - case SIGQUIT: - case SIGSEGV: - case SIGTERM: - case SIGUSR1: - case SIGUSR2: - case SIGBUS: - case SIGPOLL: - case SIGPROF: - case SIGSYS: - case SIGTRAP: - case SIGVTALRM: - case SIGXCPU: - case SIGXFSZ: - - /* - * The Posix standard defines the default behaviour for all these signals - * as being eqivalent to a call to _exit(). No mechanism is provided to - * change this behaviour. - */ - - _exit(0); - case SIGCHLD: - case SIGURG: - - /* - * The Posix standard defines these signals to be ignored by default. No - * mechanism is provided to change this behaviour. - */ - - break; - default: - - /* Tried to send an unsupported signal */ - - status = EINVAL; - } - } - - else if (pid > 0) - { - /* Attempted to signal a non-existant process */ - - status = ESRCH; - } - - if (status) - { - ALT_ERRNO = status; - return -1; - } - - return 0; -} diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_link.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_link.c deleted file mode 100644 index d796c59..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_link.c +++ /dev/null @@ -1,56 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_warning.h" -#include "sys/alt_errno.h" -#include "os/alt_syscall.h" - -/* - * link() is used by newlib to create a new link to an existing file. This is - * unsupported in the HAL environment. However a "do-nothing" implementation - * is still provied for newlib compatability. - * - * ALT_LINK is mapped onto the link() system call in alt_syscall.h - */ - -int ALT_LINK ( char *existing, char *new) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(link); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} - diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_load.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_load.c deleted file mode 100644 index ffab4b9..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_load.c +++ /dev/null @@ -1,88 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_load.h" -#include "sys/alt_cache.h" - -/* - * Linker defined symbols. - */ - -extern void __flash_rwdata_start; -extern void __ram_rwdata_start; -extern void __ram_rwdata_end; -extern void __flash_rodata_start; -extern void __ram_rodata_start; -extern void __ram_rodata_end; -extern void __flash_exceptions_start; -extern void __ram_exceptions_start; -extern void __ram_exceptions_end; - -/* - * alt_load() is called when the code is executing from flash. In this case - * there is no bootloader, so this application is responsible for loading to - * RAM any sections that are required. - */ - -void alt_load (void) -{ - /* - * Copy the .rwdata section. - */ - - alt_load_section (&__flash_rwdata_start, - &__ram_rwdata_start, - &__ram_rwdata_end); - - /* - * Copy the exception handler. - */ - - alt_load_section (&__flash_exceptions_start, - &__ram_exceptions_start, - &__ram_exceptions_end); - - /* - * Copy the .rodata section. - */ - - alt_load_section (&__flash_rodata_start, - &__ram_rodata_start, - &__ram_rodata_end); - - /* - * Now ensure that the caches are in synch. - */ - - alt_dcache_flush_all(); - alt_icache_flush_all(); -} diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_log_macro.S b/software/qsys_tutorial_green_bsp/HAL/src/alt_log_macro.S deleted file mode 100644 index 499c4ad..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_log_macro.S +++ /dev/null @@ -1,56 +0,0 @@ -/* alt_log_macro.S - * - * Implements the function tx_log_str, called by the assembly macro - * ALT_LOG_PUTS(). The macro will be empty when logging is turned off, - * and this function will not be compiled. When logging is on, - * this function is used to print out the strings defined in the beginning - * of alt_log_printf.c, using port information taken from system.h and - * alt_log_printf.h. - * - * This routine only handles strings, and sends a character into the defined - * output device's output buffer when the device is ready. It's intended for - * debugging purposes, where messages can be set to print out at certain - * points in the boot code to indicate the progress of the program. - * - */ - -#ifndef __ALT_LOG_MACROS__ -#define __ALT_LOG_MACROS__ - -/* define this flag to skip assembly-incompatible parts - * of various include files. */ -#define ALT_ASM_SRC - -#ifdef ALT_LOG_ENABLE // only compile this function if this flag is defined. - - #include "system.h" - #include "sys/alt_log_printf.h" - - .global tx_log_str -tx_log_str: - /* load base uart / jtag uart address into r6 */ - movhi r6, %hiadj(ALT_LOG_PORT_BASE) - addi r6, r6, %lo(ALT_LOG_PORT_BASE) -tx_next_char: - /* if pointer points to null, return - * r4 is the pointer to the str to be printed, set by ALT_LOG_PUTS */ - ldb r7, (r4) - beq r0, r7, end_tx - - /* check device transmit ready */ -wait_tx_ready_loop: - ldwio r5, ALT_LOG_PRINT_REG_OFFSET(r6) - andi r5, r5, ALT_LOG_PRINT_MSK - beq r5, r0, wait_tx_ready_loop - /* write char */ - stwio r7, ALT_LOG_PRINT_TXDATA_REG_OFFSET (r6) - /* advance string pointer */ - addi r4, r4, 1 - br tx_next_char -end_tx: - ret - -#endif - -#endif /* __ALT_LOG_MACROS__ */ - diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_log_printf.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_log_printf.c deleted file mode 100644 index 1f7056d..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_log_printf.c +++ /dev/null @@ -1,479 +0,0 @@ - -/* alt_log_printf.c - * - * This file implements the various C functions used for the - * alt_log logging/debugging print functions. The functions - * sit as is here - the job of hiding them from the compiler - * if logging is disabled is accomplished in the .h file. - * - * All the global variables for alt_log are defined here. - * These include the various flags that turn on additional - * logging options; the strings for assembly printing; and - * other globals needed by different logging options. - * - * There are 4 functions that handle the actual printing: - * alt_log_txchar: Actual function that puts 1 char to UART/JTAG UART. - * alt_log_repchar: Calls alt_log_txchar 'n' times - used by - * alt_log_private_printf for formatting. - * alt_log_private_printf: - * Stripped down implementation of printf - no floats. - * alt_log_printf_proc: - * Wrapper function for private_printf. - * - * The rest of the functions are called by the macros which - * were called by code in the other components. Each function - * is preceded by a comment, about which file it gets called - * in, and what its purpose is. - * - * author: gkwan - */ - -/* skip all code if enable is off */ -#ifdef ALT_LOG_ENABLE - -#include -#include -#include -#ifdef __ALTERA_AVALON_JTAG_UART - #include "altera_avalon_jtag_uart.h" - #include -#endif -#include "sys/alt_log_printf.h" - -/* strings for assembly puts */ -char alt_log_msg_bss[] = "[crt0.S] Clearing BSS \r\n";; -char alt_log_msg_alt_main[] = "[crt0.S] Calling alt_main.\r\n"; -char alt_log_msg_stackpointer[] \ - = "[crt0.S] Setting up stack and global pointers.\r\n"; -char alt_log_msg_cache[] = "[crt0.S] Inst & Data Cache Initialized.\r\n"; -/* char array allocation for alt_write */ -char alt_log_write_buf[ALT_LOG_WRITE_ECHO_LEN+2]; - -/* global variables for all 'on' flags */ - -/* - * The boot message flag is linked into the data (rwdata) section - * because if it is zero, it would otherwise be placed in the bss section. - * alt_log examines this variable before the BSS is cleared in the boot-up - * process. - */ -volatile alt_u32 alt_log_boot_on_flag \ - __attribute__ ((section (".data"))) = ALT_LOG_BOOT_ON_FLAG_SETTING; - -volatile alt_u8 alt_log_write_on_flag = ALT_LOG_WRITE_ON_FLAG_SETTING; - -volatile alt_u8 alt_log_sys_clk_on_flag = ALT_LOG_SYS_CLK_ON_FLAG_SETTING; - -volatile alt_u8 alt_log_jtag_uart_alarm_on_flag = \ - ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING; - -volatile alt_u8 alt_log_jtag_uart_isr_on_flag = \ - ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING; - -volatile alt_u8 alt_log_jtag_uart_startup_info_on_flag = \ - ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING; - -/* Global alarm object for recurrent JTAG UART status printing */ -alt_alarm alt_log_jtag_uart_alarm_1; - -/* Global ints for system clock printing and count */ -volatile int alt_log_sys_clk_count; -volatile int alt_system_clock_in_sec; - -/* enum used by alt_log_private_printf */ -enum -{ - pfState_chars, - pfState_firstFmtChar, - pfState_otherFmtChar -}; - - - - -/* Function to put one char onto the UART/JTAG UART txdata register. */ -void alt_log_txchar(int c,char *base) -{ - /* Wait until the device is ready for a character */ - while((ALT_LOG_PRINT_REG_RD(base) & ALT_LOG_PRINT_MSK) == 0) - ; - /* And pop the character into the register */ - ALT_LOG_PRINT_TXDATA_WR(base,c); -} - - -/* Called by alt_log_private_printf to print out characters repeatedly */ -void alt_log_repchar(char c,int r,int base) -{ - while(r-- > 0) - alt_log_txchar(c,(char*) base); -} - - -/* Stripped down printf function */ -void alt_log_private_printf(const char *fmt,int base,va_list args) - { - const char *w; - char c; - int state; - int fmtLeadingZero = 0; /* init these all to 0 for -W warnings. */ - int fmtLong = 0; - int fmtBeforeDecimal = 0; - int fmtAfterDecimal = 0; - int fmtBase = 0; - int fmtSigned = 0; - int fmtCase = 0; /* For hex format, if 1, A-F, else a-f. */ - - w = fmt; - state = pfState_chars; - - while(0 != (c = *w++)) - { - switch(state) - { - case pfState_chars: - if(c == '%') - { - fmtLeadingZero = 0; - fmtLong = 0; - fmtBase = 10; - fmtSigned = 1; - fmtCase = 0; /* Only %X sets this. */ - fmtBeforeDecimal = -1; - fmtAfterDecimal = -1; - state = pfState_firstFmtChar; - } - else - { - alt_log_txchar(c,(char*)base); - } - break; - - case pfState_firstFmtChar: - if(c == '0') - { - fmtLeadingZero = 1; - state = pfState_otherFmtChar; - } - else if(c == '%') - { - alt_log_txchar(c,(char*)base); - state = pfState_chars; - } - else - { - state = pfState_otherFmtChar; - goto otherFmtChar; - } - break; - - case pfState_otherFmtChar: -otherFmtChar: - if(c == '.') - { - fmtAfterDecimal = 0; - } - else if('0' <= c && c <= '9') - { - c -= '0'; - if(fmtAfterDecimal < 0) /* still before decimal */ - { - if(fmtBeforeDecimal < 0) - { - fmtBeforeDecimal = 0; - } - else - { - fmtBeforeDecimal *= 10; - } - fmtBeforeDecimal += c; - } - else - { - fmtAfterDecimal = (fmtAfterDecimal * 10) + c; - } - } - else if(c == 'l') - { - fmtLong = 1; - } - else /* we're up to the letter which determines type */ - { - switch(c) - { - case 'd': - case 'i': -doIntegerPrint: - { - unsigned long v; - unsigned long p; /* biggest power of fmtBase */ - unsigned long vShrink; /* used to count digits */ - int sign; - int digitCount; - - /* Get the value */ - if(fmtLong) - { - if (fmtSigned) - { - v = va_arg(args,long); - } - else - { - v = va_arg(args,unsigned long); - } - } - else - { - if (fmtSigned) - { - v = va_arg(args,int); - } - else - { - v = va_arg(args,unsigned int); - } - } - - /* Strip sign */ - sign = 0; - /* (assumes sign bit is #31) */ - if( fmtSigned && (v & (0x80000000)) ) - { - v = ~v + 1; - sign = 1; - } - - /* Count digits, and get largest place value */ - vShrink = v; - p = 1; - digitCount = 1; - while( (vShrink = vShrink / fmtBase) > 0 ) - { - digitCount++; - p *= fmtBase; - } - - /* Print leading characters & sign */ - fmtBeforeDecimal -= digitCount; - if(fmtLeadingZero) - { - if(sign) - { - alt_log_txchar('-',(char*)base); - fmtBeforeDecimal--; - } - alt_log_repchar('0',fmtBeforeDecimal,base); - } - else - { - if(sign) - { - fmtBeforeDecimal--; - } - alt_log_repchar(' ',fmtBeforeDecimal,base); - if(sign) - { - alt_log_txchar('-',(char*)base); - } - } - - /* Print numbery parts */ - while(p) - { - unsigned char d; - - d = v / p; - d += '0'; - if(d > '9') - { - d += (fmtCase ? 'A' : 'a') - '0' - 10; - } - alt_log_txchar(d,(char*)base); - - v = v % p; - p = p / fmtBase; - } - } - - state = pfState_chars; - break; - - case 'u': - fmtSigned = 0; - goto doIntegerPrint; - case 'o': - fmtSigned = 0; - fmtBase = 8; - goto doIntegerPrint; - case 'x': - fmtSigned = 0; - fmtBase = 16; - goto doIntegerPrint; - case 'X': - fmtSigned = 0; - fmtBase = 16; - fmtCase = 1; - goto doIntegerPrint; - - case 'c': - alt_log_repchar(' ',fmtBeforeDecimal-1,base); - alt_log_txchar(va_arg(args,int),(char*)base); - break; - - case 's': - { - char *s; - - s = va_arg(args,char *); - alt_log_repchar(' ',fmtBeforeDecimal-strlen(s),base); - - while(*s) - alt_log_txchar(*s++,(char*)base); - } - break; - } /* switch last letter of fmt */ - state=pfState_chars; - } - break; - } /* switch */ - } /* while chars left */ - } /* printf */ - -/* Main logging printf function */ -int alt_log_printf_proc(const char *fmt, ... ) -{ - va_list args; - - va_start (args, fmt); - alt_log_private_printf(fmt,ALT_LOG_PORT_BASE,args); - return (0); -} - -/* Below are the functions called by different macros in various components. */ - -/* If the system has a JTAG_UART, include JTAG_UART debugging functions */ -#ifdef __ALTERA_AVALON_JTAG_UART - -/* The alarm function in altera_avalon_jtag_uart.c. - * This function, when turned on, prints out the status - * of the JTAG UART Control register, every ALT_LOG_JTAG_UART_TICKS. - * If the flag is off, the alarm should never be registered, and this - * function should never run */ -alt_u32 altera_avalon_jtag_uart_report_log(void * context) -{ - if (alt_log_jtag_uart_alarm_on_flag) { - altera_avalon_jtag_uart_state* dev = (altera_avalon_jtag_uart_state*) context; - const char* header="JTAG Alarm:"; - alt_log_jtag_uart_print_control_reg(dev, dev->base, header); - return ALT_LOG_JTAG_UART_TICKS; - } - else - { - /* If flag is not on, return 0 to disable future alarms. - * Should never be here, alarm should not be enabled at all. */ - return 0; - } -} - -void alt_log_jtag_uart_print_control_reg(altera_avalon_jtag_uart_state* dev, int base, const char* header) -{ - unsigned int control, space, ac, wi, ri, we, re; - control = IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base); - space = (control & ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_MSK) >> - ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_OFST; - we= (control & ALTERA_AVALON_JTAG_UART_CONTROL_WE_MSK) >> - ALTERA_AVALON_JTAG_UART_CONTROL_WE_OFST; - re= (control & ALTERA_AVALON_JTAG_UART_CONTROL_RE_MSK) >> - ALTERA_AVALON_JTAG_UART_CONTROL_RE_OFST; - ri= (control & ALTERA_AVALON_JTAG_UART_CONTROL_RI_MSK) >> - ALTERA_AVALON_JTAG_UART_CONTROL_RI_OFST; - wi= (control & ALTERA_AVALON_JTAG_UART_CONTROL_WI_MSK) >> - ALTERA_AVALON_JTAG_UART_CONTROL_WI_OFST; - ac= (control & ALTERA_AVALON_JTAG_UART_CONTROL_AC_MSK) >> - ALTERA_AVALON_JTAG_UART_CONTROL_AC_OFST; - -#ifdef ALTERA_AVALON_JTAG_UART_SMALL - ALT_LOG_PRINTF( - "%s HW FIFO wspace=%d AC=%d WI=%d RI=%d WE=%d RE=%d\r\n", - header,space,ac,wi,ri,we,re); -#else - ALT_LOG_PRINTF( - "%s SW CirBuf = %d, HW FIFO wspace=%d AC=%d WI=%d RI=%d WE=%d RE=%d\r\n", - header,(dev->tx_out-dev->tx_in),space,ac,wi,ri,we,re); -#endif - - return; - -} - -/* In altera_avalon_jtag_uart.c - * Same output as the alarm function above, but this is called in the driver - * init function. Hence, it gives the status of the JTAG UART control register - * right at the initialization of the driver */ -void alt_log_jtag_uart_startup_info(altera_avalon_jtag_uart_state* dev, int base) -{ - const char* header="JTAG Startup Info:"; - alt_log_jtag_uart_print_control_reg(dev, base, header); - return; -} - -/* In altera_avalon_jtag_uart.c - * When turned on, this function will print out the status of the jtag uart - * control register every time there is a jtag uart "almost-empty" interrupt. */ -void alt_log_jtag_uart_isr_proc(int base, altera_avalon_jtag_uart_state* dev) -{ - if (alt_log_jtag_uart_isr_on_flag) { - const char* header="JTAG IRQ:"; - alt_log_jtag_uart_print_control_reg(dev, base, header); - } - return; -} - -#endif /* __ALTERA_AVALON_JTAG_UART */ - -/* In alt_write.c - * When the alt_log_write_on_flag is turned on, this function gets called - * every time alt_write gets called. The first - * ALT_LOG_WRITE_ECHO_LEN characters of every printf command (or any command - * that eventually calls write()) gets echoed to the alt_log output. */ -void alt_log_write(const void *ptr, size_t len) -{ - if (alt_log_write_on_flag) { - int temp_cnt; - int length=(ALT_LOG_WRITE_ECHO_LEN>len) ? len : ALT_LOG_WRITE_ECHO_LEN; - - if (length < 2) return; - - strncpy (alt_log_write_buf,ptr,length); - alt_log_write_buf[length-1]='\n'; - alt_log_write_buf[length]='\r'; - alt_log_write_buf[length+1]='\0'; - - /* Escape Ctrl-D's. If the Ctrl-D gets sent it might kill the terminal - * connection of alt_log. It will get replaced by 'D'. */ - for (temp_cnt=0;temp_cnt < length; temp_cnt++) { - if (alt_log_write_buf[temp_cnt]== 0x4) { - alt_log_write_buf[temp_cnt]='D'; - } - } - ALT_LOG_PRINTF("Write Echo: %s",alt_log_write_buf); - } -} - -/* In altera_avalon_timer_sc - * This function prints out a system clock is alive message - * every ALT_LOG_SYS_CLK_INTERVAL (in ticks). */ -void alt_log_system_clock() -{ - if (alt_log_sys_clk_on_flag) { - alt_log_sys_clk_count++; - if (alt_log_sys_clk_count > ALT_LOG_SYS_CLK_INTERVAL) { - alt_log_sys_clk_count = 0; - ALT_LOG_PRINTF("System Clock On %u\r\n",alt_system_clock_in_sec++); - } - } -} - - -#endif diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_lseek.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_lseek.c deleted file mode 100644 index 7857b0d..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_lseek.c +++ /dev/null @@ -1,117 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -#ifdef ALT_USE_DIRECT_DRIVERS - -off_t ALT_LSEEK (int file, off_t ptr, int dir) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(lseek); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -/* - * lseek() can be called to move the read/write pointer associated with the - * file descriptor "file". This function simply vectors the call to the lseek() - * function provided by the driver associated with the file descriptor. - * - * If the driver does not provide an implementation of lseek() an error is - * indicated. - * - * lseek() corresponds to the standard lseek() function. - * - * ALT_LSEEK is mapped onto the lseek() system call in alt_syscall.h - * - */ - -off_t ALT_LSEEK (int file, off_t ptr, int dir) -{ - alt_fd* fd; - off_t rc = 0; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - /* - * If the device driver provides an implementation of the lseek() function, - * then call that to process the request. - */ - - if (fd->dev->lseek) - { - rc = fd->dev->lseek(fd, ptr, dir); - } - /* - * Otherwise return an error. - */ - - else - { - rc = -ENOTSUP; - } - } - else - { - rc = -EBADFD; - } - - if (rc < 0) - { - ALT_ERRNO = -rc; - rc = -1; - } - - return rc; -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_main.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_main.c deleted file mode 100644 index a96229b..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_main.c +++ /dev/null @@ -1,161 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include -#include -#include -#include - -#include "sys/alt_dev.h" -#include "sys/alt_sys_init.h" -#include "sys/alt_irq.h" -#include "sys/alt_dev.h" - -#include "os/alt_hooks.h" - -#include "priv/alt_file.h" -#include "alt_types.h" - -#include "system.h" - -#include "sys/alt_log_printf.h" - -extern void _do_ctors(void); -extern void _do_dtors(void); - -/* - * Standard arguments for main. By default, no arguments are passed to main. - * However a device driver may choose to configure these arguments by calling - * alt_set_args(). The expectation is that this facility will only be used by - * the iclient/ihost utility. - */ - -int alt_argc = 0; -char** alt_argv = {NULL}; -char** alt_envp = {NULL}; - -/* - * Prototype for the entry point to the users application. - */ - -extern int main (int, char **, char **); - -/* - * alt_main is the C entry point for the HAL. It is called by the assembler - * startup code in the processor specific crt0.S. It is responsible for: - * completing the C runtime configuration; configuring all the - * devices/filesystems/components in the system; and call the entry point for - * the users application, i.e. main(). - */ - -void alt_main (void) -{ -#ifndef ALT_NO_EXIT - int result; -#endif - - /* ALT LOG - please see HAL/sys/alt_log_printf.h for details */ - ALT_LOG_PRINT_BOOT("[alt_main.c] Entering alt_main, calling alt_irq_init.\r\n"); - /* Initialize the interrupt controller. */ - alt_irq_init (NULL); - - /* Initialize the operating system */ - ALT_LOG_PRINT_BOOT("[alt_main.c] Done alt_irq_init, calling alt_os_init.\r\n"); - ALT_OS_INIT(); - - /* - * Initialize the semaphore used to control access to the file descriptor - * list. - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Done OS Init, calling alt_sem_create.\r\n"); - ALT_SEM_CREATE (&alt_fd_list_lock, 1); - - /* Initialize the device drivers/software components. */ - ALT_LOG_PRINT_BOOT("[alt_main.c] Calling alt_sys_init.\r\n"); - alt_sys_init(); - ALT_LOG_PRINT_BOOT("[alt_main.c] Done alt_sys_init.\r\n"); - -#if !defined(ALT_USE_DIRECT_DRIVERS) && (defined(ALT_STDIN_PRESENT) || defined(ALT_STDOUT_PRESENT) || defined(ALT_STDERR_PRESENT)) - - /* - * Redirect stdio to the apropriate devices now that the devices have - * been initialized. This is only done if the user has requested these - * devices be present (not equal to /dev/null) and if direct drivers - * aren't being used. - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Redirecting IO.\r\n"); - alt_io_redirect(ALT_STDOUT, ALT_STDIN, ALT_STDERR); -#endif - -#ifndef ALT_NO_C_PLUS_PLUS - /* - * Call the C++ constructors - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Calling C++ constructors.\r\n"); - _do_ctors (); -#endif /* ALT_NO_C_PLUS_PLUS */ - -#if !defined(ALT_NO_C_PLUS_PLUS) && !defined(ALT_NO_CLEAN_EXIT) && !defined(ALT_NO_EXIT) - /* - * Set the C++ destructors to be called at system shutdown. This is only done - * if a clean exit has been requested (i.e. the exit() function has not been - * redefined as _exit()). This is in the interest of reducing code footprint, - * in that the atexit() overhead is removed when it's not needed. - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Calling atexit.\r\n"); - atexit (_do_dtors); -#endif - - /* - * Finally, call main(). The return code is then passed to a subsequent - * call to exit() unless the application is never supposed to exit. - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Calling main.\r\n"); - -#ifdef ALT_NO_EXIT - main (alt_argc, alt_argv, alt_envp); -#else - result = main (alt_argc, alt_argv, alt_envp); - close(STDOUT_FILENO); - exit (result); -#endif - - ALT_LOG_PRINT_BOOT("[alt_main.c] After main - we should not be here?.\r\n"); -} - diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_malloc_lock.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_malloc_lock.c deleted file mode 100644 index 8c78f46..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_malloc_lock.c +++ /dev/null @@ -1,52 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -/* - * These are the empty malloc lock/unlock stubs required by newlib. These are - * used to make newlib's malloc() function thread safe. The default HAL - * configuration is single threaded, so there is nothing to do here. Note that - * this requires that malloc is never called by an interrupt service routine. - */ - -void __malloc_lock ( struct _reent *_r ) -{ -} - -/* - * - */ - -void __malloc_unlock ( struct _reent *_r ) -{ -} diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_mcount.S b/software/qsys_tutorial_green_bsp/HAL/src/alt_mcount.S deleted file mode 100644 index 3837523..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_mcount.S +++ /dev/null @@ -1,198 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2010 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* mcount or _mcount is inserted by GCC before the function prologue of every - * function when a program is compiled for profiling. At the start of mcount, - * we guarantee that: - * ra = self_pc (an address in the function which called mcount) - * r8 = from_pc (an address in the function which called mcount's caller) - * - * Because this is always called at the start of a function we can corrupt - * r2,r3 and r11-r15. We must not corrupt r4-r7 (because they might contain - * function arguments for the instrumented function) or r8 (which holds ra - * for the instrumented function). - */ - - .global __mcount_fn_head - - .global mcount - - /* _mcount is used by gcc4 */ - .global _mcount - -_mcount: -mcount: - /* Use a hash to speed up locating fn_entry. We use bits 5 upwards to choose - * the bucket because bits 1:0 will always be 0, and because the distribution - * of values for bits 4:2 won't be even (aligning on cache line boundaries - * will skew it). Higher bits should be fairly random. - */ - /* fn_head = mcount_fn_head + (((unsigned int)self_pc >> 5) & (HASH_BUCKETS - 1)); */ - - srli r2, ra, 3 - movhi r3, %hiadj(__mcount_fn_head) - addi r3, r3, %lo(__mcount_fn_head) - andi r2, r2, 0xFC - add r11, r2, r3 - - /* The fast case is where we have already allocated a function arc, and so - * also a function pointer. - */ - - /* First find the function being called (using self_pc) */ - mov r10, r11 -0: - ldw r10, 0(r10) - beq r10, zero, .Lnew_arc - ldw r2, 4(r10) - bne r2, ra, 0b - - /* Found a function entry for this PC. Now look for an arc with a matching - * from_pc value. There will always be at least one arc. */ - ldw r3, 8(r10) -0: - ldw r2, 4(r3) - beq r2, r8, .Lfound_arc - ldw r3, 0(r3) - bne r3, zero, 0b - -.Lnew_arc: - addi sp, sp, -24 - -.LCFI0: - stw ra, 0(sp) - stw r4, 4(sp) - stw r5, 8(sp) - stw r6, 12(sp) - stw r7, 16(sp) - stw r8, 20(sp) - -.LCFI1: - /* __mcount_record(orig_ra, orig_r8, fn_entry, *fn_head); */ - mov r4, ra - mov r5, r8 - mov r6, r10 - mov r7, r11 - call __mcount_record - - /* restore registers from the stack */ - ldw ra, 0(sp) - ldw r4, 4(sp) - ldw r5, 8(sp) - ldw r6, 12(sp) - ldw r7, 16(sp) - ldw r8, 20(sp) - - addi sp, sp, 24 - -.LCFI2: - ret - -.Lfound_arc: - /* We've found the correct arc record. Increment the count and return */ - ldw r2, 8(r3) - addi r2, r2, 1 - stw r2, 8(r3) - ret - -.Lmcount_end: - - - -/* - * Dwarf2 debug information for the function. This provides GDB with the - * information it needs to backtrace out of this function. - */ - - .section .debug_frame,"",@progbits -.LCIE: - .4byte 2f - 1f /* Length */ -1: - .4byte 0xffffffff /* CIE id */ - .byte 0x1 /* Version */ - .string "" /* Augmentation */ - .uleb128 0x1 /* Code alignment factor */ - .sleb128 -4 /* Data alignment factor */ - .byte 0x1f /* Return address register */ - - .byte 0xc /* Define CFA */ - .uleb128 0x1b /* Register 27 (sp) */ - .uleb128 0x0 /* Offset 0 */ - - .align 2 /* Padding */ -2: - -.LFDE_mcount: - .4byte 2f - 1f /* Length */ -1: - .4byte .LCIE /* Pointer to CIE */ - .4byte mcount /* Start of table entry */ - .4byte .Lmcount_end - mcount /* Size of table entry */ - - .byte 0x4 /* Advance location */ - .4byte .LCFI0 - mcount /* to .LCFI0 */ - .byte 0xe /* Define CFA offset */ - .uleb128 24 /* to 24 */ - - .byte 0x4 /* Advance location */ - .4byte .LCFI1 - .LCFI0 /* to .LCFI1 */ - .byte 0x9f /* Store ra */ - .uleb128 0x6 /* at CFA-24 */ - .byte 0x84 /* Store r4 */ - .uleb128 0x5 /* at CFA-20 */ - .byte 0x85 /* Store r5 */ - .uleb128 0x4 /* at CFA-16 */ - .byte 0x86 /* Store r6 */ - .uleb128 0x3 /* at CFA-12 */ - .byte 0x87 /* Store r7 */ - .uleb128 0x2 /* at CFA-8 */ - .byte 0x88 /* Store r8 */ - .uleb128 0x1 /* at CFA-4 */ - - .byte 0x4 /* Advance location */ - .4byte .LCFI2 - .LCFI1 /* to .LCFI2 */ - .byte 0xe /* Define CFA offset */ - .uleb128 0 /* to 0 */ - .byte 0x8 /* Same value */ - .uleb128 31 /* for ra */ - .byte 0x8 /* Same value */ - .uleb128 4 /* for r4 */ - .byte 0x8 /* Same value */ - .uleb128 5 /* for r5 */ - .byte 0x8 /* Same value */ - .uleb128 6 /* for r6 */ - .byte 0x8 /* Same value */ - .uleb128 7 /* for r7 */ - .byte 0x8 /* Same value */ - .uleb128 8 /* for r8 */ - - .align 2 -2: - diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_open.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_open.c deleted file mode 100644 index 4790f53..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_open.c +++ /dev/null @@ -1,173 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "alt_types.h" -#include "os/alt_syscall.h" - -#ifdef ALT_USE_DIRECT_DRIVERS - -int ALT_OPEN (const char* file, int flags, int mode) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(open); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -extern alt_llist alt_dev_list; - -/* - * alt_file_locked() is used by open() to ensure that a device has not been - * previously locked for exclusive access using ioctl(). This test is only - * performed for devices. Filesystems are required to handle the ioctl() call - * themselves, and report the error from the filesystems open() function. - */ - -static int alt_file_locked (alt_fd* fd) -{ - alt_u32 i; - - /* - * Mark the file descriptor as belonging to a device. - */ - - fd->fd_flags |= ALT_FD_DEV; - - /* - * Loop through all current file descriptors searching for one that's locked - * for exclusive access. If a match is found, generate an error. - */ - - for (i = 0; i <= alt_max_fd; i++) - { - if ((alt_fd_list[i].dev == fd->dev) && - (alt_fd_list[i].fd_flags & ALT_FD_EXCL) && - (&alt_fd_list[i] != fd)) - { - return -EACCES; - } - } - - /* The device is not locked */ - - return 0; -} - -/* - * open() is called in order to get a file descriptor that reference the file - * or device named "name". This descriptor can then be used to manipulate the - * file/device using the standard system calls, e.g. write(), read(), ioctl() - * etc. - * - * This is equivalent to the standard open() system call. - * - * ALT_OPEN is mapped onto the open() system call in alt_syscall.h - */ - -int ALT_OPEN (const char* file, int flags, int mode) -{ - alt_dev* dev; - alt_fd* fd; - int index = -1; - int status = -ENODEV; - int isafs = 0; - - /* - * Check the device list, to see if a device with a matching name is - * registered. - */ - - if (!(dev = alt_find_dev (file, &alt_dev_list))) - { - /* No matching device, so try the filesystem list */ - - dev = alt_find_file (file); - isafs = 1; - } - - /* - * If a matching device or filesystem is found, allocate a file descriptor. - */ - - if (dev) - { - if ((index = alt_get_fd (dev)) < 0) - { - status = index; - } - else - { - fd = &alt_fd_list[index]; - fd->fd_flags = (flags & ~ALT_FD_FLAGS_MASK); - - /* If this is a device, ensure it isn't already locked */ - - if (isafs || ((status = alt_file_locked (fd)) >= 0)) - { - /* - * If the device or filesystem provides an open() callback function, - * call it now to perform any device/filesystem specific operations. - */ - - status = (dev->open) ? dev->open(fd, file, flags, mode): 0; - } - } - } - else - { - status = -ENODEV; - } - - /* Allocation failed, so clean up and return an error */ - - if (status < 0) - { - alt_release_fd (index); - ALT_ERRNO = -status; - return -1; - } - - /* return the reference upon success */ - - return index; -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_printf.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_printf.c deleted file mode 100644 index e742b57..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_printf.c +++ /dev/null @@ -1,127 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/* - * This file provides a very minimal printf implementation for use with very - * small applications. Only the following format strings are supported: - * %x - * %s - * %c - * %% - */ - -#include -#include "sys/alt_stdio.h" - -/* - * ALT printf function - */ -void -alt_printf(const char* fmt, ... ) -{ - va_list args; - va_start(args, fmt); - const char *w; - char c; - - /* Process format string. */ - w = fmt; - while ((c = *w++) != 0) - { - /* If not a format escape character, just print */ - /* character. Otherwise, process format string. */ - if (c != '%') - { - alt_putchar(c); - } - else - { - /* Get format character. If none */ - /* available, processing is complete. */ - if ((c = *w++) != 0) - { - if (c == '%') - { - /* Process "%" escape sequence. */ - alt_putchar(c); - } - else if (c == 'c') - { - int v = va_arg(args, int); - alt_putchar(v); - } - else if (c == 'x') - { - /* Process hexadecimal number format. */ - unsigned long v = va_arg(args, unsigned long); - unsigned long digit; - int digit_shift; - - /* If the number value is zero, just print and continue. */ - if (v == 0) - { - alt_putchar('0'); - continue; - } - - /* Find first non-zero digit. */ - digit_shift = 28; - while (!(v & (0xF << digit_shift))) - digit_shift -= 4; - - /* Print digits. */ - for (; digit_shift >= 0; digit_shift -= 4) - { - digit = (v & (0xF << digit_shift)) >> digit_shift; - if (digit <= 9) - c = '0' + digit; - else - c = 'a' + digit - 10; - alt_putchar(c); - } - } - else if (c == 's') - { - /* Process string format. */ - char *s = va_arg(args, char *); - - while(*s) - alt_putchar(*s++); - } - } - else - { - break; - } - } - } -} diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_putchar.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_putchar.c deleted file mode 100644 index badaa02..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_putchar.c +++ /dev/null @@ -1,59 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#ifdef ALT_USE_DIRECT_DRIVERS -#include "system.h" -#include "sys/alt_driver.h" -#include "sys/alt_stdio.h" -#endif - -/* - * Uses the ALT_DRIVER_WRITE() macro to call directly to driver if available. - * Otherwise, uses newlib provided putchar() routine. - */ -int -alt_putchar(int c) -{ -#ifdef ALT_USE_DIRECT_DRIVERS - ALT_DRIVER_WRITE_EXTERNS(ALT_STDOUT_DEV); - char c1 = (char)(c & 0xff); - - if (ALT_DRIVER_WRITE(ALT_STDOUT_DEV, &c1, 1, 0) == -1) { - return -1; - } - return c; -#else - return putchar(c); -#endif -} diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_putstr.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_putstr.c deleted file mode 100644 index 5345945..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_putstr.c +++ /dev/null @@ -1,55 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#ifdef ALT_USE_DIRECT_DRIVERS -#include -#include "system.h" -#include "sys/alt_driver.h" -#include "sys/alt_stdio.h" -#endif - -/* - * Uses the ALT_DRIVER_WRITE() macro to call directly to driver if available. - * Otherwise, uses newlib provided fputs() routine. - */ -int -alt_putstr(const char* str) -{ -#ifdef ALT_USE_DIRECT_DRIVERS - ALT_DRIVER_WRITE_EXTERNS(ALT_STDOUT_DEV); - return ALT_DRIVER_WRITE(ALT_STDOUT_DEV, str, strlen(str), 0); -#else - return fputs(str, stdout); -#endif -} diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_read.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_read.c deleted file mode 100644 index 1c89777..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_read.c +++ /dev/null @@ -1,125 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -/* - * The read() system call is used to read a block of data from a file or device. - * This function simply vectors the request to the device driver associated - * with the input file descriptor "file". - * - * ALT_READ is mapped onto the read() system call in alt_syscall.h - */ - -#ifdef ALT_USE_DIRECT_DRIVERS - -#include "system.h" -#include "sys/alt_driver.h" - -/* - * Provide minimal version that just reads from the stdin device when provided. - */ - -int ALT_READ (int file, void *ptr, size_t len) -{ -#ifdef ALT_STDIN_PRESENT - ALT_DRIVER_READ_EXTERNS(ALT_STDIN_DEV); -#endif - -#if !defined(ALT_STDIN_PRESENT) - /* Generate a link time warning, should this function ever be called. */ - ALT_STUB_WARNING(read); -#endif - - switch (file) { -#ifdef ALT_STDIN_PRESENT - case 0: /* stdin file descriptor */ - return ALT_DRIVER_READ(ALT_STDIN_DEV, ptr, len, 0); -#endif /* ALT_STDIN_PRESENT */ - default: - ALT_ERRNO = EBADFD; - return -1; - } -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -int ALT_READ (int file, void *ptr, size_t len) -{ - alt_fd* fd; - int rval; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - /* - * If the file has not been opened with read access, or if the driver does - * not provide an implementation of read(), generate an error. Otherwise - * call the drivers read() function to process the request. - */ - - if (((fd->fd_flags & O_ACCMODE) != O_WRONLY) && - (fd->dev->read)) - { - if ((rval = fd->dev->read(fd, ptr, len)) < 0) - { - ALT_ERRNO = -rval; - return -1; - } - return rval; - } - else - { - ALT_ERRNO = EACCES; - } - } - else - { - ALT_ERRNO = EBADFD; - } - return -1; -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_release_fd.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_release_fd.c deleted file mode 100644 index 84733a7..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_release_fd.c +++ /dev/null @@ -1,54 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - -/* - * alt_release_fd() is called to free an allocated file descriptor. This is - * done by setting the device pointer in the file descriptor structure to zero. - * - * File descriptors correcponding to standard in, standard out and standard - * error cannont be released backed to the pool. They are always reserved. - */ - -void alt_release_fd (int fd) -{ - if (fd > 2) - { - alt_fd_list[fd].fd_flags = 0; - alt_fd_list[fd].dev = 0; - } -} - - - diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_remap_cached.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_remap_cached.c deleted file mode 100644 index f61cb9c..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_remap_cached.c +++ /dev/null @@ -1,50 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003,2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "sys/alt_cache.h" -#include "system.h" - -#ifdef NIOS2_MMU_PRESENT -/* Convert KERNEL region address to IO region address */ -#define BYPASS_DCACHE_MASK (0x1 << 29) -#else -/* Set bit 31 of address to bypass D-cache */ -#define BYPASS_DCACHE_MASK (0x1 << 31) -#endif - -/* - * Convert a pointer to a block of uncached memory, into a block of - * cached memory. - */ - -void* alt_remap_cached (volatile void* ptr, alt_u32 len) -{ - return (void*) (((alt_u32) ptr) & ~BYPASS_DCACHE_MASK); -} diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_remap_uncached.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_remap_uncached.c deleted file mode 100644 index 7ff6302..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_remap_uncached.c +++ /dev/null @@ -1,51 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003,2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "sys/alt_cache.h" -#include "system.h" - -#ifdef NIOS2_MMU_PRESENT -/* Convert KERNEL region address to IO region address */ -#define BYPASS_DCACHE_MASK (0x1 << 29) -#else -/* Set bit 31 of address to bypass D-cache */ -#define BYPASS_DCACHE_MASK (0x1 << 31) -#endif - -/* - * Convert a pointer to a block of cached memory, into a block of - * uncached memory. - */ - -volatile void* alt_remap_uncached (void* ptr, alt_u32 len) -{ - alt_dcache_flush (ptr, len); - return (volatile void*) (((alt_u32) ptr) | BYPASS_DCACHE_MASK); -} diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_rename.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_rename.c deleted file mode 100644 index 48afac0..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_rename.c +++ /dev/null @@ -1,55 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "os/alt_syscall.h" - -/* - * _rename() is used by newlib to rename an existing file. This is unsupported - * in the HAL environment. However a "do-nothing" implementation is still - * provied for newlib compatability. - * - * ALT_RENAME is mapped onto the _rename() system call in alt_syscall.h - */ - -int ALT_RENAME (char *existing, char *new) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(_rename); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_sbrk.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_sbrk.c deleted file mode 100644 index b8c3799..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_sbrk.c +++ /dev/null @@ -1,136 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "os/alt_syscall.h" - -#include "sys/alt_irq.h" -#include "sys/alt_stack.h" - -#include "system.h" - -/* - * sbrk() is called to dynamically extend the data segment for the application. - * Thie input argument "incr" is the size of the block to allocate. - * - * This simple implementation does not perform any bounds checking. Memory will - * be allocated, even if the request region colides with the stack or overflows - * the available physical memory. - * - * ALT_SBRK is mapped onto the sbrk() system call in alt_syscall.h - * - * This function is called by the profiling code to allocate memory so must be - * safe if called from an interrupt context. It must also not be instrumented - * because that would lead to an infinate loop. - */ - -extern char __alt_heap_start[]; /* set by linker */ -extern char __alt_heap_limit[]; /* set by linker */ - -static char *heap_end = __alt_heap_start; - -#if defined(ALT_EXCEPTION_STACK) && defined(ALT_STACK_CHECK) -char * alt_exception_old_stack_limit = NULL; -#endif - -caddr_t ALT_SBRK (int incr) __attribute__ ((no_instrument_function )); - -caddr_t ALT_SBRK (int incr) -{ - alt_irq_context context; - char *prev_heap_end; - - context = alt_irq_disable_all(); - - /* Always return data aligned on a word boundary */ - heap_end = (char *)(((unsigned int)heap_end + 3) & ~3); - -#ifdef ALT_MAX_HEAP_BYTES - /* - * User specified a maximum heap size. Return -1 if it would - * be exceeded by this sbrk call. - */ - if (((heap_end + incr) - __alt_heap_start) > ALT_MAX_HEAP_BYTES) { - alt_irq_enable_all(context); - return (caddr_t)-1; - } -#else - if ((heap_end + incr) > __alt_heap_limit) { - alt_irq_enable_all(context); - return (caddr_t)-1; - } -#endif - - prev_heap_end = heap_end; - heap_end += incr; - -#ifdef ALT_STACK_CHECK - /* - * If the stack and heap are contiguous then extending the heap reduces the - * space available for the stack. If we are still using the default stack - * then adjust the stack limit to note this, while checking for stack - * pointer overflow. - * If the stack limit isn't pointing at the top of the heap then the code - * is using a different stack so none of this needs to be done. - */ - - if (alt_stack_limit() == prev_heap_end) - { - if (alt_stack_pointer() <= heap_end) - alt_report_stack_overflow(); - - alt_set_stack_limit(heap_end); - } - -#ifdef ALT_EXCEPTION_STACK - /* - * If we are executing from the exception stack then compare against the - * stack we switched away from as well. The exception stack is a fixed - * size so doesn't need to be checked. - */ - - if (alt_exception_old_stack_limit == prev_heap_end) - { - if (alt_exception_old_stack_limit <= heap_end) - alt_report_stack_overflow(); - - alt_exception_old_stack_limit = heap_end; - } -#endif - -#endif - - alt_irq_enable_all(context); - - return (caddr_t) prev_heap_end; -} diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_settod.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_settod.c deleted file mode 100644 index 59db0f8..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_settod.c +++ /dev/null @@ -1,96 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include "sys/alt_errno.h" -#include "sys/alt_alarm.h" -#include "os/alt_syscall.h" - -/* - * "alt_timezone" and "alt_resettime" are the values of the the reset time and - * time zone set through the last call to settimeofday(). By default they are - * zero initialised. - */ - -extern struct timezone alt_timezone; -extern struct timeval alt_resettime; - -/* - * Macro defining the number of micoseconds in a second. - */ - -#define ALT_US (1000000) - - -/* - * settimeofday() can be called to calibrate the system clock, so that - * subsequent calls to gettimeofday() will return the elapsed "wall clock" - * time. - * - * This is done by updating the global structures "alt_resettime" and - * "alt_timezone" so that an immediate call to gettimeofday() would return - * the value specified by "t" and "tz". - * - * Warning: if this function is called concurrently with a call to - * gettimeofday(), the value returned by gettimeofday() will be unreliable. - * - * ALT_SETTIMEOFDAY is mapped onto the settimeofday() system call in - * alt_syscall.h - */ - -int ALT_SETTIMEOFDAY (const struct timeval *t, - const struct timezone *tz) -{ - alt_u32 nticks = alt_nticks (); - alt_u32 tick_rate = alt_ticks_per_second (); - - /* If there is a system clock available, update the current time */ - - if (tick_rate) - { - alt_resettime.tv_sec = t->tv_sec - nticks/tick_rate; - alt_resettime.tv_usec = t->tv_usec - - ((nticks*(ALT_US/tick_rate))%ALT_US); - - alt_timezone.tz_minuteswest = tz->tz_minuteswest; - alt_timezone.tz_dsttime = tz->tz_dsttime; - - return 0; - } - - /* There's no system clock available */ - - ALT_ERRNO = ENOSYS; - return -1; -} diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_software_exception.S b/software/qsys_tutorial_green_bsp/HAL/src/alt_software_exception.S deleted file mode 100644 index 2142594..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_software_exception.S +++ /dev/null @@ -1,53 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - - /* - * This file provides the global symbol: software_exception. It is provided to - * support legacy code, and should not be used by new software. - * - * It is used by legacy code to invoke the software exception handler as - * defined by version 1.0 of the Nios II kit. It should only be used when you - * are providing your own interrupt entry point, i.e. you are not using - * alt_irq_entry. - */ - -#include "system.h" - - /* - * Pull in the exception handler. - */ - - .globl alt_exception - - .section .exceptions.entry.label, "xa" - - .globl software_exception - .type software_exception, @function -software_exception: diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_stat.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_stat.c deleted file mode 100644 index 44e207b..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_stat.c +++ /dev/null @@ -1,59 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include -#include - -#include "os/alt_syscall.h" - -/* - * The stat() function is similar to the fstat() function in that it is used to - * obtain status information about a file. Instead of using an open file - * descriptor (like fstat()), stat() takes the name of a file as an input - * argument. - * - * ALT_STAT is mapped onto the stat() system call in alt_syscall.h - */ - -int ALT_STAT (const char *file, struct stat *st) -{ - int fd; - int rc; - - fd = open (file, 0); - rc = fstat (fd, st); - close (fd); - - return rc; -} diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_tick.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_tick.c deleted file mode 100644 index c73488d..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_tick.c +++ /dev/null @@ -1,149 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_irq.h" -#include "sys/alt_alarm.h" -#include "os/alt_hooks.h" -#include "alt_types.h" - -/* - * "_alt_tick_rate" is used to store the value of the system clock frequency - * in ticks per second. It is initialised to zero, which corresponds to there - * being no system clock facility available. - */ - -alt_u32 _alt_tick_rate = 0; - -/* - * "_alt_nticks" is the number of system clock ticks that have elapsed since - * reset. - */ - -volatile alt_u32 _alt_nticks = 0; - -/* - * "alt_alarm_list" is the head of a linked list of registered alarms. This is - * initialised to be an empty list. - */ - -ALT_LLIST_HEAD(alt_alarm_list); - -/* - * alt_alarm_stop() is called to remove an alarm from the list of registered - * alarms. Alternatively an alarm can unregister itself by returning zero when - * the alarm executes. - */ - -void alt_alarm_stop (alt_alarm* alarm) -{ - alt_irq_context irq_context; - - irq_context = alt_irq_disable_all(); - alt_llist_remove (&alarm->llist); - alt_irq_enable_all (irq_context); -} - -/* - * alt_tick() is periodically called by the system clock driver in order to - * process the registered list of alarms. Each alarm is registed with a - * callback interval, and a callback function, "callback". - * - * The return value of the callback function indicates how many ticks are to - * elapse until the next callback. A return value of zero indicates that the - * alarm should be deactivated. - * - * alt_tick() is expected to run at interrupt level. - */ - -void alt_tick (void) -{ - alt_alarm* next; - alt_alarm* alarm = (alt_alarm*) alt_alarm_list.next; - - alt_u32 next_callback; - - /* update the tick counter */ - - _alt_nticks++; - - /* process the registered callbacks */ - - while (alarm != (alt_alarm*) &alt_alarm_list) - { - next = (alt_alarm*) alarm->llist.next; - - /* - * Upon the tick-counter rolling over it is safe to clear the - * roll-over flag; once the flag is cleared this (or subsequnt) - * tick events are enabled to generate an alarm event. - */ - if ((alarm->rollover) && (_alt_nticks == 0)) - { - alarm->rollover = 0; - } - - /* if the alarm period has expired, make the callback */ - if ((alarm->time <= _alt_nticks) && (alarm->rollover == 0)) - { - next_callback = alarm->callback (alarm->context); - - /* deactivate the alarm if the return value is zero */ - - if (next_callback == 0) - { - alt_alarm_stop (alarm); - } - else - { - alarm->time += next_callback; - - /* - * If the desired alarm time causes a roll-over, set the rollover - * flag. This will prevent the subsequent tick event from causing - * an alarm too early. - */ - if(alarm->time < _alt_nticks) - { - alarm->rollover = 1; - } - } - } - alarm = next; - } - - /* - * Update the operating system specific timer facilities. - */ - - ALT_OS_TIME_TICK(); -} - diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_times.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_times.c deleted file mode 100644 index 4dd965d..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_times.c +++ /dev/null @@ -1,71 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "sys/alt_errno.h" -#include "sys/alt_alarm.h" -#include "os/alt_syscall.h" - -/* - * The times() function is used by newlib to obtain elapsed time information. - * The return value is the elapsed time since reset in system clock ticks. Note - * that this is distinct from the strict Posix version of times(), which should - * return the time since: 0 hours, 0 minutes, 0 seconds, January 1, 1970, GMT. - * - * The input structure is filled in with time accounting information. This - * implementation attributes all cpu time to the system. - * - * ALT_TIMES is mapped onto the times() system call in alt_syscall.h - */ - -clock_t ALT_TIMES (struct tms *buf) -{ - clock_t ticks = alt_nticks(); - - /* If there is no system clock present, generate an error */ - - if (!alt_ticks_per_second()) - { - ALT_ERRNO = ENOSYS; - return 0; - } - - /* Otherwise return the elapsed time */ - - buf->tms_utime = 0; - buf->tms_stime = ticks; - buf->tms_cutime = 0; - buf->tms_cstime = 0; - - return ticks; -} diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_uncached_free.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_uncached_free.c deleted file mode 100644 index 6e362ba..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_uncached_free.c +++ /dev/null @@ -1,49 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003,2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "sys/alt_cache.h" -#include "system.h" - -#ifdef NIOS2_MMU_PRESENT -/* Convert KERNEL region address to IO region address */ -#define BYPASS_DCACHE_MASK (0x1 << 29) -#else -/* Set bit 31 of address to bypass D-cache */ -#define BYPASS_DCACHE_MASK (0x1 << 31) -#endif - -/* - * Free a block of uncached memory. - */ - -void alt_uncached_free (volatile void* ptr) -{ - free ((void*) (((alt_u32) ptr) & ~BYPASS_DCACHE_MASK)); -} diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_uncached_malloc.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_uncached_malloc.c deleted file mode 100644 index ab3416d..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_uncached_malloc.c +++ /dev/null @@ -1,55 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003,2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "sys/alt_cache.h" -#include "system.h" - -#ifdef NIOS2_MMU_PRESENT -/* Convert KERNEL region address to IO region address */ -#define BYPASS_DCACHE_MASK (0x1 << 29) -#else -/* Set bit 31 of address to bypass D-cache */ -#define BYPASS_DCACHE_MASK (0x1 << 31) -#endif - -/* - * Allocate a block of uncached memory. - */ - -volatile void* alt_uncached_malloc (size_t size) -{ - void* ptr; - - ptr = malloc (size); - - alt_dcache_flush (ptr, size); - - return ptr ? (volatile void*) (((alt_u32) ptr) | BYPASS_DCACHE_MASK) : NULL; -} diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_unlink.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_unlink.c deleted file mode 100644 index 29e35d6..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_unlink.c +++ /dev/null @@ -1,55 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "os/alt_syscall.h" - -/* - * unlink() is used by newlib to delete an existing link to a file. This is - * unsupported in the HAL environment. However a "do-nothing" implementation - * is still provied for newlib compatability. - * - * ALT_UNLINK is mapped onto the unlink() system call in alt_syscall.h - */ - -int ALT_UNLINK (char *name) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(unlink); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_usleep.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_usleep.c deleted file mode 100644 index 2330eb8..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_usleep.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2003 Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - * - * ------------ - * - * Altera does not recommend, suggest or require that this reference design - * file be used in conjunction or combination with any other product. - * - * usleep.c - Microsecond delay routine - */ - -#include - -#include "priv/alt_busy_sleep.h" -#include "os/alt_syscall.h" - -/* - * This function simply calls alt_busy_sleep() to perform the delay. This - * function implements the delay as a calibrated "busy loop". - * - * ALT_USLEEP is mapped onto the usleep() system call in alt_syscall.h - */ - - - -#if defined (__GNUC__) && __GNUC__ >= 4 -int ALT_USLEEP (useconds_t us) -#else -unsigned int ALT_USLEEP (unsigned int us) -#endif -{ - return alt_busy_sleep(us); -} diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_wait.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_wait.c deleted file mode 100644 index a42f80f..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_wait.c +++ /dev/null @@ -1,52 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_errno.h" -#include "os/alt_syscall.h" - -/* - * wait() is used by newlib to wait for all child processes to exit. Since the - * HAL does not support spawning child processes, this returns immediately as - * there can't be anythign to wait for. - * - * ALT_WAIT is mapped onto the wait() system call in alt_syscall.h - */ - -int ALT_WAIT (int *status) -{ - *status = 0; - - ALT_ERRNO = ECHILD; - - return -1; -} - diff --git a/software/qsys_tutorial_green_bsp/HAL/src/alt_write.c b/software/qsys_tutorial_green_bsp/HAL/src/alt_write.c deleted file mode 100644 index 51debb5..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/alt_write.c +++ /dev/null @@ -1,138 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -#include "sys/alt_log_printf.h" - -/* - * The write() system call is used to write a block of data to a file or - * device. This function simply vectors the request to the device driver - * associated with the input file descriptor "file". - * - * ALT_WRITE is mapped onto the write() system call in alt_syscall.h - */ - -#ifdef ALT_USE_DIRECT_DRIVERS - -#include "system.h" -#include "sys/alt_driver.h" - -/* - * Provide minimal version that just writes to the stdout/stderr devices - * when provided. - */ - -int ALT_WRITE (int file, const void *ptr, size_t len) -{ -#ifdef ALT_STDOUT_PRESENT - ALT_DRIVER_WRITE_EXTERNS(ALT_STDOUT_DEV); -#endif -#ifdef ALT_STDERR_PRESENT - ALT_DRIVER_WRITE_EXTERNS(ALT_STDERR_DEV); -#endif - -#if !defined(ALT_STDOUT_PRESENT) && !defined(ALT_STDERR_PRESENT) - /* Generate a link time warning, should this function ever be called. */ - ALT_STUB_WARNING(write); -#endif - - switch (file) { -#ifdef ALT_STDOUT_PRESENT - case 1: /* stdout file descriptor */ - return ALT_DRIVER_WRITE(ALT_STDOUT_DEV, ptr, len, 0); -#endif /* ALT_STDOUT_PRESENT */ -#ifdef ALT_STDERR_PRESENT - case 2: /* stderr file descriptor */ - return ALT_DRIVER_WRITE(ALT_STDERR_DEV, ptr, len, 0); -#endif /* ALT_STDERR_PRESENT */ - default: - ALT_ERRNO = EBADFD; - return -1; - } -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -int ALT_WRITE (int file, const void *ptr, size_t len) -{ - alt_fd* fd; - int rval; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - /* - * If the file has not been opened with write access, or if the driver does - * not provide an implementation of write(), generate an error. Otherwise - * call the drivers write() function to process the request. - */ - - if (((fd->fd_flags & O_ACCMODE) != O_RDONLY) && fd->dev->write) - { - - /* ALT_LOG - see altera_hal/HAL/inc/sys/alt_log_printf.h */ - ALT_LOG_WRITE_FUNCTION(ptr,len); - - if ((rval = fd->dev->write(fd, ptr, len)) < 0) - { - ALT_ERRNO = -rval; - return -1; - } - return rval; - } - else - { - ALT_ERRNO = EACCES; - } - } - else - { - ALT_ERRNO = EBADFD; - } - return -1; -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_green_bsp/HAL/src/altera_nios2_qsys_irq.c b/software/qsys_tutorial_green_bsp/HAL/src/altera_nios2_qsys_irq.c deleted file mode 100644 index c7a4f93..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/altera_nios2_qsys_irq.c +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2009 Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - * - * altera_nios2_irq.c - Support for Nios II internal interrupt controller. - * - */ - -#include "sys/alt_irq.h" -#include "altera_nios2_qsys_irq.h" - -/* - * To initialize the internal interrupt controller, just clear the IENABLE - * register so that all possible IRQs are disabled. - */ -void altera_nios2_qsys_irq_init(void) -{ - NIOS2_WRITE_IENABLE(0); -} diff --git a/software/qsys_tutorial_green_bsp/HAL/src/crt0.S b/software/qsys_tutorial_green_bsp/HAL/src/crt0.S deleted file mode 100644 index 582445d..0000000 --- a/software/qsys_tutorial_green_bsp/HAL/src/crt0.S +++ /dev/null @@ -1,456 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "system.h" -#include "nios2.h" - -/* Setup header files to work with assembler code. */ -#define ALT_ASM_SRC - -/* Debug logging facility */ -#include "sys/alt_log_printf.h" - -/*************************************************************************\ -| MACROS | -\*************************************************************************/ - -/* - * The new build tools explicitly define macros when alt_load() - * must be called. The define ALT_LOAD_EXPLICITLY_CONTROLLED tells us that - * those macros are controlling if alt_load() needs to be called. - */ -#ifdef ALT_LOAD_EXPLICITLY_CONTROLLED - -/* Need to call alt_load() if any of these sections are being copied. */ -#if defined(ALT_LOAD_COPY_RODATA) || defined(ALT_LOAD_COPY_RWDATA) || defined(ALT_LOAD_COPY_EXCEPTIONS) -#define CALL_ALT_LOAD -#endif - -#else /* !ALT_LOAD_EXPLICITLY_CONTROLLED */ - -/* - * The legacy build tools use the following macros to detect when alt_load() - * needs to be called. - */ - -#define __ALT_LOAD_SECTIONS(res, text, rodata, exc) \ - ((res##_BASE != rodata##_BASE) || \ - (res##_BASE != rwdata##_BASE) || \ - (res##_BASE != exc##_BASE)) - -#define _ALT_LOAD_SECTIONS(res, text, rodata, exc) \ - __ALT_LOAD_SECTIONS(res, text, rodata, exc) - -#define ALT_LOAD_SECTIONS _ALT_LOAD_SECTIONS(ALT_RESET_DEVICE, \ - ALT_RODATA_DEVICE, \ - ALT_RWDATA_DEVICE, \ - ALT_EXCEPTIONS_DEVICE) - -/* Call alt_load() if there is no bootloader and ALT_LOAD_SECTIONS isn't 0. */ -#if defined(ALT_NO_BOOTLOADER) && ALT_LOAD_SECTIONS -#define CALL_ALT_LOAD -#endif - -#endif /* !ALT_LOAD_EXPLICITLY_CONTROLLED */ - -/* - * When the legacy build tools define a macro called ALT_NO_BOOTLOADER, - * it indicates that initialization code is allowed at the reset address. - * The new build tools define a macro called ALT_ALLOW_CODE_AT_RESET for - * the same purpose. - */ -#ifdef ALT_NO_BOOTLOADER -#define ALT_ALLOW_CODE_AT_RESET -#endif - -/*************************************************************************\ -| EXTERNAL REFERENCES | -\*************************************************************************/ - -/* - * The entry point for user code is either "main" in hosted mode, or - * "alt_main" in standalone mode. These are explicitly referenced here, - * to ensure they are built into the executable. This allows the user - * to build them into libraries, rather than supplying them in object - * files at link time. - */ - .globl main - .globl alt_main - -/* - * Create a reference to the software multiply/divide and trap handers, - * so that if they are provided, they will appear in the executable. - */ -#ifndef ALT_NO_INSTRUCTION_EMULATION - .globl alt_exception_muldiv -#endif -#ifdef ALT_TRAP_HANDLER - .globl alt_exception_trap -#endif - -/* - * Linker defined symbols used to initialize bss. - */ -.globl __bss_start -.globl __bss_end - -/*************************************************************************\ -| RESET SECTION (.entry) | -\*************************************************************************/ - -/* - * This is the reset entry point for Nios II. - * - * At reset, only the cache line which contain the reset vector is - * initialized by the hardware. The code within the first cache line - * initializes the remainder of the instruction cache. - */ - - .section .entry, "xa" - .align 5 - -/* - * Explicitly allow the use of r1 (the assembler temporary register) - * within this code. This register is normally reserved for the use of - * the assembler. - */ - .set noat - -/* - * Some tools want to know where the reset vector is. - * Code isn't always provided at the reset vector but at least the - * __reset label always contains the reset vector address because - * it is defined at the start of the .entry section. - */ - - .globl __reset - .type __reset, @function -__reset: - -/* - * Initialize the instruction cache if present (i.e. size > 0) and - * reset code is allowed unless optimizing for RTL simulation. - * RTL simulations can ensure the instruction cache is already initialized - * so skipping this loop speeds up RTL simulation. - */ - -#if NIOS2_ICACHE_SIZE > 0 && defined(ALT_ALLOW_CODE_AT_RESET) && !defined(ALT_SIM_OPTIMIZE) - /* Assume the instruction cache size is always a power of two. */ -#if NIOS2_ICACHE_SIZE > 0x8000 - movhi r2, %hi(NIOS2_ICACHE_SIZE) -#else - movui r2, NIOS2_ICACHE_SIZE -#endif - -0: - initi r2 - addi r2, r2, -NIOS2_ICACHE_LINE_SIZE - bgt r2, zero, 0b -1: - - /* - * The following debug information tells the ISS not to run the loop above - * but to perform its actions using faster internal code. - */ - .pushsection .debug_alt_sim_info - .int 1, 1, 0b, 1b - .popsection -#endif /* Initialize Instruction Cache */ - -/* - * Jump to the _start entry point in the .text section if reset code - * is allowed or if optimizing for RTL simulation. - */ -#if defined(ALT_ALLOW_CODE_AT_RESET) || defined(ALT_SIM_OPTIMIZE) - /* Jump to the _start entry point in the .text section. */ - movhi r1, %hi(_start) - ori r1, r1, %lo(_start) - jmp r1 - - .size __reset, . - __reset -#endif /* Jump to _start */ - -/* - * When not using exit, provide an _exit symbol to prevent unresolved - * references to _exit from the linker script. - */ -#ifdef ALT_NO_EXIT - .globl _exit -_exit: -#endif - -/*************************************************************************\ -| TEXT SECTION (.text) | -\*************************************************************************/ - -/* - * Start of the .text section, and also the code entry point when - * the code is executed by a bootloader rather than directly from reset. - */ - .section .text - .align 2 - - .globl _start - .type _start, @function -_start: - -/* - * Initialize the data cache if present (i.e. size > 0) and not - * optimizing for RTL simulation. - * RTL simulations can ensure the data cache is already initialized - * so skipping this loop speeds up RTL simulation. - */ - -#if NIOS2_DCACHE_SIZE > 0 && !defined(ALT_SIM_OPTIMIZE) - - /* Assume the data cache size is always a power of two. */ -#if NIOS2_DCACHE_SIZE > 0x8000 - movhi r2, %hi(NIOS2_DCACHE_SIZE) -#else - movui r2, NIOS2_DCACHE_SIZE -#endif - -0: - initd 0(r2) - addi r2, r2, -NIOS2_DCACHE_LINE_SIZE - bgt r2, zero, 0b -1: - - /* - * The following debug information tells the ISS not to run the loop above - * but to perform its actions using faster internal code. - */ - .pushsection .debug_alt_sim_info - .int 2, 1, 0b, 1b - .popsection - -#endif /* Initialize Data Cache */ - - /* Log that caches have been initialized. */ - ALT_LOG_PUTS(alt_log_msg_cache) - - /* Log that the stack pointer is about to be setup. */ - ALT_LOG_PUTS(alt_log_msg_stackpointer) - -#if (NIOS2_NUM_OF_SHADOW_REG_SETS == 0) - /* - * Now that the caches are initialized, set up the stack pointer. - * The value provided by the linker is assumed to be correctly aligned. - */ - movhi sp, %hi(__alt_stack_pointer) - ori sp, sp, %lo(__alt_stack_pointer) - - /* Set up the global pointer. */ - movhi gp, %hi(_gp) - ori gp, gp, %lo(_gp) - -#else /* NIOS2_NUM_OF_SHADOW_REG_SETS > 0 */ - - /* - * Set up the GP and SP in all shadow register sets. - */ - - /* - * Check current register set number, if CPU resets into a shadow register - * set, switch register set to 0 by writing zero to SSTATUS register and - * execute an ERET instruction that just jumps to the next PC address - * (use the NEXTPC instruction to get this). - */ - - rdctl r2, status - - /* Get the current register set number (STATUS.CRS). */ - andi r3, r2, NIOS2_STATUS_CRS_MSK - - /* Skip switch register set if STATUS.CRS is 0. */ - beq r3, zero, .Lskip_switch_reg_set - - .set nobreak - - /* Current register set is non-zero, set SSTATUS to 0. */ - mov sstatus, zero - - /* Get next pc and store in ea. */ - nextpc ea - - /* Point to instruction after eret. */ - addi ea, ea, 8 - - /* - * Execute ERET instruction that just jumps to the next PC address - */ - eret - -.Lskip_switch_reg_set: - mov r2, zero - - /* Reset STATUS register */ - wrctl status, r2 - - movui r3, NIOS2_NUM_OF_SHADOW_REG_SETS - - /* Set up the stack pointer in register set 0. */ - movhi sp, %hi(__alt_stack_pointer) - ori sp, sp, %lo(__alt_stack_pointer) - - /* Set up the global pointer in register set 0. */ - movhi gp, %hi(_gp) - ori gp, gp, %lo(_gp) - -.Lsetup_sp_and_gp_loop: - /* - * Setup GP and SP for shadow register set - * from NIOS2_NUM_OF_SHADOW_REG_SETS to 0 - */ - - /* Skip if number of register sets is 0. */ - beq r3, zero, .Lno_shadow_register_set - - - /* Add previous register set STATUS.PRS by 1 */ - movhi r4, 1 - add r2, r2, r4 - - /* Write STATUS */ - wrctl status, r2 - - /* Clear r0 in the shadow register set (not done by hardware) */ - wrprs r0, r0 - - /* Write the GP in previous register set */ - wrprs gp, gp - - /* Only write the SP in previous register set - * if using the seperate exception stack. For normal case (single stack), - * funnel code would read the SP from previous register set. - */ -#ifdef ALT_INTERRUPT_STACK - - movhi et, %hiadj(__alt_interrupt_stack_pointer) - addi et, et, %lo(__alt_interrupt_stack_pointer) - wrprs sp, et - -#endif /* ALT_INTERRUPT_STACK */ - - /* Decrease number of register set counter by 1 */ - addi r3, r3, -1 - - br .Lsetup_sp_and_gp_loop -.Lno_shadow_register_set: - -#endif /* NIOS2_NUM_OF_SHADOW_REG_SETS */ -/* - * Clear the BSS if not optimizing for RTL simulation. - * - * This uses the symbols: __bss_start and __bss_end, which are defined - * by the linker script. They mark the begining and the end of the bss - * region. The linker script guarantees that these values are word aligned. - */ -#ifndef ALT_SIM_OPTIMIZE - /* Log that the BSS is about to be cleared. */ - ALT_LOG_PUTS(alt_log_msg_bss) - - movhi r2, %hi(__bss_start) - ori r2, r2, %lo(__bss_start) - - movhi r3, %hi(__bss_end) - ori r3, r3, %lo(__bss_end) - - beq r2, r3, 1f - -0: - stw zero, (r2) - addi r2, r2, 4 - bltu r2, r3, 0b - -1: - - /* - * The following debug information tells the ISS not to run the loop above - * but to perform its actions using faster internal code. - */ - .pushsection .debug_alt_sim_info - .int 3, 1, 0b, 1b - .popsection -#endif /* ALT_SIM_OPTIMIZE */ - -/* - * The alt_load() facility is normally used when there is no bootloader. - * It copies some sections into RAM so it acts like a mini-bootloader. - */ -#ifdef CALL_ALT_LOAD - -#ifdef ALT_STACK_CHECK - /* - * If the user has selected stack checking then we need to set up a safe - * value in the stack limit register so that the relocation functions - * don't think the stack has overflowed (the contents of the rwdata - * section aren't defined until alt_load() has been called). - */ - mov et, zero -#endif - - call alt_load - -#endif /* CALL_ALT_LOAD */ - -#ifdef ALT_STACK_CHECK - /* - * Set up the stack limit (if required). The linker has set up the - * copy of the variable which is in memory. - */ - - ldw et, %gprel(alt_stack_limit_value)(gp) -#endif - - /* Log that alt_main is about to be called. */ - ALT_LOG_PUTS(alt_log_msg_alt_main) - - /* Call the C entry point. It should never return. */ - call alt_main - - /* Wait in infinite loop in case alt_main does return. */ -alt_after_alt_main: - br alt_after_alt_main - - .size _start, . - _start - -/* - * Add information about the stack base if stack overflow checking is enabled. - */ -#ifdef ALT_STACK_CHECK - .globl alt_stack_limit_value - .section .sdata,"aws",@progbits - .align 2 - .type alt_stack_limit_value, @object - .size alt_stack_limit_value, 4 -alt_stack_limit_value: - .long __alt_stack_limit -#endif diff --git a/software/qsys_tutorial_green_bsp/Makefile b/software/qsys_tutorial_green_bsp/Makefile deleted file mode 100644 index 9b68af8..0000000 --- a/software/qsys_tutorial_green_bsp/Makefile +++ /dev/null @@ -1,766 +0,0 @@ -#------------------------------------------------------------------------------ -# BSP MAKEFILE -# -# This makefile was automatically generated by the nios2-bsp-generate-files -# command. Its purpose is to build a custom Board Support Package (BSP) -# targeting a specific Nios II processor in an SOPC Builder-based design. -# -# To create an application or library Makefile which uses this BSP, try the -# nios2-app-generate-makefile or nios2-lib-generate-makefile commands. -#------------------------------------------------------------------------------ - -#------------------------------------------------------------------------------ -# TOOLS -#------------------------------------------------------------------------------ - -MKDIR := mkdir -p -ECHO := echo -SPACE := $(empty) $(empty) - -#------------------------------------------------------------------------------ -# The adjust-path macro -# -# If COMSPEC is defined, Make is launched from Windows through -# Cygwin. This adjust-path macro will call 'cygpath -u' on all -# paths to ensure they are readable by Make. -# -# If COMSPEC is not defined, Make is launched from *nix, and no adjustment -# is necessary -#------------------------------------------------------------------------------ - -ifndef COMSPEC -ifdef ComSpec -COMSPEC = $(ComSpec) -endif # ComSpec -endif # !COMSPEC - -ifdef COMSPEC - adjust-path = $(subst $(SPACE),\$(SPACE),$(shell cygpath -u "$1")) - adjust-path-mixed = $(subst $(SPACE),\$(SPACE),$(shell cygpath -m "$1")) -else - adjust-path = $(subst $(SPACE),\$(SPACE),$1) - adjust-path-mixed = $(subst $(SPACE),\$(SPACE),$1) -endif - -#------------------------------------------------------------------------------ -# DEFAULT TARGET -# -# The default target, "all", must appear before any other target in the -# Makefile. Note that extra prerequisites are added to the "all" rule later. -#------------------------------------------------------------------------------ -.PHONY: all -all: - @$(ECHO) [BSP build complete] - - -#------------------------------------------------------------------------------ -# PATHS & DIRECTORY NAMES -# -# Explicitly locate absolute path of the BSP root -#------------------------------------------------------------------------------ - -BSP_ROOT_DIR := . - -# Define absolute path to the root of the BSP. -ABS_BSP_ROOT := $(call adjust-path-mixed,$(shell pwd)) - -# Stash all BSP object files here -OBJ_DIR := ./obj - -NEWLIB_DIR = $(BSP_ROOT_DIR)/newlib - - -#------------------------------------------------------------------------------ -# MANAGED CONTENT -# -# All content between the lines "START MANAGED" and "END MANAGED" below is -# generated based on variables in the BSP settings file when the -# nios2-bsp-generate-files command is invoked. If you wish to persist any -# information pertaining to the build process, it is recomended that you -# utilize the BSP settings mechanism to do so. -# -# Note that most variable assignments in this section have a corresponding BSP -# setting that can be changed by using the nios2-bsp-create-settings or -# nios2-bsp-update-settings command before nios2-bsp-generate-files; if you -# want any variable set to a specific value when this Makefile is re-generated -# (to prevent hand-edits from being over-written), use the BSP settings -# facilities above. -#------------------------------------------------------------------------------ - -#START MANAGED - -# The following TYPE comment allows tools to identify the 'type' of target this -# makefile is associated with. -# TYPE: BSP_PRIVATE_MAKEFILE - -# This following VERSION comment indicates the version of the tool used to -# generate this makefile. A makefile variable is provided for VERSION as well. -# ACDS_VERSION: 13.0sp1 -ACDS_VERSION := 13.0sp1 - -# This following BUILD_NUMBER comment indicates the build number of the tool -# used to generate this makefile. -# BUILD_NUMBER: 232 - -SETTINGS_FILE := settings.bsp -SOPC_FILE := C:/Users/takayun/Desktop/qsys_tutorial/nios_system.sopcinfo - -#------------------------------------------------------------------------------- -# TOOL & COMMAND DEFINITIONS -# -# The base command for each build operation are expressed here. Additional -# switches may be expressed here. They will run for all instances of the -# utility. -#------------------------------------------------------------------------------- - -# Archiver command. Creates library files. -AR = nios2-elf-ar - -# Assembler command. Note that CC is used for .S files. -AS = nios2-elf-gcc - -# Custom flags only passed to the archiver. This content of this variable is -# directly passed to the archiver rather than the more standard "ARFLAGS". The -# reason for this is that GNU Make assumes some default content in ARFLAGS. -# This setting defines the value of BSP_ARFLAGS in Makefile. -BSP_ARFLAGS = -src - -# Custom flags only passed to the assembler. This setting defines the value of -# BSP_ASFLAGS in Makefile. -BSP_ASFLAGS = -Wa,-gdwarf2 - -# C/C++ compiler debug level. '-g' provides the default set of debug symbols -# typically required to debug a typical application. Omitting '-g' removes -# debug symbols from the ELF. This setting defines the value of -# BSP_CFLAGS_DEBUG in Makefile. -BSP_CFLAGS_DEBUG = -g - -# C/C++ compiler optimization level. "-O0" = no optimization,"-O2" = "normal" -# optimization, etc. "-O0" is recommended for code that you want to debug since -# compiler optimization can remove variables and produce non-sequential -# execution of code while debugging. This setting defines the value of -# BSP_CFLAGS_OPTIMIZATION in Makefile. -BSP_CFLAGS_OPTIMIZATION = '-Os' - -# C/C++ compiler warning level. "-Wall" is commonly used.This setting defines -# the value of BSP_CFLAGS_WARNINGS in Makefile. -BSP_CFLAGS_WARNINGS = -Wall - -# C compiler command. -CC = nios2-elf-gcc -xc - -# C++ compiler command. -CXX = nios2-elf-gcc -xc++ - -# Command used to remove files during 'clean' target. -RM = rm -f - - -#------------------------------------------------------------------------------- -# BUILD PRE & POST PROCESS COMMANDS -# -# The following variables are treated as shell commands in the rule -# definitions for each file-type associated with the BSP build, as well as -# commands run at the beginning and end of the entire BSP build operation. -# Pre-process commands are executed before the relevant command (for example, -# a command defined in the "CC_PRE_PROCESS" variable executes before the C -# compiler for building .c files), while post-process commands are executed -# immediately afterwards. -# -# You can view each pre/post-process command in the "Build Rules: All & -# Clean", "Pattern Rules to Build Objects", and "Library Rules" sections of -# this Makefile. -#------------------------------------------------------------------------------- - - -#------------------------------------------------------------------------------- -# BSP SOURCE BUILD SETTINGS (FLAG GENERATION) -# -# Software build settings such as compiler optimization, debug level, warning -# flags, etc., may be defined in the following variables. The variables below -# are concatenated together in the 'Flags' section of this Makefile to form -# final variables of flags passed to the build tools. -# -# These settings are considered private to the BSP and apply to all library & -# driver files in it; they do NOT automatically propagate to, for example, the -# build settings for an application. -# # For additional detail and syntax requirements, please refer to GCC help -# (example: "nios2-elf-gcc --help --verbose"). -# -# Unless indicated otherwise, multiple entries in each variable should be -# space-separated. -#------------------------------------------------------------------------------- - -# Altera HAL alt_sys_init.c generated source file -GENERATED_C_FILES := $(ABS_BSP_ROOT)/alt_sys_init.c -GENERATED_C_LIB_SRCS += alt_sys_init.c - - -#------------------------------------------------------------------------------- -# BSP SOURCE FILE LISTING -# -# All source files that comprise the BSP are listed here, along with path -# information to each file expressed relative to the BSP root. The precise -# list and location of each file is derived from the driver, operating system, -# or software package source file declarations. -# -# Following specification of the source files for each component, driver, etc., -# each source file type (C, assembly, etc.) is concatenated together and used -# to construct a list of objects. Pattern rules to build each object are then -# used to build each file. -#------------------------------------------------------------------------------- - -# altera_avalon_jtag_uart_driver sources root -altera_avalon_jtag_uart_driver_SRCS_ROOT := drivers - -# altera_avalon_jtag_uart_driver sources -altera_avalon_jtag_uart_driver_C_LIB_SRCS := \ - $(altera_avalon_jtag_uart_driver_SRCS_ROOT)/src/altera_avalon_jtag_uart_init.c \ - $(altera_avalon_jtag_uart_driver_SRCS_ROOT)/src/altera_avalon_jtag_uart_read.c \ - $(altera_avalon_jtag_uart_driver_SRCS_ROOT)/src/altera_avalon_jtag_uart_write.c \ - $(altera_avalon_jtag_uart_driver_SRCS_ROOT)/src/altera_avalon_jtag_uart_ioctl.c \ - $(altera_avalon_jtag_uart_driver_SRCS_ROOT)/src/altera_avalon_jtag_uart_fd.c - -# altera_avalon_pio_driver sources root -altera_avalon_pio_driver_SRCS_ROOT := drivers - -# altera_avalon_pio_driver sources -# altera_nios2_qsys_hal_driver sources root -altera_nios2_qsys_hal_driver_SRCS_ROOT := HAL - -# altera_nios2_qsys_hal_driver sources -altera_nios2_qsys_hal_driver_C_LIB_SRCS := \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/altera_nios2_qsys_irq.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_usleep.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_busy_sleep.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_irq_vars.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_icache_flush.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_icache_flush_all.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_dcache_flush.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_dcache_flush_all.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_dcache_flush_no_writeback.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_instruction_exception_entry.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_irq_register.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_iic.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_remap_cached.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_remap_uncached.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_uncached_free.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_uncached_malloc.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_do_ctors.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_do_dtors.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_gmon.c - -altera_nios2_qsys_hal_driver_ASM_LIB_SRCS := \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_exception_entry.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_exception_trap.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_exception_muldiv.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_irq_entry.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_software_exception.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_mcount.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_log_macro.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/crt0.S - -# hal sources root -hal_SRCS_ROOT := HAL - -# hal sources -hal_C_LIB_SRCS := \ - $(hal_SRCS_ROOT)/src/alt_alarm_start.c \ - $(hal_SRCS_ROOT)/src/alt_close.c \ - $(hal_SRCS_ROOT)/src/alt_dev.c \ - $(hal_SRCS_ROOT)/src/alt_dev_llist_insert.c \ - $(hal_SRCS_ROOT)/src/alt_dma_rxchan_open.c \ - $(hal_SRCS_ROOT)/src/alt_dma_txchan_open.c \ - $(hal_SRCS_ROOT)/src/alt_environ.c \ - $(hal_SRCS_ROOT)/src/alt_env_lock.c \ - $(hal_SRCS_ROOT)/src/alt_errno.c \ - $(hal_SRCS_ROOT)/src/alt_execve.c \ - $(hal_SRCS_ROOT)/src/alt_exit.c \ - $(hal_SRCS_ROOT)/src/alt_fcntl.c \ - $(hal_SRCS_ROOT)/src/alt_fd_lock.c \ - $(hal_SRCS_ROOT)/src/alt_fd_unlock.c \ - $(hal_SRCS_ROOT)/src/alt_find_dev.c \ - $(hal_SRCS_ROOT)/src/alt_find_file.c \ - $(hal_SRCS_ROOT)/src/alt_flash_dev.c \ - $(hal_SRCS_ROOT)/src/alt_fork.c \ - $(hal_SRCS_ROOT)/src/alt_fs_reg.c \ - $(hal_SRCS_ROOT)/src/alt_fstat.c \ - $(hal_SRCS_ROOT)/src/alt_get_fd.c \ - $(hal_SRCS_ROOT)/src/alt_getchar.c \ - $(hal_SRCS_ROOT)/src/alt_getpid.c \ - $(hal_SRCS_ROOT)/src/alt_gettod.c \ - $(hal_SRCS_ROOT)/src/alt_iic_isr_register.c \ - $(hal_SRCS_ROOT)/src/alt_instruction_exception_register.c \ - $(hal_SRCS_ROOT)/src/alt_ioctl.c \ - $(hal_SRCS_ROOT)/src/alt_io_redirect.c \ - $(hal_SRCS_ROOT)/src/alt_irq_handler.c \ - $(hal_SRCS_ROOT)/src/alt_isatty.c \ - $(hal_SRCS_ROOT)/src/alt_kill.c \ - $(hal_SRCS_ROOT)/src/alt_link.c \ - $(hal_SRCS_ROOT)/src/alt_load.c \ - $(hal_SRCS_ROOT)/src/alt_log_printf.c \ - $(hal_SRCS_ROOT)/src/alt_lseek.c \ - $(hal_SRCS_ROOT)/src/alt_main.c \ - $(hal_SRCS_ROOT)/src/alt_malloc_lock.c \ - $(hal_SRCS_ROOT)/src/alt_open.c \ - $(hal_SRCS_ROOT)/src/alt_printf.c \ - $(hal_SRCS_ROOT)/src/alt_putchar.c \ - $(hal_SRCS_ROOT)/src/alt_putstr.c \ - $(hal_SRCS_ROOT)/src/alt_read.c \ - $(hal_SRCS_ROOT)/src/alt_release_fd.c \ - $(hal_SRCS_ROOT)/src/alt_rename.c \ - $(hal_SRCS_ROOT)/src/alt_sbrk.c \ - $(hal_SRCS_ROOT)/src/alt_settod.c \ - $(hal_SRCS_ROOT)/src/alt_stat.c \ - $(hal_SRCS_ROOT)/src/alt_tick.c \ - $(hal_SRCS_ROOT)/src/alt_times.c \ - $(hal_SRCS_ROOT)/src/alt_unlink.c \ - $(hal_SRCS_ROOT)/src/alt_wait.c \ - $(hal_SRCS_ROOT)/src/alt_write.c - - -# Assemble all component C source files -COMPONENT_C_LIB_SRCS += \ - $(altera_avalon_jtag_uart_driver_C_LIB_SRCS) \ - $(altera_nios2_qsys_hal_driver_C_LIB_SRCS) \ - $(hal_C_LIB_SRCS) - -# Assemble all component assembly source files -COMPONENT_ASM_LIB_SRCS += \ - $(altera_nios2_qsys_hal_driver_ASM_LIB_SRCS) - -# Assemble all component C++ source files -COMPONENT_CPP_LIB_SRCS += \ - -#END MANAGED - -#------------------------------------------------------------------------------ -# PUBLIC.MK -# -# The generated public.mk file contains BSP information that is shared with -# other external makefiles, such as a Nios II application makefile. System- -# dependent information such as hardware-specific compiler flags and -# simulation file generation are stored here. -# -# In addition, public.mk contains include paths that various software, -# such as a device driver, may need for the C compiler. These paths are -# written to public.mk with respect to the BSP root. In public.mk, each -# path is prefixed with a special variable, $(ALT_LIBRARY_ROOT_DIR). The -# purpose of this variable is to allow an external Makefile to append on -# path information to precisely locate paths expressed in public.mk -# Since this is the BSP Makefile, we set ALT_LIBRARY_ROOT_DIR to point right -# here ("."), at the BSP root. -# -# ALT_LIBRARY_ROOT_DIR must always be set before public.mk is included. -#------------------------------------------------------------------------------ -ALT_LIBRARY_ROOT_DIR := . -include public.mk - - -#------------------------------------------------------------------------------ -# FLAGS -# -# Include paths for BSP files are written into the public.mk file and must -# be added to the existing list of pre-processor flags. In addition, "hooks" -# for standard flags left intentionally empty (CFLAGS, CPPFLAGS, ASFLAGS, -# and CXXFLAGS) are provided for conveniently adding to the relevant flags -# on the command-line or via script that calls make. -#------------------------------------------------------------------------------ -# Assemble final list of compiler flags from generated content -BSP_CFLAGS += \ - $(BSP_CFLAGS_DEFINED_SYMBOLS) \ - $(BSP_CFLAGS_UNDEFINED_SYMBOLS) \ - $(BSP_CFLAGS_OPTIMIZATION) \ - $(BSP_CFLAGS_DEBUG) \ - $(BSP_CFLAGS_WARNINGS) \ - $(BSP_CFLAGS_USER_FLAGS) \ - $(ALT_CFLAGS) \ - $(CFLAGS) - -# Make ready the final list of include directories and other C pre-processor -# flags. Each include path is made ready by prefixing it with "-I". -BSP_CPPFLAGS += \ - $(addprefix -I, $(BSP_INC_DIRS)) \ - $(addprefix -I, $(ALT_INCLUDE_DIRS)) \ - $(ALT_CPPFLAGS) \ - $(CPPFLAGS) - -# Finish off assembler flags with any user-provided flags -BSP_ASFLAGS += $(ASFLAGS) - -# Finish off C++ flags with any user-provided flags -BSP_CXXFLAGS += $(CXXFLAGS) - -# And finally, the ordered list -C_SRCS += $(GENERATED_C_LIB_SRCS) \ - $(COMPONENT_C_LIB_SRCS) - -CXX_SRCS += $(GENERATED_CPP_LIB_SRCS) \ - $(COMPONENT_CPP_LIB_SRCS) - -ASM_SRCS += $(GENERATED_ASM_LIB_SRCS) \ - $(COMPONENT_ASM_LIB_SRCS) - - -#------------------------------------------------------------------------------ -# LIST OF GENERATED FILES -# -# A Nios II BSP relies on the generation of several source files used -# by both the BSP and any applications referencing the BSP. -#------------------------------------------------------------------------------ - - -GENERATED_H_FILES := $(ABS_BSP_ROOT)/system.h - -GENERATED_LINKER_SCRIPT := $(ABS_BSP_ROOT)/linker.x - -GENERATED_FILES += $(GENERATED_H_FILES) \ - $(GENERATED_LINKER_SCRIPT) - - -#------------------------------------------------------------------------------ -# SETUP TO BUILD OBJECTS -# -# List of object files which are to be built. This is constructed from the input -# list of C source files (C_SRCS), C++ source files (CXX_SRCS), and assembler -# source file (ASM_SRCS). The permitted file extensions are: -# -# .c .C - for C files -# .cxx .cc .cpp .CXX .CC .CPP - for C++ files -# .S .s - for assembly files -# -# Extended description: The list of objects is a sorted list (duplicates -# removed) of all possible objects, placed beneath the ./obj directory, -# including any path information stored in the "*_SRCS" variable. The -# "patsubst" commands are used to concatenate together multiple file suffix -# types for common files (i.e. c++ as .cxx, .cc, .cpp). -# -# File extensions are case-insensitive in build rules with the exception of -# assembly sources. Nios II assembly sources with the ".S" extension are first -# run through the C preprocessor. Sources with the ".s" extension are not. -#------------------------------------------------------------------------------ -OBJS = $(sort $(addprefix $(OBJ_DIR)/, \ - $(patsubst %.c, %.o, $(patsubst %.C, %.o, $(C_SRCS))) \ - $(patsubst %.cxx, %.o, $(patsubst %.CXX, %.o, \ - $(patsubst %.cc, %.o, $(patsubst %.CC, %.o, \ - $(patsubst %.cpp, %.o, $(patsubst %.CPP, %.o, \ - $(CXX_SRCS) )))))) \ - $(patsubst %.S, %.o, $(patsubst %.s, %.o, $(ASM_SRCS))) )) - -# List of dependancy files for each object file. -DEPS = $(OBJS:.o=.d) - - -# Rules to force your project to rebuild or relink -# .force_relink file will cause any application that depends on this project to relink -# .force_rebuild file will cause this project to rebuild object files -# .force_rebuild_all file will cause this project and any project that depends on this project to rebuild object files - -FORCE_RELINK_DEP := .force_relink -FORCE_REBUILD_DEP := .force_rebuild -FORCE_REBUILD_ALL_DEP := .force_rebuild_all -FORCE_REBUILD_DEP_LIST := $(FORCE_RELINK_DEP) $(FORCE_REBUILD_DEP) $(FORCE_REBUILD_ALL_DEP) - -$(FORCE_REBUILD_DEP_LIST): - -$(OBJS): $(wildcard $(FORCE_REBUILD_DEP)) $(wildcard $(FORCE_REBUILD_ALL_DEP)) - - -#------------------------------------------------------------------------------ -# BUILD RULES: ALL & CLEAN -#------------------------------------------------------------------------------ -.DELETE_ON_ERROR: - -.PHONY: all -all: build_pre_process -all: Makefile $(GENERATED_FILES) $(BSP_LIB) $(NEWLIB_DIR) -all: build_post_process - - -# clean: remove .o/.a/.d -.PHONY: clean -clean: - @$(RM) -r $(BSP_LIB) $(OBJ_DIR) $(FORCE_REBUILD_DEP_LIST) -ifneq ($(wildcard $(NEWLIB_DIR)),) - @$(RM) -r $(NEWLIB_DIR) -endif - @$(ECHO) [BSP clean complete] - - -#------------------------------------------------------------------------------ -# BUILD PRE/POST PROCESS -#------------------------------------------------------------------------------ -build_pre_process : - $(BUILD_PRE_PROCESS) - -build_post_process : - $(BUILD_POST_PROCESS) - -.PHONY: build_pre_process build_post_process - - - -#------------------------------------------------------------------------------ -# MAKEFILE UP TO DATE? -# -# Is this very Makefile up to date? Someone may have changed the BSP settings -# file or the associated target hardware. -#------------------------------------------------------------------------------ -# Skip this check when clean is the only target -ifneq ($(MAKECMDGOALS),clean) - -ifneq ($(wildcard $(SETTINGS_FILE)),$(SETTINGS_FILE)) -$(warning Warning: BSP Settings File $(SETTINGS_FILE) could not be found.) -endif - -Makefile: $(wildcard $(SETTINGS_FILE)) - @$(ECHO) Makefile not up to date. - @$(ECHO) $(SETTINGS_FILE) has been modified since the BSP Makefile was generated. - @$(ECHO) - @$(ECHO) Generate the BSP to update the Makefile, and then build again. - @$(ECHO) - @$(ECHO) To generate from Eclipse: - @$(ECHO) " 1. Right-click the BSP project." - @$(ECHO) " 2. In the Nios II Menu, click Generate BSP." - @$(ECHO) - @$(ECHO) To generate from the command line: - @$(ECHO) " nios2-bsp-generate-files --settings= --bsp-dir=" - @$(ECHO) - @exit 1 - -ifneq ($(wildcard $(SOPC_FILE)),$(SOPC_FILE)) -$(warning Warning: SOPC File $(SOPC_FILE) could not be found.) -endif - -public.mk: $(wildcard $(SOPC_FILE)) - @$(ECHO) Makefile not up to date. - @$(ECHO) $(SOPC_FILE) has been modified since the BSP was generated. - @$(ECHO) - @$(ECHO) Generate the BSP to update the Makefile, and then build again. - @$(ECHO) - @$(ECHO) To generate from Eclipse: - @$(ECHO) " 1. Right-click the BSP project." - @$(ECHO) " 2. In the Nios II Menu, click Generate BSP." - @$(ECHO) - @$(ECHO) To generate from the command line: - @$(ECHO) " nios2-bsp-generate-files --settings= --bsp-dir=" - @$(ECHO) - @exit 1 - -endif # $(MAKECMDGOALS) != clean - -#------------------------------------------------------------------------------ -# PATTERN RULES TO BUILD OBJECTS -#------------------------------------------------------------------------------ -$(OBJ_DIR)/%.o: %.c - @$(ECHO) Compiling $( - -/* - * Device headers - */ - -#include "altera_nios2_qsys_irq.h" -#include "altera_avalon_jtag_uart.h" - -/* - * Allocate the device storage - */ - -ALTERA_NIOS2_QSYS_IRQ_INSTANCE ( NIOS2_PROCESSOR, nios2_processor); -ALTERA_AVALON_JTAG_UART_INSTANCE ( JTAG_UART, jtag_uart); - -/* - * Initialize the interrupt controller devices - * and then enable interrupts in the CPU. - * Called before alt_sys_init(). - * The "base" parameter is ignored and only - * present for backwards-compatibility. - */ - -void alt_irq_init ( const void* base ) -{ - ALTERA_NIOS2_QSYS_IRQ_INIT ( NIOS2_PROCESSOR, nios2_processor); - alt_irq_cpu_enable_interrupts(); -} - -/* - * Initialize the non-interrupt controller devices. - * Called after alt_irq_init(). - */ - -void alt_sys_init( void ) -{ - ALTERA_AVALON_JTAG_UART_INIT ( JTAG_UART, jtag_uart); -} diff --git a/software/qsys_tutorial_green_bsp/create-this-bsp b/software/qsys_tutorial_green_bsp/create-this-bsp deleted file mode 100644 index d95439e..0000000 --- a/software/qsys_tutorial_green_bsp/create-this-bsp +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/bash -# -# This script creates the ucosii_net_zipfs Board Support Package (BSP). - -BSP_TYPE=hal -BSP_DIR=. -SOPC_DIR=../../ -SOPC_FILE=C:/Users/takayun/Desktop/qsys_tutorial/nios_system.sopcinfo -NIOS2_BSP_ARGS="--set hal.max_file_descriptors 4 --set hal.enable_small_c_library true --set hal.sys_clk_timer none --set hal.timestamp_timer none --set hal.enable_exit false --set hal.enable_c_plus_plus false --set hal.enable_lightweight_device_driver_api true --set hal.enable_clean_exit false --set hal.enable_sim_optimize false --set hal.enable_reduced_device_drivers true --set hal.make.bsp_cflags_optimization '-Os'" -CPU_NAME= - - -# Don't run make if create-this-app script is called with --no-make arg -SKIP_MAKE= -while [ $# -gt 0 ] -do - case "$1" in - --no-make) - SKIP_MAKE=1 - ;; - *) - NIOS2_BSP_ARGS="$NIOS2_BSP_ARGS $1" - ;; - esac - shift -done - - -# Run nios2-bsp utility to create a hal BSP in this directory -# for the system with a .sopc file in $SOPC_FILE. -# Deprecating $SOPC_DIR in 10.1. Multiple .sopcinfo files in a directory may exist. - -if [ -z "$SOPC_FILE" ]; then - echo "WARNING: Use of a directory for locating a .sopcinfo file is deprecated in 10.1. Multiple .sopcinfo files may exist. You must specify the full .sopcinfo path." - cmd="nios2-bsp $BSP_TYPE $BSP_DIR $SOPC_DIR $NIOS2_BSP_ARGS $CPU_NAME" -else - cmd="nios2-bsp $BSP_TYPE $BSP_DIR $SOPC_FILE $NIOS2_BSP_ARGS $CPU_NAME" -fi - - -echo "create-this-bsp: Running \"$cmd\"" -$cmd || { - echo "$cmd failed" - exit 1 -} -if [ -z "$SKIP_MAKE" ]; then - echo "create-this-bsp: Running make" - make -fi diff --git a/software/qsys_tutorial_green_bsp/drivers/inc/altera_avalon_jtag_uart.h b/software/qsys_tutorial_green_bsp/drivers/inc/altera_avalon_jtag_uart.h deleted file mode 100644 index 95d4a99..0000000 --- a/software/qsys_tutorial_green_bsp/drivers/inc/altera_avalon_jtag_uart.h +++ /dev/null @@ -1,198 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#ifndef __ALT_AVALON_JTAG_UART_H__ -#define __ALT_AVALON_JTAG_UART_H__ - -#include - -#include "sys/alt_alarm.h" -#include "sys/alt_warning.h" - -#include "os/alt_sem.h" -#include "os/alt_flag.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * If the user wants all drivers to be small rather than fast then make sure - * this one is marked as needing to be small. - */ -#if defined ALT_USE_SMALL_DRIVERS && !defined ALTERA_AVALON_JTAG_UART_SMALL -#define ALTERA_AVALON_JTAG_UART_SMALL -#endif - -/* - * If the user wants to ignore FIFO full error after timeout - */ -#if defined ALT_JTAG_UART_IGNORE_FIFO_FULL_ERROR && !defined ALTERA_AVALON_JTAG_UART_IGNORE_FIFO_FULL_ERROR -#define ALTERA_AVALON_JTAG_UART_IGNORE_FIFO_FULL_ERROR -#endif - -/* - * Constants that can be overriden. - */ -#ifndef ALTERA_AVALON_JTAG_UART_DEFAULT_TIMEOUT -#define ALTERA_AVALON_JTAG_UART_DEFAULT_TIMEOUT 10 -#endif - -#ifndef ALTERA_AVALON_JTAG_UART_BUF_LEN -#define ALTERA_AVALON_JTAG_UART_BUF_LEN 2048 -#endif - -/* - * ALT_JTAG_UART_READ_RDY and ALT_JTAG_UART_WRITE_RDY are the bitmasks - * that define uC/OS-II event flags that are releated to this device. - * - * ALT_JTAG_UART_READ_RDY indicates that there is read data in the buffer - * ready to be processed. ALT_JTAG_UART_WRITE_RDY indicates that the transmitter is - * ready for more data. - */ -#define ALT_JTAG_UART_READ_RDY 0x1 -#define ALT_JTAG_UART_WRITE_RDY 0x2 -#define ALT_JTAG_UART_TIMEOUT 0x4 - -/* - * State structure definition. Each instance of the driver uses one - * of these structures to hold its associated state. - */ - -typedef struct altera_avalon_jtag_uart_state_s -{ - unsigned int base; - -#ifndef ALTERA_AVALON_JTAG_UART_SMALL - - unsigned int timeout; /* Timeout until host is assumed inactive */ - alt_alarm alarm; - unsigned int irq_enable; - unsigned int host_inactive; - - ALT_SEM (read_lock) - ALT_SEM (write_lock) - ALT_FLAG_GRP (events) - - /* The variables below are volatile because they are modified by the - * interrupt routine. Making them volatile and reading them atomically - * means that we don't need any large critical sections. - */ - volatile unsigned int rx_in; - unsigned int rx_out; - unsigned int tx_in; - volatile unsigned int tx_out; - char rx_buf[ALTERA_AVALON_JTAG_UART_BUF_LEN]; - char tx_buf[ALTERA_AVALON_JTAG_UART_BUF_LEN]; - -#endif /* !ALTERA_AVALON_JTAG_UART_SMALL */ - -} altera_avalon_jtag_uart_state; - -/* - * Macros used by alt_sys_init when the ALT file descriptor facility isn't used. - */ - -#ifdef ALTERA_AVALON_JTAG_UART_SMALL - -#define ALTERA_AVALON_JTAG_UART_STATE_INSTANCE(name, state) \ - altera_avalon_jtag_uart_state state = \ - { \ - name##_BASE, \ - } - -#define ALTERA_AVALON_JTAG_UART_STATE_INIT(name, state) - -#else /* !ALTERA_AVALON_JTAG_UART_SMALL */ - -#define ALTERA_AVALON_JTAG_UART_STATE_INSTANCE(name, state) \ - altera_avalon_jtag_uart_state state = \ - { \ - name##_BASE, \ - ALTERA_AVALON_JTAG_UART_DEFAULT_TIMEOUT, \ - } - -/* - * Externally referenced routines - */ -extern void altera_avalon_jtag_uart_init(altera_avalon_jtag_uart_state* sp, - int irq_controller_id, int irq); - -#define ALTERA_AVALON_JTAG_UART_STATE_INIT(name, state) \ - { \ - if (name##_IRQ == ALT_IRQ_NOT_CONNECTED) \ - { \ - ALT_LINK_ERROR ("Error: Interrupt not connected for " #name ". " \ - "You have selected the interrupt driven version of " \ - "the ALTERA Avalon JTAG UART driver, but the " \ - "interrupt is not connected for this device. You can " \ - "select a polled mode driver by checking the 'small " \ - "driver' option in the HAL configuration window, or " \ - "by using the -DALTERA_AVALON_JTAG_UART_SMALL " \ - "preprocessor flag."); \ - } \ - else \ - altera_avalon_jtag_uart_init(&state, \ - name##_IRQ_INTERRUPT_CONTROLLER_ID, \ - name##_IRQ); \ - } - -#endif /* ALTERA_AVALON_JTAG_UART_SMALL */ - -/* - * Include in case non-direct version of driver required. - */ -#include "altera_avalon_jtag_uart_fd.h" - -/* - * Map alt_sys_init macros to direct or non-direct versions. - */ -#ifdef ALT_USE_DIRECT_DRIVERS - -#define ALTERA_AVALON_JTAG_UART_INSTANCE(name, state) \ - ALTERA_AVALON_JTAG_UART_STATE_INSTANCE(name, state) -#define ALTERA_AVALON_JTAG_UART_INIT(name, state) \ - ALTERA_AVALON_JTAG_UART_STATE_INIT(name, state) - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -#define ALTERA_AVALON_JTAG_UART_INSTANCE(name, dev) \ - ALTERA_AVALON_JTAG_UART_DEV_INSTANCE(name, dev) -#define ALTERA_AVALON_JTAG_UART_INIT(name, dev) \ - ALTERA_AVALON_JTAG_UART_DEV_INIT(name, dev) - -#endif /* ALT_USE_DIRECT_DRIVERS */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_AVALON_JTAG_UART_H__ */ diff --git a/software/qsys_tutorial_green_bsp/drivers/inc/altera_avalon_jtag_uart_fd.h b/software/qsys_tutorial_green_bsp/drivers/inc/altera_avalon_jtag_uart_fd.h deleted file mode 100644 index b3c3200..0000000 --- a/software/qsys_tutorial_green_bsp/drivers/inc/altera_avalon_jtag_uart_fd.h +++ /dev/null @@ -1,125 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#ifndef __ALT_AVALON_JTAG_UART_FD_H__ -#define __ALT_AVALON_JTAG_UART_FD_H__ - -#include "sys/alt_dev.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * Externally referenced routines - */ -extern int altera_avalon_jtag_uart_read_fd (alt_fd* fd, char* ptr, int len); -extern int altera_avalon_jtag_uart_write_fd (alt_fd* fd, const char* ptr, - int len); - -/* - * Device structure definition. This is needed by alt_sys_init in order to - * reserve memory for the device instance. - */ - -typedef struct altera_avalon_jtag_uart_dev_s -{ - alt_dev dev; - altera_avalon_jtag_uart_state state; -} altera_avalon_jtag_uart_dev; - -/* - * Macros used by alt_sys_init when the ALT file descriptor facility is used. - */ - -#ifdef ALTERA_AVALON_JTAG_UART_SMALL - -#define ALTERA_AVALON_JTAG_UART_DEV_INSTANCE(name, d) \ - static altera_avalon_jtag_uart_dev d = \ - { \ - { \ - ALT_LLIST_ENTRY, \ - name##_NAME, \ - NULL, /* open */ \ - NULL, /* close */ \ - altera_avalon_jtag_uart_read_fd, \ - altera_avalon_jtag_uart_write_fd, \ - NULL, /* lseek */ \ - NULL, /* fstat */ \ - NULL, /* ioctl */ \ - }, \ - { \ - name##_BASE, \ - } \ - } - -#define ALTERA_AVALON_JTAG_UART_DEV_INIT(name, d) alt_dev_reg (&d.dev) - -#else /* !ALTERA_AVALON_JTAG_UART_SMALL */ - -extern int altera_avalon_jtag_uart_close_fd(alt_fd* fd); -extern int altera_avalon_jtag_uart_ioctl_fd (alt_fd* fd, int req, void* arg); - -#define ALTERA_AVALON_JTAG_UART_DEV_INSTANCE(name, d) \ - static altera_avalon_jtag_uart_dev d = \ - { \ - { \ - ALT_LLIST_ENTRY, \ - name##_NAME, \ - NULL, /* open */ \ - altera_avalon_jtag_uart_close_fd, \ - altera_avalon_jtag_uart_read_fd, \ - altera_avalon_jtag_uart_write_fd, \ - NULL, /* lseek */ \ - NULL, /* fstat */ \ - altera_avalon_jtag_uart_ioctl_fd, \ - }, \ - { \ - name##_BASE, \ - ALTERA_AVALON_JTAG_UART_DEFAULT_TIMEOUT, \ - } \ - } - -#define ALTERA_AVALON_JTAG_UART_DEV_INIT(name, d) \ - { \ - ALTERA_AVALON_JTAG_UART_STATE_INIT(name, d.state); \ - \ - /* make the device available to the system */ \ - alt_dev_reg(&d.dev); \ - } - -#endif /* ALTERA_AVALON_JTAG_UART_SMALL */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_AVALON_JTAG_UART_FD_H__ */ diff --git a/software/qsys_tutorial_green_bsp/drivers/inc/altera_avalon_jtag_uart_regs.h b/software/qsys_tutorial_green_bsp/drivers/inc/altera_avalon_jtag_uart_regs.h deleted file mode 100644 index 7f97160..0000000 --- a/software/qsys_tutorial_green_bsp/drivers/inc/altera_avalon_jtag_uart_regs.h +++ /dev/null @@ -1,73 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#ifndef __ALTERA_AVALON_JTAG_UART_REGS_H__ -#define __ALTERA_AVALON_JTAG_UART_REGS_H__ - -#include - -#define ALTERA_AVALON_JTAG_UART_DATA_REG 0 -#define IOADDR_ALTERA_AVALON_JTAG_UART_DATA(base) \ - __IO_CALC_ADDRESS_NATIVE(base, ALTERA_AVALON_JTAG_UART_DATA_REG) -#define IORD_ALTERA_AVALON_JTAG_UART_DATA(base) \ - IORD(base, ALTERA_AVALON_JTAG_UART_DATA_REG) -#define IOWR_ALTERA_AVALON_JTAG_UART_DATA(base, data) \ - IOWR(base, ALTERA_AVALON_JTAG_UART_DATA_REG, data) - -#define ALTERA_AVALON_JTAG_UART_DATA_DATA_MSK (0x000000FF) -#define ALTERA_AVALON_JTAG_UART_DATA_DATA_OFST (0) -#define ALTERA_AVALON_JTAG_UART_DATA_RVALID_MSK (0x00008000) -#define ALTERA_AVALON_JTAG_UART_DATA_RVALID_OFST (15) -#define ALTERA_AVALON_JTAG_UART_DATA_RAVAIL_MSK (0xFFFF0000) -#define ALTERA_AVALON_JTAG_UART_DATA_RAVAIL_OFST (16) - - -#define ALTERA_AVALON_JTAG_UART_CONTROL_REG 1 -#define IOADDR_ALTERA_AVALON_JTAG_UART_CONTROL(base) \ - __IO_CALC_ADDRESS_NATIVE(base, ALTERA_AVALON_JTAG_UART_CONTROL_REG) -#define IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base) \ - IORD(base, ALTERA_AVALON_JTAG_UART_CONTROL_REG) -#define IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(base, data) \ - IOWR(base, ALTERA_AVALON_JTAG_UART_CONTROL_REG, data) - -#define ALTERA_AVALON_JTAG_UART_CONTROL_RE_MSK (0x00000001) -#define ALTERA_AVALON_JTAG_UART_CONTROL_RE_OFST (0) -#define ALTERA_AVALON_JTAG_UART_CONTROL_WE_MSK (0x00000002) -#define ALTERA_AVALON_JTAG_UART_CONTROL_WE_OFST (1) -#define ALTERA_AVALON_JTAG_UART_CONTROL_RI_MSK (0x00000100) -#define ALTERA_AVALON_JTAG_UART_CONTROL_RI_OFST (8) -#define ALTERA_AVALON_JTAG_UART_CONTROL_WI_MSK (0x00000200) -#define ALTERA_AVALON_JTAG_UART_CONTROL_WI_OFST (9) -#define ALTERA_AVALON_JTAG_UART_CONTROL_AC_MSK (0x00000400) -#define ALTERA_AVALON_JTAG_UART_CONTROL_AC_OFST (10) -#define ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_MSK (0xFFFF0000) -#define ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_OFST (16) - -#endif /* __ALTERA_AVALON_JTAG_UART_REGS_H__ */ diff --git a/software/qsys_tutorial_green_bsp/drivers/inc/altera_avalon_pio_regs.h b/software/qsys_tutorial_green_bsp/drivers/inc/altera_avalon_pio_regs.h deleted file mode 100644 index 052439f..0000000 --- a/software/qsys_tutorial_green_bsp/drivers/inc/altera_avalon_pio_regs.h +++ /dev/null @@ -1,67 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#ifndef __ALTERA_AVALON_PIO_REGS_H__ -#define __ALTERA_AVALON_PIO_REGS_H__ - -#include - -#define IOADDR_ALTERA_AVALON_PIO_DATA(base) __IO_CALC_ADDRESS_NATIVE(base, 0) -#define IORD_ALTERA_AVALON_PIO_DATA(base) IORD(base, 0) -#define IOWR_ALTERA_AVALON_PIO_DATA(base, data) IOWR(base, 0, data) - -#define IOADDR_ALTERA_AVALON_PIO_DIRECTION(base) __IO_CALC_ADDRESS_NATIVE(base, 1) -#define IORD_ALTERA_AVALON_PIO_DIRECTION(base) IORD(base, 1) -#define IOWR_ALTERA_AVALON_PIO_DIRECTION(base, data) IOWR(base, 1, data) - -#define IOADDR_ALTERA_AVALON_PIO_IRQ_MASK(base) __IO_CALC_ADDRESS_NATIVE(base, 2) -#define IORD_ALTERA_AVALON_PIO_IRQ_MASK(base) IORD(base, 2) -#define IOWR_ALTERA_AVALON_PIO_IRQ_MASK(base, data) IOWR(base, 2, data) - -#define IOADDR_ALTERA_AVALON_PIO_EDGE_CAP(base) __IO_CALC_ADDRESS_NATIVE(base, 3) -#define IORD_ALTERA_AVALON_PIO_EDGE_CAP(base) IORD(base, 3) -#define IOWR_ALTERA_AVALON_PIO_EDGE_CAP(base, data) IOWR(base, 3, data) - - -#define IOADDR_ALTERA_AVALON_PIO_SET_BIT(base) __IO_CALC_ADDRESS_NATIVE(base, 4) -#define IORD_ALTERA_AVALON_PIO_SET_BITS(base) IORD(base, 4) -#define IOWR_ALTERA_AVALON_PIO_SET_BITS(base, data) IOWR(base, 4, data) - -#define IOADDR_ALTERA_AVALON_PIO_CLEAR_BITS(base) __IO_CALC_ADDRESS_NATIVE(base, 5) -#define IORD_ALTERA_AVALON_PIO_CLEAR_BITS(base) IORD(base, 5) -#define IOWR_ALTERA_AVALON_PIO_CLEAR_BITS(base, data) IOWR(base, 5, data) - - - -/* Defintions for direction-register operation with bi-directional PIOs */ -#define ALTERA_AVALON_PIO_DIRECTION_INPUT 0 -#define ALTERA_AVALON_PIO_DIRECTION_OUTPUT 1 - -#endif /* __ALTERA_AVALON_PIO_REGS_H__ */ diff --git a/software/qsys_tutorial_green_bsp/drivers/src/altera_avalon_jtag_uart_fd.c b/software/qsys_tutorial_green_bsp/drivers/src/altera_avalon_jtag_uart_fd.c deleted file mode 100644 index 53dfc3b..0000000 --- a/software/qsys_tutorial_green_bsp/drivers/src/altera_avalon_jtag_uart_fd.c +++ /dev/null @@ -1,86 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "alt_types.h" -#include "sys/alt_dev.h" -#include "altera_avalon_jtag_uart.h" - -extern int altera_avalon_jtag_uart_read(altera_avalon_jtag_uart_state* sp, - char* buffer, int space, int flags); -extern int altera_avalon_jtag_uart_write(altera_avalon_jtag_uart_state* sp, - const char* ptr, int count, int flags); -extern int altera_avalon_jtag_uart_ioctl(altera_avalon_jtag_uart_state* sp, - int req, void* arg); -extern int altera_avalon_jtag_uart_close(altera_avalon_jtag_uart_state* sp, - int flags); - -/* ----------------------------------------------------------------------- */ -/* --------------------- WRAPPERS FOR ALT FD SUPPORT --------------------- */ -/* - * - */ - -int -altera_avalon_jtag_uart_read_fd(alt_fd* fd, char* buffer, int space) -{ - altera_avalon_jtag_uart_dev* dev = (altera_avalon_jtag_uart_dev*) fd->dev; - - return altera_avalon_jtag_uart_read(&dev->state, buffer, space, - fd->fd_flags); -} - -int -altera_avalon_jtag_uart_write_fd(alt_fd* fd, const char* buffer, int space) -{ - altera_avalon_jtag_uart_dev* dev = (altera_avalon_jtag_uart_dev*) fd->dev; - - return altera_avalon_jtag_uart_write(&dev->state, buffer, space, - fd->fd_flags); -} - -#ifndef ALTERA_AVALON_JTAG_UART_SMALL - -int -altera_avalon_jtag_uart_close_fd(alt_fd* fd) -{ - altera_avalon_jtag_uart_dev* dev = (altera_avalon_jtag_uart_dev*) fd->dev; - - return altera_avalon_jtag_uart_close(&dev->state, fd->fd_flags); -} - -int -altera_avalon_jtag_uart_ioctl_fd(alt_fd* fd, int req, void* arg) -{ - altera_avalon_jtag_uart_dev* dev = (altera_avalon_jtag_uart_dev*) fd->dev; - - return altera_avalon_jtag_uart_ioctl(&dev->state, req, arg); -} - -#endif /* ALTERA_AVALON_JTAG_UART_SMALL */ diff --git a/software/qsys_tutorial_green_bsp/drivers/src/altera_avalon_jtag_uart_init.c b/software/qsys_tutorial_green_bsp/drivers/src/altera_avalon_jtag_uart_init.c deleted file mode 100644 index 7317bec..0000000 --- a/software/qsys_tutorial_green_bsp/drivers/src/altera_avalon_jtag_uart_init.c +++ /dev/null @@ -1,256 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include -#include -#include -#include - -#include - -#include "sys/alt_irq.h" -#include "sys/alt_alarm.h" -#include "sys/ioctl.h" -#include "alt_types.h" - -#include "altera_avalon_jtag_uart_regs.h" -#include "altera_avalon_jtag_uart.h" - -#include "sys/alt_log_printf.h" - -#ifndef ALTERA_AVALON_JTAG_UART_SMALL - -/* ----------------------------------------------------------- */ -/* ------------------------- FAST DRIVER --------------------- */ -/* ----------------------------------------------------------- */ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT -static void altera_avalon_jtag_uart_irq(void* context); -#else -static void altera_avalon_jtag_uart_irq(void* context, alt_u32 id); -#endif -static alt_u32 altera_avalon_jtag_uart_timeout(void* context); - -/* - * Driver initialization code. Register interrupts and start a timer - * which we can use to check whether the host is there. - * Return 1 on sucessful IRQ register and 0 on failure. - */ - -void altera_avalon_jtag_uart_init(altera_avalon_jtag_uart_state* sp, - int irq_controller_id, int irq) -{ - ALT_FLAG_CREATE(&sp->events, 0); - ALT_SEM_CREATE(&sp->read_lock, 1); - ALT_SEM_CREATE(&sp->write_lock, 1); - - /* enable read interrupts at the device */ - sp->irq_enable = ALTERA_AVALON_JTAG_UART_CONTROL_RE_MSK; - - IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base, sp->irq_enable); - - /* register the interrupt handler */ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - alt_ic_isr_register(irq_controller_id, irq, altera_avalon_jtag_uart_irq, - sp, NULL); -#else - alt_irq_register(irq, sp, altera_avalon_jtag_uart_irq); -#endif - - /* Register an alarm to go off every second to check for presence of host */ - sp->host_inactive = 0; - - if (alt_alarm_start(&sp->alarm, alt_ticks_per_second(), - &altera_avalon_jtag_uart_timeout, sp) < 0) - { - /* If we can't set the alarm then record "don't know if host present" - * and behave as though the host is present. - */ - sp->timeout = INT_MAX; - } - - /* ALT_LOG - see altera_hal/HAL/inc/sys/alt_log_printf.h */ - ALT_LOG_JTAG_UART_ALARM_REGISTER(sp, sp->base); -} - -/* - * Interrupt routine - */ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT -static void altera_avalon_jtag_uart_irq(void* context) -#else -static void altera_avalon_jtag_uart_irq(void* context, alt_u32 id) -#endif -{ - altera_avalon_jtag_uart_state* sp = (altera_avalon_jtag_uart_state*) context; - unsigned int base = sp->base; - - /* ALT_LOG - see altera_hal/HAL/inc/sys/alt_log_printf.h */ - ALT_LOG_JTAG_UART_ISR_FUNCTION(base, sp); - - for ( ; ; ) - { - unsigned int control = IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base); - - /* Return once nothing more to do */ - if ((control & (ALTERA_AVALON_JTAG_UART_CONTROL_RI_MSK | ALTERA_AVALON_JTAG_UART_CONTROL_WI_MSK)) == 0) - break; - - if (control & ALTERA_AVALON_JTAG_UART_CONTROL_RI_MSK) - { - /* process a read irq. Start by assuming that there is data in the - * receive FIFO (otherwise why would we have been interrupted?) - */ - unsigned int data = 1 << ALTERA_AVALON_JTAG_UART_DATA_RAVAIL_OFST; - - for ( ; ; ) - { - /* Check whether there is space in the buffer. If not then we must not - * read any characters from the buffer as they will be lost. - */ - unsigned int next = (sp->rx_in + 1) % ALTERA_AVALON_JTAG_UART_BUF_LEN; - if (next == sp->rx_out) - break; - - /* Try to remove a character from the FIFO and find out whether there - * are any more characters remaining. - */ - data = IORD_ALTERA_AVALON_JTAG_UART_DATA(base); - - if ((data & ALTERA_AVALON_JTAG_UART_DATA_RVALID_MSK) == 0) - break; - - sp->rx_buf[sp->rx_in] = (data & ALTERA_AVALON_JTAG_UART_DATA_DATA_MSK) >> ALTERA_AVALON_JTAG_UART_DATA_DATA_OFST; - sp->rx_in = (sp->rx_in + 1) % ALTERA_AVALON_JTAG_UART_BUF_LEN; - - /* Post an event to notify jtag_uart_read that a character has been read */ - ALT_FLAG_POST (sp->events, ALT_JTAG_UART_READ_RDY, OS_FLAG_SET); - } - - if (data & ALTERA_AVALON_JTAG_UART_DATA_RAVAIL_MSK) - { - /* If there is still data available here then the buffer is full - * so turn off receive interrupts until some space becomes available. - */ - sp->irq_enable &= ~ALTERA_AVALON_JTAG_UART_CONTROL_RE_MSK; - IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(base, sp->irq_enable); - - /* Dummy read to ensure IRQ is cleared prior to ISR completion */ - IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base); - } - } - - if (control & ALTERA_AVALON_JTAG_UART_CONTROL_WI_MSK) - { - /* process a write irq */ - unsigned int space = (control & ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_MSK) >> ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_OFST; - - while (space > 0 && sp->tx_out != sp->tx_in) - { - IOWR_ALTERA_AVALON_JTAG_UART_DATA(base, sp->tx_buf[sp->tx_out]); - - sp->tx_out = (sp->tx_out + 1) % ALTERA_AVALON_JTAG_UART_BUF_LEN; - - /* Post an event to notify jtag_uart_write that a character has been written */ - ALT_FLAG_POST (sp->events, ALT_JTAG_UART_WRITE_RDY, OS_FLAG_SET); - - space--; - } - - if (space > 0) - { - /* If we don't have any more data available then turn off the TX interrupt */ - sp->irq_enable &= ~ALTERA_AVALON_JTAG_UART_CONTROL_WE_MSK; - IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base, sp->irq_enable); - - /* Dummy read to ensure IRQ is cleared prior to ISR completion */ - IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base); - } - } - } -} - -/* - * Timeout routine is called every second - */ - -static alt_u32 -altera_avalon_jtag_uart_timeout(void* context) -{ - altera_avalon_jtag_uart_state* sp = (altera_avalon_jtag_uart_state *) context; - - unsigned int control = IORD_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base); - - if (control & ALTERA_AVALON_JTAG_UART_CONTROL_AC_MSK) - { - IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base, sp->irq_enable | ALTERA_AVALON_JTAG_UART_CONTROL_AC_MSK); - sp->host_inactive = 0; - } - else if (sp->host_inactive < INT_MAX - 2) { - sp->host_inactive++; - - if (sp->host_inactive >= sp->timeout) { - /* Post an event to indicate host is inactive (for jtag_uart_read */ - ALT_FLAG_POST (sp->events, ALT_JTAG_UART_TIMEOUT, OS_FLAG_SET); - } - } - - return alt_ticks_per_second(); -} - -/* - * The close() routine is implemented to drain the JTAG UART transmit buffer - * when not in "small" mode. This routine will wait for transimt data to be - * emptied unless a timeout from host-activity occurs. If the driver flags - * have been set to non-blocking mode, this routine will exit immediately if - * any data remains. This routine should be called indirectly (i.e. though - * the C library close() routine) so that the file descriptor associated - * with the relevant stream (i.e. stdout) can be closed as well. This routine - * does not manage file descriptors. - * - * The close routine is not implemented for the small driver; instead it will - * map to null. This is because the small driver simply waits while characters - * are transmitted; there is no interrupt-serviced buffer to empty - */ -int altera_avalon_jtag_uart_close(altera_avalon_jtag_uart_state* sp, int flags) -{ - /* - * Wait for all transmit data to be emptied by the JTAG UART ISR, or - * for a host-inactivity timeout, in which case transmit data will be lost - */ - while ( (sp->tx_out != sp->tx_in) && (sp->host_inactive < sp->timeout) ) { - if (flags & O_NONBLOCK) { - return -EWOULDBLOCK; - } - } - - return 0; -} - -#endif /* !ALTERA_AVALON_JTAG_UART_SMALL */ diff --git a/software/qsys_tutorial_green_bsp/drivers/src/altera_avalon_jtag_uart_ioctl.c b/software/qsys_tutorial_green_bsp/drivers/src/altera_avalon_jtag_uart_ioctl.c deleted file mode 100644 index cf71e6f..0000000 --- a/software/qsys_tutorial_green_bsp/drivers/src/altera_avalon_jtag_uart_ioctl.c +++ /dev/null @@ -1,86 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include -#include -#include -#include - -#include - -#include "sys/ioctl.h" -#include "alt_types.h" - -#include "altera_avalon_jtag_uart_regs.h" -#include "altera_avalon_jtag_uart.h" - -#include "sys/alt_log_printf.h" - -#ifndef ALTERA_AVALON_JTAG_UART_SMALL - -/* ----------------------------------------------------------- */ -/* ------------------------- FAST DRIVER --------------------- */ -/* ----------------------------------------------------------- */ - -int -altera_avalon_jtag_uart_ioctl(altera_avalon_jtag_uart_state* sp, int req, - void* arg) -{ - int rc = -ENOTTY; - - switch (req) - { - case TIOCSTIMEOUT: - /* Set the time to wait until assuming host is not connected */ - if (sp->timeout != INT_MAX) - { - int timeout = *((int *)arg); - sp->timeout = (timeout >= 2 && timeout < INT_MAX) ? timeout : INT_MAX - 1; - rc = 0; - } - break; - - case TIOCGCONNECTED: - /* Find out whether host is connected */ - if (sp->timeout != INT_MAX) - { - *((int *)arg) = (sp->host_inactive < sp->timeout) ? 1 : 0; - rc = 0; - } - break; - - default: - break; - } - - return rc; -} - -#endif /* !ALTERA_AVALON_JTAG_UART_SMALL */ diff --git a/software/qsys_tutorial_green_bsp/drivers/src/altera_avalon_jtag_uart_read.c b/software/qsys_tutorial_green_bsp/drivers/src/altera_avalon_jtag_uart_read.c deleted file mode 100644 index 5657adb..0000000 --- a/software/qsys_tutorial_green_bsp/drivers/src/altera_avalon_jtag_uart_read.c +++ /dev/null @@ -1,205 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include -#include -#include -#include - -#include - -#include "sys/alt_irq.h" -#include "sys/alt_alarm.h" -#include "sys/ioctl.h" -#include "alt_types.h" - -#include "altera_avalon_jtag_uart_regs.h" -#include "altera_avalon_jtag_uart.h" - -#include "sys/alt_log_printf.h" - -#ifdef __ucosii__ -#include "includes.h" -#endif /* __ucosii__ */ - -#ifdef ALTERA_AVALON_JTAG_UART_SMALL - -/* ----------------------------------------------------------- */ -/* ----------------------- SMALL DRIVER ---------------------- */ -/* ----------------------------------------------------------- */ - -/* Read routine. The small version blocks until it has at least one byte - * available, it then returns as much as is immediately available without - * waiting any more. It's performance will be very poor without - * interrupts. - */ - -int -altera_avalon_jtag_uart_read(altera_avalon_jtag_uart_state* sp, - char* buffer, int space, int flags) -{ - unsigned int base = sp->base; - - char * ptr = buffer; - char * end = buffer + space; - - while (ptr < end) - { - unsigned int data = IORD_ALTERA_AVALON_JTAG_UART_DATA(base); - - if (data & ALTERA_AVALON_JTAG_UART_DATA_RVALID_MSK) - *ptr++ = (data & ALTERA_AVALON_JTAG_UART_DATA_DATA_MSK) >> ALTERA_AVALON_JTAG_UART_DATA_DATA_OFST; - else if (ptr != buffer) - break; - else if(flags & O_NONBLOCK) - break; - - } - - if (ptr != buffer) - return ptr - buffer; - else if (flags & O_NONBLOCK) - return -EWOULDBLOCK; - else - return -EIO; -} - -#else /* !ALTERA_AVALON_JTAG_UART_SMALL */ - -/* ----------------------------------------------------------- */ -/* ----------------------- FAST DRIVER ----------------------- */ -/* ----------------------------------------------------------- */ - -int -altera_avalon_jtag_uart_read(altera_avalon_jtag_uart_state* sp, - char * buffer, int space, int flags) -{ - char * ptr = buffer; - - alt_irq_context context; - unsigned int n; - - /* - * When running in a multi threaded environment, obtain the "read_lock" - * semaphore. This ensures that reading from the device is thread-safe. - */ - ALT_SEM_PEND (sp->read_lock, 0); - - while (space > 0) - { - unsigned int in, out; - - /* Read as much data as possible */ - do - { - in = sp->rx_in; - out = sp->rx_out; - - if (in >= out) - n = in - out; - else - n = ALTERA_AVALON_JTAG_UART_BUF_LEN - out; - - if (n == 0) - break; /* No more data available */ - - if (n > space) - n = space; - - memcpy(ptr, sp->rx_buf + out, n); - ptr += n; - space -= n; - - sp->rx_out = (out + n) % ALTERA_AVALON_JTAG_UART_BUF_LEN; - } - while (space > 0); - - /* If we read any data then return it */ - if (ptr != buffer) - break; - - /* If in non-blocking mode then return error */ - if (flags & O_NONBLOCK) - break; - -#ifdef __ucosii__ - /* OS Present: Pend on a flag if the OS is running, otherwise spin */ - if(OSRunning == OS_TRUE) { - /* - * When running in a multi-threaded mode, we pend on the read event - * flag set and timeout event flag set in the isr. This avoids wasting CPU - * cycles waiting in this thread, when we could be doing something more - * profitable elsewhere. - */ - ALT_FLAG_PEND (sp->events, - ALT_JTAG_UART_READ_RDY | ALT_JTAG_UART_TIMEOUT, - OS_FLAG_WAIT_SET_ANY + OS_FLAG_CONSUME, - 0); - } - else { - /* Spin until more data arrives or until host disconnects */ - while (in == sp->rx_in && sp->host_inactive < sp->timeout) - ; - } -#else - /* No OS: Always spin */ - while (in == sp->rx_in && sp->host_inactive < sp->timeout) - ; -#endif /* __ucosii__ */ - - if (in == sp->rx_in) - break; - } - - /* - * Now that access to the circular buffer is complete, release the read - * semaphore so that other threads can access the buffer. - */ - - ALT_SEM_POST (sp->read_lock); - - if (ptr != buffer) - { - /* If we read any data then there is space in the buffer so enable interrupts */ - context = alt_irq_disable_all(); - sp->irq_enable |= ALTERA_AVALON_JTAG_UART_CONTROL_RE_MSK; - IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base, sp->irq_enable); - alt_irq_enable_all(context); - } - - if (ptr != buffer) - return ptr - buffer; - else if (flags & O_NONBLOCK) - return -EWOULDBLOCK; - else - return -EIO; -} - -#endif /* ALTERA_AVALON_JTAG_UART_SMALL */ diff --git a/software/qsys_tutorial_green_bsp/drivers/src/altera_avalon_jtag_uart_write.c b/software/qsys_tutorial_green_bsp/drivers/src/altera_avalon_jtag_uart_write.c deleted file mode 100644 index 11aeca1..0000000 --- a/software/qsys_tutorial_green_bsp/drivers/src/altera_avalon_jtag_uart_write.c +++ /dev/null @@ -1,217 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include -#include -#include -#include - -#include - -#include "sys/alt_irq.h" -#include "sys/alt_alarm.h" -#include "sys/ioctl.h" -#include "alt_types.h" - -#include "altera_avalon_jtag_uart_regs.h" -#include "altera_avalon_jtag_uart.h" - -#include "sys/alt_log_printf.h" - -#ifdef __ucosii__ -#include "includes.h" -#endif /* __ucosii__ */ - -#ifdef ALTERA_AVALON_JTAG_UART_SMALL - -/* ----------------------------------------------------------- */ -/* ------------------------ SMALL DRIVER --------------------- */ -/* ----------------------------------------------------------- */ - -/* Write routine. The small version blocks when there is no space to write - * into, so it's performance will be very bad if you are writing more than - * one FIFOs worth of data. But you said you didn't want to use interrupts :-) - */ - -int altera_avalon_jtag_uart_write(altera_avalon_jtag_uart_state* sp, - const char * ptr, int count, int flags) -{ - unsigned int base = sp->base; - - const char * end = ptr + count; - - while (ptr < end) - if ((IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base) & ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_MSK) != 0) - IOWR_ALTERA_AVALON_JTAG_UART_DATA(base, *ptr++); - - return count; -} - -#else /* !ALTERA_AVALON_JTAG_UART_SMALL */ - -/* ----------------------------------------------------------- */ -/* ------------------------- FAST DRIVER --------------------- */ -/* ----------------------------------------------------------- */ - -int -altera_avalon_jtag_uart_write(altera_avalon_jtag_uart_state* sp, - const char * ptr, int count, int flags) -{ - /* Remove warning at optimisation level 03 by seting out to 0 */ - unsigned int in, out=0; - unsigned int n; - alt_irq_context context; - - const char * start = ptr; - - /* - * When running in a multi threaded environment, obtain the "write_lock" - * semaphore. This ensures that writing to the device is thread-safe. - */ - ALT_SEM_PEND (sp->write_lock, 0); - - do - { - /* Copy as much as we can into the transmit buffer */ - while (count > 0) - { - /* We need a stable value of the out pointer to calculate the space available */ - in = sp->tx_in; - out = sp->tx_out; - - if (in < out) - n = out - 1 - in; - else if (out > 0) - n = ALTERA_AVALON_JTAG_UART_BUF_LEN - in; - else - n = ALTERA_AVALON_JTAG_UART_BUF_LEN - 1 - in; - - if (n == 0) - break; - - if (n > count) - n = count; - - memcpy(sp->tx_buf + in, ptr, n); - ptr += n; - count -= n; - - sp->tx_in = (in + n) % ALTERA_AVALON_JTAG_UART_BUF_LEN; - } - - /* - * If interrupts are disabled then we could transmit here, we only need - * to enable interrupts if there is no space left in the FIFO - * - * For now kick the interrupt routine every time to make it transmit - * the data - */ - context = alt_irq_disable_all(); - sp->irq_enable |= ALTERA_AVALON_JTAG_UART_CONTROL_WE_MSK; - IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base, sp->irq_enable); - alt_irq_enable_all(context); - - /* - * If there is any data left then either return now or block until - * some has been sent - */ - /* consider: test whether there is anything there while doing this and delay for at most 2s. */ - if (count > 0) - { - if (flags & O_NONBLOCK) - break; - -#ifdef __ucosii__ - /* OS Present: Pend on a flag if the OS is running, otherwise spin */ - if(OSRunning == OS_TRUE) { - /* - * When running in a multi-threaded mode, we pend on the write event - * flag set or the timeout flag in the isr. This avoids wasting CPU - * cycles waiting in this thread, when we could be doing something - * more profitable elsewhere. - */ -#ifdef ALTERA_AVALON_JTAG_UART_IGNORE_FIFO_FULL_ERROR - if(!sp->host_inactive) -#endif - ALT_FLAG_PEND (sp->events, - ALT_JTAG_UART_WRITE_RDY | ALT_JTAG_UART_TIMEOUT, - OS_FLAG_WAIT_SET_ANY + OS_FLAG_CONSUME, - 0); - } - else { - /* - * OS not running: Wait for data to be removed from buffer. - * Once the interrupt routine has removed some data then we - * will be able to insert some more. - */ - while (out == sp->tx_out && sp->host_inactive < sp->timeout) - ; - } -#else - /* - * No OS present: Always wait for data to be removed from buffer. Once - * the interrupt routine has removed some data then we will be able to - * insert some more. - */ - while (out == sp->tx_out && sp->host_inactive < sp->timeout) - ; -#endif /* __ucosii__ */ - - if (out == sp->tx_out) - break; - } - } - while (count > 0); - - /* - * Now that access to the circular buffer is complete, release the write - * semaphore so that other threads can access the buffer. - */ - ALT_SEM_POST (sp->write_lock); - - if (ptr != start) - return ptr - start; - else if (flags & O_NONBLOCK) - return -EWOULDBLOCK; -#ifdef ALTERA_AVALON_JTAG_UART_IGNORE_FIFO_FULL_ERROR - else if (sp->host_inactive >= sp->timeout) { - /* - * Reset the software FIFO, hardware FIFO could not be reset. - * Just throw away characters without reporting error. - */ - sp->tx_out = sp->tx_in = 0; - return ptr - start + count; - } -#endif - else - return -EIO; /* Host not connected */ -} - -#endif /* ALTERA_AVALON_JTAG_UART_SMALL */ diff --git a/software/qsys_tutorial_green_bsp/libhal_bsp.a b/software/qsys_tutorial_green_bsp/libhal_bsp.a deleted file mode 100644 index 1879aa9..0000000 --- a/software/qsys_tutorial_green_bsp/libhal_bsp.a +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/linker.h b/software/qsys_tutorial_green_bsp/linker.h deleted file mode 100644 index 9e03bbf..0000000 --- a/software/qsys_tutorial_green_bsp/linker.h +++ /dev/null @@ -1,101 +0,0 @@ -/* - * linker.h - Linker script mapping information - * - * Machine generated for CPU 'nios2_processor' in SOPC Builder design 'nios_system' - * SOPC Builder design path: C:/Users/takayun/Desktop/qsys_tutorial/nios_system.sopcinfo - * - * Generated: Thu Oct 27 10:41:20 JST 2016 - */ - -/* - * DO NOT MODIFY THIS FILE - * - * Changing this file will have subtle consequences - * which will almost certainly lead to a nonfunctioning - * system. If you do modify this file, be aware that your - * changes will be overwritten and lost when this file - * is generated again. - * - * DO NOT MODIFY THIS FILE - */ - -/* - * License Agreement - * - * Copyright (c) 2008 - * Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - * - * This agreement shall be governed in all respects by the laws of the State - * of California and by the laws of the United States of America. - */ - -#ifndef __LINKER_H_ -#define __LINKER_H_ - - -/* - * BSP controls alt_load() behavior in crt0. - * - */ - -#define ALT_LOAD_EXPLICITLY_CONTROLLED - - -/* - * Base address and span (size in bytes) of each linker region - * - */ - -#define ONCHIP_MEMORY_REGION_BASE 0x20 -#define ONCHIP_MEMORY_REGION_SPAN 4064 -#define RESET_REGION_BASE 0x0 -#define RESET_REGION_SPAN 32 - - -/* - * Devices associated with code sections - * - */ - -#define ALT_EXCEPTIONS_DEVICE ONCHIP_MEMORY -#define ALT_RESET_DEVICE ONCHIP_MEMORY -#define ALT_RODATA_DEVICE ONCHIP_MEMORY -#define ALT_RWDATA_DEVICE ONCHIP_MEMORY -#define ALT_TEXT_DEVICE ONCHIP_MEMORY - - -/* - * Initialization code at the reset address is allowed (e.g. no external bootloader). - * - */ - -#define ALT_ALLOW_CODE_AT_RESET - - -/* - * The alt_load() facility is called from crt0 to copy sections into RAM. - * - */ - -#define ALT_LOAD_COPY_RWDATA - -#endif /* __LINKER_H_ */ diff --git a/software/qsys_tutorial_green_bsp/linker.x b/software/qsys_tutorial_green_bsp/linker.x deleted file mode 100644 index ab70655..0000000 --- a/software/qsys_tutorial_green_bsp/linker.x +++ /dev/null @@ -1,385 +0,0 @@ -/* - * linker.x - Linker script - * - * Machine generated for CPU 'nios2_processor' in SOPC Builder design 'nios_system' - * SOPC Builder design path: C:/Users/takayun/Desktop/qsys_tutorial/nios_system.sopcinfo - * - * Generated: Thu Oct 27 10:41:20 JST 2016 - */ - -/* - * DO NOT MODIFY THIS FILE - * - * Changing this file will have subtle consequences - * which will almost certainly lead to a nonfunctioning - * system. If you do modify this file, be aware that your - * changes will be overwritten and lost when this file - * is generated again. - * - * DO NOT MODIFY THIS FILE - */ - -/* - * License Agreement - * - * Copyright (c) 2008 - * Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - * - * This agreement shall be governed in all respects by the laws of the State - * of California and by the laws of the United States of America. - */ - -MEMORY -{ - reset : ORIGIN = 0x0, LENGTH = 32 - onchip_memory : ORIGIN = 0x20, LENGTH = 4064 -} - -/* Define symbols for each memory base-address */ -__alt_mem_onchip_memory = 0x0; - -OUTPUT_FORMAT( "elf32-littlenios2", - "elf32-littlenios2", - "elf32-littlenios2" ) -OUTPUT_ARCH( nios2 ) -ENTRY( _start ) - -/* - * The alt_load() facility is enabled. This typically happens when there isn't - * an external bootloader (e.g. flash bootloader). - * The LMA (aka physical address) of each loaded section is - * set to the .text memory device. - * The HAL alt_load() routine called from crt0 copies sections from - * the .text memory to RAM as needed. - */ - -SECTIONS -{ - - /* - * Output sections associated with reset and exceptions (they have to be first) - */ - - .entry : - { - KEEP (*(.entry)) - } > reset - - .exceptions : - { - PROVIDE (__ram_exceptions_start = ABSOLUTE(.)); - . = ALIGN(0x20); - KEEP (*(.irq)); - KEEP (*(.exceptions.entry.label)); - KEEP (*(.exceptions.entry.user)); - KEEP (*(.exceptions.entry)); - KEEP (*(.exceptions.irqtest.user)); - KEEP (*(.exceptions.irqtest)); - KEEP (*(.exceptions.irqhandler.user)); - KEEP (*(.exceptions.irqhandler)); - KEEP (*(.exceptions.irqreturn.user)); - KEEP (*(.exceptions.irqreturn)); - KEEP (*(.exceptions.notirq.label)); - KEEP (*(.exceptions.notirq.user)); - KEEP (*(.exceptions.notirq)); - KEEP (*(.exceptions.soft.user)); - KEEP (*(.exceptions.soft)); - KEEP (*(.exceptions.unknown.user)); - KEEP (*(.exceptions.unknown)); - KEEP (*(.exceptions.exit.label)); - KEEP (*(.exceptions.exit.user)); - KEEP (*(.exceptions.exit)); - KEEP (*(.exceptions)); - PROVIDE (__ram_exceptions_end = ABSOLUTE(.)); - } > onchip_memory - - PROVIDE (__flash_exceptions_start = LOADADDR(.exceptions)); - - .text : - { - /* - * All code sections are merged into the text output section, along with - * the read only data sections. - * - */ - - PROVIDE (stext = ABSOLUTE(.)); - - *(.interp) - *(.hash) - *(.dynsym) - *(.dynstr) - *(.gnu.version) - *(.gnu.version_d) - *(.gnu.version_r) - *(.rel.init) - *(.rela.init) - *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) - *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) - *(.rel.fini) - *(.rela.fini) - *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) - *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) - *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) - *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) - *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) - *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) - *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) - *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) - *(.rel.ctors) - *(.rela.ctors) - *(.rel.dtors) - *(.rela.dtors) - *(.rel.got) - *(.rela.got) - *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) - *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) - *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) - *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) - *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) - *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) - *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) - *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) - *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) - *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) - *(.rel.plt) - *(.rela.plt) - *(.rel.dyn) - - KEEP (*(.init)) - *(.plt) - *(.text .stub .text.* .gnu.linkonce.t.*) - - /* .gnu.warning sections are handled specially by elf32.em. */ - - *(.gnu.warning.*) - KEEP (*(.fini)) - PROVIDE (__etext = ABSOLUTE(.)); - PROVIDE (_etext = ABSOLUTE(.)); - PROVIDE (etext = ABSOLUTE(.)); - - *(.eh_frame_hdr) - /* Ensure the __preinit_array_start label is properly aligned. We - could instead move the label definition inside the section, but - the linker would then create the section even if it turns out to - be empty, which isn't pretty. */ - . = ALIGN(4); - PROVIDE (__preinit_array_start = ABSOLUTE(.)); - *(.preinit_array) - PROVIDE (__preinit_array_end = ABSOLUTE(.)); - PROVIDE (__init_array_start = ABSOLUTE(.)); - *(.init_array) - PROVIDE (__init_array_end = ABSOLUTE(.)); - PROVIDE (__fini_array_start = ABSOLUTE(.)); - *(.fini_array) - PROVIDE (__fini_array_end = ABSOLUTE(.)); - SORT(CONSTRUCTORS) - KEEP (*(.eh_frame)) - *(.gcc_except_table) - *(.dynamic) - PROVIDE (__CTOR_LIST__ = ABSOLUTE(.)); - KEEP (*(.ctors)) - KEEP (*(SORT(.ctors.*))) - PROVIDE (__CTOR_END__ = ABSOLUTE(.)); - PROVIDE (__DTOR_LIST__ = ABSOLUTE(.)); - KEEP (*(.dtors)) - KEEP (*(SORT(.dtors.*))) - PROVIDE (__DTOR_END__ = ABSOLUTE(.)); - KEEP (*(.jcr)) - . = ALIGN(4); - } > onchip_memory = 0x3a880100 /* Nios II NOP instruction */ - - .rodata : - { - PROVIDE (__ram_rodata_start = ABSOLUTE(.)); - . = ALIGN(4); - *(.rodata .rodata.* .gnu.linkonce.r.*) - *(.rodata1) - . = ALIGN(4); - PROVIDE (__ram_rodata_end = ABSOLUTE(.)); - } > onchip_memory - - PROVIDE (__flash_rodata_start = LOADADDR(.rodata)); - - /* - * - * This section's LMA is set to the .text region. - * crt0 will copy to this section's specified mapped region virtual memory address (VMA) - * - * .rwdata region equals the .text region, and is set to be loaded into .text region. - * This requires two copies of .rwdata in the .text region. One read writable at VMA. - * and one read-only at LMA. crt0 will copy from LMA to VMA on reset - * - */ - - .rwdata LOADADDR (.rodata) + SIZEOF (.rodata) : AT ( LOADADDR (.rodata) + SIZEOF (.rodata)+ SIZEOF (.rwdata) ) - { - PROVIDE (__ram_rwdata_start = ABSOLUTE(.)); - . = ALIGN(4); - *(.got.plt) *(.got) - *(.data1) - *(.data .data.* .gnu.linkonce.d.*) - - _gp = ABSOLUTE(. + 0x8000); - PROVIDE(gp = _gp); - - *(.rwdata .rwdata.*) - *(.sdata .sdata.* .gnu.linkonce.s.*) - *(.sdata2 .sdata2.* .gnu.linkonce.s2.*) - - . = ALIGN(4); - _edata = ABSOLUTE(.); - PROVIDE (edata = ABSOLUTE(.)); - PROVIDE (__ram_rwdata_end = ABSOLUTE(.)); - } > onchip_memory - - PROVIDE (__flash_rwdata_start = LOADADDR(.rwdata)); - - /* - * - * This section's LMA is set to the .text region. - * crt0 will copy to this section's specified mapped region virtual memory address (VMA) - * - */ - - .bss LOADADDR (.rwdata) + SIZEOF (.rwdata) : AT ( LOADADDR (.rwdata) + SIZEOF (.rwdata) ) - { - __bss_start = ABSOLUTE(.); - PROVIDE (__sbss_start = ABSOLUTE(.)); - PROVIDE (___sbss_start = ABSOLUTE(.)); - - *(.dynsbss) - *(.sbss .sbss.* .gnu.linkonce.sb.*) - *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) - *(.scommon) - - PROVIDE (__sbss_end = ABSOLUTE(.)); - PROVIDE (___sbss_end = ABSOLUTE(.)); - - *(.dynbss) - *(.bss .bss.* .gnu.linkonce.b.*) - *(COMMON) - - . = ALIGN(4); - __bss_end = ABSOLUTE(.); - } > onchip_memory - - /* - * - * One output section mapped to the associated memory device for each of - * the available memory devices. These are not used by default, but can - * be used by user applications by using the .section directive. - * - * The output section used for the heap is treated in a special way, - * i.e. the symbols "end" and "_end" are added to point to the heap start. - * - * Because alt_load() is enabled, these sections have - * their LMA set to be loaded into the .text memory region. - * However, the alt_load() code will NOT automatically copy - * these sections into their mapped memory region. - * - */ - - /* - * - * This section's LMA is set to the .text region. - * crt0 will copy to this section's specified mapped region virtual memory address (VMA) - * - */ - - .onchip_memory LOADADDR (.bss) + SIZEOF (.bss) : AT ( LOADADDR (.bss) + SIZEOF (.bss) ) - { - PROVIDE (_alt_partition_onchip_memory_start = ABSOLUTE(.)); - *(.onchip_memory. onchip_memory.*) - . = ALIGN(4); - PROVIDE (_alt_partition_onchip_memory_end = ABSOLUTE(.)); - _end = ABSOLUTE(.); - end = ABSOLUTE(.); - __alt_stack_base = ABSOLUTE(.); - } > onchip_memory - - PROVIDE (_alt_partition_onchip_memory_load_addr = LOADADDR(.onchip_memory)); - - /* - * Stabs debugging sections. - * - */ - - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - /* DWARF debug sections. - Symbols in the DWARF debugging sections are relative to the beginning - of the section so we begin them at 0. */ - /* DWARF 1 */ - .debug 0 : { *(.debug) } - .line 0 : { *(.line) } - /* GNU DWARF 1 extensions */ - .debug_srcinfo 0 : { *(.debug_srcinfo) } - .debug_sfnames 0 : { *(.debug_sfnames) } - /* DWARF 1.1 and DWARF 2 */ - .debug_aranges 0 : { *(.debug_aranges) } - .debug_pubnames 0 : { *(.debug_pubnames) } - /* DWARF 2 */ - .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_line 0 : { *(.debug_line) } - .debug_frame 0 : { *(.debug_frame) } - .debug_str 0 : { *(.debug_str) } - .debug_loc 0 : { *(.debug_loc) } - .debug_macinfo 0 : { *(.debug_macinfo) } - /* SGI/MIPS DWARF 2 extensions */ - .debug_weaknames 0 : { *(.debug_weaknames) } - .debug_funcnames 0 : { *(.debug_funcnames) } - .debug_typenames 0 : { *(.debug_typenames) } - .debug_varnames 0 : { *(.debug_varnames) } - - /* Altera debug extensions */ - .debug_alt_sim_info 0 : { *(.debug_alt_sim_info) } -} - -/* provide a pointer for the stack */ - -/* - * Don't override this, override the __alt_stack_* symbols instead. - */ -__alt_data_end = 0x1000; - -/* - * The next two symbols define the location of the default stack. You can - * override them to move the stack to a different memory. - */ -PROVIDE( __alt_stack_pointer = __alt_data_end ); -PROVIDE( __alt_stack_limit = __alt_stack_base ); - -/* - * This symbol controls where the start of the heap is. If the stack is - * contiguous with the heap then the stack will contract as memory is - * allocated to the heap. - * Override this symbol to put the heap in a different memory. - */ -PROVIDE( __alt_heap_start = end ); -PROVIDE( __alt_heap_limit = 0x1000 ); diff --git a/software/qsys_tutorial_green_bsp/mem_init.mk b/software/qsys_tutorial_green_bsp/mem_init.mk deleted file mode 100644 index 4caaef9..0000000 --- a/software/qsys_tutorial_green_bsp/mem_init.mk +++ /dev/null @@ -1,322 +0,0 @@ - -######################################################################### -####### M E M I N I T M A K E F I L E C O N T E N T ###### -######################################################################### - -######################################################################### -# This file is intended to be included by public.mk -# -# -# The following variables must be defined before including this file: -# - ELF -# -# The following variables may be defined to override the default behavior: -# - HDL_SIM_DIR -# - HDL_SIM_INSTALL_DIR -# - MEM_INIT_DIR -# - MEM_INIT_INSTALL_DIR -# - QUARTUS_PROJECT_DIR -# - SOPC_NAME -# - SIM_OPTIMIZE -# - RESET_ADDRESS -# -######################################################################### - -ifeq ($(MEM_INIT_FILE),) -# MEM_INIT_FILE should be set equal to the working relative path to this -# mem_init.mk makefile fragment -MEM_INIT_FILE := $(wildcard $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))) -endif - -ifeq ($(ELF2DAT),) -ELF2DAT := elf2dat -endif - -ifeq ($(ELF2HEX),) -ELF2HEX := elf2hex -endif - -ifeq ($(ELF2FLASH),) -ELF2FLASH := elf2flash -endif - -ifeq ($(FLASH2DAT),) -FLASH2DAT := flash2dat -endif - -ifeq ($(NM),) -NM := nios2-elf-nm -endif - -ifeq ($(MKDIR),) -MKDIR := mkdir -p -endif - -ifeq ($(RM),) -RM := rm -f -endif - -ifeq ($(CP),) -CP := cp -endif - -ifeq ($(ECHO),) -ECHO := echo -endif - -MEM_INIT_DIR ?= mem_init -HDL_SIM_DIR ?= $(MEM_INIT_DIR)/hdl_sim - -ifdef QUARTUS_PROJECT_DIR -MEM_INIT_INSTALL_DIR ?= $(patsubst %/,%,$(QUARTUS_PROJECT_DIR)) -ifdef SOPC_NAME -HDL_SIM_INSTALL_DIR ?= $(patsubst %/,%,$(QUARTUS_PROJECT_DIR))/$(SOPC_NAME)_sim -endif -endif - -MEM_INIT_DESCRIPTOR_FILE ?= $(MEM_INIT_DIR)/meminit.spd - -MEM_INIT_QIP_FILE ?= $(MEM_INIT_DIR)/meminit.qip - -#------------------------------------- -# Default Flash Boot Loaders -#------------------------------------- - -BOOT_LOADER_PATH ?= $(SOPC_KIT_NIOS2)/components/altera_nios2 -BOOT_LOADER_CFI ?= $(BOOT_LOADER_PATH)/boot_loader_cfi.srec -BOOT_LOADER_CFI_BE ?= $(BOOT_LOADER_PATH)/boot_loader_cfi_be.srec - - -#------------------------------------- -# Default Target -#------------------------------------- - -.PHONY: default_mem_init -ifeq ($(QSYS),1) -default_mem_init: mem_init_generate -else -default_mem_init: mem_init_install -endif -#------------------------------------- -# Runtime Macros -#------------------------------------- - -define post-process-info - @echo Post-processing to create $@... -endef - -target_stem = $(notdir $(basename $@)) - -mem_start_address = $($(target_stem)_START) -mem_end_address = $($(target_stem)_END) -mem_width = $($(target_stem)_WIDTH) -mem_endianness = $($(target_stem)_ENDIANNESS) -mem_create_lanes = $($(target_stem)_CREATE_LANES) - -mem_pad_flag = $($(target_stem)_PAD_FLAG) -mem_reloc_input_flag = $($(target_stem)_RELOC_INPUT_FLAG) -mem_no_zero_fill_flag = $($(target_stem)_NO_ZERO_FILL_FLAG) - -flash_mem_epcs_flag = $($(target_stem)_EPCS_FLAGS) -flash_mem_cfi_flag = $($(target_stem)_CFI_FLAGS) -flash_mem_boot_loader_flag = $($(target_stem)_BOOT_LOADER_FLAG) - -elf2dat_extra_args = $(mem_pad_flag) -elf2hex_extra_args = $(mem_no_zero_fill_flag) -elf2flash_extra_args = $(flash_mem_cfi_flag) $(flash_mem_epcs_flag) $(flash_mem_boot_loader_flag) -flash2dat_extra_args = $(mem_pad_flag) $(mem_reloc_input_flag) - -#------------------------------------------------------------------------------ -# BSP SPECIFIC CONTENT -# -# The content below is controlled by the BSP and SOPC System -#------------------------------------------------------------------------------ -#START OF BSP SPECIFIC - -#------------------------------------- -# Global Settings -#------------------------------------- - - -# The following TYPE comment allows tools to identify the 'type' of target this -# makefile is associated with. -# TYPE: BSP_MEMINIT_MAKEFILE - -# This following VERSION comment indicates the version of the tool used to -# generate this makefile. A makefile variable is provided for VERSION as well. -# ACDS_VERSION: 13.0sp1 -ACDS_VERSION := 13.0sp1 - -# This following BUILD_NUMBER comment indicates the build number of the tool -# used to generate this makefile. -# BUILD_NUMBER: 232 - -# Optimize for simulation -SIM_OPTIMIZE ?= 0 - -# The CPU reset address as needed by elf2flash -RESET_ADDRESS ?= 0x00000000 - -#------------------------------------- -# Pre-Initialized Memory Descriptions -#------------------------------------- - -# Memory: onchip_memory -MEM_0 := nios_system_onchip_memory -$(MEM_0)_NAME := onchip_memory -$(MEM_0)_MEM_INIT_FILE_PARAM_NAME := INIT_FILE -HEX_FILES += $(MEM_INIT_DIR)/$(MEM_0).hex -MEM_INIT_INSTALL_FILES += $(MEM_INIT_INSTALL_DIR)/$(MEM_0).hex -DAT_FILES += $(HDL_SIM_DIR)/$(MEM_0).dat -HDL_SIM_INSTALL_FILES += $(HDL_SIM_INSTALL_DIR)/$(MEM_0).dat -SYM_FILES += $(HDL_SIM_DIR)/$(MEM_0).sym -HDL_SIM_INSTALL_FILES += $(HDL_SIM_INSTALL_DIR)/$(MEM_0).sym -$(MEM_0)_START := 0x00000000 -$(MEM_0)_END := 0x00000fff -$(MEM_0)_HIERARCHICAL_PATH := onchip_memory -$(MEM_0)_WIDTH := 32 -$(MEM_0)_ENDIANNESS := --little-endian-mem -$(MEM_0)_CREATE_LANES := 0 - -.PHONY: onchip_memory -onchip_memory: check_elf_exists $(MEM_INIT_DIR)/$(MEM_0).hex $(HDL_SIM_DIR)/$(MEM_0).dat $(HDL_SIM_DIR)/$(MEM_0).sym - - -#END OF BSP SPECIFIC - -#------------------------------------- -# Pre-Initialized Memory Targets -#------------------------------------- - -.PHONY: mem_init_install mem_init_generate mem_init_clean - -ifeq ($(QSYS),1) -# Target mem_init_install is deprecated for QSys based systems -# To initialize onchip memories for Quartus II Synthesis with Qsys based systems: -# 1) Use "make mem_init_genearate" -# 2) Add the generated mem_init/meminit.qip file to your Quartus II Project -# -mem_init_install: - $(error Deprecated Makefile Target: '$@'. Use target 'mem_init_generate' and then add $(MEM_INIT_QIP_FILE) to your Quartus II Project) - -else # QSYS != 1, if SopcBuilder based system - -ifneq ($(MEM_INIT_INSTALL_DIR),) -mem_init_install: $(MEM_INIT_INSTALL_FILES) -endif - -ifneq ($(HDL_SIM_INSTALL_DIR),) -mem_init_install: $(HDL_SIM_INSTALL_FILES) -endif - -mem_init_install: mem_init_generate -ifeq ($(MEM_INIT_INSTALL_DIR),) - @echo "WARNING: MEM_INIT_INSTALL_DIR not set. Set your QUARTUS_PROJECT_DIR environment variable." -endif -ifeq ($(HDL_SIM_INSTALL_DIR),) - @echo "WARNING: HDL_SIM_INSTALL_DIR not set. Set your QUARTUS_PROJECT_DIR and SOPC_NAME environment variable." -endif - -$(MEM_INIT_INSTALL_FILES): $(MEM_INIT_INSTALL_DIR)/%: $(MEM_INIT_DIR)/% - @$(MKDIR) $(@D) - @$(CP) -v $< $@ - -$(HDL_SIM_INSTALL_FILES): $(HDL_SIM_INSTALL_DIR)/%: $(HDL_SIM_DIR)/% - @$(MKDIR) $(@D) - @$(CP) -v $< $@ - -endif # QSYS == 1 - - -mem_init_generate: hex dat sym flash $(MEM_INIT_DESCRIPTOR_FILE) $(MEM_INIT_QIP_FILE) - -mem_init_clean: - @$(RM) -r $(MEM_INIT_DIR) $(HDL_SIM_DIR) $(FLASH_FILES) - -.PHONY: hex dat sym flash - -hex: check_elf_exists $(HEX_FILES) - -dat: check_elf_exists $(DAT_FILES) - -sym: check_elf_exists $(SYM_FILES) - -flash: check_elf_exists $(FLASH_FILES) - -#------------------------------------- -# Pre-Initialized Memory Rules -#------------------------------------- - -.PHONY: check_elf_exists -check_elf_exists: $(ELF) -ifeq ($(ELF),) - $(error ELF var not set in mem_init.mk) -endif - -$(filter-out $(FLASH_DAT_FILES),$(DAT_FILES)): %.dat: $(ELF) - $(post-process-info) - @$(MKDIR) $(@D) - bash -c '$(ELF2DAT) --infile=$< --outfile=$@ \ - --base=$(mem_start_address) --end=$(mem_end_address) --width=$(mem_width) \ - $(mem_endianness) --create-lanes=$(mem_create_lanes) $(elf2dat_extra_args)' - -$(foreach i,0 1 2 3 4 5 6 7,%_lane$(i).dat): %.dat - @true - -$(HEX_FILES): %.hex: $(ELF) - $(post-process-info) - @$(MKDIR) $(@D) - bash -c '$(ELF2HEX) $< $(mem_start_address) $(mem_end_address) --width=$(mem_width) \ - $(mem_endianness) --create-lanes=$(mem_create_lanes) $(elf2hex_extra_args) $@' - -$(SYM_FILES): %.sym: $(ELF) - $(post-process-info) - @$(MKDIR) $(@D) - $(NM) -n $< > $@ - -$(FLASH_FILES): %.flash: $(ELF) - $(post-process-info) - @$(MKDIR) $(@D) - bash -c '$(ELF2FLASH) --input=$< --outfile=$@ --sim_optimize=$(SIM_OPTIMIZE) $(mem_endianness) \ - $(elf2flash_extra_args)' - -# -# Function generate_spd_entry -# Arg1: path to the memory initialization file -# Arg2: Type HEX or DAT -# Arg3: Output spd file to append -gen_spd_entry.BASE_FILE = $(basename $(notdir $1)) -gen_spd_entry.PARAM_NAME = $($(gen_spd_entry.BASE_FILE)_MEM_INIT_FILE_PARAM_NAME) -gen_spd_entry.MEM_PATH = $($(gen_spd_entry.BASE_FILE)_HIERARCHICAL_PATH) -gen_spd_entry.SETTINGS = $(strip \ - path=\"$1\" \ - type=\"$2\" \ - $(if $(gen_spd_entry.PARAM_NAME),initParamName=\"$(gen_spd_entry.PARAM_NAME)\") \ - $(if $(gen_spd_entry.MEM_PATH),memoryPath=\"$(gen_spd_entry.MEM_PATH)\") \ -) -define gen_spd_entry -$(ECHO) "" >> $3 -endef - -$(MEM_INIT_DESCRIPTOR_FILE).DAT_FILESET := $(patsubst $(dir $(MEM_INIT_DESCRIPTOR_FILE))%,%,$(DAT_FILES)) -$(MEM_INIT_DESCRIPTOR_FILE).HEX_FILESET := $(patsubst $(dir $(MEM_INIT_DESCRIPTOR_FILE))%,%,$(HEX_FILES)) - -$(MEM_INIT_DESCRIPTOR_FILE): %.spd: $(MEM_INIT_FILE) - $(post-process-info) - @$(MKDIR) $(@D) - @$(RM) $@ - @$(ECHO) "" > $@ - @$(ECHO) "" >> $@ - @$(foreach dat_file,$($@.DAT_FILESET),$(call gen_spd_entry,$(dat_file),DAT,$@) &&)true - @$(foreach hex_file,$($@.HEX_FILESET),$(call gen_spd_entry,$(hex_file),HEX,$@) &&)true - @$(ECHO) "" >> $@ - -.DELETE_ON_ERROR: $(MEM_INIT_DESCRIPTOR_FILE) - -$(MEM_INIT_QIP_FILE): %.qip: $(MEM_INIT_FILE) - $(post-process-info) - @$(MKDIR) $(@D) - @$(RM) $@ - @$(ECHO) "set_global_assignment -name SEARCH_PATH $$::quartus(qip_path)" > $@ - -.DELETE_ON_ERROR: $(MEM_INIT_QIP_FILE) diff --git a/software/qsys_tutorial_green_bsp/memory.gdb b/software/qsys_tutorial_green_bsp/memory.gdb deleted file mode 100644 index d86c8e4..0000000 --- a/software/qsys_tutorial_green_bsp/memory.gdb +++ /dev/null @@ -1,50 +0,0 @@ -# memory.gdb - GDB memory region definitions -# -# Machine generated for CPU 'nios2_processor' in SOPC Builder design 'nios_system' -# SOPC Builder design path: C:/Users/takayun/Desktop/qsys_tutorial/nios_system.sopcinfo -# -# Generated: Thu Oct 27 10:41:20 JST 2016 - -# DO NOT MODIFY THIS FILE -# -# Changing this file will have subtle consequences -# which will almost certainly lead to a nonfunctioning -# system. If you do modify this file, be aware that your -# changes will be overwritten and lost when this file -# is generated again. -# -# DO NOT MODIFY THIS FILE - -# License Agreement -# -# Copyright (c) 2008 -# Altera Corporation, San Jose, California, USA. -# All rights reserved. -# -# 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. -# -# This agreement shall be governed in all respects by the laws of the State -# of California and by the laws of the United States of America. - -# Define memory regions for each memory connected to the CPU. -# The cache attribute is specified which improves GDB performance -# by allowing GDB to cache memory contents on the host. - -# onchip_memory -memory 0x0 0x1000 cache diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_alarm_start.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_alarm_start.d deleted file mode 100644 index 3bb20ea..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_alarm_start.d +++ /dev/null @@ -1,22 +0,0 @@ -obj/HAL/src/alt_alarm_start.o: HAL/src/alt_alarm_start.c \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h system.h linker.h - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_alarm_start.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_alarm_start.o deleted file mode 100644 index 0d59a0b..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_alarm_start.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_busy_sleep.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_busy_sleep.d deleted file mode 100644 index e93e80c..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_busy_sleep.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_busy_sleep.o: HAL/src/alt_busy_sleep.c system.h linker.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_busy_sleep.h - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_busy_sleep.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_busy_sleep.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_busy_sleep.o deleted file mode 100644 index e19b862..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_busy_sleep.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_close.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_close.d deleted file mode 100644 index fbbab9c..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_close.d +++ /dev/null @@ -1,34 +0,0 @@ -obj/HAL/src/alt_close.o: HAL/src/alt_close.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h \ - HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_close.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_close.o deleted file mode 100644 index 7316d21..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_close.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_dcache_flush.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_dcache_flush.d deleted file mode 100644 index a0eaf8a..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_dcache_flush.d +++ /dev/null @@ -1,15 +0,0 @@ -obj/HAL/src/alt_dcache_flush.o: HAL/src/alt_dcache_flush.c \ - HAL/inc/nios2.h system.h linker.h HAL/inc/alt_types.h \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h - -HAL/inc/nios2.h: - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_dcache_flush.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_dcache_flush.o deleted file mode 100644 index e797e0c..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_dcache_flush.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_dcache_flush_all.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_dcache_flush_all.d deleted file mode 100644 index 792c3e4..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_dcache_flush_all.d +++ /dev/null @@ -1,15 +0,0 @@ -obj/HAL/src/alt_dcache_flush_all.o: HAL/src/alt_dcache_flush_all.c \ - HAL/inc/nios2.h system.h linker.h HAL/inc/alt_types.h \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h - -HAL/inc/nios2.h: - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_dcache_flush_all.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_dcache_flush_all.o deleted file mode 100644 index eaf231e..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_dcache_flush_all.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_dcache_flush_no_writeback.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_dcache_flush_no_writeback.d deleted file mode 100644 index 867c42b..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_dcache_flush_no_writeback.d +++ /dev/null @@ -1,16 +0,0 @@ -obj/HAL/src/alt_dcache_flush_no_writeback.o: \ - HAL/src/alt_dcache_flush_no_writeback.c HAL/inc/nios2.h system.h \ - linker.h HAL/inc/alt_types.h HAL/inc/sys/alt_cache.h \ - HAL/inc/alt_types.h - -HAL/inc/nios2.h: - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_dcache_flush_no_writeback.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_dcache_flush_no_writeback.o deleted file mode 100644 index c80140f..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_dcache_flush_no_writeback.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_dev.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_dev.d deleted file mode 100644 index cd9b1d4..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_dev.d +++ /dev/null @@ -1,34 +0,0 @@ -obj/HAL/src/alt_dev.o: HAL/src/alt_dev.c HAL/inc/sys/alt_dev.h system.h \ - linker.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h \ - HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h HAL/inc/alt_types.h \ - system.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/alt_types.h: - -system.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_dev.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_dev.o deleted file mode 100644 index 8e66630..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_dev.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_dev_llist_insert.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_dev_llist_insert.d deleted file mode 100644 index 344d065..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_dev_llist_insert.d +++ /dev/null @@ -1,13 +0,0 @@ -obj/HAL/src/alt_dev_llist_insert.o: HAL/src/alt_dev_llist_insert.c \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/alt_types.h HAL/inc/sys/alt_errno.h - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_errno.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_dev_llist_insert.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_dev_llist_insert.o deleted file mode 100644 index b003942..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_dev_llist_insert.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_dma_rxchan_open.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_dma_rxchan_open.d deleted file mode 100644 index fb21fed..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_dma_rxchan_open.d +++ /dev/null @@ -1,35 +0,0 @@ -obj/HAL/src/alt_dma_rxchan_open.o: HAL/src/alt_dma_rxchan_open.c \ - HAL/inc/sys/alt_dma.h HAL/inc/sys/alt_dma_dev.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/alt_types.h HAL/inc/sys/alt_errno.h \ - HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h system.h linker.h \ - HAL/inc/sys/alt_llist.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h - -HAL/inc/sys/alt_dma.h: - -HAL/inc/sys/alt_dma_dev.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_errno.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_dma_rxchan_open.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_dma_rxchan_open.o deleted file mode 100644 index ce0804e..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_dma_rxchan_open.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_dma_txchan_open.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_dma_txchan_open.d deleted file mode 100644 index 500b95c..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_dma_txchan_open.d +++ /dev/null @@ -1,35 +0,0 @@ -obj/HAL/src/alt_dma_txchan_open.o: HAL/src/alt_dma_txchan_open.c \ - HAL/inc/sys/alt_dma.h HAL/inc/sys/alt_dma_dev.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/alt_types.h HAL/inc/sys/alt_errno.h \ - HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h system.h linker.h \ - HAL/inc/sys/alt_llist.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h - -HAL/inc/sys/alt_dma.h: - -HAL/inc/sys/alt_dma_dev.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_errno.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_dma_txchan_open.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_dma_txchan_open.o deleted file mode 100644 index 76951a9..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_dma_txchan_open.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_do_ctors.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_do_ctors.d deleted file mode 100644 index daf8baf..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_do_ctors.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_do_ctors.o: HAL/src/alt_do_ctors.c diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_do_ctors.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_do_ctors.o deleted file mode 100644 index efd0752..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_do_ctors.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_do_dtors.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_do_dtors.d deleted file mode 100644 index c3471eb..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_do_dtors.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_do_dtors.o: HAL/src/alt_do_dtors.c diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_do_dtors.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_do_dtors.o deleted file mode 100644 index 81ebb98..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_do_dtors.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_env_lock.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_env_lock.d deleted file mode 100644 index 634d7b0..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_env_lock.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_env_lock.o: HAL/src/alt_env_lock.c diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_env_lock.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_env_lock.o deleted file mode 100644 index 5270020..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_env_lock.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_environ.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_environ.d deleted file mode 100644 index e9ca295..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_environ.d +++ /dev/null @@ -1,3 +0,0 @@ -obj/HAL/src/alt_environ.o: HAL/src/alt_environ.c HAL/inc/os/alt_syscall.h - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_environ.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_environ.o deleted file mode 100644 index 731ba0d..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_environ.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_errno.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_errno.d deleted file mode 100644 index 29ca544..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_errno.d +++ /dev/null @@ -1,8 +0,0 @@ -obj/HAL/src/alt_errno.o: HAL/src/alt_errno.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/alt_types.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_errno.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_errno.o deleted file mode 100644 index b167297..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_errno.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_exception_entry.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_exception_entry.d deleted file mode 100644 index 540567e..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_exception_entry.d +++ /dev/null @@ -1,6 +0,0 @@ -obj/HAL/src/alt_exception_entry.o: HAL/src/alt_exception_entry.S system.h \ - linker.h - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_exception_entry.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_exception_entry.o deleted file mode 100644 index f2be55c..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_exception_entry.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_exception_muldiv.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_exception_muldiv.d deleted file mode 100644 index 63d66a7..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_exception_muldiv.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_exception_muldiv.o: HAL/src/alt_exception_muldiv.S diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_exception_muldiv.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_exception_muldiv.o deleted file mode 100644 index 1f515b7..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_exception_muldiv.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_exception_trap.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_exception_trap.d deleted file mode 100644 index 6e18488..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_exception_trap.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_exception_trap.o: HAL/src/alt_exception_trap.S diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_exception_trap.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_exception_trap.o deleted file mode 100644 index 213b840..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_exception_trap.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_execve.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_execve.d deleted file mode 100644 index 9cef7d2..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_execve.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_execve.o: HAL/src/alt_execve.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_execve.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_execve.o deleted file mode 100644 index 59f9f6f..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_execve.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_exit.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_exit.d deleted file mode 100644 index a779da8..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_exit.d +++ /dev/null @@ -1,26 +0,0 @@ -obj/HAL/src/alt_exit.o: HAL/src/alt_exit.c HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h HAL/inc/alt_types.h system.h linker.h \ - HAL/inc/sys/alt_sim.h HAL/inc/os/alt_hooks.h HAL/inc/os/alt_syscall.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_log_printf.h system.h - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_sim.h: - -HAL/inc/os/alt_hooks.h: - -HAL/inc/os/alt_syscall.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_exit.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_exit.o deleted file mode 100644 index fa9779b..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_exit.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_fcntl.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_fcntl.d deleted file mode 100644 index 527f242..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_fcntl.d +++ /dev/null @@ -1,34 +0,0 @@ -obj/HAL/src/alt_fcntl.o: HAL/src/alt_fcntl.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h \ - system.h linker.h HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/alt_types.h \ - HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_fcntl.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_fcntl.o deleted file mode 100644 index 6cbe451..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_fcntl.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_fd_lock.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_fd_lock.d deleted file mode 100644 index 93daeac..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_fd_lock.d +++ /dev/null @@ -1,27 +0,0 @@ -obj/HAL/src/alt_fd_lock.o: HAL/src/alt_fd_lock.c HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_fd_lock.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_fd_lock.o deleted file mode 100644 index 2c78027..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_fd_lock.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_fd_unlock.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_fd_unlock.d deleted file mode 100644 index 45a3207..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_fd_unlock.d +++ /dev/null @@ -1,27 +0,0 @@ -obj/HAL/src/alt_fd_unlock.o: HAL/src/alt_fd_unlock.c \ - HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h system.h linker.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_fd_unlock.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_fd_unlock.o deleted file mode 100644 index 18d5f0d..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_fd_unlock.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_find_dev.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_find_dev.d deleted file mode 100644 index 98336f8..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_find_dev.d +++ /dev/null @@ -1,31 +0,0 @@ -obj/HAL/src/alt_find_dev.o: HAL/src/alt_find_dev.c HAL/inc/sys/alt_dev.h \ - system.h linker.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h \ - HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h HAL/inc/alt_types.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_find_dev.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_find_dev.o deleted file mode 100644 index cd8f5e4..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_find_dev.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_find_file.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_find_file.d deleted file mode 100644 index d1150ca..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_find_file.d +++ /dev/null @@ -1,32 +0,0 @@ -obj/HAL/src/alt_find_file.o: HAL/src/alt_find_file.c \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h \ - HAL/inc/alt_types.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_find_file.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_find_file.o deleted file mode 100644 index 042285a..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_find_file.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_flash_dev.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_flash_dev.d deleted file mode 100644 index 8835e8f..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_flash_dev.d +++ /dev/null @@ -1,34 +0,0 @@ -obj/HAL/src/alt_flash_dev.o: HAL/src/alt_flash_dev.c \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/sys/alt_flash_dev.h \ - HAL/inc/sys/alt_flash_types.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h \ - system.h linker.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_flash_dev.h: - -HAL/inc/sys/alt_flash_types.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_flash_dev.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_flash_dev.o deleted file mode 100644 index ea528b9..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_flash_dev.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_fork.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_fork.d deleted file mode 100644 index 492be65..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_fork.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_fork.o: HAL/src/alt_fork.c HAL/inc/sys/alt_warning.h \ - HAL/inc/sys/alt_errno.h HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_warning.h: - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_fork.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_fork.o deleted file mode 100644 index 025055b..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_fork.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_fs_reg.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_fs_reg.d deleted file mode 100644 index d8f95ab..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_fs_reg.d +++ /dev/null @@ -1,29 +0,0 @@ -obj/HAL/src/alt_fs_reg.o: HAL/src/alt_fs_reg.c HAL/inc/sys/alt_dev.h \ - system.h linker.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h \ - HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_fs_reg.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_fs_reg.o deleted file mode 100644 index 644a7e3..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_fs_reg.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_fstat.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_fstat.d deleted file mode 100644 index 942fcbc..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_fstat.d +++ /dev/null @@ -1,38 +0,0 @@ -obj/HAL/src/alt_fstat.o: HAL/src/alt_fstat.c HAL/inc/sys/alt_dev.h \ - system.h linker.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/sys/alt_errno.h \ - HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_syscall.h system.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/sys/alt_errno.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_syscall.h: - -system.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_fstat.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_fstat.o deleted file mode 100644 index f758eb0..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_fstat.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_get_fd.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_get_fd.d deleted file mode 100644 index 9a4daaa..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_get_fd.d +++ /dev/null @@ -1,34 +0,0 @@ -obj/HAL/src/alt_get_fd.o: HAL/src/alt_get_fd.c HAL/inc/sys/alt_dev.h \ - system.h linker.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h \ - HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h HAL/inc/alt_types.h \ - system.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/alt_types.h: - -system.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_get_fd.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_get_fd.o deleted file mode 100644 index 352ad10..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_get_fd.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_getchar.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_getchar.d deleted file mode 100644 index bcccdf7..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_getchar.d +++ /dev/null @@ -1,34 +0,0 @@ -obj/HAL/src/alt_getchar.o: HAL/src/alt_getchar.c system.h linker.h \ - HAL/inc/sys/alt_driver.h HAL/inc/sys/alt_stdio.h \ - HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h system.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h - -system.h: - -linker.h: - -HAL/inc/sys/alt_driver.h: - -HAL/inc/sys/alt_stdio.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_getchar.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_getchar.o deleted file mode 100644 index 7ab370a..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_getchar.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_getpid.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_getpid.d deleted file mode 100644 index d9499b9..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_getpid.d +++ /dev/null @@ -1,3 +0,0 @@ -obj/HAL/src/alt_getpid.o: HAL/src/alt_getpid.c HAL/inc/os/alt_syscall.h - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_getpid.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_getpid.o deleted file mode 100644 index 17b5e30..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_getpid.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_gettod.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_gettod.d deleted file mode 100644 index cf3cf34..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_gettod.d +++ /dev/null @@ -1,17 +0,0 @@ -obj/HAL/src/alt_gettod.o: HAL/src/alt_gettod.c HAL/inc/sys/alt_alarm.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/priv/alt_alarm.h \ - HAL/inc/alt_types.h HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_gettod.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_gettod.o deleted file mode 100644 index 5812388..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_gettod.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_gmon.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_gmon.d deleted file mode 100644 index e9469ab..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_gmon.d +++ /dev/null @@ -1,24 +0,0 @@ -obj/HAL/src/alt_gmon.o: HAL/src/alt_gmon.c HAL/inc/priv/nios2_gmon_data.h \ - HAL/inc/sys/alt_irq.h HAL/inc/nios2.h HAL/inc/alt_types.h system.h \ - linker.h HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h - -HAL/inc/priv/nios2_gmon_data.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_gmon.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_gmon.o deleted file mode 100644 index 18baf06..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_gmon.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_icache_flush.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_icache_flush.d deleted file mode 100644 index 2e4ddd1..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_icache_flush.d +++ /dev/null @@ -1,15 +0,0 @@ -obj/HAL/src/alt_icache_flush.o: HAL/src/alt_icache_flush.c \ - HAL/inc/nios2.h system.h linker.h HAL/inc/alt_types.h \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h - -HAL/inc/nios2.h: - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_icache_flush.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_icache_flush.o deleted file mode 100644 index b248181..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_icache_flush.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_icache_flush_all.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_icache_flush_all.d deleted file mode 100644 index 47cfbf3..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_icache_flush_all.d +++ /dev/null @@ -1,15 +0,0 @@ -obj/HAL/src/alt_icache_flush_all.o: HAL/src/alt_icache_flush_all.c \ - HAL/inc/nios2.h system.h linker.h HAL/inc/alt_types.h \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h - -HAL/inc/nios2.h: - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_icache_flush_all.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_icache_flush_all.o deleted file mode 100644 index d07e4b1..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_icache_flush_all.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_iic.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_iic.d deleted file mode 100644 index a709e0c..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_iic.d +++ /dev/null @@ -1,29 +0,0 @@ -obj/HAL/src/alt_iic.o: HAL/src/alt_iic.c system.h linker.h \ - HAL/inc/sys/alt_irq.h HAL/inc/nios2.h HAL/inc/alt_types.h system.h \ - HAL/inc/priv/alt_iic_isr_register.h HAL/inc/alt_types.h \ - HAL/inc/sys/alt_irq.h HAL/inc/priv/alt_legacy_irq.h system.h \ - HAL/inc/nios2.h - -system.h: - -linker.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -HAL/inc/priv/alt_iic_isr_register.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/priv/alt_legacy_irq.h: - -system.h: - -HAL/inc/nios2.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_iic.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_iic.o deleted file mode 100644 index f6637ef..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_iic.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_iic_isr_register.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_iic_isr_register.d deleted file mode 100644 index d0470ae..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_iic_isr_register.d +++ /dev/null @@ -1,30 +0,0 @@ -obj/HAL/src/alt_iic_isr_register.o: HAL/src/alt_iic_isr_register.c \ - system.h linker.h HAL/inc/alt_types.h HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h HAL/inc/alt_types.h system.h \ - HAL/inc/priv/alt_iic_isr_register.h HAL/inc/alt_types.h \ - HAL/inc/sys/alt_irq.h HAL/inc/sys/alt_irq_entry.h \ - HAL/inc/priv/alt_irq_table.h - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -HAL/inc/priv/alt_iic_isr_register.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/sys/alt_irq_entry.h: - -HAL/inc/priv/alt_irq_table.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_iic_isr_register.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_iic_isr_register.o deleted file mode 100644 index 07b3b7a..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_iic_isr_register.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_instruction_exception_entry.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_instruction_exception_entry.d deleted file mode 100644 index 6d0705f..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_instruction_exception_entry.d +++ /dev/null @@ -1,18 +0,0 @@ -obj/HAL/src/alt_instruction_exception_entry.o: \ - HAL/src/alt_instruction_exception_entry.c HAL/inc/sys/alt_exceptions.h \ - HAL/inc/alt_types.h system.h linker.h HAL/inc/nios2.h \ - HAL/inc/alt_types.h system.h - -HAL/inc/sys/alt_exceptions.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_instruction_exception_entry.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_instruction_exception_entry.o deleted file mode 100644 index 3b9451e..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_instruction_exception_entry.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_instruction_exception_register.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_instruction_exception_register.d deleted file mode 100644 index d4fac04..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_instruction_exception_register.d +++ /dev/null @@ -1,16 +0,0 @@ -obj/HAL/src/alt_instruction_exception_register.o: \ - HAL/src/alt_instruction_exception_register.c \ - HAL/inc/sys/alt_exceptions.h HAL/inc/alt_types.h system.h linker.h \ - HAL/inc/alt_types.h system.h - -HAL/inc/sys/alt_exceptions.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -system.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_instruction_exception_register.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_instruction_exception_register.o deleted file mode 100644 index 7fed819..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_instruction_exception_register.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_io_redirect.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_io_redirect.d deleted file mode 100644 index 8228365..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_io_redirect.d +++ /dev/null @@ -1,29 +0,0 @@ -obj/HAL/src/alt_io_redirect.o: HAL/src/alt_io_redirect.c \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_io_redirect.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_io_redirect.o deleted file mode 100644 index 095108e..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_io_redirect.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_ioctl.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_ioctl.d deleted file mode 100644 index d70ad97..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_ioctl.d +++ /dev/null @@ -1,41 +0,0 @@ -obj/HAL/src/alt_ioctl.o: HAL/src/alt_ioctl.c HAL/inc/sys/ioctl.h \ - HAL/inc/sys/alt_errno.h HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h \ - HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h system.h linker.h \ - HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_syscall.h system.h \ - HAL/inc/sys/alt_driver.h - -HAL/inc/sys/ioctl.h: - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_syscall.h: - -system.h: - -HAL/inc/sys/alt_driver.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_ioctl.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_ioctl.o deleted file mode 100644 index 0d36fde..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_ioctl.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_irq_entry.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_irq_entry.d deleted file mode 100644 index 9ec3751..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_irq_entry.d +++ /dev/null @@ -1,5 +0,0 @@ -obj/HAL/src/alt_irq_entry.o: HAL/src/alt_irq_entry.S system.h linker.h - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_irq_entry.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_irq_entry.o deleted file mode 100644 index 4352cc3..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_irq_entry.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_irq_handler.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_irq_handler.d deleted file mode 100644 index 6fb668f..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_irq_handler.d +++ /dev/null @@ -1,19 +0,0 @@ -obj/HAL/src/alt_irq_handler.o: HAL/src/alt_irq_handler.c system.h \ - linker.h HAL/inc/sys/alt_irq.h HAL/inc/nios2.h HAL/inc/alt_types.h \ - system.h HAL/inc/os/alt_hooks.h HAL/inc/alt_types.h - -system.h: - -linker.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -HAL/inc/os/alt_hooks.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_irq_handler.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_irq_handler.o deleted file mode 100644 index 7fec5cf..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_irq_handler.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_irq_register.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_irq_register.d deleted file mode 100644 index 3df2f8a..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_irq_register.d +++ /dev/null @@ -1,36 +0,0 @@ -obj/HAL/src/alt_irq_register.o: HAL/src/alt_irq_register.c system.h \ - linker.h HAL/inc/sys/alt_irq.h HAL/inc/nios2.h HAL/inc/alt_types.h \ - system.h HAL/inc/priv/alt_legacy_irq.h system.h HAL/inc/nios2.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_irq.h HAL/inc/os/alt_hooks.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_irq_entry.h \ - HAL/inc/priv/alt_irq_table.h - -system.h: - -linker.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -HAL/inc/priv/alt_legacy_irq.h: - -system.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/os/alt_hooks.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_irq_entry.h: - -HAL/inc/priv/alt_irq_table.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_irq_register.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_irq_register.o deleted file mode 100644 index 2daf697..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_irq_register.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_irq_vars.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_irq_vars.d deleted file mode 100644 index f316558..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_irq_vars.d +++ /dev/null @@ -1,8 +0,0 @@ -obj/HAL/src/alt_irq_vars.o: HAL/src/alt_irq_vars.c HAL/inc/alt_types.h \ - system.h linker.h - -HAL/inc/alt_types.h: - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_irq_vars.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_irq_vars.o deleted file mode 100644 index aca0a70..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_irq_vars.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_isatty.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_isatty.d deleted file mode 100644 index f8b1f07..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_isatty.d +++ /dev/null @@ -1,38 +0,0 @@ -obj/HAL/src/alt_isatty.o: HAL/src/alt_isatty.c HAL/inc/sys/alt_dev.h \ - system.h linker.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_errno.h HAL/inc/sys/alt_warning.h \ - HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_syscall.h system.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_errno.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_syscall.h: - -system.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_isatty.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_isatty.o deleted file mode 100644 index 967d2db..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_isatty.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_kill.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_kill.d deleted file mode 100644 index 0c14ae8..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_kill.d +++ /dev/null @@ -1,8 +0,0 @@ -obj/HAL/src/alt_kill.o: HAL/src/alt_kill.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_kill.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_kill.o deleted file mode 100644 index ba593e3..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_kill.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_link.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_link.d deleted file mode 100644 index dc844c6..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_link.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_link.o: HAL/src/alt_link.c HAL/inc/sys/alt_warning.h \ - HAL/inc/sys/alt_errno.h HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_warning.h: - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_link.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_link.o deleted file mode 100644 index d5eb359..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_link.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_load.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_load.d deleted file mode 100644 index d496ab8..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_load.d +++ /dev/null @@ -1,8 +0,0 @@ -obj/HAL/src/alt_load.o: HAL/src/alt_load.c HAL/inc/sys/alt_load.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_cache.h - -HAL/inc/sys/alt_load.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_cache.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_load.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_load.o deleted file mode 100644 index 862aca7..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_load.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_log_macro.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_log_macro.d deleted file mode 100644 index 9768c1f..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_log_macro.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_log_macro.o: HAL/src/alt_log_macro.S diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_log_macro.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_log_macro.o deleted file mode 100644 index 489e2cc..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_log_macro.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_log_printf.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_log_printf.d deleted file mode 100644 index 251ff6d..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_log_printf.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_log_printf.o: HAL/src/alt_log_printf.c diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_log_printf.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_log_printf.o deleted file mode 100644 index a03c33d..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_log_printf.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_lseek.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_lseek.d deleted file mode 100644 index 25ed783..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_lseek.d +++ /dev/null @@ -1,34 +0,0 @@ -obj/HAL/src/alt_lseek.o: HAL/src/alt_lseek.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h \ - HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_lseek.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_lseek.o deleted file mode 100644 index 66a8b62..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_lseek.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_main.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_main.d deleted file mode 100644 index afdfda0..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_main.d +++ /dev/null @@ -1,47 +0,0 @@ -obj/HAL/src/alt_main.o: HAL/src/alt_main.c HAL/inc/sys/alt_dev.h system.h \ - linker.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_sys_init.h HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h HAL/inc/os/alt_hooks.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h \ - HAL/inc/alt_types.h system.h HAL/inc/sys/alt_log_printf.h system.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_sys_init.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/os/alt_hooks.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/alt_types.h: - -system.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_main.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_main.o deleted file mode 100644 index 3bcb569..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_main.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_malloc_lock.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_malloc_lock.d deleted file mode 100644 index 4ed35c2..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_malloc_lock.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_malloc_lock.o: HAL/src/alt_malloc_lock.c diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_malloc_lock.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_malloc_lock.o deleted file mode 100644 index 2feabc2..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_malloc_lock.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_mcount.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_mcount.d deleted file mode 100644 index 1203efc..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_mcount.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_mcount.o: HAL/src/alt_mcount.S diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_mcount.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_mcount.o deleted file mode 100644 index 2d79c6d..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_mcount.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_open.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_open.d deleted file mode 100644 index a2aacd9..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_open.d +++ /dev/null @@ -1,36 +0,0 @@ -obj/HAL/src/alt_open.o: HAL/src/alt_open.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_open.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_open.o deleted file mode 100644 index 439cdcf..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_open.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_printf.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_printf.d deleted file mode 100644 index 3ce68a4..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_printf.d +++ /dev/null @@ -1,3 +0,0 @@ -obj/HAL/src/alt_printf.o: HAL/src/alt_printf.c HAL/inc/sys/alt_stdio.h - -HAL/inc/sys/alt_stdio.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_printf.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_printf.o deleted file mode 100644 index 7df982e..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_printf.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_putchar.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_putchar.d deleted file mode 100644 index 9a0dde3..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_putchar.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_putchar.o: HAL/src/alt_putchar.c system.h linker.h \ - HAL/inc/sys/alt_driver.h HAL/inc/sys/alt_stdio.h - -system.h: - -linker.h: - -HAL/inc/sys/alt_driver.h: - -HAL/inc/sys/alt_stdio.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_putchar.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_putchar.o deleted file mode 100644 index f8574fb..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_putchar.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_putstr.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_putstr.d deleted file mode 100644 index 3cf528a..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_putstr.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_putstr.o: HAL/src/alt_putstr.c system.h linker.h \ - HAL/inc/sys/alt_driver.h HAL/inc/sys/alt_stdio.h - -system.h: - -linker.h: - -HAL/inc/sys/alt_driver.h: - -HAL/inc/sys/alt_stdio.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_putstr.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_putstr.o deleted file mode 100644 index a77185c..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_putstr.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_read.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_read.d deleted file mode 100644 index 2bb0d95..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_read.d +++ /dev/null @@ -1,38 +0,0 @@ -obj/HAL/src/alt_read.o: HAL/src/alt_read.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h \ - HAL/inc/os/alt_syscall.h system.h HAL/inc/sys/alt_driver.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_syscall.h: - -system.h: - -HAL/inc/sys/alt_driver.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_read.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_read.o deleted file mode 100644 index 7498697..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_read.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_release_fd.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_release_fd.d deleted file mode 100644 index 0e3acb5..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_release_fd.d +++ /dev/null @@ -1,29 +0,0 @@ -obj/HAL/src/alt_release_fd.o: HAL/src/alt_release_fd.c \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_release_fd.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_release_fd.o deleted file mode 100644 index ea1bb31..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_release_fd.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_remap_cached.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_remap_cached.d deleted file mode 100644 index b5fb151..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_remap_cached.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_remap_cached.o: HAL/src/alt_remap_cached.c \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h system.h linker.h - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_remap_cached.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_remap_cached.o deleted file mode 100644 index 104fbc3..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_remap_cached.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_remap_uncached.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_remap_uncached.d deleted file mode 100644 index 0423405..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_remap_uncached.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_remap_uncached.o: HAL/src/alt_remap_uncached.c \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h system.h linker.h - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_remap_uncached.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_remap_uncached.o deleted file mode 100644 index 5ba2a0b..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_remap_uncached.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_rename.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_rename.d deleted file mode 100644 index b7af4b2..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_rename.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_rename.o: HAL/src/alt_rename.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_rename.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_rename.o deleted file mode 100644 index 8d2d1cd..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_rename.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_sbrk.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_sbrk.d deleted file mode 100644 index a0771ae..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_sbrk.d +++ /dev/null @@ -1,19 +0,0 @@ -obj/HAL/src/alt_sbrk.o: HAL/src/alt_sbrk.c HAL/inc/os/alt_syscall.h \ - HAL/inc/sys/alt_irq.h HAL/inc/nios2.h HAL/inc/alt_types.h system.h \ - linker.h HAL/inc/sys/alt_stack.h system.h - -HAL/inc/os/alt_syscall.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_stack.h: - -system.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_sbrk.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_sbrk.o deleted file mode 100644 index 83b9be6..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_sbrk.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_settod.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_settod.d deleted file mode 100644 index 56718d5..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_settod.d +++ /dev/null @@ -1,17 +0,0 @@ -obj/HAL/src/alt_settod.o: HAL/src/alt_settod.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_settod.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_settod.o deleted file mode 100644 index bdaa3ec..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_settod.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_software_exception.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_software_exception.d deleted file mode 100644 index fab4023..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_software_exception.d +++ /dev/null @@ -1,6 +0,0 @@ -obj/HAL/src/alt_software_exception.o: HAL/src/alt_software_exception.S \ - system.h linker.h - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_software_exception.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_software_exception.o deleted file mode 100644 index f9e01c2..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_software_exception.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_stat.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_stat.d deleted file mode 100644 index 8a63c27..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_stat.d +++ /dev/null @@ -1,3 +0,0 @@ -obj/HAL/src/alt_stat.o: HAL/src/alt_stat.c HAL/inc/os/alt_syscall.h - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_stat.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_stat.o deleted file mode 100644 index 5ed250c..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_stat.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_tick.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_tick.d deleted file mode 100644 index ddbb281..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_tick.d +++ /dev/null @@ -1,27 +0,0 @@ -obj/HAL/src/alt_tick.o: HAL/src/alt_tick.c HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h HAL/inc/alt_types.h system.h linker.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/os/alt_hooks.h \ - HAL/inc/alt_types.h - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_hooks.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_tick.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_tick.o deleted file mode 100644 index 494088d..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_tick.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_times.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_times.d deleted file mode 100644 index 4bad83d..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_times.d +++ /dev/null @@ -1,17 +0,0 @@ -obj/HAL/src/alt_times.o: HAL/src/alt_times.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_times.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_times.o deleted file mode 100644 index 5efb72e..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_times.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_uncached_free.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_uncached_free.d deleted file mode 100644 index d74ef4b..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_uncached_free.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_uncached_free.o: HAL/src/alt_uncached_free.c \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h system.h linker.h - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_uncached_free.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_uncached_free.o deleted file mode 100644 index 3db4978..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_uncached_free.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_uncached_malloc.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_uncached_malloc.d deleted file mode 100644 index 16799fb..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_uncached_malloc.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_uncached_malloc.o: HAL/src/alt_uncached_malloc.c \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h system.h linker.h - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_uncached_malloc.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_uncached_malloc.o deleted file mode 100644 index e7e67d2..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_uncached_malloc.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_unlink.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_unlink.d deleted file mode 100644 index 0205f86..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_unlink.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_unlink.o: HAL/src/alt_unlink.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_unlink.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_unlink.o deleted file mode 100644 index ac3d501..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_unlink.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_usleep.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_usleep.d deleted file mode 100644 index b5eca45..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_usleep.d +++ /dev/null @@ -1,6 +0,0 @@ -obj/HAL/src/alt_usleep.o: HAL/src/alt_usleep.c \ - HAL/inc/priv/alt_busy_sleep.h HAL/inc/os/alt_syscall.h - -HAL/inc/priv/alt_busy_sleep.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_usleep.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_usleep.o deleted file mode 100644 index b473021..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_usleep.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_wait.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_wait.d deleted file mode 100644 index f47f5df..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_wait.d +++ /dev/null @@ -1,8 +0,0 @@ -obj/HAL/src/alt_wait.o: HAL/src/alt_wait.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_wait.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_wait.o deleted file mode 100644 index f939e0d..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_wait.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_write.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_write.d deleted file mode 100644 index 2b54a68..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_write.d +++ /dev/null @@ -1,41 +0,0 @@ -obj/HAL/src/alt_write.o: HAL/src/alt_write.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h \ - HAL/inc/os/alt_syscall.h HAL/inc/sys/alt_log_printf.h system.h \ - HAL/inc/sys/alt_driver.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_syscall.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: - -HAL/inc/sys/alt_driver.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_write.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_write.o deleted file mode 100644 index 5bd0d77..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/alt_write.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/altera_nios2_qsys_irq.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/altera_nios2_qsys_irq.d deleted file mode 100644 index 47bdd9c..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/altera_nios2_qsys_irq.d +++ /dev/null @@ -1,15 +0,0 @@ -obj/HAL/src/altera_nios2_qsys_irq.o: HAL/src/altera_nios2_qsys_irq.c \ - HAL/inc/sys/alt_irq.h HAL/inc/nios2.h HAL/inc/alt_types.h system.h \ - linker.h HAL/inc/altera_nios2_qsys_irq.h - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/altera_nios2_qsys_irq.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/altera_nios2_qsys_irq.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/altera_nios2_qsys_irq.o deleted file mode 100644 index 5a913dc..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/altera_nios2_qsys_irq.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/crt0.d b/software/qsys_tutorial_green_bsp/obj/HAL/src/crt0.d deleted file mode 100644 index 3af0bb0..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/crt0.d +++ /dev/null @@ -1,12 +0,0 @@ -obj/HAL/src/crt0.o: HAL/src/crt0.S system.h linker.h HAL/inc/nios2.h \ - HAL/inc/sys/alt_log_printf.h system.h - -system.h: - -linker.h: - -HAL/inc/nios2.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: diff --git a/software/qsys_tutorial_green_bsp/obj/HAL/src/crt0.o b/software/qsys_tutorial_green_bsp/obj/HAL/src/crt0.o deleted file mode 100644 index db57d9c..0000000 --- a/software/qsys_tutorial_green_bsp/obj/HAL/src/crt0.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/alt_sys_init.d b/software/qsys_tutorial_green_bsp/obj/alt_sys_init.d deleted file mode 100644 index 2087a7a..0000000 --- a/software/qsys_tutorial_green_bsp/obj/alt_sys_init.d +++ /dev/null @@ -1,54 +0,0 @@ -obj/alt_sys_init.o: alt_sys_init.c system.h linker.h \ - HAL/inc/sys/alt_irq.h HAL/inc/nios2.h HAL/inc/alt_types.h system.h \ - HAL/inc/sys/alt_sys_init.h HAL/inc/altera_nios2_qsys_irq.h \ - drivers/inc/altera_avalon_jtag_uart.h HAL/inc/sys/alt_alarm.h \ - HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h \ - HAL/inc/sys/alt_warning.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_flag.h \ - drivers/inc/altera_avalon_jtag_uart_fd.h HAL/inc/sys/alt_dev.h \ - HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h - -system.h: - -linker.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -HAL/inc/sys/alt_sys_init.h: - -HAL/inc/altera_nios2_qsys_irq.h: - -drivers/inc/altera_avalon_jtag_uart.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_flag.h: - -drivers/inc/altera_avalon_jtag_uart_fd.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: diff --git a/software/qsys_tutorial_green_bsp/obj/alt_sys_init.o b/software/qsys_tutorial_green_bsp/obj/alt_sys_init.o deleted file mode 100644 index 02c3c14..0000000 --- a/software/qsys_tutorial_green_bsp/obj/alt_sys_init.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/drivers/src/altera_avalon_jtag_uart_fd.d b/software/qsys_tutorial_green_bsp/obj/drivers/src/altera_avalon_jtag_uart_fd.d deleted file mode 100644 index b152697..0000000 --- a/software/qsys_tutorial_green_bsp/obj/drivers/src/altera_avalon_jtag_uart_fd.d +++ /dev/null @@ -1,48 +0,0 @@ -obj/drivers/src/altera_avalon_jtag_uart_fd.o: \ - drivers/src/altera_avalon_jtag_uart_fd.c HAL/inc/alt_types.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - drivers/inc/altera_avalon_jtag_uart.h HAL/inc/sys/alt_alarm.h \ - HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_alarm.h \ - HAL/inc/sys/alt_warning.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_flag.h \ - drivers/inc/altera_avalon_jtag_uart_fd.h HAL/inc/sys/alt_dev.h - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_flag.h: - -drivers/inc/altera_avalon_jtag_uart_fd.h: - -HAL/inc/sys/alt_dev.h: diff --git a/software/qsys_tutorial_green_bsp/obj/drivers/src/altera_avalon_jtag_uart_fd.o b/software/qsys_tutorial_green_bsp/obj/drivers/src/altera_avalon_jtag_uart_fd.o deleted file mode 100644 index 8b23d1b..0000000 --- a/software/qsys_tutorial_green_bsp/obj/drivers/src/altera_avalon_jtag_uart_fd.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/drivers/src/altera_avalon_jtag_uart_init.d b/software/qsys_tutorial_green_bsp/obj/drivers/src/altera_avalon_jtag_uart_init.d deleted file mode 100644 index f9460a1..0000000 --- a/software/qsys_tutorial_green_bsp/obj/drivers/src/altera_avalon_jtag_uart_init.d +++ /dev/null @@ -1,66 +0,0 @@ -obj/drivers/src/altera_avalon_jtag_uart_init.o: \ - drivers/src/altera_avalon_jtag_uart_init.c HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h HAL/inc/alt_types.h system.h linker.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/sys/ioctl.h \ - HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart_regs.h \ - HAL/inc/io.h HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_warning.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_flag.h \ - drivers/inc/altera_avalon_jtag_uart_fd.h HAL/inc/sys/alt_dev.h \ - HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/sys/alt_log_printf.h system.h - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/ioctl.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart_regs.h: - -HAL/inc/io.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_flag.h: - -drivers/inc/altera_avalon_jtag_uart_fd.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: diff --git a/software/qsys_tutorial_green_bsp/obj/drivers/src/altera_avalon_jtag_uart_init.o b/software/qsys_tutorial_green_bsp/obj/drivers/src/altera_avalon_jtag_uart_init.o deleted file mode 100644 index ba263e4..0000000 --- a/software/qsys_tutorial_green_bsp/obj/drivers/src/altera_avalon_jtag_uart_init.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/drivers/src/altera_avalon_jtag_uart_ioctl.d b/software/qsys_tutorial_green_bsp/obj/drivers/src/altera_avalon_jtag_uart_ioctl.d deleted file mode 100644 index d75a559..0000000 --- a/software/qsys_tutorial_green_bsp/obj/drivers/src/altera_avalon_jtag_uart_ioctl.d +++ /dev/null @@ -1,58 +0,0 @@ -obj/drivers/src/altera_avalon_jtag_uart_ioctl.o: \ - drivers/src/altera_avalon_jtag_uart_ioctl.c HAL/inc/sys/ioctl.h \ - HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart_regs.h \ - HAL/inc/io.h HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h \ - HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_flag.h \ - drivers/inc/altera_avalon_jtag_uart_fd.h HAL/inc/sys/alt_dev.h system.h \ - linker.h HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/sys/alt_log_printf.h system.h - -HAL/inc/sys/ioctl.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart_regs.h: - -HAL/inc/io.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_flag.h: - -drivers/inc/altera_avalon_jtag_uart_fd.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: diff --git a/software/qsys_tutorial_green_bsp/obj/drivers/src/altera_avalon_jtag_uart_ioctl.o b/software/qsys_tutorial_green_bsp/obj/drivers/src/altera_avalon_jtag_uart_ioctl.o deleted file mode 100644 index 73a395c..0000000 --- a/software/qsys_tutorial_green_bsp/obj/drivers/src/altera_avalon_jtag_uart_ioctl.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/drivers/src/altera_avalon_jtag_uart_read.d b/software/qsys_tutorial_green_bsp/obj/drivers/src/altera_avalon_jtag_uart_read.d deleted file mode 100644 index 9a4846a..0000000 --- a/software/qsys_tutorial_green_bsp/obj/drivers/src/altera_avalon_jtag_uart_read.d +++ /dev/null @@ -1,66 +0,0 @@ -obj/drivers/src/altera_avalon_jtag_uart_read.o: \ - drivers/src/altera_avalon_jtag_uart_read.c HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h HAL/inc/alt_types.h system.h linker.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/sys/ioctl.h \ - HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart_regs.h \ - HAL/inc/io.h HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_warning.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_flag.h \ - drivers/inc/altera_avalon_jtag_uart_fd.h HAL/inc/sys/alt_dev.h \ - HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/sys/alt_log_printf.h system.h - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/ioctl.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart_regs.h: - -HAL/inc/io.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_flag.h: - -drivers/inc/altera_avalon_jtag_uart_fd.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: diff --git a/software/qsys_tutorial_green_bsp/obj/drivers/src/altera_avalon_jtag_uart_read.o b/software/qsys_tutorial_green_bsp/obj/drivers/src/altera_avalon_jtag_uart_read.o deleted file mode 100644 index 9bbf8d8..0000000 --- a/software/qsys_tutorial_green_bsp/obj/drivers/src/altera_avalon_jtag_uart_read.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/obj/drivers/src/altera_avalon_jtag_uart_write.d b/software/qsys_tutorial_green_bsp/obj/drivers/src/altera_avalon_jtag_uart_write.d deleted file mode 100644 index 5518b7f..0000000 --- a/software/qsys_tutorial_green_bsp/obj/drivers/src/altera_avalon_jtag_uart_write.d +++ /dev/null @@ -1,66 +0,0 @@ -obj/drivers/src/altera_avalon_jtag_uart_write.o: \ - drivers/src/altera_avalon_jtag_uart_write.c HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h HAL/inc/alt_types.h system.h linker.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/sys/ioctl.h \ - HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart_regs.h \ - HAL/inc/io.h HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_warning.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_flag.h \ - drivers/inc/altera_avalon_jtag_uart_fd.h HAL/inc/sys/alt_dev.h \ - HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/sys/alt_log_printf.h system.h - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/ioctl.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart_regs.h: - -HAL/inc/io.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_flag.h: - -drivers/inc/altera_avalon_jtag_uart_fd.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: diff --git a/software/qsys_tutorial_green_bsp/obj/drivers/src/altera_avalon_jtag_uart_write.o b/software/qsys_tutorial_green_bsp/obj/drivers/src/altera_avalon_jtag_uart_write.o deleted file mode 100644 index 84dd607..0000000 --- a/software/qsys_tutorial_green_bsp/obj/drivers/src/altera_avalon_jtag_uart_write.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_green_bsp/public.mk b/software/qsys_tutorial_green_bsp/public.mk deleted file mode 100644 index 397ab19..0000000 --- a/software/qsys_tutorial_green_bsp/public.mk +++ /dev/null @@ -1,385 +0,0 @@ -#------------------------------------------------------------------------------ -# BSP "PUBLIC" MAKEFILE CONTENT -# -# This file is intended to be included in an application or library -# Makefile that is using this BSP. You can create such a Makefile with -# the nios2-app-generate-makefile or nios2-lib-generate-makefile -# commands. -# -# The following variables must be defined before including this file: -# -# ALT_LIBRARY_ROOT_DIR -# Contains the path to the BSP top-level (aka root) directory -#------------------------------------------------------------------------------ - -#------------------------------------------------------------------------------ -# PATHS -#------------------------------------------------------------------------------ - - - -# Path to the provided linker script. -BSP_LINKER_SCRIPT := $(ALT_LIBRARY_ROOT_DIR)/linker.x - -# Include paths: -# The path to root of all header files that a library wishes to make -# available for an application's use is specified here. Note that this -# may not be *all* folders within a hierarchy. For example, if it is -# desired that the application developer type: -# #include -# #include -# With files laid out like this: -# /inc/sockets.h -# /inc/ip/tcpip.h -# -# Then, only /inc need be added to the list of include -# directories. Alternatively, if you wish to be able to directly include -# all files in a hierarchy, separate paths to each folder in that -# hierarchy must be defined. - -# The following are the "base" set of include paths for a BSP. -# These paths are appended to the list that individual software -# components, drivers, etc., add in the generated portion of this -# file (below). -ALT_INCLUDE_DIRS_TO_APPEND += \ - $(ALT_LIBRARY_ROOT_DIR) \ - $(ALT_LIBRARY_ROOT_DIR)/drivers/inc - -# Additions to linker library search-path: -# Here we provide a path to "our self" for the application to construct a -# "-L " out of. This should contain a list of directories, -# relative to the library root, of all directories with .a files to link -# against. -ALT_LIBRARY_DIRS += $(ALT_LIBRARY_ROOT_DIR) - - -#------------------------------------------------------------------------------ -# COMPILATION FLAGS -#------------------------------------------------------------------------------ -# Default C pre-processor flags for a BSP: -ALT_CPPFLAGS += -DSYSTEM_BUS_WIDTH=32 \ - -pipe - - -#------------------------------------------------------------------------------ -# MANAGED CONTENT -# -# All content between the lines "START MANAGED" and "END MANAGED" below is -# generated based on variables in the BSP settings file when the -# nios2-bsp-generate-files command is invoked. If you wish to persist any -# information pertaining to the build process, it is recomended that you -# utilize the BSP settings mechanism to do so. -#------------------------------------------------------------------------------ -#START MANAGED - -# The following TYPE comment allows tools to identify the 'type' of target this -# makefile is associated with. -# TYPE: BSP_PUBLIC_MAKEFILE - -# This following VERSION comment indicates the version of the tool used to -# generate this makefile. A makefile variable is provided for VERSION as well. -# ACDS_VERSION: 13.0sp1 -ACDS_VERSION := 13.0sp1 - -# This following BUILD_NUMBER comment indicates the build number of the tool -# used to generate this makefile. -# BUILD_NUMBER: 232 - -# Qsys--generated SOPCINFO file. Required for resolving node instance ID's with -# design component names. -SOPCINFO_FILE := C:/Users/takayun/Desktop/qsys_tutorial/nios_system.sopcinfo - -# Big-Endian operation. -# setting BIG_ENDIAN is false -ALT_CFLAGS += -EL - -# Path to the provided C language runtime initialization code. -BSP_CRT0 := $(ALT_LIBRARY_ROOT_DIR)/obj/HAL/src/crt0.o - -# Name of BSP library as provided to linker using the "-msys-lib" flag or -# linker script GROUP command. -# setting BSP_SYS_LIB is hal_bsp -BSP_SYS_LIB := hal_bsp -ELF_PATCH_FLAG += --thread_model hal - -# Type identifier of the BSP library -# setting BSP_TYPE is hal -ALT_CPPFLAGS += -D__hal__ -BSP_TYPE := hal - -# CPU Name -# setting CPU_NAME is nios2_processor -CPU_NAME = nios2_processor -ELF_PATCH_FLAG += --cpu_name $(CPU_NAME) - -# Hardware Divider present. -# setting HARDWARE_DIVIDE is false -ALT_CFLAGS += -mno-hw-div - -# Hardware Multiplier present. -# setting HARDWARE_MULTIPLY is false -ALT_CFLAGS += -mno-hw-mul - -# Hardware Mulx present. -# setting HARDWARE_MULX is false -ALT_CFLAGS += -mno-hw-mulx - -# Debug Core present. -# setting HAS_DEBUG_CORE is true -CPU_HAS_DEBUG_CORE = 1 - -# Qsys generated design -# setting QSYS is 1 -QSYS := 1 -ELF_PATCH_FLAG += --qsys true - -# Design Name -# setting SOPC_NAME is nios_system -SOPC_NAME := nios_system - -# SopcBuilder Simulation Enabled -# setting SOPC_SIMULATION_ENABLED is false -ELF_PATCH_FLAG += --simulation_enabled false - -# Enable JTAG UART driver to recover when host is inactive causing buffer to -# full without returning error. Printf will not fail with this recovery. none -# setting altera_avalon_jtag_uart_driver.enable_jtag_uart_ignore_fifo_full_error is false - -# Small-footprint (polled mode) driver none -# setting altera_avalon_jtag_uart_driver.enable_small_driver is false - -# Build a custom version of newlib with the specified space-separated compiler -# flags. The custom newlib build will be placed in the <bsp root>/newlib -# directory, and will be used only for applications that utilize this BSP. -# setting hal.custom_newlib_flags is none - -# Enable support for a subset of the C++ language. This option increases code -# footprint by adding support for C++ constructors. Certain features, such as -# multiple inheritance and exceptions are not supported. If false, adds -# -DALT_NO_C_PLUS_PLUS to ALT_CPPFLAGS in public.mk, and reduces code -# footprint. none -# setting hal.enable_c_plus_plus is false -ALT_CPPFLAGS += -DALT_NO_C_PLUS_PLUS - -# When your application exits, close file descriptors, call C++ destructors, -# etc. Code footprint can be reduced by disabling clean exit. If disabled, adds -# -DALT_NO_CLEAN_EXIT to ALT_CPPFLAGS and -Wl,--defsym, exit=_exit to -# ALT_LDFLAGS in public.mk. none -# setting hal.enable_clean_exit is false -ALT_CPPFLAGS += -DALT_NO_CLEAN_EXIT -ALT_LDFLAGS += -Wl,--defsym,exit=_exit - -# Add exit() support. This option increases code footprint if your "main()" -# routine does "return" or call "exit()". If false, adds -DALT_NO_EXIT to -# ALT_CPPFLAGS in public.mk, and reduces footprint none -# setting hal.enable_exit is false -ALT_CPPFLAGS += -DALT_NO_EXIT - -# Causes code to be compiled with gprof profiling enabled and the application -# ELF to be linked with the GPROF library. If true, adds -DALT_PROVIDE_GMON to -# ALT_CPPFLAGS and -pg to ALT_CFLAGS in public.mk. none -# setting hal.enable_gprof is false - -# Enables lightweight device driver API. This reduces code and data footprint -# by removing the HAL layer that maps device names (e.g. /dev/uart0) to file -# descriptors. Instead, driver routines are called directly. The open(), -# close(), and lseek() routines will always fail if called. The read(), -# write(), fstat(), ioctl(), and isatty() routines only work for the stdio -# devices. If true, adds -DALT_USE_DIRECT_DRIVERS to ALT_CPPFLAGS in public.mk. -# The Altera Host and read-only ZIP file systems can't be used if -# hal.enable_lightweight_device_driver_api is true. -# setting hal.enable_lightweight_device_driver_api is true -ALT_CPPFLAGS += -DALT_USE_DIRECT_DRIVERS - -# Adds code to emulate multiply and divide instructions in case they are -# executed but aren't present in the CPU. Normally this isn't required because -# the compiler won't use multiply and divide instructions that aren't present -# in the CPU. If false, adds -DALT_NO_INSTRUCTION_EMULATION to ALT_CPPFLAGS in -# public.mk. none -# setting hal.enable_mul_div_emulation is false -ALT_CPPFLAGS += -DALT_NO_INSTRUCTION_EMULATION - -# Certain drivers are compiled with reduced functionality to reduce code -# footprint. Not all drivers observe this setting. The altera_avalon_uart and -# altera_avalon_jtag_uart drivers switch from interrupt-driven to polled -# operation. CAUTION: Several device drivers are disabled entirely. These -# include the altera_avalon_cfi_flash, altera_avalon_epcs_flash_controller, and -# altera_avalon_lcd_16207 drivers. This can result in certain API (HAL flash -# access routines) to fail. You can define a symbol provided by each driver to -# prevent it from being removed. If true, adds -DALT_USE_SMALL_DRIVERS to -# ALT_CPPFLAGS in public.mk. none -# setting hal.enable_reduced_device_drivers is true -ALT_CPPFLAGS += -DALT_USE_SMALL_DRIVERS - -# Turns on HAL runtime stack checking feature. Enabling this setting causes -# additional code to be placed into each subroutine call to generate an -# exception if a stack collision occurs with the heap or statically allocated -# data. If true, adds -DALT_STACK_CHECK and -mstack-check to ALT_CPPFLAGS in -# public.mk. none -# setting hal.enable_runtime_stack_checking is false - -# The BSP is compiled with optimizations to speedup HDL simulation such as -# initializing the cache, clearing the .bss section, and skipping long delay -# loops. If true, adds -DALT_SIM_OPTIMIZE to ALT_CPPFLAGS in public.mk. When -# this setting is true, the BSP shouldn't be used to build applications that -# are expected to run real hardware. -# setting hal.enable_sim_optimize is false - -# Causes the small newlib (C library) to be used. This reduces code and data -# footprint at the expense of reduced functionality. Several newlib features -# are removed such as floating-point support in printf(), stdin input routines, -# and buffered I/O. The small C library is not compatible with Micrium -# MicroC/OS-II. If true, adds -msmallc to ALT_LDFLAGS in public.mk. none -# setting hal.enable_small_c_library is true -ALT_LDFLAGS += -msmallc -ALT_CPPFLAGS += -DSMALL_C_LIB - -# Enable SOPC Builder System ID. If a System ID SOPC Builder component is -# connected to the CPU associated with this BSP, it will be enabled in the -# creation of command-line arguments to download an ELF to the target. -# Otherwise, system ID and timestamp values are left out of public.mk for -# application Makefile "download-elf" target definition. With the system ID -# check disabled, the Nios II EDS tools will not automatically ensure that the -# application .elf file (and BSP it is linked against) corresponds to the -# hardware design on the target. If false, adds --accept-bad-sysid to -# SOPC_SYSID_FLAG in public.mk. none -# setting hal.enable_sopc_sysid_check is true - -# Enable BSP generation to query if SOPC system is big endian. If true ignores -# export of 'ALT_CFLAGS += -EB' to public.mk if big endian system. If true -# ignores export of 'ALT_CFLAGS += -EL' if little endian system. none -# setting hal.make.ignore_system_derived.big_endian is false - -# Enable BSP generation to query if SOPC system has a debug core present. If -# true ignores export of 'CPU_HAS_DEBUG_CORE = 1' to public.mk if a debug core -# is found in the system. If true ignores export of 'CPU_HAS_DEBUG_CORE = 0' if -# no debug core is found in the system. none -# setting hal.make.ignore_system_derived.debug_core_present is false - -# Enable BSP generation to query if SOPC system has FPU present. If true -# ignores export of 'ALT_CFLAGS += -mhard-float' to public.mk if FPU is found -# in the system. If true ignores export of 'ALT_CFLAGS += -mhard-soft' if FPU -# is not found in the system. none -# setting hal.make.ignore_system_derived.fpu_present is false - -# Enable BSP generation to query if SOPC system has hardware divide present. If -# true ignores export of 'ALT_CFLAGS += -mno-hw-div' to public.mk if no -# division is found in system. If true ignores export of 'ALT_CFLAGS += -# -mhw-div' if division is found in the system. none -# setting hal.make.ignore_system_derived.hardware_divide_present is false - -# Enable BSP generation to query if SOPC system floating point custom -# instruction with a divider is present. If true ignores export of 'ALT_CFLAGS -# += -mcustom-fpu-cfg=60-2' and 'ALT_LDFLAGS += -mcustom-fpu-cfg=60-2' to -# public.mk if the custom instruction is found in the system. none -# setting hal.make.ignore_system_derived.hardware_fp_cust_inst_divider_present is false - -# Enable BSP generation to query if SOPC system floating point custom -# instruction without a divider is present. If true ignores export of -# 'ALT_CFLAGS += -mcustom-fpu-cfg=60-1' and 'ALT_LDFLAGS += -# -mcustom-fpu-cfg=60-1' to public.mk if the custom instruction is found in the -# system. none -# setting hal.make.ignore_system_derived.hardware_fp_cust_inst_no_divider_present is false - -# Enable BSP generation to query if SOPC system has multiplier present. If true -# ignores export of 'ALT_CFLAGS += -mno-hw-mul' to public.mk if no multiplier -# is found in the system. If true ignores export of 'ALT_CFLAGS += -mhw-mul' if -# multiplier is found in the system. none -# setting hal.make.ignore_system_derived.hardware_multiplier_present is false - -# Enable BSP generation to query if SOPC system has hardware mulx present. If -# true ignores export of 'ALT_CFLAGS += -mno-hw-mulx' to public.mk if no mulx -# is found in the system. If true ignores export of 'ALT_CFLAGS += -mhw-mulx' -# if mulx is found in the system. none -# setting hal.make.ignore_system_derived.hardware_mulx_present is false - -# Enable BSP generation to query if SOPC system has simulation enabled. If true -# ignores export of 'ELF_PATCH_FLAG += --simulation_enabled' to public.mk. none -# setting hal.make.ignore_system_derived.sopc_simulation_enabled is false - -# Enable BSP generation to query SOPC system for system ID base address. If -# true ignores export of 'SOPC_SYSID_FLAG += --sidp=
' and -# 'ELF_PATCH_FLAG += --sidp=
' to public.mk. none -# setting hal.make.ignore_system_derived.sopc_system_base_address is false - -# Enable BSP generation to query SOPC system for system ID. If true ignores -# export of 'SOPC_SYSID_FLAG += --id=' and 'ELF_PATCH_FLAG += -# --id=' to public.mk. none -# setting hal.make.ignore_system_derived.sopc_system_id is false - -# Enable BSP generation to query SOPC system for system timestamp. If true -# ignores export of 'SOPC_SYSID_FLAG += --timestamp=' and -# 'ELF_PATCH_FLAG += --timestamp=' to public.mk. none -# setting hal.make.ignore_system_derived.sopc_system_timestamp is false - -# Slave descriptor of STDERR character-mode device. This setting is used by the -# ALT_STDERR family of defines in system.h. none -# setting hal.stderr is jtag_uart -ELF_PATCH_FLAG += --stderr_dev jtag_uart - -# Slave descriptor of STDIN character-mode device. This setting is used by the -# ALT_STDIN family of defines in system.h. none -# setting hal.stdin is jtag_uart -ELF_PATCH_FLAG += --stdin_dev jtag_uart - -# Slave descriptor of STDOUT character-mode device. This setting is used by the -# ALT_STDOUT family of defines in system.h. none -# setting hal.stdout is jtag_uart -ELF_PATCH_FLAG += --stdout_dev jtag_uart - - -#------------------------------------------------------------------------------ -# SOFTWARE COMPONENT & DRIVER INCLUDE PATHS -#------------------------------------------------------------------------------ - -ALT_INCLUDE_DIRS += $(ALT_LIBRARY_ROOT_DIR)/HAL/inc - -#------------------------------------------------------------------------------ -# SOFTWARE COMPONENT & DRIVER PRODUCED ALT_CPPFLAGS ADDITIONS -#------------------------------------------------------------------------------ - -ALT_CPPFLAGS += -DALT_SINGLE_THREADED - -#END MANAGED - - -#------------------------------------------------------------------------------ -# LIBRARY INFORMATION -#------------------------------------------------------------------------------ -# Assemble the name of the BSP *.a file using the BSP library name -# (BSP_SYS_LIB) in generated content above. -BSP_LIB := lib$(BSP_SYS_LIB).a - -# Additional libraries to link against: -# An application including this file will prefix each library with "-l". -# For example, to include the Newlib math library "m" is included, which -# becomes "-lm" when linking the application. -ALT_LIBRARY_NAMES += m - -# Additions to linker dependencies: -# An application Makefile will typically add these directly to the list -# of dependencies required to build the executable target(s). The BSP -# library (*.a) file is specified here. -ALT_LDDEPS += $(ALT_LIBRARY_ROOT_DIR)/$(BSP_LIB) - -# Is this library "Makeable"? -# Add to list of root library directories that support running 'make' -# to build them. Because libraries may or may not have a Makefile in their -# root, appending to this variable tells an application to run 'make' in -# the library root to build/update this library. -MAKEABLE_LIBRARY_ROOT_DIRS += $(ALT_LIBRARY_ROOT_DIR) - -# Additional Assembler Flags -# -gdwarf2 flag is required for stepping through assembly code -ALT_ASFLAGS += -gdwarf2 - -#------------------------------------------------------------------------------ -# FINAL INCLUDE PATH LIST -#------------------------------------------------------------------------------ -# Append static include paths to paths specified by OS/driver/sw package -# additions to the BSP thus giving them precedence in case a BSP addition -# is attempting to override BSP sources. -ALT_INCLUDE_DIRS += $(ALT_INCLUDE_DIRS_TO_APPEND) - - - diff --git a/software/qsys_tutorial_green_bsp/settings.bsp b/software/qsys_tutorial_green_bsp/settings.bsp deleted file mode 100644 index 3a3e66b..0000000 --- a/software/qsys_tutorial_green_bsp/settings.bsp +++ /dev/null @@ -1,919 +0,0 @@ - - - hal - default - 2016/10/27 10:41:20 - 1477532480041 - C:\Users\takayun\Desktop\qsys_tutorial\software\qsys_tutorial_green_bsp - .\settings.bsp - C:\Users\takayun\Desktop\qsys_tutorial\nios_system.sopcinfo - default - nios2_processor - 1.9 - - hal.sys_clk_timer - ALT_SYS_CLK - UnquotedString - none - none - system_h_define - Slave descriptor of the system clock timer device. This device provides a periodic interrupt ("tick") and is typically required for RTOS use. This setting defines the value of ALT_SYS_CLK in system.h. - none - false - common - - - hal.timestamp_timer - ALT_TIMESTAMP_CLK - UnquotedString - none - none - system_h_define - Slave descriptor of timestamp timer device. This device is used by Altera HAL timestamp drivers for high-resolution time measurement. This setting defines the value of ALT_TIMESTAMP_CLK in system.h. - none - false - common - - - hal.max_file_descriptors - ALT_MAX_FD - DecimalNumber - 4 - 32 - system_h_define - Determines the number of file descriptors statically allocated. This setting defines the value of ALT_MAX_FD in system.h. - If hal.enable_lightweight_device_driver_api is true, there are no file descriptors so this setting is ignored. If hal.enable_lightweight_device_driver_api is false, this setting must be at least 4 because HAL needs a file descriptor for /dev/null, /dev/stdin, /dev/stdout, and /dev/stderr. - false - - - - hal.enable_instruction_related_exceptions_api - ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API - BooleanDefineOnly - false - false - system_h_define - Enables API for registering handlers to service instruction-related exceptions. Enabling this setting increases the size of the exception entry code. - These exception types can be generated if various processor options are enabled, such as the MMU, MPU, or other advanced exception types. - false - - - - hal.linker.allow_code_at_reset - ALT_ALLOW_CODE_AT_RESET - Boolean - 1 - 0 - none - Indicates if initialization code is allowed at the reset address. If true, defines the macro ALT_ALLOW_CODE_AT_RESET in linker.h. - If true, defines the macro ALT_ALLOW_CODE_AT_RESET in linker.h. This setting is typically false if an external bootloader (e.g. flash bootloader) is present. - false - - - - hal.linker.enable_alt_load - NONE - Boolean - 1 - 0 - none - Enables the alt_load() facility. The alt_load() facility copies sections from the .text memory into RAM. If true, this setting sets up the VMA/LMA of sections in linker.x to allow them to be loaded into the .text memory. - This setting is typically false if an external bootloader (e.g. flash bootloader) is present. - false - - - - hal.linker.enable_alt_load_copy_rodata - NONE - Boolean - 0 - 0 - none - Causes the alt_load() facility to copy the .rodata section. If true, this setting defines the macro ALT_LOAD_COPY_RODATA in linker.h. - none - false - - - - hal.linker.enable_alt_load_copy_rwdata - NONE - Boolean - 1 - 0 - none - Causes the alt_load() facility to copy the .rwdata section. If true, this setting defines the macro ALT_LOAD_COPY_RWDATA in linker.h. - none - false - - - - hal.linker.enable_alt_load_copy_exceptions - NONE - Boolean - 0 - 0 - none - Causes the alt_load() facility to copy the .exceptions section. If true, this setting defines the macro ALT_LOAD_COPY_EXCEPTIONS in linker.h. - none - false - - - - hal.linker.enable_exception_stack - NONE - Boolean - 0 - 0 - none - Enables use of a separate exception stack. If true, defines the macro ALT_EXCEPTION_STACK in linker.h, adds a memory region called exception_stack to linker.x, and provides the symbols __alt_exception_stack_pointer and __alt_exception_stack_limit in linker.x. - The hal.linker.exception_stack_size and hal.linker.exception_stack_memory_region_name settings must also be valid. This setting must be false for MicroC/OS-II BSPs. The exception stack can be used to improve interrupt and other exception performance if the EIC is *not* used. - false - common - - - hal.linker.exception_stack_size - NONE - DecimalNumber - 1024 - 1024 - none - Size of the exception stack in bytes. - Only used if hal.linker.enable_exception_stack is true. - false - common - - - hal.linker.exception_stack_memory_region_name - NONE - UnquotedString - onchip_memory - none - none - Name of the existing memory region that will be divided up to create the 'exception_stack' memory region. The selected region name will be adjusted automatically when the BSP is generated to create the 'exception_stack' memory region. - Only used if hal.linker.enable_exception_stack is true. - false - common - - - hal.linker.enable_interrupt_stack - NONE - Boolean - 0 - 0 - none - Enables use of a separate interrupt stack. If true, defines the macro ALT_INTERRUPT_STACK in linker.h, adds a memory region called interrupt_stack to linker.x, and provides the symbols __alt_interrupt_stack_pointer and __alt_interrupt_stack_limit in linker.x. - The hal.linker.interrupt_stack_size and hal.linker.interrupt_stack_memory_region_name settings must also be valid. This setting must be false for MicroC/OS-II BSPs. Only enable if the EIC is used exclusively. The exception stack can be used to improve interrupt and other exception performance if the EIC is *not* used. - false - common - - - hal.linker.interrupt_stack_size - NONE - DecimalNumber - 1024 - 1024 - none - Size of the interrupt stack in bytes. - Only used if hal.linker.enable_interrupt_stack is true. - false - common - - - hal.linker.interrupt_stack_memory_region_name - NONE - UnquotedString - onchip_memory - none - none - Name of the existing memory region that will be divided up to create the 'interrupt_stack' memory region. The selected region name will be adjusted automatically when the BSP is generated to create the 'interrupt_stack' memory region. - Only used if hal.linker.enable_interrupt_stack is true. - false - common - - - hal.stdin - NONE - UnquotedString - jtag_uart - none - system_h_define - Slave descriptor of STDIN character-mode device. This setting is used by the ALT_STDIN family of defines in system.h. - none - false - common - - - hal.stdout - NONE - UnquotedString - jtag_uart - none - system_h_define - Slave descriptor of STDOUT character-mode device. This setting is used by the ALT_STDOUT family of defines in system.h. - none - false - common - - - hal.stderr - NONE - UnquotedString - jtag_uart - none - system_h_define - Slave descriptor of STDERR character-mode device. This setting is used by the ALT_STDERR family of defines in system.h. - none - false - common - - - hal.log_port - NONE - UnquotedString - none - none - public_mk_define - Slave descriptor of debug logging character-mode device. If defined, it enables extra debug messages in the HAL source. This setting is used by the ALT_LOG_PORT family of defines in system.h. - none - false - none - - - hal.make.build_pre_process - BUILD_PRE_PROCESS - UnquotedString - none - none - makefile_variable - Command executed before BSP built. - none - false - none - - - hal.make.ar_pre_process - AR_PRE_PROCESS - UnquotedString - none - none - makefile_variable - Command executed before archiver execution. - none - false - none - - - hal.make.bsp_cflags_defined_symbols - BSP_CFLAGS_DEFINED_SYMBOLS - UnquotedString - none - none - makefile_variable - Preprocessor macros to define. A macro definition in this setting has the same effect as a "#define" in source code. Adding "-DALT_DEBUG" to this setting has the same effect as "#define ALT_DEBUG" in a souce file. Adding "-DFOO=1" to this setting is equivalent to the macro "#define FOO 1" in a source file. Macros defined with this setting are applied to all .S, .c, and C++ files in the BSP. This setting defines the value of BSP_CFLAGS_DEFINED_SYMBOLS in the BSP Makefile. - none - false - none - - - hal.make.ar_post_process - AR_POST_PROCESS - UnquotedString - none - none - makefile_variable - Command executed after archiver execution. - none - false - none - - - hal.make.as - AS - UnquotedString - nios2-elf-gcc - nios2-elf-gcc - makefile_variable - Assembler command. Note that CC is used for .S files. - none - false - none - - - hal.make.build_post_process - BUILD_POST_PROCESS - UnquotedString - none - none - makefile_variable - Command executed after BSP built. - none - false - none - - - hal.make.bsp_cflags_debug - BSP_CFLAGS_DEBUG - UnquotedString - -g - -g - makefile_variable - C/C++ compiler debug level. '-g' provides the default set of debug symbols typically required to debug a typical application. Omitting '-g' removes debug symbols from the ELF. This setting defines the value of BSP_CFLAGS_DEBUG in Makefile. - none - false - common - - - hal.make.ar - AR - UnquotedString - nios2-elf-ar - nios2-elf-ar - makefile_variable - Archiver command. Creates library files. - none - false - none - - - hal.make.rm - RM - UnquotedString - rm -f - rm -f - makefile_variable - Command used to remove files during 'clean' target. - none - false - none - - - hal.make.cxx_pre_process - CXX_PRE_PROCESS - UnquotedString - none - none - makefile_variable - Command executed before each C++ file is compiled. - none - false - none - - - hal.make.bsp_cflags_warnings - BSP_CFLAGS_WARNINGS - UnquotedString - -Wall - -Wall - makefile_variable - C/C++ compiler warning level. "-Wall" is commonly used.This setting defines the value of BSP_CFLAGS_WARNINGS in Makefile. - none - false - none - - - hal.make.bsp_arflags - BSP_ARFLAGS - UnquotedString - -src - -src - makefile_variable - Custom flags only passed to the archiver. This content of this variable is directly passed to the archiver rather than the more standard "ARFLAGS". The reason for this is that GNU Make assumes some default content in ARFLAGS. This setting defines the value of BSP_ARFLAGS in Makefile. - none - false - none - - - hal.make.bsp_cflags_optimization - BSP_CFLAGS_OPTIMIZATION - UnquotedString - '-Os' - -O0 - makefile_variable - C/C++ compiler optimization level. "-O0" = no optimization,"-O2" = "normal" optimization, etc. "-O0" is recommended for code that you want to debug since compiler optimization can remove variables and produce non-sequential execution of code while debugging. This setting defines the value of BSP_CFLAGS_OPTIMIZATION in Makefile. - none - false - common - - - hal.make.as_post_process - AS_POST_PROCESS - UnquotedString - none - none - makefile_variable - Command executed after each assembly file is compiled. - none - false - none - - - hal.make.cc_pre_process - CC_PRE_PROCESS - UnquotedString - none - none - makefile_variable - Command executed before each .c/.S file is compiled. - none - false - none - - - hal.make.bsp_asflags - BSP_ASFLAGS - UnquotedString - -Wa,-gdwarf2 - -Wa,-gdwarf2 - makefile_variable - Custom flags only passed to the assembler. This setting defines the value of BSP_ASFLAGS in Makefile. - none - false - none - - - hal.make.as_pre_process - AS_PRE_PROCESS - UnquotedString - none - none - makefile_variable - Command executed before each assembly file is compiled. - none - false - none - - - hal.make.bsp_cflags_undefined_symbols - BSP_CFLAGS_UNDEFINED_SYMBOLS - UnquotedString - none - none - makefile_variable - Preprocessor macros to undefine. Undefined macros are similar to defined macros, but replicate the "#undef" directive in source code. To undefine the macro FOO use the syntax "-u FOO" in this setting. This is equivalent to "#undef FOO" in a source file. Note: the syntax differs from macro definition (there is a space, i.e. "-u FOO" versus "-DFOO"). Macros defined with this setting are applied to all .S, .c, and C++ files in the BSP. This setting defines the value of BSP_CFLAGS_UNDEFINED_SYMBOLS in the BSP Makefile. - none - false - none - - - hal.make.cc_post_process - CC_POST_PROCESS - UnquotedString - none - none - makefile_variable - Command executed after each .c/.S file is compiled. - none - false - none - - - hal.make.cxx_post_process - CXX_POST_PROCESS - UnquotedString - none - none - makefile_variable - Command executed before each C++ file is compiled. - none - false - none - - - hal.make.cc - CC - UnquotedString - nios2-elf-gcc -xc - nios2-elf-gcc -xc - makefile_variable - C compiler command. - none - false - none - - - hal.make.bsp_cxx_flags - BSP_CXXFLAGS - UnquotedString - none - none - makefile_variable - Custom flags only passed to the C++ compiler. This setting defines the value of BSP_CXXFLAGS in Makefile. - none - false - none - - - hal.make.bsp_inc_dirs - BSP_INC_DIRS - UnquotedString - none - none - makefile_variable - Space separated list of extra include directories to scan for header files. Directories are relative to the top-level BSP directory. The -I prefix's added by the makefile so don't add it here. This setting defines the value of BSP_INC_DIRS in Makefile. - none - false - none - - - hal.make.cxx - CXX - UnquotedString - nios2-elf-gcc -xc++ - nios2-elf-gcc -xc++ - makefile_variable - C++ compiler command. - none - false - none - - - hal.make.bsp_cflags_user_flags - BSP_CFLAGS_USER_FLAGS - UnquotedString - none - none - makefile_variable - Custom flags passed to the compiler when compiling C, C++, and .S files. This setting defines the value of BSP_CFLAGS_USER_FLAGS in Makefile. - none - false - none - - - hal.make.ignore_system_derived.sopc_system_id - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query SOPC system for system ID. If true ignores export of 'SOPC_SYSID_FLAG += --id=<sysid>' and 'ELF_PATCH_FLAG += --id=<sysid>' to public.mk. - none - false - none - - - hal.make.ignore_system_derived.sopc_system_timestamp - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query SOPC system for system timestamp. If true ignores export of 'SOPC_SYSID_FLAG += --timestamp=<timestamp>' and 'ELF_PATCH_FLAG += --timestamp=<timestamp>' to public.mk. - none - false - none - - - hal.make.ignore_system_derived.sopc_system_base_address - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query SOPC system for system ID base address. If true ignores export of 'SOPC_SYSID_FLAG += --sidp=<address>' and 'ELF_PATCH_FLAG += --sidp=<address>' to public.mk. - none - false - none - - - hal.make.ignore_system_derived.sopc_simulation_enabled - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system has simulation enabled. If true ignores export of 'ELF_PATCH_FLAG += --simulation_enabled' to public.mk. - none - false - none - - - hal.make.ignore_system_derived.fpu_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system has FPU present. If true ignores export of 'ALT_CFLAGS += -mhard-float' to public.mk if FPU is found in the system. If true ignores export of 'ALT_CFLAGS += -mhard-soft' if FPU is not found in the system. - none - false - none - - - hal.make.ignore_system_derived.hardware_multiplier_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system has multiplier present. If true ignores export of 'ALT_CFLAGS += -mno-hw-mul' to public.mk if no multiplier is found in the system. If true ignores export of 'ALT_CFLAGS += -mhw-mul' if multiplier is found in the system. - none - false - none - - - hal.make.ignore_system_derived.hardware_mulx_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system has hardware mulx present. If true ignores export of 'ALT_CFLAGS += -mno-hw-mulx' to public.mk if no mulx is found in the system. If true ignores export of 'ALT_CFLAGS += -mhw-mulx' if mulx is found in the system. - none - false - none - - - hal.make.ignore_system_derived.hardware_divide_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system has hardware divide present. If true ignores export of 'ALT_CFLAGS += -mno-hw-div' to public.mk if no division is found in system. If true ignores export of 'ALT_CFLAGS += -mhw-div' if division is found in the system. - none - false - none - - - hal.make.ignore_system_derived.debug_core_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system has a debug core present. If true ignores export of 'CPU_HAS_DEBUG_CORE = 1' to public.mk if a debug core is found in the system. If true ignores export of 'CPU_HAS_DEBUG_CORE = 0' if no debug core is found in the system. - none - false - none - - - hal.make.ignore_system_derived.big_endian - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system is big endian. If true ignores export of 'ALT_CFLAGS += -EB' to public.mk if big endian system. If true ignores export of 'ALT_CFLAGS += -EL' if little endian system. - none - false - none - - - hal.make.ignore_system_derived.hardware_fp_cust_inst_divider_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system floating point custom instruction with a divider is present. If true ignores export of 'ALT_CFLAGS += -mcustom-fpu-cfg=60-2' and 'ALT_LDFLAGS += -mcustom-fpu-cfg=60-2' to public.mk if the custom instruction is found in the system. - none - false - none - - - hal.make.ignore_system_derived.hardware_fp_cust_inst_no_divider_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system floating point custom instruction without a divider is present. If true ignores export of 'ALT_CFLAGS += -mcustom-fpu-cfg=60-1' and 'ALT_LDFLAGS += -mcustom-fpu-cfg=60-1' to public.mk if the custom instruction is found in the system. - none - false - none - - - hal.enable_exit - ALT_NO_EXIT - Boolean - 0 - 1 - public_mk_define - Add exit() support. This option increases code footprint if your "main()" routine does "return" or call "exit()". If false, adds -DALT_NO_EXIT to ALT_CPPFLAGS in public.mk, and reduces footprint - none - false - none - - - hal.enable_small_c_library - NONE - Boolean - 1 - 0 - public_mk_define - Causes the small newlib (C library) to be used. This reduces code and data footprint at the expense of reduced functionality. Several newlib features are removed such as floating-point support in printf(), stdin input routines, and buffered I/O. The small C library is not compatible with Micrium MicroC/OS-II. If true, adds -msmallc to ALT_LDFLAGS in public.mk. - none - false - common - - - hal.enable_clean_exit - ALT_NO_CLEAN_EXIT - Boolean - 0 - 1 - public_mk_define - When your application exits, close file descriptors, call C++ destructors, etc. Code footprint can be reduced by disabling clean exit. If disabled, adds -DALT_NO_CLEAN_EXIT to ALT_CPPFLAGS and -Wl,--defsym, exit=_exit to ALT_LDFLAGS in public.mk. - none - false - none - - - hal.enable_runtime_stack_checking - ALT_STACK_CHECK - Boolean - 0 - 0 - public_mk_define - Turns on HAL runtime stack checking feature. Enabling this setting causes additional code to be placed into each subroutine call to generate an exception if a stack collision occurs with the heap or statically allocated data. If true, adds -DALT_STACK_CHECK and -mstack-check to ALT_CPPFLAGS in public.mk. - none - false - none - - - hal.enable_gprof - ALT_PROVIDE_GMON - Boolean - 0 - 0 - public_mk_define - Causes code to be compiled with gprof profiling enabled and the application ELF to be linked with the GPROF library. If true, adds -DALT_PROVIDE_GMON to ALT_CPPFLAGS and -pg to ALT_CFLAGS in public.mk. - none - false - common - - - hal.enable_c_plus_plus - ALT_NO_C_PLUS_PLUS - Boolean - 0 - 1 - public_mk_define - Enable support for a subset of the C++ language. This option increases code footprint by adding support for C++ constructors. Certain features, such as multiple inheritance and exceptions are not supported. If false, adds -DALT_NO_C_PLUS_PLUS to ALT_CPPFLAGS in public.mk, and reduces code footprint. - none - false - none - - - hal.enable_reduced_device_drivers - ALT_USE_SMALL_DRIVERS - Boolean - 1 - 0 - public_mk_define - Certain drivers are compiled with reduced functionality to reduce code footprint. Not all drivers observe this setting. The altera_avalon_uart and altera_avalon_jtag_uart drivers switch from interrupt-driven to polled operation. CAUTION: Several device drivers are disabled entirely. These include the altera_avalon_cfi_flash, altera_avalon_epcs_flash_controller, and altera_avalon_lcd_16207 drivers. This can result in certain API (HAL flash access routines) to fail. You can define a symbol provided by each driver to prevent it from being removed. If true, adds -DALT_USE_SMALL_DRIVERS to ALT_CPPFLAGS in public.mk. - none - false - common - - - hal.enable_lightweight_device_driver_api - ALT_USE_DIRECT_DRIVERS - Boolean - 1 - 0 - public_mk_define - Enables lightweight device driver API. This reduces code and data footprint by removing the HAL layer that maps device names (e.g. /dev/uart0) to file descriptors. Instead, driver routines are called directly. The open(), close(), and lseek() routines will always fail if called. The read(), write(), fstat(), ioctl(), and isatty() routines only work for the stdio devices. If true, adds -DALT_USE_DIRECT_DRIVERS to ALT_CPPFLAGS in public.mk. - The Altera Host and read-only ZIP file systems can't be used if hal.enable_lightweight_device_driver_api is true. - false - none - - - hal.enable_mul_div_emulation - ALT_NO_INSTRUCTION_EMULATION - Boolean - 0 - 0 - public_mk_define - Adds code to emulate multiply and divide instructions in case they are executed but aren't present in the CPU. Normally this isn't required because the compiler won't use multiply and divide instructions that aren't present in the CPU. If false, adds -DALT_NO_INSTRUCTION_EMULATION to ALT_CPPFLAGS in public.mk. - none - false - none - - - hal.enable_sim_optimize - ALT_SIM_OPTIMIZE - Boolean - 0 - 0 - public_mk_define - The BSP is compiled with optimizations to speedup HDL simulation such as initializing the cache, clearing the .bss section, and skipping long delay loops. If true, adds -DALT_SIM_OPTIMIZE to ALT_CPPFLAGS in public.mk. - When this setting is true, the BSP shouldn't be used to build applications that are expected to run real hardware. - false - common - - - hal.enable_sopc_sysid_check - NONE - Boolean - 1 - 1 - public_mk_define - Enable SOPC Builder System ID. If a System ID SOPC Builder component is connected to the CPU associated with this BSP, it will be enabled in the creation of command-line arguments to download an ELF to the target. Otherwise, system ID and timestamp values are left out of public.mk for application Makefile "download-elf" target definition. With the system ID check disabled, the Nios II EDS tools will not automatically ensure that the application .elf file (and BSP it is linked against) corresponds to the hardware design on the target. If false, adds --accept-bad-sysid to SOPC_SYSID_FLAG in public.mk. - none - false - none - - - hal.custom_newlib_flags - CUSTOM_NEWLIB_FLAGS - UnquotedString - none - none - public_mk_define - Build a custom version of newlib with the specified space-separated compiler flags. - The custom newlib build will be placed in the &lt;bsp root>/newlib directory, and will be used only for applications that utilize this BSP. - false - none - - - hal.log_flags - ALT_LOG_FLAGS - DecimalNumber - 0 - 0 - public_mk_define - The value is assigned to ALT_LOG_FLAGS in the generated public.mk. See hal.log_port setting description. Values can be -1 through 3. - hal.log_port must be set for this to be used. - false - none - - - altera_avalon_jtag_uart_driver.enable_small_driver - ALTERA_AVALON_JTAG_UART_SMALL - BooleanDefineOnly - false - false - public_mk_define - Small-footprint (polled mode) driver - none - false - - - - altera_avalon_jtag_uart_driver.enable_jtag_uart_ignore_fifo_full_error - ALTERA_AVALON_JTAG_UART_IGNORE_FIFO_FULL_ERROR - BooleanDefineOnly - false - false - public_mk_define - Enable JTAG UART driver to recover when host is inactive causing buffer to full without returning error. Printf will not fail with this recovery. - none - false - - - - onchip_memory - 0x00000000 - 0x00000FFF - 4096 - memory - - - LEDRs - 0x00002000 - 0x0000200F - 16 - - - - switches - 0x00002010 - 0x0000201F - 16 - - - - LEDs - 0x00002020 - 0x0000202F - 16 - - - - jtag_uart - 0x00002030 - 0x00002037 - 8 - printable - - - .text - onchip_memory - - - .rodata - onchip_memory - - - .rwdata - onchip_memory - - - .bss - onchip_memory - - - .heap - onchip_memory - - - .stack - onchip_memory - - \ No newline at end of file diff --git a/software/qsys_tutorial_green_bsp/summary.html b/software/qsys_tutorial_green_bsp/summary.html deleted file mode 100644 index b20197c..0000000 --- a/software/qsys_tutorial_green_bsp/summary.html +++ /dev/null @@ -1,2011 +0,0 @@ - -Altera Nios II BSP Summary - -

BSP Description

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
BSP Type:hal
SOPC Design File:C:\Users\takayun\Desktop\qsys_tutorial\nios_system.sopcinfo
Quartus JDI File:default
CPU:nios2_processor
BSP Settings File:.\settings.bsp
BSP Version:default
BSP Generated On:2016/10/27 10:41:20
BSP Generated Timestamp:1477532480041
BSP Generated Location:C:\Users\takayun\Desktop\qsys_tutorial\software\qsys_tutorial_green_bsp
-
-

Nios II Memory Map

- - - - - - - - - - - - - - - - - - - -
Slave DescriptorAddress RangeSizeAttributes
jtag_uart0x00002030 - 0x000020378printable
LEDs0x00002020 - 0x0000202F16 
switches0x00002010 - 0x0000201F16 
LEDRs0x00002000 - 0x0000200F16 
onchip_memory0x00000000 - 0x00000FFF4096memory
-
-
-

Linker Regions

- - - - -
RegionAddress RangeSizeMemoryOffset
-
-
-

Linker Section Mappings

- - - - - - - - - - - - - - - - - - - - - - -
SectionRegion
.textonchip_memory
.rodataonchip_memory
.rwdataonchip_memory
.bssonchip_memory
.heaponchip_memory
.stackonchip_memory
-

Settings

- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:altera_avalon_jtag_uart_driver.enable_jtag_uart_ignore_fifo_full_error
Identifier:ALTERA_AVALON_JTAG_UART_IGNORE_FIFO_FULL_ERROR
Default Value:false
Value:false
Type:BooleanDefineOnly
Destination:public_mk_define
Description:Enable JTAG UART driver to recover when host is inactive causing buffer to full without returning error. Printf will not fail with this recovery.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:altera_avalon_jtag_uart_driver.enable_small_driver
Identifier:ALTERA_AVALON_JTAG_UART_SMALL
Default Value:false
Value:false
Type:BooleanDefineOnly
Destination:public_mk_define
Description:Small-footprint (polled mode) driver
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.custom_newlib_flags
Identifier:CUSTOM_NEWLIB_FLAGS
Default Value:none
Value:none
Type:UnquotedString
Destination:public_mk_define
Description:Build a custom version of newlib with the specified space-separated compiler flags.
Restrictions:The custom newlib build will be placed in the &lt;bsp root>/newlib directory, and will be used only for applications that utilize this BSP.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_c_plus_plus
Identifier:ALT_NO_C_PLUS_PLUS
Default Value:1
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable support for a subset of the C++ language. This option increases code footprint by adding support for C++ constructors. Certain features, such as multiple inheritance and exceptions are not supported. If false, adds -DALT_NO_C_PLUS_PLUS to ALT_CPPFLAGS in public.mk, and reduces code footprint.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_clean_exit
Identifier:ALT_NO_CLEAN_EXIT
Default Value:1
Value:0
Type:Boolean
Destination:public_mk_define
Description:When your application exits, close file descriptors, call C++ destructors, etc. Code footprint can be reduced by disabling clean exit. If disabled, adds -DALT_NO_CLEAN_EXIT to ALT_CPPFLAGS and -Wl,--defsym, exit=_exit to ALT_LDFLAGS in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_exit
Identifier:ALT_NO_EXIT
Default Value:1
Value:0
Type:Boolean
Destination:public_mk_define
Description:Add exit() support. This option increases code footprint if your "main()" routine does "return" or call "exit()". If false, adds -DALT_NO_EXIT to ALT_CPPFLAGS in public.mk, and reduces footprint
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_gprof
Identifier:ALT_PROVIDE_GMON
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Causes code to be compiled with gprof profiling enabled and the application ELF to be linked with the GPROF library. If true, adds -DALT_PROVIDE_GMON to ALT_CPPFLAGS and -pg to ALT_CFLAGS in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_instruction_related_exceptions_api
Identifier:ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API
Default Value:false
Value:false
Type:BooleanDefineOnly
Destination:system_h_define
Description:Enables API for registering handlers to service instruction-related exceptions. Enabling this setting increases the size of the exception entry code.
Restrictions:These exception types can be generated if various processor options are enabled, such as the MMU, MPU, or other advanced exception types.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_lightweight_device_driver_api
Identifier:ALT_USE_DIRECT_DRIVERS
Default Value:0
Value:1
Type:Boolean
Destination:public_mk_define
Description:Enables lightweight device driver API. This reduces code and data footprint by removing the HAL layer that maps device names (e.g. /dev/uart0) to file descriptors. Instead, driver routines are called directly. The open(), close(), and lseek() routines will always fail if called. The read(), write(), fstat(), ioctl(), and isatty() routines only work for the stdio devices. If true, adds -DALT_USE_DIRECT_DRIVERS to ALT_CPPFLAGS in public.mk.
Restrictions:The Altera Host and read-only ZIP file systems can't be used if hal.enable_lightweight_device_driver_api is true.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_mul_div_emulation
Identifier:ALT_NO_INSTRUCTION_EMULATION
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Adds code to emulate multiply and divide instructions in case they are executed but aren't present in the CPU. Normally this isn't required because the compiler won't use multiply and divide instructions that aren't present in the CPU. If false, adds -DALT_NO_INSTRUCTION_EMULATION to ALT_CPPFLAGS in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_reduced_device_drivers
Identifier:ALT_USE_SMALL_DRIVERS
Default Value:0
Value:1
Type:Boolean
Destination:public_mk_define
Description:Certain drivers are compiled with reduced functionality to reduce code footprint. Not all drivers observe this setting. The altera_avalon_uart and altera_avalon_jtag_uart drivers switch from interrupt-driven to polled operation. CAUTION: Several device drivers are disabled entirely. These include the altera_avalon_cfi_flash, altera_avalon_epcs_flash_controller, and altera_avalon_lcd_16207 drivers. This can result in certain API (HAL flash access routines) to fail. You can define a symbol provided by each driver to prevent it from being removed. If true, adds -DALT_USE_SMALL_DRIVERS to ALT_CPPFLAGS in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_runtime_stack_checking
Identifier:ALT_STACK_CHECK
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Turns on HAL runtime stack checking feature. Enabling this setting causes additional code to be placed into each subroutine call to generate an exception if a stack collision occurs with the heap or statically allocated data. If true, adds -DALT_STACK_CHECK and -mstack-check to ALT_CPPFLAGS in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_sim_optimize
Identifier:ALT_SIM_OPTIMIZE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:The BSP is compiled with optimizations to speedup HDL simulation such as initializing the cache, clearing the .bss section, and skipping long delay loops. If true, adds -DALT_SIM_OPTIMIZE to ALT_CPPFLAGS in public.mk.
Restrictions:When this setting is true, the BSP shouldn't be used to build applications that are expected to run real hardware.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_small_c_library
Identifier:NONE
Default Value:0
Value:1
Type:Boolean
Destination:public_mk_define
Description:Causes the small newlib (C library) to be used. This reduces code and data footprint at the expense of reduced functionality. Several newlib features are removed such as floating-point support in printf(), stdin input routines, and buffered I/O. The small C library is not compatible with Micrium MicroC/OS-II. If true, adds -msmallc to ALT_LDFLAGS in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_sopc_sysid_check
Identifier:NONE
Default Value:1
Value:1
Type:Boolean
Destination:public_mk_define
Description:Enable SOPC Builder System ID. If a System ID SOPC Builder component is connected to the CPU associated with this BSP, it will be enabled in the creation of command-line arguments to download an ELF to the target. Otherwise, system ID and timestamp values are left out of public.mk for application Makefile "download-elf" target definition. With the system ID check disabled, the Nios II EDS tools will not automatically ensure that the application .elf file (and BSP it is linked against) corresponds to the hardware design on the target. If false, adds --accept-bad-sysid to SOPC_SYSID_FLAG in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.allow_code_at_reset
Identifier:ALT_ALLOW_CODE_AT_RESET
Default Value:0
Value:1
Type:Boolean
Destination:none
Description:Indicates if initialization code is allowed at the reset address. If true, defines the macro ALT_ALLOW_CODE_AT_RESET in linker.h.
Restrictions:If true, defines the macro ALT_ALLOW_CODE_AT_RESET in linker.h. This setting is typically false if an external bootloader (e.g. flash bootloader) is present.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.enable_alt_load
Identifier:NONE
Default Value:0
Value:1
Type:Boolean
Destination:none
Description:Enables the alt_load() facility. The alt_load() facility copies sections from the .text memory into RAM. If true, this setting sets up the VMA/LMA of sections in linker.x to allow them to be loaded into the .text memory.
Restrictions:This setting is typically false if an external bootloader (e.g. flash bootloader) is present.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.enable_alt_load_copy_exceptions
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:none
Description:Causes the alt_load() facility to copy the .exceptions section. If true, this setting defines the macro ALT_LOAD_COPY_EXCEPTIONS in linker.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.enable_alt_load_copy_rodata
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:none
Description:Causes the alt_load() facility to copy the .rodata section. If true, this setting defines the macro ALT_LOAD_COPY_RODATA in linker.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.enable_alt_load_copy_rwdata
Identifier:NONE
Default Value:0
Value:1
Type:Boolean
Destination:none
Description:Causes the alt_load() facility to copy the .rwdata section. If true, this setting defines the macro ALT_LOAD_COPY_RWDATA in linker.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.enable_exception_stack
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:none
Description:Enables use of a separate exception stack. If true, defines the macro ALT_EXCEPTION_STACK in linker.h, adds a memory region called exception_stack to linker.x, and provides the symbols __alt_exception_stack_pointer and __alt_exception_stack_limit in linker.x.
Restrictions:The hal.linker.exception_stack_size and hal.linker.exception_stack_memory_region_name settings must also be valid. This setting must be false for MicroC/OS-II BSPs. The exception stack can be used to improve interrupt and other exception performance if the EIC is *not* used.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.enable_interrupt_stack
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:none
Description:Enables use of a separate interrupt stack. If true, defines the macro ALT_INTERRUPT_STACK in linker.h, adds a memory region called interrupt_stack to linker.x, and provides the symbols __alt_interrupt_stack_pointer and __alt_interrupt_stack_limit in linker.x.
Restrictions:The hal.linker.interrupt_stack_size and hal.linker.interrupt_stack_memory_region_name settings must also be valid. This setting must be false for MicroC/OS-II BSPs. Only enable if the EIC is used exclusively. The exception stack can be used to improve interrupt and other exception performance if the EIC is *not* used.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.exception_stack_memory_region_name
Identifier:NONE
Default Value:none
Value:onchip_memory
Type:UnquotedString
Destination:none
Description:Name of the existing memory region that will be divided up to create the 'exception_stack' memory region. The selected region name will be adjusted automatically when the BSP is generated to create the 'exception_stack' memory region.
Restrictions:Only used if hal.linker.enable_exception_stack is true.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.exception_stack_size
Identifier:NONE
Default Value:1024
Value:1024
Type:DecimalNumber
Destination:none
Description:Size of the exception stack in bytes.
Restrictions:Only used if hal.linker.enable_exception_stack is true.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.interrupt_stack_memory_region_name
Identifier:NONE
Default Value:none
Value:onchip_memory
Type:UnquotedString
Destination:none
Description:Name of the existing memory region that will be divided up to create the 'interrupt_stack' memory region. The selected region name will be adjusted automatically when the BSP is generated to create the 'interrupt_stack' memory region.
Restrictions:Only used if hal.linker.enable_interrupt_stack is true.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.interrupt_stack_size
Identifier:NONE
Default Value:1024
Value:1024
Type:DecimalNumber
Destination:none
Description:Size of the interrupt stack in bytes.
Restrictions:Only used if hal.linker.enable_interrupt_stack is true.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.log_flags
Identifier:ALT_LOG_FLAGS
Default Value:0
Value:0
Type:DecimalNumber
Destination:public_mk_define
Description:The value is assigned to ALT_LOG_FLAGS in the generated public.mk. See hal.log_port setting description. Values can be -1 through 3.
Restrictions:hal.log_port must be set for this to be used.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.log_port
Identifier:NONE
Default Value:none
Value:none
Type:UnquotedString
Destination:public_mk_define
Description:Slave descriptor of debug logging character-mode device. If defined, it enables extra debug messages in the HAL source. This setting is used by the ALT_LOG_PORT family of defines in system.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ar
Identifier:AR
Default Value:nios2-elf-ar
Value:nios2-elf-ar
Type:UnquotedString
Destination:makefile_variable
Description:Archiver command. Creates library files.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ar_post_process
Identifier:AR_POST_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed after archiver execution.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ar_pre_process
Identifier:AR_PRE_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed before archiver execution.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.as
Identifier:AS
Default Value:nios2-elf-gcc
Value:nios2-elf-gcc
Type:UnquotedString
Destination:makefile_variable
Description:Assembler command. Note that CC is used for .S files.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.as_post_process
Identifier:AS_POST_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed after each assembly file is compiled.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.as_pre_process
Identifier:AS_PRE_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed before each assembly file is compiled.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_arflags
Identifier:BSP_ARFLAGS
Default Value:-src
Value:-src
Type:UnquotedString
Destination:makefile_variable
Description:Custom flags only passed to the archiver. This content of this variable is directly passed to the archiver rather than the more standard "ARFLAGS". The reason for this is that GNU Make assumes some default content in ARFLAGS. This setting defines the value of BSP_ARFLAGS in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_asflags
Identifier:BSP_ASFLAGS
Default Value:-Wa,-gdwarf2
Value:-Wa,-gdwarf2
Type:UnquotedString
Destination:makefile_variable
Description:Custom flags only passed to the assembler. This setting defines the value of BSP_ASFLAGS in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cflags_debug
Identifier:BSP_CFLAGS_DEBUG
Default Value:-g
Value:-g
Type:UnquotedString
Destination:makefile_variable
Description:C/C++ compiler debug level. '-g' provides the default set of debug symbols typically required to debug a typical application. Omitting '-g' removes debug symbols from the ELF. This setting defines the value of BSP_CFLAGS_DEBUG in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cflags_defined_symbols
Identifier:BSP_CFLAGS_DEFINED_SYMBOLS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Preprocessor macros to define. A macro definition in this setting has the same effect as a "#define" in source code. Adding "-DALT_DEBUG" to this setting has the same effect as "#define ALT_DEBUG" in a souce file. Adding "-DFOO=1" to this setting is equivalent to the macro "#define FOO 1" in a source file. Macros defined with this setting are applied to all .S, .c, and C++ files in the BSP. This setting defines the value of BSP_CFLAGS_DEFINED_SYMBOLS in the BSP Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cflags_optimization
Identifier:BSP_CFLAGS_OPTIMIZATION
Default Value:-O0
Value:'-Os'
Type:UnquotedString
Destination:makefile_variable
Description:C/C++ compiler optimization level. "-O0" = no optimization,"-O2" = "normal" optimization, etc. "-O0" is recommended for code that you want to debug since compiler optimization can remove variables and produce non-sequential execution of code while debugging. This setting defines the value of BSP_CFLAGS_OPTIMIZATION in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cflags_undefined_symbols
Identifier:BSP_CFLAGS_UNDEFINED_SYMBOLS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Preprocessor macros to undefine. Undefined macros are similar to defined macros, but replicate the "#undef" directive in source code. To undefine the macro FOO use the syntax "-u FOO" in this setting. This is equivalent to "#undef FOO" in a source file. Note: the syntax differs from macro definition (there is a space, i.e. "-u FOO" versus "-DFOO"). Macros defined with this setting are applied to all .S, .c, and C++ files in the BSP. This setting defines the value of BSP_CFLAGS_UNDEFINED_SYMBOLS in the BSP Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cflags_user_flags
Identifier:BSP_CFLAGS_USER_FLAGS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Custom flags passed to the compiler when compiling C, C++, and .S files. This setting defines the value of BSP_CFLAGS_USER_FLAGS in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cflags_warnings
Identifier:BSP_CFLAGS_WARNINGS
Default Value:-Wall
Value:-Wall
Type:UnquotedString
Destination:makefile_variable
Description:C/C++ compiler warning level. "-Wall" is commonly used.This setting defines the value of BSP_CFLAGS_WARNINGS in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cxx_flags
Identifier:BSP_CXXFLAGS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Custom flags only passed to the C++ compiler. This setting defines the value of BSP_CXXFLAGS in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_inc_dirs
Identifier:BSP_INC_DIRS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Space separated list of extra include directories to scan for header files. Directories are relative to the top-level BSP directory. The -I prefix's added by the makefile so don't add it here. This setting defines the value of BSP_INC_DIRS in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.build_post_process
Identifier:BUILD_POST_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed after BSP built.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.build_pre_process
Identifier:BUILD_PRE_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed before BSP built.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.cc
Identifier:CC
Default Value:nios2-elf-gcc -xc
Value:nios2-elf-gcc -xc
Type:UnquotedString
Destination:makefile_variable
Description:C compiler command.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.cc_post_process
Identifier:CC_POST_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed after each .c/.S file is compiled.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.cc_pre_process
Identifier:CC_PRE_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed before each .c/.S file is compiled.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.cxx
Identifier:CXX
Default Value:nios2-elf-gcc -xc++
Value:nios2-elf-gcc -xc++
Type:UnquotedString
Destination:makefile_variable
Description:C++ compiler command.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.cxx_post_process
Identifier:CXX_POST_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed before each C++ file is compiled.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.cxx_pre_process
Identifier:CXX_PRE_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed before each C++ file is compiled.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.big_endian
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system is big endian. If true ignores export of 'ALT_CFLAGS += -EB' to public.mk if big endian system. If true ignores export of 'ALT_CFLAGS += -EL' if little endian system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.debug_core_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system has a debug core present. If true ignores export of 'CPU_HAS_DEBUG_CORE = 1' to public.mk if a debug core is found in the system. If true ignores export of 'CPU_HAS_DEBUG_CORE = 0' if no debug core is found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.fpu_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system has FPU present. If true ignores export of 'ALT_CFLAGS += -mhard-float' to public.mk if FPU is found in the system. If true ignores export of 'ALT_CFLAGS += -mhard-soft' if FPU is not found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.hardware_divide_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system has hardware divide present. If true ignores export of 'ALT_CFLAGS += -mno-hw-div' to public.mk if no division is found in system. If true ignores export of 'ALT_CFLAGS += -mhw-div' if division is found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.hardware_fp_cust_inst_divider_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system floating point custom instruction with a divider is present. If true ignores export of 'ALT_CFLAGS += -mcustom-fpu-cfg=60-2' and 'ALT_LDFLAGS += -mcustom-fpu-cfg=60-2' to public.mk if the custom instruction is found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.hardware_fp_cust_inst_no_divider_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system floating point custom instruction without a divider is present. If true ignores export of 'ALT_CFLAGS += -mcustom-fpu-cfg=60-1' and 'ALT_LDFLAGS += -mcustom-fpu-cfg=60-1' to public.mk if the custom instruction is found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.hardware_multiplier_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system has multiplier present. If true ignores export of 'ALT_CFLAGS += -mno-hw-mul' to public.mk if no multiplier is found in the system. If true ignores export of 'ALT_CFLAGS += -mhw-mul' if multiplier is found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.hardware_mulx_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system has hardware mulx present. If true ignores export of 'ALT_CFLAGS += -mno-hw-mulx' to public.mk if no mulx is found in the system. If true ignores export of 'ALT_CFLAGS += -mhw-mulx' if mulx is found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.sopc_simulation_enabled
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system has simulation enabled. If true ignores export of 'ELF_PATCH_FLAG += --simulation_enabled' to public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.sopc_system_base_address
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query SOPC system for system ID base address. If true ignores export of 'SOPC_SYSID_FLAG += --sidp=<address>' and 'ELF_PATCH_FLAG += --sidp=<address>' to public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.sopc_system_id
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query SOPC system for system ID. If true ignores export of 'SOPC_SYSID_FLAG += --id=<sysid>' and 'ELF_PATCH_FLAG += --id=<sysid>' to public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.sopc_system_timestamp
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query SOPC system for system timestamp. If true ignores export of 'SOPC_SYSID_FLAG += --timestamp=<timestamp>' and 'ELF_PATCH_FLAG += --timestamp=<timestamp>' to public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.rm
Identifier:RM
Default Value:rm -f
Value:rm -f
Type:UnquotedString
Destination:makefile_variable
Description:Command used to remove files during 'clean' target.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.max_file_descriptors
Identifier:ALT_MAX_FD
Default Value:32
Value:4
Type:DecimalNumber
Destination:system_h_define
Description:Determines the number of file descriptors statically allocated. This setting defines the value of ALT_MAX_FD in system.h.
Restrictions:If hal.enable_lightweight_device_driver_api is true, there are no file descriptors so this setting is ignored. If hal.enable_lightweight_device_driver_api is false, this setting must be at least 4 because HAL needs a file descriptor for /dev/null, /dev/stdin, /dev/stdout, and /dev/stderr.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.stderr
Identifier:NONE
Default Value:none
Value:jtag_uart
Type:UnquotedString
Destination:system_h_define
Description:Slave descriptor of STDERR character-mode device. This setting is used by the ALT_STDERR family of defines in system.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.stdin
Identifier:NONE
Default Value:none
Value:jtag_uart
Type:UnquotedString
Destination:system_h_define
Description:Slave descriptor of STDIN character-mode device. This setting is used by the ALT_STDIN family of defines in system.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.stdout
Identifier:NONE
Default Value:none
Value:jtag_uart
Type:UnquotedString
Destination:system_h_define
Description:Slave descriptor of STDOUT character-mode device. This setting is used by the ALT_STDOUT family of defines in system.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.sys_clk_timer
Identifier:ALT_SYS_CLK
Default Value:none
Value:none
Type:UnquotedString
Destination:system_h_define
Description:Slave descriptor of the system clock timer device. This device provides a periodic interrupt ("tick") and is typically required for RTOS use. This setting defines the value of ALT_SYS_CLK in system.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.timestamp_timer
Identifier:ALT_TIMESTAMP_CLK
Default Value:none
Value:none
Type:UnquotedString
Destination:system_h_define
Description:Slave descriptor of timestamp timer device. This device is used by Altera HAL timestamp drivers for high-resolution time measurement. This setting defines the value of ALT_TIMESTAMP_CLK in system.h.
Restrictions:none
-
-
-
- - diff --git a/software/qsys_tutorial_green_bsp/system.h b/software/qsys_tutorial_green_bsp/system.h deleted file mode 100644 index 1973270..0000000 --- a/software/qsys_tutorial_green_bsp/system.h +++ /dev/null @@ -1,305 +0,0 @@ -/* - * system.h - SOPC Builder system and BSP software package information - * - * Machine generated for CPU 'nios2_processor' in SOPC Builder design 'nios_system' - * SOPC Builder design path: C:/Users/takayun/Desktop/qsys_tutorial/nios_system.sopcinfo - * - * Generated: Thu Oct 27 10:41:20 JST 2016 - */ - -/* - * DO NOT MODIFY THIS FILE - * - * Changing this file will have subtle consequences - * which will almost certainly lead to a nonfunctioning - * system. If you do modify this file, be aware that your - * changes will be overwritten and lost when this file - * is generated again. - * - * DO NOT MODIFY THIS FILE - */ - -/* - * License Agreement - * - * Copyright (c) 2008 - * Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - * - * This agreement shall be governed in all respects by the laws of the State - * of California and by the laws of the United States of America. - */ - -#ifndef __SYSTEM_H_ -#define __SYSTEM_H_ - -/* Include definitions from linker script generator */ -#include "linker.h" - - -/* - * CPU configuration - * - */ - -#define ALT_CPU_ARCHITECTURE "altera_nios2_qsys" -#define ALT_CPU_BIG_ENDIAN 0 -#define ALT_CPU_BREAK_ADDR 0x1820 -#define ALT_CPU_CPU_FREQ 50000000u -#define ALT_CPU_CPU_ID_SIZE 1 -#define ALT_CPU_CPU_ID_VALUE 0x00000000 -#define ALT_CPU_CPU_IMPLEMENTATION "tiny" -#define ALT_CPU_DATA_ADDR_WIDTH 0xe -#define ALT_CPU_DCACHE_LINE_SIZE 0 -#define ALT_CPU_DCACHE_LINE_SIZE_LOG2 0 -#define ALT_CPU_DCACHE_SIZE 0 -#define ALT_CPU_EXCEPTION_ADDR 0x20 -#define ALT_CPU_FLUSHDA_SUPPORTED -#define ALT_CPU_FREQ 50000000 -#define ALT_CPU_HARDWARE_DIVIDE_PRESENT 0 -#define ALT_CPU_HARDWARE_MULTIPLY_PRESENT 0 -#define ALT_CPU_HARDWARE_MULX_PRESENT 0 -#define ALT_CPU_HAS_DEBUG_CORE 1 -#define ALT_CPU_HAS_DEBUG_STUB -#define ALT_CPU_HAS_JMPI_INSTRUCTION -#define ALT_CPU_ICACHE_LINE_SIZE 0 -#define ALT_CPU_ICACHE_LINE_SIZE_LOG2 0 -#define ALT_CPU_ICACHE_SIZE 0 -#define ALT_CPU_INST_ADDR_WIDTH 0xd -#define ALT_CPU_NAME "nios2_processor" -#define ALT_CPU_RESET_ADDR 0x0 - - -/* - * CPU configuration (with legacy prefix - don't use these anymore) - * - */ - -#define NIOS2_BIG_ENDIAN 0 -#define NIOS2_BREAK_ADDR 0x1820 -#define NIOS2_CPU_FREQ 50000000u -#define NIOS2_CPU_ID_SIZE 1 -#define NIOS2_CPU_ID_VALUE 0x00000000 -#define NIOS2_CPU_IMPLEMENTATION "tiny" -#define NIOS2_DATA_ADDR_WIDTH 0xe -#define NIOS2_DCACHE_LINE_SIZE 0 -#define NIOS2_DCACHE_LINE_SIZE_LOG2 0 -#define NIOS2_DCACHE_SIZE 0 -#define NIOS2_EXCEPTION_ADDR 0x20 -#define NIOS2_FLUSHDA_SUPPORTED -#define NIOS2_HARDWARE_DIVIDE_PRESENT 0 -#define NIOS2_HARDWARE_MULTIPLY_PRESENT 0 -#define NIOS2_HARDWARE_MULX_PRESENT 0 -#define NIOS2_HAS_DEBUG_CORE 1 -#define NIOS2_HAS_DEBUG_STUB -#define NIOS2_HAS_JMPI_INSTRUCTION -#define NIOS2_ICACHE_LINE_SIZE 0 -#define NIOS2_ICACHE_LINE_SIZE_LOG2 0 -#define NIOS2_ICACHE_SIZE 0 -#define NIOS2_INST_ADDR_WIDTH 0xd -#define NIOS2_RESET_ADDR 0x0 - - -/* - * Define for each module class mastered by the CPU - * - */ - -#define __ALTERA_AVALON_JTAG_UART -#define __ALTERA_AVALON_ONCHIP_MEMORY2 -#define __ALTERA_AVALON_PIO -#define __ALTERA_NIOS2_QSYS - - -/* - * LEDRs configuration - * - */ - -#define ALT_MODULE_CLASS_LEDRs altera_avalon_pio -#define LEDRS_BASE 0x2000 -#define LEDRS_BIT_CLEARING_EDGE_REGISTER 0 -#define LEDRS_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define LEDRS_CAPTURE 0 -#define LEDRS_DATA_WIDTH 18 -#define LEDRS_DO_TEST_BENCH_WIRING 0 -#define LEDRS_DRIVEN_SIM_VALUE 0 -#define LEDRS_EDGE_TYPE "NONE" -#define LEDRS_FREQ 50000000 -#define LEDRS_HAS_IN 0 -#define LEDRS_HAS_OUT 1 -#define LEDRS_HAS_TRI 0 -#define LEDRS_IRQ -1 -#define LEDRS_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define LEDRS_IRQ_TYPE "NONE" -#define LEDRS_NAME "/dev/LEDRs" -#define LEDRS_RESET_VALUE 0 -#define LEDRS_SPAN 16 -#define LEDRS_TYPE "altera_avalon_pio" - - -/* - * LEDs configuration - * - */ - -#define ALT_MODULE_CLASS_LEDs altera_avalon_pio -#define LEDS_BASE 0x2020 -#define LEDS_BIT_CLEARING_EDGE_REGISTER 0 -#define LEDS_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define LEDS_CAPTURE 0 -#define LEDS_DATA_WIDTH 8 -#define LEDS_DO_TEST_BENCH_WIRING 0 -#define LEDS_DRIVEN_SIM_VALUE 0 -#define LEDS_EDGE_TYPE "NONE" -#define LEDS_FREQ 50000000 -#define LEDS_HAS_IN 0 -#define LEDS_HAS_OUT 1 -#define LEDS_HAS_TRI 0 -#define LEDS_IRQ -1 -#define LEDS_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define LEDS_IRQ_TYPE "NONE" -#define LEDS_NAME "/dev/LEDs" -#define LEDS_RESET_VALUE 0 -#define LEDS_SPAN 16 -#define LEDS_TYPE "altera_avalon_pio" - - -/* - * System configuration - * - */ - -#define ALT_DEVICE_FAMILY "Cyclone IV E" -#define ALT_ENHANCED_INTERRUPT_API_PRESENT -#define ALT_IRQ_BASE NULL -#define ALT_LOG_PORT "/dev/null" -#define ALT_LOG_PORT_BASE 0x0 -#define ALT_LOG_PORT_DEV null -#define ALT_LOG_PORT_TYPE "" -#define ALT_NUM_EXTERNAL_INTERRUPT_CONTROLLERS 0 -#define ALT_NUM_INTERNAL_INTERRUPT_CONTROLLERS 1 -#define ALT_NUM_INTERRUPT_CONTROLLERS 1 -#define ALT_STDERR "/dev/jtag_uart" -#define ALT_STDERR_BASE 0x2030 -#define ALT_STDERR_DEV jtag_uart -#define ALT_STDERR_IS_JTAG_UART -#define ALT_STDERR_PRESENT -#define ALT_STDERR_TYPE "altera_avalon_jtag_uart" -#define ALT_STDIN "/dev/jtag_uart" -#define ALT_STDIN_BASE 0x2030 -#define ALT_STDIN_DEV jtag_uart -#define ALT_STDIN_IS_JTAG_UART -#define ALT_STDIN_PRESENT -#define ALT_STDIN_TYPE "altera_avalon_jtag_uart" -#define ALT_STDOUT "/dev/jtag_uart" -#define ALT_STDOUT_BASE 0x2030 -#define ALT_STDOUT_DEV jtag_uart -#define ALT_STDOUT_IS_JTAG_UART -#define ALT_STDOUT_PRESENT -#define ALT_STDOUT_TYPE "altera_avalon_jtag_uart" -#define ALT_SYSTEM_NAME "nios_system" - - -/* - * hal configuration - * - */ - -#define ALT_MAX_FD 4 -#define ALT_SYS_CLK none -#define ALT_TIMESTAMP_CLK none - - -/* - * jtag_uart configuration - * - */ - -#define ALT_MODULE_CLASS_jtag_uart altera_avalon_jtag_uart -#define JTAG_UART_BASE 0x2030 -#define JTAG_UART_IRQ 5 -#define JTAG_UART_IRQ_INTERRUPT_CONTROLLER_ID 0 -#define JTAG_UART_NAME "/dev/jtag_uart" -#define JTAG_UART_READ_DEPTH 64 -#define JTAG_UART_READ_THRESHOLD 8 -#define JTAG_UART_SPAN 8 -#define JTAG_UART_TYPE "altera_avalon_jtag_uart" -#define JTAG_UART_WRITE_DEPTH 64 -#define JTAG_UART_WRITE_THRESHOLD 8 - - -/* - * onchip_memory configuration - * - */ - -#define ALT_MODULE_CLASS_onchip_memory altera_avalon_onchip_memory2 -#define ONCHIP_MEMORY_ALLOW_IN_SYSTEM_MEMORY_CONTENT_EDITOR 0 -#define ONCHIP_MEMORY_ALLOW_MRAM_SIM_CONTENTS_ONLY_FILE 0 -#define ONCHIP_MEMORY_BASE 0x0 -#define ONCHIP_MEMORY_CONTENTS_INFO "" -#define ONCHIP_MEMORY_DUAL_PORT 0 -#define ONCHIP_MEMORY_GUI_RAM_BLOCK_TYPE "AUTO" -#define ONCHIP_MEMORY_INIT_CONTENTS_FILE "nios_system_onchip_memory" -#define ONCHIP_MEMORY_INIT_MEM_CONTENT 1 -#define ONCHIP_MEMORY_INSTANCE_ID "NONE" -#define ONCHIP_MEMORY_IRQ -1 -#define ONCHIP_MEMORY_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define ONCHIP_MEMORY_NAME "/dev/onchip_memory" -#define ONCHIP_MEMORY_NON_DEFAULT_INIT_FILE_ENABLED 0 -#define ONCHIP_MEMORY_RAM_BLOCK_TYPE "AUTO" -#define ONCHIP_MEMORY_READ_DURING_WRITE_MODE "DONT_CARE" -#define ONCHIP_MEMORY_SINGLE_CLOCK_OP 0 -#define ONCHIP_MEMORY_SIZE_MULTIPLE 1 -#define ONCHIP_MEMORY_SIZE_VALUE 4096 -#define ONCHIP_MEMORY_SPAN 4096 -#define ONCHIP_MEMORY_TYPE "altera_avalon_onchip_memory2" -#define ONCHIP_MEMORY_WRITABLE 1 - - -/* - * switches configuration - * - */ - -#define ALT_MODULE_CLASS_switches altera_avalon_pio -#define SWITCHES_BASE 0x2010 -#define SWITCHES_BIT_CLEARING_EDGE_REGISTER 0 -#define SWITCHES_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define SWITCHES_CAPTURE 0 -#define SWITCHES_DATA_WIDTH 8 -#define SWITCHES_DO_TEST_BENCH_WIRING 0 -#define SWITCHES_DRIVEN_SIM_VALUE 0 -#define SWITCHES_EDGE_TYPE "NONE" -#define SWITCHES_FREQ 50000000 -#define SWITCHES_HAS_IN 1 -#define SWITCHES_HAS_OUT 0 -#define SWITCHES_HAS_TRI 0 -#define SWITCHES_IRQ -1 -#define SWITCHES_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define SWITCHES_IRQ_TYPE "NONE" -#define SWITCHES_NAME "/dev/switches" -#define SWITCHES_RESET_VALUE 0 -#define SWITCHES_SPAN 16 -#define SWITCHES_TYPE "altera_avalon_pio" - -#endif /* __SYSTEM_H_ */ diff --git a/software/qsys_tutorial_hexs/.cproject b/software/qsys_tutorial_hexs/.cproject deleted file mode 100644 index f6ee57f..0000000 --- a/software/qsys_tutorial_hexs/.cproject +++ /dev/null @@ -1,508 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - make - - mem_init_install - true - false - false - - - make - - mem_init_generate - true - false - false - - - make - - help - true - false - false - - - - diff --git a/software/qsys_tutorial_hexs/.force_relink b/software/qsys_tutorial_hexs/.force_relink deleted file mode 100644 index e69de29..0000000 --- a/software/qsys_tutorial_hexs/.force_relink +++ /dev/null diff --git a/software/qsys_tutorial_hexs/.project b/software/qsys_tutorial_hexs/.project deleted file mode 100644 index c8075f0..0000000 --- a/software/qsys_tutorial_hexs/.project +++ /dev/null @@ -1,96 +0,0 @@ - - - qsys_tutorial_hexs - - - - - - com.altera.sbtgui.project.makefileBuilder - - - - - com.altera.sbtgui.project.makefileBuilder - - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - ?name? - - - - org.eclipse.cdt.make.core.append_environment - true - - - org.eclipse.cdt.make.core.autoBuildTarget - all - - - org.eclipse.cdt.make.core.buildArguments - - - - org.eclipse.cdt.make.core.buildCommand - make - - - org.eclipse.cdt.make.core.buildLocation - ${workspace_loc://qsys_tutorial_hexs} - - - org.eclipse.cdt.make.core.cleanBuildTarget - clean - - - org.eclipse.cdt.make.core.contents - org.eclipse.cdt.make.core.activeConfigSettings - - - org.eclipse.cdt.make.core.enableAutoBuild - false - - - org.eclipse.cdt.make.core.enableCleanBuild - true - - - org.eclipse.cdt.make.core.enableFullBuild - true - - - org.eclipse.cdt.make.core.fullBuildTarget - all - - - org.eclipse.cdt.make.core.stopOnError - true - - - org.eclipse.cdt.make.core.useDefaultBuildCmd - true - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - org.eclipse.cdt.core.ccnature - com.altera.sbtgui.project.SBTGUINature - com.altera.sbtgui.project.SBTGUIAppNature - com.altera.sbtgui.project.SBTGUIManagedNature - - diff --git a/software/qsys_tutorial_hexs/Makefile b/software/qsys_tutorial_hexs/Makefile deleted file mode 100644 index 9ba5836..0000000 --- a/software/qsys_tutorial_hexs/Makefile +++ /dev/null @@ -1,1092 +0,0 @@ -#------------------------------------------------------------------------------ -# VARIABLES APPENDED TO BY INCLUDED MAKEFILE FRAGMENTS -#------------------------------------------------------------------------------ - -# List of include directories for -I compiler option (-I added when used). -# Includes the BSP. -ALT_INCLUDE_DIRS := - -# List of library directories for -L linker option (-L added when used). -# Includes the BSP. -ALT_LIBRARY_DIRS := - -# List of library names for -l linker option (-l added when used). -# Includes the BSP. -ALT_LIBRARY_NAMES := - -# List of library names for -msys-lib linker option (-msys-lib added when used). -# These are libraries that might be located in the BSP and depend on the BSP -# library, or vice versa -ALT_BSP_DEP_LIBRARY_NAMES := - -# List of dependencies for the linker. This is usually the full pathname -# of each library (*.a) file. -# Includes the BSP. -ALT_LDDEPS := - -# List of root library directories that support running make to build them. -# Includes the BSP and any ALT libraries. -MAKEABLE_LIBRARY_ROOT_DIRS := - -# Generic flags passed to the compiler for different types of input files. -ALT_CFLAGS := -ALT_CXXFLAGS := -ALT_CPPFLAGS := -ALT_ASFLAGS := -ALT_LDFLAGS := - - -#------------------------------------------------------------------------------ -# The adjust-path macro -# -# If COMSPEC/ComSpec is defined, Make is launched from Windows through -# Cygwin. The adjust-path macro converts absolute windows paths into -# unix style paths (Example: c:/dir -> /c/dir). This will ensture -# paths are readable by GNU Make. -# -# If COMSPEC/ComSpec is not defined, Make is launched from linux, and no -# adjustment is necessary -# -#------------------------------------------------------------------------------ - -ifndef COMSPEC -ifdef ComSpec -COMSPEC = $(ComSpec) -endif # ComSpec -endif # COMSPEC - -ifdef COMSPEC # if Windows OS - -ifeq ($(MAKE_VERSION),3.81) -# -# adjust-path/adjust-path-mixed for Mingw Gnu Make on Windows -# -# Example Usage: -# $(call adjust-path,c:/aaa/bbb) => /c/aaa/bbb -# $(call adjust-path-mixed,/c/aaa/bbb) => c:/aaa/bbb -# $(call adjust-path-mixed,/cygdrive/c/aaa/bbb) => c:/aaa/bbb -# - -# -# adjust-path -# - converts back slash characters into forward slashes -# - if input arg ($1) is an empty string then return the empty string -# - if input arg ($1) does not contain the string ":/", then return input arg -# - using sed, convert mixed path [c:/...] into mingw path [/c/...] -define adjust-path -$(strip \ -$(if $1,\ -$(if $(findstring :/,$(subst \,/,$1)),\ -$(shell echo $(subst \,/,$1) | sed -e 's,^\([a-zA-Z]\):/,/\1/,'),\ -$(subst \,/,$1)))) -endef - -# -# adjust-path-mixed -# - converts back slash characters into forward slashes -# - if input arg ($1) is an empty string then return the empty string -# - if input arg ($1) does not begin with a forward slash '/' char, then -# return input arg -# - using sed, convert mingw path [/c/...] or cygwin path [/c/cygdrive/...] -# into a mixed path [c:/...] -define adjust-path-mixed -$(strip \ -$(if $1,\ -$(if $(findstring $(subst \,/,$1),$(patsubst /%,%,$(subst \,/,$1))),\ -$(subst \,/,$1),\ -$(shell echo $(subst \,/,$1) | sed -e 's,^/cygdrive/\([a-zA-Z]\)/,\1:/,' -e 's,^/\([a-zA-Z]\)/,\1:/,')))) -endef - -else # MAKE_VERSION != 3.81 (MAKE_VERSION == 3.80 or MAKE_VERSION == 3.79) -# -# adjust-path for Cygwin Gnu Make -# $(call adjust-path,c:/aaa/bbb) = /cygdrive/c/aaa/bbb -# $(call adjust-path-mixed,/cygdrive/c/aaa/bbb) = c:/aaa/bbb -# -adjust-path = $(if $1,$(shell cygpath -u "$1"),) -adjust-path-mixed = $(if $1,$(shell cygpath -m "$1"),) -endif - -else # !COMSPEC - -adjust-path = $1 -adjust-path-mixed = $1 - -endif # COMSPEC - - -#vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv -# GENERATED SETTINGS START v -#vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv - -#START GENERATED -ACTIVE_BUILD_CONFIG := default -BUILD_CONFIGS := default - -# The following TYPE comment allows tools to identify the 'type' of target this -# makefile is associated with. -# TYPE: APP_MAKEFILE - -# This following VERSION comment indicates the version of the tool used to -# generate this makefile. A makefile variable is provided for VERSION as well. -# ACDS_VERSION: 13.0sp1 -ACDS_VERSION := 13.0sp1 - -# This following BUILD_NUMBER comment indicates the build number of the tool -# used to generate this makefile. -# BUILD_NUMBER: 232 - -# Define path to the application ELF. -# It may be used by the makefile fragments so is defined before including them. -# -ELF := qsys_tutorial_hexs.elf - -# Paths to C, C++, and assembly source files. -C_SRCS += hello_world_small.c -C_SRCS += hex_encoder.c -C_SRCS += system.c -C_SRCS += sys_memory.c -C_SRCS += input_int.c -C_SRCS += sys_register.c -C_SRCS += hex_out.c -CXX_SRCS := -ASM_SRCS := - - -# Path to root of object file tree. -OBJ_ROOT_DIR := obj - -# Options to control objdump. -CREATE_OBJDUMP := 1 -OBJDUMP_INCLUDE_SOURCE := 1 -OBJDUMP_FULL_CONTENTS := 0 - -# Options to enable/disable optional files. -CREATE_ELF_DERIVED_FILES := 0 -CREATE_LINKER_MAP := 1 - -# Common arguments for ALT_CFLAGSs -APP_CFLAGS_DEFINED_SYMBOLS := -APP_CFLAGS_UNDEFINED_SYMBOLS := -APP_CFLAGS_OPTIMIZATION := -Os -APP_CFLAGS_DEBUG_LEVEL := -g -APP_CFLAGS_WARNINGS := -Wall -APP_CFLAGS_USER_FLAGS := - -APP_ASFLAGS_USER := -APP_LDFLAGS_USER := - -# Linker options that have default values assigned later if not -# assigned here. -LINKER_SCRIPT := -CRT0 := -SYS_LIB := - -# Define path to the root of the BSP. -BSP_ROOT_DIR := ../qsys_tutorial_hexs_bsp/ - -# List of application specific include directories, library directories and library names -APP_INCLUDE_DIRS := -APP_LIBRARY_DIRS := -APP_LIBRARY_NAMES := - -# Pre- and post- processor settings. -BUILD_PRE_PROCESS := -BUILD_POST_PROCESS := - -QUARTUS_PROJECT_DIR := ../../ - - -#END GENERATED - -#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -# GENERATED SETTINGS END ^ -#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - -#------------------------------------------------------------------------------ -# DEFAULT TARGET -#------------------------------------------------------------------------------ - -# Define the variable used to echo output if not already defined. -ifeq ($(ECHO),) -ECHO := echo -endif - -# Put "all" rule before included makefile fragments because they may -# define rules and we don't want one of those to become the default rule. -.PHONY : all - -all: - @$(ECHO) [$(APP_NAME) build complete] - -all : build_pre_process libs app build_post_process - - -#------------------------------------------------------------------------------ -# VARIABLES DEPENDENT ON GENERATED CONTENT -#------------------------------------------------------------------------------ - -# Define object file directory per build configuration -CONFIG_OBJ_DIR := $(OBJ_ROOT_DIR)/$(ACTIVE_BUILD_CONFIG) - -ifeq ($(BSP_ROOT_DIR),) -$(error Edit Makefile and provide a value for BSP_ROOT_DIR) -endif - -ifeq ($(wildcard $(BSP_ROOT_DIR)),) -$(error BSP directory does not exist: $(BSP_ROOT_DIR)) -endif - -# Define absolute path to the root of the BSP. -ABS_BSP_ROOT_DIR := $(call adjust-path-mixed,$(shell cd "$(BSP_ROOT_DIR)"; pwd)) - -# Include makefile fragments. Define variable ALT_LIBRARY_ROOT_DIR before -# including each makefile fragment so that it knows the path to itself. -BSP_INCLUDE_FILE := $(BSP_ROOT_DIR)/public.mk -ALT_LIBRARY_ROOT_DIR := $(BSP_ROOT_DIR) -include $(BSP_INCLUDE_FILE) -# C2H will need this to touch the BSP public.mk and avoid the sopc file -# out-of-date error during a BSP make -ABS_BSP_INCLUDE_FILE := $(ABS_BSP_ROOT_DIR)/public.mk - - -ifneq ($(WARNING.SMALL_STACK_SIZE),) -# This WARNING is here to protect you from unknowingly using a very small stack -# If the warning is set, increase your stack size or enable the BSP small stack -# setting to eliminate the warning -$(warning WARNING: $(WARNING.SMALL_STACK_SIZE)) -endif - - -# If the BSP public.mk indicates that ALT_SIM_OPTIMIZE is set, rename the ELF -# by prefixing it with RUN_ON_HDL_SIMULATOR_ONLY_. -ifneq ($(filter -DALT_SIM_OPTIMIZE,$(ALT_CPPFLAGS)),) -ELF := RUN_ON_HDL_SIMULATOR_ONLY_$(ELF) -endif - -# If the BSP public.mk indicates that ALT_PROVIDE_GMON is set, add option to -# download_elf target -ifneq ($(filter -DALT_PROVIDE_GMON,$(ALT_CPPFLAGS)),) -GMON_OUT_FILENAME := gmon.out -WRITE_GMON_OPTION := --write-gmon $(GMON_OUT_FILENAME) -endif - -# Name of ELF application. -APP_NAME := $(basename $(ELF)) - -# Set to defaults if variables not already defined in settings. -ifeq ($(LINKER_SCRIPT),) -LINKER_SCRIPT := $(BSP_LINKER_SCRIPT) -endif -ifeq ($(CRT0),) -CRT0 := $(BSP_CRT0) -endif -ifeq ($(SYS_LIB),) -SYS_LIB := $(BSP_SYS_LIB) -endif - -OBJDUMP_NAME := $(APP_NAME).objdump -OBJDUMP_FLAGS := --disassemble --syms --all-header -ifeq ($(OBJDUMP_INCLUDE_SOURCE),1) -OBJDUMP_FLAGS += --source -endif -ifeq ($(OBJDUMP_FULL_CONTENTS),1) -OBJDUMP_FLAGS += --full-contents -endif - -# Create list of linker dependencies (*.a files). -APP_LDDEPS := $(ALT_LDDEPS) $(LDDEPS) - -# Take lists and add required prefixes. -APP_INC_DIRS := $(addprefix -I, $(ALT_INCLUDE_DIRS) $(APP_INCLUDE_DIRS) $(INC_DIRS)) -ASM_INC_PREFIX := -Wa,-I -APP_ASM_INC_DIRS := $(addprefix $(ASM_INC_PREFIX), $(ALT_INCLUDE_DIRS) $(APP_INCLUDE_DIRS) $(INC_DIRS)) -APP_LIB_DIRS := $(addprefix -L, $(ALT_LIBRARY_DIRS) $(APP_LIBRARY_DIRS) $(LIB_DIRS)) -APP_LIBS := $(addprefix -l, $(ALT_LIBRARY_NAMES) $(APP_LIBRARY_NAMES) $(LIBS)) - -ifneq ($(AVOID_NIOS2_GCC3_OPTIONS),) - -# -# Avoid Nios II GCC 3.X options. -# - -# Detect if small newlib C library is requested. -# If yes, remove the -msmallc option because it is -# now handled by other means. -ifneq ($(filter -msmallc,$(ALT_LDFLAGS)),) - ALT_LDFLAGS := $(filter-out -msmallc,$(ALT_LDFLAGS)) - ALT_C_LIBRARY := smallc -else - ALT_C_LIBRARY := c -endif - -# Put each BSP dependent library in a group to avoid circular dependencies. -APP_BSP_DEP_LIBS := $(foreach l,$(ALT_BSP_DEP_LIBRARY_NAMES),-Wl,--start-group -l$(ALT_C_LIBRARY) -lgcc -l$(l) -Wl,--end-group) - -else # !AVOID_NIOS2_GCC3_OPTIONS - -# -# Use Nios II GCC 3.X options. -# -APP_BSP_DEP_LIBS := $(addprefix -msys-lib=, $(ALT_BSP_DEP_LIBRARY_NAMES)) - -endif # !AVOID_NIOS2_GCC3_OPTIONS - -# Arguments for the C preprocessor, C/C++ compiler, assembler, and linker. -APP_CFLAGS := $(APP_CFLAGS_DEFINED_SYMBOLS) \ - $(APP_CFLAGS_UNDEFINED_SYMBOLS) \ - $(APP_CFLAGS_OPTIMIZATION) \ - $(APP_CFLAGS_DEBUG_LEVEL) \ - $(APP_CFLAGS_WARNINGS) \ - $(APP_CFLAGS_USER_FLAGS) \ - $(ALT_CFLAGS) \ - $(CFLAGS) - -# Arguments only for the C++ compiler. -APP_CXXFLAGS := $(ALT_CXXFLAGS) $(CXXFLAGS) - -# Arguments only for the C preprocessor. -# Prefix each include directory with -I. -APP_CPPFLAGS := $(APP_INC_DIRS) \ - $(ALT_CPPFLAGS) \ - $(CPPFLAGS) - -# Arguments only for the assembler. -APP_ASFLAGS := $(APP_ASM_INC_DIRS) \ - $(ALT_ASFLAGS) \ - $(APP_ASFLAGS_USER) \ - $(ASFLAGS) - -# Arguments only for the linker. -APP_LDFLAGS := $(APP_LDFLAGS_USER) - -ifneq ($(LINKER_SCRIPT),) -APP_LDFLAGS += -T'$(LINKER_SCRIPT)' -endif - -ifneq ($(AVOID_NIOS2_GCC3_OPTIONS),) - -# Avoid Nios II GCC 3.x options. -ifneq ($(CRT0),) -APP_LDFLAGS += $(CRT0) -endif - -# The equivalent of the -msys-lib option is provided -# by the GROUP() command in the linker script. -# Note this means the SYS_LIB variable is now ignored. - -else # !AVOID_NIOS2_GCC3_OPTIONS - -# Use Nios II GCC 3.x options. -ifneq ($(CRT0),) -APP_LDFLAGS += -msys-crt0='$(CRT0)' -endif -ifneq ($(SYS_LIB),) -APP_LDFLAGS += -msys-lib=$(SYS_LIB) -endif - -endif # !AVOID_NIOS2_GCC3_OPTIONS - -APP_LDFLAGS += \ - $(APP_LIB_DIRS) \ - $(ALT_LDFLAGS) \ - $(LDFLAGS) - -LINKER_MAP_NAME := $(APP_NAME).map -ifeq ($(CREATE_LINKER_MAP), 1) -APP_LDFLAGS += -Wl,-Map=$(LINKER_MAP_NAME) -endif - -# QUARTUS_PROJECT_DIR and SOPC_NAME need to be defined if you want the -# mem_init_install target of the mem_init.mk (located in the associated BSP) -# to know how to copy memory initialization files (e.g. .dat, .hex) into -# directories required for Quartus compilation or RTL simulation. - -# Defining QUARTUS_PROJECT_DIR causes mem_init_install to copy memory -# initialization files into your Quartus project directory. This is required -# to provide the initial memory contents of FPGA memories that can be -# initialized by the programming file (.sof) or Hardcopy ROMs. It is also used -# for VHDL simulation of on-chip memories. - -# Defining SOPC_NAME causes the mem_init_install target to copy memory -# initialization files into your RTL simulation directory. This is required -# to provide the initial memory contents of all memories that can be -# initialized by RTL simulation. This variable should be set to the same name -# as your SOPC Builder system name. For example, if you have a system called -# "foo.sopc", this variable should be set to "foo". - -# If SOPC_NAME is not set and QUARTUS_PROJECT_DIR is set, then derive SOPC_NAME. -ifeq ($(SOPC_NAME),) -ifneq ($(QUARTUS_PROJECT_DIR),) -SOPC_NAME := $(basename $(notdir $(wildcard $(QUARTUS_PROJECT_DIR)/*.sopcinfo))) -endif -endif - -# Defining JDI_FILE is required to specify the JTAG Debug Information File -# path. This file is generated by Quartus, and is needed along with the -# .sopcinfo file to resolve processor instance ID's from names in a multi-CPU -# systems. For multi-CPU systems, the processor instance ID is used to select -# from multiple CPU's during ELF download. - -# Both JDI_FILE and SOPCINFO_FILE are provided by the BSP if they found during -# BSP creation. If JDI_FILE is not set and QUARTUS_PROJECT_DIR is set, then -# derive JDI_FILE. We do not attempt to derive SOPCINFO_FILE since there may be -# multiple .sopcinfo files in a Quartus project. -ifeq ($(JDI_FILE),) -ifneq ($(QUARTUS_PROJECT_DIR),) -JDI_FILE := $(wildcard $(QUARTUS_PROJECT_DIR)/*.jdi) -endif -endif - -# Path to root runtime directory used for hdl simulation -RUNTIME_ROOT_DIR := $(CONFIG_OBJ_DIR)/runtime - - - -#------------------------------------------------------------------------------ -# MAKEFILE INCLUDES DEPENDENT ON GENERATED CONTENT -#------------------------------------------------------------------------------ -# mem_init.mk is a generated makefile fragment. This file defines all targets -# used to generate HDL initialization simulation files and pre-initialized -# onchip memory files. -MEM_INIT_FILE := $(BSP_ROOT_DIR)/mem_init.mk -include $(MEM_INIT_FILE) - -# Create list of object files to be built using the list of source files. -# The source file hierarchy is preserved in the object tree. -# The supported file extensions are: -# -# .c - for C files -# .cxx .cc .cpp - for C++ files -# .S .s - for assembler files -# -# Handle source files specified by --src-dir & --src-rdir differently, to -# save some processing time in calling the adjust-path macro. - -OBJ_LIST_C := $(patsubst %.c,%.o,$(filter %.c,$(C_SRCS))) -OBJ_LIST_CPP := $(patsubst %.cpp,%.o,$(filter %.cpp,$(CXX_SRCS))) -OBJ_LIST_CXX := $(patsubst %.cxx,%.o,$(filter %.cxx,$(CXX_SRCS))) -OBJ_LIST_CC := $(patsubst %.cc,%.o,$(filter %.cc,$(CXX_SRCS))) -OBJ_LIST_S := $(patsubst %.S,%.o,$(filter %.S,$(ASM_SRCS))) -OBJ_LIST_SS := $(patsubst %.s,%.o,$(filter %.s,$(ASM_SRCS))) - -OBJ_LIST := $(sort $(OBJ_LIST_C) $(OBJ_LIST_CPP) $(OBJ_LIST_CXX) \ - $(OBJ_LIST_CC) $(OBJ_LIST_S) $(OBJ_LIST_SS)) - -SDIR_OBJ_LIST_C := $(patsubst %.c,%.o,$(filter %.c,$(SDIR_C_SRCS))) -SDIR_OBJ_LIST_CPP := $(patsubst %.cpp,%.o,$(filter %.cpp,$(SDIR_CXX_SRCS))) -SDIR_OBJ_LIST_CXX := $(patsubst %.cxx,%.o,$(filter %.cxx,$(SDIR_CXX_SRCS))) -SDIR_OBJ_LIST_CC := $(patsubst %.cc,%.o,$(filter %.cc,$(SDIR_CXX_SRCS))) -SDIR_OBJ_LIST_S := $(patsubst %.S,%.o,$(filter %.S,$(SDIR_ASM_SRCS))) -SDIR_OBJ_LIST_SS := $(patsubst %.s,%.o,$(filter %.s,$(SDIR_ASM_SRCS))) - -SDIR_OBJ_LIST := $(sort $(SDIR_OBJ_LIST_C) $(SDIR_OBJ_LIST_CPP) \ - $(SDIR_OBJ_LIST_CXX) $(SDIR_OBJ_LIST_CC) $(SDIR_OBJ_LIST_S) \ - $(SDIR_OBJ_LIST_SS)) - -# Relative-pathed objects that being with "../" are handled differently. -# -# Regular objects are created as -# $(CONFIG_OBJ_DIR)//.o -# where the path structure is maintained under the obj directory. This -# applies for both absolute and relative paths; in the absolute path -# case this means the entire source path will be recreated under the obj -# directory. This is done to allow two source files with the same name -# to be included as part of the project. -# -# Note: On Cygwin, the path recreated under the obj directory will be -# the cygpath -u output path. -# -# Relative-path objects that begin with "../" cause problems under this -# scheme, as $(CONFIG_OBJ_DIR)/..// can potentially put the object -# files anywhere in the system, creating clutter and polluting the source tree. -# As such, their paths are flattened - the object file created will be -# $(CONFIG_OBJ_DIR)/.o. Due to this, two files specified with -# "../" in the beginning cannot have the same name in the project. VPATH -# will be set for these sources to allow make to relocate the source file -# via %.o rules. -# -# The following lines separate the object list into the flatten and regular -# lists, and then handles them as appropriate. - -FLATTEN_OBJ_LIST := $(filter ../%,$(OBJ_LIST)) -FLATTEN_APP_OBJS := $(addprefix $(CONFIG_OBJ_DIR)/,$(notdir $(FLATTEN_OBJ_LIST))) - -REGULAR_OBJ_LIST := $(filter-out $(FLATTEN_OBJ_LIST),$(OBJ_LIST)) -REGULAR_OBJ_LIST_C := $(filter $(OBJ_LIST_C),$(REGULAR_OBJ_LIST)) -REGULAR_OBJ_LIST_CPP := $(filter $(OBJ_LIST_CPP),$(REGULAR_OBJ_LIST)) -REGULAR_OBJ_LIST_CXX := $(filter $(OBJ_LIST_CXX),$(REGULAR_OBJ_LIST)) -REGULAR_OBJ_LIST_CC := $(filter $(OBJ_LIST_CC),$(REGULAR_OBJ_LIST)) -REGULAR_OBJ_LIST_S := $(filter $(OBJ_LIST_S),$(REGULAR_OBJ_LIST)) -REGULAR_OBJ_LIST_SS := $(filter $(OBJ_LIST_SS),$(REGULAR_OBJ_LIST)) - -FLATTEN_SDIR_OBJ_LIST := $(filter ../%,$(SDIR_OBJ_LIST)) -FLATTEN_SDIR_APP_OBJS := $(addprefix $(CONFIG_OBJ_DIR)/,$(notdir $(FLATTEN_SDIR_OBJ_LIST))) - -REGULAR_SDIR_OBJ_LIST := $(filter-out $(FLATTEN_SDIR_OBJ_LIST),$(SDIR_OBJ_LIST)) -REGULAR_SDIR_OBJ_LIST_C := $(filter $(SDIR_OBJ_LIST_C),$(REGULAR_SDIR_OBJ_LIST)) -REGULAR_SDIR_OBJ_LIST_CPP := $(filter $(SDIR_OBJ_LIST_CPP),$(REGULAR_SDIR_OBJ_LIST)) -REGULAR_SDIR_OBJ_LIST_CXX := $(filter $(SDIR_OBJ_LIST_CXX),$(REGULAR_SDIR_OBJ_LIST)) -REGULAR_SDIR_OBJ_LIST_CC := $(filter $(SDIR_OBJ_LIST_CC),$(REGULAR_SDIR_OBJ_LIST)) -REGULAR_SDIR_OBJ_LIST_S := $(filter $(SDIR_OBJ_LIST_S),$(REGULAR_SDIR_OBJ_LIST)) -REGULAR_SDIR_OBJ_LIST_SS := $(filter $(SDIR_OBJ_LIST_SS),$(REGULAR_SDIR_OBJ_LIST)) - -VPATH := $(sort $(dir $(FLATTEN_OBJ_LIST)) $(dir $(FLATTEN_SDIR_OBJ_LIST))) - -APP_OBJS_C := $(addprefix $(CONFIG_OBJ_DIR)/,\ - $(REGULAR_SDIR_OBJ_LIST_C) \ - $(foreach s,$(REGULAR_OBJ_LIST_C),$(call adjust-path,$s))) - -APP_OBJS_CPP := $(addprefix $(CONFIG_OBJ_DIR)/,\ - $(REGULAR_SDIR_OBJ_LIST_CPP) \ - $(foreach s,$(REGULAR_OBJ_LIST_CPP),$(call adjust-path,$s))) - -APP_OBJS_CXX := $(addprefix $(CONFIG_OBJ_DIR)/,\ - $(REGULAR_SDIR_OBJ_LIST_CXX) \ - $(foreach s,$(REGULAR_OBJ_LIST_CXX),$(call adjust-path,$s))) - -APP_OBJS_CC := $(addprefix $(CONFIG_OBJ_DIR)/,\ - $(REGULAR_SDIR_OBJ_LIST_CC) \ - $(foreach s,$(REGULAR_OBJ_LIST_CC),$(call adjust-path,$s))) - -APP_OBJS_S := $(addprefix $(CONFIG_OBJ_DIR)/,\ - $(REGULAR_SDIR_OBJ_LIST_S) \ - $(foreach s,$(REGULAR_OBJ_LIST_S),$(call adjust-path,$s))) - -APP_OBJS_SS := $(addprefix $(CONFIG_OBJ_DIR)/,\ - $(REGULAR_SDIR_OBJ_LIST_SS) \ - $(foreach s,$(REGULAR_OBJ_LIST_SS),$(call adjust-path,$s))) - -APP_OBJS := $(APP_OBJS_C) $(APP_OBJS_CPP) $(APP_OBJS_CXX) $(APP_OBJS_CC) \ - $(APP_OBJS_S) $(APP_OBJS_SS) \ - $(FLATTEN_APP_OBJS) $(FLATTEN_SDIR_APP_OBJS) - -# Add any extra user-provided object files. -APP_OBJS += $(OBJS) - -# Create list of dependancy files for each object file. -APP_DEPS := $(APP_OBJS:.o=.d) - -# Patch the Elf file with system specific information - -# Patch the Elf with the name of the sopc system -ifneq ($(SOPC_NAME),) -ELF_PATCH_FLAG += --sopc_system_name $(SOPC_NAME) -endif - -# Patch the Elf with the absolute path to the Quartus Project Directory -ifneq ($(QUARTUS_PROJECT_DIR),) -ABS_QUARTUS_PROJECT_DIR := $(call adjust-path-mixed,$(shell cd "$(QUARTUS_PROJECT_DIR)"; pwd)) -ELF_PATCH_FLAG += --quartus_project_dir "$(ABS_QUARTUS_PROJECT_DIR)" -endif - -# Patch the Elf and download args with the JDI_FILE if specified -ifneq ($(wildcard $(JDI_FILE)),) -ELF_PATCH_FLAG += --jdi $(JDI_FILE) -DOWNLOAD_JDI_FLAG := --jdi $(JDI_FILE) -endif - -# Patch the Elf with the SOPCINFO_FILE if specified -ifneq ($(wildcard $(SOPCINFO_FILE)),) -ELF_PATCH_FLAG += --sopcinfo $(SOPCINFO_FILE) -endif - -# Use the DOWNLOAD_CABLE variable to specify which JTAG cable to use. -# This is not needed if you only have one cable. -ifneq ($(DOWNLOAD_CABLE),) -DOWNLOAD_CABLE_FLAG := --cable '$(DOWNLOAD_CABLE)' -endif - - -#------------------------------------------------------------------------------ -# BUILD PRE/POST PROCESS -#------------------------------------------------------------------------------ -build_pre_process : - $(BUILD_PRE_PROCESS) - -build_post_process : - $(BUILD_POST_PROCESS) - -.PHONY: build_pre_process build_post_process - - -#------------------------------------------------------------------------------ -# TOOLS -#------------------------------------------------------------------------------ - -# -# Set tool default variables if not already defined. -# If these are defined, they would typically be defined in an -# included makefile fragment. -# -ifeq ($(DEFAULT_CROSS_COMPILE),) -DEFAULT_CROSS_COMPILE := nios2-elf- -endif - -ifeq ($(DEFAULT_STACK_REPORT),) -DEFAULT_STACKREPORT := nios2-stackreport -endif - -ifeq ($(DEFAULT_DOWNLOAD),) -DEFAULT_DOWNLOAD := nios2-download -endif - -ifeq ($(DEFAULT_FLASHPROG),) -DEFAULT_FLASHPROG := nios2-flash-programmer -endif - -ifeq ($(DEFAULT_ELFPATCH),) -DEFAULT_ELFPATCH := nios2-elf-insert -endif - -ifeq ($(DEFAULT_RM),) -DEFAULT_RM := rm -f -endif - -ifeq ($(DEFAULT_CP),) -DEFAULT_CP := cp -f -endif - -ifeq ($(DEFAULT_MKDIR),) -DEFAULT_MKDIR := mkdir -p -endif - -# -# Set tool variables to defaults if not already defined. -# If these are defined, they would typically be defined by a -# setting in the generated portion of this makefile. -# -ifeq ($(CROSS_COMPILE),) -CROSS_COMPILE := $(DEFAULT_CROSS_COMPILE) -endif - -ifeq ($(origin CC),default) -CC := $(CROSS_COMPILE)gcc -xc -endif - -ifeq ($(origin CXX),default) -CXX := $(CROSS_COMPILE)gcc -xc++ -endif - -ifeq ($(origin AS),default) -AS := $(CROSS_COMPILE)gcc -endif - -ifeq ($(origin AR),default) -AR := $(CROSS_COMPILE)ar -endif - -ifeq ($(origin LD),default) -LD := $(CROSS_COMPILE)g++ -endif - -ifeq ($(origin NM),default) -NM := $(CROSS_COMPILE)nm -endif - -ifeq ($(origin RM),default) -RM := $(DEFAULT_RM) -endif - -ifeq ($(origin CP),default) -CP := $(DEFAULT_CP) -endif - -ifeq ($(OBJDUMP),) -OBJDUMP := $(CROSS_COMPILE)objdump -endif - -ifeq ($(OBJCOPY),) -OBJCOPY := $(CROSS_COMPILE)objcopy -endif - -ifeq ($(STACKREPORT),) -ifeq ($(CROSS_COMPILE),nios2-elf-) -STACKREPORT := $(DEFAULT_STACKREPORT) -else -DISABLE_STACKREPORT := 1 -endif -endif - -ifeq ($(DOWNLOAD),) -DOWNLOAD := $(DEFAULT_DOWNLOAD) -endif - -ifeq ($(FLASHPROG),) -FLASHPROG := $(DEFAULT_FLASHPROG) -endif - -ifeq ($(ELFPATCH),) -ELFPATCH := $(DEFAULT_ELFPATCH) -endif - -ifeq ($(MKDIR),) -MKDIR := $(DEFAULT_MKDIR) -endif - -#------------------------------------------------------------------------------ -# PATTERN RULES TO BUILD OBJECTS -#------------------------------------------------------------------------------ - -define compile.c -@$(ECHO) Info: Compiling $< to $@ -@$(MKDIR) $(@D) -$(CC) -MP -MMD -c $(APP_CPPFLAGS) $(APP_CFLAGS) -o $@ $< -$(CC_POST_PROCESS) -endef - -define compile.cpp -@$(ECHO) Info: Compiling $< to $@ -@$(MKDIR) $(@D) -$(CXX) -MP -MMD -c $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< -$(CXX_POST_PROCESS) -endef - -# If assembling with the compiler, ensure "-Wa," is prepended to all APP_ASFLAGS -ifeq ($(AS),$(patsubst %as,%,$(AS))) -COMMA := , -APP_ASFLAGS := $(filter-out $(APP_CFLAGS),$(addprefix -Wa$(COMMA),$(patsubst -Wa$(COMMA)%,%,$(APP_ASFLAGS)))) -endif - -define compile.s -@$(ECHO) Info: Assembling $< to $@ -@$(MKDIR) $(@D) -$(AS) -MP -MMD -c $(APP_CPPFLAGS) $(APP_CFLAGS) $(APP_ASFLAGS) -o $@ $< -$(AS_POST_PROCESS) -endef - -ifeq ($(MAKE_VERSION),3.81) -.SECONDEXPANSION: - -$(APP_OBJS_C): $(CONFIG_OBJ_DIR)/%.o: $$(call adjust-path-mixed,%.c) - $(compile.c) - -$(APP_OBJS_CPP): $(CONFIG_OBJ_DIR)/%.o: $$(call adjust-path-mixed,%.cpp) - $(compile.cpp) - -$(APP_OBJS_CC): $(CONFIG_OBJ_DIR)/%.o: $$(call adjust-path-mixed,%.cc) - $(compile.cpp) - -$(APP_OBJS_CXX): $(CONFIG_OBJ_DIR)/%.o: $$(call adjust-path-mixed,%.cxx) - $(compile.cpp) - -$(APP_OBJS_S): $(CONFIG_OBJ_DIR)/%.o: $$(call adjust-path-mixed,%.S) - $(compile.s) - -$(APP_OBJS_SS): $(CONFIG_OBJ_DIR)/%.o: $$(call adjust-path-mixed,%.s) - $(compile.s) - -endif # MAKE_VERSION != 3.81 - -$(CONFIG_OBJ_DIR)/%.o: %.c - $(compile.c) - -$(CONFIG_OBJ_DIR)/%.o: %.cpp - $(compile.cpp) - -$(CONFIG_OBJ_DIR)/%.o: %.cc - $(compile.cpp) - -$(CONFIG_OBJ_DIR)/%.o: %.cxx - $(compile.cpp) - -$(CONFIG_OBJ_DIR)/%.o: %.S - $(compile.s) - -$(CONFIG_OBJ_DIR)/%.o: %.s - $(compile.s) - - -#------------------------------------------------------------------------------ -# PATTERN RULES TO INTERMEDIATE FILES -#------------------------------------------------------------------------------ - -$(CONFIG_OBJ_DIR)/%.s: %.c - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CC) -S $(APP_CPPFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.s: %.cpp - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CXX) -S $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.s: %.cc - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CXX) -S $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.s: %.cxx - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CXX) -S $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.i: %.c - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CC) -E $(APP_CPPFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.i: %.cpp - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CXX) -E $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.i: %.cc - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CXX) -E $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.i: %.cxx - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CXX) -E $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< - - -#------------------------------------------------------------------------------ -# TARGET RULES -#------------------------------------------------------------------------------ - -.PHONY : help -help : - @$(ECHO) "Summary of Makefile targets" - @$(ECHO) " Build targets:" - @$(ECHO) " all (default) - Application and all libraries (including BSP)" - @$(ECHO) " bsp - Just the BSP" - @$(ECHO) " libs - All libraries (including BSP)" - @$(ECHO) " flash - All flash files" - @$(ECHO) " mem_init_generate - All memory initialization files" -ifeq ($(QSYS),1) - @$(ECHO) " mem_init_install - This target is deprecated for QSys Systems" - @$(ECHO) " --> Use the mem_init_generate target and then" - @$(ECHO) " add the generated meminit.qip file to your" - @$(ECHO) " Quartus II Project." -else # if QSYS != 1 - @$(ECHO) " mem_init_install - Copy memory initialization files to Quartus II project" -endif # QSYS == 1 - @$(ECHO) - @$(ECHO) " Clean targets:" - @$(ECHO) " clean_all - Application and all libraries (including BSP)" - @$(ECHO) " clean - Just the application" - @$(ECHO) " clean_bsp - Just the BSP" - @$(ECHO) " clean_libs - All libraries (including BSP)" - @$(ECHO) - @$(ECHO) " Run targets:" - @$(ECHO) " download-elf - Download and run your elf executable" - @$(ECHO) " program-flash - Program flash contents to the board" - -# Handy rule to skip making libraries and just make application. -.PHONY : app -app : $(ELF) - -ifeq ($(CREATE_OBJDUMP), 1) -app : $(OBJDUMP_NAME) -endif - -ifeq ($(CREATE_ELF_DERIVED_FILES),1) -app : elf_derived_files -endif - -.PHONY: elf_derived_files -elf_derived_files: default_mem_init - -# Handy rule for making just the BSP. -.PHONY : bsp -bsp : - @$(ECHO) Info: Building $(BSP_ROOT_DIR) - @$(MAKE) --no-print-directory -C $(BSP_ROOT_DIR) - - -# Make sure all makeable libraries (including the BSP) are up-to-date. -LIB_TARGETS := $(patsubst %,%-recurs-make-lib,$(MAKEABLE_LIBRARY_ROOT_DIRS)) - -.PHONY : libs -libs : $(LIB_TARGETS) - -ifneq ($(strip $(LIB_TARGETS)),) -$(LIB_TARGETS): %-recurs-make-lib: - @$(ECHO) Info: Building $* - $(MAKE) --no-print-directory -C $* -endif - -ifneq ($(strip $(APP_LDDEPS)),) -$(APP_LDDEPS): libs - @true -endif - -# Rules to force your project to rebuild or relink -# .force_relink file will cause any application that depends on this project to relink -# .force_rebuild file will cause this project to rebuild object files -# .force_rebuild_all file will cause this project and any project that depends on this project to rebuild object files - -FORCE_RELINK_DEP := .force_relink -FORCE_REBUILD_DEP := .force_rebuild -FORCE_REBUILD_ALL_DEP := .force_rebuild_all -FORCE_REBUILD_DEP_LIST := $(CONFIG_OBJ_DIR)/$(FORCE_RELINK_DEP) $(CONFIG_OBJ_DIR)/$(FORCE_REBUILD_DEP) $(FORCE_REBUILD_ALL_DEP) - -$(FORCE_REBUILD_DEP_LIST): - -$(APP_OBJS): $(wildcard $(CONFIG_OBJ_DIR)/$(FORCE_REBUILD_DEP)) $(wildcard $(addsuffix /$(FORCE_REBUILD_ALL_DEP), . $(ALT_LIBRARY_DIRS))) - -$(ELF): $(wildcard $(addsuffix /$(FORCE_RELINK_DEP), $(CONFIG_OBJ_DIR) $(ALT_LIBRARY_DIRS))) - - -# Clean just the application. -.PHONY : clean -ifeq ($(CREATE_ELF_DERIVED_FILES),1) -clean : clean_elf_derived_files -endif - -clean : - @$(RM) -r $(ELF) $(OBJDUMP_NAME) $(LINKER_MAP_NAME) $(OBJ_ROOT_DIR) $(RUNTIME_ROOT_DIR) $(FORCE_REBUILD_DEP_LIST) - @$(ECHO) [$(APP_NAME) clean complete] - -# Clean just the BSP. -.PHONY : clean_bsp -clean_bsp : - @$(ECHO) Info: Cleaning $(BSP_ROOT_DIR) - @$(MAKE) --no-print-directory -C $(BSP_ROOT_DIR) clean - -# Clean all makeable libraries including the BSP. -LIB_CLEAN_TARGETS := $(patsubst %,%-recurs-make-clean-lib,$(MAKEABLE_LIBRARY_ROOT_DIRS)) - -.PHONY : clean_libs -clean_libs : $(LIB_CLEAN_TARGETS) - -ifneq ($(strip $(LIB_CLEAN_TARGETS)),) -$(LIB_CLEAN_TARGETS): %-recurs-make-clean-lib: - @$(ECHO) Info: Cleaning $* - $(MAKE) --no-print-directory -C $* clean -endif - -.PHONY: clean_elf_derived_files -clean_elf_derived_files: mem_init_clean - -# Clean application and all makeable libraries including the BSP. -.PHONY : clean_all -clean_all : clean mem_init_clean clean_libs - -# Include the dependency files unless the make goal is performing a clean -# of the application. -ifneq ($(firstword $(MAKECMDGOALS)),clean) -ifneq ($(firstword $(MAKECMDGOALS)),clean_all) --include $(APP_DEPS) -endif -endif - -.PHONY : download-elf -download-elf : $(ELF) - @if [ "$(DOWNLOAD)" = "none" ]; \ - then \ - $(ECHO) Downloading $(ELF) not supported; \ - else \ - $(ECHO) Info: Downloading $(ELF); \ - $(DOWNLOAD) --go --cpu_name=$(CPU_NAME) $(DOWNLOAD_CABLE_FLAG) $(SOPC_SYSID_FLAG) $(DOWNLOAD_JDI_FLAG) $(WRITE_GMON_OPTION) $(ELF); \ - fi - -# Delete the target of a rule if it has changed and its commands exit -# with a nonzero exit status. -.DELETE_ON_ERROR: - -# Rules for flash programming commands -PROGRAM_FLASH_SUFFIX := -program -PROGRAM_FLASH_TARGET := $(addsuffix $(PROGRAM_FLASH_SUFFIX), $(FLASH_FILES)) - -.PHONY : program-flash -program-flash : $(PROGRAM_FLASH_TARGET) - -.PHONY : $(PROGRAM_FLASH_TARGET) -$(PROGRAM_FLASH_TARGET) : flash - @if [ "$(FLASHPROG)" = "none" ]; \ - then \ - $(ECHO) Programming flash not supported; \ - else \ - $(ECHO) Info: Programming $(basename $@).flash; \ - if [ -z "$($(basename $@)_EPCS_FLAGS)" ]; \ - then \ - $(ECHO) $(FLASHPROG) $(SOPC_SYSID_FLAG) --base=$($(basename $@)_START) $(basename $@).flash; \ - $(FLASHPROG) $(DOWNLOAD_CABLE_FLAG) $(SOPC_SYSID_FLAG) --base=$($(basename $@)_START) $(basename $@).flash; \ - else \ - $(ECHO) $(FLASHPROG) $(SOPC_SYSID_FLAG) --epcs --base=$($(basename $@)_START) $(basename $@).flash; \ - $(FLASHPROG) $(DOWNLOAD_CABLE_FLAG) $(SOPC_SYSID_FLAG) --epcs --base=$($(basename $@)_START) $(basename $@).flash; \ - fi \ - fi - - -# Rules for simulating with an HDL Simulator [QSYS only] -ifeq ($(QSYS),1) -IP_MAKE_SIMSCRIPT := ip-make-simscript - -ifeq ($(VSIM),) -VSIM_EXE := "$(if $(VSIM_DIR),$(VSIM_DIR)/,)vsim" -ifeq ($(ENABLE_VSIM_GUI),1) -VSIM := $(VSIM_EXE) -gui -else -VSIM := $(VSIM_EXE) -c -endif # ENABLE_VSIM_GUI == 1 -endif # VSIM not set - -ifeq ($(SPD),) -ifneq ($(ABS_QUARTUS_PROJECT_DIR),) -ifneq ($(SOPC_NAME),) -SPD := $(ABS_QUARTUS_PROJECT_DIR)/$(SOPC_NAME)_tb.spd -endif # SOPC_NAME set -endif # ABS_QUARTUS_PROJECT_DIR set -endif # SPD == empty string - -ifeq ($(MSIM_SCRIPT),) -SIM_SCRIPT_DIR := $(RUNTIME_ROOT_DIR)/sim -MSIM_SCRIPT := $(SIM_SCRIPT_DIR)/mentor/msim_setup.tcl -endif # MSIM_SCRIPT == empty string - -ifeq ($(MAKE_VERSION),3.81) -ABS_MEM_INIT_DESCRIPTOR_FILE := $(abspath $(MEM_INIT_DESCRIPTOR_FILE)) -else -ABS_MEM_INIT_DESCRIPTOR_FILE := $(call adjust-path-mixed,$(shell pwd))/$(MEM_INIT_DESCRIPTOR_FILE) -endif - -$(MSIM_SCRIPT): $(SPD) $(MEM_INIT_DESCRIPTOR_FILE) -ifeq ($(SPD),) - $(error No SPD file specified. Ensure QUARTUS_PROJECT_DIR variable is set) -endif - @$(MKDIR) $(SIM_SCRIPT_DIR) - $(IP_MAKE_SIMSCRIPT) --spd=$(SPD) --spd=$(MEM_INIT_DESCRIPTOR_FILE) --output-directory=$(SIM_SCRIPT_DIR) - -VSIM_COMMAND = \ - cd $(dir $(MSIM_SCRIPT)) && \ - $(VSIM) -do "do $(notdir $(MSIM_SCRIPT)); ld; $(if $(VSIM_RUN_TIME),run ${VSIM_RUN_TIME};quit;)" - -.PHONY: sim -sim: $(MSIM_SCRIPT) mem_init_generate -ifeq ($(MSIM_SCRIPT),) - $(error MSIM_SCRIPT not set) -endif - $(VSIM_COMMAND) - -endif # QSYS == 1 - - -#------------------------------------------------------------------------------ -# ELF TARGET RULE -#------------------------------------------------------------------------------ -# Rule for constructing the executable elf file. -$(ELF) : $(APP_OBJS) $(LINKER_SCRIPT) $(APP_LDDEPS) - @$(ECHO) Info: Linking $@ - $(LD) $(APP_LDFLAGS) $(APP_CFLAGS) -o $@ $(filter-out $(CRT0),$(APP_OBJS)) $(APP_LIBS) $(APP_BSP_DEP_LIBS) -ifneq ($(DISABLE_ELFPATCH),1) - $(ELFPATCH) $@ $(ELF_PATCH_FLAG) -endif -ifneq ($(DISABLE_STACKREPORT),1) - @bash -c "$(STACKREPORT) $@" -endif - -$(OBJDUMP_NAME) : $(ELF) - @$(ECHO) Info: Creating $@ - $(OBJDUMP) $(OBJDUMP_FLAGS) $< >$@ - -# Rule for printing the name of the elf file -.PHONY: print-elf-name -print-elf-name: - @$(ECHO) $(ELF) - - diff --git a/software/qsys_tutorial_hexs/create-this-app b/software/qsys_tutorial_hexs/create-this-app deleted file mode 100644 index 1db3b9e..0000000 --- a/software/qsys_tutorial_hexs/create-this-app +++ /dev/null @@ -1,114 +0,0 @@ -#!/bin/bash -# -# This script creates the hello_world_small application in this directory. - - -BSP_DIR=../qsys_tutorial_hexs_bsp -QUARTUS_PROJECT_DIR=../../ -NIOS2_APP_GEN_ARGS="--elf-name qsys_tutorial_hexs.elf --set APP_CFLAGS_OPTIMIZATION -Os --set OBJDUMP_INCLUDE_SOURCE 1 --src-files hello_world_small.c" - - -# First, check to see if $SOPC_KIT_NIOS2 environmental variable is set. -# This variable is required for the command line tools to execute correctly. -if [ -z "${SOPC_KIT_NIOS2}" ] -then - echo Required \$SOPC_KIT_NIOS2 Environmental Variable is not set! - exit 1 -fi - - -# Also make sure that the APP has not been created already. Check for -# existence of Makefile in the app directory -if [ -f ./Makefile ] -then - echo Application has already been created! Delete Makefile if you want to create a new application makefile - exit 1 -fi - - -# We are selecting hal_reduced_footprint bsp because it supports this application. -# Check to see if the hal_reduced_footprint has already been generated by checking for -# existence of the public.mk file. If not, we need to run -# create-this-bsp file to generate the bsp. -if [ ! -f ${BSP_DIR}/public.mk ]; then - # Since BSP doesn't exist, create the BSP - # Pass any command line arguments passed to this script to the BSP. - pushd ${BSP_DIR} >> /dev/null - ./create-this-bsp "$@" || { - echo "create-this-bsp failed" - exit 1 - } - popd >> /dev/null -fi - - -# Don't run make if create-this-app script is called with --no-make arg -SKIP_MAKE= -while [ $# -gt 0 ] -do - case "$1" in - --no-make) - SKIP_MAKE=1 - ;; - esac - shift -done - - -# Now we also need to go copy the sources for this application to the -# local directory. -find "${SOPC_KIT_NIOS2}/examples/software/hello_world_small/" -name '*.c' -or -name '*.h' -or -name 'hostfs*' | xargs -i cp -L {} ./ || { - echo "failed during copying example source files" - exit 1 -} - -find "${SOPC_KIT_NIOS2}/examples/software/hello_world_small/" -name 'readme.txt' -or -name 'Readme.txt' | xargs -i cp -L {} ./ || { - echo "failed copying readme file" -} - -if [ -d "${SOPC_KIT_NIOS2}/examples/software/hello_world_small/system" ] -then - cp -RL "${SOPC_KIT_NIOS2}/examples/software/hello_world_small/system" . || { - echo "failed during copying project support files" - exit 1 - } -fi - -chmod -R +w . || { - echo "failed during changing file permissions" - exit 1 -} - -cmd="nios2-app-generate-makefile --bsp-dir ${BSP_DIR} --set QUARTUS_PROJECT_DIR=${QUARTUS_PROJECT_DIR} ${NIOS2_APP_GEN_ARGS}" - -echo "create-this-app: Running \"${cmd}\"" -$cmd || { - echo "nios2-app-generate-makefile failed" - exit 1 -} - -if [ -z "$SKIP_MAKE" ]; then - cmd="make" - - echo "create-this-app: Running \"$cmd\"" - $cmd || { - echo "make failed" - exit 1 - } - - echo - echo "To download and run the application:" - echo " 1. Make sure the board is connected to the system." - echo " 2. Run 'nios2-configure-sof ' to configure the FPGA with the hardware design." - echo " 3. If you have a stdio device, run 'nios2-terminal' in a different shell." - echo " 4. Run 'make download-elf' from the application directory." - echo - echo "To debug the application:" - echo " Import the project into Nios II Software Build Tools for Eclipse." - echo " Refer to Nios II Software Build Tools for Eclipse Documentation for more information." - echo - echo -e "" -fi - - -exit 0 diff --git a/software/qsys_tutorial_hexs/hello_world_small.c b/software/qsys_tutorial_hexs/hello_world_small.c deleted file mode 100644 index b1be61a..0000000 --- a/software/qsys_tutorial_hexs/hello_world_small.c +++ /dev/null @@ -1,34 +0,0 @@ -#include "sys/alt_stdio.h" -#include "system.h" -#include "hex_out.h" -#include "sys_register.h" -#include "sys_memory.h" -#include "input_int.h" - -#define ledrs (volatile int *) 0x00020a0 -#define push_switches (volatile char *) 0x0002080 - - -void init() { - registers_init(); - memory_init(); - clear_block(HEX0_3); clear_block(HEX4_5); clear_block(HEX6_7); - print_block("he", 2, HEX6_7); - print_block("lo", 2, HEX4_5); - print_block("you1", 4, HEX0_3); -} - -int main() -{ - init(); - while(1) { - // interrupt - in_int(); - - // event - if (PUSH_EVENT) { - // - } - } - return 0; -} diff --git a/software/qsys_tutorial_hexs/hex_encoder.c b/software/qsys_tutorial_hexs/hex_encoder.c deleted file mode 100644 index ab4eca0..0000000 --- a/software/qsys_tutorial_hexs/hex_encoder.c +++ /dev/null @@ -1,205 +0,0 @@ -/* - * hex_encoder.c - * - * Created on: 2016/11/17 - * Author: takayun - */ - -#include "hex_encoder.h" -#include - -void encodeNumHex(int hex_i, int num) { - char encoded = 0; - switch (num) { - case 0: - encoded = (char)0x40; // 100 0000 - break; - case 1: - encoded = (char)0xF9; // 111 1001 - break; - case 2: - encoded = (char)0x24; // 010 0100 - break; - case 3: - encoded = (char)0x30; // 011 0000 - break; - case 4: - encoded = (char)0x19; // 001 1001 - break; - case 5: - encoded = (char)0x12; // 001 0010 - break; - case 6: - encoded = (char)0x02; // 000 0010 - break; - case 7: - encoded = (char)0x58; // 101 1000 - break; - case 8: - encoded = (char)0x00; // 000 0000 - break; - case 9: - encoded = (char)0x10; // 001 0000 - break; - default: - encoded = 0; - break; - } - - switch (hex_i) { - case 0: - *hex0 = encoded; - break; - case 1: - *hex1 = encoded; - break; - case 2: - *hex2 = encoded; - break; - case 3: - *hex3 = encoded; - break; - case 4: - *hex4 = encoded; - break; - case 5: - *hex5 = encoded; - break; - case 6: - *hex6 = encoded; - break; - case 7: - *hex7 = encoded; - break; - default: - break; - } -} - -void encodeLatHex(int hex_i, char c) { - char encoded = 0; - - if (isdigit(c)) { - encodeNumHex(hex_i, c-'0'); - return; - } - - switch (c) { - case ' ': - encoded = (char)0xFF; // 111 1111 - break; - case '-': - encoded = (char)0x3F; // 011 1111 - break; - case 'a': - encoded = (char)0x08; // 000 1000 - break; - case 'b': - encoded = (char)0x03; // 000 0011 - break; - case 'c': - encoded = (char)0x27; // 010 0111 - break; - case 'd': - encoded = (char)0x21; // 010 0001 - break; - case 'e': - encoded = (char)0x06; // 000 0110 - break; - case 'f': - encoded = (char)0x0E; // 000 1110 - break; - case 'g': - encoded = (char)0x42; // 100 0010 - break; - case 'h': - encoded = (char)0x0B; // 000 1011 - break; - case 'i': - encoded = (char)0xFB; // 111 1011 - break; - case 'j': - encoded = (char)0x61; // 110 0001 - break; - case 'k': - encoded = (char)0x0A; // 000 1010 - break; - case 'l': - encoded = (char)0x47; // 100 0111 - break; - case 'm': - encoded = (char)0x48; // 100 1000 - break; - case 'n': - encoded = (char)0x2B; // 010 1011 - break; - case 'o': - encoded = (char)0x23; // 010 0011 - break; - case 'p': - encoded = (char)0x0C; // 000 1100 - break; - case 'q': - encoded = (char)0x04; // 000 0100 - break; - case 'r': - encoded = (char)0x2F; // 010 1111 - break; - case 's': - encoded = (char)0x13; // 001 0011 - break; - case 't': - encoded = (char)0x07; // 000 0111 - break; - case 'u': - encoded = (char)0x63; // 110 0011 - break; - case 'v': - encoded = (char)0x41; // 100 0001 - break; - case 'w': - encoded = (char)0x01; // 000 0001 - break; - case 'x': - encoded = (char)0x09; // 000 1001 - break; - case 'y': - encoded = (char)0x11; // 001 0001 - break; - case 'z': - encoded = (char)0x64; // 110 0100 - break; - default: - encoded = 0; - break; - } - - switch (hex_i) { - case 0: - *hex0 = encoded; - break; - case 1: - *hex1 = encoded; - break; - case 2: - *hex2 = encoded; - break; - case 3: - *hex3 = encoded; - break; - case 4: - *hex4 = encoded; - break; - case 5: - *hex5 = encoded; - break; - case 6: - *hex6 = encoded; - break; - case 7: - *hex7 = encoded; - break; - default: - break; - } -} diff --git a/software/qsys_tutorial_hexs/hex_encoder.h b/software/qsys_tutorial_hexs/hex_encoder.h deleted file mode 100644 index e0fec25..0000000 --- a/software/qsys_tutorial_hexs/hex_encoder.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * hex_encoder.h - * - * Created on: 2016/11/17 - * Author: takayun - */ - -#ifndef HEX_ENCODER_H_ -#define HEX_ENCODER_H_ - -/************************************************** - * Defines - **************************************************/ - -#define hex0 (volatile char *) 0x0002070 -#define hex1 (volatile char *) 0x0002060 -#define hex2 (volatile char *) 0x0002050 -#define hex3 (volatile char *) 0x0002040 -#define hex4 (volatile char *) 0x0002030 -#define hex5 (volatile char *) 0x0002020 -#define hex6 (volatile char *) 0x0002010 -#define hex7 (volatile char *) 0x0002000 - -/************************************************** - * Variables - **************************************************/ - - -/************************************************** - * Functions - **************************************************/ - -void encodeNumHex(int hex_i, int num); -void encodeLatHex(int hex_i, char c); - -#endif /* HEX_ENCODER_H_ */ diff --git a/software/qsys_tutorial_hexs/hex_out.c b/software/qsys_tutorial_hexs/hex_out.c deleted file mode 100644 index 83b37d0..0000000 --- a/software/qsys_tutorial_hexs/hex_out.c +++ /dev/null @@ -1,67 +0,0 @@ -/* - * hex_out.c - * - * Created on: 2016/11/24 - * Author: takayun - */ -#include "hex_out.h" -#include "hex_encoder.h" -#include "system.h" - -void print_block(char * str, unsigned int size, enum BLOCK_N block_i) { - int i; - if (block_i == HEX0_3) { - if (size > 4) panic(); - for (i = 0; i < size; i++) { - encodeLatHex(i,str[size-1-i]); - } - } - else if (block_i == HEX4_5) { - if (size > 2) panic(); - for (i = 0; i < size; i++) { - encodeLatHex(i+4,str[size-1-i]); - } - } - else if (block_i == HEX6_7) { - if (size > 2) panic(); - for (i = 0; i < size; i++) { - encodeLatHex(i+6,str[size-1-i]); - } - } -} - -void clear_block(enum BLOCK_N block_i) { - if (block_i == HEX0_3) { - print_block(" ", 4, HEX0_3); - } - else if (block_i == HEX4_5) { - print_block(" ", 2, HEX4_5); - } - else if (block_i == HEX6_7) { - print_block(" ", 2, HEX6_7); - } -} - -void print_number(char num) { - int i; - char buf[5]; - char val; - for (i = 0; i < 4; i++) { - if (num < 0) { - buf[0] = '-'; - val = -num; - } else { - buf[0] = ' '; - val = num; - } - buf[1] = val/100%10 + '0'; - buf[2] = val/10%10 + '0'; - buf[3] = val%10 + '0'; - } - clear_block(HEX0_3); - print_block(buf, 4, HEX0_3); -} - - - - diff --git a/software/qsys_tutorial_hexs/hex_out.h b/software/qsys_tutorial_hexs/hex_out.h deleted file mode 100644 index 50d6868..0000000 --- a/software/qsys_tutorial_hexs/hex_out.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * hex_out.h - * - * Created on: 2016/11/24 - * Author: takayun - */ - -#ifndef HEX_IO_H_ -#define HEX_IO_H_ - -/************************************************** - * Defines - **************************************************/ - -enum BLOCK_N { - HEX0_3, HEX4_5, HEX6_7 -}; - -/************************************************** - * Variables - **************************************************/ - - -/************************************************** - * Functions - **************************************************/ - -void print_block(char * str, unsigned int size, enum BLOCK_N block_i); -void clear_block(enum BLOCK_N block_i); -void print_number(char num); - - -#endif /* HEX_IO_H_ */ diff --git a/software/qsys_tutorial_hexs/input_int.c b/software/qsys_tutorial_hexs/input_int.c deleted file mode 100644 index baa6940..0000000 --- a/software/qsys_tutorial_hexs/input_int.c +++ /dev/null @@ -1,54 +0,0 @@ -/* - * input_int.c - * - * Created on: 2016/11/24 - * Author: takayun - */ -#include "hex_out.h" -#include - -#include "input_int.h" -#include "sys_register.h" - -unsigned char PUSH_EVENT = 0; - -void in_int() { - push_int(); -} - -static void update_sw_reg(sw_t s) { - global_registers[Ssw_data]; - global_registers[Ssw_inst]; - global_registers[Ssw_memi]; - global_registers[Ssw_regi]; - global_registers[Ssw_psel]; - global_registers[Ssw_rw]; - global_registers[Ssw_run]; -} - -void push_int() { - char buf[12]; - static unsigned char status = 0; - sw_t s; - s.data = *switches; - - switch (status) { - case 0: - PUSH_EVENT = 0; - if (*push_switches != 7) status = 1; - //update_sw_reg(s); // �X�C�b�`���W�X�^�X�V - sprintf(buf, "%x", s.sw.instruction_code); - print_block(buf, 4, HEX0_3); - break; - case 1: - if (*push_switches == 7) status = 2; - break; - case 2: - PUSH_EVENT = 1; - status = 0; - break; - default: - status = 0; - break; - } -} diff --git a/software/qsys_tutorial_hexs/input_int.h b/software/qsys_tutorial_hexs/input_int.h deleted file mode 100644 index 1e1e90d..0000000 --- a/software/qsys_tutorial_hexs/input_int.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * input_int.h - * - * Created on: 2016/11/24 - * Author: takayun - */ - -#ifndef SWITCHES_INT_H_ -#define SWITCHES_INT_H_ - -/************************************************** - * Defines - **************************************************/ - -#define switches (volatile int *) 0x0002090 -#define push_switches (volatile char *) 0x0002080 - -struct sw_block{ - unsigned char run_mode : 1; - unsigned char rw_mode : 1; - unsigned char program_selecter : 4; - unsigned char register_index : 4; - unsigned char memory_index : 4; - unsigned char instruction_code : 4; -}; - -typedef union { - int data; - struct sw_block sw; -} sw_t; - -/************************************************** - * Variables - **************************************************/ - -extern unsigned char PUSH_EVENT; - -/************************************************** - * Functions - **************************************************/ - -/* Function: in_int - * Sammary: - * �S�Ă̓��͊��荞�݂��s�� - * */ -void in_int(); - -void push_int(); - -#endif /* SWITCHES_INT_H_ */ diff --git a/software/qsys_tutorial_hexs/obj/default/.force_relink b/software/qsys_tutorial_hexs/obj/default/.force_relink deleted file mode 100644 index e69de29..0000000 --- a/software/qsys_tutorial_hexs/obj/default/.force_relink +++ /dev/null diff --git a/software/qsys_tutorial_hexs/obj/default/hello_world_small.d b/software/qsys_tutorial_hexs/obj/default/hello_world_small.d deleted file mode 100644 index b7d8544..0000000 --- a/software/qsys_tutorial_hexs/obj/default/hello_world_small.d +++ /dev/null @@ -1,15 +0,0 @@ -obj/default/hello_world_small.o: hello_world_small.c \ - ../qsys_tutorial_hexs_bsp//HAL/inc/sys/alt_stdio.h system.h hex_out.h \ - sys_register.h sys_memory.h input_int.h - -../qsys_tutorial_hexs_bsp//HAL/inc/sys/alt_stdio.h: - -system.h: - -hex_out.h: - -sys_register.h: - -sys_memory.h: - -input_int.h: diff --git a/software/qsys_tutorial_hexs/obj/default/hello_world_small.o b/software/qsys_tutorial_hexs/obj/default/hello_world_small.o deleted file mode 100644 index 6e67495..0000000 --- a/software/qsys_tutorial_hexs/obj/default/hello_world_small.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs/obj/default/hex_encoder.d b/software/qsys_tutorial_hexs/obj/default/hex_encoder.d deleted file mode 100644 index e913210..0000000 --- a/software/qsys_tutorial_hexs/obj/default/hex_encoder.d +++ /dev/null @@ -1,3 +0,0 @@ -obj/default/hex_encoder.o: hex_encoder.c hex_encoder.h - -hex_encoder.h: diff --git a/software/qsys_tutorial_hexs/obj/default/hex_encoder.o b/software/qsys_tutorial_hexs/obj/default/hex_encoder.o deleted file mode 100644 index 87f95c4..0000000 --- a/software/qsys_tutorial_hexs/obj/default/hex_encoder.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs/obj/default/hex_io.d b/software/qsys_tutorial_hexs/obj/default/hex_io.d deleted file mode 100644 index 4e66eff..0000000 --- a/software/qsys_tutorial_hexs/obj/default/hex_io.d +++ /dev/null @@ -1,7 +0,0 @@ -obj/default/hex_io.o: hex_io.c hex_io.h hex_encoder.h system.h - -hex_io.h: - -hex_encoder.h: - -system.h: diff --git a/software/qsys_tutorial_hexs/obj/default/hex_io.o b/software/qsys_tutorial_hexs/obj/default/hex_io.o deleted file mode 100644 index 7729e22..0000000 --- a/software/qsys_tutorial_hexs/obj/default/hex_io.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs/obj/default/hex_out.d b/software/qsys_tutorial_hexs/obj/default/hex_out.d deleted file mode 100644 index 1000db0..0000000 --- a/software/qsys_tutorial_hexs/obj/default/hex_out.d +++ /dev/null @@ -1,7 +0,0 @@ -obj/default/hex_out.o: hex_out.c hex_out.h hex_encoder.h system.h - -hex_out.h: - -hex_encoder.h: - -system.h: diff --git a/software/qsys_tutorial_hexs/obj/default/hex_out.o b/software/qsys_tutorial_hexs/obj/default/hex_out.o deleted file mode 100644 index 3bcbabd..0000000 --- a/software/qsys_tutorial_hexs/obj/default/hex_out.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs/obj/default/input_int.d b/software/qsys_tutorial_hexs/obj/default/input_int.d deleted file mode 100644 index 8872757..0000000 --- a/software/qsys_tutorial_hexs/obj/default/input_int.d +++ /dev/null @@ -1,7 +0,0 @@ -obj/default/input_int.o: input_int.c hex_out.h input_int.h sys_register.h - -hex_out.h: - -input_int.h: - -sys_register.h: diff --git a/software/qsys_tutorial_hexs/obj/default/input_int.o b/software/qsys_tutorial_hexs/obj/default/input_int.o deleted file mode 100644 index 5acfc8f..0000000 --- a/software/qsys_tutorial_hexs/obj/default/input_int.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs/obj/default/sys_memory.d b/software/qsys_tutorial_hexs/obj/default/sys_memory.d deleted file mode 100644 index 8d2a4cf..0000000 --- a/software/qsys_tutorial_hexs/obj/default/sys_memory.d +++ /dev/null @@ -1,8 +0,0 @@ -obj/default/sys_memory.o: sys_memory.c system.h sys_memory.h \ - sys_register.h - -system.h: - -sys_memory.h: - -sys_register.h: diff --git a/software/qsys_tutorial_hexs/obj/default/sys_memory.o b/software/qsys_tutorial_hexs/obj/default/sys_memory.o deleted file mode 100644 index 85984ba..0000000 --- a/software/qsys_tutorial_hexs/obj/default/sys_memory.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs/obj/default/sys_register.d b/software/qsys_tutorial_hexs/obj/default/sys_register.d deleted file mode 100644 index ec29589..0000000 --- a/software/qsys_tutorial_hexs/obj/default/sys_register.d +++ /dev/null @@ -1,3 +0,0 @@ -obj/default/sys_register.o: sys_register.c sys_register.h - -sys_register.h: diff --git a/software/qsys_tutorial_hexs/obj/default/sys_register.o b/software/qsys_tutorial_hexs/obj/default/sys_register.o deleted file mode 100644 index 65dfcac..0000000 --- a/software/qsys_tutorial_hexs/obj/default/sys_register.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs/obj/default/system.d b/software/qsys_tutorial_hexs/obj/default/system.d deleted file mode 100644 index 6c906ae..0000000 --- a/software/qsys_tutorial_hexs/obj/default/system.d +++ /dev/null @@ -1,5 +0,0 @@ -obj/default/system.o: system.c system.h hex_out.h - -system.h: - -hex_out.h: diff --git a/software/qsys_tutorial_hexs/obj/default/system.o b/software/qsys_tutorial_hexs/obj/default/system.o deleted file mode 100644 index 8f78a19..0000000 --- a/software/qsys_tutorial_hexs/obj/default/system.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs/qsys_tutorial_hexs.map b/software/qsys_tutorial_hexs/qsys_tutorial_hexs.map deleted file mode 100644 index 3a3301f..0000000 --- a/software/qsys_tutorial_hexs/qsys_tutorial_hexs.map +++ /dev/null @@ -1,714 +0,0 @@ -Archive member included because of file (symbol) - -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-divmod.o) - obj/default/hex_out.o (__divsi3) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-ctype_.o) - obj/default/hex_encoder.o (__ctype_ptr) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-sprintf.o) - obj/default/input_int.o (sprintf) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-vfprintf.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-sprintf.o) (___vfprintf_internal_r) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-fvwrite_small_str.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-sprintf.o) (__sfvwrite_small_str) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-impure.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-sprintf.o) (_impure_ptr) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-memmove.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-fvwrite_small_str.o) (memmove) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-strlen.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-vfprintf.o) (strlen) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-mul.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-vfprintf.o) (__mulsi3) -../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_load.o) - ../qsys_tutorial_hexs_bsp//obj/HAL/src/crt0.o (alt_load) -../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_main.o) - ../qsys_tutorial_hexs_bsp//obj/HAL/src/crt0.o (alt_main) -../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_sys_init.o) - ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_main.o) (alt_sys_init) -../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_load.o) (alt_dcache_flush_all) -../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_load.o) (alt_icache_flush_all) -../qsys_tutorial_hexs_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_sys_init.o) (altera_nios2_qsys_irq_init) - -Allocating common symbols -Common symbol size file - -global_registers 0xd obj/default/sys_register.o - -Memory Configuration - -Name Origin Length Attributes -reset 0x00000000 0x00000020 -onchip_memory 0x00000020 0x00000fe0 -*default* 0x00000000 0xffffffff - -Linker script and memory map - -LOAD ../qsys_tutorial_hexs_bsp//obj/HAL/src/crt0.o - 0x0000000c exit = _exit -LOAD obj/default/hello_world_small.o -LOAD obj/default/hex_encoder.o -LOAD obj/default/hex_out.o -LOAD obj/default/input_int.o -LOAD obj/default/sys_memory.o -LOAD obj/default/sys_register.o -LOAD obj/default/system.o -LOAD c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libstdc++.a -LOAD c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libm.a -LOAD c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a -START GROUP -LOAD c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a -LOAD c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a -LOAD ../qsys_tutorial_hexs_bsp/\libhal_bsp.a -END GROUP -LOAD c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a - 0x00000000 __alt_mem_onchip_memory = 0x0 - -.entry 0x00000000 0x20 - *(.entry) - .entry 0x00000000 0x20 ../qsys_tutorial_hexs_bsp//obj/HAL/src/crt0.o - 0x00000000 __reset - 0x0000000c _exit - -.exceptions 0x00000020 0x0 - 0x00000020 PROVIDE (__ram_exceptions_start, ABSOLUTE (.)) - 0x00000020 . = ALIGN (0x20) - *(.irq) - *(.exceptions.entry.label) - *(.exceptions.entry.user) - *(.exceptions.entry) - *(.exceptions.irqtest.user) - *(.exceptions.irqtest) - *(.exceptions.irqhandler.user) - *(.exceptions.irqhandler) - *(.exceptions.irqreturn.user) - *(.exceptions.irqreturn) - *(.exceptions.notirq.label) - *(.exceptions.notirq.user) - *(.exceptions.notirq) - *(.exceptions.soft.user) - *(.exceptions.soft) - *(.exceptions.unknown.user) - *(.exceptions.unknown) - *(.exceptions.exit.label) - *(.exceptions.exit.user) - *(.exceptions.exit) - *(.exceptions) - 0x00000020 PROVIDE (__ram_exceptions_end, ABSOLUTE (.)) - 0x00000020 PROVIDE (__flash_exceptions_start, LOADADDR (.exceptions)) - -.text 0x00000020 0x14c8 - 0x00000020 PROVIDE (stext, ABSOLUTE (.)) - *(.interp) - *(.hash) - *(.dynsym) - *(.dynstr) - *(.gnu.version) - *(.gnu.version_d) - *(.gnu.version_r) - *(.rel.init) - *(.rela.init) - *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) - *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) - *(.rel.fini) - *(.rela.fini) - *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) - *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) - *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) - *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) - *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) - *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) - *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) - *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) - *(.rel.ctors) - *(.rela.ctors) - *(.rel.dtors) - *(.rela.dtors) - *(.rel.got) - *(.rela.got) - *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) - *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) - *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) - *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) - *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) - *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) - *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) - *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) - *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) - *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) - *(.rel.plt) - *(.rela.plt) - *(.rel.dyn) - *(.init) - *(.plt) - *(.text .stub .text.* .gnu.linkonce.t.*) - .text 0x00000020 0x3c ../qsys_tutorial_hexs_bsp//obj/HAL/src/crt0.o - 0x00000020 _start - .text 0x0000005c 0x98 obj/default/hello_world_small.o - 0x0000005c init - 0x000000e0 main - .text 0x000000f4 0x3b8 obj/default/hex_encoder.o - 0x000000f4 encodeNumHex - 0x00000218 encodeLatHex - .text 0x000004ac 0x228 obj/default/hex_out.o - 0x000004ac print_block - 0x00000588 clear_block - 0x000005d8 print_number - .text 0x000006d4 0xcc obj/default/input_int.o - 0x000006d4 push_int - 0x0000079c in_int - .text 0x000007a0 0x124 obj/default/sys_memory.o - 0x000007a0 memory_init - 0x000007e4 memory_load - 0x00000854 memory_store - .text 0x000008c4 0x1c obj/default/sys_register.o - 0x000008c4 registers_init - .text 0x000008e0 0x2c obj/default/system.o - 0x000008e0 panic - .text 0x0000090c 0x14c c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-divmod.o) - 0x00000988 __divsi3 - 0x000009e8 __modsi3 - 0x00000a48 __udivsi3 - 0x00000a50 __umodsi3 - .text 0x00000a58 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-ctype_.o) - .text 0x00000a58 0xf4 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-sprintf.o) - 0x00000a58 sprintf - 0x00000adc _sprintf_r - .text 0x00000b4c 0x740 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-vfprintf.o) - 0x00000bcc ___vfprintf_internal_r - 0x00001268 __vfprintf_internal - .text 0x0000128c 0xb8 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-fvwrite_small_str.o) - 0x0000128c __sfvwrite_small_str - .text 0x00001344 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-impure.o) - .text 0x00001344 0x60 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-memmove.o) - 0x00001344 memmove - .text 0x000013a4 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-strlen.o) - 0x000013a4 strlen - .text 0x000013c4 0x38 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-mul.o) - 0x000013c4 __mulsi3 - .text 0x000013fc 0x8c ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_load.o) - 0x0000141c alt_load - .text 0x00001488 0x2c ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_main.o) - 0x00001488 alt_main - .text 0x000014b4 0x24 ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_sys_init.o) - 0x000014b4 alt_sys_init - 0x000014b8 alt_irq_init - .text 0x000014d8 0x4 ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - 0x000014d8 alt_dcache_flush_all - .text 0x000014dc 0x4 ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - 0x000014dc alt_icache_flush_all - .text 0x000014e0 0x8 ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - 0x000014e0 altera_nios2_qsys_irq_init - *(.gnu.warning.*) - *(.fini) - 0x000014e8 PROVIDE (__etext, ABSOLUTE (.)) - 0x000014e8 PROVIDE (_etext, ABSOLUTE (.)) - 0x000014e8 PROVIDE (etext, ABSOLUTE (.)) - *(.eh_frame_hdr) - 0x000014e8 . = ALIGN (0x4) - 0x000014e8 PROVIDE (__preinit_array_start, ABSOLUTE (.)) - *(.preinit_array) - 0x000014e8 PROVIDE (__preinit_array_end, ABSOLUTE (.)) - 0x000014e8 PROVIDE (__init_array_start, ABSOLUTE (.)) - *(.init_array) - 0x000014e8 PROVIDE (__init_array_end, ABSOLUTE (.)) - 0x000014e8 PROVIDE (__fini_array_start, ABSOLUTE (.)) - *(.fini_array) - 0x000014e8 PROVIDE (__fini_array_end, ABSOLUTE (.)) - *(.eh_frame) - *(.gcc_except_table) - *(.dynamic) - 0x000014e8 PROVIDE (__CTOR_LIST__, ABSOLUTE (.)) - *(.ctors) - *(SORT(.ctors.*)) - 0x000014e8 PROVIDE (__CTOR_END__, ABSOLUTE (.)) - 0x000014e8 PROVIDE (__DTOR_LIST__, ABSOLUTE (.)) - *(.dtors) - *(SORT(.dtors.*)) - 0x000014e8 PROVIDE (__DTOR_END__, ABSOLUTE (.)) - *(.jcr) - 0x000014e8 . = ALIGN (0x4) - -.rodata 0x000014e8 0x2ac - 0x000014e8 PROVIDE (__ram_rodata_start, ABSOLUTE (.)) - 0x000014e8 . = ALIGN (0x4) - *(.rodata .rodata.* .gnu.linkonce.r.*) - .rodata.str1.4 - 0x000014e8 0xd obj/default/hello_world_small.o - 0x10 (size before relaxing) - *fill* 0x000014f5 0x3 00 - .rodata.str1.4 - 0x000014f8 0xb obj/default/hex_out.o - 0xc (size before relaxing) - *fill* 0x00001503 0x1 00 - .rodata.str1.4 - 0x00001504 0x3 obj/default/input_int.o - 0x4 (size before relaxing) - *fill* 0x00001507 0x1 00 - .rodata.str1.4 - 0x00001508 0x8 obj/default/system.o - .rodata 0x00001510 0x281 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-ctype_.o) - 0x00001510 _ctype_ - *(.rodata1) - 0x00001794 . = ALIGN (0x4) - *fill* 0x00001791 0x3 00 - 0x00001794 PROVIDE (__ram_rodata_end, ABSOLUTE (.)) - 0x000014e8 PROVIDE (__flash_rodata_start, LOADADDR (.rodata)) - -.rwdata 0x00001794 0xf0 load address 0x00001884 - 0x00001794 PROVIDE (__ram_rwdata_start, ABSOLUTE (.)) - 0x00001794 . = ALIGN (0x4) - *(.got.plt) - *(.got) - *(.data1) - *(.data .data.* .gnu.linkonce.d.*) - .data 0x00001794 0x0 ../qsys_tutorial_hexs_bsp//obj/HAL/src/crt0.o - .data 0x00001794 0x0 obj/default/hello_world_small.o - .data 0x00001794 0x0 obj/default/hex_encoder.o - .data 0x00001794 0x0 obj/default/hex_out.o - .data 0x00001794 0x0 obj/default/input_int.o - .data 0x00001794 0x0 obj/default/sys_memory.o - .data 0x00001794 0x0 obj/default/sys_register.o - .data 0x00001794 0x0 obj/default/system.o - .data 0x00001794 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-divmod.o) - .data 0x00001794 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-ctype_.o) - .data 0x00001794 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-sprintf.o) - .data 0x00001794 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-vfprintf.o) - .data 0x00001794 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-fvwrite_small_str.o) - .data 0x00001794 0xe0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-impure.o) - .data 0x00001874 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-memmove.o) - .data 0x00001874 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-strlen.o) - .data 0x00001874 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-mul.o) - .data 0x00001874 0x0 ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_load.o) - .data 0x00001874 0x0 ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_main.o) - .data 0x00001874 0x0 ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_sys_init.o) - .data 0x00001874 0x0 ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .data 0x00001874 0x0 ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .data 0x00001874 0x0 ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - 0x00009874 _gp = ABSOLUTE ((. + 0x8000)) - 0x00009874 PROVIDE (gp, _gp) - *(.rwdata .rwdata.*) - *(.sdata .sdata.* .gnu.linkonce.s.*) - .sdata 0x00001874 0x4 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-ctype_.o) - 0x00001874 __ctype_ptr - .sdata 0x00001878 0x8 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-impure.o) - 0x00001878 _impure_ptr - 0x0000187c _global_impure_ptr - .sdata 0x00001880 0x4 ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_sys_init.o) - 0x00001880 jtag_uart - *(.sdata2 .sdata2.* .gnu.linkonce.s2.*) - 0x00001884 . = ALIGN (0x4) - 0x00001884 _edata = ABSOLUTE (.) - 0x00001884 PROVIDE (edata, ABSOLUTE (.)) - 0x00001884 PROVIDE (__ram_rwdata_end, ABSOLUTE (.)) - 0x00001884 PROVIDE (__flash_rwdata_start, LOADADDR (.rwdata)) - -.bss 0x00001974 0x64 - 0x00001974 __bss_start = ABSOLUTE (.) - 0x00001974 PROVIDE (__sbss_start, ABSOLUTE (.)) - 0x00001974 PROVIDE (___sbss_start, ABSOLUTE (.)) - *(.dynsbss) - *(.sbss .sbss.* .gnu.linkonce.sb.*) - .sbss 0x00001974 0x2 obj/default/input_int.o - 0x00001974 PUSH_EVENT - *fill* 0x00001976 0x2 00 - .sbss 0x00001978 0x4 obj/default/sys_memory.o - 0x00001978 global_current_memory - .sbss 0x0000197c 0xc ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_main.o) - 0x0000197c alt_argc - 0x00001980 alt_argv - 0x00001984 alt_envp - *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) - *(.scommon) - 0x00001988 PROVIDE (__sbss_end, ABSOLUTE (.)) - 0x00001988 PROVIDE (___sbss_end, ABSOLUTE (.)) - *(.dynbss) - *(.bss .bss.* .gnu.linkonce.b.*) - .bss 0x00001988 0x0 ../qsys_tutorial_hexs_bsp//obj/HAL/src/crt0.o - .bss 0x00001988 0x0 obj/default/hello_world_small.o - .bss 0x00001988 0x0 obj/default/hex_encoder.o - .bss 0x00001988 0x0 obj/default/hex_out.o - .bss 0x00001988 0x0 obj/default/input_int.o - .bss 0x00001988 0x40 obj/default/sys_memory.o - .bss 0x000019c8 0x0 obj/default/sys_register.o - .bss 0x000019c8 0x0 obj/default/system.o - .bss 0x000019c8 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-divmod.o) - .bss 0x000019c8 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-ctype_.o) - .bss 0x000019c8 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-sprintf.o) - .bss 0x000019c8 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-vfprintf.o) - .bss 0x000019c8 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-fvwrite_small_str.o) - .bss 0x000019c8 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-impure.o) - .bss 0x000019c8 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-memmove.o) - .bss 0x000019c8 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-strlen.o) - .bss 0x000019c8 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-mul.o) - .bss 0x000019c8 0x0 ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_load.o) - .bss 0x000019c8 0x0 ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_main.o) - .bss 0x000019c8 0x0 ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_sys_init.o) - .bss 0x000019c8 0x0 ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .bss 0x000019c8 0x0 ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .bss 0x000019c8 0x0 ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - *(COMMON) - COMMON 0x000019c8 0xd obj/default/sys_register.o - 0x000019c8 global_registers - 0x000019d8 . = ALIGN (0x4) - *fill* 0x000019d5 0x3 00 - 0x000019d8 __bss_end = ABSOLUTE (.) - -.onchip_memory 0x000019d8 0x0 - 0x000019d8 PROVIDE (_alt_partition_onchip_memory_start, ABSOLUTE (.)) - *(.onchip_memory. onchip_memory.*) - 0x000019d8 . = ALIGN (0x4) - 0x000019d8 PROVIDE (_alt_partition_onchip_memory_end, ABSOLUTE (.)) - 0x000019d8 _end = ABSOLUTE (.) - 0x000019d8 end = ABSOLUTE (.) - 0x000019d8 __alt_stack_base = ABSOLUTE (.) - 0x000019d8 PROVIDE (_alt_partition_onchip_memory_load_addr, LOADADDR (.onchip_memory)) - -.stab - *(.stab) - -.stabstr - *(.stabstr) - -.stab.excl - *(.stab.excl) - -.stab.exclstr - *(.stab.exclstr) - -.stab.index - *(.stab.index) - -.stab.indexstr - *(.stab.indexstr) - -.comment 0x00000000 0x26 - *(.comment) - .comment 0x00000000 0x26 obj/default/hello_world_small.o - 0x27 (size before relaxing) - .comment 0x00000000 0x27 obj/default/hex_encoder.o - .comment 0x00000000 0x27 obj/default/hex_out.o - .comment 0x00000000 0x27 obj/default/input_int.o - .comment 0x00000000 0x27 obj/default/sys_memory.o - .comment 0x00000000 0x27 obj/default/sys_register.o - .comment 0x00000000 0x27 obj/default/system.o - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-divmod.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-ctype_.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-sprintf.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-vfprintf.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-fvwrite_small_str.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-impure.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-memmove.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-strlen.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-mul.o) - .comment 0x00000000 0x27 ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_load.o) - .comment 0x00000000 0x27 ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_main.o) - .comment 0x00000000 0x27 ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_sys_init.o) - .comment 0x00000000 0x27 ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .comment 0x00000000 0x27 ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .comment 0x00000000 0x27 ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - -.debug - *(.debug) - -.line - *(.line) - -.debug_srcinfo - *(.debug_srcinfo) - -.debug_sfnames - *(.debug_sfnames) - -.debug_aranges 0x00000000 0x2a8 - *(.debug_aranges) - .debug_aranges - 0x00000000 0x28 ../qsys_tutorial_hexs_bsp//obj/HAL/src/crt0.o - .debug_aranges - 0x00000028 0x20 obj/default/hello_world_small.o - .debug_aranges - 0x00000048 0x20 obj/default/hex_encoder.o - .debug_aranges - 0x00000068 0x20 obj/default/hex_out.o - .debug_aranges - 0x00000088 0x20 obj/default/input_int.o - .debug_aranges - 0x000000a8 0x20 obj/default/sys_memory.o - .debug_aranges - 0x000000c8 0x20 obj/default/sys_register.o - .debug_aranges - 0x000000e8 0x20 obj/default/system.o - .debug_aranges - 0x00000108 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-divmod.o) - .debug_aranges - 0x00000128 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-sprintf.o) - .debug_aranges - 0x00000148 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-vfprintf.o) - .debug_aranges - 0x00000168 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-fvwrite_small_str.o) - .debug_aranges - 0x00000188 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-memmove.o) - .debug_aranges - 0x000001a8 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-strlen.o) - .debug_aranges - 0x000001c8 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-mul.o) - .debug_aranges - 0x000001e8 0x20 ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_load.o) - .debug_aranges - 0x00000208 0x20 ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_main.o) - .debug_aranges - 0x00000228 0x20 ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_sys_init.o) - .debug_aranges - 0x00000248 0x20 ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .debug_aranges - 0x00000268 0x20 ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .debug_aranges - 0x00000288 0x20 ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - -.debug_pubnames - 0x00000000 0x45b - *(.debug_pubnames) - .debug_pubnames - 0x00000000 0x24 obj/default/hello_world_small.o - .debug_pubnames - 0x00000024 0x34 obj/default/hex_encoder.o - .debug_pubnames - 0x00000058 0x43 obj/default/hex_out.o - .debug_pubnames - 0x0000009b 0x39 obj/default/input_int.o - .debug_pubnames - 0x000000d4 0x5d obj/default/sys_memory.o - .debug_pubnames - 0x00000131 0x3a obj/default/sys_register.o - .debug_pubnames - 0x0000016b 0x1c obj/default/system.o - .debug_pubnames - 0x00000187 0x48 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-divmod.o) - .debug_pubnames - 0x000001cf 0x2e c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-ctype_.o) - .debug_pubnames - 0x000001fd 0x2d c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-sprintf.o) - .debug_pubnames - 0x0000022a 0x45 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-vfprintf.o) - .debug_pubnames - 0x0000026f 0x2b c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-fvwrite_small_str.o) - .debug_pubnames - 0x0000029a 0x39 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-impure.o) - .debug_pubnames - 0x000002d3 0x1e c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-memmove.o) - .debug_pubnames - 0x000002f1 0x1d c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-strlen.o) - .debug_pubnames - 0x0000030e 0x1f c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-mul.o) - .debug_pubnames - 0x0000032d 0x1f ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_load.o) - .debug_pubnames - 0x0000034c 0x46 ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_main.o) - .debug_pubnames - 0x00000392 0x42 ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_sys_init.o) - .debug_pubnames - 0x000003d4 0x2b ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .debug_pubnames - 0x000003ff 0x2b ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .debug_pubnames - 0x0000042a 0x31 ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - -.debug_info 0x00000000 0x3122 - *(.debug_info .gnu.linkonce.wi.*) - .debug_info 0x00000000 0x82 ../qsys_tutorial_hexs_bsp//obj/HAL/src/crt0.o - .debug_info 0x00000082 0x6d obj/default/hello_world_small.o - .debug_info 0x000000ef 0xd2 obj/default/hex_encoder.o - .debug_info 0x000001c1 0x145 obj/default/hex_out.o - .debug_info 0x00000306 0x1ab obj/default/input_int.o - .debug_info 0x000004b1 0x19e obj/default/sys_memory.o - .debug_info 0x0000064f 0x7d obj/default/sys_register.o - .debug_info 0x000006cc 0x3a obj/default/system.o - .debug_info 0x00000706 0x21c c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-divmod.o) - .debug_info 0x00000922 0xa0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-ctype_.o) - .debug_info 0x000009c2 0x7e7 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-sprintf.o) - .debug_info 0x000011a9 0x9b6 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-vfprintf.o) - .debug_info 0x00001b5f 0x75f c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-fvwrite_small_str.o) - .debug_info 0x000022be 0x636 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-impure.o) - .debug_info 0x000028f4 0x102 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-memmove.o) - .debug_info 0x000029f6 0xc2 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-strlen.o) - .debug_info 0x00002ab8 0xf3 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-mul.o) - .debug_info 0x00002bab 0x12e ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_load.o) - .debug_info 0x00002cd9 0x125 ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_main.o) - .debug_info 0x00002dfe 0x17d ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_sys_init.o) - .debug_info 0x00002f7b 0x8d ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .debug_info 0x00003008 0x8d ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .debug_info 0x00003095 0x8d ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - -.debug_abbrev 0x00000000 0x10af - *(.debug_abbrev) - .debug_abbrev 0x00000000 0x12 ../qsys_tutorial_hexs_bsp//obj/HAL/src/crt0.o - .debug_abbrev 0x00000012 0x63 obj/default/hello_world_small.o - .debug_abbrev 0x00000075 0x9e obj/default/hex_encoder.o - .debug_abbrev 0x00000113 0xc7 obj/default/hex_out.o - .debug_abbrev 0x000001da 0xfc obj/default/input_int.o - .debug_abbrev 0x000002d6 0xe9 obj/default/sys_memory.o - .debug_abbrev 0x000003bf 0x6f obj/default/sys_register.o - .debug_abbrev 0x0000042e 0x27 obj/default/system.o - .debug_abbrev 0x00000455 0xe0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-divmod.o) - .debug_abbrev 0x00000535 0x61 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-ctype_.o) - .debug_abbrev 0x00000596 0x179 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-sprintf.o) - .debug_abbrev 0x0000070f 0x263 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-vfprintf.o) - .debug_abbrev 0x00000972 0x184 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-fvwrite_small_str.o) - .debug_abbrev 0x00000af6 0x13f c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-impure.o) - .debug_abbrev 0x00000c35 0xa8 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-memmove.o) - .debug_abbrev 0x00000cdd 0x7a c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-strlen.o) - .debug_abbrev 0x00000d57 0x7b c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-mul.o) - .debug_abbrev 0x00000dd2 0x97 ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_load.o) - .debug_abbrev 0x00000e69 0xa6 ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_main.o) - .debug_abbrev 0x00000f0f 0xe3 ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_sys_init.o) - .debug_abbrev 0x00000ff2 0x3f ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .debug_abbrev 0x00001031 0x3f ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .debug_abbrev 0x00001070 0x3f ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - -.debug_line 0x00000000 0x2f3e - *(.debug_line) - .debug_line 0x00000000 0x66 ../qsys_tutorial_hexs_bsp//obj/HAL/src/crt0.o - .debug_line 0x00000066 0x14d obj/default/hello_world_small.o - .debug_line 0x000001b3 0x2b7 obj/default/hex_encoder.o - .debug_line 0x0000046a 0x1f5 obj/default/hex_out.o - .debug_line 0x0000065f 0x288 obj/default/input_int.o - .debug_line 0x000008e7 0x10d obj/default/sys_memory.o - .debug_line 0x000009f4 0x87 obj/default/sys_register.o - .debug_line 0x00000a7b 0x94 obj/default/system.o - .debug_line 0x00000b0f 0x24f c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-divmod.o) - .debug_line 0x00000d5e 0x81 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-ctype_.o) - .debug_line 0x00000ddf 0x365 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-sprintf.o) - .debug_line 0x00001144 0x666 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-vfprintf.o) - .debug_line 0x000017aa 0x2cf c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-fvwrite_small_str.o) - .debug_line 0x00001a79 0x230 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-impure.o) - .debug_line 0x00001ca9 0x294 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-memmove.o) - .debug_line 0x00001f3d 0x250 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-strlen.o) - .debug_line 0x0000218d 0x11a c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-mul.o) - .debug_line 0x000022a7 0x217 ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_load.o) - .debug_line 0x000024be 0x2c2 ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_main.o) - .debug_line 0x00002780 0x286 ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_sys_init.o) - .debug_line 0x00002a06 0x1b5 ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .debug_line 0x00002bbb 0x1b5 ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .debug_line 0x00002d70 0x1ce ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - -.debug_frame 0x00000000 0x440 - *(.debug_frame) - .debug_frame 0x00000000 0x44 obj/default/hello_world_small.o - .debug_frame 0x00000044 0x30 obj/default/hex_encoder.o - .debug_frame 0x00000074 0x5c obj/default/hex_out.o - .debug_frame 0x000000d0 0x38 obj/default/input_int.o - .debug_frame 0x00000108 0x58 obj/default/sys_memory.o - .debug_frame 0x00000160 0x20 obj/default/sys_register.o - .debug_frame 0x00000180 0x28 obj/default/system.o - .debug_frame 0x000001a8 0x70 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-divmod.o) - .debug_frame 0x00000218 0x40 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-sprintf.o) - .debug_frame 0x00000258 0x64 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-vfprintf.o) - .debug_frame 0x000002bc 0x2c c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-fvwrite_small_str.o) - .debug_frame 0x000002e8 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-memmove.o) - .debug_frame 0x00000308 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-strlen.o) - .debug_frame 0x00000328 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-mul.o) - .debug_frame 0x00000348 0x38 ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_load.o) - .debug_frame 0x00000380 0x28 ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_main.o) - .debug_frame 0x000003a8 0x38 ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_sys_init.o) - .debug_frame 0x000003e0 0x20 ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .debug_frame 0x00000400 0x20 ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .debug_frame 0x00000420 0x20 ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - -.debug_str 0x00000000 0xfdc - *(.debug_str) - .debug_str 0x00000000 0x86 obj/default/hello_world_small.o - 0x90 (size before relaxing) - .debug_str 0x00000086 0x42 obj/default/hex_encoder.o - 0xa0 (size before relaxing) - .debug_str 0x000000c8 0x54 obj/default/hex_out.o - 0xd6 (size before relaxing) - .debug_str 0x0000011c 0xd3 obj/default/input_int.o - 0x183 (size before relaxing) - .debug_str 0x000001ef 0xb8 obj/default/sys_memory.o - 0x14d (size before relaxing) - .debug_str 0x000002a7 0x1e obj/default/sys_register.o - 0x9f (size before relaxing) - .debug_str 0x000002c5 0xf obj/default/system.o - 0x68 (size before relaxing) - .debug_str 0x000002d4 0x10b c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-divmod.o) - 0x1b4 (size before relaxing) - .debug_str 0x000003df 0xea c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-ctype_.o) - 0x119 (size before relaxing) - .debug_str 0x000004c9 0x3dd c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-sprintf.o) - 0x499 (size before relaxing) - .debug_str 0x000008a6 0x162 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-vfprintf.o) - 0x5af (size before relaxing) - .debug_str 0x00000a08 0x5d c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-fvwrite_small_str.o) - 0x487 (size before relaxing) - .debug_str 0x00000a65 0xf8 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-impure.o) - 0x45d (size before relaxing) - .debug_str 0x00000b5d 0x104 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-memmove.o) - 0x199 (size before relaxing) - .debug_str 0x00000c61 0x45 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-strlen.o) - 0x184 (size before relaxing) - .debug_str 0x00000ca6 0x37 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-mul.o) - 0x175 (size before relaxing) - .debug_str 0x00000cdd 0x142 ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_load.o) - 0x1d7 (size before relaxing) - .debug_str 0x00000e1f 0x70 ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_main.o) - 0x15b (size before relaxing) - .debug_str 0x00000e8f 0xaa ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_sys_init.o) - 0x1ce (size before relaxing) - .debug_str 0x00000f39 0x34 ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - 0x11a (size before relaxing) - .debug_str 0x00000f6d 0x34 ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - 0x11a (size before relaxing) - .debug_str 0x00000fa1 0x3b ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - 0x121 (size before relaxing) - -.debug_loc 0x00000000 0x1462 - *(.debug_loc) - .debug_loc 0x00000000 0x3e obj/default/hello_world_small.o - .debug_loc 0x0000003e 0x3b9 obj/default/hex_encoder.o - .debug_loc 0x000003f7 0x24c obj/default/hex_out.o - .debug_loc 0x00000643 0x1f obj/default/input_int.o - .debug_loc 0x00000662 0xcc obj/default/sys_memory.o - .debug_loc 0x0000072e 0x1f obj/default/system.o - .debug_loc 0x0000074d 0x1d2 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-divmod.o) - .debug_loc 0x0000091f 0xbe c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-sprintf.o) - .debug_loc 0x000009dd 0x878 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-vfprintf.o) - .debug_loc 0x00001255 0xe1 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-fvwrite_small_str.o) - .debug_loc 0x00001336 0x4f c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-memmove.o) - .debug_loc 0x00001385 0x1e c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-strlen.o) - .debug_loc 0x000013a3 0x4f c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-mul.o) - .debug_loc 0x000013f2 0x1f ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_load.o) - .debug_loc 0x00001411 0x1f ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_main.o) - .debug_loc 0x00001430 0x32 ../qsys_tutorial_hexs_bsp/\libhal_bsp.a(alt_sys_init.o) - -.debug_macinfo - *(.debug_macinfo) - -.debug_weaknames - *(.debug_weaknames) - -.debug_funcnames - *(.debug_funcnames) - -.debug_typenames - *(.debug_typenames) - -.debug_varnames - *(.debug_varnames) - -.debug_alt_sim_info - 0x00000000 0x10 - *(.debug_alt_sim_info) - .debug_alt_sim_info - 0x00000000 0x10 ../qsys_tutorial_hexs_bsp//obj/HAL/src/crt0.o - 0x00001000 __alt_data_end = 0x1000 - 0x00001000 PROVIDE (__alt_stack_pointer, __alt_data_end) - 0x000019d8 PROVIDE (__alt_stack_limit, __alt_stack_base) - 0x000019d8 PROVIDE (__alt_heap_start, end) - 0x00001000 PROVIDE (__alt_heap_limit, 0x1000) -OUTPUT(qsys_tutorial_hexs.elf elf32-littlenios2) - -.debug_ranges 0x00000000 0x178 - .debug_ranges 0x00000000 0x20 ../qsys_tutorial_hexs_bsp//obj/HAL/src/crt0.o - .debug_ranges 0x00000020 0x140 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-vfprintf.o) - .debug_ranges 0x00000160 0x18 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-fvwrite_small_str.o) diff --git a/software/qsys_tutorial_hexs/qsys_tutorial_hexs.objdump b/software/qsys_tutorial_hexs/qsys_tutorial_hexs.objdump deleted file mode 100644 index 6921dd3..0000000 --- a/software/qsys_tutorial_hexs/qsys_tutorial_hexs.objdump +++ /dev/null @@ -1,2011 +0,0 @@ - -qsys_tutorial_hexs.elf: file format elf32-littlenios2 -qsys_tutorial_hexs.elf -architecture: nios2, flags 0x00000112: -EXEC_P, HAS_SYMS, D_PAGED -start address 0x00000020 - -Program Header: - LOAD off 0x00001000 vaddr 0x00000000 paddr 0x00000000 align 2**12 - filesz 0x00000020 memsz 0x00000020 flags r-x - LOAD off 0x00001020 vaddr 0x00000020 paddr 0x00000020 align 2**12 - filesz 0x00000f68 memsz 0x00000f68 flags r-x - LOAD off 0x00001f88 vaddr 0x00000f88 paddr 0x00000f90 align 2**12 - filesz 0x00000008 memsz 0x00000008 flags rw- - LOAD off 0x00001f98 vaddr 0x00000f98 paddr 0x00000f98 align 2**12 - filesz 0x00000000 memsz 0x00000064 flags rw- - -Sections: -Idx Name Size VMA LMA File off Algn - 0 .entry 00000020 00000000 00000000 00001000 2**5 - CONTENTS, ALLOC, LOAD, READONLY, CODE - 1 .text 00000cbc 00000020 00000020 00001020 2**2 - CONTENTS, ALLOC, LOAD, READONLY, CODE - 2 .rodata 000002ac 00000cdc 00000cdc 00001cdc 2**2 - CONTENTS, ALLOC, LOAD, READONLY, DATA - 3 .rwdata 00000008 00000f88 00000f90 00001f88 2**2 - CONTENTS, ALLOC, LOAD, DATA, SMALL_DATA - 4 .bss 00000064 00000f98 00000f98 00001f98 2**2 - ALLOC, SMALL_DATA - 5 .comment 00000026 00000000 00000000 00001f90 2**0 - CONTENTS, READONLY - 6 .debug_aranges 00000248 00000000 00000000 00001fb8 2**3 - CONTENTS, READONLY, DEBUGGING - 7 .debug_pubnames 000003a2 00000000 00000000 00002200 2**0 - CONTENTS, READONLY, DEBUGGING - 8 .debug_info 00001254 00000000 00000000 000025a2 2**0 - CONTENTS, READONLY, DEBUGGING - 9 .debug_abbrev 00000aa5 00000000 00000000 000037f6 2**0 - CONTENTS, READONLY, DEBUGGING - 10 .debug_line 0000204a 00000000 00000000 0000429b 2**0 - CONTENTS, READONLY, DEBUGGING - 11 .debug_frame 00000384 00000000 00000000 000062e8 2**2 - CONTENTS, READONLY, DEBUGGING - 12 .debug_str 00000895 00000000 00000000 0000666c 2**0 - CONTENTS, READONLY, DEBUGGING - 13 .debug_loc 00000b67 00000000 00000000 00006f01 2**0 - CONTENTS, READONLY, DEBUGGING - 14 .debug_alt_sim_info 00000010 00000000 00000000 00007a68 2**2 - CONTENTS, READONLY, DEBUGGING - 15 .debug_ranges 00000020 00000000 00000000 00007a78 2**3 - CONTENTS, READONLY, DEBUGGING - 16 .thread_model 00000003 00000000 00000000 00008b60 2**0 - CONTENTS, READONLY - 17 .cpu 0000000f 00000000 00000000 00008b63 2**0 - CONTENTS, READONLY - 18 .qsys 00000001 00000000 00000000 00008b72 2**0 - CONTENTS, READONLY - 19 .simulation_enabled 00000001 00000000 00000000 00008b73 2**0 - CONTENTS, READONLY - 20 .stderr_dev 00000009 00000000 00000000 00008b74 2**0 - CONTENTS, READONLY - 21 .stdin_dev 00000009 00000000 00000000 00008b7d 2**0 - CONTENTS, READONLY - 22 .stdout_dev 00000009 00000000 00000000 00008b86 2**0 - CONTENTS, READONLY - 23 .sopc_system_name 0000000b 00000000 00000000 00008b8f 2**0 - CONTENTS, READONLY - 24 .quartus_project_dir 00000030 00000000 00000000 00008b9a 2**0 - CONTENTS, READONLY - 25 .sopcinfo 0006c868 00000000 00000000 00008bca 2**0 - CONTENTS, READONLY -SYMBOL TABLE: -00000000 l d .entry 00000000 .entry -00000020 l d .text 00000000 .text -00000cdc l d .rodata 00000000 .rodata -00000f88 l d .rwdata 00000000 .rwdata -00000f98 l d .bss 00000000 .bss -00000000 l d .comment 00000000 .comment -00000000 l d .debug_aranges 00000000 .debug_aranges -00000000 l d .debug_pubnames 00000000 .debug_pubnames -00000000 l d .debug_info 00000000 .debug_info -00000000 l d .debug_abbrev 00000000 .debug_abbrev -00000000 l d .debug_line 00000000 .debug_line -00000000 l d .debug_frame 00000000 .debug_frame -00000000 l d .debug_str 00000000 .debug_str -00000000 l d .debug_loc 00000000 .debug_loc -00000000 l d .debug_alt_sim_info 00000000 .debug_alt_sim_info -00000000 l d .debug_ranges 00000000 .debug_ranges -00000058 l .text 00000000 alt_after_alt_main -00000000 l df *ABS* 00000000 hello_world_small.c -00000000 l df *ABS* 00000000 hex_encoder.c -00000000 l df *ABS* 00000000 hex_out.c -00000000 l df *ABS* 00000000 input_int.c -00000f99 l O .bss 00000001 status.1370 -00000000 l df *ABS* 00000000 sys_memory.c -00000fac l O .bss 00000040 memory -00000000 l df *ABS* 00000000 sys_register.c -00000000 l df *ABS* 00000000 system.c -00000000 l df *ABS* 00000000 lib2-divmod.c -000008dc l F .text 0000007c udivmodsi4 -00000000 l df *ABS* 00000000 ctype_.c -00000e05 l O .rodata 00000180 _ctype_b -00000000 l df *ABS* 00000000 alt_load.c -00000a28 l F .text 00000020 alt_load_section -00000000 l df *ABS* 00000000 alt_main.c -00000000 l df *ABS* 00000000 alt_printf.c -00000000 l df *ABS* 00000000 alt_putchar.c -00000000 l df *ABS* 00000000 alt_sys_init.c -00000000 l df *ABS* 00000000 altera_avalon_jtag_uart_write.c -00000000 l df *ABS* 00000000 alt_dcache_flush_all.c -00000000 l df *ABS* 00000000 alt_icache_flush_all.c -00000000 l df *ABS* 00000000 altera_nios2_qsys_irq.c -00000ab4 g F .text 0000002c alt_main -00000f90 g *ABS* 00000000 __flash_rwdata_start -00000588 g F .text 00000050 clear_block -00000f8c g O .rwdata 00000004 jtag_uart -00000000 g F .entry 0000000c __reset -00000020 g *ABS* 00000000 __flash_exceptions_start -00000fa4 g O .bss 00000004 alt_argv -00008f88 g *ABS* 00000000 _gp -00000a18 g F .text 00000008 __udivsi3 -00000824 g F .text 00000070 memory_store -00000ffc g *ABS* 00000000 __bss_end -00000f88 g O .rwdata 00000004 __ctype_ptr -00000ccc g F .text 00000004 alt_dcache_flush_all -00000fec g O .bss 0000000d global_registers -00000f90 g *ABS* 00000000 __ram_rwdata_end -00000000 g *ABS* 00000000 __alt_mem_onchip_memory -00000f88 g *ABS* 00000000 __ram_rodata_end -00000a20 g F .text 00000008 __umodsi3 -00000ffc g *ABS* 00000000 end -00001000 g *ABS* 00000000 __alt_stack_pointer -00000c98 g F .text 00000034 altera_avalon_jtag_uart_write -00000ae0 g F .text 00000144 alt_printf -000005d8 g F .text 000000fc print_number -00000020 g F .text 0000003c _start -000004ac g F .text 000000dc print_block -00000c74 g F .text 00000004 alt_sys_init -00000f88 g *ABS* 00000000 __ram_rwdata_start -00000cdc g *ABS* 00000000 __ram_rodata_start -000008b0 g F .text 0000002c panic -00000ffc g *ABS* 00000000 __alt_stack_base -0000005c g F .text 00000084 init -00000f98 g *ABS* 00000000 __bss_start -000000e0 g F .text 00000014 main -00000fa8 g O .bss 00000004 alt_envp -000000f4 g F .text 00000124 encodeNumHex -0000076c g F .text 00000004 in_int -00000958 g F .text 00000060 __divsi3 -00000cdc g *ABS* 00000000 __flash_rodata_start -00000c78 g F .text 00000020 alt_irq_init -000006d4 g F .text 00000098 push_int -00000fa0 g O .bss 00000004 alt_argc -00000f9c g O .bss 00000004 global_current_memory -00000020 g *ABS* 00000000 __ram_exceptions_start -00000218 g F .text 00000294 encodeLatHex -00000f90 g *ABS* 00000000 _edata -00000ffc g *ABS* 00000000 _end -00000020 g *ABS* 00000000 __ram_exceptions_end -00000770 g F .text 00000044 memory_init -00000cd4 g F .text 00000008 altera_nios2_qsys_irq_init -0000000c g .entry 00000000 exit -000007b4 g F .text 00000070 memory_load -000009b8 g F .text 00000060 __modsi3 -00001000 g *ABS* 00000000 __alt_data_end -00000d04 g O .rodata 00000101 _ctype_ -00000894 g F .text 0000001c registers_init -0000000c g .entry 00000000 _exit -00000c24 g F .text 00000050 alt_putchar -00000cd0 g F .text 00000004 alt_icache_flush_all -00000a48 g F .text 0000006c alt_load -00000f98 g O .bss 00000001 PUSH_EVENT - - - -Disassembly of section .entry: - -00000000 <__reset>: - * Jump to the _start entry point in the .text section if reset code - * is allowed or if optimizing for RTL simulation. - */ -#if defined(ALT_ALLOW_CODE_AT_RESET) || defined(ALT_SIM_OPTIMIZE) - /* Jump to the _start entry point in the .text section. */ - movhi r1, %hi(_start) - 0: 00400034 movhi at,0 - ori r1, r1, %lo(_start) - 4: 08400814 ori at,at,32 - jmp r1 - 8: 0800683a jmp at - -0000000c <_exit>: - ... - -Disassembly of section .text: - -00000020 <_start>: -#if (NIOS2_NUM_OF_SHADOW_REG_SETS == 0) - /* - * Now that the caches are initialized, set up the stack pointer. - * The value provided by the linker is assumed to be correctly aligned. - */ - movhi sp, %hi(__alt_stack_pointer) - 20: 06c00034 movhi sp,0 - ori sp, sp, %lo(__alt_stack_pointer) - 24: dec40014 ori sp,sp,4096 - - /* Set up the global pointer. */ - movhi gp, %hi(_gp) - 28: 06800034 movhi gp,0 - ori gp, gp, %lo(_gp) - 2c: d6a3e214 ori gp,gp,36744 - */ -#ifndef ALT_SIM_OPTIMIZE - /* Log that the BSS is about to be cleared. */ - ALT_LOG_PUTS(alt_log_msg_bss) - - movhi r2, %hi(__bss_start) - 30: 00800034 movhi r2,0 - ori r2, r2, %lo(__bss_start) - 34: 1083e614 ori r2,r2,3992 - - movhi r3, %hi(__bss_end) - 38: 00c00034 movhi r3,0 - ori r3, r3, %lo(__bss_end) - 3c: 18c3ff14 ori r3,r3,4092 - - beq r2, r3, 1f - 40: 10c00326 beq r2,r3,50 <_start+0x30> - -0: - stw zero, (r2) - 44: 10000015 stw zero,0(r2) - addi r2, r2, 4 - 48: 10800104 addi r2,r2,4 - bltu r2, r3, 0b - 4c: 10fffd36 bltu r2,r3,44 <_start+0x24> - * section aren't defined until alt_load() has been called). - */ - mov et, zero -#endif - - call alt_load - 50: 0000a480 call a48 - - /* Log that alt_main is about to be called. */ - ALT_LOG_PUTS(alt_log_msg_alt_main) - - /* Call the C entry point. It should never return. */ - call alt_main - 54: 0000ab40 call ab4 - -00000058 : - - /* Wait in infinite loop in case alt_main does return. */ -alt_after_alt_main: - br alt_after_alt_main - 58: 003fff06 br 58 - -0000005c : - -#define ledrs (volatile int *) 0x00020a0 -#define push_switches (volatile char *) 0x0002080 - - -void init() { - 5c: defffd04 addi sp,sp,-12 - 60: dfc00215 stw ra,8(sp) - 64: dc400115 stw r17,4(sp) - 68: dc000015 stw r16,0(sp) - registers_init(); - 6c: 00008940 call 894 - memory_init(); - 70: 00007700 call 770 - clear_block(HEX0_3); clear_block(HEX4_5); clear_block(HEX6_7); - 74: 04400044 movi r17,1 - 78: 0009883a mov r4,zero - 7c: 00005880 call 588 - 80: 04000084 movi r16,2 - 84: 8809883a mov r4,r17 - 88: 00005880 call 588 - 8c: 8009883a mov r4,r16 - 90: 00005880 call 588 - print_block("he", 2, HEX6_7); - 94: 800b883a mov r5,r16 - 98: 800d883a mov r6,r16 - 9c: 01000034 movhi r4,0 - a0: 21033704 addi r4,r4,3292 - a4: 00004ac0 call 4ac - print_block("lo", 2, HEX4_5); - a8: 800b883a mov r5,r16 - ac: 880d883a mov r6,r17 - b0: 01000034 movhi r4,0 - b4: 21033804 addi r4,r4,3296 - b8: 00004ac0 call 4ac - print_block("you1", 4, HEX0_3); - bc: 01000034 movhi r4,0 - c0: 21033904 addi r4,r4,3300 - c4: 01400104 movi r5,4 - c8: 000d883a mov r6,zero -} - cc: dfc00217 ldw ra,8(sp) - d0: dc400117 ldw r17,4(sp) - d4: dc000017 ldw r16,0(sp) - d8: dec00304 addi sp,sp,12 - registers_init(); - memory_init(); - clear_block(HEX0_3); clear_block(HEX4_5); clear_block(HEX6_7); - print_block("he", 2, HEX6_7); - print_block("lo", 2, HEX4_5); - print_block("you1", 4, HEX0_3); - dc: 00004ac1 jmpi 4ac - -000000e0
: -} - -int main() -{ - e0: deffff04 addi sp,sp,-4 - e4: dfc00015 stw ra,0(sp) - init(); - e8: 000005c0 call 5c - while(1) { - // interrupt - in_int(); - ec: 000076c0 call 76c - f0: 003ffe06 br ec - -000000f4 : -#include "hex_encoder.h" -#include - -void encodeNumHex(int hex_i, int num) { - char encoded = 0; - switch (num) { - f4: 00800244 movi r2,9 - f8: 11401336 bltu r2,r5,148 - fc: 2945883a add r2,r5,r5 - 100: 1085883a add r2,r2,r2 - 104: 00c00034 movhi r3,0 - 108: 18c04604 addi r3,r3,280 - 10c: 10c5883a add r2,r2,r3 - 110: 10800017 ldw r2,0(r2) - 114: 1000683a jmp r2 - 118: 00000150 cmplti zero,zero,5 - 11c: 00000158 cmpnei zero,zero,5 - 120: 00000160 cmpeqi zero,zero,5 - 124: 00000168 cmpgeui zero,zero,5 - 128: 00000170 cmpltui zero,zero,5 - 12c: 00000178 rdprs zero,zero,5 - 130: 00000180 call 18 <_exit+0xc> - 134: 00000188 cmpgei zero,zero,6 - 138: 00000148 cmpgei zero,zero,5 - 13c: 00000140 call 14 <_exit+0x8> - 140: 01400404 movi r5,16 - 144: 00001106 br 18c - 148: 000b883a mov r5,zero - 14c: 00000f06 br 18c - 150: 01401004 movi r5,64 - 154: 00000d06 br 18c - case 0: - encoded = (char)0x40; // 100 0000 - break; - 158: 017ffe44 movi r5,-7 - 15c: 00000b06 br 18c - case 1: - encoded = (char)0xF9; // 111 1001 - break; - 160: 01400904 movi r5,36 - 164: 00000906 br 18c - case 2: - encoded = (char)0x24; // 010 0100 - break; - 168: 01400c04 movi r5,48 - 16c: 00000706 br 18c - case 3: - encoded = (char)0x30; // 011 0000 - break; - 170: 01400644 movi r5,25 - 174: 00000506 br 18c - case 4: - encoded = (char)0x19; // 001 1001 - break; - 178: 01400484 movi r5,18 - 17c: 00000306 br 18c - case 5: - encoded = (char)0x12; // 001 0010 - break; - 180: 01400084 movi r5,2 - 184: 00000106 br 18c - case 6: - encoded = (char)0x02; // 000 0010 - break; - 188: 01401604 movi r5,88 - default: - encoded = 0; - break; - } - - switch (hex_i) { - 18c: 008001c4 movi r2,7 - 190: 11002036 bltu r2,r4,214 - 194: 2105883a add r2,r4,r4 - 198: 1085883a add r2,r2,r2 - 19c: 00c00034 movhi r3,0 - 1a0: 18c06c04 addi r3,r3,432 - 1a4: 10c5883a add r2,r2,r3 - 1a8: 10800017 ldw r2,0(r2) - 1ac: 1000683a jmp r2 - 1b0: 000001d0 cmplti zero,zero,7 - 1b4: 000001d8 cmpnei zero,zero,7 - 1b8: 000001e0 cmpeqi zero,zero,7 - 1bc: 000001e8 cmpgeui zero,zero,7 - 1c0: 000001f0 cmpltui zero,zero,7 - 1c4: 000001f8 rdprs zero,zero,7 - 1c8: 00000200 call 20 <_start> - 1cc: 0000020c andi zero,zero,8 - case 0: - *hex0 = encoded; - 1d0: 00881c04 movi r2,8304 - 1d4: 00000b06 br 204 - break; - case 1: - *hex1 = encoded; - 1d8: 00881804 movi r2,8288 - 1dc: 00000906 br 204 - break; - case 2: - *hex2 = encoded; - 1e0: 00881404 movi r2,8272 - 1e4: 00000706 br 204 - break; - case 3: - *hex3 = encoded; - 1e8: 00881004 movi r2,8256 - 1ec: 00000506 br 204 - break; - case 4: - *hex4 = encoded; - 1f0: 00880c04 movi r2,8240 - 1f4: 00000306 br 204 - break; - case 5: - *hex5 = encoded; - 1f8: 00880804 movi r2,8224 - 1fc: 00000106 br 204 - break; - case 6: - *hex6 = encoded; - 200: 00880404 movi r2,8208 - 204: 11400005 stb r5,0(r2) - 208: f800283a ret - break; - case 7: - *hex7 = encoded; - 20c: 00880004 movi r2,8192 - 210: 11400005 stb r5,0(r2) - 214: f800283a ret - -00000218 : -} - -void encodeLatHex(int hex_i, char c) { - char encoded = 0; - - if (isdigit(c)) { - 218: 00800034 movhi r2,0 - 21c: 1083e204 addi r2,r2,3976 - 220: 10800017 ldw r2,0(r2) - 224: 29403fcc andi r5,r5,255 - 228: 2940201c xori r5,r5,128 - 22c: 297fe004 addi r5,r5,-128 - 230: 2885883a add r2,r5,r2 - 234: 10800003 ldbu r2,0(r2) - default: - break; - } -} - -void encodeLatHex(int hex_i, char c) { - 238: 2007883a mov r3,r4 - char encoded = 0; - - if (isdigit(c)) { - 23c: 1080010c andi r2,r2,4 - 240: 10000226 beq r2,zero,24c - encodeNumHex(hex_i, c-'0'); - 244: 297ff404 addi r5,r5,-48 - 248: 00000f41 jmpi f4 - return; - } - - switch (c) { - 24c: 00801b44 movi r2,109 - 250: 28805a26 beq r5,r2,3bc - 254: 11401d16 blt r2,r5,2cc - 258: 00801984 movi r2,102 - 25c: 28804926 beq r5,r2,384 - 260: 11400e16 blt r2,r5,29c - 264: 00801884 movi r2,98 - 268: 28803e26 beq r5,r2,364 - 26c: 11400716 blt r2,r5,28c - 270: 00800b44 movi r2,45 - 274: 28803726 beq r5,r2,354 - 278: 00801844 movi r2,97 - 27c: 28803726 beq r5,r2,35c - 280: 00800804 movi r2,32 - 284: 28802f1e bne r5,r2,344 - 288: 00003006 br 34c - 28c: 00801904 movi r2,100 - 290: 28803826 beq r5,r2,374 - 294: 11403916 blt r2,r5,37c - 298: 00003406 br 36c - 29c: 00801a44 movi r2,105 - 2a0: 28803e26 beq r5,r2,39c - 2a4: 11400516 blt r2,r5,2bc - 2a8: 008019c4 movi r2,103 - 2ac: 28803726 beq r5,r2,38c - 2b0: 00801a04 movi r2,104 - 2b4: 2880231e bne r5,r2,344 - 2b8: 00003606 br 394 - 2bc: 00801ac4 movi r2,107 - 2c0: 28803a26 beq r5,r2,3ac - 2c4: 11403b16 blt r2,r5,3b4 - 2c8: 00003606 br 3a4 - 2cc: 00801d04 movi r2,116 - 2d0: 28804826 beq r5,r2,3f4 - 2d4: 11400c16 blt r2,r5,308 - 2d8: 00801c04 movi r2,112 - 2dc: 28803d26 beq r5,r2,3d4 - 2e0: 11400516 blt r2,r5,2f8 - 2e4: 00801b84 movi r2,110 - 2e8: 28803626 beq r5,r2,3c4 - 2ec: 00801bc4 movi r2,111 - 2f0: 2880141e bne r5,r2,344 - 2f4: 00003506 br 3cc - 2f8: 00801c84 movi r2,114 - 2fc: 28803926 beq r5,r2,3e4 - 300: 11403a16 blt r2,r5,3ec - 304: 00003506 br 3dc - 308: 00801dc4 movi r2,119 - 30c: 28803f26 beq r5,r2,40c - 310: 11400516 blt r2,r5,328 - 314: 00801d44 movi r2,117 - 318: 28803826 beq r5,r2,3fc - 31c: 00801d84 movi r2,118 - 320: 2880081e bne r5,r2,344 - 324: 00003706 br 404 - 328: 00801e44 movi r2,121 - 32c: 28803b26 beq r5,r2,41c - 330: 28803816 blt r5,r2,414 - 334: 00801e84 movi r2,122 - 338: 2880021e bne r5,r2,344 - 33c: 01401904 movi r5,100 - 340: 00003706 br 420 - 344: 000b883a mov r5,zero - 348: 00003506 br 420 - 34c: 017fffc4 movi r5,-1 - 350: 00003306 br 420 - case ' ': - encoded = (char)0xFF; // 111 1111 - break; - 354: 01400fc4 movi r5,63 - 358: 00003106 br 420 - case '-': - encoded = (char)0x3F; // 011 1111 - break; - 35c: 01400204 movi r5,8 - 360: 00002f06 br 420 - case 'a': - encoded = (char)0x08; // 000 1000 - break; - 364: 014000c4 movi r5,3 - 368: 00002d06 br 420 - case 'b': - encoded = (char)0x03; // 000 0011 - break; - 36c: 014009c4 movi r5,39 - 370: 00002b06 br 420 - case 'c': - encoded = (char)0x27; // 010 0111 - break; - 374: 01400844 movi r5,33 - 378: 00002906 br 420 - case 'd': - encoded = (char)0x21; // 010 0001 - break; - 37c: 01400184 movi r5,6 - 380: 00002706 br 420 - case 'e': - encoded = (char)0x06; // 000 0110 - break; - 384: 01400384 movi r5,14 - 388: 00002506 br 420 - case 'f': - encoded = (char)0x0E; // 000 1110 - break; - 38c: 01401084 movi r5,66 - 390: 00002306 br 420 - case 'g': - encoded = (char)0x42; // 100 0010 - break; - 394: 014002c4 movi r5,11 - 398: 00002106 br 420 - case 'h': - encoded = (char)0x0B; // 000 1011 - break; - 39c: 017ffec4 movi r5,-5 - 3a0: 00001f06 br 420 - case 'i': - encoded = (char)0xFB; // 111 1011 - break; - 3a4: 01401844 movi r5,97 - 3a8: 00001d06 br 420 - case 'j': - encoded = (char)0x61; // 110 0001 - break; - 3ac: 01400284 movi r5,10 - 3b0: 00001b06 br 420 - case 'k': - encoded = (char)0x0A; // 000 1010 - break; - 3b4: 014011c4 movi r5,71 - 3b8: 00001906 br 420 - case 'l': - encoded = (char)0x47; // 100 0111 - break; - 3bc: 01401204 movi r5,72 - 3c0: 00001706 br 420 - case 'm': - encoded = (char)0x48; // 100 1000 - break; - 3c4: 01400ac4 movi r5,43 - 3c8: 00001506 br 420 - case 'n': - encoded = (char)0x2B; // 010 1011 - break; - 3cc: 014008c4 movi r5,35 - 3d0: 00001306 br 420 - case 'o': - encoded = (char)0x23; // 010 0011 - break; - 3d4: 01400304 movi r5,12 - 3d8: 00001106 br 420 - case 'p': - encoded = (char)0x0C; // 000 1100 - break; - 3dc: 01400104 movi r5,4 - 3e0: 00000f06 br 420 - case 'q': - encoded = (char)0x04; // 000 0100 - break; - 3e4: 01400bc4 movi r5,47 - 3e8: 00000d06 br 420 - case 'r': - encoded = (char)0x2F; // 010 1111 - break; - 3ec: 014004c4 movi r5,19 - 3f0: 00000b06 br 420 - case 's': - encoded = (char)0x13; // 001 0011 - break; - 3f4: 014001c4 movi r5,7 - 3f8: 00000906 br 420 - case 't': - encoded = (char)0x07; // 000 0111 - break; - 3fc: 014018c4 movi r5,99 - 400: 00000706 br 420 - case 'u': - encoded = (char)0x63; // 110 0011 - break; - 404: 01401044 movi r5,65 - 408: 00000506 br 420 - case 'v': - encoded = (char)0x41; // 100 0001 - break; - 40c: 01400044 movi r5,1 - 410: 00000306 br 420 - case 'w': - encoded = (char)0x01; // 000 0001 - break; - 414: 01400244 movi r5,9 - 418: 00000106 br 420 - case 'x': - encoded = (char)0x09; // 000 1001 - break; - 41c: 01400444 movi r5,17 - default: - encoded = 0; - break; - } - - switch (hex_i) { - 420: 008001c4 movi r2,7 - 424: 10c02036 bltu r2,r3,4a8 - 428: 18c5883a add r2,r3,r3 - 42c: 1085883a add r2,r2,r2 - 430: 00c00034 movhi r3,0 - 434: 18c11104 addi r3,r3,1092 - 438: 10c5883a add r2,r2,r3 - 43c: 10800017 ldw r2,0(r2) - 440: 1000683a jmp r2 - 444: 00000464 muli zero,zero,17 - 448: 0000046c andhi zero,zero,17 - 44c: 00000474 movhi zero,17 - 450: 0000047c xorhi zero,zero,17 - 454: 00000484 movi zero,18 - 458: 0000048c andi zero,zero,18 - 45c: 00000494 movui zero,18 - 460: 000004a0 cmpeqi zero,zero,18 - case 0: - *hex0 = encoded; - 464: 00881c04 movi r2,8304 - 468: 00000b06 br 498 - break; - case 1: - *hex1 = encoded; - 46c: 00881804 movi r2,8288 - 470: 00000906 br 498 - break; - case 2: - *hex2 = encoded; - 474: 00881404 movi r2,8272 - 478: 00000706 br 498 - break; - case 3: - *hex3 = encoded; - 47c: 00881004 movi r2,8256 - 480: 00000506 br 498 - break; - case 4: - *hex4 = encoded; - 484: 00880c04 movi r2,8240 - 488: 00000306 br 498 - break; - case 5: - *hex5 = encoded; - 48c: 00880804 movi r2,8224 - 490: 00000106 br 498 - break; - case 6: - *hex6 = encoded; - 494: 00880404 movi r2,8208 - 498: 11400005 stb r5,0(r2) - 49c: f800283a ret - break; - case 7: - *hex7 = encoded; - 4a0: 00880004 movi r2,8192 - 4a4: 11400005 stb r5,0(r2) - 4a8: f800283a ret - -000004ac : - */ -#include "hex_out.h" -#include "hex_encoder.h" -#include "system.h" - -void print_block(char * str, unsigned int size, enum BLOCK_N block_i) { - 4ac: defffc04 addi sp,sp,-16 - 4b0: dc400115 stw r17,4(sp) - 4b4: dc000015 stw r16,0(sp) - 4b8: dfc00315 stw ra,12(sp) - 4bc: dc800215 stw r18,8(sp) - 4c0: 2021883a mov r16,r4 - 4c4: 2823883a mov r17,r5 - int i; - if (block_i == HEX0_3) { - 4c8: 30000d1e bne r6,zero,500 - if (size > 4) panic(); - 4cc: 00800104 movi r2,4 - 4d0: 1140012e bgeu r2,r5,4d8 - 4d4: 00008b00 call 8b0 - 4d8: 8461883a add r16,r16,r17 - 4dc: 0025883a mov r18,zero - 4e0: 00000306 br 4f0 - for (i = 0; i < size; i++) { - encodeLatHex(i,str[size-1-i]); - 4e4: 81400007 ldb r5,0(r16) - -void print_block(char * str, unsigned int size, enum BLOCK_N block_i) { - int i; - if (block_i == HEX0_3) { - if (size > 4) panic(); - for (i = 0; i < size; i++) { - 4e8: 94800044 addi r18,r18,1 - encodeLatHex(i,str[size-1-i]); - 4ec: 00002180 call 218 - 4f0: 9009883a mov r4,r18 - -void print_block(char * str, unsigned int size, enum BLOCK_N block_i) { - int i; - if (block_i == HEX0_3) { - if (size > 4) panic(); - for (i = 0; i < size; i++) { - 4f4: 843fffc4 addi r16,r16,-1 - 4f8: 947ffa1e bne r18,r17,4e4 - 4fc: 00001c06 br 570 - encodeLatHex(i,str[size-1-i]); - } - } - else if (block_i == HEX4_5) { - 500: 00800044 movi r2,1 - 504: 30800d1e bne r6,r2,53c - if (size > 2) panic(); - 508: 00800084 movi r2,2 - 50c: 1140012e bgeu r2,r5,514 - 510: 00008b00 call 8b0 - 514: 8461883a add r16,r16,r17 - 518: 0025883a mov r18,zero - 51c: 00000306 br 52c - for (i = 0; i < size; i++) { - encodeLatHex(i+4,str[size-1-i]); - 520: 81400007 ldb r5,0(r16) - encodeLatHex(i,str[size-1-i]); - } - } - else if (block_i == HEX4_5) { - if (size > 2) panic(); - for (i = 0; i < size; i++) { - 524: 94800044 addi r18,r18,1 - encodeLatHex(i+4,str[size-1-i]); - 528: 00002180 call 218 - 52c: 91000104 addi r4,r18,4 - encodeLatHex(i,str[size-1-i]); - } - } - else if (block_i == HEX4_5) { - if (size > 2) panic(); - for (i = 0; i < size; i++) { - 530: 843fffc4 addi r16,r16,-1 - 534: 947ffa1e bne r18,r17,520 - 538: 00000d06 br 570 - encodeLatHex(i+4,str[size-1-i]); - } - } - else if (block_i == HEX6_7) { - 53c: 00800084 movi r2,2 - 540: 30800b1e bne r6,r2,570 - if (size > 2) panic(); - 544: 3140012e bgeu r6,r5,54c - 548: 00008b00 call 8b0 - 54c: 8461883a add r16,r16,r17 - 550: 0025883a mov r18,zero - 554: 00000306 br 564 - for (i = 0; i < size; i++) { - encodeLatHex(i+6,str[size-1-i]); - 558: 81400007 ldb r5,0(r16) - encodeLatHex(i+4,str[size-1-i]); - } - } - else if (block_i == HEX6_7) { - if (size > 2) panic(); - for (i = 0; i < size; i++) { - 55c: 94800044 addi r18,r18,1 - encodeLatHex(i+6,str[size-1-i]); - 560: 00002180 call 218 - 564: 91000184 addi r4,r18,6 - encodeLatHex(i+4,str[size-1-i]); - } - } - else if (block_i == HEX6_7) { - if (size > 2) panic(); - for (i = 0; i < size; i++) { - 568: 843fffc4 addi r16,r16,-1 - 56c: 947ffa1e bne r18,r17,558 - encodeLatHex(i+6,str[size-1-i]); - } - } -} - 570: dfc00317 ldw ra,12(sp) - 574: dc800217 ldw r18,8(sp) - 578: dc400117 ldw r17,4(sp) - 57c: dc000017 ldw r16,0(sp) - 580: dec00404 addi sp,sp,16 - 584: f800283a ret - -00000588 : - -void clear_block(enum BLOCK_N block_i) { - 588: 2007883a mov r3,r4 - if (block_i == HEX0_3) { - print_block(" ", 4, HEX0_3); - 58c: 01400104 movi r5,4 - 590: 000d883a mov r6,zero - 594: 01000034 movhi r4,0 - 598: 21033b04 addi r4,r4,3308 - } - } -} - -void clear_block(enum BLOCK_N block_i) { - if (block_i == HEX0_3) { - 59c: 18000c26 beq r3,zero,5d0 - print_block(" ", 4, HEX0_3); - } - else if (block_i == HEX4_5) { - 5a0: 00800044 movi r2,1 - print_block(" ", 2, HEX4_5); - 5a4: 180d883a mov r6,r3 - 5a8: 01000034 movhi r4,0 - 5ac: 21033d04 addi r4,r4,3316 - 5b0: 01400084 movi r5,2 - -void clear_block(enum BLOCK_N block_i) { - if (block_i == HEX0_3) { - print_block(" ", 4, HEX0_3); - } - else if (block_i == HEX4_5) { - 5b4: 18800626 beq r3,r2,5d0 - print_block(" ", 2, HEX4_5); - } - else if (block_i == HEX6_7) { - 5b8: 00800084 movi r2,2 - print_block(" ", 2, HEX6_7); - 5bc: 180b883a mov r5,r3 - 5c0: 01000034 movhi r4,0 - 5c4: 21033d04 addi r4,r4,3316 - 5c8: 180d883a mov r6,r3 - print_block(" ", 4, HEX0_3); - } - else if (block_i == HEX4_5) { - print_block(" ", 2, HEX4_5); - } - else if (block_i == HEX6_7) { - 5cc: 1880011e bne r3,r2,5d4 - print_block(" ", 2, HEX6_7); - 5d0: 00004ac1 jmpi 4ac - 5d4: f800283a ret - -000005d8 : - } -} - -void print_number(char num) { - 5d8: defff804 addi sp,sp,-32 - 5dc: dc800415 stw r18,16(sp) - 5e0: dc400315 stw r17,12(sp) - 5e4: dfc00715 stw ra,28(sp) - 5e8: dd000615 stw r20,24(sp) - 5ec: dcc00515 stw r19,20(sp) - 5f0: dc000215 stw r16,8(sp) - 5f4: 2023883a mov r17,r4 - 5f8: 0025883a mov r18,zero - int i; - char buf[5]; - char val; - for (i = 0; i < 4; i++) { - if (num < 0) { - 5fc: 88803fcc andi r2,r17,255 - 600: 1080201c xori r2,r2,128 - 604: 10bfe004 addi r2,r2,-128 - buf[0] = '-'; - 608: 05000b44 movi r20,45 - val = -num; - 60c: 0461c83a sub r16,zero,r17 -void print_number(char num) { - int i; - char buf[5]; - char val; - for (i = 0; i < 4; i++) { - if (num < 0) { - 610: 10000216 blt r2,zero,61c - buf[0] = '-'; - val = -num; - } else { - buf[0] = ' '; - 614: 05000804 movi r20,32 - 618: 8821883a mov r16,r17 - val = num; - } - buf[1] = val/100%10 + '0'; - 61c: 84003fcc andi r16,r16,255 - 620: 8400201c xori r16,r16,128 - 624: 843fe004 addi r16,r16,-128 - 628: 8009883a mov r4,r16 - 62c: 01401904 movi r5,100 - 630: 00009580 call 958 <__divsi3> - 634: 11003fcc andi r4,r2,255 - 638: 2100201c xori r4,r4,128 - 63c: 213fe004 addi r4,r4,-128 - 640: 01400284 movi r5,10 - 644: 00009b80 call 9b8 <__modsi3> - buf[2] = val/10%10 + '0'; - 648: 8009883a mov r4,r16 - 64c: 01400284 movi r5,10 - val = -num; - } else { - buf[0] = ' '; - val = num; - } - buf[1] = val/100%10 + '0'; - 650: 14c00c04 addi r19,r2,48 - buf[2] = val/10%10 + '0'; - 654: 00009580 call 958 <__divsi3> - 658: 11003fcc andi r4,r2,255 - 65c: 2100201c xori r4,r4,128 - 660: 213fe004 addi r4,r4,-128 - 664: 01400284 movi r5,10 - 668: 00009b80 call 9b8 <__modsi3> - buf[3] = val%10 + '0'; - 66c: 8009883a mov r4,r16 - 670: 01400284 movi r5,10 - } else { - buf[0] = ' '; - val = num; - } - buf[1] = val/100%10 + '0'; - buf[2] = val/10%10 + '0'; - 674: 14000c04 addi r16,r2,48 - buf[3] = val%10 + '0'; - 678: 00009b80 call 9b8 <__modsi3> - 67c: 10c00c04 addi r3,r2,48 - -void print_number(char num) { - int i; - char buf[5]; - char val; - for (i = 0; i < 4; i++) { - 680: 94800044 addi r18,r18,1 - 684: 00800104 movi r2,4 - 688: 90bfdc1e bne r18,r2,5fc - } - buf[1] = val/100%10 + '0'; - buf[2] = val/10%10 + '0'; - buf[3] = val%10 + '0'; - } - clear_block(HEX0_3); - 68c: 0009883a mov r4,zero - 690: d8c000c5 stb r3,3(sp) - 694: dc000085 stb r16,2(sp) - 698: dcc00045 stb r19,1(sp) - 69c: dd000005 stb r20,0(sp) - 6a0: 00005880 call 588 - print_block(buf, 4, HEX0_3); - 6a4: 900b883a mov r5,r18 - 6a8: d809883a mov r4,sp - 6ac: 000d883a mov r6,zero - 6b0: 00004ac0 call 4ac -} - 6b4: dfc00717 ldw ra,28(sp) - 6b8: dd000617 ldw r20,24(sp) - 6bc: dcc00517 ldw r19,20(sp) - 6c0: dc800417 ldw r18,16(sp) - 6c4: dc400317 ldw r17,12(sp) - 6c8: dc000217 ldw r16,8(sp) - 6cc: dec00804 addi sp,sp,32 - 6d0: f800283a ret - -000006d4 : -void push_int() { - static unsigned char status = 0; - sw_t s; - s.data = *switches; - - switch (status) { - 6d4: d0e00443 ldbu r3,-32751(gp) -} - -void push_int() { - static unsigned char status = 0; - sw_t s; - s.data = *switches; - 6d8: 00882404 movi r2,8336 - - switch (status) { - 6dc: 01000044 movi r4,1 - global_registers[Ssw_psel]; - global_registers[Ssw_rw]; - global_registers[Ssw_run]; -} - -void push_int() { - 6e0: deffff04 addi sp,sp,-4 - static unsigned char status = 0; - sw_t s; - s.data = *switches; - 6e4: 11400017 ldw r5,0(r2) - - switch (status) { - 6e8: 19001226 beq r3,r4,734 - 6ec: 19000336 bltu r3,r4,6fc - 6f0: 00800084 movi r2,2 - 6f4: 18801a1e bne r3,r2,760 - 6f8: 00001806 br 75c - case 0: - PUSH_EVENT = 0; - if (*push_switches != 7) status = 1; - 6fc: 00882004 movi r2,8320 - 700: 10800003 ldbu r2,0(r2) - 704: 00c001c4 movi r3,7 - sw_t s; - s.data = *switches; - - switch (status) { - case 0: - PUSH_EVENT = 0; - 708: d0200405 stb zero,-32752(gp) - if (*push_switches != 7) status = 1; - 70c: 10803fcc andi r2,r2,255 - 710: 1080201c xori r2,r2,128 - 714: 10bfe004 addi r2,r2,-128 - 718: 10c00126 beq r2,r3,720 - 71c: d1200445 stb r4,-32751(gp) - //update_sw_reg(s); // �X�C�b�`���W�X�^�X�V - alt_printf("%x", s.data); - 720: 01000034 movhi r4,0 - 724: 21033e04 addi r4,r4,3320 -} - -void push_int() { - static unsigned char status = 0; - sw_t s; - s.data = *switches; - 728: d9400015 stw r5,0(sp) - break; - default: - status = 0; - break; - } -} - 72c: dec00104 addi sp,sp,4 - switch (status) { - case 0: - PUSH_EVENT = 0; - if (*push_switches != 7) status = 1; - //update_sw_reg(s); // �X�C�b�`���W�X�^�X�V - alt_printf("%x", s.data); - 730: 0000ae01 jmpi ae0 - break; - case 1: - if (*push_switches == 7) status = 2; - 734: 00882004 movi r2,8320 - 738: 10800003 ldbu r2,0(r2) - 73c: 00c001c4 movi r3,7 - 740: 10803fcc andi r2,r2,255 - 744: 1080201c xori r2,r2,128 - 748: 10bfe004 addi r2,r2,-128 - 74c: 10c0051e bne r2,r3,764 - 750: 00800084 movi r2,2 - 754: d0a00445 stb r2,-32751(gp) - 758: 00000206 br 764 - break; - case 2: - PUSH_EVENT = 1; - 75c: d1200405 stb r4,-32752(gp) - status = 0; - break; - default: - status = 0; - 760: d0200445 stb zero,-32751(gp) - break; - } -} - 764: dec00104 addi sp,sp,4 - 768: f800283a ret - -0000076c : -#include "sys_register.h" - -unsigned char PUSH_EVENT = 0; - -void in_int() { - push_int(); - 76c: 00006d41 jmpi 6d4 - -00000770 : - -/************************************************** - * Impl - **************************************************/ - -void memory_init() { - 770: 000b883a mov r5,zero - 774: 00000806 br 798 - int i, j; - for (i = 0; i < MEMS_COUNT; i++) - for (j = 0; j < MEM_SIZE; j++) { - 778: 21000044 addi r4,r4,1 - 77c: 00800404 movi r2,16 - memory[i][j] = 0; - 780: 18000005 stb zero,0(r3) - **************************************************/ - -void memory_init() { - int i, j; - for (i = 0; i < MEMS_COUNT; i++) - for (j = 0; j < MEM_SIZE; j++) { - 784: 18c00044 addi r3,r3,1 - 788: 20bffb1e bne r4,r2,778 - * Impl - **************************************************/ - -void memory_init() { - int i, j; - for (i = 0; i < MEMS_COUNT; i++) - 78c: 29400044 addi r5,r5,1 - 790: 00800104 movi r2,4 - 794: 28800626 beq r5,r2,7b0 - for (j = 0; j < MEM_SIZE; j++) { - memory[i][j] = 0; - } -} - 798: 2806913a slli r3,r5,4 - 79c: 00800034 movhi r2,0 - 7a0: 1083eb04 addi r2,r2,4012 - 7a4: 0009883a mov r4,zero - 7a8: 1887883a add r3,r3,r2 - 7ac: 003ff206 br 778 - 7b0: f800283a ret - -000007b4 : - if (!(mem_addr < MEM_SIZE)) panic(); - memory[global_current_memory][mem_addr] = global_registers[reg]; - return memory[global_current_memory][mem_addr]; -} - -char memory_load(unsigned int mem_addr, enum Register reg) { - 7b4: defffd04 addi sp,sp,-12 - if (!(mem_addr < MEM_SIZE)) panic(); - 7b8: 008003c4 movi r2,15 - if (!(mem_addr < MEM_SIZE)) panic(); - memory[global_current_memory][mem_addr] = global_registers[reg]; - return memory[global_current_memory][mem_addr]; -} - -char memory_load(unsigned int mem_addr, enum Register reg) { - 7bc: dc400115 stw r17,4(sp) - 7c0: dc000015 stw r16,0(sp) - 7c4: dfc00215 stw ra,8(sp) - 7c8: 2021883a mov r16,r4 - 7cc: 2823883a mov r17,r5 - if (!(mem_addr < MEM_SIZE)) panic(); - 7d0: 1100012e bgeu r2,r4,7d8 - 7d4: 00008b00 call 8b0 - global_registers[reg] = memory[global_current_memory][mem_addr]; - 7d8: d0a00517 ldw r2,-32748(gp) - 7dc: 00c00034 movhi r3,0 - 7e0: 18c3eb04 addi r3,r3,4012 - 7e4: 01000034 movhi r4,0 - 7e8: 2103fb04 addi r4,r4,4076 - 7ec: 1004913a slli r2,r2,4 - 7f0: 8909883a add r4,r17,r4 - 7f4: 10c5883a add r2,r2,r3 - 7f8: 1405883a add r2,r2,r16 - 7fc: 10800003 ldbu r2,0(r2) - 800: 20800005 stb r2,0(r4) - return global_registers[reg]; -} - 804: 10803fcc andi r2,r2,255 - 808: 1080201c xori r2,r2,128 - 80c: 10bfe004 addi r2,r2,-128 - 810: dfc00217 ldw ra,8(sp) - 814: dc400117 ldw r17,4(sp) - 818: dc000017 ldw r16,0(sp) - 81c: dec00304 addi sp,sp,12 - 820: f800283a ret - -00000824 : - for (j = 0; j < MEM_SIZE; j++) { - memory[i][j] = 0; - } -} - -char memory_store(unsigned int mem_addr, enum Register reg) { - 824: defffd04 addi sp,sp,-12 - if (!(mem_addr < MEM_SIZE)) panic(); - 828: 008003c4 movi r2,15 - for (j = 0; j < MEM_SIZE; j++) { - memory[i][j] = 0; - } -} - -char memory_store(unsigned int mem_addr, enum Register reg) { - 82c: dc400115 stw r17,4(sp) - 830: dc000015 stw r16,0(sp) - 834: dfc00215 stw ra,8(sp) - 838: 2023883a mov r17,r4 - 83c: 2821883a mov r16,r5 - if (!(mem_addr < MEM_SIZE)) panic(); - 840: 1100012e bgeu r2,r4,848 - 844: 00008b00 call 8b0 - memory[global_current_memory][mem_addr] = global_registers[reg]; - 848: d0e00517 ldw r3,-32748(gp) - 84c: 00800034 movhi r2,0 - 850: 1083fb04 addi r2,r2,4076 - 854: 8085883a add r2,r16,r2 - 858: 1806913a slli r3,r3,4 - 85c: 10800003 ldbu r2,0(r2) - 860: 01000034 movhi r4,0 - 864: 2103eb04 addi r4,r4,4012 - 868: 1907883a add r3,r3,r4 - 86c: 1c47883a add r3,r3,r17 - 870: 18800005 stb r2,0(r3) - return memory[global_current_memory][mem_addr]; -} - 874: 10803fcc andi r2,r2,255 - 878: 1080201c xori r2,r2,128 - 87c: 10bfe004 addi r2,r2,-128 - 880: dfc00217 ldw ra,8(sp) - 884: dc400117 ldw r17,4(sp) - 888: dc000017 ldw r16,0(sp) - 88c: dec00304 addi sp,sp,12 - 890: f800283a ret - -00000894 : - */ -#include "sys_register.h" - -char global_registers[REG_MAX_COUNT]; - -void registers_init() { - 894: 00800034 movhi r2,0 - 898: 1083fb04 addi r2,r2,4076 - 89c: 10c00344 addi r3,r2,13 - int i; - for (i = 0; i < REG_MAX_COUNT; i++) global_registers[i] = 0; - 8a0: 10000005 stb zero,0(r2) - 8a4: 10800044 addi r2,r2,1 - 8a8: 10fffd1e bne r2,r3,8a0 -} - 8ac: f800283a ret - -000008b0 : - * Author: takayun - */ -#include "system.h" -#include "hex_out.h" - -void panic() { - 8b0: deffff04 addi sp,sp,-4 - clear_block(HEX0_3); - 8b4: 0009883a mov r4,zero - * Author: takayun - */ -#include "system.h" -#include "hex_out.h" - -void panic() { - 8b8: dfc00015 stw ra,0(sp) - clear_block(HEX0_3); - 8bc: 00005880 call 588 - print_block("err ", 4, HEX0_3); - 8c0: 01400104 movi r5,4 - 8c4: 01000034 movhi r4,0 - 8c8: 21033f04 addi r4,r4,3324 - 8cc: 000d883a mov r6,zero -} - 8d0: dfc00017 ldw ra,0(sp) - 8d4: dec00104 addi sp,sp,4 -#include "system.h" -#include "hex_out.h" - -void panic() { - clear_block(HEX0_3); - print_block("err ", 4, HEX0_3); - 8d8: 00004ac1 jmpi 4ac - -000008dc : - 8dc: 29001b2e bgeu r5,r4,94c - 8e0: 28001a16 blt r5,zero,94c - 8e4: 00800044 movi r2,1 - 8e8: 0007883a mov r3,zero - 8ec: 01c007c4 movi r7,31 - 8f0: 00000306 br 900 - 8f4: 19c01326 beq r3,r7,944 - 8f8: 18c00044 addi r3,r3,1 - 8fc: 28000416 blt r5,zero,910 - 900: 294b883a add r5,r5,r5 - 904: 1085883a add r2,r2,r2 - 908: 293ffa36 bltu r5,r4,8f4 - 90c: 10000d26 beq r2,zero,944 - 910: 0007883a mov r3,zero - 914: 21400236 bltu r4,r5,920 - 918: 2149c83a sub r4,r4,r5 - 91c: 1886b03a or r3,r3,r2 - 920: 1004d07a srli r2,r2,1 - 924: 280ad07a srli r5,r5,1 - 928: 103ffa1e bne r2,zero,914 - 92c: 30000226 beq r6,zero,938 - 930: 2005883a mov r2,r4 - 934: f800283a ret - 938: 1809883a mov r4,r3 - 93c: 2005883a mov r2,r4 - 940: f800283a ret - 944: 0007883a mov r3,zero - 948: 003ff806 br 92c - 94c: 00800044 movi r2,1 - 950: 0007883a mov r3,zero - 954: 003fef06 br 914 - -00000958 <__divsi3>: - 958: defffe04 addi sp,sp,-8 - 95c: dc000015 stw r16,0(sp) - 960: dfc00115 stw ra,4(sp) - 964: 0021883a mov r16,zero - 968: 20000c16 blt r4,zero,99c <__divsi3+0x44> - 96c: 000d883a mov r6,zero - 970: 28000e16 blt r5,zero,9ac <__divsi3+0x54> - 974: 00008dc0 call 8dc - 978: 1007883a mov r3,r2 - 97c: 8005003a cmpeq r2,r16,zero - 980: 1000011e bne r2,zero,988 <__divsi3+0x30> - 984: 00c7c83a sub r3,zero,r3 - 988: 1805883a mov r2,r3 - 98c: dfc00117 ldw ra,4(sp) - 990: dc000017 ldw r16,0(sp) - 994: dec00204 addi sp,sp,8 - 998: f800283a ret - 99c: 0109c83a sub r4,zero,r4 - 9a0: 04000044 movi r16,1 - 9a4: 000d883a mov r6,zero - 9a8: 283ff20e bge r5,zero,974 <__divsi3+0x1c> - 9ac: 014bc83a sub r5,zero,r5 - 9b0: 8021003a cmpeq r16,r16,zero - 9b4: 003fef06 br 974 <__divsi3+0x1c> - -000009b8 <__modsi3>: - 9b8: deffff04 addi sp,sp,-4 - 9bc: dfc00015 stw ra,0(sp) - 9c0: 01800044 movi r6,1 - 9c4: 2807883a mov r3,r5 - 9c8: 20000416 blt r4,zero,9dc <__modsi3+0x24> - 9cc: 28000c16 blt r5,zero,a00 <__modsi3+0x48> - 9d0: dfc00017 ldw ra,0(sp) - 9d4: dec00104 addi sp,sp,4 - 9d8: 00008dc1 jmpi 8dc - 9dc: 0109c83a sub r4,zero,r4 - 9e0: 28000b16 blt r5,zero,a10 <__modsi3+0x58> - 9e4: 180b883a mov r5,r3 - 9e8: 01800044 movi r6,1 - 9ec: 00008dc0 call 8dc - 9f0: 0085c83a sub r2,zero,r2 - 9f4: dfc00017 ldw ra,0(sp) - 9f8: dec00104 addi sp,sp,4 - 9fc: f800283a ret - a00: 014bc83a sub r5,zero,r5 - a04: dfc00017 ldw ra,0(sp) - a08: dec00104 addi sp,sp,4 - a0c: 00008dc1 jmpi 8dc - a10: 0147c83a sub r3,zero,r5 - a14: 003ff306 br 9e4 <__modsi3+0x2c> - -00000a18 <__udivsi3>: - a18: 000d883a mov r6,zero - a1c: 00008dc1 jmpi 8dc - -00000a20 <__umodsi3>: - a20: 01800044 movi r6,1 - a24: 00008dc1 jmpi 8dc - -00000a28 : - -static void ALT_INLINE alt_load_section (alt_u32* from, - alt_u32* to, - alt_u32* end) -{ - if (to != from) - a28: 2900051e bne r5,r4,a40 - a2c: f800283a ret - { - while( to != end ) - { - *to++ = *from++; - a30: 20800017 ldw r2,0(r4) - a34: 21000104 addi r4,r4,4 - a38: 28800015 stw r2,0(r5) - a3c: 29400104 addi r5,r5,4 - alt_u32* to, - alt_u32* end) -{ - if (to != from) - { - while( to != end ) - a40: 29bffb1e bne r5,r6,a30 - a44: f800283a ret - -00000a48 : - * there is no bootloader, so this application is responsible for loading to - * RAM any sections that are required. - */ - -void alt_load (void) -{ - a48: deffff04 addi sp,sp,-4 - /* - * Copy the .rwdata section. - */ - - alt_load_section (&__flash_rwdata_start, - a4c: 01000034 movhi r4,0 - a50: 2103e404 addi r4,r4,3984 - a54: 01400034 movhi r5,0 - a58: 2943e204 addi r5,r5,3976 - a5c: 01800034 movhi r6,0 - a60: 3183e404 addi r6,r6,3984 - * there is no bootloader, so this application is responsible for loading to - * RAM any sections that are required. - */ - -void alt_load (void) -{ - a64: dfc00015 stw ra,0(sp) - /* - * Copy the .rwdata section. - */ - - alt_load_section (&__flash_rwdata_start, - a68: 0000a280 call a28 - - /* - * Copy the exception handler. - */ - - alt_load_section (&__flash_exceptions_start, - a6c: 01000034 movhi r4,0 - a70: 21000804 addi r4,r4,32 - a74: 01400034 movhi r5,0 - a78: 29400804 addi r5,r5,32 - a7c: 01800034 movhi r6,0 - a80: 31800804 addi r6,r6,32 - a84: 0000a280 call a28 - - /* - * Copy the .rodata section. - */ - - alt_load_section (&__flash_rodata_start, - a88: 01000034 movhi r4,0 - a8c: 21033704 addi r4,r4,3292 - a90: 01400034 movhi r5,0 - a94: 29433704 addi r5,r5,3292 - a98: 01800034 movhi r6,0 - a9c: 3183e204 addi r6,r6,3976 - aa0: 0000a280 call a28 - - /* - * Now ensure that the caches are in synch. - */ - - alt_dcache_flush_all(); - aa4: 0000ccc0 call ccc - alt_icache_flush_all(); -} - aa8: dfc00017 ldw ra,0(sp) - aac: dec00104 addi sp,sp,4 - /* - * Now ensure that the caches are in synch. - */ - - alt_dcache_flush_all(); - alt_icache_flush_all(); - ab0: 0000cd01 jmpi cd0 - -00000ab4 : - * devices/filesystems/components in the system; and call the entry point for - * the users application, i.e. main(). - */ - -void alt_main (void) -{ - ab4: deffff04 addi sp,sp,-4 -#endif - - /* ALT LOG - please see HAL/sys/alt_log_printf.h for details */ - ALT_LOG_PRINT_BOOT("[alt_main.c] Entering alt_main, calling alt_irq_init.\r\n"); - /* Initialize the interrupt controller. */ - alt_irq_init (NULL); - ab8: 0009883a mov r4,zero - * devices/filesystems/components in the system; and call the entry point for - * the users application, i.e. main(). - */ - -void alt_main (void) -{ - abc: dfc00015 stw ra,0(sp) -#endif - - /* ALT LOG - please see HAL/sys/alt_log_printf.h for details */ - ALT_LOG_PRINT_BOOT("[alt_main.c] Entering alt_main, calling alt_irq_init.\r\n"); - /* Initialize the interrupt controller. */ - alt_irq_init (NULL); - ac0: 0000c780 call c78 - ALT_LOG_PRINT_BOOT("[alt_main.c] Done OS Init, calling alt_sem_create.\r\n"); - ALT_SEM_CREATE (&alt_fd_list_lock, 1); - - /* Initialize the device drivers/software components. */ - ALT_LOG_PRINT_BOOT("[alt_main.c] Calling alt_sys_init.\r\n"); - alt_sys_init(); - ac4: 0000c740 call c74 - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Calling main.\r\n"); - -#ifdef ALT_NO_EXIT - main (alt_argc, alt_argv, alt_envp); - ac8: d1200617 ldw r4,-32744(gp) - acc: d1600717 ldw r5,-32740(gp) - ad0: d1a00817 ldw r6,-32736(gp) - close(STDOUT_FILENO); - exit (result); -#endif - - ALT_LOG_PRINT_BOOT("[alt_main.c] After main - we should not be here?.\r\n"); -} - ad4: dfc00017 ldw ra,0(sp) - ad8: dec00104 addi sp,sp,4 - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Calling main.\r\n"); - -#ifdef ALT_NO_EXIT - main (alt_argc, alt_argv, alt_envp); - adc: 00000e01 jmpi e0
- -00000ae0 : -/* - * ALT printf function - */ -void -alt_printf(const char* fmt, ... ) -{ - ae0: defff804 addi sp,sp,-32 - ae4: dfc00415 stw ra,16(sp) - ae8: dc800315 stw r18,12(sp) - aec: dc400215 stw r17,8(sp) - af0: dc000115 stw r16,4(sp) - af4: d9400515 stw r5,20(sp) - af8: d9800615 stw r6,24(sp) - afc: d9c00715 stw r7,28(sp) - va_list args; - va_start(args, fmt); - b00: d8800504 addi r2,sp,20 - b04: 2025883a mov r18,r4 - b08: d8800015 stw r2,0(sp) - b0c: 00003d06 br c04 - w = fmt; - while ((c = *w++) != 0) - { - /* If not a format escape character, just print */ - /* character. Otherwise, process format string. */ - if (c != '%') - b10: 00800944 movi r2,37 - const char *w; - char c; - - /* Process format string. */ - w = fmt; - while ((c = *w++) != 0) - b14: 94800044 addi r18,r18,1 - { - /* If not a format escape character, just print */ - /* character. Otherwise, process format string. */ - if (c != '%') - b18: 18800226 beq r3,r2,b24 - { - alt_putchar(c); - b1c: 1809883a mov r4,r3 - b20: 00000a06 br b4c - } - else - { - /* Get format character. If none */ - /* available, processing is complete. */ - if ((c = *w++) != 0) - b24: 91000007 ldb r4,0(r18) - b28: 94800044 addi r18,r18,1 - b2c: 20003726 beq r4,zero,c0c - { - if (c == '%') - b30: 20c00626 beq r4,r3,b4c - { - /* Process "%" escape sequence. */ - alt_putchar(c); - } - else if (c == 'c') - b34: 008018c4 movi r2,99 - b38: 2080061e bne r4,r2,b54 - { - int v = va_arg(args, int); - b3c: d8800017 ldw r2,0(sp) - alt_putchar(v); - b40: 11000017 ldw r4,0(r2) - /* Process "%" escape sequence. */ - alt_putchar(c); - } - else if (c == 'c') - { - int v = va_arg(args, int); - b44: 10800104 addi r2,r2,4 - b48: d8800015 stw r2,0(sp) - alt_putchar(v); - b4c: 0000c240 call c24 - b50: 00002c06 br c04 - } - else if (c == 'x') - b54: 00801e04 movi r2,120 - b58: 20801e1e bne r4,r2,bd4 - { - /* Process hexadecimal number format. */ - unsigned long v = va_arg(args, unsigned long); - b5c: d8800017 ldw r2,0(sp) - b60: 14400017 ldw r17,0(r2) - b64: 10800104 addi r2,r2,4 - b68: d8800015 stw r2,0(sp) - unsigned long digit; - int digit_shift; - - /* If the number value is zero, just print and continue. */ - if (v == 0) - b6c: 88000226 beq r17,zero,b78 - b70: 04000704 movi r16,28 - b74: 00000306 br b84 - { - alt_putchar('0'); - b78: 01000c04 movi r4,48 - b7c: 003ff306 br b4c - } - - /* Find first non-zero digit. */ - digit_shift = 28; - while (!(v & (0xF << digit_shift))) - digit_shift -= 4; - b80: 843fff04 addi r16,r16,-4 - continue; - } - - /* Find first non-zero digit. */ - digit_shift = 28; - while (!(v & (0xF << digit_shift))) - b84: 008003c4 movi r2,15 - b88: 1404983a sll r2,r2,r16 - b8c: 8884703a and r2,r17,r2 - b90: 103ffb26 beq r2,zero,b80 - b94: 00000b06 br bc4 - digit_shift -= 4; - - /* Print digits. */ - for (; digit_shift >= 0; digit_shift -= 4) - { - digit = (v & (0xF << digit_shift)) >> digit_shift; - b98: 8884703a and r2,r17,r2 - b9c: 1406d83a srl r3,r2,r16 - if (digit <= 9) - ba0: 00800244 movi r2,9 - c = '0' + digit; - ba4: 19000c04 addi r4,r3,48 - - /* Print digits. */ - for (; digit_shift >= 0; digit_shift -= 4) - { - digit = (v & (0xF << digit_shift)) >> digit_shift; - if (digit <= 9) - ba8: 10c0012e bgeu r2,r3,bb0 - c = '0' + digit; - else - c = 'a' + digit - 10; - bac: 190015c4 addi r4,r3,87 - alt_putchar(c); - bb0: 21003fcc andi r4,r4,255 - bb4: 2100201c xori r4,r4,128 - bb8: 213fe004 addi r4,r4,-128 - digit_shift = 28; - while (!(v & (0xF << digit_shift))) - digit_shift -= 4; - - /* Print digits. */ - for (; digit_shift >= 0; digit_shift -= 4) - bbc: 843fff04 addi r16,r16,-4 - digit = (v & (0xF << digit_shift)) >> digit_shift; - if (digit <= 9) - c = '0' + digit; - else - c = 'a' + digit - 10; - alt_putchar(c); - bc0: 0000c240 call c24 - digit_shift -= 4; - - /* Print digits. */ - for (; digit_shift >= 0; digit_shift -= 4) - { - digit = (v & (0xF << digit_shift)) >> digit_shift; - bc4: 008003c4 movi r2,15 - bc8: 1404983a sll r2,r2,r16 - digit_shift = 28; - while (!(v & (0xF << digit_shift))) - digit_shift -= 4; - - /* Print digits. */ - for (; digit_shift >= 0; digit_shift -= 4) - bcc: 803ff20e bge r16,zero,b98 - bd0: 00000c06 br c04 - else - c = 'a' + digit - 10; - alt_putchar(c); - } - } - else if (c == 's') - bd4: 00801cc4 movi r2,115 - bd8: 20800a1e bne r4,r2,c04 - { - /* Process string format. */ - char *s = va_arg(args, char *); - bdc: d8800017 ldw r2,0(sp) - be0: 14000017 ldw r16,0(r2) - be4: 10800104 addi r2,r2,4 - be8: d8800015 stw r2,0(sp) - bec: 00000106 br bf4 - - while(*s) - alt_putchar(*s++); - bf0: 0000c240 call c24 - else if (c == 's') - { - /* Process string format. */ - char *s = va_arg(args, char *); - - while(*s) - bf4: 80800007 ldb r2,0(r16) - alt_putchar(*s++); - bf8: 84000044 addi r16,r16,1 - bfc: 1009883a mov r4,r2 - else if (c == 's') - { - /* Process string format. */ - char *s = va_arg(args, char *); - - while(*s) - c00: 103ffb1e bne r2,zero,bf0 - const char *w; - char c; - - /* Process format string. */ - w = fmt; - while ((c = *w++) != 0) - c04: 90c00007 ldb r3,0(r18) - c08: 183fc11e bne r3,zero,b10 - { - break; - } - } - } -} - c0c: dfc00417 ldw ra,16(sp) - c10: dc800317 ldw r18,12(sp) - c14: dc400217 ldw r17,8(sp) - c18: dc000117 ldw r16,4(sp) - c1c: dec00804 addi sp,sp,32 - c20: f800283a ret - -00000c24 : - * Uses the ALT_DRIVER_WRITE() macro to call directly to driver if available. - * Otherwise, uses newlib provided putchar() routine. - */ -int -alt_putchar(int c) -{ - c24: defffd04 addi sp,sp,-12 - c28: dc000115 stw r16,4(sp) -#ifdef ALT_USE_DIRECT_DRIVERS - ALT_DRIVER_WRITE_EXTERNS(ALT_STDOUT_DEV); - char c1 = (char)(c & 0xff); - - if (ALT_DRIVER_WRITE(ALT_STDOUT_DEV, &c1, 1, 0) == -1) { - c2c: d80b883a mov r5,sp - * Uses the ALT_DRIVER_WRITE() macro to call directly to driver if available. - * Otherwise, uses newlib provided putchar() routine. - */ -int -alt_putchar(int c) -{ - c30: 2021883a mov r16,r4 -#ifdef ALT_USE_DIRECT_DRIVERS - ALT_DRIVER_WRITE_EXTERNS(ALT_STDOUT_DEV); - char c1 = (char)(c & 0xff); - - if (ALT_DRIVER_WRITE(ALT_STDOUT_DEV, &c1, 1, 0) == -1) { - c34: 01800044 movi r6,1 - c38: 01000034 movhi r4,0 - c3c: 2103e304 addi r4,r4,3980 - c40: 000f883a mov r7,zero - * Uses the ALT_DRIVER_WRITE() macro to call directly to driver if available. - * Otherwise, uses newlib provided putchar() routine. - */ -int -alt_putchar(int c) -{ - c44: dfc00215 stw ra,8(sp) -#ifdef ALT_USE_DIRECT_DRIVERS - ALT_DRIVER_WRITE_EXTERNS(ALT_STDOUT_DEV); - char c1 = (char)(c & 0xff); - c48: dc000005 stb r16,0(sp) - - if (ALT_DRIVER_WRITE(ALT_STDOUT_DEV, &c1, 1, 0) == -1) { - c4c: 0000c980 call c98 - c50: 1009883a mov r4,r2 - c54: 00bfffc4 movi r2,-1 - c58: 2080011e bne r4,r2,c60 - c5c: 2021883a mov r16,r4 - } - return c; -#else - return putchar(c); -#endif -} - c60: 8005883a mov r2,r16 - c64: dfc00217 ldw ra,8(sp) - c68: dc000117 ldw r16,4(sp) - c6c: dec00304 addi sp,sp,12 - c70: f800283a ret - -00000c74 : - */ - -void alt_sys_init( void ) -{ - ALTERA_AVALON_JTAG_UART_INIT ( JTAG_UART, jtag_uart); -} - c74: f800283a ret - -00000c78 : - * The "base" parameter is ignored and only - * present for backwards-compatibility. - */ - -void alt_irq_init ( const void* base ) -{ - c78: deffff04 addi sp,sp,-4 - c7c: dfc00015 stw ra,0(sp) - ALTERA_NIOS2_QSYS_IRQ_INIT ( NIOS2_PROCESSOR, nios2_processor); - c80: 0000cd40 call cd4 - * alt_irq_cpu_enable_interrupts() enables the CPU to start taking interrupts. - */ -static ALT_INLINE void ALT_ALWAYS_INLINE - alt_irq_cpu_enable_interrupts () -{ - NIOS2_WRITE_STATUS(NIOS2_STATUS_PIE_MSK - c84: 00800044 movi r2,1 - c88: 1001703a wrctl status,r2 - alt_irq_cpu_enable_interrupts(); -} - c8c: dfc00017 ldw ra,0(sp) - c90: dec00104 addi sp,sp,4 - c94: f800283a ret - -00000c98 : - */ - -int altera_avalon_jtag_uart_write(altera_avalon_jtag_uart_state* sp, - const char * ptr, int count, int flags) -{ - unsigned int base = sp->base; - c98: 21000017 ldw r4,0(r4) - - const char * end = ptr + count; - c9c: 298f883a add r7,r5,r6 - ca0: 20c00104 addi r3,r4,4 - ca4: 00000606 br cc0 - - while (ptr < end) - if ((IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base) & ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_MSK) != 0) - ca8: 18800037 ldwio r2,0(r3) - cac: 10bfffec andhi r2,r2,65535 - cb0: 10000326 beq r2,zero,cc0 - IOWR_ALTERA_AVALON_JTAG_UART_DATA(base, *ptr++); - cb4: 28800007 ldb r2,0(r5) - cb8: 29400044 addi r5,r5,1 - cbc: 20800035 stwio r2,0(r4) -{ - unsigned int base = sp->base; - - const char * end = ptr + count; - - while (ptr < end) - cc0: 29fff936 bltu r5,r7,ca8 - if ((IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base) & ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_MSK) != 0) - IOWR_ALTERA_AVALON_JTAG_UART_DATA(base, *ptr++); - - return count; -} - cc4: 3005883a mov r2,r6 - cc8: f800283a ret - -00000ccc : - for (i = (char*) 0; i < (char*) NIOS2_DCACHE_SIZE; i+= NIOS2_DCACHE_LINE_SIZE) - { - __asm__ volatile ("flushd (%0)" :: "r" (i)); - } -#endif /* NIOS2_DCACHE_SIZE > 0 */ -} - ccc: f800283a ret - -00000cd0 : -void alt_icache_flush_all (void) -{ -#if NIOS2_ICACHE_SIZE > 0 - alt_icache_flush (0, NIOS2_ICACHE_SIZE); -#endif -} - cd0: f800283a ret - -00000cd4 : - * To initialize the internal interrupt controller, just clear the IENABLE - * register so that all possible IRQs are disabled. - */ -void altera_nios2_qsys_irq_init(void) -{ - NIOS2_WRITE_IENABLE(0); - cd4: 000170fa wrctl ienable,zero -} - cd8: f800283a ret diff --git a/software/qsys_tutorial_hexs/readme.txt b/software/qsys_tutorial_hexs/readme.txt deleted file mode 100644 index 3dc3186..0000000 --- a/software/qsys_tutorial_hexs/readme.txt +++ /dev/null @@ -1,67 +0,0 @@ -Readme - Hello World Software Example - -DESCRIPTION: -Simple program that prints "Hello from Nios II" - -The purpose of this example is to demonstrate the smallest possible Hello -World application, using the Nios II HAL BSP. The memory footprint -of this hosted application is intended to be less than 1 kbytes by default using a standard -reference design. For a more fully featured Hello World application -example, see the example titled "Hello World". - -The memory footprint of this example has been reduced by making the -following changes to the normal "Hello World" example. -Check in the Nios II Software Developers Handbook for a more complete -description. - -In the SW Application project: - - In the C/C++ Build page - - Set the Optimization Level to -Os - -In BSP project: - - In the C/C++ Build page - - - Set the Optimization Level to -Os - - - Define the preprocessor option ALT_NO_INSTRUCTION_EMULATION - This removes software exception handling, which means that you cannot - run code compiled for Nios II cpu with a hardware multiplier on a core - without a the multiply unit. Check the Nios II Software Developers - Manual for more details. - - - In the BSP: - - Set Periodic system timer and Timestamp timer to none - This prevents the automatic inclusion of the timer driver. - - - Set Max file descriptors to 4 - This reduces the size of the file handle pool. - - - Uncheck Clean exit (flush buffers) - This removes the call to exit, and when main is exitted instead of - calling exit the software will just spin in a loop. - - - Check Small C library - This uses a reduced functionality C library, which lacks - support for buffering, file IO, floating point and getch(), etc. - Check the Nios II Software Developers Manual for a complete list. - - - Check Reduced device drivers - This uses reduced functionality drivers if they're available. For the - standard design this means you get polled UART and JTAG UART drivers, - no support for the LCD driver and you lose the ability to program - CFI compliant flash devices. - - -PERIPHERALS USED: -This example exercises the following peripherals: -- STDOUT device (UART or JTAG UART) - -SOFTWARE SOURCE FILES: -This example includes the following software source files: -- small_hello_world.c: - -BOARD/HOST REQUIREMENTS: -This example requires only a JTAG connection with a Nios Development board. If -the host communication settings are changed from JTAG UART (default) to use a -conventional UART, a serial cable between board DB-9 connector and the host is -required. diff --git a/software/qsys_tutorial_hexs/sys_memory.c b/software/qsys_tutorial_hexs/sys_memory.c deleted file mode 100644 index 06f42aa..0000000 --- a/software/qsys_tutorial_hexs/sys_memory.c +++ /dev/null @@ -1,48 +0,0 @@ -/* - * sys_memory.c - * - * Created on: 2016/11/24 - * Author: takayun - */ -#include "system.h" -#include "sys_memory.h" -#include "sys_register.h" - -/************************************************** - * Public - **************************************************/ - -// �����������̂ǂ̃�������(0 < global_current_memory < MEMS_COUNT) -unsigned int global_current_memory = 0; - -/************************************************** - * Private - **************************************************/ - -// �����������̕ϐ� -static char memory[MEMS_COUNT][MEM_SIZE]; - -/************************************************** - * Impl - **************************************************/ - -void memory_init() { - int i, j; - for (i = 0; i < MEMS_COUNT; i++) - for (j = 0; j < MEM_SIZE; j++) { - memory[i][j] = 0; - } -} - -char memory_store(unsigned int mem_addr, enum Register reg) { - if (!(mem_addr < MEM_SIZE)) panic(); - memory[global_current_memory][mem_addr] = global_registers[reg]; - return memory[global_current_memory][mem_addr]; -} - -char memory_load(unsigned int mem_addr, enum Register reg) { - if (!(mem_addr < MEM_SIZE)) panic(); - global_registers[reg] = memory[global_current_memory][mem_addr]; - return global_registers[reg]; -} - diff --git a/software/qsys_tutorial_hexs/sys_memory.h b/software/qsys_tutorial_hexs/sys_memory.h deleted file mode 100644 index 69a3e7a..0000000 --- a/software/qsys_tutorial_hexs/sys_memory.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * sys_memory.h - * - * Created on: 2016/11/24 - * Author: takayun - */ - -#ifndef SYS_MEMORY_H_ -#define SYS_MEMORY_H_ - -#include "sys_register.h" - -/************************************************** - * Defines - **************************************************/ - -// �������̐� -#define MEMS_COUNT 4 - -// 1�������̃T�C�Y -#define MEM_SIZE 16 - -/************************************************** - * Variables - **************************************************/ - -extern unsigned int global_current_memory; - -/************************************************** - * Functions - **************************************************/ - -/* Function: memory_init - * Sammary: - * ������������������(All 0) */ -void memory_init(); - -/* Function: memory_store -> char - * Sammary: - * �������̎w��Ԓn�Ɏw�肵�����W�X�^����l���i�[���� - * Return: - * �������Ɋi�[���ꂽ�l */ -char memory_store(unsigned int mem_addr, enum Register reg); - -/* Function: memory_store -> char - * Sammary: - * �w�肵�����W�X�^�Ƀ������̎w��Ԓn����l���i�[���� - * Return: - * ���W�X�^�Ɋi�[���ꂽ�l */ -char memory_load(unsigned int mem_addr, enum Register reg); - - -#endif /* SYS_MEMORY_H_ */ diff --git a/software/qsys_tutorial_hexs/sys_register.c b/software/qsys_tutorial_hexs/sys_register.c deleted file mode 100644 index 84ed485..0000000 --- a/software/qsys_tutorial_hexs/sys_register.c +++ /dev/null @@ -1,17 +0,0 @@ -/* - * sys_register.c - * - * Created on: 2016/11/24 - * Author: takayun - */ -#include "sys_register.h" - -char global_registers[REG_MAX_COUNT]; - -void registers_init() { - int i; - for (i = 0; i < REG_MAX_COUNT; i++) global_registers[i] = 0; -} - - - diff --git a/software/qsys_tutorial_hexs/sys_register.h b/software/qsys_tutorial_hexs/sys_register.h deleted file mode 100644 index 42c03ac..0000000 --- a/software/qsys_tutorial_hexs/sys_register.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * sys_register.h - * - * Created on: 2016/11/24 - * Author: takayun - */ - -#ifndef SYS_REGISTER_H_ -#define SYS_REGISTER_H_ - -/************************************************** - * Defines - **************************************************/ - -// ���W�X�^�̒�` -enum Register { - /* �ʏ�̃��W�X�^ */ - Spc, //�v���O�����J�E���^ - Ssp, //�X�^�b�N�|�C���^ - Sgp0, //�ėp���W�X�^0 - Sgp1, //�ėp���W�X�^1 - Sacc, //�A�L�������[�^ - Sflg, //�t���O���W�X�^ - /* �X�C�b�`�ǂݏo���p���W�X�^ */ - Ssw_data, //�f�[�^(8bit) - Ssw_inst, //����(4bit) - Ssw_memi, //�������Ԓn(4bit) - Ssw_regi, //���W�X�^�ԍ�(4bit) - Ssw_psel, //�v���O�����Z���N�^(4bit) - Ssw_rw, //�ǂݏ������[�h(1bit) - Ssw_run, //���s���[�h(1bit) - - /* �z��錾�p */ - REG_MAX_COUNT -}; - -/************************************************** - * Variables - **************************************************/ - -// ���W�X�^�p�̕ϐ� -extern char global_registers[REG_MAX_COUNT]; - -/************************************************** - * Functions - **************************************************/ - -void registers_init(); - - -#endif /* SYS_REGISTER_H_ */ diff --git a/software/qsys_tutorial_hexs/system.c b/software/qsys_tutorial_hexs/system.c deleted file mode 100644 index 30713dd..0000000 --- a/software/qsys_tutorial_hexs/system.c +++ /dev/null @@ -1,14 +0,0 @@ -/* - * system.c - * - * Created on: 2016/11/24 - * Author: takayun - */ -#include "system.h" -#include "hex_out.h" - -void panic() { - clear_block(HEX0_3); - print_block("err ", 4, HEX0_3); -} - diff --git a/software/qsys_tutorial_hexs/system.h b/software/qsys_tutorial_hexs/system.h deleted file mode 100644 index 1a628fa..0000000 --- a/software/qsys_tutorial_hexs/system.h +++ /dev/null @@ -1,13 +0,0 @@ -/* - * system.h - * - * Created on: 2016/11/24 - * Author: takayun - */ - -#ifndef SYSTEM_H_ -#define SYSTEM_H_ - -void panic(); - -#endif /* SYSTEM_H_ */ diff --git a/software/qsys_tutorial_hexs/system/template.xml b/software/qsys_tutorial_hexs/system/template.xml deleted file mode 100644 index b09e912..0000000 --- a/software/qsys_tutorial_hexs/system/template.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git a/software/qsys_tutorial_hexs_bsp/.cproject b/software/qsys_tutorial_hexs_bsp/.cproject deleted file mode 100644 index 2ab0c0b..0000000 --- a/software/qsys_tutorial_hexs_bsp/.cproject +++ /dev/null @@ -1,481 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/software/qsys_tutorial_hexs_bsp/.project b/software/qsys_tutorial_hexs_bsp/.project deleted file mode 100644 index 28798d4..0000000 --- a/software/qsys_tutorial_hexs_bsp/.project +++ /dev/null @@ -1,85 +0,0 @@ - - - qsys_tutorial_hexs_bsp - - - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - ?name? - - - - org.eclipse.cdt.make.core.append_environment - true - - - org.eclipse.cdt.make.core.autoBuildTarget - all - - - org.eclipse.cdt.make.core.buildArguments - - - - org.eclipse.cdt.make.core.buildCommand - make - - - org.eclipse.cdt.make.core.buildLocation - ${workspace_loc://qsys_tutorial_hexs_bsp} - - - org.eclipse.cdt.make.core.cleanBuildTarget - clean - - - org.eclipse.cdt.make.core.contents - org.eclipse.cdt.make.core.activeConfigSettings - - - org.eclipse.cdt.make.core.enableAutoBuild - false - - - org.eclipse.cdt.make.core.enableCleanBuild - true - - - org.eclipse.cdt.make.core.enableFullBuild - true - - - org.eclipse.cdt.make.core.fullBuildTarget - all - - - org.eclipse.cdt.make.core.stopOnError - true - - - org.eclipse.cdt.make.core.useDefaultBuildCmd - true - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - org.eclipse.cdt.core.ccnature - com.altera.sbtgui.project.SBTGUINature - com.altera.sbtgui.project.SBTGUIBspNature - - diff --git a/software/qsys_tutorial_hexs_bsp/HAL/inc/alt_types.h b/software/qsys_tutorial_hexs_bsp/HAL/inc/alt_types.h deleted file mode 100644 index d02f171..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/inc/alt_types.h +++ /dev/null @@ -1,54 +0,0 @@ -#ifndef __ALT_TYPES_H__ -#define __ALT_TYPES_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/* - * Don't declare these typedefs if this file is included by assembly source. - */ -#ifndef ALT_ASM_SRC -typedef signed char alt_8; -typedef unsigned char alt_u8; -typedef signed short alt_16; -typedef unsigned short alt_u16; -typedef signed long alt_32; -typedef unsigned long alt_u32; -typedef long long alt_64; -typedef unsigned long long alt_u64; -#endif - -#define ALT_INLINE __inline__ -#define ALT_ALWAYS_INLINE __attribute__ ((always_inline)) -#define ALT_WEAK __attribute__((weak)) - -#endif /* __ALT_TYPES_H__ */ diff --git a/software/qsys_tutorial_hexs_bsp/HAL/inc/altera_nios2_qsys_irq.h b/software/qsys_tutorial_hexs_bsp/HAL/inc/altera_nios2_qsys_irq.h deleted file mode 100644 index 6629ec9..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/inc/altera_nios2_qsys_irq.h +++ /dev/null @@ -1,80 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * Support for the Nios II internal interrupt controller. - */ - -#ifndef __ALT_NIOS2_QSYS_IRQ_H__ -#define __ALT_NIOS2_QSYS_IRQ_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The macro ALTERA_NIOS2_IRQ_INSTANCE is used by the alt_irq_init() - * function in the auto-generated file alt_sys_init.c to create an - * instance of this interrupt controller device driver state if this - * module contains an interrupt controller. - * Only one instance of a Nios II is allowed so this macro is just empty. - */ - -#define ALTERA_NIOS2_QSYS_IRQ_INSTANCE(name, state) - -/* - * altera_nios2_irq_init() is called by the auto-generated function - * alt_irq_init() once for the Nios II if it contains an interrupt controller. - * The altera_nios2_irq_init() routine is called using the - * ALTERA_NIOS2_IRQ_INIT macro given below. - * - * This function initializes the internal interrupt controller - * so is not called if the Nios II contains an external interrupt - * controller port (because the internal interrupt controller - * is removed if this port is present). - */ - -extern void altera_nios2_qsys_irq_init( void ); - -/* - * The macro ALTERA_NIOS2_IRQ_INIT is used by the alt_irq_init() routine - * in the auto-generated file alt_sys_init.c to initialize an instance - * of the interrupt controller device driver state. - */ - -#define ALTERA_NIOS2_QSYS_IRQ_INIT(name, state) altera_nios2_qsys_irq_init() - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_NIOS2_QSYS_IRQ_H__ */ - diff --git a/software/qsys_tutorial_hexs_bsp/HAL/inc/io.h b/software/qsys_tutorial_hexs_bsp/HAL/inc/io.h deleted file mode 100644 index 362f103..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/inc/io.h +++ /dev/null @@ -1,81 +0,0 @@ -#ifndef __IO_H__ -#define __IO_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/* IO Header file for Nios II Toolchain */ - -#include "alt_types.h" -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#ifndef SYSTEM_BUS_WIDTH -#error SYSTEM_BUS_WIDTH undefined -#endif - -/* Dynamic bus access functions */ - -#define __IO_CALC_ADDRESS_DYNAMIC(BASE, OFFSET) \ - ((void *)(((alt_u8*)BASE) + (OFFSET))) - -#define IORD_32DIRECT(BASE, OFFSET) \ - __builtin_ldwio (__IO_CALC_ADDRESS_DYNAMIC ((BASE), (OFFSET))) -#define IORD_16DIRECT(BASE, OFFSET) \ - __builtin_ldhuio (__IO_CALC_ADDRESS_DYNAMIC ((BASE), (OFFSET))) -#define IORD_8DIRECT(BASE, OFFSET) \ - __builtin_ldbuio (__IO_CALC_ADDRESS_DYNAMIC ((BASE), (OFFSET))) - -#define IOWR_32DIRECT(BASE, OFFSET, DATA) \ - __builtin_stwio (__IO_CALC_ADDRESS_DYNAMIC ((BASE), (OFFSET)), (DATA)) -#define IOWR_16DIRECT(BASE, OFFSET, DATA) \ - __builtin_sthio (__IO_CALC_ADDRESS_DYNAMIC ((BASE), (OFFSET)), (DATA)) -#define IOWR_8DIRECT(BASE, OFFSET, DATA) \ - __builtin_stbio (__IO_CALC_ADDRESS_DYNAMIC ((BASE), (OFFSET)), (DATA)) - -/* Native bus access functions */ - -#define __IO_CALC_ADDRESS_NATIVE(BASE, REGNUM) \ - ((void *)(((alt_u8*)BASE) + ((REGNUM) * (SYSTEM_BUS_WIDTH/8)))) - -#define IORD(BASE, REGNUM) \ - __builtin_ldwio (__IO_CALC_ADDRESS_NATIVE ((BASE), (REGNUM))) -#define IOWR(BASE, REGNUM, DATA) \ - __builtin_stwio (__IO_CALC_ADDRESS_NATIVE ((BASE), (REGNUM)), (DATA)) - -#ifdef __cplusplus -} -#endif - -#endif /* __IO_H__ */ diff --git a/software/qsys_tutorial_hexs_bsp/HAL/inc/nios2.h b/software/qsys_tutorial_hexs_bsp/HAL/inc/nios2.h deleted file mode 100644 index 72cefba..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/inc/nios2.h +++ /dev/null @@ -1,230 +0,0 @@ -#ifndef __NIOS2_H__ -#define __NIOS2_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2008 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * This header provides processor specific macros for accessing the Nios2 - * control registers. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * Macros for accessing selected processor registers - */ - -#define NIOS2_READ_ET(et) \ - do { __asm ("mov %0, et" : "=r" (et) ); } while (0) - -#define NIOS2_WRITE_ET(et) \ - do { __asm volatile ("mov et, %z0" : : "rM" (et)); } while (0) - -#define NIOS2_READ_SP(sp) \ - do { __asm ("mov %0, sp" : "=r" (sp) ); } while (0) - -/* - * Macros for useful processor instructions - */ - -#define NIOS2_BREAK() \ - do { __asm volatile ("break"); } while (0) - -#define NIOS2_REPORT_STACK_OVERFLOW() \ - do { __asm volatile("break 3"); } while (0) - -/* - * Macros for accessing the control registers. - */ - -#define NIOS2_READ_STATUS(dest) \ - do { dest = __builtin_rdctl(0); } while (0) - -#define NIOS2_WRITE_STATUS(src) \ - do { __builtin_wrctl(0, src); } while (0) - -#define NIOS2_READ_ESTATUS(dest) \ - do { dest = __builtin_rdctl(1); } while (0) - -#define NIOS2_READ_BSTATUS(dest) \ - do { dest = __builtin_rdctl(2); } while (0) - -#define NIOS2_READ_IENABLE(dest) \ - do { dest = __builtin_rdctl(3); } while (0) - -#define NIOS2_WRITE_IENABLE(src) \ - do { __builtin_wrctl(3, src); } while (0) - -#define NIOS2_READ_IPENDING(dest) \ - do { dest = __builtin_rdctl(4); } while (0) - -#define NIOS2_READ_CPUID(dest) \ - do { dest = __builtin_rdctl(5); } while (0) - - -/* - * Macros for accessing extra exception registers. These - * are always enabled wit the MPU or MMU, and optionally - * with other advanced exception types/ - */ -#define NIOS2_READ_EXCEPTION(dest) \ - do { dest = __builtin_rdctl(7); } while (0) - -#define NIOS2_READ_BADADDR(dest) \ - do { dest = __builtin_rdctl(12); } while (0) - - -/* - * Macros for accessing control registers for MPU - * operation. These should not be used unless the - * MPU is enabled. - * - * The config register may be augmented for future - * enhancements. For now, only MPU support is provided. - */ -/* Config register */ -#define NIOS2_WRITE_CONFIG(src) \ - do { __builtin_wrctl(13, src); } while (0) - -#define NIOS2_READ_CONFIG(dest) \ - do { dest = __builtin_rdctl(13); } while (0) - -/* MPU Base Address Register */ -#define NIOS2_WRITE_MPUBASE(src) \ - do { __builtin_wrctl(14, src); } while (0) - -#define NIOS2_READ_MPUBASE(dest) \ - do { dest = __builtin_rdctl(14); } while (0) - -/* MPU Access Register */ -#define NIOS2_WRITE_MPUACC(src) \ - do { __builtin_wrctl(15, src); } while (0) - -#define NIOS2_READ_MPUACC(dest) \ - do { dest = __builtin_rdctl(15); } while (0) - - -/* - * Nios II control registers that are always present - */ -#define NIOS2_STATUS status -#define NIOS2_ESTATUS estatus -#define NIOS2_BSTATUS bstatus -#define NIOS2_IENABLE ienable -#define NIOS2_IPENDING ipending -#define NIOS2_CPUID cpuid - -/* - * STATUS, BSTATUS, ESTATUS, and SSTATUS fields. - * The presence of fields is a function of the Nios II configuration. - */ -#define NIOS2_STATUS_PIE_MSK (0x00000001) -#define NIOS2_STATUS_PIE_OFST (0) -#define NIOS2_STATUS_U_MSK (0x00000002) -#define NIOS2_STATUS_U_OFST (1) -#define NIOS2_STATUS_EH_MSK (0x00000004) -#define NIOS2_STATUS_EH_OFST (2) -#define NIOS2_STATUS_IH_MSK (0x00000008) -#define NIOS2_STATUS_IH_OFST (3) -#define NIOS2_STATUS_IL_MSK (0x000003f0) -#define NIOS2_STATUS_IL_OFST (4) -#define NIOS2_STATUS_CRS_MSK (0x0000fc00) -#define NIOS2_STATUS_CRS_OFST (10) -#define NIOS2_STATUS_PRS_MSK (0x003f0000) -#define NIOS2_STATUS_PRS_OFST (16) -#define NIOS2_STATUS_NMI_MSK (0x00400000) -#define NIOS2_STATUS_NMI_OFST (22) -#define NIOS2_STATUS_RSIE_MSK (0x00800000) -#define NIOS2_STATUS_RSIE_OFST (23) -#define NIOS2_STATUS_SRS_MSK (0x80000000) -#define NIOS2_STATUS_SRS_OFST (31) - -/* - * Bit masks & offsets available with extra exceptions support - */ - -/* Exception register */ -#define NIOS2_EXCEPTION_REG_CAUSE_MASK (0x0000007c) -#define NIOS2_EXCEPTION_REG_CAUSE_OFST (2) - -/* - * Bit masks & offsets for MPU support - * - * All bit-masks are expressed relative to the position - * of the data with a register. To read data that is LSB- - * aligned, the register read data should be masked, then - * right-shifted by the designated "OFST" macro value. The - * opposite should be used for register writes when starting - * with LSB-aligned data. - */ - -/* Config register */ -#define NIOS2_CONFIG_REG_PE_MASK (0x00000001) -#define NIOS2_CONFIG_REG_PE_OFST (0) -#define NIOS2_CONFIG_REG_ANI_MASK (0x00000002) -#define NIOS2_CONFIG_REG_ANI_OFST (1) - -/* MPU Base Address Register */ -#define NIOS2_MPUBASE_D_MASK (0x00000001) -#define NIOS2_MPUBASE_D_OFST (0) -#define NIOS2_MPUBASE_INDEX_MASK (0x0000003e) -#define NIOS2_MPUBASE_INDEX_OFST (1) -#define NIOS2_MPUBASE_BASE_ADDR_MASK (0xffffffc0) -#define NIOS2_MPUBASE_BASE_ADDR_OFST (6) - -/* MPU Access Register */ -#define NIOS2_MPUACC_LIMIT_MASK (0xffffffc0) -#define NIOS2_MPUACC_LIMIT_OFST (6) -#define NIOS2_MPUACC_MASK_MASK (0xffffffc0) -#define NIOS2_MPUACC_MASK_OFST (6) -#define NIOS2_MPUACC_C_MASK (0x00000020) -#define NIOS2_MPUACC_C_OFST (5) -#define NIOS2_MPUACC_PERM_MASK (0x0000001c) -#define NIOS2_MPUACC_PERM_OFST (2) -#define NIOS2_MPUACC_RD_MASK (0x00000002) -#define NIOS2_MPUACC_RD_OFST (1) -#define NIOS2_MPUACC_WR_MASK (0x00000001) -#define NIOS2_MPUACC_WR_OFST (0) - -/* - * Number of available IRQs in internal interrupt controller. - */ -#define NIOS2_NIRQ 32 - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __NIOS2_H__ */ diff --git a/software/qsys_tutorial_hexs_bsp/HAL/inc/os/alt_flag.h b/software/qsys_tutorial_hexs_bsp/HAL/inc/os/alt_flag.h deleted file mode 100644 index b9b4605..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/inc/os/alt_flag.h +++ /dev/null @@ -1,98 +0,0 @@ -#ifndef __ALT_FLAG_H__ -#define __ALT_FLAG_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * This header provides macro definitions that can be used to create and use - * uc/OS-II style event flags. These macros can be used in both a uC/OS-II based - * environment, and a single threaded HAL based environment. - * - * The motivation for these macros is to allow code to be developed which is - * thread safe under uC/OS-II, but incurs no additional overhead when used in a - * single threaded HAL environment. - * - * In the case of a single threaded HAL environment, they compile to - * "do nothing" directives, which ensures they do not contribute to the final - * executable. - * - * The following macros are available: - * - * ALT_FLAG_GRP - Create a flag group instance. - * ALT_EXTERN_FLAG_GRP - Create a reference to an external flag group instance. - * ALT_STATIC_FLAG_GRP - Create a static flag group instance. - * ALT_FLAG_CREATE - Initialise a flag group. - * ALT_FLAG_PEND - Pend on a flag group. - * ALT_FLAG_POST - Set a flag condition. - - * - * Input arguments and return codes are all consistant with the equivalent - * uC/OS-II function. - * - * It's important to be careful in the use of the macros: ALT_FLAG_GRP, - * ALT_EXTERN_FLAG_GRP, and ALT_STATIC_FLAG_GRP. In these three cases the - * semi-colon is included in the macro definition; so, for example, you should - * use: - * - * ALT_FLAG_GRP(mygroup) - * - * not: - * - * ALT_FLAG_GRP(mygroup); - * - * The inclusion of the semi-colon has been necessary to ensure the macros can - * compile with no warnings when used in a single threaded HAL environment. - * - */ - -#include "priv/alt_no_error.h" - -#define ALT_FLAG_GRP(group) -#define ALT_EXTERN_FLAG_GRP(group) -#define ALT_STATIC_FLAG_GRP(group) - -#define ALT_FLAG_CREATE(group, flags) alt_no_error () -#define ALT_FLAG_PEND(group, flags, wait_type, timeout) alt_no_error () -#define ALT_FLAG_POST(group, flags, opt) alt_no_error () - -#ifndef ALT_SINGLE_THREADED -#define ALT_SINGLE_THREADED -#endif - -#endif /* __ALT_FLAG_H__ */ diff --git a/software/qsys_tutorial_hexs_bsp/HAL/inc/os/alt_hooks.h b/software/qsys_tutorial_hexs_bsp/HAL/inc/os/alt_hooks.h deleted file mode 100644 index 9054e3f..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/inc/os/alt_hooks.h +++ /dev/null @@ -1,61 +0,0 @@ -#ifndef __ALT_HOOKS_H__ -#define __ALT_HOOKS_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * This header provides "do-nothing" macro definitions for operating system - * hooks within the HAL. The O/S component can override these to provide it's - * own implementation. - */ - -#define ALT_OS_TIME_TICK() while(0) -#define ALT_OS_INIT() while(0) -#define ALT_OS_STOP() while(0) - -/* Call from assembly code */ -#define ALT_OS_INT_ENTER_ASM -#define ALT_OS_INT_EXIT_ASM - -/* Call from C code */ -#define ALT_OS_INT_ENTER() while(0) -#define ALT_OS_INT_EXIT() while(0) - - -#endif /* __ALT_HOOKS_H__ */ diff --git a/software/qsys_tutorial_hexs_bsp/HAL/inc/os/alt_sem.h b/software/qsys_tutorial_hexs_bsp/HAL/inc/os/alt_sem.h deleted file mode 100644 index 753943e..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/inc/os/alt_sem.h +++ /dev/null @@ -1,96 +0,0 @@ -#ifndef __ALT_SEM_H__ -#define __ALT_SEM_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * This header provides macro definitions that can be used to create and use - * semaphores. These macros can be used in both a uC/OS-II based environment, - * and a single threaded HAL based environment. - * - * The motivation for these macros is to allow code to be developed which is - * thread safe under uC/OS-II, but incurs no additional overhead when used in a - * single threaded HAL environment. - * - * In the case of a single threaded HAL environment, they compile to - * "do nothing" directives, which ensures they do not contribute to the final - * executable. - * - * The following macros are available: - * - * ALT_SEM - Create a semaphore instance. - * ALT_EXTERN_SEM - Create a reference to an external semaphore instance. - * ALT_STATIC_SEM - Create a static semaphore instance. - * ALT_SEM_CREATE - Initialise a semaphore. - * ALT_SEM_PEND - Pend on a semaphore. - * ALT_SEM_POST - Increment a semaphore. - * - * Input arguments and return codes are all consistant with the equivalent - * uC/OS-II function. - * - * It's important to be careful in the use of the macros: ALT_SEM, - * ALT_EXTERN_SEM, and ALT_STATIC_SEM. In these three cases the semi-colon is - * included in the macro definition; so, for example, you should use: - * - * ALT_SEM(mysem) - * - * not: - * - * ALT_SEM(mysem); - * - * The inclusion of the semi-colon has been necessary to ensure the macros can - * compile with no warnings when used in a single threaded HAL environment. - * - */ - -#include "priv/alt_no_error.h" - -#define ALT_SEM(sem) -#define ALT_EXTERN_SEM(sem) -#define ALT_STATIC_SEM(sem) - -#define ALT_SEM_CREATE(sem, value) alt_no_error () -#define ALT_SEM_PEND(sem, timeout) alt_no_error () -#define ALT_SEM_POST(sem) alt_no_error () - -#ifndef ALT_SINGLE_THREADED -#define ALT_SINGLE_THREADED -#endif - -#endif /* __ALT_SEM_H__ */ diff --git a/software/qsys_tutorial_hexs_bsp/HAL/inc/os/alt_syscall.h b/software/qsys_tutorial_hexs_bsp/HAL/inc/os/alt_syscall.h deleted file mode 100644 index 507c6aa..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/inc/os/alt_syscall.h +++ /dev/null @@ -1,75 +0,0 @@ -#ifndef __ALT_SYSCALL_H__ -#define __ALT_SYSCALL_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * The macros defined in this file are used to provide the function names used - * for the HAL 'UNIX style' interface, e.g. read(), write() etc. - * - * Operating systems which are ported to the HAL can provide their own - * version of this file, which will be used in preference. This allows - * the operating system to provide it's own implementation of the top level - * system calls, while retaining the HAL functions under a different name, - * for example, alt_read(), alt_write() etc. - */ - -#define ALT_CLOSE close -#define ALT_ENVIRON environ -#define ALT_EXECVE execve -#define ALT_EXIT _exit -#define ALT_FCNTL fcntl -#define ALT_FORK fork -#define ALT_FSTAT fstat -#define ALT_GETPID getpid -#define ALT_GETTIMEOFDAY gettimeofday -#define ALT_IOCTL ioctl -#define ALT_ISATTY isatty -#define ALT_KILL kill -#define ALT_LINK link -#define ALT_LSEEK lseek -#define ALT_OPEN open -#define ALT_READ read -#define ALT_RENAME _rename -#define ALT_SBRK sbrk -#define ALT_SETTIMEOFDAY settimeofday -#define ALT_STAT stat -#define ALT_UNLINK unlink -#define ALT_USLEEP usleep -#define ALT_WAIT wait -#define ALT_WRITE write -#define ALT_TIMES times - -/* - * - */ - -#endif /* __ALT_SYSCALL_H__ */ diff --git a/software/qsys_tutorial_hexs_bsp/HAL/inc/priv/alt_alarm.h b/software/qsys_tutorial_hexs_bsp/HAL/inc/priv/alt_alarm.h deleted file mode 100644 index 45d6a0e..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/inc/priv/alt_alarm.h +++ /dev/null @@ -1,101 +0,0 @@ -#ifndef __ALT_PRIV_ALARM_H__ -#define __ALT_PRIV_ALARM_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "alt_types.h" - -/* - * This header provides the internal defenitions required by the public - * interface alt_alarm.h. These variables and structures are not guaranteed to - * exist in future implementations of the HAL. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * "alt_alarm_s" is a structure type used to maintain lists of alarm callback - * functions. - */ - -struct alt_alarm_s -{ - alt_llist llist; /* linked list */ - alt_u32 time; /* time in system ticks of the callback */ - alt_u32 (*callback) (void* context); /* callback function. The return - * value is the period for the next callback; where - * zero indicates that the alarm should be removed - * from the list. - */ - alt_u8 rollover; /* set when desired alarm time + current time causes - overflow, to prevent premature alarm */ - void* context; /* Argument for the callback */ -}; - -/* - * "_alt_tick_rate" is a global variable used to store the system clock rate - * in ticks per second. This is initialised to zero, which coresponds to there - * being no system clock available. - * - * It is then set to it's final value by the system clock driver through a call - * to alt_sysclk_init(). - */ - -extern alt_u32 _alt_tick_rate; - -/* - * "_alt_nticks" is a global variable which records the elapsed number of - * system clock ticks since the last call to settimeofday() or since reset if - * settimeofday() has not been called. - */ - -extern volatile alt_u32 _alt_nticks; - -/* The list of registered alarms. */ - -extern alt_llist alt_alarm_list; - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_PRIV_ALARM_H__ */ diff --git a/software/qsys_tutorial_hexs_bsp/HAL/inc/priv/alt_busy_sleep.h b/software/qsys_tutorial_hexs_bsp/HAL/inc/priv/alt_busy_sleep.h deleted file mode 100644 index b1af849..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/inc/priv/alt_busy_sleep.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef __ALT_BUSY_SLEEP_H -#define __ALT_BUSY_SLEEP_H - -/* - * Copyright (c) 2003 Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - */ - -/* - * The function alt_busy_sleep provides a busy loop implementation of usleep. - * This is used to provide usleep for the standalone HAL, or when the timer is - * unavailable in uC/OS-II. - */ - -extern unsigned int alt_busy_sleep (unsigned int us); - -#endif /* __ALT_BUSY_SLEEP_H */ diff --git a/software/qsys_tutorial_hexs_bsp/HAL/inc/priv/alt_dev_llist.h b/software/qsys_tutorial_hexs_bsp/HAL/inc/priv/alt_dev_llist.h deleted file mode 100644 index 451b063..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/inc/priv/alt_dev_llist.h +++ /dev/null @@ -1,77 +0,0 @@ -#ifndef __ALT_DEV_LLIST_H__ -#define __ALT_DEV_LLIST_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "sys/alt_llist.h" -#include "alt_types.h" - -/* - * This header provides the internal defenitions required to control file - * access. These variables and functions are not guaranteed to exist in - * future implementations of the HAL. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The alt_dev_llist is an internal structure used to form a common base - * class for all device types. The use of this structure allows common code - * to be used to manipulate the various device lists. - */ - -typedef struct { - alt_llist llist; - const char* name; -} alt_dev_llist; - -/* - * - */ - -extern int alt_dev_llist_insert (alt_dev_llist* dev, alt_llist* list); - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_DEV_LLIST_H__ */ diff --git a/software/qsys_tutorial_hexs_bsp/HAL/inc/priv/alt_exception_handler_registry.h b/software/qsys_tutorial_hexs_bsp/HAL/inc/priv/alt_exception_handler_registry.h deleted file mode 100644 index c6905fa..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/inc/priv/alt_exception_handler_registry.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef __ALT_EXCEPTION_HANDLER_REGISTRY_H__ -#define __ALT_EXCEPTION_HANDLER_REGISTRY_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2008 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ -#include "sys/alt_exceptions.h" - -/* Function pointer to exception callback routine */ -extern alt_exception_result (*alt_instruction_exception_handler) - (alt_exception_cause, alt_u32, alt_u32); - -#endif /* __ALT_EXCEPTION_HANDLER_REGISTRY_H__ */ diff --git a/software/qsys_tutorial_hexs_bsp/HAL/inc/priv/alt_file.h b/software/qsys_tutorial_hexs_bsp/HAL/inc/priv/alt_file.h deleted file mode 100644 index 2c3e843..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/inc/priv/alt_file.h +++ /dev/null @@ -1,179 +0,0 @@ -#ifndef __ALT_FILE_H__ -#define __ALT_FILE_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "sys/alt_dev.h" -#include "sys/alt_llist.h" -#include "os/alt_sem.h" - -#include "alt_types.h" - -/* - * This header provides the internal defenitions required to control file - * access. These variables and functions are not guaranteed to exist in - * future implementations of the HAL. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The function alt_find_dev() is used to search the device list "list" to - * locate a device named "name". If a match is found, then a pointer to the - * device is returned, otherwise NULL is returned. - */ - -extern alt_dev* alt_find_dev (const char* name, alt_llist* list); - -/* - * alt_find_file() is used to search the list of registered file systems to - * find the filesystem that the file named "name" belongs to. If a match is - * found, then a pointer to the filesystems alt_dev structure is returned, - * otherwise NULL is returned. - * - * Note that a match does not indicate that the file exists, only that a - * filesystem exists that is registered for a partition that could contain - * the file. The filesystems open() function would need to be called in order - * to determine if the file exists. - */ - -extern alt_dev* alt_find_file (const char* name); - -/* - * alt_get_fd() is used to allocate a file descriptor for the device or - * filesystem "dev". A negative return value indicates an error, otherwise the - * return value is the index of the file descriptor within the file descriptor - * pool. - */ - -extern int alt_get_fd (alt_dev* dev); - -/* - * alt_release_fd() is called to free the file descriptor with index "fd". - */ - -extern void alt_release_fd (int fd); - -/* - * alt_fd_lock() is called by ioctl() to mark the file descriptor "fd" as - * being open for exclusive access. Subsequent calls to open() for the device - * associated with "fd" will fail. A device is unlocked by either calling - * close() for "fd", or by an alternate call to ioctl() (see ioctl.c for - * details). - */ - -extern int alt_fd_lock (alt_fd* fd); - -/* - * alt_fd_unlock() is called by ioctl() to unlock a descriptor previously - * locked by a call to alt_fd_lock(). - */ - -extern int alt_fd_unlock (alt_fd* fd); - -/* - * "alt_fd_list" is the pool of file descriptors. - */ - -extern alt_fd alt_fd_list[]; - -/* - * flags used by alt_fd. - * - * ALT_FD_EXCL is used to mark a file descriptor as locked for exclusive - * access, i.e. further calls to open() for the associated device should - * fail. - * - * ALT_FD_DEV marks a dile descriptor as belonging to a device as oposed to a - * filesystem. - */ - -#define ALT_FD_EXCL 0x80000000 -#define ALT_FD_DEV 0x40000000 - -#define ALT_FD_FLAGS_MASK (ALT_FD_EXCL | ALT_FD_DEV) - -/* - * "alt_dev_list" is the head of the linked list of registered devices. - */ - -extern alt_llist alt_dev_list; - -/* - * "alt_fs_list" is the head of the linked list of registered filesystems. - */ - -extern alt_llist alt_fs_list; - -/* - * "alt_fd_list_lock" is a semaphore used to ensure that access to the pool - * of file descriptors is thread safe. - */ - -ALT_EXTERN_SEM(alt_fd_list_lock) - -/* - * "alt_max_fd" is a 'high water mark'. It indicates the highest file - * descriptor allocated. Use of this can save searching the entire pool - * for active file descriptors, which helps avoid contention on access - * to the file descriptor pool. - */ - -extern alt_32 alt_max_fd; - -/* - * alt_io_redirect() is called at startup to redirect stdout, stdin, and - * stderr to the devices named in the input arguments. By default these streams - * are directed at /dev/null, and are then redirected using this function once - * all of the devices have been registered within the system. - */ - -extern void alt_io_redirect(const char* stdout_dev, - const char* stdin_dev, - const char* stderr_dev); - - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_FILE_H__ */ diff --git a/software/qsys_tutorial_hexs_bsp/HAL/inc/priv/alt_iic_isr_register.h b/software/qsys_tutorial_hexs_bsp/HAL/inc/priv/alt_iic_isr_register.h deleted file mode 100644 index a0cb01c..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/inc/priv/alt_iic_isr_register.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef __ALT_IIC_ISR_REGISTER_H_ -#define __ALT_IIC_ISR_REGISTER_H_ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ -#include "alt_types.h" -#include "sys/alt_irq.h" - -extern int alt_iic_isr_register(alt_u32 ic_id, alt_u32 irq, alt_isr_func isr, - void *isr_context, void *flags); - -#endif /* __ALT_IIC_ISR_REGISTER_H_ */ diff --git a/software/qsys_tutorial_hexs_bsp/HAL/inc/priv/alt_irq_table.h b/software/qsys_tutorial_hexs_bsp/HAL/inc/priv/alt_irq_table.h deleted file mode 100644 index 694ef06..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/inc/priv/alt_irq_table.h +++ /dev/null @@ -1,59 +0,0 @@ -#ifndef __ALT_IRQ_TABLE_H__ -#define __ALT_IRQ_TABLE_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * Definition of a table describing each interrupt handler. The index into - * the array is the interrupt id associated with the handler. - * - * When an interrupt occurs, the associated handler is called with - * the argument stored in the context member. - * - * The table is physically created in alt_irq_handler.c - */ -extern struct ALT_IRQ_HANDLER -{ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - void (*handler)(void*); -#else - void (*handler)(void*, alt_u32); -#endif - void *context; -} alt_irq[ALT_NIRQ]; - -#endif diff --git a/software/qsys_tutorial_hexs_bsp/HAL/inc/priv/alt_legacy_irq.h b/software/qsys_tutorial_hexs_bsp/HAL/inc/priv/alt_legacy_irq.h deleted file mode 100644 index c7aec02..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/inc/priv/alt_legacy_irq.h +++ /dev/null @@ -1,158 +0,0 @@ -#ifndef __ALT_LEGACY_IRQ_H__ -#define __ALT_LEGACY_IRQ_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * This file provides prototypes and inline implementations of certain routines - * used by the legacy interrupt API. Do not include this in your driver or - * application source files, use "sys/alt_irq.h" instead to access the proper - * public API. - */ - -#include -#include "system.h" - -#ifndef NIOS2_EIC_PRESENT - -#include "nios2.h" -#include "alt_types.h" - -#include "sys/alt_irq.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * alt_irq_register() can be used to register an interrupt handler. If the - * function is succesful, then the requested interrupt will be enabled upon - * return. - */ -extern int alt_irq_register (alt_u32 id, - void* context, - alt_isr_func handler); - -/* - * alt_irq_disable() disables the individual interrupt indicated by "id". - */ -static ALT_INLINE int ALT_ALWAYS_INLINE alt_irq_disable (alt_u32 id) -{ - alt_irq_context status; - extern volatile alt_u32 alt_irq_active; - - status = alt_irq_disable_all (); - - alt_irq_active &= ~(1 << id); - NIOS2_WRITE_IENABLE (alt_irq_active); - - alt_irq_enable_all(status); - - return 0; -} - -/* - * alt_irq_enable() enables the individual interrupt indicated by "id". - */ -static ALT_INLINE int ALT_ALWAYS_INLINE alt_irq_enable (alt_u32 id) -{ - alt_irq_context status; - extern volatile alt_u32 alt_irq_active; - - status = alt_irq_disable_all (); - - alt_irq_active |= (1 << id); - NIOS2_WRITE_IENABLE (alt_irq_active); - - alt_irq_enable_all(status); - - return 0; -} - -#ifndef ALT_EXCEPTION_STACK -/* - * alt_irq_initerruptable() should only be called from within an ISR. It is used - * to allow higer priority interrupts to interrupt the current ISR. The input - * argument, "priority", is the priority, i.e. interrupt number of the current - * interrupt. - * - * If this function is called, then the ISR is required to make a call to - * alt_irq_non_interruptible() before returning. The input argument to - * alt_irq_non_interruptible() is the return value from alt_irq_interruptible(). - * - * Care should be taken when using this pair of functions, since they increasing - * the system overhead associated with interrupt handling. - * - * If you are using an exception stack then nested interrupts won't work, so - * these functions are not available in that case. - */ -static ALT_INLINE alt_u32 ALT_ALWAYS_INLINE alt_irq_interruptible (alt_u32 priority) -{ - extern volatile alt_u32 alt_priority_mask; - extern volatile alt_u32 alt_irq_active; - - alt_u32 old_priority; - - old_priority = alt_priority_mask; - alt_priority_mask = (1 << priority) - 1; - - NIOS2_WRITE_IENABLE (alt_irq_active & alt_priority_mask); - - NIOS2_WRITE_STATUS (1); - - return old_priority; -} - -/* - * See Comments above for alt_irq_interruptible() for an explanation of the use of this - * function. - */ -static ALT_INLINE void ALT_ALWAYS_INLINE alt_irq_non_interruptible (alt_u32 mask) -{ - extern volatile alt_u32 alt_priority_mask; - extern volatile alt_u32 alt_irq_active; - - NIOS2_WRITE_STATUS (0); - - alt_priority_mask = mask; - - NIOS2_WRITE_IENABLE (mask & alt_irq_active); -} -#endif /* ALT_EXCEPTION_STACK */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* NIOS2_EIC_PRESENT */ - -#endif /* __ALT_LEGACY_IRQ_H__ */ diff --git a/software/qsys_tutorial_hexs_bsp/HAL/inc/priv/alt_no_error.h b/software/qsys_tutorial_hexs_bsp/HAL/inc/priv/alt_no_error.h deleted file mode 100644 index 6143fc9..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/inc/priv/alt_no_error.h +++ /dev/null @@ -1,77 +0,0 @@ -#ifndef __ALT_NO_ERROR_H__ -#define __ALT_NO_ERROR_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "alt_types.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * alt_no_error() is a dummy function used by alt_sem.h and alt_flag.h. It - * substitutes for functions that have a return code by creating a function - * that always returns zero. - * - * This may seem a little obscure, but what happens is that the compiler can - * then optomise away the call to this function, and any code written which - * handles the error path (i.e. non zero return values). - * - * This allows code to be written which correctly use the uC/OS-II semaphore - * and flag utilities, without the use of those utilities impacting on - * excutables built for a single threaded HAL environment. - * - * This function is considered to be part of the internal implementation of - * the HAL, and should not be called directly by application code or device - * drivers. It is not guaranteed to be preserved in future versions of the - * HAL. - */ - -static ALT_INLINE int ALT_ALWAYS_INLINE alt_no_error (void) -{ - return 0; -} - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_NO_ERROR_H__ */ diff --git a/software/qsys_tutorial_hexs_bsp/HAL/inc/priv/nios2_gmon_data.h b/software/qsys_tutorial_hexs_bsp/HAL/inc/priv/nios2_gmon_data.h deleted file mode 100644 index 3f43f12..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/inc/priv/nios2_gmon_data.h +++ /dev/null @@ -1,47 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ -#ifndef NIOS2_GMON_DATA_H -#define NIOS2_GMON_DATA_H - -#define GMON_DATA_SIG 0 -#define GMON_DATA_WORDS 1 -#define GMON_DATA_PROFILE_DATA 2 -#define GMON_DATA_PROFILE_LOWPC 3 -#define GMON_DATA_PROFILE_HIGHPC 4 -#define GMON_DATA_PROFILE_BUCKET 5 -#define GMON_DATA_PROFILE_RATE 6 -#define GMON_DATA_MCOUNT_START 7 -#define GMON_DATA_MCOUNT_LIMIT 8 - -#define GMON_DATA_SIZE 9 - -extern unsigned int alt_gmon_data[GMON_DATA_SIZE]; - -#endif diff --git a/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_alarm.h b/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_alarm.h deleted file mode 100644 index 68a2f5d..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_alarm.h +++ /dev/null @@ -1,126 +0,0 @@ -#ifndef __ALT_ALARM_H__ -#define __ALT_ALARM_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "alt_llist.h" -#include "alt_types.h" - -#include "priv/alt_alarm.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * "alt_alarm" is a structure type used by applications to register an alarm - * callback function. An instance of this type must be passed as an input - * argument to alt_alarm_start(). The user is not responsible for initialising - * the contents of the instance. This is done by alt_alarm_start(). - */ - -typedef struct alt_alarm_s alt_alarm; - -/* - * alt_alarm_start() can be called by an application/driver in order to register - * a function for periodic callback at the system clock frequency. Be aware that - * this callback is likely to occur in interrupt context. - */ - -extern int alt_alarm_start (alt_alarm* the_alarm, - alt_u32 nticks, - alt_u32 (*callback) (void* context), - void* context); - -/* - * alt_alarm_stop() is used to unregister a callback. Alternatively the callback - * can return zero to unregister. - */ - -extern void alt_alarm_stop (alt_alarm* the_alarm); - -/* - * Obtain the system clock rate in ticks/s. - */ - -static ALT_INLINE alt_u32 ALT_ALWAYS_INLINE alt_ticks_per_second (void) -{ - return _alt_tick_rate; -} - -/* - * alt_sysclk_init() is intended to be only used by the system clock driver - * in order to initialise the value of the clock frequency. - */ - -static ALT_INLINE int ALT_ALWAYS_INLINE alt_sysclk_init (alt_u32 nticks) -{ - if (! _alt_tick_rate) - { - _alt_tick_rate = nticks; - return 0; - } - else - { - return -1; - } -} - -/* - * alt_nticks() returns the elapsed number of system clock ticks since reset. - */ - -static ALT_INLINE alt_u32 ALT_ALWAYS_INLINE alt_nticks (void) -{ - return _alt_nticks; -} - -/* - * alt_tick() should only be called by the system clock driver. This is used - * to notify the system that the system timer period has expired. - */ - -extern void alt_tick (void); - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_ALARM_H__ */ diff --git a/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_cache.h b/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_cache.h deleted file mode 100644 index c4d8db9..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_cache.h +++ /dev/null @@ -1,117 +0,0 @@ -#ifndef __ALT_CACHE_H__ -#define __ALT_CACHE_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003, 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include - -#include "alt_types.h" - -/* - * alt_cache.h defines the processor specific functions for manipulating the - * cache. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * alt_icache_flush() is called to flush the instruction cache for a memory - * region of length "len" bytes, starting at address "start". - */ - -extern void alt_icache_flush (void* start, alt_u32 len); - -/* - * alt_dcache_flush() is called to flush the data cache for a memory - * region of length "len" bytes, starting at address "start". - * Any dirty lines in the data cache are written back to memory. - */ - -extern void alt_dcache_flush (void* start, alt_u32 len); - -/* - * alt_dcache_flush() is called to flush the data cache for a memory - * region of length "len" bytes, starting at address "start". - * Any dirty lines in the data cache are NOT written back to memory. - */ - -extern void alt_dcache_flush_no_writeback (void* start, alt_u32 len); - -/* - * Flush the entire instruction cache. - */ - -extern void alt_icache_flush_all (void); - -/* - * Flush the entire data cache. - */ - -extern void alt_dcache_flush_all (void); - -/* - * Allocate a block of uncached memory. - */ - -extern volatile void* alt_uncached_malloc (size_t size); - -/* - * Free a block of uncached memory. - */ - -extern void alt_uncached_free (volatile void* ptr); - -/* - * Convert a pointer to a block of cached memory, into a block of - * uncached memory. - */ - -extern volatile void* alt_remap_uncached (void* ptr, alt_u32 len); - -/* - * Convert a pointer to a block of uncached memory, into a block of - * cached memory. - */ - -extern void* alt_remap_cached (volatile void* ptr, alt_u32 len); - -/* - * - */ - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_CACHE_H__ */ diff --git a/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_debug.h b/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_debug.h deleted file mode 100644 index d9f9599..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_debug.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef __ALT_DEBUG_H__ -#define __ALT_DEBUG_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * The ALT_DEVUG_ASSERT macro can be used to generate a debugger break - * from within software. The break is generated if "condition" evaluates to - * false. - */ - -#define ALT_DEBUG_ASSERT(condition) if (!condition) \ -{ \ - __asm__ volatile ("break"); \ -} - -#endif /* __ALT_DEBUG_H__ */ diff --git a/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_dev.h b/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_dev.h deleted file mode 100644 index 66c5e41..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_dev.h +++ /dev/null @@ -1,115 +0,0 @@ -#ifndef __ALT_DEV_H__ -#define __ALT_DEV_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "system.h" -#include "sys/alt_llist.h" -#include "priv/alt_dev_llist.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The value ALT_IRQ_NOT_CONNECTED is used to represent an unconnected - * interrupt line. It cannot evaluate to a valid interrupt number. - */ - -#define ALT_IRQ_NOT_CONNECTED (-1) - -typedef struct alt_dev_s alt_dev; - -struct stat; - -/* - * The file descriptor structure definition. - */ - -typedef struct alt_fd_s -{ - alt_dev* dev; - alt_u8* priv; - int fd_flags; -} alt_fd; - -/* - * The device structure definition. - */ - -struct alt_dev_s { - alt_llist llist; /* for internal use */ - const char* name; - int (*open) (alt_fd* fd, const char* name, int flags, int mode); - int (*close) (alt_fd* fd); - int (*read) (alt_fd* fd, char* ptr, int len); - int (*write) (alt_fd* fd, const char* ptr, int len); - int (*lseek) (alt_fd* fd, int ptr, int dir); - int (*fstat) (alt_fd* fd, struct stat* buf); - int (*ioctl) (alt_fd* fd, int req, void* arg); -}; - -/* - * Functions used to register device for access through the C standard - * library. - * - * The only difference between alt_dev_reg() and alt_fs_reg() is the - * interpretation that open() places on the device name. In the case of - * alt_dev_reg the device is assumed to be a particular character device, - * and so there must be an exact match in the name for open to succeed. - * In the case of alt_fs_reg() the name of the device is treated as the - * mount point for a directory, and so any call to open() where the name - * is the root of the device filename will succeed. - */ - -extern int alt_fs_reg (alt_dev* dev); - -static ALT_INLINE int alt_dev_reg (alt_dev* dev) -{ - extern alt_llist alt_dev_list; - - return alt_dev_llist_insert ((alt_dev_llist*) dev, &alt_dev_list); -} - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_DEV_H__ */ diff --git a/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_dma.h b/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_dma.h deleted file mode 100644 index 9f9b2ff..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_dma.h +++ /dev/null @@ -1,226 +0,0 @@ -#ifndef __ALT_DMA_H__ -#define __ALT_DMA_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "sys/alt_dma_dev.h" -#include "alt_types.h" - -#include - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * This header contains the application side interface for accessing DMA - * resources. See alt_dma_dev.h for the dma device driver interface. - * - * The interface model treats a DMA transaction as being composed of two - * halves (read and write). - * - * The application can supply data for transmit using an "alt_dma_txchan" - * descriptor. Alternatively an "alt_dma_rxchan" descriptor can be used to - * receive data. - */ - -/* - * alt_dma_txchan_open() is used to obtain an "alt_dma_txchan" descriptor for - * a DMA transmit device. The name is the name of the associated physical - * device (e.g. "/dev/dma_0"). - * - * The return value will be NULL on failure, and non-NULL otherwise. - */ - -extern alt_dma_txchan alt_dma_txchan_open (const char* name); - -/* - * alt_dma_txchan_close() is provided so that an application can notify the - * system that it has finished with a given DMA transmit channel. This is only - * provided for completness. - */ - -static ALT_INLINE int alt_dma_txchan_close (alt_dma_txchan dma) -{ - return 0; -} - -/* - * alt_dma_txchan_send() posts a transmit request to a DMA transmit channel. - * The input arguments are: - * - * dma: the channel to use. - * from: a pointer to the start of the data to send. - * length: the length of the data to send in bytes. - * done: callback function that will be called once the data has been sent. - * handle: opaque value passed to "done". - * - * The return value will be negative if the request cannot be posted, and - * zero otherwise. - */ - -static ALT_INLINE int alt_dma_txchan_send (alt_dma_txchan dma, - const void* from, - alt_u32 length, - alt_txchan_done* done, - void* handle) -{ - return dma ? dma->dma_send (dma, - from, - length, - done, - handle) : -ENODEV; -} - -/* - * alt_dma_txchan_space() returns the number of tranmit requests that can be - * posted to the specified DMA transmit channel. - * - * A negative value indicates that the value could not be determined. - */ - -static ALT_INLINE int alt_dma_txchan_space (alt_dma_txchan dma) -{ - return dma ? dma->space (dma) : -ENODEV; -} - -/* - * alt_dma_txchan_ioctl() can be used to perform device specific I/O - * operations on the indicated DMA transmit channel. For example some drivers - * support options to control the width of the transfer operations. See - * alt_dma_dev.h for the list of generic requests. - * - * A negative return value indicates failure, otherwise the interpretation - * of the return value is request specific. - */ - -static ALT_INLINE int alt_dma_txchan_ioctl (alt_dma_txchan dma, - int req, - void* arg) -{ - return dma ? dma->ioctl (dma, req, arg) : -ENODEV; -} - -/* - * alt_dma_rxchan_open() is used to obtain an "alt_dma_rxchan" descriptor for - * a DMA receive channel. The name is the name of the associated physical - * device (e.g. "/dev/dma_0"). - * - * The return value will be NULL on failure, and non-NULL otherwise. - */ - -extern alt_dma_rxchan alt_dma_rxchan_open (const char* dev); - -/* - * alt_dma_rxchan_close() is provided so that an application can notify the - * system that it has finished with a given DMA receive channel. This is only - * provided for completness. - */ - -static ALT_INLINE int alt_dma_rxchan_close (alt_dma_rxchan dma) -{ - return 0; -} - -/* - * - */ - -/* - * alt_dma_rxchan_prepare() posts a receive request to a DMA receive channel. - * - * The input arguments are: - * - * dma: the channel to use. - * data: a pointer to the location that data is to be received to. - * len: the maximum length of the data to receive. - * done: callback function that will be called once the data has been - * received. - * handle: opaque value passed to "done". - * - * The return value will be negative if the request cannot be posted, and - * zero otherwise. - */ - -static ALT_INLINE int alt_dma_rxchan_prepare (alt_dma_rxchan dma, - void* data, - alt_u32 len, - alt_rxchan_done* done, - void* handle) -{ - return dma ? dma->prepare (dma, data, len, done, handle) : -ENODEV; -} - -/* - * alt_dma_rxchan_ioctl() can be used to perform device specific I/O - * operations on the indicated DMA receive channel. For example some drivers - * support options to control the width of the transfer operations. See - * alt_dma_dev.h for the list of generic requests. - * - * A negative return value indicates failure, otherwise the interpretation - * of the return value is request specific. - */ - -static ALT_INLINE int alt_dma_rxchan_ioctl (alt_dma_rxchan dma, - int req, - void* arg) -{ - return dma ? dma->ioctl (dma, req, arg) : -ENODEV; -} - -/* - * alt_dma_rxchan_depth() returns the depth of the receive FIFO used to store - * receive requests. - */ - -static ALT_INLINE alt_u32 alt_dma_rxchan_depth(alt_dma_rxchan dma) -{ - return dma->depth; -} - -/* - * - */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_DMA_H__ */ diff --git a/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_dma_dev.h b/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_dma_dev.h deleted file mode 100644 index 832463d..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_dma_dev.h +++ /dev/null @@ -1,200 +0,0 @@ -#ifndef __ALT_DMA_DEV_H__ -#define __ALT_DMA_DEV_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "priv/alt_dev_llist.h" - -#include "alt_types.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * This header contains the device driver interface for accessing DMA - * resources. See alt_dma.h for the DMA application side interface. - * - * The interface model treats a DMA transaction as being composed of two - * halves (read and write). - * - * An "alt_dma_txchan_dev" is used to describe the device associated with a - * DMA transmit channel. An "alt_dma_rxchan_dev" is used to describe the - * device associated with a DMA receive channel. - */ - -/* - * List of generic ioctl requests that may be supported by a DMA device. - * - * ALT_DMA_RX_ONLY_ON: This causes a DMA channel to operate in a mode - * where only the receiver is under software control. - * The other side reads continously from a single - * location. The address to read is the argument to - * this request. - * ALT_DMA_RX_ONLY_OFF: Return to the default mode where both the receive - * and transmit sides of the DMA can be under software - * control. - * ALT_DMA_TX_ONLY_ON: This causes a DMA channel to operate in a mode - * where only the transmitter is under software control. - * The other side writes continously to a single - * location. The address to write to is the argument to - * this request. - * ALT_DMA_TX_ONLY_OFF: Return to the default mode where both the receive - * and transmit sides of the DMA can be under software - * control. - * ALT_DMA_SET_MODE_8: Transfer data in units of 8 bits. - * ALT_DMA_SET_MODE_16: Transfer data in units of 16 bits. - * ALT_DMA_SET_MODE_32: Transfer data in units of 32 bits. - * ALT_DMA_SET_MODE_64: Transfer data in units of 64 bits. - * ALT_DMA_SET_MODE_128: Transfer data in units of 128 bits. - * ALT_DMA_GET_MODE: Get the current transfer mode. - * - * The use of the macros: ALT_DMA_TX_STREAM_ON, ALT_DMA_TX_STREAM_OFF - * ALT_DMA_RX_STREAM_OFF and ALT_DMA_RX_STREAM_ON are depreciated. You should - * instead use the macros: ALT_DMA_RX_ONLY_ON, ALT_DMA_RX_ONLY_OFF, - * ALT_DMA_TX_ONLY_ON and ALT_DMA_TX_ONLY_OFF. - */ - -#define ALT_DMA_TX_STREAM_ON (0x1) -#define ALT_DMA_TX_STREAM_OFF (0x2) -#define ALT_DMA_RX_STREAM_ON (0x3) -#define ALT_DMA_RX_STREAM_OFF (0x4) -#define ALT_DMA_SET_MODE_8 (0x5) -#define ALT_DMA_SET_MODE_16 (0x6) -#define ALT_DMA_SET_MODE_32 (0x7) -#define ALT_DMA_SET_MODE_64 (0x8) -#define ALT_DMA_SET_MODE_128 (0x9) -#define ALT_DMA_GET_MODE (0xa) - -#define ALT_DMA_RX_ONLY_ON ALT_DMA_TX_STREAM_ON -#define ALT_DMA_RX_ONLY_OFF ALT_DMA_TX_STREAM_OFF -#define ALT_DMA_TX_ONLY_ON ALT_DMA_RX_STREAM_ON -#define ALT_DMA_TX_ONLY_OFF ALT_DMA_RX_STREAM_OFF - -/* - * - */ - -typedef struct alt_dma_txchan_dev_s alt_dma_txchan_dev; -typedef struct alt_dma_rxchan_dev_s alt_dma_rxchan_dev; - -typedef alt_dma_txchan_dev* alt_dma_txchan; -typedef alt_dma_rxchan_dev* alt_dma_rxchan; - -typedef void (alt_txchan_done)(void* handle); -typedef void (alt_rxchan_done)(void* handle, void* data); - -/* - * devices that provide a DMA transmit channel are required to provide an - * instance of the "alt_dma_txchan_dev" structure. - */ - -struct alt_dma_txchan_dev_s { - alt_llist llist; /* for internal use */ - const char* name; /* name of the device instance - * (e.g. "/dev/dma_0"). - */ - int (*space) (alt_dma_txchan dma); /* returns the maximum number of - * transmit requests that can be posted - */ - int (*dma_send) (alt_dma_txchan dma, - const void* from, - alt_u32 len, - alt_txchan_done* done, - void* handle); /* post a transmit request */ - int (*ioctl) (alt_dma_txchan dma, int req, void* arg); /* perform device - * specific I/O control. - */ -}; - -/* - * devices that provide a DMA receive channel are required to provide an - * instance of the "alt_dma_rxchan_dev" structure. - */ - -struct alt_dma_rxchan_dev_s { - alt_llist list; /* for internal use */ - const char* name; /* name of the device instance - * (e.g. "/dev/dma_0"). - */ - alt_u32 depth; /* maximum number of receive requests that - * can be posted. - */ - int (*prepare) (alt_dma_rxchan dma, - void* data, - alt_u32 len, - alt_rxchan_done* done, - void* handle); /* post a receive request */ - int (*ioctl) (alt_dma_rxchan dma, int req, void* arg); /* perform device - * specific I/O control. - */ -}; - -/* - * Register a DMA transmit channel with the system. - */ - -static ALT_INLINE int alt_dma_txchan_reg (alt_dma_txchan_dev* dev) -{ - extern alt_llist alt_dma_txchan_list; - - return alt_dev_llist_insert((alt_dev_llist*) dev, &alt_dma_txchan_list); -} - -/* - * Register a DMA receive channel with the system. - */ - -static ALT_INLINE int alt_dma_rxchan_reg (alt_dma_rxchan_dev* dev) -{ - extern alt_llist alt_dma_rxchan_list; - - return alt_dev_llist_insert((alt_dev_llist*) dev, &alt_dma_rxchan_list); -} - -/* - * - */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_DMA_DEV_H__ */ diff --git a/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_driver.h b/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_driver.h deleted file mode 100644 index eb0f23b..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_driver.h +++ /dev/null @@ -1,168 +0,0 @@ -#ifndef __ALT_DRIVER_H__ -#define __ALT_DRIVER_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/* - * Macros used to access a driver without HAL file descriptors. - */ - -/* - * ALT_MODULE_CLASS - * - * This macro returns the module class name for the specified module instance. - * It uses information in the system.h file. - * Neither the instance name or class name are quoted (so that they can - * be used with other pre-processor macros). - * - * Example: - * Assume the design has an instance of an altera_avalon_uart called uart1. - * Calling ALT_MODULE_CLASS(uart1) returns altera_avalon_uart. - */ - -#define ALT_MODULE_CLASS(instance) ALT_MODULE_CLASS_ ## instance - - -/* - * ALT_DRIVER_FUNC_NAME - * - * --> instance Instance name. - * --> func Function name. - * - * This macro returns the device driver function name of the specified - * module instance for the specified function name. - * - * Example: - * Assume the design has an instance of an altera_avalon_uart called uart1. - * Calling ALT_DRIVER_FUNC_NAME(uart1, write) returns - * altera_avalon_uart_write. - */ - -#define ALT_DRIVER_FUNC_NAME(instance, func) \ - ALT_DRIVER_FUNC_NAME1(ALT_MODULE_CLASS(instance), func) -#define ALT_DRIVER_FUNC_NAME1(module_class, func) \ - ALT_DRIVER_FUNC_NAME2(module_class, func) -#define ALT_DRIVER_FUNC_NAME2(module_class, func) \ - module_class ## _ ## func - -/* - * ALT_DRIVER_STATE_STRUCT - * - * --> instance Instance name. - * - * This macro returns the device driver state type name of the specified - * module instance. - * - * Example: - * Assume the design has an instance of an altera_avalon_uart called uart1. - * Calling ALT_DRIVER_STATE_STRUCT(uart1) returns: - * struct altera_avalon_uart_state_s - * - * Note that the ALT_DRIVER_FUNC_NAME macro is used even though "state" isn't - * really a function but it does match the required naming convention. - */ -#define ALT_DRIVER_STATE_STRUCT(instance) \ - struct ALT_DRIVER_FUNC_NAME(instance, state_s) - -/* - * ALT_DRIVER_STATE - * - * --> instance Instance name. - * - * This macro returns the device driver state name of the specified - * module instance. - * - * Example: - * Assume the design has an instance of an altera_avalon_uart called uart1. - * Calling ALT_DRIVER_STATE(uart1) returns uart1. - */ -#define ALT_DRIVER_STATE(instance) instance - -/* - * ALT_DRIVER_WRITE - * - * --> instance Instance name. - * --> buffer Write buffer. - * --> len Length of write buffer data. - * --> flags Control flags (e.g. O_NONBLOCK) - * - * This macro calls the "write" function of the specified driver instance. - */ - -#define ALT_DRIVER_WRITE_EXTERNS(instance) \ - extern ALT_DRIVER_STATE_STRUCT(instance) ALT_DRIVER_STATE(instance); \ - extern int ALT_DRIVER_FUNC_NAME(instance, write) \ - (ALT_DRIVER_STATE_STRUCT(instance) *, const char *, int, int); - -#define ALT_DRIVER_WRITE(instance, buffer, len, flags) \ - ALT_DRIVER_FUNC_NAME(instance, write)(&ALT_DRIVER_STATE(instance), buffer, len, flags) - - -/* - * ALT_DRIVER_READ - * - * --> instance Instance name. - * <-- buffer Read buffer. - * --> len Length of read buffer. - * --> flags Control flags (e.g. O_NONBLOCK) - * - * This macro calls the "read" function of the specified driver instance. - */ - -#define ALT_DRIVER_READ_EXTERNS(instance) \ - extern ALT_DRIVER_STATE_STRUCT(instance) ALT_DRIVER_STATE(instance); \ - extern int ALT_DRIVER_FUNC_NAME(instance, read) \ - (ALT_DRIVER_STATE_STRUCT(instance) *, const char *, int, int); - -#define ALT_DRIVER_READ(instance, buffer, len, flags) \ - ALT_DRIVER_FUNC_NAME(instance, read)(&ALT_DRIVER_STATE(instance), buffer, len, flags) - -/* - * ALT_DRIVER_IOCTL - * - * --> instance Instance name. - * --> req ioctl request (e.g. TIOCSTIMEOUT) - * --> arg Optional argument (void*) - * - * This macro calls the "ioctl" function of the specified driver instance - */ - -#define ALT_DRIVER_IOCTL_EXTERNS(instance) \ - extern ALT_DRIVER_STATE_STRUCT(instance) ALT_DRIVER_STATE(instance); \ - extern int ALT_DRIVER_FUNC_NAME(instance, ioctl) \ - (ALT_DRIVER_STATE_STRUCT(instance) *, int, void*); - -#define ALT_DRIVER_IOCTL(instance, req, arg) \ - ALT_DRIVER_FUNC_NAME(instance, ioctl)(&ALT_DRIVER_STATE(instance), req, arg) - -#endif /* __ALT_DRIVER_H__ */ diff --git a/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_errno.h b/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_errno.h deleted file mode 100644 index 4d3e50f..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_errno.h +++ /dev/null @@ -1,87 +0,0 @@ -#ifndef __ALT_ERRNO_H__ -#define __ALT_ERRNO_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * errno is defined in so that it uses the thread local version - * stored in the location pointed to by "_impure_ptr". This means that the - * accesses to errno within the HAL library can cause the entirety of - * of the structure pointed to by "_impure_ptr" to be added to the - * users application. This can be undesirable in very small footprint systems. - * - * To avoid this happening, the HAL uses the macro ALT_ERRNO, defined below, - * to access errno, rather than accessing it directly. This macro will only - * use the thread local version if some other code has already caused it to be - * included into the system, otherwise it will use the global errno value. - * - * This causes a slight increases in code size where errno is accessed, but - * can lead to significant overall benefits in very small systems. The - * increase is inconsequential when compared to the size of the structure - * pointed to by _impure_ptr. - * - * Note that this macro accesses __errno() using an externally declared - * function pointer (alt_errno). This is done so that the function call uses the - * subroutine call instruction via a register rather than an immediate address. - * This is important in the case that the code has been linked for a high - * address, but __errno() is not being used. In this case the weak linkage - * would have resulted in the instruction: "call 0" which would fail to link. - */ - -extern int* (*alt_errno) (void); - -/* Must define this so that values such as EBADFD are defined in errno.h. */ -#define __LINUX_ERRNO_EXTENSIONS__ - -#include - -#include "alt_types.h" - -#undef errno - -extern int errno; - -static ALT_INLINE int* alt_get_errno(void) -{ - return ((alt_errno) ? alt_errno() : &errno); -} - -#define ALT_ERRNO *alt_get_errno() - -#endif /* __ALT_ERRNO_H__ */ diff --git a/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_exceptions.h b/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_exceptions.h deleted file mode 100644 index 3576a52..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_exceptions.h +++ /dev/null @@ -1,127 +0,0 @@ -#ifndef __ALT_EXCEPTIONS_H__ -#define __ALT_EXCEPTIONS_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2008 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ -#include "alt_types.h" -#include "system.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * This file defines instruction-generated exception handling and registry - * API, exception type enumeration, and handler return value enumeration for - * Nios II. - */ - -/* - * The following enumeration describes the value in the CPU EXCEPTION - * register CAUSE bit field. Not all exception types will cause the - * processor to go to the exception vector; these are provided for - * reference. - */ -enum alt_exception_cause_e { - /* Exeption causes that will cause jump to exception vector */ - NIOS2_EXCEPTION_INTERRUPT = 2, - NIOS2_EXCEPTION_TRAP_INST = 3, - NIOS2_EXCEPTION_UNIMPLEMENTED_INST = 4, - NIOS2_EXCEPTION_ILLEGAL_INST = 5, - NIOS2_EXCEPTION_MISALIGNED_DATA_ADDR = 6, - NIOS2_EXCEPTION_MISALIGNED_TARGET_PC = 7, - NIOS2_EXCEPTION_DIVISION_ERROR = 8, - NIOS2_EXCEPTION_SUPERVISOR_ONLY_INST_ADDR = 9, - NIOS2_EXCEPTION_SUPERVISOR_ONLY_INST = 10, - NIOS2_EXCEPTION_SUPERVISOR_ONLY_DATA_ADDR = 11, - NIOS2_EXCEPTION_TLB_MISS = 12, - NIOS2_EXCEPTION_TLB_EXECUTE_PERM_VIOLATION = 13, - NIOS2_EXCEPTION_MPU_INST_REGION_VIOLATION = 16, - - /* Exception causes that will NOT cause a jump to exception vector */ - NIOS2_EXCEPTION_RESET = 0, - NIOS2_EXCEPTION_CPU_ONLY_RESET_REQUEST = 1, - NIOS2_EXCEPTION_TLB_READ_PERM_VIOLATION = 14, - NIOS2_EXCEPTION_TLB_WRITE_PERM_VIOLATION = 15, - NIOS2_EXCEPTION_MPU_DATA_REGION_VIOLATION = 17, - /* - * This value is passed to an exception handler's cause argument if - * "extra exceptions" information (EXECPTION) register is not - * present in the processor hardware configuration. - */ - NIOS2_EXCEPTION_CAUSE_NOT_PRESENT = -1 -}; -typedef enum alt_exception_cause_e alt_exception_cause; - -/* - * These define valid return values for a user-defined instruction-generated - * exception handler. The handler should return one of these to indicate - * whether to re-issue the instruction that triggered the exception, or to - * skip it. - */ -enum alt_exception_result_e { - NIOS2_EXCEPTION_RETURN_REISSUE_INST = 0, - NIOS2_EXCEPTION_RETURN_SKIP_INST = 1 -}; -typedef enum alt_exception_result_e alt_exception_result; - -/* - * alt_instruction_exception_register() can be used to register an exception - * handler for instruction-generated exceptions that are not handled by the - * built-in exception handler (i.e. for interrupts). - * - * The registry API is optionally enabled through the "Enable - * Instruction-related Exception API" HAL BSP setting, which will - * define the macro below. - */ -#ifdef ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API -void alt_instruction_exception_register ( - alt_exception_result (*exception_handler)( - alt_exception_cause cause, - alt_u32 exception_pc, - alt_u32 bad_addr) ); -#endif /*ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API */ - -/* - * alt_exception_cause_generated_bad_addr() indicates whether a particular - * exception cause value was from an exception-type that generated a valid - * address in the BADADDR register. The contents of BADADDR is passed to - * a user-registered exception handler in all cases, whether valid or not. - * This routine should be called to validate the bad_addr argument to - * your exception handler. - */ -int alt_exception_cause_generated_bad_addr(alt_exception_cause cause); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_EXCEPTIONS_H__ */ diff --git a/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_flash.h b/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_flash.h deleted file mode 100644 index 527328d..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_flash.h +++ /dev/null @@ -1,166 +0,0 @@ -#ifndef __ALT_FLASH_H__ -#define __ALT_FLASH_H__ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/****************************************************************************** -* * -* Alt_flash.h - User interface for flash code * -* * -* Use this interface to avoid being exposed to the internals of the device * -* driver architecture. If you chose to use the flash driver internal * -* structures we don't guarantee not to change them * -* * -* Author PRR * -* * -******************************************************************************/ - - - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#include "alt_types.h" -#include "alt_flash_types.h" -#include "alt_flash_dev.h" -#include "sys/alt_cache.h" - -alt_flash_fd* alt_flash_open_dev(const char* name); -void alt_flash_close_dev(alt_flash_fd* fd ); - -/* - * alt_write_flash - * - * Program a buffer into flash. - * - * This routine erases all the affected erase blocks (if necessary) - * and then programs the data. However it does not read the data out first - * and preserve and none overwritten data, because this would require very - * large buffers on the target. If you need - * that functionality use the functions below. - */ -static __inline__ int __attribute__ ((always_inline)) alt_write_flash( - alt_flash_fd* fd, - int offset, - const void* src_addr, - int length ) -{ - return fd->write( fd, offset, src_addr, length ); -} - -/* - * alt_read_flash - * - * Read a block of flash for most flashes this is just memcpy - * it's here for completeness in case we need it for some serial flash device - * - */ -static __inline__ int __attribute__ ((always_inline)) alt_read_flash( - alt_flash_fd* fd, int offset, - void* dest_addr, int length ) -{ - return fd->read( fd, offset, dest_addr, length ); -} - -/* - * alt_get_flash_info - * - * Return the information on the flash sectors. - * - */ -static __inline__ int __attribute__ ((always_inline)) alt_get_flash_info( - alt_flash_fd* fd, flash_region** info, - int* number_of_regions) -{ - return fd->get_info( fd, info, number_of_regions); -} - -/* - * alt_erase_flash_block - * - * Erase a particular erase block, pass in the offset to the start of - * the block and it's size - */ -static __inline__ int __attribute__ ((always_inline)) alt_erase_flash_block( - alt_flash_fd* fd, int offset, int length) -{ - int ret_code; - ret_code = fd->erase_block( fd, offset ); - - if(!ret_code) - alt_dcache_flush((alt_u8*)fd->base_addr + offset, length); - - return ret_code; -} - -/* - * alt_write_flash_block - * - * Write a particular flash block, block_offset is the offset - * (from the base of flash) to start of the block - * data_offset is the offset (from the base of flash) - * where you wish to start programming - * - * NB this function DOES NOT check that you are only writing a single - * block of data as that would slow down this function. - * - * Use alt_write_flash if you want that level of error checking. - */ - -static __inline__ int __attribute__ ((always_inline)) alt_write_flash_block( - alt_flash_fd* fd, int block_offset, - int data_offset, - const void *data, int length) -{ - - int ret_code; - ret_code = fd->write_block( fd, block_offset, data_offset, data, length ); - - if(!ret_code) - alt_dcache_flush((alt_u8*)fd->base_addr + data_offset, length); - - return ret_code; -} - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_FLASH_H__ */ diff --git a/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_flash_dev.h b/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_flash_dev.h deleted file mode 100644 index 8bab601..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_flash_dev.h +++ /dev/null @@ -1,98 +0,0 @@ -#ifndef __ALT_FLASH_DEV_H__ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/****************************************************************************** -* * -* Alt_flash_dev.h - Generic Flash device interfaces * -* * -* Author PRR * -* * -******************************************************************************/ -#define __ALT_FLASH_DEV_H__ - -#include "alt_flash_types.h" -#include "sys/alt_llist.h" -#include "priv/alt_dev_llist.h" - -#include "alt_types.h" - -typedef struct alt_flash_dev alt_flash_dev; -typedef alt_flash_dev alt_flash_fd; - -static ALT_INLINE int alt_flash_device_register( alt_flash_fd* fd) -{ - extern alt_llist alt_flash_dev_list; - - return alt_dev_llist_insert ((alt_dev_llist*) fd, &alt_flash_dev_list); -} - -typedef alt_flash_dev* (*alt_flash_open)(alt_flash_dev* flash, - const char* name ); -typedef int (*alt_flash_close)(alt_flash_dev* flash_info); - -typedef int (*alt_flash_write)( alt_flash_dev* flash, int offset, - const void* src_addr, int length ); - -typedef int (*alt_flash_get_flash_info)( alt_flash_dev* flash, flash_region** info, - int* number_of_regions); -typedef int (*alt_flash_write_block)( alt_flash_dev* flash, int block_offset, - int data_offset, const void* data, - int length); -typedef int (*alt_flash_erase_block)( alt_flash_dev* flash, int offset); -typedef int (*alt_flash_read)(alt_flash_dev* flash, int offset, - void* dest_addr, int length ); - -struct alt_flash_dev -{ - alt_llist llist; - const char* name; - alt_flash_open open; - alt_flash_close close; - alt_flash_write write; - alt_flash_read read; - alt_flash_get_flash_info get_info; - alt_flash_erase_block erase_block; - alt_flash_write_block write_block; - void* base_addr; - int length; - int number_of_regions; - flash_region region_info[ALT_MAX_NUMBER_OF_FLASH_REGIONS]; -}; - -#endif /* __ALT_FLASH_DEV_H__ */ diff --git a/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_flash_types.h b/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_flash_types.h deleted file mode 100644 index 884cbf8..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_flash_types.h +++ /dev/null @@ -1,64 +0,0 @@ -#ifndef __ALT_FLASH_TYPES_H__ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/****************************************************************************** -* * -* Alt_flash_types.h - Some generic types and defines used by the flash code * -* * -* Author PRR * -* * -******************************************************************************/ -#define __ALT_FLASH_TYPES_H__ - -#ifndef ALT_MAX_NUMBER_OF_FLASH_REGIONS -#define ALT_MAX_NUMBER_OF_FLASH_REGIONS 8 -#endif /* ALT_MAX_NUMBER_OF_FLASH_REGIONS */ - -/* - * Description of a single Erase region - */ -typedef struct flash_region -{ - int offset; - int region_size; - int number_of_blocks; - int block_size; -}flash_region; - -#endif /* __ALT_FLASH_TYPES_H__ */ diff --git a/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_irq.h b/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_irq.h deleted file mode 100644 index 6666e52..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_irq.h +++ /dev/null @@ -1,245 +0,0 @@ -#ifndef __ALT_IRQ_H__ -#define __ALT_IRQ_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * alt_irq.h is the Nios II specific implementation of the interrupt controller - * interface. - * - * Nios II includes optional support for an external interrupt controller. - * When an external controller is present, the "Enhanced" interrupt API - * must be used to manage individual interrupts. The enhanced API also - * supports the processor's internal interrupt controller. Certain API - * members are accessible from either the "legacy" or "enhanced" interrpt - * API. - * - * Regardless of which API is in use, this file should be included by - * application code and device drivers that register ISRs or manage interrpts. - */ -#include - -#include "nios2.h" -#include "alt_types.h" -#include "system.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * Macros used by alt_irq_enabled - */ -#define ALT_IRQ_ENABLED 1 -#define ALT_IRQ_DISABLED 0 - -/* - * Number of available interrupts in internal interrupt controller. - */ -#define ALT_NIRQ NIOS2_NIRQ - -/* - * Used by alt_irq_disable_all() and alt_irq_enable_all(). - */ -typedef int alt_irq_context; - -/* ISR Prototype */ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT -typedef void (*alt_isr_func)(void* isr_context); -#else -typedef void (*alt_isr_func)(void* isr_context, alt_u32 id); -#endif - -/* - * The following protypes and routines are supported by both - * the enhanced and legacy interrupt APIs - */ - -/* - * alt_irq_enabled can be called to determine if the processor's global - * interrupt enable is asserted. The return value is zero if interrupts - * are disabled, and non-zero otherwise. - * - * Whether the internal or external interrupt controller is present, - * individual interrupts may still be disabled. Use the other API to query - * a specific interrupt. - */ -static ALT_INLINE int ALT_ALWAYS_INLINE alt_irq_enabled (void) -{ - int status; - - NIOS2_READ_STATUS (status); - - return status & NIOS2_STATUS_PIE_MSK; -} - -/* - * alt_irq_disable_all() - * - * This routine inhibits all interrupts by negating the status register PIE - * bit. It returns the previous contents of the CPU status register (IRQ - * context) which can be used to restore the status register PIE bit to its - * state before this routine was called. - */ -static ALT_INLINE alt_irq_context ALT_ALWAYS_INLINE - alt_irq_disable_all (void) -{ - alt_irq_context context; - - NIOS2_READ_STATUS (context); - - NIOS2_WRITE_STATUS (context & ~NIOS2_STATUS_PIE_MSK); - - return context; -} - -/* - * alt_irq_enable_all() - * - * Enable all interrupts that were previously disabled by alt_irq_disable_all() - * - * This routine accepts a context to restore the CPU status register PIE bit - * to the state prior to a call to alt_irq_disable_all(). - - * In the case of nested calls to alt_irq_disable_all()/alt_irq_enable_all(), - * this means that alt_irq_enable_all() does not necessarily re-enable - * interrupts. - * - * This routine will perform a read-modify-write sequence to restore only - * status.PIE if the processor is configured with options that add additional - * writeable status register bits. These include the MMU, MPU, the enhanced - * interrupt controller port, and shadow registers. Otherwise, as a performance - * enhancement, status is overwritten with the prior context. - */ -static ALT_INLINE void ALT_ALWAYS_INLINE - alt_irq_enable_all (alt_irq_context context) -{ -#if (NIOS2_NUM_OF_SHADOW_REG_SETS > 0) || (defined NIOS2_EIC_PRESENT) || \ - (defined NIOS2_MMU_PRESENT) || (defined NIOS2_MPU_PRESENT) - alt_irq_context status; - - NIOS2_READ_STATUS (status); - - status &= ~NIOS2_STATUS_PIE_MSK; - status |= (context & NIOS2_STATUS_PIE_MSK); - - NIOS2_WRITE_STATUS (status); -#else - NIOS2_WRITE_STATUS (context); -#endif -} - -/* - * The function alt_irq_init() is defined within the auto-generated file - * alt_sys_init.c. This function calls the initilization macros for all - * interrupt controllers in the system at config time, before any other - * non-interrupt controller driver is initialized. - * - * The "base" parameter is ignored and only present for backwards-compatibility. - * It is recommended that NULL is passed in for the "base" parameter. - */ -extern void alt_irq_init (const void* base); - -/* - * alt_irq_cpu_enable_interrupts() enables the CPU to start taking interrupts. - */ -static ALT_INLINE void ALT_ALWAYS_INLINE - alt_irq_cpu_enable_interrupts () -{ - NIOS2_WRITE_STATUS(NIOS2_STATUS_PIE_MSK -#if defined(NIOS2_EIC_PRESENT) && (NIOS2_NUM_OF_SHADOW_REG_SETS > 0) - | NIOS2_STATUS_RSIE_MSK -#endif - ); -} - - -/* - * Prototypes for the enhanced interrupt API. - */ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT -/* - * alt_ic_isr_register() can be used to register an interrupt handler. If the - * function is succesful, then the requested interrupt will be enabled upon - * return. - */ -extern int alt_ic_isr_register(alt_u32 ic_id, - alt_u32 irq, - alt_isr_func isr, - void *isr_context, - void *flags); - -/* - * alt_ic_irq_enable() and alt_ic_irq_disable() enable/disable a specific - * interrupt by using IRQ port and interrupt controller instance. - */ -int alt_ic_irq_enable (alt_u32 ic_id, alt_u32 irq); -int alt_ic_irq_disable(alt_u32 ic_id, alt_u32 irq); - - /* - * alt_ic_irq_enabled() indicates whether a specific interrupt, as - * specified by IRQ port and interrupt controller instance is enabled. - */ -alt_u32 alt_ic_irq_enabled(alt_u32 ic_id, alt_u32 irq); - -#else -/* - * Prototypes for the legacy interrupt API. - */ -#include "priv/alt_legacy_irq.h" -#endif - - -/* - * alt_irq_pending() returns a bit list of the current pending interrupts. - * This is used by alt_irq_handler() to determine which registered interrupt - * handlers should be called. - * - * This routine is only available for the Nios II internal interrupt - * controller. - */ -#ifndef NIOS2_EIC_PRESENT -static ALT_INLINE alt_u32 ALT_ALWAYS_INLINE alt_irq_pending (void) -{ - alt_u32 active; - - NIOS2_READ_IPENDING (active); - - return active; -} -#endif - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_IRQ_H__ */ diff --git a/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_irq_entry.h b/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_irq_entry.h deleted file mode 100644 index e2008d9..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_irq_entry.h +++ /dev/null @@ -1,39 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * This file pulls in the IRQ entry assembler and C code, which is only - * required if there are any interruptes in the system. - */ - -__asm__( "\n\t.globl alt_irq_entry" ); - -__asm__( "\n\t.globl alt_irq_handler" ); - diff --git a/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_license_reminder_ucosii.h b/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_license_reminder_ucosii.h deleted file mode 100644 index 2fe649c..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_license_reminder_ucosii.h +++ /dev/null @@ -1,77 +0,0 @@ -#ifndef __ALT_LICENSE_REMINDER_UCOSII_H__ -#define __ALT_LICENSE_REMINDER_UCOSII_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include - -#define ALT_LICENSE_REMINDER_UCOSII_STRING \ - "============== Software License Reminder ===============\n" \ - "\n" \ - "uC/OS-II is provided in source form for FREE evaluation,\n" \ - "for educational use, or for peaceful research. If you\n" \ - "plan on using uC/OS-II in a commercial product you need\n" \ - "to contact Micrium to properly license its use in your\n" \ - "product. Micrium provides ALL the source code on the\n" \ - "Altera distribution for your convenience and to help you\n" \ - "experience uC/OS-II. The fact that the source is provided\n" \ - "does NOT mean that you can use it without paying a\n" \ - "licensing fee. Please help us continue to provide the\n" \ - "Embedded community with the finest software available.\n" \ - "Your honesty is greatly appreciated.\n" \ - "\n" \ - "Please contact:\n" \ - "\n" \ - "M I C R I U M\n" \ - "949 Crestview Circle\n" \ - "Weston, FL 33327-1848\n" \ - "U.S.A.\n" \ - "\n" \ - "Phone : +1 954 217 2036\n" \ - "FAX : +1 954 217 2037\n" \ - "WEB : www.micrium.com\n" \ - "E-mail: Sales@Micrium.com\n" \ - "\n" \ - "========================================================\n" - -#define alt_license_reminder_ucosii() puts(ALT_LICENSE_REMINDER_UCOSII_STRING) - - -#endif /* __ALT_LICENSE_REMINDER_UCOSII_H__ */ - diff --git a/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_llist.h b/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_llist.h deleted file mode 100644 index 46f81ce..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_llist.h +++ /dev/null @@ -1,123 +0,0 @@ -#ifndef __ALT_LIST_H__ -#define __ALT_LIST_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "alt_types.h" - -/* - * alt_llist.h defines structures and functions for use in manipulating linked - * lists. A list is considered to be constructed from a chain of objects of - * type alt_llist, with one object being defined to be the head element. - * - * A list is considered to be empty if it only contains the head element. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * alt_llist is the structure used to represent an element within a linked - * list. - */ - -typedef struct alt_llist_s alt_llist; - -struct alt_llist_s { - alt_llist* next; /* Pointer to the next element in the list. */ - alt_llist* previous; /* Pointer to the previous element in the list. */ -}; - -/* - * ALT_LLIST_HEAD is a macro that can be used to create the head of a new - * linked list. This is named "head". The head element is initialised to - * represent an empty list. - */ - -#define ALT_LLIST_HEAD(head) alt_llist head = {&head, &head} - -/* - * ALT_LLIST_ENTRY is a macro used to define an uninitialised linked list - * entry. This is used to reserve space in structure initialisation for - * structures that inherit form alt_llist. - */ - -#define ALT_LLIST_ENTRY {0, 0} - -/* - * alt_llist_insert() insert adds the linked list entry "entry" as the - * first entry in the linked list "list". "list" is the list head element. - */ - -static ALT_INLINE void ALT_ALWAYS_INLINE alt_llist_insert(alt_llist* list, - alt_llist* entry) -{ - entry->previous = list; - entry->next = list->next; - - list->next->previous = entry; - list->next = entry; -} - -/* - * alt_llist_remove() is called to remove an element from a linked list. The - * input argument is the element to remove. - */ - -static ALT_INLINE void ALT_ALWAYS_INLINE alt_llist_remove(alt_llist* entry) -{ - entry->next->previous = entry->previous; - entry->previous->next = entry->next; - - /* - * Set the entry to point to itself, so that any further calls to - * alt_llist_remove() are harmless. - */ - - entry->previous = entry; - entry->next = entry; -} - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_LLIST_H__ */ diff --git a/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_load.h b/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_load.h deleted file mode 100644 index 432e9f2..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_load.h +++ /dev/null @@ -1,78 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "alt_types.h" - -/* - * This macro is used to load code/data from its load address to its - * execution address for a given section. The section name is the input - * argument. Note that a leading '.' is assumed in the name. For example - * to load the section .onchip_ram, use: - * - * ALT_LOAD_SECTION_BY_NAME(onchip_ram); - * - * This requires that the apropriate linker symbols have been generated - * for the section in question. This will be the case if you are using the - * default linker script. - */ - -#define ALT_LOAD_SECTION_BY_NAME(name) \ - { \ - extern void _alt_partition_##name##_start; \ - extern void _alt_partition_##name##_end; \ - extern void _alt_partition_##name##_load_addr; \ - \ - alt_load_section(&_alt_partition_##name##_load_addr, \ - &_alt_partition_##name##_start, \ - &_alt_partition_##name##_end); \ - } - -/* - * Function used to load an individual section from flash to RAM. - * - * There is an implicit assumption here that the linker script will ensure - * that all sections are word aligned. - * - */ - -static void ALT_INLINE alt_load_section (alt_u32* from, - alt_u32* to, - alt_u32* end) -{ - if (to != from) - { - while( to != end ) - { - *to++ = *from++; - } - } -} diff --git a/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_log_printf.h b/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_log_printf.h deleted file mode 100644 index c15ca05..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_log_printf.h +++ /dev/null @@ -1,349 +0,0 @@ -/* alt_log_printf.h - * - * ALT_LOG is designed to provide extra logging/debugging messages from HAL - * through a different port than stdout. It is enabled by the ALT_LOG_ENABLE - * define, which needs to supplied at compile time. When logging is turned off, - * code size is unaffected. Thus, this should be transparent to the user - * when it is not actively turned on, and should not affect projects in any way. - * - * There are macros sprinkled within different components, such as the jtag uart - * and timer, in the HAL code. They are always named ALT_LOG_, and can be - * safely ignored if ALT_LOG is turned off. - * - * To turn on ALT_LOG, ALT_LOG_ENABLE must be defined, and ALT_LOG_PORT_TYPE and - * ALT_LOG_PORT_BASE must be set in system.h. This is done through editing - * .ptf, by editing the alt_log_port_type & alt_log_port_base settings. - * See the documentation html file for examples. - * - * When it is turned on, it will output extra HAL messages to a port specified - * in system.h. This can be a UART or JTAG UART port. By default it will - * output boot messages, detailing every step of the boot process. - * - * Extra logging is designed to be enabled by flags, which are defined in - * alt_log_printf.c. The default value is that all flags are off, so only the - * boot up logging messages show up. ALT_LOG_FLAGS can be set to enable certain - * groupings of flags, and that grouping is done in this file. Each flag can - * also be overridden with a -D at compile time. - * - * This header file includes the necessary prototypes for using the alt_log - * functions. It also contains all the macros that are used to remove the code - * from alt log is turned off. Also, the macros in other HAL files are defined - * here at the bottom. These macros all call some C function that is in - * alt_log_printf.c. - * - * The logging has functions for printing in C (ALT_LOG_PRINTF) and in assembly - * (ALT_LOG_PUTS). This was needed because the assembly printing occurs before - * the device is initialized. The assembly function corrupts register R4-R7, - * which are not used in the normal boot process. For this reason, do not call - * the assembly function in C. - * - * author: gkwan - */ - - -#ifndef __ALT_LOG_PRINTF_H__ -#define __ALT_LOG_PRINTF_H__ - -#include - -/* Global switch to turn on logging functions */ -#ifdef ALT_LOG_ENABLE - - /* ALT_LOG_PORT_TYPE values as defined in system.h. They are defined as - * numbers here first becasue the C preprocessor does not handle string - * comparisons. */ - #define ALTERA_AVALON_JTAG_UART 1 - #define ALTERA_AVALON_UART 0 - - /* If this .h file is included by an assembly file, skip over include files - * that won't compile in assembly. */ - #ifndef ALT_ASM_SRC - #include - #include "sys/alt_alarm.h" - #include "sys/alt_dev.h" - #ifdef __ALTERA_AVALON_JTAG_UART - #include "altera_avalon_jtag_uart.h" - #endif - #endif /* ALT_ASM_SRC */ - - /* These are included for the port register offsets and masks, needed - * to write to the port. Only include if the port type is set correctly, - * otherwise error. If alt_log is turned on and the port to output to is - * incorrect or does not exist, then should exit. */ - #if ALT_LOG_PORT_TYPE == ALTERA_AVALON_JTAG_UART - #ifdef __ALTERA_AVALON_JTAG_UART - #include - #else - #error ALT_LOG: JTAG_UART port chosen, but no JTAG_UART in system. - #endif - #elif ALT_LOG_PORT_TYPE == ALTERA_AVALON_UART - #ifdef __ALTERA_AVALON_UART - #include - #else - #error ALT_LOG: UART Port chosen, but no UART in system. - #endif - #else - #error ALT_LOG: alt_log_port_type declaration invalid! - #endif - - /* ALT_LOG_ENABLE turns on the basic printing function */ - #define ALT_LOG_PRINTF(...) do {alt_log_printf_proc(__VA_ARGS__);} while (0) - - /* Assembly macro for printing in assembly, calls tx_log_str - * which is in alt_log_macro.S. - * If alt_log_boot_on_flag is 0, skips the printing */ - #define ALT_LOG_PUTS(str) movhi r4, %hiadj(alt_log_boot_on_flag) ; \ - addi r4, r4, %lo(alt_log_boot_on_flag) ; \ - ldwio r5, 0(r4) ; \ - beq r0, r5, 0f ; \ - movhi r4, %hiadj(str) ; \ - addi r4, r4, %lo(str) ; \ - call tx_log_str ; \ - 0: - - /* These defines are here to faciliate the use of one output function - * (alt_log_txchar) to print to both the JTAG UART or the UART. Depending - * on the port type, the status register, read mask, and output register - * are set to the appropriate value for the port. */ - #if ALT_LOG_PORT_TYPE == ALTERA_AVALON_JTAG_UART - #define ALT_LOG_PRINT_REG_RD IORD_ALTERA_AVALON_JTAG_UART_CONTROL - #define ALT_LOG_PRINT_MSK ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_MSK - #define ALT_LOG_PRINT_TXDATA_WR IOWR_ALTERA_AVALON_JTAG_UART_DATA - #define ALT_LOG_PRINT_REG_OFFSET (ALTERA_AVALON_JTAG_UART_CONTROL_REG*0x4) - #define ALT_LOG_PRINT_TXDATA_REG_OFFSET (ALTERA_AVALON_JTAG_UART_DATA_REG*0x4) - #elif ALT_LOG_PORT_TYPE == ALTERA_AVALON_UART - #define ALT_LOG_PRINT_REG_RD IORD_ALTERA_AVALON_UART_STATUS - #define ALT_LOG_PRINT_MSK ALTERA_AVALON_UART_STATUS_TRDY_MSK - #define ALT_LOG_PRINT_TXDATA_WR IOWR_ALTERA_AVALON_UART_TXDATA - #define ALT_LOG_PRINT_REG_OFFSET (ALTERA_AVALON_UART_STATUS_REG*0x4) - #define ALT_LOG_PRINT_TXDATA_REG_OFFSET (ALTERA_AVALON_UART_TXDATA_REG*0x4) - #endif /* ALT_LOG_PORT */ - - /* Grouping of flags via ALT_LOG_FLAGS. Each specific flag can be set via - * -D at compile time, or else they'll be set to a default value according - * to ALT_LOG_FLAGS. ALT_LOG_FLAGS = 0 or not set is the default, where - * only the boot messages will be printed. As ALT_LOG_FLAGS increase, they - * increase in intrusiveness to the program, and will affect performance. - * - * Flag Level 1 - turns on system clock and JTAG UART startup status - * 2 - turns on write echo and JTAG_UART alarm (periodic report) - * 3 - turns on JTAG UART ISR logging - will slow performance - * significantly. - * -1 - All logging output is off, but if ALT_LOG_ENABLE is - * defined all logging function is built and code size - * remains constant - * - * Flag settings - 1 = on, 0 = off. */ - - /* This flag turns on "boot" messages for printing. This includes messages - * during crt0.S, then alt_main, and finally alt_exit. */ - #ifndef ALT_LOG_BOOT_ON_FLAG_SETTING - #if ALT_LOG_FLAGS == 1 - #define ALT_LOG_BOOT_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 2 - #define ALT_LOG_BOOT_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 3 - #define ALT_LOG_BOOT_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == -1 /* silent mode */ - #define ALT_LOG_BOOT_ON_FLAG_SETTING 0x0 - #else /* default setting */ - #define ALT_LOG_BOOT_ON_FLAG_SETTING 0x1 - #endif - #endif /* ALT_LOG_BOOT_ON_FLAG_SETTING */ - - #ifndef ALT_LOG_SYS_CLK_ON_FLAG_SETTING - #if ALT_LOG_FLAGS == 1 - #define ALT_LOG_SYS_CLK_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 2 - #define ALT_LOG_SYS_CLK_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 3 - #define ALT_LOG_SYS_CLK_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == -1 /* silent mode */ - #define ALT_LOG_SYS_CLK_ON_FLAG_SETTING 0x0 - #else /* default setting */ - #define ALT_LOG_SYS_CLK_ON_FLAG_SETTING 0x0 - #endif - #endif /* ALT_LOG_SYS_CLK_ON_FLAG_SETTING */ - - #ifndef ALT_LOG_WRITE_ON_FLAG_SETTING - #if ALT_LOG_FLAGS == 1 - #define ALT_LOG_WRITE_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 2 - #define ALT_LOG_WRITE_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 3 - #define ALT_LOG_WRITE_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == -1 /* silent mode */ - #define ALT_LOG_WRITE_ON_FLAG_SETTING 0x0 - #else /* default setting */ - #define ALT_LOG_WRITE_ON_FLAG_SETTING 0x0 - #endif - #endif /* ALT_LOG_WRITE_ON_FLAG_SETTING */ - - #ifndef ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING - #ifndef __ALTERA_AVALON_JTAG_UART - #define ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 1 - #define ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 2 - #define ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 3 - #define ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == -1 /* silent mode */ - #define ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING 0x0 - #else /* default setting */ - #define ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING 0x0 - #endif - #endif /* ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING */ - - #ifndef ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING - #ifndef __ALTERA_AVALON_JTAG_UART - #define ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 1 - #define ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 2 - #define ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 3 - #define ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == -1 /* silent mode */ - #define ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING 0x0 - #else /* default setting */ - #define ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING 0x0 - #endif - #endif /* ALT_LOG_JTAG_UART_STARTUP_INFO_FLAG_SETTING */ - - #ifndef ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING - #ifndef __ALTERA_AVALON_JTAG_UART - #define ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 1 - #define ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 2 - #define ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 3 - #define ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == -1 /* silent mode */ - #define ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING 0x0 - #else /* default setting */ - #define ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING 0x0 - #endif - #endif /* ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING */ - -#ifndef ALT_ASM_SRC - /* Function Prototypes */ - void alt_log_txchar(int c,char *uartBase); - void alt_log_private_printf(const char *fmt,int base,va_list args); - void alt_log_repchar(char c,int r,int base); - int alt_log_printf_proc(const char *fmt, ... ); - void alt_log_system_clock(); - #ifdef __ALTERA_AVALON_JTAG_UART - alt_u32 altera_avalon_jtag_uart_report_log(void * context); - void alt_log_jtag_uart_startup_info(altera_avalon_jtag_uart_state* dev, int base); - void alt_log_jtag_uart_print_control_reg(altera_avalon_jtag_uart_state* dev, \ - int base, const char* header); - void alt_log_jtag_uart_isr_proc(int base, altera_avalon_jtag_uart_state* dev); - #endif - void alt_log_write(const void *ptr, size_t len); - - /* extern all global variables */ - extern volatile alt_u32 alt_log_boot_on_flag; - extern volatile alt_u8 alt_log_write_on_flag; - extern volatile alt_u8 alt_log_sys_clk_on_flag; - extern volatile alt_u8 alt_log_jtag_uart_alarm_on_flag; - extern volatile alt_u8 alt_log_jtag_uart_isr_on_flag; - extern volatile alt_u8 alt_log_jtag_uart_startup_info_on_flag; - extern volatile int alt_log_sys_clk_count; - extern volatile int alt_system_clock_in_sec; - extern alt_alarm alt_log_jtag_uart_alarm_1; -#endif /* ALT_ASM_SRC */ - - - /* Below are the MACRO defines used in various HAL files. They check - * if their specific flag is turned on; if it is, then it executes its - * code. - * - * To keep this file reasonable, most of these macros calls functions, - * which are defined in alt_log_printf.c. Look there for implementation - * details. */ - - /* Boot Messages Logging */ - #define ALT_LOG_PRINT_BOOT(...) \ - do { if (alt_log_boot_on_flag==1) {ALT_LOG_PRINTF(__VA_ARGS__);} \ - } while (0) - - /* JTAG UART Logging */ - /* number of ticks before alarm runs logging function */ - #ifndef ALT_LOG_JTAG_UART_TICKS_DIVISOR - #define ALT_LOG_JTAG_UART_TICKS_DIVISOR 10 - #endif - #ifndef ALT_LOG_JTAG_UART_TICKS - #define ALT_LOG_JTAG_UART_TICKS \ - (alt_ticks_per_second()/ALT_LOG_JTAG_UART_TICKS_DIVISOR) - #endif - - /* if there's a JTAG UART defined, then enable these macros */ - #ifdef __ALTERA_AVALON_JTAG_UART - - /* Macro in altera_avalon_jtag_uart.c, to register the alarm function. - * Also, the startup register info is also printed here, as this is - * called within the device driver initialization. */ - #define ALT_LOG_JTAG_UART_ALARM_REGISTER(dev, base) \ - do { if (alt_log_jtag_uart_alarm_on_flag==1) { \ - alt_alarm_start(&alt_log_jtag_uart_alarm_1, \ - ALT_LOG_JTAG_UART_TICKS, &altera_avalon_jtag_uart_report_log,\ - dev);} \ - if (alt_log_jtag_uart_startup_info_on_flag==1) {\ - alt_log_jtag_uart_startup_info(dev, base);} \ - } while (0) - - /* JTAG UART IRQ Logging (when buffer is empty) - * Inserted in the ISR in altera_avalon_jtag_uart.c */ - #define ALT_LOG_JTAG_UART_ISR_FUNCTION(base, dev) \ - do { alt_log_jtag_uart_isr_proc(base, dev); } while (0) - /* else, define macros to nothing. Or else the jtag_uart specific types - * will throw compiler errors */ - #else - #define ALT_LOG_JTAG_UART_ALARM_REGISTER(dev, base) - #define ALT_LOG_JTAG_UART_ISR_FUNCTION(base, dev) - #endif - - /* System clock logging - * How often (in seconds) the system clock logging prints. - * The default value is every 1 second */ - #ifndef ALT_LOG_SYS_CLK_INTERVAL_MULTIPLIER - #define ALT_LOG_SYS_CLK_INTERVAL_MULTIPLIER 1 - #endif - #ifndef ALT_LOG_SYS_CLK_INTERVAL - #define ALT_LOG_SYS_CLK_INTERVAL \ - (alt_ticks_per_second()*ALT_LOG_SYS_CLK_INTERVAL_MULTIPLIER) - #endif - - /* System clock logging - prints a message every interval (set above) - * to show that the system clock is alive. - * This macro is used in altera_avalon_timer_sc.c */ - #define ALT_LOG_SYS_CLK_HEARTBEAT() \ - do { alt_log_system_clock(); } while (0) - - /* alt_write_logging - echos a message every time write() is called, - * displays the first ALT_LOG_WRITE_ECHO_LEN characters. - * This macro is used in alt_write.c */ - #ifndef ALT_LOG_WRITE_ECHO_LEN - #define ALT_LOG_WRITE_ECHO_LEN 15 - #endif - - #define ALT_LOG_WRITE_FUNCTION(ptr,len) \ - do { alt_log_write(ptr,len); } while (0) - -#else /* ALT_LOG_ENABLE not defined */ - - /* logging is off, set all relevant macros to null */ - #define ALT_LOG_PRINT_BOOT(...) - #define ALT_LOG_PRINTF(...) - #define ALT_LOG_JTAG_UART_ISR_FUNCTION(base, dev) - #define ALT_LOG_JTAG_UART_ALARM_REGISTER(dev, base) - #define ALT_LOG_SYS_CLK_HEARTBEAT() - #define ALT_LOG_PUTS(str) - #define ALT_LOG_WRITE_FUNCTION(ptr,len) - -#endif /* ALT_LOG_ENABLE */ - -#endif /* __ALT_LOG_PRINTF_H__ */ - diff --git a/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_set_args.h b/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_set_args.h deleted file mode 100644 index 3750e67..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_set_args.h +++ /dev/null @@ -1,71 +0,0 @@ -#ifndef __ALT_SET_ARGS_H__ -#define __ALT_SET_ARGS_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The function alt_set_args() is provided in order to define the input - * arguments to main(). If this function is not called before main() then the - * argument list passed to main() will be empty. - * - * It is expected that this function will only be used by the ihost/iclient - * utility. - */ - -static inline void alt_set_args (int argc, char** argv, char** envp) -{ - extern int alt_argc; - extern char** alt_argv; - extern char** alt_envp; - - alt_argc = argc; - alt_argv = argv; - alt_envp = envp; -} - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_SET_ARGS_H__ */ diff --git a/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_sim.h b/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_sim.h deleted file mode 100644 index 06bd27a..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_sim.h +++ /dev/null @@ -1,91 +0,0 @@ -#ifndef __ALT_SIM_H__ -#define __ALT_SIM_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ -#include "system.h" -#include "alt_types.h" - -/* - * Instructions that might mean something special to a simulator. - * These have no special effect on real hardware (they are just nops). - */ -#define ALT_SIM_FAIL() \ - do { __asm volatile ("cmpltui r0, r0, 0xabc1"); } while (0) - -#define ALT_SIM_PASS() \ - do { __asm volatile ("cmpltui r0, r0, 0xabc2"); } while (0) - -#define ALT_SIM_IN_TOP_OF_HOT_LOOP() \ - do { __asm volatile ("cmpltui r0, r0, 0xabc3"); } while (0) - -/* - * Routine called on exit. - */ -static ALT_ALWAYS_INLINE void alt_sim_halt(int exit_code) -{ - int r2 = exit_code; - -#if defined(NIOS2_HAS_DEBUG_STUB) && (defined(ALT_BREAK_ON_EXIT) || defined(ALT_PROVIDE_GMON)) - - int r3 = (1 << 2); - -#ifdef ALT_PROVIDE_GMON - extern unsigned int alt_gmon_data[]; - int r4 = (int)alt_gmon_data; - r3 |= (1 << 4); -#define ALT_GMON_DATA ,"D04"(r4) -#else -#define ALT_GMON_DATA -#endif /* ALT_PROVIDE_GMON */ - - if (r2) { - ALT_SIM_FAIL(); - } else { - ALT_SIM_PASS(); - } - - __asm__ volatile ("\n0:\n\taddi %0,%0, -1\n\tbgt %0,zero,0b" : : "r" (ALT_CPU_FREQ/100) ); /* Delay for >30ms */ - - __asm__ volatile ("break 2" : : "D02"(r2), "D03"(r3) ALT_GMON_DATA ); - -#else /* !DEBUG_STUB */ - if (r2) { - ALT_SIM_FAIL(); - } else { - ALT_SIM_PASS(); - } -#endif /* DEBUG_STUB */ -} - -#define ALT_SIM_HALT(exit_code) \ - alt_sim_halt(exit_code) - -#endif /* __ALT_SIM_H__ */ diff --git a/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_stack.h b/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_stack.h deleted file mode 100644 index e30652a..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_stack.h +++ /dev/null @@ -1,126 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#ifndef __ALT_STACK_H__ -#define __ALT_STACK_H__ - -/* - * alt_stack.h is the nios2 specific implementation of functions used by the - * stack overflow code. - */ - -#include "nios2.h" - -#include "alt_types.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - - -extern char * alt_stack_limit_value; - -#ifdef ALT_EXCEPTION_STACK -extern char __alt_exception_stack_pointer[]; /* set by the linker */ -#endif /* ALT_EXCEPTION_STACK */ - - -/* - * alt_stack_limit can be called to determine the current value of the stack - * limit register. - */ - -static ALT_INLINE char * ALT_ALWAYS_INLINE alt_stack_limit (void) -{ - char * limit; - NIOS2_READ_ET(limit); - - return limit; -} - -/* - * alt_stack_pointer can be called to determine the current value of the stack - * pointer register. - */ - -static ALT_INLINE char * ALT_ALWAYS_INLINE alt_stack_pointer (void) -{ - char * pointer; - NIOS2_READ_SP(pointer); - - return pointer; -} - - -#ifdef ALT_EXCEPTION_STACK - -/* - * alt_exception_stack_pointer returns the normal stack pointer from - * where it is stored on the exception stack (uppermost 4 bytes). This - * is really only useful during exception processing, and is only - * available if a separate exception stack has been configured. - */ - -static ALT_INLINE char * ALT_ALWAYS_INLINE alt_exception_stack_pointer (void) -{ - return (char *) *(alt_u32 *)(__alt_exception_stack_pointer - sizeof(alt_u32)); -} - -#endif /* ALT_EXCEPTION_STACK */ - - -/* - * alt_set_stack_limit can be called to update the current value of the stack - * limit register. - */ - -static ALT_INLINE void ALT_ALWAYS_INLINE alt_set_stack_limit (char * limit) -{ - alt_stack_limit_value = limit; - NIOS2_WRITE_ET(limit); -} - -/* - * alt_report_stack_overflow reports that a stack overflow happened. - */ - -static ALT_INLINE void ALT_ALWAYS_INLINE alt_report_stack_overflow (void) -{ - NIOS2_REPORT_STACK_OVERFLOW(); -} - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_STACK_H__ */ - diff --git a/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_stdio.h b/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_stdio.h deleted file mode 100644 index 1730360..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_stdio.h +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef __ALT_STDIO_H__ -#define __ALT_STDIO_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * Definitions for ALT stdio routines. - */ - -#include - - -#ifdef __cplusplus -extern "C" { -#endif - -int alt_getchar(); -int alt_putchar(int c); -int alt_putstr(const char* str); -void alt_printf(const char *fmt, ...); - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_STDIO_H__ */ diff --git a/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_sys_init.h b/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_sys_init.h deleted file mode 100644 index e4abc28..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_sys_init.h +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef __ALT_SYS_INIT_H__ -#define __ALT_SYS_INIT_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The function alt_sys_init() is defined within the auto-generated file: - * alt_sys_init.c. This function calls the initilisation macros for all - * devices, file systems, and software components within the system. - * - * The list of initilisation macros to use is constructed using the PTF and - * STF files associated with the system. - */ - -extern void alt_sys_init (void); - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_SYS_INIT_H__ */ diff --git a/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_sys_wrappers.h b/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_sys_wrappers.h deleted file mode 100644 index 044833b..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_sys_wrappers.h +++ /dev/null @@ -1,100 +0,0 @@ -#ifndef __ALT_SYS_WRAPPERS_H__ -#define __ALT_SYS_WRAPPERS_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * This file provides the prototypes for the HAL 'UNIX style functions. The - * names of these functions are defined in alt_syscall.h. THese are defined to - * be the standard names when running the standalone HAL, e.g. open(), close() - * etc., but the names may be redefined as a part of an operating system port - * in order to avoid name clashes. - */ - -#include "os/alt_syscall.h" - -#include -#include -#include -#include -#include -#include - -extern int ALT_CLOSE (int __fd); -extern int ALT_EXECVE (const char *__path, - char * const __argv[], - char * const __envp[]); -extern void ALT_EXIT (int __status); -extern int ALT_FSTAT (int file, struct stat *st); -extern int ALT_FCNTL (int file, int cmd, ...); -extern pid_t ALT_FORK (void); -extern pid_t ALT_GETPID (void); - -#if defined (__GNUC__) && __GNUC__ >= 4 -extern int ALT_GETTIMEOFDAY (struct timeval *ptimeval, - void *ptimezone); -#else -extern int ALT_GETTIMEOFDAY (struct timeval *ptimeval, - struct timezone *ptimezone); -#endif - -extern int ALT_IOCTL (int file, int req, void* arg); -extern int ALT_ISATTY (int file); -extern int ALT_KILL (int pid, int sig); -extern int ALT_LINK (const char *existing, const char *new); -extern off_t ALT_LSEEK (int file, off_t ptr, int dir); -extern int ALT_OPEN (const char* file, int flags, ...); -extern int ALT_READ (int file, void *ptr, size_t len); -extern int ALT_RENAME (char *existing, char *new); -extern void* ALT_SBRK (ptrdiff_t incr); -extern int ALT_SETTIMEOFDAY (const struct timeval *t, - const struct timezone *tz); -extern int ALT_STAT (const char *file, struct stat *st); -extern clock_t ALT_TIMES (struct tms *buf); -extern int ALT_UNLINK (const char *name); - -#if defined (__GNUC__) && __GNUC__ >= 4 -int ALT_USLEEP (useconds_t us); -#else -unsigned int ALT_USLEEP (unsigned int us); -#endif - -extern int ALT_WAIT (int *status); -extern int ALT_WRITE (int file, const void *ptr, size_t len); - - -extern char** ALT_ENVIRON; - -/* - * - */ - -#endif /* __ALT_SYS_WRAPPERS_H__ */ diff --git a/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_timestamp.h b/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_timestamp.h deleted file mode 100644 index 8a18da2..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_timestamp.h +++ /dev/null @@ -1,60 +0,0 @@ -#ifndef __ALT_TIMESTAMP_H__ -#define __ALT_TIMESTAMP_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "alt_types.h" -#include "altera_avalon_timer.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -extern int alt_timestamp_start (void); - -extern alt_timestamp_type alt_timestamp (void); - -extern alt_u32 alt_timestamp_freq (void); - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_TIMESTAMP_H__ */ diff --git a/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_warning.h b/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_warning.h deleted file mode 100644 index b66e71a..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/alt_warning.h +++ /dev/null @@ -1,75 +0,0 @@ -#ifndef __WARNING_H__ -#define __WARNING_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * alt_warning.h provides macro definitions that can be used to generate link - * time warnings. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The symbol "__alt_invalid" is used to force a link error. There should be - * no corresponding implementation of this function. - */ - -extern void __alt_invalid (void); - -#define ALT_LINK_WARNING(symbol, msg) \ - __asm__(".ifndef __evoke_link_warning_" #symbol \ - "\n\t .section .gnu.warning." #symbol \ - "\n__evoke_link_warning_" #symbol ":\n\t .string \x22" msg "\x22 \n\t .previous" \ - "\n .endif"); - -/* A canned warning for sysdeps/stub functions. */ - -#define ALT_STUB_WARNING(name) \ - ALT_LINK_WARNING (name, \ - "warning: " #name " is not implemented and will always fail") - -#define ALT_OBSOLETE_FUNCTION_WARNING(name) \ - ALT_LINK_WARNING (name, \ - "warning: " #name " is a deprecated function") - -#define ALT_LINK_ERROR(msg) \ - ALT_LINK_WARNING (__alt_invalid, msg); \ - __alt_invalid() - -#ifdef __cplusplus -} -#endif - -#endif /* __WARNING_H__ */ diff --git a/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/ioctl.h b/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/ioctl.h deleted file mode 100644 index 4d565df..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/ioctl.h +++ /dev/null @@ -1,90 +0,0 @@ -#ifndef __IOCTL_H__ -#define __IOCTL_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The ioctl() system call be used to initiate a variety of control operations - * on a file descriptor. For the most part this simply translates to a call to - * the ioctl() function of the associated device driver (TIOCEXCL and - * TIOCNXCL are notable exceptions - see ioctl.c for details). - * - * The interpretation of the ioctl requests are therefore device specific. - * - * This function is equivalent to the standard Posix ioctl() call. - */ - -extern int ioctl (int fd, int req, void* arg); - -/* - * list of ioctl calls handled by the system ioctl implementation. - */ - -#define TIOCEXCL 0x740d /* exclusive use of the device */ -#define TIOCNXCL 0x740e /* allow multiple use of the device */ - -/* - * ioctl calls which can be handled by device drivers. - */ - -#define TIOCOUTQ 0x7472 /* get output queue size */ -#define TIOCMGET 0x741d /* get termios flags */ -#define TIOCMSET 0x741a /* set termios flags */ - -/* - * ioctl calls specific to JTAG UART. - */ - -#define TIOCSTIMEOUT 0x6a01 /* Set Timeout before assuming no host present */ -#define TIOCGCONNECTED 0x6a02 /* Get indication of whether host is connected */ - -/* - * - */ - -#ifdef __cplusplus -} -#endif - -#endif /* __IOCTL_H__ */ diff --git a/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/termios.h b/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/termios.h deleted file mode 100644 index cd09539..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/inc/sys/termios.h +++ /dev/null @@ -1,181 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * This is the termios.h file provided with newlib. The only modification has - * been to the baud rate macro definitions, and an increase in the size of the - * termios structure to accomodate this. - */ - - -#ifndef _SYS_TERMIOS_H -# define _SYS_TERMIOS_H - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -# define _XCGETA (('x'<<8)|1) -# define _XCSETA (('x'<<8)|2) -# define _XCSETAW (('x'<<8)|3) -# define _XCSETAF (('x'<<8)|4) -# define _TCSBRK (('T'<<8)|5) -# define _TCFLSH (('T'<<8)|7) -# define _TCXONC (('T'<<8)|6) - -# define TCOOFF 0 -# define TCOON 1 -# define TCIOFF 2 -# define TCION 3 - -# define TCIFLUSH 0 -# define TCOFLUSH 1 -# define TCIOFLUSH 2 - -# define NCCS 13 - -# define TCSAFLUSH _XCSETAF -# define TCSANOW _XCSETA -# define TCSADRAIN _XCSETAW -# define TCSADFLUSH _XCSETAF - -# define IGNBRK 000001 -# define BRKINT 000002 -# define IGNPAR 000004 -# define INPCK 000020 -# define ISTRIP 000040 -# define INLCR 000100 -# define IGNCR 000200 -# define ICRNL 000400 -# define IXON 002000 -# define IXOFF 010000 - -# define OPOST 000001 -# define OCRNL 000004 -# define ONLCR 000010 -# define ONOCR 000020 -# define TAB3 014000 - -# define CLOCAL 004000 -# define CREAD 000200 -# define CSIZE 000060 -# define CS5 0 -# define CS6 020 -# define CS7 040 -# define CS8 060 -# define CSTOPB 000100 -# define HUPCL 002000 -# define PARENB 000400 -# define PAODD 001000 - -#define CCTS_OFLOW 010000 -#define CRTS_IFLOW 020000 -#define CRTSCTS (CCTS_OFLOW | CRTS_IFLOW) - -# define ECHO 0000010 -# define ECHOE 0000020 -# define ECHOK 0000040 -# define ECHONL 0000100 -# define ICANON 0000002 -# define IEXTEN 0000400 /* anybody know *what* this does?! */ -# define ISIG 0000001 -# define NOFLSH 0000200 -# define TOSTOP 0001000 - -# define VEOF 4 /* also VMIN -- thanks, AT&T */ -# define VEOL 5 /* also VTIME -- thanks again */ -# define VERASE 2 -# define VINTR 0 -# define VKILL 3 -# define VMIN 4 /* also VEOF */ -# define VQUIT 1 -# define VSUSP 10 -# define VTIME 5 /* also VEOL */ -# define VSTART 11 -# define VSTOP 12 - -# define B0 0 -# define B50 50 -# define B75 75 -# define B110 110 -# define B134 134 -# define B150 150 -# define B200 200 -# define B300 300 -# define B600 600 -# define B1200 1200 -# define B1800 1800 -# define B2400 2400 -# define B4800 4800 -# define B9600 9600 -# define B19200 19200 -# define B38400 38400 -# define B57600 57600 -# define B115200 115200 - -typedef unsigned char cc_t; -typedef unsigned short tcflag_t; -typedef unsigned long speed_t; - -struct termios { - tcflag_t c_iflag; - tcflag_t c_oflag; - tcflag_t c_cflag; - tcflag_t c_lflag; - char c_line; - cc_t c_cc[NCCS]; - speed_t c_ispeed; - speed_t c_ospeed; -}; - -# ifndef _NO_MACROS - -# define cfgetospeed(tp) ((tp)->c_ospeed) -# define cfgetispeed(tp) ((tp)->c_ispeed) -# define cfsetospeed(tp,s) (((tp)->c_ospeed = (s)), 0) -# define cfsetispeed(tp,s) (((tp)->c_ispeed = (s)), 0) -# define tcdrain(fd) _ioctl (fd, _TCSBRK, 1) -# endif /* _NO_MACROS */ - -#ifdef __cplusplus -} -#endif - -#endif /* _SYS_TERMIOS_H */ - diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_alarm_start.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_alarm_start.c deleted file mode 100644 index 7739959..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_alarm_start.c +++ /dev/null @@ -1,112 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "sys/alt_alarm.h" -#include "sys/alt_irq.h" - -/* - * alt_alarm_start is called to register an alarm with the system. The - * "alarm" structure passed as an input argument does not need to be - * initialised by the user. This is done within this function. - * - * The remaining input arguments are: - * - * nticks - The time to elapse until the alarm executes. This is specified in - * system clock ticks. - * callback - The function to run when the indicated time has elapsed. - * context - An opaque value, passed to the callback function. -* - * Care should be taken when defining the callback function since it is - * likely to execute in interrupt context. In particular, this mean that - * library calls like printf() should not be made, since they can result in - * deadlock. - * - * The interval to be used for the next callback is the return - * value from the callback function. A return value of zero indicates that the - * alarm should be unregistered. - * - * alt_alarm_start() will fail if the timer facility has not been enabled - * (i.e. there is no system clock). Failure is indicated by a negative return - * value. - */ - -int alt_alarm_start (alt_alarm* alarm, alt_u32 nticks, - alt_u32 (*callback) (void* context), - void* context) -{ - alt_irq_context irq_context; - alt_u32 current_nticks = 0; - - if (alt_ticks_per_second ()) - { - if (alarm) - { - alarm->callback = callback; - alarm->context = context; - - irq_context = alt_irq_disable_all (); - - current_nticks = alt_nticks(); - - alarm->time = nticks + current_nticks + 1; - - /* - * If the desired alarm time causes a roll-over, set the rollover - * flag. This will prevent the subsequent tick event from causing - * an alarm too early. - */ - if(alarm->time < current_nticks) - { - alarm->rollover = 1; - } - else - { - alarm->rollover = 0; - } - - alt_llist_insert (&alt_alarm_list, &alarm->llist); - alt_irq_enable_all (irq_context); - - return 0; - } - else - { - return -EINVAL; - } - } - else - { - return -ENOTSUP; - } -} diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_busy_sleep.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_busy_sleep.c deleted file mode 100644 index 561c0be..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_busy_sleep.c +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright (c) 2003-2004 Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - * - * ------------ - * - * Altera does not recommend, suggest or require that this reference design - * file be used in conjunction or combination with any other product. - * - * alt_busy_sleep.c - Microsecond delay routine which uses a calibrated busy - * loop to perform the delay. This is used to implement - * usleep for both uC/OS-II and the standalone HAL. - * - * Author PRR - * - * Calibrated delay with no timer required - * - * The ASM instructions in the routine are equivalent to - * - * for (i=0;i -#include - -#include "system.h" -#include "alt_types.h" - -#include "priv/alt_busy_sleep.h" - -unsigned int alt_busy_sleep (unsigned int us) -{ -/* - * Only delay if ALT_SIM_OPTIMIZE is not defined; i.e., if software - * is built targetting ModelSim RTL simulation, the delay will be - * skipped to speed up simulation. - */ -#ifndef ALT_SIM_OPTIMIZE - int i; - int big_loops; - alt_u32 cycles_per_loop; - - if (!strcmp(NIOS2_CPU_IMPLEMENTATION,"tiny")) - { - cycles_per_loop = 9; - } - else - { - cycles_per_loop = 3; - } - - - big_loops = us / (INT_MAX/ - (ALT_CPU_FREQ/(cycles_per_loop * 1000000))); - - if (big_loops) - { - for(i=0;i - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -#ifdef ALT_USE_DIRECT_DRIVERS - -int ALT_CLOSE (int fildes) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(close); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -/* - * close() is called by an application to release a file descriptor. If the - * associated file system/device has a close() callback function registered - * then this called. The file descriptor is then marked as free. - * - * ALT_CLOSE is mapped onto the close() system call in alt_syscall.h - */ - -int ALT_CLOSE (int fildes) -{ - alt_fd* fd; - int rval; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (fildes < 0) ? NULL : &alt_fd_list[fildes]; - - if (fd) - { - /* - * If the associated file system/device has a close function, call it so - * that any necessary cleanup code can run. - */ - - rval = (fd->dev->close) ? fd->dev->close(fd) : 0; - - /* Free the file descriptor structure and return. */ - - alt_release_fd (fildes); - if (rval < 0) - { - ALT_ERRNO = -rval; - return -1; - } - return 0; - } - else - { - ALT_ERRNO = EBADFD; - return -1; - } -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_dcache_flush.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_dcache_flush.c deleted file mode 100644 index 7ecc91a..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_dcache_flush.c +++ /dev/null @@ -1,97 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "nios2.h" -#include "system.h" - -#include "alt_types.h" -#include "sys/alt_cache.h" - -/* - * Nios II version 1.2 and newer supports the "flush by address" instruction, in - * addition to the "flush by line" instruction provided by older versions of - * the core. This newer instruction is used by preference when it is - * available. - */ - -#ifdef NIOS2_FLUSHDA_SUPPORTED -#define ALT_FLUSH_DATA(i) __asm__ volatile ("flushda (%0)" :: "r" (i)); -#else -#define ALT_FLUSH_DATA(i) __asm__ volatile ("flushd (%0)" :: "r" (i)); -#endif /* NIOS2_FLUSHDA_SUPPORTED */ - -/* - * alt_dcache_flush() is called to flush the data cache for a memory - * region of length "len" bytes, starting at address "start". - * - * Any dirty lines in the data cache are written back to memory. - */ - -void alt_dcache_flush (void* start, alt_u32 len) -{ -#if NIOS2_DCACHE_SIZE > 0 - - char* i; - char* end; - - /* - * This is the most we would ever need to flush. - * - * SPR 196942, 2006.01.13: The cache flush loop below will use the - * 'flushda' instruction if its available; in that case each line - * must be flushed individually, and thus 'len' cannot be trimmed. - */ - #ifndef NIOS2_FLUSHDA_SUPPORTED - if (len > NIOS2_DCACHE_SIZE) - { - len = NIOS2_DCACHE_SIZE; - } - #endif - - end = ((char*) start) + len; - - for (i = start; i < end; i+= NIOS2_DCACHE_LINE_SIZE) - { - ALT_FLUSH_DATA(i); - } - - /* - * For an unaligned flush request, we've got one more line left. - * Note that this is dependent on NIOS2_DCACHE_LINE_SIZE to be a - * multiple of 2 (which it always is). - */ - - if (((alt_u32) start) & (NIOS2_DCACHE_LINE_SIZE - 1)) - { - ALT_FLUSH_DATA(i); - } - -#endif /* NIOS2_DCACHE_SIZE > 0 */ -} diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_dcache_flush_all.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_dcache_flush_all.c deleted file mode 100644 index 6529231..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_dcache_flush_all.c +++ /dev/null @@ -1,51 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "nios2.h" -#include "system.h" - -#include "alt_types.h" -#include "sys/alt_cache.h" - -/* - * alt_dcache_flush_all() is called to flush the entire data cache. - */ - -void alt_dcache_flush_all (void) -{ -#if NIOS2_DCACHE_SIZE > 0 - char* i; - - for (i = (char*) 0; i < (char*) NIOS2_DCACHE_SIZE; i+= NIOS2_DCACHE_LINE_SIZE) - { - __asm__ volatile ("flushd (%0)" :: "r" (i)); - } -#endif /* NIOS2_DCACHE_SIZE > 0 */ -} diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_dcache_flush_no_writeback.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_dcache_flush_no_writeback.c deleted file mode 100644 index c65ca7d..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_dcache_flush_no_writeback.c +++ /dev/null @@ -1,88 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "nios2.h" -#include "system.h" - -#include "alt_types.h" -#include "sys/alt_cache.h" - -/* - * The INITDA instruction was added to Nios II in the 8.0 release. - * - * The INITDA instruction has one of the following possible behaviors - * depending on the processor configuration: - * 1) Flushes a line by address but does NOT write back dirty data. - * Occurs when a data cache is present that supports INITDA. - * The macro NIOS2_INITDA_SUPPORTED is defined in system.h. - * 2) Takes an unimplemented instruction exception. - * Occurs when a data cache is present that doesn't support INITDA. - * 3) Performs no operation - * Occurs when there is no data cache present. - * The macro NIOS2_DCACHE_SIZE is 0 in system.h. - */ - -#define ALT_FLUSH_DATA_NO_WRITEBACK(i) \ - __asm__ volatile ("initda (%0)" :: "r" (i)); - -/* - * alt_dcache_flush_no_writeback() is called to flush the data cache for a - * memory region of length "len" bytes, starting at address "start". - * - * Any dirty lines in the data cache are NOT written back to memory. - * Make sure you really want this behavior. If you aren't 100% sure, - * use the alt_dcache_flush() routine instead. - */ - -void alt_dcache_flush_no_writeback (void* start, alt_u32 len) -{ -#if defined(NIOS2_INITDA_SUPPORTED) - - char* i; - char* end = ((char*) start) + len; - - for (i = start; i < end; i+= NIOS2_DCACHE_LINE_SIZE) - { - ALT_FLUSH_DATA_NO_WRITEBACK(i); - } - - /* - * For an unaligned flush request, we've got one more line left. - * Note that this is dependent on NIOS2_DCACHE_LINE_SIZE to be a - * multiple of 2 (which it always is). - */ - - if (((alt_u32) start) & (NIOS2_DCACHE_LINE_SIZE - 1)) - { - ALT_FLUSH_DATA_NO_WRITEBACK(i); - } - -#endif /* NIOS2_INITDA_SUPPORTED */ -} diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_dev.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_dev.c deleted file mode 100644 index ebc15e5..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_dev.c +++ /dev/null @@ -1,149 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include -#include -#include - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - -#include "alt_types.h" - -#include "system.h" - -/* - * This file contains the data constructs used to control access to device and - * filesytems. - */ - -/* - * "alt_fs_list" is the head of a linked list of registered filesystems. It is - * initialised as an empty list. New entries can be added using the - * alt_fs_reg() function. - */ - -ALT_LLIST_HEAD(alt_fs_list); - - -/* - * "alt_dev_list" is the head of a linked list of registered devices. It is - * configured at startup to include a single device, "alt_dev_null". This - * device is discussed below. - */ - -extern alt_dev alt_dev_null; /* forward declaration */ - -alt_llist alt_dev_list = {&alt_dev_null.llist, &alt_dev_null.llist}; - -/* - * alt_dev_null_write() is the implementation of the write() function used - * by the alt_dev_null device. It simple discards all data passed to it, and - * indicates that the data has been successfully transmitted. - */ - -static int alt_dev_null_write (alt_fd* fd, const char* ptr, int len) -{ - return len; -} - -/* - * "alt_dev_null" is used to allow output to be redirected to nowhere. It is - * the only device registered before the call to alt_sys_init(). At startup - * stin, stdout & stderr are all directed towards this device so that library - * calls like printf() will be safe but inefectual. - */ - -alt_dev alt_dev_null = { - { - &alt_dev_list, - &alt_dev_list - }, - "/dev/null", - NULL, /* open */ - NULL, /* close */ - NULL, /* write */ - alt_dev_null_write, /* write */ - NULL, /* lseek */ - NULL, /* fstat */ - NULL /* ioctl */ - }; - -/* - * "alt_fd_list_lock" is a semaphore used to control access to the file - * descriptor list. This is used to ensure that access to the list is thread - * safe. - */ - -ALT_SEM(alt_fd_list_lock) - -/* - * "alt_max_fd" is used to make access to the file descriptor list more - * efficent. It is set to be the value of the highest allocated file - * descriptor. This saves having to search the entire pool of unallocated - * file descriptors when looking for a match. - */ - -alt_32 alt_max_fd = -1; - -/* - * "alt_fd_list" is the file descriptor pool. The first three entries in the - * array are configured as standard in, standard out, and standard error. These - * are all initialised so that accesses are directed to the alt_dev_null - * device. The remaining file descriptors are initialised as unallocated. - * - * The maximum number of file descriptors within the system is specified by the - * user defined macro "ALT_MAX_FD". This is defined in "system.h", which is - * auto-genereated using the projects PTF and STF files. - */ - -alt_fd alt_fd_list[ALT_MAX_FD] = - { - { - &alt_dev_null, /* standard in */ - 0, - 0 - }, - { - &alt_dev_null, /* standard out */ - 0, - 0 - }, - { - &alt_dev_null, /* standard error */ - 0, - 0 - } - /* all other elements are set to zero */ - }; diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_dev_llist_insert.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_dev_llist_insert.c deleted file mode 100644 index fa7239d..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_dev_llist_insert.c +++ /dev/null @@ -1,59 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "priv/alt_dev_llist.h" -#include "sys/alt_errno.h" - -/* - * - */ - -int alt_dev_llist_insert (alt_dev_llist* dev, alt_llist* list) -{ - /* - * check that the device exists, and that it has a valid name. - */ - - if (!dev || !dev->name) - { - ALT_ERRNO = EINVAL; - return -EINVAL; - } - - /* - * register the device. - */ - - alt_llist_insert(list, &dev->llist); - - return 0; -} diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_dma_rxchan_open.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_dma_rxchan_open.c deleted file mode 100644 index 6ea3b78..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_dma_rxchan_open.c +++ /dev/null @@ -1,63 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_dma.h" -#include "sys/alt_errno.h" -#include "priv/alt_file.h" - -/* - * The list of registered DMA receive channels. - */ - -ALT_LLIST_HEAD(alt_dma_rxchan_list); - -/* - * alt_dma_txchan_open() is used to obtain an "alt_dma_txchan" descriptor for - * a DMA transmit device. The name is the name of the associated physical - * device (e.g. "/dev/dma_0"). - * - * The return value will be NULL on failure, and non-NULL otherwise. - */ - -alt_dma_rxchan alt_dma_rxchan_open (const char* name) -{ - alt_dma_rxchan dev; - - dev = (alt_dma_rxchan) alt_find_dev (name, &alt_dma_rxchan_list); - - if (!dev) - { - ALT_ERRNO = ENODEV; - } - - return dev; -} diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_dma_txchan_open.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_dma_txchan_open.c deleted file mode 100644 index f41fa81..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_dma_txchan_open.c +++ /dev/null @@ -1,63 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_dma.h" -#include "sys/alt_errno.h" -#include "priv/alt_file.h" - -/* - * The list of registered receive channels. - */ - -ALT_LLIST_HEAD(alt_dma_txchan_list); - -/* - * alt_dma_txchan_open() is used to obtain an "alt_dma_txchan" descriptor for - * a DMA transmit device. The name is the name of the associated physical - * device (e.g. "/dev/dma_0"). - * - * The return value will be NULL on failure, and non-NULL otherwise. - */ - -alt_dma_txchan alt_dma_txchan_open (const char* name) -{ - alt_dma_txchan dev; - - dev = (alt_dma_txchan) alt_find_dev (name, &alt_dma_txchan_list); - - if (!dev) - { - ALT_ERRNO = ENODEV; - } - - return dev; -} diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_do_ctors.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_do_ctors.c deleted file mode 100644 index ff5a1f7..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_do_ctors.c +++ /dev/null @@ -1,64 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT IT DIRECTLY. * -* * -* Overriding HAL Functions * -* * -* To provide your own implementation of a HAL function, include the file in * -* your Nios II IDE application project. When building the executable, the * -* Nios II IDE finds your function first, and uses it in place of the HAL * -* version. * -* * -******************************************************************************/ - -/* - * - */ - -typedef void (*constructor) (void); -extern constructor __CTOR_LIST__[]; -extern constructor __CTOR_END__[]; - -/* - * Run the C++ static constructors. - */ - -void _do_ctors(void) -{ - constructor* ctor; - - for (ctor = &__CTOR_END__[-1]; ctor >= __CTOR_LIST__; ctor--) - (*ctor) (); -} diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_do_dtors.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_do_dtors.c deleted file mode 100644 index 565c99f..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_do_dtors.c +++ /dev/null @@ -1,64 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT IT DIRECTLY. * -* * -* Overriding HAL Functions * -* * -* To provide your own implementation of a HAL function, include the file in * -* your Nios II IDE application project. When building the executable, the * -* Nios II IDE finds your function first, and uses it in place of the HAL * -* version. * -* * -******************************************************************************/ - -/* - * - */ - -typedef void (*destructor) (void); -extern destructor __DTOR_LIST__[]; -extern destructor __DTOR_END__[]; - -/* - * Run the C++ static destructors. - */ - -void _do_dtors(void) -{ - destructor* dtor; - - for (dtor = &__DTOR_END__[-1]; dtor >= __DTOR_LIST__; dtor--) - (*dtor) (); -} diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_env_lock.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_env_lock.c deleted file mode 100644 index fc25a0c..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_env_lock.c +++ /dev/null @@ -1,53 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -/* - * These are the empty env lock/unlock stubs required by newlib. These are - * used to make accesses to environment variables thread safe. The default HAL - * configuration is single threaded, so there is nothing to do here. Note that - * this requires that environment variables are never manipulated by an interrupt - * service routine. - */ - -void __env_lock ( struct _reent *_r ) -{ -} - -/* - * - */ - -void __env_unlock ( struct _reent *_r ) -{ -} diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_environ.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_environ.c deleted file mode 100644 index 404efc4..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_environ.c +++ /dev/null @@ -1,42 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "os/alt_syscall.h" - -/* - * These are the environment variables passed to the C code. By default there - * are no variables registered. An application can manipulate this list using - * getenv() and setenv(). - */ - -char *__env[1] = { 0 }; -char **ALT_ENVIRON = __env; diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_errno.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_errno.c deleted file mode 100644 index 1d8368d..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_errno.c +++ /dev/null @@ -1,44 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/* - * This file defines the alt_errno global variable. See comments in - * alt_errno.h for the use of this variable. - */ - - -#include "sys/alt_errno.h" -#include "alt_types.h" - -extern int ALT_WEAK *__errno (void); - -int* (*alt_errno) (void) = __errno; diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_exception_entry.S b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_exception_entry.S deleted file mode 100644 index 3afab93..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_exception_entry.S +++ /dev/null @@ -1,360 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2008 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "system.h" - -/* - * This is the exception entry point code, which saves all the caller saved - * registers and then handles the appropriate exception. It should be pulled - * in using a .globl from all the exception handler routines. This scheme is - * used so that if an interrupt is never registered, then this code will not - * appear in the generated executable, thereby improving code footprint. - * - * If an external interrpt controller (EIC) is present, it will supply an - * interrupt vector address to the processor when an interrupt occurs. For - * The Altera Vectored Interrupt Controller (VIC) driver will establish a - * vector table and the processor will jump directly to the appropriate - * table entry, funnel routine, and then user ISR. This will bypass this code - * in entirety. This code might still be linked into a system with an EIC, - * but would then be used only for non-interrupt exceptions. - */ - - /* - * Explicitly allow the use of r1 (the assembler temporary register) - * within this code. This register is normally reserved for the use of - * the assembler. - */ - .set noat - - /* - * The top and bottom of the exception stack - */ -#ifdef ALT_EXCEPTION_STACK - - .globl __alt_exception_stack_pointer - -#ifdef ALT_STACK_CHECK - - .globl __alt_exception_stack_limit - - /* - * We need to store the value of the stack limit after interrupt somewhere. - */ - .globl alt_exception_old_stack_limit - -#endif -#endif - - .section .exceptions.entry.label, "xa" - - .globl alt_exception - .type alt_exception, @function -alt_exception: - - .section .exceptions.entry, "xa" - -#ifdef ALT_EXCEPTION_STACK - -#ifdef ALT_STACK_CHECK - stw et, %gprel(alt_exception_old_stack_limit)(gp) -#endif - - movhi et, %hiadj(__alt_exception_stack_pointer - 80) - addi et, et, %lo(__alt_exception_stack_pointer - 80) - stw sp, 76(et) - mov sp, et - -#ifdef ALT_STACK_CHECK - movhi et, %hiadj(__alt_exception_stack_limit) - addi et, et, %lo(__alt_exception_stack_limit) - stw et, %gprel(alt_stack_limit_value)(gp) -#endif - -#else - /* - * Process an exception. For all exceptions we must preserve all - * caller saved registers on the stack (See the Nios2 ABI - * documentation for details). - */ - - addi sp, sp, -76 - -#ifdef ALT_STACK_CHECK - - bltu sp, et, .Lstack_overflow - -#endif - -#endif - - stw ra, 0(sp) - - /* - * Leave a gap in the stack frame at 4(sp) for the muldiv handler to - * store zero into. - */ - - stw r1, 8(sp) - stw r2, 12(sp) - stw r3, 16(sp) - stw r4, 20(sp) - stw r5, 24(sp) - stw r6, 28(sp) - stw r7, 32(sp) - - rdctl r5, estatus - - stw r8, 36(sp) - stw r9, 40(sp) - stw r10, 44(sp) - stw r11, 48(sp) - stw r12, 52(sp) - stw r13, 56(sp) - stw r14, 60(sp) - stw r15, 64(sp) - - /* - * ea-4 contains the address of the instruction being executed - * when the exception occured. For interrupt exceptions, we will - * will be re-issue the isntruction. Store it in 72(sp) - */ - stw r5, 68(sp) /* estatus */ - addi r15, ea, -4 /* instruction that caused exception */ - stw r15, 72(sp) - - /* - * The interrupt testing code (.exceptions.irqtest) will be - * linked here. If the Internal Interrupt Controller (IIC) is - * present (an EIC is not present), the presense of an interrupt - * is determined by examining CPU control registers or an interrupt - * custom instruction, if present. - * - * If the IIC is used and an interrupt is active, the code linked - * here will call the HAL IRQ handler (alt_irq_handler()) which - * successively calls registered interrupt handler(s) until no - * interrupts remain pending. It then jumps to .exceptions.exit. If - * there is no interrupt then it continues to .exception.notirq, below. - */ - - .section .exceptions.notirq, "xa" - - /* - * Prepare to service unimplemtned instructions or traps, - * each of which is optionally inked into section .exceptions.soft, - * which will preceed .exceptions.unknown below. - * - * Unlike interrupts, we want to skip the exception-causing instructon - * upon completion, so we write ea (address of instruction *after* - * the one where the exception occured) into 72(sp). The actual - * instruction that caused the exception is written in r2, which these - * handlers will utilize. - */ - stw ea, 72(sp) /* Don't re-issue */ - ldw r2, -4(ea) /* Instruction that caused exception */ - - /* - * Other exception handling code, if enabled, will be linked here. - * This includes unimplemted (multiply/divide) instruction support - * (a BSP generaton option), and a trap handler (that would typically - * be augmented with user-specific code). These are not linked in by - * default. - */ - - /* - * In the context of linker sections, "unknown" are all exceptions - * not handled by the built-in handlers above (interupt, and trap or - * unimplemented instruction decoding, if enabled). - * - * Advanced exception types can be serviced by registering a handler. - * To do so, enable the "Enable Instruction-related Exception API" HAL - * BSP setting. If this setting is disabled, this handler code will - * either break (if the debug core is present) or enter an infinite - * loop because we don't how how to handle the exception. - */ - .section .exceptions.unknown -#ifdef ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API - /* - * The C-based HAL routine alt_instruction_exception_entry() will - * attempt to service the exception by calling a user-registered - * exception handler using alt_instruction_exception_register(). - * If no handler was registered it will either break (if the - * debugger is present) or go into an infinite loop since the - * handling behavior is undefined; in that case we will not return here. - */ - - /* Load exception-causing address as first argument (r4) */ - addi r4, ea, -4 - - /* Call the instruction-exception entry */ - call alt_instruction_exception_entry - - /* - * If alt_instruction_exception_entry() returned, the exception was - * serviced by a user-registered routine. Its return code (now in r2) - * indicates whether to re-issue or skip the exception-causing - * instruction - * - * Return code was 0: Skip. The instruction after the exception is - * already stored in 72(sp). - */ - bne r2, r0, .Lexception_exit - - /* - * Otherwise, modify 72(sp) to re-issue the instruction that caused the - * exception. - */ - addi r15, ea, -4 /* instruction that caused exception */ - stw r15, 72(sp) - -#else /* ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API disabled */ - - /* - * We got here because an instruction-related exception occured, but the - * handler API was not compiled in. We do not presume to know how to - * handle it. If the debugger is present, break, otherwise hang. - * - * If you get here then one of the following could have happened: - * - * - An instruction-generated exception occured, and the processor - * does not have the extra exceptions feature enabled, or you - * have not registered a handler using - * alt_instruction_exception_register() - * - * Some examples of instruction-generated exceptions and why they - * might occur: - * - * - Your program could have been compiled for a full-featured - * Nios II core, but it is running on a smaller core, and - * instruction emulation has been disabled by defining - * ALT_NO_INSTRUCTION_EMULATION. - * - * You can work around the problem by re-enabling instruction - * emulation, or you can figure out why your program is being - * compiled for a system other than the one that it is running on. - * - * - Your program has executed a trap instruction, but has not - * implemented a handler for this instruction. - * - * - Your program has executed an illegal instruction (one which is - * not defined in the instruction set). - * - * - Your processor includes an MMU or MPU, and you have enabled it - * before registering an exception handler to service exceptions it - * generates. - * - * The problem could also be hardware related: - * - If your hardware is broken and is generating spurious interrupts - * (a peripheral which negates its interrupt output before its - * interrupt handler has been executed will cause spurious - * interrupts) - */ -#ifdef NIOS2_HAS_DEBUG_STUB - /* - * Either tell the user now (if there is a debugger attached) or go into - * the debug monitor which will loop until a debugger is attached. - */ - break -#else - /* - * If there is no debug stub then a BREAK will probably cause a reboot. - * An infinate loop will probably be more useful. - */ -0: - br 0b -#endif /* NIOS2_HAS_DEBUG_STUB */ - -#endif /* ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API */ - - .section .exceptions.exit.label -.Lexception_exit: - - .section .exceptions.exit, "xa" - - /* - * Restore the saved registers, so that all general purpose registers - * have been restored to their state at the time the interrupt occured. - */ - - ldw r5, 68(sp) - ldw ea, 72(sp) /* This becomes the PC once eret is executed */ - ldw ra, 0(sp) - - wrctl estatus, r5 - - ldw r1, 8(sp) - ldw r2, 12(sp) - ldw r3, 16(sp) - ldw r4, 20(sp) - ldw r5, 24(sp) - ldw r6, 28(sp) - ldw r7, 32(sp) - -#ifdef ALT_EXCEPTION_STACK -#ifdef ALT_STACK_CHECK - ldw et, %gprel(alt_exception_old_stack_limit)(gp) -#endif -#endif - - ldw r8, 36(sp) - ldw r9, 40(sp) - ldw r10, 44(sp) - ldw r11, 48(sp) - ldw r12, 52(sp) - ldw r13, 56(sp) - ldw r14, 60(sp) - ldw r15, 64(sp) - -#ifdef ALT_EXCEPTION_STACK - -#ifdef ALT_STACK_CHECK - stw et, %gprel(alt_stack_limit_value)(gp) - stw zero, %gprel(alt_exception_old_stack_limit)(gp) -#endif - - ldw sp, 76(sp) - -#else - addi sp, sp, 76 - -#endif - - /* - * Return to the interrupted instruction. - */ - - eret - -#ifdef ALT_STACK_CHECK - -.Lstack_overflow: - break 3 - -#endif - diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_exception_muldiv.S b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_exception_muldiv.S deleted file mode 100644 index 55617a6..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_exception_muldiv.S +++ /dev/null @@ -1,583 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - - /* - * This is the software multiply/divide handler for Nios2. - */ - - /* - * Provide a label which can be used to pull this file in. - */ - - .section .exceptions.start - .globl alt_exception_muldiv -alt_exception_muldiv: - - /* - * Pull in the entry/exit code. - */ - .globl alt_exception - - - .section .exceptions.soft, "xa" - - - /* INSTRUCTION EMULATION - * --------------------- - * - * Nios II processors generate exceptions for unimplemented instructions. - * The routines below emulate these instructions. Depending on the - * processor core, the only instructions that might need to be emulated - * are div, divu, mul, muli, mulxss, mulxsu, and mulxuu. - * - * The emulations match the instructions, except for the following - * limitations: - * - * 1) The emulation routines do not emulate the use of the exception - * temporary register (et) as a source operand because the exception - * handler already has modified it. - * - * 2) The routines do not emulate the use of the stack pointer (sp) or the - * exception return address register (ea) as a destination because - * modifying these registers crashes the exception handler or the - * interrupted routine. - * - * 3) To save code size, the routines do not emulate the use of the - * breakpoint registers (ba and bt) as operands. - * - * Detailed Design - * --------------- - * - * The emulation routines expect the contents of integer registers r0-r31 - * to be on the stack at addresses sp, 4(sp), 8(sp), ... 124(sp). The - * routines retrieve source operands from the stack and modify the - * destination register's value on the stack prior to the end of the - * exception handler. Then all registers except the destination register - * are restored to their previous values. - * - * The instruction that causes the exception is found at address -4(ea). - * The instruction's OP and OPX fields identify the operation to be - * performed. - * - * One instruction, muli, is an I-type instruction that is identified by - * an OP field of 0x24. - * - * muli AAAAA,BBBBB,IIIIIIIIIIIIIIII,-0x24- - * 27 22 6 0 <-- LSB of field - * - * The remaining emulated instructions are R-type and have an OP field - * of 0x3a. Their OPX fields identify them. - * - * R-type AAAAA,BBBBB,CCCCC,XXXXXX,NNNNN,-0x3a- - * 27 22 17 11 6 0 <-- LSB of field - * - * - */ - - - /* - * Split the instruction into its fields. We need 4*A, 4*B, and 4*C as - * offsets to the stack pointer for access to the stored register values. - */ - /* r2 = AAAAA,BBBBB,IIIIIIIIIIIIIIII,PPPPPP */ - roli r3, r2, 7 /* r3 = BBB,IIIIIIIIIIIIIIII,PPPPPP,AAAAA,BB */ - roli r4, r3, 3 /* r4 = IIIIIIIIIIIIIIII,PPPPPP,AAAAA,BBBBB */ - roli r6, r4, 2 /* r6 = IIIIIIIIIIIIII,PPPPPP,AAAAA,BBBBB,II */ - srai r4, r4, 16 /* r4 = (sign-extended) IMM16 */ - xori r6, r6, 0x42 /* r6 = CCC,XXXXXX,NNNNN,PPPPPP,AAAAA,bBBBB,cC */ - roli r7, r6, 5 /* r7 = XXXX,NNNNN,PPPPPP,AAAAA,bBBBB,cCCCC,XX */ - andi r5, r2, 0x3f /* r5 = 00000000000000000000000000,PPPPPP */ - xori r3, r3, 0x40 - andi r3, r3, 0x7c /* r3 = 0000000000000000000000000,aAAAA,00 */ - andi r6, r6, 0x7c /* r6 = 0000000000000000000000000,bBBBB,00 */ - andi r7, r7, 0x7c /* r7 = 0000000000000000000000000,cCCCC,00 */ - - /* Now either - * r5 = OP - * r3 = 4*(A^16) - * r4 = IMM16 (sign extended) - * r6 = 4*(B^16) - * r7 = 4*(C^16) - * or - * r5 = OP - */ - - - /* - * Save everything on the stack to make it easy for the emulation routines - * to retrieve the source register operands. The exception entry code has - * already saved some of this so we don't need to do it all again. - */ - - addi sp, sp, -60 - stw zero, 64(sp) /* Save zero on stack to avoid special case for r0. */ - /* Register at and r2-r15 have already been saved. */ - - stw r16, 0(sp) - stw r17, 4(sp) - stw r18, 8(sp) - stw r19, 12(sp) - stw r20, 16(sp) - stw r21, 20(sp) - stw r22, 24(sp) - stw r23, 28(sp) - /* et @ 32 - Has already been changed.*/ - /* bt @ 36 - Usually isn't an operand. */ - stw gp, 40(sp) - stw sp, 44(sp) - stw fp, 48(sp) - /* ea @ 52 - Don't bother to save - it's already been changed */ - /* ba @ 56 - Breakpoint register usually isn't an operand */ - /* ra @ 60 - Has already been saved */ - - - /* - * Prepare for either multiplication or division loop. - * They both loop 32 times. - */ - movi r14, 32 - - - /* - * Get the operands. - * - * It is necessary to check for muli because it uses an I-type instruction - * format, while the other instructions are have an R-type format. - */ - add r3, r3, sp /* r3 = address of A-operand. */ - ldw r3, 0(r3) /* r3 = A-operand. */ - movi r15, 0x24 /* muli opcode (I-type instruction format) */ - beq r5, r15, .Lmul_immed /* muli doesn't use the B register as a source */ - - add r6, r6, sp /* r6 = address of B-operand. */ - ldw r6, 0(r6) /* r6 = B-operand. */ - /* r4 = SSSSSSSSSSSSSSSS,-----IMM16------ */ - /* IMM16 not needed, align OPX portion */ - /* r4 = SSSSSSSSSSSSSSSS,CCCCC,-OPX--,00000 */ - srli r4, r4, 5 /* r4 = 00000,SSSSSSSSSSSSSSSS,CCCCC,-OPX-- */ - andi r4, r4, 0x3f /* r4 = 00000000000000000000000000,-OPX-- */ - - /* Now - * r5 = OP - * r3 = src1 - * r6 = src2 - * r4 = OPX (no longer can be muli) - * r7 = 4*(C^16) - * r14 = loop counter - */ - - /* ILLEGAL-INSTRUCTION EXCEPTION - * ----------------------------- - * - * This code is for Nios II cores that generate exceptions when attempting - * to execute illegal instructions. Nios II cores that support an - * illegal-instruction exception are identified by the presence of the - * macro definition NIOS2_HAS_ILLEGAL_INSTRUCTION_EXCEPTION in system.h . - * - * Remember that illegal instructions are different than unimplemented - * instructions. Illegal instructions are instruction encodings that - * have not been defined by the Nios II ISA. Unimplemented instructions - * are legal instructions that must be emulated by some Nios II cores. - * - * If we get here, all instructions except multiplies and divides - * are illegal. - * - * This code assumes that OP is not muli (because muli was tested above). - * All other multiplies and divides are legal. Anything else is illegal. - */ - - movi r8, 0x3a /* OP for R-type mul* and div* */ - bne r5, r8, .Lnot_muldiv - - /* r15 already is 0x24 */ /* OPX of divu */ - beq r4, r15, .Ldivide - - movi r15,0x27 /* OPX of mul */ - beq r4, r15, .Lmultiply - - movi r15,0x07 /* OPX of mulxuu */ - beq r4, r15, .Lmultiply - - movi r15,0x17 /* OPX of mulxsu */ - beq r4, r15, .Lmultiply - - movi r15,0x1f /* OPX of mulxss */ - beq r4, r15, .Lmultiply - - movi r15,0x25 /* OPX of div */ - bne r4, r15, .Lnot_muldiv - - - /* DIVISION - * - * Divide an unsigned dividend by an unsigned divisor using - * a shift-and-subtract algorithm. The example below shows - * 43 div 7 = 6 for 8-bit integers. This classic algorithm uses a - * single register to store both the dividend and the quotient, - * allowing both values to be shifted with a single instruction. - * - * remainder dividend:quotient - * --------- ----------------- - * initialize 00000000 00101011: - * shift 00000000 0101011:_ - * remainder >= divisor? no 00000000 0101011:0 - * shift 00000000 101011:0_ - * remainder >= divisor? no 00000000 101011:00 - * shift 00000001 01011:00_ - * remainder >= divisor? no 00000001 01011:000 - * shift 00000010 1011:000_ - * remainder >= divisor? no 00000010 1011:0000 - * shift 00000101 011:0000_ - * remainder >= divisor? no 00000101 011:00000 - * shift 00001010 11:00000_ - * remainder >= divisor? yes 00001010 11:000001 - * remainder -= divisor - 00000111 - * ---------- - * 00000011 11:000001 - * shift 00000111 1:000001_ - * remainder >= divisor? yes 00000111 1:0000011 - * remainder -= divisor - 00000111 - * ---------- - * 00000000 1:0000011 - * shift 00000001 :0000011_ - * remainder >= divisor? no 00000001 :00000110 - * - * The quotient is 00000110. - */ - -.Ldivide: - /* - * Prepare for division by assuming the result - * is unsigned, and storing its "sign" as 0. - */ - movi r17, 0 - - - /* Which division opcode? */ - xori r15, r4, 0x25 /* OPX of div */ - bne r15, zero, .Lunsigned_division - - - /* - * OPX is div. Determine and store the sign of the quotient. - * Then take the absolute value of both operands. - */ - xor r17, r3, r6 /* MSB contains sign of quotient */ - bge r3, zero, 0f - sub r3, zero, r3 /* -r3 */ -0: - bge r6, zero, 0f - sub r6, zero, r6 /* -r6 */ -0: - - -.Lunsigned_division: - /* Initialize the unsigned-division loop. */ - movi r13, 0 /* remainder = 0 */ - - /* Now - * r3 = dividend : quotient - * r4 = 0x25 for div, 0x24 for divu - * r6 = divisor - * r13 = remainder - * r14 = loop counter (already initialized to 32) - * r17 = MSB contains sign of quotient - */ - - - /* - * for (count = 32; count > 0; --count) - * { - */ -.Ldivide_loop: - - /* - * Division: - * - * (remainder:dividend:quotient) <<= 1; - */ - slli r13, r13, 1 - cmplt r15, r3, zero /* r15 = MSB of r3 */ - or r13, r13, r15 - slli r3, r3, 1 - - - /* - * if (remainder >= divisor) - * { - * set LSB of quotient - * remainder -= divisor; - * } - */ - bltu r13, r6, .Ldiv_skip - ori r3, r3, 1 - sub r13, r13, r6 -.Ldiv_skip: - - /* - * } - */ - subi r14, r14, 1 - bne r14, zero, .Ldivide_loop - - mov r9, r3 - - - /* Now - * r9 = quotient - * r4 = 0x25 for div, 0x24 for divu - * r7 = 4*(C^16) - * r17 = MSB contains sign of quotient - */ - - - /* - * Conditionally negate signed quotient. If quotient is unsigned, - * the sign already is initialized to 0. - */ - bge r17, zero, .Lstore_result - sub r9, zero, r9 /* -r9 */ - - br .Lstore_result - - - - - /* MULTIPLICATION - * - * A "product" is the number that one gets by summing a "multiplicand" - * several times. The "multiplier" specifies the number of copies of the - * multiplicand that are summed. - * - * Actual multiplication algorithms don't use repeated addition, however. - * Shift-and-add algorithms get the same answer as repeated addition, and - * they are faster. To compute the lower half of a product (pppp below) - * one shifts the product left before adding in each of the partial products - * (a * mmmm) through (d * mmmm). - * - * To compute the upper half of a product (PPPP below), one adds in the - * partial products (d * mmmm) through (a * mmmm), each time following the - * add by a right shift of the product. - * - * mmmm - * * abcd - * ------ - * #### = d * mmmm - * #### = c * mmmm - * #### = b * mmmm - * #### = a * mmmm - * -------- - * PPPPpppp - * - * The example above shows 4 partial products. Computing actual Nios II - * products requires 32 partials. - * - * It is possible to compute the result of mulxsu from the result of mulxuu - * because the only difference between the results of these two opcodes is - * the value of the partial product associated with the sign bit of rA. - * - * mulxsu = mulxuu - ((rA < 0) ? rB : 0); - * - * It is possible to compute the result of mulxss from the result of mulxsu - * because the only difference between the results of these two opcodes is - * the value of the partial product associated with the sign bit of rB. - * - * mulxss = mulxsu - ((rB < 0) ? rA : 0); - * - */ - -.Lmul_immed: - /* Opcode is muli. Change it into mul for remainder of algorithm. */ - mov r7, r6 /* Field B is dest register, not field C. */ - mov r6, r4 /* Field IMM16 is src2, not field B. */ - movi r4, 0x27 /* OPX of mul is 0x27 */ - -.Lmultiply: - /* Initialize the multiplication loop. */ - movi r9, 0 /* mul_product = 0 */ - movi r10, 0 /* mulxuu_product = 0 */ - mov r11, r6 /* save original multiplier for mulxsu and mulxss */ - mov r12, r6 /* mulxuu_multiplier (will be shifted) */ - movi r16, 1 /* used to create "rori B,A,1" from "ror B,A,r16" */ - - /* Now - * r3 = multiplicand - * r6 = mul_multiplier - * r7 = 4 * dest_register (used later as offset to sp) - * r9 = mul_product - * r10 = mulxuu_product - * r11 = original multiplier - * r12 = mulxuu_multiplier - * r14 = loop counter (already initialized) - * r15 = temp - * r16 = 1 - */ - - - /* - * for (count = 32; count > 0; --count) - * { - */ -.Lmultiply_loop: - - /* - * mul_product <<= 1; - * lsb = multiplier & 1; - */ - slli r9, r9, 1 - andi r15, r12, 1 - - /* - * if (lsb == 1) - * { - * mulxuu_product += multiplicand; - * } - */ - beq r15, zero, .Lmulx_skip - add r10, r10, r3 - cmpltu r15, r10, r3 /* Save the carry from the MSB of mulxuu_product. */ - ror r15, r15, r16 /* r15 = 0x80000000 on carry, or else 0x00000000 */ -.Lmulx_skip: - - /* - * if (MSB of mul_multiplier == 1) - * { - * mul_product += multiplicand; - * } - */ - bge r6, zero, .Lmul_skip - add r9, r9, r3 -.Lmul_skip: - - /* - * mulxuu_product >>= 1; logical shift - * mul_multiplier <<= 1; done with MSB - * mulx_multiplier >>= 1; done with LSB - */ - srli r10, r10, 1 - or r10, r10, r15 /* OR in the saved carry bit. */ - slli r6, r6, 1 - srli r12, r12, 1 - - - /* - * } - */ - subi r14, r14, 1 - bne r14, zero, .Lmultiply_loop - - - /* - * Multiply emulation loop done. - */ - - /* Now - * r3 = multiplicand - * r4 = OPX - * r7 = 4 * dest_register (used later as offset to sp) - * r9 = mul_product - * r10 = mulxuu_product - * r11 = original multiplier - * r15 = temp - */ - - - /* - * Select/compute the result based on OPX. - */ - - - /* OPX == mul? Then store. */ - xori r15, r4, 0x27 - beq r15, zero, .Lstore_result - - /* It's one of the mulx.. opcodes. Move over the result. */ - mov r9, r10 - - /* OPX == mulxuu? Then store. */ - xori r15, r4, 0x07 - beq r15, zero, .Lstore_result - - /* Compute mulxsu - * - * mulxsu = mulxuu - ((rA < 0) ? rB : 0); - */ - bge r3, zero, .Lmulxsu_skip - sub r9, r9, r11 -.Lmulxsu_skip: - - /* OPX == mulxsu? Then store. */ - xori r15, r4, 0x17 - beq r15, zero, .Lstore_result - - /* Compute mulxss - * - * mulxss = mulxsu - ((rB < 0) ? rA : 0); - */ - bge r11, zero, .Lmulxss_skip - sub r9, r9, r3 -.Lmulxss_skip: - /* At this point, assume that OPX is mulxss, so store */ - - -.Lstore_result: - add r7, r7, sp - stw r9, 0(r7) - - ldw r16, 0(sp) - ldw r17, 4(sp) - ldw r18, 8(sp) - ldw r19, 12(sp) - ldw r20, 16(sp) - ldw r21, 20(sp) - ldw r22, 24(sp) - ldw r23, 28(sp) - - /* bt @ 32 - Breakpoint register usually isn't an operand. */ - /* et @ 36 - Don't corrupt et. */ - /* gp @ 40 - Don't corrupt gp. */ - /* sp @ 44 - Don't corrupt sp. */ - ldw fp, 48(sp) - /* ea @ 52 - Don't corrupt ea. */ - /* ba @ 56 - Breakpoint register usually isn't an operand. */ - - addi sp, sp, 60 - - br .Lexception_exit - - -.Lnot_muldiv: - - addi sp, sp, 60 - - - .section .exceptions.exit.label -.Lexception_exit: - diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_exception_trap.S b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_exception_trap.S deleted file mode 100644 index 60a3d40..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_exception_trap.S +++ /dev/null @@ -1,81 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - - /* - * This is the trap exception handler for Nios2. - */ - - /* - * Provide a label which can be used to pull this file in. - */ - - .section .exceptions.start - .globl alt_exception_trap -alt_exception_trap: - - /* - * Pull in the entry/exit code. - */ - .globl alt_exception - - .section .exceptions.soft, "xa" - -.Ltrap_handler: - - /* - * Did a trap instruction cause the exception? - * - * The instruction which the exception occurred on has been loaded - * into r2 by code in alt_exception_entry.S - * - */ - - movhi r3,0x003b /* upper half of trap opcode */ - ori r3,r3,0x683a /* lower half of trap opcode */ - bne r2,r3,.Lnot_trap - - /* - * There is no trap handler defined here, and so executing a trap - * instruction causes a software break. If you provide a trap handler, - * then you must replace the break instruction below with your handler. - * Your handler must preserve ea and the usual callee saved registers. - */ - - break - - br .Lexception_exit - -.Lnot_trap: - - - .section .exceptions.exit.label -.Lexception_exit: - - diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_execve.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_execve.c deleted file mode 100644 index 27b99cf..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_execve.c +++ /dev/null @@ -1,55 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "os/alt_syscall.h" - -/* - * execve() is used by newlib to launch new processes. This is unsupported in - * the HAL environment. However a "do-nothing" implementation is still - * provied for newlib compatability. - * - * ALT_EXECVE is mapped onto the execve() system call in alt_syscall.h - */ - -int ALT_EXECVE (char *name, char ** argv, char** env) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(execve); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_exit.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_exit.c deleted file mode 100644 index 971b35e..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_exit.c +++ /dev/null @@ -1,71 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_irq.h" -#include "sys/alt_sim.h" -#include "os/alt_hooks.h" -#include "os/alt_syscall.h" - -#include "alt_types.h" -#include "sys/alt_log_printf.h" -/* - * _exit() is called by exit() in order to terminate the current process. - * Typically this is called when main() completes. It should never return. - * Since there is nowhere to go once this process completes, this - * implementation simply blocks forever. - * - * Note that interrupts are not disabled so that execution outside of this - * thread is allowed to continue. - * - * ALT_EXIT is mapped onto the _exit() system call in alt_syscall.h - */ - -void ALT_EXIT (int exit_code) -{ - /* ALT_LOG - please see HAL/inc/alt_log_printf.h for details */ - ALT_LOG_PRINT_BOOT("[alt_exit.c] Entering _exit() function.\r\n"); - ALT_LOG_PRINT_BOOT("[alt_exit.c] Exit code from main was %d.\r\n",exit_code); - /* Stop all other threads */ - - ALT_LOG_PRINT_BOOT("[alt_exit.c] Calling ALT_OS_STOP().\r\n"); - ALT_OS_STOP(); - - /* Provide notification to the simulator that we've stopped */ - - ALT_LOG_PRINT_BOOT("[alt_exit.c] Calling ALT_SIM_HALT().\r\n"); - ALT_SIM_HALT(exit_code); - - /* spin forever, since there's no where to go back to */ - - ALT_LOG_PRINT_BOOT("[alt_exit.c] Spinning forever.\r\n"); - while (1); -} diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_fcntl.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_fcntl.c deleted file mode 100644 index 69c1544..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_fcntl.c +++ /dev/null @@ -1,101 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include -#include - -#include "sys/alt_errno.h" -#include "priv/alt_file.h" -#include "alt_types.h" -#include "os/alt_syscall.h" - -#define ALT_FCNTL_FLAGS_MASK ((alt_u32) (O_APPEND | O_NONBLOCK)) - -/* - * fcntl() is a limited implementation of the standard fcntl() system call. - * It can be used to change the state of the flags associated with an open - * file descriptor. Normally these flags are set during the call to - * open(). It is anticipated that the main use of this function will be to - * change the state of a device from blocking to non-blocking (where this is - * supported). - * - * The input argument "fd" is the file descriptor to be manipulated. "cmd" - * is the command to execute. This can be either F_GETFL (return the - * current value of the flags) or F_SETFL (set the value of the flags). - * - * If "cmd" is F_SETFL then the argument "arg" is the new value of flags, - * otherwise "arg" is ignored. Only the flags: O_APPEND and O_NONBLOCK - * can be updated by a call to fcntl(). All other flags remain - * unchanged. - * - * ALT_FCNTL is mapped onto the fcntl() system call in alt_syscall.h - */ - -int ALT_FCNTL (int file, int cmd, ...) -{ - alt_fd* fd; - long flags; - va_list argp; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - switch (cmd) - { - case F_GETFL: - return fd->fd_flags & ~((alt_u32) ALT_FD_FLAGS_MASK); - case F_SETFL: - va_start(argp, cmd); - flags = va_arg(argp, long); - fd->fd_flags &= ~ALT_FCNTL_FLAGS_MASK; - fd->fd_flags |= (flags & ALT_FCNTL_FLAGS_MASK); - va_end(argp); - return 0; - default: - ALT_ERRNO = EINVAL; - return -1; - } - } - - ALT_ERRNO = EBADFD; - return -1; -} diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_fd_lock.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_fd_lock.c deleted file mode 100644 index 0e2a85d..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_fd_lock.c +++ /dev/null @@ -1,75 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "priv/alt_file.h" - -/* - * alt_fd_lock() is called as a consequence of an ioctl call to gain exclusive - * access to a device, i.e.: - * - * ioctl (fd, TIOCEXCL, NULL); - * - * If there are no other open file descriptors which reference the same - * device, then alt_fd_lock() will grant the lock. Further calls to open() - * for this device will fail until the lock is released. - * - * This is done by calling close() for this file descriptor, or by calling: - * - * ioctl (fd, TIOCNXCL, NULL); - * - * The return value is zero for success, or negative in the case of failure. - */ - -int alt_fd_lock (alt_fd* fd) -{ - int i; - int rc = 0; - - ALT_SEM_PEND(alt_fd_list_lock, 0); - - for (i = 0; i < alt_max_fd; i++) - { - if ((&alt_fd_list[i] != fd) && (alt_fd_list[i].dev == fd->dev)) - { - rc = -EACCES; - goto alt_fd_lock_exit; - } - } - fd->fd_flags |= ALT_FD_EXCL; - - alt_fd_lock_exit: - - ALT_SEM_POST(alt_fd_list_lock); - return rc; -} diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_fd_unlock.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_fd_unlock.c deleted file mode 100644 index fb700dc..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_fd_unlock.c +++ /dev/null @@ -1,56 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "priv/alt_file.h" - -/* - * alt_fd_unlock() is the inverse of alt_fd_lock(). It is called as a - * consequence of a TIOCNXCL ioctl request, e.g: - * - * ioctl (fd, TIOCNXCL, NULL); - * - * It enables multiple file descriptors to exist for the same device. This - * is normally the case, but it may have been disabled by a previous call to - * alt_fd_lock(). - * - * Return zero on sucess, and a negative value on failure. - * - * The current implementation always succeeds. - */ - -int alt_fd_unlock (alt_fd* fd) -{ - fd->fd_flags &= ~ALT_FD_EXCL; - return 0; -} diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_find_dev.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_find_dev.c deleted file mode 100644 index 37aefa4..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_find_dev.c +++ /dev/null @@ -1,88 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - -#include "alt_types.h" - -/* - * alt_find_dev() is used by open() in order to locate a previously registered - * device with the name "name". The input argument "llist" is a pointer to the - * head of the device list to search. - * - * The return value is a pointer to the matching device, or NULL if there is - * no match. - * - * "name" must be an exact match for the devices registered name for a match to - * be found. - */ - -alt_dev* alt_find_dev(const char* name, alt_llist* llist) -{ - alt_dev* next = (alt_dev*) llist->next; - alt_32 len; - - len = strlen(name) + 1; - - /* - * Check each list entry in turn, until a match is found, or we reach the - * end of the list (i.e. next winds up pointing back to the list head). - */ - - while (next != (alt_dev*) llist) - { - - /* - * memcmp() is used here rather than strcmp() in order to reduce the size - * of the executable. - */ - - if (!memcmp (next->name, name, len)) - { - /* match found */ - - return next; - } - next = (alt_dev*) next->llist.next; - } - - /* No match found */ - - return NULL; -} - - diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_find_file.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_find_file.c deleted file mode 100644 index 2d97ec2..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_find_file.c +++ /dev/null @@ -1,89 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - -#include "alt_types.h" - -/* - * alt_find_file() is used by open() in order to locate a previously registered - * filesystem that owns that mount point that contains the file named "name". - * - * The return value is a pointer to the matching filesystem, or NULL if there is - * no match. - * - * A match is considered to have been found if the filesystem name followed by - * either '/' or '\0' is the prefix of the filename. For example the filename: - * "/myfilesystem/junk.txt" would match: "/myfilesystem", but not: "/myfile". - */ - -alt_dev* alt_find_file (const char* name) -{ - alt_dev* next = (alt_dev*) alt_fs_list.next; - - alt_32 len; - - /* - * Check each list entry in turn, until a match is found, or we reach the - * end of the list (i.e. next winds up pointing back to the list head). - */ - - while (next != (alt_dev*) &alt_fs_list) - { - len = strlen(next->name); - - if (next->name[len-1] == '/') - { - len -= 1; - } - - if (((name[len] == '/') || (name[len] == '\0')) && - !memcmp (next->name, name, len)) - { - /* match found */ - - return next; - } - next = (alt_dev*) next->llist.next; - } - - /* No match found */ - - return NULL; -} - - diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_flash_dev.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_flash_dev.c deleted file mode 100644 index 213f721..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_flash_dev.c +++ /dev/null @@ -1,69 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* Alt_flash.c - Functions to register a flash device to the "generic" flash * -* interface * -* * -* Author PRR * -* * -******************************************************************************/ - -#include -#include "sys/alt_llist.h" -#include "sys/alt_flash_dev.h" -#include "priv/alt_file.h" - -ALT_LLIST_HEAD(alt_flash_dev_list); - -alt_flash_fd* alt_flash_open_dev(const char* name) -{ - alt_flash_dev* dev = (alt_flash_dev*)alt_find_dev(name, &alt_flash_dev_list); - - if ((dev) && dev->open) - { - return dev->open(dev, name); - } - - return dev; -} - -void alt_flash_close_dev(alt_flash_fd* fd) -{ - if (fd && fd->close) - { - fd->close(fd); - } - return; -} - diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_fork.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_fork.c deleted file mode 100644 index ce74df0..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_fork.c +++ /dev/null @@ -1,57 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_warning.h" -#include "sys/alt_errno.h" -#include "os/alt_syscall.h" - -/* - * The fork() system call is used by newlib to create a duplicate copy of the - * curent process. This is unsupported in the HAL environment. However a - * "do-nothing" implementation is still provied for newlib compatability. - * - * ALT_FORK is mapped onto the fork() system call in alt_syscall.h - */ - -int ALT_FORK (void) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(fork); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} - - diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_fs_reg.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_fs_reg.c deleted file mode 100644 index 13437a1..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_fs_reg.c +++ /dev/null @@ -1,75 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - -/* - * The alt_fs_reg() function is used to register a file system. Once registered - * a device can be accessed using the standard posix calls: open(), read(), - * write() etc. - * - * System behaviour is undefined in the event that a file system is registered - * with a name that conflicts with an existing device or file system. - * - * alt_fs_reg() is not thread safe in the sense that there should be no other - * thread using the file system list at the time that alt_dev_reg() is called. In - * practice this means that alt_fs_reg() should only be called while operating - * in a single threaded mode. The expectation is that it will only be called - * by the file system initilisation functions invoked by alt_sys_init(), which in - * turn should only be called by the single threaded C startup code. - * - * A return value of zero indicates success. A negative return value indicates - * failure. - */ - -int alt_fs_reg (alt_dev* dev) -{ - /* - * check that the device has a name. - */ - - if (!dev->name) - { - return -ENODEV; - } - - /* - * register the file system. - */ - - alt_llist_insert(&alt_fs_list, &dev->llist); - - return 0; -} diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_fstat.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_fstat.c deleted file mode 100644 index af5d527..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_fstat.c +++ /dev/null @@ -1,128 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include "sys/alt_dev.h" -#include "sys/alt_warning.h" -#include "sys/alt_errno.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -/* - * The fstat() system call is used to obtain information about the capabilities - * of an open file descriptor. By default file descriptors are marked as - * being character devices. If a device or file system wishes to advertise - * alternative capabilities then they can register an fstat() function within - * their associated alt_dev structure. This will be called to fill in the - * entries in the imput "st" structure. - * - * This function is provided for compatability with newlib. - * - * ALT_FSTAT is mapped onto the fstat() system call in alt_syscall.h - */ - -#ifdef ALT_USE_DIRECT_DRIVERS - -#include "system.h" - -/* - * Provide minimal version that just describes all file descriptors - * as character devices for provided stdio devices. - */ -int ALT_FSTAT (int file, struct stat *st) -{ - switch (file) { -#ifdef ALT_STDIN_PRESENT - case 0: /* stdin file descriptor */ -#endif /* ALT_STDIN_PRESENT */ -#ifdef ALT_STDOUT_PRESENT - case 1: /* stdout file descriptor */ -#endif /* ALT_STDOUT_PRESENT */ -#ifdef ALT_STDERR_PRESENT - case 2: /* stderr file descriptor */ -#endif /* ALT_STDERR_PRESENT */ - st->st_mode = _IFCHR; - return 0; - default: - return -1; - } - -#if !defined(ALT_STDIN_PRESENT) && !defined(ALT_STDOUT_PRESENT) && !defined(ALT_STDERR_PRESENT) - /* Generate a link time warning, should this function ever be called. */ - ALT_STUB_WARNING(fstat); -#endif -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -int ALT_FSTAT (int file, struct stat *st) -{ - alt_fd* fd; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - /* Call the drivers fstat() function to fill out the "st" structure. */ - - if (fd->dev->fstat) - { - return fd->dev->fstat(fd, st); - } - - /* - * If no function is provided, mark the fd as belonging to a character - * device. - */ - - else - { - st->st_mode = _IFCHR; - return 0; - } - } - else - { - ALT_ERRNO = EBADFD; - return -1; - } -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_get_fd.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_get_fd.c deleted file mode 100644 index db17b2c..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_get_fd.c +++ /dev/null @@ -1,105 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - -#include "alt_types.h" - -#include "system.h" - -/* - * alt_get_fd() is called to allocate a new file descriptor from the file - * descriptor pool. If a file descriptor is succesfully allocated, it is - * configured to refer to device "dev". - * - * The return value is the index of the file descriptor structure (i.e. - * the offset of the file descriptor within the file descriptor array). A - * negative value indicates failure. - */ - -int alt_get_fd (alt_dev* dev) -{ - alt_32 i; - int rc = -EMFILE; - - /* - * Take the alt_fd_list_lock semaphore in order to avoid races when - * accessing the file descriptor pool. - */ - - ALT_SEM_PEND(alt_fd_list_lock, 0); - - /* - * Search through the list of file descriptors, and allocate the first - * free descriptor that's found. - * - * If a free descriptor is found, then the value of "alt_max_fd" is - * updated accordingly. "alt_max_fd" is a 'highwater mark' which - * indicates the highest file descriptor ever allocated. This is used to - * improve efficency when searching the file descriptor list, and - * therefore reduce contention on the alt_fd_list_lock semaphore. - */ - - for (i = 0; i < ALT_MAX_FD; i++) - { - if (!alt_fd_list[i].dev) - { - alt_fd_list[i].dev = dev; - if (i > alt_max_fd) - { - alt_max_fd = i; - } - rc = i; - goto alt_get_fd_exit; - } - } - - alt_get_fd_exit: - - /* - * Release the alt_fd_list_lock semaphore now that we are done with the - * file descriptor pool. - */ - - ALT_SEM_POST(alt_fd_list_lock); - - return rc; -} - - - - diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_getchar.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_getchar.c deleted file mode 100644 index a8f50d5..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_getchar.c +++ /dev/null @@ -1,61 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#ifdef ALT_USE_DIRECT_DRIVERS -#include "system.h" -#include "sys/alt_driver.h" -#include "sys/alt_stdio.h" -#include "priv/alt_file.h" -#include "unistd.h" -#endif - -/* - * Uses the ALT_DRIVER_READ() macro to call directly to driver if available. - * Otherwise, uses newlib provided getchar() routine. - */ -int -alt_getchar(void) -{ -#ifdef ALT_USE_DIRECT_DRIVERS - ALT_DRIVER_READ_EXTERNS(ALT_STDIN_DEV); - char c; - - if (ALT_DRIVER_READ(ALT_STDIN_DEV, &c, 1, alt_fd_list[STDIN_FILENO].fd_flags) <= 0) { - return -1; - } - return c; -#else - return getchar(); -#endif -} diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_getpid.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_getpid.c deleted file mode 100644 index 2228c7e..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_getpid.c +++ /dev/null @@ -1,47 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "os/alt_syscall.h" - -/* - * The getpid() system call is used by newlib to obtain the current process - * id. Since there is only ever a single process in the HAL environment, - * this just returns a constant. - * - * ALT_GETPID is mapped onto the getpid() system call in alt_syscall.h - */ - -int ALT_GETPID (void) -{ - return 0; -} - diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_gettod.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_gettod.c deleted file mode 100644 index ed86cba..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_gettod.c +++ /dev/null @@ -1,125 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include - -#include "sys/alt_alarm.h" -#include "alt_types.h" -#include "os/alt_syscall.h" - -/* - * Macro defining the number of micoseconds in a second. - */ - -#define ALT_US (1000000) - -/* - * "alt_timezone" and "alt_resettime" are the values of the the reset time and - * time zone set through the last call to settimeofday(). By default they are - * zero initialised. - */ - -struct timezone alt_timezone = {0, 0}; -struct timeval alt_resettime = {0, 0}; - -/* - * gettimeofday() can be called to obtain a time structure which indicates the - * current "wall clock" time. This is calculated using the elapsed number of - * system clock ticks, and the value of "alt_resettime" and "alt_timezone" set - * through the last call to settimeofday(). - * - * Warning: if this function is called concurrently with a call to - * settimeofday(), the value returned by gettimeofday() will be unreliable. - * - * ALT_GETTIMEOFDAY is mapped onto the gettimeofday() system call in - * alt_syscall.h - */ - - -#if defined (__GNUC__) && (__GNUC__ >= 4) -int ALT_GETTIMEOFDAY (struct timeval *ptimeval, void *ptimezone_vptr) -{ - struct timezone *ptimezone = (struct timezone*)ptimezone_vptr; -#else -int ALT_GETTIMEOFDAY (struct timeval *ptimeval, struct timezone *ptimezone) -{ -#endif - - alt_u32 nticks = alt_nticks (); - alt_u32 tick_rate = alt_ticks_per_second (); - - /* - * Check to see if the system clock is running. This is indicated by a - * non-zero system clock rate. If the system clock is not running, an error - * is generated and the contents of "ptimeval" and "ptimezone" are not - * updated. - */ - - if (tick_rate) - { - ptimeval->tv_sec = alt_resettime.tv_sec + nticks/tick_rate; - ptimeval->tv_usec = alt_resettime.tv_usec + - (alt_u32)(((alt_u64)nticks*(ALT_US/tick_rate))%ALT_US); - - while(ptimeval->tv_usec < 0) { - if (ptimeval->tv_sec <= 0) - { - ptimeval->tv_sec = 0; - ptimeval->tv_usec = 0; - break; - } - else - { - ptimeval->tv_sec--; - ptimeval->tv_usec += ALT_US; - } - } - - while(ptimeval->tv_usec >= ALT_US) { - ptimeval->tv_sec++; - ptimeval->tv_usec -= ALT_US; - } - - if (ptimezone) - { - ptimezone->tz_minuteswest = alt_timezone.tz_minuteswest; - ptimezone->tz_dsttime = alt_timezone.tz_dsttime; - } - - return 0; - } - - return -ENOTSUP; -} - diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_gmon.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_gmon.c deleted file mode 100644 index 6add9f1..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_gmon.c +++ /dev/null @@ -1,272 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include -#include -#include - -#include "priv/nios2_gmon_data.h" - -#include "sys/alt_irq.h" -#include "sys/alt_alarm.h" - - -/* Macros */ - -/* How large should the bins be which we use to generate the histogram */ -#define PCSAMPLE_BYTES_PER_BUCKET 32 - -#define NIOS2_READ_EA(dest) __asm__ ("mov %0, ea" : "=r" (dest)) - -/* The compiler inserts calls to mcount() at the start of - * every function call. The structure mcount_fn_arc records t - * he return address of the function called (in from_pc) - * and the return address of the mcount function - * (in self_pc). The number of times this arc is executed is - * recorded in the field count. - */ -struct mcount_fn_arc -{ - struct mcount_fn_arc * next; - void * from_pc; - unsigned int count; -}; - -/* We need to maintain a list of pointers to the heads of each adjacency - * list so that we can find them when writing out the gmon.out file. Since - * we don't know at the start of program execution how many functions will - * be called we use a list structure to do this. - */ -struct mcount_fn_entry -{ - struct mcount_fn_entry * next; - void * self_pc; - struct mcount_fn_arc * arc_head; -}; - -/* function prototypes */ - -void __mcount_record(void * self_pc, void * from_pc, struct mcount_fn_entry * fn_entry, struct mcount_fn_entry * * fn_head) __attribute__ ((no_instrument_function)); - -static __inline__ void * mcount_allocate(unsigned int size) __attribute__ ((no_instrument_function)); -static int nios2_pcsample_init(void) __attribute__ ((no_instrument_function)); -static alt_u32 nios2_pcsample(void* alarm) __attribute__ ((no_instrument_function)); - -/* global variables */ - -/* stext and etext are defined in the linker script */ -extern char stext[]; -extern char etext[]; - -/* Is the PC sampling stuff enabled yet? */ -static int pcsample_need_init = 1; - -#define HASH_BUCKETS 64 /* Must be a power of 2 */ - -/* This points to the list of adjacency list pointers. */ -struct mcount_fn_entry * __mcount_fn_head[HASH_BUCKETS]; - -/* pointer to the in-memory buffer containing the histogram */ -static unsigned short* s_pcsamples = 0; - -/* the address of the start and end of text section */ -static const unsigned int s_low_pc = (unsigned int)stext; -static const unsigned int s_high_pc = (unsigned int)etext; - -/* the alarm structure to register for pc sampling */ -static alt_alarm s_nios2_pcsample_alarm; - -unsigned int alt_gmon_data[GMON_DATA_SIZE] = -{ - 0x6e6f6d67, /* "gmon" */ - GMON_DATA_SIZE, - 0, - (unsigned int)stext, - (unsigned int)etext, - PCSAMPLE_BYTES_PER_BUCKET, - 0, - (unsigned int)__mcount_fn_head, - (unsigned int)(__mcount_fn_head + HASH_BUCKETS) -}; - -/* This holds the current slab of memory we're allocating out of */ -static char * mcount_slab_ptr = 0; -static int mcount_slab_size = 0; - -#define MCOUNT_SLAB_INCREMENT 1020 - - -/* - * We can't use malloc to allocate memory because that's too complicated, and - * can't be called at interrupt time. Use the lower level allocator instead - * because that's interrupt safe (and because we never free anything). - * - * For speed, we allocate a block of data at once. - */ -static __inline__ void * mcount_allocate(unsigned int size) -{ - void * data; - - if (size > mcount_slab_size) - { - mcount_slab_ptr = sbrk(MCOUNT_SLAB_INCREMENT); - mcount_slab_size = MCOUNT_SLAB_INCREMENT; - } - - data = mcount_slab_ptr; - mcount_slab_ptr += size; - mcount_slab_size -= size; - - return data; -} - - -/* - * Add the arc with the values of frompc and topc given to the graph. - * This function might be called at interrupt time so must be able to - * cope with reentrancy. - * - * The fast case, where we have already allocated a function arc, has been - * handled by the assmebler code. - */ -void __mcount_record(void * self_pc, void * from_pc, struct mcount_fn_entry * fn_entry, struct mcount_fn_entry * * fn_head) -{ - alt_irq_context context; - struct mcount_fn_arc * arc_entry; - - /* Keep trying to start up the PC sampler until it is running. - * (It can't start until the timer is going). - */ - if (pcsample_need_init) - { - pcsample_need_init = 0; - pcsample_need_init = nios2_pcsample_init(); - } - - /* - * We must disable interrupts around the allocation and the list update to - * prevent corruption if the instrumented function is re-entrant. - * - * It's safe for the code above to be stepping through the chain and be - * interrupted by this code modifying it - there is an edge case which will - * leave two copies of the same arc on the list (both with count=1), but - * this is dealt with on the host. - */ - context = alt_irq_disable_all(); - - if (fn_entry == NULL) - { - /* Add it to the list of functions we must output later. */ - fn_entry = (struct mcount_fn_entry *)mcount_allocate(sizeof(struct mcount_fn_entry)); - - fn_entry->self_pc = self_pc; - fn_entry->arc_head = NULL; - - fn_entry->next = *fn_head; - *fn_head = fn_entry; - } - - /* We will need a new list entry - if there was a list entry before - * then the assembler code would have handled it. */ - arc_entry = (struct mcount_fn_arc *)mcount_allocate(sizeof(struct mcount_fn_arc)); - - arc_entry->from_pc = from_pc; - arc_entry->count = 1; - - arc_entry->next = fn_entry->arc_head; - fn_entry->arc_head = arc_entry; - - alt_irq_enable_all(context); -} - - -/* - * nios2_pcsample_init starts profiling. - * It is called the first time mcount is called, and on subsequent calls to - * mcount until it returns zero. It initializes the pc histogram and turns on - * timer driven pc sampling. - */ -static int nios2_pcsample_init(void) -{ - unsigned int pcsamples_size; - - /* We sample the PC every tick */ - unsigned int prof_rate = alt_ticks_per_second(); - if (prof_rate == 0) - return 1; - - /* allocate the histogram buffer s_pcsamples */ - pcsamples_size = (s_high_pc - s_low_pc)/PCSAMPLE_BYTES_PER_BUCKET; - s_pcsamples = (unsigned short*)sbrk(pcsamples_size * sizeof(unsigned short)); - - if (s_pcsamples != 0) - { - /* initialize the buffer to zero */ - memset(s_pcsamples, 0, pcsamples_size * sizeof(unsigned short)); - - alt_gmon_data[GMON_DATA_PROFILE_DATA] = (int)s_pcsamples; - alt_gmon_data[GMON_DATA_PROFILE_RATE] = prof_rate; - - /* Sample every tick (it's cheap) */ - alt_alarm_start(&s_nios2_pcsample_alarm, 1, nios2_pcsample, 0); - } - - return 0; -} - - -/* - * Sample the PC value and store it in the histogram - */ -static alt_u32 nios2_pcsample(void* context) -{ - unsigned int pc; - unsigned int bucket; - - /* read the exception return address - this will be - * inaccurate if there are nested interrupts but we - * assume that this is rare and the inaccuracy will - * not be great */ - NIOS2_READ_EA(pc); - - /* - * If we're within the profilable range then increment the relevant - * bucket in the histogram - */ - if (pc >= s_low_pc && pc < s_high_pc && s_pcsamples != 0) - { - bucket = (pc - s_low_pc)/PCSAMPLE_BYTES_PER_BUCKET; - s_pcsamples[bucket]++; - } - - /* Sample every tick */ - return 1; -} - diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_icache_flush.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_icache_flush.c deleted file mode 100644 index 4b706ed..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_icache_flush.c +++ /dev/null @@ -1,84 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "nios2.h" -#include "system.h" - -#include "alt_types.h" -#include "sys/alt_cache.h" - -/* - * alt_icache_flush() is called to flush the instruction cache for a memory - * region of length "len" bytes, starting at address "start". - */ - -void alt_icache_flush (void* start, alt_u32 len) -{ -#if NIOS2_ICACHE_SIZE > 0 - - char* i; - char* end; - - /* - * This is the most we would ever need to flush. - */ - - if (len > NIOS2_ICACHE_SIZE) - { - len = NIOS2_ICACHE_SIZE; - } - - end = ((char*) start) + len; - - for (i = start; i < end; i+= NIOS2_ICACHE_LINE_SIZE) - { - __asm__ volatile ("flushi %0" :: "r" (i)); - } - - /* - * For an unaligned flush request, we've got one more line left. - * Note that this is dependent on NIOS2_ICACHE_LINE_SIZE to be a - * multiple of 2 (which it always is). - */ - - if (((alt_u32) start) & (NIOS2_ICACHE_LINE_SIZE - 1)) - { - __asm__ volatile ("flushi %0" :: "r" (i)); - } - - /* - * Having flushed the cache, flush any stale instructions in the - * pipeline - */ - - __asm__ volatile ("flushp"); - -#endif /* NIOS2_ICACHE_SIZE > 0 */ -} diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_icache_flush_all.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_icache_flush_all.c deleted file mode 100644 index 5088552..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_icache_flush_all.c +++ /dev/null @@ -1,46 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "nios2.h" -#include "system.h" - -#include "alt_types.h" -#include "sys/alt_cache.h" - -/* - * alt_icache_flush_all() is called to flush the entire instruction cache. - */ - -void alt_icache_flush_all (void) -{ -#if NIOS2_ICACHE_SIZE > 0 - alt_icache_flush (0, NIOS2_ICACHE_SIZE); -#endif -} diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_iic.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_iic.c deleted file mode 100644 index 1db5afa..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_iic.c +++ /dev/null @@ -1,106 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ -#include "system.h" - -/* - * This file implements the HAL Enhanced interrupt API for Nios II processors - * with an internal interrupt controller (IIC). For most routines, this serves - * as a wrapper layer over the legacy interrupt API (which must be used with - * the IIC only). - * - * Use of the enhanced API is recommended so that application and device - * drivers are compatible with a Nios II system configured with an external - * interrupt controller (EIC), or IIC. This will afford maximum portability. - * - * If an EIC is present, the EIC device driver must provide these routines, - * because their operation will be specific to that EIC type. - */ -#ifndef NIOS2_EIC_PRESENT -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - -#include "sys/alt_irq.h" -#include "priv/alt_iic_isr_register.h" -#include "priv/alt_legacy_irq.h" - -/** @Function Description: This function registers an interrupt handler. - * If the function is succesful, then the requested interrupt will be enabled upon - * return. Registering a NULL handler will disable the interrupt. - * @API Type: External - * @param ic_id Ignored. - * @param irq IRQ number - * @return 0 if successful, else error (-1) - */ -int alt_ic_isr_register(alt_u32 ic_id, alt_u32 irq, alt_isr_func isr, - void *isr_context, void *flags) -{ - return alt_iic_isr_register(ic_id, irq, isr, isr_context, flags); -} - -/** @Function Description: This function enables a single interrupt. - * @API Type: External - * @param ic_id Ignored. - * @param irq IRQ number - * @return 0 if successful, else error (-1) - */ -int alt_ic_irq_enable (alt_u32 ic_id, alt_u32 irq) -{ - return alt_irq_enable(irq); -} - -/** @Function Description: This function disables a single interrupt. - * @API Type: External - * @param ic_id Ignored. - * @param irq IRQ number - * @return 0 if successful, else error (-1) - */ -int alt_ic_irq_disable(alt_u32 ic_id, alt_u32 irq) -{ - return alt_irq_disable(irq); -} - -/** @Function Description: This function to determine if corresponding - * interrupt is enabled. - * @API Type: External - * @param ic_id Ignored. - * @param irq IRQ number - * @return Zero if corresponding interrupt is disabled and - * non-zero otherwise. - */ -alt_u32 alt_ic_irq_enabled(alt_u32 ic_id, alt_u32 irq) -{ - alt_u32 irq_enabled; - - NIOS2_READ_IENABLE(irq_enabled); - - return (irq_enabled & (1 << irq)) ? 1: 0; -} - -#endif /* ALT_ENHANCED_INTERRUPT_API_PRESENT */ -#endif /* NIOS2_EIC_PRESENT */ diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_iic_isr_register.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_iic_isr_register.c deleted file mode 100644 index b104395..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_iic_isr_register.c +++ /dev/null @@ -1,104 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ -#include -#include "system.h" - -/* - * Provides an interrupt registry mechanism for the any CPUs internal interrupt - * controller (IIC) when the enhanced interrupt API is active. - */ -#ifndef ALT_CPU_EIC_PRESENT -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - -#include "alt_types.h" -#include "sys/alt_irq.h" -#include "priv/alt_iic_isr_register.h" - -/* - * The header, alt_irq_entry.h, contains the exception entry point, and is - * provided by the processor component. It is included here, so that the code - * will be added to the executable only if alt_irq_register() is present, i.e. - * if no interrupts are registered - there's no need to provide any - * interrupt handling. - */ - -#include "sys/alt_irq_entry.h" - -/* - * The header, alt_irq_table.h contains a table describing which function - * handles each interrupt. - */ - -#include "priv/alt_irq_table.h" - -/** @Function Description: This function registers an interrupt handler. - * If the function is succesful, then the requested interrupt will be enabled - * upon return. Registering a NULL handler will disable the interrupt. - * - * @API Type: External - * @param ic_id Interrupt controller ID - * @param irq IRQ ID number - * @param isr Pointer to interrupt service routine - * @param isr_context Opaque pointer passed to ISR - * @param flags - * @return 0 if successful, else error (-1) - */ -int alt_iic_isr_register(alt_u32 ic_id, alt_u32 irq, alt_isr_func isr, - void *isr_context, void *flags) -{ - int rc = -EINVAL; - int id = irq; /* IRQ interpreted as the interrupt ID. */ - alt_irq_context status; - - if (id < ALT_NIRQ) - { - /* - * interrupts are disabled while the handler tables are updated to ensure - * that an interrupt doesn't occur while the tables are in an inconsistant - * state. - */ - - status = alt_irq_disable_all(); - - alt_irq[id].handler = isr; - alt_irq[id].context = isr_context; - - rc = (isr) ? alt_ic_irq_enable(ic_id, id) : alt_ic_irq_disable(ic_id, id); - - alt_irq_enable_all(status); - } - - return rc; -} - -#endif /* ALT_ENHANCED_INTERRUPT_API_PRESENT */ -#endif /* ALT_CPU_EIC_PRESENT */ diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_instruction_exception_entry.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_instruction_exception_entry.c deleted file mode 100644 index f4f52fc..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_instruction_exception_entry.c +++ /dev/null @@ -1,203 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2008 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ -#include "sys/alt_exceptions.h" -#include "nios2.h" -#include "alt_types.h" -#include "system.h" - -/* - * This file implements support for calling user-registered handlers for - * instruction-generated exceptions. This handler could also be reached - * in the event of a spurious interrupt. - * - * The handler code is optionally enabled through the "Enable - * Instruction-related Exception API" HAL BSP setting, which will - * define the macro below. - */ -#ifdef ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API - -/* Function pointer to exception callback routine */ -alt_exception_result (*alt_instruction_exception_handler) - (alt_exception_cause, alt_u32, alt_u32) = 0x0; - -/* Link entry routine to .exceptions section */ -int alt_instruction_exception_entry (alt_u32 exception_pc) - __attribute__ ((section (".exceptions"))); - -/* - * This is the entry point for instruction-generated exceptions handling. - * This routine will be called by alt_exceptions_entry.S, after it determines - * that an exception could not be handled by handlers that preceed that - * of instruction-generated exceptions (such as interrupts). - * - * For this to function properly, you must register an exception handler - * using alt_instruction_exception_register(). This routine will call - * that handler if it has been registered. Absent a handler, it will - * break break or hang as discussed below. - */ -int alt_instruction_exception_entry (alt_u32 exception_pc) -{ - alt_u32 cause, badaddr; - -/* - * If the processor hardware has the optional EXCEPTIONS & BADADDR registers, - * read them and pass their content to the user handler. These are always - * present if the MMU or MPU is enabled, and optionally for other advanced - * exception types via the "Extra exceptions information" setting in the - * processor (hardware) configuration. - * - * If these registers are not present, the cause field will be set to - * NIOS2_EXCEPTION_CAUSE_NOT_PRESENT. Your handling routine should - * check the validity of the cause argument before proceeding. - */ -#ifdef NIOS2_HAS_EXTRA_EXCEPTION_INFO - /* Get exception cause & "badaddr" */ - NIOS2_READ_EXCEPTION(cause); - cause = ( (cause & NIOS2_EXCEPTION_REG_CAUSE_MASK) >> - NIOS2_EXCEPTION_REG_CAUSE_OFST ); - - NIOS2_READ_BADADDR(badaddr); -#else - cause = NIOS2_EXCEPTION_CAUSE_NOT_PRESENT; - badaddr = 0; -#endif /* NIOS2_HAS_EXTRA_EXCEPTION_INFO */ - - if(alt_instruction_exception_handler) { - /* - * Call handler. Its return value indicates whether the exception-causing - * instruction should be re-issued. The code that called us, - * alt_eceptions_entry.S, will look at this value and adjust the ea - * register as necessary - */ - return alt_instruction_exception_handler(cause, exception_pc, badaddr); - } - /* - * We got here because an instruction-generated exception occured, but no - * handler is present. We do not presume to know how to handle it. If the - * debugger is present, break, otherwise hang. - * - * If you've reached here in the debugger, consider examining the - * EXCEPTIONS register cause bit-field, which was read into the 'cause' - * variable above, and compare it against the exceptions-type enumeration - * in alt_exceptions.h. This register is availabe if the MMU or MPU is - * present, or if the "Extra exceptions information" hardware option is - * selected. - * - * If you get here then one of the following could have happened: - * - * - An instruction-generated exception occured, and the processor - * does not have the extra exceptions feature enabled, or you - * have not registered a handler using - * alt_instruction_exception_register() - * - * Some examples of instruction-generated exceptions and why they - * might occur: - * - * - Your program could have been compiled for a full-featured - * Nios II core, but it is running on a smaller core, and - * instruction emulation has been disabled by defining - * ALT_NO_INSTRUCTION_EMULATION. - * - * You can work around the problem by re-enabling instruction - * emulation, or you can figure out why your program is being - * compiled for a system other than the one that it is running on. - * - * - Your program has executed a trap instruction, but has not - * implemented a handler for this instruction. - * - * - Your program has executed an illegal instruction (one which is - * not defined in the instruction set). - * - * - Your processor includes an MMU or MPU, and you have enabled it - * before registering an exception handler to service exceptions it - * generates. - * - * The problem could also be hardware related: - * - If your hardware is broken and is generating spurious interrupts - * (a peripheral which negates its interrupt output before its - * interrupt handler has been executed will cause spurious interrupts) - */ - else { -#ifdef NIOS2_HAS_DEBUG_STUB - NIOS2_BREAK(); -#else - while(1) - ; -#endif /* NIOS2_HAS_DEBUG_STUB */ - } - - /* // We should not get here. Remove compiler warning. */ - return NIOS2_EXCEPTION_RETURN_REISSUE_INST; -} - -#endif /* ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API */ - -/* - * This routine indicates whether a particular exception cause will have - * set a valid address into the BADADDR register, which is included - * in the arguments to a user-registered instruction-generated exception - * handler. Many exception types do not set valid contents in BADADDR; - * this is a convenience routine to easily test the validity of that - * argument in your handler. - * - * Note that this routine will return false (0) for cause '12', - * TLB miss. This is because there are four exception types that - * share that cause, two of which do not have a valid BADADDR. You - * must determine BADADDR's validity for these. - * - * Arguments: - * cause: The 5-bit exception cause field of the EXCEPTIONS register, - * shifted to the LSB position. You may pass the 'cause' argument - * in a handler you registered directy to this routine. - * - * Return: 1: BADADDR (bad_addr argument to handler) is valid - * 0: BADADDR is not valid - */ -int alt_exception_cause_generated_bad_addr(alt_exception_cause cause) -{ - switch (cause) { - case NIOS2_EXCEPTION_SUPERVISOR_ONLY_DATA_ADDR: - return 1; - case NIOS2_EXCEPTION_MISALIGNED_DATA_ADDR: - return 1; - case NIOS2_EXCEPTION_MISALIGNED_TARGET_PC: - return 1; - case NIOS2_EXCEPTION_TLB_READ_PERM_VIOLATION: - return 1; - case NIOS2_EXCEPTION_TLB_WRITE_PERM_VIOLATION: - return 1; - case NIOS2_EXCEPTION_MPU_DATA_REGION_VIOLATION: - return 1; - default: - return 0; - } -} diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_instruction_exception_register.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_instruction_exception_register.c deleted file mode 100644 index b059e1d..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_instruction_exception_register.c +++ /dev/null @@ -1,82 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2008 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ -#include "sys/alt_exceptions.h" -#include "alt_types.h" -#include "system.h" - -/* - * This file implements support for calling user-registered handlers for - * instruction-generated exceptions. - * - * The registry API is optionally enabled through the "Enable - * Instruction-related Exception API" HAL BSP setting, which will - * define the macro below. - */ -#ifdef ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API - -/* - * The header, alt_exception_handler_registry.h contains a struct describing - * the registered exception handler - */ -#include "priv/alt_exception_handler_registry.h" - -/* - * Pull in the exception entry assembly code. This will not be linked in - * unless this object is linked into the executable (i.e. only if - * alt_instruction_exception_register() is called). - */ -__asm__( "\n\t.globl alt_exception" ); - -/* - * alt_instruction_exception_register() is called to register a handler to - * service instruction-generated exceptions that are not handled by the - * default exception handler code (interrupts, and optionally unimplemented - * instructions and traps). - * - * Passing null (0x0) in the handler argument will disable a previously- - * registered handler. - * - * Note that if no handler is registered, exceptions that are not processed - * using the built-in handler (interrupts, and optionally unimplemented - * instructions and traps) are treated as unknown exceptions, resulting - * in either a break or an infinite loop. - */ -void alt_instruction_exception_register ( - alt_exception_result (*exception_handler)( - alt_exception_cause cause, - alt_u32 exception_pc, - alt_u32 bad_addr) ) -{ - alt_instruction_exception_handler = exception_handler; -} - -#endif /* ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API */ diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_io_redirect.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_io_redirect.c deleted file mode 100644 index 8c862f7..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_io_redirect.c +++ /dev/null @@ -1,98 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include -#include - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - - -/* - * alt_open_fd() is similar to open() in that it is used to obtain a file - * descriptor for the file named "name". The "flags" and "mode" arguments are - * identical to the "flags" and "mode" arguments of open(). - * - * The distinction between the two functions is that the file descriptor - * structure to use is passed in as an argument, rather than allocated from the - * list of free file descriptors. - * - * This is used by alt_io_redirect() to redirect the stdin, stdout and stderr - * file descriptors to point to new devices. - * - * If the device can not be succesfully opened, then the input file descriptor - * remains unchanged. - */ - -static void alt_open_fd(alt_fd* fd, const char* name, int flags, int mode) -{ - int old; - - old = open (name, flags, mode); - - if (old >= 0) - { - fd->dev = alt_fd_list[old].dev; - fd->priv = alt_fd_list[old].priv; - fd->fd_flags = alt_fd_list[old].fd_flags; - - alt_release_fd (old); - } -} - -/* - * alt_io_redirect() is called once the device/filesystem lists have been - * initialised, but before main(). Its function is to redirect standard in, - * standard out and standard error so that they point to the devices selected by - * the user (as defined in system.h). - * - * Prior to the call to this function, io is directed towards /dev/null. If - * i/o can not be redirected to the requested device, for example if the device - * does not exist, then it remains directed at /dev/null. - */ - -void alt_io_redirect(const char* stdout_dev, - const char* stdin_dev, - const char* stderr_dev) -{ - /* Redirect the channels */ - - alt_open_fd (&alt_fd_list[STDOUT_FILENO], stdout_dev, O_WRONLY, 0777); - alt_open_fd (&alt_fd_list[STDIN_FILENO], stdin_dev, O_RDONLY, 0777); - alt_open_fd (&alt_fd_list[STDERR_FILENO], stderr_dev, O_WRONLY, 0777); -} - - - - diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_ioctl.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_ioctl.c deleted file mode 100644 index f5d7ef1..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_ioctl.c +++ /dev/null @@ -1,170 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "sys/ioctl.h" -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -/* - * The ioctl() system call is provided so that application code can manipulate - * the i/o capabilities of a device in device specific ways. This is identical - * to the standard posix ioctl() function. - * - * In general this implementation simply vectors ioctl requests to the - * apropriate drivers ioctl function (as registered in the drivers alt_dev - * structure). - * - * However in the case of devices (as oposed to filesystem), the TIOCEXCL and - * TIOCNXCL requests are handled without reference to the driver. These - * requests are used to lock/release a device for exclusive access. - * - * Handling these requests centrally eases the task of device driver - * development. - * - * ALT_IOCTL is mapped onto the ioctl() system call in alt_syscall.h - */ - -#ifdef ALT_USE_DIRECT_DRIVERS - -#include "system.h" -#include "sys/alt_driver.h" - -/* - * Provide minimal version that calls ioctl routine of provided stdio devices. - */ -int ALT_IOCTL (int file, int req, void* arg) -{ -#ifdef ALT_STDIN_PRESENT - ALT_DRIVER_IOCTL_EXTERNS(ALT_STDIN_DEV); -#endif -#ifdef ALT_STDOUT_PRESENT - ALT_DRIVER_IOCTL_EXTERNS(ALT_STDOUT_DEV); -#endif -#ifdef ALT_STDERR_PRESENT - ALT_DRIVER_IOCTL_EXTERNS(ALT_STDERR_DEV); -#endif - -#if !defined(ALT_STDIN_PRESENT) && !defined(ALT_STDOUT_PRESENT) && !defined(ALT_STDERR_PRESENT) - /* Generate a link time warning, should this function ever be called. */ - ALT_STUB_WARNING(ioctl); -#endif - - switch (file) { -#ifdef ALT_STDIN_PRESENT - case 0: /* stdin file descriptor */ - return ALT_DRIVER_IOCTL(ALT_STDIN_DEV, req, arg); -#endif /* ALT_STDIN_PRESENT */ -#ifdef ALT_STDOUT_PRESENT - case 1: /* stdout file descriptor */ - return ALT_DRIVER_IOCTL(ALT_STDOUT_DEV, req, arg); -#endif /* ALT_STDOUT_PRESENT */ -#ifdef ALT_STDERR_PRESENT - case 2: /* stderr file descriptor */ - return ALT_DRIVER_IOCTL(ALT_STDERR_DEV, req, arg); -#endif /* ALT_STDERR_PRESENT */ - default: - ALT_ERRNO = EBADFD; - return -1; - } -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -int ALT_IOCTL (int file, int req, void* arg) -{ - alt_fd* fd; - int rc; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - - /* - * In the case of device drivers (not file systems) handle the TIOCEXCL - * and TIOCNXCL requests as special cases. - */ - - if (fd->fd_flags & ALT_FD_DEV) - { - if (req == TIOCEXCL) - { - rc = alt_fd_lock (fd); - goto ioctl_done; - } - else if (req == TIOCNXCL) - { - rc = alt_fd_unlock (fd); - goto ioctl_done; - } - } - - /* - * If the driver provides an ioctl() function, call that to handle the - * request, otherwise set the return code to indicate that the request - * could not be processed. - */ - - if (fd->dev->ioctl) - { - rc = fd->dev->ioctl(fd, req, arg); - } - else - { - rc = -ENOTTY; - } - } - else - { - rc = -EBADFD; - } - -ioctl_done: - - if (rc < 0) - { - ALT_ERRNO = -rc; - } - return rc; -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_irq_entry.S b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_irq_entry.S deleted file mode 100644 index d3efe7d..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_irq_entry.S +++ /dev/null @@ -1,108 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "system.h" - -/* - * This is the interrupt exception entry point code, which saves all the - * registers and calls the interrupt handler. It should be pulled in using - * a .globl from alt_irq_register.c. This scheme is used so that if an - * interrupt is never registered, then this code will not appear in the - * generated executable, thereby improving code footprint. - */ - - /* - * Explicitly allow the use of r1 (the assembler temporary register) - * within this code. This register is normally reserved for the use of - * the compiler. - */ - .set noat - - /* - * Pull in the exception handler register save code. - */ - .globl alt_exception - - .globl alt_irq_entry - .section .exceptions.entry.label, "xa" -alt_irq_entry: - - /* - * Section .exceptions.entry is in alt_exception_entry.S - * This saves all the caller saved registers and reads estatus into r5 - */ - - .section .exceptions.irqtest, "xa" - -#ifdef ALT_CI_INTERRUPT_VECTOR_N - /* - * Use the interrupt vector custom instruction if present to accelerate - * this code. - * If the interrupt vector custom instruction returns a negative - * value, there are no interrupts active (estatus.pie is 0 - * or ipending is 0) so assume it is a software exception. - */ - custom ALT_CI_INTERRUPT_VECTOR_N, r4, r0, r0 - blt r4, r0, .Lnot_irq -#else - /* - * Test to see if the exception was a software exception or caused - * by an external interrupt, and vector accordingly. - */ - rdctl r4, ipending - andi r2, r5, 1 - beq r2, zero, .Lnot_irq - beq r4, zero, .Lnot_irq -#endif /* ALT_CI_INTERRUPT_VECTOR_N */ - - .section .exceptions.irqhandler, "xa" - /* - * Now that all necessary registers have been preserved, call - * alt_irq_handler() to process the interrupts. - */ - - call alt_irq_handler - - .section .exceptions.irqreturn, "xa" - - br .Lexception_exit - - .section .exceptions.notirq.label, "xa" - -.Lnot_irq: - - /* - * Section .exceptions.exit is in alt_exception_entry.S - * This restores all the caller saved registers - */ - - .section .exceptions.exit.label -.Lexception_exit: - diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_irq_handler.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_irq_handler.c deleted file mode 100644 index 3253d02..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_irq_handler.c +++ /dev/null @@ -1,169 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include "system.h" - -/* - * This interrupt handler only works with an internal interrupt controller - * (IIC). Processors with an external interrupt controller (EIC) use an - * implementation provided by an EIC driver. - */ -#ifndef ALT_CPU_EIC_PRESENT - -#include "sys/alt_irq.h" -#include "os/alt_hooks.h" - -#include "alt_types.h" - -/* - * A table describing each interrupt handler. The index into the array is the - * interrupt id associated with the handler. - * - * When an interrupt occurs, the associated handler is called with - * the argument stored in the context member. - */ -struct ALT_IRQ_HANDLER -{ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - void (*handler)(void*); -#else - void (*handler)(void*, alt_u32); -#endif - void *context; -} alt_irq[ALT_NIRQ]; - -/* - * alt_irq_handler() is called by the interrupt exception handler in order to - * process any outstanding interrupts. - * - * It is defined here since it is linked in using weak linkage. - * This means that if there is never a call to alt_irq_register() (above) then - * this function will not get linked in to the executable. This is acceptable - * since if no handler is ever registered, then an interrupt can never occur. - * - * If Nios II interrupt vector custom instruction exists, use it to accelerate - * the dispatch of interrupt handlers. The Nios II interrupt vector custom - * instruction is present if the macro ALT_CI_INTERRUPT_VECTOR defined. - */ - -void alt_irq_handler (void) __attribute__ ((section (".exceptions"))); -void alt_irq_handler (void) -{ -#ifdef ALT_CI_INTERRUPT_VECTOR - alt_32 offset; - char* alt_irq_base = (char*)alt_irq; -#else - alt_u32 active; - alt_u32 mask; - alt_u32 i; -#endif /* ALT_CI_INTERRUPT_VECTOR */ - - /* - * Notify the operating system that we are at interrupt level. - */ - - ALT_OS_INT_ENTER(); - -#ifdef ALT_CI_INTERRUPT_VECTOR - /* - * Call the interrupt vector custom instruction using the - * ALT_CI_INTERRUPT_VECTOR macro. - * It returns the offset into the vector table of the lowest-valued pending - * interrupt (corresponds to highest priority) or a negative value if none. - * The custom instruction assumes that each table entry is eight bytes. - */ - while ((offset = ALT_CI_INTERRUPT_VECTOR) >= 0) { - struct ALT_IRQ_HANDLER* handler_entry = - (struct ALT_IRQ_HANDLER*)(alt_irq_base + offset); -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - handler_entry->handler(handler_entry->context); -#else - handler_entry->handler(handler_entry->context, offset >> 3); -#endif - } -#else /* ALT_CI_INTERRUPT_VECTOR */ - /* - * Obtain from the interrupt controller a bit list of pending interrupts, - * and then process the highest priority interrupt. This process loops, - * loading the active interrupt list on each pass until alt_irq_pending() - * return zero. - * - * The maximum interrupt latency for the highest priority interrupt is - * reduced by finding out which interrupts are pending as late as possible. - * Consider the case where the high priority interupt is asserted during - * the interrupt entry sequence for a lower priority interrupt to see why - * this is the case. - */ - - active = alt_irq_pending (); - - do - { - i = 0; - mask = 1; - - /* - * Test each bit in turn looking for an active interrupt. Once one is - * found, the interrupt handler asigned by a call to alt_irq_register() is - * called to clear the interrupt condition. - */ - - do - { - if (active & mask) - { -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - alt_irq[i].handler(alt_irq[i].context); -#else - alt_irq[i].handler(alt_irq[i].context, i); -#endif - break; - } - mask <<= 1; - i++; - - } while (1); - - active = alt_irq_pending (); - - } while (active); -#endif /* ALT_CI_INTERRUPT_VECTOR */ - - /* - * Notify the operating system that interrupt processing is complete. - */ - - ALT_OS_INT_EXIT(); -} - -#endif /* ALT_CPU_EIC_PRESENT */ diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_irq_register.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_irq_register.c deleted file mode 100644 index b5ea474..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_irq_register.c +++ /dev/null @@ -1,102 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ -#include -#include "system.h" - -/* - * This interrupt registry mechanism works with the Nios II internal interrupt - * controller (IIC) only. Systems with an external interrupt controller (EIC), - * or those with the IIC who are using the enhanced interrupt API will - * utilize the alt_ic_isr_register() routine to register an interrupt. - */ -#ifndef NIOS2_EIC_PRESENT - -#include "sys/alt_irq.h" -#include "priv/alt_legacy_irq.h" -#include "os/alt_hooks.h" - -#include "alt_types.h" - -/* - * The header, alt_irq_entry.h, contains the exception entry point, and is - * provided by the processor component. It is included here, so that the code - * will be added to the executable only if alt_irq_register() is present, i.e. - * if no interrupts are registered - there's no need to provide any - * interrupt handling. - */ - -#include "sys/alt_irq_entry.h" - -/* - * The header, alt_irq_table.h contains a table describing which function - * handles each interrupt. - */ - -#include "priv/alt_irq_table.h" - -/* - * alt_irq_handler() is called to register an interrupt handler. If the - * function is succesful, then the requested interrupt will be enabled upon - * return. Registering a NULL handler will disable the interrupt. - * - * The return value is 0 if the interrupt handler was registered and the - * interrupt was enabled, otherwise it is negative. - */ - -int alt_irq_register (alt_u32 id, - void* context, - alt_isr_func handler) -{ - int rc = -EINVAL; - alt_irq_context status; - - if (id < ALT_NIRQ) - { - /* - * interrupts are disabled while the handler tables are updated to ensure - * that an interrupt doesn't occur while the tables are in an inconsistant - * state. - */ - - status = alt_irq_disable_all (); - - alt_irq[id].handler = handler; - alt_irq[id].context = context; - - rc = (handler) ? alt_irq_enable (id): alt_irq_disable (id); - - alt_irq_enable_all(status); - } - return rc; -} -#endif /* NIOS2_EIC_PRESENT */ - diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_irq_vars.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_irq_vars.c deleted file mode 100644 index 8c0a18d..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_irq_vars.c +++ /dev/null @@ -1,47 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "alt_types.h" - -#include "system.h" - -/* - * These global variables are used to save the current list of enabled - * interrupts. See alt_irq.h for further details. - */ - -volatile alt_u32 alt_irq_active = 0; - -#ifndef ALT_EXCEPTION_STACK - -volatile alt_u32 alt_priority_mask = (alt_u32) -1; - -#endif - diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_isatty.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_isatty.c deleted file mode 100644 index 9276472..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_isatty.c +++ /dev/null @@ -1,125 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include "sys/alt_dev.h" -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -#ifdef ALT_USE_DIRECT_DRIVERS - -#include "system.h" - -/* - * Provide minimal version that just describes all file descriptors - * as tty devices for provided stdio devices. - */ -int ALT_ISATTY (int file) -{ - switch (file) { -#ifdef ALT_STDIN_PRESENT - case 0: /* stdin file descriptor */ -#endif /* ALT_STDIN_PRESENT */ -#ifdef ALT_STDOUT_PRESENT - case 1: /* stdout file descriptor */ -#endif /* ALT_STDOUT_PRESENT */ -#ifdef ALT_STDERR_PRESENT - case 2: /* stderr file descriptor */ -#endif /* ALT_STDERR_PRESENT */ - return 1; - default: - return 0; - } - -#if !defined(ALT_STDIN_PRESENT) && !defined(ALT_STDOUT_PRESENT) && !defined(ALT_STDERR_PRESENT) - /* Generate a link time warning, should this function ever be called. */ - ALT_STUB_WARNING(isatty); -#endif -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ -/* - * isatty() can be used to determine whether the input file descriptor "file" - * refers to a terminal device or not. If it is a terminal device then the - * return value is one, otherwise it is zero. - * - * ALT_ISATTY is mapped onto the isatty() system call in alt_syscall.h - */ - -int ALT_ISATTY (int file) -{ - alt_fd* fd; - struct stat stat; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - /* - * If a device driver does not provide an fstat() function, then it is - * treated as a terminal device by default. - */ - - if (!fd->dev->fstat) - { - return 1; - } - - /* - * If a driver does provide an implementation of the fstat() function, then - * this is called so that the device can identify itself. - */ - - else - { - fstat (file, &stat); - return (stat.st_mode == _IFCHR) ? 1 : 0; - } - } - else - { - ALT_ERRNO = EBADFD; - return 0; - } -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_kill.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_kill.c deleted file mode 100644 index 42c2e1d..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_kill.c +++ /dev/null @@ -1,121 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include "sys/alt_errno.h" -#include "os/alt_syscall.h" - - -/* - * kill() is used by newlib in order to send signals to processes. Since there - * is only a single process in the HAL, the only valid values for pid are - * either the current process id, or the broadcast values, i.e. pid must be - * less than or equal to zero. - * - * ALT_KILL is mapped onto the kill() system call in alt_syscall.h - */ - -int ALT_KILL (int pid, int sig) -{ - int status = 0; - - if (pid <= 0) - { - switch (sig) - { - case 0: - - /* The null signal is used to check that a pid is valid. */ - - break; - - case SIGABRT: - case SIGALRM: - case SIGFPE: - case SIGILL: - case SIGKILL: - case SIGPIPE: - case SIGQUIT: - case SIGSEGV: - case SIGTERM: - case SIGUSR1: - case SIGUSR2: - case SIGBUS: - case SIGPOLL: - case SIGPROF: - case SIGSYS: - case SIGTRAP: - case SIGVTALRM: - case SIGXCPU: - case SIGXFSZ: - - /* - * The Posix standard defines the default behaviour for all these signals - * as being eqivalent to a call to _exit(). No mechanism is provided to - * change this behaviour. - */ - - _exit(0); - case SIGCHLD: - case SIGURG: - - /* - * The Posix standard defines these signals to be ignored by default. No - * mechanism is provided to change this behaviour. - */ - - break; - default: - - /* Tried to send an unsupported signal */ - - status = EINVAL; - } - } - - else if (pid > 0) - { - /* Attempted to signal a non-existant process */ - - status = ESRCH; - } - - if (status) - { - ALT_ERRNO = status; - return -1; - } - - return 0; -} diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_link.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_link.c deleted file mode 100644 index d796c59..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_link.c +++ /dev/null @@ -1,56 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_warning.h" -#include "sys/alt_errno.h" -#include "os/alt_syscall.h" - -/* - * link() is used by newlib to create a new link to an existing file. This is - * unsupported in the HAL environment. However a "do-nothing" implementation - * is still provied for newlib compatability. - * - * ALT_LINK is mapped onto the link() system call in alt_syscall.h - */ - -int ALT_LINK ( char *existing, char *new) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(link); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} - diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_load.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_load.c deleted file mode 100644 index ffab4b9..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_load.c +++ /dev/null @@ -1,88 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_load.h" -#include "sys/alt_cache.h" - -/* - * Linker defined symbols. - */ - -extern void __flash_rwdata_start; -extern void __ram_rwdata_start; -extern void __ram_rwdata_end; -extern void __flash_rodata_start; -extern void __ram_rodata_start; -extern void __ram_rodata_end; -extern void __flash_exceptions_start; -extern void __ram_exceptions_start; -extern void __ram_exceptions_end; - -/* - * alt_load() is called when the code is executing from flash. In this case - * there is no bootloader, so this application is responsible for loading to - * RAM any sections that are required. - */ - -void alt_load (void) -{ - /* - * Copy the .rwdata section. - */ - - alt_load_section (&__flash_rwdata_start, - &__ram_rwdata_start, - &__ram_rwdata_end); - - /* - * Copy the exception handler. - */ - - alt_load_section (&__flash_exceptions_start, - &__ram_exceptions_start, - &__ram_exceptions_end); - - /* - * Copy the .rodata section. - */ - - alt_load_section (&__flash_rodata_start, - &__ram_rodata_start, - &__ram_rodata_end); - - /* - * Now ensure that the caches are in synch. - */ - - alt_dcache_flush_all(); - alt_icache_flush_all(); -} diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_log_macro.S b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_log_macro.S deleted file mode 100644 index 499c4ad..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_log_macro.S +++ /dev/null @@ -1,56 +0,0 @@ -/* alt_log_macro.S - * - * Implements the function tx_log_str, called by the assembly macro - * ALT_LOG_PUTS(). The macro will be empty when logging is turned off, - * and this function will not be compiled. When logging is on, - * this function is used to print out the strings defined in the beginning - * of alt_log_printf.c, using port information taken from system.h and - * alt_log_printf.h. - * - * This routine only handles strings, and sends a character into the defined - * output device's output buffer when the device is ready. It's intended for - * debugging purposes, where messages can be set to print out at certain - * points in the boot code to indicate the progress of the program. - * - */ - -#ifndef __ALT_LOG_MACROS__ -#define __ALT_LOG_MACROS__ - -/* define this flag to skip assembly-incompatible parts - * of various include files. */ -#define ALT_ASM_SRC - -#ifdef ALT_LOG_ENABLE // only compile this function if this flag is defined. - - #include "system.h" - #include "sys/alt_log_printf.h" - - .global tx_log_str -tx_log_str: - /* load base uart / jtag uart address into r6 */ - movhi r6, %hiadj(ALT_LOG_PORT_BASE) - addi r6, r6, %lo(ALT_LOG_PORT_BASE) -tx_next_char: - /* if pointer points to null, return - * r4 is the pointer to the str to be printed, set by ALT_LOG_PUTS */ - ldb r7, (r4) - beq r0, r7, end_tx - - /* check device transmit ready */ -wait_tx_ready_loop: - ldwio r5, ALT_LOG_PRINT_REG_OFFSET(r6) - andi r5, r5, ALT_LOG_PRINT_MSK - beq r5, r0, wait_tx_ready_loop - /* write char */ - stwio r7, ALT_LOG_PRINT_TXDATA_REG_OFFSET (r6) - /* advance string pointer */ - addi r4, r4, 1 - br tx_next_char -end_tx: - ret - -#endif - -#endif /* __ALT_LOG_MACROS__ */ - diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_log_printf.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_log_printf.c deleted file mode 100644 index 1f7056d..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_log_printf.c +++ /dev/null @@ -1,479 +0,0 @@ - -/* alt_log_printf.c - * - * This file implements the various C functions used for the - * alt_log logging/debugging print functions. The functions - * sit as is here - the job of hiding them from the compiler - * if logging is disabled is accomplished in the .h file. - * - * All the global variables for alt_log are defined here. - * These include the various flags that turn on additional - * logging options; the strings for assembly printing; and - * other globals needed by different logging options. - * - * There are 4 functions that handle the actual printing: - * alt_log_txchar: Actual function that puts 1 char to UART/JTAG UART. - * alt_log_repchar: Calls alt_log_txchar 'n' times - used by - * alt_log_private_printf for formatting. - * alt_log_private_printf: - * Stripped down implementation of printf - no floats. - * alt_log_printf_proc: - * Wrapper function for private_printf. - * - * The rest of the functions are called by the macros which - * were called by code in the other components. Each function - * is preceded by a comment, about which file it gets called - * in, and what its purpose is. - * - * author: gkwan - */ - -/* skip all code if enable is off */ -#ifdef ALT_LOG_ENABLE - -#include -#include -#include -#ifdef __ALTERA_AVALON_JTAG_UART - #include "altera_avalon_jtag_uart.h" - #include -#endif -#include "sys/alt_log_printf.h" - -/* strings for assembly puts */ -char alt_log_msg_bss[] = "[crt0.S] Clearing BSS \r\n";; -char alt_log_msg_alt_main[] = "[crt0.S] Calling alt_main.\r\n"; -char alt_log_msg_stackpointer[] \ - = "[crt0.S] Setting up stack and global pointers.\r\n"; -char alt_log_msg_cache[] = "[crt0.S] Inst & Data Cache Initialized.\r\n"; -/* char array allocation for alt_write */ -char alt_log_write_buf[ALT_LOG_WRITE_ECHO_LEN+2]; - -/* global variables for all 'on' flags */ - -/* - * The boot message flag is linked into the data (rwdata) section - * because if it is zero, it would otherwise be placed in the bss section. - * alt_log examines this variable before the BSS is cleared in the boot-up - * process. - */ -volatile alt_u32 alt_log_boot_on_flag \ - __attribute__ ((section (".data"))) = ALT_LOG_BOOT_ON_FLAG_SETTING; - -volatile alt_u8 alt_log_write_on_flag = ALT_LOG_WRITE_ON_FLAG_SETTING; - -volatile alt_u8 alt_log_sys_clk_on_flag = ALT_LOG_SYS_CLK_ON_FLAG_SETTING; - -volatile alt_u8 alt_log_jtag_uart_alarm_on_flag = \ - ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING; - -volatile alt_u8 alt_log_jtag_uart_isr_on_flag = \ - ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING; - -volatile alt_u8 alt_log_jtag_uart_startup_info_on_flag = \ - ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING; - -/* Global alarm object for recurrent JTAG UART status printing */ -alt_alarm alt_log_jtag_uart_alarm_1; - -/* Global ints for system clock printing and count */ -volatile int alt_log_sys_clk_count; -volatile int alt_system_clock_in_sec; - -/* enum used by alt_log_private_printf */ -enum -{ - pfState_chars, - pfState_firstFmtChar, - pfState_otherFmtChar -}; - - - - -/* Function to put one char onto the UART/JTAG UART txdata register. */ -void alt_log_txchar(int c,char *base) -{ - /* Wait until the device is ready for a character */ - while((ALT_LOG_PRINT_REG_RD(base) & ALT_LOG_PRINT_MSK) == 0) - ; - /* And pop the character into the register */ - ALT_LOG_PRINT_TXDATA_WR(base,c); -} - - -/* Called by alt_log_private_printf to print out characters repeatedly */ -void alt_log_repchar(char c,int r,int base) -{ - while(r-- > 0) - alt_log_txchar(c,(char*) base); -} - - -/* Stripped down printf function */ -void alt_log_private_printf(const char *fmt,int base,va_list args) - { - const char *w; - char c; - int state; - int fmtLeadingZero = 0; /* init these all to 0 for -W warnings. */ - int fmtLong = 0; - int fmtBeforeDecimal = 0; - int fmtAfterDecimal = 0; - int fmtBase = 0; - int fmtSigned = 0; - int fmtCase = 0; /* For hex format, if 1, A-F, else a-f. */ - - w = fmt; - state = pfState_chars; - - while(0 != (c = *w++)) - { - switch(state) - { - case pfState_chars: - if(c == '%') - { - fmtLeadingZero = 0; - fmtLong = 0; - fmtBase = 10; - fmtSigned = 1; - fmtCase = 0; /* Only %X sets this. */ - fmtBeforeDecimal = -1; - fmtAfterDecimal = -1; - state = pfState_firstFmtChar; - } - else - { - alt_log_txchar(c,(char*)base); - } - break; - - case pfState_firstFmtChar: - if(c == '0') - { - fmtLeadingZero = 1; - state = pfState_otherFmtChar; - } - else if(c == '%') - { - alt_log_txchar(c,(char*)base); - state = pfState_chars; - } - else - { - state = pfState_otherFmtChar; - goto otherFmtChar; - } - break; - - case pfState_otherFmtChar: -otherFmtChar: - if(c == '.') - { - fmtAfterDecimal = 0; - } - else if('0' <= c && c <= '9') - { - c -= '0'; - if(fmtAfterDecimal < 0) /* still before decimal */ - { - if(fmtBeforeDecimal < 0) - { - fmtBeforeDecimal = 0; - } - else - { - fmtBeforeDecimal *= 10; - } - fmtBeforeDecimal += c; - } - else - { - fmtAfterDecimal = (fmtAfterDecimal * 10) + c; - } - } - else if(c == 'l') - { - fmtLong = 1; - } - else /* we're up to the letter which determines type */ - { - switch(c) - { - case 'd': - case 'i': -doIntegerPrint: - { - unsigned long v; - unsigned long p; /* biggest power of fmtBase */ - unsigned long vShrink; /* used to count digits */ - int sign; - int digitCount; - - /* Get the value */ - if(fmtLong) - { - if (fmtSigned) - { - v = va_arg(args,long); - } - else - { - v = va_arg(args,unsigned long); - } - } - else - { - if (fmtSigned) - { - v = va_arg(args,int); - } - else - { - v = va_arg(args,unsigned int); - } - } - - /* Strip sign */ - sign = 0; - /* (assumes sign bit is #31) */ - if( fmtSigned && (v & (0x80000000)) ) - { - v = ~v + 1; - sign = 1; - } - - /* Count digits, and get largest place value */ - vShrink = v; - p = 1; - digitCount = 1; - while( (vShrink = vShrink / fmtBase) > 0 ) - { - digitCount++; - p *= fmtBase; - } - - /* Print leading characters & sign */ - fmtBeforeDecimal -= digitCount; - if(fmtLeadingZero) - { - if(sign) - { - alt_log_txchar('-',(char*)base); - fmtBeforeDecimal--; - } - alt_log_repchar('0',fmtBeforeDecimal,base); - } - else - { - if(sign) - { - fmtBeforeDecimal--; - } - alt_log_repchar(' ',fmtBeforeDecimal,base); - if(sign) - { - alt_log_txchar('-',(char*)base); - } - } - - /* Print numbery parts */ - while(p) - { - unsigned char d; - - d = v / p; - d += '0'; - if(d > '9') - { - d += (fmtCase ? 'A' : 'a') - '0' - 10; - } - alt_log_txchar(d,(char*)base); - - v = v % p; - p = p / fmtBase; - } - } - - state = pfState_chars; - break; - - case 'u': - fmtSigned = 0; - goto doIntegerPrint; - case 'o': - fmtSigned = 0; - fmtBase = 8; - goto doIntegerPrint; - case 'x': - fmtSigned = 0; - fmtBase = 16; - goto doIntegerPrint; - case 'X': - fmtSigned = 0; - fmtBase = 16; - fmtCase = 1; - goto doIntegerPrint; - - case 'c': - alt_log_repchar(' ',fmtBeforeDecimal-1,base); - alt_log_txchar(va_arg(args,int),(char*)base); - break; - - case 's': - { - char *s; - - s = va_arg(args,char *); - alt_log_repchar(' ',fmtBeforeDecimal-strlen(s),base); - - while(*s) - alt_log_txchar(*s++,(char*)base); - } - break; - } /* switch last letter of fmt */ - state=pfState_chars; - } - break; - } /* switch */ - } /* while chars left */ - } /* printf */ - -/* Main logging printf function */ -int alt_log_printf_proc(const char *fmt, ... ) -{ - va_list args; - - va_start (args, fmt); - alt_log_private_printf(fmt,ALT_LOG_PORT_BASE,args); - return (0); -} - -/* Below are the functions called by different macros in various components. */ - -/* If the system has a JTAG_UART, include JTAG_UART debugging functions */ -#ifdef __ALTERA_AVALON_JTAG_UART - -/* The alarm function in altera_avalon_jtag_uart.c. - * This function, when turned on, prints out the status - * of the JTAG UART Control register, every ALT_LOG_JTAG_UART_TICKS. - * If the flag is off, the alarm should never be registered, and this - * function should never run */ -alt_u32 altera_avalon_jtag_uart_report_log(void * context) -{ - if (alt_log_jtag_uart_alarm_on_flag) { - altera_avalon_jtag_uart_state* dev = (altera_avalon_jtag_uart_state*) context; - const char* header="JTAG Alarm:"; - alt_log_jtag_uart_print_control_reg(dev, dev->base, header); - return ALT_LOG_JTAG_UART_TICKS; - } - else - { - /* If flag is not on, return 0 to disable future alarms. - * Should never be here, alarm should not be enabled at all. */ - return 0; - } -} - -void alt_log_jtag_uart_print_control_reg(altera_avalon_jtag_uart_state* dev, int base, const char* header) -{ - unsigned int control, space, ac, wi, ri, we, re; - control = IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base); - space = (control & ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_MSK) >> - ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_OFST; - we= (control & ALTERA_AVALON_JTAG_UART_CONTROL_WE_MSK) >> - ALTERA_AVALON_JTAG_UART_CONTROL_WE_OFST; - re= (control & ALTERA_AVALON_JTAG_UART_CONTROL_RE_MSK) >> - ALTERA_AVALON_JTAG_UART_CONTROL_RE_OFST; - ri= (control & ALTERA_AVALON_JTAG_UART_CONTROL_RI_MSK) >> - ALTERA_AVALON_JTAG_UART_CONTROL_RI_OFST; - wi= (control & ALTERA_AVALON_JTAG_UART_CONTROL_WI_MSK) >> - ALTERA_AVALON_JTAG_UART_CONTROL_WI_OFST; - ac= (control & ALTERA_AVALON_JTAG_UART_CONTROL_AC_MSK) >> - ALTERA_AVALON_JTAG_UART_CONTROL_AC_OFST; - -#ifdef ALTERA_AVALON_JTAG_UART_SMALL - ALT_LOG_PRINTF( - "%s HW FIFO wspace=%d AC=%d WI=%d RI=%d WE=%d RE=%d\r\n", - header,space,ac,wi,ri,we,re); -#else - ALT_LOG_PRINTF( - "%s SW CirBuf = %d, HW FIFO wspace=%d AC=%d WI=%d RI=%d WE=%d RE=%d\r\n", - header,(dev->tx_out-dev->tx_in),space,ac,wi,ri,we,re); -#endif - - return; - -} - -/* In altera_avalon_jtag_uart.c - * Same output as the alarm function above, but this is called in the driver - * init function. Hence, it gives the status of the JTAG UART control register - * right at the initialization of the driver */ -void alt_log_jtag_uart_startup_info(altera_avalon_jtag_uart_state* dev, int base) -{ - const char* header="JTAG Startup Info:"; - alt_log_jtag_uart_print_control_reg(dev, base, header); - return; -} - -/* In altera_avalon_jtag_uart.c - * When turned on, this function will print out the status of the jtag uart - * control register every time there is a jtag uart "almost-empty" interrupt. */ -void alt_log_jtag_uart_isr_proc(int base, altera_avalon_jtag_uart_state* dev) -{ - if (alt_log_jtag_uart_isr_on_flag) { - const char* header="JTAG IRQ:"; - alt_log_jtag_uart_print_control_reg(dev, base, header); - } - return; -} - -#endif /* __ALTERA_AVALON_JTAG_UART */ - -/* In alt_write.c - * When the alt_log_write_on_flag is turned on, this function gets called - * every time alt_write gets called. The first - * ALT_LOG_WRITE_ECHO_LEN characters of every printf command (or any command - * that eventually calls write()) gets echoed to the alt_log output. */ -void alt_log_write(const void *ptr, size_t len) -{ - if (alt_log_write_on_flag) { - int temp_cnt; - int length=(ALT_LOG_WRITE_ECHO_LEN>len) ? len : ALT_LOG_WRITE_ECHO_LEN; - - if (length < 2) return; - - strncpy (alt_log_write_buf,ptr,length); - alt_log_write_buf[length-1]='\n'; - alt_log_write_buf[length]='\r'; - alt_log_write_buf[length+1]='\0'; - - /* Escape Ctrl-D's. If the Ctrl-D gets sent it might kill the terminal - * connection of alt_log. It will get replaced by 'D'. */ - for (temp_cnt=0;temp_cnt < length; temp_cnt++) { - if (alt_log_write_buf[temp_cnt]== 0x4) { - alt_log_write_buf[temp_cnt]='D'; - } - } - ALT_LOG_PRINTF("Write Echo: %s",alt_log_write_buf); - } -} - -/* In altera_avalon_timer_sc - * This function prints out a system clock is alive message - * every ALT_LOG_SYS_CLK_INTERVAL (in ticks). */ -void alt_log_system_clock() -{ - if (alt_log_sys_clk_on_flag) { - alt_log_sys_clk_count++; - if (alt_log_sys_clk_count > ALT_LOG_SYS_CLK_INTERVAL) { - alt_log_sys_clk_count = 0; - ALT_LOG_PRINTF("System Clock On %u\r\n",alt_system_clock_in_sec++); - } - } -} - - -#endif diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_lseek.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_lseek.c deleted file mode 100644 index 7857b0d..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_lseek.c +++ /dev/null @@ -1,117 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -#ifdef ALT_USE_DIRECT_DRIVERS - -off_t ALT_LSEEK (int file, off_t ptr, int dir) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(lseek); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -/* - * lseek() can be called to move the read/write pointer associated with the - * file descriptor "file". This function simply vectors the call to the lseek() - * function provided by the driver associated with the file descriptor. - * - * If the driver does not provide an implementation of lseek() an error is - * indicated. - * - * lseek() corresponds to the standard lseek() function. - * - * ALT_LSEEK is mapped onto the lseek() system call in alt_syscall.h - * - */ - -off_t ALT_LSEEK (int file, off_t ptr, int dir) -{ - alt_fd* fd; - off_t rc = 0; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - /* - * If the device driver provides an implementation of the lseek() function, - * then call that to process the request. - */ - - if (fd->dev->lseek) - { - rc = fd->dev->lseek(fd, ptr, dir); - } - /* - * Otherwise return an error. - */ - - else - { - rc = -ENOTSUP; - } - } - else - { - rc = -EBADFD; - } - - if (rc < 0) - { - ALT_ERRNO = -rc; - rc = -1; - } - - return rc; -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_main.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_main.c deleted file mode 100644 index a96229b..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_main.c +++ /dev/null @@ -1,161 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include -#include -#include -#include - -#include "sys/alt_dev.h" -#include "sys/alt_sys_init.h" -#include "sys/alt_irq.h" -#include "sys/alt_dev.h" - -#include "os/alt_hooks.h" - -#include "priv/alt_file.h" -#include "alt_types.h" - -#include "system.h" - -#include "sys/alt_log_printf.h" - -extern void _do_ctors(void); -extern void _do_dtors(void); - -/* - * Standard arguments for main. By default, no arguments are passed to main. - * However a device driver may choose to configure these arguments by calling - * alt_set_args(). The expectation is that this facility will only be used by - * the iclient/ihost utility. - */ - -int alt_argc = 0; -char** alt_argv = {NULL}; -char** alt_envp = {NULL}; - -/* - * Prototype for the entry point to the users application. - */ - -extern int main (int, char **, char **); - -/* - * alt_main is the C entry point for the HAL. It is called by the assembler - * startup code in the processor specific crt0.S. It is responsible for: - * completing the C runtime configuration; configuring all the - * devices/filesystems/components in the system; and call the entry point for - * the users application, i.e. main(). - */ - -void alt_main (void) -{ -#ifndef ALT_NO_EXIT - int result; -#endif - - /* ALT LOG - please see HAL/sys/alt_log_printf.h for details */ - ALT_LOG_PRINT_BOOT("[alt_main.c] Entering alt_main, calling alt_irq_init.\r\n"); - /* Initialize the interrupt controller. */ - alt_irq_init (NULL); - - /* Initialize the operating system */ - ALT_LOG_PRINT_BOOT("[alt_main.c] Done alt_irq_init, calling alt_os_init.\r\n"); - ALT_OS_INIT(); - - /* - * Initialize the semaphore used to control access to the file descriptor - * list. - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Done OS Init, calling alt_sem_create.\r\n"); - ALT_SEM_CREATE (&alt_fd_list_lock, 1); - - /* Initialize the device drivers/software components. */ - ALT_LOG_PRINT_BOOT("[alt_main.c] Calling alt_sys_init.\r\n"); - alt_sys_init(); - ALT_LOG_PRINT_BOOT("[alt_main.c] Done alt_sys_init.\r\n"); - -#if !defined(ALT_USE_DIRECT_DRIVERS) && (defined(ALT_STDIN_PRESENT) || defined(ALT_STDOUT_PRESENT) || defined(ALT_STDERR_PRESENT)) - - /* - * Redirect stdio to the apropriate devices now that the devices have - * been initialized. This is only done if the user has requested these - * devices be present (not equal to /dev/null) and if direct drivers - * aren't being used. - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Redirecting IO.\r\n"); - alt_io_redirect(ALT_STDOUT, ALT_STDIN, ALT_STDERR); -#endif - -#ifndef ALT_NO_C_PLUS_PLUS - /* - * Call the C++ constructors - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Calling C++ constructors.\r\n"); - _do_ctors (); -#endif /* ALT_NO_C_PLUS_PLUS */ - -#if !defined(ALT_NO_C_PLUS_PLUS) && !defined(ALT_NO_CLEAN_EXIT) && !defined(ALT_NO_EXIT) - /* - * Set the C++ destructors to be called at system shutdown. This is only done - * if a clean exit has been requested (i.e. the exit() function has not been - * redefined as _exit()). This is in the interest of reducing code footprint, - * in that the atexit() overhead is removed when it's not needed. - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Calling atexit.\r\n"); - atexit (_do_dtors); -#endif - - /* - * Finally, call main(). The return code is then passed to a subsequent - * call to exit() unless the application is never supposed to exit. - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Calling main.\r\n"); - -#ifdef ALT_NO_EXIT - main (alt_argc, alt_argv, alt_envp); -#else - result = main (alt_argc, alt_argv, alt_envp); - close(STDOUT_FILENO); - exit (result); -#endif - - ALT_LOG_PRINT_BOOT("[alt_main.c] After main - we should not be here?.\r\n"); -} - diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_malloc_lock.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_malloc_lock.c deleted file mode 100644 index 8c78f46..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_malloc_lock.c +++ /dev/null @@ -1,52 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -/* - * These are the empty malloc lock/unlock stubs required by newlib. These are - * used to make newlib's malloc() function thread safe. The default HAL - * configuration is single threaded, so there is nothing to do here. Note that - * this requires that malloc is never called by an interrupt service routine. - */ - -void __malloc_lock ( struct _reent *_r ) -{ -} - -/* - * - */ - -void __malloc_unlock ( struct _reent *_r ) -{ -} diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_mcount.S b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_mcount.S deleted file mode 100644 index 3837523..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_mcount.S +++ /dev/null @@ -1,198 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2010 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* mcount or _mcount is inserted by GCC before the function prologue of every - * function when a program is compiled for profiling. At the start of mcount, - * we guarantee that: - * ra = self_pc (an address in the function which called mcount) - * r8 = from_pc (an address in the function which called mcount's caller) - * - * Because this is always called at the start of a function we can corrupt - * r2,r3 and r11-r15. We must not corrupt r4-r7 (because they might contain - * function arguments for the instrumented function) or r8 (which holds ra - * for the instrumented function). - */ - - .global __mcount_fn_head - - .global mcount - - /* _mcount is used by gcc4 */ - .global _mcount - -_mcount: -mcount: - /* Use a hash to speed up locating fn_entry. We use bits 5 upwards to choose - * the bucket because bits 1:0 will always be 0, and because the distribution - * of values for bits 4:2 won't be even (aligning on cache line boundaries - * will skew it). Higher bits should be fairly random. - */ - /* fn_head = mcount_fn_head + (((unsigned int)self_pc >> 5) & (HASH_BUCKETS - 1)); */ - - srli r2, ra, 3 - movhi r3, %hiadj(__mcount_fn_head) - addi r3, r3, %lo(__mcount_fn_head) - andi r2, r2, 0xFC - add r11, r2, r3 - - /* The fast case is where we have already allocated a function arc, and so - * also a function pointer. - */ - - /* First find the function being called (using self_pc) */ - mov r10, r11 -0: - ldw r10, 0(r10) - beq r10, zero, .Lnew_arc - ldw r2, 4(r10) - bne r2, ra, 0b - - /* Found a function entry for this PC. Now look for an arc with a matching - * from_pc value. There will always be at least one arc. */ - ldw r3, 8(r10) -0: - ldw r2, 4(r3) - beq r2, r8, .Lfound_arc - ldw r3, 0(r3) - bne r3, zero, 0b - -.Lnew_arc: - addi sp, sp, -24 - -.LCFI0: - stw ra, 0(sp) - stw r4, 4(sp) - stw r5, 8(sp) - stw r6, 12(sp) - stw r7, 16(sp) - stw r8, 20(sp) - -.LCFI1: - /* __mcount_record(orig_ra, orig_r8, fn_entry, *fn_head); */ - mov r4, ra - mov r5, r8 - mov r6, r10 - mov r7, r11 - call __mcount_record - - /* restore registers from the stack */ - ldw ra, 0(sp) - ldw r4, 4(sp) - ldw r5, 8(sp) - ldw r6, 12(sp) - ldw r7, 16(sp) - ldw r8, 20(sp) - - addi sp, sp, 24 - -.LCFI2: - ret - -.Lfound_arc: - /* We've found the correct arc record. Increment the count and return */ - ldw r2, 8(r3) - addi r2, r2, 1 - stw r2, 8(r3) - ret - -.Lmcount_end: - - - -/* - * Dwarf2 debug information for the function. This provides GDB with the - * information it needs to backtrace out of this function. - */ - - .section .debug_frame,"",@progbits -.LCIE: - .4byte 2f - 1f /* Length */ -1: - .4byte 0xffffffff /* CIE id */ - .byte 0x1 /* Version */ - .string "" /* Augmentation */ - .uleb128 0x1 /* Code alignment factor */ - .sleb128 -4 /* Data alignment factor */ - .byte 0x1f /* Return address register */ - - .byte 0xc /* Define CFA */ - .uleb128 0x1b /* Register 27 (sp) */ - .uleb128 0x0 /* Offset 0 */ - - .align 2 /* Padding */ -2: - -.LFDE_mcount: - .4byte 2f - 1f /* Length */ -1: - .4byte .LCIE /* Pointer to CIE */ - .4byte mcount /* Start of table entry */ - .4byte .Lmcount_end - mcount /* Size of table entry */ - - .byte 0x4 /* Advance location */ - .4byte .LCFI0 - mcount /* to .LCFI0 */ - .byte 0xe /* Define CFA offset */ - .uleb128 24 /* to 24 */ - - .byte 0x4 /* Advance location */ - .4byte .LCFI1 - .LCFI0 /* to .LCFI1 */ - .byte 0x9f /* Store ra */ - .uleb128 0x6 /* at CFA-24 */ - .byte 0x84 /* Store r4 */ - .uleb128 0x5 /* at CFA-20 */ - .byte 0x85 /* Store r5 */ - .uleb128 0x4 /* at CFA-16 */ - .byte 0x86 /* Store r6 */ - .uleb128 0x3 /* at CFA-12 */ - .byte 0x87 /* Store r7 */ - .uleb128 0x2 /* at CFA-8 */ - .byte 0x88 /* Store r8 */ - .uleb128 0x1 /* at CFA-4 */ - - .byte 0x4 /* Advance location */ - .4byte .LCFI2 - .LCFI1 /* to .LCFI2 */ - .byte 0xe /* Define CFA offset */ - .uleb128 0 /* to 0 */ - .byte 0x8 /* Same value */ - .uleb128 31 /* for ra */ - .byte 0x8 /* Same value */ - .uleb128 4 /* for r4 */ - .byte 0x8 /* Same value */ - .uleb128 5 /* for r5 */ - .byte 0x8 /* Same value */ - .uleb128 6 /* for r6 */ - .byte 0x8 /* Same value */ - .uleb128 7 /* for r7 */ - .byte 0x8 /* Same value */ - .uleb128 8 /* for r8 */ - - .align 2 -2: - diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_open.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_open.c deleted file mode 100644 index 4790f53..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_open.c +++ /dev/null @@ -1,173 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "alt_types.h" -#include "os/alt_syscall.h" - -#ifdef ALT_USE_DIRECT_DRIVERS - -int ALT_OPEN (const char* file, int flags, int mode) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(open); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -extern alt_llist alt_dev_list; - -/* - * alt_file_locked() is used by open() to ensure that a device has not been - * previously locked for exclusive access using ioctl(). This test is only - * performed for devices. Filesystems are required to handle the ioctl() call - * themselves, and report the error from the filesystems open() function. - */ - -static int alt_file_locked (alt_fd* fd) -{ - alt_u32 i; - - /* - * Mark the file descriptor as belonging to a device. - */ - - fd->fd_flags |= ALT_FD_DEV; - - /* - * Loop through all current file descriptors searching for one that's locked - * for exclusive access. If a match is found, generate an error. - */ - - for (i = 0; i <= alt_max_fd; i++) - { - if ((alt_fd_list[i].dev == fd->dev) && - (alt_fd_list[i].fd_flags & ALT_FD_EXCL) && - (&alt_fd_list[i] != fd)) - { - return -EACCES; - } - } - - /* The device is not locked */ - - return 0; -} - -/* - * open() is called in order to get a file descriptor that reference the file - * or device named "name". This descriptor can then be used to manipulate the - * file/device using the standard system calls, e.g. write(), read(), ioctl() - * etc. - * - * This is equivalent to the standard open() system call. - * - * ALT_OPEN is mapped onto the open() system call in alt_syscall.h - */ - -int ALT_OPEN (const char* file, int flags, int mode) -{ - alt_dev* dev; - alt_fd* fd; - int index = -1; - int status = -ENODEV; - int isafs = 0; - - /* - * Check the device list, to see if a device with a matching name is - * registered. - */ - - if (!(dev = alt_find_dev (file, &alt_dev_list))) - { - /* No matching device, so try the filesystem list */ - - dev = alt_find_file (file); - isafs = 1; - } - - /* - * If a matching device or filesystem is found, allocate a file descriptor. - */ - - if (dev) - { - if ((index = alt_get_fd (dev)) < 0) - { - status = index; - } - else - { - fd = &alt_fd_list[index]; - fd->fd_flags = (flags & ~ALT_FD_FLAGS_MASK); - - /* If this is a device, ensure it isn't already locked */ - - if (isafs || ((status = alt_file_locked (fd)) >= 0)) - { - /* - * If the device or filesystem provides an open() callback function, - * call it now to perform any device/filesystem specific operations. - */ - - status = (dev->open) ? dev->open(fd, file, flags, mode): 0; - } - } - } - else - { - status = -ENODEV; - } - - /* Allocation failed, so clean up and return an error */ - - if (status < 0) - { - alt_release_fd (index); - ALT_ERRNO = -status; - return -1; - } - - /* return the reference upon success */ - - return index; -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_printf.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_printf.c deleted file mode 100644 index e742b57..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_printf.c +++ /dev/null @@ -1,127 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/* - * This file provides a very minimal printf implementation for use with very - * small applications. Only the following format strings are supported: - * %x - * %s - * %c - * %% - */ - -#include -#include "sys/alt_stdio.h" - -/* - * ALT printf function - */ -void -alt_printf(const char* fmt, ... ) -{ - va_list args; - va_start(args, fmt); - const char *w; - char c; - - /* Process format string. */ - w = fmt; - while ((c = *w++) != 0) - { - /* If not a format escape character, just print */ - /* character. Otherwise, process format string. */ - if (c != '%') - { - alt_putchar(c); - } - else - { - /* Get format character. If none */ - /* available, processing is complete. */ - if ((c = *w++) != 0) - { - if (c == '%') - { - /* Process "%" escape sequence. */ - alt_putchar(c); - } - else if (c == 'c') - { - int v = va_arg(args, int); - alt_putchar(v); - } - else if (c == 'x') - { - /* Process hexadecimal number format. */ - unsigned long v = va_arg(args, unsigned long); - unsigned long digit; - int digit_shift; - - /* If the number value is zero, just print and continue. */ - if (v == 0) - { - alt_putchar('0'); - continue; - } - - /* Find first non-zero digit. */ - digit_shift = 28; - while (!(v & (0xF << digit_shift))) - digit_shift -= 4; - - /* Print digits. */ - for (; digit_shift >= 0; digit_shift -= 4) - { - digit = (v & (0xF << digit_shift)) >> digit_shift; - if (digit <= 9) - c = '0' + digit; - else - c = 'a' + digit - 10; - alt_putchar(c); - } - } - else if (c == 's') - { - /* Process string format. */ - char *s = va_arg(args, char *); - - while(*s) - alt_putchar(*s++); - } - } - else - { - break; - } - } - } -} diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_putchar.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_putchar.c deleted file mode 100644 index badaa02..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_putchar.c +++ /dev/null @@ -1,59 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#ifdef ALT_USE_DIRECT_DRIVERS -#include "system.h" -#include "sys/alt_driver.h" -#include "sys/alt_stdio.h" -#endif - -/* - * Uses the ALT_DRIVER_WRITE() macro to call directly to driver if available. - * Otherwise, uses newlib provided putchar() routine. - */ -int -alt_putchar(int c) -{ -#ifdef ALT_USE_DIRECT_DRIVERS - ALT_DRIVER_WRITE_EXTERNS(ALT_STDOUT_DEV); - char c1 = (char)(c & 0xff); - - if (ALT_DRIVER_WRITE(ALT_STDOUT_DEV, &c1, 1, 0) == -1) { - return -1; - } - return c; -#else - return putchar(c); -#endif -} diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_putstr.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_putstr.c deleted file mode 100644 index 5345945..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_putstr.c +++ /dev/null @@ -1,55 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#ifdef ALT_USE_DIRECT_DRIVERS -#include -#include "system.h" -#include "sys/alt_driver.h" -#include "sys/alt_stdio.h" -#endif - -/* - * Uses the ALT_DRIVER_WRITE() macro to call directly to driver if available. - * Otherwise, uses newlib provided fputs() routine. - */ -int -alt_putstr(const char* str) -{ -#ifdef ALT_USE_DIRECT_DRIVERS - ALT_DRIVER_WRITE_EXTERNS(ALT_STDOUT_DEV); - return ALT_DRIVER_WRITE(ALT_STDOUT_DEV, str, strlen(str), 0); -#else - return fputs(str, stdout); -#endif -} diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_read.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_read.c deleted file mode 100644 index 1c89777..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_read.c +++ /dev/null @@ -1,125 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -/* - * The read() system call is used to read a block of data from a file or device. - * This function simply vectors the request to the device driver associated - * with the input file descriptor "file". - * - * ALT_READ is mapped onto the read() system call in alt_syscall.h - */ - -#ifdef ALT_USE_DIRECT_DRIVERS - -#include "system.h" -#include "sys/alt_driver.h" - -/* - * Provide minimal version that just reads from the stdin device when provided. - */ - -int ALT_READ (int file, void *ptr, size_t len) -{ -#ifdef ALT_STDIN_PRESENT - ALT_DRIVER_READ_EXTERNS(ALT_STDIN_DEV); -#endif - -#if !defined(ALT_STDIN_PRESENT) - /* Generate a link time warning, should this function ever be called. */ - ALT_STUB_WARNING(read); -#endif - - switch (file) { -#ifdef ALT_STDIN_PRESENT - case 0: /* stdin file descriptor */ - return ALT_DRIVER_READ(ALT_STDIN_DEV, ptr, len, 0); -#endif /* ALT_STDIN_PRESENT */ - default: - ALT_ERRNO = EBADFD; - return -1; - } -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -int ALT_READ (int file, void *ptr, size_t len) -{ - alt_fd* fd; - int rval; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - /* - * If the file has not been opened with read access, or if the driver does - * not provide an implementation of read(), generate an error. Otherwise - * call the drivers read() function to process the request. - */ - - if (((fd->fd_flags & O_ACCMODE) != O_WRONLY) && - (fd->dev->read)) - { - if ((rval = fd->dev->read(fd, ptr, len)) < 0) - { - ALT_ERRNO = -rval; - return -1; - } - return rval; - } - else - { - ALT_ERRNO = EACCES; - } - } - else - { - ALT_ERRNO = EBADFD; - } - return -1; -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_release_fd.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_release_fd.c deleted file mode 100644 index 84733a7..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_release_fd.c +++ /dev/null @@ -1,54 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - -/* - * alt_release_fd() is called to free an allocated file descriptor. This is - * done by setting the device pointer in the file descriptor structure to zero. - * - * File descriptors correcponding to standard in, standard out and standard - * error cannont be released backed to the pool. They are always reserved. - */ - -void alt_release_fd (int fd) -{ - if (fd > 2) - { - alt_fd_list[fd].fd_flags = 0; - alt_fd_list[fd].dev = 0; - } -} - - - diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_remap_cached.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_remap_cached.c deleted file mode 100644 index f61cb9c..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_remap_cached.c +++ /dev/null @@ -1,50 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003,2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "sys/alt_cache.h" -#include "system.h" - -#ifdef NIOS2_MMU_PRESENT -/* Convert KERNEL region address to IO region address */ -#define BYPASS_DCACHE_MASK (0x1 << 29) -#else -/* Set bit 31 of address to bypass D-cache */ -#define BYPASS_DCACHE_MASK (0x1 << 31) -#endif - -/* - * Convert a pointer to a block of uncached memory, into a block of - * cached memory. - */ - -void* alt_remap_cached (volatile void* ptr, alt_u32 len) -{ - return (void*) (((alt_u32) ptr) & ~BYPASS_DCACHE_MASK); -} diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_remap_uncached.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_remap_uncached.c deleted file mode 100644 index 7ff6302..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_remap_uncached.c +++ /dev/null @@ -1,51 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003,2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "sys/alt_cache.h" -#include "system.h" - -#ifdef NIOS2_MMU_PRESENT -/* Convert KERNEL region address to IO region address */ -#define BYPASS_DCACHE_MASK (0x1 << 29) -#else -/* Set bit 31 of address to bypass D-cache */ -#define BYPASS_DCACHE_MASK (0x1 << 31) -#endif - -/* - * Convert a pointer to a block of cached memory, into a block of - * uncached memory. - */ - -volatile void* alt_remap_uncached (void* ptr, alt_u32 len) -{ - alt_dcache_flush (ptr, len); - return (volatile void*) (((alt_u32) ptr) | BYPASS_DCACHE_MASK); -} diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_rename.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_rename.c deleted file mode 100644 index 48afac0..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_rename.c +++ /dev/null @@ -1,55 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "os/alt_syscall.h" - -/* - * _rename() is used by newlib to rename an existing file. This is unsupported - * in the HAL environment. However a "do-nothing" implementation is still - * provied for newlib compatability. - * - * ALT_RENAME is mapped onto the _rename() system call in alt_syscall.h - */ - -int ALT_RENAME (char *existing, char *new) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(_rename); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_sbrk.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_sbrk.c deleted file mode 100644 index b8c3799..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_sbrk.c +++ /dev/null @@ -1,136 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "os/alt_syscall.h" - -#include "sys/alt_irq.h" -#include "sys/alt_stack.h" - -#include "system.h" - -/* - * sbrk() is called to dynamically extend the data segment for the application. - * Thie input argument "incr" is the size of the block to allocate. - * - * This simple implementation does not perform any bounds checking. Memory will - * be allocated, even if the request region colides with the stack or overflows - * the available physical memory. - * - * ALT_SBRK is mapped onto the sbrk() system call in alt_syscall.h - * - * This function is called by the profiling code to allocate memory so must be - * safe if called from an interrupt context. It must also not be instrumented - * because that would lead to an infinate loop. - */ - -extern char __alt_heap_start[]; /* set by linker */ -extern char __alt_heap_limit[]; /* set by linker */ - -static char *heap_end = __alt_heap_start; - -#if defined(ALT_EXCEPTION_STACK) && defined(ALT_STACK_CHECK) -char * alt_exception_old_stack_limit = NULL; -#endif - -caddr_t ALT_SBRK (int incr) __attribute__ ((no_instrument_function )); - -caddr_t ALT_SBRK (int incr) -{ - alt_irq_context context; - char *prev_heap_end; - - context = alt_irq_disable_all(); - - /* Always return data aligned on a word boundary */ - heap_end = (char *)(((unsigned int)heap_end + 3) & ~3); - -#ifdef ALT_MAX_HEAP_BYTES - /* - * User specified a maximum heap size. Return -1 if it would - * be exceeded by this sbrk call. - */ - if (((heap_end + incr) - __alt_heap_start) > ALT_MAX_HEAP_BYTES) { - alt_irq_enable_all(context); - return (caddr_t)-1; - } -#else - if ((heap_end + incr) > __alt_heap_limit) { - alt_irq_enable_all(context); - return (caddr_t)-1; - } -#endif - - prev_heap_end = heap_end; - heap_end += incr; - -#ifdef ALT_STACK_CHECK - /* - * If the stack and heap are contiguous then extending the heap reduces the - * space available for the stack. If we are still using the default stack - * then adjust the stack limit to note this, while checking for stack - * pointer overflow. - * If the stack limit isn't pointing at the top of the heap then the code - * is using a different stack so none of this needs to be done. - */ - - if (alt_stack_limit() == prev_heap_end) - { - if (alt_stack_pointer() <= heap_end) - alt_report_stack_overflow(); - - alt_set_stack_limit(heap_end); - } - -#ifdef ALT_EXCEPTION_STACK - /* - * If we are executing from the exception stack then compare against the - * stack we switched away from as well. The exception stack is a fixed - * size so doesn't need to be checked. - */ - - if (alt_exception_old_stack_limit == prev_heap_end) - { - if (alt_exception_old_stack_limit <= heap_end) - alt_report_stack_overflow(); - - alt_exception_old_stack_limit = heap_end; - } -#endif - -#endif - - alt_irq_enable_all(context); - - return (caddr_t) prev_heap_end; -} diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_settod.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_settod.c deleted file mode 100644 index 59db0f8..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_settod.c +++ /dev/null @@ -1,96 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include "sys/alt_errno.h" -#include "sys/alt_alarm.h" -#include "os/alt_syscall.h" - -/* - * "alt_timezone" and "alt_resettime" are the values of the the reset time and - * time zone set through the last call to settimeofday(). By default they are - * zero initialised. - */ - -extern struct timezone alt_timezone; -extern struct timeval alt_resettime; - -/* - * Macro defining the number of micoseconds in a second. - */ - -#define ALT_US (1000000) - - -/* - * settimeofday() can be called to calibrate the system clock, so that - * subsequent calls to gettimeofday() will return the elapsed "wall clock" - * time. - * - * This is done by updating the global structures "alt_resettime" and - * "alt_timezone" so that an immediate call to gettimeofday() would return - * the value specified by "t" and "tz". - * - * Warning: if this function is called concurrently with a call to - * gettimeofday(), the value returned by gettimeofday() will be unreliable. - * - * ALT_SETTIMEOFDAY is mapped onto the settimeofday() system call in - * alt_syscall.h - */ - -int ALT_SETTIMEOFDAY (const struct timeval *t, - const struct timezone *tz) -{ - alt_u32 nticks = alt_nticks (); - alt_u32 tick_rate = alt_ticks_per_second (); - - /* If there is a system clock available, update the current time */ - - if (tick_rate) - { - alt_resettime.tv_sec = t->tv_sec - nticks/tick_rate; - alt_resettime.tv_usec = t->tv_usec - - ((nticks*(ALT_US/tick_rate))%ALT_US); - - alt_timezone.tz_minuteswest = tz->tz_minuteswest; - alt_timezone.tz_dsttime = tz->tz_dsttime; - - return 0; - } - - /* There's no system clock available */ - - ALT_ERRNO = ENOSYS; - return -1; -} diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_software_exception.S b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_software_exception.S deleted file mode 100644 index 2142594..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_software_exception.S +++ /dev/null @@ -1,53 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - - /* - * This file provides the global symbol: software_exception. It is provided to - * support legacy code, and should not be used by new software. - * - * It is used by legacy code to invoke the software exception handler as - * defined by version 1.0 of the Nios II kit. It should only be used when you - * are providing your own interrupt entry point, i.e. you are not using - * alt_irq_entry. - */ - -#include "system.h" - - /* - * Pull in the exception handler. - */ - - .globl alt_exception - - .section .exceptions.entry.label, "xa" - - .globl software_exception - .type software_exception, @function -software_exception: diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_stat.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_stat.c deleted file mode 100644 index 44e207b..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_stat.c +++ /dev/null @@ -1,59 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include -#include - -#include "os/alt_syscall.h" - -/* - * The stat() function is similar to the fstat() function in that it is used to - * obtain status information about a file. Instead of using an open file - * descriptor (like fstat()), stat() takes the name of a file as an input - * argument. - * - * ALT_STAT is mapped onto the stat() system call in alt_syscall.h - */ - -int ALT_STAT (const char *file, struct stat *st) -{ - int fd; - int rc; - - fd = open (file, 0); - rc = fstat (fd, st); - close (fd); - - return rc; -} diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_tick.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_tick.c deleted file mode 100644 index c73488d..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_tick.c +++ /dev/null @@ -1,149 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_irq.h" -#include "sys/alt_alarm.h" -#include "os/alt_hooks.h" -#include "alt_types.h" - -/* - * "_alt_tick_rate" is used to store the value of the system clock frequency - * in ticks per second. It is initialised to zero, which corresponds to there - * being no system clock facility available. - */ - -alt_u32 _alt_tick_rate = 0; - -/* - * "_alt_nticks" is the number of system clock ticks that have elapsed since - * reset. - */ - -volatile alt_u32 _alt_nticks = 0; - -/* - * "alt_alarm_list" is the head of a linked list of registered alarms. This is - * initialised to be an empty list. - */ - -ALT_LLIST_HEAD(alt_alarm_list); - -/* - * alt_alarm_stop() is called to remove an alarm from the list of registered - * alarms. Alternatively an alarm can unregister itself by returning zero when - * the alarm executes. - */ - -void alt_alarm_stop (alt_alarm* alarm) -{ - alt_irq_context irq_context; - - irq_context = alt_irq_disable_all(); - alt_llist_remove (&alarm->llist); - alt_irq_enable_all (irq_context); -} - -/* - * alt_tick() is periodically called by the system clock driver in order to - * process the registered list of alarms. Each alarm is registed with a - * callback interval, and a callback function, "callback". - * - * The return value of the callback function indicates how many ticks are to - * elapse until the next callback. A return value of zero indicates that the - * alarm should be deactivated. - * - * alt_tick() is expected to run at interrupt level. - */ - -void alt_tick (void) -{ - alt_alarm* next; - alt_alarm* alarm = (alt_alarm*) alt_alarm_list.next; - - alt_u32 next_callback; - - /* update the tick counter */ - - _alt_nticks++; - - /* process the registered callbacks */ - - while (alarm != (alt_alarm*) &alt_alarm_list) - { - next = (alt_alarm*) alarm->llist.next; - - /* - * Upon the tick-counter rolling over it is safe to clear the - * roll-over flag; once the flag is cleared this (or subsequnt) - * tick events are enabled to generate an alarm event. - */ - if ((alarm->rollover) && (_alt_nticks == 0)) - { - alarm->rollover = 0; - } - - /* if the alarm period has expired, make the callback */ - if ((alarm->time <= _alt_nticks) && (alarm->rollover == 0)) - { - next_callback = alarm->callback (alarm->context); - - /* deactivate the alarm if the return value is zero */ - - if (next_callback == 0) - { - alt_alarm_stop (alarm); - } - else - { - alarm->time += next_callback; - - /* - * If the desired alarm time causes a roll-over, set the rollover - * flag. This will prevent the subsequent tick event from causing - * an alarm too early. - */ - if(alarm->time < _alt_nticks) - { - alarm->rollover = 1; - } - } - } - alarm = next; - } - - /* - * Update the operating system specific timer facilities. - */ - - ALT_OS_TIME_TICK(); -} - diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_times.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_times.c deleted file mode 100644 index 4dd965d..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_times.c +++ /dev/null @@ -1,71 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "sys/alt_errno.h" -#include "sys/alt_alarm.h" -#include "os/alt_syscall.h" - -/* - * The times() function is used by newlib to obtain elapsed time information. - * The return value is the elapsed time since reset in system clock ticks. Note - * that this is distinct from the strict Posix version of times(), which should - * return the time since: 0 hours, 0 minutes, 0 seconds, January 1, 1970, GMT. - * - * The input structure is filled in with time accounting information. This - * implementation attributes all cpu time to the system. - * - * ALT_TIMES is mapped onto the times() system call in alt_syscall.h - */ - -clock_t ALT_TIMES (struct tms *buf) -{ - clock_t ticks = alt_nticks(); - - /* If there is no system clock present, generate an error */ - - if (!alt_ticks_per_second()) - { - ALT_ERRNO = ENOSYS; - return 0; - } - - /* Otherwise return the elapsed time */ - - buf->tms_utime = 0; - buf->tms_stime = ticks; - buf->tms_cutime = 0; - buf->tms_cstime = 0; - - return ticks; -} diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_uncached_free.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_uncached_free.c deleted file mode 100644 index 6e362ba..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_uncached_free.c +++ /dev/null @@ -1,49 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003,2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "sys/alt_cache.h" -#include "system.h" - -#ifdef NIOS2_MMU_PRESENT -/* Convert KERNEL region address to IO region address */ -#define BYPASS_DCACHE_MASK (0x1 << 29) -#else -/* Set bit 31 of address to bypass D-cache */ -#define BYPASS_DCACHE_MASK (0x1 << 31) -#endif - -/* - * Free a block of uncached memory. - */ - -void alt_uncached_free (volatile void* ptr) -{ - free ((void*) (((alt_u32) ptr) & ~BYPASS_DCACHE_MASK)); -} diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_uncached_malloc.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_uncached_malloc.c deleted file mode 100644 index ab3416d..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_uncached_malloc.c +++ /dev/null @@ -1,55 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003,2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "sys/alt_cache.h" -#include "system.h" - -#ifdef NIOS2_MMU_PRESENT -/* Convert KERNEL region address to IO region address */ -#define BYPASS_DCACHE_MASK (0x1 << 29) -#else -/* Set bit 31 of address to bypass D-cache */ -#define BYPASS_DCACHE_MASK (0x1 << 31) -#endif - -/* - * Allocate a block of uncached memory. - */ - -volatile void* alt_uncached_malloc (size_t size) -{ - void* ptr; - - ptr = malloc (size); - - alt_dcache_flush (ptr, size); - - return ptr ? (volatile void*) (((alt_u32) ptr) | BYPASS_DCACHE_MASK) : NULL; -} diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_unlink.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_unlink.c deleted file mode 100644 index 29e35d6..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_unlink.c +++ /dev/null @@ -1,55 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "os/alt_syscall.h" - -/* - * unlink() is used by newlib to delete an existing link to a file. This is - * unsupported in the HAL environment. However a "do-nothing" implementation - * is still provied for newlib compatability. - * - * ALT_UNLINK is mapped onto the unlink() system call in alt_syscall.h - */ - -int ALT_UNLINK (char *name) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(unlink); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_usleep.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_usleep.c deleted file mode 100644 index 2330eb8..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_usleep.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2003 Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - * - * ------------ - * - * Altera does not recommend, suggest or require that this reference design - * file be used in conjunction or combination with any other product. - * - * usleep.c - Microsecond delay routine - */ - -#include - -#include "priv/alt_busy_sleep.h" -#include "os/alt_syscall.h" - -/* - * This function simply calls alt_busy_sleep() to perform the delay. This - * function implements the delay as a calibrated "busy loop". - * - * ALT_USLEEP is mapped onto the usleep() system call in alt_syscall.h - */ - - - -#if defined (__GNUC__) && __GNUC__ >= 4 -int ALT_USLEEP (useconds_t us) -#else -unsigned int ALT_USLEEP (unsigned int us) -#endif -{ - return alt_busy_sleep(us); -} diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_wait.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_wait.c deleted file mode 100644 index a42f80f..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_wait.c +++ /dev/null @@ -1,52 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_errno.h" -#include "os/alt_syscall.h" - -/* - * wait() is used by newlib to wait for all child processes to exit. Since the - * HAL does not support spawning child processes, this returns immediately as - * there can't be anythign to wait for. - * - * ALT_WAIT is mapped onto the wait() system call in alt_syscall.h - */ - -int ALT_WAIT (int *status) -{ - *status = 0; - - ALT_ERRNO = ECHILD; - - return -1; -} - diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_write.c b/software/qsys_tutorial_hexs_bsp/HAL/src/alt_write.c deleted file mode 100644 index 51debb5..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/alt_write.c +++ /dev/null @@ -1,138 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -#include "sys/alt_log_printf.h" - -/* - * The write() system call is used to write a block of data to a file or - * device. This function simply vectors the request to the device driver - * associated with the input file descriptor "file". - * - * ALT_WRITE is mapped onto the write() system call in alt_syscall.h - */ - -#ifdef ALT_USE_DIRECT_DRIVERS - -#include "system.h" -#include "sys/alt_driver.h" - -/* - * Provide minimal version that just writes to the stdout/stderr devices - * when provided. - */ - -int ALT_WRITE (int file, const void *ptr, size_t len) -{ -#ifdef ALT_STDOUT_PRESENT - ALT_DRIVER_WRITE_EXTERNS(ALT_STDOUT_DEV); -#endif -#ifdef ALT_STDERR_PRESENT - ALT_DRIVER_WRITE_EXTERNS(ALT_STDERR_DEV); -#endif - -#if !defined(ALT_STDOUT_PRESENT) && !defined(ALT_STDERR_PRESENT) - /* Generate a link time warning, should this function ever be called. */ - ALT_STUB_WARNING(write); -#endif - - switch (file) { -#ifdef ALT_STDOUT_PRESENT - case 1: /* stdout file descriptor */ - return ALT_DRIVER_WRITE(ALT_STDOUT_DEV, ptr, len, 0); -#endif /* ALT_STDOUT_PRESENT */ -#ifdef ALT_STDERR_PRESENT - case 2: /* stderr file descriptor */ - return ALT_DRIVER_WRITE(ALT_STDERR_DEV, ptr, len, 0); -#endif /* ALT_STDERR_PRESENT */ - default: - ALT_ERRNO = EBADFD; - return -1; - } -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -int ALT_WRITE (int file, const void *ptr, size_t len) -{ - alt_fd* fd; - int rval; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - /* - * If the file has not been opened with write access, or if the driver does - * not provide an implementation of write(), generate an error. Otherwise - * call the drivers write() function to process the request. - */ - - if (((fd->fd_flags & O_ACCMODE) != O_RDONLY) && fd->dev->write) - { - - /* ALT_LOG - see altera_hal/HAL/inc/sys/alt_log_printf.h */ - ALT_LOG_WRITE_FUNCTION(ptr,len); - - if ((rval = fd->dev->write(fd, ptr, len)) < 0) - { - ALT_ERRNO = -rval; - return -1; - } - return rval; - } - else - { - ALT_ERRNO = EACCES; - } - } - else - { - ALT_ERRNO = EBADFD; - } - return -1; -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/altera_nios2_qsys_irq.c b/software/qsys_tutorial_hexs_bsp/HAL/src/altera_nios2_qsys_irq.c deleted file mode 100644 index c7a4f93..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/altera_nios2_qsys_irq.c +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2009 Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - * - * altera_nios2_irq.c - Support for Nios II internal interrupt controller. - * - */ - -#include "sys/alt_irq.h" -#include "altera_nios2_qsys_irq.h" - -/* - * To initialize the internal interrupt controller, just clear the IENABLE - * register so that all possible IRQs are disabled. - */ -void altera_nios2_qsys_irq_init(void) -{ - NIOS2_WRITE_IENABLE(0); -} diff --git a/software/qsys_tutorial_hexs_bsp/HAL/src/crt0.S b/software/qsys_tutorial_hexs_bsp/HAL/src/crt0.S deleted file mode 100644 index 582445d..0000000 --- a/software/qsys_tutorial_hexs_bsp/HAL/src/crt0.S +++ /dev/null @@ -1,456 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "system.h" -#include "nios2.h" - -/* Setup header files to work with assembler code. */ -#define ALT_ASM_SRC - -/* Debug logging facility */ -#include "sys/alt_log_printf.h" - -/*************************************************************************\ -| MACROS | -\*************************************************************************/ - -/* - * The new build tools explicitly define macros when alt_load() - * must be called. The define ALT_LOAD_EXPLICITLY_CONTROLLED tells us that - * those macros are controlling if alt_load() needs to be called. - */ -#ifdef ALT_LOAD_EXPLICITLY_CONTROLLED - -/* Need to call alt_load() if any of these sections are being copied. */ -#if defined(ALT_LOAD_COPY_RODATA) || defined(ALT_LOAD_COPY_RWDATA) || defined(ALT_LOAD_COPY_EXCEPTIONS) -#define CALL_ALT_LOAD -#endif - -#else /* !ALT_LOAD_EXPLICITLY_CONTROLLED */ - -/* - * The legacy build tools use the following macros to detect when alt_load() - * needs to be called. - */ - -#define __ALT_LOAD_SECTIONS(res, text, rodata, exc) \ - ((res##_BASE != rodata##_BASE) || \ - (res##_BASE != rwdata##_BASE) || \ - (res##_BASE != exc##_BASE)) - -#define _ALT_LOAD_SECTIONS(res, text, rodata, exc) \ - __ALT_LOAD_SECTIONS(res, text, rodata, exc) - -#define ALT_LOAD_SECTIONS _ALT_LOAD_SECTIONS(ALT_RESET_DEVICE, \ - ALT_RODATA_DEVICE, \ - ALT_RWDATA_DEVICE, \ - ALT_EXCEPTIONS_DEVICE) - -/* Call alt_load() if there is no bootloader and ALT_LOAD_SECTIONS isn't 0. */ -#if defined(ALT_NO_BOOTLOADER) && ALT_LOAD_SECTIONS -#define CALL_ALT_LOAD -#endif - -#endif /* !ALT_LOAD_EXPLICITLY_CONTROLLED */ - -/* - * When the legacy build tools define a macro called ALT_NO_BOOTLOADER, - * it indicates that initialization code is allowed at the reset address. - * The new build tools define a macro called ALT_ALLOW_CODE_AT_RESET for - * the same purpose. - */ -#ifdef ALT_NO_BOOTLOADER -#define ALT_ALLOW_CODE_AT_RESET -#endif - -/*************************************************************************\ -| EXTERNAL REFERENCES | -\*************************************************************************/ - -/* - * The entry point for user code is either "main" in hosted mode, or - * "alt_main" in standalone mode. These are explicitly referenced here, - * to ensure they are built into the executable. This allows the user - * to build them into libraries, rather than supplying them in object - * files at link time. - */ - .globl main - .globl alt_main - -/* - * Create a reference to the software multiply/divide and trap handers, - * so that if they are provided, they will appear in the executable. - */ -#ifndef ALT_NO_INSTRUCTION_EMULATION - .globl alt_exception_muldiv -#endif -#ifdef ALT_TRAP_HANDLER - .globl alt_exception_trap -#endif - -/* - * Linker defined symbols used to initialize bss. - */ -.globl __bss_start -.globl __bss_end - -/*************************************************************************\ -| RESET SECTION (.entry) | -\*************************************************************************/ - -/* - * This is the reset entry point for Nios II. - * - * At reset, only the cache line which contain the reset vector is - * initialized by the hardware. The code within the first cache line - * initializes the remainder of the instruction cache. - */ - - .section .entry, "xa" - .align 5 - -/* - * Explicitly allow the use of r1 (the assembler temporary register) - * within this code. This register is normally reserved for the use of - * the assembler. - */ - .set noat - -/* - * Some tools want to know where the reset vector is. - * Code isn't always provided at the reset vector but at least the - * __reset label always contains the reset vector address because - * it is defined at the start of the .entry section. - */ - - .globl __reset - .type __reset, @function -__reset: - -/* - * Initialize the instruction cache if present (i.e. size > 0) and - * reset code is allowed unless optimizing for RTL simulation. - * RTL simulations can ensure the instruction cache is already initialized - * so skipping this loop speeds up RTL simulation. - */ - -#if NIOS2_ICACHE_SIZE > 0 && defined(ALT_ALLOW_CODE_AT_RESET) && !defined(ALT_SIM_OPTIMIZE) - /* Assume the instruction cache size is always a power of two. */ -#if NIOS2_ICACHE_SIZE > 0x8000 - movhi r2, %hi(NIOS2_ICACHE_SIZE) -#else - movui r2, NIOS2_ICACHE_SIZE -#endif - -0: - initi r2 - addi r2, r2, -NIOS2_ICACHE_LINE_SIZE - bgt r2, zero, 0b -1: - - /* - * The following debug information tells the ISS not to run the loop above - * but to perform its actions using faster internal code. - */ - .pushsection .debug_alt_sim_info - .int 1, 1, 0b, 1b - .popsection -#endif /* Initialize Instruction Cache */ - -/* - * Jump to the _start entry point in the .text section if reset code - * is allowed or if optimizing for RTL simulation. - */ -#if defined(ALT_ALLOW_CODE_AT_RESET) || defined(ALT_SIM_OPTIMIZE) - /* Jump to the _start entry point in the .text section. */ - movhi r1, %hi(_start) - ori r1, r1, %lo(_start) - jmp r1 - - .size __reset, . - __reset -#endif /* Jump to _start */ - -/* - * When not using exit, provide an _exit symbol to prevent unresolved - * references to _exit from the linker script. - */ -#ifdef ALT_NO_EXIT - .globl _exit -_exit: -#endif - -/*************************************************************************\ -| TEXT SECTION (.text) | -\*************************************************************************/ - -/* - * Start of the .text section, and also the code entry point when - * the code is executed by a bootloader rather than directly from reset. - */ - .section .text - .align 2 - - .globl _start - .type _start, @function -_start: - -/* - * Initialize the data cache if present (i.e. size > 0) and not - * optimizing for RTL simulation. - * RTL simulations can ensure the data cache is already initialized - * so skipping this loop speeds up RTL simulation. - */ - -#if NIOS2_DCACHE_SIZE > 0 && !defined(ALT_SIM_OPTIMIZE) - - /* Assume the data cache size is always a power of two. */ -#if NIOS2_DCACHE_SIZE > 0x8000 - movhi r2, %hi(NIOS2_DCACHE_SIZE) -#else - movui r2, NIOS2_DCACHE_SIZE -#endif - -0: - initd 0(r2) - addi r2, r2, -NIOS2_DCACHE_LINE_SIZE - bgt r2, zero, 0b -1: - - /* - * The following debug information tells the ISS not to run the loop above - * but to perform its actions using faster internal code. - */ - .pushsection .debug_alt_sim_info - .int 2, 1, 0b, 1b - .popsection - -#endif /* Initialize Data Cache */ - - /* Log that caches have been initialized. */ - ALT_LOG_PUTS(alt_log_msg_cache) - - /* Log that the stack pointer is about to be setup. */ - ALT_LOG_PUTS(alt_log_msg_stackpointer) - -#if (NIOS2_NUM_OF_SHADOW_REG_SETS == 0) - /* - * Now that the caches are initialized, set up the stack pointer. - * The value provided by the linker is assumed to be correctly aligned. - */ - movhi sp, %hi(__alt_stack_pointer) - ori sp, sp, %lo(__alt_stack_pointer) - - /* Set up the global pointer. */ - movhi gp, %hi(_gp) - ori gp, gp, %lo(_gp) - -#else /* NIOS2_NUM_OF_SHADOW_REG_SETS > 0 */ - - /* - * Set up the GP and SP in all shadow register sets. - */ - - /* - * Check current register set number, if CPU resets into a shadow register - * set, switch register set to 0 by writing zero to SSTATUS register and - * execute an ERET instruction that just jumps to the next PC address - * (use the NEXTPC instruction to get this). - */ - - rdctl r2, status - - /* Get the current register set number (STATUS.CRS). */ - andi r3, r2, NIOS2_STATUS_CRS_MSK - - /* Skip switch register set if STATUS.CRS is 0. */ - beq r3, zero, .Lskip_switch_reg_set - - .set nobreak - - /* Current register set is non-zero, set SSTATUS to 0. */ - mov sstatus, zero - - /* Get next pc and store in ea. */ - nextpc ea - - /* Point to instruction after eret. */ - addi ea, ea, 8 - - /* - * Execute ERET instruction that just jumps to the next PC address - */ - eret - -.Lskip_switch_reg_set: - mov r2, zero - - /* Reset STATUS register */ - wrctl status, r2 - - movui r3, NIOS2_NUM_OF_SHADOW_REG_SETS - - /* Set up the stack pointer in register set 0. */ - movhi sp, %hi(__alt_stack_pointer) - ori sp, sp, %lo(__alt_stack_pointer) - - /* Set up the global pointer in register set 0. */ - movhi gp, %hi(_gp) - ori gp, gp, %lo(_gp) - -.Lsetup_sp_and_gp_loop: - /* - * Setup GP and SP for shadow register set - * from NIOS2_NUM_OF_SHADOW_REG_SETS to 0 - */ - - /* Skip if number of register sets is 0. */ - beq r3, zero, .Lno_shadow_register_set - - - /* Add previous register set STATUS.PRS by 1 */ - movhi r4, 1 - add r2, r2, r4 - - /* Write STATUS */ - wrctl status, r2 - - /* Clear r0 in the shadow register set (not done by hardware) */ - wrprs r0, r0 - - /* Write the GP in previous register set */ - wrprs gp, gp - - /* Only write the SP in previous register set - * if using the seperate exception stack. For normal case (single stack), - * funnel code would read the SP from previous register set. - */ -#ifdef ALT_INTERRUPT_STACK - - movhi et, %hiadj(__alt_interrupt_stack_pointer) - addi et, et, %lo(__alt_interrupt_stack_pointer) - wrprs sp, et - -#endif /* ALT_INTERRUPT_STACK */ - - /* Decrease number of register set counter by 1 */ - addi r3, r3, -1 - - br .Lsetup_sp_and_gp_loop -.Lno_shadow_register_set: - -#endif /* NIOS2_NUM_OF_SHADOW_REG_SETS */ -/* - * Clear the BSS if not optimizing for RTL simulation. - * - * This uses the symbols: __bss_start and __bss_end, which are defined - * by the linker script. They mark the begining and the end of the bss - * region. The linker script guarantees that these values are word aligned. - */ -#ifndef ALT_SIM_OPTIMIZE - /* Log that the BSS is about to be cleared. */ - ALT_LOG_PUTS(alt_log_msg_bss) - - movhi r2, %hi(__bss_start) - ori r2, r2, %lo(__bss_start) - - movhi r3, %hi(__bss_end) - ori r3, r3, %lo(__bss_end) - - beq r2, r3, 1f - -0: - stw zero, (r2) - addi r2, r2, 4 - bltu r2, r3, 0b - -1: - - /* - * The following debug information tells the ISS not to run the loop above - * but to perform its actions using faster internal code. - */ - .pushsection .debug_alt_sim_info - .int 3, 1, 0b, 1b - .popsection -#endif /* ALT_SIM_OPTIMIZE */ - -/* - * The alt_load() facility is normally used when there is no bootloader. - * It copies some sections into RAM so it acts like a mini-bootloader. - */ -#ifdef CALL_ALT_LOAD - -#ifdef ALT_STACK_CHECK - /* - * If the user has selected stack checking then we need to set up a safe - * value in the stack limit register so that the relocation functions - * don't think the stack has overflowed (the contents of the rwdata - * section aren't defined until alt_load() has been called). - */ - mov et, zero -#endif - - call alt_load - -#endif /* CALL_ALT_LOAD */ - -#ifdef ALT_STACK_CHECK - /* - * Set up the stack limit (if required). The linker has set up the - * copy of the variable which is in memory. - */ - - ldw et, %gprel(alt_stack_limit_value)(gp) -#endif - - /* Log that alt_main is about to be called. */ - ALT_LOG_PUTS(alt_log_msg_alt_main) - - /* Call the C entry point. It should never return. */ - call alt_main - - /* Wait in infinite loop in case alt_main does return. */ -alt_after_alt_main: - br alt_after_alt_main - - .size _start, . - _start - -/* - * Add information about the stack base if stack overflow checking is enabled. - */ -#ifdef ALT_STACK_CHECK - .globl alt_stack_limit_value - .section .sdata,"aws",@progbits - .align 2 - .type alt_stack_limit_value, @object - .size alt_stack_limit_value, 4 -alt_stack_limit_value: - .long __alt_stack_limit -#endif diff --git a/software/qsys_tutorial_hexs_bsp/Makefile b/software/qsys_tutorial_hexs_bsp/Makefile deleted file mode 100644 index dcf3b22..0000000 --- a/software/qsys_tutorial_hexs_bsp/Makefile +++ /dev/null @@ -1,766 +0,0 @@ -#------------------------------------------------------------------------------ -# BSP MAKEFILE -# -# This makefile was automatically generated by the nios2-bsp-generate-files -# command. Its purpose is to build a custom Board Support Package (BSP) -# targeting a specific Nios II processor in an SOPC Builder-based design. -# -# To create an application or library Makefile which uses this BSP, try the -# nios2-app-generate-makefile or nios2-lib-generate-makefile commands. -#------------------------------------------------------------------------------ - -#------------------------------------------------------------------------------ -# TOOLS -#------------------------------------------------------------------------------ - -MKDIR := mkdir -p -ECHO := echo -SPACE := $(empty) $(empty) - -#------------------------------------------------------------------------------ -# The adjust-path macro -# -# If COMSPEC is defined, Make is launched from Windows through -# Cygwin. This adjust-path macro will call 'cygpath -u' on all -# paths to ensure they are readable by Make. -# -# If COMSPEC is not defined, Make is launched from *nix, and no adjustment -# is necessary -#------------------------------------------------------------------------------ - -ifndef COMSPEC -ifdef ComSpec -COMSPEC = $(ComSpec) -endif # ComSpec -endif # !COMSPEC - -ifdef COMSPEC - adjust-path = $(subst $(SPACE),\$(SPACE),$(shell cygpath -u "$1")) - adjust-path-mixed = $(subst $(SPACE),\$(SPACE),$(shell cygpath -m "$1")) -else - adjust-path = $(subst $(SPACE),\$(SPACE),$1) - adjust-path-mixed = $(subst $(SPACE),\$(SPACE),$1) -endif - -#------------------------------------------------------------------------------ -# DEFAULT TARGET -# -# The default target, "all", must appear before any other target in the -# Makefile. Note that extra prerequisites are added to the "all" rule later. -#------------------------------------------------------------------------------ -.PHONY: all -all: - @$(ECHO) [BSP build complete] - - -#------------------------------------------------------------------------------ -# PATHS & DIRECTORY NAMES -# -# Explicitly locate absolute path of the BSP root -#------------------------------------------------------------------------------ - -BSP_ROOT_DIR := . - -# Define absolute path to the root of the BSP. -ABS_BSP_ROOT := $(call adjust-path-mixed,$(shell pwd)) - -# Stash all BSP object files here -OBJ_DIR := ./obj - -NEWLIB_DIR = $(BSP_ROOT_DIR)/newlib - - -#------------------------------------------------------------------------------ -# MANAGED CONTENT -# -# All content between the lines "START MANAGED" and "END MANAGED" below is -# generated based on variables in the BSP settings file when the -# nios2-bsp-generate-files command is invoked. If you wish to persist any -# information pertaining to the build process, it is recomended that you -# utilize the BSP settings mechanism to do so. -# -# Note that most variable assignments in this section have a corresponding BSP -# setting that can be changed by using the nios2-bsp-create-settings or -# nios2-bsp-update-settings command before nios2-bsp-generate-files; if you -# want any variable set to a specific value when this Makefile is re-generated -# (to prevent hand-edits from being over-written), use the BSP settings -# facilities above. -#------------------------------------------------------------------------------ - -#START MANAGED - -# The following TYPE comment allows tools to identify the 'type' of target this -# makefile is associated with. -# TYPE: BSP_PRIVATE_MAKEFILE - -# This following VERSION comment indicates the version of the tool used to -# generate this makefile. A makefile variable is provided for VERSION as well. -# ACDS_VERSION: 13.0sp1 -ACDS_VERSION := 13.0sp1 - -# This following BUILD_NUMBER comment indicates the build number of the tool -# used to generate this makefile. -# BUILD_NUMBER: 232 - -SETTINGS_FILE := settings.bsp -SOPC_FILE := C:/Users/takayun/Documents/DE2-115/qsys_tutorial/nios_system.sopcinfo - -#------------------------------------------------------------------------------- -# TOOL & COMMAND DEFINITIONS -# -# The base command for each build operation are expressed here. Additional -# switches may be expressed here. They will run for all instances of the -# utility. -#------------------------------------------------------------------------------- - -# Archiver command. Creates library files. -AR = nios2-elf-ar - -# Assembler command. Note that CC is used for .S files. -AS = nios2-elf-gcc - -# Custom flags only passed to the archiver. This content of this variable is -# directly passed to the archiver rather than the more standard "ARFLAGS". The -# reason for this is that GNU Make assumes some default content in ARFLAGS. -# This setting defines the value of BSP_ARFLAGS in Makefile. -BSP_ARFLAGS = -src - -# Custom flags only passed to the assembler. This setting defines the value of -# BSP_ASFLAGS in Makefile. -BSP_ASFLAGS = -Wa,-gdwarf2 - -# C/C++ compiler debug level. '-g' provides the default set of debug symbols -# typically required to debug a typical application. Omitting '-g' removes -# debug symbols from the ELF. This setting defines the value of -# BSP_CFLAGS_DEBUG in Makefile. -BSP_CFLAGS_DEBUG = -g - -# C/C++ compiler optimization level. "-O0" = no optimization,"-O2" = "normal" -# optimization, etc. "-O0" is recommended for code that you want to debug since -# compiler optimization can remove variables and produce non-sequential -# execution of code while debugging. This setting defines the value of -# BSP_CFLAGS_OPTIMIZATION in Makefile. -BSP_CFLAGS_OPTIMIZATION = '-Os' - -# C/C++ compiler warning level. "-Wall" is commonly used.This setting defines -# the value of BSP_CFLAGS_WARNINGS in Makefile. -BSP_CFLAGS_WARNINGS = -Wall - -# C compiler command. -CC = nios2-elf-gcc -xc - -# C++ compiler command. -CXX = nios2-elf-gcc -xc++ - -# Command used to remove files during 'clean' target. -RM = rm -f - - -#------------------------------------------------------------------------------- -# BUILD PRE & POST PROCESS COMMANDS -# -# The following variables are treated as shell commands in the rule -# definitions for each file-type associated with the BSP build, as well as -# commands run at the beginning and end of the entire BSP build operation. -# Pre-process commands are executed before the relevant command (for example, -# a command defined in the "CC_PRE_PROCESS" variable executes before the C -# compiler for building .c files), while post-process commands are executed -# immediately afterwards. -# -# You can view each pre/post-process command in the "Build Rules: All & -# Clean", "Pattern Rules to Build Objects", and "Library Rules" sections of -# this Makefile. -#------------------------------------------------------------------------------- - - -#------------------------------------------------------------------------------- -# BSP SOURCE BUILD SETTINGS (FLAG GENERATION) -# -# Software build settings such as compiler optimization, debug level, warning -# flags, etc., may be defined in the following variables. The variables below -# are concatenated together in the 'Flags' section of this Makefile to form -# final variables of flags passed to the build tools. -# -# These settings are considered private to the BSP and apply to all library & -# driver files in it; they do NOT automatically propagate to, for example, the -# build settings for an application. -# # For additional detail and syntax requirements, please refer to GCC help -# (example: "nios2-elf-gcc --help --verbose"). -# -# Unless indicated otherwise, multiple entries in each variable should be -# space-separated. -#------------------------------------------------------------------------------- - -# Altera HAL alt_sys_init.c generated source file -GENERATED_C_FILES := $(ABS_BSP_ROOT)/alt_sys_init.c -GENERATED_C_LIB_SRCS += alt_sys_init.c - - -#------------------------------------------------------------------------------- -# BSP SOURCE FILE LISTING -# -# All source files that comprise the BSP are listed here, along with path -# information to each file expressed relative to the BSP root. The precise -# list and location of each file is derived from the driver, operating system, -# or software package source file declarations. -# -# Following specification of the source files for each component, driver, etc., -# each source file type (C, assembly, etc.) is concatenated together and used -# to construct a list of objects. Pattern rules to build each object are then -# used to build each file. -#------------------------------------------------------------------------------- - -# altera_avalon_jtag_uart_driver sources root -altera_avalon_jtag_uart_driver_SRCS_ROOT := drivers - -# altera_avalon_jtag_uart_driver sources -altera_avalon_jtag_uart_driver_C_LIB_SRCS := \ - $(altera_avalon_jtag_uart_driver_SRCS_ROOT)/src/altera_avalon_jtag_uart_init.c \ - $(altera_avalon_jtag_uart_driver_SRCS_ROOT)/src/altera_avalon_jtag_uart_read.c \ - $(altera_avalon_jtag_uart_driver_SRCS_ROOT)/src/altera_avalon_jtag_uart_write.c \ - $(altera_avalon_jtag_uart_driver_SRCS_ROOT)/src/altera_avalon_jtag_uart_ioctl.c \ - $(altera_avalon_jtag_uart_driver_SRCS_ROOT)/src/altera_avalon_jtag_uart_fd.c - -# altera_avalon_pio_driver sources root -altera_avalon_pio_driver_SRCS_ROOT := drivers - -# altera_avalon_pio_driver sources -# altera_nios2_qsys_hal_driver sources root -altera_nios2_qsys_hal_driver_SRCS_ROOT := HAL - -# altera_nios2_qsys_hal_driver sources -altera_nios2_qsys_hal_driver_C_LIB_SRCS := \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/altera_nios2_qsys_irq.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_usleep.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_busy_sleep.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_irq_vars.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_icache_flush.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_icache_flush_all.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_dcache_flush.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_dcache_flush_all.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_dcache_flush_no_writeback.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_instruction_exception_entry.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_irq_register.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_iic.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_remap_cached.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_remap_uncached.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_uncached_free.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_uncached_malloc.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_do_ctors.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_do_dtors.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_gmon.c - -altera_nios2_qsys_hal_driver_ASM_LIB_SRCS := \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_exception_entry.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_exception_trap.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_exception_muldiv.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_irq_entry.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_software_exception.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_mcount.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_log_macro.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/crt0.S - -# hal sources root -hal_SRCS_ROOT := HAL - -# hal sources -hal_C_LIB_SRCS := \ - $(hal_SRCS_ROOT)/src/alt_alarm_start.c \ - $(hal_SRCS_ROOT)/src/alt_close.c \ - $(hal_SRCS_ROOT)/src/alt_dev.c \ - $(hal_SRCS_ROOT)/src/alt_dev_llist_insert.c \ - $(hal_SRCS_ROOT)/src/alt_dma_rxchan_open.c \ - $(hal_SRCS_ROOT)/src/alt_dma_txchan_open.c \ - $(hal_SRCS_ROOT)/src/alt_environ.c \ - $(hal_SRCS_ROOT)/src/alt_env_lock.c \ - $(hal_SRCS_ROOT)/src/alt_errno.c \ - $(hal_SRCS_ROOT)/src/alt_execve.c \ - $(hal_SRCS_ROOT)/src/alt_exit.c \ - $(hal_SRCS_ROOT)/src/alt_fcntl.c \ - $(hal_SRCS_ROOT)/src/alt_fd_lock.c \ - $(hal_SRCS_ROOT)/src/alt_fd_unlock.c \ - $(hal_SRCS_ROOT)/src/alt_find_dev.c \ - $(hal_SRCS_ROOT)/src/alt_find_file.c \ - $(hal_SRCS_ROOT)/src/alt_flash_dev.c \ - $(hal_SRCS_ROOT)/src/alt_fork.c \ - $(hal_SRCS_ROOT)/src/alt_fs_reg.c \ - $(hal_SRCS_ROOT)/src/alt_fstat.c \ - $(hal_SRCS_ROOT)/src/alt_get_fd.c \ - $(hal_SRCS_ROOT)/src/alt_getchar.c \ - $(hal_SRCS_ROOT)/src/alt_getpid.c \ - $(hal_SRCS_ROOT)/src/alt_gettod.c \ - $(hal_SRCS_ROOT)/src/alt_iic_isr_register.c \ - $(hal_SRCS_ROOT)/src/alt_instruction_exception_register.c \ - $(hal_SRCS_ROOT)/src/alt_ioctl.c \ - $(hal_SRCS_ROOT)/src/alt_io_redirect.c \ - $(hal_SRCS_ROOT)/src/alt_irq_handler.c \ - $(hal_SRCS_ROOT)/src/alt_isatty.c \ - $(hal_SRCS_ROOT)/src/alt_kill.c \ - $(hal_SRCS_ROOT)/src/alt_link.c \ - $(hal_SRCS_ROOT)/src/alt_load.c \ - $(hal_SRCS_ROOT)/src/alt_log_printf.c \ - $(hal_SRCS_ROOT)/src/alt_lseek.c \ - $(hal_SRCS_ROOT)/src/alt_main.c \ - $(hal_SRCS_ROOT)/src/alt_malloc_lock.c \ - $(hal_SRCS_ROOT)/src/alt_open.c \ - $(hal_SRCS_ROOT)/src/alt_printf.c \ - $(hal_SRCS_ROOT)/src/alt_putchar.c \ - $(hal_SRCS_ROOT)/src/alt_putstr.c \ - $(hal_SRCS_ROOT)/src/alt_read.c \ - $(hal_SRCS_ROOT)/src/alt_release_fd.c \ - $(hal_SRCS_ROOT)/src/alt_rename.c \ - $(hal_SRCS_ROOT)/src/alt_sbrk.c \ - $(hal_SRCS_ROOT)/src/alt_settod.c \ - $(hal_SRCS_ROOT)/src/alt_stat.c \ - $(hal_SRCS_ROOT)/src/alt_tick.c \ - $(hal_SRCS_ROOT)/src/alt_times.c \ - $(hal_SRCS_ROOT)/src/alt_unlink.c \ - $(hal_SRCS_ROOT)/src/alt_wait.c \ - $(hal_SRCS_ROOT)/src/alt_write.c - - -# Assemble all component C source files -COMPONENT_C_LIB_SRCS += \ - $(altera_avalon_jtag_uart_driver_C_LIB_SRCS) \ - $(altera_nios2_qsys_hal_driver_C_LIB_SRCS) \ - $(hal_C_LIB_SRCS) - -# Assemble all component assembly source files -COMPONENT_ASM_LIB_SRCS += \ - $(altera_nios2_qsys_hal_driver_ASM_LIB_SRCS) - -# Assemble all component C++ source files -COMPONENT_CPP_LIB_SRCS += \ - -#END MANAGED - -#------------------------------------------------------------------------------ -# PUBLIC.MK -# -# The generated public.mk file contains BSP information that is shared with -# other external makefiles, such as a Nios II application makefile. System- -# dependent information such as hardware-specific compiler flags and -# simulation file generation are stored here. -# -# In addition, public.mk contains include paths that various software, -# such as a device driver, may need for the C compiler. These paths are -# written to public.mk with respect to the BSP root. In public.mk, each -# path is prefixed with a special variable, $(ALT_LIBRARY_ROOT_DIR). The -# purpose of this variable is to allow an external Makefile to append on -# path information to precisely locate paths expressed in public.mk -# Since this is the BSP Makefile, we set ALT_LIBRARY_ROOT_DIR to point right -# here ("."), at the BSP root. -# -# ALT_LIBRARY_ROOT_DIR must always be set before public.mk is included. -#------------------------------------------------------------------------------ -ALT_LIBRARY_ROOT_DIR := . -include public.mk - - -#------------------------------------------------------------------------------ -# FLAGS -# -# Include paths for BSP files are written into the public.mk file and must -# be added to the existing list of pre-processor flags. In addition, "hooks" -# for standard flags left intentionally empty (CFLAGS, CPPFLAGS, ASFLAGS, -# and CXXFLAGS) are provided for conveniently adding to the relevant flags -# on the command-line or via script that calls make. -#------------------------------------------------------------------------------ -# Assemble final list of compiler flags from generated content -BSP_CFLAGS += \ - $(BSP_CFLAGS_DEFINED_SYMBOLS) \ - $(BSP_CFLAGS_UNDEFINED_SYMBOLS) \ - $(BSP_CFLAGS_OPTIMIZATION) \ - $(BSP_CFLAGS_DEBUG) \ - $(BSP_CFLAGS_WARNINGS) \ - $(BSP_CFLAGS_USER_FLAGS) \ - $(ALT_CFLAGS) \ - $(CFLAGS) - -# Make ready the final list of include directories and other C pre-processor -# flags. Each include path is made ready by prefixing it with "-I". -BSP_CPPFLAGS += \ - $(addprefix -I, $(BSP_INC_DIRS)) \ - $(addprefix -I, $(ALT_INCLUDE_DIRS)) \ - $(ALT_CPPFLAGS) \ - $(CPPFLAGS) - -# Finish off assembler flags with any user-provided flags -BSP_ASFLAGS += $(ASFLAGS) - -# Finish off C++ flags with any user-provided flags -BSP_CXXFLAGS += $(CXXFLAGS) - -# And finally, the ordered list -C_SRCS += $(GENERATED_C_LIB_SRCS) \ - $(COMPONENT_C_LIB_SRCS) - -CXX_SRCS += $(GENERATED_CPP_LIB_SRCS) \ - $(COMPONENT_CPP_LIB_SRCS) - -ASM_SRCS += $(GENERATED_ASM_LIB_SRCS) \ - $(COMPONENT_ASM_LIB_SRCS) - - -#------------------------------------------------------------------------------ -# LIST OF GENERATED FILES -# -# A Nios II BSP relies on the generation of several source files used -# by both the BSP and any applications referencing the BSP. -#------------------------------------------------------------------------------ - - -GENERATED_H_FILES := $(ABS_BSP_ROOT)/system.h - -GENERATED_LINKER_SCRIPT := $(ABS_BSP_ROOT)/linker.x - -GENERATED_FILES += $(GENERATED_H_FILES) \ - $(GENERATED_LINKER_SCRIPT) - - -#------------------------------------------------------------------------------ -# SETUP TO BUILD OBJECTS -# -# List of object files which are to be built. This is constructed from the input -# list of C source files (C_SRCS), C++ source files (CXX_SRCS), and assembler -# source file (ASM_SRCS). The permitted file extensions are: -# -# .c .C - for C files -# .cxx .cc .cpp .CXX .CC .CPP - for C++ files -# .S .s - for assembly files -# -# Extended description: The list of objects is a sorted list (duplicates -# removed) of all possible objects, placed beneath the ./obj directory, -# including any path information stored in the "*_SRCS" variable. The -# "patsubst" commands are used to concatenate together multiple file suffix -# types for common files (i.e. c++ as .cxx, .cc, .cpp). -# -# File extensions are case-insensitive in build rules with the exception of -# assembly sources. Nios II assembly sources with the ".S" extension are first -# run through the C preprocessor. Sources with the ".s" extension are not. -#------------------------------------------------------------------------------ -OBJS = $(sort $(addprefix $(OBJ_DIR)/, \ - $(patsubst %.c, %.o, $(patsubst %.C, %.o, $(C_SRCS))) \ - $(patsubst %.cxx, %.o, $(patsubst %.CXX, %.o, \ - $(patsubst %.cc, %.o, $(patsubst %.CC, %.o, \ - $(patsubst %.cpp, %.o, $(patsubst %.CPP, %.o, \ - $(CXX_SRCS) )))))) \ - $(patsubst %.S, %.o, $(patsubst %.s, %.o, $(ASM_SRCS))) )) - -# List of dependancy files for each object file. -DEPS = $(OBJS:.o=.d) - - -# Rules to force your project to rebuild or relink -# .force_relink file will cause any application that depends on this project to relink -# .force_rebuild file will cause this project to rebuild object files -# .force_rebuild_all file will cause this project and any project that depends on this project to rebuild object files - -FORCE_RELINK_DEP := .force_relink -FORCE_REBUILD_DEP := .force_rebuild -FORCE_REBUILD_ALL_DEP := .force_rebuild_all -FORCE_REBUILD_DEP_LIST := $(FORCE_RELINK_DEP) $(FORCE_REBUILD_DEP) $(FORCE_REBUILD_ALL_DEP) - -$(FORCE_REBUILD_DEP_LIST): - -$(OBJS): $(wildcard $(FORCE_REBUILD_DEP)) $(wildcard $(FORCE_REBUILD_ALL_DEP)) - - -#------------------------------------------------------------------------------ -# BUILD RULES: ALL & CLEAN -#------------------------------------------------------------------------------ -.DELETE_ON_ERROR: - -.PHONY: all -all: build_pre_process -all: Makefile $(GENERATED_FILES) $(BSP_LIB) $(NEWLIB_DIR) -all: build_post_process - - -# clean: remove .o/.a/.d -.PHONY: clean -clean: - @$(RM) -r $(BSP_LIB) $(OBJ_DIR) $(FORCE_REBUILD_DEP_LIST) -ifneq ($(wildcard $(NEWLIB_DIR)),) - @$(RM) -r $(NEWLIB_DIR) -endif - @$(ECHO) [BSP clean complete] - - -#------------------------------------------------------------------------------ -# BUILD PRE/POST PROCESS -#------------------------------------------------------------------------------ -build_pre_process : - $(BUILD_PRE_PROCESS) - -build_post_process : - $(BUILD_POST_PROCESS) - -.PHONY: build_pre_process build_post_process - - - -#------------------------------------------------------------------------------ -# MAKEFILE UP TO DATE? -# -# Is this very Makefile up to date? Someone may have changed the BSP settings -# file or the associated target hardware. -#------------------------------------------------------------------------------ -# Skip this check when clean is the only target -ifneq ($(MAKECMDGOALS),clean) - -ifneq ($(wildcard $(SETTINGS_FILE)),$(SETTINGS_FILE)) -$(warning Warning: BSP Settings File $(SETTINGS_FILE) could not be found.) -endif - -Makefile: $(wildcard $(SETTINGS_FILE)) - @$(ECHO) Makefile not up to date. - @$(ECHO) $(SETTINGS_FILE) has been modified since the BSP Makefile was generated. - @$(ECHO) - @$(ECHO) Generate the BSP to update the Makefile, and then build again. - @$(ECHO) - @$(ECHO) To generate from Eclipse: - @$(ECHO) " 1. Right-click the BSP project." - @$(ECHO) " 2. In the Nios II Menu, click Generate BSP." - @$(ECHO) - @$(ECHO) To generate from the command line: - @$(ECHO) " nios2-bsp-generate-files --settings= --bsp-dir=" - @$(ECHO) - @exit 1 - -ifneq ($(wildcard $(SOPC_FILE)),$(SOPC_FILE)) -$(warning Warning: SOPC File $(SOPC_FILE) could not be found.) -endif - -public.mk: $(wildcard $(SOPC_FILE)) - @$(ECHO) Makefile not up to date. - @$(ECHO) $(SOPC_FILE) has been modified since the BSP was generated. - @$(ECHO) - @$(ECHO) Generate the BSP to update the Makefile, and then build again. - @$(ECHO) - @$(ECHO) To generate from Eclipse: - @$(ECHO) " 1. Right-click the BSP project." - @$(ECHO) " 2. In the Nios II Menu, click Generate BSP." - @$(ECHO) - @$(ECHO) To generate from the command line: - @$(ECHO) " nios2-bsp-generate-files --settings= --bsp-dir=" - @$(ECHO) - @exit 1 - -endif # $(MAKECMDGOALS) != clean - -#------------------------------------------------------------------------------ -# PATTERN RULES TO BUILD OBJECTS -#------------------------------------------------------------------------------ -$(OBJ_DIR)/%.o: %.c - @$(ECHO) Compiling $( - -/* - * Device headers - */ - -#include "altera_nios2_qsys_irq.h" -#include "altera_avalon_jtag_uart.h" - -/* - * Allocate the device storage - */ - -ALTERA_NIOS2_QSYS_IRQ_INSTANCE ( NIOS2_PROCESSOR, nios2_processor); -ALTERA_AVALON_JTAG_UART_INSTANCE ( JTAG_UART, jtag_uart); - -/* - * Initialize the interrupt controller devices - * and then enable interrupts in the CPU. - * Called before alt_sys_init(). - * The "base" parameter is ignored and only - * present for backwards-compatibility. - */ - -void alt_irq_init ( const void* base ) -{ - ALTERA_NIOS2_QSYS_IRQ_INIT ( NIOS2_PROCESSOR, nios2_processor); - alt_irq_cpu_enable_interrupts(); -} - -/* - * Initialize the non-interrupt controller devices. - * Called after alt_irq_init(). - */ - -void alt_sys_init( void ) -{ - ALTERA_AVALON_JTAG_UART_INIT ( JTAG_UART, jtag_uart); -} diff --git a/software/qsys_tutorial_hexs_bsp/create-this-bsp b/software/qsys_tutorial_hexs_bsp/create-this-bsp deleted file mode 100644 index 49e6175..0000000 --- a/software/qsys_tutorial_hexs_bsp/create-this-bsp +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/bash -# -# This script creates the ucosii_net_zipfs Board Support Package (BSP). - -BSP_TYPE=hal -BSP_DIR=. -SOPC_DIR=../../ -SOPC_FILE=C:/Users/takayun/Documents/DE2-115/qsys_tutorial/nios_system.sopcinfo -NIOS2_BSP_ARGS="--set hal.max_file_descriptors 4 --set hal.enable_small_c_library true --set hal.sys_clk_timer none --set hal.timestamp_timer none --set hal.enable_exit false --set hal.enable_c_plus_plus false --set hal.enable_lightweight_device_driver_api true --set hal.enable_clean_exit false --set hal.enable_sim_optimize false --set hal.enable_reduced_device_drivers true --set hal.make.bsp_cflags_optimization '-Os'" -CPU_NAME= - - -# Don't run make if create-this-app script is called with --no-make arg -SKIP_MAKE= -while [ $# -gt 0 ] -do - case "$1" in - --no-make) - SKIP_MAKE=1 - ;; - *) - NIOS2_BSP_ARGS="$NIOS2_BSP_ARGS $1" - ;; - esac - shift -done - - -# Run nios2-bsp utility to create a hal BSP in this directory -# for the system with a .sopc file in $SOPC_FILE. -# Deprecating $SOPC_DIR in 10.1. Multiple .sopcinfo files in a directory may exist. - -if [ -z "$SOPC_FILE" ]; then - echo "WARNING: Use of a directory for locating a .sopcinfo file is deprecated in 10.1. Multiple .sopcinfo files may exist. You must specify the full .sopcinfo path." - cmd="nios2-bsp $BSP_TYPE $BSP_DIR $SOPC_DIR $NIOS2_BSP_ARGS $CPU_NAME" -else - cmd="nios2-bsp $BSP_TYPE $BSP_DIR $SOPC_FILE $NIOS2_BSP_ARGS $CPU_NAME" -fi - - -echo "create-this-bsp: Running \"$cmd\"" -$cmd || { - echo "$cmd failed" - exit 1 -} -if [ -z "$SKIP_MAKE" ]; then - echo "create-this-bsp: Running make" - make -fi diff --git a/software/qsys_tutorial_hexs_bsp/drivers/inc/altera_avalon_jtag_uart.h b/software/qsys_tutorial_hexs_bsp/drivers/inc/altera_avalon_jtag_uart.h deleted file mode 100644 index 95d4a99..0000000 --- a/software/qsys_tutorial_hexs_bsp/drivers/inc/altera_avalon_jtag_uart.h +++ /dev/null @@ -1,198 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#ifndef __ALT_AVALON_JTAG_UART_H__ -#define __ALT_AVALON_JTAG_UART_H__ - -#include - -#include "sys/alt_alarm.h" -#include "sys/alt_warning.h" - -#include "os/alt_sem.h" -#include "os/alt_flag.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * If the user wants all drivers to be small rather than fast then make sure - * this one is marked as needing to be small. - */ -#if defined ALT_USE_SMALL_DRIVERS && !defined ALTERA_AVALON_JTAG_UART_SMALL -#define ALTERA_AVALON_JTAG_UART_SMALL -#endif - -/* - * If the user wants to ignore FIFO full error after timeout - */ -#if defined ALT_JTAG_UART_IGNORE_FIFO_FULL_ERROR && !defined ALTERA_AVALON_JTAG_UART_IGNORE_FIFO_FULL_ERROR -#define ALTERA_AVALON_JTAG_UART_IGNORE_FIFO_FULL_ERROR -#endif - -/* - * Constants that can be overriden. - */ -#ifndef ALTERA_AVALON_JTAG_UART_DEFAULT_TIMEOUT -#define ALTERA_AVALON_JTAG_UART_DEFAULT_TIMEOUT 10 -#endif - -#ifndef ALTERA_AVALON_JTAG_UART_BUF_LEN -#define ALTERA_AVALON_JTAG_UART_BUF_LEN 2048 -#endif - -/* - * ALT_JTAG_UART_READ_RDY and ALT_JTAG_UART_WRITE_RDY are the bitmasks - * that define uC/OS-II event flags that are releated to this device. - * - * ALT_JTAG_UART_READ_RDY indicates that there is read data in the buffer - * ready to be processed. ALT_JTAG_UART_WRITE_RDY indicates that the transmitter is - * ready for more data. - */ -#define ALT_JTAG_UART_READ_RDY 0x1 -#define ALT_JTAG_UART_WRITE_RDY 0x2 -#define ALT_JTAG_UART_TIMEOUT 0x4 - -/* - * State structure definition. Each instance of the driver uses one - * of these structures to hold its associated state. - */ - -typedef struct altera_avalon_jtag_uart_state_s -{ - unsigned int base; - -#ifndef ALTERA_AVALON_JTAG_UART_SMALL - - unsigned int timeout; /* Timeout until host is assumed inactive */ - alt_alarm alarm; - unsigned int irq_enable; - unsigned int host_inactive; - - ALT_SEM (read_lock) - ALT_SEM (write_lock) - ALT_FLAG_GRP (events) - - /* The variables below are volatile because they are modified by the - * interrupt routine. Making them volatile and reading them atomically - * means that we don't need any large critical sections. - */ - volatile unsigned int rx_in; - unsigned int rx_out; - unsigned int tx_in; - volatile unsigned int tx_out; - char rx_buf[ALTERA_AVALON_JTAG_UART_BUF_LEN]; - char tx_buf[ALTERA_AVALON_JTAG_UART_BUF_LEN]; - -#endif /* !ALTERA_AVALON_JTAG_UART_SMALL */ - -} altera_avalon_jtag_uart_state; - -/* - * Macros used by alt_sys_init when the ALT file descriptor facility isn't used. - */ - -#ifdef ALTERA_AVALON_JTAG_UART_SMALL - -#define ALTERA_AVALON_JTAG_UART_STATE_INSTANCE(name, state) \ - altera_avalon_jtag_uart_state state = \ - { \ - name##_BASE, \ - } - -#define ALTERA_AVALON_JTAG_UART_STATE_INIT(name, state) - -#else /* !ALTERA_AVALON_JTAG_UART_SMALL */ - -#define ALTERA_AVALON_JTAG_UART_STATE_INSTANCE(name, state) \ - altera_avalon_jtag_uart_state state = \ - { \ - name##_BASE, \ - ALTERA_AVALON_JTAG_UART_DEFAULT_TIMEOUT, \ - } - -/* - * Externally referenced routines - */ -extern void altera_avalon_jtag_uart_init(altera_avalon_jtag_uart_state* sp, - int irq_controller_id, int irq); - -#define ALTERA_AVALON_JTAG_UART_STATE_INIT(name, state) \ - { \ - if (name##_IRQ == ALT_IRQ_NOT_CONNECTED) \ - { \ - ALT_LINK_ERROR ("Error: Interrupt not connected for " #name ". " \ - "You have selected the interrupt driven version of " \ - "the ALTERA Avalon JTAG UART driver, but the " \ - "interrupt is not connected for this device. You can " \ - "select a polled mode driver by checking the 'small " \ - "driver' option in the HAL configuration window, or " \ - "by using the -DALTERA_AVALON_JTAG_UART_SMALL " \ - "preprocessor flag."); \ - } \ - else \ - altera_avalon_jtag_uart_init(&state, \ - name##_IRQ_INTERRUPT_CONTROLLER_ID, \ - name##_IRQ); \ - } - -#endif /* ALTERA_AVALON_JTAG_UART_SMALL */ - -/* - * Include in case non-direct version of driver required. - */ -#include "altera_avalon_jtag_uart_fd.h" - -/* - * Map alt_sys_init macros to direct or non-direct versions. - */ -#ifdef ALT_USE_DIRECT_DRIVERS - -#define ALTERA_AVALON_JTAG_UART_INSTANCE(name, state) \ - ALTERA_AVALON_JTAG_UART_STATE_INSTANCE(name, state) -#define ALTERA_AVALON_JTAG_UART_INIT(name, state) \ - ALTERA_AVALON_JTAG_UART_STATE_INIT(name, state) - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -#define ALTERA_AVALON_JTAG_UART_INSTANCE(name, dev) \ - ALTERA_AVALON_JTAG_UART_DEV_INSTANCE(name, dev) -#define ALTERA_AVALON_JTAG_UART_INIT(name, dev) \ - ALTERA_AVALON_JTAG_UART_DEV_INIT(name, dev) - -#endif /* ALT_USE_DIRECT_DRIVERS */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_AVALON_JTAG_UART_H__ */ diff --git a/software/qsys_tutorial_hexs_bsp/drivers/inc/altera_avalon_jtag_uart_fd.h b/software/qsys_tutorial_hexs_bsp/drivers/inc/altera_avalon_jtag_uart_fd.h deleted file mode 100644 index b3c3200..0000000 --- a/software/qsys_tutorial_hexs_bsp/drivers/inc/altera_avalon_jtag_uart_fd.h +++ /dev/null @@ -1,125 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#ifndef __ALT_AVALON_JTAG_UART_FD_H__ -#define __ALT_AVALON_JTAG_UART_FD_H__ - -#include "sys/alt_dev.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * Externally referenced routines - */ -extern int altera_avalon_jtag_uart_read_fd (alt_fd* fd, char* ptr, int len); -extern int altera_avalon_jtag_uart_write_fd (alt_fd* fd, const char* ptr, - int len); - -/* - * Device structure definition. This is needed by alt_sys_init in order to - * reserve memory for the device instance. - */ - -typedef struct altera_avalon_jtag_uart_dev_s -{ - alt_dev dev; - altera_avalon_jtag_uart_state state; -} altera_avalon_jtag_uart_dev; - -/* - * Macros used by alt_sys_init when the ALT file descriptor facility is used. - */ - -#ifdef ALTERA_AVALON_JTAG_UART_SMALL - -#define ALTERA_AVALON_JTAG_UART_DEV_INSTANCE(name, d) \ - static altera_avalon_jtag_uart_dev d = \ - { \ - { \ - ALT_LLIST_ENTRY, \ - name##_NAME, \ - NULL, /* open */ \ - NULL, /* close */ \ - altera_avalon_jtag_uart_read_fd, \ - altera_avalon_jtag_uart_write_fd, \ - NULL, /* lseek */ \ - NULL, /* fstat */ \ - NULL, /* ioctl */ \ - }, \ - { \ - name##_BASE, \ - } \ - } - -#define ALTERA_AVALON_JTAG_UART_DEV_INIT(name, d) alt_dev_reg (&d.dev) - -#else /* !ALTERA_AVALON_JTAG_UART_SMALL */ - -extern int altera_avalon_jtag_uart_close_fd(alt_fd* fd); -extern int altera_avalon_jtag_uart_ioctl_fd (alt_fd* fd, int req, void* arg); - -#define ALTERA_AVALON_JTAG_UART_DEV_INSTANCE(name, d) \ - static altera_avalon_jtag_uart_dev d = \ - { \ - { \ - ALT_LLIST_ENTRY, \ - name##_NAME, \ - NULL, /* open */ \ - altera_avalon_jtag_uart_close_fd, \ - altera_avalon_jtag_uart_read_fd, \ - altera_avalon_jtag_uart_write_fd, \ - NULL, /* lseek */ \ - NULL, /* fstat */ \ - altera_avalon_jtag_uart_ioctl_fd, \ - }, \ - { \ - name##_BASE, \ - ALTERA_AVALON_JTAG_UART_DEFAULT_TIMEOUT, \ - } \ - } - -#define ALTERA_AVALON_JTAG_UART_DEV_INIT(name, d) \ - { \ - ALTERA_AVALON_JTAG_UART_STATE_INIT(name, d.state); \ - \ - /* make the device available to the system */ \ - alt_dev_reg(&d.dev); \ - } - -#endif /* ALTERA_AVALON_JTAG_UART_SMALL */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_AVALON_JTAG_UART_FD_H__ */ diff --git a/software/qsys_tutorial_hexs_bsp/drivers/inc/altera_avalon_jtag_uart_regs.h b/software/qsys_tutorial_hexs_bsp/drivers/inc/altera_avalon_jtag_uart_regs.h deleted file mode 100644 index 7f97160..0000000 --- a/software/qsys_tutorial_hexs_bsp/drivers/inc/altera_avalon_jtag_uart_regs.h +++ /dev/null @@ -1,73 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#ifndef __ALTERA_AVALON_JTAG_UART_REGS_H__ -#define __ALTERA_AVALON_JTAG_UART_REGS_H__ - -#include - -#define ALTERA_AVALON_JTAG_UART_DATA_REG 0 -#define IOADDR_ALTERA_AVALON_JTAG_UART_DATA(base) \ - __IO_CALC_ADDRESS_NATIVE(base, ALTERA_AVALON_JTAG_UART_DATA_REG) -#define IORD_ALTERA_AVALON_JTAG_UART_DATA(base) \ - IORD(base, ALTERA_AVALON_JTAG_UART_DATA_REG) -#define IOWR_ALTERA_AVALON_JTAG_UART_DATA(base, data) \ - IOWR(base, ALTERA_AVALON_JTAG_UART_DATA_REG, data) - -#define ALTERA_AVALON_JTAG_UART_DATA_DATA_MSK (0x000000FF) -#define ALTERA_AVALON_JTAG_UART_DATA_DATA_OFST (0) -#define ALTERA_AVALON_JTAG_UART_DATA_RVALID_MSK (0x00008000) -#define ALTERA_AVALON_JTAG_UART_DATA_RVALID_OFST (15) -#define ALTERA_AVALON_JTAG_UART_DATA_RAVAIL_MSK (0xFFFF0000) -#define ALTERA_AVALON_JTAG_UART_DATA_RAVAIL_OFST (16) - - -#define ALTERA_AVALON_JTAG_UART_CONTROL_REG 1 -#define IOADDR_ALTERA_AVALON_JTAG_UART_CONTROL(base) \ - __IO_CALC_ADDRESS_NATIVE(base, ALTERA_AVALON_JTAG_UART_CONTROL_REG) -#define IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base) \ - IORD(base, ALTERA_AVALON_JTAG_UART_CONTROL_REG) -#define IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(base, data) \ - IOWR(base, ALTERA_AVALON_JTAG_UART_CONTROL_REG, data) - -#define ALTERA_AVALON_JTAG_UART_CONTROL_RE_MSK (0x00000001) -#define ALTERA_AVALON_JTAG_UART_CONTROL_RE_OFST (0) -#define ALTERA_AVALON_JTAG_UART_CONTROL_WE_MSK (0x00000002) -#define ALTERA_AVALON_JTAG_UART_CONTROL_WE_OFST (1) -#define ALTERA_AVALON_JTAG_UART_CONTROL_RI_MSK (0x00000100) -#define ALTERA_AVALON_JTAG_UART_CONTROL_RI_OFST (8) -#define ALTERA_AVALON_JTAG_UART_CONTROL_WI_MSK (0x00000200) -#define ALTERA_AVALON_JTAG_UART_CONTROL_WI_OFST (9) -#define ALTERA_AVALON_JTAG_UART_CONTROL_AC_MSK (0x00000400) -#define ALTERA_AVALON_JTAG_UART_CONTROL_AC_OFST (10) -#define ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_MSK (0xFFFF0000) -#define ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_OFST (16) - -#endif /* __ALTERA_AVALON_JTAG_UART_REGS_H__ */ diff --git a/software/qsys_tutorial_hexs_bsp/drivers/inc/altera_avalon_pio_regs.h b/software/qsys_tutorial_hexs_bsp/drivers/inc/altera_avalon_pio_regs.h deleted file mode 100644 index 052439f..0000000 --- a/software/qsys_tutorial_hexs_bsp/drivers/inc/altera_avalon_pio_regs.h +++ /dev/null @@ -1,67 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#ifndef __ALTERA_AVALON_PIO_REGS_H__ -#define __ALTERA_AVALON_PIO_REGS_H__ - -#include - -#define IOADDR_ALTERA_AVALON_PIO_DATA(base) __IO_CALC_ADDRESS_NATIVE(base, 0) -#define IORD_ALTERA_AVALON_PIO_DATA(base) IORD(base, 0) -#define IOWR_ALTERA_AVALON_PIO_DATA(base, data) IOWR(base, 0, data) - -#define IOADDR_ALTERA_AVALON_PIO_DIRECTION(base) __IO_CALC_ADDRESS_NATIVE(base, 1) -#define IORD_ALTERA_AVALON_PIO_DIRECTION(base) IORD(base, 1) -#define IOWR_ALTERA_AVALON_PIO_DIRECTION(base, data) IOWR(base, 1, data) - -#define IOADDR_ALTERA_AVALON_PIO_IRQ_MASK(base) __IO_CALC_ADDRESS_NATIVE(base, 2) -#define IORD_ALTERA_AVALON_PIO_IRQ_MASK(base) IORD(base, 2) -#define IOWR_ALTERA_AVALON_PIO_IRQ_MASK(base, data) IOWR(base, 2, data) - -#define IOADDR_ALTERA_AVALON_PIO_EDGE_CAP(base) __IO_CALC_ADDRESS_NATIVE(base, 3) -#define IORD_ALTERA_AVALON_PIO_EDGE_CAP(base) IORD(base, 3) -#define IOWR_ALTERA_AVALON_PIO_EDGE_CAP(base, data) IOWR(base, 3, data) - - -#define IOADDR_ALTERA_AVALON_PIO_SET_BIT(base) __IO_CALC_ADDRESS_NATIVE(base, 4) -#define IORD_ALTERA_AVALON_PIO_SET_BITS(base) IORD(base, 4) -#define IOWR_ALTERA_AVALON_PIO_SET_BITS(base, data) IOWR(base, 4, data) - -#define IOADDR_ALTERA_AVALON_PIO_CLEAR_BITS(base) __IO_CALC_ADDRESS_NATIVE(base, 5) -#define IORD_ALTERA_AVALON_PIO_CLEAR_BITS(base) IORD(base, 5) -#define IOWR_ALTERA_AVALON_PIO_CLEAR_BITS(base, data) IOWR(base, 5, data) - - - -/* Defintions for direction-register operation with bi-directional PIOs */ -#define ALTERA_AVALON_PIO_DIRECTION_INPUT 0 -#define ALTERA_AVALON_PIO_DIRECTION_OUTPUT 1 - -#endif /* __ALTERA_AVALON_PIO_REGS_H__ */ diff --git a/software/qsys_tutorial_hexs_bsp/drivers/src/altera_avalon_jtag_uart_fd.c b/software/qsys_tutorial_hexs_bsp/drivers/src/altera_avalon_jtag_uart_fd.c deleted file mode 100644 index 53dfc3b..0000000 --- a/software/qsys_tutorial_hexs_bsp/drivers/src/altera_avalon_jtag_uart_fd.c +++ /dev/null @@ -1,86 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "alt_types.h" -#include "sys/alt_dev.h" -#include "altera_avalon_jtag_uart.h" - -extern int altera_avalon_jtag_uart_read(altera_avalon_jtag_uart_state* sp, - char* buffer, int space, int flags); -extern int altera_avalon_jtag_uart_write(altera_avalon_jtag_uart_state* sp, - const char* ptr, int count, int flags); -extern int altera_avalon_jtag_uart_ioctl(altera_avalon_jtag_uart_state* sp, - int req, void* arg); -extern int altera_avalon_jtag_uart_close(altera_avalon_jtag_uart_state* sp, - int flags); - -/* ----------------------------------------------------------------------- */ -/* --------------------- WRAPPERS FOR ALT FD SUPPORT --------------------- */ -/* - * - */ - -int -altera_avalon_jtag_uart_read_fd(alt_fd* fd, char* buffer, int space) -{ - altera_avalon_jtag_uart_dev* dev = (altera_avalon_jtag_uart_dev*) fd->dev; - - return altera_avalon_jtag_uart_read(&dev->state, buffer, space, - fd->fd_flags); -} - -int -altera_avalon_jtag_uart_write_fd(alt_fd* fd, const char* buffer, int space) -{ - altera_avalon_jtag_uart_dev* dev = (altera_avalon_jtag_uart_dev*) fd->dev; - - return altera_avalon_jtag_uart_write(&dev->state, buffer, space, - fd->fd_flags); -} - -#ifndef ALTERA_AVALON_JTAG_UART_SMALL - -int -altera_avalon_jtag_uart_close_fd(alt_fd* fd) -{ - altera_avalon_jtag_uart_dev* dev = (altera_avalon_jtag_uart_dev*) fd->dev; - - return altera_avalon_jtag_uart_close(&dev->state, fd->fd_flags); -} - -int -altera_avalon_jtag_uart_ioctl_fd(alt_fd* fd, int req, void* arg) -{ - altera_avalon_jtag_uart_dev* dev = (altera_avalon_jtag_uart_dev*) fd->dev; - - return altera_avalon_jtag_uart_ioctl(&dev->state, req, arg); -} - -#endif /* ALTERA_AVALON_JTAG_UART_SMALL */ diff --git a/software/qsys_tutorial_hexs_bsp/drivers/src/altera_avalon_jtag_uart_init.c b/software/qsys_tutorial_hexs_bsp/drivers/src/altera_avalon_jtag_uart_init.c deleted file mode 100644 index 7317bec..0000000 --- a/software/qsys_tutorial_hexs_bsp/drivers/src/altera_avalon_jtag_uart_init.c +++ /dev/null @@ -1,256 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include -#include -#include -#include - -#include - -#include "sys/alt_irq.h" -#include "sys/alt_alarm.h" -#include "sys/ioctl.h" -#include "alt_types.h" - -#include "altera_avalon_jtag_uart_regs.h" -#include "altera_avalon_jtag_uart.h" - -#include "sys/alt_log_printf.h" - -#ifndef ALTERA_AVALON_JTAG_UART_SMALL - -/* ----------------------------------------------------------- */ -/* ------------------------- FAST DRIVER --------------------- */ -/* ----------------------------------------------------------- */ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT -static void altera_avalon_jtag_uart_irq(void* context); -#else -static void altera_avalon_jtag_uart_irq(void* context, alt_u32 id); -#endif -static alt_u32 altera_avalon_jtag_uart_timeout(void* context); - -/* - * Driver initialization code. Register interrupts and start a timer - * which we can use to check whether the host is there. - * Return 1 on sucessful IRQ register and 0 on failure. - */ - -void altera_avalon_jtag_uart_init(altera_avalon_jtag_uart_state* sp, - int irq_controller_id, int irq) -{ - ALT_FLAG_CREATE(&sp->events, 0); - ALT_SEM_CREATE(&sp->read_lock, 1); - ALT_SEM_CREATE(&sp->write_lock, 1); - - /* enable read interrupts at the device */ - sp->irq_enable = ALTERA_AVALON_JTAG_UART_CONTROL_RE_MSK; - - IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base, sp->irq_enable); - - /* register the interrupt handler */ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - alt_ic_isr_register(irq_controller_id, irq, altera_avalon_jtag_uart_irq, - sp, NULL); -#else - alt_irq_register(irq, sp, altera_avalon_jtag_uart_irq); -#endif - - /* Register an alarm to go off every second to check for presence of host */ - sp->host_inactive = 0; - - if (alt_alarm_start(&sp->alarm, alt_ticks_per_second(), - &altera_avalon_jtag_uart_timeout, sp) < 0) - { - /* If we can't set the alarm then record "don't know if host present" - * and behave as though the host is present. - */ - sp->timeout = INT_MAX; - } - - /* ALT_LOG - see altera_hal/HAL/inc/sys/alt_log_printf.h */ - ALT_LOG_JTAG_UART_ALARM_REGISTER(sp, sp->base); -} - -/* - * Interrupt routine - */ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT -static void altera_avalon_jtag_uart_irq(void* context) -#else -static void altera_avalon_jtag_uart_irq(void* context, alt_u32 id) -#endif -{ - altera_avalon_jtag_uart_state* sp = (altera_avalon_jtag_uart_state*) context; - unsigned int base = sp->base; - - /* ALT_LOG - see altera_hal/HAL/inc/sys/alt_log_printf.h */ - ALT_LOG_JTAG_UART_ISR_FUNCTION(base, sp); - - for ( ; ; ) - { - unsigned int control = IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base); - - /* Return once nothing more to do */ - if ((control & (ALTERA_AVALON_JTAG_UART_CONTROL_RI_MSK | ALTERA_AVALON_JTAG_UART_CONTROL_WI_MSK)) == 0) - break; - - if (control & ALTERA_AVALON_JTAG_UART_CONTROL_RI_MSK) - { - /* process a read irq. Start by assuming that there is data in the - * receive FIFO (otherwise why would we have been interrupted?) - */ - unsigned int data = 1 << ALTERA_AVALON_JTAG_UART_DATA_RAVAIL_OFST; - - for ( ; ; ) - { - /* Check whether there is space in the buffer. If not then we must not - * read any characters from the buffer as they will be lost. - */ - unsigned int next = (sp->rx_in + 1) % ALTERA_AVALON_JTAG_UART_BUF_LEN; - if (next == sp->rx_out) - break; - - /* Try to remove a character from the FIFO and find out whether there - * are any more characters remaining. - */ - data = IORD_ALTERA_AVALON_JTAG_UART_DATA(base); - - if ((data & ALTERA_AVALON_JTAG_UART_DATA_RVALID_MSK) == 0) - break; - - sp->rx_buf[sp->rx_in] = (data & ALTERA_AVALON_JTAG_UART_DATA_DATA_MSK) >> ALTERA_AVALON_JTAG_UART_DATA_DATA_OFST; - sp->rx_in = (sp->rx_in + 1) % ALTERA_AVALON_JTAG_UART_BUF_LEN; - - /* Post an event to notify jtag_uart_read that a character has been read */ - ALT_FLAG_POST (sp->events, ALT_JTAG_UART_READ_RDY, OS_FLAG_SET); - } - - if (data & ALTERA_AVALON_JTAG_UART_DATA_RAVAIL_MSK) - { - /* If there is still data available here then the buffer is full - * so turn off receive interrupts until some space becomes available. - */ - sp->irq_enable &= ~ALTERA_AVALON_JTAG_UART_CONTROL_RE_MSK; - IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(base, sp->irq_enable); - - /* Dummy read to ensure IRQ is cleared prior to ISR completion */ - IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base); - } - } - - if (control & ALTERA_AVALON_JTAG_UART_CONTROL_WI_MSK) - { - /* process a write irq */ - unsigned int space = (control & ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_MSK) >> ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_OFST; - - while (space > 0 && sp->tx_out != sp->tx_in) - { - IOWR_ALTERA_AVALON_JTAG_UART_DATA(base, sp->tx_buf[sp->tx_out]); - - sp->tx_out = (sp->tx_out + 1) % ALTERA_AVALON_JTAG_UART_BUF_LEN; - - /* Post an event to notify jtag_uart_write that a character has been written */ - ALT_FLAG_POST (sp->events, ALT_JTAG_UART_WRITE_RDY, OS_FLAG_SET); - - space--; - } - - if (space > 0) - { - /* If we don't have any more data available then turn off the TX interrupt */ - sp->irq_enable &= ~ALTERA_AVALON_JTAG_UART_CONTROL_WE_MSK; - IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base, sp->irq_enable); - - /* Dummy read to ensure IRQ is cleared prior to ISR completion */ - IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base); - } - } - } -} - -/* - * Timeout routine is called every second - */ - -static alt_u32 -altera_avalon_jtag_uart_timeout(void* context) -{ - altera_avalon_jtag_uart_state* sp = (altera_avalon_jtag_uart_state *) context; - - unsigned int control = IORD_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base); - - if (control & ALTERA_AVALON_JTAG_UART_CONTROL_AC_MSK) - { - IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base, sp->irq_enable | ALTERA_AVALON_JTAG_UART_CONTROL_AC_MSK); - sp->host_inactive = 0; - } - else if (sp->host_inactive < INT_MAX - 2) { - sp->host_inactive++; - - if (sp->host_inactive >= sp->timeout) { - /* Post an event to indicate host is inactive (for jtag_uart_read */ - ALT_FLAG_POST (sp->events, ALT_JTAG_UART_TIMEOUT, OS_FLAG_SET); - } - } - - return alt_ticks_per_second(); -} - -/* - * The close() routine is implemented to drain the JTAG UART transmit buffer - * when not in "small" mode. This routine will wait for transimt data to be - * emptied unless a timeout from host-activity occurs. If the driver flags - * have been set to non-blocking mode, this routine will exit immediately if - * any data remains. This routine should be called indirectly (i.e. though - * the C library close() routine) so that the file descriptor associated - * with the relevant stream (i.e. stdout) can be closed as well. This routine - * does not manage file descriptors. - * - * The close routine is not implemented for the small driver; instead it will - * map to null. This is because the small driver simply waits while characters - * are transmitted; there is no interrupt-serviced buffer to empty - */ -int altera_avalon_jtag_uart_close(altera_avalon_jtag_uart_state* sp, int flags) -{ - /* - * Wait for all transmit data to be emptied by the JTAG UART ISR, or - * for a host-inactivity timeout, in which case transmit data will be lost - */ - while ( (sp->tx_out != sp->tx_in) && (sp->host_inactive < sp->timeout) ) { - if (flags & O_NONBLOCK) { - return -EWOULDBLOCK; - } - } - - return 0; -} - -#endif /* !ALTERA_AVALON_JTAG_UART_SMALL */ diff --git a/software/qsys_tutorial_hexs_bsp/drivers/src/altera_avalon_jtag_uart_ioctl.c b/software/qsys_tutorial_hexs_bsp/drivers/src/altera_avalon_jtag_uart_ioctl.c deleted file mode 100644 index cf71e6f..0000000 --- a/software/qsys_tutorial_hexs_bsp/drivers/src/altera_avalon_jtag_uart_ioctl.c +++ /dev/null @@ -1,86 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include -#include -#include -#include - -#include - -#include "sys/ioctl.h" -#include "alt_types.h" - -#include "altera_avalon_jtag_uart_regs.h" -#include "altera_avalon_jtag_uart.h" - -#include "sys/alt_log_printf.h" - -#ifndef ALTERA_AVALON_JTAG_UART_SMALL - -/* ----------------------------------------------------------- */ -/* ------------------------- FAST DRIVER --------------------- */ -/* ----------------------------------------------------------- */ - -int -altera_avalon_jtag_uart_ioctl(altera_avalon_jtag_uart_state* sp, int req, - void* arg) -{ - int rc = -ENOTTY; - - switch (req) - { - case TIOCSTIMEOUT: - /* Set the time to wait until assuming host is not connected */ - if (sp->timeout != INT_MAX) - { - int timeout = *((int *)arg); - sp->timeout = (timeout >= 2 && timeout < INT_MAX) ? timeout : INT_MAX - 1; - rc = 0; - } - break; - - case TIOCGCONNECTED: - /* Find out whether host is connected */ - if (sp->timeout != INT_MAX) - { - *((int *)arg) = (sp->host_inactive < sp->timeout) ? 1 : 0; - rc = 0; - } - break; - - default: - break; - } - - return rc; -} - -#endif /* !ALTERA_AVALON_JTAG_UART_SMALL */ diff --git a/software/qsys_tutorial_hexs_bsp/drivers/src/altera_avalon_jtag_uart_read.c b/software/qsys_tutorial_hexs_bsp/drivers/src/altera_avalon_jtag_uart_read.c deleted file mode 100644 index 5657adb..0000000 --- a/software/qsys_tutorial_hexs_bsp/drivers/src/altera_avalon_jtag_uart_read.c +++ /dev/null @@ -1,205 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include -#include -#include -#include - -#include - -#include "sys/alt_irq.h" -#include "sys/alt_alarm.h" -#include "sys/ioctl.h" -#include "alt_types.h" - -#include "altera_avalon_jtag_uart_regs.h" -#include "altera_avalon_jtag_uart.h" - -#include "sys/alt_log_printf.h" - -#ifdef __ucosii__ -#include "includes.h" -#endif /* __ucosii__ */ - -#ifdef ALTERA_AVALON_JTAG_UART_SMALL - -/* ----------------------------------------------------------- */ -/* ----------------------- SMALL DRIVER ---------------------- */ -/* ----------------------------------------------------------- */ - -/* Read routine. The small version blocks until it has at least one byte - * available, it then returns as much as is immediately available without - * waiting any more. It's performance will be very poor without - * interrupts. - */ - -int -altera_avalon_jtag_uart_read(altera_avalon_jtag_uart_state* sp, - char* buffer, int space, int flags) -{ - unsigned int base = sp->base; - - char * ptr = buffer; - char * end = buffer + space; - - while (ptr < end) - { - unsigned int data = IORD_ALTERA_AVALON_JTAG_UART_DATA(base); - - if (data & ALTERA_AVALON_JTAG_UART_DATA_RVALID_MSK) - *ptr++ = (data & ALTERA_AVALON_JTAG_UART_DATA_DATA_MSK) >> ALTERA_AVALON_JTAG_UART_DATA_DATA_OFST; - else if (ptr != buffer) - break; - else if(flags & O_NONBLOCK) - break; - - } - - if (ptr != buffer) - return ptr - buffer; - else if (flags & O_NONBLOCK) - return -EWOULDBLOCK; - else - return -EIO; -} - -#else /* !ALTERA_AVALON_JTAG_UART_SMALL */ - -/* ----------------------------------------------------------- */ -/* ----------------------- FAST DRIVER ----------------------- */ -/* ----------------------------------------------------------- */ - -int -altera_avalon_jtag_uart_read(altera_avalon_jtag_uart_state* sp, - char * buffer, int space, int flags) -{ - char * ptr = buffer; - - alt_irq_context context; - unsigned int n; - - /* - * When running in a multi threaded environment, obtain the "read_lock" - * semaphore. This ensures that reading from the device is thread-safe. - */ - ALT_SEM_PEND (sp->read_lock, 0); - - while (space > 0) - { - unsigned int in, out; - - /* Read as much data as possible */ - do - { - in = sp->rx_in; - out = sp->rx_out; - - if (in >= out) - n = in - out; - else - n = ALTERA_AVALON_JTAG_UART_BUF_LEN - out; - - if (n == 0) - break; /* No more data available */ - - if (n > space) - n = space; - - memcpy(ptr, sp->rx_buf + out, n); - ptr += n; - space -= n; - - sp->rx_out = (out + n) % ALTERA_AVALON_JTAG_UART_BUF_LEN; - } - while (space > 0); - - /* If we read any data then return it */ - if (ptr != buffer) - break; - - /* If in non-blocking mode then return error */ - if (flags & O_NONBLOCK) - break; - -#ifdef __ucosii__ - /* OS Present: Pend on a flag if the OS is running, otherwise spin */ - if(OSRunning == OS_TRUE) { - /* - * When running in a multi-threaded mode, we pend on the read event - * flag set and timeout event flag set in the isr. This avoids wasting CPU - * cycles waiting in this thread, when we could be doing something more - * profitable elsewhere. - */ - ALT_FLAG_PEND (sp->events, - ALT_JTAG_UART_READ_RDY | ALT_JTAG_UART_TIMEOUT, - OS_FLAG_WAIT_SET_ANY + OS_FLAG_CONSUME, - 0); - } - else { - /* Spin until more data arrives or until host disconnects */ - while (in == sp->rx_in && sp->host_inactive < sp->timeout) - ; - } -#else - /* No OS: Always spin */ - while (in == sp->rx_in && sp->host_inactive < sp->timeout) - ; -#endif /* __ucosii__ */ - - if (in == sp->rx_in) - break; - } - - /* - * Now that access to the circular buffer is complete, release the read - * semaphore so that other threads can access the buffer. - */ - - ALT_SEM_POST (sp->read_lock); - - if (ptr != buffer) - { - /* If we read any data then there is space in the buffer so enable interrupts */ - context = alt_irq_disable_all(); - sp->irq_enable |= ALTERA_AVALON_JTAG_UART_CONTROL_RE_MSK; - IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base, sp->irq_enable); - alt_irq_enable_all(context); - } - - if (ptr != buffer) - return ptr - buffer; - else if (flags & O_NONBLOCK) - return -EWOULDBLOCK; - else - return -EIO; -} - -#endif /* ALTERA_AVALON_JTAG_UART_SMALL */ diff --git a/software/qsys_tutorial_hexs_bsp/drivers/src/altera_avalon_jtag_uart_write.c b/software/qsys_tutorial_hexs_bsp/drivers/src/altera_avalon_jtag_uart_write.c deleted file mode 100644 index 11aeca1..0000000 --- a/software/qsys_tutorial_hexs_bsp/drivers/src/altera_avalon_jtag_uart_write.c +++ /dev/null @@ -1,217 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include -#include -#include -#include - -#include - -#include "sys/alt_irq.h" -#include "sys/alt_alarm.h" -#include "sys/ioctl.h" -#include "alt_types.h" - -#include "altera_avalon_jtag_uart_regs.h" -#include "altera_avalon_jtag_uart.h" - -#include "sys/alt_log_printf.h" - -#ifdef __ucosii__ -#include "includes.h" -#endif /* __ucosii__ */ - -#ifdef ALTERA_AVALON_JTAG_UART_SMALL - -/* ----------------------------------------------------------- */ -/* ------------------------ SMALL DRIVER --------------------- */ -/* ----------------------------------------------------------- */ - -/* Write routine. The small version blocks when there is no space to write - * into, so it's performance will be very bad if you are writing more than - * one FIFOs worth of data. But you said you didn't want to use interrupts :-) - */ - -int altera_avalon_jtag_uart_write(altera_avalon_jtag_uart_state* sp, - const char * ptr, int count, int flags) -{ - unsigned int base = sp->base; - - const char * end = ptr + count; - - while (ptr < end) - if ((IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base) & ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_MSK) != 0) - IOWR_ALTERA_AVALON_JTAG_UART_DATA(base, *ptr++); - - return count; -} - -#else /* !ALTERA_AVALON_JTAG_UART_SMALL */ - -/* ----------------------------------------------------------- */ -/* ------------------------- FAST DRIVER --------------------- */ -/* ----------------------------------------------------------- */ - -int -altera_avalon_jtag_uart_write(altera_avalon_jtag_uart_state* sp, - const char * ptr, int count, int flags) -{ - /* Remove warning at optimisation level 03 by seting out to 0 */ - unsigned int in, out=0; - unsigned int n; - alt_irq_context context; - - const char * start = ptr; - - /* - * When running in a multi threaded environment, obtain the "write_lock" - * semaphore. This ensures that writing to the device is thread-safe. - */ - ALT_SEM_PEND (sp->write_lock, 0); - - do - { - /* Copy as much as we can into the transmit buffer */ - while (count > 0) - { - /* We need a stable value of the out pointer to calculate the space available */ - in = sp->tx_in; - out = sp->tx_out; - - if (in < out) - n = out - 1 - in; - else if (out > 0) - n = ALTERA_AVALON_JTAG_UART_BUF_LEN - in; - else - n = ALTERA_AVALON_JTAG_UART_BUF_LEN - 1 - in; - - if (n == 0) - break; - - if (n > count) - n = count; - - memcpy(sp->tx_buf + in, ptr, n); - ptr += n; - count -= n; - - sp->tx_in = (in + n) % ALTERA_AVALON_JTAG_UART_BUF_LEN; - } - - /* - * If interrupts are disabled then we could transmit here, we only need - * to enable interrupts if there is no space left in the FIFO - * - * For now kick the interrupt routine every time to make it transmit - * the data - */ - context = alt_irq_disable_all(); - sp->irq_enable |= ALTERA_AVALON_JTAG_UART_CONTROL_WE_MSK; - IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base, sp->irq_enable); - alt_irq_enable_all(context); - - /* - * If there is any data left then either return now or block until - * some has been sent - */ - /* consider: test whether there is anything there while doing this and delay for at most 2s. */ - if (count > 0) - { - if (flags & O_NONBLOCK) - break; - -#ifdef __ucosii__ - /* OS Present: Pend on a flag if the OS is running, otherwise spin */ - if(OSRunning == OS_TRUE) { - /* - * When running in a multi-threaded mode, we pend on the write event - * flag set or the timeout flag in the isr. This avoids wasting CPU - * cycles waiting in this thread, when we could be doing something - * more profitable elsewhere. - */ -#ifdef ALTERA_AVALON_JTAG_UART_IGNORE_FIFO_FULL_ERROR - if(!sp->host_inactive) -#endif - ALT_FLAG_PEND (sp->events, - ALT_JTAG_UART_WRITE_RDY | ALT_JTAG_UART_TIMEOUT, - OS_FLAG_WAIT_SET_ANY + OS_FLAG_CONSUME, - 0); - } - else { - /* - * OS not running: Wait for data to be removed from buffer. - * Once the interrupt routine has removed some data then we - * will be able to insert some more. - */ - while (out == sp->tx_out && sp->host_inactive < sp->timeout) - ; - } -#else - /* - * No OS present: Always wait for data to be removed from buffer. Once - * the interrupt routine has removed some data then we will be able to - * insert some more. - */ - while (out == sp->tx_out && sp->host_inactive < sp->timeout) - ; -#endif /* __ucosii__ */ - - if (out == sp->tx_out) - break; - } - } - while (count > 0); - - /* - * Now that access to the circular buffer is complete, release the write - * semaphore so that other threads can access the buffer. - */ - ALT_SEM_POST (sp->write_lock); - - if (ptr != start) - return ptr - start; - else if (flags & O_NONBLOCK) - return -EWOULDBLOCK; -#ifdef ALTERA_AVALON_JTAG_UART_IGNORE_FIFO_FULL_ERROR - else if (sp->host_inactive >= sp->timeout) { - /* - * Reset the software FIFO, hardware FIFO could not be reset. - * Just throw away characters without reporting error. - */ - sp->tx_out = sp->tx_in = 0; - return ptr - start + count; - } -#endif - else - return -EIO; /* Host not connected */ -} - -#endif /* ALTERA_AVALON_JTAG_UART_SMALL */ diff --git a/software/qsys_tutorial_hexs_bsp/libhal_bsp.a b/software/qsys_tutorial_hexs_bsp/libhal_bsp.a deleted file mode 100644 index 09678a3..0000000 --- a/software/qsys_tutorial_hexs_bsp/libhal_bsp.a +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/linker.h b/software/qsys_tutorial_hexs_bsp/linker.h deleted file mode 100644 index 90651f8..0000000 --- a/software/qsys_tutorial_hexs_bsp/linker.h +++ /dev/null @@ -1,101 +0,0 @@ -/* - * linker.h - Linker script mapping information - * - * Machine generated for CPU 'nios2_processor' in SOPC Builder design 'nios_system' - * SOPC Builder design path: C:/Users/takayun/Documents/DE2-115/qsys_tutorial/nios_system.sopcinfo - * - * Generated: Thu Nov 17 09:38:43 JST 2016 - */ - -/* - * DO NOT MODIFY THIS FILE - * - * Changing this file will have subtle consequences - * which will almost certainly lead to a nonfunctioning - * system. If you do modify this file, be aware that your - * changes will be overwritten and lost when this file - * is generated again. - * - * DO NOT MODIFY THIS FILE - */ - -/* - * License Agreement - * - * Copyright (c) 2008 - * Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - * - * This agreement shall be governed in all respects by the laws of the State - * of California and by the laws of the United States of America. - */ - -#ifndef __LINKER_H_ -#define __LINKER_H_ - - -/* - * BSP controls alt_load() behavior in crt0. - * - */ - -#define ALT_LOAD_EXPLICITLY_CONTROLLED - - -/* - * Base address and span (size in bytes) of each linker region - * - */ - -#define ONCHIP_MEMORY_REGION_BASE 0x20 -#define ONCHIP_MEMORY_REGION_SPAN 4064 -#define RESET_REGION_BASE 0x0 -#define RESET_REGION_SPAN 32 - - -/* - * Devices associated with code sections - * - */ - -#define ALT_EXCEPTIONS_DEVICE ONCHIP_MEMORY -#define ALT_RESET_DEVICE ONCHIP_MEMORY -#define ALT_RODATA_DEVICE ONCHIP_MEMORY -#define ALT_RWDATA_DEVICE ONCHIP_MEMORY -#define ALT_TEXT_DEVICE ONCHIP_MEMORY - - -/* - * Initialization code at the reset address is allowed (e.g. no external bootloader). - * - */ - -#define ALT_ALLOW_CODE_AT_RESET - - -/* - * The alt_load() facility is called from crt0 to copy sections into RAM. - * - */ - -#define ALT_LOAD_COPY_RWDATA - -#endif /* __LINKER_H_ */ diff --git a/software/qsys_tutorial_hexs_bsp/linker.x b/software/qsys_tutorial_hexs_bsp/linker.x deleted file mode 100644 index 67437f7..0000000 --- a/software/qsys_tutorial_hexs_bsp/linker.x +++ /dev/null @@ -1,385 +0,0 @@ -/* - * linker.x - Linker script - * - * Machine generated for CPU 'nios2_processor' in SOPC Builder design 'nios_system' - * SOPC Builder design path: C:/Users/takayun/Documents/DE2-115/qsys_tutorial/nios_system.sopcinfo - * - * Generated: Thu Nov 17 09:38:43 JST 2016 - */ - -/* - * DO NOT MODIFY THIS FILE - * - * Changing this file will have subtle consequences - * which will almost certainly lead to a nonfunctioning - * system. If you do modify this file, be aware that your - * changes will be overwritten and lost when this file - * is generated again. - * - * DO NOT MODIFY THIS FILE - */ - -/* - * License Agreement - * - * Copyright (c) 2008 - * Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - * - * This agreement shall be governed in all respects by the laws of the State - * of California and by the laws of the United States of America. - */ - -MEMORY -{ - reset : ORIGIN = 0x0, LENGTH = 32 - onchip_memory : ORIGIN = 0x20, LENGTH = 4064 -} - -/* Define symbols for each memory base-address */ -__alt_mem_onchip_memory = 0x0; - -OUTPUT_FORMAT( "elf32-littlenios2", - "elf32-littlenios2", - "elf32-littlenios2" ) -OUTPUT_ARCH( nios2 ) -ENTRY( _start ) - -/* - * The alt_load() facility is enabled. This typically happens when there isn't - * an external bootloader (e.g. flash bootloader). - * The LMA (aka physical address) of each loaded section is - * set to the .text memory device. - * The HAL alt_load() routine called from crt0 copies sections from - * the .text memory to RAM as needed. - */ - -SECTIONS -{ - - /* - * Output sections associated with reset and exceptions (they have to be first) - */ - - .entry : - { - KEEP (*(.entry)) - } > reset - - .exceptions : - { - PROVIDE (__ram_exceptions_start = ABSOLUTE(.)); - . = ALIGN(0x20); - KEEP (*(.irq)); - KEEP (*(.exceptions.entry.label)); - KEEP (*(.exceptions.entry.user)); - KEEP (*(.exceptions.entry)); - KEEP (*(.exceptions.irqtest.user)); - KEEP (*(.exceptions.irqtest)); - KEEP (*(.exceptions.irqhandler.user)); - KEEP (*(.exceptions.irqhandler)); - KEEP (*(.exceptions.irqreturn.user)); - KEEP (*(.exceptions.irqreturn)); - KEEP (*(.exceptions.notirq.label)); - KEEP (*(.exceptions.notirq.user)); - KEEP (*(.exceptions.notirq)); - KEEP (*(.exceptions.soft.user)); - KEEP (*(.exceptions.soft)); - KEEP (*(.exceptions.unknown.user)); - KEEP (*(.exceptions.unknown)); - KEEP (*(.exceptions.exit.label)); - KEEP (*(.exceptions.exit.user)); - KEEP (*(.exceptions.exit)); - KEEP (*(.exceptions)); - PROVIDE (__ram_exceptions_end = ABSOLUTE(.)); - } > onchip_memory - - PROVIDE (__flash_exceptions_start = LOADADDR(.exceptions)); - - .text : - { - /* - * All code sections are merged into the text output section, along with - * the read only data sections. - * - */ - - PROVIDE (stext = ABSOLUTE(.)); - - *(.interp) - *(.hash) - *(.dynsym) - *(.dynstr) - *(.gnu.version) - *(.gnu.version_d) - *(.gnu.version_r) - *(.rel.init) - *(.rela.init) - *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) - *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) - *(.rel.fini) - *(.rela.fini) - *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) - *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) - *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) - *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) - *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) - *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) - *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) - *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) - *(.rel.ctors) - *(.rela.ctors) - *(.rel.dtors) - *(.rela.dtors) - *(.rel.got) - *(.rela.got) - *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) - *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) - *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) - *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) - *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) - *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) - *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) - *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) - *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) - *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) - *(.rel.plt) - *(.rela.plt) - *(.rel.dyn) - - KEEP (*(.init)) - *(.plt) - *(.text .stub .text.* .gnu.linkonce.t.*) - - /* .gnu.warning sections are handled specially by elf32.em. */ - - *(.gnu.warning.*) - KEEP (*(.fini)) - PROVIDE (__etext = ABSOLUTE(.)); - PROVIDE (_etext = ABSOLUTE(.)); - PROVIDE (etext = ABSOLUTE(.)); - - *(.eh_frame_hdr) - /* Ensure the __preinit_array_start label is properly aligned. We - could instead move the label definition inside the section, but - the linker would then create the section even if it turns out to - be empty, which isn't pretty. */ - . = ALIGN(4); - PROVIDE (__preinit_array_start = ABSOLUTE(.)); - *(.preinit_array) - PROVIDE (__preinit_array_end = ABSOLUTE(.)); - PROVIDE (__init_array_start = ABSOLUTE(.)); - *(.init_array) - PROVIDE (__init_array_end = ABSOLUTE(.)); - PROVIDE (__fini_array_start = ABSOLUTE(.)); - *(.fini_array) - PROVIDE (__fini_array_end = ABSOLUTE(.)); - SORT(CONSTRUCTORS) - KEEP (*(.eh_frame)) - *(.gcc_except_table) - *(.dynamic) - PROVIDE (__CTOR_LIST__ = ABSOLUTE(.)); - KEEP (*(.ctors)) - KEEP (*(SORT(.ctors.*))) - PROVIDE (__CTOR_END__ = ABSOLUTE(.)); - PROVIDE (__DTOR_LIST__ = ABSOLUTE(.)); - KEEP (*(.dtors)) - KEEP (*(SORT(.dtors.*))) - PROVIDE (__DTOR_END__ = ABSOLUTE(.)); - KEEP (*(.jcr)) - . = ALIGN(4); - } > onchip_memory = 0x3a880100 /* Nios II NOP instruction */ - - .rodata : - { - PROVIDE (__ram_rodata_start = ABSOLUTE(.)); - . = ALIGN(4); - *(.rodata .rodata.* .gnu.linkonce.r.*) - *(.rodata1) - . = ALIGN(4); - PROVIDE (__ram_rodata_end = ABSOLUTE(.)); - } > onchip_memory - - PROVIDE (__flash_rodata_start = LOADADDR(.rodata)); - - /* - * - * This section's LMA is set to the .text region. - * crt0 will copy to this section's specified mapped region virtual memory address (VMA) - * - * .rwdata region equals the .text region, and is set to be loaded into .text region. - * This requires two copies of .rwdata in the .text region. One read writable at VMA. - * and one read-only at LMA. crt0 will copy from LMA to VMA on reset - * - */ - - .rwdata LOADADDR (.rodata) + SIZEOF (.rodata) : AT ( LOADADDR (.rodata) + SIZEOF (.rodata)+ SIZEOF (.rwdata) ) - { - PROVIDE (__ram_rwdata_start = ABSOLUTE(.)); - . = ALIGN(4); - *(.got.plt) *(.got) - *(.data1) - *(.data .data.* .gnu.linkonce.d.*) - - _gp = ABSOLUTE(. + 0x8000); - PROVIDE(gp = _gp); - - *(.rwdata .rwdata.*) - *(.sdata .sdata.* .gnu.linkonce.s.*) - *(.sdata2 .sdata2.* .gnu.linkonce.s2.*) - - . = ALIGN(4); - _edata = ABSOLUTE(.); - PROVIDE (edata = ABSOLUTE(.)); - PROVIDE (__ram_rwdata_end = ABSOLUTE(.)); - } > onchip_memory - - PROVIDE (__flash_rwdata_start = LOADADDR(.rwdata)); - - /* - * - * This section's LMA is set to the .text region. - * crt0 will copy to this section's specified mapped region virtual memory address (VMA) - * - */ - - .bss LOADADDR (.rwdata) + SIZEOF (.rwdata) : AT ( LOADADDR (.rwdata) + SIZEOF (.rwdata) ) - { - __bss_start = ABSOLUTE(.); - PROVIDE (__sbss_start = ABSOLUTE(.)); - PROVIDE (___sbss_start = ABSOLUTE(.)); - - *(.dynsbss) - *(.sbss .sbss.* .gnu.linkonce.sb.*) - *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) - *(.scommon) - - PROVIDE (__sbss_end = ABSOLUTE(.)); - PROVIDE (___sbss_end = ABSOLUTE(.)); - - *(.dynbss) - *(.bss .bss.* .gnu.linkonce.b.*) - *(COMMON) - - . = ALIGN(4); - __bss_end = ABSOLUTE(.); - } > onchip_memory - - /* - * - * One output section mapped to the associated memory device for each of - * the available memory devices. These are not used by default, but can - * be used by user applications by using the .section directive. - * - * The output section used for the heap is treated in a special way, - * i.e. the symbols "end" and "_end" are added to point to the heap start. - * - * Because alt_load() is enabled, these sections have - * their LMA set to be loaded into the .text memory region. - * However, the alt_load() code will NOT automatically copy - * these sections into their mapped memory region. - * - */ - - /* - * - * This section's LMA is set to the .text region. - * crt0 will copy to this section's specified mapped region virtual memory address (VMA) - * - */ - - .onchip_memory LOADADDR (.bss) + SIZEOF (.bss) : AT ( LOADADDR (.bss) + SIZEOF (.bss) ) - { - PROVIDE (_alt_partition_onchip_memory_start = ABSOLUTE(.)); - *(.onchip_memory. onchip_memory.*) - . = ALIGN(4); - PROVIDE (_alt_partition_onchip_memory_end = ABSOLUTE(.)); - _end = ABSOLUTE(.); - end = ABSOLUTE(.); - __alt_stack_base = ABSOLUTE(.); - } > onchip_memory - - PROVIDE (_alt_partition_onchip_memory_load_addr = LOADADDR(.onchip_memory)); - - /* - * Stabs debugging sections. - * - */ - - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - /* DWARF debug sections. - Symbols in the DWARF debugging sections are relative to the beginning - of the section so we begin them at 0. */ - /* DWARF 1 */ - .debug 0 : { *(.debug) } - .line 0 : { *(.line) } - /* GNU DWARF 1 extensions */ - .debug_srcinfo 0 : { *(.debug_srcinfo) } - .debug_sfnames 0 : { *(.debug_sfnames) } - /* DWARF 1.1 and DWARF 2 */ - .debug_aranges 0 : { *(.debug_aranges) } - .debug_pubnames 0 : { *(.debug_pubnames) } - /* DWARF 2 */ - .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_line 0 : { *(.debug_line) } - .debug_frame 0 : { *(.debug_frame) } - .debug_str 0 : { *(.debug_str) } - .debug_loc 0 : { *(.debug_loc) } - .debug_macinfo 0 : { *(.debug_macinfo) } - /* SGI/MIPS DWARF 2 extensions */ - .debug_weaknames 0 : { *(.debug_weaknames) } - .debug_funcnames 0 : { *(.debug_funcnames) } - .debug_typenames 0 : { *(.debug_typenames) } - .debug_varnames 0 : { *(.debug_varnames) } - - /* Altera debug extensions */ - .debug_alt_sim_info 0 : { *(.debug_alt_sim_info) } -} - -/* provide a pointer for the stack */ - -/* - * Don't override this, override the __alt_stack_* symbols instead. - */ -__alt_data_end = 0x1000; - -/* - * The next two symbols define the location of the default stack. You can - * override them to move the stack to a different memory. - */ -PROVIDE( __alt_stack_pointer = __alt_data_end ); -PROVIDE( __alt_stack_limit = __alt_stack_base ); - -/* - * This symbol controls where the start of the heap is. If the stack is - * contiguous with the heap then the stack will contract as memory is - * allocated to the heap. - * Override this symbol to put the heap in a different memory. - */ -PROVIDE( __alt_heap_start = end ); -PROVIDE( __alt_heap_limit = 0x1000 ); diff --git a/software/qsys_tutorial_hexs_bsp/mem_init.mk b/software/qsys_tutorial_hexs_bsp/mem_init.mk deleted file mode 100644 index 4caaef9..0000000 --- a/software/qsys_tutorial_hexs_bsp/mem_init.mk +++ /dev/null @@ -1,322 +0,0 @@ - -######################################################################### -####### M E M I N I T M A K E F I L E C O N T E N T ###### -######################################################################### - -######################################################################### -# This file is intended to be included by public.mk -# -# -# The following variables must be defined before including this file: -# - ELF -# -# The following variables may be defined to override the default behavior: -# - HDL_SIM_DIR -# - HDL_SIM_INSTALL_DIR -# - MEM_INIT_DIR -# - MEM_INIT_INSTALL_DIR -# - QUARTUS_PROJECT_DIR -# - SOPC_NAME -# - SIM_OPTIMIZE -# - RESET_ADDRESS -# -######################################################################### - -ifeq ($(MEM_INIT_FILE),) -# MEM_INIT_FILE should be set equal to the working relative path to this -# mem_init.mk makefile fragment -MEM_INIT_FILE := $(wildcard $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))) -endif - -ifeq ($(ELF2DAT),) -ELF2DAT := elf2dat -endif - -ifeq ($(ELF2HEX),) -ELF2HEX := elf2hex -endif - -ifeq ($(ELF2FLASH),) -ELF2FLASH := elf2flash -endif - -ifeq ($(FLASH2DAT),) -FLASH2DAT := flash2dat -endif - -ifeq ($(NM),) -NM := nios2-elf-nm -endif - -ifeq ($(MKDIR),) -MKDIR := mkdir -p -endif - -ifeq ($(RM),) -RM := rm -f -endif - -ifeq ($(CP),) -CP := cp -endif - -ifeq ($(ECHO),) -ECHO := echo -endif - -MEM_INIT_DIR ?= mem_init -HDL_SIM_DIR ?= $(MEM_INIT_DIR)/hdl_sim - -ifdef QUARTUS_PROJECT_DIR -MEM_INIT_INSTALL_DIR ?= $(patsubst %/,%,$(QUARTUS_PROJECT_DIR)) -ifdef SOPC_NAME -HDL_SIM_INSTALL_DIR ?= $(patsubst %/,%,$(QUARTUS_PROJECT_DIR))/$(SOPC_NAME)_sim -endif -endif - -MEM_INIT_DESCRIPTOR_FILE ?= $(MEM_INIT_DIR)/meminit.spd - -MEM_INIT_QIP_FILE ?= $(MEM_INIT_DIR)/meminit.qip - -#------------------------------------- -# Default Flash Boot Loaders -#------------------------------------- - -BOOT_LOADER_PATH ?= $(SOPC_KIT_NIOS2)/components/altera_nios2 -BOOT_LOADER_CFI ?= $(BOOT_LOADER_PATH)/boot_loader_cfi.srec -BOOT_LOADER_CFI_BE ?= $(BOOT_LOADER_PATH)/boot_loader_cfi_be.srec - - -#------------------------------------- -# Default Target -#------------------------------------- - -.PHONY: default_mem_init -ifeq ($(QSYS),1) -default_mem_init: mem_init_generate -else -default_mem_init: mem_init_install -endif -#------------------------------------- -# Runtime Macros -#------------------------------------- - -define post-process-info - @echo Post-processing to create $@... -endef - -target_stem = $(notdir $(basename $@)) - -mem_start_address = $($(target_stem)_START) -mem_end_address = $($(target_stem)_END) -mem_width = $($(target_stem)_WIDTH) -mem_endianness = $($(target_stem)_ENDIANNESS) -mem_create_lanes = $($(target_stem)_CREATE_LANES) - -mem_pad_flag = $($(target_stem)_PAD_FLAG) -mem_reloc_input_flag = $($(target_stem)_RELOC_INPUT_FLAG) -mem_no_zero_fill_flag = $($(target_stem)_NO_ZERO_FILL_FLAG) - -flash_mem_epcs_flag = $($(target_stem)_EPCS_FLAGS) -flash_mem_cfi_flag = $($(target_stem)_CFI_FLAGS) -flash_mem_boot_loader_flag = $($(target_stem)_BOOT_LOADER_FLAG) - -elf2dat_extra_args = $(mem_pad_flag) -elf2hex_extra_args = $(mem_no_zero_fill_flag) -elf2flash_extra_args = $(flash_mem_cfi_flag) $(flash_mem_epcs_flag) $(flash_mem_boot_loader_flag) -flash2dat_extra_args = $(mem_pad_flag) $(mem_reloc_input_flag) - -#------------------------------------------------------------------------------ -# BSP SPECIFIC CONTENT -# -# The content below is controlled by the BSP and SOPC System -#------------------------------------------------------------------------------ -#START OF BSP SPECIFIC - -#------------------------------------- -# Global Settings -#------------------------------------- - - -# The following TYPE comment allows tools to identify the 'type' of target this -# makefile is associated with. -# TYPE: BSP_MEMINIT_MAKEFILE - -# This following VERSION comment indicates the version of the tool used to -# generate this makefile. A makefile variable is provided for VERSION as well. -# ACDS_VERSION: 13.0sp1 -ACDS_VERSION := 13.0sp1 - -# This following BUILD_NUMBER comment indicates the build number of the tool -# used to generate this makefile. -# BUILD_NUMBER: 232 - -# Optimize for simulation -SIM_OPTIMIZE ?= 0 - -# The CPU reset address as needed by elf2flash -RESET_ADDRESS ?= 0x00000000 - -#------------------------------------- -# Pre-Initialized Memory Descriptions -#------------------------------------- - -# Memory: onchip_memory -MEM_0 := nios_system_onchip_memory -$(MEM_0)_NAME := onchip_memory -$(MEM_0)_MEM_INIT_FILE_PARAM_NAME := INIT_FILE -HEX_FILES += $(MEM_INIT_DIR)/$(MEM_0).hex -MEM_INIT_INSTALL_FILES += $(MEM_INIT_INSTALL_DIR)/$(MEM_0).hex -DAT_FILES += $(HDL_SIM_DIR)/$(MEM_0).dat -HDL_SIM_INSTALL_FILES += $(HDL_SIM_INSTALL_DIR)/$(MEM_0).dat -SYM_FILES += $(HDL_SIM_DIR)/$(MEM_0).sym -HDL_SIM_INSTALL_FILES += $(HDL_SIM_INSTALL_DIR)/$(MEM_0).sym -$(MEM_0)_START := 0x00000000 -$(MEM_0)_END := 0x00000fff -$(MEM_0)_HIERARCHICAL_PATH := onchip_memory -$(MEM_0)_WIDTH := 32 -$(MEM_0)_ENDIANNESS := --little-endian-mem -$(MEM_0)_CREATE_LANES := 0 - -.PHONY: onchip_memory -onchip_memory: check_elf_exists $(MEM_INIT_DIR)/$(MEM_0).hex $(HDL_SIM_DIR)/$(MEM_0).dat $(HDL_SIM_DIR)/$(MEM_0).sym - - -#END OF BSP SPECIFIC - -#------------------------------------- -# Pre-Initialized Memory Targets -#------------------------------------- - -.PHONY: mem_init_install mem_init_generate mem_init_clean - -ifeq ($(QSYS),1) -# Target mem_init_install is deprecated for QSys based systems -# To initialize onchip memories for Quartus II Synthesis with Qsys based systems: -# 1) Use "make mem_init_genearate" -# 2) Add the generated mem_init/meminit.qip file to your Quartus II Project -# -mem_init_install: - $(error Deprecated Makefile Target: '$@'. Use target 'mem_init_generate' and then add $(MEM_INIT_QIP_FILE) to your Quartus II Project) - -else # QSYS != 1, if SopcBuilder based system - -ifneq ($(MEM_INIT_INSTALL_DIR),) -mem_init_install: $(MEM_INIT_INSTALL_FILES) -endif - -ifneq ($(HDL_SIM_INSTALL_DIR),) -mem_init_install: $(HDL_SIM_INSTALL_FILES) -endif - -mem_init_install: mem_init_generate -ifeq ($(MEM_INIT_INSTALL_DIR),) - @echo "WARNING: MEM_INIT_INSTALL_DIR not set. Set your QUARTUS_PROJECT_DIR environment variable." -endif -ifeq ($(HDL_SIM_INSTALL_DIR),) - @echo "WARNING: HDL_SIM_INSTALL_DIR not set. Set your QUARTUS_PROJECT_DIR and SOPC_NAME environment variable." -endif - -$(MEM_INIT_INSTALL_FILES): $(MEM_INIT_INSTALL_DIR)/%: $(MEM_INIT_DIR)/% - @$(MKDIR) $(@D) - @$(CP) -v $< $@ - -$(HDL_SIM_INSTALL_FILES): $(HDL_SIM_INSTALL_DIR)/%: $(HDL_SIM_DIR)/% - @$(MKDIR) $(@D) - @$(CP) -v $< $@ - -endif # QSYS == 1 - - -mem_init_generate: hex dat sym flash $(MEM_INIT_DESCRIPTOR_FILE) $(MEM_INIT_QIP_FILE) - -mem_init_clean: - @$(RM) -r $(MEM_INIT_DIR) $(HDL_SIM_DIR) $(FLASH_FILES) - -.PHONY: hex dat sym flash - -hex: check_elf_exists $(HEX_FILES) - -dat: check_elf_exists $(DAT_FILES) - -sym: check_elf_exists $(SYM_FILES) - -flash: check_elf_exists $(FLASH_FILES) - -#------------------------------------- -# Pre-Initialized Memory Rules -#------------------------------------- - -.PHONY: check_elf_exists -check_elf_exists: $(ELF) -ifeq ($(ELF),) - $(error ELF var not set in mem_init.mk) -endif - -$(filter-out $(FLASH_DAT_FILES),$(DAT_FILES)): %.dat: $(ELF) - $(post-process-info) - @$(MKDIR) $(@D) - bash -c '$(ELF2DAT) --infile=$< --outfile=$@ \ - --base=$(mem_start_address) --end=$(mem_end_address) --width=$(mem_width) \ - $(mem_endianness) --create-lanes=$(mem_create_lanes) $(elf2dat_extra_args)' - -$(foreach i,0 1 2 3 4 5 6 7,%_lane$(i).dat): %.dat - @true - -$(HEX_FILES): %.hex: $(ELF) - $(post-process-info) - @$(MKDIR) $(@D) - bash -c '$(ELF2HEX) $< $(mem_start_address) $(mem_end_address) --width=$(mem_width) \ - $(mem_endianness) --create-lanes=$(mem_create_lanes) $(elf2hex_extra_args) $@' - -$(SYM_FILES): %.sym: $(ELF) - $(post-process-info) - @$(MKDIR) $(@D) - $(NM) -n $< > $@ - -$(FLASH_FILES): %.flash: $(ELF) - $(post-process-info) - @$(MKDIR) $(@D) - bash -c '$(ELF2FLASH) --input=$< --outfile=$@ --sim_optimize=$(SIM_OPTIMIZE) $(mem_endianness) \ - $(elf2flash_extra_args)' - -# -# Function generate_spd_entry -# Arg1: path to the memory initialization file -# Arg2: Type HEX or DAT -# Arg3: Output spd file to append -gen_spd_entry.BASE_FILE = $(basename $(notdir $1)) -gen_spd_entry.PARAM_NAME = $($(gen_spd_entry.BASE_FILE)_MEM_INIT_FILE_PARAM_NAME) -gen_spd_entry.MEM_PATH = $($(gen_spd_entry.BASE_FILE)_HIERARCHICAL_PATH) -gen_spd_entry.SETTINGS = $(strip \ - path=\"$1\" \ - type=\"$2\" \ - $(if $(gen_spd_entry.PARAM_NAME),initParamName=\"$(gen_spd_entry.PARAM_NAME)\") \ - $(if $(gen_spd_entry.MEM_PATH),memoryPath=\"$(gen_spd_entry.MEM_PATH)\") \ -) -define gen_spd_entry -$(ECHO) "" >> $3 -endef - -$(MEM_INIT_DESCRIPTOR_FILE).DAT_FILESET := $(patsubst $(dir $(MEM_INIT_DESCRIPTOR_FILE))%,%,$(DAT_FILES)) -$(MEM_INIT_DESCRIPTOR_FILE).HEX_FILESET := $(patsubst $(dir $(MEM_INIT_DESCRIPTOR_FILE))%,%,$(HEX_FILES)) - -$(MEM_INIT_DESCRIPTOR_FILE): %.spd: $(MEM_INIT_FILE) - $(post-process-info) - @$(MKDIR) $(@D) - @$(RM) $@ - @$(ECHO) "" > $@ - @$(ECHO) "" >> $@ - @$(foreach dat_file,$($@.DAT_FILESET),$(call gen_spd_entry,$(dat_file),DAT,$@) &&)true - @$(foreach hex_file,$($@.HEX_FILESET),$(call gen_spd_entry,$(hex_file),HEX,$@) &&)true - @$(ECHO) "" >> $@ - -.DELETE_ON_ERROR: $(MEM_INIT_DESCRIPTOR_FILE) - -$(MEM_INIT_QIP_FILE): %.qip: $(MEM_INIT_FILE) - $(post-process-info) - @$(MKDIR) $(@D) - @$(RM) $@ - @$(ECHO) "set_global_assignment -name SEARCH_PATH $$::quartus(qip_path)" > $@ - -.DELETE_ON_ERROR: $(MEM_INIT_QIP_FILE) diff --git a/software/qsys_tutorial_hexs_bsp/memory.gdb b/software/qsys_tutorial_hexs_bsp/memory.gdb deleted file mode 100644 index 6e6623b..0000000 --- a/software/qsys_tutorial_hexs_bsp/memory.gdb +++ /dev/null @@ -1,50 +0,0 @@ -# memory.gdb - GDB memory region definitions -# -# Machine generated for CPU 'nios2_processor' in SOPC Builder design 'nios_system' -# SOPC Builder design path: C:/Users/takayun/Documents/DE2-115/qsys_tutorial/nios_system.sopcinfo -# -# Generated: Thu Nov 17 09:38:43 JST 2016 - -# DO NOT MODIFY THIS FILE -# -# Changing this file will have subtle consequences -# which will almost certainly lead to a nonfunctioning -# system. If you do modify this file, be aware that your -# changes will be overwritten and lost when this file -# is generated again. -# -# DO NOT MODIFY THIS FILE - -# License Agreement -# -# Copyright (c) 2008 -# Altera Corporation, San Jose, California, USA. -# All rights reserved. -# -# 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. -# -# This agreement shall be governed in all respects by the laws of the State -# of California and by the laws of the United States of America. - -# Define memory regions for each memory connected to the CPU. -# The cache attribute is specified which improves GDB performance -# by allowing GDB to cache memory contents on the host. - -# onchip_memory -memory 0x0 0x1000 cache diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_alarm_start.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_alarm_start.d deleted file mode 100644 index 3bb20ea..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_alarm_start.d +++ /dev/null @@ -1,22 +0,0 @@ -obj/HAL/src/alt_alarm_start.o: HAL/src/alt_alarm_start.c \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h system.h linker.h - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_alarm_start.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_alarm_start.o deleted file mode 100644 index 69f3a3b..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_alarm_start.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_busy_sleep.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_busy_sleep.d deleted file mode 100644 index e93e80c..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_busy_sleep.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_busy_sleep.o: HAL/src/alt_busy_sleep.c system.h linker.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_busy_sleep.h - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_busy_sleep.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_busy_sleep.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_busy_sleep.o deleted file mode 100644 index 26273d4..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_busy_sleep.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_close.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_close.d deleted file mode 100644 index fbbab9c..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_close.d +++ /dev/null @@ -1,34 +0,0 @@ -obj/HAL/src/alt_close.o: HAL/src/alt_close.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h \ - HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_close.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_close.o deleted file mode 100644 index 6f3efa8..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_close.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_dcache_flush.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_dcache_flush.d deleted file mode 100644 index a0eaf8a..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_dcache_flush.d +++ /dev/null @@ -1,15 +0,0 @@ -obj/HAL/src/alt_dcache_flush.o: HAL/src/alt_dcache_flush.c \ - HAL/inc/nios2.h system.h linker.h HAL/inc/alt_types.h \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h - -HAL/inc/nios2.h: - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_dcache_flush.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_dcache_flush.o deleted file mode 100644 index b2a836f..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_dcache_flush.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_dcache_flush_all.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_dcache_flush_all.d deleted file mode 100644 index 792c3e4..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_dcache_flush_all.d +++ /dev/null @@ -1,15 +0,0 @@ -obj/HAL/src/alt_dcache_flush_all.o: HAL/src/alt_dcache_flush_all.c \ - HAL/inc/nios2.h system.h linker.h HAL/inc/alt_types.h \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h - -HAL/inc/nios2.h: - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_dcache_flush_all.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_dcache_flush_all.o deleted file mode 100644 index 023ade7..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_dcache_flush_all.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_dcache_flush_no_writeback.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_dcache_flush_no_writeback.d deleted file mode 100644 index 867c42b..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_dcache_flush_no_writeback.d +++ /dev/null @@ -1,16 +0,0 @@ -obj/HAL/src/alt_dcache_flush_no_writeback.o: \ - HAL/src/alt_dcache_flush_no_writeback.c HAL/inc/nios2.h system.h \ - linker.h HAL/inc/alt_types.h HAL/inc/sys/alt_cache.h \ - HAL/inc/alt_types.h - -HAL/inc/nios2.h: - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_dcache_flush_no_writeback.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_dcache_flush_no_writeback.o deleted file mode 100644 index 264c9eb..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_dcache_flush_no_writeback.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_dev.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_dev.d deleted file mode 100644 index cd9b1d4..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_dev.d +++ /dev/null @@ -1,34 +0,0 @@ -obj/HAL/src/alt_dev.o: HAL/src/alt_dev.c HAL/inc/sys/alt_dev.h system.h \ - linker.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h \ - HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h HAL/inc/alt_types.h \ - system.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/alt_types.h: - -system.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_dev.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_dev.o deleted file mode 100644 index 49133c5..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_dev.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_dev_llist_insert.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_dev_llist_insert.d deleted file mode 100644 index 344d065..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_dev_llist_insert.d +++ /dev/null @@ -1,13 +0,0 @@ -obj/HAL/src/alt_dev_llist_insert.o: HAL/src/alt_dev_llist_insert.c \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/alt_types.h HAL/inc/sys/alt_errno.h - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_errno.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_dev_llist_insert.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_dev_llist_insert.o deleted file mode 100644 index 955a9a1..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_dev_llist_insert.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_dma_rxchan_open.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_dma_rxchan_open.d deleted file mode 100644 index fb21fed..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_dma_rxchan_open.d +++ /dev/null @@ -1,35 +0,0 @@ -obj/HAL/src/alt_dma_rxchan_open.o: HAL/src/alt_dma_rxchan_open.c \ - HAL/inc/sys/alt_dma.h HAL/inc/sys/alt_dma_dev.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/alt_types.h HAL/inc/sys/alt_errno.h \ - HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h system.h linker.h \ - HAL/inc/sys/alt_llist.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h - -HAL/inc/sys/alt_dma.h: - -HAL/inc/sys/alt_dma_dev.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_errno.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_dma_rxchan_open.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_dma_rxchan_open.o deleted file mode 100644 index 7404338..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_dma_rxchan_open.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_dma_txchan_open.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_dma_txchan_open.d deleted file mode 100644 index 500b95c..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_dma_txchan_open.d +++ /dev/null @@ -1,35 +0,0 @@ -obj/HAL/src/alt_dma_txchan_open.o: HAL/src/alt_dma_txchan_open.c \ - HAL/inc/sys/alt_dma.h HAL/inc/sys/alt_dma_dev.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/alt_types.h HAL/inc/sys/alt_errno.h \ - HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h system.h linker.h \ - HAL/inc/sys/alt_llist.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h - -HAL/inc/sys/alt_dma.h: - -HAL/inc/sys/alt_dma_dev.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_errno.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_dma_txchan_open.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_dma_txchan_open.o deleted file mode 100644 index 9811e6c..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_dma_txchan_open.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_do_ctors.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_do_ctors.d deleted file mode 100644 index daf8baf..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_do_ctors.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_do_ctors.o: HAL/src/alt_do_ctors.c diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_do_ctors.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_do_ctors.o deleted file mode 100644 index a01cd14..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_do_ctors.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_do_dtors.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_do_dtors.d deleted file mode 100644 index c3471eb..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_do_dtors.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_do_dtors.o: HAL/src/alt_do_dtors.c diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_do_dtors.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_do_dtors.o deleted file mode 100644 index 267e5dd..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_do_dtors.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_env_lock.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_env_lock.d deleted file mode 100644 index 634d7b0..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_env_lock.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_env_lock.o: HAL/src/alt_env_lock.c diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_env_lock.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_env_lock.o deleted file mode 100644 index bbd9da2..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_env_lock.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_environ.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_environ.d deleted file mode 100644 index e9ca295..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_environ.d +++ /dev/null @@ -1,3 +0,0 @@ -obj/HAL/src/alt_environ.o: HAL/src/alt_environ.c HAL/inc/os/alt_syscall.h - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_environ.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_environ.o deleted file mode 100644 index 1fc5cb1..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_environ.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_errno.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_errno.d deleted file mode 100644 index 29ca544..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_errno.d +++ /dev/null @@ -1,8 +0,0 @@ -obj/HAL/src/alt_errno.o: HAL/src/alt_errno.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/alt_types.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_errno.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_errno.o deleted file mode 100644 index 10ef546..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_errno.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_exception_entry.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_exception_entry.d deleted file mode 100644 index 540567e..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_exception_entry.d +++ /dev/null @@ -1,6 +0,0 @@ -obj/HAL/src/alt_exception_entry.o: HAL/src/alt_exception_entry.S system.h \ - linker.h - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_exception_entry.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_exception_entry.o deleted file mode 100644 index 60ab912..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_exception_entry.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_exception_muldiv.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_exception_muldiv.d deleted file mode 100644 index 63d66a7..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_exception_muldiv.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_exception_muldiv.o: HAL/src/alt_exception_muldiv.S diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_exception_muldiv.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_exception_muldiv.o deleted file mode 100644 index 34d3093..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_exception_muldiv.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_exception_trap.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_exception_trap.d deleted file mode 100644 index 6e18488..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_exception_trap.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_exception_trap.o: HAL/src/alt_exception_trap.S diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_exception_trap.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_exception_trap.o deleted file mode 100644 index 9064823..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_exception_trap.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_execve.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_execve.d deleted file mode 100644 index 9cef7d2..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_execve.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_execve.o: HAL/src/alt_execve.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_execve.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_execve.o deleted file mode 100644 index 6b014d8..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_execve.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_exit.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_exit.d deleted file mode 100644 index a779da8..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_exit.d +++ /dev/null @@ -1,26 +0,0 @@ -obj/HAL/src/alt_exit.o: HAL/src/alt_exit.c HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h HAL/inc/alt_types.h system.h linker.h \ - HAL/inc/sys/alt_sim.h HAL/inc/os/alt_hooks.h HAL/inc/os/alt_syscall.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_log_printf.h system.h - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_sim.h: - -HAL/inc/os/alt_hooks.h: - -HAL/inc/os/alt_syscall.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_exit.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_exit.o deleted file mode 100644 index 4175c1b..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_exit.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_fcntl.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_fcntl.d deleted file mode 100644 index 527f242..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_fcntl.d +++ /dev/null @@ -1,34 +0,0 @@ -obj/HAL/src/alt_fcntl.o: HAL/src/alt_fcntl.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h \ - system.h linker.h HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/alt_types.h \ - HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_fcntl.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_fcntl.o deleted file mode 100644 index 553217a..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_fcntl.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_fd_lock.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_fd_lock.d deleted file mode 100644 index 93daeac..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_fd_lock.d +++ /dev/null @@ -1,27 +0,0 @@ -obj/HAL/src/alt_fd_lock.o: HAL/src/alt_fd_lock.c HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_fd_lock.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_fd_lock.o deleted file mode 100644 index 2f58903..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_fd_lock.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_fd_unlock.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_fd_unlock.d deleted file mode 100644 index 45a3207..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_fd_unlock.d +++ /dev/null @@ -1,27 +0,0 @@ -obj/HAL/src/alt_fd_unlock.o: HAL/src/alt_fd_unlock.c \ - HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h system.h linker.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_fd_unlock.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_fd_unlock.o deleted file mode 100644 index e19aa05..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_fd_unlock.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_find_dev.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_find_dev.d deleted file mode 100644 index 98336f8..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_find_dev.d +++ /dev/null @@ -1,31 +0,0 @@ -obj/HAL/src/alt_find_dev.o: HAL/src/alt_find_dev.c HAL/inc/sys/alt_dev.h \ - system.h linker.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h \ - HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h HAL/inc/alt_types.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_find_dev.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_find_dev.o deleted file mode 100644 index 41e7ae4..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_find_dev.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_find_file.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_find_file.d deleted file mode 100644 index d1150ca..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_find_file.d +++ /dev/null @@ -1,32 +0,0 @@ -obj/HAL/src/alt_find_file.o: HAL/src/alt_find_file.c \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h \ - HAL/inc/alt_types.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_find_file.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_find_file.o deleted file mode 100644 index 2466258..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_find_file.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_flash_dev.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_flash_dev.d deleted file mode 100644 index 8835e8f..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_flash_dev.d +++ /dev/null @@ -1,34 +0,0 @@ -obj/HAL/src/alt_flash_dev.o: HAL/src/alt_flash_dev.c \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/sys/alt_flash_dev.h \ - HAL/inc/sys/alt_flash_types.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h \ - system.h linker.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_flash_dev.h: - -HAL/inc/sys/alt_flash_types.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_flash_dev.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_flash_dev.o deleted file mode 100644 index 5d639ce..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_flash_dev.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_fork.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_fork.d deleted file mode 100644 index 492be65..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_fork.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_fork.o: HAL/src/alt_fork.c HAL/inc/sys/alt_warning.h \ - HAL/inc/sys/alt_errno.h HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_warning.h: - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_fork.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_fork.o deleted file mode 100644 index 3e7fe7a..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_fork.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_fs_reg.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_fs_reg.d deleted file mode 100644 index d8f95ab..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_fs_reg.d +++ /dev/null @@ -1,29 +0,0 @@ -obj/HAL/src/alt_fs_reg.o: HAL/src/alt_fs_reg.c HAL/inc/sys/alt_dev.h \ - system.h linker.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h \ - HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_fs_reg.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_fs_reg.o deleted file mode 100644 index 03dc454..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_fs_reg.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_fstat.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_fstat.d deleted file mode 100644 index 942fcbc..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_fstat.d +++ /dev/null @@ -1,38 +0,0 @@ -obj/HAL/src/alt_fstat.o: HAL/src/alt_fstat.c HAL/inc/sys/alt_dev.h \ - system.h linker.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/sys/alt_errno.h \ - HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_syscall.h system.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/sys/alt_errno.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_syscall.h: - -system.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_fstat.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_fstat.o deleted file mode 100644 index 35c02c5..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_fstat.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_get_fd.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_get_fd.d deleted file mode 100644 index 9a4daaa..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_get_fd.d +++ /dev/null @@ -1,34 +0,0 @@ -obj/HAL/src/alt_get_fd.o: HAL/src/alt_get_fd.c HAL/inc/sys/alt_dev.h \ - system.h linker.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h \ - HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h HAL/inc/alt_types.h \ - system.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/alt_types.h: - -system.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_get_fd.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_get_fd.o deleted file mode 100644 index 3501e2b..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_get_fd.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_getchar.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_getchar.d deleted file mode 100644 index bcccdf7..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_getchar.d +++ /dev/null @@ -1,34 +0,0 @@ -obj/HAL/src/alt_getchar.o: HAL/src/alt_getchar.c system.h linker.h \ - HAL/inc/sys/alt_driver.h HAL/inc/sys/alt_stdio.h \ - HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h system.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h - -system.h: - -linker.h: - -HAL/inc/sys/alt_driver.h: - -HAL/inc/sys/alt_stdio.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_getchar.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_getchar.o deleted file mode 100644 index 69c55fc..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_getchar.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_getpid.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_getpid.d deleted file mode 100644 index d9499b9..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_getpid.d +++ /dev/null @@ -1,3 +0,0 @@ -obj/HAL/src/alt_getpid.o: HAL/src/alt_getpid.c HAL/inc/os/alt_syscall.h - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_getpid.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_getpid.o deleted file mode 100644 index 01efb1a..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_getpid.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_gettod.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_gettod.d deleted file mode 100644 index cf3cf34..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_gettod.d +++ /dev/null @@ -1,17 +0,0 @@ -obj/HAL/src/alt_gettod.o: HAL/src/alt_gettod.c HAL/inc/sys/alt_alarm.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/priv/alt_alarm.h \ - HAL/inc/alt_types.h HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_gettod.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_gettod.o deleted file mode 100644 index 7f6381e..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_gettod.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_gmon.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_gmon.d deleted file mode 100644 index e9469ab..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_gmon.d +++ /dev/null @@ -1,24 +0,0 @@ -obj/HAL/src/alt_gmon.o: HAL/src/alt_gmon.c HAL/inc/priv/nios2_gmon_data.h \ - HAL/inc/sys/alt_irq.h HAL/inc/nios2.h HAL/inc/alt_types.h system.h \ - linker.h HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h - -HAL/inc/priv/nios2_gmon_data.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_gmon.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_gmon.o deleted file mode 100644 index 92e7edb..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_gmon.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_icache_flush.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_icache_flush.d deleted file mode 100644 index 2e4ddd1..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_icache_flush.d +++ /dev/null @@ -1,15 +0,0 @@ -obj/HAL/src/alt_icache_flush.o: HAL/src/alt_icache_flush.c \ - HAL/inc/nios2.h system.h linker.h HAL/inc/alt_types.h \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h - -HAL/inc/nios2.h: - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_icache_flush.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_icache_flush.o deleted file mode 100644 index ab1c71d..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_icache_flush.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_icache_flush_all.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_icache_flush_all.d deleted file mode 100644 index 47cfbf3..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_icache_flush_all.d +++ /dev/null @@ -1,15 +0,0 @@ -obj/HAL/src/alt_icache_flush_all.o: HAL/src/alt_icache_flush_all.c \ - HAL/inc/nios2.h system.h linker.h HAL/inc/alt_types.h \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h - -HAL/inc/nios2.h: - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_icache_flush_all.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_icache_flush_all.o deleted file mode 100644 index c03bc17..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_icache_flush_all.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_iic.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_iic.d deleted file mode 100644 index a709e0c..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_iic.d +++ /dev/null @@ -1,29 +0,0 @@ -obj/HAL/src/alt_iic.o: HAL/src/alt_iic.c system.h linker.h \ - HAL/inc/sys/alt_irq.h HAL/inc/nios2.h HAL/inc/alt_types.h system.h \ - HAL/inc/priv/alt_iic_isr_register.h HAL/inc/alt_types.h \ - HAL/inc/sys/alt_irq.h HAL/inc/priv/alt_legacy_irq.h system.h \ - HAL/inc/nios2.h - -system.h: - -linker.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -HAL/inc/priv/alt_iic_isr_register.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/priv/alt_legacy_irq.h: - -system.h: - -HAL/inc/nios2.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_iic.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_iic.o deleted file mode 100644 index b9319d5..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_iic.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_iic_isr_register.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_iic_isr_register.d deleted file mode 100644 index d0470ae..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_iic_isr_register.d +++ /dev/null @@ -1,30 +0,0 @@ -obj/HAL/src/alt_iic_isr_register.o: HAL/src/alt_iic_isr_register.c \ - system.h linker.h HAL/inc/alt_types.h HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h HAL/inc/alt_types.h system.h \ - HAL/inc/priv/alt_iic_isr_register.h HAL/inc/alt_types.h \ - HAL/inc/sys/alt_irq.h HAL/inc/sys/alt_irq_entry.h \ - HAL/inc/priv/alt_irq_table.h - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -HAL/inc/priv/alt_iic_isr_register.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/sys/alt_irq_entry.h: - -HAL/inc/priv/alt_irq_table.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_iic_isr_register.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_iic_isr_register.o deleted file mode 100644 index 0c7b557..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_iic_isr_register.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_instruction_exception_entry.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_instruction_exception_entry.d deleted file mode 100644 index 6d0705f..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_instruction_exception_entry.d +++ /dev/null @@ -1,18 +0,0 @@ -obj/HAL/src/alt_instruction_exception_entry.o: \ - HAL/src/alt_instruction_exception_entry.c HAL/inc/sys/alt_exceptions.h \ - HAL/inc/alt_types.h system.h linker.h HAL/inc/nios2.h \ - HAL/inc/alt_types.h system.h - -HAL/inc/sys/alt_exceptions.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_instruction_exception_entry.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_instruction_exception_entry.o deleted file mode 100644 index fea8b78..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_instruction_exception_entry.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_instruction_exception_register.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_instruction_exception_register.d deleted file mode 100644 index d4fac04..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_instruction_exception_register.d +++ /dev/null @@ -1,16 +0,0 @@ -obj/HAL/src/alt_instruction_exception_register.o: \ - HAL/src/alt_instruction_exception_register.c \ - HAL/inc/sys/alt_exceptions.h HAL/inc/alt_types.h system.h linker.h \ - HAL/inc/alt_types.h system.h - -HAL/inc/sys/alt_exceptions.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -system.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_instruction_exception_register.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_instruction_exception_register.o deleted file mode 100644 index d404ff9..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_instruction_exception_register.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_io_redirect.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_io_redirect.d deleted file mode 100644 index 8228365..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_io_redirect.d +++ /dev/null @@ -1,29 +0,0 @@ -obj/HAL/src/alt_io_redirect.o: HAL/src/alt_io_redirect.c \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_io_redirect.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_io_redirect.o deleted file mode 100644 index 6022dd1..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_io_redirect.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_ioctl.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_ioctl.d deleted file mode 100644 index d70ad97..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_ioctl.d +++ /dev/null @@ -1,41 +0,0 @@ -obj/HAL/src/alt_ioctl.o: HAL/src/alt_ioctl.c HAL/inc/sys/ioctl.h \ - HAL/inc/sys/alt_errno.h HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h \ - HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h system.h linker.h \ - HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_syscall.h system.h \ - HAL/inc/sys/alt_driver.h - -HAL/inc/sys/ioctl.h: - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_syscall.h: - -system.h: - -HAL/inc/sys/alt_driver.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_ioctl.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_ioctl.o deleted file mode 100644 index 8b533d2..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_ioctl.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_irq_entry.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_irq_entry.d deleted file mode 100644 index 9ec3751..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_irq_entry.d +++ /dev/null @@ -1,5 +0,0 @@ -obj/HAL/src/alt_irq_entry.o: HAL/src/alt_irq_entry.S system.h linker.h - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_irq_entry.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_irq_entry.o deleted file mode 100644 index 134b0fb..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_irq_entry.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_irq_handler.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_irq_handler.d deleted file mode 100644 index 6fb668f..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_irq_handler.d +++ /dev/null @@ -1,19 +0,0 @@ -obj/HAL/src/alt_irq_handler.o: HAL/src/alt_irq_handler.c system.h \ - linker.h HAL/inc/sys/alt_irq.h HAL/inc/nios2.h HAL/inc/alt_types.h \ - system.h HAL/inc/os/alt_hooks.h HAL/inc/alt_types.h - -system.h: - -linker.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -HAL/inc/os/alt_hooks.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_irq_handler.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_irq_handler.o deleted file mode 100644 index f5a340f..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_irq_handler.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_irq_register.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_irq_register.d deleted file mode 100644 index 3df2f8a..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_irq_register.d +++ /dev/null @@ -1,36 +0,0 @@ -obj/HAL/src/alt_irq_register.o: HAL/src/alt_irq_register.c system.h \ - linker.h HAL/inc/sys/alt_irq.h HAL/inc/nios2.h HAL/inc/alt_types.h \ - system.h HAL/inc/priv/alt_legacy_irq.h system.h HAL/inc/nios2.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_irq.h HAL/inc/os/alt_hooks.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_irq_entry.h \ - HAL/inc/priv/alt_irq_table.h - -system.h: - -linker.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -HAL/inc/priv/alt_legacy_irq.h: - -system.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/os/alt_hooks.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_irq_entry.h: - -HAL/inc/priv/alt_irq_table.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_irq_register.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_irq_register.o deleted file mode 100644 index cd25c14..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_irq_register.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_irq_vars.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_irq_vars.d deleted file mode 100644 index f316558..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_irq_vars.d +++ /dev/null @@ -1,8 +0,0 @@ -obj/HAL/src/alt_irq_vars.o: HAL/src/alt_irq_vars.c HAL/inc/alt_types.h \ - system.h linker.h - -HAL/inc/alt_types.h: - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_irq_vars.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_irq_vars.o deleted file mode 100644 index 16cb8fd..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_irq_vars.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_isatty.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_isatty.d deleted file mode 100644 index f8b1f07..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_isatty.d +++ /dev/null @@ -1,38 +0,0 @@ -obj/HAL/src/alt_isatty.o: HAL/src/alt_isatty.c HAL/inc/sys/alt_dev.h \ - system.h linker.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_errno.h HAL/inc/sys/alt_warning.h \ - HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_syscall.h system.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_errno.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_syscall.h: - -system.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_isatty.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_isatty.o deleted file mode 100644 index 203368f..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_isatty.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_kill.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_kill.d deleted file mode 100644 index 0c14ae8..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_kill.d +++ /dev/null @@ -1,8 +0,0 @@ -obj/HAL/src/alt_kill.o: HAL/src/alt_kill.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_kill.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_kill.o deleted file mode 100644 index 4c855a7..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_kill.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_link.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_link.d deleted file mode 100644 index dc844c6..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_link.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_link.o: HAL/src/alt_link.c HAL/inc/sys/alt_warning.h \ - HAL/inc/sys/alt_errno.h HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_warning.h: - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_link.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_link.o deleted file mode 100644 index 5cf7164..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_link.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_load.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_load.d deleted file mode 100644 index d496ab8..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_load.d +++ /dev/null @@ -1,8 +0,0 @@ -obj/HAL/src/alt_load.o: HAL/src/alt_load.c HAL/inc/sys/alt_load.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_cache.h - -HAL/inc/sys/alt_load.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_cache.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_load.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_load.o deleted file mode 100644 index 9073c92..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_load.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_log_macro.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_log_macro.d deleted file mode 100644 index 9768c1f..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_log_macro.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_log_macro.o: HAL/src/alt_log_macro.S diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_log_macro.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_log_macro.o deleted file mode 100644 index 489e2cc..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_log_macro.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_log_printf.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_log_printf.d deleted file mode 100644 index 251ff6d..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_log_printf.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_log_printf.o: HAL/src/alt_log_printf.c diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_log_printf.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_log_printf.o deleted file mode 100644 index a03c33d..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_log_printf.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_lseek.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_lseek.d deleted file mode 100644 index 25ed783..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_lseek.d +++ /dev/null @@ -1,34 +0,0 @@ -obj/HAL/src/alt_lseek.o: HAL/src/alt_lseek.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h \ - HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_lseek.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_lseek.o deleted file mode 100644 index 762a6f6..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_lseek.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_main.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_main.d deleted file mode 100644 index afdfda0..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_main.d +++ /dev/null @@ -1,47 +0,0 @@ -obj/HAL/src/alt_main.o: HAL/src/alt_main.c HAL/inc/sys/alt_dev.h system.h \ - linker.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_sys_init.h HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h HAL/inc/os/alt_hooks.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h \ - HAL/inc/alt_types.h system.h HAL/inc/sys/alt_log_printf.h system.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_sys_init.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/os/alt_hooks.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/alt_types.h: - -system.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_main.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_main.o deleted file mode 100644 index a71b072..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_main.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_malloc_lock.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_malloc_lock.d deleted file mode 100644 index 4ed35c2..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_malloc_lock.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_malloc_lock.o: HAL/src/alt_malloc_lock.c diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_malloc_lock.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_malloc_lock.o deleted file mode 100644 index f521fd6..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_malloc_lock.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_mcount.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_mcount.d deleted file mode 100644 index 1203efc..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_mcount.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_mcount.o: HAL/src/alt_mcount.S diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_mcount.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_mcount.o deleted file mode 100644 index a74bde2..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_mcount.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_open.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_open.d deleted file mode 100644 index a2aacd9..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_open.d +++ /dev/null @@ -1,36 +0,0 @@ -obj/HAL/src/alt_open.o: HAL/src/alt_open.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_open.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_open.o deleted file mode 100644 index 0a02c30..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_open.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_printf.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_printf.d deleted file mode 100644 index 3ce68a4..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_printf.d +++ /dev/null @@ -1,3 +0,0 @@ -obj/HAL/src/alt_printf.o: HAL/src/alt_printf.c HAL/inc/sys/alt_stdio.h - -HAL/inc/sys/alt_stdio.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_printf.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_printf.o deleted file mode 100644 index a833195..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_printf.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_putchar.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_putchar.d deleted file mode 100644 index 9a0dde3..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_putchar.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_putchar.o: HAL/src/alt_putchar.c system.h linker.h \ - HAL/inc/sys/alt_driver.h HAL/inc/sys/alt_stdio.h - -system.h: - -linker.h: - -HAL/inc/sys/alt_driver.h: - -HAL/inc/sys/alt_stdio.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_putchar.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_putchar.o deleted file mode 100644 index efee823..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_putchar.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_putstr.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_putstr.d deleted file mode 100644 index 3cf528a..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_putstr.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_putstr.o: HAL/src/alt_putstr.c system.h linker.h \ - HAL/inc/sys/alt_driver.h HAL/inc/sys/alt_stdio.h - -system.h: - -linker.h: - -HAL/inc/sys/alt_driver.h: - -HAL/inc/sys/alt_stdio.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_putstr.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_putstr.o deleted file mode 100644 index a57d33f..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_putstr.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_read.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_read.d deleted file mode 100644 index 2bb0d95..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_read.d +++ /dev/null @@ -1,38 +0,0 @@ -obj/HAL/src/alt_read.o: HAL/src/alt_read.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h \ - HAL/inc/os/alt_syscall.h system.h HAL/inc/sys/alt_driver.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_syscall.h: - -system.h: - -HAL/inc/sys/alt_driver.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_read.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_read.o deleted file mode 100644 index 92b6c7a..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_read.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_release_fd.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_release_fd.d deleted file mode 100644 index 0e3acb5..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_release_fd.d +++ /dev/null @@ -1,29 +0,0 @@ -obj/HAL/src/alt_release_fd.o: HAL/src/alt_release_fd.c \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_release_fd.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_release_fd.o deleted file mode 100644 index 9062f1a..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_release_fd.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_remap_cached.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_remap_cached.d deleted file mode 100644 index b5fb151..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_remap_cached.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_remap_cached.o: HAL/src/alt_remap_cached.c \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h system.h linker.h - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_remap_cached.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_remap_cached.o deleted file mode 100644 index 143aa76..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_remap_cached.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_remap_uncached.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_remap_uncached.d deleted file mode 100644 index 0423405..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_remap_uncached.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_remap_uncached.o: HAL/src/alt_remap_uncached.c \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h system.h linker.h - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_remap_uncached.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_remap_uncached.o deleted file mode 100644 index 1186b98..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_remap_uncached.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_rename.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_rename.d deleted file mode 100644 index b7af4b2..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_rename.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_rename.o: HAL/src/alt_rename.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_rename.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_rename.o deleted file mode 100644 index 5b3cb63..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_rename.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_sbrk.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_sbrk.d deleted file mode 100644 index a0771ae..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_sbrk.d +++ /dev/null @@ -1,19 +0,0 @@ -obj/HAL/src/alt_sbrk.o: HAL/src/alt_sbrk.c HAL/inc/os/alt_syscall.h \ - HAL/inc/sys/alt_irq.h HAL/inc/nios2.h HAL/inc/alt_types.h system.h \ - linker.h HAL/inc/sys/alt_stack.h system.h - -HAL/inc/os/alt_syscall.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_stack.h: - -system.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_sbrk.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_sbrk.o deleted file mode 100644 index 83e996c..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_sbrk.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_settod.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_settod.d deleted file mode 100644 index 56718d5..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_settod.d +++ /dev/null @@ -1,17 +0,0 @@ -obj/HAL/src/alt_settod.o: HAL/src/alt_settod.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_settod.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_settod.o deleted file mode 100644 index 4c10348..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_settod.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_software_exception.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_software_exception.d deleted file mode 100644 index fab4023..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_software_exception.d +++ /dev/null @@ -1,6 +0,0 @@ -obj/HAL/src/alt_software_exception.o: HAL/src/alt_software_exception.S \ - system.h linker.h - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_software_exception.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_software_exception.o deleted file mode 100644 index f9e01c2..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_software_exception.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_stat.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_stat.d deleted file mode 100644 index 8a63c27..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_stat.d +++ /dev/null @@ -1,3 +0,0 @@ -obj/HAL/src/alt_stat.o: HAL/src/alt_stat.c HAL/inc/os/alt_syscall.h - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_stat.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_stat.o deleted file mode 100644 index 213187c..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_stat.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_tick.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_tick.d deleted file mode 100644 index ddbb281..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_tick.d +++ /dev/null @@ -1,27 +0,0 @@ -obj/HAL/src/alt_tick.o: HAL/src/alt_tick.c HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h HAL/inc/alt_types.h system.h linker.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/os/alt_hooks.h \ - HAL/inc/alt_types.h - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_hooks.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_tick.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_tick.o deleted file mode 100644 index a2829cd..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_tick.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_times.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_times.d deleted file mode 100644 index 4bad83d..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_times.d +++ /dev/null @@ -1,17 +0,0 @@ -obj/HAL/src/alt_times.o: HAL/src/alt_times.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_times.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_times.o deleted file mode 100644 index 5a8f119..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_times.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_uncached_free.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_uncached_free.d deleted file mode 100644 index d74ef4b..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_uncached_free.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_uncached_free.o: HAL/src/alt_uncached_free.c \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h system.h linker.h - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_uncached_free.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_uncached_free.o deleted file mode 100644 index c5899eb..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_uncached_free.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_uncached_malloc.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_uncached_malloc.d deleted file mode 100644 index 16799fb..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_uncached_malloc.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_uncached_malloc.o: HAL/src/alt_uncached_malloc.c \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h system.h linker.h - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_uncached_malloc.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_uncached_malloc.o deleted file mode 100644 index b875695..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_uncached_malloc.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_unlink.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_unlink.d deleted file mode 100644 index 0205f86..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_unlink.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_unlink.o: HAL/src/alt_unlink.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_unlink.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_unlink.o deleted file mode 100644 index 69af5c6..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_unlink.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_usleep.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_usleep.d deleted file mode 100644 index b5eca45..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_usleep.d +++ /dev/null @@ -1,6 +0,0 @@ -obj/HAL/src/alt_usleep.o: HAL/src/alt_usleep.c \ - HAL/inc/priv/alt_busy_sleep.h HAL/inc/os/alt_syscall.h - -HAL/inc/priv/alt_busy_sleep.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_usleep.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_usleep.o deleted file mode 100644 index fdae7c8..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_usleep.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_wait.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_wait.d deleted file mode 100644 index f47f5df..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_wait.d +++ /dev/null @@ -1,8 +0,0 @@ -obj/HAL/src/alt_wait.o: HAL/src/alt_wait.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_wait.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_wait.o deleted file mode 100644 index 2aa48cb..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_wait.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_write.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_write.d deleted file mode 100644 index 2b54a68..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_write.d +++ /dev/null @@ -1,41 +0,0 @@ -obj/HAL/src/alt_write.o: HAL/src/alt_write.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h \ - HAL/inc/os/alt_syscall.h HAL/inc/sys/alt_log_printf.h system.h \ - HAL/inc/sys/alt_driver.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_syscall.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: - -HAL/inc/sys/alt_driver.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_write.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_write.o deleted file mode 100644 index f600fbd..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/alt_write.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/altera_nios2_qsys_irq.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/altera_nios2_qsys_irq.d deleted file mode 100644 index 47bdd9c..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/altera_nios2_qsys_irq.d +++ /dev/null @@ -1,15 +0,0 @@ -obj/HAL/src/altera_nios2_qsys_irq.o: HAL/src/altera_nios2_qsys_irq.c \ - HAL/inc/sys/alt_irq.h HAL/inc/nios2.h HAL/inc/alt_types.h system.h \ - linker.h HAL/inc/altera_nios2_qsys_irq.h - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/altera_nios2_qsys_irq.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/altera_nios2_qsys_irq.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/altera_nios2_qsys_irq.o deleted file mode 100644 index e9741aa..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/altera_nios2_qsys_irq.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/crt0.d b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/crt0.d deleted file mode 100644 index 3af0bb0..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/crt0.d +++ /dev/null @@ -1,12 +0,0 @@ -obj/HAL/src/crt0.o: HAL/src/crt0.S system.h linker.h HAL/inc/nios2.h \ - HAL/inc/sys/alt_log_printf.h system.h - -system.h: - -linker.h: - -HAL/inc/nios2.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/crt0.o b/software/qsys_tutorial_hexs_bsp/obj/HAL/src/crt0.o deleted file mode 100644 index 3209774..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/HAL/src/crt0.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/alt_sys_init.d b/software/qsys_tutorial_hexs_bsp/obj/alt_sys_init.d deleted file mode 100644 index 2087a7a..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/alt_sys_init.d +++ /dev/null @@ -1,54 +0,0 @@ -obj/alt_sys_init.o: alt_sys_init.c system.h linker.h \ - HAL/inc/sys/alt_irq.h HAL/inc/nios2.h HAL/inc/alt_types.h system.h \ - HAL/inc/sys/alt_sys_init.h HAL/inc/altera_nios2_qsys_irq.h \ - drivers/inc/altera_avalon_jtag_uart.h HAL/inc/sys/alt_alarm.h \ - HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h \ - HAL/inc/sys/alt_warning.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_flag.h \ - drivers/inc/altera_avalon_jtag_uart_fd.h HAL/inc/sys/alt_dev.h \ - HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h - -system.h: - -linker.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -HAL/inc/sys/alt_sys_init.h: - -HAL/inc/altera_nios2_qsys_irq.h: - -drivers/inc/altera_avalon_jtag_uart.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_flag.h: - -drivers/inc/altera_avalon_jtag_uart_fd.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/alt_sys_init.o b/software/qsys_tutorial_hexs_bsp/obj/alt_sys_init.o deleted file mode 100644 index ca64d1b..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/alt_sys_init.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/drivers/src/altera_avalon_jtag_uart_fd.d b/software/qsys_tutorial_hexs_bsp/obj/drivers/src/altera_avalon_jtag_uart_fd.d deleted file mode 100644 index b152697..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/drivers/src/altera_avalon_jtag_uart_fd.d +++ /dev/null @@ -1,48 +0,0 @@ -obj/drivers/src/altera_avalon_jtag_uart_fd.o: \ - drivers/src/altera_avalon_jtag_uart_fd.c HAL/inc/alt_types.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - drivers/inc/altera_avalon_jtag_uart.h HAL/inc/sys/alt_alarm.h \ - HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_alarm.h \ - HAL/inc/sys/alt_warning.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_flag.h \ - drivers/inc/altera_avalon_jtag_uart_fd.h HAL/inc/sys/alt_dev.h - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_flag.h: - -drivers/inc/altera_avalon_jtag_uart_fd.h: - -HAL/inc/sys/alt_dev.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/drivers/src/altera_avalon_jtag_uart_fd.o b/software/qsys_tutorial_hexs_bsp/obj/drivers/src/altera_avalon_jtag_uart_fd.o deleted file mode 100644 index 30b326f..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/drivers/src/altera_avalon_jtag_uart_fd.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/drivers/src/altera_avalon_jtag_uart_init.d b/software/qsys_tutorial_hexs_bsp/obj/drivers/src/altera_avalon_jtag_uart_init.d deleted file mode 100644 index f9460a1..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/drivers/src/altera_avalon_jtag_uart_init.d +++ /dev/null @@ -1,66 +0,0 @@ -obj/drivers/src/altera_avalon_jtag_uart_init.o: \ - drivers/src/altera_avalon_jtag_uart_init.c HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h HAL/inc/alt_types.h system.h linker.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/sys/ioctl.h \ - HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart_regs.h \ - HAL/inc/io.h HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_warning.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_flag.h \ - drivers/inc/altera_avalon_jtag_uart_fd.h HAL/inc/sys/alt_dev.h \ - HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/sys/alt_log_printf.h system.h - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/ioctl.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart_regs.h: - -HAL/inc/io.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_flag.h: - -drivers/inc/altera_avalon_jtag_uart_fd.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/drivers/src/altera_avalon_jtag_uart_init.o b/software/qsys_tutorial_hexs_bsp/obj/drivers/src/altera_avalon_jtag_uart_init.o deleted file mode 100644 index 55224f0..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/drivers/src/altera_avalon_jtag_uart_init.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/drivers/src/altera_avalon_jtag_uart_ioctl.d b/software/qsys_tutorial_hexs_bsp/obj/drivers/src/altera_avalon_jtag_uart_ioctl.d deleted file mode 100644 index d75a559..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/drivers/src/altera_avalon_jtag_uart_ioctl.d +++ /dev/null @@ -1,58 +0,0 @@ -obj/drivers/src/altera_avalon_jtag_uart_ioctl.o: \ - drivers/src/altera_avalon_jtag_uart_ioctl.c HAL/inc/sys/ioctl.h \ - HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart_regs.h \ - HAL/inc/io.h HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h \ - HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_flag.h \ - drivers/inc/altera_avalon_jtag_uart_fd.h HAL/inc/sys/alt_dev.h system.h \ - linker.h HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/sys/alt_log_printf.h system.h - -HAL/inc/sys/ioctl.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart_regs.h: - -HAL/inc/io.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_flag.h: - -drivers/inc/altera_avalon_jtag_uart_fd.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/drivers/src/altera_avalon_jtag_uart_ioctl.o b/software/qsys_tutorial_hexs_bsp/obj/drivers/src/altera_avalon_jtag_uart_ioctl.o deleted file mode 100644 index fa7a713..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/drivers/src/altera_avalon_jtag_uart_ioctl.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/drivers/src/altera_avalon_jtag_uart_read.d b/software/qsys_tutorial_hexs_bsp/obj/drivers/src/altera_avalon_jtag_uart_read.d deleted file mode 100644 index 9a4846a..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/drivers/src/altera_avalon_jtag_uart_read.d +++ /dev/null @@ -1,66 +0,0 @@ -obj/drivers/src/altera_avalon_jtag_uart_read.o: \ - drivers/src/altera_avalon_jtag_uart_read.c HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h HAL/inc/alt_types.h system.h linker.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/sys/ioctl.h \ - HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart_regs.h \ - HAL/inc/io.h HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_warning.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_flag.h \ - drivers/inc/altera_avalon_jtag_uart_fd.h HAL/inc/sys/alt_dev.h \ - HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/sys/alt_log_printf.h system.h - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/ioctl.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart_regs.h: - -HAL/inc/io.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_flag.h: - -drivers/inc/altera_avalon_jtag_uart_fd.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/drivers/src/altera_avalon_jtag_uart_read.o b/software/qsys_tutorial_hexs_bsp/obj/drivers/src/altera_avalon_jtag_uart_read.o deleted file mode 100644 index 37ac844..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/drivers/src/altera_avalon_jtag_uart_read.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/obj/drivers/src/altera_avalon_jtag_uart_write.d b/software/qsys_tutorial_hexs_bsp/obj/drivers/src/altera_avalon_jtag_uart_write.d deleted file mode 100644 index 5518b7f..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/drivers/src/altera_avalon_jtag_uart_write.d +++ /dev/null @@ -1,66 +0,0 @@ -obj/drivers/src/altera_avalon_jtag_uart_write.o: \ - drivers/src/altera_avalon_jtag_uart_write.c HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h HAL/inc/alt_types.h system.h linker.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/sys/ioctl.h \ - HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart_regs.h \ - HAL/inc/io.h HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_warning.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_flag.h \ - drivers/inc/altera_avalon_jtag_uart_fd.h HAL/inc/sys/alt_dev.h \ - HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/sys/alt_log_printf.h system.h - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/ioctl.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart_regs.h: - -HAL/inc/io.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_flag.h: - -drivers/inc/altera_avalon_jtag_uart_fd.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: diff --git a/software/qsys_tutorial_hexs_bsp/obj/drivers/src/altera_avalon_jtag_uart_write.o b/software/qsys_tutorial_hexs_bsp/obj/drivers/src/altera_avalon_jtag_uart_write.o deleted file mode 100644 index 544fdbb..0000000 --- a/software/qsys_tutorial_hexs_bsp/obj/drivers/src/altera_avalon_jtag_uart_write.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_hexs_bsp/public.mk b/software/qsys_tutorial_hexs_bsp/public.mk deleted file mode 100644 index 5eb883d..0000000 --- a/software/qsys_tutorial_hexs_bsp/public.mk +++ /dev/null @@ -1,385 +0,0 @@ -#------------------------------------------------------------------------------ -# BSP "PUBLIC" MAKEFILE CONTENT -# -# This file is intended to be included in an application or library -# Makefile that is using this BSP. You can create such a Makefile with -# the nios2-app-generate-makefile or nios2-lib-generate-makefile -# commands. -# -# The following variables must be defined before including this file: -# -# ALT_LIBRARY_ROOT_DIR -# Contains the path to the BSP top-level (aka root) directory -#------------------------------------------------------------------------------ - -#------------------------------------------------------------------------------ -# PATHS -#------------------------------------------------------------------------------ - - - -# Path to the provided linker script. -BSP_LINKER_SCRIPT := $(ALT_LIBRARY_ROOT_DIR)/linker.x - -# Include paths: -# The path to root of all header files that a library wishes to make -# available for an application's use is specified here. Note that this -# may not be *all* folders within a hierarchy. For example, if it is -# desired that the application developer type: -# #include -# #include -# With files laid out like this: -# /inc/sockets.h -# /inc/ip/tcpip.h -# -# Then, only /inc need be added to the list of include -# directories. Alternatively, if you wish to be able to directly include -# all files in a hierarchy, separate paths to each folder in that -# hierarchy must be defined. - -# The following are the "base" set of include paths for a BSP. -# These paths are appended to the list that individual software -# components, drivers, etc., add in the generated portion of this -# file (below). -ALT_INCLUDE_DIRS_TO_APPEND += \ - $(ALT_LIBRARY_ROOT_DIR) \ - $(ALT_LIBRARY_ROOT_DIR)/drivers/inc - -# Additions to linker library search-path: -# Here we provide a path to "our self" for the application to construct a -# "-L " out of. This should contain a list of directories, -# relative to the library root, of all directories with .a files to link -# against. -ALT_LIBRARY_DIRS += $(ALT_LIBRARY_ROOT_DIR) - - -#------------------------------------------------------------------------------ -# COMPILATION FLAGS -#------------------------------------------------------------------------------ -# Default C pre-processor flags for a BSP: -ALT_CPPFLAGS += -DSYSTEM_BUS_WIDTH=32 \ - -pipe - - -#------------------------------------------------------------------------------ -# MANAGED CONTENT -# -# All content between the lines "START MANAGED" and "END MANAGED" below is -# generated based on variables in the BSP settings file when the -# nios2-bsp-generate-files command is invoked. If you wish to persist any -# information pertaining to the build process, it is recomended that you -# utilize the BSP settings mechanism to do so. -#------------------------------------------------------------------------------ -#START MANAGED - -# The following TYPE comment allows tools to identify the 'type' of target this -# makefile is associated with. -# TYPE: BSP_PUBLIC_MAKEFILE - -# This following VERSION comment indicates the version of the tool used to -# generate this makefile. A makefile variable is provided for VERSION as well. -# ACDS_VERSION: 13.0sp1 -ACDS_VERSION := 13.0sp1 - -# This following BUILD_NUMBER comment indicates the build number of the tool -# used to generate this makefile. -# BUILD_NUMBER: 232 - -# Qsys--generated SOPCINFO file. Required for resolving node instance ID's with -# design component names. -SOPCINFO_FILE := C:/Users/takayun/Documents/DE2-115/qsys_tutorial/nios_system.sopcinfo - -# Big-Endian operation. -# setting BIG_ENDIAN is false -ALT_CFLAGS += -EL - -# Path to the provided C language runtime initialization code. -BSP_CRT0 := $(ALT_LIBRARY_ROOT_DIR)/obj/HAL/src/crt0.o - -# Name of BSP library as provided to linker using the "-msys-lib" flag or -# linker script GROUP command. -# setting BSP_SYS_LIB is hal_bsp -BSP_SYS_LIB := hal_bsp -ELF_PATCH_FLAG += --thread_model hal - -# Type identifier of the BSP library -# setting BSP_TYPE is hal -ALT_CPPFLAGS += -D__hal__ -BSP_TYPE := hal - -# CPU Name -# setting CPU_NAME is nios2_processor -CPU_NAME = nios2_processor -ELF_PATCH_FLAG += --cpu_name $(CPU_NAME) - -# Hardware Divider present. -# setting HARDWARE_DIVIDE is false -ALT_CFLAGS += -mno-hw-div - -# Hardware Multiplier present. -# setting HARDWARE_MULTIPLY is false -ALT_CFLAGS += -mno-hw-mul - -# Hardware Mulx present. -# setting HARDWARE_MULX is false -ALT_CFLAGS += -mno-hw-mulx - -# Debug Core present. -# setting HAS_DEBUG_CORE is true -CPU_HAS_DEBUG_CORE = 1 - -# Qsys generated design -# setting QSYS is 1 -QSYS := 1 -ELF_PATCH_FLAG += --qsys true - -# Design Name -# setting SOPC_NAME is nios_system -SOPC_NAME := nios_system - -# SopcBuilder Simulation Enabled -# setting SOPC_SIMULATION_ENABLED is false -ELF_PATCH_FLAG += --simulation_enabled false - -# Enable JTAG UART driver to recover when host is inactive causing buffer to -# full without returning error. Printf will not fail with this recovery. none -# setting altera_avalon_jtag_uart_driver.enable_jtag_uart_ignore_fifo_full_error is false - -# Small-footprint (polled mode) driver none -# setting altera_avalon_jtag_uart_driver.enable_small_driver is false - -# Build a custom version of newlib with the specified space-separated compiler -# flags. The custom newlib build will be placed in the <bsp root>/newlib -# directory, and will be used only for applications that utilize this BSP. -# setting hal.custom_newlib_flags is none - -# Enable support for a subset of the C++ language. This option increases code -# footprint by adding support for C++ constructors. Certain features, such as -# multiple inheritance and exceptions are not supported. If false, adds -# -DALT_NO_C_PLUS_PLUS to ALT_CPPFLAGS in public.mk, and reduces code -# footprint. none -# setting hal.enable_c_plus_plus is false -ALT_CPPFLAGS += -DALT_NO_C_PLUS_PLUS - -# When your application exits, close file descriptors, call C++ destructors, -# etc. Code footprint can be reduced by disabling clean exit. If disabled, adds -# -DALT_NO_CLEAN_EXIT to ALT_CPPFLAGS and -Wl,--defsym, exit=_exit to -# ALT_LDFLAGS in public.mk. none -# setting hal.enable_clean_exit is false -ALT_CPPFLAGS += -DALT_NO_CLEAN_EXIT -ALT_LDFLAGS += -Wl,--defsym,exit=_exit - -# Add exit() support. This option increases code footprint if your "main()" -# routine does "return" or call "exit()". If false, adds -DALT_NO_EXIT to -# ALT_CPPFLAGS in public.mk, and reduces footprint none -# setting hal.enable_exit is false -ALT_CPPFLAGS += -DALT_NO_EXIT - -# Causes code to be compiled with gprof profiling enabled and the application -# ELF to be linked with the GPROF library. If true, adds -DALT_PROVIDE_GMON to -# ALT_CPPFLAGS and -pg to ALT_CFLAGS in public.mk. none -# setting hal.enable_gprof is false - -# Enables lightweight device driver API. This reduces code and data footprint -# by removing the HAL layer that maps device names (e.g. /dev/uart0) to file -# descriptors. Instead, driver routines are called directly. The open(), -# close(), and lseek() routines will always fail if called. The read(), -# write(), fstat(), ioctl(), and isatty() routines only work for the stdio -# devices. If true, adds -DALT_USE_DIRECT_DRIVERS to ALT_CPPFLAGS in public.mk. -# The Altera Host and read-only ZIP file systems can't be used if -# hal.enable_lightweight_device_driver_api is true. -# setting hal.enable_lightweight_device_driver_api is true -ALT_CPPFLAGS += -DALT_USE_DIRECT_DRIVERS - -# Adds code to emulate multiply and divide instructions in case they are -# executed but aren't present in the CPU. Normally this isn't required because -# the compiler won't use multiply and divide instructions that aren't present -# in the CPU. If false, adds -DALT_NO_INSTRUCTION_EMULATION to ALT_CPPFLAGS in -# public.mk. none -# setting hal.enable_mul_div_emulation is false -ALT_CPPFLAGS += -DALT_NO_INSTRUCTION_EMULATION - -# Certain drivers are compiled with reduced functionality to reduce code -# footprint. Not all drivers observe this setting. The altera_avalon_uart and -# altera_avalon_jtag_uart drivers switch from interrupt-driven to polled -# operation. CAUTION: Several device drivers are disabled entirely. These -# include the altera_avalon_cfi_flash, altera_avalon_epcs_flash_controller, and -# altera_avalon_lcd_16207 drivers. This can result in certain API (HAL flash -# access routines) to fail. You can define a symbol provided by each driver to -# prevent it from being removed. If true, adds -DALT_USE_SMALL_DRIVERS to -# ALT_CPPFLAGS in public.mk. none -# setting hal.enable_reduced_device_drivers is true -ALT_CPPFLAGS += -DALT_USE_SMALL_DRIVERS - -# Turns on HAL runtime stack checking feature. Enabling this setting causes -# additional code to be placed into each subroutine call to generate an -# exception if a stack collision occurs with the heap or statically allocated -# data. If true, adds -DALT_STACK_CHECK and -mstack-check to ALT_CPPFLAGS in -# public.mk. none -# setting hal.enable_runtime_stack_checking is false - -# The BSP is compiled with optimizations to speedup HDL simulation such as -# initializing the cache, clearing the .bss section, and skipping long delay -# loops. If true, adds -DALT_SIM_OPTIMIZE to ALT_CPPFLAGS in public.mk. When -# this setting is true, the BSP shouldn't be used to build applications that -# are expected to run real hardware. -# setting hal.enable_sim_optimize is false - -# Causes the small newlib (C library) to be used. This reduces code and data -# footprint at the expense of reduced functionality. Several newlib features -# are removed such as floating-point support in printf(), stdin input routines, -# and buffered I/O. The small C library is not compatible with Micrium -# MicroC/OS-II. If true, adds -msmallc to ALT_LDFLAGS in public.mk. none -# setting hal.enable_small_c_library is true -ALT_LDFLAGS += -msmallc -ALT_CPPFLAGS += -DSMALL_C_LIB - -# Enable SOPC Builder System ID. If a System ID SOPC Builder component is -# connected to the CPU associated with this BSP, it will be enabled in the -# creation of command-line arguments to download an ELF to the target. -# Otherwise, system ID and timestamp values are left out of public.mk for -# application Makefile "download-elf" target definition. With the system ID -# check disabled, the Nios II EDS tools will not automatically ensure that the -# application .elf file (and BSP it is linked against) corresponds to the -# hardware design on the target. If false, adds --accept-bad-sysid to -# SOPC_SYSID_FLAG in public.mk. none -# setting hal.enable_sopc_sysid_check is true - -# Enable BSP generation to query if SOPC system is big endian. If true ignores -# export of 'ALT_CFLAGS += -EB' to public.mk if big endian system. If true -# ignores export of 'ALT_CFLAGS += -EL' if little endian system. none -# setting hal.make.ignore_system_derived.big_endian is false - -# Enable BSP generation to query if SOPC system has a debug core present. If -# true ignores export of 'CPU_HAS_DEBUG_CORE = 1' to public.mk if a debug core -# is found in the system. If true ignores export of 'CPU_HAS_DEBUG_CORE = 0' if -# no debug core is found in the system. none -# setting hal.make.ignore_system_derived.debug_core_present is false - -# Enable BSP generation to query if SOPC system has FPU present. If true -# ignores export of 'ALT_CFLAGS += -mhard-float' to public.mk if FPU is found -# in the system. If true ignores export of 'ALT_CFLAGS += -mhard-soft' if FPU -# is not found in the system. none -# setting hal.make.ignore_system_derived.fpu_present is false - -# Enable BSP generation to query if SOPC system has hardware divide present. If -# true ignores export of 'ALT_CFLAGS += -mno-hw-div' to public.mk if no -# division is found in system. If true ignores export of 'ALT_CFLAGS += -# -mhw-div' if division is found in the system. none -# setting hal.make.ignore_system_derived.hardware_divide_present is false - -# Enable BSP generation to query if SOPC system floating point custom -# instruction with a divider is present. If true ignores export of 'ALT_CFLAGS -# += -mcustom-fpu-cfg=60-2' and 'ALT_LDFLAGS += -mcustom-fpu-cfg=60-2' to -# public.mk if the custom instruction is found in the system. none -# setting hal.make.ignore_system_derived.hardware_fp_cust_inst_divider_present is false - -# Enable BSP generation to query if SOPC system floating point custom -# instruction without a divider is present. If true ignores export of -# 'ALT_CFLAGS += -mcustom-fpu-cfg=60-1' and 'ALT_LDFLAGS += -# -mcustom-fpu-cfg=60-1' to public.mk if the custom instruction is found in the -# system. none -# setting hal.make.ignore_system_derived.hardware_fp_cust_inst_no_divider_present is false - -# Enable BSP generation to query if SOPC system has multiplier present. If true -# ignores export of 'ALT_CFLAGS += -mno-hw-mul' to public.mk if no multiplier -# is found in the system. If true ignores export of 'ALT_CFLAGS += -mhw-mul' if -# multiplier is found in the system. none -# setting hal.make.ignore_system_derived.hardware_multiplier_present is false - -# Enable BSP generation to query if SOPC system has hardware mulx present. If -# true ignores export of 'ALT_CFLAGS += -mno-hw-mulx' to public.mk if no mulx -# is found in the system. If true ignores export of 'ALT_CFLAGS += -mhw-mulx' -# if mulx is found in the system. none -# setting hal.make.ignore_system_derived.hardware_mulx_present is false - -# Enable BSP generation to query if SOPC system has simulation enabled. If true -# ignores export of 'ELF_PATCH_FLAG += --simulation_enabled' to public.mk. none -# setting hal.make.ignore_system_derived.sopc_simulation_enabled is false - -# Enable BSP generation to query SOPC system for system ID base address. If -# true ignores export of 'SOPC_SYSID_FLAG += --sidp=
' and -# 'ELF_PATCH_FLAG += --sidp=
' to public.mk. none -# setting hal.make.ignore_system_derived.sopc_system_base_address is false - -# Enable BSP generation to query SOPC system for system ID. If true ignores -# export of 'SOPC_SYSID_FLAG += --id=' and 'ELF_PATCH_FLAG += -# --id=' to public.mk. none -# setting hal.make.ignore_system_derived.sopc_system_id is false - -# Enable BSP generation to query SOPC system for system timestamp. If true -# ignores export of 'SOPC_SYSID_FLAG += --timestamp=' and -# 'ELF_PATCH_FLAG += --timestamp=' to public.mk. none -# setting hal.make.ignore_system_derived.sopc_system_timestamp is false - -# Slave descriptor of STDERR character-mode device. This setting is used by the -# ALT_STDERR family of defines in system.h. none -# setting hal.stderr is jtag_uart -ELF_PATCH_FLAG += --stderr_dev jtag_uart - -# Slave descriptor of STDIN character-mode device. This setting is used by the -# ALT_STDIN family of defines in system.h. none -# setting hal.stdin is jtag_uart -ELF_PATCH_FLAG += --stdin_dev jtag_uart - -# Slave descriptor of STDOUT character-mode device. This setting is used by the -# ALT_STDOUT family of defines in system.h. none -# setting hal.stdout is jtag_uart -ELF_PATCH_FLAG += --stdout_dev jtag_uart - - -#------------------------------------------------------------------------------ -# SOFTWARE COMPONENT & DRIVER INCLUDE PATHS -#------------------------------------------------------------------------------ - -ALT_INCLUDE_DIRS += $(ALT_LIBRARY_ROOT_DIR)/HAL/inc - -#------------------------------------------------------------------------------ -# SOFTWARE COMPONENT & DRIVER PRODUCED ALT_CPPFLAGS ADDITIONS -#------------------------------------------------------------------------------ - -ALT_CPPFLAGS += -DALT_SINGLE_THREADED - -#END MANAGED - - -#------------------------------------------------------------------------------ -# LIBRARY INFORMATION -#------------------------------------------------------------------------------ -# Assemble the name of the BSP *.a file using the BSP library name -# (BSP_SYS_LIB) in generated content above. -BSP_LIB := lib$(BSP_SYS_LIB).a - -# Additional libraries to link against: -# An application including this file will prefix each library with "-l". -# For example, to include the Newlib math library "m" is included, which -# becomes "-lm" when linking the application. -ALT_LIBRARY_NAMES += m - -# Additions to linker dependencies: -# An application Makefile will typically add these directly to the list -# of dependencies required to build the executable target(s). The BSP -# library (*.a) file is specified here. -ALT_LDDEPS += $(ALT_LIBRARY_ROOT_DIR)/$(BSP_LIB) - -# Is this library "Makeable"? -# Add to list of root library directories that support running 'make' -# to build them. Because libraries may or may not have a Makefile in their -# root, appending to this variable tells an application to run 'make' in -# the library root to build/update this library. -MAKEABLE_LIBRARY_ROOT_DIRS += $(ALT_LIBRARY_ROOT_DIR) - -# Additional Assembler Flags -# -gdwarf2 flag is required for stepping through assembly code -ALT_ASFLAGS += -gdwarf2 - -#------------------------------------------------------------------------------ -# FINAL INCLUDE PATH LIST -#------------------------------------------------------------------------------ -# Append static include paths to paths specified by OS/driver/sw package -# additions to the BSP thus giving them precedence in case a BSP addition -# is attempting to override BSP sources. -ALT_INCLUDE_DIRS += $(ALT_INCLUDE_DIRS_TO_APPEND) - - - diff --git a/software/qsys_tutorial_hexs_bsp/settings.bsp b/software/qsys_tutorial_hexs_bsp/settings.bsp deleted file mode 100644 index cf46c41..0000000 --- a/software/qsys_tutorial_hexs_bsp/settings.bsp +++ /dev/null @@ -1,973 +0,0 @@ - - - hal - default - 2016/11/17 9:38:42 - 1479343122799 - C:\Users\takayun\Documents\DE2-115\qsys_tutorial\software\qsys_tutorial_hexs_bsp - .\settings.bsp - C:\Users\takayun\Documents\DE2-115\qsys_tutorial\nios_system.sopcinfo - default - nios2_processor - 1.9 - - hal.sys_clk_timer - ALT_SYS_CLK - UnquotedString - none - none - system_h_define - Slave descriptor of the system clock timer device. This device provides a periodic interrupt ("tick") and is typically required for RTOS use. This setting defines the value of ALT_SYS_CLK in system.h. - none - false - common - - - hal.timestamp_timer - ALT_TIMESTAMP_CLK - UnquotedString - none - none - system_h_define - Slave descriptor of timestamp timer device. This device is used by Altera HAL timestamp drivers for high-resolution time measurement. This setting defines the value of ALT_TIMESTAMP_CLK in system.h. - none - false - common - - - hal.max_file_descriptors - ALT_MAX_FD - DecimalNumber - 4 - 32 - system_h_define - Determines the number of file descriptors statically allocated. This setting defines the value of ALT_MAX_FD in system.h. - If hal.enable_lightweight_device_driver_api is true, there are no file descriptors so this setting is ignored. If hal.enable_lightweight_device_driver_api is false, this setting must be at least 4 because HAL needs a file descriptor for /dev/null, /dev/stdin, /dev/stdout, and /dev/stderr. - false - - - - hal.enable_instruction_related_exceptions_api - ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API - BooleanDefineOnly - false - false - system_h_define - Enables API for registering handlers to service instruction-related exceptions. Enabling this setting increases the size of the exception entry code. - These exception types can be generated if various processor options are enabled, such as the MMU, MPU, or other advanced exception types. - false - - - - hal.linker.allow_code_at_reset - ALT_ALLOW_CODE_AT_RESET - Boolean - 1 - 0 - none - Indicates if initialization code is allowed at the reset address. If true, defines the macro ALT_ALLOW_CODE_AT_RESET in linker.h. - If true, defines the macro ALT_ALLOW_CODE_AT_RESET in linker.h. This setting is typically false if an external bootloader (e.g. flash bootloader) is present. - false - - - - hal.linker.enable_alt_load - NONE - Boolean - 1 - 0 - none - Enables the alt_load() facility. The alt_load() facility copies sections from the .text memory into RAM. If true, this setting sets up the VMA/LMA of sections in linker.x to allow them to be loaded into the .text memory. - This setting is typically false if an external bootloader (e.g. flash bootloader) is present. - false - - - - hal.linker.enable_alt_load_copy_rodata - NONE - Boolean - 0 - 0 - none - Causes the alt_load() facility to copy the .rodata section. If true, this setting defines the macro ALT_LOAD_COPY_RODATA in linker.h. - none - false - - - - hal.linker.enable_alt_load_copy_rwdata - NONE - Boolean - 1 - 0 - none - Causes the alt_load() facility to copy the .rwdata section. If true, this setting defines the macro ALT_LOAD_COPY_RWDATA in linker.h. - none - false - - - - hal.linker.enable_alt_load_copy_exceptions - NONE - Boolean - 0 - 0 - none - Causes the alt_load() facility to copy the .exceptions section. If true, this setting defines the macro ALT_LOAD_COPY_EXCEPTIONS in linker.h. - none - false - - - - hal.linker.enable_exception_stack - NONE - Boolean - 0 - 0 - none - Enables use of a separate exception stack. If true, defines the macro ALT_EXCEPTION_STACK in linker.h, adds a memory region called exception_stack to linker.x, and provides the symbols __alt_exception_stack_pointer and __alt_exception_stack_limit in linker.x. - The hal.linker.exception_stack_size and hal.linker.exception_stack_memory_region_name settings must also be valid. This setting must be false for MicroC/OS-II BSPs. The exception stack can be used to improve interrupt and other exception performance if the EIC is *not* used. - false - common - - - hal.linker.exception_stack_size - NONE - DecimalNumber - 1024 - 1024 - none - Size of the exception stack in bytes. - Only used if hal.linker.enable_exception_stack is true. - false - common - - - hal.linker.exception_stack_memory_region_name - NONE - UnquotedString - onchip_memory - none - none - Name of the existing memory region that will be divided up to create the 'exception_stack' memory region. The selected region name will be adjusted automatically when the BSP is generated to create the 'exception_stack' memory region. - Only used if hal.linker.enable_exception_stack is true. - false - common - - - hal.linker.enable_interrupt_stack - NONE - Boolean - 0 - 0 - none - Enables use of a separate interrupt stack. If true, defines the macro ALT_INTERRUPT_STACK in linker.h, adds a memory region called interrupt_stack to linker.x, and provides the symbols __alt_interrupt_stack_pointer and __alt_interrupt_stack_limit in linker.x. - The hal.linker.interrupt_stack_size and hal.linker.interrupt_stack_memory_region_name settings must also be valid. This setting must be false for MicroC/OS-II BSPs. Only enable if the EIC is used exclusively. The exception stack can be used to improve interrupt and other exception performance if the EIC is *not* used. - false - common - - - hal.linker.interrupt_stack_size - NONE - DecimalNumber - 1024 - 1024 - none - Size of the interrupt stack in bytes. - Only used if hal.linker.enable_interrupt_stack is true. - false - common - - - hal.linker.interrupt_stack_memory_region_name - NONE - UnquotedString - onchip_memory - none - none - Name of the existing memory region that will be divided up to create the 'interrupt_stack' memory region. The selected region name will be adjusted automatically when the BSP is generated to create the 'interrupt_stack' memory region. - Only used if hal.linker.enable_interrupt_stack is true. - false - common - - - hal.stdin - NONE - UnquotedString - jtag_uart - none - system_h_define - Slave descriptor of STDIN character-mode device. This setting is used by the ALT_STDIN family of defines in system.h. - none - false - common - - - hal.stdout - NONE - UnquotedString - jtag_uart - none - system_h_define - Slave descriptor of STDOUT character-mode device. This setting is used by the ALT_STDOUT family of defines in system.h. - none - false - common - - - hal.stderr - NONE - UnquotedString - jtag_uart - none - system_h_define - Slave descriptor of STDERR character-mode device. This setting is used by the ALT_STDERR family of defines in system.h. - none - false - common - - - hal.log_port - NONE - UnquotedString - none - none - public_mk_define - Slave descriptor of debug logging character-mode device. If defined, it enables extra debug messages in the HAL source. This setting is used by the ALT_LOG_PORT family of defines in system.h. - none - false - none - - - hal.make.build_pre_process - BUILD_PRE_PROCESS - UnquotedString - none - none - makefile_variable - Command executed before BSP built. - none - false - none - - - hal.make.ar_pre_process - AR_PRE_PROCESS - UnquotedString - none - none - makefile_variable - Command executed before archiver execution. - none - false - none - - - hal.make.bsp_cflags_defined_symbols - BSP_CFLAGS_DEFINED_SYMBOLS - UnquotedString - none - none - makefile_variable - Preprocessor macros to define. A macro definition in this setting has the same effect as a "#define" in source code. Adding "-DALT_DEBUG" to this setting has the same effect as "#define ALT_DEBUG" in a souce file. Adding "-DFOO=1" to this setting is equivalent to the macro "#define FOO 1" in a source file. Macros defined with this setting are applied to all .S, .c, and C++ files in the BSP. This setting defines the value of BSP_CFLAGS_DEFINED_SYMBOLS in the BSP Makefile. - none - false - none - - - hal.make.ar_post_process - AR_POST_PROCESS - UnquotedString - none - none - makefile_variable - Command executed after archiver execution. - none - false - none - - - hal.make.as - AS - UnquotedString - nios2-elf-gcc - nios2-elf-gcc - makefile_variable - Assembler command. Note that CC is used for .S files. - none - false - none - - - hal.make.build_post_process - BUILD_POST_PROCESS - UnquotedString - none - none - makefile_variable - Command executed after BSP built. - none - false - none - - - hal.make.bsp_cflags_debug - BSP_CFLAGS_DEBUG - UnquotedString - -g - -g - makefile_variable - C/C++ compiler debug level. '-g' provides the default set of debug symbols typically required to debug a typical application. Omitting '-g' removes debug symbols from the ELF. This setting defines the value of BSP_CFLAGS_DEBUG in Makefile. - none - false - common - - - hal.make.ar - AR - UnquotedString - nios2-elf-ar - nios2-elf-ar - makefile_variable - Archiver command. Creates library files. - none - false - none - - - hal.make.rm - RM - UnquotedString - rm -f - rm -f - makefile_variable - Command used to remove files during 'clean' target. - none - false - none - - - hal.make.cxx_pre_process - CXX_PRE_PROCESS - UnquotedString - none - none - makefile_variable - Command executed before each C++ file is compiled. - none - false - none - - - hal.make.bsp_cflags_warnings - BSP_CFLAGS_WARNINGS - UnquotedString - -Wall - -Wall - makefile_variable - C/C++ compiler warning level. "-Wall" is commonly used.This setting defines the value of BSP_CFLAGS_WARNINGS in Makefile. - none - false - none - - - hal.make.bsp_arflags - BSP_ARFLAGS - UnquotedString - -src - -src - makefile_variable - Custom flags only passed to the archiver. This content of this variable is directly passed to the archiver rather than the more standard "ARFLAGS". The reason for this is that GNU Make assumes some default content in ARFLAGS. This setting defines the value of BSP_ARFLAGS in Makefile. - none - false - none - - - hal.make.bsp_cflags_optimization - BSP_CFLAGS_OPTIMIZATION - UnquotedString - '-Os' - -O0 - makefile_variable - C/C++ compiler optimization level. "-O0" = no optimization,"-O2" = "normal" optimization, etc. "-O0" is recommended for code that you want to debug since compiler optimization can remove variables and produce non-sequential execution of code while debugging. This setting defines the value of BSP_CFLAGS_OPTIMIZATION in Makefile. - none - false - common - - - hal.make.as_post_process - AS_POST_PROCESS - UnquotedString - none - none - makefile_variable - Command executed after each assembly file is compiled. - none - false - none - - - hal.make.cc_pre_process - CC_PRE_PROCESS - UnquotedString - none - none - makefile_variable - Command executed before each .c/.S file is compiled. - none - false - none - - - hal.make.bsp_asflags - BSP_ASFLAGS - UnquotedString - -Wa,-gdwarf2 - -Wa,-gdwarf2 - makefile_variable - Custom flags only passed to the assembler. This setting defines the value of BSP_ASFLAGS in Makefile. - none - false - none - - - hal.make.as_pre_process - AS_PRE_PROCESS - UnquotedString - none - none - makefile_variable - Command executed before each assembly file is compiled. - none - false - none - - - hal.make.bsp_cflags_undefined_symbols - BSP_CFLAGS_UNDEFINED_SYMBOLS - UnquotedString - none - none - makefile_variable - Preprocessor macros to undefine. Undefined macros are similar to defined macros, but replicate the "#undef" directive in source code. To undefine the macro FOO use the syntax "-u FOO" in this setting. This is equivalent to "#undef FOO" in a source file. Note: the syntax differs from macro definition (there is a space, i.e. "-u FOO" versus "-DFOO"). Macros defined with this setting are applied to all .S, .c, and C++ files in the BSP. This setting defines the value of BSP_CFLAGS_UNDEFINED_SYMBOLS in the BSP Makefile. - none - false - none - - - hal.make.cc_post_process - CC_POST_PROCESS - UnquotedString - none - none - makefile_variable - Command executed after each .c/.S file is compiled. - none - false - none - - - hal.make.cxx_post_process - CXX_POST_PROCESS - UnquotedString - none - none - makefile_variable - Command executed before each C++ file is compiled. - none - false - none - - - hal.make.cc - CC - UnquotedString - nios2-elf-gcc -xc - nios2-elf-gcc -xc - makefile_variable - C compiler command. - none - false - none - - - hal.make.bsp_cxx_flags - BSP_CXXFLAGS - UnquotedString - none - none - makefile_variable - Custom flags only passed to the C++ compiler. This setting defines the value of BSP_CXXFLAGS in Makefile. - none - false - none - - - hal.make.bsp_inc_dirs - BSP_INC_DIRS - UnquotedString - none - none - makefile_variable - Space separated list of extra include directories to scan for header files. Directories are relative to the top-level BSP directory. The -I prefix's added by the makefile so don't add it here. This setting defines the value of BSP_INC_DIRS in Makefile. - none - false - none - - - hal.make.cxx - CXX - UnquotedString - nios2-elf-gcc -xc++ - nios2-elf-gcc -xc++ - makefile_variable - C++ compiler command. - none - false - none - - - hal.make.bsp_cflags_user_flags - BSP_CFLAGS_USER_FLAGS - UnquotedString - none - none - makefile_variable - Custom flags passed to the compiler when compiling C, C++, and .S files. This setting defines the value of BSP_CFLAGS_USER_FLAGS in Makefile. - none - false - none - - - hal.make.ignore_system_derived.sopc_system_id - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query SOPC system for system ID. If true ignores export of 'SOPC_SYSID_FLAG += --id=<sysid>' and 'ELF_PATCH_FLAG += --id=<sysid>' to public.mk. - none - false - none - - - hal.make.ignore_system_derived.sopc_system_timestamp - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query SOPC system for system timestamp. If true ignores export of 'SOPC_SYSID_FLAG += --timestamp=<timestamp>' and 'ELF_PATCH_FLAG += --timestamp=<timestamp>' to public.mk. - none - false - none - - - hal.make.ignore_system_derived.sopc_system_base_address - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query SOPC system for system ID base address. If true ignores export of 'SOPC_SYSID_FLAG += --sidp=<address>' and 'ELF_PATCH_FLAG += --sidp=<address>' to public.mk. - none - false - none - - - hal.make.ignore_system_derived.sopc_simulation_enabled - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system has simulation enabled. If true ignores export of 'ELF_PATCH_FLAG += --simulation_enabled' to public.mk. - none - false - none - - - hal.make.ignore_system_derived.fpu_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system has FPU present. If true ignores export of 'ALT_CFLAGS += -mhard-float' to public.mk if FPU is found in the system. If true ignores export of 'ALT_CFLAGS += -mhard-soft' if FPU is not found in the system. - none - false - none - - - hal.make.ignore_system_derived.hardware_multiplier_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system has multiplier present. If true ignores export of 'ALT_CFLAGS += -mno-hw-mul' to public.mk if no multiplier is found in the system. If true ignores export of 'ALT_CFLAGS += -mhw-mul' if multiplier is found in the system. - none - false - none - - - hal.make.ignore_system_derived.hardware_mulx_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system has hardware mulx present. If true ignores export of 'ALT_CFLAGS += -mno-hw-mulx' to public.mk if no mulx is found in the system. If true ignores export of 'ALT_CFLAGS += -mhw-mulx' if mulx is found in the system. - none - false - none - - - hal.make.ignore_system_derived.hardware_divide_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system has hardware divide present. If true ignores export of 'ALT_CFLAGS += -mno-hw-div' to public.mk if no division is found in system. If true ignores export of 'ALT_CFLAGS += -mhw-div' if division is found in the system. - none - false - none - - - hal.make.ignore_system_derived.debug_core_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system has a debug core present. If true ignores export of 'CPU_HAS_DEBUG_CORE = 1' to public.mk if a debug core is found in the system. If true ignores export of 'CPU_HAS_DEBUG_CORE = 0' if no debug core is found in the system. - none - false - none - - - hal.make.ignore_system_derived.big_endian - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system is big endian. If true ignores export of 'ALT_CFLAGS += -EB' to public.mk if big endian system. If true ignores export of 'ALT_CFLAGS += -EL' if little endian system. - none - false - none - - - hal.make.ignore_system_derived.hardware_fp_cust_inst_divider_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system floating point custom instruction with a divider is present. If true ignores export of 'ALT_CFLAGS += -mcustom-fpu-cfg=60-2' and 'ALT_LDFLAGS += -mcustom-fpu-cfg=60-2' to public.mk if the custom instruction is found in the system. - none - false - none - - - hal.make.ignore_system_derived.hardware_fp_cust_inst_no_divider_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system floating point custom instruction without a divider is present. If true ignores export of 'ALT_CFLAGS += -mcustom-fpu-cfg=60-1' and 'ALT_LDFLAGS += -mcustom-fpu-cfg=60-1' to public.mk if the custom instruction is found in the system. - none - false - none - - - hal.enable_exit - ALT_NO_EXIT - Boolean - 0 - 1 - public_mk_define - Add exit() support. This option increases code footprint if your "main()" routine does "return" or call "exit()". If false, adds -DALT_NO_EXIT to ALT_CPPFLAGS in public.mk, and reduces footprint - none - false - none - - - hal.enable_small_c_library - NONE - Boolean - 1 - 0 - public_mk_define - Causes the small newlib (C library) to be used. This reduces code and data footprint at the expense of reduced functionality. Several newlib features are removed such as floating-point support in printf(), stdin input routines, and buffered I/O. The small C library is not compatible with Micrium MicroC/OS-II. If true, adds -msmallc to ALT_LDFLAGS in public.mk. - none - false - common - - - hal.enable_clean_exit - ALT_NO_CLEAN_EXIT - Boolean - 0 - 1 - public_mk_define - When your application exits, close file descriptors, call C++ destructors, etc. Code footprint can be reduced by disabling clean exit. If disabled, adds -DALT_NO_CLEAN_EXIT to ALT_CPPFLAGS and -Wl,--defsym, exit=_exit to ALT_LDFLAGS in public.mk. - none - false - none - - - hal.enable_runtime_stack_checking - ALT_STACK_CHECK - Boolean - 0 - 0 - public_mk_define - Turns on HAL runtime stack checking feature. Enabling this setting causes additional code to be placed into each subroutine call to generate an exception if a stack collision occurs with the heap or statically allocated data. If true, adds -DALT_STACK_CHECK and -mstack-check to ALT_CPPFLAGS in public.mk. - none - false - none - - - hal.enable_gprof - ALT_PROVIDE_GMON - Boolean - 0 - 0 - public_mk_define - Causes code to be compiled with gprof profiling enabled and the application ELF to be linked with the GPROF library. If true, adds -DALT_PROVIDE_GMON to ALT_CPPFLAGS and -pg to ALT_CFLAGS in public.mk. - none - false - common - - - hal.enable_c_plus_plus - ALT_NO_C_PLUS_PLUS - Boolean - 0 - 1 - public_mk_define - Enable support for a subset of the C++ language. This option increases code footprint by adding support for C++ constructors. Certain features, such as multiple inheritance and exceptions are not supported. If false, adds -DALT_NO_C_PLUS_PLUS to ALT_CPPFLAGS in public.mk, and reduces code footprint. - none - false - none - - - hal.enable_reduced_device_drivers - ALT_USE_SMALL_DRIVERS - Boolean - 1 - 0 - public_mk_define - Certain drivers are compiled with reduced functionality to reduce code footprint. Not all drivers observe this setting. The altera_avalon_uart and altera_avalon_jtag_uart drivers switch from interrupt-driven to polled operation. CAUTION: Several device drivers are disabled entirely. These include the altera_avalon_cfi_flash, altera_avalon_epcs_flash_controller, and altera_avalon_lcd_16207 drivers. This can result in certain API (HAL flash access routines) to fail. You can define a symbol provided by each driver to prevent it from being removed. If true, adds -DALT_USE_SMALL_DRIVERS to ALT_CPPFLAGS in public.mk. - none - false - common - - - hal.enable_lightweight_device_driver_api - ALT_USE_DIRECT_DRIVERS - Boolean - 1 - 0 - public_mk_define - Enables lightweight device driver API. This reduces code and data footprint by removing the HAL layer that maps device names (e.g. /dev/uart0) to file descriptors. Instead, driver routines are called directly. The open(), close(), and lseek() routines will always fail if called. The read(), write(), fstat(), ioctl(), and isatty() routines only work for the stdio devices. If true, adds -DALT_USE_DIRECT_DRIVERS to ALT_CPPFLAGS in public.mk. - The Altera Host and read-only ZIP file systems can't be used if hal.enable_lightweight_device_driver_api is true. - false - none - - - hal.enable_mul_div_emulation - ALT_NO_INSTRUCTION_EMULATION - Boolean - 0 - 0 - public_mk_define - Adds code to emulate multiply and divide instructions in case they are executed but aren't present in the CPU. Normally this isn't required because the compiler won't use multiply and divide instructions that aren't present in the CPU. If false, adds -DALT_NO_INSTRUCTION_EMULATION to ALT_CPPFLAGS in public.mk. - none - false - none - - - hal.enable_sim_optimize - ALT_SIM_OPTIMIZE - Boolean - 0 - 0 - public_mk_define - The BSP is compiled with optimizations to speedup HDL simulation such as initializing the cache, clearing the .bss section, and skipping long delay loops. If true, adds -DALT_SIM_OPTIMIZE to ALT_CPPFLAGS in public.mk. - When this setting is true, the BSP shouldn't be used to build applications that are expected to run real hardware. - false - common - - - hal.enable_sopc_sysid_check - NONE - Boolean - 1 - 1 - public_mk_define - Enable SOPC Builder System ID. If a System ID SOPC Builder component is connected to the CPU associated with this BSP, it will be enabled in the creation of command-line arguments to download an ELF to the target. Otherwise, system ID and timestamp values are left out of public.mk for application Makefile "download-elf" target definition. With the system ID check disabled, the Nios II EDS tools will not automatically ensure that the application .elf file (and BSP it is linked against) corresponds to the hardware design on the target. If false, adds --accept-bad-sysid to SOPC_SYSID_FLAG in public.mk. - none - false - none - - - hal.custom_newlib_flags - CUSTOM_NEWLIB_FLAGS - UnquotedString - none - none - public_mk_define - Build a custom version of newlib with the specified space-separated compiler flags. - The custom newlib build will be placed in the &lt;bsp root>/newlib directory, and will be used only for applications that utilize this BSP. - false - none - - - hal.log_flags - ALT_LOG_FLAGS - DecimalNumber - 0 - 0 - public_mk_define - The value is assigned to ALT_LOG_FLAGS in the generated public.mk. See hal.log_port setting description. Values can be -1 through 3. - hal.log_port must be set for this to be used. - false - none - - - altera_avalon_jtag_uart_driver.enable_small_driver - ALTERA_AVALON_JTAG_UART_SMALL - BooleanDefineOnly - false - false - public_mk_define - Small-footprint (polled mode) driver - none - false - - - - altera_avalon_jtag_uart_driver.enable_jtag_uart_ignore_fifo_full_error - ALTERA_AVALON_JTAG_UART_IGNORE_FIFO_FULL_ERROR - BooleanDefineOnly - false - false - public_mk_define - Enable JTAG UART driver to recover when host is inactive causing buffer to full without returning error. Printf will not fail with this recovery. - none - false - - - - onchip_memory - 0x00000000 - 0x00000FFF - 4096 - memory - - - pio_0 - 0x00002000 - 0x0000200F - 16 - - - - hex6 - 0x00002010 - 0x0000201F - 16 - - - - hex5 - 0x00002020 - 0x0000202F - 16 - - - - hex4 - 0x00002030 - 0x0000203F - 16 - - - - hex3 - 0x00002040 - 0x0000204F - 16 - - - - hex2 - 0x00002050 - 0x0000205F - 16 - - - - hex1 - 0x00002060 - 0x0000206F - 16 - - - - hex0 - 0x00002070 - 0x0000207F - 16 - - - - push_switches - 0x00002080 - 0x0000208F - 16 - - - - switches - 0x00002090 - 0x0000209F - 16 - - - - LEDRs - 0x000020A0 - 0x000020AF - 16 - - - - LEDs - 0x000020B0 - 0x000020BF - 16 - - - - jtag_uart - 0x000020C0 - 0x000020C7 - 8 - printable - - - .text - onchip_memory - - - .rodata - onchip_memory - - - .rwdata - onchip_memory - - - .bss - onchip_memory - - - .heap - onchip_memory - - - .stack - onchip_memory - - \ No newline at end of file diff --git a/software/qsys_tutorial_hexs_bsp/summary.html b/software/qsys_tutorial_hexs_bsp/summary.html deleted file mode 100644 index e8198e5..0000000 --- a/software/qsys_tutorial_hexs_bsp/summary.html +++ /dev/null @@ -1,2038 +0,0 @@ - -Altera Nios II BSP Summary - -

BSP Description

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
BSP Type:hal
SOPC Design File:C:\Users\takayun\Documents\DE2-115\qsys_tutorial\nios_system.sopcinfo
Quartus JDI File:default
CPU:nios2_processor
BSP Settings File:.\settings.bsp
BSP Version:default
BSP Generated On:2016/11/17 9:38:42
BSP Generated Timestamp:1479343122799
BSP Generated Location:C:\Users\takayun\Documents\DE2-115\qsys_tutorial\software\qsys_tutorial_hexs_bsp
-
-

Nios II Memory Map

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Slave DescriptorAddress RangeSizeAttributes
jtag_uart0x000020C0 - 0x000020C78printable
LEDs0x000020B0 - 0x000020BF16 
LEDRs0x000020A0 - 0x000020AF16 
switches0x00002090 - 0x0000209F16 
push_switches0x00002080 - 0x0000208F16 
hex00x00002070 - 0x0000207F16 
hex10x00002060 - 0x0000206F16 
hex20x00002050 - 0x0000205F16 
hex30x00002040 - 0x0000204F16 
hex40x00002030 - 0x0000203F16 
hex50x00002020 - 0x0000202F16 
hex60x00002010 - 0x0000201F16 
pio_00x00002000 - 0x0000200F16 
onchip_memory0x00000000 - 0x00000FFF4096memory
-
-
-

Linker Regions

- - - - -
RegionAddress RangeSizeMemoryOffset
-
-
-

Linker Section Mappings

- - - - - - - - - - - - - - - - - - - - - - -
SectionRegion
.textonchip_memory
.rodataonchip_memory
.rwdataonchip_memory
.bssonchip_memory
.heaponchip_memory
.stackonchip_memory
-

Settings

- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:altera_avalon_jtag_uart_driver.enable_jtag_uart_ignore_fifo_full_error
Identifier:ALTERA_AVALON_JTAG_UART_IGNORE_FIFO_FULL_ERROR
Default Value:false
Value:false
Type:BooleanDefineOnly
Destination:public_mk_define
Description:Enable JTAG UART driver to recover when host is inactive causing buffer to full without returning error. Printf will not fail with this recovery.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:altera_avalon_jtag_uart_driver.enable_small_driver
Identifier:ALTERA_AVALON_JTAG_UART_SMALL
Default Value:false
Value:false
Type:BooleanDefineOnly
Destination:public_mk_define
Description:Small-footprint (polled mode) driver
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.custom_newlib_flags
Identifier:CUSTOM_NEWLIB_FLAGS
Default Value:none
Value:none
Type:UnquotedString
Destination:public_mk_define
Description:Build a custom version of newlib with the specified space-separated compiler flags.
Restrictions:The custom newlib build will be placed in the &lt;bsp root>/newlib directory, and will be used only for applications that utilize this BSP.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_c_plus_plus
Identifier:ALT_NO_C_PLUS_PLUS
Default Value:1
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable support for a subset of the C++ language. This option increases code footprint by adding support for C++ constructors. Certain features, such as multiple inheritance and exceptions are not supported. If false, adds -DALT_NO_C_PLUS_PLUS to ALT_CPPFLAGS in public.mk, and reduces code footprint.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_clean_exit
Identifier:ALT_NO_CLEAN_EXIT
Default Value:1
Value:0
Type:Boolean
Destination:public_mk_define
Description:When your application exits, close file descriptors, call C++ destructors, etc. Code footprint can be reduced by disabling clean exit. If disabled, adds -DALT_NO_CLEAN_EXIT to ALT_CPPFLAGS and -Wl,--defsym, exit=_exit to ALT_LDFLAGS in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_exit
Identifier:ALT_NO_EXIT
Default Value:1
Value:0
Type:Boolean
Destination:public_mk_define
Description:Add exit() support. This option increases code footprint if your "main()" routine does "return" or call "exit()". If false, adds -DALT_NO_EXIT to ALT_CPPFLAGS in public.mk, and reduces footprint
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_gprof
Identifier:ALT_PROVIDE_GMON
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Causes code to be compiled with gprof profiling enabled and the application ELF to be linked with the GPROF library. If true, adds -DALT_PROVIDE_GMON to ALT_CPPFLAGS and -pg to ALT_CFLAGS in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_instruction_related_exceptions_api
Identifier:ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API
Default Value:false
Value:false
Type:BooleanDefineOnly
Destination:system_h_define
Description:Enables API for registering handlers to service instruction-related exceptions. Enabling this setting increases the size of the exception entry code.
Restrictions:These exception types can be generated if various processor options are enabled, such as the MMU, MPU, or other advanced exception types.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_lightweight_device_driver_api
Identifier:ALT_USE_DIRECT_DRIVERS
Default Value:0
Value:1
Type:Boolean
Destination:public_mk_define
Description:Enables lightweight device driver API. This reduces code and data footprint by removing the HAL layer that maps device names (e.g. /dev/uart0) to file descriptors. Instead, driver routines are called directly. The open(), close(), and lseek() routines will always fail if called. The read(), write(), fstat(), ioctl(), and isatty() routines only work for the stdio devices. If true, adds -DALT_USE_DIRECT_DRIVERS to ALT_CPPFLAGS in public.mk.
Restrictions:The Altera Host and read-only ZIP file systems can't be used if hal.enable_lightweight_device_driver_api is true.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_mul_div_emulation
Identifier:ALT_NO_INSTRUCTION_EMULATION
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Adds code to emulate multiply and divide instructions in case they are executed but aren't present in the CPU. Normally this isn't required because the compiler won't use multiply and divide instructions that aren't present in the CPU. If false, adds -DALT_NO_INSTRUCTION_EMULATION to ALT_CPPFLAGS in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_reduced_device_drivers
Identifier:ALT_USE_SMALL_DRIVERS
Default Value:0
Value:1
Type:Boolean
Destination:public_mk_define
Description:Certain drivers are compiled with reduced functionality to reduce code footprint. Not all drivers observe this setting. The altera_avalon_uart and altera_avalon_jtag_uart drivers switch from interrupt-driven to polled operation. CAUTION: Several device drivers are disabled entirely. These include the altera_avalon_cfi_flash, altera_avalon_epcs_flash_controller, and altera_avalon_lcd_16207 drivers. This can result in certain API (HAL flash access routines) to fail. You can define a symbol provided by each driver to prevent it from being removed. If true, adds -DALT_USE_SMALL_DRIVERS to ALT_CPPFLAGS in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_runtime_stack_checking
Identifier:ALT_STACK_CHECK
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Turns on HAL runtime stack checking feature. Enabling this setting causes additional code to be placed into each subroutine call to generate an exception if a stack collision occurs with the heap or statically allocated data. If true, adds -DALT_STACK_CHECK and -mstack-check to ALT_CPPFLAGS in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_sim_optimize
Identifier:ALT_SIM_OPTIMIZE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:The BSP is compiled with optimizations to speedup HDL simulation such as initializing the cache, clearing the .bss section, and skipping long delay loops. If true, adds -DALT_SIM_OPTIMIZE to ALT_CPPFLAGS in public.mk.
Restrictions:When this setting is true, the BSP shouldn't be used to build applications that are expected to run real hardware.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_small_c_library
Identifier:NONE
Default Value:0
Value:1
Type:Boolean
Destination:public_mk_define
Description:Causes the small newlib (C library) to be used. This reduces code and data footprint at the expense of reduced functionality. Several newlib features are removed such as floating-point support in printf(), stdin input routines, and buffered I/O. The small C library is not compatible with Micrium MicroC/OS-II. If true, adds -msmallc to ALT_LDFLAGS in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_sopc_sysid_check
Identifier:NONE
Default Value:1
Value:1
Type:Boolean
Destination:public_mk_define
Description:Enable SOPC Builder System ID. If a System ID SOPC Builder component is connected to the CPU associated with this BSP, it will be enabled in the creation of command-line arguments to download an ELF to the target. Otherwise, system ID and timestamp values are left out of public.mk for application Makefile "download-elf" target definition. With the system ID check disabled, the Nios II EDS tools will not automatically ensure that the application .elf file (and BSP it is linked against) corresponds to the hardware design on the target. If false, adds --accept-bad-sysid to SOPC_SYSID_FLAG in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.allow_code_at_reset
Identifier:ALT_ALLOW_CODE_AT_RESET
Default Value:0
Value:1
Type:Boolean
Destination:none
Description:Indicates if initialization code is allowed at the reset address. If true, defines the macro ALT_ALLOW_CODE_AT_RESET in linker.h.
Restrictions:If true, defines the macro ALT_ALLOW_CODE_AT_RESET in linker.h. This setting is typically false if an external bootloader (e.g. flash bootloader) is present.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.enable_alt_load
Identifier:NONE
Default Value:0
Value:1
Type:Boolean
Destination:none
Description:Enables the alt_load() facility. The alt_load() facility copies sections from the .text memory into RAM. If true, this setting sets up the VMA/LMA of sections in linker.x to allow them to be loaded into the .text memory.
Restrictions:This setting is typically false if an external bootloader (e.g. flash bootloader) is present.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.enable_alt_load_copy_exceptions
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:none
Description:Causes the alt_load() facility to copy the .exceptions section. If true, this setting defines the macro ALT_LOAD_COPY_EXCEPTIONS in linker.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.enable_alt_load_copy_rodata
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:none
Description:Causes the alt_load() facility to copy the .rodata section. If true, this setting defines the macro ALT_LOAD_COPY_RODATA in linker.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.enable_alt_load_copy_rwdata
Identifier:NONE
Default Value:0
Value:1
Type:Boolean
Destination:none
Description:Causes the alt_load() facility to copy the .rwdata section. If true, this setting defines the macro ALT_LOAD_COPY_RWDATA in linker.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.enable_exception_stack
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:none
Description:Enables use of a separate exception stack. If true, defines the macro ALT_EXCEPTION_STACK in linker.h, adds a memory region called exception_stack to linker.x, and provides the symbols __alt_exception_stack_pointer and __alt_exception_stack_limit in linker.x.
Restrictions:The hal.linker.exception_stack_size and hal.linker.exception_stack_memory_region_name settings must also be valid. This setting must be false for MicroC/OS-II BSPs. The exception stack can be used to improve interrupt and other exception performance if the EIC is *not* used.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.enable_interrupt_stack
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:none
Description:Enables use of a separate interrupt stack. If true, defines the macro ALT_INTERRUPT_STACK in linker.h, adds a memory region called interrupt_stack to linker.x, and provides the symbols __alt_interrupt_stack_pointer and __alt_interrupt_stack_limit in linker.x.
Restrictions:The hal.linker.interrupt_stack_size and hal.linker.interrupt_stack_memory_region_name settings must also be valid. This setting must be false for MicroC/OS-II BSPs. Only enable if the EIC is used exclusively. The exception stack can be used to improve interrupt and other exception performance if the EIC is *not* used.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.exception_stack_memory_region_name
Identifier:NONE
Default Value:none
Value:onchip_memory
Type:UnquotedString
Destination:none
Description:Name of the existing memory region that will be divided up to create the 'exception_stack' memory region. The selected region name will be adjusted automatically when the BSP is generated to create the 'exception_stack' memory region.
Restrictions:Only used if hal.linker.enable_exception_stack is true.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.exception_stack_size
Identifier:NONE
Default Value:1024
Value:1024
Type:DecimalNumber
Destination:none
Description:Size of the exception stack in bytes.
Restrictions:Only used if hal.linker.enable_exception_stack is true.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.interrupt_stack_memory_region_name
Identifier:NONE
Default Value:none
Value:onchip_memory
Type:UnquotedString
Destination:none
Description:Name of the existing memory region that will be divided up to create the 'interrupt_stack' memory region. The selected region name will be adjusted automatically when the BSP is generated to create the 'interrupt_stack' memory region.
Restrictions:Only used if hal.linker.enable_interrupt_stack is true.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.interrupt_stack_size
Identifier:NONE
Default Value:1024
Value:1024
Type:DecimalNumber
Destination:none
Description:Size of the interrupt stack in bytes.
Restrictions:Only used if hal.linker.enable_interrupt_stack is true.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.log_flags
Identifier:ALT_LOG_FLAGS
Default Value:0
Value:0
Type:DecimalNumber
Destination:public_mk_define
Description:The value is assigned to ALT_LOG_FLAGS in the generated public.mk. See hal.log_port setting description. Values can be -1 through 3.
Restrictions:hal.log_port must be set for this to be used.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.log_port
Identifier:NONE
Default Value:none
Value:none
Type:UnquotedString
Destination:public_mk_define
Description:Slave descriptor of debug logging character-mode device. If defined, it enables extra debug messages in the HAL source. This setting is used by the ALT_LOG_PORT family of defines in system.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ar
Identifier:AR
Default Value:nios2-elf-ar
Value:nios2-elf-ar
Type:UnquotedString
Destination:makefile_variable
Description:Archiver command. Creates library files.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ar_post_process
Identifier:AR_POST_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed after archiver execution.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ar_pre_process
Identifier:AR_PRE_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed before archiver execution.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.as
Identifier:AS
Default Value:nios2-elf-gcc
Value:nios2-elf-gcc
Type:UnquotedString
Destination:makefile_variable
Description:Assembler command. Note that CC is used for .S files.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.as_post_process
Identifier:AS_POST_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed after each assembly file is compiled.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.as_pre_process
Identifier:AS_PRE_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed before each assembly file is compiled.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_arflags
Identifier:BSP_ARFLAGS
Default Value:-src
Value:-src
Type:UnquotedString
Destination:makefile_variable
Description:Custom flags only passed to the archiver. This content of this variable is directly passed to the archiver rather than the more standard "ARFLAGS". The reason for this is that GNU Make assumes some default content in ARFLAGS. This setting defines the value of BSP_ARFLAGS in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_asflags
Identifier:BSP_ASFLAGS
Default Value:-Wa,-gdwarf2
Value:-Wa,-gdwarf2
Type:UnquotedString
Destination:makefile_variable
Description:Custom flags only passed to the assembler. This setting defines the value of BSP_ASFLAGS in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cflags_debug
Identifier:BSP_CFLAGS_DEBUG
Default Value:-g
Value:-g
Type:UnquotedString
Destination:makefile_variable
Description:C/C++ compiler debug level. '-g' provides the default set of debug symbols typically required to debug a typical application. Omitting '-g' removes debug symbols from the ELF. This setting defines the value of BSP_CFLAGS_DEBUG in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cflags_defined_symbols
Identifier:BSP_CFLAGS_DEFINED_SYMBOLS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Preprocessor macros to define. A macro definition in this setting has the same effect as a "#define" in source code. Adding "-DALT_DEBUG" to this setting has the same effect as "#define ALT_DEBUG" in a souce file. Adding "-DFOO=1" to this setting is equivalent to the macro "#define FOO 1" in a source file. Macros defined with this setting are applied to all .S, .c, and C++ files in the BSP. This setting defines the value of BSP_CFLAGS_DEFINED_SYMBOLS in the BSP Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cflags_optimization
Identifier:BSP_CFLAGS_OPTIMIZATION
Default Value:-O0
Value:'-Os'
Type:UnquotedString
Destination:makefile_variable
Description:C/C++ compiler optimization level. "-O0" = no optimization,"-O2" = "normal" optimization, etc. "-O0" is recommended for code that you want to debug since compiler optimization can remove variables and produce non-sequential execution of code while debugging. This setting defines the value of BSP_CFLAGS_OPTIMIZATION in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cflags_undefined_symbols
Identifier:BSP_CFLAGS_UNDEFINED_SYMBOLS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Preprocessor macros to undefine. Undefined macros are similar to defined macros, but replicate the "#undef" directive in source code. To undefine the macro FOO use the syntax "-u FOO" in this setting. This is equivalent to "#undef FOO" in a source file. Note: the syntax differs from macro definition (there is a space, i.e. "-u FOO" versus "-DFOO"). Macros defined with this setting are applied to all .S, .c, and C++ files in the BSP. This setting defines the value of BSP_CFLAGS_UNDEFINED_SYMBOLS in the BSP Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cflags_user_flags
Identifier:BSP_CFLAGS_USER_FLAGS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Custom flags passed to the compiler when compiling C, C++, and .S files. This setting defines the value of BSP_CFLAGS_USER_FLAGS in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cflags_warnings
Identifier:BSP_CFLAGS_WARNINGS
Default Value:-Wall
Value:-Wall
Type:UnquotedString
Destination:makefile_variable
Description:C/C++ compiler warning level. "-Wall" is commonly used.This setting defines the value of BSP_CFLAGS_WARNINGS in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cxx_flags
Identifier:BSP_CXXFLAGS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Custom flags only passed to the C++ compiler. This setting defines the value of BSP_CXXFLAGS in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_inc_dirs
Identifier:BSP_INC_DIRS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Space separated list of extra include directories to scan for header files. Directories are relative to the top-level BSP directory. The -I prefix's added by the makefile so don't add it here. This setting defines the value of BSP_INC_DIRS in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.build_post_process
Identifier:BUILD_POST_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed after BSP built.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.build_pre_process
Identifier:BUILD_PRE_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed before BSP built.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.cc
Identifier:CC
Default Value:nios2-elf-gcc -xc
Value:nios2-elf-gcc -xc
Type:UnquotedString
Destination:makefile_variable
Description:C compiler command.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.cc_post_process
Identifier:CC_POST_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed after each .c/.S file is compiled.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.cc_pre_process
Identifier:CC_PRE_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed before each .c/.S file is compiled.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.cxx
Identifier:CXX
Default Value:nios2-elf-gcc -xc++
Value:nios2-elf-gcc -xc++
Type:UnquotedString
Destination:makefile_variable
Description:C++ compiler command.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.cxx_post_process
Identifier:CXX_POST_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed before each C++ file is compiled.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.cxx_pre_process
Identifier:CXX_PRE_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed before each C++ file is compiled.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.big_endian
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system is big endian. If true ignores export of 'ALT_CFLAGS += -EB' to public.mk if big endian system. If true ignores export of 'ALT_CFLAGS += -EL' if little endian system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.debug_core_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system has a debug core present. If true ignores export of 'CPU_HAS_DEBUG_CORE = 1' to public.mk if a debug core is found in the system. If true ignores export of 'CPU_HAS_DEBUG_CORE = 0' if no debug core is found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.fpu_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system has FPU present. If true ignores export of 'ALT_CFLAGS += -mhard-float' to public.mk if FPU is found in the system. If true ignores export of 'ALT_CFLAGS += -mhard-soft' if FPU is not found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.hardware_divide_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system has hardware divide present. If true ignores export of 'ALT_CFLAGS += -mno-hw-div' to public.mk if no division is found in system. If true ignores export of 'ALT_CFLAGS += -mhw-div' if division is found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.hardware_fp_cust_inst_divider_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system floating point custom instruction with a divider is present. If true ignores export of 'ALT_CFLAGS += -mcustom-fpu-cfg=60-2' and 'ALT_LDFLAGS += -mcustom-fpu-cfg=60-2' to public.mk if the custom instruction is found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.hardware_fp_cust_inst_no_divider_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system floating point custom instruction without a divider is present. If true ignores export of 'ALT_CFLAGS += -mcustom-fpu-cfg=60-1' and 'ALT_LDFLAGS += -mcustom-fpu-cfg=60-1' to public.mk if the custom instruction is found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.hardware_multiplier_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system has multiplier present. If true ignores export of 'ALT_CFLAGS += -mno-hw-mul' to public.mk if no multiplier is found in the system. If true ignores export of 'ALT_CFLAGS += -mhw-mul' if multiplier is found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.hardware_mulx_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system has hardware mulx present. If true ignores export of 'ALT_CFLAGS += -mno-hw-mulx' to public.mk if no mulx is found in the system. If true ignores export of 'ALT_CFLAGS += -mhw-mulx' if mulx is found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.sopc_simulation_enabled
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system has simulation enabled. If true ignores export of 'ELF_PATCH_FLAG += --simulation_enabled' to public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.sopc_system_base_address
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query SOPC system for system ID base address. If true ignores export of 'SOPC_SYSID_FLAG += --sidp=<address>' and 'ELF_PATCH_FLAG += --sidp=<address>' to public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.sopc_system_id
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query SOPC system for system ID. If true ignores export of 'SOPC_SYSID_FLAG += --id=<sysid>' and 'ELF_PATCH_FLAG += --id=<sysid>' to public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.sopc_system_timestamp
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query SOPC system for system timestamp. If true ignores export of 'SOPC_SYSID_FLAG += --timestamp=<timestamp>' and 'ELF_PATCH_FLAG += --timestamp=<timestamp>' to public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.rm
Identifier:RM
Default Value:rm -f
Value:rm -f
Type:UnquotedString
Destination:makefile_variable
Description:Command used to remove files during 'clean' target.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.max_file_descriptors
Identifier:ALT_MAX_FD
Default Value:32
Value:4
Type:DecimalNumber
Destination:system_h_define
Description:Determines the number of file descriptors statically allocated. This setting defines the value of ALT_MAX_FD in system.h.
Restrictions:If hal.enable_lightweight_device_driver_api is true, there are no file descriptors so this setting is ignored. If hal.enable_lightweight_device_driver_api is false, this setting must be at least 4 because HAL needs a file descriptor for /dev/null, /dev/stdin, /dev/stdout, and /dev/stderr.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.stderr
Identifier:NONE
Default Value:none
Value:jtag_uart
Type:UnquotedString
Destination:system_h_define
Description:Slave descriptor of STDERR character-mode device. This setting is used by the ALT_STDERR family of defines in system.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.stdin
Identifier:NONE
Default Value:none
Value:jtag_uart
Type:UnquotedString
Destination:system_h_define
Description:Slave descriptor of STDIN character-mode device. This setting is used by the ALT_STDIN family of defines in system.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.stdout
Identifier:NONE
Default Value:none
Value:jtag_uart
Type:UnquotedString
Destination:system_h_define
Description:Slave descriptor of STDOUT character-mode device. This setting is used by the ALT_STDOUT family of defines in system.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.sys_clk_timer
Identifier:ALT_SYS_CLK
Default Value:none
Value:none
Type:UnquotedString
Destination:system_h_define
Description:Slave descriptor of the system clock timer device. This device provides a periodic interrupt ("tick") and is typically required for RTOS use. This setting defines the value of ALT_SYS_CLK in system.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.timestamp_timer
Identifier:ALT_TIMESTAMP_CLK
Default Value:none
Value:none
Type:UnquotedString
Destination:system_h_define
Description:Slave descriptor of timestamp timer device. This device is used by Altera HAL timestamp drivers for high-resolution time measurement. This setting defines the value of ALT_TIMESTAMP_CLK in system.h.
Restrictions:none
-
-
-
- - diff --git a/software/qsys_tutorial_hexs_bsp/system.h b/software/qsys_tutorial_hexs_bsp/system.h deleted file mode 100644 index 1a8c3b9..0000000 --- a/software/qsys_tutorial_hexs_bsp/system.h +++ /dev/null @@ -1,548 +0,0 @@ -/* - * system.h - SOPC Builder system and BSP software package information - * - * Machine generated for CPU 'nios2_processor' in SOPC Builder design 'nios_system' - * SOPC Builder design path: C:/Users/takayun/Documents/DE2-115/qsys_tutorial/nios_system.sopcinfo - * - * Generated: Thu Nov 17 09:38:43 JST 2016 - */ - -/* - * DO NOT MODIFY THIS FILE - * - * Changing this file will have subtle consequences - * which will almost certainly lead to a nonfunctioning - * system. If you do modify this file, be aware that your - * changes will be overwritten and lost when this file - * is generated again. - * - * DO NOT MODIFY THIS FILE - */ - -/* - * License Agreement - * - * Copyright (c) 2008 - * Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - * - * This agreement shall be governed in all respects by the laws of the State - * of California and by the laws of the United States of America. - */ - -#ifndef __SYSTEM_H_ -#define __SYSTEM_H_ - -/* Include definitions from linker script generator */ -#include "linker.h" - - -/* - * CPU configuration - * - */ - -#define ALT_CPU_ARCHITECTURE "altera_nios2_qsys" -#define ALT_CPU_BIG_ENDIAN 0 -#define ALT_CPU_BREAK_ADDR 0x1820 -#define ALT_CPU_CPU_FREQ 50000000u -#define ALT_CPU_CPU_ID_SIZE 1 -#define ALT_CPU_CPU_ID_VALUE 0x00000000 -#define ALT_CPU_CPU_IMPLEMENTATION "tiny" -#define ALT_CPU_DATA_ADDR_WIDTH 0xe -#define ALT_CPU_DCACHE_LINE_SIZE 0 -#define ALT_CPU_DCACHE_LINE_SIZE_LOG2 0 -#define ALT_CPU_DCACHE_SIZE 0 -#define ALT_CPU_EXCEPTION_ADDR 0x20 -#define ALT_CPU_FLUSHDA_SUPPORTED -#define ALT_CPU_FREQ 50000000 -#define ALT_CPU_HARDWARE_DIVIDE_PRESENT 0 -#define ALT_CPU_HARDWARE_MULTIPLY_PRESENT 0 -#define ALT_CPU_HARDWARE_MULX_PRESENT 0 -#define ALT_CPU_HAS_DEBUG_CORE 1 -#define ALT_CPU_HAS_DEBUG_STUB -#define ALT_CPU_HAS_JMPI_INSTRUCTION -#define ALT_CPU_ICACHE_LINE_SIZE 0 -#define ALT_CPU_ICACHE_LINE_SIZE_LOG2 0 -#define ALT_CPU_ICACHE_SIZE 0 -#define ALT_CPU_INST_ADDR_WIDTH 0xd -#define ALT_CPU_NAME "nios2_processor" -#define ALT_CPU_RESET_ADDR 0x0 - - -/* - * CPU configuration (with legacy prefix - don't use these anymore) - * - */ - -#define NIOS2_BIG_ENDIAN 0 -#define NIOS2_BREAK_ADDR 0x1820 -#define NIOS2_CPU_FREQ 50000000u -#define NIOS2_CPU_ID_SIZE 1 -#define NIOS2_CPU_ID_VALUE 0x00000000 -#define NIOS2_CPU_IMPLEMENTATION "tiny" -#define NIOS2_DATA_ADDR_WIDTH 0xe -#define NIOS2_DCACHE_LINE_SIZE 0 -#define NIOS2_DCACHE_LINE_SIZE_LOG2 0 -#define NIOS2_DCACHE_SIZE 0 -#define NIOS2_EXCEPTION_ADDR 0x20 -#define NIOS2_FLUSHDA_SUPPORTED -#define NIOS2_HARDWARE_DIVIDE_PRESENT 0 -#define NIOS2_HARDWARE_MULTIPLY_PRESENT 0 -#define NIOS2_HARDWARE_MULX_PRESENT 0 -#define NIOS2_HAS_DEBUG_CORE 1 -#define NIOS2_HAS_DEBUG_STUB -#define NIOS2_HAS_JMPI_INSTRUCTION -#define NIOS2_ICACHE_LINE_SIZE 0 -#define NIOS2_ICACHE_LINE_SIZE_LOG2 0 -#define NIOS2_ICACHE_SIZE 0 -#define NIOS2_INST_ADDR_WIDTH 0xd -#define NIOS2_RESET_ADDR 0x0 - - -/* - * Define for each module class mastered by the CPU - * - */ - -#define __ALTERA_AVALON_JTAG_UART -#define __ALTERA_AVALON_ONCHIP_MEMORY2 -#define __ALTERA_AVALON_PIO -#define __ALTERA_NIOS2_QSYS - - -/* - * LEDRs configuration - * - */ - -#define ALT_MODULE_CLASS_LEDRs altera_avalon_pio -#define LEDRS_BASE 0x20a0 -#define LEDRS_BIT_CLEARING_EDGE_REGISTER 0 -#define LEDRS_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define LEDRS_CAPTURE 0 -#define LEDRS_DATA_WIDTH 18 -#define LEDRS_DO_TEST_BENCH_WIRING 0 -#define LEDRS_DRIVEN_SIM_VALUE 0 -#define LEDRS_EDGE_TYPE "NONE" -#define LEDRS_FREQ 50000000 -#define LEDRS_HAS_IN 0 -#define LEDRS_HAS_OUT 1 -#define LEDRS_HAS_TRI 0 -#define LEDRS_IRQ -1 -#define LEDRS_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define LEDRS_IRQ_TYPE "NONE" -#define LEDRS_NAME "/dev/LEDRs" -#define LEDRS_RESET_VALUE 0 -#define LEDRS_SPAN 16 -#define LEDRS_TYPE "altera_avalon_pio" - - -/* - * LEDs configuration - * - */ - -#define ALT_MODULE_CLASS_LEDs altera_avalon_pio -#define LEDS_BASE 0x20b0 -#define LEDS_BIT_CLEARING_EDGE_REGISTER 0 -#define LEDS_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define LEDS_CAPTURE 0 -#define LEDS_DATA_WIDTH 8 -#define LEDS_DO_TEST_BENCH_WIRING 0 -#define LEDS_DRIVEN_SIM_VALUE 0 -#define LEDS_EDGE_TYPE "NONE" -#define LEDS_FREQ 50000000 -#define LEDS_HAS_IN 0 -#define LEDS_HAS_OUT 1 -#define LEDS_HAS_TRI 0 -#define LEDS_IRQ -1 -#define LEDS_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define LEDS_IRQ_TYPE "NONE" -#define LEDS_NAME "/dev/LEDs" -#define LEDS_RESET_VALUE 0 -#define LEDS_SPAN 16 -#define LEDS_TYPE "altera_avalon_pio" - - -/* - * System configuration - * - */ - -#define ALT_DEVICE_FAMILY "Cyclone IV E" -#define ALT_ENHANCED_INTERRUPT_API_PRESENT -#define ALT_IRQ_BASE NULL -#define ALT_LOG_PORT "/dev/null" -#define ALT_LOG_PORT_BASE 0x0 -#define ALT_LOG_PORT_DEV null -#define ALT_LOG_PORT_TYPE "" -#define ALT_NUM_EXTERNAL_INTERRUPT_CONTROLLERS 0 -#define ALT_NUM_INTERNAL_INTERRUPT_CONTROLLERS 1 -#define ALT_NUM_INTERRUPT_CONTROLLERS 1 -#define ALT_STDERR "/dev/jtag_uart" -#define ALT_STDERR_BASE 0x20c0 -#define ALT_STDERR_DEV jtag_uart -#define ALT_STDERR_IS_JTAG_UART -#define ALT_STDERR_PRESENT -#define ALT_STDERR_TYPE "altera_avalon_jtag_uart" -#define ALT_STDIN "/dev/jtag_uart" -#define ALT_STDIN_BASE 0x20c0 -#define ALT_STDIN_DEV jtag_uart -#define ALT_STDIN_IS_JTAG_UART -#define ALT_STDIN_PRESENT -#define ALT_STDIN_TYPE "altera_avalon_jtag_uart" -#define ALT_STDOUT "/dev/jtag_uart" -#define ALT_STDOUT_BASE 0x20c0 -#define ALT_STDOUT_DEV jtag_uart -#define ALT_STDOUT_IS_JTAG_UART -#define ALT_STDOUT_PRESENT -#define ALT_STDOUT_TYPE "altera_avalon_jtag_uart" -#define ALT_SYSTEM_NAME "nios_system" - - -/* - * hal configuration - * - */ - -#define ALT_MAX_FD 4 -#define ALT_SYS_CLK none -#define ALT_TIMESTAMP_CLK none - - -/* - * hex0 configuration - * - */ - -#define ALT_MODULE_CLASS_hex0 altera_avalon_pio -#define HEX0_BASE 0x2070 -#define HEX0_BIT_CLEARING_EDGE_REGISTER 0 -#define HEX0_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define HEX0_CAPTURE 0 -#define HEX0_DATA_WIDTH 7 -#define HEX0_DO_TEST_BENCH_WIRING 0 -#define HEX0_DRIVEN_SIM_VALUE 0 -#define HEX0_EDGE_TYPE "NONE" -#define HEX0_FREQ 50000000 -#define HEX0_HAS_IN 0 -#define HEX0_HAS_OUT 1 -#define HEX0_HAS_TRI 0 -#define HEX0_IRQ -1 -#define HEX0_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define HEX0_IRQ_TYPE "NONE" -#define HEX0_NAME "/dev/hex0" -#define HEX0_RESET_VALUE 0 -#define HEX0_SPAN 16 -#define HEX0_TYPE "altera_avalon_pio" - - -/* - * hex1 configuration - * - */ - -#define ALT_MODULE_CLASS_hex1 altera_avalon_pio -#define HEX1_BASE 0x2060 -#define HEX1_BIT_CLEARING_EDGE_REGISTER 0 -#define HEX1_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define HEX1_CAPTURE 0 -#define HEX1_DATA_WIDTH 7 -#define HEX1_DO_TEST_BENCH_WIRING 0 -#define HEX1_DRIVEN_SIM_VALUE 0 -#define HEX1_EDGE_TYPE "NONE" -#define HEX1_FREQ 50000000 -#define HEX1_HAS_IN 0 -#define HEX1_HAS_OUT 1 -#define HEX1_HAS_TRI 0 -#define HEX1_IRQ -1 -#define HEX1_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define HEX1_IRQ_TYPE "NONE" -#define HEX1_NAME "/dev/hex1" -#define HEX1_RESET_VALUE 0 -#define HEX1_SPAN 16 -#define HEX1_TYPE "altera_avalon_pio" - - -/* - * hex2 configuration - * - */ - -#define ALT_MODULE_CLASS_hex2 altera_avalon_pio -#define HEX2_BASE 0x2050 -#define HEX2_BIT_CLEARING_EDGE_REGISTER 0 -#define HEX2_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define HEX2_CAPTURE 0 -#define HEX2_DATA_WIDTH 7 -#define HEX2_DO_TEST_BENCH_WIRING 0 -#define HEX2_DRIVEN_SIM_VALUE 0 -#define HEX2_EDGE_TYPE "NONE" -#define HEX2_FREQ 50000000 -#define HEX2_HAS_IN 0 -#define HEX2_HAS_OUT 1 -#define HEX2_HAS_TRI 0 -#define HEX2_IRQ -1 -#define HEX2_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define HEX2_IRQ_TYPE "NONE" -#define HEX2_NAME "/dev/hex2" -#define HEX2_RESET_VALUE 0 -#define HEX2_SPAN 16 -#define HEX2_TYPE "altera_avalon_pio" - - -/* - * hex3 configuration - * - */ - -#define ALT_MODULE_CLASS_hex3 altera_avalon_pio -#define HEX3_BASE 0x2040 -#define HEX3_BIT_CLEARING_EDGE_REGISTER 0 -#define HEX3_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define HEX3_CAPTURE 0 -#define HEX3_DATA_WIDTH 7 -#define HEX3_DO_TEST_BENCH_WIRING 0 -#define HEX3_DRIVEN_SIM_VALUE 0 -#define HEX3_EDGE_TYPE "NONE" -#define HEX3_FREQ 50000000 -#define HEX3_HAS_IN 0 -#define HEX3_HAS_OUT 1 -#define HEX3_HAS_TRI 0 -#define HEX3_IRQ -1 -#define HEX3_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define HEX3_IRQ_TYPE "NONE" -#define HEX3_NAME "/dev/hex3" -#define HEX3_RESET_VALUE 0 -#define HEX3_SPAN 16 -#define HEX3_TYPE "altera_avalon_pio" - - -/* - * hex4 configuration - * - */ - -#define ALT_MODULE_CLASS_hex4 altera_avalon_pio -#define HEX4_BASE 0x2030 -#define HEX4_BIT_CLEARING_EDGE_REGISTER 0 -#define HEX4_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define HEX4_CAPTURE 0 -#define HEX4_DATA_WIDTH 7 -#define HEX4_DO_TEST_BENCH_WIRING 0 -#define HEX4_DRIVEN_SIM_VALUE 0 -#define HEX4_EDGE_TYPE "NONE" -#define HEX4_FREQ 50000000 -#define HEX4_HAS_IN 0 -#define HEX4_HAS_OUT 1 -#define HEX4_HAS_TRI 0 -#define HEX4_IRQ -1 -#define HEX4_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define HEX4_IRQ_TYPE "NONE" -#define HEX4_NAME "/dev/hex4" -#define HEX4_RESET_VALUE 0 -#define HEX4_SPAN 16 -#define HEX4_TYPE "altera_avalon_pio" - - -/* - * hex5 configuration - * - */ - -#define ALT_MODULE_CLASS_hex5 altera_avalon_pio -#define HEX5_BASE 0x2020 -#define HEX5_BIT_CLEARING_EDGE_REGISTER 0 -#define HEX5_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define HEX5_CAPTURE 0 -#define HEX5_DATA_WIDTH 7 -#define HEX5_DO_TEST_BENCH_WIRING 0 -#define HEX5_DRIVEN_SIM_VALUE 0 -#define HEX5_EDGE_TYPE "NONE" -#define HEX5_FREQ 50000000 -#define HEX5_HAS_IN 0 -#define HEX5_HAS_OUT 1 -#define HEX5_HAS_TRI 0 -#define HEX5_IRQ -1 -#define HEX5_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define HEX5_IRQ_TYPE "NONE" -#define HEX5_NAME "/dev/hex5" -#define HEX5_RESET_VALUE 0 -#define HEX5_SPAN 16 -#define HEX5_TYPE "altera_avalon_pio" - - -/* - * hex6 configuration - * - */ - -#define ALT_MODULE_CLASS_hex6 altera_avalon_pio -#define HEX6_BASE 0x2010 -#define HEX6_BIT_CLEARING_EDGE_REGISTER 0 -#define HEX6_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define HEX6_CAPTURE 0 -#define HEX6_DATA_WIDTH 7 -#define HEX6_DO_TEST_BENCH_WIRING 0 -#define HEX6_DRIVEN_SIM_VALUE 0 -#define HEX6_EDGE_TYPE "NONE" -#define HEX6_FREQ 50000000 -#define HEX6_HAS_IN 0 -#define HEX6_HAS_OUT 1 -#define HEX6_HAS_TRI 0 -#define HEX6_IRQ -1 -#define HEX6_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define HEX6_IRQ_TYPE "NONE" -#define HEX6_NAME "/dev/hex6" -#define HEX6_RESET_VALUE 0 -#define HEX6_SPAN 16 -#define HEX6_TYPE "altera_avalon_pio" - - -/* - * jtag_uart configuration - * - */ - -#define ALT_MODULE_CLASS_jtag_uart altera_avalon_jtag_uart -#define JTAG_UART_BASE 0x20c0 -#define JTAG_UART_IRQ 5 -#define JTAG_UART_IRQ_INTERRUPT_CONTROLLER_ID 0 -#define JTAG_UART_NAME "/dev/jtag_uart" -#define JTAG_UART_READ_DEPTH 64 -#define JTAG_UART_READ_THRESHOLD 8 -#define JTAG_UART_SPAN 8 -#define JTAG_UART_TYPE "altera_avalon_jtag_uart" -#define JTAG_UART_WRITE_DEPTH 64 -#define JTAG_UART_WRITE_THRESHOLD 8 - - -/* - * onchip_memory configuration - * - */ - -#define ALT_MODULE_CLASS_onchip_memory altera_avalon_onchip_memory2 -#define ONCHIP_MEMORY_ALLOW_IN_SYSTEM_MEMORY_CONTENT_EDITOR 0 -#define ONCHIP_MEMORY_ALLOW_MRAM_SIM_CONTENTS_ONLY_FILE 0 -#define ONCHIP_MEMORY_BASE 0x0 -#define ONCHIP_MEMORY_CONTENTS_INFO "" -#define ONCHIP_MEMORY_DUAL_PORT 0 -#define ONCHIP_MEMORY_GUI_RAM_BLOCK_TYPE "AUTO" -#define ONCHIP_MEMORY_INIT_CONTENTS_FILE "nios_system_onchip_memory" -#define ONCHIP_MEMORY_INIT_MEM_CONTENT 1 -#define ONCHIP_MEMORY_INSTANCE_ID "NONE" -#define ONCHIP_MEMORY_IRQ -1 -#define ONCHIP_MEMORY_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define ONCHIP_MEMORY_NAME "/dev/onchip_memory" -#define ONCHIP_MEMORY_NON_DEFAULT_INIT_FILE_ENABLED 0 -#define ONCHIP_MEMORY_RAM_BLOCK_TYPE "AUTO" -#define ONCHIP_MEMORY_READ_DURING_WRITE_MODE "DONT_CARE" -#define ONCHIP_MEMORY_SINGLE_CLOCK_OP 0 -#define ONCHIP_MEMORY_SIZE_MULTIPLE 1 -#define ONCHIP_MEMORY_SIZE_VALUE 4096 -#define ONCHIP_MEMORY_SPAN 4096 -#define ONCHIP_MEMORY_TYPE "altera_avalon_onchip_memory2" -#define ONCHIP_MEMORY_WRITABLE 1 - - -/* - * pio_0 configuration - * - */ - -#define ALT_MODULE_CLASS_pio_0 altera_avalon_pio -#define PIO_0_BASE 0x2000 -#define PIO_0_BIT_CLEARING_EDGE_REGISTER 0 -#define PIO_0_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define PIO_0_CAPTURE 0 -#define PIO_0_DATA_WIDTH 7 -#define PIO_0_DO_TEST_BENCH_WIRING 0 -#define PIO_0_DRIVEN_SIM_VALUE 0 -#define PIO_0_EDGE_TYPE "NONE" -#define PIO_0_FREQ 50000000 -#define PIO_0_HAS_IN 0 -#define PIO_0_HAS_OUT 1 -#define PIO_0_HAS_TRI 0 -#define PIO_0_IRQ -1 -#define PIO_0_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define PIO_0_IRQ_TYPE "NONE" -#define PIO_0_NAME "/dev/pio_0" -#define PIO_0_RESET_VALUE 0 -#define PIO_0_SPAN 16 -#define PIO_0_TYPE "altera_avalon_pio" - - -/* - * push_switches configuration - * - */ - -#define ALT_MODULE_CLASS_push_switches altera_avalon_pio -#define PUSH_SWITCHES_BASE 0x2080 -#define PUSH_SWITCHES_BIT_CLEARING_EDGE_REGISTER 0 -#define PUSH_SWITCHES_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define PUSH_SWITCHES_CAPTURE 0 -#define PUSH_SWITCHES_DATA_WIDTH 3 -#define PUSH_SWITCHES_DO_TEST_BENCH_WIRING 0 -#define PUSH_SWITCHES_DRIVEN_SIM_VALUE 0 -#define PUSH_SWITCHES_EDGE_TYPE "NONE" -#define PUSH_SWITCHES_FREQ 50000000 -#define PUSH_SWITCHES_HAS_IN 1 -#define PUSH_SWITCHES_HAS_OUT 0 -#define PUSH_SWITCHES_HAS_TRI 0 -#define PUSH_SWITCHES_IRQ -1 -#define PUSH_SWITCHES_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define PUSH_SWITCHES_IRQ_TYPE "NONE" -#define PUSH_SWITCHES_NAME "/dev/push_switches" -#define PUSH_SWITCHES_RESET_VALUE 0 -#define PUSH_SWITCHES_SPAN 16 -#define PUSH_SWITCHES_TYPE "altera_avalon_pio" - - -/* - * switches configuration - * - */ - -#define ALT_MODULE_CLASS_switches altera_avalon_pio -#define SWITCHES_BASE 0x2090 -#define SWITCHES_BIT_CLEARING_EDGE_REGISTER 0 -#define SWITCHES_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define SWITCHES_CAPTURE 0 -#define SWITCHES_DATA_WIDTH 18 -#define SWITCHES_DO_TEST_BENCH_WIRING 0 -#define SWITCHES_DRIVEN_SIM_VALUE 0 -#define SWITCHES_EDGE_TYPE "NONE" -#define SWITCHES_FREQ 50000000 -#define SWITCHES_HAS_IN 1 -#define SWITCHES_HAS_OUT 0 -#define SWITCHES_HAS_TRI 0 -#define SWITCHES_IRQ -1 -#define SWITCHES_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define SWITCHES_IRQ_TYPE "NONE" -#define SWITCHES_NAME "/dev/switches" -#define SWITCHES_RESET_VALUE 0 -#define SWITCHES_SPAN 16 -#define SWITCHES_TYPE "altera_avalon_pio" - -#endif /* __SYSTEM_H_ */ diff --git a/software/qsys_tutorial_key3/.cproject b/software/qsys_tutorial_key3/.cproject deleted file mode 100644 index 75c8ff4..0000000 --- a/software/qsys_tutorial_key3/.cproject +++ /dev/null @@ -1,508 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - make - - mem_init_install - true - false - false - - - make - - mem_init_generate - true - false - false - - - make - - help - true - false - false - - - - diff --git a/software/qsys_tutorial_key3/.project b/software/qsys_tutorial_key3/.project deleted file mode 100644 index d4d3359..0000000 --- a/software/qsys_tutorial_key3/.project +++ /dev/null @@ -1,96 +0,0 @@ - - - qsys_tutorial_key3 - - - - - - com.altera.sbtgui.project.makefileBuilder - - - - - com.altera.sbtgui.project.makefileBuilder - - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - ?name? - - - - org.eclipse.cdt.make.core.append_environment - true - - - org.eclipse.cdt.make.core.autoBuildTarget - all - - - org.eclipse.cdt.make.core.buildArguments - - - - org.eclipse.cdt.make.core.buildCommand - make - - - org.eclipse.cdt.make.core.buildLocation - ${workspace_loc://qsys_tutorial_key3} - - - org.eclipse.cdt.make.core.cleanBuildTarget - clean - - - org.eclipse.cdt.make.core.contents - org.eclipse.cdt.make.core.activeConfigSettings - - - org.eclipse.cdt.make.core.enableAutoBuild - false - - - org.eclipse.cdt.make.core.enableCleanBuild - true - - - org.eclipse.cdt.make.core.enableFullBuild - true - - - org.eclipse.cdt.make.core.fullBuildTarget - all - - - org.eclipse.cdt.make.core.stopOnError - true - - - org.eclipse.cdt.make.core.useDefaultBuildCmd - true - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - org.eclipse.cdt.core.ccnature - com.altera.sbtgui.project.SBTGUINature - com.altera.sbtgui.project.SBTGUIAppNature - com.altera.sbtgui.project.SBTGUIManagedNature - - diff --git a/software/qsys_tutorial_key3/Makefile b/software/qsys_tutorial_key3/Makefile deleted file mode 100644 index 59d7e66..0000000 --- a/software/qsys_tutorial_key3/Makefile +++ /dev/null @@ -1,1086 +0,0 @@ -#------------------------------------------------------------------------------ -# VARIABLES APPENDED TO BY INCLUDED MAKEFILE FRAGMENTS -#------------------------------------------------------------------------------ - -# List of include directories for -I compiler option (-I added when used). -# Includes the BSP. -ALT_INCLUDE_DIRS := - -# List of library directories for -L linker option (-L added when used). -# Includes the BSP. -ALT_LIBRARY_DIRS := - -# List of library names for -l linker option (-l added when used). -# Includes the BSP. -ALT_LIBRARY_NAMES := - -# List of library names for -msys-lib linker option (-msys-lib added when used). -# These are libraries that might be located in the BSP and depend on the BSP -# library, or vice versa -ALT_BSP_DEP_LIBRARY_NAMES := - -# List of dependencies for the linker. This is usually the full pathname -# of each library (*.a) file. -# Includes the BSP. -ALT_LDDEPS := - -# List of root library directories that support running make to build them. -# Includes the BSP and any ALT libraries. -MAKEABLE_LIBRARY_ROOT_DIRS := - -# Generic flags passed to the compiler for different types of input files. -ALT_CFLAGS := -ALT_CXXFLAGS := -ALT_CPPFLAGS := -ALT_ASFLAGS := -ALT_LDFLAGS := - - -#------------------------------------------------------------------------------ -# The adjust-path macro -# -# If COMSPEC/ComSpec is defined, Make is launched from Windows through -# Cygwin. The adjust-path macro converts absolute windows paths into -# unix style paths (Example: c:/dir -> /c/dir). This will ensture -# paths are readable by GNU Make. -# -# If COMSPEC/ComSpec is not defined, Make is launched from linux, and no -# adjustment is necessary -# -#------------------------------------------------------------------------------ - -ifndef COMSPEC -ifdef ComSpec -COMSPEC = $(ComSpec) -endif # ComSpec -endif # COMSPEC - -ifdef COMSPEC # if Windows OS - -ifeq ($(MAKE_VERSION),3.81) -# -# adjust-path/adjust-path-mixed for Mingw Gnu Make on Windows -# -# Example Usage: -# $(call adjust-path,c:/aaa/bbb) => /c/aaa/bbb -# $(call adjust-path-mixed,/c/aaa/bbb) => c:/aaa/bbb -# $(call adjust-path-mixed,/cygdrive/c/aaa/bbb) => c:/aaa/bbb -# - -# -# adjust-path -# - converts back slash characters into forward slashes -# - if input arg ($1) is an empty string then return the empty string -# - if input arg ($1) does not contain the string ":/", then return input arg -# - using sed, convert mixed path [c:/...] into mingw path [/c/...] -define adjust-path -$(strip \ -$(if $1,\ -$(if $(findstring :/,$(subst \,/,$1)),\ -$(shell echo $(subst \,/,$1) | sed -e 's,^\([a-zA-Z]\):/,/\1/,'),\ -$(subst \,/,$1)))) -endef - -# -# adjust-path-mixed -# - converts back slash characters into forward slashes -# - if input arg ($1) is an empty string then return the empty string -# - if input arg ($1) does not begin with a forward slash '/' char, then -# return input arg -# - using sed, convert mingw path [/c/...] or cygwin path [/c/cygdrive/...] -# into a mixed path [c:/...] -define adjust-path-mixed -$(strip \ -$(if $1,\ -$(if $(findstring $(subst \,/,$1),$(patsubst /%,%,$(subst \,/,$1))),\ -$(subst \,/,$1),\ -$(shell echo $(subst \,/,$1) | sed -e 's,^/cygdrive/\([a-zA-Z]\)/,\1:/,' -e 's,^/\([a-zA-Z]\)/,\1:/,')))) -endef - -else # MAKE_VERSION != 3.81 (MAKE_VERSION == 3.80 or MAKE_VERSION == 3.79) -# -# adjust-path for Cygwin Gnu Make -# $(call adjust-path,c:/aaa/bbb) = /cygdrive/c/aaa/bbb -# $(call adjust-path-mixed,/cygdrive/c/aaa/bbb) = c:/aaa/bbb -# -adjust-path = $(if $1,$(shell cygpath -u "$1"),) -adjust-path-mixed = $(if $1,$(shell cygpath -m "$1"),) -endif - -else # !COMSPEC - -adjust-path = $1 -adjust-path-mixed = $1 - -endif # COMSPEC - - -#vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv -# GENERATED SETTINGS START v -#vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv - -#START GENERATED -ACTIVE_BUILD_CONFIG := default -BUILD_CONFIGS := default - -# The following TYPE comment allows tools to identify the 'type' of target this -# makefile is associated with. -# TYPE: APP_MAKEFILE - -# This following VERSION comment indicates the version of the tool used to -# generate this makefile. A makefile variable is provided for VERSION as well. -# ACDS_VERSION: 13.0sp1 -ACDS_VERSION := 13.0sp1 - -# This following BUILD_NUMBER comment indicates the build number of the tool -# used to generate this makefile. -# BUILD_NUMBER: 232 - -# Define path to the application ELF. -# It may be used by the makefile fragments so is defined before including them. -# -ELF := qsys_tutorial_key3.elf - -# Paths to C, C++, and assembly source files. -C_SRCS := hello_world_small.c -CXX_SRCS := -ASM_SRCS := - - -# Path to root of object file tree. -OBJ_ROOT_DIR := obj - -# Options to control objdump. -CREATE_OBJDUMP := 1 -OBJDUMP_INCLUDE_SOURCE := 1 -OBJDUMP_FULL_CONTENTS := 0 - -# Options to enable/disable optional files. -CREATE_ELF_DERIVED_FILES := 0 -CREATE_LINKER_MAP := 1 - -# Common arguments for ALT_CFLAGSs -APP_CFLAGS_DEFINED_SYMBOLS := -APP_CFLAGS_UNDEFINED_SYMBOLS := -APP_CFLAGS_OPTIMIZATION := -Os -APP_CFLAGS_DEBUG_LEVEL := -g -APP_CFLAGS_WARNINGS := -Wall -APP_CFLAGS_USER_FLAGS := - -APP_ASFLAGS_USER := -APP_LDFLAGS_USER := - -# Linker options that have default values assigned later if not -# assigned here. -LINKER_SCRIPT := -CRT0 := -SYS_LIB := - -# Define path to the root of the BSP. -BSP_ROOT_DIR := ../qsys_tutorial_key3_bsp/ - -# List of application specific include directories, library directories and library names -APP_INCLUDE_DIRS := -APP_LIBRARY_DIRS := -APP_LIBRARY_NAMES := - -# Pre- and post- processor settings. -BUILD_PRE_PROCESS := -BUILD_POST_PROCESS := - -QUARTUS_PROJECT_DIR := ../../ - - -#END GENERATED - -#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -# GENERATED SETTINGS END ^ -#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - -#------------------------------------------------------------------------------ -# DEFAULT TARGET -#------------------------------------------------------------------------------ - -# Define the variable used to echo output if not already defined. -ifeq ($(ECHO),) -ECHO := echo -endif - -# Put "all" rule before included makefile fragments because they may -# define rules and we don't want one of those to become the default rule. -.PHONY : all - -all: - @$(ECHO) [$(APP_NAME) build complete] - -all : build_pre_process libs app build_post_process - - -#------------------------------------------------------------------------------ -# VARIABLES DEPENDENT ON GENERATED CONTENT -#------------------------------------------------------------------------------ - -# Define object file directory per build configuration -CONFIG_OBJ_DIR := $(OBJ_ROOT_DIR)/$(ACTIVE_BUILD_CONFIG) - -ifeq ($(BSP_ROOT_DIR),) -$(error Edit Makefile and provide a value for BSP_ROOT_DIR) -endif - -ifeq ($(wildcard $(BSP_ROOT_DIR)),) -$(error BSP directory does not exist: $(BSP_ROOT_DIR)) -endif - -# Define absolute path to the root of the BSP. -ABS_BSP_ROOT_DIR := $(call adjust-path-mixed,$(shell cd "$(BSP_ROOT_DIR)"; pwd)) - -# Include makefile fragments. Define variable ALT_LIBRARY_ROOT_DIR before -# including each makefile fragment so that it knows the path to itself. -BSP_INCLUDE_FILE := $(BSP_ROOT_DIR)/public.mk -ALT_LIBRARY_ROOT_DIR := $(BSP_ROOT_DIR) -include $(BSP_INCLUDE_FILE) -# C2H will need this to touch the BSP public.mk and avoid the sopc file -# out-of-date error during a BSP make -ABS_BSP_INCLUDE_FILE := $(ABS_BSP_ROOT_DIR)/public.mk - - -ifneq ($(WARNING.SMALL_STACK_SIZE),) -# This WARNING is here to protect you from unknowingly using a very small stack -# If the warning is set, increase your stack size or enable the BSP small stack -# setting to eliminate the warning -$(warning WARNING: $(WARNING.SMALL_STACK_SIZE)) -endif - - -# If the BSP public.mk indicates that ALT_SIM_OPTIMIZE is set, rename the ELF -# by prefixing it with RUN_ON_HDL_SIMULATOR_ONLY_. -ifneq ($(filter -DALT_SIM_OPTIMIZE,$(ALT_CPPFLAGS)),) -ELF := RUN_ON_HDL_SIMULATOR_ONLY_$(ELF) -endif - -# If the BSP public.mk indicates that ALT_PROVIDE_GMON is set, add option to -# download_elf target -ifneq ($(filter -DALT_PROVIDE_GMON,$(ALT_CPPFLAGS)),) -GMON_OUT_FILENAME := gmon.out -WRITE_GMON_OPTION := --write-gmon $(GMON_OUT_FILENAME) -endif - -# Name of ELF application. -APP_NAME := $(basename $(ELF)) - -# Set to defaults if variables not already defined in settings. -ifeq ($(LINKER_SCRIPT),) -LINKER_SCRIPT := $(BSP_LINKER_SCRIPT) -endif -ifeq ($(CRT0),) -CRT0 := $(BSP_CRT0) -endif -ifeq ($(SYS_LIB),) -SYS_LIB := $(BSP_SYS_LIB) -endif - -OBJDUMP_NAME := $(APP_NAME).objdump -OBJDUMP_FLAGS := --disassemble --syms --all-header -ifeq ($(OBJDUMP_INCLUDE_SOURCE),1) -OBJDUMP_FLAGS += --source -endif -ifeq ($(OBJDUMP_FULL_CONTENTS),1) -OBJDUMP_FLAGS += --full-contents -endif - -# Create list of linker dependencies (*.a files). -APP_LDDEPS := $(ALT_LDDEPS) $(LDDEPS) - -# Take lists and add required prefixes. -APP_INC_DIRS := $(addprefix -I, $(ALT_INCLUDE_DIRS) $(APP_INCLUDE_DIRS) $(INC_DIRS)) -ASM_INC_PREFIX := -Wa,-I -APP_ASM_INC_DIRS := $(addprefix $(ASM_INC_PREFIX), $(ALT_INCLUDE_DIRS) $(APP_INCLUDE_DIRS) $(INC_DIRS)) -APP_LIB_DIRS := $(addprefix -L, $(ALT_LIBRARY_DIRS) $(APP_LIBRARY_DIRS) $(LIB_DIRS)) -APP_LIBS := $(addprefix -l, $(ALT_LIBRARY_NAMES) $(APP_LIBRARY_NAMES) $(LIBS)) - -ifneq ($(AVOID_NIOS2_GCC3_OPTIONS),) - -# -# Avoid Nios II GCC 3.X options. -# - -# Detect if small newlib C library is requested. -# If yes, remove the -msmallc option because it is -# now handled by other means. -ifneq ($(filter -msmallc,$(ALT_LDFLAGS)),) - ALT_LDFLAGS := $(filter-out -msmallc,$(ALT_LDFLAGS)) - ALT_C_LIBRARY := smallc -else - ALT_C_LIBRARY := c -endif - -# Put each BSP dependent library in a group to avoid circular dependencies. -APP_BSP_DEP_LIBS := $(foreach l,$(ALT_BSP_DEP_LIBRARY_NAMES),-Wl,--start-group -l$(ALT_C_LIBRARY) -lgcc -l$(l) -Wl,--end-group) - -else # !AVOID_NIOS2_GCC3_OPTIONS - -# -# Use Nios II GCC 3.X options. -# -APP_BSP_DEP_LIBS := $(addprefix -msys-lib=, $(ALT_BSP_DEP_LIBRARY_NAMES)) - -endif # !AVOID_NIOS2_GCC3_OPTIONS - -# Arguments for the C preprocessor, C/C++ compiler, assembler, and linker. -APP_CFLAGS := $(APP_CFLAGS_DEFINED_SYMBOLS) \ - $(APP_CFLAGS_UNDEFINED_SYMBOLS) \ - $(APP_CFLAGS_OPTIMIZATION) \ - $(APP_CFLAGS_DEBUG_LEVEL) \ - $(APP_CFLAGS_WARNINGS) \ - $(APP_CFLAGS_USER_FLAGS) \ - $(ALT_CFLAGS) \ - $(CFLAGS) - -# Arguments only for the C++ compiler. -APP_CXXFLAGS := $(ALT_CXXFLAGS) $(CXXFLAGS) - -# Arguments only for the C preprocessor. -# Prefix each include directory with -I. -APP_CPPFLAGS := $(APP_INC_DIRS) \ - $(ALT_CPPFLAGS) \ - $(CPPFLAGS) - -# Arguments only for the assembler. -APP_ASFLAGS := $(APP_ASM_INC_DIRS) \ - $(ALT_ASFLAGS) \ - $(APP_ASFLAGS_USER) \ - $(ASFLAGS) - -# Arguments only for the linker. -APP_LDFLAGS := $(APP_LDFLAGS_USER) - -ifneq ($(LINKER_SCRIPT),) -APP_LDFLAGS += -T'$(LINKER_SCRIPT)' -endif - -ifneq ($(AVOID_NIOS2_GCC3_OPTIONS),) - -# Avoid Nios II GCC 3.x options. -ifneq ($(CRT0),) -APP_LDFLAGS += $(CRT0) -endif - -# The equivalent of the -msys-lib option is provided -# by the GROUP() command in the linker script. -# Note this means the SYS_LIB variable is now ignored. - -else # !AVOID_NIOS2_GCC3_OPTIONS - -# Use Nios II GCC 3.x options. -ifneq ($(CRT0),) -APP_LDFLAGS += -msys-crt0='$(CRT0)' -endif -ifneq ($(SYS_LIB),) -APP_LDFLAGS += -msys-lib=$(SYS_LIB) -endif - -endif # !AVOID_NIOS2_GCC3_OPTIONS - -APP_LDFLAGS += \ - $(APP_LIB_DIRS) \ - $(ALT_LDFLAGS) \ - $(LDFLAGS) - -LINKER_MAP_NAME := $(APP_NAME).map -ifeq ($(CREATE_LINKER_MAP), 1) -APP_LDFLAGS += -Wl,-Map=$(LINKER_MAP_NAME) -endif - -# QUARTUS_PROJECT_DIR and SOPC_NAME need to be defined if you want the -# mem_init_install target of the mem_init.mk (located in the associated BSP) -# to know how to copy memory initialization files (e.g. .dat, .hex) into -# directories required for Quartus compilation or RTL simulation. - -# Defining QUARTUS_PROJECT_DIR causes mem_init_install to copy memory -# initialization files into your Quartus project directory. This is required -# to provide the initial memory contents of FPGA memories that can be -# initialized by the programming file (.sof) or Hardcopy ROMs. It is also used -# for VHDL simulation of on-chip memories. - -# Defining SOPC_NAME causes the mem_init_install target to copy memory -# initialization files into your RTL simulation directory. This is required -# to provide the initial memory contents of all memories that can be -# initialized by RTL simulation. This variable should be set to the same name -# as your SOPC Builder system name. For example, if you have a system called -# "foo.sopc", this variable should be set to "foo". - -# If SOPC_NAME is not set and QUARTUS_PROJECT_DIR is set, then derive SOPC_NAME. -ifeq ($(SOPC_NAME),) -ifneq ($(QUARTUS_PROJECT_DIR),) -SOPC_NAME := $(basename $(notdir $(wildcard $(QUARTUS_PROJECT_DIR)/*.sopcinfo))) -endif -endif - -# Defining JDI_FILE is required to specify the JTAG Debug Information File -# path. This file is generated by Quartus, and is needed along with the -# .sopcinfo file to resolve processor instance ID's from names in a multi-CPU -# systems. For multi-CPU systems, the processor instance ID is used to select -# from multiple CPU's during ELF download. - -# Both JDI_FILE and SOPCINFO_FILE are provided by the BSP if they found during -# BSP creation. If JDI_FILE is not set and QUARTUS_PROJECT_DIR is set, then -# derive JDI_FILE. We do not attempt to derive SOPCINFO_FILE since there may be -# multiple .sopcinfo files in a Quartus project. -ifeq ($(JDI_FILE),) -ifneq ($(QUARTUS_PROJECT_DIR),) -JDI_FILE := $(wildcard $(QUARTUS_PROJECT_DIR)/*.jdi) -endif -endif - -# Path to root runtime directory used for hdl simulation -RUNTIME_ROOT_DIR := $(CONFIG_OBJ_DIR)/runtime - - - -#------------------------------------------------------------------------------ -# MAKEFILE INCLUDES DEPENDENT ON GENERATED CONTENT -#------------------------------------------------------------------------------ -# mem_init.mk is a generated makefile fragment. This file defines all targets -# used to generate HDL initialization simulation files and pre-initialized -# onchip memory files. -MEM_INIT_FILE := $(BSP_ROOT_DIR)/mem_init.mk -include $(MEM_INIT_FILE) - -# Create list of object files to be built using the list of source files. -# The source file hierarchy is preserved in the object tree. -# The supported file extensions are: -# -# .c - for C files -# .cxx .cc .cpp - for C++ files -# .S .s - for assembler files -# -# Handle source files specified by --src-dir & --src-rdir differently, to -# save some processing time in calling the adjust-path macro. - -OBJ_LIST_C := $(patsubst %.c,%.o,$(filter %.c,$(C_SRCS))) -OBJ_LIST_CPP := $(patsubst %.cpp,%.o,$(filter %.cpp,$(CXX_SRCS))) -OBJ_LIST_CXX := $(patsubst %.cxx,%.o,$(filter %.cxx,$(CXX_SRCS))) -OBJ_LIST_CC := $(patsubst %.cc,%.o,$(filter %.cc,$(CXX_SRCS))) -OBJ_LIST_S := $(patsubst %.S,%.o,$(filter %.S,$(ASM_SRCS))) -OBJ_LIST_SS := $(patsubst %.s,%.o,$(filter %.s,$(ASM_SRCS))) - -OBJ_LIST := $(sort $(OBJ_LIST_C) $(OBJ_LIST_CPP) $(OBJ_LIST_CXX) \ - $(OBJ_LIST_CC) $(OBJ_LIST_S) $(OBJ_LIST_SS)) - -SDIR_OBJ_LIST_C := $(patsubst %.c,%.o,$(filter %.c,$(SDIR_C_SRCS))) -SDIR_OBJ_LIST_CPP := $(patsubst %.cpp,%.o,$(filter %.cpp,$(SDIR_CXX_SRCS))) -SDIR_OBJ_LIST_CXX := $(patsubst %.cxx,%.o,$(filter %.cxx,$(SDIR_CXX_SRCS))) -SDIR_OBJ_LIST_CC := $(patsubst %.cc,%.o,$(filter %.cc,$(SDIR_CXX_SRCS))) -SDIR_OBJ_LIST_S := $(patsubst %.S,%.o,$(filter %.S,$(SDIR_ASM_SRCS))) -SDIR_OBJ_LIST_SS := $(patsubst %.s,%.o,$(filter %.s,$(SDIR_ASM_SRCS))) - -SDIR_OBJ_LIST := $(sort $(SDIR_OBJ_LIST_C) $(SDIR_OBJ_LIST_CPP) \ - $(SDIR_OBJ_LIST_CXX) $(SDIR_OBJ_LIST_CC) $(SDIR_OBJ_LIST_S) \ - $(SDIR_OBJ_LIST_SS)) - -# Relative-pathed objects that being with "../" are handled differently. -# -# Regular objects are created as -# $(CONFIG_OBJ_DIR)//.o -# where the path structure is maintained under the obj directory. This -# applies for both absolute and relative paths; in the absolute path -# case this means the entire source path will be recreated under the obj -# directory. This is done to allow two source files with the same name -# to be included as part of the project. -# -# Note: On Cygwin, the path recreated under the obj directory will be -# the cygpath -u output path. -# -# Relative-path objects that begin with "../" cause problems under this -# scheme, as $(CONFIG_OBJ_DIR)/..// can potentially put the object -# files anywhere in the system, creating clutter and polluting the source tree. -# As such, their paths are flattened - the object file created will be -# $(CONFIG_OBJ_DIR)/.o. Due to this, two files specified with -# "../" in the beginning cannot have the same name in the project. VPATH -# will be set for these sources to allow make to relocate the source file -# via %.o rules. -# -# The following lines separate the object list into the flatten and regular -# lists, and then handles them as appropriate. - -FLATTEN_OBJ_LIST := $(filter ../%,$(OBJ_LIST)) -FLATTEN_APP_OBJS := $(addprefix $(CONFIG_OBJ_DIR)/,$(notdir $(FLATTEN_OBJ_LIST))) - -REGULAR_OBJ_LIST := $(filter-out $(FLATTEN_OBJ_LIST),$(OBJ_LIST)) -REGULAR_OBJ_LIST_C := $(filter $(OBJ_LIST_C),$(REGULAR_OBJ_LIST)) -REGULAR_OBJ_LIST_CPP := $(filter $(OBJ_LIST_CPP),$(REGULAR_OBJ_LIST)) -REGULAR_OBJ_LIST_CXX := $(filter $(OBJ_LIST_CXX),$(REGULAR_OBJ_LIST)) -REGULAR_OBJ_LIST_CC := $(filter $(OBJ_LIST_CC),$(REGULAR_OBJ_LIST)) -REGULAR_OBJ_LIST_S := $(filter $(OBJ_LIST_S),$(REGULAR_OBJ_LIST)) -REGULAR_OBJ_LIST_SS := $(filter $(OBJ_LIST_SS),$(REGULAR_OBJ_LIST)) - -FLATTEN_SDIR_OBJ_LIST := $(filter ../%,$(SDIR_OBJ_LIST)) -FLATTEN_SDIR_APP_OBJS := $(addprefix $(CONFIG_OBJ_DIR)/,$(notdir $(FLATTEN_SDIR_OBJ_LIST))) - -REGULAR_SDIR_OBJ_LIST := $(filter-out $(FLATTEN_SDIR_OBJ_LIST),$(SDIR_OBJ_LIST)) -REGULAR_SDIR_OBJ_LIST_C := $(filter $(SDIR_OBJ_LIST_C),$(REGULAR_SDIR_OBJ_LIST)) -REGULAR_SDIR_OBJ_LIST_CPP := $(filter $(SDIR_OBJ_LIST_CPP),$(REGULAR_SDIR_OBJ_LIST)) -REGULAR_SDIR_OBJ_LIST_CXX := $(filter $(SDIR_OBJ_LIST_CXX),$(REGULAR_SDIR_OBJ_LIST)) -REGULAR_SDIR_OBJ_LIST_CC := $(filter $(SDIR_OBJ_LIST_CC),$(REGULAR_SDIR_OBJ_LIST)) -REGULAR_SDIR_OBJ_LIST_S := $(filter $(SDIR_OBJ_LIST_S),$(REGULAR_SDIR_OBJ_LIST)) -REGULAR_SDIR_OBJ_LIST_SS := $(filter $(SDIR_OBJ_LIST_SS),$(REGULAR_SDIR_OBJ_LIST)) - -VPATH := $(sort $(dir $(FLATTEN_OBJ_LIST)) $(dir $(FLATTEN_SDIR_OBJ_LIST))) - -APP_OBJS_C := $(addprefix $(CONFIG_OBJ_DIR)/,\ - $(REGULAR_SDIR_OBJ_LIST_C) \ - $(foreach s,$(REGULAR_OBJ_LIST_C),$(call adjust-path,$s))) - -APP_OBJS_CPP := $(addprefix $(CONFIG_OBJ_DIR)/,\ - $(REGULAR_SDIR_OBJ_LIST_CPP) \ - $(foreach s,$(REGULAR_OBJ_LIST_CPP),$(call adjust-path,$s))) - -APP_OBJS_CXX := $(addprefix $(CONFIG_OBJ_DIR)/,\ - $(REGULAR_SDIR_OBJ_LIST_CXX) \ - $(foreach s,$(REGULAR_OBJ_LIST_CXX),$(call adjust-path,$s))) - -APP_OBJS_CC := $(addprefix $(CONFIG_OBJ_DIR)/,\ - $(REGULAR_SDIR_OBJ_LIST_CC) \ - $(foreach s,$(REGULAR_OBJ_LIST_CC),$(call adjust-path,$s))) - -APP_OBJS_S := $(addprefix $(CONFIG_OBJ_DIR)/,\ - $(REGULAR_SDIR_OBJ_LIST_S) \ - $(foreach s,$(REGULAR_OBJ_LIST_S),$(call adjust-path,$s))) - -APP_OBJS_SS := $(addprefix $(CONFIG_OBJ_DIR)/,\ - $(REGULAR_SDIR_OBJ_LIST_SS) \ - $(foreach s,$(REGULAR_OBJ_LIST_SS),$(call adjust-path,$s))) - -APP_OBJS := $(APP_OBJS_C) $(APP_OBJS_CPP) $(APP_OBJS_CXX) $(APP_OBJS_CC) \ - $(APP_OBJS_S) $(APP_OBJS_SS) \ - $(FLATTEN_APP_OBJS) $(FLATTEN_SDIR_APP_OBJS) - -# Add any extra user-provided object files. -APP_OBJS += $(OBJS) - -# Create list of dependancy files for each object file. -APP_DEPS := $(APP_OBJS:.o=.d) - -# Patch the Elf file with system specific information - -# Patch the Elf with the name of the sopc system -ifneq ($(SOPC_NAME),) -ELF_PATCH_FLAG += --sopc_system_name $(SOPC_NAME) -endif - -# Patch the Elf with the absolute path to the Quartus Project Directory -ifneq ($(QUARTUS_PROJECT_DIR),) -ABS_QUARTUS_PROJECT_DIR := $(call adjust-path-mixed,$(shell cd "$(QUARTUS_PROJECT_DIR)"; pwd)) -ELF_PATCH_FLAG += --quartus_project_dir "$(ABS_QUARTUS_PROJECT_DIR)" -endif - -# Patch the Elf and download args with the JDI_FILE if specified -ifneq ($(wildcard $(JDI_FILE)),) -ELF_PATCH_FLAG += --jdi $(JDI_FILE) -DOWNLOAD_JDI_FLAG := --jdi $(JDI_FILE) -endif - -# Patch the Elf with the SOPCINFO_FILE if specified -ifneq ($(wildcard $(SOPCINFO_FILE)),) -ELF_PATCH_FLAG += --sopcinfo $(SOPCINFO_FILE) -endif - -# Use the DOWNLOAD_CABLE variable to specify which JTAG cable to use. -# This is not needed if you only have one cable. -ifneq ($(DOWNLOAD_CABLE),) -DOWNLOAD_CABLE_FLAG := --cable '$(DOWNLOAD_CABLE)' -endif - - -#------------------------------------------------------------------------------ -# BUILD PRE/POST PROCESS -#------------------------------------------------------------------------------ -build_pre_process : - $(BUILD_PRE_PROCESS) - -build_post_process : - $(BUILD_POST_PROCESS) - -.PHONY: build_pre_process build_post_process - - -#------------------------------------------------------------------------------ -# TOOLS -#------------------------------------------------------------------------------ - -# -# Set tool default variables if not already defined. -# If these are defined, they would typically be defined in an -# included makefile fragment. -# -ifeq ($(DEFAULT_CROSS_COMPILE),) -DEFAULT_CROSS_COMPILE := nios2-elf- -endif - -ifeq ($(DEFAULT_STACK_REPORT),) -DEFAULT_STACKREPORT := nios2-stackreport -endif - -ifeq ($(DEFAULT_DOWNLOAD),) -DEFAULT_DOWNLOAD := nios2-download -endif - -ifeq ($(DEFAULT_FLASHPROG),) -DEFAULT_FLASHPROG := nios2-flash-programmer -endif - -ifeq ($(DEFAULT_ELFPATCH),) -DEFAULT_ELFPATCH := nios2-elf-insert -endif - -ifeq ($(DEFAULT_RM),) -DEFAULT_RM := rm -f -endif - -ifeq ($(DEFAULT_CP),) -DEFAULT_CP := cp -f -endif - -ifeq ($(DEFAULT_MKDIR),) -DEFAULT_MKDIR := mkdir -p -endif - -# -# Set tool variables to defaults if not already defined. -# If these are defined, they would typically be defined by a -# setting in the generated portion of this makefile. -# -ifeq ($(CROSS_COMPILE),) -CROSS_COMPILE := $(DEFAULT_CROSS_COMPILE) -endif - -ifeq ($(origin CC),default) -CC := $(CROSS_COMPILE)gcc -xc -endif - -ifeq ($(origin CXX),default) -CXX := $(CROSS_COMPILE)gcc -xc++ -endif - -ifeq ($(origin AS),default) -AS := $(CROSS_COMPILE)gcc -endif - -ifeq ($(origin AR),default) -AR := $(CROSS_COMPILE)ar -endif - -ifeq ($(origin LD),default) -LD := $(CROSS_COMPILE)g++ -endif - -ifeq ($(origin NM),default) -NM := $(CROSS_COMPILE)nm -endif - -ifeq ($(origin RM),default) -RM := $(DEFAULT_RM) -endif - -ifeq ($(origin CP),default) -CP := $(DEFAULT_CP) -endif - -ifeq ($(OBJDUMP),) -OBJDUMP := $(CROSS_COMPILE)objdump -endif - -ifeq ($(OBJCOPY),) -OBJCOPY := $(CROSS_COMPILE)objcopy -endif - -ifeq ($(STACKREPORT),) -ifeq ($(CROSS_COMPILE),nios2-elf-) -STACKREPORT := $(DEFAULT_STACKREPORT) -else -DISABLE_STACKREPORT := 1 -endif -endif - -ifeq ($(DOWNLOAD),) -DOWNLOAD := $(DEFAULT_DOWNLOAD) -endif - -ifeq ($(FLASHPROG),) -FLASHPROG := $(DEFAULT_FLASHPROG) -endif - -ifeq ($(ELFPATCH),) -ELFPATCH := $(DEFAULT_ELFPATCH) -endif - -ifeq ($(MKDIR),) -MKDIR := $(DEFAULT_MKDIR) -endif - -#------------------------------------------------------------------------------ -# PATTERN RULES TO BUILD OBJECTS -#------------------------------------------------------------------------------ - -define compile.c -@$(ECHO) Info: Compiling $< to $@ -@$(MKDIR) $(@D) -$(CC) -MP -MMD -c $(APP_CPPFLAGS) $(APP_CFLAGS) -o $@ $< -$(CC_POST_PROCESS) -endef - -define compile.cpp -@$(ECHO) Info: Compiling $< to $@ -@$(MKDIR) $(@D) -$(CXX) -MP -MMD -c $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< -$(CXX_POST_PROCESS) -endef - -# If assembling with the compiler, ensure "-Wa," is prepended to all APP_ASFLAGS -ifeq ($(AS),$(patsubst %as,%,$(AS))) -COMMA := , -APP_ASFLAGS := $(filter-out $(APP_CFLAGS),$(addprefix -Wa$(COMMA),$(patsubst -Wa$(COMMA)%,%,$(APP_ASFLAGS)))) -endif - -define compile.s -@$(ECHO) Info: Assembling $< to $@ -@$(MKDIR) $(@D) -$(AS) -MP -MMD -c $(APP_CPPFLAGS) $(APP_CFLAGS) $(APP_ASFLAGS) -o $@ $< -$(AS_POST_PROCESS) -endef - -ifeq ($(MAKE_VERSION),3.81) -.SECONDEXPANSION: - -$(APP_OBJS_C): $(CONFIG_OBJ_DIR)/%.o: $$(call adjust-path-mixed,%.c) - $(compile.c) - -$(APP_OBJS_CPP): $(CONFIG_OBJ_DIR)/%.o: $$(call adjust-path-mixed,%.cpp) - $(compile.cpp) - -$(APP_OBJS_CC): $(CONFIG_OBJ_DIR)/%.o: $$(call adjust-path-mixed,%.cc) - $(compile.cpp) - -$(APP_OBJS_CXX): $(CONFIG_OBJ_DIR)/%.o: $$(call adjust-path-mixed,%.cxx) - $(compile.cpp) - -$(APP_OBJS_S): $(CONFIG_OBJ_DIR)/%.o: $$(call adjust-path-mixed,%.S) - $(compile.s) - -$(APP_OBJS_SS): $(CONFIG_OBJ_DIR)/%.o: $$(call adjust-path-mixed,%.s) - $(compile.s) - -endif # MAKE_VERSION != 3.81 - -$(CONFIG_OBJ_DIR)/%.o: %.c - $(compile.c) - -$(CONFIG_OBJ_DIR)/%.o: %.cpp - $(compile.cpp) - -$(CONFIG_OBJ_DIR)/%.o: %.cc - $(compile.cpp) - -$(CONFIG_OBJ_DIR)/%.o: %.cxx - $(compile.cpp) - -$(CONFIG_OBJ_DIR)/%.o: %.S - $(compile.s) - -$(CONFIG_OBJ_DIR)/%.o: %.s - $(compile.s) - - -#------------------------------------------------------------------------------ -# PATTERN RULES TO INTERMEDIATE FILES -#------------------------------------------------------------------------------ - -$(CONFIG_OBJ_DIR)/%.s: %.c - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CC) -S $(APP_CPPFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.s: %.cpp - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CXX) -S $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.s: %.cc - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CXX) -S $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.s: %.cxx - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CXX) -S $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.i: %.c - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CC) -E $(APP_CPPFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.i: %.cpp - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CXX) -E $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.i: %.cc - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CXX) -E $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.i: %.cxx - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CXX) -E $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< - - -#------------------------------------------------------------------------------ -# TARGET RULES -#------------------------------------------------------------------------------ - -.PHONY : help -help : - @$(ECHO) "Summary of Makefile targets" - @$(ECHO) " Build targets:" - @$(ECHO) " all (default) - Application and all libraries (including BSP)" - @$(ECHO) " bsp - Just the BSP" - @$(ECHO) " libs - All libraries (including BSP)" - @$(ECHO) " flash - All flash files" - @$(ECHO) " mem_init_generate - All memory initialization files" -ifeq ($(QSYS),1) - @$(ECHO) " mem_init_install - This target is deprecated for QSys Systems" - @$(ECHO) " --> Use the mem_init_generate target and then" - @$(ECHO) " add the generated meminit.qip file to your" - @$(ECHO) " Quartus II Project." -else # if QSYS != 1 - @$(ECHO) " mem_init_install - Copy memory initialization files to Quartus II project" -endif # QSYS == 1 - @$(ECHO) - @$(ECHO) " Clean targets:" - @$(ECHO) " clean_all - Application and all libraries (including BSP)" - @$(ECHO) " clean - Just the application" - @$(ECHO) " clean_bsp - Just the BSP" - @$(ECHO) " clean_libs - All libraries (including BSP)" - @$(ECHO) - @$(ECHO) " Run targets:" - @$(ECHO) " download-elf - Download and run your elf executable" - @$(ECHO) " program-flash - Program flash contents to the board" - -# Handy rule to skip making libraries and just make application. -.PHONY : app -app : $(ELF) - -ifeq ($(CREATE_OBJDUMP), 1) -app : $(OBJDUMP_NAME) -endif - -ifeq ($(CREATE_ELF_DERIVED_FILES),1) -app : elf_derived_files -endif - -.PHONY: elf_derived_files -elf_derived_files: default_mem_init - -# Handy rule for making just the BSP. -.PHONY : bsp -bsp : - @$(ECHO) Info: Building $(BSP_ROOT_DIR) - @$(MAKE) --no-print-directory -C $(BSP_ROOT_DIR) - - -# Make sure all makeable libraries (including the BSP) are up-to-date. -LIB_TARGETS := $(patsubst %,%-recurs-make-lib,$(MAKEABLE_LIBRARY_ROOT_DIRS)) - -.PHONY : libs -libs : $(LIB_TARGETS) - -ifneq ($(strip $(LIB_TARGETS)),) -$(LIB_TARGETS): %-recurs-make-lib: - @$(ECHO) Info: Building $* - $(MAKE) --no-print-directory -C $* -endif - -ifneq ($(strip $(APP_LDDEPS)),) -$(APP_LDDEPS): libs - @true -endif - -# Rules to force your project to rebuild or relink -# .force_relink file will cause any application that depends on this project to relink -# .force_rebuild file will cause this project to rebuild object files -# .force_rebuild_all file will cause this project and any project that depends on this project to rebuild object files - -FORCE_RELINK_DEP := .force_relink -FORCE_REBUILD_DEP := .force_rebuild -FORCE_REBUILD_ALL_DEP := .force_rebuild_all -FORCE_REBUILD_DEP_LIST := $(CONFIG_OBJ_DIR)/$(FORCE_RELINK_DEP) $(CONFIG_OBJ_DIR)/$(FORCE_REBUILD_DEP) $(FORCE_REBUILD_ALL_DEP) - -$(FORCE_REBUILD_DEP_LIST): - -$(APP_OBJS): $(wildcard $(CONFIG_OBJ_DIR)/$(FORCE_REBUILD_DEP)) $(wildcard $(addsuffix /$(FORCE_REBUILD_ALL_DEP), . $(ALT_LIBRARY_DIRS))) - -$(ELF): $(wildcard $(addsuffix /$(FORCE_RELINK_DEP), $(CONFIG_OBJ_DIR) $(ALT_LIBRARY_DIRS))) - - -# Clean just the application. -.PHONY : clean -ifeq ($(CREATE_ELF_DERIVED_FILES),1) -clean : clean_elf_derived_files -endif - -clean : - @$(RM) -r $(ELF) $(OBJDUMP_NAME) $(LINKER_MAP_NAME) $(OBJ_ROOT_DIR) $(RUNTIME_ROOT_DIR) $(FORCE_REBUILD_DEP_LIST) - @$(ECHO) [$(APP_NAME) clean complete] - -# Clean just the BSP. -.PHONY : clean_bsp -clean_bsp : - @$(ECHO) Info: Cleaning $(BSP_ROOT_DIR) - @$(MAKE) --no-print-directory -C $(BSP_ROOT_DIR) clean - -# Clean all makeable libraries including the BSP. -LIB_CLEAN_TARGETS := $(patsubst %,%-recurs-make-clean-lib,$(MAKEABLE_LIBRARY_ROOT_DIRS)) - -.PHONY : clean_libs -clean_libs : $(LIB_CLEAN_TARGETS) - -ifneq ($(strip $(LIB_CLEAN_TARGETS)),) -$(LIB_CLEAN_TARGETS): %-recurs-make-clean-lib: - @$(ECHO) Info: Cleaning $* - $(MAKE) --no-print-directory -C $* clean -endif - -.PHONY: clean_elf_derived_files -clean_elf_derived_files: mem_init_clean - -# Clean application and all makeable libraries including the BSP. -.PHONY : clean_all -clean_all : clean mem_init_clean clean_libs - -# Include the dependency files unless the make goal is performing a clean -# of the application. -ifneq ($(firstword $(MAKECMDGOALS)),clean) -ifneq ($(firstword $(MAKECMDGOALS)),clean_all) --include $(APP_DEPS) -endif -endif - -.PHONY : download-elf -download-elf : $(ELF) - @if [ "$(DOWNLOAD)" = "none" ]; \ - then \ - $(ECHO) Downloading $(ELF) not supported; \ - else \ - $(ECHO) Info: Downloading $(ELF); \ - $(DOWNLOAD) --go --cpu_name=$(CPU_NAME) $(DOWNLOAD_CABLE_FLAG) $(SOPC_SYSID_FLAG) $(DOWNLOAD_JDI_FLAG) $(WRITE_GMON_OPTION) $(ELF); \ - fi - -# Delete the target of a rule if it has changed and its commands exit -# with a nonzero exit status. -.DELETE_ON_ERROR: - -# Rules for flash programming commands -PROGRAM_FLASH_SUFFIX := -program -PROGRAM_FLASH_TARGET := $(addsuffix $(PROGRAM_FLASH_SUFFIX), $(FLASH_FILES)) - -.PHONY : program-flash -program-flash : $(PROGRAM_FLASH_TARGET) - -.PHONY : $(PROGRAM_FLASH_TARGET) -$(PROGRAM_FLASH_TARGET) : flash - @if [ "$(FLASHPROG)" = "none" ]; \ - then \ - $(ECHO) Programming flash not supported; \ - else \ - $(ECHO) Info: Programming $(basename $@).flash; \ - if [ -z "$($(basename $@)_EPCS_FLAGS)" ]; \ - then \ - $(ECHO) $(FLASHPROG) $(SOPC_SYSID_FLAG) --base=$($(basename $@)_START) $(basename $@).flash; \ - $(FLASHPROG) $(DOWNLOAD_CABLE_FLAG) $(SOPC_SYSID_FLAG) --base=$($(basename $@)_START) $(basename $@).flash; \ - else \ - $(ECHO) $(FLASHPROG) $(SOPC_SYSID_FLAG) --epcs --base=$($(basename $@)_START) $(basename $@).flash; \ - $(FLASHPROG) $(DOWNLOAD_CABLE_FLAG) $(SOPC_SYSID_FLAG) --epcs --base=$($(basename $@)_START) $(basename $@).flash; \ - fi \ - fi - - -# Rules for simulating with an HDL Simulator [QSYS only] -ifeq ($(QSYS),1) -IP_MAKE_SIMSCRIPT := ip-make-simscript - -ifeq ($(VSIM),) -VSIM_EXE := "$(if $(VSIM_DIR),$(VSIM_DIR)/,)vsim" -ifeq ($(ENABLE_VSIM_GUI),1) -VSIM := $(VSIM_EXE) -gui -else -VSIM := $(VSIM_EXE) -c -endif # ENABLE_VSIM_GUI == 1 -endif # VSIM not set - -ifeq ($(SPD),) -ifneq ($(ABS_QUARTUS_PROJECT_DIR),) -ifneq ($(SOPC_NAME),) -SPD := $(ABS_QUARTUS_PROJECT_DIR)/$(SOPC_NAME)_tb.spd -endif # SOPC_NAME set -endif # ABS_QUARTUS_PROJECT_DIR set -endif # SPD == empty string - -ifeq ($(MSIM_SCRIPT),) -SIM_SCRIPT_DIR := $(RUNTIME_ROOT_DIR)/sim -MSIM_SCRIPT := $(SIM_SCRIPT_DIR)/mentor/msim_setup.tcl -endif # MSIM_SCRIPT == empty string - -ifeq ($(MAKE_VERSION),3.81) -ABS_MEM_INIT_DESCRIPTOR_FILE := $(abspath $(MEM_INIT_DESCRIPTOR_FILE)) -else -ABS_MEM_INIT_DESCRIPTOR_FILE := $(call adjust-path-mixed,$(shell pwd))/$(MEM_INIT_DESCRIPTOR_FILE) -endif - -$(MSIM_SCRIPT): $(SPD) $(MEM_INIT_DESCRIPTOR_FILE) -ifeq ($(SPD),) - $(error No SPD file specified. Ensure QUARTUS_PROJECT_DIR variable is set) -endif - @$(MKDIR) $(SIM_SCRIPT_DIR) - $(IP_MAKE_SIMSCRIPT) --spd=$(SPD) --spd=$(MEM_INIT_DESCRIPTOR_FILE) --output-directory=$(SIM_SCRIPT_DIR) - -VSIM_COMMAND = \ - cd $(dir $(MSIM_SCRIPT)) && \ - $(VSIM) -do "do $(notdir $(MSIM_SCRIPT)); ld; $(if $(VSIM_RUN_TIME),run ${VSIM_RUN_TIME};quit;)" - -.PHONY: sim -sim: $(MSIM_SCRIPT) mem_init_generate -ifeq ($(MSIM_SCRIPT),) - $(error MSIM_SCRIPT not set) -endif - $(VSIM_COMMAND) - -endif # QSYS == 1 - - -#------------------------------------------------------------------------------ -# ELF TARGET RULE -#------------------------------------------------------------------------------ -# Rule for constructing the executable elf file. -$(ELF) : $(APP_OBJS) $(LINKER_SCRIPT) $(APP_LDDEPS) - @$(ECHO) Info: Linking $@ - $(LD) $(APP_LDFLAGS) $(APP_CFLAGS) -o $@ $(filter-out $(CRT0),$(APP_OBJS)) $(APP_LIBS) $(APP_BSP_DEP_LIBS) -ifneq ($(DISABLE_ELFPATCH),1) - $(ELFPATCH) $@ $(ELF_PATCH_FLAG) -endif -ifneq ($(DISABLE_STACKREPORT),1) - @bash -c "$(STACKREPORT) $@" -endif - -$(OBJDUMP_NAME) : $(ELF) - @$(ECHO) Info: Creating $@ - $(OBJDUMP) $(OBJDUMP_FLAGS) $< >$@ - -# Rule for printing the name of the elf file -.PHONY: print-elf-name -print-elf-name: - @$(ECHO) $(ELF) - - diff --git a/software/qsys_tutorial_key3/create-this-app b/software/qsys_tutorial_key3/create-this-app deleted file mode 100644 index c88eacb..0000000 --- a/software/qsys_tutorial_key3/create-this-app +++ /dev/null @@ -1,114 +0,0 @@ -#!/bin/bash -# -# This script creates the hello_world_small application in this directory. - - -BSP_DIR=../qsys_tutorial_key3_bsp -QUARTUS_PROJECT_DIR=../../ -NIOS2_APP_GEN_ARGS="--elf-name qsys_tutorial_key3.elf --set APP_CFLAGS_OPTIMIZATION -Os --set OBJDUMP_INCLUDE_SOURCE 1 --src-files hello_world_small.c" - - -# First, check to see if $SOPC_KIT_NIOS2 environmental variable is set. -# This variable is required for the command line tools to execute correctly. -if [ -z "${SOPC_KIT_NIOS2}" ] -then - echo Required \$SOPC_KIT_NIOS2 Environmental Variable is not set! - exit 1 -fi - - -# Also make sure that the APP has not been created already. Check for -# existence of Makefile in the app directory -if [ -f ./Makefile ] -then - echo Application has already been created! Delete Makefile if you want to create a new application makefile - exit 1 -fi - - -# We are selecting hal_reduced_footprint bsp because it supports this application. -# Check to see if the hal_reduced_footprint has already been generated by checking for -# existence of the public.mk file. If not, we need to run -# create-this-bsp file to generate the bsp. -if [ ! -f ${BSP_DIR}/public.mk ]; then - # Since BSP doesn't exist, create the BSP - # Pass any command line arguments passed to this script to the BSP. - pushd ${BSP_DIR} >> /dev/null - ./create-this-bsp "$@" || { - echo "create-this-bsp failed" - exit 1 - } - popd >> /dev/null -fi - - -# Don't run make if create-this-app script is called with --no-make arg -SKIP_MAKE= -while [ $# -gt 0 ] -do - case "$1" in - --no-make) - SKIP_MAKE=1 - ;; - esac - shift -done - - -# Now we also need to go copy the sources for this application to the -# local directory. -find "${SOPC_KIT_NIOS2}/examples/software/hello_world_small/" -name '*.c' -or -name '*.h' -or -name 'hostfs*' | xargs -i cp -L {} ./ || { - echo "failed during copying example source files" - exit 1 -} - -find "${SOPC_KIT_NIOS2}/examples/software/hello_world_small/" -name 'readme.txt' -or -name 'Readme.txt' | xargs -i cp -L {} ./ || { - echo "failed copying readme file" -} - -if [ -d "${SOPC_KIT_NIOS2}/examples/software/hello_world_small/system" ] -then - cp -RL "${SOPC_KIT_NIOS2}/examples/software/hello_world_small/system" . || { - echo "failed during copying project support files" - exit 1 - } -fi - -chmod -R +w . || { - echo "failed during changing file permissions" - exit 1 -} - -cmd="nios2-app-generate-makefile --bsp-dir ${BSP_DIR} --set QUARTUS_PROJECT_DIR=${QUARTUS_PROJECT_DIR} ${NIOS2_APP_GEN_ARGS}" - -echo "create-this-app: Running \"${cmd}\"" -$cmd || { - echo "nios2-app-generate-makefile failed" - exit 1 -} - -if [ -z "$SKIP_MAKE" ]; then - cmd="make" - - echo "create-this-app: Running \"$cmd\"" - $cmd || { - echo "make failed" - exit 1 - } - - echo - echo "To download and run the application:" - echo " 1. Make sure the board is connected to the system." - echo " 2. Run 'nios2-configure-sof ' to configure the FPGA with the hardware design." - echo " 3. If you have a stdio device, run 'nios2-terminal' in a different shell." - echo " 4. Run 'make download-elf' from the application directory." - echo - echo "To debug the application:" - echo " Import the project into Nios II Software Build Tools for Eclipse." - echo " Refer to Nios II Software Build Tools for Eclipse Documentation for more information." - echo - echo -e "" -fi - - -exit 0 diff --git a/software/qsys_tutorial_key3/hello_world_small.c b/software/qsys_tutorial_key3/hello_world_small.c deleted file mode 100644 index a0c31d7..0000000 --- a/software/qsys_tutorial_key3/hello_world_small.c +++ /dev/null @@ -1,140 +0,0 @@ -/* - * "Small Hello World" example. - * - * This example prints 'Hello from Nios II' to the STDOUT stream. It runs on - * the Nios II 'standard', 'full_featured', 'fast', and 'low_cost' example - * designs. It requires a STDOUT device in your system's hardware. - * - * The purpose of this example is to demonstrate the smallest possible Hello - * World application, using the Nios II HAL library. The memory footprint - * of this hosted application is ~332 bytes by default using the standard - * reference design. For a more fully featured Hello World application - * example, see the example titled "Hello World". - * - * The memory footprint of this example has been reduced by making the - * following changes to the normal "Hello World" example. - * Check in the Nios II Software Developers Manual for a more complete - * description. - * - * In the SW Application project (small_hello_world): - * - * - In the C/C++ Build page - * - * - Set the Optimization Level to -Os - * - * In System Library project (small_hello_world_syslib): - * - In the C/C++ Build page - * - * - Set the Optimization Level to -Os - * - * - Define the preprocessor option ALT_NO_INSTRUCTION_EMULATION - * This removes software exception handling, which means that you cannot - * run code compiled for Nios II cpu with a hardware multiplier on a core - * without a the multiply unit. Check the Nios II Software Developers - * Manual for more details. - * - * - In the System Library page: - * - Set Periodic system timer and Timestamp timer to none - * This prevents the automatic inclusion of the timer driver. - * - * - Set Max file descriptors to 4 - * This reduces the size of the file handle pool. - * - * - Check Main function does not exit - * - Uncheck Clean exit (flush buffers) - * This removes the unneeded call to exit when main returns, since it - * won't. - * - * - Check Don't use C++ - * This builds without the C++ support code. - * - * - Check Small C library - * This uses a reduced functionality C library, which lacks - * support for buffering, file IO, floating point and getch(), etc. - * Check the Nios II Software Developers Manual for a complete list. - * - * - Check Reduced device drivers - * This uses reduced functionality drivers if they're available. For the - * standard design this means you get polled UART and JTAG UART drivers, - * no support for the LCD driver and you lose the ability to program - * CFI compliant flash devices. - * - * - Check Access device drivers directly - * This bypasses the device file system to access device drivers directly. - * This eliminates the space required for the device file system services. - * It also provides a HAL version of libc services that access the drivers - * directly, further reducing space. Only a limited number of libc - * functions are available in this configuration. - * - * - Use ALT versions of stdio routines: - * - * Function Description - * =============== ===================================== - * alt_printf Only supports %s, %x, and %c ( < 1 Kbyte) - * alt_putstr Smaller overhead than puts with direct drivers - * Note this function doesn't add a newline. - * alt_putchar Smaller overhead than putchar with direct drivers - * alt_getchar Smaller overhead than getchar with direct drivers - * - */ - -#include "sys/alt_stdio.h" - -#define switches (volatile int *) 0x0002010 -#define ledrs (volatile int *) 0x0002020 -#define push_switches (volatile char *) 0x0002000 - -typedef struct { - unsigned int other : 10; - unsigned int code : 8; -} switches_t; - -typedef union { - int data; - switches_t sw; -} sw_t; - -void main() -{ - int buf = 0; - unsigned char status = 0; - while(1) { - sw_t s; - s.data = *switches; - - switch (status) { - case 0: - if (*push_switches != 7) status = 1; - buf = s.sw.code; - break; - case 1: - if (*push_switches == 7) status = 2; - break; - case 2: - *ledrs += buf; - status = 0; - break; - default: - status = 0; - break; - } - /* - *ledrs = *push_switches; - s.data = *switches; - *ledrs |= s.sw.code; - */ - //alt_putchar(s.sw.code); - } -#if 0 - unsigned long i = 0; - volatile int j = 0; - while(1){ - *ledrs = i++; - if (i > (unsigned long)1<<18) i = 0; - for (j = 0; j < 100; j++); - } - - //while (1) - //*leds = *switches; -#endif -} diff --git a/software/qsys_tutorial_key3/obj/default/hello_world_small.d b/software/qsys_tutorial_key3/obj/default/hello_world_small.d deleted file mode 100644 index f939c96..0000000 --- a/software/qsys_tutorial_key3/obj/default/hello_world_small.d +++ /dev/null @@ -1,4 +0,0 @@ -obj/default/hello_world_small.o: hello_world_small.c \ - ../qsys_tutorial_key3_bsp//HAL/inc/sys/alt_stdio.h - -../qsys_tutorial_key3_bsp//HAL/inc/sys/alt_stdio.h: diff --git a/software/qsys_tutorial_key3/obj/default/hello_world_small.o b/software/qsys_tutorial_key3/obj/default/hello_world_small.o deleted file mode 100644 index 7685feb..0000000 --- a/software/qsys_tutorial_key3/obj/default/hello_world_small.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3/qsys_tutorial_key3.elf b/software/qsys_tutorial_key3/qsys_tutorial_key3.elf deleted file mode 100644 index e6c5b3c..0000000 --- a/software/qsys_tutorial_key3/qsys_tutorial_key3.elf +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3/qsys_tutorial_key3.map b/software/qsys_tutorial_key3/qsys_tutorial_key3.map deleted file mode 100644 index bb39af4..0000000 --- a/software/qsys_tutorial_key3/qsys_tutorial_key3.map +++ /dev/null @@ -1,412 +0,0 @@ -Archive member included because of file (symbol) - -../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_load.o) - ../qsys_tutorial_key3_bsp//obj/HAL/src/crt0.o (alt_load) -../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_main.o) - ../qsys_tutorial_key3_bsp//obj/HAL/src/crt0.o (alt_main) -../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_sys_init.o) - ../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_main.o) (alt_sys_init) -../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - ../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_load.o) (alt_dcache_flush_all) -../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - ../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_load.o) (alt_icache_flush_all) -../qsys_tutorial_key3_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - ../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_sys_init.o) (altera_nios2_qsys_irq_init) - -Memory Configuration - -Name Origin Length Attributes -reset 0x00000000 0x00000020 -onchip_memory 0x00000020 0x00000fe0 -*default* 0x00000000 0xffffffff - -Linker script and memory map - -LOAD ../qsys_tutorial_key3_bsp//obj/HAL/src/crt0.o - 0x0000000c exit = _exit -LOAD obj/default/hello_world_small.o -LOAD c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libstdc++.a -LOAD c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libm.a -LOAD c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a -START GROUP -LOAD c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a -LOAD c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a -LOAD ../qsys_tutorial_key3_bsp/\libhal_bsp.a -END GROUP -LOAD c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a - 0x00000000 __alt_mem_onchip_memory = 0x0 - -.entry 0x00000000 0x20 - *(.entry) - .entry 0x00000000 0x20 ../qsys_tutorial_key3_bsp//obj/HAL/src/crt0.o - 0x00000000 __reset - 0x0000000c _exit - -.exceptions 0x00000020 0x0 - 0x00000020 PROVIDE (__ram_exceptions_start, ABSOLUTE (.)) - 0x00000020 . = ALIGN (0x20) - *(.irq) - *(.exceptions.entry.label) - *(.exceptions.entry.user) - *(.exceptions.entry) - *(.exceptions.irqtest.user) - *(.exceptions.irqtest) - *(.exceptions.irqhandler.user) - *(.exceptions.irqhandler) - *(.exceptions.irqreturn.user) - *(.exceptions.irqreturn) - *(.exceptions.notirq.label) - *(.exceptions.notirq.user) - *(.exceptions.notirq) - *(.exceptions.soft.user) - *(.exceptions.soft) - *(.exceptions.unknown.user) - *(.exceptions.unknown) - *(.exceptions.exit.label) - *(.exceptions.exit.user) - *(.exceptions.exit) - *(.exceptions) - 0x00000020 PROVIDE (__ram_exceptions_end, ABSOLUTE (.)) - 0x00000020 PROVIDE (__flash_exceptions_start, LOADADDR (.exceptions)) - -.text 0x00000020 0x1b8 - 0x00000020 PROVIDE (stext, ABSOLUTE (.)) - *(.interp) - *(.hash) - *(.dynsym) - *(.dynstr) - *(.gnu.version) - *(.gnu.version_d) - *(.gnu.version_r) - *(.rel.init) - *(.rela.init) - *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) - *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) - *(.rel.fini) - *(.rela.fini) - *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) - *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) - *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) - *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) - *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) - *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) - *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) - *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) - *(.rel.ctors) - *(.rela.ctors) - *(.rel.dtors) - *(.rela.dtors) - *(.rel.got) - *(.rela.got) - *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) - *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) - *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) - *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) - *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) - *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) - *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) - *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) - *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) - *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) - *(.rel.plt) - *(.rela.plt) - *(.rel.dyn) - *(.init) - *(.plt) - *(.text .stub .text.* .gnu.linkonce.t.*) - .text 0x00000020 0x3c ../qsys_tutorial_key3_bsp//obj/HAL/src/crt0.o - 0x00000020 _start - .text 0x0000005c 0x90 obj/default/hello_world_small.o - 0x0000005c main - .text 0x000000ec 0x8c ../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_load.o) - 0x0000010c alt_load - .text 0x00000178 0x2c ../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_main.o) - 0x00000178 alt_main - .text 0x000001a4 0x24 ../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_sys_init.o) - 0x000001a4 alt_sys_init - 0x000001a8 alt_irq_init - .text 0x000001c8 0x4 ../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - 0x000001c8 alt_dcache_flush_all - .text 0x000001cc 0x4 ../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - 0x000001cc alt_icache_flush_all - .text 0x000001d0 0x8 ../qsys_tutorial_key3_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - 0x000001d0 altera_nios2_qsys_irq_init - *(.gnu.warning.*) - *(.fini) - 0x000001d8 PROVIDE (__etext, ABSOLUTE (.)) - 0x000001d8 PROVIDE (_etext, ABSOLUTE (.)) - 0x000001d8 PROVIDE (etext, ABSOLUTE (.)) - *(.eh_frame_hdr) - 0x000001d8 . = ALIGN (0x4) - 0x000001d8 PROVIDE (__preinit_array_start, ABSOLUTE (.)) - *(.preinit_array) - 0x000001d8 PROVIDE (__preinit_array_end, ABSOLUTE (.)) - 0x000001d8 PROVIDE (__init_array_start, ABSOLUTE (.)) - *(.init_array) - 0x000001d8 PROVIDE (__init_array_end, ABSOLUTE (.)) - 0x000001d8 PROVIDE (__fini_array_start, ABSOLUTE (.)) - *(.fini_array) - 0x000001d8 PROVIDE (__fini_array_end, ABSOLUTE (.)) - *(.eh_frame) - *(.gcc_except_table) - *(.dynamic) - 0x000001d8 PROVIDE (__CTOR_LIST__, ABSOLUTE (.)) - *(.ctors) - *(SORT(.ctors.*)) - 0x000001d8 PROVIDE (__CTOR_END__, ABSOLUTE (.)) - 0x000001d8 PROVIDE (__DTOR_LIST__, ABSOLUTE (.)) - *(.dtors) - *(SORT(.dtors.*)) - 0x000001d8 PROVIDE (__DTOR_END__, ABSOLUTE (.)) - *(.jcr) - 0x000001d8 . = ALIGN (0x4) - -.rodata 0x000001d8 0x0 - 0x000001d8 PROVIDE (__ram_rodata_start, ABSOLUTE (.)) - 0x000001d8 . = ALIGN (0x4) - *(.rodata .rodata.* .gnu.linkonce.r.*) - *(.rodata1) - 0x000001d8 . = ALIGN (0x4) - 0x000001d8 PROVIDE (__ram_rodata_end, ABSOLUTE (.)) - 0x000001d8 PROVIDE (__flash_rodata_start, LOADADDR (.rodata)) - -.rwdata 0x000001d8 0x4 load address 0x000001dc - 0x000001d8 PROVIDE (__ram_rwdata_start, ABSOLUTE (.)) - 0x000001d8 . = ALIGN (0x4) - *(.got.plt) - *(.got) - *(.data1) - *(.data .data.* .gnu.linkonce.d.*) - .data 0x000001d8 0x0 ../qsys_tutorial_key3_bsp//obj/HAL/src/crt0.o - .data 0x000001d8 0x0 obj/default/hello_world_small.o - .data 0x000001d8 0x0 ../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_load.o) - .data 0x000001d8 0x0 ../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_main.o) - .data 0x000001d8 0x0 ../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_sys_init.o) - .data 0x000001d8 0x0 ../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .data 0x000001d8 0x0 ../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .data 0x000001d8 0x0 ../qsys_tutorial_key3_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - 0x000081d8 _gp = ABSOLUTE ((. + 0x8000)) - 0x000081d8 PROVIDE (gp, _gp) - *(.rwdata .rwdata.*) - *(.sdata .sdata.* .gnu.linkonce.s.*) - .sdata 0x000001d8 0x4 ../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_sys_init.o) - 0x000001d8 jtag_uart - *(.sdata2 .sdata2.* .gnu.linkonce.s2.*) - 0x000001dc . = ALIGN (0x4) - 0x000001dc _edata = ABSOLUTE (.) - 0x000001dc PROVIDE (edata, ABSOLUTE (.)) - 0x000001dc PROVIDE (__ram_rwdata_end, ABSOLUTE (.)) - 0x000001dc PROVIDE (__flash_rwdata_start, LOADADDR (.rwdata)) - -.bss 0x000001e0 0xc - 0x000001e0 __bss_start = ABSOLUTE (.) - 0x000001e0 PROVIDE (__sbss_start, ABSOLUTE (.)) - 0x000001e0 PROVIDE (___sbss_start, ABSOLUTE (.)) - *(.dynsbss) - *(.sbss .sbss.* .gnu.linkonce.sb.*) - .sbss 0x000001e0 0xc ../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_main.o) - 0x000001e0 alt_argc - 0x000001e4 alt_argv - 0x000001e8 alt_envp - *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) - *(.scommon) - 0x000001ec PROVIDE (__sbss_end, ABSOLUTE (.)) - 0x000001ec PROVIDE (___sbss_end, ABSOLUTE (.)) - *(.dynbss) - *(.bss .bss.* .gnu.linkonce.b.*) - .bss 0x000001ec 0x0 ../qsys_tutorial_key3_bsp//obj/HAL/src/crt0.o - .bss 0x000001ec 0x0 obj/default/hello_world_small.o - .bss 0x000001ec 0x0 ../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_load.o) - .bss 0x000001ec 0x0 ../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_main.o) - .bss 0x000001ec 0x0 ../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_sys_init.o) - .bss 0x000001ec 0x0 ../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .bss 0x000001ec 0x0 ../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .bss 0x000001ec 0x0 ../qsys_tutorial_key3_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - *(COMMON) - 0x000001ec . = ALIGN (0x4) - 0x000001ec __bss_end = ABSOLUTE (.) - -.onchip_memory 0x000001ec 0x0 - 0x000001ec PROVIDE (_alt_partition_onchip_memory_start, ABSOLUTE (.)) - *(.onchip_memory. onchip_memory.*) - 0x000001ec . = ALIGN (0x4) - 0x000001ec PROVIDE (_alt_partition_onchip_memory_end, ABSOLUTE (.)) - 0x000001ec _end = ABSOLUTE (.) - 0x000001ec end = ABSOLUTE (.) - 0x000001ec __alt_stack_base = ABSOLUTE (.) - 0x000001ec PROVIDE (_alt_partition_onchip_memory_load_addr, LOADADDR (.onchip_memory)) - -.stab - *(.stab) - -.stabstr - *(.stabstr) - -.stab.excl - *(.stab.excl) - -.stab.exclstr - *(.stab.exclstr) - -.stab.index - *(.stab.index) - -.stab.indexstr - *(.stab.indexstr) - -.comment 0x00000000 0x26 - *(.comment) - .comment 0x00000000 0x26 obj/default/hello_world_small.o - 0x27 (size before relaxing) - .comment 0x00000000 0x27 ../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_load.o) - .comment 0x00000000 0x27 ../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_main.o) - .comment 0x00000000 0x27 ../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_sys_init.o) - .comment 0x00000000 0x27 ../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .comment 0x00000000 0x27 ../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .comment 0x00000000 0x27 ../qsys_tutorial_key3_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - -.debug - *(.debug) - -.line - *(.line) - -.debug_srcinfo - *(.debug_srcinfo) - -.debug_sfnames - *(.debug_sfnames) - -.debug_aranges 0x00000000 0x108 - *(.debug_aranges) - .debug_aranges - 0x00000000 0x28 ../qsys_tutorial_key3_bsp//obj/HAL/src/crt0.o - .debug_aranges - 0x00000028 0x20 obj/default/hello_world_small.o - .debug_aranges - 0x00000048 0x20 ../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_load.o) - .debug_aranges - 0x00000068 0x20 ../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_main.o) - .debug_aranges - 0x00000088 0x20 ../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_sys_init.o) - .debug_aranges - 0x000000a8 0x20 ../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .debug_aranges - 0x000000c8 0x20 ../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .debug_aranges - 0x000000e8 0x20 ../qsys_tutorial_key3_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - -.debug_pubnames - 0x00000000 0x149 - *(.debug_pubnames) - .debug_pubnames - 0x00000000 0x1b obj/default/hello_world_small.o - .debug_pubnames - 0x0000001b 0x1f ../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_load.o) - .debug_pubnames - 0x0000003a 0x46 ../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_main.o) - .debug_pubnames - 0x00000080 0x42 ../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_sys_init.o) - .debug_pubnames - 0x000000c2 0x2b ../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .debug_pubnames - 0x000000ed 0x2b ../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .debug_pubnames - 0x00000118 0x31 ../qsys_tutorial_key3_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - -.debug_info 0x00000000 0x6dd - *(.debug_info .gnu.linkonce.wi.*) - .debug_info 0x00000000 0x82 ../qsys_tutorial_key3_bsp//obj/HAL/src/crt0.o - .debug_info 0x00000082 0xe4 obj/default/hello_world_small.o - .debug_info 0x00000166 0x12e ../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_load.o) - .debug_info 0x00000294 0x125 ../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_main.o) - .debug_info 0x000003b9 0x17d ../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_sys_init.o) - .debug_info 0x00000536 0x8d ../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .debug_info 0x000005c3 0x8d ../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .debug_info 0x00000650 0x8d ../qsys_tutorial_key3_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - -.debug_abbrev 0x00000000 0x3ba - *(.debug_abbrev) - .debug_abbrev 0x00000000 0x12 ../qsys_tutorial_key3_bsp//obj/HAL/src/crt0.o - .debug_abbrev 0x00000012 0xcb obj/default/hello_world_small.o - .debug_abbrev 0x000000dd 0x97 ../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_load.o) - .debug_abbrev 0x00000174 0xa6 ../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_main.o) - .debug_abbrev 0x0000021a 0xe3 ../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_sys_init.o) - .debug_abbrev 0x000002fd 0x3f ../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .debug_abbrev 0x0000033c 0x3f ../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .debug_abbrev 0x0000037b 0x3f ../qsys_tutorial_key3_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - -.debug_line 0x00000000 0xe24 - *(.debug_line) - .debug_line 0x00000000 0x66 ../qsys_tutorial_key3_bsp//obj/HAL/src/crt0.o - .debug_line 0x00000066 0x127 obj/default/hello_world_small.o - .debug_line 0x0000018d 0x217 ../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_load.o) - .debug_line 0x000003a4 0x2c2 ../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_main.o) - .debug_line 0x00000666 0x286 ../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_sys_init.o) - .debug_line 0x000008ec 0x1b5 ../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .debug_line 0x00000aa1 0x1b5 ../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .debug_line 0x00000c56 0x1ce ../qsys_tutorial_key3_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - -.debug_frame 0x00000000 0x118 - *(.debug_frame) - .debug_frame 0x00000000 0x20 obj/default/hello_world_small.o - .debug_frame 0x00000020 0x38 ../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_load.o) - .debug_frame 0x00000058 0x28 ../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_main.o) - .debug_frame 0x00000080 0x38 ../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_sys_init.o) - .debug_frame 0x000000b8 0x20 ../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .debug_frame 0x000000d8 0x20 ../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .debug_frame 0x000000f8 0x20 ../qsys_tutorial_key3_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - -.debug_str 0x00000000 0x3ed - *(.debug_str) - .debug_str 0x00000000 0xa2 obj/default/hello_world_small.o - 0xb4 (size before relaxing) - .debug_str 0x000000a2 0x184 ../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_load.o) - 0x1d7 (size before relaxing) - .debug_str 0x00000226 0x75 ../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_main.o) - 0x15b (size before relaxing) - .debug_str 0x0000029b 0xaf ../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_sys_init.o) - 0x1ce (size before relaxing) - .debug_str 0x0000034a 0x34 ../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - 0x11a (size before relaxing) - .debug_str 0x0000037e 0x34 ../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - 0x11a (size before relaxing) - .debug_str 0x000003b2 0x3b ../qsys_tutorial_key3_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - 0x121 (size before relaxing) - -.debug_loc 0x00000000 0xb7 - *(.debug_loc) - .debug_loc 0x00000000 0x47 obj/default/hello_world_small.o - .debug_loc 0x00000047 0x1f ../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_load.o) - .debug_loc 0x00000066 0x1f ../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_main.o) - .debug_loc 0x00000085 0x32 ../qsys_tutorial_key3_bsp/\libhal_bsp.a(alt_sys_init.o) - -.debug_macinfo - *(.debug_macinfo) - -.debug_weaknames - *(.debug_weaknames) - -.debug_funcnames - *(.debug_funcnames) - -.debug_typenames - *(.debug_typenames) - -.debug_varnames - *(.debug_varnames) - -.debug_alt_sim_info - 0x00000000 0x10 - *(.debug_alt_sim_info) - .debug_alt_sim_info - 0x00000000 0x10 ../qsys_tutorial_key3_bsp//obj/HAL/src/crt0.o - 0x00001000 __alt_data_end = 0x1000 - 0x00001000 PROVIDE (__alt_stack_pointer, __alt_data_end) - 0x000001ec PROVIDE (__alt_stack_limit, __alt_stack_base) - 0x000001ec PROVIDE (__alt_heap_start, end) - 0x00001000 PROVIDE (__alt_heap_limit, 0x1000) -OUTPUT(qsys_tutorial_key3.elf elf32-littlenios2) - -.debug_ranges 0x00000000 0x20 - .debug_ranges 0x00000000 0x20 ../qsys_tutorial_key3_bsp//obj/HAL/src/crt0.o diff --git a/software/qsys_tutorial_key3/qsys_tutorial_key3.objdump b/software/qsys_tutorial_key3/qsys_tutorial_key3.objdump deleted file mode 100644 index 6467fbd..0000000 --- a/software/qsys_tutorial_key3/qsys_tutorial_key3.objdump +++ /dev/null @@ -1,523 +0,0 @@ - -qsys_tutorial_key3.elf: file format elf32-littlenios2 -qsys_tutorial_key3.elf -architecture: nios2, flags 0x00000112: -EXEC_P, HAS_SYMS, D_PAGED -start address 0x00000020 - -Program Header: - LOAD off 0x00001000 vaddr 0x00000000 paddr 0x00000000 align 2**12 - filesz 0x00000020 memsz 0x00000020 flags r-x - LOAD off 0x00001020 vaddr 0x00000020 paddr 0x00000020 align 2**12 - filesz 0x000001b8 memsz 0x000001b8 flags r-x - LOAD off 0x000011d8 vaddr 0x000001d8 paddr 0x000001dc align 2**12 - filesz 0x00000004 memsz 0x00000004 flags rw- - LOAD off 0x000011e0 vaddr 0x000001e0 paddr 0x000001e0 align 2**12 - filesz 0x00000000 memsz 0x0000000c flags rw- - -Sections: -Idx Name Size VMA LMA File off Algn - 0 .entry 00000020 00000000 00000000 00001000 2**5 - CONTENTS, ALLOC, LOAD, READONLY, CODE - 1 .text 000001b8 00000020 00000020 00001020 2**2 - CONTENTS, ALLOC, LOAD, READONLY, CODE - 2 .rwdata 00000004 000001d8 000001dc 000011d8 2**2 - CONTENTS, ALLOC, LOAD, DATA, SMALL_DATA - 3 .bss 0000000c 000001e0 000001e0 000011e0 2**2 - ALLOC, SMALL_DATA - 4 .comment 00000026 00000000 00000000 000011dc 2**0 - CONTENTS, READONLY - 5 .debug_aranges 00000108 00000000 00000000 00001208 2**3 - CONTENTS, READONLY, DEBUGGING - 6 .debug_pubnames 00000149 00000000 00000000 00001310 2**0 - CONTENTS, READONLY, DEBUGGING - 7 .debug_info 000006dd 00000000 00000000 00001459 2**0 - CONTENTS, READONLY, DEBUGGING - 8 .debug_abbrev 000003ba 00000000 00000000 00001b36 2**0 - CONTENTS, READONLY, DEBUGGING - 9 .debug_line 00000e24 00000000 00000000 00001ef0 2**0 - CONTENTS, READONLY, DEBUGGING - 10 .debug_frame 00000118 00000000 00000000 00002d14 2**2 - CONTENTS, READONLY, DEBUGGING - 11 .debug_str 000003ed 00000000 00000000 00002e2c 2**0 - CONTENTS, READONLY, DEBUGGING - 12 .debug_loc 000000b7 00000000 00000000 00003219 2**0 - CONTENTS, READONLY, DEBUGGING - 13 .debug_alt_sim_info 00000010 00000000 00000000 000032d0 2**2 - CONTENTS, READONLY, DEBUGGING - 14 .debug_ranges 00000020 00000000 00000000 000032e0 2**3 - CONTENTS, READONLY, DEBUGGING - 15 .thread_model 00000003 00000000 00000000 00003f17 2**0 - CONTENTS, READONLY - 16 .cpu 0000000f 00000000 00000000 00003f1a 2**0 - CONTENTS, READONLY - 17 .qsys 00000001 00000000 00000000 00003f29 2**0 - CONTENTS, READONLY - 18 .simulation_enabled 00000001 00000000 00000000 00003f2a 2**0 - CONTENTS, READONLY - 19 .stderr_dev 00000009 00000000 00000000 00003f2b 2**0 - CONTENTS, READONLY - 20 .stdin_dev 00000009 00000000 00000000 00003f34 2**0 - CONTENTS, READONLY - 21 .stdout_dev 00000009 00000000 00000000 00003f3d 2**0 - CONTENTS, READONLY - 22 .sopc_system_name 0000000b 00000000 00000000 00003f46 2**0 - CONTENTS, READONLY - 23 .quartus_project_dir 00000030 00000000 00000000 00003f51 2**0 - CONTENTS, READONLY - 24 .sopcinfo 0003d17e 00000000 00000000 00003f81 2**0 - CONTENTS, READONLY -SYMBOL TABLE: -00000000 l d .entry 00000000 .entry -00000020 l d .text 00000000 .text -000001d8 l d .rwdata 00000000 .rwdata -000001e0 l d .bss 00000000 .bss -00000000 l d .comment 00000000 .comment -00000000 l d .debug_aranges 00000000 .debug_aranges -00000000 l d .debug_pubnames 00000000 .debug_pubnames -00000000 l d .debug_info 00000000 .debug_info -00000000 l d .debug_abbrev 00000000 .debug_abbrev -00000000 l d .debug_line 00000000 .debug_line -00000000 l d .debug_frame 00000000 .debug_frame -00000000 l d .debug_str 00000000 .debug_str -00000000 l d .debug_loc 00000000 .debug_loc -00000000 l d .debug_alt_sim_info 00000000 .debug_alt_sim_info -00000000 l d .debug_ranges 00000000 .debug_ranges -00000058 l .text 00000000 alt_after_alt_main -00000000 l df *ABS* 00000000 hello_world_small.c -00000000 l df *ABS* 00000000 alt_load.c -000000ec l F .text 00000020 alt_load_section -00000000 l df *ABS* 00000000 alt_main.c -00000000 l df *ABS* 00000000 alt_sys_init.c -00000000 l df *ABS* 00000000 alt_dcache_flush_all.c -00000000 l df *ABS* 00000000 alt_icache_flush_all.c -00000000 l df *ABS* 00000000 altera_nios2_qsys_irq.c -00000178 g F .text 0000002c alt_main -000001dc g *ABS* 00000000 __flash_rwdata_start -000001d8 g O .rwdata 00000004 jtag_uart -00000000 g F .entry 0000000c __reset -00000020 g *ABS* 00000000 __flash_exceptions_start -000001e4 g O .bss 00000004 alt_argv -000081d8 g *ABS* 00000000 _gp -000001ec g *ABS* 00000000 __bss_end -000001c8 g F .text 00000004 alt_dcache_flush_all -000001dc g *ABS* 00000000 __ram_rwdata_end -00000000 g *ABS* 00000000 __alt_mem_onchip_memory -000001d8 g *ABS* 00000000 __ram_rodata_end -000001ec g *ABS* 00000000 end -00001000 g *ABS* 00000000 __alt_stack_pointer -00000020 g F .text 0000003c _start -000001a4 g F .text 00000004 alt_sys_init -000001d8 g *ABS* 00000000 __ram_rwdata_start -000001d8 g *ABS* 00000000 __ram_rodata_start -000001ec g *ABS* 00000000 __alt_stack_base -000001e0 g *ABS* 00000000 __bss_start -0000005c g F .text 00000090 main -000001e8 g O .bss 00000004 alt_envp -000001d8 g *ABS* 00000000 __flash_rodata_start -000001a8 g F .text 00000020 alt_irq_init -000001e0 g O .bss 00000004 alt_argc -00000020 g *ABS* 00000000 __ram_exceptions_start -000001dc g *ABS* 00000000 _edata -000001ec g *ABS* 00000000 _end -00000020 g *ABS* 00000000 __ram_exceptions_end -000001d0 g F .text 00000008 altera_nios2_qsys_irq_init -0000000c g .entry 00000000 exit -00001000 g *ABS* 00000000 __alt_data_end -0000000c g .entry 00000000 _exit -000001cc g F .text 00000004 alt_icache_flush_all -0000010c g F .text 0000006c alt_load - - - -Disassembly of section .entry: - -00000000 <__reset>: - * Jump to the _start entry point in the .text section if reset code - * is allowed or if optimizing for RTL simulation. - */ -#if defined(ALT_ALLOW_CODE_AT_RESET) || defined(ALT_SIM_OPTIMIZE) - /* Jump to the _start entry point in the .text section. */ - movhi r1, %hi(_start) - 0: 00400034 movhi at,0 - ori r1, r1, %lo(_start) - 4: 08400814 ori at,at,32 - jmp r1 - 8: 0800683a jmp at - -0000000c <_exit>: - ... - -Disassembly of section .text: - -00000020 <_start>: -#if (NIOS2_NUM_OF_SHADOW_REG_SETS == 0) - /* - * Now that the caches are initialized, set up the stack pointer. - * The value provided by the linker is assumed to be correctly aligned. - */ - movhi sp, %hi(__alt_stack_pointer) - 20: 06c00034 movhi sp,0 - ori sp, sp, %lo(__alt_stack_pointer) - 24: dec40014 ori sp,sp,4096 - - /* Set up the global pointer. */ - movhi gp, %hi(_gp) - 28: 06800034 movhi gp,0 - ori gp, gp, %lo(_gp) - 2c: d6a07614 ori gp,gp,33240 - */ -#ifndef ALT_SIM_OPTIMIZE - /* Log that the BSS is about to be cleared. */ - ALT_LOG_PUTS(alt_log_msg_bss) - - movhi r2, %hi(__bss_start) - 30: 00800034 movhi r2,0 - ori r2, r2, %lo(__bss_start) - 34: 10807814 ori r2,r2,480 - - movhi r3, %hi(__bss_end) - 38: 00c00034 movhi r3,0 - ori r3, r3, %lo(__bss_end) - 3c: 18c07b14 ori r3,r3,492 - - beq r2, r3, 1f - 40: 10c00326 beq r2,r3,50 <_start+0x30> - -0: - stw zero, (r2) - 44: 10000015 stw zero,0(r2) - addi r2, r2, 4 - 48: 10800104 addi r2,r2,4 - bltu r2, r3, 0b - 4c: 10fffd36 bltu r2,r3,44 <_start+0x24> - * section aren't defined until alt_load() has been called). - */ - mov et, zero -#endif - - call alt_load - 50: 000010c0 call 10c - - /* Log that alt_main is about to be called. */ - ALT_LOG_PUTS(alt_log_msg_alt_main) - - /* Call the C entry point. It should never return. */ - call alt_main - 54: 00001780 call 178 - -00000058 : - - /* Wait in infinite loop in case alt_main does return. */ -alt_after_alt_main: - br alt_after_alt_main - 58: 003fff06 br 58 - -0000005c
: -{ - int buf = 0; - unsigned char status = 0; - while(1) { - sw_t s; - s.data = *switches; - 5c: 00880404 movi r2,8208 - 60: 10c00017 ldw r3,0(r2) - 64: 00000d06 br 9c - 68: 01400084 movi r5,2 - 6c: 00880404 movi r2,8208 - - switch (status) { - 70: 29003fcc andi r4,r5,255 - 74: 00c00044 movi r3,1 -{ - int buf = 0; - unsigned char status = 0; - while(1) { - sw_t s; - s.data = *switches; - 78: 10800017 ldw r2,0(r2) - - switch (status) { - 7c: 20c00e26 beq r4,r3,b8 - break; - case 1: - if (*push_switches == 7) status = 2; - break; - case 2: - *ledrs += buf; - 80: 01880804 movi r6,8224 - unsigned char status = 0; - while(1) { - sw_t s; - s.data = *switches; - - switch (status) { - 84: 000b883a mov r5,zero - 88: 20c00336 bltu r4,r3,98 - 8c: 00800084 movi r2,2 - 90: 20801126 beq r4,r2,d8 - 94: 003ff506 br 6c - 98: 1007883a mov r3,r2 - case 0: - if (*push_switches != 7) status = 1; - 9c: 00880004 movi r2,8192 - a0: 10800003 ldbu r2,0(r2) - buf = s.sw.code; - a4: 1806d2ba srli r3,r3,10 - sw_t s; - s.data = *switches; - - switch (status) { - case 0: - if (*push_switches != 7) status = 1; - a8: 108001d8 cmpnei r2,r2,7 - ac: 100b883a mov r5,r2 - buf = s.sw.code; - b0: 19c03fcc andi r7,r3,255 - b4: 003fed06 br 6c - break; - case 1: - if (*push_switches == 7) status = 2; - b8: 00880004 movi r2,8192 - bc: 10800003 ldbu r2,0(r2) - c0: 00c001c4 movi r3,7 - c4: 10803fcc andi r2,r2,255 - c8: 1080201c xori r2,r2,128 - cc: 10bfe004 addi r2,r2,-128 - d0: 10ffe61e bne r2,r3,6c - d4: 003fe406 br 68 - break; - case 2: - *ledrs += buf; - d8: 30800017 ldw r2,0(r6) - dc: 000b883a mov r5,zero - e0: 11c5883a add r2,r2,r7 - e4: 30800015 stw r2,0(r6) - e8: 003fe006 br 6c - -000000ec : - -static void ALT_INLINE alt_load_section (alt_u32* from, - alt_u32* to, - alt_u32* end) -{ - if (to != from) - ec: 2900051e bne r5,r4,104 - f0: f800283a ret - { - while( to != end ) - { - *to++ = *from++; - f4: 20800017 ldw r2,0(r4) - f8: 21000104 addi r4,r4,4 - fc: 28800015 stw r2,0(r5) - 100: 29400104 addi r5,r5,4 - alt_u32* to, - alt_u32* end) -{ - if (to != from) - { - while( to != end ) - 104: 29bffb1e bne r5,r6,f4 - 108: f800283a ret - -0000010c : - * there is no bootloader, so this application is responsible for loading to - * RAM any sections that are required. - */ - -void alt_load (void) -{ - 10c: deffff04 addi sp,sp,-4 - /* - * Copy the .rwdata section. - */ - - alt_load_section (&__flash_rwdata_start, - 110: 01000034 movhi r4,0 - 114: 21007704 addi r4,r4,476 - 118: 01400034 movhi r5,0 - 11c: 29407604 addi r5,r5,472 - 120: 01800034 movhi r6,0 - 124: 31807704 addi r6,r6,476 - * there is no bootloader, so this application is responsible for loading to - * RAM any sections that are required. - */ - -void alt_load (void) -{ - 128: dfc00015 stw ra,0(sp) - /* - * Copy the .rwdata section. - */ - - alt_load_section (&__flash_rwdata_start, - 12c: 00000ec0 call ec - - /* - * Copy the exception handler. - */ - - alt_load_section (&__flash_exceptions_start, - 130: 01000034 movhi r4,0 - 134: 21000804 addi r4,r4,32 - 138: 01400034 movhi r5,0 - 13c: 29400804 addi r5,r5,32 - 140: 01800034 movhi r6,0 - 144: 31800804 addi r6,r6,32 - 148: 00000ec0 call ec - - /* - * Copy the .rodata section. - */ - - alt_load_section (&__flash_rodata_start, - 14c: 01000034 movhi r4,0 - 150: 21007604 addi r4,r4,472 - 154: 01400034 movhi r5,0 - 158: 29407604 addi r5,r5,472 - 15c: 01800034 movhi r6,0 - 160: 31807604 addi r6,r6,472 - 164: 00000ec0 call ec - - /* - * Now ensure that the caches are in synch. - */ - - alt_dcache_flush_all(); - 168: 00001c80 call 1c8 - alt_icache_flush_all(); -} - 16c: dfc00017 ldw ra,0(sp) - 170: dec00104 addi sp,sp,4 - /* - * Now ensure that the caches are in synch. - */ - - alt_dcache_flush_all(); - alt_icache_flush_all(); - 174: 00001cc1 jmpi 1cc - -00000178 : - * devices/filesystems/components in the system; and call the entry point for - * the users application, i.e. main(). - */ - -void alt_main (void) -{ - 178: deffff04 addi sp,sp,-4 -#endif - - /* ALT LOG - please see HAL/sys/alt_log_printf.h for details */ - ALT_LOG_PRINT_BOOT("[alt_main.c] Entering alt_main, calling alt_irq_init.\r\n"); - /* Initialize the interrupt controller. */ - alt_irq_init (NULL); - 17c: 0009883a mov r4,zero - * devices/filesystems/components in the system; and call the entry point for - * the users application, i.e. main(). - */ - -void alt_main (void) -{ - 180: dfc00015 stw ra,0(sp) -#endif - - /* ALT LOG - please see HAL/sys/alt_log_printf.h for details */ - ALT_LOG_PRINT_BOOT("[alt_main.c] Entering alt_main, calling alt_irq_init.\r\n"); - /* Initialize the interrupt controller. */ - alt_irq_init (NULL); - 184: 00001a80 call 1a8 - ALT_LOG_PRINT_BOOT("[alt_main.c] Done OS Init, calling alt_sem_create.\r\n"); - ALT_SEM_CREATE (&alt_fd_list_lock, 1); - - /* Initialize the device drivers/software components. */ - ALT_LOG_PRINT_BOOT("[alt_main.c] Calling alt_sys_init.\r\n"); - alt_sys_init(); - 188: 00001a40 call 1a4 - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Calling main.\r\n"); - -#ifdef ALT_NO_EXIT - main (alt_argc, alt_argv, alt_envp); - 18c: d1200217 ldw r4,-32760(gp) - 190: d1600317 ldw r5,-32756(gp) - 194: d1a00417 ldw r6,-32752(gp) - close(STDOUT_FILENO); - exit (result); -#endif - - ALT_LOG_PRINT_BOOT("[alt_main.c] After main - we should not be here?.\r\n"); -} - 198: dfc00017 ldw ra,0(sp) - 19c: dec00104 addi sp,sp,4 - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Calling main.\r\n"); - -#ifdef ALT_NO_EXIT - main (alt_argc, alt_argv, alt_envp); - 1a0: 000005c1 jmpi 5c
- -000001a4 : - */ - -void alt_sys_init( void ) -{ - ALTERA_AVALON_JTAG_UART_INIT ( JTAG_UART, jtag_uart); -} - 1a4: f800283a ret - -000001a8 : - * The "base" parameter is ignored and only - * present for backwards-compatibility. - */ - -void alt_irq_init ( const void* base ) -{ - 1a8: deffff04 addi sp,sp,-4 - 1ac: dfc00015 stw ra,0(sp) - ALTERA_NIOS2_QSYS_IRQ_INIT ( NIOS2_PROCESSOR, nios2_processor); - 1b0: 00001d00 call 1d0 - * alt_irq_cpu_enable_interrupts() enables the CPU to start taking interrupts. - */ -static ALT_INLINE void ALT_ALWAYS_INLINE - alt_irq_cpu_enable_interrupts () -{ - NIOS2_WRITE_STATUS(NIOS2_STATUS_PIE_MSK - 1b4: 00800044 movi r2,1 - 1b8: 1001703a wrctl status,r2 - alt_irq_cpu_enable_interrupts(); -} - 1bc: dfc00017 ldw ra,0(sp) - 1c0: dec00104 addi sp,sp,4 - 1c4: f800283a ret - -000001c8 : - for (i = (char*) 0; i < (char*) NIOS2_DCACHE_SIZE; i+= NIOS2_DCACHE_LINE_SIZE) - { - __asm__ volatile ("flushd (%0)" :: "r" (i)); - } -#endif /* NIOS2_DCACHE_SIZE > 0 */ -} - 1c8: f800283a ret - -000001cc : -void alt_icache_flush_all (void) -{ -#if NIOS2_ICACHE_SIZE > 0 - alt_icache_flush (0, NIOS2_ICACHE_SIZE); -#endif -} - 1cc: f800283a ret - -000001d0 : - * To initialize the internal interrupt controller, just clear the IENABLE - * register so that all possible IRQs are disabled. - */ -void altera_nios2_qsys_irq_init(void) -{ - NIOS2_WRITE_IENABLE(0); - 1d0: 000170fa wrctl ienable,zero -} - 1d4: f800283a ret diff --git a/software/qsys_tutorial_key3/readme.txt b/software/qsys_tutorial_key3/readme.txt deleted file mode 100644 index 3dc3186..0000000 --- a/software/qsys_tutorial_key3/readme.txt +++ /dev/null @@ -1,67 +0,0 @@ -Readme - Hello World Software Example - -DESCRIPTION: -Simple program that prints "Hello from Nios II" - -The purpose of this example is to demonstrate the smallest possible Hello -World application, using the Nios II HAL BSP. The memory footprint -of this hosted application is intended to be less than 1 kbytes by default using a standard -reference design. For a more fully featured Hello World application -example, see the example titled "Hello World". - -The memory footprint of this example has been reduced by making the -following changes to the normal "Hello World" example. -Check in the Nios II Software Developers Handbook for a more complete -description. - -In the SW Application project: - - In the C/C++ Build page - - Set the Optimization Level to -Os - -In BSP project: - - In the C/C++ Build page - - - Set the Optimization Level to -Os - - - Define the preprocessor option ALT_NO_INSTRUCTION_EMULATION - This removes software exception handling, which means that you cannot - run code compiled for Nios II cpu with a hardware multiplier on a core - without a the multiply unit. Check the Nios II Software Developers - Manual for more details. - - - In the BSP: - - Set Periodic system timer and Timestamp timer to none - This prevents the automatic inclusion of the timer driver. - - - Set Max file descriptors to 4 - This reduces the size of the file handle pool. - - - Uncheck Clean exit (flush buffers) - This removes the call to exit, and when main is exitted instead of - calling exit the software will just spin in a loop. - - - Check Small C library - This uses a reduced functionality C library, which lacks - support for buffering, file IO, floating point and getch(), etc. - Check the Nios II Software Developers Manual for a complete list. - - - Check Reduced device drivers - This uses reduced functionality drivers if they're available. For the - standard design this means you get polled UART and JTAG UART drivers, - no support for the LCD driver and you lose the ability to program - CFI compliant flash devices. - - -PERIPHERALS USED: -This example exercises the following peripherals: -- STDOUT device (UART or JTAG UART) - -SOFTWARE SOURCE FILES: -This example includes the following software source files: -- small_hello_world.c: - -BOARD/HOST REQUIREMENTS: -This example requires only a JTAG connection with a Nios Development board. If -the host communication settings are changed from JTAG UART (default) to use a -conventional UART, a serial cable between board DB-9 connector and the host is -required. diff --git a/software/qsys_tutorial_key3/system/template.xml b/software/qsys_tutorial_key3/system/template.xml deleted file mode 100644 index b09e912..0000000 --- a/software/qsys_tutorial_key3/system/template.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git a/software/qsys_tutorial_key3_bsp/.cproject b/software/qsys_tutorial_key3_bsp/.cproject deleted file mode 100644 index 0c0aa28..0000000 --- a/software/qsys_tutorial_key3_bsp/.cproject +++ /dev/null @@ -1,481 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/software/qsys_tutorial_key3_bsp/.project b/software/qsys_tutorial_key3_bsp/.project deleted file mode 100644 index da645a5..0000000 --- a/software/qsys_tutorial_key3_bsp/.project +++ /dev/null @@ -1,85 +0,0 @@ - - - qsys_tutorial_key3_bsp - - - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - ?name? - - - - org.eclipse.cdt.make.core.append_environment - true - - - org.eclipse.cdt.make.core.autoBuildTarget - all - - - org.eclipse.cdt.make.core.buildArguments - - - - org.eclipse.cdt.make.core.buildCommand - make - - - org.eclipse.cdt.make.core.buildLocation - ${workspace_loc://qsys_tutorial_key3_bsp} - - - org.eclipse.cdt.make.core.cleanBuildTarget - clean - - - org.eclipse.cdt.make.core.contents - org.eclipse.cdt.make.core.activeConfigSettings - - - org.eclipse.cdt.make.core.enableAutoBuild - false - - - org.eclipse.cdt.make.core.enableCleanBuild - true - - - org.eclipse.cdt.make.core.enableFullBuild - true - - - org.eclipse.cdt.make.core.fullBuildTarget - all - - - org.eclipse.cdt.make.core.stopOnError - true - - - org.eclipse.cdt.make.core.useDefaultBuildCmd - true - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - org.eclipse.cdt.core.ccnature - com.altera.sbtgui.project.SBTGUINature - com.altera.sbtgui.project.SBTGUIBspNature - - diff --git a/software/qsys_tutorial_key3_bsp/HAL/inc/alt_types.h b/software/qsys_tutorial_key3_bsp/HAL/inc/alt_types.h deleted file mode 100644 index d02f171..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/inc/alt_types.h +++ /dev/null @@ -1,54 +0,0 @@ -#ifndef __ALT_TYPES_H__ -#define __ALT_TYPES_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/* - * Don't declare these typedefs if this file is included by assembly source. - */ -#ifndef ALT_ASM_SRC -typedef signed char alt_8; -typedef unsigned char alt_u8; -typedef signed short alt_16; -typedef unsigned short alt_u16; -typedef signed long alt_32; -typedef unsigned long alt_u32; -typedef long long alt_64; -typedef unsigned long long alt_u64; -#endif - -#define ALT_INLINE __inline__ -#define ALT_ALWAYS_INLINE __attribute__ ((always_inline)) -#define ALT_WEAK __attribute__((weak)) - -#endif /* __ALT_TYPES_H__ */ diff --git a/software/qsys_tutorial_key3_bsp/HAL/inc/altera_nios2_qsys_irq.h b/software/qsys_tutorial_key3_bsp/HAL/inc/altera_nios2_qsys_irq.h deleted file mode 100644 index 6629ec9..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/inc/altera_nios2_qsys_irq.h +++ /dev/null @@ -1,80 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * Support for the Nios II internal interrupt controller. - */ - -#ifndef __ALT_NIOS2_QSYS_IRQ_H__ -#define __ALT_NIOS2_QSYS_IRQ_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The macro ALTERA_NIOS2_IRQ_INSTANCE is used by the alt_irq_init() - * function in the auto-generated file alt_sys_init.c to create an - * instance of this interrupt controller device driver state if this - * module contains an interrupt controller. - * Only one instance of a Nios II is allowed so this macro is just empty. - */ - -#define ALTERA_NIOS2_QSYS_IRQ_INSTANCE(name, state) - -/* - * altera_nios2_irq_init() is called by the auto-generated function - * alt_irq_init() once for the Nios II if it contains an interrupt controller. - * The altera_nios2_irq_init() routine is called using the - * ALTERA_NIOS2_IRQ_INIT macro given below. - * - * This function initializes the internal interrupt controller - * so is not called if the Nios II contains an external interrupt - * controller port (because the internal interrupt controller - * is removed if this port is present). - */ - -extern void altera_nios2_qsys_irq_init( void ); - -/* - * The macro ALTERA_NIOS2_IRQ_INIT is used by the alt_irq_init() routine - * in the auto-generated file alt_sys_init.c to initialize an instance - * of the interrupt controller device driver state. - */ - -#define ALTERA_NIOS2_QSYS_IRQ_INIT(name, state) altera_nios2_qsys_irq_init() - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_NIOS2_QSYS_IRQ_H__ */ - diff --git a/software/qsys_tutorial_key3_bsp/HAL/inc/io.h b/software/qsys_tutorial_key3_bsp/HAL/inc/io.h deleted file mode 100644 index 362f103..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/inc/io.h +++ /dev/null @@ -1,81 +0,0 @@ -#ifndef __IO_H__ -#define __IO_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/* IO Header file for Nios II Toolchain */ - -#include "alt_types.h" -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#ifndef SYSTEM_BUS_WIDTH -#error SYSTEM_BUS_WIDTH undefined -#endif - -/* Dynamic bus access functions */ - -#define __IO_CALC_ADDRESS_DYNAMIC(BASE, OFFSET) \ - ((void *)(((alt_u8*)BASE) + (OFFSET))) - -#define IORD_32DIRECT(BASE, OFFSET) \ - __builtin_ldwio (__IO_CALC_ADDRESS_DYNAMIC ((BASE), (OFFSET))) -#define IORD_16DIRECT(BASE, OFFSET) \ - __builtin_ldhuio (__IO_CALC_ADDRESS_DYNAMIC ((BASE), (OFFSET))) -#define IORD_8DIRECT(BASE, OFFSET) \ - __builtin_ldbuio (__IO_CALC_ADDRESS_DYNAMIC ((BASE), (OFFSET))) - -#define IOWR_32DIRECT(BASE, OFFSET, DATA) \ - __builtin_stwio (__IO_CALC_ADDRESS_DYNAMIC ((BASE), (OFFSET)), (DATA)) -#define IOWR_16DIRECT(BASE, OFFSET, DATA) \ - __builtin_sthio (__IO_CALC_ADDRESS_DYNAMIC ((BASE), (OFFSET)), (DATA)) -#define IOWR_8DIRECT(BASE, OFFSET, DATA) \ - __builtin_stbio (__IO_CALC_ADDRESS_DYNAMIC ((BASE), (OFFSET)), (DATA)) - -/* Native bus access functions */ - -#define __IO_CALC_ADDRESS_NATIVE(BASE, REGNUM) \ - ((void *)(((alt_u8*)BASE) + ((REGNUM) * (SYSTEM_BUS_WIDTH/8)))) - -#define IORD(BASE, REGNUM) \ - __builtin_ldwio (__IO_CALC_ADDRESS_NATIVE ((BASE), (REGNUM))) -#define IOWR(BASE, REGNUM, DATA) \ - __builtin_stwio (__IO_CALC_ADDRESS_NATIVE ((BASE), (REGNUM)), (DATA)) - -#ifdef __cplusplus -} -#endif - -#endif /* __IO_H__ */ diff --git a/software/qsys_tutorial_key3_bsp/HAL/inc/nios2.h b/software/qsys_tutorial_key3_bsp/HAL/inc/nios2.h deleted file mode 100644 index 72cefba..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/inc/nios2.h +++ /dev/null @@ -1,230 +0,0 @@ -#ifndef __NIOS2_H__ -#define __NIOS2_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2008 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * This header provides processor specific macros for accessing the Nios2 - * control registers. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * Macros for accessing selected processor registers - */ - -#define NIOS2_READ_ET(et) \ - do { __asm ("mov %0, et" : "=r" (et) ); } while (0) - -#define NIOS2_WRITE_ET(et) \ - do { __asm volatile ("mov et, %z0" : : "rM" (et)); } while (0) - -#define NIOS2_READ_SP(sp) \ - do { __asm ("mov %0, sp" : "=r" (sp) ); } while (0) - -/* - * Macros for useful processor instructions - */ - -#define NIOS2_BREAK() \ - do { __asm volatile ("break"); } while (0) - -#define NIOS2_REPORT_STACK_OVERFLOW() \ - do { __asm volatile("break 3"); } while (0) - -/* - * Macros for accessing the control registers. - */ - -#define NIOS2_READ_STATUS(dest) \ - do { dest = __builtin_rdctl(0); } while (0) - -#define NIOS2_WRITE_STATUS(src) \ - do { __builtin_wrctl(0, src); } while (0) - -#define NIOS2_READ_ESTATUS(dest) \ - do { dest = __builtin_rdctl(1); } while (0) - -#define NIOS2_READ_BSTATUS(dest) \ - do { dest = __builtin_rdctl(2); } while (0) - -#define NIOS2_READ_IENABLE(dest) \ - do { dest = __builtin_rdctl(3); } while (0) - -#define NIOS2_WRITE_IENABLE(src) \ - do { __builtin_wrctl(3, src); } while (0) - -#define NIOS2_READ_IPENDING(dest) \ - do { dest = __builtin_rdctl(4); } while (0) - -#define NIOS2_READ_CPUID(dest) \ - do { dest = __builtin_rdctl(5); } while (0) - - -/* - * Macros for accessing extra exception registers. These - * are always enabled wit the MPU or MMU, and optionally - * with other advanced exception types/ - */ -#define NIOS2_READ_EXCEPTION(dest) \ - do { dest = __builtin_rdctl(7); } while (0) - -#define NIOS2_READ_BADADDR(dest) \ - do { dest = __builtin_rdctl(12); } while (0) - - -/* - * Macros for accessing control registers for MPU - * operation. These should not be used unless the - * MPU is enabled. - * - * The config register may be augmented for future - * enhancements. For now, only MPU support is provided. - */ -/* Config register */ -#define NIOS2_WRITE_CONFIG(src) \ - do { __builtin_wrctl(13, src); } while (0) - -#define NIOS2_READ_CONFIG(dest) \ - do { dest = __builtin_rdctl(13); } while (0) - -/* MPU Base Address Register */ -#define NIOS2_WRITE_MPUBASE(src) \ - do { __builtin_wrctl(14, src); } while (0) - -#define NIOS2_READ_MPUBASE(dest) \ - do { dest = __builtin_rdctl(14); } while (0) - -/* MPU Access Register */ -#define NIOS2_WRITE_MPUACC(src) \ - do { __builtin_wrctl(15, src); } while (0) - -#define NIOS2_READ_MPUACC(dest) \ - do { dest = __builtin_rdctl(15); } while (0) - - -/* - * Nios II control registers that are always present - */ -#define NIOS2_STATUS status -#define NIOS2_ESTATUS estatus -#define NIOS2_BSTATUS bstatus -#define NIOS2_IENABLE ienable -#define NIOS2_IPENDING ipending -#define NIOS2_CPUID cpuid - -/* - * STATUS, BSTATUS, ESTATUS, and SSTATUS fields. - * The presence of fields is a function of the Nios II configuration. - */ -#define NIOS2_STATUS_PIE_MSK (0x00000001) -#define NIOS2_STATUS_PIE_OFST (0) -#define NIOS2_STATUS_U_MSK (0x00000002) -#define NIOS2_STATUS_U_OFST (1) -#define NIOS2_STATUS_EH_MSK (0x00000004) -#define NIOS2_STATUS_EH_OFST (2) -#define NIOS2_STATUS_IH_MSK (0x00000008) -#define NIOS2_STATUS_IH_OFST (3) -#define NIOS2_STATUS_IL_MSK (0x000003f0) -#define NIOS2_STATUS_IL_OFST (4) -#define NIOS2_STATUS_CRS_MSK (0x0000fc00) -#define NIOS2_STATUS_CRS_OFST (10) -#define NIOS2_STATUS_PRS_MSK (0x003f0000) -#define NIOS2_STATUS_PRS_OFST (16) -#define NIOS2_STATUS_NMI_MSK (0x00400000) -#define NIOS2_STATUS_NMI_OFST (22) -#define NIOS2_STATUS_RSIE_MSK (0x00800000) -#define NIOS2_STATUS_RSIE_OFST (23) -#define NIOS2_STATUS_SRS_MSK (0x80000000) -#define NIOS2_STATUS_SRS_OFST (31) - -/* - * Bit masks & offsets available with extra exceptions support - */ - -/* Exception register */ -#define NIOS2_EXCEPTION_REG_CAUSE_MASK (0x0000007c) -#define NIOS2_EXCEPTION_REG_CAUSE_OFST (2) - -/* - * Bit masks & offsets for MPU support - * - * All bit-masks are expressed relative to the position - * of the data with a register. To read data that is LSB- - * aligned, the register read data should be masked, then - * right-shifted by the designated "OFST" macro value. The - * opposite should be used for register writes when starting - * with LSB-aligned data. - */ - -/* Config register */ -#define NIOS2_CONFIG_REG_PE_MASK (0x00000001) -#define NIOS2_CONFIG_REG_PE_OFST (0) -#define NIOS2_CONFIG_REG_ANI_MASK (0x00000002) -#define NIOS2_CONFIG_REG_ANI_OFST (1) - -/* MPU Base Address Register */ -#define NIOS2_MPUBASE_D_MASK (0x00000001) -#define NIOS2_MPUBASE_D_OFST (0) -#define NIOS2_MPUBASE_INDEX_MASK (0x0000003e) -#define NIOS2_MPUBASE_INDEX_OFST (1) -#define NIOS2_MPUBASE_BASE_ADDR_MASK (0xffffffc0) -#define NIOS2_MPUBASE_BASE_ADDR_OFST (6) - -/* MPU Access Register */ -#define NIOS2_MPUACC_LIMIT_MASK (0xffffffc0) -#define NIOS2_MPUACC_LIMIT_OFST (6) -#define NIOS2_MPUACC_MASK_MASK (0xffffffc0) -#define NIOS2_MPUACC_MASK_OFST (6) -#define NIOS2_MPUACC_C_MASK (0x00000020) -#define NIOS2_MPUACC_C_OFST (5) -#define NIOS2_MPUACC_PERM_MASK (0x0000001c) -#define NIOS2_MPUACC_PERM_OFST (2) -#define NIOS2_MPUACC_RD_MASK (0x00000002) -#define NIOS2_MPUACC_RD_OFST (1) -#define NIOS2_MPUACC_WR_MASK (0x00000001) -#define NIOS2_MPUACC_WR_OFST (0) - -/* - * Number of available IRQs in internal interrupt controller. - */ -#define NIOS2_NIRQ 32 - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __NIOS2_H__ */ diff --git a/software/qsys_tutorial_key3_bsp/HAL/inc/os/alt_flag.h b/software/qsys_tutorial_key3_bsp/HAL/inc/os/alt_flag.h deleted file mode 100644 index b9b4605..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/inc/os/alt_flag.h +++ /dev/null @@ -1,98 +0,0 @@ -#ifndef __ALT_FLAG_H__ -#define __ALT_FLAG_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * This header provides macro definitions that can be used to create and use - * uc/OS-II style event flags. These macros can be used in both a uC/OS-II based - * environment, and a single threaded HAL based environment. - * - * The motivation for these macros is to allow code to be developed which is - * thread safe under uC/OS-II, but incurs no additional overhead when used in a - * single threaded HAL environment. - * - * In the case of a single threaded HAL environment, they compile to - * "do nothing" directives, which ensures they do not contribute to the final - * executable. - * - * The following macros are available: - * - * ALT_FLAG_GRP - Create a flag group instance. - * ALT_EXTERN_FLAG_GRP - Create a reference to an external flag group instance. - * ALT_STATIC_FLAG_GRP - Create a static flag group instance. - * ALT_FLAG_CREATE - Initialise a flag group. - * ALT_FLAG_PEND - Pend on a flag group. - * ALT_FLAG_POST - Set a flag condition. - - * - * Input arguments and return codes are all consistant with the equivalent - * uC/OS-II function. - * - * It's important to be careful in the use of the macros: ALT_FLAG_GRP, - * ALT_EXTERN_FLAG_GRP, and ALT_STATIC_FLAG_GRP. In these three cases the - * semi-colon is included in the macro definition; so, for example, you should - * use: - * - * ALT_FLAG_GRP(mygroup) - * - * not: - * - * ALT_FLAG_GRP(mygroup); - * - * The inclusion of the semi-colon has been necessary to ensure the macros can - * compile with no warnings when used in a single threaded HAL environment. - * - */ - -#include "priv/alt_no_error.h" - -#define ALT_FLAG_GRP(group) -#define ALT_EXTERN_FLAG_GRP(group) -#define ALT_STATIC_FLAG_GRP(group) - -#define ALT_FLAG_CREATE(group, flags) alt_no_error () -#define ALT_FLAG_PEND(group, flags, wait_type, timeout) alt_no_error () -#define ALT_FLAG_POST(group, flags, opt) alt_no_error () - -#ifndef ALT_SINGLE_THREADED -#define ALT_SINGLE_THREADED -#endif - -#endif /* __ALT_FLAG_H__ */ diff --git a/software/qsys_tutorial_key3_bsp/HAL/inc/os/alt_hooks.h b/software/qsys_tutorial_key3_bsp/HAL/inc/os/alt_hooks.h deleted file mode 100644 index 9054e3f..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/inc/os/alt_hooks.h +++ /dev/null @@ -1,61 +0,0 @@ -#ifndef __ALT_HOOKS_H__ -#define __ALT_HOOKS_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * This header provides "do-nothing" macro definitions for operating system - * hooks within the HAL. The O/S component can override these to provide it's - * own implementation. - */ - -#define ALT_OS_TIME_TICK() while(0) -#define ALT_OS_INIT() while(0) -#define ALT_OS_STOP() while(0) - -/* Call from assembly code */ -#define ALT_OS_INT_ENTER_ASM -#define ALT_OS_INT_EXIT_ASM - -/* Call from C code */ -#define ALT_OS_INT_ENTER() while(0) -#define ALT_OS_INT_EXIT() while(0) - - -#endif /* __ALT_HOOKS_H__ */ diff --git a/software/qsys_tutorial_key3_bsp/HAL/inc/os/alt_sem.h b/software/qsys_tutorial_key3_bsp/HAL/inc/os/alt_sem.h deleted file mode 100644 index 753943e..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/inc/os/alt_sem.h +++ /dev/null @@ -1,96 +0,0 @@ -#ifndef __ALT_SEM_H__ -#define __ALT_SEM_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * This header provides macro definitions that can be used to create and use - * semaphores. These macros can be used in both a uC/OS-II based environment, - * and a single threaded HAL based environment. - * - * The motivation for these macros is to allow code to be developed which is - * thread safe under uC/OS-II, but incurs no additional overhead when used in a - * single threaded HAL environment. - * - * In the case of a single threaded HAL environment, they compile to - * "do nothing" directives, which ensures they do not contribute to the final - * executable. - * - * The following macros are available: - * - * ALT_SEM - Create a semaphore instance. - * ALT_EXTERN_SEM - Create a reference to an external semaphore instance. - * ALT_STATIC_SEM - Create a static semaphore instance. - * ALT_SEM_CREATE - Initialise a semaphore. - * ALT_SEM_PEND - Pend on a semaphore. - * ALT_SEM_POST - Increment a semaphore. - * - * Input arguments and return codes are all consistant with the equivalent - * uC/OS-II function. - * - * It's important to be careful in the use of the macros: ALT_SEM, - * ALT_EXTERN_SEM, and ALT_STATIC_SEM. In these three cases the semi-colon is - * included in the macro definition; so, for example, you should use: - * - * ALT_SEM(mysem) - * - * not: - * - * ALT_SEM(mysem); - * - * The inclusion of the semi-colon has been necessary to ensure the macros can - * compile with no warnings when used in a single threaded HAL environment. - * - */ - -#include "priv/alt_no_error.h" - -#define ALT_SEM(sem) -#define ALT_EXTERN_SEM(sem) -#define ALT_STATIC_SEM(sem) - -#define ALT_SEM_CREATE(sem, value) alt_no_error () -#define ALT_SEM_PEND(sem, timeout) alt_no_error () -#define ALT_SEM_POST(sem) alt_no_error () - -#ifndef ALT_SINGLE_THREADED -#define ALT_SINGLE_THREADED -#endif - -#endif /* __ALT_SEM_H__ */ diff --git a/software/qsys_tutorial_key3_bsp/HAL/inc/os/alt_syscall.h b/software/qsys_tutorial_key3_bsp/HAL/inc/os/alt_syscall.h deleted file mode 100644 index 507c6aa..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/inc/os/alt_syscall.h +++ /dev/null @@ -1,75 +0,0 @@ -#ifndef __ALT_SYSCALL_H__ -#define __ALT_SYSCALL_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * The macros defined in this file are used to provide the function names used - * for the HAL 'UNIX style' interface, e.g. read(), write() etc. - * - * Operating systems which are ported to the HAL can provide their own - * version of this file, which will be used in preference. This allows - * the operating system to provide it's own implementation of the top level - * system calls, while retaining the HAL functions under a different name, - * for example, alt_read(), alt_write() etc. - */ - -#define ALT_CLOSE close -#define ALT_ENVIRON environ -#define ALT_EXECVE execve -#define ALT_EXIT _exit -#define ALT_FCNTL fcntl -#define ALT_FORK fork -#define ALT_FSTAT fstat -#define ALT_GETPID getpid -#define ALT_GETTIMEOFDAY gettimeofday -#define ALT_IOCTL ioctl -#define ALT_ISATTY isatty -#define ALT_KILL kill -#define ALT_LINK link -#define ALT_LSEEK lseek -#define ALT_OPEN open -#define ALT_READ read -#define ALT_RENAME _rename -#define ALT_SBRK sbrk -#define ALT_SETTIMEOFDAY settimeofday -#define ALT_STAT stat -#define ALT_UNLINK unlink -#define ALT_USLEEP usleep -#define ALT_WAIT wait -#define ALT_WRITE write -#define ALT_TIMES times - -/* - * - */ - -#endif /* __ALT_SYSCALL_H__ */ diff --git a/software/qsys_tutorial_key3_bsp/HAL/inc/priv/alt_alarm.h b/software/qsys_tutorial_key3_bsp/HAL/inc/priv/alt_alarm.h deleted file mode 100644 index 45d6a0e..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/inc/priv/alt_alarm.h +++ /dev/null @@ -1,101 +0,0 @@ -#ifndef __ALT_PRIV_ALARM_H__ -#define __ALT_PRIV_ALARM_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "alt_types.h" - -/* - * This header provides the internal defenitions required by the public - * interface alt_alarm.h. These variables and structures are not guaranteed to - * exist in future implementations of the HAL. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * "alt_alarm_s" is a structure type used to maintain lists of alarm callback - * functions. - */ - -struct alt_alarm_s -{ - alt_llist llist; /* linked list */ - alt_u32 time; /* time in system ticks of the callback */ - alt_u32 (*callback) (void* context); /* callback function. The return - * value is the period for the next callback; where - * zero indicates that the alarm should be removed - * from the list. - */ - alt_u8 rollover; /* set when desired alarm time + current time causes - overflow, to prevent premature alarm */ - void* context; /* Argument for the callback */ -}; - -/* - * "_alt_tick_rate" is a global variable used to store the system clock rate - * in ticks per second. This is initialised to zero, which coresponds to there - * being no system clock available. - * - * It is then set to it's final value by the system clock driver through a call - * to alt_sysclk_init(). - */ - -extern alt_u32 _alt_tick_rate; - -/* - * "_alt_nticks" is a global variable which records the elapsed number of - * system clock ticks since the last call to settimeofday() or since reset if - * settimeofday() has not been called. - */ - -extern volatile alt_u32 _alt_nticks; - -/* The list of registered alarms. */ - -extern alt_llist alt_alarm_list; - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_PRIV_ALARM_H__ */ diff --git a/software/qsys_tutorial_key3_bsp/HAL/inc/priv/alt_busy_sleep.h b/software/qsys_tutorial_key3_bsp/HAL/inc/priv/alt_busy_sleep.h deleted file mode 100644 index b1af849..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/inc/priv/alt_busy_sleep.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef __ALT_BUSY_SLEEP_H -#define __ALT_BUSY_SLEEP_H - -/* - * Copyright (c) 2003 Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - */ - -/* - * The function alt_busy_sleep provides a busy loop implementation of usleep. - * This is used to provide usleep for the standalone HAL, or when the timer is - * unavailable in uC/OS-II. - */ - -extern unsigned int alt_busy_sleep (unsigned int us); - -#endif /* __ALT_BUSY_SLEEP_H */ diff --git a/software/qsys_tutorial_key3_bsp/HAL/inc/priv/alt_dev_llist.h b/software/qsys_tutorial_key3_bsp/HAL/inc/priv/alt_dev_llist.h deleted file mode 100644 index 451b063..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/inc/priv/alt_dev_llist.h +++ /dev/null @@ -1,77 +0,0 @@ -#ifndef __ALT_DEV_LLIST_H__ -#define __ALT_DEV_LLIST_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "sys/alt_llist.h" -#include "alt_types.h" - -/* - * This header provides the internal defenitions required to control file - * access. These variables and functions are not guaranteed to exist in - * future implementations of the HAL. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The alt_dev_llist is an internal structure used to form a common base - * class for all device types. The use of this structure allows common code - * to be used to manipulate the various device lists. - */ - -typedef struct { - alt_llist llist; - const char* name; -} alt_dev_llist; - -/* - * - */ - -extern int alt_dev_llist_insert (alt_dev_llist* dev, alt_llist* list); - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_DEV_LLIST_H__ */ diff --git a/software/qsys_tutorial_key3_bsp/HAL/inc/priv/alt_exception_handler_registry.h b/software/qsys_tutorial_key3_bsp/HAL/inc/priv/alt_exception_handler_registry.h deleted file mode 100644 index c6905fa..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/inc/priv/alt_exception_handler_registry.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef __ALT_EXCEPTION_HANDLER_REGISTRY_H__ -#define __ALT_EXCEPTION_HANDLER_REGISTRY_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2008 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ -#include "sys/alt_exceptions.h" - -/* Function pointer to exception callback routine */ -extern alt_exception_result (*alt_instruction_exception_handler) - (alt_exception_cause, alt_u32, alt_u32); - -#endif /* __ALT_EXCEPTION_HANDLER_REGISTRY_H__ */ diff --git a/software/qsys_tutorial_key3_bsp/HAL/inc/priv/alt_file.h b/software/qsys_tutorial_key3_bsp/HAL/inc/priv/alt_file.h deleted file mode 100644 index 2c3e843..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/inc/priv/alt_file.h +++ /dev/null @@ -1,179 +0,0 @@ -#ifndef __ALT_FILE_H__ -#define __ALT_FILE_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "sys/alt_dev.h" -#include "sys/alt_llist.h" -#include "os/alt_sem.h" - -#include "alt_types.h" - -/* - * This header provides the internal defenitions required to control file - * access. These variables and functions are not guaranteed to exist in - * future implementations of the HAL. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The function alt_find_dev() is used to search the device list "list" to - * locate a device named "name". If a match is found, then a pointer to the - * device is returned, otherwise NULL is returned. - */ - -extern alt_dev* alt_find_dev (const char* name, alt_llist* list); - -/* - * alt_find_file() is used to search the list of registered file systems to - * find the filesystem that the file named "name" belongs to. If a match is - * found, then a pointer to the filesystems alt_dev structure is returned, - * otherwise NULL is returned. - * - * Note that a match does not indicate that the file exists, only that a - * filesystem exists that is registered for a partition that could contain - * the file. The filesystems open() function would need to be called in order - * to determine if the file exists. - */ - -extern alt_dev* alt_find_file (const char* name); - -/* - * alt_get_fd() is used to allocate a file descriptor for the device or - * filesystem "dev". A negative return value indicates an error, otherwise the - * return value is the index of the file descriptor within the file descriptor - * pool. - */ - -extern int alt_get_fd (alt_dev* dev); - -/* - * alt_release_fd() is called to free the file descriptor with index "fd". - */ - -extern void alt_release_fd (int fd); - -/* - * alt_fd_lock() is called by ioctl() to mark the file descriptor "fd" as - * being open for exclusive access. Subsequent calls to open() for the device - * associated with "fd" will fail. A device is unlocked by either calling - * close() for "fd", or by an alternate call to ioctl() (see ioctl.c for - * details). - */ - -extern int alt_fd_lock (alt_fd* fd); - -/* - * alt_fd_unlock() is called by ioctl() to unlock a descriptor previously - * locked by a call to alt_fd_lock(). - */ - -extern int alt_fd_unlock (alt_fd* fd); - -/* - * "alt_fd_list" is the pool of file descriptors. - */ - -extern alt_fd alt_fd_list[]; - -/* - * flags used by alt_fd. - * - * ALT_FD_EXCL is used to mark a file descriptor as locked for exclusive - * access, i.e. further calls to open() for the associated device should - * fail. - * - * ALT_FD_DEV marks a dile descriptor as belonging to a device as oposed to a - * filesystem. - */ - -#define ALT_FD_EXCL 0x80000000 -#define ALT_FD_DEV 0x40000000 - -#define ALT_FD_FLAGS_MASK (ALT_FD_EXCL | ALT_FD_DEV) - -/* - * "alt_dev_list" is the head of the linked list of registered devices. - */ - -extern alt_llist alt_dev_list; - -/* - * "alt_fs_list" is the head of the linked list of registered filesystems. - */ - -extern alt_llist alt_fs_list; - -/* - * "alt_fd_list_lock" is a semaphore used to ensure that access to the pool - * of file descriptors is thread safe. - */ - -ALT_EXTERN_SEM(alt_fd_list_lock) - -/* - * "alt_max_fd" is a 'high water mark'. It indicates the highest file - * descriptor allocated. Use of this can save searching the entire pool - * for active file descriptors, which helps avoid contention on access - * to the file descriptor pool. - */ - -extern alt_32 alt_max_fd; - -/* - * alt_io_redirect() is called at startup to redirect stdout, stdin, and - * stderr to the devices named in the input arguments. By default these streams - * are directed at /dev/null, and are then redirected using this function once - * all of the devices have been registered within the system. - */ - -extern void alt_io_redirect(const char* stdout_dev, - const char* stdin_dev, - const char* stderr_dev); - - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_FILE_H__ */ diff --git a/software/qsys_tutorial_key3_bsp/HAL/inc/priv/alt_iic_isr_register.h b/software/qsys_tutorial_key3_bsp/HAL/inc/priv/alt_iic_isr_register.h deleted file mode 100644 index a0cb01c..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/inc/priv/alt_iic_isr_register.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef __ALT_IIC_ISR_REGISTER_H_ -#define __ALT_IIC_ISR_REGISTER_H_ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ -#include "alt_types.h" -#include "sys/alt_irq.h" - -extern int alt_iic_isr_register(alt_u32 ic_id, alt_u32 irq, alt_isr_func isr, - void *isr_context, void *flags); - -#endif /* __ALT_IIC_ISR_REGISTER_H_ */ diff --git a/software/qsys_tutorial_key3_bsp/HAL/inc/priv/alt_irq_table.h b/software/qsys_tutorial_key3_bsp/HAL/inc/priv/alt_irq_table.h deleted file mode 100644 index 694ef06..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/inc/priv/alt_irq_table.h +++ /dev/null @@ -1,59 +0,0 @@ -#ifndef __ALT_IRQ_TABLE_H__ -#define __ALT_IRQ_TABLE_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * Definition of a table describing each interrupt handler. The index into - * the array is the interrupt id associated with the handler. - * - * When an interrupt occurs, the associated handler is called with - * the argument stored in the context member. - * - * The table is physically created in alt_irq_handler.c - */ -extern struct ALT_IRQ_HANDLER -{ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - void (*handler)(void*); -#else - void (*handler)(void*, alt_u32); -#endif - void *context; -} alt_irq[ALT_NIRQ]; - -#endif diff --git a/software/qsys_tutorial_key3_bsp/HAL/inc/priv/alt_legacy_irq.h b/software/qsys_tutorial_key3_bsp/HAL/inc/priv/alt_legacy_irq.h deleted file mode 100644 index c7aec02..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/inc/priv/alt_legacy_irq.h +++ /dev/null @@ -1,158 +0,0 @@ -#ifndef __ALT_LEGACY_IRQ_H__ -#define __ALT_LEGACY_IRQ_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * This file provides prototypes and inline implementations of certain routines - * used by the legacy interrupt API. Do not include this in your driver or - * application source files, use "sys/alt_irq.h" instead to access the proper - * public API. - */ - -#include -#include "system.h" - -#ifndef NIOS2_EIC_PRESENT - -#include "nios2.h" -#include "alt_types.h" - -#include "sys/alt_irq.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * alt_irq_register() can be used to register an interrupt handler. If the - * function is succesful, then the requested interrupt will be enabled upon - * return. - */ -extern int alt_irq_register (alt_u32 id, - void* context, - alt_isr_func handler); - -/* - * alt_irq_disable() disables the individual interrupt indicated by "id". - */ -static ALT_INLINE int ALT_ALWAYS_INLINE alt_irq_disable (alt_u32 id) -{ - alt_irq_context status; - extern volatile alt_u32 alt_irq_active; - - status = alt_irq_disable_all (); - - alt_irq_active &= ~(1 << id); - NIOS2_WRITE_IENABLE (alt_irq_active); - - alt_irq_enable_all(status); - - return 0; -} - -/* - * alt_irq_enable() enables the individual interrupt indicated by "id". - */ -static ALT_INLINE int ALT_ALWAYS_INLINE alt_irq_enable (alt_u32 id) -{ - alt_irq_context status; - extern volatile alt_u32 alt_irq_active; - - status = alt_irq_disable_all (); - - alt_irq_active |= (1 << id); - NIOS2_WRITE_IENABLE (alt_irq_active); - - alt_irq_enable_all(status); - - return 0; -} - -#ifndef ALT_EXCEPTION_STACK -/* - * alt_irq_initerruptable() should only be called from within an ISR. It is used - * to allow higer priority interrupts to interrupt the current ISR. The input - * argument, "priority", is the priority, i.e. interrupt number of the current - * interrupt. - * - * If this function is called, then the ISR is required to make a call to - * alt_irq_non_interruptible() before returning. The input argument to - * alt_irq_non_interruptible() is the return value from alt_irq_interruptible(). - * - * Care should be taken when using this pair of functions, since they increasing - * the system overhead associated with interrupt handling. - * - * If you are using an exception stack then nested interrupts won't work, so - * these functions are not available in that case. - */ -static ALT_INLINE alt_u32 ALT_ALWAYS_INLINE alt_irq_interruptible (alt_u32 priority) -{ - extern volatile alt_u32 alt_priority_mask; - extern volatile alt_u32 alt_irq_active; - - alt_u32 old_priority; - - old_priority = alt_priority_mask; - alt_priority_mask = (1 << priority) - 1; - - NIOS2_WRITE_IENABLE (alt_irq_active & alt_priority_mask); - - NIOS2_WRITE_STATUS (1); - - return old_priority; -} - -/* - * See Comments above for alt_irq_interruptible() for an explanation of the use of this - * function. - */ -static ALT_INLINE void ALT_ALWAYS_INLINE alt_irq_non_interruptible (alt_u32 mask) -{ - extern volatile alt_u32 alt_priority_mask; - extern volatile alt_u32 alt_irq_active; - - NIOS2_WRITE_STATUS (0); - - alt_priority_mask = mask; - - NIOS2_WRITE_IENABLE (mask & alt_irq_active); -} -#endif /* ALT_EXCEPTION_STACK */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* NIOS2_EIC_PRESENT */ - -#endif /* __ALT_LEGACY_IRQ_H__ */ diff --git a/software/qsys_tutorial_key3_bsp/HAL/inc/priv/alt_no_error.h b/software/qsys_tutorial_key3_bsp/HAL/inc/priv/alt_no_error.h deleted file mode 100644 index 6143fc9..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/inc/priv/alt_no_error.h +++ /dev/null @@ -1,77 +0,0 @@ -#ifndef __ALT_NO_ERROR_H__ -#define __ALT_NO_ERROR_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "alt_types.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * alt_no_error() is a dummy function used by alt_sem.h and alt_flag.h. It - * substitutes for functions that have a return code by creating a function - * that always returns zero. - * - * This may seem a little obscure, but what happens is that the compiler can - * then optomise away the call to this function, and any code written which - * handles the error path (i.e. non zero return values). - * - * This allows code to be written which correctly use the uC/OS-II semaphore - * and flag utilities, without the use of those utilities impacting on - * excutables built for a single threaded HAL environment. - * - * This function is considered to be part of the internal implementation of - * the HAL, and should not be called directly by application code or device - * drivers. It is not guaranteed to be preserved in future versions of the - * HAL. - */ - -static ALT_INLINE int ALT_ALWAYS_INLINE alt_no_error (void) -{ - return 0; -} - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_NO_ERROR_H__ */ diff --git a/software/qsys_tutorial_key3_bsp/HAL/inc/priv/nios2_gmon_data.h b/software/qsys_tutorial_key3_bsp/HAL/inc/priv/nios2_gmon_data.h deleted file mode 100644 index 3f43f12..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/inc/priv/nios2_gmon_data.h +++ /dev/null @@ -1,47 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ -#ifndef NIOS2_GMON_DATA_H -#define NIOS2_GMON_DATA_H - -#define GMON_DATA_SIG 0 -#define GMON_DATA_WORDS 1 -#define GMON_DATA_PROFILE_DATA 2 -#define GMON_DATA_PROFILE_LOWPC 3 -#define GMON_DATA_PROFILE_HIGHPC 4 -#define GMON_DATA_PROFILE_BUCKET 5 -#define GMON_DATA_PROFILE_RATE 6 -#define GMON_DATA_MCOUNT_START 7 -#define GMON_DATA_MCOUNT_LIMIT 8 - -#define GMON_DATA_SIZE 9 - -extern unsigned int alt_gmon_data[GMON_DATA_SIZE]; - -#endif diff --git a/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_alarm.h b/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_alarm.h deleted file mode 100644 index 68a2f5d..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_alarm.h +++ /dev/null @@ -1,126 +0,0 @@ -#ifndef __ALT_ALARM_H__ -#define __ALT_ALARM_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "alt_llist.h" -#include "alt_types.h" - -#include "priv/alt_alarm.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * "alt_alarm" is a structure type used by applications to register an alarm - * callback function. An instance of this type must be passed as an input - * argument to alt_alarm_start(). The user is not responsible for initialising - * the contents of the instance. This is done by alt_alarm_start(). - */ - -typedef struct alt_alarm_s alt_alarm; - -/* - * alt_alarm_start() can be called by an application/driver in order to register - * a function for periodic callback at the system clock frequency. Be aware that - * this callback is likely to occur in interrupt context. - */ - -extern int alt_alarm_start (alt_alarm* the_alarm, - alt_u32 nticks, - alt_u32 (*callback) (void* context), - void* context); - -/* - * alt_alarm_stop() is used to unregister a callback. Alternatively the callback - * can return zero to unregister. - */ - -extern void alt_alarm_stop (alt_alarm* the_alarm); - -/* - * Obtain the system clock rate in ticks/s. - */ - -static ALT_INLINE alt_u32 ALT_ALWAYS_INLINE alt_ticks_per_second (void) -{ - return _alt_tick_rate; -} - -/* - * alt_sysclk_init() is intended to be only used by the system clock driver - * in order to initialise the value of the clock frequency. - */ - -static ALT_INLINE int ALT_ALWAYS_INLINE alt_sysclk_init (alt_u32 nticks) -{ - if (! _alt_tick_rate) - { - _alt_tick_rate = nticks; - return 0; - } - else - { - return -1; - } -} - -/* - * alt_nticks() returns the elapsed number of system clock ticks since reset. - */ - -static ALT_INLINE alt_u32 ALT_ALWAYS_INLINE alt_nticks (void) -{ - return _alt_nticks; -} - -/* - * alt_tick() should only be called by the system clock driver. This is used - * to notify the system that the system timer period has expired. - */ - -extern void alt_tick (void); - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_ALARM_H__ */ diff --git a/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_cache.h b/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_cache.h deleted file mode 100644 index c4d8db9..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_cache.h +++ /dev/null @@ -1,117 +0,0 @@ -#ifndef __ALT_CACHE_H__ -#define __ALT_CACHE_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003, 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include - -#include "alt_types.h" - -/* - * alt_cache.h defines the processor specific functions for manipulating the - * cache. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * alt_icache_flush() is called to flush the instruction cache for a memory - * region of length "len" bytes, starting at address "start". - */ - -extern void alt_icache_flush (void* start, alt_u32 len); - -/* - * alt_dcache_flush() is called to flush the data cache for a memory - * region of length "len" bytes, starting at address "start". - * Any dirty lines in the data cache are written back to memory. - */ - -extern void alt_dcache_flush (void* start, alt_u32 len); - -/* - * alt_dcache_flush() is called to flush the data cache for a memory - * region of length "len" bytes, starting at address "start". - * Any dirty lines in the data cache are NOT written back to memory. - */ - -extern void alt_dcache_flush_no_writeback (void* start, alt_u32 len); - -/* - * Flush the entire instruction cache. - */ - -extern void alt_icache_flush_all (void); - -/* - * Flush the entire data cache. - */ - -extern void alt_dcache_flush_all (void); - -/* - * Allocate a block of uncached memory. - */ - -extern volatile void* alt_uncached_malloc (size_t size); - -/* - * Free a block of uncached memory. - */ - -extern void alt_uncached_free (volatile void* ptr); - -/* - * Convert a pointer to a block of cached memory, into a block of - * uncached memory. - */ - -extern volatile void* alt_remap_uncached (void* ptr, alt_u32 len); - -/* - * Convert a pointer to a block of uncached memory, into a block of - * cached memory. - */ - -extern void* alt_remap_cached (volatile void* ptr, alt_u32 len); - -/* - * - */ - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_CACHE_H__ */ diff --git a/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_debug.h b/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_debug.h deleted file mode 100644 index d9f9599..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_debug.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef __ALT_DEBUG_H__ -#define __ALT_DEBUG_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * The ALT_DEVUG_ASSERT macro can be used to generate a debugger break - * from within software. The break is generated if "condition" evaluates to - * false. - */ - -#define ALT_DEBUG_ASSERT(condition) if (!condition) \ -{ \ - __asm__ volatile ("break"); \ -} - -#endif /* __ALT_DEBUG_H__ */ diff --git a/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_dev.h b/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_dev.h deleted file mode 100644 index 66c5e41..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_dev.h +++ /dev/null @@ -1,115 +0,0 @@ -#ifndef __ALT_DEV_H__ -#define __ALT_DEV_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "system.h" -#include "sys/alt_llist.h" -#include "priv/alt_dev_llist.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The value ALT_IRQ_NOT_CONNECTED is used to represent an unconnected - * interrupt line. It cannot evaluate to a valid interrupt number. - */ - -#define ALT_IRQ_NOT_CONNECTED (-1) - -typedef struct alt_dev_s alt_dev; - -struct stat; - -/* - * The file descriptor structure definition. - */ - -typedef struct alt_fd_s -{ - alt_dev* dev; - alt_u8* priv; - int fd_flags; -} alt_fd; - -/* - * The device structure definition. - */ - -struct alt_dev_s { - alt_llist llist; /* for internal use */ - const char* name; - int (*open) (alt_fd* fd, const char* name, int flags, int mode); - int (*close) (alt_fd* fd); - int (*read) (alt_fd* fd, char* ptr, int len); - int (*write) (alt_fd* fd, const char* ptr, int len); - int (*lseek) (alt_fd* fd, int ptr, int dir); - int (*fstat) (alt_fd* fd, struct stat* buf); - int (*ioctl) (alt_fd* fd, int req, void* arg); -}; - -/* - * Functions used to register device for access through the C standard - * library. - * - * The only difference between alt_dev_reg() and alt_fs_reg() is the - * interpretation that open() places on the device name. In the case of - * alt_dev_reg the device is assumed to be a particular character device, - * and so there must be an exact match in the name for open to succeed. - * In the case of alt_fs_reg() the name of the device is treated as the - * mount point for a directory, and so any call to open() where the name - * is the root of the device filename will succeed. - */ - -extern int alt_fs_reg (alt_dev* dev); - -static ALT_INLINE int alt_dev_reg (alt_dev* dev) -{ - extern alt_llist alt_dev_list; - - return alt_dev_llist_insert ((alt_dev_llist*) dev, &alt_dev_list); -} - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_DEV_H__ */ diff --git a/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_dma.h b/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_dma.h deleted file mode 100644 index 9f9b2ff..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_dma.h +++ /dev/null @@ -1,226 +0,0 @@ -#ifndef __ALT_DMA_H__ -#define __ALT_DMA_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "sys/alt_dma_dev.h" -#include "alt_types.h" - -#include - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * This header contains the application side interface for accessing DMA - * resources. See alt_dma_dev.h for the dma device driver interface. - * - * The interface model treats a DMA transaction as being composed of two - * halves (read and write). - * - * The application can supply data for transmit using an "alt_dma_txchan" - * descriptor. Alternatively an "alt_dma_rxchan" descriptor can be used to - * receive data. - */ - -/* - * alt_dma_txchan_open() is used to obtain an "alt_dma_txchan" descriptor for - * a DMA transmit device. The name is the name of the associated physical - * device (e.g. "/dev/dma_0"). - * - * The return value will be NULL on failure, and non-NULL otherwise. - */ - -extern alt_dma_txchan alt_dma_txchan_open (const char* name); - -/* - * alt_dma_txchan_close() is provided so that an application can notify the - * system that it has finished with a given DMA transmit channel. This is only - * provided for completness. - */ - -static ALT_INLINE int alt_dma_txchan_close (alt_dma_txchan dma) -{ - return 0; -} - -/* - * alt_dma_txchan_send() posts a transmit request to a DMA transmit channel. - * The input arguments are: - * - * dma: the channel to use. - * from: a pointer to the start of the data to send. - * length: the length of the data to send in bytes. - * done: callback function that will be called once the data has been sent. - * handle: opaque value passed to "done". - * - * The return value will be negative if the request cannot be posted, and - * zero otherwise. - */ - -static ALT_INLINE int alt_dma_txchan_send (alt_dma_txchan dma, - const void* from, - alt_u32 length, - alt_txchan_done* done, - void* handle) -{ - return dma ? dma->dma_send (dma, - from, - length, - done, - handle) : -ENODEV; -} - -/* - * alt_dma_txchan_space() returns the number of tranmit requests that can be - * posted to the specified DMA transmit channel. - * - * A negative value indicates that the value could not be determined. - */ - -static ALT_INLINE int alt_dma_txchan_space (alt_dma_txchan dma) -{ - return dma ? dma->space (dma) : -ENODEV; -} - -/* - * alt_dma_txchan_ioctl() can be used to perform device specific I/O - * operations on the indicated DMA transmit channel. For example some drivers - * support options to control the width of the transfer operations. See - * alt_dma_dev.h for the list of generic requests. - * - * A negative return value indicates failure, otherwise the interpretation - * of the return value is request specific. - */ - -static ALT_INLINE int alt_dma_txchan_ioctl (alt_dma_txchan dma, - int req, - void* arg) -{ - return dma ? dma->ioctl (dma, req, arg) : -ENODEV; -} - -/* - * alt_dma_rxchan_open() is used to obtain an "alt_dma_rxchan" descriptor for - * a DMA receive channel. The name is the name of the associated physical - * device (e.g. "/dev/dma_0"). - * - * The return value will be NULL on failure, and non-NULL otherwise. - */ - -extern alt_dma_rxchan alt_dma_rxchan_open (const char* dev); - -/* - * alt_dma_rxchan_close() is provided so that an application can notify the - * system that it has finished with a given DMA receive channel. This is only - * provided for completness. - */ - -static ALT_INLINE int alt_dma_rxchan_close (alt_dma_rxchan dma) -{ - return 0; -} - -/* - * - */ - -/* - * alt_dma_rxchan_prepare() posts a receive request to a DMA receive channel. - * - * The input arguments are: - * - * dma: the channel to use. - * data: a pointer to the location that data is to be received to. - * len: the maximum length of the data to receive. - * done: callback function that will be called once the data has been - * received. - * handle: opaque value passed to "done". - * - * The return value will be negative if the request cannot be posted, and - * zero otherwise. - */ - -static ALT_INLINE int alt_dma_rxchan_prepare (alt_dma_rxchan dma, - void* data, - alt_u32 len, - alt_rxchan_done* done, - void* handle) -{ - return dma ? dma->prepare (dma, data, len, done, handle) : -ENODEV; -} - -/* - * alt_dma_rxchan_ioctl() can be used to perform device specific I/O - * operations on the indicated DMA receive channel. For example some drivers - * support options to control the width of the transfer operations. See - * alt_dma_dev.h for the list of generic requests. - * - * A negative return value indicates failure, otherwise the interpretation - * of the return value is request specific. - */ - -static ALT_INLINE int alt_dma_rxchan_ioctl (alt_dma_rxchan dma, - int req, - void* arg) -{ - return dma ? dma->ioctl (dma, req, arg) : -ENODEV; -} - -/* - * alt_dma_rxchan_depth() returns the depth of the receive FIFO used to store - * receive requests. - */ - -static ALT_INLINE alt_u32 alt_dma_rxchan_depth(alt_dma_rxchan dma) -{ - return dma->depth; -} - -/* - * - */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_DMA_H__ */ diff --git a/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_dma_dev.h b/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_dma_dev.h deleted file mode 100644 index 832463d..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_dma_dev.h +++ /dev/null @@ -1,200 +0,0 @@ -#ifndef __ALT_DMA_DEV_H__ -#define __ALT_DMA_DEV_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "priv/alt_dev_llist.h" - -#include "alt_types.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * This header contains the device driver interface for accessing DMA - * resources. See alt_dma.h for the DMA application side interface. - * - * The interface model treats a DMA transaction as being composed of two - * halves (read and write). - * - * An "alt_dma_txchan_dev" is used to describe the device associated with a - * DMA transmit channel. An "alt_dma_rxchan_dev" is used to describe the - * device associated with a DMA receive channel. - */ - -/* - * List of generic ioctl requests that may be supported by a DMA device. - * - * ALT_DMA_RX_ONLY_ON: This causes a DMA channel to operate in a mode - * where only the receiver is under software control. - * The other side reads continously from a single - * location. The address to read is the argument to - * this request. - * ALT_DMA_RX_ONLY_OFF: Return to the default mode where both the receive - * and transmit sides of the DMA can be under software - * control. - * ALT_DMA_TX_ONLY_ON: This causes a DMA channel to operate in a mode - * where only the transmitter is under software control. - * The other side writes continously to a single - * location. The address to write to is the argument to - * this request. - * ALT_DMA_TX_ONLY_OFF: Return to the default mode where both the receive - * and transmit sides of the DMA can be under software - * control. - * ALT_DMA_SET_MODE_8: Transfer data in units of 8 bits. - * ALT_DMA_SET_MODE_16: Transfer data in units of 16 bits. - * ALT_DMA_SET_MODE_32: Transfer data in units of 32 bits. - * ALT_DMA_SET_MODE_64: Transfer data in units of 64 bits. - * ALT_DMA_SET_MODE_128: Transfer data in units of 128 bits. - * ALT_DMA_GET_MODE: Get the current transfer mode. - * - * The use of the macros: ALT_DMA_TX_STREAM_ON, ALT_DMA_TX_STREAM_OFF - * ALT_DMA_RX_STREAM_OFF and ALT_DMA_RX_STREAM_ON are depreciated. You should - * instead use the macros: ALT_DMA_RX_ONLY_ON, ALT_DMA_RX_ONLY_OFF, - * ALT_DMA_TX_ONLY_ON and ALT_DMA_TX_ONLY_OFF. - */ - -#define ALT_DMA_TX_STREAM_ON (0x1) -#define ALT_DMA_TX_STREAM_OFF (0x2) -#define ALT_DMA_RX_STREAM_ON (0x3) -#define ALT_DMA_RX_STREAM_OFF (0x4) -#define ALT_DMA_SET_MODE_8 (0x5) -#define ALT_DMA_SET_MODE_16 (0x6) -#define ALT_DMA_SET_MODE_32 (0x7) -#define ALT_DMA_SET_MODE_64 (0x8) -#define ALT_DMA_SET_MODE_128 (0x9) -#define ALT_DMA_GET_MODE (0xa) - -#define ALT_DMA_RX_ONLY_ON ALT_DMA_TX_STREAM_ON -#define ALT_DMA_RX_ONLY_OFF ALT_DMA_TX_STREAM_OFF -#define ALT_DMA_TX_ONLY_ON ALT_DMA_RX_STREAM_ON -#define ALT_DMA_TX_ONLY_OFF ALT_DMA_RX_STREAM_OFF - -/* - * - */ - -typedef struct alt_dma_txchan_dev_s alt_dma_txchan_dev; -typedef struct alt_dma_rxchan_dev_s alt_dma_rxchan_dev; - -typedef alt_dma_txchan_dev* alt_dma_txchan; -typedef alt_dma_rxchan_dev* alt_dma_rxchan; - -typedef void (alt_txchan_done)(void* handle); -typedef void (alt_rxchan_done)(void* handle, void* data); - -/* - * devices that provide a DMA transmit channel are required to provide an - * instance of the "alt_dma_txchan_dev" structure. - */ - -struct alt_dma_txchan_dev_s { - alt_llist llist; /* for internal use */ - const char* name; /* name of the device instance - * (e.g. "/dev/dma_0"). - */ - int (*space) (alt_dma_txchan dma); /* returns the maximum number of - * transmit requests that can be posted - */ - int (*dma_send) (alt_dma_txchan dma, - const void* from, - alt_u32 len, - alt_txchan_done* done, - void* handle); /* post a transmit request */ - int (*ioctl) (alt_dma_txchan dma, int req, void* arg); /* perform device - * specific I/O control. - */ -}; - -/* - * devices that provide a DMA receive channel are required to provide an - * instance of the "alt_dma_rxchan_dev" structure. - */ - -struct alt_dma_rxchan_dev_s { - alt_llist list; /* for internal use */ - const char* name; /* name of the device instance - * (e.g. "/dev/dma_0"). - */ - alt_u32 depth; /* maximum number of receive requests that - * can be posted. - */ - int (*prepare) (alt_dma_rxchan dma, - void* data, - alt_u32 len, - alt_rxchan_done* done, - void* handle); /* post a receive request */ - int (*ioctl) (alt_dma_rxchan dma, int req, void* arg); /* perform device - * specific I/O control. - */ -}; - -/* - * Register a DMA transmit channel with the system. - */ - -static ALT_INLINE int alt_dma_txchan_reg (alt_dma_txchan_dev* dev) -{ - extern alt_llist alt_dma_txchan_list; - - return alt_dev_llist_insert((alt_dev_llist*) dev, &alt_dma_txchan_list); -} - -/* - * Register a DMA receive channel with the system. - */ - -static ALT_INLINE int alt_dma_rxchan_reg (alt_dma_rxchan_dev* dev) -{ - extern alt_llist alt_dma_rxchan_list; - - return alt_dev_llist_insert((alt_dev_llist*) dev, &alt_dma_rxchan_list); -} - -/* - * - */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_DMA_DEV_H__ */ diff --git a/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_driver.h b/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_driver.h deleted file mode 100644 index eb0f23b..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_driver.h +++ /dev/null @@ -1,168 +0,0 @@ -#ifndef __ALT_DRIVER_H__ -#define __ALT_DRIVER_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/* - * Macros used to access a driver without HAL file descriptors. - */ - -/* - * ALT_MODULE_CLASS - * - * This macro returns the module class name for the specified module instance. - * It uses information in the system.h file. - * Neither the instance name or class name are quoted (so that they can - * be used with other pre-processor macros). - * - * Example: - * Assume the design has an instance of an altera_avalon_uart called uart1. - * Calling ALT_MODULE_CLASS(uart1) returns altera_avalon_uart. - */ - -#define ALT_MODULE_CLASS(instance) ALT_MODULE_CLASS_ ## instance - - -/* - * ALT_DRIVER_FUNC_NAME - * - * --> instance Instance name. - * --> func Function name. - * - * This macro returns the device driver function name of the specified - * module instance for the specified function name. - * - * Example: - * Assume the design has an instance of an altera_avalon_uart called uart1. - * Calling ALT_DRIVER_FUNC_NAME(uart1, write) returns - * altera_avalon_uart_write. - */ - -#define ALT_DRIVER_FUNC_NAME(instance, func) \ - ALT_DRIVER_FUNC_NAME1(ALT_MODULE_CLASS(instance), func) -#define ALT_DRIVER_FUNC_NAME1(module_class, func) \ - ALT_DRIVER_FUNC_NAME2(module_class, func) -#define ALT_DRIVER_FUNC_NAME2(module_class, func) \ - module_class ## _ ## func - -/* - * ALT_DRIVER_STATE_STRUCT - * - * --> instance Instance name. - * - * This macro returns the device driver state type name of the specified - * module instance. - * - * Example: - * Assume the design has an instance of an altera_avalon_uart called uart1. - * Calling ALT_DRIVER_STATE_STRUCT(uart1) returns: - * struct altera_avalon_uart_state_s - * - * Note that the ALT_DRIVER_FUNC_NAME macro is used even though "state" isn't - * really a function but it does match the required naming convention. - */ -#define ALT_DRIVER_STATE_STRUCT(instance) \ - struct ALT_DRIVER_FUNC_NAME(instance, state_s) - -/* - * ALT_DRIVER_STATE - * - * --> instance Instance name. - * - * This macro returns the device driver state name of the specified - * module instance. - * - * Example: - * Assume the design has an instance of an altera_avalon_uart called uart1. - * Calling ALT_DRIVER_STATE(uart1) returns uart1. - */ -#define ALT_DRIVER_STATE(instance) instance - -/* - * ALT_DRIVER_WRITE - * - * --> instance Instance name. - * --> buffer Write buffer. - * --> len Length of write buffer data. - * --> flags Control flags (e.g. O_NONBLOCK) - * - * This macro calls the "write" function of the specified driver instance. - */ - -#define ALT_DRIVER_WRITE_EXTERNS(instance) \ - extern ALT_DRIVER_STATE_STRUCT(instance) ALT_DRIVER_STATE(instance); \ - extern int ALT_DRIVER_FUNC_NAME(instance, write) \ - (ALT_DRIVER_STATE_STRUCT(instance) *, const char *, int, int); - -#define ALT_DRIVER_WRITE(instance, buffer, len, flags) \ - ALT_DRIVER_FUNC_NAME(instance, write)(&ALT_DRIVER_STATE(instance), buffer, len, flags) - - -/* - * ALT_DRIVER_READ - * - * --> instance Instance name. - * <-- buffer Read buffer. - * --> len Length of read buffer. - * --> flags Control flags (e.g. O_NONBLOCK) - * - * This macro calls the "read" function of the specified driver instance. - */ - -#define ALT_DRIVER_READ_EXTERNS(instance) \ - extern ALT_DRIVER_STATE_STRUCT(instance) ALT_DRIVER_STATE(instance); \ - extern int ALT_DRIVER_FUNC_NAME(instance, read) \ - (ALT_DRIVER_STATE_STRUCT(instance) *, const char *, int, int); - -#define ALT_DRIVER_READ(instance, buffer, len, flags) \ - ALT_DRIVER_FUNC_NAME(instance, read)(&ALT_DRIVER_STATE(instance), buffer, len, flags) - -/* - * ALT_DRIVER_IOCTL - * - * --> instance Instance name. - * --> req ioctl request (e.g. TIOCSTIMEOUT) - * --> arg Optional argument (void*) - * - * This macro calls the "ioctl" function of the specified driver instance - */ - -#define ALT_DRIVER_IOCTL_EXTERNS(instance) \ - extern ALT_DRIVER_STATE_STRUCT(instance) ALT_DRIVER_STATE(instance); \ - extern int ALT_DRIVER_FUNC_NAME(instance, ioctl) \ - (ALT_DRIVER_STATE_STRUCT(instance) *, int, void*); - -#define ALT_DRIVER_IOCTL(instance, req, arg) \ - ALT_DRIVER_FUNC_NAME(instance, ioctl)(&ALT_DRIVER_STATE(instance), req, arg) - -#endif /* __ALT_DRIVER_H__ */ diff --git a/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_errno.h b/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_errno.h deleted file mode 100644 index 4d3e50f..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_errno.h +++ /dev/null @@ -1,87 +0,0 @@ -#ifndef __ALT_ERRNO_H__ -#define __ALT_ERRNO_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * errno is defined in so that it uses the thread local version - * stored in the location pointed to by "_impure_ptr". This means that the - * accesses to errno within the HAL library can cause the entirety of - * of the structure pointed to by "_impure_ptr" to be added to the - * users application. This can be undesirable in very small footprint systems. - * - * To avoid this happening, the HAL uses the macro ALT_ERRNO, defined below, - * to access errno, rather than accessing it directly. This macro will only - * use the thread local version if some other code has already caused it to be - * included into the system, otherwise it will use the global errno value. - * - * This causes a slight increases in code size where errno is accessed, but - * can lead to significant overall benefits in very small systems. The - * increase is inconsequential when compared to the size of the structure - * pointed to by _impure_ptr. - * - * Note that this macro accesses __errno() using an externally declared - * function pointer (alt_errno). This is done so that the function call uses the - * subroutine call instruction via a register rather than an immediate address. - * This is important in the case that the code has been linked for a high - * address, but __errno() is not being used. In this case the weak linkage - * would have resulted in the instruction: "call 0" which would fail to link. - */ - -extern int* (*alt_errno) (void); - -/* Must define this so that values such as EBADFD are defined in errno.h. */ -#define __LINUX_ERRNO_EXTENSIONS__ - -#include - -#include "alt_types.h" - -#undef errno - -extern int errno; - -static ALT_INLINE int* alt_get_errno(void) -{ - return ((alt_errno) ? alt_errno() : &errno); -} - -#define ALT_ERRNO *alt_get_errno() - -#endif /* __ALT_ERRNO_H__ */ diff --git a/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_exceptions.h b/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_exceptions.h deleted file mode 100644 index 3576a52..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_exceptions.h +++ /dev/null @@ -1,127 +0,0 @@ -#ifndef __ALT_EXCEPTIONS_H__ -#define __ALT_EXCEPTIONS_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2008 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ -#include "alt_types.h" -#include "system.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * This file defines instruction-generated exception handling and registry - * API, exception type enumeration, and handler return value enumeration for - * Nios II. - */ - -/* - * The following enumeration describes the value in the CPU EXCEPTION - * register CAUSE bit field. Not all exception types will cause the - * processor to go to the exception vector; these are provided for - * reference. - */ -enum alt_exception_cause_e { - /* Exeption causes that will cause jump to exception vector */ - NIOS2_EXCEPTION_INTERRUPT = 2, - NIOS2_EXCEPTION_TRAP_INST = 3, - NIOS2_EXCEPTION_UNIMPLEMENTED_INST = 4, - NIOS2_EXCEPTION_ILLEGAL_INST = 5, - NIOS2_EXCEPTION_MISALIGNED_DATA_ADDR = 6, - NIOS2_EXCEPTION_MISALIGNED_TARGET_PC = 7, - NIOS2_EXCEPTION_DIVISION_ERROR = 8, - NIOS2_EXCEPTION_SUPERVISOR_ONLY_INST_ADDR = 9, - NIOS2_EXCEPTION_SUPERVISOR_ONLY_INST = 10, - NIOS2_EXCEPTION_SUPERVISOR_ONLY_DATA_ADDR = 11, - NIOS2_EXCEPTION_TLB_MISS = 12, - NIOS2_EXCEPTION_TLB_EXECUTE_PERM_VIOLATION = 13, - NIOS2_EXCEPTION_MPU_INST_REGION_VIOLATION = 16, - - /* Exception causes that will NOT cause a jump to exception vector */ - NIOS2_EXCEPTION_RESET = 0, - NIOS2_EXCEPTION_CPU_ONLY_RESET_REQUEST = 1, - NIOS2_EXCEPTION_TLB_READ_PERM_VIOLATION = 14, - NIOS2_EXCEPTION_TLB_WRITE_PERM_VIOLATION = 15, - NIOS2_EXCEPTION_MPU_DATA_REGION_VIOLATION = 17, - /* - * This value is passed to an exception handler's cause argument if - * "extra exceptions" information (EXECPTION) register is not - * present in the processor hardware configuration. - */ - NIOS2_EXCEPTION_CAUSE_NOT_PRESENT = -1 -}; -typedef enum alt_exception_cause_e alt_exception_cause; - -/* - * These define valid return values for a user-defined instruction-generated - * exception handler. The handler should return one of these to indicate - * whether to re-issue the instruction that triggered the exception, or to - * skip it. - */ -enum alt_exception_result_e { - NIOS2_EXCEPTION_RETURN_REISSUE_INST = 0, - NIOS2_EXCEPTION_RETURN_SKIP_INST = 1 -}; -typedef enum alt_exception_result_e alt_exception_result; - -/* - * alt_instruction_exception_register() can be used to register an exception - * handler for instruction-generated exceptions that are not handled by the - * built-in exception handler (i.e. for interrupts). - * - * The registry API is optionally enabled through the "Enable - * Instruction-related Exception API" HAL BSP setting, which will - * define the macro below. - */ -#ifdef ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API -void alt_instruction_exception_register ( - alt_exception_result (*exception_handler)( - alt_exception_cause cause, - alt_u32 exception_pc, - alt_u32 bad_addr) ); -#endif /*ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API */ - -/* - * alt_exception_cause_generated_bad_addr() indicates whether a particular - * exception cause value was from an exception-type that generated a valid - * address in the BADADDR register. The contents of BADADDR is passed to - * a user-registered exception handler in all cases, whether valid or not. - * This routine should be called to validate the bad_addr argument to - * your exception handler. - */ -int alt_exception_cause_generated_bad_addr(alt_exception_cause cause); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_EXCEPTIONS_H__ */ diff --git a/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_flash.h b/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_flash.h deleted file mode 100644 index 527328d..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_flash.h +++ /dev/null @@ -1,166 +0,0 @@ -#ifndef __ALT_FLASH_H__ -#define __ALT_FLASH_H__ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/****************************************************************************** -* * -* Alt_flash.h - User interface for flash code * -* * -* Use this interface to avoid being exposed to the internals of the device * -* driver architecture. If you chose to use the flash driver internal * -* structures we don't guarantee not to change them * -* * -* Author PRR * -* * -******************************************************************************/ - - - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#include "alt_types.h" -#include "alt_flash_types.h" -#include "alt_flash_dev.h" -#include "sys/alt_cache.h" - -alt_flash_fd* alt_flash_open_dev(const char* name); -void alt_flash_close_dev(alt_flash_fd* fd ); - -/* - * alt_write_flash - * - * Program a buffer into flash. - * - * This routine erases all the affected erase blocks (if necessary) - * and then programs the data. However it does not read the data out first - * and preserve and none overwritten data, because this would require very - * large buffers on the target. If you need - * that functionality use the functions below. - */ -static __inline__ int __attribute__ ((always_inline)) alt_write_flash( - alt_flash_fd* fd, - int offset, - const void* src_addr, - int length ) -{ - return fd->write( fd, offset, src_addr, length ); -} - -/* - * alt_read_flash - * - * Read a block of flash for most flashes this is just memcpy - * it's here for completeness in case we need it for some serial flash device - * - */ -static __inline__ int __attribute__ ((always_inline)) alt_read_flash( - alt_flash_fd* fd, int offset, - void* dest_addr, int length ) -{ - return fd->read( fd, offset, dest_addr, length ); -} - -/* - * alt_get_flash_info - * - * Return the information on the flash sectors. - * - */ -static __inline__ int __attribute__ ((always_inline)) alt_get_flash_info( - alt_flash_fd* fd, flash_region** info, - int* number_of_regions) -{ - return fd->get_info( fd, info, number_of_regions); -} - -/* - * alt_erase_flash_block - * - * Erase a particular erase block, pass in the offset to the start of - * the block and it's size - */ -static __inline__ int __attribute__ ((always_inline)) alt_erase_flash_block( - alt_flash_fd* fd, int offset, int length) -{ - int ret_code; - ret_code = fd->erase_block( fd, offset ); - - if(!ret_code) - alt_dcache_flush((alt_u8*)fd->base_addr + offset, length); - - return ret_code; -} - -/* - * alt_write_flash_block - * - * Write a particular flash block, block_offset is the offset - * (from the base of flash) to start of the block - * data_offset is the offset (from the base of flash) - * where you wish to start programming - * - * NB this function DOES NOT check that you are only writing a single - * block of data as that would slow down this function. - * - * Use alt_write_flash if you want that level of error checking. - */ - -static __inline__ int __attribute__ ((always_inline)) alt_write_flash_block( - alt_flash_fd* fd, int block_offset, - int data_offset, - const void *data, int length) -{ - - int ret_code; - ret_code = fd->write_block( fd, block_offset, data_offset, data, length ); - - if(!ret_code) - alt_dcache_flush((alt_u8*)fd->base_addr + data_offset, length); - - return ret_code; -} - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_FLASH_H__ */ diff --git a/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_flash_dev.h b/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_flash_dev.h deleted file mode 100644 index 8bab601..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_flash_dev.h +++ /dev/null @@ -1,98 +0,0 @@ -#ifndef __ALT_FLASH_DEV_H__ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/****************************************************************************** -* * -* Alt_flash_dev.h - Generic Flash device interfaces * -* * -* Author PRR * -* * -******************************************************************************/ -#define __ALT_FLASH_DEV_H__ - -#include "alt_flash_types.h" -#include "sys/alt_llist.h" -#include "priv/alt_dev_llist.h" - -#include "alt_types.h" - -typedef struct alt_flash_dev alt_flash_dev; -typedef alt_flash_dev alt_flash_fd; - -static ALT_INLINE int alt_flash_device_register( alt_flash_fd* fd) -{ - extern alt_llist alt_flash_dev_list; - - return alt_dev_llist_insert ((alt_dev_llist*) fd, &alt_flash_dev_list); -} - -typedef alt_flash_dev* (*alt_flash_open)(alt_flash_dev* flash, - const char* name ); -typedef int (*alt_flash_close)(alt_flash_dev* flash_info); - -typedef int (*alt_flash_write)( alt_flash_dev* flash, int offset, - const void* src_addr, int length ); - -typedef int (*alt_flash_get_flash_info)( alt_flash_dev* flash, flash_region** info, - int* number_of_regions); -typedef int (*alt_flash_write_block)( alt_flash_dev* flash, int block_offset, - int data_offset, const void* data, - int length); -typedef int (*alt_flash_erase_block)( alt_flash_dev* flash, int offset); -typedef int (*alt_flash_read)(alt_flash_dev* flash, int offset, - void* dest_addr, int length ); - -struct alt_flash_dev -{ - alt_llist llist; - const char* name; - alt_flash_open open; - alt_flash_close close; - alt_flash_write write; - alt_flash_read read; - alt_flash_get_flash_info get_info; - alt_flash_erase_block erase_block; - alt_flash_write_block write_block; - void* base_addr; - int length; - int number_of_regions; - flash_region region_info[ALT_MAX_NUMBER_OF_FLASH_REGIONS]; -}; - -#endif /* __ALT_FLASH_DEV_H__ */ diff --git a/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_flash_types.h b/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_flash_types.h deleted file mode 100644 index 884cbf8..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_flash_types.h +++ /dev/null @@ -1,64 +0,0 @@ -#ifndef __ALT_FLASH_TYPES_H__ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/****************************************************************************** -* * -* Alt_flash_types.h - Some generic types and defines used by the flash code * -* * -* Author PRR * -* * -******************************************************************************/ -#define __ALT_FLASH_TYPES_H__ - -#ifndef ALT_MAX_NUMBER_OF_FLASH_REGIONS -#define ALT_MAX_NUMBER_OF_FLASH_REGIONS 8 -#endif /* ALT_MAX_NUMBER_OF_FLASH_REGIONS */ - -/* - * Description of a single Erase region - */ -typedef struct flash_region -{ - int offset; - int region_size; - int number_of_blocks; - int block_size; -}flash_region; - -#endif /* __ALT_FLASH_TYPES_H__ */ diff --git a/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_irq.h b/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_irq.h deleted file mode 100644 index 6666e52..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_irq.h +++ /dev/null @@ -1,245 +0,0 @@ -#ifndef __ALT_IRQ_H__ -#define __ALT_IRQ_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * alt_irq.h is the Nios II specific implementation of the interrupt controller - * interface. - * - * Nios II includes optional support for an external interrupt controller. - * When an external controller is present, the "Enhanced" interrupt API - * must be used to manage individual interrupts. The enhanced API also - * supports the processor's internal interrupt controller. Certain API - * members are accessible from either the "legacy" or "enhanced" interrpt - * API. - * - * Regardless of which API is in use, this file should be included by - * application code and device drivers that register ISRs or manage interrpts. - */ -#include - -#include "nios2.h" -#include "alt_types.h" -#include "system.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * Macros used by alt_irq_enabled - */ -#define ALT_IRQ_ENABLED 1 -#define ALT_IRQ_DISABLED 0 - -/* - * Number of available interrupts in internal interrupt controller. - */ -#define ALT_NIRQ NIOS2_NIRQ - -/* - * Used by alt_irq_disable_all() and alt_irq_enable_all(). - */ -typedef int alt_irq_context; - -/* ISR Prototype */ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT -typedef void (*alt_isr_func)(void* isr_context); -#else -typedef void (*alt_isr_func)(void* isr_context, alt_u32 id); -#endif - -/* - * The following protypes and routines are supported by both - * the enhanced and legacy interrupt APIs - */ - -/* - * alt_irq_enabled can be called to determine if the processor's global - * interrupt enable is asserted. The return value is zero if interrupts - * are disabled, and non-zero otherwise. - * - * Whether the internal or external interrupt controller is present, - * individual interrupts may still be disabled. Use the other API to query - * a specific interrupt. - */ -static ALT_INLINE int ALT_ALWAYS_INLINE alt_irq_enabled (void) -{ - int status; - - NIOS2_READ_STATUS (status); - - return status & NIOS2_STATUS_PIE_MSK; -} - -/* - * alt_irq_disable_all() - * - * This routine inhibits all interrupts by negating the status register PIE - * bit. It returns the previous contents of the CPU status register (IRQ - * context) which can be used to restore the status register PIE bit to its - * state before this routine was called. - */ -static ALT_INLINE alt_irq_context ALT_ALWAYS_INLINE - alt_irq_disable_all (void) -{ - alt_irq_context context; - - NIOS2_READ_STATUS (context); - - NIOS2_WRITE_STATUS (context & ~NIOS2_STATUS_PIE_MSK); - - return context; -} - -/* - * alt_irq_enable_all() - * - * Enable all interrupts that were previously disabled by alt_irq_disable_all() - * - * This routine accepts a context to restore the CPU status register PIE bit - * to the state prior to a call to alt_irq_disable_all(). - - * In the case of nested calls to alt_irq_disable_all()/alt_irq_enable_all(), - * this means that alt_irq_enable_all() does not necessarily re-enable - * interrupts. - * - * This routine will perform a read-modify-write sequence to restore only - * status.PIE if the processor is configured with options that add additional - * writeable status register bits. These include the MMU, MPU, the enhanced - * interrupt controller port, and shadow registers. Otherwise, as a performance - * enhancement, status is overwritten with the prior context. - */ -static ALT_INLINE void ALT_ALWAYS_INLINE - alt_irq_enable_all (alt_irq_context context) -{ -#if (NIOS2_NUM_OF_SHADOW_REG_SETS > 0) || (defined NIOS2_EIC_PRESENT) || \ - (defined NIOS2_MMU_PRESENT) || (defined NIOS2_MPU_PRESENT) - alt_irq_context status; - - NIOS2_READ_STATUS (status); - - status &= ~NIOS2_STATUS_PIE_MSK; - status |= (context & NIOS2_STATUS_PIE_MSK); - - NIOS2_WRITE_STATUS (status); -#else - NIOS2_WRITE_STATUS (context); -#endif -} - -/* - * The function alt_irq_init() is defined within the auto-generated file - * alt_sys_init.c. This function calls the initilization macros for all - * interrupt controllers in the system at config time, before any other - * non-interrupt controller driver is initialized. - * - * The "base" parameter is ignored and only present for backwards-compatibility. - * It is recommended that NULL is passed in for the "base" parameter. - */ -extern void alt_irq_init (const void* base); - -/* - * alt_irq_cpu_enable_interrupts() enables the CPU to start taking interrupts. - */ -static ALT_INLINE void ALT_ALWAYS_INLINE - alt_irq_cpu_enable_interrupts () -{ - NIOS2_WRITE_STATUS(NIOS2_STATUS_PIE_MSK -#if defined(NIOS2_EIC_PRESENT) && (NIOS2_NUM_OF_SHADOW_REG_SETS > 0) - | NIOS2_STATUS_RSIE_MSK -#endif - ); -} - - -/* - * Prototypes for the enhanced interrupt API. - */ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT -/* - * alt_ic_isr_register() can be used to register an interrupt handler. If the - * function is succesful, then the requested interrupt will be enabled upon - * return. - */ -extern int alt_ic_isr_register(alt_u32 ic_id, - alt_u32 irq, - alt_isr_func isr, - void *isr_context, - void *flags); - -/* - * alt_ic_irq_enable() and alt_ic_irq_disable() enable/disable a specific - * interrupt by using IRQ port and interrupt controller instance. - */ -int alt_ic_irq_enable (alt_u32 ic_id, alt_u32 irq); -int alt_ic_irq_disable(alt_u32 ic_id, alt_u32 irq); - - /* - * alt_ic_irq_enabled() indicates whether a specific interrupt, as - * specified by IRQ port and interrupt controller instance is enabled. - */ -alt_u32 alt_ic_irq_enabled(alt_u32 ic_id, alt_u32 irq); - -#else -/* - * Prototypes for the legacy interrupt API. - */ -#include "priv/alt_legacy_irq.h" -#endif - - -/* - * alt_irq_pending() returns a bit list of the current pending interrupts. - * This is used by alt_irq_handler() to determine which registered interrupt - * handlers should be called. - * - * This routine is only available for the Nios II internal interrupt - * controller. - */ -#ifndef NIOS2_EIC_PRESENT -static ALT_INLINE alt_u32 ALT_ALWAYS_INLINE alt_irq_pending (void) -{ - alt_u32 active; - - NIOS2_READ_IPENDING (active); - - return active; -} -#endif - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_IRQ_H__ */ diff --git a/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_irq_entry.h b/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_irq_entry.h deleted file mode 100644 index e2008d9..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_irq_entry.h +++ /dev/null @@ -1,39 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * This file pulls in the IRQ entry assembler and C code, which is only - * required if there are any interruptes in the system. - */ - -__asm__( "\n\t.globl alt_irq_entry" ); - -__asm__( "\n\t.globl alt_irq_handler" ); - diff --git a/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_license_reminder_ucosii.h b/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_license_reminder_ucosii.h deleted file mode 100644 index 2fe649c..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_license_reminder_ucosii.h +++ /dev/null @@ -1,77 +0,0 @@ -#ifndef __ALT_LICENSE_REMINDER_UCOSII_H__ -#define __ALT_LICENSE_REMINDER_UCOSII_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include - -#define ALT_LICENSE_REMINDER_UCOSII_STRING \ - "============== Software License Reminder ===============\n" \ - "\n" \ - "uC/OS-II is provided in source form for FREE evaluation,\n" \ - "for educational use, or for peaceful research. If you\n" \ - "plan on using uC/OS-II in a commercial product you need\n" \ - "to contact Micrium to properly license its use in your\n" \ - "product. Micrium provides ALL the source code on the\n" \ - "Altera distribution for your convenience and to help you\n" \ - "experience uC/OS-II. The fact that the source is provided\n" \ - "does NOT mean that you can use it without paying a\n" \ - "licensing fee. Please help us continue to provide the\n" \ - "Embedded community with the finest software available.\n" \ - "Your honesty is greatly appreciated.\n" \ - "\n" \ - "Please contact:\n" \ - "\n" \ - "M I C R I U M\n" \ - "949 Crestview Circle\n" \ - "Weston, FL 33327-1848\n" \ - "U.S.A.\n" \ - "\n" \ - "Phone : +1 954 217 2036\n" \ - "FAX : +1 954 217 2037\n" \ - "WEB : www.micrium.com\n" \ - "E-mail: Sales@Micrium.com\n" \ - "\n" \ - "========================================================\n" - -#define alt_license_reminder_ucosii() puts(ALT_LICENSE_REMINDER_UCOSII_STRING) - - -#endif /* __ALT_LICENSE_REMINDER_UCOSII_H__ */ - diff --git a/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_llist.h b/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_llist.h deleted file mode 100644 index 46f81ce..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_llist.h +++ /dev/null @@ -1,123 +0,0 @@ -#ifndef __ALT_LIST_H__ -#define __ALT_LIST_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "alt_types.h" - -/* - * alt_llist.h defines structures and functions for use in manipulating linked - * lists. A list is considered to be constructed from a chain of objects of - * type alt_llist, with one object being defined to be the head element. - * - * A list is considered to be empty if it only contains the head element. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * alt_llist is the structure used to represent an element within a linked - * list. - */ - -typedef struct alt_llist_s alt_llist; - -struct alt_llist_s { - alt_llist* next; /* Pointer to the next element in the list. */ - alt_llist* previous; /* Pointer to the previous element in the list. */ -}; - -/* - * ALT_LLIST_HEAD is a macro that can be used to create the head of a new - * linked list. This is named "head". The head element is initialised to - * represent an empty list. - */ - -#define ALT_LLIST_HEAD(head) alt_llist head = {&head, &head} - -/* - * ALT_LLIST_ENTRY is a macro used to define an uninitialised linked list - * entry. This is used to reserve space in structure initialisation for - * structures that inherit form alt_llist. - */ - -#define ALT_LLIST_ENTRY {0, 0} - -/* - * alt_llist_insert() insert adds the linked list entry "entry" as the - * first entry in the linked list "list". "list" is the list head element. - */ - -static ALT_INLINE void ALT_ALWAYS_INLINE alt_llist_insert(alt_llist* list, - alt_llist* entry) -{ - entry->previous = list; - entry->next = list->next; - - list->next->previous = entry; - list->next = entry; -} - -/* - * alt_llist_remove() is called to remove an element from a linked list. The - * input argument is the element to remove. - */ - -static ALT_INLINE void ALT_ALWAYS_INLINE alt_llist_remove(alt_llist* entry) -{ - entry->next->previous = entry->previous; - entry->previous->next = entry->next; - - /* - * Set the entry to point to itself, so that any further calls to - * alt_llist_remove() are harmless. - */ - - entry->previous = entry; - entry->next = entry; -} - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_LLIST_H__ */ diff --git a/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_load.h b/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_load.h deleted file mode 100644 index 432e9f2..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_load.h +++ /dev/null @@ -1,78 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "alt_types.h" - -/* - * This macro is used to load code/data from its load address to its - * execution address for a given section. The section name is the input - * argument. Note that a leading '.' is assumed in the name. For example - * to load the section .onchip_ram, use: - * - * ALT_LOAD_SECTION_BY_NAME(onchip_ram); - * - * This requires that the apropriate linker symbols have been generated - * for the section in question. This will be the case if you are using the - * default linker script. - */ - -#define ALT_LOAD_SECTION_BY_NAME(name) \ - { \ - extern void _alt_partition_##name##_start; \ - extern void _alt_partition_##name##_end; \ - extern void _alt_partition_##name##_load_addr; \ - \ - alt_load_section(&_alt_partition_##name##_load_addr, \ - &_alt_partition_##name##_start, \ - &_alt_partition_##name##_end); \ - } - -/* - * Function used to load an individual section from flash to RAM. - * - * There is an implicit assumption here that the linker script will ensure - * that all sections are word aligned. - * - */ - -static void ALT_INLINE alt_load_section (alt_u32* from, - alt_u32* to, - alt_u32* end) -{ - if (to != from) - { - while( to != end ) - { - *to++ = *from++; - } - } -} diff --git a/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_log_printf.h b/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_log_printf.h deleted file mode 100644 index c15ca05..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_log_printf.h +++ /dev/null @@ -1,349 +0,0 @@ -/* alt_log_printf.h - * - * ALT_LOG is designed to provide extra logging/debugging messages from HAL - * through a different port than stdout. It is enabled by the ALT_LOG_ENABLE - * define, which needs to supplied at compile time. When logging is turned off, - * code size is unaffected. Thus, this should be transparent to the user - * when it is not actively turned on, and should not affect projects in any way. - * - * There are macros sprinkled within different components, such as the jtag uart - * and timer, in the HAL code. They are always named ALT_LOG_, and can be - * safely ignored if ALT_LOG is turned off. - * - * To turn on ALT_LOG, ALT_LOG_ENABLE must be defined, and ALT_LOG_PORT_TYPE and - * ALT_LOG_PORT_BASE must be set in system.h. This is done through editing - * .ptf, by editing the alt_log_port_type & alt_log_port_base settings. - * See the documentation html file for examples. - * - * When it is turned on, it will output extra HAL messages to a port specified - * in system.h. This can be a UART or JTAG UART port. By default it will - * output boot messages, detailing every step of the boot process. - * - * Extra logging is designed to be enabled by flags, which are defined in - * alt_log_printf.c. The default value is that all flags are off, so only the - * boot up logging messages show up. ALT_LOG_FLAGS can be set to enable certain - * groupings of flags, and that grouping is done in this file. Each flag can - * also be overridden with a -D at compile time. - * - * This header file includes the necessary prototypes for using the alt_log - * functions. It also contains all the macros that are used to remove the code - * from alt log is turned off. Also, the macros in other HAL files are defined - * here at the bottom. These macros all call some C function that is in - * alt_log_printf.c. - * - * The logging has functions for printing in C (ALT_LOG_PRINTF) and in assembly - * (ALT_LOG_PUTS). This was needed because the assembly printing occurs before - * the device is initialized. The assembly function corrupts register R4-R7, - * which are not used in the normal boot process. For this reason, do not call - * the assembly function in C. - * - * author: gkwan - */ - - -#ifndef __ALT_LOG_PRINTF_H__ -#define __ALT_LOG_PRINTF_H__ - -#include - -/* Global switch to turn on logging functions */ -#ifdef ALT_LOG_ENABLE - - /* ALT_LOG_PORT_TYPE values as defined in system.h. They are defined as - * numbers here first becasue the C preprocessor does not handle string - * comparisons. */ - #define ALTERA_AVALON_JTAG_UART 1 - #define ALTERA_AVALON_UART 0 - - /* If this .h file is included by an assembly file, skip over include files - * that won't compile in assembly. */ - #ifndef ALT_ASM_SRC - #include - #include "sys/alt_alarm.h" - #include "sys/alt_dev.h" - #ifdef __ALTERA_AVALON_JTAG_UART - #include "altera_avalon_jtag_uart.h" - #endif - #endif /* ALT_ASM_SRC */ - - /* These are included for the port register offsets and masks, needed - * to write to the port. Only include if the port type is set correctly, - * otherwise error. If alt_log is turned on and the port to output to is - * incorrect or does not exist, then should exit. */ - #if ALT_LOG_PORT_TYPE == ALTERA_AVALON_JTAG_UART - #ifdef __ALTERA_AVALON_JTAG_UART - #include - #else - #error ALT_LOG: JTAG_UART port chosen, but no JTAG_UART in system. - #endif - #elif ALT_LOG_PORT_TYPE == ALTERA_AVALON_UART - #ifdef __ALTERA_AVALON_UART - #include - #else - #error ALT_LOG: UART Port chosen, but no UART in system. - #endif - #else - #error ALT_LOG: alt_log_port_type declaration invalid! - #endif - - /* ALT_LOG_ENABLE turns on the basic printing function */ - #define ALT_LOG_PRINTF(...) do {alt_log_printf_proc(__VA_ARGS__);} while (0) - - /* Assembly macro for printing in assembly, calls tx_log_str - * which is in alt_log_macro.S. - * If alt_log_boot_on_flag is 0, skips the printing */ - #define ALT_LOG_PUTS(str) movhi r4, %hiadj(alt_log_boot_on_flag) ; \ - addi r4, r4, %lo(alt_log_boot_on_flag) ; \ - ldwio r5, 0(r4) ; \ - beq r0, r5, 0f ; \ - movhi r4, %hiadj(str) ; \ - addi r4, r4, %lo(str) ; \ - call tx_log_str ; \ - 0: - - /* These defines are here to faciliate the use of one output function - * (alt_log_txchar) to print to both the JTAG UART or the UART. Depending - * on the port type, the status register, read mask, and output register - * are set to the appropriate value for the port. */ - #if ALT_LOG_PORT_TYPE == ALTERA_AVALON_JTAG_UART - #define ALT_LOG_PRINT_REG_RD IORD_ALTERA_AVALON_JTAG_UART_CONTROL - #define ALT_LOG_PRINT_MSK ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_MSK - #define ALT_LOG_PRINT_TXDATA_WR IOWR_ALTERA_AVALON_JTAG_UART_DATA - #define ALT_LOG_PRINT_REG_OFFSET (ALTERA_AVALON_JTAG_UART_CONTROL_REG*0x4) - #define ALT_LOG_PRINT_TXDATA_REG_OFFSET (ALTERA_AVALON_JTAG_UART_DATA_REG*0x4) - #elif ALT_LOG_PORT_TYPE == ALTERA_AVALON_UART - #define ALT_LOG_PRINT_REG_RD IORD_ALTERA_AVALON_UART_STATUS - #define ALT_LOG_PRINT_MSK ALTERA_AVALON_UART_STATUS_TRDY_MSK - #define ALT_LOG_PRINT_TXDATA_WR IOWR_ALTERA_AVALON_UART_TXDATA - #define ALT_LOG_PRINT_REG_OFFSET (ALTERA_AVALON_UART_STATUS_REG*0x4) - #define ALT_LOG_PRINT_TXDATA_REG_OFFSET (ALTERA_AVALON_UART_TXDATA_REG*0x4) - #endif /* ALT_LOG_PORT */ - - /* Grouping of flags via ALT_LOG_FLAGS. Each specific flag can be set via - * -D at compile time, or else they'll be set to a default value according - * to ALT_LOG_FLAGS. ALT_LOG_FLAGS = 0 or not set is the default, where - * only the boot messages will be printed. As ALT_LOG_FLAGS increase, they - * increase in intrusiveness to the program, and will affect performance. - * - * Flag Level 1 - turns on system clock and JTAG UART startup status - * 2 - turns on write echo and JTAG_UART alarm (periodic report) - * 3 - turns on JTAG UART ISR logging - will slow performance - * significantly. - * -1 - All logging output is off, but if ALT_LOG_ENABLE is - * defined all logging function is built and code size - * remains constant - * - * Flag settings - 1 = on, 0 = off. */ - - /* This flag turns on "boot" messages for printing. This includes messages - * during crt0.S, then alt_main, and finally alt_exit. */ - #ifndef ALT_LOG_BOOT_ON_FLAG_SETTING - #if ALT_LOG_FLAGS == 1 - #define ALT_LOG_BOOT_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 2 - #define ALT_LOG_BOOT_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 3 - #define ALT_LOG_BOOT_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == -1 /* silent mode */ - #define ALT_LOG_BOOT_ON_FLAG_SETTING 0x0 - #else /* default setting */ - #define ALT_LOG_BOOT_ON_FLAG_SETTING 0x1 - #endif - #endif /* ALT_LOG_BOOT_ON_FLAG_SETTING */ - - #ifndef ALT_LOG_SYS_CLK_ON_FLAG_SETTING - #if ALT_LOG_FLAGS == 1 - #define ALT_LOG_SYS_CLK_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 2 - #define ALT_LOG_SYS_CLK_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 3 - #define ALT_LOG_SYS_CLK_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == -1 /* silent mode */ - #define ALT_LOG_SYS_CLK_ON_FLAG_SETTING 0x0 - #else /* default setting */ - #define ALT_LOG_SYS_CLK_ON_FLAG_SETTING 0x0 - #endif - #endif /* ALT_LOG_SYS_CLK_ON_FLAG_SETTING */ - - #ifndef ALT_LOG_WRITE_ON_FLAG_SETTING - #if ALT_LOG_FLAGS == 1 - #define ALT_LOG_WRITE_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 2 - #define ALT_LOG_WRITE_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 3 - #define ALT_LOG_WRITE_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == -1 /* silent mode */ - #define ALT_LOG_WRITE_ON_FLAG_SETTING 0x0 - #else /* default setting */ - #define ALT_LOG_WRITE_ON_FLAG_SETTING 0x0 - #endif - #endif /* ALT_LOG_WRITE_ON_FLAG_SETTING */ - - #ifndef ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING - #ifndef __ALTERA_AVALON_JTAG_UART - #define ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 1 - #define ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 2 - #define ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 3 - #define ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == -1 /* silent mode */ - #define ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING 0x0 - #else /* default setting */ - #define ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING 0x0 - #endif - #endif /* ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING */ - - #ifndef ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING - #ifndef __ALTERA_AVALON_JTAG_UART - #define ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 1 - #define ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 2 - #define ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 3 - #define ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == -1 /* silent mode */ - #define ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING 0x0 - #else /* default setting */ - #define ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING 0x0 - #endif - #endif /* ALT_LOG_JTAG_UART_STARTUP_INFO_FLAG_SETTING */ - - #ifndef ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING - #ifndef __ALTERA_AVALON_JTAG_UART - #define ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 1 - #define ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 2 - #define ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 3 - #define ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == -1 /* silent mode */ - #define ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING 0x0 - #else /* default setting */ - #define ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING 0x0 - #endif - #endif /* ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING */ - -#ifndef ALT_ASM_SRC - /* Function Prototypes */ - void alt_log_txchar(int c,char *uartBase); - void alt_log_private_printf(const char *fmt,int base,va_list args); - void alt_log_repchar(char c,int r,int base); - int alt_log_printf_proc(const char *fmt, ... ); - void alt_log_system_clock(); - #ifdef __ALTERA_AVALON_JTAG_UART - alt_u32 altera_avalon_jtag_uart_report_log(void * context); - void alt_log_jtag_uart_startup_info(altera_avalon_jtag_uart_state* dev, int base); - void alt_log_jtag_uart_print_control_reg(altera_avalon_jtag_uart_state* dev, \ - int base, const char* header); - void alt_log_jtag_uart_isr_proc(int base, altera_avalon_jtag_uart_state* dev); - #endif - void alt_log_write(const void *ptr, size_t len); - - /* extern all global variables */ - extern volatile alt_u32 alt_log_boot_on_flag; - extern volatile alt_u8 alt_log_write_on_flag; - extern volatile alt_u8 alt_log_sys_clk_on_flag; - extern volatile alt_u8 alt_log_jtag_uart_alarm_on_flag; - extern volatile alt_u8 alt_log_jtag_uart_isr_on_flag; - extern volatile alt_u8 alt_log_jtag_uart_startup_info_on_flag; - extern volatile int alt_log_sys_clk_count; - extern volatile int alt_system_clock_in_sec; - extern alt_alarm alt_log_jtag_uart_alarm_1; -#endif /* ALT_ASM_SRC */ - - - /* Below are the MACRO defines used in various HAL files. They check - * if their specific flag is turned on; if it is, then it executes its - * code. - * - * To keep this file reasonable, most of these macros calls functions, - * which are defined in alt_log_printf.c. Look there for implementation - * details. */ - - /* Boot Messages Logging */ - #define ALT_LOG_PRINT_BOOT(...) \ - do { if (alt_log_boot_on_flag==1) {ALT_LOG_PRINTF(__VA_ARGS__);} \ - } while (0) - - /* JTAG UART Logging */ - /* number of ticks before alarm runs logging function */ - #ifndef ALT_LOG_JTAG_UART_TICKS_DIVISOR - #define ALT_LOG_JTAG_UART_TICKS_DIVISOR 10 - #endif - #ifndef ALT_LOG_JTAG_UART_TICKS - #define ALT_LOG_JTAG_UART_TICKS \ - (alt_ticks_per_second()/ALT_LOG_JTAG_UART_TICKS_DIVISOR) - #endif - - /* if there's a JTAG UART defined, then enable these macros */ - #ifdef __ALTERA_AVALON_JTAG_UART - - /* Macro in altera_avalon_jtag_uart.c, to register the alarm function. - * Also, the startup register info is also printed here, as this is - * called within the device driver initialization. */ - #define ALT_LOG_JTAG_UART_ALARM_REGISTER(dev, base) \ - do { if (alt_log_jtag_uart_alarm_on_flag==1) { \ - alt_alarm_start(&alt_log_jtag_uart_alarm_1, \ - ALT_LOG_JTAG_UART_TICKS, &altera_avalon_jtag_uart_report_log,\ - dev);} \ - if (alt_log_jtag_uart_startup_info_on_flag==1) {\ - alt_log_jtag_uart_startup_info(dev, base);} \ - } while (0) - - /* JTAG UART IRQ Logging (when buffer is empty) - * Inserted in the ISR in altera_avalon_jtag_uart.c */ - #define ALT_LOG_JTAG_UART_ISR_FUNCTION(base, dev) \ - do { alt_log_jtag_uart_isr_proc(base, dev); } while (0) - /* else, define macros to nothing. Or else the jtag_uart specific types - * will throw compiler errors */ - #else - #define ALT_LOG_JTAG_UART_ALARM_REGISTER(dev, base) - #define ALT_LOG_JTAG_UART_ISR_FUNCTION(base, dev) - #endif - - /* System clock logging - * How often (in seconds) the system clock logging prints. - * The default value is every 1 second */ - #ifndef ALT_LOG_SYS_CLK_INTERVAL_MULTIPLIER - #define ALT_LOG_SYS_CLK_INTERVAL_MULTIPLIER 1 - #endif - #ifndef ALT_LOG_SYS_CLK_INTERVAL - #define ALT_LOG_SYS_CLK_INTERVAL \ - (alt_ticks_per_second()*ALT_LOG_SYS_CLK_INTERVAL_MULTIPLIER) - #endif - - /* System clock logging - prints a message every interval (set above) - * to show that the system clock is alive. - * This macro is used in altera_avalon_timer_sc.c */ - #define ALT_LOG_SYS_CLK_HEARTBEAT() \ - do { alt_log_system_clock(); } while (0) - - /* alt_write_logging - echos a message every time write() is called, - * displays the first ALT_LOG_WRITE_ECHO_LEN characters. - * This macro is used in alt_write.c */ - #ifndef ALT_LOG_WRITE_ECHO_LEN - #define ALT_LOG_WRITE_ECHO_LEN 15 - #endif - - #define ALT_LOG_WRITE_FUNCTION(ptr,len) \ - do { alt_log_write(ptr,len); } while (0) - -#else /* ALT_LOG_ENABLE not defined */ - - /* logging is off, set all relevant macros to null */ - #define ALT_LOG_PRINT_BOOT(...) - #define ALT_LOG_PRINTF(...) - #define ALT_LOG_JTAG_UART_ISR_FUNCTION(base, dev) - #define ALT_LOG_JTAG_UART_ALARM_REGISTER(dev, base) - #define ALT_LOG_SYS_CLK_HEARTBEAT() - #define ALT_LOG_PUTS(str) - #define ALT_LOG_WRITE_FUNCTION(ptr,len) - -#endif /* ALT_LOG_ENABLE */ - -#endif /* __ALT_LOG_PRINTF_H__ */ - diff --git a/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_set_args.h b/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_set_args.h deleted file mode 100644 index 3750e67..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_set_args.h +++ /dev/null @@ -1,71 +0,0 @@ -#ifndef __ALT_SET_ARGS_H__ -#define __ALT_SET_ARGS_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The function alt_set_args() is provided in order to define the input - * arguments to main(). If this function is not called before main() then the - * argument list passed to main() will be empty. - * - * It is expected that this function will only be used by the ihost/iclient - * utility. - */ - -static inline void alt_set_args (int argc, char** argv, char** envp) -{ - extern int alt_argc; - extern char** alt_argv; - extern char** alt_envp; - - alt_argc = argc; - alt_argv = argv; - alt_envp = envp; -} - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_SET_ARGS_H__ */ diff --git a/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_sim.h b/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_sim.h deleted file mode 100644 index 06bd27a..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_sim.h +++ /dev/null @@ -1,91 +0,0 @@ -#ifndef __ALT_SIM_H__ -#define __ALT_SIM_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ -#include "system.h" -#include "alt_types.h" - -/* - * Instructions that might mean something special to a simulator. - * These have no special effect on real hardware (they are just nops). - */ -#define ALT_SIM_FAIL() \ - do { __asm volatile ("cmpltui r0, r0, 0xabc1"); } while (0) - -#define ALT_SIM_PASS() \ - do { __asm volatile ("cmpltui r0, r0, 0xabc2"); } while (0) - -#define ALT_SIM_IN_TOP_OF_HOT_LOOP() \ - do { __asm volatile ("cmpltui r0, r0, 0xabc3"); } while (0) - -/* - * Routine called on exit. - */ -static ALT_ALWAYS_INLINE void alt_sim_halt(int exit_code) -{ - int r2 = exit_code; - -#if defined(NIOS2_HAS_DEBUG_STUB) && (defined(ALT_BREAK_ON_EXIT) || defined(ALT_PROVIDE_GMON)) - - int r3 = (1 << 2); - -#ifdef ALT_PROVIDE_GMON - extern unsigned int alt_gmon_data[]; - int r4 = (int)alt_gmon_data; - r3 |= (1 << 4); -#define ALT_GMON_DATA ,"D04"(r4) -#else -#define ALT_GMON_DATA -#endif /* ALT_PROVIDE_GMON */ - - if (r2) { - ALT_SIM_FAIL(); - } else { - ALT_SIM_PASS(); - } - - __asm__ volatile ("\n0:\n\taddi %0,%0, -1\n\tbgt %0,zero,0b" : : "r" (ALT_CPU_FREQ/100) ); /* Delay for >30ms */ - - __asm__ volatile ("break 2" : : "D02"(r2), "D03"(r3) ALT_GMON_DATA ); - -#else /* !DEBUG_STUB */ - if (r2) { - ALT_SIM_FAIL(); - } else { - ALT_SIM_PASS(); - } -#endif /* DEBUG_STUB */ -} - -#define ALT_SIM_HALT(exit_code) \ - alt_sim_halt(exit_code) - -#endif /* __ALT_SIM_H__ */ diff --git a/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_stack.h b/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_stack.h deleted file mode 100644 index e30652a..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_stack.h +++ /dev/null @@ -1,126 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#ifndef __ALT_STACK_H__ -#define __ALT_STACK_H__ - -/* - * alt_stack.h is the nios2 specific implementation of functions used by the - * stack overflow code. - */ - -#include "nios2.h" - -#include "alt_types.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - - -extern char * alt_stack_limit_value; - -#ifdef ALT_EXCEPTION_STACK -extern char __alt_exception_stack_pointer[]; /* set by the linker */ -#endif /* ALT_EXCEPTION_STACK */ - - -/* - * alt_stack_limit can be called to determine the current value of the stack - * limit register. - */ - -static ALT_INLINE char * ALT_ALWAYS_INLINE alt_stack_limit (void) -{ - char * limit; - NIOS2_READ_ET(limit); - - return limit; -} - -/* - * alt_stack_pointer can be called to determine the current value of the stack - * pointer register. - */ - -static ALT_INLINE char * ALT_ALWAYS_INLINE alt_stack_pointer (void) -{ - char * pointer; - NIOS2_READ_SP(pointer); - - return pointer; -} - - -#ifdef ALT_EXCEPTION_STACK - -/* - * alt_exception_stack_pointer returns the normal stack pointer from - * where it is stored on the exception stack (uppermost 4 bytes). This - * is really only useful during exception processing, and is only - * available if a separate exception stack has been configured. - */ - -static ALT_INLINE char * ALT_ALWAYS_INLINE alt_exception_stack_pointer (void) -{ - return (char *) *(alt_u32 *)(__alt_exception_stack_pointer - sizeof(alt_u32)); -} - -#endif /* ALT_EXCEPTION_STACK */ - - -/* - * alt_set_stack_limit can be called to update the current value of the stack - * limit register. - */ - -static ALT_INLINE void ALT_ALWAYS_INLINE alt_set_stack_limit (char * limit) -{ - alt_stack_limit_value = limit; - NIOS2_WRITE_ET(limit); -} - -/* - * alt_report_stack_overflow reports that a stack overflow happened. - */ - -static ALT_INLINE void ALT_ALWAYS_INLINE alt_report_stack_overflow (void) -{ - NIOS2_REPORT_STACK_OVERFLOW(); -} - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_STACK_H__ */ - diff --git a/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_stdio.h b/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_stdio.h deleted file mode 100644 index 1730360..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_stdio.h +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef __ALT_STDIO_H__ -#define __ALT_STDIO_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * Definitions for ALT stdio routines. - */ - -#include - - -#ifdef __cplusplus -extern "C" { -#endif - -int alt_getchar(); -int alt_putchar(int c); -int alt_putstr(const char* str); -void alt_printf(const char *fmt, ...); - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_STDIO_H__ */ diff --git a/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_sys_init.h b/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_sys_init.h deleted file mode 100644 index e4abc28..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_sys_init.h +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef __ALT_SYS_INIT_H__ -#define __ALT_SYS_INIT_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The function alt_sys_init() is defined within the auto-generated file: - * alt_sys_init.c. This function calls the initilisation macros for all - * devices, file systems, and software components within the system. - * - * The list of initilisation macros to use is constructed using the PTF and - * STF files associated with the system. - */ - -extern void alt_sys_init (void); - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_SYS_INIT_H__ */ diff --git a/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_sys_wrappers.h b/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_sys_wrappers.h deleted file mode 100644 index 044833b..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_sys_wrappers.h +++ /dev/null @@ -1,100 +0,0 @@ -#ifndef __ALT_SYS_WRAPPERS_H__ -#define __ALT_SYS_WRAPPERS_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * This file provides the prototypes for the HAL 'UNIX style functions. The - * names of these functions are defined in alt_syscall.h. THese are defined to - * be the standard names when running the standalone HAL, e.g. open(), close() - * etc., but the names may be redefined as a part of an operating system port - * in order to avoid name clashes. - */ - -#include "os/alt_syscall.h" - -#include -#include -#include -#include -#include -#include - -extern int ALT_CLOSE (int __fd); -extern int ALT_EXECVE (const char *__path, - char * const __argv[], - char * const __envp[]); -extern void ALT_EXIT (int __status); -extern int ALT_FSTAT (int file, struct stat *st); -extern int ALT_FCNTL (int file, int cmd, ...); -extern pid_t ALT_FORK (void); -extern pid_t ALT_GETPID (void); - -#if defined (__GNUC__) && __GNUC__ >= 4 -extern int ALT_GETTIMEOFDAY (struct timeval *ptimeval, - void *ptimezone); -#else -extern int ALT_GETTIMEOFDAY (struct timeval *ptimeval, - struct timezone *ptimezone); -#endif - -extern int ALT_IOCTL (int file, int req, void* arg); -extern int ALT_ISATTY (int file); -extern int ALT_KILL (int pid, int sig); -extern int ALT_LINK (const char *existing, const char *new); -extern off_t ALT_LSEEK (int file, off_t ptr, int dir); -extern int ALT_OPEN (const char* file, int flags, ...); -extern int ALT_READ (int file, void *ptr, size_t len); -extern int ALT_RENAME (char *existing, char *new); -extern void* ALT_SBRK (ptrdiff_t incr); -extern int ALT_SETTIMEOFDAY (const struct timeval *t, - const struct timezone *tz); -extern int ALT_STAT (const char *file, struct stat *st); -extern clock_t ALT_TIMES (struct tms *buf); -extern int ALT_UNLINK (const char *name); - -#if defined (__GNUC__) && __GNUC__ >= 4 -int ALT_USLEEP (useconds_t us); -#else -unsigned int ALT_USLEEP (unsigned int us); -#endif - -extern int ALT_WAIT (int *status); -extern int ALT_WRITE (int file, const void *ptr, size_t len); - - -extern char** ALT_ENVIRON; - -/* - * - */ - -#endif /* __ALT_SYS_WRAPPERS_H__ */ diff --git a/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_timestamp.h b/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_timestamp.h deleted file mode 100644 index 8a18da2..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_timestamp.h +++ /dev/null @@ -1,60 +0,0 @@ -#ifndef __ALT_TIMESTAMP_H__ -#define __ALT_TIMESTAMP_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "alt_types.h" -#include "altera_avalon_timer.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -extern int alt_timestamp_start (void); - -extern alt_timestamp_type alt_timestamp (void); - -extern alt_u32 alt_timestamp_freq (void); - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_TIMESTAMP_H__ */ diff --git a/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_warning.h b/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_warning.h deleted file mode 100644 index b66e71a..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/inc/sys/alt_warning.h +++ /dev/null @@ -1,75 +0,0 @@ -#ifndef __WARNING_H__ -#define __WARNING_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * alt_warning.h provides macro definitions that can be used to generate link - * time warnings. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The symbol "__alt_invalid" is used to force a link error. There should be - * no corresponding implementation of this function. - */ - -extern void __alt_invalid (void); - -#define ALT_LINK_WARNING(symbol, msg) \ - __asm__(".ifndef __evoke_link_warning_" #symbol \ - "\n\t .section .gnu.warning." #symbol \ - "\n__evoke_link_warning_" #symbol ":\n\t .string \x22" msg "\x22 \n\t .previous" \ - "\n .endif"); - -/* A canned warning for sysdeps/stub functions. */ - -#define ALT_STUB_WARNING(name) \ - ALT_LINK_WARNING (name, \ - "warning: " #name " is not implemented and will always fail") - -#define ALT_OBSOLETE_FUNCTION_WARNING(name) \ - ALT_LINK_WARNING (name, \ - "warning: " #name " is a deprecated function") - -#define ALT_LINK_ERROR(msg) \ - ALT_LINK_WARNING (__alt_invalid, msg); \ - __alt_invalid() - -#ifdef __cplusplus -} -#endif - -#endif /* __WARNING_H__ */ diff --git a/software/qsys_tutorial_key3_bsp/HAL/inc/sys/ioctl.h b/software/qsys_tutorial_key3_bsp/HAL/inc/sys/ioctl.h deleted file mode 100644 index 4d565df..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/inc/sys/ioctl.h +++ /dev/null @@ -1,90 +0,0 @@ -#ifndef __IOCTL_H__ -#define __IOCTL_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The ioctl() system call be used to initiate a variety of control operations - * on a file descriptor. For the most part this simply translates to a call to - * the ioctl() function of the associated device driver (TIOCEXCL and - * TIOCNXCL are notable exceptions - see ioctl.c for details). - * - * The interpretation of the ioctl requests are therefore device specific. - * - * This function is equivalent to the standard Posix ioctl() call. - */ - -extern int ioctl (int fd, int req, void* arg); - -/* - * list of ioctl calls handled by the system ioctl implementation. - */ - -#define TIOCEXCL 0x740d /* exclusive use of the device */ -#define TIOCNXCL 0x740e /* allow multiple use of the device */ - -/* - * ioctl calls which can be handled by device drivers. - */ - -#define TIOCOUTQ 0x7472 /* get output queue size */ -#define TIOCMGET 0x741d /* get termios flags */ -#define TIOCMSET 0x741a /* set termios flags */ - -/* - * ioctl calls specific to JTAG UART. - */ - -#define TIOCSTIMEOUT 0x6a01 /* Set Timeout before assuming no host present */ -#define TIOCGCONNECTED 0x6a02 /* Get indication of whether host is connected */ - -/* - * - */ - -#ifdef __cplusplus -} -#endif - -#endif /* __IOCTL_H__ */ diff --git a/software/qsys_tutorial_key3_bsp/HAL/inc/sys/termios.h b/software/qsys_tutorial_key3_bsp/HAL/inc/sys/termios.h deleted file mode 100644 index cd09539..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/inc/sys/termios.h +++ /dev/null @@ -1,181 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * This is the termios.h file provided with newlib. The only modification has - * been to the baud rate macro definitions, and an increase in the size of the - * termios structure to accomodate this. - */ - - -#ifndef _SYS_TERMIOS_H -# define _SYS_TERMIOS_H - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -# define _XCGETA (('x'<<8)|1) -# define _XCSETA (('x'<<8)|2) -# define _XCSETAW (('x'<<8)|3) -# define _XCSETAF (('x'<<8)|4) -# define _TCSBRK (('T'<<8)|5) -# define _TCFLSH (('T'<<8)|7) -# define _TCXONC (('T'<<8)|6) - -# define TCOOFF 0 -# define TCOON 1 -# define TCIOFF 2 -# define TCION 3 - -# define TCIFLUSH 0 -# define TCOFLUSH 1 -# define TCIOFLUSH 2 - -# define NCCS 13 - -# define TCSAFLUSH _XCSETAF -# define TCSANOW _XCSETA -# define TCSADRAIN _XCSETAW -# define TCSADFLUSH _XCSETAF - -# define IGNBRK 000001 -# define BRKINT 000002 -# define IGNPAR 000004 -# define INPCK 000020 -# define ISTRIP 000040 -# define INLCR 000100 -# define IGNCR 000200 -# define ICRNL 000400 -# define IXON 002000 -# define IXOFF 010000 - -# define OPOST 000001 -# define OCRNL 000004 -# define ONLCR 000010 -# define ONOCR 000020 -# define TAB3 014000 - -# define CLOCAL 004000 -# define CREAD 000200 -# define CSIZE 000060 -# define CS5 0 -# define CS6 020 -# define CS7 040 -# define CS8 060 -# define CSTOPB 000100 -# define HUPCL 002000 -# define PARENB 000400 -# define PAODD 001000 - -#define CCTS_OFLOW 010000 -#define CRTS_IFLOW 020000 -#define CRTSCTS (CCTS_OFLOW | CRTS_IFLOW) - -# define ECHO 0000010 -# define ECHOE 0000020 -# define ECHOK 0000040 -# define ECHONL 0000100 -# define ICANON 0000002 -# define IEXTEN 0000400 /* anybody know *what* this does?! */ -# define ISIG 0000001 -# define NOFLSH 0000200 -# define TOSTOP 0001000 - -# define VEOF 4 /* also VMIN -- thanks, AT&T */ -# define VEOL 5 /* also VTIME -- thanks again */ -# define VERASE 2 -# define VINTR 0 -# define VKILL 3 -# define VMIN 4 /* also VEOF */ -# define VQUIT 1 -# define VSUSP 10 -# define VTIME 5 /* also VEOL */ -# define VSTART 11 -# define VSTOP 12 - -# define B0 0 -# define B50 50 -# define B75 75 -# define B110 110 -# define B134 134 -# define B150 150 -# define B200 200 -# define B300 300 -# define B600 600 -# define B1200 1200 -# define B1800 1800 -# define B2400 2400 -# define B4800 4800 -# define B9600 9600 -# define B19200 19200 -# define B38400 38400 -# define B57600 57600 -# define B115200 115200 - -typedef unsigned char cc_t; -typedef unsigned short tcflag_t; -typedef unsigned long speed_t; - -struct termios { - tcflag_t c_iflag; - tcflag_t c_oflag; - tcflag_t c_cflag; - tcflag_t c_lflag; - char c_line; - cc_t c_cc[NCCS]; - speed_t c_ispeed; - speed_t c_ospeed; -}; - -# ifndef _NO_MACROS - -# define cfgetospeed(tp) ((tp)->c_ospeed) -# define cfgetispeed(tp) ((tp)->c_ispeed) -# define cfsetospeed(tp,s) (((tp)->c_ospeed = (s)), 0) -# define cfsetispeed(tp,s) (((tp)->c_ispeed = (s)), 0) -# define tcdrain(fd) _ioctl (fd, _TCSBRK, 1) -# endif /* _NO_MACROS */ - -#ifdef __cplusplus -} -#endif - -#endif /* _SYS_TERMIOS_H */ - diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_alarm_start.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_alarm_start.c deleted file mode 100644 index 7739959..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_alarm_start.c +++ /dev/null @@ -1,112 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "sys/alt_alarm.h" -#include "sys/alt_irq.h" - -/* - * alt_alarm_start is called to register an alarm with the system. The - * "alarm" structure passed as an input argument does not need to be - * initialised by the user. This is done within this function. - * - * The remaining input arguments are: - * - * nticks - The time to elapse until the alarm executes. This is specified in - * system clock ticks. - * callback - The function to run when the indicated time has elapsed. - * context - An opaque value, passed to the callback function. -* - * Care should be taken when defining the callback function since it is - * likely to execute in interrupt context. In particular, this mean that - * library calls like printf() should not be made, since they can result in - * deadlock. - * - * The interval to be used for the next callback is the return - * value from the callback function. A return value of zero indicates that the - * alarm should be unregistered. - * - * alt_alarm_start() will fail if the timer facility has not been enabled - * (i.e. there is no system clock). Failure is indicated by a negative return - * value. - */ - -int alt_alarm_start (alt_alarm* alarm, alt_u32 nticks, - alt_u32 (*callback) (void* context), - void* context) -{ - alt_irq_context irq_context; - alt_u32 current_nticks = 0; - - if (alt_ticks_per_second ()) - { - if (alarm) - { - alarm->callback = callback; - alarm->context = context; - - irq_context = alt_irq_disable_all (); - - current_nticks = alt_nticks(); - - alarm->time = nticks + current_nticks + 1; - - /* - * If the desired alarm time causes a roll-over, set the rollover - * flag. This will prevent the subsequent tick event from causing - * an alarm too early. - */ - if(alarm->time < current_nticks) - { - alarm->rollover = 1; - } - else - { - alarm->rollover = 0; - } - - alt_llist_insert (&alt_alarm_list, &alarm->llist); - alt_irq_enable_all (irq_context); - - return 0; - } - else - { - return -EINVAL; - } - } - else - { - return -ENOTSUP; - } -} diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_busy_sleep.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_busy_sleep.c deleted file mode 100644 index 561c0be..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_busy_sleep.c +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright (c) 2003-2004 Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - * - * ------------ - * - * Altera does not recommend, suggest or require that this reference design - * file be used in conjunction or combination with any other product. - * - * alt_busy_sleep.c - Microsecond delay routine which uses a calibrated busy - * loop to perform the delay. This is used to implement - * usleep for both uC/OS-II and the standalone HAL. - * - * Author PRR - * - * Calibrated delay with no timer required - * - * The ASM instructions in the routine are equivalent to - * - * for (i=0;i -#include - -#include "system.h" -#include "alt_types.h" - -#include "priv/alt_busy_sleep.h" - -unsigned int alt_busy_sleep (unsigned int us) -{ -/* - * Only delay if ALT_SIM_OPTIMIZE is not defined; i.e., if software - * is built targetting ModelSim RTL simulation, the delay will be - * skipped to speed up simulation. - */ -#ifndef ALT_SIM_OPTIMIZE - int i; - int big_loops; - alt_u32 cycles_per_loop; - - if (!strcmp(NIOS2_CPU_IMPLEMENTATION,"tiny")) - { - cycles_per_loop = 9; - } - else - { - cycles_per_loop = 3; - } - - - big_loops = us / (INT_MAX/ - (ALT_CPU_FREQ/(cycles_per_loop * 1000000))); - - if (big_loops) - { - for(i=0;i - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -#ifdef ALT_USE_DIRECT_DRIVERS - -int ALT_CLOSE (int fildes) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(close); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -/* - * close() is called by an application to release a file descriptor. If the - * associated file system/device has a close() callback function registered - * then this called. The file descriptor is then marked as free. - * - * ALT_CLOSE is mapped onto the close() system call in alt_syscall.h - */ - -int ALT_CLOSE (int fildes) -{ - alt_fd* fd; - int rval; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (fildes < 0) ? NULL : &alt_fd_list[fildes]; - - if (fd) - { - /* - * If the associated file system/device has a close function, call it so - * that any necessary cleanup code can run. - */ - - rval = (fd->dev->close) ? fd->dev->close(fd) : 0; - - /* Free the file descriptor structure and return. */ - - alt_release_fd (fildes); - if (rval < 0) - { - ALT_ERRNO = -rval; - return -1; - } - return 0; - } - else - { - ALT_ERRNO = EBADFD; - return -1; - } -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_dcache_flush.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_dcache_flush.c deleted file mode 100644 index 7ecc91a..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_dcache_flush.c +++ /dev/null @@ -1,97 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "nios2.h" -#include "system.h" - -#include "alt_types.h" -#include "sys/alt_cache.h" - -/* - * Nios II version 1.2 and newer supports the "flush by address" instruction, in - * addition to the "flush by line" instruction provided by older versions of - * the core. This newer instruction is used by preference when it is - * available. - */ - -#ifdef NIOS2_FLUSHDA_SUPPORTED -#define ALT_FLUSH_DATA(i) __asm__ volatile ("flushda (%0)" :: "r" (i)); -#else -#define ALT_FLUSH_DATA(i) __asm__ volatile ("flushd (%0)" :: "r" (i)); -#endif /* NIOS2_FLUSHDA_SUPPORTED */ - -/* - * alt_dcache_flush() is called to flush the data cache for a memory - * region of length "len" bytes, starting at address "start". - * - * Any dirty lines in the data cache are written back to memory. - */ - -void alt_dcache_flush (void* start, alt_u32 len) -{ -#if NIOS2_DCACHE_SIZE > 0 - - char* i; - char* end; - - /* - * This is the most we would ever need to flush. - * - * SPR 196942, 2006.01.13: The cache flush loop below will use the - * 'flushda' instruction if its available; in that case each line - * must be flushed individually, and thus 'len' cannot be trimmed. - */ - #ifndef NIOS2_FLUSHDA_SUPPORTED - if (len > NIOS2_DCACHE_SIZE) - { - len = NIOS2_DCACHE_SIZE; - } - #endif - - end = ((char*) start) + len; - - for (i = start; i < end; i+= NIOS2_DCACHE_LINE_SIZE) - { - ALT_FLUSH_DATA(i); - } - - /* - * For an unaligned flush request, we've got one more line left. - * Note that this is dependent on NIOS2_DCACHE_LINE_SIZE to be a - * multiple of 2 (which it always is). - */ - - if (((alt_u32) start) & (NIOS2_DCACHE_LINE_SIZE - 1)) - { - ALT_FLUSH_DATA(i); - } - -#endif /* NIOS2_DCACHE_SIZE > 0 */ -} diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_dcache_flush_all.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_dcache_flush_all.c deleted file mode 100644 index 6529231..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_dcache_flush_all.c +++ /dev/null @@ -1,51 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "nios2.h" -#include "system.h" - -#include "alt_types.h" -#include "sys/alt_cache.h" - -/* - * alt_dcache_flush_all() is called to flush the entire data cache. - */ - -void alt_dcache_flush_all (void) -{ -#if NIOS2_DCACHE_SIZE > 0 - char* i; - - for (i = (char*) 0; i < (char*) NIOS2_DCACHE_SIZE; i+= NIOS2_DCACHE_LINE_SIZE) - { - __asm__ volatile ("flushd (%0)" :: "r" (i)); - } -#endif /* NIOS2_DCACHE_SIZE > 0 */ -} diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_dcache_flush_no_writeback.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_dcache_flush_no_writeback.c deleted file mode 100644 index c65ca7d..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_dcache_flush_no_writeback.c +++ /dev/null @@ -1,88 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "nios2.h" -#include "system.h" - -#include "alt_types.h" -#include "sys/alt_cache.h" - -/* - * The INITDA instruction was added to Nios II in the 8.0 release. - * - * The INITDA instruction has one of the following possible behaviors - * depending on the processor configuration: - * 1) Flushes a line by address but does NOT write back dirty data. - * Occurs when a data cache is present that supports INITDA. - * The macro NIOS2_INITDA_SUPPORTED is defined in system.h. - * 2) Takes an unimplemented instruction exception. - * Occurs when a data cache is present that doesn't support INITDA. - * 3) Performs no operation - * Occurs when there is no data cache present. - * The macro NIOS2_DCACHE_SIZE is 0 in system.h. - */ - -#define ALT_FLUSH_DATA_NO_WRITEBACK(i) \ - __asm__ volatile ("initda (%0)" :: "r" (i)); - -/* - * alt_dcache_flush_no_writeback() is called to flush the data cache for a - * memory region of length "len" bytes, starting at address "start". - * - * Any dirty lines in the data cache are NOT written back to memory. - * Make sure you really want this behavior. If you aren't 100% sure, - * use the alt_dcache_flush() routine instead. - */ - -void alt_dcache_flush_no_writeback (void* start, alt_u32 len) -{ -#if defined(NIOS2_INITDA_SUPPORTED) - - char* i; - char* end = ((char*) start) + len; - - for (i = start; i < end; i+= NIOS2_DCACHE_LINE_SIZE) - { - ALT_FLUSH_DATA_NO_WRITEBACK(i); - } - - /* - * For an unaligned flush request, we've got one more line left. - * Note that this is dependent on NIOS2_DCACHE_LINE_SIZE to be a - * multiple of 2 (which it always is). - */ - - if (((alt_u32) start) & (NIOS2_DCACHE_LINE_SIZE - 1)) - { - ALT_FLUSH_DATA_NO_WRITEBACK(i); - } - -#endif /* NIOS2_INITDA_SUPPORTED */ -} diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_dev.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_dev.c deleted file mode 100644 index ebc15e5..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_dev.c +++ /dev/null @@ -1,149 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include -#include -#include - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - -#include "alt_types.h" - -#include "system.h" - -/* - * This file contains the data constructs used to control access to device and - * filesytems. - */ - -/* - * "alt_fs_list" is the head of a linked list of registered filesystems. It is - * initialised as an empty list. New entries can be added using the - * alt_fs_reg() function. - */ - -ALT_LLIST_HEAD(alt_fs_list); - - -/* - * "alt_dev_list" is the head of a linked list of registered devices. It is - * configured at startup to include a single device, "alt_dev_null". This - * device is discussed below. - */ - -extern alt_dev alt_dev_null; /* forward declaration */ - -alt_llist alt_dev_list = {&alt_dev_null.llist, &alt_dev_null.llist}; - -/* - * alt_dev_null_write() is the implementation of the write() function used - * by the alt_dev_null device. It simple discards all data passed to it, and - * indicates that the data has been successfully transmitted. - */ - -static int alt_dev_null_write (alt_fd* fd, const char* ptr, int len) -{ - return len; -} - -/* - * "alt_dev_null" is used to allow output to be redirected to nowhere. It is - * the only device registered before the call to alt_sys_init(). At startup - * stin, stdout & stderr are all directed towards this device so that library - * calls like printf() will be safe but inefectual. - */ - -alt_dev alt_dev_null = { - { - &alt_dev_list, - &alt_dev_list - }, - "/dev/null", - NULL, /* open */ - NULL, /* close */ - NULL, /* write */ - alt_dev_null_write, /* write */ - NULL, /* lseek */ - NULL, /* fstat */ - NULL /* ioctl */ - }; - -/* - * "alt_fd_list_lock" is a semaphore used to control access to the file - * descriptor list. This is used to ensure that access to the list is thread - * safe. - */ - -ALT_SEM(alt_fd_list_lock) - -/* - * "alt_max_fd" is used to make access to the file descriptor list more - * efficent. It is set to be the value of the highest allocated file - * descriptor. This saves having to search the entire pool of unallocated - * file descriptors when looking for a match. - */ - -alt_32 alt_max_fd = -1; - -/* - * "alt_fd_list" is the file descriptor pool. The first three entries in the - * array are configured as standard in, standard out, and standard error. These - * are all initialised so that accesses are directed to the alt_dev_null - * device. The remaining file descriptors are initialised as unallocated. - * - * The maximum number of file descriptors within the system is specified by the - * user defined macro "ALT_MAX_FD". This is defined in "system.h", which is - * auto-genereated using the projects PTF and STF files. - */ - -alt_fd alt_fd_list[ALT_MAX_FD] = - { - { - &alt_dev_null, /* standard in */ - 0, - 0 - }, - { - &alt_dev_null, /* standard out */ - 0, - 0 - }, - { - &alt_dev_null, /* standard error */ - 0, - 0 - } - /* all other elements are set to zero */ - }; diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_dev_llist_insert.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_dev_llist_insert.c deleted file mode 100644 index fa7239d..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_dev_llist_insert.c +++ /dev/null @@ -1,59 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "priv/alt_dev_llist.h" -#include "sys/alt_errno.h" - -/* - * - */ - -int alt_dev_llist_insert (alt_dev_llist* dev, alt_llist* list) -{ - /* - * check that the device exists, and that it has a valid name. - */ - - if (!dev || !dev->name) - { - ALT_ERRNO = EINVAL; - return -EINVAL; - } - - /* - * register the device. - */ - - alt_llist_insert(list, &dev->llist); - - return 0; -} diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_dma_rxchan_open.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_dma_rxchan_open.c deleted file mode 100644 index 6ea3b78..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_dma_rxchan_open.c +++ /dev/null @@ -1,63 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_dma.h" -#include "sys/alt_errno.h" -#include "priv/alt_file.h" - -/* - * The list of registered DMA receive channels. - */ - -ALT_LLIST_HEAD(alt_dma_rxchan_list); - -/* - * alt_dma_txchan_open() is used to obtain an "alt_dma_txchan" descriptor for - * a DMA transmit device. The name is the name of the associated physical - * device (e.g. "/dev/dma_0"). - * - * The return value will be NULL on failure, and non-NULL otherwise. - */ - -alt_dma_rxchan alt_dma_rxchan_open (const char* name) -{ - alt_dma_rxchan dev; - - dev = (alt_dma_rxchan) alt_find_dev (name, &alt_dma_rxchan_list); - - if (!dev) - { - ALT_ERRNO = ENODEV; - } - - return dev; -} diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_dma_txchan_open.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_dma_txchan_open.c deleted file mode 100644 index f41fa81..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_dma_txchan_open.c +++ /dev/null @@ -1,63 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_dma.h" -#include "sys/alt_errno.h" -#include "priv/alt_file.h" - -/* - * The list of registered receive channels. - */ - -ALT_LLIST_HEAD(alt_dma_txchan_list); - -/* - * alt_dma_txchan_open() is used to obtain an "alt_dma_txchan" descriptor for - * a DMA transmit device. The name is the name of the associated physical - * device (e.g. "/dev/dma_0"). - * - * The return value will be NULL on failure, and non-NULL otherwise. - */ - -alt_dma_txchan alt_dma_txchan_open (const char* name) -{ - alt_dma_txchan dev; - - dev = (alt_dma_txchan) alt_find_dev (name, &alt_dma_txchan_list); - - if (!dev) - { - ALT_ERRNO = ENODEV; - } - - return dev; -} diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_do_ctors.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_do_ctors.c deleted file mode 100644 index ff5a1f7..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_do_ctors.c +++ /dev/null @@ -1,64 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT IT DIRECTLY. * -* * -* Overriding HAL Functions * -* * -* To provide your own implementation of a HAL function, include the file in * -* your Nios II IDE application project. When building the executable, the * -* Nios II IDE finds your function first, and uses it in place of the HAL * -* version. * -* * -******************************************************************************/ - -/* - * - */ - -typedef void (*constructor) (void); -extern constructor __CTOR_LIST__[]; -extern constructor __CTOR_END__[]; - -/* - * Run the C++ static constructors. - */ - -void _do_ctors(void) -{ - constructor* ctor; - - for (ctor = &__CTOR_END__[-1]; ctor >= __CTOR_LIST__; ctor--) - (*ctor) (); -} diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_do_dtors.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_do_dtors.c deleted file mode 100644 index 565c99f..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_do_dtors.c +++ /dev/null @@ -1,64 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT IT DIRECTLY. * -* * -* Overriding HAL Functions * -* * -* To provide your own implementation of a HAL function, include the file in * -* your Nios II IDE application project. When building the executable, the * -* Nios II IDE finds your function first, and uses it in place of the HAL * -* version. * -* * -******************************************************************************/ - -/* - * - */ - -typedef void (*destructor) (void); -extern destructor __DTOR_LIST__[]; -extern destructor __DTOR_END__[]; - -/* - * Run the C++ static destructors. - */ - -void _do_dtors(void) -{ - destructor* dtor; - - for (dtor = &__DTOR_END__[-1]; dtor >= __DTOR_LIST__; dtor--) - (*dtor) (); -} diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_env_lock.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_env_lock.c deleted file mode 100644 index fc25a0c..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_env_lock.c +++ /dev/null @@ -1,53 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -/* - * These are the empty env lock/unlock stubs required by newlib. These are - * used to make accesses to environment variables thread safe. The default HAL - * configuration is single threaded, so there is nothing to do here. Note that - * this requires that environment variables are never manipulated by an interrupt - * service routine. - */ - -void __env_lock ( struct _reent *_r ) -{ -} - -/* - * - */ - -void __env_unlock ( struct _reent *_r ) -{ -} diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_environ.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_environ.c deleted file mode 100644 index 404efc4..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_environ.c +++ /dev/null @@ -1,42 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "os/alt_syscall.h" - -/* - * These are the environment variables passed to the C code. By default there - * are no variables registered. An application can manipulate this list using - * getenv() and setenv(). - */ - -char *__env[1] = { 0 }; -char **ALT_ENVIRON = __env; diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_errno.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_errno.c deleted file mode 100644 index 1d8368d..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_errno.c +++ /dev/null @@ -1,44 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/* - * This file defines the alt_errno global variable. See comments in - * alt_errno.h for the use of this variable. - */ - - -#include "sys/alt_errno.h" -#include "alt_types.h" - -extern int ALT_WEAK *__errno (void); - -int* (*alt_errno) (void) = __errno; diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_exception_entry.S b/software/qsys_tutorial_key3_bsp/HAL/src/alt_exception_entry.S deleted file mode 100644 index 3afab93..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_exception_entry.S +++ /dev/null @@ -1,360 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2008 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "system.h" - -/* - * This is the exception entry point code, which saves all the caller saved - * registers and then handles the appropriate exception. It should be pulled - * in using a .globl from all the exception handler routines. This scheme is - * used so that if an interrupt is never registered, then this code will not - * appear in the generated executable, thereby improving code footprint. - * - * If an external interrpt controller (EIC) is present, it will supply an - * interrupt vector address to the processor when an interrupt occurs. For - * The Altera Vectored Interrupt Controller (VIC) driver will establish a - * vector table and the processor will jump directly to the appropriate - * table entry, funnel routine, and then user ISR. This will bypass this code - * in entirety. This code might still be linked into a system with an EIC, - * but would then be used only for non-interrupt exceptions. - */ - - /* - * Explicitly allow the use of r1 (the assembler temporary register) - * within this code. This register is normally reserved for the use of - * the assembler. - */ - .set noat - - /* - * The top and bottom of the exception stack - */ -#ifdef ALT_EXCEPTION_STACK - - .globl __alt_exception_stack_pointer - -#ifdef ALT_STACK_CHECK - - .globl __alt_exception_stack_limit - - /* - * We need to store the value of the stack limit after interrupt somewhere. - */ - .globl alt_exception_old_stack_limit - -#endif -#endif - - .section .exceptions.entry.label, "xa" - - .globl alt_exception - .type alt_exception, @function -alt_exception: - - .section .exceptions.entry, "xa" - -#ifdef ALT_EXCEPTION_STACK - -#ifdef ALT_STACK_CHECK - stw et, %gprel(alt_exception_old_stack_limit)(gp) -#endif - - movhi et, %hiadj(__alt_exception_stack_pointer - 80) - addi et, et, %lo(__alt_exception_stack_pointer - 80) - stw sp, 76(et) - mov sp, et - -#ifdef ALT_STACK_CHECK - movhi et, %hiadj(__alt_exception_stack_limit) - addi et, et, %lo(__alt_exception_stack_limit) - stw et, %gprel(alt_stack_limit_value)(gp) -#endif - -#else - /* - * Process an exception. For all exceptions we must preserve all - * caller saved registers on the stack (See the Nios2 ABI - * documentation for details). - */ - - addi sp, sp, -76 - -#ifdef ALT_STACK_CHECK - - bltu sp, et, .Lstack_overflow - -#endif - -#endif - - stw ra, 0(sp) - - /* - * Leave a gap in the stack frame at 4(sp) for the muldiv handler to - * store zero into. - */ - - stw r1, 8(sp) - stw r2, 12(sp) - stw r3, 16(sp) - stw r4, 20(sp) - stw r5, 24(sp) - stw r6, 28(sp) - stw r7, 32(sp) - - rdctl r5, estatus - - stw r8, 36(sp) - stw r9, 40(sp) - stw r10, 44(sp) - stw r11, 48(sp) - stw r12, 52(sp) - stw r13, 56(sp) - stw r14, 60(sp) - stw r15, 64(sp) - - /* - * ea-4 contains the address of the instruction being executed - * when the exception occured. For interrupt exceptions, we will - * will be re-issue the isntruction. Store it in 72(sp) - */ - stw r5, 68(sp) /* estatus */ - addi r15, ea, -4 /* instruction that caused exception */ - stw r15, 72(sp) - - /* - * The interrupt testing code (.exceptions.irqtest) will be - * linked here. If the Internal Interrupt Controller (IIC) is - * present (an EIC is not present), the presense of an interrupt - * is determined by examining CPU control registers or an interrupt - * custom instruction, if present. - * - * If the IIC is used and an interrupt is active, the code linked - * here will call the HAL IRQ handler (alt_irq_handler()) which - * successively calls registered interrupt handler(s) until no - * interrupts remain pending. It then jumps to .exceptions.exit. If - * there is no interrupt then it continues to .exception.notirq, below. - */ - - .section .exceptions.notirq, "xa" - - /* - * Prepare to service unimplemtned instructions or traps, - * each of which is optionally inked into section .exceptions.soft, - * which will preceed .exceptions.unknown below. - * - * Unlike interrupts, we want to skip the exception-causing instructon - * upon completion, so we write ea (address of instruction *after* - * the one where the exception occured) into 72(sp). The actual - * instruction that caused the exception is written in r2, which these - * handlers will utilize. - */ - stw ea, 72(sp) /* Don't re-issue */ - ldw r2, -4(ea) /* Instruction that caused exception */ - - /* - * Other exception handling code, if enabled, will be linked here. - * This includes unimplemted (multiply/divide) instruction support - * (a BSP generaton option), and a trap handler (that would typically - * be augmented with user-specific code). These are not linked in by - * default. - */ - - /* - * In the context of linker sections, "unknown" are all exceptions - * not handled by the built-in handlers above (interupt, and trap or - * unimplemented instruction decoding, if enabled). - * - * Advanced exception types can be serviced by registering a handler. - * To do so, enable the "Enable Instruction-related Exception API" HAL - * BSP setting. If this setting is disabled, this handler code will - * either break (if the debug core is present) or enter an infinite - * loop because we don't how how to handle the exception. - */ - .section .exceptions.unknown -#ifdef ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API - /* - * The C-based HAL routine alt_instruction_exception_entry() will - * attempt to service the exception by calling a user-registered - * exception handler using alt_instruction_exception_register(). - * If no handler was registered it will either break (if the - * debugger is present) or go into an infinite loop since the - * handling behavior is undefined; in that case we will not return here. - */ - - /* Load exception-causing address as first argument (r4) */ - addi r4, ea, -4 - - /* Call the instruction-exception entry */ - call alt_instruction_exception_entry - - /* - * If alt_instruction_exception_entry() returned, the exception was - * serviced by a user-registered routine. Its return code (now in r2) - * indicates whether to re-issue or skip the exception-causing - * instruction - * - * Return code was 0: Skip. The instruction after the exception is - * already stored in 72(sp). - */ - bne r2, r0, .Lexception_exit - - /* - * Otherwise, modify 72(sp) to re-issue the instruction that caused the - * exception. - */ - addi r15, ea, -4 /* instruction that caused exception */ - stw r15, 72(sp) - -#else /* ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API disabled */ - - /* - * We got here because an instruction-related exception occured, but the - * handler API was not compiled in. We do not presume to know how to - * handle it. If the debugger is present, break, otherwise hang. - * - * If you get here then one of the following could have happened: - * - * - An instruction-generated exception occured, and the processor - * does not have the extra exceptions feature enabled, or you - * have not registered a handler using - * alt_instruction_exception_register() - * - * Some examples of instruction-generated exceptions and why they - * might occur: - * - * - Your program could have been compiled for a full-featured - * Nios II core, but it is running on a smaller core, and - * instruction emulation has been disabled by defining - * ALT_NO_INSTRUCTION_EMULATION. - * - * You can work around the problem by re-enabling instruction - * emulation, or you can figure out why your program is being - * compiled for a system other than the one that it is running on. - * - * - Your program has executed a trap instruction, but has not - * implemented a handler for this instruction. - * - * - Your program has executed an illegal instruction (one which is - * not defined in the instruction set). - * - * - Your processor includes an MMU or MPU, and you have enabled it - * before registering an exception handler to service exceptions it - * generates. - * - * The problem could also be hardware related: - * - If your hardware is broken and is generating spurious interrupts - * (a peripheral which negates its interrupt output before its - * interrupt handler has been executed will cause spurious - * interrupts) - */ -#ifdef NIOS2_HAS_DEBUG_STUB - /* - * Either tell the user now (if there is a debugger attached) or go into - * the debug monitor which will loop until a debugger is attached. - */ - break -#else - /* - * If there is no debug stub then a BREAK will probably cause a reboot. - * An infinate loop will probably be more useful. - */ -0: - br 0b -#endif /* NIOS2_HAS_DEBUG_STUB */ - -#endif /* ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API */ - - .section .exceptions.exit.label -.Lexception_exit: - - .section .exceptions.exit, "xa" - - /* - * Restore the saved registers, so that all general purpose registers - * have been restored to their state at the time the interrupt occured. - */ - - ldw r5, 68(sp) - ldw ea, 72(sp) /* This becomes the PC once eret is executed */ - ldw ra, 0(sp) - - wrctl estatus, r5 - - ldw r1, 8(sp) - ldw r2, 12(sp) - ldw r3, 16(sp) - ldw r4, 20(sp) - ldw r5, 24(sp) - ldw r6, 28(sp) - ldw r7, 32(sp) - -#ifdef ALT_EXCEPTION_STACK -#ifdef ALT_STACK_CHECK - ldw et, %gprel(alt_exception_old_stack_limit)(gp) -#endif -#endif - - ldw r8, 36(sp) - ldw r9, 40(sp) - ldw r10, 44(sp) - ldw r11, 48(sp) - ldw r12, 52(sp) - ldw r13, 56(sp) - ldw r14, 60(sp) - ldw r15, 64(sp) - -#ifdef ALT_EXCEPTION_STACK - -#ifdef ALT_STACK_CHECK - stw et, %gprel(alt_stack_limit_value)(gp) - stw zero, %gprel(alt_exception_old_stack_limit)(gp) -#endif - - ldw sp, 76(sp) - -#else - addi sp, sp, 76 - -#endif - - /* - * Return to the interrupted instruction. - */ - - eret - -#ifdef ALT_STACK_CHECK - -.Lstack_overflow: - break 3 - -#endif - diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_exception_muldiv.S b/software/qsys_tutorial_key3_bsp/HAL/src/alt_exception_muldiv.S deleted file mode 100644 index 55617a6..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_exception_muldiv.S +++ /dev/null @@ -1,583 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - - /* - * This is the software multiply/divide handler for Nios2. - */ - - /* - * Provide a label which can be used to pull this file in. - */ - - .section .exceptions.start - .globl alt_exception_muldiv -alt_exception_muldiv: - - /* - * Pull in the entry/exit code. - */ - .globl alt_exception - - - .section .exceptions.soft, "xa" - - - /* INSTRUCTION EMULATION - * --------------------- - * - * Nios II processors generate exceptions for unimplemented instructions. - * The routines below emulate these instructions. Depending on the - * processor core, the only instructions that might need to be emulated - * are div, divu, mul, muli, mulxss, mulxsu, and mulxuu. - * - * The emulations match the instructions, except for the following - * limitations: - * - * 1) The emulation routines do not emulate the use of the exception - * temporary register (et) as a source operand because the exception - * handler already has modified it. - * - * 2) The routines do not emulate the use of the stack pointer (sp) or the - * exception return address register (ea) as a destination because - * modifying these registers crashes the exception handler or the - * interrupted routine. - * - * 3) To save code size, the routines do not emulate the use of the - * breakpoint registers (ba and bt) as operands. - * - * Detailed Design - * --------------- - * - * The emulation routines expect the contents of integer registers r0-r31 - * to be on the stack at addresses sp, 4(sp), 8(sp), ... 124(sp). The - * routines retrieve source operands from the stack and modify the - * destination register's value on the stack prior to the end of the - * exception handler. Then all registers except the destination register - * are restored to their previous values. - * - * The instruction that causes the exception is found at address -4(ea). - * The instruction's OP and OPX fields identify the operation to be - * performed. - * - * One instruction, muli, is an I-type instruction that is identified by - * an OP field of 0x24. - * - * muli AAAAA,BBBBB,IIIIIIIIIIIIIIII,-0x24- - * 27 22 6 0 <-- LSB of field - * - * The remaining emulated instructions are R-type and have an OP field - * of 0x3a. Their OPX fields identify them. - * - * R-type AAAAA,BBBBB,CCCCC,XXXXXX,NNNNN,-0x3a- - * 27 22 17 11 6 0 <-- LSB of field - * - * - */ - - - /* - * Split the instruction into its fields. We need 4*A, 4*B, and 4*C as - * offsets to the stack pointer for access to the stored register values. - */ - /* r2 = AAAAA,BBBBB,IIIIIIIIIIIIIIII,PPPPPP */ - roli r3, r2, 7 /* r3 = BBB,IIIIIIIIIIIIIIII,PPPPPP,AAAAA,BB */ - roli r4, r3, 3 /* r4 = IIIIIIIIIIIIIIII,PPPPPP,AAAAA,BBBBB */ - roli r6, r4, 2 /* r6 = IIIIIIIIIIIIII,PPPPPP,AAAAA,BBBBB,II */ - srai r4, r4, 16 /* r4 = (sign-extended) IMM16 */ - xori r6, r6, 0x42 /* r6 = CCC,XXXXXX,NNNNN,PPPPPP,AAAAA,bBBBB,cC */ - roli r7, r6, 5 /* r7 = XXXX,NNNNN,PPPPPP,AAAAA,bBBBB,cCCCC,XX */ - andi r5, r2, 0x3f /* r5 = 00000000000000000000000000,PPPPPP */ - xori r3, r3, 0x40 - andi r3, r3, 0x7c /* r3 = 0000000000000000000000000,aAAAA,00 */ - andi r6, r6, 0x7c /* r6 = 0000000000000000000000000,bBBBB,00 */ - andi r7, r7, 0x7c /* r7 = 0000000000000000000000000,cCCCC,00 */ - - /* Now either - * r5 = OP - * r3 = 4*(A^16) - * r4 = IMM16 (sign extended) - * r6 = 4*(B^16) - * r7 = 4*(C^16) - * or - * r5 = OP - */ - - - /* - * Save everything on the stack to make it easy for the emulation routines - * to retrieve the source register operands. The exception entry code has - * already saved some of this so we don't need to do it all again. - */ - - addi sp, sp, -60 - stw zero, 64(sp) /* Save zero on stack to avoid special case for r0. */ - /* Register at and r2-r15 have already been saved. */ - - stw r16, 0(sp) - stw r17, 4(sp) - stw r18, 8(sp) - stw r19, 12(sp) - stw r20, 16(sp) - stw r21, 20(sp) - stw r22, 24(sp) - stw r23, 28(sp) - /* et @ 32 - Has already been changed.*/ - /* bt @ 36 - Usually isn't an operand. */ - stw gp, 40(sp) - stw sp, 44(sp) - stw fp, 48(sp) - /* ea @ 52 - Don't bother to save - it's already been changed */ - /* ba @ 56 - Breakpoint register usually isn't an operand */ - /* ra @ 60 - Has already been saved */ - - - /* - * Prepare for either multiplication or division loop. - * They both loop 32 times. - */ - movi r14, 32 - - - /* - * Get the operands. - * - * It is necessary to check for muli because it uses an I-type instruction - * format, while the other instructions are have an R-type format. - */ - add r3, r3, sp /* r3 = address of A-operand. */ - ldw r3, 0(r3) /* r3 = A-operand. */ - movi r15, 0x24 /* muli opcode (I-type instruction format) */ - beq r5, r15, .Lmul_immed /* muli doesn't use the B register as a source */ - - add r6, r6, sp /* r6 = address of B-operand. */ - ldw r6, 0(r6) /* r6 = B-operand. */ - /* r4 = SSSSSSSSSSSSSSSS,-----IMM16------ */ - /* IMM16 not needed, align OPX portion */ - /* r4 = SSSSSSSSSSSSSSSS,CCCCC,-OPX--,00000 */ - srli r4, r4, 5 /* r4 = 00000,SSSSSSSSSSSSSSSS,CCCCC,-OPX-- */ - andi r4, r4, 0x3f /* r4 = 00000000000000000000000000,-OPX-- */ - - /* Now - * r5 = OP - * r3 = src1 - * r6 = src2 - * r4 = OPX (no longer can be muli) - * r7 = 4*(C^16) - * r14 = loop counter - */ - - /* ILLEGAL-INSTRUCTION EXCEPTION - * ----------------------------- - * - * This code is for Nios II cores that generate exceptions when attempting - * to execute illegal instructions. Nios II cores that support an - * illegal-instruction exception are identified by the presence of the - * macro definition NIOS2_HAS_ILLEGAL_INSTRUCTION_EXCEPTION in system.h . - * - * Remember that illegal instructions are different than unimplemented - * instructions. Illegal instructions are instruction encodings that - * have not been defined by the Nios II ISA. Unimplemented instructions - * are legal instructions that must be emulated by some Nios II cores. - * - * If we get here, all instructions except multiplies and divides - * are illegal. - * - * This code assumes that OP is not muli (because muli was tested above). - * All other multiplies and divides are legal. Anything else is illegal. - */ - - movi r8, 0x3a /* OP for R-type mul* and div* */ - bne r5, r8, .Lnot_muldiv - - /* r15 already is 0x24 */ /* OPX of divu */ - beq r4, r15, .Ldivide - - movi r15,0x27 /* OPX of mul */ - beq r4, r15, .Lmultiply - - movi r15,0x07 /* OPX of mulxuu */ - beq r4, r15, .Lmultiply - - movi r15,0x17 /* OPX of mulxsu */ - beq r4, r15, .Lmultiply - - movi r15,0x1f /* OPX of mulxss */ - beq r4, r15, .Lmultiply - - movi r15,0x25 /* OPX of div */ - bne r4, r15, .Lnot_muldiv - - - /* DIVISION - * - * Divide an unsigned dividend by an unsigned divisor using - * a shift-and-subtract algorithm. The example below shows - * 43 div 7 = 6 for 8-bit integers. This classic algorithm uses a - * single register to store both the dividend and the quotient, - * allowing both values to be shifted with a single instruction. - * - * remainder dividend:quotient - * --------- ----------------- - * initialize 00000000 00101011: - * shift 00000000 0101011:_ - * remainder >= divisor? no 00000000 0101011:0 - * shift 00000000 101011:0_ - * remainder >= divisor? no 00000000 101011:00 - * shift 00000001 01011:00_ - * remainder >= divisor? no 00000001 01011:000 - * shift 00000010 1011:000_ - * remainder >= divisor? no 00000010 1011:0000 - * shift 00000101 011:0000_ - * remainder >= divisor? no 00000101 011:00000 - * shift 00001010 11:00000_ - * remainder >= divisor? yes 00001010 11:000001 - * remainder -= divisor - 00000111 - * ---------- - * 00000011 11:000001 - * shift 00000111 1:000001_ - * remainder >= divisor? yes 00000111 1:0000011 - * remainder -= divisor - 00000111 - * ---------- - * 00000000 1:0000011 - * shift 00000001 :0000011_ - * remainder >= divisor? no 00000001 :00000110 - * - * The quotient is 00000110. - */ - -.Ldivide: - /* - * Prepare for division by assuming the result - * is unsigned, and storing its "sign" as 0. - */ - movi r17, 0 - - - /* Which division opcode? */ - xori r15, r4, 0x25 /* OPX of div */ - bne r15, zero, .Lunsigned_division - - - /* - * OPX is div. Determine and store the sign of the quotient. - * Then take the absolute value of both operands. - */ - xor r17, r3, r6 /* MSB contains sign of quotient */ - bge r3, zero, 0f - sub r3, zero, r3 /* -r3 */ -0: - bge r6, zero, 0f - sub r6, zero, r6 /* -r6 */ -0: - - -.Lunsigned_division: - /* Initialize the unsigned-division loop. */ - movi r13, 0 /* remainder = 0 */ - - /* Now - * r3 = dividend : quotient - * r4 = 0x25 for div, 0x24 for divu - * r6 = divisor - * r13 = remainder - * r14 = loop counter (already initialized to 32) - * r17 = MSB contains sign of quotient - */ - - - /* - * for (count = 32; count > 0; --count) - * { - */ -.Ldivide_loop: - - /* - * Division: - * - * (remainder:dividend:quotient) <<= 1; - */ - slli r13, r13, 1 - cmplt r15, r3, zero /* r15 = MSB of r3 */ - or r13, r13, r15 - slli r3, r3, 1 - - - /* - * if (remainder >= divisor) - * { - * set LSB of quotient - * remainder -= divisor; - * } - */ - bltu r13, r6, .Ldiv_skip - ori r3, r3, 1 - sub r13, r13, r6 -.Ldiv_skip: - - /* - * } - */ - subi r14, r14, 1 - bne r14, zero, .Ldivide_loop - - mov r9, r3 - - - /* Now - * r9 = quotient - * r4 = 0x25 for div, 0x24 for divu - * r7 = 4*(C^16) - * r17 = MSB contains sign of quotient - */ - - - /* - * Conditionally negate signed quotient. If quotient is unsigned, - * the sign already is initialized to 0. - */ - bge r17, zero, .Lstore_result - sub r9, zero, r9 /* -r9 */ - - br .Lstore_result - - - - - /* MULTIPLICATION - * - * A "product" is the number that one gets by summing a "multiplicand" - * several times. The "multiplier" specifies the number of copies of the - * multiplicand that are summed. - * - * Actual multiplication algorithms don't use repeated addition, however. - * Shift-and-add algorithms get the same answer as repeated addition, and - * they are faster. To compute the lower half of a product (pppp below) - * one shifts the product left before adding in each of the partial products - * (a * mmmm) through (d * mmmm). - * - * To compute the upper half of a product (PPPP below), one adds in the - * partial products (d * mmmm) through (a * mmmm), each time following the - * add by a right shift of the product. - * - * mmmm - * * abcd - * ------ - * #### = d * mmmm - * #### = c * mmmm - * #### = b * mmmm - * #### = a * mmmm - * -------- - * PPPPpppp - * - * The example above shows 4 partial products. Computing actual Nios II - * products requires 32 partials. - * - * It is possible to compute the result of mulxsu from the result of mulxuu - * because the only difference between the results of these two opcodes is - * the value of the partial product associated with the sign bit of rA. - * - * mulxsu = mulxuu - ((rA < 0) ? rB : 0); - * - * It is possible to compute the result of mulxss from the result of mulxsu - * because the only difference between the results of these two opcodes is - * the value of the partial product associated with the sign bit of rB. - * - * mulxss = mulxsu - ((rB < 0) ? rA : 0); - * - */ - -.Lmul_immed: - /* Opcode is muli. Change it into mul for remainder of algorithm. */ - mov r7, r6 /* Field B is dest register, not field C. */ - mov r6, r4 /* Field IMM16 is src2, not field B. */ - movi r4, 0x27 /* OPX of mul is 0x27 */ - -.Lmultiply: - /* Initialize the multiplication loop. */ - movi r9, 0 /* mul_product = 0 */ - movi r10, 0 /* mulxuu_product = 0 */ - mov r11, r6 /* save original multiplier for mulxsu and mulxss */ - mov r12, r6 /* mulxuu_multiplier (will be shifted) */ - movi r16, 1 /* used to create "rori B,A,1" from "ror B,A,r16" */ - - /* Now - * r3 = multiplicand - * r6 = mul_multiplier - * r7 = 4 * dest_register (used later as offset to sp) - * r9 = mul_product - * r10 = mulxuu_product - * r11 = original multiplier - * r12 = mulxuu_multiplier - * r14 = loop counter (already initialized) - * r15 = temp - * r16 = 1 - */ - - - /* - * for (count = 32; count > 0; --count) - * { - */ -.Lmultiply_loop: - - /* - * mul_product <<= 1; - * lsb = multiplier & 1; - */ - slli r9, r9, 1 - andi r15, r12, 1 - - /* - * if (lsb == 1) - * { - * mulxuu_product += multiplicand; - * } - */ - beq r15, zero, .Lmulx_skip - add r10, r10, r3 - cmpltu r15, r10, r3 /* Save the carry from the MSB of mulxuu_product. */ - ror r15, r15, r16 /* r15 = 0x80000000 on carry, or else 0x00000000 */ -.Lmulx_skip: - - /* - * if (MSB of mul_multiplier == 1) - * { - * mul_product += multiplicand; - * } - */ - bge r6, zero, .Lmul_skip - add r9, r9, r3 -.Lmul_skip: - - /* - * mulxuu_product >>= 1; logical shift - * mul_multiplier <<= 1; done with MSB - * mulx_multiplier >>= 1; done with LSB - */ - srli r10, r10, 1 - or r10, r10, r15 /* OR in the saved carry bit. */ - slli r6, r6, 1 - srli r12, r12, 1 - - - /* - * } - */ - subi r14, r14, 1 - bne r14, zero, .Lmultiply_loop - - - /* - * Multiply emulation loop done. - */ - - /* Now - * r3 = multiplicand - * r4 = OPX - * r7 = 4 * dest_register (used later as offset to sp) - * r9 = mul_product - * r10 = mulxuu_product - * r11 = original multiplier - * r15 = temp - */ - - - /* - * Select/compute the result based on OPX. - */ - - - /* OPX == mul? Then store. */ - xori r15, r4, 0x27 - beq r15, zero, .Lstore_result - - /* It's one of the mulx.. opcodes. Move over the result. */ - mov r9, r10 - - /* OPX == mulxuu? Then store. */ - xori r15, r4, 0x07 - beq r15, zero, .Lstore_result - - /* Compute mulxsu - * - * mulxsu = mulxuu - ((rA < 0) ? rB : 0); - */ - bge r3, zero, .Lmulxsu_skip - sub r9, r9, r11 -.Lmulxsu_skip: - - /* OPX == mulxsu? Then store. */ - xori r15, r4, 0x17 - beq r15, zero, .Lstore_result - - /* Compute mulxss - * - * mulxss = mulxsu - ((rB < 0) ? rA : 0); - */ - bge r11, zero, .Lmulxss_skip - sub r9, r9, r3 -.Lmulxss_skip: - /* At this point, assume that OPX is mulxss, so store */ - - -.Lstore_result: - add r7, r7, sp - stw r9, 0(r7) - - ldw r16, 0(sp) - ldw r17, 4(sp) - ldw r18, 8(sp) - ldw r19, 12(sp) - ldw r20, 16(sp) - ldw r21, 20(sp) - ldw r22, 24(sp) - ldw r23, 28(sp) - - /* bt @ 32 - Breakpoint register usually isn't an operand. */ - /* et @ 36 - Don't corrupt et. */ - /* gp @ 40 - Don't corrupt gp. */ - /* sp @ 44 - Don't corrupt sp. */ - ldw fp, 48(sp) - /* ea @ 52 - Don't corrupt ea. */ - /* ba @ 56 - Breakpoint register usually isn't an operand. */ - - addi sp, sp, 60 - - br .Lexception_exit - - -.Lnot_muldiv: - - addi sp, sp, 60 - - - .section .exceptions.exit.label -.Lexception_exit: - diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_exception_trap.S b/software/qsys_tutorial_key3_bsp/HAL/src/alt_exception_trap.S deleted file mode 100644 index 60a3d40..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_exception_trap.S +++ /dev/null @@ -1,81 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - - /* - * This is the trap exception handler for Nios2. - */ - - /* - * Provide a label which can be used to pull this file in. - */ - - .section .exceptions.start - .globl alt_exception_trap -alt_exception_trap: - - /* - * Pull in the entry/exit code. - */ - .globl alt_exception - - .section .exceptions.soft, "xa" - -.Ltrap_handler: - - /* - * Did a trap instruction cause the exception? - * - * The instruction which the exception occurred on has been loaded - * into r2 by code in alt_exception_entry.S - * - */ - - movhi r3,0x003b /* upper half of trap opcode */ - ori r3,r3,0x683a /* lower half of trap opcode */ - bne r2,r3,.Lnot_trap - - /* - * There is no trap handler defined here, and so executing a trap - * instruction causes a software break. If you provide a trap handler, - * then you must replace the break instruction below with your handler. - * Your handler must preserve ea and the usual callee saved registers. - */ - - break - - br .Lexception_exit - -.Lnot_trap: - - - .section .exceptions.exit.label -.Lexception_exit: - - diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_execve.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_execve.c deleted file mode 100644 index 27b99cf..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_execve.c +++ /dev/null @@ -1,55 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "os/alt_syscall.h" - -/* - * execve() is used by newlib to launch new processes. This is unsupported in - * the HAL environment. However a "do-nothing" implementation is still - * provied for newlib compatability. - * - * ALT_EXECVE is mapped onto the execve() system call in alt_syscall.h - */ - -int ALT_EXECVE (char *name, char ** argv, char** env) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(execve); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_exit.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_exit.c deleted file mode 100644 index 971b35e..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_exit.c +++ /dev/null @@ -1,71 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_irq.h" -#include "sys/alt_sim.h" -#include "os/alt_hooks.h" -#include "os/alt_syscall.h" - -#include "alt_types.h" -#include "sys/alt_log_printf.h" -/* - * _exit() is called by exit() in order to terminate the current process. - * Typically this is called when main() completes. It should never return. - * Since there is nowhere to go once this process completes, this - * implementation simply blocks forever. - * - * Note that interrupts are not disabled so that execution outside of this - * thread is allowed to continue. - * - * ALT_EXIT is mapped onto the _exit() system call in alt_syscall.h - */ - -void ALT_EXIT (int exit_code) -{ - /* ALT_LOG - please see HAL/inc/alt_log_printf.h for details */ - ALT_LOG_PRINT_BOOT("[alt_exit.c] Entering _exit() function.\r\n"); - ALT_LOG_PRINT_BOOT("[alt_exit.c] Exit code from main was %d.\r\n",exit_code); - /* Stop all other threads */ - - ALT_LOG_PRINT_BOOT("[alt_exit.c] Calling ALT_OS_STOP().\r\n"); - ALT_OS_STOP(); - - /* Provide notification to the simulator that we've stopped */ - - ALT_LOG_PRINT_BOOT("[alt_exit.c] Calling ALT_SIM_HALT().\r\n"); - ALT_SIM_HALT(exit_code); - - /* spin forever, since there's no where to go back to */ - - ALT_LOG_PRINT_BOOT("[alt_exit.c] Spinning forever.\r\n"); - while (1); -} diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_fcntl.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_fcntl.c deleted file mode 100644 index 69c1544..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_fcntl.c +++ /dev/null @@ -1,101 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include -#include - -#include "sys/alt_errno.h" -#include "priv/alt_file.h" -#include "alt_types.h" -#include "os/alt_syscall.h" - -#define ALT_FCNTL_FLAGS_MASK ((alt_u32) (O_APPEND | O_NONBLOCK)) - -/* - * fcntl() is a limited implementation of the standard fcntl() system call. - * It can be used to change the state of the flags associated with an open - * file descriptor. Normally these flags are set during the call to - * open(). It is anticipated that the main use of this function will be to - * change the state of a device from blocking to non-blocking (where this is - * supported). - * - * The input argument "fd" is the file descriptor to be manipulated. "cmd" - * is the command to execute. This can be either F_GETFL (return the - * current value of the flags) or F_SETFL (set the value of the flags). - * - * If "cmd" is F_SETFL then the argument "arg" is the new value of flags, - * otherwise "arg" is ignored. Only the flags: O_APPEND and O_NONBLOCK - * can be updated by a call to fcntl(). All other flags remain - * unchanged. - * - * ALT_FCNTL is mapped onto the fcntl() system call in alt_syscall.h - */ - -int ALT_FCNTL (int file, int cmd, ...) -{ - alt_fd* fd; - long flags; - va_list argp; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - switch (cmd) - { - case F_GETFL: - return fd->fd_flags & ~((alt_u32) ALT_FD_FLAGS_MASK); - case F_SETFL: - va_start(argp, cmd); - flags = va_arg(argp, long); - fd->fd_flags &= ~ALT_FCNTL_FLAGS_MASK; - fd->fd_flags |= (flags & ALT_FCNTL_FLAGS_MASK); - va_end(argp); - return 0; - default: - ALT_ERRNO = EINVAL; - return -1; - } - } - - ALT_ERRNO = EBADFD; - return -1; -} diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_fd_lock.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_fd_lock.c deleted file mode 100644 index 0e2a85d..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_fd_lock.c +++ /dev/null @@ -1,75 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "priv/alt_file.h" - -/* - * alt_fd_lock() is called as a consequence of an ioctl call to gain exclusive - * access to a device, i.e.: - * - * ioctl (fd, TIOCEXCL, NULL); - * - * If there are no other open file descriptors which reference the same - * device, then alt_fd_lock() will grant the lock. Further calls to open() - * for this device will fail until the lock is released. - * - * This is done by calling close() for this file descriptor, or by calling: - * - * ioctl (fd, TIOCNXCL, NULL); - * - * The return value is zero for success, or negative in the case of failure. - */ - -int alt_fd_lock (alt_fd* fd) -{ - int i; - int rc = 0; - - ALT_SEM_PEND(alt_fd_list_lock, 0); - - for (i = 0; i < alt_max_fd; i++) - { - if ((&alt_fd_list[i] != fd) && (alt_fd_list[i].dev == fd->dev)) - { - rc = -EACCES; - goto alt_fd_lock_exit; - } - } - fd->fd_flags |= ALT_FD_EXCL; - - alt_fd_lock_exit: - - ALT_SEM_POST(alt_fd_list_lock); - return rc; -} diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_fd_unlock.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_fd_unlock.c deleted file mode 100644 index fb700dc..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_fd_unlock.c +++ /dev/null @@ -1,56 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "priv/alt_file.h" - -/* - * alt_fd_unlock() is the inverse of alt_fd_lock(). It is called as a - * consequence of a TIOCNXCL ioctl request, e.g: - * - * ioctl (fd, TIOCNXCL, NULL); - * - * It enables multiple file descriptors to exist for the same device. This - * is normally the case, but it may have been disabled by a previous call to - * alt_fd_lock(). - * - * Return zero on sucess, and a negative value on failure. - * - * The current implementation always succeeds. - */ - -int alt_fd_unlock (alt_fd* fd) -{ - fd->fd_flags &= ~ALT_FD_EXCL; - return 0; -} diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_find_dev.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_find_dev.c deleted file mode 100644 index 37aefa4..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_find_dev.c +++ /dev/null @@ -1,88 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - -#include "alt_types.h" - -/* - * alt_find_dev() is used by open() in order to locate a previously registered - * device with the name "name". The input argument "llist" is a pointer to the - * head of the device list to search. - * - * The return value is a pointer to the matching device, or NULL if there is - * no match. - * - * "name" must be an exact match for the devices registered name for a match to - * be found. - */ - -alt_dev* alt_find_dev(const char* name, alt_llist* llist) -{ - alt_dev* next = (alt_dev*) llist->next; - alt_32 len; - - len = strlen(name) + 1; - - /* - * Check each list entry in turn, until a match is found, or we reach the - * end of the list (i.e. next winds up pointing back to the list head). - */ - - while (next != (alt_dev*) llist) - { - - /* - * memcmp() is used here rather than strcmp() in order to reduce the size - * of the executable. - */ - - if (!memcmp (next->name, name, len)) - { - /* match found */ - - return next; - } - next = (alt_dev*) next->llist.next; - } - - /* No match found */ - - return NULL; -} - - diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_find_file.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_find_file.c deleted file mode 100644 index 2d97ec2..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_find_file.c +++ /dev/null @@ -1,89 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - -#include "alt_types.h" - -/* - * alt_find_file() is used by open() in order to locate a previously registered - * filesystem that owns that mount point that contains the file named "name". - * - * The return value is a pointer to the matching filesystem, or NULL if there is - * no match. - * - * A match is considered to have been found if the filesystem name followed by - * either '/' or '\0' is the prefix of the filename. For example the filename: - * "/myfilesystem/junk.txt" would match: "/myfilesystem", but not: "/myfile". - */ - -alt_dev* alt_find_file (const char* name) -{ - alt_dev* next = (alt_dev*) alt_fs_list.next; - - alt_32 len; - - /* - * Check each list entry in turn, until a match is found, or we reach the - * end of the list (i.e. next winds up pointing back to the list head). - */ - - while (next != (alt_dev*) &alt_fs_list) - { - len = strlen(next->name); - - if (next->name[len-1] == '/') - { - len -= 1; - } - - if (((name[len] == '/') || (name[len] == '\0')) && - !memcmp (next->name, name, len)) - { - /* match found */ - - return next; - } - next = (alt_dev*) next->llist.next; - } - - /* No match found */ - - return NULL; -} - - diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_flash_dev.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_flash_dev.c deleted file mode 100644 index 213f721..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_flash_dev.c +++ /dev/null @@ -1,69 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* Alt_flash.c - Functions to register a flash device to the "generic" flash * -* interface * -* * -* Author PRR * -* * -******************************************************************************/ - -#include -#include "sys/alt_llist.h" -#include "sys/alt_flash_dev.h" -#include "priv/alt_file.h" - -ALT_LLIST_HEAD(alt_flash_dev_list); - -alt_flash_fd* alt_flash_open_dev(const char* name) -{ - alt_flash_dev* dev = (alt_flash_dev*)alt_find_dev(name, &alt_flash_dev_list); - - if ((dev) && dev->open) - { - return dev->open(dev, name); - } - - return dev; -} - -void alt_flash_close_dev(alt_flash_fd* fd) -{ - if (fd && fd->close) - { - fd->close(fd); - } - return; -} - diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_fork.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_fork.c deleted file mode 100644 index ce74df0..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_fork.c +++ /dev/null @@ -1,57 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_warning.h" -#include "sys/alt_errno.h" -#include "os/alt_syscall.h" - -/* - * The fork() system call is used by newlib to create a duplicate copy of the - * curent process. This is unsupported in the HAL environment. However a - * "do-nothing" implementation is still provied for newlib compatability. - * - * ALT_FORK is mapped onto the fork() system call in alt_syscall.h - */ - -int ALT_FORK (void) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(fork); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} - - diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_fs_reg.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_fs_reg.c deleted file mode 100644 index 13437a1..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_fs_reg.c +++ /dev/null @@ -1,75 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - -/* - * The alt_fs_reg() function is used to register a file system. Once registered - * a device can be accessed using the standard posix calls: open(), read(), - * write() etc. - * - * System behaviour is undefined in the event that a file system is registered - * with a name that conflicts with an existing device or file system. - * - * alt_fs_reg() is not thread safe in the sense that there should be no other - * thread using the file system list at the time that alt_dev_reg() is called. In - * practice this means that alt_fs_reg() should only be called while operating - * in a single threaded mode. The expectation is that it will only be called - * by the file system initilisation functions invoked by alt_sys_init(), which in - * turn should only be called by the single threaded C startup code. - * - * A return value of zero indicates success. A negative return value indicates - * failure. - */ - -int alt_fs_reg (alt_dev* dev) -{ - /* - * check that the device has a name. - */ - - if (!dev->name) - { - return -ENODEV; - } - - /* - * register the file system. - */ - - alt_llist_insert(&alt_fs_list, &dev->llist); - - return 0; -} diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_fstat.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_fstat.c deleted file mode 100644 index af5d527..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_fstat.c +++ /dev/null @@ -1,128 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include "sys/alt_dev.h" -#include "sys/alt_warning.h" -#include "sys/alt_errno.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -/* - * The fstat() system call is used to obtain information about the capabilities - * of an open file descriptor. By default file descriptors are marked as - * being character devices. If a device or file system wishes to advertise - * alternative capabilities then they can register an fstat() function within - * their associated alt_dev structure. This will be called to fill in the - * entries in the imput "st" structure. - * - * This function is provided for compatability with newlib. - * - * ALT_FSTAT is mapped onto the fstat() system call in alt_syscall.h - */ - -#ifdef ALT_USE_DIRECT_DRIVERS - -#include "system.h" - -/* - * Provide minimal version that just describes all file descriptors - * as character devices for provided stdio devices. - */ -int ALT_FSTAT (int file, struct stat *st) -{ - switch (file) { -#ifdef ALT_STDIN_PRESENT - case 0: /* stdin file descriptor */ -#endif /* ALT_STDIN_PRESENT */ -#ifdef ALT_STDOUT_PRESENT - case 1: /* stdout file descriptor */ -#endif /* ALT_STDOUT_PRESENT */ -#ifdef ALT_STDERR_PRESENT - case 2: /* stderr file descriptor */ -#endif /* ALT_STDERR_PRESENT */ - st->st_mode = _IFCHR; - return 0; - default: - return -1; - } - -#if !defined(ALT_STDIN_PRESENT) && !defined(ALT_STDOUT_PRESENT) && !defined(ALT_STDERR_PRESENT) - /* Generate a link time warning, should this function ever be called. */ - ALT_STUB_WARNING(fstat); -#endif -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -int ALT_FSTAT (int file, struct stat *st) -{ - alt_fd* fd; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - /* Call the drivers fstat() function to fill out the "st" structure. */ - - if (fd->dev->fstat) - { - return fd->dev->fstat(fd, st); - } - - /* - * If no function is provided, mark the fd as belonging to a character - * device. - */ - - else - { - st->st_mode = _IFCHR; - return 0; - } - } - else - { - ALT_ERRNO = EBADFD; - return -1; - } -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_get_fd.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_get_fd.c deleted file mode 100644 index db17b2c..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_get_fd.c +++ /dev/null @@ -1,105 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - -#include "alt_types.h" - -#include "system.h" - -/* - * alt_get_fd() is called to allocate a new file descriptor from the file - * descriptor pool. If a file descriptor is succesfully allocated, it is - * configured to refer to device "dev". - * - * The return value is the index of the file descriptor structure (i.e. - * the offset of the file descriptor within the file descriptor array). A - * negative value indicates failure. - */ - -int alt_get_fd (alt_dev* dev) -{ - alt_32 i; - int rc = -EMFILE; - - /* - * Take the alt_fd_list_lock semaphore in order to avoid races when - * accessing the file descriptor pool. - */ - - ALT_SEM_PEND(alt_fd_list_lock, 0); - - /* - * Search through the list of file descriptors, and allocate the first - * free descriptor that's found. - * - * If a free descriptor is found, then the value of "alt_max_fd" is - * updated accordingly. "alt_max_fd" is a 'highwater mark' which - * indicates the highest file descriptor ever allocated. This is used to - * improve efficency when searching the file descriptor list, and - * therefore reduce contention on the alt_fd_list_lock semaphore. - */ - - for (i = 0; i < ALT_MAX_FD; i++) - { - if (!alt_fd_list[i].dev) - { - alt_fd_list[i].dev = dev; - if (i > alt_max_fd) - { - alt_max_fd = i; - } - rc = i; - goto alt_get_fd_exit; - } - } - - alt_get_fd_exit: - - /* - * Release the alt_fd_list_lock semaphore now that we are done with the - * file descriptor pool. - */ - - ALT_SEM_POST(alt_fd_list_lock); - - return rc; -} - - - - diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_getchar.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_getchar.c deleted file mode 100644 index a8f50d5..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_getchar.c +++ /dev/null @@ -1,61 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#ifdef ALT_USE_DIRECT_DRIVERS -#include "system.h" -#include "sys/alt_driver.h" -#include "sys/alt_stdio.h" -#include "priv/alt_file.h" -#include "unistd.h" -#endif - -/* - * Uses the ALT_DRIVER_READ() macro to call directly to driver if available. - * Otherwise, uses newlib provided getchar() routine. - */ -int -alt_getchar(void) -{ -#ifdef ALT_USE_DIRECT_DRIVERS - ALT_DRIVER_READ_EXTERNS(ALT_STDIN_DEV); - char c; - - if (ALT_DRIVER_READ(ALT_STDIN_DEV, &c, 1, alt_fd_list[STDIN_FILENO].fd_flags) <= 0) { - return -1; - } - return c; -#else - return getchar(); -#endif -} diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_getpid.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_getpid.c deleted file mode 100644 index 2228c7e..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_getpid.c +++ /dev/null @@ -1,47 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "os/alt_syscall.h" - -/* - * The getpid() system call is used by newlib to obtain the current process - * id. Since there is only ever a single process in the HAL environment, - * this just returns a constant. - * - * ALT_GETPID is mapped onto the getpid() system call in alt_syscall.h - */ - -int ALT_GETPID (void) -{ - return 0; -} - diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_gettod.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_gettod.c deleted file mode 100644 index ed86cba..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_gettod.c +++ /dev/null @@ -1,125 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include - -#include "sys/alt_alarm.h" -#include "alt_types.h" -#include "os/alt_syscall.h" - -/* - * Macro defining the number of micoseconds in a second. - */ - -#define ALT_US (1000000) - -/* - * "alt_timezone" and "alt_resettime" are the values of the the reset time and - * time zone set through the last call to settimeofday(). By default they are - * zero initialised. - */ - -struct timezone alt_timezone = {0, 0}; -struct timeval alt_resettime = {0, 0}; - -/* - * gettimeofday() can be called to obtain a time structure which indicates the - * current "wall clock" time. This is calculated using the elapsed number of - * system clock ticks, and the value of "alt_resettime" and "alt_timezone" set - * through the last call to settimeofday(). - * - * Warning: if this function is called concurrently with a call to - * settimeofday(), the value returned by gettimeofday() will be unreliable. - * - * ALT_GETTIMEOFDAY is mapped onto the gettimeofday() system call in - * alt_syscall.h - */ - - -#if defined (__GNUC__) && (__GNUC__ >= 4) -int ALT_GETTIMEOFDAY (struct timeval *ptimeval, void *ptimezone_vptr) -{ - struct timezone *ptimezone = (struct timezone*)ptimezone_vptr; -#else -int ALT_GETTIMEOFDAY (struct timeval *ptimeval, struct timezone *ptimezone) -{ -#endif - - alt_u32 nticks = alt_nticks (); - alt_u32 tick_rate = alt_ticks_per_second (); - - /* - * Check to see if the system clock is running. This is indicated by a - * non-zero system clock rate. If the system clock is not running, an error - * is generated and the contents of "ptimeval" and "ptimezone" are not - * updated. - */ - - if (tick_rate) - { - ptimeval->tv_sec = alt_resettime.tv_sec + nticks/tick_rate; - ptimeval->tv_usec = alt_resettime.tv_usec + - (alt_u32)(((alt_u64)nticks*(ALT_US/tick_rate))%ALT_US); - - while(ptimeval->tv_usec < 0) { - if (ptimeval->tv_sec <= 0) - { - ptimeval->tv_sec = 0; - ptimeval->tv_usec = 0; - break; - } - else - { - ptimeval->tv_sec--; - ptimeval->tv_usec += ALT_US; - } - } - - while(ptimeval->tv_usec >= ALT_US) { - ptimeval->tv_sec++; - ptimeval->tv_usec -= ALT_US; - } - - if (ptimezone) - { - ptimezone->tz_minuteswest = alt_timezone.tz_minuteswest; - ptimezone->tz_dsttime = alt_timezone.tz_dsttime; - } - - return 0; - } - - return -ENOTSUP; -} - diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_gmon.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_gmon.c deleted file mode 100644 index 6add9f1..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_gmon.c +++ /dev/null @@ -1,272 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include -#include -#include - -#include "priv/nios2_gmon_data.h" - -#include "sys/alt_irq.h" -#include "sys/alt_alarm.h" - - -/* Macros */ - -/* How large should the bins be which we use to generate the histogram */ -#define PCSAMPLE_BYTES_PER_BUCKET 32 - -#define NIOS2_READ_EA(dest) __asm__ ("mov %0, ea" : "=r" (dest)) - -/* The compiler inserts calls to mcount() at the start of - * every function call. The structure mcount_fn_arc records t - * he return address of the function called (in from_pc) - * and the return address of the mcount function - * (in self_pc). The number of times this arc is executed is - * recorded in the field count. - */ -struct mcount_fn_arc -{ - struct mcount_fn_arc * next; - void * from_pc; - unsigned int count; -}; - -/* We need to maintain a list of pointers to the heads of each adjacency - * list so that we can find them when writing out the gmon.out file. Since - * we don't know at the start of program execution how many functions will - * be called we use a list structure to do this. - */ -struct mcount_fn_entry -{ - struct mcount_fn_entry * next; - void * self_pc; - struct mcount_fn_arc * arc_head; -}; - -/* function prototypes */ - -void __mcount_record(void * self_pc, void * from_pc, struct mcount_fn_entry * fn_entry, struct mcount_fn_entry * * fn_head) __attribute__ ((no_instrument_function)); - -static __inline__ void * mcount_allocate(unsigned int size) __attribute__ ((no_instrument_function)); -static int nios2_pcsample_init(void) __attribute__ ((no_instrument_function)); -static alt_u32 nios2_pcsample(void* alarm) __attribute__ ((no_instrument_function)); - -/* global variables */ - -/* stext and etext are defined in the linker script */ -extern char stext[]; -extern char etext[]; - -/* Is the PC sampling stuff enabled yet? */ -static int pcsample_need_init = 1; - -#define HASH_BUCKETS 64 /* Must be a power of 2 */ - -/* This points to the list of adjacency list pointers. */ -struct mcount_fn_entry * __mcount_fn_head[HASH_BUCKETS]; - -/* pointer to the in-memory buffer containing the histogram */ -static unsigned short* s_pcsamples = 0; - -/* the address of the start and end of text section */ -static const unsigned int s_low_pc = (unsigned int)stext; -static const unsigned int s_high_pc = (unsigned int)etext; - -/* the alarm structure to register for pc sampling */ -static alt_alarm s_nios2_pcsample_alarm; - -unsigned int alt_gmon_data[GMON_DATA_SIZE] = -{ - 0x6e6f6d67, /* "gmon" */ - GMON_DATA_SIZE, - 0, - (unsigned int)stext, - (unsigned int)etext, - PCSAMPLE_BYTES_PER_BUCKET, - 0, - (unsigned int)__mcount_fn_head, - (unsigned int)(__mcount_fn_head + HASH_BUCKETS) -}; - -/* This holds the current slab of memory we're allocating out of */ -static char * mcount_slab_ptr = 0; -static int mcount_slab_size = 0; - -#define MCOUNT_SLAB_INCREMENT 1020 - - -/* - * We can't use malloc to allocate memory because that's too complicated, and - * can't be called at interrupt time. Use the lower level allocator instead - * because that's interrupt safe (and because we never free anything). - * - * For speed, we allocate a block of data at once. - */ -static __inline__ void * mcount_allocate(unsigned int size) -{ - void * data; - - if (size > mcount_slab_size) - { - mcount_slab_ptr = sbrk(MCOUNT_SLAB_INCREMENT); - mcount_slab_size = MCOUNT_SLAB_INCREMENT; - } - - data = mcount_slab_ptr; - mcount_slab_ptr += size; - mcount_slab_size -= size; - - return data; -} - - -/* - * Add the arc with the values of frompc and topc given to the graph. - * This function might be called at interrupt time so must be able to - * cope with reentrancy. - * - * The fast case, where we have already allocated a function arc, has been - * handled by the assmebler code. - */ -void __mcount_record(void * self_pc, void * from_pc, struct mcount_fn_entry * fn_entry, struct mcount_fn_entry * * fn_head) -{ - alt_irq_context context; - struct mcount_fn_arc * arc_entry; - - /* Keep trying to start up the PC sampler until it is running. - * (It can't start until the timer is going). - */ - if (pcsample_need_init) - { - pcsample_need_init = 0; - pcsample_need_init = nios2_pcsample_init(); - } - - /* - * We must disable interrupts around the allocation and the list update to - * prevent corruption if the instrumented function is re-entrant. - * - * It's safe for the code above to be stepping through the chain and be - * interrupted by this code modifying it - there is an edge case which will - * leave two copies of the same arc on the list (both with count=1), but - * this is dealt with on the host. - */ - context = alt_irq_disable_all(); - - if (fn_entry == NULL) - { - /* Add it to the list of functions we must output later. */ - fn_entry = (struct mcount_fn_entry *)mcount_allocate(sizeof(struct mcount_fn_entry)); - - fn_entry->self_pc = self_pc; - fn_entry->arc_head = NULL; - - fn_entry->next = *fn_head; - *fn_head = fn_entry; - } - - /* We will need a new list entry - if there was a list entry before - * then the assembler code would have handled it. */ - arc_entry = (struct mcount_fn_arc *)mcount_allocate(sizeof(struct mcount_fn_arc)); - - arc_entry->from_pc = from_pc; - arc_entry->count = 1; - - arc_entry->next = fn_entry->arc_head; - fn_entry->arc_head = arc_entry; - - alt_irq_enable_all(context); -} - - -/* - * nios2_pcsample_init starts profiling. - * It is called the first time mcount is called, and on subsequent calls to - * mcount until it returns zero. It initializes the pc histogram and turns on - * timer driven pc sampling. - */ -static int nios2_pcsample_init(void) -{ - unsigned int pcsamples_size; - - /* We sample the PC every tick */ - unsigned int prof_rate = alt_ticks_per_second(); - if (prof_rate == 0) - return 1; - - /* allocate the histogram buffer s_pcsamples */ - pcsamples_size = (s_high_pc - s_low_pc)/PCSAMPLE_BYTES_PER_BUCKET; - s_pcsamples = (unsigned short*)sbrk(pcsamples_size * sizeof(unsigned short)); - - if (s_pcsamples != 0) - { - /* initialize the buffer to zero */ - memset(s_pcsamples, 0, pcsamples_size * sizeof(unsigned short)); - - alt_gmon_data[GMON_DATA_PROFILE_DATA] = (int)s_pcsamples; - alt_gmon_data[GMON_DATA_PROFILE_RATE] = prof_rate; - - /* Sample every tick (it's cheap) */ - alt_alarm_start(&s_nios2_pcsample_alarm, 1, nios2_pcsample, 0); - } - - return 0; -} - - -/* - * Sample the PC value and store it in the histogram - */ -static alt_u32 nios2_pcsample(void* context) -{ - unsigned int pc; - unsigned int bucket; - - /* read the exception return address - this will be - * inaccurate if there are nested interrupts but we - * assume that this is rare and the inaccuracy will - * not be great */ - NIOS2_READ_EA(pc); - - /* - * If we're within the profilable range then increment the relevant - * bucket in the histogram - */ - if (pc >= s_low_pc && pc < s_high_pc && s_pcsamples != 0) - { - bucket = (pc - s_low_pc)/PCSAMPLE_BYTES_PER_BUCKET; - s_pcsamples[bucket]++; - } - - /* Sample every tick */ - return 1; -} - diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_icache_flush.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_icache_flush.c deleted file mode 100644 index 4b706ed..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_icache_flush.c +++ /dev/null @@ -1,84 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "nios2.h" -#include "system.h" - -#include "alt_types.h" -#include "sys/alt_cache.h" - -/* - * alt_icache_flush() is called to flush the instruction cache for a memory - * region of length "len" bytes, starting at address "start". - */ - -void alt_icache_flush (void* start, alt_u32 len) -{ -#if NIOS2_ICACHE_SIZE > 0 - - char* i; - char* end; - - /* - * This is the most we would ever need to flush. - */ - - if (len > NIOS2_ICACHE_SIZE) - { - len = NIOS2_ICACHE_SIZE; - } - - end = ((char*) start) + len; - - for (i = start; i < end; i+= NIOS2_ICACHE_LINE_SIZE) - { - __asm__ volatile ("flushi %0" :: "r" (i)); - } - - /* - * For an unaligned flush request, we've got one more line left. - * Note that this is dependent on NIOS2_ICACHE_LINE_SIZE to be a - * multiple of 2 (which it always is). - */ - - if (((alt_u32) start) & (NIOS2_ICACHE_LINE_SIZE - 1)) - { - __asm__ volatile ("flushi %0" :: "r" (i)); - } - - /* - * Having flushed the cache, flush any stale instructions in the - * pipeline - */ - - __asm__ volatile ("flushp"); - -#endif /* NIOS2_ICACHE_SIZE > 0 */ -} diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_icache_flush_all.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_icache_flush_all.c deleted file mode 100644 index 5088552..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_icache_flush_all.c +++ /dev/null @@ -1,46 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "nios2.h" -#include "system.h" - -#include "alt_types.h" -#include "sys/alt_cache.h" - -/* - * alt_icache_flush_all() is called to flush the entire instruction cache. - */ - -void alt_icache_flush_all (void) -{ -#if NIOS2_ICACHE_SIZE > 0 - alt_icache_flush (0, NIOS2_ICACHE_SIZE); -#endif -} diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_iic.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_iic.c deleted file mode 100644 index 1db5afa..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_iic.c +++ /dev/null @@ -1,106 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ -#include "system.h" - -/* - * This file implements the HAL Enhanced interrupt API for Nios II processors - * with an internal interrupt controller (IIC). For most routines, this serves - * as a wrapper layer over the legacy interrupt API (which must be used with - * the IIC only). - * - * Use of the enhanced API is recommended so that application and device - * drivers are compatible with a Nios II system configured with an external - * interrupt controller (EIC), or IIC. This will afford maximum portability. - * - * If an EIC is present, the EIC device driver must provide these routines, - * because their operation will be specific to that EIC type. - */ -#ifndef NIOS2_EIC_PRESENT -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - -#include "sys/alt_irq.h" -#include "priv/alt_iic_isr_register.h" -#include "priv/alt_legacy_irq.h" - -/** @Function Description: This function registers an interrupt handler. - * If the function is succesful, then the requested interrupt will be enabled upon - * return. Registering a NULL handler will disable the interrupt. - * @API Type: External - * @param ic_id Ignored. - * @param irq IRQ number - * @return 0 if successful, else error (-1) - */ -int alt_ic_isr_register(alt_u32 ic_id, alt_u32 irq, alt_isr_func isr, - void *isr_context, void *flags) -{ - return alt_iic_isr_register(ic_id, irq, isr, isr_context, flags); -} - -/** @Function Description: This function enables a single interrupt. - * @API Type: External - * @param ic_id Ignored. - * @param irq IRQ number - * @return 0 if successful, else error (-1) - */ -int alt_ic_irq_enable (alt_u32 ic_id, alt_u32 irq) -{ - return alt_irq_enable(irq); -} - -/** @Function Description: This function disables a single interrupt. - * @API Type: External - * @param ic_id Ignored. - * @param irq IRQ number - * @return 0 if successful, else error (-1) - */ -int alt_ic_irq_disable(alt_u32 ic_id, alt_u32 irq) -{ - return alt_irq_disable(irq); -} - -/** @Function Description: This function to determine if corresponding - * interrupt is enabled. - * @API Type: External - * @param ic_id Ignored. - * @param irq IRQ number - * @return Zero if corresponding interrupt is disabled and - * non-zero otherwise. - */ -alt_u32 alt_ic_irq_enabled(alt_u32 ic_id, alt_u32 irq) -{ - alt_u32 irq_enabled; - - NIOS2_READ_IENABLE(irq_enabled); - - return (irq_enabled & (1 << irq)) ? 1: 0; -} - -#endif /* ALT_ENHANCED_INTERRUPT_API_PRESENT */ -#endif /* NIOS2_EIC_PRESENT */ diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_iic_isr_register.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_iic_isr_register.c deleted file mode 100644 index b104395..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_iic_isr_register.c +++ /dev/null @@ -1,104 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ -#include -#include "system.h" - -/* - * Provides an interrupt registry mechanism for the any CPUs internal interrupt - * controller (IIC) when the enhanced interrupt API is active. - */ -#ifndef ALT_CPU_EIC_PRESENT -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - -#include "alt_types.h" -#include "sys/alt_irq.h" -#include "priv/alt_iic_isr_register.h" - -/* - * The header, alt_irq_entry.h, contains the exception entry point, and is - * provided by the processor component. It is included here, so that the code - * will be added to the executable only if alt_irq_register() is present, i.e. - * if no interrupts are registered - there's no need to provide any - * interrupt handling. - */ - -#include "sys/alt_irq_entry.h" - -/* - * The header, alt_irq_table.h contains a table describing which function - * handles each interrupt. - */ - -#include "priv/alt_irq_table.h" - -/** @Function Description: This function registers an interrupt handler. - * If the function is succesful, then the requested interrupt will be enabled - * upon return. Registering a NULL handler will disable the interrupt. - * - * @API Type: External - * @param ic_id Interrupt controller ID - * @param irq IRQ ID number - * @param isr Pointer to interrupt service routine - * @param isr_context Opaque pointer passed to ISR - * @param flags - * @return 0 if successful, else error (-1) - */ -int alt_iic_isr_register(alt_u32 ic_id, alt_u32 irq, alt_isr_func isr, - void *isr_context, void *flags) -{ - int rc = -EINVAL; - int id = irq; /* IRQ interpreted as the interrupt ID. */ - alt_irq_context status; - - if (id < ALT_NIRQ) - { - /* - * interrupts are disabled while the handler tables are updated to ensure - * that an interrupt doesn't occur while the tables are in an inconsistant - * state. - */ - - status = alt_irq_disable_all(); - - alt_irq[id].handler = isr; - alt_irq[id].context = isr_context; - - rc = (isr) ? alt_ic_irq_enable(ic_id, id) : alt_ic_irq_disable(ic_id, id); - - alt_irq_enable_all(status); - } - - return rc; -} - -#endif /* ALT_ENHANCED_INTERRUPT_API_PRESENT */ -#endif /* ALT_CPU_EIC_PRESENT */ diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_instruction_exception_entry.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_instruction_exception_entry.c deleted file mode 100644 index f4f52fc..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_instruction_exception_entry.c +++ /dev/null @@ -1,203 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2008 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ -#include "sys/alt_exceptions.h" -#include "nios2.h" -#include "alt_types.h" -#include "system.h" - -/* - * This file implements support for calling user-registered handlers for - * instruction-generated exceptions. This handler could also be reached - * in the event of a spurious interrupt. - * - * The handler code is optionally enabled through the "Enable - * Instruction-related Exception API" HAL BSP setting, which will - * define the macro below. - */ -#ifdef ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API - -/* Function pointer to exception callback routine */ -alt_exception_result (*alt_instruction_exception_handler) - (alt_exception_cause, alt_u32, alt_u32) = 0x0; - -/* Link entry routine to .exceptions section */ -int alt_instruction_exception_entry (alt_u32 exception_pc) - __attribute__ ((section (".exceptions"))); - -/* - * This is the entry point for instruction-generated exceptions handling. - * This routine will be called by alt_exceptions_entry.S, after it determines - * that an exception could not be handled by handlers that preceed that - * of instruction-generated exceptions (such as interrupts). - * - * For this to function properly, you must register an exception handler - * using alt_instruction_exception_register(). This routine will call - * that handler if it has been registered. Absent a handler, it will - * break break or hang as discussed below. - */ -int alt_instruction_exception_entry (alt_u32 exception_pc) -{ - alt_u32 cause, badaddr; - -/* - * If the processor hardware has the optional EXCEPTIONS & BADADDR registers, - * read them and pass their content to the user handler. These are always - * present if the MMU or MPU is enabled, and optionally for other advanced - * exception types via the "Extra exceptions information" setting in the - * processor (hardware) configuration. - * - * If these registers are not present, the cause field will be set to - * NIOS2_EXCEPTION_CAUSE_NOT_PRESENT. Your handling routine should - * check the validity of the cause argument before proceeding. - */ -#ifdef NIOS2_HAS_EXTRA_EXCEPTION_INFO - /* Get exception cause & "badaddr" */ - NIOS2_READ_EXCEPTION(cause); - cause = ( (cause & NIOS2_EXCEPTION_REG_CAUSE_MASK) >> - NIOS2_EXCEPTION_REG_CAUSE_OFST ); - - NIOS2_READ_BADADDR(badaddr); -#else - cause = NIOS2_EXCEPTION_CAUSE_NOT_PRESENT; - badaddr = 0; -#endif /* NIOS2_HAS_EXTRA_EXCEPTION_INFO */ - - if(alt_instruction_exception_handler) { - /* - * Call handler. Its return value indicates whether the exception-causing - * instruction should be re-issued. The code that called us, - * alt_eceptions_entry.S, will look at this value and adjust the ea - * register as necessary - */ - return alt_instruction_exception_handler(cause, exception_pc, badaddr); - } - /* - * We got here because an instruction-generated exception occured, but no - * handler is present. We do not presume to know how to handle it. If the - * debugger is present, break, otherwise hang. - * - * If you've reached here in the debugger, consider examining the - * EXCEPTIONS register cause bit-field, which was read into the 'cause' - * variable above, and compare it against the exceptions-type enumeration - * in alt_exceptions.h. This register is availabe if the MMU or MPU is - * present, or if the "Extra exceptions information" hardware option is - * selected. - * - * If you get here then one of the following could have happened: - * - * - An instruction-generated exception occured, and the processor - * does not have the extra exceptions feature enabled, or you - * have not registered a handler using - * alt_instruction_exception_register() - * - * Some examples of instruction-generated exceptions and why they - * might occur: - * - * - Your program could have been compiled for a full-featured - * Nios II core, but it is running on a smaller core, and - * instruction emulation has been disabled by defining - * ALT_NO_INSTRUCTION_EMULATION. - * - * You can work around the problem by re-enabling instruction - * emulation, or you can figure out why your program is being - * compiled for a system other than the one that it is running on. - * - * - Your program has executed a trap instruction, but has not - * implemented a handler for this instruction. - * - * - Your program has executed an illegal instruction (one which is - * not defined in the instruction set). - * - * - Your processor includes an MMU or MPU, and you have enabled it - * before registering an exception handler to service exceptions it - * generates. - * - * The problem could also be hardware related: - * - If your hardware is broken and is generating spurious interrupts - * (a peripheral which negates its interrupt output before its - * interrupt handler has been executed will cause spurious interrupts) - */ - else { -#ifdef NIOS2_HAS_DEBUG_STUB - NIOS2_BREAK(); -#else - while(1) - ; -#endif /* NIOS2_HAS_DEBUG_STUB */ - } - - /* // We should not get here. Remove compiler warning. */ - return NIOS2_EXCEPTION_RETURN_REISSUE_INST; -} - -#endif /* ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API */ - -/* - * This routine indicates whether a particular exception cause will have - * set a valid address into the BADADDR register, which is included - * in the arguments to a user-registered instruction-generated exception - * handler. Many exception types do not set valid contents in BADADDR; - * this is a convenience routine to easily test the validity of that - * argument in your handler. - * - * Note that this routine will return false (0) for cause '12', - * TLB miss. This is because there are four exception types that - * share that cause, two of which do not have a valid BADADDR. You - * must determine BADADDR's validity for these. - * - * Arguments: - * cause: The 5-bit exception cause field of the EXCEPTIONS register, - * shifted to the LSB position. You may pass the 'cause' argument - * in a handler you registered directy to this routine. - * - * Return: 1: BADADDR (bad_addr argument to handler) is valid - * 0: BADADDR is not valid - */ -int alt_exception_cause_generated_bad_addr(alt_exception_cause cause) -{ - switch (cause) { - case NIOS2_EXCEPTION_SUPERVISOR_ONLY_DATA_ADDR: - return 1; - case NIOS2_EXCEPTION_MISALIGNED_DATA_ADDR: - return 1; - case NIOS2_EXCEPTION_MISALIGNED_TARGET_PC: - return 1; - case NIOS2_EXCEPTION_TLB_READ_PERM_VIOLATION: - return 1; - case NIOS2_EXCEPTION_TLB_WRITE_PERM_VIOLATION: - return 1; - case NIOS2_EXCEPTION_MPU_DATA_REGION_VIOLATION: - return 1; - default: - return 0; - } -} diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_instruction_exception_register.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_instruction_exception_register.c deleted file mode 100644 index b059e1d..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_instruction_exception_register.c +++ /dev/null @@ -1,82 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2008 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ -#include "sys/alt_exceptions.h" -#include "alt_types.h" -#include "system.h" - -/* - * This file implements support for calling user-registered handlers for - * instruction-generated exceptions. - * - * The registry API is optionally enabled through the "Enable - * Instruction-related Exception API" HAL BSP setting, which will - * define the macro below. - */ -#ifdef ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API - -/* - * The header, alt_exception_handler_registry.h contains a struct describing - * the registered exception handler - */ -#include "priv/alt_exception_handler_registry.h" - -/* - * Pull in the exception entry assembly code. This will not be linked in - * unless this object is linked into the executable (i.e. only if - * alt_instruction_exception_register() is called). - */ -__asm__( "\n\t.globl alt_exception" ); - -/* - * alt_instruction_exception_register() is called to register a handler to - * service instruction-generated exceptions that are not handled by the - * default exception handler code (interrupts, and optionally unimplemented - * instructions and traps). - * - * Passing null (0x0) in the handler argument will disable a previously- - * registered handler. - * - * Note that if no handler is registered, exceptions that are not processed - * using the built-in handler (interrupts, and optionally unimplemented - * instructions and traps) are treated as unknown exceptions, resulting - * in either a break or an infinite loop. - */ -void alt_instruction_exception_register ( - alt_exception_result (*exception_handler)( - alt_exception_cause cause, - alt_u32 exception_pc, - alt_u32 bad_addr) ) -{ - alt_instruction_exception_handler = exception_handler; -} - -#endif /* ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API */ diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_io_redirect.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_io_redirect.c deleted file mode 100644 index 8c862f7..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_io_redirect.c +++ /dev/null @@ -1,98 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include -#include - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - - -/* - * alt_open_fd() is similar to open() in that it is used to obtain a file - * descriptor for the file named "name". The "flags" and "mode" arguments are - * identical to the "flags" and "mode" arguments of open(). - * - * The distinction between the two functions is that the file descriptor - * structure to use is passed in as an argument, rather than allocated from the - * list of free file descriptors. - * - * This is used by alt_io_redirect() to redirect the stdin, stdout and stderr - * file descriptors to point to new devices. - * - * If the device can not be succesfully opened, then the input file descriptor - * remains unchanged. - */ - -static void alt_open_fd(alt_fd* fd, const char* name, int flags, int mode) -{ - int old; - - old = open (name, flags, mode); - - if (old >= 0) - { - fd->dev = alt_fd_list[old].dev; - fd->priv = alt_fd_list[old].priv; - fd->fd_flags = alt_fd_list[old].fd_flags; - - alt_release_fd (old); - } -} - -/* - * alt_io_redirect() is called once the device/filesystem lists have been - * initialised, but before main(). Its function is to redirect standard in, - * standard out and standard error so that they point to the devices selected by - * the user (as defined in system.h). - * - * Prior to the call to this function, io is directed towards /dev/null. If - * i/o can not be redirected to the requested device, for example if the device - * does not exist, then it remains directed at /dev/null. - */ - -void alt_io_redirect(const char* stdout_dev, - const char* stdin_dev, - const char* stderr_dev) -{ - /* Redirect the channels */ - - alt_open_fd (&alt_fd_list[STDOUT_FILENO], stdout_dev, O_WRONLY, 0777); - alt_open_fd (&alt_fd_list[STDIN_FILENO], stdin_dev, O_RDONLY, 0777); - alt_open_fd (&alt_fd_list[STDERR_FILENO], stderr_dev, O_WRONLY, 0777); -} - - - - diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_ioctl.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_ioctl.c deleted file mode 100644 index f5d7ef1..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_ioctl.c +++ /dev/null @@ -1,170 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "sys/ioctl.h" -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -/* - * The ioctl() system call is provided so that application code can manipulate - * the i/o capabilities of a device in device specific ways. This is identical - * to the standard posix ioctl() function. - * - * In general this implementation simply vectors ioctl requests to the - * apropriate drivers ioctl function (as registered in the drivers alt_dev - * structure). - * - * However in the case of devices (as oposed to filesystem), the TIOCEXCL and - * TIOCNXCL requests are handled without reference to the driver. These - * requests are used to lock/release a device for exclusive access. - * - * Handling these requests centrally eases the task of device driver - * development. - * - * ALT_IOCTL is mapped onto the ioctl() system call in alt_syscall.h - */ - -#ifdef ALT_USE_DIRECT_DRIVERS - -#include "system.h" -#include "sys/alt_driver.h" - -/* - * Provide minimal version that calls ioctl routine of provided stdio devices. - */ -int ALT_IOCTL (int file, int req, void* arg) -{ -#ifdef ALT_STDIN_PRESENT - ALT_DRIVER_IOCTL_EXTERNS(ALT_STDIN_DEV); -#endif -#ifdef ALT_STDOUT_PRESENT - ALT_DRIVER_IOCTL_EXTERNS(ALT_STDOUT_DEV); -#endif -#ifdef ALT_STDERR_PRESENT - ALT_DRIVER_IOCTL_EXTERNS(ALT_STDERR_DEV); -#endif - -#if !defined(ALT_STDIN_PRESENT) && !defined(ALT_STDOUT_PRESENT) && !defined(ALT_STDERR_PRESENT) - /* Generate a link time warning, should this function ever be called. */ - ALT_STUB_WARNING(ioctl); -#endif - - switch (file) { -#ifdef ALT_STDIN_PRESENT - case 0: /* stdin file descriptor */ - return ALT_DRIVER_IOCTL(ALT_STDIN_DEV, req, arg); -#endif /* ALT_STDIN_PRESENT */ -#ifdef ALT_STDOUT_PRESENT - case 1: /* stdout file descriptor */ - return ALT_DRIVER_IOCTL(ALT_STDOUT_DEV, req, arg); -#endif /* ALT_STDOUT_PRESENT */ -#ifdef ALT_STDERR_PRESENT - case 2: /* stderr file descriptor */ - return ALT_DRIVER_IOCTL(ALT_STDERR_DEV, req, arg); -#endif /* ALT_STDERR_PRESENT */ - default: - ALT_ERRNO = EBADFD; - return -1; - } -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -int ALT_IOCTL (int file, int req, void* arg) -{ - alt_fd* fd; - int rc; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - - /* - * In the case of device drivers (not file systems) handle the TIOCEXCL - * and TIOCNXCL requests as special cases. - */ - - if (fd->fd_flags & ALT_FD_DEV) - { - if (req == TIOCEXCL) - { - rc = alt_fd_lock (fd); - goto ioctl_done; - } - else if (req == TIOCNXCL) - { - rc = alt_fd_unlock (fd); - goto ioctl_done; - } - } - - /* - * If the driver provides an ioctl() function, call that to handle the - * request, otherwise set the return code to indicate that the request - * could not be processed. - */ - - if (fd->dev->ioctl) - { - rc = fd->dev->ioctl(fd, req, arg); - } - else - { - rc = -ENOTTY; - } - } - else - { - rc = -EBADFD; - } - -ioctl_done: - - if (rc < 0) - { - ALT_ERRNO = -rc; - } - return rc; -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_irq_entry.S b/software/qsys_tutorial_key3_bsp/HAL/src/alt_irq_entry.S deleted file mode 100644 index d3efe7d..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_irq_entry.S +++ /dev/null @@ -1,108 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "system.h" - -/* - * This is the interrupt exception entry point code, which saves all the - * registers and calls the interrupt handler. It should be pulled in using - * a .globl from alt_irq_register.c. This scheme is used so that if an - * interrupt is never registered, then this code will not appear in the - * generated executable, thereby improving code footprint. - */ - - /* - * Explicitly allow the use of r1 (the assembler temporary register) - * within this code. This register is normally reserved for the use of - * the compiler. - */ - .set noat - - /* - * Pull in the exception handler register save code. - */ - .globl alt_exception - - .globl alt_irq_entry - .section .exceptions.entry.label, "xa" -alt_irq_entry: - - /* - * Section .exceptions.entry is in alt_exception_entry.S - * This saves all the caller saved registers and reads estatus into r5 - */ - - .section .exceptions.irqtest, "xa" - -#ifdef ALT_CI_INTERRUPT_VECTOR_N - /* - * Use the interrupt vector custom instruction if present to accelerate - * this code. - * If the interrupt vector custom instruction returns a negative - * value, there are no interrupts active (estatus.pie is 0 - * or ipending is 0) so assume it is a software exception. - */ - custom ALT_CI_INTERRUPT_VECTOR_N, r4, r0, r0 - blt r4, r0, .Lnot_irq -#else - /* - * Test to see if the exception was a software exception or caused - * by an external interrupt, and vector accordingly. - */ - rdctl r4, ipending - andi r2, r5, 1 - beq r2, zero, .Lnot_irq - beq r4, zero, .Lnot_irq -#endif /* ALT_CI_INTERRUPT_VECTOR_N */ - - .section .exceptions.irqhandler, "xa" - /* - * Now that all necessary registers have been preserved, call - * alt_irq_handler() to process the interrupts. - */ - - call alt_irq_handler - - .section .exceptions.irqreturn, "xa" - - br .Lexception_exit - - .section .exceptions.notirq.label, "xa" - -.Lnot_irq: - - /* - * Section .exceptions.exit is in alt_exception_entry.S - * This restores all the caller saved registers - */ - - .section .exceptions.exit.label -.Lexception_exit: - diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_irq_handler.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_irq_handler.c deleted file mode 100644 index 3253d02..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_irq_handler.c +++ /dev/null @@ -1,169 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include "system.h" - -/* - * This interrupt handler only works with an internal interrupt controller - * (IIC). Processors with an external interrupt controller (EIC) use an - * implementation provided by an EIC driver. - */ -#ifndef ALT_CPU_EIC_PRESENT - -#include "sys/alt_irq.h" -#include "os/alt_hooks.h" - -#include "alt_types.h" - -/* - * A table describing each interrupt handler. The index into the array is the - * interrupt id associated with the handler. - * - * When an interrupt occurs, the associated handler is called with - * the argument stored in the context member. - */ -struct ALT_IRQ_HANDLER -{ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - void (*handler)(void*); -#else - void (*handler)(void*, alt_u32); -#endif - void *context; -} alt_irq[ALT_NIRQ]; - -/* - * alt_irq_handler() is called by the interrupt exception handler in order to - * process any outstanding interrupts. - * - * It is defined here since it is linked in using weak linkage. - * This means that if there is never a call to alt_irq_register() (above) then - * this function will not get linked in to the executable. This is acceptable - * since if no handler is ever registered, then an interrupt can never occur. - * - * If Nios II interrupt vector custom instruction exists, use it to accelerate - * the dispatch of interrupt handlers. The Nios II interrupt vector custom - * instruction is present if the macro ALT_CI_INTERRUPT_VECTOR defined. - */ - -void alt_irq_handler (void) __attribute__ ((section (".exceptions"))); -void alt_irq_handler (void) -{ -#ifdef ALT_CI_INTERRUPT_VECTOR - alt_32 offset; - char* alt_irq_base = (char*)alt_irq; -#else - alt_u32 active; - alt_u32 mask; - alt_u32 i; -#endif /* ALT_CI_INTERRUPT_VECTOR */ - - /* - * Notify the operating system that we are at interrupt level. - */ - - ALT_OS_INT_ENTER(); - -#ifdef ALT_CI_INTERRUPT_VECTOR - /* - * Call the interrupt vector custom instruction using the - * ALT_CI_INTERRUPT_VECTOR macro. - * It returns the offset into the vector table of the lowest-valued pending - * interrupt (corresponds to highest priority) or a negative value if none. - * The custom instruction assumes that each table entry is eight bytes. - */ - while ((offset = ALT_CI_INTERRUPT_VECTOR) >= 0) { - struct ALT_IRQ_HANDLER* handler_entry = - (struct ALT_IRQ_HANDLER*)(alt_irq_base + offset); -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - handler_entry->handler(handler_entry->context); -#else - handler_entry->handler(handler_entry->context, offset >> 3); -#endif - } -#else /* ALT_CI_INTERRUPT_VECTOR */ - /* - * Obtain from the interrupt controller a bit list of pending interrupts, - * and then process the highest priority interrupt. This process loops, - * loading the active interrupt list on each pass until alt_irq_pending() - * return zero. - * - * The maximum interrupt latency for the highest priority interrupt is - * reduced by finding out which interrupts are pending as late as possible. - * Consider the case where the high priority interupt is asserted during - * the interrupt entry sequence for a lower priority interrupt to see why - * this is the case. - */ - - active = alt_irq_pending (); - - do - { - i = 0; - mask = 1; - - /* - * Test each bit in turn looking for an active interrupt. Once one is - * found, the interrupt handler asigned by a call to alt_irq_register() is - * called to clear the interrupt condition. - */ - - do - { - if (active & mask) - { -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - alt_irq[i].handler(alt_irq[i].context); -#else - alt_irq[i].handler(alt_irq[i].context, i); -#endif - break; - } - mask <<= 1; - i++; - - } while (1); - - active = alt_irq_pending (); - - } while (active); -#endif /* ALT_CI_INTERRUPT_VECTOR */ - - /* - * Notify the operating system that interrupt processing is complete. - */ - - ALT_OS_INT_EXIT(); -} - -#endif /* ALT_CPU_EIC_PRESENT */ diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_irq_register.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_irq_register.c deleted file mode 100644 index b5ea474..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_irq_register.c +++ /dev/null @@ -1,102 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ -#include -#include "system.h" - -/* - * This interrupt registry mechanism works with the Nios II internal interrupt - * controller (IIC) only. Systems with an external interrupt controller (EIC), - * or those with the IIC who are using the enhanced interrupt API will - * utilize the alt_ic_isr_register() routine to register an interrupt. - */ -#ifndef NIOS2_EIC_PRESENT - -#include "sys/alt_irq.h" -#include "priv/alt_legacy_irq.h" -#include "os/alt_hooks.h" - -#include "alt_types.h" - -/* - * The header, alt_irq_entry.h, contains the exception entry point, and is - * provided by the processor component. It is included here, so that the code - * will be added to the executable only if alt_irq_register() is present, i.e. - * if no interrupts are registered - there's no need to provide any - * interrupt handling. - */ - -#include "sys/alt_irq_entry.h" - -/* - * The header, alt_irq_table.h contains a table describing which function - * handles each interrupt. - */ - -#include "priv/alt_irq_table.h" - -/* - * alt_irq_handler() is called to register an interrupt handler. If the - * function is succesful, then the requested interrupt will be enabled upon - * return. Registering a NULL handler will disable the interrupt. - * - * The return value is 0 if the interrupt handler was registered and the - * interrupt was enabled, otherwise it is negative. - */ - -int alt_irq_register (alt_u32 id, - void* context, - alt_isr_func handler) -{ - int rc = -EINVAL; - alt_irq_context status; - - if (id < ALT_NIRQ) - { - /* - * interrupts are disabled while the handler tables are updated to ensure - * that an interrupt doesn't occur while the tables are in an inconsistant - * state. - */ - - status = alt_irq_disable_all (); - - alt_irq[id].handler = handler; - alt_irq[id].context = context; - - rc = (handler) ? alt_irq_enable (id): alt_irq_disable (id); - - alt_irq_enable_all(status); - } - return rc; -} -#endif /* NIOS2_EIC_PRESENT */ - diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_irq_vars.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_irq_vars.c deleted file mode 100644 index 8c0a18d..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_irq_vars.c +++ /dev/null @@ -1,47 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "alt_types.h" - -#include "system.h" - -/* - * These global variables are used to save the current list of enabled - * interrupts. See alt_irq.h for further details. - */ - -volatile alt_u32 alt_irq_active = 0; - -#ifndef ALT_EXCEPTION_STACK - -volatile alt_u32 alt_priority_mask = (alt_u32) -1; - -#endif - diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_isatty.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_isatty.c deleted file mode 100644 index 9276472..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_isatty.c +++ /dev/null @@ -1,125 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include "sys/alt_dev.h" -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -#ifdef ALT_USE_DIRECT_DRIVERS - -#include "system.h" - -/* - * Provide minimal version that just describes all file descriptors - * as tty devices for provided stdio devices. - */ -int ALT_ISATTY (int file) -{ - switch (file) { -#ifdef ALT_STDIN_PRESENT - case 0: /* stdin file descriptor */ -#endif /* ALT_STDIN_PRESENT */ -#ifdef ALT_STDOUT_PRESENT - case 1: /* stdout file descriptor */ -#endif /* ALT_STDOUT_PRESENT */ -#ifdef ALT_STDERR_PRESENT - case 2: /* stderr file descriptor */ -#endif /* ALT_STDERR_PRESENT */ - return 1; - default: - return 0; - } - -#if !defined(ALT_STDIN_PRESENT) && !defined(ALT_STDOUT_PRESENT) && !defined(ALT_STDERR_PRESENT) - /* Generate a link time warning, should this function ever be called. */ - ALT_STUB_WARNING(isatty); -#endif -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ -/* - * isatty() can be used to determine whether the input file descriptor "file" - * refers to a terminal device or not. If it is a terminal device then the - * return value is one, otherwise it is zero. - * - * ALT_ISATTY is mapped onto the isatty() system call in alt_syscall.h - */ - -int ALT_ISATTY (int file) -{ - alt_fd* fd; - struct stat stat; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - /* - * If a device driver does not provide an fstat() function, then it is - * treated as a terminal device by default. - */ - - if (!fd->dev->fstat) - { - return 1; - } - - /* - * If a driver does provide an implementation of the fstat() function, then - * this is called so that the device can identify itself. - */ - - else - { - fstat (file, &stat); - return (stat.st_mode == _IFCHR) ? 1 : 0; - } - } - else - { - ALT_ERRNO = EBADFD; - return 0; - } -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_kill.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_kill.c deleted file mode 100644 index 42c2e1d..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_kill.c +++ /dev/null @@ -1,121 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include "sys/alt_errno.h" -#include "os/alt_syscall.h" - - -/* - * kill() is used by newlib in order to send signals to processes. Since there - * is only a single process in the HAL, the only valid values for pid are - * either the current process id, or the broadcast values, i.e. pid must be - * less than or equal to zero. - * - * ALT_KILL is mapped onto the kill() system call in alt_syscall.h - */ - -int ALT_KILL (int pid, int sig) -{ - int status = 0; - - if (pid <= 0) - { - switch (sig) - { - case 0: - - /* The null signal is used to check that a pid is valid. */ - - break; - - case SIGABRT: - case SIGALRM: - case SIGFPE: - case SIGILL: - case SIGKILL: - case SIGPIPE: - case SIGQUIT: - case SIGSEGV: - case SIGTERM: - case SIGUSR1: - case SIGUSR2: - case SIGBUS: - case SIGPOLL: - case SIGPROF: - case SIGSYS: - case SIGTRAP: - case SIGVTALRM: - case SIGXCPU: - case SIGXFSZ: - - /* - * The Posix standard defines the default behaviour for all these signals - * as being eqivalent to a call to _exit(). No mechanism is provided to - * change this behaviour. - */ - - _exit(0); - case SIGCHLD: - case SIGURG: - - /* - * The Posix standard defines these signals to be ignored by default. No - * mechanism is provided to change this behaviour. - */ - - break; - default: - - /* Tried to send an unsupported signal */ - - status = EINVAL; - } - } - - else if (pid > 0) - { - /* Attempted to signal a non-existant process */ - - status = ESRCH; - } - - if (status) - { - ALT_ERRNO = status; - return -1; - } - - return 0; -} diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_link.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_link.c deleted file mode 100644 index d796c59..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_link.c +++ /dev/null @@ -1,56 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_warning.h" -#include "sys/alt_errno.h" -#include "os/alt_syscall.h" - -/* - * link() is used by newlib to create a new link to an existing file. This is - * unsupported in the HAL environment. However a "do-nothing" implementation - * is still provied for newlib compatability. - * - * ALT_LINK is mapped onto the link() system call in alt_syscall.h - */ - -int ALT_LINK ( char *existing, char *new) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(link); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} - diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_load.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_load.c deleted file mode 100644 index ffab4b9..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_load.c +++ /dev/null @@ -1,88 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_load.h" -#include "sys/alt_cache.h" - -/* - * Linker defined symbols. - */ - -extern void __flash_rwdata_start; -extern void __ram_rwdata_start; -extern void __ram_rwdata_end; -extern void __flash_rodata_start; -extern void __ram_rodata_start; -extern void __ram_rodata_end; -extern void __flash_exceptions_start; -extern void __ram_exceptions_start; -extern void __ram_exceptions_end; - -/* - * alt_load() is called when the code is executing from flash. In this case - * there is no bootloader, so this application is responsible for loading to - * RAM any sections that are required. - */ - -void alt_load (void) -{ - /* - * Copy the .rwdata section. - */ - - alt_load_section (&__flash_rwdata_start, - &__ram_rwdata_start, - &__ram_rwdata_end); - - /* - * Copy the exception handler. - */ - - alt_load_section (&__flash_exceptions_start, - &__ram_exceptions_start, - &__ram_exceptions_end); - - /* - * Copy the .rodata section. - */ - - alt_load_section (&__flash_rodata_start, - &__ram_rodata_start, - &__ram_rodata_end); - - /* - * Now ensure that the caches are in synch. - */ - - alt_dcache_flush_all(); - alt_icache_flush_all(); -} diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_log_macro.S b/software/qsys_tutorial_key3_bsp/HAL/src/alt_log_macro.S deleted file mode 100644 index 499c4ad..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_log_macro.S +++ /dev/null @@ -1,56 +0,0 @@ -/* alt_log_macro.S - * - * Implements the function tx_log_str, called by the assembly macro - * ALT_LOG_PUTS(). The macro will be empty when logging is turned off, - * and this function will not be compiled. When logging is on, - * this function is used to print out the strings defined in the beginning - * of alt_log_printf.c, using port information taken from system.h and - * alt_log_printf.h. - * - * This routine only handles strings, and sends a character into the defined - * output device's output buffer when the device is ready. It's intended for - * debugging purposes, where messages can be set to print out at certain - * points in the boot code to indicate the progress of the program. - * - */ - -#ifndef __ALT_LOG_MACROS__ -#define __ALT_LOG_MACROS__ - -/* define this flag to skip assembly-incompatible parts - * of various include files. */ -#define ALT_ASM_SRC - -#ifdef ALT_LOG_ENABLE // only compile this function if this flag is defined. - - #include "system.h" - #include "sys/alt_log_printf.h" - - .global tx_log_str -tx_log_str: - /* load base uart / jtag uart address into r6 */ - movhi r6, %hiadj(ALT_LOG_PORT_BASE) - addi r6, r6, %lo(ALT_LOG_PORT_BASE) -tx_next_char: - /* if pointer points to null, return - * r4 is the pointer to the str to be printed, set by ALT_LOG_PUTS */ - ldb r7, (r4) - beq r0, r7, end_tx - - /* check device transmit ready */ -wait_tx_ready_loop: - ldwio r5, ALT_LOG_PRINT_REG_OFFSET(r6) - andi r5, r5, ALT_LOG_PRINT_MSK - beq r5, r0, wait_tx_ready_loop - /* write char */ - stwio r7, ALT_LOG_PRINT_TXDATA_REG_OFFSET (r6) - /* advance string pointer */ - addi r4, r4, 1 - br tx_next_char -end_tx: - ret - -#endif - -#endif /* __ALT_LOG_MACROS__ */ - diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_log_printf.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_log_printf.c deleted file mode 100644 index 1f7056d..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_log_printf.c +++ /dev/null @@ -1,479 +0,0 @@ - -/* alt_log_printf.c - * - * This file implements the various C functions used for the - * alt_log logging/debugging print functions. The functions - * sit as is here - the job of hiding them from the compiler - * if logging is disabled is accomplished in the .h file. - * - * All the global variables for alt_log are defined here. - * These include the various flags that turn on additional - * logging options; the strings for assembly printing; and - * other globals needed by different logging options. - * - * There are 4 functions that handle the actual printing: - * alt_log_txchar: Actual function that puts 1 char to UART/JTAG UART. - * alt_log_repchar: Calls alt_log_txchar 'n' times - used by - * alt_log_private_printf for formatting. - * alt_log_private_printf: - * Stripped down implementation of printf - no floats. - * alt_log_printf_proc: - * Wrapper function for private_printf. - * - * The rest of the functions are called by the macros which - * were called by code in the other components. Each function - * is preceded by a comment, about which file it gets called - * in, and what its purpose is. - * - * author: gkwan - */ - -/* skip all code if enable is off */ -#ifdef ALT_LOG_ENABLE - -#include -#include -#include -#ifdef __ALTERA_AVALON_JTAG_UART - #include "altera_avalon_jtag_uart.h" - #include -#endif -#include "sys/alt_log_printf.h" - -/* strings for assembly puts */ -char alt_log_msg_bss[] = "[crt0.S] Clearing BSS \r\n";; -char alt_log_msg_alt_main[] = "[crt0.S] Calling alt_main.\r\n"; -char alt_log_msg_stackpointer[] \ - = "[crt0.S] Setting up stack and global pointers.\r\n"; -char alt_log_msg_cache[] = "[crt0.S] Inst & Data Cache Initialized.\r\n"; -/* char array allocation for alt_write */ -char alt_log_write_buf[ALT_LOG_WRITE_ECHO_LEN+2]; - -/* global variables for all 'on' flags */ - -/* - * The boot message flag is linked into the data (rwdata) section - * because if it is zero, it would otherwise be placed in the bss section. - * alt_log examines this variable before the BSS is cleared in the boot-up - * process. - */ -volatile alt_u32 alt_log_boot_on_flag \ - __attribute__ ((section (".data"))) = ALT_LOG_BOOT_ON_FLAG_SETTING; - -volatile alt_u8 alt_log_write_on_flag = ALT_LOG_WRITE_ON_FLAG_SETTING; - -volatile alt_u8 alt_log_sys_clk_on_flag = ALT_LOG_SYS_CLK_ON_FLAG_SETTING; - -volatile alt_u8 alt_log_jtag_uart_alarm_on_flag = \ - ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING; - -volatile alt_u8 alt_log_jtag_uart_isr_on_flag = \ - ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING; - -volatile alt_u8 alt_log_jtag_uart_startup_info_on_flag = \ - ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING; - -/* Global alarm object for recurrent JTAG UART status printing */ -alt_alarm alt_log_jtag_uart_alarm_1; - -/* Global ints for system clock printing and count */ -volatile int alt_log_sys_clk_count; -volatile int alt_system_clock_in_sec; - -/* enum used by alt_log_private_printf */ -enum -{ - pfState_chars, - pfState_firstFmtChar, - pfState_otherFmtChar -}; - - - - -/* Function to put one char onto the UART/JTAG UART txdata register. */ -void alt_log_txchar(int c,char *base) -{ - /* Wait until the device is ready for a character */ - while((ALT_LOG_PRINT_REG_RD(base) & ALT_LOG_PRINT_MSK) == 0) - ; - /* And pop the character into the register */ - ALT_LOG_PRINT_TXDATA_WR(base,c); -} - - -/* Called by alt_log_private_printf to print out characters repeatedly */ -void alt_log_repchar(char c,int r,int base) -{ - while(r-- > 0) - alt_log_txchar(c,(char*) base); -} - - -/* Stripped down printf function */ -void alt_log_private_printf(const char *fmt,int base,va_list args) - { - const char *w; - char c; - int state; - int fmtLeadingZero = 0; /* init these all to 0 for -W warnings. */ - int fmtLong = 0; - int fmtBeforeDecimal = 0; - int fmtAfterDecimal = 0; - int fmtBase = 0; - int fmtSigned = 0; - int fmtCase = 0; /* For hex format, if 1, A-F, else a-f. */ - - w = fmt; - state = pfState_chars; - - while(0 != (c = *w++)) - { - switch(state) - { - case pfState_chars: - if(c == '%') - { - fmtLeadingZero = 0; - fmtLong = 0; - fmtBase = 10; - fmtSigned = 1; - fmtCase = 0; /* Only %X sets this. */ - fmtBeforeDecimal = -1; - fmtAfterDecimal = -1; - state = pfState_firstFmtChar; - } - else - { - alt_log_txchar(c,(char*)base); - } - break; - - case pfState_firstFmtChar: - if(c == '0') - { - fmtLeadingZero = 1; - state = pfState_otherFmtChar; - } - else if(c == '%') - { - alt_log_txchar(c,(char*)base); - state = pfState_chars; - } - else - { - state = pfState_otherFmtChar; - goto otherFmtChar; - } - break; - - case pfState_otherFmtChar: -otherFmtChar: - if(c == '.') - { - fmtAfterDecimal = 0; - } - else if('0' <= c && c <= '9') - { - c -= '0'; - if(fmtAfterDecimal < 0) /* still before decimal */ - { - if(fmtBeforeDecimal < 0) - { - fmtBeforeDecimal = 0; - } - else - { - fmtBeforeDecimal *= 10; - } - fmtBeforeDecimal += c; - } - else - { - fmtAfterDecimal = (fmtAfterDecimal * 10) + c; - } - } - else if(c == 'l') - { - fmtLong = 1; - } - else /* we're up to the letter which determines type */ - { - switch(c) - { - case 'd': - case 'i': -doIntegerPrint: - { - unsigned long v; - unsigned long p; /* biggest power of fmtBase */ - unsigned long vShrink; /* used to count digits */ - int sign; - int digitCount; - - /* Get the value */ - if(fmtLong) - { - if (fmtSigned) - { - v = va_arg(args,long); - } - else - { - v = va_arg(args,unsigned long); - } - } - else - { - if (fmtSigned) - { - v = va_arg(args,int); - } - else - { - v = va_arg(args,unsigned int); - } - } - - /* Strip sign */ - sign = 0; - /* (assumes sign bit is #31) */ - if( fmtSigned && (v & (0x80000000)) ) - { - v = ~v + 1; - sign = 1; - } - - /* Count digits, and get largest place value */ - vShrink = v; - p = 1; - digitCount = 1; - while( (vShrink = vShrink / fmtBase) > 0 ) - { - digitCount++; - p *= fmtBase; - } - - /* Print leading characters & sign */ - fmtBeforeDecimal -= digitCount; - if(fmtLeadingZero) - { - if(sign) - { - alt_log_txchar('-',(char*)base); - fmtBeforeDecimal--; - } - alt_log_repchar('0',fmtBeforeDecimal,base); - } - else - { - if(sign) - { - fmtBeforeDecimal--; - } - alt_log_repchar(' ',fmtBeforeDecimal,base); - if(sign) - { - alt_log_txchar('-',(char*)base); - } - } - - /* Print numbery parts */ - while(p) - { - unsigned char d; - - d = v / p; - d += '0'; - if(d > '9') - { - d += (fmtCase ? 'A' : 'a') - '0' - 10; - } - alt_log_txchar(d,(char*)base); - - v = v % p; - p = p / fmtBase; - } - } - - state = pfState_chars; - break; - - case 'u': - fmtSigned = 0; - goto doIntegerPrint; - case 'o': - fmtSigned = 0; - fmtBase = 8; - goto doIntegerPrint; - case 'x': - fmtSigned = 0; - fmtBase = 16; - goto doIntegerPrint; - case 'X': - fmtSigned = 0; - fmtBase = 16; - fmtCase = 1; - goto doIntegerPrint; - - case 'c': - alt_log_repchar(' ',fmtBeforeDecimal-1,base); - alt_log_txchar(va_arg(args,int),(char*)base); - break; - - case 's': - { - char *s; - - s = va_arg(args,char *); - alt_log_repchar(' ',fmtBeforeDecimal-strlen(s),base); - - while(*s) - alt_log_txchar(*s++,(char*)base); - } - break; - } /* switch last letter of fmt */ - state=pfState_chars; - } - break; - } /* switch */ - } /* while chars left */ - } /* printf */ - -/* Main logging printf function */ -int alt_log_printf_proc(const char *fmt, ... ) -{ - va_list args; - - va_start (args, fmt); - alt_log_private_printf(fmt,ALT_LOG_PORT_BASE,args); - return (0); -} - -/* Below are the functions called by different macros in various components. */ - -/* If the system has a JTAG_UART, include JTAG_UART debugging functions */ -#ifdef __ALTERA_AVALON_JTAG_UART - -/* The alarm function in altera_avalon_jtag_uart.c. - * This function, when turned on, prints out the status - * of the JTAG UART Control register, every ALT_LOG_JTAG_UART_TICKS. - * If the flag is off, the alarm should never be registered, and this - * function should never run */ -alt_u32 altera_avalon_jtag_uart_report_log(void * context) -{ - if (alt_log_jtag_uart_alarm_on_flag) { - altera_avalon_jtag_uart_state* dev = (altera_avalon_jtag_uart_state*) context; - const char* header="JTAG Alarm:"; - alt_log_jtag_uart_print_control_reg(dev, dev->base, header); - return ALT_LOG_JTAG_UART_TICKS; - } - else - { - /* If flag is not on, return 0 to disable future alarms. - * Should never be here, alarm should not be enabled at all. */ - return 0; - } -} - -void alt_log_jtag_uart_print_control_reg(altera_avalon_jtag_uart_state* dev, int base, const char* header) -{ - unsigned int control, space, ac, wi, ri, we, re; - control = IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base); - space = (control & ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_MSK) >> - ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_OFST; - we= (control & ALTERA_AVALON_JTAG_UART_CONTROL_WE_MSK) >> - ALTERA_AVALON_JTAG_UART_CONTROL_WE_OFST; - re= (control & ALTERA_AVALON_JTAG_UART_CONTROL_RE_MSK) >> - ALTERA_AVALON_JTAG_UART_CONTROL_RE_OFST; - ri= (control & ALTERA_AVALON_JTAG_UART_CONTROL_RI_MSK) >> - ALTERA_AVALON_JTAG_UART_CONTROL_RI_OFST; - wi= (control & ALTERA_AVALON_JTAG_UART_CONTROL_WI_MSK) >> - ALTERA_AVALON_JTAG_UART_CONTROL_WI_OFST; - ac= (control & ALTERA_AVALON_JTAG_UART_CONTROL_AC_MSK) >> - ALTERA_AVALON_JTAG_UART_CONTROL_AC_OFST; - -#ifdef ALTERA_AVALON_JTAG_UART_SMALL - ALT_LOG_PRINTF( - "%s HW FIFO wspace=%d AC=%d WI=%d RI=%d WE=%d RE=%d\r\n", - header,space,ac,wi,ri,we,re); -#else - ALT_LOG_PRINTF( - "%s SW CirBuf = %d, HW FIFO wspace=%d AC=%d WI=%d RI=%d WE=%d RE=%d\r\n", - header,(dev->tx_out-dev->tx_in),space,ac,wi,ri,we,re); -#endif - - return; - -} - -/* In altera_avalon_jtag_uart.c - * Same output as the alarm function above, but this is called in the driver - * init function. Hence, it gives the status of the JTAG UART control register - * right at the initialization of the driver */ -void alt_log_jtag_uart_startup_info(altera_avalon_jtag_uart_state* dev, int base) -{ - const char* header="JTAG Startup Info:"; - alt_log_jtag_uart_print_control_reg(dev, base, header); - return; -} - -/* In altera_avalon_jtag_uart.c - * When turned on, this function will print out the status of the jtag uart - * control register every time there is a jtag uart "almost-empty" interrupt. */ -void alt_log_jtag_uart_isr_proc(int base, altera_avalon_jtag_uart_state* dev) -{ - if (alt_log_jtag_uart_isr_on_flag) { - const char* header="JTAG IRQ:"; - alt_log_jtag_uart_print_control_reg(dev, base, header); - } - return; -} - -#endif /* __ALTERA_AVALON_JTAG_UART */ - -/* In alt_write.c - * When the alt_log_write_on_flag is turned on, this function gets called - * every time alt_write gets called. The first - * ALT_LOG_WRITE_ECHO_LEN characters of every printf command (or any command - * that eventually calls write()) gets echoed to the alt_log output. */ -void alt_log_write(const void *ptr, size_t len) -{ - if (alt_log_write_on_flag) { - int temp_cnt; - int length=(ALT_LOG_WRITE_ECHO_LEN>len) ? len : ALT_LOG_WRITE_ECHO_LEN; - - if (length < 2) return; - - strncpy (alt_log_write_buf,ptr,length); - alt_log_write_buf[length-1]='\n'; - alt_log_write_buf[length]='\r'; - alt_log_write_buf[length+1]='\0'; - - /* Escape Ctrl-D's. If the Ctrl-D gets sent it might kill the terminal - * connection of alt_log. It will get replaced by 'D'. */ - for (temp_cnt=0;temp_cnt < length; temp_cnt++) { - if (alt_log_write_buf[temp_cnt]== 0x4) { - alt_log_write_buf[temp_cnt]='D'; - } - } - ALT_LOG_PRINTF("Write Echo: %s",alt_log_write_buf); - } -} - -/* In altera_avalon_timer_sc - * This function prints out a system clock is alive message - * every ALT_LOG_SYS_CLK_INTERVAL (in ticks). */ -void alt_log_system_clock() -{ - if (alt_log_sys_clk_on_flag) { - alt_log_sys_clk_count++; - if (alt_log_sys_clk_count > ALT_LOG_SYS_CLK_INTERVAL) { - alt_log_sys_clk_count = 0; - ALT_LOG_PRINTF("System Clock On %u\r\n",alt_system_clock_in_sec++); - } - } -} - - -#endif diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_lseek.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_lseek.c deleted file mode 100644 index 7857b0d..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_lseek.c +++ /dev/null @@ -1,117 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -#ifdef ALT_USE_DIRECT_DRIVERS - -off_t ALT_LSEEK (int file, off_t ptr, int dir) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(lseek); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -/* - * lseek() can be called to move the read/write pointer associated with the - * file descriptor "file". This function simply vectors the call to the lseek() - * function provided by the driver associated with the file descriptor. - * - * If the driver does not provide an implementation of lseek() an error is - * indicated. - * - * lseek() corresponds to the standard lseek() function. - * - * ALT_LSEEK is mapped onto the lseek() system call in alt_syscall.h - * - */ - -off_t ALT_LSEEK (int file, off_t ptr, int dir) -{ - alt_fd* fd; - off_t rc = 0; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - /* - * If the device driver provides an implementation of the lseek() function, - * then call that to process the request. - */ - - if (fd->dev->lseek) - { - rc = fd->dev->lseek(fd, ptr, dir); - } - /* - * Otherwise return an error. - */ - - else - { - rc = -ENOTSUP; - } - } - else - { - rc = -EBADFD; - } - - if (rc < 0) - { - ALT_ERRNO = -rc; - rc = -1; - } - - return rc; -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_main.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_main.c deleted file mode 100644 index a96229b..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_main.c +++ /dev/null @@ -1,161 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include -#include -#include -#include - -#include "sys/alt_dev.h" -#include "sys/alt_sys_init.h" -#include "sys/alt_irq.h" -#include "sys/alt_dev.h" - -#include "os/alt_hooks.h" - -#include "priv/alt_file.h" -#include "alt_types.h" - -#include "system.h" - -#include "sys/alt_log_printf.h" - -extern void _do_ctors(void); -extern void _do_dtors(void); - -/* - * Standard arguments for main. By default, no arguments are passed to main. - * However a device driver may choose to configure these arguments by calling - * alt_set_args(). The expectation is that this facility will only be used by - * the iclient/ihost utility. - */ - -int alt_argc = 0; -char** alt_argv = {NULL}; -char** alt_envp = {NULL}; - -/* - * Prototype for the entry point to the users application. - */ - -extern int main (int, char **, char **); - -/* - * alt_main is the C entry point for the HAL. It is called by the assembler - * startup code in the processor specific crt0.S. It is responsible for: - * completing the C runtime configuration; configuring all the - * devices/filesystems/components in the system; and call the entry point for - * the users application, i.e. main(). - */ - -void alt_main (void) -{ -#ifndef ALT_NO_EXIT - int result; -#endif - - /* ALT LOG - please see HAL/sys/alt_log_printf.h for details */ - ALT_LOG_PRINT_BOOT("[alt_main.c] Entering alt_main, calling alt_irq_init.\r\n"); - /* Initialize the interrupt controller. */ - alt_irq_init (NULL); - - /* Initialize the operating system */ - ALT_LOG_PRINT_BOOT("[alt_main.c] Done alt_irq_init, calling alt_os_init.\r\n"); - ALT_OS_INIT(); - - /* - * Initialize the semaphore used to control access to the file descriptor - * list. - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Done OS Init, calling alt_sem_create.\r\n"); - ALT_SEM_CREATE (&alt_fd_list_lock, 1); - - /* Initialize the device drivers/software components. */ - ALT_LOG_PRINT_BOOT("[alt_main.c] Calling alt_sys_init.\r\n"); - alt_sys_init(); - ALT_LOG_PRINT_BOOT("[alt_main.c] Done alt_sys_init.\r\n"); - -#if !defined(ALT_USE_DIRECT_DRIVERS) && (defined(ALT_STDIN_PRESENT) || defined(ALT_STDOUT_PRESENT) || defined(ALT_STDERR_PRESENT)) - - /* - * Redirect stdio to the apropriate devices now that the devices have - * been initialized. This is only done if the user has requested these - * devices be present (not equal to /dev/null) and if direct drivers - * aren't being used. - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Redirecting IO.\r\n"); - alt_io_redirect(ALT_STDOUT, ALT_STDIN, ALT_STDERR); -#endif - -#ifndef ALT_NO_C_PLUS_PLUS - /* - * Call the C++ constructors - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Calling C++ constructors.\r\n"); - _do_ctors (); -#endif /* ALT_NO_C_PLUS_PLUS */ - -#if !defined(ALT_NO_C_PLUS_PLUS) && !defined(ALT_NO_CLEAN_EXIT) && !defined(ALT_NO_EXIT) - /* - * Set the C++ destructors to be called at system shutdown. This is only done - * if a clean exit has been requested (i.e. the exit() function has not been - * redefined as _exit()). This is in the interest of reducing code footprint, - * in that the atexit() overhead is removed when it's not needed. - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Calling atexit.\r\n"); - atexit (_do_dtors); -#endif - - /* - * Finally, call main(). The return code is then passed to a subsequent - * call to exit() unless the application is never supposed to exit. - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Calling main.\r\n"); - -#ifdef ALT_NO_EXIT - main (alt_argc, alt_argv, alt_envp); -#else - result = main (alt_argc, alt_argv, alt_envp); - close(STDOUT_FILENO); - exit (result); -#endif - - ALT_LOG_PRINT_BOOT("[alt_main.c] After main - we should not be here?.\r\n"); -} - diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_malloc_lock.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_malloc_lock.c deleted file mode 100644 index 8c78f46..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_malloc_lock.c +++ /dev/null @@ -1,52 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -/* - * These are the empty malloc lock/unlock stubs required by newlib. These are - * used to make newlib's malloc() function thread safe. The default HAL - * configuration is single threaded, so there is nothing to do here. Note that - * this requires that malloc is never called by an interrupt service routine. - */ - -void __malloc_lock ( struct _reent *_r ) -{ -} - -/* - * - */ - -void __malloc_unlock ( struct _reent *_r ) -{ -} diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_mcount.S b/software/qsys_tutorial_key3_bsp/HAL/src/alt_mcount.S deleted file mode 100644 index 3837523..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_mcount.S +++ /dev/null @@ -1,198 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2010 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* mcount or _mcount is inserted by GCC before the function prologue of every - * function when a program is compiled for profiling. At the start of mcount, - * we guarantee that: - * ra = self_pc (an address in the function which called mcount) - * r8 = from_pc (an address in the function which called mcount's caller) - * - * Because this is always called at the start of a function we can corrupt - * r2,r3 and r11-r15. We must not corrupt r4-r7 (because they might contain - * function arguments for the instrumented function) or r8 (which holds ra - * for the instrumented function). - */ - - .global __mcount_fn_head - - .global mcount - - /* _mcount is used by gcc4 */ - .global _mcount - -_mcount: -mcount: - /* Use a hash to speed up locating fn_entry. We use bits 5 upwards to choose - * the bucket because bits 1:0 will always be 0, and because the distribution - * of values for bits 4:2 won't be even (aligning on cache line boundaries - * will skew it). Higher bits should be fairly random. - */ - /* fn_head = mcount_fn_head + (((unsigned int)self_pc >> 5) & (HASH_BUCKETS - 1)); */ - - srli r2, ra, 3 - movhi r3, %hiadj(__mcount_fn_head) - addi r3, r3, %lo(__mcount_fn_head) - andi r2, r2, 0xFC - add r11, r2, r3 - - /* The fast case is where we have already allocated a function arc, and so - * also a function pointer. - */ - - /* First find the function being called (using self_pc) */ - mov r10, r11 -0: - ldw r10, 0(r10) - beq r10, zero, .Lnew_arc - ldw r2, 4(r10) - bne r2, ra, 0b - - /* Found a function entry for this PC. Now look for an arc with a matching - * from_pc value. There will always be at least one arc. */ - ldw r3, 8(r10) -0: - ldw r2, 4(r3) - beq r2, r8, .Lfound_arc - ldw r3, 0(r3) - bne r3, zero, 0b - -.Lnew_arc: - addi sp, sp, -24 - -.LCFI0: - stw ra, 0(sp) - stw r4, 4(sp) - stw r5, 8(sp) - stw r6, 12(sp) - stw r7, 16(sp) - stw r8, 20(sp) - -.LCFI1: - /* __mcount_record(orig_ra, orig_r8, fn_entry, *fn_head); */ - mov r4, ra - mov r5, r8 - mov r6, r10 - mov r7, r11 - call __mcount_record - - /* restore registers from the stack */ - ldw ra, 0(sp) - ldw r4, 4(sp) - ldw r5, 8(sp) - ldw r6, 12(sp) - ldw r7, 16(sp) - ldw r8, 20(sp) - - addi sp, sp, 24 - -.LCFI2: - ret - -.Lfound_arc: - /* We've found the correct arc record. Increment the count and return */ - ldw r2, 8(r3) - addi r2, r2, 1 - stw r2, 8(r3) - ret - -.Lmcount_end: - - - -/* - * Dwarf2 debug information for the function. This provides GDB with the - * information it needs to backtrace out of this function. - */ - - .section .debug_frame,"",@progbits -.LCIE: - .4byte 2f - 1f /* Length */ -1: - .4byte 0xffffffff /* CIE id */ - .byte 0x1 /* Version */ - .string "" /* Augmentation */ - .uleb128 0x1 /* Code alignment factor */ - .sleb128 -4 /* Data alignment factor */ - .byte 0x1f /* Return address register */ - - .byte 0xc /* Define CFA */ - .uleb128 0x1b /* Register 27 (sp) */ - .uleb128 0x0 /* Offset 0 */ - - .align 2 /* Padding */ -2: - -.LFDE_mcount: - .4byte 2f - 1f /* Length */ -1: - .4byte .LCIE /* Pointer to CIE */ - .4byte mcount /* Start of table entry */ - .4byte .Lmcount_end - mcount /* Size of table entry */ - - .byte 0x4 /* Advance location */ - .4byte .LCFI0 - mcount /* to .LCFI0 */ - .byte 0xe /* Define CFA offset */ - .uleb128 24 /* to 24 */ - - .byte 0x4 /* Advance location */ - .4byte .LCFI1 - .LCFI0 /* to .LCFI1 */ - .byte 0x9f /* Store ra */ - .uleb128 0x6 /* at CFA-24 */ - .byte 0x84 /* Store r4 */ - .uleb128 0x5 /* at CFA-20 */ - .byte 0x85 /* Store r5 */ - .uleb128 0x4 /* at CFA-16 */ - .byte 0x86 /* Store r6 */ - .uleb128 0x3 /* at CFA-12 */ - .byte 0x87 /* Store r7 */ - .uleb128 0x2 /* at CFA-8 */ - .byte 0x88 /* Store r8 */ - .uleb128 0x1 /* at CFA-4 */ - - .byte 0x4 /* Advance location */ - .4byte .LCFI2 - .LCFI1 /* to .LCFI2 */ - .byte 0xe /* Define CFA offset */ - .uleb128 0 /* to 0 */ - .byte 0x8 /* Same value */ - .uleb128 31 /* for ra */ - .byte 0x8 /* Same value */ - .uleb128 4 /* for r4 */ - .byte 0x8 /* Same value */ - .uleb128 5 /* for r5 */ - .byte 0x8 /* Same value */ - .uleb128 6 /* for r6 */ - .byte 0x8 /* Same value */ - .uleb128 7 /* for r7 */ - .byte 0x8 /* Same value */ - .uleb128 8 /* for r8 */ - - .align 2 -2: - diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_open.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_open.c deleted file mode 100644 index 4790f53..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_open.c +++ /dev/null @@ -1,173 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "alt_types.h" -#include "os/alt_syscall.h" - -#ifdef ALT_USE_DIRECT_DRIVERS - -int ALT_OPEN (const char* file, int flags, int mode) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(open); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -extern alt_llist alt_dev_list; - -/* - * alt_file_locked() is used by open() to ensure that a device has not been - * previously locked for exclusive access using ioctl(). This test is only - * performed for devices. Filesystems are required to handle the ioctl() call - * themselves, and report the error from the filesystems open() function. - */ - -static int alt_file_locked (alt_fd* fd) -{ - alt_u32 i; - - /* - * Mark the file descriptor as belonging to a device. - */ - - fd->fd_flags |= ALT_FD_DEV; - - /* - * Loop through all current file descriptors searching for one that's locked - * for exclusive access. If a match is found, generate an error. - */ - - for (i = 0; i <= alt_max_fd; i++) - { - if ((alt_fd_list[i].dev == fd->dev) && - (alt_fd_list[i].fd_flags & ALT_FD_EXCL) && - (&alt_fd_list[i] != fd)) - { - return -EACCES; - } - } - - /* The device is not locked */ - - return 0; -} - -/* - * open() is called in order to get a file descriptor that reference the file - * or device named "name". This descriptor can then be used to manipulate the - * file/device using the standard system calls, e.g. write(), read(), ioctl() - * etc. - * - * This is equivalent to the standard open() system call. - * - * ALT_OPEN is mapped onto the open() system call in alt_syscall.h - */ - -int ALT_OPEN (const char* file, int flags, int mode) -{ - alt_dev* dev; - alt_fd* fd; - int index = -1; - int status = -ENODEV; - int isafs = 0; - - /* - * Check the device list, to see if a device with a matching name is - * registered. - */ - - if (!(dev = alt_find_dev (file, &alt_dev_list))) - { - /* No matching device, so try the filesystem list */ - - dev = alt_find_file (file); - isafs = 1; - } - - /* - * If a matching device or filesystem is found, allocate a file descriptor. - */ - - if (dev) - { - if ((index = alt_get_fd (dev)) < 0) - { - status = index; - } - else - { - fd = &alt_fd_list[index]; - fd->fd_flags = (flags & ~ALT_FD_FLAGS_MASK); - - /* If this is a device, ensure it isn't already locked */ - - if (isafs || ((status = alt_file_locked (fd)) >= 0)) - { - /* - * If the device or filesystem provides an open() callback function, - * call it now to perform any device/filesystem specific operations. - */ - - status = (dev->open) ? dev->open(fd, file, flags, mode): 0; - } - } - } - else - { - status = -ENODEV; - } - - /* Allocation failed, so clean up and return an error */ - - if (status < 0) - { - alt_release_fd (index); - ALT_ERRNO = -status; - return -1; - } - - /* return the reference upon success */ - - return index; -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_printf.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_printf.c deleted file mode 100644 index e742b57..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_printf.c +++ /dev/null @@ -1,127 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/* - * This file provides a very minimal printf implementation for use with very - * small applications. Only the following format strings are supported: - * %x - * %s - * %c - * %% - */ - -#include -#include "sys/alt_stdio.h" - -/* - * ALT printf function - */ -void -alt_printf(const char* fmt, ... ) -{ - va_list args; - va_start(args, fmt); - const char *w; - char c; - - /* Process format string. */ - w = fmt; - while ((c = *w++) != 0) - { - /* If not a format escape character, just print */ - /* character. Otherwise, process format string. */ - if (c != '%') - { - alt_putchar(c); - } - else - { - /* Get format character. If none */ - /* available, processing is complete. */ - if ((c = *w++) != 0) - { - if (c == '%') - { - /* Process "%" escape sequence. */ - alt_putchar(c); - } - else if (c == 'c') - { - int v = va_arg(args, int); - alt_putchar(v); - } - else if (c == 'x') - { - /* Process hexadecimal number format. */ - unsigned long v = va_arg(args, unsigned long); - unsigned long digit; - int digit_shift; - - /* If the number value is zero, just print and continue. */ - if (v == 0) - { - alt_putchar('0'); - continue; - } - - /* Find first non-zero digit. */ - digit_shift = 28; - while (!(v & (0xF << digit_shift))) - digit_shift -= 4; - - /* Print digits. */ - for (; digit_shift >= 0; digit_shift -= 4) - { - digit = (v & (0xF << digit_shift)) >> digit_shift; - if (digit <= 9) - c = '0' + digit; - else - c = 'a' + digit - 10; - alt_putchar(c); - } - } - else if (c == 's') - { - /* Process string format. */ - char *s = va_arg(args, char *); - - while(*s) - alt_putchar(*s++); - } - } - else - { - break; - } - } - } -} diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_putchar.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_putchar.c deleted file mode 100644 index badaa02..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_putchar.c +++ /dev/null @@ -1,59 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#ifdef ALT_USE_DIRECT_DRIVERS -#include "system.h" -#include "sys/alt_driver.h" -#include "sys/alt_stdio.h" -#endif - -/* - * Uses the ALT_DRIVER_WRITE() macro to call directly to driver if available. - * Otherwise, uses newlib provided putchar() routine. - */ -int -alt_putchar(int c) -{ -#ifdef ALT_USE_DIRECT_DRIVERS - ALT_DRIVER_WRITE_EXTERNS(ALT_STDOUT_DEV); - char c1 = (char)(c & 0xff); - - if (ALT_DRIVER_WRITE(ALT_STDOUT_DEV, &c1, 1, 0) == -1) { - return -1; - } - return c; -#else - return putchar(c); -#endif -} diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_putstr.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_putstr.c deleted file mode 100644 index 5345945..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_putstr.c +++ /dev/null @@ -1,55 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#ifdef ALT_USE_DIRECT_DRIVERS -#include -#include "system.h" -#include "sys/alt_driver.h" -#include "sys/alt_stdio.h" -#endif - -/* - * Uses the ALT_DRIVER_WRITE() macro to call directly to driver if available. - * Otherwise, uses newlib provided fputs() routine. - */ -int -alt_putstr(const char* str) -{ -#ifdef ALT_USE_DIRECT_DRIVERS - ALT_DRIVER_WRITE_EXTERNS(ALT_STDOUT_DEV); - return ALT_DRIVER_WRITE(ALT_STDOUT_DEV, str, strlen(str), 0); -#else - return fputs(str, stdout); -#endif -} diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_read.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_read.c deleted file mode 100644 index 1c89777..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_read.c +++ /dev/null @@ -1,125 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -/* - * The read() system call is used to read a block of data from a file or device. - * This function simply vectors the request to the device driver associated - * with the input file descriptor "file". - * - * ALT_READ is mapped onto the read() system call in alt_syscall.h - */ - -#ifdef ALT_USE_DIRECT_DRIVERS - -#include "system.h" -#include "sys/alt_driver.h" - -/* - * Provide minimal version that just reads from the stdin device when provided. - */ - -int ALT_READ (int file, void *ptr, size_t len) -{ -#ifdef ALT_STDIN_PRESENT - ALT_DRIVER_READ_EXTERNS(ALT_STDIN_DEV); -#endif - -#if !defined(ALT_STDIN_PRESENT) - /* Generate a link time warning, should this function ever be called. */ - ALT_STUB_WARNING(read); -#endif - - switch (file) { -#ifdef ALT_STDIN_PRESENT - case 0: /* stdin file descriptor */ - return ALT_DRIVER_READ(ALT_STDIN_DEV, ptr, len, 0); -#endif /* ALT_STDIN_PRESENT */ - default: - ALT_ERRNO = EBADFD; - return -1; - } -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -int ALT_READ (int file, void *ptr, size_t len) -{ - alt_fd* fd; - int rval; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - /* - * If the file has not been opened with read access, or if the driver does - * not provide an implementation of read(), generate an error. Otherwise - * call the drivers read() function to process the request. - */ - - if (((fd->fd_flags & O_ACCMODE) != O_WRONLY) && - (fd->dev->read)) - { - if ((rval = fd->dev->read(fd, ptr, len)) < 0) - { - ALT_ERRNO = -rval; - return -1; - } - return rval; - } - else - { - ALT_ERRNO = EACCES; - } - } - else - { - ALT_ERRNO = EBADFD; - } - return -1; -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_release_fd.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_release_fd.c deleted file mode 100644 index 84733a7..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_release_fd.c +++ /dev/null @@ -1,54 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - -/* - * alt_release_fd() is called to free an allocated file descriptor. This is - * done by setting the device pointer in the file descriptor structure to zero. - * - * File descriptors correcponding to standard in, standard out and standard - * error cannont be released backed to the pool. They are always reserved. - */ - -void alt_release_fd (int fd) -{ - if (fd > 2) - { - alt_fd_list[fd].fd_flags = 0; - alt_fd_list[fd].dev = 0; - } -} - - - diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_remap_cached.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_remap_cached.c deleted file mode 100644 index f61cb9c..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_remap_cached.c +++ /dev/null @@ -1,50 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003,2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "sys/alt_cache.h" -#include "system.h" - -#ifdef NIOS2_MMU_PRESENT -/* Convert KERNEL region address to IO region address */ -#define BYPASS_DCACHE_MASK (0x1 << 29) -#else -/* Set bit 31 of address to bypass D-cache */ -#define BYPASS_DCACHE_MASK (0x1 << 31) -#endif - -/* - * Convert a pointer to a block of uncached memory, into a block of - * cached memory. - */ - -void* alt_remap_cached (volatile void* ptr, alt_u32 len) -{ - return (void*) (((alt_u32) ptr) & ~BYPASS_DCACHE_MASK); -} diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_remap_uncached.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_remap_uncached.c deleted file mode 100644 index 7ff6302..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_remap_uncached.c +++ /dev/null @@ -1,51 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003,2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "sys/alt_cache.h" -#include "system.h" - -#ifdef NIOS2_MMU_PRESENT -/* Convert KERNEL region address to IO region address */ -#define BYPASS_DCACHE_MASK (0x1 << 29) -#else -/* Set bit 31 of address to bypass D-cache */ -#define BYPASS_DCACHE_MASK (0x1 << 31) -#endif - -/* - * Convert a pointer to a block of cached memory, into a block of - * uncached memory. - */ - -volatile void* alt_remap_uncached (void* ptr, alt_u32 len) -{ - alt_dcache_flush (ptr, len); - return (volatile void*) (((alt_u32) ptr) | BYPASS_DCACHE_MASK); -} diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_rename.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_rename.c deleted file mode 100644 index 48afac0..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_rename.c +++ /dev/null @@ -1,55 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "os/alt_syscall.h" - -/* - * _rename() is used by newlib to rename an existing file. This is unsupported - * in the HAL environment. However a "do-nothing" implementation is still - * provied for newlib compatability. - * - * ALT_RENAME is mapped onto the _rename() system call in alt_syscall.h - */ - -int ALT_RENAME (char *existing, char *new) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(_rename); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_sbrk.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_sbrk.c deleted file mode 100644 index b8c3799..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_sbrk.c +++ /dev/null @@ -1,136 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "os/alt_syscall.h" - -#include "sys/alt_irq.h" -#include "sys/alt_stack.h" - -#include "system.h" - -/* - * sbrk() is called to dynamically extend the data segment for the application. - * Thie input argument "incr" is the size of the block to allocate. - * - * This simple implementation does not perform any bounds checking. Memory will - * be allocated, even if the request region colides with the stack or overflows - * the available physical memory. - * - * ALT_SBRK is mapped onto the sbrk() system call in alt_syscall.h - * - * This function is called by the profiling code to allocate memory so must be - * safe if called from an interrupt context. It must also not be instrumented - * because that would lead to an infinate loop. - */ - -extern char __alt_heap_start[]; /* set by linker */ -extern char __alt_heap_limit[]; /* set by linker */ - -static char *heap_end = __alt_heap_start; - -#if defined(ALT_EXCEPTION_STACK) && defined(ALT_STACK_CHECK) -char * alt_exception_old_stack_limit = NULL; -#endif - -caddr_t ALT_SBRK (int incr) __attribute__ ((no_instrument_function )); - -caddr_t ALT_SBRK (int incr) -{ - alt_irq_context context; - char *prev_heap_end; - - context = alt_irq_disable_all(); - - /* Always return data aligned on a word boundary */ - heap_end = (char *)(((unsigned int)heap_end + 3) & ~3); - -#ifdef ALT_MAX_HEAP_BYTES - /* - * User specified a maximum heap size. Return -1 if it would - * be exceeded by this sbrk call. - */ - if (((heap_end + incr) - __alt_heap_start) > ALT_MAX_HEAP_BYTES) { - alt_irq_enable_all(context); - return (caddr_t)-1; - } -#else - if ((heap_end + incr) > __alt_heap_limit) { - alt_irq_enable_all(context); - return (caddr_t)-1; - } -#endif - - prev_heap_end = heap_end; - heap_end += incr; - -#ifdef ALT_STACK_CHECK - /* - * If the stack and heap are contiguous then extending the heap reduces the - * space available for the stack. If we are still using the default stack - * then adjust the stack limit to note this, while checking for stack - * pointer overflow. - * If the stack limit isn't pointing at the top of the heap then the code - * is using a different stack so none of this needs to be done. - */ - - if (alt_stack_limit() == prev_heap_end) - { - if (alt_stack_pointer() <= heap_end) - alt_report_stack_overflow(); - - alt_set_stack_limit(heap_end); - } - -#ifdef ALT_EXCEPTION_STACK - /* - * If we are executing from the exception stack then compare against the - * stack we switched away from as well. The exception stack is a fixed - * size so doesn't need to be checked. - */ - - if (alt_exception_old_stack_limit == prev_heap_end) - { - if (alt_exception_old_stack_limit <= heap_end) - alt_report_stack_overflow(); - - alt_exception_old_stack_limit = heap_end; - } -#endif - -#endif - - alt_irq_enable_all(context); - - return (caddr_t) prev_heap_end; -} diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_settod.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_settod.c deleted file mode 100644 index 59db0f8..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_settod.c +++ /dev/null @@ -1,96 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include "sys/alt_errno.h" -#include "sys/alt_alarm.h" -#include "os/alt_syscall.h" - -/* - * "alt_timezone" and "alt_resettime" are the values of the the reset time and - * time zone set through the last call to settimeofday(). By default they are - * zero initialised. - */ - -extern struct timezone alt_timezone; -extern struct timeval alt_resettime; - -/* - * Macro defining the number of micoseconds in a second. - */ - -#define ALT_US (1000000) - - -/* - * settimeofday() can be called to calibrate the system clock, so that - * subsequent calls to gettimeofday() will return the elapsed "wall clock" - * time. - * - * This is done by updating the global structures "alt_resettime" and - * "alt_timezone" so that an immediate call to gettimeofday() would return - * the value specified by "t" and "tz". - * - * Warning: if this function is called concurrently with a call to - * gettimeofday(), the value returned by gettimeofday() will be unreliable. - * - * ALT_SETTIMEOFDAY is mapped onto the settimeofday() system call in - * alt_syscall.h - */ - -int ALT_SETTIMEOFDAY (const struct timeval *t, - const struct timezone *tz) -{ - alt_u32 nticks = alt_nticks (); - alt_u32 tick_rate = alt_ticks_per_second (); - - /* If there is a system clock available, update the current time */ - - if (tick_rate) - { - alt_resettime.tv_sec = t->tv_sec - nticks/tick_rate; - alt_resettime.tv_usec = t->tv_usec - - ((nticks*(ALT_US/tick_rate))%ALT_US); - - alt_timezone.tz_minuteswest = tz->tz_minuteswest; - alt_timezone.tz_dsttime = tz->tz_dsttime; - - return 0; - } - - /* There's no system clock available */ - - ALT_ERRNO = ENOSYS; - return -1; -} diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_software_exception.S b/software/qsys_tutorial_key3_bsp/HAL/src/alt_software_exception.S deleted file mode 100644 index 2142594..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_software_exception.S +++ /dev/null @@ -1,53 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - - /* - * This file provides the global symbol: software_exception. It is provided to - * support legacy code, and should not be used by new software. - * - * It is used by legacy code to invoke the software exception handler as - * defined by version 1.0 of the Nios II kit. It should only be used when you - * are providing your own interrupt entry point, i.e. you are not using - * alt_irq_entry. - */ - -#include "system.h" - - /* - * Pull in the exception handler. - */ - - .globl alt_exception - - .section .exceptions.entry.label, "xa" - - .globl software_exception - .type software_exception, @function -software_exception: diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_stat.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_stat.c deleted file mode 100644 index 44e207b..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_stat.c +++ /dev/null @@ -1,59 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include -#include - -#include "os/alt_syscall.h" - -/* - * The stat() function is similar to the fstat() function in that it is used to - * obtain status information about a file. Instead of using an open file - * descriptor (like fstat()), stat() takes the name of a file as an input - * argument. - * - * ALT_STAT is mapped onto the stat() system call in alt_syscall.h - */ - -int ALT_STAT (const char *file, struct stat *st) -{ - int fd; - int rc; - - fd = open (file, 0); - rc = fstat (fd, st); - close (fd); - - return rc; -} diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_tick.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_tick.c deleted file mode 100644 index c73488d..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_tick.c +++ /dev/null @@ -1,149 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_irq.h" -#include "sys/alt_alarm.h" -#include "os/alt_hooks.h" -#include "alt_types.h" - -/* - * "_alt_tick_rate" is used to store the value of the system clock frequency - * in ticks per second. It is initialised to zero, which corresponds to there - * being no system clock facility available. - */ - -alt_u32 _alt_tick_rate = 0; - -/* - * "_alt_nticks" is the number of system clock ticks that have elapsed since - * reset. - */ - -volatile alt_u32 _alt_nticks = 0; - -/* - * "alt_alarm_list" is the head of a linked list of registered alarms. This is - * initialised to be an empty list. - */ - -ALT_LLIST_HEAD(alt_alarm_list); - -/* - * alt_alarm_stop() is called to remove an alarm from the list of registered - * alarms. Alternatively an alarm can unregister itself by returning zero when - * the alarm executes. - */ - -void alt_alarm_stop (alt_alarm* alarm) -{ - alt_irq_context irq_context; - - irq_context = alt_irq_disable_all(); - alt_llist_remove (&alarm->llist); - alt_irq_enable_all (irq_context); -} - -/* - * alt_tick() is periodically called by the system clock driver in order to - * process the registered list of alarms. Each alarm is registed with a - * callback interval, and a callback function, "callback". - * - * The return value of the callback function indicates how many ticks are to - * elapse until the next callback. A return value of zero indicates that the - * alarm should be deactivated. - * - * alt_tick() is expected to run at interrupt level. - */ - -void alt_tick (void) -{ - alt_alarm* next; - alt_alarm* alarm = (alt_alarm*) alt_alarm_list.next; - - alt_u32 next_callback; - - /* update the tick counter */ - - _alt_nticks++; - - /* process the registered callbacks */ - - while (alarm != (alt_alarm*) &alt_alarm_list) - { - next = (alt_alarm*) alarm->llist.next; - - /* - * Upon the tick-counter rolling over it is safe to clear the - * roll-over flag; once the flag is cleared this (or subsequnt) - * tick events are enabled to generate an alarm event. - */ - if ((alarm->rollover) && (_alt_nticks == 0)) - { - alarm->rollover = 0; - } - - /* if the alarm period has expired, make the callback */ - if ((alarm->time <= _alt_nticks) && (alarm->rollover == 0)) - { - next_callback = alarm->callback (alarm->context); - - /* deactivate the alarm if the return value is zero */ - - if (next_callback == 0) - { - alt_alarm_stop (alarm); - } - else - { - alarm->time += next_callback; - - /* - * If the desired alarm time causes a roll-over, set the rollover - * flag. This will prevent the subsequent tick event from causing - * an alarm too early. - */ - if(alarm->time < _alt_nticks) - { - alarm->rollover = 1; - } - } - } - alarm = next; - } - - /* - * Update the operating system specific timer facilities. - */ - - ALT_OS_TIME_TICK(); -} - diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_times.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_times.c deleted file mode 100644 index 4dd965d..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_times.c +++ /dev/null @@ -1,71 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "sys/alt_errno.h" -#include "sys/alt_alarm.h" -#include "os/alt_syscall.h" - -/* - * The times() function is used by newlib to obtain elapsed time information. - * The return value is the elapsed time since reset in system clock ticks. Note - * that this is distinct from the strict Posix version of times(), which should - * return the time since: 0 hours, 0 minutes, 0 seconds, January 1, 1970, GMT. - * - * The input structure is filled in with time accounting information. This - * implementation attributes all cpu time to the system. - * - * ALT_TIMES is mapped onto the times() system call in alt_syscall.h - */ - -clock_t ALT_TIMES (struct tms *buf) -{ - clock_t ticks = alt_nticks(); - - /* If there is no system clock present, generate an error */ - - if (!alt_ticks_per_second()) - { - ALT_ERRNO = ENOSYS; - return 0; - } - - /* Otherwise return the elapsed time */ - - buf->tms_utime = 0; - buf->tms_stime = ticks; - buf->tms_cutime = 0; - buf->tms_cstime = 0; - - return ticks; -} diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_uncached_free.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_uncached_free.c deleted file mode 100644 index 6e362ba..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_uncached_free.c +++ /dev/null @@ -1,49 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003,2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "sys/alt_cache.h" -#include "system.h" - -#ifdef NIOS2_MMU_PRESENT -/* Convert KERNEL region address to IO region address */ -#define BYPASS_DCACHE_MASK (0x1 << 29) -#else -/* Set bit 31 of address to bypass D-cache */ -#define BYPASS_DCACHE_MASK (0x1 << 31) -#endif - -/* - * Free a block of uncached memory. - */ - -void alt_uncached_free (volatile void* ptr) -{ - free ((void*) (((alt_u32) ptr) & ~BYPASS_DCACHE_MASK)); -} diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_uncached_malloc.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_uncached_malloc.c deleted file mode 100644 index ab3416d..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_uncached_malloc.c +++ /dev/null @@ -1,55 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003,2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "sys/alt_cache.h" -#include "system.h" - -#ifdef NIOS2_MMU_PRESENT -/* Convert KERNEL region address to IO region address */ -#define BYPASS_DCACHE_MASK (0x1 << 29) -#else -/* Set bit 31 of address to bypass D-cache */ -#define BYPASS_DCACHE_MASK (0x1 << 31) -#endif - -/* - * Allocate a block of uncached memory. - */ - -volatile void* alt_uncached_malloc (size_t size) -{ - void* ptr; - - ptr = malloc (size); - - alt_dcache_flush (ptr, size); - - return ptr ? (volatile void*) (((alt_u32) ptr) | BYPASS_DCACHE_MASK) : NULL; -} diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_unlink.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_unlink.c deleted file mode 100644 index 29e35d6..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_unlink.c +++ /dev/null @@ -1,55 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "os/alt_syscall.h" - -/* - * unlink() is used by newlib to delete an existing link to a file. This is - * unsupported in the HAL environment. However a "do-nothing" implementation - * is still provied for newlib compatability. - * - * ALT_UNLINK is mapped onto the unlink() system call in alt_syscall.h - */ - -int ALT_UNLINK (char *name) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(unlink); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_usleep.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_usleep.c deleted file mode 100644 index 2330eb8..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_usleep.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2003 Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - * - * ------------ - * - * Altera does not recommend, suggest or require that this reference design - * file be used in conjunction or combination with any other product. - * - * usleep.c - Microsecond delay routine - */ - -#include - -#include "priv/alt_busy_sleep.h" -#include "os/alt_syscall.h" - -/* - * This function simply calls alt_busy_sleep() to perform the delay. This - * function implements the delay as a calibrated "busy loop". - * - * ALT_USLEEP is mapped onto the usleep() system call in alt_syscall.h - */ - - - -#if defined (__GNUC__) && __GNUC__ >= 4 -int ALT_USLEEP (useconds_t us) -#else -unsigned int ALT_USLEEP (unsigned int us) -#endif -{ - return alt_busy_sleep(us); -} diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_wait.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_wait.c deleted file mode 100644 index a42f80f..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_wait.c +++ /dev/null @@ -1,52 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_errno.h" -#include "os/alt_syscall.h" - -/* - * wait() is used by newlib to wait for all child processes to exit. Since the - * HAL does not support spawning child processes, this returns immediately as - * there can't be anythign to wait for. - * - * ALT_WAIT is mapped onto the wait() system call in alt_syscall.h - */ - -int ALT_WAIT (int *status) -{ - *status = 0; - - ALT_ERRNO = ECHILD; - - return -1; -} - diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/alt_write.c b/software/qsys_tutorial_key3_bsp/HAL/src/alt_write.c deleted file mode 100644 index 51debb5..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/alt_write.c +++ /dev/null @@ -1,138 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -#include "sys/alt_log_printf.h" - -/* - * The write() system call is used to write a block of data to a file or - * device. This function simply vectors the request to the device driver - * associated with the input file descriptor "file". - * - * ALT_WRITE is mapped onto the write() system call in alt_syscall.h - */ - -#ifdef ALT_USE_DIRECT_DRIVERS - -#include "system.h" -#include "sys/alt_driver.h" - -/* - * Provide minimal version that just writes to the stdout/stderr devices - * when provided. - */ - -int ALT_WRITE (int file, const void *ptr, size_t len) -{ -#ifdef ALT_STDOUT_PRESENT - ALT_DRIVER_WRITE_EXTERNS(ALT_STDOUT_DEV); -#endif -#ifdef ALT_STDERR_PRESENT - ALT_DRIVER_WRITE_EXTERNS(ALT_STDERR_DEV); -#endif - -#if !defined(ALT_STDOUT_PRESENT) && !defined(ALT_STDERR_PRESENT) - /* Generate a link time warning, should this function ever be called. */ - ALT_STUB_WARNING(write); -#endif - - switch (file) { -#ifdef ALT_STDOUT_PRESENT - case 1: /* stdout file descriptor */ - return ALT_DRIVER_WRITE(ALT_STDOUT_DEV, ptr, len, 0); -#endif /* ALT_STDOUT_PRESENT */ -#ifdef ALT_STDERR_PRESENT - case 2: /* stderr file descriptor */ - return ALT_DRIVER_WRITE(ALT_STDERR_DEV, ptr, len, 0); -#endif /* ALT_STDERR_PRESENT */ - default: - ALT_ERRNO = EBADFD; - return -1; - } -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -int ALT_WRITE (int file, const void *ptr, size_t len) -{ - alt_fd* fd; - int rval; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - /* - * If the file has not been opened with write access, or if the driver does - * not provide an implementation of write(), generate an error. Otherwise - * call the drivers write() function to process the request. - */ - - if (((fd->fd_flags & O_ACCMODE) != O_RDONLY) && fd->dev->write) - { - - /* ALT_LOG - see altera_hal/HAL/inc/sys/alt_log_printf.h */ - ALT_LOG_WRITE_FUNCTION(ptr,len); - - if ((rval = fd->dev->write(fd, ptr, len)) < 0) - { - ALT_ERRNO = -rval; - return -1; - } - return rval; - } - else - { - ALT_ERRNO = EACCES; - } - } - else - { - ALT_ERRNO = EBADFD; - } - return -1; -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/altera_nios2_qsys_irq.c b/software/qsys_tutorial_key3_bsp/HAL/src/altera_nios2_qsys_irq.c deleted file mode 100644 index c7a4f93..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/altera_nios2_qsys_irq.c +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2009 Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - * - * altera_nios2_irq.c - Support for Nios II internal interrupt controller. - * - */ - -#include "sys/alt_irq.h" -#include "altera_nios2_qsys_irq.h" - -/* - * To initialize the internal interrupt controller, just clear the IENABLE - * register so that all possible IRQs are disabled. - */ -void altera_nios2_qsys_irq_init(void) -{ - NIOS2_WRITE_IENABLE(0); -} diff --git a/software/qsys_tutorial_key3_bsp/HAL/src/crt0.S b/software/qsys_tutorial_key3_bsp/HAL/src/crt0.S deleted file mode 100644 index 582445d..0000000 --- a/software/qsys_tutorial_key3_bsp/HAL/src/crt0.S +++ /dev/null @@ -1,456 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "system.h" -#include "nios2.h" - -/* Setup header files to work with assembler code. */ -#define ALT_ASM_SRC - -/* Debug logging facility */ -#include "sys/alt_log_printf.h" - -/*************************************************************************\ -| MACROS | -\*************************************************************************/ - -/* - * The new build tools explicitly define macros when alt_load() - * must be called. The define ALT_LOAD_EXPLICITLY_CONTROLLED tells us that - * those macros are controlling if alt_load() needs to be called. - */ -#ifdef ALT_LOAD_EXPLICITLY_CONTROLLED - -/* Need to call alt_load() if any of these sections are being copied. */ -#if defined(ALT_LOAD_COPY_RODATA) || defined(ALT_LOAD_COPY_RWDATA) || defined(ALT_LOAD_COPY_EXCEPTIONS) -#define CALL_ALT_LOAD -#endif - -#else /* !ALT_LOAD_EXPLICITLY_CONTROLLED */ - -/* - * The legacy build tools use the following macros to detect when alt_load() - * needs to be called. - */ - -#define __ALT_LOAD_SECTIONS(res, text, rodata, exc) \ - ((res##_BASE != rodata##_BASE) || \ - (res##_BASE != rwdata##_BASE) || \ - (res##_BASE != exc##_BASE)) - -#define _ALT_LOAD_SECTIONS(res, text, rodata, exc) \ - __ALT_LOAD_SECTIONS(res, text, rodata, exc) - -#define ALT_LOAD_SECTIONS _ALT_LOAD_SECTIONS(ALT_RESET_DEVICE, \ - ALT_RODATA_DEVICE, \ - ALT_RWDATA_DEVICE, \ - ALT_EXCEPTIONS_DEVICE) - -/* Call alt_load() if there is no bootloader and ALT_LOAD_SECTIONS isn't 0. */ -#if defined(ALT_NO_BOOTLOADER) && ALT_LOAD_SECTIONS -#define CALL_ALT_LOAD -#endif - -#endif /* !ALT_LOAD_EXPLICITLY_CONTROLLED */ - -/* - * When the legacy build tools define a macro called ALT_NO_BOOTLOADER, - * it indicates that initialization code is allowed at the reset address. - * The new build tools define a macro called ALT_ALLOW_CODE_AT_RESET for - * the same purpose. - */ -#ifdef ALT_NO_BOOTLOADER -#define ALT_ALLOW_CODE_AT_RESET -#endif - -/*************************************************************************\ -| EXTERNAL REFERENCES | -\*************************************************************************/ - -/* - * The entry point for user code is either "main" in hosted mode, or - * "alt_main" in standalone mode. These are explicitly referenced here, - * to ensure they are built into the executable. This allows the user - * to build them into libraries, rather than supplying them in object - * files at link time. - */ - .globl main - .globl alt_main - -/* - * Create a reference to the software multiply/divide and trap handers, - * so that if they are provided, they will appear in the executable. - */ -#ifndef ALT_NO_INSTRUCTION_EMULATION - .globl alt_exception_muldiv -#endif -#ifdef ALT_TRAP_HANDLER - .globl alt_exception_trap -#endif - -/* - * Linker defined symbols used to initialize bss. - */ -.globl __bss_start -.globl __bss_end - -/*************************************************************************\ -| RESET SECTION (.entry) | -\*************************************************************************/ - -/* - * This is the reset entry point for Nios II. - * - * At reset, only the cache line which contain the reset vector is - * initialized by the hardware. The code within the first cache line - * initializes the remainder of the instruction cache. - */ - - .section .entry, "xa" - .align 5 - -/* - * Explicitly allow the use of r1 (the assembler temporary register) - * within this code. This register is normally reserved for the use of - * the assembler. - */ - .set noat - -/* - * Some tools want to know where the reset vector is. - * Code isn't always provided at the reset vector but at least the - * __reset label always contains the reset vector address because - * it is defined at the start of the .entry section. - */ - - .globl __reset - .type __reset, @function -__reset: - -/* - * Initialize the instruction cache if present (i.e. size > 0) and - * reset code is allowed unless optimizing for RTL simulation. - * RTL simulations can ensure the instruction cache is already initialized - * so skipping this loop speeds up RTL simulation. - */ - -#if NIOS2_ICACHE_SIZE > 0 && defined(ALT_ALLOW_CODE_AT_RESET) && !defined(ALT_SIM_OPTIMIZE) - /* Assume the instruction cache size is always a power of two. */ -#if NIOS2_ICACHE_SIZE > 0x8000 - movhi r2, %hi(NIOS2_ICACHE_SIZE) -#else - movui r2, NIOS2_ICACHE_SIZE -#endif - -0: - initi r2 - addi r2, r2, -NIOS2_ICACHE_LINE_SIZE - bgt r2, zero, 0b -1: - - /* - * The following debug information tells the ISS not to run the loop above - * but to perform its actions using faster internal code. - */ - .pushsection .debug_alt_sim_info - .int 1, 1, 0b, 1b - .popsection -#endif /* Initialize Instruction Cache */ - -/* - * Jump to the _start entry point in the .text section if reset code - * is allowed or if optimizing for RTL simulation. - */ -#if defined(ALT_ALLOW_CODE_AT_RESET) || defined(ALT_SIM_OPTIMIZE) - /* Jump to the _start entry point in the .text section. */ - movhi r1, %hi(_start) - ori r1, r1, %lo(_start) - jmp r1 - - .size __reset, . - __reset -#endif /* Jump to _start */ - -/* - * When not using exit, provide an _exit symbol to prevent unresolved - * references to _exit from the linker script. - */ -#ifdef ALT_NO_EXIT - .globl _exit -_exit: -#endif - -/*************************************************************************\ -| TEXT SECTION (.text) | -\*************************************************************************/ - -/* - * Start of the .text section, and also the code entry point when - * the code is executed by a bootloader rather than directly from reset. - */ - .section .text - .align 2 - - .globl _start - .type _start, @function -_start: - -/* - * Initialize the data cache if present (i.e. size > 0) and not - * optimizing for RTL simulation. - * RTL simulations can ensure the data cache is already initialized - * so skipping this loop speeds up RTL simulation. - */ - -#if NIOS2_DCACHE_SIZE > 0 && !defined(ALT_SIM_OPTIMIZE) - - /* Assume the data cache size is always a power of two. */ -#if NIOS2_DCACHE_SIZE > 0x8000 - movhi r2, %hi(NIOS2_DCACHE_SIZE) -#else - movui r2, NIOS2_DCACHE_SIZE -#endif - -0: - initd 0(r2) - addi r2, r2, -NIOS2_DCACHE_LINE_SIZE - bgt r2, zero, 0b -1: - - /* - * The following debug information tells the ISS not to run the loop above - * but to perform its actions using faster internal code. - */ - .pushsection .debug_alt_sim_info - .int 2, 1, 0b, 1b - .popsection - -#endif /* Initialize Data Cache */ - - /* Log that caches have been initialized. */ - ALT_LOG_PUTS(alt_log_msg_cache) - - /* Log that the stack pointer is about to be setup. */ - ALT_LOG_PUTS(alt_log_msg_stackpointer) - -#if (NIOS2_NUM_OF_SHADOW_REG_SETS == 0) - /* - * Now that the caches are initialized, set up the stack pointer. - * The value provided by the linker is assumed to be correctly aligned. - */ - movhi sp, %hi(__alt_stack_pointer) - ori sp, sp, %lo(__alt_stack_pointer) - - /* Set up the global pointer. */ - movhi gp, %hi(_gp) - ori gp, gp, %lo(_gp) - -#else /* NIOS2_NUM_OF_SHADOW_REG_SETS > 0 */ - - /* - * Set up the GP and SP in all shadow register sets. - */ - - /* - * Check current register set number, if CPU resets into a shadow register - * set, switch register set to 0 by writing zero to SSTATUS register and - * execute an ERET instruction that just jumps to the next PC address - * (use the NEXTPC instruction to get this). - */ - - rdctl r2, status - - /* Get the current register set number (STATUS.CRS). */ - andi r3, r2, NIOS2_STATUS_CRS_MSK - - /* Skip switch register set if STATUS.CRS is 0. */ - beq r3, zero, .Lskip_switch_reg_set - - .set nobreak - - /* Current register set is non-zero, set SSTATUS to 0. */ - mov sstatus, zero - - /* Get next pc and store in ea. */ - nextpc ea - - /* Point to instruction after eret. */ - addi ea, ea, 8 - - /* - * Execute ERET instruction that just jumps to the next PC address - */ - eret - -.Lskip_switch_reg_set: - mov r2, zero - - /* Reset STATUS register */ - wrctl status, r2 - - movui r3, NIOS2_NUM_OF_SHADOW_REG_SETS - - /* Set up the stack pointer in register set 0. */ - movhi sp, %hi(__alt_stack_pointer) - ori sp, sp, %lo(__alt_stack_pointer) - - /* Set up the global pointer in register set 0. */ - movhi gp, %hi(_gp) - ori gp, gp, %lo(_gp) - -.Lsetup_sp_and_gp_loop: - /* - * Setup GP and SP for shadow register set - * from NIOS2_NUM_OF_SHADOW_REG_SETS to 0 - */ - - /* Skip if number of register sets is 0. */ - beq r3, zero, .Lno_shadow_register_set - - - /* Add previous register set STATUS.PRS by 1 */ - movhi r4, 1 - add r2, r2, r4 - - /* Write STATUS */ - wrctl status, r2 - - /* Clear r0 in the shadow register set (not done by hardware) */ - wrprs r0, r0 - - /* Write the GP in previous register set */ - wrprs gp, gp - - /* Only write the SP in previous register set - * if using the seperate exception stack. For normal case (single stack), - * funnel code would read the SP from previous register set. - */ -#ifdef ALT_INTERRUPT_STACK - - movhi et, %hiadj(__alt_interrupt_stack_pointer) - addi et, et, %lo(__alt_interrupt_stack_pointer) - wrprs sp, et - -#endif /* ALT_INTERRUPT_STACK */ - - /* Decrease number of register set counter by 1 */ - addi r3, r3, -1 - - br .Lsetup_sp_and_gp_loop -.Lno_shadow_register_set: - -#endif /* NIOS2_NUM_OF_SHADOW_REG_SETS */ -/* - * Clear the BSS if not optimizing for RTL simulation. - * - * This uses the symbols: __bss_start and __bss_end, which are defined - * by the linker script. They mark the begining and the end of the bss - * region. The linker script guarantees that these values are word aligned. - */ -#ifndef ALT_SIM_OPTIMIZE - /* Log that the BSS is about to be cleared. */ - ALT_LOG_PUTS(alt_log_msg_bss) - - movhi r2, %hi(__bss_start) - ori r2, r2, %lo(__bss_start) - - movhi r3, %hi(__bss_end) - ori r3, r3, %lo(__bss_end) - - beq r2, r3, 1f - -0: - stw zero, (r2) - addi r2, r2, 4 - bltu r2, r3, 0b - -1: - - /* - * The following debug information tells the ISS not to run the loop above - * but to perform its actions using faster internal code. - */ - .pushsection .debug_alt_sim_info - .int 3, 1, 0b, 1b - .popsection -#endif /* ALT_SIM_OPTIMIZE */ - -/* - * The alt_load() facility is normally used when there is no bootloader. - * It copies some sections into RAM so it acts like a mini-bootloader. - */ -#ifdef CALL_ALT_LOAD - -#ifdef ALT_STACK_CHECK - /* - * If the user has selected stack checking then we need to set up a safe - * value in the stack limit register so that the relocation functions - * don't think the stack has overflowed (the contents of the rwdata - * section aren't defined until alt_load() has been called). - */ - mov et, zero -#endif - - call alt_load - -#endif /* CALL_ALT_LOAD */ - -#ifdef ALT_STACK_CHECK - /* - * Set up the stack limit (if required). The linker has set up the - * copy of the variable which is in memory. - */ - - ldw et, %gprel(alt_stack_limit_value)(gp) -#endif - - /* Log that alt_main is about to be called. */ - ALT_LOG_PUTS(alt_log_msg_alt_main) - - /* Call the C entry point. It should never return. */ - call alt_main - - /* Wait in infinite loop in case alt_main does return. */ -alt_after_alt_main: - br alt_after_alt_main - - .size _start, . - _start - -/* - * Add information about the stack base if stack overflow checking is enabled. - */ -#ifdef ALT_STACK_CHECK - .globl alt_stack_limit_value - .section .sdata,"aws",@progbits - .align 2 - .type alt_stack_limit_value, @object - .size alt_stack_limit_value, 4 -alt_stack_limit_value: - .long __alt_stack_limit -#endif diff --git a/software/qsys_tutorial_key3_bsp/Makefile b/software/qsys_tutorial_key3_bsp/Makefile deleted file mode 100644 index dcf3b22..0000000 --- a/software/qsys_tutorial_key3_bsp/Makefile +++ /dev/null @@ -1,766 +0,0 @@ -#------------------------------------------------------------------------------ -# BSP MAKEFILE -# -# This makefile was automatically generated by the nios2-bsp-generate-files -# command. Its purpose is to build a custom Board Support Package (BSP) -# targeting a specific Nios II processor in an SOPC Builder-based design. -# -# To create an application or library Makefile which uses this BSP, try the -# nios2-app-generate-makefile or nios2-lib-generate-makefile commands. -#------------------------------------------------------------------------------ - -#------------------------------------------------------------------------------ -# TOOLS -#------------------------------------------------------------------------------ - -MKDIR := mkdir -p -ECHO := echo -SPACE := $(empty) $(empty) - -#------------------------------------------------------------------------------ -# The adjust-path macro -# -# If COMSPEC is defined, Make is launched from Windows through -# Cygwin. This adjust-path macro will call 'cygpath -u' on all -# paths to ensure they are readable by Make. -# -# If COMSPEC is not defined, Make is launched from *nix, and no adjustment -# is necessary -#------------------------------------------------------------------------------ - -ifndef COMSPEC -ifdef ComSpec -COMSPEC = $(ComSpec) -endif # ComSpec -endif # !COMSPEC - -ifdef COMSPEC - adjust-path = $(subst $(SPACE),\$(SPACE),$(shell cygpath -u "$1")) - adjust-path-mixed = $(subst $(SPACE),\$(SPACE),$(shell cygpath -m "$1")) -else - adjust-path = $(subst $(SPACE),\$(SPACE),$1) - adjust-path-mixed = $(subst $(SPACE),\$(SPACE),$1) -endif - -#------------------------------------------------------------------------------ -# DEFAULT TARGET -# -# The default target, "all", must appear before any other target in the -# Makefile. Note that extra prerequisites are added to the "all" rule later. -#------------------------------------------------------------------------------ -.PHONY: all -all: - @$(ECHO) [BSP build complete] - - -#------------------------------------------------------------------------------ -# PATHS & DIRECTORY NAMES -# -# Explicitly locate absolute path of the BSP root -#------------------------------------------------------------------------------ - -BSP_ROOT_DIR := . - -# Define absolute path to the root of the BSP. -ABS_BSP_ROOT := $(call adjust-path-mixed,$(shell pwd)) - -# Stash all BSP object files here -OBJ_DIR := ./obj - -NEWLIB_DIR = $(BSP_ROOT_DIR)/newlib - - -#------------------------------------------------------------------------------ -# MANAGED CONTENT -# -# All content between the lines "START MANAGED" and "END MANAGED" below is -# generated based on variables in the BSP settings file when the -# nios2-bsp-generate-files command is invoked. If you wish to persist any -# information pertaining to the build process, it is recomended that you -# utilize the BSP settings mechanism to do so. -# -# Note that most variable assignments in this section have a corresponding BSP -# setting that can be changed by using the nios2-bsp-create-settings or -# nios2-bsp-update-settings command before nios2-bsp-generate-files; if you -# want any variable set to a specific value when this Makefile is re-generated -# (to prevent hand-edits from being over-written), use the BSP settings -# facilities above. -#------------------------------------------------------------------------------ - -#START MANAGED - -# The following TYPE comment allows tools to identify the 'type' of target this -# makefile is associated with. -# TYPE: BSP_PRIVATE_MAKEFILE - -# This following VERSION comment indicates the version of the tool used to -# generate this makefile. A makefile variable is provided for VERSION as well. -# ACDS_VERSION: 13.0sp1 -ACDS_VERSION := 13.0sp1 - -# This following BUILD_NUMBER comment indicates the build number of the tool -# used to generate this makefile. -# BUILD_NUMBER: 232 - -SETTINGS_FILE := settings.bsp -SOPC_FILE := C:/Users/takayun/Documents/DE2-115/qsys_tutorial/nios_system.sopcinfo - -#------------------------------------------------------------------------------- -# TOOL & COMMAND DEFINITIONS -# -# The base command for each build operation are expressed here. Additional -# switches may be expressed here. They will run for all instances of the -# utility. -#------------------------------------------------------------------------------- - -# Archiver command. Creates library files. -AR = nios2-elf-ar - -# Assembler command. Note that CC is used for .S files. -AS = nios2-elf-gcc - -# Custom flags only passed to the archiver. This content of this variable is -# directly passed to the archiver rather than the more standard "ARFLAGS". The -# reason for this is that GNU Make assumes some default content in ARFLAGS. -# This setting defines the value of BSP_ARFLAGS in Makefile. -BSP_ARFLAGS = -src - -# Custom flags only passed to the assembler. This setting defines the value of -# BSP_ASFLAGS in Makefile. -BSP_ASFLAGS = -Wa,-gdwarf2 - -# C/C++ compiler debug level. '-g' provides the default set of debug symbols -# typically required to debug a typical application. Omitting '-g' removes -# debug symbols from the ELF. This setting defines the value of -# BSP_CFLAGS_DEBUG in Makefile. -BSP_CFLAGS_DEBUG = -g - -# C/C++ compiler optimization level. "-O0" = no optimization,"-O2" = "normal" -# optimization, etc. "-O0" is recommended for code that you want to debug since -# compiler optimization can remove variables and produce non-sequential -# execution of code while debugging. This setting defines the value of -# BSP_CFLAGS_OPTIMIZATION in Makefile. -BSP_CFLAGS_OPTIMIZATION = '-Os' - -# C/C++ compiler warning level. "-Wall" is commonly used.This setting defines -# the value of BSP_CFLAGS_WARNINGS in Makefile. -BSP_CFLAGS_WARNINGS = -Wall - -# C compiler command. -CC = nios2-elf-gcc -xc - -# C++ compiler command. -CXX = nios2-elf-gcc -xc++ - -# Command used to remove files during 'clean' target. -RM = rm -f - - -#------------------------------------------------------------------------------- -# BUILD PRE & POST PROCESS COMMANDS -# -# The following variables are treated as shell commands in the rule -# definitions for each file-type associated with the BSP build, as well as -# commands run at the beginning and end of the entire BSP build operation. -# Pre-process commands are executed before the relevant command (for example, -# a command defined in the "CC_PRE_PROCESS" variable executes before the C -# compiler for building .c files), while post-process commands are executed -# immediately afterwards. -# -# You can view each pre/post-process command in the "Build Rules: All & -# Clean", "Pattern Rules to Build Objects", and "Library Rules" sections of -# this Makefile. -#------------------------------------------------------------------------------- - - -#------------------------------------------------------------------------------- -# BSP SOURCE BUILD SETTINGS (FLAG GENERATION) -# -# Software build settings such as compiler optimization, debug level, warning -# flags, etc., may be defined in the following variables. The variables below -# are concatenated together in the 'Flags' section of this Makefile to form -# final variables of flags passed to the build tools. -# -# These settings are considered private to the BSP and apply to all library & -# driver files in it; they do NOT automatically propagate to, for example, the -# build settings for an application. -# # For additional detail and syntax requirements, please refer to GCC help -# (example: "nios2-elf-gcc --help --verbose"). -# -# Unless indicated otherwise, multiple entries in each variable should be -# space-separated. -#------------------------------------------------------------------------------- - -# Altera HAL alt_sys_init.c generated source file -GENERATED_C_FILES := $(ABS_BSP_ROOT)/alt_sys_init.c -GENERATED_C_LIB_SRCS += alt_sys_init.c - - -#------------------------------------------------------------------------------- -# BSP SOURCE FILE LISTING -# -# All source files that comprise the BSP are listed here, along with path -# information to each file expressed relative to the BSP root. The precise -# list and location of each file is derived from the driver, operating system, -# or software package source file declarations. -# -# Following specification of the source files for each component, driver, etc., -# each source file type (C, assembly, etc.) is concatenated together and used -# to construct a list of objects. Pattern rules to build each object are then -# used to build each file. -#------------------------------------------------------------------------------- - -# altera_avalon_jtag_uart_driver sources root -altera_avalon_jtag_uart_driver_SRCS_ROOT := drivers - -# altera_avalon_jtag_uart_driver sources -altera_avalon_jtag_uart_driver_C_LIB_SRCS := \ - $(altera_avalon_jtag_uart_driver_SRCS_ROOT)/src/altera_avalon_jtag_uart_init.c \ - $(altera_avalon_jtag_uart_driver_SRCS_ROOT)/src/altera_avalon_jtag_uart_read.c \ - $(altera_avalon_jtag_uart_driver_SRCS_ROOT)/src/altera_avalon_jtag_uart_write.c \ - $(altera_avalon_jtag_uart_driver_SRCS_ROOT)/src/altera_avalon_jtag_uart_ioctl.c \ - $(altera_avalon_jtag_uart_driver_SRCS_ROOT)/src/altera_avalon_jtag_uart_fd.c - -# altera_avalon_pio_driver sources root -altera_avalon_pio_driver_SRCS_ROOT := drivers - -# altera_avalon_pio_driver sources -# altera_nios2_qsys_hal_driver sources root -altera_nios2_qsys_hal_driver_SRCS_ROOT := HAL - -# altera_nios2_qsys_hal_driver sources -altera_nios2_qsys_hal_driver_C_LIB_SRCS := \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/altera_nios2_qsys_irq.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_usleep.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_busy_sleep.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_irq_vars.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_icache_flush.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_icache_flush_all.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_dcache_flush.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_dcache_flush_all.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_dcache_flush_no_writeback.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_instruction_exception_entry.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_irq_register.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_iic.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_remap_cached.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_remap_uncached.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_uncached_free.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_uncached_malloc.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_do_ctors.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_do_dtors.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_gmon.c - -altera_nios2_qsys_hal_driver_ASM_LIB_SRCS := \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_exception_entry.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_exception_trap.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_exception_muldiv.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_irq_entry.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_software_exception.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_mcount.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_log_macro.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/crt0.S - -# hal sources root -hal_SRCS_ROOT := HAL - -# hal sources -hal_C_LIB_SRCS := \ - $(hal_SRCS_ROOT)/src/alt_alarm_start.c \ - $(hal_SRCS_ROOT)/src/alt_close.c \ - $(hal_SRCS_ROOT)/src/alt_dev.c \ - $(hal_SRCS_ROOT)/src/alt_dev_llist_insert.c \ - $(hal_SRCS_ROOT)/src/alt_dma_rxchan_open.c \ - $(hal_SRCS_ROOT)/src/alt_dma_txchan_open.c \ - $(hal_SRCS_ROOT)/src/alt_environ.c \ - $(hal_SRCS_ROOT)/src/alt_env_lock.c \ - $(hal_SRCS_ROOT)/src/alt_errno.c \ - $(hal_SRCS_ROOT)/src/alt_execve.c \ - $(hal_SRCS_ROOT)/src/alt_exit.c \ - $(hal_SRCS_ROOT)/src/alt_fcntl.c \ - $(hal_SRCS_ROOT)/src/alt_fd_lock.c \ - $(hal_SRCS_ROOT)/src/alt_fd_unlock.c \ - $(hal_SRCS_ROOT)/src/alt_find_dev.c \ - $(hal_SRCS_ROOT)/src/alt_find_file.c \ - $(hal_SRCS_ROOT)/src/alt_flash_dev.c \ - $(hal_SRCS_ROOT)/src/alt_fork.c \ - $(hal_SRCS_ROOT)/src/alt_fs_reg.c \ - $(hal_SRCS_ROOT)/src/alt_fstat.c \ - $(hal_SRCS_ROOT)/src/alt_get_fd.c \ - $(hal_SRCS_ROOT)/src/alt_getchar.c \ - $(hal_SRCS_ROOT)/src/alt_getpid.c \ - $(hal_SRCS_ROOT)/src/alt_gettod.c \ - $(hal_SRCS_ROOT)/src/alt_iic_isr_register.c \ - $(hal_SRCS_ROOT)/src/alt_instruction_exception_register.c \ - $(hal_SRCS_ROOT)/src/alt_ioctl.c \ - $(hal_SRCS_ROOT)/src/alt_io_redirect.c \ - $(hal_SRCS_ROOT)/src/alt_irq_handler.c \ - $(hal_SRCS_ROOT)/src/alt_isatty.c \ - $(hal_SRCS_ROOT)/src/alt_kill.c \ - $(hal_SRCS_ROOT)/src/alt_link.c \ - $(hal_SRCS_ROOT)/src/alt_load.c \ - $(hal_SRCS_ROOT)/src/alt_log_printf.c \ - $(hal_SRCS_ROOT)/src/alt_lseek.c \ - $(hal_SRCS_ROOT)/src/alt_main.c \ - $(hal_SRCS_ROOT)/src/alt_malloc_lock.c \ - $(hal_SRCS_ROOT)/src/alt_open.c \ - $(hal_SRCS_ROOT)/src/alt_printf.c \ - $(hal_SRCS_ROOT)/src/alt_putchar.c \ - $(hal_SRCS_ROOT)/src/alt_putstr.c \ - $(hal_SRCS_ROOT)/src/alt_read.c \ - $(hal_SRCS_ROOT)/src/alt_release_fd.c \ - $(hal_SRCS_ROOT)/src/alt_rename.c \ - $(hal_SRCS_ROOT)/src/alt_sbrk.c \ - $(hal_SRCS_ROOT)/src/alt_settod.c \ - $(hal_SRCS_ROOT)/src/alt_stat.c \ - $(hal_SRCS_ROOT)/src/alt_tick.c \ - $(hal_SRCS_ROOT)/src/alt_times.c \ - $(hal_SRCS_ROOT)/src/alt_unlink.c \ - $(hal_SRCS_ROOT)/src/alt_wait.c \ - $(hal_SRCS_ROOT)/src/alt_write.c - - -# Assemble all component C source files -COMPONENT_C_LIB_SRCS += \ - $(altera_avalon_jtag_uart_driver_C_LIB_SRCS) \ - $(altera_nios2_qsys_hal_driver_C_LIB_SRCS) \ - $(hal_C_LIB_SRCS) - -# Assemble all component assembly source files -COMPONENT_ASM_LIB_SRCS += \ - $(altera_nios2_qsys_hal_driver_ASM_LIB_SRCS) - -# Assemble all component C++ source files -COMPONENT_CPP_LIB_SRCS += \ - -#END MANAGED - -#------------------------------------------------------------------------------ -# PUBLIC.MK -# -# The generated public.mk file contains BSP information that is shared with -# other external makefiles, such as a Nios II application makefile. System- -# dependent information such as hardware-specific compiler flags and -# simulation file generation are stored here. -# -# In addition, public.mk contains include paths that various software, -# such as a device driver, may need for the C compiler. These paths are -# written to public.mk with respect to the BSP root. In public.mk, each -# path is prefixed with a special variable, $(ALT_LIBRARY_ROOT_DIR). The -# purpose of this variable is to allow an external Makefile to append on -# path information to precisely locate paths expressed in public.mk -# Since this is the BSP Makefile, we set ALT_LIBRARY_ROOT_DIR to point right -# here ("."), at the BSP root. -# -# ALT_LIBRARY_ROOT_DIR must always be set before public.mk is included. -#------------------------------------------------------------------------------ -ALT_LIBRARY_ROOT_DIR := . -include public.mk - - -#------------------------------------------------------------------------------ -# FLAGS -# -# Include paths for BSP files are written into the public.mk file and must -# be added to the existing list of pre-processor flags. In addition, "hooks" -# for standard flags left intentionally empty (CFLAGS, CPPFLAGS, ASFLAGS, -# and CXXFLAGS) are provided for conveniently adding to the relevant flags -# on the command-line or via script that calls make. -#------------------------------------------------------------------------------ -# Assemble final list of compiler flags from generated content -BSP_CFLAGS += \ - $(BSP_CFLAGS_DEFINED_SYMBOLS) \ - $(BSP_CFLAGS_UNDEFINED_SYMBOLS) \ - $(BSP_CFLAGS_OPTIMIZATION) \ - $(BSP_CFLAGS_DEBUG) \ - $(BSP_CFLAGS_WARNINGS) \ - $(BSP_CFLAGS_USER_FLAGS) \ - $(ALT_CFLAGS) \ - $(CFLAGS) - -# Make ready the final list of include directories and other C pre-processor -# flags. Each include path is made ready by prefixing it with "-I". -BSP_CPPFLAGS += \ - $(addprefix -I, $(BSP_INC_DIRS)) \ - $(addprefix -I, $(ALT_INCLUDE_DIRS)) \ - $(ALT_CPPFLAGS) \ - $(CPPFLAGS) - -# Finish off assembler flags with any user-provided flags -BSP_ASFLAGS += $(ASFLAGS) - -# Finish off C++ flags with any user-provided flags -BSP_CXXFLAGS += $(CXXFLAGS) - -# And finally, the ordered list -C_SRCS += $(GENERATED_C_LIB_SRCS) \ - $(COMPONENT_C_LIB_SRCS) - -CXX_SRCS += $(GENERATED_CPP_LIB_SRCS) \ - $(COMPONENT_CPP_LIB_SRCS) - -ASM_SRCS += $(GENERATED_ASM_LIB_SRCS) \ - $(COMPONENT_ASM_LIB_SRCS) - - -#------------------------------------------------------------------------------ -# LIST OF GENERATED FILES -# -# A Nios II BSP relies on the generation of several source files used -# by both the BSP and any applications referencing the BSP. -#------------------------------------------------------------------------------ - - -GENERATED_H_FILES := $(ABS_BSP_ROOT)/system.h - -GENERATED_LINKER_SCRIPT := $(ABS_BSP_ROOT)/linker.x - -GENERATED_FILES += $(GENERATED_H_FILES) \ - $(GENERATED_LINKER_SCRIPT) - - -#------------------------------------------------------------------------------ -# SETUP TO BUILD OBJECTS -# -# List of object files which are to be built. This is constructed from the input -# list of C source files (C_SRCS), C++ source files (CXX_SRCS), and assembler -# source file (ASM_SRCS). The permitted file extensions are: -# -# .c .C - for C files -# .cxx .cc .cpp .CXX .CC .CPP - for C++ files -# .S .s - for assembly files -# -# Extended description: The list of objects is a sorted list (duplicates -# removed) of all possible objects, placed beneath the ./obj directory, -# including any path information stored in the "*_SRCS" variable. The -# "patsubst" commands are used to concatenate together multiple file suffix -# types for common files (i.e. c++ as .cxx, .cc, .cpp). -# -# File extensions are case-insensitive in build rules with the exception of -# assembly sources. Nios II assembly sources with the ".S" extension are first -# run through the C preprocessor. Sources with the ".s" extension are not. -#------------------------------------------------------------------------------ -OBJS = $(sort $(addprefix $(OBJ_DIR)/, \ - $(patsubst %.c, %.o, $(patsubst %.C, %.o, $(C_SRCS))) \ - $(patsubst %.cxx, %.o, $(patsubst %.CXX, %.o, \ - $(patsubst %.cc, %.o, $(patsubst %.CC, %.o, \ - $(patsubst %.cpp, %.o, $(patsubst %.CPP, %.o, \ - $(CXX_SRCS) )))))) \ - $(patsubst %.S, %.o, $(patsubst %.s, %.o, $(ASM_SRCS))) )) - -# List of dependancy files for each object file. -DEPS = $(OBJS:.o=.d) - - -# Rules to force your project to rebuild or relink -# .force_relink file will cause any application that depends on this project to relink -# .force_rebuild file will cause this project to rebuild object files -# .force_rebuild_all file will cause this project and any project that depends on this project to rebuild object files - -FORCE_RELINK_DEP := .force_relink -FORCE_REBUILD_DEP := .force_rebuild -FORCE_REBUILD_ALL_DEP := .force_rebuild_all -FORCE_REBUILD_DEP_LIST := $(FORCE_RELINK_DEP) $(FORCE_REBUILD_DEP) $(FORCE_REBUILD_ALL_DEP) - -$(FORCE_REBUILD_DEP_LIST): - -$(OBJS): $(wildcard $(FORCE_REBUILD_DEP)) $(wildcard $(FORCE_REBUILD_ALL_DEP)) - - -#------------------------------------------------------------------------------ -# BUILD RULES: ALL & CLEAN -#------------------------------------------------------------------------------ -.DELETE_ON_ERROR: - -.PHONY: all -all: build_pre_process -all: Makefile $(GENERATED_FILES) $(BSP_LIB) $(NEWLIB_DIR) -all: build_post_process - - -# clean: remove .o/.a/.d -.PHONY: clean -clean: - @$(RM) -r $(BSP_LIB) $(OBJ_DIR) $(FORCE_REBUILD_DEP_LIST) -ifneq ($(wildcard $(NEWLIB_DIR)),) - @$(RM) -r $(NEWLIB_DIR) -endif - @$(ECHO) [BSP clean complete] - - -#------------------------------------------------------------------------------ -# BUILD PRE/POST PROCESS -#------------------------------------------------------------------------------ -build_pre_process : - $(BUILD_PRE_PROCESS) - -build_post_process : - $(BUILD_POST_PROCESS) - -.PHONY: build_pre_process build_post_process - - - -#------------------------------------------------------------------------------ -# MAKEFILE UP TO DATE? -# -# Is this very Makefile up to date? Someone may have changed the BSP settings -# file or the associated target hardware. -#------------------------------------------------------------------------------ -# Skip this check when clean is the only target -ifneq ($(MAKECMDGOALS),clean) - -ifneq ($(wildcard $(SETTINGS_FILE)),$(SETTINGS_FILE)) -$(warning Warning: BSP Settings File $(SETTINGS_FILE) could not be found.) -endif - -Makefile: $(wildcard $(SETTINGS_FILE)) - @$(ECHO) Makefile not up to date. - @$(ECHO) $(SETTINGS_FILE) has been modified since the BSP Makefile was generated. - @$(ECHO) - @$(ECHO) Generate the BSP to update the Makefile, and then build again. - @$(ECHO) - @$(ECHO) To generate from Eclipse: - @$(ECHO) " 1. Right-click the BSP project." - @$(ECHO) " 2. In the Nios II Menu, click Generate BSP." - @$(ECHO) - @$(ECHO) To generate from the command line: - @$(ECHO) " nios2-bsp-generate-files --settings= --bsp-dir=" - @$(ECHO) - @exit 1 - -ifneq ($(wildcard $(SOPC_FILE)),$(SOPC_FILE)) -$(warning Warning: SOPC File $(SOPC_FILE) could not be found.) -endif - -public.mk: $(wildcard $(SOPC_FILE)) - @$(ECHO) Makefile not up to date. - @$(ECHO) $(SOPC_FILE) has been modified since the BSP was generated. - @$(ECHO) - @$(ECHO) Generate the BSP to update the Makefile, and then build again. - @$(ECHO) - @$(ECHO) To generate from Eclipse: - @$(ECHO) " 1. Right-click the BSP project." - @$(ECHO) " 2. In the Nios II Menu, click Generate BSP." - @$(ECHO) - @$(ECHO) To generate from the command line: - @$(ECHO) " nios2-bsp-generate-files --settings= --bsp-dir=" - @$(ECHO) - @exit 1 - -endif # $(MAKECMDGOALS) != clean - -#------------------------------------------------------------------------------ -# PATTERN RULES TO BUILD OBJECTS -#------------------------------------------------------------------------------ -$(OBJ_DIR)/%.o: %.c - @$(ECHO) Compiling $( - -/* - * Device headers - */ - -#include "altera_nios2_qsys_irq.h" -#include "altera_avalon_jtag_uart.h" - -/* - * Allocate the device storage - */ - -ALTERA_NIOS2_QSYS_IRQ_INSTANCE ( NIOS2_PROCESSOR, nios2_processor); -ALTERA_AVALON_JTAG_UART_INSTANCE ( JTAG_UART, jtag_uart); - -/* - * Initialize the interrupt controller devices - * and then enable interrupts in the CPU. - * Called before alt_sys_init(). - * The "base" parameter is ignored and only - * present for backwards-compatibility. - */ - -void alt_irq_init ( const void* base ) -{ - ALTERA_NIOS2_QSYS_IRQ_INIT ( NIOS2_PROCESSOR, nios2_processor); - alt_irq_cpu_enable_interrupts(); -} - -/* - * Initialize the non-interrupt controller devices. - * Called after alt_irq_init(). - */ - -void alt_sys_init( void ) -{ - ALTERA_AVALON_JTAG_UART_INIT ( JTAG_UART, jtag_uart); -} diff --git a/software/qsys_tutorial_key3_bsp/create-this-bsp b/software/qsys_tutorial_key3_bsp/create-this-bsp deleted file mode 100644 index 49e6175..0000000 --- a/software/qsys_tutorial_key3_bsp/create-this-bsp +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/bash -# -# This script creates the ucosii_net_zipfs Board Support Package (BSP). - -BSP_TYPE=hal -BSP_DIR=. -SOPC_DIR=../../ -SOPC_FILE=C:/Users/takayun/Documents/DE2-115/qsys_tutorial/nios_system.sopcinfo -NIOS2_BSP_ARGS="--set hal.max_file_descriptors 4 --set hal.enable_small_c_library true --set hal.sys_clk_timer none --set hal.timestamp_timer none --set hal.enable_exit false --set hal.enable_c_plus_plus false --set hal.enable_lightweight_device_driver_api true --set hal.enable_clean_exit false --set hal.enable_sim_optimize false --set hal.enable_reduced_device_drivers true --set hal.make.bsp_cflags_optimization '-Os'" -CPU_NAME= - - -# Don't run make if create-this-app script is called with --no-make arg -SKIP_MAKE= -while [ $# -gt 0 ] -do - case "$1" in - --no-make) - SKIP_MAKE=1 - ;; - *) - NIOS2_BSP_ARGS="$NIOS2_BSP_ARGS $1" - ;; - esac - shift -done - - -# Run nios2-bsp utility to create a hal BSP in this directory -# for the system with a .sopc file in $SOPC_FILE. -# Deprecating $SOPC_DIR in 10.1. Multiple .sopcinfo files in a directory may exist. - -if [ -z "$SOPC_FILE" ]; then - echo "WARNING: Use of a directory for locating a .sopcinfo file is deprecated in 10.1. Multiple .sopcinfo files may exist. You must specify the full .sopcinfo path." - cmd="nios2-bsp $BSP_TYPE $BSP_DIR $SOPC_DIR $NIOS2_BSP_ARGS $CPU_NAME" -else - cmd="nios2-bsp $BSP_TYPE $BSP_DIR $SOPC_FILE $NIOS2_BSP_ARGS $CPU_NAME" -fi - - -echo "create-this-bsp: Running \"$cmd\"" -$cmd || { - echo "$cmd failed" - exit 1 -} -if [ -z "$SKIP_MAKE" ]; then - echo "create-this-bsp: Running make" - make -fi diff --git a/software/qsys_tutorial_key3_bsp/drivers/inc/altera_avalon_jtag_uart.h b/software/qsys_tutorial_key3_bsp/drivers/inc/altera_avalon_jtag_uart.h deleted file mode 100644 index 95d4a99..0000000 --- a/software/qsys_tutorial_key3_bsp/drivers/inc/altera_avalon_jtag_uart.h +++ /dev/null @@ -1,198 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#ifndef __ALT_AVALON_JTAG_UART_H__ -#define __ALT_AVALON_JTAG_UART_H__ - -#include - -#include "sys/alt_alarm.h" -#include "sys/alt_warning.h" - -#include "os/alt_sem.h" -#include "os/alt_flag.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * If the user wants all drivers to be small rather than fast then make sure - * this one is marked as needing to be small. - */ -#if defined ALT_USE_SMALL_DRIVERS && !defined ALTERA_AVALON_JTAG_UART_SMALL -#define ALTERA_AVALON_JTAG_UART_SMALL -#endif - -/* - * If the user wants to ignore FIFO full error after timeout - */ -#if defined ALT_JTAG_UART_IGNORE_FIFO_FULL_ERROR && !defined ALTERA_AVALON_JTAG_UART_IGNORE_FIFO_FULL_ERROR -#define ALTERA_AVALON_JTAG_UART_IGNORE_FIFO_FULL_ERROR -#endif - -/* - * Constants that can be overriden. - */ -#ifndef ALTERA_AVALON_JTAG_UART_DEFAULT_TIMEOUT -#define ALTERA_AVALON_JTAG_UART_DEFAULT_TIMEOUT 10 -#endif - -#ifndef ALTERA_AVALON_JTAG_UART_BUF_LEN -#define ALTERA_AVALON_JTAG_UART_BUF_LEN 2048 -#endif - -/* - * ALT_JTAG_UART_READ_RDY and ALT_JTAG_UART_WRITE_RDY are the bitmasks - * that define uC/OS-II event flags that are releated to this device. - * - * ALT_JTAG_UART_READ_RDY indicates that there is read data in the buffer - * ready to be processed. ALT_JTAG_UART_WRITE_RDY indicates that the transmitter is - * ready for more data. - */ -#define ALT_JTAG_UART_READ_RDY 0x1 -#define ALT_JTAG_UART_WRITE_RDY 0x2 -#define ALT_JTAG_UART_TIMEOUT 0x4 - -/* - * State structure definition. Each instance of the driver uses one - * of these structures to hold its associated state. - */ - -typedef struct altera_avalon_jtag_uart_state_s -{ - unsigned int base; - -#ifndef ALTERA_AVALON_JTAG_UART_SMALL - - unsigned int timeout; /* Timeout until host is assumed inactive */ - alt_alarm alarm; - unsigned int irq_enable; - unsigned int host_inactive; - - ALT_SEM (read_lock) - ALT_SEM (write_lock) - ALT_FLAG_GRP (events) - - /* The variables below are volatile because they are modified by the - * interrupt routine. Making them volatile and reading them atomically - * means that we don't need any large critical sections. - */ - volatile unsigned int rx_in; - unsigned int rx_out; - unsigned int tx_in; - volatile unsigned int tx_out; - char rx_buf[ALTERA_AVALON_JTAG_UART_BUF_LEN]; - char tx_buf[ALTERA_AVALON_JTAG_UART_BUF_LEN]; - -#endif /* !ALTERA_AVALON_JTAG_UART_SMALL */ - -} altera_avalon_jtag_uart_state; - -/* - * Macros used by alt_sys_init when the ALT file descriptor facility isn't used. - */ - -#ifdef ALTERA_AVALON_JTAG_UART_SMALL - -#define ALTERA_AVALON_JTAG_UART_STATE_INSTANCE(name, state) \ - altera_avalon_jtag_uart_state state = \ - { \ - name##_BASE, \ - } - -#define ALTERA_AVALON_JTAG_UART_STATE_INIT(name, state) - -#else /* !ALTERA_AVALON_JTAG_UART_SMALL */ - -#define ALTERA_AVALON_JTAG_UART_STATE_INSTANCE(name, state) \ - altera_avalon_jtag_uart_state state = \ - { \ - name##_BASE, \ - ALTERA_AVALON_JTAG_UART_DEFAULT_TIMEOUT, \ - } - -/* - * Externally referenced routines - */ -extern void altera_avalon_jtag_uart_init(altera_avalon_jtag_uart_state* sp, - int irq_controller_id, int irq); - -#define ALTERA_AVALON_JTAG_UART_STATE_INIT(name, state) \ - { \ - if (name##_IRQ == ALT_IRQ_NOT_CONNECTED) \ - { \ - ALT_LINK_ERROR ("Error: Interrupt not connected for " #name ". " \ - "You have selected the interrupt driven version of " \ - "the ALTERA Avalon JTAG UART driver, but the " \ - "interrupt is not connected for this device. You can " \ - "select a polled mode driver by checking the 'small " \ - "driver' option in the HAL configuration window, or " \ - "by using the -DALTERA_AVALON_JTAG_UART_SMALL " \ - "preprocessor flag."); \ - } \ - else \ - altera_avalon_jtag_uart_init(&state, \ - name##_IRQ_INTERRUPT_CONTROLLER_ID, \ - name##_IRQ); \ - } - -#endif /* ALTERA_AVALON_JTAG_UART_SMALL */ - -/* - * Include in case non-direct version of driver required. - */ -#include "altera_avalon_jtag_uart_fd.h" - -/* - * Map alt_sys_init macros to direct or non-direct versions. - */ -#ifdef ALT_USE_DIRECT_DRIVERS - -#define ALTERA_AVALON_JTAG_UART_INSTANCE(name, state) \ - ALTERA_AVALON_JTAG_UART_STATE_INSTANCE(name, state) -#define ALTERA_AVALON_JTAG_UART_INIT(name, state) \ - ALTERA_AVALON_JTAG_UART_STATE_INIT(name, state) - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -#define ALTERA_AVALON_JTAG_UART_INSTANCE(name, dev) \ - ALTERA_AVALON_JTAG_UART_DEV_INSTANCE(name, dev) -#define ALTERA_AVALON_JTAG_UART_INIT(name, dev) \ - ALTERA_AVALON_JTAG_UART_DEV_INIT(name, dev) - -#endif /* ALT_USE_DIRECT_DRIVERS */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_AVALON_JTAG_UART_H__ */ diff --git a/software/qsys_tutorial_key3_bsp/drivers/inc/altera_avalon_jtag_uart_fd.h b/software/qsys_tutorial_key3_bsp/drivers/inc/altera_avalon_jtag_uart_fd.h deleted file mode 100644 index b3c3200..0000000 --- a/software/qsys_tutorial_key3_bsp/drivers/inc/altera_avalon_jtag_uart_fd.h +++ /dev/null @@ -1,125 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#ifndef __ALT_AVALON_JTAG_UART_FD_H__ -#define __ALT_AVALON_JTAG_UART_FD_H__ - -#include "sys/alt_dev.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * Externally referenced routines - */ -extern int altera_avalon_jtag_uart_read_fd (alt_fd* fd, char* ptr, int len); -extern int altera_avalon_jtag_uart_write_fd (alt_fd* fd, const char* ptr, - int len); - -/* - * Device structure definition. This is needed by alt_sys_init in order to - * reserve memory for the device instance. - */ - -typedef struct altera_avalon_jtag_uart_dev_s -{ - alt_dev dev; - altera_avalon_jtag_uart_state state; -} altera_avalon_jtag_uart_dev; - -/* - * Macros used by alt_sys_init when the ALT file descriptor facility is used. - */ - -#ifdef ALTERA_AVALON_JTAG_UART_SMALL - -#define ALTERA_AVALON_JTAG_UART_DEV_INSTANCE(name, d) \ - static altera_avalon_jtag_uart_dev d = \ - { \ - { \ - ALT_LLIST_ENTRY, \ - name##_NAME, \ - NULL, /* open */ \ - NULL, /* close */ \ - altera_avalon_jtag_uart_read_fd, \ - altera_avalon_jtag_uart_write_fd, \ - NULL, /* lseek */ \ - NULL, /* fstat */ \ - NULL, /* ioctl */ \ - }, \ - { \ - name##_BASE, \ - } \ - } - -#define ALTERA_AVALON_JTAG_UART_DEV_INIT(name, d) alt_dev_reg (&d.dev) - -#else /* !ALTERA_AVALON_JTAG_UART_SMALL */ - -extern int altera_avalon_jtag_uart_close_fd(alt_fd* fd); -extern int altera_avalon_jtag_uart_ioctl_fd (alt_fd* fd, int req, void* arg); - -#define ALTERA_AVALON_JTAG_UART_DEV_INSTANCE(name, d) \ - static altera_avalon_jtag_uart_dev d = \ - { \ - { \ - ALT_LLIST_ENTRY, \ - name##_NAME, \ - NULL, /* open */ \ - altera_avalon_jtag_uart_close_fd, \ - altera_avalon_jtag_uart_read_fd, \ - altera_avalon_jtag_uart_write_fd, \ - NULL, /* lseek */ \ - NULL, /* fstat */ \ - altera_avalon_jtag_uart_ioctl_fd, \ - }, \ - { \ - name##_BASE, \ - ALTERA_AVALON_JTAG_UART_DEFAULT_TIMEOUT, \ - } \ - } - -#define ALTERA_AVALON_JTAG_UART_DEV_INIT(name, d) \ - { \ - ALTERA_AVALON_JTAG_UART_STATE_INIT(name, d.state); \ - \ - /* make the device available to the system */ \ - alt_dev_reg(&d.dev); \ - } - -#endif /* ALTERA_AVALON_JTAG_UART_SMALL */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_AVALON_JTAG_UART_FD_H__ */ diff --git a/software/qsys_tutorial_key3_bsp/drivers/inc/altera_avalon_jtag_uart_regs.h b/software/qsys_tutorial_key3_bsp/drivers/inc/altera_avalon_jtag_uart_regs.h deleted file mode 100644 index 7f97160..0000000 --- a/software/qsys_tutorial_key3_bsp/drivers/inc/altera_avalon_jtag_uart_regs.h +++ /dev/null @@ -1,73 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#ifndef __ALTERA_AVALON_JTAG_UART_REGS_H__ -#define __ALTERA_AVALON_JTAG_UART_REGS_H__ - -#include - -#define ALTERA_AVALON_JTAG_UART_DATA_REG 0 -#define IOADDR_ALTERA_AVALON_JTAG_UART_DATA(base) \ - __IO_CALC_ADDRESS_NATIVE(base, ALTERA_AVALON_JTAG_UART_DATA_REG) -#define IORD_ALTERA_AVALON_JTAG_UART_DATA(base) \ - IORD(base, ALTERA_AVALON_JTAG_UART_DATA_REG) -#define IOWR_ALTERA_AVALON_JTAG_UART_DATA(base, data) \ - IOWR(base, ALTERA_AVALON_JTAG_UART_DATA_REG, data) - -#define ALTERA_AVALON_JTAG_UART_DATA_DATA_MSK (0x000000FF) -#define ALTERA_AVALON_JTAG_UART_DATA_DATA_OFST (0) -#define ALTERA_AVALON_JTAG_UART_DATA_RVALID_MSK (0x00008000) -#define ALTERA_AVALON_JTAG_UART_DATA_RVALID_OFST (15) -#define ALTERA_AVALON_JTAG_UART_DATA_RAVAIL_MSK (0xFFFF0000) -#define ALTERA_AVALON_JTAG_UART_DATA_RAVAIL_OFST (16) - - -#define ALTERA_AVALON_JTAG_UART_CONTROL_REG 1 -#define IOADDR_ALTERA_AVALON_JTAG_UART_CONTROL(base) \ - __IO_CALC_ADDRESS_NATIVE(base, ALTERA_AVALON_JTAG_UART_CONTROL_REG) -#define IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base) \ - IORD(base, ALTERA_AVALON_JTAG_UART_CONTROL_REG) -#define IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(base, data) \ - IOWR(base, ALTERA_AVALON_JTAG_UART_CONTROL_REG, data) - -#define ALTERA_AVALON_JTAG_UART_CONTROL_RE_MSK (0x00000001) -#define ALTERA_AVALON_JTAG_UART_CONTROL_RE_OFST (0) -#define ALTERA_AVALON_JTAG_UART_CONTROL_WE_MSK (0x00000002) -#define ALTERA_AVALON_JTAG_UART_CONTROL_WE_OFST (1) -#define ALTERA_AVALON_JTAG_UART_CONTROL_RI_MSK (0x00000100) -#define ALTERA_AVALON_JTAG_UART_CONTROL_RI_OFST (8) -#define ALTERA_AVALON_JTAG_UART_CONTROL_WI_MSK (0x00000200) -#define ALTERA_AVALON_JTAG_UART_CONTROL_WI_OFST (9) -#define ALTERA_AVALON_JTAG_UART_CONTROL_AC_MSK (0x00000400) -#define ALTERA_AVALON_JTAG_UART_CONTROL_AC_OFST (10) -#define ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_MSK (0xFFFF0000) -#define ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_OFST (16) - -#endif /* __ALTERA_AVALON_JTAG_UART_REGS_H__ */ diff --git a/software/qsys_tutorial_key3_bsp/drivers/inc/altera_avalon_pio_regs.h b/software/qsys_tutorial_key3_bsp/drivers/inc/altera_avalon_pio_regs.h deleted file mode 100644 index 052439f..0000000 --- a/software/qsys_tutorial_key3_bsp/drivers/inc/altera_avalon_pio_regs.h +++ /dev/null @@ -1,67 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#ifndef __ALTERA_AVALON_PIO_REGS_H__ -#define __ALTERA_AVALON_PIO_REGS_H__ - -#include - -#define IOADDR_ALTERA_AVALON_PIO_DATA(base) __IO_CALC_ADDRESS_NATIVE(base, 0) -#define IORD_ALTERA_AVALON_PIO_DATA(base) IORD(base, 0) -#define IOWR_ALTERA_AVALON_PIO_DATA(base, data) IOWR(base, 0, data) - -#define IOADDR_ALTERA_AVALON_PIO_DIRECTION(base) __IO_CALC_ADDRESS_NATIVE(base, 1) -#define IORD_ALTERA_AVALON_PIO_DIRECTION(base) IORD(base, 1) -#define IOWR_ALTERA_AVALON_PIO_DIRECTION(base, data) IOWR(base, 1, data) - -#define IOADDR_ALTERA_AVALON_PIO_IRQ_MASK(base) __IO_CALC_ADDRESS_NATIVE(base, 2) -#define IORD_ALTERA_AVALON_PIO_IRQ_MASK(base) IORD(base, 2) -#define IOWR_ALTERA_AVALON_PIO_IRQ_MASK(base, data) IOWR(base, 2, data) - -#define IOADDR_ALTERA_AVALON_PIO_EDGE_CAP(base) __IO_CALC_ADDRESS_NATIVE(base, 3) -#define IORD_ALTERA_AVALON_PIO_EDGE_CAP(base) IORD(base, 3) -#define IOWR_ALTERA_AVALON_PIO_EDGE_CAP(base, data) IOWR(base, 3, data) - - -#define IOADDR_ALTERA_AVALON_PIO_SET_BIT(base) __IO_CALC_ADDRESS_NATIVE(base, 4) -#define IORD_ALTERA_AVALON_PIO_SET_BITS(base) IORD(base, 4) -#define IOWR_ALTERA_AVALON_PIO_SET_BITS(base, data) IOWR(base, 4, data) - -#define IOADDR_ALTERA_AVALON_PIO_CLEAR_BITS(base) __IO_CALC_ADDRESS_NATIVE(base, 5) -#define IORD_ALTERA_AVALON_PIO_CLEAR_BITS(base) IORD(base, 5) -#define IOWR_ALTERA_AVALON_PIO_CLEAR_BITS(base, data) IOWR(base, 5, data) - - - -/* Defintions for direction-register operation with bi-directional PIOs */ -#define ALTERA_AVALON_PIO_DIRECTION_INPUT 0 -#define ALTERA_AVALON_PIO_DIRECTION_OUTPUT 1 - -#endif /* __ALTERA_AVALON_PIO_REGS_H__ */ diff --git a/software/qsys_tutorial_key3_bsp/drivers/src/altera_avalon_jtag_uart_fd.c b/software/qsys_tutorial_key3_bsp/drivers/src/altera_avalon_jtag_uart_fd.c deleted file mode 100644 index 53dfc3b..0000000 --- a/software/qsys_tutorial_key3_bsp/drivers/src/altera_avalon_jtag_uart_fd.c +++ /dev/null @@ -1,86 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "alt_types.h" -#include "sys/alt_dev.h" -#include "altera_avalon_jtag_uart.h" - -extern int altera_avalon_jtag_uart_read(altera_avalon_jtag_uart_state* sp, - char* buffer, int space, int flags); -extern int altera_avalon_jtag_uart_write(altera_avalon_jtag_uart_state* sp, - const char* ptr, int count, int flags); -extern int altera_avalon_jtag_uart_ioctl(altera_avalon_jtag_uart_state* sp, - int req, void* arg); -extern int altera_avalon_jtag_uart_close(altera_avalon_jtag_uart_state* sp, - int flags); - -/* ----------------------------------------------------------------------- */ -/* --------------------- WRAPPERS FOR ALT FD SUPPORT --------------------- */ -/* - * - */ - -int -altera_avalon_jtag_uart_read_fd(alt_fd* fd, char* buffer, int space) -{ - altera_avalon_jtag_uart_dev* dev = (altera_avalon_jtag_uart_dev*) fd->dev; - - return altera_avalon_jtag_uart_read(&dev->state, buffer, space, - fd->fd_flags); -} - -int -altera_avalon_jtag_uart_write_fd(alt_fd* fd, const char* buffer, int space) -{ - altera_avalon_jtag_uart_dev* dev = (altera_avalon_jtag_uart_dev*) fd->dev; - - return altera_avalon_jtag_uart_write(&dev->state, buffer, space, - fd->fd_flags); -} - -#ifndef ALTERA_AVALON_JTAG_UART_SMALL - -int -altera_avalon_jtag_uart_close_fd(alt_fd* fd) -{ - altera_avalon_jtag_uart_dev* dev = (altera_avalon_jtag_uart_dev*) fd->dev; - - return altera_avalon_jtag_uart_close(&dev->state, fd->fd_flags); -} - -int -altera_avalon_jtag_uart_ioctl_fd(alt_fd* fd, int req, void* arg) -{ - altera_avalon_jtag_uart_dev* dev = (altera_avalon_jtag_uart_dev*) fd->dev; - - return altera_avalon_jtag_uart_ioctl(&dev->state, req, arg); -} - -#endif /* ALTERA_AVALON_JTAG_UART_SMALL */ diff --git a/software/qsys_tutorial_key3_bsp/drivers/src/altera_avalon_jtag_uart_init.c b/software/qsys_tutorial_key3_bsp/drivers/src/altera_avalon_jtag_uart_init.c deleted file mode 100644 index 7317bec..0000000 --- a/software/qsys_tutorial_key3_bsp/drivers/src/altera_avalon_jtag_uart_init.c +++ /dev/null @@ -1,256 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include -#include -#include -#include - -#include - -#include "sys/alt_irq.h" -#include "sys/alt_alarm.h" -#include "sys/ioctl.h" -#include "alt_types.h" - -#include "altera_avalon_jtag_uart_regs.h" -#include "altera_avalon_jtag_uart.h" - -#include "sys/alt_log_printf.h" - -#ifndef ALTERA_AVALON_JTAG_UART_SMALL - -/* ----------------------------------------------------------- */ -/* ------------------------- FAST DRIVER --------------------- */ -/* ----------------------------------------------------------- */ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT -static void altera_avalon_jtag_uart_irq(void* context); -#else -static void altera_avalon_jtag_uart_irq(void* context, alt_u32 id); -#endif -static alt_u32 altera_avalon_jtag_uart_timeout(void* context); - -/* - * Driver initialization code. Register interrupts and start a timer - * which we can use to check whether the host is there. - * Return 1 on sucessful IRQ register and 0 on failure. - */ - -void altera_avalon_jtag_uart_init(altera_avalon_jtag_uart_state* sp, - int irq_controller_id, int irq) -{ - ALT_FLAG_CREATE(&sp->events, 0); - ALT_SEM_CREATE(&sp->read_lock, 1); - ALT_SEM_CREATE(&sp->write_lock, 1); - - /* enable read interrupts at the device */ - sp->irq_enable = ALTERA_AVALON_JTAG_UART_CONTROL_RE_MSK; - - IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base, sp->irq_enable); - - /* register the interrupt handler */ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - alt_ic_isr_register(irq_controller_id, irq, altera_avalon_jtag_uart_irq, - sp, NULL); -#else - alt_irq_register(irq, sp, altera_avalon_jtag_uart_irq); -#endif - - /* Register an alarm to go off every second to check for presence of host */ - sp->host_inactive = 0; - - if (alt_alarm_start(&sp->alarm, alt_ticks_per_second(), - &altera_avalon_jtag_uart_timeout, sp) < 0) - { - /* If we can't set the alarm then record "don't know if host present" - * and behave as though the host is present. - */ - sp->timeout = INT_MAX; - } - - /* ALT_LOG - see altera_hal/HAL/inc/sys/alt_log_printf.h */ - ALT_LOG_JTAG_UART_ALARM_REGISTER(sp, sp->base); -} - -/* - * Interrupt routine - */ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT -static void altera_avalon_jtag_uart_irq(void* context) -#else -static void altera_avalon_jtag_uart_irq(void* context, alt_u32 id) -#endif -{ - altera_avalon_jtag_uart_state* sp = (altera_avalon_jtag_uart_state*) context; - unsigned int base = sp->base; - - /* ALT_LOG - see altera_hal/HAL/inc/sys/alt_log_printf.h */ - ALT_LOG_JTAG_UART_ISR_FUNCTION(base, sp); - - for ( ; ; ) - { - unsigned int control = IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base); - - /* Return once nothing more to do */ - if ((control & (ALTERA_AVALON_JTAG_UART_CONTROL_RI_MSK | ALTERA_AVALON_JTAG_UART_CONTROL_WI_MSK)) == 0) - break; - - if (control & ALTERA_AVALON_JTAG_UART_CONTROL_RI_MSK) - { - /* process a read irq. Start by assuming that there is data in the - * receive FIFO (otherwise why would we have been interrupted?) - */ - unsigned int data = 1 << ALTERA_AVALON_JTAG_UART_DATA_RAVAIL_OFST; - - for ( ; ; ) - { - /* Check whether there is space in the buffer. If not then we must not - * read any characters from the buffer as they will be lost. - */ - unsigned int next = (sp->rx_in + 1) % ALTERA_AVALON_JTAG_UART_BUF_LEN; - if (next == sp->rx_out) - break; - - /* Try to remove a character from the FIFO and find out whether there - * are any more characters remaining. - */ - data = IORD_ALTERA_AVALON_JTAG_UART_DATA(base); - - if ((data & ALTERA_AVALON_JTAG_UART_DATA_RVALID_MSK) == 0) - break; - - sp->rx_buf[sp->rx_in] = (data & ALTERA_AVALON_JTAG_UART_DATA_DATA_MSK) >> ALTERA_AVALON_JTAG_UART_DATA_DATA_OFST; - sp->rx_in = (sp->rx_in + 1) % ALTERA_AVALON_JTAG_UART_BUF_LEN; - - /* Post an event to notify jtag_uart_read that a character has been read */ - ALT_FLAG_POST (sp->events, ALT_JTAG_UART_READ_RDY, OS_FLAG_SET); - } - - if (data & ALTERA_AVALON_JTAG_UART_DATA_RAVAIL_MSK) - { - /* If there is still data available here then the buffer is full - * so turn off receive interrupts until some space becomes available. - */ - sp->irq_enable &= ~ALTERA_AVALON_JTAG_UART_CONTROL_RE_MSK; - IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(base, sp->irq_enable); - - /* Dummy read to ensure IRQ is cleared prior to ISR completion */ - IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base); - } - } - - if (control & ALTERA_AVALON_JTAG_UART_CONTROL_WI_MSK) - { - /* process a write irq */ - unsigned int space = (control & ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_MSK) >> ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_OFST; - - while (space > 0 && sp->tx_out != sp->tx_in) - { - IOWR_ALTERA_AVALON_JTAG_UART_DATA(base, sp->tx_buf[sp->tx_out]); - - sp->tx_out = (sp->tx_out + 1) % ALTERA_AVALON_JTAG_UART_BUF_LEN; - - /* Post an event to notify jtag_uart_write that a character has been written */ - ALT_FLAG_POST (sp->events, ALT_JTAG_UART_WRITE_RDY, OS_FLAG_SET); - - space--; - } - - if (space > 0) - { - /* If we don't have any more data available then turn off the TX interrupt */ - sp->irq_enable &= ~ALTERA_AVALON_JTAG_UART_CONTROL_WE_MSK; - IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base, sp->irq_enable); - - /* Dummy read to ensure IRQ is cleared prior to ISR completion */ - IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base); - } - } - } -} - -/* - * Timeout routine is called every second - */ - -static alt_u32 -altera_avalon_jtag_uart_timeout(void* context) -{ - altera_avalon_jtag_uart_state* sp = (altera_avalon_jtag_uart_state *) context; - - unsigned int control = IORD_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base); - - if (control & ALTERA_AVALON_JTAG_UART_CONTROL_AC_MSK) - { - IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base, sp->irq_enable | ALTERA_AVALON_JTAG_UART_CONTROL_AC_MSK); - sp->host_inactive = 0; - } - else if (sp->host_inactive < INT_MAX - 2) { - sp->host_inactive++; - - if (sp->host_inactive >= sp->timeout) { - /* Post an event to indicate host is inactive (for jtag_uart_read */ - ALT_FLAG_POST (sp->events, ALT_JTAG_UART_TIMEOUT, OS_FLAG_SET); - } - } - - return alt_ticks_per_second(); -} - -/* - * The close() routine is implemented to drain the JTAG UART transmit buffer - * when not in "small" mode. This routine will wait for transimt data to be - * emptied unless a timeout from host-activity occurs. If the driver flags - * have been set to non-blocking mode, this routine will exit immediately if - * any data remains. This routine should be called indirectly (i.e. though - * the C library close() routine) so that the file descriptor associated - * with the relevant stream (i.e. stdout) can be closed as well. This routine - * does not manage file descriptors. - * - * The close routine is not implemented for the small driver; instead it will - * map to null. This is because the small driver simply waits while characters - * are transmitted; there is no interrupt-serviced buffer to empty - */ -int altera_avalon_jtag_uart_close(altera_avalon_jtag_uart_state* sp, int flags) -{ - /* - * Wait for all transmit data to be emptied by the JTAG UART ISR, or - * for a host-inactivity timeout, in which case transmit data will be lost - */ - while ( (sp->tx_out != sp->tx_in) && (sp->host_inactive < sp->timeout) ) { - if (flags & O_NONBLOCK) { - return -EWOULDBLOCK; - } - } - - return 0; -} - -#endif /* !ALTERA_AVALON_JTAG_UART_SMALL */ diff --git a/software/qsys_tutorial_key3_bsp/drivers/src/altera_avalon_jtag_uart_ioctl.c b/software/qsys_tutorial_key3_bsp/drivers/src/altera_avalon_jtag_uart_ioctl.c deleted file mode 100644 index cf71e6f..0000000 --- a/software/qsys_tutorial_key3_bsp/drivers/src/altera_avalon_jtag_uart_ioctl.c +++ /dev/null @@ -1,86 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include -#include -#include -#include - -#include - -#include "sys/ioctl.h" -#include "alt_types.h" - -#include "altera_avalon_jtag_uart_regs.h" -#include "altera_avalon_jtag_uart.h" - -#include "sys/alt_log_printf.h" - -#ifndef ALTERA_AVALON_JTAG_UART_SMALL - -/* ----------------------------------------------------------- */ -/* ------------------------- FAST DRIVER --------------------- */ -/* ----------------------------------------------------------- */ - -int -altera_avalon_jtag_uart_ioctl(altera_avalon_jtag_uart_state* sp, int req, - void* arg) -{ - int rc = -ENOTTY; - - switch (req) - { - case TIOCSTIMEOUT: - /* Set the time to wait until assuming host is not connected */ - if (sp->timeout != INT_MAX) - { - int timeout = *((int *)arg); - sp->timeout = (timeout >= 2 && timeout < INT_MAX) ? timeout : INT_MAX - 1; - rc = 0; - } - break; - - case TIOCGCONNECTED: - /* Find out whether host is connected */ - if (sp->timeout != INT_MAX) - { - *((int *)arg) = (sp->host_inactive < sp->timeout) ? 1 : 0; - rc = 0; - } - break; - - default: - break; - } - - return rc; -} - -#endif /* !ALTERA_AVALON_JTAG_UART_SMALL */ diff --git a/software/qsys_tutorial_key3_bsp/drivers/src/altera_avalon_jtag_uart_read.c b/software/qsys_tutorial_key3_bsp/drivers/src/altera_avalon_jtag_uart_read.c deleted file mode 100644 index 5657adb..0000000 --- a/software/qsys_tutorial_key3_bsp/drivers/src/altera_avalon_jtag_uart_read.c +++ /dev/null @@ -1,205 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include -#include -#include -#include - -#include - -#include "sys/alt_irq.h" -#include "sys/alt_alarm.h" -#include "sys/ioctl.h" -#include "alt_types.h" - -#include "altera_avalon_jtag_uart_regs.h" -#include "altera_avalon_jtag_uart.h" - -#include "sys/alt_log_printf.h" - -#ifdef __ucosii__ -#include "includes.h" -#endif /* __ucosii__ */ - -#ifdef ALTERA_AVALON_JTAG_UART_SMALL - -/* ----------------------------------------------------------- */ -/* ----------------------- SMALL DRIVER ---------------------- */ -/* ----------------------------------------------------------- */ - -/* Read routine. The small version blocks until it has at least one byte - * available, it then returns as much as is immediately available without - * waiting any more. It's performance will be very poor without - * interrupts. - */ - -int -altera_avalon_jtag_uart_read(altera_avalon_jtag_uart_state* sp, - char* buffer, int space, int flags) -{ - unsigned int base = sp->base; - - char * ptr = buffer; - char * end = buffer + space; - - while (ptr < end) - { - unsigned int data = IORD_ALTERA_AVALON_JTAG_UART_DATA(base); - - if (data & ALTERA_AVALON_JTAG_UART_DATA_RVALID_MSK) - *ptr++ = (data & ALTERA_AVALON_JTAG_UART_DATA_DATA_MSK) >> ALTERA_AVALON_JTAG_UART_DATA_DATA_OFST; - else if (ptr != buffer) - break; - else if(flags & O_NONBLOCK) - break; - - } - - if (ptr != buffer) - return ptr - buffer; - else if (flags & O_NONBLOCK) - return -EWOULDBLOCK; - else - return -EIO; -} - -#else /* !ALTERA_AVALON_JTAG_UART_SMALL */ - -/* ----------------------------------------------------------- */ -/* ----------------------- FAST DRIVER ----------------------- */ -/* ----------------------------------------------------------- */ - -int -altera_avalon_jtag_uart_read(altera_avalon_jtag_uart_state* sp, - char * buffer, int space, int flags) -{ - char * ptr = buffer; - - alt_irq_context context; - unsigned int n; - - /* - * When running in a multi threaded environment, obtain the "read_lock" - * semaphore. This ensures that reading from the device is thread-safe. - */ - ALT_SEM_PEND (sp->read_lock, 0); - - while (space > 0) - { - unsigned int in, out; - - /* Read as much data as possible */ - do - { - in = sp->rx_in; - out = sp->rx_out; - - if (in >= out) - n = in - out; - else - n = ALTERA_AVALON_JTAG_UART_BUF_LEN - out; - - if (n == 0) - break; /* No more data available */ - - if (n > space) - n = space; - - memcpy(ptr, sp->rx_buf + out, n); - ptr += n; - space -= n; - - sp->rx_out = (out + n) % ALTERA_AVALON_JTAG_UART_BUF_LEN; - } - while (space > 0); - - /* If we read any data then return it */ - if (ptr != buffer) - break; - - /* If in non-blocking mode then return error */ - if (flags & O_NONBLOCK) - break; - -#ifdef __ucosii__ - /* OS Present: Pend on a flag if the OS is running, otherwise spin */ - if(OSRunning == OS_TRUE) { - /* - * When running in a multi-threaded mode, we pend on the read event - * flag set and timeout event flag set in the isr. This avoids wasting CPU - * cycles waiting in this thread, when we could be doing something more - * profitable elsewhere. - */ - ALT_FLAG_PEND (sp->events, - ALT_JTAG_UART_READ_RDY | ALT_JTAG_UART_TIMEOUT, - OS_FLAG_WAIT_SET_ANY + OS_FLAG_CONSUME, - 0); - } - else { - /* Spin until more data arrives or until host disconnects */ - while (in == sp->rx_in && sp->host_inactive < sp->timeout) - ; - } -#else - /* No OS: Always spin */ - while (in == sp->rx_in && sp->host_inactive < sp->timeout) - ; -#endif /* __ucosii__ */ - - if (in == sp->rx_in) - break; - } - - /* - * Now that access to the circular buffer is complete, release the read - * semaphore so that other threads can access the buffer. - */ - - ALT_SEM_POST (sp->read_lock); - - if (ptr != buffer) - { - /* If we read any data then there is space in the buffer so enable interrupts */ - context = alt_irq_disable_all(); - sp->irq_enable |= ALTERA_AVALON_JTAG_UART_CONTROL_RE_MSK; - IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base, sp->irq_enable); - alt_irq_enable_all(context); - } - - if (ptr != buffer) - return ptr - buffer; - else if (flags & O_NONBLOCK) - return -EWOULDBLOCK; - else - return -EIO; -} - -#endif /* ALTERA_AVALON_JTAG_UART_SMALL */ diff --git a/software/qsys_tutorial_key3_bsp/drivers/src/altera_avalon_jtag_uart_write.c b/software/qsys_tutorial_key3_bsp/drivers/src/altera_avalon_jtag_uart_write.c deleted file mode 100644 index 11aeca1..0000000 --- a/software/qsys_tutorial_key3_bsp/drivers/src/altera_avalon_jtag_uart_write.c +++ /dev/null @@ -1,217 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include -#include -#include -#include - -#include - -#include "sys/alt_irq.h" -#include "sys/alt_alarm.h" -#include "sys/ioctl.h" -#include "alt_types.h" - -#include "altera_avalon_jtag_uart_regs.h" -#include "altera_avalon_jtag_uart.h" - -#include "sys/alt_log_printf.h" - -#ifdef __ucosii__ -#include "includes.h" -#endif /* __ucosii__ */ - -#ifdef ALTERA_AVALON_JTAG_UART_SMALL - -/* ----------------------------------------------------------- */ -/* ------------------------ SMALL DRIVER --------------------- */ -/* ----------------------------------------------------------- */ - -/* Write routine. The small version blocks when there is no space to write - * into, so it's performance will be very bad if you are writing more than - * one FIFOs worth of data. But you said you didn't want to use interrupts :-) - */ - -int altera_avalon_jtag_uart_write(altera_avalon_jtag_uart_state* sp, - const char * ptr, int count, int flags) -{ - unsigned int base = sp->base; - - const char * end = ptr + count; - - while (ptr < end) - if ((IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base) & ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_MSK) != 0) - IOWR_ALTERA_AVALON_JTAG_UART_DATA(base, *ptr++); - - return count; -} - -#else /* !ALTERA_AVALON_JTAG_UART_SMALL */ - -/* ----------------------------------------------------------- */ -/* ------------------------- FAST DRIVER --------------------- */ -/* ----------------------------------------------------------- */ - -int -altera_avalon_jtag_uart_write(altera_avalon_jtag_uart_state* sp, - const char * ptr, int count, int flags) -{ - /* Remove warning at optimisation level 03 by seting out to 0 */ - unsigned int in, out=0; - unsigned int n; - alt_irq_context context; - - const char * start = ptr; - - /* - * When running in a multi threaded environment, obtain the "write_lock" - * semaphore. This ensures that writing to the device is thread-safe. - */ - ALT_SEM_PEND (sp->write_lock, 0); - - do - { - /* Copy as much as we can into the transmit buffer */ - while (count > 0) - { - /* We need a stable value of the out pointer to calculate the space available */ - in = sp->tx_in; - out = sp->tx_out; - - if (in < out) - n = out - 1 - in; - else if (out > 0) - n = ALTERA_AVALON_JTAG_UART_BUF_LEN - in; - else - n = ALTERA_AVALON_JTAG_UART_BUF_LEN - 1 - in; - - if (n == 0) - break; - - if (n > count) - n = count; - - memcpy(sp->tx_buf + in, ptr, n); - ptr += n; - count -= n; - - sp->tx_in = (in + n) % ALTERA_AVALON_JTAG_UART_BUF_LEN; - } - - /* - * If interrupts are disabled then we could transmit here, we only need - * to enable interrupts if there is no space left in the FIFO - * - * For now kick the interrupt routine every time to make it transmit - * the data - */ - context = alt_irq_disable_all(); - sp->irq_enable |= ALTERA_AVALON_JTAG_UART_CONTROL_WE_MSK; - IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base, sp->irq_enable); - alt_irq_enable_all(context); - - /* - * If there is any data left then either return now or block until - * some has been sent - */ - /* consider: test whether there is anything there while doing this and delay for at most 2s. */ - if (count > 0) - { - if (flags & O_NONBLOCK) - break; - -#ifdef __ucosii__ - /* OS Present: Pend on a flag if the OS is running, otherwise spin */ - if(OSRunning == OS_TRUE) { - /* - * When running in a multi-threaded mode, we pend on the write event - * flag set or the timeout flag in the isr. This avoids wasting CPU - * cycles waiting in this thread, when we could be doing something - * more profitable elsewhere. - */ -#ifdef ALTERA_AVALON_JTAG_UART_IGNORE_FIFO_FULL_ERROR - if(!sp->host_inactive) -#endif - ALT_FLAG_PEND (sp->events, - ALT_JTAG_UART_WRITE_RDY | ALT_JTAG_UART_TIMEOUT, - OS_FLAG_WAIT_SET_ANY + OS_FLAG_CONSUME, - 0); - } - else { - /* - * OS not running: Wait for data to be removed from buffer. - * Once the interrupt routine has removed some data then we - * will be able to insert some more. - */ - while (out == sp->tx_out && sp->host_inactive < sp->timeout) - ; - } -#else - /* - * No OS present: Always wait for data to be removed from buffer. Once - * the interrupt routine has removed some data then we will be able to - * insert some more. - */ - while (out == sp->tx_out && sp->host_inactive < sp->timeout) - ; -#endif /* __ucosii__ */ - - if (out == sp->tx_out) - break; - } - } - while (count > 0); - - /* - * Now that access to the circular buffer is complete, release the write - * semaphore so that other threads can access the buffer. - */ - ALT_SEM_POST (sp->write_lock); - - if (ptr != start) - return ptr - start; - else if (flags & O_NONBLOCK) - return -EWOULDBLOCK; -#ifdef ALTERA_AVALON_JTAG_UART_IGNORE_FIFO_FULL_ERROR - else if (sp->host_inactive >= sp->timeout) { - /* - * Reset the software FIFO, hardware FIFO could not be reset. - * Just throw away characters without reporting error. - */ - sp->tx_out = sp->tx_in = 0; - return ptr - start + count; - } -#endif - else - return -EIO; /* Host not connected */ -} - -#endif /* ALTERA_AVALON_JTAG_UART_SMALL */ diff --git a/software/qsys_tutorial_key3_bsp/libhal_bsp.a b/software/qsys_tutorial_key3_bsp/libhal_bsp.a deleted file mode 100644 index cfc9e65..0000000 --- a/software/qsys_tutorial_key3_bsp/libhal_bsp.a +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/linker.h b/software/qsys_tutorial_key3_bsp/linker.h deleted file mode 100644 index db29027..0000000 --- a/software/qsys_tutorial_key3_bsp/linker.h +++ /dev/null @@ -1,101 +0,0 @@ -/* - * linker.h - Linker script mapping information - * - * Machine generated for CPU 'nios2_processor' in SOPC Builder design 'nios_system' - * SOPC Builder design path: C:/Users/takayun/Documents/DE2-115/qsys_tutorial/nios_system.sopcinfo - * - * Generated: Thu Nov 10 10:49:51 JST 2016 - */ - -/* - * DO NOT MODIFY THIS FILE - * - * Changing this file will have subtle consequences - * which will almost certainly lead to a nonfunctioning - * system. If you do modify this file, be aware that your - * changes will be overwritten and lost when this file - * is generated again. - * - * DO NOT MODIFY THIS FILE - */ - -/* - * License Agreement - * - * Copyright (c) 2008 - * Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - * - * This agreement shall be governed in all respects by the laws of the State - * of California and by the laws of the United States of America. - */ - -#ifndef __LINKER_H_ -#define __LINKER_H_ - - -/* - * BSP controls alt_load() behavior in crt0. - * - */ - -#define ALT_LOAD_EXPLICITLY_CONTROLLED - - -/* - * Base address and span (size in bytes) of each linker region - * - */ - -#define ONCHIP_MEMORY_REGION_BASE 0x20 -#define ONCHIP_MEMORY_REGION_SPAN 4064 -#define RESET_REGION_BASE 0x0 -#define RESET_REGION_SPAN 32 - - -/* - * Devices associated with code sections - * - */ - -#define ALT_EXCEPTIONS_DEVICE ONCHIP_MEMORY -#define ALT_RESET_DEVICE ONCHIP_MEMORY -#define ALT_RODATA_DEVICE ONCHIP_MEMORY -#define ALT_RWDATA_DEVICE ONCHIP_MEMORY -#define ALT_TEXT_DEVICE ONCHIP_MEMORY - - -/* - * Initialization code at the reset address is allowed (e.g. no external bootloader). - * - */ - -#define ALT_ALLOW_CODE_AT_RESET - - -/* - * The alt_load() facility is called from crt0 to copy sections into RAM. - * - */ - -#define ALT_LOAD_COPY_RWDATA - -#endif /* __LINKER_H_ */ diff --git a/software/qsys_tutorial_key3_bsp/linker.x b/software/qsys_tutorial_key3_bsp/linker.x deleted file mode 100644 index a41d6ec..0000000 --- a/software/qsys_tutorial_key3_bsp/linker.x +++ /dev/null @@ -1,385 +0,0 @@ -/* - * linker.x - Linker script - * - * Machine generated for CPU 'nios2_processor' in SOPC Builder design 'nios_system' - * SOPC Builder design path: C:/Users/takayun/Documents/DE2-115/qsys_tutorial/nios_system.sopcinfo - * - * Generated: Thu Nov 10 10:49:51 JST 2016 - */ - -/* - * DO NOT MODIFY THIS FILE - * - * Changing this file will have subtle consequences - * which will almost certainly lead to a nonfunctioning - * system. If you do modify this file, be aware that your - * changes will be overwritten and lost when this file - * is generated again. - * - * DO NOT MODIFY THIS FILE - */ - -/* - * License Agreement - * - * Copyright (c) 2008 - * Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - * - * This agreement shall be governed in all respects by the laws of the State - * of California and by the laws of the United States of America. - */ - -MEMORY -{ - reset : ORIGIN = 0x0, LENGTH = 32 - onchip_memory : ORIGIN = 0x20, LENGTH = 4064 -} - -/* Define symbols for each memory base-address */ -__alt_mem_onchip_memory = 0x0; - -OUTPUT_FORMAT( "elf32-littlenios2", - "elf32-littlenios2", - "elf32-littlenios2" ) -OUTPUT_ARCH( nios2 ) -ENTRY( _start ) - -/* - * The alt_load() facility is enabled. This typically happens when there isn't - * an external bootloader (e.g. flash bootloader). - * The LMA (aka physical address) of each loaded section is - * set to the .text memory device. - * The HAL alt_load() routine called from crt0 copies sections from - * the .text memory to RAM as needed. - */ - -SECTIONS -{ - - /* - * Output sections associated with reset and exceptions (they have to be first) - */ - - .entry : - { - KEEP (*(.entry)) - } > reset - - .exceptions : - { - PROVIDE (__ram_exceptions_start = ABSOLUTE(.)); - . = ALIGN(0x20); - KEEP (*(.irq)); - KEEP (*(.exceptions.entry.label)); - KEEP (*(.exceptions.entry.user)); - KEEP (*(.exceptions.entry)); - KEEP (*(.exceptions.irqtest.user)); - KEEP (*(.exceptions.irqtest)); - KEEP (*(.exceptions.irqhandler.user)); - KEEP (*(.exceptions.irqhandler)); - KEEP (*(.exceptions.irqreturn.user)); - KEEP (*(.exceptions.irqreturn)); - KEEP (*(.exceptions.notirq.label)); - KEEP (*(.exceptions.notirq.user)); - KEEP (*(.exceptions.notirq)); - KEEP (*(.exceptions.soft.user)); - KEEP (*(.exceptions.soft)); - KEEP (*(.exceptions.unknown.user)); - KEEP (*(.exceptions.unknown)); - KEEP (*(.exceptions.exit.label)); - KEEP (*(.exceptions.exit.user)); - KEEP (*(.exceptions.exit)); - KEEP (*(.exceptions)); - PROVIDE (__ram_exceptions_end = ABSOLUTE(.)); - } > onchip_memory - - PROVIDE (__flash_exceptions_start = LOADADDR(.exceptions)); - - .text : - { - /* - * All code sections are merged into the text output section, along with - * the read only data sections. - * - */ - - PROVIDE (stext = ABSOLUTE(.)); - - *(.interp) - *(.hash) - *(.dynsym) - *(.dynstr) - *(.gnu.version) - *(.gnu.version_d) - *(.gnu.version_r) - *(.rel.init) - *(.rela.init) - *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) - *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) - *(.rel.fini) - *(.rela.fini) - *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) - *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) - *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) - *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) - *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) - *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) - *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) - *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) - *(.rel.ctors) - *(.rela.ctors) - *(.rel.dtors) - *(.rela.dtors) - *(.rel.got) - *(.rela.got) - *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) - *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) - *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) - *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) - *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) - *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) - *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) - *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) - *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) - *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) - *(.rel.plt) - *(.rela.plt) - *(.rel.dyn) - - KEEP (*(.init)) - *(.plt) - *(.text .stub .text.* .gnu.linkonce.t.*) - - /* .gnu.warning sections are handled specially by elf32.em. */ - - *(.gnu.warning.*) - KEEP (*(.fini)) - PROVIDE (__etext = ABSOLUTE(.)); - PROVIDE (_etext = ABSOLUTE(.)); - PROVIDE (etext = ABSOLUTE(.)); - - *(.eh_frame_hdr) - /* Ensure the __preinit_array_start label is properly aligned. We - could instead move the label definition inside the section, but - the linker would then create the section even if it turns out to - be empty, which isn't pretty. */ - . = ALIGN(4); - PROVIDE (__preinit_array_start = ABSOLUTE(.)); - *(.preinit_array) - PROVIDE (__preinit_array_end = ABSOLUTE(.)); - PROVIDE (__init_array_start = ABSOLUTE(.)); - *(.init_array) - PROVIDE (__init_array_end = ABSOLUTE(.)); - PROVIDE (__fini_array_start = ABSOLUTE(.)); - *(.fini_array) - PROVIDE (__fini_array_end = ABSOLUTE(.)); - SORT(CONSTRUCTORS) - KEEP (*(.eh_frame)) - *(.gcc_except_table) - *(.dynamic) - PROVIDE (__CTOR_LIST__ = ABSOLUTE(.)); - KEEP (*(.ctors)) - KEEP (*(SORT(.ctors.*))) - PROVIDE (__CTOR_END__ = ABSOLUTE(.)); - PROVIDE (__DTOR_LIST__ = ABSOLUTE(.)); - KEEP (*(.dtors)) - KEEP (*(SORT(.dtors.*))) - PROVIDE (__DTOR_END__ = ABSOLUTE(.)); - KEEP (*(.jcr)) - . = ALIGN(4); - } > onchip_memory = 0x3a880100 /* Nios II NOP instruction */ - - .rodata : - { - PROVIDE (__ram_rodata_start = ABSOLUTE(.)); - . = ALIGN(4); - *(.rodata .rodata.* .gnu.linkonce.r.*) - *(.rodata1) - . = ALIGN(4); - PROVIDE (__ram_rodata_end = ABSOLUTE(.)); - } > onchip_memory - - PROVIDE (__flash_rodata_start = LOADADDR(.rodata)); - - /* - * - * This section's LMA is set to the .text region. - * crt0 will copy to this section's specified mapped region virtual memory address (VMA) - * - * .rwdata region equals the .text region, and is set to be loaded into .text region. - * This requires two copies of .rwdata in the .text region. One read writable at VMA. - * and one read-only at LMA. crt0 will copy from LMA to VMA on reset - * - */ - - .rwdata LOADADDR (.rodata) + SIZEOF (.rodata) : AT ( LOADADDR (.rodata) + SIZEOF (.rodata)+ SIZEOF (.rwdata) ) - { - PROVIDE (__ram_rwdata_start = ABSOLUTE(.)); - . = ALIGN(4); - *(.got.plt) *(.got) - *(.data1) - *(.data .data.* .gnu.linkonce.d.*) - - _gp = ABSOLUTE(. + 0x8000); - PROVIDE(gp = _gp); - - *(.rwdata .rwdata.*) - *(.sdata .sdata.* .gnu.linkonce.s.*) - *(.sdata2 .sdata2.* .gnu.linkonce.s2.*) - - . = ALIGN(4); - _edata = ABSOLUTE(.); - PROVIDE (edata = ABSOLUTE(.)); - PROVIDE (__ram_rwdata_end = ABSOLUTE(.)); - } > onchip_memory - - PROVIDE (__flash_rwdata_start = LOADADDR(.rwdata)); - - /* - * - * This section's LMA is set to the .text region. - * crt0 will copy to this section's specified mapped region virtual memory address (VMA) - * - */ - - .bss LOADADDR (.rwdata) + SIZEOF (.rwdata) : AT ( LOADADDR (.rwdata) + SIZEOF (.rwdata) ) - { - __bss_start = ABSOLUTE(.); - PROVIDE (__sbss_start = ABSOLUTE(.)); - PROVIDE (___sbss_start = ABSOLUTE(.)); - - *(.dynsbss) - *(.sbss .sbss.* .gnu.linkonce.sb.*) - *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) - *(.scommon) - - PROVIDE (__sbss_end = ABSOLUTE(.)); - PROVIDE (___sbss_end = ABSOLUTE(.)); - - *(.dynbss) - *(.bss .bss.* .gnu.linkonce.b.*) - *(COMMON) - - . = ALIGN(4); - __bss_end = ABSOLUTE(.); - } > onchip_memory - - /* - * - * One output section mapped to the associated memory device for each of - * the available memory devices. These are not used by default, but can - * be used by user applications by using the .section directive. - * - * The output section used for the heap is treated in a special way, - * i.e. the symbols "end" and "_end" are added to point to the heap start. - * - * Because alt_load() is enabled, these sections have - * their LMA set to be loaded into the .text memory region. - * However, the alt_load() code will NOT automatically copy - * these sections into their mapped memory region. - * - */ - - /* - * - * This section's LMA is set to the .text region. - * crt0 will copy to this section's specified mapped region virtual memory address (VMA) - * - */ - - .onchip_memory LOADADDR (.bss) + SIZEOF (.bss) : AT ( LOADADDR (.bss) + SIZEOF (.bss) ) - { - PROVIDE (_alt_partition_onchip_memory_start = ABSOLUTE(.)); - *(.onchip_memory. onchip_memory.*) - . = ALIGN(4); - PROVIDE (_alt_partition_onchip_memory_end = ABSOLUTE(.)); - _end = ABSOLUTE(.); - end = ABSOLUTE(.); - __alt_stack_base = ABSOLUTE(.); - } > onchip_memory - - PROVIDE (_alt_partition_onchip_memory_load_addr = LOADADDR(.onchip_memory)); - - /* - * Stabs debugging sections. - * - */ - - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - /* DWARF debug sections. - Symbols in the DWARF debugging sections are relative to the beginning - of the section so we begin them at 0. */ - /* DWARF 1 */ - .debug 0 : { *(.debug) } - .line 0 : { *(.line) } - /* GNU DWARF 1 extensions */ - .debug_srcinfo 0 : { *(.debug_srcinfo) } - .debug_sfnames 0 : { *(.debug_sfnames) } - /* DWARF 1.1 and DWARF 2 */ - .debug_aranges 0 : { *(.debug_aranges) } - .debug_pubnames 0 : { *(.debug_pubnames) } - /* DWARF 2 */ - .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_line 0 : { *(.debug_line) } - .debug_frame 0 : { *(.debug_frame) } - .debug_str 0 : { *(.debug_str) } - .debug_loc 0 : { *(.debug_loc) } - .debug_macinfo 0 : { *(.debug_macinfo) } - /* SGI/MIPS DWARF 2 extensions */ - .debug_weaknames 0 : { *(.debug_weaknames) } - .debug_funcnames 0 : { *(.debug_funcnames) } - .debug_typenames 0 : { *(.debug_typenames) } - .debug_varnames 0 : { *(.debug_varnames) } - - /* Altera debug extensions */ - .debug_alt_sim_info 0 : { *(.debug_alt_sim_info) } -} - -/* provide a pointer for the stack */ - -/* - * Don't override this, override the __alt_stack_* symbols instead. - */ -__alt_data_end = 0x1000; - -/* - * The next two symbols define the location of the default stack. You can - * override them to move the stack to a different memory. - */ -PROVIDE( __alt_stack_pointer = __alt_data_end ); -PROVIDE( __alt_stack_limit = __alt_stack_base ); - -/* - * This symbol controls where the start of the heap is. If the stack is - * contiguous with the heap then the stack will contract as memory is - * allocated to the heap. - * Override this symbol to put the heap in a different memory. - */ -PROVIDE( __alt_heap_start = end ); -PROVIDE( __alt_heap_limit = 0x1000 ); diff --git a/software/qsys_tutorial_key3_bsp/mem_init.mk b/software/qsys_tutorial_key3_bsp/mem_init.mk deleted file mode 100644 index 4caaef9..0000000 --- a/software/qsys_tutorial_key3_bsp/mem_init.mk +++ /dev/null @@ -1,322 +0,0 @@ - -######################################################################### -####### M E M I N I T M A K E F I L E C O N T E N T ###### -######################################################################### - -######################################################################### -# This file is intended to be included by public.mk -# -# -# The following variables must be defined before including this file: -# - ELF -# -# The following variables may be defined to override the default behavior: -# - HDL_SIM_DIR -# - HDL_SIM_INSTALL_DIR -# - MEM_INIT_DIR -# - MEM_INIT_INSTALL_DIR -# - QUARTUS_PROJECT_DIR -# - SOPC_NAME -# - SIM_OPTIMIZE -# - RESET_ADDRESS -# -######################################################################### - -ifeq ($(MEM_INIT_FILE),) -# MEM_INIT_FILE should be set equal to the working relative path to this -# mem_init.mk makefile fragment -MEM_INIT_FILE := $(wildcard $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))) -endif - -ifeq ($(ELF2DAT),) -ELF2DAT := elf2dat -endif - -ifeq ($(ELF2HEX),) -ELF2HEX := elf2hex -endif - -ifeq ($(ELF2FLASH),) -ELF2FLASH := elf2flash -endif - -ifeq ($(FLASH2DAT),) -FLASH2DAT := flash2dat -endif - -ifeq ($(NM),) -NM := nios2-elf-nm -endif - -ifeq ($(MKDIR),) -MKDIR := mkdir -p -endif - -ifeq ($(RM),) -RM := rm -f -endif - -ifeq ($(CP),) -CP := cp -endif - -ifeq ($(ECHO),) -ECHO := echo -endif - -MEM_INIT_DIR ?= mem_init -HDL_SIM_DIR ?= $(MEM_INIT_DIR)/hdl_sim - -ifdef QUARTUS_PROJECT_DIR -MEM_INIT_INSTALL_DIR ?= $(patsubst %/,%,$(QUARTUS_PROJECT_DIR)) -ifdef SOPC_NAME -HDL_SIM_INSTALL_DIR ?= $(patsubst %/,%,$(QUARTUS_PROJECT_DIR))/$(SOPC_NAME)_sim -endif -endif - -MEM_INIT_DESCRIPTOR_FILE ?= $(MEM_INIT_DIR)/meminit.spd - -MEM_INIT_QIP_FILE ?= $(MEM_INIT_DIR)/meminit.qip - -#------------------------------------- -# Default Flash Boot Loaders -#------------------------------------- - -BOOT_LOADER_PATH ?= $(SOPC_KIT_NIOS2)/components/altera_nios2 -BOOT_LOADER_CFI ?= $(BOOT_LOADER_PATH)/boot_loader_cfi.srec -BOOT_LOADER_CFI_BE ?= $(BOOT_LOADER_PATH)/boot_loader_cfi_be.srec - - -#------------------------------------- -# Default Target -#------------------------------------- - -.PHONY: default_mem_init -ifeq ($(QSYS),1) -default_mem_init: mem_init_generate -else -default_mem_init: mem_init_install -endif -#------------------------------------- -# Runtime Macros -#------------------------------------- - -define post-process-info - @echo Post-processing to create $@... -endef - -target_stem = $(notdir $(basename $@)) - -mem_start_address = $($(target_stem)_START) -mem_end_address = $($(target_stem)_END) -mem_width = $($(target_stem)_WIDTH) -mem_endianness = $($(target_stem)_ENDIANNESS) -mem_create_lanes = $($(target_stem)_CREATE_LANES) - -mem_pad_flag = $($(target_stem)_PAD_FLAG) -mem_reloc_input_flag = $($(target_stem)_RELOC_INPUT_FLAG) -mem_no_zero_fill_flag = $($(target_stem)_NO_ZERO_FILL_FLAG) - -flash_mem_epcs_flag = $($(target_stem)_EPCS_FLAGS) -flash_mem_cfi_flag = $($(target_stem)_CFI_FLAGS) -flash_mem_boot_loader_flag = $($(target_stem)_BOOT_LOADER_FLAG) - -elf2dat_extra_args = $(mem_pad_flag) -elf2hex_extra_args = $(mem_no_zero_fill_flag) -elf2flash_extra_args = $(flash_mem_cfi_flag) $(flash_mem_epcs_flag) $(flash_mem_boot_loader_flag) -flash2dat_extra_args = $(mem_pad_flag) $(mem_reloc_input_flag) - -#------------------------------------------------------------------------------ -# BSP SPECIFIC CONTENT -# -# The content below is controlled by the BSP and SOPC System -#------------------------------------------------------------------------------ -#START OF BSP SPECIFIC - -#------------------------------------- -# Global Settings -#------------------------------------- - - -# The following TYPE comment allows tools to identify the 'type' of target this -# makefile is associated with. -# TYPE: BSP_MEMINIT_MAKEFILE - -# This following VERSION comment indicates the version of the tool used to -# generate this makefile. A makefile variable is provided for VERSION as well. -# ACDS_VERSION: 13.0sp1 -ACDS_VERSION := 13.0sp1 - -# This following BUILD_NUMBER comment indicates the build number of the tool -# used to generate this makefile. -# BUILD_NUMBER: 232 - -# Optimize for simulation -SIM_OPTIMIZE ?= 0 - -# The CPU reset address as needed by elf2flash -RESET_ADDRESS ?= 0x00000000 - -#------------------------------------- -# Pre-Initialized Memory Descriptions -#------------------------------------- - -# Memory: onchip_memory -MEM_0 := nios_system_onchip_memory -$(MEM_0)_NAME := onchip_memory -$(MEM_0)_MEM_INIT_FILE_PARAM_NAME := INIT_FILE -HEX_FILES += $(MEM_INIT_DIR)/$(MEM_0).hex -MEM_INIT_INSTALL_FILES += $(MEM_INIT_INSTALL_DIR)/$(MEM_0).hex -DAT_FILES += $(HDL_SIM_DIR)/$(MEM_0).dat -HDL_SIM_INSTALL_FILES += $(HDL_SIM_INSTALL_DIR)/$(MEM_0).dat -SYM_FILES += $(HDL_SIM_DIR)/$(MEM_0).sym -HDL_SIM_INSTALL_FILES += $(HDL_SIM_INSTALL_DIR)/$(MEM_0).sym -$(MEM_0)_START := 0x00000000 -$(MEM_0)_END := 0x00000fff -$(MEM_0)_HIERARCHICAL_PATH := onchip_memory -$(MEM_0)_WIDTH := 32 -$(MEM_0)_ENDIANNESS := --little-endian-mem -$(MEM_0)_CREATE_LANES := 0 - -.PHONY: onchip_memory -onchip_memory: check_elf_exists $(MEM_INIT_DIR)/$(MEM_0).hex $(HDL_SIM_DIR)/$(MEM_0).dat $(HDL_SIM_DIR)/$(MEM_0).sym - - -#END OF BSP SPECIFIC - -#------------------------------------- -# Pre-Initialized Memory Targets -#------------------------------------- - -.PHONY: mem_init_install mem_init_generate mem_init_clean - -ifeq ($(QSYS),1) -# Target mem_init_install is deprecated for QSys based systems -# To initialize onchip memories for Quartus II Synthesis with Qsys based systems: -# 1) Use "make mem_init_genearate" -# 2) Add the generated mem_init/meminit.qip file to your Quartus II Project -# -mem_init_install: - $(error Deprecated Makefile Target: '$@'. Use target 'mem_init_generate' and then add $(MEM_INIT_QIP_FILE) to your Quartus II Project) - -else # QSYS != 1, if SopcBuilder based system - -ifneq ($(MEM_INIT_INSTALL_DIR),) -mem_init_install: $(MEM_INIT_INSTALL_FILES) -endif - -ifneq ($(HDL_SIM_INSTALL_DIR),) -mem_init_install: $(HDL_SIM_INSTALL_FILES) -endif - -mem_init_install: mem_init_generate -ifeq ($(MEM_INIT_INSTALL_DIR),) - @echo "WARNING: MEM_INIT_INSTALL_DIR not set. Set your QUARTUS_PROJECT_DIR environment variable." -endif -ifeq ($(HDL_SIM_INSTALL_DIR),) - @echo "WARNING: HDL_SIM_INSTALL_DIR not set. Set your QUARTUS_PROJECT_DIR and SOPC_NAME environment variable." -endif - -$(MEM_INIT_INSTALL_FILES): $(MEM_INIT_INSTALL_DIR)/%: $(MEM_INIT_DIR)/% - @$(MKDIR) $(@D) - @$(CP) -v $< $@ - -$(HDL_SIM_INSTALL_FILES): $(HDL_SIM_INSTALL_DIR)/%: $(HDL_SIM_DIR)/% - @$(MKDIR) $(@D) - @$(CP) -v $< $@ - -endif # QSYS == 1 - - -mem_init_generate: hex dat sym flash $(MEM_INIT_DESCRIPTOR_FILE) $(MEM_INIT_QIP_FILE) - -mem_init_clean: - @$(RM) -r $(MEM_INIT_DIR) $(HDL_SIM_DIR) $(FLASH_FILES) - -.PHONY: hex dat sym flash - -hex: check_elf_exists $(HEX_FILES) - -dat: check_elf_exists $(DAT_FILES) - -sym: check_elf_exists $(SYM_FILES) - -flash: check_elf_exists $(FLASH_FILES) - -#------------------------------------- -# Pre-Initialized Memory Rules -#------------------------------------- - -.PHONY: check_elf_exists -check_elf_exists: $(ELF) -ifeq ($(ELF),) - $(error ELF var not set in mem_init.mk) -endif - -$(filter-out $(FLASH_DAT_FILES),$(DAT_FILES)): %.dat: $(ELF) - $(post-process-info) - @$(MKDIR) $(@D) - bash -c '$(ELF2DAT) --infile=$< --outfile=$@ \ - --base=$(mem_start_address) --end=$(mem_end_address) --width=$(mem_width) \ - $(mem_endianness) --create-lanes=$(mem_create_lanes) $(elf2dat_extra_args)' - -$(foreach i,0 1 2 3 4 5 6 7,%_lane$(i).dat): %.dat - @true - -$(HEX_FILES): %.hex: $(ELF) - $(post-process-info) - @$(MKDIR) $(@D) - bash -c '$(ELF2HEX) $< $(mem_start_address) $(mem_end_address) --width=$(mem_width) \ - $(mem_endianness) --create-lanes=$(mem_create_lanes) $(elf2hex_extra_args) $@' - -$(SYM_FILES): %.sym: $(ELF) - $(post-process-info) - @$(MKDIR) $(@D) - $(NM) -n $< > $@ - -$(FLASH_FILES): %.flash: $(ELF) - $(post-process-info) - @$(MKDIR) $(@D) - bash -c '$(ELF2FLASH) --input=$< --outfile=$@ --sim_optimize=$(SIM_OPTIMIZE) $(mem_endianness) \ - $(elf2flash_extra_args)' - -# -# Function generate_spd_entry -# Arg1: path to the memory initialization file -# Arg2: Type HEX or DAT -# Arg3: Output spd file to append -gen_spd_entry.BASE_FILE = $(basename $(notdir $1)) -gen_spd_entry.PARAM_NAME = $($(gen_spd_entry.BASE_FILE)_MEM_INIT_FILE_PARAM_NAME) -gen_spd_entry.MEM_PATH = $($(gen_spd_entry.BASE_FILE)_HIERARCHICAL_PATH) -gen_spd_entry.SETTINGS = $(strip \ - path=\"$1\" \ - type=\"$2\" \ - $(if $(gen_spd_entry.PARAM_NAME),initParamName=\"$(gen_spd_entry.PARAM_NAME)\") \ - $(if $(gen_spd_entry.MEM_PATH),memoryPath=\"$(gen_spd_entry.MEM_PATH)\") \ -) -define gen_spd_entry -$(ECHO) "" >> $3 -endef - -$(MEM_INIT_DESCRIPTOR_FILE).DAT_FILESET := $(patsubst $(dir $(MEM_INIT_DESCRIPTOR_FILE))%,%,$(DAT_FILES)) -$(MEM_INIT_DESCRIPTOR_FILE).HEX_FILESET := $(patsubst $(dir $(MEM_INIT_DESCRIPTOR_FILE))%,%,$(HEX_FILES)) - -$(MEM_INIT_DESCRIPTOR_FILE): %.spd: $(MEM_INIT_FILE) - $(post-process-info) - @$(MKDIR) $(@D) - @$(RM) $@ - @$(ECHO) "" > $@ - @$(ECHO) "" >> $@ - @$(foreach dat_file,$($@.DAT_FILESET),$(call gen_spd_entry,$(dat_file),DAT,$@) &&)true - @$(foreach hex_file,$($@.HEX_FILESET),$(call gen_spd_entry,$(hex_file),HEX,$@) &&)true - @$(ECHO) "" >> $@ - -.DELETE_ON_ERROR: $(MEM_INIT_DESCRIPTOR_FILE) - -$(MEM_INIT_QIP_FILE): %.qip: $(MEM_INIT_FILE) - $(post-process-info) - @$(MKDIR) $(@D) - @$(RM) $@ - @$(ECHO) "set_global_assignment -name SEARCH_PATH $$::quartus(qip_path)" > $@ - -.DELETE_ON_ERROR: $(MEM_INIT_QIP_FILE) diff --git a/software/qsys_tutorial_key3_bsp/memory.gdb b/software/qsys_tutorial_key3_bsp/memory.gdb deleted file mode 100644 index 4fc01b7..0000000 --- a/software/qsys_tutorial_key3_bsp/memory.gdb +++ /dev/null @@ -1,50 +0,0 @@ -# memory.gdb - GDB memory region definitions -# -# Machine generated for CPU 'nios2_processor' in SOPC Builder design 'nios_system' -# SOPC Builder design path: C:/Users/takayun/Documents/DE2-115/qsys_tutorial/nios_system.sopcinfo -# -# Generated: Thu Nov 10 10:49:51 JST 2016 - -# DO NOT MODIFY THIS FILE -# -# Changing this file will have subtle consequences -# which will almost certainly lead to a nonfunctioning -# system. If you do modify this file, be aware that your -# changes will be overwritten and lost when this file -# is generated again. -# -# DO NOT MODIFY THIS FILE - -# License Agreement -# -# Copyright (c) 2008 -# Altera Corporation, San Jose, California, USA. -# All rights reserved. -# -# 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. -# -# This agreement shall be governed in all respects by the laws of the State -# of California and by the laws of the United States of America. - -# Define memory regions for each memory connected to the CPU. -# The cache attribute is specified which improves GDB performance -# by allowing GDB to cache memory contents on the host. - -# onchip_memory -memory 0x0 0x1000 cache diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_alarm_start.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_alarm_start.d deleted file mode 100644 index 3bb20ea..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_alarm_start.d +++ /dev/null @@ -1,22 +0,0 @@ -obj/HAL/src/alt_alarm_start.o: HAL/src/alt_alarm_start.c \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h system.h linker.h - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_alarm_start.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_alarm_start.o deleted file mode 100644 index de5f8bd..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_alarm_start.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_busy_sleep.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_busy_sleep.d deleted file mode 100644 index e93e80c..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_busy_sleep.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_busy_sleep.o: HAL/src/alt_busy_sleep.c system.h linker.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_busy_sleep.h - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_busy_sleep.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_busy_sleep.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_busy_sleep.o deleted file mode 100644 index 117c365..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_busy_sleep.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_close.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_close.d deleted file mode 100644 index fbbab9c..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_close.d +++ /dev/null @@ -1,34 +0,0 @@ -obj/HAL/src/alt_close.o: HAL/src/alt_close.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h \ - HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_close.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_close.o deleted file mode 100644 index 04ccc64..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_close.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_dcache_flush.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_dcache_flush.d deleted file mode 100644 index a0eaf8a..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_dcache_flush.d +++ /dev/null @@ -1,15 +0,0 @@ -obj/HAL/src/alt_dcache_flush.o: HAL/src/alt_dcache_flush.c \ - HAL/inc/nios2.h system.h linker.h HAL/inc/alt_types.h \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h - -HAL/inc/nios2.h: - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_dcache_flush.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_dcache_flush.o deleted file mode 100644 index 735e0d4..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_dcache_flush.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_dcache_flush_all.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_dcache_flush_all.d deleted file mode 100644 index 792c3e4..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_dcache_flush_all.d +++ /dev/null @@ -1,15 +0,0 @@ -obj/HAL/src/alt_dcache_flush_all.o: HAL/src/alt_dcache_flush_all.c \ - HAL/inc/nios2.h system.h linker.h HAL/inc/alt_types.h \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h - -HAL/inc/nios2.h: - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_dcache_flush_all.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_dcache_flush_all.o deleted file mode 100644 index 9985744..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_dcache_flush_all.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_dcache_flush_no_writeback.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_dcache_flush_no_writeback.d deleted file mode 100644 index 867c42b..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_dcache_flush_no_writeback.d +++ /dev/null @@ -1,16 +0,0 @@ -obj/HAL/src/alt_dcache_flush_no_writeback.o: \ - HAL/src/alt_dcache_flush_no_writeback.c HAL/inc/nios2.h system.h \ - linker.h HAL/inc/alt_types.h HAL/inc/sys/alt_cache.h \ - HAL/inc/alt_types.h - -HAL/inc/nios2.h: - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_dcache_flush_no_writeback.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_dcache_flush_no_writeback.o deleted file mode 100644 index e2c67ac..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_dcache_flush_no_writeback.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_dev.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_dev.d deleted file mode 100644 index cd9b1d4..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_dev.d +++ /dev/null @@ -1,34 +0,0 @@ -obj/HAL/src/alt_dev.o: HAL/src/alt_dev.c HAL/inc/sys/alt_dev.h system.h \ - linker.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h \ - HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h HAL/inc/alt_types.h \ - system.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/alt_types.h: - -system.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_dev.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_dev.o deleted file mode 100644 index 99d8dc4..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_dev.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_dev_llist_insert.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_dev_llist_insert.d deleted file mode 100644 index 344d065..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_dev_llist_insert.d +++ /dev/null @@ -1,13 +0,0 @@ -obj/HAL/src/alt_dev_llist_insert.o: HAL/src/alt_dev_llist_insert.c \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/alt_types.h HAL/inc/sys/alt_errno.h - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_errno.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_dev_llist_insert.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_dev_llist_insert.o deleted file mode 100644 index f37e8ad..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_dev_llist_insert.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_dma_rxchan_open.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_dma_rxchan_open.d deleted file mode 100644 index fb21fed..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_dma_rxchan_open.d +++ /dev/null @@ -1,35 +0,0 @@ -obj/HAL/src/alt_dma_rxchan_open.o: HAL/src/alt_dma_rxchan_open.c \ - HAL/inc/sys/alt_dma.h HAL/inc/sys/alt_dma_dev.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/alt_types.h HAL/inc/sys/alt_errno.h \ - HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h system.h linker.h \ - HAL/inc/sys/alt_llist.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h - -HAL/inc/sys/alt_dma.h: - -HAL/inc/sys/alt_dma_dev.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_errno.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_dma_rxchan_open.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_dma_rxchan_open.o deleted file mode 100644 index 8f93fc0..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_dma_rxchan_open.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_dma_txchan_open.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_dma_txchan_open.d deleted file mode 100644 index 500b95c..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_dma_txchan_open.d +++ /dev/null @@ -1,35 +0,0 @@ -obj/HAL/src/alt_dma_txchan_open.o: HAL/src/alt_dma_txchan_open.c \ - HAL/inc/sys/alt_dma.h HAL/inc/sys/alt_dma_dev.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/alt_types.h HAL/inc/sys/alt_errno.h \ - HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h system.h linker.h \ - HAL/inc/sys/alt_llist.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h - -HAL/inc/sys/alt_dma.h: - -HAL/inc/sys/alt_dma_dev.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_errno.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_dma_txchan_open.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_dma_txchan_open.o deleted file mode 100644 index 4592be7..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_dma_txchan_open.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_do_ctors.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_do_ctors.d deleted file mode 100644 index daf8baf..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_do_ctors.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_do_ctors.o: HAL/src/alt_do_ctors.c diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_do_ctors.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_do_ctors.o deleted file mode 100644 index 15bae2b..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_do_ctors.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_do_dtors.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_do_dtors.d deleted file mode 100644 index c3471eb..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_do_dtors.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_do_dtors.o: HAL/src/alt_do_dtors.c diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_do_dtors.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_do_dtors.o deleted file mode 100644 index 91c75ed..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_do_dtors.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_env_lock.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_env_lock.d deleted file mode 100644 index 634d7b0..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_env_lock.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_env_lock.o: HAL/src/alt_env_lock.c diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_env_lock.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_env_lock.o deleted file mode 100644 index 6c1dbb6..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_env_lock.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_environ.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_environ.d deleted file mode 100644 index e9ca295..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_environ.d +++ /dev/null @@ -1,3 +0,0 @@ -obj/HAL/src/alt_environ.o: HAL/src/alt_environ.c HAL/inc/os/alt_syscall.h - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_environ.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_environ.o deleted file mode 100644 index adb87a0..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_environ.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_errno.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_errno.d deleted file mode 100644 index 29ca544..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_errno.d +++ /dev/null @@ -1,8 +0,0 @@ -obj/HAL/src/alt_errno.o: HAL/src/alt_errno.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/alt_types.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_errno.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_errno.o deleted file mode 100644 index 2a46f43..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_errno.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_exception_entry.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_exception_entry.d deleted file mode 100644 index 540567e..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_exception_entry.d +++ /dev/null @@ -1,6 +0,0 @@ -obj/HAL/src/alt_exception_entry.o: HAL/src/alt_exception_entry.S system.h \ - linker.h - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_exception_entry.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_exception_entry.o deleted file mode 100644 index 4da05d6..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_exception_entry.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_exception_muldiv.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_exception_muldiv.d deleted file mode 100644 index 63d66a7..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_exception_muldiv.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_exception_muldiv.o: HAL/src/alt_exception_muldiv.S diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_exception_muldiv.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_exception_muldiv.o deleted file mode 100644 index 34e2166..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_exception_muldiv.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_exception_trap.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_exception_trap.d deleted file mode 100644 index 6e18488..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_exception_trap.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_exception_trap.o: HAL/src/alt_exception_trap.S diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_exception_trap.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_exception_trap.o deleted file mode 100644 index b5fda1f..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_exception_trap.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_execve.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_execve.d deleted file mode 100644 index 9cef7d2..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_execve.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_execve.o: HAL/src/alt_execve.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_execve.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_execve.o deleted file mode 100644 index 577120e..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_execve.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_exit.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_exit.d deleted file mode 100644 index a779da8..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_exit.d +++ /dev/null @@ -1,26 +0,0 @@ -obj/HAL/src/alt_exit.o: HAL/src/alt_exit.c HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h HAL/inc/alt_types.h system.h linker.h \ - HAL/inc/sys/alt_sim.h HAL/inc/os/alt_hooks.h HAL/inc/os/alt_syscall.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_log_printf.h system.h - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_sim.h: - -HAL/inc/os/alt_hooks.h: - -HAL/inc/os/alt_syscall.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_exit.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_exit.o deleted file mode 100644 index a3d259d..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_exit.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_fcntl.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_fcntl.d deleted file mode 100644 index 527f242..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_fcntl.d +++ /dev/null @@ -1,34 +0,0 @@ -obj/HAL/src/alt_fcntl.o: HAL/src/alt_fcntl.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h \ - system.h linker.h HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/alt_types.h \ - HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_fcntl.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_fcntl.o deleted file mode 100644 index e2f766e..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_fcntl.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_fd_lock.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_fd_lock.d deleted file mode 100644 index 93daeac..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_fd_lock.d +++ /dev/null @@ -1,27 +0,0 @@ -obj/HAL/src/alt_fd_lock.o: HAL/src/alt_fd_lock.c HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_fd_lock.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_fd_lock.o deleted file mode 100644 index da9b89e..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_fd_lock.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_fd_unlock.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_fd_unlock.d deleted file mode 100644 index 45a3207..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_fd_unlock.d +++ /dev/null @@ -1,27 +0,0 @@ -obj/HAL/src/alt_fd_unlock.o: HAL/src/alt_fd_unlock.c \ - HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h system.h linker.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_fd_unlock.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_fd_unlock.o deleted file mode 100644 index f31ae6c..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_fd_unlock.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_find_dev.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_find_dev.d deleted file mode 100644 index 98336f8..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_find_dev.d +++ /dev/null @@ -1,31 +0,0 @@ -obj/HAL/src/alt_find_dev.o: HAL/src/alt_find_dev.c HAL/inc/sys/alt_dev.h \ - system.h linker.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h \ - HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h HAL/inc/alt_types.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_find_dev.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_find_dev.o deleted file mode 100644 index 424d05a..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_find_dev.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_find_file.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_find_file.d deleted file mode 100644 index d1150ca..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_find_file.d +++ /dev/null @@ -1,32 +0,0 @@ -obj/HAL/src/alt_find_file.o: HAL/src/alt_find_file.c \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h \ - HAL/inc/alt_types.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_find_file.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_find_file.o deleted file mode 100644 index 6e696b8..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_find_file.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_flash_dev.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_flash_dev.d deleted file mode 100644 index 8835e8f..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_flash_dev.d +++ /dev/null @@ -1,34 +0,0 @@ -obj/HAL/src/alt_flash_dev.o: HAL/src/alt_flash_dev.c \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/sys/alt_flash_dev.h \ - HAL/inc/sys/alt_flash_types.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h \ - system.h linker.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_flash_dev.h: - -HAL/inc/sys/alt_flash_types.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_flash_dev.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_flash_dev.o deleted file mode 100644 index f3e48a7..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_flash_dev.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_fork.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_fork.d deleted file mode 100644 index 492be65..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_fork.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_fork.o: HAL/src/alt_fork.c HAL/inc/sys/alt_warning.h \ - HAL/inc/sys/alt_errno.h HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_warning.h: - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_fork.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_fork.o deleted file mode 100644 index fd43c71..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_fork.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_fs_reg.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_fs_reg.d deleted file mode 100644 index d8f95ab..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_fs_reg.d +++ /dev/null @@ -1,29 +0,0 @@ -obj/HAL/src/alt_fs_reg.o: HAL/src/alt_fs_reg.c HAL/inc/sys/alt_dev.h \ - system.h linker.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h \ - HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_fs_reg.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_fs_reg.o deleted file mode 100644 index 6f1111c..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_fs_reg.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_fstat.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_fstat.d deleted file mode 100644 index 942fcbc..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_fstat.d +++ /dev/null @@ -1,38 +0,0 @@ -obj/HAL/src/alt_fstat.o: HAL/src/alt_fstat.c HAL/inc/sys/alt_dev.h \ - system.h linker.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/sys/alt_errno.h \ - HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_syscall.h system.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/sys/alt_errno.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_syscall.h: - -system.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_fstat.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_fstat.o deleted file mode 100644 index c895163..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_fstat.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_get_fd.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_get_fd.d deleted file mode 100644 index 9a4daaa..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_get_fd.d +++ /dev/null @@ -1,34 +0,0 @@ -obj/HAL/src/alt_get_fd.o: HAL/src/alt_get_fd.c HAL/inc/sys/alt_dev.h \ - system.h linker.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h \ - HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h HAL/inc/alt_types.h \ - system.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/alt_types.h: - -system.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_get_fd.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_get_fd.o deleted file mode 100644 index 546c0d3..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_get_fd.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_getchar.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_getchar.d deleted file mode 100644 index bcccdf7..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_getchar.d +++ /dev/null @@ -1,34 +0,0 @@ -obj/HAL/src/alt_getchar.o: HAL/src/alt_getchar.c system.h linker.h \ - HAL/inc/sys/alt_driver.h HAL/inc/sys/alt_stdio.h \ - HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h system.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h - -system.h: - -linker.h: - -HAL/inc/sys/alt_driver.h: - -HAL/inc/sys/alt_stdio.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_getchar.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_getchar.o deleted file mode 100644 index 5260623..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_getchar.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_getpid.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_getpid.d deleted file mode 100644 index d9499b9..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_getpid.d +++ /dev/null @@ -1,3 +0,0 @@ -obj/HAL/src/alt_getpid.o: HAL/src/alt_getpid.c HAL/inc/os/alt_syscall.h - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_getpid.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_getpid.o deleted file mode 100644 index e58bdef..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_getpid.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_gettod.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_gettod.d deleted file mode 100644 index cf3cf34..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_gettod.d +++ /dev/null @@ -1,17 +0,0 @@ -obj/HAL/src/alt_gettod.o: HAL/src/alt_gettod.c HAL/inc/sys/alt_alarm.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/priv/alt_alarm.h \ - HAL/inc/alt_types.h HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_gettod.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_gettod.o deleted file mode 100644 index d2747e5..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_gettod.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_gmon.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_gmon.d deleted file mode 100644 index e9469ab..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_gmon.d +++ /dev/null @@ -1,24 +0,0 @@ -obj/HAL/src/alt_gmon.o: HAL/src/alt_gmon.c HAL/inc/priv/nios2_gmon_data.h \ - HAL/inc/sys/alt_irq.h HAL/inc/nios2.h HAL/inc/alt_types.h system.h \ - linker.h HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h - -HAL/inc/priv/nios2_gmon_data.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_gmon.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_gmon.o deleted file mode 100644 index e6d6f45..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_gmon.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_icache_flush.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_icache_flush.d deleted file mode 100644 index 2e4ddd1..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_icache_flush.d +++ /dev/null @@ -1,15 +0,0 @@ -obj/HAL/src/alt_icache_flush.o: HAL/src/alt_icache_flush.c \ - HAL/inc/nios2.h system.h linker.h HAL/inc/alt_types.h \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h - -HAL/inc/nios2.h: - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_icache_flush.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_icache_flush.o deleted file mode 100644 index 3a5082a..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_icache_flush.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_icache_flush_all.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_icache_flush_all.d deleted file mode 100644 index 47cfbf3..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_icache_flush_all.d +++ /dev/null @@ -1,15 +0,0 @@ -obj/HAL/src/alt_icache_flush_all.o: HAL/src/alt_icache_flush_all.c \ - HAL/inc/nios2.h system.h linker.h HAL/inc/alt_types.h \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h - -HAL/inc/nios2.h: - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_icache_flush_all.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_icache_flush_all.o deleted file mode 100644 index 9a2a3f5..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_icache_flush_all.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_iic.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_iic.d deleted file mode 100644 index a709e0c..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_iic.d +++ /dev/null @@ -1,29 +0,0 @@ -obj/HAL/src/alt_iic.o: HAL/src/alt_iic.c system.h linker.h \ - HAL/inc/sys/alt_irq.h HAL/inc/nios2.h HAL/inc/alt_types.h system.h \ - HAL/inc/priv/alt_iic_isr_register.h HAL/inc/alt_types.h \ - HAL/inc/sys/alt_irq.h HAL/inc/priv/alt_legacy_irq.h system.h \ - HAL/inc/nios2.h - -system.h: - -linker.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -HAL/inc/priv/alt_iic_isr_register.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/priv/alt_legacy_irq.h: - -system.h: - -HAL/inc/nios2.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_iic.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_iic.o deleted file mode 100644 index e4731b0..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_iic.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_iic_isr_register.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_iic_isr_register.d deleted file mode 100644 index d0470ae..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_iic_isr_register.d +++ /dev/null @@ -1,30 +0,0 @@ -obj/HAL/src/alt_iic_isr_register.o: HAL/src/alt_iic_isr_register.c \ - system.h linker.h HAL/inc/alt_types.h HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h HAL/inc/alt_types.h system.h \ - HAL/inc/priv/alt_iic_isr_register.h HAL/inc/alt_types.h \ - HAL/inc/sys/alt_irq.h HAL/inc/sys/alt_irq_entry.h \ - HAL/inc/priv/alt_irq_table.h - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -HAL/inc/priv/alt_iic_isr_register.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/sys/alt_irq_entry.h: - -HAL/inc/priv/alt_irq_table.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_iic_isr_register.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_iic_isr_register.o deleted file mode 100644 index 5888c63..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_iic_isr_register.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_instruction_exception_entry.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_instruction_exception_entry.d deleted file mode 100644 index 6d0705f..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_instruction_exception_entry.d +++ /dev/null @@ -1,18 +0,0 @@ -obj/HAL/src/alt_instruction_exception_entry.o: \ - HAL/src/alt_instruction_exception_entry.c HAL/inc/sys/alt_exceptions.h \ - HAL/inc/alt_types.h system.h linker.h HAL/inc/nios2.h \ - HAL/inc/alt_types.h system.h - -HAL/inc/sys/alt_exceptions.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_instruction_exception_entry.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_instruction_exception_entry.o deleted file mode 100644 index 76c0f30..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_instruction_exception_entry.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_instruction_exception_register.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_instruction_exception_register.d deleted file mode 100644 index d4fac04..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_instruction_exception_register.d +++ /dev/null @@ -1,16 +0,0 @@ -obj/HAL/src/alt_instruction_exception_register.o: \ - HAL/src/alt_instruction_exception_register.c \ - HAL/inc/sys/alt_exceptions.h HAL/inc/alt_types.h system.h linker.h \ - HAL/inc/alt_types.h system.h - -HAL/inc/sys/alt_exceptions.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -system.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_instruction_exception_register.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_instruction_exception_register.o deleted file mode 100644 index 4a11aab..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_instruction_exception_register.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_io_redirect.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_io_redirect.d deleted file mode 100644 index 8228365..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_io_redirect.d +++ /dev/null @@ -1,29 +0,0 @@ -obj/HAL/src/alt_io_redirect.o: HAL/src/alt_io_redirect.c \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_io_redirect.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_io_redirect.o deleted file mode 100644 index 9f1861c..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_io_redirect.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_ioctl.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_ioctl.d deleted file mode 100644 index d70ad97..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_ioctl.d +++ /dev/null @@ -1,41 +0,0 @@ -obj/HAL/src/alt_ioctl.o: HAL/src/alt_ioctl.c HAL/inc/sys/ioctl.h \ - HAL/inc/sys/alt_errno.h HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h \ - HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h system.h linker.h \ - HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_syscall.h system.h \ - HAL/inc/sys/alt_driver.h - -HAL/inc/sys/ioctl.h: - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_syscall.h: - -system.h: - -HAL/inc/sys/alt_driver.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_ioctl.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_ioctl.o deleted file mode 100644 index b679799..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_ioctl.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_irq_entry.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_irq_entry.d deleted file mode 100644 index 9ec3751..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_irq_entry.d +++ /dev/null @@ -1,5 +0,0 @@ -obj/HAL/src/alt_irq_entry.o: HAL/src/alt_irq_entry.S system.h linker.h - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_irq_entry.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_irq_entry.o deleted file mode 100644 index f81ea10..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_irq_entry.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_irq_handler.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_irq_handler.d deleted file mode 100644 index 6fb668f..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_irq_handler.d +++ /dev/null @@ -1,19 +0,0 @@ -obj/HAL/src/alt_irq_handler.o: HAL/src/alt_irq_handler.c system.h \ - linker.h HAL/inc/sys/alt_irq.h HAL/inc/nios2.h HAL/inc/alt_types.h \ - system.h HAL/inc/os/alt_hooks.h HAL/inc/alt_types.h - -system.h: - -linker.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -HAL/inc/os/alt_hooks.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_irq_handler.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_irq_handler.o deleted file mode 100644 index e8d593e..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_irq_handler.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_irq_register.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_irq_register.d deleted file mode 100644 index 3df2f8a..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_irq_register.d +++ /dev/null @@ -1,36 +0,0 @@ -obj/HAL/src/alt_irq_register.o: HAL/src/alt_irq_register.c system.h \ - linker.h HAL/inc/sys/alt_irq.h HAL/inc/nios2.h HAL/inc/alt_types.h \ - system.h HAL/inc/priv/alt_legacy_irq.h system.h HAL/inc/nios2.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_irq.h HAL/inc/os/alt_hooks.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_irq_entry.h \ - HAL/inc/priv/alt_irq_table.h - -system.h: - -linker.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -HAL/inc/priv/alt_legacy_irq.h: - -system.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/os/alt_hooks.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_irq_entry.h: - -HAL/inc/priv/alt_irq_table.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_irq_register.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_irq_register.o deleted file mode 100644 index 4254ca8..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_irq_register.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_irq_vars.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_irq_vars.d deleted file mode 100644 index f316558..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_irq_vars.d +++ /dev/null @@ -1,8 +0,0 @@ -obj/HAL/src/alt_irq_vars.o: HAL/src/alt_irq_vars.c HAL/inc/alt_types.h \ - system.h linker.h - -HAL/inc/alt_types.h: - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_irq_vars.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_irq_vars.o deleted file mode 100644 index ee1382e..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_irq_vars.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_isatty.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_isatty.d deleted file mode 100644 index f8b1f07..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_isatty.d +++ /dev/null @@ -1,38 +0,0 @@ -obj/HAL/src/alt_isatty.o: HAL/src/alt_isatty.c HAL/inc/sys/alt_dev.h \ - system.h linker.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_errno.h HAL/inc/sys/alt_warning.h \ - HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_syscall.h system.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_errno.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_syscall.h: - -system.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_isatty.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_isatty.o deleted file mode 100644 index 50348d3..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_isatty.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_kill.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_kill.d deleted file mode 100644 index 0c14ae8..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_kill.d +++ /dev/null @@ -1,8 +0,0 @@ -obj/HAL/src/alt_kill.o: HAL/src/alt_kill.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_kill.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_kill.o deleted file mode 100644 index c91d08e..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_kill.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_link.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_link.d deleted file mode 100644 index dc844c6..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_link.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_link.o: HAL/src/alt_link.c HAL/inc/sys/alt_warning.h \ - HAL/inc/sys/alt_errno.h HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_warning.h: - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_link.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_link.o deleted file mode 100644 index 1863f89..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_link.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_load.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_load.d deleted file mode 100644 index d496ab8..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_load.d +++ /dev/null @@ -1,8 +0,0 @@ -obj/HAL/src/alt_load.o: HAL/src/alt_load.c HAL/inc/sys/alt_load.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_cache.h - -HAL/inc/sys/alt_load.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_cache.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_load.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_load.o deleted file mode 100644 index 0633ea6..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_load.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_log_macro.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_log_macro.d deleted file mode 100644 index 9768c1f..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_log_macro.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_log_macro.o: HAL/src/alt_log_macro.S diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_log_macro.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_log_macro.o deleted file mode 100644 index 489e2cc..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_log_macro.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_log_printf.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_log_printf.d deleted file mode 100644 index 251ff6d..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_log_printf.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_log_printf.o: HAL/src/alt_log_printf.c diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_log_printf.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_log_printf.o deleted file mode 100644 index a03c33d..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_log_printf.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_lseek.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_lseek.d deleted file mode 100644 index 25ed783..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_lseek.d +++ /dev/null @@ -1,34 +0,0 @@ -obj/HAL/src/alt_lseek.o: HAL/src/alt_lseek.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h \ - HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_lseek.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_lseek.o deleted file mode 100644 index 2763b47..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_lseek.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_main.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_main.d deleted file mode 100644 index afdfda0..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_main.d +++ /dev/null @@ -1,47 +0,0 @@ -obj/HAL/src/alt_main.o: HAL/src/alt_main.c HAL/inc/sys/alt_dev.h system.h \ - linker.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_sys_init.h HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h HAL/inc/os/alt_hooks.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h \ - HAL/inc/alt_types.h system.h HAL/inc/sys/alt_log_printf.h system.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_sys_init.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/os/alt_hooks.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/alt_types.h: - -system.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_main.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_main.o deleted file mode 100644 index a99d0ae..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_main.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_malloc_lock.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_malloc_lock.d deleted file mode 100644 index 4ed35c2..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_malloc_lock.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_malloc_lock.o: HAL/src/alt_malloc_lock.c diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_malloc_lock.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_malloc_lock.o deleted file mode 100644 index ba326fd..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_malloc_lock.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_mcount.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_mcount.d deleted file mode 100644 index 1203efc..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_mcount.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_mcount.o: HAL/src/alt_mcount.S diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_mcount.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_mcount.o deleted file mode 100644 index 2732b82..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_mcount.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_open.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_open.d deleted file mode 100644 index a2aacd9..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_open.d +++ /dev/null @@ -1,36 +0,0 @@ -obj/HAL/src/alt_open.o: HAL/src/alt_open.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_open.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_open.o deleted file mode 100644 index 4de29e1..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_open.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_printf.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_printf.d deleted file mode 100644 index 3ce68a4..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_printf.d +++ /dev/null @@ -1,3 +0,0 @@ -obj/HAL/src/alt_printf.o: HAL/src/alt_printf.c HAL/inc/sys/alt_stdio.h - -HAL/inc/sys/alt_stdio.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_printf.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_printf.o deleted file mode 100644 index b603a08..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_printf.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_putchar.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_putchar.d deleted file mode 100644 index 9a0dde3..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_putchar.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_putchar.o: HAL/src/alt_putchar.c system.h linker.h \ - HAL/inc/sys/alt_driver.h HAL/inc/sys/alt_stdio.h - -system.h: - -linker.h: - -HAL/inc/sys/alt_driver.h: - -HAL/inc/sys/alt_stdio.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_putchar.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_putchar.o deleted file mode 100644 index 9a3af5e..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_putchar.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_putstr.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_putstr.d deleted file mode 100644 index 3cf528a..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_putstr.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_putstr.o: HAL/src/alt_putstr.c system.h linker.h \ - HAL/inc/sys/alt_driver.h HAL/inc/sys/alt_stdio.h - -system.h: - -linker.h: - -HAL/inc/sys/alt_driver.h: - -HAL/inc/sys/alt_stdio.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_putstr.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_putstr.o deleted file mode 100644 index af9c101..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_putstr.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_read.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_read.d deleted file mode 100644 index 2bb0d95..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_read.d +++ /dev/null @@ -1,38 +0,0 @@ -obj/HAL/src/alt_read.o: HAL/src/alt_read.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h \ - HAL/inc/os/alt_syscall.h system.h HAL/inc/sys/alt_driver.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_syscall.h: - -system.h: - -HAL/inc/sys/alt_driver.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_read.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_read.o deleted file mode 100644 index 9354e2d..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_read.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_release_fd.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_release_fd.d deleted file mode 100644 index 0e3acb5..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_release_fd.d +++ /dev/null @@ -1,29 +0,0 @@ -obj/HAL/src/alt_release_fd.o: HAL/src/alt_release_fd.c \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_release_fd.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_release_fd.o deleted file mode 100644 index f0b19e1..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_release_fd.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_remap_cached.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_remap_cached.d deleted file mode 100644 index b5fb151..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_remap_cached.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_remap_cached.o: HAL/src/alt_remap_cached.c \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h system.h linker.h - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_remap_cached.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_remap_cached.o deleted file mode 100644 index 530a0de..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_remap_cached.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_remap_uncached.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_remap_uncached.d deleted file mode 100644 index 0423405..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_remap_uncached.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_remap_uncached.o: HAL/src/alt_remap_uncached.c \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h system.h linker.h - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_remap_uncached.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_remap_uncached.o deleted file mode 100644 index 489404e..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_remap_uncached.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_rename.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_rename.d deleted file mode 100644 index b7af4b2..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_rename.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_rename.o: HAL/src/alt_rename.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_rename.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_rename.o deleted file mode 100644 index 8e87d65..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_rename.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_sbrk.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_sbrk.d deleted file mode 100644 index a0771ae..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_sbrk.d +++ /dev/null @@ -1,19 +0,0 @@ -obj/HAL/src/alt_sbrk.o: HAL/src/alt_sbrk.c HAL/inc/os/alt_syscall.h \ - HAL/inc/sys/alt_irq.h HAL/inc/nios2.h HAL/inc/alt_types.h system.h \ - linker.h HAL/inc/sys/alt_stack.h system.h - -HAL/inc/os/alt_syscall.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_stack.h: - -system.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_sbrk.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_sbrk.o deleted file mode 100644 index b155224..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_sbrk.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_settod.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_settod.d deleted file mode 100644 index 56718d5..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_settod.d +++ /dev/null @@ -1,17 +0,0 @@ -obj/HAL/src/alt_settod.o: HAL/src/alt_settod.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_settod.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_settod.o deleted file mode 100644 index 5b1322b..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_settod.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_software_exception.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_software_exception.d deleted file mode 100644 index fab4023..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_software_exception.d +++ /dev/null @@ -1,6 +0,0 @@ -obj/HAL/src/alt_software_exception.o: HAL/src/alt_software_exception.S \ - system.h linker.h - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_software_exception.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_software_exception.o deleted file mode 100644 index f9e01c2..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_software_exception.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_stat.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_stat.d deleted file mode 100644 index 8a63c27..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_stat.d +++ /dev/null @@ -1,3 +0,0 @@ -obj/HAL/src/alt_stat.o: HAL/src/alt_stat.c HAL/inc/os/alt_syscall.h - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_stat.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_stat.o deleted file mode 100644 index 59fc938..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_stat.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_tick.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_tick.d deleted file mode 100644 index ddbb281..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_tick.d +++ /dev/null @@ -1,27 +0,0 @@ -obj/HAL/src/alt_tick.o: HAL/src/alt_tick.c HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h HAL/inc/alt_types.h system.h linker.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/os/alt_hooks.h \ - HAL/inc/alt_types.h - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_hooks.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_tick.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_tick.o deleted file mode 100644 index a61ba50..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_tick.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_times.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_times.d deleted file mode 100644 index 4bad83d..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_times.d +++ /dev/null @@ -1,17 +0,0 @@ -obj/HAL/src/alt_times.o: HAL/src/alt_times.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_times.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_times.o deleted file mode 100644 index 85ad792..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_times.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_uncached_free.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_uncached_free.d deleted file mode 100644 index d74ef4b..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_uncached_free.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_uncached_free.o: HAL/src/alt_uncached_free.c \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h system.h linker.h - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_uncached_free.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_uncached_free.o deleted file mode 100644 index eeeef6a..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_uncached_free.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_uncached_malloc.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_uncached_malloc.d deleted file mode 100644 index 16799fb..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_uncached_malloc.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_uncached_malloc.o: HAL/src/alt_uncached_malloc.c \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h system.h linker.h - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_uncached_malloc.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_uncached_malloc.o deleted file mode 100644 index 9603134..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_uncached_malloc.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_unlink.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_unlink.d deleted file mode 100644 index 0205f86..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_unlink.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_unlink.o: HAL/src/alt_unlink.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_unlink.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_unlink.o deleted file mode 100644 index 5a20226..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_unlink.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_usleep.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_usleep.d deleted file mode 100644 index b5eca45..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_usleep.d +++ /dev/null @@ -1,6 +0,0 @@ -obj/HAL/src/alt_usleep.o: HAL/src/alt_usleep.c \ - HAL/inc/priv/alt_busy_sleep.h HAL/inc/os/alt_syscall.h - -HAL/inc/priv/alt_busy_sleep.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_usleep.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_usleep.o deleted file mode 100644 index 8246c24..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_usleep.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_wait.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_wait.d deleted file mode 100644 index f47f5df..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_wait.d +++ /dev/null @@ -1,8 +0,0 @@ -obj/HAL/src/alt_wait.o: HAL/src/alt_wait.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_wait.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_wait.o deleted file mode 100644 index 5c04683..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_wait.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_write.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_write.d deleted file mode 100644 index 2b54a68..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_write.d +++ /dev/null @@ -1,41 +0,0 @@ -obj/HAL/src/alt_write.o: HAL/src/alt_write.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h \ - HAL/inc/os/alt_syscall.h HAL/inc/sys/alt_log_printf.h system.h \ - HAL/inc/sys/alt_driver.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_syscall.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: - -HAL/inc/sys/alt_driver.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_write.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_write.o deleted file mode 100644 index c6aee9e..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/alt_write.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/altera_nios2_qsys_irq.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/altera_nios2_qsys_irq.d deleted file mode 100644 index 47bdd9c..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/altera_nios2_qsys_irq.d +++ /dev/null @@ -1,15 +0,0 @@ -obj/HAL/src/altera_nios2_qsys_irq.o: HAL/src/altera_nios2_qsys_irq.c \ - HAL/inc/sys/alt_irq.h HAL/inc/nios2.h HAL/inc/alt_types.h system.h \ - linker.h HAL/inc/altera_nios2_qsys_irq.h - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/altera_nios2_qsys_irq.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/altera_nios2_qsys_irq.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/altera_nios2_qsys_irq.o deleted file mode 100644 index b956c07..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/altera_nios2_qsys_irq.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/crt0.d b/software/qsys_tutorial_key3_bsp/obj/HAL/src/crt0.d deleted file mode 100644 index 3af0bb0..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/crt0.d +++ /dev/null @@ -1,12 +0,0 @@ -obj/HAL/src/crt0.o: HAL/src/crt0.S system.h linker.h HAL/inc/nios2.h \ - HAL/inc/sys/alt_log_printf.h system.h - -system.h: - -linker.h: - -HAL/inc/nios2.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/HAL/src/crt0.o b/software/qsys_tutorial_key3_bsp/obj/HAL/src/crt0.o deleted file mode 100644 index 6c8f431..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/HAL/src/crt0.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/alt_sys_init.d b/software/qsys_tutorial_key3_bsp/obj/alt_sys_init.d deleted file mode 100644 index 2087a7a..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/alt_sys_init.d +++ /dev/null @@ -1,54 +0,0 @@ -obj/alt_sys_init.o: alt_sys_init.c system.h linker.h \ - HAL/inc/sys/alt_irq.h HAL/inc/nios2.h HAL/inc/alt_types.h system.h \ - HAL/inc/sys/alt_sys_init.h HAL/inc/altera_nios2_qsys_irq.h \ - drivers/inc/altera_avalon_jtag_uart.h HAL/inc/sys/alt_alarm.h \ - HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h \ - HAL/inc/sys/alt_warning.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_flag.h \ - drivers/inc/altera_avalon_jtag_uart_fd.h HAL/inc/sys/alt_dev.h \ - HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h - -system.h: - -linker.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -HAL/inc/sys/alt_sys_init.h: - -HAL/inc/altera_nios2_qsys_irq.h: - -drivers/inc/altera_avalon_jtag_uart.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_flag.h: - -drivers/inc/altera_avalon_jtag_uart_fd.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/alt_sys_init.o b/software/qsys_tutorial_key3_bsp/obj/alt_sys_init.o deleted file mode 100644 index 23031b2..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/alt_sys_init.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/drivers/src/altera_avalon_jtag_uart_fd.d b/software/qsys_tutorial_key3_bsp/obj/drivers/src/altera_avalon_jtag_uart_fd.d deleted file mode 100644 index b152697..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/drivers/src/altera_avalon_jtag_uart_fd.d +++ /dev/null @@ -1,48 +0,0 @@ -obj/drivers/src/altera_avalon_jtag_uart_fd.o: \ - drivers/src/altera_avalon_jtag_uart_fd.c HAL/inc/alt_types.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - drivers/inc/altera_avalon_jtag_uart.h HAL/inc/sys/alt_alarm.h \ - HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_alarm.h \ - HAL/inc/sys/alt_warning.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_flag.h \ - drivers/inc/altera_avalon_jtag_uart_fd.h HAL/inc/sys/alt_dev.h - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_flag.h: - -drivers/inc/altera_avalon_jtag_uart_fd.h: - -HAL/inc/sys/alt_dev.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/drivers/src/altera_avalon_jtag_uart_fd.o b/software/qsys_tutorial_key3_bsp/obj/drivers/src/altera_avalon_jtag_uart_fd.o deleted file mode 100644 index ba35d74..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/drivers/src/altera_avalon_jtag_uart_fd.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/drivers/src/altera_avalon_jtag_uart_init.d b/software/qsys_tutorial_key3_bsp/obj/drivers/src/altera_avalon_jtag_uart_init.d deleted file mode 100644 index f9460a1..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/drivers/src/altera_avalon_jtag_uart_init.d +++ /dev/null @@ -1,66 +0,0 @@ -obj/drivers/src/altera_avalon_jtag_uart_init.o: \ - drivers/src/altera_avalon_jtag_uart_init.c HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h HAL/inc/alt_types.h system.h linker.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/sys/ioctl.h \ - HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart_regs.h \ - HAL/inc/io.h HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_warning.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_flag.h \ - drivers/inc/altera_avalon_jtag_uart_fd.h HAL/inc/sys/alt_dev.h \ - HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/sys/alt_log_printf.h system.h - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/ioctl.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart_regs.h: - -HAL/inc/io.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_flag.h: - -drivers/inc/altera_avalon_jtag_uart_fd.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/drivers/src/altera_avalon_jtag_uart_init.o b/software/qsys_tutorial_key3_bsp/obj/drivers/src/altera_avalon_jtag_uart_init.o deleted file mode 100644 index 89ba594..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/drivers/src/altera_avalon_jtag_uart_init.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/drivers/src/altera_avalon_jtag_uart_ioctl.d b/software/qsys_tutorial_key3_bsp/obj/drivers/src/altera_avalon_jtag_uart_ioctl.d deleted file mode 100644 index d75a559..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/drivers/src/altera_avalon_jtag_uart_ioctl.d +++ /dev/null @@ -1,58 +0,0 @@ -obj/drivers/src/altera_avalon_jtag_uart_ioctl.o: \ - drivers/src/altera_avalon_jtag_uart_ioctl.c HAL/inc/sys/ioctl.h \ - HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart_regs.h \ - HAL/inc/io.h HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h \ - HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_flag.h \ - drivers/inc/altera_avalon_jtag_uart_fd.h HAL/inc/sys/alt_dev.h system.h \ - linker.h HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/sys/alt_log_printf.h system.h - -HAL/inc/sys/ioctl.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart_regs.h: - -HAL/inc/io.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_flag.h: - -drivers/inc/altera_avalon_jtag_uart_fd.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/drivers/src/altera_avalon_jtag_uart_ioctl.o b/software/qsys_tutorial_key3_bsp/obj/drivers/src/altera_avalon_jtag_uart_ioctl.o deleted file mode 100644 index ba19ad0..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/drivers/src/altera_avalon_jtag_uart_ioctl.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/drivers/src/altera_avalon_jtag_uart_read.d b/software/qsys_tutorial_key3_bsp/obj/drivers/src/altera_avalon_jtag_uart_read.d deleted file mode 100644 index 9a4846a..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/drivers/src/altera_avalon_jtag_uart_read.d +++ /dev/null @@ -1,66 +0,0 @@ -obj/drivers/src/altera_avalon_jtag_uart_read.o: \ - drivers/src/altera_avalon_jtag_uart_read.c HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h HAL/inc/alt_types.h system.h linker.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/sys/ioctl.h \ - HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart_regs.h \ - HAL/inc/io.h HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_warning.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_flag.h \ - drivers/inc/altera_avalon_jtag_uart_fd.h HAL/inc/sys/alt_dev.h \ - HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/sys/alt_log_printf.h system.h - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/ioctl.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart_regs.h: - -HAL/inc/io.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_flag.h: - -drivers/inc/altera_avalon_jtag_uart_fd.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/drivers/src/altera_avalon_jtag_uart_read.o b/software/qsys_tutorial_key3_bsp/obj/drivers/src/altera_avalon_jtag_uart_read.o deleted file mode 100644 index f93ff18..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/drivers/src/altera_avalon_jtag_uart_read.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/obj/drivers/src/altera_avalon_jtag_uart_write.d b/software/qsys_tutorial_key3_bsp/obj/drivers/src/altera_avalon_jtag_uart_write.d deleted file mode 100644 index 5518b7f..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/drivers/src/altera_avalon_jtag_uart_write.d +++ /dev/null @@ -1,66 +0,0 @@ -obj/drivers/src/altera_avalon_jtag_uart_write.o: \ - drivers/src/altera_avalon_jtag_uart_write.c HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h HAL/inc/alt_types.h system.h linker.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/sys/ioctl.h \ - HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart_regs.h \ - HAL/inc/io.h HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_warning.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_flag.h \ - drivers/inc/altera_avalon_jtag_uart_fd.h HAL/inc/sys/alt_dev.h \ - HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/sys/alt_log_printf.h system.h - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/ioctl.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart_regs.h: - -HAL/inc/io.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_flag.h: - -drivers/inc/altera_avalon_jtag_uart_fd.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: diff --git a/software/qsys_tutorial_key3_bsp/obj/drivers/src/altera_avalon_jtag_uart_write.o b/software/qsys_tutorial_key3_bsp/obj/drivers/src/altera_avalon_jtag_uart_write.o deleted file mode 100644 index cce83e4..0000000 --- a/software/qsys_tutorial_key3_bsp/obj/drivers/src/altera_avalon_jtag_uart_write.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_key3_bsp/public.mk b/software/qsys_tutorial_key3_bsp/public.mk deleted file mode 100644 index 5eb883d..0000000 --- a/software/qsys_tutorial_key3_bsp/public.mk +++ /dev/null @@ -1,385 +0,0 @@ -#------------------------------------------------------------------------------ -# BSP "PUBLIC" MAKEFILE CONTENT -# -# This file is intended to be included in an application or library -# Makefile that is using this BSP. You can create such a Makefile with -# the nios2-app-generate-makefile or nios2-lib-generate-makefile -# commands. -# -# The following variables must be defined before including this file: -# -# ALT_LIBRARY_ROOT_DIR -# Contains the path to the BSP top-level (aka root) directory -#------------------------------------------------------------------------------ - -#------------------------------------------------------------------------------ -# PATHS -#------------------------------------------------------------------------------ - - - -# Path to the provided linker script. -BSP_LINKER_SCRIPT := $(ALT_LIBRARY_ROOT_DIR)/linker.x - -# Include paths: -# The path to root of all header files that a library wishes to make -# available for an application's use is specified here. Note that this -# may not be *all* folders within a hierarchy. For example, if it is -# desired that the application developer type: -# #include -# #include -# With files laid out like this: -# /inc/sockets.h -# /inc/ip/tcpip.h -# -# Then, only /inc need be added to the list of include -# directories. Alternatively, if you wish to be able to directly include -# all files in a hierarchy, separate paths to each folder in that -# hierarchy must be defined. - -# The following are the "base" set of include paths for a BSP. -# These paths are appended to the list that individual software -# components, drivers, etc., add in the generated portion of this -# file (below). -ALT_INCLUDE_DIRS_TO_APPEND += \ - $(ALT_LIBRARY_ROOT_DIR) \ - $(ALT_LIBRARY_ROOT_DIR)/drivers/inc - -# Additions to linker library search-path: -# Here we provide a path to "our self" for the application to construct a -# "-L " out of. This should contain a list of directories, -# relative to the library root, of all directories with .a files to link -# against. -ALT_LIBRARY_DIRS += $(ALT_LIBRARY_ROOT_DIR) - - -#------------------------------------------------------------------------------ -# COMPILATION FLAGS -#------------------------------------------------------------------------------ -# Default C pre-processor flags for a BSP: -ALT_CPPFLAGS += -DSYSTEM_BUS_WIDTH=32 \ - -pipe - - -#------------------------------------------------------------------------------ -# MANAGED CONTENT -# -# All content between the lines "START MANAGED" and "END MANAGED" below is -# generated based on variables in the BSP settings file when the -# nios2-bsp-generate-files command is invoked. If you wish to persist any -# information pertaining to the build process, it is recomended that you -# utilize the BSP settings mechanism to do so. -#------------------------------------------------------------------------------ -#START MANAGED - -# The following TYPE comment allows tools to identify the 'type' of target this -# makefile is associated with. -# TYPE: BSP_PUBLIC_MAKEFILE - -# This following VERSION comment indicates the version of the tool used to -# generate this makefile. A makefile variable is provided for VERSION as well. -# ACDS_VERSION: 13.0sp1 -ACDS_VERSION := 13.0sp1 - -# This following BUILD_NUMBER comment indicates the build number of the tool -# used to generate this makefile. -# BUILD_NUMBER: 232 - -# Qsys--generated SOPCINFO file. Required for resolving node instance ID's with -# design component names. -SOPCINFO_FILE := C:/Users/takayun/Documents/DE2-115/qsys_tutorial/nios_system.sopcinfo - -# Big-Endian operation. -# setting BIG_ENDIAN is false -ALT_CFLAGS += -EL - -# Path to the provided C language runtime initialization code. -BSP_CRT0 := $(ALT_LIBRARY_ROOT_DIR)/obj/HAL/src/crt0.o - -# Name of BSP library as provided to linker using the "-msys-lib" flag or -# linker script GROUP command. -# setting BSP_SYS_LIB is hal_bsp -BSP_SYS_LIB := hal_bsp -ELF_PATCH_FLAG += --thread_model hal - -# Type identifier of the BSP library -# setting BSP_TYPE is hal -ALT_CPPFLAGS += -D__hal__ -BSP_TYPE := hal - -# CPU Name -# setting CPU_NAME is nios2_processor -CPU_NAME = nios2_processor -ELF_PATCH_FLAG += --cpu_name $(CPU_NAME) - -# Hardware Divider present. -# setting HARDWARE_DIVIDE is false -ALT_CFLAGS += -mno-hw-div - -# Hardware Multiplier present. -# setting HARDWARE_MULTIPLY is false -ALT_CFLAGS += -mno-hw-mul - -# Hardware Mulx present. -# setting HARDWARE_MULX is false -ALT_CFLAGS += -mno-hw-mulx - -# Debug Core present. -# setting HAS_DEBUG_CORE is true -CPU_HAS_DEBUG_CORE = 1 - -# Qsys generated design -# setting QSYS is 1 -QSYS := 1 -ELF_PATCH_FLAG += --qsys true - -# Design Name -# setting SOPC_NAME is nios_system -SOPC_NAME := nios_system - -# SopcBuilder Simulation Enabled -# setting SOPC_SIMULATION_ENABLED is false -ELF_PATCH_FLAG += --simulation_enabled false - -# Enable JTAG UART driver to recover when host is inactive causing buffer to -# full without returning error. Printf will not fail with this recovery. none -# setting altera_avalon_jtag_uart_driver.enable_jtag_uart_ignore_fifo_full_error is false - -# Small-footprint (polled mode) driver none -# setting altera_avalon_jtag_uart_driver.enable_small_driver is false - -# Build a custom version of newlib with the specified space-separated compiler -# flags. The custom newlib build will be placed in the <bsp root>/newlib -# directory, and will be used only for applications that utilize this BSP. -# setting hal.custom_newlib_flags is none - -# Enable support for a subset of the C++ language. This option increases code -# footprint by adding support for C++ constructors. Certain features, such as -# multiple inheritance and exceptions are not supported. If false, adds -# -DALT_NO_C_PLUS_PLUS to ALT_CPPFLAGS in public.mk, and reduces code -# footprint. none -# setting hal.enable_c_plus_plus is false -ALT_CPPFLAGS += -DALT_NO_C_PLUS_PLUS - -# When your application exits, close file descriptors, call C++ destructors, -# etc. Code footprint can be reduced by disabling clean exit. If disabled, adds -# -DALT_NO_CLEAN_EXIT to ALT_CPPFLAGS and -Wl,--defsym, exit=_exit to -# ALT_LDFLAGS in public.mk. none -# setting hal.enable_clean_exit is false -ALT_CPPFLAGS += -DALT_NO_CLEAN_EXIT -ALT_LDFLAGS += -Wl,--defsym,exit=_exit - -# Add exit() support. This option increases code footprint if your "main()" -# routine does "return" or call "exit()". If false, adds -DALT_NO_EXIT to -# ALT_CPPFLAGS in public.mk, and reduces footprint none -# setting hal.enable_exit is false -ALT_CPPFLAGS += -DALT_NO_EXIT - -# Causes code to be compiled with gprof profiling enabled and the application -# ELF to be linked with the GPROF library. If true, adds -DALT_PROVIDE_GMON to -# ALT_CPPFLAGS and -pg to ALT_CFLAGS in public.mk. none -# setting hal.enable_gprof is false - -# Enables lightweight device driver API. This reduces code and data footprint -# by removing the HAL layer that maps device names (e.g. /dev/uart0) to file -# descriptors. Instead, driver routines are called directly. The open(), -# close(), and lseek() routines will always fail if called. The read(), -# write(), fstat(), ioctl(), and isatty() routines only work for the stdio -# devices. If true, adds -DALT_USE_DIRECT_DRIVERS to ALT_CPPFLAGS in public.mk. -# The Altera Host and read-only ZIP file systems can't be used if -# hal.enable_lightweight_device_driver_api is true. -# setting hal.enable_lightweight_device_driver_api is true -ALT_CPPFLAGS += -DALT_USE_DIRECT_DRIVERS - -# Adds code to emulate multiply and divide instructions in case they are -# executed but aren't present in the CPU. Normally this isn't required because -# the compiler won't use multiply and divide instructions that aren't present -# in the CPU. If false, adds -DALT_NO_INSTRUCTION_EMULATION to ALT_CPPFLAGS in -# public.mk. none -# setting hal.enable_mul_div_emulation is false -ALT_CPPFLAGS += -DALT_NO_INSTRUCTION_EMULATION - -# Certain drivers are compiled with reduced functionality to reduce code -# footprint. Not all drivers observe this setting. The altera_avalon_uart and -# altera_avalon_jtag_uart drivers switch from interrupt-driven to polled -# operation. CAUTION: Several device drivers are disabled entirely. These -# include the altera_avalon_cfi_flash, altera_avalon_epcs_flash_controller, and -# altera_avalon_lcd_16207 drivers. This can result in certain API (HAL flash -# access routines) to fail. You can define a symbol provided by each driver to -# prevent it from being removed. If true, adds -DALT_USE_SMALL_DRIVERS to -# ALT_CPPFLAGS in public.mk. none -# setting hal.enable_reduced_device_drivers is true -ALT_CPPFLAGS += -DALT_USE_SMALL_DRIVERS - -# Turns on HAL runtime stack checking feature. Enabling this setting causes -# additional code to be placed into each subroutine call to generate an -# exception if a stack collision occurs with the heap or statically allocated -# data. If true, adds -DALT_STACK_CHECK and -mstack-check to ALT_CPPFLAGS in -# public.mk. none -# setting hal.enable_runtime_stack_checking is false - -# The BSP is compiled with optimizations to speedup HDL simulation such as -# initializing the cache, clearing the .bss section, and skipping long delay -# loops. If true, adds -DALT_SIM_OPTIMIZE to ALT_CPPFLAGS in public.mk. When -# this setting is true, the BSP shouldn't be used to build applications that -# are expected to run real hardware. -# setting hal.enable_sim_optimize is false - -# Causes the small newlib (C library) to be used. This reduces code and data -# footprint at the expense of reduced functionality. Several newlib features -# are removed such as floating-point support in printf(), stdin input routines, -# and buffered I/O. The small C library is not compatible with Micrium -# MicroC/OS-II. If true, adds -msmallc to ALT_LDFLAGS in public.mk. none -# setting hal.enable_small_c_library is true -ALT_LDFLAGS += -msmallc -ALT_CPPFLAGS += -DSMALL_C_LIB - -# Enable SOPC Builder System ID. If a System ID SOPC Builder component is -# connected to the CPU associated with this BSP, it will be enabled in the -# creation of command-line arguments to download an ELF to the target. -# Otherwise, system ID and timestamp values are left out of public.mk for -# application Makefile "download-elf" target definition. With the system ID -# check disabled, the Nios II EDS tools will not automatically ensure that the -# application .elf file (and BSP it is linked against) corresponds to the -# hardware design on the target. If false, adds --accept-bad-sysid to -# SOPC_SYSID_FLAG in public.mk. none -# setting hal.enable_sopc_sysid_check is true - -# Enable BSP generation to query if SOPC system is big endian. If true ignores -# export of 'ALT_CFLAGS += -EB' to public.mk if big endian system. If true -# ignores export of 'ALT_CFLAGS += -EL' if little endian system. none -# setting hal.make.ignore_system_derived.big_endian is false - -# Enable BSP generation to query if SOPC system has a debug core present. If -# true ignores export of 'CPU_HAS_DEBUG_CORE = 1' to public.mk if a debug core -# is found in the system. If true ignores export of 'CPU_HAS_DEBUG_CORE = 0' if -# no debug core is found in the system. none -# setting hal.make.ignore_system_derived.debug_core_present is false - -# Enable BSP generation to query if SOPC system has FPU present. If true -# ignores export of 'ALT_CFLAGS += -mhard-float' to public.mk if FPU is found -# in the system. If true ignores export of 'ALT_CFLAGS += -mhard-soft' if FPU -# is not found in the system. none -# setting hal.make.ignore_system_derived.fpu_present is false - -# Enable BSP generation to query if SOPC system has hardware divide present. If -# true ignores export of 'ALT_CFLAGS += -mno-hw-div' to public.mk if no -# division is found in system. If true ignores export of 'ALT_CFLAGS += -# -mhw-div' if division is found in the system. none -# setting hal.make.ignore_system_derived.hardware_divide_present is false - -# Enable BSP generation to query if SOPC system floating point custom -# instruction with a divider is present. If true ignores export of 'ALT_CFLAGS -# += -mcustom-fpu-cfg=60-2' and 'ALT_LDFLAGS += -mcustom-fpu-cfg=60-2' to -# public.mk if the custom instruction is found in the system. none -# setting hal.make.ignore_system_derived.hardware_fp_cust_inst_divider_present is false - -# Enable BSP generation to query if SOPC system floating point custom -# instruction without a divider is present. If true ignores export of -# 'ALT_CFLAGS += -mcustom-fpu-cfg=60-1' and 'ALT_LDFLAGS += -# -mcustom-fpu-cfg=60-1' to public.mk if the custom instruction is found in the -# system. none -# setting hal.make.ignore_system_derived.hardware_fp_cust_inst_no_divider_present is false - -# Enable BSP generation to query if SOPC system has multiplier present. If true -# ignores export of 'ALT_CFLAGS += -mno-hw-mul' to public.mk if no multiplier -# is found in the system. If true ignores export of 'ALT_CFLAGS += -mhw-mul' if -# multiplier is found in the system. none -# setting hal.make.ignore_system_derived.hardware_multiplier_present is false - -# Enable BSP generation to query if SOPC system has hardware mulx present. If -# true ignores export of 'ALT_CFLAGS += -mno-hw-mulx' to public.mk if no mulx -# is found in the system. If true ignores export of 'ALT_CFLAGS += -mhw-mulx' -# if mulx is found in the system. none -# setting hal.make.ignore_system_derived.hardware_mulx_present is false - -# Enable BSP generation to query if SOPC system has simulation enabled. If true -# ignores export of 'ELF_PATCH_FLAG += --simulation_enabled' to public.mk. none -# setting hal.make.ignore_system_derived.sopc_simulation_enabled is false - -# Enable BSP generation to query SOPC system for system ID base address. If -# true ignores export of 'SOPC_SYSID_FLAG += --sidp=
' and -# 'ELF_PATCH_FLAG += --sidp=
' to public.mk. none -# setting hal.make.ignore_system_derived.sopc_system_base_address is false - -# Enable BSP generation to query SOPC system for system ID. If true ignores -# export of 'SOPC_SYSID_FLAG += --id=' and 'ELF_PATCH_FLAG += -# --id=' to public.mk. none -# setting hal.make.ignore_system_derived.sopc_system_id is false - -# Enable BSP generation to query SOPC system for system timestamp. If true -# ignores export of 'SOPC_SYSID_FLAG += --timestamp=' and -# 'ELF_PATCH_FLAG += --timestamp=' to public.mk. none -# setting hal.make.ignore_system_derived.sopc_system_timestamp is false - -# Slave descriptor of STDERR character-mode device. This setting is used by the -# ALT_STDERR family of defines in system.h. none -# setting hal.stderr is jtag_uart -ELF_PATCH_FLAG += --stderr_dev jtag_uart - -# Slave descriptor of STDIN character-mode device. This setting is used by the -# ALT_STDIN family of defines in system.h. none -# setting hal.stdin is jtag_uart -ELF_PATCH_FLAG += --stdin_dev jtag_uart - -# Slave descriptor of STDOUT character-mode device. This setting is used by the -# ALT_STDOUT family of defines in system.h. none -# setting hal.stdout is jtag_uart -ELF_PATCH_FLAG += --stdout_dev jtag_uart - - -#------------------------------------------------------------------------------ -# SOFTWARE COMPONENT & DRIVER INCLUDE PATHS -#------------------------------------------------------------------------------ - -ALT_INCLUDE_DIRS += $(ALT_LIBRARY_ROOT_DIR)/HAL/inc - -#------------------------------------------------------------------------------ -# SOFTWARE COMPONENT & DRIVER PRODUCED ALT_CPPFLAGS ADDITIONS -#------------------------------------------------------------------------------ - -ALT_CPPFLAGS += -DALT_SINGLE_THREADED - -#END MANAGED - - -#------------------------------------------------------------------------------ -# LIBRARY INFORMATION -#------------------------------------------------------------------------------ -# Assemble the name of the BSP *.a file using the BSP library name -# (BSP_SYS_LIB) in generated content above. -BSP_LIB := lib$(BSP_SYS_LIB).a - -# Additional libraries to link against: -# An application including this file will prefix each library with "-l". -# For example, to include the Newlib math library "m" is included, which -# becomes "-lm" when linking the application. -ALT_LIBRARY_NAMES += m - -# Additions to linker dependencies: -# An application Makefile will typically add these directly to the list -# of dependencies required to build the executable target(s). The BSP -# library (*.a) file is specified here. -ALT_LDDEPS += $(ALT_LIBRARY_ROOT_DIR)/$(BSP_LIB) - -# Is this library "Makeable"? -# Add to list of root library directories that support running 'make' -# to build them. Because libraries may or may not have a Makefile in their -# root, appending to this variable tells an application to run 'make' in -# the library root to build/update this library. -MAKEABLE_LIBRARY_ROOT_DIRS += $(ALT_LIBRARY_ROOT_DIR) - -# Additional Assembler Flags -# -gdwarf2 flag is required for stepping through assembly code -ALT_ASFLAGS += -gdwarf2 - -#------------------------------------------------------------------------------ -# FINAL INCLUDE PATH LIST -#------------------------------------------------------------------------------ -# Append static include paths to paths specified by OS/driver/sw package -# additions to the BSP thus giving them precedence in case a BSP addition -# is attempting to override BSP sources. -ALT_INCLUDE_DIRS += $(ALT_INCLUDE_DIRS_TO_APPEND) - - - diff --git a/software/qsys_tutorial_key3_bsp/settings.bsp b/software/qsys_tutorial_key3_bsp/settings.bsp deleted file mode 100644 index 3562949..0000000 --- a/software/qsys_tutorial_key3_bsp/settings.bsp +++ /dev/null @@ -1,925 +0,0 @@ - - - hal - default - 2016/11/10 10:49:50 - 1478742590906 - C:\Users\takayun\Documents\DE2-115\qsys_tutorial\software\qsys_tutorial_key3_bsp - .\settings.bsp - C:\Users\takayun\Documents\DE2-115\qsys_tutorial\nios_system.sopcinfo - default - nios2_processor - 1.9 - - hal.sys_clk_timer - ALT_SYS_CLK - UnquotedString - none - none - system_h_define - Slave descriptor of the system clock timer device. This device provides a periodic interrupt ("tick") and is typically required for RTOS use. This setting defines the value of ALT_SYS_CLK in system.h. - none - false - common - - - hal.timestamp_timer - ALT_TIMESTAMP_CLK - UnquotedString - none - none - system_h_define - Slave descriptor of timestamp timer device. This device is used by Altera HAL timestamp drivers for high-resolution time measurement. This setting defines the value of ALT_TIMESTAMP_CLK in system.h. - none - false - common - - - hal.max_file_descriptors - ALT_MAX_FD - DecimalNumber - 4 - 32 - system_h_define - Determines the number of file descriptors statically allocated. This setting defines the value of ALT_MAX_FD in system.h. - If hal.enable_lightweight_device_driver_api is true, there are no file descriptors so this setting is ignored. If hal.enable_lightweight_device_driver_api is false, this setting must be at least 4 because HAL needs a file descriptor for /dev/null, /dev/stdin, /dev/stdout, and /dev/stderr. - false - - - - hal.enable_instruction_related_exceptions_api - ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API - BooleanDefineOnly - false - false - system_h_define - Enables API for registering handlers to service instruction-related exceptions. Enabling this setting increases the size of the exception entry code. - These exception types can be generated if various processor options are enabled, such as the MMU, MPU, or other advanced exception types. - false - - - - hal.linker.allow_code_at_reset - ALT_ALLOW_CODE_AT_RESET - Boolean - 1 - 0 - none - Indicates if initialization code is allowed at the reset address. If true, defines the macro ALT_ALLOW_CODE_AT_RESET in linker.h. - If true, defines the macro ALT_ALLOW_CODE_AT_RESET in linker.h. This setting is typically false if an external bootloader (e.g. flash bootloader) is present. - false - - - - hal.linker.enable_alt_load - NONE - Boolean - 1 - 0 - none - Enables the alt_load() facility. The alt_load() facility copies sections from the .text memory into RAM. If true, this setting sets up the VMA/LMA of sections in linker.x to allow them to be loaded into the .text memory. - This setting is typically false if an external bootloader (e.g. flash bootloader) is present. - false - - - - hal.linker.enable_alt_load_copy_rodata - NONE - Boolean - 0 - 0 - none - Causes the alt_load() facility to copy the .rodata section. If true, this setting defines the macro ALT_LOAD_COPY_RODATA in linker.h. - none - false - - - - hal.linker.enable_alt_load_copy_rwdata - NONE - Boolean - 1 - 0 - none - Causes the alt_load() facility to copy the .rwdata section. If true, this setting defines the macro ALT_LOAD_COPY_RWDATA in linker.h. - none - false - - - - hal.linker.enable_alt_load_copy_exceptions - NONE - Boolean - 0 - 0 - none - Causes the alt_load() facility to copy the .exceptions section. If true, this setting defines the macro ALT_LOAD_COPY_EXCEPTIONS in linker.h. - none - false - - - - hal.linker.enable_exception_stack - NONE - Boolean - 0 - 0 - none - Enables use of a separate exception stack. If true, defines the macro ALT_EXCEPTION_STACK in linker.h, adds a memory region called exception_stack to linker.x, and provides the symbols __alt_exception_stack_pointer and __alt_exception_stack_limit in linker.x. - The hal.linker.exception_stack_size and hal.linker.exception_stack_memory_region_name settings must also be valid. This setting must be false for MicroC/OS-II BSPs. The exception stack can be used to improve interrupt and other exception performance if the EIC is *not* used. - false - common - - - hal.linker.exception_stack_size - NONE - DecimalNumber - 1024 - 1024 - none - Size of the exception stack in bytes. - Only used if hal.linker.enable_exception_stack is true. - false - common - - - hal.linker.exception_stack_memory_region_name - NONE - UnquotedString - onchip_memory - none - none - Name of the existing memory region that will be divided up to create the 'exception_stack' memory region. The selected region name will be adjusted automatically when the BSP is generated to create the 'exception_stack' memory region. - Only used if hal.linker.enable_exception_stack is true. - false - common - - - hal.linker.enable_interrupt_stack - NONE - Boolean - 0 - 0 - none - Enables use of a separate interrupt stack. If true, defines the macro ALT_INTERRUPT_STACK in linker.h, adds a memory region called interrupt_stack to linker.x, and provides the symbols __alt_interrupt_stack_pointer and __alt_interrupt_stack_limit in linker.x. - The hal.linker.interrupt_stack_size and hal.linker.interrupt_stack_memory_region_name settings must also be valid. This setting must be false for MicroC/OS-II BSPs. Only enable if the EIC is used exclusively. The exception stack can be used to improve interrupt and other exception performance if the EIC is *not* used. - false - common - - - hal.linker.interrupt_stack_size - NONE - DecimalNumber - 1024 - 1024 - none - Size of the interrupt stack in bytes. - Only used if hal.linker.enable_interrupt_stack is true. - false - common - - - hal.linker.interrupt_stack_memory_region_name - NONE - UnquotedString - onchip_memory - none - none - Name of the existing memory region that will be divided up to create the 'interrupt_stack' memory region. The selected region name will be adjusted automatically when the BSP is generated to create the 'interrupt_stack' memory region. - Only used if hal.linker.enable_interrupt_stack is true. - false - common - - - hal.stdin - NONE - UnquotedString - jtag_uart - none - system_h_define - Slave descriptor of STDIN character-mode device. This setting is used by the ALT_STDIN family of defines in system.h. - none - false - common - - - hal.stdout - NONE - UnquotedString - jtag_uart - none - system_h_define - Slave descriptor of STDOUT character-mode device. This setting is used by the ALT_STDOUT family of defines in system.h. - none - false - common - - - hal.stderr - NONE - UnquotedString - jtag_uart - none - system_h_define - Slave descriptor of STDERR character-mode device. This setting is used by the ALT_STDERR family of defines in system.h. - none - false - common - - - hal.log_port - NONE - UnquotedString - none - none - public_mk_define - Slave descriptor of debug logging character-mode device. If defined, it enables extra debug messages in the HAL source. This setting is used by the ALT_LOG_PORT family of defines in system.h. - none - false - none - - - hal.make.build_pre_process - BUILD_PRE_PROCESS - UnquotedString - none - none - makefile_variable - Command executed before BSP built. - none - false - none - - - hal.make.ar_pre_process - AR_PRE_PROCESS - UnquotedString - none - none - makefile_variable - Command executed before archiver execution. - none - false - none - - - hal.make.bsp_cflags_defined_symbols - BSP_CFLAGS_DEFINED_SYMBOLS - UnquotedString - none - none - makefile_variable - Preprocessor macros to define. A macro definition in this setting has the same effect as a "#define" in source code. Adding "-DALT_DEBUG" to this setting has the same effect as "#define ALT_DEBUG" in a souce file. Adding "-DFOO=1" to this setting is equivalent to the macro "#define FOO 1" in a source file. Macros defined with this setting are applied to all .S, .c, and C++ files in the BSP. This setting defines the value of BSP_CFLAGS_DEFINED_SYMBOLS in the BSP Makefile. - none - false - none - - - hal.make.ar_post_process - AR_POST_PROCESS - UnquotedString - none - none - makefile_variable - Command executed after archiver execution. - none - false - none - - - hal.make.as - AS - UnquotedString - nios2-elf-gcc - nios2-elf-gcc - makefile_variable - Assembler command. Note that CC is used for .S files. - none - false - none - - - hal.make.build_post_process - BUILD_POST_PROCESS - UnquotedString - none - none - makefile_variable - Command executed after BSP built. - none - false - none - - - hal.make.bsp_cflags_debug - BSP_CFLAGS_DEBUG - UnquotedString - -g - -g - makefile_variable - C/C++ compiler debug level. '-g' provides the default set of debug symbols typically required to debug a typical application. Omitting '-g' removes debug symbols from the ELF. This setting defines the value of BSP_CFLAGS_DEBUG in Makefile. - none - false - common - - - hal.make.ar - AR - UnquotedString - nios2-elf-ar - nios2-elf-ar - makefile_variable - Archiver command. Creates library files. - none - false - none - - - hal.make.rm - RM - UnquotedString - rm -f - rm -f - makefile_variable - Command used to remove files during 'clean' target. - none - false - none - - - hal.make.cxx_pre_process - CXX_PRE_PROCESS - UnquotedString - none - none - makefile_variable - Command executed before each C++ file is compiled. - none - false - none - - - hal.make.bsp_cflags_warnings - BSP_CFLAGS_WARNINGS - UnquotedString - -Wall - -Wall - makefile_variable - C/C++ compiler warning level. "-Wall" is commonly used.This setting defines the value of BSP_CFLAGS_WARNINGS in Makefile. - none - false - none - - - hal.make.bsp_arflags - BSP_ARFLAGS - UnquotedString - -src - -src - makefile_variable - Custom flags only passed to the archiver. This content of this variable is directly passed to the archiver rather than the more standard "ARFLAGS". The reason for this is that GNU Make assumes some default content in ARFLAGS. This setting defines the value of BSP_ARFLAGS in Makefile. - none - false - none - - - hal.make.bsp_cflags_optimization - BSP_CFLAGS_OPTIMIZATION - UnquotedString - '-Os' - -O0 - makefile_variable - C/C++ compiler optimization level. "-O0" = no optimization,"-O2" = "normal" optimization, etc. "-O0" is recommended for code that you want to debug since compiler optimization can remove variables and produce non-sequential execution of code while debugging. This setting defines the value of BSP_CFLAGS_OPTIMIZATION in Makefile. - none - false - common - - - hal.make.as_post_process - AS_POST_PROCESS - UnquotedString - none - none - makefile_variable - Command executed after each assembly file is compiled. - none - false - none - - - hal.make.cc_pre_process - CC_PRE_PROCESS - UnquotedString - none - none - makefile_variable - Command executed before each .c/.S file is compiled. - none - false - none - - - hal.make.bsp_asflags - BSP_ASFLAGS - UnquotedString - -Wa,-gdwarf2 - -Wa,-gdwarf2 - makefile_variable - Custom flags only passed to the assembler. This setting defines the value of BSP_ASFLAGS in Makefile. - none - false - none - - - hal.make.as_pre_process - AS_PRE_PROCESS - UnquotedString - none - none - makefile_variable - Command executed before each assembly file is compiled. - none - false - none - - - hal.make.bsp_cflags_undefined_symbols - BSP_CFLAGS_UNDEFINED_SYMBOLS - UnquotedString - none - none - makefile_variable - Preprocessor macros to undefine. Undefined macros are similar to defined macros, but replicate the "#undef" directive in source code. To undefine the macro FOO use the syntax "-u FOO" in this setting. This is equivalent to "#undef FOO" in a source file. Note: the syntax differs from macro definition (there is a space, i.e. "-u FOO" versus "-DFOO"). Macros defined with this setting are applied to all .S, .c, and C++ files in the BSP. This setting defines the value of BSP_CFLAGS_UNDEFINED_SYMBOLS in the BSP Makefile. - none - false - none - - - hal.make.cc_post_process - CC_POST_PROCESS - UnquotedString - none - none - makefile_variable - Command executed after each .c/.S file is compiled. - none - false - none - - - hal.make.cxx_post_process - CXX_POST_PROCESS - UnquotedString - none - none - makefile_variable - Command executed before each C++ file is compiled. - none - false - none - - - hal.make.cc - CC - UnquotedString - nios2-elf-gcc -xc - nios2-elf-gcc -xc - makefile_variable - C compiler command. - none - false - none - - - hal.make.bsp_cxx_flags - BSP_CXXFLAGS - UnquotedString - none - none - makefile_variable - Custom flags only passed to the C++ compiler. This setting defines the value of BSP_CXXFLAGS in Makefile. - none - false - none - - - hal.make.bsp_inc_dirs - BSP_INC_DIRS - UnquotedString - none - none - makefile_variable - Space separated list of extra include directories to scan for header files. Directories are relative to the top-level BSP directory. The -I prefix's added by the makefile so don't add it here. This setting defines the value of BSP_INC_DIRS in Makefile. - none - false - none - - - hal.make.cxx - CXX - UnquotedString - nios2-elf-gcc -xc++ - nios2-elf-gcc -xc++ - makefile_variable - C++ compiler command. - none - false - none - - - hal.make.bsp_cflags_user_flags - BSP_CFLAGS_USER_FLAGS - UnquotedString - none - none - makefile_variable - Custom flags passed to the compiler when compiling C, C++, and .S files. This setting defines the value of BSP_CFLAGS_USER_FLAGS in Makefile. - none - false - none - - - hal.make.ignore_system_derived.sopc_system_id - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query SOPC system for system ID. If true ignores export of 'SOPC_SYSID_FLAG += --id=<sysid>' and 'ELF_PATCH_FLAG += --id=<sysid>' to public.mk. - none - false - none - - - hal.make.ignore_system_derived.sopc_system_timestamp - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query SOPC system for system timestamp. If true ignores export of 'SOPC_SYSID_FLAG += --timestamp=<timestamp>' and 'ELF_PATCH_FLAG += --timestamp=<timestamp>' to public.mk. - none - false - none - - - hal.make.ignore_system_derived.sopc_system_base_address - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query SOPC system for system ID base address. If true ignores export of 'SOPC_SYSID_FLAG += --sidp=<address>' and 'ELF_PATCH_FLAG += --sidp=<address>' to public.mk. - none - false - none - - - hal.make.ignore_system_derived.sopc_simulation_enabled - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system has simulation enabled. If true ignores export of 'ELF_PATCH_FLAG += --simulation_enabled' to public.mk. - none - false - none - - - hal.make.ignore_system_derived.fpu_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system has FPU present. If true ignores export of 'ALT_CFLAGS += -mhard-float' to public.mk if FPU is found in the system. If true ignores export of 'ALT_CFLAGS += -mhard-soft' if FPU is not found in the system. - none - false - none - - - hal.make.ignore_system_derived.hardware_multiplier_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system has multiplier present. If true ignores export of 'ALT_CFLAGS += -mno-hw-mul' to public.mk if no multiplier is found in the system. If true ignores export of 'ALT_CFLAGS += -mhw-mul' if multiplier is found in the system. - none - false - none - - - hal.make.ignore_system_derived.hardware_mulx_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system has hardware mulx present. If true ignores export of 'ALT_CFLAGS += -mno-hw-mulx' to public.mk if no mulx is found in the system. If true ignores export of 'ALT_CFLAGS += -mhw-mulx' if mulx is found in the system. - none - false - none - - - hal.make.ignore_system_derived.hardware_divide_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system has hardware divide present. If true ignores export of 'ALT_CFLAGS += -mno-hw-div' to public.mk if no division is found in system. If true ignores export of 'ALT_CFLAGS += -mhw-div' if division is found in the system. - none - false - none - - - hal.make.ignore_system_derived.debug_core_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system has a debug core present. If true ignores export of 'CPU_HAS_DEBUG_CORE = 1' to public.mk if a debug core is found in the system. If true ignores export of 'CPU_HAS_DEBUG_CORE = 0' if no debug core is found in the system. - none - false - none - - - hal.make.ignore_system_derived.big_endian - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system is big endian. If true ignores export of 'ALT_CFLAGS += -EB' to public.mk if big endian system. If true ignores export of 'ALT_CFLAGS += -EL' if little endian system. - none - false - none - - - hal.make.ignore_system_derived.hardware_fp_cust_inst_divider_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system floating point custom instruction with a divider is present. If true ignores export of 'ALT_CFLAGS += -mcustom-fpu-cfg=60-2' and 'ALT_LDFLAGS += -mcustom-fpu-cfg=60-2' to public.mk if the custom instruction is found in the system. - none - false - none - - - hal.make.ignore_system_derived.hardware_fp_cust_inst_no_divider_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system floating point custom instruction without a divider is present. If true ignores export of 'ALT_CFLAGS += -mcustom-fpu-cfg=60-1' and 'ALT_LDFLAGS += -mcustom-fpu-cfg=60-1' to public.mk if the custom instruction is found in the system. - none - false - none - - - hal.enable_exit - ALT_NO_EXIT - Boolean - 0 - 1 - public_mk_define - Add exit() support. This option increases code footprint if your "main()" routine does "return" or call "exit()". If false, adds -DALT_NO_EXIT to ALT_CPPFLAGS in public.mk, and reduces footprint - none - false - none - - - hal.enable_small_c_library - NONE - Boolean - 1 - 0 - public_mk_define - Causes the small newlib (C library) to be used. This reduces code and data footprint at the expense of reduced functionality. Several newlib features are removed such as floating-point support in printf(), stdin input routines, and buffered I/O. The small C library is not compatible with Micrium MicroC/OS-II. If true, adds -msmallc to ALT_LDFLAGS in public.mk. - none - false - common - - - hal.enable_clean_exit - ALT_NO_CLEAN_EXIT - Boolean - 0 - 1 - public_mk_define - When your application exits, close file descriptors, call C++ destructors, etc. Code footprint can be reduced by disabling clean exit. If disabled, adds -DALT_NO_CLEAN_EXIT to ALT_CPPFLAGS and -Wl,--defsym, exit=_exit to ALT_LDFLAGS in public.mk. - none - false - none - - - hal.enable_runtime_stack_checking - ALT_STACK_CHECK - Boolean - 0 - 0 - public_mk_define - Turns on HAL runtime stack checking feature. Enabling this setting causes additional code to be placed into each subroutine call to generate an exception if a stack collision occurs with the heap or statically allocated data. If true, adds -DALT_STACK_CHECK and -mstack-check to ALT_CPPFLAGS in public.mk. - none - false - none - - - hal.enable_gprof - ALT_PROVIDE_GMON - Boolean - 0 - 0 - public_mk_define - Causes code to be compiled with gprof profiling enabled and the application ELF to be linked with the GPROF library. If true, adds -DALT_PROVIDE_GMON to ALT_CPPFLAGS and -pg to ALT_CFLAGS in public.mk. - none - false - common - - - hal.enable_c_plus_plus - ALT_NO_C_PLUS_PLUS - Boolean - 0 - 1 - public_mk_define - Enable support for a subset of the C++ language. This option increases code footprint by adding support for C++ constructors. Certain features, such as multiple inheritance and exceptions are not supported. If false, adds -DALT_NO_C_PLUS_PLUS to ALT_CPPFLAGS in public.mk, and reduces code footprint. - none - false - none - - - hal.enable_reduced_device_drivers - ALT_USE_SMALL_DRIVERS - Boolean - 1 - 0 - public_mk_define - Certain drivers are compiled with reduced functionality to reduce code footprint. Not all drivers observe this setting. The altera_avalon_uart and altera_avalon_jtag_uart drivers switch from interrupt-driven to polled operation. CAUTION: Several device drivers are disabled entirely. These include the altera_avalon_cfi_flash, altera_avalon_epcs_flash_controller, and altera_avalon_lcd_16207 drivers. This can result in certain API (HAL flash access routines) to fail. You can define a symbol provided by each driver to prevent it from being removed. If true, adds -DALT_USE_SMALL_DRIVERS to ALT_CPPFLAGS in public.mk. - none - false - common - - - hal.enable_lightweight_device_driver_api - ALT_USE_DIRECT_DRIVERS - Boolean - 1 - 0 - public_mk_define - Enables lightweight device driver API. This reduces code and data footprint by removing the HAL layer that maps device names (e.g. /dev/uart0) to file descriptors. Instead, driver routines are called directly. The open(), close(), and lseek() routines will always fail if called. The read(), write(), fstat(), ioctl(), and isatty() routines only work for the stdio devices. If true, adds -DALT_USE_DIRECT_DRIVERS to ALT_CPPFLAGS in public.mk. - The Altera Host and read-only ZIP file systems can't be used if hal.enable_lightweight_device_driver_api is true. - false - none - - - hal.enable_mul_div_emulation - ALT_NO_INSTRUCTION_EMULATION - Boolean - 0 - 0 - public_mk_define - Adds code to emulate multiply and divide instructions in case they are executed but aren't present in the CPU. Normally this isn't required because the compiler won't use multiply and divide instructions that aren't present in the CPU. If false, adds -DALT_NO_INSTRUCTION_EMULATION to ALT_CPPFLAGS in public.mk. - none - false - none - - - hal.enable_sim_optimize - ALT_SIM_OPTIMIZE - Boolean - 0 - 0 - public_mk_define - The BSP is compiled with optimizations to speedup HDL simulation such as initializing the cache, clearing the .bss section, and skipping long delay loops. If true, adds -DALT_SIM_OPTIMIZE to ALT_CPPFLAGS in public.mk. - When this setting is true, the BSP shouldn't be used to build applications that are expected to run real hardware. - false - common - - - hal.enable_sopc_sysid_check - NONE - Boolean - 1 - 1 - public_mk_define - Enable SOPC Builder System ID. If a System ID SOPC Builder component is connected to the CPU associated with this BSP, it will be enabled in the creation of command-line arguments to download an ELF to the target. Otherwise, system ID and timestamp values are left out of public.mk for application Makefile "download-elf" target definition. With the system ID check disabled, the Nios II EDS tools will not automatically ensure that the application .elf file (and BSP it is linked against) corresponds to the hardware design on the target. If false, adds --accept-bad-sysid to SOPC_SYSID_FLAG in public.mk. - none - false - none - - - hal.custom_newlib_flags - CUSTOM_NEWLIB_FLAGS - UnquotedString - none - none - public_mk_define - Build a custom version of newlib with the specified space-separated compiler flags. - The custom newlib build will be placed in the &lt;bsp root>/newlib directory, and will be used only for applications that utilize this BSP. - false - none - - - hal.log_flags - ALT_LOG_FLAGS - DecimalNumber - 0 - 0 - public_mk_define - The value is assigned to ALT_LOG_FLAGS in the generated public.mk. See hal.log_port setting description. Values can be -1 through 3. - hal.log_port must be set for this to be used. - false - none - - - altera_avalon_jtag_uart_driver.enable_small_driver - ALTERA_AVALON_JTAG_UART_SMALL - BooleanDefineOnly - false - false - public_mk_define - Small-footprint (polled mode) driver - none - false - - - - altera_avalon_jtag_uart_driver.enable_jtag_uart_ignore_fifo_full_error - ALTERA_AVALON_JTAG_UART_IGNORE_FIFO_FULL_ERROR - BooleanDefineOnly - false - false - public_mk_define - Enable JTAG UART driver to recover when host is inactive causing buffer to full without returning error. Printf will not fail with this recovery. - none - false - - - - onchip_memory - 0x00000000 - 0x00000FFF - 4096 - memory - - - push_switches - 0x00002000 - 0x0000200F - 16 - - - - switches - 0x00002010 - 0x0000201F - 16 - - - - LEDRs - 0x00002020 - 0x0000202F - 16 - - - - LEDs - 0x00002030 - 0x0000203F - 16 - - - - jtag_uart - 0x00002040 - 0x00002047 - 8 - printable - - - .text - onchip_memory - - - .rodata - onchip_memory - - - .rwdata - onchip_memory - - - .bss - onchip_memory - - - .heap - onchip_memory - - - .stack - onchip_memory - - \ No newline at end of file diff --git a/software/qsys_tutorial_key3_bsp/summary.html b/software/qsys_tutorial_key3_bsp/summary.html deleted file mode 100644 index 7c6b1e0..0000000 --- a/software/qsys_tutorial_key3_bsp/summary.html +++ /dev/null @@ -1,2014 +0,0 @@ - -Altera Nios II BSP Summary - -

BSP Description

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
BSP Type:hal
SOPC Design File:C:\Users\takayun\Documents\DE2-115\qsys_tutorial\nios_system.sopcinfo
Quartus JDI File:default
CPU:nios2_processor
BSP Settings File:.\settings.bsp
BSP Version:default
BSP Generated On:2016/11/10 10:49:50
BSP Generated Timestamp:1478742590906
BSP Generated Location:C:\Users\takayun\Documents\DE2-115\qsys_tutorial\software\qsys_tutorial_key3_bsp
-
-

Nios II Memory Map

- - - - - - - - - - - - - - - - - - - - - - -
Slave DescriptorAddress RangeSizeAttributes
jtag_uart0x00002040 - 0x000020478printable
LEDs0x00002030 - 0x0000203F16 
LEDRs0x00002020 - 0x0000202F16 
switches0x00002010 - 0x0000201F16 
push_switches0x00002000 - 0x0000200F16 
onchip_memory0x00000000 - 0x00000FFF4096memory
-
-
-

Linker Regions

- - - - -
RegionAddress RangeSizeMemoryOffset
-
-
-

Linker Section Mappings

- - - - - - - - - - - - - - - - - - - - - - -
SectionRegion
.textonchip_memory
.rodataonchip_memory
.rwdataonchip_memory
.bssonchip_memory
.heaponchip_memory
.stackonchip_memory
-

Settings

- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:altera_avalon_jtag_uart_driver.enable_jtag_uart_ignore_fifo_full_error
Identifier:ALTERA_AVALON_JTAG_UART_IGNORE_FIFO_FULL_ERROR
Default Value:false
Value:false
Type:BooleanDefineOnly
Destination:public_mk_define
Description:Enable JTAG UART driver to recover when host is inactive causing buffer to full without returning error. Printf will not fail with this recovery.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:altera_avalon_jtag_uart_driver.enable_small_driver
Identifier:ALTERA_AVALON_JTAG_UART_SMALL
Default Value:false
Value:false
Type:BooleanDefineOnly
Destination:public_mk_define
Description:Small-footprint (polled mode) driver
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.custom_newlib_flags
Identifier:CUSTOM_NEWLIB_FLAGS
Default Value:none
Value:none
Type:UnquotedString
Destination:public_mk_define
Description:Build a custom version of newlib with the specified space-separated compiler flags.
Restrictions:The custom newlib build will be placed in the &lt;bsp root>/newlib directory, and will be used only for applications that utilize this BSP.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_c_plus_plus
Identifier:ALT_NO_C_PLUS_PLUS
Default Value:1
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable support for a subset of the C++ language. This option increases code footprint by adding support for C++ constructors. Certain features, such as multiple inheritance and exceptions are not supported. If false, adds -DALT_NO_C_PLUS_PLUS to ALT_CPPFLAGS in public.mk, and reduces code footprint.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_clean_exit
Identifier:ALT_NO_CLEAN_EXIT
Default Value:1
Value:0
Type:Boolean
Destination:public_mk_define
Description:When your application exits, close file descriptors, call C++ destructors, etc. Code footprint can be reduced by disabling clean exit. If disabled, adds -DALT_NO_CLEAN_EXIT to ALT_CPPFLAGS and -Wl,--defsym, exit=_exit to ALT_LDFLAGS in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_exit
Identifier:ALT_NO_EXIT
Default Value:1
Value:0
Type:Boolean
Destination:public_mk_define
Description:Add exit() support. This option increases code footprint if your "main()" routine does "return" or call "exit()". If false, adds -DALT_NO_EXIT to ALT_CPPFLAGS in public.mk, and reduces footprint
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_gprof
Identifier:ALT_PROVIDE_GMON
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Causes code to be compiled with gprof profiling enabled and the application ELF to be linked with the GPROF library. If true, adds -DALT_PROVIDE_GMON to ALT_CPPFLAGS and -pg to ALT_CFLAGS in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_instruction_related_exceptions_api
Identifier:ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API
Default Value:false
Value:false
Type:BooleanDefineOnly
Destination:system_h_define
Description:Enables API for registering handlers to service instruction-related exceptions. Enabling this setting increases the size of the exception entry code.
Restrictions:These exception types can be generated if various processor options are enabled, such as the MMU, MPU, or other advanced exception types.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_lightweight_device_driver_api
Identifier:ALT_USE_DIRECT_DRIVERS
Default Value:0
Value:1
Type:Boolean
Destination:public_mk_define
Description:Enables lightweight device driver API. This reduces code and data footprint by removing the HAL layer that maps device names (e.g. /dev/uart0) to file descriptors. Instead, driver routines are called directly. The open(), close(), and lseek() routines will always fail if called. The read(), write(), fstat(), ioctl(), and isatty() routines only work for the stdio devices. If true, adds -DALT_USE_DIRECT_DRIVERS to ALT_CPPFLAGS in public.mk.
Restrictions:The Altera Host and read-only ZIP file systems can't be used if hal.enable_lightweight_device_driver_api is true.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_mul_div_emulation
Identifier:ALT_NO_INSTRUCTION_EMULATION
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Adds code to emulate multiply and divide instructions in case they are executed but aren't present in the CPU. Normally this isn't required because the compiler won't use multiply and divide instructions that aren't present in the CPU. If false, adds -DALT_NO_INSTRUCTION_EMULATION to ALT_CPPFLAGS in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_reduced_device_drivers
Identifier:ALT_USE_SMALL_DRIVERS
Default Value:0
Value:1
Type:Boolean
Destination:public_mk_define
Description:Certain drivers are compiled with reduced functionality to reduce code footprint. Not all drivers observe this setting. The altera_avalon_uart and altera_avalon_jtag_uart drivers switch from interrupt-driven to polled operation. CAUTION: Several device drivers are disabled entirely. These include the altera_avalon_cfi_flash, altera_avalon_epcs_flash_controller, and altera_avalon_lcd_16207 drivers. This can result in certain API (HAL flash access routines) to fail. You can define a symbol provided by each driver to prevent it from being removed. If true, adds -DALT_USE_SMALL_DRIVERS to ALT_CPPFLAGS in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_runtime_stack_checking
Identifier:ALT_STACK_CHECK
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Turns on HAL runtime stack checking feature. Enabling this setting causes additional code to be placed into each subroutine call to generate an exception if a stack collision occurs with the heap or statically allocated data. If true, adds -DALT_STACK_CHECK and -mstack-check to ALT_CPPFLAGS in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_sim_optimize
Identifier:ALT_SIM_OPTIMIZE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:The BSP is compiled with optimizations to speedup HDL simulation such as initializing the cache, clearing the .bss section, and skipping long delay loops. If true, adds -DALT_SIM_OPTIMIZE to ALT_CPPFLAGS in public.mk.
Restrictions:When this setting is true, the BSP shouldn't be used to build applications that are expected to run real hardware.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_small_c_library
Identifier:NONE
Default Value:0
Value:1
Type:Boolean
Destination:public_mk_define
Description:Causes the small newlib (C library) to be used. This reduces code and data footprint at the expense of reduced functionality. Several newlib features are removed such as floating-point support in printf(), stdin input routines, and buffered I/O. The small C library is not compatible with Micrium MicroC/OS-II. If true, adds -msmallc to ALT_LDFLAGS in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_sopc_sysid_check
Identifier:NONE
Default Value:1
Value:1
Type:Boolean
Destination:public_mk_define
Description:Enable SOPC Builder System ID. If a System ID SOPC Builder component is connected to the CPU associated with this BSP, it will be enabled in the creation of command-line arguments to download an ELF to the target. Otherwise, system ID and timestamp values are left out of public.mk for application Makefile "download-elf" target definition. With the system ID check disabled, the Nios II EDS tools will not automatically ensure that the application .elf file (and BSP it is linked against) corresponds to the hardware design on the target. If false, adds --accept-bad-sysid to SOPC_SYSID_FLAG in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.allow_code_at_reset
Identifier:ALT_ALLOW_CODE_AT_RESET
Default Value:0
Value:1
Type:Boolean
Destination:none
Description:Indicates if initialization code is allowed at the reset address. If true, defines the macro ALT_ALLOW_CODE_AT_RESET in linker.h.
Restrictions:If true, defines the macro ALT_ALLOW_CODE_AT_RESET in linker.h. This setting is typically false if an external bootloader (e.g. flash bootloader) is present.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.enable_alt_load
Identifier:NONE
Default Value:0
Value:1
Type:Boolean
Destination:none
Description:Enables the alt_load() facility. The alt_load() facility copies sections from the .text memory into RAM. If true, this setting sets up the VMA/LMA of sections in linker.x to allow them to be loaded into the .text memory.
Restrictions:This setting is typically false if an external bootloader (e.g. flash bootloader) is present.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.enable_alt_load_copy_exceptions
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:none
Description:Causes the alt_load() facility to copy the .exceptions section. If true, this setting defines the macro ALT_LOAD_COPY_EXCEPTIONS in linker.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.enable_alt_load_copy_rodata
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:none
Description:Causes the alt_load() facility to copy the .rodata section. If true, this setting defines the macro ALT_LOAD_COPY_RODATA in linker.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.enable_alt_load_copy_rwdata
Identifier:NONE
Default Value:0
Value:1
Type:Boolean
Destination:none
Description:Causes the alt_load() facility to copy the .rwdata section. If true, this setting defines the macro ALT_LOAD_COPY_RWDATA in linker.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.enable_exception_stack
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:none
Description:Enables use of a separate exception stack. If true, defines the macro ALT_EXCEPTION_STACK in linker.h, adds a memory region called exception_stack to linker.x, and provides the symbols __alt_exception_stack_pointer and __alt_exception_stack_limit in linker.x.
Restrictions:The hal.linker.exception_stack_size and hal.linker.exception_stack_memory_region_name settings must also be valid. This setting must be false for MicroC/OS-II BSPs. The exception stack can be used to improve interrupt and other exception performance if the EIC is *not* used.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.enable_interrupt_stack
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:none
Description:Enables use of a separate interrupt stack. If true, defines the macro ALT_INTERRUPT_STACK in linker.h, adds a memory region called interrupt_stack to linker.x, and provides the symbols __alt_interrupt_stack_pointer and __alt_interrupt_stack_limit in linker.x.
Restrictions:The hal.linker.interrupt_stack_size and hal.linker.interrupt_stack_memory_region_name settings must also be valid. This setting must be false for MicroC/OS-II BSPs. Only enable if the EIC is used exclusively. The exception stack can be used to improve interrupt and other exception performance if the EIC is *not* used.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.exception_stack_memory_region_name
Identifier:NONE
Default Value:none
Value:onchip_memory
Type:UnquotedString
Destination:none
Description:Name of the existing memory region that will be divided up to create the 'exception_stack' memory region. The selected region name will be adjusted automatically when the BSP is generated to create the 'exception_stack' memory region.
Restrictions:Only used if hal.linker.enable_exception_stack is true.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.exception_stack_size
Identifier:NONE
Default Value:1024
Value:1024
Type:DecimalNumber
Destination:none
Description:Size of the exception stack in bytes.
Restrictions:Only used if hal.linker.enable_exception_stack is true.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.interrupt_stack_memory_region_name
Identifier:NONE
Default Value:none
Value:onchip_memory
Type:UnquotedString
Destination:none
Description:Name of the existing memory region that will be divided up to create the 'interrupt_stack' memory region. The selected region name will be adjusted automatically when the BSP is generated to create the 'interrupt_stack' memory region.
Restrictions:Only used if hal.linker.enable_interrupt_stack is true.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.interrupt_stack_size
Identifier:NONE
Default Value:1024
Value:1024
Type:DecimalNumber
Destination:none
Description:Size of the interrupt stack in bytes.
Restrictions:Only used if hal.linker.enable_interrupt_stack is true.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.log_flags
Identifier:ALT_LOG_FLAGS
Default Value:0
Value:0
Type:DecimalNumber
Destination:public_mk_define
Description:The value is assigned to ALT_LOG_FLAGS in the generated public.mk. See hal.log_port setting description. Values can be -1 through 3.
Restrictions:hal.log_port must be set for this to be used.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.log_port
Identifier:NONE
Default Value:none
Value:none
Type:UnquotedString
Destination:public_mk_define
Description:Slave descriptor of debug logging character-mode device. If defined, it enables extra debug messages in the HAL source. This setting is used by the ALT_LOG_PORT family of defines in system.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ar
Identifier:AR
Default Value:nios2-elf-ar
Value:nios2-elf-ar
Type:UnquotedString
Destination:makefile_variable
Description:Archiver command. Creates library files.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ar_post_process
Identifier:AR_POST_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed after archiver execution.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ar_pre_process
Identifier:AR_PRE_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed before archiver execution.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.as
Identifier:AS
Default Value:nios2-elf-gcc
Value:nios2-elf-gcc
Type:UnquotedString
Destination:makefile_variable
Description:Assembler command. Note that CC is used for .S files.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.as_post_process
Identifier:AS_POST_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed after each assembly file is compiled.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.as_pre_process
Identifier:AS_PRE_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed before each assembly file is compiled.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_arflags
Identifier:BSP_ARFLAGS
Default Value:-src
Value:-src
Type:UnquotedString
Destination:makefile_variable
Description:Custom flags only passed to the archiver. This content of this variable is directly passed to the archiver rather than the more standard "ARFLAGS". The reason for this is that GNU Make assumes some default content in ARFLAGS. This setting defines the value of BSP_ARFLAGS in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_asflags
Identifier:BSP_ASFLAGS
Default Value:-Wa,-gdwarf2
Value:-Wa,-gdwarf2
Type:UnquotedString
Destination:makefile_variable
Description:Custom flags only passed to the assembler. This setting defines the value of BSP_ASFLAGS in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cflags_debug
Identifier:BSP_CFLAGS_DEBUG
Default Value:-g
Value:-g
Type:UnquotedString
Destination:makefile_variable
Description:C/C++ compiler debug level. '-g' provides the default set of debug symbols typically required to debug a typical application. Omitting '-g' removes debug symbols from the ELF. This setting defines the value of BSP_CFLAGS_DEBUG in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cflags_defined_symbols
Identifier:BSP_CFLAGS_DEFINED_SYMBOLS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Preprocessor macros to define. A macro definition in this setting has the same effect as a "#define" in source code. Adding "-DALT_DEBUG" to this setting has the same effect as "#define ALT_DEBUG" in a souce file. Adding "-DFOO=1" to this setting is equivalent to the macro "#define FOO 1" in a source file. Macros defined with this setting are applied to all .S, .c, and C++ files in the BSP. This setting defines the value of BSP_CFLAGS_DEFINED_SYMBOLS in the BSP Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cflags_optimization
Identifier:BSP_CFLAGS_OPTIMIZATION
Default Value:-O0
Value:'-Os'
Type:UnquotedString
Destination:makefile_variable
Description:C/C++ compiler optimization level. "-O0" = no optimization,"-O2" = "normal" optimization, etc. "-O0" is recommended for code that you want to debug since compiler optimization can remove variables and produce non-sequential execution of code while debugging. This setting defines the value of BSP_CFLAGS_OPTIMIZATION in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cflags_undefined_symbols
Identifier:BSP_CFLAGS_UNDEFINED_SYMBOLS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Preprocessor macros to undefine. Undefined macros are similar to defined macros, but replicate the "#undef" directive in source code. To undefine the macro FOO use the syntax "-u FOO" in this setting. This is equivalent to "#undef FOO" in a source file. Note: the syntax differs from macro definition (there is a space, i.e. "-u FOO" versus "-DFOO"). Macros defined with this setting are applied to all .S, .c, and C++ files in the BSP. This setting defines the value of BSP_CFLAGS_UNDEFINED_SYMBOLS in the BSP Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cflags_user_flags
Identifier:BSP_CFLAGS_USER_FLAGS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Custom flags passed to the compiler when compiling C, C++, and .S files. This setting defines the value of BSP_CFLAGS_USER_FLAGS in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cflags_warnings
Identifier:BSP_CFLAGS_WARNINGS
Default Value:-Wall
Value:-Wall
Type:UnquotedString
Destination:makefile_variable
Description:C/C++ compiler warning level. "-Wall" is commonly used.This setting defines the value of BSP_CFLAGS_WARNINGS in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cxx_flags
Identifier:BSP_CXXFLAGS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Custom flags only passed to the C++ compiler. This setting defines the value of BSP_CXXFLAGS in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_inc_dirs
Identifier:BSP_INC_DIRS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Space separated list of extra include directories to scan for header files. Directories are relative to the top-level BSP directory. The -I prefix's added by the makefile so don't add it here. This setting defines the value of BSP_INC_DIRS in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.build_post_process
Identifier:BUILD_POST_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed after BSP built.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.build_pre_process
Identifier:BUILD_PRE_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed before BSP built.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.cc
Identifier:CC
Default Value:nios2-elf-gcc -xc
Value:nios2-elf-gcc -xc
Type:UnquotedString
Destination:makefile_variable
Description:C compiler command.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.cc_post_process
Identifier:CC_POST_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed after each .c/.S file is compiled.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.cc_pre_process
Identifier:CC_PRE_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed before each .c/.S file is compiled.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.cxx
Identifier:CXX
Default Value:nios2-elf-gcc -xc++
Value:nios2-elf-gcc -xc++
Type:UnquotedString
Destination:makefile_variable
Description:C++ compiler command.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.cxx_post_process
Identifier:CXX_POST_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed before each C++ file is compiled.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.cxx_pre_process
Identifier:CXX_PRE_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed before each C++ file is compiled.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.big_endian
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system is big endian. If true ignores export of 'ALT_CFLAGS += -EB' to public.mk if big endian system. If true ignores export of 'ALT_CFLAGS += -EL' if little endian system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.debug_core_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system has a debug core present. If true ignores export of 'CPU_HAS_DEBUG_CORE = 1' to public.mk if a debug core is found in the system. If true ignores export of 'CPU_HAS_DEBUG_CORE = 0' if no debug core is found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.fpu_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system has FPU present. If true ignores export of 'ALT_CFLAGS += -mhard-float' to public.mk if FPU is found in the system. If true ignores export of 'ALT_CFLAGS += -mhard-soft' if FPU is not found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.hardware_divide_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system has hardware divide present. If true ignores export of 'ALT_CFLAGS += -mno-hw-div' to public.mk if no division is found in system. If true ignores export of 'ALT_CFLAGS += -mhw-div' if division is found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.hardware_fp_cust_inst_divider_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system floating point custom instruction with a divider is present. If true ignores export of 'ALT_CFLAGS += -mcustom-fpu-cfg=60-2' and 'ALT_LDFLAGS += -mcustom-fpu-cfg=60-2' to public.mk if the custom instruction is found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.hardware_fp_cust_inst_no_divider_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system floating point custom instruction without a divider is present. If true ignores export of 'ALT_CFLAGS += -mcustom-fpu-cfg=60-1' and 'ALT_LDFLAGS += -mcustom-fpu-cfg=60-1' to public.mk if the custom instruction is found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.hardware_multiplier_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system has multiplier present. If true ignores export of 'ALT_CFLAGS += -mno-hw-mul' to public.mk if no multiplier is found in the system. If true ignores export of 'ALT_CFLAGS += -mhw-mul' if multiplier is found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.hardware_mulx_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system has hardware mulx present. If true ignores export of 'ALT_CFLAGS += -mno-hw-mulx' to public.mk if no mulx is found in the system. If true ignores export of 'ALT_CFLAGS += -mhw-mulx' if mulx is found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.sopc_simulation_enabled
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system has simulation enabled. If true ignores export of 'ELF_PATCH_FLAG += --simulation_enabled' to public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.sopc_system_base_address
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query SOPC system for system ID base address. If true ignores export of 'SOPC_SYSID_FLAG += --sidp=<address>' and 'ELF_PATCH_FLAG += --sidp=<address>' to public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.sopc_system_id
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query SOPC system for system ID. If true ignores export of 'SOPC_SYSID_FLAG += --id=<sysid>' and 'ELF_PATCH_FLAG += --id=<sysid>' to public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.sopc_system_timestamp
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query SOPC system for system timestamp. If true ignores export of 'SOPC_SYSID_FLAG += --timestamp=<timestamp>' and 'ELF_PATCH_FLAG += --timestamp=<timestamp>' to public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.rm
Identifier:RM
Default Value:rm -f
Value:rm -f
Type:UnquotedString
Destination:makefile_variable
Description:Command used to remove files during 'clean' target.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.max_file_descriptors
Identifier:ALT_MAX_FD
Default Value:32
Value:4
Type:DecimalNumber
Destination:system_h_define
Description:Determines the number of file descriptors statically allocated. This setting defines the value of ALT_MAX_FD in system.h.
Restrictions:If hal.enable_lightweight_device_driver_api is true, there are no file descriptors so this setting is ignored. If hal.enable_lightweight_device_driver_api is false, this setting must be at least 4 because HAL needs a file descriptor for /dev/null, /dev/stdin, /dev/stdout, and /dev/stderr.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.stderr
Identifier:NONE
Default Value:none
Value:jtag_uart
Type:UnquotedString
Destination:system_h_define
Description:Slave descriptor of STDERR character-mode device. This setting is used by the ALT_STDERR family of defines in system.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.stdin
Identifier:NONE
Default Value:none
Value:jtag_uart
Type:UnquotedString
Destination:system_h_define
Description:Slave descriptor of STDIN character-mode device. This setting is used by the ALT_STDIN family of defines in system.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.stdout
Identifier:NONE
Default Value:none
Value:jtag_uart
Type:UnquotedString
Destination:system_h_define
Description:Slave descriptor of STDOUT character-mode device. This setting is used by the ALT_STDOUT family of defines in system.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.sys_clk_timer
Identifier:ALT_SYS_CLK
Default Value:none
Value:none
Type:UnquotedString
Destination:system_h_define
Description:Slave descriptor of the system clock timer device. This device provides a periodic interrupt ("tick") and is typically required for RTOS use. This setting defines the value of ALT_SYS_CLK in system.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.timestamp_timer
Identifier:ALT_TIMESTAMP_CLK
Default Value:none
Value:none
Type:UnquotedString
Destination:system_h_define
Description:Slave descriptor of timestamp timer device. This device is used by Altera HAL timestamp drivers for high-resolution time measurement. This setting defines the value of ALT_TIMESTAMP_CLK in system.h.
Restrictions:none
-
-
-
- - diff --git a/software/qsys_tutorial_key3_bsp/system.h b/software/qsys_tutorial_key3_bsp/system.h deleted file mode 100644 index aacf072..0000000 --- a/software/qsys_tutorial_key3_bsp/system.h +++ /dev/null @@ -1,332 +0,0 @@ -/* - * system.h - SOPC Builder system and BSP software package information - * - * Machine generated for CPU 'nios2_processor' in SOPC Builder design 'nios_system' - * SOPC Builder design path: C:/Users/takayun/Documents/DE2-115/qsys_tutorial/nios_system.sopcinfo - * - * Generated: Thu Nov 10 10:49:51 JST 2016 - */ - -/* - * DO NOT MODIFY THIS FILE - * - * Changing this file will have subtle consequences - * which will almost certainly lead to a nonfunctioning - * system. If you do modify this file, be aware that your - * changes will be overwritten and lost when this file - * is generated again. - * - * DO NOT MODIFY THIS FILE - */ - -/* - * License Agreement - * - * Copyright (c) 2008 - * Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - * - * This agreement shall be governed in all respects by the laws of the State - * of California and by the laws of the United States of America. - */ - -#ifndef __SYSTEM_H_ -#define __SYSTEM_H_ - -/* Include definitions from linker script generator */ -#include "linker.h" - - -/* - * CPU configuration - * - */ - -#define ALT_CPU_ARCHITECTURE "altera_nios2_qsys" -#define ALT_CPU_BIG_ENDIAN 0 -#define ALT_CPU_BREAK_ADDR 0x1820 -#define ALT_CPU_CPU_FREQ 50000000u -#define ALT_CPU_CPU_ID_SIZE 1 -#define ALT_CPU_CPU_ID_VALUE 0x00000000 -#define ALT_CPU_CPU_IMPLEMENTATION "tiny" -#define ALT_CPU_DATA_ADDR_WIDTH 0xe -#define ALT_CPU_DCACHE_LINE_SIZE 0 -#define ALT_CPU_DCACHE_LINE_SIZE_LOG2 0 -#define ALT_CPU_DCACHE_SIZE 0 -#define ALT_CPU_EXCEPTION_ADDR 0x20 -#define ALT_CPU_FLUSHDA_SUPPORTED -#define ALT_CPU_FREQ 50000000 -#define ALT_CPU_HARDWARE_DIVIDE_PRESENT 0 -#define ALT_CPU_HARDWARE_MULTIPLY_PRESENT 0 -#define ALT_CPU_HARDWARE_MULX_PRESENT 0 -#define ALT_CPU_HAS_DEBUG_CORE 1 -#define ALT_CPU_HAS_DEBUG_STUB -#define ALT_CPU_HAS_JMPI_INSTRUCTION -#define ALT_CPU_ICACHE_LINE_SIZE 0 -#define ALT_CPU_ICACHE_LINE_SIZE_LOG2 0 -#define ALT_CPU_ICACHE_SIZE 0 -#define ALT_CPU_INST_ADDR_WIDTH 0xd -#define ALT_CPU_NAME "nios2_processor" -#define ALT_CPU_RESET_ADDR 0x0 - - -/* - * CPU configuration (with legacy prefix - don't use these anymore) - * - */ - -#define NIOS2_BIG_ENDIAN 0 -#define NIOS2_BREAK_ADDR 0x1820 -#define NIOS2_CPU_FREQ 50000000u -#define NIOS2_CPU_ID_SIZE 1 -#define NIOS2_CPU_ID_VALUE 0x00000000 -#define NIOS2_CPU_IMPLEMENTATION "tiny" -#define NIOS2_DATA_ADDR_WIDTH 0xe -#define NIOS2_DCACHE_LINE_SIZE 0 -#define NIOS2_DCACHE_LINE_SIZE_LOG2 0 -#define NIOS2_DCACHE_SIZE 0 -#define NIOS2_EXCEPTION_ADDR 0x20 -#define NIOS2_FLUSHDA_SUPPORTED -#define NIOS2_HARDWARE_DIVIDE_PRESENT 0 -#define NIOS2_HARDWARE_MULTIPLY_PRESENT 0 -#define NIOS2_HARDWARE_MULX_PRESENT 0 -#define NIOS2_HAS_DEBUG_CORE 1 -#define NIOS2_HAS_DEBUG_STUB -#define NIOS2_HAS_JMPI_INSTRUCTION -#define NIOS2_ICACHE_LINE_SIZE 0 -#define NIOS2_ICACHE_LINE_SIZE_LOG2 0 -#define NIOS2_ICACHE_SIZE 0 -#define NIOS2_INST_ADDR_WIDTH 0xd -#define NIOS2_RESET_ADDR 0x0 - - -/* - * Define for each module class mastered by the CPU - * - */ - -#define __ALTERA_AVALON_JTAG_UART -#define __ALTERA_AVALON_ONCHIP_MEMORY2 -#define __ALTERA_AVALON_PIO -#define __ALTERA_NIOS2_QSYS - - -/* - * LEDRs configuration - * - */ - -#define ALT_MODULE_CLASS_LEDRs altera_avalon_pio -#define LEDRS_BASE 0x2020 -#define LEDRS_BIT_CLEARING_EDGE_REGISTER 0 -#define LEDRS_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define LEDRS_CAPTURE 0 -#define LEDRS_DATA_WIDTH 18 -#define LEDRS_DO_TEST_BENCH_WIRING 0 -#define LEDRS_DRIVEN_SIM_VALUE 0 -#define LEDRS_EDGE_TYPE "NONE" -#define LEDRS_FREQ 50000000 -#define LEDRS_HAS_IN 0 -#define LEDRS_HAS_OUT 1 -#define LEDRS_HAS_TRI 0 -#define LEDRS_IRQ -1 -#define LEDRS_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define LEDRS_IRQ_TYPE "NONE" -#define LEDRS_NAME "/dev/LEDRs" -#define LEDRS_RESET_VALUE 0 -#define LEDRS_SPAN 16 -#define LEDRS_TYPE "altera_avalon_pio" - - -/* - * LEDs configuration - * - */ - -#define ALT_MODULE_CLASS_LEDs altera_avalon_pio -#define LEDS_BASE 0x2030 -#define LEDS_BIT_CLEARING_EDGE_REGISTER 0 -#define LEDS_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define LEDS_CAPTURE 0 -#define LEDS_DATA_WIDTH 8 -#define LEDS_DO_TEST_BENCH_WIRING 0 -#define LEDS_DRIVEN_SIM_VALUE 0 -#define LEDS_EDGE_TYPE "NONE" -#define LEDS_FREQ 50000000 -#define LEDS_HAS_IN 0 -#define LEDS_HAS_OUT 1 -#define LEDS_HAS_TRI 0 -#define LEDS_IRQ -1 -#define LEDS_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define LEDS_IRQ_TYPE "NONE" -#define LEDS_NAME "/dev/LEDs" -#define LEDS_RESET_VALUE 0 -#define LEDS_SPAN 16 -#define LEDS_TYPE "altera_avalon_pio" - - -/* - * System configuration - * - */ - -#define ALT_DEVICE_FAMILY "Cyclone IV E" -#define ALT_ENHANCED_INTERRUPT_API_PRESENT -#define ALT_IRQ_BASE NULL -#define ALT_LOG_PORT "/dev/null" -#define ALT_LOG_PORT_BASE 0x0 -#define ALT_LOG_PORT_DEV null -#define ALT_LOG_PORT_TYPE "" -#define ALT_NUM_EXTERNAL_INTERRUPT_CONTROLLERS 0 -#define ALT_NUM_INTERNAL_INTERRUPT_CONTROLLERS 1 -#define ALT_NUM_INTERRUPT_CONTROLLERS 1 -#define ALT_STDERR "/dev/jtag_uart" -#define ALT_STDERR_BASE 0x2040 -#define ALT_STDERR_DEV jtag_uart -#define ALT_STDERR_IS_JTAG_UART -#define ALT_STDERR_PRESENT -#define ALT_STDERR_TYPE "altera_avalon_jtag_uart" -#define ALT_STDIN "/dev/jtag_uart" -#define ALT_STDIN_BASE 0x2040 -#define ALT_STDIN_DEV jtag_uart -#define ALT_STDIN_IS_JTAG_UART -#define ALT_STDIN_PRESENT -#define ALT_STDIN_TYPE "altera_avalon_jtag_uart" -#define ALT_STDOUT "/dev/jtag_uart" -#define ALT_STDOUT_BASE 0x2040 -#define ALT_STDOUT_DEV jtag_uart -#define ALT_STDOUT_IS_JTAG_UART -#define ALT_STDOUT_PRESENT -#define ALT_STDOUT_TYPE "altera_avalon_jtag_uart" -#define ALT_SYSTEM_NAME "nios_system" - - -/* - * hal configuration - * - */ - -#define ALT_MAX_FD 4 -#define ALT_SYS_CLK none -#define ALT_TIMESTAMP_CLK none - - -/* - * jtag_uart configuration - * - */ - -#define ALT_MODULE_CLASS_jtag_uart altera_avalon_jtag_uart -#define JTAG_UART_BASE 0x2040 -#define JTAG_UART_IRQ 5 -#define JTAG_UART_IRQ_INTERRUPT_CONTROLLER_ID 0 -#define JTAG_UART_NAME "/dev/jtag_uart" -#define JTAG_UART_READ_DEPTH 64 -#define JTAG_UART_READ_THRESHOLD 8 -#define JTAG_UART_SPAN 8 -#define JTAG_UART_TYPE "altera_avalon_jtag_uart" -#define JTAG_UART_WRITE_DEPTH 64 -#define JTAG_UART_WRITE_THRESHOLD 8 - - -/* - * onchip_memory configuration - * - */ - -#define ALT_MODULE_CLASS_onchip_memory altera_avalon_onchip_memory2 -#define ONCHIP_MEMORY_ALLOW_IN_SYSTEM_MEMORY_CONTENT_EDITOR 0 -#define ONCHIP_MEMORY_ALLOW_MRAM_SIM_CONTENTS_ONLY_FILE 0 -#define ONCHIP_MEMORY_BASE 0x0 -#define ONCHIP_MEMORY_CONTENTS_INFO "" -#define ONCHIP_MEMORY_DUAL_PORT 0 -#define ONCHIP_MEMORY_GUI_RAM_BLOCK_TYPE "AUTO" -#define ONCHIP_MEMORY_INIT_CONTENTS_FILE "nios_system_onchip_memory" -#define ONCHIP_MEMORY_INIT_MEM_CONTENT 1 -#define ONCHIP_MEMORY_INSTANCE_ID "NONE" -#define ONCHIP_MEMORY_IRQ -1 -#define ONCHIP_MEMORY_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define ONCHIP_MEMORY_NAME "/dev/onchip_memory" -#define ONCHIP_MEMORY_NON_DEFAULT_INIT_FILE_ENABLED 0 -#define ONCHIP_MEMORY_RAM_BLOCK_TYPE "AUTO" -#define ONCHIP_MEMORY_READ_DURING_WRITE_MODE "DONT_CARE" -#define ONCHIP_MEMORY_SINGLE_CLOCK_OP 0 -#define ONCHIP_MEMORY_SIZE_MULTIPLE 1 -#define ONCHIP_MEMORY_SIZE_VALUE 4096 -#define ONCHIP_MEMORY_SPAN 4096 -#define ONCHIP_MEMORY_TYPE "altera_avalon_onchip_memory2" -#define ONCHIP_MEMORY_WRITABLE 1 - - -/* - * push_switches configuration - * - */ - -#define ALT_MODULE_CLASS_push_switches altera_avalon_pio -#define PUSH_SWITCHES_BASE 0x2000 -#define PUSH_SWITCHES_BIT_CLEARING_EDGE_REGISTER 0 -#define PUSH_SWITCHES_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define PUSH_SWITCHES_CAPTURE 0 -#define PUSH_SWITCHES_DATA_WIDTH 3 -#define PUSH_SWITCHES_DO_TEST_BENCH_WIRING 0 -#define PUSH_SWITCHES_DRIVEN_SIM_VALUE 0 -#define PUSH_SWITCHES_EDGE_TYPE "NONE" -#define PUSH_SWITCHES_FREQ 50000000 -#define PUSH_SWITCHES_HAS_IN 1 -#define PUSH_SWITCHES_HAS_OUT 0 -#define PUSH_SWITCHES_HAS_TRI 0 -#define PUSH_SWITCHES_IRQ -1 -#define PUSH_SWITCHES_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define PUSH_SWITCHES_IRQ_TYPE "NONE" -#define PUSH_SWITCHES_NAME "/dev/push_switches" -#define PUSH_SWITCHES_RESET_VALUE 0 -#define PUSH_SWITCHES_SPAN 16 -#define PUSH_SWITCHES_TYPE "altera_avalon_pio" - - -/* - * switches configuration - * - */ - -#define ALT_MODULE_CLASS_switches altera_avalon_pio -#define SWITCHES_BASE 0x2010 -#define SWITCHES_BIT_CLEARING_EDGE_REGISTER 0 -#define SWITCHES_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define SWITCHES_CAPTURE 0 -#define SWITCHES_DATA_WIDTH 18 -#define SWITCHES_DO_TEST_BENCH_WIRING 0 -#define SWITCHES_DRIVEN_SIM_VALUE 0 -#define SWITCHES_EDGE_TYPE "NONE" -#define SWITCHES_FREQ 50000000 -#define SWITCHES_HAS_IN 1 -#define SWITCHES_HAS_OUT 0 -#define SWITCHES_HAS_TRI 0 -#define SWITCHES_IRQ -1 -#define SWITCHES_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define SWITCHES_IRQ_TYPE "NONE" -#define SWITCHES_NAME "/dev/switches" -#define SWITCHES_RESET_VALUE 0 -#define SWITCHES_SPAN 16 -#define SWITCHES_TYPE "altera_avalon_pio" - -#endif /* __SYSTEM_H_ */ diff --git a/software/qsys_tutorial_lcd/.cproject b/software/qsys_tutorial_lcd/.cproject deleted file mode 100644 index 1061b2a..0000000 --- a/software/qsys_tutorial_lcd/.cproject +++ /dev/null @@ -1,508 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - make - - mem_init_install - true - false - false - - - make - - mem_init_generate - true - false - false - - - make - - help - true - false - false - - - - diff --git a/software/qsys_tutorial_lcd/.project b/software/qsys_tutorial_lcd/.project deleted file mode 100644 index 3c212ad..0000000 --- a/software/qsys_tutorial_lcd/.project +++ /dev/null @@ -1,96 +0,0 @@ - - - qsys_tutorial_lcd - - - - - - com.altera.sbtgui.project.makefileBuilder - - - - - com.altera.sbtgui.project.makefileBuilder - - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - ?name? - - - - org.eclipse.cdt.make.core.append_environment - true - - - org.eclipse.cdt.make.core.autoBuildTarget - all - - - org.eclipse.cdt.make.core.buildArguments - - - - org.eclipse.cdt.make.core.buildCommand - make - - - org.eclipse.cdt.make.core.buildLocation - ${workspace_loc://qsys_tutorial_lcd} - - - org.eclipse.cdt.make.core.cleanBuildTarget - clean - - - org.eclipse.cdt.make.core.contents - org.eclipse.cdt.make.core.activeConfigSettings - - - org.eclipse.cdt.make.core.enableAutoBuild - false - - - org.eclipse.cdt.make.core.enableCleanBuild - true - - - org.eclipse.cdt.make.core.enableFullBuild - true - - - org.eclipse.cdt.make.core.fullBuildTarget - all - - - org.eclipse.cdt.make.core.stopOnError - true - - - org.eclipse.cdt.make.core.useDefaultBuildCmd - true - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - org.eclipse.cdt.core.ccnature - com.altera.sbtgui.project.SBTGUINature - com.altera.sbtgui.project.SBTGUIAppNature - com.altera.sbtgui.project.SBTGUIManagedNature - - diff --git a/software/qsys_tutorial_lcd/LCD.c b/software/qsys_tutorial_lcd/LCD.c deleted file mode 100644 index 5804ed6..0000000 --- a/software/qsys_tutorial_lcd/LCD.c +++ /dev/null @@ -1,50 +0,0 @@ -#include -#include -#include -#include "system.h" -#include "LCD.h" -//------------------------------------------------------------------------- -void LCD_Init() -{ - lcd_write_cmd(LCD_16207_0_BASE,0x38); - usleep(2000); - lcd_write_cmd(LCD_16207_0_BASE,0x0C); - usleep(2000); - lcd_write_cmd(LCD_16207_0_BASE,0x01); - usleep(2000); - lcd_write_cmd(LCD_16207_0_BASE,0x06); - usleep(2000); - lcd_write_cmd(LCD_16207_0_BASE,0x80); - usleep(2000); -} -//------------------------------------------------------------------------- -void LCD_Show_Text(char* Text) -{ - int i; - for(i=0;i /c/dir). This will ensture -# paths are readable by GNU Make. -# -# If COMSPEC/ComSpec is not defined, Make is launched from linux, and no -# adjustment is necessary -# -#------------------------------------------------------------------------------ - -ifndef COMSPEC -ifdef ComSpec -COMSPEC = $(ComSpec) -endif # ComSpec -endif # COMSPEC - -ifdef COMSPEC # if Windows OS - -ifeq ($(MAKE_VERSION),3.81) -# -# adjust-path/adjust-path-mixed for Mingw Gnu Make on Windows -# -# Example Usage: -# $(call adjust-path,c:/aaa/bbb) => /c/aaa/bbb -# $(call adjust-path-mixed,/c/aaa/bbb) => c:/aaa/bbb -# $(call adjust-path-mixed,/cygdrive/c/aaa/bbb) => c:/aaa/bbb -# - -# -# adjust-path -# - converts back slash characters into forward slashes -# - if input arg ($1) is an empty string then return the empty string -# - if input arg ($1) does not contain the string ":/", then return input arg -# - using sed, convert mixed path [c:/...] into mingw path [/c/...] -define adjust-path -$(strip \ -$(if $1,\ -$(if $(findstring :/,$(subst \,/,$1)),\ -$(shell echo $(subst \,/,$1) | sed -e 's,^\([a-zA-Z]\):/,/\1/,'),\ -$(subst \,/,$1)))) -endef - -# -# adjust-path-mixed -# - converts back slash characters into forward slashes -# - if input arg ($1) is an empty string then return the empty string -# - if input arg ($1) does not begin with a forward slash '/' char, then -# return input arg -# - using sed, convert mingw path [/c/...] or cygwin path [/c/cygdrive/...] -# into a mixed path [c:/...] -define adjust-path-mixed -$(strip \ -$(if $1,\ -$(if $(findstring $(subst \,/,$1),$(patsubst /%,%,$(subst \,/,$1))),\ -$(subst \,/,$1),\ -$(shell echo $(subst \,/,$1) | sed -e 's,^/cygdrive/\([a-zA-Z]\)/,\1:/,' -e 's,^/\([a-zA-Z]\)/,\1:/,')))) -endef - -else # MAKE_VERSION != 3.81 (MAKE_VERSION == 3.80 or MAKE_VERSION == 3.79) -# -# adjust-path for Cygwin Gnu Make -# $(call adjust-path,c:/aaa/bbb) = /cygdrive/c/aaa/bbb -# $(call adjust-path-mixed,/cygdrive/c/aaa/bbb) = c:/aaa/bbb -# -adjust-path = $(if $1,$(shell cygpath -u "$1"),) -adjust-path-mixed = $(if $1,$(shell cygpath -m "$1"),) -endif - -else # !COMSPEC - -adjust-path = $1 -adjust-path-mixed = $1 - -endif # COMSPEC - - -#vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv -# GENERATED SETTINGS START v -#vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv - -#START GENERATED -ACTIVE_BUILD_CONFIG := default -BUILD_CONFIGS := default - -# The following TYPE comment allows tools to identify the 'type' of target this -# makefile is associated with. -# TYPE: APP_MAKEFILE - -# This following VERSION comment indicates the version of the tool used to -# generate this makefile. A makefile variable is provided for VERSION as well. -# ACDS_VERSION: 13.0sp1 -ACDS_VERSION := 13.0sp1 - -# This following BUILD_NUMBER comment indicates the build number of the tool -# used to generate this makefile. -# BUILD_NUMBER: 232 - -# Define path to the application ELF. -# It may be used by the makefile fragments so is defined before including them. -# -ELF := qsys_tutorial_lcd.elf - -# Paths to C, C++, and assembly source files. -C_SRCS += hello_world_small.c -C_SRCS += hex_encoder.c -C_SRCS += hex_out.c -C_SRCS += input_int.c -C_SRCS += inst_decoder.c -C_SRCS += sys_memory.c -C_SRCS += sys_register.c -C_SRCS += system.c -C_SRCS += LCD.c -CXX_SRCS := -ASM_SRCS := - - -# Path to root of object file tree. -OBJ_ROOT_DIR := obj - -# Options to control objdump. -CREATE_OBJDUMP := 1 -OBJDUMP_INCLUDE_SOURCE := 1 -OBJDUMP_FULL_CONTENTS := 0 - -# Options to enable/disable optional files. -CREATE_ELF_DERIVED_FILES := 0 -CREATE_LINKER_MAP := 1 - -# Common arguments for ALT_CFLAGSs -APP_CFLAGS_DEFINED_SYMBOLS := -APP_CFLAGS_UNDEFINED_SYMBOLS := -APP_CFLAGS_OPTIMIZATION := -Os -APP_CFLAGS_DEBUG_LEVEL := -g -APP_CFLAGS_WARNINGS := -Wall -APP_CFLAGS_USER_FLAGS := - -APP_ASFLAGS_USER := -APP_LDFLAGS_USER := - -# Linker options that have default values assigned later if not -# assigned here. -LINKER_SCRIPT := -CRT0 := -SYS_LIB := - -# Define path to the root of the BSP. -BSP_ROOT_DIR := ../qsys_tutorial_lcd_bsp/ - -# List of application specific include directories, library directories and library names -APP_INCLUDE_DIRS := -APP_LIBRARY_DIRS := -APP_LIBRARY_NAMES := - -# Pre- and post- processor settings. -BUILD_PRE_PROCESS := -BUILD_POST_PROCESS := - -QUARTUS_PROJECT_DIR := ../../ - - -#END GENERATED - -#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -# GENERATED SETTINGS END ^ -#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - -#------------------------------------------------------------------------------ -# DEFAULT TARGET -#------------------------------------------------------------------------------ - -# Define the variable used to echo output if not already defined. -ifeq ($(ECHO),) -ECHO := echo -endif - -# Put "all" rule before included makefile fragments because they may -# define rules and we don't want one of those to become the default rule. -.PHONY : all - -all: - @$(ECHO) [$(APP_NAME) build complete] - -all : build_pre_process libs app build_post_process - - -#------------------------------------------------------------------------------ -# VARIABLES DEPENDENT ON GENERATED CONTENT -#------------------------------------------------------------------------------ - -# Define object file directory per build configuration -CONFIG_OBJ_DIR := $(OBJ_ROOT_DIR)/$(ACTIVE_BUILD_CONFIG) - -ifeq ($(BSP_ROOT_DIR),) -$(error Edit Makefile and provide a value for BSP_ROOT_DIR) -endif - -ifeq ($(wildcard $(BSP_ROOT_DIR)),) -$(error BSP directory does not exist: $(BSP_ROOT_DIR)) -endif - -# Define absolute path to the root of the BSP. -ABS_BSP_ROOT_DIR := $(call adjust-path-mixed,$(shell cd "$(BSP_ROOT_DIR)"; pwd)) - -# Include makefile fragments. Define variable ALT_LIBRARY_ROOT_DIR before -# including each makefile fragment so that it knows the path to itself. -BSP_INCLUDE_FILE := $(BSP_ROOT_DIR)/public.mk -ALT_LIBRARY_ROOT_DIR := $(BSP_ROOT_DIR) -include $(BSP_INCLUDE_FILE) -# C2H will need this to touch the BSP public.mk and avoid the sopc file -# out-of-date error during a BSP make -ABS_BSP_INCLUDE_FILE := $(ABS_BSP_ROOT_DIR)/public.mk - - -ifneq ($(WARNING.SMALL_STACK_SIZE),) -# This WARNING is here to protect you from unknowingly using a very small stack -# If the warning is set, increase your stack size or enable the BSP small stack -# setting to eliminate the warning -$(warning WARNING: $(WARNING.SMALL_STACK_SIZE)) -endif - - -# If the BSP public.mk indicates that ALT_SIM_OPTIMIZE is set, rename the ELF -# by prefixing it with RUN_ON_HDL_SIMULATOR_ONLY_. -ifneq ($(filter -DALT_SIM_OPTIMIZE,$(ALT_CPPFLAGS)),) -ELF := RUN_ON_HDL_SIMULATOR_ONLY_$(ELF) -endif - -# If the BSP public.mk indicates that ALT_PROVIDE_GMON is set, add option to -# download_elf target -ifneq ($(filter -DALT_PROVIDE_GMON,$(ALT_CPPFLAGS)),) -GMON_OUT_FILENAME := gmon.out -WRITE_GMON_OPTION := --write-gmon $(GMON_OUT_FILENAME) -endif - -# Name of ELF application. -APP_NAME := $(basename $(ELF)) - -# Set to defaults if variables not already defined in settings. -ifeq ($(LINKER_SCRIPT),) -LINKER_SCRIPT := $(BSP_LINKER_SCRIPT) -endif -ifeq ($(CRT0),) -CRT0 := $(BSP_CRT0) -endif -ifeq ($(SYS_LIB),) -SYS_LIB := $(BSP_SYS_LIB) -endif - -OBJDUMP_NAME := $(APP_NAME).objdump -OBJDUMP_FLAGS := --disassemble --syms --all-header -ifeq ($(OBJDUMP_INCLUDE_SOURCE),1) -OBJDUMP_FLAGS += --source -endif -ifeq ($(OBJDUMP_FULL_CONTENTS),1) -OBJDUMP_FLAGS += --full-contents -endif - -# Create list of linker dependencies (*.a files). -APP_LDDEPS := $(ALT_LDDEPS) $(LDDEPS) - -# Take lists and add required prefixes. -APP_INC_DIRS := $(addprefix -I, $(ALT_INCLUDE_DIRS) $(APP_INCLUDE_DIRS) $(INC_DIRS)) -ASM_INC_PREFIX := -Wa,-I -APP_ASM_INC_DIRS := $(addprefix $(ASM_INC_PREFIX), $(ALT_INCLUDE_DIRS) $(APP_INCLUDE_DIRS) $(INC_DIRS)) -APP_LIB_DIRS := $(addprefix -L, $(ALT_LIBRARY_DIRS) $(APP_LIBRARY_DIRS) $(LIB_DIRS)) -APP_LIBS := $(addprefix -l, $(ALT_LIBRARY_NAMES) $(APP_LIBRARY_NAMES) $(LIBS)) - -ifneq ($(AVOID_NIOS2_GCC3_OPTIONS),) - -# -# Avoid Nios II GCC 3.X options. -# - -# Detect if small newlib C library is requested. -# If yes, remove the -msmallc option because it is -# now handled by other means. -ifneq ($(filter -msmallc,$(ALT_LDFLAGS)),) - ALT_LDFLAGS := $(filter-out -msmallc,$(ALT_LDFLAGS)) - ALT_C_LIBRARY := smallc -else - ALT_C_LIBRARY := c -endif - -# Put each BSP dependent library in a group to avoid circular dependencies. -APP_BSP_DEP_LIBS := $(foreach l,$(ALT_BSP_DEP_LIBRARY_NAMES),-Wl,--start-group -l$(ALT_C_LIBRARY) -lgcc -l$(l) -Wl,--end-group) - -else # !AVOID_NIOS2_GCC3_OPTIONS - -# -# Use Nios II GCC 3.X options. -# -APP_BSP_DEP_LIBS := $(addprefix -msys-lib=, $(ALT_BSP_DEP_LIBRARY_NAMES)) - -endif # !AVOID_NIOS2_GCC3_OPTIONS - -# Arguments for the C preprocessor, C/C++ compiler, assembler, and linker. -APP_CFLAGS := $(APP_CFLAGS_DEFINED_SYMBOLS) \ - $(APP_CFLAGS_UNDEFINED_SYMBOLS) \ - $(APP_CFLAGS_OPTIMIZATION) \ - $(APP_CFLAGS_DEBUG_LEVEL) \ - $(APP_CFLAGS_WARNINGS) \ - $(APP_CFLAGS_USER_FLAGS) \ - $(ALT_CFLAGS) \ - $(CFLAGS) - -# Arguments only for the C++ compiler. -APP_CXXFLAGS := $(ALT_CXXFLAGS) $(CXXFLAGS) - -# Arguments only for the C preprocessor. -# Prefix each include directory with -I. -APP_CPPFLAGS := $(APP_INC_DIRS) \ - $(ALT_CPPFLAGS) \ - $(CPPFLAGS) - -# Arguments only for the assembler. -APP_ASFLAGS := $(APP_ASM_INC_DIRS) \ - $(ALT_ASFLAGS) \ - $(APP_ASFLAGS_USER) \ - $(ASFLAGS) - -# Arguments only for the linker. -APP_LDFLAGS := $(APP_LDFLAGS_USER) - -ifneq ($(LINKER_SCRIPT),) -APP_LDFLAGS += -T'$(LINKER_SCRIPT)' -endif - -ifneq ($(AVOID_NIOS2_GCC3_OPTIONS),) - -# Avoid Nios II GCC 3.x options. -ifneq ($(CRT0),) -APP_LDFLAGS += $(CRT0) -endif - -# The equivalent of the -msys-lib option is provided -# by the GROUP() command in the linker script. -# Note this means the SYS_LIB variable is now ignored. - -else # !AVOID_NIOS2_GCC3_OPTIONS - -# Use Nios II GCC 3.x options. -ifneq ($(CRT0),) -APP_LDFLAGS += -msys-crt0='$(CRT0)' -endif -ifneq ($(SYS_LIB),) -APP_LDFLAGS += -msys-lib=$(SYS_LIB) -endif - -endif # !AVOID_NIOS2_GCC3_OPTIONS - -APP_LDFLAGS += \ - $(APP_LIB_DIRS) \ - $(ALT_LDFLAGS) \ - $(LDFLAGS) - -LINKER_MAP_NAME := $(APP_NAME).map -ifeq ($(CREATE_LINKER_MAP), 1) -APP_LDFLAGS += -Wl,-Map=$(LINKER_MAP_NAME) -endif - -# QUARTUS_PROJECT_DIR and SOPC_NAME need to be defined if you want the -# mem_init_install target of the mem_init.mk (located in the associated BSP) -# to know how to copy memory initialization files (e.g. .dat, .hex) into -# directories required for Quartus compilation or RTL simulation. - -# Defining QUARTUS_PROJECT_DIR causes mem_init_install to copy memory -# initialization files into your Quartus project directory. This is required -# to provide the initial memory contents of FPGA memories that can be -# initialized by the programming file (.sof) or Hardcopy ROMs. It is also used -# for VHDL simulation of on-chip memories. - -# Defining SOPC_NAME causes the mem_init_install target to copy memory -# initialization files into your RTL simulation directory. This is required -# to provide the initial memory contents of all memories that can be -# initialized by RTL simulation. This variable should be set to the same name -# as your SOPC Builder system name. For example, if you have a system called -# "foo.sopc", this variable should be set to "foo". - -# If SOPC_NAME is not set and QUARTUS_PROJECT_DIR is set, then derive SOPC_NAME. -ifeq ($(SOPC_NAME),) -ifneq ($(QUARTUS_PROJECT_DIR),) -SOPC_NAME := $(basename $(notdir $(wildcard $(QUARTUS_PROJECT_DIR)/*.sopcinfo))) -endif -endif - -# Defining JDI_FILE is required to specify the JTAG Debug Information File -# path. This file is generated by Quartus, and is needed along with the -# .sopcinfo file to resolve processor instance ID's from names in a multi-CPU -# systems. For multi-CPU systems, the processor instance ID is used to select -# from multiple CPU's during ELF download. - -# Both JDI_FILE and SOPCINFO_FILE are provided by the BSP if they found during -# BSP creation. If JDI_FILE is not set and QUARTUS_PROJECT_DIR is set, then -# derive JDI_FILE. We do not attempt to derive SOPCINFO_FILE since there may be -# multiple .sopcinfo files in a Quartus project. -ifeq ($(JDI_FILE),) -ifneq ($(QUARTUS_PROJECT_DIR),) -JDI_FILE := $(wildcard $(QUARTUS_PROJECT_DIR)/*.jdi) -endif -endif - -# Path to root runtime directory used for hdl simulation -RUNTIME_ROOT_DIR := $(CONFIG_OBJ_DIR)/runtime - - - -#------------------------------------------------------------------------------ -# MAKEFILE INCLUDES DEPENDENT ON GENERATED CONTENT -#------------------------------------------------------------------------------ -# mem_init.mk is a generated makefile fragment. This file defines all targets -# used to generate HDL initialization simulation files and pre-initialized -# onchip memory files. -MEM_INIT_FILE := $(BSP_ROOT_DIR)/mem_init.mk -include $(MEM_INIT_FILE) - -# Create list of object files to be built using the list of source files. -# The source file hierarchy is preserved in the object tree. -# The supported file extensions are: -# -# .c - for C files -# .cxx .cc .cpp - for C++ files -# .S .s - for assembler files -# -# Handle source files specified by --src-dir & --src-rdir differently, to -# save some processing time in calling the adjust-path macro. - -OBJ_LIST_C := $(patsubst %.c,%.o,$(filter %.c,$(C_SRCS))) -OBJ_LIST_CPP := $(patsubst %.cpp,%.o,$(filter %.cpp,$(CXX_SRCS))) -OBJ_LIST_CXX := $(patsubst %.cxx,%.o,$(filter %.cxx,$(CXX_SRCS))) -OBJ_LIST_CC := $(patsubst %.cc,%.o,$(filter %.cc,$(CXX_SRCS))) -OBJ_LIST_S := $(patsubst %.S,%.o,$(filter %.S,$(ASM_SRCS))) -OBJ_LIST_SS := $(patsubst %.s,%.o,$(filter %.s,$(ASM_SRCS))) - -OBJ_LIST := $(sort $(OBJ_LIST_C) $(OBJ_LIST_CPP) $(OBJ_LIST_CXX) \ - $(OBJ_LIST_CC) $(OBJ_LIST_S) $(OBJ_LIST_SS)) - -SDIR_OBJ_LIST_C := $(patsubst %.c,%.o,$(filter %.c,$(SDIR_C_SRCS))) -SDIR_OBJ_LIST_CPP := $(patsubst %.cpp,%.o,$(filter %.cpp,$(SDIR_CXX_SRCS))) -SDIR_OBJ_LIST_CXX := $(patsubst %.cxx,%.o,$(filter %.cxx,$(SDIR_CXX_SRCS))) -SDIR_OBJ_LIST_CC := $(patsubst %.cc,%.o,$(filter %.cc,$(SDIR_CXX_SRCS))) -SDIR_OBJ_LIST_S := $(patsubst %.S,%.o,$(filter %.S,$(SDIR_ASM_SRCS))) -SDIR_OBJ_LIST_SS := $(patsubst %.s,%.o,$(filter %.s,$(SDIR_ASM_SRCS))) - -SDIR_OBJ_LIST := $(sort $(SDIR_OBJ_LIST_C) $(SDIR_OBJ_LIST_CPP) \ - $(SDIR_OBJ_LIST_CXX) $(SDIR_OBJ_LIST_CC) $(SDIR_OBJ_LIST_S) \ - $(SDIR_OBJ_LIST_SS)) - -# Relative-pathed objects that being with "../" are handled differently. -# -# Regular objects are created as -# $(CONFIG_OBJ_DIR)//.o -# where the path structure is maintained under the obj directory. This -# applies for both absolute and relative paths; in the absolute path -# case this means the entire source path will be recreated under the obj -# directory. This is done to allow two source files with the same name -# to be included as part of the project. -# -# Note: On Cygwin, the path recreated under the obj directory will be -# the cygpath -u output path. -# -# Relative-path objects that begin with "../" cause problems under this -# scheme, as $(CONFIG_OBJ_DIR)/..// can potentially put the object -# files anywhere in the system, creating clutter and polluting the source tree. -# As such, their paths are flattened - the object file created will be -# $(CONFIG_OBJ_DIR)/.o. Due to this, two files specified with -# "../" in the beginning cannot have the same name in the project. VPATH -# will be set for these sources to allow make to relocate the source file -# via %.o rules. -# -# The following lines separate the object list into the flatten and regular -# lists, and then handles them as appropriate. - -FLATTEN_OBJ_LIST := $(filter ../%,$(OBJ_LIST)) -FLATTEN_APP_OBJS := $(addprefix $(CONFIG_OBJ_DIR)/,$(notdir $(FLATTEN_OBJ_LIST))) - -REGULAR_OBJ_LIST := $(filter-out $(FLATTEN_OBJ_LIST),$(OBJ_LIST)) -REGULAR_OBJ_LIST_C := $(filter $(OBJ_LIST_C),$(REGULAR_OBJ_LIST)) -REGULAR_OBJ_LIST_CPP := $(filter $(OBJ_LIST_CPP),$(REGULAR_OBJ_LIST)) -REGULAR_OBJ_LIST_CXX := $(filter $(OBJ_LIST_CXX),$(REGULAR_OBJ_LIST)) -REGULAR_OBJ_LIST_CC := $(filter $(OBJ_LIST_CC),$(REGULAR_OBJ_LIST)) -REGULAR_OBJ_LIST_S := $(filter $(OBJ_LIST_S),$(REGULAR_OBJ_LIST)) -REGULAR_OBJ_LIST_SS := $(filter $(OBJ_LIST_SS),$(REGULAR_OBJ_LIST)) - -FLATTEN_SDIR_OBJ_LIST := $(filter ../%,$(SDIR_OBJ_LIST)) -FLATTEN_SDIR_APP_OBJS := $(addprefix $(CONFIG_OBJ_DIR)/,$(notdir $(FLATTEN_SDIR_OBJ_LIST))) - -REGULAR_SDIR_OBJ_LIST := $(filter-out $(FLATTEN_SDIR_OBJ_LIST),$(SDIR_OBJ_LIST)) -REGULAR_SDIR_OBJ_LIST_C := $(filter $(SDIR_OBJ_LIST_C),$(REGULAR_SDIR_OBJ_LIST)) -REGULAR_SDIR_OBJ_LIST_CPP := $(filter $(SDIR_OBJ_LIST_CPP),$(REGULAR_SDIR_OBJ_LIST)) -REGULAR_SDIR_OBJ_LIST_CXX := $(filter $(SDIR_OBJ_LIST_CXX),$(REGULAR_SDIR_OBJ_LIST)) -REGULAR_SDIR_OBJ_LIST_CC := $(filter $(SDIR_OBJ_LIST_CC),$(REGULAR_SDIR_OBJ_LIST)) -REGULAR_SDIR_OBJ_LIST_S := $(filter $(SDIR_OBJ_LIST_S),$(REGULAR_SDIR_OBJ_LIST)) -REGULAR_SDIR_OBJ_LIST_SS := $(filter $(SDIR_OBJ_LIST_SS),$(REGULAR_SDIR_OBJ_LIST)) - -VPATH := $(sort $(dir $(FLATTEN_OBJ_LIST)) $(dir $(FLATTEN_SDIR_OBJ_LIST))) - -APP_OBJS_C := $(addprefix $(CONFIG_OBJ_DIR)/,\ - $(REGULAR_SDIR_OBJ_LIST_C) \ - $(foreach s,$(REGULAR_OBJ_LIST_C),$(call adjust-path,$s))) - -APP_OBJS_CPP := $(addprefix $(CONFIG_OBJ_DIR)/,\ - $(REGULAR_SDIR_OBJ_LIST_CPP) \ - $(foreach s,$(REGULAR_OBJ_LIST_CPP),$(call adjust-path,$s))) - -APP_OBJS_CXX := $(addprefix $(CONFIG_OBJ_DIR)/,\ - $(REGULAR_SDIR_OBJ_LIST_CXX) \ - $(foreach s,$(REGULAR_OBJ_LIST_CXX),$(call adjust-path,$s))) - -APP_OBJS_CC := $(addprefix $(CONFIG_OBJ_DIR)/,\ - $(REGULAR_SDIR_OBJ_LIST_CC) \ - $(foreach s,$(REGULAR_OBJ_LIST_CC),$(call adjust-path,$s))) - -APP_OBJS_S := $(addprefix $(CONFIG_OBJ_DIR)/,\ - $(REGULAR_SDIR_OBJ_LIST_S) \ - $(foreach s,$(REGULAR_OBJ_LIST_S),$(call adjust-path,$s))) - -APP_OBJS_SS := $(addprefix $(CONFIG_OBJ_DIR)/,\ - $(REGULAR_SDIR_OBJ_LIST_SS) \ - $(foreach s,$(REGULAR_OBJ_LIST_SS),$(call adjust-path,$s))) - -APP_OBJS := $(APP_OBJS_C) $(APP_OBJS_CPP) $(APP_OBJS_CXX) $(APP_OBJS_CC) \ - $(APP_OBJS_S) $(APP_OBJS_SS) \ - $(FLATTEN_APP_OBJS) $(FLATTEN_SDIR_APP_OBJS) - -# Add any extra user-provided object files. -APP_OBJS += $(OBJS) - -# Create list of dependancy files for each object file. -APP_DEPS := $(APP_OBJS:.o=.d) - -# Patch the Elf file with system specific information - -# Patch the Elf with the name of the sopc system -ifneq ($(SOPC_NAME),) -ELF_PATCH_FLAG += --sopc_system_name $(SOPC_NAME) -endif - -# Patch the Elf with the absolute path to the Quartus Project Directory -ifneq ($(QUARTUS_PROJECT_DIR),) -ABS_QUARTUS_PROJECT_DIR := $(call adjust-path-mixed,$(shell cd "$(QUARTUS_PROJECT_DIR)"; pwd)) -ELF_PATCH_FLAG += --quartus_project_dir "$(ABS_QUARTUS_PROJECT_DIR)" -endif - -# Patch the Elf and download args with the JDI_FILE if specified -ifneq ($(wildcard $(JDI_FILE)),) -ELF_PATCH_FLAG += --jdi $(JDI_FILE) -DOWNLOAD_JDI_FLAG := --jdi $(JDI_FILE) -endif - -# Patch the Elf with the SOPCINFO_FILE if specified -ifneq ($(wildcard $(SOPCINFO_FILE)),) -ELF_PATCH_FLAG += --sopcinfo $(SOPCINFO_FILE) -endif - -# Use the DOWNLOAD_CABLE variable to specify which JTAG cable to use. -# This is not needed if you only have one cable. -ifneq ($(DOWNLOAD_CABLE),) -DOWNLOAD_CABLE_FLAG := --cable '$(DOWNLOAD_CABLE)' -endif - - -#------------------------------------------------------------------------------ -# BUILD PRE/POST PROCESS -#------------------------------------------------------------------------------ -build_pre_process : - $(BUILD_PRE_PROCESS) - -build_post_process : - $(BUILD_POST_PROCESS) - -.PHONY: build_pre_process build_post_process - - -#------------------------------------------------------------------------------ -# TOOLS -#------------------------------------------------------------------------------ - -# -# Set tool default variables if not already defined. -# If these are defined, they would typically be defined in an -# included makefile fragment. -# -ifeq ($(DEFAULT_CROSS_COMPILE),) -DEFAULT_CROSS_COMPILE := nios2-elf- -endif - -ifeq ($(DEFAULT_STACK_REPORT),) -DEFAULT_STACKREPORT := nios2-stackreport -endif - -ifeq ($(DEFAULT_DOWNLOAD),) -DEFAULT_DOWNLOAD := nios2-download -endif - -ifeq ($(DEFAULT_FLASHPROG),) -DEFAULT_FLASHPROG := nios2-flash-programmer -endif - -ifeq ($(DEFAULT_ELFPATCH),) -DEFAULT_ELFPATCH := nios2-elf-insert -endif - -ifeq ($(DEFAULT_RM),) -DEFAULT_RM := rm -f -endif - -ifeq ($(DEFAULT_CP),) -DEFAULT_CP := cp -f -endif - -ifeq ($(DEFAULT_MKDIR),) -DEFAULT_MKDIR := mkdir -p -endif - -# -# Set tool variables to defaults if not already defined. -# If these are defined, they would typically be defined by a -# setting in the generated portion of this makefile. -# -ifeq ($(CROSS_COMPILE),) -CROSS_COMPILE := $(DEFAULT_CROSS_COMPILE) -endif - -ifeq ($(origin CC),default) -CC := $(CROSS_COMPILE)gcc -xc -endif - -ifeq ($(origin CXX),default) -CXX := $(CROSS_COMPILE)gcc -xc++ -endif - -ifeq ($(origin AS),default) -AS := $(CROSS_COMPILE)gcc -endif - -ifeq ($(origin AR),default) -AR := $(CROSS_COMPILE)ar -endif - -ifeq ($(origin LD),default) -LD := $(CROSS_COMPILE)g++ -endif - -ifeq ($(origin NM),default) -NM := $(CROSS_COMPILE)nm -endif - -ifeq ($(origin RM),default) -RM := $(DEFAULT_RM) -endif - -ifeq ($(origin CP),default) -CP := $(DEFAULT_CP) -endif - -ifeq ($(OBJDUMP),) -OBJDUMP := $(CROSS_COMPILE)objdump -endif - -ifeq ($(OBJCOPY),) -OBJCOPY := $(CROSS_COMPILE)objcopy -endif - -ifeq ($(STACKREPORT),) -ifeq ($(CROSS_COMPILE),nios2-elf-) -STACKREPORT := $(DEFAULT_STACKREPORT) -else -DISABLE_STACKREPORT := 1 -endif -endif - -ifeq ($(DOWNLOAD),) -DOWNLOAD := $(DEFAULT_DOWNLOAD) -endif - -ifeq ($(FLASHPROG),) -FLASHPROG := $(DEFAULT_FLASHPROG) -endif - -ifeq ($(ELFPATCH),) -ELFPATCH := $(DEFAULT_ELFPATCH) -endif - -ifeq ($(MKDIR),) -MKDIR := $(DEFAULT_MKDIR) -endif - -#------------------------------------------------------------------------------ -# PATTERN RULES TO BUILD OBJECTS -#------------------------------------------------------------------------------ - -define compile.c -@$(ECHO) Info: Compiling $< to $@ -@$(MKDIR) $(@D) -$(CC) -MP -MMD -c $(APP_CPPFLAGS) $(APP_CFLAGS) -o $@ $< -$(CC_POST_PROCESS) -endef - -define compile.cpp -@$(ECHO) Info: Compiling $< to $@ -@$(MKDIR) $(@D) -$(CXX) -MP -MMD -c $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< -$(CXX_POST_PROCESS) -endef - -# If assembling with the compiler, ensure "-Wa," is prepended to all APP_ASFLAGS -ifeq ($(AS),$(patsubst %as,%,$(AS))) -COMMA := , -APP_ASFLAGS := $(filter-out $(APP_CFLAGS),$(addprefix -Wa$(COMMA),$(patsubst -Wa$(COMMA)%,%,$(APP_ASFLAGS)))) -endif - -define compile.s -@$(ECHO) Info: Assembling $< to $@ -@$(MKDIR) $(@D) -$(AS) -MP -MMD -c $(APP_CPPFLAGS) $(APP_CFLAGS) $(APP_ASFLAGS) -o $@ $< -$(AS_POST_PROCESS) -endef - -ifeq ($(MAKE_VERSION),3.81) -.SECONDEXPANSION: - -$(APP_OBJS_C): $(CONFIG_OBJ_DIR)/%.o: $$(call adjust-path-mixed,%.c) - $(compile.c) - -$(APP_OBJS_CPP): $(CONFIG_OBJ_DIR)/%.o: $$(call adjust-path-mixed,%.cpp) - $(compile.cpp) - -$(APP_OBJS_CC): $(CONFIG_OBJ_DIR)/%.o: $$(call adjust-path-mixed,%.cc) - $(compile.cpp) - -$(APP_OBJS_CXX): $(CONFIG_OBJ_DIR)/%.o: $$(call adjust-path-mixed,%.cxx) - $(compile.cpp) - -$(APP_OBJS_S): $(CONFIG_OBJ_DIR)/%.o: $$(call adjust-path-mixed,%.S) - $(compile.s) - -$(APP_OBJS_SS): $(CONFIG_OBJ_DIR)/%.o: $$(call adjust-path-mixed,%.s) - $(compile.s) - -endif # MAKE_VERSION != 3.81 - -$(CONFIG_OBJ_DIR)/%.o: %.c - $(compile.c) - -$(CONFIG_OBJ_DIR)/%.o: %.cpp - $(compile.cpp) - -$(CONFIG_OBJ_DIR)/%.o: %.cc - $(compile.cpp) - -$(CONFIG_OBJ_DIR)/%.o: %.cxx - $(compile.cpp) - -$(CONFIG_OBJ_DIR)/%.o: %.S - $(compile.s) - -$(CONFIG_OBJ_DIR)/%.o: %.s - $(compile.s) - - -#------------------------------------------------------------------------------ -# PATTERN RULES TO INTERMEDIATE FILES -#------------------------------------------------------------------------------ - -$(CONFIG_OBJ_DIR)/%.s: %.c - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CC) -S $(APP_CPPFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.s: %.cpp - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CXX) -S $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.s: %.cc - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CXX) -S $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.s: %.cxx - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CXX) -S $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.i: %.c - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CC) -E $(APP_CPPFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.i: %.cpp - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CXX) -E $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.i: %.cc - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CXX) -E $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.i: %.cxx - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CXX) -E $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< - - -#------------------------------------------------------------------------------ -# TARGET RULES -#------------------------------------------------------------------------------ - -.PHONY : help -help : - @$(ECHO) "Summary of Makefile targets" - @$(ECHO) " Build targets:" - @$(ECHO) " all (default) - Application and all libraries (including BSP)" - @$(ECHO) " bsp - Just the BSP" - @$(ECHO) " libs - All libraries (including BSP)" - @$(ECHO) " flash - All flash files" - @$(ECHO) " mem_init_generate - All memory initialization files" -ifeq ($(QSYS),1) - @$(ECHO) " mem_init_install - This target is deprecated for QSys Systems" - @$(ECHO) " --> Use the mem_init_generate target and then" - @$(ECHO) " add the generated meminit.qip file to your" - @$(ECHO) " Quartus II Project." -else # if QSYS != 1 - @$(ECHO) " mem_init_install - Copy memory initialization files to Quartus II project" -endif # QSYS == 1 - @$(ECHO) - @$(ECHO) " Clean targets:" - @$(ECHO) " clean_all - Application and all libraries (including BSP)" - @$(ECHO) " clean - Just the application" - @$(ECHO) " clean_bsp - Just the BSP" - @$(ECHO) " clean_libs - All libraries (including BSP)" - @$(ECHO) - @$(ECHO) " Run targets:" - @$(ECHO) " download-elf - Download and run your elf executable" - @$(ECHO) " program-flash - Program flash contents to the board" - -# Handy rule to skip making libraries and just make application. -.PHONY : app -app : $(ELF) - -ifeq ($(CREATE_OBJDUMP), 1) -app : $(OBJDUMP_NAME) -endif - -ifeq ($(CREATE_ELF_DERIVED_FILES),1) -app : elf_derived_files -endif - -.PHONY: elf_derived_files -elf_derived_files: default_mem_init - -# Handy rule for making just the BSP. -.PHONY : bsp -bsp : - @$(ECHO) Info: Building $(BSP_ROOT_DIR) - @$(MAKE) --no-print-directory -C $(BSP_ROOT_DIR) - - -# Make sure all makeable libraries (including the BSP) are up-to-date. -LIB_TARGETS := $(patsubst %,%-recurs-make-lib,$(MAKEABLE_LIBRARY_ROOT_DIRS)) - -.PHONY : libs -libs : $(LIB_TARGETS) - -ifneq ($(strip $(LIB_TARGETS)),) -$(LIB_TARGETS): %-recurs-make-lib: - @$(ECHO) Info: Building $* - $(MAKE) --no-print-directory -C $* -endif - -ifneq ($(strip $(APP_LDDEPS)),) -$(APP_LDDEPS): libs - @true -endif - -# Rules to force your project to rebuild or relink -# .force_relink file will cause any application that depends on this project to relink -# .force_rebuild file will cause this project to rebuild object files -# .force_rebuild_all file will cause this project and any project that depends on this project to rebuild object files - -FORCE_RELINK_DEP := .force_relink -FORCE_REBUILD_DEP := .force_rebuild -FORCE_REBUILD_ALL_DEP := .force_rebuild_all -FORCE_REBUILD_DEP_LIST := $(CONFIG_OBJ_DIR)/$(FORCE_RELINK_DEP) $(CONFIG_OBJ_DIR)/$(FORCE_REBUILD_DEP) $(FORCE_REBUILD_ALL_DEP) - -$(FORCE_REBUILD_DEP_LIST): - -$(APP_OBJS): $(wildcard $(CONFIG_OBJ_DIR)/$(FORCE_REBUILD_DEP)) $(wildcard $(addsuffix /$(FORCE_REBUILD_ALL_DEP), . $(ALT_LIBRARY_DIRS))) - -$(ELF): $(wildcard $(addsuffix /$(FORCE_RELINK_DEP), $(CONFIG_OBJ_DIR) $(ALT_LIBRARY_DIRS))) - - -# Clean just the application. -.PHONY : clean -ifeq ($(CREATE_ELF_DERIVED_FILES),1) -clean : clean_elf_derived_files -endif - -clean : - @$(RM) -r $(ELF) $(OBJDUMP_NAME) $(LINKER_MAP_NAME) $(OBJ_ROOT_DIR) $(RUNTIME_ROOT_DIR) $(FORCE_REBUILD_DEP_LIST) - @$(ECHO) [$(APP_NAME) clean complete] - -# Clean just the BSP. -.PHONY : clean_bsp -clean_bsp : - @$(ECHO) Info: Cleaning $(BSP_ROOT_DIR) - @$(MAKE) --no-print-directory -C $(BSP_ROOT_DIR) clean - -# Clean all makeable libraries including the BSP. -LIB_CLEAN_TARGETS := $(patsubst %,%-recurs-make-clean-lib,$(MAKEABLE_LIBRARY_ROOT_DIRS)) - -.PHONY : clean_libs -clean_libs : $(LIB_CLEAN_TARGETS) - -ifneq ($(strip $(LIB_CLEAN_TARGETS)),) -$(LIB_CLEAN_TARGETS): %-recurs-make-clean-lib: - @$(ECHO) Info: Cleaning $* - $(MAKE) --no-print-directory -C $* clean -endif - -.PHONY: clean_elf_derived_files -clean_elf_derived_files: mem_init_clean - -# Clean application and all makeable libraries including the BSP. -.PHONY : clean_all -clean_all : clean mem_init_clean clean_libs - -# Include the dependency files unless the make goal is performing a clean -# of the application. -ifneq ($(firstword $(MAKECMDGOALS)),clean) -ifneq ($(firstword $(MAKECMDGOALS)),clean_all) --include $(APP_DEPS) -endif -endif - -.PHONY : download-elf -download-elf : $(ELF) - @if [ "$(DOWNLOAD)" = "none" ]; \ - then \ - $(ECHO) Downloading $(ELF) not supported; \ - else \ - $(ECHO) Info: Downloading $(ELF); \ - $(DOWNLOAD) --go --cpu_name=$(CPU_NAME) $(DOWNLOAD_CABLE_FLAG) $(SOPC_SYSID_FLAG) $(DOWNLOAD_JDI_FLAG) $(WRITE_GMON_OPTION) $(ELF); \ - fi - -# Delete the target of a rule if it has changed and its commands exit -# with a nonzero exit status. -.DELETE_ON_ERROR: - -# Rules for flash programming commands -PROGRAM_FLASH_SUFFIX := -program -PROGRAM_FLASH_TARGET := $(addsuffix $(PROGRAM_FLASH_SUFFIX), $(FLASH_FILES)) - -.PHONY : program-flash -program-flash : $(PROGRAM_FLASH_TARGET) - -.PHONY : $(PROGRAM_FLASH_TARGET) -$(PROGRAM_FLASH_TARGET) : flash - @if [ "$(FLASHPROG)" = "none" ]; \ - then \ - $(ECHO) Programming flash not supported; \ - else \ - $(ECHO) Info: Programming $(basename $@).flash; \ - if [ -z "$($(basename $@)_EPCS_FLAGS)" ]; \ - then \ - $(ECHO) $(FLASHPROG) $(SOPC_SYSID_FLAG) --base=$($(basename $@)_START) $(basename $@).flash; \ - $(FLASHPROG) $(DOWNLOAD_CABLE_FLAG) $(SOPC_SYSID_FLAG) --base=$($(basename $@)_START) $(basename $@).flash; \ - else \ - $(ECHO) $(FLASHPROG) $(SOPC_SYSID_FLAG) --epcs --base=$($(basename $@)_START) $(basename $@).flash; \ - $(FLASHPROG) $(DOWNLOAD_CABLE_FLAG) $(SOPC_SYSID_FLAG) --epcs --base=$($(basename $@)_START) $(basename $@).flash; \ - fi \ - fi - - -# Rules for simulating with an HDL Simulator [QSYS only] -ifeq ($(QSYS),1) -IP_MAKE_SIMSCRIPT := ip-make-simscript - -ifeq ($(VSIM),) -VSIM_EXE := "$(if $(VSIM_DIR),$(VSIM_DIR)/,)vsim" -ifeq ($(ENABLE_VSIM_GUI),1) -VSIM := $(VSIM_EXE) -gui -else -VSIM := $(VSIM_EXE) -c -endif # ENABLE_VSIM_GUI == 1 -endif # VSIM not set - -ifeq ($(SPD),) -ifneq ($(ABS_QUARTUS_PROJECT_DIR),) -ifneq ($(SOPC_NAME),) -SPD := $(ABS_QUARTUS_PROJECT_DIR)/$(SOPC_NAME)_tb.spd -endif # SOPC_NAME set -endif # ABS_QUARTUS_PROJECT_DIR set -endif # SPD == empty string - -ifeq ($(MSIM_SCRIPT),) -SIM_SCRIPT_DIR := $(RUNTIME_ROOT_DIR)/sim -MSIM_SCRIPT := $(SIM_SCRIPT_DIR)/mentor/msim_setup.tcl -endif # MSIM_SCRIPT == empty string - -ifeq ($(MAKE_VERSION),3.81) -ABS_MEM_INIT_DESCRIPTOR_FILE := $(abspath $(MEM_INIT_DESCRIPTOR_FILE)) -else -ABS_MEM_INIT_DESCRIPTOR_FILE := $(call adjust-path-mixed,$(shell pwd))/$(MEM_INIT_DESCRIPTOR_FILE) -endif - -$(MSIM_SCRIPT): $(SPD) $(MEM_INIT_DESCRIPTOR_FILE) -ifeq ($(SPD),) - $(error No SPD file specified. Ensure QUARTUS_PROJECT_DIR variable is set) -endif - @$(MKDIR) $(SIM_SCRIPT_DIR) - $(IP_MAKE_SIMSCRIPT) --spd=$(SPD) --spd=$(MEM_INIT_DESCRIPTOR_FILE) --output-directory=$(SIM_SCRIPT_DIR) - -VSIM_COMMAND = \ - cd $(dir $(MSIM_SCRIPT)) && \ - $(VSIM) -do "do $(notdir $(MSIM_SCRIPT)); ld; $(if $(VSIM_RUN_TIME),run ${VSIM_RUN_TIME};quit;)" - -.PHONY: sim -sim: $(MSIM_SCRIPT) mem_init_generate -ifeq ($(MSIM_SCRIPT),) - $(error MSIM_SCRIPT not set) -endif - $(VSIM_COMMAND) - -endif # QSYS == 1 - - -#------------------------------------------------------------------------------ -# ELF TARGET RULE -#------------------------------------------------------------------------------ -# Rule for constructing the executable elf file. -$(ELF) : $(APP_OBJS) $(LINKER_SCRIPT) $(APP_LDDEPS) - @$(ECHO) Info: Linking $@ - $(LD) $(APP_LDFLAGS) $(APP_CFLAGS) -o $@ $(filter-out $(CRT0),$(APP_OBJS)) $(APP_LIBS) $(APP_BSP_DEP_LIBS) -ifneq ($(DISABLE_ELFPATCH),1) - $(ELFPATCH) $@ $(ELF_PATCH_FLAG) -endif -ifneq ($(DISABLE_STACKREPORT),1) - @bash -c "$(STACKREPORT) $@" -endif - -$(OBJDUMP_NAME) : $(ELF) - @$(ECHO) Info: Creating $@ - $(OBJDUMP) $(OBJDUMP_FLAGS) $< >$@ - -# Rule for printing the name of the elf file -.PHONY: print-elf-name -print-elf-name: - @$(ECHO) $(ELF) - - diff --git a/software/qsys_tutorial_lcd/create-this-app b/software/qsys_tutorial_lcd/create-this-app deleted file mode 100644 index 9d21d54..0000000 --- a/software/qsys_tutorial_lcd/create-this-app +++ /dev/null @@ -1,114 +0,0 @@ -#!/bin/bash -# -# This script creates the hello_world_small application in this directory. - - -BSP_DIR=../qsys_tutorial_lcd_bsp -QUARTUS_PROJECT_DIR=../../ -NIOS2_APP_GEN_ARGS="--elf-name qsys_tutorial_lcd.elf --set APP_CFLAGS_OPTIMIZATION -Os --set OBJDUMP_INCLUDE_SOURCE 1 --src-files hello_world_small.c" - - -# First, check to see if $SOPC_KIT_NIOS2 environmental variable is set. -# This variable is required for the command line tools to execute correctly. -if [ -z "${SOPC_KIT_NIOS2}" ] -then - echo Required \$SOPC_KIT_NIOS2 Environmental Variable is not set! - exit 1 -fi - - -# Also make sure that the APP has not been created already. Check for -# existence of Makefile in the app directory -if [ -f ./Makefile ] -then - echo Application has already been created! Delete Makefile if you want to create a new application makefile - exit 1 -fi - - -# We are selecting hal_reduced_footprint bsp because it supports this application. -# Check to see if the hal_reduced_footprint has already been generated by checking for -# existence of the public.mk file. If not, we need to run -# create-this-bsp file to generate the bsp. -if [ ! -f ${BSP_DIR}/public.mk ]; then - # Since BSP doesn't exist, create the BSP - # Pass any command line arguments passed to this script to the BSP. - pushd ${BSP_DIR} >> /dev/null - ./create-this-bsp "$@" || { - echo "create-this-bsp failed" - exit 1 - } - popd >> /dev/null -fi - - -# Don't run make if create-this-app script is called with --no-make arg -SKIP_MAKE= -while [ $# -gt 0 ] -do - case "$1" in - --no-make) - SKIP_MAKE=1 - ;; - esac - shift -done - - -# Now we also need to go copy the sources for this application to the -# local directory. -find "${SOPC_KIT_NIOS2}/examples/software/hello_world_small/" -name '*.c' -or -name '*.h' -or -name 'hostfs*' | xargs -i cp -L {} ./ || { - echo "failed during copying example source files" - exit 1 -} - -find "${SOPC_KIT_NIOS2}/examples/software/hello_world_small/" -name 'readme.txt' -or -name 'Readme.txt' | xargs -i cp -L {} ./ || { - echo "failed copying readme file" -} - -if [ -d "${SOPC_KIT_NIOS2}/examples/software/hello_world_small/system" ] -then - cp -RL "${SOPC_KIT_NIOS2}/examples/software/hello_world_small/system" . || { - echo "failed during copying project support files" - exit 1 - } -fi - -chmod -R +w . || { - echo "failed during changing file permissions" - exit 1 -} - -cmd="nios2-app-generate-makefile --bsp-dir ${BSP_DIR} --set QUARTUS_PROJECT_DIR=${QUARTUS_PROJECT_DIR} ${NIOS2_APP_GEN_ARGS}" - -echo "create-this-app: Running \"${cmd}\"" -$cmd || { - echo "nios2-app-generate-makefile failed" - exit 1 -} - -if [ -z "$SKIP_MAKE" ]; then - cmd="make" - - echo "create-this-app: Running \"$cmd\"" - $cmd || { - echo "make failed" - exit 1 - } - - echo - echo "To download and run the application:" - echo " 1. Make sure the board is connected to the system." - echo " 2. Run 'nios2-configure-sof ' to configure the FPGA with the hardware design." - echo " 3. If you have a stdio device, run 'nios2-terminal' in a different shell." - echo " 4. Run 'make download-elf' from the application directory." - echo - echo "To debug the application:" - echo " Import the project into Nios II Software Build Tools for Eclipse." - echo " Refer to Nios II Software Build Tools for Eclipse Documentation for more information." - echo - echo -e "" -fi - - -exit 0 diff --git a/software/qsys_tutorial_lcd/hello_world_small.c b/software/qsys_tutorial_lcd/hello_world_small.c deleted file mode 100644 index 8c4b4b0..0000000 --- a/software/qsys_tutorial_lcd/hello_world_small.c +++ /dev/null @@ -1,136 +0,0 @@ -#include "sys/alt_stdio.h" -#include -#include "system.h" -#include "hex_out.h" -#include "sys_register.h" -#include "sys_memory.h" -#include "input_int.h" -#include "inst_decoder.h" - -#define LCD_16207_0_BASE LCD_0_BASE -#include "LCD.h" - - -#define ledrs (volatile int *) 0x00050a0 - -#define T_MS10 12500 //(10ms) - -void wait(unsigned int s) { - volatile i; - for (i = 0; i < T_MS10*s; i++); -} - -void init() { - LCD_Init(); - LCD_Test(); - registers_init(); - memory_init(); - clear_block(HEX0_3); clear_block(HEX4_5); clear_block(HEX6_7); - print_block("he", 2, HEX6_7); - print_block("lo", 2, HEX4_5); - print_block("you1", 4, HEX0_3); - wait(200); - clear_block(HEX0_3); clear_block(HEX4_5); clear_block(HEX6_7); -} - -char stack[5]; - -void store_value(){ - char buf[5]; - unsigned int memi = global_registers[Ssw_memi]; - memory_store(memi, Ssw_data); - sprintf(buf, "%02x", (unsigned char)memi); - print_block(buf, 2, HEX6_7); - print_block("--", 2, HEX4_5); - sprintf(buf, "%04d", global_registers[Ssw_data]); - print_block(buf, 4, HEX0_3); -} -void store_inst(){ - char inst; - char mem_index; - char reg_index; - struct InstRec inst_rec; - - // �K�v�ȏ��̎擾 - inst = global_registers[Ssw_inst]; - mem_index = global_registers[Ssw_memi]; - reg_index = global_registers[Ssw_regi]; - inst_rec.inst = (unsigned int)inst; - inst_rec.memi = (unsigned int)mem_index; - inst_rec.regi = (unsigned int)reg_index; - - // �X�g�A���� - inst_memory_store((unsigned int)global_registers[Spc], inst_rec); - global_registers[Spc]++; - - { - char buf[5]; - sprintf(buf, "%04d", inst_rec.inst); - print_block(buf, 4, HEX0_3); - sprintf(buf, "%02x", global_registers[Spc]); - print_block(buf, 2, HEX4_5); - } -} -void run_proc() { - volatile struct InstRec inst_rec; - - //print_block(" go ", 4, HEX0_3); - - global_registers[Spc] = 0; - print_block("pc", 2, HEX6_7); - do { - // pc�\�� - { - char buf[5]; - sprintf(buf, "%02x", global_registers[Spc]); - print_block(buf, 2, HEX4_5); - } - // ���߃t�F�b�` - inst_rec = inst_fetch(); - // ���߃f�R�[�h���s - inst_decode(inst_rec); - if ( global_registers[Ssw_run] ) wait(100); - }while( inst_rec.inst != INST_END ); - - //print_block(" end", 4, HEX0_3); -} - -void print_change_memory(unsigned int current_memory) { - char buf[5]; - sprintf(buf, "g %2d", current_memory); - print_block(buf, 4, HEX0_3); - print_block("an", 2, HEX4_5); - print_block("ch", 2, HEX6_7); - wait(200); - clear_block(HEX0_3); clear_block(HEX4_5); clear_block(HEX6_7); -} - -int main() -{ - init(); - while(1) { - // interrupt - in_int(); - - // event - if (PUSH_EVENT == PUSH_VALSTR) { - // �l�̃X�g�A - store_value(); - } - if (PUSH_EVENT == PUSH_INSSTR) { - // ���߂̃X�g�A - store_inst(); - } - if (PUSH_EVENT == PUSH_RUN) { - if (global_current_memory != (unsigned int)global_registers[Ssw_psel]) { - global_current_memory = (unsigned int)global_registers[Ssw_psel]; - print_change_memory(global_current_memory); - } - else { - // �v���O�������s - run_proc(); - } - } - } - return 0; -} diff --git a/software/qsys_tutorial_lcd/hex_encoder.c b/software/qsys_tutorial_lcd/hex_encoder.c deleted file mode 100644 index ab4eca0..0000000 --- a/software/qsys_tutorial_lcd/hex_encoder.c +++ /dev/null @@ -1,205 +0,0 @@ -/* - * hex_encoder.c - * - * Created on: 2016/11/17 - * Author: takayun - */ - -#include "hex_encoder.h" -#include - -void encodeNumHex(int hex_i, int num) { - char encoded = 0; - switch (num) { - case 0: - encoded = (char)0x40; // 100 0000 - break; - case 1: - encoded = (char)0xF9; // 111 1001 - break; - case 2: - encoded = (char)0x24; // 010 0100 - break; - case 3: - encoded = (char)0x30; // 011 0000 - break; - case 4: - encoded = (char)0x19; // 001 1001 - break; - case 5: - encoded = (char)0x12; // 001 0010 - break; - case 6: - encoded = (char)0x02; // 000 0010 - break; - case 7: - encoded = (char)0x58; // 101 1000 - break; - case 8: - encoded = (char)0x00; // 000 0000 - break; - case 9: - encoded = (char)0x10; // 001 0000 - break; - default: - encoded = 0; - break; - } - - switch (hex_i) { - case 0: - *hex0 = encoded; - break; - case 1: - *hex1 = encoded; - break; - case 2: - *hex2 = encoded; - break; - case 3: - *hex3 = encoded; - break; - case 4: - *hex4 = encoded; - break; - case 5: - *hex5 = encoded; - break; - case 6: - *hex6 = encoded; - break; - case 7: - *hex7 = encoded; - break; - default: - break; - } -} - -void encodeLatHex(int hex_i, char c) { - char encoded = 0; - - if (isdigit(c)) { - encodeNumHex(hex_i, c-'0'); - return; - } - - switch (c) { - case ' ': - encoded = (char)0xFF; // 111 1111 - break; - case '-': - encoded = (char)0x3F; // 011 1111 - break; - case 'a': - encoded = (char)0x08; // 000 1000 - break; - case 'b': - encoded = (char)0x03; // 000 0011 - break; - case 'c': - encoded = (char)0x27; // 010 0111 - break; - case 'd': - encoded = (char)0x21; // 010 0001 - break; - case 'e': - encoded = (char)0x06; // 000 0110 - break; - case 'f': - encoded = (char)0x0E; // 000 1110 - break; - case 'g': - encoded = (char)0x42; // 100 0010 - break; - case 'h': - encoded = (char)0x0B; // 000 1011 - break; - case 'i': - encoded = (char)0xFB; // 111 1011 - break; - case 'j': - encoded = (char)0x61; // 110 0001 - break; - case 'k': - encoded = (char)0x0A; // 000 1010 - break; - case 'l': - encoded = (char)0x47; // 100 0111 - break; - case 'm': - encoded = (char)0x48; // 100 1000 - break; - case 'n': - encoded = (char)0x2B; // 010 1011 - break; - case 'o': - encoded = (char)0x23; // 010 0011 - break; - case 'p': - encoded = (char)0x0C; // 000 1100 - break; - case 'q': - encoded = (char)0x04; // 000 0100 - break; - case 'r': - encoded = (char)0x2F; // 010 1111 - break; - case 's': - encoded = (char)0x13; // 001 0011 - break; - case 't': - encoded = (char)0x07; // 000 0111 - break; - case 'u': - encoded = (char)0x63; // 110 0011 - break; - case 'v': - encoded = (char)0x41; // 100 0001 - break; - case 'w': - encoded = (char)0x01; // 000 0001 - break; - case 'x': - encoded = (char)0x09; // 000 1001 - break; - case 'y': - encoded = (char)0x11; // 001 0001 - break; - case 'z': - encoded = (char)0x64; // 110 0100 - break; - default: - encoded = 0; - break; - } - - switch (hex_i) { - case 0: - *hex0 = encoded; - break; - case 1: - *hex1 = encoded; - break; - case 2: - *hex2 = encoded; - break; - case 3: - *hex3 = encoded; - break; - case 4: - *hex4 = encoded; - break; - case 5: - *hex5 = encoded; - break; - case 6: - *hex6 = encoded; - break; - case 7: - *hex7 = encoded; - break; - default: - break; - } -} diff --git a/software/qsys_tutorial_lcd/hex_encoder.h b/software/qsys_tutorial_lcd/hex_encoder.h deleted file mode 100644 index d04473e..0000000 --- a/software/qsys_tutorial_lcd/hex_encoder.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * hex_encoder.h - * - * Created on: 2016/11/17 - * Author: takayun - */ - -#ifndef HEX_ENCODER_H_ -#define HEX_ENCODER_H_ - -/************************************************** - * Defines - **************************************************/ - -#define hex0 (volatile char *) 0x0005070 -#define hex1 (volatile char *) 0x0005060 -#define hex2 (volatile char *) 0x0005050 -#define hex3 (volatile char *) 0x0005040 -#define hex4 (volatile char *) 0x0005030 -#define hex5 (volatile char *) 0x0005020 -#define hex6 (volatile char *) 0x0005010 -#define hex7 (volatile char *) 0x0005000 - -/************************************************** - * Variables - **************************************************/ - - -/************************************************** - * Functions - **************************************************/ - -void encodeNumHex(int hex_i, int num); -void encodeLatHex(int hex_i, char c); - -#endif /* HEX_ENCODER_H_ */ diff --git a/software/qsys_tutorial_lcd/hex_out.c b/software/qsys_tutorial_lcd/hex_out.c deleted file mode 100644 index 83b37d0..0000000 --- a/software/qsys_tutorial_lcd/hex_out.c +++ /dev/null @@ -1,67 +0,0 @@ -/* - * hex_out.c - * - * Created on: 2016/11/24 - * Author: takayun - */ -#include "hex_out.h" -#include "hex_encoder.h" -#include "system.h" - -void print_block(char * str, unsigned int size, enum BLOCK_N block_i) { - int i; - if (block_i == HEX0_3) { - if (size > 4) panic(); - for (i = 0; i < size; i++) { - encodeLatHex(i,str[size-1-i]); - } - } - else if (block_i == HEX4_5) { - if (size > 2) panic(); - for (i = 0; i < size; i++) { - encodeLatHex(i+4,str[size-1-i]); - } - } - else if (block_i == HEX6_7) { - if (size > 2) panic(); - for (i = 0; i < size; i++) { - encodeLatHex(i+6,str[size-1-i]); - } - } -} - -void clear_block(enum BLOCK_N block_i) { - if (block_i == HEX0_3) { - print_block(" ", 4, HEX0_3); - } - else if (block_i == HEX4_5) { - print_block(" ", 2, HEX4_5); - } - else if (block_i == HEX6_7) { - print_block(" ", 2, HEX6_7); - } -} - -void print_number(char num) { - int i; - char buf[5]; - char val; - for (i = 0; i < 4; i++) { - if (num < 0) { - buf[0] = '-'; - val = -num; - } else { - buf[0] = ' '; - val = num; - } - buf[1] = val/100%10 + '0'; - buf[2] = val/10%10 + '0'; - buf[3] = val%10 + '0'; - } - clear_block(HEX0_3); - print_block(buf, 4, HEX0_3); -} - - - - diff --git a/software/qsys_tutorial_lcd/hex_out.h b/software/qsys_tutorial_lcd/hex_out.h deleted file mode 100644 index 50d6868..0000000 --- a/software/qsys_tutorial_lcd/hex_out.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * hex_out.h - * - * Created on: 2016/11/24 - * Author: takayun - */ - -#ifndef HEX_IO_H_ -#define HEX_IO_H_ - -/************************************************** - * Defines - **************************************************/ - -enum BLOCK_N { - HEX0_3, HEX4_5, HEX6_7 -}; - -/************************************************** - * Variables - **************************************************/ - - -/************************************************** - * Functions - **************************************************/ - -void print_block(char * str, unsigned int size, enum BLOCK_N block_i); -void clear_block(enum BLOCK_N block_i); -void print_number(char num); - - -#endif /* HEX_IO_H_ */ diff --git a/software/qsys_tutorial_lcd/input_int.c b/software/qsys_tutorial_lcd/input_int.c deleted file mode 100644 index 0838b2b..0000000 --- a/software/qsys_tutorial_lcd/input_int.c +++ /dev/null @@ -1,67 +0,0 @@ -/* - * input_int.c - * - * Created on: 2016/11/24 - * Author: takayun - */ -#include "input_int.h" -#include "sys_register.h" - -unsigned char PUSH_EVENT = PUSH_NONE; - -void in_int() { - push_int(); -} - -static void update_sw_reg(sw_t s) { - global_registers[Ssw_data] = (char)s.data.value; - global_registers[Ssw_inst] = (char)s.splited.instruction_code; - global_registers[Ssw_memi] = (char)s.splited.memory_index; - global_registers[Ssw_regi] = (char)s.splited.register_index; - global_registers[Ssw_psel] = (char)s.splited.program_selecter; - global_registers[Ssw_rw] = (char)s.splited.rw_mode; - global_registers[Ssw_run] = (char)s.splited.run_mode; -} - -enum PushEvent push_decode(char psw) { - switch(psw) { - case 0x3: - return PUSH_VALSTR; - break; - case 0x5: - return PUSH_INSSTR; - break; - case 0x6: - return PUSH_RUN; - break; - } - return PUSH_NONE; -} - -void push_int() { - static unsigned char status = 0; - static enum PushEvent event_code; - volatile sw_t s; - s.sw = *switches; - - switch (status) { - case 0: - PUSH_EVENT = PUSH_NONE; - if (*push_switches != 7) { - event_code = push_decode(*push_switches); - status = 1; - } - update_sw_reg(s); // �X�C�b�`���W�X�^�X�V - break; - case 1: - if (*push_switches == 7) status = 2; - break; - case 2: - PUSH_EVENT = event_code; - status = 0; - break; - default: - status = 0; - break; - } -} diff --git a/software/qsys_tutorial_lcd/input_int.h b/software/qsys_tutorial_lcd/input_int.h deleted file mode 100644 index 3cd8cba..0000000 --- a/software/qsys_tutorial_lcd/input_int.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * input_int.h - * - * Created on: 2016/11/24 - * Author: takayun - */ - -#ifndef SWITCHES_INT_H_ -#define SWITCHES_INT_H_ - -/************************************************** - * Defines - **************************************************/ - -#define switches (volatile int *) 0x0005090 -#define push_switches (volatile char *) 0x0005080 - -typedef union { - int sw; - struct { - unsigned int run_mode : 1; - unsigned int rw_mode : 1; - unsigned int program_selecter : 4; - unsigned int memory_index : 4; - unsigned int register_index : 4; - unsigned int instruction_code : 4; - } splited; - struct { - unsigned int : 10; - unsigned int value : 8; - } data; -} sw_t; - -enum PushEvent{ - PUSH_NONE, - PUSH_ANY, - PUSH_VALSTR, - PUSH_INSSTR, - PUSH_RUN -}; - -/************************************************** - * Variables - **************************************************/ - -extern unsigned char PUSH_EVENT; - -/************************************************** - * Functions - **************************************************/ - -/* Function: in_int - * Sammary: - * �S�Ă̓��͊��荞�݂��s�� - * */ -void in_int(); - -void push_int(); - -#endif /* SWITCHES_INT_H_ */ diff --git a/software/qsys_tutorial_lcd/inst_decoder.c b/software/qsys_tutorial_lcd/inst_decoder.c deleted file mode 100644 index d864653..0000000 --- a/software/qsys_tutorial_lcd/inst_decoder.c +++ /dev/null @@ -1,109 +0,0 @@ -/* - * inst_decoder.c - * - * Created on: 2016/11/25 - * Author: takayun - */ - -#include "inst_decoder.h" -#include "sys_memory.h" -#include "sys_register.h" -#include "hex_out.h" -#include - -struct InstRec inst_fetch(){ - return inst_memory_load((unsigned int)global_registers[Spc]++); -} - -void inst_decode(struct InstRec inst_rec){ - switch(inst_rec.inst) { - case INST_END: - break; - case INST_JUMP: - inst_jump(inst_rec.regi, inst_rec.memi); - break; - case INST_OUTPUT: - inst_output(inst_rec.regi, inst_rec.memi); - break; - case INST_LOAD: - inst_load(inst_rec.regi, inst_rec.memi); - break; - case INST_STORE: - inst_store(inst_rec.regi, inst_rec.memi); - break; - case INST_DELAY: - inst_delay(inst_rec.regi, inst_rec.memi); - break; - case INST_ADD: - inst_add(inst_rec.regi, inst_rec.memi); - break; - case INST_COMP: - inst_comp(inst_rec.regi, inst_rec.memi); - break; - case INST_JEQ: - inst_jeq(inst_rec.regi, inst_rec.memi); - break; - case INST_JNE: - inst_jne(inst_rec.regi, inst_rec.memi); - break; - case INST_JIEQ: - inst_jieq(inst_rec.regi, inst_rec.memi); - break; - case INST_JINE: - inst_jine(inst_rec.regi, inst_rec.memi); - break; - } -} - -void inst_jump(enum Register reg, unsigned char memory_index){ - global_registers[Spc]=global_registers[reg]+memory_index; -} -void inst_output(enum Register reg, unsigned char memory_index){ - //�������̒l��7�Z�O�ɕ\�� - char buf[5]; - memory_load(memory_index, Sseg); - sprintf(buf, "%04d", global_registers[Sseg]); - print_block(buf, 4, HEX0_3); -} -void inst_load(enum Register reg, unsigned char memory_index){ - memory_load(memory_index, reg); -} -void inst_store(enum Register reg, unsigned char memory_index){ - memory_store(memory_index, reg); -} -void inst_delay(enum Register reg, unsigned char memory_index){ - //���W�X�^�̒l*10ms�҂� -} -void inst_add(enum Register reg, unsigned char memory_index){ - global_registers[Sacc]+=global_registers[reg]; -} -void inst_comp(enum Register reg, unsigned char memory_index){ - if(global_registers[Sacc]==global_registers[reg]){ - global_registers[Sflg]=0; - } else if(global_registers[Sacc] > global_registers[reg]){ - global_registers[Sflg]=-1; - }else{ - global_registers[Sflg]=1; - } -} -void inst_jeq(enum Register reg, unsigned char memory_index){ - if(global_registers[Sflg]==global_registers[reg]){ - global_registers[Spc]++; - } -} -void inst_jne(enum Register reg, unsigned char memory_index){ - if(global_registers[Sflg]!=global_registers[reg]){ - global_registers[Spc]++; - } -} -void inst_jieq(char im, unsigned char memory_index){ - if(global_registers[Sflg]==im){ - global_registers[Spc]++; - } -} -void inst_jine(char im, unsigned char memory_index){ - if(global_registers[Sflg]!=im){ - global_registers[Spc]++; - } -} - diff --git a/software/qsys_tutorial_lcd/inst_decoder.h b/software/qsys_tutorial_lcd/inst_decoder.h deleted file mode 100644 index 9860750..0000000 --- a/software/qsys_tutorial_lcd/inst_decoder.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * inst_decoder.h - * - * Created on: 2016/11/25 - * Author: takayun - */ - -#ifndef INST_DECODER_H_ -#define INST_DECODER_H_ - -#include "sys_register.h" - -#define INST_END 0x0 -#define INST_JUMP 0x1 -#define INST_OUTPUT 0x2 -#define INST_LOAD 0x3 -#define INST_STORE 0x4 -#define INST_DELAY 0x5 -#define INST_ADD 0x6 -#define INST_COMP 0x7 -#define INST_JEQ 0x8 -#define INST_JNE 0x9 -#define INST_JIEQ 0xA -#define INST_JINE 0xB - -struct InstRec { - unsigned int inst : 4; - unsigned int memi : 4; - unsigned int regi : 4; -}; - -struct InstRec inst_fetch(); - -void inst_decode(struct InstRec inst_rec); - -void inst_jump(enum Register reg, unsigned char memory_index); -void inst_output(enum Register reg, unsigned char memory_index); -void inst_load(enum Register reg, unsigned char memory_index); -void inst_store(enum Register reg, unsigned char memory_index); -void inst_delay(enum Register reg, unsigned char memory_index); -void inst_add(enum Register reg, unsigned char memory_index); -void inst_comp(enum Register reg, unsigned char memory_index); -void inst_jeq(enum Register reg, unsigned char memory_index); -void inst_jne(enum Register reg, unsigned char memory_index); -void inst_jieq(char im, unsigned char memory_index); -void inst_jine(char im, unsigned char memory_index); - - -#endif /* INST_DECODER_H_ */ diff --git a/software/qsys_tutorial_lcd/obj/default/LCD.d b/software/qsys_tutorial_lcd/obj/default/LCD.d deleted file mode 100644 index 7631415..0000000 --- a/software/qsys_tutorial_lcd/obj/default/LCD.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/default/LCD.o: LCD.c ../qsys_tutorial_lcd_bsp//HAL/inc/io.h \ - ../qsys_tutorial_lcd_bsp//HAL/inc/alt_types.h system.h LCD.h - -../qsys_tutorial_lcd_bsp//HAL/inc/io.h: - -../qsys_tutorial_lcd_bsp//HAL/inc/alt_types.h: - -system.h: - -LCD.h: diff --git a/software/qsys_tutorial_lcd/obj/default/hello_world_small.d b/software/qsys_tutorial_lcd/obj/default/hello_world_small.d deleted file mode 100644 index c33febe..0000000 --- a/software/qsys_tutorial_lcd/obj/default/hello_world_small.d +++ /dev/null @@ -1,17 +0,0 @@ -obj/default/hello_world_small.o: hello_world_small.c \ - ../qsys_tutorial_lcd_bsp//HAL/inc/sys/alt_stdio.h system.h hex_out.h \ - sys_register.h sys_memory.h inst_decoder.h input_int.h - -../qsys_tutorial_lcd_bsp//HAL/inc/sys/alt_stdio.h: - -system.h: - -hex_out.h: - -sys_register.h: - -sys_memory.h: - -inst_decoder.h: - -input_int.h: diff --git a/software/qsys_tutorial_lcd/obj/default/hello_world_small.o b/software/qsys_tutorial_lcd/obj/default/hello_world_small.o deleted file mode 100644 index 7f61985..0000000 --- a/software/qsys_tutorial_lcd/obj/default/hello_world_small.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd/obj/default/hex_encoder.d b/software/qsys_tutorial_lcd/obj/default/hex_encoder.d deleted file mode 100644 index e913210..0000000 --- a/software/qsys_tutorial_lcd/obj/default/hex_encoder.d +++ /dev/null @@ -1,3 +0,0 @@ -obj/default/hex_encoder.o: hex_encoder.c hex_encoder.h - -hex_encoder.h: diff --git a/software/qsys_tutorial_lcd/obj/default/hex_encoder.o b/software/qsys_tutorial_lcd/obj/default/hex_encoder.o deleted file mode 100644 index 65036f7..0000000 --- a/software/qsys_tutorial_lcd/obj/default/hex_encoder.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd/obj/default/hex_out.d b/software/qsys_tutorial_lcd/obj/default/hex_out.d deleted file mode 100644 index 1000db0..0000000 --- a/software/qsys_tutorial_lcd/obj/default/hex_out.d +++ /dev/null @@ -1,7 +0,0 @@ -obj/default/hex_out.o: hex_out.c hex_out.h hex_encoder.h system.h - -hex_out.h: - -hex_encoder.h: - -system.h: diff --git a/software/qsys_tutorial_lcd/obj/default/hex_out.o b/software/qsys_tutorial_lcd/obj/default/hex_out.o deleted file mode 100644 index 2ac0334..0000000 --- a/software/qsys_tutorial_lcd/obj/default/hex_out.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd/obj/default/input_int.d b/software/qsys_tutorial_lcd/obj/default/input_int.d deleted file mode 100644 index 25051be..0000000 --- a/software/qsys_tutorial_lcd/obj/default/input_int.d +++ /dev/null @@ -1,5 +0,0 @@ -obj/default/input_int.o: input_int.c input_int.h sys_register.h - -input_int.h: - -sys_register.h: diff --git a/software/qsys_tutorial_lcd/obj/default/input_int.o b/software/qsys_tutorial_lcd/obj/default/input_int.o deleted file mode 100644 index 43cf5d1..0000000 --- a/software/qsys_tutorial_lcd/obj/default/input_int.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd/obj/default/inst_decoder.d b/software/qsys_tutorial_lcd/obj/default/inst_decoder.d deleted file mode 100644 index 3e61d10..0000000 --- a/software/qsys_tutorial_lcd/obj/default/inst_decoder.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/default/inst_decoder.o: inst_decoder.c inst_decoder.h sys_register.h \ - sys_memory.h hex_out.h - -inst_decoder.h: - -sys_register.h: - -sys_memory.h: - -hex_out.h: diff --git a/software/qsys_tutorial_lcd/obj/default/inst_decoder.o b/software/qsys_tutorial_lcd/obj/default/inst_decoder.o deleted file mode 100644 index 00c3ec0..0000000 --- a/software/qsys_tutorial_lcd/obj/default/inst_decoder.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd/obj/default/sys_memory.d b/software/qsys_tutorial_lcd/obj/default/sys_memory.d deleted file mode 100644 index 52d4dcd..0000000 --- a/software/qsys_tutorial_lcd/obj/default/sys_memory.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/default/sys_memory.o: sys_memory.c system.h sys_memory.h \ - sys_register.h inst_decoder.h - -system.h: - -sys_memory.h: - -sys_register.h: - -inst_decoder.h: diff --git a/software/qsys_tutorial_lcd/obj/default/sys_memory.o b/software/qsys_tutorial_lcd/obj/default/sys_memory.o deleted file mode 100644 index 612152e..0000000 --- a/software/qsys_tutorial_lcd/obj/default/sys_memory.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd/obj/default/sys_register.d b/software/qsys_tutorial_lcd/obj/default/sys_register.d deleted file mode 100644 index ec29589..0000000 --- a/software/qsys_tutorial_lcd/obj/default/sys_register.d +++ /dev/null @@ -1,3 +0,0 @@ -obj/default/sys_register.o: sys_register.c sys_register.h - -sys_register.h: diff --git a/software/qsys_tutorial_lcd/obj/default/sys_register.o b/software/qsys_tutorial_lcd/obj/default/sys_register.o deleted file mode 100644 index b6a2ba5..0000000 --- a/software/qsys_tutorial_lcd/obj/default/sys_register.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd/obj/default/system.d b/software/qsys_tutorial_lcd/obj/default/system.d deleted file mode 100644 index 6c906ae..0000000 --- a/software/qsys_tutorial_lcd/obj/default/system.d +++ /dev/null @@ -1,5 +0,0 @@ -obj/default/system.o: system.c system.h hex_out.h - -system.h: - -hex_out.h: diff --git a/software/qsys_tutorial_lcd/obj/default/system.o b/software/qsys_tutorial_lcd/obj/default/system.o deleted file mode 100644 index 7663f6c..0000000 --- a/software/qsys_tutorial_lcd/obj/default/system.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd/qsys_tutorial_lcd.elf b/software/qsys_tutorial_lcd/qsys_tutorial_lcd.elf deleted file mode 100644 index 21c9273..0000000 --- a/software/qsys_tutorial_lcd/qsys_tutorial_lcd.elf +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd/qsys_tutorial_lcd.map b/software/qsys_tutorial_lcd/qsys_tutorial_lcd.map deleted file mode 100644 index 05f97a8..0000000 --- a/software/qsys_tutorial_lcd/qsys_tutorial_lcd.map +++ /dev/null @@ -1,753 +0,0 @@ -Archive member included because of file (symbol) - -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-divmod.o) - obj/default/hex_out.o (__divsi3) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-mul.o) - obj/default/hello_world_small.o (__mulsi3) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-ctype_.o) - obj/default/hex_encoder.o (__ctype_ptr) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-sprintf.o) - obj/default/hello_world_small.o (sprintf) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-vfprintf.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-sprintf.o) (___vfprintf_internal_r) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-fvwrite_small_str.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-sprintf.o) (__sfvwrite_small_str) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-impure.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-sprintf.o) (_impure_ptr) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-memmove.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-fvwrite_small_str.o) (memmove) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-strlen.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-vfprintf.o) (strlen) -../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_load.o) - ../qsys_tutorial_lcd_bsp//obj/HAL/src/crt0.o (alt_load) -../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_main.o) - ../qsys_tutorial_lcd_bsp//obj/HAL/src/crt0.o (alt_main) -../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_sys_init.o) - ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_main.o) (alt_sys_init) -../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_load.o) (alt_dcache_flush_all) -../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_load.o) (alt_icache_flush_all) -../qsys_tutorial_lcd_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_sys_init.o) (altera_nios2_qsys_irq_init) - -Allocating common symbols -Common symbol size file - -stack 0x5 obj/default/hello_world_small.o -global_registers 0xf obj/default/sys_register.o - -Memory Configuration - -Name Origin Length Attributes -reset 0x00000000 0x00000020 -onchip_memory 0x00000020 0x00003fe0 -*default* 0x00000000 0xffffffff - -Linker script and memory map - -LOAD ../qsys_tutorial_lcd_bsp//obj/HAL/src/crt0.o - 0x0000000c exit = _exit -LOAD obj/default/hello_world_small.o -LOAD obj/default/hex_encoder.o -LOAD obj/default/hex_out.o -LOAD obj/default/input_int.o -LOAD obj/default/inst_decoder.o -LOAD obj/default/sys_memory.o -LOAD obj/default/sys_register.o -LOAD obj/default/system.o -LOAD c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libstdc++.a -LOAD c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libm.a -LOAD c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a -START GROUP -LOAD c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a -LOAD c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a -LOAD ../qsys_tutorial_lcd_bsp/\libhal_bsp.a -END GROUP -LOAD c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a - 0x00000000 __alt_mem_onchip_memory = 0x0 - -.entry 0x00000000 0x20 - *(.entry) - .entry 0x00000000 0x20 ../qsys_tutorial_lcd_bsp//obj/HAL/src/crt0.o - 0x00000000 __reset - 0x0000000c _exit - -.exceptions 0x00000020 0x0 - 0x00000020 PROVIDE (__ram_exceptions_start, ABSOLUTE (.)) - 0x00000020 . = ALIGN (0x20) - *(.irq) - *(.exceptions.entry.label) - *(.exceptions.entry.user) - *(.exceptions.entry) - *(.exceptions.irqtest.user) - *(.exceptions.irqtest) - *(.exceptions.irqhandler.user) - *(.exceptions.irqhandler) - *(.exceptions.irqreturn.user) - *(.exceptions.irqreturn) - *(.exceptions.notirq.label) - *(.exceptions.notirq.user) - *(.exceptions.notirq) - *(.exceptions.soft.user) - *(.exceptions.soft) - *(.exceptions.unknown.user) - *(.exceptions.unknown) - *(.exceptions.exit.label) - *(.exceptions.exit.user) - *(.exceptions.exit) - *(.exceptions) - 0x00000020 PROVIDE (__ram_exceptions_end, ABSOLUTE (.)) - 0x00000020 PROVIDE (__flash_exceptions_start, LOADADDR (.exceptions)) - -.text 0x00000020 0x1d1c - 0x00000020 PROVIDE (stext, ABSOLUTE (.)) - *(.interp) - *(.hash) - *(.dynsym) - *(.dynstr) - *(.gnu.version) - *(.gnu.version_d) - *(.gnu.version_r) - *(.rel.init) - *(.rela.init) - *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) - *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) - *(.rel.fini) - *(.rela.fini) - *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) - *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) - *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) - *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) - *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) - *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) - *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) - *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) - *(.rel.ctors) - *(.rela.ctors) - *(.rel.dtors) - *(.rela.dtors) - *(.rel.got) - *(.rela.got) - *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) - *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) - *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) - *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) - *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) - *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) - *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) - *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) - *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) - *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) - *(.rel.plt) - *(.rela.plt) - *(.rel.dyn) - *(.init) - *(.plt) - *(.text .stub .text.* .gnu.linkonce.t.*) - .text 0x00000020 0x3c ../qsys_tutorial_lcd_bsp//obj/HAL/src/crt0.o - 0x00000020 _start - .text 0x0000005c 0x408 obj/default/hello_world_small.o - 0x0000005c wait - 0x00000098 print_change_memory - 0x00000130 run_proc - 0x000001d0 store_inst - 0x000002a0 store_value - 0x00000344 init - 0x000003e8 main - .text 0x00000464 0x3b8 obj/default/hex_encoder.o - 0x00000464 encodeNumHex - 0x00000588 encodeLatHex - .text 0x0000081c 0x228 obj/default/hex_out.o - 0x0000081c print_block - 0x000008f8 clear_block - 0x00000948 print_number - .text 0x00000a44 0x180 obj/default/input_int.o - 0x00000a44 push_decode - 0x00000a84 push_int - 0x00000bc0 in_int - .text 0x00000bc4 0x334 obj/default/inst_decoder.o - 0x00000bc4 inst_jump - 0x00000be0 inst_delay - 0x00000be4 inst_add - 0x00000c04 inst_comp - 0x00000c3c inst_jeq - 0x00000c64 inst_jne - 0x00000c8c inst_jieq - 0x00000cb8 inst_jine - 0x00000ce4 inst_store - 0x00000cf4 inst_load - 0x00000d04 inst_output - 0x00000d50 inst_fetch - 0x00000d88 inst_decode - .text 0x00000ef8 0x220 obj/default/sys_memory.o - 0x00000ef8 memory_init - 0x00000f3c inst_memory_store - 0x00000fbc inst_memory_load - 0x00001038 memory_load - 0x000010a8 memory_store - .text 0x00001118 0x1c obj/default/sys_register.o - 0x00001118 registers_init - .text 0x00001134 0x2c obj/default/system.o - 0x00001134 panic - .text 0x00001160 0x14c c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-divmod.o) - 0x000011dc __divsi3 - 0x0000123c __modsi3 - 0x0000129c __udivsi3 - 0x000012a4 __umodsi3 - .text 0x000012ac 0x38 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-mul.o) - 0x000012ac __mulsi3 - .text 0x000012e4 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-ctype_.o) - .text 0x000012e4 0xf4 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-sprintf.o) - 0x000012e4 sprintf - 0x00001368 _sprintf_r - .text 0x000013d8 0x740 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-vfprintf.o) - 0x00001458 ___vfprintf_internal_r - 0x00001af4 __vfprintf_internal - .text 0x00001b18 0xb8 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-fvwrite_small_str.o) - 0x00001b18 __sfvwrite_small_str - .text 0x00001bd0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-impure.o) - .text 0x00001bd0 0x60 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-memmove.o) - 0x00001bd0 memmove - .text 0x00001c30 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-strlen.o) - 0x00001c30 strlen - .text 0x00001c50 0x8c ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_load.o) - 0x00001c70 alt_load - .text 0x00001cdc 0x2c ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_main.o) - 0x00001cdc alt_main - .text 0x00001d08 0x24 ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_sys_init.o) - 0x00001d08 alt_sys_init - 0x00001d0c alt_irq_init - .text 0x00001d2c 0x4 ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - 0x00001d2c alt_dcache_flush_all - .text 0x00001d30 0x4 ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - 0x00001d30 alt_icache_flush_all - .text 0x00001d34 0x8 ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - 0x00001d34 altera_nios2_qsys_irq_init - *(.gnu.warning.*) - *(.fini) - 0x00001d3c PROVIDE (__etext, ABSOLUTE (.)) - 0x00001d3c PROVIDE (_etext, ABSOLUTE (.)) - 0x00001d3c PROVIDE (etext, ABSOLUTE (.)) - *(.eh_frame_hdr) - 0x00001d3c . = ALIGN (0x4) - 0x00001d3c PROVIDE (__preinit_array_start, ABSOLUTE (.)) - *(.preinit_array) - 0x00001d3c PROVIDE (__preinit_array_end, ABSOLUTE (.)) - 0x00001d3c PROVIDE (__init_array_start, ABSOLUTE (.)) - *(.init_array) - 0x00001d3c PROVIDE (__init_array_end, ABSOLUTE (.)) - 0x00001d3c PROVIDE (__fini_array_start, ABSOLUTE (.)) - *(.fini_array) - 0x00001d3c PROVIDE (__fini_array_end, ABSOLUTE (.)) - *(.eh_frame) - *(.gcc_except_table) - *(.dynamic) - 0x00001d3c PROVIDE (__CTOR_LIST__, ABSOLUTE (.)) - *(.ctors) - *(SORT(.ctors.*)) - 0x00001d3c PROVIDE (__CTOR_END__, ABSOLUTE (.)) - 0x00001d3c PROVIDE (__DTOR_LIST__, ABSOLUTE (.)) - *(.dtors) - *(SORT(.dtors.*)) - 0x00001d3c PROVIDE (__DTOR_END__, ABSOLUTE (.)) - *(.jcr) - 0x00001d3c . = ALIGN (0x4) - -.rodata 0x00001d3c 0x2d0 - 0x00001d3c PROVIDE (__ram_rodata_start, ABSOLUTE (.)) - 0x00001d3c . = ALIGN (0x4) - *(.rodata .rodata.* .gnu.linkonce.r.*) - .rodata.str1.4 - 0x00001d3c 0x35 obj/default/hello_world_small.o - 0x38 (size before relaxing) - *fill* 0x00001d71 0x3 00 - .rodata.str1.4 - 0x00001d74 0xb obj/default/hex_out.o - 0xc (size before relaxing) - .rodata.str1.4 - 0x00000000 0x8 obj/default/inst_decoder.o - *fill* 0x00001d7f 0x1 00 - .rodata.str1.4 - 0x00001d80 0x8 obj/default/system.o - .rodata 0x00001d88 0x281 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-ctype_.o) - 0x00001d88 _ctype_ - *(.rodata1) - 0x0000200c . = ALIGN (0x4) - *fill* 0x00002009 0x3 00 - 0x0000200c PROVIDE (__ram_rodata_end, ABSOLUTE (.)) - 0x00001d3c PROVIDE (__flash_rodata_start, LOADADDR (.rodata)) - -.rwdata 0x0000200c 0xf0 load address 0x000020fc - 0x0000200c PROVIDE (__ram_rwdata_start, ABSOLUTE (.)) - 0x0000200c . = ALIGN (0x4) - *(.got.plt) - *(.got) - *(.data1) - *(.data .data.* .gnu.linkonce.d.*) - .data 0x0000200c 0x0 ../qsys_tutorial_lcd_bsp//obj/HAL/src/crt0.o - .data 0x0000200c 0x0 obj/default/hello_world_small.o - .data 0x0000200c 0x0 obj/default/hex_encoder.o - .data 0x0000200c 0x0 obj/default/hex_out.o - .data 0x0000200c 0x0 obj/default/input_int.o - .data 0x0000200c 0x0 obj/default/inst_decoder.o - .data 0x0000200c 0x0 obj/default/sys_memory.o - .data 0x0000200c 0x0 obj/default/sys_register.o - .data 0x0000200c 0x0 obj/default/system.o - .data 0x0000200c 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-divmod.o) - .data 0x0000200c 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-mul.o) - .data 0x0000200c 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-ctype_.o) - .data 0x0000200c 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-sprintf.o) - .data 0x0000200c 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-vfprintf.o) - .data 0x0000200c 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-fvwrite_small_str.o) - .data 0x0000200c 0xe0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-impure.o) - .data 0x000020ec 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-memmove.o) - .data 0x000020ec 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-strlen.o) - .data 0x000020ec 0x0 ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_load.o) - .data 0x000020ec 0x0 ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_main.o) - .data 0x000020ec 0x0 ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_sys_init.o) - .data 0x000020ec 0x0 ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .data 0x000020ec 0x0 ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .data 0x000020ec 0x0 ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - 0x0000a0ec _gp = ABSOLUTE ((. + 0x8000)) - 0x0000a0ec PROVIDE (gp, _gp) - *(.rwdata .rwdata.*) - *(.sdata .sdata.* .gnu.linkonce.s.*) - .sdata 0x000020ec 0x4 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-ctype_.o) - 0x000020ec __ctype_ptr - .sdata 0x000020f0 0x8 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-impure.o) - 0x000020f0 _impure_ptr - 0x000020f4 _global_impure_ptr - .sdata 0x000020f8 0x4 ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_sys_init.o) - 0x000020f8 jtag_uart - *(.sdata2 .sdata2.* .gnu.linkonce.s2.*) - 0x000020fc . = ALIGN (0x4) - 0x000020fc _edata = ABSOLUTE (.) - 0x000020fc PROVIDE (edata, ABSOLUTE (.)) - 0x000020fc PROVIDE (__ram_rwdata_end, ABSOLUTE (.)) - 0x000020fc PROVIDE (__flash_rwdata_start, LOADADDR (.rwdata)) - -.bss 0x000021ec 0x174 - 0x000021ec __bss_start = ABSOLUTE (.) - 0x000021ec PROVIDE (__sbss_start, ABSOLUTE (.)) - 0x000021ec PROVIDE (___sbss_start, ABSOLUTE (.)) - *(.dynsbss) - *(.sbss .sbss.* .gnu.linkonce.sb.*) - .sbss 0x000021ec 0x5 obj/default/hello_world_small.o - 0x000021ec stack - *fill* 0x000021f1 0x3 00 - .sbss 0x000021f4 0xc obj/default/input_int.o - 0x000021f4 PUSH_EVENT - .sbss 0x00002200 0x4 obj/default/sys_memory.o - 0x00002200 global_current_memory - .sbss 0x00002204 0xc ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_main.o) - 0x00002204 alt_argc - 0x00002208 alt_argv - 0x0000220c alt_envp - *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) - *(.scommon) - 0x00002210 PROVIDE (__sbss_end, ABSOLUTE (.)) - 0x00002210 PROVIDE (___sbss_end, ABSOLUTE (.)) - *(.dynbss) - *(.bss .bss.* .gnu.linkonce.b.*) - .bss 0x00002210 0x0 ../qsys_tutorial_lcd_bsp//obj/HAL/src/crt0.o - .bss 0x00002210 0x0 obj/default/hello_world_small.o - .bss 0x00002210 0x0 obj/default/hex_encoder.o - .bss 0x00002210 0x0 obj/default/hex_out.o - .bss 0x00002210 0x0 obj/default/input_int.o - .bss 0x00002210 0x0 obj/default/inst_decoder.o - .bss 0x00002210 0x140 obj/default/sys_memory.o - .bss 0x00002350 0x0 obj/default/sys_register.o - .bss 0x00002350 0x0 obj/default/system.o - .bss 0x00002350 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-divmod.o) - .bss 0x00002350 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-mul.o) - .bss 0x00002350 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-ctype_.o) - .bss 0x00002350 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-sprintf.o) - .bss 0x00002350 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-vfprintf.o) - .bss 0x00002350 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-fvwrite_small_str.o) - .bss 0x00002350 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-impure.o) - .bss 0x00002350 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-memmove.o) - .bss 0x00002350 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-strlen.o) - .bss 0x00002350 0x0 ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_load.o) - .bss 0x00002350 0x0 ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_main.o) - .bss 0x00002350 0x0 ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_sys_init.o) - .bss 0x00002350 0x0 ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .bss 0x00002350 0x0 ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .bss 0x00002350 0x0 ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - *(COMMON) - COMMON 0x00002350 0xf obj/default/sys_register.o - 0x00002350 global_registers - 0x00002360 . = ALIGN (0x4) - *fill* 0x0000235f 0x1 00 - 0x00002360 __bss_end = ABSOLUTE (.) - -.onchip_memory 0x00002360 0x0 - 0x00002360 PROVIDE (_alt_partition_onchip_memory_start, ABSOLUTE (.)) - *(.onchip_memory. onchip_memory.*) - 0x00002360 . = ALIGN (0x4) - 0x00002360 PROVIDE (_alt_partition_onchip_memory_end, ABSOLUTE (.)) - 0x00002360 _end = ABSOLUTE (.) - 0x00002360 end = ABSOLUTE (.) - 0x00002360 __alt_stack_base = ABSOLUTE (.) - 0x00002360 PROVIDE (_alt_partition_onchip_memory_load_addr, LOADADDR (.onchip_memory)) - -.stab - *(.stab) - -.stabstr - *(.stabstr) - -.stab.excl - *(.stab.excl) - -.stab.exclstr - *(.stab.exclstr) - -.stab.index - *(.stab.index) - -.stab.indexstr - *(.stab.indexstr) - -.comment 0x00000000 0x26 - *(.comment) - .comment 0x00000000 0x26 obj/default/hello_world_small.o - 0x27 (size before relaxing) - .comment 0x00000000 0x27 obj/default/hex_encoder.o - .comment 0x00000000 0x27 obj/default/hex_out.o - .comment 0x00000000 0x27 obj/default/input_int.o - .comment 0x00000000 0x27 obj/default/inst_decoder.o - .comment 0x00000000 0x27 obj/default/sys_memory.o - .comment 0x00000000 0x27 obj/default/sys_register.o - .comment 0x00000000 0x27 obj/default/system.o - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-divmod.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-mul.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-ctype_.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-sprintf.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-vfprintf.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-fvwrite_small_str.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-impure.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-memmove.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-strlen.o) - .comment 0x00000000 0x27 ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_load.o) - .comment 0x00000000 0x27 ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_main.o) - .comment 0x00000000 0x27 ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_sys_init.o) - .comment 0x00000000 0x27 ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .comment 0x00000000 0x27 ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .comment 0x00000000 0x27 ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - -.debug - *(.debug) - -.line - *(.line) - -.debug_srcinfo - *(.debug_srcinfo) - -.debug_sfnames - *(.debug_sfnames) - -.debug_aranges 0x00000000 0x2c8 - *(.debug_aranges) - .debug_aranges - 0x00000000 0x28 ../qsys_tutorial_lcd_bsp//obj/HAL/src/crt0.o - .debug_aranges - 0x00000028 0x20 obj/default/hello_world_small.o - .debug_aranges - 0x00000048 0x20 obj/default/hex_encoder.o - .debug_aranges - 0x00000068 0x20 obj/default/hex_out.o - .debug_aranges - 0x00000088 0x20 obj/default/input_int.o - .debug_aranges - 0x000000a8 0x20 obj/default/inst_decoder.o - .debug_aranges - 0x000000c8 0x20 obj/default/sys_memory.o - .debug_aranges - 0x000000e8 0x20 obj/default/sys_register.o - .debug_aranges - 0x00000108 0x20 obj/default/system.o - .debug_aranges - 0x00000128 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-divmod.o) - .debug_aranges - 0x00000148 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-mul.o) - .debug_aranges - 0x00000168 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-sprintf.o) - .debug_aranges - 0x00000188 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-vfprintf.o) - .debug_aranges - 0x000001a8 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-fvwrite_small_str.o) - .debug_aranges - 0x000001c8 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-memmove.o) - .debug_aranges - 0x000001e8 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-strlen.o) - .debug_aranges - 0x00000208 0x20 ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_load.o) - .debug_aranges - 0x00000228 0x20 ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_main.o) - .debug_aranges - 0x00000248 0x20 ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_sys_init.o) - .debug_aranges - 0x00000268 0x20 ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .debug_aranges - 0x00000288 0x20 ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .debug_aranges - 0x000002a8 0x20 ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - -.debug_pubnames - 0x00000000 0x5b9 - *(.debug_pubnames) - .debug_pubnames - 0x00000000 0x7b obj/default/hello_world_small.o - .debug_pubnames - 0x0000007b 0x34 obj/default/hex_encoder.o - .debug_pubnames - 0x000000af 0x43 obj/default/hex_out.o - .debug_pubnames - 0x000000f2 0x49 obj/default/input_int.o - .debug_pubnames - 0x0000013b 0xcc obj/default/inst_decoder.o - .debug_pubnames - 0x00000207 0x88 obj/default/sys_memory.o - .debug_pubnames - 0x0000028f 0x3a obj/default/sys_register.o - .debug_pubnames - 0x000002c9 0x1c obj/default/system.o - .debug_pubnames - 0x000002e5 0x48 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-divmod.o) - .debug_pubnames - 0x0000032d 0x1f c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-mul.o) - .debug_pubnames - 0x0000034c 0x2e c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-ctype_.o) - .debug_pubnames - 0x0000037a 0x2d c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-sprintf.o) - .debug_pubnames - 0x000003a7 0x45 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-vfprintf.o) - .debug_pubnames - 0x000003ec 0x2b c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-fvwrite_small_str.o) - .debug_pubnames - 0x00000417 0x39 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-impure.o) - .debug_pubnames - 0x00000450 0x1e c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-memmove.o) - .debug_pubnames - 0x0000046e 0x1d c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-strlen.o) - .debug_pubnames - 0x0000048b 0x1f ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_load.o) - .debug_pubnames - 0x000004aa 0x46 ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_main.o) - .debug_pubnames - 0x000004f0 0x42 ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_sys_init.o) - .debug_pubnames - 0x00000532 0x2b ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .debug_pubnames - 0x0000055d 0x2b ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .debug_pubnames - 0x00000588 0x31 ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - -.debug_info 0x00000000 0x39d5 - *(.debug_info .gnu.linkonce.wi.*) - .debug_info 0x00000000 0x81 ../qsys_tutorial_lcd_bsp//obj/HAL/src/crt0.o - .debug_info 0x00000081 0x28d obj/default/hello_world_small.o - .debug_info 0x0000030e 0xd2 obj/default/hex_encoder.o - .debug_info 0x000003e0 0x145 obj/default/hex_out.o - .debug_info 0x00000525 0x245 obj/default/input_int.o - .debug_info 0x0000076a 0x526 obj/default/inst_decoder.o - .debug_info 0x00000c90 0x272 obj/default/sys_memory.o - .debug_info 0x00000f02 0x7d obj/default/sys_register.o - .debug_info 0x00000f7f 0x3a obj/default/system.o - .debug_info 0x00000fb9 0x21c c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-divmod.o) - .debug_info 0x000011d5 0xf3 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-mul.o) - .debug_info 0x000012c8 0xa0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-ctype_.o) - .debug_info 0x00001368 0x7e7 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-sprintf.o) - .debug_info 0x00001b4f 0x9b6 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-vfprintf.o) - .debug_info 0x00002505 0x75f c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-fvwrite_small_str.o) - .debug_info 0x00002c64 0x636 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-impure.o) - .debug_info 0x0000329a 0x102 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-memmove.o) - .debug_info 0x0000339c 0xc2 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-strlen.o) - .debug_info 0x0000345e 0x12e ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_load.o) - .debug_info 0x0000358c 0x125 ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_main.o) - .debug_info 0x000036b1 0x17d ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_sys_init.o) - .debug_info 0x0000382e 0x8d ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .debug_info 0x000038bb 0x8d ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .debug_info 0x00003948 0x8d ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - -.debug_abbrev 0x00000000 0x13f4 - *(.debug_abbrev) - .debug_abbrev 0x00000000 0x12 ../qsys_tutorial_lcd_bsp//obj/HAL/src/crt0.o - .debug_abbrev 0x00000012 0x145 obj/default/hello_world_small.o - .debug_abbrev 0x00000157 0x9e obj/default/hex_encoder.o - .debug_abbrev 0x000001f5 0xc7 obj/default/hex_out.o - .debug_abbrev 0x000002bc 0x185 obj/default/input_int.o - .debug_abbrev 0x00000441 0x186 obj/default/inst_decoder.o - .debug_abbrev 0x000005c7 0x13d obj/default/sys_memory.o - .debug_abbrev 0x00000704 0x6f obj/default/sys_register.o - .debug_abbrev 0x00000773 0x27 obj/default/system.o - .debug_abbrev 0x0000079a 0xe0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-divmod.o) - .debug_abbrev 0x0000087a 0x7b c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-mul.o) - .debug_abbrev 0x000008f5 0x61 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-ctype_.o) - .debug_abbrev 0x00000956 0x179 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-sprintf.o) - .debug_abbrev 0x00000acf 0x263 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-vfprintf.o) - .debug_abbrev 0x00000d32 0x184 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-fvwrite_small_str.o) - .debug_abbrev 0x00000eb6 0x13f c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-impure.o) - .debug_abbrev 0x00000ff5 0xa8 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-memmove.o) - .debug_abbrev 0x0000109d 0x7a c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-strlen.o) - .debug_abbrev 0x00001117 0x97 ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_load.o) - .debug_abbrev 0x000011ae 0xa6 ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_main.o) - .debug_abbrev 0x00001254 0xe3 ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_sys_init.o) - .debug_abbrev 0x00001337 0x3f ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .debug_abbrev 0x00001376 0x3f ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .debug_abbrev 0x000013b5 0x3f ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - -.debug_line 0x00000000 0x374c - *(.debug_line) - .debug_line 0x00000000 0x66 ../qsys_tutorial_lcd_bsp//obj/HAL/src/crt0.o - .debug_line 0x00000066 0x53c obj/default/hello_world_small.o - .debug_line 0x000005a2 0x2b7 obj/default/hex_encoder.o - .debug_line 0x00000859 0x1f5 obj/default/hex_out.o - .debug_line 0x00000a4e 0x1d9 obj/default/input_int.o - .debug_line 0x00000c27 0x44c obj/default/inst_decoder.o - .debug_line 0x00001073 0x18f obj/default/sys_memory.o - .debug_line 0x00001202 0x87 obj/default/sys_register.o - .debug_line 0x00001289 0x94 obj/default/system.o - .debug_line 0x0000131d 0x24f c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-divmod.o) - .debug_line 0x0000156c 0x11a c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-mul.o) - .debug_line 0x00001686 0x81 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-ctype_.o) - .debug_line 0x00001707 0x365 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-sprintf.o) - .debug_line 0x00001a6c 0x666 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-vfprintf.o) - .debug_line 0x000020d2 0x2cf c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-fvwrite_small_str.o) - .debug_line 0x000023a1 0x230 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-impure.o) - .debug_line 0x000025d1 0x294 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-memmove.o) - .debug_line 0x00002865 0x250 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-strlen.o) - .debug_line 0x00002ab5 0x217 ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_load.o) - .debug_line 0x00002ccc 0x2c2 ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_main.o) - .debug_line 0x00002f8e 0x286 ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_sys_init.o) - .debug_line 0x00003214 0x1b5 ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .debug_line 0x000033c9 0x1b5 ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .debug_line 0x0000357e 0x1ce ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - -.debug_frame 0x00000000 0x5ec - *(.debug_frame) - .debug_frame 0x00000000 0xd4 obj/default/hello_world_small.o - .debug_frame 0x000000d4 0x30 obj/default/hex_encoder.o - .debug_frame 0x00000104 0x5c obj/default/hex_out.o - .debug_frame 0x00000160 0x44 obj/default/input_int.o - .debug_frame 0x000001a4 0xf0 obj/default/inst_decoder.o - .debug_frame 0x00000294 0x78 obj/default/sys_memory.o - .debug_frame 0x0000030c 0x20 obj/default/sys_register.o - .debug_frame 0x0000032c 0x28 obj/default/system.o - .debug_frame 0x00000354 0x70 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-divmod.o) - .debug_frame 0x000003c4 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-mul.o) - .debug_frame 0x000003e4 0x40 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-sprintf.o) - .debug_frame 0x00000424 0x64 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-vfprintf.o) - .debug_frame 0x00000488 0x2c c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-fvwrite_small_str.o) - .debug_frame 0x000004b4 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-memmove.o) - .debug_frame 0x000004d4 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-strlen.o) - .debug_frame 0x000004f4 0x38 ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_load.o) - .debug_frame 0x0000052c 0x28 ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_main.o) - .debug_frame 0x00000554 0x38 ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_sys_init.o) - .debug_frame 0x0000058c 0x20 ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .debug_frame 0x000005ac 0x20 ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .debug_frame 0x000005cc 0x20 ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - -.debug_str 0x00000000 0x1151 - *(.debug_str) - .debug_str 0x00000000 0x152 obj/default/hello_world_small.o - 0x1b3 (size before relaxing) - .debug_str 0x00000152 0x42 obj/default/hex_encoder.o - 0x9f (size before relaxing) - .debug_str 0x00000194 0x54 obj/default/hex_out.o - 0xd5 (size before relaxing) - .debug_str 0x000001e8 0xe2 obj/default/input_int.o - 0x193 (size before relaxing) - .debug_str 0x000002ca 0x107 obj/default/inst_decoder.o - 0x226 (size before relaxing) - .debug_str 0x000003d1 0x51 obj/default/sys_memory.o - 0x1a6 (size before relaxing) - .debug_str 0x00000422 0x1e obj/default/sys_register.o - 0x9e (size before relaxing) - .debug_str 0x00000440 0xf obj/default/system.o - 0x67 (size before relaxing) - .debug_str 0x0000044f 0x10b c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-divmod.o) - 0x1b4 (size before relaxing) - .debug_str 0x0000055a 0x37 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-mul.o) - 0x175 (size before relaxing) - .debug_str 0x00000591 0xea c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-ctype_.o) - 0x119 (size before relaxing) - .debug_str 0x0000067b 0x3d8 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-sprintf.o) - 0x499 (size before relaxing) - .debug_str 0x00000a53 0x162 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-vfprintf.o) - 0x5af (size before relaxing) - .debug_str 0x00000bb5 0x5d c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-fvwrite_small_str.o) - 0x487 (size before relaxing) - .debug_str 0x00000c12 0xf8 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-impure.o) - 0x45d (size before relaxing) - .debug_str 0x00000d0a 0x104 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-memmove.o) - 0x199 (size before relaxing) - .debug_str 0x00000e0e 0x45 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-strlen.o) - 0x184 (size before relaxing) - .debug_str 0x00000e53 0x141 ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_load.o) - 0x1d6 (size before relaxing) - .debug_str 0x00000f94 0x70 ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_main.o) - 0x15a (size before relaxing) - .debug_str 0x00001004 0xaa ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_sys_init.o) - 0x1cd (size before relaxing) - .debug_str 0x000010ae 0x34 ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - 0x119 (size before relaxing) - .debug_str 0x000010e2 0x34 ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - 0x119 (size before relaxing) - .debug_str 0x00001116 0x3b ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - 0x120 (size before relaxing) - -.debug_loc 0x00000000 0x1783 - *(.debug_loc) - .debug_loc 0x00000000 0x161 obj/default/hello_world_small.o - .debug_loc 0x00000161 0x3b9 obj/default/hex_encoder.o - .debug_loc 0x0000051a 0x24c obj/default/hex_out.o - .debug_loc 0x00000766 0x52 obj/default/input_int.o - .debug_loc 0x000007b8 0x192 obj/default/inst_decoder.o - .debug_loc 0x0000094a 0x105 obj/default/sys_memory.o - .debug_loc 0x00000a4f 0x1f obj/default/system.o - .debug_loc 0x00000a6e 0x1d2 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-divmod.o) - .debug_loc 0x00000c40 0x4f c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-mul.o) - .debug_loc 0x00000c8f 0xbe c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-sprintf.o) - .debug_loc 0x00000d4d 0x878 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-vfprintf.o) - .debug_loc 0x000015c5 0xe1 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-fvwrite_small_str.o) - .debug_loc 0x000016a6 0x4f c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-memmove.o) - .debug_loc 0x000016f5 0x1e c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-strlen.o) - .debug_loc 0x00001713 0x1f ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_load.o) - .debug_loc 0x00001732 0x1f ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_main.o) - .debug_loc 0x00001751 0x32 ../qsys_tutorial_lcd_bsp/\libhal_bsp.a(alt_sys_init.o) - -.debug_macinfo - *(.debug_macinfo) - -.debug_weaknames - *(.debug_weaknames) - -.debug_funcnames - *(.debug_funcnames) - -.debug_typenames - *(.debug_typenames) - -.debug_varnames - *(.debug_varnames) - -.debug_alt_sim_info - 0x00000000 0x10 - *(.debug_alt_sim_info) - .debug_alt_sim_info - 0x00000000 0x10 ../qsys_tutorial_lcd_bsp//obj/HAL/src/crt0.o - 0x00004000 __alt_data_end = 0x4000 - 0x00004000 PROVIDE (__alt_stack_pointer, __alt_data_end) - 0x00002360 PROVIDE (__alt_stack_limit, __alt_stack_base) - 0x00002360 PROVIDE (__alt_heap_start, end) - 0x00004000 PROVIDE (__alt_heap_limit, 0x4000) -OUTPUT(qsys_tutorial_lcd.elf elf32-littlenios2) - -.debug_ranges 0x00000000 0x190 - .debug_ranges 0x00000000 0x20 ../qsys_tutorial_lcd_bsp//obj/HAL/src/crt0.o - .debug_ranges 0x00000020 0x18 obj/default/hello_world_small.o - .debug_ranges 0x00000038 0x140 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-vfprintf.o) - .debug_ranges 0x00000178 0x18 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-fvwrite_small_str.o) diff --git a/software/qsys_tutorial_lcd/qsys_tutorial_lcd.objdump b/software/qsys_tutorial_lcd/qsys_tutorial_lcd.objdump deleted file mode 100644 index 9b0be08..0000000 --- a/software/qsys_tutorial_lcd/qsys_tutorial_lcd.objdump +++ /dev/null @@ -1,3491 +0,0 @@ - -qsys_tutorial_lcd.elf: file format elf32-littlenios2 -qsys_tutorial_lcd.elf -architecture: nios2, flags 0x00000112: -EXEC_P, HAS_SYMS, D_PAGED -start address 0x00000020 - -Program Header: - LOAD off 0x00001000 vaddr 0x00000000 paddr 0x00000000 align 2**12 - filesz 0x00000020 memsz 0x00000020 flags r-x - LOAD off 0x00001020 vaddr 0x00000020 paddr 0x00000020 align 2**12 - filesz 0x00001fec memsz 0x00001fec flags r-x - LOAD off 0x0000300c vaddr 0x0000200c paddr 0x000020fc align 2**12 - filesz 0x000000f0 memsz 0x000000f0 flags rw- - LOAD off 0x000031ec vaddr 0x000021ec paddr 0x000021ec align 2**12 - filesz 0x00000000 memsz 0x00000174 flags rw- - -Sections: -Idx Name Size VMA LMA File off Algn - 0 .entry 00000020 00000000 00000000 00001000 2**5 - CONTENTS, ALLOC, LOAD, READONLY, CODE - 1 .text 00001d1c 00000020 00000020 00001020 2**2 - CONTENTS, ALLOC, LOAD, READONLY, CODE - 2 .rodata 000002d0 00001d3c 00001d3c 00002d3c 2**2 - CONTENTS, ALLOC, LOAD, READONLY, DATA - 3 .rwdata 000000f0 0000200c 000020fc 0000300c 2**2 - CONTENTS, ALLOC, LOAD, DATA, SMALL_DATA - 4 .bss 00000174 000021ec 000021ec 000031ec 2**2 - ALLOC, SMALL_DATA - 5 .comment 00000026 00000000 00000000 000030fc 2**0 - CONTENTS, READONLY - 6 .debug_aranges 000002c8 00000000 00000000 00003128 2**3 - CONTENTS, READONLY, DEBUGGING - 7 .debug_pubnames 000005b9 00000000 00000000 000033f0 2**0 - CONTENTS, READONLY, DEBUGGING - 8 .debug_info 000039d5 00000000 00000000 000039a9 2**0 - CONTENTS, READONLY, DEBUGGING - 9 .debug_abbrev 000013f4 00000000 00000000 0000737e 2**0 - CONTENTS, READONLY, DEBUGGING - 10 .debug_line 0000374c 00000000 00000000 00008772 2**0 - CONTENTS, READONLY, DEBUGGING - 11 .debug_frame 000005ec 00000000 00000000 0000bec0 2**2 - CONTENTS, READONLY, DEBUGGING - 12 .debug_str 00001151 00000000 00000000 0000c4ac 2**0 - CONTENTS, READONLY, DEBUGGING - 13 .debug_loc 00001783 00000000 00000000 0000d5fd 2**0 - CONTENTS, READONLY, DEBUGGING - 14 .debug_alt_sim_info 00000010 00000000 00000000 0000ed80 2**2 - CONTENTS, READONLY, DEBUGGING - 15 .debug_ranges 00000190 00000000 00000000 0000ed90 2**3 - CONTENTS, READONLY, DEBUGGING - 16 .thread_model 00000003 00000000 00000000 000103ea 2**0 - CONTENTS, READONLY - 17 .cpu 0000000f 00000000 00000000 000103ed 2**0 - CONTENTS, READONLY - 18 .qsys 00000001 00000000 00000000 000103fc 2**0 - CONTENTS, READONLY - 19 .simulation_enabled 00000001 00000000 00000000 000103fd 2**0 - CONTENTS, READONLY - 20 .stderr_dev 00000009 00000000 00000000 000103fe 2**0 - CONTENTS, READONLY - 21 .stdin_dev 00000009 00000000 00000000 00010407 2**0 - CONTENTS, READONLY - 22 .stdout_dev 00000009 00000000 00000000 00010410 2**0 - CONTENTS, READONLY - 23 .sopc_system_name 0000000b 00000000 00000000 00010419 2**0 - CONTENTS, READONLY - 24 .quartus_project_dir 00000030 00000000 00000000 00010424 2**0 - CONTENTS, READONLY - 25 .sopcinfo 00084495 00000000 00000000 00010454 2**0 - CONTENTS, READONLY -SYMBOL TABLE: -00000000 l d .entry 00000000 .entry -00000020 l d .text 00000000 .text -00001d3c l d .rodata 00000000 .rodata -0000200c l d .rwdata 00000000 .rwdata -000021ec l d .bss 00000000 .bss -00000000 l d .comment 00000000 .comment -00000000 l d .debug_aranges 00000000 .debug_aranges -00000000 l d .debug_pubnames 00000000 .debug_pubnames -00000000 l d .debug_info 00000000 .debug_info -00000000 l d .debug_abbrev 00000000 .debug_abbrev -00000000 l d .debug_line 00000000 .debug_line -00000000 l d .debug_frame 00000000 .debug_frame -00000000 l d .debug_str 00000000 .debug_str -00000000 l d .debug_loc 00000000 .debug_loc -00000000 l d .debug_alt_sim_info 00000000 .debug_alt_sim_info -00000000 l d .debug_ranges 00000000 .debug_ranges -00000058 l .text 00000000 alt_after_alt_main -00000000 l df *ABS* 00000000 hello_world_small.c -00000000 l df *ABS* 00000000 hex_encoder.c -00000000 l df *ABS* 00000000 hex_out.c -00000000 l df *ABS* 00000000 input_int.c -000021fc l O .bss 00000001 status.1396 -000021f8 l O .bss 00000004 event_code.1397 -00000000 l df *ABS* 00000000 inst_decoder.c -00000000 l df *ABS* 00000000 sys_memory.c -00002210 l O .bss 00000040 memory -00002250 l O .bss 00000100 inst_memory -00000000 l df *ABS* 00000000 sys_register.c -00000000 l df *ABS* 00000000 system.c -00000000 l df *ABS* 00000000 lib2-divmod.c -00001160 l F .text 0000007c udivmodsi4 -00000000 l df *ABS* 00000000 lib2-mul.c -00000000 l df *ABS* 00000000 ctype_.c -00001e89 l O .rodata 00000180 _ctype_b -00000000 l df *ABS* 00000000 sprintf.c -00000000 l df *ABS* 00000000 vfprintf.c -000013d8 l F .text 00000080 print_repeat -00000000 l df *ABS* 00000000 fvwrite_small_str.c -00000000 l df *ABS* 00000000 impure.c -0000200c l O .rwdata 000000e0 impure_data -00000000 l df *ABS* 00000000 memmove.c -00000000 l df *ABS* 00000000 strlen.c -00000000 l df *ABS* 00000000 alt_load.c -00001c50 l F .text 00000020 alt_load_section -00000000 l df *ABS* 00000000 alt_main.c -00000000 l df *ABS* 00000000 alt_sys_init.c -00000000 l df *ABS* 00000000 alt_dcache_flush_all.c -00000000 l df *ABS* 00000000 alt_icache_flush_all.c -00000000 l df *ABS* 00000000 altera_nios2_qsys_irq.c -00000cf4 g F .text 00000010 inst_load -00001cdc g F .text 0000002c alt_main -000020fc g *ABS* 00000000 __flash_rwdata_start -000008f8 g F .text 00000050 clear_block -000002a0 g F .text 000000a4 store_value -00000be4 g F .text 00000020 inst_add -00000cb8 g F .text 0000002c inst_jine -00001bd0 g F .text 00000060 memmove -000020f8 g O .rwdata 00000004 jtag_uart -00001b18 g F .text 000000b8 __sfvwrite_small_str -00000000 g F .entry 0000000c __reset -00000020 g *ABS* 00000000 __flash_exceptions_start -00002208 g O .bss 00000004 alt_argv -0000a0ec g *ABS* 00000000 _gp -00000bc4 g F .text 0000001c inst_jump -00000130 g F .text 000000a0 run_proc -0000129c g F .text 00000008 __udivsi3 -00000c8c g F .text 0000002c inst_jieq -00000d04 g F .text 0000004c inst_output -000010a8 g F .text 00000070 memory_store -000020f4 g O .rwdata 00000004 _global_impure_ptr -00002360 g *ABS* 00000000 __bss_end -000021ec g O .bss 00000005 stack -000020ec g O .rwdata 00000004 __ctype_ptr -00000d50 g F .text 00000038 inst_fetch -00001d2c g F .text 00000004 alt_dcache_flush_all -00002350 g O .bss 0000000f global_registers -00000c3c g F .text 00000028 inst_jeq -000020fc g *ABS* 00000000 __ram_rwdata_end -00000000 g *ABS* 00000000 __alt_mem_onchip_memory -0000200c g *ABS* 00000000 __ram_rodata_end -000012a4 g F .text 00000008 __umodsi3 -00002360 g *ABS* 00000000 end -00004000 g *ABS* 00000000 __alt_stack_pointer -00001458 g F .text 0000069c ___vfprintf_internal_r -00001368 g F .text 00000070 _sprintf_r -0000005c g F .text 0000003c wait -00000948 g F .text 000000fc print_number -00000020 g F .text 0000003c _start -0000081c g F .text 000000dc print_block -00001d08 g F .text 00000004 alt_sys_init -000012ac g F .text 00000038 __mulsi3 -0000200c g *ABS* 00000000 __ram_rwdata_start -00001d3c g *ABS* 00000000 __ram_rodata_start -00001134 g F .text 0000002c panic -00002360 g *ABS* 00000000 __alt_stack_base -00000be0 g F .text 00000004 inst_delay -00000ce4 g F .text 00000010 inst_store -00000344 g F .text 000000a4 init -000021ec g *ABS* 00000000 __bss_start -000003e8 g F .text 0000007c main -0000220c g O .bss 00000004 alt_envp -00000464 g F .text 00000124 encodeNumHex -00000bc0 g F .text 00000004 in_int -000011dc g F .text 00000060 __divsi3 -00001d3c g *ABS* 00000000 __flash_rodata_start -00001d0c g F .text 00000020 alt_irq_init -000012e4 g F .text 00000084 sprintf -00000098 g F .text 00000098 print_change_memory -00000a84 g F .text 0000013c push_int -000020f0 g O .rwdata 00000004 _impure_ptr -00002204 g O .bss 00000004 alt_argc -00002200 g O .bss 00000004 global_current_memory -00000020 g *ABS* 00000000 __ram_exceptions_start -00000588 g F .text 00000294 encodeLatHex -000020fc g *ABS* 00000000 _edata -00002360 g *ABS* 00000000 _end -00000020 g *ABS* 00000000 __ram_exceptions_end -00000ef8 g F .text 00000044 memory_init -00001d34 g F .text 00000008 altera_nios2_qsys_irq_init -0000000c g .entry 00000000 exit -00001038 g F .text 00000070 memory_load -0000123c g F .text 00000060 __modsi3 -00004000 g *ABS* 00000000 __alt_data_end -00000d88 g F .text 00000170 inst_decode -00001d88 g O .rodata 00000101 _ctype_ -00000c04 g F .text 00000038 inst_comp -00001118 g F .text 0000001c registers_init -0000000c g .entry 00000000 _exit -00000c64 g F .text 00000028 inst_jne -00001c30 g F .text 00000020 strlen -000001d0 g F .text 000000d0 store_inst -00001d30 g F .text 00000004 alt_icache_flush_all -00001af4 g F .text 00000024 __vfprintf_internal -00000f3c g F .text 00000080 inst_memory_store -00000a44 g F .text 00000040 push_decode -00001c70 g F .text 0000006c alt_load -000021f4 g O .bss 00000001 PUSH_EVENT -00000fbc g F .text 0000007c inst_memory_load - - - -Disassembly of section .entry: - -00000000 <__reset>: - * Jump to the _start entry point in the .text section if reset code - * is allowed or if optimizing for RTL simulation. - */ -#if defined(ALT_ALLOW_CODE_AT_RESET) || defined(ALT_SIM_OPTIMIZE) - /* Jump to the _start entry point in the .text section. */ - movhi r1, %hi(_start) - 0: 00400034 movhi at,0 - ori r1, r1, %lo(_start) - 4: 08400814 ori at,at,32 - jmp r1 - 8: 0800683a jmp at - -0000000c <_exit>: - ... - -Disassembly of section .text: - -00000020 <_start>: -#if (NIOS2_NUM_OF_SHADOW_REG_SETS == 0) - /* - * Now that the caches are initialized, set up the stack pointer. - * The value provided by the linker is assumed to be correctly aligned. - */ - movhi sp, %hi(__alt_stack_pointer) - 20: 06c00034 movhi sp,0 - ori sp, sp, %lo(__alt_stack_pointer) - 24: ded00014 ori sp,sp,16384 - - /* Set up the global pointer. */ - movhi gp, %hi(_gp) - 28: 06800034 movhi gp,0 - ori gp, gp, %lo(_gp) - 2c: d6a83b14 ori gp,gp,41196 - */ -#ifndef ALT_SIM_OPTIMIZE - /* Log that the BSS is about to be cleared. */ - ALT_LOG_PUTS(alt_log_msg_bss) - - movhi r2, %hi(__bss_start) - 30: 00800034 movhi r2,0 - ori r2, r2, %lo(__bss_start) - 34: 10887b14 ori r2,r2,8684 - - movhi r3, %hi(__bss_end) - 38: 00c00034 movhi r3,0 - ori r3, r3, %lo(__bss_end) - 3c: 18c8d814 ori r3,r3,9056 - - beq r2, r3, 1f - 40: 10c00326 beq r2,r3,50 <_start+0x30> - -0: - stw zero, (r2) - 44: 10000015 stw zero,0(r2) - addi r2, r2, 4 - 48: 10800104 addi r2,r2,4 - bltu r2, r3, 0b - 4c: 10fffd36 bltu r2,r3,44 <_start+0x24> - * section aren't defined until alt_load() has been called). - */ - mov et, zero -#endif - - call alt_load - 50: 0001c700 call 1c70 - - /* Log that alt_main is about to be called. */ - ALT_LOG_PUTS(alt_log_msg_alt_main) - - /* Call the C entry point. It should never return. */ - call alt_main - 54: 0001cdc0 call 1cdc - -00000058 : - - /* Wait in infinite loop in case alt_main does return. */ -alt_after_alt_main: - br alt_after_alt_main - 58: 003fff06 br 58 - -0000005c : - -#define ledrs (volatile int *) 0x00050a0 - -#define T_MS10 12500 //(10ms) - -void wait(unsigned int s) { - 5c: defffe04 addi sp,sp,-8 - volatile i; - for (i = 0; i < T_MS10*s; i++); - 60: 014c3504 movi r5,12500 - -#define ledrs (volatile int *) 0x00050a0 - -#define T_MS10 12500 //(10ms) - -void wait(unsigned int s) { - 64: dfc00115 stw ra,4(sp) - volatile i; - for (i = 0; i < T_MS10*s; i++); - 68: d8000015 stw zero,0(sp) - 6c: 00012ac0 call 12ac <__mulsi3> - 70: 1007883a mov r3,r2 - 74: 00000306 br 84 - 78: d8800017 ldw r2,0(sp) - 7c: 10800044 addi r2,r2,1 - 80: d8800015 stw r2,0(sp) - 84: d8800017 ldw r2,0(sp) - 88: 10fffb36 bltu r2,r3,78 -} - 8c: dfc00117 ldw ra,4(sp) - 90: dec00204 addi sp,sp,8 - 94: f800283a ret - -00000098 : - }while( inst_rec.inst != INST_END ); - - //print_block(" end", 4, HEX0_3); -} - -void print_change_memory(unsigned int current_memory) { - 98: defffb04 addi sp,sp,-20 - 9c: 200d883a mov r6,r4 - char buf[5]; - sprintf(buf, "g %2d", current_memory); - a0: 01400034 movhi r5,0 - a4: 29474f04 addi r5,r5,7484 - a8: d809883a mov r4,sp - }while( inst_rec.inst != INST_END ); - - //print_block(" end", 4, HEX0_3); -} - -void print_change_memory(unsigned int current_memory) { - ac: dfc00415 stw ra,16(sp) - b0: dc400315 stw r17,12(sp) - b4: dc000215 stw r16,8(sp) - char buf[5]; - sprintf(buf, "g %2d", current_memory); - print_block(buf, 4, HEX0_3); - print_block("an", 2, HEX4_5); - b8: 04400044 movi r17,1 - //print_block(" end", 4, HEX0_3); -} - -void print_change_memory(unsigned int current_memory) { - char buf[5]; - sprintf(buf, "g %2d", current_memory); - bc: 00012e40 call 12e4 - print_block(buf, 4, HEX0_3); - print_block("an", 2, HEX4_5); - c0: 04000084 movi r16,2 -} - -void print_change_memory(unsigned int current_memory) { - char buf[5]; - sprintf(buf, "g %2d", current_memory); - print_block(buf, 4, HEX0_3); - c4: d809883a mov r4,sp - c8: 01400104 movi r5,4 - cc: 000d883a mov r6,zero - d0: 000081c0 call 81c - print_block("an", 2, HEX4_5); - d4: 800b883a mov r5,r16 - d8: 880d883a mov r6,r17 - dc: 01000034 movhi r4,0 - e0: 21075104 addi r4,r4,7492 - e4: 000081c0 call 81c - print_block("ch", 2, HEX6_7); - e8: 800b883a mov r5,r16 - ec: 800d883a mov r6,r16 - f0: 01000034 movhi r4,0 - f4: 21075204 addi r4,r4,7496 - f8: 000081c0 call 81c - wait(200); - fc: 01003204 movi r4,200 - 100: 000005c0 call 5c - clear_block(HEX0_3); clear_block(HEX4_5); clear_block(HEX6_7); - 104: 0009883a mov r4,zero - 108: 00008f80 call 8f8 - 10c: 8809883a mov r4,r17 - 110: 00008f80 call 8f8 - 114: 8009883a mov r4,r16 - 118: 00008f80 call 8f8 -} - 11c: dfc00417 ldw ra,16(sp) - 120: dc400317 ldw r17,12(sp) - 124: dc000217 ldw r16,8(sp) - 128: dec00504 addi sp,sp,20 - 12c: f800283a ret - -00000130 : - print_block(buf, 4, HEX0_3); - sprintf(buf, "%02x", global_registers[Spc]); - print_block(buf, 2, HEX4_5); - } -} -void run_proc() { - 130: defffa04 addi sp,sp,-24 - 134: dfc00515 stw ra,20(sp) - 138: dc400415 stw r17,16(sp) - 13c: dc000315 stw r16,12(sp) - volatile struct InstRec inst_rec; - - //print_block(" go ", 4, HEX0_3); - - global_registers[Spc] = 0; - print_block("pc", 2, HEX6_7); - 140: 01400084 movi r5,2 -void run_proc() { - volatile struct InstRec inst_rec; - - //print_block(" go ", 4, HEX0_3); - - global_registers[Spc] = 0; - 144: 00800034 movhi r2,0 - 148: 1088d404 addi r2,r2,9040 - print_block("pc", 2, HEX6_7); - 14c: 01000034 movhi r4,0 - 150: 21075304 addi r4,r4,7500 - 154: 280d883a mov r6,r5 -void run_proc() { - volatile struct InstRec inst_rec; - - //print_block(" go ", 4, HEX0_3); - - global_registers[Spc] = 0; - 158: 10000045 stb zero,1(r2) - print_block("pc", 2, HEX6_7); - 15c: 000081c0 call 81c - do { - // pc�\�� - { - char buf[5]; - sprintf(buf, "%02x", global_registers[Spc]); - 160: 04400034 movhi r17,0 - 164: 8c48d404 addi r17,r17,9040 - 168: 89800047 ldb r6,1(r17) - 16c: dc000104 addi r16,sp,4 - 170: 01400034 movhi r5,0 - 174: 29475404 addi r5,r5,7504 - 178: 8009883a mov r4,r16 - 17c: 00012e40 call 12e4 - print_block(buf, 2, HEX4_5); - 180: 8009883a mov r4,r16 - 184: 01400084 movi r5,2 - 188: 01800044 movi r6,1 - 18c: 000081c0 call 81c - } - // ���߃t�F�b�` - inst_rec = inst_fetch(); - 190: 0000d500 call d50 - 194: d8800015 stw r2,0(sp) - // ���߃f�R�[�h���s - inst_decode(inst_rec); - 198: d9000017 ldw r4,0(sp) - 19c: 0000d880 call d88 - if ( global_registers[Ssw_run] ) wait(100); - 1a0: 88800347 ldb r2,13(r17) - 1a4: 01001904 movi r4,100 - 1a8: 10000126 beq r2,zero,1b0 - 1ac: 000005c0 call 5c - }while( inst_rec.inst != INST_END ); - 1b0: d8800017 ldw r2,0(sp) - 1b4: 108003cc andi r2,r2,15 - 1b8: 103fe91e bne r2,zero,160 - - //print_block(" end", 4, HEX0_3); -} - 1bc: dfc00517 ldw ra,20(sp) - 1c0: dc400417 ldw r17,16(sp) - 1c4: dc000317 ldw r16,12(sp) - 1c8: dec00604 addi sp,sp,24 - 1cc: f800283a ret - -000001d0 : - print_block(buf, 2, HEX6_7); - print_block("--", 2, HEX4_5); - sprintf(buf, "%04d", global_registers[Ssw_data]); - print_block(buf, 4, HEX0_3); -} -void store_inst(){ - 1d0: defffb04 addi sp,sp,-20 - 1d4: dc000215 stw r16,8(sp) - char reg_index; - struct InstRec inst_rec; - - // �K�v�ȏ��̎擾 - inst = global_registers[Ssw_inst]; - mem_index = global_registers[Ssw_memi]; - 1d8: 04000034 movhi r16,0 - 1dc: 8408d404 addi r16,r16,9040 - reg_index = global_registers[Ssw_regi]; - inst_rec.inst = (unsigned int)inst; - inst_rec.memi = (unsigned int)mem_index; - 1e0: 80c00283 ldbu r3,10(r16) - print_block(buf, 2, HEX6_7); - print_block("--", 2, HEX4_5); - sprintf(buf, "%04d", global_registers[Ssw_data]); - print_block(buf, 4, HEX0_3); -} -void store_inst(){ - 1e4: dc400315 stw r17,12(sp) - - // �K�v�ȏ��̎擾 - inst = global_registers[Ssw_inst]; - mem_index = global_registers[Ssw_memi]; - reg_index = global_registers[Ssw_regi]; - inst_rec.inst = (unsigned int)inst; - 1e8: 84400203 ldbu r17,8(r16) - 1ec: 008003c4 movi r2,15 - inst_rec.memi = (unsigned int)mem_index; - inst_rec.regi = (unsigned int)reg_index; - 1f0: 81800243 ldbu r6,9(r16) - // �K�v�ȏ��̎擾 - inst = global_registers[Ssw_inst]; - mem_index = global_registers[Ssw_memi]; - reg_index = global_registers[Ssw_regi]; - inst_rec.inst = (unsigned int)inst; - inst_rec.memi = (unsigned int)mem_index; - 1f4: 1886703a and r3,r3,r2 - - // �K�v�ȏ��̎擾 - inst = global_registers[Ssw_inst]; - mem_index = global_registers[Ssw_memi]; - reg_index = global_registers[Ssw_regi]; - inst_rec.inst = (unsigned int)inst; - 1f8: 017ffc04 movi r5,-16 - inst_rec.memi = (unsigned int)mem_index; - 1fc: 1806913a slli r3,r3,4 - - // �K�v�ȏ��̎擾 - inst = global_registers[Ssw_inst]; - mem_index = global_registers[Ssw_memi]; - reg_index = global_registers[Ssw_regi]; - inst_rec.inst = (unsigned int)inst; - 200: 88a2703a and r17,r17,r2 - 204: 294a703a and r5,r5,r5 - inst_rec.memi = (unsigned int)mem_index; - inst_rec.regi = (unsigned int)reg_index; - 208: 308c703a and r6,r6,r2 - - // �K�v�ȏ��̎擾 - inst = global_registers[Ssw_inst]; - mem_index = global_registers[Ssw_memi]; - reg_index = global_registers[Ssw_regi]; - inst_rec.inst = (unsigned int)inst; - 20c: 894ab03a or r5,r17,r5 - inst_rec.memi = (unsigned int)mem_index; - 210: 00bfc3c4 movi r2,-241 - inst_rec.regi = (unsigned int)reg_index; - 214: 300c923a slli r6,r6,8 - // �K�v�ȏ��̎擾 - inst = global_registers[Ssw_inst]; - mem_index = global_registers[Ssw_memi]; - reg_index = global_registers[Ssw_regi]; - inst_rec.inst = (unsigned int)inst; - inst_rec.memi = (unsigned int)mem_index; - 218: 288a703a and r5,r5,r2 - 21c: 28cab03a or r5,r5,r3 - inst_rec.regi = (unsigned int)reg_index; - - // �X�g�A���� - inst_memory_store((unsigned int)global_registers[Spc], inst_rec); - 220: 81000047 ldb r4,1(r16) - inst = global_registers[Ssw_inst]; - mem_index = global_registers[Ssw_memi]; - reg_index = global_registers[Ssw_regi]; - inst_rec.inst = (unsigned int)inst; - inst_rec.memi = (unsigned int)mem_index; - inst_rec.regi = (unsigned int)reg_index; - 224: 00bc3fc4 movi r2,-3841 - 228: 288a703a and r5,r5,r2 - - // �X�g�A���� - inst_memory_store((unsigned int)global_registers[Spc], inst_rec); - 22c: 298ab03a or r5,r5,r6 - print_block(buf, 2, HEX6_7); - print_block("--", 2, HEX4_5); - sprintf(buf, "%04d", global_registers[Ssw_data]); - print_block(buf, 4, HEX0_3); -} -void store_inst(){ - 230: dfc00415 stw ra,16(sp) - inst_rec.inst = (unsigned int)inst; - inst_rec.memi = (unsigned int)mem_index; - inst_rec.regi = (unsigned int)reg_index; - - // �X�g�A���� - inst_memory_store((unsigned int)global_registers[Spc], inst_rec); - 234: 0000f3c0 call f3c - global_registers[Spc]++; - 238: 80800043 ldbu r2,1(r16) - - { - char buf[5]; - sprintf(buf, "%04d", inst_rec.inst); - 23c: 880d883a mov r6,r17 - 240: d809883a mov r4,sp - 244: 01400034 movhi r5,0 - 248: 29475604 addi r5,r5,7512 - inst_rec.memi = (unsigned int)mem_index; - inst_rec.regi = (unsigned int)reg_index; - - // �X�g�A���� - inst_memory_store((unsigned int)global_registers[Spc], inst_rec); - global_registers[Spc]++; - 24c: 10800044 addi r2,r2,1 - 250: 80800045 stb r2,1(r16) - - { - char buf[5]; - sprintf(buf, "%04d", inst_rec.inst); - 254: 00012e40 call 12e4 - print_block(buf, 4, HEX0_3); - 258: d809883a mov r4,sp - 25c: 01400104 movi r5,4 - 260: 000d883a mov r6,zero - 264: 000081c0 call 81c - sprintf(buf, "%02x", global_registers[Spc]); - 268: 81800047 ldb r6,1(r16) - 26c: d809883a mov r4,sp - 270: 01400034 movhi r5,0 - 274: 29475404 addi r5,r5,7504 - 278: 00012e40 call 12e4 - print_block(buf, 2, HEX4_5); - 27c: d809883a mov r4,sp - 280: 01400084 movi r5,2 - 284: 01800044 movi r6,1 - 288: 000081c0 call 81c - } -} - 28c: dfc00417 ldw ra,16(sp) - 290: dc400317 ldw r17,12(sp) - 294: dc000217 ldw r16,8(sp) - 298: dec00504 addi sp,sp,20 - 29c: f800283a ret - -000002a0 : - clear_block(HEX0_3); clear_block(HEX4_5); clear_block(HEX6_7); -} - -char stack[5]; - -void store_value(){ - 2a0: defffa04 addi sp,sp,-24 - 2a4: dc800415 stw r18,16(sp) - char buf[5]; - unsigned int memi = global_registers[Ssw_memi]; - 2a8: 04800034 movhi r18,0 - 2ac: 9488d404 addi r18,r18,9040 - clear_block(HEX0_3); clear_block(HEX4_5); clear_block(HEX6_7); -} - -char stack[5]; - -void store_value(){ - 2b0: dc400315 stw r17,12(sp) - char buf[5]; - unsigned int memi = global_registers[Ssw_memi]; - 2b4: 94400287 ldb r17,10(r18) - memory_store(memi, Ssw_data); - 2b8: 014001c4 movi r5,7 - clear_block(HEX0_3); clear_block(HEX4_5); clear_block(HEX6_7); -} - -char stack[5]; - -void store_value(){ - 2bc: dfc00515 stw ra,20(sp) - char buf[5]; - unsigned int memi = global_registers[Ssw_memi]; - memory_store(memi, Ssw_data); - 2c0: 8809883a mov r4,r17 - clear_block(HEX0_3); clear_block(HEX4_5); clear_block(HEX6_7); -} - -char stack[5]; - -void store_value(){ - 2c4: dc000215 stw r16,8(sp) - char buf[5]; - unsigned int memi = global_registers[Ssw_memi]; - memory_store(memi, Ssw_data); - 2c8: 00010a80 call 10a8 - sprintf(buf, "%02x", (unsigned char)memi); - print_block(buf, 2, HEX6_7); - 2cc: 04000084 movi r16,2 - -void store_value(){ - char buf[5]; - unsigned int memi = global_registers[Ssw_memi]; - memory_store(memi, Ssw_data); - sprintf(buf, "%02x", (unsigned char)memi); - 2d0: d809883a mov r4,sp - 2d4: 89803fcc andi r6,r17,255 - 2d8: 01400034 movhi r5,0 - 2dc: 29475404 addi r5,r5,7504 - 2e0: 00012e40 call 12e4 - print_block(buf, 2, HEX6_7); - 2e4: d809883a mov r4,sp - 2e8: 800b883a mov r5,r16 - 2ec: 800d883a mov r6,r16 - 2f0: 000081c0 call 81c - print_block("--", 2, HEX4_5); - 2f4: 800b883a mov r5,r16 - 2f8: 01800044 movi r6,1 - 2fc: 01000034 movhi r4,0 - 300: 21075804 addi r4,r4,7520 - 304: 000081c0 call 81c - sprintf(buf, "%04d", global_registers[Ssw_data]); - 308: 918001c7 ldb r6,7(r18) - 30c: d809883a mov r4,sp - 310: 01400034 movhi r5,0 - 314: 29475604 addi r5,r5,7512 - 318: 00012e40 call 12e4 - print_block(buf, 4, HEX0_3); - 31c: d809883a mov r4,sp - 320: 01400104 movi r5,4 - 324: 000d883a mov r6,zero - 328: 000081c0 call 81c -} - 32c: dfc00517 ldw ra,20(sp) - 330: dc800417 ldw r18,16(sp) - 334: dc400317 ldw r17,12(sp) - 338: dc000217 ldw r16,8(sp) - 33c: dec00604 addi sp,sp,24 - 340: f800283a ret - -00000344 : -void wait(unsigned int s) { - volatile i; - for (i = 0; i < T_MS10*s; i++); -} - -void init() { - 344: defffd04 addi sp,sp,-12 - 348: dfc00215 stw ra,8(sp) - 34c: dc400115 stw r17,4(sp) - 350: dc000015 stw r16,0(sp) - registers_init(); - 354: 00011180 call 1118 - memory_init(); - 358: 0000ef80 call ef8 - clear_block(HEX0_3); clear_block(HEX4_5); clear_block(HEX6_7); - 35c: 04400044 movi r17,1 - 360: 0009883a mov r4,zero - 364: 04000084 movi r16,2 - 368: 00008f80 call 8f8 - 36c: 8809883a mov r4,r17 - 370: 00008f80 call 8f8 - 374: 8009883a mov r4,r16 - 378: 00008f80 call 8f8 - print_block("he", 2, HEX6_7); - 37c: 800b883a mov r5,r16 - 380: 800d883a mov r6,r16 - 384: 01000034 movhi r4,0 - 388: 21075904 addi r4,r4,7524 - 38c: 000081c0 call 81c - print_block("lo", 2, HEX4_5); - 390: 800b883a mov r5,r16 - 394: 880d883a mov r6,r17 - 398: 01000034 movhi r4,0 - 39c: 21075a04 addi r4,r4,7528 - 3a0: 000081c0 call 81c - print_block("you1", 4, HEX0_3); - 3a4: 01400104 movi r5,4 - 3a8: 000d883a mov r6,zero - 3ac: 01000034 movhi r4,0 - 3b0: 21075b04 addi r4,r4,7532 - 3b4: 000081c0 call 81c - wait(200); - 3b8: 01003204 movi r4,200 - 3bc: 000005c0 call 5c - clear_block(HEX0_3); clear_block(HEX4_5); clear_block(HEX6_7); - 3c0: 0009883a mov r4,zero - 3c4: 00008f80 call 8f8 - 3c8: 8809883a mov r4,r17 - 3cc: 00008f80 call 8f8 - 3d0: 8009883a mov r4,r16 -} - 3d4: dfc00217 ldw ra,8(sp) - 3d8: dc400117 ldw r17,4(sp) - 3dc: dc000017 ldw r16,0(sp) - 3e0: dec00304 addi sp,sp,12 - clear_block(HEX0_3); clear_block(HEX4_5); clear_block(HEX6_7); - print_block("he", 2, HEX6_7); - print_block("lo", 2, HEX4_5); - print_block("you1", 4, HEX0_3); - wait(200); - clear_block(HEX0_3); clear_block(HEX4_5); clear_block(HEX6_7); - 3e4: 00008f81 jmpi 8f8 - -000003e8
: - wait(200); - clear_block(HEX0_3); clear_block(HEX4_5); clear_block(HEX6_7); -} - -int main() -{ - 3e8: defffe04 addi sp,sp,-8 - 3ec: dfc00115 stw ra,4(sp) - 3f0: dc000015 stw r16,0(sp) - init(); - 3f4: 00003440 call 344 - while(1) { - // interrupt - in_int(); - - // event - if (PUSH_EVENT == PUSH_VALSTR) { - 3f8: 04000034 movhi r16,0 - 3fc: 84087d04 addi r16,r16,8692 -int main() -{ - init(); - while(1) { - // interrupt - in_int(); - 400: 0000bc00 call bc0 - - // event - if (PUSH_EVENT == PUSH_VALSTR) { - 404: 80c00003 ldbu r3,0(r16) - 408: 00800084 movi r2,2 - 40c: 1880011e bne r3,r2,414 - // �l�̃X�g�A - store_value(); - 410: 00002a00 call 2a0 - } - if (PUSH_EVENT == PUSH_INSSTR) { - 414: 80c00003 ldbu r3,0(r16) - 418: 008000c4 movi r2,3 - 41c: 1880011e bne r3,r2,424 - // ���߂̃X�g�A - store_inst(); - 420: 00001d00 call 1d0 - } - if (PUSH_EVENT == PUSH_RUN) { - 424: 80c00003 ldbu r3,0(r16) - 428: 00800104 movi r2,4 - if (global_current_memory != (unsigned int)global_registers[Ssw_psel]) { - 42c: 01400034 movhi r5,0 - 430: 29488004 addi r5,r5,8704 - } - if (PUSH_EVENT == PUSH_INSSTR) { - // ���߂̃X�g�A - store_inst(); - } - if (PUSH_EVENT == PUSH_RUN) { - 434: 18bff01e bne r3,r2,3f8 - if (global_current_memory != (unsigned int)global_registers[Ssw_psel]) { - 438: 00800034 movhi r2,0 - 43c: 1088d404 addi r2,r2,9040 - 440: 10c002c7 ldb r3,11(r2) - 444: 28800017 ldw r2,0(r5) - global_current_memory = (unsigned int)global_registers[Ssw_psel]; - print_change_memory(global_current_memory); - 448: 1809883a mov r4,r3 - if (PUSH_EVENT == PUSH_INSSTR) { - // ���߂̃X�g�A - store_inst(); - } - if (PUSH_EVENT == PUSH_RUN) { - if (global_current_memory != (unsigned int)global_registers[Ssw_psel]) { - 44c: 10c00326 beq r2,r3,45c - global_current_memory = (unsigned int)global_registers[Ssw_psel]; - 450: 28c00015 stw r3,0(r5) - print_change_memory(global_current_memory); - 454: 00000980 call 98 - 458: 003fe706 br 3f8 - } - else { - // �v���O�������s - run_proc(); - 45c: 00001300 call 130 - 460: 003fe506 br 3f8 - -00000464 : -#include "hex_encoder.h" -#include - -void encodeNumHex(int hex_i, int num) { - char encoded = 0; - switch (num) { - 464: 00800244 movi r2,9 - 468: 11401336 bltu r2,r5,4b8 - 46c: 2945883a add r2,r5,r5 - 470: 1085883a add r2,r2,r2 - 474: 00c00034 movhi r3,0 - 478: 18c12204 addi r3,r3,1160 - 47c: 10c5883a add r2,r2,r3 - 480: 10800017 ldw r2,0(r2) - 484: 1000683a jmp r2 - 488: 000004c0 call 4c <_start+0x2c> - 48c: 000004c8 cmpgei zero,zero,19 - 490: 000004d0 cmplti zero,zero,19 - 494: 000004d8 cmpnei zero,zero,19 - 498: 000004e0 cmpeqi zero,zero,19 - 49c: 000004e8 cmpgeui zero,zero,19 - 4a0: 000004f0 cmpltui zero,zero,19 - 4a4: 000004f8 rdprs zero,zero,19 - 4a8: 000004b8 rdprs zero,zero,18 - 4ac: 000004b0 cmpltui zero,zero,18 - 4b0: 01400404 movi r5,16 - 4b4: 00001106 br 4fc - 4b8: 000b883a mov r5,zero - 4bc: 00000f06 br 4fc - 4c0: 01401004 movi r5,64 - 4c4: 00000d06 br 4fc - case 0: - encoded = (char)0x40; // 100 0000 - break; - 4c8: 017ffe44 movi r5,-7 - 4cc: 00000b06 br 4fc - case 1: - encoded = (char)0xF9; // 111 1001 - break; - 4d0: 01400904 movi r5,36 - 4d4: 00000906 br 4fc - case 2: - encoded = (char)0x24; // 010 0100 - break; - 4d8: 01400c04 movi r5,48 - 4dc: 00000706 br 4fc - case 3: - encoded = (char)0x30; // 011 0000 - break; - 4e0: 01400644 movi r5,25 - 4e4: 00000506 br 4fc - case 4: - encoded = (char)0x19; // 001 1001 - break; - 4e8: 01400484 movi r5,18 - 4ec: 00000306 br 4fc - case 5: - encoded = (char)0x12; // 001 0010 - break; - 4f0: 01400084 movi r5,2 - 4f4: 00000106 br 4fc - case 6: - encoded = (char)0x02; // 000 0010 - break; - 4f8: 01401604 movi r5,88 - default: - encoded = 0; - break; - } - - switch (hex_i) { - 4fc: 008001c4 movi r2,7 - 500: 11002036 bltu r2,r4,584 - 504: 2105883a add r2,r4,r4 - 508: 1085883a add r2,r2,r2 - 50c: 00c00034 movhi r3,0 - 510: 18c14804 addi r3,r3,1312 - 514: 10c5883a add r2,r2,r3 - 518: 10800017 ldw r2,0(r2) - 51c: 1000683a jmp r2 - 520: 00000540 call 54 <_start+0x34> - 524: 00000548 cmpgei zero,zero,21 - 528: 00000550 cmplti zero,zero,21 - 52c: 00000558 cmpnei zero,zero,21 - 530: 00000560 cmpeqi zero,zero,21 - 534: 00000568 cmpgeui zero,zero,21 - 538: 00000570 cmpltui zero,zero,21 - 53c: 0000057c xorhi zero,zero,21 - case 0: - *hex0 = encoded; - 540: 00941c04 movi r2,20592 - 544: 00000b06 br 574 - break; - case 1: - *hex1 = encoded; - 548: 00941804 movi r2,20576 - 54c: 00000906 br 574 - break; - case 2: - *hex2 = encoded; - 550: 00941404 movi r2,20560 - 554: 00000706 br 574 - break; - case 3: - *hex3 = encoded; - 558: 00941004 movi r2,20544 - 55c: 00000506 br 574 - break; - case 4: - *hex4 = encoded; - 560: 00940c04 movi r2,20528 - 564: 00000306 br 574 - break; - case 5: - *hex5 = encoded; - 568: 00940804 movi r2,20512 - 56c: 00000106 br 574 - break; - case 6: - *hex6 = encoded; - 570: 00940404 movi r2,20496 - 574: 11400005 stb r5,0(r2) - 578: f800283a ret - break; - case 7: - *hex7 = encoded; - 57c: 00940004 movi r2,20480 - 580: 11400005 stb r5,0(r2) - 584: f800283a ret - -00000588 : -} - -void encodeLatHex(int hex_i, char c) { - char encoded = 0; - - if (isdigit(c)) { - 588: 00800034 movhi r2,0 - 58c: 10883b04 addi r2,r2,8428 - 590: 10800017 ldw r2,0(r2) - 594: 29403fcc andi r5,r5,255 - 598: 2940201c xori r5,r5,128 - 59c: 297fe004 addi r5,r5,-128 - 5a0: 2885883a add r2,r5,r2 - 5a4: 10800003 ldbu r2,0(r2) - default: - break; - } -} - -void encodeLatHex(int hex_i, char c) { - 5a8: 2007883a mov r3,r4 - char encoded = 0; - - if (isdigit(c)) { - 5ac: 1080010c andi r2,r2,4 - 5b0: 10000226 beq r2,zero,5bc - encodeNumHex(hex_i, c-'0'); - 5b4: 297ff404 addi r5,r5,-48 - 5b8: 00004641 jmpi 464 - return; - } - - switch (c) { - 5bc: 00801b44 movi r2,109 - 5c0: 28805a26 beq r5,r2,72c - 5c4: 11401d16 blt r2,r5,63c - 5c8: 00801984 movi r2,102 - 5cc: 28804926 beq r5,r2,6f4 - 5d0: 11400e16 blt r2,r5,60c - 5d4: 00801884 movi r2,98 - 5d8: 28803e26 beq r5,r2,6d4 - 5dc: 11400716 blt r2,r5,5fc - 5e0: 00800b44 movi r2,45 - 5e4: 28803726 beq r5,r2,6c4 - 5e8: 00801844 movi r2,97 - 5ec: 28803726 beq r5,r2,6cc - 5f0: 00800804 movi r2,32 - 5f4: 28802f1e bne r5,r2,6b4 - 5f8: 00003006 br 6bc - 5fc: 00801904 movi r2,100 - 600: 28803826 beq r5,r2,6e4 - 604: 11403916 blt r2,r5,6ec - 608: 00003406 br 6dc - 60c: 00801a44 movi r2,105 - 610: 28803e26 beq r5,r2,70c - 614: 11400516 blt r2,r5,62c - 618: 008019c4 movi r2,103 - 61c: 28803726 beq r5,r2,6fc - 620: 00801a04 movi r2,104 - 624: 2880231e bne r5,r2,6b4 - 628: 00003606 br 704 - 62c: 00801ac4 movi r2,107 - 630: 28803a26 beq r5,r2,71c - 634: 11403b16 blt r2,r5,724 - 638: 00003606 br 714 - 63c: 00801d04 movi r2,116 - 640: 28804826 beq r5,r2,764 - 644: 11400c16 blt r2,r5,678 - 648: 00801c04 movi r2,112 - 64c: 28803d26 beq r5,r2,744 - 650: 11400516 blt r2,r5,668 - 654: 00801b84 movi r2,110 - 658: 28803626 beq r5,r2,734 - 65c: 00801bc4 movi r2,111 - 660: 2880141e bne r5,r2,6b4 - 664: 00003506 br 73c - 668: 00801c84 movi r2,114 - 66c: 28803926 beq r5,r2,754 - 670: 11403a16 blt r2,r5,75c - 674: 00003506 br 74c - 678: 00801dc4 movi r2,119 - 67c: 28803f26 beq r5,r2,77c - 680: 11400516 blt r2,r5,698 - 684: 00801d44 movi r2,117 - 688: 28803826 beq r5,r2,76c - 68c: 00801d84 movi r2,118 - 690: 2880081e bne r5,r2,6b4 - 694: 00003706 br 774 - 698: 00801e44 movi r2,121 - 69c: 28803b26 beq r5,r2,78c - 6a0: 28803816 blt r5,r2,784 - 6a4: 00801e84 movi r2,122 - 6a8: 2880021e bne r5,r2,6b4 - 6ac: 01401904 movi r5,100 - 6b0: 00003706 br 790 - 6b4: 000b883a mov r5,zero - 6b8: 00003506 br 790 - 6bc: 017fffc4 movi r5,-1 - 6c0: 00003306 br 790 - case ' ': - encoded = (char)0xFF; // 111 1111 - break; - 6c4: 01400fc4 movi r5,63 - 6c8: 00003106 br 790 - case '-': - encoded = (char)0x3F; // 011 1111 - break; - 6cc: 01400204 movi r5,8 - 6d0: 00002f06 br 790 - case 'a': - encoded = (char)0x08; // 000 1000 - break; - 6d4: 014000c4 movi r5,3 - 6d8: 00002d06 br 790 - case 'b': - encoded = (char)0x03; // 000 0011 - break; - 6dc: 014009c4 movi r5,39 - 6e0: 00002b06 br 790 - case 'c': - encoded = (char)0x27; // 010 0111 - break; - 6e4: 01400844 movi r5,33 - 6e8: 00002906 br 790 - case 'd': - encoded = (char)0x21; // 010 0001 - break; - 6ec: 01400184 movi r5,6 - 6f0: 00002706 br 790 - case 'e': - encoded = (char)0x06; // 000 0110 - break; - 6f4: 01400384 movi r5,14 - 6f8: 00002506 br 790 - case 'f': - encoded = (char)0x0E; // 000 1110 - break; - 6fc: 01401084 movi r5,66 - 700: 00002306 br 790 - case 'g': - encoded = (char)0x42; // 100 0010 - break; - 704: 014002c4 movi r5,11 - 708: 00002106 br 790 - case 'h': - encoded = (char)0x0B; // 000 1011 - break; - 70c: 017ffec4 movi r5,-5 - 710: 00001f06 br 790 - case 'i': - encoded = (char)0xFB; // 111 1011 - break; - 714: 01401844 movi r5,97 - 718: 00001d06 br 790 - case 'j': - encoded = (char)0x61; // 110 0001 - break; - 71c: 01400284 movi r5,10 - 720: 00001b06 br 790 - case 'k': - encoded = (char)0x0A; // 000 1010 - break; - 724: 014011c4 movi r5,71 - 728: 00001906 br 790 - case 'l': - encoded = (char)0x47; // 100 0111 - break; - 72c: 01401204 movi r5,72 - 730: 00001706 br 790 - case 'm': - encoded = (char)0x48; // 100 1000 - break; - 734: 01400ac4 movi r5,43 - 738: 00001506 br 790 - case 'n': - encoded = (char)0x2B; // 010 1011 - break; - 73c: 014008c4 movi r5,35 - 740: 00001306 br 790 - case 'o': - encoded = (char)0x23; // 010 0011 - break; - 744: 01400304 movi r5,12 - 748: 00001106 br 790 - case 'p': - encoded = (char)0x0C; // 000 1100 - break; - 74c: 01400104 movi r5,4 - 750: 00000f06 br 790 - case 'q': - encoded = (char)0x04; // 000 0100 - break; - 754: 01400bc4 movi r5,47 - 758: 00000d06 br 790 - case 'r': - encoded = (char)0x2F; // 010 1111 - break; - 75c: 014004c4 movi r5,19 - 760: 00000b06 br 790 - case 's': - encoded = (char)0x13; // 001 0011 - break; - 764: 014001c4 movi r5,7 - 768: 00000906 br 790 - case 't': - encoded = (char)0x07; // 000 0111 - break; - 76c: 014018c4 movi r5,99 - 770: 00000706 br 790 - case 'u': - encoded = (char)0x63; // 110 0011 - break; - 774: 01401044 movi r5,65 - 778: 00000506 br 790 - case 'v': - encoded = (char)0x41; // 100 0001 - break; - 77c: 01400044 movi r5,1 - 780: 00000306 br 790 - case 'w': - encoded = (char)0x01; // 000 0001 - break; - 784: 01400244 movi r5,9 - 788: 00000106 br 790 - case 'x': - encoded = (char)0x09; // 000 1001 - break; - 78c: 01400444 movi r5,17 - default: - encoded = 0; - break; - } - - switch (hex_i) { - 790: 008001c4 movi r2,7 - 794: 10c02036 bltu r2,r3,818 - 798: 18c5883a add r2,r3,r3 - 79c: 1085883a add r2,r2,r2 - 7a0: 00c00034 movhi r3,0 - 7a4: 18c1ed04 addi r3,r3,1972 - 7a8: 10c5883a add r2,r2,r3 - 7ac: 10800017 ldw r2,0(r2) - 7b0: 1000683a jmp r2 - 7b4: 000007d4 movui zero,31 - 7b8: 000007dc xori zero,zero,31 - 7bc: 000007e4 muli zero,zero,31 - 7c0: 000007ec andhi zero,zero,31 - 7c4: 000007f4 movhi zero,31 - 7c8: 000007fc xorhi zero,zero,31 - 7cc: 00000804 movi zero,32 - 7d0: 00000810 cmplti zero,zero,32 - case 0: - *hex0 = encoded; - 7d4: 00941c04 movi r2,20592 - 7d8: 00000b06 br 808 - break; - case 1: - *hex1 = encoded; - 7dc: 00941804 movi r2,20576 - 7e0: 00000906 br 808 - break; - case 2: - *hex2 = encoded; - 7e4: 00941404 movi r2,20560 - 7e8: 00000706 br 808 - break; - case 3: - *hex3 = encoded; - 7ec: 00941004 movi r2,20544 - 7f0: 00000506 br 808 - break; - case 4: - *hex4 = encoded; - 7f4: 00940c04 movi r2,20528 - 7f8: 00000306 br 808 - break; - case 5: - *hex5 = encoded; - 7fc: 00940804 movi r2,20512 - 800: 00000106 br 808 - break; - case 6: - *hex6 = encoded; - 804: 00940404 movi r2,20496 - 808: 11400005 stb r5,0(r2) - 80c: f800283a ret - break; - case 7: - *hex7 = encoded; - 810: 00940004 movi r2,20480 - 814: 11400005 stb r5,0(r2) - 818: f800283a ret - -0000081c : - */ -#include "hex_out.h" -#include "hex_encoder.h" -#include "system.h" - -void print_block(char * str, unsigned int size, enum BLOCK_N block_i) { - 81c: defffc04 addi sp,sp,-16 - 820: dc400115 stw r17,4(sp) - 824: dc000015 stw r16,0(sp) - 828: dfc00315 stw ra,12(sp) - 82c: dc800215 stw r18,8(sp) - 830: 2021883a mov r16,r4 - 834: 2823883a mov r17,r5 - int i; - if (block_i == HEX0_3) { - 838: 30000d1e bne r6,zero,870 - if (size > 4) panic(); - 83c: 00800104 movi r2,4 - 840: 1140012e bgeu r2,r5,848 - 844: 00011340 call 1134 - 848: 8461883a add r16,r16,r17 - 84c: 0025883a mov r18,zero - 850: 00000306 br 860 - for (i = 0; i < size; i++) { - encodeLatHex(i,str[size-1-i]); - 854: 81400007 ldb r5,0(r16) - -void print_block(char * str, unsigned int size, enum BLOCK_N block_i) { - int i; - if (block_i == HEX0_3) { - if (size > 4) panic(); - for (i = 0; i < size; i++) { - 858: 94800044 addi r18,r18,1 - encodeLatHex(i,str[size-1-i]); - 85c: 00005880 call 588 - 860: 9009883a mov r4,r18 - -void print_block(char * str, unsigned int size, enum BLOCK_N block_i) { - int i; - if (block_i == HEX0_3) { - if (size > 4) panic(); - for (i = 0; i < size; i++) { - 864: 843fffc4 addi r16,r16,-1 - 868: 947ffa1e bne r18,r17,854 - 86c: 00001c06 br 8e0 - encodeLatHex(i,str[size-1-i]); - } - } - else if (block_i == HEX4_5) { - 870: 00800044 movi r2,1 - 874: 30800d1e bne r6,r2,8ac - if (size > 2) panic(); - 878: 00800084 movi r2,2 - 87c: 1140012e bgeu r2,r5,884 - 880: 00011340 call 1134 - 884: 8461883a add r16,r16,r17 - 888: 0025883a mov r18,zero - 88c: 00000306 br 89c - for (i = 0; i < size; i++) { - encodeLatHex(i+4,str[size-1-i]); - 890: 81400007 ldb r5,0(r16) - encodeLatHex(i,str[size-1-i]); - } - } - else if (block_i == HEX4_5) { - if (size > 2) panic(); - for (i = 0; i < size; i++) { - 894: 94800044 addi r18,r18,1 - encodeLatHex(i+4,str[size-1-i]); - 898: 00005880 call 588 - 89c: 91000104 addi r4,r18,4 - encodeLatHex(i,str[size-1-i]); - } - } - else if (block_i == HEX4_5) { - if (size > 2) panic(); - for (i = 0; i < size; i++) { - 8a0: 843fffc4 addi r16,r16,-1 - 8a4: 947ffa1e bne r18,r17,890 - 8a8: 00000d06 br 8e0 - encodeLatHex(i+4,str[size-1-i]); - } - } - else if (block_i == HEX6_7) { - 8ac: 00800084 movi r2,2 - 8b0: 30800b1e bne r6,r2,8e0 - if (size > 2) panic(); - 8b4: 3140012e bgeu r6,r5,8bc - 8b8: 00011340 call 1134 - 8bc: 8461883a add r16,r16,r17 - 8c0: 0025883a mov r18,zero - 8c4: 00000306 br 8d4 - for (i = 0; i < size; i++) { - encodeLatHex(i+6,str[size-1-i]); - 8c8: 81400007 ldb r5,0(r16) - encodeLatHex(i+4,str[size-1-i]); - } - } - else if (block_i == HEX6_7) { - if (size > 2) panic(); - for (i = 0; i < size; i++) { - 8cc: 94800044 addi r18,r18,1 - encodeLatHex(i+6,str[size-1-i]); - 8d0: 00005880 call 588 - 8d4: 91000184 addi r4,r18,6 - encodeLatHex(i+4,str[size-1-i]); - } - } - else if (block_i == HEX6_7) { - if (size > 2) panic(); - for (i = 0; i < size; i++) { - 8d8: 843fffc4 addi r16,r16,-1 - 8dc: 947ffa1e bne r18,r17,8c8 - encodeLatHex(i+6,str[size-1-i]); - } - } -} - 8e0: dfc00317 ldw ra,12(sp) - 8e4: dc800217 ldw r18,8(sp) - 8e8: dc400117 ldw r17,4(sp) - 8ec: dc000017 ldw r16,0(sp) - 8f0: dec00404 addi sp,sp,16 - 8f4: f800283a ret - -000008f8 : - -void clear_block(enum BLOCK_N block_i) { - 8f8: 2007883a mov r3,r4 - if (block_i == HEX0_3) { - print_block(" ", 4, HEX0_3); - 8fc: 01400104 movi r5,4 - 900: 000d883a mov r6,zero - 904: 01000034 movhi r4,0 - 908: 21075d04 addi r4,r4,7540 - } - } -} - -void clear_block(enum BLOCK_N block_i) { - if (block_i == HEX0_3) { - 90c: 18000c26 beq r3,zero,940 - print_block(" ", 4, HEX0_3); - } - else if (block_i == HEX4_5) { - 910: 00800044 movi r2,1 - print_block(" ", 2, HEX4_5); - 914: 180d883a mov r6,r3 - 918: 01000034 movhi r4,0 - 91c: 21075f04 addi r4,r4,7548 - 920: 01400084 movi r5,2 - -void clear_block(enum BLOCK_N block_i) { - if (block_i == HEX0_3) { - print_block(" ", 4, HEX0_3); - } - else if (block_i == HEX4_5) { - 924: 18800626 beq r3,r2,940 - print_block(" ", 2, HEX4_5); - } - else if (block_i == HEX6_7) { - 928: 00800084 movi r2,2 - print_block(" ", 2, HEX6_7); - 92c: 180b883a mov r5,r3 - 930: 01000034 movhi r4,0 - 934: 21075f04 addi r4,r4,7548 - 938: 180d883a mov r6,r3 - print_block(" ", 4, HEX0_3); - } - else if (block_i == HEX4_5) { - print_block(" ", 2, HEX4_5); - } - else if (block_i == HEX6_7) { - 93c: 1880011e bne r3,r2,944 - print_block(" ", 2, HEX6_7); - 940: 000081c1 jmpi 81c - 944: f800283a ret - -00000948 : - } -} - -void print_number(char num) { - 948: defff804 addi sp,sp,-32 - 94c: dc800415 stw r18,16(sp) - 950: dc400315 stw r17,12(sp) - 954: dfc00715 stw ra,28(sp) - 958: dd000615 stw r20,24(sp) - 95c: dcc00515 stw r19,20(sp) - 960: dc000215 stw r16,8(sp) - 964: 2023883a mov r17,r4 - 968: 0025883a mov r18,zero - int i; - char buf[5]; - char val; - for (i = 0; i < 4; i++) { - if (num < 0) { - 96c: 88803fcc andi r2,r17,255 - 970: 1080201c xori r2,r2,128 - 974: 10bfe004 addi r2,r2,-128 - buf[0] = '-'; - 978: 05000b44 movi r20,45 - val = -num; - 97c: 0461c83a sub r16,zero,r17 -void print_number(char num) { - int i; - char buf[5]; - char val; - for (i = 0; i < 4; i++) { - if (num < 0) { - 980: 10000216 blt r2,zero,98c - buf[0] = '-'; - val = -num; - } else { - buf[0] = ' '; - 984: 05000804 movi r20,32 - 988: 8821883a mov r16,r17 - val = num; - } - buf[1] = val/100%10 + '0'; - 98c: 84003fcc andi r16,r16,255 - 990: 8400201c xori r16,r16,128 - 994: 843fe004 addi r16,r16,-128 - 998: 8009883a mov r4,r16 - 99c: 01401904 movi r5,100 - 9a0: 00011dc0 call 11dc <__divsi3> - 9a4: 11003fcc andi r4,r2,255 - 9a8: 2100201c xori r4,r4,128 - 9ac: 213fe004 addi r4,r4,-128 - 9b0: 01400284 movi r5,10 - 9b4: 000123c0 call 123c <__modsi3> - buf[2] = val/10%10 + '0'; - 9b8: 8009883a mov r4,r16 - 9bc: 01400284 movi r5,10 - val = -num; - } else { - buf[0] = ' '; - val = num; - } - buf[1] = val/100%10 + '0'; - 9c0: 14c00c04 addi r19,r2,48 - buf[2] = val/10%10 + '0'; - 9c4: 00011dc0 call 11dc <__divsi3> - 9c8: 11003fcc andi r4,r2,255 - 9cc: 2100201c xori r4,r4,128 - 9d0: 213fe004 addi r4,r4,-128 - 9d4: 01400284 movi r5,10 - 9d8: 000123c0 call 123c <__modsi3> - buf[3] = val%10 + '0'; - 9dc: 8009883a mov r4,r16 - 9e0: 01400284 movi r5,10 - } else { - buf[0] = ' '; - val = num; - } - buf[1] = val/100%10 + '0'; - buf[2] = val/10%10 + '0'; - 9e4: 14000c04 addi r16,r2,48 - buf[3] = val%10 + '0'; - 9e8: 000123c0 call 123c <__modsi3> - 9ec: 10c00c04 addi r3,r2,48 - -void print_number(char num) { - int i; - char buf[5]; - char val; - for (i = 0; i < 4; i++) { - 9f0: 94800044 addi r18,r18,1 - 9f4: 00800104 movi r2,4 - 9f8: 90bfdc1e bne r18,r2,96c - } - buf[1] = val/100%10 + '0'; - buf[2] = val/10%10 + '0'; - buf[3] = val%10 + '0'; - } - clear_block(HEX0_3); - 9fc: 0009883a mov r4,zero - a00: d8c000c5 stb r3,3(sp) - a04: dc000085 stb r16,2(sp) - a08: dcc00045 stb r19,1(sp) - a0c: dd000005 stb r20,0(sp) - a10: 00008f80 call 8f8 - print_block(buf, 4, HEX0_3); - a14: 900b883a mov r5,r18 - a18: d809883a mov r4,sp - a1c: 000d883a mov r6,zero - a20: 000081c0 call 81c -} - a24: dfc00717 ldw ra,28(sp) - a28: dd000617 ldw r20,24(sp) - a2c: dcc00517 ldw r19,20(sp) - a30: dc800417 ldw r18,16(sp) - a34: dc400317 ldw r17,12(sp) - a38: dc000217 ldw r16,8(sp) - a3c: dec00804 addi sp,sp,32 - a40: f800283a ret - -00000a44 : - global_registers[Ssw_rw] = (char)s.splited.rw_mode; - global_registers[Ssw_run] = (char)s.splited.run_mode; -} - -enum PushEvent push_decode(char psw) { - switch(psw) { - a44: 21003fcc andi r4,r4,255 - a48: 2100201c xori r4,r4,128 - a4c: 213fe004 addi r4,r4,-128 - a50: 00800144 movi r2,5 - a54: 20800826 beq r4,r2,a78 - a58: 00800184 movi r2,6 - a5c: 00c00104 movi r3,4 - a60: 20800626 beq r4,r2,a7c - a64: 008000c4 movi r2,3 - a68: 0007883a mov r3,zero - a6c: 2080031e bne r4,r2,a7c - a70: 00c00084 movi r3,2 - a74: 00000106 br a7c - case 0x3: - return PUSH_VALSTR; - a78: 00c000c4 movi r3,3 - case 0x6: - return PUSH_RUN; - break; - } - return PUSH_NONE; -} - a7c: 1805883a mov r2,r3 - a80: f800283a ret - -00000a84 : - -void push_int() { - static unsigned char status = 0; - static enum PushEvent event_code; - volatile sw_t s; - s.sw = *switches; - a84: 00942404 movi r2,20624 - a88: 10800017 ldw r2,0(r2) - - switch (status) { - a8c: d0e04403 ldbu r3,-32496(gp) - break; - } - return PUSH_NONE; -} - -void push_int() { - a90: deffff04 addi sp,sp,-4 - static unsigned char status = 0; - static enum PushEvent event_code; - volatile sw_t s; - s.sw = *switches; - - switch (status) { - a94: 01000044 movi r4,1 - -void push_int() { - static unsigned char status = 0; - static enum PushEvent event_code; - volatile sw_t s; - s.sw = *switches; - a98: d8800015 stw r2,0(sp) - - switch (status) { - a9c: 19003726 beq r3,r4,b7c - aa0: 19000336 bltu r3,r4,ab0 - aa4: 00800084 movi r2,2 - aa8: 1880421e bne r3,r2,bb4 - aac: 00003d06 br ba4 - case 0: - PUSH_EVENT = PUSH_NONE; - if (*push_switches != 7) { - ab0: 01142004 movi r4,20608 - ab4: 20800003 ldbu r2,0(r4) - ab8: 00c001c4 movi r3,7 - volatile sw_t s; - s.sw = *switches; - - switch (status) { - case 0: - PUSH_EVENT = PUSH_NONE; - abc: d0204205 stb zero,-32504(gp) - if (*push_switches != 7) { - ac0: 10803fcc andi r2,r2,255 - ac4: 1080201c xori r2,r2,128 - ac8: 10bfe004 addi r2,r2,-128 - acc: 10c01526 beq r2,r3,b24 - event_code = push_decode(*push_switches); - ad0: 20800003 ldbu r2,0(r4) - global_registers[Ssw_rw] = (char)s.splited.rw_mode; - global_registers[Ssw_run] = (char)s.splited.run_mode; -} - -enum PushEvent push_decode(char psw) { - switch(psw) { - ad4: 10c03fcc andi r3,r2,255 - ad8: 18c0201c xori r3,r3,128 - adc: 18ffe004 addi r3,r3,-128 - ae0: 00800144 movi r2,5 - ae4: 18800b26 beq r3,r2,b14 - ae8: 00800184 movi r2,6 - aec: 18800326 beq r3,r2,afc - af0: 008000c4 movi r2,3 - af4: 1880031e bne r3,r2,b04 - af8: 00000406 br b0c - afc: 00800104 movi r2,4 - b00: 00000506 br b18 - b04: 0005883a mov r2,zero - b08: 00000306 br b18 - b0c: 00800084 movi r2,2 - b10: 00000106 br b18 - b14: 008000c4 movi r2,3 - - switch (status) { - case 0: - PUSH_EVENT = PUSH_NONE; - if (*push_switches != 7) { - event_code = push_decode(*push_switches); - b18: d0a04315 stw r2,-32500(gp) - status = 1; - b1c: 00800044 movi r2,1 - b20: d0a04405 stb r2,-32496(gp) - b24: d8800017 ldw r2,0(sp) -void in_int() { - push_int(); -} - -static void update_sw_reg(sw_t s) { - global_registers[Ssw_data] = (char)s.data.value; - b28: 00c00034 movhi r3,0 - b2c: 18c8d404 addi r3,r3,9040 - b30: 1012d2ba srli r9,r2,10 - global_registers[Ssw_inst] = (char)s.splited.instruction_code; - b34: 1008d3ba srli r4,r2,14 - global_registers[Ssw_memi] = (char)s.splited.memory_index; - b38: 100ad1ba srli r5,r2,6 - global_registers[Ssw_regi] = (char)s.splited.register_index; - global_registers[Ssw_psel] = (char)s.splited.program_selecter; - b3c: 100cd0ba srli r6,r2,2 - global_registers[Ssw_rw] = (char)s.splited.rw_mode; - b40: 100ed07a srli r7,r2,1 - push_int(); -} - -static void update_sw_reg(sw_t s) { - global_registers[Ssw_data] = (char)s.data.value; - global_registers[Ssw_inst] = (char)s.splited.instruction_code; - b44: 210003cc andi r4,r4,15 - global_registers[Ssw_memi] = (char)s.splited.memory_index; - b48: 294003cc andi r5,r5,15 - global_registers[Ssw_regi] = (char)s.splited.register_index; - b4c: 4a0003cc andi r8,r9,15 - global_registers[Ssw_psel] = (char)s.splited.program_selecter; - b50: 318003cc andi r6,r6,15 - global_registers[Ssw_rw] = (char)s.splited.rw_mode; - b54: 39c0004c andi r7,r7,1 - global_registers[Ssw_run] = (char)s.splited.run_mode; - b58: 1080004c andi r2,r2,1 - b5c: 18800345 stb r2,13(r3) - push_int(); -} - -static void update_sw_reg(sw_t s) { - global_registers[Ssw_data] = (char)s.data.value; - global_registers[Ssw_inst] = (char)s.splited.instruction_code; - b60: 19000205 stb r4,8(r3) - global_registers[Ssw_memi] = (char)s.splited.memory_index; - b64: 19400285 stb r5,10(r3) - global_registers[Ssw_regi] = (char)s.splited.register_index; - b68: 1a000245 stb r8,9(r3) - global_registers[Ssw_psel] = (char)s.splited.program_selecter; - b6c: 198002c5 stb r6,11(r3) - global_registers[Ssw_rw] = (char)s.splited.rw_mode; - b70: 19c00305 stb r7,12(r3) -void in_int() { - push_int(); -} - -static void update_sw_reg(sw_t s) { - global_registers[Ssw_data] = (char)s.data.value; - b74: 1a4001c5 stb r9,7(r3) - b78: 00000f06 br bb8 - status = 1; - } - update_sw_reg(s); // �X�C�b�`���W�X�^�X�V - break; - case 1: - if (*push_switches == 7) status = 2; - b7c: 00942004 movi r2,20608 - b80: 10800003 ldbu r2,0(r2) - b84: 00c001c4 movi r3,7 - b88: 10803fcc andi r2,r2,255 - b8c: 1080201c xori r2,r2,128 - b90: 10bfe004 addi r2,r2,-128 - b94: 10c0081e bne r2,r3,bb8 - b98: 00800084 movi r2,2 - b9c: d0a04405 stb r2,-32496(gp) - ba0: 00000506 br bb8 - break; - case 2: - PUSH_EVENT = event_code; - ba4: d0a04317 ldw r2,-32500(gp) - status = 0; - ba8: d0204405 stb zero,-32496(gp) - break; - case 1: - if (*push_switches == 7) status = 2; - break; - case 2: - PUSH_EVENT = event_code; - bac: d0a04205 stb r2,-32504(gp) - bb0: 00000106 br bb8 - status = 0; - break; - default: - status = 0; - bb4: d0204405 stb zero,-32496(gp) - break; - } -} - bb8: dec00104 addi sp,sp,4 - bbc: f800283a ret - -00000bc0 : -#include "sys_register.h" - -unsigned char PUSH_EVENT = PUSH_NONE; - -void in_int() { - push_int(); - bc0: 0000a841 jmpi a84 - -00000bc4 : - break; - } -} - -void inst_jump(enum Register reg, unsigned char memory_index){ - global_registers[Spc]=global_registers[reg]+memory_index; - bc4: 00c00034 movhi r3,0 - bc8: 18c8d404 addi r3,r3,9040 - bcc: 20c9883a add r4,r4,r3 - bd0: 20800003 ldbu r2,0(r4) - bd4: 288b883a add r5,r5,r2 - bd8: 19400045 stb r5,1(r3) -} - bdc: f800283a ret - -00000be0 : -void inst_store(enum Register reg, unsigned char memory_index){ - memory_store(memory_index, reg); -} -void inst_delay(enum Register reg, unsigned char memory_index){ - //���W�X�^�̒l*10ms�҂� -} - be0: f800283a ret - -00000be4 : -void inst_add(enum Register reg, unsigned char memory_index){ - global_registers[Sacc]+=global_registers[reg]; - be4: 00c00034 movhi r3,0 - be8: 18c8d404 addi r3,r3,9040 - bec: 20c9883a add r4,r4,r3 - bf0: 21000003 ldbu r4,0(r4) - bf4: 18800143 ldbu r2,5(r3) - bf8: 1105883a add r2,r2,r4 - bfc: 18800145 stb r2,5(r3) -} - c00: f800283a ret - -00000c04 : -void inst_comp(enum Register reg, unsigned char memory_index){ - if(global_registers[Sacc]==global_registers[reg]){ - c04: 00c00034 movhi r3,0 - c08: 18c8d404 addi r3,r3,9040 - c0c: 20c9883a add r4,r4,r3 - c10: 21000007 ldb r4,0(r4) - c14: 18800147 ldb r2,5(r3) - c18: 1100021e bne r2,r4,c24 - global_registers[Sflg]=0; - c1c: 18000185 stb zero,6(r3) - c20: f800283a ret - } else if(global_registers[Sacc] > global_registers[reg]){ - c24: 2080020e bge r4,r2,c30 - global_registers[Sflg]=-1; - c28: 00bfffc4 movi r2,-1 - c2c: 00000106 br c34 - }else{ - global_registers[Sflg]=1; - c30: 00800044 movi r2,1 - c34: 18800185 stb r2,6(r3) - c38: f800283a ret - -00000c3c : - } -} -void inst_jeq(enum Register reg, unsigned char memory_index){ - if(global_registers[Sflg]==global_registers[reg]){ - c3c: 01400034 movhi r5,0 - c40: 2948d404 addi r5,r5,9040 - c44: 2149883a add r4,r4,r5 - c48: 20c00007 ldb r3,0(r4) - c4c: 28800187 ldb r2,6(r5) - c50: 10c0031e bne r2,r3,c60 - global_registers[Spc]++; - c54: 28800043 ldbu r2,1(r5) - c58: 10800044 addi r2,r2,1 - c5c: 28800045 stb r2,1(r5) - c60: f800283a ret - -00000c64 : - } -} -void inst_jne(enum Register reg, unsigned char memory_index){ - if(global_registers[Sflg]!=global_registers[reg]){ - c64: 01400034 movhi r5,0 - c68: 2948d404 addi r5,r5,9040 - c6c: 2149883a add r4,r4,r5 - c70: 20c00007 ldb r3,0(r4) - c74: 28800187 ldb r2,6(r5) - c78: 10c00326 beq r2,r3,c88 - global_registers[Spc]++; - c7c: 28800043 ldbu r2,1(r5) - c80: 10800044 addi r2,r2,1 - c84: 28800045 stb r2,1(r5) - c88: f800283a ret - -00000c8c : - } -} -void inst_jieq(char im, unsigned char memory_index){ - if(global_registers[Sflg]==im){ - c8c: 00c00034 movhi r3,0 - c90: 18c8d404 addi r3,r3,9040 - c94: 21003fcc andi r4,r4,255 - c98: 18800187 ldb r2,6(r3) - c9c: 2100201c xori r4,r4,128 - ca0: 213fe004 addi r4,r4,-128 - ca4: 1100031e bne r2,r4,cb4 - global_registers[Spc]++; - ca8: 18800043 ldbu r2,1(r3) - cac: 10800044 addi r2,r2,1 - cb0: 18800045 stb r2,1(r3) - cb4: f800283a ret - -00000cb8 : - } -} -void inst_jine(char im, unsigned char memory_index){ - if(global_registers[Sflg]!=im){ - cb8: 00c00034 movhi r3,0 - cbc: 18c8d404 addi r3,r3,9040 - cc0: 21003fcc andi r4,r4,255 - cc4: 18800187 ldb r2,6(r3) - cc8: 2100201c xori r4,r4,128 - ccc: 213fe004 addi r4,r4,-128 - cd0: 11000326 beq r2,r4,ce0 - global_registers[Spc]++; - cd4: 18800043 ldbu r2,1(r3) - cd8: 10800044 addi r2,r2,1 - cdc: 18800045 stb r2,1(r3) - ce0: f800283a ret - -00000ce4 : - print_block(buf, 4, HEX0_3); -} -void inst_load(enum Register reg, unsigned char memory_index){ - memory_load(memory_index, reg); -} -void inst_store(enum Register reg, unsigned char memory_index){ - ce4: 2005883a mov r2,r4 - memory_store(memory_index, reg); - ce8: 29003fcc andi r4,r5,255 - cec: 100b883a mov r5,r2 - cf0: 00010a81 jmpi 10a8 - -00000cf4 : - char buf[5]; - memory_load(memory_index, Sseg); - sprintf(buf, "%04d", global_registers[Sseg]); - print_block(buf, 4, HEX0_3); -} -void inst_load(enum Register reg, unsigned char memory_index){ - cf4: 2005883a mov r2,r4 - memory_load(memory_index, reg); - cf8: 29003fcc andi r4,r5,255 - cfc: 100b883a mov r5,r2 - d00: 00010381 jmpi 1038 - -00000d04 : -} - -void inst_jump(enum Register reg, unsigned char memory_index){ - global_registers[Spc]=global_registers[reg]+memory_index; -} -void inst_output(enum Register reg, unsigned char memory_index){ - d04: defffd04 addi sp,sp,-12 - //�������̒l��7�Z�O�ɕ\�� - char buf[5]; - memory_load(memory_index, Sseg); - d08: 29003fcc andi r4,r5,255 - d0c: 01400384 movi r5,14 -} - -void inst_jump(enum Register reg, unsigned char memory_index){ - global_registers[Spc]=global_registers[reg]+memory_index; -} -void inst_output(enum Register reg, unsigned char memory_index){ - d10: dfc00215 stw ra,8(sp) - //�������̒l��7�Z�O�ɕ\�� - char buf[5]; - memory_load(memory_index, Sseg); - d14: 00010380 call 1038 - sprintf(buf, "%04d", global_registers[Sseg]); - d18: 00800034 movhi r2,0 - d1c: 1088d404 addi r2,r2,9040 - d20: 11800387 ldb r6,14(r2) - d24: d809883a mov r4,sp - d28: 01400034 movhi r5,0 - d2c: 29475604 addi r5,r5,7512 - d30: 00012e40 call 12e4 - print_block(buf, 4, HEX0_3); - d34: d809883a mov r4,sp - d38: 01400104 movi r5,4 - d3c: 000d883a mov r6,zero - d40: 000081c0 call 81c -} - d44: dfc00217 ldw ra,8(sp) - d48: dec00304 addi sp,sp,12 - d4c: f800283a ret - -00000d50 : -#include "sys_register.h" -#include "hex_out.h" -#include - -struct InstRec inst_fetch(){ - return inst_memory_load((unsigned int)global_registers[Spc]++); - d50: 00c00034 movhi r3,0 - d54: 18c8d404 addi r3,r3,9040 - d58: 18800043 ldbu r2,1(r3) -#include "sys_memory.h" -#include "sys_register.h" -#include "hex_out.h" -#include - -struct InstRec inst_fetch(){ - d5c: deffff04 addi sp,sp,-4 - d60: dfc00015 stw ra,0(sp) - return inst_memory_load((unsigned int)global_registers[Spc]++); - d64: 11003fcc andi r4,r2,255 - d68: 2100201c xori r4,r4,128 - d6c: 213fe004 addi r4,r4,-128 - d70: 10800044 addi r2,r2,1 - d74: 18800045 stb r2,1(r3) - d78: 0000fbc0 call fbc -} - d7c: dfc00017 ldw ra,0(sp) - d80: dec00104 addi sp,sp,4 - d84: f800283a ret - -00000d88 : - -void inst_decode(struct InstRec inst_rec){ - d88: 2004d13a srli r2,r4,4 - d8c: 2006d23a srli r3,r4,8 - switch(inst_rec.inst) { - d90: 210003cc andi r4,r4,15 - d94: 21bfffc4 addi r6,r4,-1 - -struct InstRec inst_fetch(){ - return inst_memory_load((unsigned int)global_registers[Spc]++); -} - -void inst_decode(struct InstRec inst_rec){ - d98: 114003cc andi r5,r2,15 - switch(inst_rec.inst) { - d9c: 00800284 movi r2,10 - -struct InstRec inst_fetch(){ - return inst_memory_load((unsigned int)global_registers[Spc]++); -} - -void inst_decode(struct InstRec inst_rec){ - da0: 190003cc andi r4,r3,15 - switch(inst_rec.inst) { - da4: 11805336 bltu r2,r6,ef4 - da8: 3185883a add r2,r6,r6 - dac: 1085883a add r2,r2,r2 - db0: 00c00034 movhi r3,0 - db4: 18c37104 addi r3,r3,3524 - db8: 10c5883a add r2,r2,r3 - dbc: 10800017 ldw r2,0(r2) - dc0: 1000683a jmp r2 - dc4: 00000df0 cmpltui zero,zero,55 - dc8: 00000e10 cmplti zero,zero,56 - dcc: 00000e1c xori zero,zero,56 - dd0: 00000e28 cmpgeui zero,zero,56 - dd4: 00000ef4 movhi zero,59 - dd8: 00000e34 movhi zero,56 - ddc: 00000e58 cmpnei zero,zero,57 - de0: 00000e64 muli zero,zero,57 - de4: 00000e84 movi zero,58 - de8: 00000eb0 cmpltui zero,zero,58 - dec: 00000ed4 movui zero,59 - break; - } -} - -void inst_jump(enum Register reg, unsigned char memory_index){ - global_registers[Spc]=global_registers[reg]+memory_index; - df0: 00c00034 movhi r3,0 - df4: 18c8d404 addi r3,r3,9040 - df8: 20803fcc andi r2,r4,255 - dfc: 10c5883a add r2,r2,r3 - e00: 10800003 ldbu r2,0(r2) - e04: 2885883a add r2,r5,r2 - e08: 18800045 stb r2,1(r3) - e0c: f800283a ret - break; - case INST_JUMP: - inst_jump(inst_rec.regi, inst_rec.memi); - break; - case INST_OUTPUT: - inst_output(inst_rec.regi, inst_rec.memi); - e10: 21003fcc andi r4,r4,255 - e14: 29403fcc andi r5,r5,255 - e18: 0000d041 jmpi d04 - break; - case INST_LOAD: - inst_load(inst_rec.regi, inst_rec.memi); - e1c: 21003fcc andi r4,r4,255 - e20: 29403fcc andi r5,r5,255 - e24: 0000cf41 jmpi cf4 - break; - case INST_STORE: - inst_store(inst_rec.regi, inst_rec.memi); - e28: 21003fcc andi r4,r4,255 - e2c: 29403fcc andi r5,r5,255 - e30: 0000ce41 jmpi ce4 -} -void inst_delay(enum Register reg, unsigned char memory_index){ - //���W�X�^�̒l*10ms�҂� -} -void inst_add(enum Register reg, unsigned char memory_index){ - global_registers[Sacc]+=global_registers[reg]; - e34: 00c00034 movhi r3,0 - e38: 18c8d404 addi r3,r3,9040 - e3c: 20803fcc andi r2,r4,255 - e40: 10c5883a add r2,r2,r3 - e44: 11000003 ldbu r4,0(r2) - e48: 18800143 ldbu r2,5(r3) - e4c: 1105883a add r2,r2,r4 - e50: 18800145 stb r2,5(r3) - e54: f800283a ret - break; - case INST_ADD: - inst_add(inst_rec.regi, inst_rec.memi); - break; - case INST_COMP: - inst_comp(inst_rec.regi, inst_rec.memi); - e58: 21003fcc andi r4,r4,255 - e5c: 29403fcc andi r5,r5,255 - e60: 0000c041 jmpi c04 - }else{ - global_registers[Sflg]=1; - } -} -void inst_jeq(enum Register reg, unsigned char memory_index){ - if(global_registers[Sflg]==global_registers[reg]){ - e64: 20803fcc andi r2,r4,255 - e68: 01000034 movhi r4,0 - e6c: 2108d404 addi r4,r4,9040 - e70: 1105883a add r2,r2,r4 - e74: 10c00007 ldb r3,0(r2) - e78: 20800187 ldb r2,6(r4) - e7c: 10c01d1e bne r2,r3,ef4 - e80: 00000706 br ea0 - global_registers[Spc]++; - } -} -void inst_jne(enum Register reg, unsigned char memory_index){ - if(global_registers[Sflg]!=global_registers[reg]){ - e84: 20803fcc andi r2,r4,255 - e88: 01000034 movhi r4,0 - e8c: 2108d404 addi r4,r4,9040 - e90: 1105883a add r2,r2,r4 - e94: 10c00007 ldb r3,0(r2) - e98: 20800187 ldb r2,6(r4) - e9c: 10c01526 beq r2,r3,ef4 - global_registers[Spc]++; - ea0: 20800043 ldbu r2,1(r4) - ea4: 10800044 addi r2,r2,1 - ea8: 20800045 stb r2,1(r4) - eac: f800283a ret - } -} -void inst_jieq(char im, unsigned char memory_index){ - if(global_registers[Sflg]==im){ - eb0: 01400034 movhi r5,0 - eb4: 2948d404 addi r5,r5,9040 - eb8: 28c00187 ldb r3,6(r5) - ebc: 208003cc andi r2,r4,15 - ec0: 18800c1e bne r3,r2,ef4 - global_registers[Spc]++; - ec4: 28800043 ldbu r2,1(r5) - ec8: 10800044 addi r2,r2,1 - ecc: 28800045 stb r2,1(r5) - ed0: f800283a ret - } -} -void inst_jine(char im, unsigned char memory_index){ - if(global_registers[Sflg]!=im){ - ed4: 01400034 movhi r5,0 - ed8: 2948d404 addi r5,r5,9040 - edc: 28c00187 ldb r3,6(r5) - ee0: 208003cc andi r2,r4,15 - ee4: 18800326 beq r3,r2,ef4 - global_registers[Spc]++; - ee8: 28800043 ldbu r2,1(r5) - eec: 10800044 addi r2,r2,1 - ef0: 28800045 stb r2,1(r5) - ef4: f800283a ret - -00000ef8 : - -/************************************************** - * Impl - **************************************************/ - -void memory_init() { - ef8: 000b883a mov r5,zero - efc: 00000806 br f20 - int i, j; - for (i = 0; i < MEMS_COUNT; i++) - for (j = 0; j < MEM_SIZE; j++) { - f00: 21000044 addi r4,r4,1 - f04: 00800404 movi r2,16 - memory[i][j] = 0; - f08: 18000005 stb zero,0(r3) - **************************************************/ - -void memory_init() { - int i, j; - for (i = 0; i < MEMS_COUNT; i++) - for (j = 0; j < MEM_SIZE; j++) { - f0c: 18c00044 addi r3,r3,1 - f10: 20bffb1e bne r4,r2,f00 - * Impl - **************************************************/ - -void memory_init() { - int i, j; - for (i = 0; i < MEMS_COUNT; i++) - f14: 29400044 addi r5,r5,1 - f18: 00800104 movi r2,4 - f1c: 28800626 beq r5,r2,f38 - for (j = 0; j < MEM_SIZE; j++) { - memory[i][j] = 0; - } -} - f20: 2806913a slli r3,r5,4 - f24: 00800034 movhi r2,0 - f28: 10888404 addi r2,r2,8720 - f2c: 0009883a mov r4,zero - f30: 1887883a add r3,r3,r2 - f34: 003ff206 br f00 - f38: f800283a ret - -00000f3c : - -void inst_memory_store(unsigned int mem_addr, struct InstRec inst_rec){ - inst_memory[global_current_memory][mem_addr] = inst_rec; - f3c: d1a04517 ldw r6,-32492(gp) - f40: 2810d23a srli r8,r5,8 - for (j = 0; j < MEM_SIZE; j++) { - memory[i][j] = 0; - } -} - -void inst_memory_store(unsigned int mem_addr, struct InstRec inst_rec){ - f44: 024003c4 movi r9,15 - inst_memory[global_current_memory][mem_addr] = inst_rec; - f48: 300c913a slli r6,r6,4 - for (j = 0; j < MEM_SIZE; j++) { - memory[i][j] = 0; - } -} - -void inst_memory_store(unsigned int mem_addr, struct InstRec inst_rec){ - f4c: 280ed13a srli r7,r5,4 - inst_memory[global_current_memory][mem_addr] = inst_rec; - f50: 00800034 movhi r2,0 - f54: 10889404 addi r2,r2,8784 - f58: 310d883a add r6,r6,r4 - f5c: 318d883a add r6,r6,r6 - f60: 318d883a add r6,r6,r6 - f64: 010003c4 movi r4,15 - f68: 308d883a add r6,r6,r2 - f6c: 4250703a and r8,r8,r9 - f70: 4110703a and r8,r8,r4 - f74: 30800017 ldw r2,0(r6) - for (j = 0; j < MEM_SIZE; j++) { - memory[i][j] = 0; - } -} - -void inst_memory_store(unsigned int mem_addr, struct InstRec inst_rec){ - f78: 3a4e703a and r7,r7,r9 - inst_memory[global_current_memory][mem_addr] = inst_rec; - f7c: 4010923a slli r8,r8,8 - f80: 21ce703a and r7,r4,r7 - f84: 00fc3fc4 movi r3,-3841 - f88: 10c4703a and r2,r2,r3 - f8c: 380e913a slli r7,r7,4 - f90: 00ffc3c4 movi r3,-241 - f94: 1204b03a or r2,r2,r8 - f98: 10c4703a and r2,r2,r3 - f9c: 11c4b03a or r2,r2,r7 - for (j = 0; j < MEM_SIZE; j++) { - memory[i][j] = 0; - } -} - -void inst_memory_store(unsigned int mem_addr, struct InstRec inst_rec){ - fa0: 2a4a703a and r5,r5,r9 - inst_memory[global_current_memory][mem_addr] = inst_rec; - fa4: 00fffc04 movi r3,-16 - fa8: 2148703a and r4,r4,r5 - fac: 10c4703a and r2,r2,r3 - fb0: 1104b03a or r2,r2,r4 - fb4: 30800015 stw r2,0(r6) -} - fb8: f800283a ret - -00000fbc : -struct InstRec inst_memory_load(unsigned int mem_addr){ - return inst_memory[global_current_memory][mem_addr]; - fbc: d0a04517 ldw r2,-32492(gp) - fc0: 00c00034 movhi r3,0 - fc4: 18c89404 addi r3,r3,8784 - fc8: 01c003c4 movi r7,15 - fcc: 1004913a slli r2,r2,4 - fd0: 018003c4 movi r6,15 - fd4: 1105883a add r2,r2,r4 - fd8: 1085883a add r2,r2,r2 - fdc: 1085883a add r2,r2,r2 - fe0: 10c5883a add r2,r2,r3 - fe4: 11400017 ldw r5,0(r2) - fe8: 00bc3fc4 movi r2,-3841 - fec: 1084703a and r2,r2,r2 - ff0: 2806d23a srli r3,r5,8 - ff4: 2808d13a srli r4,r5,4 - ff8: 29ca703a and r5,r5,r7 - ffc: 19c6703a and r3,r3,r7 - 1000: 1986703a and r3,r3,r6 - 1004: 21c8703a and r4,r4,r7 - 1008: 1806923a slli r3,r3,8 - 100c: 3108703a and r4,r6,r4 - 1010: 2008913a slli r4,r4,4 - 1014: 10c4b03a or r2,r2,r3 - 1018: 00ffc3c4 movi r3,-241 - 101c: 10c4703a and r2,r2,r3 - 1020: 1104b03a or r2,r2,r4 - 1024: 00fffc04 movi r3,-16 - 1028: 314c703a and r6,r6,r5 - 102c: 10c4703a and r2,r2,r3 -} - 1030: 1184b03a or r2,r2,r6 - 1034: f800283a ret - -00001038 : - if (!(mem_addr < MEM_SIZE)) panic(); - memory[global_current_memory][mem_addr] = global_registers[reg]; - return memory[global_current_memory][mem_addr]; -} - -char memory_load(unsigned int mem_addr, enum Register reg) { - 1038: defffd04 addi sp,sp,-12 - if (!(mem_addr < MEM_SIZE)) panic(); - 103c: 008003c4 movi r2,15 - if (!(mem_addr < MEM_SIZE)) panic(); - memory[global_current_memory][mem_addr] = global_registers[reg]; - return memory[global_current_memory][mem_addr]; -} - -char memory_load(unsigned int mem_addr, enum Register reg) { - 1040: dc400115 stw r17,4(sp) - 1044: dc000015 stw r16,0(sp) - 1048: dfc00215 stw ra,8(sp) - 104c: 2021883a mov r16,r4 - 1050: 2823883a mov r17,r5 - if (!(mem_addr < MEM_SIZE)) panic(); - 1054: 1100012e bgeu r2,r4,105c - 1058: 00011340 call 1134 - global_registers[reg] = memory[global_current_memory][mem_addr]; - 105c: d0a04517 ldw r2,-32492(gp) - 1060: 00c00034 movhi r3,0 - 1064: 18c88404 addi r3,r3,8720 - 1068: 01000034 movhi r4,0 - 106c: 2108d404 addi r4,r4,9040 - 1070: 1004913a slli r2,r2,4 - 1074: 8909883a add r4,r17,r4 - 1078: 10c5883a add r2,r2,r3 - 107c: 1405883a add r2,r2,r16 - 1080: 10800003 ldbu r2,0(r2) - 1084: 20800005 stb r2,0(r4) - return global_registers[reg]; -} - 1088: 10803fcc andi r2,r2,255 - 108c: 1080201c xori r2,r2,128 - 1090: 10bfe004 addi r2,r2,-128 - 1094: dfc00217 ldw ra,8(sp) - 1098: dc400117 ldw r17,4(sp) - 109c: dc000017 ldw r16,0(sp) - 10a0: dec00304 addi sp,sp,12 - 10a4: f800283a ret - -000010a8 : -} -struct InstRec inst_memory_load(unsigned int mem_addr){ - return inst_memory[global_current_memory][mem_addr]; -} - -char memory_store(unsigned int mem_addr, enum Register reg) { - 10a8: defffd04 addi sp,sp,-12 - if (!(mem_addr < MEM_SIZE)) panic(); - 10ac: 008003c4 movi r2,15 -} -struct InstRec inst_memory_load(unsigned int mem_addr){ - return inst_memory[global_current_memory][mem_addr]; -} - -char memory_store(unsigned int mem_addr, enum Register reg) { - 10b0: dc400115 stw r17,4(sp) - 10b4: dc000015 stw r16,0(sp) - 10b8: dfc00215 stw ra,8(sp) - 10bc: 2023883a mov r17,r4 - 10c0: 2821883a mov r16,r5 - if (!(mem_addr < MEM_SIZE)) panic(); - 10c4: 1100012e bgeu r2,r4,10cc - 10c8: 00011340 call 1134 - memory[global_current_memory][mem_addr] = global_registers[reg]; - 10cc: d0e04517 ldw r3,-32492(gp) - 10d0: 00800034 movhi r2,0 - 10d4: 1088d404 addi r2,r2,9040 - 10d8: 8085883a add r2,r16,r2 - 10dc: 1806913a slli r3,r3,4 - 10e0: 10800003 ldbu r2,0(r2) - 10e4: 01000034 movhi r4,0 - 10e8: 21088404 addi r4,r4,8720 - 10ec: 1907883a add r3,r3,r4 - 10f0: 1c47883a add r3,r3,r17 - 10f4: 18800005 stb r2,0(r3) - return memory[global_current_memory][mem_addr]; -} - 10f8: 10803fcc andi r2,r2,255 - 10fc: 1080201c xori r2,r2,128 - 1100: 10bfe004 addi r2,r2,-128 - 1104: dfc00217 ldw ra,8(sp) - 1108: dc400117 ldw r17,4(sp) - 110c: dc000017 ldw r16,0(sp) - 1110: dec00304 addi sp,sp,12 - 1114: f800283a ret - -00001118 : - */ -#include "sys_register.h" - -char global_registers[REG_MAX_COUNT]; - -void registers_init() { - 1118: 00800034 movhi r2,0 - 111c: 1088d404 addi r2,r2,9040 - 1120: 10c003c4 addi r3,r2,15 - int i; - for (i = 0; i < REG_MAX_COUNT; i++) global_registers[i] = 0; - 1124: 10000005 stb zero,0(r2) - 1128: 10800044 addi r2,r2,1 - 112c: 10fffd1e bne r2,r3,1124 -} - 1130: f800283a ret - -00001134 : - * Author: takayun - */ -#include "system.h" -#include "hex_out.h" - -void panic() { - 1134: deffff04 addi sp,sp,-4 - clear_block(HEX0_3); - 1138: 0009883a mov r4,zero - * Author: takayun - */ -#include "system.h" -#include "hex_out.h" - -void panic() { - 113c: dfc00015 stw ra,0(sp) - clear_block(HEX0_3); - 1140: 00008f80 call 8f8 - print_block("err ", 4, HEX0_3); - 1144: 01400104 movi r5,4 - 1148: 01000034 movhi r4,0 - 114c: 21076004 addi r4,r4,7552 - 1150: 000d883a mov r6,zero -} - 1154: dfc00017 ldw ra,0(sp) - 1158: dec00104 addi sp,sp,4 -#include "system.h" -#include "hex_out.h" - -void panic() { - clear_block(HEX0_3); - print_block("err ", 4, HEX0_3); - 115c: 000081c1 jmpi 81c - -00001160 : - 1160: 29001b2e bgeu r5,r4,11d0 - 1164: 28001a16 blt r5,zero,11d0 - 1168: 00800044 movi r2,1 - 116c: 0007883a mov r3,zero - 1170: 01c007c4 movi r7,31 - 1174: 00000306 br 1184 - 1178: 19c01326 beq r3,r7,11c8 - 117c: 18c00044 addi r3,r3,1 - 1180: 28000416 blt r5,zero,1194 - 1184: 294b883a add r5,r5,r5 - 1188: 1085883a add r2,r2,r2 - 118c: 293ffa36 bltu r5,r4,1178 - 1190: 10000d26 beq r2,zero,11c8 - 1194: 0007883a mov r3,zero - 1198: 21400236 bltu r4,r5,11a4 - 119c: 2149c83a sub r4,r4,r5 - 11a0: 1886b03a or r3,r3,r2 - 11a4: 1004d07a srli r2,r2,1 - 11a8: 280ad07a srli r5,r5,1 - 11ac: 103ffa1e bne r2,zero,1198 - 11b0: 30000226 beq r6,zero,11bc - 11b4: 2005883a mov r2,r4 - 11b8: f800283a ret - 11bc: 1809883a mov r4,r3 - 11c0: 2005883a mov r2,r4 - 11c4: f800283a ret - 11c8: 0007883a mov r3,zero - 11cc: 003ff806 br 11b0 - 11d0: 00800044 movi r2,1 - 11d4: 0007883a mov r3,zero - 11d8: 003fef06 br 1198 - -000011dc <__divsi3>: - 11dc: defffe04 addi sp,sp,-8 - 11e0: dc000015 stw r16,0(sp) - 11e4: dfc00115 stw ra,4(sp) - 11e8: 0021883a mov r16,zero - 11ec: 20000c16 blt r4,zero,1220 <__divsi3+0x44> - 11f0: 000d883a mov r6,zero - 11f4: 28000e16 blt r5,zero,1230 <__divsi3+0x54> - 11f8: 00011600 call 1160 - 11fc: 1007883a mov r3,r2 - 1200: 8005003a cmpeq r2,r16,zero - 1204: 1000011e bne r2,zero,120c <__divsi3+0x30> - 1208: 00c7c83a sub r3,zero,r3 - 120c: 1805883a mov r2,r3 - 1210: dfc00117 ldw ra,4(sp) - 1214: dc000017 ldw r16,0(sp) - 1218: dec00204 addi sp,sp,8 - 121c: f800283a ret - 1220: 0109c83a sub r4,zero,r4 - 1224: 04000044 movi r16,1 - 1228: 000d883a mov r6,zero - 122c: 283ff20e bge r5,zero,11f8 <__divsi3+0x1c> - 1230: 014bc83a sub r5,zero,r5 - 1234: 8021003a cmpeq r16,r16,zero - 1238: 003fef06 br 11f8 <__divsi3+0x1c> - -0000123c <__modsi3>: - 123c: deffff04 addi sp,sp,-4 - 1240: dfc00015 stw ra,0(sp) - 1244: 01800044 movi r6,1 - 1248: 2807883a mov r3,r5 - 124c: 20000416 blt r4,zero,1260 <__modsi3+0x24> - 1250: 28000c16 blt r5,zero,1284 <__modsi3+0x48> - 1254: dfc00017 ldw ra,0(sp) - 1258: dec00104 addi sp,sp,4 - 125c: 00011601 jmpi 1160 - 1260: 0109c83a sub r4,zero,r4 - 1264: 28000b16 blt r5,zero,1294 <__modsi3+0x58> - 1268: 180b883a mov r5,r3 - 126c: 01800044 movi r6,1 - 1270: 00011600 call 1160 - 1274: 0085c83a sub r2,zero,r2 - 1278: dfc00017 ldw ra,0(sp) - 127c: dec00104 addi sp,sp,4 - 1280: f800283a ret - 1284: 014bc83a sub r5,zero,r5 - 1288: dfc00017 ldw ra,0(sp) - 128c: dec00104 addi sp,sp,4 - 1290: 00011601 jmpi 1160 - 1294: 0147c83a sub r3,zero,r5 - 1298: 003ff306 br 1268 <__modsi3+0x2c> - -0000129c <__udivsi3>: - 129c: 000d883a mov r6,zero - 12a0: 00011601 jmpi 1160 - -000012a4 <__umodsi3>: - 12a4: 01800044 movi r6,1 - 12a8: 00011601 jmpi 1160 - -000012ac <__mulsi3>: - 12ac: 20000a26 beq r4,zero,12d8 <__mulsi3+0x2c> - 12b0: 0007883a mov r3,zero - 12b4: 2080004c andi r2,r4,1 - 12b8: 1005003a cmpeq r2,r2,zero - 12bc: 2008d07a srli r4,r4,1 - 12c0: 1000011e bne r2,zero,12c8 <__mulsi3+0x1c> - 12c4: 1947883a add r3,r3,r5 - 12c8: 294b883a add r5,r5,r5 - 12cc: 203ff91e bne r4,zero,12b4 <__mulsi3+0x8> - 12d0: 1805883a mov r2,r3 - 12d4: f800283a ret - 12d8: 0007883a mov r3,zero - 12dc: 1805883a mov r2,r3 - 12e0: f800283a ret - -000012e4 : - 12e4: defff504 addi sp,sp,-44 - 12e8: 2015883a mov r10,r4 - 12ec: dfc00815 stw ra,32(sp) - 12f0: d9800915 stw r6,36(sp) - 12f4: d9c00a15 stw r7,40(sp) - 12f8: d8800904 addi r2,sp,36 - 12fc: d8800015 stw r2,0(sp) - 1300: 00800034 movhi r2,0 - 1304: 10883c04 addi r2,r2,8432 - 1308: 11000017 ldw r4,0(r2) - 130c: d9c00017 ldw r7,0(sp) - 1310: 00808204 movi r2,520 - 1314: 02200034 movhi r8,32768 - 1318: 423fffc4 addi r8,r8,-1 - 131c: 280d883a mov r6,r5 - 1320: d880010d sth r2,4(sp) - 1324: 00c00034 movhi r3,0 - 1328: 18c6c604 addi r3,r3,6936 - 132c: d9400104 addi r5,sp,4 - 1330: 00bfffc4 movi r2,-1 - 1334: d8c00215 stw r3,8(sp) - 1338: da800315 stw r10,12(sp) - 133c: da000415 stw r8,16(sp) - 1340: d880018d sth r2,6(sp) - 1344: da800515 stw r10,20(sp) - 1348: da000615 stw r8,24(sp) - 134c: d8000715 stw zero,28(sp) - 1350: 00014580 call 1458 <___vfprintf_internal_r> - 1354: d8c00517 ldw r3,20(sp) - 1358: 18000005 stb zero,0(r3) - 135c: dfc00817 ldw ra,32(sp) - 1360: dec00b04 addi sp,sp,44 - 1364: f800283a ret - -00001368 <_sprintf_r>: - 1368: defff604 addi sp,sp,-40 - 136c: 2815883a mov r10,r5 - 1370: dfc00815 stw ra,32(sp) - 1374: d9c00915 stw r7,36(sp) - 1378: d8800904 addi r2,sp,36 - 137c: d8800015 stw r2,0(sp) - 1380: 100f883a mov r7,r2 - 1384: 00808204 movi r2,520 - 1388: 02200034 movhi r8,32768 - 138c: 423fffc4 addi r8,r8,-1 - 1390: d880010d sth r2,4(sp) - 1394: 00c00034 movhi r3,0 - 1398: 18c6c604 addi r3,r3,6936 - 139c: d9400104 addi r5,sp,4 - 13a0: 00bfffc4 movi r2,-1 - 13a4: d8c00215 stw r3,8(sp) - 13a8: da800315 stw r10,12(sp) - 13ac: da000415 stw r8,16(sp) - 13b0: d880018d sth r2,6(sp) - 13b4: da800515 stw r10,20(sp) - 13b8: da000615 stw r8,24(sp) - 13bc: d8000715 stw zero,28(sp) - 13c0: 00014580 call 1458 <___vfprintf_internal_r> - 13c4: d8c00517 ldw r3,20(sp) - 13c8: 18000005 stb zero,0(r3) - 13cc: dfc00817 ldw ra,32(sp) - 13d0: dec00a04 addi sp,sp,40 - 13d4: f800283a ret - -000013d8 : - 13d8: defffb04 addi sp,sp,-20 - 13dc: dc800315 stw r18,12(sp) - 13e0: dc400215 stw r17,8(sp) - 13e4: dc000115 stw r16,4(sp) - 13e8: dfc00415 stw ra,16(sp) - 13ec: 2025883a mov r18,r4 - 13f0: 2823883a mov r17,r5 - 13f4: 3821883a mov r16,r7 - 13f8: d9800005 stb r6,0(sp) - 13fc: 9009883a mov r4,r18 - 1400: 880b883a mov r5,r17 - 1404: d80d883a mov r6,sp - 1408: 01c00044 movi r7,1 - 140c: 04000b0e bge zero,r16,143c - 1410: 88c00117 ldw r3,4(r17) - 1414: 843fffc4 addi r16,r16,-1 - 1418: 183ee83a callr r3 - 141c: 103ff726 beq r2,zero,13fc - 1420: 00bfffc4 movi r2,-1 - 1424: dfc00417 ldw ra,16(sp) - 1428: dc800317 ldw r18,12(sp) - 142c: dc400217 ldw r17,8(sp) - 1430: dc000117 ldw r16,4(sp) - 1434: dec00504 addi sp,sp,20 - 1438: f800283a ret - 143c: 0005883a mov r2,zero - 1440: dfc00417 ldw ra,16(sp) - 1444: dc800317 ldw r18,12(sp) - 1448: dc400217 ldw r17,8(sp) - 144c: dc000117 ldw r16,4(sp) - 1450: dec00504 addi sp,sp,20 - 1454: f800283a ret - -00001458 <___vfprintf_internal_r>: - 1458: deffe304 addi sp,sp,-116 - 145c: df001b15 stw fp,108(sp) - 1460: ddc01a15 stw r23,104(sp) - 1464: dd001715 stw r20,92(sp) - 1468: dc801515 stw r18,84(sp) - 146c: dc001315 stw r16,76(sp) - 1470: dfc01c15 stw ra,112(sp) - 1474: dd801915 stw r22,100(sp) - 1478: dd401815 stw r21,96(sp) - 147c: dcc01615 stw r19,88(sp) - 1480: dc401415 stw r17,80(sp) - 1484: d9001015 stw r4,64(sp) - 1488: 2829883a mov r20,r5 - 148c: d9c01115 stw r7,68(sp) - 1490: 3025883a mov r18,r6 - 1494: 0021883a mov r16,zero - 1498: d8000f15 stw zero,60(sp) - 149c: d8000e15 stw zero,56(sp) - 14a0: 0039883a mov fp,zero - 14a4: d8000915 stw zero,36(sp) - 14a8: d8000d15 stw zero,52(sp) - 14ac: d8000c15 stw zero,48(sp) - 14b0: d8000b15 stw zero,44(sp) - 14b4: 002f883a mov r23,zero - 14b8: 91400003 ldbu r5,0(r18) - 14bc: 01c00044 movi r7,1 - 14c0: 94800044 addi r18,r18,1 - 14c4: 29003fcc andi r4,r5,255 - 14c8: 2100201c xori r4,r4,128 - 14cc: 213fe004 addi r4,r4,-128 - 14d0: 20001526 beq r4,zero,1528 <___vfprintf_internal_r+0xd0> - 14d4: 81c03526 beq r16,r7,15ac <___vfprintf_internal_r+0x154> - 14d8: 3c002016 blt r7,r16,155c <___vfprintf_internal_r+0x104> - 14dc: 803ff61e bne r16,zero,14b8 <___vfprintf_internal_r+0x60> - 14e0: 00800944 movi r2,37 - 14e4: 2081501e bne r4,r2,1a28 <___vfprintf_internal_r+0x5d0> - 14e8: 073fffc4 movi fp,-1 - 14ec: 00800284 movi r2,10 - 14f0: d9c00c15 stw r7,48(sp) - 14f4: d8000f15 stw zero,60(sp) - 14f8: d8000e15 stw zero,56(sp) - 14fc: df000915 stw fp,36(sp) - 1500: d8800d15 stw r2,52(sp) - 1504: d8000b15 stw zero,44(sp) - 1508: 91400003 ldbu r5,0(r18) - 150c: 3821883a mov r16,r7 - 1510: 94800044 addi r18,r18,1 - 1514: 29003fcc andi r4,r5,255 - 1518: 2100201c xori r4,r4,128 - 151c: 213fe004 addi r4,r4,-128 - 1520: 01c00044 movi r7,1 - 1524: 203feb1e bne r4,zero,14d4 <___vfprintf_internal_r+0x7c> - 1528: b805883a mov r2,r23 - 152c: dfc01c17 ldw ra,112(sp) - 1530: df001b17 ldw fp,108(sp) - 1534: ddc01a17 ldw r23,104(sp) - 1538: dd801917 ldw r22,100(sp) - 153c: dd401817 ldw r21,96(sp) - 1540: dd001717 ldw r20,92(sp) - 1544: dcc01617 ldw r19,88(sp) - 1548: dc801517 ldw r18,84(sp) - 154c: dc401417 ldw r17,80(sp) - 1550: dc001317 ldw r16,76(sp) - 1554: dec01d04 addi sp,sp,116 - 1558: f800283a ret - 155c: 00800084 movi r2,2 - 1560: 80801726 beq r16,r2,15c0 <___vfprintf_internal_r+0x168> - 1564: 008000c4 movi r2,3 - 1568: 80bfd31e bne r16,r2,14b8 <___vfprintf_internal_r+0x60> - 156c: 2c7ff404 addi r17,r5,-48 - 1570: 88c03fcc andi r3,r17,255 - 1574: 00800244 movi r2,9 - 1578: 10c02136 bltu r2,r3,1600 <___vfprintf_internal_r+0x1a8> - 157c: d8c00917 ldw r3,36(sp) - 1580: 18012716 blt r3,zero,1a20 <___vfprintf_internal_r+0x5c8> - 1584: d9000917 ldw r4,36(sp) - 1588: 01400284 movi r5,10 - 158c: 00012ac0 call 12ac <__mulsi3> - 1590: 1007883a mov r3,r2 - 1594: 88803fcc andi r2,r17,255 - 1598: 1080201c xori r2,r2,128 - 159c: 10bfe004 addi r2,r2,-128 - 15a0: 1887883a add r3,r3,r2 - 15a4: d8c00915 stw r3,36(sp) - 15a8: 003fc306 br 14b8 <___vfprintf_internal_r+0x60> - 15ac: 00800c04 movi r2,48 - 15b0: 2080b326 beq r4,r2,1880 <___vfprintf_internal_r+0x428> - 15b4: 00800944 movi r2,37 - 15b8: 20812726 beq r4,r2,1a58 <___vfprintf_internal_r+0x600> - 15bc: 04000084 movi r16,2 - 15c0: 2c7ff404 addi r17,r5,-48 - 15c4: 88c03fcc andi r3,r17,255 - 15c8: 00800244 movi r2,9 - 15cc: 10c00a36 bltu r2,r3,15f8 <___vfprintf_internal_r+0x1a0> - 15d0: e000b416 blt fp,zero,18a4 <___vfprintf_internal_r+0x44c> - 15d4: e009883a mov r4,fp - 15d8: 01400284 movi r5,10 - 15dc: 00012ac0 call 12ac <__mulsi3> - 15e0: 1007883a mov r3,r2 - 15e4: 88803fcc andi r2,r17,255 - 15e8: 1080201c xori r2,r2,128 - 15ec: 10bfe004 addi r2,r2,-128 - 15f0: 18b9883a add fp,r3,r2 - 15f4: 003fb006 br 14b8 <___vfprintf_internal_r+0x60> - 15f8: 00800b84 movi r2,46 - 15fc: 2080a326 beq r4,r2,188c <___vfprintf_internal_r+0x434> - 1600: 00801b04 movi r2,108 - 1604: 2080a326 beq r4,r2,1894 <___vfprintf_internal_r+0x43c> - 1608: d8c00917 ldw r3,36(sp) - 160c: 1800a716 blt r3,zero,18ac <___vfprintf_internal_r+0x454> - 1610: d8000f15 stw zero,60(sp) - 1614: 28bfea04 addi r2,r5,-88 - 1618: 10803fcc andi r2,r2,255 - 161c: 00c00804 movi r3,32 - 1620: 18802836 bltu r3,r2,16c4 <___vfprintf_internal_r+0x26c> - 1624: 1085883a add r2,r2,r2 - 1628: 1085883a add r2,r2,r2 - 162c: 00c00034 movhi r3,0 - 1630: 18c59004 addi r3,r3,5696 - 1634: 10c5883a add r2,r2,r3 - 1638: 11000017 ldw r4,0(r2) - 163c: 2000683a jmp r4 - 1640: 000016cc andi zero,zero,91 - 1644: 000016c4 movi zero,91 - 1648: 000016c4 movi zero,91 - 164c: 000016c4 movi zero,91 - 1650: 000016c4 movi zero,91 - 1654: 000016c4 movi zero,91 - 1658: 000016c4 movi zero,91 - 165c: 000016c4 movi zero,91 - 1660: 000016c4 movi zero,91 - 1664: 000016c4 movi zero,91 - 1668: 000016c4 movi zero,91 - 166c: 000018f8 rdprs zero,zero,99 - 1670: 000016e0 cmpeqi zero,zero,91 - 1674: 000016c4 movi zero,91 - 1678: 000016c4 movi zero,91 - 167c: 000016c4 movi zero,91 - 1680: 000016c4 movi zero,91 - 1684: 000016e0 cmpeqi zero,zero,91 - 1688: 000016c4 movi zero,91 - 168c: 000016c4 movi zero,91 - 1690: 000016c4 movi zero,91 - 1694: 000016c4 movi zero,91 - 1698: 000016c4 movi zero,91 - 169c: 00001960 cmpeqi zero,zero,101 - 16a0: 000016c4 movi zero,91 - 16a4: 000016c4 movi zero,91 - 16a8: 000016c4 movi zero,91 - 16ac: 00001970 cmpltui zero,zero,101 - 16b0: 000016c4 movi zero,91 - 16b4: 00001844 movi zero,97 - 16b8: 000016c4 movi zero,91 - 16bc: 000016c4 movi zero,91 - 16c0: 0000183c xorhi zero,zero,96 - 16c4: 0021883a mov r16,zero - 16c8: 003f7b06 br 14b8 <___vfprintf_internal_r+0x60> - 16cc: 00c00404 movi r3,16 - 16d0: 00800044 movi r2,1 - 16d4: d8c00d15 stw r3,52(sp) - 16d8: d8000c15 stw zero,48(sp) - 16dc: d8800b15 stw r2,44(sp) - 16e0: d8c00e17 ldw r3,56(sp) - 16e4: 1805003a cmpeq r2,r3,zero - 16e8: 10005a1e bne r2,zero,1854 <___vfprintf_internal_r+0x3fc> - 16ec: d8800c17 ldw r2,48(sp) - 16f0: 1000781e bne r2,zero,18d4 <___vfprintf_internal_r+0x47c> - 16f4: d8801117 ldw r2,68(sp) - 16f8: d8000a15 stw zero,40(sp) - 16fc: 14400017 ldw r17,0(r2) - 1700: 11c00104 addi r7,r2,4 - 1704: d9c01115 stw r7,68(sp) - 1708: 88005a26 beq r17,zero,1874 <___vfprintf_internal_r+0x41c> - 170c: d8c00b17 ldw r3,44(sp) - 1710: dcc00044 addi r19,sp,1 - 1714: 05800244 movi r22,9 - 1718: 182b003a cmpeq r21,r3,zero - 171c: dcc01215 stw r19,72(sp) - 1720: 00000506 br 1738 <___vfprintf_internal_r+0x2e0> - 1724: 21000c04 addi r4,r4,48 - 1728: 99000005 stb r4,0(r19) - 172c: 9cc00044 addi r19,r19,1 - 1730: 80000f26 beq r16,zero,1770 <___vfprintf_internal_r+0x318> - 1734: 8023883a mov r17,r16 - 1738: d9400d17 ldw r5,52(sp) - 173c: 8809883a mov r4,r17 - 1740: 000129c0 call 129c <__udivsi3> - 1744: d9000d17 ldw r4,52(sp) - 1748: 100b883a mov r5,r2 - 174c: 1021883a mov r16,r2 - 1750: 00012ac0 call 12ac <__mulsi3> - 1754: 8889c83a sub r4,r17,r2 - 1758: b13ff20e bge r22,r4,1724 <___vfprintf_internal_r+0x2cc> - 175c: a8009f1e bne r21,zero,19dc <___vfprintf_internal_r+0x584> - 1760: 21000dc4 addi r4,r4,55 - 1764: 99000005 stb r4,0(r19) - 1768: 9cc00044 addi r19,r19,1 - 176c: 803ff11e bne r16,zero,1734 <___vfprintf_internal_r+0x2dc> - 1770: d8801217 ldw r2,72(sp) - 1774: 98a3c83a sub r17,r19,r2 - 1778: d8c00917 ldw r3,36(sp) - 177c: 1c4bc83a sub r5,r3,r17 - 1780: 0140130e bge zero,r5,17d0 <___vfprintf_internal_r+0x378> - 1784: d8c00044 addi r3,sp,1 - 1788: 18800804 addi r2,r3,32 - 178c: 9880102e bgeu r19,r2,17d0 <___vfprintf_internal_r+0x378> - 1790: 00800c04 movi r2,48 - 1794: 28ffffc4 addi r3,r5,-1 - 1798: 98800005 stb r2,0(r19) - 179c: 99000044 addi r4,r19,1 - 17a0: 00c0080e bge zero,r3,17c4 <___vfprintf_internal_r+0x36c> - 17a4: d8c00044 addi r3,sp,1 - 17a8: 18800804 addi r2,r3,32 - 17ac: 2080052e bgeu r4,r2,17c4 <___vfprintf_internal_r+0x36c> - 17b0: 00800c04 movi r2,48 - 17b4: 20800005 stb r2,0(r4) - 17b8: 21000044 addi r4,r4,1 - 17bc: 9945883a add r2,r19,r5 - 17c0: 20bff81e bne r4,r2,17a4 <___vfprintf_internal_r+0x34c> - 17c4: d8801217 ldw r2,72(sp) - 17c8: 2027883a mov r19,r4 - 17cc: 20a3c83a sub r17,r4,r2 - 17d0: d8c00a17 ldw r3,40(sp) - 17d4: 1c45883a add r2,r3,r17 - 17d8: e0a1c83a sub r16,fp,r2 - 17dc: d8800f17 ldw r2,60(sp) - 17e0: 10008026 beq r2,zero,19e4 <___vfprintf_internal_r+0x58c> - 17e4: 1805003a cmpeq r2,r3,zero - 17e8: 1000ae26 beq r2,zero,1aa4 <___vfprintf_internal_r+0x64c> - 17ec: 0400a516 blt zero,r16,1a84 <___vfprintf_internal_r+0x62c> - 17f0: b805883a mov r2,r23 - 17f4: 0440950e bge zero,r17,1a4c <___vfprintf_internal_r+0x5f4> - 17f8: 102f883a mov r23,r2 - 17fc: 1461883a add r16,r2,r17 - 1800: 00000206 br 180c <___vfprintf_internal_r+0x3b4> - 1804: bdc00044 addi r23,r23,1 - 1808: 85ffae26 beq r16,r23,16c4 <___vfprintf_internal_r+0x26c> - 180c: 9cffffc4 addi r19,r19,-1 - 1810: 98800003 ldbu r2,0(r19) - 1814: a0c00117 ldw r3,4(r20) - 1818: d9001017 ldw r4,64(sp) - 181c: d8800005 stb r2,0(sp) - 1820: a00b883a mov r5,r20 - 1824: d80d883a mov r6,sp - 1828: 01c00044 movi r7,1 - 182c: 183ee83a callr r3 - 1830: 103ff426 beq r2,zero,1804 <___vfprintf_internal_r+0x3ac> - 1834: 05ffffc4 movi r23,-1 - 1838: 003f3b06 br 1528 <___vfprintf_internal_r+0xd0> - 183c: 00c00404 movi r3,16 - 1840: d8c00d15 stw r3,52(sp) - 1844: d8000c15 stw zero,48(sp) - 1848: d8c00e17 ldw r3,56(sp) - 184c: 1805003a cmpeq r2,r3,zero - 1850: 103fa626 beq r2,zero,16ec <___vfprintf_internal_r+0x294> - 1854: d8c00c17 ldw r3,48(sp) - 1858: 1800171e bne r3,zero,18b8 <___vfprintf_internal_r+0x460> - 185c: d8c01117 ldw r3,68(sp) - 1860: d8000a15 stw zero,40(sp) - 1864: 1c400017 ldw r17,0(r3) - 1868: 19c00104 addi r7,r3,4 - 186c: d9c01115 stw r7,68(sp) - 1870: 883fa61e bne r17,zero,170c <___vfprintf_internal_r+0x2b4> - 1874: dcc00044 addi r19,sp,1 - 1878: dcc01215 stw r19,72(sp) - 187c: 003fbe06 br 1778 <___vfprintf_internal_r+0x320> - 1880: 04000084 movi r16,2 - 1884: d9c00f15 stw r7,60(sp) - 1888: 003f0b06 br 14b8 <___vfprintf_internal_r+0x60> - 188c: 040000c4 movi r16,3 - 1890: 003f0906 br 14b8 <___vfprintf_internal_r+0x60> - 1894: 00800044 movi r2,1 - 1898: 040000c4 movi r16,3 - 189c: d8800e15 stw r2,56(sp) - 18a0: 003f0506 br 14b8 <___vfprintf_internal_r+0x60> - 18a4: 0007883a mov r3,zero - 18a8: 003f4e06 br 15e4 <___vfprintf_internal_r+0x18c> - 18ac: 00800044 movi r2,1 - 18b0: d8800915 stw r2,36(sp) - 18b4: 003f5706 br 1614 <___vfprintf_internal_r+0x1bc> - 18b8: d8801117 ldw r2,68(sp) - 18bc: 14400017 ldw r17,0(r2) - 18c0: 10800104 addi r2,r2,4 - 18c4: d8801115 stw r2,68(sp) - 18c8: 88000716 blt r17,zero,18e8 <___vfprintf_internal_r+0x490> - 18cc: d8000a15 stw zero,40(sp) - 18d0: 003f8d06 br 1708 <___vfprintf_internal_r+0x2b0> - 18d4: d8c01117 ldw r3,68(sp) - 18d8: 1c400017 ldw r17,0(r3) - 18dc: 18c00104 addi r3,r3,4 - 18e0: d8c01115 stw r3,68(sp) - 18e4: 883ff90e bge r17,zero,18cc <___vfprintf_internal_r+0x474> - 18e8: 00800044 movi r2,1 - 18ec: 0463c83a sub r17,zero,r17 - 18f0: d8800a15 stw r2,40(sp) - 18f4: 003f8406 br 1708 <___vfprintf_internal_r+0x2b0> - 18f8: 04000044 movi r16,1 - 18fc: 8700080e bge r16,fp,1920 <___vfprintf_internal_r+0x4c8> - 1900: d9001017 ldw r4,64(sp) - 1904: a00b883a mov r5,r20 - 1908: 01800804 movi r6,32 - 190c: e1ffffc4 addi r7,fp,-1 - 1910: 00013d80 call 13d8 - 1914: 103fc71e bne r2,zero,1834 <___vfprintf_internal_r+0x3dc> - 1918: e5c5883a add r2,fp,r23 - 191c: 15ffffc4 addi r23,r2,-1 - 1920: d8c01117 ldw r3,68(sp) - 1924: d9001017 ldw r4,64(sp) - 1928: 800f883a mov r7,r16 - 192c: 18800017 ldw r2,0(r3) - 1930: a0c00117 ldw r3,4(r20) - 1934: a00b883a mov r5,r20 - 1938: d8800005 stb r2,0(sp) - 193c: d80d883a mov r6,sp - 1940: 183ee83a callr r3 - 1944: 103fbb1e bne r2,zero,1834 <___vfprintf_internal_r+0x3dc> - 1948: d8801117 ldw r2,68(sp) - 194c: bdc00044 addi r23,r23,1 - 1950: 0021883a mov r16,zero - 1954: 10800104 addi r2,r2,4 - 1958: d8801115 stw r2,68(sp) - 195c: 003ed606 br 14b8 <___vfprintf_internal_r+0x60> - 1960: 00800204 movi r2,8 - 1964: d8800d15 stw r2,52(sp) - 1968: d8000c15 stw zero,48(sp) - 196c: 003fb606 br 1848 <___vfprintf_internal_r+0x3f0> - 1970: d8c01117 ldw r3,68(sp) - 1974: 1cc00017 ldw r19,0(r3) - 1978: 9809883a mov r4,r19 - 197c: 0001c300 call 1c30 - 1980: e0a1c83a sub r16,fp,r2 - 1984: 1023883a mov r17,r2 - 1988: 0400070e bge zero,r16,19a8 <___vfprintf_internal_r+0x550> - 198c: d9001017 ldw r4,64(sp) - 1990: a00b883a mov r5,r20 - 1994: 01800804 movi r6,32 - 1998: 800f883a mov r7,r16 - 199c: 00013d80 call 13d8 - 19a0: 103fa41e bne r2,zero,1834 <___vfprintf_internal_r+0x3dc> - 19a4: bc2f883a add r23,r23,r16 - 19a8: a0c00117 ldw r3,4(r20) - 19ac: d9001017 ldw r4,64(sp) - 19b0: 980d883a mov r6,r19 - 19b4: a00b883a mov r5,r20 - 19b8: 880f883a mov r7,r17 - 19bc: 183ee83a callr r3 - 19c0: 103f9c1e bne r2,zero,1834 <___vfprintf_internal_r+0x3dc> - 19c4: d8801117 ldw r2,68(sp) - 19c8: bc6f883a add r23,r23,r17 - 19cc: 0021883a mov r16,zero - 19d0: 10800104 addi r2,r2,4 - 19d4: d8801115 stw r2,68(sp) - 19d8: 003eb706 br 14b8 <___vfprintf_internal_r+0x60> - 19dc: 210015c4 addi r4,r4,87 - 19e0: 003f5106 br 1728 <___vfprintf_internal_r+0x2d0> - 19e4: 04003b16 blt zero,r16,1ad4 <___vfprintf_internal_r+0x67c> - 19e8: d8c00a17 ldw r3,40(sp) - 19ec: 1805003a cmpeq r2,r3,zero - 19f0: 103f7f1e bne r2,zero,17f0 <___vfprintf_internal_r+0x398> - 19f4: a0c00117 ldw r3,4(r20) - 19f8: d9001017 ldw r4,64(sp) - 19fc: 00800b44 movi r2,45 - 1a00: d8800005 stb r2,0(sp) - 1a04: a00b883a mov r5,r20 - 1a08: d80d883a mov r6,sp - 1a0c: 01c00044 movi r7,1 - 1a10: 183ee83a callr r3 - 1a14: 103f871e bne r2,zero,1834 <___vfprintf_internal_r+0x3dc> - 1a18: b8800044 addi r2,r23,1 - 1a1c: 003f7506 br 17f4 <___vfprintf_internal_r+0x39c> - 1a20: 0007883a mov r3,zero - 1a24: 003edb06 br 1594 <___vfprintf_internal_r+0x13c> - 1a28: a0c00117 ldw r3,4(r20) - 1a2c: d9001017 ldw r4,64(sp) - 1a30: d9400005 stb r5,0(sp) - 1a34: d80d883a mov r6,sp - 1a38: a00b883a mov r5,r20 - 1a3c: 183ee83a callr r3 - 1a40: 103f7c1e bne r2,zero,1834 <___vfprintf_internal_r+0x3dc> - 1a44: bdc00044 addi r23,r23,1 - 1a48: 003e9b06 br 14b8 <___vfprintf_internal_r+0x60> - 1a4c: 102f883a mov r23,r2 - 1a50: 0021883a mov r16,zero - 1a54: 003e9806 br 14b8 <___vfprintf_internal_r+0x60> - 1a58: a0c00117 ldw r3,4(r20) - 1a5c: d9000005 stb r4,0(sp) - 1a60: d9001017 ldw r4,64(sp) - 1a64: a00b883a mov r5,r20 - 1a68: d80d883a mov r6,sp - 1a6c: 800f883a mov r7,r16 - 1a70: 183ee83a callr r3 - 1a74: 103f6f1e bne r2,zero,1834 <___vfprintf_internal_r+0x3dc> - 1a78: bc2f883a add r23,r23,r16 - 1a7c: 0021883a mov r16,zero - 1a80: 003e8d06 br 14b8 <___vfprintf_internal_r+0x60> - 1a84: d9001017 ldw r4,64(sp) - 1a88: a00b883a mov r5,r20 - 1a8c: 01800c04 movi r6,48 - 1a90: 800f883a mov r7,r16 - 1a94: 00013d80 call 13d8 - 1a98: 103f661e bne r2,zero,1834 <___vfprintf_internal_r+0x3dc> - 1a9c: bc05883a add r2,r23,r16 - 1aa0: 003f5406 br 17f4 <___vfprintf_internal_r+0x39c> - 1aa4: a0c00117 ldw r3,4(r20) - 1aa8: d9001017 ldw r4,64(sp) - 1aac: 00800b44 movi r2,45 - 1ab0: d8800005 stb r2,0(sp) - 1ab4: a00b883a mov r5,r20 - 1ab8: d80d883a mov r6,sp - 1abc: 01c00044 movi r7,1 - 1ac0: 183ee83a callr r3 - 1ac4: 103f5b1e bne r2,zero,1834 <___vfprintf_internal_r+0x3dc> - 1ac8: bdc00044 addi r23,r23,1 - 1acc: 043f480e bge zero,r16,17f0 <___vfprintf_internal_r+0x398> - 1ad0: 003fec06 br 1a84 <___vfprintf_internal_r+0x62c> - 1ad4: d9001017 ldw r4,64(sp) - 1ad8: a00b883a mov r5,r20 - 1adc: 01800804 movi r6,32 - 1ae0: 800f883a mov r7,r16 - 1ae4: 00013d80 call 13d8 - 1ae8: 103f521e bne r2,zero,1834 <___vfprintf_internal_r+0x3dc> - 1aec: bc2f883a add r23,r23,r16 - 1af0: 003fbd06 br 19e8 <___vfprintf_internal_r+0x590> - -00001af4 <__vfprintf_internal>: - 1af4: 00800034 movhi r2,0 - 1af8: 10883c04 addi r2,r2,8432 - 1afc: 2013883a mov r9,r4 - 1b00: 11000017 ldw r4,0(r2) - 1b04: 2805883a mov r2,r5 - 1b08: 300f883a mov r7,r6 - 1b0c: 480b883a mov r5,r9 - 1b10: 100d883a mov r6,r2 - 1b14: 00014581 jmpi 1458 <___vfprintf_internal_r> - -00001b18 <__sfvwrite_small_str>: - 1b18: 2900000b ldhu r4,0(r5) - 1b1c: defffd04 addi sp,sp,-12 - 1b20: dc000015 stw r16,0(sp) - 1b24: 20ffffcc andi r3,r4,65535 - 1b28: 1880020c andi r2,r3,8 - 1b2c: 2821883a mov r16,r5 - 1b30: dfc00215 stw ra,8(sp) - 1b34: dc400115 stw r17,4(sp) - 1b38: 300b883a mov r5,r6 - 1b3c: 10001d26 beq r2,zero,1bb4 <__sfvwrite_small_str+0x9c> - 1b40: 8080008f ldh r2,2(r16) - 1b44: 1000190e bge r2,zero,1bac <__sfvwrite_small_str+0x94> - 1b48: 1880800c andi r2,r3,512 - 1b4c: 10001726 beq r2,zero,1bac <__sfvwrite_small_str+0x94> - 1b50: 81800517 ldw r6,20(r16) - 1b54: 31c0020e bge r6,r7,1b60 <__sfvwrite_small_str+0x48> - 1b58: 1880200c andi r2,r3,128 - 1b5c: 1000131e bne r2,zero,1bac <__sfvwrite_small_str+0x94> - 1b60: 3023883a mov r17,r6 - 1b64: 3980010e bge r7,r6,1b6c <__sfvwrite_small_str+0x54> - 1b68: 3823883a mov r17,r7 - 1b6c: 81000417 ldw r4,16(r16) - 1b70: 880d883a mov r6,r17 - 1b74: 0001bd00 call 1bd0 - 1b78: 80800417 ldw r2,16(r16) - 1b7c: 80c00517 ldw r3,20(r16) - 1b80: 0009883a mov r4,zero - 1b84: 1445883a add r2,r2,r17 - 1b88: 1c47c83a sub r3,r3,r17 - 1b8c: 80800415 stw r2,16(r16) - 1b90: 2005883a mov r2,r4 - 1b94: 80c00515 stw r3,20(r16) - 1b98: dfc00217 ldw ra,8(sp) - 1b9c: dc400117 ldw r17,4(sp) - 1ba0: dc000017 ldw r16,0(sp) - 1ba4: dec00304 addi sp,sp,12 - 1ba8: f800283a ret - 1bac: 20801014 ori r2,r4,64 - 1bb0: 8080000d sth r2,0(r16) - 1bb4: 013fffc4 movi r4,-1 - 1bb8: 2005883a mov r2,r4 - 1bbc: dfc00217 ldw ra,8(sp) - 1bc0: dc400117 ldw r17,4(sp) - 1bc4: dc000017 ldw r16,0(sp) - 1bc8: dec00304 addi sp,sp,12 - 1bcc: f800283a ret - -00001bd0 : - 1bd0: 2011883a mov r8,r4 - 1bd4: 2900022e bgeu r5,r4,1be0 - 1bd8: 2989883a add r4,r5,r6 - 1bdc: 41000a36 bltu r8,r4,1c08 - 1be0: 30000726 beq r6,zero,1c00 - 1be4: 000f883a mov r7,zero - 1be8: 29c5883a add r2,r5,r7 - 1bec: 11000003 ldbu r4,0(r2) - 1bf0: 3a07883a add r3,r7,r8 - 1bf4: 39c00044 addi r7,r7,1 - 1bf8: 19000005 stb r4,0(r3) - 1bfc: 31fffa1e bne r6,r7,1be8 - 1c00: 4005883a mov r2,r8 - 1c04: f800283a ret - 1c08: 303ffd26 beq r6,zero,1c00 - 1c0c: 4187883a add r3,r8,r6 - 1c10: 198dc83a sub r6,r3,r6 - 1c14: 213fffc4 addi r4,r4,-1 - 1c18: 20800003 ldbu r2,0(r4) - 1c1c: 18ffffc4 addi r3,r3,-1 - 1c20: 18800005 stb r2,0(r3) - 1c24: 19bffb1e bne r3,r6,1c14 - 1c28: 4005883a mov r2,r8 - 1c2c: f800283a ret - -00001c30 : - 1c30: 20800007 ldb r2,0(r4) - 1c34: 10000526 beq r2,zero,1c4c - 1c38: 2007883a mov r3,r4 - 1c3c: 18c00044 addi r3,r3,1 - 1c40: 18800007 ldb r2,0(r3) - 1c44: 103ffd1e bne r2,zero,1c3c - 1c48: 1905c83a sub r2,r3,r4 - 1c4c: f800283a ret - -00001c50 : - -static void ALT_INLINE alt_load_section (alt_u32* from, - alt_u32* to, - alt_u32* end) -{ - if (to != from) - 1c50: 2900051e bne r5,r4,1c68 - 1c54: f800283a ret - { - while( to != end ) - { - *to++ = *from++; - 1c58: 20800017 ldw r2,0(r4) - 1c5c: 21000104 addi r4,r4,4 - 1c60: 28800015 stw r2,0(r5) - 1c64: 29400104 addi r5,r5,4 - alt_u32* to, - alt_u32* end) -{ - if (to != from) - { - while( to != end ) - 1c68: 29bffb1e bne r5,r6,1c58 - 1c6c: f800283a ret - -00001c70 : - * there is no bootloader, so this application is responsible for loading to - * RAM any sections that are required. - */ - -void alt_load (void) -{ - 1c70: deffff04 addi sp,sp,-4 - /* - * Copy the .rwdata section. - */ - - alt_load_section (&__flash_rwdata_start, - 1c74: 01000034 movhi r4,0 - 1c78: 21083f04 addi r4,r4,8444 - 1c7c: 01400034 movhi r5,0 - 1c80: 29480304 addi r5,r5,8204 - 1c84: 01800034 movhi r6,0 - 1c88: 31883f04 addi r6,r6,8444 - * there is no bootloader, so this application is responsible for loading to - * RAM any sections that are required. - */ - -void alt_load (void) -{ - 1c8c: dfc00015 stw ra,0(sp) - /* - * Copy the .rwdata section. - */ - - alt_load_section (&__flash_rwdata_start, - 1c90: 0001c500 call 1c50 - - /* - * Copy the exception handler. - */ - - alt_load_section (&__flash_exceptions_start, - 1c94: 01000034 movhi r4,0 - 1c98: 21000804 addi r4,r4,32 - 1c9c: 01400034 movhi r5,0 - 1ca0: 29400804 addi r5,r5,32 - 1ca4: 01800034 movhi r6,0 - 1ca8: 31800804 addi r6,r6,32 - 1cac: 0001c500 call 1c50 - - /* - * Copy the .rodata section. - */ - - alt_load_section (&__flash_rodata_start, - 1cb0: 01000034 movhi r4,0 - 1cb4: 21074f04 addi r4,r4,7484 - 1cb8: 01400034 movhi r5,0 - 1cbc: 29474f04 addi r5,r5,7484 - 1cc0: 01800034 movhi r6,0 - 1cc4: 31880304 addi r6,r6,8204 - 1cc8: 0001c500 call 1c50 - - /* - * Now ensure that the caches are in synch. - */ - - alt_dcache_flush_all(); - 1ccc: 0001d2c0 call 1d2c - alt_icache_flush_all(); -} - 1cd0: dfc00017 ldw ra,0(sp) - 1cd4: dec00104 addi sp,sp,4 - /* - * Now ensure that the caches are in synch. - */ - - alt_dcache_flush_all(); - alt_icache_flush_all(); - 1cd8: 0001d301 jmpi 1d30 - -00001cdc : - * devices/filesystems/components in the system; and call the entry point for - * the users application, i.e. main(). - */ - -void alt_main (void) -{ - 1cdc: deffff04 addi sp,sp,-4 -#endif - - /* ALT LOG - please see HAL/sys/alt_log_printf.h for details */ - ALT_LOG_PRINT_BOOT("[alt_main.c] Entering alt_main, calling alt_irq_init.\r\n"); - /* Initialize the interrupt controller. */ - alt_irq_init (NULL); - 1ce0: 0009883a mov r4,zero - * devices/filesystems/components in the system; and call the entry point for - * the users application, i.e. main(). - */ - -void alt_main (void) -{ - 1ce4: dfc00015 stw ra,0(sp) -#endif - - /* ALT LOG - please see HAL/sys/alt_log_printf.h for details */ - ALT_LOG_PRINT_BOOT("[alt_main.c] Entering alt_main, calling alt_irq_init.\r\n"); - /* Initialize the interrupt controller. */ - alt_irq_init (NULL); - 1ce8: 0001d0c0 call 1d0c - ALT_LOG_PRINT_BOOT("[alt_main.c] Done OS Init, calling alt_sem_create.\r\n"); - ALT_SEM_CREATE (&alt_fd_list_lock, 1); - - /* Initialize the device drivers/software components. */ - ALT_LOG_PRINT_BOOT("[alt_main.c] Calling alt_sys_init.\r\n"); - alt_sys_init(); - 1cec: 0001d080 call 1d08 - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Calling main.\r\n"); - -#ifdef ALT_NO_EXIT - main (alt_argc, alt_argv, alt_envp); - 1cf0: d1204617 ldw r4,-32488(gp) - 1cf4: d1604717 ldw r5,-32484(gp) - 1cf8: d1a04817 ldw r6,-32480(gp) - close(STDOUT_FILENO); - exit (result); -#endif - - ALT_LOG_PRINT_BOOT("[alt_main.c] After main - we should not be here?.\r\n"); -} - 1cfc: dfc00017 ldw ra,0(sp) - 1d00: dec00104 addi sp,sp,4 - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Calling main.\r\n"); - -#ifdef ALT_NO_EXIT - main (alt_argc, alt_argv, alt_envp); - 1d04: 00003e81 jmpi 3e8
- -00001d08 : - */ - -void alt_sys_init( void ) -{ - ALTERA_AVALON_JTAG_UART_INIT ( JTAG_UART, jtag_uart); -} - 1d08: f800283a ret - -00001d0c : - * The "base" parameter is ignored and only - * present for backwards-compatibility. - */ - -void alt_irq_init ( const void* base ) -{ - 1d0c: deffff04 addi sp,sp,-4 - 1d10: dfc00015 stw ra,0(sp) - ALTERA_NIOS2_QSYS_IRQ_INIT ( NIOS2_PROCESSOR, nios2_processor); - 1d14: 0001d340 call 1d34 - * alt_irq_cpu_enable_interrupts() enables the CPU to start taking interrupts. - */ -static ALT_INLINE void ALT_ALWAYS_INLINE - alt_irq_cpu_enable_interrupts () -{ - NIOS2_WRITE_STATUS(NIOS2_STATUS_PIE_MSK - 1d18: 00800044 movi r2,1 - 1d1c: 1001703a wrctl status,r2 - alt_irq_cpu_enable_interrupts(); -} - 1d20: dfc00017 ldw ra,0(sp) - 1d24: dec00104 addi sp,sp,4 - 1d28: f800283a ret - -00001d2c : - for (i = (char*) 0; i < (char*) NIOS2_DCACHE_SIZE; i+= NIOS2_DCACHE_LINE_SIZE) - { - __asm__ volatile ("flushd (%0)" :: "r" (i)); - } -#endif /* NIOS2_DCACHE_SIZE > 0 */ -} - 1d2c: f800283a ret - -00001d30 : -void alt_icache_flush_all (void) -{ -#if NIOS2_ICACHE_SIZE > 0 - alt_icache_flush (0, NIOS2_ICACHE_SIZE); -#endif -} - 1d30: f800283a ret - -00001d34 : - * To initialize the internal interrupt controller, just clear the IENABLE - * register so that all possible IRQs are disabled. - */ -void altera_nios2_qsys_irq_init(void) -{ - NIOS2_WRITE_IENABLE(0); - 1d34: 000170fa wrctl ienable,zero -} - 1d38: f800283a ret diff --git a/software/qsys_tutorial_lcd/readme.txt b/software/qsys_tutorial_lcd/readme.txt deleted file mode 100644 index 3dc3186..0000000 --- a/software/qsys_tutorial_lcd/readme.txt +++ /dev/null @@ -1,67 +0,0 @@ -Readme - Hello World Software Example - -DESCRIPTION: -Simple program that prints "Hello from Nios II" - -The purpose of this example is to demonstrate the smallest possible Hello -World application, using the Nios II HAL BSP. The memory footprint -of this hosted application is intended to be less than 1 kbytes by default using a standard -reference design. For a more fully featured Hello World application -example, see the example titled "Hello World". - -The memory footprint of this example has been reduced by making the -following changes to the normal "Hello World" example. -Check in the Nios II Software Developers Handbook for a more complete -description. - -In the SW Application project: - - In the C/C++ Build page - - Set the Optimization Level to -Os - -In BSP project: - - In the C/C++ Build page - - - Set the Optimization Level to -Os - - - Define the preprocessor option ALT_NO_INSTRUCTION_EMULATION - This removes software exception handling, which means that you cannot - run code compiled for Nios II cpu with a hardware multiplier on a core - without a the multiply unit. Check the Nios II Software Developers - Manual for more details. - - - In the BSP: - - Set Periodic system timer and Timestamp timer to none - This prevents the automatic inclusion of the timer driver. - - - Set Max file descriptors to 4 - This reduces the size of the file handle pool. - - - Uncheck Clean exit (flush buffers) - This removes the call to exit, and when main is exitted instead of - calling exit the software will just spin in a loop. - - - Check Small C library - This uses a reduced functionality C library, which lacks - support for buffering, file IO, floating point and getch(), etc. - Check the Nios II Software Developers Manual for a complete list. - - - Check Reduced device drivers - This uses reduced functionality drivers if they're available. For the - standard design this means you get polled UART and JTAG UART drivers, - no support for the LCD driver and you lose the ability to program - CFI compliant flash devices. - - -PERIPHERALS USED: -This example exercises the following peripherals: -- STDOUT device (UART or JTAG UART) - -SOFTWARE SOURCE FILES: -This example includes the following software source files: -- small_hello_world.c: - -BOARD/HOST REQUIREMENTS: -This example requires only a JTAG connection with a Nios Development board. If -the host communication settings are changed from JTAG UART (default) to use a -conventional UART, a serial cable between board DB-9 connector and the host is -required. diff --git a/software/qsys_tutorial_lcd/sys_memory.c b/software/qsys_tutorial_lcd/sys_memory.c deleted file mode 100644 index c8faff6..0000000 --- a/software/qsys_tutorial_lcd/sys_memory.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * sys_memory.c - * - * Created on: 2016/11/24 - * Author: takayun - */ -#include "system.h" -#include "sys_memory.h" -#include "sys_register.h" - -/************************************************** - * Public - **************************************************/ - -// �����������̂ǂ̃�������(0 < global_current_memory < MEMS_COUNT) -unsigned int global_current_memory = 0; - -/************************************************** - * Private - **************************************************/ - -// �����������̕ϐ� -static char memory[MEMS_COUNT][MEM_SIZE]; - -static struct InstRec inst_memory[MEMS_COUNT][MEM_SIZE]; - - -/************************************************** - * Impl - **************************************************/ - -void memory_init() { - int i, j; - for (i = 0; i < MEMS_COUNT; i++) - for (j = 0; j < MEM_SIZE; j++) { - memory[i][j] = 0; - } -} - -void inst_memory_store(unsigned int mem_addr, struct InstRec inst_rec){ - inst_memory[global_current_memory][mem_addr] = inst_rec; -} -struct InstRec inst_memory_load(unsigned int mem_addr){ - return inst_memory[global_current_memory][mem_addr]; -} - -char memory_store(unsigned int mem_addr, enum Register reg) { - if (!(mem_addr < MEM_SIZE)) panic(); - memory[global_current_memory][mem_addr] = global_registers[reg]; - return memory[global_current_memory][mem_addr]; -} - -char memory_load(unsigned int mem_addr, enum Register reg) { - if (!(mem_addr < MEM_SIZE)) panic(); - global_registers[reg] = memory[global_current_memory][mem_addr]; - return global_registers[reg]; -} - diff --git a/software/qsys_tutorial_lcd/sys_memory.h b/software/qsys_tutorial_lcd/sys_memory.h deleted file mode 100644 index 648fe11..0000000 --- a/software/qsys_tutorial_lcd/sys_memory.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * sys_memory.h - * - * Created on: 2016/11/24 - * Author: takayun - */ - -#ifndef SYS_MEMORY_H_ -#define SYS_MEMORY_H_ - -#include "sys_register.h" -#include "inst_decoder.h" - -/************************************************** - * Defines - **************************************************/ - -// �������̐� -#define MEMS_COUNT 4 - -// 1�������̃T�C�Y -#define MEM_SIZE 16 - -/************************************************** - * Variables - **************************************************/ - -extern unsigned int global_current_memory; - -/************************************************** - * Functions - **************************************************/ - -/* Function: memory_init - * Sammary: - * ������������������(All 0) */ -void memory_init(); - -/* ���ߗp�������ɖ��߂̃X�g�A&���[�h */ - -/* Function: memory_store -> char - * Sammary: - * �������̎w��Ԓn�Ɏw�肵�����W�X�^����l���i�[���� - * Return: - * �������Ɋi�[���ꂽ�l */ -void inst_memory_store(unsigned int mem_addr, struct InstRec inst_rec); -struct InstRec inst_memory_load(unsigned int mem_addr); - - -/* ������-���W�X�^�Ԃ̑��� */ - -/* Function: memory_store -> char - * Sammary: - * �������̎w��Ԓn�Ɏw�肵�����W�X�^����l���i�[���� - * Return: - * �������Ɋi�[���ꂽ�l */ -char memory_store(unsigned int mem_addr, enum Register reg); - -/* Function: memory_store -> char - * Sammary: - * �w�肵�����W�X�^�Ƀ������̎w��Ԓn����l���i�[���� - * Return: - * ���W�X�^�Ɋi�[���ꂽ�l */ -char memory_load(unsigned int mem_addr, enum Register reg); - - -#endif /* SYS_MEMORY_H_ */ diff --git a/software/qsys_tutorial_lcd/sys_register.c b/software/qsys_tutorial_lcd/sys_register.c deleted file mode 100644 index 84ed485..0000000 --- a/software/qsys_tutorial_lcd/sys_register.c +++ /dev/null @@ -1,17 +0,0 @@ -/* - * sys_register.c - * - * Created on: 2016/11/24 - * Author: takayun - */ -#include "sys_register.h" - -char global_registers[REG_MAX_COUNT]; - -void registers_init() { - int i; - for (i = 0; i < REG_MAX_COUNT; i++) global_registers[i] = 0; -} - - - diff --git a/software/qsys_tutorial_lcd/sys_register.h b/software/qsys_tutorial_lcd/sys_register.h deleted file mode 100644 index 65ad219..0000000 --- a/software/qsys_tutorial_lcd/sys_register.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * sys_register.h - * - * Created on: 2016/11/24 - * Author: takayun - */ - -#ifndef SYS_REGISTER_H_ -#define SYS_REGISTER_H_ - -/************************************************** - * Defines - **************************************************/ - -// ���W�X�^�̒�` -enum Register { - /* �ʏ�̃��W�X�^ */ - Szero, //�[�����W�X�^ - Spc, //�v���O�����J�E���^ - Ssp, //�X�^�b�N�|�C���^ - Sgp0, //�ėp���W�X�^0 - Sgp1, //�ėp���W�X�^1 - Sacc, //�A�L�������[�^ - Sflg, //�t���O���W�X�^ - /* �X�C�b�`�ǂݏo���p���W�X�^ */ - Ssw_data, //�f�[�^(8bit) - Ssw_inst, //����(4bit) - Ssw_regi, //���W�X�^�ԍ�(4bit) - Ssw_memi, //�������Ԓn(4bit) - Ssw_psel, //�v���O�����Z���N�^(4bit) - Ssw_rw, //�ǂݏ������[�h(1bit) - Ssw_run, //���s���[�h(1bit) - /* 7�Z�O�p���W�X�^ */ - Sseg, - - /* �z��錾�p */ - REG_MAX_COUNT -}; - -/************************************************** - * Variables - **************************************************/ - -// ���W�X�^�p�̕ϐ� -extern char global_registers[REG_MAX_COUNT]; - -/************************************************** - * Functions - **************************************************/ - -void registers_init(); - - -#endif /* SYS_REGISTER_H_ */ diff --git a/software/qsys_tutorial_lcd/system.c b/software/qsys_tutorial_lcd/system.c deleted file mode 100644 index 30713dd..0000000 --- a/software/qsys_tutorial_lcd/system.c +++ /dev/null @@ -1,14 +0,0 @@ -/* - * system.c - * - * Created on: 2016/11/24 - * Author: takayun - */ -#include "system.h" -#include "hex_out.h" - -void panic() { - clear_block(HEX0_3); - print_block("err ", 4, HEX0_3); -} - diff --git a/software/qsys_tutorial_lcd/system.h b/software/qsys_tutorial_lcd/system.h deleted file mode 100644 index 1a628fa..0000000 --- a/software/qsys_tutorial_lcd/system.h +++ /dev/null @@ -1,13 +0,0 @@ -/* - * system.h - * - * Created on: 2016/11/24 - * Author: takayun - */ - -#ifndef SYSTEM_H_ -#define SYSTEM_H_ - -void panic(); - -#endif /* SYSTEM_H_ */ diff --git a/software/qsys_tutorial_lcd/system/template.xml b/software/qsys_tutorial_lcd/system/template.xml deleted file mode 100644 index b09e912..0000000 --- a/software/qsys_tutorial_lcd/system/template.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git a/software/qsys_tutorial_lcd2/.cproject b/software/qsys_tutorial_lcd2/.cproject deleted file mode 100644 index 408fd00..0000000 --- a/software/qsys_tutorial_lcd2/.cproject +++ /dev/null @@ -1,508 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - make - - mem_init_install - true - false - false - - - make - - mem_init_generate - true - false - false - - - make - - help - true - false - false - - - - diff --git a/software/qsys_tutorial_lcd2/.force_relink b/software/qsys_tutorial_lcd2/.force_relink deleted file mode 100644 index e69de29..0000000 --- a/software/qsys_tutorial_lcd2/.force_relink +++ /dev/null diff --git a/software/qsys_tutorial_lcd2/.project b/software/qsys_tutorial_lcd2/.project deleted file mode 100644 index 009651b..0000000 --- a/software/qsys_tutorial_lcd2/.project +++ /dev/null @@ -1,96 +0,0 @@ - - - qsys_tutorial_lcd2 - - - - - - com.altera.sbtgui.project.makefileBuilder - - - - - com.altera.sbtgui.project.makefileBuilder - - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - ?name? - - - - org.eclipse.cdt.make.core.append_environment - true - - - org.eclipse.cdt.make.core.autoBuildTarget - all - - - org.eclipse.cdt.make.core.buildArguments - - - - org.eclipse.cdt.make.core.buildCommand - make - - - org.eclipse.cdt.make.core.buildLocation - ${workspace_loc://qsys_tutorial_lcd2} - - - org.eclipse.cdt.make.core.cleanBuildTarget - clean - - - org.eclipse.cdt.make.core.contents - org.eclipse.cdt.make.core.activeConfigSettings - - - org.eclipse.cdt.make.core.enableAutoBuild - false - - - org.eclipse.cdt.make.core.enableCleanBuild - true - - - org.eclipse.cdt.make.core.enableFullBuild - true - - - org.eclipse.cdt.make.core.fullBuildTarget - all - - - org.eclipse.cdt.make.core.stopOnError - true - - - org.eclipse.cdt.make.core.useDefaultBuildCmd - true - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - org.eclipse.cdt.core.ccnature - com.altera.sbtgui.project.SBTGUINature - com.altera.sbtgui.project.SBTGUIAppNature - com.altera.sbtgui.project.SBTGUIManagedNature - - diff --git a/software/qsys_tutorial_lcd2/Makefile b/software/qsys_tutorial_lcd2/Makefile deleted file mode 100644 index 76ddf36..0000000 --- a/software/qsys_tutorial_lcd2/Makefile +++ /dev/null @@ -1,1093 +0,0 @@ -#------------------------------------------------------------------------------ -# VARIABLES APPENDED TO BY INCLUDED MAKEFILE FRAGMENTS -#------------------------------------------------------------------------------ - -# List of include directories for -I compiler option (-I added when used). -# Includes the BSP. -ALT_INCLUDE_DIRS := - -# List of library directories for -L linker option (-L added when used). -# Includes the BSP. -ALT_LIBRARY_DIRS := - -# List of library names for -l linker option (-l added when used). -# Includes the BSP. -ALT_LIBRARY_NAMES := - -# List of library names for -msys-lib linker option (-msys-lib added when used). -# These are libraries that might be located in the BSP and depend on the BSP -# library, or vice versa -ALT_BSP_DEP_LIBRARY_NAMES := - -# List of dependencies for the linker. This is usually the full pathname -# of each library (*.a) file. -# Includes the BSP. -ALT_LDDEPS := - -# List of root library directories that support running make to build them. -# Includes the BSP and any ALT libraries. -MAKEABLE_LIBRARY_ROOT_DIRS := - -# Generic flags passed to the compiler for different types of input files. -ALT_CFLAGS := -ALT_CXXFLAGS := -ALT_CPPFLAGS := -ALT_ASFLAGS := -ALT_LDFLAGS := - - -#------------------------------------------------------------------------------ -# The adjust-path macro -# -# If COMSPEC/ComSpec is defined, Make is launched from Windows through -# Cygwin. The adjust-path macro converts absolute windows paths into -# unix style paths (Example: c:/dir -> /c/dir). This will ensture -# paths are readable by GNU Make. -# -# If COMSPEC/ComSpec is not defined, Make is launched from linux, and no -# adjustment is necessary -# -#------------------------------------------------------------------------------ - -ifndef COMSPEC -ifdef ComSpec -COMSPEC = $(ComSpec) -endif # ComSpec -endif # COMSPEC - -ifdef COMSPEC # if Windows OS - -ifeq ($(MAKE_VERSION),3.81) -# -# adjust-path/adjust-path-mixed for Mingw Gnu Make on Windows -# -# Example Usage: -# $(call adjust-path,c:/aaa/bbb) => /c/aaa/bbb -# $(call adjust-path-mixed,/c/aaa/bbb) => c:/aaa/bbb -# $(call adjust-path-mixed,/cygdrive/c/aaa/bbb) => c:/aaa/bbb -# - -# -# adjust-path -# - converts back slash characters into forward slashes -# - if input arg ($1) is an empty string then return the empty string -# - if input arg ($1) does not contain the string ":/", then return input arg -# - using sed, convert mixed path [c:/...] into mingw path [/c/...] -define adjust-path -$(strip \ -$(if $1,\ -$(if $(findstring :/,$(subst \,/,$1)),\ -$(shell echo $(subst \,/,$1) | sed -e 's,^\([a-zA-Z]\):/,/\1/,'),\ -$(subst \,/,$1)))) -endef - -# -# adjust-path-mixed -# - converts back slash characters into forward slashes -# - if input arg ($1) is an empty string then return the empty string -# - if input arg ($1) does not begin with a forward slash '/' char, then -# return input arg -# - using sed, convert mingw path [/c/...] or cygwin path [/c/cygdrive/...] -# into a mixed path [c:/...] -define adjust-path-mixed -$(strip \ -$(if $1,\ -$(if $(findstring $(subst \,/,$1),$(patsubst /%,%,$(subst \,/,$1))),\ -$(subst \,/,$1),\ -$(shell echo $(subst \,/,$1) | sed -e 's,^/cygdrive/\([a-zA-Z]\)/,\1:/,' -e 's,^/\([a-zA-Z]\)/,\1:/,')))) -endef - -else # MAKE_VERSION != 3.81 (MAKE_VERSION == 3.80 or MAKE_VERSION == 3.79) -# -# adjust-path for Cygwin Gnu Make -# $(call adjust-path,c:/aaa/bbb) = /cygdrive/c/aaa/bbb -# $(call adjust-path-mixed,/cygdrive/c/aaa/bbb) = c:/aaa/bbb -# -adjust-path = $(if $1,$(shell cygpath -u "$1"),) -adjust-path-mixed = $(if $1,$(shell cygpath -m "$1"),) -endif - -else # !COMSPEC - -adjust-path = $1 -adjust-path-mixed = $1 - -endif # COMSPEC - - -#vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv -# GENERATED SETTINGS START v -#vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv - -#START GENERATED -ACTIVE_BUILD_CONFIG := default -BUILD_CONFIGS := default - -# The following TYPE comment allows tools to identify the 'type' of target this -# makefile is associated with. -# TYPE: APP_MAKEFILE - -# This following VERSION comment indicates the version of the tool used to -# generate this makefile. A makefile variable is provided for VERSION as well. -# ACDS_VERSION: 13.0sp1 -ACDS_VERSION := 13.0sp1 - -# This following BUILD_NUMBER comment indicates the build number of the tool -# used to generate this makefile. -# BUILD_NUMBER: 232 - -# Define path to the application ELF. -# It may be used by the makefile fragments so is defined before including them. -# -ELF := qsys_tutorial_lcd2.elf - -# Paths to C, C++, and assembly source files. -C_SRCS += hello_world_small.c -C_SRCS += hex_encoder.c -C_SRCS += hex_out.c -C_SRCS += input_int.c -C_SRCS += inst_decoder.c -C_SRCS += sys_memory.c -C_SRCS += sys_register.c -C_SRCS += system.c -CXX_SRCS := -ASM_SRCS := - - -# Path to root of object file tree. -OBJ_ROOT_DIR := obj - -# Options to control objdump. -CREATE_OBJDUMP := 1 -OBJDUMP_INCLUDE_SOURCE := 1 -OBJDUMP_FULL_CONTENTS := 0 - -# Options to enable/disable optional files. -CREATE_ELF_DERIVED_FILES := 0 -CREATE_LINKER_MAP := 1 - -# Common arguments for ALT_CFLAGSs -APP_CFLAGS_DEFINED_SYMBOLS := -APP_CFLAGS_UNDEFINED_SYMBOLS := -APP_CFLAGS_OPTIMIZATION := -Os -APP_CFLAGS_DEBUG_LEVEL := -g -APP_CFLAGS_WARNINGS := -Wall -APP_CFLAGS_USER_FLAGS := - -APP_ASFLAGS_USER := -APP_LDFLAGS_USER := - -# Linker options that have default values assigned later if not -# assigned here. -LINKER_SCRIPT := -CRT0 := -SYS_LIB := - -# Define path to the root of the BSP. -BSP_ROOT_DIR := ../qsys_tutorial_lcd2_bsp/ - -# List of application specific include directories, library directories and library names -APP_INCLUDE_DIRS := -APP_LIBRARY_DIRS := -APP_LIBRARY_NAMES := - -# Pre- and post- processor settings. -BUILD_PRE_PROCESS := -BUILD_POST_PROCESS := - -QUARTUS_PROJECT_DIR := ../../ - - -#END GENERATED - -#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -# GENERATED SETTINGS END ^ -#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - -#------------------------------------------------------------------------------ -# DEFAULT TARGET -#------------------------------------------------------------------------------ - -# Define the variable used to echo output if not already defined. -ifeq ($(ECHO),) -ECHO := echo -endif - -# Put "all" rule before included makefile fragments because they may -# define rules and we don't want one of those to become the default rule. -.PHONY : all - -all: - @$(ECHO) [$(APP_NAME) build complete] - -all : build_pre_process libs app build_post_process - - -#------------------------------------------------------------------------------ -# VARIABLES DEPENDENT ON GENERATED CONTENT -#------------------------------------------------------------------------------ - -# Define object file directory per build configuration -CONFIG_OBJ_DIR := $(OBJ_ROOT_DIR)/$(ACTIVE_BUILD_CONFIG) - -ifeq ($(BSP_ROOT_DIR),) -$(error Edit Makefile and provide a value for BSP_ROOT_DIR) -endif - -ifeq ($(wildcard $(BSP_ROOT_DIR)),) -$(error BSP directory does not exist: $(BSP_ROOT_DIR)) -endif - -# Define absolute path to the root of the BSP. -ABS_BSP_ROOT_DIR := $(call adjust-path-mixed,$(shell cd "$(BSP_ROOT_DIR)"; pwd)) - -# Include makefile fragments. Define variable ALT_LIBRARY_ROOT_DIR before -# including each makefile fragment so that it knows the path to itself. -BSP_INCLUDE_FILE := $(BSP_ROOT_DIR)/public.mk -ALT_LIBRARY_ROOT_DIR := $(BSP_ROOT_DIR) -include $(BSP_INCLUDE_FILE) -# C2H will need this to touch the BSP public.mk and avoid the sopc file -# out-of-date error during a BSP make -ABS_BSP_INCLUDE_FILE := $(ABS_BSP_ROOT_DIR)/public.mk - - -ifneq ($(WARNING.SMALL_STACK_SIZE),) -# This WARNING is here to protect you from unknowingly using a very small stack -# If the warning is set, increase your stack size or enable the BSP small stack -# setting to eliminate the warning -$(warning WARNING: $(WARNING.SMALL_STACK_SIZE)) -endif - - -# If the BSP public.mk indicates that ALT_SIM_OPTIMIZE is set, rename the ELF -# by prefixing it with RUN_ON_HDL_SIMULATOR_ONLY_. -ifneq ($(filter -DALT_SIM_OPTIMIZE,$(ALT_CPPFLAGS)),) -ELF := RUN_ON_HDL_SIMULATOR_ONLY_$(ELF) -endif - -# If the BSP public.mk indicates that ALT_PROVIDE_GMON is set, add option to -# download_elf target -ifneq ($(filter -DALT_PROVIDE_GMON,$(ALT_CPPFLAGS)),) -GMON_OUT_FILENAME := gmon.out -WRITE_GMON_OPTION := --write-gmon $(GMON_OUT_FILENAME) -endif - -# Name of ELF application. -APP_NAME := $(basename $(ELF)) - -# Set to defaults if variables not already defined in settings. -ifeq ($(LINKER_SCRIPT),) -LINKER_SCRIPT := $(BSP_LINKER_SCRIPT) -endif -ifeq ($(CRT0),) -CRT0 := $(BSP_CRT0) -endif -ifeq ($(SYS_LIB),) -SYS_LIB := $(BSP_SYS_LIB) -endif - -OBJDUMP_NAME := $(APP_NAME).objdump -OBJDUMP_FLAGS := --disassemble --syms --all-header -ifeq ($(OBJDUMP_INCLUDE_SOURCE),1) -OBJDUMP_FLAGS += --source -endif -ifeq ($(OBJDUMP_FULL_CONTENTS),1) -OBJDUMP_FLAGS += --full-contents -endif - -# Create list of linker dependencies (*.a files). -APP_LDDEPS := $(ALT_LDDEPS) $(LDDEPS) - -# Take lists and add required prefixes. -APP_INC_DIRS := $(addprefix -I, $(ALT_INCLUDE_DIRS) $(APP_INCLUDE_DIRS) $(INC_DIRS)) -ASM_INC_PREFIX := -Wa,-I -APP_ASM_INC_DIRS := $(addprefix $(ASM_INC_PREFIX), $(ALT_INCLUDE_DIRS) $(APP_INCLUDE_DIRS) $(INC_DIRS)) -APP_LIB_DIRS := $(addprefix -L, $(ALT_LIBRARY_DIRS) $(APP_LIBRARY_DIRS) $(LIB_DIRS)) -APP_LIBS := $(addprefix -l, $(ALT_LIBRARY_NAMES) $(APP_LIBRARY_NAMES) $(LIBS)) - -ifneq ($(AVOID_NIOS2_GCC3_OPTIONS),) - -# -# Avoid Nios II GCC 3.X options. -# - -# Detect if small newlib C library is requested. -# If yes, remove the -msmallc option because it is -# now handled by other means. -ifneq ($(filter -msmallc,$(ALT_LDFLAGS)),) - ALT_LDFLAGS := $(filter-out -msmallc,$(ALT_LDFLAGS)) - ALT_C_LIBRARY := smallc -else - ALT_C_LIBRARY := c -endif - -# Put each BSP dependent library in a group to avoid circular dependencies. -APP_BSP_DEP_LIBS := $(foreach l,$(ALT_BSP_DEP_LIBRARY_NAMES),-Wl,--start-group -l$(ALT_C_LIBRARY) -lgcc -l$(l) -Wl,--end-group) - -else # !AVOID_NIOS2_GCC3_OPTIONS - -# -# Use Nios II GCC 3.X options. -# -APP_BSP_DEP_LIBS := $(addprefix -msys-lib=, $(ALT_BSP_DEP_LIBRARY_NAMES)) - -endif # !AVOID_NIOS2_GCC3_OPTIONS - -# Arguments for the C preprocessor, C/C++ compiler, assembler, and linker. -APP_CFLAGS := $(APP_CFLAGS_DEFINED_SYMBOLS) \ - $(APP_CFLAGS_UNDEFINED_SYMBOLS) \ - $(APP_CFLAGS_OPTIMIZATION) \ - $(APP_CFLAGS_DEBUG_LEVEL) \ - $(APP_CFLAGS_WARNINGS) \ - $(APP_CFLAGS_USER_FLAGS) \ - $(ALT_CFLAGS) \ - $(CFLAGS) - -# Arguments only for the C++ compiler. -APP_CXXFLAGS := $(ALT_CXXFLAGS) $(CXXFLAGS) - -# Arguments only for the C preprocessor. -# Prefix each include directory with -I. -APP_CPPFLAGS := $(APP_INC_DIRS) \ - $(ALT_CPPFLAGS) \ - $(CPPFLAGS) - -# Arguments only for the assembler. -APP_ASFLAGS := $(APP_ASM_INC_DIRS) \ - $(ALT_ASFLAGS) \ - $(APP_ASFLAGS_USER) \ - $(ASFLAGS) - -# Arguments only for the linker. -APP_LDFLAGS := $(APP_LDFLAGS_USER) - -ifneq ($(LINKER_SCRIPT),) -APP_LDFLAGS += -T'$(LINKER_SCRIPT)' -endif - -ifneq ($(AVOID_NIOS2_GCC3_OPTIONS),) - -# Avoid Nios II GCC 3.x options. -ifneq ($(CRT0),) -APP_LDFLAGS += $(CRT0) -endif - -# The equivalent of the -msys-lib option is provided -# by the GROUP() command in the linker script. -# Note this means the SYS_LIB variable is now ignored. - -else # !AVOID_NIOS2_GCC3_OPTIONS - -# Use Nios II GCC 3.x options. -ifneq ($(CRT0),) -APP_LDFLAGS += -msys-crt0='$(CRT0)' -endif -ifneq ($(SYS_LIB),) -APP_LDFLAGS += -msys-lib=$(SYS_LIB) -endif - -endif # !AVOID_NIOS2_GCC3_OPTIONS - -APP_LDFLAGS += \ - $(APP_LIB_DIRS) \ - $(ALT_LDFLAGS) \ - $(LDFLAGS) - -LINKER_MAP_NAME := $(APP_NAME).map -ifeq ($(CREATE_LINKER_MAP), 1) -APP_LDFLAGS += -Wl,-Map=$(LINKER_MAP_NAME) -endif - -# QUARTUS_PROJECT_DIR and SOPC_NAME need to be defined if you want the -# mem_init_install target of the mem_init.mk (located in the associated BSP) -# to know how to copy memory initialization files (e.g. .dat, .hex) into -# directories required for Quartus compilation or RTL simulation. - -# Defining QUARTUS_PROJECT_DIR causes mem_init_install to copy memory -# initialization files into your Quartus project directory. This is required -# to provide the initial memory contents of FPGA memories that can be -# initialized by the programming file (.sof) or Hardcopy ROMs. It is also used -# for VHDL simulation of on-chip memories. - -# Defining SOPC_NAME causes the mem_init_install target to copy memory -# initialization files into your RTL simulation directory. This is required -# to provide the initial memory contents of all memories that can be -# initialized by RTL simulation. This variable should be set to the same name -# as your SOPC Builder system name. For example, if you have a system called -# "foo.sopc", this variable should be set to "foo". - -# If SOPC_NAME is not set and QUARTUS_PROJECT_DIR is set, then derive SOPC_NAME. -ifeq ($(SOPC_NAME),) -ifneq ($(QUARTUS_PROJECT_DIR),) -SOPC_NAME := $(basename $(notdir $(wildcard $(QUARTUS_PROJECT_DIR)/*.sopcinfo))) -endif -endif - -# Defining JDI_FILE is required to specify the JTAG Debug Information File -# path. This file is generated by Quartus, and is needed along with the -# .sopcinfo file to resolve processor instance ID's from names in a multi-CPU -# systems. For multi-CPU systems, the processor instance ID is used to select -# from multiple CPU's during ELF download. - -# Both JDI_FILE and SOPCINFO_FILE are provided by the BSP if they found during -# BSP creation. If JDI_FILE is not set and QUARTUS_PROJECT_DIR is set, then -# derive JDI_FILE. We do not attempt to derive SOPCINFO_FILE since there may be -# multiple .sopcinfo files in a Quartus project. -ifeq ($(JDI_FILE),) -ifneq ($(QUARTUS_PROJECT_DIR),) -JDI_FILE := $(wildcard $(QUARTUS_PROJECT_DIR)/*.jdi) -endif -endif - -# Path to root runtime directory used for hdl simulation -RUNTIME_ROOT_DIR := $(CONFIG_OBJ_DIR)/runtime - - - -#------------------------------------------------------------------------------ -# MAKEFILE INCLUDES DEPENDENT ON GENERATED CONTENT -#------------------------------------------------------------------------------ -# mem_init.mk is a generated makefile fragment. This file defines all targets -# used to generate HDL initialization simulation files and pre-initialized -# onchip memory files. -MEM_INIT_FILE := $(BSP_ROOT_DIR)/mem_init.mk -include $(MEM_INIT_FILE) - -# Create list of object files to be built using the list of source files. -# The source file hierarchy is preserved in the object tree. -# The supported file extensions are: -# -# .c - for C files -# .cxx .cc .cpp - for C++ files -# .S .s - for assembler files -# -# Handle source files specified by --src-dir & --src-rdir differently, to -# save some processing time in calling the adjust-path macro. - -OBJ_LIST_C := $(patsubst %.c,%.o,$(filter %.c,$(C_SRCS))) -OBJ_LIST_CPP := $(patsubst %.cpp,%.o,$(filter %.cpp,$(CXX_SRCS))) -OBJ_LIST_CXX := $(patsubst %.cxx,%.o,$(filter %.cxx,$(CXX_SRCS))) -OBJ_LIST_CC := $(patsubst %.cc,%.o,$(filter %.cc,$(CXX_SRCS))) -OBJ_LIST_S := $(patsubst %.S,%.o,$(filter %.S,$(ASM_SRCS))) -OBJ_LIST_SS := $(patsubst %.s,%.o,$(filter %.s,$(ASM_SRCS))) - -OBJ_LIST := $(sort $(OBJ_LIST_C) $(OBJ_LIST_CPP) $(OBJ_LIST_CXX) \ - $(OBJ_LIST_CC) $(OBJ_LIST_S) $(OBJ_LIST_SS)) - -SDIR_OBJ_LIST_C := $(patsubst %.c,%.o,$(filter %.c,$(SDIR_C_SRCS))) -SDIR_OBJ_LIST_CPP := $(patsubst %.cpp,%.o,$(filter %.cpp,$(SDIR_CXX_SRCS))) -SDIR_OBJ_LIST_CXX := $(patsubst %.cxx,%.o,$(filter %.cxx,$(SDIR_CXX_SRCS))) -SDIR_OBJ_LIST_CC := $(patsubst %.cc,%.o,$(filter %.cc,$(SDIR_CXX_SRCS))) -SDIR_OBJ_LIST_S := $(patsubst %.S,%.o,$(filter %.S,$(SDIR_ASM_SRCS))) -SDIR_OBJ_LIST_SS := $(patsubst %.s,%.o,$(filter %.s,$(SDIR_ASM_SRCS))) - -SDIR_OBJ_LIST := $(sort $(SDIR_OBJ_LIST_C) $(SDIR_OBJ_LIST_CPP) \ - $(SDIR_OBJ_LIST_CXX) $(SDIR_OBJ_LIST_CC) $(SDIR_OBJ_LIST_S) \ - $(SDIR_OBJ_LIST_SS)) - -# Relative-pathed objects that being with "../" are handled differently. -# -# Regular objects are created as -# $(CONFIG_OBJ_DIR)//.o -# where the path structure is maintained under the obj directory. This -# applies for both absolute and relative paths; in the absolute path -# case this means the entire source path will be recreated under the obj -# directory. This is done to allow two source files with the same name -# to be included as part of the project. -# -# Note: On Cygwin, the path recreated under the obj directory will be -# the cygpath -u output path. -# -# Relative-path objects that begin with "../" cause problems under this -# scheme, as $(CONFIG_OBJ_DIR)/..// can potentially put the object -# files anywhere in the system, creating clutter and polluting the source tree. -# As such, their paths are flattened - the object file created will be -# $(CONFIG_OBJ_DIR)/.o. Due to this, two files specified with -# "../" in the beginning cannot have the same name in the project. VPATH -# will be set for these sources to allow make to relocate the source file -# via %.o rules. -# -# The following lines separate the object list into the flatten and regular -# lists, and then handles them as appropriate. - -FLATTEN_OBJ_LIST := $(filter ../%,$(OBJ_LIST)) -FLATTEN_APP_OBJS := $(addprefix $(CONFIG_OBJ_DIR)/,$(notdir $(FLATTEN_OBJ_LIST))) - -REGULAR_OBJ_LIST := $(filter-out $(FLATTEN_OBJ_LIST),$(OBJ_LIST)) -REGULAR_OBJ_LIST_C := $(filter $(OBJ_LIST_C),$(REGULAR_OBJ_LIST)) -REGULAR_OBJ_LIST_CPP := $(filter $(OBJ_LIST_CPP),$(REGULAR_OBJ_LIST)) -REGULAR_OBJ_LIST_CXX := $(filter $(OBJ_LIST_CXX),$(REGULAR_OBJ_LIST)) -REGULAR_OBJ_LIST_CC := $(filter $(OBJ_LIST_CC),$(REGULAR_OBJ_LIST)) -REGULAR_OBJ_LIST_S := $(filter $(OBJ_LIST_S),$(REGULAR_OBJ_LIST)) -REGULAR_OBJ_LIST_SS := $(filter $(OBJ_LIST_SS),$(REGULAR_OBJ_LIST)) - -FLATTEN_SDIR_OBJ_LIST := $(filter ../%,$(SDIR_OBJ_LIST)) -FLATTEN_SDIR_APP_OBJS := $(addprefix $(CONFIG_OBJ_DIR)/,$(notdir $(FLATTEN_SDIR_OBJ_LIST))) - -REGULAR_SDIR_OBJ_LIST := $(filter-out $(FLATTEN_SDIR_OBJ_LIST),$(SDIR_OBJ_LIST)) -REGULAR_SDIR_OBJ_LIST_C := $(filter $(SDIR_OBJ_LIST_C),$(REGULAR_SDIR_OBJ_LIST)) -REGULAR_SDIR_OBJ_LIST_CPP := $(filter $(SDIR_OBJ_LIST_CPP),$(REGULAR_SDIR_OBJ_LIST)) -REGULAR_SDIR_OBJ_LIST_CXX := $(filter $(SDIR_OBJ_LIST_CXX),$(REGULAR_SDIR_OBJ_LIST)) -REGULAR_SDIR_OBJ_LIST_CC := $(filter $(SDIR_OBJ_LIST_CC),$(REGULAR_SDIR_OBJ_LIST)) -REGULAR_SDIR_OBJ_LIST_S := $(filter $(SDIR_OBJ_LIST_S),$(REGULAR_SDIR_OBJ_LIST)) -REGULAR_SDIR_OBJ_LIST_SS := $(filter $(SDIR_OBJ_LIST_SS),$(REGULAR_SDIR_OBJ_LIST)) - -VPATH := $(sort $(dir $(FLATTEN_OBJ_LIST)) $(dir $(FLATTEN_SDIR_OBJ_LIST))) - -APP_OBJS_C := $(addprefix $(CONFIG_OBJ_DIR)/,\ - $(REGULAR_SDIR_OBJ_LIST_C) \ - $(foreach s,$(REGULAR_OBJ_LIST_C),$(call adjust-path,$s))) - -APP_OBJS_CPP := $(addprefix $(CONFIG_OBJ_DIR)/,\ - $(REGULAR_SDIR_OBJ_LIST_CPP) \ - $(foreach s,$(REGULAR_OBJ_LIST_CPP),$(call adjust-path,$s))) - -APP_OBJS_CXX := $(addprefix $(CONFIG_OBJ_DIR)/,\ - $(REGULAR_SDIR_OBJ_LIST_CXX) \ - $(foreach s,$(REGULAR_OBJ_LIST_CXX),$(call adjust-path,$s))) - -APP_OBJS_CC := $(addprefix $(CONFIG_OBJ_DIR)/,\ - $(REGULAR_SDIR_OBJ_LIST_CC) \ - $(foreach s,$(REGULAR_OBJ_LIST_CC),$(call adjust-path,$s))) - -APP_OBJS_S := $(addprefix $(CONFIG_OBJ_DIR)/,\ - $(REGULAR_SDIR_OBJ_LIST_S) \ - $(foreach s,$(REGULAR_OBJ_LIST_S),$(call adjust-path,$s))) - -APP_OBJS_SS := $(addprefix $(CONFIG_OBJ_DIR)/,\ - $(REGULAR_SDIR_OBJ_LIST_SS) \ - $(foreach s,$(REGULAR_OBJ_LIST_SS),$(call adjust-path,$s))) - -APP_OBJS := $(APP_OBJS_C) $(APP_OBJS_CPP) $(APP_OBJS_CXX) $(APP_OBJS_CC) \ - $(APP_OBJS_S) $(APP_OBJS_SS) \ - $(FLATTEN_APP_OBJS) $(FLATTEN_SDIR_APP_OBJS) - -# Add any extra user-provided object files. -APP_OBJS += $(OBJS) - -# Create list of dependancy files for each object file. -APP_DEPS := $(APP_OBJS:.o=.d) - -# Patch the Elf file with system specific information - -# Patch the Elf with the name of the sopc system -ifneq ($(SOPC_NAME),) -ELF_PATCH_FLAG += --sopc_system_name $(SOPC_NAME) -endif - -# Patch the Elf with the absolute path to the Quartus Project Directory -ifneq ($(QUARTUS_PROJECT_DIR),) -ABS_QUARTUS_PROJECT_DIR := $(call adjust-path-mixed,$(shell cd "$(QUARTUS_PROJECT_DIR)"; pwd)) -ELF_PATCH_FLAG += --quartus_project_dir "$(ABS_QUARTUS_PROJECT_DIR)" -endif - -# Patch the Elf and download args with the JDI_FILE if specified -ifneq ($(wildcard $(JDI_FILE)),) -ELF_PATCH_FLAG += --jdi $(JDI_FILE) -DOWNLOAD_JDI_FLAG := --jdi $(JDI_FILE) -endif - -# Patch the Elf with the SOPCINFO_FILE if specified -ifneq ($(wildcard $(SOPCINFO_FILE)),) -ELF_PATCH_FLAG += --sopcinfo $(SOPCINFO_FILE) -endif - -# Use the DOWNLOAD_CABLE variable to specify which JTAG cable to use. -# This is not needed if you only have one cable. -ifneq ($(DOWNLOAD_CABLE),) -DOWNLOAD_CABLE_FLAG := --cable '$(DOWNLOAD_CABLE)' -endif - - -#------------------------------------------------------------------------------ -# BUILD PRE/POST PROCESS -#------------------------------------------------------------------------------ -build_pre_process : - $(BUILD_PRE_PROCESS) - -build_post_process : - $(BUILD_POST_PROCESS) - -.PHONY: build_pre_process build_post_process - - -#------------------------------------------------------------------------------ -# TOOLS -#------------------------------------------------------------------------------ - -# -# Set tool default variables if not already defined. -# If these are defined, they would typically be defined in an -# included makefile fragment. -# -ifeq ($(DEFAULT_CROSS_COMPILE),) -DEFAULT_CROSS_COMPILE := nios2-elf- -endif - -ifeq ($(DEFAULT_STACK_REPORT),) -DEFAULT_STACKREPORT := nios2-stackreport -endif - -ifeq ($(DEFAULT_DOWNLOAD),) -DEFAULT_DOWNLOAD := nios2-download -endif - -ifeq ($(DEFAULT_FLASHPROG),) -DEFAULT_FLASHPROG := nios2-flash-programmer -endif - -ifeq ($(DEFAULT_ELFPATCH),) -DEFAULT_ELFPATCH := nios2-elf-insert -endif - -ifeq ($(DEFAULT_RM),) -DEFAULT_RM := rm -f -endif - -ifeq ($(DEFAULT_CP),) -DEFAULT_CP := cp -f -endif - -ifeq ($(DEFAULT_MKDIR),) -DEFAULT_MKDIR := mkdir -p -endif - -# -# Set tool variables to defaults if not already defined. -# If these are defined, they would typically be defined by a -# setting in the generated portion of this makefile. -# -ifeq ($(CROSS_COMPILE),) -CROSS_COMPILE := $(DEFAULT_CROSS_COMPILE) -endif - -ifeq ($(origin CC),default) -CC := $(CROSS_COMPILE)gcc -xc -endif - -ifeq ($(origin CXX),default) -CXX := $(CROSS_COMPILE)gcc -xc++ -endif - -ifeq ($(origin AS),default) -AS := $(CROSS_COMPILE)gcc -endif - -ifeq ($(origin AR),default) -AR := $(CROSS_COMPILE)ar -endif - -ifeq ($(origin LD),default) -LD := $(CROSS_COMPILE)g++ -endif - -ifeq ($(origin NM),default) -NM := $(CROSS_COMPILE)nm -endif - -ifeq ($(origin RM),default) -RM := $(DEFAULT_RM) -endif - -ifeq ($(origin CP),default) -CP := $(DEFAULT_CP) -endif - -ifeq ($(OBJDUMP),) -OBJDUMP := $(CROSS_COMPILE)objdump -endif - -ifeq ($(OBJCOPY),) -OBJCOPY := $(CROSS_COMPILE)objcopy -endif - -ifeq ($(STACKREPORT),) -ifeq ($(CROSS_COMPILE),nios2-elf-) -STACKREPORT := $(DEFAULT_STACKREPORT) -else -DISABLE_STACKREPORT := 1 -endif -endif - -ifeq ($(DOWNLOAD),) -DOWNLOAD := $(DEFAULT_DOWNLOAD) -endif - -ifeq ($(FLASHPROG),) -FLASHPROG := $(DEFAULT_FLASHPROG) -endif - -ifeq ($(ELFPATCH),) -ELFPATCH := $(DEFAULT_ELFPATCH) -endif - -ifeq ($(MKDIR),) -MKDIR := $(DEFAULT_MKDIR) -endif - -#------------------------------------------------------------------------------ -# PATTERN RULES TO BUILD OBJECTS -#------------------------------------------------------------------------------ - -define compile.c -@$(ECHO) Info: Compiling $< to $@ -@$(MKDIR) $(@D) -$(CC) -MP -MMD -c $(APP_CPPFLAGS) $(APP_CFLAGS) -o $@ $< -$(CC_POST_PROCESS) -endef - -define compile.cpp -@$(ECHO) Info: Compiling $< to $@ -@$(MKDIR) $(@D) -$(CXX) -MP -MMD -c $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< -$(CXX_POST_PROCESS) -endef - -# If assembling with the compiler, ensure "-Wa," is prepended to all APP_ASFLAGS -ifeq ($(AS),$(patsubst %as,%,$(AS))) -COMMA := , -APP_ASFLAGS := $(filter-out $(APP_CFLAGS),$(addprefix -Wa$(COMMA),$(patsubst -Wa$(COMMA)%,%,$(APP_ASFLAGS)))) -endif - -define compile.s -@$(ECHO) Info: Assembling $< to $@ -@$(MKDIR) $(@D) -$(AS) -MP -MMD -c $(APP_CPPFLAGS) $(APP_CFLAGS) $(APP_ASFLAGS) -o $@ $< -$(AS_POST_PROCESS) -endef - -ifeq ($(MAKE_VERSION),3.81) -.SECONDEXPANSION: - -$(APP_OBJS_C): $(CONFIG_OBJ_DIR)/%.o: $$(call adjust-path-mixed,%.c) - $(compile.c) - -$(APP_OBJS_CPP): $(CONFIG_OBJ_DIR)/%.o: $$(call adjust-path-mixed,%.cpp) - $(compile.cpp) - -$(APP_OBJS_CC): $(CONFIG_OBJ_DIR)/%.o: $$(call adjust-path-mixed,%.cc) - $(compile.cpp) - -$(APP_OBJS_CXX): $(CONFIG_OBJ_DIR)/%.o: $$(call adjust-path-mixed,%.cxx) - $(compile.cpp) - -$(APP_OBJS_S): $(CONFIG_OBJ_DIR)/%.o: $$(call adjust-path-mixed,%.S) - $(compile.s) - -$(APP_OBJS_SS): $(CONFIG_OBJ_DIR)/%.o: $$(call adjust-path-mixed,%.s) - $(compile.s) - -endif # MAKE_VERSION != 3.81 - -$(CONFIG_OBJ_DIR)/%.o: %.c - $(compile.c) - -$(CONFIG_OBJ_DIR)/%.o: %.cpp - $(compile.cpp) - -$(CONFIG_OBJ_DIR)/%.o: %.cc - $(compile.cpp) - -$(CONFIG_OBJ_DIR)/%.o: %.cxx - $(compile.cpp) - -$(CONFIG_OBJ_DIR)/%.o: %.S - $(compile.s) - -$(CONFIG_OBJ_DIR)/%.o: %.s - $(compile.s) - - -#------------------------------------------------------------------------------ -# PATTERN RULES TO INTERMEDIATE FILES -#------------------------------------------------------------------------------ - -$(CONFIG_OBJ_DIR)/%.s: %.c - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CC) -S $(APP_CPPFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.s: %.cpp - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CXX) -S $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.s: %.cc - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CXX) -S $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.s: %.cxx - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CXX) -S $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.i: %.c - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CC) -E $(APP_CPPFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.i: %.cpp - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CXX) -E $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.i: %.cc - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CXX) -E $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.i: %.cxx - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CXX) -E $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< - - -#------------------------------------------------------------------------------ -# TARGET RULES -#------------------------------------------------------------------------------ - -.PHONY : help -help : - @$(ECHO) "Summary of Makefile targets" - @$(ECHO) " Build targets:" - @$(ECHO) " all (default) - Application and all libraries (including BSP)" - @$(ECHO) " bsp - Just the BSP" - @$(ECHO) " libs - All libraries (including BSP)" - @$(ECHO) " flash - All flash files" - @$(ECHO) " mem_init_generate - All memory initialization files" -ifeq ($(QSYS),1) - @$(ECHO) " mem_init_install - This target is deprecated for QSys Systems" - @$(ECHO) " --> Use the mem_init_generate target and then" - @$(ECHO) " add the generated meminit.qip file to your" - @$(ECHO) " Quartus II Project." -else # if QSYS != 1 - @$(ECHO) " mem_init_install - Copy memory initialization files to Quartus II project" -endif # QSYS == 1 - @$(ECHO) - @$(ECHO) " Clean targets:" - @$(ECHO) " clean_all - Application and all libraries (including BSP)" - @$(ECHO) " clean - Just the application" - @$(ECHO) " clean_bsp - Just the BSP" - @$(ECHO) " clean_libs - All libraries (including BSP)" - @$(ECHO) - @$(ECHO) " Run targets:" - @$(ECHO) " download-elf - Download and run your elf executable" - @$(ECHO) " program-flash - Program flash contents to the board" - -# Handy rule to skip making libraries and just make application. -.PHONY : app -app : $(ELF) - -ifeq ($(CREATE_OBJDUMP), 1) -app : $(OBJDUMP_NAME) -endif - -ifeq ($(CREATE_ELF_DERIVED_FILES),1) -app : elf_derived_files -endif - -.PHONY: elf_derived_files -elf_derived_files: default_mem_init - -# Handy rule for making just the BSP. -.PHONY : bsp -bsp : - @$(ECHO) Info: Building $(BSP_ROOT_DIR) - @$(MAKE) --no-print-directory -C $(BSP_ROOT_DIR) - - -# Make sure all makeable libraries (including the BSP) are up-to-date. -LIB_TARGETS := $(patsubst %,%-recurs-make-lib,$(MAKEABLE_LIBRARY_ROOT_DIRS)) - -.PHONY : libs -libs : $(LIB_TARGETS) - -ifneq ($(strip $(LIB_TARGETS)),) -$(LIB_TARGETS): %-recurs-make-lib: - @$(ECHO) Info: Building $* - $(MAKE) --no-print-directory -C $* -endif - -ifneq ($(strip $(APP_LDDEPS)),) -$(APP_LDDEPS): libs - @true -endif - -# Rules to force your project to rebuild or relink -# .force_relink file will cause any application that depends on this project to relink -# .force_rebuild file will cause this project to rebuild object files -# .force_rebuild_all file will cause this project and any project that depends on this project to rebuild object files - -FORCE_RELINK_DEP := .force_relink -FORCE_REBUILD_DEP := .force_rebuild -FORCE_REBUILD_ALL_DEP := .force_rebuild_all -FORCE_REBUILD_DEP_LIST := $(CONFIG_OBJ_DIR)/$(FORCE_RELINK_DEP) $(CONFIG_OBJ_DIR)/$(FORCE_REBUILD_DEP) $(FORCE_REBUILD_ALL_DEP) - -$(FORCE_REBUILD_DEP_LIST): - -$(APP_OBJS): $(wildcard $(CONFIG_OBJ_DIR)/$(FORCE_REBUILD_DEP)) $(wildcard $(addsuffix /$(FORCE_REBUILD_ALL_DEP), . $(ALT_LIBRARY_DIRS))) - -$(ELF): $(wildcard $(addsuffix /$(FORCE_RELINK_DEP), $(CONFIG_OBJ_DIR) $(ALT_LIBRARY_DIRS))) - - -# Clean just the application. -.PHONY : clean -ifeq ($(CREATE_ELF_DERIVED_FILES),1) -clean : clean_elf_derived_files -endif - -clean : - @$(RM) -r $(ELF) $(OBJDUMP_NAME) $(LINKER_MAP_NAME) $(OBJ_ROOT_DIR) $(RUNTIME_ROOT_DIR) $(FORCE_REBUILD_DEP_LIST) - @$(ECHO) [$(APP_NAME) clean complete] - -# Clean just the BSP. -.PHONY : clean_bsp -clean_bsp : - @$(ECHO) Info: Cleaning $(BSP_ROOT_DIR) - @$(MAKE) --no-print-directory -C $(BSP_ROOT_DIR) clean - -# Clean all makeable libraries including the BSP. -LIB_CLEAN_TARGETS := $(patsubst %,%-recurs-make-clean-lib,$(MAKEABLE_LIBRARY_ROOT_DIRS)) - -.PHONY : clean_libs -clean_libs : $(LIB_CLEAN_TARGETS) - -ifneq ($(strip $(LIB_CLEAN_TARGETS)),) -$(LIB_CLEAN_TARGETS): %-recurs-make-clean-lib: - @$(ECHO) Info: Cleaning $* - $(MAKE) --no-print-directory -C $* clean -endif - -.PHONY: clean_elf_derived_files -clean_elf_derived_files: mem_init_clean - -# Clean application and all makeable libraries including the BSP. -.PHONY : clean_all -clean_all : clean mem_init_clean clean_libs - -# Include the dependency files unless the make goal is performing a clean -# of the application. -ifneq ($(firstword $(MAKECMDGOALS)),clean) -ifneq ($(firstword $(MAKECMDGOALS)),clean_all) --include $(APP_DEPS) -endif -endif - -.PHONY : download-elf -download-elf : $(ELF) - @if [ "$(DOWNLOAD)" = "none" ]; \ - then \ - $(ECHO) Downloading $(ELF) not supported; \ - else \ - $(ECHO) Info: Downloading $(ELF); \ - $(DOWNLOAD) --go --cpu_name=$(CPU_NAME) $(DOWNLOAD_CABLE_FLAG) $(SOPC_SYSID_FLAG) $(DOWNLOAD_JDI_FLAG) $(WRITE_GMON_OPTION) $(ELF); \ - fi - -# Delete the target of a rule if it has changed and its commands exit -# with a nonzero exit status. -.DELETE_ON_ERROR: - -# Rules for flash programming commands -PROGRAM_FLASH_SUFFIX := -program -PROGRAM_FLASH_TARGET := $(addsuffix $(PROGRAM_FLASH_SUFFIX), $(FLASH_FILES)) - -.PHONY : program-flash -program-flash : $(PROGRAM_FLASH_TARGET) - -.PHONY : $(PROGRAM_FLASH_TARGET) -$(PROGRAM_FLASH_TARGET) : flash - @if [ "$(FLASHPROG)" = "none" ]; \ - then \ - $(ECHO) Programming flash not supported; \ - else \ - $(ECHO) Info: Programming $(basename $@).flash; \ - if [ -z "$($(basename $@)_EPCS_FLAGS)" ]; \ - then \ - $(ECHO) $(FLASHPROG) $(SOPC_SYSID_FLAG) --base=$($(basename $@)_START) $(basename $@).flash; \ - $(FLASHPROG) $(DOWNLOAD_CABLE_FLAG) $(SOPC_SYSID_FLAG) --base=$($(basename $@)_START) $(basename $@).flash; \ - else \ - $(ECHO) $(FLASHPROG) $(SOPC_SYSID_FLAG) --epcs --base=$($(basename $@)_START) $(basename $@).flash; \ - $(FLASHPROG) $(DOWNLOAD_CABLE_FLAG) $(SOPC_SYSID_FLAG) --epcs --base=$($(basename $@)_START) $(basename $@).flash; \ - fi \ - fi - - -# Rules for simulating with an HDL Simulator [QSYS only] -ifeq ($(QSYS),1) -IP_MAKE_SIMSCRIPT := ip-make-simscript - -ifeq ($(VSIM),) -VSIM_EXE := "$(if $(VSIM_DIR),$(VSIM_DIR)/,)vsim" -ifeq ($(ENABLE_VSIM_GUI),1) -VSIM := $(VSIM_EXE) -gui -else -VSIM := $(VSIM_EXE) -c -endif # ENABLE_VSIM_GUI == 1 -endif # VSIM not set - -ifeq ($(SPD),) -ifneq ($(ABS_QUARTUS_PROJECT_DIR),) -ifneq ($(SOPC_NAME),) -SPD := $(ABS_QUARTUS_PROJECT_DIR)/$(SOPC_NAME)_tb.spd -endif # SOPC_NAME set -endif # ABS_QUARTUS_PROJECT_DIR set -endif # SPD == empty string - -ifeq ($(MSIM_SCRIPT),) -SIM_SCRIPT_DIR := $(RUNTIME_ROOT_DIR)/sim -MSIM_SCRIPT := $(SIM_SCRIPT_DIR)/mentor/msim_setup.tcl -endif # MSIM_SCRIPT == empty string - -ifeq ($(MAKE_VERSION),3.81) -ABS_MEM_INIT_DESCRIPTOR_FILE := $(abspath $(MEM_INIT_DESCRIPTOR_FILE)) -else -ABS_MEM_INIT_DESCRIPTOR_FILE := $(call adjust-path-mixed,$(shell pwd))/$(MEM_INIT_DESCRIPTOR_FILE) -endif - -$(MSIM_SCRIPT): $(SPD) $(MEM_INIT_DESCRIPTOR_FILE) -ifeq ($(SPD),) - $(error No SPD file specified. Ensure QUARTUS_PROJECT_DIR variable is set) -endif - @$(MKDIR) $(SIM_SCRIPT_DIR) - $(IP_MAKE_SIMSCRIPT) --spd=$(SPD) --spd=$(MEM_INIT_DESCRIPTOR_FILE) --output-directory=$(SIM_SCRIPT_DIR) - -VSIM_COMMAND = \ - cd $(dir $(MSIM_SCRIPT)) && \ - $(VSIM) -do "do $(notdir $(MSIM_SCRIPT)); ld; $(if $(VSIM_RUN_TIME),run ${VSIM_RUN_TIME};quit;)" - -.PHONY: sim -sim: $(MSIM_SCRIPT) mem_init_generate -ifeq ($(MSIM_SCRIPT),) - $(error MSIM_SCRIPT not set) -endif - $(VSIM_COMMAND) - -endif # QSYS == 1 - - -#------------------------------------------------------------------------------ -# ELF TARGET RULE -#------------------------------------------------------------------------------ -# Rule for constructing the executable elf file. -$(ELF) : $(APP_OBJS) $(LINKER_SCRIPT) $(APP_LDDEPS) - @$(ECHO) Info: Linking $@ - $(LD) $(APP_LDFLAGS) $(APP_CFLAGS) -o $@ $(filter-out $(CRT0),$(APP_OBJS)) $(APP_LIBS) $(APP_BSP_DEP_LIBS) -ifneq ($(DISABLE_ELFPATCH),1) - $(ELFPATCH) $@ $(ELF_PATCH_FLAG) -endif -ifneq ($(DISABLE_STACKREPORT),1) - @bash -c "$(STACKREPORT) $@" -endif - -$(OBJDUMP_NAME) : $(ELF) - @$(ECHO) Info: Creating $@ - $(OBJDUMP) $(OBJDUMP_FLAGS) $< >$@ - -# Rule for printing the name of the elf file -.PHONY: print-elf-name -print-elf-name: - @$(ECHO) $(ELF) - - diff --git a/software/qsys_tutorial_lcd2/create-this-app b/software/qsys_tutorial_lcd2/create-this-app deleted file mode 100644 index 2ef502e..0000000 --- a/software/qsys_tutorial_lcd2/create-this-app +++ /dev/null @@ -1,114 +0,0 @@ -#!/bin/bash -# -# This script creates the hello_world_small application in this directory. - - -BSP_DIR=../qsys_tutorial_lcd2_bsp -QUARTUS_PROJECT_DIR=../../ -NIOS2_APP_GEN_ARGS="--elf-name qsys_tutorial_lcd2.elf --set APP_CFLAGS_OPTIMIZATION -Os --set OBJDUMP_INCLUDE_SOURCE 1 --src-files hello_world_small.c" - - -# First, check to see if $SOPC_KIT_NIOS2 environmental variable is set. -# This variable is required for the command line tools to execute correctly. -if [ -z "${SOPC_KIT_NIOS2}" ] -then - echo Required \$SOPC_KIT_NIOS2 Environmental Variable is not set! - exit 1 -fi - - -# Also make sure that the APP has not been created already. Check for -# existence of Makefile in the app directory -if [ -f ./Makefile ] -then - echo Application has already been created! Delete Makefile if you want to create a new application makefile - exit 1 -fi - - -# We are selecting hal_reduced_footprint bsp because it supports this application. -# Check to see if the hal_reduced_footprint has already been generated by checking for -# existence of the public.mk file. If not, we need to run -# create-this-bsp file to generate the bsp. -if [ ! -f ${BSP_DIR}/public.mk ]; then - # Since BSP doesn't exist, create the BSP - # Pass any command line arguments passed to this script to the BSP. - pushd ${BSP_DIR} >> /dev/null - ./create-this-bsp "$@" || { - echo "create-this-bsp failed" - exit 1 - } - popd >> /dev/null -fi - - -# Don't run make if create-this-app script is called with --no-make arg -SKIP_MAKE= -while [ $# -gt 0 ] -do - case "$1" in - --no-make) - SKIP_MAKE=1 - ;; - esac - shift -done - - -# Now we also need to go copy the sources for this application to the -# local directory. -find "${SOPC_KIT_NIOS2}/examples/software/hello_world_small/" -name '*.c' -or -name '*.h' -or -name 'hostfs*' | xargs -i cp -L {} ./ || { - echo "failed during copying example source files" - exit 1 -} - -find "${SOPC_KIT_NIOS2}/examples/software/hello_world_small/" -name 'readme.txt' -or -name 'Readme.txt' | xargs -i cp -L {} ./ || { - echo "failed copying readme file" -} - -if [ -d "${SOPC_KIT_NIOS2}/examples/software/hello_world_small/system" ] -then - cp -RL "${SOPC_KIT_NIOS2}/examples/software/hello_world_small/system" . || { - echo "failed during copying project support files" - exit 1 - } -fi - -chmod -R +w . || { - echo "failed during changing file permissions" - exit 1 -} - -cmd="nios2-app-generate-makefile --bsp-dir ${BSP_DIR} --set QUARTUS_PROJECT_DIR=${QUARTUS_PROJECT_DIR} ${NIOS2_APP_GEN_ARGS}" - -echo "create-this-app: Running \"${cmd}\"" -$cmd || { - echo "nios2-app-generate-makefile failed" - exit 1 -} - -if [ -z "$SKIP_MAKE" ]; then - cmd="make" - - echo "create-this-app: Running \"$cmd\"" - $cmd || { - echo "make failed" - exit 1 - } - - echo - echo "To download and run the application:" - echo " 1. Make sure the board is connected to the system." - echo " 2. Run 'nios2-configure-sof ' to configure the FPGA with the hardware design." - echo " 3. If you have a stdio device, run 'nios2-terminal' in a different shell." - echo " 4. Run 'make download-elf' from the application directory." - echo - echo "To debug the application:" - echo " Import the project into Nios II Software Build Tools for Eclipse." - echo " Refer to Nios II Software Build Tools for Eclipse Documentation for more information." - echo - echo -e "" -fi - - -exit 0 diff --git a/software/qsys_tutorial_lcd2/hello_world_small.c b/software/qsys_tutorial_lcd2/hello_world_small.c deleted file mode 100644 index be51785..0000000 --- a/software/qsys_tutorial_lcd2/hello_world_small.c +++ /dev/null @@ -1,152 +0,0 @@ -#include "sys/alt_stdio.h" -#include -#include -#include -#include "system.h" -#include "hex_out.h" -#include "sys_register.h" -#include "sys_memory.h" -#include "input_int.h" -#include "inst_decoder.h" - -#include "altera_avalon_lcd_16207.h" -#include "altera_avalon_lcd_16207_regs.h" - - -#define LCD_BASE 0x4030 - -#define ledrs (volatile int *) 0x00050a0 -#define lcd_on (volatile char *) 0x4010 -#define lcd_blon (volatile char *) 0x4020 - -#define T_MS10 12500 //(10ms) - -void wait(unsigned int s) { - volatile i; - for (i = 0; i < T_MS10*s; i++); -} - -void init() { - FILE *flcd; - char msg[] = "test"; - *lcd_on = 1; - *lcd_blon = 1; - usleep(2000); - - flcd = fopen(LCD_16207_0_NAME, "w"); - if (flcd) { - fwrite(msg, strlen(msg), 1, flcd); - fclose(flcd); - } - // - registers_init(); - memory_init(); - clear_block(HEX0_3); clear_block(HEX4_5); clear_block(HEX6_7); - print_block("he", 2, HEX6_7); - print_block("lo", 2, HEX4_5); - print_block("you1", 4, HEX0_3); - wait(200); - clear_block(HEX0_3); clear_block(HEX4_5); clear_block(HEX6_7); -} - -char stack[5]; - -void store_value(){ - char buf[5]; - unsigned int memi = global_registers[Ssw_memi]; - memory_store(memi, Ssw_data); - sprintf(buf, "%02x", (unsigned char)memi); - print_block(buf, 2, HEX6_7); - print_block("--", 2, HEX4_5); - sprintf(buf, "%04d", global_registers[Ssw_data]); - print_block(buf, 4, HEX0_3); -} -void store_inst(){ - char inst; - char mem_index; - char reg_index; - struct InstRec inst_rec; - - // �K�v�ȏ��̎擾 - inst = global_registers[Ssw_inst]; - mem_index = global_registers[Ssw_memi]; - reg_index = global_registers[Ssw_regi]; - inst_rec.inst = (unsigned int)inst; - inst_rec.memi = (unsigned int)mem_index; - inst_rec.regi = (unsigned int)reg_index; - - // �X�g�A���� - inst_memory_store((unsigned int)global_registers[Spc], inst_rec); - global_registers[Spc]++; - - { - char buf[5]; - sprintf(buf, "%04d", inst_rec.inst); - print_block(buf, 4, HEX0_3); - sprintf(buf, "%02x", global_registers[Spc]); - print_block(buf, 2, HEX4_5); - } -} -void run_proc() { - volatile struct InstRec inst_rec; - - //print_block(" go ", 4, HEX0_3); - - global_registers[Spc] = 0; - print_block("pc", 2, HEX6_7); - do { - // pc�\�� - { - char buf[5]; - sprintf(buf, "%02x", global_registers[Spc]); - print_block(buf, 2, HEX4_5); - } - // ���߃t�F�b�` - inst_rec = inst_fetch(); - // ���߃f�R�[�h���s - inst_decode(inst_rec); - if ( global_registers[Ssw_run] ) wait(100); - }while( inst_rec.inst != INST_END ); - - //print_block(" end", 4, HEX0_3); -} - -void print_change_memory(unsigned int current_memory) { - char buf[5]; - sprintf(buf, "g %2d", current_memory); - print_block(buf, 4, HEX0_3); - print_block("an", 2, HEX4_5); - print_block("ch", 2, HEX6_7); - wait(200); - clear_block(HEX0_3); clear_block(HEX4_5); clear_block(HEX6_7); -} - -int main() -{ - init(); - while(1) { - // interrupt - in_int(); - - // event - if (PUSH_EVENT == PUSH_VALSTR) { - // �l�̃X�g�A - store_value(); - } - if (PUSH_EVENT == PUSH_INSSTR) { - // ���߂̃X�g�A - store_inst(); - } - if (PUSH_EVENT == PUSH_RUN) { - if (global_current_memory != (unsigned int)global_registers[Ssw_psel]) { - global_current_memory = (unsigned int)global_registers[Ssw_psel]; - print_change_memory(global_current_memory); - } - else { - // �v���O�������s - run_proc(); - } - } - } - return 0; -} diff --git a/software/qsys_tutorial_lcd2/hex_encoder.c b/software/qsys_tutorial_lcd2/hex_encoder.c deleted file mode 100644 index ab4eca0..0000000 --- a/software/qsys_tutorial_lcd2/hex_encoder.c +++ /dev/null @@ -1,205 +0,0 @@ -/* - * hex_encoder.c - * - * Created on: 2016/11/17 - * Author: takayun - */ - -#include "hex_encoder.h" -#include - -void encodeNumHex(int hex_i, int num) { - char encoded = 0; - switch (num) { - case 0: - encoded = (char)0x40; // 100 0000 - break; - case 1: - encoded = (char)0xF9; // 111 1001 - break; - case 2: - encoded = (char)0x24; // 010 0100 - break; - case 3: - encoded = (char)0x30; // 011 0000 - break; - case 4: - encoded = (char)0x19; // 001 1001 - break; - case 5: - encoded = (char)0x12; // 001 0010 - break; - case 6: - encoded = (char)0x02; // 000 0010 - break; - case 7: - encoded = (char)0x58; // 101 1000 - break; - case 8: - encoded = (char)0x00; // 000 0000 - break; - case 9: - encoded = (char)0x10; // 001 0000 - break; - default: - encoded = 0; - break; - } - - switch (hex_i) { - case 0: - *hex0 = encoded; - break; - case 1: - *hex1 = encoded; - break; - case 2: - *hex2 = encoded; - break; - case 3: - *hex3 = encoded; - break; - case 4: - *hex4 = encoded; - break; - case 5: - *hex5 = encoded; - break; - case 6: - *hex6 = encoded; - break; - case 7: - *hex7 = encoded; - break; - default: - break; - } -} - -void encodeLatHex(int hex_i, char c) { - char encoded = 0; - - if (isdigit(c)) { - encodeNumHex(hex_i, c-'0'); - return; - } - - switch (c) { - case ' ': - encoded = (char)0xFF; // 111 1111 - break; - case '-': - encoded = (char)0x3F; // 011 1111 - break; - case 'a': - encoded = (char)0x08; // 000 1000 - break; - case 'b': - encoded = (char)0x03; // 000 0011 - break; - case 'c': - encoded = (char)0x27; // 010 0111 - break; - case 'd': - encoded = (char)0x21; // 010 0001 - break; - case 'e': - encoded = (char)0x06; // 000 0110 - break; - case 'f': - encoded = (char)0x0E; // 000 1110 - break; - case 'g': - encoded = (char)0x42; // 100 0010 - break; - case 'h': - encoded = (char)0x0B; // 000 1011 - break; - case 'i': - encoded = (char)0xFB; // 111 1011 - break; - case 'j': - encoded = (char)0x61; // 110 0001 - break; - case 'k': - encoded = (char)0x0A; // 000 1010 - break; - case 'l': - encoded = (char)0x47; // 100 0111 - break; - case 'm': - encoded = (char)0x48; // 100 1000 - break; - case 'n': - encoded = (char)0x2B; // 010 1011 - break; - case 'o': - encoded = (char)0x23; // 010 0011 - break; - case 'p': - encoded = (char)0x0C; // 000 1100 - break; - case 'q': - encoded = (char)0x04; // 000 0100 - break; - case 'r': - encoded = (char)0x2F; // 010 1111 - break; - case 's': - encoded = (char)0x13; // 001 0011 - break; - case 't': - encoded = (char)0x07; // 000 0111 - break; - case 'u': - encoded = (char)0x63; // 110 0011 - break; - case 'v': - encoded = (char)0x41; // 100 0001 - break; - case 'w': - encoded = (char)0x01; // 000 0001 - break; - case 'x': - encoded = (char)0x09; // 000 1001 - break; - case 'y': - encoded = (char)0x11; // 001 0001 - break; - case 'z': - encoded = (char)0x64; // 110 0100 - break; - default: - encoded = 0; - break; - } - - switch (hex_i) { - case 0: - *hex0 = encoded; - break; - case 1: - *hex1 = encoded; - break; - case 2: - *hex2 = encoded; - break; - case 3: - *hex3 = encoded; - break; - case 4: - *hex4 = encoded; - break; - case 5: - *hex5 = encoded; - break; - case 6: - *hex6 = encoded; - break; - case 7: - *hex7 = encoded; - break; - default: - break; - } -} diff --git a/software/qsys_tutorial_lcd2/hex_encoder.h b/software/qsys_tutorial_lcd2/hex_encoder.h deleted file mode 100644 index d04473e..0000000 --- a/software/qsys_tutorial_lcd2/hex_encoder.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * hex_encoder.h - * - * Created on: 2016/11/17 - * Author: takayun - */ - -#ifndef HEX_ENCODER_H_ -#define HEX_ENCODER_H_ - -/************************************************** - * Defines - **************************************************/ - -#define hex0 (volatile char *) 0x0005070 -#define hex1 (volatile char *) 0x0005060 -#define hex2 (volatile char *) 0x0005050 -#define hex3 (volatile char *) 0x0005040 -#define hex4 (volatile char *) 0x0005030 -#define hex5 (volatile char *) 0x0005020 -#define hex6 (volatile char *) 0x0005010 -#define hex7 (volatile char *) 0x0005000 - -/************************************************** - * Variables - **************************************************/ - - -/************************************************** - * Functions - **************************************************/ - -void encodeNumHex(int hex_i, int num); -void encodeLatHex(int hex_i, char c); - -#endif /* HEX_ENCODER_H_ */ diff --git a/software/qsys_tutorial_lcd2/hex_out.c b/software/qsys_tutorial_lcd2/hex_out.c deleted file mode 100644 index 83b37d0..0000000 --- a/software/qsys_tutorial_lcd2/hex_out.c +++ /dev/null @@ -1,67 +0,0 @@ -/* - * hex_out.c - * - * Created on: 2016/11/24 - * Author: takayun - */ -#include "hex_out.h" -#include "hex_encoder.h" -#include "system.h" - -void print_block(char * str, unsigned int size, enum BLOCK_N block_i) { - int i; - if (block_i == HEX0_3) { - if (size > 4) panic(); - for (i = 0; i < size; i++) { - encodeLatHex(i,str[size-1-i]); - } - } - else if (block_i == HEX4_5) { - if (size > 2) panic(); - for (i = 0; i < size; i++) { - encodeLatHex(i+4,str[size-1-i]); - } - } - else if (block_i == HEX6_7) { - if (size > 2) panic(); - for (i = 0; i < size; i++) { - encodeLatHex(i+6,str[size-1-i]); - } - } -} - -void clear_block(enum BLOCK_N block_i) { - if (block_i == HEX0_3) { - print_block(" ", 4, HEX0_3); - } - else if (block_i == HEX4_5) { - print_block(" ", 2, HEX4_5); - } - else if (block_i == HEX6_7) { - print_block(" ", 2, HEX6_7); - } -} - -void print_number(char num) { - int i; - char buf[5]; - char val; - for (i = 0; i < 4; i++) { - if (num < 0) { - buf[0] = '-'; - val = -num; - } else { - buf[0] = ' '; - val = num; - } - buf[1] = val/100%10 + '0'; - buf[2] = val/10%10 + '0'; - buf[3] = val%10 + '0'; - } - clear_block(HEX0_3); - print_block(buf, 4, HEX0_3); -} - - - - diff --git a/software/qsys_tutorial_lcd2/hex_out.h b/software/qsys_tutorial_lcd2/hex_out.h deleted file mode 100644 index 50d6868..0000000 --- a/software/qsys_tutorial_lcd2/hex_out.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * hex_out.h - * - * Created on: 2016/11/24 - * Author: takayun - */ - -#ifndef HEX_IO_H_ -#define HEX_IO_H_ - -/************************************************** - * Defines - **************************************************/ - -enum BLOCK_N { - HEX0_3, HEX4_5, HEX6_7 -}; - -/************************************************** - * Variables - **************************************************/ - - -/************************************************** - * Functions - **************************************************/ - -void print_block(char * str, unsigned int size, enum BLOCK_N block_i); -void clear_block(enum BLOCK_N block_i); -void print_number(char num); - - -#endif /* HEX_IO_H_ */ diff --git a/software/qsys_tutorial_lcd2/input_int.c b/software/qsys_tutorial_lcd2/input_int.c deleted file mode 100644 index 0838b2b..0000000 --- a/software/qsys_tutorial_lcd2/input_int.c +++ /dev/null @@ -1,67 +0,0 @@ -/* - * input_int.c - * - * Created on: 2016/11/24 - * Author: takayun - */ -#include "input_int.h" -#include "sys_register.h" - -unsigned char PUSH_EVENT = PUSH_NONE; - -void in_int() { - push_int(); -} - -static void update_sw_reg(sw_t s) { - global_registers[Ssw_data] = (char)s.data.value; - global_registers[Ssw_inst] = (char)s.splited.instruction_code; - global_registers[Ssw_memi] = (char)s.splited.memory_index; - global_registers[Ssw_regi] = (char)s.splited.register_index; - global_registers[Ssw_psel] = (char)s.splited.program_selecter; - global_registers[Ssw_rw] = (char)s.splited.rw_mode; - global_registers[Ssw_run] = (char)s.splited.run_mode; -} - -enum PushEvent push_decode(char psw) { - switch(psw) { - case 0x3: - return PUSH_VALSTR; - break; - case 0x5: - return PUSH_INSSTR; - break; - case 0x6: - return PUSH_RUN; - break; - } - return PUSH_NONE; -} - -void push_int() { - static unsigned char status = 0; - static enum PushEvent event_code; - volatile sw_t s; - s.sw = *switches; - - switch (status) { - case 0: - PUSH_EVENT = PUSH_NONE; - if (*push_switches != 7) { - event_code = push_decode(*push_switches); - status = 1; - } - update_sw_reg(s); // �X�C�b�`���W�X�^�X�V - break; - case 1: - if (*push_switches == 7) status = 2; - break; - case 2: - PUSH_EVENT = event_code; - status = 0; - break; - default: - status = 0; - break; - } -} diff --git a/software/qsys_tutorial_lcd2/input_int.h b/software/qsys_tutorial_lcd2/input_int.h deleted file mode 100644 index 3cd8cba..0000000 --- a/software/qsys_tutorial_lcd2/input_int.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * input_int.h - * - * Created on: 2016/11/24 - * Author: takayun - */ - -#ifndef SWITCHES_INT_H_ -#define SWITCHES_INT_H_ - -/************************************************** - * Defines - **************************************************/ - -#define switches (volatile int *) 0x0005090 -#define push_switches (volatile char *) 0x0005080 - -typedef union { - int sw; - struct { - unsigned int run_mode : 1; - unsigned int rw_mode : 1; - unsigned int program_selecter : 4; - unsigned int memory_index : 4; - unsigned int register_index : 4; - unsigned int instruction_code : 4; - } splited; - struct { - unsigned int : 10; - unsigned int value : 8; - } data; -} sw_t; - -enum PushEvent{ - PUSH_NONE, - PUSH_ANY, - PUSH_VALSTR, - PUSH_INSSTR, - PUSH_RUN -}; - -/************************************************** - * Variables - **************************************************/ - -extern unsigned char PUSH_EVENT; - -/************************************************** - * Functions - **************************************************/ - -/* Function: in_int - * Sammary: - * �S�Ă̓��͊��荞�݂��s�� - * */ -void in_int(); - -void push_int(); - -#endif /* SWITCHES_INT_H_ */ diff --git a/software/qsys_tutorial_lcd2/inst_decoder.c b/software/qsys_tutorial_lcd2/inst_decoder.c deleted file mode 100644 index d864653..0000000 --- a/software/qsys_tutorial_lcd2/inst_decoder.c +++ /dev/null @@ -1,109 +0,0 @@ -/* - * inst_decoder.c - * - * Created on: 2016/11/25 - * Author: takayun - */ - -#include "inst_decoder.h" -#include "sys_memory.h" -#include "sys_register.h" -#include "hex_out.h" -#include - -struct InstRec inst_fetch(){ - return inst_memory_load((unsigned int)global_registers[Spc]++); -} - -void inst_decode(struct InstRec inst_rec){ - switch(inst_rec.inst) { - case INST_END: - break; - case INST_JUMP: - inst_jump(inst_rec.regi, inst_rec.memi); - break; - case INST_OUTPUT: - inst_output(inst_rec.regi, inst_rec.memi); - break; - case INST_LOAD: - inst_load(inst_rec.regi, inst_rec.memi); - break; - case INST_STORE: - inst_store(inst_rec.regi, inst_rec.memi); - break; - case INST_DELAY: - inst_delay(inst_rec.regi, inst_rec.memi); - break; - case INST_ADD: - inst_add(inst_rec.regi, inst_rec.memi); - break; - case INST_COMP: - inst_comp(inst_rec.regi, inst_rec.memi); - break; - case INST_JEQ: - inst_jeq(inst_rec.regi, inst_rec.memi); - break; - case INST_JNE: - inst_jne(inst_rec.regi, inst_rec.memi); - break; - case INST_JIEQ: - inst_jieq(inst_rec.regi, inst_rec.memi); - break; - case INST_JINE: - inst_jine(inst_rec.regi, inst_rec.memi); - break; - } -} - -void inst_jump(enum Register reg, unsigned char memory_index){ - global_registers[Spc]=global_registers[reg]+memory_index; -} -void inst_output(enum Register reg, unsigned char memory_index){ - //�������̒l��7�Z�O�ɕ\�� - char buf[5]; - memory_load(memory_index, Sseg); - sprintf(buf, "%04d", global_registers[Sseg]); - print_block(buf, 4, HEX0_3); -} -void inst_load(enum Register reg, unsigned char memory_index){ - memory_load(memory_index, reg); -} -void inst_store(enum Register reg, unsigned char memory_index){ - memory_store(memory_index, reg); -} -void inst_delay(enum Register reg, unsigned char memory_index){ - //���W�X�^�̒l*10ms�҂� -} -void inst_add(enum Register reg, unsigned char memory_index){ - global_registers[Sacc]+=global_registers[reg]; -} -void inst_comp(enum Register reg, unsigned char memory_index){ - if(global_registers[Sacc]==global_registers[reg]){ - global_registers[Sflg]=0; - } else if(global_registers[Sacc] > global_registers[reg]){ - global_registers[Sflg]=-1; - }else{ - global_registers[Sflg]=1; - } -} -void inst_jeq(enum Register reg, unsigned char memory_index){ - if(global_registers[Sflg]==global_registers[reg]){ - global_registers[Spc]++; - } -} -void inst_jne(enum Register reg, unsigned char memory_index){ - if(global_registers[Sflg]!=global_registers[reg]){ - global_registers[Spc]++; - } -} -void inst_jieq(char im, unsigned char memory_index){ - if(global_registers[Sflg]==im){ - global_registers[Spc]++; - } -} -void inst_jine(char im, unsigned char memory_index){ - if(global_registers[Sflg]!=im){ - global_registers[Spc]++; - } -} - diff --git a/software/qsys_tutorial_lcd2/inst_decoder.h b/software/qsys_tutorial_lcd2/inst_decoder.h deleted file mode 100644 index 9860750..0000000 --- a/software/qsys_tutorial_lcd2/inst_decoder.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * inst_decoder.h - * - * Created on: 2016/11/25 - * Author: takayun - */ - -#ifndef INST_DECODER_H_ -#define INST_DECODER_H_ - -#include "sys_register.h" - -#define INST_END 0x0 -#define INST_JUMP 0x1 -#define INST_OUTPUT 0x2 -#define INST_LOAD 0x3 -#define INST_STORE 0x4 -#define INST_DELAY 0x5 -#define INST_ADD 0x6 -#define INST_COMP 0x7 -#define INST_JEQ 0x8 -#define INST_JNE 0x9 -#define INST_JIEQ 0xA -#define INST_JINE 0xB - -struct InstRec { - unsigned int inst : 4; - unsigned int memi : 4; - unsigned int regi : 4; -}; - -struct InstRec inst_fetch(); - -void inst_decode(struct InstRec inst_rec); - -void inst_jump(enum Register reg, unsigned char memory_index); -void inst_output(enum Register reg, unsigned char memory_index); -void inst_load(enum Register reg, unsigned char memory_index); -void inst_store(enum Register reg, unsigned char memory_index); -void inst_delay(enum Register reg, unsigned char memory_index); -void inst_add(enum Register reg, unsigned char memory_index); -void inst_comp(enum Register reg, unsigned char memory_index); -void inst_jeq(enum Register reg, unsigned char memory_index); -void inst_jne(enum Register reg, unsigned char memory_index); -void inst_jieq(char im, unsigned char memory_index); -void inst_jine(char im, unsigned char memory_index); - - -#endif /* INST_DECODER_H_ */ diff --git a/software/qsys_tutorial_lcd2/obj/default/hello_world_small.d b/software/qsys_tutorial_lcd2/obj/default/hello_world_small.d deleted file mode 100644 index a52cccf..0000000 --- a/software/qsys_tutorial_lcd2/obj/default/hello_world_small.d +++ /dev/null @@ -1,70 +0,0 @@ -obj/default/hello_world_small.o: hello_world_small.c \ - ../qsys_tutorial_lcd2_bsp//HAL/inc/sys/alt_stdio.h system.h hex_out.h \ - sys_register.h sys_memory.h inst_decoder.h input_int.h \ - ../qsys_tutorial_lcd2_bsp//drivers/inc/altera_avalon_lcd_16207.h \ - ../qsys_tutorial_lcd2_bsp//HAL/inc/sys/alt_alarm.h \ - ../qsys_tutorial_lcd2_bsp//HAL/inc/sys/alt_llist.h \ - ../qsys_tutorial_lcd2_bsp//HAL/inc/alt_types.h \ - ../qsys_tutorial_lcd2_bsp//HAL/inc/priv/alt_alarm.h \ - ../qsys_tutorial_lcd2_bsp//HAL/inc/alt_types.h \ - ../qsys_tutorial_lcd2_bsp//HAL/inc/os/alt_sem.h \ - ../qsys_tutorial_lcd2_bsp//HAL/inc/priv/alt_no_error.h \ - ../qsys_tutorial_lcd2_bsp//drivers/inc/altera_avalon_lcd_16207_fd.h \ - ../qsys_tutorial_lcd2_bsp//HAL/inc/sys/alt_dev.h \ - ../qsys_tutorial_lcd2_bsp/system.h ../qsys_tutorial_lcd2_bsp/linker.h \ - ../qsys_tutorial_lcd2_bsp//HAL/inc/sys/alt_llist.h \ - ../qsys_tutorial_lcd2_bsp//HAL/inc/priv/alt_dev_llist.h \ - ../qsys_tutorial_lcd2_bsp//HAL/inc/sys/alt_llist.h \ - ../qsys_tutorial_lcd2_bsp//drivers/inc/altera_avalon_lcd_16207_regs.h \ - ../qsys_tutorial_lcd2_bsp//HAL/inc/io.h \ - ../qsys_tutorial_lcd2_bsp//HAL/inc/alt_types.h - -../qsys_tutorial_lcd2_bsp//HAL/inc/sys/alt_stdio.h: - -system.h: - -hex_out.h: - -sys_register.h: - -sys_memory.h: - -inst_decoder.h: - -input_int.h: - -../qsys_tutorial_lcd2_bsp//drivers/inc/altera_avalon_lcd_16207.h: - -../qsys_tutorial_lcd2_bsp//HAL/inc/sys/alt_alarm.h: - -../qsys_tutorial_lcd2_bsp//HAL/inc/sys/alt_llist.h: - -../qsys_tutorial_lcd2_bsp//HAL/inc/alt_types.h: - -../qsys_tutorial_lcd2_bsp//HAL/inc/priv/alt_alarm.h: - -../qsys_tutorial_lcd2_bsp//HAL/inc/alt_types.h: - -../qsys_tutorial_lcd2_bsp//HAL/inc/os/alt_sem.h: - -../qsys_tutorial_lcd2_bsp//HAL/inc/priv/alt_no_error.h: - -../qsys_tutorial_lcd2_bsp//drivers/inc/altera_avalon_lcd_16207_fd.h: - -../qsys_tutorial_lcd2_bsp//HAL/inc/sys/alt_dev.h: - -../qsys_tutorial_lcd2_bsp/system.h: - -../qsys_tutorial_lcd2_bsp/linker.h: - -../qsys_tutorial_lcd2_bsp//HAL/inc/sys/alt_llist.h: - -../qsys_tutorial_lcd2_bsp//HAL/inc/priv/alt_dev_llist.h: - -../qsys_tutorial_lcd2_bsp//HAL/inc/sys/alt_llist.h: - -../qsys_tutorial_lcd2_bsp//drivers/inc/altera_avalon_lcd_16207_regs.h: - -../qsys_tutorial_lcd2_bsp//HAL/inc/io.h: - -../qsys_tutorial_lcd2_bsp//HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_lcd2/obj/default/hello_world_small.o b/software/qsys_tutorial_lcd2/obj/default/hello_world_small.o deleted file mode 100644 index 1a167c6..0000000 --- a/software/qsys_tutorial_lcd2/obj/default/hello_world_small.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2/obj/default/hex_encoder.d b/software/qsys_tutorial_lcd2/obj/default/hex_encoder.d deleted file mode 100644 index e913210..0000000 --- a/software/qsys_tutorial_lcd2/obj/default/hex_encoder.d +++ /dev/null @@ -1,3 +0,0 @@ -obj/default/hex_encoder.o: hex_encoder.c hex_encoder.h - -hex_encoder.h: diff --git a/software/qsys_tutorial_lcd2/obj/default/hex_encoder.o b/software/qsys_tutorial_lcd2/obj/default/hex_encoder.o deleted file mode 100644 index 4d3905a..0000000 --- a/software/qsys_tutorial_lcd2/obj/default/hex_encoder.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2/obj/default/hex_out.d b/software/qsys_tutorial_lcd2/obj/default/hex_out.d deleted file mode 100644 index 1000db0..0000000 --- a/software/qsys_tutorial_lcd2/obj/default/hex_out.d +++ /dev/null @@ -1,7 +0,0 @@ -obj/default/hex_out.o: hex_out.c hex_out.h hex_encoder.h system.h - -hex_out.h: - -hex_encoder.h: - -system.h: diff --git a/software/qsys_tutorial_lcd2/obj/default/hex_out.o b/software/qsys_tutorial_lcd2/obj/default/hex_out.o deleted file mode 100644 index eea192b..0000000 --- a/software/qsys_tutorial_lcd2/obj/default/hex_out.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2/obj/default/input_int.d b/software/qsys_tutorial_lcd2/obj/default/input_int.d deleted file mode 100644 index 25051be..0000000 --- a/software/qsys_tutorial_lcd2/obj/default/input_int.d +++ /dev/null @@ -1,5 +0,0 @@ -obj/default/input_int.o: input_int.c input_int.h sys_register.h - -input_int.h: - -sys_register.h: diff --git a/software/qsys_tutorial_lcd2/obj/default/input_int.o b/software/qsys_tutorial_lcd2/obj/default/input_int.o deleted file mode 100644 index be2a16b..0000000 --- a/software/qsys_tutorial_lcd2/obj/default/input_int.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2/obj/default/inst_decoder.d b/software/qsys_tutorial_lcd2/obj/default/inst_decoder.d deleted file mode 100644 index 3e61d10..0000000 --- a/software/qsys_tutorial_lcd2/obj/default/inst_decoder.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/default/inst_decoder.o: inst_decoder.c inst_decoder.h sys_register.h \ - sys_memory.h hex_out.h - -inst_decoder.h: - -sys_register.h: - -sys_memory.h: - -hex_out.h: diff --git a/software/qsys_tutorial_lcd2/obj/default/inst_decoder.o b/software/qsys_tutorial_lcd2/obj/default/inst_decoder.o deleted file mode 100644 index 786b0dd..0000000 --- a/software/qsys_tutorial_lcd2/obj/default/inst_decoder.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2/obj/default/sys_memory.d b/software/qsys_tutorial_lcd2/obj/default/sys_memory.d deleted file mode 100644 index 52d4dcd..0000000 --- a/software/qsys_tutorial_lcd2/obj/default/sys_memory.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/default/sys_memory.o: sys_memory.c system.h sys_memory.h \ - sys_register.h inst_decoder.h - -system.h: - -sys_memory.h: - -sys_register.h: - -inst_decoder.h: diff --git a/software/qsys_tutorial_lcd2/obj/default/sys_memory.o b/software/qsys_tutorial_lcd2/obj/default/sys_memory.o deleted file mode 100644 index 46c6e33..0000000 --- a/software/qsys_tutorial_lcd2/obj/default/sys_memory.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2/obj/default/sys_register.d b/software/qsys_tutorial_lcd2/obj/default/sys_register.d deleted file mode 100644 index ec29589..0000000 --- a/software/qsys_tutorial_lcd2/obj/default/sys_register.d +++ /dev/null @@ -1,3 +0,0 @@ -obj/default/sys_register.o: sys_register.c sys_register.h - -sys_register.h: diff --git a/software/qsys_tutorial_lcd2/obj/default/sys_register.o b/software/qsys_tutorial_lcd2/obj/default/sys_register.o deleted file mode 100644 index 4ec230a..0000000 --- a/software/qsys_tutorial_lcd2/obj/default/sys_register.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2/obj/default/system.d b/software/qsys_tutorial_lcd2/obj/default/system.d deleted file mode 100644 index 6c906ae..0000000 --- a/software/qsys_tutorial_lcd2/obj/default/system.d +++ /dev/null @@ -1,5 +0,0 @@ -obj/default/system.o: system.c system.h hex_out.h - -system.h: - -hex_out.h: diff --git a/software/qsys_tutorial_lcd2/obj/default/system.o b/software/qsys_tutorial_lcd2/obj/default/system.o deleted file mode 100644 index 4e60efb..0000000 --- a/software/qsys_tutorial_lcd2/obj/default/system.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2/qsys_tutorial_lcd2.map b/software/qsys_tutorial_lcd2/qsys_tutorial_lcd2.map deleted file mode 100644 index 9aba510..0000000 --- a/software/qsys_tutorial_lcd2/qsys_tutorial_lcd2.map +++ /dev/null @@ -1,791 +0,0 @@ -Archive member included because of file (symbol) - -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-divmod.o) - obj/default/hex_out.o (__divsi3) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-mul.o) - obj/default/hello_world_small.o (__mulsi3) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-ctype_.o) - obj/default/hex_encoder.o (__ctype_ptr) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-sprintf.o) - obj/default/hello_world_small.o (sprintf) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-strlen.o) - obj/default/hello_world_small.o (strlen) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-vfprintf.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-sprintf.o) (___vfprintf_internal_r) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-fvwrite_small_str.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-sprintf.o) (__sfvwrite_small_str) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-impure.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-sprintf.o) (_impure_ptr) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-memmove.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-fvwrite_small_str.o) (memmove) -../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_load.o) - ../qsys_tutorial_lcd2_bsp//obj/HAL/src/crt0.o (alt_load) -../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_main.o) - ../qsys_tutorial_lcd2_bsp//obj/HAL/src/crt0.o (alt_main) -../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_usleep.o) - obj/default/hello_world_small.o (usleep) -../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_sys_init.o) - ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_main.o) (alt_sys_init) -../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_busy_sleep.o) - ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_usleep.o) (alt_busy_sleep) -../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_load.o) (alt_dcache_flush_all) -../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_load.o) (alt_icache_flush_all) -../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_sys_init.o) (altera_nios2_qsys_irq_init) - -Allocating common symbols -Common symbol size file - -stack 0x5 obj/default/hello_world_small.o -global_registers 0xf obj/default/sys_register.o - -Memory Configuration - -Name Origin Length Attributes -reset 0x00000000 0x00000020 -onchip_memory 0x00000020 0x00003fe0 -*default* 0x00000000 0xffffffff - -Linker script and memory map - -LOAD ../qsys_tutorial_lcd2_bsp//obj/HAL/src/crt0.o - 0x0000000c exit = _exit -LOAD obj/default/hello_world_small.o -LOAD obj/default/hex_encoder.o -LOAD obj/default/hex_out.o -LOAD obj/default/input_int.o -LOAD obj/default/inst_decoder.o -LOAD obj/default/sys_memory.o -LOAD obj/default/sys_register.o -LOAD obj/default/system.o -LOAD c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libstdc++.a -LOAD c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libm.a -LOAD c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a -START GROUP -LOAD c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a -LOAD c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a -LOAD ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a -END GROUP -LOAD c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a - 0x00000000 __alt_mem_onchip_memory = 0x0 - -.entry 0x00000000 0x20 - *(.entry) - .entry 0x00000000 0x20 ../qsys_tutorial_lcd2_bsp//obj/HAL/src/crt0.o - 0x00000000 __reset - 0x0000000c _exit - -.exceptions 0x00000020 0x0 - 0x00000020 PROVIDE (__ram_exceptions_start, ABSOLUTE (.)) - 0x00000020 . = ALIGN (0x20) - *(.irq) - *(.exceptions.entry.label) - *(.exceptions.entry.user) - *(.exceptions.entry) - *(.exceptions.irqtest.user) - *(.exceptions.irqtest) - *(.exceptions.irqhandler.user) - *(.exceptions.irqhandler) - *(.exceptions.irqreturn.user) - *(.exceptions.irqreturn) - *(.exceptions.notirq.label) - *(.exceptions.notirq.user) - *(.exceptions.notirq) - *(.exceptions.soft.user) - *(.exceptions.soft) - *(.exceptions.unknown.user) - *(.exceptions.unknown) - *(.exceptions.exit.label) - *(.exceptions.exit.user) - *(.exceptions.exit) - *(.exceptions) - 0x00000020 PROVIDE (__ram_exceptions_end, ABSOLUTE (.)) - 0x00000020 PROVIDE (__flash_exceptions_start, LOADADDR (.exceptions)) - -.text 0x00000020 0x1e14 - 0x00000020 PROVIDE (stext, ABSOLUTE (.)) - *(.interp) - *(.hash) - *(.dynsym) - *(.dynstr) - *(.gnu.version) - *(.gnu.version_d) - *(.gnu.version_r) - *(.rel.init) - *(.rela.init) - *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) - *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) - *(.rel.fini) - *(.rela.fini) - *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) - *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) - *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) - *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) - *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) - *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) - *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) - *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) - *(.rel.ctors) - *(.rela.ctors) - *(.rel.dtors) - *(.rela.dtors) - *(.rel.got) - *(.rela.got) - *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) - *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) - *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) - *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) - *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) - *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) - *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) - *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) - *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) - *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) - *(.rel.plt) - *(.rela.plt) - *(.rel.dyn) - *(.init) - *(.plt) - *(.text .stub .text.* .gnu.linkonce.t.*) - .text 0x00000020 0x3c ../qsys_tutorial_lcd2_bsp//obj/HAL/src/crt0.o - 0x00000020 _start - .text 0x0000005c 0x470 obj/default/hello_world_small.o - 0x0000005c wait - 0x00000098 print_change_memory - 0x00000130 run_proc - 0x000001d0 store_inst - 0x000002a0 store_value - 0x00000344 init - 0x00000450 main - .text 0x000004cc 0x3b8 obj/default/hex_encoder.o - 0x000004cc encodeNumHex - 0x000005f0 encodeLatHex - .text 0x00000884 0x228 obj/default/hex_out.o - 0x00000884 print_block - 0x00000960 clear_block - 0x000009b0 print_number - .text 0x00000aac 0x180 obj/default/input_int.o - 0x00000aac push_decode - 0x00000aec push_int - 0x00000c28 in_int - .text 0x00000c2c 0x334 obj/default/inst_decoder.o - 0x00000c2c inst_jump - 0x00000c48 inst_delay - 0x00000c4c inst_add - 0x00000c6c inst_comp - 0x00000ca4 inst_jeq - 0x00000ccc inst_jne - 0x00000cf4 inst_jieq - 0x00000d20 inst_jine - 0x00000d4c inst_store - 0x00000d5c inst_load - 0x00000d6c inst_output - 0x00000db8 inst_fetch - 0x00000df0 inst_decode - .text 0x00000f60 0x220 obj/default/sys_memory.o - 0x00000f60 memory_init - 0x00000fa4 inst_memory_store - 0x00001024 inst_memory_load - 0x000010a0 memory_load - 0x00001110 memory_store - .text 0x00001180 0x1c obj/default/sys_register.o - 0x00001180 registers_init - .text 0x0000119c 0x2c obj/default/system.o - 0x0000119c panic - .text 0x000011c8 0x14c c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-divmod.o) - 0x00001244 __divsi3 - 0x000012a4 __modsi3 - 0x00001304 __udivsi3 - 0x0000130c __umodsi3 - .text 0x00001314 0x38 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-mul.o) - 0x00001314 __mulsi3 - .text 0x0000134c 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-ctype_.o) - .text 0x0000134c 0xf4 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-sprintf.o) - 0x0000134c sprintf - 0x000013d0 _sprintf_r - .text 0x00001440 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-strlen.o) - 0x00001440 strlen - .text 0x00001460 0x740 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-vfprintf.o) - 0x000014e0 ___vfprintf_internal_r - 0x00001b7c __vfprintf_internal - .text 0x00001ba0 0xb8 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-fvwrite_small_str.o) - 0x00001ba0 __sfvwrite_small_str - .text 0x00001c58 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-impure.o) - .text 0x00001c58 0x60 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-memmove.o) - 0x00001c58 memmove - .text 0x00001cb8 0x8c ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_load.o) - 0x00001cd8 alt_load - .text 0x00001d44 0x2c ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_main.o) - 0x00001d44 alt_main - .text 0x00001d70 0x4 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_usleep.o) - 0x00001d70 usleep - .text 0x00001d74 0x24 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_sys_init.o) - 0x00001d74 alt_sys_init - 0x00001d78 alt_irq_init - .text 0x00001d98 0x8c ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_busy_sleep.o) - 0x00001d98 alt_busy_sleep - .text 0x00001e24 0x4 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - 0x00001e24 alt_dcache_flush_all - .text 0x00001e28 0x4 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - 0x00001e28 alt_icache_flush_all - .text 0x00001e2c 0x8 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - 0x00001e2c altera_nios2_qsys_irq_init - *(.gnu.warning.*) - *(.fini) - 0x00001e34 PROVIDE (__etext, ABSOLUTE (.)) - 0x00001e34 PROVIDE (_etext, ABSOLUTE (.)) - 0x00001e34 PROVIDE (etext, ABSOLUTE (.)) - *(.eh_frame_hdr) - 0x00001e34 . = ALIGN (0x4) - 0x00001e34 PROVIDE (__preinit_array_start, ABSOLUTE (.)) - *(.preinit_array) - 0x00001e34 PROVIDE (__preinit_array_end, ABSOLUTE (.)) - 0x00001e34 PROVIDE (__init_array_start, ABSOLUTE (.)) - *(.init_array) - 0x00001e34 PROVIDE (__init_array_end, ABSOLUTE (.)) - 0x00001e34 PROVIDE (__fini_array_start, ABSOLUTE (.)) - *(.fini_array) - 0x00001e34 PROVIDE (__fini_array_end, ABSOLUTE (.)) - *(.eh_frame) - *(.gcc_except_table) - *(.dynamic) - 0x00001e34 PROVIDE (__CTOR_LIST__, ABSOLUTE (.)) - *(.ctors) - *(SORT(.ctors.*)) - 0x00001e34 PROVIDE (__CTOR_END__, ABSOLUTE (.)) - 0x00001e34 PROVIDE (__DTOR_LIST__, ABSOLUTE (.)) - *(.dtors) - *(SORT(.dtors.*)) - 0x00001e34 PROVIDE (__DTOR_END__, ABSOLUTE (.)) - *(.jcr) - 0x00001e34 . = ALIGN (0x4) - -.rodata 0x00001e34 0x2f0 - 0x00001e34 PROVIDE (__ram_rodata_start, ABSOLUTE (.)) - 0x00001e34 . = ALIGN (0x4) - *(.rodata .rodata.* .gnu.linkonce.r.*) - .rodata.str1.4 - 0x00001e34 0x55 obj/default/hello_world_small.o - 0x58 (size before relaxing) - *fill* 0x00001e89 0x3 00 - .rodata.str1.4 - 0x00001e8c 0xb obj/default/hex_out.o - 0xc (size before relaxing) - .rodata.str1.4 - 0x00000000 0x8 obj/default/inst_decoder.o - *fill* 0x00001e97 0x1 00 - .rodata.str1.4 - 0x00001e98 0x8 obj/default/system.o - .rodata 0x00001ea0 0x281 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-ctype_.o) - 0x00001ea0 _ctype_ - *(.rodata1) - 0x00002124 . = ALIGN (0x4) - *fill* 0x00002121 0x3 00 - 0x00002124 PROVIDE (__ram_rodata_end, ABSOLUTE (.)) - 0x00001e34 PROVIDE (__flash_rodata_start, LOADADDR (.rodata)) - -.rwdata 0x00002124 0xf0 load address 0x00002214 - 0x00002124 PROVIDE (__ram_rwdata_start, ABSOLUTE (.)) - 0x00002124 . = ALIGN (0x4) - *(.got.plt) - *(.got) - *(.data1) - *(.data .data.* .gnu.linkonce.d.*) - .data 0x00002124 0x0 ../qsys_tutorial_lcd2_bsp//obj/HAL/src/crt0.o - .data 0x00002124 0x0 obj/default/hello_world_small.o - .data 0x00002124 0x0 obj/default/hex_encoder.o - .data 0x00002124 0x0 obj/default/hex_out.o - .data 0x00002124 0x0 obj/default/input_int.o - .data 0x00002124 0x0 obj/default/inst_decoder.o - .data 0x00002124 0x0 obj/default/sys_memory.o - .data 0x00002124 0x0 obj/default/sys_register.o - .data 0x00002124 0x0 obj/default/system.o - .data 0x00002124 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-divmod.o) - .data 0x00002124 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-mul.o) - .data 0x00002124 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-ctype_.o) - .data 0x00002124 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-sprintf.o) - .data 0x00002124 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-strlen.o) - .data 0x00002124 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-vfprintf.o) - .data 0x00002124 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-fvwrite_small_str.o) - .data 0x00002124 0xe0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-impure.o) - .data 0x00002204 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-memmove.o) - .data 0x00002204 0x0 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_load.o) - .data 0x00002204 0x0 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_main.o) - .data 0x00002204 0x0 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_usleep.o) - .data 0x00002204 0x0 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_sys_init.o) - .data 0x00002204 0x0 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_busy_sleep.o) - .data 0x00002204 0x0 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .data 0x00002204 0x0 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .data 0x00002204 0x0 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - 0x0000a204 _gp = ABSOLUTE ((. + 0x8000)) - 0x0000a204 PROVIDE (gp, _gp) - *(.rwdata .rwdata.*) - *(.sdata .sdata.* .gnu.linkonce.s.*) - .sdata 0x00002204 0x4 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-ctype_.o) - 0x00002204 __ctype_ptr - .sdata 0x00002208 0x8 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-impure.o) - 0x00002208 _impure_ptr - 0x0000220c _global_impure_ptr - .sdata 0x00002210 0x4 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_sys_init.o) - 0x00002210 jtag_uart - *(.sdata2 .sdata2.* .gnu.linkonce.s2.*) - 0x00002214 . = ALIGN (0x4) - 0x00002214 _edata = ABSOLUTE (.) - 0x00002214 PROVIDE (edata, ABSOLUTE (.)) - 0x00002214 PROVIDE (__ram_rwdata_end, ABSOLUTE (.)) - 0x00002214 PROVIDE (__flash_rwdata_start, LOADADDR (.rwdata)) - -.bss 0x00002304 0x174 - 0x00002304 __bss_start = ABSOLUTE (.) - 0x00002304 PROVIDE (__sbss_start, ABSOLUTE (.)) - 0x00002304 PROVIDE (___sbss_start, ABSOLUTE (.)) - *(.dynsbss) - *(.sbss .sbss.* .gnu.linkonce.sb.*) - .sbss 0x00002304 0x5 obj/default/hello_world_small.o - 0x00002304 stack - *fill* 0x00002309 0x3 00 - .sbss 0x0000230c 0xc obj/default/input_int.o - 0x0000230c PUSH_EVENT - .sbss 0x00002318 0x4 obj/default/sys_memory.o - 0x00002318 global_current_memory - .sbss 0x0000231c 0xc ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_main.o) - 0x0000231c alt_argc - 0x00002320 alt_argv - 0x00002324 alt_envp - *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) - *(.scommon) - 0x00002328 PROVIDE (__sbss_end, ABSOLUTE (.)) - 0x00002328 PROVIDE (___sbss_end, ABSOLUTE (.)) - *(.dynbss) - *(.bss .bss.* .gnu.linkonce.b.*) - .bss 0x00002328 0x0 ../qsys_tutorial_lcd2_bsp//obj/HAL/src/crt0.o - .bss 0x00002328 0x0 obj/default/hello_world_small.o - .bss 0x00002328 0x0 obj/default/hex_encoder.o - .bss 0x00002328 0x0 obj/default/hex_out.o - .bss 0x00002328 0x0 obj/default/input_int.o - .bss 0x00002328 0x0 obj/default/inst_decoder.o - .bss 0x00002328 0x140 obj/default/sys_memory.o - .bss 0x00002468 0x0 obj/default/sys_register.o - .bss 0x00002468 0x0 obj/default/system.o - .bss 0x00002468 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-divmod.o) - .bss 0x00002468 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-mul.o) - .bss 0x00002468 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-ctype_.o) - .bss 0x00002468 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-sprintf.o) - .bss 0x00002468 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-strlen.o) - .bss 0x00002468 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-vfprintf.o) - .bss 0x00002468 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-fvwrite_small_str.o) - .bss 0x00002468 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-impure.o) - .bss 0x00002468 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-memmove.o) - .bss 0x00002468 0x0 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_load.o) - .bss 0x00002468 0x0 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_main.o) - .bss 0x00002468 0x0 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_usleep.o) - .bss 0x00002468 0x0 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_sys_init.o) - .bss 0x00002468 0x0 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_busy_sleep.o) - .bss 0x00002468 0x0 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .bss 0x00002468 0x0 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .bss 0x00002468 0x0 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - *(COMMON) - COMMON 0x00002468 0xf obj/default/sys_register.o - 0x00002468 global_registers - 0x00002478 . = ALIGN (0x4) - *fill* 0x00002477 0x1 00 - 0x00002478 __bss_end = ABSOLUTE (.) - -.onchip_memory 0x00002478 0x0 - 0x00002478 PROVIDE (_alt_partition_onchip_memory_start, ABSOLUTE (.)) - *(.onchip_memory. onchip_memory.*) - 0x00002478 . = ALIGN (0x4) - 0x00002478 PROVIDE (_alt_partition_onchip_memory_end, ABSOLUTE (.)) - 0x00002478 _end = ABSOLUTE (.) - 0x00002478 end = ABSOLUTE (.) - 0x00002478 __alt_stack_base = ABSOLUTE (.) - 0x00002478 PROVIDE (_alt_partition_onchip_memory_load_addr, LOADADDR (.onchip_memory)) - -.stab - *(.stab) - -.stabstr - *(.stabstr) - -.stab.excl - *(.stab.excl) - -.stab.exclstr - *(.stab.exclstr) - -.stab.index - *(.stab.index) - -.stab.indexstr - *(.stab.indexstr) - -.comment 0x00000000 0x26 - *(.comment) - .comment 0x00000000 0x26 obj/default/hello_world_small.o - 0x27 (size before relaxing) - .comment 0x00000000 0x27 obj/default/hex_encoder.o - .comment 0x00000000 0x27 obj/default/hex_out.o - .comment 0x00000000 0x27 obj/default/input_int.o - .comment 0x00000000 0x27 obj/default/inst_decoder.o - .comment 0x00000000 0x27 obj/default/sys_memory.o - .comment 0x00000000 0x27 obj/default/sys_register.o - .comment 0x00000000 0x27 obj/default/system.o - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-divmod.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-mul.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-ctype_.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-sprintf.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-strlen.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-vfprintf.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-fvwrite_small_str.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-impure.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-memmove.o) - .comment 0x00000000 0x27 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_load.o) - .comment 0x00000000 0x27 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_main.o) - .comment 0x00000000 0x27 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_usleep.o) - .comment 0x00000000 0x27 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_sys_init.o) - .comment 0x00000000 0x27 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_busy_sleep.o) - .comment 0x00000000 0x27 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .comment 0x00000000 0x27 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .comment 0x00000000 0x27 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - -.debug - *(.debug) - -.line - *(.line) - -.debug_srcinfo - *(.debug_srcinfo) - -.debug_sfnames - *(.debug_sfnames) - -.debug_aranges 0x00000000 0x308 - *(.debug_aranges) - .debug_aranges - 0x00000000 0x28 ../qsys_tutorial_lcd2_bsp//obj/HAL/src/crt0.o - .debug_aranges - 0x00000028 0x20 obj/default/hello_world_small.o - .debug_aranges - 0x00000048 0x20 obj/default/hex_encoder.o - .debug_aranges - 0x00000068 0x20 obj/default/hex_out.o - .debug_aranges - 0x00000088 0x20 obj/default/input_int.o - .debug_aranges - 0x000000a8 0x20 obj/default/inst_decoder.o - .debug_aranges - 0x000000c8 0x20 obj/default/sys_memory.o - .debug_aranges - 0x000000e8 0x20 obj/default/sys_register.o - .debug_aranges - 0x00000108 0x20 obj/default/system.o - .debug_aranges - 0x00000128 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-divmod.o) - .debug_aranges - 0x00000148 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-mul.o) - .debug_aranges - 0x00000168 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-sprintf.o) - .debug_aranges - 0x00000188 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-strlen.o) - .debug_aranges - 0x000001a8 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-vfprintf.o) - .debug_aranges - 0x000001c8 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-fvwrite_small_str.o) - .debug_aranges - 0x000001e8 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-memmove.o) - .debug_aranges - 0x00000208 0x20 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_load.o) - .debug_aranges - 0x00000228 0x20 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_main.o) - .debug_aranges - 0x00000248 0x20 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_usleep.o) - .debug_aranges - 0x00000268 0x20 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_sys_init.o) - .debug_aranges - 0x00000288 0x20 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_busy_sleep.o) - .debug_aranges - 0x000002a8 0x20 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .debug_aranges - 0x000002c8 0x20 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .debug_aranges - 0x000002e8 0x20 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - -.debug_pubnames - 0x00000000 0x5fb - *(.debug_pubnames) - .debug_pubnames - 0x00000000 0x7b obj/default/hello_world_small.o - .debug_pubnames - 0x0000007b 0x34 obj/default/hex_encoder.o - .debug_pubnames - 0x000000af 0x43 obj/default/hex_out.o - .debug_pubnames - 0x000000f2 0x49 obj/default/input_int.o - .debug_pubnames - 0x0000013b 0xcc obj/default/inst_decoder.o - .debug_pubnames - 0x00000207 0x88 obj/default/sys_memory.o - .debug_pubnames - 0x0000028f 0x3a obj/default/sys_register.o - .debug_pubnames - 0x000002c9 0x1c obj/default/system.o - .debug_pubnames - 0x000002e5 0x48 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-divmod.o) - .debug_pubnames - 0x0000032d 0x1f c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-mul.o) - .debug_pubnames - 0x0000034c 0x2e c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-ctype_.o) - .debug_pubnames - 0x0000037a 0x2d c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-sprintf.o) - .debug_pubnames - 0x000003a7 0x1d c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-strlen.o) - .debug_pubnames - 0x000003c4 0x45 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-vfprintf.o) - .debug_pubnames - 0x00000409 0x2b c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-fvwrite_small_str.o) - .debug_pubnames - 0x00000434 0x39 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-impure.o) - .debug_pubnames - 0x0000046d 0x1e c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-memmove.o) - .debug_pubnames - 0x0000048b 0x1f ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_load.o) - .debug_pubnames - 0x000004aa 0x46 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_main.o) - .debug_pubnames - 0x000004f0 0x1d ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_usleep.o) - .debug_pubnames - 0x0000050d 0x42 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_sys_init.o) - .debug_pubnames - 0x0000054f 0x25 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_busy_sleep.o) - .debug_pubnames - 0x00000574 0x2b ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .debug_pubnames - 0x0000059f 0x2b ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .debug_pubnames - 0x000005ca 0x31 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - -.debug_info 0x00000000 0x448e - *(.debug_info .gnu.linkonce.wi.*) - .debug_info 0x00000000 0x82 ../qsys_tutorial_lcd2_bsp//obj/HAL/src/crt0.o - .debug_info 0x00000082 0xbca obj/default/hello_world_small.o - .debug_info 0x00000c4c 0xd2 obj/default/hex_encoder.o - .debug_info 0x00000d1e 0x145 obj/default/hex_out.o - .debug_info 0x00000e63 0x245 obj/default/input_int.o - .debug_info 0x000010a8 0x526 obj/default/inst_decoder.o - .debug_info 0x000015ce 0x272 obj/default/sys_memory.o - .debug_info 0x00001840 0x7d obj/default/sys_register.o - .debug_info 0x000018bd 0x3a obj/default/system.o - .debug_info 0x000018f7 0x21c c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-divmod.o) - .debug_info 0x00001b13 0xf3 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-mul.o) - .debug_info 0x00001c06 0xa0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-ctype_.o) - .debug_info 0x00001ca6 0x7e7 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-sprintf.o) - .debug_info 0x0000248d 0xc2 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-strlen.o) - .debug_info 0x0000254f 0x9b6 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-vfprintf.o) - .debug_info 0x00002f05 0x75f c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-fvwrite_small_str.o) - .debug_info 0x00003664 0x636 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-impure.o) - .debug_info 0x00003c9a 0x102 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-memmove.o) - .debug_info 0x00003d9c 0x12e ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_load.o) - .debug_info 0x00003eca 0x125 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_main.o) - .debug_info 0x00003fef 0xab ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_usleep.o) - .debug_info 0x0000409a 0x17d ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_sys_init.o) - .debug_info 0x00004217 0xd0 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_busy_sleep.o) - .debug_info 0x000042e7 0x8d ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .debug_info 0x00004374 0x8d ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .debug_info 0x00004401 0x8d ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - -.debug_abbrev 0x00000000 0x15a3 - *(.debug_abbrev) - .debug_abbrev 0x00000000 0x12 ../qsys_tutorial_lcd2_bsp//obj/HAL/src/crt0.o - .debug_abbrev 0x00000012 0x21e obj/default/hello_world_small.o - .debug_abbrev 0x00000230 0x9e obj/default/hex_encoder.o - .debug_abbrev 0x000002ce 0xc7 obj/default/hex_out.o - .debug_abbrev 0x00000395 0x185 obj/default/input_int.o - .debug_abbrev 0x0000051a 0x186 obj/default/inst_decoder.o - .debug_abbrev 0x000006a0 0x13d obj/default/sys_memory.o - .debug_abbrev 0x000007dd 0x6f obj/default/sys_register.o - .debug_abbrev 0x0000084c 0x27 obj/default/system.o - .debug_abbrev 0x00000873 0xe0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-divmod.o) - .debug_abbrev 0x00000953 0x7b c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-mul.o) - .debug_abbrev 0x000009ce 0x61 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-ctype_.o) - .debug_abbrev 0x00000a2f 0x179 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-sprintf.o) - .debug_abbrev 0x00000ba8 0x7a c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-strlen.o) - .debug_abbrev 0x00000c22 0x263 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-vfprintf.o) - .debug_abbrev 0x00000e85 0x184 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-fvwrite_small_str.o) - .debug_abbrev 0x00001009 0x13f c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-impure.o) - .debug_abbrev 0x00001148 0xa8 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-memmove.o) - .debug_abbrev 0x000011f0 0x97 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_load.o) - .debug_abbrev 0x00001287 0xa6 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_main.o) - .debug_abbrev 0x0000132d 0x5d ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_usleep.o) - .debug_abbrev 0x0000138a 0xe3 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_sys_init.o) - .debug_abbrev 0x0000146d 0x79 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_busy_sleep.o) - .debug_abbrev 0x000014e6 0x3f ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .debug_abbrev 0x00001525 0x3f ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .debug_abbrev 0x00001564 0x3f ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - -.debug_line 0x00000000 0x3d56 - *(.debug_line) - .debug_line 0x00000000 0x66 ../qsys_tutorial_lcd2_bsp//obj/HAL/src/crt0.o - .debug_line 0x00000066 0x6a9 obj/default/hello_world_small.o - .debug_line 0x0000070f 0x2b7 obj/default/hex_encoder.o - .debug_line 0x000009c6 0x1f5 obj/default/hex_out.o - .debug_line 0x00000bbb 0x1d9 obj/default/input_int.o - .debug_line 0x00000d94 0x44c obj/default/inst_decoder.o - .debug_line 0x000011e0 0x18f obj/default/sys_memory.o - .debug_line 0x0000136f 0x87 obj/default/sys_register.o - .debug_line 0x000013f6 0x94 obj/default/system.o - .debug_line 0x0000148a 0x24f c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-divmod.o) - .debug_line 0x000016d9 0x11a c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-mul.o) - .debug_line 0x000017f3 0x81 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-ctype_.o) - .debug_line 0x00001874 0x365 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-sprintf.o) - .debug_line 0x00001bd9 0x250 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-strlen.o) - .debug_line 0x00001e29 0x666 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-vfprintf.o) - .debug_line 0x0000248f 0x2cf c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-fvwrite_small_str.o) - .debug_line 0x0000275e 0x230 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-impure.o) - .debug_line 0x0000298e 0x294 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-memmove.o) - .debug_line 0x00002c22 0x217 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_load.o) - .debug_line 0x00002e39 0x2c2 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_main.o) - .debug_line 0x000030fb 0x202 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_usleep.o) - .debug_line 0x000032fd 0x2c3 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_sys_init.o) - .debug_line 0x000035c0 0x25e ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_busy_sleep.o) - .debug_line 0x0000381e 0x1b5 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .debug_line 0x000039d3 0x1b5 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .debug_line 0x00003b88 0x1ce ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - -.debug_frame 0x00000000 0x630 - *(.debug_frame) - .debug_frame 0x00000000 0xd0 obj/default/hello_world_small.o - .debug_frame 0x000000d0 0x30 obj/default/hex_encoder.o - .debug_frame 0x00000100 0x5c obj/default/hex_out.o - .debug_frame 0x0000015c 0x44 obj/default/input_int.o - .debug_frame 0x000001a0 0xf0 obj/default/inst_decoder.o - .debug_frame 0x00000290 0x78 obj/default/sys_memory.o - .debug_frame 0x00000308 0x20 obj/default/sys_register.o - .debug_frame 0x00000328 0x28 obj/default/system.o - .debug_frame 0x00000350 0x70 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-divmod.o) - .debug_frame 0x000003c0 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-mul.o) - .debug_frame 0x000003e0 0x40 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-sprintf.o) - .debug_frame 0x00000420 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-strlen.o) - .debug_frame 0x00000440 0x64 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-vfprintf.o) - .debug_frame 0x000004a4 0x2c c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-fvwrite_small_str.o) - .debug_frame 0x000004d0 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-memmove.o) - .debug_frame 0x000004f0 0x38 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_load.o) - .debug_frame 0x00000528 0x28 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_main.o) - .debug_frame 0x00000550 0x20 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_usleep.o) - .debug_frame 0x00000570 0x38 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_sys_init.o) - .debug_frame 0x000005a8 0x28 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_busy_sleep.o) - .debug_frame 0x000005d0 0x20 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .debug_frame 0x000005f0 0x20 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .debug_frame 0x00000610 0x20 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - -.debug_str 0x00000000 0x12cb - *(.debug_str) - .debug_str 0x00000000 0x51e obj/default/hello_world_small.o - 0x5a7 (size before relaxing) - .debug_str 0x0000051e 0x42 obj/default/hex_encoder.o - 0xa0 (size before relaxing) - .debug_str 0x00000560 0x54 obj/default/hex_out.o - 0xd6 (size before relaxing) - .debug_str 0x000005b4 0xe2 obj/default/input_int.o - 0x194 (size before relaxing) - .debug_str 0x00000696 0x107 obj/default/inst_decoder.o - 0x227 (size before relaxing) - .debug_str 0x0000079d 0x51 obj/default/sys_memory.o - 0x1a7 (size before relaxing) - .debug_str 0x000007ee 0x1e obj/default/sys_register.o - 0x9f (size before relaxing) - .debug_str 0x0000080c 0xf obj/default/system.o - 0x68 (size before relaxing) - .debug_str 0x0000081b 0x10b c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-divmod.o) - 0x1b4 (size before relaxing) - .debug_str 0x00000926 0x37 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-mul.o) - 0x175 (size before relaxing) - .debug_str 0x0000095d 0xea c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-ctype_.o) - 0x119 (size before relaxing) - .debug_str 0x00000a47 0x16b c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-sprintf.o) - 0x499 (size before relaxing) - .debug_str 0x00000bb2 0xe9 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-strlen.o) - 0x184 (size before relaxing) - .debug_str 0x00000c9b 0x162 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-vfprintf.o) - 0x5af (size before relaxing) - .debug_str 0x00000dfd 0x5d c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-fvwrite_small_str.o) - 0x487 (size before relaxing) - .debug_str 0x00000e5a 0xf8 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-impure.o) - 0x45d (size before relaxing) - .debug_str 0x00000f52 0x60 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-memmove.o) - 0x199 (size before relaxing) - .debug_str 0x00000fb2 0x13a ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_load.o) - 0x1d7 (size before relaxing) - .debug_str 0x000010ec 0x44 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_main.o) - 0x15b (size before relaxing) - .debug_str 0x00001130 0x27 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_usleep.o) - 0x10d (size before relaxing) - .debug_str 0x00001157 0x8f ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_sys_init.o) - 0x1ce (size before relaxing) - .debug_str 0x000011e6 0x42 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_busy_sleep.o) - 0x130 (size before relaxing) - .debug_str 0x00001228 0x34 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - 0x11a (size before relaxing) - .debug_str 0x0000125c 0x34 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - 0x11a (size before relaxing) - .debug_str 0x00001290 0x3b ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - 0x121 (size before relaxing) - -.debug_loc 0x00000000 0x180f - *(.debug_loc) - .debug_loc 0x00000000 0x18a obj/default/hello_world_small.o - .debug_loc 0x0000018a 0x3b9 obj/default/hex_encoder.o - .debug_loc 0x00000543 0x24c obj/default/hex_out.o - .debug_loc 0x0000078f 0x52 obj/default/input_int.o - .debug_loc 0x000007e1 0x192 obj/default/inst_decoder.o - .debug_loc 0x00000973 0x105 obj/default/sys_memory.o - .debug_loc 0x00000a78 0x1f obj/default/system.o - .debug_loc 0x00000a97 0x1d2 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-divmod.o) - .debug_loc 0x00000c69 0x4f c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-mul.o) - .debug_loc 0x00000cb8 0xbe c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-sprintf.o) - .debug_loc 0x00000d76 0x1e c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-strlen.o) - .debug_loc 0x00000d94 0x878 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-vfprintf.o) - .debug_loc 0x0000160c 0xe1 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-fvwrite_small_str.o) - .debug_loc 0x000016ed 0x4f c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-memmove.o) - .debug_loc 0x0000173c 0x1f ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_load.o) - .debug_loc 0x0000175b 0x1f ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_main.o) - .debug_loc 0x0000177a 0x13 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_usleep.o) - .debug_loc 0x0000178d 0x32 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_sys_init.o) - .debug_loc 0x000017bf 0x50 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_busy_sleep.o) - -.debug_macinfo - *(.debug_macinfo) - -.debug_weaknames - *(.debug_weaknames) - -.debug_funcnames - *(.debug_funcnames) - -.debug_typenames - *(.debug_typenames) - -.debug_varnames - *(.debug_varnames) - -.debug_alt_sim_info - 0x00000000 0x40 - *(.debug_alt_sim_info) - .debug_alt_sim_info - 0x00000000 0x10 ../qsys_tutorial_lcd2_bsp//obj/HAL/src/crt0.o - .debug_alt_sim_info - 0x00000010 0x30 ../qsys_tutorial_lcd2_bsp/\libhal_bsp.a(alt_busy_sleep.o) - 0x00004000 __alt_data_end = 0x4000 - 0x00004000 PROVIDE (__alt_stack_pointer, __alt_data_end) - 0x00002478 PROVIDE (__alt_stack_limit, __alt_stack_base) - 0x00002478 PROVIDE (__alt_heap_start, end) - 0x00004000 PROVIDE (__alt_heap_limit, 0x4000) -OUTPUT(qsys_tutorial_lcd2.elf elf32-littlenios2) - -.debug_ranges 0x00000000 0x190 - .debug_ranges 0x00000000 0x20 ../qsys_tutorial_lcd2_bsp//obj/HAL/src/crt0.o - .debug_ranges 0x00000020 0x18 obj/default/hello_world_small.o - .debug_ranges 0x00000038 0x140 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-vfprintf.o) - .debug_ranges 0x00000178 0x18 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-fvwrite_small_str.o) diff --git a/software/qsys_tutorial_lcd2/readme.txt b/software/qsys_tutorial_lcd2/readme.txt deleted file mode 100644 index 3dc3186..0000000 --- a/software/qsys_tutorial_lcd2/readme.txt +++ /dev/null @@ -1,67 +0,0 @@ -Readme - Hello World Software Example - -DESCRIPTION: -Simple program that prints "Hello from Nios II" - -The purpose of this example is to demonstrate the smallest possible Hello -World application, using the Nios II HAL BSP. The memory footprint -of this hosted application is intended to be less than 1 kbytes by default using a standard -reference design. For a more fully featured Hello World application -example, see the example titled "Hello World". - -The memory footprint of this example has been reduced by making the -following changes to the normal "Hello World" example. -Check in the Nios II Software Developers Handbook for a more complete -description. - -In the SW Application project: - - In the C/C++ Build page - - Set the Optimization Level to -Os - -In BSP project: - - In the C/C++ Build page - - - Set the Optimization Level to -Os - - - Define the preprocessor option ALT_NO_INSTRUCTION_EMULATION - This removes software exception handling, which means that you cannot - run code compiled for Nios II cpu with a hardware multiplier on a core - without a the multiply unit. Check the Nios II Software Developers - Manual for more details. - - - In the BSP: - - Set Periodic system timer and Timestamp timer to none - This prevents the automatic inclusion of the timer driver. - - - Set Max file descriptors to 4 - This reduces the size of the file handle pool. - - - Uncheck Clean exit (flush buffers) - This removes the call to exit, and when main is exitted instead of - calling exit the software will just spin in a loop. - - - Check Small C library - This uses a reduced functionality C library, which lacks - support for buffering, file IO, floating point and getch(), etc. - Check the Nios II Software Developers Manual for a complete list. - - - Check Reduced device drivers - This uses reduced functionality drivers if they're available. For the - standard design this means you get polled UART and JTAG UART drivers, - no support for the LCD driver and you lose the ability to program - CFI compliant flash devices. - - -PERIPHERALS USED: -This example exercises the following peripherals: -- STDOUT device (UART or JTAG UART) - -SOFTWARE SOURCE FILES: -This example includes the following software source files: -- small_hello_world.c: - -BOARD/HOST REQUIREMENTS: -This example requires only a JTAG connection with a Nios Development board. If -the host communication settings are changed from JTAG UART (default) to use a -conventional UART, a serial cable between board DB-9 connector and the host is -required. diff --git a/software/qsys_tutorial_lcd2/sys_memory.c b/software/qsys_tutorial_lcd2/sys_memory.c deleted file mode 100644 index c8faff6..0000000 --- a/software/qsys_tutorial_lcd2/sys_memory.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * sys_memory.c - * - * Created on: 2016/11/24 - * Author: takayun - */ -#include "system.h" -#include "sys_memory.h" -#include "sys_register.h" - -/************************************************** - * Public - **************************************************/ - -// �����������̂ǂ̃�������(0 < global_current_memory < MEMS_COUNT) -unsigned int global_current_memory = 0; - -/************************************************** - * Private - **************************************************/ - -// �����������̕ϐ� -static char memory[MEMS_COUNT][MEM_SIZE]; - -static struct InstRec inst_memory[MEMS_COUNT][MEM_SIZE]; - - -/************************************************** - * Impl - **************************************************/ - -void memory_init() { - int i, j; - for (i = 0; i < MEMS_COUNT; i++) - for (j = 0; j < MEM_SIZE; j++) { - memory[i][j] = 0; - } -} - -void inst_memory_store(unsigned int mem_addr, struct InstRec inst_rec){ - inst_memory[global_current_memory][mem_addr] = inst_rec; -} -struct InstRec inst_memory_load(unsigned int mem_addr){ - return inst_memory[global_current_memory][mem_addr]; -} - -char memory_store(unsigned int mem_addr, enum Register reg) { - if (!(mem_addr < MEM_SIZE)) panic(); - memory[global_current_memory][mem_addr] = global_registers[reg]; - return memory[global_current_memory][mem_addr]; -} - -char memory_load(unsigned int mem_addr, enum Register reg) { - if (!(mem_addr < MEM_SIZE)) panic(); - global_registers[reg] = memory[global_current_memory][mem_addr]; - return global_registers[reg]; -} - diff --git a/software/qsys_tutorial_lcd2/sys_memory.h b/software/qsys_tutorial_lcd2/sys_memory.h deleted file mode 100644 index 648fe11..0000000 --- a/software/qsys_tutorial_lcd2/sys_memory.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * sys_memory.h - * - * Created on: 2016/11/24 - * Author: takayun - */ - -#ifndef SYS_MEMORY_H_ -#define SYS_MEMORY_H_ - -#include "sys_register.h" -#include "inst_decoder.h" - -/************************************************** - * Defines - **************************************************/ - -// �������̐� -#define MEMS_COUNT 4 - -// 1�������̃T�C�Y -#define MEM_SIZE 16 - -/************************************************** - * Variables - **************************************************/ - -extern unsigned int global_current_memory; - -/************************************************** - * Functions - **************************************************/ - -/* Function: memory_init - * Sammary: - * ������������������(All 0) */ -void memory_init(); - -/* ���ߗp�������ɖ��߂̃X�g�A&���[�h */ - -/* Function: memory_store -> char - * Sammary: - * �������̎w��Ԓn�Ɏw�肵�����W�X�^����l���i�[���� - * Return: - * �������Ɋi�[���ꂽ�l */ -void inst_memory_store(unsigned int mem_addr, struct InstRec inst_rec); -struct InstRec inst_memory_load(unsigned int mem_addr); - - -/* ������-���W�X�^�Ԃ̑��� */ - -/* Function: memory_store -> char - * Sammary: - * �������̎w��Ԓn�Ɏw�肵�����W�X�^����l���i�[���� - * Return: - * �������Ɋi�[���ꂽ�l */ -char memory_store(unsigned int mem_addr, enum Register reg); - -/* Function: memory_store -> char - * Sammary: - * �w�肵�����W�X�^�Ƀ������̎w��Ԓn����l���i�[���� - * Return: - * ���W�X�^�Ɋi�[���ꂽ�l */ -char memory_load(unsigned int mem_addr, enum Register reg); - - -#endif /* SYS_MEMORY_H_ */ diff --git a/software/qsys_tutorial_lcd2/sys_register.c b/software/qsys_tutorial_lcd2/sys_register.c deleted file mode 100644 index 84ed485..0000000 --- a/software/qsys_tutorial_lcd2/sys_register.c +++ /dev/null @@ -1,17 +0,0 @@ -/* - * sys_register.c - * - * Created on: 2016/11/24 - * Author: takayun - */ -#include "sys_register.h" - -char global_registers[REG_MAX_COUNT]; - -void registers_init() { - int i; - for (i = 0; i < REG_MAX_COUNT; i++) global_registers[i] = 0; -} - - - diff --git a/software/qsys_tutorial_lcd2/sys_register.h b/software/qsys_tutorial_lcd2/sys_register.h deleted file mode 100644 index 65ad219..0000000 --- a/software/qsys_tutorial_lcd2/sys_register.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * sys_register.h - * - * Created on: 2016/11/24 - * Author: takayun - */ - -#ifndef SYS_REGISTER_H_ -#define SYS_REGISTER_H_ - -/************************************************** - * Defines - **************************************************/ - -// ���W�X�^�̒�` -enum Register { - /* �ʏ�̃��W�X�^ */ - Szero, //�[�����W�X�^ - Spc, //�v���O�����J�E���^ - Ssp, //�X�^�b�N�|�C���^ - Sgp0, //�ėp���W�X�^0 - Sgp1, //�ėp���W�X�^1 - Sacc, //�A�L�������[�^ - Sflg, //�t���O���W�X�^ - /* �X�C�b�`�ǂݏo���p���W�X�^ */ - Ssw_data, //�f�[�^(8bit) - Ssw_inst, //����(4bit) - Ssw_regi, //���W�X�^�ԍ�(4bit) - Ssw_memi, //�������Ԓn(4bit) - Ssw_psel, //�v���O�����Z���N�^(4bit) - Ssw_rw, //�ǂݏ������[�h(1bit) - Ssw_run, //���s���[�h(1bit) - /* 7�Z�O�p���W�X�^ */ - Sseg, - - /* �z��錾�p */ - REG_MAX_COUNT -}; - -/************************************************** - * Variables - **************************************************/ - -// ���W�X�^�p�̕ϐ� -extern char global_registers[REG_MAX_COUNT]; - -/************************************************** - * Functions - **************************************************/ - -void registers_init(); - - -#endif /* SYS_REGISTER_H_ */ diff --git a/software/qsys_tutorial_lcd2/system.c b/software/qsys_tutorial_lcd2/system.c deleted file mode 100644 index 30713dd..0000000 --- a/software/qsys_tutorial_lcd2/system.c +++ /dev/null @@ -1,14 +0,0 @@ -/* - * system.c - * - * Created on: 2016/11/24 - * Author: takayun - */ -#include "system.h" -#include "hex_out.h" - -void panic() { - clear_block(HEX0_3); - print_block("err ", 4, HEX0_3); -} - diff --git a/software/qsys_tutorial_lcd2/system.h b/software/qsys_tutorial_lcd2/system.h deleted file mode 100644 index 1a628fa..0000000 --- a/software/qsys_tutorial_lcd2/system.h +++ /dev/null @@ -1,13 +0,0 @@ -/* - * system.h - * - * Created on: 2016/11/24 - * Author: takayun - */ - -#ifndef SYSTEM_H_ -#define SYSTEM_H_ - -void panic(); - -#endif /* SYSTEM_H_ */ diff --git a/software/qsys_tutorial_lcd2/system/template.xml b/software/qsys_tutorial_lcd2/system/template.xml deleted file mode 100644 index b09e912..0000000 --- a/software/qsys_tutorial_lcd2/system/template.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git a/software/qsys_tutorial_lcd2_bsp/.cproject b/software/qsys_tutorial_lcd2_bsp/.cproject deleted file mode 100644 index a8126ff..0000000 --- a/software/qsys_tutorial_lcd2_bsp/.cproject +++ /dev/null @@ -1,481 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/software/qsys_tutorial_lcd2_bsp/.project b/software/qsys_tutorial_lcd2_bsp/.project deleted file mode 100644 index 1076844..0000000 --- a/software/qsys_tutorial_lcd2_bsp/.project +++ /dev/null @@ -1,85 +0,0 @@ - - - qsys_tutorial_lcd2_bsp - - - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - ?name? - - - - org.eclipse.cdt.make.core.append_environment - true - - - org.eclipse.cdt.make.core.autoBuildTarget - all - - - org.eclipse.cdt.make.core.buildArguments - - - - org.eclipse.cdt.make.core.buildCommand - make - - - org.eclipse.cdt.make.core.buildLocation - ${workspace_loc://qsys_tutorial_lcd2_bsp} - - - org.eclipse.cdt.make.core.cleanBuildTarget - clean - - - org.eclipse.cdt.make.core.contents - org.eclipse.cdt.make.core.activeConfigSettings - - - org.eclipse.cdt.make.core.enableAutoBuild - false - - - org.eclipse.cdt.make.core.enableCleanBuild - true - - - org.eclipse.cdt.make.core.enableFullBuild - true - - - org.eclipse.cdt.make.core.fullBuildTarget - all - - - org.eclipse.cdt.make.core.stopOnError - true - - - org.eclipse.cdt.make.core.useDefaultBuildCmd - true - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - org.eclipse.cdt.core.ccnature - com.altera.sbtgui.project.SBTGUINature - com.altera.sbtgui.project.SBTGUIBspNature - - diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/inc/alt_types.h b/software/qsys_tutorial_lcd2_bsp/HAL/inc/alt_types.h deleted file mode 100644 index d02f171..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/inc/alt_types.h +++ /dev/null @@ -1,54 +0,0 @@ -#ifndef __ALT_TYPES_H__ -#define __ALT_TYPES_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/* - * Don't declare these typedefs if this file is included by assembly source. - */ -#ifndef ALT_ASM_SRC -typedef signed char alt_8; -typedef unsigned char alt_u8; -typedef signed short alt_16; -typedef unsigned short alt_u16; -typedef signed long alt_32; -typedef unsigned long alt_u32; -typedef long long alt_64; -typedef unsigned long long alt_u64; -#endif - -#define ALT_INLINE __inline__ -#define ALT_ALWAYS_INLINE __attribute__ ((always_inline)) -#define ALT_WEAK __attribute__((weak)) - -#endif /* __ALT_TYPES_H__ */ diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/inc/altera_nios2_qsys_irq.h b/software/qsys_tutorial_lcd2_bsp/HAL/inc/altera_nios2_qsys_irq.h deleted file mode 100644 index 6629ec9..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/inc/altera_nios2_qsys_irq.h +++ /dev/null @@ -1,80 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * Support for the Nios II internal interrupt controller. - */ - -#ifndef __ALT_NIOS2_QSYS_IRQ_H__ -#define __ALT_NIOS2_QSYS_IRQ_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The macro ALTERA_NIOS2_IRQ_INSTANCE is used by the alt_irq_init() - * function in the auto-generated file alt_sys_init.c to create an - * instance of this interrupt controller device driver state if this - * module contains an interrupt controller. - * Only one instance of a Nios II is allowed so this macro is just empty. - */ - -#define ALTERA_NIOS2_QSYS_IRQ_INSTANCE(name, state) - -/* - * altera_nios2_irq_init() is called by the auto-generated function - * alt_irq_init() once for the Nios II if it contains an interrupt controller. - * The altera_nios2_irq_init() routine is called using the - * ALTERA_NIOS2_IRQ_INIT macro given below. - * - * This function initializes the internal interrupt controller - * so is not called if the Nios II contains an external interrupt - * controller port (because the internal interrupt controller - * is removed if this port is present). - */ - -extern void altera_nios2_qsys_irq_init( void ); - -/* - * The macro ALTERA_NIOS2_IRQ_INIT is used by the alt_irq_init() routine - * in the auto-generated file alt_sys_init.c to initialize an instance - * of the interrupt controller device driver state. - */ - -#define ALTERA_NIOS2_QSYS_IRQ_INIT(name, state) altera_nios2_qsys_irq_init() - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_NIOS2_QSYS_IRQ_H__ */ - diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/inc/io.h b/software/qsys_tutorial_lcd2_bsp/HAL/inc/io.h deleted file mode 100644 index 362f103..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/inc/io.h +++ /dev/null @@ -1,81 +0,0 @@ -#ifndef __IO_H__ -#define __IO_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/* IO Header file for Nios II Toolchain */ - -#include "alt_types.h" -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#ifndef SYSTEM_BUS_WIDTH -#error SYSTEM_BUS_WIDTH undefined -#endif - -/* Dynamic bus access functions */ - -#define __IO_CALC_ADDRESS_DYNAMIC(BASE, OFFSET) \ - ((void *)(((alt_u8*)BASE) + (OFFSET))) - -#define IORD_32DIRECT(BASE, OFFSET) \ - __builtin_ldwio (__IO_CALC_ADDRESS_DYNAMIC ((BASE), (OFFSET))) -#define IORD_16DIRECT(BASE, OFFSET) \ - __builtin_ldhuio (__IO_CALC_ADDRESS_DYNAMIC ((BASE), (OFFSET))) -#define IORD_8DIRECT(BASE, OFFSET) \ - __builtin_ldbuio (__IO_CALC_ADDRESS_DYNAMIC ((BASE), (OFFSET))) - -#define IOWR_32DIRECT(BASE, OFFSET, DATA) \ - __builtin_stwio (__IO_CALC_ADDRESS_DYNAMIC ((BASE), (OFFSET)), (DATA)) -#define IOWR_16DIRECT(BASE, OFFSET, DATA) \ - __builtin_sthio (__IO_CALC_ADDRESS_DYNAMIC ((BASE), (OFFSET)), (DATA)) -#define IOWR_8DIRECT(BASE, OFFSET, DATA) \ - __builtin_stbio (__IO_CALC_ADDRESS_DYNAMIC ((BASE), (OFFSET)), (DATA)) - -/* Native bus access functions */ - -#define __IO_CALC_ADDRESS_NATIVE(BASE, REGNUM) \ - ((void *)(((alt_u8*)BASE) + ((REGNUM) * (SYSTEM_BUS_WIDTH/8)))) - -#define IORD(BASE, REGNUM) \ - __builtin_ldwio (__IO_CALC_ADDRESS_NATIVE ((BASE), (REGNUM))) -#define IOWR(BASE, REGNUM, DATA) \ - __builtin_stwio (__IO_CALC_ADDRESS_NATIVE ((BASE), (REGNUM)), (DATA)) - -#ifdef __cplusplus -} -#endif - -#endif /* __IO_H__ */ diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/inc/nios2.h b/software/qsys_tutorial_lcd2_bsp/HAL/inc/nios2.h deleted file mode 100644 index 72cefba..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/inc/nios2.h +++ /dev/null @@ -1,230 +0,0 @@ -#ifndef __NIOS2_H__ -#define __NIOS2_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2008 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * This header provides processor specific macros for accessing the Nios2 - * control registers. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * Macros for accessing selected processor registers - */ - -#define NIOS2_READ_ET(et) \ - do { __asm ("mov %0, et" : "=r" (et) ); } while (0) - -#define NIOS2_WRITE_ET(et) \ - do { __asm volatile ("mov et, %z0" : : "rM" (et)); } while (0) - -#define NIOS2_READ_SP(sp) \ - do { __asm ("mov %0, sp" : "=r" (sp) ); } while (0) - -/* - * Macros for useful processor instructions - */ - -#define NIOS2_BREAK() \ - do { __asm volatile ("break"); } while (0) - -#define NIOS2_REPORT_STACK_OVERFLOW() \ - do { __asm volatile("break 3"); } while (0) - -/* - * Macros for accessing the control registers. - */ - -#define NIOS2_READ_STATUS(dest) \ - do { dest = __builtin_rdctl(0); } while (0) - -#define NIOS2_WRITE_STATUS(src) \ - do { __builtin_wrctl(0, src); } while (0) - -#define NIOS2_READ_ESTATUS(dest) \ - do { dest = __builtin_rdctl(1); } while (0) - -#define NIOS2_READ_BSTATUS(dest) \ - do { dest = __builtin_rdctl(2); } while (0) - -#define NIOS2_READ_IENABLE(dest) \ - do { dest = __builtin_rdctl(3); } while (0) - -#define NIOS2_WRITE_IENABLE(src) \ - do { __builtin_wrctl(3, src); } while (0) - -#define NIOS2_READ_IPENDING(dest) \ - do { dest = __builtin_rdctl(4); } while (0) - -#define NIOS2_READ_CPUID(dest) \ - do { dest = __builtin_rdctl(5); } while (0) - - -/* - * Macros for accessing extra exception registers. These - * are always enabled wit the MPU or MMU, and optionally - * with other advanced exception types/ - */ -#define NIOS2_READ_EXCEPTION(dest) \ - do { dest = __builtin_rdctl(7); } while (0) - -#define NIOS2_READ_BADADDR(dest) \ - do { dest = __builtin_rdctl(12); } while (0) - - -/* - * Macros for accessing control registers for MPU - * operation. These should not be used unless the - * MPU is enabled. - * - * The config register may be augmented for future - * enhancements. For now, only MPU support is provided. - */ -/* Config register */ -#define NIOS2_WRITE_CONFIG(src) \ - do { __builtin_wrctl(13, src); } while (0) - -#define NIOS2_READ_CONFIG(dest) \ - do { dest = __builtin_rdctl(13); } while (0) - -/* MPU Base Address Register */ -#define NIOS2_WRITE_MPUBASE(src) \ - do { __builtin_wrctl(14, src); } while (0) - -#define NIOS2_READ_MPUBASE(dest) \ - do { dest = __builtin_rdctl(14); } while (0) - -/* MPU Access Register */ -#define NIOS2_WRITE_MPUACC(src) \ - do { __builtin_wrctl(15, src); } while (0) - -#define NIOS2_READ_MPUACC(dest) \ - do { dest = __builtin_rdctl(15); } while (0) - - -/* - * Nios II control registers that are always present - */ -#define NIOS2_STATUS status -#define NIOS2_ESTATUS estatus -#define NIOS2_BSTATUS bstatus -#define NIOS2_IENABLE ienable -#define NIOS2_IPENDING ipending -#define NIOS2_CPUID cpuid - -/* - * STATUS, BSTATUS, ESTATUS, and SSTATUS fields. - * The presence of fields is a function of the Nios II configuration. - */ -#define NIOS2_STATUS_PIE_MSK (0x00000001) -#define NIOS2_STATUS_PIE_OFST (0) -#define NIOS2_STATUS_U_MSK (0x00000002) -#define NIOS2_STATUS_U_OFST (1) -#define NIOS2_STATUS_EH_MSK (0x00000004) -#define NIOS2_STATUS_EH_OFST (2) -#define NIOS2_STATUS_IH_MSK (0x00000008) -#define NIOS2_STATUS_IH_OFST (3) -#define NIOS2_STATUS_IL_MSK (0x000003f0) -#define NIOS2_STATUS_IL_OFST (4) -#define NIOS2_STATUS_CRS_MSK (0x0000fc00) -#define NIOS2_STATUS_CRS_OFST (10) -#define NIOS2_STATUS_PRS_MSK (0x003f0000) -#define NIOS2_STATUS_PRS_OFST (16) -#define NIOS2_STATUS_NMI_MSK (0x00400000) -#define NIOS2_STATUS_NMI_OFST (22) -#define NIOS2_STATUS_RSIE_MSK (0x00800000) -#define NIOS2_STATUS_RSIE_OFST (23) -#define NIOS2_STATUS_SRS_MSK (0x80000000) -#define NIOS2_STATUS_SRS_OFST (31) - -/* - * Bit masks & offsets available with extra exceptions support - */ - -/* Exception register */ -#define NIOS2_EXCEPTION_REG_CAUSE_MASK (0x0000007c) -#define NIOS2_EXCEPTION_REG_CAUSE_OFST (2) - -/* - * Bit masks & offsets for MPU support - * - * All bit-masks are expressed relative to the position - * of the data with a register. To read data that is LSB- - * aligned, the register read data should be masked, then - * right-shifted by the designated "OFST" macro value. The - * opposite should be used for register writes when starting - * with LSB-aligned data. - */ - -/* Config register */ -#define NIOS2_CONFIG_REG_PE_MASK (0x00000001) -#define NIOS2_CONFIG_REG_PE_OFST (0) -#define NIOS2_CONFIG_REG_ANI_MASK (0x00000002) -#define NIOS2_CONFIG_REG_ANI_OFST (1) - -/* MPU Base Address Register */ -#define NIOS2_MPUBASE_D_MASK (0x00000001) -#define NIOS2_MPUBASE_D_OFST (0) -#define NIOS2_MPUBASE_INDEX_MASK (0x0000003e) -#define NIOS2_MPUBASE_INDEX_OFST (1) -#define NIOS2_MPUBASE_BASE_ADDR_MASK (0xffffffc0) -#define NIOS2_MPUBASE_BASE_ADDR_OFST (6) - -/* MPU Access Register */ -#define NIOS2_MPUACC_LIMIT_MASK (0xffffffc0) -#define NIOS2_MPUACC_LIMIT_OFST (6) -#define NIOS2_MPUACC_MASK_MASK (0xffffffc0) -#define NIOS2_MPUACC_MASK_OFST (6) -#define NIOS2_MPUACC_C_MASK (0x00000020) -#define NIOS2_MPUACC_C_OFST (5) -#define NIOS2_MPUACC_PERM_MASK (0x0000001c) -#define NIOS2_MPUACC_PERM_OFST (2) -#define NIOS2_MPUACC_RD_MASK (0x00000002) -#define NIOS2_MPUACC_RD_OFST (1) -#define NIOS2_MPUACC_WR_MASK (0x00000001) -#define NIOS2_MPUACC_WR_OFST (0) - -/* - * Number of available IRQs in internal interrupt controller. - */ -#define NIOS2_NIRQ 32 - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __NIOS2_H__ */ diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/inc/os/alt_flag.h b/software/qsys_tutorial_lcd2_bsp/HAL/inc/os/alt_flag.h deleted file mode 100644 index b9b4605..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/inc/os/alt_flag.h +++ /dev/null @@ -1,98 +0,0 @@ -#ifndef __ALT_FLAG_H__ -#define __ALT_FLAG_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * This header provides macro definitions that can be used to create and use - * uc/OS-II style event flags. These macros can be used in both a uC/OS-II based - * environment, and a single threaded HAL based environment. - * - * The motivation for these macros is to allow code to be developed which is - * thread safe under uC/OS-II, but incurs no additional overhead when used in a - * single threaded HAL environment. - * - * In the case of a single threaded HAL environment, they compile to - * "do nothing" directives, which ensures they do not contribute to the final - * executable. - * - * The following macros are available: - * - * ALT_FLAG_GRP - Create a flag group instance. - * ALT_EXTERN_FLAG_GRP - Create a reference to an external flag group instance. - * ALT_STATIC_FLAG_GRP - Create a static flag group instance. - * ALT_FLAG_CREATE - Initialise a flag group. - * ALT_FLAG_PEND - Pend on a flag group. - * ALT_FLAG_POST - Set a flag condition. - - * - * Input arguments and return codes are all consistant with the equivalent - * uC/OS-II function. - * - * It's important to be careful in the use of the macros: ALT_FLAG_GRP, - * ALT_EXTERN_FLAG_GRP, and ALT_STATIC_FLAG_GRP. In these three cases the - * semi-colon is included in the macro definition; so, for example, you should - * use: - * - * ALT_FLAG_GRP(mygroup) - * - * not: - * - * ALT_FLAG_GRP(mygroup); - * - * The inclusion of the semi-colon has been necessary to ensure the macros can - * compile with no warnings when used in a single threaded HAL environment. - * - */ - -#include "priv/alt_no_error.h" - -#define ALT_FLAG_GRP(group) -#define ALT_EXTERN_FLAG_GRP(group) -#define ALT_STATIC_FLAG_GRP(group) - -#define ALT_FLAG_CREATE(group, flags) alt_no_error () -#define ALT_FLAG_PEND(group, flags, wait_type, timeout) alt_no_error () -#define ALT_FLAG_POST(group, flags, opt) alt_no_error () - -#ifndef ALT_SINGLE_THREADED -#define ALT_SINGLE_THREADED -#endif - -#endif /* __ALT_FLAG_H__ */ diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/inc/os/alt_hooks.h b/software/qsys_tutorial_lcd2_bsp/HAL/inc/os/alt_hooks.h deleted file mode 100644 index 9054e3f..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/inc/os/alt_hooks.h +++ /dev/null @@ -1,61 +0,0 @@ -#ifndef __ALT_HOOKS_H__ -#define __ALT_HOOKS_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * This header provides "do-nothing" macro definitions for operating system - * hooks within the HAL. The O/S component can override these to provide it's - * own implementation. - */ - -#define ALT_OS_TIME_TICK() while(0) -#define ALT_OS_INIT() while(0) -#define ALT_OS_STOP() while(0) - -/* Call from assembly code */ -#define ALT_OS_INT_ENTER_ASM -#define ALT_OS_INT_EXIT_ASM - -/* Call from C code */ -#define ALT_OS_INT_ENTER() while(0) -#define ALT_OS_INT_EXIT() while(0) - - -#endif /* __ALT_HOOKS_H__ */ diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/inc/os/alt_sem.h b/software/qsys_tutorial_lcd2_bsp/HAL/inc/os/alt_sem.h deleted file mode 100644 index 753943e..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/inc/os/alt_sem.h +++ /dev/null @@ -1,96 +0,0 @@ -#ifndef __ALT_SEM_H__ -#define __ALT_SEM_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * This header provides macro definitions that can be used to create and use - * semaphores. These macros can be used in both a uC/OS-II based environment, - * and a single threaded HAL based environment. - * - * The motivation for these macros is to allow code to be developed which is - * thread safe under uC/OS-II, but incurs no additional overhead when used in a - * single threaded HAL environment. - * - * In the case of a single threaded HAL environment, they compile to - * "do nothing" directives, which ensures they do not contribute to the final - * executable. - * - * The following macros are available: - * - * ALT_SEM - Create a semaphore instance. - * ALT_EXTERN_SEM - Create a reference to an external semaphore instance. - * ALT_STATIC_SEM - Create a static semaphore instance. - * ALT_SEM_CREATE - Initialise a semaphore. - * ALT_SEM_PEND - Pend on a semaphore. - * ALT_SEM_POST - Increment a semaphore. - * - * Input arguments and return codes are all consistant with the equivalent - * uC/OS-II function. - * - * It's important to be careful in the use of the macros: ALT_SEM, - * ALT_EXTERN_SEM, and ALT_STATIC_SEM. In these three cases the semi-colon is - * included in the macro definition; so, for example, you should use: - * - * ALT_SEM(mysem) - * - * not: - * - * ALT_SEM(mysem); - * - * The inclusion of the semi-colon has been necessary to ensure the macros can - * compile with no warnings when used in a single threaded HAL environment. - * - */ - -#include "priv/alt_no_error.h" - -#define ALT_SEM(sem) -#define ALT_EXTERN_SEM(sem) -#define ALT_STATIC_SEM(sem) - -#define ALT_SEM_CREATE(sem, value) alt_no_error () -#define ALT_SEM_PEND(sem, timeout) alt_no_error () -#define ALT_SEM_POST(sem) alt_no_error () - -#ifndef ALT_SINGLE_THREADED -#define ALT_SINGLE_THREADED -#endif - -#endif /* __ALT_SEM_H__ */ diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/inc/os/alt_syscall.h b/software/qsys_tutorial_lcd2_bsp/HAL/inc/os/alt_syscall.h deleted file mode 100644 index 507c6aa..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/inc/os/alt_syscall.h +++ /dev/null @@ -1,75 +0,0 @@ -#ifndef __ALT_SYSCALL_H__ -#define __ALT_SYSCALL_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * The macros defined in this file are used to provide the function names used - * for the HAL 'UNIX style' interface, e.g. read(), write() etc. - * - * Operating systems which are ported to the HAL can provide their own - * version of this file, which will be used in preference. This allows - * the operating system to provide it's own implementation of the top level - * system calls, while retaining the HAL functions under a different name, - * for example, alt_read(), alt_write() etc. - */ - -#define ALT_CLOSE close -#define ALT_ENVIRON environ -#define ALT_EXECVE execve -#define ALT_EXIT _exit -#define ALT_FCNTL fcntl -#define ALT_FORK fork -#define ALT_FSTAT fstat -#define ALT_GETPID getpid -#define ALT_GETTIMEOFDAY gettimeofday -#define ALT_IOCTL ioctl -#define ALT_ISATTY isatty -#define ALT_KILL kill -#define ALT_LINK link -#define ALT_LSEEK lseek -#define ALT_OPEN open -#define ALT_READ read -#define ALT_RENAME _rename -#define ALT_SBRK sbrk -#define ALT_SETTIMEOFDAY settimeofday -#define ALT_STAT stat -#define ALT_UNLINK unlink -#define ALT_USLEEP usleep -#define ALT_WAIT wait -#define ALT_WRITE write -#define ALT_TIMES times - -/* - * - */ - -#endif /* __ALT_SYSCALL_H__ */ diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/inc/priv/alt_alarm.h b/software/qsys_tutorial_lcd2_bsp/HAL/inc/priv/alt_alarm.h deleted file mode 100644 index 45d6a0e..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/inc/priv/alt_alarm.h +++ /dev/null @@ -1,101 +0,0 @@ -#ifndef __ALT_PRIV_ALARM_H__ -#define __ALT_PRIV_ALARM_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "alt_types.h" - -/* - * This header provides the internal defenitions required by the public - * interface alt_alarm.h. These variables and structures are not guaranteed to - * exist in future implementations of the HAL. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * "alt_alarm_s" is a structure type used to maintain lists of alarm callback - * functions. - */ - -struct alt_alarm_s -{ - alt_llist llist; /* linked list */ - alt_u32 time; /* time in system ticks of the callback */ - alt_u32 (*callback) (void* context); /* callback function. The return - * value is the period for the next callback; where - * zero indicates that the alarm should be removed - * from the list. - */ - alt_u8 rollover; /* set when desired alarm time + current time causes - overflow, to prevent premature alarm */ - void* context; /* Argument for the callback */ -}; - -/* - * "_alt_tick_rate" is a global variable used to store the system clock rate - * in ticks per second. This is initialised to zero, which coresponds to there - * being no system clock available. - * - * It is then set to it's final value by the system clock driver through a call - * to alt_sysclk_init(). - */ - -extern alt_u32 _alt_tick_rate; - -/* - * "_alt_nticks" is a global variable which records the elapsed number of - * system clock ticks since the last call to settimeofday() or since reset if - * settimeofday() has not been called. - */ - -extern volatile alt_u32 _alt_nticks; - -/* The list of registered alarms. */ - -extern alt_llist alt_alarm_list; - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_PRIV_ALARM_H__ */ diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/inc/priv/alt_busy_sleep.h b/software/qsys_tutorial_lcd2_bsp/HAL/inc/priv/alt_busy_sleep.h deleted file mode 100644 index b1af849..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/inc/priv/alt_busy_sleep.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef __ALT_BUSY_SLEEP_H -#define __ALT_BUSY_SLEEP_H - -/* - * Copyright (c) 2003 Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - */ - -/* - * The function alt_busy_sleep provides a busy loop implementation of usleep. - * This is used to provide usleep for the standalone HAL, or when the timer is - * unavailable in uC/OS-II. - */ - -extern unsigned int alt_busy_sleep (unsigned int us); - -#endif /* __ALT_BUSY_SLEEP_H */ diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/inc/priv/alt_dev_llist.h b/software/qsys_tutorial_lcd2_bsp/HAL/inc/priv/alt_dev_llist.h deleted file mode 100644 index 451b063..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/inc/priv/alt_dev_llist.h +++ /dev/null @@ -1,77 +0,0 @@ -#ifndef __ALT_DEV_LLIST_H__ -#define __ALT_DEV_LLIST_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "sys/alt_llist.h" -#include "alt_types.h" - -/* - * This header provides the internal defenitions required to control file - * access. These variables and functions are not guaranteed to exist in - * future implementations of the HAL. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The alt_dev_llist is an internal structure used to form a common base - * class for all device types. The use of this structure allows common code - * to be used to manipulate the various device lists. - */ - -typedef struct { - alt_llist llist; - const char* name; -} alt_dev_llist; - -/* - * - */ - -extern int alt_dev_llist_insert (alt_dev_llist* dev, alt_llist* list); - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_DEV_LLIST_H__ */ diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/inc/priv/alt_exception_handler_registry.h b/software/qsys_tutorial_lcd2_bsp/HAL/inc/priv/alt_exception_handler_registry.h deleted file mode 100644 index c6905fa..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/inc/priv/alt_exception_handler_registry.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef __ALT_EXCEPTION_HANDLER_REGISTRY_H__ -#define __ALT_EXCEPTION_HANDLER_REGISTRY_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2008 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ -#include "sys/alt_exceptions.h" - -/* Function pointer to exception callback routine */ -extern alt_exception_result (*alt_instruction_exception_handler) - (alt_exception_cause, alt_u32, alt_u32); - -#endif /* __ALT_EXCEPTION_HANDLER_REGISTRY_H__ */ diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/inc/priv/alt_file.h b/software/qsys_tutorial_lcd2_bsp/HAL/inc/priv/alt_file.h deleted file mode 100644 index 2c3e843..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/inc/priv/alt_file.h +++ /dev/null @@ -1,179 +0,0 @@ -#ifndef __ALT_FILE_H__ -#define __ALT_FILE_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "sys/alt_dev.h" -#include "sys/alt_llist.h" -#include "os/alt_sem.h" - -#include "alt_types.h" - -/* - * This header provides the internal defenitions required to control file - * access. These variables and functions are not guaranteed to exist in - * future implementations of the HAL. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The function alt_find_dev() is used to search the device list "list" to - * locate a device named "name". If a match is found, then a pointer to the - * device is returned, otherwise NULL is returned. - */ - -extern alt_dev* alt_find_dev (const char* name, alt_llist* list); - -/* - * alt_find_file() is used to search the list of registered file systems to - * find the filesystem that the file named "name" belongs to. If a match is - * found, then a pointer to the filesystems alt_dev structure is returned, - * otherwise NULL is returned. - * - * Note that a match does not indicate that the file exists, only that a - * filesystem exists that is registered for a partition that could contain - * the file. The filesystems open() function would need to be called in order - * to determine if the file exists. - */ - -extern alt_dev* alt_find_file (const char* name); - -/* - * alt_get_fd() is used to allocate a file descriptor for the device or - * filesystem "dev". A negative return value indicates an error, otherwise the - * return value is the index of the file descriptor within the file descriptor - * pool. - */ - -extern int alt_get_fd (alt_dev* dev); - -/* - * alt_release_fd() is called to free the file descriptor with index "fd". - */ - -extern void alt_release_fd (int fd); - -/* - * alt_fd_lock() is called by ioctl() to mark the file descriptor "fd" as - * being open for exclusive access. Subsequent calls to open() for the device - * associated with "fd" will fail. A device is unlocked by either calling - * close() for "fd", or by an alternate call to ioctl() (see ioctl.c for - * details). - */ - -extern int alt_fd_lock (alt_fd* fd); - -/* - * alt_fd_unlock() is called by ioctl() to unlock a descriptor previously - * locked by a call to alt_fd_lock(). - */ - -extern int alt_fd_unlock (alt_fd* fd); - -/* - * "alt_fd_list" is the pool of file descriptors. - */ - -extern alt_fd alt_fd_list[]; - -/* - * flags used by alt_fd. - * - * ALT_FD_EXCL is used to mark a file descriptor as locked for exclusive - * access, i.e. further calls to open() for the associated device should - * fail. - * - * ALT_FD_DEV marks a dile descriptor as belonging to a device as oposed to a - * filesystem. - */ - -#define ALT_FD_EXCL 0x80000000 -#define ALT_FD_DEV 0x40000000 - -#define ALT_FD_FLAGS_MASK (ALT_FD_EXCL | ALT_FD_DEV) - -/* - * "alt_dev_list" is the head of the linked list of registered devices. - */ - -extern alt_llist alt_dev_list; - -/* - * "alt_fs_list" is the head of the linked list of registered filesystems. - */ - -extern alt_llist alt_fs_list; - -/* - * "alt_fd_list_lock" is a semaphore used to ensure that access to the pool - * of file descriptors is thread safe. - */ - -ALT_EXTERN_SEM(alt_fd_list_lock) - -/* - * "alt_max_fd" is a 'high water mark'. It indicates the highest file - * descriptor allocated. Use of this can save searching the entire pool - * for active file descriptors, which helps avoid contention on access - * to the file descriptor pool. - */ - -extern alt_32 alt_max_fd; - -/* - * alt_io_redirect() is called at startup to redirect stdout, stdin, and - * stderr to the devices named in the input arguments. By default these streams - * are directed at /dev/null, and are then redirected using this function once - * all of the devices have been registered within the system. - */ - -extern void alt_io_redirect(const char* stdout_dev, - const char* stdin_dev, - const char* stderr_dev); - - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_FILE_H__ */ diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/inc/priv/alt_iic_isr_register.h b/software/qsys_tutorial_lcd2_bsp/HAL/inc/priv/alt_iic_isr_register.h deleted file mode 100644 index a0cb01c..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/inc/priv/alt_iic_isr_register.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef __ALT_IIC_ISR_REGISTER_H_ -#define __ALT_IIC_ISR_REGISTER_H_ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ -#include "alt_types.h" -#include "sys/alt_irq.h" - -extern int alt_iic_isr_register(alt_u32 ic_id, alt_u32 irq, alt_isr_func isr, - void *isr_context, void *flags); - -#endif /* __ALT_IIC_ISR_REGISTER_H_ */ diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/inc/priv/alt_irq_table.h b/software/qsys_tutorial_lcd2_bsp/HAL/inc/priv/alt_irq_table.h deleted file mode 100644 index 694ef06..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/inc/priv/alt_irq_table.h +++ /dev/null @@ -1,59 +0,0 @@ -#ifndef __ALT_IRQ_TABLE_H__ -#define __ALT_IRQ_TABLE_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * Definition of a table describing each interrupt handler. The index into - * the array is the interrupt id associated with the handler. - * - * When an interrupt occurs, the associated handler is called with - * the argument stored in the context member. - * - * The table is physically created in alt_irq_handler.c - */ -extern struct ALT_IRQ_HANDLER -{ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - void (*handler)(void*); -#else - void (*handler)(void*, alt_u32); -#endif - void *context; -} alt_irq[ALT_NIRQ]; - -#endif diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/inc/priv/alt_legacy_irq.h b/software/qsys_tutorial_lcd2_bsp/HAL/inc/priv/alt_legacy_irq.h deleted file mode 100644 index c7aec02..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/inc/priv/alt_legacy_irq.h +++ /dev/null @@ -1,158 +0,0 @@ -#ifndef __ALT_LEGACY_IRQ_H__ -#define __ALT_LEGACY_IRQ_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * This file provides prototypes and inline implementations of certain routines - * used by the legacy interrupt API. Do not include this in your driver or - * application source files, use "sys/alt_irq.h" instead to access the proper - * public API. - */ - -#include -#include "system.h" - -#ifndef NIOS2_EIC_PRESENT - -#include "nios2.h" -#include "alt_types.h" - -#include "sys/alt_irq.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * alt_irq_register() can be used to register an interrupt handler. If the - * function is succesful, then the requested interrupt will be enabled upon - * return. - */ -extern int alt_irq_register (alt_u32 id, - void* context, - alt_isr_func handler); - -/* - * alt_irq_disable() disables the individual interrupt indicated by "id". - */ -static ALT_INLINE int ALT_ALWAYS_INLINE alt_irq_disable (alt_u32 id) -{ - alt_irq_context status; - extern volatile alt_u32 alt_irq_active; - - status = alt_irq_disable_all (); - - alt_irq_active &= ~(1 << id); - NIOS2_WRITE_IENABLE (alt_irq_active); - - alt_irq_enable_all(status); - - return 0; -} - -/* - * alt_irq_enable() enables the individual interrupt indicated by "id". - */ -static ALT_INLINE int ALT_ALWAYS_INLINE alt_irq_enable (alt_u32 id) -{ - alt_irq_context status; - extern volatile alt_u32 alt_irq_active; - - status = alt_irq_disable_all (); - - alt_irq_active |= (1 << id); - NIOS2_WRITE_IENABLE (alt_irq_active); - - alt_irq_enable_all(status); - - return 0; -} - -#ifndef ALT_EXCEPTION_STACK -/* - * alt_irq_initerruptable() should only be called from within an ISR. It is used - * to allow higer priority interrupts to interrupt the current ISR. The input - * argument, "priority", is the priority, i.e. interrupt number of the current - * interrupt. - * - * If this function is called, then the ISR is required to make a call to - * alt_irq_non_interruptible() before returning. The input argument to - * alt_irq_non_interruptible() is the return value from alt_irq_interruptible(). - * - * Care should be taken when using this pair of functions, since they increasing - * the system overhead associated with interrupt handling. - * - * If you are using an exception stack then nested interrupts won't work, so - * these functions are not available in that case. - */ -static ALT_INLINE alt_u32 ALT_ALWAYS_INLINE alt_irq_interruptible (alt_u32 priority) -{ - extern volatile alt_u32 alt_priority_mask; - extern volatile alt_u32 alt_irq_active; - - alt_u32 old_priority; - - old_priority = alt_priority_mask; - alt_priority_mask = (1 << priority) - 1; - - NIOS2_WRITE_IENABLE (alt_irq_active & alt_priority_mask); - - NIOS2_WRITE_STATUS (1); - - return old_priority; -} - -/* - * See Comments above for alt_irq_interruptible() for an explanation of the use of this - * function. - */ -static ALT_INLINE void ALT_ALWAYS_INLINE alt_irq_non_interruptible (alt_u32 mask) -{ - extern volatile alt_u32 alt_priority_mask; - extern volatile alt_u32 alt_irq_active; - - NIOS2_WRITE_STATUS (0); - - alt_priority_mask = mask; - - NIOS2_WRITE_IENABLE (mask & alt_irq_active); -} -#endif /* ALT_EXCEPTION_STACK */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* NIOS2_EIC_PRESENT */ - -#endif /* __ALT_LEGACY_IRQ_H__ */ diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/inc/priv/alt_no_error.h b/software/qsys_tutorial_lcd2_bsp/HAL/inc/priv/alt_no_error.h deleted file mode 100644 index 6143fc9..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/inc/priv/alt_no_error.h +++ /dev/null @@ -1,77 +0,0 @@ -#ifndef __ALT_NO_ERROR_H__ -#define __ALT_NO_ERROR_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "alt_types.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * alt_no_error() is a dummy function used by alt_sem.h and alt_flag.h. It - * substitutes for functions that have a return code by creating a function - * that always returns zero. - * - * This may seem a little obscure, but what happens is that the compiler can - * then optomise away the call to this function, and any code written which - * handles the error path (i.e. non zero return values). - * - * This allows code to be written which correctly use the uC/OS-II semaphore - * and flag utilities, without the use of those utilities impacting on - * excutables built for a single threaded HAL environment. - * - * This function is considered to be part of the internal implementation of - * the HAL, and should not be called directly by application code or device - * drivers. It is not guaranteed to be preserved in future versions of the - * HAL. - */ - -static ALT_INLINE int ALT_ALWAYS_INLINE alt_no_error (void) -{ - return 0; -} - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_NO_ERROR_H__ */ diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/inc/priv/nios2_gmon_data.h b/software/qsys_tutorial_lcd2_bsp/HAL/inc/priv/nios2_gmon_data.h deleted file mode 100644 index 3f43f12..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/inc/priv/nios2_gmon_data.h +++ /dev/null @@ -1,47 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ -#ifndef NIOS2_GMON_DATA_H -#define NIOS2_GMON_DATA_H - -#define GMON_DATA_SIG 0 -#define GMON_DATA_WORDS 1 -#define GMON_DATA_PROFILE_DATA 2 -#define GMON_DATA_PROFILE_LOWPC 3 -#define GMON_DATA_PROFILE_HIGHPC 4 -#define GMON_DATA_PROFILE_BUCKET 5 -#define GMON_DATA_PROFILE_RATE 6 -#define GMON_DATA_MCOUNT_START 7 -#define GMON_DATA_MCOUNT_LIMIT 8 - -#define GMON_DATA_SIZE 9 - -extern unsigned int alt_gmon_data[GMON_DATA_SIZE]; - -#endif diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_alarm.h b/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_alarm.h deleted file mode 100644 index 68a2f5d..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_alarm.h +++ /dev/null @@ -1,126 +0,0 @@ -#ifndef __ALT_ALARM_H__ -#define __ALT_ALARM_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "alt_llist.h" -#include "alt_types.h" - -#include "priv/alt_alarm.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * "alt_alarm" is a structure type used by applications to register an alarm - * callback function. An instance of this type must be passed as an input - * argument to alt_alarm_start(). The user is not responsible for initialising - * the contents of the instance. This is done by alt_alarm_start(). - */ - -typedef struct alt_alarm_s alt_alarm; - -/* - * alt_alarm_start() can be called by an application/driver in order to register - * a function for periodic callback at the system clock frequency. Be aware that - * this callback is likely to occur in interrupt context. - */ - -extern int alt_alarm_start (alt_alarm* the_alarm, - alt_u32 nticks, - alt_u32 (*callback) (void* context), - void* context); - -/* - * alt_alarm_stop() is used to unregister a callback. Alternatively the callback - * can return zero to unregister. - */ - -extern void alt_alarm_stop (alt_alarm* the_alarm); - -/* - * Obtain the system clock rate in ticks/s. - */ - -static ALT_INLINE alt_u32 ALT_ALWAYS_INLINE alt_ticks_per_second (void) -{ - return _alt_tick_rate; -} - -/* - * alt_sysclk_init() is intended to be only used by the system clock driver - * in order to initialise the value of the clock frequency. - */ - -static ALT_INLINE int ALT_ALWAYS_INLINE alt_sysclk_init (alt_u32 nticks) -{ - if (! _alt_tick_rate) - { - _alt_tick_rate = nticks; - return 0; - } - else - { - return -1; - } -} - -/* - * alt_nticks() returns the elapsed number of system clock ticks since reset. - */ - -static ALT_INLINE alt_u32 ALT_ALWAYS_INLINE alt_nticks (void) -{ - return _alt_nticks; -} - -/* - * alt_tick() should only be called by the system clock driver. This is used - * to notify the system that the system timer period has expired. - */ - -extern void alt_tick (void); - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_ALARM_H__ */ diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_cache.h b/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_cache.h deleted file mode 100644 index c4d8db9..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_cache.h +++ /dev/null @@ -1,117 +0,0 @@ -#ifndef __ALT_CACHE_H__ -#define __ALT_CACHE_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003, 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include - -#include "alt_types.h" - -/* - * alt_cache.h defines the processor specific functions for manipulating the - * cache. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * alt_icache_flush() is called to flush the instruction cache for a memory - * region of length "len" bytes, starting at address "start". - */ - -extern void alt_icache_flush (void* start, alt_u32 len); - -/* - * alt_dcache_flush() is called to flush the data cache for a memory - * region of length "len" bytes, starting at address "start". - * Any dirty lines in the data cache are written back to memory. - */ - -extern void alt_dcache_flush (void* start, alt_u32 len); - -/* - * alt_dcache_flush() is called to flush the data cache for a memory - * region of length "len" bytes, starting at address "start". - * Any dirty lines in the data cache are NOT written back to memory. - */ - -extern void alt_dcache_flush_no_writeback (void* start, alt_u32 len); - -/* - * Flush the entire instruction cache. - */ - -extern void alt_icache_flush_all (void); - -/* - * Flush the entire data cache. - */ - -extern void alt_dcache_flush_all (void); - -/* - * Allocate a block of uncached memory. - */ - -extern volatile void* alt_uncached_malloc (size_t size); - -/* - * Free a block of uncached memory. - */ - -extern void alt_uncached_free (volatile void* ptr); - -/* - * Convert a pointer to a block of cached memory, into a block of - * uncached memory. - */ - -extern volatile void* alt_remap_uncached (void* ptr, alt_u32 len); - -/* - * Convert a pointer to a block of uncached memory, into a block of - * cached memory. - */ - -extern void* alt_remap_cached (volatile void* ptr, alt_u32 len); - -/* - * - */ - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_CACHE_H__ */ diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_debug.h b/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_debug.h deleted file mode 100644 index d9f9599..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_debug.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef __ALT_DEBUG_H__ -#define __ALT_DEBUG_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * The ALT_DEVUG_ASSERT macro can be used to generate a debugger break - * from within software. The break is generated if "condition" evaluates to - * false. - */ - -#define ALT_DEBUG_ASSERT(condition) if (!condition) \ -{ \ - __asm__ volatile ("break"); \ -} - -#endif /* __ALT_DEBUG_H__ */ diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_dev.h b/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_dev.h deleted file mode 100644 index 66c5e41..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_dev.h +++ /dev/null @@ -1,115 +0,0 @@ -#ifndef __ALT_DEV_H__ -#define __ALT_DEV_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "system.h" -#include "sys/alt_llist.h" -#include "priv/alt_dev_llist.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The value ALT_IRQ_NOT_CONNECTED is used to represent an unconnected - * interrupt line. It cannot evaluate to a valid interrupt number. - */ - -#define ALT_IRQ_NOT_CONNECTED (-1) - -typedef struct alt_dev_s alt_dev; - -struct stat; - -/* - * The file descriptor structure definition. - */ - -typedef struct alt_fd_s -{ - alt_dev* dev; - alt_u8* priv; - int fd_flags; -} alt_fd; - -/* - * The device structure definition. - */ - -struct alt_dev_s { - alt_llist llist; /* for internal use */ - const char* name; - int (*open) (alt_fd* fd, const char* name, int flags, int mode); - int (*close) (alt_fd* fd); - int (*read) (alt_fd* fd, char* ptr, int len); - int (*write) (alt_fd* fd, const char* ptr, int len); - int (*lseek) (alt_fd* fd, int ptr, int dir); - int (*fstat) (alt_fd* fd, struct stat* buf); - int (*ioctl) (alt_fd* fd, int req, void* arg); -}; - -/* - * Functions used to register device for access through the C standard - * library. - * - * The only difference between alt_dev_reg() and alt_fs_reg() is the - * interpretation that open() places on the device name. In the case of - * alt_dev_reg the device is assumed to be a particular character device, - * and so there must be an exact match in the name for open to succeed. - * In the case of alt_fs_reg() the name of the device is treated as the - * mount point for a directory, and so any call to open() where the name - * is the root of the device filename will succeed. - */ - -extern int alt_fs_reg (alt_dev* dev); - -static ALT_INLINE int alt_dev_reg (alt_dev* dev) -{ - extern alt_llist alt_dev_list; - - return alt_dev_llist_insert ((alt_dev_llist*) dev, &alt_dev_list); -} - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_DEV_H__ */ diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_dma.h b/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_dma.h deleted file mode 100644 index 9f9b2ff..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_dma.h +++ /dev/null @@ -1,226 +0,0 @@ -#ifndef __ALT_DMA_H__ -#define __ALT_DMA_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "sys/alt_dma_dev.h" -#include "alt_types.h" - -#include - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * This header contains the application side interface for accessing DMA - * resources. See alt_dma_dev.h for the dma device driver interface. - * - * The interface model treats a DMA transaction as being composed of two - * halves (read and write). - * - * The application can supply data for transmit using an "alt_dma_txchan" - * descriptor. Alternatively an "alt_dma_rxchan" descriptor can be used to - * receive data. - */ - -/* - * alt_dma_txchan_open() is used to obtain an "alt_dma_txchan" descriptor for - * a DMA transmit device. The name is the name of the associated physical - * device (e.g. "/dev/dma_0"). - * - * The return value will be NULL on failure, and non-NULL otherwise. - */ - -extern alt_dma_txchan alt_dma_txchan_open (const char* name); - -/* - * alt_dma_txchan_close() is provided so that an application can notify the - * system that it has finished with a given DMA transmit channel. This is only - * provided for completness. - */ - -static ALT_INLINE int alt_dma_txchan_close (alt_dma_txchan dma) -{ - return 0; -} - -/* - * alt_dma_txchan_send() posts a transmit request to a DMA transmit channel. - * The input arguments are: - * - * dma: the channel to use. - * from: a pointer to the start of the data to send. - * length: the length of the data to send in bytes. - * done: callback function that will be called once the data has been sent. - * handle: opaque value passed to "done". - * - * The return value will be negative if the request cannot be posted, and - * zero otherwise. - */ - -static ALT_INLINE int alt_dma_txchan_send (alt_dma_txchan dma, - const void* from, - alt_u32 length, - alt_txchan_done* done, - void* handle) -{ - return dma ? dma->dma_send (dma, - from, - length, - done, - handle) : -ENODEV; -} - -/* - * alt_dma_txchan_space() returns the number of tranmit requests that can be - * posted to the specified DMA transmit channel. - * - * A negative value indicates that the value could not be determined. - */ - -static ALT_INLINE int alt_dma_txchan_space (alt_dma_txchan dma) -{ - return dma ? dma->space (dma) : -ENODEV; -} - -/* - * alt_dma_txchan_ioctl() can be used to perform device specific I/O - * operations on the indicated DMA transmit channel. For example some drivers - * support options to control the width of the transfer operations. See - * alt_dma_dev.h for the list of generic requests. - * - * A negative return value indicates failure, otherwise the interpretation - * of the return value is request specific. - */ - -static ALT_INLINE int alt_dma_txchan_ioctl (alt_dma_txchan dma, - int req, - void* arg) -{ - return dma ? dma->ioctl (dma, req, arg) : -ENODEV; -} - -/* - * alt_dma_rxchan_open() is used to obtain an "alt_dma_rxchan" descriptor for - * a DMA receive channel. The name is the name of the associated physical - * device (e.g. "/dev/dma_0"). - * - * The return value will be NULL on failure, and non-NULL otherwise. - */ - -extern alt_dma_rxchan alt_dma_rxchan_open (const char* dev); - -/* - * alt_dma_rxchan_close() is provided so that an application can notify the - * system that it has finished with a given DMA receive channel. This is only - * provided for completness. - */ - -static ALT_INLINE int alt_dma_rxchan_close (alt_dma_rxchan dma) -{ - return 0; -} - -/* - * - */ - -/* - * alt_dma_rxchan_prepare() posts a receive request to a DMA receive channel. - * - * The input arguments are: - * - * dma: the channel to use. - * data: a pointer to the location that data is to be received to. - * len: the maximum length of the data to receive. - * done: callback function that will be called once the data has been - * received. - * handle: opaque value passed to "done". - * - * The return value will be negative if the request cannot be posted, and - * zero otherwise. - */ - -static ALT_INLINE int alt_dma_rxchan_prepare (alt_dma_rxchan dma, - void* data, - alt_u32 len, - alt_rxchan_done* done, - void* handle) -{ - return dma ? dma->prepare (dma, data, len, done, handle) : -ENODEV; -} - -/* - * alt_dma_rxchan_ioctl() can be used to perform device specific I/O - * operations on the indicated DMA receive channel. For example some drivers - * support options to control the width of the transfer operations. See - * alt_dma_dev.h for the list of generic requests. - * - * A negative return value indicates failure, otherwise the interpretation - * of the return value is request specific. - */ - -static ALT_INLINE int alt_dma_rxchan_ioctl (alt_dma_rxchan dma, - int req, - void* arg) -{ - return dma ? dma->ioctl (dma, req, arg) : -ENODEV; -} - -/* - * alt_dma_rxchan_depth() returns the depth of the receive FIFO used to store - * receive requests. - */ - -static ALT_INLINE alt_u32 alt_dma_rxchan_depth(alt_dma_rxchan dma) -{ - return dma->depth; -} - -/* - * - */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_DMA_H__ */ diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_dma_dev.h b/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_dma_dev.h deleted file mode 100644 index 832463d..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_dma_dev.h +++ /dev/null @@ -1,200 +0,0 @@ -#ifndef __ALT_DMA_DEV_H__ -#define __ALT_DMA_DEV_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "priv/alt_dev_llist.h" - -#include "alt_types.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * This header contains the device driver interface for accessing DMA - * resources. See alt_dma.h for the DMA application side interface. - * - * The interface model treats a DMA transaction as being composed of two - * halves (read and write). - * - * An "alt_dma_txchan_dev" is used to describe the device associated with a - * DMA transmit channel. An "alt_dma_rxchan_dev" is used to describe the - * device associated with a DMA receive channel. - */ - -/* - * List of generic ioctl requests that may be supported by a DMA device. - * - * ALT_DMA_RX_ONLY_ON: This causes a DMA channel to operate in a mode - * where only the receiver is under software control. - * The other side reads continously from a single - * location. The address to read is the argument to - * this request. - * ALT_DMA_RX_ONLY_OFF: Return to the default mode where both the receive - * and transmit sides of the DMA can be under software - * control. - * ALT_DMA_TX_ONLY_ON: This causes a DMA channel to operate in a mode - * where only the transmitter is under software control. - * The other side writes continously to a single - * location. The address to write to is the argument to - * this request. - * ALT_DMA_TX_ONLY_OFF: Return to the default mode where both the receive - * and transmit sides of the DMA can be under software - * control. - * ALT_DMA_SET_MODE_8: Transfer data in units of 8 bits. - * ALT_DMA_SET_MODE_16: Transfer data in units of 16 bits. - * ALT_DMA_SET_MODE_32: Transfer data in units of 32 bits. - * ALT_DMA_SET_MODE_64: Transfer data in units of 64 bits. - * ALT_DMA_SET_MODE_128: Transfer data in units of 128 bits. - * ALT_DMA_GET_MODE: Get the current transfer mode. - * - * The use of the macros: ALT_DMA_TX_STREAM_ON, ALT_DMA_TX_STREAM_OFF - * ALT_DMA_RX_STREAM_OFF and ALT_DMA_RX_STREAM_ON are depreciated. You should - * instead use the macros: ALT_DMA_RX_ONLY_ON, ALT_DMA_RX_ONLY_OFF, - * ALT_DMA_TX_ONLY_ON and ALT_DMA_TX_ONLY_OFF. - */ - -#define ALT_DMA_TX_STREAM_ON (0x1) -#define ALT_DMA_TX_STREAM_OFF (0x2) -#define ALT_DMA_RX_STREAM_ON (0x3) -#define ALT_DMA_RX_STREAM_OFF (0x4) -#define ALT_DMA_SET_MODE_8 (0x5) -#define ALT_DMA_SET_MODE_16 (0x6) -#define ALT_DMA_SET_MODE_32 (0x7) -#define ALT_DMA_SET_MODE_64 (0x8) -#define ALT_DMA_SET_MODE_128 (0x9) -#define ALT_DMA_GET_MODE (0xa) - -#define ALT_DMA_RX_ONLY_ON ALT_DMA_TX_STREAM_ON -#define ALT_DMA_RX_ONLY_OFF ALT_DMA_TX_STREAM_OFF -#define ALT_DMA_TX_ONLY_ON ALT_DMA_RX_STREAM_ON -#define ALT_DMA_TX_ONLY_OFF ALT_DMA_RX_STREAM_OFF - -/* - * - */ - -typedef struct alt_dma_txchan_dev_s alt_dma_txchan_dev; -typedef struct alt_dma_rxchan_dev_s alt_dma_rxchan_dev; - -typedef alt_dma_txchan_dev* alt_dma_txchan; -typedef alt_dma_rxchan_dev* alt_dma_rxchan; - -typedef void (alt_txchan_done)(void* handle); -typedef void (alt_rxchan_done)(void* handle, void* data); - -/* - * devices that provide a DMA transmit channel are required to provide an - * instance of the "alt_dma_txchan_dev" structure. - */ - -struct alt_dma_txchan_dev_s { - alt_llist llist; /* for internal use */ - const char* name; /* name of the device instance - * (e.g. "/dev/dma_0"). - */ - int (*space) (alt_dma_txchan dma); /* returns the maximum number of - * transmit requests that can be posted - */ - int (*dma_send) (alt_dma_txchan dma, - const void* from, - alt_u32 len, - alt_txchan_done* done, - void* handle); /* post a transmit request */ - int (*ioctl) (alt_dma_txchan dma, int req, void* arg); /* perform device - * specific I/O control. - */ -}; - -/* - * devices that provide a DMA receive channel are required to provide an - * instance of the "alt_dma_rxchan_dev" structure. - */ - -struct alt_dma_rxchan_dev_s { - alt_llist list; /* for internal use */ - const char* name; /* name of the device instance - * (e.g. "/dev/dma_0"). - */ - alt_u32 depth; /* maximum number of receive requests that - * can be posted. - */ - int (*prepare) (alt_dma_rxchan dma, - void* data, - alt_u32 len, - alt_rxchan_done* done, - void* handle); /* post a receive request */ - int (*ioctl) (alt_dma_rxchan dma, int req, void* arg); /* perform device - * specific I/O control. - */ -}; - -/* - * Register a DMA transmit channel with the system. - */ - -static ALT_INLINE int alt_dma_txchan_reg (alt_dma_txchan_dev* dev) -{ - extern alt_llist alt_dma_txchan_list; - - return alt_dev_llist_insert((alt_dev_llist*) dev, &alt_dma_txchan_list); -} - -/* - * Register a DMA receive channel with the system. - */ - -static ALT_INLINE int alt_dma_rxchan_reg (alt_dma_rxchan_dev* dev) -{ - extern alt_llist alt_dma_rxchan_list; - - return alt_dev_llist_insert((alt_dev_llist*) dev, &alt_dma_rxchan_list); -} - -/* - * - */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_DMA_DEV_H__ */ diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_driver.h b/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_driver.h deleted file mode 100644 index eb0f23b..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_driver.h +++ /dev/null @@ -1,168 +0,0 @@ -#ifndef __ALT_DRIVER_H__ -#define __ALT_DRIVER_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/* - * Macros used to access a driver without HAL file descriptors. - */ - -/* - * ALT_MODULE_CLASS - * - * This macro returns the module class name for the specified module instance. - * It uses information in the system.h file. - * Neither the instance name or class name are quoted (so that they can - * be used with other pre-processor macros). - * - * Example: - * Assume the design has an instance of an altera_avalon_uart called uart1. - * Calling ALT_MODULE_CLASS(uart1) returns altera_avalon_uart. - */ - -#define ALT_MODULE_CLASS(instance) ALT_MODULE_CLASS_ ## instance - - -/* - * ALT_DRIVER_FUNC_NAME - * - * --> instance Instance name. - * --> func Function name. - * - * This macro returns the device driver function name of the specified - * module instance for the specified function name. - * - * Example: - * Assume the design has an instance of an altera_avalon_uart called uart1. - * Calling ALT_DRIVER_FUNC_NAME(uart1, write) returns - * altera_avalon_uart_write. - */ - -#define ALT_DRIVER_FUNC_NAME(instance, func) \ - ALT_DRIVER_FUNC_NAME1(ALT_MODULE_CLASS(instance), func) -#define ALT_DRIVER_FUNC_NAME1(module_class, func) \ - ALT_DRIVER_FUNC_NAME2(module_class, func) -#define ALT_DRIVER_FUNC_NAME2(module_class, func) \ - module_class ## _ ## func - -/* - * ALT_DRIVER_STATE_STRUCT - * - * --> instance Instance name. - * - * This macro returns the device driver state type name of the specified - * module instance. - * - * Example: - * Assume the design has an instance of an altera_avalon_uart called uart1. - * Calling ALT_DRIVER_STATE_STRUCT(uart1) returns: - * struct altera_avalon_uart_state_s - * - * Note that the ALT_DRIVER_FUNC_NAME macro is used even though "state" isn't - * really a function but it does match the required naming convention. - */ -#define ALT_DRIVER_STATE_STRUCT(instance) \ - struct ALT_DRIVER_FUNC_NAME(instance, state_s) - -/* - * ALT_DRIVER_STATE - * - * --> instance Instance name. - * - * This macro returns the device driver state name of the specified - * module instance. - * - * Example: - * Assume the design has an instance of an altera_avalon_uart called uart1. - * Calling ALT_DRIVER_STATE(uart1) returns uart1. - */ -#define ALT_DRIVER_STATE(instance) instance - -/* - * ALT_DRIVER_WRITE - * - * --> instance Instance name. - * --> buffer Write buffer. - * --> len Length of write buffer data. - * --> flags Control flags (e.g. O_NONBLOCK) - * - * This macro calls the "write" function of the specified driver instance. - */ - -#define ALT_DRIVER_WRITE_EXTERNS(instance) \ - extern ALT_DRIVER_STATE_STRUCT(instance) ALT_DRIVER_STATE(instance); \ - extern int ALT_DRIVER_FUNC_NAME(instance, write) \ - (ALT_DRIVER_STATE_STRUCT(instance) *, const char *, int, int); - -#define ALT_DRIVER_WRITE(instance, buffer, len, flags) \ - ALT_DRIVER_FUNC_NAME(instance, write)(&ALT_DRIVER_STATE(instance), buffer, len, flags) - - -/* - * ALT_DRIVER_READ - * - * --> instance Instance name. - * <-- buffer Read buffer. - * --> len Length of read buffer. - * --> flags Control flags (e.g. O_NONBLOCK) - * - * This macro calls the "read" function of the specified driver instance. - */ - -#define ALT_DRIVER_READ_EXTERNS(instance) \ - extern ALT_DRIVER_STATE_STRUCT(instance) ALT_DRIVER_STATE(instance); \ - extern int ALT_DRIVER_FUNC_NAME(instance, read) \ - (ALT_DRIVER_STATE_STRUCT(instance) *, const char *, int, int); - -#define ALT_DRIVER_READ(instance, buffer, len, flags) \ - ALT_DRIVER_FUNC_NAME(instance, read)(&ALT_DRIVER_STATE(instance), buffer, len, flags) - -/* - * ALT_DRIVER_IOCTL - * - * --> instance Instance name. - * --> req ioctl request (e.g. TIOCSTIMEOUT) - * --> arg Optional argument (void*) - * - * This macro calls the "ioctl" function of the specified driver instance - */ - -#define ALT_DRIVER_IOCTL_EXTERNS(instance) \ - extern ALT_DRIVER_STATE_STRUCT(instance) ALT_DRIVER_STATE(instance); \ - extern int ALT_DRIVER_FUNC_NAME(instance, ioctl) \ - (ALT_DRIVER_STATE_STRUCT(instance) *, int, void*); - -#define ALT_DRIVER_IOCTL(instance, req, arg) \ - ALT_DRIVER_FUNC_NAME(instance, ioctl)(&ALT_DRIVER_STATE(instance), req, arg) - -#endif /* __ALT_DRIVER_H__ */ diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_errno.h b/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_errno.h deleted file mode 100644 index 4d3e50f..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_errno.h +++ /dev/null @@ -1,87 +0,0 @@ -#ifndef __ALT_ERRNO_H__ -#define __ALT_ERRNO_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * errno is defined in so that it uses the thread local version - * stored in the location pointed to by "_impure_ptr". This means that the - * accesses to errno within the HAL library can cause the entirety of - * of the structure pointed to by "_impure_ptr" to be added to the - * users application. This can be undesirable in very small footprint systems. - * - * To avoid this happening, the HAL uses the macro ALT_ERRNO, defined below, - * to access errno, rather than accessing it directly. This macro will only - * use the thread local version if some other code has already caused it to be - * included into the system, otherwise it will use the global errno value. - * - * This causes a slight increases in code size where errno is accessed, but - * can lead to significant overall benefits in very small systems. The - * increase is inconsequential when compared to the size of the structure - * pointed to by _impure_ptr. - * - * Note that this macro accesses __errno() using an externally declared - * function pointer (alt_errno). This is done so that the function call uses the - * subroutine call instruction via a register rather than an immediate address. - * This is important in the case that the code has been linked for a high - * address, but __errno() is not being used. In this case the weak linkage - * would have resulted in the instruction: "call 0" which would fail to link. - */ - -extern int* (*alt_errno) (void); - -/* Must define this so that values such as EBADFD are defined in errno.h. */ -#define __LINUX_ERRNO_EXTENSIONS__ - -#include - -#include "alt_types.h" - -#undef errno - -extern int errno; - -static ALT_INLINE int* alt_get_errno(void) -{ - return ((alt_errno) ? alt_errno() : &errno); -} - -#define ALT_ERRNO *alt_get_errno() - -#endif /* __ALT_ERRNO_H__ */ diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_exceptions.h b/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_exceptions.h deleted file mode 100644 index 3576a52..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_exceptions.h +++ /dev/null @@ -1,127 +0,0 @@ -#ifndef __ALT_EXCEPTIONS_H__ -#define __ALT_EXCEPTIONS_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2008 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ -#include "alt_types.h" -#include "system.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * This file defines instruction-generated exception handling and registry - * API, exception type enumeration, and handler return value enumeration for - * Nios II. - */ - -/* - * The following enumeration describes the value in the CPU EXCEPTION - * register CAUSE bit field. Not all exception types will cause the - * processor to go to the exception vector; these are provided for - * reference. - */ -enum alt_exception_cause_e { - /* Exeption causes that will cause jump to exception vector */ - NIOS2_EXCEPTION_INTERRUPT = 2, - NIOS2_EXCEPTION_TRAP_INST = 3, - NIOS2_EXCEPTION_UNIMPLEMENTED_INST = 4, - NIOS2_EXCEPTION_ILLEGAL_INST = 5, - NIOS2_EXCEPTION_MISALIGNED_DATA_ADDR = 6, - NIOS2_EXCEPTION_MISALIGNED_TARGET_PC = 7, - NIOS2_EXCEPTION_DIVISION_ERROR = 8, - NIOS2_EXCEPTION_SUPERVISOR_ONLY_INST_ADDR = 9, - NIOS2_EXCEPTION_SUPERVISOR_ONLY_INST = 10, - NIOS2_EXCEPTION_SUPERVISOR_ONLY_DATA_ADDR = 11, - NIOS2_EXCEPTION_TLB_MISS = 12, - NIOS2_EXCEPTION_TLB_EXECUTE_PERM_VIOLATION = 13, - NIOS2_EXCEPTION_MPU_INST_REGION_VIOLATION = 16, - - /* Exception causes that will NOT cause a jump to exception vector */ - NIOS2_EXCEPTION_RESET = 0, - NIOS2_EXCEPTION_CPU_ONLY_RESET_REQUEST = 1, - NIOS2_EXCEPTION_TLB_READ_PERM_VIOLATION = 14, - NIOS2_EXCEPTION_TLB_WRITE_PERM_VIOLATION = 15, - NIOS2_EXCEPTION_MPU_DATA_REGION_VIOLATION = 17, - /* - * This value is passed to an exception handler's cause argument if - * "extra exceptions" information (EXECPTION) register is not - * present in the processor hardware configuration. - */ - NIOS2_EXCEPTION_CAUSE_NOT_PRESENT = -1 -}; -typedef enum alt_exception_cause_e alt_exception_cause; - -/* - * These define valid return values for a user-defined instruction-generated - * exception handler. The handler should return one of these to indicate - * whether to re-issue the instruction that triggered the exception, or to - * skip it. - */ -enum alt_exception_result_e { - NIOS2_EXCEPTION_RETURN_REISSUE_INST = 0, - NIOS2_EXCEPTION_RETURN_SKIP_INST = 1 -}; -typedef enum alt_exception_result_e alt_exception_result; - -/* - * alt_instruction_exception_register() can be used to register an exception - * handler for instruction-generated exceptions that are not handled by the - * built-in exception handler (i.e. for interrupts). - * - * The registry API is optionally enabled through the "Enable - * Instruction-related Exception API" HAL BSP setting, which will - * define the macro below. - */ -#ifdef ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API -void alt_instruction_exception_register ( - alt_exception_result (*exception_handler)( - alt_exception_cause cause, - alt_u32 exception_pc, - alt_u32 bad_addr) ); -#endif /*ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API */ - -/* - * alt_exception_cause_generated_bad_addr() indicates whether a particular - * exception cause value was from an exception-type that generated a valid - * address in the BADADDR register. The contents of BADADDR is passed to - * a user-registered exception handler in all cases, whether valid or not. - * This routine should be called to validate the bad_addr argument to - * your exception handler. - */ -int alt_exception_cause_generated_bad_addr(alt_exception_cause cause); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_EXCEPTIONS_H__ */ diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_flash.h b/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_flash.h deleted file mode 100644 index 527328d..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_flash.h +++ /dev/null @@ -1,166 +0,0 @@ -#ifndef __ALT_FLASH_H__ -#define __ALT_FLASH_H__ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/****************************************************************************** -* * -* Alt_flash.h - User interface for flash code * -* * -* Use this interface to avoid being exposed to the internals of the device * -* driver architecture. If you chose to use the flash driver internal * -* structures we don't guarantee not to change them * -* * -* Author PRR * -* * -******************************************************************************/ - - - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#include "alt_types.h" -#include "alt_flash_types.h" -#include "alt_flash_dev.h" -#include "sys/alt_cache.h" - -alt_flash_fd* alt_flash_open_dev(const char* name); -void alt_flash_close_dev(alt_flash_fd* fd ); - -/* - * alt_write_flash - * - * Program a buffer into flash. - * - * This routine erases all the affected erase blocks (if necessary) - * and then programs the data. However it does not read the data out first - * and preserve and none overwritten data, because this would require very - * large buffers on the target. If you need - * that functionality use the functions below. - */ -static __inline__ int __attribute__ ((always_inline)) alt_write_flash( - alt_flash_fd* fd, - int offset, - const void* src_addr, - int length ) -{ - return fd->write( fd, offset, src_addr, length ); -} - -/* - * alt_read_flash - * - * Read a block of flash for most flashes this is just memcpy - * it's here for completeness in case we need it for some serial flash device - * - */ -static __inline__ int __attribute__ ((always_inline)) alt_read_flash( - alt_flash_fd* fd, int offset, - void* dest_addr, int length ) -{ - return fd->read( fd, offset, dest_addr, length ); -} - -/* - * alt_get_flash_info - * - * Return the information on the flash sectors. - * - */ -static __inline__ int __attribute__ ((always_inline)) alt_get_flash_info( - alt_flash_fd* fd, flash_region** info, - int* number_of_regions) -{ - return fd->get_info( fd, info, number_of_regions); -} - -/* - * alt_erase_flash_block - * - * Erase a particular erase block, pass in the offset to the start of - * the block and it's size - */ -static __inline__ int __attribute__ ((always_inline)) alt_erase_flash_block( - alt_flash_fd* fd, int offset, int length) -{ - int ret_code; - ret_code = fd->erase_block( fd, offset ); - - if(!ret_code) - alt_dcache_flush((alt_u8*)fd->base_addr + offset, length); - - return ret_code; -} - -/* - * alt_write_flash_block - * - * Write a particular flash block, block_offset is the offset - * (from the base of flash) to start of the block - * data_offset is the offset (from the base of flash) - * where you wish to start programming - * - * NB this function DOES NOT check that you are only writing a single - * block of data as that would slow down this function. - * - * Use alt_write_flash if you want that level of error checking. - */ - -static __inline__ int __attribute__ ((always_inline)) alt_write_flash_block( - alt_flash_fd* fd, int block_offset, - int data_offset, - const void *data, int length) -{ - - int ret_code; - ret_code = fd->write_block( fd, block_offset, data_offset, data, length ); - - if(!ret_code) - alt_dcache_flush((alt_u8*)fd->base_addr + data_offset, length); - - return ret_code; -} - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_FLASH_H__ */ diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_flash_dev.h b/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_flash_dev.h deleted file mode 100644 index 8bab601..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_flash_dev.h +++ /dev/null @@ -1,98 +0,0 @@ -#ifndef __ALT_FLASH_DEV_H__ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/****************************************************************************** -* * -* Alt_flash_dev.h - Generic Flash device interfaces * -* * -* Author PRR * -* * -******************************************************************************/ -#define __ALT_FLASH_DEV_H__ - -#include "alt_flash_types.h" -#include "sys/alt_llist.h" -#include "priv/alt_dev_llist.h" - -#include "alt_types.h" - -typedef struct alt_flash_dev alt_flash_dev; -typedef alt_flash_dev alt_flash_fd; - -static ALT_INLINE int alt_flash_device_register( alt_flash_fd* fd) -{ - extern alt_llist alt_flash_dev_list; - - return alt_dev_llist_insert ((alt_dev_llist*) fd, &alt_flash_dev_list); -} - -typedef alt_flash_dev* (*alt_flash_open)(alt_flash_dev* flash, - const char* name ); -typedef int (*alt_flash_close)(alt_flash_dev* flash_info); - -typedef int (*alt_flash_write)( alt_flash_dev* flash, int offset, - const void* src_addr, int length ); - -typedef int (*alt_flash_get_flash_info)( alt_flash_dev* flash, flash_region** info, - int* number_of_regions); -typedef int (*alt_flash_write_block)( alt_flash_dev* flash, int block_offset, - int data_offset, const void* data, - int length); -typedef int (*alt_flash_erase_block)( alt_flash_dev* flash, int offset); -typedef int (*alt_flash_read)(alt_flash_dev* flash, int offset, - void* dest_addr, int length ); - -struct alt_flash_dev -{ - alt_llist llist; - const char* name; - alt_flash_open open; - alt_flash_close close; - alt_flash_write write; - alt_flash_read read; - alt_flash_get_flash_info get_info; - alt_flash_erase_block erase_block; - alt_flash_write_block write_block; - void* base_addr; - int length; - int number_of_regions; - flash_region region_info[ALT_MAX_NUMBER_OF_FLASH_REGIONS]; -}; - -#endif /* __ALT_FLASH_DEV_H__ */ diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_flash_types.h b/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_flash_types.h deleted file mode 100644 index 884cbf8..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_flash_types.h +++ /dev/null @@ -1,64 +0,0 @@ -#ifndef __ALT_FLASH_TYPES_H__ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/****************************************************************************** -* * -* Alt_flash_types.h - Some generic types and defines used by the flash code * -* * -* Author PRR * -* * -******************************************************************************/ -#define __ALT_FLASH_TYPES_H__ - -#ifndef ALT_MAX_NUMBER_OF_FLASH_REGIONS -#define ALT_MAX_NUMBER_OF_FLASH_REGIONS 8 -#endif /* ALT_MAX_NUMBER_OF_FLASH_REGIONS */ - -/* - * Description of a single Erase region - */ -typedef struct flash_region -{ - int offset; - int region_size; - int number_of_blocks; - int block_size; -}flash_region; - -#endif /* __ALT_FLASH_TYPES_H__ */ diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_irq.h b/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_irq.h deleted file mode 100644 index 6666e52..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_irq.h +++ /dev/null @@ -1,245 +0,0 @@ -#ifndef __ALT_IRQ_H__ -#define __ALT_IRQ_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * alt_irq.h is the Nios II specific implementation of the interrupt controller - * interface. - * - * Nios II includes optional support for an external interrupt controller. - * When an external controller is present, the "Enhanced" interrupt API - * must be used to manage individual interrupts. The enhanced API also - * supports the processor's internal interrupt controller. Certain API - * members are accessible from either the "legacy" or "enhanced" interrpt - * API. - * - * Regardless of which API is in use, this file should be included by - * application code and device drivers that register ISRs or manage interrpts. - */ -#include - -#include "nios2.h" -#include "alt_types.h" -#include "system.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * Macros used by alt_irq_enabled - */ -#define ALT_IRQ_ENABLED 1 -#define ALT_IRQ_DISABLED 0 - -/* - * Number of available interrupts in internal interrupt controller. - */ -#define ALT_NIRQ NIOS2_NIRQ - -/* - * Used by alt_irq_disable_all() and alt_irq_enable_all(). - */ -typedef int alt_irq_context; - -/* ISR Prototype */ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT -typedef void (*alt_isr_func)(void* isr_context); -#else -typedef void (*alt_isr_func)(void* isr_context, alt_u32 id); -#endif - -/* - * The following protypes and routines are supported by both - * the enhanced and legacy interrupt APIs - */ - -/* - * alt_irq_enabled can be called to determine if the processor's global - * interrupt enable is asserted. The return value is zero if interrupts - * are disabled, and non-zero otherwise. - * - * Whether the internal or external interrupt controller is present, - * individual interrupts may still be disabled. Use the other API to query - * a specific interrupt. - */ -static ALT_INLINE int ALT_ALWAYS_INLINE alt_irq_enabled (void) -{ - int status; - - NIOS2_READ_STATUS (status); - - return status & NIOS2_STATUS_PIE_MSK; -} - -/* - * alt_irq_disable_all() - * - * This routine inhibits all interrupts by negating the status register PIE - * bit. It returns the previous contents of the CPU status register (IRQ - * context) which can be used to restore the status register PIE bit to its - * state before this routine was called. - */ -static ALT_INLINE alt_irq_context ALT_ALWAYS_INLINE - alt_irq_disable_all (void) -{ - alt_irq_context context; - - NIOS2_READ_STATUS (context); - - NIOS2_WRITE_STATUS (context & ~NIOS2_STATUS_PIE_MSK); - - return context; -} - -/* - * alt_irq_enable_all() - * - * Enable all interrupts that were previously disabled by alt_irq_disable_all() - * - * This routine accepts a context to restore the CPU status register PIE bit - * to the state prior to a call to alt_irq_disable_all(). - - * In the case of nested calls to alt_irq_disable_all()/alt_irq_enable_all(), - * this means that alt_irq_enable_all() does not necessarily re-enable - * interrupts. - * - * This routine will perform a read-modify-write sequence to restore only - * status.PIE if the processor is configured with options that add additional - * writeable status register bits. These include the MMU, MPU, the enhanced - * interrupt controller port, and shadow registers. Otherwise, as a performance - * enhancement, status is overwritten with the prior context. - */ -static ALT_INLINE void ALT_ALWAYS_INLINE - alt_irq_enable_all (alt_irq_context context) -{ -#if (NIOS2_NUM_OF_SHADOW_REG_SETS > 0) || (defined NIOS2_EIC_PRESENT) || \ - (defined NIOS2_MMU_PRESENT) || (defined NIOS2_MPU_PRESENT) - alt_irq_context status; - - NIOS2_READ_STATUS (status); - - status &= ~NIOS2_STATUS_PIE_MSK; - status |= (context & NIOS2_STATUS_PIE_MSK); - - NIOS2_WRITE_STATUS (status); -#else - NIOS2_WRITE_STATUS (context); -#endif -} - -/* - * The function alt_irq_init() is defined within the auto-generated file - * alt_sys_init.c. This function calls the initilization macros for all - * interrupt controllers in the system at config time, before any other - * non-interrupt controller driver is initialized. - * - * The "base" parameter is ignored and only present for backwards-compatibility. - * It is recommended that NULL is passed in for the "base" parameter. - */ -extern void alt_irq_init (const void* base); - -/* - * alt_irq_cpu_enable_interrupts() enables the CPU to start taking interrupts. - */ -static ALT_INLINE void ALT_ALWAYS_INLINE - alt_irq_cpu_enable_interrupts () -{ - NIOS2_WRITE_STATUS(NIOS2_STATUS_PIE_MSK -#if defined(NIOS2_EIC_PRESENT) && (NIOS2_NUM_OF_SHADOW_REG_SETS > 0) - | NIOS2_STATUS_RSIE_MSK -#endif - ); -} - - -/* - * Prototypes for the enhanced interrupt API. - */ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT -/* - * alt_ic_isr_register() can be used to register an interrupt handler. If the - * function is succesful, then the requested interrupt will be enabled upon - * return. - */ -extern int alt_ic_isr_register(alt_u32 ic_id, - alt_u32 irq, - alt_isr_func isr, - void *isr_context, - void *flags); - -/* - * alt_ic_irq_enable() and alt_ic_irq_disable() enable/disable a specific - * interrupt by using IRQ port and interrupt controller instance. - */ -int alt_ic_irq_enable (alt_u32 ic_id, alt_u32 irq); -int alt_ic_irq_disable(alt_u32 ic_id, alt_u32 irq); - - /* - * alt_ic_irq_enabled() indicates whether a specific interrupt, as - * specified by IRQ port and interrupt controller instance is enabled. - */ -alt_u32 alt_ic_irq_enabled(alt_u32 ic_id, alt_u32 irq); - -#else -/* - * Prototypes for the legacy interrupt API. - */ -#include "priv/alt_legacy_irq.h" -#endif - - -/* - * alt_irq_pending() returns a bit list of the current pending interrupts. - * This is used by alt_irq_handler() to determine which registered interrupt - * handlers should be called. - * - * This routine is only available for the Nios II internal interrupt - * controller. - */ -#ifndef NIOS2_EIC_PRESENT -static ALT_INLINE alt_u32 ALT_ALWAYS_INLINE alt_irq_pending (void) -{ - alt_u32 active; - - NIOS2_READ_IPENDING (active); - - return active; -} -#endif - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_IRQ_H__ */ diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_irq_entry.h b/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_irq_entry.h deleted file mode 100644 index e2008d9..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_irq_entry.h +++ /dev/null @@ -1,39 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * This file pulls in the IRQ entry assembler and C code, which is only - * required if there are any interruptes in the system. - */ - -__asm__( "\n\t.globl alt_irq_entry" ); - -__asm__( "\n\t.globl alt_irq_handler" ); - diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_license_reminder_ucosii.h b/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_license_reminder_ucosii.h deleted file mode 100644 index 2fe649c..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_license_reminder_ucosii.h +++ /dev/null @@ -1,77 +0,0 @@ -#ifndef __ALT_LICENSE_REMINDER_UCOSII_H__ -#define __ALT_LICENSE_REMINDER_UCOSII_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include - -#define ALT_LICENSE_REMINDER_UCOSII_STRING \ - "============== Software License Reminder ===============\n" \ - "\n" \ - "uC/OS-II is provided in source form for FREE evaluation,\n" \ - "for educational use, or for peaceful research. If you\n" \ - "plan on using uC/OS-II in a commercial product you need\n" \ - "to contact Micrium to properly license its use in your\n" \ - "product. Micrium provides ALL the source code on the\n" \ - "Altera distribution for your convenience and to help you\n" \ - "experience uC/OS-II. The fact that the source is provided\n" \ - "does NOT mean that you can use it without paying a\n" \ - "licensing fee. Please help us continue to provide the\n" \ - "Embedded community with the finest software available.\n" \ - "Your honesty is greatly appreciated.\n" \ - "\n" \ - "Please contact:\n" \ - "\n" \ - "M I C R I U M\n" \ - "949 Crestview Circle\n" \ - "Weston, FL 33327-1848\n" \ - "U.S.A.\n" \ - "\n" \ - "Phone : +1 954 217 2036\n" \ - "FAX : +1 954 217 2037\n" \ - "WEB : www.micrium.com\n" \ - "E-mail: Sales@Micrium.com\n" \ - "\n" \ - "========================================================\n" - -#define alt_license_reminder_ucosii() puts(ALT_LICENSE_REMINDER_UCOSII_STRING) - - -#endif /* __ALT_LICENSE_REMINDER_UCOSII_H__ */ - diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_llist.h b/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_llist.h deleted file mode 100644 index 46f81ce..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_llist.h +++ /dev/null @@ -1,123 +0,0 @@ -#ifndef __ALT_LIST_H__ -#define __ALT_LIST_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "alt_types.h" - -/* - * alt_llist.h defines structures and functions for use in manipulating linked - * lists. A list is considered to be constructed from a chain of objects of - * type alt_llist, with one object being defined to be the head element. - * - * A list is considered to be empty if it only contains the head element. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * alt_llist is the structure used to represent an element within a linked - * list. - */ - -typedef struct alt_llist_s alt_llist; - -struct alt_llist_s { - alt_llist* next; /* Pointer to the next element in the list. */ - alt_llist* previous; /* Pointer to the previous element in the list. */ -}; - -/* - * ALT_LLIST_HEAD is a macro that can be used to create the head of a new - * linked list. This is named "head". The head element is initialised to - * represent an empty list. - */ - -#define ALT_LLIST_HEAD(head) alt_llist head = {&head, &head} - -/* - * ALT_LLIST_ENTRY is a macro used to define an uninitialised linked list - * entry. This is used to reserve space in structure initialisation for - * structures that inherit form alt_llist. - */ - -#define ALT_LLIST_ENTRY {0, 0} - -/* - * alt_llist_insert() insert adds the linked list entry "entry" as the - * first entry in the linked list "list". "list" is the list head element. - */ - -static ALT_INLINE void ALT_ALWAYS_INLINE alt_llist_insert(alt_llist* list, - alt_llist* entry) -{ - entry->previous = list; - entry->next = list->next; - - list->next->previous = entry; - list->next = entry; -} - -/* - * alt_llist_remove() is called to remove an element from a linked list. The - * input argument is the element to remove. - */ - -static ALT_INLINE void ALT_ALWAYS_INLINE alt_llist_remove(alt_llist* entry) -{ - entry->next->previous = entry->previous; - entry->previous->next = entry->next; - - /* - * Set the entry to point to itself, so that any further calls to - * alt_llist_remove() are harmless. - */ - - entry->previous = entry; - entry->next = entry; -} - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_LLIST_H__ */ diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_load.h b/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_load.h deleted file mode 100644 index 432e9f2..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_load.h +++ /dev/null @@ -1,78 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "alt_types.h" - -/* - * This macro is used to load code/data from its load address to its - * execution address for a given section. The section name is the input - * argument. Note that a leading '.' is assumed in the name. For example - * to load the section .onchip_ram, use: - * - * ALT_LOAD_SECTION_BY_NAME(onchip_ram); - * - * This requires that the apropriate linker symbols have been generated - * for the section in question. This will be the case if you are using the - * default linker script. - */ - -#define ALT_LOAD_SECTION_BY_NAME(name) \ - { \ - extern void _alt_partition_##name##_start; \ - extern void _alt_partition_##name##_end; \ - extern void _alt_partition_##name##_load_addr; \ - \ - alt_load_section(&_alt_partition_##name##_load_addr, \ - &_alt_partition_##name##_start, \ - &_alt_partition_##name##_end); \ - } - -/* - * Function used to load an individual section from flash to RAM. - * - * There is an implicit assumption here that the linker script will ensure - * that all sections are word aligned. - * - */ - -static void ALT_INLINE alt_load_section (alt_u32* from, - alt_u32* to, - alt_u32* end) -{ - if (to != from) - { - while( to != end ) - { - *to++ = *from++; - } - } -} diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_log_printf.h b/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_log_printf.h deleted file mode 100644 index c15ca05..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_log_printf.h +++ /dev/null @@ -1,349 +0,0 @@ -/* alt_log_printf.h - * - * ALT_LOG is designed to provide extra logging/debugging messages from HAL - * through a different port than stdout. It is enabled by the ALT_LOG_ENABLE - * define, which needs to supplied at compile time. When logging is turned off, - * code size is unaffected. Thus, this should be transparent to the user - * when it is not actively turned on, and should not affect projects in any way. - * - * There are macros sprinkled within different components, such as the jtag uart - * and timer, in the HAL code. They are always named ALT_LOG_, and can be - * safely ignored if ALT_LOG is turned off. - * - * To turn on ALT_LOG, ALT_LOG_ENABLE must be defined, and ALT_LOG_PORT_TYPE and - * ALT_LOG_PORT_BASE must be set in system.h. This is done through editing - * .ptf, by editing the alt_log_port_type & alt_log_port_base settings. - * See the documentation html file for examples. - * - * When it is turned on, it will output extra HAL messages to a port specified - * in system.h. This can be a UART or JTAG UART port. By default it will - * output boot messages, detailing every step of the boot process. - * - * Extra logging is designed to be enabled by flags, which are defined in - * alt_log_printf.c. The default value is that all flags are off, so only the - * boot up logging messages show up. ALT_LOG_FLAGS can be set to enable certain - * groupings of flags, and that grouping is done in this file. Each flag can - * also be overridden with a -D at compile time. - * - * This header file includes the necessary prototypes for using the alt_log - * functions. It also contains all the macros that are used to remove the code - * from alt log is turned off. Also, the macros in other HAL files are defined - * here at the bottom. These macros all call some C function that is in - * alt_log_printf.c. - * - * The logging has functions for printing in C (ALT_LOG_PRINTF) and in assembly - * (ALT_LOG_PUTS). This was needed because the assembly printing occurs before - * the device is initialized. The assembly function corrupts register R4-R7, - * which are not used in the normal boot process. For this reason, do not call - * the assembly function in C. - * - * author: gkwan - */ - - -#ifndef __ALT_LOG_PRINTF_H__ -#define __ALT_LOG_PRINTF_H__ - -#include - -/* Global switch to turn on logging functions */ -#ifdef ALT_LOG_ENABLE - - /* ALT_LOG_PORT_TYPE values as defined in system.h. They are defined as - * numbers here first becasue the C preprocessor does not handle string - * comparisons. */ - #define ALTERA_AVALON_JTAG_UART 1 - #define ALTERA_AVALON_UART 0 - - /* If this .h file is included by an assembly file, skip over include files - * that won't compile in assembly. */ - #ifndef ALT_ASM_SRC - #include - #include "sys/alt_alarm.h" - #include "sys/alt_dev.h" - #ifdef __ALTERA_AVALON_JTAG_UART - #include "altera_avalon_jtag_uart.h" - #endif - #endif /* ALT_ASM_SRC */ - - /* These are included for the port register offsets and masks, needed - * to write to the port. Only include if the port type is set correctly, - * otherwise error. If alt_log is turned on and the port to output to is - * incorrect or does not exist, then should exit. */ - #if ALT_LOG_PORT_TYPE == ALTERA_AVALON_JTAG_UART - #ifdef __ALTERA_AVALON_JTAG_UART - #include - #else - #error ALT_LOG: JTAG_UART port chosen, but no JTAG_UART in system. - #endif - #elif ALT_LOG_PORT_TYPE == ALTERA_AVALON_UART - #ifdef __ALTERA_AVALON_UART - #include - #else - #error ALT_LOG: UART Port chosen, but no UART in system. - #endif - #else - #error ALT_LOG: alt_log_port_type declaration invalid! - #endif - - /* ALT_LOG_ENABLE turns on the basic printing function */ - #define ALT_LOG_PRINTF(...) do {alt_log_printf_proc(__VA_ARGS__);} while (0) - - /* Assembly macro for printing in assembly, calls tx_log_str - * which is in alt_log_macro.S. - * If alt_log_boot_on_flag is 0, skips the printing */ - #define ALT_LOG_PUTS(str) movhi r4, %hiadj(alt_log_boot_on_flag) ; \ - addi r4, r4, %lo(alt_log_boot_on_flag) ; \ - ldwio r5, 0(r4) ; \ - beq r0, r5, 0f ; \ - movhi r4, %hiadj(str) ; \ - addi r4, r4, %lo(str) ; \ - call tx_log_str ; \ - 0: - - /* These defines are here to faciliate the use of one output function - * (alt_log_txchar) to print to both the JTAG UART or the UART. Depending - * on the port type, the status register, read mask, and output register - * are set to the appropriate value for the port. */ - #if ALT_LOG_PORT_TYPE == ALTERA_AVALON_JTAG_UART - #define ALT_LOG_PRINT_REG_RD IORD_ALTERA_AVALON_JTAG_UART_CONTROL - #define ALT_LOG_PRINT_MSK ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_MSK - #define ALT_LOG_PRINT_TXDATA_WR IOWR_ALTERA_AVALON_JTAG_UART_DATA - #define ALT_LOG_PRINT_REG_OFFSET (ALTERA_AVALON_JTAG_UART_CONTROL_REG*0x4) - #define ALT_LOG_PRINT_TXDATA_REG_OFFSET (ALTERA_AVALON_JTAG_UART_DATA_REG*0x4) - #elif ALT_LOG_PORT_TYPE == ALTERA_AVALON_UART - #define ALT_LOG_PRINT_REG_RD IORD_ALTERA_AVALON_UART_STATUS - #define ALT_LOG_PRINT_MSK ALTERA_AVALON_UART_STATUS_TRDY_MSK - #define ALT_LOG_PRINT_TXDATA_WR IOWR_ALTERA_AVALON_UART_TXDATA - #define ALT_LOG_PRINT_REG_OFFSET (ALTERA_AVALON_UART_STATUS_REG*0x4) - #define ALT_LOG_PRINT_TXDATA_REG_OFFSET (ALTERA_AVALON_UART_TXDATA_REG*0x4) - #endif /* ALT_LOG_PORT */ - - /* Grouping of flags via ALT_LOG_FLAGS. Each specific flag can be set via - * -D at compile time, or else they'll be set to a default value according - * to ALT_LOG_FLAGS. ALT_LOG_FLAGS = 0 or not set is the default, where - * only the boot messages will be printed. As ALT_LOG_FLAGS increase, they - * increase in intrusiveness to the program, and will affect performance. - * - * Flag Level 1 - turns on system clock and JTAG UART startup status - * 2 - turns on write echo and JTAG_UART alarm (periodic report) - * 3 - turns on JTAG UART ISR logging - will slow performance - * significantly. - * -1 - All logging output is off, but if ALT_LOG_ENABLE is - * defined all logging function is built and code size - * remains constant - * - * Flag settings - 1 = on, 0 = off. */ - - /* This flag turns on "boot" messages for printing. This includes messages - * during crt0.S, then alt_main, and finally alt_exit. */ - #ifndef ALT_LOG_BOOT_ON_FLAG_SETTING - #if ALT_LOG_FLAGS == 1 - #define ALT_LOG_BOOT_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 2 - #define ALT_LOG_BOOT_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 3 - #define ALT_LOG_BOOT_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == -1 /* silent mode */ - #define ALT_LOG_BOOT_ON_FLAG_SETTING 0x0 - #else /* default setting */ - #define ALT_LOG_BOOT_ON_FLAG_SETTING 0x1 - #endif - #endif /* ALT_LOG_BOOT_ON_FLAG_SETTING */ - - #ifndef ALT_LOG_SYS_CLK_ON_FLAG_SETTING - #if ALT_LOG_FLAGS == 1 - #define ALT_LOG_SYS_CLK_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 2 - #define ALT_LOG_SYS_CLK_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 3 - #define ALT_LOG_SYS_CLK_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == -1 /* silent mode */ - #define ALT_LOG_SYS_CLK_ON_FLAG_SETTING 0x0 - #else /* default setting */ - #define ALT_LOG_SYS_CLK_ON_FLAG_SETTING 0x0 - #endif - #endif /* ALT_LOG_SYS_CLK_ON_FLAG_SETTING */ - - #ifndef ALT_LOG_WRITE_ON_FLAG_SETTING - #if ALT_LOG_FLAGS == 1 - #define ALT_LOG_WRITE_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 2 - #define ALT_LOG_WRITE_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 3 - #define ALT_LOG_WRITE_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == -1 /* silent mode */ - #define ALT_LOG_WRITE_ON_FLAG_SETTING 0x0 - #else /* default setting */ - #define ALT_LOG_WRITE_ON_FLAG_SETTING 0x0 - #endif - #endif /* ALT_LOG_WRITE_ON_FLAG_SETTING */ - - #ifndef ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING - #ifndef __ALTERA_AVALON_JTAG_UART - #define ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 1 - #define ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 2 - #define ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 3 - #define ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == -1 /* silent mode */ - #define ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING 0x0 - #else /* default setting */ - #define ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING 0x0 - #endif - #endif /* ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING */ - - #ifndef ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING - #ifndef __ALTERA_AVALON_JTAG_UART - #define ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 1 - #define ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 2 - #define ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 3 - #define ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == -1 /* silent mode */ - #define ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING 0x0 - #else /* default setting */ - #define ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING 0x0 - #endif - #endif /* ALT_LOG_JTAG_UART_STARTUP_INFO_FLAG_SETTING */ - - #ifndef ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING - #ifndef __ALTERA_AVALON_JTAG_UART - #define ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 1 - #define ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 2 - #define ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 3 - #define ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == -1 /* silent mode */ - #define ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING 0x0 - #else /* default setting */ - #define ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING 0x0 - #endif - #endif /* ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING */ - -#ifndef ALT_ASM_SRC - /* Function Prototypes */ - void alt_log_txchar(int c,char *uartBase); - void alt_log_private_printf(const char *fmt,int base,va_list args); - void alt_log_repchar(char c,int r,int base); - int alt_log_printf_proc(const char *fmt, ... ); - void alt_log_system_clock(); - #ifdef __ALTERA_AVALON_JTAG_UART - alt_u32 altera_avalon_jtag_uart_report_log(void * context); - void alt_log_jtag_uart_startup_info(altera_avalon_jtag_uart_state* dev, int base); - void alt_log_jtag_uart_print_control_reg(altera_avalon_jtag_uart_state* dev, \ - int base, const char* header); - void alt_log_jtag_uart_isr_proc(int base, altera_avalon_jtag_uart_state* dev); - #endif - void alt_log_write(const void *ptr, size_t len); - - /* extern all global variables */ - extern volatile alt_u32 alt_log_boot_on_flag; - extern volatile alt_u8 alt_log_write_on_flag; - extern volatile alt_u8 alt_log_sys_clk_on_flag; - extern volatile alt_u8 alt_log_jtag_uart_alarm_on_flag; - extern volatile alt_u8 alt_log_jtag_uart_isr_on_flag; - extern volatile alt_u8 alt_log_jtag_uart_startup_info_on_flag; - extern volatile int alt_log_sys_clk_count; - extern volatile int alt_system_clock_in_sec; - extern alt_alarm alt_log_jtag_uart_alarm_1; -#endif /* ALT_ASM_SRC */ - - - /* Below are the MACRO defines used in various HAL files. They check - * if their specific flag is turned on; if it is, then it executes its - * code. - * - * To keep this file reasonable, most of these macros calls functions, - * which are defined in alt_log_printf.c. Look there for implementation - * details. */ - - /* Boot Messages Logging */ - #define ALT_LOG_PRINT_BOOT(...) \ - do { if (alt_log_boot_on_flag==1) {ALT_LOG_PRINTF(__VA_ARGS__);} \ - } while (0) - - /* JTAG UART Logging */ - /* number of ticks before alarm runs logging function */ - #ifndef ALT_LOG_JTAG_UART_TICKS_DIVISOR - #define ALT_LOG_JTAG_UART_TICKS_DIVISOR 10 - #endif - #ifndef ALT_LOG_JTAG_UART_TICKS - #define ALT_LOG_JTAG_UART_TICKS \ - (alt_ticks_per_second()/ALT_LOG_JTAG_UART_TICKS_DIVISOR) - #endif - - /* if there's a JTAG UART defined, then enable these macros */ - #ifdef __ALTERA_AVALON_JTAG_UART - - /* Macro in altera_avalon_jtag_uart.c, to register the alarm function. - * Also, the startup register info is also printed here, as this is - * called within the device driver initialization. */ - #define ALT_LOG_JTAG_UART_ALARM_REGISTER(dev, base) \ - do { if (alt_log_jtag_uart_alarm_on_flag==1) { \ - alt_alarm_start(&alt_log_jtag_uart_alarm_1, \ - ALT_LOG_JTAG_UART_TICKS, &altera_avalon_jtag_uart_report_log,\ - dev);} \ - if (alt_log_jtag_uart_startup_info_on_flag==1) {\ - alt_log_jtag_uart_startup_info(dev, base);} \ - } while (0) - - /* JTAG UART IRQ Logging (when buffer is empty) - * Inserted in the ISR in altera_avalon_jtag_uart.c */ - #define ALT_LOG_JTAG_UART_ISR_FUNCTION(base, dev) \ - do { alt_log_jtag_uart_isr_proc(base, dev); } while (0) - /* else, define macros to nothing. Or else the jtag_uart specific types - * will throw compiler errors */ - #else - #define ALT_LOG_JTAG_UART_ALARM_REGISTER(dev, base) - #define ALT_LOG_JTAG_UART_ISR_FUNCTION(base, dev) - #endif - - /* System clock logging - * How often (in seconds) the system clock logging prints. - * The default value is every 1 second */ - #ifndef ALT_LOG_SYS_CLK_INTERVAL_MULTIPLIER - #define ALT_LOG_SYS_CLK_INTERVAL_MULTIPLIER 1 - #endif - #ifndef ALT_LOG_SYS_CLK_INTERVAL - #define ALT_LOG_SYS_CLK_INTERVAL \ - (alt_ticks_per_second()*ALT_LOG_SYS_CLK_INTERVAL_MULTIPLIER) - #endif - - /* System clock logging - prints a message every interval (set above) - * to show that the system clock is alive. - * This macro is used in altera_avalon_timer_sc.c */ - #define ALT_LOG_SYS_CLK_HEARTBEAT() \ - do { alt_log_system_clock(); } while (0) - - /* alt_write_logging - echos a message every time write() is called, - * displays the first ALT_LOG_WRITE_ECHO_LEN characters. - * This macro is used in alt_write.c */ - #ifndef ALT_LOG_WRITE_ECHO_LEN - #define ALT_LOG_WRITE_ECHO_LEN 15 - #endif - - #define ALT_LOG_WRITE_FUNCTION(ptr,len) \ - do { alt_log_write(ptr,len); } while (0) - -#else /* ALT_LOG_ENABLE not defined */ - - /* logging is off, set all relevant macros to null */ - #define ALT_LOG_PRINT_BOOT(...) - #define ALT_LOG_PRINTF(...) - #define ALT_LOG_JTAG_UART_ISR_FUNCTION(base, dev) - #define ALT_LOG_JTAG_UART_ALARM_REGISTER(dev, base) - #define ALT_LOG_SYS_CLK_HEARTBEAT() - #define ALT_LOG_PUTS(str) - #define ALT_LOG_WRITE_FUNCTION(ptr,len) - -#endif /* ALT_LOG_ENABLE */ - -#endif /* __ALT_LOG_PRINTF_H__ */ - diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_set_args.h b/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_set_args.h deleted file mode 100644 index 3750e67..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_set_args.h +++ /dev/null @@ -1,71 +0,0 @@ -#ifndef __ALT_SET_ARGS_H__ -#define __ALT_SET_ARGS_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The function alt_set_args() is provided in order to define the input - * arguments to main(). If this function is not called before main() then the - * argument list passed to main() will be empty. - * - * It is expected that this function will only be used by the ihost/iclient - * utility. - */ - -static inline void alt_set_args (int argc, char** argv, char** envp) -{ - extern int alt_argc; - extern char** alt_argv; - extern char** alt_envp; - - alt_argc = argc; - alt_argv = argv; - alt_envp = envp; -} - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_SET_ARGS_H__ */ diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_sim.h b/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_sim.h deleted file mode 100644 index 06bd27a..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_sim.h +++ /dev/null @@ -1,91 +0,0 @@ -#ifndef __ALT_SIM_H__ -#define __ALT_SIM_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ -#include "system.h" -#include "alt_types.h" - -/* - * Instructions that might mean something special to a simulator. - * These have no special effect on real hardware (they are just nops). - */ -#define ALT_SIM_FAIL() \ - do { __asm volatile ("cmpltui r0, r0, 0xabc1"); } while (0) - -#define ALT_SIM_PASS() \ - do { __asm volatile ("cmpltui r0, r0, 0xabc2"); } while (0) - -#define ALT_SIM_IN_TOP_OF_HOT_LOOP() \ - do { __asm volatile ("cmpltui r0, r0, 0xabc3"); } while (0) - -/* - * Routine called on exit. - */ -static ALT_ALWAYS_INLINE void alt_sim_halt(int exit_code) -{ - int r2 = exit_code; - -#if defined(NIOS2_HAS_DEBUG_STUB) && (defined(ALT_BREAK_ON_EXIT) || defined(ALT_PROVIDE_GMON)) - - int r3 = (1 << 2); - -#ifdef ALT_PROVIDE_GMON - extern unsigned int alt_gmon_data[]; - int r4 = (int)alt_gmon_data; - r3 |= (1 << 4); -#define ALT_GMON_DATA ,"D04"(r4) -#else -#define ALT_GMON_DATA -#endif /* ALT_PROVIDE_GMON */ - - if (r2) { - ALT_SIM_FAIL(); - } else { - ALT_SIM_PASS(); - } - - __asm__ volatile ("\n0:\n\taddi %0,%0, -1\n\tbgt %0,zero,0b" : : "r" (ALT_CPU_FREQ/100) ); /* Delay for >30ms */ - - __asm__ volatile ("break 2" : : "D02"(r2), "D03"(r3) ALT_GMON_DATA ); - -#else /* !DEBUG_STUB */ - if (r2) { - ALT_SIM_FAIL(); - } else { - ALT_SIM_PASS(); - } -#endif /* DEBUG_STUB */ -} - -#define ALT_SIM_HALT(exit_code) \ - alt_sim_halt(exit_code) - -#endif /* __ALT_SIM_H__ */ diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_stack.h b/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_stack.h deleted file mode 100644 index e30652a..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_stack.h +++ /dev/null @@ -1,126 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#ifndef __ALT_STACK_H__ -#define __ALT_STACK_H__ - -/* - * alt_stack.h is the nios2 specific implementation of functions used by the - * stack overflow code. - */ - -#include "nios2.h" - -#include "alt_types.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - - -extern char * alt_stack_limit_value; - -#ifdef ALT_EXCEPTION_STACK -extern char __alt_exception_stack_pointer[]; /* set by the linker */ -#endif /* ALT_EXCEPTION_STACK */ - - -/* - * alt_stack_limit can be called to determine the current value of the stack - * limit register. - */ - -static ALT_INLINE char * ALT_ALWAYS_INLINE alt_stack_limit (void) -{ - char * limit; - NIOS2_READ_ET(limit); - - return limit; -} - -/* - * alt_stack_pointer can be called to determine the current value of the stack - * pointer register. - */ - -static ALT_INLINE char * ALT_ALWAYS_INLINE alt_stack_pointer (void) -{ - char * pointer; - NIOS2_READ_SP(pointer); - - return pointer; -} - - -#ifdef ALT_EXCEPTION_STACK - -/* - * alt_exception_stack_pointer returns the normal stack pointer from - * where it is stored on the exception stack (uppermost 4 bytes). This - * is really only useful during exception processing, and is only - * available if a separate exception stack has been configured. - */ - -static ALT_INLINE char * ALT_ALWAYS_INLINE alt_exception_stack_pointer (void) -{ - return (char *) *(alt_u32 *)(__alt_exception_stack_pointer - sizeof(alt_u32)); -} - -#endif /* ALT_EXCEPTION_STACK */ - - -/* - * alt_set_stack_limit can be called to update the current value of the stack - * limit register. - */ - -static ALT_INLINE void ALT_ALWAYS_INLINE alt_set_stack_limit (char * limit) -{ - alt_stack_limit_value = limit; - NIOS2_WRITE_ET(limit); -} - -/* - * alt_report_stack_overflow reports that a stack overflow happened. - */ - -static ALT_INLINE void ALT_ALWAYS_INLINE alt_report_stack_overflow (void) -{ - NIOS2_REPORT_STACK_OVERFLOW(); -} - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_STACK_H__ */ - diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_stdio.h b/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_stdio.h deleted file mode 100644 index 1730360..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_stdio.h +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef __ALT_STDIO_H__ -#define __ALT_STDIO_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * Definitions for ALT stdio routines. - */ - -#include - - -#ifdef __cplusplus -extern "C" { -#endif - -int alt_getchar(); -int alt_putchar(int c); -int alt_putstr(const char* str); -void alt_printf(const char *fmt, ...); - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_STDIO_H__ */ diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_sys_init.h b/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_sys_init.h deleted file mode 100644 index e4abc28..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_sys_init.h +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef __ALT_SYS_INIT_H__ -#define __ALT_SYS_INIT_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The function alt_sys_init() is defined within the auto-generated file: - * alt_sys_init.c. This function calls the initilisation macros for all - * devices, file systems, and software components within the system. - * - * The list of initilisation macros to use is constructed using the PTF and - * STF files associated with the system. - */ - -extern void alt_sys_init (void); - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_SYS_INIT_H__ */ diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_sys_wrappers.h b/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_sys_wrappers.h deleted file mode 100644 index 044833b..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_sys_wrappers.h +++ /dev/null @@ -1,100 +0,0 @@ -#ifndef __ALT_SYS_WRAPPERS_H__ -#define __ALT_SYS_WRAPPERS_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * This file provides the prototypes for the HAL 'UNIX style functions. The - * names of these functions are defined in alt_syscall.h. THese are defined to - * be the standard names when running the standalone HAL, e.g. open(), close() - * etc., but the names may be redefined as a part of an operating system port - * in order to avoid name clashes. - */ - -#include "os/alt_syscall.h" - -#include -#include -#include -#include -#include -#include - -extern int ALT_CLOSE (int __fd); -extern int ALT_EXECVE (const char *__path, - char * const __argv[], - char * const __envp[]); -extern void ALT_EXIT (int __status); -extern int ALT_FSTAT (int file, struct stat *st); -extern int ALT_FCNTL (int file, int cmd, ...); -extern pid_t ALT_FORK (void); -extern pid_t ALT_GETPID (void); - -#if defined (__GNUC__) && __GNUC__ >= 4 -extern int ALT_GETTIMEOFDAY (struct timeval *ptimeval, - void *ptimezone); -#else -extern int ALT_GETTIMEOFDAY (struct timeval *ptimeval, - struct timezone *ptimezone); -#endif - -extern int ALT_IOCTL (int file, int req, void* arg); -extern int ALT_ISATTY (int file); -extern int ALT_KILL (int pid, int sig); -extern int ALT_LINK (const char *existing, const char *new); -extern off_t ALT_LSEEK (int file, off_t ptr, int dir); -extern int ALT_OPEN (const char* file, int flags, ...); -extern int ALT_READ (int file, void *ptr, size_t len); -extern int ALT_RENAME (char *existing, char *new); -extern void* ALT_SBRK (ptrdiff_t incr); -extern int ALT_SETTIMEOFDAY (const struct timeval *t, - const struct timezone *tz); -extern int ALT_STAT (const char *file, struct stat *st); -extern clock_t ALT_TIMES (struct tms *buf); -extern int ALT_UNLINK (const char *name); - -#if defined (__GNUC__) && __GNUC__ >= 4 -int ALT_USLEEP (useconds_t us); -#else -unsigned int ALT_USLEEP (unsigned int us); -#endif - -extern int ALT_WAIT (int *status); -extern int ALT_WRITE (int file, const void *ptr, size_t len); - - -extern char** ALT_ENVIRON; - -/* - * - */ - -#endif /* __ALT_SYS_WRAPPERS_H__ */ diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_timestamp.h b/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_timestamp.h deleted file mode 100644 index 8a18da2..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_timestamp.h +++ /dev/null @@ -1,60 +0,0 @@ -#ifndef __ALT_TIMESTAMP_H__ -#define __ALT_TIMESTAMP_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "alt_types.h" -#include "altera_avalon_timer.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -extern int alt_timestamp_start (void); - -extern alt_timestamp_type alt_timestamp (void); - -extern alt_u32 alt_timestamp_freq (void); - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_TIMESTAMP_H__ */ diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_warning.h b/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_warning.h deleted file mode 100644 index b66e71a..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/alt_warning.h +++ /dev/null @@ -1,75 +0,0 @@ -#ifndef __WARNING_H__ -#define __WARNING_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * alt_warning.h provides macro definitions that can be used to generate link - * time warnings. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The symbol "__alt_invalid" is used to force a link error. There should be - * no corresponding implementation of this function. - */ - -extern void __alt_invalid (void); - -#define ALT_LINK_WARNING(symbol, msg) \ - __asm__(".ifndef __evoke_link_warning_" #symbol \ - "\n\t .section .gnu.warning." #symbol \ - "\n__evoke_link_warning_" #symbol ":\n\t .string \x22" msg "\x22 \n\t .previous" \ - "\n .endif"); - -/* A canned warning for sysdeps/stub functions. */ - -#define ALT_STUB_WARNING(name) \ - ALT_LINK_WARNING (name, \ - "warning: " #name " is not implemented and will always fail") - -#define ALT_OBSOLETE_FUNCTION_WARNING(name) \ - ALT_LINK_WARNING (name, \ - "warning: " #name " is a deprecated function") - -#define ALT_LINK_ERROR(msg) \ - ALT_LINK_WARNING (__alt_invalid, msg); \ - __alt_invalid() - -#ifdef __cplusplus -} -#endif - -#endif /* __WARNING_H__ */ diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/ioctl.h b/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/ioctl.h deleted file mode 100644 index 4d565df..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/ioctl.h +++ /dev/null @@ -1,90 +0,0 @@ -#ifndef __IOCTL_H__ -#define __IOCTL_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The ioctl() system call be used to initiate a variety of control operations - * on a file descriptor. For the most part this simply translates to a call to - * the ioctl() function of the associated device driver (TIOCEXCL and - * TIOCNXCL are notable exceptions - see ioctl.c for details). - * - * The interpretation of the ioctl requests are therefore device specific. - * - * This function is equivalent to the standard Posix ioctl() call. - */ - -extern int ioctl (int fd, int req, void* arg); - -/* - * list of ioctl calls handled by the system ioctl implementation. - */ - -#define TIOCEXCL 0x740d /* exclusive use of the device */ -#define TIOCNXCL 0x740e /* allow multiple use of the device */ - -/* - * ioctl calls which can be handled by device drivers. - */ - -#define TIOCOUTQ 0x7472 /* get output queue size */ -#define TIOCMGET 0x741d /* get termios flags */ -#define TIOCMSET 0x741a /* set termios flags */ - -/* - * ioctl calls specific to JTAG UART. - */ - -#define TIOCSTIMEOUT 0x6a01 /* Set Timeout before assuming no host present */ -#define TIOCGCONNECTED 0x6a02 /* Get indication of whether host is connected */ - -/* - * - */ - -#ifdef __cplusplus -} -#endif - -#endif /* __IOCTL_H__ */ diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/termios.h b/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/termios.h deleted file mode 100644 index cd09539..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/inc/sys/termios.h +++ /dev/null @@ -1,181 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * This is the termios.h file provided with newlib. The only modification has - * been to the baud rate macro definitions, and an increase in the size of the - * termios structure to accomodate this. - */ - - -#ifndef _SYS_TERMIOS_H -# define _SYS_TERMIOS_H - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -# define _XCGETA (('x'<<8)|1) -# define _XCSETA (('x'<<8)|2) -# define _XCSETAW (('x'<<8)|3) -# define _XCSETAF (('x'<<8)|4) -# define _TCSBRK (('T'<<8)|5) -# define _TCFLSH (('T'<<8)|7) -# define _TCXONC (('T'<<8)|6) - -# define TCOOFF 0 -# define TCOON 1 -# define TCIOFF 2 -# define TCION 3 - -# define TCIFLUSH 0 -# define TCOFLUSH 1 -# define TCIOFLUSH 2 - -# define NCCS 13 - -# define TCSAFLUSH _XCSETAF -# define TCSANOW _XCSETA -# define TCSADRAIN _XCSETAW -# define TCSADFLUSH _XCSETAF - -# define IGNBRK 000001 -# define BRKINT 000002 -# define IGNPAR 000004 -# define INPCK 000020 -# define ISTRIP 000040 -# define INLCR 000100 -# define IGNCR 000200 -# define ICRNL 000400 -# define IXON 002000 -# define IXOFF 010000 - -# define OPOST 000001 -# define OCRNL 000004 -# define ONLCR 000010 -# define ONOCR 000020 -# define TAB3 014000 - -# define CLOCAL 004000 -# define CREAD 000200 -# define CSIZE 000060 -# define CS5 0 -# define CS6 020 -# define CS7 040 -# define CS8 060 -# define CSTOPB 000100 -# define HUPCL 002000 -# define PARENB 000400 -# define PAODD 001000 - -#define CCTS_OFLOW 010000 -#define CRTS_IFLOW 020000 -#define CRTSCTS (CCTS_OFLOW | CRTS_IFLOW) - -# define ECHO 0000010 -# define ECHOE 0000020 -# define ECHOK 0000040 -# define ECHONL 0000100 -# define ICANON 0000002 -# define IEXTEN 0000400 /* anybody know *what* this does?! */ -# define ISIG 0000001 -# define NOFLSH 0000200 -# define TOSTOP 0001000 - -# define VEOF 4 /* also VMIN -- thanks, AT&T */ -# define VEOL 5 /* also VTIME -- thanks again */ -# define VERASE 2 -# define VINTR 0 -# define VKILL 3 -# define VMIN 4 /* also VEOF */ -# define VQUIT 1 -# define VSUSP 10 -# define VTIME 5 /* also VEOL */ -# define VSTART 11 -# define VSTOP 12 - -# define B0 0 -# define B50 50 -# define B75 75 -# define B110 110 -# define B134 134 -# define B150 150 -# define B200 200 -# define B300 300 -# define B600 600 -# define B1200 1200 -# define B1800 1800 -# define B2400 2400 -# define B4800 4800 -# define B9600 9600 -# define B19200 19200 -# define B38400 38400 -# define B57600 57600 -# define B115200 115200 - -typedef unsigned char cc_t; -typedef unsigned short tcflag_t; -typedef unsigned long speed_t; - -struct termios { - tcflag_t c_iflag; - tcflag_t c_oflag; - tcflag_t c_cflag; - tcflag_t c_lflag; - char c_line; - cc_t c_cc[NCCS]; - speed_t c_ispeed; - speed_t c_ospeed; -}; - -# ifndef _NO_MACROS - -# define cfgetospeed(tp) ((tp)->c_ospeed) -# define cfgetispeed(tp) ((tp)->c_ispeed) -# define cfsetospeed(tp,s) (((tp)->c_ospeed = (s)), 0) -# define cfsetispeed(tp,s) (((tp)->c_ispeed = (s)), 0) -# define tcdrain(fd) _ioctl (fd, _TCSBRK, 1) -# endif /* _NO_MACROS */ - -#ifdef __cplusplus -} -#endif - -#endif /* _SYS_TERMIOS_H */ - diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_alarm_start.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_alarm_start.c deleted file mode 100644 index 7739959..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_alarm_start.c +++ /dev/null @@ -1,112 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "sys/alt_alarm.h" -#include "sys/alt_irq.h" - -/* - * alt_alarm_start is called to register an alarm with the system. The - * "alarm" structure passed as an input argument does not need to be - * initialised by the user. This is done within this function. - * - * The remaining input arguments are: - * - * nticks - The time to elapse until the alarm executes. This is specified in - * system clock ticks. - * callback - The function to run when the indicated time has elapsed. - * context - An opaque value, passed to the callback function. -* - * Care should be taken when defining the callback function since it is - * likely to execute in interrupt context. In particular, this mean that - * library calls like printf() should not be made, since they can result in - * deadlock. - * - * The interval to be used for the next callback is the return - * value from the callback function. A return value of zero indicates that the - * alarm should be unregistered. - * - * alt_alarm_start() will fail if the timer facility has not been enabled - * (i.e. there is no system clock). Failure is indicated by a negative return - * value. - */ - -int alt_alarm_start (alt_alarm* alarm, alt_u32 nticks, - alt_u32 (*callback) (void* context), - void* context) -{ - alt_irq_context irq_context; - alt_u32 current_nticks = 0; - - if (alt_ticks_per_second ()) - { - if (alarm) - { - alarm->callback = callback; - alarm->context = context; - - irq_context = alt_irq_disable_all (); - - current_nticks = alt_nticks(); - - alarm->time = nticks + current_nticks + 1; - - /* - * If the desired alarm time causes a roll-over, set the rollover - * flag. This will prevent the subsequent tick event from causing - * an alarm too early. - */ - if(alarm->time < current_nticks) - { - alarm->rollover = 1; - } - else - { - alarm->rollover = 0; - } - - alt_llist_insert (&alt_alarm_list, &alarm->llist); - alt_irq_enable_all (irq_context); - - return 0; - } - else - { - return -EINVAL; - } - } - else - { - return -ENOTSUP; - } -} diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_busy_sleep.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_busy_sleep.c deleted file mode 100644 index 561c0be..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_busy_sleep.c +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright (c) 2003-2004 Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - * - * ------------ - * - * Altera does not recommend, suggest or require that this reference design - * file be used in conjunction or combination with any other product. - * - * alt_busy_sleep.c - Microsecond delay routine which uses a calibrated busy - * loop to perform the delay. This is used to implement - * usleep for both uC/OS-II and the standalone HAL. - * - * Author PRR - * - * Calibrated delay with no timer required - * - * The ASM instructions in the routine are equivalent to - * - * for (i=0;i -#include - -#include "system.h" -#include "alt_types.h" - -#include "priv/alt_busy_sleep.h" - -unsigned int alt_busy_sleep (unsigned int us) -{ -/* - * Only delay if ALT_SIM_OPTIMIZE is not defined; i.e., if software - * is built targetting ModelSim RTL simulation, the delay will be - * skipped to speed up simulation. - */ -#ifndef ALT_SIM_OPTIMIZE - int i; - int big_loops; - alt_u32 cycles_per_loop; - - if (!strcmp(NIOS2_CPU_IMPLEMENTATION,"tiny")) - { - cycles_per_loop = 9; - } - else - { - cycles_per_loop = 3; - } - - - big_loops = us / (INT_MAX/ - (ALT_CPU_FREQ/(cycles_per_loop * 1000000))); - - if (big_loops) - { - for(i=0;i - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -#ifdef ALT_USE_DIRECT_DRIVERS - -int ALT_CLOSE (int fildes) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(close); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -/* - * close() is called by an application to release a file descriptor. If the - * associated file system/device has a close() callback function registered - * then this called. The file descriptor is then marked as free. - * - * ALT_CLOSE is mapped onto the close() system call in alt_syscall.h - */ - -int ALT_CLOSE (int fildes) -{ - alt_fd* fd; - int rval; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (fildes < 0) ? NULL : &alt_fd_list[fildes]; - - if (fd) - { - /* - * If the associated file system/device has a close function, call it so - * that any necessary cleanup code can run. - */ - - rval = (fd->dev->close) ? fd->dev->close(fd) : 0; - - /* Free the file descriptor structure and return. */ - - alt_release_fd (fildes); - if (rval < 0) - { - ALT_ERRNO = -rval; - return -1; - } - return 0; - } - else - { - ALT_ERRNO = EBADFD; - return -1; - } -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_dcache_flush.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_dcache_flush.c deleted file mode 100644 index 7ecc91a..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_dcache_flush.c +++ /dev/null @@ -1,97 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "nios2.h" -#include "system.h" - -#include "alt_types.h" -#include "sys/alt_cache.h" - -/* - * Nios II version 1.2 and newer supports the "flush by address" instruction, in - * addition to the "flush by line" instruction provided by older versions of - * the core. This newer instruction is used by preference when it is - * available. - */ - -#ifdef NIOS2_FLUSHDA_SUPPORTED -#define ALT_FLUSH_DATA(i) __asm__ volatile ("flushda (%0)" :: "r" (i)); -#else -#define ALT_FLUSH_DATA(i) __asm__ volatile ("flushd (%0)" :: "r" (i)); -#endif /* NIOS2_FLUSHDA_SUPPORTED */ - -/* - * alt_dcache_flush() is called to flush the data cache for a memory - * region of length "len" bytes, starting at address "start". - * - * Any dirty lines in the data cache are written back to memory. - */ - -void alt_dcache_flush (void* start, alt_u32 len) -{ -#if NIOS2_DCACHE_SIZE > 0 - - char* i; - char* end; - - /* - * This is the most we would ever need to flush. - * - * SPR 196942, 2006.01.13: The cache flush loop below will use the - * 'flushda' instruction if its available; in that case each line - * must be flushed individually, and thus 'len' cannot be trimmed. - */ - #ifndef NIOS2_FLUSHDA_SUPPORTED - if (len > NIOS2_DCACHE_SIZE) - { - len = NIOS2_DCACHE_SIZE; - } - #endif - - end = ((char*) start) + len; - - for (i = start; i < end; i+= NIOS2_DCACHE_LINE_SIZE) - { - ALT_FLUSH_DATA(i); - } - - /* - * For an unaligned flush request, we've got one more line left. - * Note that this is dependent on NIOS2_DCACHE_LINE_SIZE to be a - * multiple of 2 (which it always is). - */ - - if (((alt_u32) start) & (NIOS2_DCACHE_LINE_SIZE - 1)) - { - ALT_FLUSH_DATA(i); - } - -#endif /* NIOS2_DCACHE_SIZE > 0 */ -} diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_dcache_flush_all.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_dcache_flush_all.c deleted file mode 100644 index 6529231..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_dcache_flush_all.c +++ /dev/null @@ -1,51 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "nios2.h" -#include "system.h" - -#include "alt_types.h" -#include "sys/alt_cache.h" - -/* - * alt_dcache_flush_all() is called to flush the entire data cache. - */ - -void alt_dcache_flush_all (void) -{ -#if NIOS2_DCACHE_SIZE > 0 - char* i; - - for (i = (char*) 0; i < (char*) NIOS2_DCACHE_SIZE; i+= NIOS2_DCACHE_LINE_SIZE) - { - __asm__ volatile ("flushd (%0)" :: "r" (i)); - } -#endif /* NIOS2_DCACHE_SIZE > 0 */ -} diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_dcache_flush_no_writeback.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_dcache_flush_no_writeback.c deleted file mode 100644 index c65ca7d..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_dcache_flush_no_writeback.c +++ /dev/null @@ -1,88 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "nios2.h" -#include "system.h" - -#include "alt_types.h" -#include "sys/alt_cache.h" - -/* - * The INITDA instruction was added to Nios II in the 8.0 release. - * - * The INITDA instruction has one of the following possible behaviors - * depending on the processor configuration: - * 1) Flushes a line by address but does NOT write back dirty data. - * Occurs when a data cache is present that supports INITDA. - * The macro NIOS2_INITDA_SUPPORTED is defined in system.h. - * 2) Takes an unimplemented instruction exception. - * Occurs when a data cache is present that doesn't support INITDA. - * 3) Performs no operation - * Occurs when there is no data cache present. - * The macro NIOS2_DCACHE_SIZE is 0 in system.h. - */ - -#define ALT_FLUSH_DATA_NO_WRITEBACK(i) \ - __asm__ volatile ("initda (%0)" :: "r" (i)); - -/* - * alt_dcache_flush_no_writeback() is called to flush the data cache for a - * memory region of length "len" bytes, starting at address "start". - * - * Any dirty lines in the data cache are NOT written back to memory. - * Make sure you really want this behavior. If you aren't 100% sure, - * use the alt_dcache_flush() routine instead. - */ - -void alt_dcache_flush_no_writeback (void* start, alt_u32 len) -{ -#if defined(NIOS2_INITDA_SUPPORTED) - - char* i; - char* end = ((char*) start) + len; - - for (i = start; i < end; i+= NIOS2_DCACHE_LINE_SIZE) - { - ALT_FLUSH_DATA_NO_WRITEBACK(i); - } - - /* - * For an unaligned flush request, we've got one more line left. - * Note that this is dependent on NIOS2_DCACHE_LINE_SIZE to be a - * multiple of 2 (which it always is). - */ - - if (((alt_u32) start) & (NIOS2_DCACHE_LINE_SIZE - 1)) - { - ALT_FLUSH_DATA_NO_WRITEBACK(i); - } - -#endif /* NIOS2_INITDA_SUPPORTED */ -} diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_dev.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_dev.c deleted file mode 100644 index ebc15e5..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_dev.c +++ /dev/null @@ -1,149 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include -#include -#include - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - -#include "alt_types.h" - -#include "system.h" - -/* - * This file contains the data constructs used to control access to device and - * filesytems. - */ - -/* - * "alt_fs_list" is the head of a linked list of registered filesystems. It is - * initialised as an empty list. New entries can be added using the - * alt_fs_reg() function. - */ - -ALT_LLIST_HEAD(alt_fs_list); - - -/* - * "alt_dev_list" is the head of a linked list of registered devices. It is - * configured at startup to include a single device, "alt_dev_null". This - * device is discussed below. - */ - -extern alt_dev alt_dev_null; /* forward declaration */ - -alt_llist alt_dev_list = {&alt_dev_null.llist, &alt_dev_null.llist}; - -/* - * alt_dev_null_write() is the implementation of the write() function used - * by the alt_dev_null device. It simple discards all data passed to it, and - * indicates that the data has been successfully transmitted. - */ - -static int alt_dev_null_write (alt_fd* fd, const char* ptr, int len) -{ - return len; -} - -/* - * "alt_dev_null" is used to allow output to be redirected to nowhere. It is - * the only device registered before the call to alt_sys_init(). At startup - * stin, stdout & stderr are all directed towards this device so that library - * calls like printf() will be safe but inefectual. - */ - -alt_dev alt_dev_null = { - { - &alt_dev_list, - &alt_dev_list - }, - "/dev/null", - NULL, /* open */ - NULL, /* close */ - NULL, /* write */ - alt_dev_null_write, /* write */ - NULL, /* lseek */ - NULL, /* fstat */ - NULL /* ioctl */ - }; - -/* - * "alt_fd_list_lock" is a semaphore used to control access to the file - * descriptor list. This is used to ensure that access to the list is thread - * safe. - */ - -ALT_SEM(alt_fd_list_lock) - -/* - * "alt_max_fd" is used to make access to the file descriptor list more - * efficent. It is set to be the value of the highest allocated file - * descriptor. This saves having to search the entire pool of unallocated - * file descriptors when looking for a match. - */ - -alt_32 alt_max_fd = -1; - -/* - * "alt_fd_list" is the file descriptor pool. The first three entries in the - * array are configured as standard in, standard out, and standard error. These - * are all initialised so that accesses are directed to the alt_dev_null - * device. The remaining file descriptors are initialised as unallocated. - * - * The maximum number of file descriptors within the system is specified by the - * user defined macro "ALT_MAX_FD". This is defined in "system.h", which is - * auto-genereated using the projects PTF and STF files. - */ - -alt_fd alt_fd_list[ALT_MAX_FD] = - { - { - &alt_dev_null, /* standard in */ - 0, - 0 - }, - { - &alt_dev_null, /* standard out */ - 0, - 0 - }, - { - &alt_dev_null, /* standard error */ - 0, - 0 - } - /* all other elements are set to zero */ - }; diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_dev_llist_insert.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_dev_llist_insert.c deleted file mode 100644 index fa7239d..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_dev_llist_insert.c +++ /dev/null @@ -1,59 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "priv/alt_dev_llist.h" -#include "sys/alt_errno.h" - -/* - * - */ - -int alt_dev_llist_insert (alt_dev_llist* dev, alt_llist* list) -{ - /* - * check that the device exists, and that it has a valid name. - */ - - if (!dev || !dev->name) - { - ALT_ERRNO = EINVAL; - return -EINVAL; - } - - /* - * register the device. - */ - - alt_llist_insert(list, &dev->llist); - - return 0; -} diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_dma_rxchan_open.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_dma_rxchan_open.c deleted file mode 100644 index 6ea3b78..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_dma_rxchan_open.c +++ /dev/null @@ -1,63 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_dma.h" -#include "sys/alt_errno.h" -#include "priv/alt_file.h" - -/* - * The list of registered DMA receive channels. - */ - -ALT_LLIST_HEAD(alt_dma_rxchan_list); - -/* - * alt_dma_txchan_open() is used to obtain an "alt_dma_txchan" descriptor for - * a DMA transmit device. The name is the name of the associated physical - * device (e.g. "/dev/dma_0"). - * - * The return value will be NULL on failure, and non-NULL otherwise. - */ - -alt_dma_rxchan alt_dma_rxchan_open (const char* name) -{ - alt_dma_rxchan dev; - - dev = (alt_dma_rxchan) alt_find_dev (name, &alt_dma_rxchan_list); - - if (!dev) - { - ALT_ERRNO = ENODEV; - } - - return dev; -} diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_dma_txchan_open.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_dma_txchan_open.c deleted file mode 100644 index f41fa81..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_dma_txchan_open.c +++ /dev/null @@ -1,63 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_dma.h" -#include "sys/alt_errno.h" -#include "priv/alt_file.h" - -/* - * The list of registered receive channels. - */ - -ALT_LLIST_HEAD(alt_dma_txchan_list); - -/* - * alt_dma_txchan_open() is used to obtain an "alt_dma_txchan" descriptor for - * a DMA transmit device. The name is the name of the associated physical - * device (e.g. "/dev/dma_0"). - * - * The return value will be NULL on failure, and non-NULL otherwise. - */ - -alt_dma_txchan alt_dma_txchan_open (const char* name) -{ - alt_dma_txchan dev; - - dev = (alt_dma_txchan) alt_find_dev (name, &alt_dma_txchan_list); - - if (!dev) - { - ALT_ERRNO = ENODEV; - } - - return dev; -} diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_do_ctors.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_do_ctors.c deleted file mode 100644 index ff5a1f7..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_do_ctors.c +++ /dev/null @@ -1,64 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT IT DIRECTLY. * -* * -* Overriding HAL Functions * -* * -* To provide your own implementation of a HAL function, include the file in * -* your Nios II IDE application project. When building the executable, the * -* Nios II IDE finds your function first, and uses it in place of the HAL * -* version. * -* * -******************************************************************************/ - -/* - * - */ - -typedef void (*constructor) (void); -extern constructor __CTOR_LIST__[]; -extern constructor __CTOR_END__[]; - -/* - * Run the C++ static constructors. - */ - -void _do_ctors(void) -{ - constructor* ctor; - - for (ctor = &__CTOR_END__[-1]; ctor >= __CTOR_LIST__; ctor--) - (*ctor) (); -} diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_do_dtors.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_do_dtors.c deleted file mode 100644 index 565c99f..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_do_dtors.c +++ /dev/null @@ -1,64 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT IT DIRECTLY. * -* * -* Overriding HAL Functions * -* * -* To provide your own implementation of a HAL function, include the file in * -* your Nios II IDE application project. When building the executable, the * -* Nios II IDE finds your function first, and uses it in place of the HAL * -* version. * -* * -******************************************************************************/ - -/* - * - */ - -typedef void (*destructor) (void); -extern destructor __DTOR_LIST__[]; -extern destructor __DTOR_END__[]; - -/* - * Run the C++ static destructors. - */ - -void _do_dtors(void) -{ - destructor* dtor; - - for (dtor = &__DTOR_END__[-1]; dtor >= __DTOR_LIST__; dtor--) - (*dtor) (); -} diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_env_lock.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_env_lock.c deleted file mode 100644 index fc25a0c..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_env_lock.c +++ /dev/null @@ -1,53 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -/* - * These are the empty env lock/unlock stubs required by newlib. These are - * used to make accesses to environment variables thread safe. The default HAL - * configuration is single threaded, so there is nothing to do here. Note that - * this requires that environment variables are never manipulated by an interrupt - * service routine. - */ - -void __env_lock ( struct _reent *_r ) -{ -} - -/* - * - */ - -void __env_unlock ( struct _reent *_r ) -{ -} diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_environ.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_environ.c deleted file mode 100644 index 404efc4..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_environ.c +++ /dev/null @@ -1,42 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "os/alt_syscall.h" - -/* - * These are the environment variables passed to the C code. By default there - * are no variables registered. An application can manipulate this list using - * getenv() and setenv(). - */ - -char *__env[1] = { 0 }; -char **ALT_ENVIRON = __env; diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_errno.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_errno.c deleted file mode 100644 index 1d8368d..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_errno.c +++ /dev/null @@ -1,44 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/* - * This file defines the alt_errno global variable. See comments in - * alt_errno.h for the use of this variable. - */ - - -#include "sys/alt_errno.h" -#include "alt_types.h" - -extern int ALT_WEAK *__errno (void); - -int* (*alt_errno) (void) = __errno; diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_exception_entry.S b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_exception_entry.S deleted file mode 100644 index 3afab93..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_exception_entry.S +++ /dev/null @@ -1,360 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2008 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "system.h" - -/* - * This is the exception entry point code, which saves all the caller saved - * registers and then handles the appropriate exception. It should be pulled - * in using a .globl from all the exception handler routines. This scheme is - * used so that if an interrupt is never registered, then this code will not - * appear in the generated executable, thereby improving code footprint. - * - * If an external interrpt controller (EIC) is present, it will supply an - * interrupt vector address to the processor when an interrupt occurs. For - * The Altera Vectored Interrupt Controller (VIC) driver will establish a - * vector table and the processor will jump directly to the appropriate - * table entry, funnel routine, and then user ISR. This will bypass this code - * in entirety. This code might still be linked into a system with an EIC, - * but would then be used only for non-interrupt exceptions. - */ - - /* - * Explicitly allow the use of r1 (the assembler temporary register) - * within this code. This register is normally reserved for the use of - * the assembler. - */ - .set noat - - /* - * The top and bottom of the exception stack - */ -#ifdef ALT_EXCEPTION_STACK - - .globl __alt_exception_stack_pointer - -#ifdef ALT_STACK_CHECK - - .globl __alt_exception_stack_limit - - /* - * We need to store the value of the stack limit after interrupt somewhere. - */ - .globl alt_exception_old_stack_limit - -#endif -#endif - - .section .exceptions.entry.label, "xa" - - .globl alt_exception - .type alt_exception, @function -alt_exception: - - .section .exceptions.entry, "xa" - -#ifdef ALT_EXCEPTION_STACK - -#ifdef ALT_STACK_CHECK - stw et, %gprel(alt_exception_old_stack_limit)(gp) -#endif - - movhi et, %hiadj(__alt_exception_stack_pointer - 80) - addi et, et, %lo(__alt_exception_stack_pointer - 80) - stw sp, 76(et) - mov sp, et - -#ifdef ALT_STACK_CHECK - movhi et, %hiadj(__alt_exception_stack_limit) - addi et, et, %lo(__alt_exception_stack_limit) - stw et, %gprel(alt_stack_limit_value)(gp) -#endif - -#else - /* - * Process an exception. For all exceptions we must preserve all - * caller saved registers on the stack (See the Nios2 ABI - * documentation for details). - */ - - addi sp, sp, -76 - -#ifdef ALT_STACK_CHECK - - bltu sp, et, .Lstack_overflow - -#endif - -#endif - - stw ra, 0(sp) - - /* - * Leave a gap in the stack frame at 4(sp) for the muldiv handler to - * store zero into. - */ - - stw r1, 8(sp) - stw r2, 12(sp) - stw r3, 16(sp) - stw r4, 20(sp) - stw r5, 24(sp) - stw r6, 28(sp) - stw r7, 32(sp) - - rdctl r5, estatus - - stw r8, 36(sp) - stw r9, 40(sp) - stw r10, 44(sp) - stw r11, 48(sp) - stw r12, 52(sp) - stw r13, 56(sp) - stw r14, 60(sp) - stw r15, 64(sp) - - /* - * ea-4 contains the address of the instruction being executed - * when the exception occured. For interrupt exceptions, we will - * will be re-issue the isntruction. Store it in 72(sp) - */ - stw r5, 68(sp) /* estatus */ - addi r15, ea, -4 /* instruction that caused exception */ - stw r15, 72(sp) - - /* - * The interrupt testing code (.exceptions.irqtest) will be - * linked here. If the Internal Interrupt Controller (IIC) is - * present (an EIC is not present), the presense of an interrupt - * is determined by examining CPU control registers or an interrupt - * custom instruction, if present. - * - * If the IIC is used and an interrupt is active, the code linked - * here will call the HAL IRQ handler (alt_irq_handler()) which - * successively calls registered interrupt handler(s) until no - * interrupts remain pending. It then jumps to .exceptions.exit. If - * there is no interrupt then it continues to .exception.notirq, below. - */ - - .section .exceptions.notirq, "xa" - - /* - * Prepare to service unimplemtned instructions or traps, - * each of which is optionally inked into section .exceptions.soft, - * which will preceed .exceptions.unknown below. - * - * Unlike interrupts, we want to skip the exception-causing instructon - * upon completion, so we write ea (address of instruction *after* - * the one where the exception occured) into 72(sp). The actual - * instruction that caused the exception is written in r2, which these - * handlers will utilize. - */ - stw ea, 72(sp) /* Don't re-issue */ - ldw r2, -4(ea) /* Instruction that caused exception */ - - /* - * Other exception handling code, if enabled, will be linked here. - * This includes unimplemted (multiply/divide) instruction support - * (a BSP generaton option), and a trap handler (that would typically - * be augmented with user-specific code). These are not linked in by - * default. - */ - - /* - * In the context of linker sections, "unknown" are all exceptions - * not handled by the built-in handlers above (interupt, and trap or - * unimplemented instruction decoding, if enabled). - * - * Advanced exception types can be serviced by registering a handler. - * To do so, enable the "Enable Instruction-related Exception API" HAL - * BSP setting. If this setting is disabled, this handler code will - * either break (if the debug core is present) or enter an infinite - * loop because we don't how how to handle the exception. - */ - .section .exceptions.unknown -#ifdef ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API - /* - * The C-based HAL routine alt_instruction_exception_entry() will - * attempt to service the exception by calling a user-registered - * exception handler using alt_instruction_exception_register(). - * If no handler was registered it will either break (if the - * debugger is present) or go into an infinite loop since the - * handling behavior is undefined; in that case we will not return here. - */ - - /* Load exception-causing address as first argument (r4) */ - addi r4, ea, -4 - - /* Call the instruction-exception entry */ - call alt_instruction_exception_entry - - /* - * If alt_instruction_exception_entry() returned, the exception was - * serviced by a user-registered routine. Its return code (now in r2) - * indicates whether to re-issue or skip the exception-causing - * instruction - * - * Return code was 0: Skip. The instruction after the exception is - * already stored in 72(sp). - */ - bne r2, r0, .Lexception_exit - - /* - * Otherwise, modify 72(sp) to re-issue the instruction that caused the - * exception. - */ - addi r15, ea, -4 /* instruction that caused exception */ - stw r15, 72(sp) - -#else /* ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API disabled */ - - /* - * We got here because an instruction-related exception occured, but the - * handler API was not compiled in. We do not presume to know how to - * handle it. If the debugger is present, break, otherwise hang. - * - * If you get here then one of the following could have happened: - * - * - An instruction-generated exception occured, and the processor - * does not have the extra exceptions feature enabled, or you - * have not registered a handler using - * alt_instruction_exception_register() - * - * Some examples of instruction-generated exceptions and why they - * might occur: - * - * - Your program could have been compiled for a full-featured - * Nios II core, but it is running on a smaller core, and - * instruction emulation has been disabled by defining - * ALT_NO_INSTRUCTION_EMULATION. - * - * You can work around the problem by re-enabling instruction - * emulation, or you can figure out why your program is being - * compiled for a system other than the one that it is running on. - * - * - Your program has executed a trap instruction, but has not - * implemented a handler for this instruction. - * - * - Your program has executed an illegal instruction (one which is - * not defined in the instruction set). - * - * - Your processor includes an MMU or MPU, and you have enabled it - * before registering an exception handler to service exceptions it - * generates. - * - * The problem could also be hardware related: - * - If your hardware is broken and is generating spurious interrupts - * (a peripheral which negates its interrupt output before its - * interrupt handler has been executed will cause spurious - * interrupts) - */ -#ifdef NIOS2_HAS_DEBUG_STUB - /* - * Either tell the user now (if there is a debugger attached) or go into - * the debug monitor which will loop until a debugger is attached. - */ - break -#else - /* - * If there is no debug stub then a BREAK will probably cause a reboot. - * An infinate loop will probably be more useful. - */ -0: - br 0b -#endif /* NIOS2_HAS_DEBUG_STUB */ - -#endif /* ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API */ - - .section .exceptions.exit.label -.Lexception_exit: - - .section .exceptions.exit, "xa" - - /* - * Restore the saved registers, so that all general purpose registers - * have been restored to their state at the time the interrupt occured. - */ - - ldw r5, 68(sp) - ldw ea, 72(sp) /* This becomes the PC once eret is executed */ - ldw ra, 0(sp) - - wrctl estatus, r5 - - ldw r1, 8(sp) - ldw r2, 12(sp) - ldw r3, 16(sp) - ldw r4, 20(sp) - ldw r5, 24(sp) - ldw r6, 28(sp) - ldw r7, 32(sp) - -#ifdef ALT_EXCEPTION_STACK -#ifdef ALT_STACK_CHECK - ldw et, %gprel(alt_exception_old_stack_limit)(gp) -#endif -#endif - - ldw r8, 36(sp) - ldw r9, 40(sp) - ldw r10, 44(sp) - ldw r11, 48(sp) - ldw r12, 52(sp) - ldw r13, 56(sp) - ldw r14, 60(sp) - ldw r15, 64(sp) - -#ifdef ALT_EXCEPTION_STACK - -#ifdef ALT_STACK_CHECK - stw et, %gprel(alt_stack_limit_value)(gp) - stw zero, %gprel(alt_exception_old_stack_limit)(gp) -#endif - - ldw sp, 76(sp) - -#else - addi sp, sp, 76 - -#endif - - /* - * Return to the interrupted instruction. - */ - - eret - -#ifdef ALT_STACK_CHECK - -.Lstack_overflow: - break 3 - -#endif - diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_exception_muldiv.S b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_exception_muldiv.S deleted file mode 100644 index 55617a6..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_exception_muldiv.S +++ /dev/null @@ -1,583 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - - /* - * This is the software multiply/divide handler for Nios2. - */ - - /* - * Provide a label which can be used to pull this file in. - */ - - .section .exceptions.start - .globl alt_exception_muldiv -alt_exception_muldiv: - - /* - * Pull in the entry/exit code. - */ - .globl alt_exception - - - .section .exceptions.soft, "xa" - - - /* INSTRUCTION EMULATION - * --------------------- - * - * Nios II processors generate exceptions for unimplemented instructions. - * The routines below emulate these instructions. Depending on the - * processor core, the only instructions that might need to be emulated - * are div, divu, mul, muli, mulxss, mulxsu, and mulxuu. - * - * The emulations match the instructions, except for the following - * limitations: - * - * 1) The emulation routines do not emulate the use of the exception - * temporary register (et) as a source operand because the exception - * handler already has modified it. - * - * 2) The routines do not emulate the use of the stack pointer (sp) or the - * exception return address register (ea) as a destination because - * modifying these registers crashes the exception handler or the - * interrupted routine. - * - * 3) To save code size, the routines do not emulate the use of the - * breakpoint registers (ba and bt) as operands. - * - * Detailed Design - * --------------- - * - * The emulation routines expect the contents of integer registers r0-r31 - * to be on the stack at addresses sp, 4(sp), 8(sp), ... 124(sp). The - * routines retrieve source operands from the stack and modify the - * destination register's value on the stack prior to the end of the - * exception handler. Then all registers except the destination register - * are restored to their previous values. - * - * The instruction that causes the exception is found at address -4(ea). - * The instruction's OP and OPX fields identify the operation to be - * performed. - * - * One instruction, muli, is an I-type instruction that is identified by - * an OP field of 0x24. - * - * muli AAAAA,BBBBB,IIIIIIIIIIIIIIII,-0x24- - * 27 22 6 0 <-- LSB of field - * - * The remaining emulated instructions are R-type and have an OP field - * of 0x3a. Their OPX fields identify them. - * - * R-type AAAAA,BBBBB,CCCCC,XXXXXX,NNNNN,-0x3a- - * 27 22 17 11 6 0 <-- LSB of field - * - * - */ - - - /* - * Split the instruction into its fields. We need 4*A, 4*B, and 4*C as - * offsets to the stack pointer for access to the stored register values. - */ - /* r2 = AAAAA,BBBBB,IIIIIIIIIIIIIIII,PPPPPP */ - roli r3, r2, 7 /* r3 = BBB,IIIIIIIIIIIIIIII,PPPPPP,AAAAA,BB */ - roli r4, r3, 3 /* r4 = IIIIIIIIIIIIIIII,PPPPPP,AAAAA,BBBBB */ - roli r6, r4, 2 /* r6 = IIIIIIIIIIIIII,PPPPPP,AAAAA,BBBBB,II */ - srai r4, r4, 16 /* r4 = (sign-extended) IMM16 */ - xori r6, r6, 0x42 /* r6 = CCC,XXXXXX,NNNNN,PPPPPP,AAAAA,bBBBB,cC */ - roli r7, r6, 5 /* r7 = XXXX,NNNNN,PPPPPP,AAAAA,bBBBB,cCCCC,XX */ - andi r5, r2, 0x3f /* r5 = 00000000000000000000000000,PPPPPP */ - xori r3, r3, 0x40 - andi r3, r3, 0x7c /* r3 = 0000000000000000000000000,aAAAA,00 */ - andi r6, r6, 0x7c /* r6 = 0000000000000000000000000,bBBBB,00 */ - andi r7, r7, 0x7c /* r7 = 0000000000000000000000000,cCCCC,00 */ - - /* Now either - * r5 = OP - * r3 = 4*(A^16) - * r4 = IMM16 (sign extended) - * r6 = 4*(B^16) - * r7 = 4*(C^16) - * or - * r5 = OP - */ - - - /* - * Save everything on the stack to make it easy for the emulation routines - * to retrieve the source register operands. The exception entry code has - * already saved some of this so we don't need to do it all again. - */ - - addi sp, sp, -60 - stw zero, 64(sp) /* Save zero on stack to avoid special case for r0. */ - /* Register at and r2-r15 have already been saved. */ - - stw r16, 0(sp) - stw r17, 4(sp) - stw r18, 8(sp) - stw r19, 12(sp) - stw r20, 16(sp) - stw r21, 20(sp) - stw r22, 24(sp) - stw r23, 28(sp) - /* et @ 32 - Has already been changed.*/ - /* bt @ 36 - Usually isn't an operand. */ - stw gp, 40(sp) - stw sp, 44(sp) - stw fp, 48(sp) - /* ea @ 52 - Don't bother to save - it's already been changed */ - /* ba @ 56 - Breakpoint register usually isn't an operand */ - /* ra @ 60 - Has already been saved */ - - - /* - * Prepare for either multiplication or division loop. - * They both loop 32 times. - */ - movi r14, 32 - - - /* - * Get the operands. - * - * It is necessary to check for muli because it uses an I-type instruction - * format, while the other instructions are have an R-type format. - */ - add r3, r3, sp /* r3 = address of A-operand. */ - ldw r3, 0(r3) /* r3 = A-operand. */ - movi r15, 0x24 /* muli opcode (I-type instruction format) */ - beq r5, r15, .Lmul_immed /* muli doesn't use the B register as a source */ - - add r6, r6, sp /* r6 = address of B-operand. */ - ldw r6, 0(r6) /* r6 = B-operand. */ - /* r4 = SSSSSSSSSSSSSSSS,-----IMM16------ */ - /* IMM16 not needed, align OPX portion */ - /* r4 = SSSSSSSSSSSSSSSS,CCCCC,-OPX--,00000 */ - srli r4, r4, 5 /* r4 = 00000,SSSSSSSSSSSSSSSS,CCCCC,-OPX-- */ - andi r4, r4, 0x3f /* r4 = 00000000000000000000000000,-OPX-- */ - - /* Now - * r5 = OP - * r3 = src1 - * r6 = src2 - * r4 = OPX (no longer can be muli) - * r7 = 4*(C^16) - * r14 = loop counter - */ - - /* ILLEGAL-INSTRUCTION EXCEPTION - * ----------------------------- - * - * This code is for Nios II cores that generate exceptions when attempting - * to execute illegal instructions. Nios II cores that support an - * illegal-instruction exception are identified by the presence of the - * macro definition NIOS2_HAS_ILLEGAL_INSTRUCTION_EXCEPTION in system.h . - * - * Remember that illegal instructions are different than unimplemented - * instructions. Illegal instructions are instruction encodings that - * have not been defined by the Nios II ISA. Unimplemented instructions - * are legal instructions that must be emulated by some Nios II cores. - * - * If we get here, all instructions except multiplies and divides - * are illegal. - * - * This code assumes that OP is not muli (because muli was tested above). - * All other multiplies and divides are legal. Anything else is illegal. - */ - - movi r8, 0x3a /* OP for R-type mul* and div* */ - bne r5, r8, .Lnot_muldiv - - /* r15 already is 0x24 */ /* OPX of divu */ - beq r4, r15, .Ldivide - - movi r15,0x27 /* OPX of mul */ - beq r4, r15, .Lmultiply - - movi r15,0x07 /* OPX of mulxuu */ - beq r4, r15, .Lmultiply - - movi r15,0x17 /* OPX of mulxsu */ - beq r4, r15, .Lmultiply - - movi r15,0x1f /* OPX of mulxss */ - beq r4, r15, .Lmultiply - - movi r15,0x25 /* OPX of div */ - bne r4, r15, .Lnot_muldiv - - - /* DIVISION - * - * Divide an unsigned dividend by an unsigned divisor using - * a shift-and-subtract algorithm. The example below shows - * 43 div 7 = 6 for 8-bit integers. This classic algorithm uses a - * single register to store both the dividend and the quotient, - * allowing both values to be shifted with a single instruction. - * - * remainder dividend:quotient - * --------- ----------------- - * initialize 00000000 00101011: - * shift 00000000 0101011:_ - * remainder >= divisor? no 00000000 0101011:0 - * shift 00000000 101011:0_ - * remainder >= divisor? no 00000000 101011:00 - * shift 00000001 01011:00_ - * remainder >= divisor? no 00000001 01011:000 - * shift 00000010 1011:000_ - * remainder >= divisor? no 00000010 1011:0000 - * shift 00000101 011:0000_ - * remainder >= divisor? no 00000101 011:00000 - * shift 00001010 11:00000_ - * remainder >= divisor? yes 00001010 11:000001 - * remainder -= divisor - 00000111 - * ---------- - * 00000011 11:000001 - * shift 00000111 1:000001_ - * remainder >= divisor? yes 00000111 1:0000011 - * remainder -= divisor - 00000111 - * ---------- - * 00000000 1:0000011 - * shift 00000001 :0000011_ - * remainder >= divisor? no 00000001 :00000110 - * - * The quotient is 00000110. - */ - -.Ldivide: - /* - * Prepare for division by assuming the result - * is unsigned, and storing its "sign" as 0. - */ - movi r17, 0 - - - /* Which division opcode? */ - xori r15, r4, 0x25 /* OPX of div */ - bne r15, zero, .Lunsigned_division - - - /* - * OPX is div. Determine and store the sign of the quotient. - * Then take the absolute value of both operands. - */ - xor r17, r3, r6 /* MSB contains sign of quotient */ - bge r3, zero, 0f - sub r3, zero, r3 /* -r3 */ -0: - bge r6, zero, 0f - sub r6, zero, r6 /* -r6 */ -0: - - -.Lunsigned_division: - /* Initialize the unsigned-division loop. */ - movi r13, 0 /* remainder = 0 */ - - /* Now - * r3 = dividend : quotient - * r4 = 0x25 for div, 0x24 for divu - * r6 = divisor - * r13 = remainder - * r14 = loop counter (already initialized to 32) - * r17 = MSB contains sign of quotient - */ - - - /* - * for (count = 32; count > 0; --count) - * { - */ -.Ldivide_loop: - - /* - * Division: - * - * (remainder:dividend:quotient) <<= 1; - */ - slli r13, r13, 1 - cmplt r15, r3, zero /* r15 = MSB of r3 */ - or r13, r13, r15 - slli r3, r3, 1 - - - /* - * if (remainder >= divisor) - * { - * set LSB of quotient - * remainder -= divisor; - * } - */ - bltu r13, r6, .Ldiv_skip - ori r3, r3, 1 - sub r13, r13, r6 -.Ldiv_skip: - - /* - * } - */ - subi r14, r14, 1 - bne r14, zero, .Ldivide_loop - - mov r9, r3 - - - /* Now - * r9 = quotient - * r4 = 0x25 for div, 0x24 for divu - * r7 = 4*(C^16) - * r17 = MSB contains sign of quotient - */ - - - /* - * Conditionally negate signed quotient. If quotient is unsigned, - * the sign already is initialized to 0. - */ - bge r17, zero, .Lstore_result - sub r9, zero, r9 /* -r9 */ - - br .Lstore_result - - - - - /* MULTIPLICATION - * - * A "product" is the number that one gets by summing a "multiplicand" - * several times. The "multiplier" specifies the number of copies of the - * multiplicand that are summed. - * - * Actual multiplication algorithms don't use repeated addition, however. - * Shift-and-add algorithms get the same answer as repeated addition, and - * they are faster. To compute the lower half of a product (pppp below) - * one shifts the product left before adding in each of the partial products - * (a * mmmm) through (d * mmmm). - * - * To compute the upper half of a product (PPPP below), one adds in the - * partial products (d * mmmm) through (a * mmmm), each time following the - * add by a right shift of the product. - * - * mmmm - * * abcd - * ------ - * #### = d * mmmm - * #### = c * mmmm - * #### = b * mmmm - * #### = a * mmmm - * -------- - * PPPPpppp - * - * The example above shows 4 partial products. Computing actual Nios II - * products requires 32 partials. - * - * It is possible to compute the result of mulxsu from the result of mulxuu - * because the only difference between the results of these two opcodes is - * the value of the partial product associated with the sign bit of rA. - * - * mulxsu = mulxuu - ((rA < 0) ? rB : 0); - * - * It is possible to compute the result of mulxss from the result of mulxsu - * because the only difference between the results of these two opcodes is - * the value of the partial product associated with the sign bit of rB. - * - * mulxss = mulxsu - ((rB < 0) ? rA : 0); - * - */ - -.Lmul_immed: - /* Opcode is muli. Change it into mul for remainder of algorithm. */ - mov r7, r6 /* Field B is dest register, not field C. */ - mov r6, r4 /* Field IMM16 is src2, not field B. */ - movi r4, 0x27 /* OPX of mul is 0x27 */ - -.Lmultiply: - /* Initialize the multiplication loop. */ - movi r9, 0 /* mul_product = 0 */ - movi r10, 0 /* mulxuu_product = 0 */ - mov r11, r6 /* save original multiplier for mulxsu and mulxss */ - mov r12, r6 /* mulxuu_multiplier (will be shifted) */ - movi r16, 1 /* used to create "rori B,A,1" from "ror B,A,r16" */ - - /* Now - * r3 = multiplicand - * r6 = mul_multiplier - * r7 = 4 * dest_register (used later as offset to sp) - * r9 = mul_product - * r10 = mulxuu_product - * r11 = original multiplier - * r12 = mulxuu_multiplier - * r14 = loop counter (already initialized) - * r15 = temp - * r16 = 1 - */ - - - /* - * for (count = 32; count > 0; --count) - * { - */ -.Lmultiply_loop: - - /* - * mul_product <<= 1; - * lsb = multiplier & 1; - */ - slli r9, r9, 1 - andi r15, r12, 1 - - /* - * if (lsb == 1) - * { - * mulxuu_product += multiplicand; - * } - */ - beq r15, zero, .Lmulx_skip - add r10, r10, r3 - cmpltu r15, r10, r3 /* Save the carry from the MSB of mulxuu_product. */ - ror r15, r15, r16 /* r15 = 0x80000000 on carry, or else 0x00000000 */ -.Lmulx_skip: - - /* - * if (MSB of mul_multiplier == 1) - * { - * mul_product += multiplicand; - * } - */ - bge r6, zero, .Lmul_skip - add r9, r9, r3 -.Lmul_skip: - - /* - * mulxuu_product >>= 1; logical shift - * mul_multiplier <<= 1; done with MSB - * mulx_multiplier >>= 1; done with LSB - */ - srli r10, r10, 1 - or r10, r10, r15 /* OR in the saved carry bit. */ - slli r6, r6, 1 - srli r12, r12, 1 - - - /* - * } - */ - subi r14, r14, 1 - bne r14, zero, .Lmultiply_loop - - - /* - * Multiply emulation loop done. - */ - - /* Now - * r3 = multiplicand - * r4 = OPX - * r7 = 4 * dest_register (used later as offset to sp) - * r9 = mul_product - * r10 = mulxuu_product - * r11 = original multiplier - * r15 = temp - */ - - - /* - * Select/compute the result based on OPX. - */ - - - /* OPX == mul? Then store. */ - xori r15, r4, 0x27 - beq r15, zero, .Lstore_result - - /* It's one of the mulx.. opcodes. Move over the result. */ - mov r9, r10 - - /* OPX == mulxuu? Then store. */ - xori r15, r4, 0x07 - beq r15, zero, .Lstore_result - - /* Compute mulxsu - * - * mulxsu = mulxuu - ((rA < 0) ? rB : 0); - */ - bge r3, zero, .Lmulxsu_skip - sub r9, r9, r11 -.Lmulxsu_skip: - - /* OPX == mulxsu? Then store. */ - xori r15, r4, 0x17 - beq r15, zero, .Lstore_result - - /* Compute mulxss - * - * mulxss = mulxsu - ((rB < 0) ? rA : 0); - */ - bge r11, zero, .Lmulxss_skip - sub r9, r9, r3 -.Lmulxss_skip: - /* At this point, assume that OPX is mulxss, so store */ - - -.Lstore_result: - add r7, r7, sp - stw r9, 0(r7) - - ldw r16, 0(sp) - ldw r17, 4(sp) - ldw r18, 8(sp) - ldw r19, 12(sp) - ldw r20, 16(sp) - ldw r21, 20(sp) - ldw r22, 24(sp) - ldw r23, 28(sp) - - /* bt @ 32 - Breakpoint register usually isn't an operand. */ - /* et @ 36 - Don't corrupt et. */ - /* gp @ 40 - Don't corrupt gp. */ - /* sp @ 44 - Don't corrupt sp. */ - ldw fp, 48(sp) - /* ea @ 52 - Don't corrupt ea. */ - /* ba @ 56 - Breakpoint register usually isn't an operand. */ - - addi sp, sp, 60 - - br .Lexception_exit - - -.Lnot_muldiv: - - addi sp, sp, 60 - - - .section .exceptions.exit.label -.Lexception_exit: - diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_exception_trap.S b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_exception_trap.S deleted file mode 100644 index 60a3d40..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_exception_trap.S +++ /dev/null @@ -1,81 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - - /* - * This is the trap exception handler for Nios2. - */ - - /* - * Provide a label which can be used to pull this file in. - */ - - .section .exceptions.start - .globl alt_exception_trap -alt_exception_trap: - - /* - * Pull in the entry/exit code. - */ - .globl alt_exception - - .section .exceptions.soft, "xa" - -.Ltrap_handler: - - /* - * Did a trap instruction cause the exception? - * - * The instruction which the exception occurred on has been loaded - * into r2 by code in alt_exception_entry.S - * - */ - - movhi r3,0x003b /* upper half of trap opcode */ - ori r3,r3,0x683a /* lower half of trap opcode */ - bne r2,r3,.Lnot_trap - - /* - * There is no trap handler defined here, and so executing a trap - * instruction causes a software break. If you provide a trap handler, - * then you must replace the break instruction below with your handler. - * Your handler must preserve ea and the usual callee saved registers. - */ - - break - - br .Lexception_exit - -.Lnot_trap: - - - .section .exceptions.exit.label -.Lexception_exit: - - diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_execve.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_execve.c deleted file mode 100644 index 27b99cf..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_execve.c +++ /dev/null @@ -1,55 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "os/alt_syscall.h" - -/* - * execve() is used by newlib to launch new processes. This is unsupported in - * the HAL environment. However a "do-nothing" implementation is still - * provied for newlib compatability. - * - * ALT_EXECVE is mapped onto the execve() system call in alt_syscall.h - */ - -int ALT_EXECVE (char *name, char ** argv, char** env) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(execve); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_exit.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_exit.c deleted file mode 100644 index 971b35e..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_exit.c +++ /dev/null @@ -1,71 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_irq.h" -#include "sys/alt_sim.h" -#include "os/alt_hooks.h" -#include "os/alt_syscall.h" - -#include "alt_types.h" -#include "sys/alt_log_printf.h" -/* - * _exit() is called by exit() in order to terminate the current process. - * Typically this is called when main() completes. It should never return. - * Since there is nowhere to go once this process completes, this - * implementation simply blocks forever. - * - * Note that interrupts are not disabled so that execution outside of this - * thread is allowed to continue. - * - * ALT_EXIT is mapped onto the _exit() system call in alt_syscall.h - */ - -void ALT_EXIT (int exit_code) -{ - /* ALT_LOG - please see HAL/inc/alt_log_printf.h for details */ - ALT_LOG_PRINT_BOOT("[alt_exit.c] Entering _exit() function.\r\n"); - ALT_LOG_PRINT_BOOT("[alt_exit.c] Exit code from main was %d.\r\n",exit_code); - /* Stop all other threads */ - - ALT_LOG_PRINT_BOOT("[alt_exit.c] Calling ALT_OS_STOP().\r\n"); - ALT_OS_STOP(); - - /* Provide notification to the simulator that we've stopped */ - - ALT_LOG_PRINT_BOOT("[alt_exit.c] Calling ALT_SIM_HALT().\r\n"); - ALT_SIM_HALT(exit_code); - - /* spin forever, since there's no where to go back to */ - - ALT_LOG_PRINT_BOOT("[alt_exit.c] Spinning forever.\r\n"); - while (1); -} diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_fcntl.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_fcntl.c deleted file mode 100644 index 69c1544..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_fcntl.c +++ /dev/null @@ -1,101 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include -#include - -#include "sys/alt_errno.h" -#include "priv/alt_file.h" -#include "alt_types.h" -#include "os/alt_syscall.h" - -#define ALT_FCNTL_FLAGS_MASK ((alt_u32) (O_APPEND | O_NONBLOCK)) - -/* - * fcntl() is a limited implementation of the standard fcntl() system call. - * It can be used to change the state of the flags associated with an open - * file descriptor. Normally these flags are set during the call to - * open(). It is anticipated that the main use of this function will be to - * change the state of a device from blocking to non-blocking (where this is - * supported). - * - * The input argument "fd" is the file descriptor to be manipulated. "cmd" - * is the command to execute. This can be either F_GETFL (return the - * current value of the flags) or F_SETFL (set the value of the flags). - * - * If "cmd" is F_SETFL then the argument "arg" is the new value of flags, - * otherwise "arg" is ignored. Only the flags: O_APPEND and O_NONBLOCK - * can be updated by a call to fcntl(). All other flags remain - * unchanged. - * - * ALT_FCNTL is mapped onto the fcntl() system call in alt_syscall.h - */ - -int ALT_FCNTL (int file, int cmd, ...) -{ - alt_fd* fd; - long flags; - va_list argp; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - switch (cmd) - { - case F_GETFL: - return fd->fd_flags & ~((alt_u32) ALT_FD_FLAGS_MASK); - case F_SETFL: - va_start(argp, cmd); - flags = va_arg(argp, long); - fd->fd_flags &= ~ALT_FCNTL_FLAGS_MASK; - fd->fd_flags |= (flags & ALT_FCNTL_FLAGS_MASK); - va_end(argp); - return 0; - default: - ALT_ERRNO = EINVAL; - return -1; - } - } - - ALT_ERRNO = EBADFD; - return -1; -} diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_fd_lock.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_fd_lock.c deleted file mode 100644 index 0e2a85d..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_fd_lock.c +++ /dev/null @@ -1,75 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "priv/alt_file.h" - -/* - * alt_fd_lock() is called as a consequence of an ioctl call to gain exclusive - * access to a device, i.e.: - * - * ioctl (fd, TIOCEXCL, NULL); - * - * If there are no other open file descriptors which reference the same - * device, then alt_fd_lock() will grant the lock. Further calls to open() - * for this device will fail until the lock is released. - * - * This is done by calling close() for this file descriptor, or by calling: - * - * ioctl (fd, TIOCNXCL, NULL); - * - * The return value is zero for success, or negative in the case of failure. - */ - -int alt_fd_lock (alt_fd* fd) -{ - int i; - int rc = 0; - - ALT_SEM_PEND(alt_fd_list_lock, 0); - - for (i = 0; i < alt_max_fd; i++) - { - if ((&alt_fd_list[i] != fd) && (alt_fd_list[i].dev == fd->dev)) - { - rc = -EACCES; - goto alt_fd_lock_exit; - } - } - fd->fd_flags |= ALT_FD_EXCL; - - alt_fd_lock_exit: - - ALT_SEM_POST(alt_fd_list_lock); - return rc; -} diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_fd_unlock.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_fd_unlock.c deleted file mode 100644 index fb700dc..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_fd_unlock.c +++ /dev/null @@ -1,56 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "priv/alt_file.h" - -/* - * alt_fd_unlock() is the inverse of alt_fd_lock(). It is called as a - * consequence of a TIOCNXCL ioctl request, e.g: - * - * ioctl (fd, TIOCNXCL, NULL); - * - * It enables multiple file descriptors to exist for the same device. This - * is normally the case, but it may have been disabled by a previous call to - * alt_fd_lock(). - * - * Return zero on sucess, and a negative value on failure. - * - * The current implementation always succeeds. - */ - -int alt_fd_unlock (alt_fd* fd) -{ - fd->fd_flags &= ~ALT_FD_EXCL; - return 0; -} diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_find_dev.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_find_dev.c deleted file mode 100644 index 37aefa4..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_find_dev.c +++ /dev/null @@ -1,88 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - -#include "alt_types.h" - -/* - * alt_find_dev() is used by open() in order to locate a previously registered - * device with the name "name". The input argument "llist" is a pointer to the - * head of the device list to search. - * - * The return value is a pointer to the matching device, or NULL if there is - * no match. - * - * "name" must be an exact match for the devices registered name for a match to - * be found. - */ - -alt_dev* alt_find_dev(const char* name, alt_llist* llist) -{ - alt_dev* next = (alt_dev*) llist->next; - alt_32 len; - - len = strlen(name) + 1; - - /* - * Check each list entry in turn, until a match is found, or we reach the - * end of the list (i.e. next winds up pointing back to the list head). - */ - - while (next != (alt_dev*) llist) - { - - /* - * memcmp() is used here rather than strcmp() in order to reduce the size - * of the executable. - */ - - if (!memcmp (next->name, name, len)) - { - /* match found */ - - return next; - } - next = (alt_dev*) next->llist.next; - } - - /* No match found */ - - return NULL; -} - - diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_find_file.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_find_file.c deleted file mode 100644 index 2d97ec2..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_find_file.c +++ /dev/null @@ -1,89 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - -#include "alt_types.h" - -/* - * alt_find_file() is used by open() in order to locate a previously registered - * filesystem that owns that mount point that contains the file named "name". - * - * The return value is a pointer to the matching filesystem, or NULL if there is - * no match. - * - * A match is considered to have been found if the filesystem name followed by - * either '/' or '\0' is the prefix of the filename. For example the filename: - * "/myfilesystem/junk.txt" would match: "/myfilesystem", but not: "/myfile". - */ - -alt_dev* alt_find_file (const char* name) -{ - alt_dev* next = (alt_dev*) alt_fs_list.next; - - alt_32 len; - - /* - * Check each list entry in turn, until a match is found, or we reach the - * end of the list (i.e. next winds up pointing back to the list head). - */ - - while (next != (alt_dev*) &alt_fs_list) - { - len = strlen(next->name); - - if (next->name[len-1] == '/') - { - len -= 1; - } - - if (((name[len] == '/') || (name[len] == '\0')) && - !memcmp (next->name, name, len)) - { - /* match found */ - - return next; - } - next = (alt_dev*) next->llist.next; - } - - /* No match found */ - - return NULL; -} - - diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_flash_dev.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_flash_dev.c deleted file mode 100644 index 213f721..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_flash_dev.c +++ /dev/null @@ -1,69 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* Alt_flash.c - Functions to register a flash device to the "generic" flash * -* interface * -* * -* Author PRR * -* * -******************************************************************************/ - -#include -#include "sys/alt_llist.h" -#include "sys/alt_flash_dev.h" -#include "priv/alt_file.h" - -ALT_LLIST_HEAD(alt_flash_dev_list); - -alt_flash_fd* alt_flash_open_dev(const char* name) -{ - alt_flash_dev* dev = (alt_flash_dev*)alt_find_dev(name, &alt_flash_dev_list); - - if ((dev) && dev->open) - { - return dev->open(dev, name); - } - - return dev; -} - -void alt_flash_close_dev(alt_flash_fd* fd) -{ - if (fd && fd->close) - { - fd->close(fd); - } - return; -} - diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_fork.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_fork.c deleted file mode 100644 index ce74df0..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_fork.c +++ /dev/null @@ -1,57 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_warning.h" -#include "sys/alt_errno.h" -#include "os/alt_syscall.h" - -/* - * The fork() system call is used by newlib to create a duplicate copy of the - * curent process. This is unsupported in the HAL environment. However a - * "do-nothing" implementation is still provied for newlib compatability. - * - * ALT_FORK is mapped onto the fork() system call in alt_syscall.h - */ - -int ALT_FORK (void) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(fork); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} - - diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_fs_reg.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_fs_reg.c deleted file mode 100644 index 13437a1..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_fs_reg.c +++ /dev/null @@ -1,75 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - -/* - * The alt_fs_reg() function is used to register a file system. Once registered - * a device can be accessed using the standard posix calls: open(), read(), - * write() etc. - * - * System behaviour is undefined in the event that a file system is registered - * with a name that conflicts with an existing device or file system. - * - * alt_fs_reg() is not thread safe in the sense that there should be no other - * thread using the file system list at the time that alt_dev_reg() is called. In - * practice this means that alt_fs_reg() should only be called while operating - * in a single threaded mode. The expectation is that it will only be called - * by the file system initilisation functions invoked by alt_sys_init(), which in - * turn should only be called by the single threaded C startup code. - * - * A return value of zero indicates success. A negative return value indicates - * failure. - */ - -int alt_fs_reg (alt_dev* dev) -{ - /* - * check that the device has a name. - */ - - if (!dev->name) - { - return -ENODEV; - } - - /* - * register the file system. - */ - - alt_llist_insert(&alt_fs_list, &dev->llist); - - return 0; -} diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_fstat.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_fstat.c deleted file mode 100644 index af5d527..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_fstat.c +++ /dev/null @@ -1,128 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include "sys/alt_dev.h" -#include "sys/alt_warning.h" -#include "sys/alt_errno.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -/* - * The fstat() system call is used to obtain information about the capabilities - * of an open file descriptor. By default file descriptors are marked as - * being character devices. If a device or file system wishes to advertise - * alternative capabilities then they can register an fstat() function within - * their associated alt_dev structure. This will be called to fill in the - * entries in the imput "st" structure. - * - * This function is provided for compatability with newlib. - * - * ALT_FSTAT is mapped onto the fstat() system call in alt_syscall.h - */ - -#ifdef ALT_USE_DIRECT_DRIVERS - -#include "system.h" - -/* - * Provide minimal version that just describes all file descriptors - * as character devices for provided stdio devices. - */ -int ALT_FSTAT (int file, struct stat *st) -{ - switch (file) { -#ifdef ALT_STDIN_PRESENT - case 0: /* stdin file descriptor */ -#endif /* ALT_STDIN_PRESENT */ -#ifdef ALT_STDOUT_PRESENT - case 1: /* stdout file descriptor */ -#endif /* ALT_STDOUT_PRESENT */ -#ifdef ALT_STDERR_PRESENT - case 2: /* stderr file descriptor */ -#endif /* ALT_STDERR_PRESENT */ - st->st_mode = _IFCHR; - return 0; - default: - return -1; - } - -#if !defined(ALT_STDIN_PRESENT) && !defined(ALT_STDOUT_PRESENT) && !defined(ALT_STDERR_PRESENT) - /* Generate a link time warning, should this function ever be called. */ - ALT_STUB_WARNING(fstat); -#endif -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -int ALT_FSTAT (int file, struct stat *st) -{ - alt_fd* fd; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - /* Call the drivers fstat() function to fill out the "st" structure. */ - - if (fd->dev->fstat) - { - return fd->dev->fstat(fd, st); - } - - /* - * If no function is provided, mark the fd as belonging to a character - * device. - */ - - else - { - st->st_mode = _IFCHR; - return 0; - } - } - else - { - ALT_ERRNO = EBADFD; - return -1; - } -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_get_fd.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_get_fd.c deleted file mode 100644 index db17b2c..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_get_fd.c +++ /dev/null @@ -1,105 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - -#include "alt_types.h" - -#include "system.h" - -/* - * alt_get_fd() is called to allocate a new file descriptor from the file - * descriptor pool. If a file descriptor is succesfully allocated, it is - * configured to refer to device "dev". - * - * The return value is the index of the file descriptor structure (i.e. - * the offset of the file descriptor within the file descriptor array). A - * negative value indicates failure. - */ - -int alt_get_fd (alt_dev* dev) -{ - alt_32 i; - int rc = -EMFILE; - - /* - * Take the alt_fd_list_lock semaphore in order to avoid races when - * accessing the file descriptor pool. - */ - - ALT_SEM_PEND(alt_fd_list_lock, 0); - - /* - * Search through the list of file descriptors, and allocate the first - * free descriptor that's found. - * - * If a free descriptor is found, then the value of "alt_max_fd" is - * updated accordingly. "alt_max_fd" is a 'highwater mark' which - * indicates the highest file descriptor ever allocated. This is used to - * improve efficency when searching the file descriptor list, and - * therefore reduce contention on the alt_fd_list_lock semaphore. - */ - - for (i = 0; i < ALT_MAX_FD; i++) - { - if (!alt_fd_list[i].dev) - { - alt_fd_list[i].dev = dev; - if (i > alt_max_fd) - { - alt_max_fd = i; - } - rc = i; - goto alt_get_fd_exit; - } - } - - alt_get_fd_exit: - - /* - * Release the alt_fd_list_lock semaphore now that we are done with the - * file descriptor pool. - */ - - ALT_SEM_POST(alt_fd_list_lock); - - return rc; -} - - - - diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_getchar.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_getchar.c deleted file mode 100644 index a8f50d5..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_getchar.c +++ /dev/null @@ -1,61 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#ifdef ALT_USE_DIRECT_DRIVERS -#include "system.h" -#include "sys/alt_driver.h" -#include "sys/alt_stdio.h" -#include "priv/alt_file.h" -#include "unistd.h" -#endif - -/* - * Uses the ALT_DRIVER_READ() macro to call directly to driver if available. - * Otherwise, uses newlib provided getchar() routine. - */ -int -alt_getchar(void) -{ -#ifdef ALT_USE_DIRECT_DRIVERS - ALT_DRIVER_READ_EXTERNS(ALT_STDIN_DEV); - char c; - - if (ALT_DRIVER_READ(ALT_STDIN_DEV, &c, 1, alt_fd_list[STDIN_FILENO].fd_flags) <= 0) { - return -1; - } - return c; -#else - return getchar(); -#endif -} diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_getpid.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_getpid.c deleted file mode 100644 index 2228c7e..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_getpid.c +++ /dev/null @@ -1,47 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "os/alt_syscall.h" - -/* - * The getpid() system call is used by newlib to obtain the current process - * id. Since there is only ever a single process in the HAL environment, - * this just returns a constant. - * - * ALT_GETPID is mapped onto the getpid() system call in alt_syscall.h - */ - -int ALT_GETPID (void) -{ - return 0; -} - diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_gettod.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_gettod.c deleted file mode 100644 index ed86cba..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_gettod.c +++ /dev/null @@ -1,125 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include - -#include "sys/alt_alarm.h" -#include "alt_types.h" -#include "os/alt_syscall.h" - -/* - * Macro defining the number of micoseconds in a second. - */ - -#define ALT_US (1000000) - -/* - * "alt_timezone" and "alt_resettime" are the values of the the reset time and - * time zone set through the last call to settimeofday(). By default they are - * zero initialised. - */ - -struct timezone alt_timezone = {0, 0}; -struct timeval alt_resettime = {0, 0}; - -/* - * gettimeofday() can be called to obtain a time structure which indicates the - * current "wall clock" time. This is calculated using the elapsed number of - * system clock ticks, and the value of "alt_resettime" and "alt_timezone" set - * through the last call to settimeofday(). - * - * Warning: if this function is called concurrently with a call to - * settimeofday(), the value returned by gettimeofday() will be unreliable. - * - * ALT_GETTIMEOFDAY is mapped onto the gettimeofday() system call in - * alt_syscall.h - */ - - -#if defined (__GNUC__) && (__GNUC__ >= 4) -int ALT_GETTIMEOFDAY (struct timeval *ptimeval, void *ptimezone_vptr) -{ - struct timezone *ptimezone = (struct timezone*)ptimezone_vptr; -#else -int ALT_GETTIMEOFDAY (struct timeval *ptimeval, struct timezone *ptimezone) -{ -#endif - - alt_u32 nticks = alt_nticks (); - alt_u32 tick_rate = alt_ticks_per_second (); - - /* - * Check to see if the system clock is running. This is indicated by a - * non-zero system clock rate. If the system clock is not running, an error - * is generated and the contents of "ptimeval" and "ptimezone" are not - * updated. - */ - - if (tick_rate) - { - ptimeval->tv_sec = alt_resettime.tv_sec + nticks/tick_rate; - ptimeval->tv_usec = alt_resettime.tv_usec + - (alt_u32)(((alt_u64)nticks*(ALT_US/tick_rate))%ALT_US); - - while(ptimeval->tv_usec < 0) { - if (ptimeval->tv_sec <= 0) - { - ptimeval->tv_sec = 0; - ptimeval->tv_usec = 0; - break; - } - else - { - ptimeval->tv_sec--; - ptimeval->tv_usec += ALT_US; - } - } - - while(ptimeval->tv_usec >= ALT_US) { - ptimeval->tv_sec++; - ptimeval->tv_usec -= ALT_US; - } - - if (ptimezone) - { - ptimezone->tz_minuteswest = alt_timezone.tz_minuteswest; - ptimezone->tz_dsttime = alt_timezone.tz_dsttime; - } - - return 0; - } - - return -ENOTSUP; -} - diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_gmon.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_gmon.c deleted file mode 100644 index 6add9f1..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_gmon.c +++ /dev/null @@ -1,272 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include -#include -#include - -#include "priv/nios2_gmon_data.h" - -#include "sys/alt_irq.h" -#include "sys/alt_alarm.h" - - -/* Macros */ - -/* How large should the bins be which we use to generate the histogram */ -#define PCSAMPLE_BYTES_PER_BUCKET 32 - -#define NIOS2_READ_EA(dest) __asm__ ("mov %0, ea" : "=r" (dest)) - -/* The compiler inserts calls to mcount() at the start of - * every function call. The structure mcount_fn_arc records t - * he return address of the function called (in from_pc) - * and the return address of the mcount function - * (in self_pc). The number of times this arc is executed is - * recorded in the field count. - */ -struct mcount_fn_arc -{ - struct mcount_fn_arc * next; - void * from_pc; - unsigned int count; -}; - -/* We need to maintain a list of pointers to the heads of each adjacency - * list so that we can find them when writing out the gmon.out file. Since - * we don't know at the start of program execution how many functions will - * be called we use a list structure to do this. - */ -struct mcount_fn_entry -{ - struct mcount_fn_entry * next; - void * self_pc; - struct mcount_fn_arc * arc_head; -}; - -/* function prototypes */ - -void __mcount_record(void * self_pc, void * from_pc, struct mcount_fn_entry * fn_entry, struct mcount_fn_entry * * fn_head) __attribute__ ((no_instrument_function)); - -static __inline__ void * mcount_allocate(unsigned int size) __attribute__ ((no_instrument_function)); -static int nios2_pcsample_init(void) __attribute__ ((no_instrument_function)); -static alt_u32 nios2_pcsample(void* alarm) __attribute__ ((no_instrument_function)); - -/* global variables */ - -/* stext and etext are defined in the linker script */ -extern char stext[]; -extern char etext[]; - -/* Is the PC sampling stuff enabled yet? */ -static int pcsample_need_init = 1; - -#define HASH_BUCKETS 64 /* Must be a power of 2 */ - -/* This points to the list of adjacency list pointers. */ -struct mcount_fn_entry * __mcount_fn_head[HASH_BUCKETS]; - -/* pointer to the in-memory buffer containing the histogram */ -static unsigned short* s_pcsamples = 0; - -/* the address of the start and end of text section */ -static const unsigned int s_low_pc = (unsigned int)stext; -static const unsigned int s_high_pc = (unsigned int)etext; - -/* the alarm structure to register for pc sampling */ -static alt_alarm s_nios2_pcsample_alarm; - -unsigned int alt_gmon_data[GMON_DATA_SIZE] = -{ - 0x6e6f6d67, /* "gmon" */ - GMON_DATA_SIZE, - 0, - (unsigned int)stext, - (unsigned int)etext, - PCSAMPLE_BYTES_PER_BUCKET, - 0, - (unsigned int)__mcount_fn_head, - (unsigned int)(__mcount_fn_head + HASH_BUCKETS) -}; - -/* This holds the current slab of memory we're allocating out of */ -static char * mcount_slab_ptr = 0; -static int mcount_slab_size = 0; - -#define MCOUNT_SLAB_INCREMENT 1020 - - -/* - * We can't use malloc to allocate memory because that's too complicated, and - * can't be called at interrupt time. Use the lower level allocator instead - * because that's interrupt safe (and because we never free anything). - * - * For speed, we allocate a block of data at once. - */ -static __inline__ void * mcount_allocate(unsigned int size) -{ - void * data; - - if (size > mcount_slab_size) - { - mcount_slab_ptr = sbrk(MCOUNT_SLAB_INCREMENT); - mcount_slab_size = MCOUNT_SLAB_INCREMENT; - } - - data = mcount_slab_ptr; - mcount_slab_ptr += size; - mcount_slab_size -= size; - - return data; -} - - -/* - * Add the arc with the values of frompc and topc given to the graph. - * This function might be called at interrupt time so must be able to - * cope with reentrancy. - * - * The fast case, where we have already allocated a function arc, has been - * handled by the assmebler code. - */ -void __mcount_record(void * self_pc, void * from_pc, struct mcount_fn_entry * fn_entry, struct mcount_fn_entry * * fn_head) -{ - alt_irq_context context; - struct mcount_fn_arc * arc_entry; - - /* Keep trying to start up the PC sampler until it is running. - * (It can't start until the timer is going). - */ - if (pcsample_need_init) - { - pcsample_need_init = 0; - pcsample_need_init = nios2_pcsample_init(); - } - - /* - * We must disable interrupts around the allocation and the list update to - * prevent corruption if the instrumented function is re-entrant. - * - * It's safe for the code above to be stepping through the chain and be - * interrupted by this code modifying it - there is an edge case which will - * leave two copies of the same arc on the list (both with count=1), but - * this is dealt with on the host. - */ - context = alt_irq_disable_all(); - - if (fn_entry == NULL) - { - /* Add it to the list of functions we must output later. */ - fn_entry = (struct mcount_fn_entry *)mcount_allocate(sizeof(struct mcount_fn_entry)); - - fn_entry->self_pc = self_pc; - fn_entry->arc_head = NULL; - - fn_entry->next = *fn_head; - *fn_head = fn_entry; - } - - /* We will need a new list entry - if there was a list entry before - * then the assembler code would have handled it. */ - arc_entry = (struct mcount_fn_arc *)mcount_allocate(sizeof(struct mcount_fn_arc)); - - arc_entry->from_pc = from_pc; - arc_entry->count = 1; - - arc_entry->next = fn_entry->arc_head; - fn_entry->arc_head = arc_entry; - - alt_irq_enable_all(context); -} - - -/* - * nios2_pcsample_init starts profiling. - * It is called the first time mcount is called, and on subsequent calls to - * mcount until it returns zero. It initializes the pc histogram and turns on - * timer driven pc sampling. - */ -static int nios2_pcsample_init(void) -{ - unsigned int pcsamples_size; - - /* We sample the PC every tick */ - unsigned int prof_rate = alt_ticks_per_second(); - if (prof_rate == 0) - return 1; - - /* allocate the histogram buffer s_pcsamples */ - pcsamples_size = (s_high_pc - s_low_pc)/PCSAMPLE_BYTES_PER_BUCKET; - s_pcsamples = (unsigned short*)sbrk(pcsamples_size * sizeof(unsigned short)); - - if (s_pcsamples != 0) - { - /* initialize the buffer to zero */ - memset(s_pcsamples, 0, pcsamples_size * sizeof(unsigned short)); - - alt_gmon_data[GMON_DATA_PROFILE_DATA] = (int)s_pcsamples; - alt_gmon_data[GMON_DATA_PROFILE_RATE] = prof_rate; - - /* Sample every tick (it's cheap) */ - alt_alarm_start(&s_nios2_pcsample_alarm, 1, nios2_pcsample, 0); - } - - return 0; -} - - -/* - * Sample the PC value and store it in the histogram - */ -static alt_u32 nios2_pcsample(void* context) -{ - unsigned int pc; - unsigned int bucket; - - /* read the exception return address - this will be - * inaccurate if there are nested interrupts but we - * assume that this is rare and the inaccuracy will - * not be great */ - NIOS2_READ_EA(pc); - - /* - * If we're within the profilable range then increment the relevant - * bucket in the histogram - */ - if (pc >= s_low_pc && pc < s_high_pc && s_pcsamples != 0) - { - bucket = (pc - s_low_pc)/PCSAMPLE_BYTES_PER_BUCKET; - s_pcsamples[bucket]++; - } - - /* Sample every tick */ - return 1; -} - diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_icache_flush.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_icache_flush.c deleted file mode 100644 index 4b706ed..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_icache_flush.c +++ /dev/null @@ -1,84 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "nios2.h" -#include "system.h" - -#include "alt_types.h" -#include "sys/alt_cache.h" - -/* - * alt_icache_flush() is called to flush the instruction cache for a memory - * region of length "len" bytes, starting at address "start". - */ - -void alt_icache_flush (void* start, alt_u32 len) -{ -#if NIOS2_ICACHE_SIZE > 0 - - char* i; - char* end; - - /* - * This is the most we would ever need to flush. - */ - - if (len > NIOS2_ICACHE_SIZE) - { - len = NIOS2_ICACHE_SIZE; - } - - end = ((char*) start) + len; - - for (i = start; i < end; i+= NIOS2_ICACHE_LINE_SIZE) - { - __asm__ volatile ("flushi %0" :: "r" (i)); - } - - /* - * For an unaligned flush request, we've got one more line left. - * Note that this is dependent on NIOS2_ICACHE_LINE_SIZE to be a - * multiple of 2 (which it always is). - */ - - if (((alt_u32) start) & (NIOS2_ICACHE_LINE_SIZE - 1)) - { - __asm__ volatile ("flushi %0" :: "r" (i)); - } - - /* - * Having flushed the cache, flush any stale instructions in the - * pipeline - */ - - __asm__ volatile ("flushp"); - -#endif /* NIOS2_ICACHE_SIZE > 0 */ -} diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_icache_flush_all.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_icache_flush_all.c deleted file mode 100644 index 5088552..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_icache_flush_all.c +++ /dev/null @@ -1,46 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "nios2.h" -#include "system.h" - -#include "alt_types.h" -#include "sys/alt_cache.h" - -/* - * alt_icache_flush_all() is called to flush the entire instruction cache. - */ - -void alt_icache_flush_all (void) -{ -#if NIOS2_ICACHE_SIZE > 0 - alt_icache_flush (0, NIOS2_ICACHE_SIZE); -#endif -} diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_iic.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_iic.c deleted file mode 100644 index 1db5afa..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_iic.c +++ /dev/null @@ -1,106 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ -#include "system.h" - -/* - * This file implements the HAL Enhanced interrupt API for Nios II processors - * with an internal interrupt controller (IIC). For most routines, this serves - * as a wrapper layer over the legacy interrupt API (which must be used with - * the IIC only). - * - * Use of the enhanced API is recommended so that application and device - * drivers are compatible with a Nios II system configured with an external - * interrupt controller (EIC), or IIC. This will afford maximum portability. - * - * If an EIC is present, the EIC device driver must provide these routines, - * because their operation will be specific to that EIC type. - */ -#ifndef NIOS2_EIC_PRESENT -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - -#include "sys/alt_irq.h" -#include "priv/alt_iic_isr_register.h" -#include "priv/alt_legacy_irq.h" - -/** @Function Description: This function registers an interrupt handler. - * If the function is succesful, then the requested interrupt will be enabled upon - * return. Registering a NULL handler will disable the interrupt. - * @API Type: External - * @param ic_id Ignored. - * @param irq IRQ number - * @return 0 if successful, else error (-1) - */ -int alt_ic_isr_register(alt_u32 ic_id, alt_u32 irq, alt_isr_func isr, - void *isr_context, void *flags) -{ - return alt_iic_isr_register(ic_id, irq, isr, isr_context, flags); -} - -/** @Function Description: This function enables a single interrupt. - * @API Type: External - * @param ic_id Ignored. - * @param irq IRQ number - * @return 0 if successful, else error (-1) - */ -int alt_ic_irq_enable (alt_u32 ic_id, alt_u32 irq) -{ - return alt_irq_enable(irq); -} - -/** @Function Description: This function disables a single interrupt. - * @API Type: External - * @param ic_id Ignored. - * @param irq IRQ number - * @return 0 if successful, else error (-1) - */ -int alt_ic_irq_disable(alt_u32 ic_id, alt_u32 irq) -{ - return alt_irq_disable(irq); -} - -/** @Function Description: This function to determine if corresponding - * interrupt is enabled. - * @API Type: External - * @param ic_id Ignored. - * @param irq IRQ number - * @return Zero if corresponding interrupt is disabled and - * non-zero otherwise. - */ -alt_u32 alt_ic_irq_enabled(alt_u32 ic_id, alt_u32 irq) -{ - alt_u32 irq_enabled; - - NIOS2_READ_IENABLE(irq_enabled); - - return (irq_enabled & (1 << irq)) ? 1: 0; -} - -#endif /* ALT_ENHANCED_INTERRUPT_API_PRESENT */ -#endif /* NIOS2_EIC_PRESENT */ diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_iic_isr_register.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_iic_isr_register.c deleted file mode 100644 index b104395..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_iic_isr_register.c +++ /dev/null @@ -1,104 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ -#include -#include "system.h" - -/* - * Provides an interrupt registry mechanism for the any CPUs internal interrupt - * controller (IIC) when the enhanced interrupt API is active. - */ -#ifndef ALT_CPU_EIC_PRESENT -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - -#include "alt_types.h" -#include "sys/alt_irq.h" -#include "priv/alt_iic_isr_register.h" - -/* - * The header, alt_irq_entry.h, contains the exception entry point, and is - * provided by the processor component. It is included here, so that the code - * will be added to the executable only if alt_irq_register() is present, i.e. - * if no interrupts are registered - there's no need to provide any - * interrupt handling. - */ - -#include "sys/alt_irq_entry.h" - -/* - * The header, alt_irq_table.h contains a table describing which function - * handles each interrupt. - */ - -#include "priv/alt_irq_table.h" - -/** @Function Description: This function registers an interrupt handler. - * If the function is succesful, then the requested interrupt will be enabled - * upon return. Registering a NULL handler will disable the interrupt. - * - * @API Type: External - * @param ic_id Interrupt controller ID - * @param irq IRQ ID number - * @param isr Pointer to interrupt service routine - * @param isr_context Opaque pointer passed to ISR - * @param flags - * @return 0 if successful, else error (-1) - */ -int alt_iic_isr_register(alt_u32 ic_id, alt_u32 irq, alt_isr_func isr, - void *isr_context, void *flags) -{ - int rc = -EINVAL; - int id = irq; /* IRQ interpreted as the interrupt ID. */ - alt_irq_context status; - - if (id < ALT_NIRQ) - { - /* - * interrupts are disabled while the handler tables are updated to ensure - * that an interrupt doesn't occur while the tables are in an inconsistant - * state. - */ - - status = alt_irq_disable_all(); - - alt_irq[id].handler = isr; - alt_irq[id].context = isr_context; - - rc = (isr) ? alt_ic_irq_enable(ic_id, id) : alt_ic_irq_disable(ic_id, id); - - alt_irq_enable_all(status); - } - - return rc; -} - -#endif /* ALT_ENHANCED_INTERRUPT_API_PRESENT */ -#endif /* ALT_CPU_EIC_PRESENT */ diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_instruction_exception_entry.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_instruction_exception_entry.c deleted file mode 100644 index f4f52fc..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_instruction_exception_entry.c +++ /dev/null @@ -1,203 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2008 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ -#include "sys/alt_exceptions.h" -#include "nios2.h" -#include "alt_types.h" -#include "system.h" - -/* - * This file implements support for calling user-registered handlers for - * instruction-generated exceptions. This handler could also be reached - * in the event of a spurious interrupt. - * - * The handler code is optionally enabled through the "Enable - * Instruction-related Exception API" HAL BSP setting, which will - * define the macro below. - */ -#ifdef ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API - -/* Function pointer to exception callback routine */ -alt_exception_result (*alt_instruction_exception_handler) - (alt_exception_cause, alt_u32, alt_u32) = 0x0; - -/* Link entry routine to .exceptions section */ -int alt_instruction_exception_entry (alt_u32 exception_pc) - __attribute__ ((section (".exceptions"))); - -/* - * This is the entry point for instruction-generated exceptions handling. - * This routine will be called by alt_exceptions_entry.S, after it determines - * that an exception could not be handled by handlers that preceed that - * of instruction-generated exceptions (such as interrupts). - * - * For this to function properly, you must register an exception handler - * using alt_instruction_exception_register(). This routine will call - * that handler if it has been registered. Absent a handler, it will - * break break or hang as discussed below. - */ -int alt_instruction_exception_entry (alt_u32 exception_pc) -{ - alt_u32 cause, badaddr; - -/* - * If the processor hardware has the optional EXCEPTIONS & BADADDR registers, - * read them and pass their content to the user handler. These are always - * present if the MMU or MPU is enabled, and optionally for other advanced - * exception types via the "Extra exceptions information" setting in the - * processor (hardware) configuration. - * - * If these registers are not present, the cause field will be set to - * NIOS2_EXCEPTION_CAUSE_NOT_PRESENT. Your handling routine should - * check the validity of the cause argument before proceeding. - */ -#ifdef NIOS2_HAS_EXTRA_EXCEPTION_INFO - /* Get exception cause & "badaddr" */ - NIOS2_READ_EXCEPTION(cause); - cause = ( (cause & NIOS2_EXCEPTION_REG_CAUSE_MASK) >> - NIOS2_EXCEPTION_REG_CAUSE_OFST ); - - NIOS2_READ_BADADDR(badaddr); -#else - cause = NIOS2_EXCEPTION_CAUSE_NOT_PRESENT; - badaddr = 0; -#endif /* NIOS2_HAS_EXTRA_EXCEPTION_INFO */ - - if(alt_instruction_exception_handler) { - /* - * Call handler. Its return value indicates whether the exception-causing - * instruction should be re-issued. The code that called us, - * alt_eceptions_entry.S, will look at this value and adjust the ea - * register as necessary - */ - return alt_instruction_exception_handler(cause, exception_pc, badaddr); - } - /* - * We got here because an instruction-generated exception occured, but no - * handler is present. We do not presume to know how to handle it. If the - * debugger is present, break, otherwise hang. - * - * If you've reached here in the debugger, consider examining the - * EXCEPTIONS register cause bit-field, which was read into the 'cause' - * variable above, and compare it against the exceptions-type enumeration - * in alt_exceptions.h. This register is availabe if the MMU or MPU is - * present, or if the "Extra exceptions information" hardware option is - * selected. - * - * If you get here then one of the following could have happened: - * - * - An instruction-generated exception occured, and the processor - * does not have the extra exceptions feature enabled, or you - * have not registered a handler using - * alt_instruction_exception_register() - * - * Some examples of instruction-generated exceptions and why they - * might occur: - * - * - Your program could have been compiled for a full-featured - * Nios II core, but it is running on a smaller core, and - * instruction emulation has been disabled by defining - * ALT_NO_INSTRUCTION_EMULATION. - * - * You can work around the problem by re-enabling instruction - * emulation, or you can figure out why your program is being - * compiled for a system other than the one that it is running on. - * - * - Your program has executed a trap instruction, but has not - * implemented a handler for this instruction. - * - * - Your program has executed an illegal instruction (one which is - * not defined in the instruction set). - * - * - Your processor includes an MMU or MPU, and you have enabled it - * before registering an exception handler to service exceptions it - * generates. - * - * The problem could also be hardware related: - * - If your hardware is broken and is generating spurious interrupts - * (a peripheral which negates its interrupt output before its - * interrupt handler has been executed will cause spurious interrupts) - */ - else { -#ifdef NIOS2_HAS_DEBUG_STUB - NIOS2_BREAK(); -#else - while(1) - ; -#endif /* NIOS2_HAS_DEBUG_STUB */ - } - - /* // We should not get here. Remove compiler warning. */ - return NIOS2_EXCEPTION_RETURN_REISSUE_INST; -} - -#endif /* ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API */ - -/* - * This routine indicates whether a particular exception cause will have - * set a valid address into the BADADDR register, which is included - * in the arguments to a user-registered instruction-generated exception - * handler. Many exception types do not set valid contents in BADADDR; - * this is a convenience routine to easily test the validity of that - * argument in your handler. - * - * Note that this routine will return false (0) for cause '12', - * TLB miss. This is because there are four exception types that - * share that cause, two of which do not have a valid BADADDR. You - * must determine BADADDR's validity for these. - * - * Arguments: - * cause: The 5-bit exception cause field of the EXCEPTIONS register, - * shifted to the LSB position. You may pass the 'cause' argument - * in a handler you registered directy to this routine. - * - * Return: 1: BADADDR (bad_addr argument to handler) is valid - * 0: BADADDR is not valid - */ -int alt_exception_cause_generated_bad_addr(alt_exception_cause cause) -{ - switch (cause) { - case NIOS2_EXCEPTION_SUPERVISOR_ONLY_DATA_ADDR: - return 1; - case NIOS2_EXCEPTION_MISALIGNED_DATA_ADDR: - return 1; - case NIOS2_EXCEPTION_MISALIGNED_TARGET_PC: - return 1; - case NIOS2_EXCEPTION_TLB_READ_PERM_VIOLATION: - return 1; - case NIOS2_EXCEPTION_TLB_WRITE_PERM_VIOLATION: - return 1; - case NIOS2_EXCEPTION_MPU_DATA_REGION_VIOLATION: - return 1; - default: - return 0; - } -} diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_instruction_exception_register.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_instruction_exception_register.c deleted file mode 100644 index b059e1d..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_instruction_exception_register.c +++ /dev/null @@ -1,82 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2008 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ -#include "sys/alt_exceptions.h" -#include "alt_types.h" -#include "system.h" - -/* - * This file implements support for calling user-registered handlers for - * instruction-generated exceptions. - * - * The registry API is optionally enabled through the "Enable - * Instruction-related Exception API" HAL BSP setting, which will - * define the macro below. - */ -#ifdef ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API - -/* - * The header, alt_exception_handler_registry.h contains a struct describing - * the registered exception handler - */ -#include "priv/alt_exception_handler_registry.h" - -/* - * Pull in the exception entry assembly code. This will not be linked in - * unless this object is linked into the executable (i.e. only if - * alt_instruction_exception_register() is called). - */ -__asm__( "\n\t.globl alt_exception" ); - -/* - * alt_instruction_exception_register() is called to register a handler to - * service instruction-generated exceptions that are not handled by the - * default exception handler code (interrupts, and optionally unimplemented - * instructions and traps). - * - * Passing null (0x0) in the handler argument will disable a previously- - * registered handler. - * - * Note that if no handler is registered, exceptions that are not processed - * using the built-in handler (interrupts, and optionally unimplemented - * instructions and traps) are treated as unknown exceptions, resulting - * in either a break or an infinite loop. - */ -void alt_instruction_exception_register ( - alt_exception_result (*exception_handler)( - alt_exception_cause cause, - alt_u32 exception_pc, - alt_u32 bad_addr) ) -{ - alt_instruction_exception_handler = exception_handler; -} - -#endif /* ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API */ diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_io_redirect.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_io_redirect.c deleted file mode 100644 index 8c862f7..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_io_redirect.c +++ /dev/null @@ -1,98 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include -#include - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - - -/* - * alt_open_fd() is similar to open() in that it is used to obtain a file - * descriptor for the file named "name". The "flags" and "mode" arguments are - * identical to the "flags" and "mode" arguments of open(). - * - * The distinction between the two functions is that the file descriptor - * structure to use is passed in as an argument, rather than allocated from the - * list of free file descriptors. - * - * This is used by alt_io_redirect() to redirect the stdin, stdout and stderr - * file descriptors to point to new devices. - * - * If the device can not be succesfully opened, then the input file descriptor - * remains unchanged. - */ - -static void alt_open_fd(alt_fd* fd, const char* name, int flags, int mode) -{ - int old; - - old = open (name, flags, mode); - - if (old >= 0) - { - fd->dev = alt_fd_list[old].dev; - fd->priv = alt_fd_list[old].priv; - fd->fd_flags = alt_fd_list[old].fd_flags; - - alt_release_fd (old); - } -} - -/* - * alt_io_redirect() is called once the device/filesystem lists have been - * initialised, but before main(). Its function is to redirect standard in, - * standard out and standard error so that they point to the devices selected by - * the user (as defined in system.h). - * - * Prior to the call to this function, io is directed towards /dev/null. If - * i/o can not be redirected to the requested device, for example if the device - * does not exist, then it remains directed at /dev/null. - */ - -void alt_io_redirect(const char* stdout_dev, - const char* stdin_dev, - const char* stderr_dev) -{ - /* Redirect the channels */ - - alt_open_fd (&alt_fd_list[STDOUT_FILENO], stdout_dev, O_WRONLY, 0777); - alt_open_fd (&alt_fd_list[STDIN_FILENO], stdin_dev, O_RDONLY, 0777); - alt_open_fd (&alt_fd_list[STDERR_FILENO], stderr_dev, O_WRONLY, 0777); -} - - - - diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_ioctl.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_ioctl.c deleted file mode 100644 index f5d7ef1..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_ioctl.c +++ /dev/null @@ -1,170 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "sys/ioctl.h" -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -/* - * The ioctl() system call is provided so that application code can manipulate - * the i/o capabilities of a device in device specific ways. This is identical - * to the standard posix ioctl() function. - * - * In general this implementation simply vectors ioctl requests to the - * apropriate drivers ioctl function (as registered in the drivers alt_dev - * structure). - * - * However in the case of devices (as oposed to filesystem), the TIOCEXCL and - * TIOCNXCL requests are handled without reference to the driver. These - * requests are used to lock/release a device for exclusive access. - * - * Handling these requests centrally eases the task of device driver - * development. - * - * ALT_IOCTL is mapped onto the ioctl() system call in alt_syscall.h - */ - -#ifdef ALT_USE_DIRECT_DRIVERS - -#include "system.h" -#include "sys/alt_driver.h" - -/* - * Provide minimal version that calls ioctl routine of provided stdio devices. - */ -int ALT_IOCTL (int file, int req, void* arg) -{ -#ifdef ALT_STDIN_PRESENT - ALT_DRIVER_IOCTL_EXTERNS(ALT_STDIN_DEV); -#endif -#ifdef ALT_STDOUT_PRESENT - ALT_DRIVER_IOCTL_EXTERNS(ALT_STDOUT_DEV); -#endif -#ifdef ALT_STDERR_PRESENT - ALT_DRIVER_IOCTL_EXTERNS(ALT_STDERR_DEV); -#endif - -#if !defined(ALT_STDIN_PRESENT) && !defined(ALT_STDOUT_PRESENT) && !defined(ALT_STDERR_PRESENT) - /* Generate a link time warning, should this function ever be called. */ - ALT_STUB_WARNING(ioctl); -#endif - - switch (file) { -#ifdef ALT_STDIN_PRESENT - case 0: /* stdin file descriptor */ - return ALT_DRIVER_IOCTL(ALT_STDIN_DEV, req, arg); -#endif /* ALT_STDIN_PRESENT */ -#ifdef ALT_STDOUT_PRESENT - case 1: /* stdout file descriptor */ - return ALT_DRIVER_IOCTL(ALT_STDOUT_DEV, req, arg); -#endif /* ALT_STDOUT_PRESENT */ -#ifdef ALT_STDERR_PRESENT - case 2: /* stderr file descriptor */ - return ALT_DRIVER_IOCTL(ALT_STDERR_DEV, req, arg); -#endif /* ALT_STDERR_PRESENT */ - default: - ALT_ERRNO = EBADFD; - return -1; - } -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -int ALT_IOCTL (int file, int req, void* arg) -{ - alt_fd* fd; - int rc; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - - /* - * In the case of device drivers (not file systems) handle the TIOCEXCL - * and TIOCNXCL requests as special cases. - */ - - if (fd->fd_flags & ALT_FD_DEV) - { - if (req == TIOCEXCL) - { - rc = alt_fd_lock (fd); - goto ioctl_done; - } - else if (req == TIOCNXCL) - { - rc = alt_fd_unlock (fd); - goto ioctl_done; - } - } - - /* - * If the driver provides an ioctl() function, call that to handle the - * request, otherwise set the return code to indicate that the request - * could not be processed. - */ - - if (fd->dev->ioctl) - { - rc = fd->dev->ioctl(fd, req, arg); - } - else - { - rc = -ENOTTY; - } - } - else - { - rc = -EBADFD; - } - -ioctl_done: - - if (rc < 0) - { - ALT_ERRNO = -rc; - } - return rc; -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_irq_entry.S b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_irq_entry.S deleted file mode 100644 index d3efe7d..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_irq_entry.S +++ /dev/null @@ -1,108 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "system.h" - -/* - * This is the interrupt exception entry point code, which saves all the - * registers and calls the interrupt handler. It should be pulled in using - * a .globl from alt_irq_register.c. This scheme is used so that if an - * interrupt is never registered, then this code will not appear in the - * generated executable, thereby improving code footprint. - */ - - /* - * Explicitly allow the use of r1 (the assembler temporary register) - * within this code. This register is normally reserved for the use of - * the compiler. - */ - .set noat - - /* - * Pull in the exception handler register save code. - */ - .globl alt_exception - - .globl alt_irq_entry - .section .exceptions.entry.label, "xa" -alt_irq_entry: - - /* - * Section .exceptions.entry is in alt_exception_entry.S - * This saves all the caller saved registers and reads estatus into r5 - */ - - .section .exceptions.irqtest, "xa" - -#ifdef ALT_CI_INTERRUPT_VECTOR_N - /* - * Use the interrupt vector custom instruction if present to accelerate - * this code. - * If the interrupt vector custom instruction returns a negative - * value, there are no interrupts active (estatus.pie is 0 - * or ipending is 0) so assume it is a software exception. - */ - custom ALT_CI_INTERRUPT_VECTOR_N, r4, r0, r0 - blt r4, r0, .Lnot_irq -#else - /* - * Test to see if the exception was a software exception or caused - * by an external interrupt, and vector accordingly. - */ - rdctl r4, ipending - andi r2, r5, 1 - beq r2, zero, .Lnot_irq - beq r4, zero, .Lnot_irq -#endif /* ALT_CI_INTERRUPT_VECTOR_N */ - - .section .exceptions.irqhandler, "xa" - /* - * Now that all necessary registers have been preserved, call - * alt_irq_handler() to process the interrupts. - */ - - call alt_irq_handler - - .section .exceptions.irqreturn, "xa" - - br .Lexception_exit - - .section .exceptions.notirq.label, "xa" - -.Lnot_irq: - - /* - * Section .exceptions.exit is in alt_exception_entry.S - * This restores all the caller saved registers - */ - - .section .exceptions.exit.label -.Lexception_exit: - diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_irq_handler.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_irq_handler.c deleted file mode 100644 index 3253d02..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_irq_handler.c +++ /dev/null @@ -1,169 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include "system.h" - -/* - * This interrupt handler only works with an internal interrupt controller - * (IIC). Processors with an external interrupt controller (EIC) use an - * implementation provided by an EIC driver. - */ -#ifndef ALT_CPU_EIC_PRESENT - -#include "sys/alt_irq.h" -#include "os/alt_hooks.h" - -#include "alt_types.h" - -/* - * A table describing each interrupt handler. The index into the array is the - * interrupt id associated with the handler. - * - * When an interrupt occurs, the associated handler is called with - * the argument stored in the context member. - */ -struct ALT_IRQ_HANDLER -{ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - void (*handler)(void*); -#else - void (*handler)(void*, alt_u32); -#endif - void *context; -} alt_irq[ALT_NIRQ]; - -/* - * alt_irq_handler() is called by the interrupt exception handler in order to - * process any outstanding interrupts. - * - * It is defined here since it is linked in using weak linkage. - * This means that if there is never a call to alt_irq_register() (above) then - * this function will not get linked in to the executable. This is acceptable - * since if no handler is ever registered, then an interrupt can never occur. - * - * If Nios II interrupt vector custom instruction exists, use it to accelerate - * the dispatch of interrupt handlers. The Nios II interrupt vector custom - * instruction is present if the macro ALT_CI_INTERRUPT_VECTOR defined. - */ - -void alt_irq_handler (void) __attribute__ ((section (".exceptions"))); -void alt_irq_handler (void) -{ -#ifdef ALT_CI_INTERRUPT_VECTOR - alt_32 offset; - char* alt_irq_base = (char*)alt_irq; -#else - alt_u32 active; - alt_u32 mask; - alt_u32 i; -#endif /* ALT_CI_INTERRUPT_VECTOR */ - - /* - * Notify the operating system that we are at interrupt level. - */ - - ALT_OS_INT_ENTER(); - -#ifdef ALT_CI_INTERRUPT_VECTOR - /* - * Call the interrupt vector custom instruction using the - * ALT_CI_INTERRUPT_VECTOR macro. - * It returns the offset into the vector table of the lowest-valued pending - * interrupt (corresponds to highest priority) or a negative value if none. - * The custom instruction assumes that each table entry is eight bytes. - */ - while ((offset = ALT_CI_INTERRUPT_VECTOR) >= 0) { - struct ALT_IRQ_HANDLER* handler_entry = - (struct ALT_IRQ_HANDLER*)(alt_irq_base + offset); -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - handler_entry->handler(handler_entry->context); -#else - handler_entry->handler(handler_entry->context, offset >> 3); -#endif - } -#else /* ALT_CI_INTERRUPT_VECTOR */ - /* - * Obtain from the interrupt controller a bit list of pending interrupts, - * and then process the highest priority interrupt. This process loops, - * loading the active interrupt list on each pass until alt_irq_pending() - * return zero. - * - * The maximum interrupt latency for the highest priority interrupt is - * reduced by finding out which interrupts are pending as late as possible. - * Consider the case where the high priority interupt is asserted during - * the interrupt entry sequence for a lower priority interrupt to see why - * this is the case. - */ - - active = alt_irq_pending (); - - do - { - i = 0; - mask = 1; - - /* - * Test each bit in turn looking for an active interrupt. Once one is - * found, the interrupt handler asigned by a call to alt_irq_register() is - * called to clear the interrupt condition. - */ - - do - { - if (active & mask) - { -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - alt_irq[i].handler(alt_irq[i].context); -#else - alt_irq[i].handler(alt_irq[i].context, i); -#endif - break; - } - mask <<= 1; - i++; - - } while (1); - - active = alt_irq_pending (); - - } while (active); -#endif /* ALT_CI_INTERRUPT_VECTOR */ - - /* - * Notify the operating system that interrupt processing is complete. - */ - - ALT_OS_INT_EXIT(); -} - -#endif /* ALT_CPU_EIC_PRESENT */ diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_irq_register.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_irq_register.c deleted file mode 100644 index b5ea474..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_irq_register.c +++ /dev/null @@ -1,102 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ -#include -#include "system.h" - -/* - * This interrupt registry mechanism works with the Nios II internal interrupt - * controller (IIC) only. Systems with an external interrupt controller (EIC), - * or those with the IIC who are using the enhanced interrupt API will - * utilize the alt_ic_isr_register() routine to register an interrupt. - */ -#ifndef NIOS2_EIC_PRESENT - -#include "sys/alt_irq.h" -#include "priv/alt_legacy_irq.h" -#include "os/alt_hooks.h" - -#include "alt_types.h" - -/* - * The header, alt_irq_entry.h, contains the exception entry point, and is - * provided by the processor component. It is included here, so that the code - * will be added to the executable only if alt_irq_register() is present, i.e. - * if no interrupts are registered - there's no need to provide any - * interrupt handling. - */ - -#include "sys/alt_irq_entry.h" - -/* - * The header, alt_irq_table.h contains a table describing which function - * handles each interrupt. - */ - -#include "priv/alt_irq_table.h" - -/* - * alt_irq_handler() is called to register an interrupt handler. If the - * function is succesful, then the requested interrupt will be enabled upon - * return. Registering a NULL handler will disable the interrupt. - * - * The return value is 0 if the interrupt handler was registered and the - * interrupt was enabled, otherwise it is negative. - */ - -int alt_irq_register (alt_u32 id, - void* context, - alt_isr_func handler) -{ - int rc = -EINVAL; - alt_irq_context status; - - if (id < ALT_NIRQ) - { - /* - * interrupts are disabled while the handler tables are updated to ensure - * that an interrupt doesn't occur while the tables are in an inconsistant - * state. - */ - - status = alt_irq_disable_all (); - - alt_irq[id].handler = handler; - alt_irq[id].context = context; - - rc = (handler) ? alt_irq_enable (id): alt_irq_disable (id); - - alt_irq_enable_all(status); - } - return rc; -} -#endif /* NIOS2_EIC_PRESENT */ - diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_irq_vars.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_irq_vars.c deleted file mode 100644 index 8c0a18d..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_irq_vars.c +++ /dev/null @@ -1,47 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "alt_types.h" - -#include "system.h" - -/* - * These global variables are used to save the current list of enabled - * interrupts. See alt_irq.h for further details. - */ - -volatile alt_u32 alt_irq_active = 0; - -#ifndef ALT_EXCEPTION_STACK - -volatile alt_u32 alt_priority_mask = (alt_u32) -1; - -#endif - diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_isatty.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_isatty.c deleted file mode 100644 index 9276472..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_isatty.c +++ /dev/null @@ -1,125 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include "sys/alt_dev.h" -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -#ifdef ALT_USE_DIRECT_DRIVERS - -#include "system.h" - -/* - * Provide minimal version that just describes all file descriptors - * as tty devices for provided stdio devices. - */ -int ALT_ISATTY (int file) -{ - switch (file) { -#ifdef ALT_STDIN_PRESENT - case 0: /* stdin file descriptor */ -#endif /* ALT_STDIN_PRESENT */ -#ifdef ALT_STDOUT_PRESENT - case 1: /* stdout file descriptor */ -#endif /* ALT_STDOUT_PRESENT */ -#ifdef ALT_STDERR_PRESENT - case 2: /* stderr file descriptor */ -#endif /* ALT_STDERR_PRESENT */ - return 1; - default: - return 0; - } - -#if !defined(ALT_STDIN_PRESENT) && !defined(ALT_STDOUT_PRESENT) && !defined(ALT_STDERR_PRESENT) - /* Generate a link time warning, should this function ever be called. */ - ALT_STUB_WARNING(isatty); -#endif -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ -/* - * isatty() can be used to determine whether the input file descriptor "file" - * refers to a terminal device or not. If it is a terminal device then the - * return value is one, otherwise it is zero. - * - * ALT_ISATTY is mapped onto the isatty() system call in alt_syscall.h - */ - -int ALT_ISATTY (int file) -{ - alt_fd* fd; - struct stat stat; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - /* - * If a device driver does not provide an fstat() function, then it is - * treated as a terminal device by default. - */ - - if (!fd->dev->fstat) - { - return 1; - } - - /* - * If a driver does provide an implementation of the fstat() function, then - * this is called so that the device can identify itself. - */ - - else - { - fstat (file, &stat); - return (stat.st_mode == _IFCHR) ? 1 : 0; - } - } - else - { - ALT_ERRNO = EBADFD; - return 0; - } -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_kill.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_kill.c deleted file mode 100644 index 42c2e1d..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_kill.c +++ /dev/null @@ -1,121 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include "sys/alt_errno.h" -#include "os/alt_syscall.h" - - -/* - * kill() is used by newlib in order to send signals to processes. Since there - * is only a single process in the HAL, the only valid values for pid are - * either the current process id, or the broadcast values, i.e. pid must be - * less than or equal to zero. - * - * ALT_KILL is mapped onto the kill() system call in alt_syscall.h - */ - -int ALT_KILL (int pid, int sig) -{ - int status = 0; - - if (pid <= 0) - { - switch (sig) - { - case 0: - - /* The null signal is used to check that a pid is valid. */ - - break; - - case SIGABRT: - case SIGALRM: - case SIGFPE: - case SIGILL: - case SIGKILL: - case SIGPIPE: - case SIGQUIT: - case SIGSEGV: - case SIGTERM: - case SIGUSR1: - case SIGUSR2: - case SIGBUS: - case SIGPOLL: - case SIGPROF: - case SIGSYS: - case SIGTRAP: - case SIGVTALRM: - case SIGXCPU: - case SIGXFSZ: - - /* - * The Posix standard defines the default behaviour for all these signals - * as being eqivalent to a call to _exit(). No mechanism is provided to - * change this behaviour. - */ - - _exit(0); - case SIGCHLD: - case SIGURG: - - /* - * The Posix standard defines these signals to be ignored by default. No - * mechanism is provided to change this behaviour. - */ - - break; - default: - - /* Tried to send an unsupported signal */ - - status = EINVAL; - } - } - - else if (pid > 0) - { - /* Attempted to signal a non-existant process */ - - status = ESRCH; - } - - if (status) - { - ALT_ERRNO = status; - return -1; - } - - return 0; -} diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_link.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_link.c deleted file mode 100644 index d796c59..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_link.c +++ /dev/null @@ -1,56 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_warning.h" -#include "sys/alt_errno.h" -#include "os/alt_syscall.h" - -/* - * link() is used by newlib to create a new link to an existing file. This is - * unsupported in the HAL environment. However a "do-nothing" implementation - * is still provied for newlib compatability. - * - * ALT_LINK is mapped onto the link() system call in alt_syscall.h - */ - -int ALT_LINK ( char *existing, char *new) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(link); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} - diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_load.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_load.c deleted file mode 100644 index ffab4b9..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_load.c +++ /dev/null @@ -1,88 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_load.h" -#include "sys/alt_cache.h" - -/* - * Linker defined symbols. - */ - -extern void __flash_rwdata_start; -extern void __ram_rwdata_start; -extern void __ram_rwdata_end; -extern void __flash_rodata_start; -extern void __ram_rodata_start; -extern void __ram_rodata_end; -extern void __flash_exceptions_start; -extern void __ram_exceptions_start; -extern void __ram_exceptions_end; - -/* - * alt_load() is called when the code is executing from flash. In this case - * there is no bootloader, so this application is responsible for loading to - * RAM any sections that are required. - */ - -void alt_load (void) -{ - /* - * Copy the .rwdata section. - */ - - alt_load_section (&__flash_rwdata_start, - &__ram_rwdata_start, - &__ram_rwdata_end); - - /* - * Copy the exception handler. - */ - - alt_load_section (&__flash_exceptions_start, - &__ram_exceptions_start, - &__ram_exceptions_end); - - /* - * Copy the .rodata section. - */ - - alt_load_section (&__flash_rodata_start, - &__ram_rodata_start, - &__ram_rodata_end); - - /* - * Now ensure that the caches are in synch. - */ - - alt_dcache_flush_all(); - alt_icache_flush_all(); -} diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_log_macro.S b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_log_macro.S deleted file mode 100644 index 499c4ad..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_log_macro.S +++ /dev/null @@ -1,56 +0,0 @@ -/* alt_log_macro.S - * - * Implements the function tx_log_str, called by the assembly macro - * ALT_LOG_PUTS(). The macro will be empty when logging is turned off, - * and this function will not be compiled. When logging is on, - * this function is used to print out the strings defined in the beginning - * of alt_log_printf.c, using port information taken from system.h and - * alt_log_printf.h. - * - * This routine only handles strings, and sends a character into the defined - * output device's output buffer when the device is ready. It's intended for - * debugging purposes, where messages can be set to print out at certain - * points in the boot code to indicate the progress of the program. - * - */ - -#ifndef __ALT_LOG_MACROS__ -#define __ALT_LOG_MACROS__ - -/* define this flag to skip assembly-incompatible parts - * of various include files. */ -#define ALT_ASM_SRC - -#ifdef ALT_LOG_ENABLE // only compile this function if this flag is defined. - - #include "system.h" - #include "sys/alt_log_printf.h" - - .global tx_log_str -tx_log_str: - /* load base uart / jtag uart address into r6 */ - movhi r6, %hiadj(ALT_LOG_PORT_BASE) - addi r6, r6, %lo(ALT_LOG_PORT_BASE) -tx_next_char: - /* if pointer points to null, return - * r4 is the pointer to the str to be printed, set by ALT_LOG_PUTS */ - ldb r7, (r4) - beq r0, r7, end_tx - - /* check device transmit ready */ -wait_tx_ready_loop: - ldwio r5, ALT_LOG_PRINT_REG_OFFSET(r6) - andi r5, r5, ALT_LOG_PRINT_MSK - beq r5, r0, wait_tx_ready_loop - /* write char */ - stwio r7, ALT_LOG_PRINT_TXDATA_REG_OFFSET (r6) - /* advance string pointer */ - addi r4, r4, 1 - br tx_next_char -end_tx: - ret - -#endif - -#endif /* __ALT_LOG_MACROS__ */ - diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_log_printf.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_log_printf.c deleted file mode 100644 index 1f7056d..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_log_printf.c +++ /dev/null @@ -1,479 +0,0 @@ - -/* alt_log_printf.c - * - * This file implements the various C functions used for the - * alt_log logging/debugging print functions. The functions - * sit as is here - the job of hiding them from the compiler - * if logging is disabled is accomplished in the .h file. - * - * All the global variables for alt_log are defined here. - * These include the various flags that turn on additional - * logging options; the strings for assembly printing; and - * other globals needed by different logging options. - * - * There are 4 functions that handle the actual printing: - * alt_log_txchar: Actual function that puts 1 char to UART/JTAG UART. - * alt_log_repchar: Calls alt_log_txchar 'n' times - used by - * alt_log_private_printf for formatting. - * alt_log_private_printf: - * Stripped down implementation of printf - no floats. - * alt_log_printf_proc: - * Wrapper function for private_printf. - * - * The rest of the functions are called by the macros which - * were called by code in the other components. Each function - * is preceded by a comment, about which file it gets called - * in, and what its purpose is. - * - * author: gkwan - */ - -/* skip all code if enable is off */ -#ifdef ALT_LOG_ENABLE - -#include -#include -#include -#ifdef __ALTERA_AVALON_JTAG_UART - #include "altera_avalon_jtag_uart.h" - #include -#endif -#include "sys/alt_log_printf.h" - -/* strings for assembly puts */ -char alt_log_msg_bss[] = "[crt0.S] Clearing BSS \r\n";; -char alt_log_msg_alt_main[] = "[crt0.S] Calling alt_main.\r\n"; -char alt_log_msg_stackpointer[] \ - = "[crt0.S] Setting up stack and global pointers.\r\n"; -char alt_log_msg_cache[] = "[crt0.S] Inst & Data Cache Initialized.\r\n"; -/* char array allocation for alt_write */ -char alt_log_write_buf[ALT_LOG_WRITE_ECHO_LEN+2]; - -/* global variables for all 'on' flags */ - -/* - * The boot message flag is linked into the data (rwdata) section - * because if it is zero, it would otherwise be placed in the bss section. - * alt_log examines this variable before the BSS is cleared in the boot-up - * process. - */ -volatile alt_u32 alt_log_boot_on_flag \ - __attribute__ ((section (".data"))) = ALT_LOG_BOOT_ON_FLAG_SETTING; - -volatile alt_u8 alt_log_write_on_flag = ALT_LOG_WRITE_ON_FLAG_SETTING; - -volatile alt_u8 alt_log_sys_clk_on_flag = ALT_LOG_SYS_CLK_ON_FLAG_SETTING; - -volatile alt_u8 alt_log_jtag_uart_alarm_on_flag = \ - ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING; - -volatile alt_u8 alt_log_jtag_uart_isr_on_flag = \ - ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING; - -volatile alt_u8 alt_log_jtag_uart_startup_info_on_flag = \ - ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING; - -/* Global alarm object for recurrent JTAG UART status printing */ -alt_alarm alt_log_jtag_uart_alarm_1; - -/* Global ints for system clock printing and count */ -volatile int alt_log_sys_clk_count; -volatile int alt_system_clock_in_sec; - -/* enum used by alt_log_private_printf */ -enum -{ - pfState_chars, - pfState_firstFmtChar, - pfState_otherFmtChar -}; - - - - -/* Function to put one char onto the UART/JTAG UART txdata register. */ -void alt_log_txchar(int c,char *base) -{ - /* Wait until the device is ready for a character */ - while((ALT_LOG_PRINT_REG_RD(base) & ALT_LOG_PRINT_MSK) == 0) - ; - /* And pop the character into the register */ - ALT_LOG_PRINT_TXDATA_WR(base,c); -} - - -/* Called by alt_log_private_printf to print out characters repeatedly */ -void alt_log_repchar(char c,int r,int base) -{ - while(r-- > 0) - alt_log_txchar(c,(char*) base); -} - - -/* Stripped down printf function */ -void alt_log_private_printf(const char *fmt,int base,va_list args) - { - const char *w; - char c; - int state; - int fmtLeadingZero = 0; /* init these all to 0 for -W warnings. */ - int fmtLong = 0; - int fmtBeforeDecimal = 0; - int fmtAfterDecimal = 0; - int fmtBase = 0; - int fmtSigned = 0; - int fmtCase = 0; /* For hex format, if 1, A-F, else a-f. */ - - w = fmt; - state = pfState_chars; - - while(0 != (c = *w++)) - { - switch(state) - { - case pfState_chars: - if(c == '%') - { - fmtLeadingZero = 0; - fmtLong = 0; - fmtBase = 10; - fmtSigned = 1; - fmtCase = 0; /* Only %X sets this. */ - fmtBeforeDecimal = -1; - fmtAfterDecimal = -1; - state = pfState_firstFmtChar; - } - else - { - alt_log_txchar(c,(char*)base); - } - break; - - case pfState_firstFmtChar: - if(c == '0') - { - fmtLeadingZero = 1; - state = pfState_otherFmtChar; - } - else if(c == '%') - { - alt_log_txchar(c,(char*)base); - state = pfState_chars; - } - else - { - state = pfState_otherFmtChar; - goto otherFmtChar; - } - break; - - case pfState_otherFmtChar: -otherFmtChar: - if(c == '.') - { - fmtAfterDecimal = 0; - } - else if('0' <= c && c <= '9') - { - c -= '0'; - if(fmtAfterDecimal < 0) /* still before decimal */ - { - if(fmtBeforeDecimal < 0) - { - fmtBeforeDecimal = 0; - } - else - { - fmtBeforeDecimal *= 10; - } - fmtBeforeDecimal += c; - } - else - { - fmtAfterDecimal = (fmtAfterDecimal * 10) + c; - } - } - else if(c == 'l') - { - fmtLong = 1; - } - else /* we're up to the letter which determines type */ - { - switch(c) - { - case 'd': - case 'i': -doIntegerPrint: - { - unsigned long v; - unsigned long p; /* biggest power of fmtBase */ - unsigned long vShrink; /* used to count digits */ - int sign; - int digitCount; - - /* Get the value */ - if(fmtLong) - { - if (fmtSigned) - { - v = va_arg(args,long); - } - else - { - v = va_arg(args,unsigned long); - } - } - else - { - if (fmtSigned) - { - v = va_arg(args,int); - } - else - { - v = va_arg(args,unsigned int); - } - } - - /* Strip sign */ - sign = 0; - /* (assumes sign bit is #31) */ - if( fmtSigned && (v & (0x80000000)) ) - { - v = ~v + 1; - sign = 1; - } - - /* Count digits, and get largest place value */ - vShrink = v; - p = 1; - digitCount = 1; - while( (vShrink = vShrink / fmtBase) > 0 ) - { - digitCount++; - p *= fmtBase; - } - - /* Print leading characters & sign */ - fmtBeforeDecimal -= digitCount; - if(fmtLeadingZero) - { - if(sign) - { - alt_log_txchar('-',(char*)base); - fmtBeforeDecimal--; - } - alt_log_repchar('0',fmtBeforeDecimal,base); - } - else - { - if(sign) - { - fmtBeforeDecimal--; - } - alt_log_repchar(' ',fmtBeforeDecimal,base); - if(sign) - { - alt_log_txchar('-',(char*)base); - } - } - - /* Print numbery parts */ - while(p) - { - unsigned char d; - - d = v / p; - d += '0'; - if(d > '9') - { - d += (fmtCase ? 'A' : 'a') - '0' - 10; - } - alt_log_txchar(d,(char*)base); - - v = v % p; - p = p / fmtBase; - } - } - - state = pfState_chars; - break; - - case 'u': - fmtSigned = 0; - goto doIntegerPrint; - case 'o': - fmtSigned = 0; - fmtBase = 8; - goto doIntegerPrint; - case 'x': - fmtSigned = 0; - fmtBase = 16; - goto doIntegerPrint; - case 'X': - fmtSigned = 0; - fmtBase = 16; - fmtCase = 1; - goto doIntegerPrint; - - case 'c': - alt_log_repchar(' ',fmtBeforeDecimal-1,base); - alt_log_txchar(va_arg(args,int),(char*)base); - break; - - case 's': - { - char *s; - - s = va_arg(args,char *); - alt_log_repchar(' ',fmtBeforeDecimal-strlen(s),base); - - while(*s) - alt_log_txchar(*s++,(char*)base); - } - break; - } /* switch last letter of fmt */ - state=pfState_chars; - } - break; - } /* switch */ - } /* while chars left */ - } /* printf */ - -/* Main logging printf function */ -int alt_log_printf_proc(const char *fmt, ... ) -{ - va_list args; - - va_start (args, fmt); - alt_log_private_printf(fmt,ALT_LOG_PORT_BASE,args); - return (0); -} - -/* Below are the functions called by different macros in various components. */ - -/* If the system has a JTAG_UART, include JTAG_UART debugging functions */ -#ifdef __ALTERA_AVALON_JTAG_UART - -/* The alarm function in altera_avalon_jtag_uart.c. - * This function, when turned on, prints out the status - * of the JTAG UART Control register, every ALT_LOG_JTAG_UART_TICKS. - * If the flag is off, the alarm should never be registered, and this - * function should never run */ -alt_u32 altera_avalon_jtag_uart_report_log(void * context) -{ - if (alt_log_jtag_uart_alarm_on_flag) { - altera_avalon_jtag_uart_state* dev = (altera_avalon_jtag_uart_state*) context; - const char* header="JTAG Alarm:"; - alt_log_jtag_uart_print_control_reg(dev, dev->base, header); - return ALT_LOG_JTAG_UART_TICKS; - } - else - { - /* If flag is not on, return 0 to disable future alarms. - * Should never be here, alarm should not be enabled at all. */ - return 0; - } -} - -void alt_log_jtag_uart_print_control_reg(altera_avalon_jtag_uart_state* dev, int base, const char* header) -{ - unsigned int control, space, ac, wi, ri, we, re; - control = IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base); - space = (control & ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_MSK) >> - ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_OFST; - we= (control & ALTERA_AVALON_JTAG_UART_CONTROL_WE_MSK) >> - ALTERA_AVALON_JTAG_UART_CONTROL_WE_OFST; - re= (control & ALTERA_AVALON_JTAG_UART_CONTROL_RE_MSK) >> - ALTERA_AVALON_JTAG_UART_CONTROL_RE_OFST; - ri= (control & ALTERA_AVALON_JTAG_UART_CONTROL_RI_MSK) >> - ALTERA_AVALON_JTAG_UART_CONTROL_RI_OFST; - wi= (control & ALTERA_AVALON_JTAG_UART_CONTROL_WI_MSK) >> - ALTERA_AVALON_JTAG_UART_CONTROL_WI_OFST; - ac= (control & ALTERA_AVALON_JTAG_UART_CONTROL_AC_MSK) >> - ALTERA_AVALON_JTAG_UART_CONTROL_AC_OFST; - -#ifdef ALTERA_AVALON_JTAG_UART_SMALL - ALT_LOG_PRINTF( - "%s HW FIFO wspace=%d AC=%d WI=%d RI=%d WE=%d RE=%d\r\n", - header,space,ac,wi,ri,we,re); -#else - ALT_LOG_PRINTF( - "%s SW CirBuf = %d, HW FIFO wspace=%d AC=%d WI=%d RI=%d WE=%d RE=%d\r\n", - header,(dev->tx_out-dev->tx_in),space,ac,wi,ri,we,re); -#endif - - return; - -} - -/* In altera_avalon_jtag_uart.c - * Same output as the alarm function above, but this is called in the driver - * init function. Hence, it gives the status of the JTAG UART control register - * right at the initialization of the driver */ -void alt_log_jtag_uart_startup_info(altera_avalon_jtag_uart_state* dev, int base) -{ - const char* header="JTAG Startup Info:"; - alt_log_jtag_uart_print_control_reg(dev, base, header); - return; -} - -/* In altera_avalon_jtag_uart.c - * When turned on, this function will print out the status of the jtag uart - * control register every time there is a jtag uart "almost-empty" interrupt. */ -void alt_log_jtag_uart_isr_proc(int base, altera_avalon_jtag_uart_state* dev) -{ - if (alt_log_jtag_uart_isr_on_flag) { - const char* header="JTAG IRQ:"; - alt_log_jtag_uart_print_control_reg(dev, base, header); - } - return; -} - -#endif /* __ALTERA_AVALON_JTAG_UART */ - -/* In alt_write.c - * When the alt_log_write_on_flag is turned on, this function gets called - * every time alt_write gets called. The first - * ALT_LOG_WRITE_ECHO_LEN characters of every printf command (or any command - * that eventually calls write()) gets echoed to the alt_log output. */ -void alt_log_write(const void *ptr, size_t len) -{ - if (alt_log_write_on_flag) { - int temp_cnt; - int length=(ALT_LOG_WRITE_ECHO_LEN>len) ? len : ALT_LOG_WRITE_ECHO_LEN; - - if (length < 2) return; - - strncpy (alt_log_write_buf,ptr,length); - alt_log_write_buf[length-1]='\n'; - alt_log_write_buf[length]='\r'; - alt_log_write_buf[length+1]='\0'; - - /* Escape Ctrl-D's. If the Ctrl-D gets sent it might kill the terminal - * connection of alt_log. It will get replaced by 'D'. */ - for (temp_cnt=0;temp_cnt < length; temp_cnt++) { - if (alt_log_write_buf[temp_cnt]== 0x4) { - alt_log_write_buf[temp_cnt]='D'; - } - } - ALT_LOG_PRINTF("Write Echo: %s",alt_log_write_buf); - } -} - -/* In altera_avalon_timer_sc - * This function prints out a system clock is alive message - * every ALT_LOG_SYS_CLK_INTERVAL (in ticks). */ -void alt_log_system_clock() -{ - if (alt_log_sys_clk_on_flag) { - alt_log_sys_clk_count++; - if (alt_log_sys_clk_count > ALT_LOG_SYS_CLK_INTERVAL) { - alt_log_sys_clk_count = 0; - ALT_LOG_PRINTF("System Clock On %u\r\n",alt_system_clock_in_sec++); - } - } -} - - -#endif diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_lseek.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_lseek.c deleted file mode 100644 index 7857b0d..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_lseek.c +++ /dev/null @@ -1,117 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -#ifdef ALT_USE_DIRECT_DRIVERS - -off_t ALT_LSEEK (int file, off_t ptr, int dir) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(lseek); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -/* - * lseek() can be called to move the read/write pointer associated with the - * file descriptor "file". This function simply vectors the call to the lseek() - * function provided by the driver associated with the file descriptor. - * - * If the driver does not provide an implementation of lseek() an error is - * indicated. - * - * lseek() corresponds to the standard lseek() function. - * - * ALT_LSEEK is mapped onto the lseek() system call in alt_syscall.h - * - */ - -off_t ALT_LSEEK (int file, off_t ptr, int dir) -{ - alt_fd* fd; - off_t rc = 0; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - /* - * If the device driver provides an implementation of the lseek() function, - * then call that to process the request. - */ - - if (fd->dev->lseek) - { - rc = fd->dev->lseek(fd, ptr, dir); - } - /* - * Otherwise return an error. - */ - - else - { - rc = -ENOTSUP; - } - } - else - { - rc = -EBADFD; - } - - if (rc < 0) - { - ALT_ERRNO = -rc; - rc = -1; - } - - return rc; -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_main.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_main.c deleted file mode 100644 index a96229b..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_main.c +++ /dev/null @@ -1,161 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include -#include -#include -#include - -#include "sys/alt_dev.h" -#include "sys/alt_sys_init.h" -#include "sys/alt_irq.h" -#include "sys/alt_dev.h" - -#include "os/alt_hooks.h" - -#include "priv/alt_file.h" -#include "alt_types.h" - -#include "system.h" - -#include "sys/alt_log_printf.h" - -extern void _do_ctors(void); -extern void _do_dtors(void); - -/* - * Standard arguments for main. By default, no arguments are passed to main. - * However a device driver may choose to configure these arguments by calling - * alt_set_args(). The expectation is that this facility will only be used by - * the iclient/ihost utility. - */ - -int alt_argc = 0; -char** alt_argv = {NULL}; -char** alt_envp = {NULL}; - -/* - * Prototype for the entry point to the users application. - */ - -extern int main (int, char **, char **); - -/* - * alt_main is the C entry point for the HAL. It is called by the assembler - * startup code in the processor specific crt0.S. It is responsible for: - * completing the C runtime configuration; configuring all the - * devices/filesystems/components in the system; and call the entry point for - * the users application, i.e. main(). - */ - -void alt_main (void) -{ -#ifndef ALT_NO_EXIT - int result; -#endif - - /* ALT LOG - please see HAL/sys/alt_log_printf.h for details */ - ALT_LOG_PRINT_BOOT("[alt_main.c] Entering alt_main, calling alt_irq_init.\r\n"); - /* Initialize the interrupt controller. */ - alt_irq_init (NULL); - - /* Initialize the operating system */ - ALT_LOG_PRINT_BOOT("[alt_main.c] Done alt_irq_init, calling alt_os_init.\r\n"); - ALT_OS_INIT(); - - /* - * Initialize the semaphore used to control access to the file descriptor - * list. - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Done OS Init, calling alt_sem_create.\r\n"); - ALT_SEM_CREATE (&alt_fd_list_lock, 1); - - /* Initialize the device drivers/software components. */ - ALT_LOG_PRINT_BOOT("[alt_main.c] Calling alt_sys_init.\r\n"); - alt_sys_init(); - ALT_LOG_PRINT_BOOT("[alt_main.c] Done alt_sys_init.\r\n"); - -#if !defined(ALT_USE_DIRECT_DRIVERS) && (defined(ALT_STDIN_PRESENT) || defined(ALT_STDOUT_PRESENT) || defined(ALT_STDERR_PRESENT)) - - /* - * Redirect stdio to the apropriate devices now that the devices have - * been initialized. This is only done if the user has requested these - * devices be present (not equal to /dev/null) and if direct drivers - * aren't being used. - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Redirecting IO.\r\n"); - alt_io_redirect(ALT_STDOUT, ALT_STDIN, ALT_STDERR); -#endif - -#ifndef ALT_NO_C_PLUS_PLUS - /* - * Call the C++ constructors - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Calling C++ constructors.\r\n"); - _do_ctors (); -#endif /* ALT_NO_C_PLUS_PLUS */ - -#if !defined(ALT_NO_C_PLUS_PLUS) && !defined(ALT_NO_CLEAN_EXIT) && !defined(ALT_NO_EXIT) - /* - * Set the C++ destructors to be called at system shutdown. This is only done - * if a clean exit has been requested (i.e. the exit() function has not been - * redefined as _exit()). This is in the interest of reducing code footprint, - * in that the atexit() overhead is removed when it's not needed. - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Calling atexit.\r\n"); - atexit (_do_dtors); -#endif - - /* - * Finally, call main(). The return code is then passed to a subsequent - * call to exit() unless the application is never supposed to exit. - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Calling main.\r\n"); - -#ifdef ALT_NO_EXIT - main (alt_argc, alt_argv, alt_envp); -#else - result = main (alt_argc, alt_argv, alt_envp); - close(STDOUT_FILENO); - exit (result); -#endif - - ALT_LOG_PRINT_BOOT("[alt_main.c] After main - we should not be here?.\r\n"); -} - diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_malloc_lock.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_malloc_lock.c deleted file mode 100644 index 8c78f46..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_malloc_lock.c +++ /dev/null @@ -1,52 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -/* - * These are the empty malloc lock/unlock stubs required by newlib. These are - * used to make newlib's malloc() function thread safe. The default HAL - * configuration is single threaded, so there is nothing to do here. Note that - * this requires that malloc is never called by an interrupt service routine. - */ - -void __malloc_lock ( struct _reent *_r ) -{ -} - -/* - * - */ - -void __malloc_unlock ( struct _reent *_r ) -{ -} diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_mcount.S b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_mcount.S deleted file mode 100644 index 3837523..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_mcount.S +++ /dev/null @@ -1,198 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2010 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* mcount or _mcount is inserted by GCC before the function prologue of every - * function when a program is compiled for profiling. At the start of mcount, - * we guarantee that: - * ra = self_pc (an address in the function which called mcount) - * r8 = from_pc (an address in the function which called mcount's caller) - * - * Because this is always called at the start of a function we can corrupt - * r2,r3 and r11-r15. We must not corrupt r4-r7 (because they might contain - * function arguments for the instrumented function) or r8 (which holds ra - * for the instrumented function). - */ - - .global __mcount_fn_head - - .global mcount - - /* _mcount is used by gcc4 */ - .global _mcount - -_mcount: -mcount: - /* Use a hash to speed up locating fn_entry. We use bits 5 upwards to choose - * the bucket because bits 1:0 will always be 0, and because the distribution - * of values for bits 4:2 won't be even (aligning on cache line boundaries - * will skew it). Higher bits should be fairly random. - */ - /* fn_head = mcount_fn_head + (((unsigned int)self_pc >> 5) & (HASH_BUCKETS - 1)); */ - - srli r2, ra, 3 - movhi r3, %hiadj(__mcount_fn_head) - addi r3, r3, %lo(__mcount_fn_head) - andi r2, r2, 0xFC - add r11, r2, r3 - - /* The fast case is where we have already allocated a function arc, and so - * also a function pointer. - */ - - /* First find the function being called (using self_pc) */ - mov r10, r11 -0: - ldw r10, 0(r10) - beq r10, zero, .Lnew_arc - ldw r2, 4(r10) - bne r2, ra, 0b - - /* Found a function entry for this PC. Now look for an arc with a matching - * from_pc value. There will always be at least one arc. */ - ldw r3, 8(r10) -0: - ldw r2, 4(r3) - beq r2, r8, .Lfound_arc - ldw r3, 0(r3) - bne r3, zero, 0b - -.Lnew_arc: - addi sp, sp, -24 - -.LCFI0: - stw ra, 0(sp) - stw r4, 4(sp) - stw r5, 8(sp) - stw r6, 12(sp) - stw r7, 16(sp) - stw r8, 20(sp) - -.LCFI1: - /* __mcount_record(orig_ra, orig_r8, fn_entry, *fn_head); */ - mov r4, ra - mov r5, r8 - mov r6, r10 - mov r7, r11 - call __mcount_record - - /* restore registers from the stack */ - ldw ra, 0(sp) - ldw r4, 4(sp) - ldw r5, 8(sp) - ldw r6, 12(sp) - ldw r7, 16(sp) - ldw r8, 20(sp) - - addi sp, sp, 24 - -.LCFI2: - ret - -.Lfound_arc: - /* We've found the correct arc record. Increment the count and return */ - ldw r2, 8(r3) - addi r2, r2, 1 - stw r2, 8(r3) - ret - -.Lmcount_end: - - - -/* - * Dwarf2 debug information for the function. This provides GDB with the - * information it needs to backtrace out of this function. - */ - - .section .debug_frame,"",@progbits -.LCIE: - .4byte 2f - 1f /* Length */ -1: - .4byte 0xffffffff /* CIE id */ - .byte 0x1 /* Version */ - .string "" /* Augmentation */ - .uleb128 0x1 /* Code alignment factor */ - .sleb128 -4 /* Data alignment factor */ - .byte 0x1f /* Return address register */ - - .byte 0xc /* Define CFA */ - .uleb128 0x1b /* Register 27 (sp) */ - .uleb128 0x0 /* Offset 0 */ - - .align 2 /* Padding */ -2: - -.LFDE_mcount: - .4byte 2f - 1f /* Length */ -1: - .4byte .LCIE /* Pointer to CIE */ - .4byte mcount /* Start of table entry */ - .4byte .Lmcount_end - mcount /* Size of table entry */ - - .byte 0x4 /* Advance location */ - .4byte .LCFI0 - mcount /* to .LCFI0 */ - .byte 0xe /* Define CFA offset */ - .uleb128 24 /* to 24 */ - - .byte 0x4 /* Advance location */ - .4byte .LCFI1 - .LCFI0 /* to .LCFI1 */ - .byte 0x9f /* Store ra */ - .uleb128 0x6 /* at CFA-24 */ - .byte 0x84 /* Store r4 */ - .uleb128 0x5 /* at CFA-20 */ - .byte 0x85 /* Store r5 */ - .uleb128 0x4 /* at CFA-16 */ - .byte 0x86 /* Store r6 */ - .uleb128 0x3 /* at CFA-12 */ - .byte 0x87 /* Store r7 */ - .uleb128 0x2 /* at CFA-8 */ - .byte 0x88 /* Store r8 */ - .uleb128 0x1 /* at CFA-4 */ - - .byte 0x4 /* Advance location */ - .4byte .LCFI2 - .LCFI1 /* to .LCFI2 */ - .byte 0xe /* Define CFA offset */ - .uleb128 0 /* to 0 */ - .byte 0x8 /* Same value */ - .uleb128 31 /* for ra */ - .byte 0x8 /* Same value */ - .uleb128 4 /* for r4 */ - .byte 0x8 /* Same value */ - .uleb128 5 /* for r5 */ - .byte 0x8 /* Same value */ - .uleb128 6 /* for r6 */ - .byte 0x8 /* Same value */ - .uleb128 7 /* for r7 */ - .byte 0x8 /* Same value */ - .uleb128 8 /* for r8 */ - - .align 2 -2: - diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_open.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_open.c deleted file mode 100644 index 4790f53..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_open.c +++ /dev/null @@ -1,173 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "alt_types.h" -#include "os/alt_syscall.h" - -#ifdef ALT_USE_DIRECT_DRIVERS - -int ALT_OPEN (const char* file, int flags, int mode) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(open); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -extern alt_llist alt_dev_list; - -/* - * alt_file_locked() is used by open() to ensure that a device has not been - * previously locked for exclusive access using ioctl(). This test is only - * performed for devices. Filesystems are required to handle the ioctl() call - * themselves, and report the error from the filesystems open() function. - */ - -static int alt_file_locked (alt_fd* fd) -{ - alt_u32 i; - - /* - * Mark the file descriptor as belonging to a device. - */ - - fd->fd_flags |= ALT_FD_DEV; - - /* - * Loop through all current file descriptors searching for one that's locked - * for exclusive access. If a match is found, generate an error. - */ - - for (i = 0; i <= alt_max_fd; i++) - { - if ((alt_fd_list[i].dev == fd->dev) && - (alt_fd_list[i].fd_flags & ALT_FD_EXCL) && - (&alt_fd_list[i] != fd)) - { - return -EACCES; - } - } - - /* The device is not locked */ - - return 0; -} - -/* - * open() is called in order to get a file descriptor that reference the file - * or device named "name". This descriptor can then be used to manipulate the - * file/device using the standard system calls, e.g. write(), read(), ioctl() - * etc. - * - * This is equivalent to the standard open() system call. - * - * ALT_OPEN is mapped onto the open() system call in alt_syscall.h - */ - -int ALT_OPEN (const char* file, int flags, int mode) -{ - alt_dev* dev; - alt_fd* fd; - int index = -1; - int status = -ENODEV; - int isafs = 0; - - /* - * Check the device list, to see if a device with a matching name is - * registered. - */ - - if (!(dev = alt_find_dev (file, &alt_dev_list))) - { - /* No matching device, so try the filesystem list */ - - dev = alt_find_file (file); - isafs = 1; - } - - /* - * If a matching device or filesystem is found, allocate a file descriptor. - */ - - if (dev) - { - if ((index = alt_get_fd (dev)) < 0) - { - status = index; - } - else - { - fd = &alt_fd_list[index]; - fd->fd_flags = (flags & ~ALT_FD_FLAGS_MASK); - - /* If this is a device, ensure it isn't already locked */ - - if (isafs || ((status = alt_file_locked (fd)) >= 0)) - { - /* - * If the device or filesystem provides an open() callback function, - * call it now to perform any device/filesystem specific operations. - */ - - status = (dev->open) ? dev->open(fd, file, flags, mode): 0; - } - } - } - else - { - status = -ENODEV; - } - - /* Allocation failed, so clean up and return an error */ - - if (status < 0) - { - alt_release_fd (index); - ALT_ERRNO = -status; - return -1; - } - - /* return the reference upon success */ - - return index; -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_printf.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_printf.c deleted file mode 100644 index e742b57..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_printf.c +++ /dev/null @@ -1,127 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/* - * This file provides a very minimal printf implementation for use with very - * small applications. Only the following format strings are supported: - * %x - * %s - * %c - * %% - */ - -#include -#include "sys/alt_stdio.h" - -/* - * ALT printf function - */ -void -alt_printf(const char* fmt, ... ) -{ - va_list args; - va_start(args, fmt); - const char *w; - char c; - - /* Process format string. */ - w = fmt; - while ((c = *w++) != 0) - { - /* If not a format escape character, just print */ - /* character. Otherwise, process format string. */ - if (c != '%') - { - alt_putchar(c); - } - else - { - /* Get format character. If none */ - /* available, processing is complete. */ - if ((c = *w++) != 0) - { - if (c == '%') - { - /* Process "%" escape sequence. */ - alt_putchar(c); - } - else if (c == 'c') - { - int v = va_arg(args, int); - alt_putchar(v); - } - else if (c == 'x') - { - /* Process hexadecimal number format. */ - unsigned long v = va_arg(args, unsigned long); - unsigned long digit; - int digit_shift; - - /* If the number value is zero, just print and continue. */ - if (v == 0) - { - alt_putchar('0'); - continue; - } - - /* Find first non-zero digit. */ - digit_shift = 28; - while (!(v & (0xF << digit_shift))) - digit_shift -= 4; - - /* Print digits. */ - for (; digit_shift >= 0; digit_shift -= 4) - { - digit = (v & (0xF << digit_shift)) >> digit_shift; - if (digit <= 9) - c = '0' + digit; - else - c = 'a' + digit - 10; - alt_putchar(c); - } - } - else if (c == 's') - { - /* Process string format. */ - char *s = va_arg(args, char *); - - while(*s) - alt_putchar(*s++); - } - } - else - { - break; - } - } - } -} diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_putchar.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_putchar.c deleted file mode 100644 index badaa02..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_putchar.c +++ /dev/null @@ -1,59 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#ifdef ALT_USE_DIRECT_DRIVERS -#include "system.h" -#include "sys/alt_driver.h" -#include "sys/alt_stdio.h" -#endif - -/* - * Uses the ALT_DRIVER_WRITE() macro to call directly to driver if available. - * Otherwise, uses newlib provided putchar() routine. - */ -int -alt_putchar(int c) -{ -#ifdef ALT_USE_DIRECT_DRIVERS - ALT_DRIVER_WRITE_EXTERNS(ALT_STDOUT_DEV); - char c1 = (char)(c & 0xff); - - if (ALT_DRIVER_WRITE(ALT_STDOUT_DEV, &c1, 1, 0) == -1) { - return -1; - } - return c; -#else - return putchar(c); -#endif -} diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_putstr.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_putstr.c deleted file mode 100644 index 5345945..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_putstr.c +++ /dev/null @@ -1,55 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#ifdef ALT_USE_DIRECT_DRIVERS -#include -#include "system.h" -#include "sys/alt_driver.h" -#include "sys/alt_stdio.h" -#endif - -/* - * Uses the ALT_DRIVER_WRITE() macro to call directly to driver if available. - * Otherwise, uses newlib provided fputs() routine. - */ -int -alt_putstr(const char* str) -{ -#ifdef ALT_USE_DIRECT_DRIVERS - ALT_DRIVER_WRITE_EXTERNS(ALT_STDOUT_DEV); - return ALT_DRIVER_WRITE(ALT_STDOUT_DEV, str, strlen(str), 0); -#else - return fputs(str, stdout); -#endif -} diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_read.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_read.c deleted file mode 100644 index 1c89777..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_read.c +++ /dev/null @@ -1,125 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -/* - * The read() system call is used to read a block of data from a file or device. - * This function simply vectors the request to the device driver associated - * with the input file descriptor "file". - * - * ALT_READ is mapped onto the read() system call in alt_syscall.h - */ - -#ifdef ALT_USE_DIRECT_DRIVERS - -#include "system.h" -#include "sys/alt_driver.h" - -/* - * Provide minimal version that just reads from the stdin device when provided. - */ - -int ALT_READ (int file, void *ptr, size_t len) -{ -#ifdef ALT_STDIN_PRESENT - ALT_DRIVER_READ_EXTERNS(ALT_STDIN_DEV); -#endif - -#if !defined(ALT_STDIN_PRESENT) - /* Generate a link time warning, should this function ever be called. */ - ALT_STUB_WARNING(read); -#endif - - switch (file) { -#ifdef ALT_STDIN_PRESENT - case 0: /* stdin file descriptor */ - return ALT_DRIVER_READ(ALT_STDIN_DEV, ptr, len, 0); -#endif /* ALT_STDIN_PRESENT */ - default: - ALT_ERRNO = EBADFD; - return -1; - } -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -int ALT_READ (int file, void *ptr, size_t len) -{ - alt_fd* fd; - int rval; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - /* - * If the file has not been opened with read access, or if the driver does - * not provide an implementation of read(), generate an error. Otherwise - * call the drivers read() function to process the request. - */ - - if (((fd->fd_flags & O_ACCMODE) != O_WRONLY) && - (fd->dev->read)) - { - if ((rval = fd->dev->read(fd, ptr, len)) < 0) - { - ALT_ERRNO = -rval; - return -1; - } - return rval; - } - else - { - ALT_ERRNO = EACCES; - } - } - else - { - ALT_ERRNO = EBADFD; - } - return -1; -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_release_fd.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_release_fd.c deleted file mode 100644 index 84733a7..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_release_fd.c +++ /dev/null @@ -1,54 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - -/* - * alt_release_fd() is called to free an allocated file descriptor. This is - * done by setting the device pointer in the file descriptor structure to zero. - * - * File descriptors correcponding to standard in, standard out and standard - * error cannont be released backed to the pool. They are always reserved. - */ - -void alt_release_fd (int fd) -{ - if (fd > 2) - { - alt_fd_list[fd].fd_flags = 0; - alt_fd_list[fd].dev = 0; - } -} - - - diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_remap_cached.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_remap_cached.c deleted file mode 100644 index f61cb9c..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_remap_cached.c +++ /dev/null @@ -1,50 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003,2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "sys/alt_cache.h" -#include "system.h" - -#ifdef NIOS2_MMU_PRESENT -/* Convert KERNEL region address to IO region address */ -#define BYPASS_DCACHE_MASK (0x1 << 29) -#else -/* Set bit 31 of address to bypass D-cache */ -#define BYPASS_DCACHE_MASK (0x1 << 31) -#endif - -/* - * Convert a pointer to a block of uncached memory, into a block of - * cached memory. - */ - -void* alt_remap_cached (volatile void* ptr, alt_u32 len) -{ - return (void*) (((alt_u32) ptr) & ~BYPASS_DCACHE_MASK); -} diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_remap_uncached.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_remap_uncached.c deleted file mode 100644 index 7ff6302..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_remap_uncached.c +++ /dev/null @@ -1,51 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003,2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "sys/alt_cache.h" -#include "system.h" - -#ifdef NIOS2_MMU_PRESENT -/* Convert KERNEL region address to IO region address */ -#define BYPASS_DCACHE_MASK (0x1 << 29) -#else -/* Set bit 31 of address to bypass D-cache */ -#define BYPASS_DCACHE_MASK (0x1 << 31) -#endif - -/* - * Convert a pointer to a block of cached memory, into a block of - * uncached memory. - */ - -volatile void* alt_remap_uncached (void* ptr, alt_u32 len) -{ - alt_dcache_flush (ptr, len); - return (volatile void*) (((alt_u32) ptr) | BYPASS_DCACHE_MASK); -} diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_rename.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_rename.c deleted file mode 100644 index 48afac0..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_rename.c +++ /dev/null @@ -1,55 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "os/alt_syscall.h" - -/* - * _rename() is used by newlib to rename an existing file. This is unsupported - * in the HAL environment. However a "do-nothing" implementation is still - * provied for newlib compatability. - * - * ALT_RENAME is mapped onto the _rename() system call in alt_syscall.h - */ - -int ALT_RENAME (char *existing, char *new) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(_rename); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_sbrk.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_sbrk.c deleted file mode 100644 index b8c3799..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_sbrk.c +++ /dev/null @@ -1,136 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "os/alt_syscall.h" - -#include "sys/alt_irq.h" -#include "sys/alt_stack.h" - -#include "system.h" - -/* - * sbrk() is called to dynamically extend the data segment for the application. - * Thie input argument "incr" is the size of the block to allocate. - * - * This simple implementation does not perform any bounds checking. Memory will - * be allocated, even if the request region colides with the stack or overflows - * the available physical memory. - * - * ALT_SBRK is mapped onto the sbrk() system call in alt_syscall.h - * - * This function is called by the profiling code to allocate memory so must be - * safe if called from an interrupt context. It must also not be instrumented - * because that would lead to an infinate loop. - */ - -extern char __alt_heap_start[]; /* set by linker */ -extern char __alt_heap_limit[]; /* set by linker */ - -static char *heap_end = __alt_heap_start; - -#if defined(ALT_EXCEPTION_STACK) && defined(ALT_STACK_CHECK) -char * alt_exception_old_stack_limit = NULL; -#endif - -caddr_t ALT_SBRK (int incr) __attribute__ ((no_instrument_function )); - -caddr_t ALT_SBRK (int incr) -{ - alt_irq_context context; - char *prev_heap_end; - - context = alt_irq_disable_all(); - - /* Always return data aligned on a word boundary */ - heap_end = (char *)(((unsigned int)heap_end + 3) & ~3); - -#ifdef ALT_MAX_HEAP_BYTES - /* - * User specified a maximum heap size. Return -1 if it would - * be exceeded by this sbrk call. - */ - if (((heap_end + incr) - __alt_heap_start) > ALT_MAX_HEAP_BYTES) { - alt_irq_enable_all(context); - return (caddr_t)-1; - } -#else - if ((heap_end + incr) > __alt_heap_limit) { - alt_irq_enable_all(context); - return (caddr_t)-1; - } -#endif - - prev_heap_end = heap_end; - heap_end += incr; - -#ifdef ALT_STACK_CHECK - /* - * If the stack and heap are contiguous then extending the heap reduces the - * space available for the stack. If we are still using the default stack - * then adjust the stack limit to note this, while checking for stack - * pointer overflow. - * If the stack limit isn't pointing at the top of the heap then the code - * is using a different stack so none of this needs to be done. - */ - - if (alt_stack_limit() == prev_heap_end) - { - if (alt_stack_pointer() <= heap_end) - alt_report_stack_overflow(); - - alt_set_stack_limit(heap_end); - } - -#ifdef ALT_EXCEPTION_STACK - /* - * If we are executing from the exception stack then compare against the - * stack we switched away from as well. The exception stack is a fixed - * size so doesn't need to be checked. - */ - - if (alt_exception_old_stack_limit == prev_heap_end) - { - if (alt_exception_old_stack_limit <= heap_end) - alt_report_stack_overflow(); - - alt_exception_old_stack_limit = heap_end; - } -#endif - -#endif - - alt_irq_enable_all(context); - - return (caddr_t) prev_heap_end; -} diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_settod.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_settod.c deleted file mode 100644 index 59db0f8..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_settod.c +++ /dev/null @@ -1,96 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include "sys/alt_errno.h" -#include "sys/alt_alarm.h" -#include "os/alt_syscall.h" - -/* - * "alt_timezone" and "alt_resettime" are the values of the the reset time and - * time zone set through the last call to settimeofday(). By default they are - * zero initialised. - */ - -extern struct timezone alt_timezone; -extern struct timeval alt_resettime; - -/* - * Macro defining the number of micoseconds in a second. - */ - -#define ALT_US (1000000) - - -/* - * settimeofday() can be called to calibrate the system clock, so that - * subsequent calls to gettimeofday() will return the elapsed "wall clock" - * time. - * - * This is done by updating the global structures "alt_resettime" and - * "alt_timezone" so that an immediate call to gettimeofday() would return - * the value specified by "t" and "tz". - * - * Warning: if this function is called concurrently with a call to - * gettimeofday(), the value returned by gettimeofday() will be unreliable. - * - * ALT_SETTIMEOFDAY is mapped onto the settimeofday() system call in - * alt_syscall.h - */ - -int ALT_SETTIMEOFDAY (const struct timeval *t, - const struct timezone *tz) -{ - alt_u32 nticks = alt_nticks (); - alt_u32 tick_rate = alt_ticks_per_second (); - - /* If there is a system clock available, update the current time */ - - if (tick_rate) - { - alt_resettime.tv_sec = t->tv_sec - nticks/tick_rate; - alt_resettime.tv_usec = t->tv_usec - - ((nticks*(ALT_US/tick_rate))%ALT_US); - - alt_timezone.tz_minuteswest = tz->tz_minuteswest; - alt_timezone.tz_dsttime = tz->tz_dsttime; - - return 0; - } - - /* There's no system clock available */ - - ALT_ERRNO = ENOSYS; - return -1; -} diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_software_exception.S b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_software_exception.S deleted file mode 100644 index 2142594..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_software_exception.S +++ /dev/null @@ -1,53 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - - /* - * This file provides the global symbol: software_exception. It is provided to - * support legacy code, and should not be used by new software. - * - * It is used by legacy code to invoke the software exception handler as - * defined by version 1.0 of the Nios II kit. It should only be used when you - * are providing your own interrupt entry point, i.e. you are not using - * alt_irq_entry. - */ - -#include "system.h" - - /* - * Pull in the exception handler. - */ - - .globl alt_exception - - .section .exceptions.entry.label, "xa" - - .globl software_exception - .type software_exception, @function -software_exception: diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_stat.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_stat.c deleted file mode 100644 index 44e207b..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_stat.c +++ /dev/null @@ -1,59 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include -#include - -#include "os/alt_syscall.h" - -/* - * The stat() function is similar to the fstat() function in that it is used to - * obtain status information about a file. Instead of using an open file - * descriptor (like fstat()), stat() takes the name of a file as an input - * argument. - * - * ALT_STAT is mapped onto the stat() system call in alt_syscall.h - */ - -int ALT_STAT (const char *file, struct stat *st) -{ - int fd; - int rc; - - fd = open (file, 0); - rc = fstat (fd, st); - close (fd); - - return rc; -} diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_tick.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_tick.c deleted file mode 100644 index c73488d..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_tick.c +++ /dev/null @@ -1,149 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_irq.h" -#include "sys/alt_alarm.h" -#include "os/alt_hooks.h" -#include "alt_types.h" - -/* - * "_alt_tick_rate" is used to store the value of the system clock frequency - * in ticks per second. It is initialised to zero, which corresponds to there - * being no system clock facility available. - */ - -alt_u32 _alt_tick_rate = 0; - -/* - * "_alt_nticks" is the number of system clock ticks that have elapsed since - * reset. - */ - -volatile alt_u32 _alt_nticks = 0; - -/* - * "alt_alarm_list" is the head of a linked list of registered alarms. This is - * initialised to be an empty list. - */ - -ALT_LLIST_HEAD(alt_alarm_list); - -/* - * alt_alarm_stop() is called to remove an alarm from the list of registered - * alarms. Alternatively an alarm can unregister itself by returning zero when - * the alarm executes. - */ - -void alt_alarm_stop (alt_alarm* alarm) -{ - alt_irq_context irq_context; - - irq_context = alt_irq_disable_all(); - alt_llist_remove (&alarm->llist); - alt_irq_enable_all (irq_context); -} - -/* - * alt_tick() is periodically called by the system clock driver in order to - * process the registered list of alarms. Each alarm is registed with a - * callback interval, and a callback function, "callback". - * - * The return value of the callback function indicates how many ticks are to - * elapse until the next callback. A return value of zero indicates that the - * alarm should be deactivated. - * - * alt_tick() is expected to run at interrupt level. - */ - -void alt_tick (void) -{ - alt_alarm* next; - alt_alarm* alarm = (alt_alarm*) alt_alarm_list.next; - - alt_u32 next_callback; - - /* update the tick counter */ - - _alt_nticks++; - - /* process the registered callbacks */ - - while (alarm != (alt_alarm*) &alt_alarm_list) - { - next = (alt_alarm*) alarm->llist.next; - - /* - * Upon the tick-counter rolling over it is safe to clear the - * roll-over flag; once the flag is cleared this (or subsequnt) - * tick events are enabled to generate an alarm event. - */ - if ((alarm->rollover) && (_alt_nticks == 0)) - { - alarm->rollover = 0; - } - - /* if the alarm period has expired, make the callback */ - if ((alarm->time <= _alt_nticks) && (alarm->rollover == 0)) - { - next_callback = alarm->callback (alarm->context); - - /* deactivate the alarm if the return value is zero */ - - if (next_callback == 0) - { - alt_alarm_stop (alarm); - } - else - { - alarm->time += next_callback; - - /* - * If the desired alarm time causes a roll-over, set the rollover - * flag. This will prevent the subsequent tick event from causing - * an alarm too early. - */ - if(alarm->time < _alt_nticks) - { - alarm->rollover = 1; - } - } - } - alarm = next; - } - - /* - * Update the operating system specific timer facilities. - */ - - ALT_OS_TIME_TICK(); -} - diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_times.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_times.c deleted file mode 100644 index 4dd965d..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_times.c +++ /dev/null @@ -1,71 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "sys/alt_errno.h" -#include "sys/alt_alarm.h" -#include "os/alt_syscall.h" - -/* - * The times() function is used by newlib to obtain elapsed time information. - * The return value is the elapsed time since reset in system clock ticks. Note - * that this is distinct from the strict Posix version of times(), which should - * return the time since: 0 hours, 0 minutes, 0 seconds, January 1, 1970, GMT. - * - * The input structure is filled in with time accounting information. This - * implementation attributes all cpu time to the system. - * - * ALT_TIMES is mapped onto the times() system call in alt_syscall.h - */ - -clock_t ALT_TIMES (struct tms *buf) -{ - clock_t ticks = alt_nticks(); - - /* If there is no system clock present, generate an error */ - - if (!alt_ticks_per_second()) - { - ALT_ERRNO = ENOSYS; - return 0; - } - - /* Otherwise return the elapsed time */ - - buf->tms_utime = 0; - buf->tms_stime = ticks; - buf->tms_cutime = 0; - buf->tms_cstime = 0; - - return ticks; -} diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_uncached_free.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_uncached_free.c deleted file mode 100644 index 6e362ba..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_uncached_free.c +++ /dev/null @@ -1,49 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003,2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "sys/alt_cache.h" -#include "system.h" - -#ifdef NIOS2_MMU_PRESENT -/* Convert KERNEL region address to IO region address */ -#define BYPASS_DCACHE_MASK (0x1 << 29) -#else -/* Set bit 31 of address to bypass D-cache */ -#define BYPASS_DCACHE_MASK (0x1 << 31) -#endif - -/* - * Free a block of uncached memory. - */ - -void alt_uncached_free (volatile void* ptr) -{ - free ((void*) (((alt_u32) ptr) & ~BYPASS_DCACHE_MASK)); -} diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_uncached_malloc.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_uncached_malloc.c deleted file mode 100644 index ab3416d..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_uncached_malloc.c +++ /dev/null @@ -1,55 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003,2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "sys/alt_cache.h" -#include "system.h" - -#ifdef NIOS2_MMU_PRESENT -/* Convert KERNEL region address to IO region address */ -#define BYPASS_DCACHE_MASK (0x1 << 29) -#else -/* Set bit 31 of address to bypass D-cache */ -#define BYPASS_DCACHE_MASK (0x1 << 31) -#endif - -/* - * Allocate a block of uncached memory. - */ - -volatile void* alt_uncached_malloc (size_t size) -{ - void* ptr; - - ptr = malloc (size); - - alt_dcache_flush (ptr, size); - - return ptr ? (volatile void*) (((alt_u32) ptr) | BYPASS_DCACHE_MASK) : NULL; -} diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_unlink.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_unlink.c deleted file mode 100644 index 29e35d6..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_unlink.c +++ /dev/null @@ -1,55 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "os/alt_syscall.h" - -/* - * unlink() is used by newlib to delete an existing link to a file. This is - * unsupported in the HAL environment. However a "do-nothing" implementation - * is still provied for newlib compatability. - * - * ALT_UNLINK is mapped onto the unlink() system call in alt_syscall.h - */ - -int ALT_UNLINK (char *name) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(unlink); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_usleep.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_usleep.c deleted file mode 100644 index 2330eb8..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_usleep.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2003 Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - * - * ------------ - * - * Altera does not recommend, suggest or require that this reference design - * file be used in conjunction or combination with any other product. - * - * usleep.c - Microsecond delay routine - */ - -#include - -#include "priv/alt_busy_sleep.h" -#include "os/alt_syscall.h" - -/* - * This function simply calls alt_busy_sleep() to perform the delay. This - * function implements the delay as a calibrated "busy loop". - * - * ALT_USLEEP is mapped onto the usleep() system call in alt_syscall.h - */ - - - -#if defined (__GNUC__) && __GNUC__ >= 4 -int ALT_USLEEP (useconds_t us) -#else -unsigned int ALT_USLEEP (unsigned int us) -#endif -{ - return alt_busy_sleep(us); -} diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_wait.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_wait.c deleted file mode 100644 index a42f80f..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_wait.c +++ /dev/null @@ -1,52 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_errno.h" -#include "os/alt_syscall.h" - -/* - * wait() is used by newlib to wait for all child processes to exit. Since the - * HAL does not support spawning child processes, this returns immediately as - * there can't be anythign to wait for. - * - * ALT_WAIT is mapped onto the wait() system call in alt_syscall.h - */ - -int ALT_WAIT (int *status) -{ - *status = 0; - - ALT_ERRNO = ECHILD; - - return -1; -} - diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_write.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_write.c deleted file mode 100644 index 51debb5..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/alt_write.c +++ /dev/null @@ -1,138 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -#include "sys/alt_log_printf.h" - -/* - * The write() system call is used to write a block of data to a file or - * device. This function simply vectors the request to the device driver - * associated with the input file descriptor "file". - * - * ALT_WRITE is mapped onto the write() system call in alt_syscall.h - */ - -#ifdef ALT_USE_DIRECT_DRIVERS - -#include "system.h" -#include "sys/alt_driver.h" - -/* - * Provide minimal version that just writes to the stdout/stderr devices - * when provided. - */ - -int ALT_WRITE (int file, const void *ptr, size_t len) -{ -#ifdef ALT_STDOUT_PRESENT - ALT_DRIVER_WRITE_EXTERNS(ALT_STDOUT_DEV); -#endif -#ifdef ALT_STDERR_PRESENT - ALT_DRIVER_WRITE_EXTERNS(ALT_STDERR_DEV); -#endif - -#if !defined(ALT_STDOUT_PRESENT) && !defined(ALT_STDERR_PRESENT) - /* Generate a link time warning, should this function ever be called. */ - ALT_STUB_WARNING(write); -#endif - - switch (file) { -#ifdef ALT_STDOUT_PRESENT - case 1: /* stdout file descriptor */ - return ALT_DRIVER_WRITE(ALT_STDOUT_DEV, ptr, len, 0); -#endif /* ALT_STDOUT_PRESENT */ -#ifdef ALT_STDERR_PRESENT - case 2: /* stderr file descriptor */ - return ALT_DRIVER_WRITE(ALT_STDERR_DEV, ptr, len, 0); -#endif /* ALT_STDERR_PRESENT */ - default: - ALT_ERRNO = EBADFD; - return -1; - } -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -int ALT_WRITE (int file, const void *ptr, size_t len) -{ - alt_fd* fd; - int rval; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - /* - * If the file has not been opened with write access, or if the driver does - * not provide an implementation of write(), generate an error. Otherwise - * call the drivers write() function to process the request. - */ - - if (((fd->fd_flags & O_ACCMODE) != O_RDONLY) && fd->dev->write) - { - - /* ALT_LOG - see altera_hal/HAL/inc/sys/alt_log_printf.h */ - ALT_LOG_WRITE_FUNCTION(ptr,len); - - if ((rval = fd->dev->write(fd, ptr, len)) < 0) - { - ALT_ERRNO = -rval; - return -1; - } - return rval; - } - else - { - ALT_ERRNO = EACCES; - } - } - else - { - ALT_ERRNO = EBADFD; - } - return -1; -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/altera_nios2_qsys_irq.c b/software/qsys_tutorial_lcd2_bsp/HAL/src/altera_nios2_qsys_irq.c deleted file mode 100644 index c7a4f93..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/altera_nios2_qsys_irq.c +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2009 Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - * - * altera_nios2_irq.c - Support for Nios II internal interrupt controller. - * - */ - -#include "sys/alt_irq.h" -#include "altera_nios2_qsys_irq.h" - -/* - * To initialize the internal interrupt controller, just clear the IENABLE - * register so that all possible IRQs are disabled. - */ -void altera_nios2_qsys_irq_init(void) -{ - NIOS2_WRITE_IENABLE(0); -} diff --git a/software/qsys_tutorial_lcd2_bsp/HAL/src/crt0.S b/software/qsys_tutorial_lcd2_bsp/HAL/src/crt0.S deleted file mode 100644 index 582445d..0000000 --- a/software/qsys_tutorial_lcd2_bsp/HAL/src/crt0.S +++ /dev/null @@ -1,456 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "system.h" -#include "nios2.h" - -/* Setup header files to work with assembler code. */ -#define ALT_ASM_SRC - -/* Debug logging facility */ -#include "sys/alt_log_printf.h" - -/*************************************************************************\ -| MACROS | -\*************************************************************************/ - -/* - * The new build tools explicitly define macros when alt_load() - * must be called. The define ALT_LOAD_EXPLICITLY_CONTROLLED tells us that - * those macros are controlling if alt_load() needs to be called. - */ -#ifdef ALT_LOAD_EXPLICITLY_CONTROLLED - -/* Need to call alt_load() if any of these sections are being copied. */ -#if defined(ALT_LOAD_COPY_RODATA) || defined(ALT_LOAD_COPY_RWDATA) || defined(ALT_LOAD_COPY_EXCEPTIONS) -#define CALL_ALT_LOAD -#endif - -#else /* !ALT_LOAD_EXPLICITLY_CONTROLLED */ - -/* - * The legacy build tools use the following macros to detect when alt_load() - * needs to be called. - */ - -#define __ALT_LOAD_SECTIONS(res, text, rodata, exc) \ - ((res##_BASE != rodata##_BASE) || \ - (res##_BASE != rwdata##_BASE) || \ - (res##_BASE != exc##_BASE)) - -#define _ALT_LOAD_SECTIONS(res, text, rodata, exc) \ - __ALT_LOAD_SECTIONS(res, text, rodata, exc) - -#define ALT_LOAD_SECTIONS _ALT_LOAD_SECTIONS(ALT_RESET_DEVICE, \ - ALT_RODATA_DEVICE, \ - ALT_RWDATA_DEVICE, \ - ALT_EXCEPTIONS_DEVICE) - -/* Call alt_load() if there is no bootloader and ALT_LOAD_SECTIONS isn't 0. */ -#if defined(ALT_NO_BOOTLOADER) && ALT_LOAD_SECTIONS -#define CALL_ALT_LOAD -#endif - -#endif /* !ALT_LOAD_EXPLICITLY_CONTROLLED */ - -/* - * When the legacy build tools define a macro called ALT_NO_BOOTLOADER, - * it indicates that initialization code is allowed at the reset address. - * The new build tools define a macro called ALT_ALLOW_CODE_AT_RESET for - * the same purpose. - */ -#ifdef ALT_NO_BOOTLOADER -#define ALT_ALLOW_CODE_AT_RESET -#endif - -/*************************************************************************\ -| EXTERNAL REFERENCES | -\*************************************************************************/ - -/* - * The entry point for user code is either "main" in hosted mode, or - * "alt_main" in standalone mode. These are explicitly referenced here, - * to ensure they are built into the executable. This allows the user - * to build them into libraries, rather than supplying them in object - * files at link time. - */ - .globl main - .globl alt_main - -/* - * Create a reference to the software multiply/divide and trap handers, - * so that if they are provided, they will appear in the executable. - */ -#ifndef ALT_NO_INSTRUCTION_EMULATION - .globl alt_exception_muldiv -#endif -#ifdef ALT_TRAP_HANDLER - .globl alt_exception_trap -#endif - -/* - * Linker defined symbols used to initialize bss. - */ -.globl __bss_start -.globl __bss_end - -/*************************************************************************\ -| RESET SECTION (.entry) | -\*************************************************************************/ - -/* - * This is the reset entry point for Nios II. - * - * At reset, only the cache line which contain the reset vector is - * initialized by the hardware. The code within the first cache line - * initializes the remainder of the instruction cache. - */ - - .section .entry, "xa" - .align 5 - -/* - * Explicitly allow the use of r1 (the assembler temporary register) - * within this code. This register is normally reserved for the use of - * the assembler. - */ - .set noat - -/* - * Some tools want to know where the reset vector is. - * Code isn't always provided at the reset vector but at least the - * __reset label always contains the reset vector address because - * it is defined at the start of the .entry section. - */ - - .globl __reset - .type __reset, @function -__reset: - -/* - * Initialize the instruction cache if present (i.e. size > 0) and - * reset code is allowed unless optimizing for RTL simulation. - * RTL simulations can ensure the instruction cache is already initialized - * so skipping this loop speeds up RTL simulation. - */ - -#if NIOS2_ICACHE_SIZE > 0 && defined(ALT_ALLOW_CODE_AT_RESET) && !defined(ALT_SIM_OPTIMIZE) - /* Assume the instruction cache size is always a power of two. */ -#if NIOS2_ICACHE_SIZE > 0x8000 - movhi r2, %hi(NIOS2_ICACHE_SIZE) -#else - movui r2, NIOS2_ICACHE_SIZE -#endif - -0: - initi r2 - addi r2, r2, -NIOS2_ICACHE_LINE_SIZE - bgt r2, zero, 0b -1: - - /* - * The following debug information tells the ISS not to run the loop above - * but to perform its actions using faster internal code. - */ - .pushsection .debug_alt_sim_info - .int 1, 1, 0b, 1b - .popsection -#endif /* Initialize Instruction Cache */ - -/* - * Jump to the _start entry point in the .text section if reset code - * is allowed or if optimizing for RTL simulation. - */ -#if defined(ALT_ALLOW_CODE_AT_RESET) || defined(ALT_SIM_OPTIMIZE) - /* Jump to the _start entry point in the .text section. */ - movhi r1, %hi(_start) - ori r1, r1, %lo(_start) - jmp r1 - - .size __reset, . - __reset -#endif /* Jump to _start */ - -/* - * When not using exit, provide an _exit symbol to prevent unresolved - * references to _exit from the linker script. - */ -#ifdef ALT_NO_EXIT - .globl _exit -_exit: -#endif - -/*************************************************************************\ -| TEXT SECTION (.text) | -\*************************************************************************/ - -/* - * Start of the .text section, and also the code entry point when - * the code is executed by a bootloader rather than directly from reset. - */ - .section .text - .align 2 - - .globl _start - .type _start, @function -_start: - -/* - * Initialize the data cache if present (i.e. size > 0) and not - * optimizing for RTL simulation. - * RTL simulations can ensure the data cache is already initialized - * so skipping this loop speeds up RTL simulation. - */ - -#if NIOS2_DCACHE_SIZE > 0 && !defined(ALT_SIM_OPTIMIZE) - - /* Assume the data cache size is always a power of two. */ -#if NIOS2_DCACHE_SIZE > 0x8000 - movhi r2, %hi(NIOS2_DCACHE_SIZE) -#else - movui r2, NIOS2_DCACHE_SIZE -#endif - -0: - initd 0(r2) - addi r2, r2, -NIOS2_DCACHE_LINE_SIZE - bgt r2, zero, 0b -1: - - /* - * The following debug information tells the ISS not to run the loop above - * but to perform its actions using faster internal code. - */ - .pushsection .debug_alt_sim_info - .int 2, 1, 0b, 1b - .popsection - -#endif /* Initialize Data Cache */ - - /* Log that caches have been initialized. */ - ALT_LOG_PUTS(alt_log_msg_cache) - - /* Log that the stack pointer is about to be setup. */ - ALT_LOG_PUTS(alt_log_msg_stackpointer) - -#if (NIOS2_NUM_OF_SHADOW_REG_SETS == 0) - /* - * Now that the caches are initialized, set up the stack pointer. - * The value provided by the linker is assumed to be correctly aligned. - */ - movhi sp, %hi(__alt_stack_pointer) - ori sp, sp, %lo(__alt_stack_pointer) - - /* Set up the global pointer. */ - movhi gp, %hi(_gp) - ori gp, gp, %lo(_gp) - -#else /* NIOS2_NUM_OF_SHADOW_REG_SETS > 0 */ - - /* - * Set up the GP and SP in all shadow register sets. - */ - - /* - * Check current register set number, if CPU resets into a shadow register - * set, switch register set to 0 by writing zero to SSTATUS register and - * execute an ERET instruction that just jumps to the next PC address - * (use the NEXTPC instruction to get this). - */ - - rdctl r2, status - - /* Get the current register set number (STATUS.CRS). */ - andi r3, r2, NIOS2_STATUS_CRS_MSK - - /* Skip switch register set if STATUS.CRS is 0. */ - beq r3, zero, .Lskip_switch_reg_set - - .set nobreak - - /* Current register set is non-zero, set SSTATUS to 0. */ - mov sstatus, zero - - /* Get next pc and store in ea. */ - nextpc ea - - /* Point to instruction after eret. */ - addi ea, ea, 8 - - /* - * Execute ERET instruction that just jumps to the next PC address - */ - eret - -.Lskip_switch_reg_set: - mov r2, zero - - /* Reset STATUS register */ - wrctl status, r2 - - movui r3, NIOS2_NUM_OF_SHADOW_REG_SETS - - /* Set up the stack pointer in register set 0. */ - movhi sp, %hi(__alt_stack_pointer) - ori sp, sp, %lo(__alt_stack_pointer) - - /* Set up the global pointer in register set 0. */ - movhi gp, %hi(_gp) - ori gp, gp, %lo(_gp) - -.Lsetup_sp_and_gp_loop: - /* - * Setup GP and SP for shadow register set - * from NIOS2_NUM_OF_SHADOW_REG_SETS to 0 - */ - - /* Skip if number of register sets is 0. */ - beq r3, zero, .Lno_shadow_register_set - - - /* Add previous register set STATUS.PRS by 1 */ - movhi r4, 1 - add r2, r2, r4 - - /* Write STATUS */ - wrctl status, r2 - - /* Clear r0 in the shadow register set (not done by hardware) */ - wrprs r0, r0 - - /* Write the GP in previous register set */ - wrprs gp, gp - - /* Only write the SP in previous register set - * if using the seperate exception stack. For normal case (single stack), - * funnel code would read the SP from previous register set. - */ -#ifdef ALT_INTERRUPT_STACK - - movhi et, %hiadj(__alt_interrupt_stack_pointer) - addi et, et, %lo(__alt_interrupt_stack_pointer) - wrprs sp, et - -#endif /* ALT_INTERRUPT_STACK */ - - /* Decrease number of register set counter by 1 */ - addi r3, r3, -1 - - br .Lsetup_sp_and_gp_loop -.Lno_shadow_register_set: - -#endif /* NIOS2_NUM_OF_SHADOW_REG_SETS */ -/* - * Clear the BSS if not optimizing for RTL simulation. - * - * This uses the symbols: __bss_start and __bss_end, which are defined - * by the linker script. They mark the begining and the end of the bss - * region. The linker script guarantees that these values are word aligned. - */ -#ifndef ALT_SIM_OPTIMIZE - /* Log that the BSS is about to be cleared. */ - ALT_LOG_PUTS(alt_log_msg_bss) - - movhi r2, %hi(__bss_start) - ori r2, r2, %lo(__bss_start) - - movhi r3, %hi(__bss_end) - ori r3, r3, %lo(__bss_end) - - beq r2, r3, 1f - -0: - stw zero, (r2) - addi r2, r2, 4 - bltu r2, r3, 0b - -1: - - /* - * The following debug information tells the ISS not to run the loop above - * but to perform its actions using faster internal code. - */ - .pushsection .debug_alt_sim_info - .int 3, 1, 0b, 1b - .popsection -#endif /* ALT_SIM_OPTIMIZE */ - -/* - * The alt_load() facility is normally used when there is no bootloader. - * It copies some sections into RAM so it acts like a mini-bootloader. - */ -#ifdef CALL_ALT_LOAD - -#ifdef ALT_STACK_CHECK - /* - * If the user has selected stack checking then we need to set up a safe - * value in the stack limit register so that the relocation functions - * don't think the stack has overflowed (the contents of the rwdata - * section aren't defined until alt_load() has been called). - */ - mov et, zero -#endif - - call alt_load - -#endif /* CALL_ALT_LOAD */ - -#ifdef ALT_STACK_CHECK - /* - * Set up the stack limit (if required). The linker has set up the - * copy of the variable which is in memory. - */ - - ldw et, %gprel(alt_stack_limit_value)(gp) -#endif - - /* Log that alt_main is about to be called. */ - ALT_LOG_PUTS(alt_log_msg_alt_main) - - /* Call the C entry point. It should never return. */ - call alt_main - - /* Wait in infinite loop in case alt_main does return. */ -alt_after_alt_main: - br alt_after_alt_main - - .size _start, . - _start - -/* - * Add information about the stack base if stack overflow checking is enabled. - */ -#ifdef ALT_STACK_CHECK - .globl alt_stack_limit_value - .section .sdata,"aws",@progbits - .align 2 - .type alt_stack_limit_value, @object - .size alt_stack_limit_value, 4 -alt_stack_limit_value: - .long __alt_stack_limit -#endif diff --git a/software/qsys_tutorial_lcd2_bsp/Makefile b/software/qsys_tutorial_lcd2_bsp/Makefile deleted file mode 100644 index cf5e813..0000000 --- a/software/qsys_tutorial_lcd2_bsp/Makefile +++ /dev/null @@ -1,775 +0,0 @@ -#------------------------------------------------------------------------------ -# BSP MAKEFILE -# -# This makefile was automatically generated by the nios2-bsp-generate-files -# command. Its purpose is to build a custom Board Support Package (BSP) -# targeting a specific Nios II processor in an SOPC Builder-based design. -# -# To create an application or library Makefile which uses this BSP, try the -# nios2-app-generate-makefile or nios2-lib-generate-makefile commands. -#------------------------------------------------------------------------------ - -#------------------------------------------------------------------------------ -# TOOLS -#------------------------------------------------------------------------------ - -MKDIR := mkdir -p -ECHO := echo -SPACE := $(empty) $(empty) - -#------------------------------------------------------------------------------ -# The adjust-path macro -# -# If COMSPEC is defined, Make is launched from Windows through -# Cygwin. This adjust-path macro will call 'cygpath -u' on all -# paths to ensure they are readable by Make. -# -# If COMSPEC is not defined, Make is launched from *nix, and no adjustment -# is necessary -#------------------------------------------------------------------------------ - -ifndef COMSPEC -ifdef ComSpec -COMSPEC = $(ComSpec) -endif # ComSpec -endif # !COMSPEC - -ifdef COMSPEC - adjust-path = $(subst $(SPACE),\$(SPACE),$(shell cygpath -u "$1")) - adjust-path-mixed = $(subst $(SPACE),\$(SPACE),$(shell cygpath -m "$1")) -else - adjust-path = $(subst $(SPACE),\$(SPACE),$1) - adjust-path-mixed = $(subst $(SPACE),\$(SPACE),$1) -endif - -#------------------------------------------------------------------------------ -# DEFAULT TARGET -# -# The default target, "all", must appear before any other target in the -# Makefile. Note that extra prerequisites are added to the "all" rule later. -#------------------------------------------------------------------------------ -.PHONY: all -all: - @$(ECHO) [BSP build complete] - - -#------------------------------------------------------------------------------ -# PATHS & DIRECTORY NAMES -# -# Explicitly locate absolute path of the BSP root -#------------------------------------------------------------------------------ - -BSP_ROOT_DIR := . - -# Define absolute path to the root of the BSP. -ABS_BSP_ROOT := $(call adjust-path-mixed,$(shell pwd)) - -# Stash all BSP object files here -OBJ_DIR := ./obj - -NEWLIB_DIR = $(BSP_ROOT_DIR)/newlib - - -#------------------------------------------------------------------------------ -# MANAGED CONTENT -# -# All content between the lines "START MANAGED" and "END MANAGED" below is -# generated based on variables in the BSP settings file when the -# nios2-bsp-generate-files command is invoked. If you wish to persist any -# information pertaining to the build process, it is recomended that you -# utilize the BSP settings mechanism to do so. -# -# Note that most variable assignments in this section have a corresponding BSP -# setting that can be changed by using the nios2-bsp-create-settings or -# nios2-bsp-update-settings command before nios2-bsp-generate-files; if you -# want any variable set to a specific value when this Makefile is re-generated -# (to prevent hand-edits from being over-written), use the BSP settings -# facilities above. -#------------------------------------------------------------------------------ - -#START MANAGED - -# The following TYPE comment allows tools to identify the 'type' of target this -# makefile is associated with. -# TYPE: BSP_PRIVATE_MAKEFILE - -# This following VERSION comment indicates the version of the tool used to -# generate this makefile. A makefile variable is provided for VERSION as well. -# ACDS_VERSION: 13.0sp1 -ACDS_VERSION := 13.0sp1 - -# This following BUILD_NUMBER comment indicates the build number of the tool -# used to generate this makefile. -# BUILD_NUMBER: 232 - -SETTINGS_FILE := settings.bsp -SOPC_FILE := C:/Users/takayun/Documents/DE2-115/qsys_tutorial/nios_system.sopcinfo - -#------------------------------------------------------------------------------- -# TOOL & COMMAND DEFINITIONS -# -# The base command for each build operation are expressed here. Additional -# switches may be expressed here. They will run for all instances of the -# utility. -#------------------------------------------------------------------------------- - -# Archiver command. Creates library files. -AR = nios2-elf-ar - -# Assembler command. Note that CC is used for .S files. -AS = nios2-elf-gcc - -# Custom flags only passed to the archiver. This content of this variable is -# directly passed to the archiver rather than the more standard "ARFLAGS". The -# reason for this is that GNU Make assumes some default content in ARFLAGS. -# This setting defines the value of BSP_ARFLAGS in Makefile. -BSP_ARFLAGS = -src - -# Custom flags only passed to the assembler. This setting defines the value of -# BSP_ASFLAGS in Makefile. -BSP_ASFLAGS = -Wa,-gdwarf2 - -# C/C++ compiler debug level. '-g' provides the default set of debug symbols -# typically required to debug a typical application. Omitting '-g' removes -# debug symbols from the ELF. This setting defines the value of -# BSP_CFLAGS_DEBUG in Makefile. -BSP_CFLAGS_DEBUG = -g - -# C/C++ compiler optimization level. "-O0" = no optimization,"-O2" = "normal" -# optimization, etc. "-O0" is recommended for code that you want to debug since -# compiler optimization can remove variables and produce non-sequential -# execution of code while debugging. This setting defines the value of -# BSP_CFLAGS_OPTIMIZATION in Makefile. -BSP_CFLAGS_OPTIMIZATION = '-Os' - -# C/C++ compiler warning level. "-Wall" is commonly used.This setting defines -# the value of BSP_CFLAGS_WARNINGS in Makefile. -BSP_CFLAGS_WARNINGS = -Wall - -# C compiler command. -CC = nios2-elf-gcc -xc - -# C++ compiler command. -CXX = nios2-elf-gcc -xc++ - -# Command used to remove files during 'clean' target. -RM = rm -f - - -#------------------------------------------------------------------------------- -# BUILD PRE & POST PROCESS COMMANDS -# -# The following variables are treated as shell commands in the rule -# definitions for each file-type associated with the BSP build, as well as -# commands run at the beginning and end of the entire BSP build operation. -# Pre-process commands are executed before the relevant command (for example, -# a command defined in the "CC_PRE_PROCESS" variable executes before the C -# compiler for building .c files), while post-process commands are executed -# immediately afterwards. -# -# You can view each pre/post-process command in the "Build Rules: All & -# Clean", "Pattern Rules to Build Objects", and "Library Rules" sections of -# this Makefile. -#------------------------------------------------------------------------------- - - -#------------------------------------------------------------------------------- -# BSP SOURCE BUILD SETTINGS (FLAG GENERATION) -# -# Software build settings such as compiler optimization, debug level, warning -# flags, etc., may be defined in the following variables. The variables below -# are concatenated together in the 'Flags' section of this Makefile to form -# final variables of flags passed to the build tools. -# -# These settings are considered private to the BSP and apply to all library & -# driver files in it; they do NOT automatically propagate to, for example, the -# build settings for an application. -# # For additional detail and syntax requirements, please refer to GCC help -# (example: "nios2-elf-gcc --help --verbose"). -# -# Unless indicated otherwise, multiple entries in each variable should be -# space-separated. -#------------------------------------------------------------------------------- - -# Altera HAL alt_sys_init.c generated source file -GENERATED_C_FILES := $(ABS_BSP_ROOT)/alt_sys_init.c -GENERATED_C_LIB_SRCS += alt_sys_init.c - - -#------------------------------------------------------------------------------- -# BSP SOURCE FILE LISTING -# -# All source files that comprise the BSP are listed here, along with path -# information to each file expressed relative to the BSP root. The precise -# list and location of each file is derived from the driver, operating system, -# or software package source file declarations. -# -# Following specification of the source files for each component, driver, etc., -# each source file type (C, assembly, etc.) is concatenated together and used -# to construct a list of objects. Pattern rules to build each object are then -# used to build each file. -#------------------------------------------------------------------------------- - -# altera_avalon_jtag_uart_driver sources root -altera_avalon_jtag_uart_driver_SRCS_ROOT := drivers - -# altera_avalon_jtag_uart_driver sources -altera_avalon_jtag_uart_driver_C_LIB_SRCS := \ - $(altera_avalon_jtag_uart_driver_SRCS_ROOT)/src/altera_avalon_jtag_uart_init.c \ - $(altera_avalon_jtag_uart_driver_SRCS_ROOT)/src/altera_avalon_jtag_uart_read.c \ - $(altera_avalon_jtag_uart_driver_SRCS_ROOT)/src/altera_avalon_jtag_uart_write.c \ - $(altera_avalon_jtag_uart_driver_SRCS_ROOT)/src/altera_avalon_jtag_uart_ioctl.c \ - $(altera_avalon_jtag_uart_driver_SRCS_ROOT)/src/altera_avalon_jtag_uart_fd.c - -# altera_avalon_lcd_16207_driver sources root -altera_avalon_lcd_16207_driver_SRCS_ROOT := drivers - -# altera_avalon_lcd_16207_driver sources -altera_avalon_lcd_16207_driver_C_LIB_SRCS := \ - $(altera_avalon_lcd_16207_driver_SRCS_ROOT)/src/altera_avalon_lcd_16207.c \ - $(altera_avalon_lcd_16207_driver_SRCS_ROOT)/src/altera_avalon_lcd_16207_fd.c - -# altera_avalon_pio_driver sources root -altera_avalon_pio_driver_SRCS_ROOT := drivers - -# altera_avalon_pio_driver sources -# altera_nios2_qsys_hal_driver sources root -altera_nios2_qsys_hal_driver_SRCS_ROOT := HAL - -# altera_nios2_qsys_hal_driver sources -altera_nios2_qsys_hal_driver_C_LIB_SRCS := \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/altera_nios2_qsys_irq.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_usleep.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_busy_sleep.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_irq_vars.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_icache_flush.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_icache_flush_all.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_dcache_flush.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_dcache_flush_all.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_dcache_flush_no_writeback.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_instruction_exception_entry.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_irq_register.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_iic.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_remap_cached.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_remap_uncached.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_uncached_free.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_uncached_malloc.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_do_ctors.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_do_dtors.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_gmon.c - -altera_nios2_qsys_hal_driver_ASM_LIB_SRCS := \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_exception_entry.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_exception_trap.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_exception_muldiv.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_irq_entry.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_software_exception.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_mcount.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_log_macro.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/crt0.S - -# hal sources root -hal_SRCS_ROOT := HAL - -# hal sources -hal_C_LIB_SRCS := \ - $(hal_SRCS_ROOT)/src/alt_alarm_start.c \ - $(hal_SRCS_ROOT)/src/alt_close.c \ - $(hal_SRCS_ROOT)/src/alt_dev.c \ - $(hal_SRCS_ROOT)/src/alt_dev_llist_insert.c \ - $(hal_SRCS_ROOT)/src/alt_dma_rxchan_open.c \ - $(hal_SRCS_ROOT)/src/alt_dma_txchan_open.c \ - $(hal_SRCS_ROOT)/src/alt_environ.c \ - $(hal_SRCS_ROOT)/src/alt_env_lock.c \ - $(hal_SRCS_ROOT)/src/alt_errno.c \ - $(hal_SRCS_ROOT)/src/alt_execve.c \ - $(hal_SRCS_ROOT)/src/alt_exit.c \ - $(hal_SRCS_ROOT)/src/alt_fcntl.c \ - $(hal_SRCS_ROOT)/src/alt_fd_lock.c \ - $(hal_SRCS_ROOT)/src/alt_fd_unlock.c \ - $(hal_SRCS_ROOT)/src/alt_find_dev.c \ - $(hal_SRCS_ROOT)/src/alt_find_file.c \ - $(hal_SRCS_ROOT)/src/alt_flash_dev.c \ - $(hal_SRCS_ROOT)/src/alt_fork.c \ - $(hal_SRCS_ROOT)/src/alt_fs_reg.c \ - $(hal_SRCS_ROOT)/src/alt_fstat.c \ - $(hal_SRCS_ROOT)/src/alt_get_fd.c \ - $(hal_SRCS_ROOT)/src/alt_getchar.c \ - $(hal_SRCS_ROOT)/src/alt_getpid.c \ - $(hal_SRCS_ROOT)/src/alt_gettod.c \ - $(hal_SRCS_ROOT)/src/alt_iic_isr_register.c \ - $(hal_SRCS_ROOT)/src/alt_instruction_exception_register.c \ - $(hal_SRCS_ROOT)/src/alt_ioctl.c \ - $(hal_SRCS_ROOT)/src/alt_io_redirect.c \ - $(hal_SRCS_ROOT)/src/alt_irq_handler.c \ - $(hal_SRCS_ROOT)/src/alt_isatty.c \ - $(hal_SRCS_ROOT)/src/alt_kill.c \ - $(hal_SRCS_ROOT)/src/alt_link.c \ - $(hal_SRCS_ROOT)/src/alt_load.c \ - $(hal_SRCS_ROOT)/src/alt_log_printf.c \ - $(hal_SRCS_ROOT)/src/alt_lseek.c \ - $(hal_SRCS_ROOT)/src/alt_main.c \ - $(hal_SRCS_ROOT)/src/alt_malloc_lock.c \ - $(hal_SRCS_ROOT)/src/alt_open.c \ - $(hal_SRCS_ROOT)/src/alt_printf.c \ - $(hal_SRCS_ROOT)/src/alt_putchar.c \ - $(hal_SRCS_ROOT)/src/alt_putstr.c \ - $(hal_SRCS_ROOT)/src/alt_read.c \ - $(hal_SRCS_ROOT)/src/alt_release_fd.c \ - $(hal_SRCS_ROOT)/src/alt_rename.c \ - $(hal_SRCS_ROOT)/src/alt_sbrk.c \ - $(hal_SRCS_ROOT)/src/alt_settod.c \ - $(hal_SRCS_ROOT)/src/alt_stat.c \ - $(hal_SRCS_ROOT)/src/alt_tick.c \ - $(hal_SRCS_ROOT)/src/alt_times.c \ - $(hal_SRCS_ROOT)/src/alt_unlink.c \ - $(hal_SRCS_ROOT)/src/alt_wait.c \ - $(hal_SRCS_ROOT)/src/alt_write.c - - -# Assemble all component C source files -COMPONENT_C_LIB_SRCS += \ - $(altera_avalon_jtag_uart_driver_C_LIB_SRCS) \ - $(altera_avalon_lcd_16207_driver_C_LIB_SRCS) \ - $(altera_nios2_qsys_hal_driver_C_LIB_SRCS) \ - $(hal_C_LIB_SRCS) - -# Assemble all component assembly source files -COMPONENT_ASM_LIB_SRCS += \ - $(altera_nios2_qsys_hal_driver_ASM_LIB_SRCS) - -# Assemble all component C++ source files -COMPONENT_CPP_LIB_SRCS += \ - -#END MANAGED - -#------------------------------------------------------------------------------ -# PUBLIC.MK -# -# The generated public.mk file contains BSP information that is shared with -# other external makefiles, such as a Nios II application makefile. System- -# dependent information such as hardware-specific compiler flags and -# simulation file generation are stored here. -# -# In addition, public.mk contains include paths that various software, -# such as a device driver, may need for the C compiler. These paths are -# written to public.mk with respect to the BSP root. In public.mk, each -# path is prefixed with a special variable, $(ALT_LIBRARY_ROOT_DIR). The -# purpose of this variable is to allow an external Makefile to append on -# path information to precisely locate paths expressed in public.mk -# Since this is the BSP Makefile, we set ALT_LIBRARY_ROOT_DIR to point right -# here ("."), at the BSP root. -# -# ALT_LIBRARY_ROOT_DIR must always be set before public.mk is included. -#------------------------------------------------------------------------------ -ALT_LIBRARY_ROOT_DIR := . -include public.mk - - -#------------------------------------------------------------------------------ -# FLAGS -# -# Include paths for BSP files are written into the public.mk file and must -# be added to the existing list of pre-processor flags. In addition, "hooks" -# for standard flags left intentionally empty (CFLAGS, CPPFLAGS, ASFLAGS, -# and CXXFLAGS) are provided for conveniently adding to the relevant flags -# on the command-line or via script that calls make. -#------------------------------------------------------------------------------ -# Assemble final list of compiler flags from generated content -BSP_CFLAGS += \ - $(BSP_CFLAGS_DEFINED_SYMBOLS) \ - $(BSP_CFLAGS_UNDEFINED_SYMBOLS) \ - $(BSP_CFLAGS_OPTIMIZATION) \ - $(BSP_CFLAGS_DEBUG) \ - $(BSP_CFLAGS_WARNINGS) \ - $(BSP_CFLAGS_USER_FLAGS) \ - $(ALT_CFLAGS) \ - $(CFLAGS) - -# Make ready the final list of include directories and other C pre-processor -# flags. Each include path is made ready by prefixing it with "-I". -BSP_CPPFLAGS += \ - $(addprefix -I, $(BSP_INC_DIRS)) \ - $(addprefix -I, $(ALT_INCLUDE_DIRS)) \ - $(ALT_CPPFLAGS) \ - $(CPPFLAGS) - -# Finish off assembler flags with any user-provided flags -BSP_ASFLAGS += $(ASFLAGS) - -# Finish off C++ flags with any user-provided flags -BSP_CXXFLAGS += $(CXXFLAGS) - -# And finally, the ordered list -C_SRCS += $(GENERATED_C_LIB_SRCS) \ - $(COMPONENT_C_LIB_SRCS) - -CXX_SRCS += $(GENERATED_CPP_LIB_SRCS) \ - $(COMPONENT_CPP_LIB_SRCS) - -ASM_SRCS += $(GENERATED_ASM_LIB_SRCS) \ - $(COMPONENT_ASM_LIB_SRCS) - - -#------------------------------------------------------------------------------ -# LIST OF GENERATED FILES -# -# A Nios II BSP relies on the generation of several source files used -# by both the BSP and any applications referencing the BSP. -#------------------------------------------------------------------------------ - - -GENERATED_H_FILES := $(ABS_BSP_ROOT)/system.h - -GENERATED_LINKER_SCRIPT := $(ABS_BSP_ROOT)/linker.x - -GENERATED_FILES += $(GENERATED_H_FILES) \ - $(GENERATED_LINKER_SCRIPT) - - -#------------------------------------------------------------------------------ -# SETUP TO BUILD OBJECTS -# -# List of object files which are to be built. This is constructed from the input -# list of C source files (C_SRCS), C++ source files (CXX_SRCS), and assembler -# source file (ASM_SRCS). The permitted file extensions are: -# -# .c .C - for C files -# .cxx .cc .cpp .CXX .CC .CPP - for C++ files -# .S .s - for assembly files -# -# Extended description: The list of objects is a sorted list (duplicates -# removed) of all possible objects, placed beneath the ./obj directory, -# including any path information stored in the "*_SRCS" variable. The -# "patsubst" commands are used to concatenate together multiple file suffix -# types for common files (i.e. c++ as .cxx, .cc, .cpp). -# -# File extensions are case-insensitive in build rules with the exception of -# assembly sources. Nios II assembly sources with the ".S" extension are first -# run through the C preprocessor. Sources with the ".s" extension are not. -#------------------------------------------------------------------------------ -OBJS = $(sort $(addprefix $(OBJ_DIR)/, \ - $(patsubst %.c, %.o, $(patsubst %.C, %.o, $(C_SRCS))) \ - $(patsubst %.cxx, %.o, $(patsubst %.CXX, %.o, \ - $(patsubst %.cc, %.o, $(patsubst %.CC, %.o, \ - $(patsubst %.cpp, %.o, $(patsubst %.CPP, %.o, \ - $(CXX_SRCS) )))))) \ - $(patsubst %.S, %.o, $(patsubst %.s, %.o, $(ASM_SRCS))) )) - -# List of dependancy files for each object file. -DEPS = $(OBJS:.o=.d) - - -# Rules to force your project to rebuild or relink -# .force_relink file will cause any application that depends on this project to relink -# .force_rebuild file will cause this project to rebuild object files -# .force_rebuild_all file will cause this project and any project that depends on this project to rebuild object files - -FORCE_RELINK_DEP := .force_relink -FORCE_REBUILD_DEP := .force_rebuild -FORCE_REBUILD_ALL_DEP := .force_rebuild_all -FORCE_REBUILD_DEP_LIST := $(FORCE_RELINK_DEP) $(FORCE_REBUILD_DEP) $(FORCE_REBUILD_ALL_DEP) - -$(FORCE_REBUILD_DEP_LIST): - -$(OBJS): $(wildcard $(FORCE_REBUILD_DEP)) $(wildcard $(FORCE_REBUILD_ALL_DEP)) - - -#------------------------------------------------------------------------------ -# BUILD RULES: ALL & CLEAN -#------------------------------------------------------------------------------ -.DELETE_ON_ERROR: - -.PHONY: all -all: build_pre_process -all: Makefile $(GENERATED_FILES) $(BSP_LIB) $(NEWLIB_DIR) -all: build_post_process - - -# clean: remove .o/.a/.d -.PHONY: clean -clean: - @$(RM) -r $(BSP_LIB) $(OBJ_DIR) $(FORCE_REBUILD_DEP_LIST) -ifneq ($(wildcard $(NEWLIB_DIR)),) - @$(RM) -r $(NEWLIB_DIR) -endif - @$(ECHO) [BSP clean complete] - - -#------------------------------------------------------------------------------ -# BUILD PRE/POST PROCESS -#------------------------------------------------------------------------------ -build_pre_process : - $(BUILD_PRE_PROCESS) - -build_post_process : - $(BUILD_POST_PROCESS) - -.PHONY: build_pre_process build_post_process - - - -#------------------------------------------------------------------------------ -# MAKEFILE UP TO DATE? -# -# Is this very Makefile up to date? Someone may have changed the BSP settings -# file or the associated target hardware. -#------------------------------------------------------------------------------ -# Skip this check when clean is the only target -ifneq ($(MAKECMDGOALS),clean) - -ifneq ($(wildcard $(SETTINGS_FILE)),$(SETTINGS_FILE)) -$(warning Warning: BSP Settings File $(SETTINGS_FILE) could not be found.) -endif - -Makefile: $(wildcard $(SETTINGS_FILE)) - @$(ECHO) Makefile not up to date. - @$(ECHO) $(SETTINGS_FILE) has been modified since the BSP Makefile was generated. - @$(ECHO) - @$(ECHO) Generate the BSP to update the Makefile, and then build again. - @$(ECHO) - @$(ECHO) To generate from Eclipse: - @$(ECHO) " 1. Right-click the BSP project." - @$(ECHO) " 2. In the Nios II Menu, click Generate BSP." - @$(ECHO) - @$(ECHO) To generate from the command line: - @$(ECHO) " nios2-bsp-generate-files --settings= --bsp-dir=" - @$(ECHO) - @exit 1 - -ifneq ($(wildcard $(SOPC_FILE)),$(SOPC_FILE)) -$(warning Warning: SOPC File $(SOPC_FILE) could not be found.) -endif - -public.mk: $(wildcard $(SOPC_FILE)) - @$(ECHO) Makefile not up to date. - @$(ECHO) $(SOPC_FILE) has been modified since the BSP was generated. - @$(ECHO) - @$(ECHO) Generate the BSP to update the Makefile, and then build again. - @$(ECHO) - @$(ECHO) To generate from Eclipse: - @$(ECHO) " 1. Right-click the BSP project." - @$(ECHO) " 2. In the Nios II Menu, click Generate BSP." - @$(ECHO) - @$(ECHO) To generate from the command line: - @$(ECHO) " nios2-bsp-generate-files --settings= --bsp-dir=" - @$(ECHO) - @exit 1 - -endif # $(MAKECMDGOALS) != clean - -#------------------------------------------------------------------------------ -# PATTERN RULES TO BUILD OBJECTS -#------------------------------------------------------------------------------ -$(OBJ_DIR)/%.o: %.c - @$(ECHO) Compiling $( - -/* - * Device headers - */ - -#include "altera_nios2_qsys_irq.h" -#include "altera_avalon_jtag_uart.h" -#include "altera_avalon_lcd_16207.h" - -/* - * Allocate the device storage - */ - -ALTERA_NIOS2_QSYS_IRQ_INSTANCE ( NIOS2_PROCESSOR, nios2_processor); -ALTERA_AVALON_JTAG_UART_INSTANCE ( JTAG_UART, jtag_uart); -ALTERA_AVALON_LCD_16207_INSTANCE ( LCD_16207_0, lcd_16207_0); - -/* - * Initialize the interrupt controller devices - * and then enable interrupts in the CPU. - * Called before alt_sys_init(). - * The "base" parameter is ignored and only - * present for backwards-compatibility. - */ - -void alt_irq_init ( const void* base ) -{ - ALTERA_NIOS2_QSYS_IRQ_INIT ( NIOS2_PROCESSOR, nios2_processor); - alt_irq_cpu_enable_interrupts(); -} - -/* - * Initialize the non-interrupt controller devices. - * Called after alt_irq_init(). - */ - -void alt_sys_init( void ) -{ - ALTERA_AVALON_JTAG_UART_INIT ( JTAG_UART, jtag_uart); - ALTERA_AVALON_LCD_16207_INIT ( LCD_16207_0, lcd_16207_0); -} diff --git a/software/qsys_tutorial_lcd2_bsp/create-this-bsp b/software/qsys_tutorial_lcd2_bsp/create-this-bsp deleted file mode 100644 index 49e6175..0000000 --- a/software/qsys_tutorial_lcd2_bsp/create-this-bsp +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/bash -# -# This script creates the ucosii_net_zipfs Board Support Package (BSP). - -BSP_TYPE=hal -BSP_DIR=. -SOPC_DIR=../../ -SOPC_FILE=C:/Users/takayun/Documents/DE2-115/qsys_tutorial/nios_system.sopcinfo -NIOS2_BSP_ARGS="--set hal.max_file_descriptors 4 --set hal.enable_small_c_library true --set hal.sys_clk_timer none --set hal.timestamp_timer none --set hal.enable_exit false --set hal.enable_c_plus_plus false --set hal.enable_lightweight_device_driver_api true --set hal.enable_clean_exit false --set hal.enable_sim_optimize false --set hal.enable_reduced_device_drivers true --set hal.make.bsp_cflags_optimization '-Os'" -CPU_NAME= - - -# Don't run make if create-this-app script is called with --no-make arg -SKIP_MAKE= -while [ $# -gt 0 ] -do - case "$1" in - --no-make) - SKIP_MAKE=1 - ;; - *) - NIOS2_BSP_ARGS="$NIOS2_BSP_ARGS $1" - ;; - esac - shift -done - - -# Run nios2-bsp utility to create a hal BSP in this directory -# for the system with a .sopc file in $SOPC_FILE. -# Deprecating $SOPC_DIR in 10.1. Multiple .sopcinfo files in a directory may exist. - -if [ -z "$SOPC_FILE" ]; then - echo "WARNING: Use of a directory for locating a .sopcinfo file is deprecated in 10.1. Multiple .sopcinfo files may exist. You must specify the full .sopcinfo path." - cmd="nios2-bsp $BSP_TYPE $BSP_DIR $SOPC_DIR $NIOS2_BSP_ARGS $CPU_NAME" -else - cmd="nios2-bsp $BSP_TYPE $BSP_DIR $SOPC_FILE $NIOS2_BSP_ARGS $CPU_NAME" -fi - - -echo "create-this-bsp: Running \"$cmd\"" -$cmd || { - echo "$cmd failed" - exit 1 -} -if [ -z "$SKIP_MAKE" ]; then - echo "create-this-bsp: Running make" - make -fi diff --git a/software/qsys_tutorial_lcd2_bsp/drivers/inc/altera_avalon_jtag_uart.h b/software/qsys_tutorial_lcd2_bsp/drivers/inc/altera_avalon_jtag_uart.h deleted file mode 100644 index 95d4a99..0000000 --- a/software/qsys_tutorial_lcd2_bsp/drivers/inc/altera_avalon_jtag_uart.h +++ /dev/null @@ -1,198 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#ifndef __ALT_AVALON_JTAG_UART_H__ -#define __ALT_AVALON_JTAG_UART_H__ - -#include - -#include "sys/alt_alarm.h" -#include "sys/alt_warning.h" - -#include "os/alt_sem.h" -#include "os/alt_flag.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * If the user wants all drivers to be small rather than fast then make sure - * this one is marked as needing to be small. - */ -#if defined ALT_USE_SMALL_DRIVERS && !defined ALTERA_AVALON_JTAG_UART_SMALL -#define ALTERA_AVALON_JTAG_UART_SMALL -#endif - -/* - * If the user wants to ignore FIFO full error after timeout - */ -#if defined ALT_JTAG_UART_IGNORE_FIFO_FULL_ERROR && !defined ALTERA_AVALON_JTAG_UART_IGNORE_FIFO_FULL_ERROR -#define ALTERA_AVALON_JTAG_UART_IGNORE_FIFO_FULL_ERROR -#endif - -/* - * Constants that can be overriden. - */ -#ifndef ALTERA_AVALON_JTAG_UART_DEFAULT_TIMEOUT -#define ALTERA_AVALON_JTAG_UART_DEFAULT_TIMEOUT 10 -#endif - -#ifndef ALTERA_AVALON_JTAG_UART_BUF_LEN -#define ALTERA_AVALON_JTAG_UART_BUF_LEN 2048 -#endif - -/* - * ALT_JTAG_UART_READ_RDY and ALT_JTAG_UART_WRITE_RDY are the bitmasks - * that define uC/OS-II event flags that are releated to this device. - * - * ALT_JTAG_UART_READ_RDY indicates that there is read data in the buffer - * ready to be processed. ALT_JTAG_UART_WRITE_RDY indicates that the transmitter is - * ready for more data. - */ -#define ALT_JTAG_UART_READ_RDY 0x1 -#define ALT_JTAG_UART_WRITE_RDY 0x2 -#define ALT_JTAG_UART_TIMEOUT 0x4 - -/* - * State structure definition. Each instance of the driver uses one - * of these structures to hold its associated state. - */ - -typedef struct altera_avalon_jtag_uart_state_s -{ - unsigned int base; - -#ifndef ALTERA_AVALON_JTAG_UART_SMALL - - unsigned int timeout; /* Timeout until host is assumed inactive */ - alt_alarm alarm; - unsigned int irq_enable; - unsigned int host_inactive; - - ALT_SEM (read_lock) - ALT_SEM (write_lock) - ALT_FLAG_GRP (events) - - /* The variables below are volatile because they are modified by the - * interrupt routine. Making them volatile and reading them atomically - * means that we don't need any large critical sections. - */ - volatile unsigned int rx_in; - unsigned int rx_out; - unsigned int tx_in; - volatile unsigned int tx_out; - char rx_buf[ALTERA_AVALON_JTAG_UART_BUF_LEN]; - char tx_buf[ALTERA_AVALON_JTAG_UART_BUF_LEN]; - -#endif /* !ALTERA_AVALON_JTAG_UART_SMALL */ - -} altera_avalon_jtag_uart_state; - -/* - * Macros used by alt_sys_init when the ALT file descriptor facility isn't used. - */ - -#ifdef ALTERA_AVALON_JTAG_UART_SMALL - -#define ALTERA_AVALON_JTAG_UART_STATE_INSTANCE(name, state) \ - altera_avalon_jtag_uart_state state = \ - { \ - name##_BASE, \ - } - -#define ALTERA_AVALON_JTAG_UART_STATE_INIT(name, state) - -#else /* !ALTERA_AVALON_JTAG_UART_SMALL */ - -#define ALTERA_AVALON_JTAG_UART_STATE_INSTANCE(name, state) \ - altera_avalon_jtag_uart_state state = \ - { \ - name##_BASE, \ - ALTERA_AVALON_JTAG_UART_DEFAULT_TIMEOUT, \ - } - -/* - * Externally referenced routines - */ -extern void altera_avalon_jtag_uart_init(altera_avalon_jtag_uart_state* sp, - int irq_controller_id, int irq); - -#define ALTERA_AVALON_JTAG_UART_STATE_INIT(name, state) \ - { \ - if (name##_IRQ == ALT_IRQ_NOT_CONNECTED) \ - { \ - ALT_LINK_ERROR ("Error: Interrupt not connected for " #name ". " \ - "You have selected the interrupt driven version of " \ - "the ALTERA Avalon JTAG UART driver, but the " \ - "interrupt is not connected for this device. You can " \ - "select a polled mode driver by checking the 'small " \ - "driver' option in the HAL configuration window, or " \ - "by using the -DALTERA_AVALON_JTAG_UART_SMALL " \ - "preprocessor flag."); \ - } \ - else \ - altera_avalon_jtag_uart_init(&state, \ - name##_IRQ_INTERRUPT_CONTROLLER_ID, \ - name##_IRQ); \ - } - -#endif /* ALTERA_AVALON_JTAG_UART_SMALL */ - -/* - * Include in case non-direct version of driver required. - */ -#include "altera_avalon_jtag_uart_fd.h" - -/* - * Map alt_sys_init macros to direct or non-direct versions. - */ -#ifdef ALT_USE_DIRECT_DRIVERS - -#define ALTERA_AVALON_JTAG_UART_INSTANCE(name, state) \ - ALTERA_AVALON_JTAG_UART_STATE_INSTANCE(name, state) -#define ALTERA_AVALON_JTAG_UART_INIT(name, state) \ - ALTERA_AVALON_JTAG_UART_STATE_INIT(name, state) - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -#define ALTERA_AVALON_JTAG_UART_INSTANCE(name, dev) \ - ALTERA_AVALON_JTAG_UART_DEV_INSTANCE(name, dev) -#define ALTERA_AVALON_JTAG_UART_INIT(name, dev) \ - ALTERA_AVALON_JTAG_UART_DEV_INIT(name, dev) - -#endif /* ALT_USE_DIRECT_DRIVERS */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_AVALON_JTAG_UART_H__ */ diff --git a/software/qsys_tutorial_lcd2_bsp/drivers/inc/altera_avalon_jtag_uart_fd.h b/software/qsys_tutorial_lcd2_bsp/drivers/inc/altera_avalon_jtag_uart_fd.h deleted file mode 100644 index b3c3200..0000000 --- a/software/qsys_tutorial_lcd2_bsp/drivers/inc/altera_avalon_jtag_uart_fd.h +++ /dev/null @@ -1,125 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#ifndef __ALT_AVALON_JTAG_UART_FD_H__ -#define __ALT_AVALON_JTAG_UART_FD_H__ - -#include "sys/alt_dev.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * Externally referenced routines - */ -extern int altera_avalon_jtag_uart_read_fd (alt_fd* fd, char* ptr, int len); -extern int altera_avalon_jtag_uart_write_fd (alt_fd* fd, const char* ptr, - int len); - -/* - * Device structure definition. This is needed by alt_sys_init in order to - * reserve memory for the device instance. - */ - -typedef struct altera_avalon_jtag_uart_dev_s -{ - alt_dev dev; - altera_avalon_jtag_uart_state state; -} altera_avalon_jtag_uart_dev; - -/* - * Macros used by alt_sys_init when the ALT file descriptor facility is used. - */ - -#ifdef ALTERA_AVALON_JTAG_UART_SMALL - -#define ALTERA_AVALON_JTAG_UART_DEV_INSTANCE(name, d) \ - static altera_avalon_jtag_uart_dev d = \ - { \ - { \ - ALT_LLIST_ENTRY, \ - name##_NAME, \ - NULL, /* open */ \ - NULL, /* close */ \ - altera_avalon_jtag_uart_read_fd, \ - altera_avalon_jtag_uart_write_fd, \ - NULL, /* lseek */ \ - NULL, /* fstat */ \ - NULL, /* ioctl */ \ - }, \ - { \ - name##_BASE, \ - } \ - } - -#define ALTERA_AVALON_JTAG_UART_DEV_INIT(name, d) alt_dev_reg (&d.dev) - -#else /* !ALTERA_AVALON_JTAG_UART_SMALL */ - -extern int altera_avalon_jtag_uart_close_fd(alt_fd* fd); -extern int altera_avalon_jtag_uart_ioctl_fd (alt_fd* fd, int req, void* arg); - -#define ALTERA_AVALON_JTAG_UART_DEV_INSTANCE(name, d) \ - static altera_avalon_jtag_uart_dev d = \ - { \ - { \ - ALT_LLIST_ENTRY, \ - name##_NAME, \ - NULL, /* open */ \ - altera_avalon_jtag_uart_close_fd, \ - altera_avalon_jtag_uart_read_fd, \ - altera_avalon_jtag_uart_write_fd, \ - NULL, /* lseek */ \ - NULL, /* fstat */ \ - altera_avalon_jtag_uart_ioctl_fd, \ - }, \ - { \ - name##_BASE, \ - ALTERA_AVALON_JTAG_UART_DEFAULT_TIMEOUT, \ - } \ - } - -#define ALTERA_AVALON_JTAG_UART_DEV_INIT(name, d) \ - { \ - ALTERA_AVALON_JTAG_UART_STATE_INIT(name, d.state); \ - \ - /* make the device available to the system */ \ - alt_dev_reg(&d.dev); \ - } - -#endif /* ALTERA_AVALON_JTAG_UART_SMALL */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_AVALON_JTAG_UART_FD_H__ */ diff --git a/software/qsys_tutorial_lcd2_bsp/drivers/inc/altera_avalon_jtag_uart_regs.h b/software/qsys_tutorial_lcd2_bsp/drivers/inc/altera_avalon_jtag_uart_regs.h deleted file mode 100644 index 7f97160..0000000 --- a/software/qsys_tutorial_lcd2_bsp/drivers/inc/altera_avalon_jtag_uart_regs.h +++ /dev/null @@ -1,73 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#ifndef __ALTERA_AVALON_JTAG_UART_REGS_H__ -#define __ALTERA_AVALON_JTAG_UART_REGS_H__ - -#include - -#define ALTERA_AVALON_JTAG_UART_DATA_REG 0 -#define IOADDR_ALTERA_AVALON_JTAG_UART_DATA(base) \ - __IO_CALC_ADDRESS_NATIVE(base, ALTERA_AVALON_JTAG_UART_DATA_REG) -#define IORD_ALTERA_AVALON_JTAG_UART_DATA(base) \ - IORD(base, ALTERA_AVALON_JTAG_UART_DATA_REG) -#define IOWR_ALTERA_AVALON_JTAG_UART_DATA(base, data) \ - IOWR(base, ALTERA_AVALON_JTAG_UART_DATA_REG, data) - -#define ALTERA_AVALON_JTAG_UART_DATA_DATA_MSK (0x000000FF) -#define ALTERA_AVALON_JTAG_UART_DATA_DATA_OFST (0) -#define ALTERA_AVALON_JTAG_UART_DATA_RVALID_MSK (0x00008000) -#define ALTERA_AVALON_JTAG_UART_DATA_RVALID_OFST (15) -#define ALTERA_AVALON_JTAG_UART_DATA_RAVAIL_MSK (0xFFFF0000) -#define ALTERA_AVALON_JTAG_UART_DATA_RAVAIL_OFST (16) - - -#define ALTERA_AVALON_JTAG_UART_CONTROL_REG 1 -#define IOADDR_ALTERA_AVALON_JTAG_UART_CONTROL(base) \ - __IO_CALC_ADDRESS_NATIVE(base, ALTERA_AVALON_JTAG_UART_CONTROL_REG) -#define IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base) \ - IORD(base, ALTERA_AVALON_JTAG_UART_CONTROL_REG) -#define IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(base, data) \ - IOWR(base, ALTERA_AVALON_JTAG_UART_CONTROL_REG, data) - -#define ALTERA_AVALON_JTAG_UART_CONTROL_RE_MSK (0x00000001) -#define ALTERA_AVALON_JTAG_UART_CONTROL_RE_OFST (0) -#define ALTERA_AVALON_JTAG_UART_CONTROL_WE_MSK (0x00000002) -#define ALTERA_AVALON_JTAG_UART_CONTROL_WE_OFST (1) -#define ALTERA_AVALON_JTAG_UART_CONTROL_RI_MSK (0x00000100) -#define ALTERA_AVALON_JTAG_UART_CONTROL_RI_OFST (8) -#define ALTERA_AVALON_JTAG_UART_CONTROL_WI_MSK (0x00000200) -#define ALTERA_AVALON_JTAG_UART_CONTROL_WI_OFST (9) -#define ALTERA_AVALON_JTAG_UART_CONTROL_AC_MSK (0x00000400) -#define ALTERA_AVALON_JTAG_UART_CONTROL_AC_OFST (10) -#define ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_MSK (0xFFFF0000) -#define ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_OFST (16) - -#endif /* __ALTERA_AVALON_JTAG_UART_REGS_H__ */ diff --git a/software/qsys_tutorial_lcd2_bsp/drivers/inc/altera_avalon_lcd_16207.h b/software/qsys_tutorial_lcd2_bsp/drivers/inc/altera_avalon_lcd_16207.h deleted file mode 100644 index 2024b9a..0000000 --- a/software/qsys_tutorial_lcd2_bsp/drivers/inc/altera_avalon_lcd_16207.h +++ /dev/null @@ -1,158 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#ifndef __ALTERA_AVALON_LCD_16207_H__ -#define __ALTERA_AVALON_LCD_16207_H__ - -#include - -#include "sys/alt_alarm.h" -#include "os/alt_sem.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The altera_avalon_lcd_16207_dev structure is used to hold device specific - * data. This includes the transmit and receive buffers. - * - * An instance of this structure is created in the auto-generated - * alt_sys_init.c file for each UART listed in the systems PTF file. This is - * done using the ALTERA_AVALON_LCD_16207_STATE_INSTANCE macro given below. - */ - -#define ALT_LCD_HEIGHT 2 -#define ALT_LCD_WIDTH 16 -#define ALT_LCD_VIRTUAL_WIDTH 80 - -typedef struct altera_avalon_lcd_16207_state_s -{ - int base; - - alt_alarm alarm; - int period; - - char broken; - - unsigned char x; - unsigned char y; - char address; - char esccount; - - char scrollpos; - char scrollmax; - char active; /* If non-zero then the foreground routines are - * active so the timer call must not update the - * display. */ - - char escape[8]; - - struct - { - char visible[ALT_LCD_WIDTH]; - char data[ALT_LCD_VIRTUAL_WIDTH+1]; - char width; - unsigned char speed; - - } line[ALT_LCD_HEIGHT]; - - ALT_SEM (write_lock)/* Semaphore used to control access to the - * write buffer in multi-threaded mode */ -} altera_avalon_lcd_16207_state; - -/* - * Called by alt_sys_init.c to initialize the driver. - */ -extern void altera_avalon_lcd_16207_init(altera_avalon_lcd_16207_state* sp); - -/* - * The LCD panel driver is not trivial, so leave it out in the small - * drivers case. Also leave it out in simulation because there is no - * simulated hardware for the LCD panel. These two can be overridden - * by defining ALT_USE_LCE_16207 if you really want it. - */ - -#if (!defined(ALT_USE_SMALL_DRIVERS) && !defined(ALT_SIM_OPTIMIZE)) || defined ALT_USE_LCD_16207 - -/* - * Used by the auto-generated file - * alt_sys_init.c to create an instance of this device driver. - */ -#define ALTERA_AVALON_LCD_16207_STATE_INSTANCE(name, state) \ - altera_avalon_lcd_16207_state state = \ - { \ - name##_BASE \ - } - -/* - * The macro ALTERA_AVALON_LCD_16207_INIT is used by the auto-generated file - * alt_sys_init.c to initialize an instance of the device driver. - */ -#define ALTERA_AVALON_LCD_16207_STATE_INIT(name, state) \ - altera_avalon_lcd_16207_init(&state) - -#else /* exclude driver */ - -#define ALTERA_AVALON_LCD_16207_STATE_INSTANCE(name, state) extern int alt_no_storage -#define ALTERA_AVALON_LCD_16207_STATE_INIT(name, state) while (0) - -#endif /* exclude driver */ - -/* - * Include in case non-direct version of driver required. - */ -#include "altera_avalon_lcd_16207_fd.h" - -/* - * Map alt_sys_init macros to direct or non-direct versions. - */ -#ifdef ALT_USE_DIRECT_DRIVERS - -#define ALTERA_AVALON_LCD_16207_INSTANCE(name, state) \ - ALTERA_AVALON_LCD_16207_STATE_INSTANCE(name, state) -#define ALTERA_AVALON_LCD_16207_INIT(name, state) \ - ALTERA_AVALON_LCD_16207_STATE_INIT(name, state) - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -#define ALTERA_AVALON_LCD_16207_INSTANCE(name, dev) \ - ALTERA_AVALON_LCD_16207_DEV_INSTANCE(name, dev) -#define ALTERA_AVALON_LCD_16207_INIT(name, dev) \ - ALTERA_AVALON_LCD_16207_DEV_INIT(name, dev) - -#endif /* ALT_USE_DIRECT_DRIVERS */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALTERA_AVALON_LCD_16207_H__ */ diff --git a/software/qsys_tutorial_lcd2_bsp/drivers/inc/altera_avalon_lcd_16207_fd.h b/software/qsys_tutorial_lcd2_bsp/drivers/inc/altera_avalon_lcd_16207_fd.h deleted file mode 100644 index 370927b..0000000 --- a/software/qsys_tutorial_lcd2_bsp/drivers/inc/altera_avalon_lcd_16207_fd.h +++ /dev/null @@ -1,108 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#ifndef __ALTERA_AVALON_LCD_16207_FD_H__ -#define __ALTERA_AVALON_LCD_16207_FD_H__ - -#include "sys/alt_dev.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * Externally referenced routines - */ -extern int altera_avalon_lcd_16207_write_fd(alt_fd* fd, const char* ptr, - int len); - -/* - * Device structure definition. This is needed by alt_sys_init in order to - * reserve memory for the device instance. - */ - -typedef struct altera_avalon_lcd_16207_dev_s -{ - alt_dev dev; - altera_avalon_lcd_16207_state state; -} altera_avalon_lcd_16207_dev; - -/* - * The LCD panel driver is not trivial, so leave it out in the small - * drivers case. Also leave it out in simulation because there is no - * simulated hardware for the LCD panel. These two can be overridden - * by defining ALT_USE_LCE_16207 if you really want it. - */ - -#if (!defined(ALT_USE_SMALL_DRIVERS) && !defined(ALT_SIM_OPTIMIZE)) || defined ALT_USE_LCD_16207 - -/* - * Macros used by alt_sys_init when the ALT file descriptor facility is used. - */ -#define ALTERA_AVALON_LCD_16207_DEV_INSTANCE(name, d) \ - static altera_avalon_lcd_16207_dev d = \ - { \ - { \ - ALT_LLIST_ENTRY, \ - name##_NAME, \ - NULL, /* open */ \ - NULL, /* close */ \ - NULL, /* read */ \ - altera_avalon_lcd_16207_write_fd, \ - NULL, /* lseek */ \ - NULL, /* fstat */ \ - NULL, /* ioctl */ \ - }, \ - { \ - name##_BASE \ - }, \ - } - -#define ALTERA_AVALON_LCD_16207_DEV_INIT(name, d) \ - { \ - ALTERA_AVALON_LCD_16207_STATE_INIT(name, d.state); \ - \ - /* make the device available to the system */ \ - alt_dev_reg(&d.dev); \ - } - -#else /* exclude driver */ - -#define ALTERA_AVALON_LCD_16207_DEV_INSTANCE(name, d) extern int alt_no_storage -#define ALTERA_AVALON_LCD_16207_DEV_INIT(name, d) while (0) - -#endif - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALTERA_AVALON_LCD_16207_FD_H__ */ diff --git a/software/qsys_tutorial_lcd2_bsp/drivers/inc/altera_avalon_lcd_16207_regs.h b/software/qsys_tutorial_lcd2_bsp/drivers/inc/altera_avalon_lcd_16207_regs.h deleted file mode 100644 index 79e29a6..0000000 --- a/software/qsys_tutorial_lcd2_bsp/drivers/inc/altera_avalon_lcd_16207_regs.h +++ /dev/null @@ -1,83 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#ifndef __ALTERA_AVALON_LCD_16207_REGS_H__ -#define __ALTERA_AVALON_LCD_16207_REGS_H__ - -/* -/////////////////////////////////////////////////////////////////////////// -// -// ALTERA_AVALON_LCD_16207 PERIPHERAL -// -// Provides a hardware interface that allows software to -// access the two (2) internal 8-bit registers in an Optrex -// model 16207 (or equivalent) character LCD display (the kind -// shipped with the Nios Development Kit, 2 rows x 16 columns). -// -// Because the interface to the LCD module is "not quite Avalon," -// the hardware in this module ends-up mapping the module's -// two physical read-write registers into four Avalon-visible -// registers: Two read-only registers and two write-only registers. -// A picture is worth a thousand words: -// -// THE REGISTER MAP -// -// 7 6 5 4 3 2 1 0 Offset -// +-----+-----+-----+-----+-----+-----+-----+-----+ -// RS = 0 | Command Register (WRITE-Only) | 0 -// +-----+-----+-----+-----+-----+-----+-----+-----+ -// RS = 0 | Status Register (READ -Only) | 1 -// +-----+-----+-----+-----+-----+-----+-----+-----+ -// RS = 1 | Data Register (WRITE-Only) | 2 -// +-----+-----+-----+-----+-----+-----+-----+-----+ -// RS = 1 | Data Register (READ -Only) | 3 -// +-----+-----+-----+-----+-----+-----+-----+-----+ -// -/////////////////////////////////////////////////////////////////////////// -*/ - -#include - -#define IOADDR_ALTERA_AVALON_LCD_16207_COMMAND(base) __IO_CALC_ADDRESS_NATIVE(base, 0) -#define IOWR_ALTERA_AVALON_LCD_16207_COMMAND(base, data) IOWR(base, 0, data) - -#define IOADDR_ALTERA_AVALON_LCD_16207_STATUS(base) __IO_CALC_ADDRESS_NATIVE(base, 1) -#define IORD_ALTERA_AVALON_LCD_16207_STATUS(base) IORD(base, 1) - -#define ALTERA_AVALON_LCD_16207_STATUS_BUSY_MSK (0x00000080u) -#define ALTERA_AVALON_LCD_16207_STATUS_BUSY_OFST (7) - -#define IOADDR_ALTERA_AVALON_LCD_16207_DATA_WR(base) __IO_CALC_ADDRESS_NATIVE(base, 2) -#define IOWR_ALTERA_AVALON_LCD_16207_DATA(base, data) IOWR(base, 2, data) - -#define IOADDR_ALTERA_AVALON_LCD_16207_DATA_RD(base) __IO_CALC_ADDRESS_NATIVE(base, 3) -#define IORD_ALTERA_AVALON_LCD_16207_DATA(base) IORD(base, 3) - -#endif diff --git a/software/qsys_tutorial_lcd2_bsp/drivers/inc/altera_avalon_pio_regs.h b/software/qsys_tutorial_lcd2_bsp/drivers/inc/altera_avalon_pio_regs.h deleted file mode 100644 index 052439f..0000000 --- a/software/qsys_tutorial_lcd2_bsp/drivers/inc/altera_avalon_pio_regs.h +++ /dev/null @@ -1,67 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#ifndef __ALTERA_AVALON_PIO_REGS_H__ -#define __ALTERA_AVALON_PIO_REGS_H__ - -#include - -#define IOADDR_ALTERA_AVALON_PIO_DATA(base) __IO_CALC_ADDRESS_NATIVE(base, 0) -#define IORD_ALTERA_AVALON_PIO_DATA(base) IORD(base, 0) -#define IOWR_ALTERA_AVALON_PIO_DATA(base, data) IOWR(base, 0, data) - -#define IOADDR_ALTERA_AVALON_PIO_DIRECTION(base) __IO_CALC_ADDRESS_NATIVE(base, 1) -#define IORD_ALTERA_AVALON_PIO_DIRECTION(base) IORD(base, 1) -#define IOWR_ALTERA_AVALON_PIO_DIRECTION(base, data) IOWR(base, 1, data) - -#define IOADDR_ALTERA_AVALON_PIO_IRQ_MASK(base) __IO_CALC_ADDRESS_NATIVE(base, 2) -#define IORD_ALTERA_AVALON_PIO_IRQ_MASK(base) IORD(base, 2) -#define IOWR_ALTERA_AVALON_PIO_IRQ_MASK(base, data) IOWR(base, 2, data) - -#define IOADDR_ALTERA_AVALON_PIO_EDGE_CAP(base) __IO_CALC_ADDRESS_NATIVE(base, 3) -#define IORD_ALTERA_AVALON_PIO_EDGE_CAP(base) IORD(base, 3) -#define IOWR_ALTERA_AVALON_PIO_EDGE_CAP(base, data) IOWR(base, 3, data) - - -#define IOADDR_ALTERA_AVALON_PIO_SET_BIT(base) __IO_CALC_ADDRESS_NATIVE(base, 4) -#define IORD_ALTERA_AVALON_PIO_SET_BITS(base) IORD(base, 4) -#define IOWR_ALTERA_AVALON_PIO_SET_BITS(base, data) IOWR(base, 4, data) - -#define IOADDR_ALTERA_AVALON_PIO_CLEAR_BITS(base) __IO_CALC_ADDRESS_NATIVE(base, 5) -#define IORD_ALTERA_AVALON_PIO_CLEAR_BITS(base) IORD(base, 5) -#define IOWR_ALTERA_AVALON_PIO_CLEAR_BITS(base, data) IOWR(base, 5, data) - - - -/* Defintions for direction-register operation with bi-directional PIOs */ -#define ALTERA_AVALON_PIO_DIRECTION_INPUT 0 -#define ALTERA_AVALON_PIO_DIRECTION_OUTPUT 1 - -#endif /* __ALTERA_AVALON_PIO_REGS_H__ */ diff --git a/software/qsys_tutorial_lcd2_bsp/drivers/src/altera_avalon_jtag_uart_fd.c b/software/qsys_tutorial_lcd2_bsp/drivers/src/altera_avalon_jtag_uart_fd.c deleted file mode 100644 index 53dfc3b..0000000 --- a/software/qsys_tutorial_lcd2_bsp/drivers/src/altera_avalon_jtag_uart_fd.c +++ /dev/null @@ -1,86 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "alt_types.h" -#include "sys/alt_dev.h" -#include "altera_avalon_jtag_uart.h" - -extern int altera_avalon_jtag_uart_read(altera_avalon_jtag_uart_state* sp, - char* buffer, int space, int flags); -extern int altera_avalon_jtag_uart_write(altera_avalon_jtag_uart_state* sp, - const char* ptr, int count, int flags); -extern int altera_avalon_jtag_uart_ioctl(altera_avalon_jtag_uart_state* sp, - int req, void* arg); -extern int altera_avalon_jtag_uart_close(altera_avalon_jtag_uart_state* sp, - int flags); - -/* ----------------------------------------------------------------------- */ -/* --------------------- WRAPPERS FOR ALT FD SUPPORT --------------------- */ -/* - * - */ - -int -altera_avalon_jtag_uart_read_fd(alt_fd* fd, char* buffer, int space) -{ - altera_avalon_jtag_uart_dev* dev = (altera_avalon_jtag_uart_dev*) fd->dev; - - return altera_avalon_jtag_uart_read(&dev->state, buffer, space, - fd->fd_flags); -} - -int -altera_avalon_jtag_uart_write_fd(alt_fd* fd, const char* buffer, int space) -{ - altera_avalon_jtag_uart_dev* dev = (altera_avalon_jtag_uart_dev*) fd->dev; - - return altera_avalon_jtag_uart_write(&dev->state, buffer, space, - fd->fd_flags); -} - -#ifndef ALTERA_AVALON_JTAG_UART_SMALL - -int -altera_avalon_jtag_uart_close_fd(alt_fd* fd) -{ - altera_avalon_jtag_uart_dev* dev = (altera_avalon_jtag_uart_dev*) fd->dev; - - return altera_avalon_jtag_uart_close(&dev->state, fd->fd_flags); -} - -int -altera_avalon_jtag_uart_ioctl_fd(alt_fd* fd, int req, void* arg) -{ - altera_avalon_jtag_uart_dev* dev = (altera_avalon_jtag_uart_dev*) fd->dev; - - return altera_avalon_jtag_uart_ioctl(&dev->state, req, arg); -} - -#endif /* ALTERA_AVALON_JTAG_UART_SMALL */ diff --git a/software/qsys_tutorial_lcd2_bsp/drivers/src/altera_avalon_jtag_uart_init.c b/software/qsys_tutorial_lcd2_bsp/drivers/src/altera_avalon_jtag_uart_init.c deleted file mode 100644 index 7317bec..0000000 --- a/software/qsys_tutorial_lcd2_bsp/drivers/src/altera_avalon_jtag_uart_init.c +++ /dev/null @@ -1,256 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include -#include -#include -#include - -#include - -#include "sys/alt_irq.h" -#include "sys/alt_alarm.h" -#include "sys/ioctl.h" -#include "alt_types.h" - -#include "altera_avalon_jtag_uart_regs.h" -#include "altera_avalon_jtag_uart.h" - -#include "sys/alt_log_printf.h" - -#ifndef ALTERA_AVALON_JTAG_UART_SMALL - -/* ----------------------------------------------------------- */ -/* ------------------------- FAST DRIVER --------------------- */ -/* ----------------------------------------------------------- */ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT -static void altera_avalon_jtag_uart_irq(void* context); -#else -static void altera_avalon_jtag_uart_irq(void* context, alt_u32 id); -#endif -static alt_u32 altera_avalon_jtag_uart_timeout(void* context); - -/* - * Driver initialization code. Register interrupts and start a timer - * which we can use to check whether the host is there. - * Return 1 on sucessful IRQ register and 0 on failure. - */ - -void altera_avalon_jtag_uart_init(altera_avalon_jtag_uart_state* sp, - int irq_controller_id, int irq) -{ - ALT_FLAG_CREATE(&sp->events, 0); - ALT_SEM_CREATE(&sp->read_lock, 1); - ALT_SEM_CREATE(&sp->write_lock, 1); - - /* enable read interrupts at the device */ - sp->irq_enable = ALTERA_AVALON_JTAG_UART_CONTROL_RE_MSK; - - IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base, sp->irq_enable); - - /* register the interrupt handler */ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - alt_ic_isr_register(irq_controller_id, irq, altera_avalon_jtag_uart_irq, - sp, NULL); -#else - alt_irq_register(irq, sp, altera_avalon_jtag_uart_irq); -#endif - - /* Register an alarm to go off every second to check for presence of host */ - sp->host_inactive = 0; - - if (alt_alarm_start(&sp->alarm, alt_ticks_per_second(), - &altera_avalon_jtag_uart_timeout, sp) < 0) - { - /* If we can't set the alarm then record "don't know if host present" - * and behave as though the host is present. - */ - sp->timeout = INT_MAX; - } - - /* ALT_LOG - see altera_hal/HAL/inc/sys/alt_log_printf.h */ - ALT_LOG_JTAG_UART_ALARM_REGISTER(sp, sp->base); -} - -/* - * Interrupt routine - */ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT -static void altera_avalon_jtag_uart_irq(void* context) -#else -static void altera_avalon_jtag_uart_irq(void* context, alt_u32 id) -#endif -{ - altera_avalon_jtag_uart_state* sp = (altera_avalon_jtag_uart_state*) context; - unsigned int base = sp->base; - - /* ALT_LOG - see altera_hal/HAL/inc/sys/alt_log_printf.h */ - ALT_LOG_JTAG_UART_ISR_FUNCTION(base, sp); - - for ( ; ; ) - { - unsigned int control = IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base); - - /* Return once nothing more to do */ - if ((control & (ALTERA_AVALON_JTAG_UART_CONTROL_RI_MSK | ALTERA_AVALON_JTAG_UART_CONTROL_WI_MSK)) == 0) - break; - - if (control & ALTERA_AVALON_JTAG_UART_CONTROL_RI_MSK) - { - /* process a read irq. Start by assuming that there is data in the - * receive FIFO (otherwise why would we have been interrupted?) - */ - unsigned int data = 1 << ALTERA_AVALON_JTAG_UART_DATA_RAVAIL_OFST; - - for ( ; ; ) - { - /* Check whether there is space in the buffer. If not then we must not - * read any characters from the buffer as they will be lost. - */ - unsigned int next = (sp->rx_in + 1) % ALTERA_AVALON_JTAG_UART_BUF_LEN; - if (next == sp->rx_out) - break; - - /* Try to remove a character from the FIFO and find out whether there - * are any more characters remaining. - */ - data = IORD_ALTERA_AVALON_JTAG_UART_DATA(base); - - if ((data & ALTERA_AVALON_JTAG_UART_DATA_RVALID_MSK) == 0) - break; - - sp->rx_buf[sp->rx_in] = (data & ALTERA_AVALON_JTAG_UART_DATA_DATA_MSK) >> ALTERA_AVALON_JTAG_UART_DATA_DATA_OFST; - sp->rx_in = (sp->rx_in + 1) % ALTERA_AVALON_JTAG_UART_BUF_LEN; - - /* Post an event to notify jtag_uart_read that a character has been read */ - ALT_FLAG_POST (sp->events, ALT_JTAG_UART_READ_RDY, OS_FLAG_SET); - } - - if (data & ALTERA_AVALON_JTAG_UART_DATA_RAVAIL_MSK) - { - /* If there is still data available here then the buffer is full - * so turn off receive interrupts until some space becomes available. - */ - sp->irq_enable &= ~ALTERA_AVALON_JTAG_UART_CONTROL_RE_MSK; - IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(base, sp->irq_enable); - - /* Dummy read to ensure IRQ is cleared prior to ISR completion */ - IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base); - } - } - - if (control & ALTERA_AVALON_JTAG_UART_CONTROL_WI_MSK) - { - /* process a write irq */ - unsigned int space = (control & ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_MSK) >> ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_OFST; - - while (space > 0 && sp->tx_out != sp->tx_in) - { - IOWR_ALTERA_AVALON_JTAG_UART_DATA(base, sp->tx_buf[sp->tx_out]); - - sp->tx_out = (sp->tx_out + 1) % ALTERA_AVALON_JTAG_UART_BUF_LEN; - - /* Post an event to notify jtag_uart_write that a character has been written */ - ALT_FLAG_POST (sp->events, ALT_JTAG_UART_WRITE_RDY, OS_FLAG_SET); - - space--; - } - - if (space > 0) - { - /* If we don't have any more data available then turn off the TX interrupt */ - sp->irq_enable &= ~ALTERA_AVALON_JTAG_UART_CONTROL_WE_MSK; - IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base, sp->irq_enable); - - /* Dummy read to ensure IRQ is cleared prior to ISR completion */ - IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base); - } - } - } -} - -/* - * Timeout routine is called every second - */ - -static alt_u32 -altera_avalon_jtag_uart_timeout(void* context) -{ - altera_avalon_jtag_uart_state* sp = (altera_avalon_jtag_uart_state *) context; - - unsigned int control = IORD_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base); - - if (control & ALTERA_AVALON_JTAG_UART_CONTROL_AC_MSK) - { - IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base, sp->irq_enable | ALTERA_AVALON_JTAG_UART_CONTROL_AC_MSK); - sp->host_inactive = 0; - } - else if (sp->host_inactive < INT_MAX - 2) { - sp->host_inactive++; - - if (sp->host_inactive >= sp->timeout) { - /* Post an event to indicate host is inactive (for jtag_uart_read */ - ALT_FLAG_POST (sp->events, ALT_JTAG_UART_TIMEOUT, OS_FLAG_SET); - } - } - - return alt_ticks_per_second(); -} - -/* - * The close() routine is implemented to drain the JTAG UART transmit buffer - * when not in "small" mode. This routine will wait for transimt data to be - * emptied unless a timeout from host-activity occurs. If the driver flags - * have been set to non-blocking mode, this routine will exit immediately if - * any data remains. This routine should be called indirectly (i.e. though - * the C library close() routine) so that the file descriptor associated - * with the relevant stream (i.e. stdout) can be closed as well. This routine - * does not manage file descriptors. - * - * The close routine is not implemented for the small driver; instead it will - * map to null. This is because the small driver simply waits while characters - * are transmitted; there is no interrupt-serviced buffer to empty - */ -int altera_avalon_jtag_uart_close(altera_avalon_jtag_uart_state* sp, int flags) -{ - /* - * Wait for all transmit data to be emptied by the JTAG UART ISR, or - * for a host-inactivity timeout, in which case transmit data will be lost - */ - while ( (sp->tx_out != sp->tx_in) && (sp->host_inactive < sp->timeout) ) { - if (flags & O_NONBLOCK) { - return -EWOULDBLOCK; - } - } - - return 0; -} - -#endif /* !ALTERA_AVALON_JTAG_UART_SMALL */ diff --git a/software/qsys_tutorial_lcd2_bsp/drivers/src/altera_avalon_jtag_uart_ioctl.c b/software/qsys_tutorial_lcd2_bsp/drivers/src/altera_avalon_jtag_uart_ioctl.c deleted file mode 100644 index cf71e6f..0000000 --- a/software/qsys_tutorial_lcd2_bsp/drivers/src/altera_avalon_jtag_uart_ioctl.c +++ /dev/null @@ -1,86 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include -#include -#include -#include - -#include - -#include "sys/ioctl.h" -#include "alt_types.h" - -#include "altera_avalon_jtag_uart_regs.h" -#include "altera_avalon_jtag_uart.h" - -#include "sys/alt_log_printf.h" - -#ifndef ALTERA_AVALON_JTAG_UART_SMALL - -/* ----------------------------------------------------------- */ -/* ------------------------- FAST DRIVER --------------------- */ -/* ----------------------------------------------------------- */ - -int -altera_avalon_jtag_uart_ioctl(altera_avalon_jtag_uart_state* sp, int req, - void* arg) -{ - int rc = -ENOTTY; - - switch (req) - { - case TIOCSTIMEOUT: - /* Set the time to wait until assuming host is not connected */ - if (sp->timeout != INT_MAX) - { - int timeout = *((int *)arg); - sp->timeout = (timeout >= 2 && timeout < INT_MAX) ? timeout : INT_MAX - 1; - rc = 0; - } - break; - - case TIOCGCONNECTED: - /* Find out whether host is connected */ - if (sp->timeout != INT_MAX) - { - *((int *)arg) = (sp->host_inactive < sp->timeout) ? 1 : 0; - rc = 0; - } - break; - - default: - break; - } - - return rc; -} - -#endif /* !ALTERA_AVALON_JTAG_UART_SMALL */ diff --git a/software/qsys_tutorial_lcd2_bsp/drivers/src/altera_avalon_jtag_uart_read.c b/software/qsys_tutorial_lcd2_bsp/drivers/src/altera_avalon_jtag_uart_read.c deleted file mode 100644 index 5657adb..0000000 --- a/software/qsys_tutorial_lcd2_bsp/drivers/src/altera_avalon_jtag_uart_read.c +++ /dev/null @@ -1,205 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include -#include -#include -#include - -#include - -#include "sys/alt_irq.h" -#include "sys/alt_alarm.h" -#include "sys/ioctl.h" -#include "alt_types.h" - -#include "altera_avalon_jtag_uart_regs.h" -#include "altera_avalon_jtag_uart.h" - -#include "sys/alt_log_printf.h" - -#ifdef __ucosii__ -#include "includes.h" -#endif /* __ucosii__ */ - -#ifdef ALTERA_AVALON_JTAG_UART_SMALL - -/* ----------------------------------------------------------- */ -/* ----------------------- SMALL DRIVER ---------------------- */ -/* ----------------------------------------------------------- */ - -/* Read routine. The small version blocks until it has at least one byte - * available, it then returns as much as is immediately available without - * waiting any more. It's performance will be very poor without - * interrupts. - */ - -int -altera_avalon_jtag_uart_read(altera_avalon_jtag_uart_state* sp, - char* buffer, int space, int flags) -{ - unsigned int base = sp->base; - - char * ptr = buffer; - char * end = buffer + space; - - while (ptr < end) - { - unsigned int data = IORD_ALTERA_AVALON_JTAG_UART_DATA(base); - - if (data & ALTERA_AVALON_JTAG_UART_DATA_RVALID_MSK) - *ptr++ = (data & ALTERA_AVALON_JTAG_UART_DATA_DATA_MSK) >> ALTERA_AVALON_JTAG_UART_DATA_DATA_OFST; - else if (ptr != buffer) - break; - else if(flags & O_NONBLOCK) - break; - - } - - if (ptr != buffer) - return ptr - buffer; - else if (flags & O_NONBLOCK) - return -EWOULDBLOCK; - else - return -EIO; -} - -#else /* !ALTERA_AVALON_JTAG_UART_SMALL */ - -/* ----------------------------------------------------------- */ -/* ----------------------- FAST DRIVER ----------------------- */ -/* ----------------------------------------------------------- */ - -int -altera_avalon_jtag_uart_read(altera_avalon_jtag_uart_state* sp, - char * buffer, int space, int flags) -{ - char * ptr = buffer; - - alt_irq_context context; - unsigned int n; - - /* - * When running in a multi threaded environment, obtain the "read_lock" - * semaphore. This ensures that reading from the device is thread-safe. - */ - ALT_SEM_PEND (sp->read_lock, 0); - - while (space > 0) - { - unsigned int in, out; - - /* Read as much data as possible */ - do - { - in = sp->rx_in; - out = sp->rx_out; - - if (in >= out) - n = in - out; - else - n = ALTERA_AVALON_JTAG_UART_BUF_LEN - out; - - if (n == 0) - break; /* No more data available */ - - if (n > space) - n = space; - - memcpy(ptr, sp->rx_buf + out, n); - ptr += n; - space -= n; - - sp->rx_out = (out + n) % ALTERA_AVALON_JTAG_UART_BUF_LEN; - } - while (space > 0); - - /* If we read any data then return it */ - if (ptr != buffer) - break; - - /* If in non-blocking mode then return error */ - if (flags & O_NONBLOCK) - break; - -#ifdef __ucosii__ - /* OS Present: Pend on a flag if the OS is running, otherwise spin */ - if(OSRunning == OS_TRUE) { - /* - * When running in a multi-threaded mode, we pend on the read event - * flag set and timeout event flag set in the isr. This avoids wasting CPU - * cycles waiting in this thread, when we could be doing something more - * profitable elsewhere. - */ - ALT_FLAG_PEND (sp->events, - ALT_JTAG_UART_READ_RDY | ALT_JTAG_UART_TIMEOUT, - OS_FLAG_WAIT_SET_ANY + OS_FLAG_CONSUME, - 0); - } - else { - /* Spin until more data arrives or until host disconnects */ - while (in == sp->rx_in && sp->host_inactive < sp->timeout) - ; - } -#else - /* No OS: Always spin */ - while (in == sp->rx_in && sp->host_inactive < sp->timeout) - ; -#endif /* __ucosii__ */ - - if (in == sp->rx_in) - break; - } - - /* - * Now that access to the circular buffer is complete, release the read - * semaphore so that other threads can access the buffer. - */ - - ALT_SEM_POST (sp->read_lock); - - if (ptr != buffer) - { - /* If we read any data then there is space in the buffer so enable interrupts */ - context = alt_irq_disable_all(); - sp->irq_enable |= ALTERA_AVALON_JTAG_UART_CONTROL_RE_MSK; - IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base, sp->irq_enable); - alt_irq_enable_all(context); - } - - if (ptr != buffer) - return ptr - buffer; - else if (flags & O_NONBLOCK) - return -EWOULDBLOCK; - else - return -EIO; -} - -#endif /* ALTERA_AVALON_JTAG_UART_SMALL */ diff --git a/software/qsys_tutorial_lcd2_bsp/drivers/src/altera_avalon_jtag_uart_write.c b/software/qsys_tutorial_lcd2_bsp/drivers/src/altera_avalon_jtag_uart_write.c deleted file mode 100644 index 11aeca1..0000000 --- a/software/qsys_tutorial_lcd2_bsp/drivers/src/altera_avalon_jtag_uart_write.c +++ /dev/null @@ -1,217 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include -#include -#include -#include - -#include - -#include "sys/alt_irq.h" -#include "sys/alt_alarm.h" -#include "sys/ioctl.h" -#include "alt_types.h" - -#include "altera_avalon_jtag_uart_regs.h" -#include "altera_avalon_jtag_uart.h" - -#include "sys/alt_log_printf.h" - -#ifdef __ucosii__ -#include "includes.h" -#endif /* __ucosii__ */ - -#ifdef ALTERA_AVALON_JTAG_UART_SMALL - -/* ----------------------------------------------------------- */ -/* ------------------------ SMALL DRIVER --------------------- */ -/* ----------------------------------------------------------- */ - -/* Write routine. The small version blocks when there is no space to write - * into, so it's performance will be very bad if you are writing more than - * one FIFOs worth of data. But you said you didn't want to use interrupts :-) - */ - -int altera_avalon_jtag_uart_write(altera_avalon_jtag_uart_state* sp, - const char * ptr, int count, int flags) -{ - unsigned int base = sp->base; - - const char * end = ptr + count; - - while (ptr < end) - if ((IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base) & ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_MSK) != 0) - IOWR_ALTERA_AVALON_JTAG_UART_DATA(base, *ptr++); - - return count; -} - -#else /* !ALTERA_AVALON_JTAG_UART_SMALL */ - -/* ----------------------------------------------------------- */ -/* ------------------------- FAST DRIVER --------------------- */ -/* ----------------------------------------------------------- */ - -int -altera_avalon_jtag_uart_write(altera_avalon_jtag_uart_state* sp, - const char * ptr, int count, int flags) -{ - /* Remove warning at optimisation level 03 by seting out to 0 */ - unsigned int in, out=0; - unsigned int n; - alt_irq_context context; - - const char * start = ptr; - - /* - * When running in a multi threaded environment, obtain the "write_lock" - * semaphore. This ensures that writing to the device is thread-safe. - */ - ALT_SEM_PEND (sp->write_lock, 0); - - do - { - /* Copy as much as we can into the transmit buffer */ - while (count > 0) - { - /* We need a stable value of the out pointer to calculate the space available */ - in = sp->tx_in; - out = sp->tx_out; - - if (in < out) - n = out - 1 - in; - else if (out > 0) - n = ALTERA_AVALON_JTAG_UART_BUF_LEN - in; - else - n = ALTERA_AVALON_JTAG_UART_BUF_LEN - 1 - in; - - if (n == 0) - break; - - if (n > count) - n = count; - - memcpy(sp->tx_buf + in, ptr, n); - ptr += n; - count -= n; - - sp->tx_in = (in + n) % ALTERA_AVALON_JTAG_UART_BUF_LEN; - } - - /* - * If interrupts are disabled then we could transmit here, we only need - * to enable interrupts if there is no space left in the FIFO - * - * For now kick the interrupt routine every time to make it transmit - * the data - */ - context = alt_irq_disable_all(); - sp->irq_enable |= ALTERA_AVALON_JTAG_UART_CONTROL_WE_MSK; - IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base, sp->irq_enable); - alt_irq_enable_all(context); - - /* - * If there is any data left then either return now or block until - * some has been sent - */ - /* consider: test whether there is anything there while doing this and delay for at most 2s. */ - if (count > 0) - { - if (flags & O_NONBLOCK) - break; - -#ifdef __ucosii__ - /* OS Present: Pend on a flag if the OS is running, otherwise spin */ - if(OSRunning == OS_TRUE) { - /* - * When running in a multi-threaded mode, we pend on the write event - * flag set or the timeout flag in the isr. This avoids wasting CPU - * cycles waiting in this thread, when we could be doing something - * more profitable elsewhere. - */ -#ifdef ALTERA_AVALON_JTAG_UART_IGNORE_FIFO_FULL_ERROR - if(!sp->host_inactive) -#endif - ALT_FLAG_PEND (sp->events, - ALT_JTAG_UART_WRITE_RDY | ALT_JTAG_UART_TIMEOUT, - OS_FLAG_WAIT_SET_ANY + OS_FLAG_CONSUME, - 0); - } - else { - /* - * OS not running: Wait for data to be removed from buffer. - * Once the interrupt routine has removed some data then we - * will be able to insert some more. - */ - while (out == sp->tx_out && sp->host_inactive < sp->timeout) - ; - } -#else - /* - * No OS present: Always wait for data to be removed from buffer. Once - * the interrupt routine has removed some data then we will be able to - * insert some more. - */ - while (out == sp->tx_out && sp->host_inactive < sp->timeout) - ; -#endif /* __ucosii__ */ - - if (out == sp->tx_out) - break; - } - } - while (count > 0); - - /* - * Now that access to the circular buffer is complete, release the write - * semaphore so that other threads can access the buffer. - */ - ALT_SEM_POST (sp->write_lock); - - if (ptr != start) - return ptr - start; - else if (flags & O_NONBLOCK) - return -EWOULDBLOCK; -#ifdef ALTERA_AVALON_JTAG_UART_IGNORE_FIFO_FULL_ERROR - else if (sp->host_inactive >= sp->timeout) { - /* - * Reset the software FIFO, hardware FIFO could not be reset. - * Just throw away characters without reporting error. - */ - sp->tx_out = sp->tx_in = 0; - return ptr - start + count; - } -#endif - else - return -EIO; /* Host not connected */ -} - -#endif /* ALTERA_AVALON_JTAG_UART_SMALL */ diff --git a/software/qsys_tutorial_lcd2_bsp/drivers/src/altera_avalon_lcd_16207.c b/software/qsys_tutorial_lcd2_bsp/drivers/src/altera_avalon_lcd_16207.c deleted file mode 100644 index 1fefba3..0000000 --- a/software/qsys_tutorial_lcd2_bsp/drivers/src/altera_avalon_lcd_16207.c +++ /dev/null @@ -1,605 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* ===================================================================== */ - -/* - * This file provides the implementation of the functions used to drive a - * LCD panel. - * - * Characters written to the device will appear on the LCD panel as though - * it is a very small terminal. If the lines written to the terminal are - * longer than the number of characters on the terminal then it will scroll - * the lines of text automatically to display them all. - * - * If more lines are written than will fit on the terminal then it will scroll - * when characters are written to the line "below" the last displayed one - - * the cursor is allowed to sit below the visible area of the screen providing - * that this line is entirely blank. - * - * The following control sequences may be used to move around and do useful - * stuff: - * CR Moves back to the start of the current line - * LF Moves down a line and back to the start - * BS Moves back a character without erasing - * ESC Starts a VT100 style escape sequence - * - * The following escape sequences are recognised: - * ESC [ ; H Move to row and column specified (positions are - * counted from the top left which is 1;1) - * ESC [ K Clear from current position to end of line - * ESC [ 2 J Clear screen and go to top left - * - */ - -/* ===================================================================== */ - -#include -#include - -#include -#include -#include - -#include "sys/alt_alarm.h" - -#include "altera_avalon_lcd_16207_regs.h" -#include "altera_avalon_lcd_16207.h" - -/* --------------------------------------------------------------------- */ - -/* Commands which can be written to the COMMAND register */ - -enum /* Write to character RAM */ -{ - LCD_CMD_WRITE_DATA = 0x80 - /* Bits 6:0 hold character RAM address */ -}; - -enum /* Write to character generator RAM */ -{ - LCD_CMD_WRITE_CGR = 0x40 - /* Bits 5:0 hold character generator RAM address */ -}; - -enum /* Function Set command */ -{ - LCD_CMD_FUNCTION_SET = 0x20, - LCD_CMD_8BIT = 0x10, - LCD_CMD_TWO_LINE = 0x08, - LCD_CMD_BIGFONT = 0x04 -}; - -enum /* Shift command */ -{ - LCD_CMD_SHIFT = 0x10, - LCD_CMD_SHIFT_DISPLAY = 0x08, - LCD_CMD_SHIFT_RIGHT = 0x04 -}; - -enum /* On/Off command */ -{ - LCD_CMD_ONOFF = 0x08, - LCD_CMD_ENABLE_DISP = 0x04, - LCD_CMD_ENABLE_CURSOR = 0x02, - LCD_CMD_ENABLE_BLINK = 0x01 -}; - -enum /* Entry Mode command */ -{ - LCD_CMD_MODES = 0x04, - LCD_CMD_MODE_INC = 0x02, - LCD_CMD_MODE_SHIFT = 0x01 -}; - -enum /* Home command */ -{ - LCD_CMD_HOME = 0x02 -}; - -enum /* Clear command */ -{ - LCD_CMD_CLEAR = 0x01 -}; - -/* Where in LCD character space do the rows start */ -static char colstart[4] = { 0x00, 0x40, 0x20, 0x60 }; - -/* --------------------------------------------------------------------- */ - -static void lcd_write_command(altera_avalon_lcd_16207_state* sp, - unsigned char command) -{ - unsigned int base = sp->base; - - /* We impose a timeout on the driver in case the LCD panel isn't connected. - * The first time we call this function the timeout is approx 25ms - * (assuming 5 cycles per loop and a 200MHz clock). Obviously systems - * with slower clocks, or debug builds, or slower memory will take longer. - */ - int i = 1000000; - - /* Don't bother if the LCD panel didn't work before */ - if (sp->broken) - return; - - /* Wait until LCD isn't busy. */ - while (IORD_ALTERA_AVALON_LCD_16207_STATUS(base) & ALTERA_AVALON_LCD_16207_STATUS_BUSY_MSK) - if (--i == 0) - { - sp->broken = 1; - return; - } - - /* Despite what it says in the datasheet, the LCD isn't ready to accept - * a write immediately after it returns BUSY=0. Wait for 100us more. - */ - usleep(100); - - IOWR_ALTERA_AVALON_LCD_16207_COMMAND(base, command); -} - -/* --------------------------------------------------------------------- */ - -static void lcd_write_data(altera_avalon_lcd_16207_state* sp, - unsigned char data) -{ - unsigned int base = sp->base; - - /* We impose a timeout on the driver in case the LCD panel isn't connected. - * The first time we call this function the timeout is approx 25ms - * (assuming 5 cycles per loop and a 200MHz clock). Obviously systems - * with slower clocks, or debug builds, or slower memory will take longer. - */ - int i = 1000000; - - /* Don't bother if the LCD panel didn't work before */ - if (sp->broken) - return; - - /* Wait until LCD isn't busy. */ - while (IORD_ALTERA_AVALON_LCD_16207_STATUS(base) & ALTERA_AVALON_LCD_16207_STATUS_BUSY_MSK) - if (--i == 0) - { - sp->broken = 1; - return; - } - - /* Despite what it says in the datasheet, the LCD isn't ready to accept - * a write immediately after it returns BUSY=0. Wait for 100us more. - */ - usleep(100); - - IOWR_ALTERA_AVALON_LCD_16207_DATA(base, data); - - sp->address++; -} - -/* --------------------------------------------------------------------- */ - -static void lcd_clear_screen(altera_avalon_lcd_16207_state* sp) -{ - int y; - - lcd_write_command(sp, LCD_CMD_CLEAR); - - sp->x = 0; - sp->y = 0; - sp->address = 0; - - for (y = 0 ; y < ALT_LCD_HEIGHT ; y++) - { - memset(sp->line[y].data, ' ', sizeof(sp->line[0].data)); - memset(sp->line[y].visible, ' ', sizeof(sp->line[0].visible)); - sp->line[y].width = 0; - } -} - -/* --------------------------------------------------------------------- */ - -static void lcd_repaint_screen(altera_avalon_lcd_16207_state* sp) -{ - int y, x; - - /* scrollpos controls how much the lines have scrolled round. The speed - * each line scrolls at is controlled by its speed variable - while - * scrolline lines will wrap at the position set by width - */ - - int scrollpos = sp->scrollpos; - - for (y = 0 ; y < ALT_LCD_HEIGHT ; y++) - { - int width = sp->line[y].width; - int offset = (scrollpos * sp->line[y].speed) >> 8; - if (offset >= width) - offset = 0; - - for (x = 0 ; x < ALT_LCD_WIDTH ; x++) - { - char c = sp->line[y].data[(x + offset) % width]; - - /* Writing data takes 40us, so don't do it unless required */ - if (sp->line[y].visible[x] != c) - { - unsigned char address = x + colstart[y]; - - if (address != sp->address) - { - lcd_write_command(sp, LCD_CMD_WRITE_DATA | address); - sp->address = address; - } - - lcd_write_data(sp, c); - sp->line[y].visible[x] = c; - } - } - } -} - -/* --------------------------------------------------------------------- */ - -static void lcd_scroll_up(altera_avalon_lcd_16207_state* sp) -{ - int y; - - for (y = 0 ; y < ALT_LCD_HEIGHT ; y++) - { - if (y < ALT_LCD_HEIGHT-1) - memcpy(sp->line[y].data, sp->line[y+1].data, ALT_LCD_VIRTUAL_WIDTH); - else - memset(sp->line[y].data, ' ', ALT_LCD_VIRTUAL_WIDTH); - } - - sp->y--; -} - -/* --------------------------------------------------------------------- */ - -static void lcd_handle_escape(altera_avalon_lcd_16207_state* sp, char c) -{ - int parm1 = 0, parm2 = 0; - - if (sp->escape[0] == '[') - { - char * ptr = sp->escape+1; - while (isdigit(*ptr)) - parm1 = (parm1 * 10) + (*ptr++ - '0'); - - if (*ptr == ';') - { - ptr++; - while (isdigit(*ptr)) - parm2 = (parm2 * 10) + (*ptr++ - '0'); - } - } - else - parm1 = -1; - - switch (c) - { - case 'H': /* ESC '[' ';' 'H' : Move cursor to location */ - case 'f': /* Same as above */ - if (parm2 > 0) - sp->x = parm2 - 1; - if (parm1 > 0) - { - sp->y = parm1 - 1; - if (sp->y > ALT_LCD_HEIGHT * 2) - sp->y = ALT_LCD_HEIGHT * 2; - while (sp->y > ALT_LCD_HEIGHT) - lcd_scroll_up(sp); - } - break; - - case 'J': - /* ESC J is clear to beginning of line [unimplemented] - * ESC [ 0 J is clear to bottom of screen [unimplemented] - * ESC [ 1 J is clear to beginning of screen [unimplemented] - * ESC [ 2 J is clear screen - */ - if (parm1 == 2) - lcd_clear_screen(sp); - break; - - case 'K': - /* ESC K is clear to end of line - * ESC [ 0 K is clear to end of line - * ESC [ 1 K is clear to beginning of line [unimplemented] - * ESC [ 2 K is clear line [unimplemented] - */ - if (parm1 < 1) - { - if (sp->x < ALT_LCD_VIRTUAL_WIDTH) - memset(sp->line[sp->y].data + sp->x, ' ', ALT_LCD_VIRTUAL_WIDTH - sp->x); - } - break; - } -} - -/* --------------------------------------------------------------------- */ - -int altera_avalon_lcd_16207_write(altera_avalon_lcd_16207_state* sp, - const char* ptr, int len, int flags) -{ - const char* end = ptr + len; - - int y; - int widthmax; - - /* When running in a multi threaded environment, obtain the "write_lock" - * semaphore. This ensures that writing to the device is thread-safe. - */ - - ALT_SEM_PEND (sp->write_lock, 0); - - /* Tell the routine which is called off the timer interrupt that the - * foreground routines are active so it must not repaint the display. */ - sp->active = 1; - - for ( ; ptr < end ; ptr++) - { - char c = *ptr; - - if (sp->esccount >= 0) - { - unsigned int esccount = sp->esccount; - - /* Single character escape sequences can end with any character - * Multi character escape sequences start with '[' and contain - * digits and semicolons before terminating - */ - if ((esccount == 0 && c != '[') || - (esccount > 0 && !isdigit(c) && c != ';')) - { - sp->escape[esccount] = 0; - - lcd_handle_escape(sp, c); - - sp->esccount = -1; - } - else if (sp->esccount < sizeof(sp->escape)-1) - { - sp->escape[esccount] = c; - sp->esccount++; - } - } - else if (c == 27) /* ESC */ - { - sp->esccount = 0; - } - else if (c == '\r') - { - sp->x = 0; - } - else if (c == '\n') - { - sp->x = 0; - sp->y++; - - /* Let the cursor sit at X=0, Y=HEIGHT without scrolling so the user - * can print two lines of data without losing one. - */ - if (sp->y > ALT_LCD_HEIGHT) - lcd_scroll_up(sp); - } - else if (c == '\b') - { - if (sp->x > 0) - sp->x--; - } - else if (isprint(c)) - { - /* If we didn't scroll on the last linefeed then we might need to do - * it now. */ - if (sp->y >= ALT_LCD_HEIGHT) - lcd_scroll_up(sp); - - if (sp->x < ALT_LCD_VIRTUAL_WIDTH) - sp->line[sp->y].data[sp->x] = c; - - sp->x++; - } - } - - /* Recalculate the scrolling parameters */ - widthmax = ALT_LCD_WIDTH; - for (y = 0 ; y < ALT_LCD_HEIGHT ; y++) - { - int width; - for (width = ALT_LCD_VIRTUAL_WIDTH ; width > 0 ; width--) - if (sp->line[y].data[width-1] != ' ') - break; - - /* The minimum width is the size of the LCD panel. If the real width - * is long enough to require scrolling then add an extra space so the - * end of the message doesn't run into the beginning of it. - */ - if (width <= ALT_LCD_WIDTH) - width = ALT_LCD_WIDTH; - else - width++; - - sp->line[y].width = width; - if (widthmax < width) - widthmax = width; - sp->line[y].speed = 0; /* By default lines don't scroll */ - } - - if (widthmax <= ALT_LCD_WIDTH) - sp->scrollmax = 0; - else - { - widthmax *= 2; - sp->scrollmax = widthmax; - - /* Now calculate how fast each of the other lines should go */ - for (y = 0 ; y < ALT_LCD_HEIGHT ; y++) - if (sp->line[y].width > ALT_LCD_WIDTH) - { - /* You have three options for how to make the display scroll, chosen - * using the preprocessor directives below - */ -#if 1 - /* This option makes all the lines scroll round at different speeds - * which are chosen so that all the scrolls finish at the same time. - */ - sp->line[y].speed = 256 * sp->line[y].width / widthmax; -#elif 1 - /* This option pads the shorter lines with spaces so that they all - * scroll together. - */ - sp->line[y].width = widthmax / 2; - sp->line[y].speed = 256/2; -#else - /* This option makes the shorter lines stop after they have rotated - * and waits for the longer lines to catch up - */ - sp->line[y].speed = 256/2; -#endif - } - } - - /* Repaint once, then check whether there has been a missed repaint - * (because active was set when the timer interrupt occurred). If there - * has been a missed repaint then paint again. And again. etc. - */ - for ( ; ; ) - { - int old_scrollpos = sp->scrollpos; - - lcd_repaint_screen(sp); - - /* Let the timer routines repaint the display again */ - sp->active = 0; - - /* Have the timer routines tried to scroll while we were painting? - * If not then we can exit */ - if (sp->scrollpos == old_scrollpos) - break; - - /* We need to repaint again since the display scrolled while we were - * painting last time */ - sp->active = 1; - } - - /* Now that access to the display is complete, release the write - * semaphore so that other threads can access the buffer. - */ - - ALT_SEM_POST (sp->write_lock); - - return len; -} - -/* --------------------------------------------------------------------- */ - -/* This should be in a top level header file really */ -#define container_of(ptr, type, member) ((type *)((char *)ptr - offsetof(type, member))) - -/* - * Timeout routine is called every second - */ - -static alt_u32 alt_lcd_16207_timeout(void* context) -{ - altera_avalon_lcd_16207_state* sp = (altera_avalon_lcd_16207_state*)context; - - /* Update the scrolling position */ - if (sp->scrollpos + 1 >= sp->scrollmax) - sp->scrollpos = 0; - else - sp->scrollpos = sp->scrollpos + 1; - - /* Repaint the panel unless the foreground will do it again soon */ - if (sp->scrollmax > 0 && !sp->active) - lcd_repaint_screen(sp); - - return sp->period; -} - -/* --------------------------------------------------------------------- */ - -/* - * Called at boot time to initialise the LCD driver - */ -void altera_avalon_lcd_16207_init(altera_avalon_lcd_16207_state* sp) -{ - unsigned int base = sp->base; - - /* Mark the device as functional */ - sp->broken = 0; - - ALT_SEM_CREATE (&sp->write_lock, 1); - - /* The initialisation sequence below is copied from the datasheet for - * the 16207 LCD display. The first commands need to be timed because - * the BUSY bit in the status register doesn't work until the display - * has been reset three times. - */ - - /* Wait for 15 ms then reset */ - usleep(15000); - IOWR_ALTERA_AVALON_LCD_16207_COMMAND(base, LCD_CMD_FUNCTION_SET | LCD_CMD_8BIT); - - /* Wait for another 4.1ms and reset again */ - usleep(4100); - IOWR_ALTERA_AVALON_LCD_16207_COMMAND(base, LCD_CMD_FUNCTION_SET | LCD_CMD_8BIT); - - /* Wait a further 1 ms and reset a third time */ - usleep(1000); - IOWR_ALTERA_AVALON_LCD_16207_COMMAND(base, LCD_CMD_FUNCTION_SET | LCD_CMD_8BIT); - - /* Setup interface parameters: 8 bit bus, 2 rows, 5x7 font */ - lcd_write_command(sp, LCD_CMD_FUNCTION_SET | LCD_CMD_8BIT | LCD_CMD_TWO_LINE); - - /* Turn display off */ - lcd_write_command(sp, LCD_CMD_ONOFF); - - /* Clear display */ - lcd_clear_screen(sp); - - /* Set mode: increment after writing, don't shift display */ - lcd_write_command(sp, LCD_CMD_MODES | LCD_CMD_MODE_INC); - - /* Turn display on */ - lcd_write_command(sp, LCD_CMD_ONOFF | LCD_CMD_ENABLE_DISP); - - sp->esccount = -1; - memset(sp->escape, 0, sizeof(sp->escape)); - - sp->scrollpos = 0; - sp->scrollmax = 0; - sp->active = 0; - - sp->period = alt_ticks_per_second() / 10; /* Call every 100ms */ - - alt_alarm_start(&sp->alarm, sp->period, &alt_lcd_16207_timeout, sp); -} diff --git a/software/qsys_tutorial_lcd2_bsp/drivers/src/altera_avalon_lcd_16207_fd.c b/software/qsys_tutorial_lcd2_bsp/drivers/src/altera_avalon_lcd_16207_fd.c deleted file mode 100644 index 431b094..0000000 --- a/software/qsys_tutorial_lcd2_bsp/drivers/src/altera_avalon_lcd_16207_fd.c +++ /dev/null @@ -1,45 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "alt_types.h" -#include "sys/alt_dev.h" -#include "altera_avalon_lcd_16207.h" - -extern int altera_avalon_lcd_16207_write(altera_avalon_lcd_16207_state* sp, - const char* ptr, int count, int flags); - -int -altera_avalon_lcd_16207_write_fd(alt_fd* fd, const char* buffer, int space) -{ - altera_avalon_lcd_16207_dev* dev = (altera_avalon_lcd_16207_dev*) fd->dev; - - return altera_avalon_lcd_16207_write(&dev->state, buffer, space, - fd->fd_flags); -} diff --git a/software/qsys_tutorial_lcd2_bsp/libhal_bsp.a b/software/qsys_tutorial_lcd2_bsp/libhal_bsp.a deleted file mode 100644 index 2603a54..0000000 --- a/software/qsys_tutorial_lcd2_bsp/libhal_bsp.a +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/linker.h b/software/qsys_tutorial_lcd2_bsp/linker.h deleted file mode 100644 index d45b2ad..0000000 --- a/software/qsys_tutorial_lcd2_bsp/linker.h +++ /dev/null @@ -1,101 +0,0 @@ -/* - * linker.h - Linker script mapping information - * - * Machine generated for CPU 'nios2_processor' in SOPC Builder design 'nios_system' - * SOPC Builder design path: C:/Users/takayun/Documents/DE2-115/qsys_tutorial/nios_system.sopcinfo - * - * Generated: Fri Dec 02 00:00:37 JST 2016 - */ - -/* - * DO NOT MODIFY THIS FILE - * - * Changing this file will have subtle consequences - * which will almost certainly lead to a nonfunctioning - * system. If you do modify this file, be aware that your - * changes will be overwritten and lost when this file - * is generated again. - * - * DO NOT MODIFY THIS FILE - */ - -/* - * License Agreement - * - * Copyright (c) 2008 - * Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - * - * This agreement shall be governed in all respects by the laws of the State - * of California and by the laws of the United States of America. - */ - -#ifndef __LINKER_H_ -#define __LINKER_H_ - - -/* - * BSP controls alt_load() behavior in crt0. - * - */ - -#define ALT_LOAD_EXPLICITLY_CONTROLLED - - -/* - * Base address and span (size in bytes) of each linker region - * - */ - -#define ONCHIP_MEMORY_REGION_BASE 0x20 -#define ONCHIP_MEMORY_REGION_SPAN 16352 -#define RESET_REGION_BASE 0x0 -#define RESET_REGION_SPAN 32 - - -/* - * Devices associated with code sections - * - */ - -#define ALT_EXCEPTIONS_DEVICE ONCHIP_MEMORY -#define ALT_RESET_DEVICE ONCHIP_MEMORY -#define ALT_RODATA_DEVICE ONCHIP_MEMORY -#define ALT_RWDATA_DEVICE ONCHIP_MEMORY -#define ALT_TEXT_DEVICE ONCHIP_MEMORY - - -/* - * Initialization code at the reset address is allowed (e.g. no external bootloader). - * - */ - -#define ALT_ALLOW_CODE_AT_RESET - - -/* - * The alt_load() facility is called from crt0 to copy sections into RAM. - * - */ - -#define ALT_LOAD_COPY_RWDATA - -#endif /* __LINKER_H_ */ diff --git a/software/qsys_tutorial_lcd2_bsp/linker.x b/software/qsys_tutorial_lcd2_bsp/linker.x deleted file mode 100644 index e1671bb..0000000 --- a/software/qsys_tutorial_lcd2_bsp/linker.x +++ /dev/null @@ -1,385 +0,0 @@ -/* - * linker.x - Linker script - * - * Machine generated for CPU 'nios2_processor' in SOPC Builder design 'nios_system' - * SOPC Builder design path: C:/Users/takayun/Documents/DE2-115/qsys_tutorial/nios_system.sopcinfo - * - * Generated: Fri Dec 02 00:00:37 JST 2016 - */ - -/* - * DO NOT MODIFY THIS FILE - * - * Changing this file will have subtle consequences - * which will almost certainly lead to a nonfunctioning - * system. If you do modify this file, be aware that your - * changes will be overwritten and lost when this file - * is generated again. - * - * DO NOT MODIFY THIS FILE - */ - -/* - * License Agreement - * - * Copyright (c) 2008 - * Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - * - * This agreement shall be governed in all respects by the laws of the State - * of California and by the laws of the United States of America. - */ - -MEMORY -{ - reset : ORIGIN = 0x0, LENGTH = 32 - onchip_memory : ORIGIN = 0x20, LENGTH = 16352 -} - -/* Define symbols for each memory base-address */ -__alt_mem_onchip_memory = 0x0; - -OUTPUT_FORMAT( "elf32-littlenios2", - "elf32-littlenios2", - "elf32-littlenios2" ) -OUTPUT_ARCH( nios2 ) -ENTRY( _start ) - -/* - * The alt_load() facility is enabled. This typically happens when there isn't - * an external bootloader (e.g. flash bootloader). - * The LMA (aka physical address) of each loaded section is - * set to the .text memory device. - * The HAL alt_load() routine called from crt0 copies sections from - * the .text memory to RAM as needed. - */ - -SECTIONS -{ - - /* - * Output sections associated with reset and exceptions (they have to be first) - */ - - .entry : - { - KEEP (*(.entry)) - } > reset - - .exceptions : - { - PROVIDE (__ram_exceptions_start = ABSOLUTE(.)); - . = ALIGN(0x20); - KEEP (*(.irq)); - KEEP (*(.exceptions.entry.label)); - KEEP (*(.exceptions.entry.user)); - KEEP (*(.exceptions.entry)); - KEEP (*(.exceptions.irqtest.user)); - KEEP (*(.exceptions.irqtest)); - KEEP (*(.exceptions.irqhandler.user)); - KEEP (*(.exceptions.irqhandler)); - KEEP (*(.exceptions.irqreturn.user)); - KEEP (*(.exceptions.irqreturn)); - KEEP (*(.exceptions.notirq.label)); - KEEP (*(.exceptions.notirq.user)); - KEEP (*(.exceptions.notirq)); - KEEP (*(.exceptions.soft.user)); - KEEP (*(.exceptions.soft)); - KEEP (*(.exceptions.unknown.user)); - KEEP (*(.exceptions.unknown)); - KEEP (*(.exceptions.exit.label)); - KEEP (*(.exceptions.exit.user)); - KEEP (*(.exceptions.exit)); - KEEP (*(.exceptions)); - PROVIDE (__ram_exceptions_end = ABSOLUTE(.)); - } > onchip_memory - - PROVIDE (__flash_exceptions_start = LOADADDR(.exceptions)); - - .text : - { - /* - * All code sections are merged into the text output section, along with - * the read only data sections. - * - */ - - PROVIDE (stext = ABSOLUTE(.)); - - *(.interp) - *(.hash) - *(.dynsym) - *(.dynstr) - *(.gnu.version) - *(.gnu.version_d) - *(.gnu.version_r) - *(.rel.init) - *(.rela.init) - *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) - *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) - *(.rel.fini) - *(.rela.fini) - *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) - *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) - *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) - *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) - *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) - *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) - *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) - *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) - *(.rel.ctors) - *(.rela.ctors) - *(.rel.dtors) - *(.rela.dtors) - *(.rel.got) - *(.rela.got) - *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) - *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) - *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) - *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) - *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) - *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) - *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) - *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) - *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) - *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) - *(.rel.plt) - *(.rela.plt) - *(.rel.dyn) - - KEEP (*(.init)) - *(.plt) - *(.text .stub .text.* .gnu.linkonce.t.*) - - /* .gnu.warning sections are handled specially by elf32.em. */ - - *(.gnu.warning.*) - KEEP (*(.fini)) - PROVIDE (__etext = ABSOLUTE(.)); - PROVIDE (_etext = ABSOLUTE(.)); - PROVIDE (etext = ABSOLUTE(.)); - - *(.eh_frame_hdr) - /* Ensure the __preinit_array_start label is properly aligned. We - could instead move the label definition inside the section, but - the linker would then create the section even if it turns out to - be empty, which isn't pretty. */ - . = ALIGN(4); - PROVIDE (__preinit_array_start = ABSOLUTE(.)); - *(.preinit_array) - PROVIDE (__preinit_array_end = ABSOLUTE(.)); - PROVIDE (__init_array_start = ABSOLUTE(.)); - *(.init_array) - PROVIDE (__init_array_end = ABSOLUTE(.)); - PROVIDE (__fini_array_start = ABSOLUTE(.)); - *(.fini_array) - PROVIDE (__fini_array_end = ABSOLUTE(.)); - SORT(CONSTRUCTORS) - KEEP (*(.eh_frame)) - *(.gcc_except_table) - *(.dynamic) - PROVIDE (__CTOR_LIST__ = ABSOLUTE(.)); - KEEP (*(.ctors)) - KEEP (*(SORT(.ctors.*))) - PROVIDE (__CTOR_END__ = ABSOLUTE(.)); - PROVIDE (__DTOR_LIST__ = ABSOLUTE(.)); - KEEP (*(.dtors)) - KEEP (*(SORT(.dtors.*))) - PROVIDE (__DTOR_END__ = ABSOLUTE(.)); - KEEP (*(.jcr)) - . = ALIGN(4); - } > onchip_memory = 0x3a880100 /* Nios II NOP instruction */ - - .rodata : - { - PROVIDE (__ram_rodata_start = ABSOLUTE(.)); - . = ALIGN(4); - *(.rodata .rodata.* .gnu.linkonce.r.*) - *(.rodata1) - . = ALIGN(4); - PROVIDE (__ram_rodata_end = ABSOLUTE(.)); - } > onchip_memory - - PROVIDE (__flash_rodata_start = LOADADDR(.rodata)); - - /* - * - * This section's LMA is set to the .text region. - * crt0 will copy to this section's specified mapped region virtual memory address (VMA) - * - * .rwdata region equals the .text region, and is set to be loaded into .text region. - * This requires two copies of .rwdata in the .text region. One read writable at VMA. - * and one read-only at LMA. crt0 will copy from LMA to VMA on reset - * - */ - - .rwdata LOADADDR (.rodata) + SIZEOF (.rodata) : AT ( LOADADDR (.rodata) + SIZEOF (.rodata)+ SIZEOF (.rwdata) ) - { - PROVIDE (__ram_rwdata_start = ABSOLUTE(.)); - . = ALIGN(4); - *(.got.plt) *(.got) - *(.data1) - *(.data .data.* .gnu.linkonce.d.*) - - _gp = ABSOLUTE(. + 0x8000); - PROVIDE(gp = _gp); - - *(.rwdata .rwdata.*) - *(.sdata .sdata.* .gnu.linkonce.s.*) - *(.sdata2 .sdata2.* .gnu.linkonce.s2.*) - - . = ALIGN(4); - _edata = ABSOLUTE(.); - PROVIDE (edata = ABSOLUTE(.)); - PROVIDE (__ram_rwdata_end = ABSOLUTE(.)); - } > onchip_memory - - PROVIDE (__flash_rwdata_start = LOADADDR(.rwdata)); - - /* - * - * This section's LMA is set to the .text region. - * crt0 will copy to this section's specified mapped region virtual memory address (VMA) - * - */ - - .bss LOADADDR (.rwdata) + SIZEOF (.rwdata) : AT ( LOADADDR (.rwdata) + SIZEOF (.rwdata) ) - { - __bss_start = ABSOLUTE(.); - PROVIDE (__sbss_start = ABSOLUTE(.)); - PROVIDE (___sbss_start = ABSOLUTE(.)); - - *(.dynsbss) - *(.sbss .sbss.* .gnu.linkonce.sb.*) - *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) - *(.scommon) - - PROVIDE (__sbss_end = ABSOLUTE(.)); - PROVIDE (___sbss_end = ABSOLUTE(.)); - - *(.dynbss) - *(.bss .bss.* .gnu.linkonce.b.*) - *(COMMON) - - . = ALIGN(4); - __bss_end = ABSOLUTE(.); - } > onchip_memory - - /* - * - * One output section mapped to the associated memory device for each of - * the available memory devices. These are not used by default, but can - * be used by user applications by using the .section directive. - * - * The output section used for the heap is treated in a special way, - * i.e. the symbols "end" and "_end" are added to point to the heap start. - * - * Because alt_load() is enabled, these sections have - * their LMA set to be loaded into the .text memory region. - * However, the alt_load() code will NOT automatically copy - * these sections into their mapped memory region. - * - */ - - /* - * - * This section's LMA is set to the .text region. - * crt0 will copy to this section's specified mapped region virtual memory address (VMA) - * - */ - - .onchip_memory LOADADDR (.bss) + SIZEOF (.bss) : AT ( LOADADDR (.bss) + SIZEOF (.bss) ) - { - PROVIDE (_alt_partition_onchip_memory_start = ABSOLUTE(.)); - *(.onchip_memory. onchip_memory.*) - . = ALIGN(4); - PROVIDE (_alt_partition_onchip_memory_end = ABSOLUTE(.)); - _end = ABSOLUTE(.); - end = ABSOLUTE(.); - __alt_stack_base = ABSOLUTE(.); - } > onchip_memory - - PROVIDE (_alt_partition_onchip_memory_load_addr = LOADADDR(.onchip_memory)); - - /* - * Stabs debugging sections. - * - */ - - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - /* DWARF debug sections. - Symbols in the DWARF debugging sections are relative to the beginning - of the section so we begin them at 0. */ - /* DWARF 1 */ - .debug 0 : { *(.debug) } - .line 0 : { *(.line) } - /* GNU DWARF 1 extensions */ - .debug_srcinfo 0 : { *(.debug_srcinfo) } - .debug_sfnames 0 : { *(.debug_sfnames) } - /* DWARF 1.1 and DWARF 2 */ - .debug_aranges 0 : { *(.debug_aranges) } - .debug_pubnames 0 : { *(.debug_pubnames) } - /* DWARF 2 */ - .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_line 0 : { *(.debug_line) } - .debug_frame 0 : { *(.debug_frame) } - .debug_str 0 : { *(.debug_str) } - .debug_loc 0 : { *(.debug_loc) } - .debug_macinfo 0 : { *(.debug_macinfo) } - /* SGI/MIPS DWARF 2 extensions */ - .debug_weaknames 0 : { *(.debug_weaknames) } - .debug_funcnames 0 : { *(.debug_funcnames) } - .debug_typenames 0 : { *(.debug_typenames) } - .debug_varnames 0 : { *(.debug_varnames) } - - /* Altera debug extensions */ - .debug_alt_sim_info 0 : { *(.debug_alt_sim_info) } -} - -/* provide a pointer for the stack */ - -/* - * Don't override this, override the __alt_stack_* symbols instead. - */ -__alt_data_end = 0x4000; - -/* - * The next two symbols define the location of the default stack. You can - * override them to move the stack to a different memory. - */ -PROVIDE( __alt_stack_pointer = __alt_data_end ); -PROVIDE( __alt_stack_limit = __alt_stack_base ); - -/* - * This symbol controls where the start of the heap is. If the stack is - * contiguous with the heap then the stack will contract as memory is - * allocated to the heap. - * Override this symbol to put the heap in a different memory. - */ -PROVIDE( __alt_heap_start = end ); -PROVIDE( __alt_heap_limit = 0x4000 ); diff --git a/software/qsys_tutorial_lcd2_bsp/mem_init.mk b/software/qsys_tutorial_lcd2_bsp/mem_init.mk deleted file mode 100644 index 8529cc2..0000000 --- a/software/qsys_tutorial_lcd2_bsp/mem_init.mk +++ /dev/null @@ -1,322 +0,0 @@ - -######################################################################### -####### M E M I N I T M A K E F I L E C O N T E N T ###### -######################################################################### - -######################################################################### -# This file is intended to be included by public.mk -# -# -# The following variables must be defined before including this file: -# - ELF -# -# The following variables may be defined to override the default behavior: -# - HDL_SIM_DIR -# - HDL_SIM_INSTALL_DIR -# - MEM_INIT_DIR -# - MEM_INIT_INSTALL_DIR -# - QUARTUS_PROJECT_DIR -# - SOPC_NAME -# - SIM_OPTIMIZE -# - RESET_ADDRESS -# -######################################################################### - -ifeq ($(MEM_INIT_FILE),) -# MEM_INIT_FILE should be set equal to the working relative path to this -# mem_init.mk makefile fragment -MEM_INIT_FILE := $(wildcard $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))) -endif - -ifeq ($(ELF2DAT),) -ELF2DAT := elf2dat -endif - -ifeq ($(ELF2HEX),) -ELF2HEX := elf2hex -endif - -ifeq ($(ELF2FLASH),) -ELF2FLASH := elf2flash -endif - -ifeq ($(FLASH2DAT),) -FLASH2DAT := flash2dat -endif - -ifeq ($(NM),) -NM := nios2-elf-nm -endif - -ifeq ($(MKDIR),) -MKDIR := mkdir -p -endif - -ifeq ($(RM),) -RM := rm -f -endif - -ifeq ($(CP),) -CP := cp -endif - -ifeq ($(ECHO),) -ECHO := echo -endif - -MEM_INIT_DIR ?= mem_init -HDL_SIM_DIR ?= $(MEM_INIT_DIR)/hdl_sim - -ifdef QUARTUS_PROJECT_DIR -MEM_INIT_INSTALL_DIR ?= $(patsubst %/,%,$(QUARTUS_PROJECT_DIR)) -ifdef SOPC_NAME -HDL_SIM_INSTALL_DIR ?= $(patsubst %/,%,$(QUARTUS_PROJECT_DIR))/$(SOPC_NAME)_sim -endif -endif - -MEM_INIT_DESCRIPTOR_FILE ?= $(MEM_INIT_DIR)/meminit.spd - -MEM_INIT_QIP_FILE ?= $(MEM_INIT_DIR)/meminit.qip - -#------------------------------------- -# Default Flash Boot Loaders -#------------------------------------- - -BOOT_LOADER_PATH ?= $(SOPC_KIT_NIOS2)/components/altera_nios2 -BOOT_LOADER_CFI ?= $(BOOT_LOADER_PATH)/boot_loader_cfi.srec -BOOT_LOADER_CFI_BE ?= $(BOOT_LOADER_PATH)/boot_loader_cfi_be.srec - - -#------------------------------------- -# Default Target -#------------------------------------- - -.PHONY: default_mem_init -ifeq ($(QSYS),1) -default_mem_init: mem_init_generate -else -default_mem_init: mem_init_install -endif -#------------------------------------- -# Runtime Macros -#------------------------------------- - -define post-process-info - @echo Post-processing to create $@... -endef - -target_stem = $(notdir $(basename $@)) - -mem_start_address = $($(target_stem)_START) -mem_end_address = $($(target_stem)_END) -mem_width = $($(target_stem)_WIDTH) -mem_endianness = $($(target_stem)_ENDIANNESS) -mem_create_lanes = $($(target_stem)_CREATE_LANES) - -mem_pad_flag = $($(target_stem)_PAD_FLAG) -mem_reloc_input_flag = $($(target_stem)_RELOC_INPUT_FLAG) -mem_no_zero_fill_flag = $($(target_stem)_NO_ZERO_FILL_FLAG) - -flash_mem_epcs_flag = $($(target_stem)_EPCS_FLAGS) -flash_mem_cfi_flag = $($(target_stem)_CFI_FLAGS) -flash_mem_boot_loader_flag = $($(target_stem)_BOOT_LOADER_FLAG) - -elf2dat_extra_args = $(mem_pad_flag) -elf2hex_extra_args = $(mem_no_zero_fill_flag) -elf2flash_extra_args = $(flash_mem_cfi_flag) $(flash_mem_epcs_flag) $(flash_mem_boot_loader_flag) -flash2dat_extra_args = $(mem_pad_flag) $(mem_reloc_input_flag) - -#------------------------------------------------------------------------------ -# BSP SPECIFIC CONTENT -# -# The content below is controlled by the BSP and SOPC System -#------------------------------------------------------------------------------ -#START OF BSP SPECIFIC - -#------------------------------------- -# Global Settings -#------------------------------------- - - -# The following TYPE comment allows tools to identify the 'type' of target this -# makefile is associated with. -# TYPE: BSP_MEMINIT_MAKEFILE - -# This following VERSION comment indicates the version of the tool used to -# generate this makefile. A makefile variable is provided for VERSION as well. -# ACDS_VERSION: 13.0sp1 -ACDS_VERSION := 13.0sp1 - -# This following BUILD_NUMBER comment indicates the build number of the tool -# used to generate this makefile. -# BUILD_NUMBER: 232 - -# Optimize for simulation -SIM_OPTIMIZE ?= 0 - -# The CPU reset address as needed by elf2flash -RESET_ADDRESS ?= 0x00000000 - -#------------------------------------- -# Pre-Initialized Memory Descriptions -#------------------------------------- - -# Memory: onchip_memory -MEM_0 := nios_system_onchip_memory -$(MEM_0)_NAME := onchip_memory -$(MEM_0)_MEM_INIT_FILE_PARAM_NAME := INIT_FILE -HEX_FILES += $(MEM_INIT_DIR)/$(MEM_0).hex -MEM_INIT_INSTALL_FILES += $(MEM_INIT_INSTALL_DIR)/$(MEM_0).hex -DAT_FILES += $(HDL_SIM_DIR)/$(MEM_0).dat -HDL_SIM_INSTALL_FILES += $(HDL_SIM_INSTALL_DIR)/$(MEM_0).dat -SYM_FILES += $(HDL_SIM_DIR)/$(MEM_0).sym -HDL_SIM_INSTALL_FILES += $(HDL_SIM_INSTALL_DIR)/$(MEM_0).sym -$(MEM_0)_START := 0x00000000 -$(MEM_0)_END := 0x00003fff -$(MEM_0)_HIERARCHICAL_PATH := onchip_memory -$(MEM_0)_WIDTH := 32 -$(MEM_0)_ENDIANNESS := --little-endian-mem -$(MEM_0)_CREATE_LANES := 0 - -.PHONY: onchip_memory -onchip_memory: check_elf_exists $(MEM_INIT_DIR)/$(MEM_0).hex $(HDL_SIM_DIR)/$(MEM_0).dat $(HDL_SIM_DIR)/$(MEM_0).sym - - -#END OF BSP SPECIFIC - -#------------------------------------- -# Pre-Initialized Memory Targets -#------------------------------------- - -.PHONY: mem_init_install mem_init_generate mem_init_clean - -ifeq ($(QSYS),1) -# Target mem_init_install is deprecated for QSys based systems -# To initialize onchip memories for Quartus II Synthesis with Qsys based systems: -# 1) Use "make mem_init_genearate" -# 2) Add the generated mem_init/meminit.qip file to your Quartus II Project -# -mem_init_install: - $(error Deprecated Makefile Target: '$@'. Use target 'mem_init_generate' and then add $(MEM_INIT_QIP_FILE) to your Quartus II Project) - -else # QSYS != 1, if SopcBuilder based system - -ifneq ($(MEM_INIT_INSTALL_DIR),) -mem_init_install: $(MEM_INIT_INSTALL_FILES) -endif - -ifneq ($(HDL_SIM_INSTALL_DIR),) -mem_init_install: $(HDL_SIM_INSTALL_FILES) -endif - -mem_init_install: mem_init_generate -ifeq ($(MEM_INIT_INSTALL_DIR),) - @echo "WARNING: MEM_INIT_INSTALL_DIR not set. Set your QUARTUS_PROJECT_DIR environment variable." -endif -ifeq ($(HDL_SIM_INSTALL_DIR),) - @echo "WARNING: HDL_SIM_INSTALL_DIR not set. Set your QUARTUS_PROJECT_DIR and SOPC_NAME environment variable." -endif - -$(MEM_INIT_INSTALL_FILES): $(MEM_INIT_INSTALL_DIR)/%: $(MEM_INIT_DIR)/% - @$(MKDIR) $(@D) - @$(CP) -v $< $@ - -$(HDL_SIM_INSTALL_FILES): $(HDL_SIM_INSTALL_DIR)/%: $(HDL_SIM_DIR)/% - @$(MKDIR) $(@D) - @$(CP) -v $< $@ - -endif # QSYS == 1 - - -mem_init_generate: hex dat sym flash $(MEM_INIT_DESCRIPTOR_FILE) $(MEM_INIT_QIP_FILE) - -mem_init_clean: - @$(RM) -r $(MEM_INIT_DIR) $(HDL_SIM_DIR) $(FLASH_FILES) - -.PHONY: hex dat sym flash - -hex: check_elf_exists $(HEX_FILES) - -dat: check_elf_exists $(DAT_FILES) - -sym: check_elf_exists $(SYM_FILES) - -flash: check_elf_exists $(FLASH_FILES) - -#------------------------------------- -# Pre-Initialized Memory Rules -#------------------------------------- - -.PHONY: check_elf_exists -check_elf_exists: $(ELF) -ifeq ($(ELF),) - $(error ELF var not set in mem_init.mk) -endif - -$(filter-out $(FLASH_DAT_FILES),$(DAT_FILES)): %.dat: $(ELF) - $(post-process-info) - @$(MKDIR) $(@D) - bash -c '$(ELF2DAT) --infile=$< --outfile=$@ \ - --base=$(mem_start_address) --end=$(mem_end_address) --width=$(mem_width) \ - $(mem_endianness) --create-lanes=$(mem_create_lanes) $(elf2dat_extra_args)' - -$(foreach i,0 1 2 3 4 5 6 7,%_lane$(i).dat): %.dat - @true - -$(HEX_FILES): %.hex: $(ELF) - $(post-process-info) - @$(MKDIR) $(@D) - bash -c '$(ELF2HEX) $< $(mem_start_address) $(mem_end_address) --width=$(mem_width) \ - $(mem_endianness) --create-lanes=$(mem_create_lanes) $(elf2hex_extra_args) $@' - -$(SYM_FILES): %.sym: $(ELF) - $(post-process-info) - @$(MKDIR) $(@D) - $(NM) -n $< > $@ - -$(FLASH_FILES): %.flash: $(ELF) - $(post-process-info) - @$(MKDIR) $(@D) - bash -c '$(ELF2FLASH) --input=$< --outfile=$@ --sim_optimize=$(SIM_OPTIMIZE) $(mem_endianness) \ - $(elf2flash_extra_args)' - -# -# Function generate_spd_entry -# Arg1: path to the memory initialization file -# Arg2: Type HEX or DAT -# Arg3: Output spd file to append -gen_spd_entry.BASE_FILE = $(basename $(notdir $1)) -gen_spd_entry.PARAM_NAME = $($(gen_spd_entry.BASE_FILE)_MEM_INIT_FILE_PARAM_NAME) -gen_spd_entry.MEM_PATH = $($(gen_spd_entry.BASE_FILE)_HIERARCHICAL_PATH) -gen_spd_entry.SETTINGS = $(strip \ - path=\"$1\" \ - type=\"$2\" \ - $(if $(gen_spd_entry.PARAM_NAME),initParamName=\"$(gen_spd_entry.PARAM_NAME)\") \ - $(if $(gen_spd_entry.MEM_PATH),memoryPath=\"$(gen_spd_entry.MEM_PATH)\") \ -) -define gen_spd_entry -$(ECHO) "" >> $3 -endef - -$(MEM_INIT_DESCRIPTOR_FILE).DAT_FILESET := $(patsubst $(dir $(MEM_INIT_DESCRIPTOR_FILE))%,%,$(DAT_FILES)) -$(MEM_INIT_DESCRIPTOR_FILE).HEX_FILESET := $(patsubst $(dir $(MEM_INIT_DESCRIPTOR_FILE))%,%,$(HEX_FILES)) - -$(MEM_INIT_DESCRIPTOR_FILE): %.spd: $(MEM_INIT_FILE) - $(post-process-info) - @$(MKDIR) $(@D) - @$(RM) $@ - @$(ECHO) "" > $@ - @$(ECHO) "" >> $@ - @$(foreach dat_file,$($@.DAT_FILESET),$(call gen_spd_entry,$(dat_file),DAT,$@) &&)true - @$(foreach hex_file,$($@.HEX_FILESET),$(call gen_spd_entry,$(hex_file),HEX,$@) &&)true - @$(ECHO) "" >> $@ - -.DELETE_ON_ERROR: $(MEM_INIT_DESCRIPTOR_FILE) - -$(MEM_INIT_QIP_FILE): %.qip: $(MEM_INIT_FILE) - $(post-process-info) - @$(MKDIR) $(@D) - @$(RM) $@ - @$(ECHO) "set_global_assignment -name SEARCH_PATH $$::quartus(qip_path)" > $@ - -.DELETE_ON_ERROR: $(MEM_INIT_QIP_FILE) diff --git a/software/qsys_tutorial_lcd2_bsp/memory.gdb b/software/qsys_tutorial_lcd2_bsp/memory.gdb deleted file mode 100644 index d293992..0000000 --- a/software/qsys_tutorial_lcd2_bsp/memory.gdb +++ /dev/null @@ -1,50 +0,0 @@ -# memory.gdb - GDB memory region definitions -# -# Machine generated for CPU 'nios2_processor' in SOPC Builder design 'nios_system' -# SOPC Builder design path: C:/Users/takayun/Documents/DE2-115/qsys_tutorial/nios_system.sopcinfo -# -# Generated: Fri Dec 02 00:00:37 JST 2016 - -# DO NOT MODIFY THIS FILE -# -# Changing this file will have subtle consequences -# which will almost certainly lead to a nonfunctioning -# system. If you do modify this file, be aware that your -# changes will be overwritten and lost when this file -# is generated again. -# -# DO NOT MODIFY THIS FILE - -# License Agreement -# -# Copyright (c) 2008 -# Altera Corporation, San Jose, California, USA. -# All rights reserved. -# -# 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. -# -# This agreement shall be governed in all respects by the laws of the State -# of California and by the laws of the United States of America. - -# Define memory regions for each memory connected to the CPU. -# The cache attribute is specified which improves GDB performance -# by allowing GDB to cache memory contents on the host. - -# onchip_memory -memory 0x0 0x4000 cache diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_alarm_start.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_alarm_start.d deleted file mode 100644 index 3bb20ea..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_alarm_start.d +++ /dev/null @@ -1,22 +0,0 @@ -obj/HAL/src/alt_alarm_start.o: HAL/src/alt_alarm_start.c \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h system.h linker.h - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_alarm_start.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_alarm_start.o deleted file mode 100644 index a549138..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_alarm_start.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_busy_sleep.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_busy_sleep.d deleted file mode 100644 index e93e80c..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_busy_sleep.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_busy_sleep.o: HAL/src/alt_busy_sleep.c system.h linker.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_busy_sleep.h - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_busy_sleep.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_busy_sleep.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_busy_sleep.o deleted file mode 100644 index 2924cc0..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_busy_sleep.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_close.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_close.d deleted file mode 100644 index fbbab9c..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_close.d +++ /dev/null @@ -1,34 +0,0 @@ -obj/HAL/src/alt_close.o: HAL/src/alt_close.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h \ - HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_close.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_close.o deleted file mode 100644 index b38d76f..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_close.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_dcache_flush.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_dcache_flush.d deleted file mode 100644 index a0eaf8a..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_dcache_flush.d +++ /dev/null @@ -1,15 +0,0 @@ -obj/HAL/src/alt_dcache_flush.o: HAL/src/alt_dcache_flush.c \ - HAL/inc/nios2.h system.h linker.h HAL/inc/alt_types.h \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h - -HAL/inc/nios2.h: - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_dcache_flush.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_dcache_flush.o deleted file mode 100644 index 70f3957..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_dcache_flush.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_dcache_flush_all.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_dcache_flush_all.d deleted file mode 100644 index 792c3e4..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_dcache_flush_all.d +++ /dev/null @@ -1,15 +0,0 @@ -obj/HAL/src/alt_dcache_flush_all.o: HAL/src/alt_dcache_flush_all.c \ - HAL/inc/nios2.h system.h linker.h HAL/inc/alt_types.h \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h - -HAL/inc/nios2.h: - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_dcache_flush_all.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_dcache_flush_all.o deleted file mode 100644 index c8099e9..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_dcache_flush_all.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_dcache_flush_no_writeback.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_dcache_flush_no_writeback.d deleted file mode 100644 index 867c42b..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_dcache_flush_no_writeback.d +++ /dev/null @@ -1,16 +0,0 @@ -obj/HAL/src/alt_dcache_flush_no_writeback.o: \ - HAL/src/alt_dcache_flush_no_writeback.c HAL/inc/nios2.h system.h \ - linker.h HAL/inc/alt_types.h HAL/inc/sys/alt_cache.h \ - HAL/inc/alt_types.h - -HAL/inc/nios2.h: - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_dcache_flush_no_writeback.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_dcache_flush_no_writeback.o deleted file mode 100644 index 9cf8fe9..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_dcache_flush_no_writeback.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_dev.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_dev.d deleted file mode 100644 index cd9b1d4..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_dev.d +++ /dev/null @@ -1,34 +0,0 @@ -obj/HAL/src/alt_dev.o: HAL/src/alt_dev.c HAL/inc/sys/alt_dev.h system.h \ - linker.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h \ - HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h HAL/inc/alt_types.h \ - system.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/alt_types.h: - -system.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_dev.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_dev.o deleted file mode 100644 index 8e993ac..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_dev.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_dev_llist_insert.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_dev_llist_insert.d deleted file mode 100644 index 344d065..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_dev_llist_insert.d +++ /dev/null @@ -1,13 +0,0 @@ -obj/HAL/src/alt_dev_llist_insert.o: HAL/src/alt_dev_llist_insert.c \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/alt_types.h HAL/inc/sys/alt_errno.h - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_errno.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_dev_llist_insert.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_dev_llist_insert.o deleted file mode 100644 index 4483b6d..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_dev_llist_insert.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_dma_rxchan_open.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_dma_rxchan_open.d deleted file mode 100644 index fb21fed..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_dma_rxchan_open.d +++ /dev/null @@ -1,35 +0,0 @@ -obj/HAL/src/alt_dma_rxchan_open.o: HAL/src/alt_dma_rxchan_open.c \ - HAL/inc/sys/alt_dma.h HAL/inc/sys/alt_dma_dev.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/alt_types.h HAL/inc/sys/alt_errno.h \ - HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h system.h linker.h \ - HAL/inc/sys/alt_llist.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h - -HAL/inc/sys/alt_dma.h: - -HAL/inc/sys/alt_dma_dev.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_errno.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_dma_rxchan_open.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_dma_rxchan_open.o deleted file mode 100644 index 6a28820..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_dma_rxchan_open.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_dma_txchan_open.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_dma_txchan_open.d deleted file mode 100644 index 500b95c..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_dma_txchan_open.d +++ /dev/null @@ -1,35 +0,0 @@ -obj/HAL/src/alt_dma_txchan_open.o: HAL/src/alt_dma_txchan_open.c \ - HAL/inc/sys/alt_dma.h HAL/inc/sys/alt_dma_dev.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/alt_types.h HAL/inc/sys/alt_errno.h \ - HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h system.h linker.h \ - HAL/inc/sys/alt_llist.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h - -HAL/inc/sys/alt_dma.h: - -HAL/inc/sys/alt_dma_dev.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_errno.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_dma_txchan_open.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_dma_txchan_open.o deleted file mode 100644 index 25955fa..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_dma_txchan_open.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_do_ctors.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_do_ctors.d deleted file mode 100644 index daf8baf..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_do_ctors.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_do_ctors.o: HAL/src/alt_do_ctors.c diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_do_ctors.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_do_ctors.o deleted file mode 100644 index 0b7fa34..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_do_ctors.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_do_dtors.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_do_dtors.d deleted file mode 100644 index c3471eb..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_do_dtors.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_do_dtors.o: HAL/src/alt_do_dtors.c diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_do_dtors.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_do_dtors.o deleted file mode 100644 index 5b83880..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_do_dtors.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_env_lock.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_env_lock.d deleted file mode 100644 index 634d7b0..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_env_lock.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_env_lock.o: HAL/src/alt_env_lock.c diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_env_lock.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_env_lock.o deleted file mode 100644 index 6f59a4b..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_env_lock.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_environ.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_environ.d deleted file mode 100644 index e9ca295..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_environ.d +++ /dev/null @@ -1,3 +0,0 @@ -obj/HAL/src/alt_environ.o: HAL/src/alt_environ.c HAL/inc/os/alt_syscall.h - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_environ.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_environ.o deleted file mode 100644 index d82f8c3..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_environ.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_errno.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_errno.d deleted file mode 100644 index 29ca544..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_errno.d +++ /dev/null @@ -1,8 +0,0 @@ -obj/HAL/src/alt_errno.o: HAL/src/alt_errno.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/alt_types.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_errno.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_errno.o deleted file mode 100644 index 10e03c2..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_errno.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_exception_entry.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_exception_entry.d deleted file mode 100644 index 540567e..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_exception_entry.d +++ /dev/null @@ -1,6 +0,0 @@ -obj/HAL/src/alt_exception_entry.o: HAL/src/alt_exception_entry.S system.h \ - linker.h - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_exception_entry.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_exception_entry.o deleted file mode 100644 index ecc8f27..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_exception_entry.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_exception_muldiv.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_exception_muldiv.d deleted file mode 100644 index 63d66a7..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_exception_muldiv.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_exception_muldiv.o: HAL/src/alt_exception_muldiv.S diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_exception_muldiv.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_exception_muldiv.o deleted file mode 100644 index 9350570..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_exception_muldiv.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_exception_trap.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_exception_trap.d deleted file mode 100644 index 6e18488..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_exception_trap.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_exception_trap.o: HAL/src/alt_exception_trap.S diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_exception_trap.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_exception_trap.o deleted file mode 100644 index 588d6d2..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_exception_trap.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_execve.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_execve.d deleted file mode 100644 index 9cef7d2..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_execve.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_execve.o: HAL/src/alt_execve.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_execve.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_execve.o deleted file mode 100644 index c30ca9e..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_execve.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_exit.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_exit.d deleted file mode 100644 index a779da8..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_exit.d +++ /dev/null @@ -1,26 +0,0 @@ -obj/HAL/src/alt_exit.o: HAL/src/alt_exit.c HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h HAL/inc/alt_types.h system.h linker.h \ - HAL/inc/sys/alt_sim.h HAL/inc/os/alt_hooks.h HAL/inc/os/alt_syscall.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_log_printf.h system.h - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_sim.h: - -HAL/inc/os/alt_hooks.h: - -HAL/inc/os/alt_syscall.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_exit.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_exit.o deleted file mode 100644 index 6171824..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_exit.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_fcntl.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_fcntl.d deleted file mode 100644 index 527f242..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_fcntl.d +++ /dev/null @@ -1,34 +0,0 @@ -obj/HAL/src/alt_fcntl.o: HAL/src/alt_fcntl.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h \ - system.h linker.h HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/alt_types.h \ - HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_fcntl.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_fcntl.o deleted file mode 100644 index cf66cba..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_fcntl.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_fd_lock.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_fd_lock.d deleted file mode 100644 index 93daeac..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_fd_lock.d +++ /dev/null @@ -1,27 +0,0 @@ -obj/HAL/src/alt_fd_lock.o: HAL/src/alt_fd_lock.c HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_fd_lock.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_fd_lock.o deleted file mode 100644 index b5bf901..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_fd_lock.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_fd_unlock.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_fd_unlock.d deleted file mode 100644 index 45a3207..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_fd_unlock.d +++ /dev/null @@ -1,27 +0,0 @@ -obj/HAL/src/alt_fd_unlock.o: HAL/src/alt_fd_unlock.c \ - HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h system.h linker.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_fd_unlock.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_fd_unlock.o deleted file mode 100644 index 1cffda8..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_fd_unlock.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_find_dev.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_find_dev.d deleted file mode 100644 index 98336f8..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_find_dev.d +++ /dev/null @@ -1,31 +0,0 @@ -obj/HAL/src/alt_find_dev.o: HAL/src/alt_find_dev.c HAL/inc/sys/alt_dev.h \ - system.h linker.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h \ - HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h HAL/inc/alt_types.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_find_dev.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_find_dev.o deleted file mode 100644 index 07c7f1c..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_find_dev.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_find_file.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_find_file.d deleted file mode 100644 index d1150ca..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_find_file.d +++ /dev/null @@ -1,32 +0,0 @@ -obj/HAL/src/alt_find_file.o: HAL/src/alt_find_file.c \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h \ - HAL/inc/alt_types.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_find_file.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_find_file.o deleted file mode 100644 index fdb21f0..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_find_file.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_flash_dev.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_flash_dev.d deleted file mode 100644 index 8835e8f..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_flash_dev.d +++ /dev/null @@ -1,34 +0,0 @@ -obj/HAL/src/alt_flash_dev.o: HAL/src/alt_flash_dev.c \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/sys/alt_flash_dev.h \ - HAL/inc/sys/alt_flash_types.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h \ - system.h linker.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_flash_dev.h: - -HAL/inc/sys/alt_flash_types.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_flash_dev.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_flash_dev.o deleted file mode 100644 index b268af6..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_flash_dev.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_fork.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_fork.d deleted file mode 100644 index 492be65..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_fork.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_fork.o: HAL/src/alt_fork.c HAL/inc/sys/alt_warning.h \ - HAL/inc/sys/alt_errno.h HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_warning.h: - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_fork.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_fork.o deleted file mode 100644 index b076e62..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_fork.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_fs_reg.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_fs_reg.d deleted file mode 100644 index d8f95ab..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_fs_reg.d +++ /dev/null @@ -1,29 +0,0 @@ -obj/HAL/src/alt_fs_reg.o: HAL/src/alt_fs_reg.c HAL/inc/sys/alt_dev.h \ - system.h linker.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h \ - HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_fs_reg.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_fs_reg.o deleted file mode 100644 index 4e75d14..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_fs_reg.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_fstat.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_fstat.d deleted file mode 100644 index 942fcbc..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_fstat.d +++ /dev/null @@ -1,38 +0,0 @@ -obj/HAL/src/alt_fstat.o: HAL/src/alt_fstat.c HAL/inc/sys/alt_dev.h \ - system.h linker.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/sys/alt_errno.h \ - HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_syscall.h system.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/sys/alt_errno.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_syscall.h: - -system.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_fstat.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_fstat.o deleted file mode 100644 index 38db9c9..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_fstat.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_get_fd.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_get_fd.d deleted file mode 100644 index 9a4daaa..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_get_fd.d +++ /dev/null @@ -1,34 +0,0 @@ -obj/HAL/src/alt_get_fd.o: HAL/src/alt_get_fd.c HAL/inc/sys/alt_dev.h \ - system.h linker.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h \ - HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h HAL/inc/alt_types.h \ - system.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/alt_types.h: - -system.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_get_fd.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_get_fd.o deleted file mode 100644 index 9998d68..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_get_fd.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_getchar.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_getchar.d deleted file mode 100644 index bcccdf7..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_getchar.d +++ /dev/null @@ -1,34 +0,0 @@ -obj/HAL/src/alt_getchar.o: HAL/src/alt_getchar.c system.h linker.h \ - HAL/inc/sys/alt_driver.h HAL/inc/sys/alt_stdio.h \ - HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h system.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h - -system.h: - -linker.h: - -HAL/inc/sys/alt_driver.h: - -HAL/inc/sys/alt_stdio.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_getchar.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_getchar.o deleted file mode 100644 index b9b7f63..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_getchar.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_getpid.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_getpid.d deleted file mode 100644 index d9499b9..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_getpid.d +++ /dev/null @@ -1,3 +0,0 @@ -obj/HAL/src/alt_getpid.o: HAL/src/alt_getpid.c HAL/inc/os/alt_syscall.h - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_getpid.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_getpid.o deleted file mode 100644 index 5285c9d..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_getpid.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_gettod.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_gettod.d deleted file mode 100644 index cf3cf34..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_gettod.d +++ /dev/null @@ -1,17 +0,0 @@ -obj/HAL/src/alt_gettod.o: HAL/src/alt_gettod.c HAL/inc/sys/alt_alarm.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/priv/alt_alarm.h \ - HAL/inc/alt_types.h HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_gettod.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_gettod.o deleted file mode 100644 index 2204779..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_gettod.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_gmon.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_gmon.d deleted file mode 100644 index e9469ab..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_gmon.d +++ /dev/null @@ -1,24 +0,0 @@ -obj/HAL/src/alt_gmon.o: HAL/src/alt_gmon.c HAL/inc/priv/nios2_gmon_data.h \ - HAL/inc/sys/alt_irq.h HAL/inc/nios2.h HAL/inc/alt_types.h system.h \ - linker.h HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h - -HAL/inc/priv/nios2_gmon_data.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_gmon.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_gmon.o deleted file mode 100644 index 79e0a00..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_gmon.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_icache_flush.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_icache_flush.d deleted file mode 100644 index 2e4ddd1..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_icache_flush.d +++ /dev/null @@ -1,15 +0,0 @@ -obj/HAL/src/alt_icache_flush.o: HAL/src/alt_icache_flush.c \ - HAL/inc/nios2.h system.h linker.h HAL/inc/alt_types.h \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h - -HAL/inc/nios2.h: - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_icache_flush.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_icache_flush.o deleted file mode 100644 index ce87226..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_icache_flush.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_icache_flush_all.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_icache_flush_all.d deleted file mode 100644 index 47cfbf3..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_icache_flush_all.d +++ /dev/null @@ -1,15 +0,0 @@ -obj/HAL/src/alt_icache_flush_all.o: HAL/src/alt_icache_flush_all.c \ - HAL/inc/nios2.h system.h linker.h HAL/inc/alt_types.h \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h - -HAL/inc/nios2.h: - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_icache_flush_all.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_icache_flush_all.o deleted file mode 100644 index a188382..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_icache_flush_all.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_iic.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_iic.d deleted file mode 100644 index a709e0c..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_iic.d +++ /dev/null @@ -1,29 +0,0 @@ -obj/HAL/src/alt_iic.o: HAL/src/alt_iic.c system.h linker.h \ - HAL/inc/sys/alt_irq.h HAL/inc/nios2.h HAL/inc/alt_types.h system.h \ - HAL/inc/priv/alt_iic_isr_register.h HAL/inc/alt_types.h \ - HAL/inc/sys/alt_irq.h HAL/inc/priv/alt_legacy_irq.h system.h \ - HAL/inc/nios2.h - -system.h: - -linker.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -HAL/inc/priv/alt_iic_isr_register.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/priv/alt_legacy_irq.h: - -system.h: - -HAL/inc/nios2.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_iic.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_iic.o deleted file mode 100644 index 5646bcb..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_iic.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_iic_isr_register.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_iic_isr_register.d deleted file mode 100644 index d0470ae..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_iic_isr_register.d +++ /dev/null @@ -1,30 +0,0 @@ -obj/HAL/src/alt_iic_isr_register.o: HAL/src/alt_iic_isr_register.c \ - system.h linker.h HAL/inc/alt_types.h HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h HAL/inc/alt_types.h system.h \ - HAL/inc/priv/alt_iic_isr_register.h HAL/inc/alt_types.h \ - HAL/inc/sys/alt_irq.h HAL/inc/sys/alt_irq_entry.h \ - HAL/inc/priv/alt_irq_table.h - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -HAL/inc/priv/alt_iic_isr_register.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/sys/alt_irq_entry.h: - -HAL/inc/priv/alt_irq_table.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_iic_isr_register.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_iic_isr_register.o deleted file mode 100644 index b7065e2..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_iic_isr_register.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_instruction_exception_entry.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_instruction_exception_entry.d deleted file mode 100644 index 6d0705f..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_instruction_exception_entry.d +++ /dev/null @@ -1,18 +0,0 @@ -obj/HAL/src/alt_instruction_exception_entry.o: \ - HAL/src/alt_instruction_exception_entry.c HAL/inc/sys/alt_exceptions.h \ - HAL/inc/alt_types.h system.h linker.h HAL/inc/nios2.h \ - HAL/inc/alt_types.h system.h - -HAL/inc/sys/alt_exceptions.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_instruction_exception_entry.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_instruction_exception_entry.o deleted file mode 100644 index 77ebccd..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_instruction_exception_entry.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_instruction_exception_register.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_instruction_exception_register.d deleted file mode 100644 index d4fac04..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_instruction_exception_register.d +++ /dev/null @@ -1,16 +0,0 @@ -obj/HAL/src/alt_instruction_exception_register.o: \ - HAL/src/alt_instruction_exception_register.c \ - HAL/inc/sys/alt_exceptions.h HAL/inc/alt_types.h system.h linker.h \ - HAL/inc/alt_types.h system.h - -HAL/inc/sys/alt_exceptions.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -system.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_instruction_exception_register.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_instruction_exception_register.o deleted file mode 100644 index 2c92d62..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_instruction_exception_register.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_io_redirect.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_io_redirect.d deleted file mode 100644 index 8228365..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_io_redirect.d +++ /dev/null @@ -1,29 +0,0 @@ -obj/HAL/src/alt_io_redirect.o: HAL/src/alt_io_redirect.c \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_io_redirect.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_io_redirect.o deleted file mode 100644 index d322315..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_io_redirect.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_ioctl.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_ioctl.d deleted file mode 100644 index d70ad97..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_ioctl.d +++ /dev/null @@ -1,41 +0,0 @@ -obj/HAL/src/alt_ioctl.o: HAL/src/alt_ioctl.c HAL/inc/sys/ioctl.h \ - HAL/inc/sys/alt_errno.h HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h \ - HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h system.h linker.h \ - HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_syscall.h system.h \ - HAL/inc/sys/alt_driver.h - -HAL/inc/sys/ioctl.h: - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_syscall.h: - -system.h: - -HAL/inc/sys/alt_driver.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_ioctl.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_ioctl.o deleted file mode 100644 index 41722f9..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_ioctl.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_irq_entry.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_irq_entry.d deleted file mode 100644 index 9ec3751..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_irq_entry.d +++ /dev/null @@ -1,5 +0,0 @@ -obj/HAL/src/alt_irq_entry.o: HAL/src/alt_irq_entry.S system.h linker.h - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_irq_entry.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_irq_entry.o deleted file mode 100644 index 5379bec..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_irq_entry.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_irq_handler.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_irq_handler.d deleted file mode 100644 index 6fb668f..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_irq_handler.d +++ /dev/null @@ -1,19 +0,0 @@ -obj/HAL/src/alt_irq_handler.o: HAL/src/alt_irq_handler.c system.h \ - linker.h HAL/inc/sys/alt_irq.h HAL/inc/nios2.h HAL/inc/alt_types.h \ - system.h HAL/inc/os/alt_hooks.h HAL/inc/alt_types.h - -system.h: - -linker.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -HAL/inc/os/alt_hooks.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_irq_handler.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_irq_handler.o deleted file mode 100644 index 29364ec..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_irq_handler.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_irq_register.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_irq_register.d deleted file mode 100644 index 3df2f8a..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_irq_register.d +++ /dev/null @@ -1,36 +0,0 @@ -obj/HAL/src/alt_irq_register.o: HAL/src/alt_irq_register.c system.h \ - linker.h HAL/inc/sys/alt_irq.h HAL/inc/nios2.h HAL/inc/alt_types.h \ - system.h HAL/inc/priv/alt_legacy_irq.h system.h HAL/inc/nios2.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_irq.h HAL/inc/os/alt_hooks.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_irq_entry.h \ - HAL/inc/priv/alt_irq_table.h - -system.h: - -linker.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -HAL/inc/priv/alt_legacy_irq.h: - -system.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/os/alt_hooks.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_irq_entry.h: - -HAL/inc/priv/alt_irq_table.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_irq_register.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_irq_register.o deleted file mode 100644 index 42a8f9c..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_irq_register.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_irq_vars.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_irq_vars.d deleted file mode 100644 index f316558..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_irq_vars.d +++ /dev/null @@ -1,8 +0,0 @@ -obj/HAL/src/alt_irq_vars.o: HAL/src/alt_irq_vars.c HAL/inc/alt_types.h \ - system.h linker.h - -HAL/inc/alt_types.h: - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_irq_vars.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_irq_vars.o deleted file mode 100644 index 1ea12ef..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_irq_vars.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_isatty.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_isatty.d deleted file mode 100644 index f8b1f07..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_isatty.d +++ /dev/null @@ -1,38 +0,0 @@ -obj/HAL/src/alt_isatty.o: HAL/src/alt_isatty.c HAL/inc/sys/alt_dev.h \ - system.h linker.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_errno.h HAL/inc/sys/alt_warning.h \ - HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_syscall.h system.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_errno.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_syscall.h: - -system.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_isatty.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_isatty.o deleted file mode 100644 index c6b88a5..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_isatty.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_kill.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_kill.d deleted file mode 100644 index 0c14ae8..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_kill.d +++ /dev/null @@ -1,8 +0,0 @@ -obj/HAL/src/alt_kill.o: HAL/src/alt_kill.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_kill.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_kill.o deleted file mode 100644 index 88f4d4a..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_kill.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_link.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_link.d deleted file mode 100644 index dc844c6..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_link.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_link.o: HAL/src/alt_link.c HAL/inc/sys/alt_warning.h \ - HAL/inc/sys/alt_errno.h HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_warning.h: - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_link.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_link.o deleted file mode 100644 index 71e4df0..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_link.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_load.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_load.d deleted file mode 100644 index d496ab8..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_load.d +++ /dev/null @@ -1,8 +0,0 @@ -obj/HAL/src/alt_load.o: HAL/src/alt_load.c HAL/inc/sys/alt_load.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_cache.h - -HAL/inc/sys/alt_load.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_cache.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_load.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_load.o deleted file mode 100644 index 0cc6a19..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_load.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_log_macro.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_log_macro.d deleted file mode 100644 index 9768c1f..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_log_macro.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_log_macro.o: HAL/src/alt_log_macro.S diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_log_macro.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_log_macro.o deleted file mode 100644 index 489e2cc..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_log_macro.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_log_printf.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_log_printf.d deleted file mode 100644 index 251ff6d..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_log_printf.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_log_printf.o: HAL/src/alt_log_printf.c diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_log_printf.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_log_printf.o deleted file mode 100644 index a03c33d..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_log_printf.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_lseek.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_lseek.d deleted file mode 100644 index 25ed783..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_lseek.d +++ /dev/null @@ -1,34 +0,0 @@ -obj/HAL/src/alt_lseek.o: HAL/src/alt_lseek.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h \ - HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_lseek.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_lseek.o deleted file mode 100644 index 4af2703..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_lseek.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_main.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_main.d deleted file mode 100644 index afdfda0..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_main.d +++ /dev/null @@ -1,47 +0,0 @@ -obj/HAL/src/alt_main.o: HAL/src/alt_main.c HAL/inc/sys/alt_dev.h system.h \ - linker.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_sys_init.h HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h HAL/inc/os/alt_hooks.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h \ - HAL/inc/alt_types.h system.h HAL/inc/sys/alt_log_printf.h system.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_sys_init.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/os/alt_hooks.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/alt_types.h: - -system.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_main.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_main.o deleted file mode 100644 index 73422a5..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_main.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_malloc_lock.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_malloc_lock.d deleted file mode 100644 index 4ed35c2..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_malloc_lock.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_malloc_lock.o: HAL/src/alt_malloc_lock.c diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_malloc_lock.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_malloc_lock.o deleted file mode 100644 index 9b5c5ee..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_malloc_lock.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_mcount.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_mcount.d deleted file mode 100644 index 1203efc..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_mcount.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_mcount.o: HAL/src/alt_mcount.S diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_mcount.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_mcount.o deleted file mode 100644 index bf698bf..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_mcount.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_open.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_open.d deleted file mode 100644 index a2aacd9..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_open.d +++ /dev/null @@ -1,36 +0,0 @@ -obj/HAL/src/alt_open.o: HAL/src/alt_open.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_open.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_open.o deleted file mode 100644 index 7779efe..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_open.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_printf.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_printf.d deleted file mode 100644 index 3ce68a4..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_printf.d +++ /dev/null @@ -1,3 +0,0 @@ -obj/HAL/src/alt_printf.o: HAL/src/alt_printf.c HAL/inc/sys/alt_stdio.h - -HAL/inc/sys/alt_stdio.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_printf.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_printf.o deleted file mode 100644 index ec37fc7..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_printf.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_putchar.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_putchar.d deleted file mode 100644 index 9a0dde3..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_putchar.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_putchar.o: HAL/src/alt_putchar.c system.h linker.h \ - HAL/inc/sys/alt_driver.h HAL/inc/sys/alt_stdio.h - -system.h: - -linker.h: - -HAL/inc/sys/alt_driver.h: - -HAL/inc/sys/alt_stdio.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_putchar.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_putchar.o deleted file mode 100644 index 2dcdb7e..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_putchar.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_putstr.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_putstr.d deleted file mode 100644 index 3cf528a..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_putstr.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_putstr.o: HAL/src/alt_putstr.c system.h linker.h \ - HAL/inc/sys/alt_driver.h HAL/inc/sys/alt_stdio.h - -system.h: - -linker.h: - -HAL/inc/sys/alt_driver.h: - -HAL/inc/sys/alt_stdio.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_putstr.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_putstr.o deleted file mode 100644 index 0b69827..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_putstr.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_read.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_read.d deleted file mode 100644 index 2bb0d95..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_read.d +++ /dev/null @@ -1,38 +0,0 @@ -obj/HAL/src/alt_read.o: HAL/src/alt_read.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h \ - HAL/inc/os/alt_syscall.h system.h HAL/inc/sys/alt_driver.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_syscall.h: - -system.h: - -HAL/inc/sys/alt_driver.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_read.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_read.o deleted file mode 100644 index 15fc4fe..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_read.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_release_fd.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_release_fd.d deleted file mode 100644 index 0e3acb5..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_release_fd.d +++ /dev/null @@ -1,29 +0,0 @@ -obj/HAL/src/alt_release_fd.o: HAL/src/alt_release_fd.c \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_release_fd.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_release_fd.o deleted file mode 100644 index 91ccf5a..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_release_fd.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_remap_cached.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_remap_cached.d deleted file mode 100644 index b5fb151..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_remap_cached.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_remap_cached.o: HAL/src/alt_remap_cached.c \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h system.h linker.h - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_remap_cached.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_remap_cached.o deleted file mode 100644 index 41c81f9..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_remap_cached.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_remap_uncached.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_remap_uncached.d deleted file mode 100644 index 0423405..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_remap_uncached.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_remap_uncached.o: HAL/src/alt_remap_uncached.c \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h system.h linker.h - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_remap_uncached.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_remap_uncached.o deleted file mode 100644 index 5779904..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_remap_uncached.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_rename.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_rename.d deleted file mode 100644 index b7af4b2..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_rename.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_rename.o: HAL/src/alt_rename.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_rename.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_rename.o deleted file mode 100644 index 128612e..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_rename.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_sbrk.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_sbrk.d deleted file mode 100644 index a0771ae..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_sbrk.d +++ /dev/null @@ -1,19 +0,0 @@ -obj/HAL/src/alt_sbrk.o: HAL/src/alt_sbrk.c HAL/inc/os/alt_syscall.h \ - HAL/inc/sys/alt_irq.h HAL/inc/nios2.h HAL/inc/alt_types.h system.h \ - linker.h HAL/inc/sys/alt_stack.h system.h - -HAL/inc/os/alt_syscall.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_stack.h: - -system.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_sbrk.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_sbrk.o deleted file mode 100644 index 2f6e8c6..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_sbrk.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_settod.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_settod.d deleted file mode 100644 index 56718d5..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_settod.d +++ /dev/null @@ -1,17 +0,0 @@ -obj/HAL/src/alt_settod.o: HAL/src/alt_settod.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_settod.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_settod.o deleted file mode 100644 index 5ef7e3d..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_settod.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_software_exception.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_software_exception.d deleted file mode 100644 index fab4023..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_software_exception.d +++ /dev/null @@ -1,6 +0,0 @@ -obj/HAL/src/alt_software_exception.o: HAL/src/alt_software_exception.S \ - system.h linker.h - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_software_exception.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_software_exception.o deleted file mode 100644 index f9e01c2..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_software_exception.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_stat.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_stat.d deleted file mode 100644 index 8a63c27..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_stat.d +++ /dev/null @@ -1,3 +0,0 @@ -obj/HAL/src/alt_stat.o: HAL/src/alt_stat.c HAL/inc/os/alt_syscall.h - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_stat.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_stat.o deleted file mode 100644 index aeb58c8..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_stat.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_tick.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_tick.d deleted file mode 100644 index ddbb281..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_tick.d +++ /dev/null @@ -1,27 +0,0 @@ -obj/HAL/src/alt_tick.o: HAL/src/alt_tick.c HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h HAL/inc/alt_types.h system.h linker.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/os/alt_hooks.h \ - HAL/inc/alt_types.h - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_hooks.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_tick.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_tick.o deleted file mode 100644 index c87b756..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_tick.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_times.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_times.d deleted file mode 100644 index 4bad83d..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_times.d +++ /dev/null @@ -1,17 +0,0 @@ -obj/HAL/src/alt_times.o: HAL/src/alt_times.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_times.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_times.o deleted file mode 100644 index 7d12c7c..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_times.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_uncached_free.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_uncached_free.d deleted file mode 100644 index d74ef4b..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_uncached_free.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_uncached_free.o: HAL/src/alt_uncached_free.c \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h system.h linker.h - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_uncached_free.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_uncached_free.o deleted file mode 100644 index 69ec0b1..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_uncached_free.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_uncached_malloc.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_uncached_malloc.d deleted file mode 100644 index 16799fb..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_uncached_malloc.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_uncached_malloc.o: HAL/src/alt_uncached_malloc.c \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h system.h linker.h - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_uncached_malloc.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_uncached_malloc.o deleted file mode 100644 index cedd32a..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_uncached_malloc.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_unlink.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_unlink.d deleted file mode 100644 index 0205f86..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_unlink.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_unlink.o: HAL/src/alt_unlink.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_unlink.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_unlink.o deleted file mode 100644 index 8fe2562..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_unlink.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_usleep.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_usleep.d deleted file mode 100644 index b5eca45..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_usleep.d +++ /dev/null @@ -1,6 +0,0 @@ -obj/HAL/src/alt_usleep.o: HAL/src/alt_usleep.c \ - HAL/inc/priv/alt_busy_sleep.h HAL/inc/os/alt_syscall.h - -HAL/inc/priv/alt_busy_sleep.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_usleep.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_usleep.o deleted file mode 100644 index 7eb8b92..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_usleep.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_wait.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_wait.d deleted file mode 100644 index f47f5df..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_wait.d +++ /dev/null @@ -1,8 +0,0 @@ -obj/HAL/src/alt_wait.o: HAL/src/alt_wait.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_wait.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_wait.o deleted file mode 100644 index 89a8467..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_wait.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_write.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_write.d deleted file mode 100644 index 2b54a68..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_write.d +++ /dev/null @@ -1,41 +0,0 @@ -obj/HAL/src/alt_write.o: HAL/src/alt_write.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h \ - HAL/inc/os/alt_syscall.h HAL/inc/sys/alt_log_printf.h system.h \ - HAL/inc/sys/alt_driver.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_syscall.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: - -HAL/inc/sys/alt_driver.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_write.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_write.o deleted file mode 100644 index 3d70b90..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/alt_write.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/altera_nios2_qsys_irq.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/altera_nios2_qsys_irq.d deleted file mode 100644 index 47bdd9c..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/altera_nios2_qsys_irq.d +++ /dev/null @@ -1,15 +0,0 @@ -obj/HAL/src/altera_nios2_qsys_irq.o: HAL/src/altera_nios2_qsys_irq.c \ - HAL/inc/sys/alt_irq.h HAL/inc/nios2.h HAL/inc/alt_types.h system.h \ - linker.h HAL/inc/altera_nios2_qsys_irq.h - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/altera_nios2_qsys_irq.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/altera_nios2_qsys_irq.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/altera_nios2_qsys_irq.o deleted file mode 100644 index dfe1663..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/altera_nios2_qsys_irq.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/crt0.d b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/crt0.d deleted file mode 100644 index 3af0bb0..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/crt0.d +++ /dev/null @@ -1,12 +0,0 @@ -obj/HAL/src/crt0.o: HAL/src/crt0.S system.h linker.h HAL/inc/nios2.h \ - HAL/inc/sys/alt_log_printf.h system.h - -system.h: - -linker.h: - -HAL/inc/nios2.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/crt0.o b/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/crt0.o deleted file mode 100644 index e508ad9..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/HAL/src/crt0.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/alt_sys_init.d b/software/qsys_tutorial_lcd2_bsp/obj/alt_sys_init.d deleted file mode 100644 index 029ebe0..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/alt_sys_init.d +++ /dev/null @@ -1,59 +0,0 @@ -obj/alt_sys_init.o: alt_sys_init.c system.h linker.h \ - HAL/inc/sys/alt_irq.h HAL/inc/nios2.h HAL/inc/alt_types.h system.h \ - HAL/inc/sys/alt_sys_init.h HAL/inc/altera_nios2_qsys_irq.h \ - drivers/inc/altera_avalon_jtag_uart.h HAL/inc/sys/alt_alarm.h \ - HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h \ - HAL/inc/sys/alt_warning.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_flag.h \ - drivers/inc/altera_avalon_jtag_uart_fd.h HAL/inc/sys/alt_dev.h \ - HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h drivers/inc/altera_avalon_lcd_16207.h \ - drivers/inc/altera_avalon_lcd_16207_fd.h - -system.h: - -linker.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -HAL/inc/sys/alt_sys_init.h: - -HAL/inc/altera_nios2_qsys_irq.h: - -drivers/inc/altera_avalon_jtag_uart.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_flag.h: - -drivers/inc/altera_avalon_jtag_uart_fd.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -drivers/inc/altera_avalon_lcd_16207.h: - -drivers/inc/altera_avalon_lcd_16207_fd.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/alt_sys_init.o b/software/qsys_tutorial_lcd2_bsp/obj/alt_sys_init.o deleted file mode 100644 index dcd0c34..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/alt_sys_init.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/drivers/src/altera_avalon_jtag_uart_fd.d b/software/qsys_tutorial_lcd2_bsp/obj/drivers/src/altera_avalon_jtag_uart_fd.d deleted file mode 100644 index b152697..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/drivers/src/altera_avalon_jtag_uart_fd.d +++ /dev/null @@ -1,48 +0,0 @@ -obj/drivers/src/altera_avalon_jtag_uart_fd.o: \ - drivers/src/altera_avalon_jtag_uart_fd.c HAL/inc/alt_types.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - drivers/inc/altera_avalon_jtag_uart.h HAL/inc/sys/alt_alarm.h \ - HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_alarm.h \ - HAL/inc/sys/alt_warning.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_flag.h \ - drivers/inc/altera_avalon_jtag_uart_fd.h HAL/inc/sys/alt_dev.h - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_flag.h: - -drivers/inc/altera_avalon_jtag_uart_fd.h: - -HAL/inc/sys/alt_dev.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/drivers/src/altera_avalon_jtag_uart_fd.o b/software/qsys_tutorial_lcd2_bsp/obj/drivers/src/altera_avalon_jtag_uart_fd.o deleted file mode 100644 index 91ece10..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/drivers/src/altera_avalon_jtag_uart_fd.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/drivers/src/altera_avalon_jtag_uart_init.d b/software/qsys_tutorial_lcd2_bsp/obj/drivers/src/altera_avalon_jtag_uart_init.d deleted file mode 100644 index f9460a1..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/drivers/src/altera_avalon_jtag_uart_init.d +++ /dev/null @@ -1,66 +0,0 @@ -obj/drivers/src/altera_avalon_jtag_uart_init.o: \ - drivers/src/altera_avalon_jtag_uart_init.c HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h HAL/inc/alt_types.h system.h linker.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/sys/ioctl.h \ - HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart_regs.h \ - HAL/inc/io.h HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_warning.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_flag.h \ - drivers/inc/altera_avalon_jtag_uart_fd.h HAL/inc/sys/alt_dev.h \ - HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/sys/alt_log_printf.h system.h - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/ioctl.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart_regs.h: - -HAL/inc/io.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_flag.h: - -drivers/inc/altera_avalon_jtag_uart_fd.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/drivers/src/altera_avalon_jtag_uart_init.o b/software/qsys_tutorial_lcd2_bsp/obj/drivers/src/altera_avalon_jtag_uart_init.o deleted file mode 100644 index a136b20..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/drivers/src/altera_avalon_jtag_uart_init.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/drivers/src/altera_avalon_jtag_uart_ioctl.d b/software/qsys_tutorial_lcd2_bsp/obj/drivers/src/altera_avalon_jtag_uart_ioctl.d deleted file mode 100644 index d75a559..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/drivers/src/altera_avalon_jtag_uart_ioctl.d +++ /dev/null @@ -1,58 +0,0 @@ -obj/drivers/src/altera_avalon_jtag_uart_ioctl.o: \ - drivers/src/altera_avalon_jtag_uart_ioctl.c HAL/inc/sys/ioctl.h \ - HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart_regs.h \ - HAL/inc/io.h HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h \ - HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_flag.h \ - drivers/inc/altera_avalon_jtag_uart_fd.h HAL/inc/sys/alt_dev.h system.h \ - linker.h HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/sys/alt_log_printf.h system.h - -HAL/inc/sys/ioctl.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart_regs.h: - -HAL/inc/io.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_flag.h: - -drivers/inc/altera_avalon_jtag_uart_fd.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/drivers/src/altera_avalon_jtag_uart_ioctl.o b/software/qsys_tutorial_lcd2_bsp/obj/drivers/src/altera_avalon_jtag_uart_ioctl.o deleted file mode 100644 index fc9ce92..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/drivers/src/altera_avalon_jtag_uart_ioctl.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/drivers/src/altera_avalon_jtag_uart_read.d b/software/qsys_tutorial_lcd2_bsp/obj/drivers/src/altera_avalon_jtag_uart_read.d deleted file mode 100644 index 9a4846a..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/drivers/src/altera_avalon_jtag_uart_read.d +++ /dev/null @@ -1,66 +0,0 @@ -obj/drivers/src/altera_avalon_jtag_uart_read.o: \ - drivers/src/altera_avalon_jtag_uart_read.c HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h HAL/inc/alt_types.h system.h linker.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/sys/ioctl.h \ - HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart_regs.h \ - HAL/inc/io.h HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_warning.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_flag.h \ - drivers/inc/altera_avalon_jtag_uart_fd.h HAL/inc/sys/alt_dev.h \ - HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/sys/alt_log_printf.h system.h - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/ioctl.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart_regs.h: - -HAL/inc/io.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_flag.h: - -drivers/inc/altera_avalon_jtag_uart_fd.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/drivers/src/altera_avalon_jtag_uart_read.o b/software/qsys_tutorial_lcd2_bsp/obj/drivers/src/altera_avalon_jtag_uart_read.o deleted file mode 100644 index 9222461..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/drivers/src/altera_avalon_jtag_uart_read.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/drivers/src/altera_avalon_jtag_uart_write.d b/software/qsys_tutorial_lcd2_bsp/obj/drivers/src/altera_avalon_jtag_uart_write.d deleted file mode 100644 index 5518b7f..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/drivers/src/altera_avalon_jtag_uart_write.d +++ /dev/null @@ -1,66 +0,0 @@ -obj/drivers/src/altera_avalon_jtag_uart_write.o: \ - drivers/src/altera_avalon_jtag_uart_write.c HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h HAL/inc/alt_types.h system.h linker.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/sys/ioctl.h \ - HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart_regs.h \ - HAL/inc/io.h HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_warning.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_flag.h \ - drivers/inc/altera_avalon_jtag_uart_fd.h HAL/inc/sys/alt_dev.h \ - HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/sys/alt_log_printf.h system.h - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/ioctl.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart_regs.h: - -HAL/inc/io.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_flag.h: - -drivers/inc/altera_avalon_jtag_uart_fd.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/drivers/src/altera_avalon_jtag_uart_write.o b/software/qsys_tutorial_lcd2_bsp/obj/drivers/src/altera_avalon_jtag_uart_write.o deleted file mode 100644 index 8602b6d..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/drivers/src/altera_avalon_jtag_uart_write.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/drivers/src/altera_avalon_lcd_16207.d b/software/qsys_tutorial_lcd2_bsp/obj/drivers/src/altera_avalon_lcd_16207.d deleted file mode 100644 index dfd0adb..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/drivers/src/altera_avalon_lcd_16207.d +++ /dev/null @@ -1,47 +0,0 @@ -obj/drivers/src/altera_avalon_lcd_16207.o: \ - drivers/src/altera_avalon_lcd_16207.c HAL/inc/sys/alt_alarm.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/priv/alt_alarm.h \ - HAL/inc/alt_types.h drivers/inc/altera_avalon_lcd_16207_regs.h \ - HAL/inc/io.h HAL/inc/alt_types.h drivers/inc/altera_avalon_lcd_16207.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h drivers/inc/altera_avalon_lcd_16207_fd.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_lcd_16207_regs.h: - -HAL/inc/io.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_lcd_16207.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -drivers/inc/altera_avalon_lcd_16207_fd.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/drivers/src/altera_avalon_lcd_16207.o b/software/qsys_tutorial_lcd2_bsp/obj/drivers/src/altera_avalon_lcd_16207.o deleted file mode 100644 index 4554201..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/drivers/src/altera_avalon_lcd_16207.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/obj/drivers/src/altera_avalon_lcd_16207_fd.d b/software/qsys_tutorial_lcd2_bsp/obj/drivers/src/altera_avalon_lcd_16207_fd.d deleted file mode 100644 index b39dc1d..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/drivers/src/altera_avalon_lcd_16207_fd.d +++ /dev/null @@ -1,43 +0,0 @@ -obj/drivers/src/altera_avalon_lcd_16207_fd.o: \ - drivers/src/altera_avalon_lcd_16207_fd.c HAL/inc/alt_types.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - drivers/inc/altera_avalon_lcd_16207.h HAL/inc/sys/alt_alarm.h \ - HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_alarm.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h drivers/inc/altera_avalon_lcd_16207_fd.h \ - HAL/inc/sys/alt_dev.h - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_lcd_16207.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -drivers/inc/altera_avalon_lcd_16207_fd.h: - -HAL/inc/sys/alt_dev.h: diff --git a/software/qsys_tutorial_lcd2_bsp/obj/drivers/src/altera_avalon_lcd_16207_fd.o b/software/qsys_tutorial_lcd2_bsp/obj/drivers/src/altera_avalon_lcd_16207_fd.o deleted file mode 100644 index d43dc6a..0000000 --- a/software/qsys_tutorial_lcd2_bsp/obj/drivers/src/altera_avalon_lcd_16207_fd.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd2_bsp/public.mk b/software/qsys_tutorial_lcd2_bsp/public.mk deleted file mode 100644 index 5eb883d..0000000 --- a/software/qsys_tutorial_lcd2_bsp/public.mk +++ /dev/null @@ -1,385 +0,0 @@ -#------------------------------------------------------------------------------ -# BSP "PUBLIC" MAKEFILE CONTENT -# -# This file is intended to be included in an application or library -# Makefile that is using this BSP. You can create such a Makefile with -# the nios2-app-generate-makefile or nios2-lib-generate-makefile -# commands. -# -# The following variables must be defined before including this file: -# -# ALT_LIBRARY_ROOT_DIR -# Contains the path to the BSP top-level (aka root) directory -#------------------------------------------------------------------------------ - -#------------------------------------------------------------------------------ -# PATHS -#------------------------------------------------------------------------------ - - - -# Path to the provided linker script. -BSP_LINKER_SCRIPT := $(ALT_LIBRARY_ROOT_DIR)/linker.x - -# Include paths: -# The path to root of all header files that a library wishes to make -# available for an application's use is specified here. Note that this -# may not be *all* folders within a hierarchy. For example, if it is -# desired that the application developer type: -# #include -# #include -# With files laid out like this: -# /inc/sockets.h -# /inc/ip/tcpip.h -# -# Then, only /inc need be added to the list of include -# directories. Alternatively, if you wish to be able to directly include -# all files in a hierarchy, separate paths to each folder in that -# hierarchy must be defined. - -# The following are the "base" set of include paths for a BSP. -# These paths are appended to the list that individual software -# components, drivers, etc., add in the generated portion of this -# file (below). -ALT_INCLUDE_DIRS_TO_APPEND += \ - $(ALT_LIBRARY_ROOT_DIR) \ - $(ALT_LIBRARY_ROOT_DIR)/drivers/inc - -# Additions to linker library search-path: -# Here we provide a path to "our self" for the application to construct a -# "-L " out of. This should contain a list of directories, -# relative to the library root, of all directories with .a files to link -# against. -ALT_LIBRARY_DIRS += $(ALT_LIBRARY_ROOT_DIR) - - -#------------------------------------------------------------------------------ -# COMPILATION FLAGS -#------------------------------------------------------------------------------ -# Default C pre-processor flags for a BSP: -ALT_CPPFLAGS += -DSYSTEM_BUS_WIDTH=32 \ - -pipe - - -#------------------------------------------------------------------------------ -# MANAGED CONTENT -# -# All content between the lines "START MANAGED" and "END MANAGED" below is -# generated based on variables in the BSP settings file when the -# nios2-bsp-generate-files command is invoked. If you wish to persist any -# information pertaining to the build process, it is recomended that you -# utilize the BSP settings mechanism to do so. -#------------------------------------------------------------------------------ -#START MANAGED - -# The following TYPE comment allows tools to identify the 'type' of target this -# makefile is associated with. -# TYPE: BSP_PUBLIC_MAKEFILE - -# This following VERSION comment indicates the version of the tool used to -# generate this makefile. A makefile variable is provided for VERSION as well. -# ACDS_VERSION: 13.0sp1 -ACDS_VERSION := 13.0sp1 - -# This following BUILD_NUMBER comment indicates the build number of the tool -# used to generate this makefile. -# BUILD_NUMBER: 232 - -# Qsys--generated SOPCINFO file. Required for resolving node instance ID's with -# design component names. -SOPCINFO_FILE := C:/Users/takayun/Documents/DE2-115/qsys_tutorial/nios_system.sopcinfo - -# Big-Endian operation. -# setting BIG_ENDIAN is false -ALT_CFLAGS += -EL - -# Path to the provided C language runtime initialization code. -BSP_CRT0 := $(ALT_LIBRARY_ROOT_DIR)/obj/HAL/src/crt0.o - -# Name of BSP library as provided to linker using the "-msys-lib" flag or -# linker script GROUP command. -# setting BSP_SYS_LIB is hal_bsp -BSP_SYS_LIB := hal_bsp -ELF_PATCH_FLAG += --thread_model hal - -# Type identifier of the BSP library -# setting BSP_TYPE is hal -ALT_CPPFLAGS += -D__hal__ -BSP_TYPE := hal - -# CPU Name -# setting CPU_NAME is nios2_processor -CPU_NAME = nios2_processor -ELF_PATCH_FLAG += --cpu_name $(CPU_NAME) - -# Hardware Divider present. -# setting HARDWARE_DIVIDE is false -ALT_CFLAGS += -mno-hw-div - -# Hardware Multiplier present. -# setting HARDWARE_MULTIPLY is false -ALT_CFLAGS += -mno-hw-mul - -# Hardware Mulx present. -# setting HARDWARE_MULX is false -ALT_CFLAGS += -mno-hw-mulx - -# Debug Core present. -# setting HAS_DEBUG_CORE is true -CPU_HAS_DEBUG_CORE = 1 - -# Qsys generated design -# setting QSYS is 1 -QSYS := 1 -ELF_PATCH_FLAG += --qsys true - -# Design Name -# setting SOPC_NAME is nios_system -SOPC_NAME := nios_system - -# SopcBuilder Simulation Enabled -# setting SOPC_SIMULATION_ENABLED is false -ELF_PATCH_FLAG += --simulation_enabled false - -# Enable JTAG UART driver to recover when host is inactive causing buffer to -# full without returning error. Printf will not fail with this recovery. none -# setting altera_avalon_jtag_uart_driver.enable_jtag_uart_ignore_fifo_full_error is false - -# Small-footprint (polled mode) driver none -# setting altera_avalon_jtag_uart_driver.enable_small_driver is false - -# Build a custom version of newlib with the specified space-separated compiler -# flags. The custom newlib build will be placed in the <bsp root>/newlib -# directory, and will be used only for applications that utilize this BSP. -# setting hal.custom_newlib_flags is none - -# Enable support for a subset of the C++ language. This option increases code -# footprint by adding support for C++ constructors. Certain features, such as -# multiple inheritance and exceptions are not supported. If false, adds -# -DALT_NO_C_PLUS_PLUS to ALT_CPPFLAGS in public.mk, and reduces code -# footprint. none -# setting hal.enable_c_plus_plus is false -ALT_CPPFLAGS += -DALT_NO_C_PLUS_PLUS - -# When your application exits, close file descriptors, call C++ destructors, -# etc. Code footprint can be reduced by disabling clean exit. If disabled, adds -# -DALT_NO_CLEAN_EXIT to ALT_CPPFLAGS and -Wl,--defsym, exit=_exit to -# ALT_LDFLAGS in public.mk. none -# setting hal.enable_clean_exit is false -ALT_CPPFLAGS += -DALT_NO_CLEAN_EXIT -ALT_LDFLAGS += -Wl,--defsym,exit=_exit - -# Add exit() support. This option increases code footprint if your "main()" -# routine does "return" or call "exit()". If false, adds -DALT_NO_EXIT to -# ALT_CPPFLAGS in public.mk, and reduces footprint none -# setting hal.enable_exit is false -ALT_CPPFLAGS += -DALT_NO_EXIT - -# Causes code to be compiled with gprof profiling enabled and the application -# ELF to be linked with the GPROF library. If true, adds -DALT_PROVIDE_GMON to -# ALT_CPPFLAGS and -pg to ALT_CFLAGS in public.mk. none -# setting hal.enable_gprof is false - -# Enables lightweight device driver API. This reduces code and data footprint -# by removing the HAL layer that maps device names (e.g. /dev/uart0) to file -# descriptors. Instead, driver routines are called directly. The open(), -# close(), and lseek() routines will always fail if called. The read(), -# write(), fstat(), ioctl(), and isatty() routines only work for the stdio -# devices. If true, adds -DALT_USE_DIRECT_DRIVERS to ALT_CPPFLAGS in public.mk. -# The Altera Host and read-only ZIP file systems can't be used if -# hal.enable_lightweight_device_driver_api is true. -# setting hal.enable_lightweight_device_driver_api is true -ALT_CPPFLAGS += -DALT_USE_DIRECT_DRIVERS - -# Adds code to emulate multiply and divide instructions in case they are -# executed but aren't present in the CPU. Normally this isn't required because -# the compiler won't use multiply and divide instructions that aren't present -# in the CPU. If false, adds -DALT_NO_INSTRUCTION_EMULATION to ALT_CPPFLAGS in -# public.mk. none -# setting hal.enable_mul_div_emulation is false -ALT_CPPFLAGS += -DALT_NO_INSTRUCTION_EMULATION - -# Certain drivers are compiled with reduced functionality to reduce code -# footprint. Not all drivers observe this setting. The altera_avalon_uart and -# altera_avalon_jtag_uart drivers switch from interrupt-driven to polled -# operation. CAUTION: Several device drivers are disabled entirely. These -# include the altera_avalon_cfi_flash, altera_avalon_epcs_flash_controller, and -# altera_avalon_lcd_16207 drivers. This can result in certain API (HAL flash -# access routines) to fail. You can define a symbol provided by each driver to -# prevent it from being removed. If true, adds -DALT_USE_SMALL_DRIVERS to -# ALT_CPPFLAGS in public.mk. none -# setting hal.enable_reduced_device_drivers is true -ALT_CPPFLAGS += -DALT_USE_SMALL_DRIVERS - -# Turns on HAL runtime stack checking feature. Enabling this setting causes -# additional code to be placed into each subroutine call to generate an -# exception if a stack collision occurs with the heap or statically allocated -# data. If true, adds -DALT_STACK_CHECK and -mstack-check to ALT_CPPFLAGS in -# public.mk. none -# setting hal.enable_runtime_stack_checking is false - -# The BSP is compiled with optimizations to speedup HDL simulation such as -# initializing the cache, clearing the .bss section, and skipping long delay -# loops. If true, adds -DALT_SIM_OPTIMIZE to ALT_CPPFLAGS in public.mk. When -# this setting is true, the BSP shouldn't be used to build applications that -# are expected to run real hardware. -# setting hal.enable_sim_optimize is false - -# Causes the small newlib (C library) to be used. This reduces code and data -# footprint at the expense of reduced functionality. Several newlib features -# are removed such as floating-point support in printf(), stdin input routines, -# and buffered I/O. The small C library is not compatible with Micrium -# MicroC/OS-II. If true, adds -msmallc to ALT_LDFLAGS in public.mk. none -# setting hal.enable_small_c_library is true -ALT_LDFLAGS += -msmallc -ALT_CPPFLAGS += -DSMALL_C_LIB - -# Enable SOPC Builder System ID. If a System ID SOPC Builder component is -# connected to the CPU associated with this BSP, it will be enabled in the -# creation of command-line arguments to download an ELF to the target. -# Otherwise, system ID and timestamp values are left out of public.mk for -# application Makefile "download-elf" target definition. With the system ID -# check disabled, the Nios II EDS tools will not automatically ensure that the -# application .elf file (and BSP it is linked against) corresponds to the -# hardware design on the target. If false, adds --accept-bad-sysid to -# SOPC_SYSID_FLAG in public.mk. none -# setting hal.enable_sopc_sysid_check is true - -# Enable BSP generation to query if SOPC system is big endian. If true ignores -# export of 'ALT_CFLAGS += -EB' to public.mk if big endian system. If true -# ignores export of 'ALT_CFLAGS += -EL' if little endian system. none -# setting hal.make.ignore_system_derived.big_endian is false - -# Enable BSP generation to query if SOPC system has a debug core present. If -# true ignores export of 'CPU_HAS_DEBUG_CORE = 1' to public.mk if a debug core -# is found in the system. If true ignores export of 'CPU_HAS_DEBUG_CORE = 0' if -# no debug core is found in the system. none -# setting hal.make.ignore_system_derived.debug_core_present is false - -# Enable BSP generation to query if SOPC system has FPU present. If true -# ignores export of 'ALT_CFLAGS += -mhard-float' to public.mk if FPU is found -# in the system. If true ignores export of 'ALT_CFLAGS += -mhard-soft' if FPU -# is not found in the system. none -# setting hal.make.ignore_system_derived.fpu_present is false - -# Enable BSP generation to query if SOPC system has hardware divide present. If -# true ignores export of 'ALT_CFLAGS += -mno-hw-div' to public.mk if no -# division is found in system. If true ignores export of 'ALT_CFLAGS += -# -mhw-div' if division is found in the system. none -# setting hal.make.ignore_system_derived.hardware_divide_present is false - -# Enable BSP generation to query if SOPC system floating point custom -# instruction with a divider is present. If true ignores export of 'ALT_CFLAGS -# += -mcustom-fpu-cfg=60-2' and 'ALT_LDFLAGS += -mcustom-fpu-cfg=60-2' to -# public.mk if the custom instruction is found in the system. none -# setting hal.make.ignore_system_derived.hardware_fp_cust_inst_divider_present is false - -# Enable BSP generation to query if SOPC system floating point custom -# instruction without a divider is present. If true ignores export of -# 'ALT_CFLAGS += -mcustom-fpu-cfg=60-1' and 'ALT_LDFLAGS += -# -mcustom-fpu-cfg=60-1' to public.mk if the custom instruction is found in the -# system. none -# setting hal.make.ignore_system_derived.hardware_fp_cust_inst_no_divider_present is false - -# Enable BSP generation to query if SOPC system has multiplier present. If true -# ignores export of 'ALT_CFLAGS += -mno-hw-mul' to public.mk if no multiplier -# is found in the system. If true ignores export of 'ALT_CFLAGS += -mhw-mul' if -# multiplier is found in the system. none -# setting hal.make.ignore_system_derived.hardware_multiplier_present is false - -# Enable BSP generation to query if SOPC system has hardware mulx present. If -# true ignores export of 'ALT_CFLAGS += -mno-hw-mulx' to public.mk if no mulx -# is found in the system. If true ignores export of 'ALT_CFLAGS += -mhw-mulx' -# if mulx is found in the system. none -# setting hal.make.ignore_system_derived.hardware_mulx_present is false - -# Enable BSP generation to query if SOPC system has simulation enabled. If true -# ignores export of 'ELF_PATCH_FLAG += --simulation_enabled' to public.mk. none -# setting hal.make.ignore_system_derived.sopc_simulation_enabled is false - -# Enable BSP generation to query SOPC system for system ID base address. If -# true ignores export of 'SOPC_SYSID_FLAG += --sidp=
' and -# 'ELF_PATCH_FLAG += --sidp=
' to public.mk. none -# setting hal.make.ignore_system_derived.sopc_system_base_address is false - -# Enable BSP generation to query SOPC system for system ID. If true ignores -# export of 'SOPC_SYSID_FLAG += --id=' and 'ELF_PATCH_FLAG += -# --id=' to public.mk. none -# setting hal.make.ignore_system_derived.sopc_system_id is false - -# Enable BSP generation to query SOPC system for system timestamp. If true -# ignores export of 'SOPC_SYSID_FLAG += --timestamp=' and -# 'ELF_PATCH_FLAG += --timestamp=' to public.mk. none -# setting hal.make.ignore_system_derived.sopc_system_timestamp is false - -# Slave descriptor of STDERR character-mode device. This setting is used by the -# ALT_STDERR family of defines in system.h. none -# setting hal.stderr is jtag_uart -ELF_PATCH_FLAG += --stderr_dev jtag_uart - -# Slave descriptor of STDIN character-mode device. This setting is used by the -# ALT_STDIN family of defines in system.h. none -# setting hal.stdin is jtag_uart -ELF_PATCH_FLAG += --stdin_dev jtag_uart - -# Slave descriptor of STDOUT character-mode device. This setting is used by the -# ALT_STDOUT family of defines in system.h. none -# setting hal.stdout is jtag_uart -ELF_PATCH_FLAG += --stdout_dev jtag_uart - - -#------------------------------------------------------------------------------ -# SOFTWARE COMPONENT & DRIVER INCLUDE PATHS -#------------------------------------------------------------------------------ - -ALT_INCLUDE_DIRS += $(ALT_LIBRARY_ROOT_DIR)/HAL/inc - -#------------------------------------------------------------------------------ -# SOFTWARE COMPONENT & DRIVER PRODUCED ALT_CPPFLAGS ADDITIONS -#------------------------------------------------------------------------------ - -ALT_CPPFLAGS += -DALT_SINGLE_THREADED - -#END MANAGED - - -#------------------------------------------------------------------------------ -# LIBRARY INFORMATION -#------------------------------------------------------------------------------ -# Assemble the name of the BSP *.a file using the BSP library name -# (BSP_SYS_LIB) in generated content above. -BSP_LIB := lib$(BSP_SYS_LIB).a - -# Additional libraries to link against: -# An application including this file will prefix each library with "-l". -# For example, to include the Newlib math library "m" is included, which -# becomes "-lm" when linking the application. -ALT_LIBRARY_NAMES += m - -# Additions to linker dependencies: -# An application Makefile will typically add these directly to the list -# of dependencies required to build the executable target(s). The BSP -# library (*.a) file is specified here. -ALT_LDDEPS += $(ALT_LIBRARY_ROOT_DIR)/$(BSP_LIB) - -# Is this library "Makeable"? -# Add to list of root library directories that support running 'make' -# to build them. Because libraries may or may not have a Makefile in their -# root, appending to this variable tells an application to run 'make' in -# the library root to build/update this library. -MAKEABLE_LIBRARY_ROOT_DIRS += $(ALT_LIBRARY_ROOT_DIR) - -# Additional Assembler Flags -# -gdwarf2 flag is required for stepping through assembly code -ALT_ASFLAGS += -gdwarf2 - -#------------------------------------------------------------------------------ -# FINAL INCLUDE PATH LIST -#------------------------------------------------------------------------------ -# Append static include paths to paths specified by OS/driver/sw package -# additions to the BSP thus giving them precedence in case a BSP addition -# is attempting to override BSP sources. -ALT_INCLUDE_DIRS += $(ALT_INCLUDE_DIRS_TO_APPEND) - - - diff --git a/software/qsys_tutorial_lcd2_bsp/settings.bsp b/software/qsys_tutorial_lcd2_bsp/settings.bsp deleted file mode 100644 index 79cf4df..0000000 --- a/software/qsys_tutorial_lcd2_bsp/settings.bsp +++ /dev/null @@ -1,991 +0,0 @@ - - - hal - default - 2016/12/02 0:00:36 - 1480604436216 - C:\Users\takayun\Documents\DE2-115\qsys_tutorial\software\qsys_tutorial_lcd2_bsp - .\settings.bsp - C:\Users\takayun\Documents\DE2-115\qsys_tutorial\nios_system.sopcinfo - default - nios2_processor - 1.9 - - hal.sys_clk_timer - ALT_SYS_CLK - UnquotedString - none - none - system_h_define - Slave descriptor of the system clock timer device. This device provides a periodic interrupt ("tick") and is typically required for RTOS use. This setting defines the value of ALT_SYS_CLK in system.h. - none - false - common - - - hal.timestamp_timer - ALT_TIMESTAMP_CLK - UnquotedString - none - none - system_h_define - Slave descriptor of timestamp timer device. This device is used by Altera HAL timestamp drivers for high-resolution time measurement. This setting defines the value of ALT_TIMESTAMP_CLK in system.h. - none - false - common - - - hal.max_file_descriptors - ALT_MAX_FD - DecimalNumber - 4 - 32 - system_h_define - Determines the number of file descriptors statically allocated. This setting defines the value of ALT_MAX_FD in system.h. - If hal.enable_lightweight_device_driver_api is true, there are no file descriptors so this setting is ignored. If hal.enable_lightweight_device_driver_api is false, this setting must be at least 4 because HAL needs a file descriptor for /dev/null, /dev/stdin, /dev/stdout, and /dev/stderr. - false - - - - hal.enable_instruction_related_exceptions_api - ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API - BooleanDefineOnly - false - false - system_h_define - Enables API for registering handlers to service instruction-related exceptions. Enabling this setting increases the size of the exception entry code. - These exception types can be generated if various processor options are enabled, such as the MMU, MPU, or other advanced exception types. - false - - - - hal.linker.allow_code_at_reset - ALT_ALLOW_CODE_AT_RESET - Boolean - 1 - 0 - none - Indicates if initialization code is allowed at the reset address. If true, defines the macro ALT_ALLOW_CODE_AT_RESET in linker.h. - If true, defines the macro ALT_ALLOW_CODE_AT_RESET in linker.h. This setting is typically false if an external bootloader (e.g. flash bootloader) is present. - false - - - - hal.linker.enable_alt_load - NONE - Boolean - 1 - 0 - none - Enables the alt_load() facility. The alt_load() facility copies sections from the .text memory into RAM. If true, this setting sets up the VMA/LMA of sections in linker.x to allow them to be loaded into the .text memory. - This setting is typically false if an external bootloader (e.g. flash bootloader) is present. - false - - - - hal.linker.enable_alt_load_copy_rodata - NONE - Boolean - 0 - 0 - none - Causes the alt_load() facility to copy the .rodata section. If true, this setting defines the macro ALT_LOAD_COPY_RODATA in linker.h. - none - false - - - - hal.linker.enable_alt_load_copy_rwdata - NONE - Boolean - 1 - 0 - none - Causes the alt_load() facility to copy the .rwdata section. If true, this setting defines the macro ALT_LOAD_COPY_RWDATA in linker.h. - none - false - - - - hal.linker.enable_alt_load_copy_exceptions - NONE - Boolean - 0 - 0 - none - Causes the alt_load() facility to copy the .exceptions section. If true, this setting defines the macro ALT_LOAD_COPY_EXCEPTIONS in linker.h. - none - false - - - - hal.linker.enable_exception_stack - NONE - Boolean - 0 - 0 - none - Enables use of a separate exception stack. If true, defines the macro ALT_EXCEPTION_STACK in linker.h, adds a memory region called exception_stack to linker.x, and provides the symbols __alt_exception_stack_pointer and __alt_exception_stack_limit in linker.x. - The hal.linker.exception_stack_size and hal.linker.exception_stack_memory_region_name settings must also be valid. This setting must be false for MicroC/OS-II BSPs. The exception stack can be used to improve interrupt and other exception performance if the EIC is *not* used. - false - common - - - hal.linker.exception_stack_size - NONE - DecimalNumber - 1024 - 1024 - none - Size of the exception stack in bytes. - Only used if hal.linker.enable_exception_stack is true. - false - common - - - hal.linker.exception_stack_memory_region_name - NONE - UnquotedString - onchip_memory - none - none - Name of the existing memory region that will be divided up to create the 'exception_stack' memory region. The selected region name will be adjusted automatically when the BSP is generated to create the 'exception_stack' memory region. - Only used if hal.linker.enable_exception_stack is true. - false - common - - - hal.linker.enable_interrupt_stack - NONE - Boolean - 0 - 0 - none - Enables use of a separate interrupt stack. If true, defines the macro ALT_INTERRUPT_STACK in linker.h, adds a memory region called interrupt_stack to linker.x, and provides the symbols __alt_interrupt_stack_pointer and __alt_interrupt_stack_limit in linker.x. - The hal.linker.interrupt_stack_size and hal.linker.interrupt_stack_memory_region_name settings must also be valid. This setting must be false for MicroC/OS-II BSPs. Only enable if the EIC is used exclusively. The exception stack can be used to improve interrupt and other exception performance if the EIC is *not* used. - false - common - - - hal.linker.interrupt_stack_size - NONE - DecimalNumber - 1024 - 1024 - none - Size of the interrupt stack in bytes. - Only used if hal.linker.enable_interrupt_stack is true. - false - common - - - hal.linker.interrupt_stack_memory_region_name - NONE - UnquotedString - onchip_memory - none - none - Name of the existing memory region that will be divided up to create the 'interrupt_stack' memory region. The selected region name will be adjusted automatically when the BSP is generated to create the 'interrupt_stack' memory region. - Only used if hal.linker.enable_interrupt_stack is true. - false - common - - - hal.stdin - NONE - UnquotedString - jtag_uart - none - system_h_define - Slave descriptor of STDIN character-mode device. This setting is used by the ALT_STDIN family of defines in system.h. - none - false - common - - - hal.stdout - NONE - UnquotedString - jtag_uart - none - system_h_define - Slave descriptor of STDOUT character-mode device. This setting is used by the ALT_STDOUT family of defines in system.h. - none - false - common - - - hal.stderr - NONE - UnquotedString - jtag_uart - none - system_h_define - Slave descriptor of STDERR character-mode device. This setting is used by the ALT_STDERR family of defines in system.h. - none - false - common - - - hal.log_port - NONE - UnquotedString - none - none - public_mk_define - Slave descriptor of debug logging character-mode device. If defined, it enables extra debug messages in the HAL source. This setting is used by the ALT_LOG_PORT family of defines in system.h. - none - false - none - - - hal.make.build_pre_process - BUILD_PRE_PROCESS - UnquotedString - none - none - makefile_variable - Command executed before BSP built. - none - false - none - - - hal.make.ar_pre_process - AR_PRE_PROCESS - UnquotedString - none - none - makefile_variable - Command executed before archiver execution. - none - false - none - - - hal.make.bsp_cflags_defined_symbols - BSP_CFLAGS_DEFINED_SYMBOLS - UnquotedString - none - none - makefile_variable - Preprocessor macros to define. A macro definition in this setting has the same effect as a "#define" in source code. Adding "-DALT_DEBUG" to this setting has the same effect as "#define ALT_DEBUG" in a souce file. Adding "-DFOO=1" to this setting is equivalent to the macro "#define FOO 1" in a source file. Macros defined with this setting are applied to all .S, .c, and C++ files in the BSP. This setting defines the value of BSP_CFLAGS_DEFINED_SYMBOLS in the BSP Makefile. - none - false - none - - - hal.make.ar_post_process - AR_POST_PROCESS - UnquotedString - none - none - makefile_variable - Command executed after archiver execution. - none - false - none - - - hal.make.as - AS - UnquotedString - nios2-elf-gcc - nios2-elf-gcc - makefile_variable - Assembler command. Note that CC is used for .S files. - none - false - none - - - hal.make.build_post_process - BUILD_POST_PROCESS - UnquotedString - none - none - makefile_variable - Command executed after BSP built. - none - false - none - - - hal.make.bsp_cflags_debug - BSP_CFLAGS_DEBUG - UnquotedString - -g - -g - makefile_variable - C/C++ compiler debug level. '-g' provides the default set of debug symbols typically required to debug a typical application. Omitting '-g' removes debug symbols from the ELF. This setting defines the value of BSP_CFLAGS_DEBUG in Makefile. - none - false - common - - - hal.make.ar - AR - UnquotedString - nios2-elf-ar - nios2-elf-ar - makefile_variable - Archiver command. Creates library files. - none - false - none - - - hal.make.rm - RM - UnquotedString - rm -f - rm -f - makefile_variable - Command used to remove files during 'clean' target. - none - false - none - - - hal.make.cxx_pre_process - CXX_PRE_PROCESS - UnquotedString - none - none - makefile_variable - Command executed before each C++ file is compiled. - none - false - none - - - hal.make.bsp_cflags_warnings - BSP_CFLAGS_WARNINGS - UnquotedString - -Wall - -Wall - makefile_variable - C/C++ compiler warning level. "-Wall" is commonly used.This setting defines the value of BSP_CFLAGS_WARNINGS in Makefile. - none - false - none - - - hal.make.bsp_arflags - BSP_ARFLAGS - UnquotedString - -src - -src - makefile_variable - Custom flags only passed to the archiver. This content of this variable is directly passed to the archiver rather than the more standard "ARFLAGS". The reason for this is that GNU Make assumes some default content in ARFLAGS. This setting defines the value of BSP_ARFLAGS in Makefile. - none - false - none - - - hal.make.bsp_cflags_optimization - BSP_CFLAGS_OPTIMIZATION - UnquotedString - '-Os' - -O0 - makefile_variable - C/C++ compiler optimization level. "-O0" = no optimization,"-O2" = "normal" optimization, etc. "-O0" is recommended for code that you want to debug since compiler optimization can remove variables and produce non-sequential execution of code while debugging. This setting defines the value of BSP_CFLAGS_OPTIMIZATION in Makefile. - none - false - common - - - hal.make.as_post_process - AS_POST_PROCESS - UnquotedString - none - none - makefile_variable - Command executed after each assembly file is compiled. - none - false - none - - - hal.make.cc_pre_process - CC_PRE_PROCESS - UnquotedString - none - none - makefile_variable - Command executed before each .c/.S file is compiled. - none - false - none - - - hal.make.bsp_asflags - BSP_ASFLAGS - UnquotedString - -Wa,-gdwarf2 - -Wa,-gdwarf2 - makefile_variable - Custom flags only passed to the assembler. This setting defines the value of BSP_ASFLAGS in Makefile. - none - false - none - - - hal.make.as_pre_process - AS_PRE_PROCESS - UnquotedString - none - none - makefile_variable - Command executed before each assembly file is compiled. - none - false - none - - - hal.make.bsp_cflags_undefined_symbols - BSP_CFLAGS_UNDEFINED_SYMBOLS - UnquotedString - none - none - makefile_variable - Preprocessor macros to undefine. Undefined macros are similar to defined macros, but replicate the "#undef" directive in source code. To undefine the macro FOO use the syntax "-u FOO" in this setting. This is equivalent to "#undef FOO" in a source file. Note: the syntax differs from macro definition (there is a space, i.e. "-u FOO" versus "-DFOO"). Macros defined with this setting are applied to all .S, .c, and C++ files in the BSP. This setting defines the value of BSP_CFLAGS_UNDEFINED_SYMBOLS in the BSP Makefile. - none - false - none - - - hal.make.cc_post_process - CC_POST_PROCESS - UnquotedString - none - none - makefile_variable - Command executed after each .c/.S file is compiled. - none - false - none - - - hal.make.cxx_post_process - CXX_POST_PROCESS - UnquotedString - none - none - makefile_variable - Command executed before each C++ file is compiled. - none - false - none - - - hal.make.cc - CC - UnquotedString - nios2-elf-gcc -xc - nios2-elf-gcc -xc - makefile_variable - C compiler command. - none - false - none - - - hal.make.bsp_cxx_flags - BSP_CXXFLAGS - UnquotedString - none - none - makefile_variable - Custom flags only passed to the C++ compiler. This setting defines the value of BSP_CXXFLAGS in Makefile. - none - false - none - - - hal.make.bsp_inc_dirs - BSP_INC_DIRS - UnquotedString - none - none - makefile_variable - Space separated list of extra include directories to scan for header files. Directories are relative to the top-level BSP directory. The -I prefix's added by the makefile so don't add it here. This setting defines the value of BSP_INC_DIRS in Makefile. - none - false - none - - - hal.make.cxx - CXX - UnquotedString - nios2-elf-gcc -xc++ - nios2-elf-gcc -xc++ - makefile_variable - C++ compiler command. - none - false - none - - - hal.make.bsp_cflags_user_flags - BSP_CFLAGS_USER_FLAGS - UnquotedString - none - none - makefile_variable - Custom flags passed to the compiler when compiling C, C++, and .S files. This setting defines the value of BSP_CFLAGS_USER_FLAGS in Makefile. - none - false - none - - - hal.make.ignore_system_derived.sopc_system_id - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query SOPC system for system ID. If true ignores export of 'SOPC_SYSID_FLAG += --id=<sysid>' and 'ELF_PATCH_FLAG += --id=<sysid>' to public.mk. - none - false - none - - - hal.make.ignore_system_derived.sopc_system_timestamp - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query SOPC system for system timestamp. If true ignores export of 'SOPC_SYSID_FLAG += --timestamp=<timestamp>' and 'ELF_PATCH_FLAG += --timestamp=<timestamp>' to public.mk. - none - false - none - - - hal.make.ignore_system_derived.sopc_system_base_address - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query SOPC system for system ID base address. If true ignores export of 'SOPC_SYSID_FLAG += --sidp=<address>' and 'ELF_PATCH_FLAG += --sidp=<address>' to public.mk. - none - false - none - - - hal.make.ignore_system_derived.sopc_simulation_enabled - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system has simulation enabled. If true ignores export of 'ELF_PATCH_FLAG += --simulation_enabled' to public.mk. - none - false - none - - - hal.make.ignore_system_derived.fpu_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system has FPU present. If true ignores export of 'ALT_CFLAGS += -mhard-float' to public.mk if FPU is found in the system. If true ignores export of 'ALT_CFLAGS += -mhard-soft' if FPU is not found in the system. - none - false - none - - - hal.make.ignore_system_derived.hardware_multiplier_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system has multiplier present. If true ignores export of 'ALT_CFLAGS += -mno-hw-mul' to public.mk if no multiplier is found in the system. If true ignores export of 'ALT_CFLAGS += -mhw-mul' if multiplier is found in the system. - none - false - none - - - hal.make.ignore_system_derived.hardware_mulx_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system has hardware mulx present. If true ignores export of 'ALT_CFLAGS += -mno-hw-mulx' to public.mk if no mulx is found in the system. If true ignores export of 'ALT_CFLAGS += -mhw-mulx' if mulx is found in the system. - none - false - none - - - hal.make.ignore_system_derived.hardware_divide_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system has hardware divide present. If true ignores export of 'ALT_CFLAGS += -mno-hw-div' to public.mk if no division is found in system. If true ignores export of 'ALT_CFLAGS += -mhw-div' if division is found in the system. - none - false - none - - - hal.make.ignore_system_derived.debug_core_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system has a debug core present. If true ignores export of 'CPU_HAS_DEBUG_CORE = 1' to public.mk if a debug core is found in the system. If true ignores export of 'CPU_HAS_DEBUG_CORE = 0' if no debug core is found in the system. - none - false - none - - - hal.make.ignore_system_derived.big_endian - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system is big endian. If true ignores export of 'ALT_CFLAGS += -EB' to public.mk if big endian system. If true ignores export of 'ALT_CFLAGS += -EL' if little endian system. - none - false - none - - - hal.make.ignore_system_derived.hardware_fp_cust_inst_divider_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system floating point custom instruction with a divider is present. If true ignores export of 'ALT_CFLAGS += -mcustom-fpu-cfg=60-2' and 'ALT_LDFLAGS += -mcustom-fpu-cfg=60-2' to public.mk if the custom instruction is found in the system. - none - false - none - - - hal.make.ignore_system_derived.hardware_fp_cust_inst_no_divider_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system floating point custom instruction without a divider is present. If true ignores export of 'ALT_CFLAGS += -mcustom-fpu-cfg=60-1' and 'ALT_LDFLAGS += -mcustom-fpu-cfg=60-1' to public.mk if the custom instruction is found in the system. - none - false - none - - - hal.enable_exit - ALT_NO_EXIT - Boolean - 0 - 1 - public_mk_define - Add exit() support. This option increases code footprint if your "main()" routine does "return" or call "exit()". If false, adds -DALT_NO_EXIT to ALT_CPPFLAGS in public.mk, and reduces footprint - none - false - none - - - hal.enable_small_c_library - NONE - Boolean - 1 - 0 - public_mk_define - Causes the small newlib (C library) to be used. This reduces code and data footprint at the expense of reduced functionality. Several newlib features are removed such as floating-point support in printf(), stdin input routines, and buffered I/O. The small C library is not compatible with Micrium MicroC/OS-II. If true, adds -msmallc to ALT_LDFLAGS in public.mk. - none - false - common - - - hal.enable_clean_exit - ALT_NO_CLEAN_EXIT - Boolean - 0 - 1 - public_mk_define - When your application exits, close file descriptors, call C++ destructors, etc. Code footprint can be reduced by disabling clean exit. If disabled, adds -DALT_NO_CLEAN_EXIT to ALT_CPPFLAGS and -Wl,--defsym, exit=_exit to ALT_LDFLAGS in public.mk. - none - false - none - - - hal.enable_runtime_stack_checking - ALT_STACK_CHECK - Boolean - 0 - 0 - public_mk_define - Turns on HAL runtime stack checking feature. Enabling this setting causes additional code to be placed into each subroutine call to generate an exception if a stack collision occurs with the heap or statically allocated data. If true, adds -DALT_STACK_CHECK and -mstack-check to ALT_CPPFLAGS in public.mk. - none - false - none - - - hal.enable_gprof - ALT_PROVIDE_GMON - Boolean - 0 - 0 - public_mk_define - Causes code to be compiled with gprof profiling enabled and the application ELF to be linked with the GPROF library. If true, adds -DALT_PROVIDE_GMON to ALT_CPPFLAGS and -pg to ALT_CFLAGS in public.mk. - none - false - common - - - hal.enable_c_plus_plus - ALT_NO_C_PLUS_PLUS - Boolean - 0 - 1 - public_mk_define - Enable support for a subset of the C++ language. This option increases code footprint by adding support for C++ constructors. Certain features, such as multiple inheritance and exceptions are not supported. If false, adds -DALT_NO_C_PLUS_PLUS to ALT_CPPFLAGS in public.mk, and reduces code footprint. - none - false - none - - - hal.enable_reduced_device_drivers - ALT_USE_SMALL_DRIVERS - Boolean - 1 - 0 - public_mk_define - Certain drivers are compiled with reduced functionality to reduce code footprint. Not all drivers observe this setting. The altera_avalon_uart and altera_avalon_jtag_uart drivers switch from interrupt-driven to polled operation. CAUTION: Several device drivers are disabled entirely. These include the altera_avalon_cfi_flash, altera_avalon_epcs_flash_controller, and altera_avalon_lcd_16207 drivers. This can result in certain API (HAL flash access routines) to fail. You can define a symbol provided by each driver to prevent it from being removed. If true, adds -DALT_USE_SMALL_DRIVERS to ALT_CPPFLAGS in public.mk. - none - false - common - - - hal.enable_lightweight_device_driver_api - ALT_USE_DIRECT_DRIVERS - Boolean - 1 - 0 - public_mk_define - Enables lightweight device driver API. This reduces code and data footprint by removing the HAL layer that maps device names (e.g. /dev/uart0) to file descriptors. Instead, driver routines are called directly. The open(), close(), and lseek() routines will always fail if called. The read(), write(), fstat(), ioctl(), and isatty() routines only work for the stdio devices. If true, adds -DALT_USE_DIRECT_DRIVERS to ALT_CPPFLAGS in public.mk. - The Altera Host and read-only ZIP file systems can't be used if hal.enable_lightweight_device_driver_api is true. - false - none - - - hal.enable_mul_div_emulation - ALT_NO_INSTRUCTION_EMULATION - Boolean - 0 - 0 - public_mk_define - Adds code to emulate multiply and divide instructions in case they are executed but aren't present in the CPU. Normally this isn't required because the compiler won't use multiply and divide instructions that aren't present in the CPU. If false, adds -DALT_NO_INSTRUCTION_EMULATION to ALT_CPPFLAGS in public.mk. - none - false - none - - - hal.enable_sim_optimize - ALT_SIM_OPTIMIZE - Boolean - 0 - 0 - public_mk_define - The BSP is compiled with optimizations to speedup HDL simulation such as initializing the cache, clearing the .bss section, and skipping long delay loops. If true, adds -DALT_SIM_OPTIMIZE to ALT_CPPFLAGS in public.mk. - When this setting is true, the BSP shouldn't be used to build applications that are expected to run real hardware. - false - common - - - hal.enable_sopc_sysid_check - NONE - Boolean - 1 - 1 - public_mk_define - Enable SOPC Builder System ID. If a System ID SOPC Builder component is connected to the CPU associated with this BSP, it will be enabled in the creation of command-line arguments to download an ELF to the target. Otherwise, system ID and timestamp values are left out of public.mk for application Makefile "download-elf" target definition. With the system ID check disabled, the Nios II EDS tools will not automatically ensure that the application .elf file (and BSP it is linked against) corresponds to the hardware design on the target. If false, adds --accept-bad-sysid to SOPC_SYSID_FLAG in public.mk. - none - false - none - - - hal.custom_newlib_flags - CUSTOM_NEWLIB_FLAGS - UnquotedString - none - none - public_mk_define - Build a custom version of newlib with the specified space-separated compiler flags. - The custom newlib build will be placed in the &lt;bsp root>/newlib directory, and will be used only for applications that utilize this BSP. - false - none - - - hal.log_flags - ALT_LOG_FLAGS - DecimalNumber - 0 - 0 - public_mk_define - The value is assigned to ALT_LOG_FLAGS in the generated public.mk. See hal.log_port setting description. Values can be -1 through 3. - hal.log_port must be set for this to be used. - false - none - - - altera_avalon_jtag_uart_driver.enable_small_driver - ALTERA_AVALON_JTAG_UART_SMALL - BooleanDefineOnly - false - false - public_mk_define - Small-footprint (polled mode) driver - none - false - - - - altera_avalon_jtag_uart_driver.enable_jtag_uart_ignore_fifo_full_error - ALTERA_AVALON_JTAG_UART_IGNORE_FIFO_FULL_ERROR - BooleanDefineOnly - false - false - public_mk_define - Enable JTAG UART driver to recover when host is inactive causing buffer to full without returning error. Printf will not fail with this recovery. - none - false - - - - onchip_memory - 0x00000000 - 0x00003FFF - 16384 - memory - - - lcd_on - 0x00004010 - 0x0000401F - 16 - - - - lcd_blon - 0x00004020 - 0x0000402F - 16 - - - - lcd_16207_0 - 0x00004030 - 0x0000403F - 16 - printable - - - hex7 - 0x00005000 - 0x0000500F - 16 - - - - hex6 - 0x00005010 - 0x0000501F - 16 - - - - hex5 - 0x00005020 - 0x0000502F - 16 - - - - hex4 - 0x00005030 - 0x0000503F - 16 - - - - hex3 - 0x00005040 - 0x0000504F - 16 - - - - hex2 - 0x00005050 - 0x0000505F - 16 - - - - hex1 - 0x00005060 - 0x0000506F - 16 - - - - hex0 - 0x00005070 - 0x0000507F - 16 - - - - push_switches - 0x00005080 - 0x0000508F - 16 - - - - switches - 0x00005090 - 0x0000509F - 16 - - - - LEDRs - 0x000050A0 - 0x000050AF - 16 - - - - LEDs - 0x000050B0 - 0x000050BF - 16 - - - - jtag_uart - 0x000050C0 - 0x000050C7 - 8 - printable - - - .text - onchip_memory - - - .rodata - onchip_memory - - - .rwdata - onchip_memory - - - .bss - onchip_memory - - - .heap - onchip_memory - - - .stack - onchip_memory - - \ No newline at end of file diff --git a/software/qsys_tutorial_lcd2_bsp/summary.html b/software/qsys_tutorial_lcd2_bsp/summary.html deleted file mode 100644 index 847f3f6..0000000 --- a/software/qsys_tutorial_lcd2_bsp/summary.html +++ /dev/null @@ -1,2047 +0,0 @@ - -Altera Nios II BSP Summary - -

BSP Description

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
BSP Type:hal
SOPC Design File:C:\Users\takayun\Documents\DE2-115\qsys_tutorial\nios_system.sopcinfo
Quartus JDI File:default
CPU:nios2_processor
BSP Settings File:.\settings.bsp
BSP Version:default
BSP Generated On:2016/12/02 0:00:36
BSP Generated Timestamp:1480604436216
BSP Generated Location:C:\Users\takayun\Documents\DE2-115\qsys_tutorial\software\qsys_tutorial_lcd2_bsp
-
-

Nios II Memory Map

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Slave DescriptorAddress RangeSizeAttributes
jtag_uart0x000050C0 - 0x000050C78printable
LEDs0x000050B0 - 0x000050BF16 
LEDRs0x000050A0 - 0x000050AF16 
switches0x00005090 - 0x0000509F16 
push_switches0x00005080 - 0x0000508F16 
hex00x00005070 - 0x0000507F16 
hex10x00005060 - 0x0000506F16 
hex20x00005050 - 0x0000505F16 
hex30x00005040 - 0x0000504F16 
hex40x00005030 - 0x0000503F16 
hex50x00005020 - 0x0000502F16 
hex60x00005010 - 0x0000501F16 
hex70x00005000 - 0x0000500F16 
lcd_16207_00x00004030 - 0x0000403F16printable
lcd_blon0x00004020 - 0x0000402F16 
lcd_on0x00004010 - 0x0000401F16 
onchip_memory0x00000000 - 0x00003FFF16384memory
-
-
-

Linker Regions

- - - - -
RegionAddress RangeSizeMemoryOffset
-
-
-

Linker Section Mappings

- - - - - - - - - - - - - - - - - - - - - - -
SectionRegion
.textonchip_memory
.rodataonchip_memory
.rwdataonchip_memory
.bssonchip_memory
.heaponchip_memory
.stackonchip_memory
-

Settings

- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:altera_avalon_jtag_uart_driver.enable_jtag_uart_ignore_fifo_full_error
Identifier:ALTERA_AVALON_JTAG_UART_IGNORE_FIFO_FULL_ERROR
Default Value:false
Value:false
Type:BooleanDefineOnly
Destination:public_mk_define
Description:Enable JTAG UART driver to recover when host is inactive causing buffer to full without returning error. Printf will not fail with this recovery.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:altera_avalon_jtag_uart_driver.enable_small_driver
Identifier:ALTERA_AVALON_JTAG_UART_SMALL
Default Value:false
Value:false
Type:BooleanDefineOnly
Destination:public_mk_define
Description:Small-footprint (polled mode) driver
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.custom_newlib_flags
Identifier:CUSTOM_NEWLIB_FLAGS
Default Value:none
Value:none
Type:UnquotedString
Destination:public_mk_define
Description:Build a custom version of newlib with the specified space-separated compiler flags.
Restrictions:The custom newlib build will be placed in the &lt;bsp root>/newlib directory, and will be used only for applications that utilize this BSP.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_c_plus_plus
Identifier:ALT_NO_C_PLUS_PLUS
Default Value:1
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable support for a subset of the C++ language. This option increases code footprint by adding support for C++ constructors. Certain features, such as multiple inheritance and exceptions are not supported. If false, adds -DALT_NO_C_PLUS_PLUS to ALT_CPPFLAGS in public.mk, and reduces code footprint.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_clean_exit
Identifier:ALT_NO_CLEAN_EXIT
Default Value:1
Value:0
Type:Boolean
Destination:public_mk_define
Description:When your application exits, close file descriptors, call C++ destructors, etc. Code footprint can be reduced by disabling clean exit. If disabled, adds -DALT_NO_CLEAN_EXIT to ALT_CPPFLAGS and -Wl,--defsym, exit=_exit to ALT_LDFLAGS in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_exit
Identifier:ALT_NO_EXIT
Default Value:1
Value:0
Type:Boolean
Destination:public_mk_define
Description:Add exit() support. This option increases code footprint if your "main()" routine does "return" or call "exit()". If false, adds -DALT_NO_EXIT to ALT_CPPFLAGS in public.mk, and reduces footprint
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_gprof
Identifier:ALT_PROVIDE_GMON
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Causes code to be compiled with gprof profiling enabled and the application ELF to be linked with the GPROF library. If true, adds -DALT_PROVIDE_GMON to ALT_CPPFLAGS and -pg to ALT_CFLAGS in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_instruction_related_exceptions_api
Identifier:ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API
Default Value:false
Value:false
Type:BooleanDefineOnly
Destination:system_h_define
Description:Enables API for registering handlers to service instruction-related exceptions. Enabling this setting increases the size of the exception entry code.
Restrictions:These exception types can be generated if various processor options are enabled, such as the MMU, MPU, or other advanced exception types.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_lightweight_device_driver_api
Identifier:ALT_USE_DIRECT_DRIVERS
Default Value:0
Value:1
Type:Boolean
Destination:public_mk_define
Description:Enables lightweight device driver API. This reduces code and data footprint by removing the HAL layer that maps device names (e.g. /dev/uart0) to file descriptors. Instead, driver routines are called directly. The open(), close(), and lseek() routines will always fail if called. The read(), write(), fstat(), ioctl(), and isatty() routines only work for the stdio devices. If true, adds -DALT_USE_DIRECT_DRIVERS to ALT_CPPFLAGS in public.mk.
Restrictions:The Altera Host and read-only ZIP file systems can't be used if hal.enable_lightweight_device_driver_api is true.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_mul_div_emulation
Identifier:ALT_NO_INSTRUCTION_EMULATION
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Adds code to emulate multiply and divide instructions in case they are executed but aren't present in the CPU. Normally this isn't required because the compiler won't use multiply and divide instructions that aren't present in the CPU. If false, adds -DALT_NO_INSTRUCTION_EMULATION to ALT_CPPFLAGS in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_reduced_device_drivers
Identifier:ALT_USE_SMALL_DRIVERS
Default Value:0
Value:1
Type:Boolean
Destination:public_mk_define
Description:Certain drivers are compiled with reduced functionality to reduce code footprint. Not all drivers observe this setting. The altera_avalon_uart and altera_avalon_jtag_uart drivers switch from interrupt-driven to polled operation. CAUTION: Several device drivers are disabled entirely. These include the altera_avalon_cfi_flash, altera_avalon_epcs_flash_controller, and altera_avalon_lcd_16207 drivers. This can result in certain API (HAL flash access routines) to fail. You can define a symbol provided by each driver to prevent it from being removed. If true, adds -DALT_USE_SMALL_DRIVERS to ALT_CPPFLAGS in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_runtime_stack_checking
Identifier:ALT_STACK_CHECK
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Turns on HAL runtime stack checking feature. Enabling this setting causes additional code to be placed into each subroutine call to generate an exception if a stack collision occurs with the heap or statically allocated data. If true, adds -DALT_STACK_CHECK and -mstack-check to ALT_CPPFLAGS in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_sim_optimize
Identifier:ALT_SIM_OPTIMIZE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:The BSP is compiled with optimizations to speedup HDL simulation such as initializing the cache, clearing the .bss section, and skipping long delay loops. If true, adds -DALT_SIM_OPTIMIZE to ALT_CPPFLAGS in public.mk.
Restrictions:When this setting is true, the BSP shouldn't be used to build applications that are expected to run real hardware.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_small_c_library
Identifier:NONE
Default Value:0
Value:1
Type:Boolean
Destination:public_mk_define
Description:Causes the small newlib (C library) to be used. This reduces code and data footprint at the expense of reduced functionality. Several newlib features are removed such as floating-point support in printf(), stdin input routines, and buffered I/O. The small C library is not compatible with Micrium MicroC/OS-II. If true, adds -msmallc to ALT_LDFLAGS in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_sopc_sysid_check
Identifier:NONE
Default Value:1
Value:1
Type:Boolean
Destination:public_mk_define
Description:Enable SOPC Builder System ID. If a System ID SOPC Builder component is connected to the CPU associated with this BSP, it will be enabled in the creation of command-line arguments to download an ELF to the target. Otherwise, system ID and timestamp values are left out of public.mk for application Makefile "download-elf" target definition. With the system ID check disabled, the Nios II EDS tools will not automatically ensure that the application .elf file (and BSP it is linked against) corresponds to the hardware design on the target. If false, adds --accept-bad-sysid to SOPC_SYSID_FLAG in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.allow_code_at_reset
Identifier:ALT_ALLOW_CODE_AT_RESET
Default Value:0
Value:1
Type:Boolean
Destination:none
Description:Indicates if initialization code is allowed at the reset address. If true, defines the macro ALT_ALLOW_CODE_AT_RESET in linker.h.
Restrictions:If true, defines the macro ALT_ALLOW_CODE_AT_RESET in linker.h. This setting is typically false if an external bootloader (e.g. flash bootloader) is present.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.enable_alt_load
Identifier:NONE
Default Value:0
Value:1
Type:Boolean
Destination:none
Description:Enables the alt_load() facility. The alt_load() facility copies sections from the .text memory into RAM. If true, this setting sets up the VMA/LMA of sections in linker.x to allow them to be loaded into the .text memory.
Restrictions:This setting is typically false if an external bootloader (e.g. flash bootloader) is present.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.enable_alt_load_copy_exceptions
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:none
Description:Causes the alt_load() facility to copy the .exceptions section. If true, this setting defines the macro ALT_LOAD_COPY_EXCEPTIONS in linker.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.enable_alt_load_copy_rodata
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:none
Description:Causes the alt_load() facility to copy the .rodata section. If true, this setting defines the macro ALT_LOAD_COPY_RODATA in linker.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.enable_alt_load_copy_rwdata
Identifier:NONE
Default Value:0
Value:1
Type:Boolean
Destination:none
Description:Causes the alt_load() facility to copy the .rwdata section. If true, this setting defines the macro ALT_LOAD_COPY_RWDATA in linker.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.enable_exception_stack
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:none
Description:Enables use of a separate exception stack. If true, defines the macro ALT_EXCEPTION_STACK in linker.h, adds a memory region called exception_stack to linker.x, and provides the symbols __alt_exception_stack_pointer and __alt_exception_stack_limit in linker.x.
Restrictions:The hal.linker.exception_stack_size and hal.linker.exception_stack_memory_region_name settings must also be valid. This setting must be false for MicroC/OS-II BSPs. The exception stack can be used to improve interrupt and other exception performance if the EIC is *not* used.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.enable_interrupt_stack
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:none
Description:Enables use of a separate interrupt stack. If true, defines the macro ALT_INTERRUPT_STACK in linker.h, adds a memory region called interrupt_stack to linker.x, and provides the symbols __alt_interrupt_stack_pointer and __alt_interrupt_stack_limit in linker.x.
Restrictions:The hal.linker.interrupt_stack_size and hal.linker.interrupt_stack_memory_region_name settings must also be valid. This setting must be false for MicroC/OS-II BSPs. Only enable if the EIC is used exclusively. The exception stack can be used to improve interrupt and other exception performance if the EIC is *not* used.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.exception_stack_memory_region_name
Identifier:NONE
Default Value:none
Value:onchip_memory
Type:UnquotedString
Destination:none
Description:Name of the existing memory region that will be divided up to create the 'exception_stack' memory region. The selected region name will be adjusted automatically when the BSP is generated to create the 'exception_stack' memory region.
Restrictions:Only used if hal.linker.enable_exception_stack is true.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.exception_stack_size
Identifier:NONE
Default Value:1024
Value:1024
Type:DecimalNumber
Destination:none
Description:Size of the exception stack in bytes.
Restrictions:Only used if hal.linker.enable_exception_stack is true.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.interrupt_stack_memory_region_name
Identifier:NONE
Default Value:none
Value:onchip_memory
Type:UnquotedString
Destination:none
Description:Name of the existing memory region that will be divided up to create the 'interrupt_stack' memory region. The selected region name will be adjusted automatically when the BSP is generated to create the 'interrupt_stack' memory region.
Restrictions:Only used if hal.linker.enable_interrupt_stack is true.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.interrupt_stack_size
Identifier:NONE
Default Value:1024
Value:1024
Type:DecimalNumber
Destination:none
Description:Size of the interrupt stack in bytes.
Restrictions:Only used if hal.linker.enable_interrupt_stack is true.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.log_flags
Identifier:ALT_LOG_FLAGS
Default Value:0
Value:0
Type:DecimalNumber
Destination:public_mk_define
Description:The value is assigned to ALT_LOG_FLAGS in the generated public.mk. See hal.log_port setting description. Values can be -1 through 3.
Restrictions:hal.log_port must be set for this to be used.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.log_port
Identifier:NONE
Default Value:none
Value:none
Type:UnquotedString
Destination:public_mk_define
Description:Slave descriptor of debug logging character-mode device. If defined, it enables extra debug messages in the HAL source. This setting is used by the ALT_LOG_PORT family of defines in system.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ar
Identifier:AR
Default Value:nios2-elf-ar
Value:nios2-elf-ar
Type:UnquotedString
Destination:makefile_variable
Description:Archiver command. Creates library files.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ar_post_process
Identifier:AR_POST_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed after archiver execution.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ar_pre_process
Identifier:AR_PRE_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed before archiver execution.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.as
Identifier:AS
Default Value:nios2-elf-gcc
Value:nios2-elf-gcc
Type:UnquotedString
Destination:makefile_variable
Description:Assembler command. Note that CC is used for .S files.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.as_post_process
Identifier:AS_POST_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed after each assembly file is compiled.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.as_pre_process
Identifier:AS_PRE_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed before each assembly file is compiled.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_arflags
Identifier:BSP_ARFLAGS
Default Value:-src
Value:-src
Type:UnquotedString
Destination:makefile_variable
Description:Custom flags only passed to the archiver. This content of this variable is directly passed to the archiver rather than the more standard "ARFLAGS". The reason for this is that GNU Make assumes some default content in ARFLAGS. This setting defines the value of BSP_ARFLAGS in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_asflags
Identifier:BSP_ASFLAGS
Default Value:-Wa,-gdwarf2
Value:-Wa,-gdwarf2
Type:UnquotedString
Destination:makefile_variable
Description:Custom flags only passed to the assembler. This setting defines the value of BSP_ASFLAGS in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cflags_debug
Identifier:BSP_CFLAGS_DEBUG
Default Value:-g
Value:-g
Type:UnquotedString
Destination:makefile_variable
Description:C/C++ compiler debug level. '-g' provides the default set of debug symbols typically required to debug a typical application. Omitting '-g' removes debug symbols from the ELF. This setting defines the value of BSP_CFLAGS_DEBUG in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cflags_defined_symbols
Identifier:BSP_CFLAGS_DEFINED_SYMBOLS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Preprocessor macros to define. A macro definition in this setting has the same effect as a "#define" in source code. Adding "-DALT_DEBUG" to this setting has the same effect as "#define ALT_DEBUG" in a souce file. Adding "-DFOO=1" to this setting is equivalent to the macro "#define FOO 1" in a source file. Macros defined with this setting are applied to all .S, .c, and C++ files in the BSP. This setting defines the value of BSP_CFLAGS_DEFINED_SYMBOLS in the BSP Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cflags_optimization
Identifier:BSP_CFLAGS_OPTIMIZATION
Default Value:-O0
Value:'-Os'
Type:UnquotedString
Destination:makefile_variable
Description:C/C++ compiler optimization level. "-O0" = no optimization,"-O2" = "normal" optimization, etc. "-O0" is recommended for code that you want to debug since compiler optimization can remove variables and produce non-sequential execution of code while debugging. This setting defines the value of BSP_CFLAGS_OPTIMIZATION in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cflags_undefined_symbols
Identifier:BSP_CFLAGS_UNDEFINED_SYMBOLS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Preprocessor macros to undefine. Undefined macros are similar to defined macros, but replicate the "#undef" directive in source code. To undefine the macro FOO use the syntax "-u FOO" in this setting. This is equivalent to "#undef FOO" in a source file. Note: the syntax differs from macro definition (there is a space, i.e. "-u FOO" versus "-DFOO"). Macros defined with this setting are applied to all .S, .c, and C++ files in the BSP. This setting defines the value of BSP_CFLAGS_UNDEFINED_SYMBOLS in the BSP Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cflags_user_flags
Identifier:BSP_CFLAGS_USER_FLAGS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Custom flags passed to the compiler when compiling C, C++, and .S files. This setting defines the value of BSP_CFLAGS_USER_FLAGS in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cflags_warnings
Identifier:BSP_CFLAGS_WARNINGS
Default Value:-Wall
Value:-Wall
Type:UnquotedString
Destination:makefile_variable
Description:C/C++ compiler warning level. "-Wall" is commonly used.This setting defines the value of BSP_CFLAGS_WARNINGS in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cxx_flags
Identifier:BSP_CXXFLAGS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Custom flags only passed to the C++ compiler. This setting defines the value of BSP_CXXFLAGS in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_inc_dirs
Identifier:BSP_INC_DIRS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Space separated list of extra include directories to scan for header files. Directories are relative to the top-level BSP directory. The -I prefix's added by the makefile so don't add it here. This setting defines the value of BSP_INC_DIRS in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.build_post_process
Identifier:BUILD_POST_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed after BSP built.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.build_pre_process
Identifier:BUILD_PRE_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed before BSP built.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.cc
Identifier:CC
Default Value:nios2-elf-gcc -xc
Value:nios2-elf-gcc -xc
Type:UnquotedString
Destination:makefile_variable
Description:C compiler command.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.cc_post_process
Identifier:CC_POST_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed after each .c/.S file is compiled.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.cc_pre_process
Identifier:CC_PRE_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed before each .c/.S file is compiled.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.cxx
Identifier:CXX
Default Value:nios2-elf-gcc -xc++
Value:nios2-elf-gcc -xc++
Type:UnquotedString
Destination:makefile_variable
Description:C++ compiler command.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.cxx_post_process
Identifier:CXX_POST_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed before each C++ file is compiled.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.cxx_pre_process
Identifier:CXX_PRE_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed before each C++ file is compiled.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.big_endian
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system is big endian. If true ignores export of 'ALT_CFLAGS += -EB' to public.mk if big endian system. If true ignores export of 'ALT_CFLAGS += -EL' if little endian system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.debug_core_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system has a debug core present. If true ignores export of 'CPU_HAS_DEBUG_CORE = 1' to public.mk if a debug core is found in the system. If true ignores export of 'CPU_HAS_DEBUG_CORE = 0' if no debug core is found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.fpu_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system has FPU present. If true ignores export of 'ALT_CFLAGS += -mhard-float' to public.mk if FPU is found in the system. If true ignores export of 'ALT_CFLAGS += -mhard-soft' if FPU is not found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.hardware_divide_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system has hardware divide present. If true ignores export of 'ALT_CFLAGS += -mno-hw-div' to public.mk if no division is found in system. If true ignores export of 'ALT_CFLAGS += -mhw-div' if division is found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.hardware_fp_cust_inst_divider_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system floating point custom instruction with a divider is present. If true ignores export of 'ALT_CFLAGS += -mcustom-fpu-cfg=60-2' and 'ALT_LDFLAGS += -mcustom-fpu-cfg=60-2' to public.mk if the custom instruction is found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.hardware_fp_cust_inst_no_divider_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system floating point custom instruction without a divider is present. If true ignores export of 'ALT_CFLAGS += -mcustom-fpu-cfg=60-1' and 'ALT_LDFLAGS += -mcustom-fpu-cfg=60-1' to public.mk if the custom instruction is found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.hardware_multiplier_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system has multiplier present. If true ignores export of 'ALT_CFLAGS += -mno-hw-mul' to public.mk if no multiplier is found in the system. If true ignores export of 'ALT_CFLAGS += -mhw-mul' if multiplier is found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.hardware_mulx_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system has hardware mulx present. If true ignores export of 'ALT_CFLAGS += -mno-hw-mulx' to public.mk if no mulx is found in the system. If true ignores export of 'ALT_CFLAGS += -mhw-mulx' if mulx is found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.sopc_simulation_enabled
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system has simulation enabled. If true ignores export of 'ELF_PATCH_FLAG += --simulation_enabled' to public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.sopc_system_base_address
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query SOPC system for system ID base address. If true ignores export of 'SOPC_SYSID_FLAG += --sidp=<address>' and 'ELF_PATCH_FLAG += --sidp=<address>' to public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.sopc_system_id
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query SOPC system for system ID. If true ignores export of 'SOPC_SYSID_FLAG += --id=<sysid>' and 'ELF_PATCH_FLAG += --id=<sysid>' to public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.sopc_system_timestamp
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query SOPC system for system timestamp. If true ignores export of 'SOPC_SYSID_FLAG += --timestamp=<timestamp>' and 'ELF_PATCH_FLAG += --timestamp=<timestamp>' to public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.rm
Identifier:RM
Default Value:rm -f
Value:rm -f
Type:UnquotedString
Destination:makefile_variable
Description:Command used to remove files during 'clean' target.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.max_file_descriptors
Identifier:ALT_MAX_FD
Default Value:32
Value:4
Type:DecimalNumber
Destination:system_h_define
Description:Determines the number of file descriptors statically allocated. This setting defines the value of ALT_MAX_FD in system.h.
Restrictions:If hal.enable_lightweight_device_driver_api is true, there are no file descriptors so this setting is ignored. If hal.enable_lightweight_device_driver_api is false, this setting must be at least 4 because HAL needs a file descriptor for /dev/null, /dev/stdin, /dev/stdout, and /dev/stderr.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.stderr
Identifier:NONE
Default Value:none
Value:jtag_uart
Type:UnquotedString
Destination:system_h_define
Description:Slave descriptor of STDERR character-mode device. This setting is used by the ALT_STDERR family of defines in system.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.stdin
Identifier:NONE
Default Value:none
Value:jtag_uart
Type:UnquotedString
Destination:system_h_define
Description:Slave descriptor of STDIN character-mode device. This setting is used by the ALT_STDIN family of defines in system.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.stdout
Identifier:NONE
Default Value:none
Value:jtag_uart
Type:UnquotedString
Destination:system_h_define
Description:Slave descriptor of STDOUT character-mode device. This setting is used by the ALT_STDOUT family of defines in system.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.sys_clk_timer
Identifier:ALT_SYS_CLK
Default Value:none
Value:none
Type:UnquotedString
Destination:system_h_define
Description:Slave descriptor of the system clock timer device. This device provides a periodic interrupt ("tick") and is typically required for RTOS use. This setting defines the value of ALT_SYS_CLK in system.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.timestamp_timer
Identifier:ALT_TIMESTAMP_CLK
Default Value:none
Value:none
Type:UnquotedString
Destination:system_h_define
Description:Slave descriptor of timestamp timer device. This device is used by Altera HAL timestamp drivers for high-resolution time measurement. This setting defines the value of ALT_TIMESTAMP_CLK in system.h.
Restrictions:none
-
-
-
- - diff --git a/software/qsys_tutorial_lcd2_bsp/system.h b/software/qsys_tutorial_lcd2_bsp/system.h deleted file mode 100644 index 60a31a3..0000000 --- a/software/qsys_tutorial_lcd2_bsp/system.h +++ /dev/null @@ -1,617 +0,0 @@ -/* - * system.h - SOPC Builder system and BSP software package information - * - * Machine generated for CPU 'nios2_processor' in SOPC Builder design 'nios_system' - * SOPC Builder design path: C:/Users/takayun/Documents/DE2-115/qsys_tutorial/nios_system.sopcinfo - * - * Generated: Fri Dec 02 00:00:37 JST 2016 - */ - -/* - * DO NOT MODIFY THIS FILE - * - * Changing this file will have subtle consequences - * which will almost certainly lead to a nonfunctioning - * system. If you do modify this file, be aware that your - * changes will be overwritten and lost when this file - * is generated again. - * - * DO NOT MODIFY THIS FILE - */ - -/* - * License Agreement - * - * Copyright (c) 2008 - * Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - * - * This agreement shall be governed in all respects by the laws of the State - * of California and by the laws of the United States of America. - */ - -#ifndef __SYSTEM_H_ -#define __SYSTEM_H_ - -/* Include definitions from linker script generator */ -#include "linker.h" - - -/* - * CPU configuration - * - */ - -#define ALT_CPU_ARCHITECTURE "altera_nios2_qsys" -#define ALT_CPU_BIG_ENDIAN 0 -#define ALT_CPU_BREAK_ADDR 0x4820 -#define ALT_CPU_CPU_FREQ 50000000u -#define ALT_CPU_CPU_ID_SIZE 1 -#define ALT_CPU_CPU_ID_VALUE 0x00000000 -#define ALT_CPU_CPU_IMPLEMENTATION "tiny" -#define ALT_CPU_DATA_ADDR_WIDTH 0xf -#define ALT_CPU_DCACHE_LINE_SIZE 0 -#define ALT_CPU_DCACHE_LINE_SIZE_LOG2 0 -#define ALT_CPU_DCACHE_SIZE 0 -#define ALT_CPU_EXCEPTION_ADDR 0x20 -#define ALT_CPU_FLUSHDA_SUPPORTED -#define ALT_CPU_FREQ 50000000 -#define ALT_CPU_HARDWARE_DIVIDE_PRESENT 0 -#define ALT_CPU_HARDWARE_MULTIPLY_PRESENT 0 -#define ALT_CPU_HARDWARE_MULX_PRESENT 0 -#define ALT_CPU_HAS_DEBUG_CORE 1 -#define ALT_CPU_HAS_DEBUG_STUB -#define ALT_CPU_HAS_JMPI_INSTRUCTION -#define ALT_CPU_ICACHE_LINE_SIZE 0 -#define ALT_CPU_ICACHE_LINE_SIZE_LOG2 0 -#define ALT_CPU_ICACHE_SIZE 0 -#define ALT_CPU_INST_ADDR_WIDTH 0xf -#define ALT_CPU_NAME "nios2_processor" -#define ALT_CPU_RESET_ADDR 0x0 - - -/* - * CPU configuration (with legacy prefix - don't use these anymore) - * - */ - -#define NIOS2_BIG_ENDIAN 0 -#define NIOS2_BREAK_ADDR 0x4820 -#define NIOS2_CPU_FREQ 50000000u -#define NIOS2_CPU_ID_SIZE 1 -#define NIOS2_CPU_ID_VALUE 0x00000000 -#define NIOS2_CPU_IMPLEMENTATION "tiny" -#define NIOS2_DATA_ADDR_WIDTH 0xf -#define NIOS2_DCACHE_LINE_SIZE 0 -#define NIOS2_DCACHE_LINE_SIZE_LOG2 0 -#define NIOS2_DCACHE_SIZE 0 -#define NIOS2_EXCEPTION_ADDR 0x20 -#define NIOS2_FLUSHDA_SUPPORTED -#define NIOS2_HARDWARE_DIVIDE_PRESENT 0 -#define NIOS2_HARDWARE_MULTIPLY_PRESENT 0 -#define NIOS2_HARDWARE_MULX_PRESENT 0 -#define NIOS2_HAS_DEBUG_CORE 1 -#define NIOS2_HAS_DEBUG_STUB -#define NIOS2_HAS_JMPI_INSTRUCTION -#define NIOS2_ICACHE_LINE_SIZE 0 -#define NIOS2_ICACHE_LINE_SIZE_LOG2 0 -#define NIOS2_ICACHE_SIZE 0 -#define NIOS2_INST_ADDR_WIDTH 0xf -#define NIOS2_RESET_ADDR 0x0 - - -/* - * Define for each module class mastered by the CPU - * - */ - -#define __ALTERA_AVALON_JTAG_UART -#define __ALTERA_AVALON_LCD_16207 -#define __ALTERA_AVALON_ONCHIP_MEMORY2 -#define __ALTERA_AVALON_PIO -#define __ALTERA_NIOS2_QSYS - - -/* - * LEDRs configuration - * - */ - -#define ALT_MODULE_CLASS_LEDRs altera_avalon_pio -#define LEDRS_BASE 0x50a0 -#define LEDRS_BIT_CLEARING_EDGE_REGISTER 0 -#define LEDRS_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define LEDRS_CAPTURE 0 -#define LEDRS_DATA_WIDTH 18 -#define LEDRS_DO_TEST_BENCH_WIRING 0 -#define LEDRS_DRIVEN_SIM_VALUE 0 -#define LEDRS_EDGE_TYPE "NONE" -#define LEDRS_FREQ 50000000 -#define LEDRS_HAS_IN 0 -#define LEDRS_HAS_OUT 1 -#define LEDRS_HAS_TRI 0 -#define LEDRS_IRQ -1 -#define LEDRS_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define LEDRS_IRQ_TYPE "NONE" -#define LEDRS_NAME "/dev/LEDRs" -#define LEDRS_RESET_VALUE 0 -#define LEDRS_SPAN 16 -#define LEDRS_TYPE "altera_avalon_pio" - - -/* - * LEDs configuration - * - */ - -#define ALT_MODULE_CLASS_LEDs altera_avalon_pio -#define LEDS_BASE 0x50b0 -#define LEDS_BIT_CLEARING_EDGE_REGISTER 0 -#define LEDS_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define LEDS_CAPTURE 0 -#define LEDS_DATA_WIDTH 8 -#define LEDS_DO_TEST_BENCH_WIRING 0 -#define LEDS_DRIVEN_SIM_VALUE 0 -#define LEDS_EDGE_TYPE "NONE" -#define LEDS_FREQ 50000000 -#define LEDS_HAS_IN 0 -#define LEDS_HAS_OUT 1 -#define LEDS_HAS_TRI 0 -#define LEDS_IRQ -1 -#define LEDS_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define LEDS_IRQ_TYPE "NONE" -#define LEDS_NAME "/dev/LEDs" -#define LEDS_RESET_VALUE 0 -#define LEDS_SPAN 16 -#define LEDS_TYPE "altera_avalon_pio" - - -/* - * System configuration - * - */ - -#define ALT_DEVICE_FAMILY "Cyclone IV E" -#define ALT_ENHANCED_INTERRUPT_API_PRESENT -#define ALT_IRQ_BASE NULL -#define ALT_LOG_PORT "/dev/null" -#define ALT_LOG_PORT_BASE 0x0 -#define ALT_LOG_PORT_DEV null -#define ALT_LOG_PORT_TYPE "" -#define ALT_NUM_EXTERNAL_INTERRUPT_CONTROLLERS 0 -#define ALT_NUM_INTERNAL_INTERRUPT_CONTROLLERS 1 -#define ALT_NUM_INTERRUPT_CONTROLLERS 1 -#define ALT_STDERR "/dev/jtag_uart" -#define ALT_STDERR_BASE 0x50c0 -#define ALT_STDERR_DEV jtag_uart -#define ALT_STDERR_IS_JTAG_UART -#define ALT_STDERR_PRESENT -#define ALT_STDERR_TYPE "altera_avalon_jtag_uart" -#define ALT_STDIN "/dev/jtag_uart" -#define ALT_STDIN_BASE 0x50c0 -#define ALT_STDIN_DEV jtag_uart -#define ALT_STDIN_IS_JTAG_UART -#define ALT_STDIN_PRESENT -#define ALT_STDIN_TYPE "altera_avalon_jtag_uart" -#define ALT_STDOUT "/dev/jtag_uart" -#define ALT_STDOUT_BASE 0x50c0 -#define ALT_STDOUT_DEV jtag_uart -#define ALT_STDOUT_IS_JTAG_UART -#define ALT_STDOUT_PRESENT -#define ALT_STDOUT_TYPE "altera_avalon_jtag_uart" -#define ALT_SYSTEM_NAME "nios_system" - - -/* - * hal configuration - * - */ - -#define ALT_MAX_FD 4 -#define ALT_SYS_CLK none -#define ALT_TIMESTAMP_CLK none - - -/* - * hex0 configuration - * - */ - -#define ALT_MODULE_CLASS_hex0 altera_avalon_pio -#define HEX0_BASE 0x5070 -#define HEX0_BIT_CLEARING_EDGE_REGISTER 0 -#define HEX0_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define HEX0_CAPTURE 0 -#define HEX0_DATA_WIDTH 7 -#define HEX0_DO_TEST_BENCH_WIRING 0 -#define HEX0_DRIVEN_SIM_VALUE 0 -#define HEX0_EDGE_TYPE "NONE" -#define HEX0_FREQ 50000000 -#define HEX0_HAS_IN 0 -#define HEX0_HAS_OUT 1 -#define HEX0_HAS_TRI 0 -#define HEX0_IRQ -1 -#define HEX0_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define HEX0_IRQ_TYPE "NONE" -#define HEX0_NAME "/dev/hex0" -#define HEX0_RESET_VALUE 0 -#define HEX0_SPAN 16 -#define HEX0_TYPE "altera_avalon_pio" - - -/* - * hex1 configuration - * - */ - -#define ALT_MODULE_CLASS_hex1 altera_avalon_pio -#define HEX1_BASE 0x5060 -#define HEX1_BIT_CLEARING_EDGE_REGISTER 0 -#define HEX1_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define HEX1_CAPTURE 0 -#define HEX1_DATA_WIDTH 7 -#define HEX1_DO_TEST_BENCH_WIRING 0 -#define HEX1_DRIVEN_SIM_VALUE 0 -#define HEX1_EDGE_TYPE "NONE" -#define HEX1_FREQ 50000000 -#define HEX1_HAS_IN 0 -#define HEX1_HAS_OUT 1 -#define HEX1_HAS_TRI 0 -#define HEX1_IRQ -1 -#define HEX1_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define HEX1_IRQ_TYPE "NONE" -#define HEX1_NAME "/dev/hex1" -#define HEX1_RESET_VALUE 0 -#define HEX1_SPAN 16 -#define HEX1_TYPE "altera_avalon_pio" - - -/* - * hex2 configuration - * - */ - -#define ALT_MODULE_CLASS_hex2 altera_avalon_pio -#define HEX2_BASE 0x5050 -#define HEX2_BIT_CLEARING_EDGE_REGISTER 0 -#define HEX2_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define HEX2_CAPTURE 0 -#define HEX2_DATA_WIDTH 7 -#define HEX2_DO_TEST_BENCH_WIRING 0 -#define HEX2_DRIVEN_SIM_VALUE 0 -#define HEX2_EDGE_TYPE "NONE" -#define HEX2_FREQ 50000000 -#define HEX2_HAS_IN 0 -#define HEX2_HAS_OUT 1 -#define HEX2_HAS_TRI 0 -#define HEX2_IRQ -1 -#define HEX2_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define HEX2_IRQ_TYPE "NONE" -#define HEX2_NAME "/dev/hex2" -#define HEX2_RESET_VALUE 0 -#define HEX2_SPAN 16 -#define HEX2_TYPE "altera_avalon_pio" - - -/* - * hex3 configuration - * - */ - -#define ALT_MODULE_CLASS_hex3 altera_avalon_pio -#define HEX3_BASE 0x5040 -#define HEX3_BIT_CLEARING_EDGE_REGISTER 0 -#define HEX3_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define HEX3_CAPTURE 0 -#define HEX3_DATA_WIDTH 7 -#define HEX3_DO_TEST_BENCH_WIRING 0 -#define HEX3_DRIVEN_SIM_VALUE 0 -#define HEX3_EDGE_TYPE "NONE" -#define HEX3_FREQ 50000000 -#define HEX3_HAS_IN 0 -#define HEX3_HAS_OUT 1 -#define HEX3_HAS_TRI 0 -#define HEX3_IRQ -1 -#define HEX3_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define HEX3_IRQ_TYPE "NONE" -#define HEX3_NAME "/dev/hex3" -#define HEX3_RESET_VALUE 0 -#define HEX3_SPAN 16 -#define HEX3_TYPE "altera_avalon_pio" - - -/* - * hex4 configuration - * - */ - -#define ALT_MODULE_CLASS_hex4 altera_avalon_pio -#define HEX4_BASE 0x5030 -#define HEX4_BIT_CLEARING_EDGE_REGISTER 0 -#define HEX4_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define HEX4_CAPTURE 0 -#define HEX4_DATA_WIDTH 7 -#define HEX4_DO_TEST_BENCH_WIRING 0 -#define HEX4_DRIVEN_SIM_VALUE 0 -#define HEX4_EDGE_TYPE "NONE" -#define HEX4_FREQ 50000000 -#define HEX4_HAS_IN 0 -#define HEX4_HAS_OUT 1 -#define HEX4_HAS_TRI 0 -#define HEX4_IRQ -1 -#define HEX4_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define HEX4_IRQ_TYPE "NONE" -#define HEX4_NAME "/dev/hex4" -#define HEX4_RESET_VALUE 0 -#define HEX4_SPAN 16 -#define HEX4_TYPE "altera_avalon_pio" - - -/* - * hex5 configuration - * - */ - -#define ALT_MODULE_CLASS_hex5 altera_avalon_pio -#define HEX5_BASE 0x5020 -#define HEX5_BIT_CLEARING_EDGE_REGISTER 0 -#define HEX5_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define HEX5_CAPTURE 0 -#define HEX5_DATA_WIDTH 7 -#define HEX5_DO_TEST_BENCH_WIRING 0 -#define HEX5_DRIVEN_SIM_VALUE 0 -#define HEX5_EDGE_TYPE "NONE" -#define HEX5_FREQ 50000000 -#define HEX5_HAS_IN 0 -#define HEX5_HAS_OUT 1 -#define HEX5_HAS_TRI 0 -#define HEX5_IRQ -1 -#define HEX5_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define HEX5_IRQ_TYPE "NONE" -#define HEX5_NAME "/dev/hex5" -#define HEX5_RESET_VALUE 0 -#define HEX5_SPAN 16 -#define HEX5_TYPE "altera_avalon_pio" - - -/* - * hex6 configuration - * - */ - -#define ALT_MODULE_CLASS_hex6 altera_avalon_pio -#define HEX6_BASE 0x5010 -#define HEX6_BIT_CLEARING_EDGE_REGISTER 0 -#define HEX6_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define HEX6_CAPTURE 0 -#define HEX6_DATA_WIDTH 7 -#define HEX6_DO_TEST_BENCH_WIRING 0 -#define HEX6_DRIVEN_SIM_VALUE 0 -#define HEX6_EDGE_TYPE "NONE" -#define HEX6_FREQ 50000000 -#define HEX6_HAS_IN 0 -#define HEX6_HAS_OUT 1 -#define HEX6_HAS_TRI 0 -#define HEX6_IRQ -1 -#define HEX6_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define HEX6_IRQ_TYPE "NONE" -#define HEX6_NAME "/dev/hex6" -#define HEX6_RESET_VALUE 0 -#define HEX6_SPAN 16 -#define HEX6_TYPE "altera_avalon_pio" - - -/* - * hex7 configuration - * - */ - -#define ALT_MODULE_CLASS_hex7 altera_avalon_pio -#define HEX7_BASE 0x5000 -#define HEX7_BIT_CLEARING_EDGE_REGISTER 0 -#define HEX7_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define HEX7_CAPTURE 0 -#define HEX7_DATA_WIDTH 7 -#define HEX7_DO_TEST_BENCH_WIRING 0 -#define HEX7_DRIVEN_SIM_VALUE 0 -#define HEX7_EDGE_TYPE "NONE" -#define HEX7_FREQ 50000000 -#define HEX7_HAS_IN 0 -#define HEX7_HAS_OUT 1 -#define HEX7_HAS_TRI 0 -#define HEX7_IRQ -1 -#define HEX7_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define HEX7_IRQ_TYPE "NONE" -#define HEX7_NAME "/dev/hex7" -#define HEX7_RESET_VALUE 0 -#define HEX7_SPAN 16 -#define HEX7_TYPE "altera_avalon_pio" - - -/* - * jtag_uart configuration - * - */ - -#define ALT_MODULE_CLASS_jtag_uart altera_avalon_jtag_uart -#define JTAG_UART_BASE 0x50c0 -#define JTAG_UART_IRQ 5 -#define JTAG_UART_IRQ_INTERRUPT_CONTROLLER_ID 0 -#define JTAG_UART_NAME "/dev/jtag_uart" -#define JTAG_UART_READ_DEPTH 64 -#define JTAG_UART_READ_THRESHOLD 8 -#define JTAG_UART_SPAN 8 -#define JTAG_UART_TYPE "altera_avalon_jtag_uart" -#define JTAG_UART_WRITE_DEPTH 64 -#define JTAG_UART_WRITE_THRESHOLD 8 - - -/* - * lcd_16207_0 configuration - * - */ - -#define ALT_MODULE_CLASS_lcd_16207_0 altera_avalon_lcd_16207 -#define LCD_16207_0_BASE 0x4030 -#define LCD_16207_0_IRQ -1 -#define LCD_16207_0_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define LCD_16207_0_NAME "/dev/lcd_16207_0" -#define LCD_16207_0_SPAN 16 -#define LCD_16207_0_TYPE "altera_avalon_lcd_16207" - - -/* - * lcd_blon configuration - * - */ - -#define ALT_MODULE_CLASS_lcd_blon altera_avalon_pio -#define LCD_BLON_BASE 0x4020 -#define LCD_BLON_BIT_CLEARING_EDGE_REGISTER 0 -#define LCD_BLON_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define LCD_BLON_CAPTURE 0 -#define LCD_BLON_DATA_WIDTH 1 -#define LCD_BLON_DO_TEST_BENCH_WIRING 0 -#define LCD_BLON_DRIVEN_SIM_VALUE 0 -#define LCD_BLON_EDGE_TYPE "NONE" -#define LCD_BLON_FREQ 50000000 -#define LCD_BLON_HAS_IN 0 -#define LCD_BLON_HAS_OUT 1 -#define LCD_BLON_HAS_TRI 0 -#define LCD_BLON_IRQ -1 -#define LCD_BLON_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define LCD_BLON_IRQ_TYPE "NONE" -#define LCD_BLON_NAME "/dev/lcd_blon" -#define LCD_BLON_RESET_VALUE 0 -#define LCD_BLON_SPAN 16 -#define LCD_BLON_TYPE "altera_avalon_pio" - - -/* - * lcd_on configuration - * - */ - -#define ALT_MODULE_CLASS_lcd_on altera_avalon_pio -#define LCD_ON_BASE 0x4010 -#define LCD_ON_BIT_CLEARING_EDGE_REGISTER 0 -#define LCD_ON_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define LCD_ON_CAPTURE 0 -#define LCD_ON_DATA_WIDTH 1 -#define LCD_ON_DO_TEST_BENCH_WIRING 0 -#define LCD_ON_DRIVEN_SIM_VALUE 0 -#define LCD_ON_EDGE_TYPE "NONE" -#define LCD_ON_FREQ 50000000 -#define LCD_ON_HAS_IN 0 -#define LCD_ON_HAS_OUT 1 -#define LCD_ON_HAS_TRI 0 -#define LCD_ON_IRQ -1 -#define LCD_ON_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define LCD_ON_IRQ_TYPE "NONE" -#define LCD_ON_NAME "/dev/lcd_on" -#define LCD_ON_RESET_VALUE 0 -#define LCD_ON_SPAN 16 -#define LCD_ON_TYPE "altera_avalon_pio" - - -/* - * onchip_memory configuration - * - */ - -#define ALT_MODULE_CLASS_onchip_memory altera_avalon_onchip_memory2 -#define ONCHIP_MEMORY_ALLOW_IN_SYSTEM_MEMORY_CONTENT_EDITOR 0 -#define ONCHIP_MEMORY_ALLOW_MRAM_SIM_CONTENTS_ONLY_FILE 0 -#define ONCHIP_MEMORY_BASE 0x0 -#define ONCHIP_MEMORY_CONTENTS_INFO "" -#define ONCHIP_MEMORY_DUAL_PORT 0 -#define ONCHIP_MEMORY_GUI_RAM_BLOCK_TYPE "AUTO" -#define ONCHIP_MEMORY_INIT_CONTENTS_FILE "nios_system_onchip_memory" -#define ONCHIP_MEMORY_INIT_MEM_CONTENT 1 -#define ONCHIP_MEMORY_INSTANCE_ID "NONE" -#define ONCHIP_MEMORY_IRQ -1 -#define ONCHIP_MEMORY_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define ONCHIP_MEMORY_NAME "/dev/onchip_memory" -#define ONCHIP_MEMORY_NON_DEFAULT_INIT_FILE_ENABLED 0 -#define ONCHIP_MEMORY_RAM_BLOCK_TYPE "AUTO" -#define ONCHIP_MEMORY_READ_DURING_WRITE_MODE "DONT_CARE" -#define ONCHIP_MEMORY_SINGLE_CLOCK_OP 0 -#define ONCHIP_MEMORY_SIZE_MULTIPLE 1 -#define ONCHIP_MEMORY_SIZE_VALUE 16384 -#define ONCHIP_MEMORY_SPAN 16384 -#define ONCHIP_MEMORY_TYPE "altera_avalon_onchip_memory2" -#define ONCHIP_MEMORY_WRITABLE 1 - - -/* - * push_switches configuration - * - */ - -#define ALT_MODULE_CLASS_push_switches altera_avalon_pio -#define PUSH_SWITCHES_BASE 0x5080 -#define PUSH_SWITCHES_BIT_CLEARING_EDGE_REGISTER 0 -#define PUSH_SWITCHES_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define PUSH_SWITCHES_CAPTURE 0 -#define PUSH_SWITCHES_DATA_WIDTH 3 -#define PUSH_SWITCHES_DO_TEST_BENCH_WIRING 0 -#define PUSH_SWITCHES_DRIVEN_SIM_VALUE 0 -#define PUSH_SWITCHES_EDGE_TYPE "NONE" -#define PUSH_SWITCHES_FREQ 50000000 -#define PUSH_SWITCHES_HAS_IN 1 -#define PUSH_SWITCHES_HAS_OUT 0 -#define PUSH_SWITCHES_HAS_TRI 0 -#define PUSH_SWITCHES_IRQ -1 -#define PUSH_SWITCHES_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define PUSH_SWITCHES_IRQ_TYPE "NONE" -#define PUSH_SWITCHES_NAME "/dev/push_switches" -#define PUSH_SWITCHES_RESET_VALUE 0 -#define PUSH_SWITCHES_SPAN 16 -#define PUSH_SWITCHES_TYPE "altera_avalon_pio" - - -/* - * switches configuration - * - */ - -#define ALT_MODULE_CLASS_switches altera_avalon_pio -#define SWITCHES_BASE 0x5090 -#define SWITCHES_BIT_CLEARING_EDGE_REGISTER 0 -#define SWITCHES_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define SWITCHES_CAPTURE 0 -#define SWITCHES_DATA_WIDTH 18 -#define SWITCHES_DO_TEST_BENCH_WIRING 0 -#define SWITCHES_DRIVEN_SIM_VALUE 0 -#define SWITCHES_EDGE_TYPE "NONE" -#define SWITCHES_FREQ 50000000 -#define SWITCHES_HAS_IN 1 -#define SWITCHES_HAS_OUT 0 -#define SWITCHES_HAS_TRI 0 -#define SWITCHES_IRQ -1 -#define SWITCHES_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define SWITCHES_IRQ_TYPE "NONE" -#define SWITCHES_NAME "/dev/switches" -#define SWITCHES_RESET_VALUE 0 -#define SWITCHES_SPAN 16 -#define SWITCHES_TYPE "altera_avalon_pio" - -#endif /* __SYSTEM_H_ */ diff --git a/software/qsys_tutorial_lcd3/.cproject b/software/qsys_tutorial_lcd3/.cproject deleted file mode 100644 index c89cdac..0000000 --- a/software/qsys_tutorial_lcd3/.cproject +++ /dev/null @@ -1,508 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - make - - mem_init_install - true - false - false - - - make - - mem_init_generate - true - false - false - - - make - - help - true - false - false - - - - diff --git a/software/qsys_tutorial_lcd3/.project b/software/qsys_tutorial_lcd3/.project deleted file mode 100644 index 6707ca7..0000000 --- a/software/qsys_tutorial_lcd3/.project +++ /dev/null @@ -1,96 +0,0 @@ - - - qsys_tutorial_lcd3 - - - - - - com.altera.sbtgui.project.makefileBuilder - - - - - com.altera.sbtgui.project.makefileBuilder - - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - ?name? - - - - org.eclipse.cdt.make.core.append_environment - true - - - org.eclipse.cdt.make.core.autoBuildTarget - all - - - org.eclipse.cdt.make.core.buildArguments - - - - org.eclipse.cdt.make.core.buildCommand - make - - - org.eclipse.cdt.make.core.buildLocation - ${workspace_loc://qsys_tutorial_lcd3} - - - org.eclipse.cdt.make.core.cleanBuildTarget - clean - - - org.eclipse.cdt.make.core.contents - org.eclipse.cdt.make.core.activeConfigSettings - - - org.eclipse.cdt.make.core.enableAutoBuild - false - - - org.eclipse.cdt.make.core.enableCleanBuild - true - - - org.eclipse.cdt.make.core.enableFullBuild - true - - - org.eclipse.cdt.make.core.fullBuildTarget - all - - - org.eclipse.cdt.make.core.stopOnError - true - - - org.eclipse.cdt.make.core.useDefaultBuildCmd - true - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - org.eclipse.cdt.core.ccnature - com.altera.sbtgui.project.SBTGUINature - com.altera.sbtgui.project.SBTGUIAppNature - com.altera.sbtgui.project.SBTGUIManagedNature - - diff --git a/software/qsys_tutorial_lcd3/Makefile b/software/qsys_tutorial_lcd3/Makefile deleted file mode 100644 index 5b08897..0000000 --- a/software/qsys_tutorial_lcd3/Makefile +++ /dev/null @@ -1,1086 +0,0 @@ -#------------------------------------------------------------------------------ -# VARIABLES APPENDED TO BY INCLUDED MAKEFILE FRAGMENTS -#------------------------------------------------------------------------------ - -# List of include directories for -I compiler option (-I added when used). -# Includes the BSP. -ALT_INCLUDE_DIRS := - -# List of library directories for -L linker option (-L added when used). -# Includes the BSP. -ALT_LIBRARY_DIRS := - -# List of library names for -l linker option (-l added when used). -# Includes the BSP. -ALT_LIBRARY_NAMES := - -# List of library names for -msys-lib linker option (-msys-lib added when used). -# These are libraries that might be located in the BSP and depend on the BSP -# library, or vice versa -ALT_BSP_DEP_LIBRARY_NAMES := - -# List of dependencies for the linker. This is usually the full pathname -# of each library (*.a) file. -# Includes the BSP. -ALT_LDDEPS := - -# List of root library directories that support running make to build them. -# Includes the BSP and any ALT libraries. -MAKEABLE_LIBRARY_ROOT_DIRS := - -# Generic flags passed to the compiler for different types of input files. -ALT_CFLAGS := -ALT_CXXFLAGS := -ALT_CPPFLAGS := -ALT_ASFLAGS := -ALT_LDFLAGS := - - -#------------------------------------------------------------------------------ -# The adjust-path macro -# -# If COMSPEC/ComSpec is defined, Make is launched from Windows through -# Cygwin. The adjust-path macro converts absolute windows paths into -# unix style paths (Example: c:/dir -> /c/dir). This will ensture -# paths are readable by GNU Make. -# -# If COMSPEC/ComSpec is not defined, Make is launched from linux, and no -# adjustment is necessary -# -#------------------------------------------------------------------------------ - -ifndef COMSPEC -ifdef ComSpec -COMSPEC = $(ComSpec) -endif # ComSpec -endif # COMSPEC - -ifdef COMSPEC # if Windows OS - -ifeq ($(MAKE_VERSION),3.81) -# -# adjust-path/adjust-path-mixed for Mingw Gnu Make on Windows -# -# Example Usage: -# $(call adjust-path,c:/aaa/bbb) => /c/aaa/bbb -# $(call adjust-path-mixed,/c/aaa/bbb) => c:/aaa/bbb -# $(call adjust-path-mixed,/cygdrive/c/aaa/bbb) => c:/aaa/bbb -# - -# -# adjust-path -# - converts back slash characters into forward slashes -# - if input arg ($1) is an empty string then return the empty string -# - if input arg ($1) does not contain the string ":/", then return input arg -# - using sed, convert mixed path [c:/...] into mingw path [/c/...] -define adjust-path -$(strip \ -$(if $1,\ -$(if $(findstring :/,$(subst \,/,$1)),\ -$(shell echo $(subst \,/,$1) | sed -e 's,^\([a-zA-Z]\):/,/\1/,'),\ -$(subst \,/,$1)))) -endef - -# -# adjust-path-mixed -# - converts back slash characters into forward slashes -# - if input arg ($1) is an empty string then return the empty string -# - if input arg ($1) does not begin with a forward slash '/' char, then -# return input arg -# - using sed, convert mingw path [/c/...] or cygwin path [/c/cygdrive/...] -# into a mixed path [c:/...] -define adjust-path-mixed -$(strip \ -$(if $1,\ -$(if $(findstring $(subst \,/,$1),$(patsubst /%,%,$(subst \,/,$1))),\ -$(subst \,/,$1),\ -$(shell echo $(subst \,/,$1) | sed -e 's,^/cygdrive/\([a-zA-Z]\)/,\1:/,' -e 's,^/\([a-zA-Z]\)/,\1:/,')))) -endef - -else # MAKE_VERSION != 3.81 (MAKE_VERSION == 3.80 or MAKE_VERSION == 3.79) -# -# adjust-path for Cygwin Gnu Make -# $(call adjust-path,c:/aaa/bbb) = /cygdrive/c/aaa/bbb -# $(call adjust-path-mixed,/cygdrive/c/aaa/bbb) = c:/aaa/bbb -# -adjust-path = $(if $1,$(shell cygpath -u "$1"),) -adjust-path-mixed = $(if $1,$(shell cygpath -m "$1"),) -endif - -else # !COMSPEC - -adjust-path = $1 -adjust-path-mixed = $1 - -endif # COMSPEC - - -#vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv -# GENERATED SETTINGS START v -#vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv - -#START GENERATED -ACTIVE_BUILD_CONFIG := default -BUILD_CONFIGS := default - -# The following TYPE comment allows tools to identify the 'type' of target this -# makefile is associated with. -# TYPE: APP_MAKEFILE - -# This following VERSION comment indicates the version of the tool used to -# generate this makefile. A makefile variable is provided for VERSION as well. -# ACDS_VERSION: 13.0sp1 -ACDS_VERSION := 13.0sp1 - -# This following BUILD_NUMBER comment indicates the build number of the tool -# used to generate this makefile. -# BUILD_NUMBER: 232 - -# Define path to the application ELF. -# It may be used by the makefile fragments so is defined before including them. -# -ELF := qsys_tutorial_lcd3.elf - -# Paths to C, C++, and assembly source files. -C_SRCS := hello_world.c -CXX_SRCS := -ASM_SRCS := - - -# Path to root of object file tree. -OBJ_ROOT_DIR := obj - -# Options to control objdump. -CREATE_OBJDUMP := 1 -OBJDUMP_INCLUDE_SOURCE := 1 -OBJDUMP_FULL_CONTENTS := 0 - -# Options to enable/disable optional files. -CREATE_ELF_DERIVED_FILES := 0 -CREATE_LINKER_MAP := 1 - -# Common arguments for ALT_CFLAGSs -APP_CFLAGS_DEFINED_SYMBOLS := -APP_CFLAGS_UNDEFINED_SYMBOLS := -APP_CFLAGS_OPTIMIZATION := -O0 -APP_CFLAGS_DEBUG_LEVEL := -g -APP_CFLAGS_WARNINGS := -Wall -APP_CFLAGS_USER_FLAGS := - -APP_ASFLAGS_USER := -APP_LDFLAGS_USER := - -# Linker options that have default values assigned later if not -# assigned here. -LINKER_SCRIPT := -CRT0 := -SYS_LIB := - -# Define path to the root of the BSP. -BSP_ROOT_DIR := ../qsys_tutorial_lcd3_bsp/ - -# List of application specific include directories, library directories and library names -APP_INCLUDE_DIRS := -APP_LIBRARY_DIRS := -APP_LIBRARY_NAMES := - -# Pre- and post- processor settings. -BUILD_PRE_PROCESS := -BUILD_POST_PROCESS := - -QUARTUS_PROJECT_DIR := ../../ - - -#END GENERATED - -#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -# GENERATED SETTINGS END ^ -#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - -#------------------------------------------------------------------------------ -# DEFAULT TARGET -#------------------------------------------------------------------------------ - -# Define the variable used to echo output if not already defined. -ifeq ($(ECHO),) -ECHO := echo -endif - -# Put "all" rule before included makefile fragments because they may -# define rules and we don't want one of those to become the default rule. -.PHONY : all - -all: - @$(ECHO) [$(APP_NAME) build complete] - -all : build_pre_process libs app build_post_process - - -#------------------------------------------------------------------------------ -# VARIABLES DEPENDENT ON GENERATED CONTENT -#------------------------------------------------------------------------------ - -# Define object file directory per build configuration -CONFIG_OBJ_DIR := $(OBJ_ROOT_DIR)/$(ACTIVE_BUILD_CONFIG) - -ifeq ($(BSP_ROOT_DIR),) -$(error Edit Makefile and provide a value for BSP_ROOT_DIR) -endif - -ifeq ($(wildcard $(BSP_ROOT_DIR)),) -$(error BSP directory does not exist: $(BSP_ROOT_DIR)) -endif - -# Define absolute path to the root of the BSP. -ABS_BSP_ROOT_DIR := $(call adjust-path-mixed,$(shell cd "$(BSP_ROOT_DIR)"; pwd)) - -# Include makefile fragments. Define variable ALT_LIBRARY_ROOT_DIR before -# including each makefile fragment so that it knows the path to itself. -BSP_INCLUDE_FILE := $(BSP_ROOT_DIR)/public.mk -ALT_LIBRARY_ROOT_DIR := $(BSP_ROOT_DIR) -include $(BSP_INCLUDE_FILE) -# C2H will need this to touch the BSP public.mk and avoid the sopc file -# out-of-date error during a BSP make -ABS_BSP_INCLUDE_FILE := $(ABS_BSP_ROOT_DIR)/public.mk - - -ifneq ($(WARNING.SMALL_STACK_SIZE),) -# This WARNING is here to protect you from unknowingly using a very small stack -# If the warning is set, increase your stack size or enable the BSP small stack -# setting to eliminate the warning -$(warning WARNING: $(WARNING.SMALL_STACK_SIZE)) -endif - - -# If the BSP public.mk indicates that ALT_SIM_OPTIMIZE is set, rename the ELF -# by prefixing it with RUN_ON_HDL_SIMULATOR_ONLY_. -ifneq ($(filter -DALT_SIM_OPTIMIZE,$(ALT_CPPFLAGS)),) -ELF := RUN_ON_HDL_SIMULATOR_ONLY_$(ELF) -endif - -# If the BSP public.mk indicates that ALT_PROVIDE_GMON is set, add option to -# download_elf target -ifneq ($(filter -DALT_PROVIDE_GMON,$(ALT_CPPFLAGS)),) -GMON_OUT_FILENAME := gmon.out -WRITE_GMON_OPTION := --write-gmon $(GMON_OUT_FILENAME) -endif - -# Name of ELF application. -APP_NAME := $(basename $(ELF)) - -# Set to defaults if variables not already defined in settings. -ifeq ($(LINKER_SCRIPT),) -LINKER_SCRIPT := $(BSP_LINKER_SCRIPT) -endif -ifeq ($(CRT0),) -CRT0 := $(BSP_CRT0) -endif -ifeq ($(SYS_LIB),) -SYS_LIB := $(BSP_SYS_LIB) -endif - -OBJDUMP_NAME := $(APP_NAME).objdump -OBJDUMP_FLAGS := --disassemble --syms --all-header -ifeq ($(OBJDUMP_INCLUDE_SOURCE),1) -OBJDUMP_FLAGS += --source -endif -ifeq ($(OBJDUMP_FULL_CONTENTS),1) -OBJDUMP_FLAGS += --full-contents -endif - -# Create list of linker dependencies (*.a files). -APP_LDDEPS := $(ALT_LDDEPS) $(LDDEPS) - -# Take lists and add required prefixes. -APP_INC_DIRS := $(addprefix -I, $(ALT_INCLUDE_DIRS) $(APP_INCLUDE_DIRS) $(INC_DIRS)) -ASM_INC_PREFIX := -Wa,-I -APP_ASM_INC_DIRS := $(addprefix $(ASM_INC_PREFIX), $(ALT_INCLUDE_DIRS) $(APP_INCLUDE_DIRS) $(INC_DIRS)) -APP_LIB_DIRS := $(addprefix -L, $(ALT_LIBRARY_DIRS) $(APP_LIBRARY_DIRS) $(LIB_DIRS)) -APP_LIBS := $(addprefix -l, $(ALT_LIBRARY_NAMES) $(APP_LIBRARY_NAMES) $(LIBS)) - -ifneq ($(AVOID_NIOS2_GCC3_OPTIONS),) - -# -# Avoid Nios II GCC 3.X options. -# - -# Detect if small newlib C library is requested. -# If yes, remove the -msmallc option because it is -# now handled by other means. -ifneq ($(filter -msmallc,$(ALT_LDFLAGS)),) - ALT_LDFLAGS := $(filter-out -msmallc,$(ALT_LDFLAGS)) - ALT_C_LIBRARY := smallc -else - ALT_C_LIBRARY := c -endif - -# Put each BSP dependent library in a group to avoid circular dependencies. -APP_BSP_DEP_LIBS := $(foreach l,$(ALT_BSP_DEP_LIBRARY_NAMES),-Wl,--start-group -l$(ALT_C_LIBRARY) -lgcc -l$(l) -Wl,--end-group) - -else # !AVOID_NIOS2_GCC3_OPTIONS - -# -# Use Nios II GCC 3.X options. -# -APP_BSP_DEP_LIBS := $(addprefix -msys-lib=, $(ALT_BSP_DEP_LIBRARY_NAMES)) - -endif # !AVOID_NIOS2_GCC3_OPTIONS - -# Arguments for the C preprocessor, C/C++ compiler, assembler, and linker. -APP_CFLAGS := $(APP_CFLAGS_DEFINED_SYMBOLS) \ - $(APP_CFLAGS_UNDEFINED_SYMBOLS) \ - $(APP_CFLAGS_OPTIMIZATION) \ - $(APP_CFLAGS_DEBUG_LEVEL) \ - $(APP_CFLAGS_WARNINGS) \ - $(APP_CFLAGS_USER_FLAGS) \ - $(ALT_CFLAGS) \ - $(CFLAGS) - -# Arguments only for the C++ compiler. -APP_CXXFLAGS := $(ALT_CXXFLAGS) $(CXXFLAGS) - -# Arguments only for the C preprocessor. -# Prefix each include directory with -I. -APP_CPPFLAGS := $(APP_INC_DIRS) \ - $(ALT_CPPFLAGS) \ - $(CPPFLAGS) - -# Arguments only for the assembler. -APP_ASFLAGS := $(APP_ASM_INC_DIRS) \ - $(ALT_ASFLAGS) \ - $(APP_ASFLAGS_USER) \ - $(ASFLAGS) - -# Arguments only for the linker. -APP_LDFLAGS := $(APP_LDFLAGS_USER) - -ifneq ($(LINKER_SCRIPT),) -APP_LDFLAGS += -T'$(LINKER_SCRIPT)' -endif - -ifneq ($(AVOID_NIOS2_GCC3_OPTIONS),) - -# Avoid Nios II GCC 3.x options. -ifneq ($(CRT0),) -APP_LDFLAGS += $(CRT0) -endif - -# The equivalent of the -msys-lib option is provided -# by the GROUP() command in the linker script. -# Note this means the SYS_LIB variable is now ignored. - -else # !AVOID_NIOS2_GCC3_OPTIONS - -# Use Nios II GCC 3.x options. -ifneq ($(CRT0),) -APP_LDFLAGS += -msys-crt0='$(CRT0)' -endif -ifneq ($(SYS_LIB),) -APP_LDFLAGS += -msys-lib=$(SYS_LIB) -endif - -endif # !AVOID_NIOS2_GCC3_OPTIONS - -APP_LDFLAGS += \ - $(APP_LIB_DIRS) \ - $(ALT_LDFLAGS) \ - $(LDFLAGS) - -LINKER_MAP_NAME := $(APP_NAME).map -ifeq ($(CREATE_LINKER_MAP), 1) -APP_LDFLAGS += -Wl,-Map=$(LINKER_MAP_NAME) -endif - -# QUARTUS_PROJECT_DIR and SOPC_NAME need to be defined if you want the -# mem_init_install target of the mem_init.mk (located in the associated BSP) -# to know how to copy memory initialization files (e.g. .dat, .hex) into -# directories required for Quartus compilation or RTL simulation. - -# Defining QUARTUS_PROJECT_DIR causes mem_init_install to copy memory -# initialization files into your Quartus project directory. This is required -# to provide the initial memory contents of FPGA memories that can be -# initialized by the programming file (.sof) or Hardcopy ROMs. It is also used -# for VHDL simulation of on-chip memories. - -# Defining SOPC_NAME causes the mem_init_install target to copy memory -# initialization files into your RTL simulation directory. This is required -# to provide the initial memory contents of all memories that can be -# initialized by RTL simulation. This variable should be set to the same name -# as your SOPC Builder system name. For example, if you have a system called -# "foo.sopc", this variable should be set to "foo". - -# If SOPC_NAME is not set and QUARTUS_PROJECT_DIR is set, then derive SOPC_NAME. -ifeq ($(SOPC_NAME),) -ifneq ($(QUARTUS_PROJECT_DIR),) -SOPC_NAME := $(basename $(notdir $(wildcard $(QUARTUS_PROJECT_DIR)/*.sopcinfo))) -endif -endif - -# Defining JDI_FILE is required to specify the JTAG Debug Information File -# path. This file is generated by Quartus, and is needed along with the -# .sopcinfo file to resolve processor instance ID's from names in a multi-CPU -# systems. For multi-CPU systems, the processor instance ID is used to select -# from multiple CPU's during ELF download. - -# Both JDI_FILE and SOPCINFO_FILE are provided by the BSP if they found during -# BSP creation. If JDI_FILE is not set and QUARTUS_PROJECT_DIR is set, then -# derive JDI_FILE. We do not attempt to derive SOPCINFO_FILE since there may be -# multiple .sopcinfo files in a Quartus project. -ifeq ($(JDI_FILE),) -ifneq ($(QUARTUS_PROJECT_DIR),) -JDI_FILE := $(wildcard $(QUARTUS_PROJECT_DIR)/*.jdi) -endif -endif - -# Path to root runtime directory used for hdl simulation -RUNTIME_ROOT_DIR := $(CONFIG_OBJ_DIR)/runtime - - - -#------------------------------------------------------------------------------ -# MAKEFILE INCLUDES DEPENDENT ON GENERATED CONTENT -#------------------------------------------------------------------------------ -# mem_init.mk is a generated makefile fragment. This file defines all targets -# used to generate HDL initialization simulation files and pre-initialized -# onchip memory files. -MEM_INIT_FILE := $(BSP_ROOT_DIR)/mem_init.mk -include $(MEM_INIT_FILE) - -# Create list of object files to be built using the list of source files. -# The source file hierarchy is preserved in the object tree. -# The supported file extensions are: -# -# .c - for C files -# .cxx .cc .cpp - for C++ files -# .S .s - for assembler files -# -# Handle source files specified by --src-dir & --src-rdir differently, to -# save some processing time in calling the adjust-path macro. - -OBJ_LIST_C := $(patsubst %.c,%.o,$(filter %.c,$(C_SRCS))) -OBJ_LIST_CPP := $(patsubst %.cpp,%.o,$(filter %.cpp,$(CXX_SRCS))) -OBJ_LIST_CXX := $(patsubst %.cxx,%.o,$(filter %.cxx,$(CXX_SRCS))) -OBJ_LIST_CC := $(patsubst %.cc,%.o,$(filter %.cc,$(CXX_SRCS))) -OBJ_LIST_S := $(patsubst %.S,%.o,$(filter %.S,$(ASM_SRCS))) -OBJ_LIST_SS := $(patsubst %.s,%.o,$(filter %.s,$(ASM_SRCS))) - -OBJ_LIST := $(sort $(OBJ_LIST_C) $(OBJ_LIST_CPP) $(OBJ_LIST_CXX) \ - $(OBJ_LIST_CC) $(OBJ_LIST_S) $(OBJ_LIST_SS)) - -SDIR_OBJ_LIST_C := $(patsubst %.c,%.o,$(filter %.c,$(SDIR_C_SRCS))) -SDIR_OBJ_LIST_CPP := $(patsubst %.cpp,%.o,$(filter %.cpp,$(SDIR_CXX_SRCS))) -SDIR_OBJ_LIST_CXX := $(patsubst %.cxx,%.o,$(filter %.cxx,$(SDIR_CXX_SRCS))) -SDIR_OBJ_LIST_CC := $(patsubst %.cc,%.o,$(filter %.cc,$(SDIR_CXX_SRCS))) -SDIR_OBJ_LIST_S := $(patsubst %.S,%.o,$(filter %.S,$(SDIR_ASM_SRCS))) -SDIR_OBJ_LIST_SS := $(patsubst %.s,%.o,$(filter %.s,$(SDIR_ASM_SRCS))) - -SDIR_OBJ_LIST := $(sort $(SDIR_OBJ_LIST_C) $(SDIR_OBJ_LIST_CPP) \ - $(SDIR_OBJ_LIST_CXX) $(SDIR_OBJ_LIST_CC) $(SDIR_OBJ_LIST_S) \ - $(SDIR_OBJ_LIST_SS)) - -# Relative-pathed objects that being with "../" are handled differently. -# -# Regular objects are created as -# $(CONFIG_OBJ_DIR)//.o -# where the path structure is maintained under the obj directory. This -# applies for both absolute and relative paths; in the absolute path -# case this means the entire source path will be recreated under the obj -# directory. This is done to allow two source files with the same name -# to be included as part of the project. -# -# Note: On Cygwin, the path recreated under the obj directory will be -# the cygpath -u output path. -# -# Relative-path objects that begin with "../" cause problems under this -# scheme, as $(CONFIG_OBJ_DIR)/..// can potentially put the object -# files anywhere in the system, creating clutter and polluting the source tree. -# As such, their paths are flattened - the object file created will be -# $(CONFIG_OBJ_DIR)/.o. Due to this, two files specified with -# "../" in the beginning cannot have the same name in the project. VPATH -# will be set for these sources to allow make to relocate the source file -# via %.o rules. -# -# The following lines separate the object list into the flatten and regular -# lists, and then handles them as appropriate. - -FLATTEN_OBJ_LIST := $(filter ../%,$(OBJ_LIST)) -FLATTEN_APP_OBJS := $(addprefix $(CONFIG_OBJ_DIR)/,$(notdir $(FLATTEN_OBJ_LIST))) - -REGULAR_OBJ_LIST := $(filter-out $(FLATTEN_OBJ_LIST),$(OBJ_LIST)) -REGULAR_OBJ_LIST_C := $(filter $(OBJ_LIST_C),$(REGULAR_OBJ_LIST)) -REGULAR_OBJ_LIST_CPP := $(filter $(OBJ_LIST_CPP),$(REGULAR_OBJ_LIST)) -REGULAR_OBJ_LIST_CXX := $(filter $(OBJ_LIST_CXX),$(REGULAR_OBJ_LIST)) -REGULAR_OBJ_LIST_CC := $(filter $(OBJ_LIST_CC),$(REGULAR_OBJ_LIST)) -REGULAR_OBJ_LIST_S := $(filter $(OBJ_LIST_S),$(REGULAR_OBJ_LIST)) -REGULAR_OBJ_LIST_SS := $(filter $(OBJ_LIST_SS),$(REGULAR_OBJ_LIST)) - -FLATTEN_SDIR_OBJ_LIST := $(filter ../%,$(SDIR_OBJ_LIST)) -FLATTEN_SDIR_APP_OBJS := $(addprefix $(CONFIG_OBJ_DIR)/,$(notdir $(FLATTEN_SDIR_OBJ_LIST))) - -REGULAR_SDIR_OBJ_LIST := $(filter-out $(FLATTEN_SDIR_OBJ_LIST),$(SDIR_OBJ_LIST)) -REGULAR_SDIR_OBJ_LIST_C := $(filter $(SDIR_OBJ_LIST_C),$(REGULAR_SDIR_OBJ_LIST)) -REGULAR_SDIR_OBJ_LIST_CPP := $(filter $(SDIR_OBJ_LIST_CPP),$(REGULAR_SDIR_OBJ_LIST)) -REGULAR_SDIR_OBJ_LIST_CXX := $(filter $(SDIR_OBJ_LIST_CXX),$(REGULAR_SDIR_OBJ_LIST)) -REGULAR_SDIR_OBJ_LIST_CC := $(filter $(SDIR_OBJ_LIST_CC),$(REGULAR_SDIR_OBJ_LIST)) -REGULAR_SDIR_OBJ_LIST_S := $(filter $(SDIR_OBJ_LIST_S),$(REGULAR_SDIR_OBJ_LIST)) -REGULAR_SDIR_OBJ_LIST_SS := $(filter $(SDIR_OBJ_LIST_SS),$(REGULAR_SDIR_OBJ_LIST)) - -VPATH := $(sort $(dir $(FLATTEN_OBJ_LIST)) $(dir $(FLATTEN_SDIR_OBJ_LIST))) - -APP_OBJS_C := $(addprefix $(CONFIG_OBJ_DIR)/,\ - $(REGULAR_SDIR_OBJ_LIST_C) \ - $(foreach s,$(REGULAR_OBJ_LIST_C),$(call adjust-path,$s))) - -APP_OBJS_CPP := $(addprefix $(CONFIG_OBJ_DIR)/,\ - $(REGULAR_SDIR_OBJ_LIST_CPP) \ - $(foreach s,$(REGULAR_OBJ_LIST_CPP),$(call adjust-path,$s))) - -APP_OBJS_CXX := $(addprefix $(CONFIG_OBJ_DIR)/,\ - $(REGULAR_SDIR_OBJ_LIST_CXX) \ - $(foreach s,$(REGULAR_OBJ_LIST_CXX),$(call adjust-path,$s))) - -APP_OBJS_CC := $(addprefix $(CONFIG_OBJ_DIR)/,\ - $(REGULAR_SDIR_OBJ_LIST_CC) \ - $(foreach s,$(REGULAR_OBJ_LIST_CC),$(call adjust-path,$s))) - -APP_OBJS_S := $(addprefix $(CONFIG_OBJ_DIR)/,\ - $(REGULAR_SDIR_OBJ_LIST_S) \ - $(foreach s,$(REGULAR_OBJ_LIST_S),$(call adjust-path,$s))) - -APP_OBJS_SS := $(addprefix $(CONFIG_OBJ_DIR)/,\ - $(REGULAR_SDIR_OBJ_LIST_SS) \ - $(foreach s,$(REGULAR_OBJ_LIST_SS),$(call adjust-path,$s))) - -APP_OBJS := $(APP_OBJS_C) $(APP_OBJS_CPP) $(APP_OBJS_CXX) $(APP_OBJS_CC) \ - $(APP_OBJS_S) $(APP_OBJS_SS) \ - $(FLATTEN_APP_OBJS) $(FLATTEN_SDIR_APP_OBJS) - -# Add any extra user-provided object files. -APP_OBJS += $(OBJS) - -# Create list of dependancy files for each object file. -APP_DEPS := $(APP_OBJS:.o=.d) - -# Patch the Elf file with system specific information - -# Patch the Elf with the name of the sopc system -ifneq ($(SOPC_NAME),) -ELF_PATCH_FLAG += --sopc_system_name $(SOPC_NAME) -endif - -# Patch the Elf with the absolute path to the Quartus Project Directory -ifneq ($(QUARTUS_PROJECT_DIR),) -ABS_QUARTUS_PROJECT_DIR := $(call adjust-path-mixed,$(shell cd "$(QUARTUS_PROJECT_DIR)"; pwd)) -ELF_PATCH_FLAG += --quartus_project_dir "$(ABS_QUARTUS_PROJECT_DIR)" -endif - -# Patch the Elf and download args with the JDI_FILE if specified -ifneq ($(wildcard $(JDI_FILE)),) -ELF_PATCH_FLAG += --jdi $(JDI_FILE) -DOWNLOAD_JDI_FLAG := --jdi $(JDI_FILE) -endif - -# Patch the Elf with the SOPCINFO_FILE if specified -ifneq ($(wildcard $(SOPCINFO_FILE)),) -ELF_PATCH_FLAG += --sopcinfo $(SOPCINFO_FILE) -endif - -# Use the DOWNLOAD_CABLE variable to specify which JTAG cable to use. -# This is not needed if you only have one cable. -ifneq ($(DOWNLOAD_CABLE),) -DOWNLOAD_CABLE_FLAG := --cable '$(DOWNLOAD_CABLE)' -endif - - -#------------------------------------------------------------------------------ -# BUILD PRE/POST PROCESS -#------------------------------------------------------------------------------ -build_pre_process : - $(BUILD_PRE_PROCESS) - -build_post_process : - $(BUILD_POST_PROCESS) - -.PHONY: build_pre_process build_post_process - - -#------------------------------------------------------------------------------ -# TOOLS -#------------------------------------------------------------------------------ - -# -# Set tool default variables if not already defined. -# If these are defined, they would typically be defined in an -# included makefile fragment. -# -ifeq ($(DEFAULT_CROSS_COMPILE),) -DEFAULT_CROSS_COMPILE := nios2-elf- -endif - -ifeq ($(DEFAULT_STACK_REPORT),) -DEFAULT_STACKREPORT := nios2-stackreport -endif - -ifeq ($(DEFAULT_DOWNLOAD),) -DEFAULT_DOWNLOAD := nios2-download -endif - -ifeq ($(DEFAULT_FLASHPROG),) -DEFAULT_FLASHPROG := nios2-flash-programmer -endif - -ifeq ($(DEFAULT_ELFPATCH),) -DEFAULT_ELFPATCH := nios2-elf-insert -endif - -ifeq ($(DEFAULT_RM),) -DEFAULT_RM := rm -f -endif - -ifeq ($(DEFAULT_CP),) -DEFAULT_CP := cp -f -endif - -ifeq ($(DEFAULT_MKDIR),) -DEFAULT_MKDIR := mkdir -p -endif - -# -# Set tool variables to defaults if not already defined. -# If these are defined, they would typically be defined by a -# setting in the generated portion of this makefile. -# -ifeq ($(CROSS_COMPILE),) -CROSS_COMPILE := $(DEFAULT_CROSS_COMPILE) -endif - -ifeq ($(origin CC),default) -CC := $(CROSS_COMPILE)gcc -xc -endif - -ifeq ($(origin CXX),default) -CXX := $(CROSS_COMPILE)gcc -xc++ -endif - -ifeq ($(origin AS),default) -AS := $(CROSS_COMPILE)gcc -endif - -ifeq ($(origin AR),default) -AR := $(CROSS_COMPILE)ar -endif - -ifeq ($(origin LD),default) -LD := $(CROSS_COMPILE)g++ -endif - -ifeq ($(origin NM),default) -NM := $(CROSS_COMPILE)nm -endif - -ifeq ($(origin RM),default) -RM := $(DEFAULT_RM) -endif - -ifeq ($(origin CP),default) -CP := $(DEFAULT_CP) -endif - -ifeq ($(OBJDUMP),) -OBJDUMP := $(CROSS_COMPILE)objdump -endif - -ifeq ($(OBJCOPY),) -OBJCOPY := $(CROSS_COMPILE)objcopy -endif - -ifeq ($(STACKREPORT),) -ifeq ($(CROSS_COMPILE),nios2-elf-) -STACKREPORT := $(DEFAULT_STACKREPORT) -else -DISABLE_STACKREPORT := 1 -endif -endif - -ifeq ($(DOWNLOAD),) -DOWNLOAD := $(DEFAULT_DOWNLOAD) -endif - -ifeq ($(FLASHPROG),) -FLASHPROG := $(DEFAULT_FLASHPROG) -endif - -ifeq ($(ELFPATCH),) -ELFPATCH := $(DEFAULT_ELFPATCH) -endif - -ifeq ($(MKDIR),) -MKDIR := $(DEFAULT_MKDIR) -endif - -#------------------------------------------------------------------------------ -# PATTERN RULES TO BUILD OBJECTS -#------------------------------------------------------------------------------ - -define compile.c -@$(ECHO) Info: Compiling $< to $@ -@$(MKDIR) $(@D) -$(CC) -MP -MMD -c $(APP_CPPFLAGS) $(APP_CFLAGS) -o $@ $< -$(CC_POST_PROCESS) -endef - -define compile.cpp -@$(ECHO) Info: Compiling $< to $@ -@$(MKDIR) $(@D) -$(CXX) -MP -MMD -c $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< -$(CXX_POST_PROCESS) -endef - -# If assembling with the compiler, ensure "-Wa," is prepended to all APP_ASFLAGS -ifeq ($(AS),$(patsubst %as,%,$(AS))) -COMMA := , -APP_ASFLAGS := $(filter-out $(APP_CFLAGS),$(addprefix -Wa$(COMMA),$(patsubst -Wa$(COMMA)%,%,$(APP_ASFLAGS)))) -endif - -define compile.s -@$(ECHO) Info: Assembling $< to $@ -@$(MKDIR) $(@D) -$(AS) -MP -MMD -c $(APP_CPPFLAGS) $(APP_CFLAGS) $(APP_ASFLAGS) -o $@ $< -$(AS_POST_PROCESS) -endef - -ifeq ($(MAKE_VERSION),3.81) -.SECONDEXPANSION: - -$(APP_OBJS_C): $(CONFIG_OBJ_DIR)/%.o: $$(call adjust-path-mixed,%.c) - $(compile.c) - -$(APP_OBJS_CPP): $(CONFIG_OBJ_DIR)/%.o: $$(call adjust-path-mixed,%.cpp) - $(compile.cpp) - -$(APP_OBJS_CC): $(CONFIG_OBJ_DIR)/%.o: $$(call adjust-path-mixed,%.cc) - $(compile.cpp) - -$(APP_OBJS_CXX): $(CONFIG_OBJ_DIR)/%.o: $$(call adjust-path-mixed,%.cxx) - $(compile.cpp) - -$(APP_OBJS_S): $(CONFIG_OBJ_DIR)/%.o: $$(call adjust-path-mixed,%.S) - $(compile.s) - -$(APP_OBJS_SS): $(CONFIG_OBJ_DIR)/%.o: $$(call adjust-path-mixed,%.s) - $(compile.s) - -endif # MAKE_VERSION != 3.81 - -$(CONFIG_OBJ_DIR)/%.o: %.c - $(compile.c) - -$(CONFIG_OBJ_DIR)/%.o: %.cpp - $(compile.cpp) - -$(CONFIG_OBJ_DIR)/%.o: %.cc - $(compile.cpp) - -$(CONFIG_OBJ_DIR)/%.o: %.cxx - $(compile.cpp) - -$(CONFIG_OBJ_DIR)/%.o: %.S - $(compile.s) - -$(CONFIG_OBJ_DIR)/%.o: %.s - $(compile.s) - - -#------------------------------------------------------------------------------ -# PATTERN RULES TO INTERMEDIATE FILES -#------------------------------------------------------------------------------ - -$(CONFIG_OBJ_DIR)/%.s: %.c - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CC) -S $(APP_CPPFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.s: %.cpp - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CXX) -S $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.s: %.cc - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CXX) -S $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.s: %.cxx - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CXX) -S $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.i: %.c - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CC) -E $(APP_CPPFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.i: %.cpp - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CXX) -E $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.i: %.cc - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CXX) -E $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.i: %.cxx - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CXX) -E $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< - - -#------------------------------------------------------------------------------ -# TARGET RULES -#------------------------------------------------------------------------------ - -.PHONY : help -help : - @$(ECHO) "Summary of Makefile targets" - @$(ECHO) " Build targets:" - @$(ECHO) " all (default) - Application and all libraries (including BSP)" - @$(ECHO) " bsp - Just the BSP" - @$(ECHO) " libs - All libraries (including BSP)" - @$(ECHO) " flash - All flash files" - @$(ECHO) " mem_init_generate - All memory initialization files" -ifeq ($(QSYS),1) - @$(ECHO) " mem_init_install - This target is deprecated for QSys Systems" - @$(ECHO) " --> Use the mem_init_generate target and then" - @$(ECHO) " add the generated meminit.qip file to your" - @$(ECHO) " Quartus II Project." -else # if QSYS != 1 - @$(ECHO) " mem_init_install - Copy memory initialization files to Quartus II project" -endif # QSYS == 1 - @$(ECHO) - @$(ECHO) " Clean targets:" - @$(ECHO) " clean_all - Application and all libraries (including BSP)" - @$(ECHO) " clean - Just the application" - @$(ECHO) " clean_bsp - Just the BSP" - @$(ECHO) " clean_libs - All libraries (including BSP)" - @$(ECHO) - @$(ECHO) " Run targets:" - @$(ECHO) " download-elf - Download and run your elf executable" - @$(ECHO) " program-flash - Program flash contents to the board" - -# Handy rule to skip making libraries and just make application. -.PHONY : app -app : $(ELF) - -ifeq ($(CREATE_OBJDUMP), 1) -app : $(OBJDUMP_NAME) -endif - -ifeq ($(CREATE_ELF_DERIVED_FILES),1) -app : elf_derived_files -endif - -.PHONY: elf_derived_files -elf_derived_files: default_mem_init - -# Handy rule for making just the BSP. -.PHONY : bsp -bsp : - @$(ECHO) Info: Building $(BSP_ROOT_DIR) - @$(MAKE) --no-print-directory -C $(BSP_ROOT_DIR) - - -# Make sure all makeable libraries (including the BSP) are up-to-date. -LIB_TARGETS := $(patsubst %,%-recurs-make-lib,$(MAKEABLE_LIBRARY_ROOT_DIRS)) - -.PHONY : libs -libs : $(LIB_TARGETS) - -ifneq ($(strip $(LIB_TARGETS)),) -$(LIB_TARGETS): %-recurs-make-lib: - @$(ECHO) Info: Building $* - $(MAKE) --no-print-directory -C $* -endif - -ifneq ($(strip $(APP_LDDEPS)),) -$(APP_LDDEPS): libs - @true -endif - -# Rules to force your project to rebuild or relink -# .force_relink file will cause any application that depends on this project to relink -# .force_rebuild file will cause this project to rebuild object files -# .force_rebuild_all file will cause this project and any project that depends on this project to rebuild object files - -FORCE_RELINK_DEP := .force_relink -FORCE_REBUILD_DEP := .force_rebuild -FORCE_REBUILD_ALL_DEP := .force_rebuild_all -FORCE_REBUILD_DEP_LIST := $(CONFIG_OBJ_DIR)/$(FORCE_RELINK_DEP) $(CONFIG_OBJ_DIR)/$(FORCE_REBUILD_DEP) $(FORCE_REBUILD_ALL_DEP) - -$(FORCE_REBUILD_DEP_LIST): - -$(APP_OBJS): $(wildcard $(CONFIG_OBJ_DIR)/$(FORCE_REBUILD_DEP)) $(wildcard $(addsuffix /$(FORCE_REBUILD_ALL_DEP), . $(ALT_LIBRARY_DIRS))) - -$(ELF): $(wildcard $(addsuffix /$(FORCE_RELINK_DEP), $(CONFIG_OBJ_DIR) $(ALT_LIBRARY_DIRS))) - - -# Clean just the application. -.PHONY : clean -ifeq ($(CREATE_ELF_DERIVED_FILES),1) -clean : clean_elf_derived_files -endif - -clean : - @$(RM) -r $(ELF) $(OBJDUMP_NAME) $(LINKER_MAP_NAME) $(OBJ_ROOT_DIR) $(RUNTIME_ROOT_DIR) $(FORCE_REBUILD_DEP_LIST) - @$(ECHO) [$(APP_NAME) clean complete] - -# Clean just the BSP. -.PHONY : clean_bsp -clean_bsp : - @$(ECHO) Info: Cleaning $(BSP_ROOT_DIR) - @$(MAKE) --no-print-directory -C $(BSP_ROOT_DIR) clean - -# Clean all makeable libraries including the BSP. -LIB_CLEAN_TARGETS := $(patsubst %,%-recurs-make-clean-lib,$(MAKEABLE_LIBRARY_ROOT_DIRS)) - -.PHONY : clean_libs -clean_libs : $(LIB_CLEAN_TARGETS) - -ifneq ($(strip $(LIB_CLEAN_TARGETS)),) -$(LIB_CLEAN_TARGETS): %-recurs-make-clean-lib: - @$(ECHO) Info: Cleaning $* - $(MAKE) --no-print-directory -C $* clean -endif - -.PHONY: clean_elf_derived_files -clean_elf_derived_files: mem_init_clean - -# Clean application and all makeable libraries including the BSP. -.PHONY : clean_all -clean_all : clean mem_init_clean clean_libs - -# Include the dependency files unless the make goal is performing a clean -# of the application. -ifneq ($(firstword $(MAKECMDGOALS)),clean) -ifneq ($(firstword $(MAKECMDGOALS)),clean_all) --include $(APP_DEPS) -endif -endif - -.PHONY : download-elf -download-elf : $(ELF) - @if [ "$(DOWNLOAD)" = "none" ]; \ - then \ - $(ECHO) Downloading $(ELF) not supported; \ - else \ - $(ECHO) Info: Downloading $(ELF); \ - $(DOWNLOAD) --go --cpu_name=$(CPU_NAME) $(DOWNLOAD_CABLE_FLAG) $(SOPC_SYSID_FLAG) $(DOWNLOAD_JDI_FLAG) $(WRITE_GMON_OPTION) $(ELF); \ - fi - -# Delete the target of a rule if it has changed and its commands exit -# with a nonzero exit status. -.DELETE_ON_ERROR: - -# Rules for flash programming commands -PROGRAM_FLASH_SUFFIX := -program -PROGRAM_FLASH_TARGET := $(addsuffix $(PROGRAM_FLASH_SUFFIX), $(FLASH_FILES)) - -.PHONY : program-flash -program-flash : $(PROGRAM_FLASH_TARGET) - -.PHONY : $(PROGRAM_FLASH_TARGET) -$(PROGRAM_FLASH_TARGET) : flash - @if [ "$(FLASHPROG)" = "none" ]; \ - then \ - $(ECHO) Programming flash not supported; \ - else \ - $(ECHO) Info: Programming $(basename $@).flash; \ - if [ -z "$($(basename $@)_EPCS_FLAGS)" ]; \ - then \ - $(ECHO) $(FLASHPROG) $(SOPC_SYSID_FLAG) --base=$($(basename $@)_START) $(basename $@).flash; \ - $(FLASHPROG) $(DOWNLOAD_CABLE_FLAG) $(SOPC_SYSID_FLAG) --base=$($(basename $@)_START) $(basename $@).flash; \ - else \ - $(ECHO) $(FLASHPROG) $(SOPC_SYSID_FLAG) --epcs --base=$($(basename $@)_START) $(basename $@).flash; \ - $(FLASHPROG) $(DOWNLOAD_CABLE_FLAG) $(SOPC_SYSID_FLAG) --epcs --base=$($(basename $@)_START) $(basename $@).flash; \ - fi \ - fi - - -# Rules for simulating with an HDL Simulator [QSYS only] -ifeq ($(QSYS),1) -IP_MAKE_SIMSCRIPT := ip-make-simscript - -ifeq ($(VSIM),) -VSIM_EXE := "$(if $(VSIM_DIR),$(VSIM_DIR)/,)vsim" -ifeq ($(ENABLE_VSIM_GUI),1) -VSIM := $(VSIM_EXE) -gui -else -VSIM := $(VSIM_EXE) -c -endif # ENABLE_VSIM_GUI == 1 -endif # VSIM not set - -ifeq ($(SPD),) -ifneq ($(ABS_QUARTUS_PROJECT_DIR),) -ifneq ($(SOPC_NAME),) -SPD := $(ABS_QUARTUS_PROJECT_DIR)/$(SOPC_NAME)_tb.spd -endif # SOPC_NAME set -endif # ABS_QUARTUS_PROJECT_DIR set -endif # SPD == empty string - -ifeq ($(MSIM_SCRIPT),) -SIM_SCRIPT_DIR := $(RUNTIME_ROOT_DIR)/sim -MSIM_SCRIPT := $(SIM_SCRIPT_DIR)/mentor/msim_setup.tcl -endif # MSIM_SCRIPT == empty string - -ifeq ($(MAKE_VERSION),3.81) -ABS_MEM_INIT_DESCRIPTOR_FILE := $(abspath $(MEM_INIT_DESCRIPTOR_FILE)) -else -ABS_MEM_INIT_DESCRIPTOR_FILE := $(call adjust-path-mixed,$(shell pwd))/$(MEM_INIT_DESCRIPTOR_FILE) -endif - -$(MSIM_SCRIPT): $(SPD) $(MEM_INIT_DESCRIPTOR_FILE) -ifeq ($(SPD),) - $(error No SPD file specified. Ensure QUARTUS_PROJECT_DIR variable is set) -endif - @$(MKDIR) $(SIM_SCRIPT_DIR) - $(IP_MAKE_SIMSCRIPT) --spd=$(SPD) --spd=$(MEM_INIT_DESCRIPTOR_FILE) --output-directory=$(SIM_SCRIPT_DIR) - -VSIM_COMMAND = \ - cd $(dir $(MSIM_SCRIPT)) && \ - $(VSIM) -do "do $(notdir $(MSIM_SCRIPT)); ld; $(if $(VSIM_RUN_TIME),run ${VSIM_RUN_TIME};quit;)" - -.PHONY: sim -sim: $(MSIM_SCRIPT) mem_init_generate -ifeq ($(MSIM_SCRIPT),) - $(error MSIM_SCRIPT not set) -endif - $(VSIM_COMMAND) - -endif # QSYS == 1 - - -#------------------------------------------------------------------------------ -# ELF TARGET RULE -#------------------------------------------------------------------------------ -# Rule for constructing the executable elf file. -$(ELF) : $(APP_OBJS) $(LINKER_SCRIPT) $(APP_LDDEPS) - @$(ECHO) Info: Linking $@ - $(LD) $(APP_LDFLAGS) $(APP_CFLAGS) -o $@ $(filter-out $(CRT0),$(APP_OBJS)) $(APP_LIBS) $(APP_BSP_DEP_LIBS) -ifneq ($(DISABLE_ELFPATCH),1) - $(ELFPATCH) $@ $(ELF_PATCH_FLAG) -endif -ifneq ($(DISABLE_STACKREPORT),1) - @bash -c "$(STACKREPORT) $@" -endif - -$(OBJDUMP_NAME) : $(ELF) - @$(ECHO) Info: Creating $@ - $(OBJDUMP) $(OBJDUMP_FLAGS) $< >$@ - -# Rule for printing the name of the elf file -.PHONY: print-elf-name -print-elf-name: - @$(ECHO) $(ELF) - - diff --git a/software/qsys_tutorial_lcd3/create-this-app b/software/qsys_tutorial_lcd3/create-this-app deleted file mode 100644 index 8cb9ebd..0000000 --- a/software/qsys_tutorial_lcd3/create-this-app +++ /dev/null @@ -1,114 +0,0 @@ -#!/bin/bash -# -# This script creates the hello_world application in this directory. - - -BSP_DIR=../qsys_tutorial_lcd3_bsp -QUARTUS_PROJECT_DIR=../../ -NIOS2_APP_GEN_ARGS="--elf-name qsys_tutorial_lcd3.elf --set OBJDUMP_INCLUDE_SOURCE 1 --src-files hello_world.c" - - -# First, check to see if $SOPC_KIT_NIOS2 environmental variable is set. -# This variable is required for the command line tools to execute correctly. -if [ -z "${SOPC_KIT_NIOS2}" ] -then - echo Required \$SOPC_KIT_NIOS2 Environmental Variable is not set! - exit 1 -fi - - -# Also make sure that the APP has not been created already. Check for -# existence of Makefile in the app directory -if [ -f ./Makefile ] -then - echo Application has already been created! Delete Makefile if you want to create a new application makefile - exit 1 -fi - - -# We are selecting hal_default bsp because it supports this application. -# Check to see if the hal_default has already been generated by checking for -# existence of the public.mk file. If not, we need to run -# create-this-bsp file to generate the bsp. -if [ ! -f ${BSP_DIR}/public.mk ]; then - # Since BSP doesn't exist, create the BSP - # Pass any command line arguments passed to this script to the BSP. - pushd ${BSP_DIR} >> /dev/null - ./create-this-bsp "$@" || { - echo "create-this-bsp failed" - exit 1 - } - popd >> /dev/null -fi - - -# Don't run make if create-this-app script is called with --no-make arg -SKIP_MAKE= -while [ $# -gt 0 ] -do - case "$1" in - --no-make) - SKIP_MAKE=1 - ;; - esac - shift -done - - -# Now we also need to go copy the sources for this application to the -# local directory. -find "${SOPC_KIT_NIOS2}/examples/software/hello_world/" -name '*.c' -or -name '*.h' -or -name 'hostfs*' | xargs -i cp -L {} ./ || { - echo "failed during copying example source files" - exit 1 -} - -find "${SOPC_KIT_NIOS2}/examples/software/hello_world/" -name 'readme.txt' -or -name 'Readme.txt' | xargs -i cp -L {} ./ || { - echo "failed copying readme file" -} - -if [ -d "${SOPC_KIT_NIOS2}/examples/software/hello_world/system" ] -then - cp -RL "${SOPC_KIT_NIOS2}/examples/software/hello_world/system" . || { - echo "failed during copying project support files" - exit 1 - } -fi - -chmod -R +w . || { - echo "failed during changing file permissions" - exit 1 -} - -cmd="nios2-app-generate-makefile --bsp-dir ${BSP_DIR} --set QUARTUS_PROJECT_DIR=${QUARTUS_PROJECT_DIR} ${NIOS2_APP_GEN_ARGS}" - -echo "create-this-app: Running \"${cmd}\"" -$cmd || { - echo "nios2-app-generate-makefile failed" - exit 1 -} - -if [ -z "$SKIP_MAKE" ]; then - cmd="make" - - echo "create-this-app: Running \"$cmd\"" - $cmd || { - echo "make failed" - exit 1 - } - - echo - echo "To download and run the application:" - echo " 1. Make sure the board is connected to the system." - echo " 2. Run 'nios2-configure-sof ' to configure the FPGA with the hardware design." - echo " 3. If you have a stdio device, run 'nios2-terminal' in a different shell." - echo " 4. Run 'make download-elf' from the application directory." - echo - echo "To debug the application:" - echo " Import the project into Nios II Software Build Tools for Eclipse." - echo " Refer to Nios II Software Build Tools for Eclipse Documentation for more information." - echo - echo -e "" -fi - - -exit 0 diff --git a/software/qsys_tutorial_lcd3/hello_world.c b/software/qsys_tutorial_lcd3/hello_world.c deleted file mode 100644 index 8645f46..0000000 --- a/software/qsys_tutorial_lcd3/hello_world.c +++ /dev/null @@ -1,31 +0,0 @@ -#include -#include -#include -#include "system.h" - -#define lcd_on (volatile char *) 0x00041010 -#define lcd_blon (volatile char *) 0x00041020 - - -int main() -{ - *lcd_on = 1; - *lcd_blon = 1; - printf("Hello from Nios II!\n"); - hello(); - return 0; -} - -void hello() { - FILE *pLCD; - char msg[] = "Hello\nWorld\n"; - - pLCD = fopen(LCD_16207_0_NAME, "w"); - if (pLCD) { - fwrite(msg, strlen(msg), 1, pLCD); - fclose(pLCD); - } else { - printf("failed to say Hello World\n"); - } - printf("end"); -} diff --git a/software/qsys_tutorial_lcd3/obj/default/hello_world.d b/software/qsys_tutorial_lcd3/obj/default/hello_world.d deleted file mode 100644 index 76ce20b..0000000 --- a/software/qsys_tutorial_lcd3/obj/default/hello_world.d +++ /dev/null @@ -1,6 +0,0 @@ -obj/default/hello_world.o: hello_world.c \ - ../qsys_tutorial_lcd3_bsp/system.h ../qsys_tutorial_lcd3_bsp/linker.h - -../qsys_tutorial_lcd3_bsp/system.h: - -../qsys_tutorial_lcd3_bsp/linker.h: diff --git a/software/qsys_tutorial_lcd3/obj/default/hello_world.o b/software/qsys_tutorial_lcd3/obj/default/hello_world.o deleted file mode 100644 index 5c0e2b8..0000000 --- a/software/qsys_tutorial_lcd3/obj/default/hello_world.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3/qsys_tutorial_lcd3.elf b/software/qsys_tutorial_lcd3/qsys_tutorial_lcd3.elf deleted file mode 100644 index 295a4ce..0000000 --- a/software/qsys_tutorial_lcd3/qsys_tutorial_lcd3.elf +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3/qsys_tutorial_lcd3.map b/software/qsys_tutorial_lcd3/qsys_tutorial_lcd3.map deleted file mode 100644 index 5bd1bd7..0000000 --- a/software/qsys_tutorial_lcd3/qsys_tutorial_lcd3.map +++ /dev/null @@ -1,2415 +0,0 @@ -Archive member included because of file (symbol) - -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fclose.o) - obj/default/hello_world.o (fclose) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fflush.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fclose.o) (_fflush_r) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-findfp.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fclose.o) (__sfp_lock_acquire) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fopen.o) - obj/default/hello_world.o (fopen) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-freer.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fclose.o) (_free_r) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fseek.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fopen.o) (_fseek_r) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fstatr.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fseek.o) (_fstat_r) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fwalk.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fflush.o) (_fwalk_reent) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fwrite.o) - obj/default/hello_world.o (fwrite) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-impure.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fclose.o) (_impure_ptr) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-int_errno.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fstatr.o) (errno) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-makebuf.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fseek.o) (__smakebuf_r) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-mallocr.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-findfp.o) (_malloc_r) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-memset.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-findfp.o) (memset) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-openr.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fopen.o) (_open_r) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-printf.o) - obj/default/hello_world.o (printf) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-puts.o) - obj/default/hello_world.o (puts) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-refill.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fseek.o) (__srefill_r) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-sbrkr.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-freer.o) (_sbrk_r) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-stdio.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-findfp.o) (__sclose) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-strlen.o) - obj/default/hello_world.o (strlen) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-vfprintf.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-printf.o) (___vfprintf_internal_r) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-writer.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-stdio.o) (_write_r) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-wsetup.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-vfprintf.o) (__swsetup_r) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-closer.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-stdio.o) (_close_r) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-dtoa.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-vfprintf.o) (_dtoa_r) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-flags.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fopen.o) (__sflags) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fvwrite.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fwrite.o) (__sfvwrite_r) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-isattyr.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-makebuf.o) (_isatty_r) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-locale.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-vfprintf.o) (_localeconv_r) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-lseekr.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-stdio.o) (_lseek_r) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-memchr.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-vfprintf.o) (memchr) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-memcpy.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-dtoa.o) (memcpy) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-memmove.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fvwrite.o) (memmove) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-mprec.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-dtoa.o) (_Bfree) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-readr.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-stdio.o) (_read_r) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-reallocr.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fvwrite.o) (_realloc_r) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-s_isinfd.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-vfprintf.o) (__isinfd) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-s_isnand.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-vfprintf.o) (__isnand) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-strcmp.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-locale.o) (strcmp) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-callocr.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-mprec.o) (_calloc_r) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_udivdi3.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-vfprintf.o) (__udivdi3) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_umoddi3.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-vfprintf.o) (__umoddi3) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_addsub_df.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-dtoa.o) (__subdf3) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_mul_df.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-dtoa.o) (__muldf3) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_div_df.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-dtoa.o) (__divdf3) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_eq_df.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-vfprintf.o) (__eqdf2) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_ne_df.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-vfprintf.o) (__nedf2) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_gt_df.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-dtoa.o) (__gtdf2) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_ge_df.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-dtoa.o) (__gedf2) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_lt_df.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-vfprintf.o) (__ltdf2) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_si_to_df.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-dtoa.o) (__floatsidf) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_df_to_si.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-dtoa.o) (__fixdfsi) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_thenan_df.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_addsub_df.o) (__thenan_df) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_usi_to_df.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-dtoa.o) (__floatunsidf) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-divmod.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-vfprintf.o) (__divsi3) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-mul.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-findfp.o) (__mulsi3) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_muldi3.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_mul_df.o) (__muldi3) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_clz.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_udivdi3.o) (__clz_tab) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_clzsi2.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_si_to_df.o) (__clzsi2) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_pack_df.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_addsub_df.o) (__pack_d) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_unpack_df.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_addsub_df.o) (__unpack_d) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_fpcmp_parts_df.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_eq_df.o) (__fpcmp_parts_d) -../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_close.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-closer.o) (close) -../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_dev.o) - ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_close.o) (alt_fd_list) -../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_errno.o) - ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_close.o) (alt_errno) -../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_fstat.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fstatr.o) (fstat) -../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_isatty.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-isattyr.o) (isatty) -../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_load.o) - ../qsys_tutorial_lcd3_bsp//obj/HAL/src/crt0.o (alt_load) -../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_lseek.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-lseekr.o) (lseek) -../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_main.o) - ../qsys_tutorial_lcd3_bsp//obj/HAL/src/crt0.o (alt_main) -../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_malloc_lock.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-freer.o) (__malloc_lock) -../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_open.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-openr.o) (open) -../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_read.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-readr.o) (read) -../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_release_fd.o) - ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_close.o) (alt_release_fd) -../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_sbrk.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-sbrkr.o) (sbrk) -../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_write.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-writer.o) (write) -../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_sys_init.o) - ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_main.o) (alt_irq_init) -../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_fd.o) - ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_sys_init.o) (altera_avalon_jtag_uart_read_fd) -../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_init.o) - ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_sys_init.o) (altera_avalon_jtag_uart_init) -../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_ioctl.o) - ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_fd.o) (altera_avalon_jtag_uart_ioctl) -../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_read.o) - ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_fd.o) (altera_avalon_jtag_uart_read) -../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_write.o) - ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_fd.o) (altera_avalon_jtag_uart_write) -../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_lcd_16207.o) - ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_sys_init.o) (altera_avalon_lcd_16207_init) -../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_lcd_16207_fd.o) - ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_sys_init.o) (altera_avalon_lcd_16207_write_fd) -../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_alarm_start.o) - ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_init.o) (alt_alarm_start) -../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_load.o) (alt_dcache_flush_all) -../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_dev_llist_insert.o) - ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_sys_init.o) (alt_dev_llist_insert) -../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_do_ctors.o) - ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_main.o) (_do_ctors) -../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_do_dtors.o) - ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_main.o) (_do_dtors) -../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_find_dev.o) - ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_open.o) (alt_find_dev) -../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_find_file.o) - ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_open.o) (alt_find_file) -../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_get_fd.o) - ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_open.o) (alt_get_fd) -../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_load.o) (alt_icache_flush_all) -../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_iic.o) - ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_init.o) (alt_ic_isr_register) -../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_iic_isr_register.o) - ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_iic.o) (alt_iic_isr_register) -../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_io_redirect.o) - ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_main.o) (alt_io_redirect) -../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_irq_entry.o) - ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_iic_isr_register.o) (alt_irq_entry) -../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_irq_handler.o) - ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_iic_isr_register.o) (alt_irq_handler) -../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_irq_vars.o) - ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_iic.o) (alt_irq_active) -../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_tick.o) - ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_init.o) (_alt_tick_rate) -../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_usleep.o) - ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_lcd_16207.o) (usleep) -../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_sys_init.o) (altera_nios2_qsys_irq_init) -../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_busy_sleep.o) - ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_usleep.o) (alt_busy_sleep) -../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_exception_entry.o) - ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_irq_entry.o) (alt_exception) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-atexit.o) - ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_main.o) (atexit) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-ctype_.o) - ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_lcd_16207.o) (__ctype_ptr) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-exit.o) - ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_main.o) (exit) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-memcmp.o) - ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_find_dev.o) (memcmp) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-__atexit.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-atexit.o) (__register_exitproc) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-__call_atexit.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-exit.o) (__call_exitprocs) -../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_exit.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-exit.o) (_exit) - -Allocating common symbols -Common symbol size file - -alt_irq 0x100 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_irq_handler.o) -errno 0x4 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-int_errno.o) -_atexit0 0x190 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-atexit.o) - -Memory Configuration - -Name Origin Length Attributes -reset 0x00000000 0x00000020 -onchip_memory 0x00000020 0x00031fe0 -*default* 0x00000000 0xffffffff - -Linker script and memory map - -LOAD ../qsys_tutorial_lcd3_bsp//obj/HAL/src/crt0.o -LOAD obj/default/hello_world.o -LOAD c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libstdc++.a -LOAD c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libm.a -LOAD c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a -START GROUP -LOAD c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a -LOAD c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a -LOAD ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a -END GROUP -LOAD c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a - 0x00000000 __alt_mem_onchip_memory = 0x0 - -.entry 0x00000000 0x20 - *(.entry) - .entry 0x00000000 0x20 ../qsys_tutorial_lcd3_bsp//obj/HAL/src/crt0.o - 0x00000000 __reset - -.exceptions 0x00000020 0x194 - 0x00000020 PROVIDE (__ram_exceptions_start, ABSOLUTE (.)) - 0x00000020 . = ALIGN (0x20) - *(.irq) - *(.exceptions.entry.label) - .exceptions.entry.label - 0x00000020 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_irq_entry.o) - 0x00000020 alt_irq_entry - .exceptions.entry.label - 0x00000020 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_exception_entry.o) - 0x00000020 alt_exception - *(.exceptions.entry.user) - *(.exceptions.entry) - .exceptions.entry - 0x00000020 0x54 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_exception_entry.o) - *(.exceptions.irqtest.user) - *(.exceptions.irqtest) - .exceptions.irqtest - 0x00000074 0x10 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_irq_entry.o) - *(.exceptions.irqhandler.user) - *(.exceptions.irqhandler) - .exceptions.irqhandler - 0x00000084 0x4 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_irq_entry.o) - *(.exceptions.irqreturn.user) - *(.exceptions.irqreturn) - .exceptions.irqreturn - 0x00000088 0x4 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_irq_entry.o) - *(.exceptions.notirq.label) - .exceptions.notirq.label - 0x0000008c 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_irq_entry.o) - *(.exceptions.notirq.user) - *(.exceptions.notirq) - .exceptions.notirq - 0x0000008c 0x8 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_exception_entry.o) - *(.exceptions.soft.user) - *(.exceptions.soft) - *(.exceptions.unknown.user) - *(.exceptions.unknown) - .exceptions.unknown - 0x00000094 0x4 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_exception_entry.o) - *(.exceptions.exit.label) - .exceptions.exit.label - 0x00000098 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_irq_entry.o) - .exceptions.exit.label - 0x00000098 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_exception_entry.o) - *(.exceptions.exit.user) - *(.exceptions.exit) - .exceptions.exit - 0x00000098 0x54 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_exception_entry.o) - *(.exceptions) - .exceptions 0x000000ec 0xc8 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_irq_handler.o) - 0x000000ec alt_irq_handler - 0x000001b4 PROVIDE (__ram_exceptions_end, ABSOLUTE (.)) - 0x00000020 PROVIDE (__flash_exceptions_start, LOADADDR (.exceptions)) - -.text 0x000001b4 0xdfa8 - 0x000001b4 PROVIDE (stext, ABSOLUTE (.)) - *(.interp) - *(.hash) - *(.dynsym) - *(.dynstr) - *(.gnu.version) - *(.gnu.version_d) - *(.gnu.version_r) - *(.rel.init) - *(.rela.init) - *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) - *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) - *(.rel.fini) - *(.rela.fini) - *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) - *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) - *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) - *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) - *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) - *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) - *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) - *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) - *(.rel.ctors) - *(.rela.ctors) - *(.rel.dtors) - *(.rela.dtors) - *(.rel.got) - *(.rela.got) - *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) - *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) - *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) - *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) - *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) - *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) - *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) - *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) - *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) - *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) - *(.rel.plt) - *(.rela.plt) - *(.rel.dyn) - *(.init) - *(.plt) - *(.text .stub .text.* .gnu.linkonce.t.*) - .text 0x000001b4 0x3c ../qsys_tutorial_lcd3_bsp//obj/HAL/src/crt0.o - 0x000001b4 _start - .text 0x000001f0 0x108 obj/default/hello_world.o - 0x000001f0 main - 0x00000248 hello - .text 0x000002f8 0x124 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fclose.o) - 0x000002f8 _fclose_r - 0x00000408 fclose - .text 0x0000041c 0x230 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fflush.o) - 0x0000041c _fflush_r - 0x00000618 fflush - .text 0x0000064c 0x2f4 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-findfp.o) - 0x000006a4 __sfp_lock_acquire - 0x000006a8 __sfp_lock_release - 0x000006ac __sinit_lock_acquire - 0x000006b0 __sinit_lock_release - 0x000006b4 __sinit - 0x00000768 __fp_unlock_all - 0x00000780 __fp_lock_all - 0x00000798 _cleanup_r - 0x000007a4 _cleanup - 0x000007b4 __sfmoreglue - 0x00000850 __sfp - .text 0x00000940 0x110 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fopen.o) - 0x00000940 _fopen_r - 0x00000a34 fopen - .text 0x00000a50 0x440 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-freer.o) - 0x00000a50 _malloc_trim_r - 0x00000b7c _free_r - .text 0x00000e90 0x460 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fseek.o) - 0x00000e90 _fseek_r - 0x000012cc fseek - .text 0x000012f0 0x74 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fstatr.o) - 0x000012f0 _fstat_r - .text 0x00001364 0x180 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fwalk.o) - 0x00001364 _fwalk_reent - 0x0000142c _fwalk - .text 0x000014e4 0xec c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fwrite.o) - 0x000014e4 _fwrite_r - 0x00001590 fwrite - .text 0x000015d0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-impure.o) - .text 0x000015d0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-int_errno.o) - .text 0x000015d0 0x194 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-makebuf.o) - 0x000015d0 __smakebuf_r - .text 0x00001764 0x740 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-mallocr.o) - 0x00001764 _malloc_r - .text 0x00001ea4 0x98 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-memset.o) - 0x00001ea4 memset - .text 0x00001f3c 0x78 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-openr.o) - 0x00001f3c _open_r - .text 0x00001fb4 0x78 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-printf.o) - 0x00001fb4 printf - 0x00001ff8 _printf_r - .text 0x0000202c 0xb4 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-puts.o) - 0x0000202c _puts_r - 0x000020cc puts - .text 0x000020e0 0x1e0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-refill.o) - 0x000020e0 __srefill_r - .text 0x000022c0 0x70 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-sbrkr.o) - 0x000022c0 _sbrk_r - .text 0x00002330 0x14c c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-stdio.o) - 0x00002330 __sclose - 0x00002338 __sseek - 0x000023a0 __swrite - 0x0000241c __sread - .text 0x0000247c 0x74 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-strlen.o) - 0x0000247c strlen - .text 0x000024f0 0x1f40 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-vfprintf.o) - 0x00002548 ___vfprintf_internal_r - 0x0000440c __vfprintf_internal - .text 0x00004430 0x78 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-writer.o) - 0x00004430 _write_r - .text 0x000044a8 0x13c c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-wsetup.o) - 0x000044a8 __swsetup_r - .text 0x000045e4 0x70 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-closer.o) - 0x000045e4 _close_r - .text 0x00004654 0x17f8 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-dtoa.o) - 0x00004898 _dtoa_r - .text 0x00005e4c 0xa0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-flags.o) - 0x00005e4c __sflags - .text 0x00005eec 0x49c c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fvwrite.o) - 0x00005eec __sfvwrite_r - .text 0x00006388 0x70 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-isattyr.o) - 0x00006388 _isatty_r - .text 0x000063f8 0xc4 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-locale.o) - 0x000063f8 __locale_charset - 0x00006400 _localeconv_r - 0x0000640c localeconv - 0x0000641c _setlocale_r - 0x000064a0 setlocale - .text 0x000064bc 0x78 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-lseekr.o) - 0x000064bc _lseek_r - .text 0x00006534 0xe4 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-memchr.o) - 0x00006534 memchr - .text 0x00006618 0xa0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-memcpy.o) - 0x00006618 memcpy - .text 0x000066b8 0xe0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-memmove.o) - 0x000066b8 memmove - .text 0x00006798 0x108c c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-mprec.o) - 0x00006798 _Bfree - 0x000067c0 __hi0bits - 0x00006830 __lo0bits - 0x000068f4 __mcmp - 0x00006954 __ulp - 0x000069d4 __b2d - 0x00006af4 __ratio - 0x00006ba4 _mprec_log10 - 0x00006c38 __copybits - 0x00006c90 __any_on - 0x00006d18 _Balloc - 0x00006dd4 __d2b - 0x00006f50 __mdiff - 0x000070dc __lshift - 0x00007228 __multiply - 0x0000747c __i2b - 0x000074b8 __multadd - 0x000075e4 __pow5mult - 0x00007704 __s2b - .text 0x00007824 0x78 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-readr.o) - 0x00007824 _read_r - .text 0x0000789c 0x5f4 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-reallocr.o) - 0x0000789c _realloc_r - .text 0x00007e90 0x40 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-s_isinfd.o) - 0x00007e90 __isinfd - .text 0x00007ed0 0x30 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-s_isnand.o) - 0x00007ed0 __isnand - .text 0x00007f00 0xbc c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-strcmp.o) - 0x00007f00 strcmp - .text 0x00007fbc 0xc8 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-callocr.o) - 0x00007fbc _calloc_r - .text 0x00008084 0x66c c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_udivdi3.o) - 0x00008084 __udivdi3 - .text 0x000086f0 0x660 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_umoddi3.o) - 0x000086f0 __umoddi3 - .text 0x00008d50 0x504 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_addsub_df.o) - 0x00009160 __subdf3 - 0x000091e0 __adddf3 - .text 0x00009254 0x3c4 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_mul_df.o) - 0x00009254 __muldf3 - .text 0x00009618 0x258 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_div_df.o) - 0x00009618 __divdf3 - .text 0x00009870 0x88 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_eq_df.o) - 0x00009870 __eqdf2 - .text 0x000098f8 0x88 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_ne_df.o) - 0x000098f8 __nedf2 - .text 0x00009980 0x88 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_gt_df.o) - 0x00009980 __gtdf2 - .text 0x00009a08 0x88 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_ge_df.o) - 0x00009a08 __gedf2 - .text 0x00009a90 0x88 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_lt_df.o) - 0x00009a90 __ltdf2 - .text 0x00009b18 0xf8 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_si_to_df.o) - 0x00009b18 __floatsidf - .text 0x00009c10 0xd8 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_df_to_si.o) - 0x00009c10 __fixdfsi - .text 0x00009ce8 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_thenan_df.o) - .text 0x00009ce8 0x194 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_usi_to_df.o) - 0x00009ce8 __floatunsidf - .text 0x00009e7c 0x14c c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-divmod.o) - 0x00009ef8 __divsi3 - 0x00009f58 __modsi3 - 0x00009fb8 __udivsi3 - 0x00009fc0 __umodsi3 - .text 0x00009fc8 0x38 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-mul.o) - 0x00009fc8 __mulsi3 - .text 0x0000a000 0x124 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_muldi3.o) - 0x0000a000 __muldi3 - .text 0x0000a124 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_clz.o) - .text 0x0000a124 0x80 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_clzsi2.o) - 0x0000a124 __clzsi2 - .text 0x0000a1a4 0x314 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_pack_df.o) - 0x0000a1a4 __pack_d - .text 0x0000a4b8 0x138 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_unpack_df.o) - 0x0000a4b8 __unpack_d - .text 0x0000a5f0 0xc8 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_fpcmp_parts_df.o) - 0x0000a5f0 __fpcmp_parts_d - .text 0x0000a6b8 0x160 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_close.o) - 0x0000a6b8 close - .text 0x0000a818 0x2c ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_dev.o) - .text 0x0000a844 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_errno.o) - .text 0x0000a844 0x138 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_fstat.o) - 0x0000a844 fstat - .text 0x0000a97c 0x124 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_isatty.o) - 0x0000a97c isatty - .text 0x0000aaa0 0xec ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_load.o) - 0x0000aaa0 alt_load - .text 0x0000ab8c 0x154 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_lseek.o) - 0x0000ab8c lseek - .text 0x0000ace0 0x6c ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_main.o) - 0x0000ace0 alt_main - .text 0x0000ad4c 0x40 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_malloc_lock.o) - 0x0000ad4c __malloc_lock - 0x0000ad6c __malloc_unlock - .text 0x0000ad8c 0x2e4 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_open.o) - 0x0000ae84 open - .text 0x0000b070 0x184 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_read.o) - 0x0000b070 read - .text 0x0000b1f4 0x78 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_release_fd.o) - 0x0000b1f4 alt_release_fd - .text 0x0000b26c 0xbc ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_sbrk.o) - 0x0000b26c sbrk - .text 0x0000b328 0x184 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_write.o) - 0x0000b328 write - .text 0x0000b4ac 0xc8 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_sys_init.o) - 0x0000b4ac alt_irq_init - 0x0000b4e0 alt_sys_init - .text 0x0000b574 0x148 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_fd.o) - 0x0000b574 altera_avalon_jtag_uart_read_fd - 0x0000b5cc altera_avalon_jtag_uart_write_fd - 0x0000b624 altera_avalon_jtag_uart_close_fd - 0x0000b66c altera_avalon_jtag_uart_ioctl_fd - .text 0x0000b6bc 0x40c ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_init.o) - 0x0000b6bc altera_avalon_jtag_uart_init - 0x0000ba54 altera_avalon_jtag_uart_close - .text 0x0000bac8 0xf4 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_ioctl.o) - 0x0000bac8 altera_avalon_jtag_uart_ioctl - .text 0x0000bbbc 0x224 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_read.o) - 0x0000bbbc altera_avalon_jtag_uart_read - .text 0x0000bde0 0x240 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_write.o) - 0x0000bde0 altera_avalon_jtag_uart_write - .text 0x0000c020 0xf80 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_lcd_16207.o) - 0x0000c85c altera_avalon_lcd_16207_write - 0x0000ce64 altera_avalon_lcd_16207_init - .text 0x0000cfa0 0x58 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_lcd_16207_fd.o) - 0x0000cfa0 altera_avalon_lcd_16207_write_fd - .text 0x0000cff8 0x154 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_alarm_start.o) - 0x0000cff8 alt_alarm_start - .text 0x0000d14c 0x1c ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - 0x0000d14c alt_dcache_flush_all - .text 0x0000d168 0x114 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_dev_llist_insert.o) - 0x0000d168 alt_dev_llist_insert - .text 0x0000d27c 0x64 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_do_ctors.o) - 0x0000d27c _do_ctors - .text 0x0000d2e0 0x64 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_do_dtors.o) - 0x0000d2e0 _do_dtors - .text 0x0000d344 0x94 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_find_dev.o) - 0x0000d344 alt_find_dev - .text 0x0000d3d8 0x120 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_find_file.o) - 0x0000d3d8 alt_find_file - .text 0x0000d4f8 0xd0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_get_fd.o) - 0x0000d4f8 alt_get_fd - .text 0x0000d5c8 0x1c ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - 0x0000d5c8 alt_icache_flush_all - .text 0x0000d5e4 0x1d4 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_iic.o) - 0x0000d5e4 alt_ic_isr_register - 0x0000d634 alt_ic_irq_enable - 0x0000d6d0 alt_ic_irq_disable - 0x0000d770 alt_ic_irq_enabled - .text 0x0000d7b8 0xf8 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_iic_isr_register.o) - 0x0000d7b8 alt_iic_isr_register - .text 0x0000d8b0 0x150 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_io_redirect.o) - 0x0000d988 alt_io_redirect - .text 0x0000da00 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_irq_entry.o) - .text 0x0000da00 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_irq_handler.o) - .text 0x0000da00 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_irq_vars.o) - .text 0x0000da00 0x1a4 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_tick.o) - 0x0000da00 alt_alarm_stop - 0x0000da98 alt_tick - .text 0x0000dba4 0x30 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_usleep.o) - 0x0000dba4 usleep - .text 0x0000dbd4 0x20 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - 0x0000dbd4 altera_nios2_qsys_irq_init - .text 0x0000dbf4 0x15c ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_busy_sleep.o) - 0x0000dbf4 alt_busy_sleep - .text 0x0000dd50 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_exception_entry.o) - .text 0x0000dd50 0x14 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-atexit.o) - 0x0000dd50 atexit - .text 0x0000dd64 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-ctype_.o) - .text 0x0000dd64 0x38 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-exit.o) - 0x0000dd64 exit - .text 0x0000dd9c 0x74 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-memcmp.o) - 0x0000dd9c memcmp - .text 0x0000de10 0x134 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-__atexit.o) - 0x0000de10 __register_exitproc - .text 0x0000df44 0x1b4 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-__call_atexit.o) - 0x0000df48 __call_exitprocs - .text 0x0000e0f8 0x60 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_exit.o) - 0x0000e138 _exit - *(.gnu.warning.*) - *(.fini) - 0x0000e158 PROVIDE (__etext, ABSOLUTE (.)) - 0x0000e158 PROVIDE (_etext, ABSOLUTE (.)) - 0x0000e158 PROVIDE (etext, ABSOLUTE (.)) - *(.eh_frame_hdr) - 0x0000e158 . = ALIGN (0x4) - 0x0000e158 PROVIDE (__preinit_array_start, ABSOLUTE (.)) - *(.preinit_array) - 0x0000e158 PROVIDE (__preinit_array_end, ABSOLUTE (.)) - 0x0000e158 PROVIDE (__init_array_start, ABSOLUTE (.)) - *(.init_array) - 0x0000e158 PROVIDE (__init_array_end, ABSOLUTE (.)) - 0x0000e158 PROVIDE (__fini_array_start, ABSOLUTE (.)) - *(.fini_array) - 0x0000e158 PROVIDE (__fini_array_end, ABSOLUTE (.)) - *(.eh_frame) - *(.gcc_except_table) - *(.dynamic) - 0x0000e158 PROVIDE (__CTOR_LIST__, ABSOLUTE (.)) - *(.ctors) - *(SORT(.ctors.*)) - .ctors.65535 0x0000e158 0x4 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-__call_atexit.o) - 0x0000e15c PROVIDE (__CTOR_END__, ABSOLUTE (.)) - 0x0000e15c PROVIDE (__DTOR_LIST__, ABSOLUTE (.)) - *(.dtors) - *(SORT(.dtors.*)) - 0x0000e15c PROVIDE (__DTOR_END__, ABSOLUTE (.)) - *(.jcr) - 0x0000e15c . = ALIGN (0x4) - -.rodata 0x0000e15c 0x630 - 0x0000e15c PROVIDE (__ram_rodata_start, ABSOLUTE (.)) - 0x0000e15c . = ALIGN (0x4) - *(.rodata .rodata.* .gnu.linkonce.r.*) - .rodata 0x0000e15c 0x5c obj/default/hello_world.o - .rodata.str1.4 - 0x0000e1b8 0x2 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-impure.o) - 0x4 (size before relaxing) - *fill* 0x0000e1ba 0x2 00 - .rodata.str1.4 - 0x0000e1bc 0x2 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-puts.o) - 0x4 (size before relaxing) - *fill* 0x0000e1be 0x2 00 - .rodata.str1.4 - 0x0000e1c0 0x5e c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-vfprintf.o) - 0x60 (size before relaxing) - .rodata 0x0000e21e 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-vfprintf.o) - *fill* 0x0000e23e 0x2 00 - .rodata.str1.4 - 0x0000e240 0x10 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-dtoa.o) - 0x14 (size before relaxing) - .rodata.str1.4 - 0x0000e250 0x10 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-locale.o) - 0x18 (size before relaxing) - .rodata 0x0000e260 0x30 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-locale.o) - .rodata 0x0000e290 0x124 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-mprec.o) - 0x0000e290 __mprec_tens - 0x0000e358 __mprec_bigtens - 0x0000e380 __mprec_tinytens - .rodata 0x0000e3b4 0x14 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_thenan_df.o) - 0x0000e3b4 __thenan_df - .rodata 0x0000e3c8 0x100 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_clz.o) - 0x0000e3c8 __clz_tab - .rodata 0x0000e4c8 0xc ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_dev.o) - .rodata 0x0000e4d4 0x10 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_main.o) - .rodata 0x0000e4e4 0x24 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_sys_init.o) - .rodata 0x0000e508 0x281 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-ctype_.o) - 0x0000e508 _ctype_ - *(.rodata1) - 0x0000e78c . = ALIGN (0x4) - *fill* 0x0000e789 0x3 00 - 0x0000e78c PROVIDE (__ram_rodata_end, ABSOLUTE (.)) - 0x0000e15c PROVIDE (__flash_rodata_start, LOADADDR (.rodata)) - -.rwdata 0x0000e78c 0x1b84 load address 0x00010310 - 0x0000e78c PROVIDE (__ram_rwdata_start, ABSOLUTE (.)) - 0x0000e78c . = ALIGN (0x4) - *(.got.plt) - *(.got) - *(.data1) - *(.data .data.* .gnu.linkonce.d.*) - .data 0x0000e78c 0x0 ../qsys_tutorial_lcd3_bsp//obj/HAL/src/crt0.o - .data 0x0000e78c 0x0 obj/default/hello_world.o - .data 0x0000e78c 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fclose.o) - .data 0x0000e78c 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fflush.o) - .data 0x0000e78c 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-findfp.o) - .data 0x0000e78c 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fopen.o) - .data 0x0000e78c 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-freer.o) - .data 0x0000e78c 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fseek.o) - .data 0x0000e78c 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fstatr.o) - .data 0x0000e78c 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fwalk.o) - .data 0x0000e78c 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fwrite.o) - .data 0x0000e78c 0x400 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-impure.o) - .data 0x0000eb8c 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-int_errno.o) - .data 0x0000eb8c 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-makebuf.o) - .data 0x0000eb8c 0x408 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-mallocr.o) - 0x0000eb8c __malloc_av_ - .data 0x0000ef94 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-memset.o) - .data 0x0000ef94 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-openr.o) - .data 0x0000ef94 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-printf.o) - .data 0x0000ef94 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-puts.o) - .data 0x0000ef94 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-refill.o) - .data 0x0000ef94 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-sbrkr.o) - .data 0x0000ef94 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-stdio.o) - .data 0x0000ef94 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-strlen.o) - .data 0x0000ef94 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-vfprintf.o) - .data 0x0000ef94 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-writer.o) - .data 0x0000ef94 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-wsetup.o) - .data 0x0000ef94 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-closer.o) - .data 0x0000ef94 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-dtoa.o) - .data 0x0000ef94 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-flags.o) - .data 0x0000ef94 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fvwrite.o) - .data 0x0000ef94 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-isattyr.o) - .data 0x0000ef94 0xc c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-locale.o) - 0x0000ef94 __lc_ctype - .data 0x0000efa0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-lseekr.o) - .data 0x0000efa0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-memchr.o) - .data 0x0000efa0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-memcpy.o) - .data 0x0000efa0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-memmove.o) - .data 0x0000efa0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-mprec.o) - .data 0x0000efa0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-readr.o) - .data 0x0000efa0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-reallocr.o) - .data 0x0000efa0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-s_isinfd.o) - .data 0x0000efa0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-s_isnand.o) - .data 0x0000efa0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-strcmp.o) - .data 0x0000efa0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-callocr.o) - .data 0x0000efa0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_udivdi3.o) - .data 0x0000efa0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_umoddi3.o) - .data 0x0000efa0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_addsub_df.o) - .data 0x0000efa0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_mul_df.o) - .data 0x0000efa0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_div_df.o) - .data 0x0000efa0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_eq_df.o) - .data 0x0000efa0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_ne_df.o) - .data 0x0000efa0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_gt_df.o) - .data 0x0000efa0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_ge_df.o) - .data 0x0000efa0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_lt_df.o) - .data 0x0000efa0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_si_to_df.o) - .data 0x0000efa0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_df_to_si.o) - .data 0x0000efa0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_thenan_df.o) - .data 0x0000efa0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_usi_to_df.o) - .data 0x0000efa0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-divmod.o) - .data 0x0000efa0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-mul.o) - .data 0x0000efa0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_muldi3.o) - .data 0x0000efa0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_clz.o) - .data 0x0000efa0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_clzsi2.o) - .data 0x0000efa0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_pack_df.o) - .data 0x0000efa0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_unpack_df.o) - .data 0x0000efa0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_fpcmp_parts_df.o) - .data 0x0000efa0 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_close.o) - .data 0x0000efa0 0x1a8 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_dev.o) - 0x0000efa0 alt_dev_null - 0x0000efc8 alt_fd_list - .data 0x0000f148 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_errno.o) - .data 0x0000f148 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_fstat.o) - .data 0x0000f148 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_isatty.o) - .data 0x0000f148 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_load.o) - .data 0x0000f148 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_lseek.o) - .data 0x0000f148 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_main.o) - .data 0x0000f148 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_malloc_lock.o) - .data 0x0000f148 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_open.o) - .data 0x0000f148 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_read.o) - .data 0x0000f148 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_release_fd.o) - .data 0x0000f148 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_sbrk.o) - .data 0x0000f148 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_write.o) - .data 0x0000f148 0x1180 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_sys_init.o) - .data 0x000102c8 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_fd.o) - .data 0x000102c8 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_init.o) - .data 0x000102c8 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_ioctl.o) - .data 0x000102c8 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_read.o) - .data 0x000102c8 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_write.o) - .data 0x000102c8 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_lcd_16207.o) - .data 0x000102c8 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_lcd_16207_fd.o) - .data 0x000102c8 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_alarm_start.o) - .data 0x000102c8 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .data 0x000102c8 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_dev_llist_insert.o) - .data 0x000102c8 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_do_ctors.o) - .data 0x000102c8 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_do_dtors.o) - .data 0x000102c8 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_find_dev.o) - .data 0x000102c8 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_find_file.o) - .data 0x000102c8 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_get_fd.o) - .data 0x000102c8 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .data 0x000102c8 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_iic.o) - .data 0x000102c8 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_iic_isr_register.o) - .data 0x000102c8 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_io_redirect.o) - .data 0x000102c8 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_irq_entry.o) - .data 0x000102c8 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_irq_handler.o) - .data 0x000102c8 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_irq_vars.o) - .data 0x000102c8 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_tick.o) - .data 0x000102c8 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_usleep.o) - .data 0x000102c8 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - .data 0x000102c8 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_busy_sleep.o) - .data 0x000102c8 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_exception_entry.o) - .data 0x000102c8 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-atexit.o) - .data 0x000102c8 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-ctype_.o) - .data 0x000102c8 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-exit.o) - .data 0x000102c8 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-memcmp.o) - .data 0x000102c8 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-__atexit.o) - .data 0x000102c8 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-__call_atexit.o) - .data 0x000102c8 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_exit.o) - 0x000182c8 _gp = ABSOLUTE ((. + 0x8000)) - 0x000182c8 PROVIDE (gp, _gp) - *(.rwdata .rwdata.*) - *(.sdata .sdata.* .gnu.linkonce.s.*) - .sdata 0x000102c8 0x8 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-impure.o) - 0x000102c8 _impure_ptr - 0x000102cc _global_impure_ptr - .sdata 0x000102d0 0x8 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-mallocr.o) - 0x000102d0 __malloc_trim_threshold - 0x000102d4 __malloc_sbrk_base - .sdata 0x000102d8 0x8 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-locale.o) - 0x000102d8 __mb_cur_max - .sdata 0x000102e0 0x14 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_dev.o) - 0x000102e0 alt_fs_list - 0x000102e8 alt_dev_list - 0x000102f0 alt_max_fd - .sdata 0x000102f4 0x4 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_errno.o) - 0x000102f4 alt_errno - .sdata 0x000102f8 0x4 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_sbrk.o) - .sdata 0x000102fc 0x4 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_lcd_16207.o) - .sdata 0x00010300 0x4 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_irq_vars.o) - 0x00010300 alt_priority_mask - .sdata 0x00010304 0x8 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_tick.o) - 0x00010304 alt_alarm_list - .sdata 0x0001030c 0x4 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-ctype_.o) - 0x0001030c __ctype_ptr - *(.sdata2 .sdata2.* .gnu.linkonce.s2.*) - 0x00010310 . = ALIGN (0x4) - 0x00010310 _edata = ABSOLUTE (.) - 0x00010310 PROVIDE (edata, ABSOLUTE (.)) - 0x00010310 PROVIDE (__ram_rwdata_end, ABSOLUTE (.)) - 0x00010310 PROVIDE (__flash_rwdata_start, LOADADDR (.rwdata)) - -.bss 0x00011e94 0x2ec - 0x00011e94 __bss_start = ABSOLUTE (.) - 0x00011e94 PROVIDE (__sbss_start, ABSOLUTE (.)) - 0x00011e94 PROVIDE (___sbss_start, ABSOLUTE (.)) - *(.dynsbss) - *(.sbss .sbss.* .gnu.linkonce.sb.*) - .sbss 0x00011e94 0x4 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-int_errno.o) - 0x00011e94 errno - .sbss 0x00011e98 0xc c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-mallocr.o) - 0x00011e98 __malloc_top_pad - 0x00011e9c __malloc_max_sbrked_mem - 0x00011ea0 __malloc_max_total_mem - .sbss 0x00011ea4 0xc c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-locale.o) - 0x00011ea4 __nlocale_changed - 0x00011ea8 __mlocale_changed - 0x00011eac _PathLocale - .sbss 0x00011eb0 0xc ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_main.o) - 0x00011eb0 alt_argc - 0x00011eb4 alt_argv - 0x00011eb8 alt_envp - .sbss 0x00011ebc 0x4 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_irq_vars.o) - 0x00011ebc alt_irq_active - .sbss 0x00011ec0 0x8 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_tick.o) - 0x00011ec0 _alt_tick_rate - 0x00011ec4 _alt_nticks - *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) - *(.scommon) - 0x00011ec8 PROVIDE (__sbss_end, ABSOLUTE (.)) - 0x00011ec8 PROVIDE (___sbss_end, ABSOLUTE (.)) - *(.dynbss) - *(.bss .bss.* .gnu.linkonce.b.*) - .bss 0x00011ec8 0x0 ../qsys_tutorial_lcd3_bsp//obj/HAL/src/crt0.o - .bss 0x00011ec8 0x0 obj/default/hello_world.o - .bss 0x00011ec8 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fclose.o) - .bss 0x00011ec8 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fflush.o) - .bss 0x00011ec8 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-findfp.o) - .bss 0x00011ec8 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fopen.o) - .bss 0x00011ec8 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-freer.o) - .bss 0x00011ec8 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fseek.o) - .bss 0x00011ec8 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fstatr.o) - .bss 0x00011ec8 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fwalk.o) - .bss 0x00011ec8 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fwrite.o) - .bss 0x00011ec8 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-impure.o) - .bss 0x00011ec8 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-int_errno.o) - .bss 0x00011ec8 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-makebuf.o) - .bss 0x00011ec8 0x28 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-mallocr.o) - 0x00011ec8 __malloc_current_mallinfo - .bss 0x00011ef0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-memset.o) - .bss 0x00011ef0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-openr.o) - .bss 0x00011ef0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-printf.o) - .bss 0x00011ef0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-puts.o) - .bss 0x00011ef0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-refill.o) - .bss 0x00011ef0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-sbrkr.o) - .bss 0x00011ef0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-stdio.o) - .bss 0x00011ef0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-strlen.o) - .bss 0x00011ef0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-vfprintf.o) - .bss 0x00011ef0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-writer.o) - .bss 0x00011ef0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-wsetup.o) - .bss 0x00011ef0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-closer.o) - .bss 0x00011ef0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-dtoa.o) - .bss 0x00011ef0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-flags.o) - .bss 0x00011ef0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fvwrite.o) - .bss 0x00011ef0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-isattyr.o) - .bss 0x00011ef0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-locale.o) - .bss 0x00011ef0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-lseekr.o) - .bss 0x00011ef0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-memchr.o) - .bss 0x00011ef0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-memcpy.o) - .bss 0x00011ef0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-memmove.o) - .bss 0x00011ef0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-mprec.o) - .bss 0x00011ef0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-readr.o) - .bss 0x00011ef0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-reallocr.o) - .bss 0x00011ef0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-s_isinfd.o) - .bss 0x00011ef0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-s_isnand.o) - .bss 0x00011ef0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-strcmp.o) - .bss 0x00011ef0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-callocr.o) - .bss 0x00011ef0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_udivdi3.o) - .bss 0x00011ef0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_umoddi3.o) - .bss 0x00011ef0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_addsub_df.o) - .bss 0x00011ef0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_mul_df.o) - .bss 0x00011ef0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_div_df.o) - .bss 0x00011ef0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_eq_df.o) - .bss 0x00011ef0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_ne_df.o) - .bss 0x00011ef0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_gt_df.o) - .bss 0x00011ef0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_ge_df.o) - .bss 0x00011ef0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_lt_df.o) - .bss 0x00011ef0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_si_to_df.o) - .bss 0x00011ef0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_df_to_si.o) - .bss 0x00011ef0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_thenan_df.o) - .bss 0x00011ef0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_usi_to_df.o) - .bss 0x00011ef0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-divmod.o) - .bss 0x00011ef0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-mul.o) - .bss 0x00011ef0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_muldi3.o) - .bss 0x00011ef0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_clz.o) - .bss 0x00011ef0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_clzsi2.o) - .bss 0x00011ef0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_pack_df.o) - .bss 0x00011ef0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_unpack_df.o) - .bss 0x00011ef0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_fpcmp_parts_df.o) - .bss 0x00011ef0 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_close.o) - .bss 0x00011ef0 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_dev.o) - .bss 0x00011ef0 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_errno.o) - .bss 0x00011ef0 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_fstat.o) - .bss 0x00011ef0 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_isatty.o) - .bss 0x00011ef0 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_load.o) - .bss 0x00011ef0 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_lseek.o) - .bss 0x00011ef0 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_main.o) - .bss 0x00011ef0 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_malloc_lock.o) - .bss 0x00011ef0 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_open.o) - .bss 0x00011ef0 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_read.o) - .bss 0x00011ef0 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_release_fd.o) - .bss 0x00011ef0 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_sbrk.o) - .bss 0x00011ef0 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_write.o) - .bss 0x00011ef0 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_sys_init.o) - .bss 0x00011ef0 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_fd.o) - .bss 0x00011ef0 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_init.o) - .bss 0x00011ef0 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_ioctl.o) - .bss 0x00011ef0 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_read.o) - .bss 0x00011ef0 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_write.o) - .bss 0x00011ef0 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_lcd_16207.o) - .bss 0x00011ef0 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_lcd_16207_fd.o) - .bss 0x00011ef0 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_alarm_start.o) - .bss 0x00011ef0 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .bss 0x00011ef0 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_dev_llist_insert.o) - .bss 0x00011ef0 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_do_ctors.o) - .bss 0x00011ef0 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_do_dtors.o) - .bss 0x00011ef0 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_find_dev.o) - .bss 0x00011ef0 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_find_file.o) - .bss 0x00011ef0 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_get_fd.o) - .bss 0x00011ef0 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .bss 0x00011ef0 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_iic.o) - .bss 0x00011ef0 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_iic_isr_register.o) - .bss 0x00011ef0 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_io_redirect.o) - .bss 0x00011ef0 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_irq_entry.o) - .bss 0x00011ef0 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_irq_handler.o) - .bss 0x00011ef0 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_irq_vars.o) - .bss 0x00011ef0 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_tick.o) - .bss 0x00011ef0 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_usleep.o) - .bss 0x00011ef0 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - .bss 0x00011ef0 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_busy_sleep.o) - .bss 0x00011ef0 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_exception_entry.o) - .bss 0x00011ef0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-atexit.o) - .bss 0x00011ef0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-ctype_.o) - .bss 0x00011ef0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-exit.o) - .bss 0x00011ef0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-memcmp.o) - .bss 0x00011ef0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-__atexit.o) - .bss 0x00011ef0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-__call_atexit.o) - .bss 0x00011ef0 0x0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_exit.o) - *(COMMON) - COMMON 0x00011ef0 0x100 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_irq_handler.o) - 0x00011ef0 alt_irq - COMMON 0x00011ff0 0x190 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-atexit.o) - 0x00011ff0 _atexit0 - 0x00012180 . = ALIGN (0x4) - 0x00012180 __bss_end = ABSOLUTE (.) - -.onchip_memory 0x00012180 0x0 - 0x00012180 PROVIDE (_alt_partition_onchip_memory_start, ABSOLUTE (.)) - *(.onchip_memory. onchip_memory.*) - 0x00012180 . = ALIGN (0x4) - 0x00012180 PROVIDE (_alt_partition_onchip_memory_end, ABSOLUTE (.)) - 0x00012180 _end = ABSOLUTE (.) - 0x00012180 end = ABSOLUTE (.) - 0x00012180 __alt_stack_base = ABSOLUTE (.) - 0x00012180 PROVIDE (_alt_partition_onchip_memory_load_addr, LOADADDR (.onchip_memory)) - -.stab - *(.stab) - -.stabstr - *(.stabstr) - -.stab.excl - *(.stab.excl) - -.stab.exclstr - *(.stab.exclstr) - -.stab.index - *(.stab.index) - -.stab.indexstr - *(.stab.indexstr) - -.comment 0x00000000 0x26 - *(.comment) - .comment 0x00000000 0x26 obj/default/hello_world.o - 0x27 (size before relaxing) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fclose.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fflush.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-findfp.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fopen.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-freer.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fseek.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fstatr.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fwalk.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fwrite.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-impure.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-int_errno.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-makebuf.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-mallocr.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-memset.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-openr.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-printf.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-puts.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-refill.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-sbrkr.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-stdio.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-strlen.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-vfprintf.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-writer.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-wsetup.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-closer.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-dtoa.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-flags.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fvwrite.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-isattyr.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-locale.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-lseekr.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-memchr.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-memcpy.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-memmove.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-mprec.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-readr.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-reallocr.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-s_isinfd.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-s_isnand.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-strcmp.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-callocr.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_udivdi3.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_umoddi3.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_addsub_df.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_mul_df.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_div_df.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_eq_df.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_ne_df.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_gt_df.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_ge_df.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_lt_df.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_si_to_df.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_df_to_si.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_thenan_df.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_usi_to_df.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-divmod.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-mul.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_muldi3.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_clz.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_clzsi2.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_pack_df.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_unpack_df.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_fpcmp_parts_df.o) - .comment 0x00000000 0x27 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_close.o) - .comment 0x00000000 0x27 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_dev.o) - .comment 0x00000000 0x27 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_errno.o) - .comment 0x00000000 0x27 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_fstat.o) - .comment 0x00000000 0x27 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_isatty.o) - .comment 0x00000000 0x27 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_load.o) - .comment 0x00000000 0x27 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_lseek.o) - .comment 0x00000000 0x27 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_main.o) - .comment 0x00000000 0x27 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_malloc_lock.o) - .comment 0x00000000 0x27 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_open.o) - .comment 0x00000000 0x27 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_read.o) - .comment 0x00000000 0x27 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_release_fd.o) - .comment 0x00000000 0x27 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_sbrk.o) - .comment 0x00000000 0x27 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_write.o) - .comment 0x00000000 0x27 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_sys_init.o) - .comment 0x00000000 0x27 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_fd.o) - .comment 0x00000000 0x27 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_init.o) - .comment 0x00000000 0x27 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_ioctl.o) - .comment 0x00000000 0x27 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_read.o) - .comment 0x00000000 0x27 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_write.o) - .comment 0x00000000 0x27 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_lcd_16207.o) - .comment 0x00000000 0x27 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_lcd_16207_fd.o) - .comment 0x00000000 0x27 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_alarm_start.o) - .comment 0x00000000 0x27 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .comment 0x00000000 0x27 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_dev_llist_insert.o) - .comment 0x00000000 0x27 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_do_ctors.o) - .comment 0x00000000 0x27 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_do_dtors.o) - .comment 0x00000000 0x27 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_find_dev.o) - .comment 0x00000000 0x27 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_find_file.o) - .comment 0x00000000 0x27 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_get_fd.o) - .comment 0x00000000 0x27 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .comment 0x00000000 0x27 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_iic.o) - .comment 0x00000000 0x27 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_iic_isr_register.o) - .comment 0x00000000 0x27 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_io_redirect.o) - .comment 0x00000000 0x27 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_irq_handler.o) - .comment 0x00000000 0x27 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_irq_vars.o) - .comment 0x00000000 0x27 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_tick.o) - .comment 0x00000000 0x27 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_usleep.o) - .comment 0x00000000 0x27 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - .comment 0x00000000 0x27 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_busy_sleep.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-atexit.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-ctype_.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-exit.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-memcmp.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-__atexit.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-__call_atexit.o) - .comment 0x00000000 0x27 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_exit.o) - -.debug - *(.debug) - -.line - *(.line) - -.debug_srcinfo - *(.debug_srcinfo) - -.debug_sfnames - *(.debug_sfnames) - -.debug_aranges 0x00000000 0xd98 - *(.debug_aranges) - .debug_aranges - 0x00000000 0x28 ../qsys_tutorial_lcd3_bsp//obj/HAL/src/crt0.o - .debug_aranges - 0x00000028 0x20 obj/default/hello_world.o - .debug_aranges - 0x00000048 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fclose.o) - .debug_aranges - 0x00000068 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fflush.o) - .debug_aranges - 0x00000088 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-findfp.o) - .debug_aranges - 0x000000a8 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fopen.o) - .debug_aranges - 0x000000c8 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-freer.o) - .debug_aranges - 0x000000e8 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fseek.o) - .debug_aranges - 0x00000108 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fstatr.o) - .debug_aranges - 0x00000128 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fwalk.o) - .debug_aranges - 0x00000148 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fwrite.o) - .debug_aranges - 0x00000168 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-makebuf.o) - .debug_aranges - 0x00000188 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-mallocr.o) - .debug_aranges - 0x000001a8 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-memset.o) - .debug_aranges - 0x000001c8 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-openr.o) - .debug_aranges - 0x000001e8 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-printf.o) - .debug_aranges - 0x00000208 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-puts.o) - .debug_aranges - 0x00000228 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-refill.o) - .debug_aranges - 0x00000248 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-sbrkr.o) - .debug_aranges - 0x00000268 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-stdio.o) - .debug_aranges - 0x00000288 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-strlen.o) - .debug_aranges - 0x000002a8 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-vfprintf.o) - .debug_aranges - 0x000002c8 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-writer.o) - .debug_aranges - 0x000002e8 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-wsetup.o) - .debug_aranges - 0x00000308 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-closer.o) - .debug_aranges - 0x00000328 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-dtoa.o) - .debug_aranges - 0x00000348 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-flags.o) - .debug_aranges - 0x00000368 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fvwrite.o) - .debug_aranges - 0x00000388 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-isattyr.o) - .debug_aranges - 0x000003a8 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-locale.o) - .debug_aranges - 0x000003c8 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-lseekr.o) - .debug_aranges - 0x000003e8 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-memchr.o) - .debug_aranges - 0x00000408 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-memcpy.o) - .debug_aranges - 0x00000428 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-memmove.o) - .debug_aranges - 0x00000448 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-mprec.o) - .debug_aranges - 0x00000468 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-readr.o) - .debug_aranges - 0x00000488 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-reallocr.o) - .debug_aranges - 0x000004a8 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-s_isinfd.o) - .debug_aranges - 0x000004c8 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-s_isnand.o) - .debug_aranges - 0x000004e8 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-strcmp.o) - .debug_aranges - 0x00000508 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-callocr.o) - .debug_aranges - 0x00000528 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_udivdi3.o) - .debug_aranges - 0x00000548 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_umoddi3.o) - .debug_aranges - 0x00000568 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_addsub_df.o) - .debug_aranges - 0x00000588 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_mul_df.o) - .debug_aranges - 0x000005a8 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_div_df.o) - .debug_aranges - 0x000005c8 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_eq_df.o) - .debug_aranges - 0x000005e8 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_ne_df.o) - .debug_aranges - 0x00000608 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_gt_df.o) - .debug_aranges - 0x00000628 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_ge_df.o) - .debug_aranges - 0x00000648 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_lt_df.o) - .debug_aranges - 0x00000668 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_si_to_df.o) - .debug_aranges - 0x00000688 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_df_to_si.o) - .debug_aranges - 0x000006a8 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_usi_to_df.o) - .debug_aranges - 0x000006c8 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-divmod.o) - .debug_aranges - 0x000006e8 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-mul.o) - .debug_aranges - 0x00000708 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_muldi3.o) - .debug_aranges - 0x00000728 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_clzsi2.o) - .debug_aranges - 0x00000748 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_pack_df.o) - .debug_aranges - 0x00000768 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_unpack_df.o) - .debug_aranges - 0x00000788 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_fpcmp_parts_df.o) - .debug_aranges - 0x000007a8 0x20 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_close.o) - .debug_aranges - 0x000007c8 0x20 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_dev.o) - .debug_aranges - 0x000007e8 0x20 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_fstat.o) - .debug_aranges - 0x00000808 0x20 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_isatty.o) - .debug_aranges - 0x00000828 0x20 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_load.o) - .debug_aranges - 0x00000848 0x20 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_lseek.o) - .debug_aranges - 0x00000868 0x20 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_main.o) - .debug_aranges - 0x00000888 0x20 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_malloc_lock.o) - .debug_aranges - 0x000008a8 0x20 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_open.o) - .debug_aranges - 0x000008c8 0x20 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_read.o) - .debug_aranges - 0x000008e8 0x20 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_release_fd.o) - .debug_aranges - 0x00000908 0x20 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_sbrk.o) - .debug_aranges - 0x00000928 0x20 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_write.o) - .debug_aranges - 0x00000948 0x20 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_sys_init.o) - .debug_aranges - 0x00000968 0x20 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_fd.o) - .debug_aranges - 0x00000988 0x20 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_init.o) - .debug_aranges - 0x000009a8 0x20 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_ioctl.o) - .debug_aranges - 0x000009c8 0x20 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_read.o) - .debug_aranges - 0x000009e8 0x20 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_write.o) - .debug_aranges - 0x00000a08 0x20 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_lcd_16207.o) - .debug_aranges - 0x00000a28 0x20 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_lcd_16207_fd.o) - .debug_aranges - 0x00000a48 0x20 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_alarm_start.o) - .debug_aranges - 0x00000a68 0x20 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .debug_aranges - 0x00000a88 0x20 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_dev_llist_insert.o) - .debug_aranges - 0x00000aa8 0x20 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_do_ctors.o) - .debug_aranges - 0x00000ac8 0x20 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_do_dtors.o) - .debug_aranges - 0x00000ae8 0x20 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_find_dev.o) - .debug_aranges - 0x00000b08 0x20 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_find_file.o) - .debug_aranges - 0x00000b28 0x20 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_get_fd.o) - .debug_aranges - 0x00000b48 0x20 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .debug_aranges - 0x00000b68 0x20 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_iic.o) - .debug_aranges - 0x00000b88 0x20 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_iic_isr_register.o) - .debug_aranges - 0x00000ba8 0x20 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_io_redirect.o) - .debug_aranges - 0x00000bc8 0x30 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_irq_entry.o) - .debug_aranges - 0x00000bf8 0x28 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_irq_handler.o) - .debug_aranges - 0x00000c20 0x20 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_tick.o) - .debug_aranges - 0x00000c40 0x20 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_usleep.o) - .debug_aranges - 0x00000c60 0x20 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - .debug_aranges - 0x00000c80 0x20 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_busy_sleep.o) - .debug_aranges - 0x00000ca0 0x38 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_exception_entry.o) - .debug_aranges - 0x00000cd8 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-atexit.o) - .debug_aranges - 0x00000cf8 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-exit.o) - .debug_aranges - 0x00000d18 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-memcmp.o) - .debug_aranges - 0x00000d38 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-__atexit.o) - .debug_aranges - 0x00000d58 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-__call_atexit.o) - .debug_aranges - 0x00000d78 0x20 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_exit.o) - -.debug_pubnames - 0x00000000 0x14d6 - *(.debug_pubnames) - .debug_pubnames - 0x00000000 0x25 obj/default/hello_world.o - .debug_pubnames - 0x00000025 0x2b c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fclose.o) - .debug_pubnames - 0x00000050 0x2b c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fflush.o) - .debug_pubnames - 0x0000007b 0xdb c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-findfp.o) - .debug_pubnames - 0x00000156 0x29 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fopen.o) - .debug_pubnames - 0x0000017f 0x31 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-freer.o) - .debug_pubnames - 0x000001b0 0x29 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fseek.o) - .debug_pubnames - 0x000001d9 0x1f c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fstatr.o) - .debug_pubnames - 0x000001f8 0x2e c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fwalk.o) - .debug_pubnames - 0x00000226 0x2b c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fwrite.o) - .debug_pubnames - 0x00000251 0x39 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-impure.o) - .debug_pubnames - 0x0000028a 0x1c c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-int_errno.o) - .debug_pubnames - 0x000002a6 0x23 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-makebuf.o) - .debug_pubnames - 0x000002c9 0xce c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-mallocr.o) - .debug_pubnames - 0x00000397 0x1d c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-memset.o) - .debug_pubnames - 0x000003b4 0x1e c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-openr.o) - .debug_pubnames - 0x000003d2 0x2b c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-printf.o) - .debug_pubnames - 0x000003fd 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-puts.o) - .debug_pubnames - 0x00000424 0x22 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-refill.o) - .debug_pubnames - 0x00000446 0x1e c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-sbrkr.o) - .debug_pubnames - 0x00000464 0x44 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-stdio.o) - .debug_pubnames - 0x000004a8 0x1d c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-strlen.o) - .debug_pubnames - 0x000004c5 0x45 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-vfprintf.o) - .debug_pubnames - 0x0000050a 0x1f c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-writer.o) - .debug_pubnames - 0x00000529 0x22 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-wsetup.o) - .debug_pubnames - 0x0000054b 0x1f c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-closer.o) - .debug_pubnames - 0x0000056a 0x1e c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-dtoa.o) - .debug_pubnames - 0x00000588 0x1f c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-flags.o) - .debug_pubnames - 0x000005a7 0x23 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fvwrite.o) - .debug_pubnames - 0x000005ca 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-isattyr.o) - .debug_pubnames - 0x000005ea 0xc3 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-locale.o) - .debug_pubnames - 0x000006ad 0x1f c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-lseekr.o) - .debug_pubnames - 0x000006cc 0x1d c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-memchr.o) - .debug_pubnames - 0x000006e9 0x1d c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-memcpy.o) - .debug_pubnames - 0x00000706 0x1e c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-memmove.o) - .debug_pubnames - 0x00000724 0x13a c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-mprec.o) - .debug_pubnames - 0x0000085e 0x1e c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-readr.o) - .debug_pubnames - 0x0000087c 0x21 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-reallocr.o) - .debug_pubnames - 0x0000089d 0x1f c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-s_isinfd.o) - .debug_pubnames - 0x000008bc 0x1f c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-s_isnand.o) - .debug_pubnames - 0x000008db 0x1d c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-strcmp.o) - .debug_pubnames - 0x000008f8 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-callocr.o) - .debug_pubnames - 0x00000918 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_udivdi3.o) - .debug_pubnames - 0x00000938 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_umoddi3.o) - .debug_pubnames - 0x00000958 0x2c c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_addsub_df.o) - .debug_pubnames - 0x00000984 0x1f c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_mul_df.o) - .debug_pubnames - 0x000009a3 0x1f c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_div_df.o) - .debug_pubnames - 0x000009c2 0x1e c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_eq_df.o) - .debug_pubnames - 0x000009e0 0x1e c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_ne_df.o) - .debug_pubnames - 0x000009fe 0x1e c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_gt_df.o) - .debug_pubnames - 0x00000a1c 0x1e c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_ge_df.o) - .debug_pubnames - 0x00000a3a 0x1e c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_lt_df.o) - .debug_pubnames - 0x00000a58 0x22 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_si_to_df.o) - .debug_pubnames - 0x00000a7a 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_df_to_si.o) - .debug_pubnames - 0x00000a9a 0x22 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_thenan_df.o) - .debug_pubnames - 0x00000abc 0x24 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_usi_to_df.o) - .debug_pubnames - 0x00000ae0 0x48 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-divmod.o) - .debug_pubnames - 0x00000b28 0x1f c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-mul.o) - .debug_pubnames - 0x00000b47 0x1f c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_muldi3.o) - .debug_pubnames - 0x00000b66 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_clz.o) - .debug_pubnames - 0x00000b86 0x1f c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_clzsi2.o) - .debug_pubnames - 0x00000ba5 0x1f c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_pack_df.o) - .debug_pubnames - 0x00000bc4 0x21 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_unpack_df.o) - .debug_pubnames - 0x00000be5 0x26 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_fpcmp_parts_df.o) - .debug_pubnames - 0x00000c0b 0x1c ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_close.o) - .debug_pubnames - 0x00000c27 0x63 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_dev.o) - .debug_pubnames - 0x00000c8a 0x20 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_errno.o) - .debug_pubnames - 0x00000caa 0x1c ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_fstat.o) - .debug_pubnames - 0x00000cc6 0x1d ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_isatty.o) - .debug_pubnames - 0x00000ce3 0x1f ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_load.o) - .debug_pubnames - 0x00000d02 0x1c ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_lseek.o) - .debug_pubnames - 0x00000d1e 0x46 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_main.o) - .debug_pubnames - 0x00000d64 0x38 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_malloc_lock.o) - .debug_pubnames - 0x00000d9c 0x1b ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_open.o) - .debug_pubnames - 0x00000db7 0x1b ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_read.o) - .debug_pubnames - 0x00000dd2 0x25 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_release_fd.o) - .debug_pubnames - 0x00000df7 0x1b ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_sbrk.o) - .debug_pubnames - 0x00000e12 0x1c ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_write.o) - .debug_pubnames - 0x00000e2e 0x34 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_sys_init.o) - .debug_pubnames - 0x00000e62 0xa5 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_fd.o) - .debug_pubnames - 0x00000f07 0x55 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_init.o) - .debug_pubnames - 0x00000f5c 0x34 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_ioctl.o) - .debug_pubnames - 0x00000f90 0x33 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_read.o) - .debug_pubnames - 0x00000fc3 0x34 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_write.o) - .debug_pubnames - 0x00000ff7 0x55 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_lcd_16207.o) - .debug_pubnames - 0x0000104c 0x37 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_lcd_16207_fd.o) - .debug_pubnames - 0x00001083 0x26 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_alarm_start.o) - .debug_pubnames - 0x000010a9 0x2b ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .debug_pubnames - 0x000010d4 0x2b ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_dev_llist_insert.o) - .debug_pubnames - 0x000010ff 0x20 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_do_ctors.o) - .debug_pubnames - 0x0000111f 0x20 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_do_dtors.o) - .debug_pubnames - 0x0000113f 0x23 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_find_dev.o) - .debug_pubnames - 0x00001162 0x24 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_find_file.o) - .debug_pubnames - 0x00001186 0x21 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_get_fd.o) - .debug_pubnames - 0x000011a7 0x2b ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .debug_pubnames - 0x000011d2 0x6e ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_iic.o) - .debug_pubnames - 0x00001240 0x2b ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_iic_isr_register.o) - .debug_pubnames - 0x0000126b 0x26 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_io_redirect.o) - .debug_pubnames - 0x00001291 0x32 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_irq_handler.o) - .debug_pubnames - 0x000012c3 0x3b ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_irq_vars.o) - .debug_pubnames - 0x000012fe 0x68 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_tick.o) - .debug_pubnames - 0x00001366 0x1d ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_usleep.o) - .debug_pubnames - 0x00001383 0x31 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - .debug_pubnames - 0x000013b4 0x25 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_busy_sleep.o) - .debug_pubnames - 0x000013d9 0x2a c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-atexit.o) - .debug_pubnames - 0x00001403 0x2e c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-ctype_.o) - .debug_pubnames - 0x00001431 0x1b c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-exit.o) - .debug_pubnames - 0x0000144c 0x1d c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-memcmp.o) - .debug_pubnames - 0x00001469 0x2a c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-__atexit.o) - .debug_pubnames - 0x00001493 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-__call_atexit.o) - .debug_pubnames - 0x000014ba 0x1c ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_exit.o) - -.debug_info 0x00000000 0x285c7 - *(.debug_info .gnu.linkonce.wi.*) - .debug_info 0x00000000 0x82 ../qsys_tutorial_lcd3_bsp//obj/HAL/src/crt0.o - .debug_info 0x00000082 0xc1e obj/default/hello_world.o - .debug_info 0x00000ca0 0x994 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fclose.o) - .debug_info 0x00001634 0x9fe c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fflush.o) - .debug_info 0x00002032 0xb72 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-findfp.o) - .debug_info 0x00002ba4 0x9e0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fopen.o) - .debug_info 0x00003584 0xbc9 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-freer.o) - .debug_info 0x0000414d 0xbdc c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fseek.o) - .debug_info 0x00004d29 0xafc c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fstatr.o) - .debug_info 0x00005825 0xaed c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fwalk.o) - .debug_info 0x00006312 0xa83 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fwrite.o) - .debug_info 0x00006d95 0x93d c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-impure.o) - .debug_info 0x000076d2 0x8c c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-int_errno.o) - .debug_info 0x0000775e 0xb1a c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-makebuf.o) - .debug_info 0x00008278 0xcd0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-mallocr.o) - .debug_info 0x00008f48 0x113 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-memset.o) - .debug_info 0x0000905b 0x977 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-openr.o) - .debug_info 0x000099d2 0x9d1 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-printf.o) - .debug_info 0x0000a3a3 0xa25 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-puts.o) - .debug_info 0x0000adc8 0x98b c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-refill.o) - .debug_info 0x0000b753 0x962 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-sbrkr.o) - .debug_info 0x0000c0b5 0xaac c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-stdio.o) - .debug_info 0x0000cb61 0xdb c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-strlen.o) - .debug_info 0x0000cc3c 0x10d5 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-vfprintf.o) - .debug_info 0x0000dd11 0x993 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-writer.o) - .debug_info 0x0000e6a4 0x95d c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-wsetup.o) - .debug_info 0x0000f001 0x958 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-closer.o) - .debug_info 0x0000f959 0xd6f c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-dtoa.o) - .debug_info 0x000106c8 0x977 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-flags.o) - .debug_info 0x0001103f 0xa88 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fvwrite.o) - .debug_info 0x00011ac7 0x958 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-isattyr.o) - .debug_info 0x0001241f 0xb97 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-locale.o) - .debug_info 0x00012fb6 0x981 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-lseekr.o) - .debug_info 0x00013937 0x138 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-memchr.o) - .debug_info 0x00013a6f 0x106 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-memcpy.o) - .debug_info 0x00013b75 0x13e c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-memmove.o) - .debug_info 0x00013cb3 0x143b c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-mprec.o) - .debug_info 0x000150ee 0x98c c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-readr.o) - .debug_info 0x00015a7a 0xbd7 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-reallocr.o) - .debug_info 0x00016651 0xd7 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-s_isinfd.o) - .debug_info 0x00016728 0xd5 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-s_isnand.o) - .debug_info 0x000167fd 0xdd c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-strcmp.o) - .debug_info 0x000168da 0xa1b c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-callocr.o) - .debug_info 0x000172f5 0x71c c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_udivdi3.o) - .debug_info 0x00017a11 0x749 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_umoddi3.o) - .debug_info 0x0001815a 0x493 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_addsub_df.o) - .debug_info 0x000185ed 0x488 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_mul_df.o) - .debug_info 0x00018a75 0x39b c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_div_df.o) - .debug_info 0x00018e10 0x29d c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_eq_df.o) - .debug_info 0x000190ad 0x29d c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_ne_df.o) - .debug_info 0x0001934a 0x29d c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_gt_df.o) - .debug_info 0x000195e7 0x29d c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_ge_df.o) - .debug_info 0x00019884 0x29d c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_lt_df.o) - .debug_info 0x00019b21 0x218 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_si_to_df.o) - .debug_info 0x00019d39 0x2cd c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_df_to_si.o) - .debug_info 0x0001a006 0x164 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_thenan_df.o) - .debug_info 0x0001a16a 0x213 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_usi_to_df.o) - .debug_info 0x0001a37d 0x21c c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-divmod.o) - .debug_info 0x0001a599 0xf3 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-mul.o) - .debug_info 0x0001a68c 0x210 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_muldi3.o) - .debug_info 0x0001a89c 0xc9 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_clz.o) - .debug_info 0x0001a965 0x130 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_clzsi2.o) - .debug_info 0x0001aa95 0x2fc c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_pack_df.o) - .debug_info 0x0001ad91 0x268 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_unpack_df.o) - .debug_info 0x0001aff9 0x21b c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_fpcmp_parts_df.o) - .debug_info 0x0001b214 0x46e ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_close.o) - .debug_info 0x0001b682 0x686 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_dev.o) - .debug_info 0x0001bd08 0x16b ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_errno.o) - .debug_info 0x0001be73 0x667 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_fstat.o) - .debug_info 0x0001c4da 0x66d ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_isatty.o) - .debug_info 0x0001cb47 0x294 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_load.o) - .debug_info 0x0001cddb 0x4a1 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_lseek.o) - .debug_info 0x0001d27c 0x22c ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_main.o) - .debug_info 0x0001d4a8 0xc1f ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_malloc_lock.o) - .debug_info 0x0001e0c7 0x52c ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_open.o) - .debug_info 0x0001e5f3 0x691 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_read.o) - .debug_info 0x0001ec84 0x3f9 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_release_fd.o) - .debug_info 0x0001f07d 0x2be ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_sbrk.o) - .debug_info 0x0001f33b 0x69a ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_write.o) - .debug_info 0x0001f9d5 0x90e ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_sys_init.o) - .debug_info 0x000202e3 0x7e0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_fd.o) - .debug_info 0x00020ac3 0x608 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_init.o) - .debug_info 0x000210cb 0x44a ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_ioctl.o) - .debug_info 0x00021515 0x54d ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_read.o) - .debug_info 0x00021a62 0x545 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_write.o) - .debug_info 0x00021fa7 0x8f5 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_lcd_16207.o) - .debug_info 0x0002289c 0x719 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_lcd_16207_fd.o) - .debug_info 0x00022fb5 0x449 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_alarm_start.o) - .debug_info 0x000233fe 0x163 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .debug_info 0x00023561 0x2be ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_dev_llist_insert.o) - .debug_info 0x0002381f 0x116 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_do_ctors.o) - .debug_info 0x00023935 0x115 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_do_dtors.o) - .debug_info 0x00023a4a 0x41f ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_find_dev.o) - .debug_info 0x00023e69 0x426 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_find_file.o) - .debug_info 0x0002428f 0x467 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_get_fd.o) - .debug_info 0x000246f6 0x163 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .debug_info 0x00024859 0x49a ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_iic.o) - .debug_info 0x00024cf3 0x31b ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_iic_isr_register.o) - .debug_info 0x0002500e 0x69c ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_io_redirect.o) - .debug_info 0x000256aa 0x8b ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_irq_entry.o) - .debug_info 0x00025735 0x27c ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_irq_handler.o) - .debug_info 0x000259b1 0x16e ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_irq_vars.o) - .debug_info 0x00025b1f 0x405 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_tick.o) - .debug_info 0x00025f24 0x16f ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_usleep.o) - .debug_info 0x00026093 0x16a ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - .debug_info 0x000261fd 0x1b2 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_busy_sleep.o) - .debug_info 0x000263af 0x91 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_exception_entry.o) - .debug_info 0x00026440 0x181 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-atexit.o) - .debug_info 0x000265c1 0xa0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-ctype_.o) - .debug_info 0x00026661 0x93f c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-exit.o) - .debug_info 0x00026fa0 0x115 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-memcmp.o) - .debug_info 0x000270b5 0x99c c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-__atexit.o) - .debug_info 0x00027a51 0x9e2 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-__call_atexit.o) - .debug_info 0x00028433 0x194 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_exit.o) - -.debug_abbrev 0x00000000 0x86c2 - *(.debug_abbrev) - .debug_abbrev 0x00000000 0x12 ../qsys_tutorial_lcd3_bsp//obj/HAL/src/crt0.o - .debug_abbrev 0x00000012 0x186 obj/default/hello_world.o - .debug_abbrev 0x00000198 0x1a7 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fclose.o) - .debug_abbrev 0x0000033f 0x1c6 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fflush.o) - .debug_abbrev 0x00000505 0x24c c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-findfp.o) - .debug_abbrev 0x00000751 0x1b6 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fopen.o) - .debug_abbrev 0x00000907 0x1d9 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-freer.o) - .debug_abbrev 0x00000ae0 0x208 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fseek.o) - .debug_abbrev 0x00000ce8 0x18e c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fstatr.o) - .debug_abbrev 0x00000e76 0x1e3 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fwalk.o) - .debug_abbrev 0x00001059 0x1b1 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fwrite.o) - .debug_abbrev 0x0000120a 0x157 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-impure.o) - .debug_abbrev 0x00001361 0x3b c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-int_errno.o) - .debug_abbrev 0x0000139c 0x197 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-makebuf.o) - .debug_abbrev 0x00001533 0x216 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-mallocr.o) - .debug_abbrev 0x00001749 0xb8 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-memset.o) - .debug_abbrev 0x00001801 0x18e c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-openr.o) - .debug_abbrev 0x0000198f 0x191 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-printf.o) - .debug_abbrev 0x00001b20 0x1ac c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-puts.o) - .debug_abbrev 0x00001ccc 0x187 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-refill.o) - .debug_abbrev 0x00001e53 0x18c c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-sbrkr.o) - .debug_abbrev 0x00001fdf 0x1c9 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-stdio.o) - .debug_abbrev 0x000021a8 0x8b c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-strlen.o) - .debug_abbrev 0x00002233 0x30a c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-vfprintf.o) - .debug_abbrev 0x0000253d 0x184 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-writer.o) - .debug_abbrev 0x000026c1 0x170 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-wsetup.o) - .debug_abbrev 0x00002831 0x17f c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-closer.o) - .debug_abbrev 0x000029b0 0x232 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-dtoa.o) - .debug_abbrev 0x00002be2 0x17d c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-flags.o) - .debug_abbrev 0x00002d5f 0x1a3 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fvwrite.o) - .debug_abbrev 0x00002f02 0x17f c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-isattyr.o) - .debug_abbrev 0x00003081 0x1ed c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-locale.o) - .debug_abbrev 0x0000326e 0x18e c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-lseekr.o) - .debug_abbrev 0x000033fc 0xb5 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-memchr.o) - .debug_abbrev 0x000034b1 0xb5 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-memcpy.o) - .debug_abbrev 0x00003566 0xb5 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-memmove.o) - .debug_abbrev 0x0000361b 0x297 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-mprec.o) - .debug_abbrev 0x000038b2 0x17f c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-readr.o) - .debug_abbrev 0x00003a31 0x1c3 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-reallocr.o) - .debug_abbrev 0x00003bf4 0x79 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-s_isinfd.o) - .debug_abbrev 0x00003c6d 0x79 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-s_isnand.o) - .debug_abbrev 0x00003ce6 0x80 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-strcmp.o) - .debug_abbrev 0x00003d66 0x1b8 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-callocr.o) - .debug_abbrev 0x00003f1e 0x16b c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_udivdi3.o) - .debug_abbrev 0x00004089 0x18e c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_umoddi3.o) - .debug_abbrev 0x00004217 0x1d2 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_addsub_df.o) - .debug_abbrev 0x000043e9 0x204 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_mul_df.o) - .debug_abbrev 0x000045ed 0x1e3 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_div_df.o) - .debug_abbrev 0x000047d0 0x151 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_eq_df.o) - .debug_abbrev 0x00004921 0x151 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_ne_df.o) - .debug_abbrev 0x00004a72 0x151 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_gt_df.o) - .debug_abbrev 0x00004bc3 0x151 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_ge_df.o) - .debug_abbrev 0x00004d14 0x151 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_lt_df.o) - .debug_abbrev 0x00004e65 0x13f c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_si_to_df.o) - .debug_abbrev 0x00004fa4 0x176 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_df_to_si.o) - .debug_abbrev 0x0000511a 0xba c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_thenan_df.o) - .debug_abbrev 0x000051d4 0x155 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_usi_to_df.o) - .debug_abbrev 0x00005329 0xe0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-divmod.o) - .debug_abbrev 0x00005409 0x7b c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-mul.o) - .debug_abbrev 0x00005484 0xfb c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_muldi3.o) - .debug_abbrev 0x0000557f 0x61 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_clz.o) - .debug_abbrev 0x000055e0 0xb9 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_clzsi2.o) - .debug_abbrev 0x00005699 0x1b1 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_pack_df.o) - .debug_abbrev 0x0000584a 0x149 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_unpack_df.o) - .debug_abbrev 0x00005993 0x132 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_fpcmp_parts_df.o) - .debug_abbrev 0x00005ac5 0xfb ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_close.o) - .debug_abbrev 0x00005bc0 0xc7 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_dev.o) - .debug_abbrev 0x00005c87 0x5e ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_errno.o) - .debug_abbrev 0x00005ce5 0xfb ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_fstat.o) - .debug_abbrev 0x00005de0 0xfb ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_isatty.o) - .debug_abbrev 0x00005edb 0x88 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_load.o) - .debug_abbrev 0x00005f63 0xfb ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_lseek.o) - .debug_abbrev 0x0000605e 0xb7 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_main.o) - .debug_abbrev 0x00006115 0x181 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_malloc_lock.o) - .debug_abbrev 0x00006296 0x112 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_open.o) - .debug_abbrev 0x000063a8 0xfb ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_read.o) - .debug_abbrev 0x000064a3 0xc1 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_release_fd.o) - .debug_abbrev 0x00006564 0x115 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_sbrk.o) - .debug_abbrev 0x00006679 0x100 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_write.o) - .debug_abbrev 0x00006779 0x158 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_sys_init.o) - .debug_abbrev 0x000068d1 0xf7 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_fd.o) - .debug_abbrev 0x000069c8 0x17c ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_init.o) - .debug_abbrev 0x00006b44 0xf0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_ioctl.o) - .debug_abbrev 0x00006c34 0x191 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_read.o) - .debug_abbrev 0x00006dc5 0x18d ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_write.o) - .debug_abbrev 0x00006f52 0x1c3 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_lcd_16207.o) - .debug_abbrev 0x00007115 0x104 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_lcd_16207_fd.o) - .debug_abbrev 0x00007219 0x172 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_alarm_start.o) - .debug_abbrev 0x0000738b 0x3f ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .debug_abbrev 0x000073ca 0xf6 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_dev_llist_insert.o) - .debug_abbrev 0x000074c0 0x76 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_do_ctors.o) - .debug_abbrev 0x00007536 0x76 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_do_dtors.o) - .debug_abbrev 0x000075ac 0xcf ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_find_dev.o) - .debug_abbrev 0x0000767b 0xcf ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_find_file.o) - .debug_abbrev 0x0000774a 0xfb ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_get_fd.o) - .debug_abbrev 0x00007845 0x3f ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .debug_abbrev 0x00007884 0x134 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_iic.o) - .debug_abbrev 0x000079b8 0x14e ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_iic_isr_register.o) - .debug_abbrev 0x00007b06 0xf0 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_io_redirect.o) - .debug_abbrev 0x00007bf6 0x12 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_irq_entry.o) - .debug_abbrev 0x00007c08 0x10c ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_irq_handler.o) - .debug_abbrev 0x00007d14 0x44 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_irq_vars.o) - .debug_abbrev 0x00007d58 0x150 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_tick.o) - .debug_abbrev 0x00007ea8 0x5d ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_usleep.o) - .debug_abbrev 0x00007f05 0x3f ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - .debug_abbrev 0x00007f44 0x6c ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_busy_sleep.o) - .debug_abbrev 0x00007fb0 0x12 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_exception_entry.o) - .debug_abbrev 0x00007fc2 0xb7 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-atexit.o) - .debug_abbrev 0x00008079 0x61 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-ctype_.o) - .debug_abbrev 0x000080da 0x16e c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-exit.o) - .debug_abbrev 0x00008248 0x7c c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-memcmp.o) - .debug_abbrev 0x000082c4 0x1ae c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-__atexit.o) - .debug_abbrev 0x00008472 0x1de c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-__call_atexit.o) - .debug_abbrev 0x00008650 0x72 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_exit.o) - -.debug_line 0x00000000 0x15639 - *(.debug_line) - .debug_line 0x00000000 0x66 ../qsys_tutorial_lcd3_bsp//obj/HAL/src/crt0.o - .debug_line 0x00000066 0x236 obj/default/hello_world.o - .debug_line 0x0000029c 0x2eb c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fclose.o) - .debug_line 0x00000587 0x410 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fflush.o) - .debug_line 0x00000997 0x60c c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-findfp.o) - .debug_line 0x00000fa3 0x345 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fopen.o) - .debug_line 0x000012e8 0x5ee c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-freer.o) - .debug_line 0x000018d6 0x5ae c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fseek.o) - .debug_line 0x00001e84 0x267 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fstatr.o) - .debug_line 0x000020eb 0x34d c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fwalk.o) - .debug_line 0x00002438 0x2e4 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fwrite.o) - .debug_line 0x0000271c 0x230 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-impure.o) - .debug_line 0x0000294c 0x1e2 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-int_errno.o) - .debug_line 0x00002b2e 0x3c6 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-makebuf.o) - .debug_line 0x00002ef4 0x80d c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-mallocr.o) - .debug_line 0x00003701 0x304 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-memset.o) - .debug_line 0x00003a05 0x27e c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-openr.o) - .debug_line 0x00003c83 0x29e c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-printf.o) - .debug_line 0x00003f21 0x2fa c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-puts.o) - .debug_line 0x0000421b 0x3c7 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-refill.o) - .debug_line 0x000045e2 0x29c c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-sbrkr.o) - .debug_line 0x0000487e 0x38f c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-stdio.o) - .debug_line 0x00004c0d 0x270 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-strlen.o) - .debug_line 0x00004e7d 0x110f c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-vfprintf.o) - .debug_line 0x00005f8c 0x29d c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-writer.o) - .debug_line 0x00006229 0x2f3 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-wsetup.o) - .debug_line 0x0000651c 0x29d c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-closer.o) - .debug_line 0x000067b9 0x1309 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-dtoa.o) - .debug_line 0x00007ac2 0x299 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-flags.o) - .debug_line 0x00007d5b 0x644 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fvwrite.o) - .debug_line 0x0000839f 0x29e c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-isattyr.o) - .debug_line 0x0000863d 0x2cb c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-locale.o) - .debug_line 0x00008908 0x29d c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-lseekr.o) - .debug_line 0x00008ba5 0x306 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-memchr.o) - .debug_line 0x00008eab 0x1af c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-memcpy.o) - .debug_line 0x0000905a 0x30d c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-memmove.o) - .debug_line 0x00009367 0x125e c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-mprec.o) - .debug_line 0x0000a5c5 0x29c c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-readr.o) - .debug_line 0x0000a861 0x58d c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-reallocr.o) - .debug_line 0x0000adee 0x225 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-s_isinfd.o) - .debug_line 0x0000b013 0x21d c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-s_isnand.o) - .debug_line 0x0000b230 0x2d8 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-strcmp.o) - .debug_line 0x0000b508 0x25f c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-callocr.o) - .debug_line 0x0000b767 0x2f2 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_udivdi3.o) - .debug_line 0x0000ba59 0x405 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_umoddi3.o) - .debug_line 0x0000be5e 0x430 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_addsub_df.o) - .debug_line 0x0000c28e 0x3e5 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_mul_df.o) - .debug_line 0x0000c673 0x301 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_div_df.o) - .debug_line 0x0000c974 0x129 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_eq_df.o) - .debug_line 0x0000ca9d 0x129 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_ne_df.o) - .debug_line 0x0000cbc6 0x129 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_gt_df.o) - .debug_line 0x0000ccef 0x129 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_ge_df.o) - .debug_line 0x0000ce18 0x129 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_lt_df.o) - .debug_line 0x0000cf41 0x175 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_si_to_df.o) - .debug_line 0x0000d0b6 0x149 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_df_to_si.o) - .debug_line 0x0000d1ff 0x94 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_thenan_df.o) - .debug_line 0x0000d293 0x189 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_usi_to_df.o) - .debug_line 0x0000d41c 0x24f c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-divmod.o) - .debug_line 0x0000d66b 0x11a c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-mul.o) - .debug_line 0x0000d785 0x14f c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_muldi3.o) - .debug_line 0x0000d8d4 0xaa c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_clz.o) - .debug_line 0x0000d97e 0x105 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_clzsi2.o) - .debug_line 0x0000da83 0x222 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_pack_df.o) - .debug_line 0x0000dca5 0x1e4 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_unpack_df.o) - .debug_line 0x0000de89 0x187 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_fpcmp_parts_df.o) - .debug_line 0x0000e010 0x299 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_close.o) - .debug_line 0x0000e2a9 0x254 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_dev.o) - .debug_line 0x0000e4fd 0x1aa ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_errno.o) - .debug_line 0x0000e6a7 0x2a1 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_fstat.o) - .debug_line 0x0000e948 0x2a2 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_isatty.o) - .debug_line 0x0000ebea 0x217 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_load.o) - .debug_line 0x0000ee01 0x2a1 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_lseek.o) - .debug_line 0x0000f0a2 0x2ca ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_main.o) - .debug_line 0x0000f36c 0x20f ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_malloc_lock.o) - .debug_line 0x0000f57b 0x2ff ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_open.o) - .debug_line 0x0000f87a 0x2c8 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_read.o) - .debug_line 0x0000fb42 0xed ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_release_fd.o) - .debug_line 0x0000fc2f 0x261 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_sbrk.o) - .debug_line 0x0000fe90 0x2c9 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_write.o) - .debug_line 0x00010159 0x2eb ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_sys_init.o) - .debug_line 0x00010444 0x217 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_fd.o) - .debug_line 0x0001065b 0x4ab ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_init.o) - .debug_line 0x00010b06 0x317 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_ioctl.o) - .debug_line 0x00010e1d 0x3f7 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_read.o) - .debug_line 0x00011214 0x405 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_write.o) - .debug_line 0x00011619 0x8c1 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_lcd_16207.o) - .debug_line 0x00011eda 0x1b7 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_lcd_16207_fd.o) - .debug_line 0x00012091 0x2dc ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_alarm_start.o) - .debug_line 0x0001236d 0x1b5 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .debug_line 0x00012522 0x25a ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_dev_llist_insert.o) - .debug_line 0x0001277c 0x83 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_do_ctors.o) - .debug_line 0x000127ff 0x83 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_do_dtors.o) - .debug_line 0x00012882 0x26b ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_find_dev.o) - .debug_line 0x00012aed 0x27c ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_find_file.o) - .debug_line 0x00012d69 0x297 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_get_fd.o) - .debug_line 0x00013000 0x1b5 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .debug_line 0x000131b5 0x2c8 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_iic.o) - .debug_line 0x0001347d 0x249 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_iic_isr_register.o) - .debug_line 0x000136c6 0x2b4 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_io_redirect.o) - .debug_line 0x0001397a 0x6b ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_irq_entry.o) - .debug_line 0x000139e5 0x248 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_irq_handler.o) - .debug_line 0x00013c2d 0x72 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_irq_vars.o) - .debug_line 0x00013c9f 0x2dc ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_tick.o) - .debug_line 0x00013f7b 0x202 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_usleep.o) - .debug_line 0x0001417d 0x1ce ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - .debug_line 0x0001434b 0x25c ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_busy_sleep.o) - .debug_line 0x000145a7 0xab ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_exception_entry.o) - .debug_line 0x00014652 0x203 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-atexit.o) - .debug_line 0x00014855 0x81 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-ctype_.o) - .debug_line 0x000148d6 0x23b c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-exit.o) - .debug_line 0x00014b11 0x2a2 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-memcmp.o) - .debug_line 0x00014db3 0x316 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-__atexit.o) - .debug_line 0x000150c9 0x36a c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-__call_atexit.o) - .debug_line 0x00015433 0x206 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_exit.o) - -.debug_frame 0x00000000 0x1b08 - *(.debug_frame) - .debug_frame 0x00000000 0x48 obj/default/hello_world.o - .debug_frame 0x00000048 0x3c c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fclose.o) - .debug_frame 0x00000084 0x40 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fflush.o) - .debug_frame 0x000000c4 0x118 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-findfp.o) - .debug_frame 0x000001dc 0x40 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fopen.o) - .debug_frame 0x0000021c 0x4c c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-freer.o) - .debug_frame 0x00000268 0x48 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fseek.o) - .debug_frame 0x000002b0 0x2c c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fstatr.o) - .debug_frame 0x000002dc 0x60 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fwalk.o) - .debug_frame 0x0000033c 0x48 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fwrite.o) - .debug_frame 0x00000384 0x2c c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-makebuf.o) - .debug_frame 0x000003b0 0x38 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-mallocr.o) - .debug_frame 0x000003e8 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-memset.o) - .debug_frame 0x00000408 0x2c c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-openr.o) - .debug_frame 0x00000434 0x40 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-printf.o) - .debug_frame 0x00000474 0x3c c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-puts.o) - .debug_frame 0x000004b0 0x3c c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-refill.o) - .debug_frame 0x000004ec 0x2c c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-sbrkr.o) - .debug_frame 0x00000518 0x78 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-stdio.o) - .debug_frame 0x00000590 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-strlen.o) - .debug_frame 0x000005b0 0x64 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-vfprintf.o) - .debug_frame 0x00000614 0x2c c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-writer.o) - .debug_frame 0x00000640 0x2c c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-wsetup.o) - .debug_frame 0x0000066c 0x2c c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-closer.o) - .debug_frame 0x00000698 0x64 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-dtoa.o) - .debug_frame 0x000006fc 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-flags.o) - .debug_frame 0x0000071c 0x38 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fvwrite.o) - .debug_frame 0x00000754 0x2c c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-isattyr.o) - .debug_frame 0x00000780 0x70 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-locale.o) - .debug_frame 0x000007f0 0x2c c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-lseekr.o) - .debug_frame 0x0000081c 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-memchr.o) - .debug_frame 0x0000083c 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-memcpy.o) - .debug_frame 0x0000085c 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-memmove.o) - .debug_frame 0x0000087c 0x228 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-mprec.o) - .debug_frame 0x00000aa4 0x2c c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-readr.o) - .debug_frame 0x00000ad0 0x38 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-reallocr.o) - .debug_frame 0x00000b08 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-s_isinfd.o) - .debug_frame 0x00000b28 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-s_isnand.o) - .debug_frame 0x00000b48 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-strcmp.o) - .debug_frame 0x00000b68 0x2c c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-callocr.o) - .debug_frame 0x00000b94 0x38 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_udivdi3.o) - .debug_frame 0x00000bcc 0x38 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_umoddi3.o) - .debug_frame 0x00000c04 0x70 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_addsub_df.o) - .debug_frame 0x00000c74 0x3c c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_mul_df.o) - .debug_frame 0x00000cb0 0x30 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_div_df.o) - .debug_frame 0x00000ce0 0x2c c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_eq_df.o) - .debug_frame 0x00000d0c 0x2c c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_ne_df.o) - .debug_frame 0x00000d38 0x2c c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_gt_df.o) - .debug_frame 0x00000d64 0x2c c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_ge_df.o) - .debug_frame 0x00000d90 0x2c c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_lt_df.o) - .debug_frame 0x00000dbc 0x30 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_si_to_df.o) - .debug_frame 0x00000dec 0x28 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_df_to_si.o) - .debug_frame 0x00000e14 0x38 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_usi_to_df.o) - .debug_frame 0x00000e4c 0x70 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-divmod.o) - .debug_frame 0x00000ebc 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-mul.o) - .debug_frame 0x00000edc 0x40 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_muldi3.o) - .debug_frame 0x00000f1c 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_clzsi2.o) - .debug_frame 0x00000f3c 0x2c c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_pack_df.o) - .debug_frame 0x00000f68 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_unpack_df.o) - .debug_frame 0x00000f88 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_fpcmp_parts_df.o) - .debug_frame 0x00000fa8 0x48 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_close.o) - .debug_frame 0x00000ff0 0x2c ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_dev.o) - .debug_frame 0x0000101c 0x48 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_fstat.o) - .debug_frame 0x00001064 0x48 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_isatty.o) - .debug_frame 0x000010ac 0x48 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_load.o) - .debug_frame 0x000010f4 0x48 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_lseek.o) - .debug_frame 0x0000113c 0x2c ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_main.o) - .debug_frame 0x00001168 0x48 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_malloc_lock.o) - .debug_frame 0x000011b0 0x68 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_open.o) - .debug_frame 0x00001218 0x48 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_read.o) - .debug_frame 0x00001260 0x30 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_release_fd.o) - .debug_frame 0x00001290 0x2c ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_sbrk.o) - .debug_frame 0x000012bc 0x48 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_write.o) - .debug_frame 0x00001304 0x64 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_sys_init.o) - .debug_frame 0x00001368 0x80 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_fd.o) - .debug_frame 0x000013e8 0x80 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_init.o) - .debug_frame 0x00001468 0x2c ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_ioctl.o) - .debug_frame 0x00001494 0x2c ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_read.o) - .debug_frame 0x000014c0 0x2c ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_write.o) - .debug_frame 0x000014ec 0x124 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_lcd_16207.o) - .debug_frame 0x00001610 0x2c ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_lcd_16207_fd.o) - .debug_frame 0x0000163c 0x2c ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_alarm_start.o) - .debug_frame 0x00001668 0x2c ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .debug_frame 0x00001694 0x48 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_dev_llist_insert.o) - .debug_frame 0x000016dc 0x2c ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_do_ctors.o) - .debug_frame 0x00001708 0x2c ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_do_dtors.o) - .debug_frame 0x00001734 0x2c ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_find_dev.o) - .debug_frame 0x00001760 0x2c ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_find_file.o) - .debug_frame 0x0000178c 0x30 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_get_fd.o) - .debug_frame 0x000017bc 0x2c ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .debug_frame 0x000017e8 0x80 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_iic.o) - .debug_frame 0x00001868 0x2c ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_iic_isr_register.o) - .debug_frame 0x00001894 0x4c ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_io_redirect.o) - .debug_frame 0x000018e0 0x2c ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_irq_handler.o) - .debug_frame 0x0000190c 0x48 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_tick.o) - .debug_frame 0x00001954 0x2c ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_usleep.o) - .debug_frame 0x00001980 0x2c ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - .debug_frame 0x000019ac 0x2c ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_busy_sleep.o) - .debug_frame 0x000019d8 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-atexit.o) - .debug_frame 0x000019f8 0x28 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-exit.o) - .debug_frame 0x00001a20 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-memcmp.o) - .debug_frame 0x00001a40 0x34 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-__atexit.o) - .debug_frame 0x00001a74 0x4c c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-__call_atexit.o) - .debug_frame 0x00001ac0 0x48 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_exit.o) - -.debug_str 0x00000000 0x2558 - *(.debug_str) - .debug_str 0x00000000 0x20 obj/default/hello_world.o - .debug_str 0x00000020 0x4a6 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fclose.o) - 0x524 (size before relaxing) - .debug_str 0x000004c6 0x68 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fflush.o) - 0x540 (size before relaxing) - .debug_str 0x0000052e 0x105 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-findfp.o) - 0x602 (size before relaxing) - .debug_str 0x00000633 0x52 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fopen.o) - 0x533 (size before relaxing) - .debug_str 0x00000685 0x1f5 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-freer.o) - 0x651 (size before relaxing) - .debug_str 0x0000087a 0x13d c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fseek.o) - 0x640 (size before relaxing) - .debug_str 0x000009b7 0xe2 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fstatr.o) - 0x5ff (size before relaxing) - .debug_str 0x00000a99 0x61 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fwalk.o) - 0x543 (size before relaxing) - .debug_str 0x00000afa 0x8a c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fwrite.o) - 0x56d (size before relaxing) - .debug_str 0x00000b84 0x49 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-impure.o) - 0x528 (size before relaxing) - .debug_str 0x00000bcd 0x40 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-int_errno.o) - 0x171 (size before relaxing) - .debug_str 0x00000c0d 0x56 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-makebuf.o) - 0x614 (size before relaxing) - .debug_str 0x00000c63 0xef c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-mallocr.o) - 0x6ff (size before relaxing) - .debug_str 0x00000d52 0xf0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-memset.o) - 0x18c (size before relaxing) - .debug_str 0x00000e42 0x44 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-openr.o) - 0x51a (size before relaxing) - .debug_str 0x00000e86 0x56 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-printf.o) - 0x531 (size before relaxing) - .debug_str 0x00000edc 0x48 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-puts.o) - 0x557 (size before relaxing) - .debug_str 0x00000f24 0x50 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-refill.o) - 0x528 (size before relaxing) - .debug_str 0x00000f74 0x53 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-sbrkr.o) - 0x519 (size before relaxing) - .debug_str 0x00000fc7 0x5e c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-stdio.o) - 0x53f (size before relaxing) - .debug_str 0x00001025 0x45 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-strlen.o) - 0x18b (size before relaxing) - .debug_str 0x0000106a 0x183 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-vfprintf.o) - 0x706 (size before relaxing) - .debug_str 0x000011ed 0x4f c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-writer.o) - 0x51c (size before relaxing) - .debug_str 0x0000123c 0x49 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-wsetup.o) - 0x51a (size before relaxing) - .debug_str 0x00001285 0x46 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-closer.o) - 0x50c (size before relaxing) - .debug_str 0x000012cb 0x105 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-dtoa.o) - 0x60f (size before relaxing) - .debug_str 0x000013d0 0x4a c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-flags.o) - 0x50f (size before relaxing) - .debug_str 0x0000141a 0x69 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fvwrite.o) - 0x571 (size before relaxing) - .debug_str 0x00001483 0x48 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-isattyr.o) - 0x50e (size before relaxing) - .debug_str 0x000014cb 0x233 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-locale.o) - 0x6b7 (size before relaxing) - .debug_str 0x000016fe 0x46 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-lseekr.o) - 0x51a (size before relaxing) - .debug_str 0x00001744 0x58 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-memchr.o) - 0x199 (size before relaxing) - .debug_str 0x0000179c 0x6c c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-memcpy.o) - 0x136 (size before relaxing) - .debug_str 0x00001808 0x50 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-memmove.o) - 0x1ab (size before relaxing) - .debug_str 0x00001858 0xfb c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-mprec.o) - 0x61c (size before relaxing) - .debug_str 0x00001953 0x44 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-readr.o) - 0x51a (size before relaxing) - .debug_str 0x00001997 0x59 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-reallocr.o) - 0x5d1 (size before relaxing) - .debug_str 0x000019f0 0xea c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-s_isinfd.o) - 0x198 (size before relaxing) - .debug_str 0x00001ada 0x49 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-s_isnand.o) - 0x198 (size before relaxing) - .debug_str 0x00001b23 0x45 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-strcmp.o) - 0x171 (size before relaxing) - .debug_str 0x00001b68 0x19 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-callocr.o) - 0x550 (size before relaxing) - .debug_str 0x00001b81 0x147 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_udivdi3.o) - 0x1f7 (size before relaxing) - .debug_str 0x00001cc8 0xa c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_umoddi3.o) - 0x1f7 (size before relaxing) - .debug_str 0x00001cd2 0x137 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_addsub_df.o) - 0x26f (size before relaxing) - .debug_str 0x00001e09 0x40 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_mul_df.o) - 0x241 (size before relaxing) - .debug_str 0x00001e49 0x35 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_div_df.o) - 0x231 (size before relaxing) - .debug_str 0x00001e7e 0x8 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_eq_df.o) - 0x1fe (size before relaxing) - .debug_str 0x00001e86 0x8 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_ne_df.o) - 0x1fe (size before relaxing) - .debug_str 0x00001e8e 0x8 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_gt_df.o) - 0x1fe (size before relaxing) - .debug_str 0x00001e96 0x8 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_ge_df.o) - 0x1fe (size before relaxing) - .debug_str 0x00001e9e 0x8 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_lt_df.o) - 0x1fe (size before relaxing) - .debug_str 0x00001ea6 0x18 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_si_to_df.o) - 0x1de (size before relaxing) - .debug_str 0x00001ebe 0xa c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_df_to_si.o) - 0x207 (size before relaxing) - .debug_str 0x00000000 0x1a3 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_thenan_df.o) - .debug_str 0x00001ec8 0x14 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_usi_to_df.o) - 0x1da (size before relaxing) - .debug_str 0x00001edc 0x76 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-divmod.o) - 0x1b4 (size before relaxing) - .debug_str 0x00001f52 0x37 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-mul.o) - 0x175 (size before relaxing) - .debug_str 0x00001f89 0x9 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_muldi3.o) - 0x1ac (size before relaxing) - .debug_str 0x00000000 0x161 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_clz.o) - .debug_str 0x00001f92 0x9 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_clzsi2.o) - 0x17e (size before relaxing) - .debug_str 0x00001f9b 0x10 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_pack_df.o) - 0x206 (size before relaxing) - .debug_str 0x00001fab 0xb c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_unpack_df.o) - 0x1e8 (size before relaxing) - .debug_str 0x00001fb6 0x10 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_fpcmp_parts_df.o) - 0x1c6 (size before relaxing) - .debug_str 0x00001fc6 0x12 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_close.o) - .debug_str 0x00001fd8 0x12 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_dev.o) - .debug_str 0x00001fea 0x12 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_errno.o) - .debug_str 0x00001ffc 0x12 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_fstat.o) - .debug_str 0x0000200e 0x12 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_isatty.o) - .debug_str 0x00002020 0x12 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_load.o) - .debug_str 0x00002032 0x12 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_lseek.o) - .debug_str 0x00002044 0x12 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_main.o) - .debug_str 0x00002056 0x20 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_malloc_lock.o) - .debug_str 0x00002076 0x12 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_open.o) - .debug_str 0x00002088 0x12 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_read.o) - .debug_str 0x0000209a 0x1a ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_sbrk.o) - .debug_str 0x000020b4 0x12 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_write.o) - .debug_str 0x000020c6 0x12 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_sys_init.o) - .debug_str 0x000020d8 0x12 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_fd.o) - .debug_str 0x000020ea 0x1a ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_init.o) - .debug_str 0x00002104 0x12 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_ioctl.o) - .debug_str 0x00002116 0x1a ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_read.o) - .debug_str 0x00002130 0x1a ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_write.o) - .debug_str 0x0000214a 0x25 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_lcd_16207.o) - .debug_str 0x0000216f 0x12 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_lcd_16207_fd.o) - .debug_str 0x00002181 0x23 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_alarm_start.o) - .debug_str 0x000021a4 0x12 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .debug_str 0x000021b6 0x12 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_dev_llist_insert.o) - .debug_str 0x000021c8 0x12 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_find_dev.o) - .debug_str 0x000021da 0x12 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_find_file.o) - .debug_str 0x000021ec 0x12 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_get_fd.o) - .debug_str 0x000021fe 0x12 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .debug_str 0x00002210 0x18 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_iic.o) - .debug_str 0x00002228 0x1a ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_iic_isr_register.o) - .debug_str 0x00002242 0x12 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_io_redirect.o) - .debug_str 0x00002254 0x12 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_irq_handler.o) - .debug_str 0x00002266 0x1a ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_tick.o) - .debug_str 0x00002280 0x12 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_usleep.o) - .debug_str 0x00002292 0x12 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - .debug_str 0x000022a4 0x12 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_busy_sleep.o) - .debug_str 0x000022b6 0x3e c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-atexit.o) - 0x1cd (size before relaxing) - .debug_str 0x000022f4 0xf0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-ctype_.o) - 0x113 (size before relaxing) - .debug_str 0x000023e4 0x41 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-exit.o) - 0x51a (size before relaxing) - .debug_str 0x00002425 0x45 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-memcmp.o) - 0x178 (size before relaxing) - .debug_str 0x0000246a 0x54 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-__atexit.o) - 0x532 (size before relaxing) - .debug_str 0x000024be 0x7e c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-__call_atexit.o) - 0x55c (size before relaxing) - .debug_str 0x0000253c 0x1c ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_exit.o) - -.debug_loc 0x00000000 0xc7eb - *(.debug_loc) - .debug_loc 0x00000000 0x56 obj/default/hello_world.o - .debug_loc 0x00000056 0xe4 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fclose.o) - .debug_loc 0x0000013a 0x1f6 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fflush.o) - .debug_loc 0x00000330 0x1e1 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-findfp.o) - .debug_loc 0x00000511 0x1c9 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fopen.o) - .debug_loc 0x000006da 0x4a7 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-freer.o) - .debug_loc 0x00000b81 0x348 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fseek.o) - .debug_loc 0x00000ec9 0x79 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fstatr.o) - .debug_loc 0x00000f42 0x1d2 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fwalk.o) - .debug_loc 0x00001114 0x183 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fwrite.o) - .debug_loc 0x00001297 0x11c c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-makebuf.o) - .debug_loc 0x000013b3 0xaeb c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-mallocr.o) - .debug_loc 0x00001e9e 0xa1 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-memset.o) - .debug_loc 0x00001f3f 0x97 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-openr.o) - .debug_loc 0x00001fd6 0xcb c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-printf.o) - .debug_loc 0x000020a1 0xa2 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-puts.o) - .debug_loc 0x00002143 0xd1 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-refill.o) - .debug_loc 0x00002214 0x5b c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-sbrkr.o) - .debug_loc 0x0000226f 0x21f c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-stdio.o) - .debug_loc 0x0000248e 0x3c c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-strlen.o) - .debug_loc 0x000024ca 0x1dc0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-vfprintf.o) - .debug_loc 0x0000428a 0x97 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-writer.o) - .debug_loc 0x00004321 0x7c c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-wsetup.o) - .debug_loc 0x0000439d 0x5b c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-closer.o) - .debug_loc 0x000043f8 0x1da7 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-dtoa.o) - .debug_loc 0x0000619f 0xa4 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-flags.o) - .debug_loc 0x00006243 0x4e4 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fvwrite.o) - .debug_loc 0x00006727 0x5b c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-isattyr.o) - .debug_loc 0x00006782 0xe1 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-locale.o) - .debug_loc 0x00006863 0x97 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-lseekr.o) - .debug_loc 0x000068fa 0x106 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-memchr.o) - .debug_loc 0x00006a00 0xca c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-memcpy.o) - .debug_loc 0x00006aca 0x117 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-memmove.o) - .debug_loc 0x00006be1 0x1547 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-mprec.o) - .debug_loc 0x00008128 0x97 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-readr.o) - .debug_loc 0x000081bf 0x8c0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-reallocr.o) - .debug_loc 0x00008a7f 0x36 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-s_isinfd.o) - .debug_loc 0x00008ab5 0x18 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-s_isnand.o) - .debug_loc 0x00008acd 0x65 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-strcmp.o) - .debug_loc 0x00008b32 0xff c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-callocr.o) - .debug_loc 0x00008c31 0xc12 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_udivdi3.o) - .debug_loc 0x00009843 0xbcc c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_umoddi3.o) - .debug_loc 0x0000a40f 0x47a c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_addsub_df.o) - .debug_loc 0x0000a889 0x3b4 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_mul_df.o) - .debug_loc 0x0000ac3d 0x1df c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_div_df.o) - .debug_loc 0x0000ae1c 0x70 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_eq_df.o) - .debug_loc 0x0000ae8c 0x70 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_ne_df.o) - .debug_loc 0x0000aefc 0x70 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_gt_df.o) - .debug_loc 0x0000af6c 0x70 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_ge_df.o) - .debug_loc 0x0000afdc 0x70 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_lt_df.o) - .debug_loc 0x0000b04c 0x9a c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_si_to_df.o) - .debug_loc 0x0000b0e6 0x8b c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_df_to_si.o) - .debug_loc 0x0000b171 0x5b c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_usi_to_df.o) - .debug_loc 0x0000b1cc 0x1d2 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-divmod.o) - .debug_loc 0x0000b39e 0x4f c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-mul.o) - .debug_loc 0x0000b3ed 0x103 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_muldi3.o) - .debug_loc 0x0000b4f0 0x1e c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_clzsi2.o) - .debug_loc 0x0000b50e 0x184 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_pack_df.o) - .debug_loc 0x0000b692 0xe5 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_unpack_df.o) - .debug_loc 0x0000b777 0x56 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_close.o) - .debug_loc 0x0000b7cd 0x2b ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_dev.o) - .debug_loc 0x0000b7f8 0x56 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_fstat.o) - .debug_loc 0x0000b84e 0x57 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_isatty.o) - .debug_loc 0x0000b8a5 0x56 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_load.o) - .debug_loc 0x0000b8fb 0x56 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_lseek.o) - .debug_loc 0x0000b951 0x2b ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_main.o) - .debug_loc 0x0000b97c 0x56 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_malloc_lock.o) - .debug_loc 0x0000b9d2 0x81 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_open.o) - .debug_loc 0x0000ba53 0x56 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_read.o) - .debug_loc 0x0000baa9 0x2b ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_release_fd.o) - .debug_loc 0x0000bad4 0x2b ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_sbrk.o) - .debug_loc 0x0000baff 0x56 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_write.o) - .debug_loc 0x0000bb55 0x81 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_sys_init.o) - .debug_loc 0x0000bbd6 0xac ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_fd.o) - .debug_loc 0x0000bc82 0xac ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_init.o) - .debug_loc 0x0000bd2e 0x2b ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_ioctl.o) - .debug_loc 0x0000bd59 0x2b ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_read.o) - .debug_loc 0x0000bd84 0x2b ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_jtag_uart_write.o) - .debug_loc 0x0000bdaf 0x184 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_lcd_16207.o) - .debug_loc 0x0000bf33 0x2b ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_avalon_lcd_16207_fd.o) - .debug_loc 0x0000bf5e 0x2b ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_alarm_start.o) - .debug_loc 0x0000bf89 0x2b ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .debug_loc 0x0000bfb4 0x56 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_dev_llist_insert.o) - .debug_loc 0x0000c00a 0x2b ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_do_ctors.o) - .debug_loc 0x0000c035 0x2b ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_do_dtors.o) - .debug_loc 0x0000c060 0x2b ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_find_dev.o) - .debug_loc 0x0000c08b 0x2b ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_find_file.o) - .debug_loc 0x0000c0b6 0x2b ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_get_fd.o) - .debug_loc 0x0000c0e1 0x2b ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .debug_loc 0x0000c10c 0xac ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_iic.o) - .debug_loc 0x0000c1b8 0x2b ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_iic_isr_register.o) - .debug_loc 0x0000c1e3 0x56 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_io_redirect.o) - .debug_loc 0x0000c239 0x2b ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_irq_handler.o) - .debug_loc 0x0000c264 0x56 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_tick.o) - .debug_loc 0x0000c2ba 0x2b ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_usleep.o) - .debug_loc 0x0000c2e5 0x2b ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - .debug_loc 0x0000c310 0x2b ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_busy_sleep.o) - .debug_loc 0x0000c33b 0x1e c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-atexit.o) - .debug_loc 0x0000c359 0x3d c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-exit.o) - .debug_loc 0x0000c396 0x114 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-memcmp.o) - .debug_loc 0x0000c4aa 0x120 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-__atexit.o) - .debug_loc 0x0000c5ca 0x1cb c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-__call_atexit.o) - .debug_loc 0x0000c795 0x56 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_exit.o) - -.debug_macinfo - *(.debug_macinfo) - -.debug_weaknames - *(.debug_weaknames) - -.debug_funcnames - *(.debug_funcnames) - -.debug_typenames - *(.debug_typenames) - -.debug_varnames - *(.debug_varnames) - -.debug_alt_sim_info - 0x00000000 0x40 - *(.debug_alt_sim_info) - .debug_alt_sim_info - 0x00000000 0x10 ../qsys_tutorial_lcd3_bsp//obj/HAL/src/crt0.o - .debug_alt_sim_info - 0x00000010 0x30 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_busy_sleep.o) - 0x00032000 __alt_data_end = 0x32000 - 0x00032000 PROVIDE (__alt_stack_pointer, __alt_data_end) - 0x00012180 PROVIDE (__alt_stack_limit, __alt_stack_base) - 0x00012180 PROVIDE (__alt_heap_start, end) - 0x00032000 PROVIDE (__alt_heap_limit, 0x32000) -OUTPUT(qsys_tutorial_lcd3.elf elf32-littlenios2) - -.debug_ranges 0x00000000 0x9e0 - .debug_ranges 0x00000000 0x20 ../qsys_tutorial_lcd3_bsp//obj/HAL/src/crt0.o - .debug_ranges 0x00000020 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fflush.o) - .debug_ranges 0x00000040 0xa0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fwalk.o) - .debug_ranges 0x000000e0 0x70 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-mallocr.o) - .debug_ranges 0x00000150 0x168 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-vfprintf.o) - .debug_ranges 0x000002b8 0x28 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-fvwrite.o) - .debug_ranges 0x000002e0 0x110 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-reallocr.o) - .debug_ranges 0x000003f0 0x38 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-callocr.o) - .debug_ranges 0x00000428 0x190 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_udivdi3.o) - .debug_ranges 0x000005b8 0x1c0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_umoddi3.o) - .debug_ranges 0x00000778 0x30 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_addsub_df.o) - .debug_ranges 0x000007a8 0x88 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_mul_df.o) - .debug_ranges 0x00000830 0x50 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_div_df.o) - .debug_ranges 0x00000880 0x18 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_usi_to_df.o) - .debug_ranges 0x00000898 0x88 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_muldi3.o) - .debug_ranges 0x00000920 0x28 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_clzsi2.o) - .debug_ranges 0x00000948 0x28 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(_pack_df.o) - .debug_ranges 0x00000970 0x28 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_irq_entry.o) - .debug_ranges 0x00000998 0x30 ../qsys_tutorial_lcd3_bsp/\libhal_bsp.a(alt_exception_entry.o) - .debug_ranges 0x000009c8 0x18 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libc.a(lib_a-__call_atexit.o) diff --git a/software/qsys_tutorial_lcd3/qsys_tutorial_lcd3.objdump b/software/qsys_tutorial_lcd3/qsys_tutorial_lcd3.objdump deleted file mode 100644 index a0302b5..0000000 --- a/software/qsys_tutorial_lcd3/qsys_tutorial_lcd3.objdump +++ /dev/null @@ -1,17880 +0,0 @@ - -qsys_tutorial_lcd3.elf: file format elf32-littlenios2 -qsys_tutorial_lcd3.elf -architecture: nios2, flags 0x00000112: -EXEC_P, HAS_SYMS, D_PAGED -start address 0x000001b4 - -Program Header: - LOAD off 0x00001000 vaddr 0x00000000 paddr 0x00000000 align 2**12 - filesz 0x00000020 memsz 0x00000020 flags r-x - LOAD off 0x00001020 vaddr 0x00000020 paddr 0x00000020 align 2**12 - filesz 0x0000e76c memsz 0x0000e76c flags r-x - LOAD off 0x0000f78c vaddr 0x0000e78c paddr 0x00010310 align 2**12 - filesz 0x00001b84 memsz 0x00001b84 flags rw- - LOAD off 0x00011e94 vaddr 0x00011e94 paddr 0x00011e94 align 2**12 - filesz 0x00000000 memsz 0x000002ec flags rw- - -Sections: -Idx Name Size VMA LMA File off Algn - 0 .entry 00000020 00000000 00000000 00001000 2**5 - CONTENTS, ALLOC, LOAD, READONLY, CODE - 1 .exceptions 00000194 00000020 00000020 00001020 2**2 - CONTENTS, ALLOC, LOAD, READONLY, CODE - 2 .text 0000dfa8 000001b4 000001b4 000011b4 2**2 - CONTENTS, ALLOC, LOAD, READONLY, CODE - 3 .rodata 00000630 0000e15c 0000e15c 0000f15c 2**2 - CONTENTS, ALLOC, LOAD, READONLY, DATA - 4 .rwdata 00001b84 0000e78c 00010310 0000f78c 2**2 - CONTENTS, ALLOC, LOAD, DATA, SMALL_DATA - 5 .bss 000002ec 00011e94 00011e94 00011e94 2**2 - ALLOC, SMALL_DATA - 6 .comment 00000026 00000000 00000000 00011310 2**0 - CONTENTS, READONLY - 7 .debug_aranges 00000d98 00000000 00000000 00011338 2**3 - CONTENTS, READONLY, DEBUGGING - 8 .debug_pubnames 000014d6 00000000 00000000 000120d0 2**0 - CONTENTS, READONLY, DEBUGGING - 9 .debug_info 000285c7 00000000 00000000 000135a6 2**0 - CONTENTS, READONLY, DEBUGGING - 10 .debug_abbrev 000086c2 00000000 00000000 0003bb6d 2**0 - CONTENTS, READONLY, DEBUGGING - 11 .debug_line 00015639 00000000 00000000 0004422f 2**0 - CONTENTS, READONLY, DEBUGGING - 12 .debug_frame 00001b08 00000000 00000000 00059868 2**2 - CONTENTS, READONLY, DEBUGGING - 13 .debug_str 00002558 00000000 00000000 0005b370 2**0 - CONTENTS, READONLY, DEBUGGING - 14 .debug_loc 0000c7eb 00000000 00000000 0005d8c8 2**0 - CONTENTS, READONLY, DEBUGGING - 15 .debug_alt_sim_info 00000040 00000000 00000000 0006a0b4 2**2 - CONTENTS, READONLY, DEBUGGING - 16 .debug_ranges 000009e0 00000000 00000000 0006a0f8 2**3 - CONTENTS, READONLY, DEBUGGING - 17 .thread_model 00000003 00000000 00000000 0006dcb5 2**0 - CONTENTS, READONLY - 18 .cpu 0000000f 00000000 00000000 0006dcb8 2**0 - CONTENTS, READONLY - 19 .qsys 00000001 00000000 00000000 0006dcc7 2**0 - CONTENTS, READONLY - 20 .simulation_enabled 00000001 00000000 00000000 0006dcc8 2**0 - CONTENTS, READONLY - 21 .stderr_dev 00000009 00000000 00000000 0006dcc9 2**0 - CONTENTS, READONLY - 22 .stdin_dev 00000009 00000000 00000000 0006dcd2 2**0 - CONTENTS, READONLY - 23 .stdout_dev 00000009 00000000 00000000 0006dcdb 2**0 - CONTENTS, READONLY - 24 .sopc_system_name 0000000b 00000000 00000000 0006dce4 2**0 - CONTENTS, READONLY - 25 .quartus_project_dir 00000030 00000000 00000000 0006dcef 2**0 - CONTENTS, READONLY - 26 .sopcinfo 0007d9aa 00000000 00000000 0006dd1f 2**0 - CONTENTS, READONLY -SYMBOL TABLE: -00000000 l d .entry 00000000 .entry -00000020 l d .exceptions 00000000 .exceptions -000001b4 l d .text 00000000 .text -0000e15c l d .rodata 00000000 .rodata -0000e78c l d .rwdata 00000000 .rwdata -00011e94 l d .bss 00000000 .bss -00000000 l d .comment 00000000 .comment -00000000 l d .debug_aranges 00000000 .debug_aranges -00000000 l d .debug_pubnames 00000000 .debug_pubnames -00000000 l d .debug_info 00000000 .debug_info -00000000 l d .debug_abbrev 00000000 .debug_abbrev -00000000 l d .debug_line 00000000 .debug_line -00000000 l d .debug_frame 00000000 .debug_frame -00000000 l d .debug_str 00000000 .debug_str -00000000 l d .debug_loc 00000000 .debug_loc -00000000 l d .debug_alt_sim_info 00000000 .debug_alt_sim_info -00000000 l d .debug_ranges 00000000 .debug_ranges -000001ec l .text 00000000 alt_after_alt_main -00000000 l df *ABS* 00000000 alt_irq_handler.c -00000000 l df *ABS* 00000000 hello_world.c -00000000 l df *ABS* 00000000 fclose.c -00000000 l df *ABS* 00000000 fflush.c -00000000 l df *ABS* 00000000 findfp.c -0000064c l F .text 00000058 std -00000758 l F .text 00000008 __fp_lock -00000760 l F .text 00000008 __fp_unlock -00000000 l df *ABS* 00000000 fopen.c -00000000 l df *ABS* 00000000 mallocr.c -00000000 l df *ABS* 00000000 fseek.c -00000000 l df *ABS* 00000000 fstatr.c -00000000 l df *ABS* 00000000 fwalk.c -00000000 l df *ABS* 00000000 fwrite.c -00000000 l df *ABS* 00000000 impure.c -0000e78c l O .rwdata 00000400 impure_data -00000000 l df *ABS* 00000000 int_errno.c -00000000 l df *ABS* 00000000 makebuf.c -00000000 l df *ABS* 00000000 mallocr.c -00000000 l df *ABS* 00000000 memset.c -00000000 l df *ABS* 00000000 openr.c -00000000 l df *ABS* 00000000 printf.c -00000000 l df *ABS* 00000000 puts.c -00000000 l df *ABS* 00000000 refill.c -000022a4 l F .text 0000001c lflush -00000000 l df *ABS* 00000000 sbrkr.c -00000000 l df *ABS* 00000000 stdio.c -00000000 l df *ABS* 00000000 strlen.c -00000000 l df *ABS* 00000000 vfprintf.c -000024f0 l F .text 00000058 __sprint_r -0000e22e l O .rodata 00000010 blanks.3452 -0000e21e l O .rodata 00000010 zeroes.3453 -00000000 l df *ABS* 00000000 writer.c -00000000 l df *ABS* 00000000 wsetup.c -00000000 l df *ABS* 00000000 closer.c -00000000 l df *ABS* 00000000 dtoa.c -00004654 l F .text 00000244 quorem -00000000 l df *ABS* 00000000 flags.c -00000000 l df *ABS* 00000000 fvwrite.c -00000000 l df *ABS* 00000000 isattyr.c -00000000 l df *ABS* 00000000 locale.c -000102dc l O .rwdata 00000004 charset -0000e260 l O .rodata 00000030 lconv -00000000 l df *ABS* 00000000 lseekr.c -00000000 l df *ABS* 00000000 memchr.c -00000000 l df *ABS* 00000000 memcpy.c -00000000 l df *ABS* 00000000 memmove.c -00000000 l df *ABS* 00000000 mprec.c -0000e3a8 l O .rodata 0000000c p05.2458 -00000000 l df *ABS* 00000000 readr.c -00000000 l df *ABS* 00000000 mallocr.c -00000000 l df *ABS* 00000000 s_isinfd.c -00000000 l df *ABS* 00000000 s_isnand.c -00000000 l df *ABS* 00000000 strcmp.c -00000000 l df *ABS* 00000000 mallocr.c -00000000 l df *ABS* 00000000 libgcc2.c -00000000 l df *ABS* 00000000 libgcc2.c -00000000 l df *ABS* 00000000 dp-bit.c -00008d50 l F .text 00000410 _fpadd_parts -00000000 l df *ABS* 00000000 dp-bit.c -00000000 l df *ABS* 00000000 dp-bit.c -00000000 l df *ABS* 00000000 dp-bit.c -00000000 l df *ABS* 00000000 dp-bit.c -00000000 l df *ABS* 00000000 dp-bit.c -00000000 l df *ABS* 00000000 dp-bit.c -00000000 l df *ABS* 00000000 dp-bit.c -00000000 l df *ABS* 00000000 dp-bit.c -00000000 l df *ABS* 00000000 dp-bit.c -00000000 l df *ABS* 00000000 dp-bit.c -00000000 l df *ABS* 00000000 dp-bit.c -00000000 l df *ABS* 00000000 lib2-divmod.c -00009e7c l F .text 0000007c udivmodsi4 -00000000 l df *ABS* 00000000 lib2-mul.c -00000000 l df *ABS* 00000000 libgcc2.c -00000000 l df *ABS* 00000000 libgcc2.c -00000000 l df *ABS* 00000000 libgcc2.c -00000000 l df *ABS* 00000000 dp-bit.c -00000000 l df *ABS* 00000000 dp-bit.c -00000000 l df *ABS* 00000000 dp-bit.c -00000000 l df *ABS* 00000000 alt_close.c -0000a7b8 l F .text 00000060 alt_get_errno -00000000 l df *ABS* 00000000 alt_dev.c -0000a818 l F .text 0000002c alt_dev_null_write -00000000 l df *ABS* 00000000 alt_errno.c -00000000 l df *ABS* 00000000 alt_fstat.c -0000a91c l F .text 00000060 alt_get_errno -00000000 l df *ABS* 00000000 alt_isatty.c -0000aa40 l F .text 00000060 alt_get_errno -00000000 l df *ABS* 00000000 alt_load.c -0000ab20 l F .text 0000006c alt_load_section -00000000 l df *ABS* 00000000 alt_lseek.c -0000ac80 l F .text 00000060 alt_get_errno -00000000 l df *ABS* 00000000 alt_main.c -00000000 l df *ABS* 00000000 alt_malloc_lock.c -00000000 l df *ABS* 00000000 alt_open.c -0000ad8c l F .text 000000f8 alt_file_locked -0000b010 l F .text 00000060 alt_get_errno -00000000 l df *ABS* 00000000 alt_read.c -0000b194 l F .text 00000060 alt_get_errno -00000000 l df *ABS* 00000000 alt_release_fd.c -00000000 l df *ABS* 00000000 alt_sbrk.c -000102f8 l O .rwdata 00000004 heap_end -00000000 l df *ABS* 00000000 alt_write.c -0000b44c l F .text 00000060 alt_get_errno -00000000 l df *ABS* 00000000 alt_sys_init.c -0000f148 l O .rwdata 00001060 jtag_uart -000101a8 l O .rwdata 00000120 lcd_16207_0 -0000b53c l F .text 00000038 alt_dev_reg -00000000 l df *ABS* 00000000 altera_avalon_jtag_uart_fd.c -00000000 l df *ABS* 00000000 altera_avalon_jtag_uart_init.c -0000b77c l F .text 00000228 altera_avalon_jtag_uart_irq -0000b9a4 l F .text 000000b0 altera_avalon_jtag_uart_timeout -00000000 l df *ABS* 00000000 altera_avalon_jtag_uart_ioctl.c -00000000 l df *ABS* 00000000 altera_avalon_jtag_uart_read.c -00000000 l df *ABS* 00000000 altera_avalon_jtag_uart_write.c -00000000 l df *ABS* 00000000 altera_avalon_lcd_16207.c -000102fc l O .rwdata 00000004 colstart -0000c020 l F .text 000000b8 lcd_write_command -0000c0d8 l F .text 000000d4 lcd_write_data -0000c1ac l F .text 000000d8 lcd_clear_screen -0000c284 l F .text 00000214 lcd_repaint_screen -0000c498 l F .text 000000e0 lcd_scroll_up -0000c578 l F .text 000002e4 lcd_handle_escape -0000cd98 l F .text 000000cc alt_lcd_16207_timeout -00000000 l df *ABS* 00000000 altera_avalon_lcd_16207_fd.c -00000000 l df *ABS* 00000000 alt_alarm_start.c -00000000 l df *ABS* 00000000 alt_dcache_flush_all.c -00000000 l df *ABS* 00000000 alt_dev_llist_insert.c -0000d21c l F .text 00000060 alt_get_errno -00000000 l df *ABS* 00000000 alt_do_ctors.c -00000000 l df *ABS* 00000000 alt_do_dtors.c -00000000 l df *ABS* 00000000 alt_find_dev.c -00000000 l df *ABS* 00000000 alt_find_file.c -00000000 l df *ABS* 00000000 alt_get_fd.c -00000000 l df *ABS* 00000000 alt_icache_flush_all.c -00000000 l df *ABS* 00000000 alt_iic.c -00000000 l df *ABS* 00000000 alt_iic_isr_register.c -00000000 l df *ABS* 00000000 alt_io_redirect.c -0000d8b0 l F .text 000000d8 alt_open_fd -00000000 l df *ABS* 00000000 alt_irq_vars.c -00000000 l df *ABS* 00000000 alt_tick.c -00000000 l df *ABS* 00000000 alt_usleep.c -00000000 l df *ABS* 00000000 altera_nios2_qsys_irq.c -00000000 l df *ABS* 00000000 alt_busy_sleep.c -00000000 l df *ABS* 00000000 atexit.c -00000000 l df *ABS* 00000000 ctype_.c -0000e609 l O .rodata 00000180 _ctype_b -00000000 l df *ABS* 00000000 exit.c -00000000 l df *ABS* 00000000 memcmp.c -00000000 l df *ABS* 00000000 __atexit.c -00000000 l df *ABS* 00000000 __call_atexit.c -0000df44 l F .text 00000004 register_fini -00000000 l df *ABS* 00000000 alt_exit.c -0000e0f8 l F .text 00000040 alt_sim_halt -00006ba4 g F .text 00000094 _mprec_log10 -00006c90 g F .text 00000088 __any_on -00006388 g F .text 00000070 _isatty_r -0000e380 g O .rodata 00000028 __mprec_tinytens -0000ace0 g F .text 0000006c alt_main -0000202c g F .text 000000a0 _puts_r -00011ef0 g O .bss 00000100 alt_irq -000064bc g F .text 00000078 _lseek_r -00010310 g *ABS* 00000000 __flash_rwdata_start -00005e4c g F .text 000000a0 __sflags -00009870 g F .text 00000088 __eqdf2 -00012180 g *ABS* 00000000 __alt_heap_start -00001fb4 g F .text 00000044 printf -00002338 g F .text 00000068 __sseek -000006b4 g F .text 000000a4 __sinit -0000641c g F .text 00000084 _setlocale_r -000007b4 g F .text 0000009c __sfmoreglue -0000ad6c g F .text 00000020 __malloc_unlock -000066b8 g F .text 000000e0 memmove -000007a4 g F .text 00000010 _cleanup -00006d18 g F .text 000000bc _Balloc -00009980 g F .text 00000088 __gtdf2 -00000000 w *UND* 00000000 __errno -00000000 g F .entry 0000000c __reset -00000020 g *ABS* 00000000 __flash_exceptions_start -000012f0 g F .text 00000074 _fstat_r -00011e94 g O .bss 00000004 errno -00011eb4 g O .bss 00000004 alt_argv -000182c8 g *ABS* 00000000 _gp -0000dba4 g F .text 00000030 usleep -0000efc8 g O .rwdata 00000180 alt_fd_list -00000248 g F .text 000000b0 hello -0000d344 g F .text 00000094 alt_find_dev -00006618 g F .text 000000a0 memcpy -00000798 g F .text 0000000c _cleanup_r -00009b18 g F .text 000000f8 __floatsidf -0000d988 g F .text 00000078 alt_io_redirect -00009a90 g F .text 00000088 __ltdf2 -0000e15c g *ABS* 00000000 __DTOR_END__ -000020cc g F .text 00000014 puts -00006af4 g F .text 000000b0 __ratio -0000bbbc g F .text 00000224 altera_avalon_jtag_uart_read -00000000 w *UND* 00000000 malloc -00001ff8 g F .text 00000034 _printf_r -00009fb8 g F .text 00000008 __udivsi3 -0000a97c g F .text 000000c4 isatty -0000e290 g O .rodata 000000c8 __mprec_tens -000063f8 g F .text 00000008 __locale_charset -00011e98 g O .bss 00000004 __malloc_top_pad -000102d8 g O .rwdata 00000004 __mb_cur_max -00006400 g F .text 0000000c _localeconv_r -0000747c g F .text 0000003c __i2b -00005eec g F .text 0000049c __sfvwrite_r -000022c0 g F .text 00000070 _sbrk_r -00007824 g F .text 00000078 _read_r -0000ef94 g O .rwdata 0000000c __lc_ctype -000102f0 g O .rwdata 00000004 alt_max_fd -0000a4b8 g F .text 00000138 __unpack_d -000002f8 g F .text 00000110 _fclose_r -00000618 g F .text 00000034 fflush -00011e9c g O .bss 00000004 __malloc_max_sbrked_mem -000091e0 g F .text 00000074 __adddf3 -000069d4 g F .text 00000120 __b2d -000086f0 g F .text 00000660 __umoddi3 -0000ab8c g F .text 000000f4 lseek -000102cc g O .rwdata 00000004 _global_impure_ptr -0000789c g F .text 000005f4 _realloc_r -00012180 g *ABS* 00000000 __bss_end -0000d7b8 g F .text 000000f8 alt_iic_isr_register -0000da98 g F .text 0000010c alt_tick -00008084 g F .text 0000066c __udivdi3 -0000e358 g O .rodata 00000028 __mprec_bigtens -00007704 g F .text 00000120 __s2b -00009ce8 g F .text 00000194 __floatunsidf -000068f4 g F .text 00000060 __mcmp -0001030c g O .rwdata 00000004 __ctype_ptr -00000780 g F .text 00000018 __fp_lock_all -0000d770 g F .text 00000048 alt_ic_irq_enabled -0000da00 g F .text 00000098 alt_alarm_stop -00011ebc g O .bss 00000004 alt_irq_active -000000ec g F .exceptions 000000c8 alt_irq_handler -0000efa0 g O .rwdata 00000028 alt_dev_null -0000d14c g F .text 0000001c alt_dcache_flush_all -000067c0 g F .text 00000070 __hi0bits -00009c10 g F .text 000000d8 __fixdfsi -00010310 g *ABS* 00000000 __ram_rwdata_end -00000000 g *ABS* 00000000 __alt_mem_onchip_memory -000102e8 g O .rwdata 00000008 alt_dev_list -0000b328 g F .text 00000124 write -0000e78c g *ABS* 00000000 __ram_rodata_end -0000a844 g F .text 000000d8 fstat -000075e4 g F .text 00000120 __pow5mult -00011ea4 g O .bss 00000004 __nlocale_changed -00009fc0 g F .text 00000008 __umodsi3 -00012180 g *ABS* 00000000 end -0000c85c g F .text 0000053c altera_avalon_lcd_16207_write -000012cc g F .text 00000024 fseek -0000b6bc g F .text 000000c0 altera_avalon_jtag_uart_init -0000e158 g *ABS* 00000000 __CTOR_LIST__ -00032000 g *ABS* 00000000 __alt_stack_pointer -0000a124 g F .text 00000080 __clzsi2 -0000bde0 g F .text 00000240 altera_avalon_jtag_uart_write -000006a4 g F .text 00000004 __sfp_lock_acquire -00006534 g F .text 000000e4 memchr -00002548 g F .text 00001ec4 ___vfprintf_internal_r -00000b7c g F .text 00000314 _free_r -0000df48 g F .text 000001b0 __call_exitprocs -00011ea8 g O .bss 00000004 __mlocale_changed -000102d4 g O .rwdata 00000004 __malloc_sbrk_base -000001b4 g F .text 0000003c _start -00011ec0 g O .bss 00000004 _alt_tick_rate -000070dc g F .text 0000014c __lshift -00011ec4 g O .bss 00000004 _alt_nticks -0000b070 g F .text 00000124 read -0000b4e0 g F .text 0000005c alt_sys_init -00001f3c g F .text 00000078 _open_r -0000de10 g F .text 00000134 __register_exitproc -00007228 g F .text 00000254 __multiply -0000ba54 g F .text 00000074 altera_avalon_jtag_uart_close -00009fc8 g F .text 00000038 __mulsi3 -0000e78c g *ABS* 00000000 __ram_rwdata_start -0000e15c g *ABS* 00000000 __ram_rodata_start -00011ec8 g O .bss 00000028 __malloc_current_mallinfo -00006dd4 g F .text 0000017c __d2b -0000b574 g F .text 00000058 altera_avalon_jtag_uart_read_fd -0000d4f8 g F .text 000000d0 alt_get_fd -0000dbf4 g F .text 0000015c alt_busy_sleep -0000a5f0 g F .text 000000c8 __fpcmp_parts_d -000045e4 g F .text 00000070 _close_r -0000dd9c g F .text 00000074 memcmp -0000b624 g F .text 00000048 altera_avalon_jtag_uart_close_fd -00012180 g *ABS* 00000000 __alt_stack_base -0000b66c g F .text 00000050 altera_avalon_jtag_uart_ioctl_fd -000014e4 g F .text 000000ac _fwrite_r -000044a8 g F .text 0000013c __swsetup_r -00009618 g F .text 00000258 __divdf3 -00000850 g F .text 000000f0 __sfp -00006c38 g F .text 00000058 __copybits -0000eb8c g O .rwdata 00000408 __malloc_av_ -000006b0 g F .text 00000004 __sinit_lock_release -00009254 g F .text 000003c4 __muldf3 -0000241c g F .text 00000060 __sread -0000d3d8 g F .text 00000120 alt_find_file -0000d168 g F .text 000000b4 alt_dev_llist_insert -0000ad4c g F .text 00000020 __malloc_lock -0000b26c g F .text 000000bc sbrk -0000041c g F .text 000001fc _fflush_r -00007fbc g F .text 000000c8 _calloc_r -00000a34 g F .text 0000001c fopen -00011e94 g *ABS* 00000000 __bss_start -00001ea4 g F .text 00000098 memset -000001f0 g F .text 00000058 main -00011eb8 g O .bss 00000004 alt_envp -00011ea0 g O .bss 00000004 __malloc_max_total_mem -0000b5cc g F .text 00000058 altera_avalon_jtag_uart_write_fd -0000ce64 g F .text 0000013c altera_avalon_lcd_16207_init -00002330 g F .text 00000008 __sclose -00032000 g *ABS* 00000000 __alt_heap_limit -00000408 g F .text 00000014 fclose -00011ff0 g O .bss 00000190 _atexit0 -00004898 g F .text 000015b4 _dtoa_r -00001764 g F .text 00000740 _malloc_r -000102f4 g O .rwdata 00000004 alt_errno -0000142c g F .text 000000b8 _fwalk -00009ef8 g F .text 00000060 __divsi3 -0000e3b4 g O .rodata 00000014 __thenan_df -00000a50 g F .text 0000012c _malloc_trim_r -0000e15c g *ABS* 00000000 __CTOR_END__ -00007f00 g F .text 000000bc strcmp -0000e15c g *ABS* 00000000 __flash_rodata_start -0000e15c g *ABS* 00000000 __DTOR_LIST__ -000098f8 g F .text 00000088 __nedf2 -0000b4ac g F .text 00000034 alt_irq_init -0000b1f4 g F .text 00000078 alt_release_fd -0000e3c8 g O .rodata 00000100 __clz_tab -00011eac g O .bss 00000004 _PathLocale -0000dd50 g F .text 00000014 atexit -00004430 g F .text 00000078 _write_r -000064a0 g F .text 0000001c setlocale -000102c8 g O .rwdata 00000004 _impure_ptr -00011eb0 g O .bss 00000004 alt_argc -0000d2e0 g F .text 00000064 _do_dtors -00000e90 g F .text 0000043c _fseek_r -000020e0 g F .text 000001c4 __srefill_r -00000020 g .exceptions 00000000 alt_irq_entry -00006954 g F .text 00000080 __ulp -00007e90 g F .text 00000040 __isinfd -00000768 g F .text 00000018 __fp_unlock_all -0000cfa0 g F .text 00000058 altera_avalon_lcd_16207_write_fd -000102e0 g O .rwdata 00000008 alt_fs_list -00000020 g *ABS* 00000000 __ram_exceptions_start -0000640c g F .text 00000010 localeconv -0000d5e4 g F .text 00000050 alt_ic_isr_register -00001590 g F .text 00000040 fwrite -00010310 g *ABS* 00000000 _edata -00012180 g *ABS* 00000000 _end -000001b4 g *ABS* 00000000 __ram_exceptions_end -0000bac8 g F .text 000000f4 altera_avalon_jtag_uart_ioctl -0000d6d0 g F .text 000000a0 alt_ic_irq_disable -000023a0 g F .text 0000007c __swrite -000102d0 g O .rwdata 00000004 __malloc_trim_threshold -0000dbd4 g F .text 00000020 altera_nios2_qsys_irq_init -0000dd64 g F .text 00000038 exit -00001364 g F .text 000000c8 _fwalk_reent -00006f50 g F .text 0000018c __mdiff -00009f58 g F .text 00000060 __modsi3 -00032000 g *ABS* 00000000 __alt_data_end -00000020 g F .exceptions 00000000 alt_exception -000006a8 g F .text 00000004 __sfp_lock_release -0000e508 g O .rodata 00000101 _ctype_ -00000940 g F .text 000000f4 _fopen_r -0000e138 g F .text 00000020 _exit -00007ed0 g F .text 00000030 __isnand -0000cff8 g F .text 00000154 alt_alarm_start -0000a000 g F .text 00000124 __muldi3 -000015d0 g F .text 00000194 __smakebuf_r -0000247c g F .text 00000074 strlen -0000ae84 g F .text 0000018c open -00009a08 g F .text 00000088 __gedf2 -0000d5c8 g F .text 0000001c alt_icache_flush_all -00010300 g O .rwdata 00000004 alt_priority_mask -0000d634 g F .text 0000009c alt_ic_irq_enable -0000440c g F .text 00000024 __vfprintf_internal -00009160 g F .text 00000080 __subdf3 -00006830 g F .text 000000c4 __lo0bits -00010304 g O .rwdata 00000008 alt_alarm_list -0000d27c g F .text 00000064 _do_ctors -0000a6b8 g F .text 00000100 close -0000aaa0 g F .text 00000080 alt_load -0000a1a4 g F .text 00000314 __pack_d -00000000 w *UND* 00000000 free -000006ac g F .text 00000004 __sinit_lock_acquire -000074b8 g F .text 0000012c __multadd -00006798 g F .text 00000028 _Bfree - - - -Disassembly of section .entry: - -00000000 <__reset>: - * Jump to the _start entry point in the .text section if reset code - * is allowed or if optimizing for RTL simulation. - */ -#if defined(ALT_ALLOW_CODE_AT_RESET) || defined(ALT_SIM_OPTIMIZE) - /* Jump to the _start entry point in the .text section. */ - movhi r1, %hi(_start) - 0: 00400034 movhi at,0 - ori r1, r1, %lo(_start) - 4: 08406d14 ori at,at,436 - jmp r1 - 8: 0800683a jmp at - ... - -Disassembly of section .exceptions: - -00000020 : - * Process an exception. For all exceptions we must preserve all - * caller saved registers on the stack (See the Nios2 ABI - * documentation for details). - */ - - addi sp, sp, -76 - 20: deffed04 addi sp,sp,-76 - -#endif - -#endif - - stw ra, 0(sp) - 24: dfc00015 stw ra,0(sp) - /* - * Leave a gap in the stack frame at 4(sp) for the muldiv handler to - * store zero into. - */ - - stw r1, 8(sp) - 28: d8400215 stw at,8(sp) - stw r2, 12(sp) - 2c: d8800315 stw r2,12(sp) - stw r3, 16(sp) - 30: d8c00415 stw r3,16(sp) - stw r4, 20(sp) - 34: d9000515 stw r4,20(sp) - stw r5, 24(sp) - 38: d9400615 stw r5,24(sp) - stw r6, 28(sp) - 3c: d9800715 stw r6,28(sp) - stw r7, 32(sp) - 40: d9c00815 stw r7,32(sp) - - rdctl r5, estatus - 44: 000b307a rdctl r5,estatus - - stw r8, 36(sp) - 48: da000915 stw r8,36(sp) - stw r9, 40(sp) - 4c: da400a15 stw r9,40(sp) - stw r10, 44(sp) - 50: da800b15 stw r10,44(sp) - stw r11, 48(sp) - 54: dac00c15 stw r11,48(sp) - stw r12, 52(sp) - 58: db000d15 stw r12,52(sp) - stw r13, 56(sp) - 5c: db400e15 stw r13,56(sp) - stw r14, 60(sp) - 60: db800f15 stw r14,60(sp) - stw r15, 64(sp) - 64: dbc01015 stw r15,64(sp) - /* - * ea-4 contains the address of the instruction being executed - * when the exception occured. For interrupt exceptions, we will - * will be re-issue the isntruction. Store it in 72(sp) - */ - stw r5, 68(sp) /* estatus */ - 68: d9401115 stw r5,68(sp) - addi r15, ea, -4 /* instruction that caused exception */ - 6c: ebffff04 addi r15,ea,-4 - stw r15, 72(sp) - 70: dbc01215 stw r15,72(sp) -#else - /* - * Test to see if the exception was a software exception or caused - * by an external interrupt, and vector accordingly. - */ - rdctl r4, ipending - 74: 0009313a rdctl r4,ipending - andi r2, r5, 1 - 78: 2880004c andi r2,r5,1 - beq r2, zero, .Lnot_irq - 7c: 10000326 beq r2,zero,8c - beq r4, zero, .Lnot_irq - 80: 20000226 beq r4,zero,8c - /* - * Now that all necessary registers have been preserved, call - * alt_irq_handler() to process the interrupts. - */ - - call alt_irq_handler - 84: 00000ec0 call ec - - .section .exceptions.irqreturn, "xa" - - br .Lexception_exit - 88: 00000306 br 98 - * upon completion, so we write ea (address of instruction *after* - * the one where the exception occured) into 72(sp). The actual - * instruction that caused the exception is written in r2, which these - * handlers will utilize. - */ - stw ea, 72(sp) /* Don't re-issue */ - 8c: df401215 stw ea,72(sp) - ldw r2, -4(ea) /* Instruction that caused exception */ - 90: e8bfff17 ldw r2,-4(ea) -#ifdef NIOS2_HAS_DEBUG_STUB - /* - * Either tell the user now (if there is a debugger attached) or go into - * the debug monitor which will loop until a debugger is attached. - */ - break - 94: 003da03a break 0 - /* - * Restore the saved registers, so that all general purpose registers - * have been restored to their state at the time the interrupt occured. - */ - - ldw r5, 68(sp) - 98: d9401117 ldw r5,68(sp) - ldw ea, 72(sp) /* This becomes the PC once eret is executed */ - 9c: df401217 ldw ea,72(sp) - ldw ra, 0(sp) - a0: dfc00017 ldw ra,0(sp) - - wrctl estatus, r5 - a4: 2801707a wrctl estatus,r5 - - ldw r1, 8(sp) - a8: d8400217 ldw at,8(sp) - ldw r2, 12(sp) - ac: d8800317 ldw r2,12(sp) - ldw r3, 16(sp) - b0: d8c00417 ldw r3,16(sp) - ldw r4, 20(sp) - b4: d9000517 ldw r4,20(sp) - ldw r5, 24(sp) - b8: d9400617 ldw r5,24(sp) - ldw r6, 28(sp) - bc: d9800717 ldw r6,28(sp) - ldw r7, 32(sp) - c0: d9c00817 ldw r7,32(sp) -#ifdef ALT_STACK_CHECK - ldw et, %gprel(alt_exception_old_stack_limit)(gp) -#endif -#endif - - ldw r8, 36(sp) - c4: da000917 ldw r8,36(sp) - ldw r9, 40(sp) - c8: da400a17 ldw r9,40(sp) - ldw r10, 44(sp) - cc: da800b17 ldw r10,44(sp) - ldw r11, 48(sp) - d0: dac00c17 ldw r11,48(sp) - ldw r12, 52(sp) - d4: db000d17 ldw r12,52(sp) - ldw r13, 56(sp) - d8: db400e17 ldw r13,56(sp) - ldw r14, 60(sp) - dc: db800f17 ldw r14,60(sp) - ldw r15, 64(sp) - e0: dbc01017 ldw r15,64(sp) -#endif - - ldw sp, 76(sp) - -#else - addi sp, sp, 76 - e4: dec01304 addi sp,sp,76 - - /* - * Return to the interrupted instruction. - */ - - eret - e8: ef80083a eret - -000000ec : - * instruction is present if the macro ALT_CI_INTERRUPT_VECTOR defined. - */ - -void alt_irq_handler (void) __attribute__ ((section (".exceptions"))); -void alt_irq_handler (void) -{ - ec: defff904 addi sp,sp,-28 - f0: dfc00615 stw ra,24(sp) - f4: df000515 stw fp,20(sp) - f8: df000504 addi fp,sp,20 -#ifndef NIOS2_EIC_PRESENT -static ALT_INLINE alt_u32 ALT_ALWAYS_INLINE alt_irq_pending (void) -{ - alt_u32 active; - - NIOS2_READ_IPENDING (active); - fc: 0005313a rdctl r2,ipending - 100: e0bffc15 stw r2,-16(fp) - - return active; - 104: e0bffc17 ldw r2,-16(fp) - * Consider the case where the high priority interupt is asserted during - * the interrupt entry sequence for a lower priority interrupt to see why - * this is the case. - */ - - active = alt_irq_pending (); - 108: e0bfff15 stw r2,-4(fp) - - do - { - i = 0; - 10c: e03ffd15 stw zero,-12(fp) - mask = 1; - 110: 00800044 movi r2,1 - 114: e0bffe15 stw r2,-8(fp) - * called to clear the interrupt condition. - */ - - do - { - if (active & mask) - 118: e0ffff17 ldw r3,-4(fp) - 11c: e0bffe17 ldw r2,-8(fp) - 120: 1884703a and r2,r3,r2 - 124: 1005003a cmpeq r2,r2,zero - 128: 1000161e bne r2,zero,184 - { -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - alt_irq[i].handler(alt_irq[i].context); - 12c: e0bffd17 ldw r2,-12(fp) - 130: 00c00074 movhi r3,1 - 134: 18c7bc04 addi r3,r3,7920 - 138: 100490fa slli r2,r2,3 - 13c: 10c5883a add r2,r2,r3 - 140: 11400017 ldw r5,0(r2) - 144: e0bffd17 ldw r2,-12(fp) - 148: 00c00074 movhi r3,1 - 14c: 18c7bc04 addi r3,r3,7920 - 150: 100490fa slli r2,r2,3 - 154: 10c5883a add r2,r2,r3 - 158: 10800104 addi r2,r2,4 - 15c: 11000017 ldw r4,0(r2) - 160: 283ee83a callr r5 -#ifndef NIOS2_EIC_PRESENT -static ALT_INLINE alt_u32 ALT_ALWAYS_INLINE alt_irq_pending (void) -{ - alt_u32 active; - - NIOS2_READ_IPENDING (active); - 164: 0005313a rdctl r2,ipending - 168: e0bffb15 stw r2,-20(fp) - - return active; - 16c: e0bffb17 ldw r2,-20(fp) - mask <<= 1; - i++; - - } while (1); - - active = alt_irq_pending (); - 170: e0bfff15 stw r2,-4(fp) - - } while (active); - 174: e0bfff17 ldw r2,-4(fp) - 178: 1004c03a cmpne r2,r2,zero - 17c: 103fe31e bne r2,zero,10c - 180: 00000706 br 1a0 -#else - alt_irq[i].handler(alt_irq[i].context, i); -#endif - break; - } - mask <<= 1; - 184: e0bffe17 ldw r2,-8(fp) - 188: 1085883a add r2,r2,r2 - 18c: e0bffe15 stw r2,-8(fp) - i++; - 190: e0bffd17 ldw r2,-12(fp) - 194: 10800044 addi r2,r2,1 - 198: e0bffd15 stw r2,-12(fp) - - } while (1); - 19c: 003fde06 br 118 - /* - * Notify the operating system that interrupt processing is complete. - */ - - ALT_OS_INT_EXIT(); -} - 1a0: e037883a mov sp,fp - 1a4: dfc00117 ldw ra,4(sp) - 1a8: df000017 ldw fp,0(sp) - 1ac: dec00204 addi sp,sp,8 - 1b0: f800283a ret - -Disassembly of section .text: - -000001b4 <_start>: -#if (NIOS2_NUM_OF_SHADOW_REG_SETS == 0) - /* - * Now that the caches are initialized, set up the stack pointer. - * The value provided by the linker is assumed to be correctly aligned. - */ - movhi sp, %hi(__alt_stack_pointer) - 1b4: 06c000f4 movhi sp,3 - ori sp, sp, %lo(__alt_stack_pointer) - 1b8: dec80014 ori sp,sp,8192 - - /* Set up the global pointer. */ - movhi gp, %hi(_gp) - 1bc: 06800074 movhi gp,1 - ori gp, gp, %lo(_gp) - 1c0: d6a0b214 ori gp,gp,33480 - */ -#ifndef ALT_SIM_OPTIMIZE - /* Log that the BSS is about to be cleared. */ - ALT_LOG_PUTS(alt_log_msg_bss) - - movhi r2, %hi(__bss_start) - 1c4: 00800074 movhi r2,1 - ori r2, r2, %lo(__bss_start) - 1c8: 1087a514 ori r2,r2,7828 - - movhi r3, %hi(__bss_end) - 1cc: 00c00074 movhi r3,1 - ori r3, r3, %lo(__bss_end) - 1d0: 18c86014 ori r3,r3,8576 - - beq r2, r3, 1f - 1d4: 10c00326 beq r2,r3,1e4 <_start+0x30> - -0: - stw zero, (r2) - 1d8: 10000015 stw zero,0(r2) - addi r2, r2, 4 - 1dc: 10800104 addi r2,r2,4 - bltu r2, r3, 0b - 1e0: 10fffd36 bltu r2,r3,1d8 <_start+0x24> - * section aren't defined until alt_load() has been called). - */ - mov et, zero -#endif - - call alt_load - 1e4: 000aaa00 call aaa0 - - /* Log that alt_main is about to be called. */ - ALT_LOG_PUTS(alt_log_msg_alt_main) - - /* Call the C entry point. It should never return. */ - call alt_main - 1e8: 000ace00 call ace0 - -000001ec : - - /* Wait in infinite loop in case alt_main does return. */ -alt_after_alt_main: - br alt_after_alt_main - 1ec: 003fff06 br 1ec - -000001f0
: -#define lcd_on (volatile char *) 0x00041010 -#define lcd_blon (volatile char *) 0x00041020 - - -int main() -{ - 1f0: defffe04 addi sp,sp,-8 - 1f4: dfc00115 stw ra,4(sp) - 1f8: df000015 stw fp,0(sp) - 1fc: d839883a mov fp,sp - *lcd_on = 1; - 200: 00c00134 movhi r3,4 - 204: 18c40404 addi r3,r3,4112 - 208: 00800044 movi r2,1 - 20c: 18800005 stb r2,0(r3) - *lcd_blon = 1; - 210: 00c00134 movhi r3,4 - 214: 18c40804 addi r3,r3,4128 - 218: 00800044 movi r2,1 - 21c: 18800005 stb r2,0(r3) - printf("Hello from Nios II!\n"); - 220: 01000074 movhi r4,1 - 224: 21385704 addi r4,r4,-7844 - 228: 00020cc0 call 20cc - hello(); - 22c: 00002480 call 248 - return 0; - 230: 0005883a mov r2,zero -} - 234: e037883a mov sp,fp - 238: dfc00117 ldw ra,4(sp) - 23c: df000017 ldw fp,0(sp) - 240: dec00204 addi sp,sp,8 - 244: f800283a ret - -00000248 : - -void hello() { - 248: defff904 addi sp,sp,-28 - 24c: dfc00615 stw ra,24(sp) - 250: df000515 stw fp,20(sp) - 254: df000504 addi fp,sp,20 - FILE *pLCD; - char msg[] = "Hello\nWorld\n"; - 258: 00c00074 movhi r3,1 - 25c: 18f86a04 addi r3,r3,-7768 - 260: 18800017 ldw r2,0(r3) - 264: e0bffc15 stw r2,-16(fp) - 268: 18800117 ldw r2,4(r3) - 26c: e0bffd15 stw r2,-12(fp) - 270: 18800217 ldw r2,8(r3) - 274: e0bffe15 stw r2,-8(fp) - 278: 18800303 ldbu r2,12(r3) - 27c: e0bfff05 stb r2,-4(fp) - - pLCD = fopen(LCD_16207_0_NAME, "w"); - 280: 01000074 movhi r4,1 - 284: 21385c04 addi r4,r4,-7824 - 288: 01400074 movhi r5,1 - 28c: 29786104 addi r5,r5,-7804 - 290: 0000a340 call a34 - 294: e0bffb15 stw r2,-20(fp) - if (pLCD) { - 298: e0bffb17 ldw r2,-20(fp) - 29c: 1005003a cmpeq r2,r2,zero - 2a0: 10000a1e bne r2,zero,2cc - fwrite(msg, strlen(msg), 1, pLCD); - 2a4: e13ffc04 addi r4,fp,-16 - 2a8: 000247c0 call 247c - 2ac: 100b883a mov r5,r2 - 2b0: e13ffc04 addi r4,fp,-16 - 2b4: 01800044 movi r6,1 - 2b8: e1fffb17 ldw r7,-20(fp) - 2bc: 00015900 call 1590 - fclose(pLCD); - 2c0: e13ffb17 ldw r4,-20(fp) - 2c4: 00004080 call 408 - 2c8: 00000306 br 2d8 - } else { - printf("failed to say Hello World\n"); - 2cc: 01000074 movhi r4,1 - 2d0: 21386204 addi r4,r4,-7800 - 2d4: 00020cc0 call 20cc - } - printf("end"); - 2d8: 01000074 movhi r4,1 - 2dc: 21386904 addi r4,r4,-7772 - 2e0: 0001fb40 call 1fb4 -} - 2e4: e037883a mov sp,fp - 2e8: dfc00117 ldw ra,4(sp) - 2ec: df000017 ldw fp,0(sp) - 2f0: dec00204 addi sp,sp,8 - 2f4: f800283a ret - -000002f8 <_fclose_r>: - 2f8: defffc04 addi sp,sp,-16 - 2fc: dc400115 stw r17,4(sp) - 300: dc000015 stw r16,0(sp) - 304: dfc00315 stw ra,12(sp) - 308: dc800215 stw r18,8(sp) - 30c: 2821883a mov r16,r5 - 310: 2023883a mov r17,r4 - 314: 28002926 beq r5,zero,3bc <_fclose_r+0xc4> - 318: 00006a40 call 6a4 <__sfp_lock_acquire> - 31c: 88000226 beq r17,zero,328 <_fclose_r+0x30> - 320: 88800e17 ldw r2,56(r17) - 324: 10002d26 beq r2,zero,3dc <_fclose_r+0xe4> - 328: 8080030f ldh r2,12(r16) - 32c: 10002226 beq r2,zero,3b8 <_fclose_r+0xc0> - 330: 8809883a mov r4,r17 - 334: 800b883a mov r5,r16 - 338: 000041c0 call 41c <_fflush_r> - 33c: 1025883a mov r18,r2 - 340: 80800b17 ldw r2,44(r16) - 344: 10000426 beq r2,zero,358 <_fclose_r+0x60> - 348: 81400717 ldw r5,28(r16) - 34c: 8809883a mov r4,r17 - 350: 103ee83a callr r2 - 354: 10002a16 blt r2,zero,400 <_fclose_r+0x108> - 358: 8080030b ldhu r2,12(r16) - 35c: 1080200c andi r2,r2,128 - 360: 1000231e bne r2,zero,3f0 <_fclose_r+0xf8> - 364: 81400c17 ldw r5,48(r16) - 368: 28000526 beq r5,zero,380 <_fclose_r+0x88> - 36c: 80801004 addi r2,r16,64 - 370: 28800226 beq r5,r2,37c <_fclose_r+0x84> - 374: 8809883a mov r4,r17 - 378: 0000b7c0 call b7c <_free_r> - 37c: 80000c15 stw zero,48(r16) - 380: 81401117 ldw r5,68(r16) - 384: 28000326 beq r5,zero,394 <_fclose_r+0x9c> - 388: 8809883a mov r4,r17 - 38c: 0000b7c0 call b7c <_free_r> - 390: 80001115 stw zero,68(r16) - 394: 8000030d sth zero,12(r16) - 398: 00006a80 call 6a8 <__sfp_lock_release> - 39c: 9005883a mov r2,r18 - 3a0: dfc00317 ldw ra,12(sp) - 3a4: dc800217 ldw r18,8(sp) - 3a8: dc400117 ldw r17,4(sp) - 3ac: dc000017 ldw r16,0(sp) - 3b0: dec00404 addi sp,sp,16 - 3b4: f800283a ret - 3b8: 00006a80 call 6a8 <__sfp_lock_release> - 3bc: 0025883a mov r18,zero - 3c0: 9005883a mov r2,r18 - 3c4: dfc00317 ldw ra,12(sp) - 3c8: dc800217 ldw r18,8(sp) - 3cc: dc400117 ldw r17,4(sp) - 3d0: dc000017 ldw r16,0(sp) - 3d4: dec00404 addi sp,sp,16 - 3d8: f800283a ret - 3dc: 8809883a mov r4,r17 - 3e0: 00006b40 call 6b4 <__sinit> - 3e4: 8080030f ldh r2,12(r16) - 3e8: 103fd11e bne r2,zero,330 <_fclose_r+0x38> - 3ec: 003ff206 br 3b8 <_fclose_r+0xc0> - 3f0: 81400417 ldw r5,16(r16) - 3f4: 8809883a mov r4,r17 - 3f8: 0000b7c0 call b7c <_free_r> - 3fc: 003fd906 br 364 <_fclose_r+0x6c> - 400: 04bfffc4 movi r18,-1 - 404: 003fd406 br 358 <_fclose_r+0x60> - -00000408 : - 408: 00800074 movhi r2,1 - 40c: 1080b204 addi r2,r2,712 - 410: 200b883a mov r5,r4 - 414: 11000017 ldw r4,0(r2) - 418: 00002f81 jmpi 2f8 <_fclose_r> - -0000041c <_fflush_r>: - 41c: defffb04 addi sp,sp,-20 - 420: dcc00315 stw r19,12(sp) - 424: dc800215 stw r18,8(sp) - 428: dfc00415 stw ra,16(sp) - 42c: dc400115 stw r17,4(sp) - 430: dc000015 stw r16,0(sp) - 434: 2027883a mov r19,r4 - 438: 2825883a mov r18,r5 - 43c: 20000226 beq r4,zero,448 <_fflush_r+0x2c> - 440: 20800e17 ldw r2,56(r4) - 444: 10005626 beq r2,zero,5a0 <_fflush_r+0x184> - 448: 9100030b ldhu r4,12(r18) - 44c: 20ffffcc andi r3,r4,65535 - 450: 18e0001c xori r3,r3,32768 - 454: 18e00004 addi r3,r3,-32768 - 458: 1880020c andi r2,r3,8 - 45c: 1000261e bne r2,zero,4f8 <_fflush_r+0xdc> - 460: 90c00117 ldw r3,4(r18) - 464: 20820014 ori r2,r4,2048 - 468: 9080030d sth r2,12(r18) - 46c: 1009883a mov r4,r2 - 470: 00c0400e bge zero,r3,574 <_fflush_r+0x158> - 474: 92000a17 ldw r8,40(r18) - 478: 40004026 beq r8,zero,57c <_fflush_r+0x160> - 47c: 2084000c andi r2,r4,4096 - 480: 10005326 beq r2,zero,5d0 <_fflush_r+0x1b4> - 484: 94001417 ldw r16,80(r18) - 488: 9080030b ldhu r2,12(r18) - 48c: 1080010c andi r2,r2,4 - 490: 1000481e bne r2,zero,5b4 <_fflush_r+0x198> - 494: 91400717 ldw r5,28(r18) - 498: 9809883a mov r4,r19 - 49c: 800d883a mov r6,r16 - 4a0: 000f883a mov r7,zero - 4a4: 403ee83a callr r8 - 4a8: 8080261e bne r16,r2,544 <_fflush_r+0x128> - 4ac: 9080030b ldhu r2,12(r18) - 4b0: 91000417 ldw r4,16(r18) - 4b4: 90000115 stw zero,4(r18) - 4b8: 10bdffcc andi r2,r2,63487 - 4bc: 10ffffcc andi r3,r2,65535 - 4c0: 18c4000c andi r3,r3,4096 - 4c4: 9080030d sth r2,12(r18) - 4c8: 91000015 stw r4,0(r18) - 4cc: 18002b26 beq r3,zero,57c <_fflush_r+0x160> - 4d0: 0007883a mov r3,zero - 4d4: 1805883a mov r2,r3 - 4d8: 94001415 stw r16,80(r18) - 4dc: dfc00417 ldw ra,16(sp) - 4e0: dcc00317 ldw r19,12(sp) - 4e4: dc800217 ldw r18,8(sp) - 4e8: dc400117 ldw r17,4(sp) - 4ec: dc000017 ldw r16,0(sp) - 4f0: dec00504 addi sp,sp,20 - 4f4: f800283a ret - 4f8: 94400417 ldw r17,16(r18) - 4fc: 88001f26 beq r17,zero,57c <_fflush_r+0x160> - 500: 90800017 ldw r2,0(r18) - 504: 18c000cc andi r3,r3,3 - 508: 94400015 stw r17,0(r18) - 50c: 1461c83a sub r16,r2,r17 - 510: 18002526 beq r3,zero,5a8 <_fflush_r+0x18c> - 514: 0005883a mov r2,zero - 518: 90800215 stw r2,8(r18) - 51c: 0400170e bge zero,r16,57c <_fflush_r+0x160> - 520: 90c00917 ldw r3,36(r18) - 524: 91400717 ldw r5,28(r18) - 528: 880d883a mov r6,r17 - 52c: 800f883a mov r7,r16 - 530: 9809883a mov r4,r19 - 534: 183ee83a callr r3 - 538: 88a3883a add r17,r17,r2 - 53c: 80a1c83a sub r16,r16,r2 - 540: 00bff616 blt zero,r2,51c <_fflush_r+0x100> - 544: 9080030b ldhu r2,12(r18) - 548: 00ffffc4 movi r3,-1 - 54c: 10801014 ori r2,r2,64 - 550: 9080030d sth r2,12(r18) - 554: 1805883a mov r2,r3 - 558: dfc00417 ldw ra,16(sp) - 55c: dcc00317 ldw r19,12(sp) - 560: dc800217 ldw r18,8(sp) - 564: dc400117 ldw r17,4(sp) - 568: dc000017 ldw r16,0(sp) - 56c: dec00504 addi sp,sp,20 - 570: f800283a ret - 574: 90800f17 ldw r2,60(r18) - 578: 00bfbe16 blt zero,r2,474 <_fflush_r+0x58> - 57c: 0007883a mov r3,zero - 580: 1805883a mov r2,r3 - 584: dfc00417 ldw ra,16(sp) - 588: dcc00317 ldw r19,12(sp) - 58c: dc800217 ldw r18,8(sp) - 590: dc400117 ldw r17,4(sp) - 594: dc000017 ldw r16,0(sp) - 598: dec00504 addi sp,sp,20 - 59c: f800283a ret - 5a0: 00006b40 call 6b4 <__sinit> - 5a4: 003fa806 br 448 <_fflush_r+0x2c> - 5a8: 90800517 ldw r2,20(r18) - 5ac: 90800215 stw r2,8(r18) - 5b0: 003fda06 br 51c <_fflush_r+0x100> - 5b4: 90800117 ldw r2,4(r18) - 5b8: 90c00c17 ldw r3,48(r18) - 5bc: 80a1c83a sub r16,r16,r2 - 5c0: 183fb426 beq r3,zero,494 <_fflush_r+0x78> - 5c4: 90800f17 ldw r2,60(r18) - 5c8: 80a1c83a sub r16,r16,r2 - 5cc: 003fb106 br 494 <_fflush_r+0x78> - 5d0: 91400717 ldw r5,28(r18) - 5d4: 9809883a mov r4,r19 - 5d8: 000d883a mov r6,zero - 5dc: 01c00044 movi r7,1 - 5e0: 403ee83a callr r8 - 5e4: 1021883a mov r16,r2 - 5e8: 00bfffc4 movi r2,-1 - 5ec: 80800226 beq r16,r2,5f8 <_fflush_r+0x1dc> - 5f0: 92000a17 ldw r8,40(r18) - 5f4: 003fa406 br 488 <_fflush_r+0x6c> - 5f8: 98c00017 ldw r3,0(r19) - 5fc: 00800744 movi r2,29 - 600: 18bfde26 beq r3,r2,57c <_fflush_r+0x160> - 604: 9080030b ldhu r2,12(r18) - 608: 8007883a mov r3,r16 - 60c: 10801014 ori r2,r2,64 - 610: 9080030d sth r2,12(r18) - 614: 003fcf06 br 554 <_fflush_r+0x138> - -00000618 : - 618: 01400034 movhi r5,0 - 61c: 29410704 addi r5,r5,1052 - 620: 2007883a mov r3,r4 - 624: 20000526 beq r4,zero,63c - 628: 00800074 movhi r2,1 - 62c: 1080b204 addi r2,r2,712 - 630: 11000017 ldw r4,0(r2) - 634: 180b883a mov r5,r3 - 638: 000041c1 jmpi 41c <_fflush_r> - 63c: 00800074 movhi r2,1 - 640: 1080b304 addi r2,r2,716 - 644: 11000017 ldw r4,0(r2) - 648: 00013641 jmpi 1364 <_fwalk_reent> - -0000064c : - 64c: 00800034 movhi r2,0 - 650: 1088cc04 addi r2,r2,9008 - 654: 20800b15 stw r2,44(r4) - 658: 00800034 movhi r2,0 - 65c: 10890704 addi r2,r2,9244 - 660: 20800815 stw r2,32(r4) - 664: 00c00034 movhi r3,0 - 668: 18c8e804 addi r3,r3,9120 - 66c: 00800034 movhi r2,0 - 670: 1088ce04 addi r2,r2,9016 - 674: 2140030d sth r5,12(r4) - 678: 2180038d sth r6,14(r4) - 67c: 20c00915 stw r3,36(r4) - 680: 20800a15 stw r2,40(r4) - 684: 20000015 stw zero,0(r4) - 688: 20000115 stw zero,4(r4) - 68c: 20000215 stw zero,8(r4) - 690: 20000415 stw zero,16(r4) - 694: 20000515 stw zero,20(r4) - 698: 20000615 stw zero,24(r4) - 69c: 21000715 stw r4,28(r4) - 6a0: f800283a ret - -000006a4 <__sfp_lock_acquire>: - 6a4: f800283a ret - -000006a8 <__sfp_lock_release>: - 6a8: f800283a ret - -000006ac <__sinit_lock_acquire>: - 6ac: f800283a ret - -000006b0 <__sinit_lock_release>: - 6b0: f800283a ret - -000006b4 <__sinit>: - 6b4: 20800e17 ldw r2,56(r4) - 6b8: defffd04 addi sp,sp,-12 - 6bc: dc400115 stw r17,4(sp) - 6c0: dc000015 stw r16,0(sp) - 6c4: dfc00215 stw ra,8(sp) - 6c8: 04400044 movi r17,1 - 6cc: 01400104 movi r5,4 - 6d0: 000d883a mov r6,zero - 6d4: 2021883a mov r16,r4 - 6d8: 2200bb04 addi r8,r4,748 - 6dc: 200f883a mov r7,r4 - 6e0: 10000526 beq r2,zero,6f8 <__sinit+0x44> - 6e4: dfc00217 ldw ra,8(sp) - 6e8: dc400117 ldw r17,4(sp) - 6ec: dc000017 ldw r16,0(sp) - 6f0: dec00304 addi sp,sp,12 - 6f4: f800283a ret - 6f8: 21000117 ldw r4,4(r4) - 6fc: 00800034 movhi r2,0 - 700: 1081e604 addi r2,r2,1944 - 704: 00c000c4 movi r3,3 - 708: 80800f15 stw r2,60(r16) - 70c: 80c0b915 stw r3,740(r16) - 710: 8200ba15 stw r8,744(r16) - 714: 84400e15 stw r17,56(r16) - 718: 8000b815 stw zero,736(r16) - 71c: 000064c0 call 64c - 720: 81000217 ldw r4,8(r16) - 724: 880d883a mov r6,r17 - 728: 800f883a mov r7,r16 - 72c: 01400284 movi r5,10 - 730: 000064c0 call 64c - 734: 81000317 ldw r4,12(r16) - 738: 800f883a mov r7,r16 - 73c: 01400484 movi r5,18 - 740: 01800084 movi r6,2 - 744: dfc00217 ldw ra,8(sp) - 748: dc400117 ldw r17,4(sp) - 74c: dc000017 ldw r16,0(sp) - 750: dec00304 addi sp,sp,12 - 754: 000064c1 jmpi 64c - -00000758 <__fp_lock>: - 758: 0005883a mov r2,zero - 75c: f800283a ret - -00000760 <__fp_unlock>: - 760: 0005883a mov r2,zero - 764: f800283a ret - -00000768 <__fp_unlock_all>: - 768: 00800074 movhi r2,1 - 76c: 1080b204 addi r2,r2,712 - 770: 11000017 ldw r4,0(r2) - 774: 01400034 movhi r5,0 - 778: 2941d804 addi r5,r5,1888 - 77c: 000142c1 jmpi 142c <_fwalk> - -00000780 <__fp_lock_all>: - 780: 00800074 movhi r2,1 - 784: 1080b204 addi r2,r2,712 - 788: 11000017 ldw r4,0(r2) - 78c: 01400034 movhi r5,0 - 790: 2941d604 addi r5,r5,1880 - 794: 000142c1 jmpi 142c <_fwalk> - -00000798 <_cleanup_r>: - 798: 01400034 movhi r5,0 - 79c: 29410204 addi r5,r5,1032 - 7a0: 000142c1 jmpi 142c <_fwalk> - -000007a4 <_cleanup>: - 7a4: 00800074 movhi r2,1 - 7a8: 1080b304 addi r2,r2,716 - 7ac: 11000017 ldw r4,0(r2) - 7b0: 00007981 jmpi 798 <_cleanup_r> - -000007b4 <__sfmoreglue>: - 7b4: defffc04 addi sp,sp,-16 - 7b8: dc000015 stw r16,0(sp) - 7bc: 2821883a mov r16,r5 - 7c0: dc400115 stw r17,4(sp) - 7c4: 01401704 movi r5,92 - 7c8: 2023883a mov r17,r4 - 7cc: 8009883a mov r4,r16 - 7d0: dfc00315 stw ra,12(sp) - 7d4: dcc00215 stw r19,8(sp) - 7d8: 0009fc80 call 9fc8 <__mulsi3> - 7dc: 11400304 addi r5,r2,12 - 7e0: 8809883a mov r4,r17 - 7e4: 1027883a mov r19,r2 - 7e8: 00017640 call 1764 <_malloc_r> - 7ec: 10c00304 addi r3,r2,12 - 7f0: 1023883a mov r17,r2 - 7f4: 1809883a mov r4,r3 - 7f8: 980d883a mov r6,r19 - 7fc: 000b883a mov r5,zero - 800: 10000b26 beq r2,zero,830 <__sfmoreglue+0x7c> - 804: 14000115 stw r16,4(r2) - 808: 10c00215 stw r3,8(r2) - 80c: 10000015 stw zero,0(r2) - 810: 0001ea40 call 1ea4 - 814: 8805883a mov r2,r17 - 818: dfc00317 ldw ra,12(sp) - 81c: dcc00217 ldw r19,8(sp) - 820: dc400117 ldw r17,4(sp) - 824: dc000017 ldw r16,0(sp) - 828: dec00404 addi sp,sp,16 - 82c: f800283a ret - 830: 0023883a mov r17,zero - 834: 8805883a mov r2,r17 - 838: dfc00317 ldw ra,12(sp) - 83c: dcc00217 ldw r19,8(sp) - 840: dc400117 ldw r17,4(sp) - 844: dc000017 ldw r16,0(sp) - 848: dec00404 addi sp,sp,16 - 84c: f800283a ret - -00000850 <__sfp>: - 850: defffd04 addi sp,sp,-12 - 854: 00800074 movhi r2,1 - 858: 1080b304 addi r2,r2,716 - 85c: dc000015 stw r16,0(sp) - 860: 14000017 ldw r16,0(r2) - 864: dc400115 stw r17,4(sp) - 868: dfc00215 stw ra,8(sp) - 86c: 80800e17 ldw r2,56(r16) - 870: 2023883a mov r17,r4 - 874: 10002626 beq r2,zero,910 <__sfp+0xc0> - 878: 8400b804 addi r16,r16,736 - 87c: 80800117 ldw r2,4(r16) - 880: 81000217 ldw r4,8(r16) - 884: 10ffffc4 addi r3,r2,-1 - 888: 18000916 blt r3,zero,8b0 <__sfp+0x60> - 88c: 2080030f ldh r2,12(r4) - 890: 10000b26 beq r2,zero,8c0 <__sfp+0x70> - 894: 017fffc4 movi r5,-1 - 898: 00000206 br 8a4 <__sfp+0x54> - 89c: 2080030f ldh r2,12(r4) - 8a0: 10000726 beq r2,zero,8c0 <__sfp+0x70> - 8a4: 18ffffc4 addi r3,r3,-1 - 8a8: 21001704 addi r4,r4,92 - 8ac: 197ffb1e bne r3,r5,89c <__sfp+0x4c> - 8b0: 80800017 ldw r2,0(r16) - 8b4: 10001926 beq r2,zero,91c <__sfp+0xcc> - 8b8: 1021883a mov r16,r2 - 8bc: 003fef06 br 87c <__sfp+0x2c> - 8c0: 00bfffc4 movi r2,-1 - 8c4: 00c00044 movi r3,1 - 8c8: 2080038d sth r2,14(r4) - 8cc: 20c0030d sth r3,12(r4) - 8d0: 20000015 stw zero,0(r4) - 8d4: 20000215 stw zero,8(r4) - 8d8: 20000115 stw zero,4(r4) - 8dc: 20000415 stw zero,16(r4) - 8e0: 20000515 stw zero,20(r4) - 8e4: 20000615 stw zero,24(r4) - 8e8: 20000c15 stw zero,48(r4) - 8ec: 20000d15 stw zero,52(r4) - 8f0: 20001115 stw zero,68(r4) - 8f4: 20001215 stw zero,72(r4) - 8f8: 2005883a mov r2,r4 - 8fc: dfc00217 ldw ra,8(sp) - 900: dc400117 ldw r17,4(sp) - 904: dc000017 ldw r16,0(sp) - 908: dec00304 addi sp,sp,12 - 90c: f800283a ret - 910: 8009883a mov r4,r16 - 914: 00006b40 call 6b4 <__sinit> - 918: 003fd706 br 878 <__sfp+0x28> - 91c: 8809883a mov r4,r17 - 920: 01400104 movi r5,4 - 924: 00007b40 call 7b4 <__sfmoreglue> - 928: 80800015 stw r2,0(r16) - 92c: 103fe21e bne r2,zero,8b8 <__sfp+0x68> - 930: 00800304 movi r2,12 - 934: 0009883a mov r4,zero - 938: 88800015 stw r2,0(r17) - 93c: 003fee06 br 8f8 <__sfp+0xa8> - -00000940 <_fopen_r>: - 940: defffa04 addi sp,sp,-24 - 944: dcc00415 stw r19,16(sp) - 948: 2827883a mov r19,r5 - 94c: 300b883a mov r5,r6 - 950: d80d883a mov r6,sp - 954: dc800315 stw r18,12(sp) - 958: dc400215 stw r17,8(sp) - 95c: dc000115 stw r16,4(sp) - 960: dfc00515 stw ra,20(sp) - 964: 2021883a mov r16,r4 - 968: 0005e4c0 call 5e4c <__sflags> - 96c: 1025883a mov r18,r2 - 970: 8009883a mov r4,r16 - 974: 0023883a mov r17,zero - 978: 1000081e bne r2,zero,99c <_fopen_r+0x5c> - 97c: 8805883a mov r2,r17 - 980: dfc00517 ldw ra,20(sp) - 984: dcc00417 ldw r19,16(sp) - 988: dc800317 ldw r18,12(sp) - 98c: dc400217 ldw r17,8(sp) - 990: dc000117 ldw r16,4(sp) - 994: dec00604 addi sp,sp,24 - 998: f800283a ret - 99c: 00008500 call 850 <__sfp> - 9a0: 1023883a mov r17,r2 - 9a4: 980b883a mov r5,r19 - 9a8: 8009883a mov r4,r16 - 9ac: 01c06d84 movi r7,438 - 9b0: 103ff226 beq r2,zero,97c <_fopen_r+0x3c> - 9b4: d9800017 ldw r6,0(sp) - 9b8: 0001f3c0 call 1f3c <_open_r> - 9bc: 10001816 blt r2,zero,a20 <_fopen_r+0xe0> - 9c0: 00c00034 movhi r3,0 - 9c4: 18c8e804 addi r3,r3,9120 - 9c8: 923fffcc andi r8,r18,65535 - 9cc: 8880038d sth r2,14(r17) - 9d0: 00800034 movhi r2,0 - 9d4: 10890704 addi r2,r2,9244 - 9d8: 88800815 stw r2,32(r17) - 9dc: 88c00915 stw r3,36(r17) - 9e0: 00800034 movhi r2,0 - 9e4: 1088ce04 addi r2,r2,9016 - 9e8: 00c00034 movhi r3,0 - 9ec: 18c8cc04 addi r3,r3,9008 - 9f0: 4200400c andi r8,r8,256 - 9f4: 8c80030d sth r18,12(r17) - 9f8: 8009883a mov r4,r16 - 9fc: 880b883a mov r5,r17 - a00: 000d883a mov r6,zero - a04: 01c00084 movi r7,2 - a08: 88800a15 stw r2,40(r17) - a0c: 88c00b15 stw r3,44(r17) - a10: 8c400715 stw r17,28(r17) - a14: 403fd926 beq r8,zero,97c <_fopen_r+0x3c> - a18: 0000e900 call e90 <_fseek_r> - a1c: 003fd706 br 97c <_fopen_r+0x3c> - a20: 00006a40 call 6a4 <__sfp_lock_acquire> - a24: 8800030d sth zero,12(r17) - a28: 00006a80 call 6a8 <__sfp_lock_release> - a2c: 0023883a mov r17,zero - a30: 003fd206 br 97c <_fopen_r+0x3c> - -00000a34 : - a34: 01800074 movhi r6,1 - a38: 3180b204 addi r6,r6,712 - a3c: 2007883a mov r3,r4 - a40: 31000017 ldw r4,0(r6) - a44: 280d883a mov r6,r5 - a48: 180b883a mov r5,r3 - a4c: 00009401 jmpi 940 <_fopen_r> - -00000a50 <_malloc_trim_r>: - a50: defffb04 addi sp,sp,-20 - a54: dcc00315 stw r19,12(sp) - a58: 04c00074 movhi r19,1 - a5c: 9cfae304 addi r19,r19,-5236 - a60: dc800215 stw r18,8(sp) - a64: dc400115 stw r17,4(sp) - a68: dc000015 stw r16,0(sp) - a6c: 2823883a mov r17,r5 - a70: 2025883a mov r18,r4 - a74: dfc00415 stw ra,16(sp) - a78: 000ad4c0 call ad4c <__malloc_lock> - a7c: 98800217 ldw r2,8(r19) - a80: 9009883a mov r4,r18 - a84: 000b883a mov r5,zero - a88: 10c00117 ldw r3,4(r2) - a8c: 00bfff04 movi r2,-4 - a90: 18a0703a and r16,r3,r2 - a94: 8463c83a sub r17,r16,r17 - a98: 8c43fbc4 addi r17,r17,4079 - a9c: 8822d33a srli r17,r17,12 - aa0: 0083ffc4 movi r2,4095 - aa4: 8c7fffc4 addi r17,r17,-1 - aa8: 8822933a slli r17,r17,12 - aac: 1440060e bge r2,r17,ac8 <_malloc_trim_r+0x78> - ab0: 00022c00 call 22c0 <_sbrk_r> - ab4: 98c00217 ldw r3,8(r19) - ab8: 9009883a mov r4,r18 - abc: 044bc83a sub r5,zero,r17 - ac0: 80c7883a add r3,r16,r3 - ac4: 10c00926 beq r2,r3,aec <_malloc_trim_r+0x9c> - ac8: 000ad6c0 call ad6c <__malloc_unlock> - acc: 0005883a mov r2,zero - ad0: dfc00417 ldw ra,16(sp) - ad4: dcc00317 ldw r19,12(sp) - ad8: dc800217 ldw r18,8(sp) - adc: dc400117 ldw r17,4(sp) - ae0: dc000017 ldw r16,0(sp) - ae4: dec00504 addi sp,sp,20 - ae8: f800283a ret - aec: 9009883a mov r4,r18 - af0: 00022c00 call 22c0 <_sbrk_r> - af4: 844dc83a sub r6,r16,r17 - af8: 00ffffc4 movi r3,-1 - afc: 9009883a mov r4,r18 - b00: 000b883a mov r5,zero - b04: 01c00074 movhi r7,1 - b08: 39c7b204 addi r7,r7,7880 - b0c: 31800054 ori r6,r6,1 - b10: 10c00926 beq r2,r3,b38 <_malloc_trim_r+0xe8> - b14: 38800017 ldw r2,0(r7) - b18: 98c00217 ldw r3,8(r19) - b1c: 9009883a mov r4,r18 - b20: 1445c83a sub r2,r2,r17 - b24: 38800015 stw r2,0(r7) - b28: 19800115 stw r6,4(r3) - b2c: 000ad6c0 call ad6c <__malloc_unlock> - b30: 00800044 movi r2,1 - b34: 003fe606 br ad0 <_malloc_trim_r+0x80> - b38: 00022c00 call 22c0 <_sbrk_r> - b3c: 99800217 ldw r6,8(r19) - b40: 100f883a mov r7,r2 - b44: 9009883a mov r4,r18 - b48: 1187c83a sub r3,r2,r6 - b4c: 008003c4 movi r2,15 - b50: 19400054 ori r5,r3,1 - b54: 10ffdc0e bge r2,r3,ac8 <_malloc_trim_r+0x78> - b58: 00800074 movhi r2,1 - b5c: 1080b504 addi r2,r2,724 - b60: 10c00017 ldw r3,0(r2) - b64: 00800074 movhi r2,1 - b68: 1087b204 addi r2,r2,7880 - b6c: 31400115 stw r5,4(r6) - b70: 38c7c83a sub r3,r7,r3 - b74: 10c00015 stw r3,0(r2) - b78: 003fd306 br ac8 <_malloc_trim_r+0x78> - -00000b7c <_free_r>: - b7c: defffd04 addi sp,sp,-12 - b80: dc400115 stw r17,4(sp) - b84: dc000015 stw r16,0(sp) - b88: dfc00215 stw ra,8(sp) - b8c: 2821883a mov r16,r5 - b90: 2023883a mov r17,r4 - b94: 28005a26 beq r5,zero,d00 <_free_r+0x184> - b98: 000ad4c0 call ad4c <__malloc_lock> - b9c: 823ffe04 addi r8,r16,-8 - ba0: 41400117 ldw r5,4(r8) - ba4: 00bfff84 movi r2,-2 - ba8: 02800074 movhi r10,1 - bac: 52bae304 addi r10,r10,-5236 - bb0: 288e703a and r7,r5,r2 - bb4: 41cd883a add r6,r8,r7 - bb8: 30c00117 ldw r3,4(r6) - bbc: 51000217 ldw r4,8(r10) - bc0: 00bfff04 movi r2,-4 - bc4: 1892703a and r9,r3,r2 - bc8: 5017883a mov r11,r10 - bcc: 31006726 beq r6,r4,d6c <_free_r+0x1f0> - bd0: 2880004c andi r2,r5,1 - bd4: 1005003a cmpeq r2,r2,zero - bd8: 32400115 stw r9,4(r6) - bdc: 10001a1e bne r2,zero,c48 <_free_r+0xcc> - be0: 000b883a mov r5,zero - be4: 3247883a add r3,r6,r9 - be8: 18800117 ldw r2,4(r3) - bec: 1080004c andi r2,r2,1 - bf0: 1000231e bne r2,zero,c80 <_free_r+0x104> - bf4: 280ac03a cmpne r5,r5,zero - bf8: 3a4f883a add r7,r7,r9 - bfc: 2800451e bne r5,zero,d14 <_free_r+0x198> - c00: 31000217 ldw r4,8(r6) - c04: 00800074 movhi r2,1 - c08: 10bae504 addi r2,r2,-5228 - c0c: 20807b26 beq r4,r2,dfc <_free_r+0x280> - c10: 30800317 ldw r2,12(r6) - c14: 3a07883a add r3,r7,r8 - c18: 19c00015 stw r7,0(r3) - c1c: 11000215 stw r4,8(r2) - c20: 20800315 stw r2,12(r4) - c24: 38800054 ori r2,r7,1 - c28: 40800115 stw r2,4(r8) - c2c: 28001a26 beq r5,zero,c98 <_free_r+0x11c> - c30: 8809883a mov r4,r17 - c34: dfc00217 ldw ra,8(sp) - c38: dc400117 ldw r17,4(sp) - c3c: dc000017 ldw r16,0(sp) - c40: dec00304 addi sp,sp,12 - c44: 000ad6c1 jmpi ad6c <__malloc_unlock> - c48: 80bffe17 ldw r2,-8(r16) - c4c: 50c00204 addi r3,r10,8 - c50: 4091c83a sub r8,r8,r2 - c54: 41000217 ldw r4,8(r8) - c58: 388f883a add r7,r7,r2 - c5c: 20c06126 beq r4,r3,de4 <_free_r+0x268> - c60: 40800317 ldw r2,12(r8) - c64: 3247883a add r3,r6,r9 - c68: 000b883a mov r5,zero - c6c: 11000215 stw r4,8(r2) - c70: 20800315 stw r2,12(r4) - c74: 18800117 ldw r2,4(r3) - c78: 1080004c andi r2,r2,1 - c7c: 103fdd26 beq r2,zero,bf4 <_free_r+0x78> - c80: 38800054 ori r2,r7,1 - c84: 3a07883a add r3,r7,r8 - c88: 280ac03a cmpne r5,r5,zero - c8c: 40800115 stw r2,4(r8) - c90: 19c00015 stw r7,0(r3) - c94: 283fe61e bne r5,zero,c30 <_free_r+0xb4> - c98: 00807fc4 movi r2,511 - c9c: 11c01f2e bgeu r2,r7,d1c <_free_r+0x1a0> - ca0: 3806d27a srli r3,r7,9 - ca4: 1800481e bne r3,zero,dc8 <_free_r+0x24c> - ca8: 3804d0fa srli r2,r7,3 - cac: 100690fa slli r3,r2,3 - cb0: 1acd883a add r6,r3,r11 - cb4: 31400217 ldw r5,8(r6) - cb8: 31405926 beq r6,r5,e20 <_free_r+0x2a4> - cbc: 28800117 ldw r2,4(r5) - cc0: 00ffff04 movi r3,-4 - cc4: 10c4703a and r2,r2,r3 - cc8: 3880022e bgeu r7,r2,cd4 <_free_r+0x158> - ccc: 29400217 ldw r5,8(r5) - cd0: 317ffa1e bne r6,r5,cbc <_free_r+0x140> - cd4: 29800317 ldw r6,12(r5) - cd8: 41800315 stw r6,12(r8) - cdc: 41400215 stw r5,8(r8) - ce0: 8809883a mov r4,r17 - ce4: 2a000315 stw r8,12(r5) - ce8: 32000215 stw r8,8(r6) - cec: dfc00217 ldw ra,8(sp) - cf0: dc400117 ldw r17,4(sp) - cf4: dc000017 ldw r16,0(sp) - cf8: dec00304 addi sp,sp,12 - cfc: 000ad6c1 jmpi ad6c <__malloc_unlock> - d00: dfc00217 ldw ra,8(sp) - d04: dc400117 ldw r17,4(sp) - d08: dc000017 ldw r16,0(sp) - d0c: dec00304 addi sp,sp,12 - d10: f800283a ret - d14: 31000217 ldw r4,8(r6) - d18: 003fbd06 br c10 <_free_r+0x94> - d1c: 3806d0fa srli r3,r7,3 - d20: 00800044 movi r2,1 - d24: 51400117 ldw r5,4(r10) - d28: 180890fa slli r4,r3,3 - d2c: 1807d0ba srai r3,r3,2 - d30: 22c9883a add r4,r4,r11 - d34: 21800217 ldw r6,8(r4) - d38: 10c4983a sll r2,r2,r3 - d3c: 41000315 stw r4,12(r8) - d40: 41800215 stw r6,8(r8) - d44: 288ab03a or r5,r5,r2 - d48: 22000215 stw r8,8(r4) - d4c: 8809883a mov r4,r17 - d50: 51400115 stw r5,4(r10) - d54: 32000315 stw r8,12(r6) - d58: dfc00217 ldw ra,8(sp) - d5c: dc400117 ldw r17,4(sp) - d60: dc000017 ldw r16,0(sp) - d64: dec00304 addi sp,sp,12 - d68: 000ad6c1 jmpi ad6c <__malloc_unlock> - d6c: 2880004c andi r2,r5,1 - d70: 3a4d883a add r6,r7,r9 - d74: 1000071e bne r2,zero,d94 <_free_r+0x218> - d78: 80bffe17 ldw r2,-8(r16) - d7c: 4091c83a sub r8,r8,r2 - d80: 41000317 ldw r4,12(r8) - d84: 40c00217 ldw r3,8(r8) - d88: 308d883a add r6,r6,r2 - d8c: 20c00215 stw r3,8(r4) - d90: 19000315 stw r4,12(r3) - d94: 00800074 movhi r2,1 - d98: 1080b404 addi r2,r2,720 - d9c: 11000017 ldw r4,0(r2) - da0: 30c00054 ori r3,r6,1 - da4: 52000215 stw r8,8(r10) - da8: 40c00115 stw r3,4(r8) - dac: 313fa036 bltu r6,r4,c30 <_free_r+0xb4> - db0: 00800074 movhi r2,1 - db4: 1087a604 addi r2,r2,7832 - db8: 11400017 ldw r5,0(r2) - dbc: 8809883a mov r4,r17 - dc0: 0000a500 call a50 <_malloc_trim_r> - dc4: 003f9a06 br c30 <_free_r+0xb4> - dc8: 00800104 movi r2,4 - dcc: 10c0072e bgeu r2,r3,dec <_free_r+0x270> - dd0: 00800504 movi r2,20 - dd4: 10c01936 bltu r2,r3,e3c <_free_r+0x2c0> - dd8: 188016c4 addi r2,r3,91 - ddc: 100690fa slli r3,r2,3 - de0: 003fb306 br cb0 <_free_r+0x134> - de4: 01400044 movi r5,1 - de8: 003f7e06 br be4 <_free_r+0x68> - dec: 3804d1ba srli r2,r7,6 - df0: 10800e04 addi r2,r2,56 - df4: 100690fa slli r3,r2,3 - df8: 003fad06 br cb0 <_free_r+0x134> - dfc: 22000315 stw r8,12(r4) - e00: 22000215 stw r8,8(r4) - e04: 3a05883a add r2,r7,r8 - e08: 38c00054 ori r3,r7,1 - e0c: 11c00015 stw r7,0(r2) - e10: 41000215 stw r4,8(r8) - e14: 40c00115 stw r3,4(r8) - e18: 41000315 stw r4,12(r8) - e1c: 003f8406 br c30 <_free_r+0xb4> - e20: 1005d0ba srai r2,r2,2 - e24: 00c00044 movi r3,1 - e28: 51000117 ldw r4,4(r10) - e2c: 1886983a sll r3,r3,r2 - e30: 20c8b03a or r4,r4,r3 - e34: 51000115 stw r4,4(r10) - e38: 003fa706 br cd8 <_free_r+0x15c> - e3c: 00801504 movi r2,84 - e40: 10c00436 bltu r2,r3,e54 <_free_r+0x2d8> - e44: 3804d33a srli r2,r7,12 - e48: 10801b84 addi r2,r2,110 - e4c: 100690fa slli r3,r2,3 - e50: 003f9706 br cb0 <_free_r+0x134> - e54: 00805504 movi r2,340 - e58: 10c00436 bltu r2,r3,e6c <_free_r+0x2f0> - e5c: 3804d3fa srli r2,r7,15 - e60: 10801dc4 addi r2,r2,119 - e64: 100690fa slli r3,r2,3 - e68: 003f9106 br cb0 <_free_r+0x134> - e6c: 00815504 movi r2,1364 - e70: 10c0032e bgeu r2,r3,e80 <_free_r+0x304> - e74: 00801f84 movi r2,126 - e78: 00c0fc04 movi r3,1008 - e7c: 003f8c06 br cb0 <_free_r+0x134> - e80: 3804d4ba srli r2,r7,18 - e84: 10801f04 addi r2,r2,124 - e88: 100690fa slli r3,r2,3 - e8c: 003f8806 br cb0 <_free_r+0x134> - -00000e90 <_fseek_r>: - e90: deffe804 addi sp,sp,-96 - e94: dd801515 stw r22,84(sp) - e98: dcc01215 stw r19,72(sp) - e9c: dc801115 stw r18,68(sp) - ea0: dc000f15 stw r16,60(sp) - ea4: dfc01715 stw ra,92(sp) - ea8: ddc01615 stw r23,88(sp) - eac: dd401415 stw r21,80(sp) - eb0: dd001315 stw r20,76(sp) - eb4: dc401015 stw r17,64(sp) - eb8: 2025883a mov r18,r4 - ebc: 2821883a mov r16,r5 - ec0: 302d883a mov r22,r6 - ec4: 3827883a mov r19,r7 - ec8: 20000226 beq r4,zero,ed4 <_fseek_r+0x44> - ecc: 20800e17 ldw r2,56(r4) - ed0: 10007826 beq r2,zero,10b4 <_fseek_r+0x224> - ed4: 8080030b ldhu r2,12(r16) - ed8: 00c04204 movi r3,264 - edc: 1080420c andi r2,r2,264 - ee0: 10c07926 beq r2,r3,10c8 <_fseek_r+0x238> - ee4: 85400a17 ldw r21,40(r16) - ee8: a800ea26 beq r21,zero,1294 <_fseek_r+0x404> - eec: 00800044 movi r2,1 - ef0: 98805f26 beq r19,r2,1070 <_fseek_r+0x1e0> - ef4: 00800084 movi r2,2 - ef8: 98801026 beq r19,r2,f3c <_fseek_r+0xac> - efc: 98000f26 beq r19,zero,f3c <_fseek_r+0xac> - f00: 00800584 movi r2,22 - f04: 013fffc4 movi r4,-1 - f08: 90800015 stw r2,0(r18) - f0c: 2005883a mov r2,r4 - f10: dfc01717 ldw ra,92(sp) - f14: ddc01617 ldw r23,88(sp) - f18: dd801517 ldw r22,84(sp) - f1c: dd401417 ldw r21,80(sp) - f20: dd001317 ldw r20,76(sp) - f24: dcc01217 ldw r19,72(sp) - f28: dc801117 ldw r18,68(sp) - f2c: dc401017 ldw r17,64(sp) - f30: dc000f17 ldw r16,60(sp) - f34: dec01804 addi sp,sp,96 - f38: f800283a ret - f3c: 81800417 ldw r6,16(r16) - f40: 0023883a mov r17,zero - f44: 002f883a mov r23,zero - f48: 3000a626 beq r6,zero,11e4 <_fseek_r+0x354> - f4c: 8100030b ldhu r4,12(r16) - f50: 2082068c andi r2,r4,2074 - f54: 1000081e bne r2,zero,f78 <_fseek_r+0xe8> - f58: 2081000c andi r2,r4,1024 - f5c: 10001b1e bne r2,zero,fcc <_fseek_r+0x13c> - f60: 00800034 movhi r2,0 - f64: 1088ce04 addi r2,r2,9016 - f68: a8800926 beq r21,r2,f90 <_fseek_r+0x100> - f6c: 8080030b ldhu r2,12(r16) - f70: 10820014 ori r2,r2,2048 - f74: 8080030d sth r2,12(r16) - f78: 9009883a mov r4,r18 - f7c: 800b883a mov r5,r16 - f80: 000041c0 call 41c <_fflush_r> - f84: 1000a326 beq r2,zero,1214 <_fseek_r+0x384> - f88: 013fffc4 movi r4,-1 - f8c: 003fdf06 br f0c <_fseek_r+0x7c> - f90: 8140038f ldh r5,14(r16) - f94: 283ff516 blt r5,zero,f6c <_fseek_r+0xdc> - f98: 9009883a mov r4,r18 - f9c: d80d883a mov r6,sp - fa0: 00012f00 call 12f0 <_fstat_r> - fa4: 103ff11e bne r2,zero,f6c <_fseek_r+0xdc> - fa8: d8800117 ldw r2,4(sp) - fac: 00e00014 movui r3,32768 - fb0: 10bc000c andi r2,r2,61440 - fb4: 10ffed1e bne r2,r3,f6c <_fseek_r+0xdc> - fb8: 80c0030b ldhu r3,12(r16) - fbc: 00810004 movi r2,1024 - fc0: 80801315 stw r2,76(r16) - fc4: 1886b03a or r3,r3,r2 - fc8: 80c0030d sth r3,12(r16) - fcc: 9800701e bne r19,zero,1190 <_fseek_r+0x300> - fd0: b029883a mov r20,r22 - fd4: b804c03a cmpne r2,r23,zero - fd8: 10003f1e bne r2,zero,10d8 <_fseek_r+0x248> - fdc: 8100030b ldhu r4,12(r16) - fe0: 2084000c andi r2,r4,4096 - fe4: 1000a126 beq r2,zero,126c <_fseek_r+0x3dc> - fe8: 81801417 ldw r6,80(r16) - fec: 80c00117 ldw r3,4(r16) - ff0: 81400c17 ldw r5,48(r16) - ff4: 30e3c83a sub r17,r6,r3 - ff8: 28008026 beq r5,zero,11fc <_fseek_r+0x36c> - ffc: 81c00f17 ldw r7,60(r16) - 1000: 89e3c83a sub r17,r17,r7 - 1004: 80800e17 ldw r2,56(r16) - 1008: 81800417 ldw r6,16(r16) - 100c: 88c7883a add r3,r17,r3 - 1010: 1185c83a sub r2,r2,r6 - 1014: 11cf883a add r7,r2,r7 - 1018: 1887c83a sub r3,r3,r2 - 101c: 2088000c andi r2,r4,8192 - 1020: 10003e1e bne r2,zero,111c <_fseek_r+0x28c> - 1024: a0c03d16 blt r20,r3,111c <_fseek_r+0x28c> - 1028: 38c5883a add r2,r7,r3 - 102c: a0803b2e bgeu r20,r2,111c <_fseek_r+0x28c> - 1030: a0c5c83a sub r2,r20,r3 - 1034: 3887c83a sub r3,r7,r2 - 1038: 3085883a add r2,r6,r2 - 103c: 80800015 stw r2,0(r16) - 1040: 80c00115 stw r3,4(r16) - 1044: 28000526 beq r5,zero,105c <_fseek_r+0x1cc> - 1048: 80801004 addi r2,r16,64 - 104c: 28800226 beq r5,r2,1058 <_fseek_r+0x1c8> - 1050: 9009883a mov r4,r18 - 1054: 0000b7c0 call b7c <_free_r> - 1058: 80000c15 stw zero,48(r16) - 105c: 8080030b ldhu r2,12(r16) - 1060: 0009883a mov r4,zero - 1064: 10bff7cc andi r2,r2,65503 - 1068: 8080030d sth r2,12(r16) - 106c: 003fa706 br f0c <_fseek_r+0x7c> - 1070: 9009883a mov r4,r18 - 1074: 800b883a mov r5,r16 - 1078: 000041c0 call 41c <_fflush_r> - 107c: 8100030b ldhu r4,12(r16) - 1080: 2084000c andi r2,r4,4096 - 1084: 10008726 beq r2,zero,12a4 <_fseek_r+0x414> - 1088: 84401417 ldw r17,80(r16) - 108c: 2080010c andi r2,r4,4 - 1090: 1000171e bne r2,zero,10f0 <_fseek_r+0x260> - 1094: 2080020c andi r2,r4,8 - 1098: 10003b26 beq r2,zero,1188 <_fseek_r+0x2f8> - 109c: 80800017 ldw r2,0(r16) - 10a0: 10003926 beq r2,zero,1188 <_fseek_r+0x2f8> - 10a4: 81800417 ldw r6,16(r16) - 10a8: 1185c83a sub r2,r2,r6 - 10ac: 88a3883a add r17,r17,r2 - 10b0: 00001606 br 110c <_fseek_r+0x27c> - 10b4: 00006b40 call 6b4 <__sinit> - 10b8: 8080030b ldhu r2,12(r16) - 10bc: 00c04204 movi r3,264 - 10c0: 1080420c andi r2,r2,264 - 10c4: 10ff871e bne r2,r3,ee4 <_fseek_r+0x54> - 10c8: 9009883a mov r4,r18 - 10cc: 800b883a mov r5,r16 - 10d0: 000041c0 call 41c <_fflush_r> - 10d4: 003f8306 br ee4 <_fseek_r+0x54> - 10d8: 81400c17 ldw r5,48(r16) - 10dc: 28004526 beq r5,zero,11f4 <_fseek_r+0x364> - 10e0: 8100030b ldhu r4,12(r16) - 10e4: 80c00117 ldw r3,4(r16) - 10e8: 81c00f17 ldw r7,60(r16) - 10ec: 003fc506 br 1004 <_fseek_r+0x174> - 10f0: 80c00117 ldw r3,4(r16) - 10f4: 80800c17 ldw r2,48(r16) - 10f8: 88e3c83a sub r17,r17,r3 - 10fc: 10002226 beq r2,zero,1188 <_fseek_r+0x2f8> - 1100: 81c00f17 ldw r7,60(r16) - 1104: 81800417 ldw r6,16(r16) - 1108: 89e3c83a sub r17,r17,r7 - 110c: b46d883a add r22,r22,r17 - 1110: 0027883a mov r19,zero - 1114: 05c00044 movi r23,1 - 1118: 003f8b06 br f48 <_fseek_r+0xb8> - 111c: 80801317 ldw r2,76(r16) - 1120: 81400717 ldw r5,28(r16) - 1124: 9009883a mov r4,r18 - 1128: 0085c83a sub r2,zero,r2 - 112c: a0a2703a and r17,r20,r2 - 1130: 880d883a mov r6,r17 - 1134: 000f883a mov r7,zero - 1138: a83ee83a callr r21 - 113c: 00ffffc4 movi r3,-1 - 1140: 10ff8d26 beq r2,r3,f78 <_fseek_r+0xe8> - 1144: 80800417 ldw r2,16(r16) - 1148: 81400c17 ldw r5,48(r16) - 114c: 80000115 stw zero,4(r16) - 1150: 80800015 stw r2,0(r16) - 1154: 28000526 beq r5,zero,116c <_fseek_r+0x2dc> - 1158: 80801004 addi r2,r16,64 - 115c: 28800226 beq r5,r2,1168 <_fseek_r+0x2d8> - 1160: 9009883a mov r4,r18 - 1164: 0000b7c0 call b7c <_free_r> - 1168: 80000c15 stw zero,48(r16) - 116c: 8080030b ldhu r2,12(r16) - 1170: a463c83a sub r17,r20,r17 - 1174: 10bff7cc andi r2,r2,65503 - 1178: 8080030d sth r2,12(r16) - 117c: 88000c1e bne r17,zero,11b0 <_fseek_r+0x320> - 1180: 0009883a mov r4,zero - 1184: 003f6106 br f0c <_fseek_r+0x7c> - 1188: 81800417 ldw r6,16(r16) - 118c: 003fdf06 br 110c <_fseek_r+0x27c> - 1190: 8140038f ldh r5,14(r16) - 1194: 9009883a mov r4,r18 - 1198: d80d883a mov r6,sp - 119c: 00012f00 call 12f0 <_fstat_r> - 11a0: 103f751e bne r2,zero,f78 <_fseek_r+0xe8> - 11a4: d8800417 ldw r2,16(sp) - 11a8: b0a9883a add r20,r22,r2 - 11ac: 003f8906 br fd4 <_fseek_r+0x144> - 11b0: 9009883a mov r4,r18 - 11b4: 800b883a mov r5,r16 - 11b8: 00020e00 call 20e0 <__srefill_r> - 11bc: 103f6e1e bne r2,zero,f78 <_fseek_r+0xe8> - 11c0: 80c00117 ldw r3,4(r16) - 11c4: 1c7f6c36 bltu r3,r17,f78 <_fseek_r+0xe8> - 11c8: 80800017 ldw r2,0(r16) - 11cc: 1c47c83a sub r3,r3,r17 - 11d0: 0009883a mov r4,zero - 11d4: 1445883a add r2,r2,r17 - 11d8: 80c00115 stw r3,4(r16) - 11dc: 80800015 stw r2,0(r16) - 11e0: 003f4a06 br f0c <_fseek_r+0x7c> - 11e4: 9009883a mov r4,r18 - 11e8: 800b883a mov r5,r16 - 11ec: 00015d00 call 15d0 <__smakebuf_r> - 11f0: 003f5606 br f4c <_fseek_r+0xbc> - 11f4: 8100030b ldhu r4,12(r16) - 11f8: 80c00117 ldw r3,4(r16) - 11fc: 80800017 ldw r2,0(r16) - 1200: 81800417 ldw r6,16(r16) - 1204: 1185c83a sub r2,r2,r6 - 1208: 10cf883a add r7,r2,r3 - 120c: 8887c83a sub r3,r17,r2 - 1210: 003f8206 br 101c <_fseek_r+0x18c> - 1214: 81400717 ldw r5,28(r16) - 1218: b00d883a mov r6,r22 - 121c: 980f883a mov r7,r19 - 1220: 9009883a mov r4,r18 - 1224: a83ee83a callr r21 - 1228: 00ffffc4 movi r3,-1 - 122c: 10ff5626 beq r2,r3,f88 <_fseek_r+0xf8> - 1230: 81400c17 ldw r5,48(r16) - 1234: 28000526 beq r5,zero,124c <_fseek_r+0x3bc> - 1238: 80801004 addi r2,r16,64 - 123c: 28800226 beq r5,r2,1248 <_fseek_r+0x3b8> - 1240: 9009883a mov r4,r18 - 1244: 0000b7c0 call b7c <_free_r> - 1248: 80000c15 stw zero,48(r16) - 124c: 8080030b ldhu r2,12(r16) - 1250: 80c00417 ldw r3,16(r16) - 1254: 0009883a mov r4,zero - 1258: 10bdf7cc andi r2,r2,63455 - 125c: 8080030d sth r2,12(r16) - 1260: 80c00015 stw r3,0(r16) - 1264: 80000115 stw zero,4(r16) - 1268: 003f2806 br f0c <_fseek_r+0x7c> - 126c: 81400717 ldw r5,28(r16) - 1270: 000d883a mov r6,zero - 1274: 9009883a mov r4,r18 - 1278: 01c00044 movi r7,1 - 127c: a83ee83a callr r21 - 1280: 100d883a mov r6,r2 - 1284: 00bfffc4 movi r2,-1 - 1288: 30bf3b26 beq r6,r2,f78 <_fseek_r+0xe8> - 128c: 8100030b ldhu r4,12(r16) - 1290: 003f5606 br fec <_fseek_r+0x15c> - 1294: 00800744 movi r2,29 - 1298: 013fffc4 movi r4,-1 - 129c: 90800015 stw r2,0(r18) - 12a0: 003f1a06 br f0c <_fseek_r+0x7c> - 12a4: 81400717 ldw r5,28(r16) - 12a8: 980f883a mov r7,r19 - 12ac: 9009883a mov r4,r18 - 12b0: 000d883a mov r6,zero - 12b4: a83ee83a callr r21 - 12b8: 1023883a mov r17,r2 - 12bc: 00bfffc4 movi r2,-1 - 12c0: 88bf3126 beq r17,r2,f88 <_fseek_r+0xf8> - 12c4: 8100030b ldhu r4,12(r16) - 12c8: 003f7006 br 108c <_fseek_r+0x1fc> - -000012cc : - 12cc: 00800074 movhi r2,1 - 12d0: 1080b204 addi r2,r2,712 - 12d4: 2013883a mov r9,r4 - 12d8: 11000017 ldw r4,0(r2) - 12dc: 2805883a mov r2,r5 - 12e0: 300f883a mov r7,r6 - 12e4: 480b883a mov r5,r9 - 12e8: 100d883a mov r6,r2 - 12ec: 0000e901 jmpi e90 <_fseek_r> - -000012f0 <_fstat_r>: - 12f0: defffd04 addi sp,sp,-12 - 12f4: dc000015 stw r16,0(sp) - 12f8: 04000074 movhi r16,1 - 12fc: 8407a504 addi r16,r16,7828 - 1300: dc400115 stw r17,4(sp) - 1304: 80000015 stw zero,0(r16) - 1308: 2023883a mov r17,r4 - 130c: 2809883a mov r4,r5 - 1310: 300b883a mov r5,r6 - 1314: dfc00215 stw ra,8(sp) - 1318: 000a8440 call a844 - 131c: 1007883a mov r3,r2 - 1320: 00bfffc4 movi r2,-1 - 1324: 18800626 beq r3,r2,1340 <_fstat_r+0x50> - 1328: 1805883a mov r2,r3 - 132c: dfc00217 ldw ra,8(sp) - 1330: dc400117 ldw r17,4(sp) - 1334: dc000017 ldw r16,0(sp) - 1338: dec00304 addi sp,sp,12 - 133c: f800283a ret - 1340: 80800017 ldw r2,0(r16) - 1344: 103ff826 beq r2,zero,1328 <_fstat_r+0x38> - 1348: 88800015 stw r2,0(r17) - 134c: 1805883a mov r2,r3 - 1350: dfc00217 ldw ra,8(sp) - 1354: dc400117 ldw r17,4(sp) - 1358: dc000017 ldw r16,0(sp) - 135c: dec00304 addi sp,sp,12 - 1360: f800283a ret - -00001364 <_fwalk_reent>: - 1364: defff704 addi sp,sp,-36 - 1368: dcc00315 stw r19,12(sp) - 136c: 24c0b804 addi r19,r4,736 - 1370: dd800615 stw r22,24(sp) - 1374: dd400515 stw r21,20(sp) - 1378: dfc00815 stw ra,32(sp) - 137c: ddc00715 stw r23,28(sp) - 1380: dd000415 stw r20,16(sp) - 1384: dc800215 stw r18,8(sp) - 1388: dc400115 stw r17,4(sp) - 138c: dc000015 stw r16,0(sp) - 1390: 202b883a mov r21,r4 - 1394: 282d883a mov r22,r5 - 1398: 00006a40 call 6a4 <__sfp_lock_acquire> - 139c: 98002126 beq r19,zero,1424 <_fwalk_reent+0xc0> - 13a0: 002f883a mov r23,zero - 13a4: 9c800117 ldw r18,4(r19) - 13a8: 9c000217 ldw r16,8(r19) - 13ac: 90bfffc4 addi r2,r18,-1 - 13b0: 10000d16 blt r2,zero,13e8 <_fwalk_reent+0x84> - 13b4: 0023883a mov r17,zero - 13b8: 053fffc4 movi r20,-1 - 13bc: 8080030f ldh r2,12(r16) - 13c0: 8c400044 addi r17,r17,1 - 13c4: 10000626 beq r2,zero,13e0 <_fwalk_reent+0x7c> - 13c8: 8080038f ldh r2,14(r16) - 13cc: 800b883a mov r5,r16 - 13d0: a809883a mov r4,r21 - 13d4: 15000226 beq r2,r20,13e0 <_fwalk_reent+0x7c> - 13d8: b03ee83a callr r22 - 13dc: b8aeb03a or r23,r23,r2 - 13e0: 84001704 addi r16,r16,92 - 13e4: 947ff51e bne r18,r17,13bc <_fwalk_reent+0x58> - 13e8: 9cc00017 ldw r19,0(r19) - 13ec: 983fed1e bne r19,zero,13a4 <_fwalk_reent+0x40> - 13f0: 00006a80 call 6a8 <__sfp_lock_release> - 13f4: b805883a mov r2,r23 - 13f8: dfc00817 ldw ra,32(sp) - 13fc: ddc00717 ldw r23,28(sp) - 1400: dd800617 ldw r22,24(sp) - 1404: dd400517 ldw r21,20(sp) - 1408: dd000417 ldw r20,16(sp) - 140c: dcc00317 ldw r19,12(sp) - 1410: dc800217 ldw r18,8(sp) - 1414: dc400117 ldw r17,4(sp) - 1418: dc000017 ldw r16,0(sp) - 141c: dec00904 addi sp,sp,36 - 1420: f800283a ret - 1424: 002f883a mov r23,zero - 1428: 003ff106 br 13f0 <_fwalk_reent+0x8c> - -0000142c <_fwalk>: - 142c: defff804 addi sp,sp,-32 - 1430: dcc00315 stw r19,12(sp) - 1434: 24c0b804 addi r19,r4,736 - 1438: dd400515 stw r21,20(sp) - 143c: dfc00715 stw ra,28(sp) - 1440: dd800615 stw r22,24(sp) - 1444: dd000415 stw r20,16(sp) - 1448: dc800215 stw r18,8(sp) - 144c: dc400115 stw r17,4(sp) - 1450: dc000015 stw r16,0(sp) - 1454: 282b883a mov r21,r5 - 1458: 00006a40 call 6a4 <__sfp_lock_acquire> - 145c: 98001f26 beq r19,zero,14dc <_fwalk+0xb0> - 1460: 002d883a mov r22,zero - 1464: 9c800117 ldw r18,4(r19) - 1468: 9c000217 ldw r16,8(r19) - 146c: 90bfffc4 addi r2,r18,-1 - 1470: 10000c16 blt r2,zero,14a4 <_fwalk+0x78> - 1474: 0023883a mov r17,zero - 1478: 053fffc4 movi r20,-1 - 147c: 8080030f ldh r2,12(r16) - 1480: 8c400044 addi r17,r17,1 - 1484: 10000526 beq r2,zero,149c <_fwalk+0x70> - 1488: 8080038f ldh r2,14(r16) - 148c: 8009883a mov r4,r16 - 1490: 15000226 beq r2,r20,149c <_fwalk+0x70> - 1494: a83ee83a callr r21 - 1498: b0acb03a or r22,r22,r2 - 149c: 84001704 addi r16,r16,92 - 14a0: 947ff61e bne r18,r17,147c <_fwalk+0x50> - 14a4: 9cc00017 ldw r19,0(r19) - 14a8: 983fee1e bne r19,zero,1464 <_fwalk+0x38> - 14ac: 00006a80 call 6a8 <__sfp_lock_release> - 14b0: b005883a mov r2,r22 - 14b4: dfc00717 ldw ra,28(sp) - 14b8: dd800617 ldw r22,24(sp) - 14bc: dd400517 ldw r21,20(sp) - 14c0: dd000417 ldw r20,16(sp) - 14c4: dcc00317 ldw r19,12(sp) - 14c8: dc800217 ldw r18,8(sp) - 14cc: dc400117 ldw r17,4(sp) - 14d0: dc000017 ldw r16,0(sp) - 14d4: dec00804 addi sp,sp,32 - 14d8: f800283a ret - 14dc: 002d883a mov r22,zero - 14e0: 003ff206 br 14ac <_fwalk+0x80> - -000014e4 <_fwrite_r>: - 14e4: defff604 addi sp,sp,-40 - 14e8: dc000515 stw r16,20(sp) - 14ec: d9400015 stw r5,0(sp) - 14f0: 2021883a mov r16,r4 - 14f4: 300b883a mov r5,r6 - 14f8: 3809883a mov r4,r7 - 14fc: dcc00815 stw r19,32(sp) - 1500: dc800715 stw r18,28(sp) - 1504: dc400615 stw r17,24(sp) - 1508: dfc00915 stw ra,36(sp) - 150c: 3825883a mov r18,r7 - 1510: 3027883a mov r19,r6 - 1514: 0009fc80 call 9fc8 <__mulsi3> - 1518: 1023883a mov r17,r2 - 151c: 00800044 movi r2,1 - 1520: d8800315 stw r2,12(sp) - 1524: dc400115 stw r17,4(sp) - 1528: dc400415 stw r17,16(sp) - 152c: dec00215 stw sp,8(sp) - 1530: 80000326 beq r16,zero,1540 <_fwrite_r+0x5c> - 1534: 80800e17 ldw r2,56(r16) - 1538: 8009883a mov r4,r16 - 153c: 10001226 beq r2,zero,1588 <_fwrite_r+0xa4> - 1540: d9400a17 ldw r5,40(sp) - 1544: 8009883a mov r4,r16 - 1548: d9800204 addi r6,sp,8 - 154c: 0005eec0 call 5eec <__sfvwrite_r> - 1550: 980b883a mov r5,r19 - 1554: 10000426 beq r2,zero,1568 <_fwrite_r+0x84> - 1558: d9000417 ldw r4,16(sp) - 155c: 8909c83a sub r4,r17,r4 - 1560: 0009fb80 call 9fb8 <__udivsi3> - 1564: 1025883a mov r18,r2 - 1568: 9005883a mov r2,r18 - 156c: dfc00917 ldw ra,36(sp) - 1570: dcc00817 ldw r19,32(sp) - 1574: dc800717 ldw r18,28(sp) - 1578: dc400617 ldw r17,24(sp) - 157c: dc000517 ldw r16,20(sp) - 1580: dec00a04 addi sp,sp,40 - 1584: f800283a ret - 1588: 00006b40 call 6b4 <__sinit> - 158c: 003fec06 br 1540 <_fwrite_r+0x5c> - -00001590 : - 1590: 00800074 movhi r2,1 - 1594: 1080b204 addi r2,r2,712 - 1598: 2017883a mov r11,r4 - 159c: 11000017 ldw r4,0(r2) - 15a0: defffe04 addi sp,sp,-8 - 15a4: 3013883a mov r9,r6 - 15a8: 2805883a mov r2,r5 - 15ac: d9c00015 stw r7,0(sp) - 15b0: 580b883a mov r5,r11 - 15b4: 100d883a mov r6,r2 - 15b8: 480f883a mov r7,r9 - 15bc: dfc00115 stw ra,4(sp) - 15c0: 00014e40 call 14e4 <_fwrite_r> - 15c4: dfc00117 ldw ra,4(sp) - 15c8: dec00204 addi sp,sp,8 - 15cc: f800283a ret - -000015d0 <__smakebuf_r>: - 15d0: 2880030b ldhu r2,12(r5) - 15d4: deffed04 addi sp,sp,-76 - 15d8: dc401015 stw r17,64(sp) - 15dc: 1080008c andi r2,r2,2 - 15e0: dc000f15 stw r16,60(sp) - 15e4: dfc01215 stw ra,72(sp) - 15e8: dc801115 stw r18,68(sp) - 15ec: 2821883a mov r16,r5 - 15f0: 2023883a mov r17,r4 - 15f4: 10000b26 beq r2,zero,1624 <__smakebuf_r+0x54> - 15f8: 28c010c4 addi r3,r5,67 - 15fc: 00800044 movi r2,1 - 1600: 28800515 stw r2,20(r5) - 1604: 28c00415 stw r3,16(r5) - 1608: 28c00015 stw r3,0(r5) - 160c: dfc01217 ldw ra,72(sp) - 1610: dc801117 ldw r18,68(sp) - 1614: dc401017 ldw r17,64(sp) - 1618: dc000f17 ldw r16,60(sp) - 161c: dec01304 addi sp,sp,76 - 1620: f800283a ret - 1624: 2940038f ldh r5,14(r5) - 1628: 28002116 blt r5,zero,16b0 <__smakebuf_r+0xe0> - 162c: d80d883a mov r6,sp - 1630: 00012f00 call 12f0 <_fstat_r> - 1634: 10001e16 blt r2,zero,16b0 <__smakebuf_r+0xe0> - 1638: d8800117 ldw r2,4(sp) - 163c: 00e00014 movui r3,32768 - 1640: 113c000c andi r4,r2,61440 - 1644: 20c03126 beq r4,r3,170c <__smakebuf_r+0x13c> - 1648: 8080030b ldhu r2,12(r16) - 164c: 00c80004 movi r3,8192 - 1650: 10820014 ori r2,r2,2048 - 1654: 8080030d sth r2,12(r16) - 1658: 20c01e26 beq r4,r3,16d4 <__smakebuf_r+0x104> - 165c: 04810004 movi r18,1024 - 1660: 8809883a mov r4,r17 - 1664: 900b883a mov r5,r18 - 1668: 00017640 call 1764 <_malloc_r> - 166c: 1009883a mov r4,r2 - 1670: 10003126 beq r2,zero,1738 <__smakebuf_r+0x168> - 1674: 80c0030b ldhu r3,12(r16) - 1678: 00800034 movhi r2,0 - 167c: 1081e604 addi r2,r2,1944 - 1680: 88800f15 stw r2,60(r17) - 1684: 18c02014 ori r3,r3,128 - 1688: 84800515 stw r18,20(r16) - 168c: 80c0030d sth r3,12(r16) - 1690: 81000415 stw r4,16(r16) - 1694: 81000015 stw r4,0(r16) - 1698: dfc01217 ldw ra,72(sp) - 169c: dc801117 ldw r18,68(sp) - 16a0: dc401017 ldw r17,64(sp) - 16a4: dc000f17 ldw r16,60(sp) - 16a8: dec01304 addi sp,sp,76 - 16ac: f800283a ret - 16b0: 80c0030b ldhu r3,12(r16) - 16b4: 1880200c andi r2,r3,128 - 16b8: 10000426 beq r2,zero,16cc <__smakebuf_r+0xfc> - 16bc: 04801004 movi r18,64 - 16c0: 18820014 ori r2,r3,2048 - 16c4: 8080030d sth r2,12(r16) - 16c8: 003fe506 br 1660 <__smakebuf_r+0x90> - 16cc: 04810004 movi r18,1024 - 16d0: 003ffb06 br 16c0 <__smakebuf_r+0xf0> - 16d4: 8140038f ldh r5,14(r16) - 16d8: 8809883a mov r4,r17 - 16dc: 00063880 call 6388 <_isatty_r> - 16e0: 103fde26 beq r2,zero,165c <__smakebuf_r+0x8c> - 16e4: 8080030b ldhu r2,12(r16) - 16e8: 80c010c4 addi r3,r16,67 - 16ec: 04810004 movi r18,1024 - 16f0: 10800054 ori r2,r2,1 - 16f4: 8080030d sth r2,12(r16) - 16f8: 00800044 movi r2,1 - 16fc: 80c00415 stw r3,16(r16) - 1700: 80800515 stw r2,20(r16) - 1704: 80c00015 stw r3,0(r16) - 1708: 003fd506 br 1660 <__smakebuf_r+0x90> - 170c: 80c00a17 ldw r3,40(r16) - 1710: 00800034 movhi r2,0 - 1714: 1088ce04 addi r2,r2,9016 - 1718: 18bfcb1e bne r3,r2,1648 <__smakebuf_r+0x78> - 171c: 8080030b ldhu r2,12(r16) - 1720: 00c10004 movi r3,1024 - 1724: 1825883a mov r18,r3 - 1728: 10c4b03a or r2,r2,r3 - 172c: 8080030d sth r2,12(r16) - 1730: 80c01315 stw r3,76(r16) - 1734: 003fca06 br 1660 <__smakebuf_r+0x90> - 1738: 8100030b ldhu r4,12(r16) - 173c: 2080800c andi r2,r4,512 - 1740: 103fb21e bne r2,zero,160c <__smakebuf_r+0x3c> - 1744: 80c010c4 addi r3,r16,67 - 1748: 21000094 ori r4,r4,2 - 174c: 00800044 movi r2,1 - 1750: 80800515 stw r2,20(r16) - 1754: 8100030d sth r4,12(r16) - 1758: 80c00415 stw r3,16(r16) - 175c: 80c00015 stw r3,0(r16) - 1760: 003faa06 br 160c <__smakebuf_r+0x3c> - -00001764 <_malloc_r>: - 1764: defff604 addi sp,sp,-40 - 1768: 28c002c4 addi r3,r5,11 - 176c: 00800584 movi r2,22 - 1770: dc800215 stw r18,8(sp) - 1774: dfc00915 stw ra,36(sp) - 1778: df000815 stw fp,32(sp) - 177c: ddc00715 stw r23,28(sp) - 1780: dd800615 stw r22,24(sp) - 1784: dd400515 stw r21,20(sp) - 1788: dd000415 stw r20,16(sp) - 178c: dcc00315 stw r19,12(sp) - 1790: dc400115 stw r17,4(sp) - 1794: dc000015 stw r16,0(sp) - 1798: 2025883a mov r18,r4 - 179c: 10c01236 bltu r2,r3,17e8 <_malloc_r+0x84> - 17a0: 04400404 movi r17,16 - 17a4: 8940142e bgeu r17,r5,17f8 <_malloc_r+0x94> - 17a8: 00800304 movi r2,12 - 17ac: 0007883a mov r3,zero - 17b0: 90800015 stw r2,0(r18) - 17b4: 1805883a mov r2,r3 - 17b8: dfc00917 ldw ra,36(sp) - 17bc: df000817 ldw fp,32(sp) - 17c0: ddc00717 ldw r23,28(sp) - 17c4: dd800617 ldw r22,24(sp) - 17c8: dd400517 ldw r21,20(sp) - 17cc: dd000417 ldw r20,16(sp) - 17d0: dcc00317 ldw r19,12(sp) - 17d4: dc800217 ldw r18,8(sp) - 17d8: dc400117 ldw r17,4(sp) - 17dc: dc000017 ldw r16,0(sp) - 17e0: dec00a04 addi sp,sp,40 - 17e4: f800283a ret - 17e8: 00bffe04 movi r2,-8 - 17ec: 18a2703a and r17,r3,r2 - 17f0: 883fed16 blt r17,zero,17a8 <_malloc_r+0x44> - 17f4: 897fec36 bltu r17,r5,17a8 <_malloc_r+0x44> - 17f8: 9009883a mov r4,r18 - 17fc: 000ad4c0 call ad4c <__malloc_lock> - 1800: 00807dc4 movi r2,503 - 1804: 14402b2e bgeu r2,r17,18b4 <_malloc_r+0x150> - 1808: 8806d27a srli r3,r17,9 - 180c: 18003f1e bne r3,zero,190c <_malloc_r+0x1a8> - 1810: 880cd0fa srli r6,r17,3 - 1814: 300490fa slli r2,r6,3 - 1818: 02c00074 movhi r11,1 - 181c: 5afae304 addi r11,r11,-5236 - 1820: 12cb883a add r5,r2,r11 - 1824: 2c000317 ldw r16,12(r5) - 1828: 580f883a mov r7,r11 - 182c: 2c00041e bne r5,r16,1840 <_malloc_r+0xdc> - 1830: 00000a06 br 185c <_malloc_r+0xf8> - 1834: 1800860e bge r3,zero,1a50 <_malloc_r+0x2ec> - 1838: 84000317 ldw r16,12(r16) - 183c: 2c000726 beq r5,r16,185c <_malloc_r+0xf8> - 1840: 80800117 ldw r2,4(r16) - 1844: 00ffff04 movi r3,-4 - 1848: 10c8703a and r4,r2,r3 - 184c: 2447c83a sub r3,r4,r17 - 1850: 008003c4 movi r2,15 - 1854: 10fff70e bge r2,r3,1834 <_malloc_r+0xd0> - 1858: 31bfffc4 addi r6,r6,-1 - 185c: 32400044 addi r9,r6,1 - 1860: 02800074 movhi r10,1 - 1864: 52bae504 addi r10,r10,-5228 - 1868: 54000217 ldw r16,8(r10) - 186c: 8280a026 beq r16,r10,1af0 <_malloc_r+0x38c> - 1870: 80800117 ldw r2,4(r16) - 1874: 00ffff04 movi r3,-4 - 1878: 10ca703a and r5,r2,r3 - 187c: 2c4dc83a sub r6,r5,r17 - 1880: 008003c4 movi r2,15 - 1884: 11808316 blt r2,r6,1a94 <_malloc_r+0x330> - 1888: 52800315 stw r10,12(r10) - 188c: 52800215 stw r10,8(r10) - 1890: 30002916 blt r6,zero,1938 <_malloc_r+0x1d4> - 1894: 8147883a add r3,r16,r5 - 1898: 18800117 ldw r2,4(r3) - 189c: 9009883a mov r4,r18 - 18a0: 10800054 ori r2,r2,1 - 18a4: 18800115 stw r2,4(r3) - 18a8: 000ad6c0 call ad6c <__malloc_unlock> - 18ac: 80c00204 addi r3,r16,8 - 18b0: 003fc006 br 17b4 <_malloc_r+0x50> - 18b4: 02c00074 movhi r11,1 - 18b8: 5afae304 addi r11,r11,-5236 - 18bc: 8ac5883a add r2,r17,r11 - 18c0: 14000317 ldw r16,12(r2) - 18c4: 580f883a mov r7,r11 - 18c8: 8806d0fa srli r3,r17,3 - 18cc: 14006c26 beq r2,r16,1a80 <_malloc_r+0x31c> - 18d0: 80c00117 ldw r3,4(r16) - 18d4: 00bfff04 movi r2,-4 - 18d8: 81800317 ldw r6,12(r16) - 18dc: 1886703a and r3,r3,r2 - 18e0: 80c7883a add r3,r16,r3 - 18e4: 18800117 ldw r2,4(r3) - 18e8: 81400217 ldw r5,8(r16) - 18ec: 9009883a mov r4,r18 - 18f0: 10800054 ori r2,r2,1 - 18f4: 18800115 stw r2,4(r3) - 18f8: 31400215 stw r5,8(r6) - 18fc: 29800315 stw r6,12(r5) - 1900: 000ad6c0 call ad6c <__malloc_unlock> - 1904: 80c00204 addi r3,r16,8 - 1908: 003faa06 br 17b4 <_malloc_r+0x50> - 190c: 00800104 movi r2,4 - 1910: 10c0052e bgeu r2,r3,1928 <_malloc_r+0x1c4> - 1914: 00800504 movi r2,20 - 1918: 10c07836 bltu r2,r3,1afc <_malloc_r+0x398> - 191c: 198016c4 addi r6,r3,91 - 1920: 300490fa slli r2,r6,3 - 1924: 003fbc06 br 1818 <_malloc_r+0xb4> - 1928: 8804d1ba srli r2,r17,6 - 192c: 11800e04 addi r6,r2,56 - 1930: 300490fa slli r2,r6,3 - 1934: 003fb806 br 1818 <_malloc_r+0xb4> - 1938: 00807fc4 movi r2,511 - 193c: 1140bb36 bltu r2,r5,1c2c <_malloc_r+0x4c8> - 1940: 2806d0fa srli r3,r5,3 - 1944: 573ffe04 addi fp,r10,-8 - 1948: 00800044 movi r2,1 - 194c: 180890fa slli r4,r3,3 - 1950: 1807d0ba srai r3,r3,2 - 1954: e1c00117 ldw r7,4(fp) - 1958: 5909883a add r4,r11,r4 - 195c: 21400217 ldw r5,8(r4) - 1960: 10c4983a sll r2,r2,r3 - 1964: 81000315 stw r4,12(r16) - 1968: 81400215 stw r5,8(r16) - 196c: 388eb03a or r7,r7,r2 - 1970: 2c000315 stw r16,12(r5) - 1974: 24000215 stw r16,8(r4) - 1978: e1c00115 stw r7,4(fp) - 197c: 4807883a mov r3,r9 - 1980: 4800cd16 blt r9,zero,1cb8 <_malloc_r+0x554> - 1984: 1807d0ba srai r3,r3,2 - 1988: 00800044 movi r2,1 - 198c: 10c8983a sll r4,r2,r3 - 1990: 39004436 bltu r7,r4,1aa4 <_malloc_r+0x340> - 1994: 21c4703a and r2,r4,r7 - 1998: 10000a1e bne r2,zero,19c4 <_malloc_r+0x260> - 199c: 2109883a add r4,r4,r4 - 19a0: 00bfff04 movi r2,-4 - 19a4: 4884703a and r2,r9,r2 - 19a8: 3906703a and r3,r7,r4 - 19ac: 12400104 addi r9,r2,4 - 19b0: 1800041e bne r3,zero,19c4 <_malloc_r+0x260> - 19b4: 2109883a add r4,r4,r4 - 19b8: 3904703a and r2,r7,r4 - 19bc: 4a400104 addi r9,r9,4 - 19c0: 103ffc26 beq r2,zero,19b4 <_malloc_r+0x250> - 19c4: 480490fa slli r2,r9,3 - 19c8: 4819883a mov r12,r9 - 19cc: 023fff04 movi r8,-4 - 19d0: 589b883a add r13,r11,r2 - 19d4: 6807883a mov r3,r13 - 19d8: 014003c4 movi r5,15 - 19dc: 1c000317 ldw r16,12(r3) - 19e0: 1c00041e bne r3,r16,19f4 <_malloc_r+0x290> - 19e4: 0000a706 br 1c84 <_malloc_r+0x520> - 19e8: 3000ab0e bge r6,zero,1c98 <_malloc_r+0x534> - 19ec: 84000317 ldw r16,12(r16) - 19f0: 1c00a426 beq r3,r16,1c84 <_malloc_r+0x520> - 19f4: 80800117 ldw r2,4(r16) - 19f8: 1204703a and r2,r2,r8 - 19fc: 144dc83a sub r6,r2,r17 - 1a00: 29bff90e bge r5,r6,19e8 <_malloc_r+0x284> - 1a04: 81000317 ldw r4,12(r16) - 1a08: 80c00217 ldw r3,8(r16) - 1a0c: 89400054 ori r5,r17,1 - 1a10: 8445883a add r2,r16,r17 - 1a14: 20c00215 stw r3,8(r4) - 1a18: 19000315 stw r4,12(r3) - 1a1c: 81400115 stw r5,4(r16) - 1a20: 1187883a add r3,r2,r6 - 1a24: 31000054 ori r4,r6,1 - 1a28: 50800315 stw r2,12(r10) - 1a2c: 50800215 stw r2,8(r10) - 1a30: 19800015 stw r6,0(r3) - 1a34: 11000115 stw r4,4(r2) - 1a38: 12800215 stw r10,8(r2) - 1a3c: 12800315 stw r10,12(r2) - 1a40: 9009883a mov r4,r18 - 1a44: 000ad6c0 call ad6c <__malloc_unlock> - 1a48: 80c00204 addi r3,r16,8 - 1a4c: 003f5906 br 17b4 <_malloc_r+0x50> - 1a50: 8109883a add r4,r16,r4 - 1a54: 20800117 ldw r2,4(r4) - 1a58: 80c00217 ldw r3,8(r16) - 1a5c: 81400317 ldw r5,12(r16) - 1a60: 10800054 ori r2,r2,1 - 1a64: 20800115 stw r2,4(r4) - 1a68: 28c00215 stw r3,8(r5) - 1a6c: 19400315 stw r5,12(r3) - 1a70: 9009883a mov r4,r18 - 1a74: 000ad6c0 call ad6c <__malloc_unlock> - 1a78: 80c00204 addi r3,r16,8 - 1a7c: 003f4d06 br 17b4 <_malloc_r+0x50> - 1a80: 80800204 addi r2,r16,8 - 1a84: 14000317 ldw r16,12(r2) - 1a88: 143f911e bne r2,r16,18d0 <_malloc_r+0x16c> - 1a8c: 1a400084 addi r9,r3,2 - 1a90: 003f7306 br 1860 <_malloc_r+0xfc> - 1a94: 88c00054 ori r3,r17,1 - 1a98: 8445883a add r2,r16,r17 - 1a9c: 80c00115 stw r3,4(r16) - 1aa0: 003fdf06 br 1a20 <_malloc_r+0x2bc> - 1aa4: e4000217 ldw r16,8(fp) - 1aa8: 00bfff04 movi r2,-4 - 1aac: 80c00117 ldw r3,4(r16) - 1ab0: 802d883a mov r22,r16 - 1ab4: 18aa703a and r21,r3,r2 - 1ab8: ac401636 bltu r21,r17,1b14 <_malloc_r+0x3b0> - 1abc: ac49c83a sub r4,r21,r17 - 1ac0: 008003c4 movi r2,15 - 1ac4: 1100130e bge r2,r4,1b14 <_malloc_r+0x3b0> - 1ac8: 88800054 ori r2,r17,1 - 1acc: 8447883a add r3,r16,r17 - 1ad0: 80800115 stw r2,4(r16) - 1ad4: 20800054 ori r2,r4,1 - 1ad8: 18800115 stw r2,4(r3) - 1adc: e0c00215 stw r3,8(fp) - 1ae0: 9009883a mov r4,r18 - 1ae4: 000ad6c0 call ad6c <__malloc_unlock> - 1ae8: 80c00204 addi r3,r16,8 - 1aec: 003f3106 br 17b4 <_malloc_r+0x50> - 1af0: 39c00117 ldw r7,4(r7) - 1af4: 573ffe04 addi fp,r10,-8 - 1af8: 003fa006 br 197c <_malloc_r+0x218> - 1afc: 00801504 movi r2,84 - 1b00: 10c06736 bltu r2,r3,1ca0 <_malloc_r+0x53c> - 1b04: 8804d33a srli r2,r17,12 - 1b08: 11801b84 addi r6,r2,110 - 1b0c: 300490fa slli r2,r6,3 - 1b10: 003f4106 br 1818 <_malloc_r+0xb4> - 1b14: d0a6f417 ldw r2,-25648(gp) - 1b18: d0e00317 ldw r3,-32756(gp) - 1b1c: 053fffc4 movi r20,-1 - 1b20: 10800404 addi r2,r2,16 - 1b24: 88a7883a add r19,r17,r2 - 1b28: 1d000326 beq r3,r20,1b38 <_malloc_r+0x3d4> - 1b2c: 98c3ffc4 addi r3,r19,4095 - 1b30: 00bc0004 movi r2,-4096 - 1b34: 18a6703a and r19,r3,r2 - 1b38: 9009883a mov r4,r18 - 1b3c: 980b883a mov r5,r19 - 1b40: 00022c00 call 22c0 <_sbrk_r> - 1b44: 1009883a mov r4,r2 - 1b48: 15000426 beq r2,r20,1b5c <_malloc_r+0x3f8> - 1b4c: 854b883a add r5,r16,r21 - 1b50: 1029883a mov r20,r2 - 1b54: 11405a2e bgeu r2,r5,1cc0 <_malloc_r+0x55c> - 1b58: 87000c26 beq r16,fp,1b8c <_malloc_r+0x428> - 1b5c: e4000217 ldw r16,8(fp) - 1b60: 80c00117 ldw r3,4(r16) - 1b64: 00bfff04 movi r2,-4 - 1b68: 1884703a and r2,r3,r2 - 1b6c: 14400336 bltu r2,r17,1b7c <_malloc_r+0x418> - 1b70: 1449c83a sub r4,r2,r17 - 1b74: 008003c4 movi r2,15 - 1b78: 113fd316 blt r2,r4,1ac8 <_malloc_r+0x364> - 1b7c: 9009883a mov r4,r18 - 1b80: 000ad6c0 call ad6c <__malloc_unlock> - 1b84: 0007883a mov r3,zero - 1b88: 003f0a06 br 17b4 <_malloc_r+0x50> - 1b8c: 05c00074 movhi r23,1 - 1b90: bdc7b204 addi r23,r23,7880 - 1b94: b8800017 ldw r2,0(r23) - 1b98: 988d883a add r6,r19,r2 - 1b9c: b9800015 stw r6,0(r23) - 1ba0: d0e00317 ldw r3,-32756(gp) - 1ba4: 00bfffc4 movi r2,-1 - 1ba8: 18808e26 beq r3,r2,1de4 <_malloc_r+0x680> - 1bac: 2145c83a sub r2,r4,r5 - 1bb0: 3085883a add r2,r6,r2 - 1bb4: b8800015 stw r2,0(r23) - 1bb8: 20c001cc andi r3,r4,7 - 1bbc: 18005f1e bne r3,zero,1d3c <_malloc_r+0x5d8> - 1bc0: 000b883a mov r5,zero - 1bc4: a4c5883a add r2,r20,r19 - 1bc8: 1083ffcc andi r2,r2,4095 - 1bcc: 00c40004 movi r3,4096 - 1bd0: 1887c83a sub r3,r3,r2 - 1bd4: 28e7883a add r19,r5,r3 - 1bd8: 9009883a mov r4,r18 - 1bdc: 980b883a mov r5,r19 - 1be0: 00022c00 call 22c0 <_sbrk_r> - 1be4: 1007883a mov r3,r2 - 1be8: 00bfffc4 movi r2,-1 - 1bec: 18807a26 beq r3,r2,1dd8 <_malloc_r+0x674> - 1bf0: 1d05c83a sub r2,r3,r20 - 1bf4: 9885883a add r2,r19,r2 - 1bf8: 10c00054 ori r3,r2,1 - 1bfc: b8800017 ldw r2,0(r23) - 1c00: a021883a mov r16,r20 - 1c04: a0c00115 stw r3,4(r20) - 1c08: 9885883a add r2,r19,r2 - 1c0c: b8800015 stw r2,0(r23) - 1c10: e5000215 stw r20,8(fp) - 1c14: b7003626 beq r22,fp,1cf0 <_malloc_r+0x58c> - 1c18: 018003c4 movi r6,15 - 1c1c: 35404b36 bltu r6,r21,1d4c <_malloc_r+0x5e8> - 1c20: 00800044 movi r2,1 - 1c24: a0800115 stw r2,4(r20) - 1c28: 003fcd06 br 1b60 <_malloc_r+0x3fc> - 1c2c: 2808d27a srli r4,r5,9 - 1c30: 2000371e bne r4,zero,1d10 <_malloc_r+0x5ac> - 1c34: 2808d0fa srli r4,r5,3 - 1c38: 200690fa slli r3,r4,3 - 1c3c: 1ad1883a add r8,r3,r11 - 1c40: 41800217 ldw r6,8(r8) - 1c44: 41805b26 beq r8,r6,1db4 <_malloc_r+0x650> - 1c48: 30800117 ldw r2,4(r6) - 1c4c: 00ffff04 movi r3,-4 - 1c50: 10c4703a and r2,r2,r3 - 1c54: 2880022e bgeu r5,r2,1c60 <_malloc_r+0x4fc> - 1c58: 31800217 ldw r6,8(r6) - 1c5c: 41bffa1e bne r8,r6,1c48 <_malloc_r+0x4e4> - 1c60: 32000317 ldw r8,12(r6) - 1c64: 39c00117 ldw r7,4(r7) - 1c68: 82000315 stw r8,12(r16) - 1c6c: 81800215 stw r6,8(r16) - 1c70: 07000074 movhi fp,1 - 1c74: e73ae304 addi fp,fp,-5236 - 1c78: 34000315 stw r16,12(r6) - 1c7c: 44000215 stw r16,8(r8) - 1c80: 003f3e06 br 197c <_malloc_r+0x218> - 1c84: 63000044 addi r12,r12,1 - 1c88: 608000cc andi r2,r12,3 - 1c8c: 10005d26 beq r2,zero,1e04 <_malloc_r+0x6a0> - 1c90: 18c00204 addi r3,r3,8 - 1c94: 003f5106 br 19dc <_malloc_r+0x278> - 1c98: 8089883a add r4,r16,r2 - 1c9c: 003f6d06 br 1a54 <_malloc_r+0x2f0> - 1ca0: 00805504 movi r2,340 - 1ca4: 10c02036 bltu r2,r3,1d28 <_malloc_r+0x5c4> - 1ca8: 8804d3fa srli r2,r17,15 - 1cac: 11801dc4 addi r6,r2,119 - 1cb0: 300490fa slli r2,r6,3 - 1cb4: 003ed806 br 1818 <_malloc_r+0xb4> - 1cb8: 48c000c4 addi r3,r9,3 - 1cbc: 003f3106 br 1984 <_malloc_r+0x220> - 1cc0: 05c00074 movhi r23,1 - 1cc4: bdc7b204 addi r23,r23,7880 - 1cc8: b8800017 ldw r2,0(r23) - 1ccc: 988d883a add r6,r19,r2 - 1cd0: b9800015 stw r6,0(r23) - 1cd4: 293fb21e bne r5,r4,1ba0 <_malloc_r+0x43c> - 1cd8: 2083ffcc andi r2,r4,4095 - 1cdc: 103fb01e bne r2,zero,1ba0 <_malloc_r+0x43c> - 1ce0: e4000217 ldw r16,8(fp) - 1ce4: 9d45883a add r2,r19,r21 - 1ce8: 10800054 ori r2,r2,1 - 1cec: 80800115 stw r2,4(r16) - 1cf0: b8c00017 ldw r3,0(r23) - 1cf4: d0a6f517 ldw r2,-25644(gp) - 1cf8: 10c0012e bgeu r2,r3,1d00 <_malloc_r+0x59c> - 1cfc: d0e6f515 stw r3,-25644(gp) - 1d00: d0a6f617 ldw r2,-25640(gp) - 1d04: 10ff962e bgeu r2,r3,1b60 <_malloc_r+0x3fc> - 1d08: d0e6f615 stw r3,-25640(gp) - 1d0c: 003f9406 br 1b60 <_malloc_r+0x3fc> - 1d10: 00800104 movi r2,4 - 1d14: 11001e36 bltu r2,r4,1d90 <_malloc_r+0x62c> - 1d18: 2804d1ba srli r2,r5,6 - 1d1c: 11000e04 addi r4,r2,56 - 1d20: 200690fa slli r3,r4,3 - 1d24: 003fc506 br 1c3c <_malloc_r+0x4d8> - 1d28: 00815504 movi r2,1364 - 1d2c: 10c01d2e bgeu r2,r3,1da4 <_malloc_r+0x640> - 1d30: 01801f84 movi r6,126 - 1d34: 0080fc04 movi r2,1008 - 1d38: 003eb706 br 1818 <_malloc_r+0xb4> - 1d3c: 00800204 movi r2,8 - 1d40: 10cbc83a sub r5,r2,r3 - 1d44: 2169883a add r20,r4,r5 - 1d48: 003f9e06 br 1bc4 <_malloc_r+0x460> - 1d4c: 00bffe04 movi r2,-8 - 1d50: a93ffd04 addi r4,r21,-12 - 1d54: 2088703a and r4,r4,r2 - 1d58: b10b883a add r5,r22,r4 - 1d5c: 00c00144 movi r3,5 - 1d60: 28c00215 stw r3,8(r5) - 1d64: 28c00115 stw r3,4(r5) - 1d68: b0800117 ldw r2,4(r22) - 1d6c: 1080004c andi r2,r2,1 - 1d70: 2084b03a or r2,r4,r2 - 1d74: b0800115 stw r2,4(r22) - 1d78: 313fdd2e bgeu r6,r4,1cf0 <_malloc_r+0x58c> - 1d7c: b1400204 addi r5,r22,8 - 1d80: 9009883a mov r4,r18 - 1d84: 0000b7c0 call b7c <_free_r> - 1d88: e4000217 ldw r16,8(fp) - 1d8c: 003fd806 br 1cf0 <_malloc_r+0x58c> - 1d90: 00800504 movi r2,20 - 1d94: 11001536 bltu r2,r4,1dec <_malloc_r+0x688> - 1d98: 210016c4 addi r4,r4,91 - 1d9c: 200690fa slli r3,r4,3 - 1da0: 003fa606 br 1c3c <_malloc_r+0x4d8> - 1da4: 8804d4ba srli r2,r17,18 - 1da8: 11801f04 addi r6,r2,124 - 1dac: 300490fa slli r2,r6,3 - 1db0: 003e9906 br 1818 <_malloc_r+0xb4> - 1db4: 2009d0ba srai r4,r4,2 - 1db8: 01400074 movhi r5,1 - 1dbc: 297ae304 addi r5,r5,-5236 - 1dc0: 00c00044 movi r3,1 - 1dc4: 28800117 ldw r2,4(r5) - 1dc8: 1906983a sll r3,r3,r4 - 1dcc: 10c4b03a or r2,r2,r3 - 1dd0: 28800115 stw r2,4(r5) - 1dd4: 003fa306 br 1c64 <_malloc_r+0x500> - 1dd8: 0027883a mov r19,zero - 1ddc: 00c00044 movi r3,1 - 1de0: 003f8606 br 1bfc <_malloc_r+0x498> - 1de4: d1200315 stw r4,-32756(gp) - 1de8: 003f7306 br 1bb8 <_malloc_r+0x454> - 1dec: 00801504 movi r2,84 - 1df0: 11001936 bltu r2,r4,1e58 <_malloc_r+0x6f4> - 1df4: 2804d33a srli r2,r5,12 - 1df8: 11001b84 addi r4,r2,110 - 1dfc: 200690fa slli r3,r4,3 - 1e00: 003f8e06 br 1c3c <_malloc_r+0x4d8> - 1e04: 480b883a mov r5,r9 - 1e08: 6807883a mov r3,r13 - 1e0c: 288000cc andi r2,r5,3 - 1e10: 18fffe04 addi r3,r3,-8 - 1e14: 297fffc4 addi r5,r5,-1 - 1e18: 10001526 beq r2,zero,1e70 <_malloc_r+0x70c> - 1e1c: 18800217 ldw r2,8(r3) - 1e20: 10fffa26 beq r2,r3,1e0c <_malloc_r+0x6a8> - 1e24: 2109883a add r4,r4,r4 - 1e28: 393f1e36 bltu r7,r4,1aa4 <_malloc_r+0x340> - 1e2c: 203f1d26 beq r4,zero,1aa4 <_malloc_r+0x340> - 1e30: 21c4703a and r2,r4,r7 - 1e34: 10000226 beq r2,zero,1e40 <_malloc_r+0x6dc> - 1e38: 6013883a mov r9,r12 - 1e3c: 003ee106 br 19c4 <_malloc_r+0x260> - 1e40: 2109883a add r4,r4,r4 - 1e44: 3904703a and r2,r7,r4 - 1e48: 63000104 addi r12,r12,4 - 1e4c: 103ffc26 beq r2,zero,1e40 <_malloc_r+0x6dc> - 1e50: 6013883a mov r9,r12 - 1e54: 003edb06 br 19c4 <_malloc_r+0x260> - 1e58: 00805504 movi r2,340 - 1e5c: 11000836 bltu r2,r4,1e80 <_malloc_r+0x71c> - 1e60: 2804d3fa srli r2,r5,15 - 1e64: 11001dc4 addi r4,r2,119 - 1e68: 200690fa slli r3,r4,3 - 1e6c: 003f7306 br 1c3c <_malloc_r+0x4d8> - 1e70: 0104303a nor r2,zero,r4 - 1e74: 388e703a and r7,r7,r2 - 1e78: e1c00115 stw r7,4(fp) - 1e7c: 003fe906 br 1e24 <_malloc_r+0x6c0> - 1e80: 00815504 movi r2,1364 - 1e84: 1100032e bgeu r2,r4,1e94 <_malloc_r+0x730> - 1e88: 01001f84 movi r4,126 - 1e8c: 00c0fc04 movi r3,1008 - 1e90: 003f6a06 br 1c3c <_malloc_r+0x4d8> - 1e94: 2804d4ba srli r2,r5,18 - 1e98: 11001f04 addi r4,r2,124 - 1e9c: 200690fa slli r3,r4,3 - 1ea0: 003f6606 br 1c3c <_malloc_r+0x4d8> - -00001ea4 : - 1ea4: 008000c4 movi r2,3 - 1ea8: 29403fcc andi r5,r5,255 - 1eac: 2007883a mov r3,r4 - 1eb0: 1180022e bgeu r2,r6,1ebc - 1eb4: 2084703a and r2,r4,r2 - 1eb8: 10000826 beq r2,zero,1edc - 1ebc: 30000526 beq r6,zero,1ed4 - 1ec0: 2805883a mov r2,r5 - 1ec4: 30cd883a add r6,r6,r3 - 1ec8: 18800005 stb r2,0(r3) - 1ecc: 18c00044 addi r3,r3,1 - 1ed0: 19bffd1e bne r3,r6,1ec8 - 1ed4: 2005883a mov r2,r4 - 1ed8: f800283a ret - 1edc: 2804923a slli r2,r5,8 - 1ee0: 020003c4 movi r8,15 - 1ee4: 200f883a mov r7,r4 - 1ee8: 2884b03a or r2,r5,r2 - 1eec: 1006943a slli r3,r2,16 - 1ef0: 10c6b03a or r3,r2,r3 - 1ef4: 41800a2e bgeu r8,r6,1f20 - 1ef8: 4005883a mov r2,r8 - 1efc: 31bffc04 addi r6,r6,-16 - 1f00: 38c00015 stw r3,0(r7) - 1f04: 38c00115 stw r3,4(r7) - 1f08: 38c00215 stw r3,8(r7) - 1f0c: 38c00315 stw r3,12(r7) - 1f10: 39c00404 addi r7,r7,16 - 1f14: 11bff936 bltu r2,r6,1efc - 1f18: 008000c4 movi r2,3 - 1f1c: 1180052e bgeu r2,r6,1f34 - 1f20: 31bfff04 addi r6,r6,-4 - 1f24: 008000c4 movi r2,3 - 1f28: 38c00015 stw r3,0(r7) - 1f2c: 39c00104 addi r7,r7,4 - 1f30: 11bffb36 bltu r2,r6,1f20 - 1f34: 3807883a mov r3,r7 - 1f38: 003fe006 br 1ebc - -00001f3c <_open_r>: - 1f3c: defffd04 addi sp,sp,-12 - 1f40: dc000015 stw r16,0(sp) - 1f44: 04000074 movhi r16,1 - 1f48: 8407a504 addi r16,r16,7828 - 1f4c: dc400115 stw r17,4(sp) - 1f50: 80000015 stw zero,0(r16) - 1f54: 2023883a mov r17,r4 - 1f58: 2809883a mov r4,r5 - 1f5c: 300b883a mov r5,r6 - 1f60: 380d883a mov r6,r7 - 1f64: dfc00215 stw ra,8(sp) - 1f68: 000ae840 call ae84 - 1f6c: 1007883a mov r3,r2 - 1f70: 00bfffc4 movi r2,-1 - 1f74: 18800626 beq r3,r2,1f90 <_open_r+0x54> - 1f78: 1805883a mov r2,r3 - 1f7c: dfc00217 ldw ra,8(sp) - 1f80: dc400117 ldw r17,4(sp) - 1f84: dc000017 ldw r16,0(sp) - 1f88: dec00304 addi sp,sp,12 - 1f8c: f800283a ret - 1f90: 80800017 ldw r2,0(r16) - 1f94: 103ff826 beq r2,zero,1f78 <_open_r+0x3c> - 1f98: 88800015 stw r2,0(r17) - 1f9c: 1805883a mov r2,r3 - 1fa0: dfc00217 ldw ra,8(sp) - 1fa4: dc400117 ldw r17,4(sp) - 1fa8: dc000017 ldw r16,0(sp) - 1fac: dec00304 addi sp,sp,12 - 1fb0: f800283a ret - -00001fb4 : - 1fb4: defffb04 addi sp,sp,-20 - 1fb8: dfc00115 stw ra,4(sp) - 1fbc: d9400215 stw r5,8(sp) - 1fc0: d9800315 stw r6,12(sp) - 1fc4: d9c00415 stw r7,16(sp) - 1fc8: 00800074 movhi r2,1 - 1fcc: 1080b204 addi r2,r2,712 - 1fd0: 10c00017 ldw r3,0(r2) - 1fd4: 200b883a mov r5,r4 - 1fd8: d8800204 addi r2,sp,8 - 1fdc: 19000217 ldw r4,8(r3) - 1fe0: 100d883a mov r6,r2 - 1fe4: d8800015 stw r2,0(sp) - 1fe8: 000440c0 call 440c <__vfprintf_internal> - 1fec: dfc00117 ldw ra,4(sp) - 1ff0: dec00504 addi sp,sp,20 - 1ff4: f800283a ret - -00001ff8 <_printf_r>: - 1ff8: defffc04 addi sp,sp,-16 - 1ffc: dfc00115 stw ra,4(sp) - 2000: d9800215 stw r6,8(sp) - 2004: d9c00315 stw r7,12(sp) - 2008: 280d883a mov r6,r5 - 200c: 21400217 ldw r5,8(r4) - 2010: d8c00204 addi r3,sp,8 - 2014: 180f883a mov r7,r3 - 2018: d8c00015 stw r3,0(sp) - 201c: 00025480 call 2548 <___vfprintf_internal_r> - 2020: dfc00117 ldw ra,4(sp) - 2024: dec00404 addi sp,sp,16 - 2028: f800283a ret - -0000202c <_puts_r>: - 202c: defff604 addi sp,sp,-40 - 2030: dc400715 stw r17,28(sp) - 2034: 2023883a mov r17,r4 - 2038: 2809883a mov r4,r5 - 203c: dfc00915 stw ra,36(sp) - 2040: dcc00815 stw r19,32(sp) - 2044: 2827883a mov r19,r5 - 2048: 000247c0 call 247c - 204c: 89400217 ldw r5,8(r17) - 2050: 00c00074 movhi r3,1 - 2054: 18f86f04 addi r3,r3,-7748 - 2058: 01c00044 movi r7,1 - 205c: 12000044 addi r8,r2,1 - 2060: d8c00515 stw r3,20(sp) - 2064: d9c00615 stw r7,24(sp) - 2068: d8c00304 addi r3,sp,12 - 206c: 01c00084 movi r7,2 - 2070: 8809883a mov r4,r17 - 2074: d80d883a mov r6,sp - 2078: d8c00015 stw r3,0(sp) - 207c: dcc00315 stw r19,12(sp) - 2080: da000215 stw r8,8(sp) - 2084: d9c00115 stw r7,4(sp) - 2088: d8800415 stw r2,16(sp) - 208c: 0005eec0 call 5eec <__sfvwrite_r> - 2090: 00ffffc4 movi r3,-1 - 2094: 10000626 beq r2,zero,20b0 <_puts_r+0x84> - 2098: 1805883a mov r2,r3 - 209c: dfc00917 ldw ra,36(sp) - 20a0: dcc00817 ldw r19,32(sp) - 20a4: dc400717 ldw r17,28(sp) - 20a8: dec00a04 addi sp,sp,40 - 20ac: f800283a ret - 20b0: 00c00284 movi r3,10 - 20b4: 1805883a mov r2,r3 - 20b8: dfc00917 ldw ra,36(sp) - 20bc: dcc00817 ldw r19,32(sp) - 20c0: dc400717 ldw r17,28(sp) - 20c4: dec00a04 addi sp,sp,40 - 20c8: f800283a ret - -000020cc : - 20cc: 00800074 movhi r2,1 - 20d0: 1080b204 addi r2,r2,712 - 20d4: 200b883a mov r5,r4 - 20d8: 11000017 ldw r4,0(r2) - 20dc: 000202c1 jmpi 202c <_puts_r> - -000020e0 <__srefill_r>: - 20e0: defffd04 addi sp,sp,-12 - 20e4: dc400115 stw r17,4(sp) - 20e8: dc000015 stw r16,0(sp) - 20ec: dfc00215 stw ra,8(sp) - 20f0: 2023883a mov r17,r4 - 20f4: 2821883a mov r16,r5 - 20f8: 20000226 beq r4,zero,2104 <__srefill_r+0x24> - 20fc: 20800e17 ldw r2,56(r4) - 2100: 10004126 beq r2,zero,2208 <__srefill_r+0x128> - 2104: 80c0030b ldhu r3,12(r16) - 2108: 80000115 stw zero,4(r16) - 210c: 1880080c andi r2,r3,32 - 2110: 1000361e bne r2,zero,21ec <__srefill_r+0x10c> - 2114: 1880010c andi r2,r3,4 - 2118: 1000211e bne r2,zero,21a0 <__srefill_r+0xc0> - 211c: 1880040c andi r2,r3,16 - 2120: 10005026 beq r2,zero,2264 <__srefill_r+0x184> - 2124: 1880020c andi r2,r3,8 - 2128: 1000541e bne r2,zero,227c <__srefill_r+0x19c> - 212c: 8080030b ldhu r2,12(r16) - 2130: 10800114 ori r2,r2,4 - 2134: 8080030d sth r2,12(r16) - 2138: 80800417 ldw r2,16(r16) - 213c: 10004526 beq r2,zero,2254 <__srefill_r+0x174> - 2140: 8080030b ldhu r2,12(r16) - 2144: 108000cc andi r2,r2,3 - 2148: 1000361e bne r2,zero,2224 <__srefill_r+0x144> - 214c: 81800417 ldw r6,16(r16) - 2150: 80c00817 ldw r3,32(r16) - 2154: 81400717 ldw r5,28(r16) - 2158: 81c00517 ldw r7,20(r16) - 215c: 8809883a mov r4,r17 - 2160: 81800015 stw r6,0(r16) - 2164: 183ee83a callr r3 - 2168: 80c0030b ldhu r3,12(r16) - 216c: 1009883a mov r4,r2 - 2170: 80800115 stw r2,4(r16) - 2174: 00b7ffc4 movi r2,-8193 - 2178: 1884703a and r2,r3,r2 - 217c: 8080030d sth r2,12(r16) - 2180: 0100230e bge zero,r4,2210 <__srefill_r+0x130> - 2184: 0009883a mov r4,zero - 2188: 2005883a mov r2,r4 - 218c: dfc00217 ldw ra,8(sp) - 2190: dc400117 ldw r17,4(sp) - 2194: dc000017 ldw r16,0(sp) - 2198: dec00304 addi sp,sp,12 - 219c: f800283a ret - 21a0: 81400c17 ldw r5,48(r16) - 21a4: 283fe426 beq r5,zero,2138 <__srefill_r+0x58> - 21a8: 80801004 addi r2,r16,64 - 21ac: 28800226 beq r5,r2,21b8 <__srefill_r+0xd8> - 21b0: 8809883a mov r4,r17 - 21b4: 0000b7c0 call b7c <_free_r> - 21b8: 80800f17 ldw r2,60(r16) - 21bc: 80000c15 stw zero,48(r16) - 21c0: 80800115 stw r2,4(r16) - 21c4: 103fdc26 beq r2,zero,2138 <__srefill_r+0x58> - 21c8: 80800e17 ldw r2,56(r16) - 21cc: 0009883a mov r4,zero - 21d0: 80800015 stw r2,0(r16) - 21d4: 2005883a mov r2,r4 - 21d8: dfc00217 ldw ra,8(sp) - 21dc: dc400117 ldw r17,4(sp) - 21e0: dc000017 ldw r16,0(sp) - 21e4: dec00304 addi sp,sp,12 - 21e8: f800283a ret - 21ec: 013fffc4 movi r4,-1 - 21f0: 2005883a mov r2,r4 - 21f4: dfc00217 ldw ra,8(sp) - 21f8: dc400117 ldw r17,4(sp) - 21fc: dc000017 ldw r16,0(sp) - 2200: dec00304 addi sp,sp,12 - 2204: f800283a ret - 2208: 00006b40 call 6b4 <__sinit> - 220c: 003fbd06 br 2104 <__srefill_r+0x24> - 2210: 20000b1e bne r4,zero,2240 <__srefill_r+0x160> - 2214: 10800814 ori r2,r2,32 - 2218: 013fffc4 movi r4,-1 - 221c: 8080030d sth r2,12(r16) - 2220: 003fd906 br 2188 <__srefill_r+0xa8> - 2224: 00800074 movhi r2,1 - 2228: 1080b304 addi r2,r2,716 - 222c: 11000017 ldw r4,0(r2) - 2230: 01400034 movhi r5,0 - 2234: 2948a904 addi r5,r5,8868 - 2238: 000142c0 call 142c <_fwalk> - 223c: 003fc306 br 214c <__srefill_r+0x6c> - 2240: 10801014 ori r2,r2,64 - 2244: 013fffc4 movi r4,-1 - 2248: 8080030d sth r2,12(r16) - 224c: 80000115 stw zero,4(r16) - 2250: 003fcd06 br 2188 <__srefill_r+0xa8> - 2254: 8809883a mov r4,r17 - 2258: 800b883a mov r5,r16 - 225c: 00015d00 call 15d0 <__smakebuf_r> - 2260: 003fb706 br 2140 <__srefill_r+0x60> - 2264: 18c01014 ori r3,r3,64 - 2268: 00800244 movi r2,9 - 226c: 013fffc4 movi r4,-1 - 2270: 88800015 stw r2,0(r17) - 2274: 80c0030d sth r3,12(r16) - 2278: 003fc306 br 2188 <__srefill_r+0xa8> - 227c: 8809883a mov r4,r17 - 2280: 800b883a mov r5,r16 - 2284: 000041c0 call 41c <_fflush_r> - 2288: 103fd81e bne r2,zero,21ec <__srefill_r+0x10c> - 228c: 8080030b ldhu r2,12(r16) - 2290: 80000215 stw zero,8(r16) - 2294: 80000615 stw zero,24(r16) - 2298: 10bffdcc andi r2,r2,65527 - 229c: 8080030d sth r2,12(r16) - 22a0: 003fa206 br 212c <__srefill_r+0x4c> - -000022a4 : - 22a4: 20c0030b ldhu r3,12(r4) - 22a8: 01400244 movi r5,9 - 22ac: 0005883a mov r2,zero - 22b0: 18c0024c andi r3,r3,9 - 22b4: 19400126 beq r3,r5,22bc - 22b8: f800283a ret - 22bc: 00006181 jmpi 618 - -000022c0 <_sbrk_r>: - 22c0: defffd04 addi sp,sp,-12 - 22c4: dc000015 stw r16,0(sp) - 22c8: 04000074 movhi r16,1 - 22cc: 8407a504 addi r16,r16,7828 - 22d0: dc400115 stw r17,4(sp) - 22d4: 80000015 stw zero,0(r16) - 22d8: 2023883a mov r17,r4 - 22dc: 2809883a mov r4,r5 - 22e0: dfc00215 stw ra,8(sp) - 22e4: 000b26c0 call b26c - 22e8: 1007883a mov r3,r2 - 22ec: 00bfffc4 movi r2,-1 - 22f0: 18800626 beq r3,r2,230c <_sbrk_r+0x4c> - 22f4: 1805883a mov r2,r3 - 22f8: dfc00217 ldw ra,8(sp) - 22fc: dc400117 ldw r17,4(sp) - 2300: dc000017 ldw r16,0(sp) - 2304: dec00304 addi sp,sp,12 - 2308: f800283a ret - 230c: 80800017 ldw r2,0(r16) - 2310: 103ff826 beq r2,zero,22f4 <_sbrk_r+0x34> - 2314: 88800015 stw r2,0(r17) - 2318: 1805883a mov r2,r3 - 231c: dfc00217 ldw ra,8(sp) - 2320: dc400117 ldw r17,4(sp) - 2324: dc000017 ldw r16,0(sp) - 2328: dec00304 addi sp,sp,12 - 232c: f800283a ret - -00002330 <__sclose>: - 2330: 2940038f ldh r5,14(r5) - 2334: 00045e41 jmpi 45e4 <_close_r> - -00002338 <__sseek>: - 2338: defffe04 addi sp,sp,-8 - 233c: dc000015 stw r16,0(sp) - 2340: 2821883a mov r16,r5 - 2344: 2940038f ldh r5,14(r5) - 2348: dfc00115 stw ra,4(sp) - 234c: 00064bc0 call 64bc <_lseek_r> - 2350: 1007883a mov r3,r2 - 2354: 00bfffc4 movi r2,-1 - 2358: 18800926 beq r3,r2,2380 <__sseek+0x48> - 235c: 8080030b ldhu r2,12(r16) - 2360: 80c01415 stw r3,80(r16) - 2364: 10840014 ori r2,r2,4096 - 2368: 8080030d sth r2,12(r16) - 236c: 1805883a mov r2,r3 - 2370: dfc00117 ldw ra,4(sp) - 2374: dc000017 ldw r16,0(sp) - 2378: dec00204 addi sp,sp,8 - 237c: f800283a ret - 2380: 8080030b ldhu r2,12(r16) - 2384: 10bbffcc andi r2,r2,61439 - 2388: 8080030d sth r2,12(r16) - 238c: 1805883a mov r2,r3 - 2390: dfc00117 ldw ra,4(sp) - 2394: dc000017 ldw r16,0(sp) - 2398: dec00204 addi sp,sp,8 - 239c: f800283a ret - -000023a0 <__swrite>: - 23a0: 2880030b ldhu r2,12(r5) - 23a4: defffb04 addi sp,sp,-20 - 23a8: dcc00315 stw r19,12(sp) - 23ac: 1080400c andi r2,r2,256 - 23b0: dc800215 stw r18,8(sp) - 23b4: dc400115 stw r17,4(sp) - 23b8: dc000015 stw r16,0(sp) - 23bc: 3027883a mov r19,r6 - 23c0: 3825883a mov r18,r7 - 23c4: dfc00415 stw ra,16(sp) - 23c8: 2821883a mov r16,r5 - 23cc: 000d883a mov r6,zero - 23d0: 01c00084 movi r7,2 - 23d4: 2023883a mov r17,r4 - 23d8: 10000226 beq r2,zero,23e4 <__swrite+0x44> - 23dc: 2940038f ldh r5,14(r5) - 23e0: 00064bc0 call 64bc <_lseek_r> - 23e4: 8080030b ldhu r2,12(r16) - 23e8: 8140038f ldh r5,14(r16) - 23ec: 8809883a mov r4,r17 - 23f0: 10bbffcc andi r2,r2,61439 - 23f4: 980d883a mov r6,r19 - 23f8: 900f883a mov r7,r18 - 23fc: 8080030d sth r2,12(r16) - 2400: dfc00417 ldw ra,16(sp) - 2404: dcc00317 ldw r19,12(sp) - 2408: dc800217 ldw r18,8(sp) - 240c: dc400117 ldw r17,4(sp) - 2410: dc000017 ldw r16,0(sp) - 2414: dec00504 addi sp,sp,20 - 2418: 00044301 jmpi 4430 <_write_r> - -0000241c <__sread>: - 241c: defffe04 addi sp,sp,-8 - 2420: dc000015 stw r16,0(sp) - 2424: 2821883a mov r16,r5 - 2428: 2940038f ldh r5,14(r5) - 242c: dfc00115 stw ra,4(sp) - 2430: 00078240 call 7824 <_read_r> - 2434: 1007883a mov r3,r2 - 2438: 10000816 blt r2,zero,245c <__sread+0x40> - 243c: 80801417 ldw r2,80(r16) - 2440: 10c5883a add r2,r2,r3 - 2444: 80801415 stw r2,80(r16) - 2448: 1805883a mov r2,r3 - 244c: dfc00117 ldw ra,4(sp) - 2450: dc000017 ldw r16,0(sp) - 2454: dec00204 addi sp,sp,8 - 2458: f800283a ret - 245c: 8080030b ldhu r2,12(r16) - 2460: 10bbffcc andi r2,r2,61439 - 2464: 8080030d sth r2,12(r16) - 2468: 1805883a mov r2,r3 - 246c: dfc00117 ldw ra,4(sp) - 2470: dc000017 ldw r16,0(sp) - 2474: dec00204 addi sp,sp,8 - 2478: f800283a ret - -0000247c : - 247c: 208000cc andi r2,r4,3 - 2480: 2011883a mov r8,r4 - 2484: 1000161e bne r2,zero,24e0 - 2488: 20c00017 ldw r3,0(r4) - 248c: 017fbff4 movhi r5,65279 - 2490: 297fbfc4 addi r5,r5,-257 - 2494: 01e02074 movhi r7,32897 - 2498: 39e02004 addi r7,r7,-32640 - 249c: 1945883a add r2,r3,r5 - 24a0: 11c4703a and r2,r2,r7 - 24a4: 00c6303a nor r3,zero,r3 - 24a8: 1886703a and r3,r3,r2 - 24ac: 18000c1e bne r3,zero,24e0 - 24b0: 280d883a mov r6,r5 - 24b4: 380b883a mov r5,r7 - 24b8: 21000104 addi r4,r4,4 - 24bc: 20800017 ldw r2,0(r4) - 24c0: 1187883a add r3,r2,r6 - 24c4: 1946703a and r3,r3,r5 - 24c8: 0084303a nor r2,zero,r2 - 24cc: 10c4703a and r2,r2,r3 - 24d0: 103ff926 beq r2,zero,24b8 - 24d4: 20800007 ldb r2,0(r4) - 24d8: 10000326 beq r2,zero,24e8 - 24dc: 21000044 addi r4,r4,1 - 24e0: 20800007 ldb r2,0(r4) - 24e4: 103ffd1e bne r2,zero,24dc - 24e8: 2205c83a sub r2,r4,r8 - 24ec: f800283a ret - -000024f0 <__sprint_r>: - 24f0: 30800217 ldw r2,8(r6) - 24f4: defffe04 addi sp,sp,-8 - 24f8: dc000015 stw r16,0(sp) - 24fc: dfc00115 stw ra,4(sp) - 2500: 3021883a mov r16,r6 - 2504: 0007883a mov r3,zero - 2508: 1000061e bne r2,zero,2524 <__sprint_r+0x34> - 250c: 1805883a mov r2,r3 - 2510: 30000115 stw zero,4(r6) - 2514: dfc00117 ldw ra,4(sp) - 2518: dc000017 ldw r16,0(sp) - 251c: dec00204 addi sp,sp,8 - 2520: f800283a ret - 2524: 0005eec0 call 5eec <__sfvwrite_r> - 2528: 1007883a mov r3,r2 - 252c: 1805883a mov r2,r3 - 2530: 80000115 stw zero,4(r16) - 2534: 80000215 stw zero,8(r16) - 2538: dfc00117 ldw ra,4(sp) - 253c: dc000017 ldw r16,0(sp) - 2540: dec00204 addi sp,sp,8 - 2544: f800283a ret - -00002548 <___vfprintf_internal_r>: - 2548: defea404 addi sp,sp,-1392 - 254c: dd815815 stw r22,1376(sp) - 2550: dc015215 stw r16,1352(sp) - 2554: d9c15115 stw r7,1348(sp) - 2558: dfc15b15 stw ra,1388(sp) - 255c: df015a15 stw fp,1384(sp) - 2560: ddc15915 stw r23,1380(sp) - 2564: dd415715 stw r21,1372(sp) - 2568: dd015615 stw r20,1368(sp) - 256c: dcc15515 stw r19,1364(sp) - 2570: dc815415 stw r18,1360(sp) - 2574: dc415315 stw r17,1356(sp) - 2578: 282d883a mov r22,r5 - 257c: 3021883a mov r16,r6 - 2580: d9014f15 stw r4,1340(sp) - 2584: 00064000 call 6400 <_localeconv_r> - 2588: 10800017 ldw r2,0(r2) - 258c: d9c15117 ldw r7,1348(sp) - 2590: d8814915 stw r2,1316(sp) - 2594: d8814f17 ldw r2,1340(sp) - 2598: 10000226 beq r2,zero,25a4 <___vfprintf_internal_r+0x5c> - 259c: 10800e17 ldw r2,56(r2) - 25a0: 10020d26 beq r2,zero,2dd8 <___vfprintf_internal_r+0x890> - 25a4: b080030b ldhu r2,12(r22) - 25a8: 1080020c andi r2,r2,8 - 25ac: 10020e26 beq r2,zero,2de8 <___vfprintf_internal_r+0x8a0> - 25b0: b0800417 ldw r2,16(r22) - 25b4: 10020c26 beq r2,zero,2de8 <___vfprintf_internal_r+0x8a0> - 25b8: b200030b ldhu r8,12(r22) - 25bc: 00800284 movi r2,10 - 25c0: 40c0068c andi r3,r8,26 - 25c4: 18802f1e bne r3,r2,2684 <___vfprintf_internal_r+0x13c> - 25c8: b080038f ldh r2,14(r22) - 25cc: 10002d16 blt r2,zero,2684 <___vfprintf_internal_r+0x13c> - 25d0: b240038b ldhu r9,14(r22) - 25d4: b2800717 ldw r10,28(r22) - 25d8: b2c00917 ldw r11,36(r22) - 25dc: d9014f17 ldw r4,1340(sp) - 25e0: dc402904 addi r17,sp,164 - 25e4: d8804004 addi r2,sp,256 - 25e8: 00c10004 movi r3,1024 - 25ec: 423fff4c andi r8,r8,65533 - 25f0: 800d883a mov r6,r16 - 25f4: 880b883a mov r5,r17 - 25f8: da002c0d sth r8,176(sp) - 25fc: da402c8d sth r9,178(sp) - 2600: da803015 stw r10,192(sp) - 2604: dac03215 stw r11,200(sp) - 2608: d8802d15 stw r2,180(sp) - 260c: d8c02e15 stw r3,184(sp) - 2610: d8802915 stw r2,164(sp) - 2614: d8c02b15 stw r3,172(sp) - 2618: d8002f15 stw zero,188(sp) - 261c: 00025480 call 2548 <___vfprintf_internal_r> - 2620: d8814b15 stw r2,1324(sp) - 2624: 10000416 blt r2,zero,2638 <___vfprintf_internal_r+0xf0> - 2628: d9014f17 ldw r4,1340(sp) - 262c: 880b883a mov r5,r17 - 2630: 000041c0 call 41c <_fflush_r> - 2634: 1002321e bne r2,zero,2f00 <___vfprintf_internal_r+0x9b8> - 2638: d8802c0b ldhu r2,176(sp) - 263c: 1080100c andi r2,r2,64 - 2640: 10000326 beq r2,zero,2650 <___vfprintf_internal_r+0x108> - 2644: b080030b ldhu r2,12(r22) - 2648: 10801014 ori r2,r2,64 - 264c: b080030d sth r2,12(r22) - 2650: d8814b17 ldw r2,1324(sp) - 2654: dfc15b17 ldw ra,1388(sp) - 2658: df015a17 ldw fp,1384(sp) - 265c: ddc15917 ldw r23,1380(sp) - 2660: dd815817 ldw r22,1376(sp) - 2664: dd415717 ldw r21,1372(sp) - 2668: dd015617 ldw r20,1368(sp) - 266c: dcc15517 ldw r19,1364(sp) - 2670: dc815417 ldw r18,1360(sp) - 2674: dc415317 ldw r17,1356(sp) - 2678: dc015217 ldw r16,1352(sp) - 267c: dec15c04 addi sp,sp,1392 - 2680: f800283a ret - 2684: 0005883a mov r2,zero - 2688: 0007883a mov r3,zero - 268c: dd401904 addi r21,sp,100 - 2690: d8814215 stw r2,1288(sp) - 2694: 802f883a mov r23,r16 - 2698: d8c14315 stw r3,1292(sp) - 269c: d8014b15 stw zero,1324(sp) - 26a0: d8014815 stw zero,1312(sp) - 26a4: d8014415 stw zero,1296(sp) - 26a8: d8014715 stw zero,1308(sp) - 26ac: dd400c15 stw r21,48(sp) - 26b0: d8000e15 stw zero,56(sp) - 26b4: d8000d15 stw zero,52(sp) - 26b8: b8800007 ldb r2,0(r23) - 26bc: 10001926 beq r2,zero,2724 <___vfprintf_internal_r+0x1dc> - 26c0: 00c00944 movi r3,37 - 26c4: 10c01726 beq r2,r3,2724 <___vfprintf_internal_r+0x1dc> - 26c8: b821883a mov r16,r23 - 26cc: 00000106 br 26d4 <___vfprintf_internal_r+0x18c> - 26d0: 10c00326 beq r2,r3,26e0 <___vfprintf_internal_r+0x198> - 26d4: 84000044 addi r16,r16,1 - 26d8: 80800007 ldb r2,0(r16) - 26dc: 103ffc1e bne r2,zero,26d0 <___vfprintf_internal_r+0x188> - 26e0: 85e7c83a sub r19,r16,r23 - 26e4: 98000e26 beq r19,zero,2720 <___vfprintf_internal_r+0x1d8> - 26e8: dc800e17 ldw r18,56(sp) - 26ec: dc400d17 ldw r17,52(sp) - 26f0: 008001c4 movi r2,7 - 26f4: 94e5883a add r18,r18,r19 - 26f8: 8c400044 addi r17,r17,1 - 26fc: adc00015 stw r23,0(r21) - 2700: dc800e15 stw r18,56(sp) - 2704: acc00115 stw r19,4(r21) - 2708: dc400d15 stw r17,52(sp) - 270c: 14428b16 blt r2,r17,313c <___vfprintf_internal_r+0xbf4> - 2710: ad400204 addi r21,r21,8 - 2714: d9014b17 ldw r4,1324(sp) - 2718: 24c9883a add r4,r4,r19 - 271c: d9014b15 stw r4,1324(sp) - 2720: 802f883a mov r23,r16 - 2724: b8800007 ldb r2,0(r23) - 2728: 10013c26 beq r2,zero,2c1c <___vfprintf_internal_r+0x6d4> - 272c: bdc00044 addi r23,r23,1 - 2730: d8000405 stb zero,16(sp) - 2734: b8c00007 ldb r3,0(r23) - 2738: 04ffffc4 movi r19,-1 - 273c: d8014c15 stw zero,1328(sp) - 2740: d8014a15 stw zero,1320(sp) - 2744: d8c14d15 stw r3,1332(sp) - 2748: bdc00044 addi r23,r23,1 - 274c: d9414d17 ldw r5,1332(sp) - 2750: 00801604 movi r2,88 - 2754: 28fff804 addi r3,r5,-32 - 2758: 10c06036 bltu r2,r3,28dc <___vfprintf_internal_r+0x394> - 275c: 18c5883a add r2,r3,r3 - 2760: 1085883a add r2,r2,r2 - 2764: 00c00034 movhi r3,0 - 2768: 18c9de04 addi r3,r3,10104 - 276c: 10c5883a add r2,r2,r3 - 2770: 11000017 ldw r4,0(r2) - 2774: 2000683a jmp r4 - 2778: 000036ec andhi zero,zero,219 - 277c: 000028dc xori zero,zero,163 - 2780: 000028dc xori zero,zero,163 - 2784: 000036d8 cmpnei zero,zero,219 - 2788: 000028dc xori zero,zero,163 - 278c: 000028dc xori zero,zero,163 - 2790: 000028dc xori zero,zero,163 - 2794: 000028dc xori zero,zero,163 - 2798: 000028dc xori zero,zero,163 - 279c: 000028dc xori zero,zero,163 - 27a0: 000034b8 rdprs zero,zero,210 - 27a4: 000036c8 cmpgei zero,zero,219 - 27a8: 000028dc xori zero,zero,163 - 27ac: 000034d0 cmplti zero,zero,211 - 27b0: 00003770 cmpltui zero,zero,221 - 27b4: 000028dc xori zero,zero,163 - 27b8: 0000375c xori zero,zero,221 - 27bc: 00003718 cmpnei zero,zero,220 - 27c0: 00003718 cmpnei zero,zero,220 - 27c4: 00003718 cmpnei zero,zero,220 - 27c8: 00003718 cmpnei zero,zero,220 - 27cc: 00003718 cmpnei zero,zero,220 - 27d0: 00003718 cmpnei zero,zero,220 - 27d4: 00003718 cmpnei zero,zero,220 - 27d8: 00003718 cmpnei zero,zero,220 - 27dc: 00003718 cmpnei zero,zero,220 - 27e0: 000028dc xori zero,zero,163 - 27e4: 000028dc xori zero,zero,163 - 27e8: 000028dc xori zero,zero,163 - 27ec: 000028dc xori zero,zero,163 - 27f0: 000028dc xori zero,zero,163 - 27f4: 000028dc xori zero,zero,163 - 27f8: 000028dc xori zero,zero,163 - 27fc: 000028dc xori zero,zero,163 - 2800: 000028dc xori zero,zero,163 - 2804: 000028dc xori zero,zero,163 - 2808: 00002f34 movhi zero,188 - 280c: 000035a0 cmpeqi zero,zero,214 - 2810: 000028dc xori zero,zero,163 - 2814: 000035a0 cmpeqi zero,zero,214 - 2818: 000028dc xori zero,zero,163 - 281c: 000028dc xori zero,zero,163 - 2820: 000028dc xori zero,zero,163 - 2824: 000028dc xori zero,zero,163 - 2828: 00003704 movi zero,220 - 282c: 000028dc xori zero,zero,163 - 2830: 000028dc xori zero,zero,163 - 2834: 00002fe8 cmpgeui zero,zero,191 - 2838: 000028dc xori zero,zero,163 - 283c: 000028dc xori zero,zero,163 - 2840: 000028dc xori zero,zero,163 - 2844: 000028dc xori zero,zero,163 - 2848: 000028dc xori zero,zero,163 - 284c: 00003034 movhi zero,192 - 2850: 000028dc xori zero,zero,163 - 2854: 000028dc xori zero,zero,163 - 2858: 00003654 movui zero,217 - 285c: 000028dc xori zero,zero,163 - 2860: 000028dc xori zero,zero,163 - 2864: 000028dc xori zero,zero,163 - 2868: 000028dc xori zero,zero,163 - 286c: 000028dc xori zero,zero,163 - 2870: 000028dc xori zero,zero,163 - 2874: 000028dc xori zero,zero,163 - 2878: 000028dc xori zero,zero,163 - 287c: 000028dc xori zero,zero,163 - 2880: 000028dc xori zero,zero,163 - 2884: 00003628 cmpgeui zero,zero,216 - 2888: 00002f40 call 2f4 - 288c: 000035a0 cmpeqi zero,zero,214 - 2890: 000035a0 cmpeqi zero,zero,214 - 2894: 000035a0 cmpeqi zero,zero,214 - 2898: 0000358c andi zero,zero,214 - 289c: 00002f40 call 2f4 - 28a0: 000028dc xori zero,zero,163 - 28a4: 000028dc xori zero,zero,163 - 28a8: 00003514 movui zero,212 - 28ac: 000028dc xori zero,zero,163 - 28b0: 000034e4 muli zero,zero,211 - 28b4: 00002ff4 movhi zero,191 - 28b8: 00003544 movi zero,213 - 28bc: 00003530 cmpltui zero,zero,212 - 28c0: 000028dc xori zero,zero,163 - 28c4: 000037d8 cmpnei zero,zero,223 - 28c8: 000028dc xori zero,zero,163 - 28cc: 00003040 call 304 <_fclose_r+0xc> - 28d0: 000028dc xori zero,zero,163 - 28d4: 000028dc xori zero,zero,163 - 28d8: 000036b8 rdprs zero,zero,218 - 28dc: d9014d17 ldw r4,1332(sp) - 28e0: 2000ce26 beq r4,zero,2c1c <___vfprintf_internal_r+0x6d4> - 28e4: 01400044 movi r5,1 - 28e8: d9800f04 addi r6,sp,60 - 28ec: d9c14015 stw r7,1280(sp) - 28f0: d9414515 stw r5,1300(sp) - 28f4: d9814115 stw r6,1284(sp) - 28f8: 280f883a mov r7,r5 - 28fc: d9000f05 stb r4,60(sp) - 2900: d8000405 stb zero,16(sp) - 2904: d8014615 stw zero,1304(sp) - 2908: d8c14c17 ldw r3,1328(sp) - 290c: 1880008c andi r2,r3,2 - 2910: 1005003a cmpeq r2,r2,zero - 2914: d8815015 stw r2,1344(sp) - 2918: 1000031e bne r2,zero,2928 <___vfprintf_internal_r+0x3e0> - 291c: d9014517 ldw r4,1300(sp) - 2920: 21000084 addi r4,r4,2 - 2924: d9014515 stw r4,1300(sp) - 2928: d9414c17 ldw r5,1328(sp) - 292c: 2940210c andi r5,r5,132 - 2930: d9414e15 stw r5,1336(sp) - 2934: 28002d1e bne r5,zero,29ec <___vfprintf_internal_r+0x4a4> - 2938: d9814a17 ldw r6,1320(sp) - 293c: d8814517 ldw r2,1300(sp) - 2940: 30a1c83a sub r16,r6,r2 - 2944: 0400290e bge zero,r16,29ec <___vfprintf_internal_r+0x4a4> - 2948: 00800404 movi r2,16 - 294c: 14045e0e bge r2,r16,3ac8 <___vfprintf_internal_r+0x1580> - 2950: dc800e17 ldw r18,56(sp) - 2954: dc400d17 ldw r17,52(sp) - 2958: 1027883a mov r19,r2 - 295c: 07000074 movhi fp,1 - 2960: e7388b84 addi fp,fp,-7634 - 2964: 050001c4 movi r20,7 - 2968: 00000306 br 2978 <___vfprintf_internal_r+0x430> - 296c: 843ffc04 addi r16,r16,-16 - 2970: ad400204 addi r21,r21,8 - 2974: 9c00130e bge r19,r16,29c4 <___vfprintf_internal_r+0x47c> - 2978: 94800404 addi r18,r18,16 - 297c: 8c400044 addi r17,r17,1 - 2980: af000015 stw fp,0(r21) - 2984: acc00115 stw r19,4(r21) - 2988: dc800e15 stw r18,56(sp) - 298c: dc400d15 stw r17,52(sp) - 2990: a47ff60e bge r20,r17,296c <___vfprintf_internal_r+0x424> - 2994: d9014f17 ldw r4,1340(sp) - 2998: b00b883a mov r5,r22 - 299c: d9800c04 addi r6,sp,48 - 29a0: d9c15115 stw r7,1348(sp) - 29a4: 00024f00 call 24f0 <__sprint_r> - 29a8: d9c15117 ldw r7,1348(sp) - 29ac: 10009e1e bne r2,zero,2c28 <___vfprintf_internal_r+0x6e0> - 29b0: 843ffc04 addi r16,r16,-16 - 29b4: dc800e17 ldw r18,56(sp) - 29b8: dc400d17 ldw r17,52(sp) - 29bc: dd401904 addi r21,sp,100 - 29c0: 9c3fed16 blt r19,r16,2978 <___vfprintf_internal_r+0x430> - 29c4: 9425883a add r18,r18,r16 - 29c8: 8c400044 addi r17,r17,1 - 29cc: 008001c4 movi r2,7 - 29d0: af000015 stw fp,0(r21) - 29d4: ac000115 stw r16,4(r21) - 29d8: dc800e15 stw r18,56(sp) - 29dc: dc400d15 stw r17,52(sp) - 29e0: 1441f516 blt r2,r17,31b8 <___vfprintf_internal_r+0xc70> - 29e4: ad400204 addi r21,r21,8 - 29e8: 00000206 br 29f4 <___vfprintf_internal_r+0x4ac> - 29ec: dc800e17 ldw r18,56(sp) - 29f0: dc400d17 ldw r17,52(sp) - 29f4: d8800407 ldb r2,16(sp) - 29f8: 10000b26 beq r2,zero,2a28 <___vfprintf_internal_r+0x4e0> - 29fc: 00800044 movi r2,1 - 2a00: 94800044 addi r18,r18,1 - 2a04: 8c400044 addi r17,r17,1 - 2a08: a8800115 stw r2,4(r21) - 2a0c: d8c00404 addi r3,sp,16 - 2a10: 008001c4 movi r2,7 - 2a14: a8c00015 stw r3,0(r21) - 2a18: dc800e15 stw r18,56(sp) - 2a1c: dc400d15 stw r17,52(sp) - 2a20: 1441da16 blt r2,r17,318c <___vfprintf_internal_r+0xc44> - 2a24: ad400204 addi r21,r21,8 - 2a28: d9015017 ldw r4,1344(sp) - 2a2c: 20000b1e bne r4,zero,2a5c <___vfprintf_internal_r+0x514> - 2a30: d8800444 addi r2,sp,17 - 2a34: 94800084 addi r18,r18,2 - 2a38: 8c400044 addi r17,r17,1 - 2a3c: a8800015 stw r2,0(r21) - 2a40: 00c00084 movi r3,2 - 2a44: 008001c4 movi r2,7 - 2a48: a8c00115 stw r3,4(r21) - 2a4c: dc800e15 stw r18,56(sp) - 2a50: dc400d15 stw r17,52(sp) - 2a54: 1441c216 blt r2,r17,3160 <___vfprintf_internal_r+0xc18> - 2a58: ad400204 addi r21,r21,8 - 2a5c: d9414e17 ldw r5,1336(sp) - 2a60: 00802004 movi r2,128 - 2a64: 2880b126 beq r5,r2,2d2c <___vfprintf_internal_r+0x7e4> - 2a68: d8c14617 ldw r3,1304(sp) - 2a6c: 19e1c83a sub r16,r3,r7 - 2a70: 0400260e bge zero,r16,2b0c <___vfprintf_internal_r+0x5c4> - 2a74: 00800404 movi r2,16 - 2a78: 1403cf0e bge r2,r16,39b8 <___vfprintf_internal_r+0x1470> - 2a7c: 1027883a mov r19,r2 - 2a80: 07000074 movhi fp,1 - 2a84: e7388784 addi fp,fp,-7650 - 2a88: 050001c4 movi r20,7 - 2a8c: 00000306 br 2a9c <___vfprintf_internal_r+0x554> - 2a90: 843ffc04 addi r16,r16,-16 - 2a94: ad400204 addi r21,r21,8 - 2a98: 9c00130e bge r19,r16,2ae8 <___vfprintf_internal_r+0x5a0> - 2a9c: 94800404 addi r18,r18,16 - 2aa0: 8c400044 addi r17,r17,1 - 2aa4: af000015 stw fp,0(r21) - 2aa8: acc00115 stw r19,4(r21) - 2aac: dc800e15 stw r18,56(sp) - 2ab0: dc400d15 stw r17,52(sp) - 2ab4: a47ff60e bge r20,r17,2a90 <___vfprintf_internal_r+0x548> - 2ab8: d9014f17 ldw r4,1340(sp) - 2abc: b00b883a mov r5,r22 - 2ac0: d9800c04 addi r6,sp,48 - 2ac4: d9c15115 stw r7,1348(sp) - 2ac8: 00024f00 call 24f0 <__sprint_r> - 2acc: d9c15117 ldw r7,1348(sp) - 2ad0: 1000551e bne r2,zero,2c28 <___vfprintf_internal_r+0x6e0> - 2ad4: 843ffc04 addi r16,r16,-16 - 2ad8: dc800e17 ldw r18,56(sp) - 2adc: dc400d17 ldw r17,52(sp) - 2ae0: dd401904 addi r21,sp,100 - 2ae4: 9c3fed16 blt r19,r16,2a9c <___vfprintf_internal_r+0x554> - 2ae8: 9425883a add r18,r18,r16 - 2aec: 8c400044 addi r17,r17,1 - 2af0: 008001c4 movi r2,7 - 2af4: af000015 stw fp,0(r21) - 2af8: ac000115 stw r16,4(r21) - 2afc: dc800e15 stw r18,56(sp) - 2b00: dc400d15 stw r17,52(sp) - 2b04: 14418216 blt r2,r17,3110 <___vfprintf_internal_r+0xbc8> - 2b08: ad400204 addi r21,r21,8 - 2b0c: d9014c17 ldw r4,1328(sp) - 2b10: 2080400c andi r2,r4,256 - 2b14: 10004a1e bne r2,zero,2c40 <___vfprintf_internal_r+0x6f8> - 2b18: d9414117 ldw r5,1284(sp) - 2b1c: 91e5883a add r18,r18,r7 - 2b20: 8c400044 addi r17,r17,1 - 2b24: 008001c4 movi r2,7 - 2b28: a9400015 stw r5,0(r21) - 2b2c: a9c00115 stw r7,4(r21) - 2b30: dc800e15 stw r18,56(sp) - 2b34: dc400d15 stw r17,52(sp) - 2b38: 14416716 blt r2,r17,30d8 <___vfprintf_internal_r+0xb90> - 2b3c: a8c00204 addi r3,r21,8 - 2b40: d9814c17 ldw r6,1328(sp) - 2b44: 3080010c andi r2,r6,4 - 2b48: 10002826 beq r2,zero,2bec <___vfprintf_internal_r+0x6a4> - 2b4c: d8814a17 ldw r2,1320(sp) - 2b50: d9014517 ldw r4,1300(sp) - 2b54: 1121c83a sub r16,r2,r4 - 2b58: 0400240e bge zero,r16,2bec <___vfprintf_internal_r+0x6a4> - 2b5c: 00800404 movi r2,16 - 2b60: 1404550e bge r2,r16,3cb8 <___vfprintf_internal_r+0x1770> - 2b64: dc400d17 ldw r17,52(sp) - 2b68: 1027883a mov r19,r2 - 2b6c: 07000074 movhi fp,1 - 2b70: e7388b84 addi fp,fp,-7634 - 2b74: 050001c4 movi r20,7 - 2b78: 00000306 br 2b88 <___vfprintf_internal_r+0x640> - 2b7c: 843ffc04 addi r16,r16,-16 - 2b80: 18c00204 addi r3,r3,8 - 2b84: 9c00110e bge r19,r16,2bcc <___vfprintf_internal_r+0x684> - 2b88: 94800404 addi r18,r18,16 - 2b8c: 8c400044 addi r17,r17,1 - 2b90: 1f000015 stw fp,0(r3) - 2b94: 1cc00115 stw r19,4(r3) - 2b98: dc800e15 stw r18,56(sp) - 2b9c: dc400d15 stw r17,52(sp) - 2ba0: a47ff60e bge r20,r17,2b7c <___vfprintf_internal_r+0x634> - 2ba4: d9014f17 ldw r4,1340(sp) - 2ba8: b00b883a mov r5,r22 - 2bac: d9800c04 addi r6,sp,48 - 2bb0: 00024f00 call 24f0 <__sprint_r> - 2bb4: 10001c1e bne r2,zero,2c28 <___vfprintf_internal_r+0x6e0> - 2bb8: 843ffc04 addi r16,r16,-16 - 2bbc: dc800e17 ldw r18,56(sp) - 2bc0: dc400d17 ldw r17,52(sp) - 2bc4: d8c01904 addi r3,sp,100 - 2bc8: 9c3fef16 blt r19,r16,2b88 <___vfprintf_internal_r+0x640> - 2bcc: 9425883a add r18,r18,r16 - 2bd0: 8c400044 addi r17,r17,1 - 2bd4: 008001c4 movi r2,7 - 2bd8: 1f000015 stw fp,0(r3) - 2bdc: 1c000115 stw r16,4(r3) - 2be0: dc800e15 stw r18,56(sp) - 2be4: dc400d15 stw r17,52(sp) - 2be8: 1440cb16 blt r2,r17,2f18 <___vfprintf_internal_r+0x9d0> - 2bec: d8814a17 ldw r2,1320(sp) - 2bf0: d9414517 ldw r5,1300(sp) - 2bf4: 1140010e bge r2,r5,2bfc <___vfprintf_internal_r+0x6b4> - 2bf8: 2805883a mov r2,r5 - 2bfc: d9814b17 ldw r6,1324(sp) - 2c00: 308d883a add r6,r6,r2 - 2c04: d9814b15 stw r6,1324(sp) - 2c08: 90013b1e bne r18,zero,30f8 <___vfprintf_internal_r+0xbb0> - 2c0c: d9c14017 ldw r7,1280(sp) - 2c10: dd401904 addi r21,sp,100 - 2c14: d8000d15 stw zero,52(sp) - 2c18: 003ea706 br 26b8 <___vfprintf_internal_r+0x170> - 2c1c: d8800e17 ldw r2,56(sp) - 2c20: 1005451e bne r2,zero,4138 <___vfprintf_internal_r+0x1bf0> - 2c24: d8000d15 stw zero,52(sp) - 2c28: b080030b ldhu r2,12(r22) - 2c2c: 1080100c andi r2,r2,64 - 2c30: 103e8726 beq r2,zero,2650 <___vfprintf_internal_r+0x108> - 2c34: 00bfffc4 movi r2,-1 - 2c38: d8814b15 stw r2,1324(sp) - 2c3c: 003e8406 br 2650 <___vfprintf_internal_r+0x108> - 2c40: d9814d17 ldw r6,1332(sp) - 2c44: 00801944 movi r2,101 - 2c48: 11806e16 blt r2,r6,2e04 <___vfprintf_internal_r+0x8bc> - 2c4c: d9414717 ldw r5,1308(sp) - 2c50: 00c00044 movi r3,1 - 2c54: 1943490e bge r3,r5,397c <___vfprintf_internal_r+0x1434> - 2c58: d8814117 ldw r2,1284(sp) - 2c5c: 94800044 addi r18,r18,1 - 2c60: 8c400044 addi r17,r17,1 - 2c64: a8800015 stw r2,0(r21) - 2c68: 008001c4 movi r2,7 - 2c6c: a8c00115 stw r3,4(r21) - 2c70: dc800e15 stw r18,56(sp) - 2c74: dc400d15 stw r17,52(sp) - 2c78: 1441ca16 blt r2,r17,33a4 <___vfprintf_internal_r+0xe5c> - 2c7c: a8c00204 addi r3,r21,8 - 2c80: d9014917 ldw r4,1316(sp) - 2c84: 00800044 movi r2,1 - 2c88: 94800044 addi r18,r18,1 - 2c8c: 8c400044 addi r17,r17,1 - 2c90: 18800115 stw r2,4(r3) - 2c94: 008001c4 movi r2,7 - 2c98: 19000015 stw r4,0(r3) - 2c9c: dc800e15 stw r18,56(sp) - 2ca0: dc400d15 stw r17,52(sp) - 2ca4: 1441b616 blt r2,r17,3380 <___vfprintf_internal_r+0xe38> - 2ca8: 1cc00204 addi r19,r3,8 - 2cac: d9014217 ldw r4,1288(sp) - 2cb0: d9414317 ldw r5,1292(sp) - 2cb4: 000d883a mov r6,zero - 2cb8: 000f883a mov r7,zero - 2cbc: 00098f80 call 98f8 <__nedf2> - 2cc0: 10017426 beq r2,zero,3294 <___vfprintf_internal_r+0xd4c> - 2cc4: d9414717 ldw r5,1308(sp) - 2cc8: d9814117 ldw r6,1284(sp) - 2ccc: 8c400044 addi r17,r17,1 - 2cd0: 2c85883a add r2,r5,r18 - 2cd4: 14bfffc4 addi r18,r2,-1 - 2cd8: 28bfffc4 addi r2,r5,-1 - 2cdc: 30c00044 addi r3,r6,1 - 2ce0: 98800115 stw r2,4(r19) - 2ce4: 008001c4 movi r2,7 - 2ce8: 98c00015 stw r3,0(r19) - 2cec: dc800e15 stw r18,56(sp) - 2cf0: dc400d15 stw r17,52(sp) - 2cf4: 14418e16 blt r2,r17,3330 <___vfprintf_internal_r+0xde8> - 2cf8: 9cc00204 addi r19,r19,8 - 2cfc: d9414817 ldw r5,1312(sp) - 2d00: d8800804 addi r2,sp,32 - 2d04: 8c400044 addi r17,r17,1 - 2d08: 9165883a add r18,r18,r5 - 2d0c: 98800015 stw r2,0(r19) - 2d10: 008001c4 movi r2,7 - 2d14: 99400115 stw r5,4(r19) - 2d18: dc800e15 stw r18,56(sp) - 2d1c: dc400d15 stw r17,52(sp) - 2d20: 1440ed16 blt r2,r17,30d8 <___vfprintf_internal_r+0xb90> - 2d24: 98c00204 addi r3,r19,8 - 2d28: 003f8506 br 2b40 <___vfprintf_internal_r+0x5f8> - 2d2c: d9814a17 ldw r6,1320(sp) - 2d30: d8814517 ldw r2,1300(sp) - 2d34: 30a1c83a sub r16,r6,r2 - 2d38: 043f4b0e bge zero,r16,2a68 <___vfprintf_internal_r+0x520> - 2d3c: 00800404 movi r2,16 - 2d40: 14043a0e bge r2,r16,3e2c <___vfprintf_internal_r+0x18e4> - 2d44: 1027883a mov r19,r2 - 2d48: 07000074 movhi fp,1 - 2d4c: e7388784 addi fp,fp,-7650 - 2d50: 050001c4 movi r20,7 - 2d54: 00000306 br 2d64 <___vfprintf_internal_r+0x81c> - 2d58: 843ffc04 addi r16,r16,-16 - 2d5c: ad400204 addi r21,r21,8 - 2d60: 9c00130e bge r19,r16,2db0 <___vfprintf_internal_r+0x868> - 2d64: 94800404 addi r18,r18,16 - 2d68: 8c400044 addi r17,r17,1 - 2d6c: af000015 stw fp,0(r21) - 2d70: acc00115 stw r19,4(r21) - 2d74: dc800e15 stw r18,56(sp) - 2d78: dc400d15 stw r17,52(sp) - 2d7c: a47ff60e bge r20,r17,2d58 <___vfprintf_internal_r+0x810> - 2d80: d9014f17 ldw r4,1340(sp) - 2d84: b00b883a mov r5,r22 - 2d88: d9800c04 addi r6,sp,48 - 2d8c: d9c15115 stw r7,1348(sp) - 2d90: 00024f00 call 24f0 <__sprint_r> - 2d94: d9c15117 ldw r7,1348(sp) - 2d98: 103fa31e bne r2,zero,2c28 <___vfprintf_internal_r+0x6e0> - 2d9c: 843ffc04 addi r16,r16,-16 - 2da0: dc800e17 ldw r18,56(sp) - 2da4: dc400d17 ldw r17,52(sp) - 2da8: dd401904 addi r21,sp,100 - 2dac: 9c3fed16 blt r19,r16,2d64 <___vfprintf_internal_r+0x81c> - 2db0: 9425883a add r18,r18,r16 - 2db4: 8c400044 addi r17,r17,1 - 2db8: 008001c4 movi r2,7 - 2dbc: af000015 stw fp,0(r21) - 2dc0: ac000115 stw r16,4(r21) - 2dc4: dc800e15 stw r18,56(sp) - 2dc8: dc400d15 stw r17,52(sp) - 2dcc: 14416116 blt r2,r17,3354 <___vfprintf_internal_r+0xe0c> - 2dd0: ad400204 addi r21,r21,8 - 2dd4: 003f2406 br 2a68 <___vfprintf_internal_r+0x520> - 2dd8: d9014f17 ldw r4,1340(sp) - 2ddc: 00006b40 call 6b4 <__sinit> - 2de0: d9c15117 ldw r7,1348(sp) - 2de4: 003def06 br 25a4 <___vfprintf_internal_r+0x5c> - 2de8: d9014f17 ldw r4,1340(sp) - 2dec: b00b883a mov r5,r22 - 2df0: d9c15115 stw r7,1348(sp) - 2df4: 00044a80 call 44a8 <__swsetup_r> - 2df8: d9c15117 ldw r7,1348(sp) - 2dfc: 103dee26 beq r2,zero,25b8 <___vfprintf_internal_r+0x70> - 2e00: 003f8c06 br 2c34 <___vfprintf_internal_r+0x6ec> - 2e04: d9014217 ldw r4,1288(sp) - 2e08: d9414317 ldw r5,1292(sp) - 2e0c: 000d883a mov r6,zero - 2e10: 000f883a mov r7,zero - 2e14: 00098700 call 9870 <__eqdf2> - 2e18: 1000f21e bne r2,zero,31e4 <___vfprintf_internal_r+0xc9c> - 2e1c: 00800074 movhi r2,1 - 2e20: 10b88704 addi r2,r2,-7652 - 2e24: 94800044 addi r18,r18,1 - 2e28: 8c400044 addi r17,r17,1 - 2e2c: a8800015 stw r2,0(r21) - 2e30: 00c00044 movi r3,1 - 2e34: 008001c4 movi r2,7 - 2e38: a8c00115 stw r3,4(r21) - 2e3c: dc800e15 stw r18,56(sp) - 2e40: dc400d15 stw r17,52(sp) - 2e44: 14430016 blt r2,r17,3a48 <___vfprintf_internal_r+0x1500> - 2e48: a8c00204 addi r3,r21,8 - 2e4c: d8800517 ldw r2,20(sp) - 2e50: d9014717 ldw r4,1308(sp) - 2e54: 11015c0e bge r2,r4,33c8 <___vfprintf_internal_r+0xe80> - 2e58: dc400d17 ldw r17,52(sp) - 2e5c: d9814917 ldw r6,1316(sp) - 2e60: 00800044 movi r2,1 - 2e64: 94800044 addi r18,r18,1 - 2e68: 8c400044 addi r17,r17,1 - 2e6c: 18800115 stw r2,4(r3) - 2e70: 008001c4 movi r2,7 - 2e74: 19800015 stw r6,0(r3) - 2e78: dc800e15 stw r18,56(sp) - 2e7c: dc400d15 stw r17,52(sp) - 2e80: 14431616 blt r2,r17,3adc <___vfprintf_internal_r+0x1594> - 2e84: 18c00204 addi r3,r3,8 - 2e88: d8814717 ldw r2,1308(sp) - 2e8c: 143fffc4 addi r16,r2,-1 - 2e90: 043f2b0e bge zero,r16,2b40 <___vfprintf_internal_r+0x5f8> - 2e94: 00800404 movi r2,16 - 2e98: 1402a80e bge r2,r16,393c <___vfprintf_internal_r+0x13f4> - 2e9c: dc400d17 ldw r17,52(sp) - 2ea0: 1027883a mov r19,r2 - 2ea4: 07000074 movhi fp,1 - 2ea8: e7388784 addi fp,fp,-7650 - 2eac: 050001c4 movi r20,7 - 2eb0: 00000306 br 2ec0 <___vfprintf_internal_r+0x978> - 2eb4: 18c00204 addi r3,r3,8 - 2eb8: 843ffc04 addi r16,r16,-16 - 2ebc: 9c02a20e bge r19,r16,3948 <___vfprintf_internal_r+0x1400> - 2ec0: 94800404 addi r18,r18,16 - 2ec4: 8c400044 addi r17,r17,1 - 2ec8: 1f000015 stw fp,0(r3) - 2ecc: 1cc00115 stw r19,4(r3) - 2ed0: dc800e15 stw r18,56(sp) - 2ed4: dc400d15 stw r17,52(sp) - 2ed8: a47ff60e bge r20,r17,2eb4 <___vfprintf_internal_r+0x96c> - 2edc: d9014f17 ldw r4,1340(sp) - 2ee0: b00b883a mov r5,r22 - 2ee4: d9800c04 addi r6,sp,48 - 2ee8: 00024f00 call 24f0 <__sprint_r> - 2eec: 103f4e1e bne r2,zero,2c28 <___vfprintf_internal_r+0x6e0> - 2ef0: dc800e17 ldw r18,56(sp) - 2ef4: dc400d17 ldw r17,52(sp) - 2ef8: d8c01904 addi r3,sp,100 - 2efc: 003fee06 br 2eb8 <___vfprintf_internal_r+0x970> - 2f00: d8802c0b ldhu r2,176(sp) - 2f04: 00ffffc4 movi r3,-1 - 2f08: d8c14b15 stw r3,1324(sp) - 2f0c: 1080100c andi r2,r2,64 - 2f10: 103dcc1e bne r2,zero,2644 <___vfprintf_internal_r+0xfc> - 2f14: 003dce06 br 2650 <___vfprintf_internal_r+0x108> - 2f18: d9014f17 ldw r4,1340(sp) - 2f1c: b00b883a mov r5,r22 - 2f20: d9800c04 addi r6,sp,48 - 2f24: 00024f00 call 24f0 <__sprint_r> - 2f28: 103f3f1e bne r2,zero,2c28 <___vfprintf_internal_r+0x6e0> - 2f2c: dc800e17 ldw r18,56(sp) - 2f30: 003f2e06 br 2bec <___vfprintf_internal_r+0x6a4> - 2f34: d9414c17 ldw r5,1328(sp) - 2f38: 29400414 ori r5,r5,16 - 2f3c: d9414c15 stw r5,1328(sp) - 2f40: d9814c17 ldw r6,1328(sp) - 2f44: 3080080c andi r2,r6,32 - 2f48: 10014f1e bne r2,zero,3488 <___vfprintf_internal_r+0xf40> - 2f4c: d8c14c17 ldw r3,1328(sp) - 2f50: 1880040c andi r2,r3,16 - 2f54: 1002f01e bne r2,zero,3b18 <___vfprintf_internal_r+0x15d0> - 2f58: d9014c17 ldw r4,1328(sp) - 2f5c: 2080100c andi r2,r4,64 - 2f60: 1002ed26 beq r2,zero,3b18 <___vfprintf_internal_r+0x15d0> - 2f64: 3880000f ldh r2,0(r7) - 2f68: 39c00104 addi r7,r7,4 - 2f6c: d9c14015 stw r7,1280(sp) - 2f70: 1023d7fa srai r17,r2,31 - 2f74: 1021883a mov r16,r2 - 2f78: 88037816 blt r17,zero,3d5c <___vfprintf_internal_r+0x1814> - 2f7c: 01000044 movi r4,1 - 2f80: 98000416 blt r19,zero,2f94 <___vfprintf_internal_r+0xa4c> - 2f84: d8c14c17 ldw r3,1328(sp) - 2f88: 00bfdfc4 movi r2,-129 - 2f8c: 1886703a and r3,r3,r2 - 2f90: d8c14c15 stw r3,1328(sp) - 2f94: 8444b03a or r2,r16,r17 - 2f98: 10022c1e bne r2,zero,384c <___vfprintf_internal_r+0x1304> - 2f9c: 98022b1e bne r19,zero,384c <___vfprintf_internal_r+0x1304> - 2fa0: 20803fcc andi r2,r4,255 - 2fa4: 1002a126 beq r2,zero,3a2c <___vfprintf_internal_r+0x14e4> - 2fa8: d8c01904 addi r3,sp,100 - 2fac: dd000f04 addi r20,sp,60 - 2fb0: d8c14115 stw r3,1284(sp) - 2fb4: d8c14117 ldw r3,1284(sp) - 2fb8: dcc14515 stw r19,1300(sp) - 2fbc: a0c5c83a sub r2,r20,r3 - 2fc0: 11c00a04 addi r7,r2,40 - 2fc4: 99c0010e bge r19,r7,2fcc <___vfprintf_internal_r+0xa84> - 2fc8: d9c14515 stw r7,1300(sp) - 2fcc: dcc14615 stw r19,1304(sp) - 2fd0: d8800407 ldb r2,16(sp) - 2fd4: 103e4c26 beq r2,zero,2908 <___vfprintf_internal_r+0x3c0> - 2fd8: d8814517 ldw r2,1300(sp) - 2fdc: 10800044 addi r2,r2,1 - 2fe0: d8814515 stw r2,1300(sp) - 2fe4: 003e4806 br 2908 <___vfprintf_internal_r+0x3c0> - 2fe8: d9814c17 ldw r6,1328(sp) - 2fec: 31800414 ori r6,r6,16 - 2ff0: d9814c15 stw r6,1328(sp) - 2ff4: d8c14c17 ldw r3,1328(sp) - 2ff8: 1880080c andi r2,r3,32 - 2ffc: 1001271e bne r2,zero,349c <___vfprintf_internal_r+0xf54> - 3000: d9414c17 ldw r5,1328(sp) - 3004: 2880040c andi r2,r5,16 - 3008: 1002bc1e bne r2,zero,3afc <___vfprintf_internal_r+0x15b4> - 300c: d9814c17 ldw r6,1328(sp) - 3010: 3080100c andi r2,r6,64 - 3014: 1002b926 beq r2,zero,3afc <___vfprintf_internal_r+0x15b4> - 3018: 3c00000b ldhu r16,0(r7) - 301c: 0009883a mov r4,zero - 3020: 39c00104 addi r7,r7,4 - 3024: 0023883a mov r17,zero - 3028: d9c14015 stw r7,1280(sp) - 302c: d8000405 stb zero,16(sp) - 3030: 003fd306 br 2f80 <___vfprintf_internal_r+0xa38> - 3034: d9014c17 ldw r4,1328(sp) - 3038: 21000414 ori r4,r4,16 - 303c: d9014c15 stw r4,1328(sp) - 3040: d9414c17 ldw r5,1328(sp) - 3044: 2880080c andi r2,r5,32 - 3048: 1001081e bne r2,zero,346c <___vfprintf_internal_r+0xf24> - 304c: d8c14c17 ldw r3,1328(sp) - 3050: 1880040c andi r2,r3,16 - 3054: 1002b61e bne r2,zero,3b30 <___vfprintf_internal_r+0x15e8> - 3058: d9014c17 ldw r4,1328(sp) - 305c: 2080100c andi r2,r4,64 - 3060: 1002b326 beq r2,zero,3b30 <___vfprintf_internal_r+0x15e8> - 3064: 3c00000b ldhu r16,0(r7) - 3068: 01000044 movi r4,1 - 306c: 39c00104 addi r7,r7,4 - 3070: 0023883a mov r17,zero - 3074: d9c14015 stw r7,1280(sp) - 3078: d8000405 stb zero,16(sp) - 307c: 003fc006 br 2f80 <___vfprintf_internal_r+0xa38> - 3080: d9014f17 ldw r4,1340(sp) - 3084: b00b883a mov r5,r22 - 3088: d9800c04 addi r6,sp,48 - 308c: 00024f00 call 24f0 <__sprint_r> - 3090: 103ee51e bne r2,zero,2c28 <___vfprintf_internal_r+0x6e0> - 3094: dc800e17 ldw r18,56(sp) - 3098: d8c01904 addi r3,sp,100 - 309c: d9814c17 ldw r6,1328(sp) - 30a0: 3080004c andi r2,r6,1 - 30a4: 1005003a cmpeq r2,r2,zero - 30a8: 103ea51e bne r2,zero,2b40 <___vfprintf_internal_r+0x5f8> - 30ac: 00800044 movi r2,1 - 30b0: dc400d17 ldw r17,52(sp) - 30b4: 18800115 stw r2,4(r3) - 30b8: d8814917 ldw r2,1316(sp) - 30bc: 94800044 addi r18,r18,1 - 30c0: 8c400044 addi r17,r17,1 - 30c4: 18800015 stw r2,0(r3) - 30c8: 008001c4 movi r2,7 - 30cc: dc800e15 stw r18,56(sp) - 30d0: dc400d15 stw r17,52(sp) - 30d4: 1442240e bge r2,r17,3968 <___vfprintf_internal_r+0x1420> - 30d8: d9014f17 ldw r4,1340(sp) - 30dc: b00b883a mov r5,r22 - 30e0: d9800c04 addi r6,sp,48 - 30e4: 00024f00 call 24f0 <__sprint_r> - 30e8: 103ecf1e bne r2,zero,2c28 <___vfprintf_internal_r+0x6e0> - 30ec: dc800e17 ldw r18,56(sp) - 30f0: d8c01904 addi r3,sp,100 - 30f4: 003e9206 br 2b40 <___vfprintf_internal_r+0x5f8> - 30f8: d9014f17 ldw r4,1340(sp) - 30fc: b00b883a mov r5,r22 - 3100: d9800c04 addi r6,sp,48 - 3104: 00024f00 call 24f0 <__sprint_r> - 3108: 103ec026 beq r2,zero,2c0c <___vfprintf_internal_r+0x6c4> - 310c: 003ec606 br 2c28 <___vfprintf_internal_r+0x6e0> - 3110: d9014f17 ldw r4,1340(sp) - 3114: b00b883a mov r5,r22 - 3118: d9800c04 addi r6,sp,48 - 311c: d9c15115 stw r7,1348(sp) - 3120: 00024f00 call 24f0 <__sprint_r> - 3124: d9c15117 ldw r7,1348(sp) - 3128: 103ebf1e bne r2,zero,2c28 <___vfprintf_internal_r+0x6e0> - 312c: dc800e17 ldw r18,56(sp) - 3130: dc400d17 ldw r17,52(sp) - 3134: dd401904 addi r21,sp,100 - 3138: 003e7406 br 2b0c <___vfprintf_internal_r+0x5c4> - 313c: d9014f17 ldw r4,1340(sp) - 3140: b00b883a mov r5,r22 - 3144: d9800c04 addi r6,sp,48 - 3148: d9c15115 stw r7,1348(sp) - 314c: 00024f00 call 24f0 <__sprint_r> - 3150: d9c15117 ldw r7,1348(sp) - 3154: 103eb41e bne r2,zero,2c28 <___vfprintf_internal_r+0x6e0> - 3158: dd401904 addi r21,sp,100 - 315c: 003d6d06 br 2714 <___vfprintf_internal_r+0x1cc> - 3160: d9014f17 ldw r4,1340(sp) - 3164: b00b883a mov r5,r22 - 3168: d9800c04 addi r6,sp,48 - 316c: d9c15115 stw r7,1348(sp) - 3170: 00024f00 call 24f0 <__sprint_r> - 3174: d9c15117 ldw r7,1348(sp) - 3178: 103eab1e bne r2,zero,2c28 <___vfprintf_internal_r+0x6e0> - 317c: dc800e17 ldw r18,56(sp) - 3180: dc400d17 ldw r17,52(sp) - 3184: dd401904 addi r21,sp,100 - 3188: 003e3406 br 2a5c <___vfprintf_internal_r+0x514> - 318c: d9014f17 ldw r4,1340(sp) - 3190: b00b883a mov r5,r22 - 3194: d9800c04 addi r6,sp,48 - 3198: d9c15115 stw r7,1348(sp) - 319c: 00024f00 call 24f0 <__sprint_r> - 31a0: d9c15117 ldw r7,1348(sp) - 31a4: 103ea01e bne r2,zero,2c28 <___vfprintf_internal_r+0x6e0> - 31a8: dc800e17 ldw r18,56(sp) - 31ac: dc400d17 ldw r17,52(sp) - 31b0: dd401904 addi r21,sp,100 - 31b4: 003e1c06 br 2a28 <___vfprintf_internal_r+0x4e0> - 31b8: d9014f17 ldw r4,1340(sp) - 31bc: b00b883a mov r5,r22 - 31c0: d9800c04 addi r6,sp,48 - 31c4: d9c15115 stw r7,1348(sp) - 31c8: 00024f00 call 24f0 <__sprint_r> - 31cc: d9c15117 ldw r7,1348(sp) - 31d0: 103e951e bne r2,zero,2c28 <___vfprintf_internal_r+0x6e0> - 31d4: dc800e17 ldw r18,56(sp) - 31d8: dc400d17 ldw r17,52(sp) - 31dc: dd401904 addi r21,sp,100 - 31e0: 003e0406 br 29f4 <___vfprintf_internal_r+0x4ac> - 31e4: d9000517 ldw r4,20(sp) - 31e8: 0102580e bge zero,r4,3b4c <___vfprintf_internal_r+0x1604> - 31ec: d9814717 ldw r6,1308(sp) - 31f0: 21807a16 blt r4,r6,33dc <___vfprintf_internal_r+0xe94> - 31f4: d8814117 ldw r2,1284(sp) - 31f8: 91a5883a add r18,r18,r6 - 31fc: 8c400044 addi r17,r17,1 - 3200: a8800015 stw r2,0(r21) - 3204: 008001c4 movi r2,7 - 3208: a9800115 stw r6,4(r21) - 320c: dc800e15 stw r18,56(sp) - 3210: dc400d15 stw r17,52(sp) - 3214: 1442fc16 blt r2,r17,3e08 <___vfprintf_internal_r+0x18c0> - 3218: a8c00204 addi r3,r21,8 - 321c: d9414717 ldw r5,1308(sp) - 3220: 2161c83a sub r16,r4,r5 - 3224: 043f9d0e bge zero,r16,309c <___vfprintf_internal_r+0xb54> - 3228: 00800404 movi r2,16 - 322c: 1402190e bge r2,r16,3a94 <___vfprintf_internal_r+0x154c> - 3230: dc400d17 ldw r17,52(sp) - 3234: 1027883a mov r19,r2 - 3238: 07000074 movhi fp,1 - 323c: e7388784 addi fp,fp,-7650 - 3240: 050001c4 movi r20,7 - 3244: 00000306 br 3254 <___vfprintf_internal_r+0xd0c> - 3248: 18c00204 addi r3,r3,8 - 324c: 843ffc04 addi r16,r16,-16 - 3250: 9c02130e bge r19,r16,3aa0 <___vfprintf_internal_r+0x1558> - 3254: 94800404 addi r18,r18,16 - 3258: 8c400044 addi r17,r17,1 - 325c: 1f000015 stw fp,0(r3) - 3260: 1cc00115 stw r19,4(r3) - 3264: dc800e15 stw r18,56(sp) - 3268: dc400d15 stw r17,52(sp) - 326c: a47ff60e bge r20,r17,3248 <___vfprintf_internal_r+0xd00> - 3270: d9014f17 ldw r4,1340(sp) - 3274: b00b883a mov r5,r22 - 3278: d9800c04 addi r6,sp,48 - 327c: 00024f00 call 24f0 <__sprint_r> - 3280: 103e691e bne r2,zero,2c28 <___vfprintf_internal_r+0x6e0> - 3284: dc800e17 ldw r18,56(sp) - 3288: dc400d17 ldw r17,52(sp) - 328c: d8c01904 addi r3,sp,100 - 3290: 003fee06 br 324c <___vfprintf_internal_r+0xd04> - 3294: d8814717 ldw r2,1308(sp) - 3298: 143fffc4 addi r16,r2,-1 - 329c: 043e970e bge zero,r16,2cfc <___vfprintf_internal_r+0x7b4> - 32a0: 00800404 movi r2,16 - 32a4: 1400180e bge r2,r16,3308 <___vfprintf_internal_r+0xdc0> - 32a8: 1029883a mov r20,r2 - 32ac: 07000074 movhi fp,1 - 32b0: e7388784 addi fp,fp,-7650 - 32b4: 054001c4 movi r21,7 - 32b8: 00000306 br 32c8 <___vfprintf_internal_r+0xd80> - 32bc: 9cc00204 addi r19,r19,8 - 32c0: 843ffc04 addi r16,r16,-16 - 32c4: a400120e bge r20,r16,3310 <___vfprintf_internal_r+0xdc8> - 32c8: 94800404 addi r18,r18,16 - 32cc: 8c400044 addi r17,r17,1 - 32d0: 9f000015 stw fp,0(r19) - 32d4: 9d000115 stw r20,4(r19) - 32d8: dc800e15 stw r18,56(sp) - 32dc: dc400d15 stw r17,52(sp) - 32e0: ac7ff60e bge r21,r17,32bc <___vfprintf_internal_r+0xd74> - 32e4: d9014f17 ldw r4,1340(sp) - 32e8: b00b883a mov r5,r22 - 32ec: d9800c04 addi r6,sp,48 - 32f0: 00024f00 call 24f0 <__sprint_r> - 32f4: 103e4c1e bne r2,zero,2c28 <___vfprintf_internal_r+0x6e0> - 32f8: dc800e17 ldw r18,56(sp) - 32fc: dc400d17 ldw r17,52(sp) - 3300: dcc01904 addi r19,sp,100 - 3304: 003fee06 br 32c0 <___vfprintf_internal_r+0xd78> - 3308: 07000074 movhi fp,1 - 330c: e7388784 addi fp,fp,-7650 - 3310: 9425883a add r18,r18,r16 - 3314: 8c400044 addi r17,r17,1 - 3318: 008001c4 movi r2,7 - 331c: 9f000015 stw fp,0(r19) - 3320: 9c000115 stw r16,4(r19) - 3324: dc800e15 stw r18,56(sp) - 3328: dc400d15 stw r17,52(sp) - 332c: 147e720e bge r2,r17,2cf8 <___vfprintf_internal_r+0x7b0> - 3330: d9014f17 ldw r4,1340(sp) - 3334: b00b883a mov r5,r22 - 3338: d9800c04 addi r6,sp,48 - 333c: 00024f00 call 24f0 <__sprint_r> - 3340: 103e391e bne r2,zero,2c28 <___vfprintf_internal_r+0x6e0> - 3344: dc800e17 ldw r18,56(sp) - 3348: dc400d17 ldw r17,52(sp) - 334c: dcc01904 addi r19,sp,100 - 3350: 003e6a06 br 2cfc <___vfprintf_internal_r+0x7b4> - 3354: d9014f17 ldw r4,1340(sp) - 3358: b00b883a mov r5,r22 - 335c: d9800c04 addi r6,sp,48 - 3360: d9c15115 stw r7,1348(sp) - 3364: 00024f00 call 24f0 <__sprint_r> - 3368: d9c15117 ldw r7,1348(sp) - 336c: 103e2e1e bne r2,zero,2c28 <___vfprintf_internal_r+0x6e0> - 3370: dc800e17 ldw r18,56(sp) - 3374: dc400d17 ldw r17,52(sp) - 3378: dd401904 addi r21,sp,100 - 337c: 003dba06 br 2a68 <___vfprintf_internal_r+0x520> - 3380: d9014f17 ldw r4,1340(sp) - 3384: b00b883a mov r5,r22 - 3388: d9800c04 addi r6,sp,48 - 338c: 00024f00 call 24f0 <__sprint_r> - 3390: 103e251e bne r2,zero,2c28 <___vfprintf_internal_r+0x6e0> - 3394: dc800e17 ldw r18,56(sp) - 3398: dc400d17 ldw r17,52(sp) - 339c: dcc01904 addi r19,sp,100 - 33a0: 003e4206 br 2cac <___vfprintf_internal_r+0x764> - 33a4: d9014f17 ldw r4,1340(sp) - 33a8: b00b883a mov r5,r22 - 33ac: d9800c04 addi r6,sp,48 - 33b0: 00024f00 call 24f0 <__sprint_r> - 33b4: 103e1c1e bne r2,zero,2c28 <___vfprintf_internal_r+0x6e0> - 33b8: dc800e17 ldw r18,56(sp) - 33bc: dc400d17 ldw r17,52(sp) - 33c0: d8c01904 addi r3,sp,100 - 33c4: 003e2e06 br 2c80 <___vfprintf_internal_r+0x738> - 33c8: d9414c17 ldw r5,1328(sp) - 33cc: 2880004c andi r2,r5,1 - 33d0: 1005003a cmpeq r2,r2,zero - 33d4: 103dda1e bne r2,zero,2b40 <___vfprintf_internal_r+0x5f8> - 33d8: 003e9f06 br 2e58 <___vfprintf_internal_r+0x910> - 33dc: d8c14117 ldw r3,1284(sp) - 33e0: 9125883a add r18,r18,r4 - 33e4: 8c400044 addi r17,r17,1 - 33e8: 008001c4 movi r2,7 - 33ec: a8c00015 stw r3,0(r21) - 33f0: a9000115 stw r4,4(r21) - 33f4: dc800e15 stw r18,56(sp) - 33f8: dc400d15 stw r17,52(sp) - 33fc: 14426c16 blt r2,r17,3db0 <___vfprintf_internal_r+0x1868> - 3400: a8c00204 addi r3,r21,8 - 3404: d9414917 ldw r5,1316(sp) - 3408: 00800044 movi r2,1 - 340c: 94800044 addi r18,r18,1 - 3410: 8c400044 addi r17,r17,1 - 3414: 18800115 stw r2,4(r3) - 3418: 008001c4 movi r2,7 - 341c: 19400015 stw r5,0(r3) - 3420: dc800e15 stw r18,56(sp) - 3424: dc400d15 stw r17,52(sp) - 3428: 2021883a mov r16,r4 - 342c: 14425616 blt r2,r17,3d88 <___vfprintf_internal_r+0x1840> - 3430: 19400204 addi r5,r3,8 - 3434: d9814717 ldw r6,1308(sp) - 3438: 8c400044 addi r17,r17,1 - 343c: dc400d15 stw r17,52(sp) - 3440: 3107c83a sub r3,r6,r4 - 3444: d9014117 ldw r4,1284(sp) - 3448: 90e5883a add r18,r18,r3 - 344c: 28c00115 stw r3,4(r5) - 3450: 8105883a add r2,r16,r4 - 3454: 28800015 stw r2,0(r5) - 3458: 008001c4 movi r2,7 - 345c: dc800e15 stw r18,56(sp) - 3460: 147f1d16 blt r2,r17,30d8 <___vfprintf_internal_r+0xb90> - 3464: 28c00204 addi r3,r5,8 - 3468: 003db506 br 2b40 <___vfprintf_internal_r+0x5f8> - 346c: 3c000017 ldw r16,0(r7) - 3470: 3c400117 ldw r17,4(r7) - 3474: 39800204 addi r6,r7,8 - 3478: 01000044 movi r4,1 - 347c: d9814015 stw r6,1280(sp) - 3480: d8000405 stb zero,16(sp) - 3484: 003ebe06 br 2f80 <___vfprintf_internal_r+0xa38> - 3488: 3c000017 ldw r16,0(r7) - 348c: 3c400117 ldw r17,4(r7) - 3490: 38800204 addi r2,r7,8 - 3494: d8814015 stw r2,1280(sp) - 3498: 003eb706 br 2f78 <___vfprintf_internal_r+0xa30> - 349c: 3c000017 ldw r16,0(r7) - 34a0: 3c400117 ldw r17,4(r7) - 34a4: 39000204 addi r4,r7,8 - 34a8: d9014015 stw r4,1280(sp) - 34ac: 0009883a mov r4,zero - 34b0: d8000405 stb zero,16(sp) - 34b4: 003eb206 br 2f80 <___vfprintf_internal_r+0xa38> - 34b8: 38c00017 ldw r3,0(r7) - 34bc: 39c00104 addi r7,r7,4 - 34c0: d8c14a15 stw r3,1320(sp) - 34c4: 1800d70e bge r3,zero,3824 <___vfprintf_internal_r+0x12dc> - 34c8: 00c7c83a sub r3,zero,r3 - 34cc: d8c14a15 stw r3,1320(sp) - 34d0: d9014c17 ldw r4,1328(sp) - 34d4: b8c00007 ldb r3,0(r23) - 34d8: 21000114 ori r4,r4,4 - 34dc: d9014c15 stw r4,1328(sp) - 34e0: 003c9806 br 2744 <___vfprintf_internal_r+0x1fc> - 34e4: d9814c17 ldw r6,1328(sp) - 34e8: 3080080c andi r2,r6,32 - 34ec: 1001f626 beq r2,zero,3cc8 <___vfprintf_internal_r+0x1780> - 34f0: d9014b17 ldw r4,1324(sp) - 34f4: 38800017 ldw r2,0(r7) - 34f8: 39c00104 addi r7,r7,4 - 34fc: d9c14015 stw r7,1280(sp) - 3500: 2007d7fa srai r3,r4,31 - 3504: d9c14017 ldw r7,1280(sp) - 3508: 11000015 stw r4,0(r2) - 350c: 10c00115 stw r3,4(r2) - 3510: 003c6906 br 26b8 <___vfprintf_internal_r+0x170> - 3514: b8c00007 ldb r3,0(r23) - 3518: 00801b04 movi r2,108 - 351c: 18825526 beq r3,r2,3e74 <___vfprintf_internal_r+0x192c> - 3520: d9414c17 ldw r5,1328(sp) - 3524: 29400414 ori r5,r5,16 - 3528: d9414c15 stw r5,1328(sp) - 352c: 003c8506 br 2744 <___vfprintf_internal_r+0x1fc> - 3530: d9814c17 ldw r6,1328(sp) - 3534: b8c00007 ldb r3,0(r23) - 3538: 31800814 ori r6,r6,32 - 353c: d9814c15 stw r6,1328(sp) - 3540: 003c8006 br 2744 <___vfprintf_internal_r+0x1fc> - 3544: d8814c17 ldw r2,1328(sp) - 3548: 3c000017 ldw r16,0(r7) - 354c: 00c01e04 movi r3,120 - 3550: 10800094 ori r2,r2,2 - 3554: d8814c15 stw r2,1328(sp) - 3558: 39c00104 addi r7,r7,4 - 355c: 01400074 movhi r5,1 - 3560: 29787004 addi r5,r5,-7744 - 3564: 00800c04 movi r2,48 - 3568: 0023883a mov r17,zero - 356c: 01000084 movi r4,2 - 3570: d9c14015 stw r7,1280(sp) - 3574: d8c14d15 stw r3,1332(sp) - 3578: d9414415 stw r5,1296(sp) - 357c: d8800445 stb r2,17(sp) - 3580: d8c00485 stb r3,18(sp) - 3584: d8000405 stb zero,16(sp) - 3588: 003e7d06 br 2f80 <___vfprintf_internal_r+0xa38> - 358c: d8814c17 ldw r2,1328(sp) - 3590: b8c00007 ldb r3,0(r23) - 3594: 10801014 ori r2,r2,64 - 3598: d8814c15 stw r2,1328(sp) - 359c: 003c6906 br 2744 <___vfprintf_internal_r+0x1fc> - 35a0: d9414c17 ldw r5,1328(sp) - 35a4: 2880020c andi r2,r5,8 - 35a8: 1001e526 beq r2,zero,3d40 <___vfprintf_internal_r+0x17f8> - 35ac: 39800017 ldw r6,0(r7) - 35b0: 38800204 addi r2,r7,8 - 35b4: d8814015 stw r2,1280(sp) - 35b8: d9814215 stw r6,1288(sp) - 35bc: 39c00117 ldw r7,4(r7) - 35c0: d9c14315 stw r7,1292(sp) - 35c4: d9014217 ldw r4,1288(sp) - 35c8: d9414317 ldw r5,1292(sp) - 35cc: 0007e900 call 7e90 <__isinfd> - 35d0: 10021d26 beq r2,zero,3e48 <___vfprintf_internal_r+0x1900> - 35d4: d9014217 ldw r4,1288(sp) - 35d8: d9414317 ldw r5,1292(sp) - 35dc: 000d883a mov r6,zero - 35e0: 000f883a mov r7,zero - 35e4: 0009a900 call 9a90 <__ltdf2> - 35e8: 1002d016 blt r2,zero,412c <___vfprintf_internal_r+0x1be4> - 35ec: d9414d17 ldw r5,1332(sp) - 35f0: 008011c4 movi r2,71 - 35f4: 11421016 blt r2,r5,3e38 <___vfprintf_internal_r+0x18f0> - 35f8: 01800074 movhi r6,1 - 35fc: 31b87504 addi r6,r6,-7724 - 3600: d9814115 stw r6,1284(sp) - 3604: d9014c17 ldw r4,1328(sp) - 3608: 00c000c4 movi r3,3 - 360c: 00bfdfc4 movi r2,-129 - 3610: 2088703a and r4,r4,r2 - 3614: 180f883a mov r7,r3 - 3618: d8c14515 stw r3,1300(sp) - 361c: d9014c15 stw r4,1328(sp) - 3620: d8014615 stw zero,1304(sp) - 3624: 003e6a06 br 2fd0 <___vfprintf_internal_r+0xa88> - 3628: 38800017 ldw r2,0(r7) - 362c: 00c00044 movi r3,1 - 3630: 39c00104 addi r7,r7,4 - 3634: d9c14015 stw r7,1280(sp) - 3638: d9000f04 addi r4,sp,60 - 363c: 180f883a mov r7,r3 - 3640: d8c14515 stw r3,1300(sp) - 3644: d9014115 stw r4,1284(sp) - 3648: d8800f05 stb r2,60(sp) - 364c: d8000405 stb zero,16(sp) - 3650: 003cac06 br 2904 <___vfprintf_internal_r+0x3bc> - 3654: 01400074 movhi r5,1 - 3658: 29787b04 addi r5,r5,-7700 - 365c: d9414415 stw r5,1296(sp) - 3660: d9814c17 ldw r6,1328(sp) - 3664: 3080080c andi r2,r6,32 - 3668: 1000ff26 beq r2,zero,3a68 <___vfprintf_internal_r+0x1520> - 366c: 3c000017 ldw r16,0(r7) - 3670: 3c400117 ldw r17,4(r7) - 3674: 38800204 addi r2,r7,8 - 3678: d8814015 stw r2,1280(sp) - 367c: d9414c17 ldw r5,1328(sp) - 3680: 2880004c andi r2,r5,1 - 3684: 1005003a cmpeq r2,r2,zero - 3688: 1000b91e bne r2,zero,3970 <___vfprintf_internal_r+0x1428> - 368c: 8444b03a or r2,r16,r17 - 3690: 1000b726 beq r2,zero,3970 <___vfprintf_internal_r+0x1428> - 3694: d9814d17 ldw r6,1332(sp) - 3698: 29400094 ori r5,r5,2 - 369c: 00800c04 movi r2,48 - 36a0: 01000084 movi r4,2 - 36a4: d9414c15 stw r5,1328(sp) - 36a8: d8800445 stb r2,17(sp) - 36ac: d9800485 stb r6,18(sp) - 36b0: d8000405 stb zero,16(sp) - 36b4: 003e3206 br 2f80 <___vfprintf_internal_r+0xa38> - 36b8: 01800074 movhi r6,1 - 36bc: 31b87004 addi r6,r6,-7744 - 36c0: d9814415 stw r6,1296(sp) - 36c4: 003fe606 br 3660 <___vfprintf_internal_r+0x1118> - 36c8: 00800ac4 movi r2,43 - 36cc: d8800405 stb r2,16(sp) - 36d0: b8c00007 ldb r3,0(r23) - 36d4: 003c1b06 br 2744 <___vfprintf_internal_r+0x1fc> - 36d8: d8814c17 ldw r2,1328(sp) - 36dc: b8c00007 ldb r3,0(r23) - 36e0: 10800054 ori r2,r2,1 - 36e4: d8814c15 stw r2,1328(sp) - 36e8: 003c1606 br 2744 <___vfprintf_internal_r+0x1fc> - 36ec: d8800407 ldb r2,16(sp) - 36f0: 10004c1e bne r2,zero,3824 <___vfprintf_internal_r+0x12dc> - 36f4: 00800804 movi r2,32 - 36f8: d8800405 stb r2,16(sp) - 36fc: b8c00007 ldb r3,0(r23) - 3700: 003c1006 br 2744 <___vfprintf_internal_r+0x1fc> - 3704: d9814c17 ldw r6,1328(sp) - 3708: b8c00007 ldb r3,0(r23) - 370c: 31800214 ori r6,r6,8 - 3710: d9814c15 stw r6,1328(sp) - 3714: 003c0b06 br 2744 <___vfprintf_internal_r+0x1fc> - 3718: 0009883a mov r4,zero - 371c: 04000244 movi r16,9 - 3720: 01400284 movi r5,10 - 3724: d9c15115 stw r7,1348(sp) - 3728: 0009fc80 call 9fc8 <__mulsi3> - 372c: b9000007 ldb r4,0(r23) - 3730: d8c14d17 ldw r3,1332(sp) - 3734: bdc00044 addi r23,r23,1 - 3738: d9014d15 stw r4,1332(sp) - 373c: d9414d17 ldw r5,1332(sp) - 3740: 1885883a add r2,r3,r2 - 3744: 113ff404 addi r4,r2,-48 - 3748: 28bff404 addi r2,r5,-48 - 374c: d9c15117 ldw r7,1348(sp) - 3750: 80bff32e bgeu r16,r2,3720 <___vfprintf_internal_r+0x11d8> - 3754: d9014a15 stw r4,1320(sp) - 3758: 003bfc06 br 274c <___vfprintf_internal_r+0x204> - 375c: d8814c17 ldw r2,1328(sp) - 3760: b8c00007 ldb r3,0(r23) - 3764: 10802014 ori r2,r2,128 - 3768: d8814c15 stw r2,1328(sp) - 376c: 003bf506 br 2744 <___vfprintf_internal_r+0x1fc> - 3770: b8c00007 ldb r3,0(r23) - 3774: 00800a84 movi r2,42 - 3778: bdc00044 addi r23,r23,1 - 377c: 18831826 beq r3,r2,43e0 <___vfprintf_internal_r+0x1e98> - 3780: d8c14d15 stw r3,1332(sp) - 3784: 18bff404 addi r2,r3,-48 - 3788: 00c00244 movi r3,9 - 378c: 18827b36 bltu r3,r2,417c <___vfprintf_internal_r+0x1c34> - 3790: 1821883a mov r16,r3 - 3794: 0009883a mov r4,zero - 3798: 01400284 movi r5,10 - 379c: d9c15115 stw r7,1348(sp) - 37a0: 0009fc80 call 9fc8 <__mulsi3> - 37a4: d9414d17 ldw r5,1332(sp) - 37a8: b9800007 ldb r6,0(r23) - 37ac: d9c15117 ldw r7,1348(sp) - 37b0: 1145883a add r2,r2,r5 - 37b4: 113ff404 addi r4,r2,-48 - 37b8: 30bff404 addi r2,r6,-48 - 37bc: d9814d15 stw r6,1332(sp) - 37c0: bdc00044 addi r23,r23,1 - 37c4: 80bff42e bgeu r16,r2,3798 <___vfprintf_internal_r+0x1250> - 37c8: 2027883a mov r19,r4 - 37cc: 203bdf0e bge r4,zero,274c <___vfprintf_internal_r+0x204> - 37d0: 04ffffc4 movi r19,-1 - 37d4: 003bdd06 br 274c <___vfprintf_internal_r+0x204> - 37d8: d8000405 stb zero,16(sp) - 37dc: 39800017 ldw r6,0(r7) - 37e0: 39c00104 addi r7,r7,4 - 37e4: d9c14015 stw r7,1280(sp) - 37e8: d9814115 stw r6,1284(sp) - 37ec: 3001c926 beq r6,zero,3f14 <___vfprintf_internal_r+0x19cc> - 37f0: 98000e16 blt r19,zero,382c <___vfprintf_internal_r+0x12e4> - 37f4: d9014117 ldw r4,1284(sp) - 37f8: 000b883a mov r5,zero - 37fc: 980d883a mov r6,r19 - 3800: 00065340 call 6534 - 3804: 10025926 beq r2,zero,416c <___vfprintf_internal_r+0x1c24> - 3808: d8c14117 ldw r3,1284(sp) - 380c: 10cfc83a sub r7,r2,r3 - 3810: 99c19e16 blt r19,r7,3e8c <___vfprintf_internal_r+0x1944> - 3814: d9c14515 stw r7,1300(sp) - 3818: 38000916 blt r7,zero,3840 <___vfprintf_internal_r+0x12f8> - 381c: d8014615 stw zero,1304(sp) - 3820: 003deb06 br 2fd0 <___vfprintf_internal_r+0xa88> - 3824: b8c00007 ldb r3,0(r23) - 3828: 003bc606 br 2744 <___vfprintf_internal_r+0x1fc> - 382c: d9014117 ldw r4,1284(sp) - 3830: 000247c0 call 247c - 3834: d8814515 stw r2,1300(sp) - 3838: 100f883a mov r7,r2 - 383c: 103ff70e bge r2,zero,381c <___vfprintf_internal_r+0x12d4> - 3840: d8014515 stw zero,1300(sp) - 3844: d8014615 stw zero,1304(sp) - 3848: 003de106 br 2fd0 <___vfprintf_internal_r+0xa88> - 384c: 20c03fcc andi r3,r4,255 - 3850: 00800044 movi r2,1 - 3854: 18802d26 beq r3,r2,390c <___vfprintf_internal_r+0x13c4> - 3858: 18800e36 bltu r3,r2,3894 <___vfprintf_internal_r+0x134c> - 385c: 00800084 movi r2,2 - 3860: 1880fa26 beq r3,r2,3c4c <___vfprintf_internal_r+0x1704> - 3864: 01000074 movhi r4,1 - 3868: 21388004 addi r4,r4,-7680 - 386c: 000247c0 call 247c - 3870: 100f883a mov r7,r2 - 3874: dcc14515 stw r19,1300(sp) - 3878: 9880010e bge r19,r2,3880 <___vfprintf_internal_r+0x1338> - 387c: d8814515 stw r2,1300(sp) - 3880: 00800074 movhi r2,1 - 3884: 10b88004 addi r2,r2,-7680 - 3888: dcc14615 stw r19,1304(sp) - 388c: d8814115 stw r2,1284(sp) - 3890: 003dcf06 br 2fd0 <___vfprintf_internal_r+0xa88> - 3894: d9401904 addi r5,sp,100 - 3898: dd000f04 addi r20,sp,60 - 389c: d9414115 stw r5,1284(sp) - 38a0: 880a977a slli r5,r17,29 - 38a4: d9814117 ldw r6,1284(sp) - 38a8: 8004d0fa srli r2,r16,3 - 38ac: 8806d0fa srli r3,r17,3 - 38b0: 810001cc andi r4,r16,7 - 38b4: 2884b03a or r2,r5,r2 - 38b8: 31bfffc4 addi r6,r6,-1 - 38bc: 21000c04 addi r4,r4,48 - 38c0: d9814115 stw r6,1284(sp) - 38c4: 10cab03a or r5,r2,r3 - 38c8: 31000005 stb r4,0(r6) - 38cc: 1021883a mov r16,r2 - 38d0: 1823883a mov r17,r3 - 38d4: 283ff21e bne r5,zero,38a0 <___vfprintf_internal_r+0x1358> - 38d8: d8c14c17 ldw r3,1328(sp) - 38dc: 1880004c andi r2,r3,1 - 38e0: 1005003a cmpeq r2,r2,zero - 38e4: 103db31e bne r2,zero,2fb4 <___vfprintf_internal_r+0xa6c> - 38e8: 20803fcc andi r2,r4,255 - 38ec: 1080201c xori r2,r2,128 - 38f0: 10bfe004 addi r2,r2,-128 - 38f4: 00c00c04 movi r3,48 - 38f8: 10fdae26 beq r2,r3,2fb4 <___vfprintf_internal_r+0xa6c> - 38fc: 31bfffc4 addi r6,r6,-1 - 3900: d9814115 stw r6,1284(sp) - 3904: 30c00005 stb r3,0(r6) - 3908: 003daa06 br 2fb4 <___vfprintf_internal_r+0xa6c> - 390c: 88800068 cmpgeui r2,r17,1 - 3910: 10002c1e bne r2,zero,39c4 <___vfprintf_internal_r+0x147c> - 3914: 8800021e bne r17,zero,3920 <___vfprintf_internal_r+0x13d8> - 3918: 00800244 movi r2,9 - 391c: 14002936 bltu r2,r16,39c4 <___vfprintf_internal_r+0x147c> - 3920: d90018c4 addi r4,sp,99 - 3924: dd000f04 addi r20,sp,60 - 3928: d9014115 stw r4,1284(sp) - 392c: d9014117 ldw r4,1284(sp) - 3930: 80800c04 addi r2,r16,48 - 3934: 20800005 stb r2,0(r4) - 3938: 003d9e06 br 2fb4 <___vfprintf_internal_r+0xa6c> - 393c: dc400d17 ldw r17,52(sp) - 3940: 07000074 movhi fp,1 - 3944: e7388784 addi fp,fp,-7650 - 3948: 9425883a add r18,r18,r16 - 394c: 8c400044 addi r17,r17,1 - 3950: 008001c4 movi r2,7 - 3954: 1f000015 stw fp,0(r3) - 3958: 1c000115 stw r16,4(r3) - 395c: dc800e15 stw r18,56(sp) - 3960: dc400d15 stw r17,52(sp) - 3964: 147ddc16 blt r2,r17,30d8 <___vfprintf_internal_r+0xb90> - 3968: 18c00204 addi r3,r3,8 - 396c: 003c7406 br 2b40 <___vfprintf_internal_r+0x5f8> - 3970: 01000084 movi r4,2 - 3974: d8000405 stb zero,16(sp) - 3978: 003d8106 br 2f80 <___vfprintf_internal_r+0xa38> - 397c: d9814c17 ldw r6,1328(sp) - 3980: 30c4703a and r2,r6,r3 - 3984: 1005003a cmpeq r2,r2,zero - 3988: 103cb326 beq r2,zero,2c58 <___vfprintf_internal_r+0x710> - 398c: d9014117 ldw r4,1284(sp) - 3990: 94800044 addi r18,r18,1 - 3994: 8c400044 addi r17,r17,1 - 3998: 008001c4 movi r2,7 - 399c: a9000015 stw r4,0(r21) - 39a0: a8c00115 stw r3,4(r21) - 39a4: dc800e15 stw r18,56(sp) - 39a8: dc400d15 stw r17,52(sp) - 39ac: 147e6016 blt r2,r17,3330 <___vfprintf_internal_r+0xde8> - 39b0: acc00204 addi r19,r21,8 - 39b4: 003cd106 br 2cfc <___vfprintf_internal_r+0x7b4> - 39b8: 07000074 movhi fp,1 - 39bc: e7388784 addi fp,fp,-7650 - 39c0: 003c4906 br 2ae8 <___vfprintf_internal_r+0x5a0> - 39c4: dd000f04 addi r20,sp,60 - 39c8: dc801904 addi r18,sp,100 - 39cc: 8009883a mov r4,r16 - 39d0: 880b883a mov r5,r17 - 39d4: 01800284 movi r6,10 - 39d8: 000f883a mov r7,zero - 39dc: 00086f00 call 86f0 <__umoddi3> - 39e0: 12000c04 addi r8,r2,48 - 39e4: 94bfffc4 addi r18,r18,-1 - 39e8: 8009883a mov r4,r16 - 39ec: 880b883a mov r5,r17 - 39f0: 01800284 movi r6,10 - 39f4: 000f883a mov r7,zero - 39f8: 92000005 stb r8,0(r18) - 39fc: 00080840 call 8084 <__udivdi3> - 3a00: 1009883a mov r4,r2 - 3a04: 1021883a mov r16,r2 - 3a08: 18800068 cmpgeui r2,r3,1 - 3a0c: 1823883a mov r17,r3 - 3a10: 103fee1e bne r2,zero,39cc <___vfprintf_internal_r+0x1484> - 3a14: 1800021e bne r3,zero,3a20 <___vfprintf_internal_r+0x14d8> - 3a18: 00800244 movi r2,9 - 3a1c: 113feb36 bltu r2,r4,39cc <___vfprintf_internal_r+0x1484> - 3a20: 94bfffc4 addi r18,r18,-1 - 3a24: dc814115 stw r18,1284(sp) - 3a28: 003fc006 br 392c <___vfprintf_internal_r+0x13e4> - 3a2c: d9014c17 ldw r4,1328(sp) - 3a30: 2080004c andi r2,r4,1 - 3a34: 10009a1e bne r2,zero,3ca0 <___vfprintf_internal_r+0x1758> - 3a38: d9401904 addi r5,sp,100 - 3a3c: dd000f04 addi r20,sp,60 - 3a40: d9414115 stw r5,1284(sp) - 3a44: 003d5b06 br 2fb4 <___vfprintf_internal_r+0xa6c> - 3a48: d9014f17 ldw r4,1340(sp) - 3a4c: b00b883a mov r5,r22 - 3a50: d9800c04 addi r6,sp,48 - 3a54: 00024f00 call 24f0 <__sprint_r> - 3a58: 103c731e bne r2,zero,2c28 <___vfprintf_internal_r+0x6e0> - 3a5c: dc800e17 ldw r18,56(sp) - 3a60: d8c01904 addi r3,sp,100 - 3a64: 003cf906 br 2e4c <___vfprintf_internal_r+0x904> - 3a68: d8c14c17 ldw r3,1328(sp) - 3a6c: 1880040c andi r2,r3,16 - 3a70: 1000711e bne r2,zero,3c38 <___vfprintf_internal_r+0x16f0> - 3a74: d9014c17 ldw r4,1328(sp) - 3a78: 2080100c andi r2,r4,64 - 3a7c: 10006e26 beq r2,zero,3c38 <___vfprintf_internal_r+0x16f0> - 3a80: 3c00000b ldhu r16,0(r7) - 3a84: 0023883a mov r17,zero - 3a88: 39c00104 addi r7,r7,4 - 3a8c: d9c14015 stw r7,1280(sp) - 3a90: 003efa06 br 367c <___vfprintf_internal_r+0x1134> - 3a94: dc400d17 ldw r17,52(sp) - 3a98: 07000074 movhi fp,1 - 3a9c: e7388784 addi fp,fp,-7650 - 3aa0: 9425883a add r18,r18,r16 - 3aa4: 8c400044 addi r17,r17,1 - 3aa8: 008001c4 movi r2,7 - 3aac: 1f000015 stw fp,0(r3) - 3ab0: 1c000115 stw r16,4(r3) - 3ab4: dc800e15 stw r18,56(sp) - 3ab8: dc400d15 stw r17,52(sp) - 3abc: 147d7016 blt r2,r17,3080 <___vfprintf_internal_r+0xb38> - 3ac0: 18c00204 addi r3,r3,8 - 3ac4: 003d7506 br 309c <___vfprintf_internal_r+0xb54> - 3ac8: dc800e17 ldw r18,56(sp) - 3acc: dc400d17 ldw r17,52(sp) - 3ad0: 07000074 movhi fp,1 - 3ad4: e7388b84 addi fp,fp,-7634 - 3ad8: 003bba06 br 29c4 <___vfprintf_internal_r+0x47c> - 3adc: d9014f17 ldw r4,1340(sp) - 3ae0: b00b883a mov r5,r22 - 3ae4: d9800c04 addi r6,sp,48 - 3ae8: 00024f00 call 24f0 <__sprint_r> - 3aec: 103c4e1e bne r2,zero,2c28 <___vfprintf_internal_r+0x6e0> - 3af0: dc800e17 ldw r18,56(sp) - 3af4: d8c01904 addi r3,sp,100 - 3af8: 003ce306 br 2e88 <___vfprintf_internal_r+0x940> - 3afc: 3c000017 ldw r16,0(r7) - 3b00: 0009883a mov r4,zero - 3b04: 39c00104 addi r7,r7,4 - 3b08: 0023883a mov r17,zero - 3b0c: d9c14015 stw r7,1280(sp) - 3b10: d8000405 stb zero,16(sp) - 3b14: 003d1a06 br 2f80 <___vfprintf_internal_r+0xa38> - 3b18: 38800017 ldw r2,0(r7) - 3b1c: 39c00104 addi r7,r7,4 - 3b20: d9c14015 stw r7,1280(sp) - 3b24: 1023d7fa srai r17,r2,31 - 3b28: 1021883a mov r16,r2 - 3b2c: 003d1206 br 2f78 <___vfprintf_internal_r+0xa30> - 3b30: 3c000017 ldw r16,0(r7) - 3b34: 01000044 movi r4,1 - 3b38: 39c00104 addi r7,r7,4 - 3b3c: 0023883a mov r17,zero - 3b40: d9c14015 stw r7,1280(sp) - 3b44: d8000405 stb zero,16(sp) - 3b48: 003d0d06 br 2f80 <___vfprintf_internal_r+0xa38> - 3b4c: 00800074 movhi r2,1 - 3b50: 10b88704 addi r2,r2,-7652 - 3b54: 94800044 addi r18,r18,1 - 3b58: 8c400044 addi r17,r17,1 - 3b5c: a8800015 stw r2,0(r21) - 3b60: 00c00044 movi r3,1 - 3b64: 008001c4 movi r2,7 - 3b68: a8c00115 stw r3,4(r21) - 3b6c: dc800e15 stw r18,56(sp) - 3b70: dc400d15 stw r17,52(sp) - 3b74: 1440ca16 blt r2,r17,3ea0 <___vfprintf_internal_r+0x1958> - 3b78: a8c00204 addi r3,r21,8 - 3b7c: 2000061e bne r4,zero,3b98 <___vfprintf_internal_r+0x1650> - 3b80: d9414717 ldw r5,1308(sp) - 3b84: 2800041e bne r5,zero,3b98 <___vfprintf_internal_r+0x1650> - 3b88: d9814c17 ldw r6,1328(sp) - 3b8c: 3080004c andi r2,r6,1 - 3b90: 1005003a cmpeq r2,r2,zero - 3b94: 103bea1e bne r2,zero,2b40 <___vfprintf_internal_r+0x5f8> - 3b98: 00800044 movi r2,1 - 3b9c: dc400d17 ldw r17,52(sp) - 3ba0: 18800115 stw r2,4(r3) - 3ba4: d8814917 ldw r2,1316(sp) - 3ba8: 94800044 addi r18,r18,1 - 3bac: 8c400044 addi r17,r17,1 - 3bb0: 18800015 stw r2,0(r3) - 3bb4: 008001c4 movi r2,7 - 3bb8: dc800e15 stw r18,56(sp) - 3bbc: dc400d15 stw r17,52(sp) - 3bc0: 1440ca16 blt r2,r17,3eec <___vfprintf_internal_r+0x19a4> - 3bc4: 18c00204 addi r3,r3,8 - 3bc8: 0121c83a sub r16,zero,r4 - 3bcc: 0400500e bge zero,r16,3d10 <___vfprintf_internal_r+0x17c8> - 3bd0: 00800404 movi r2,16 - 3bd4: 1400800e bge r2,r16,3dd8 <___vfprintf_internal_r+0x1890> - 3bd8: 1027883a mov r19,r2 - 3bdc: 07000074 movhi fp,1 - 3be0: e7388784 addi fp,fp,-7650 - 3be4: 050001c4 movi r20,7 - 3be8: 00000306 br 3bf8 <___vfprintf_internal_r+0x16b0> - 3bec: 18c00204 addi r3,r3,8 - 3bf0: 843ffc04 addi r16,r16,-16 - 3bf4: 9c007a0e bge r19,r16,3de0 <___vfprintf_internal_r+0x1898> - 3bf8: 94800404 addi r18,r18,16 - 3bfc: 8c400044 addi r17,r17,1 - 3c00: 1f000015 stw fp,0(r3) - 3c04: 1cc00115 stw r19,4(r3) - 3c08: dc800e15 stw r18,56(sp) - 3c0c: dc400d15 stw r17,52(sp) - 3c10: a47ff60e bge r20,r17,3bec <___vfprintf_internal_r+0x16a4> - 3c14: d9014f17 ldw r4,1340(sp) - 3c18: b00b883a mov r5,r22 - 3c1c: d9800c04 addi r6,sp,48 - 3c20: 00024f00 call 24f0 <__sprint_r> - 3c24: 103c001e bne r2,zero,2c28 <___vfprintf_internal_r+0x6e0> - 3c28: dc800e17 ldw r18,56(sp) - 3c2c: dc400d17 ldw r17,52(sp) - 3c30: d8c01904 addi r3,sp,100 - 3c34: 003fee06 br 3bf0 <___vfprintf_internal_r+0x16a8> - 3c38: 3c000017 ldw r16,0(r7) - 3c3c: 0023883a mov r17,zero - 3c40: 39c00104 addi r7,r7,4 - 3c44: d9c14015 stw r7,1280(sp) - 3c48: 003e8c06 br 367c <___vfprintf_internal_r+0x1134> - 3c4c: d9401904 addi r5,sp,100 - 3c50: dd000f04 addi r20,sp,60 - 3c54: d9414115 stw r5,1284(sp) - 3c58: d9814417 ldw r6,1296(sp) - 3c5c: 880a973a slli r5,r17,28 - 3c60: 8004d13a srli r2,r16,4 - 3c64: 810003cc andi r4,r16,15 - 3c68: 3109883a add r4,r6,r4 - 3c6c: 2884b03a or r2,r5,r2 - 3c70: 21400003 ldbu r5,0(r4) - 3c74: d9014117 ldw r4,1284(sp) - 3c78: 8806d13a srli r3,r17,4 - 3c7c: 1021883a mov r16,r2 - 3c80: 213fffc4 addi r4,r4,-1 - 3c84: d9014115 stw r4,1284(sp) - 3c88: d9814117 ldw r6,1284(sp) - 3c8c: 10c8b03a or r4,r2,r3 - 3c90: 1823883a mov r17,r3 - 3c94: 31400005 stb r5,0(r6) - 3c98: 203fef1e bne r4,zero,3c58 <___vfprintf_internal_r+0x1710> - 3c9c: 003cc506 br 2fb4 <___vfprintf_internal_r+0xa6c> - 3ca0: 00800c04 movi r2,48 - 3ca4: d98018c4 addi r6,sp,99 - 3ca8: dd000f04 addi r20,sp,60 - 3cac: d88018c5 stb r2,99(sp) - 3cb0: d9814115 stw r6,1284(sp) - 3cb4: 003cbf06 br 2fb4 <___vfprintf_internal_r+0xa6c> - 3cb8: dc400d17 ldw r17,52(sp) - 3cbc: 07000074 movhi fp,1 - 3cc0: e7388b84 addi fp,fp,-7634 - 3cc4: 003bc106 br 2bcc <___vfprintf_internal_r+0x684> - 3cc8: d9414c17 ldw r5,1328(sp) - 3ccc: 2880040c andi r2,r5,16 - 3cd0: 10007c26 beq r2,zero,3ec4 <___vfprintf_internal_r+0x197c> - 3cd4: 38800017 ldw r2,0(r7) - 3cd8: 39c00104 addi r7,r7,4 - 3cdc: d9c14015 stw r7,1280(sp) - 3ce0: d9814b17 ldw r6,1324(sp) - 3ce4: d9c14017 ldw r7,1280(sp) - 3ce8: 11800015 stw r6,0(r2) - 3cec: 003a7206 br 26b8 <___vfprintf_internal_r+0x170> - 3cf0: d9014f17 ldw r4,1340(sp) - 3cf4: b00b883a mov r5,r22 - 3cf8: d9800c04 addi r6,sp,48 - 3cfc: 00024f00 call 24f0 <__sprint_r> - 3d00: 103bc91e bne r2,zero,2c28 <___vfprintf_internal_r+0x6e0> - 3d04: dc800e17 ldw r18,56(sp) - 3d08: dc400d17 ldw r17,52(sp) - 3d0c: d8c01904 addi r3,sp,100 - 3d10: d9014717 ldw r4,1308(sp) - 3d14: d9414117 ldw r5,1284(sp) - 3d18: 8c400044 addi r17,r17,1 - 3d1c: 9125883a add r18,r18,r4 - 3d20: 008001c4 movi r2,7 - 3d24: 19400015 stw r5,0(r3) - 3d28: 19000115 stw r4,4(r3) - 3d2c: dc800e15 stw r18,56(sp) - 3d30: dc400d15 stw r17,52(sp) - 3d34: 147ce816 blt r2,r17,30d8 <___vfprintf_internal_r+0xb90> - 3d38: 18c00204 addi r3,r3,8 - 3d3c: 003b8006 br 2b40 <___vfprintf_internal_r+0x5f8> - 3d40: 38c00017 ldw r3,0(r7) - 3d44: 39000204 addi r4,r7,8 - 3d48: d9014015 stw r4,1280(sp) - 3d4c: d8c14215 stw r3,1288(sp) - 3d50: 39c00117 ldw r7,4(r7) - 3d54: d9c14315 stw r7,1292(sp) - 3d58: 003e1a06 br 35c4 <___vfprintf_internal_r+0x107c> - 3d5c: 0005883a mov r2,zero - 3d60: 1409c83a sub r4,r2,r16 - 3d64: 1105803a cmpltu r2,r2,r4 - 3d68: 044bc83a sub r5,zero,r17 - 3d6c: 2885c83a sub r2,r5,r2 - 3d70: 2021883a mov r16,r4 - 3d74: 1023883a mov r17,r2 - 3d78: 01000044 movi r4,1 - 3d7c: 00800b44 movi r2,45 - 3d80: d8800405 stb r2,16(sp) - 3d84: 003c7e06 br 2f80 <___vfprintf_internal_r+0xa38> - 3d88: d9014f17 ldw r4,1340(sp) - 3d8c: b00b883a mov r5,r22 - 3d90: d9800c04 addi r6,sp,48 - 3d94: 00024f00 call 24f0 <__sprint_r> - 3d98: 103ba31e bne r2,zero,2c28 <___vfprintf_internal_r+0x6e0> - 3d9c: dc800e17 ldw r18,56(sp) - 3da0: dc400d17 ldw r17,52(sp) - 3da4: d9000517 ldw r4,20(sp) - 3da8: d9401904 addi r5,sp,100 - 3dac: 003da106 br 3434 <___vfprintf_internal_r+0xeec> - 3db0: d9014f17 ldw r4,1340(sp) - 3db4: b00b883a mov r5,r22 - 3db8: d9800c04 addi r6,sp,48 - 3dbc: 00024f00 call 24f0 <__sprint_r> - 3dc0: 103b991e bne r2,zero,2c28 <___vfprintf_internal_r+0x6e0> - 3dc4: dc800e17 ldw r18,56(sp) - 3dc8: dc400d17 ldw r17,52(sp) - 3dcc: d9000517 ldw r4,20(sp) - 3dd0: d8c01904 addi r3,sp,100 - 3dd4: 003d8b06 br 3404 <___vfprintf_internal_r+0xebc> - 3dd8: 07000074 movhi fp,1 - 3ddc: e7388784 addi fp,fp,-7650 - 3de0: 9425883a add r18,r18,r16 - 3de4: 8c400044 addi r17,r17,1 - 3de8: 008001c4 movi r2,7 - 3dec: 1f000015 stw fp,0(r3) - 3df0: 1c000115 stw r16,4(r3) - 3df4: dc800e15 stw r18,56(sp) - 3df8: dc400d15 stw r17,52(sp) - 3dfc: 147fbc16 blt r2,r17,3cf0 <___vfprintf_internal_r+0x17a8> - 3e00: 18c00204 addi r3,r3,8 - 3e04: 003fc206 br 3d10 <___vfprintf_internal_r+0x17c8> - 3e08: d9014f17 ldw r4,1340(sp) - 3e0c: b00b883a mov r5,r22 - 3e10: d9800c04 addi r6,sp,48 - 3e14: 00024f00 call 24f0 <__sprint_r> - 3e18: 103b831e bne r2,zero,2c28 <___vfprintf_internal_r+0x6e0> - 3e1c: dc800e17 ldw r18,56(sp) - 3e20: d9000517 ldw r4,20(sp) - 3e24: d8c01904 addi r3,sp,100 - 3e28: 003cfc06 br 321c <___vfprintf_internal_r+0xcd4> - 3e2c: 07000074 movhi fp,1 - 3e30: e7388784 addi fp,fp,-7650 - 3e34: 003bde06 br 2db0 <___vfprintf_internal_r+0x868> - 3e38: 00800074 movhi r2,1 - 3e3c: 10b87604 addi r2,r2,-7720 - 3e40: d8814115 stw r2,1284(sp) - 3e44: 003def06 br 3604 <___vfprintf_internal_r+0x10bc> - 3e48: d9014217 ldw r4,1288(sp) - 3e4c: d9414317 ldw r5,1292(sp) - 3e50: 0007ed00 call 7ed0 <__isnand> - 3e54: 10003926 beq r2,zero,3f3c <___vfprintf_internal_r+0x19f4> - 3e58: d9414d17 ldw r5,1332(sp) - 3e5c: 008011c4 movi r2,71 - 3e60: 1140ce16 blt r2,r5,419c <___vfprintf_internal_r+0x1c54> - 3e64: 01800074 movhi r6,1 - 3e68: 31b87704 addi r6,r6,-7716 - 3e6c: d9814115 stw r6,1284(sp) - 3e70: 003de406 br 3604 <___vfprintf_internal_r+0x10bc> - 3e74: d9014c17 ldw r4,1328(sp) - 3e78: bdc00044 addi r23,r23,1 - 3e7c: b8c00007 ldb r3,0(r23) - 3e80: 21000814 ori r4,r4,32 - 3e84: d9014c15 stw r4,1328(sp) - 3e88: 003a2e06 br 2744 <___vfprintf_internal_r+0x1fc> - 3e8c: dcc14515 stw r19,1300(sp) - 3e90: 98011016 blt r19,zero,42d4 <___vfprintf_internal_r+0x1d8c> - 3e94: 980f883a mov r7,r19 - 3e98: d8014615 stw zero,1304(sp) - 3e9c: 003c4c06 br 2fd0 <___vfprintf_internal_r+0xa88> - 3ea0: d9014f17 ldw r4,1340(sp) - 3ea4: b00b883a mov r5,r22 - 3ea8: d9800c04 addi r6,sp,48 - 3eac: 00024f00 call 24f0 <__sprint_r> - 3eb0: 103b5d1e bne r2,zero,2c28 <___vfprintf_internal_r+0x6e0> - 3eb4: dc800e17 ldw r18,56(sp) - 3eb8: d9000517 ldw r4,20(sp) - 3ebc: d8c01904 addi r3,sp,100 - 3ec0: 003f2e06 br 3b7c <___vfprintf_internal_r+0x1634> - 3ec4: d8c14c17 ldw r3,1328(sp) - 3ec8: 1880100c andi r2,r3,64 - 3ecc: 1000a026 beq r2,zero,4150 <___vfprintf_internal_r+0x1c08> - 3ed0: 38800017 ldw r2,0(r7) - 3ed4: 39c00104 addi r7,r7,4 - 3ed8: d9c14015 stw r7,1280(sp) - 3edc: d9014b17 ldw r4,1324(sp) - 3ee0: d9c14017 ldw r7,1280(sp) - 3ee4: 1100000d sth r4,0(r2) - 3ee8: 0039f306 br 26b8 <___vfprintf_internal_r+0x170> - 3eec: d9014f17 ldw r4,1340(sp) - 3ef0: b00b883a mov r5,r22 - 3ef4: d9800c04 addi r6,sp,48 - 3ef8: 00024f00 call 24f0 <__sprint_r> - 3efc: 103b4a1e bne r2,zero,2c28 <___vfprintf_internal_r+0x6e0> - 3f00: dc800e17 ldw r18,56(sp) - 3f04: dc400d17 ldw r17,52(sp) - 3f08: d9000517 ldw r4,20(sp) - 3f0c: d8c01904 addi r3,sp,100 - 3f10: 003f2d06 br 3bc8 <___vfprintf_internal_r+0x1680> - 3f14: 00800184 movi r2,6 - 3f18: 14c09a36 bltu r2,r19,4184 <___vfprintf_internal_r+0x1c3c> - 3f1c: dcc14515 stw r19,1300(sp) - 3f20: 9800010e bge r19,zero,3f28 <___vfprintf_internal_r+0x19e0> - 3f24: d8014515 stw zero,1300(sp) - 3f28: 00800074 movhi r2,1 - 3f2c: 10b87904 addi r2,r2,-7708 - 3f30: 980f883a mov r7,r19 - 3f34: d8814115 stw r2,1284(sp) - 3f38: 003a7206 br 2904 <___vfprintf_internal_r+0x3bc> - 3f3c: 00bfffc4 movi r2,-1 - 3f40: 9880e226 beq r19,r2,42cc <___vfprintf_internal_r+0x1d84> - 3f44: d9414d17 ldw r5,1332(sp) - 3f48: 008019c4 movi r2,103 - 3f4c: 2880dc26 beq r5,r2,42c0 <___vfprintf_internal_r+0x1d78> - 3f50: 008011c4 movi r2,71 - 3f54: 2880da26 beq r5,r2,42c0 <___vfprintf_internal_r+0x1d78> - 3f58: d9414c17 ldw r5,1328(sp) - 3f5c: d9014317 ldw r4,1292(sp) - 3f60: d9814217 ldw r6,1288(sp) - 3f64: 29404014 ori r5,r5,256 - 3f68: d9414c15 stw r5,1328(sp) - 3f6c: 2000cc16 blt r4,zero,42a0 <___vfprintf_internal_r+0x1d58> - 3f70: 3021883a mov r16,r6 - 3f74: 2023883a mov r17,r4 - 3f78: 0039883a mov fp,zero - 3f7c: d9414d17 ldw r5,1332(sp) - 3f80: 00801984 movi r2,102 - 3f84: 2880b726 beq r5,r2,4264 <___vfprintf_internal_r+0x1d1c> - 3f88: 00801184 movi r2,70 - 3f8c: 2880b526 beq r5,r2,4264 <___vfprintf_internal_r+0x1d1c> - 3f90: 00801944 movi r2,101 - 3f94: 2880c826 beq r5,r2,42b8 <___vfprintf_internal_r+0x1d70> - 3f98: 00801144 movi r2,69 - 3f9c: 2880c626 beq r5,r2,42b8 <___vfprintf_internal_r+0x1d70> - 3fa0: 9829883a mov r20,r19 - 3fa4: d9014f17 ldw r4,1340(sp) - 3fa8: d8800504 addi r2,sp,20 - 3fac: 880d883a mov r6,r17 - 3fb0: d8800115 stw r2,4(sp) - 3fb4: d8c00604 addi r3,sp,24 - 3fb8: d8800704 addi r2,sp,28 - 3fbc: 800b883a mov r5,r16 - 3fc0: 01c00084 movi r7,2 - 3fc4: d8c00215 stw r3,8(sp) - 3fc8: d8800315 stw r2,12(sp) - 3fcc: dd000015 stw r20,0(sp) - 3fd0: 00048980 call 4898 <_dtoa_r> - 3fd4: d9814d17 ldw r6,1332(sp) - 3fd8: d8814115 stw r2,1284(sp) - 3fdc: 008019c4 movi r2,103 - 3fe0: 30809526 beq r6,r2,4238 <___vfprintf_internal_r+0x1cf0> - 3fe4: d8c14d17 ldw r3,1332(sp) - 3fe8: 008011c4 movi r2,71 - 3fec: 18809226 beq r3,r2,4238 <___vfprintf_internal_r+0x1cf0> - 3ff0: d9414117 ldw r5,1284(sp) - 3ff4: d9814d17 ldw r6,1332(sp) - 3ff8: 00801984 movi r2,102 - 3ffc: 2d25883a add r18,r5,r20 - 4000: 30808626 beq r6,r2,421c <___vfprintf_internal_r+0x1cd4> - 4004: 00801184 movi r2,70 - 4008: 30808426 beq r6,r2,421c <___vfprintf_internal_r+0x1cd4> - 400c: 000d883a mov r6,zero - 4010: 000f883a mov r7,zero - 4014: 880b883a mov r5,r17 - 4018: 8009883a mov r4,r16 - 401c: 00098700 call 9870 <__eqdf2> - 4020: 1000751e bne r2,zero,41f8 <___vfprintf_internal_r+0x1cb0> - 4024: 9005883a mov r2,r18 - 4028: dc800715 stw r18,28(sp) - 402c: d9014117 ldw r4,1284(sp) - 4030: d9414d17 ldw r5,1332(sp) - 4034: 00c019c4 movi r3,103 - 4038: 1125c83a sub r18,r2,r4 - 403c: 28c06826 beq r5,r3,41e0 <___vfprintf_internal_r+0x1c98> - 4040: 008011c4 movi r2,71 - 4044: 28806626 beq r5,r2,41e0 <___vfprintf_internal_r+0x1c98> - 4048: d9000517 ldw r4,20(sp) - 404c: d8c14d17 ldw r3,1332(sp) - 4050: 00801944 movi r2,101 - 4054: 10c05516 blt r2,r3,41ac <___vfprintf_internal_r+0x1c64> - 4058: 213fffc4 addi r4,r4,-1 - 405c: d9000515 stw r4,20(sp) - 4060: d8c00805 stb r3,32(sp) - 4064: 2021883a mov r16,r4 - 4068: 2000c116 blt r4,zero,4370 <___vfprintf_internal_r+0x1e28> - 406c: 00800ac4 movi r2,43 - 4070: d8800845 stb r2,33(sp) - 4074: 00800244 movi r2,9 - 4078: 1400af0e bge r2,r16,4338 <___vfprintf_internal_r+0x1df0> - 407c: 1027883a mov r19,r2 - 4080: dc400b84 addi r17,sp,46 - 4084: 8009883a mov r4,r16 - 4088: 01400284 movi r5,10 - 408c: 0009f580 call 9f58 <__modsi3> - 4090: 10800c04 addi r2,r2,48 - 4094: 8c7fffc4 addi r17,r17,-1 - 4098: 8009883a mov r4,r16 - 409c: 01400284 movi r5,10 - 40a0: 88800005 stb r2,0(r17) - 40a4: 0009ef80 call 9ef8 <__divsi3> - 40a8: 1021883a mov r16,r2 - 40ac: 98bff516 blt r19,r2,4084 <___vfprintf_internal_r+0x1b3c> - 40b0: 10c00c04 addi r3,r2,48 - 40b4: d88009c4 addi r2,sp,39 - 40b8: 108001c4 addi r2,r2,7 - 40bc: 897fffc4 addi r5,r17,-1 - 40c0: 88ffffc5 stb r3,-1(r17) - 40c4: 2880a72e bgeu r5,r2,4364 <___vfprintf_internal_r+0x1e1c> - 40c8: 1009883a mov r4,r2 - 40cc: d9800804 addi r6,sp,32 - 40d0: d8c00884 addi r3,sp,34 - 40d4: 28800003 ldbu r2,0(r5) - 40d8: 29400044 addi r5,r5,1 - 40dc: 18800005 stb r2,0(r3) - 40e0: 18c00044 addi r3,r3,1 - 40e4: 293ffb36 bltu r5,r4,40d4 <___vfprintf_internal_r+0x1b8c> - 40e8: 1987c83a sub r3,r3,r6 - 40ec: 00800044 movi r2,1 - 40f0: d8c14815 stw r3,1312(sp) - 40f4: 90cf883a add r7,r18,r3 - 40f8: 1480960e bge r2,r18,4354 <___vfprintf_internal_r+0x1e0c> - 40fc: 39c00044 addi r7,r7,1 - 4100: d9c14515 stw r7,1300(sp) - 4104: 38003416 blt r7,zero,41d8 <___vfprintf_internal_r+0x1c90> - 4108: e0803fcc andi r2,fp,255 - 410c: 1080201c xori r2,r2,128 - 4110: 10bfe004 addi r2,r2,-128 - 4114: 10004e26 beq r2,zero,4250 <___vfprintf_internal_r+0x1d08> - 4118: 00800b44 movi r2,45 - 411c: dc814715 stw r18,1308(sp) - 4120: d8014615 stw zero,1304(sp) - 4124: d8800405 stb r2,16(sp) - 4128: 003bab06 br 2fd8 <___vfprintf_internal_r+0xa90> - 412c: 00800b44 movi r2,45 - 4130: d8800405 stb r2,16(sp) - 4134: 003d2d06 br 35ec <___vfprintf_internal_r+0x10a4> - 4138: d9014f17 ldw r4,1340(sp) - 413c: b00b883a mov r5,r22 - 4140: d9800c04 addi r6,sp,48 - 4144: 00024f00 call 24f0 <__sprint_r> - 4148: 103ab71e bne r2,zero,2c28 <___vfprintf_internal_r+0x6e0> - 414c: 003ab506 br 2c24 <___vfprintf_internal_r+0x6dc> - 4150: 38800017 ldw r2,0(r7) - 4154: 39c00104 addi r7,r7,4 - 4158: d9c14015 stw r7,1280(sp) - 415c: d9414b17 ldw r5,1324(sp) - 4160: d9c14017 ldw r7,1280(sp) - 4164: 11400015 stw r5,0(r2) - 4168: 00395306 br 26b8 <___vfprintf_internal_r+0x170> - 416c: 980f883a mov r7,r19 - 4170: dcc14515 stw r19,1300(sp) - 4174: d8014615 stw zero,1304(sp) - 4178: 003b9506 br 2fd0 <___vfprintf_internal_r+0xa88> - 417c: 0027883a mov r19,zero - 4180: 00397206 br 274c <___vfprintf_internal_r+0x204> - 4184: 00c00074 movhi r3,1 - 4188: 18f87904 addi r3,r3,-7708 - 418c: 100f883a mov r7,r2 - 4190: d8814515 stw r2,1300(sp) - 4194: d8c14115 stw r3,1284(sp) - 4198: 0039da06 br 2904 <___vfprintf_internal_r+0x3bc> - 419c: 00800074 movhi r2,1 - 41a0: 10b87804 addi r2,r2,-7712 - 41a4: d8814115 stw r2,1284(sp) - 41a8: 003d1606 br 3604 <___vfprintf_internal_r+0x10bc> - 41ac: d9414d17 ldw r5,1332(sp) - 41b0: 00801984 movi r2,102 - 41b4: 28804926 beq r5,r2,42dc <___vfprintf_internal_r+0x1d94> - 41b8: 200f883a mov r7,r4 - 41bc: 24805716 blt r4,r18,431c <___vfprintf_internal_r+0x1dd4> - 41c0: d9414c17 ldw r5,1328(sp) - 41c4: 2880004c andi r2,r5,1 - 41c8: 10000126 beq r2,zero,41d0 <___vfprintf_internal_r+0x1c88> - 41cc: 21c00044 addi r7,r4,1 - 41d0: d9c14515 stw r7,1300(sp) - 41d4: 383fcc0e bge r7,zero,4108 <___vfprintf_internal_r+0x1bc0> - 41d8: d8014515 stw zero,1300(sp) - 41dc: 003fca06 br 4108 <___vfprintf_internal_r+0x1bc0> - 41e0: d9000517 ldw r4,20(sp) - 41e4: 00bfff04 movi r2,-4 - 41e8: 1100480e bge r2,r4,430c <___vfprintf_internal_r+0x1dc4> - 41ec: 99004716 blt r19,r4,430c <___vfprintf_internal_r+0x1dc4> - 41f0: d8c14d15 stw r3,1332(sp) - 41f4: 003ff006 br 41b8 <___vfprintf_internal_r+0x1c70> - 41f8: d8800717 ldw r2,28(sp) - 41fc: 14bf8b2e bgeu r2,r18,402c <___vfprintf_internal_r+0x1ae4> - 4200: 9007883a mov r3,r18 - 4204: 01000c04 movi r4,48 - 4208: 11000005 stb r4,0(r2) - 420c: 10800044 addi r2,r2,1 - 4210: d8800715 stw r2,28(sp) - 4214: 18bffc1e bne r3,r2,4208 <___vfprintf_internal_r+0x1cc0> - 4218: 003f8406 br 402c <___vfprintf_internal_r+0x1ae4> - 421c: d8814117 ldw r2,1284(sp) - 4220: 10c00007 ldb r3,0(r2) - 4224: 00800c04 movi r2,48 - 4228: 18805b26 beq r3,r2,4398 <___vfprintf_internal_r+0x1e50> - 422c: d9000517 ldw r4,20(sp) - 4230: 9125883a add r18,r18,r4 - 4234: 003f7506 br 400c <___vfprintf_internal_r+0x1ac4> - 4238: d9014c17 ldw r4,1328(sp) - 423c: 2080004c andi r2,r4,1 - 4240: 1005003a cmpeq r2,r2,zero - 4244: 103f6a26 beq r2,zero,3ff0 <___vfprintf_internal_r+0x1aa8> - 4248: d8800717 ldw r2,28(sp) - 424c: 003f7706 br 402c <___vfprintf_internal_r+0x1ae4> - 4250: d9c14515 stw r7,1300(sp) - 4254: 38004d16 blt r7,zero,438c <___vfprintf_internal_r+0x1e44> - 4258: dc814715 stw r18,1308(sp) - 425c: d8014615 stw zero,1304(sp) - 4260: 003b5b06 br 2fd0 <___vfprintf_internal_r+0xa88> - 4264: d9014f17 ldw r4,1340(sp) - 4268: d8800504 addi r2,sp,20 - 426c: d8800115 stw r2,4(sp) - 4270: d8c00604 addi r3,sp,24 - 4274: d8800704 addi r2,sp,28 - 4278: 800b883a mov r5,r16 - 427c: 880d883a mov r6,r17 - 4280: 01c000c4 movi r7,3 - 4284: d8c00215 stw r3,8(sp) - 4288: d8800315 stw r2,12(sp) - 428c: dcc00015 stw r19,0(sp) - 4290: 9829883a mov r20,r19 - 4294: 00048980 call 4898 <_dtoa_r> - 4298: d8814115 stw r2,1284(sp) - 429c: 003f5106 br 3fe4 <___vfprintf_internal_r+0x1a9c> - 42a0: d8c14217 ldw r3,1288(sp) - 42a4: d9014317 ldw r4,1292(sp) - 42a8: 07000b44 movi fp,45 - 42ac: 1821883a mov r16,r3 - 42b0: 2460003c xorhi r17,r4,32768 - 42b4: 003f3106 br 3f7c <___vfprintf_internal_r+0x1a34> - 42b8: 9d000044 addi r20,r19,1 - 42bc: 003f3906 br 3fa4 <___vfprintf_internal_r+0x1a5c> - 42c0: 983f251e bne r19,zero,3f58 <___vfprintf_internal_r+0x1a10> - 42c4: 04c00044 movi r19,1 - 42c8: 003f2306 br 3f58 <___vfprintf_internal_r+0x1a10> - 42cc: 04c00184 movi r19,6 - 42d0: 003f2106 br 3f58 <___vfprintf_internal_r+0x1a10> - 42d4: d8014515 stw zero,1300(sp) - 42d8: 003eee06 br 3e94 <___vfprintf_internal_r+0x194c> - 42dc: 200f883a mov r7,r4 - 42e0: 0100370e bge zero,r4,43c0 <___vfprintf_internal_r+0x1e78> - 42e4: 9800031e bne r19,zero,42f4 <___vfprintf_internal_r+0x1dac> - 42e8: d9814c17 ldw r6,1328(sp) - 42ec: 3080004c andi r2,r6,1 - 42f0: 103fb726 beq r2,zero,41d0 <___vfprintf_internal_r+0x1c88> - 42f4: 20800044 addi r2,r4,1 - 42f8: 98a7883a add r19,r19,r2 - 42fc: dcc14515 stw r19,1300(sp) - 4300: 980f883a mov r7,r19 - 4304: 983f800e bge r19,zero,4108 <___vfprintf_internal_r+0x1bc0> - 4308: 003fb306 br 41d8 <___vfprintf_internal_r+0x1c90> - 430c: d9814d17 ldw r6,1332(sp) - 4310: 31bfff84 addi r6,r6,-2 - 4314: d9814d15 stw r6,1332(sp) - 4318: 003f4c06 br 404c <___vfprintf_internal_r+0x1b04> - 431c: 0100180e bge zero,r4,4380 <___vfprintf_internal_r+0x1e38> - 4320: 00800044 movi r2,1 - 4324: 1485883a add r2,r2,r18 - 4328: d8814515 stw r2,1300(sp) - 432c: 100f883a mov r7,r2 - 4330: 103f750e bge r2,zero,4108 <___vfprintf_internal_r+0x1bc0> - 4334: 003fa806 br 41d8 <___vfprintf_internal_r+0x1c90> - 4338: 80c00c04 addi r3,r16,48 - 433c: 00800c04 movi r2,48 - 4340: d8c008c5 stb r3,35(sp) - 4344: d9800804 addi r6,sp,32 - 4348: d8c00904 addi r3,sp,36 - 434c: d8800885 stb r2,34(sp) - 4350: 003f6506 br 40e8 <___vfprintf_internal_r+0x1ba0> - 4354: d9014c17 ldw r4,1328(sp) - 4358: 2084703a and r2,r4,r2 - 435c: 103f9c26 beq r2,zero,41d0 <___vfprintf_internal_r+0x1c88> - 4360: 003f6606 br 40fc <___vfprintf_internal_r+0x1bb4> - 4364: d9800804 addi r6,sp,32 - 4368: d8c00884 addi r3,sp,34 - 436c: 003f5e06 br 40e8 <___vfprintf_internal_r+0x1ba0> - 4370: 00800b44 movi r2,45 - 4374: 0121c83a sub r16,zero,r4 - 4378: d8800845 stb r2,33(sp) - 437c: 003f3d06 br 4074 <___vfprintf_internal_r+0x1b2c> - 4380: 00800084 movi r2,2 - 4384: 1105c83a sub r2,r2,r4 - 4388: 003fe606 br 4324 <___vfprintf_internal_r+0x1ddc> - 438c: d8014515 stw zero,1300(sp) - 4390: dc814715 stw r18,1308(sp) - 4394: 003fb106 br 425c <___vfprintf_internal_r+0x1d14> - 4398: 000d883a mov r6,zero - 439c: 000f883a mov r7,zero - 43a0: 8009883a mov r4,r16 - 43a4: 880b883a mov r5,r17 - 43a8: 00098f80 call 98f8 <__nedf2> - 43ac: 103f9f26 beq r2,zero,422c <___vfprintf_internal_r+0x1ce4> - 43b0: 00800044 movi r2,1 - 43b4: 1509c83a sub r4,r2,r20 - 43b8: d9000515 stw r4,20(sp) - 43bc: 003f9b06 br 422c <___vfprintf_internal_r+0x1ce4> - 43c0: 98000d1e bne r19,zero,43f8 <___vfprintf_internal_r+0x1eb0> - 43c4: d8c14c17 ldw r3,1328(sp) - 43c8: 1880004c andi r2,r3,1 - 43cc: 10000a1e bne r2,zero,43f8 <___vfprintf_internal_r+0x1eb0> - 43d0: 01000044 movi r4,1 - 43d4: 200f883a mov r7,r4 - 43d8: d9014515 stw r4,1300(sp) - 43dc: 003f4a06 br 4108 <___vfprintf_internal_r+0x1bc0> - 43e0: 3cc00017 ldw r19,0(r7) - 43e4: 39c00104 addi r7,r7,4 - 43e8: 983d0e0e bge r19,zero,3824 <___vfprintf_internal_r+0x12dc> - 43ec: b8c00007 ldb r3,0(r23) - 43f0: 04ffffc4 movi r19,-1 - 43f4: 0038d306 br 2744 <___vfprintf_internal_r+0x1fc> - 43f8: 9cc00084 addi r19,r19,2 - 43fc: dcc14515 stw r19,1300(sp) - 4400: 980f883a mov r7,r19 - 4404: 983f400e bge r19,zero,4108 <___vfprintf_internal_r+0x1bc0> - 4408: 003f7306 br 41d8 <___vfprintf_internal_r+0x1c90> - -0000440c <__vfprintf_internal>: - 440c: 00800074 movhi r2,1 - 4410: 1080b204 addi r2,r2,712 - 4414: 2013883a mov r9,r4 - 4418: 11000017 ldw r4,0(r2) - 441c: 2805883a mov r2,r5 - 4420: 300f883a mov r7,r6 - 4424: 480b883a mov r5,r9 - 4428: 100d883a mov r6,r2 - 442c: 00025481 jmpi 2548 <___vfprintf_internal_r> - -00004430 <_write_r>: - 4430: defffd04 addi sp,sp,-12 - 4434: dc000015 stw r16,0(sp) - 4438: 04000074 movhi r16,1 - 443c: 8407a504 addi r16,r16,7828 - 4440: dc400115 stw r17,4(sp) - 4444: 80000015 stw zero,0(r16) - 4448: 2023883a mov r17,r4 - 444c: 2809883a mov r4,r5 - 4450: 300b883a mov r5,r6 - 4454: 380d883a mov r6,r7 - 4458: dfc00215 stw ra,8(sp) - 445c: 000b3280 call b328 - 4460: 1007883a mov r3,r2 - 4464: 00bfffc4 movi r2,-1 - 4468: 18800626 beq r3,r2,4484 <_write_r+0x54> - 446c: 1805883a mov r2,r3 - 4470: dfc00217 ldw ra,8(sp) - 4474: dc400117 ldw r17,4(sp) - 4478: dc000017 ldw r16,0(sp) - 447c: dec00304 addi sp,sp,12 - 4480: f800283a ret - 4484: 80800017 ldw r2,0(r16) - 4488: 103ff826 beq r2,zero,446c <_write_r+0x3c> - 448c: 88800015 stw r2,0(r17) - 4490: 1805883a mov r2,r3 - 4494: dfc00217 ldw ra,8(sp) - 4498: dc400117 ldw r17,4(sp) - 449c: dc000017 ldw r16,0(sp) - 44a0: dec00304 addi sp,sp,12 - 44a4: f800283a ret - -000044a8 <__swsetup_r>: - 44a8: 00800074 movhi r2,1 - 44ac: 1080b204 addi r2,r2,712 - 44b0: 10c00017 ldw r3,0(r2) - 44b4: defffd04 addi sp,sp,-12 - 44b8: dc400115 stw r17,4(sp) - 44bc: dc000015 stw r16,0(sp) - 44c0: dfc00215 stw ra,8(sp) - 44c4: 2023883a mov r17,r4 - 44c8: 2821883a mov r16,r5 - 44cc: 18000226 beq r3,zero,44d8 <__swsetup_r+0x30> - 44d0: 18800e17 ldw r2,56(r3) - 44d4: 10001f26 beq r2,zero,4554 <__swsetup_r+0xac> - 44d8: 8100030b ldhu r4,12(r16) - 44dc: 2080020c andi r2,r4,8 - 44e0: 10002826 beq r2,zero,4584 <__swsetup_r+0xdc> - 44e4: 81400417 ldw r5,16(r16) - 44e8: 28001d26 beq r5,zero,4560 <__swsetup_r+0xb8> - 44ec: 2080004c andi r2,r4,1 - 44f0: 1005003a cmpeq r2,r2,zero - 44f4: 10000b26 beq r2,zero,4524 <__swsetup_r+0x7c> - 44f8: 2080008c andi r2,r4,2 - 44fc: 10001226 beq r2,zero,4548 <__swsetup_r+0xa0> - 4500: 0005883a mov r2,zero - 4504: 80800215 stw r2,8(r16) - 4508: 28000b26 beq r5,zero,4538 <__swsetup_r+0x90> - 450c: 0005883a mov r2,zero - 4510: dfc00217 ldw ra,8(sp) - 4514: dc400117 ldw r17,4(sp) - 4518: dc000017 ldw r16,0(sp) - 451c: dec00304 addi sp,sp,12 - 4520: f800283a ret - 4524: 80800517 ldw r2,20(r16) - 4528: 80000215 stw zero,8(r16) - 452c: 0085c83a sub r2,zero,r2 - 4530: 80800615 stw r2,24(r16) - 4534: 283ff51e bne r5,zero,450c <__swsetup_r+0x64> - 4538: 2080200c andi r2,r4,128 - 453c: 103ff326 beq r2,zero,450c <__swsetup_r+0x64> - 4540: 00bfffc4 movi r2,-1 - 4544: 003ff206 br 4510 <__swsetup_r+0x68> - 4548: 80800517 ldw r2,20(r16) - 454c: 80800215 stw r2,8(r16) - 4550: 003fed06 br 4508 <__swsetup_r+0x60> - 4554: 1809883a mov r4,r3 - 4558: 00006b40 call 6b4 <__sinit> - 455c: 003fde06 br 44d8 <__swsetup_r+0x30> - 4560: 20c0a00c andi r3,r4,640 - 4564: 00808004 movi r2,512 - 4568: 18bfe026 beq r3,r2,44ec <__swsetup_r+0x44> - 456c: 8809883a mov r4,r17 - 4570: 800b883a mov r5,r16 - 4574: 00015d00 call 15d0 <__smakebuf_r> - 4578: 8100030b ldhu r4,12(r16) - 457c: 81400417 ldw r5,16(r16) - 4580: 003fda06 br 44ec <__swsetup_r+0x44> - 4584: 2080040c andi r2,r4,16 - 4588: 103fed26 beq r2,zero,4540 <__swsetup_r+0x98> - 458c: 2080010c andi r2,r4,4 - 4590: 10001226 beq r2,zero,45dc <__swsetup_r+0x134> - 4594: 81400c17 ldw r5,48(r16) - 4598: 28000526 beq r5,zero,45b0 <__swsetup_r+0x108> - 459c: 80801004 addi r2,r16,64 - 45a0: 28800226 beq r5,r2,45ac <__swsetup_r+0x104> - 45a4: 8809883a mov r4,r17 - 45a8: 0000b7c0 call b7c <_free_r> - 45ac: 80000c15 stw zero,48(r16) - 45b0: 8080030b ldhu r2,12(r16) - 45b4: 81400417 ldw r5,16(r16) - 45b8: 80000115 stw zero,4(r16) - 45bc: 10bff6cc andi r2,r2,65499 - 45c0: 8080030d sth r2,12(r16) - 45c4: 81400015 stw r5,0(r16) - 45c8: 8080030b ldhu r2,12(r16) - 45cc: 10800214 ori r2,r2,8 - 45d0: 113fffcc andi r4,r2,65535 - 45d4: 8080030d sth r2,12(r16) - 45d8: 003fc306 br 44e8 <__swsetup_r+0x40> - 45dc: 81400417 ldw r5,16(r16) - 45e0: 003ff906 br 45c8 <__swsetup_r+0x120> - -000045e4 <_close_r>: - 45e4: defffd04 addi sp,sp,-12 - 45e8: dc000015 stw r16,0(sp) - 45ec: 04000074 movhi r16,1 - 45f0: 8407a504 addi r16,r16,7828 - 45f4: dc400115 stw r17,4(sp) - 45f8: 80000015 stw zero,0(r16) - 45fc: 2023883a mov r17,r4 - 4600: 2809883a mov r4,r5 - 4604: dfc00215 stw ra,8(sp) - 4608: 000a6b80 call a6b8 - 460c: 1007883a mov r3,r2 - 4610: 00bfffc4 movi r2,-1 - 4614: 18800626 beq r3,r2,4630 <_close_r+0x4c> - 4618: 1805883a mov r2,r3 - 461c: dfc00217 ldw ra,8(sp) - 4620: dc400117 ldw r17,4(sp) - 4624: dc000017 ldw r16,0(sp) - 4628: dec00304 addi sp,sp,12 - 462c: f800283a ret - 4630: 80800017 ldw r2,0(r16) - 4634: 103ff826 beq r2,zero,4618 <_close_r+0x34> - 4638: 88800015 stw r2,0(r17) - 463c: 1805883a mov r2,r3 - 4640: dfc00217 ldw ra,8(sp) - 4644: dc400117 ldw r17,4(sp) - 4648: dc000017 ldw r16,0(sp) - 464c: dec00304 addi sp,sp,12 - 4650: f800283a ret - -00004654 : - 4654: 28c00417 ldw r3,16(r5) - 4658: 20800417 ldw r2,16(r4) - 465c: defff104 addi sp,sp,-60 - 4660: dfc00e15 stw ra,56(sp) - 4664: df000d15 stw fp,52(sp) - 4668: ddc00c15 stw r23,48(sp) - 466c: dd800b15 stw r22,44(sp) - 4670: dd400a15 stw r21,40(sp) - 4674: dd000915 stw r20,36(sp) - 4678: dcc00815 stw r19,32(sp) - 467c: dc800715 stw r18,28(sp) - 4680: dc400615 stw r17,24(sp) - 4684: dc000515 stw r16,20(sp) - 4688: d9000315 stw r4,12(sp) - 468c: d9400415 stw r5,16(sp) - 4690: 10c07f16 blt r2,r3,4890 - 4694: 1d3fffc4 addi r20,r3,-1 - 4698: d8c00417 ldw r3,16(sp) - 469c: d9000317 ldw r4,12(sp) - 46a0: a505883a add r2,r20,r20 - 46a4: 1085883a add r2,r2,r2 - 46a8: 1cc00504 addi r19,r3,20 - 46ac: 25c00504 addi r23,r4,20 - 46b0: 98ad883a add r22,r19,r2 - 46b4: 15c7883a add r3,r2,r23 - 46b8: b1400017 ldw r5,0(r22) - 46bc: 19000017 ldw r4,0(r3) - 46c0: d8c00015 stw r3,0(sp) - 46c4: 29400044 addi r5,r5,1 - 46c8: d9000215 stw r4,8(sp) - 46cc: 0009fb80 call 9fb8 <__udivsi3> - 46d0: 1039883a mov fp,r2 - 46d4: 10003d1e bne r2,zero,47cc - 46d8: d9400417 ldw r5,16(sp) - 46dc: d9000317 ldw r4,12(sp) - 46e0: 00068f40 call 68f4 <__mcmp> - 46e4: 10002c16 blt r2,zero,4798 - 46e8: e7000044 addi fp,fp,1 - 46ec: b80f883a mov r7,r23 - 46f0: 0011883a mov r8,zero - 46f4: 0009883a mov r4,zero - 46f8: 99400017 ldw r5,0(r19) - 46fc: 38c00017 ldw r3,0(r7) - 4700: 9cc00104 addi r19,r19,4 - 4704: 28bfffcc andi r2,r5,65535 - 4708: 2085883a add r2,r4,r2 - 470c: 11bfffcc andi r6,r2,65535 - 4710: 193fffcc andi r4,r3,65535 - 4714: 1004d43a srli r2,r2,16 - 4718: 280ad43a srli r5,r5,16 - 471c: 2189c83a sub r4,r4,r6 - 4720: 2209883a add r4,r4,r8 - 4724: 1806d43a srli r3,r3,16 - 4728: 288b883a add r5,r5,r2 - 472c: 200dd43a srai r6,r4,16 - 4730: 28bfffcc andi r2,r5,65535 - 4734: 1887c83a sub r3,r3,r2 - 4738: 1987883a add r3,r3,r6 - 473c: 3900000d sth r4,0(r7) - 4740: 38c0008d sth r3,2(r7) - 4744: 2808d43a srli r4,r5,16 - 4748: 39c00104 addi r7,r7,4 - 474c: 1811d43a srai r8,r3,16 - 4750: b4ffe92e bgeu r22,r19,46f8 - 4754: a505883a add r2,r20,r20 - 4758: 1085883a add r2,r2,r2 - 475c: b885883a add r2,r23,r2 - 4760: 10c00017 ldw r3,0(r2) - 4764: 18000c1e bne r3,zero,4798 - 4768: 113fff04 addi r4,r2,-4 - 476c: b900082e bgeu r23,r4,4790 - 4770: 10bfff17 ldw r2,-4(r2) - 4774: 10000326 beq r2,zero,4784 - 4778: 00000506 br 4790 - 477c: 20800017 ldw r2,0(r4) - 4780: 1000031e bne r2,zero,4790 - 4784: 213fff04 addi r4,r4,-4 - 4788: a53fffc4 addi r20,r20,-1 - 478c: b93ffb36 bltu r23,r4,477c - 4790: d9000317 ldw r4,12(sp) - 4794: 25000415 stw r20,16(r4) - 4798: e005883a mov r2,fp - 479c: dfc00e17 ldw ra,56(sp) - 47a0: df000d17 ldw fp,52(sp) - 47a4: ddc00c17 ldw r23,48(sp) - 47a8: dd800b17 ldw r22,44(sp) - 47ac: dd400a17 ldw r21,40(sp) - 47b0: dd000917 ldw r20,36(sp) - 47b4: dcc00817 ldw r19,32(sp) - 47b8: dc800717 ldw r18,28(sp) - 47bc: dc400617 ldw r17,24(sp) - 47c0: dc000517 ldw r16,20(sp) - 47c4: dec00f04 addi sp,sp,60 - 47c8: f800283a ret - 47cc: b823883a mov r17,r23 - 47d0: 9825883a mov r18,r19 - 47d4: d8000115 stw zero,4(sp) - 47d8: 002b883a mov r21,zero - 47dc: 94000017 ldw r16,0(r18) - 47e0: e009883a mov r4,fp - 47e4: 94800104 addi r18,r18,4 - 47e8: 817fffcc andi r5,r16,65535 - 47ec: 0009fc80 call 9fc8 <__mulsi3> - 47f0: 800ad43a srli r5,r16,16 - 47f4: e009883a mov r4,fp - 47f8: a8a1883a add r16,r21,r2 - 47fc: 0009fc80 call 9fc8 <__mulsi3> - 4800: 89000017 ldw r4,0(r17) - 4804: 80ffffcc andi r3,r16,65535 - 4808: 8020d43a srli r16,r16,16 - 480c: 217fffcc andi r5,r4,65535 - 4810: 28cbc83a sub r5,r5,r3 - 4814: d8c00117 ldw r3,4(sp) - 4818: 2008d43a srli r4,r4,16 - 481c: 1405883a add r2,r2,r16 - 4820: 28cb883a add r5,r5,r3 - 4824: 280dd43a srai r6,r5,16 - 4828: 10ffffcc andi r3,r2,65535 - 482c: 20c9c83a sub r4,r4,r3 - 4830: 2189883a add r4,r4,r6 - 4834: 8900008d sth r4,2(r17) - 4838: 2009d43a srai r4,r4,16 - 483c: 8940000d sth r5,0(r17) - 4840: 102ad43a srli r21,r2,16 - 4844: 8c400104 addi r17,r17,4 - 4848: d9000115 stw r4,4(sp) - 484c: b4bfe32e bgeu r22,r18,47dc - 4850: d9000217 ldw r4,8(sp) - 4854: 203fa01e bne r4,zero,46d8 - 4858: d8800017 ldw r2,0(sp) - 485c: 10ffff04 addi r3,r2,-4 - 4860: b8c0082e bgeu r23,r3,4884 - 4864: 10bfff17 ldw r2,-4(r2) - 4868: 10000326 beq r2,zero,4878 - 486c: 00000506 br 4884 - 4870: 18800017 ldw r2,0(r3) - 4874: 1000031e bne r2,zero,4884 - 4878: 18ffff04 addi r3,r3,-4 - 487c: a53fffc4 addi r20,r20,-1 - 4880: b8fffb36 bltu r23,r3,4870 - 4884: d8c00317 ldw r3,12(sp) - 4888: 1d000415 stw r20,16(r3) - 488c: 003f9206 br 46d8 - 4890: 0005883a mov r2,zero - 4894: 003fc106 br 479c - -00004898 <_dtoa_r>: - 4898: 22001017 ldw r8,64(r4) - 489c: deffda04 addi sp,sp,-152 - 48a0: dd402115 stw r21,132(sp) - 48a4: dd002015 stw r20,128(sp) - 48a8: dc801e15 stw r18,120(sp) - 48ac: dc401d15 stw r17,116(sp) - 48b0: dfc02515 stw ra,148(sp) - 48b4: df002415 stw fp,144(sp) - 48b8: ddc02315 stw r23,140(sp) - 48bc: dd802215 stw r22,136(sp) - 48c0: dcc01f15 stw r19,124(sp) - 48c4: dc001c15 stw r16,112(sp) - 48c8: d9001615 stw r4,88(sp) - 48cc: 3023883a mov r17,r6 - 48d0: 2829883a mov r20,r5 - 48d4: d9c01715 stw r7,92(sp) - 48d8: dc802817 ldw r18,160(sp) - 48dc: 302b883a mov r21,r6 - 48e0: 40000a26 beq r8,zero,490c <_dtoa_r+0x74> - 48e4: 20801117 ldw r2,68(r4) - 48e8: 400b883a mov r5,r8 - 48ec: 40800115 stw r2,4(r8) - 48f0: 20c01117 ldw r3,68(r4) - 48f4: 00800044 movi r2,1 - 48f8: 10c4983a sll r2,r2,r3 - 48fc: 40800215 stw r2,8(r8) - 4900: 00067980 call 6798 <_Bfree> - 4904: d8c01617 ldw r3,88(sp) - 4908: 18001015 stw zero,64(r3) - 490c: 8800a316 blt r17,zero,4b9c <_dtoa_r+0x304> - 4910: 90000015 stw zero,0(r18) - 4914: a8dffc2c andhi r3,r21,32752 - 4918: 009ffc34 movhi r2,32752 - 491c: 18809126 beq r3,r2,4b64 <_dtoa_r+0x2cc> - 4920: 000d883a mov r6,zero - 4924: 000f883a mov r7,zero - 4928: a009883a mov r4,r20 - 492c: a80b883a mov r5,r21 - 4930: dd001215 stw r20,72(sp) - 4934: dd401315 stw r21,76(sp) - 4938: 00098f80 call 98f8 <__nedf2> - 493c: 1000171e bne r2,zero,499c <_dtoa_r+0x104> - 4940: d9802717 ldw r6,156(sp) - 4944: 00800044 movi r2,1 - 4948: 30800015 stw r2,0(r6) - 494c: d8802917 ldw r2,164(sp) - 4950: 10029b26 beq r2,zero,53c0 <_dtoa_r+0xb28> - 4954: d9002917 ldw r4,164(sp) - 4958: 00800074 movhi r2,1 - 495c: 10b88744 addi r2,r2,-7651 - 4960: 10ffffc4 addi r3,r2,-1 - 4964: 20800015 stw r2,0(r4) - 4968: 1805883a mov r2,r3 - 496c: dfc02517 ldw ra,148(sp) - 4970: df002417 ldw fp,144(sp) - 4974: ddc02317 ldw r23,140(sp) - 4978: dd802217 ldw r22,136(sp) - 497c: dd402117 ldw r21,132(sp) - 4980: dd002017 ldw r20,128(sp) - 4984: dcc01f17 ldw r19,124(sp) - 4988: dc801e17 ldw r18,120(sp) - 498c: dc401d17 ldw r17,116(sp) - 4990: dc001c17 ldw r16,112(sp) - 4994: dec02604 addi sp,sp,152 - 4998: f800283a ret - 499c: d9001617 ldw r4,88(sp) - 49a0: d9401217 ldw r5,72(sp) - 49a4: d8800104 addi r2,sp,4 - 49a8: a80d883a mov r6,r21 - 49ac: d9c00204 addi r7,sp,8 - 49b0: d8800015 stw r2,0(sp) - 49b4: 0006dd40 call 6dd4 <__d2b> - 49b8: d8800715 stw r2,28(sp) - 49bc: a804d53a srli r2,r21,20 - 49c0: 1101ffcc andi r4,r2,2047 - 49c4: 20008626 beq r4,zero,4be0 <_dtoa_r+0x348> - 49c8: d8c01217 ldw r3,72(sp) - 49cc: 00800434 movhi r2,16 - 49d0: 10bfffc4 addi r2,r2,-1 - 49d4: ddc00117 ldw r23,4(sp) - 49d8: a884703a and r2,r21,r2 - 49dc: 1811883a mov r8,r3 - 49e0: 124ffc34 orhi r9,r2,16368 - 49e4: 25bf0044 addi r22,r4,-1023 - 49e8: d8000815 stw zero,32(sp) - 49ec: 0005883a mov r2,zero - 49f0: 00cffe34 movhi r3,16376 - 49f4: 480b883a mov r5,r9 - 49f8: 4009883a mov r4,r8 - 49fc: 180f883a mov r7,r3 - 4a00: 100d883a mov r6,r2 - 4a04: 00091600 call 9160 <__subdf3> - 4a08: 0218dbf4 movhi r8,25455 - 4a0c: 4210d844 addi r8,r8,17249 - 4a10: 024ff4f4 movhi r9,16339 - 4a14: 4a61e9c4 addi r9,r9,-30809 - 4a18: 480f883a mov r7,r9 - 4a1c: 400d883a mov r6,r8 - 4a20: 180b883a mov r5,r3 - 4a24: 1009883a mov r4,r2 - 4a28: 00092540 call 9254 <__muldf3> - 4a2c: 0222d874 movhi r8,35681 - 4a30: 42322cc4 addi r8,r8,-14157 - 4a34: 024ff1f4 movhi r9,16327 - 4a38: 4a628a04 addi r9,r9,-30168 - 4a3c: 480f883a mov r7,r9 - 4a40: 400d883a mov r6,r8 - 4a44: 180b883a mov r5,r3 - 4a48: 1009883a mov r4,r2 - 4a4c: 00091e00 call 91e0 <__adddf3> - 4a50: b009883a mov r4,r22 - 4a54: 1021883a mov r16,r2 - 4a58: 1823883a mov r17,r3 - 4a5c: 0009b180 call 9b18 <__floatsidf> - 4a60: 021427f4 movhi r8,20639 - 4a64: 421e7ec4 addi r8,r8,31227 - 4a68: 024ff4f4 movhi r9,16339 - 4a6c: 4a5104c4 addi r9,r9,17427 - 4a70: 480f883a mov r7,r9 - 4a74: 400d883a mov r6,r8 - 4a78: 180b883a mov r5,r3 - 4a7c: 1009883a mov r4,r2 - 4a80: 00092540 call 9254 <__muldf3> - 4a84: 180f883a mov r7,r3 - 4a88: 880b883a mov r5,r17 - 4a8c: 100d883a mov r6,r2 - 4a90: 8009883a mov r4,r16 - 4a94: 00091e00 call 91e0 <__adddf3> - 4a98: 1009883a mov r4,r2 - 4a9c: 180b883a mov r5,r3 - 4aa0: 1021883a mov r16,r2 - 4aa4: 1823883a mov r17,r3 - 4aa8: 0009c100 call 9c10 <__fixdfsi> - 4aac: 000d883a mov r6,zero - 4ab0: 000f883a mov r7,zero - 4ab4: 8009883a mov r4,r16 - 4ab8: 880b883a mov r5,r17 - 4abc: d8800d15 stw r2,52(sp) - 4ac0: 0009a900 call 9a90 <__ltdf2> - 4ac4: 10031716 blt r2,zero,5724 <_dtoa_r+0xe8c> - 4ac8: d8c00d17 ldw r3,52(sp) - 4acc: 00800584 movi r2,22 - 4ad0: 10c1482e bgeu r2,r3,4ff4 <_dtoa_r+0x75c> - 4ad4: 01000044 movi r4,1 - 4ad8: d9000c15 stw r4,48(sp) - 4adc: bd85c83a sub r2,r23,r22 - 4ae0: 11bfffc4 addi r6,r2,-1 - 4ae4: 30030b16 blt r6,zero,5714 <_dtoa_r+0xe7c> - 4ae8: d9800a15 stw r6,40(sp) - 4aec: d8001115 stw zero,68(sp) - 4af0: d8c00d17 ldw r3,52(sp) - 4af4: 1802ff16 blt r3,zero,56f4 <_dtoa_r+0xe5c> - 4af8: d9000a17 ldw r4,40(sp) - 4afc: d8c00915 stw r3,36(sp) - 4b00: d8001015 stw zero,64(sp) - 4b04: 20c9883a add r4,r4,r3 - 4b08: d9000a15 stw r4,40(sp) - 4b0c: d9001717 ldw r4,92(sp) - 4b10: 00800244 movi r2,9 - 4b14: 11004636 bltu r2,r4,4c30 <_dtoa_r+0x398> - 4b18: 00800144 movi r2,5 - 4b1c: 11020416 blt r2,r4,5330 <_dtoa_r+0xa98> - 4b20: 04400044 movi r17,1 - 4b24: d8c01717 ldw r3,92(sp) - 4b28: 00800144 movi r2,5 - 4b2c: 10c1ed36 bltu r2,r3,52e4 <_dtoa_r+0xa4c> - 4b30: 18c5883a add r2,r3,r3 - 4b34: 1085883a add r2,r2,r2 - 4b38: 00c00034 movhi r3,0 - 4b3c: 18d2d304 addi r3,r3,19276 - 4b40: 10c5883a add r2,r2,r3 - 4b44: 11000017 ldw r4,0(r2) - 4b48: 2000683a jmp r4 - 4b4c: 00004c38 rdprs zero,zero,304 - 4b50: 00004c38 rdprs zero,zero,304 - 4b54: 00005638 rdprs zero,zero,344 - 4b58: 00005610 cmplti zero,zero,344 - 4b5c: 00005654 movui zero,345 - 4b60: 00005660 cmpeqi zero,zero,345 - 4b64: d9002717 ldw r4,156(sp) - 4b68: 0089c3c4 movi r2,9999 - 4b6c: 20800015 stw r2,0(r4) - 4b70: a0001026 beq r20,zero,4bb4 <_dtoa_r+0x31c> - 4b74: 00c00074 movhi r3,1 - 4b78: 18f89304 addi r3,r3,-7604 - 4b7c: d9802917 ldw r6,164(sp) - 4b80: 303f7926 beq r6,zero,4968 <_dtoa_r+0xd0> - 4b84: 188000c7 ldb r2,3(r3) - 4b88: 190000c4 addi r4,r3,3 - 4b8c: 1000101e bne r2,zero,4bd0 <_dtoa_r+0x338> - 4b90: d8802917 ldw r2,164(sp) - 4b94: 11000015 stw r4,0(r2) - 4b98: 003f7306 br 4968 <_dtoa_r+0xd0> - 4b9c: 00a00034 movhi r2,32768 - 4ba0: 10bfffc4 addi r2,r2,-1 - 4ba4: 00c00044 movi r3,1 - 4ba8: 88aa703a and r21,r17,r2 - 4bac: 90c00015 stw r3,0(r18) - 4bb0: 003f5806 br 4914 <_dtoa_r+0x7c> - 4bb4: 00800434 movhi r2,16 - 4bb8: 10bfffc4 addi r2,r2,-1 - 4bbc: a884703a and r2,r21,r2 - 4bc0: 103fec1e bne r2,zero,4b74 <_dtoa_r+0x2dc> - 4bc4: 00c00074 movhi r3,1 - 4bc8: 18f89004 addi r3,r3,-7616 - 4bcc: 003feb06 br 4b7c <_dtoa_r+0x2e4> - 4bd0: d8802917 ldw r2,164(sp) - 4bd4: 19000204 addi r4,r3,8 - 4bd8: 11000015 stw r4,0(r2) - 4bdc: 003f6206 br 4968 <_dtoa_r+0xd0> - 4be0: ddc00117 ldw r23,4(sp) - 4be4: d8800217 ldw r2,8(sp) - 4be8: 01000804 movi r4,32 - 4bec: b8c10c84 addi r3,r23,1074 - 4bf0: 18a3883a add r17,r3,r2 - 4bf4: 2441b80e bge r4,r17,52d8 <_dtoa_r+0xa40> - 4bf8: 00c01004 movi r3,64 - 4bfc: 1c47c83a sub r3,r3,r17 - 4c00: 88bff804 addi r2,r17,-32 - 4c04: a8c6983a sll r3,r21,r3 - 4c08: a084d83a srl r2,r20,r2 - 4c0c: 1888b03a or r4,r3,r2 - 4c10: 0009ce80 call 9ce8 <__floatunsidf> - 4c14: 1011883a mov r8,r2 - 4c18: 00bf8434 movhi r2,65040 - 4c1c: 01000044 movi r4,1 - 4c20: 10d3883a add r9,r2,r3 - 4c24: 8dbef344 addi r22,r17,-1075 - 4c28: d9000815 stw r4,32(sp) - 4c2c: 003f6f06 br 49ec <_dtoa_r+0x154> - 4c30: d8001715 stw zero,92(sp) - 4c34: 04400044 movi r17,1 - 4c38: 00bfffc4 movi r2,-1 - 4c3c: 00c00044 movi r3,1 - 4c40: d8800e15 stw r2,56(sp) - 4c44: d8002615 stw zero,152(sp) - 4c48: d8800f15 stw r2,60(sp) - 4c4c: d8c00b15 stw r3,44(sp) - 4c50: 1021883a mov r16,r2 - 4c54: d8801617 ldw r2,88(sp) - 4c58: 10001115 stw zero,68(r2) - 4c5c: d8801617 ldw r2,88(sp) - 4c60: 11401117 ldw r5,68(r2) - 4c64: 1009883a mov r4,r2 - 4c68: 0006d180 call 6d18 <_Balloc> - 4c6c: d8c01617 ldw r3,88(sp) - 4c70: d8800515 stw r2,20(sp) - 4c74: 18801015 stw r2,64(r3) - 4c78: 00800384 movi r2,14 - 4c7c: 14006836 bltu r2,r16,4e20 <_dtoa_r+0x588> - 4c80: 8805003a cmpeq r2,r17,zero - 4c84: 1000661e bne r2,zero,4e20 <_dtoa_r+0x588> - 4c88: d9000d17 ldw r4,52(sp) - 4c8c: 0102300e bge zero,r4,5550 <_dtoa_r+0xcb8> - 4c90: 208003cc andi r2,r4,15 - 4c94: 100490fa slli r2,r2,3 - 4c98: 2025d13a srai r18,r4,4 - 4c9c: 00c00074 movhi r3,1 - 4ca0: 18f8a404 addi r3,r3,-7536 - 4ca4: 10c5883a add r2,r2,r3 - 4ca8: 90c0040c andi r3,r18,16 - 4cac: 14000017 ldw r16,0(r2) - 4cb0: 14400117 ldw r17,4(r2) - 4cb4: 18036a1e bne r3,zero,5a60 <_dtoa_r+0x11c8> - 4cb8: 05800084 movi r22,2 - 4cbc: 90001026 beq r18,zero,4d00 <_dtoa_r+0x468> - 4cc0: 04c00074 movhi r19,1 - 4cc4: 9cf8d604 addi r19,r19,-7336 - 4cc8: 9080004c andi r2,r18,1 - 4ccc: 1005003a cmpeq r2,r2,zero - 4cd0: 1000081e bne r2,zero,4cf4 <_dtoa_r+0x45c> - 4cd4: 99800017 ldw r6,0(r19) - 4cd8: 99c00117 ldw r7,4(r19) - 4cdc: 880b883a mov r5,r17 - 4ce0: 8009883a mov r4,r16 - 4ce4: 00092540 call 9254 <__muldf3> - 4ce8: 1021883a mov r16,r2 - 4cec: b5800044 addi r22,r22,1 - 4cf0: 1823883a mov r17,r3 - 4cf4: 9025d07a srai r18,r18,1 - 4cf8: 9cc00204 addi r19,r19,8 - 4cfc: 903ff21e bne r18,zero,4cc8 <_dtoa_r+0x430> - 4d00: a80b883a mov r5,r21 - 4d04: a009883a mov r4,r20 - 4d08: 880f883a mov r7,r17 - 4d0c: 800d883a mov r6,r16 - 4d10: 00096180 call 9618 <__divdf3> - 4d14: 1029883a mov r20,r2 - 4d18: 182b883a mov r21,r3 - 4d1c: d8c00c17 ldw r3,48(sp) - 4d20: 1805003a cmpeq r2,r3,zero - 4d24: 1000081e bne r2,zero,4d48 <_dtoa_r+0x4b0> - 4d28: 0005883a mov r2,zero - 4d2c: 00cffc34 movhi r3,16368 - 4d30: 180f883a mov r7,r3 - 4d34: a009883a mov r4,r20 - 4d38: a80b883a mov r5,r21 - 4d3c: 100d883a mov r6,r2 - 4d40: 0009a900 call 9a90 <__ltdf2> - 4d44: 1003fe16 blt r2,zero,5d40 <_dtoa_r+0x14a8> - 4d48: b009883a mov r4,r22 - 4d4c: 0009b180 call 9b18 <__floatsidf> - 4d50: 180b883a mov r5,r3 - 4d54: 1009883a mov r4,r2 - 4d58: a00d883a mov r6,r20 - 4d5c: a80f883a mov r7,r21 - 4d60: 00092540 call 9254 <__muldf3> - 4d64: 0011883a mov r8,zero - 4d68: 02500734 movhi r9,16412 - 4d6c: 1009883a mov r4,r2 - 4d70: 180b883a mov r5,r3 - 4d74: 480f883a mov r7,r9 - 4d78: 400d883a mov r6,r8 - 4d7c: 00091e00 call 91e0 <__adddf3> - 4d80: d9000f17 ldw r4,60(sp) - 4d84: 102d883a mov r22,r2 - 4d88: 00bf3034 movhi r2,64704 - 4d8c: 18b9883a add fp,r3,r2 - 4d90: e02f883a mov r23,fp - 4d94: 20028f1e bne r4,zero,57d4 <_dtoa_r+0xf3c> - 4d98: 0005883a mov r2,zero - 4d9c: 00d00534 movhi r3,16404 - 4da0: a009883a mov r4,r20 - 4da4: a80b883a mov r5,r21 - 4da8: 180f883a mov r7,r3 - 4dac: 100d883a mov r6,r2 - 4db0: 00091600 call 9160 <__subdf3> - 4db4: 1009883a mov r4,r2 - 4db8: e00f883a mov r7,fp - 4dbc: 180b883a mov r5,r3 - 4dc0: b00d883a mov r6,r22 - 4dc4: 1025883a mov r18,r2 - 4dc8: 1827883a mov r19,r3 - 4dcc: 00099800 call 9980 <__gtdf2> - 4dd0: 00834f16 blt zero,r2,5b10 <_dtoa_r+0x1278> - 4dd4: e0e0003c xorhi r3,fp,32768 - 4dd8: 9009883a mov r4,r18 - 4ddc: 980b883a mov r5,r19 - 4de0: 180f883a mov r7,r3 - 4de4: b00d883a mov r6,r22 - 4de8: 0009a900 call 9a90 <__ltdf2> - 4dec: 1000080e bge r2,zero,4e10 <_dtoa_r+0x578> - 4df0: 0027883a mov r19,zero - 4df4: 0025883a mov r18,zero - 4df8: d8802617 ldw r2,152(sp) - 4dfc: df000517 ldw fp,20(sp) - 4e00: d8000615 stw zero,24(sp) - 4e04: 0084303a nor r2,zero,r2 - 4e08: d8800d15 stw r2,52(sp) - 4e0c: 00019b06 br 547c <_dtoa_r+0xbe4> - 4e10: d9801217 ldw r6,72(sp) - 4e14: d8801317 ldw r2,76(sp) - 4e18: 3029883a mov r20,r6 - 4e1c: 102b883a mov r21,r2 - 4e20: d8c00217 ldw r3,8(sp) - 4e24: 18008516 blt r3,zero,503c <_dtoa_r+0x7a4> - 4e28: d9000d17 ldw r4,52(sp) - 4e2c: 00800384 movi r2,14 - 4e30: 11008216 blt r2,r4,503c <_dtoa_r+0x7a4> - 4e34: 200490fa slli r2,r4,3 - 4e38: d9802617 ldw r6,152(sp) - 4e3c: 00c00074 movhi r3,1 - 4e40: 18f8a404 addi r3,r3,-7536 - 4e44: 10c5883a add r2,r2,r3 - 4e48: 14800017 ldw r18,0(r2) - 4e4c: 14c00117 ldw r19,4(r2) - 4e50: 30031e16 blt r6,zero,5acc <_dtoa_r+0x1234> - 4e54: d9000517 ldw r4,20(sp) - 4e58: d8c00f17 ldw r3,60(sp) - 4e5c: a823883a mov r17,r21 - 4e60: a021883a mov r16,r20 - 4e64: 192b883a add r21,r3,r4 - 4e68: 2039883a mov fp,r4 - 4e6c: 00000f06 br 4eac <_dtoa_r+0x614> - 4e70: 0005883a mov r2,zero - 4e74: 00d00934 movhi r3,16420 - 4e78: 5009883a mov r4,r10 - 4e7c: 580b883a mov r5,r11 - 4e80: 180f883a mov r7,r3 - 4e84: 100d883a mov r6,r2 - 4e88: 00092540 call 9254 <__muldf3> - 4e8c: 180b883a mov r5,r3 - 4e90: 000d883a mov r6,zero - 4e94: 000f883a mov r7,zero - 4e98: 1009883a mov r4,r2 - 4e9c: 1021883a mov r16,r2 - 4ea0: 1823883a mov r17,r3 - 4ea4: 00098f80 call 98f8 <__nedf2> - 4ea8: 10004526 beq r2,zero,4fc0 <_dtoa_r+0x728> - 4eac: 900d883a mov r6,r18 - 4eb0: 980f883a mov r7,r19 - 4eb4: 8009883a mov r4,r16 - 4eb8: 880b883a mov r5,r17 - 4ebc: 00096180 call 9618 <__divdf3> - 4ec0: 180b883a mov r5,r3 - 4ec4: 1009883a mov r4,r2 - 4ec8: 0009c100 call 9c10 <__fixdfsi> - 4ecc: 1009883a mov r4,r2 - 4ed0: 1029883a mov r20,r2 - 4ed4: 0009b180 call 9b18 <__floatsidf> - 4ed8: 180f883a mov r7,r3 - 4edc: 9009883a mov r4,r18 - 4ee0: 980b883a mov r5,r19 - 4ee4: 100d883a mov r6,r2 - 4ee8: 00092540 call 9254 <__muldf3> - 4eec: 180f883a mov r7,r3 - 4ef0: 880b883a mov r5,r17 - 4ef4: 8009883a mov r4,r16 - 4ef8: 100d883a mov r6,r2 - 4efc: 00091600 call 9160 <__subdf3> - 4f00: 1015883a mov r10,r2 - 4f04: a0800c04 addi r2,r20,48 - 4f08: e0800005 stb r2,0(fp) - 4f0c: e7000044 addi fp,fp,1 - 4f10: 1817883a mov r11,r3 - 4f14: e57fd61e bne fp,r21,4e70 <_dtoa_r+0x5d8> - 4f18: 500d883a mov r6,r10 - 4f1c: 180f883a mov r7,r3 - 4f20: 5009883a mov r4,r10 - 4f24: 180b883a mov r5,r3 - 4f28: 00091e00 call 91e0 <__adddf3> - 4f2c: 100d883a mov r6,r2 - 4f30: 9009883a mov r4,r18 - 4f34: 980b883a mov r5,r19 - 4f38: 180f883a mov r7,r3 - 4f3c: 1021883a mov r16,r2 - 4f40: 1823883a mov r17,r3 - 4f44: 0009a900 call 9a90 <__ltdf2> - 4f48: 10000816 blt r2,zero,4f6c <_dtoa_r+0x6d4> - 4f4c: 980b883a mov r5,r19 - 4f50: 800d883a mov r6,r16 - 4f54: 880f883a mov r7,r17 - 4f58: 9009883a mov r4,r18 - 4f5c: 00098700 call 9870 <__eqdf2> - 4f60: 1000171e bne r2,zero,4fc0 <_dtoa_r+0x728> - 4f64: a080004c andi r2,r20,1 - 4f68: 10001526 beq r2,zero,4fc0 <_dtoa_r+0x728> - 4f6c: d8800d17 ldw r2,52(sp) - 4f70: d8800415 stw r2,16(sp) - 4f74: e009883a mov r4,fp - 4f78: 213fffc4 addi r4,r4,-1 - 4f7c: 20c00007 ldb r3,0(r4) - 4f80: 00800e44 movi r2,57 - 4f84: 1880081e bne r3,r2,4fa8 <_dtoa_r+0x710> - 4f88: d8800517 ldw r2,20(sp) - 4f8c: 113ffa1e bne r2,r4,4f78 <_dtoa_r+0x6e0> - 4f90: d8c00417 ldw r3,16(sp) - 4f94: d9800517 ldw r6,20(sp) - 4f98: 00800c04 movi r2,48 - 4f9c: 18c00044 addi r3,r3,1 - 4fa0: d8c00415 stw r3,16(sp) - 4fa4: 30800005 stb r2,0(r6) - 4fa8: 20800003 ldbu r2,0(r4) - 4fac: d8c00417 ldw r3,16(sp) - 4fb0: 27000044 addi fp,r4,1 - 4fb4: 10800044 addi r2,r2,1 - 4fb8: d8c00d15 stw r3,52(sp) - 4fbc: 20800005 stb r2,0(r4) - 4fc0: d9001617 ldw r4,88(sp) - 4fc4: d9400717 ldw r5,28(sp) - 4fc8: 00067980 call 6798 <_Bfree> - 4fcc: e0000005 stb zero,0(fp) - 4fd0: d9800d17 ldw r6,52(sp) - 4fd4: d8c02717 ldw r3,156(sp) - 4fd8: d9002917 ldw r4,164(sp) - 4fdc: 30800044 addi r2,r6,1 - 4fe0: 18800015 stw r2,0(r3) - 4fe4: 20029c26 beq r4,zero,5a58 <_dtoa_r+0x11c0> - 4fe8: d8c00517 ldw r3,20(sp) - 4fec: 27000015 stw fp,0(r4) - 4ff0: 003e5d06 br 4968 <_dtoa_r+0xd0> - 4ff4: d9800d17 ldw r6,52(sp) - 4ff8: 00c00074 movhi r3,1 - 4ffc: 18f8a404 addi r3,r3,-7536 - 5000: d9001217 ldw r4,72(sp) - 5004: 300490fa slli r2,r6,3 - 5008: d9401317 ldw r5,76(sp) - 500c: 10c5883a add r2,r2,r3 - 5010: 12000017 ldw r8,0(r2) - 5014: 12400117 ldw r9,4(r2) - 5018: 400d883a mov r6,r8 - 501c: 480f883a mov r7,r9 - 5020: 0009a900 call 9a90 <__ltdf2> - 5024: 1000030e bge r2,zero,5034 <_dtoa_r+0x79c> - 5028: d8800d17 ldw r2,52(sp) - 502c: 10bfffc4 addi r2,r2,-1 - 5030: d8800d15 stw r2,52(sp) - 5034: d8000c15 stw zero,48(sp) - 5038: 003ea806 br 4adc <_dtoa_r+0x244> - 503c: d9000b17 ldw r4,44(sp) - 5040: 202cc03a cmpne r22,r4,zero - 5044: b000c71e bne r22,zero,5364 <_dtoa_r+0xacc> - 5048: dc001117 ldw r16,68(sp) - 504c: dc801017 ldw r18,64(sp) - 5050: 0027883a mov r19,zero - 5054: 04000b0e bge zero,r16,5084 <_dtoa_r+0x7ec> - 5058: d8c00a17 ldw r3,40(sp) - 505c: 00c0090e bge zero,r3,5084 <_dtoa_r+0x7ec> - 5060: 8005883a mov r2,r16 - 5064: 1c011316 blt r3,r16,54b4 <_dtoa_r+0xc1c> - 5068: d9000a17 ldw r4,40(sp) - 506c: d9801117 ldw r6,68(sp) - 5070: 80a1c83a sub r16,r16,r2 - 5074: 2089c83a sub r4,r4,r2 - 5078: 308dc83a sub r6,r6,r2 - 507c: d9000a15 stw r4,40(sp) - 5080: d9801115 stw r6,68(sp) - 5084: d8801017 ldw r2,64(sp) - 5088: 0080150e bge zero,r2,50e0 <_dtoa_r+0x848> - 508c: d8c00b17 ldw r3,44(sp) - 5090: 1805003a cmpeq r2,r3,zero - 5094: 1001c91e bne r2,zero,57bc <_dtoa_r+0xf24> - 5098: 04800e0e bge zero,r18,50d4 <_dtoa_r+0x83c> - 509c: d9001617 ldw r4,88(sp) - 50a0: 980b883a mov r5,r19 - 50a4: 900d883a mov r6,r18 - 50a8: 00075e40 call 75e4 <__pow5mult> - 50ac: d9001617 ldw r4,88(sp) - 50b0: d9800717 ldw r6,28(sp) - 50b4: 100b883a mov r5,r2 - 50b8: 1027883a mov r19,r2 - 50bc: 00072280 call 7228 <__multiply> - 50c0: d9001617 ldw r4,88(sp) - 50c4: d9400717 ldw r5,28(sp) - 50c8: 1023883a mov r17,r2 - 50cc: 00067980 call 6798 <_Bfree> - 50d0: dc400715 stw r17,28(sp) - 50d4: d9001017 ldw r4,64(sp) - 50d8: 248dc83a sub r6,r4,r18 - 50dc: 30010e1e bne r6,zero,5518 <_dtoa_r+0xc80> - 50e0: d9001617 ldw r4,88(sp) - 50e4: 04400044 movi r17,1 - 50e8: 880b883a mov r5,r17 - 50ec: 000747c0 call 747c <__i2b> - 50f0: d9800917 ldw r6,36(sp) - 50f4: 1025883a mov r18,r2 - 50f8: 0180040e bge zero,r6,510c <_dtoa_r+0x874> - 50fc: d9001617 ldw r4,88(sp) - 5100: 100b883a mov r5,r2 - 5104: 00075e40 call 75e4 <__pow5mult> - 5108: 1025883a mov r18,r2 - 510c: d8801717 ldw r2,92(sp) - 5110: 8880f30e bge r17,r2,54e0 <_dtoa_r+0xc48> - 5114: 0023883a mov r17,zero - 5118: d9800917 ldw r6,36(sp) - 511c: 30019e1e bne r6,zero,5798 <_dtoa_r+0xf00> - 5120: 00c00044 movi r3,1 - 5124: d9000a17 ldw r4,40(sp) - 5128: 20c5883a add r2,r4,r3 - 512c: 10c007cc andi r3,r2,31 - 5130: 1800841e bne r3,zero,5344 <_dtoa_r+0xaac> - 5134: 00800704 movi r2,28 - 5138: d9000a17 ldw r4,40(sp) - 513c: d9801117 ldw r6,68(sp) - 5140: 80a1883a add r16,r16,r2 - 5144: 2089883a add r4,r4,r2 - 5148: 308d883a add r6,r6,r2 - 514c: d9000a15 stw r4,40(sp) - 5150: d9801115 stw r6,68(sp) - 5154: d8801117 ldw r2,68(sp) - 5158: 0080050e bge zero,r2,5170 <_dtoa_r+0x8d8> - 515c: d9400717 ldw r5,28(sp) - 5160: d9001617 ldw r4,88(sp) - 5164: 100d883a mov r6,r2 - 5168: 00070dc0 call 70dc <__lshift> - 516c: d8800715 stw r2,28(sp) - 5170: d8c00a17 ldw r3,40(sp) - 5174: 00c0050e bge zero,r3,518c <_dtoa_r+0x8f4> - 5178: d9001617 ldw r4,88(sp) - 517c: 900b883a mov r5,r18 - 5180: 180d883a mov r6,r3 - 5184: 00070dc0 call 70dc <__lshift> - 5188: 1025883a mov r18,r2 - 518c: d9000c17 ldw r4,48(sp) - 5190: 2005003a cmpeq r2,r4,zero - 5194: 10016f26 beq r2,zero,5754 <_dtoa_r+0xebc> - 5198: d9000f17 ldw r4,60(sp) - 519c: 0102170e bge zero,r4,59fc <_dtoa_r+0x1164> - 51a0: d9800b17 ldw r6,44(sp) - 51a4: 3005003a cmpeq r2,r6,zero - 51a8: 1000881e bne r2,zero,53cc <_dtoa_r+0xb34> - 51ac: 0400050e bge zero,r16,51c4 <_dtoa_r+0x92c> - 51b0: d9001617 ldw r4,88(sp) - 51b4: 980b883a mov r5,r19 - 51b8: 800d883a mov r6,r16 - 51bc: 00070dc0 call 70dc <__lshift> - 51c0: 1027883a mov r19,r2 - 51c4: 8804c03a cmpne r2,r17,zero - 51c8: 1002541e bne r2,zero,5b1c <_dtoa_r+0x1284> - 51cc: 980b883a mov r5,r19 - 51d0: dd800517 ldw r22,20(sp) - 51d4: dcc00615 stw r19,24(sp) - 51d8: a700004c andi fp,r20,1 - 51dc: 2827883a mov r19,r5 - 51e0: d9000717 ldw r4,28(sp) - 51e4: 900b883a mov r5,r18 - 51e8: 00046540 call 4654 - 51ec: d9000717 ldw r4,28(sp) - 51f0: d9400617 ldw r5,24(sp) - 51f4: 1023883a mov r17,r2 - 51f8: 8dc00c04 addi r23,r17,48 - 51fc: 00068f40 call 68f4 <__mcmp> - 5200: d9001617 ldw r4,88(sp) - 5204: 900b883a mov r5,r18 - 5208: 980d883a mov r6,r19 - 520c: 1029883a mov r20,r2 - 5210: 0006f500 call 6f50 <__mdiff> - 5214: 102b883a mov r21,r2 - 5218: 10800317 ldw r2,12(r2) - 521c: 1001281e bne r2,zero,56c0 <_dtoa_r+0xe28> - 5220: d9000717 ldw r4,28(sp) - 5224: a80b883a mov r5,r21 - 5228: 00068f40 call 68f4 <__mcmp> - 522c: d9001617 ldw r4,88(sp) - 5230: 1021883a mov r16,r2 - 5234: a80b883a mov r5,r21 - 5238: 00067980 call 6798 <_Bfree> - 523c: 8000041e bne r16,zero,5250 <_dtoa_r+0x9b8> - 5240: d8801717 ldw r2,92(sp) - 5244: 1000021e bne r2,zero,5250 <_dtoa_r+0x9b8> - 5248: e004c03a cmpne r2,fp,zero - 524c: 10011726 beq r2,zero,56ac <_dtoa_r+0xe14> - 5250: a0010616 blt r20,zero,566c <_dtoa_r+0xdd4> - 5254: a000041e bne r20,zero,5268 <_dtoa_r+0x9d0> - 5258: d8c01717 ldw r3,92(sp) - 525c: 1800021e bne r3,zero,5268 <_dtoa_r+0x9d0> - 5260: e004c03a cmpne r2,fp,zero - 5264: 10010126 beq r2,zero,566c <_dtoa_r+0xdd4> - 5268: 04023d16 blt zero,r16,5b60 <_dtoa_r+0x12c8> - 526c: b5c00005 stb r23,0(r22) - 5270: d9800517 ldw r6,20(sp) - 5274: d9000f17 ldw r4,60(sp) - 5278: b5800044 addi r22,r22,1 - 527c: 3105883a add r2,r6,r4 - 5280: b0806526 beq r22,r2,5418 <_dtoa_r+0xb80> - 5284: d9400717 ldw r5,28(sp) - 5288: d9001617 ldw r4,88(sp) - 528c: 01800284 movi r6,10 - 5290: 000f883a mov r7,zero - 5294: 00074b80 call 74b8 <__multadd> - 5298: d8800715 stw r2,28(sp) - 529c: d8800617 ldw r2,24(sp) - 52a0: 14c10c26 beq r2,r19,56d4 <_dtoa_r+0xe3c> - 52a4: d9400617 ldw r5,24(sp) - 52a8: d9001617 ldw r4,88(sp) - 52ac: 01800284 movi r6,10 - 52b0: 000f883a mov r7,zero - 52b4: 00074b80 call 74b8 <__multadd> - 52b8: d9001617 ldw r4,88(sp) - 52bc: 980b883a mov r5,r19 - 52c0: 01800284 movi r6,10 - 52c4: 000f883a mov r7,zero - 52c8: d8800615 stw r2,24(sp) - 52cc: 00074b80 call 74b8 <__multadd> - 52d0: 1027883a mov r19,r2 - 52d4: 003fc206 br 51e0 <_dtoa_r+0x948> - 52d8: 2445c83a sub r2,r4,r17 - 52dc: a088983a sll r4,r20,r2 - 52e0: 003e4b06 br 4c10 <_dtoa_r+0x378> - 52e4: 01bfffc4 movi r6,-1 - 52e8: 00800044 movi r2,1 - 52ec: d9800e15 stw r6,56(sp) - 52f0: d9800f15 stw r6,60(sp) - 52f4: d8800b15 stw r2,44(sp) - 52f8: d8c01617 ldw r3,88(sp) - 52fc: 008005c4 movi r2,23 - 5300: 18001115 stw zero,68(r3) - 5304: 1580082e bgeu r2,r22,5328 <_dtoa_r+0xa90> - 5308: 00c00104 movi r3,4 - 530c: 0009883a mov r4,zero - 5310: 18c7883a add r3,r3,r3 - 5314: 18800504 addi r2,r3,20 - 5318: 21000044 addi r4,r4,1 - 531c: b0bffc2e bgeu r22,r2,5310 <_dtoa_r+0xa78> - 5320: d9801617 ldw r6,88(sp) - 5324: 31001115 stw r4,68(r6) - 5328: dc000f17 ldw r16,60(sp) - 532c: 003e4b06 br 4c5c <_dtoa_r+0x3c4> - 5330: d9801717 ldw r6,92(sp) - 5334: 0023883a mov r17,zero - 5338: 31bfff04 addi r6,r6,-4 - 533c: d9801715 stw r6,92(sp) - 5340: 003df806 br 4b24 <_dtoa_r+0x28c> - 5344: 00800804 movi r2,32 - 5348: 10c9c83a sub r4,r2,r3 - 534c: 00c00104 movi r3,4 - 5350: 19005a16 blt r3,r4,54bc <_dtoa_r+0xc24> - 5354: 008000c4 movi r2,3 - 5358: 113f7e16 blt r2,r4,5154 <_dtoa_r+0x8bc> - 535c: 20800704 addi r2,r4,28 - 5360: 003f7506 br 5138 <_dtoa_r+0x8a0> - 5364: d9801717 ldw r6,92(sp) - 5368: 00800044 movi r2,1 - 536c: 1180a10e bge r2,r6,55f4 <_dtoa_r+0xd5c> - 5370: d9800f17 ldw r6,60(sp) - 5374: d8c01017 ldw r3,64(sp) - 5378: 30bfffc4 addi r2,r6,-1 - 537c: 1881c616 blt r3,r2,5a98 <_dtoa_r+0x1200> - 5380: 18a5c83a sub r18,r3,r2 - 5384: d8800f17 ldw r2,60(sp) - 5388: 10026216 blt r2,zero,5d14 <_dtoa_r+0x147c> - 538c: dc001117 ldw r16,68(sp) - 5390: 1007883a mov r3,r2 - 5394: d9800a17 ldw r6,40(sp) - 5398: d8801117 ldw r2,68(sp) - 539c: d9001617 ldw r4,88(sp) - 53a0: 30cd883a add r6,r6,r3 - 53a4: 10c5883a add r2,r2,r3 - 53a8: 01400044 movi r5,1 - 53ac: d9800a15 stw r6,40(sp) - 53b0: d8801115 stw r2,68(sp) - 53b4: 000747c0 call 747c <__i2b> - 53b8: 1027883a mov r19,r2 - 53bc: 003f2506 br 5054 <_dtoa_r+0x7bc> - 53c0: 00c00074 movhi r3,1 - 53c4: 18f88704 addi r3,r3,-7652 - 53c8: 003d6706 br 4968 <_dtoa_r+0xd0> - 53cc: dd800517 ldw r22,20(sp) - 53d0: 04000044 movi r16,1 - 53d4: 00000706 br 53f4 <_dtoa_r+0xb5c> - 53d8: d9400717 ldw r5,28(sp) - 53dc: d9001617 ldw r4,88(sp) - 53e0: 01800284 movi r6,10 - 53e4: 000f883a mov r7,zero - 53e8: 00074b80 call 74b8 <__multadd> - 53ec: d8800715 stw r2,28(sp) - 53f0: 84000044 addi r16,r16,1 - 53f4: d9000717 ldw r4,28(sp) - 53f8: 900b883a mov r5,r18 - 53fc: 00046540 call 4654 - 5400: 15c00c04 addi r23,r2,48 - 5404: b5c00005 stb r23,0(r22) - 5408: d8c00f17 ldw r3,60(sp) - 540c: b5800044 addi r22,r22,1 - 5410: 80fff116 blt r16,r3,53d8 <_dtoa_r+0xb40> - 5414: d8000615 stw zero,24(sp) - 5418: d9400717 ldw r5,28(sp) - 541c: d9001617 ldw r4,88(sp) - 5420: 01800044 movi r6,1 - 5424: 00070dc0 call 70dc <__lshift> - 5428: 1009883a mov r4,r2 - 542c: 900b883a mov r5,r18 - 5430: d8800715 stw r2,28(sp) - 5434: 00068f40 call 68f4 <__mcmp> - 5438: 00803c0e bge zero,r2,552c <_dtoa_r+0xc94> - 543c: b009883a mov r4,r22 - 5440: 213fffc4 addi r4,r4,-1 - 5444: 21400003 ldbu r5,0(r4) - 5448: 00800e44 movi r2,57 - 544c: 28c03fcc andi r3,r5,255 - 5450: 18c0201c xori r3,r3,128 - 5454: 18ffe004 addi r3,r3,-128 - 5458: 1881981e bne r3,r2,5abc <_dtoa_r+0x1224> - 545c: d9800517 ldw r6,20(sp) - 5460: 21bff71e bne r4,r6,5440 <_dtoa_r+0xba8> - 5464: d8800d17 ldw r2,52(sp) - 5468: 37000044 addi fp,r6,1 - 546c: 10800044 addi r2,r2,1 - 5470: d8800d15 stw r2,52(sp) - 5474: 00800c44 movi r2,49 - 5478: 30800005 stb r2,0(r6) - 547c: d9001617 ldw r4,88(sp) - 5480: 900b883a mov r5,r18 - 5484: 00067980 call 6798 <_Bfree> - 5488: 983ecd26 beq r19,zero,4fc0 <_dtoa_r+0x728> - 548c: d8c00617 ldw r3,24(sp) - 5490: 18000426 beq r3,zero,54a4 <_dtoa_r+0xc0c> - 5494: 1cc00326 beq r3,r19,54a4 <_dtoa_r+0xc0c> - 5498: d9001617 ldw r4,88(sp) - 549c: 180b883a mov r5,r3 - 54a0: 00067980 call 6798 <_Bfree> - 54a4: d9001617 ldw r4,88(sp) - 54a8: 980b883a mov r5,r19 - 54ac: 00067980 call 6798 <_Bfree> - 54b0: 003ec306 br 4fc0 <_dtoa_r+0x728> - 54b4: 1805883a mov r2,r3 - 54b8: 003eeb06 br 5068 <_dtoa_r+0x7d0> - 54bc: d9800a17 ldw r6,40(sp) - 54c0: d8c01117 ldw r3,68(sp) - 54c4: 20bfff04 addi r2,r4,-4 - 54c8: 308d883a add r6,r6,r2 - 54cc: 1887883a add r3,r3,r2 - 54d0: 80a1883a add r16,r16,r2 - 54d4: d9800a15 stw r6,40(sp) - 54d8: d8c01115 stw r3,68(sp) - 54dc: 003f1d06 br 5154 <_dtoa_r+0x8bc> - 54e0: a03f0c1e bne r20,zero,5114 <_dtoa_r+0x87c> - 54e4: 00800434 movhi r2,16 - 54e8: 10bfffc4 addi r2,r2,-1 - 54ec: a884703a and r2,r21,r2 - 54f0: 103f081e bne r2,zero,5114 <_dtoa_r+0x87c> - 54f4: a89ffc2c andhi r2,r21,32752 - 54f8: 103f0626 beq r2,zero,5114 <_dtoa_r+0x87c> - 54fc: d8c01117 ldw r3,68(sp) - 5500: d9000a17 ldw r4,40(sp) - 5504: 18c00044 addi r3,r3,1 - 5508: 21000044 addi r4,r4,1 - 550c: d8c01115 stw r3,68(sp) - 5510: d9000a15 stw r4,40(sp) - 5514: 003f0006 br 5118 <_dtoa_r+0x880> - 5518: d9400717 ldw r5,28(sp) - 551c: d9001617 ldw r4,88(sp) - 5520: 00075e40 call 75e4 <__pow5mult> - 5524: d8800715 stw r2,28(sp) - 5528: 003eed06 br 50e0 <_dtoa_r+0x848> - 552c: 1000021e bne r2,zero,5538 <_dtoa_r+0xca0> - 5530: b880004c andi r2,r23,1 - 5534: 103fc11e bne r2,zero,543c <_dtoa_r+0xba4> - 5538: b5bfffc4 addi r22,r22,-1 - 553c: b0c00007 ldb r3,0(r22) - 5540: 00800c04 movi r2,48 - 5544: 18bffc26 beq r3,r2,5538 <_dtoa_r+0xca0> - 5548: b7000044 addi fp,r22,1 - 554c: 003fcb06 br 547c <_dtoa_r+0xbe4> - 5550: d9800d17 ldw r6,52(sp) - 5554: 018fc83a sub r7,zero,r6 - 5558: 3801f726 beq r7,zero,5d38 <_dtoa_r+0x14a0> - 555c: 398003cc andi r6,r7,15 - 5560: 300c90fa slli r6,r6,3 - 5564: 01400074 movhi r5,1 - 5568: 2978a404 addi r5,r5,-7536 - 556c: d9001217 ldw r4,72(sp) - 5570: 314d883a add r6,r6,r5 - 5574: 30c00117 ldw r3,4(r6) - 5578: 30800017 ldw r2,0(r6) - 557c: d9401317 ldw r5,76(sp) - 5580: 3821d13a srai r16,r7,4 - 5584: 100d883a mov r6,r2 - 5588: 180f883a mov r7,r3 - 558c: 00092540 call 9254 <__muldf3> - 5590: 1011883a mov r8,r2 - 5594: 1813883a mov r9,r3 - 5598: 1029883a mov r20,r2 - 559c: 182b883a mov r21,r3 - 55a0: 8001e526 beq r16,zero,5d38 <_dtoa_r+0x14a0> - 55a4: 05800084 movi r22,2 - 55a8: 04400074 movhi r17,1 - 55ac: 8c78d604 addi r17,r17,-7336 - 55b0: 8080004c andi r2,r16,1 - 55b4: 1005003a cmpeq r2,r2,zero - 55b8: 1000081e bne r2,zero,55dc <_dtoa_r+0xd44> - 55bc: 89800017 ldw r6,0(r17) - 55c0: 89c00117 ldw r7,4(r17) - 55c4: 480b883a mov r5,r9 - 55c8: 4009883a mov r4,r8 - 55cc: 00092540 call 9254 <__muldf3> - 55d0: 1011883a mov r8,r2 - 55d4: b5800044 addi r22,r22,1 - 55d8: 1813883a mov r9,r3 - 55dc: 8021d07a srai r16,r16,1 - 55e0: 8c400204 addi r17,r17,8 - 55e4: 803ff21e bne r16,zero,55b0 <_dtoa_r+0xd18> - 55e8: 4029883a mov r20,r8 - 55ec: 482b883a mov r21,r9 - 55f0: 003dca06 br 4d1c <_dtoa_r+0x484> - 55f4: d9000817 ldw r4,32(sp) - 55f8: 2005003a cmpeq r2,r4,zero - 55fc: 1001f61e bne r2,zero,5dd8 <_dtoa_r+0x1540> - 5600: dc001117 ldw r16,68(sp) - 5604: dc801017 ldw r18,64(sp) - 5608: 18c10cc4 addi r3,r3,1075 - 560c: 003f6106 br 5394 <_dtoa_r+0xafc> - 5610: d8000b15 stw zero,44(sp) - 5614: d9802617 ldw r6,152(sp) - 5618: d8c00d17 ldw r3,52(sp) - 561c: 30800044 addi r2,r6,1 - 5620: 18ad883a add r22,r3,r2 - 5624: b13fffc4 addi r4,r22,-1 - 5628: d9000e15 stw r4,56(sp) - 562c: 0581f60e bge zero,r22,5e08 <_dtoa_r+0x1570> - 5630: dd800f15 stw r22,60(sp) - 5634: 003f3006 br 52f8 <_dtoa_r+0xa60> - 5638: d8000b15 stw zero,44(sp) - 563c: d9002617 ldw r4,152(sp) - 5640: 0101eb0e bge zero,r4,5df0 <_dtoa_r+0x1558> - 5644: 202d883a mov r22,r4 - 5648: d9000e15 stw r4,56(sp) - 564c: d9000f15 stw r4,60(sp) - 5650: 003f2906 br 52f8 <_dtoa_r+0xa60> - 5654: 01800044 movi r6,1 - 5658: d9800b15 stw r6,44(sp) - 565c: 003ff706 br 563c <_dtoa_r+0xda4> - 5660: 01000044 movi r4,1 - 5664: d9000b15 stw r4,44(sp) - 5668: 003fea06 br 5614 <_dtoa_r+0xd7c> - 566c: 04000c0e bge zero,r16,56a0 <_dtoa_r+0xe08> - 5670: d9400717 ldw r5,28(sp) - 5674: d9001617 ldw r4,88(sp) - 5678: 01800044 movi r6,1 - 567c: 00070dc0 call 70dc <__lshift> - 5680: 1009883a mov r4,r2 - 5684: 900b883a mov r5,r18 - 5688: d8800715 stw r2,28(sp) - 568c: 00068f40 call 68f4 <__mcmp> - 5690: 0081e00e bge zero,r2,5e14 <_dtoa_r+0x157c> - 5694: bdc00044 addi r23,r23,1 - 5698: 00800e84 movi r2,58 - 569c: b881a226 beq r23,r2,5d28 <_dtoa_r+0x1490> - 56a0: b7000044 addi fp,r22,1 - 56a4: b5c00005 stb r23,0(r22) - 56a8: 003f7406 br 547c <_dtoa_r+0xbe4> - 56ac: 00800e44 movi r2,57 - 56b0: b8819d26 beq r23,r2,5d28 <_dtoa_r+0x1490> - 56b4: 053ffa0e bge zero,r20,56a0 <_dtoa_r+0xe08> - 56b8: 8dc00c44 addi r23,r17,49 - 56bc: 003ff806 br 56a0 <_dtoa_r+0xe08> - 56c0: d9001617 ldw r4,88(sp) - 56c4: a80b883a mov r5,r21 - 56c8: 04000044 movi r16,1 - 56cc: 00067980 call 6798 <_Bfree> - 56d0: 003edf06 br 5250 <_dtoa_r+0x9b8> - 56d4: d9001617 ldw r4,88(sp) - 56d8: 980b883a mov r5,r19 - 56dc: 01800284 movi r6,10 - 56e0: 000f883a mov r7,zero - 56e4: 00074b80 call 74b8 <__multadd> - 56e8: 1027883a mov r19,r2 - 56ec: d8800615 stw r2,24(sp) - 56f0: 003ebb06 br 51e0 <_dtoa_r+0x948> - 56f4: d9801117 ldw r6,68(sp) - 56f8: d8800d17 ldw r2,52(sp) - 56fc: d8000915 stw zero,36(sp) - 5700: 308dc83a sub r6,r6,r2 - 5704: 0087c83a sub r3,zero,r2 - 5708: d9801115 stw r6,68(sp) - 570c: d8c01015 stw r3,64(sp) - 5710: 003cfe06 br 4b0c <_dtoa_r+0x274> - 5714: 018dc83a sub r6,zero,r6 - 5718: d9801115 stw r6,68(sp) - 571c: d8000a15 stw zero,40(sp) - 5720: 003cf306 br 4af0 <_dtoa_r+0x258> - 5724: d9000d17 ldw r4,52(sp) - 5728: 0009b180 call 9b18 <__floatsidf> - 572c: 880b883a mov r5,r17 - 5730: 8009883a mov r4,r16 - 5734: 180f883a mov r7,r3 - 5738: 100d883a mov r6,r2 - 573c: 00098f80 call 98f8 <__nedf2> - 5740: 103ce126 beq r2,zero,4ac8 <_dtoa_r+0x230> - 5744: d9800d17 ldw r6,52(sp) - 5748: 31bfffc4 addi r6,r6,-1 - 574c: d9800d15 stw r6,52(sp) - 5750: 003cdd06 br 4ac8 <_dtoa_r+0x230> - 5754: d9000717 ldw r4,28(sp) - 5758: 900b883a mov r5,r18 - 575c: 00068f40 call 68f4 <__mcmp> - 5760: 103e8d0e bge r2,zero,5198 <_dtoa_r+0x900> - 5764: d9400717 ldw r5,28(sp) - 5768: d9001617 ldw r4,88(sp) - 576c: 01800284 movi r6,10 - 5770: 000f883a mov r7,zero - 5774: 00074b80 call 74b8 <__multadd> - 5778: d9800d17 ldw r6,52(sp) - 577c: d8800715 stw r2,28(sp) - 5780: 31bfffc4 addi r6,r6,-1 - 5784: d9800d15 stw r6,52(sp) - 5788: b001a71e bne r22,zero,5e28 <_dtoa_r+0x1590> - 578c: d8800e17 ldw r2,56(sp) - 5790: d8800f15 stw r2,60(sp) - 5794: 003e8006 br 5198 <_dtoa_r+0x900> - 5798: 90800417 ldw r2,16(r18) - 579c: 1085883a add r2,r2,r2 - 57a0: 1085883a add r2,r2,r2 - 57a4: 1485883a add r2,r2,r18 - 57a8: 11000417 ldw r4,16(r2) - 57ac: 00067c00 call 67c0 <__hi0bits> - 57b0: 00c00804 movi r3,32 - 57b4: 1887c83a sub r3,r3,r2 - 57b8: 003e5a06 br 5124 <_dtoa_r+0x88c> - 57bc: d9400717 ldw r5,28(sp) - 57c0: d9801017 ldw r6,64(sp) - 57c4: d9001617 ldw r4,88(sp) - 57c8: 00075e40 call 75e4 <__pow5mult> - 57cc: d8800715 stw r2,28(sp) - 57d0: 003e4306 br 50e0 <_dtoa_r+0x848> - 57d4: d9800f17 ldw r6,60(sp) - 57d8: d8800d17 ldw r2,52(sp) - 57dc: d9800315 stw r6,12(sp) - 57e0: d8800415 stw r2,16(sp) - 57e4: d8c00b17 ldw r3,44(sp) - 57e8: 1805003a cmpeq r2,r3,zero - 57ec: 1000e21e bne r2,zero,5b78 <_dtoa_r+0x12e0> - 57f0: d9000317 ldw r4,12(sp) - 57f4: 0005883a mov r2,zero - 57f8: 00cff834 movhi r3,16352 - 57fc: 200c90fa slli r6,r4,3 - 5800: 01000074 movhi r4,1 - 5804: 2138a404 addi r4,r4,-7536 - 5808: 180b883a mov r5,r3 - 580c: 310d883a add r6,r6,r4 - 5810: 327fff17 ldw r9,-4(r6) - 5814: 323ffe17 ldw r8,-8(r6) - 5818: 1009883a mov r4,r2 - 581c: 480f883a mov r7,r9 - 5820: 400d883a mov r6,r8 - 5824: 00096180 call 9618 <__divdf3> - 5828: 180b883a mov r5,r3 - 582c: b00d883a mov r6,r22 - 5830: b80f883a mov r7,r23 - 5834: 1009883a mov r4,r2 - 5838: 00091600 call 9160 <__subdf3> - 583c: a80b883a mov r5,r21 - 5840: a009883a mov r4,r20 - 5844: d8c01915 stw r3,100(sp) - 5848: d8801815 stw r2,96(sp) - 584c: 0009c100 call 9c10 <__fixdfsi> - 5850: 1009883a mov r4,r2 - 5854: 1027883a mov r19,r2 - 5858: 0009b180 call 9b18 <__floatsidf> - 585c: a80b883a mov r5,r21 - 5860: a009883a mov r4,r20 - 5864: 180f883a mov r7,r3 - 5868: 100d883a mov r6,r2 - 586c: 00091600 call 9160 <__subdf3> - 5870: d9801817 ldw r6,96(sp) - 5874: 1823883a mov r17,r3 - 5878: d8801415 stw r2,80(sp) - 587c: 302d883a mov r22,r6 - 5880: d9800517 ldw r6,20(sp) - 5884: 9cc00c04 addi r19,r19,48 - 5888: dc401515 stw r17,84(sp) - 588c: d8c01917 ldw r3,100(sp) - 5890: 34c00005 stb r19,0(r6) - 5894: d8800517 ldw r2,20(sp) - 5898: d9401917 ldw r5,100(sp) - 589c: d9801417 ldw r6,80(sp) - 58a0: b009883a mov r4,r22 - 58a4: 880f883a mov r7,r17 - 58a8: 182f883a mov r23,r3 - 58ac: 17000044 addi fp,r2,1 - 58b0: 00099800 call 9980 <__gtdf2> - 58b4: 00804e16 blt zero,r2,59f0 <_dtoa_r+0x1158> - 58b8: d9801417 ldw r6,80(sp) - 58bc: 0005883a mov r2,zero - 58c0: 00cffc34 movhi r3,16368 - 58c4: 180b883a mov r5,r3 - 58c8: 880f883a mov r7,r17 - 58cc: 1009883a mov r4,r2 - 58d0: 00091600 call 9160 <__subdf3> - 58d4: d9401917 ldw r5,100(sp) - 58d8: 180f883a mov r7,r3 - 58dc: b009883a mov r4,r22 - 58e0: 100d883a mov r6,r2 - 58e4: 00099800 call 9980 <__gtdf2> - 58e8: 00bda216 blt zero,r2,4f74 <_dtoa_r+0x6dc> - 58ec: d8c00317 ldw r3,12(sp) - 58f0: 00800044 movi r2,1 - 58f4: 10c01216 blt r2,r3,5940 <_dtoa_r+0x10a8> - 58f8: 003d4506 br 4e10 <_dtoa_r+0x578> - 58fc: d9801417 ldw r6,80(sp) - 5900: 0005883a mov r2,zero - 5904: 00cffc34 movhi r3,16368 - 5908: 180b883a mov r5,r3 - 590c: 880f883a mov r7,r17 - 5910: 1009883a mov r4,r2 - 5914: 00091600 call 9160 <__subdf3> - 5918: d9c01b17 ldw r7,108(sp) - 591c: 180b883a mov r5,r3 - 5920: 1009883a mov r4,r2 - 5924: b00d883a mov r6,r22 - 5928: 0009a900 call 9a90 <__ltdf2> - 592c: 103d9116 blt r2,zero,4f74 <_dtoa_r+0x6dc> - 5930: d9800517 ldw r6,20(sp) - 5934: d9000317 ldw r4,12(sp) - 5938: 3105883a add r2,r6,r4 - 593c: e0bd3426 beq fp,r2,4e10 <_dtoa_r+0x578> - 5940: 04500934 movhi r17,16420 - 5944: 0021883a mov r16,zero - 5948: b80b883a mov r5,r23 - 594c: b009883a mov r4,r22 - 5950: 800d883a mov r6,r16 - 5954: 880f883a mov r7,r17 - 5958: 00092540 call 9254 <__muldf3> - 595c: d9401517 ldw r5,84(sp) - 5960: d9001417 ldw r4,80(sp) - 5964: 880f883a mov r7,r17 - 5968: 000d883a mov r6,zero - 596c: d8801a15 stw r2,104(sp) - 5970: d8c01b15 stw r3,108(sp) - 5974: 00092540 call 9254 <__muldf3> - 5978: 180b883a mov r5,r3 - 597c: 1009883a mov r4,r2 - 5980: 1823883a mov r17,r3 - 5984: 1021883a mov r16,r2 - 5988: 0009c100 call 9c10 <__fixdfsi> - 598c: 1009883a mov r4,r2 - 5990: 102b883a mov r21,r2 - 5994: 0009b180 call 9b18 <__floatsidf> - 5998: 880b883a mov r5,r17 - 599c: 8009883a mov r4,r16 - 59a0: 180f883a mov r7,r3 - 59a4: 100d883a mov r6,r2 - 59a8: 00091600 call 9160 <__subdf3> - 59ac: 1021883a mov r16,r2 - 59b0: d9001b17 ldw r4,108(sp) - 59b4: 1823883a mov r17,r3 - 59b8: dc001415 stw r16,80(sp) - 59bc: ad400c04 addi r21,r21,48 - 59c0: dc401515 stw r17,84(sp) - 59c4: d8801a17 ldw r2,104(sp) - 59c8: e5400005 stb r21,0(fp) - 59cc: 202f883a mov r23,r4 - 59d0: d9c01b17 ldw r7,108(sp) - 59d4: d9001417 ldw r4,80(sp) - 59d8: 880b883a mov r5,r17 - 59dc: 100d883a mov r6,r2 - 59e0: 102d883a mov r22,r2 - 59e4: e7000044 addi fp,fp,1 - 59e8: 0009a900 call 9a90 <__ltdf2> - 59ec: 103fc30e bge r2,zero,58fc <_dtoa_r+0x1064> - 59f0: d9000417 ldw r4,16(sp) - 59f4: d9000d15 stw r4,52(sp) - 59f8: 003d7106 br 4fc0 <_dtoa_r+0x728> - 59fc: d9801717 ldw r6,92(sp) - 5a00: 00800084 movi r2,2 - 5a04: 11bde60e bge r2,r6,51a0 <_dtoa_r+0x908> - 5a08: 203cfb1e bne r4,zero,4df8 <_dtoa_r+0x560> - 5a0c: d9001617 ldw r4,88(sp) - 5a10: 900b883a mov r5,r18 - 5a14: 01800144 movi r6,5 - 5a18: 000f883a mov r7,zero - 5a1c: 00074b80 call 74b8 <__multadd> - 5a20: d9000717 ldw r4,28(sp) - 5a24: 100b883a mov r5,r2 - 5a28: 1025883a mov r18,r2 - 5a2c: 00068f40 call 68f4 <__mcmp> - 5a30: 00bcf10e bge zero,r2,4df8 <_dtoa_r+0x560> - 5a34: d8c00d17 ldw r3,52(sp) - 5a38: d9000517 ldw r4,20(sp) - 5a3c: d8000615 stw zero,24(sp) - 5a40: 18c00044 addi r3,r3,1 - 5a44: d8c00d15 stw r3,52(sp) - 5a48: 00800c44 movi r2,49 - 5a4c: 27000044 addi fp,r4,1 - 5a50: 20800005 stb r2,0(r4) - 5a54: 003e8906 br 547c <_dtoa_r+0xbe4> - 5a58: d8c00517 ldw r3,20(sp) - 5a5c: 003bc206 br 4968 <_dtoa_r+0xd0> - 5a60: 01800074 movhi r6,1 - 5a64: 31b8d604 addi r6,r6,-7336 - 5a68: 30c00917 ldw r3,36(r6) - 5a6c: 30800817 ldw r2,32(r6) - 5a70: d9001217 ldw r4,72(sp) - 5a74: d9401317 ldw r5,76(sp) - 5a78: 180f883a mov r7,r3 - 5a7c: 100d883a mov r6,r2 - 5a80: 00096180 call 9618 <__divdf3> - 5a84: 948003cc andi r18,r18,15 - 5a88: 058000c4 movi r22,3 - 5a8c: 1029883a mov r20,r2 - 5a90: 182b883a mov r21,r3 - 5a94: 003c8906 br 4cbc <_dtoa_r+0x424> - 5a98: d9001017 ldw r4,64(sp) - 5a9c: d9800917 ldw r6,36(sp) - 5aa0: 0025883a mov r18,zero - 5aa4: 1105c83a sub r2,r2,r4 - 5aa8: 2089883a add r4,r4,r2 - 5aac: 308d883a add r6,r6,r2 - 5ab0: d9001015 stw r4,64(sp) - 5ab4: d9800915 stw r6,36(sp) - 5ab8: 003e3206 br 5384 <_dtoa_r+0xaec> - 5abc: 28800044 addi r2,r5,1 - 5ac0: 27000044 addi fp,r4,1 - 5ac4: 20800005 stb r2,0(r4) - 5ac8: 003e6c06 br 547c <_dtoa_r+0xbe4> - 5acc: d8800f17 ldw r2,60(sp) - 5ad0: 00bce016 blt zero,r2,4e54 <_dtoa_r+0x5bc> - 5ad4: d9800f17 ldw r6,60(sp) - 5ad8: 303cc51e bne r6,zero,4df0 <_dtoa_r+0x558> - 5adc: 0005883a mov r2,zero - 5ae0: 00d00534 movhi r3,16404 - 5ae4: 980b883a mov r5,r19 - 5ae8: 180f883a mov r7,r3 - 5aec: 9009883a mov r4,r18 - 5af0: 100d883a mov r6,r2 - 5af4: 00092540 call 9254 <__muldf3> - 5af8: 180b883a mov r5,r3 - 5afc: a80f883a mov r7,r21 - 5b00: 1009883a mov r4,r2 - 5b04: a00d883a mov r6,r20 - 5b08: 0009a080 call 9a08 <__gedf2> - 5b0c: 103cb80e bge r2,zero,4df0 <_dtoa_r+0x558> - 5b10: 0027883a mov r19,zero - 5b14: 0025883a mov r18,zero - 5b18: 003fc606 br 5a34 <_dtoa_r+0x119c> - 5b1c: 99400117 ldw r5,4(r19) - 5b20: d9001617 ldw r4,88(sp) - 5b24: 0006d180 call 6d18 <_Balloc> - 5b28: 99800417 ldw r6,16(r19) - 5b2c: 11000304 addi r4,r2,12 - 5b30: 99400304 addi r5,r19,12 - 5b34: 318d883a add r6,r6,r6 - 5b38: 318d883a add r6,r6,r6 - 5b3c: 31800204 addi r6,r6,8 - 5b40: 1023883a mov r17,r2 - 5b44: 00066180 call 6618 - 5b48: d9001617 ldw r4,88(sp) - 5b4c: 880b883a mov r5,r17 - 5b50: 01800044 movi r6,1 - 5b54: 00070dc0 call 70dc <__lshift> - 5b58: 100b883a mov r5,r2 - 5b5c: 003d9c06 br 51d0 <_dtoa_r+0x938> - 5b60: 00800e44 movi r2,57 - 5b64: b8807026 beq r23,r2,5d28 <_dtoa_r+0x1490> - 5b68: b8800044 addi r2,r23,1 - 5b6c: b7000044 addi fp,r22,1 - 5b70: b0800005 stb r2,0(r22) - 5b74: 003e4106 br 547c <_dtoa_r+0xbe4> - 5b78: d8800317 ldw r2,12(sp) - 5b7c: 01800074 movhi r6,1 - 5b80: 31b8a404 addi r6,r6,-7536 - 5b84: b009883a mov r4,r22 - 5b88: 100e90fa slli r7,r2,3 - 5b8c: b80b883a mov r5,r23 - 5b90: 398f883a add r7,r7,r6 - 5b94: 38bffe17 ldw r2,-8(r7) - 5b98: d9800517 ldw r6,20(sp) - 5b9c: 38ffff17 ldw r3,-4(r7) - 5ba0: 37000044 addi fp,r6,1 - 5ba4: 180f883a mov r7,r3 - 5ba8: 100d883a mov r6,r2 - 5bac: 00092540 call 9254 <__muldf3> - 5bb0: a80b883a mov r5,r21 - 5bb4: a009883a mov r4,r20 - 5bb8: 182f883a mov r23,r3 - 5bbc: 102d883a mov r22,r2 - 5bc0: 0009c100 call 9c10 <__fixdfsi> - 5bc4: 1009883a mov r4,r2 - 5bc8: 1027883a mov r19,r2 - 5bcc: 0009b180 call 9b18 <__floatsidf> - 5bd0: a80b883a mov r5,r21 - 5bd4: a009883a mov r4,r20 - 5bd8: 180f883a mov r7,r3 - 5bdc: 100d883a mov r6,r2 - 5be0: 00091600 call 9160 <__subdf3> - 5be4: 180b883a mov r5,r3 - 5be8: d8c00517 ldw r3,20(sp) - 5bec: 9cc00c04 addi r19,r19,48 - 5bf0: 1009883a mov r4,r2 - 5bf4: 1cc00005 stb r19,0(r3) - 5bf8: 2021883a mov r16,r4 - 5bfc: d9000317 ldw r4,12(sp) - 5c00: 00800044 movi r2,1 - 5c04: 2823883a mov r17,r5 - 5c08: 20802226 beq r4,r2,5c94 <_dtoa_r+0x13fc> - 5c0c: 1029883a mov r20,r2 - 5c10: 0005883a mov r2,zero - 5c14: 00d00934 movhi r3,16420 - 5c18: 180f883a mov r7,r3 - 5c1c: 100d883a mov r6,r2 - 5c20: 880b883a mov r5,r17 - 5c24: 8009883a mov r4,r16 - 5c28: 00092540 call 9254 <__muldf3> - 5c2c: 180b883a mov r5,r3 - 5c30: 1009883a mov r4,r2 - 5c34: 1823883a mov r17,r3 - 5c38: 1021883a mov r16,r2 - 5c3c: 0009c100 call 9c10 <__fixdfsi> - 5c40: 1009883a mov r4,r2 - 5c44: 102b883a mov r21,r2 - 5c48: 0009b180 call 9b18 <__floatsidf> - 5c4c: 880b883a mov r5,r17 - 5c50: 8009883a mov r4,r16 - 5c54: 180f883a mov r7,r3 - 5c58: 100d883a mov r6,r2 - 5c5c: 00091600 call 9160 <__subdf3> - 5c60: 180b883a mov r5,r3 - 5c64: d8c00517 ldw r3,20(sp) - 5c68: 1009883a mov r4,r2 - 5c6c: ad400c04 addi r21,r21,48 - 5c70: 1d05883a add r2,r3,r20 - 5c74: 15400005 stb r21,0(r2) - 5c78: 2021883a mov r16,r4 - 5c7c: d9000317 ldw r4,12(sp) - 5c80: a5000044 addi r20,r20,1 - 5c84: 2823883a mov r17,r5 - 5c88: a13fe11e bne r20,r4,5c10 <_dtoa_r+0x1378> - 5c8c: e505883a add r2,fp,r20 - 5c90: 173fffc4 addi fp,r2,-1 - 5c94: 0025883a mov r18,zero - 5c98: 04cff834 movhi r19,16352 - 5c9c: b009883a mov r4,r22 - 5ca0: b80b883a mov r5,r23 - 5ca4: 900d883a mov r6,r18 - 5ca8: 980f883a mov r7,r19 - 5cac: 00091e00 call 91e0 <__adddf3> - 5cb0: 180b883a mov r5,r3 - 5cb4: 1009883a mov r4,r2 - 5cb8: 800d883a mov r6,r16 - 5cbc: 880f883a mov r7,r17 - 5cc0: 0009a900 call 9a90 <__ltdf2> - 5cc4: 103cab16 blt r2,zero,4f74 <_dtoa_r+0x6dc> - 5cc8: 0009883a mov r4,zero - 5ccc: 980b883a mov r5,r19 - 5cd0: b80f883a mov r7,r23 - 5cd4: b00d883a mov r6,r22 - 5cd8: 00091600 call 9160 <__subdf3> - 5cdc: 180b883a mov r5,r3 - 5ce0: 880f883a mov r7,r17 - 5ce4: 1009883a mov r4,r2 - 5ce8: 800d883a mov r6,r16 - 5cec: 00099800 call 9980 <__gtdf2> - 5cf0: 00bc470e bge zero,r2,4e10 <_dtoa_r+0x578> - 5cf4: 00c00c04 movi r3,48 - 5cf8: e73fffc4 addi fp,fp,-1 - 5cfc: e0800007 ldb r2,0(fp) - 5d00: 10fffd26 beq r2,r3,5cf8 <_dtoa_r+0x1460> - 5d04: d9800417 ldw r6,16(sp) - 5d08: e7000044 addi fp,fp,1 - 5d0c: d9800d15 stw r6,52(sp) - 5d10: 003cab06 br 4fc0 <_dtoa_r+0x728> - 5d14: d8c00f17 ldw r3,60(sp) - 5d18: d9001117 ldw r4,68(sp) - 5d1c: 20e1c83a sub r16,r4,r3 - 5d20: 0007883a mov r3,zero - 5d24: 003d9b06 br 5394 <_dtoa_r+0xafc> - 5d28: 00800e44 movi r2,57 - 5d2c: b0800005 stb r2,0(r22) - 5d30: b5800044 addi r22,r22,1 - 5d34: 003dc106 br 543c <_dtoa_r+0xba4> - 5d38: 05800084 movi r22,2 - 5d3c: 003bf706 br 4d1c <_dtoa_r+0x484> - 5d40: d9000f17 ldw r4,60(sp) - 5d44: 013c000e bge zero,r4,4d48 <_dtoa_r+0x4b0> - 5d48: d9800e17 ldw r6,56(sp) - 5d4c: 01bc300e bge zero,r6,4e10 <_dtoa_r+0x578> - 5d50: 0005883a mov r2,zero - 5d54: 00d00934 movhi r3,16420 - 5d58: a80b883a mov r5,r21 - 5d5c: 180f883a mov r7,r3 - 5d60: a009883a mov r4,r20 - 5d64: 100d883a mov r6,r2 - 5d68: 00092540 call 9254 <__muldf3> - 5d6c: b1000044 addi r4,r22,1 - 5d70: 1021883a mov r16,r2 - 5d74: 1823883a mov r17,r3 - 5d78: 0009b180 call 9b18 <__floatsidf> - 5d7c: 880b883a mov r5,r17 - 5d80: 8009883a mov r4,r16 - 5d84: 180f883a mov r7,r3 - 5d88: 100d883a mov r6,r2 - 5d8c: 00092540 call 9254 <__muldf3> - 5d90: 0011883a mov r8,zero - 5d94: 02500734 movhi r9,16412 - 5d98: 180b883a mov r5,r3 - 5d9c: 480f883a mov r7,r9 - 5da0: 1009883a mov r4,r2 - 5da4: 400d883a mov r6,r8 - 5da8: 00091e00 call 91e0 <__adddf3> - 5dac: 102d883a mov r22,r2 - 5db0: 00bf3034 movhi r2,64704 - 5db4: 10ef883a add r23,r2,r3 - 5db8: d8800d17 ldw r2,52(sp) - 5dbc: d8c00e17 ldw r3,56(sp) - 5dc0: 8029883a mov r20,r16 - 5dc4: 10bfffc4 addi r2,r2,-1 - 5dc8: 882b883a mov r21,r17 - 5dcc: d8800415 stw r2,16(sp) - 5dd0: d8c00315 stw r3,12(sp) - 5dd4: 003e8306 br 57e4 <_dtoa_r+0xf4c> - 5dd8: d8800117 ldw r2,4(sp) - 5ddc: dc001117 ldw r16,68(sp) - 5de0: dc801017 ldw r18,64(sp) - 5de4: 00c00d84 movi r3,54 - 5de8: 1887c83a sub r3,r3,r2 - 5dec: 003d6906 br 5394 <_dtoa_r+0xafc> - 5df0: 01800044 movi r6,1 - 5df4: 3021883a mov r16,r6 - 5df8: d9800f15 stw r6,60(sp) - 5dfc: d9802615 stw r6,152(sp) - 5e00: d9800e15 stw r6,56(sp) - 5e04: 003b9306 br 4c54 <_dtoa_r+0x3bc> - 5e08: b021883a mov r16,r22 - 5e0c: dd800f15 stw r22,60(sp) - 5e10: 003b9006 br 4c54 <_dtoa_r+0x3bc> - 5e14: 103e221e bne r2,zero,56a0 <_dtoa_r+0xe08> - 5e18: b880004c andi r2,r23,1 - 5e1c: 1005003a cmpeq r2,r2,zero - 5e20: 103e1f1e bne r2,zero,56a0 <_dtoa_r+0xe08> - 5e24: 003e1b06 br 5694 <_dtoa_r+0xdfc> - 5e28: d9001617 ldw r4,88(sp) - 5e2c: 980b883a mov r5,r19 - 5e30: 01800284 movi r6,10 - 5e34: 000f883a mov r7,zero - 5e38: 00074b80 call 74b8 <__multadd> - 5e3c: d8c00e17 ldw r3,56(sp) - 5e40: 1027883a mov r19,r2 - 5e44: d8c00f15 stw r3,60(sp) - 5e48: 003cd306 br 5198 <_dtoa_r+0x900> - -00005e4c <__sflags>: - 5e4c: 28c00007 ldb r3,0(r5) - 5e50: 00801c84 movi r2,114 - 5e54: 18800926 beq r3,r2,5e7c <__sflags+0x30> - 5e58: 00801dc4 movi r2,119 - 5e5c: 18801426 beq r3,r2,5eb0 <__sflags+0x64> - 5e60: 00801844 movi r2,97 - 5e64: 18801626 beq r3,r2,5ec0 <__sflags+0x74> - 5e68: 0007883a mov r3,zero - 5e6c: 00800584 movi r2,22 - 5e70: 20800015 stw r2,0(r4) - 5e74: 1805883a mov r2,r3 - 5e78: f800283a ret - 5e7c: 000f883a mov r7,zero - 5e80: 0011883a mov r8,zero - 5e84: 00c00104 movi r3,4 - 5e88: 28800047 ldb r2,1(r5) - 5e8c: 10000426 beq r2,zero,5ea0 <__sflags+0x54> - 5e90: 01000ac4 movi r4,43 - 5e94: 11000e26 beq r2,r4,5ed0 <__sflags+0x84> - 5e98: 28800087 ldb r2,2(r5) - 5e9c: 11000c26 beq r2,r4,5ed0 <__sflags+0x84> - 5ea0: 3a04b03a or r2,r7,r8 - 5ea4: 30800015 stw r2,0(r6) - 5ea8: 1805883a mov r2,r3 - 5eac: f800283a ret - 5eb0: 01c00044 movi r7,1 - 5eb4: 02018004 movi r8,1536 - 5eb8: 00c00204 movi r3,8 - 5ebc: 003ff206 br 5e88 <__sflags+0x3c> - 5ec0: 01c00044 movi r7,1 - 5ec4: 02008204 movi r8,520 - 5ec8: 00c04204 movi r3,264 - 5ecc: 003fee06 br 5e88 <__sflags+0x3c> - 5ed0: 00bffcc4 movi r2,-13 - 5ed4: 1884703a and r2,r3,r2 - 5ed8: 01c00084 movi r7,2 - 5edc: 10c00414 ori r3,r2,16 - 5ee0: 3a04b03a or r2,r7,r8 - 5ee4: 30800015 stw r2,0(r6) - 5ee8: 003fef06 br 5ea8 <__sflags+0x5c> - -00005eec <__sfvwrite_r>: - 5eec: 30800217 ldw r2,8(r6) - 5ef0: defff504 addi sp,sp,-44 - 5ef4: df000915 stw fp,36(sp) - 5ef8: dd800715 stw r22,28(sp) - 5efc: dc800315 stw r18,12(sp) - 5f00: dfc00a15 stw ra,40(sp) - 5f04: ddc00815 stw r23,32(sp) - 5f08: dd400615 stw r21,24(sp) - 5f0c: dd000515 stw r20,20(sp) - 5f10: dcc00415 stw r19,16(sp) - 5f14: dc400215 stw r17,8(sp) - 5f18: dc000115 stw r16,4(sp) - 5f1c: 302d883a mov r22,r6 - 5f20: 2039883a mov fp,r4 - 5f24: 2825883a mov r18,r5 - 5f28: 10001c26 beq r2,zero,5f9c <__sfvwrite_r+0xb0> - 5f2c: 29c0030b ldhu r7,12(r5) - 5f30: 3880020c andi r2,r7,8 - 5f34: 10002726 beq r2,zero,5fd4 <__sfvwrite_r+0xe8> - 5f38: 28800417 ldw r2,16(r5) - 5f3c: 10002526 beq r2,zero,5fd4 <__sfvwrite_r+0xe8> - 5f40: 3880008c andi r2,r7,2 - 5f44: b5400017 ldw r21,0(r22) - 5f48: 10002826 beq r2,zero,5fec <__sfvwrite_r+0x100> - 5f4c: 0021883a mov r16,zero - 5f50: 0023883a mov r17,zero - 5f54: 880d883a mov r6,r17 - 5f58: e009883a mov r4,fp - 5f5c: 00810004 movi r2,1024 - 5f60: 80006e26 beq r16,zero,611c <__sfvwrite_r+0x230> - 5f64: 800f883a mov r7,r16 - 5f68: 91400717 ldw r5,28(r18) - 5f6c: 1400012e bgeu r2,r16,5f74 <__sfvwrite_r+0x88> - 5f70: 100f883a mov r7,r2 - 5f74: 90c00917 ldw r3,36(r18) - 5f78: 183ee83a callr r3 - 5f7c: 1007883a mov r3,r2 - 5f80: 80a1c83a sub r16,r16,r2 - 5f84: 88a3883a add r17,r17,r2 - 5f88: 00806d0e bge zero,r2,6140 <__sfvwrite_r+0x254> - 5f8c: b0800217 ldw r2,8(r22) - 5f90: 10c5c83a sub r2,r2,r3 - 5f94: b0800215 stw r2,8(r22) - 5f98: 103fee1e bne r2,zero,5f54 <__sfvwrite_r+0x68> - 5f9c: 0009883a mov r4,zero - 5fa0: 2005883a mov r2,r4 - 5fa4: dfc00a17 ldw ra,40(sp) - 5fa8: df000917 ldw fp,36(sp) - 5fac: ddc00817 ldw r23,32(sp) - 5fb0: dd800717 ldw r22,28(sp) - 5fb4: dd400617 ldw r21,24(sp) - 5fb8: dd000517 ldw r20,20(sp) - 5fbc: dcc00417 ldw r19,16(sp) - 5fc0: dc800317 ldw r18,12(sp) - 5fc4: dc400217 ldw r17,8(sp) - 5fc8: dc000117 ldw r16,4(sp) - 5fcc: dec00b04 addi sp,sp,44 - 5fd0: f800283a ret - 5fd4: 00044a80 call 44a8 <__swsetup_r> - 5fd8: 1000e41e bne r2,zero,636c <__sfvwrite_r+0x480> - 5fdc: 91c0030b ldhu r7,12(r18) - 5fe0: b5400017 ldw r21,0(r22) - 5fe4: 3880008c andi r2,r7,2 - 5fe8: 103fd81e bne r2,zero,5f4c <__sfvwrite_r+0x60> - 5fec: 3880004c andi r2,r7,1 - 5ff0: 1005003a cmpeq r2,r2,zero - 5ff4: 10005726 beq r2,zero,6154 <__sfvwrite_r+0x268> - 5ff8: 0029883a mov r20,zero - 5ffc: 002f883a mov r23,zero - 6000: a0004226 beq r20,zero,610c <__sfvwrite_r+0x220> - 6004: 3880800c andi r2,r7,512 - 6008: 94000217 ldw r16,8(r18) - 600c: 10008b26 beq r2,zero,623c <__sfvwrite_r+0x350> - 6010: 800d883a mov r6,r16 - 6014: a400a536 bltu r20,r16,62ac <__sfvwrite_r+0x3c0> - 6018: 3881200c andi r2,r7,1152 - 601c: 10002726 beq r2,zero,60bc <__sfvwrite_r+0x1d0> - 6020: 90800517 ldw r2,20(r18) - 6024: 92000417 ldw r8,16(r18) - 6028: 91400017 ldw r5,0(r18) - 602c: 1087883a add r3,r2,r2 - 6030: 1887883a add r3,r3,r2 - 6034: 1808d7fa srli r4,r3,31 - 6038: 2a21c83a sub r16,r5,r8 - 603c: 80800044 addi r2,r16,1 - 6040: 20c9883a add r4,r4,r3 - 6044: 2027d07a srai r19,r4,1 - 6048: a085883a add r2,r20,r2 - 604c: 980d883a mov r6,r19 - 6050: 9880022e bgeu r19,r2,605c <__sfvwrite_r+0x170> - 6054: 1027883a mov r19,r2 - 6058: 100d883a mov r6,r2 - 605c: 3881000c andi r2,r7,1024 - 6060: 1000b826 beq r2,zero,6344 <__sfvwrite_r+0x458> - 6064: 300b883a mov r5,r6 - 6068: e009883a mov r4,fp - 606c: 00017640 call 1764 <_malloc_r> - 6070: 10003126 beq r2,zero,6138 <__sfvwrite_r+0x24c> - 6074: 91400417 ldw r5,16(r18) - 6078: 1009883a mov r4,r2 - 607c: 800d883a mov r6,r16 - 6080: 1023883a mov r17,r2 - 6084: 00066180 call 6618 - 6088: 90c0030b ldhu r3,12(r18) - 608c: 00beffc4 movi r2,-1025 - 6090: 1886703a and r3,r3,r2 - 6094: 18c02014 ori r3,r3,128 - 6098: 90c0030d sth r3,12(r18) - 609c: 9c07c83a sub r3,r19,r16 - 60a0: 8c05883a add r2,r17,r16 - 60a4: a00d883a mov r6,r20 - 60a8: a021883a mov r16,r20 - 60ac: 90800015 stw r2,0(r18) - 60b0: 90c00215 stw r3,8(r18) - 60b4: 94400415 stw r17,16(r18) - 60b8: 94c00515 stw r19,20(r18) - 60bc: 91000017 ldw r4,0(r18) - 60c0: b80b883a mov r5,r23 - 60c4: a023883a mov r17,r20 - 60c8: 00066b80 call 66b8 - 60cc: 90c00217 ldw r3,8(r18) - 60d0: 90800017 ldw r2,0(r18) - 60d4: a027883a mov r19,r20 - 60d8: 1c07c83a sub r3,r3,r16 - 60dc: 1405883a add r2,r2,r16 - 60e0: 90c00215 stw r3,8(r18) - 60e4: a021883a mov r16,r20 - 60e8: 90800015 stw r2,0(r18) - 60ec: b0800217 ldw r2,8(r22) - 60f0: 1405c83a sub r2,r2,r16 - 60f4: b0800215 stw r2,8(r22) - 60f8: 103fa826 beq r2,zero,5f9c <__sfvwrite_r+0xb0> - 60fc: a469c83a sub r20,r20,r17 - 6100: 91c0030b ldhu r7,12(r18) - 6104: bcef883a add r23,r23,r19 - 6108: a03fbe1e bne r20,zero,6004 <__sfvwrite_r+0x118> - 610c: adc00017 ldw r23,0(r21) - 6110: ad000117 ldw r20,4(r21) - 6114: ad400204 addi r21,r21,8 - 6118: 003fb906 br 6000 <__sfvwrite_r+0x114> - 611c: ac400017 ldw r17,0(r21) - 6120: ac000117 ldw r16,4(r21) - 6124: ad400204 addi r21,r21,8 - 6128: 003f8a06 br 5f54 <__sfvwrite_r+0x68> - 612c: 91400417 ldw r5,16(r18) - 6130: e009883a mov r4,fp - 6134: 0000b7c0 call b7c <_free_r> - 6138: 00800304 movi r2,12 - 613c: e0800015 stw r2,0(fp) - 6140: 9080030b ldhu r2,12(r18) - 6144: 013fffc4 movi r4,-1 - 6148: 10801014 ori r2,r2,64 - 614c: 9080030d sth r2,12(r18) - 6150: 003f9306 br 5fa0 <__sfvwrite_r+0xb4> - 6154: 0027883a mov r19,zero - 6158: 002f883a mov r23,zero - 615c: d8000015 stw zero,0(sp) - 6160: 0029883a mov r20,zero - 6164: 98001e26 beq r19,zero,61e0 <__sfvwrite_r+0x2f4> - 6168: d8c00017 ldw r3,0(sp) - 616c: 1804c03a cmpne r2,r3,zero - 6170: 10005e26 beq r2,zero,62ec <__sfvwrite_r+0x400> - 6174: 9821883a mov r16,r19 - 6178: a4c0012e bgeu r20,r19,6180 <__sfvwrite_r+0x294> - 617c: a021883a mov r16,r20 - 6180: 91000017 ldw r4,0(r18) - 6184: 90800417 ldw r2,16(r18) - 6188: 91800217 ldw r6,8(r18) - 618c: 91c00517 ldw r7,20(r18) - 6190: 1100022e bgeu r2,r4,619c <__sfvwrite_r+0x2b0> - 6194: 31e3883a add r17,r6,r7 - 6198: 8c001616 blt r17,r16,61f4 <__sfvwrite_r+0x308> - 619c: 81c03816 blt r16,r7,6280 <__sfvwrite_r+0x394> - 61a0: 90c00917 ldw r3,36(r18) - 61a4: 91400717 ldw r5,28(r18) - 61a8: e009883a mov r4,fp - 61ac: b80d883a mov r6,r23 - 61b0: 183ee83a callr r3 - 61b4: 1023883a mov r17,r2 - 61b8: 00bfe10e bge zero,r2,6140 <__sfvwrite_r+0x254> - 61bc: a469c83a sub r20,r20,r17 - 61c0: a0001826 beq r20,zero,6224 <__sfvwrite_r+0x338> - 61c4: b0800217 ldw r2,8(r22) - 61c8: 1445c83a sub r2,r2,r17 - 61cc: b0800215 stw r2,8(r22) - 61d0: 103f7226 beq r2,zero,5f9c <__sfvwrite_r+0xb0> - 61d4: 9c67c83a sub r19,r19,r17 - 61d8: bc6f883a add r23,r23,r17 - 61dc: 983fe21e bne r19,zero,6168 <__sfvwrite_r+0x27c> - 61e0: adc00017 ldw r23,0(r21) - 61e4: acc00117 ldw r19,4(r21) - 61e8: ad400204 addi r21,r21,8 - 61ec: d8000015 stw zero,0(sp) - 61f0: 003fdc06 br 6164 <__sfvwrite_r+0x278> - 61f4: b80b883a mov r5,r23 - 61f8: 880d883a mov r6,r17 - 61fc: 00066b80 call 66b8 - 6200: 90c00017 ldw r3,0(r18) - 6204: e009883a mov r4,fp - 6208: 900b883a mov r5,r18 - 620c: 1c47883a add r3,r3,r17 - 6210: 90c00015 stw r3,0(r18) - 6214: 000041c0 call 41c <_fflush_r> - 6218: 103fc91e bne r2,zero,6140 <__sfvwrite_r+0x254> - 621c: a469c83a sub r20,r20,r17 - 6220: a03fe81e bne r20,zero,61c4 <__sfvwrite_r+0x2d8> - 6224: e009883a mov r4,fp - 6228: 900b883a mov r5,r18 - 622c: 000041c0 call 41c <_fflush_r> - 6230: 103fc31e bne r2,zero,6140 <__sfvwrite_r+0x254> - 6234: d8000015 stw zero,0(sp) - 6238: 003fe206 br 61c4 <__sfvwrite_r+0x2d8> - 623c: 91000017 ldw r4,0(r18) - 6240: 90800417 ldw r2,16(r18) - 6244: 1100022e bgeu r2,r4,6250 <__sfvwrite_r+0x364> - 6248: 8023883a mov r17,r16 - 624c: 85003136 bltu r16,r20,6314 <__sfvwrite_r+0x428> - 6250: 91c00517 ldw r7,20(r18) - 6254: a1c01836 bltu r20,r7,62b8 <__sfvwrite_r+0x3cc> - 6258: 90c00917 ldw r3,36(r18) - 625c: 91400717 ldw r5,28(r18) - 6260: e009883a mov r4,fp - 6264: b80d883a mov r6,r23 - 6268: 183ee83a callr r3 - 626c: 1021883a mov r16,r2 - 6270: 00bfb30e bge zero,r2,6140 <__sfvwrite_r+0x254> - 6274: 1023883a mov r17,r2 - 6278: 1027883a mov r19,r2 - 627c: 003f9b06 br 60ec <__sfvwrite_r+0x200> - 6280: b80b883a mov r5,r23 - 6284: 800d883a mov r6,r16 - 6288: 00066b80 call 66b8 - 628c: 90c00217 ldw r3,8(r18) - 6290: 90800017 ldw r2,0(r18) - 6294: 8023883a mov r17,r16 - 6298: 1c07c83a sub r3,r3,r16 - 629c: 1405883a add r2,r2,r16 - 62a0: 90c00215 stw r3,8(r18) - 62a4: 90800015 stw r2,0(r18) - 62a8: 003fc406 br 61bc <__sfvwrite_r+0x2d0> - 62ac: a00d883a mov r6,r20 - 62b0: a021883a mov r16,r20 - 62b4: 003f8106 br 60bc <__sfvwrite_r+0x1d0> - 62b8: b80b883a mov r5,r23 - 62bc: a00d883a mov r6,r20 - 62c0: 00066b80 call 66b8 - 62c4: 90c00217 ldw r3,8(r18) - 62c8: 90800017 ldw r2,0(r18) - 62cc: a021883a mov r16,r20 - 62d0: 1d07c83a sub r3,r3,r20 - 62d4: 1505883a add r2,r2,r20 - 62d8: a023883a mov r17,r20 - 62dc: a027883a mov r19,r20 - 62e0: 90c00215 stw r3,8(r18) - 62e4: 90800015 stw r2,0(r18) - 62e8: 003f8006 br 60ec <__sfvwrite_r+0x200> - 62ec: b809883a mov r4,r23 - 62f0: 01400284 movi r5,10 - 62f4: 980d883a mov r6,r19 - 62f8: 00065340 call 6534 - 62fc: 10001726 beq r2,zero,635c <__sfvwrite_r+0x470> - 6300: 15c5c83a sub r2,r2,r23 - 6304: 15000044 addi r20,r2,1 - 6308: 00800044 movi r2,1 - 630c: d8800015 stw r2,0(sp) - 6310: 003f9806 br 6174 <__sfvwrite_r+0x288> - 6314: b80b883a mov r5,r23 - 6318: 800d883a mov r6,r16 - 631c: 00066b80 call 66b8 - 6320: 90c00017 ldw r3,0(r18) - 6324: e009883a mov r4,fp - 6328: 900b883a mov r5,r18 - 632c: 1c07883a add r3,r3,r16 - 6330: 90c00015 stw r3,0(r18) - 6334: 8027883a mov r19,r16 - 6338: 000041c0 call 41c <_fflush_r> - 633c: 103f6b26 beq r2,zero,60ec <__sfvwrite_r+0x200> - 6340: 003f7f06 br 6140 <__sfvwrite_r+0x254> - 6344: 400b883a mov r5,r8 - 6348: e009883a mov r4,fp - 634c: 000789c0 call 789c <_realloc_r> - 6350: 103f7626 beq r2,zero,612c <__sfvwrite_r+0x240> - 6354: 1023883a mov r17,r2 - 6358: 003f5006 br 609c <__sfvwrite_r+0x1b0> - 635c: 00c00044 movi r3,1 - 6360: 9d000044 addi r20,r19,1 - 6364: d8c00015 stw r3,0(sp) - 6368: 003f8206 br 6174 <__sfvwrite_r+0x288> - 636c: 9080030b ldhu r2,12(r18) - 6370: 00c00244 movi r3,9 - 6374: 013fffc4 movi r4,-1 - 6378: 10801014 ori r2,r2,64 - 637c: 9080030d sth r2,12(r18) - 6380: e0c00015 stw r3,0(fp) - 6384: 003f0606 br 5fa0 <__sfvwrite_r+0xb4> - -00006388 <_isatty_r>: - 6388: defffd04 addi sp,sp,-12 - 638c: dc000015 stw r16,0(sp) - 6390: 04000074 movhi r16,1 - 6394: 8407a504 addi r16,r16,7828 - 6398: dc400115 stw r17,4(sp) - 639c: 80000015 stw zero,0(r16) - 63a0: 2023883a mov r17,r4 - 63a4: 2809883a mov r4,r5 - 63a8: dfc00215 stw ra,8(sp) - 63ac: 000a97c0 call a97c - 63b0: 1007883a mov r3,r2 - 63b4: 00bfffc4 movi r2,-1 - 63b8: 18800626 beq r3,r2,63d4 <_isatty_r+0x4c> - 63bc: 1805883a mov r2,r3 - 63c0: dfc00217 ldw ra,8(sp) - 63c4: dc400117 ldw r17,4(sp) - 63c8: dc000017 ldw r16,0(sp) - 63cc: dec00304 addi sp,sp,12 - 63d0: f800283a ret - 63d4: 80800017 ldw r2,0(r16) - 63d8: 103ff826 beq r2,zero,63bc <_isatty_r+0x34> - 63dc: 88800015 stw r2,0(r17) - 63e0: 1805883a mov r2,r3 - 63e4: dfc00217 ldw ra,8(sp) - 63e8: dc400117 ldw r17,4(sp) - 63ec: dc000017 ldw r16,0(sp) - 63f0: dec00304 addi sp,sp,12 - 63f4: f800283a ret - -000063f8 <__locale_charset>: - 63f8: d0a00517 ldw r2,-32748(gp) - 63fc: f800283a ret - -00006400 <_localeconv_r>: - 6400: 00800074 movhi r2,1 - 6404: 10b89804 addi r2,r2,-7584 - 6408: f800283a ret - -0000640c : - 640c: 00800074 movhi r2,1 - 6410: 1080b204 addi r2,r2,712 - 6414: 11000017 ldw r4,0(r2) - 6418: 00064001 jmpi 6400 <_localeconv_r> - -0000641c <_setlocale_r>: - 641c: defffc04 addi sp,sp,-16 - 6420: 00c00074 movhi r3,1 - 6424: 18f86e04 addi r3,r3,-7752 - 6428: dc800215 stw r18,8(sp) - 642c: dc400115 stw r17,4(sp) - 6430: dc000015 stw r16,0(sp) - 6434: 2023883a mov r17,r4 - 6438: 2825883a mov r18,r5 - 643c: dfc00315 stw ra,12(sp) - 6440: 3021883a mov r16,r6 - 6444: 3009883a mov r4,r6 - 6448: 180b883a mov r5,r3 - 644c: 30000926 beq r6,zero,6474 <_setlocale_r+0x58> - 6450: 0007f000 call 7f00 - 6454: 8009883a mov r4,r16 - 6458: 01400074 movhi r5,1 - 645c: 29787f04 addi r5,r5,-7684 - 6460: 10000b1e bne r2,zero,6490 <_setlocale_r+0x74> - 6464: 8c000d15 stw r16,52(r17) - 6468: 8c800c15 stw r18,48(r17) - 646c: 00c00074 movhi r3,1 - 6470: 18f86e04 addi r3,r3,-7752 - 6474: 1805883a mov r2,r3 - 6478: dfc00317 ldw ra,12(sp) - 647c: dc800217 ldw r18,8(sp) - 6480: dc400117 ldw r17,4(sp) - 6484: dc000017 ldw r16,0(sp) - 6488: dec00404 addi sp,sp,16 - 648c: f800283a ret - 6490: 0007f000 call 7f00 - 6494: 0007883a mov r3,zero - 6498: 103ff226 beq r2,zero,6464 <_setlocale_r+0x48> - 649c: 003ff506 br 6474 <_setlocale_r+0x58> - -000064a0 : - 64a0: 01800074 movhi r6,1 - 64a4: 3180b204 addi r6,r6,712 - 64a8: 2007883a mov r3,r4 - 64ac: 31000017 ldw r4,0(r6) - 64b0: 280d883a mov r6,r5 - 64b4: 180b883a mov r5,r3 - 64b8: 000641c1 jmpi 641c <_setlocale_r> - -000064bc <_lseek_r>: - 64bc: defffd04 addi sp,sp,-12 - 64c0: dc000015 stw r16,0(sp) - 64c4: 04000074 movhi r16,1 - 64c8: 8407a504 addi r16,r16,7828 - 64cc: dc400115 stw r17,4(sp) - 64d0: 80000015 stw zero,0(r16) - 64d4: 2023883a mov r17,r4 - 64d8: 2809883a mov r4,r5 - 64dc: 300b883a mov r5,r6 - 64e0: 380d883a mov r6,r7 - 64e4: dfc00215 stw ra,8(sp) - 64e8: 000ab8c0 call ab8c - 64ec: 1007883a mov r3,r2 - 64f0: 00bfffc4 movi r2,-1 - 64f4: 18800626 beq r3,r2,6510 <_lseek_r+0x54> - 64f8: 1805883a mov r2,r3 - 64fc: dfc00217 ldw ra,8(sp) - 6500: dc400117 ldw r17,4(sp) - 6504: dc000017 ldw r16,0(sp) - 6508: dec00304 addi sp,sp,12 - 650c: f800283a ret - 6510: 80800017 ldw r2,0(r16) - 6514: 103ff826 beq r2,zero,64f8 <_lseek_r+0x3c> - 6518: 88800015 stw r2,0(r17) - 651c: 1805883a mov r2,r3 - 6520: dfc00217 ldw ra,8(sp) - 6524: dc400117 ldw r17,4(sp) - 6528: dc000017 ldw r16,0(sp) - 652c: dec00304 addi sp,sp,12 - 6530: f800283a ret - -00006534 : - 6534: 008000c4 movi r2,3 - 6538: 29403fcc andi r5,r5,255 - 653c: 2007883a mov r3,r4 - 6540: 1180022e bgeu r2,r6,654c - 6544: 2084703a and r2,r4,r2 - 6548: 10000b26 beq r2,zero,6578 - 654c: 313fffc4 addi r4,r6,-1 - 6550: 3000051e bne r6,zero,6568 - 6554: 00002c06 br 6608 - 6558: 213fffc4 addi r4,r4,-1 - 655c: 00bfffc4 movi r2,-1 - 6560: 18c00044 addi r3,r3,1 - 6564: 20802826 beq r4,r2,6608 - 6568: 18800003 ldbu r2,0(r3) - 656c: 28bffa1e bne r5,r2,6558 - 6570: 1805883a mov r2,r3 - 6574: f800283a ret - 6578: 0011883a mov r8,zero - 657c: 0007883a mov r3,zero - 6580: 01c00104 movi r7,4 - 6584: 4004923a slli r2,r8,8 - 6588: 18c00044 addi r3,r3,1 - 658c: 1151883a add r8,r2,r5 - 6590: 19fffc1e bne r3,r7,6584 - 6594: 02bfbff4 movhi r10,65279 - 6598: 52bfbfc4 addi r10,r10,-257 - 659c: 02602074 movhi r9,32897 - 65a0: 4a602004 addi r9,r9,-32640 - 65a4: 02c000c4 movi r11,3 - 65a8: 20800017 ldw r2,0(r4) - 65ac: 31bfff04 addi r6,r6,-4 - 65b0: 200f883a mov r7,r4 - 65b4: 1204f03a xor r2,r2,r8 - 65b8: 1287883a add r3,r2,r10 - 65bc: 1a46703a and r3,r3,r9 - 65c0: 0084303a nor r2,zero,r2 - 65c4: 10c4703a and r2,r2,r3 - 65c8: 10000b26 beq r2,zero,65f8 - 65cc: 20800003 ldbu r2,0(r4) - 65d0: 28800f26 beq r5,r2,6610 - 65d4: 20800043 ldbu r2,1(r4) - 65d8: 21c00044 addi r7,r4,1 - 65dc: 28800c26 beq r5,r2,6610 - 65e0: 20800083 ldbu r2,2(r4) - 65e4: 21c00084 addi r7,r4,2 - 65e8: 28800926 beq r5,r2,6610 - 65ec: 208000c3 ldbu r2,3(r4) - 65f0: 21c000c4 addi r7,r4,3 - 65f4: 28800626 beq r5,r2,6610 - 65f8: 21000104 addi r4,r4,4 - 65fc: 59bfea36 bltu r11,r6,65a8 - 6600: 2007883a mov r3,r4 - 6604: 003fd106 br 654c - 6608: 0005883a mov r2,zero - 660c: f800283a ret - 6610: 3805883a mov r2,r7 - 6614: f800283a ret - -00006618 : - 6618: 01c003c4 movi r7,15 - 661c: 2007883a mov r3,r4 - 6620: 3980032e bgeu r7,r6,6630 - 6624: 2904b03a or r2,r5,r4 - 6628: 108000cc andi r2,r2,3 - 662c: 10000926 beq r2,zero,6654 - 6630: 30000626 beq r6,zero,664c - 6634: 30cd883a add r6,r6,r3 - 6638: 28800003 ldbu r2,0(r5) - 663c: 29400044 addi r5,r5,1 - 6640: 18800005 stb r2,0(r3) - 6644: 18c00044 addi r3,r3,1 - 6648: 30fffb1e bne r6,r3,6638 - 664c: 2005883a mov r2,r4 - 6650: f800283a ret - 6654: 3811883a mov r8,r7 - 6658: 200f883a mov r7,r4 - 665c: 28c00017 ldw r3,0(r5) - 6660: 31bffc04 addi r6,r6,-16 - 6664: 38c00015 stw r3,0(r7) - 6668: 28800117 ldw r2,4(r5) - 666c: 38800115 stw r2,4(r7) - 6670: 28c00217 ldw r3,8(r5) - 6674: 38c00215 stw r3,8(r7) - 6678: 28800317 ldw r2,12(r5) - 667c: 29400404 addi r5,r5,16 - 6680: 38800315 stw r2,12(r7) - 6684: 39c00404 addi r7,r7,16 - 6688: 41bff436 bltu r8,r6,665c - 668c: 008000c4 movi r2,3 - 6690: 1180072e bgeu r2,r6,66b0 - 6694: 1007883a mov r3,r2 - 6698: 28800017 ldw r2,0(r5) - 669c: 31bfff04 addi r6,r6,-4 - 66a0: 29400104 addi r5,r5,4 - 66a4: 38800015 stw r2,0(r7) - 66a8: 39c00104 addi r7,r7,4 - 66ac: 19bffa36 bltu r3,r6,6698 - 66b0: 3807883a mov r3,r7 - 66b4: 003fde06 br 6630 - -000066b8 : - 66b8: 2807883a mov r3,r5 - 66bc: 2011883a mov r8,r4 - 66c0: 29000c2e bgeu r5,r4,66f4 - 66c4: 298f883a add r7,r5,r6 - 66c8: 21c00a2e bgeu r4,r7,66f4 - 66cc: 30000726 beq r6,zero,66ec - 66d0: 2187883a add r3,r4,r6 - 66d4: 198dc83a sub r6,r3,r6 - 66d8: 39ffffc4 addi r7,r7,-1 - 66dc: 38800003 ldbu r2,0(r7) - 66e0: 18ffffc4 addi r3,r3,-1 - 66e4: 18800005 stb r2,0(r3) - 66e8: 19bffb1e bne r3,r6,66d8 - 66ec: 2005883a mov r2,r4 - 66f0: f800283a ret - 66f4: 01c003c4 movi r7,15 - 66f8: 39800a36 bltu r7,r6,6724 - 66fc: 303ffb26 beq r6,zero,66ec - 6700: 400f883a mov r7,r8 - 6704: 320d883a add r6,r6,r8 - 6708: 28800003 ldbu r2,0(r5) - 670c: 29400044 addi r5,r5,1 - 6710: 38800005 stb r2,0(r7) - 6714: 39c00044 addi r7,r7,1 - 6718: 39bffb1e bne r7,r6,6708 - 671c: 2005883a mov r2,r4 - 6720: f800283a ret - 6724: 1904b03a or r2,r3,r4 - 6728: 108000cc andi r2,r2,3 - 672c: 103ff31e bne r2,zero,66fc - 6730: 3811883a mov r8,r7 - 6734: 180b883a mov r5,r3 - 6738: 200f883a mov r7,r4 - 673c: 28c00017 ldw r3,0(r5) - 6740: 31bffc04 addi r6,r6,-16 - 6744: 38c00015 stw r3,0(r7) - 6748: 28800117 ldw r2,4(r5) - 674c: 38800115 stw r2,4(r7) - 6750: 28c00217 ldw r3,8(r5) - 6754: 38c00215 stw r3,8(r7) - 6758: 28800317 ldw r2,12(r5) - 675c: 29400404 addi r5,r5,16 - 6760: 38800315 stw r2,12(r7) - 6764: 39c00404 addi r7,r7,16 - 6768: 41bff436 bltu r8,r6,673c - 676c: 008000c4 movi r2,3 - 6770: 1180072e bgeu r2,r6,6790 - 6774: 1007883a mov r3,r2 - 6778: 28800017 ldw r2,0(r5) - 677c: 31bfff04 addi r6,r6,-4 - 6780: 29400104 addi r5,r5,4 - 6784: 38800015 stw r2,0(r7) - 6788: 39c00104 addi r7,r7,4 - 678c: 19bffa36 bltu r3,r6,6778 - 6790: 3811883a mov r8,r7 - 6794: 003fd906 br 66fc - -00006798 <_Bfree>: - 6798: 28000826 beq r5,zero,67bc <_Bfree+0x24> - 679c: 28800117 ldw r2,4(r5) - 67a0: 21001317 ldw r4,76(r4) - 67a4: 1085883a add r2,r2,r2 - 67a8: 1085883a add r2,r2,r2 - 67ac: 1105883a add r2,r2,r4 - 67b0: 10c00017 ldw r3,0(r2) - 67b4: 28c00015 stw r3,0(r5) - 67b8: 11400015 stw r5,0(r2) - 67bc: f800283a ret - -000067c0 <__hi0bits>: - 67c0: 20bfffec andhi r2,r4,65535 - 67c4: 10001426 beq r2,zero,6818 <__hi0bits+0x58> - 67c8: 0007883a mov r3,zero - 67cc: 20bfc02c andhi r2,r4,65280 - 67d0: 1000021e bne r2,zero,67dc <__hi0bits+0x1c> - 67d4: 2008923a slli r4,r4,8 - 67d8: 18c00204 addi r3,r3,8 - 67dc: 20bc002c andhi r2,r4,61440 - 67e0: 1000021e bne r2,zero,67ec <__hi0bits+0x2c> - 67e4: 2008913a slli r4,r4,4 - 67e8: 18c00104 addi r3,r3,4 - 67ec: 20b0002c andhi r2,r4,49152 - 67f0: 1000031e bne r2,zero,6800 <__hi0bits+0x40> - 67f4: 2105883a add r2,r4,r4 - 67f8: 18c00084 addi r3,r3,2 - 67fc: 1089883a add r4,r2,r2 - 6800: 20000316 blt r4,zero,6810 <__hi0bits+0x50> - 6804: 2090002c andhi r2,r4,16384 - 6808: 10000626 beq r2,zero,6824 <__hi0bits+0x64> - 680c: 18c00044 addi r3,r3,1 - 6810: 1805883a mov r2,r3 - 6814: f800283a ret - 6818: 2008943a slli r4,r4,16 - 681c: 00c00404 movi r3,16 - 6820: 003fea06 br 67cc <__hi0bits+0xc> - 6824: 00c00804 movi r3,32 - 6828: 1805883a mov r2,r3 - 682c: f800283a ret - -00006830 <__lo0bits>: - 6830: 20c00017 ldw r3,0(r4) - 6834: 188001cc andi r2,r3,7 - 6838: 10000a26 beq r2,zero,6864 <__lo0bits+0x34> - 683c: 1880004c andi r2,r3,1 - 6840: 1005003a cmpeq r2,r2,zero - 6844: 10002126 beq r2,zero,68cc <__lo0bits+0x9c> - 6848: 1880008c andi r2,r3,2 - 684c: 1000251e bne r2,zero,68e4 <__lo0bits+0xb4> - 6850: 1804d0ba srli r2,r3,2 - 6854: 01400084 movi r5,2 - 6858: 20800015 stw r2,0(r4) - 685c: 2805883a mov r2,r5 - 6860: f800283a ret - 6864: 18bfffcc andi r2,r3,65535 - 6868: 10001526 beq r2,zero,68c0 <__lo0bits+0x90> - 686c: 000b883a mov r5,zero - 6870: 18803fcc andi r2,r3,255 - 6874: 1000021e bne r2,zero,6880 <__lo0bits+0x50> - 6878: 1806d23a srli r3,r3,8 - 687c: 29400204 addi r5,r5,8 - 6880: 188003cc andi r2,r3,15 - 6884: 1000021e bne r2,zero,6890 <__lo0bits+0x60> - 6888: 1806d13a srli r3,r3,4 - 688c: 29400104 addi r5,r5,4 - 6890: 188000cc andi r2,r3,3 - 6894: 1000021e bne r2,zero,68a0 <__lo0bits+0x70> - 6898: 1806d0ba srli r3,r3,2 - 689c: 29400084 addi r5,r5,2 - 68a0: 1880004c andi r2,r3,1 - 68a4: 1000031e bne r2,zero,68b4 <__lo0bits+0x84> - 68a8: 1806d07a srli r3,r3,1 - 68ac: 18000a26 beq r3,zero,68d8 <__lo0bits+0xa8> - 68b0: 29400044 addi r5,r5,1 - 68b4: 2805883a mov r2,r5 - 68b8: 20c00015 stw r3,0(r4) - 68bc: f800283a ret - 68c0: 1806d43a srli r3,r3,16 - 68c4: 01400404 movi r5,16 - 68c8: 003fe906 br 6870 <__lo0bits+0x40> - 68cc: 000b883a mov r5,zero - 68d0: 2805883a mov r2,r5 - 68d4: f800283a ret - 68d8: 01400804 movi r5,32 - 68dc: 2805883a mov r2,r5 - 68e0: f800283a ret - 68e4: 1804d07a srli r2,r3,1 - 68e8: 01400044 movi r5,1 - 68ec: 20800015 stw r2,0(r4) - 68f0: 003fda06 br 685c <__lo0bits+0x2c> - -000068f4 <__mcmp>: - 68f4: 20800417 ldw r2,16(r4) - 68f8: 28c00417 ldw r3,16(r5) - 68fc: 10cfc83a sub r7,r2,r3 - 6900: 38000c1e bne r7,zero,6934 <__mcmp+0x40> - 6904: 18c5883a add r2,r3,r3 - 6908: 1085883a add r2,r2,r2 - 690c: 10c00504 addi r3,r2,20 - 6910: 21000504 addi r4,r4,20 - 6914: 28cb883a add r5,r5,r3 - 6918: 2085883a add r2,r4,r2 - 691c: 10bfff04 addi r2,r2,-4 - 6920: 297fff04 addi r5,r5,-4 - 6924: 11800017 ldw r6,0(r2) - 6928: 28c00017 ldw r3,0(r5) - 692c: 30c0031e bne r6,r3,693c <__mcmp+0x48> - 6930: 20bffa36 bltu r4,r2,691c <__mcmp+0x28> - 6934: 3805883a mov r2,r7 - 6938: f800283a ret - 693c: 30c00336 bltu r6,r3,694c <__mcmp+0x58> - 6940: 01c00044 movi r7,1 - 6944: 3805883a mov r2,r7 - 6948: f800283a ret - 694c: 01ffffc4 movi r7,-1 - 6950: 003ff806 br 6934 <__mcmp+0x40> - -00006954 <__ulp>: - 6954: 295ffc2c andhi r5,r5,32752 - 6958: 013f3034 movhi r4,64704 - 695c: 290b883a add r5,r5,r4 - 6960: 0145c83a sub r2,zero,r5 - 6964: 1007d53a srai r3,r2,20 - 6968: 000d883a mov r6,zero - 696c: 0140040e bge zero,r5,6980 <__ulp+0x2c> - 6970: 280f883a mov r7,r5 - 6974: 3807883a mov r3,r7 - 6978: 3005883a mov r2,r6 - 697c: f800283a ret - 6980: 008004c4 movi r2,19 - 6984: 193ffb04 addi r4,r3,-20 - 6988: 10c00c0e bge r2,r3,69bc <__ulp+0x68> - 698c: 008007c4 movi r2,31 - 6990: 1107c83a sub r3,r2,r4 - 6994: 00800784 movi r2,30 - 6998: 01400044 movi r5,1 - 699c: 11000216 blt r2,r4,69a8 <__ulp+0x54> - 69a0: 00800044 movi r2,1 - 69a4: 10ca983a sll r5,r2,r3 - 69a8: 000f883a mov r7,zero - 69ac: 280d883a mov r6,r5 - 69b0: 3807883a mov r3,r7 - 69b4: 3005883a mov r2,r6 - 69b8: f800283a ret - 69bc: 00800234 movhi r2,8 - 69c0: 10cfd83a sra r7,r2,r3 - 69c4: 000d883a mov r6,zero - 69c8: 3005883a mov r2,r6 - 69cc: 3807883a mov r3,r7 - 69d0: f800283a ret - -000069d4 <__b2d>: - 69d4: 20800417 ldw r2,16(r4) - 69d8: defff904 addi sp,sp,-28 - 69dc: dd000415 stw r20,16(sp) - 69e0: 1085883a add r2,r2,r2 - 69e4: 25000504 addi r20,r4,20 - 69e8: 1085883a add r2,r2,r2 - 69ec: dc000015 stw r16,0(sp) - 69f0: a0a1883a add r16,r20,r2 - 69f4: dd400515 stw r21,20(sp) - 69f8: 857fff17 ldw r21,-4(r16) - 69fc: dc400115 stw r17,4(sp) - 6a00: dfc00615 stw ra,24(sp) - 6a04: a809883a mov r4,r21 - 6a08: 2823883a mov r17,r5 - 6a0c: dcc00315 stw r19,12(sp) - 6a10: dc800215 stw r18,8(sp) - 6a14: 00067c00 call 67c0 <__hi0bits> - 6a18: 100b883a mov r5,r2 - 6a1c: 00800804 movi r2,32 - 6a20: 1145c83a sub r2,r2,r5 - 6a24: 88800015 stw r2,0(r17) - 6a28: 00800284 movi r2,10 - 6a2c: 80ffff04 addi r3,r16,-4 - 6a30: 11401416 blt r2,r5,6a84 <__b2d+0xb0> - 6a34: 008002c4 movi r2,11 - 6a38: 1149c83a sub r4,r2,r5 - 6a3c: a0c02736 bltu r20,r3,6adc <__b2d+0x108> - 6a40: 000d883a mov r6,zero - 6a44: 28800544 addi r2,r5,21 - 6a48: a906d83a srl r3,r21,r4 - 6a4c: a884983a sll r2,r21,r2 - 6a50: 1ccffc34 orhi r19,r3,16368 - 6a54: 11a4b03a or r18,r2,r6 - 6a58: 9005883a mov r2,r18 - 6a5c: 9807883a mov r3,r19 - 6a60: dfc00617 ldw ra,24(sp) - 6a64: dd400517 ldw r21,20(sp) - 6a68: dd000417 ldw r20,16(sp) - 6a6c: dcc00317 ldw r19,12(sp) - 6a70: dc800217 ldw r18,8(sp) - 6a74: dc400117 ldw r17,4(sp) - 6a78: dc000017 ldw r16,0(sp) - 6a7c: dec00704 addi sp,sp,28 - 6a80: f800283a ret - 6a84: a0c00e36 bltu r20,r3,6ac0 <__b2d+0xec> - 6a88: 293ffd44 addi r4,r5,-11 - 6a8c: 000d883a mov r6,zero - 6a90: 20000f26 beq r4,zero,6ad0 <__b2d+0xfc> - 6a94: 00800804 movi r2,32 - 6a98: 110bc83a sub r5,r2,r4 - 6a9c: a0c01236 bltu r20,r3,6ae8 <__b2d+0x114> - 6aa0: 000f883a mov r7,zero - 6aa4: a904983a sll r2,r21,r4 - 6aa8: 3146d83a srl r3,r6,r5 - 6aac: 3108983a sll r4,r6,r4 - 6ab0: 108ffc34 orhi r2,r2,16368 - 6ab4: 18a6b03a or r19,r3,r2 - 6ab8: 3924b03a or r18,r7,r4 - 6abc: 003fe606 br 6a58 <__b2d+0x84> - 6ac0: 293ffd44 addi r4,r5,-11 - 6ac4: 81bffe17 ldw r6,-8(r16) - 6ac8: 80fffe04 addi r3,r16,-8 - 6acc: 203ff11e bne r4,zero,6a94 <__b2d+0xc0> - 6ad0: accffc34 orhi r19,r21,16368 - 6ad4: 3025883a mov r18,r6 - 6ad8: 003fdf06 br 6a58 <__b2d+0x84> - 6adc: 18bfff17 ldw r2,-4(r3) - 6ae0: 110cd83a srl r6,r2,r4 - 6ae4: 003fd706 br 6a44 <__b2d+0x70> - 6ae8: 18bfff17 ldw r2,-4(r3) - 6aec: 114ed83a srl r7,r2,r5 - 6af0: 003fec06 br 6aa4 <__b2d+0xd0> - -00006af4 <__ratio>: - 6af4: defff904 addi sp,sp,-28 - 6af8: dc400215 stw r17,8(sp) - 6afc: 2823883a mov r17,r5 - 6b00: d80b883a mov r5,sp - 6b04: dfc00615 stw ra,24(sp) - 6b08: dd000515 stw r20,20(sp) - 6b0c: dcc00415 stw r19,16(sp) - 6b10: dc800315 stw r18,12(sp) - 6b14: 2025883a mov r18,r4 - 6b18: 00069d40 call 69d4 <__b2d> - 6b1c: 8809883a mov r4,r17 - 6b20: d9400104 addi r5,sp,4 - 6b24: 1027883a mov r19,r2 - 6b28: 1829883a mov r20,r3 - 6b2c: 00069d40 call 69d4 <__b2d> - 6b30: 89000417 ldw r4,16(r17) - 6b34: 91c00417 ldw r7,16(r18) - 6b38: d9800117 ldw r6,4(sp) - 6b3c: 180b883a mov r5,r3 - 6b40: 390fc83a sub r7,r7,r4 - 6b44: 1009883a mov r4,r2 - 6b48: d8800017 ldw r2,0(sp) - 6b4c: 380e917a slli r7,r7,5 - 6b50: 2011883a mov r8,r4 - 6b54: 1185c83a sub r2,r2,r6 - 6b58: 11c5883a add r2,r2,r7 - 6b5c: 1006953a slli r3,r2,20 - 6b60: 2813883a mov r9,r5 - 6b64: 00800d0e bge zero,r2,6b9c <__ratio+0xa8> - 6b68: 1d29883a add r20,r3,r20 - 6b6c: a00b883a mov r5,r20 - 6b70: 480f883a mov r7,r9 - 6b74: 9809883a mov r4,r19 - 6b78: 400d883a mov r6,r8 - 6b7c: 00096180 call 9618 <__divdf3> - 6b80: dfc00617 ldw ra,24(sp) - 6b84: dd000517 ldw r20,20(sp) - 6b88: dcc00417 ldw r19,16(sp) - 6b8c: dc800317 ldw r18,12(sp) - 6b90: dc400217 ldw r17,8(sp) - 6b94: dec00704 addi sp,sp,28 - 6b98: f800283a ret - 6b9c: 28d3c83a sub r9,r5,r3 - 6ba0: 003ff206 br 6b6c <__ratio+0x78> - -00006ba4 <_mprec_log10>: - 6ba4: defffe04 addi sp,sp,-8 - 6ba8: 008005c4 movi r2,23 - 6bac: dc000015 stw r16,0(sp) - 6bb0: dfc00115 stw ra,4(sp) - 6bb4: 2021883a mov r16,r4 - 6bb8: 11000c16 blt r2,r4,6bec <_mprec_log10+0x48> - 6bbc: 200490fa slli r2,r4,3 - 6bc0: 00c00074 movhi r3,1 - 6bc4: 18f8a404 addi r3,r3,-7536 - 6bc8: 10c5883a add r2,r2,r3 - 6bcc: 12400117 ldw r9,4(r2) - 6bd0: 12000017 ldw r8,0(r2) - 6bd4: 4807883a mov r3,r9 - 6bd8: 4005883a mov r2,r8 - 6bdc: dfc00117 ldw ra,4(sp) - 6be0: dc000017 ldw r16,0(sp) - 6be4: dec00204 addi sp,sp,8 - 6be8: f800283a ret - 6bec: 0011883a mov r8,zero - 6bf0: 024ffc34 movhi r9,16368 - 6bf4: 0005883a mov r2,zero - 6bf8: 00d00934 movhi r3,16420 - 6bfc: 480b883a mov r5,r9 - 6c00: 4009883a mov r4,r8 - 6c04: 180f883a mov r7,r3 - 6c08: 100d883a mov r6,r2 - 6c0c: 00092540 call 9254 <__muldf3> - 6c10: 843fffc4 addi r16,r16,-1 - 6c14: 1011883a mov r8,r2 - 6c18: 1813883a mov r9,r3 - 6c1c: 803ff51e bne r16,zero,6bf4 <_mprec_log10+0x50> - 6c20: 4005883a mov r2,r8 - 6c24: 4807883a mov r3,r9 - 6c28: dfc00117 ldw ra,4(sp) - 6c2c: dc000017 ldw r16,0(sp) - 6c30: dec00204 addi sp,sp,8 - 6c34: f800283a ret - -00006c38 <__copybits>: - 6c38: 297fffc4 addi r5,r5,-1 - 6c3c: 30800417 ldw r2,16(r6) - 6c40: 280bd17a srai r5,r5,5 - 6c44: 31800504 addi r6,r6,20 - 6c48: 1085883a add r2,r2,r2 - 6c4c: 294b883a add r5,r5,r5 - 6c50: 294b883a add r5,r5,r5 - 6c54: 1085883a add r2,r2,r2 - 6c58: 290b883a add r5,r5,r4 - 6c5c: 3087883a add r3,r6,r2 - 6c60: 29400104 addi r5,r5,4 - 6c64: 30c0052e bgeu r6,r3,6c7c <__copybits+0x44> - 6c68: 30800017 ldw r2,0(r6) - 6c6c: 31800104 addi r6,r6,4 - 6c70: 20800015 stw r2,0(r4) - 6c74: 21000104 addi r4,r4,4 - 6c78: 30fffb36 bltu r6,r3,6c68 <__copybits+0x30> - 6c7c: 2140032e bgeu r4,r5,6c8c <__copybits+0x54> - 6c80: 20000015 stw zero,0(r4) - 6c84: 21000104 addi r4,r4,4 - 6c88: 217ffd36 bltu r4,r5,6c80 <__copybits+0x48> - 6c8c: f800283a ret - -00006c90 <__any_on>: - 6c90: 20800417 ldw r2,16(r4) - 6c94: 2807d17a srai r3,r5,5 - 6c98: 21000504 addi r4,r4,20 - 6c9c: 10c00d0e bge r2,r3,6cd4 <__any_on+0x44> - 6ca0: 1085883a add r2,r2,r2 - 6ca4: 1085883a add r2,r2,r2 - 6ca8: 208d883a add r6,r4,r2 - 6cac: 2180182e bgeu r4,r6,6d10 <__any_on+0x80> - 6cb0: 30bfff17 ldw r2,-4(r6) - 6cb4: 30ffff04 addi r3,r6,-4 - 6cb8: 1000041e bne r2,zero,6ccc <__any_on+0x3c> - 6cbc: 20c0142e bgeu r4,r3,6d10 <__any_on+0x80> - 6cc0: 18ffff04 addi r3,r3,-4 - 6cc4: 18800017 ldw r2,0(r3) - 6cc8: 103ffc26 beq r2,zero,6cbc <__any_on+0x2c> - 6ccc: 00800044 movi r2,1 - 6cd0: f800283a ret - 6cd4: 18800a0e bge r3,r2,6d00 <__any_on+0x70> - 6cd8: 294007cc andi r5,r5,31 - 6cdc: 28000826 beq r5,zero,6d00 <__any_on+0x70> - 6ce0: 18c5883a add r2,r3,r3 - 6ce4: 1085883a add r2,r2,r2 - 6ce8: 208d883a add r6,r4,r2 - 6cec: 30c00017 ldw r3,0(r6) - 6cf0: 1944d83a srl r2,r3,r5 - 6cf4: 1144983a sll r2,r2,r5 - 6cf8: 18bff41e bne r3,r2,6ccc <__any_on+0x3c> - 6cfc: 003feb06 br 6cac <__any_on+0x1c> - 6d00: 18c5883a add r2,r3,r3 - 6d04: 1085883a add r2,r2,r2 - 6d08: 208d883a add r6,r4,r2 - 6d0c: 003fe706 br 6cac <__any_on+0x1c> - 6d10: 0005883a mov r2,zero - 6d14: f800283a ret - -00006d18 <_Balloc>: - 6d18: 20c01317 ldw r3,76(r4) - 6d1c: defffb04 addi sp,sp,-20 - 6d20: dcc00315 stw r19,12(sp) - 6d24: dc800215 stw r18,8(sp) - 6d28: dfc00415 stw ra,16(sp) - 6d2c: 2825883a mov r18,r5 - 6d30: dc400115 stw r17,4(sp) - 6d34: dc000015 stw r16,0(sp) - 6d38: 2027883a mov r19,r4 - 6d3c: 01800404 movi r6,16 - 6d40: 01400104 movi r5,4 - 6d44: 18001726 beq r3,zero,6da4 <_Balloc+0x8c> - 6d48: 01400044 movi r5,1 - 6d4c: 9485883a add r2,r18,r18 - 6d50: 2ca2983a sll r17,r5,r18 - 6d54: 1085883a add r2,r2,r2 - 6d58: 10c7883a add r3,r2,r3 - 6d5c: 1c000017 ldw r16,0(r3) - 6d60: 8c4d883a add r6,r17,r17 - 6d64: 318d883a add r6,r6,r6 - 6d68: 9809883a mov r4,r19 - 6d6c: 31800504 addi r6,r6,20 - 6d70: 80001226 beq r16,zero,6dbc <_Balloc+0xa4> - 6d74: 80800017 ldw r2,0(r16) - 6d78: 18800015 stw r2,0(r3) - 6d7c: 80000415 stw zero,16(r16) - 6d80: 80000315 stw zero,12(r16) - 6d84: 8005883a mov r2,r16 - 6d88: dfc00417 ldw ra,16(sp) - 6d8c: dcc00317 ldw r19,12(sp) - 6d90: dc800217 ldw r18,8(sp) - 6d94: dc400117 ldw r17,4(sp) - 6d98: dc000017 ldw r16,0(sp) - 6d9c: dec00504 addi sp,sp,20 - 6da0: f800283a ret - 6da4: 0007fbc0 call 7fbc <_calloc_r> - 6da8: 1007883a mov r3,r2 - 6dac: 0021883a mov r16,zero - 6db0: 98801315 stw r2,76(r19) - 6db4: 103fe41e bne r2,zero,6d48 <_Balloc+0x30> - 6db8: 003ff206 br 6d84 <_Balloc+0x6c> - 6dbc: 0007fbc0 call 7fbc <_calloc_r> - 6dc0: 103ff026 beq r2,zero,6d84 <_Balloc+0x6c> - 6dc4: 1021883a mov r16,r2 - 6dc8: 14800115 stw r18,4(r2) - 6dcc: 14400215 stw r17,8(r2) - 6dd0: 003fea06 br 6d7c <_Balloc+0x64> - -00006dd4 <__d2b>: - 6dd4: defff504 addi sp,sp,-44 - 6dd8: dcc00515 stw r19,20(sp) - 6ddc: 04c00044 movi r19,1 - 6de0: dc000215 stw r16,8(sp) - 6de4: 2821883a mov r16,r5 - 6de8: 980b883a mov r5,r19 - 6dec: ddc00915 stw r23,36(sp) - 6df0: dd800815 stw r22,32(sp) - 6df4: dd400715 stw r21,28(sp) - 6df8: dd000615 stw r20,24(sp) - 6dfc: dc800415 stw r18,16(sp) - 6e00: dc400315 stw r17,12(sp) - 6e04: dfc00a15 stw ra,40(sp) - 6e08: 3023883a mov r17,r6 - 6e0c: 382d883a mov r22,r7 - 6e10: ddc00b17 ldw r23,44(sp) - 6e14: 0006d180 call 6d18 <_Balloc> - 6e18: 1025883a mov r18,r2 - 6e1c: 00a00034 movhi r2,32768 - 6e20: 10bfffc4 addi r2,r2,-1 - 6e24: 8888703a and r4,r17,r2 - 6e28: 202ad53a srli r21,r4,20 - 6e2c: 00800434 movhi r2,16 - 6e30: 10bfffc4 addi r2,r2,-1 - 6e34: 8886703a and r3,r17,r2 - 6e38: a829003a cmpeq r20,r21,zero - 6e3c: 800b883a mov r5,r16 - 6e40: d8c00115 stw r3,4(sp) - 6e44: 94000504 addi r16,r18,20 - 6e48: a000021e bne r20,zero,6e54 <__d2b+0x80> - 6e4c: 18c00434 orhi r3,r3,16 - 6e50: d8c00115 stw r3,4(sp) - 6e54: 28002726 beq r5,zero,6ef4 <__d2b+0x120> - 6e58: d809883a mov r4,sp - 6e5c: d9400015 stw r5,0(sp) - 6e60: 00068300 call 6830 <__lo0bits> - 6e64: 100d883a mov r6,r2 - 6e68: 10003526 beq r2,zero,6f40 <__d2b+0x16c> - 6e6c: d8c00117 ldw r3,4(sp) - 6e70: 00800804 movi r2,32 - 6e74: 1185c83a sub r2,r2,r6 - 6e78: d9000017 ldw r4,0(sp) - 6e7c: 1886983a sll r3,r3,r2 - 6e80: 1906b03a or r3,r3,r4 - 6e84: 90c00515 stw r3,20(r18) - 6e88: d8c00117 ldw r3,4(sp) - 6e8c: 1986d83a srl r3,r3,r6 - 6e90: d8c00115 stw r3,4(sp) - 6e94: 180b003a cmpeq r5,r3,zero - 6e98: 00800084 movi r2,2 - 6e9c: 114bc83a sub r5,r2,r5 - 6ea0: 80c00115 stw r3,4(r16) - 6ea4: 91400415 stw r5,16(r18) - 6ea8: a0001a1e bne r20,zero,6f14 <__d2b+0x140> - 6eac: 3545883a add r2,r6,r21 - 6eb0: 10bef344 addi r2,r2,-1075 - 6eb4: 00c00d44 movi r3,53 - 6eb8: b0800015 stw r2,0(r22) - 6ebc: 1987c83a sub r3,r3,r6 - 6ec0: b8c00015 stw r3,0(r23) - 6ec4: 9005883a mov r2,r18 - 6ec8: dfc00a17 ldw ra,40(sp) - 6ecc: ddc00917 ldw r23,36(sp) - 6ed0: dd800817 ldw r22,32(sp) - 6ed4: dd400717 ldw r21,28(sp) - 6ed8: dd000617 ldw r20,24(sp) - 6edc: dcc00517 ldw r19,20(sp) - 6ee0: dc800417 ldw r18,16(sp) - 6ee4: dc400317 ldw r17,12(sp) - 6ee8: dc000217 ldw r16,8(sp) - 6eec: dec00b04 addi sp,sp,44 - 6ef0: f800283a ret - 6ef4: d9000104 addi r4,sp,4 - 6ef8: 00068300 call 6830 <__lo0bits> - 6efc: 11800804 addi r6,r2,32 - 6f00: d8800117 ldw r2,4(sp) - 6f04: 94c00415 stw r19,16(r18) - 6f08: 980b883a mov r5,r19 - 6f0c: 90800515 stw r2,20(r18) - 6f10: a03fe626 beq r20,zero,6eac <__d2b+0xd8> - 6f14: 2945883a add r2,r5,r5 - 6f18: 1085883a add r2,r2,r2 - 6f1c: 1405883a add r2,r2,r16 - 6f20: 113fff17 ldw r4,-4(r2) - 6f24: 30fef384 addi r3,r6,-1074 - 6f28: 2820917a slli r16,r5,5 - 6f2c: b0c00015 stw r3,0(r22) - 6f30: 00067c00 call 67c0 <__hi0bits> - 6f34: 80a1c83a sub r16,r16,r2 - 6f38: bc000015 stw r16,0(r23) - 6f3c: 003fe106 br 6ec4 <__d2b+0xf0> - 6f40: d8800017 ldw r2,0(sp) - 6f44: 90800515 stw r2,20(r18) - 6f48: d8c00117 ldw r3,4(sp) - 6f4c: 003fd106 br 6e94 <__d2b+0xc0> - -00006f50 <__mdiff>: - 6f50: defffb04 addi sp,sp,-20 - 6f54: dc000015 stw r16,0(sp) - 6f58: 2821883a mov r16,r5 - 6f5c: dc800215 stw r18,8(sp) - 6f60: 300b883a mov r5,r6 - 6f64: 2025883a mov r18,r4 - 6f68: 8009883a mov r4,r16 - 6f6c: dc400115 stw r17,4(sp) - 6f70: dfc00415 stw ra,16(sp) - 6f74: dcc00315 stw r19,12(sp) - 6f78: 3023883a mov r17,r6 - 6f7c: 00068f40 call 68f4 <__mcmp> - 6f80: 10004226 beq r2,zero,708c <__mdiff+0x13c> - 6f84: 10005016 blt r2,zero,70c8 <__mdiff+0x178> - 6f88: 0027883a mov r19,zero - 6f8c: 81400117 ldw r5,4(r16) - 6f90: 9009883a mov r4,r18 - 6f94: 0006d180 call 6d18 <_Balloc> - 6f98: 1019883a mov r12,r2 - 6f9c: 82800417 ldw r10,16(r16) - 6fa0: 88800417 ldw r2,16(r17) - 6fa4: 81800504 addi r6,r16,20 - 6fa8: 5287883a add r3,r10,r10 - 6fac: 1085883a add r2,r2,r2 - 6fb0: 18c7883a add r3,r3,r3 - 6fb4: 1085883a add r2,r2,r2 - 6fb8: 8a000504 addi r8,r17,20 - 6fbc: 64c00315 stw r19,12(r12) - 6fc0: 30db883a add r13,r6,r3 - 6fc4: 4097883a add r11,r8,r2 - 6fc8: 61c00504 addi r7,r12,20 - 6fcc: 0013883a mov r9,zero - 6fd0: 31000017 ldw r4,0(r6) - 6fd4: 41400017 ldw r5,0(r8) - 6fd8: 42000104 addi r8,r8,4 - 6fdc: 20bfffcc andi r2,r4,65535 - 6fe0: 28ffffcc andi r3,r5,65535 - 6fe4: 10c5c83a sub r2,r2,r3 - 6fe8: 1245883a add r2,r2,r9 - 6fec: 2008d43a srli r4,r4,16 - 6ff0: 280ad43a srli r5,r5,16 - 6ff4: 1007d43a srai r3,r2,16 - 6ff8: 3880000d sth r2,0(r7) - 6ffc: 2149c83a sub r4,r4,r5 - 7000: 20c9883a add r4,r4,r3 - 7004: 3900008d sth r4,2(r7) - 7008: 31800104 addi r6,r6,4 - 700c: 39c00104 addi r7,r7,4 - 7010: 2013d43a srai r9,r4,16 - 7014: 42ffee36 bltu r8,r11,6fd0 <__mdiff+0x80> - 7018: 33400c2e bgeu r6,r13,704c <__mdiff+0xfc> - 701c: 30800017 ldw r2,0(r6) - 7020: 31800104 addi r6,r6,4 - 7024: 10ffffcc andi r3,r2,65535 - 7028: 1a47883a add r3,r3,r9 - 702c: 1004d43a srli r2,r2,16 - 7030: 1809d43a srai r4,r3,16 - 7034: 38c0000d sth r3,0(r7) - 7038: 1105883a add r2,r2,r4 - 703c: 3880008d sth r2,2(r7) - 7040: 1013d43a srai r9,r2,16 - 7044: 39c00104 addi r7,r7,4 - 7048: 337ff436 bltu r6,r13,701c <__mdiff+0xcc> - 704c: 38bfff17 ldw r2,-4(r7) - 7050: 38ffff04 addi r3,r7,-4 - 7054: 1000041e bne r2,zero,7068 <__mdiff+0x118> - 7058: 18ffff04 addi r3,r3,-4 - 705c: 18800017 ldw r2,0(r3) - 7060: 52bfffc4 addi r10,r10,-1 - 7064: 103ffc26 beq r2,zero,7058 <__mdiff+0x108> - 7068: 6005883a mov r2,r12 - 706c: 62800415 stw r10,16(r12) - 7070: dfc00417 ldw ra,16(sp) - 7074: dcc00317 ldw r19,12(sp) - 7078: dc800217 ldw r18,8(sp) - 707c: dc400117 ldw r17,4(sp) - 7080: dc000017 ldw r16,0(sp) - 7084: dec00504 addi sp,sp,20 - 7088: f800283a ret - 708c: 9009883a mov r4,r18 - 7090: 000b883a mov r5,zero - 7094: 0006d180 call 6d18 <_Balloc> - 7098: 1019883a mov r12,r2 - 709c: 00800044 movi r2,1 - 70a0: 60800415 stw r2,16(r12) - 70a4: 6005883a mov r2,r12 - 70a8: 60000515 stw zero,20(r12) - 70ac: dfc00417 ldw ra,16(sp) - 70b0: dcc00317 ldw r19,12(sp) - 70b4: dc800217 ldw r18,8(sp) - 70b8: dc400117 ldw r17,4(sp) - 70bc: dc000017 ldw r16,0(sp) - 70c0: dec00504 addi sp,sp,20 - 70c4: f800283a ret - 70c8: 880d883a mov r6,r17 - 70cc: 04c00044 movi r19,1 - 70d0: 8023883a mov r17,r16 - 70d4: 3021883a mov r16,r6 - 70d8: 003fac06 br 6f8c <__mdiff+0x3c> - -000070dc <__lshift>: - 70dc: defff904 addi sp,sp,-28 - 70e0: 28800417 ldw r2,16(r5) - 70e4: dc000015 stw r16,0(sp) - 70e8: 3021d17a srai r16,r6,5 - 70ec: 28c00217 ldw r3,8(r5) - 70f0: 10800044 addi r2,r2,1 - 70f4: dc400115 stw r17,4(sp) - 70f8: 80a3883a add r17,r16,r2 - 70fc: dd400515 stw r21,20(sp) - 7100: dd000415 stw r20,16(sp) - 7104: dc800215 stw r18,8(sp) - 7108: dfc00615 stw ra,24(sp) - 710c: 2825883a mov r18,r5 - 7110: dcc00315 stw r19,12(sp) - 7114: 3029883a mov r20,r6 - 7118: 202b883a mov r21,r4 - 711c: 29400117 ldw r5,4(r5) - 7120: 1c40030e bge r3,r17,7130 <__lshift+0x54> - 7124: 18c7883a add r3,r3,r3 - 7128: 29400044 addi r5,r5,1 - 712c: 1c7ffd16 blt r3,r17,7124 <__lshift+0x48> - 7130: a809883a mov r4,r21 - 7134: 0006d180 call 6d18 <_Balloc> - 7138: 1027883a mov r19,r2 - 713c: 11400504 addi r5,r2,20 - 7140: 0400090e bge zero,r16,7168 <__lshift+0x8c> - 7144: 2805883a mov r2,r5 - 7148: 0007883a mov r3,zero - 714c: 18c00044 addi r3,r3,1 - 7150: 10000015 stw zero,0(r2) - 7154: 10800104 addi r2,r2,4 - 7158: 80fffc1e bne r16,r3,714c <__lshift+0x70> - 715c: 8405883a add r2,r16,r16 - 7160: 1085883a add r2,r2,r2 - 7164: 288b883a add r5,r5,r2 - 7168: 90800417 ldw r2,16(r18) - 716c: 91000504 addi r4,r18,20 - 7170: a18007cc andi r6,r20,31 - 7174: 1085883a add r2,r2,r2 - 7178: 1085883a add r2,r2,r2 - 717c: 208f883a add r7,r4,r2 - 7180: 30001e26 beq r6,zero,71fc <__lshift+0x120> - 7184: 00800804 movi r2,32 - 7188: 1191c83a sub r8,r2,r6 - 718c: 0007883a mov r3,zero - 7190: 20800017 ldw r2,0(r4) - 7194: 1184983a sll r2,r2,r6 - 7198: 1884b03a or r2,r3,r2 - 719c: 28800015 stw r2,0(r5) - 71a0: 20c00017 ldw r3,0(r4) - 71a4: 21000104 addi r4,r4,4 - 71a8: 29400104 addi r5,r5,4 - 71ac: 1a06d83a srl r3,r3,r8 - 71b0: 21fff736 bltu r4,r7,7190 <__lshift+0xb4> - 71b4: 28c00015 stw r3,0(r5) - 71b8: 18000126 beq r3,zero,71c0 <__lshift+0xe4> - 71bc: 8c400044 addi r17,r17,1 - 71c0: 88bfffc4 addi r2,r17,-1 - 71c4: 98800415 stw r2,16(r19) - 71c8: a809883a mov r4,r21 - 71cc: 900b883a mov r5,r18 - 71d0: 00067980 call 6798 <_Bfree> - 71d4: 9805883a mov r2,r19 - 71d8: dfc00617 ldw ra,24(sp) - 71dc: dd400517 ldw r21,20(sp) - 71e0: dd000417 ldw r20,16(sp) - 71e4: dcc00317 ldw r19,12(sp) - 71e8: dc800217 ldw r18,8(sp) - 71ec: dc400117 ldw r17,4(sp) - 71f0: dc000017 ldw r16,0(sp) - 71f4: dec00704 addi sp,sp,28 - 71f8: f800283a ret - 71fc: 20800017 ldw r2,0(r4) - 7200: 21000104 addi r4,r4,4 - 7204: 28800015 stw r2,0(r5) - 7208: 29400104 addi r5,r5,4 - 720c: 21ffec2e bgeu r4,r7,71c0 <__lshift+0xe4> - 7210: 20800017 ldw r2,0(r4) - 7214: 21000104 addi r4,r4,4 - 7218: 28800015 stw r2,0(r5) - 721c: 29400104 addi r5,r5,4 - 7220: 21fff636 bltu r4,r7,71fc <__lshift+0x120> - 7224: 003fe606 br 71c0 <__lshift+0xe4> - -00007228 <__multiply>: - 7228: defff004 addi sp,sp,-64 - 722c: dc800815 stw r18,32(sp) - 7230: dc400715 stw r17,28(sp) - 7234: 2c800417 ldw r18,16(r5) - 7238: 34400417 ldw r17,16(r6) - 723c: dcc00915 stw r19,36(sp) - 7240: dc000615 stw r16,24(sp) - 7244: dfc00f15 stw ra,60(sp) - 7248: df000e15 stw fp,56(sp) - 724c: ddc00d15 stw r23,52(sp) - 7250: dd800c15 stw r22,48(sp) - 7254: dd400b15 stw r21,44(sp) - 7258: dd000a15 stw r20,40(sp) - 725c: 2821883a mov r16,r5 - 7260: 3027883a mov r19,r6 - 7264: 9440040e bge r18,r17,7278 <__multiply+0x50> - 7268: 8825883a mov r18,r17 - 726c: 2c400417 ldw r17,16(r5) - 7270: 2827883a mov r19,r5 - 7274: 3021883a mov r16,r6 - 7278: 80800217 ldw r2,8(r16) - 727c: 9447883a add r3,r18,r17 - 7280: d8c00415 stw r3,16(sp) - 7284: 81400117 ldw r5,4(r16) - 7288: 10c0010e bge r2,r3,7290 <__multiply+0x68> - 728c: 29400044 addi r5,r5,1 - 7290: 0006d180 call 6d18 <_Balloc> - 7294: d8800515 stw r2,20(sp) - 7298: d9000417 ldw r4,16(sp) - 729c: d8c00517 ldw r3,20(sp) - 72a0: 2105883a add r2,r4,r4 - 72a4: 1085883a add r2,r2,r2 - 72a8: 19000504 addi r4,r3,20 - 72ac: 2085883a add r2,r4,r2 - 72b0: d8800315 stw r2,12(sp) - 72b4: 2080052e bgeu r4,r2,72cc <__multiply+0xa4> - 72b8: 2005883a mov r2,r4 - 72bc: d8c00317 ldw r3,12(sp) - 72c0: 10000015 stw zero,0(r2) - 72c4: 10800104 addi r2,r2,4 - 72c8: 10fffc36 bltu r2,r3,72bc <__multiply+0x94> - 72cc: 8c45883a add r2,r17,r17 - 72d0: 9487883a add r3,r18,r18 - 72d4: 9dc00504 addi r23,r19,20 - 72d8: 1085883a add r2,r2,r2 - 72dc: 84000504 addi r16,r16,20 - 72e0: 18c7883a add r3,r3,r3 - 72e4: b885883a add r2,r23,r2 - 72e8: dc000015 stw r16,0(sp) - 72ec: d8800215 stw r2,8(sp) - 72f0: 80f9883a add fp,r16,r3 - 72f4: b880432e bgeu r23,r2,7404 <__multiply+0x1dc> - 72f8: d9000115 stw r4,4(sp) - 72fc: b9000017 ldw r4,0(r23) - 7300: 253fffcc andi r20,r4,65535 - 7304: a0001a26 beq r20,zero,7370 <__multiply+0x148> - 7308: dcc00017 ldw r19,0(sp) - 730c: dc800117 ldw r18,4(sp) - 7310: 002b883a mov r21,zero - 7314: 9c400017 ldw r17,0(r19) - 7318: 94000017 ldw r16,0(r18) - 731c: a009883a mov r4,r20 - 7320: 897fffcc andi r5,r17,65535 - 7324: 0009fc80 call 9fc8 <__mulsi3> - 7328: 880ad43a srli r5,r17,16 - 732c: 80ffffcc andi r3,r16,65535 - 7330: a8c7883a add r3,r21,r3 - 7334: a009883a mov r4,r20 - 7338: 10e3883a add r17,r2,r3 - 733c: 8020d43a srli r16,r16,16 - 7340: 0009fc80 call 9fc8 <__mulsi3> - 7344: 8806d43a srli r3,r17,16 - 7348: 1405883a add r2,r2,r16 - 734c: 9cc00104 addi r19,r19,4 - 7350: 1887883a add r3,r3,r2 - 7354: 90c0008d sth r3,2(r18) - 7358: 9440000d sth r17,0(r18) - 735c: 182ad43a srli r21,r3,16 - 7360: 94800104 addi r18,r18,4 - 7364: 9f3feb36 bltu r19,fp,7314 <__multiply+0xec> - 7368: 95400015 stw r21,0(r18) - 736c: b9000017 ldw r4,0(r23) - 7370: 202ad43a srli r21,r4,16 - 7374: a8001c26 beq r21,zero,73e8 <__multiply+0x1c0> - 7378: d9000117 ldw r4,4(sp) - 737c: dd000017 ldw r20,0(sp) - 7380: 002d883a mov r22,zero - 7384: 24c00017 ldw r19,0(r4) - 7388: 2025883a mov r18,r4 - 738c: 9823883a mov r17,r19 - 7390: a4000017 ldw r16,0(r20) - 7394: a809883a mov r4,r21 - 7398: a5000104 addi r20,r20,4 - 739c: 817fffcc andi r5,r16,65535 - 73a0: 0009fc80 call 9fc8 <__mulsi3> - 73a4: 8806d43a srli r3,r17,16 - 73a8: 800ad43a srli r5,r16,16 - 73ac: 94c0000d sth r19,0(r18) - 73b0: b0c7883a add r3,r22,r3 - 73b4: 10e1883a add r16,r2,r3 - 73b8: 9400008d sth r16,2(r18) - 73bc: a809883a mov r4,r21 - 73c0: 94800104 addi r18,r18,4 - 73c4: 0009fc80 call 9fc8 <__mulsi3> - 73c8: 94400017 ldw r17,0(r18) - 73cc: 8020d43a srli r16,r16,16 - 73d0: 88ffffcc andi r3,r17,65535 - 73d4: 10c5883a add r2,r2,r3 - 73d8: 80a7883a add r19,r16,r2 - 73dc: 982cd43a srli r22,r19,16 - 73e0: a73feb36 bltu r20,fp,7390 <__multiply+0x168> - 73e4: 94c00015 stw r19,0(r18) - 73e8: d8800217 ldw r2,8(sp) - 73ec: bdc00104 addi r23,r23,4 - 73f0: b880042e bgeu r23,r2,7404 <__multiply+0x1dc> - 73f4: d8c00117 ldw r3,4(sp) - 73f8: 18c00104 addi r3,r3,4 - 73fc: d8c00115 stw r3,4(sp) - 7400: 003fbe06 br 72fc <__multiply+0xd4> - 7404: d9000417 ldw r4,16(sp) - 7408: 01000c0e bge zero,r4,743c <__multiply+0x214> - 740c: d8c00317 ldw r3,12(sp) - 7410: 18bfff17 ldw r2,-4(r3) - 7414: 18ffff04 addi r3,r3,-4 - 7418: 10000326 beq r2,zero,7428 <__multiply+0x200> - 741c: 00000706 br 743c <__multiply+0x214> - 7420: 18800017 ldw r2,0(r3) - 7424: 1000051e bne r2,zero,743c <__multiply+0x214> - 7428: d9000417 ldw r4,16(sp) - 742c: 18ffff04 addi r3,r3,-4 - 7430: 213fffc4 addi r4,r4,-1 - 7434: d9000415 stw r4,16(sp) - 7438: 203ff91e bne r4,zero,7420 <__multiply+0x1f8> - 743c: d8800417 ldw r2,16(sp) - 7440: d8c00517 ldw r3,20(sp) - 7444: 18800415 stw r2,16(r3) - 7448: 1805883a mov r2,r3 - 744c: dfc00f17 ldw ra,60(sp) - 7450: df000e17 ldw fp,56(sp) - 7454: ddc00d17 ldw r23,52(sp) - 7458: dd800c17 ldw r22,48(sp) - 745c: dd400b17 ldw r21,44(sp) - 7460: dd000a17 ldw r20,40(sp) - 7464: dcc00917 ldw r19,36(sp) - 7468: dc800817 ldw r18,32(sp) - 746c: dc400717 ldw r17,28(sp) - 7470: dc000617 ldw r16,24(sp) - 7474: dec01004 addi sp,sp,64 - 7478: f800283a ret - -0000747c <__i2b>: - 747c: defffd04 addi sp,sp,-12 - 7480: dc000015 stw r16,0(sp) - 7484: 04000044 movi r16,1 - 7488: dc800115 stw r18,4(sp) - 748c: 2825883a mov r18,r5 - 7490: 800b883a mov r5,r16 - 7494: dfc00215 stw ra,8(sp) - 7498: 0006d180 call 6d18 <_Balloc> - 749c: 14000415 stw r16,16(r2) - 74a0: 14800515 stw r18,20(r2) - 74a4: dfc00217 ldw ra,8(sp) - 74a8: dc800117 ldw r18,4(sp) - 74ac: dc000017 ldw r16,0(sp) - 74b0: dec00304 addi sp,sp,12 - 74b4: f800283a ret - -000074b8 <__multadd>: - 74b8: defff604 addi sp,sp,-40 - 74bc: dd800615 stw r22,24(sp) - 74c0: 2d800417 ldw r22,16(r5) - 74c4: df000815 stw fp,32(sp) - 74c8: ddc00715 stw r23,28(sp) - 74cc: dd400515 stw r21,20(sp) - 74d0: dd000415 stw r20,16(sp) - 74d4: dcc00315 stw r19,12(sp) - 74d8: dc800215 stw r18,8(sp) - 74dc: dfc00915 stw ra,36(sp) - 74e0: dc400115 stw r17,4(sp) - 74e4: dc000015 stw r16,0(sp) - 74e8: 282f883a mov r23,r5 - 74ec: 2039883a mov fp,r4 - 74f0: 302b883a mov r21,r6 - 74f4: 3829883a mov r20,r7 - 74f8: 2c800504 addi r18,r5,20 - 74fc: 0027883a mov r19,zero - 7500: 94400017 ldw r17,0(r18) - 7504: a80b883a mov r5,r21 - 7508: 9cc00044 addi r19,r19,1 - 750c: 893fffcc andi r4,r17,65535 - 7510: 0009fc80 call 9fc8 <__mulsi3> - 7514: 8808d43a srli r4,r17,16 - 7518: 1521883a add r16,r2,r20 - 751c: a80b883a mov r5,r21 - 7520: 0009fc80 call 9fc8 <__mulsi3> - 7524: 8008d43a srli r4,r16,16 - 7528: 843fffcc andi r16,r16,65535 - 752c: 1105883a add r2,r2,r4 - 7530: 1006943a slli r3,r2,16 - 7534: 1028d43a srli r20,r2,16 - 7538: 1c07883a add r3,r3,r16 - 753c: 90c00015 stw r3,0(r18) - 7540: 94800104 addi r18,r18,4 - 7544: 9dbfee16 blt r19,r22,7500 <__multadd+0x48> - 7548: a0000826 beq r20,zero,756c <__multadd+0xb4> - 754c: b8800217 ldw r2,8(r23) - 7550: b080130e bge r22,r2,75a0 <__multadd+0xe8> - 7554: b585883a add r2,r22,r22 - 7558: 1085883a add r2,r2,r2 - 755c: 15c5883a add r2,r2,r23 - 7560: b0c00044 addi r3,r22,1 - 7564: 15000515 stw r20,20(r2) - 7568: b8c00415 stw r3,16(r23) - 756c: b805883a mov r2,r23 - 7570: dfc00917 ldw ra,36(sp) - 7574: df000817 ldw fp,32(sp) - 7578: ddc00717 ldw r23,28(sp) - 757c: dd800617 ldw r22,24(sp) - 7580: dd400517 ldw r21,20(sp) - 7584: dd000417 ldw r20,16(sp) - 7588: dcc00317 ldw r19,12(sp) - 758c: dc800217 ldw r18,8(sp) - 7590: dc400117 ldw r17,4(sp) - 7594: dc000017 ldw r16,0(sp) - 7598: dec00a04 addi sp,sp,40 - 759c: f800283a ret - 75a0: b9400117 ldw r5,4(r23) - 75a4: e009883a mov r4,fp - 75a8: 29400044 addi r5,r5,1 - 75ac: 0006d180 call 6d18 <_Balloc> - 75b0: b9800417 ldw r6,16(r23) - 75b4: b9400304 addi r5,r23,12 - 75b8: 11000304 addi r4,r2,12 - 75bc: 318d883a add r6,r6,r6 - 75c0: 318d883a add r6,r6,r6 - 75c4: 31800204 addi r6,r6,8 - 75c8: 1023883a mov r17,r2 - 75cc: 00066180 call 6618 - 75d0: b80b883a mov r5,r23 - 75d4: e009883a mov r4,fp - 75d8: 00067980 call 6798 <_Bfree> - 75dc: 882f883a mov r23,r17 - 75e0: 003fdc06 br 7554 <__multadd+0x9c> - -000075e4 <__pow5mult>: - 75e4: defffa04 addi sp,sp,-24 - 75e8: 308000cc andi r2,r6,3 - 75ec: dd000415 stw r20,16(sp) - 75f0: dcc00315 stw r19,12(sp) - 75f4: dc000015 stw r16,0(sp) - 75f8: dfc00515 stw ra,20(sp) - 75fc: dc800215 stw r18,8(sp) - 7600: dc400115 stw r17,4(sp) - 7604: 3021883a mov r16,r6 - 7608: 2027883a mov r19,r4 - 760c: 2829883a mov r20,r5 - 7610: 10002b1e bne r2,zero,76c0 <__pow5mult+0xdc> - 7614: 8025d0ba srai r18,r16,2 - 7618: 90001b26 beq r18,zero,7688 <__pow5mult+0xa4> - 761c: 9c001217 ldw r16,72(r19) - 7620: 8000081e bne r16,zero,7644 <__pow5mult+0x60> - 7624: 00003006 br 76e8 <__pow5mult+0x104> - 7628: 800b883a mov r5,r16 - 762c: 800d883a mov r6,r16 - 7630: 9809883a mov r4,r19 - 7634: 90001426 beq r18,zero,7688 <__pow5mult+0xa4> - 7638: 80800017 ldw r2,0(r16) - 763c: 10001b26 beq r2,zero,76ac <__pow5mult+0xc8> - 7640: 1021883a mov r16,r2 - 7644: 9080004c andi r2,r18,1 - 7648: 1005003a cmpeq r2,r2,zero - 764c: 9025d07a srai r18,r18,1 - 7650: 800d883a mov r6,r16 - 7654: 9809883a mov r4,r19 - 7658: a00b883a mov r5,r20 - 765c: 103ff21e bne r2,zero,7628 <__pow5mult+0x44> - 7660: 00072280 call 7228 <__multiply> - 7664: a00b883a mov r5,r20 - 7668: 9809883a mov r4,r19 - 766c: 1023883a mov r17,r2 - 7670: 00067980 call 6798 <_Bfree> - 7674: 8829883a mov r20,r17 - 7678: 800b883a mov r5,r16 - 767c: 800d883a mov r6,r16 - 7680: 9809883a mov r4,r19 - 7684: 903fec1e bne r18,zero,7638 <__pow5mult+0x54> - 7688: a005883a mov r2,r20 - 768c: dfc00517 ldw ra,20(sp) - 7690: dd000417 ldw r20,16(sp) - 7694: dcc00317 ldw r19,12(sp) - 7698: dc800217 ldw r18,8(sp) - 769c: dc400117 ldw r17,4(sp) - 76a0: dc000017 ldw r16,0(sp) - 76a4: dec00604 addi sp,sp,24 - 76a8: f800283a ret - 76ac: 00072280 call 7228 <__multiply> - 76b0: 80800015 stw r2,0(r16) - 76b4: 1021883a mov r16,r2 - 76b8: 10000015 stw zero,0(r2) - 76bc: 003fe106 br 7644 <__pow5mult+0x60> - 76c0: 1085883a add r2,r2,r2 - 76c4: 00c00074 movhi r3,1 - 76c8: 18f8ea04 addi r3,r3,-7256 - 76cc: 1085883a add r2,r2,r2 - 76d0: 10c5883a add r2,r2,r3 - 76d4: 11bfff17 ldw r6,-4(r2) - 76d8: 000f883a mov r7,zero - 76dc: 00074b80 call 74b8 <__multadd> - 76e0: 1029883a mov r20,r2 - 76e4: 003fcb06 br 7614 <__pow5mult+0x30> - 76e8: 9809883a mov r4,r19 - 76ec: 01409c44 movi r5,625 - 76f0: 000747c0 call 747c <__i2b> - 76f4: 98801215 stw r2,72(r19) - 76f8: 1021883a mov r16,r2 - 76fc: 10000015 stw zero,0(r2) - 7700: 003fd006 br 7644 <__pow5mult+0x60> - -00007704 <__s2b>: - 7704: defff904 addi sp,sp,-28 - 7708: dcc00315 stw r19,12(sp) - 770c: dc800215 stw r18,8(sp) - 7710: 2827883a mov r19,r5 - 7714: 2025883a mov r18,r4 - 7718: 01400244 movi r5,9 - 771c: 39000204 addi r4,r7,8 - 7720: dd000415 stw r20,16(sp) - 7724: dc400115 stw r17,4(sp) - 7728: dfc00615 stw ra,24(sp) - 772c: dd400515 stw r21,20(sp) - 7730: dc000015 stw r16,0(sp) - 7734: 3829883a mov r20,r7 - 7738: 3023883a mov r17,r6 - 773c: 0009ef80 call 9ef8 <__divsi3> - 7740: 00c00044 movi r3,1 - 7744: 1880350e bge r3,r2,781c <__s2b+0x118> - 7748: 000b883a mov r5,zero - 774c: 18c7883a add r3,r3,r3 - 7750: 29400044 addi r5,r5,1 - 7754: 18bffd16 blt r3,r2,774c <__s2b+0x48> - 7758: 9009883a mov r4,r18 - 775c: 0006d180 call 6d18 <_Balloc> - 7760: 1011883a mov r8,r2 - 7764: d8800717 ldw r2,28(sp) - 7768: 00c00044 movi r3,1 - 776c: 01800244 movi r6,9 - 7770: 40800515 stw r2,20(r8) - 7774: 40c00415 stw r3,16(r8) - 7778: 3440260e bge r6,r17,7814 <__s2b+0x110> - 777c: 3021883a mov r16,r6 - 7780: 99ab883a add r21,r19,r6 - 7784: 9c05883a add r2,r19,r16 - 7788: 11c00007 ldb r7,0(r2) - 778c: 400b883a mov r5,r8 - 7790: 9009883a mov r4,r18 - 7794: 39fff404 addi r7,r7,-48 - 7798: 01800284 movi r6,10 - 779c: 00074b80 call 74b8 <__multadd> - 77a0: 84000044 addi r16,r16,1 - 77a4: 1011883a mov r8,r2 - 77a8: 8c3ff61e bne r17,r16,7784 <__s2b+0x80> - 77ac: ac45883a add r2,r21,r17 - 77b0: 117ffe04 addi r5,r2,-8 - 77b4: 880d883a mov r6,r17 - 77b8: 35000c0e bge r6,r20,77ec <__s2b+0xe8> - 77bc: a185c83a sub r2,r20,r6 - 77c0: 2821883a mov r16,r5 - 77c4: 28a3883a add r17,r5,r2 - 77c8: 81c00007 ldb r7,0(r16) - 77cc: 400b883a mov r5,r8 - 77d0: 9009883a mov r4,r18 - 77d4: 39fff404 addi r7,r7,-48 - 77d8: 01800284 movi r6,10 - 77dc: 00074b80 call 74b8 <__multadd> - 77e0: 84000044 addi r16,r16,1 - 77e4: 1011883a mov r8,r2 - 77e8: 847ff71e bne r16,r17,77c8 <__s2b+0xc4> - 77ec: 4005883a mov r2,r8 - 77f0: dfc00617 ldw ra,24(sp) - 77f4: dd400517 ldw r21,20(sp) - 77f8: dd000417 ldw r20,16(sp) - 77fc: dcc00317 ldw r19,12(sp) - 7800: dc800217 ldw r18,8(sp) - 7804: dc400117 ldw r17,4(sp) - 7808: dc000017 ldw r16,0(sp) - 780c: dec00704 addi sp,sp,28 - 7810: f800283a ret - 7814: 99400284 addi r5,r19,10 - 7818: 003fe706 br 77b8 <__s2b+0xb4> - 781c: 000b883a mov r5,zero - 7820: 003fcd06 br 7758 <__s2b+0x54> - -00007824 <_read_r>: - 7824: defffd04 addi sp,sp,-12 - 7828: dc000015 stw r16,0(sp) - 782c: 04000074 movhi r16,1 - 7830: 8407a504 addi r16,r16,7828 - 7834: dc400115 stw r17,4(sp) - 7838: 80000015 stw zero,0(r16) - 783c: 2023883a mov r17,r4 - 7840: 2809883a mov r4,r5 - 7844: 300b883a mov r5,r6 - 7848: 380d883a mov r6,r7 - 784c: dfc00215 stw ra,8(sp) - 7850: 000b0700 call b070 - 7854: 1007883a mov r3,r2 - 7858: 00bfffc4 movi r2,-1 - 785c: 18800626 beq r3,r2,7878 <_read_r+0x54> - 7860: 1805883a mov r2,r3 - 7864: dfc00217 ldw ra,8(sp) - 7868: dc400117 ldw r17,4(sp) - 786c: dc000017 ldw r16,0(sp) - 7870: dec00304 addi sp,sp,12 - 7874: f800283a ret - 7878: 80800017 ldw r2,0(r16) - 787c: 103ff826 beq r2,zero,7860 <_read_r+0x3c> - 7880: 88800015 stw r2,0(r17) - 7884: 1805883a mov r2,r3 - 7888: dfc00217 ldw ra,8(sp) - 788c: dc400117 ldw r17,4(sp) - 7890: dc000017 ldw r16,0(sp) - 7894: dec00304 addi sp,sp,12 - 7898: f800283a ret - -0000789c <_realloc_r>: - 789c: defff404 addi sp,sp,-48 - 78a0: dd800815 stw r22,32(sp) - 78a4: dc800415 stw r18,16(sp) - 78a8: dc400315 stw r17,12(sp) - 78ac: dfc00b15 stw ra,44(sp) - 78b0: df000a15 stw fp,40(sp) - 78b4: ddc00915 stw r23,36(sp) - 78b8: dd400715 stw r21,28(sp) - 78bc: dd000615 stw r20,24(sp) - 78c0: dcc00515 stw r19,20(sp) - 78c4: dc000215 stw r16,8(sp) - 78c8: 2825883a mov r18,r5 - 78cc: 3023883a mov r17,r6 - 78d0: 202d883a mov r22,r4 - 78d4: 2800c926 beq r5,zero,7bfc <_realloc_r+0x360> - 78d8: 000ad4c0 call ad4c <__malloc_lock> - 78dc: 943ffe04 addi r16,r18,-8 - 78e0: 88c002c4 addi r3,r17,11 - 78e4: 00800584 movi r2,22 - 78e8: 82000117 ldw r8,4(r16) - 78ec: 10c01b2e bgeu r2,r3,795c <_realloc_r+0xc0> - 78f0: 00bffe04 movi r2,-8 - 78f4: 188e703a and r7,r3,r2 - 78f8: 3839883a mov fp,r7 - 78fc: 38001a16 blt r7,zero,7968 <_realloc_r+0xcc> - 7900: e4401936 bltu fp,r17,7968 <_realloc_r+0xcc> - 7904: 013fff04 movi r4,-4 - 7908: 4126703a and r19,r8,r4 - 790c: 99c02616 blt r19,r7,79a8 <_realloc_r+0x10c> - 7910: 802b883a mov r21,r16 - 7914: 9829883a mov r20,r19 - 7918: 84000204 addi r16,r16,8 - 791c: a80f883a mov r7,r21 - 7920: a70dc83a sub r6,r20,fp - 7924: 008003c4 movi r2,15 - 7928: 1180c136 bltu r2,r6,7c30 <_realloc_r+0x394> - 792c: 38800117 ldw r2,4(r7) - 7930: a549883a add r4,r20,r21 - 7934: 1080004c andi r2,r2,1 - 7938: a084b03a or r2,r20,r2 - 793c: 38800115 stw r2,4(r7) - 7940: 20c00117 ldw r3,4(r4) - 7944: 18c00054 ori r3,r3,1 - 7948: 20c00115 stw r3,4(r4) - 794c: b009883a mov r4,r22 - 7950: 000ad6c0 call ad6c <__malloc_unlock> - 7954: 8023883a mov r17,r16 - 7958: 00000606 br 7974 <_realloc_r+0xd8> - 795c: 01c00404 movi r7,16 - 7960: 3839883a mov fp,r7 - 7964: e47fe72e bgeu fp,r17,7904 <_realloc_r+0x68> - 7968: 00800304 movi r2,12 - 796c: 0023883a mov r17,zero - 7970: b0800015 stw r2,0(r22) - 7974: 8805883a mov r2,r17 - 7978: dfc00b17 ldw ra,44(sp) - 797c: df000a17 ldw fp,40(sp) - 7980: ddc00917 ldw r23,36(sp) - 7984: dd800817 ldw r22,32(sp) - 7988: dd400717 ldw r21,28(sp) - 798c: dd000617 ldw r20,24(sp) - 7990: dcc00517 ldw r19,20(sp) - 7994: dc800417 ldw r18,16(sp) - 7998: dc400317 ldw r17,12(sp) - 799c: dc000217 ldw r16,8(sp) - 79a0: dec00c04 addi sp,sp,48 - 79a4: f800283a ret - 79a8: 00800074 movhi r2,1 - 79ac: 10bae304 addi r2,r2,-5236 - 79b0: 12400217 ldw r9,8(r2) - 79b4: 84cd883a add r6,r16,r19 - 79b8: 802b883a mov r21,r16 - 79bc: 3240b926 beq r6,r9,7ca4 <_realloc_r+0x408> - 79c0: 31400117 ldw r5,4(r6) - 79c4: 00bfff84 movi r2,-2 - 79c8: 2884703a and r2,r5,r2 - 79cc: 1185883a add r2,r2,r6 - 79d0: 10c00117 ldw r3,4(r2) - 79d4: 18c0004c andi r3,r3,1 - 79d8: 1807003a cmpeq r3,r3,zero - 79dc: 1800a326 beq r3,zero,7c6c <_realloc_r+0x3d0> - 79e0: 2908703a and r4,r5,r4 - 79e4: 9929883a add r20,r19,r4 - 79e8: a1c0a30e bge r20,r7,7c78 <_realloc_r+0x3dc> - 79ec: 4080004c andi r2,r8,1 - 79f0: 1000551e bne r2,zero,7b48 <_realloc_r+0x2ac> - 79f4: 80800017 ldw r2,0(r16) - 79f8: 80afc83a sub r23,r16,r2 - 79fc: b8c00117 ldw r3,4(r23) - 7a00: 00bfff04 movi r2,-4 - 7a04: 1884703a and r2,r3,r2 - 7a08: 30002e26 beq r6,zero,7ac4 <_realloc_r+0x228> - 7a0c: 3240b926 beq r6,r9,7cf4 <_realloc_r+0x458> - 7a10: 98a9883a add r20,r19,r2 - 7a14: 2509883a add r4,r4,r20 - 7a18: d9000015 stw r4,0(sp) - 7a1c: 21c02a16 blt r4,r7,7ac8 <_realloc_r+0x22c> - 7a20: 30800317 ldw r2,12(r6) - 7a24: 30c00217 ldw r3,8(r6) - 7a28: 01400904 movi r5,36 - 7a2c: 99bfff04 addi r6,r19,-4 - 7a30: 18800315 stw r2,12(r3) - 7a34: 10c00215 stw r3,8(r2) - 7a38: b9000317 ldw r4,12(r23) - 7a3c: b8800217 ldw r2,8(r23) - 7a40: b82b883a mov r21,r23 - 7a44: bc000204 addi r16,r23,8 - 7a48: 20800215 stw r2,8(r4) - 7a4c: 11000315 stw r4,12(r2) - 7a50: 2980e436 bltu r5,r6,7de4 <_realloc_r+0x548> - 7a54: 008004c4 movi r2,19 - 7a58: 9009883a mov r4,r18 - 7a5c: 8011883a mov r8,r16 - 7a60: 11800f2e bgeu r2,r6,7aa0 <_realloc_r+0x204> - 7a64: 90800017 ldw r2,0(r18) - 7a68: ba000404 addi r8,r23,16 - 7a6c: 91000204 addi r4,r18,8 - 7a70: b8800215 stw r2,8(r23) - 7a74: 90c00117 ldw r3,4(r18) - 7a78: 008006c4 movi r2,27 - 7a7c: b8c00315 stw r3,12(r23) - 7a80: 1180072e bgeu r2,r6,7aa0 <_realloc_r+0x204> - 7a84: 90c00217 ldw r3,8(r18) - 7a88: ba000604 addi r8,r23,24 - 7a8c: 91000404 addi r4,r18,16 - 7a90: b8c00415 stw r3,16(r23) - 7a94: 90800317 ldw r2,12(r18) - 7a98: b8800515 stw r2,20(r23) - 7a9c: 3140e726 beq r6,r5,7e3c <_realloc_r+0x5a0> - 7aa0: 20800017 ldw r2,0(r4) - 7aa4: dd000017 ldw r20,0(sp) - 7aa8: b80f883a mov r7,r23 - 7aac: 40800015 stw r2,0(r8) - 7ab0: 20c00117 ldw r3,4(r4) - 7ab4: 40c00115 stw r3,4(r8) - 7ab8: 20800217 ldw r2,8(r4) - 7abc: 40800215 stw r2,8(r8) - 7ac0: 003f9706 br 7920 <_realloc_r+0x84> - 7ac4: 98a9883a add r20,r19,r2 - 7ac8: a1c01f16 blt r20,r7,7b48 <_realloc_r+0x2ac> - 7acc: b8c00317 ldw r3,12(r23) - 7ad0: b8800217 ldw r2,8(r23) - 7ad4: 99bfff04 addi r6,r19,-4 - 7ad8: 01400904 movi r5,36 - 7adc: b82b883a mov r21,r23 - 7ae0: 18800215 stw r2,8(r3) - 7ae4: 10c00315 stw r3,12(r2) - 7ae8: bc000204 addi r16,r23,8 - 7aec: 2980c336 bltu r5,r6,7dfc <_realloc_r+0x560> - 7af0: 008004c4 movi r2,19 - 7af4: 9009883a mov r4,r18 - 7af8: 8011883a mov r8,r16 - 7afc: 11800f2e bgeu r2,r6,7b3c <_realloc_r+0x2a0> - 7b00: 90800017 ldw r2,0(r18) - 7b04: ba000404 addi r8,r23,16 - 7b08: 91000204 addi r4,r18,8 - 7b0c: b8800215 stw r2,8(r23) - 7b10: 90c00117 ldw r3,4(r18) - 7b14: 008006c4 movi r2,27 - 7b18: b8c00315 stw r3,12(r23) - 7b1c: 1180072e bgeu r2,r6,7b3c <_realloc_r+0x2a0> - 7b20: 90c00217 ldw r3,8(r18) - 7b24: ba000604 addi r8,r23,24 - 7b28: 91000404 addi r4,r18,16 - 7b2c: b8c00415 stw r3,16(r23) - 7b30: 90800317 ldw r2,12(r18) - 7b34: b8800515 stw r2,20(r23) - 7b38: 3140c726 beq r6,r5,7e58 <_realloc_r+0x5bc> - 7b3c: 20800017 ldw r2,0(r4) - 7b40: b80f883a mov r7,r23 - 7b44: 003fd906 br 7aac <_realloc_r+0x210> - 7b48: 880b883a mov r5,r17 - 7b4c: b009883a mov r4,r22 - 7b50: 00017640 call 1764 <_malloc_r> - 7b54: 1023883a mov r17,r2 - 7b58: 10002526 beq r2,zero,7bf0 <_realloc_r+0x354> - 7b5c: 80800117 ldw r2,4(r16) - 7b60: 00ffff84 movi r3,-2 - 7b64: 893ffe04 addi r4,r17,-8 - 7b68: 10c4703a and r2,r2,r3 - 7b6c: 8085883a add r2,r16,r2 - 7b70: 20809526 beq r4,r2,7dc8 <_realloc_r+0x52c> - 7b74: 99bfff04 addi r6,r19,-4 - 7b78: 01c00904 movi r7,36 - 7b7c: 39804536 bltu r7,r6,7c94 <_realloc_r+0x3f8> - 7b80: 008004c4 movi r2,19 - 7b84: 9009883a mov r4,r18 - 7b88: 880b883a mov r5,r17 - 7b8c: 11800f2e bgeu r2,r6,7bcc <_realloc_r+0x330> - 7b90: 90800017 ldw r2,0(r18) - 7b94: 89400204 addi r5,r17,8 - 7b98: 91000204 addi r4,r18,8 - 7b9c: 88800015 stw r2,0(r17) - 7ba0: 90c00117 ldw r3,4(r18) - 7ba4: 008006c4 movi r2,27 - 7ba8: 88c00115 stw r3,4(r17) - 7bac: 1180072e bgeu r2,r6,7bcc <_realloc_r+0x330> - 7bb0: 90c00217 ldw r3,8(r18) - 7bb4: 89400404 addi r5,r17,16 - 7bb8: 91000404 addi r4,r18,16 - 7bbc: 88c00215 stw r3,8(r17) - 7bc0: 90800317 ldw r2,12(r18) - 7bc4: 88800315 stw r2,12(r17) - 7bc8: 31c09126 beq r6,r7,7e10 <_realloc_r+0x574> - 7bcc: 20800017 ldw r2,0(r4) - 7bd0: 28800015 stw r2,0(r5) - 7bd4: 20c00117 ldw r3,4(r4) - 7bd8: 28c00115 stw r3,4(r5) - 7bdc: 20800217 ldw r2,8(r4) - 7be0: 28800215 stw r2,8(r5) - 7be4: 900b883a mov r5,r18 - 7be8: b009883a mov r4,r22 - 7bec: 0000b7c0 call b7c <_free_r> - 7bf0: b009883a mov r4,r22 - 7bf4: 000ad6c0 call ad6c <__malloc_unlock> - 7bf8: 003f5e06 br 7974 <_realloc_r+0xd8> - 7bfc: 300b883a mov r5,r6 - 7c00: dfc00b17 ldw ra,44(sp) - 7c04: df000a17 ldw fp,40(sp) - 7c08: ddc00917 ldw r23,36(sp) - 7c0c: dd800817 ldw r22,32(sp) - 7c10: dd400717 ldw r21,28(sp) - 7c14: dd000617 ldw r20,24(sp) - 7c18: dcc00517 ldw r19,20(sp) - 7c1c: dc800417 ldw r18,16(sp) - 7c20: dc400317 ldw r17,12(sp) - 7c24: dc000217 ldw r16,8(sp) - 7c28: dec00c04 addi sp,sp,48 - 7c2c: 00017641 jmpi 1764 <_malloc_r> - 7c30: 38800117 ldw r2,4(r7) - 7c34: e54b883a add r5,fp,r21 - 7c38: 31000054 ori r4,r6,1 - 7c3c: 1080004c andi r2,r2,1 - 7c40: 1704b03a or r2,r2,fp - 7c44: 38800115 stw r2,4(r7) - 7c48: 29000115 stw r4,4(r5) - 7c4c: 2987883a add r3,r5,r6 - 7c50: 18800117 ldw r2,4(r3) - 7c54: 29400204 addi r5,r5,8 - 7c58: b009883a mov r4,r22 - 7c5c: 10800054 ori r2,r2,1 - 7c60: 18800115 stw r2,4(r3) - 7c64: 0000b7c0 call b7c <_free_r> - 7c68: 003f3806 br 794c <_realloc_r+0xb0> - 7c6c: 000d883a mov r6,zero - 7c70: 0009883a mov r4,zero - 7c74: 003f5d06 br 79ec <_realloc_r+0x150> - 7c78: 30c00217 ldw r3,8(r6) - 7c7c: 30800317 ldw r2,12(r6) - 7c80: 800f883a mov r7,r16 - 7c84: 84000204 addi r16,r16,8 - 7c88: 10c00215 stw r3,8(r2) - 7c8c: 18800315 stw r2,12(r3) - 7c90: 003f2306 br 7920 <_realloc_r+0x84> - 7c94: 8809883a mov r4,r17 - 7c98: 900b883a mov r5,r18 - 7c9c: 00066b80 call 66b8 - 7ca0: 003fd006 br 7be4 <_realloc_r+0x348> - 7ca4: 30800117 ldw r2,4(r6) - 7ca8: e0c00404 addi r3,fp,16 - 7cac: 1108703a and r4,r2,r4 - 7cb0: 9905883a add r2,r19,r4 - 7cb4: 10ff4d16 blt r2,r3,79ec <_realloc_r+0x150> - 7cb8: 1705c83a sub r2,r2,fp - 7cbc: 870b883a add r5,r16,fp - 7cc0: 10800054 ori r2,r2,1 - 7cc4: 28800115 stw r2,4(r5) - 7cc8: 80c00117 ldw r3,4(r16) - 7ccc: 00800074 movhi r2,1 - 7cd0: 10bae304 addi r2,r2,-5236 - 7cd4: b009883a mov r4,r22 - 7cd8: 18c0004c andi r3,r3,1 - 7cdc: e0c6b03a or r3,fp,r3 - 7ce0: 11400215 stw r5,8(r2) - 7ce4: 80c00115 stw r3,4(r16) - 7ce8: 000ad6c0 call ad6c <__malloc_unlock> - 7cec: 84400204 addi r17,r16,8 - 7cf0: 003f2006 br 7974 <_realloc_r+0xd8> - 7cf4: 98a9883a add r20,r19,r2 - 7cf8: 2509883a add r4,r4,r20 - 7cfc: e0800404 addi r2,fp,16 - 7d00: d9000115 stw r4,4(sp) - 7d04: 20bf7016 blt r4,r2,7ac8 <_realloc_r+0x22c> - 7d08: b8c00317 ldw r3,12(r23) - 7d0c: b8800217 ldw r2,8(r23) - 7d10: 99bfff04 addi r6,r19,-4 - 7d14: 01400904 movi r5,36 - 7d18: 18800215 stw r2,8(r3) - 7d1c: 10c00315 stw r3,12(r2) - 7d20: bc400204 addi r17,r23,8 - 7d24: 29804136 bltu r5,r6,7e2c <_realloc_r+0x590> - 7d28: 008004c4 movi r2,19 - 7d2c: 9009883a mov r4,r18 - 7d30: 880f883a mov r7,r17 - 7d34: 11800f2e bgeu r2,r6,7d74 <_realloc_r+0x4d8> - 7d38: 90800017 ldw r2,0(r18) - 7d3c: b9c00404 addi r7,r23,16 - 7d40: 91000204 addi r4,r18,8 - 7d44: b8800215 stw r2,8(r23) - 7d48: 90c00117 ldw r3,4(r18) - 7d4c: 008006c4 movi r2,27 - 7d50: b8c00315 stw r3,12(r23) - 7d54: 1180072e bgeu r2,r6,7d74 <_realloc_r+0x4d8> - 7d58: 90c00217 ldw r3,8(r18) - 7d5c: b9c00604 addi r7,r23,24 - 7d60: 91000404 addi r4,r18,16 - 7d64: b8c00415 stw r3,16(r23) - 7d68: 90800317 ldw r2,12(r18) - 7d6c: b8800515 stw r2,20(r23) - 7d70: 31404026 beq r6,r5,7e74 <_realloc_r+0x5d8> - 7d74: 20800017 ldw r2,0(r4) - 7d78: 38800015 stw r2,0(r7) - 7d7c: 20c00117 ldw r3,4(r4) - 7d80: 38c00115 stw r3,4(r7) - 7d84: 20800217 ldw r2,8(r4) - 7d88: 38800215 stw r2,8(r7) - 7d8c: d8c00117 ldw r3,4(sp) - 7d90: bf0b883a add r5,r23,fp - 7d94: b009883a mov r4,r22 - 7d98: 1f05c83a sub r2,r3,fp - 7d9c: 10800054 ori r2,r2,1 - 7da0: 28800115 stw r2,4(r5) - 7da4: b8c00117 ldw r3,4(r23) - 7da8: 00800074 movhi r2,1 - 7dac: 10bae304 addi r2,r2,-5236 - 7db0: 11400215 stw r5,8(r2) - 7db4: 18c0004c andi r3,r3,1 - 7db8: e0c6b03a or r3,fp,r3 - 7dbc: b8c00115 stw r3,4(r23) - 7dc0: 000ad6c0 call ad6c <__malloc_unlock> - 7dc4: 003eeb06 br 7974 <_realloc_r+0xd8> - 7dc8: 20800117 ldw r2,4(r4) - 7dcc: 00ffff04 movi r3,-4 - 7dd0: 800f883a mov r7,r16 - 7dd4: 10c4703a and r2,r2,r3 - 7dd8: 98a9883a add r20,r19,r2 - 7ddc: 84000204 addi r16,r16,8 - 7de0: 003ecf06 br 7920 <_realloc_r+0x84> - 7de4: 900b883a mov r5,r18 - 7de8: 8009883a mov r4,r16 - 7dec: 00066b80 call 66b8 - 7df0: dd000017 ldw r20,0(sp) - 7df4: b80f883a mov r7,r23 - 7df8: 003ec906 br 7920 <_realloc_r+0x84> - 7dfc: 900b883a mov r5,r18 - 7e00: 8009883a mov r4,r16 - 7e04: 00066b80 call 66b8 - 7e08: b80f883a mov r7,r23 - 7e0c: 003ec406 br 7920 <_realloc_r+0x84> - 7e10: 90c00417 ldw r3,16(r18) - 7e14: 89400604 addi r5,r17,24 - 7e18: 91000604 addi r4,r18,24 - 7e1c: 88c00415 stw r3,16(r17) - 7e20: 90800517 ldw r2,20(r18) - 7e24: 88800515 stw r2,20(r17) - 7e28: 003f6806 br 7bcc <_realloc_r+0x330> - 7e2c: 900b883a mov r5,r18 - 7e30: 8809883a mov r4,r17 - 7e34: 00066b80 call 66b8 - 7e38: 003fd406 br 7d8c <_realloc_r+0x4f0> - 7e3c: 90c00417 ldw r3,16(r18) - 7e40: 91000604 addi r4,r18,24 - 7e44: ba000804 addi r8,r23,32 - 7e48: b8c00615 stw r3,24(r23) - 7e4c: 90800517 ldw r2,20(r18) - 7e50: b8800715 stw r2,28(r23) - 7e54: 003f1206 br 7aa0 <_realloc_r+0x204> - 7e58: 90c00417 ldw r3,16(r18) - 7e5c: 91000604 addi r4,r18,24 - 7e60: ba000804 addi r8,r23,32 - 7e64: b8c00615 stw r3,24(r23) - 7e68: 90800517 ldw r2,20(r18) - 7e6c: b8800715 stw r2,28(r23) - 7e70: 003f3206 br 7b3c <_realloc_r+0x2a0> - 7e74: 90c00417 ldw r3,16(r18) - 7e78: 91000604 addi r4,r18,24 - 7e7c: b9c00804 addi r7,r23,32 - 7e80: b8c00615 stw r3,24(r23) - 7e84: 90800517 ldw r2,20(r18) - 7e88: b8800715 stw r2,28(r23) - 7e8c: 003fb906 br 7d74 <_realloc_r+0x4d8> - -00007e90 <__isinfd>: - 7e90: 200d883a mov r6,r4 - 7e94: 0109c83a sub r4,zero,r4 - 7e98: 2188b03a or r4,r4,r6 - 7e9c: 2008d7fa srli r4,r4,31 - 7ea0: 00a00034 movhi r2,32768 - 7ea4: 10bfffc4 addi r2,r2,-1 - 7ea8: 1144703a and r2,r2,r5 - 7eac: 2088b03a or r4,r4,r2 - 7eb0: 009ffc34 movhi r2,32752 - 7eb4: 1105c83a sub r2,r2,r4 - 7eb8: 0087c83a sub r3,zero,r2 - 7ebc: 10c4b03a or r2,r2,r3 - 7ec0: 1004d7fa srli r2,r2,31 - 7ec4: 00c00044 movi r3,1 - 7ec8: 1885c83a sub r2,r3,r2 - 7ecc: f800283a ret - -00007ed0 <__isnand>: - 7ed0: 200d883a mov r6,r4 - 7ed4: 0109c83a sub r4,zero,r4 - 7ed8: 2188b03a or r4,r4,r6 - 7edc: 2008d7fa srli r4,r4,31 - 7ee0: 00a00034 movhi r2,32768 - 7ee4: 10bfffc4 addi r2,r2,-1 - 7ee8: 1144703a and r2,r2,r5 - 7eec: 2088b03a or r4,r4,r2 - 7ef0: 009ffc34 movhi r2,32752 - 7ef4: 1105c83a sub r2,r2,r4 - 7ef8: 1004d7fa srli r2,r2,31 - 7efc: f800283a ret - -00007f00 : - 7f00: 2144b03a or r2,r4,r5 - 7f04: 108000cc andi r2,r2,3 - 7f08: 10001d1e bne r2,zero,7f80 - 7f0c: 200f883a mov r7,r4 - 7f10: 28800017 ldw r2,0(r5) - 7f14: 21000017 ldw r4,0(r4) - 7f18: 280d883a mov r6,r5 - 7f1c: 2080161e bne r4,r2,7f78 - 7f20: 023fbff4 movhi r8,65279 - 7f24: 423fbfc4 addi r8,r8,-257 - 7f28: 2207883a add r3,r4,r8 - 7f2c: 01602074 movhi r5,32897 - 7f30: 29602004 addi r5,r5,-32640 - 7f34: 1946703a and r3,r3,r5 - 7f38: 0104303a nor r2,zero,r4 - 7f3c: 10c4703a and r2,r2,r3 - 7f40: 10001c1e bne r2,zero,7fb4 - 7f44: 4013883a mov r9,r8 - 7f48: 2811883a mov r8,r5 - 7f4c: 00000106 br 7f54 - 7f50: 1800181e bne r3,zero,7fb4 - 7f54: 39c00104 addi r7,r7,4 - 7f58: 39000017 ldw r4,0(r7) - 7f5c: 31800104 addi r6,r6,4 - 7f60: 31400017 ldw r5,0(r6) - 7f64: 2245883a add r2,r4,r9 - 7f68: 1204703a and r2,r2,r8 - 7f6c: 0106303a nor r3,zero,r4 - 7f70: 1886703a and r3,r3,r2 - 7f74: 217ff626 beq r4,r5,7f50 - 7f78: 3809883a mov r4,r7 - 7f7c: 300b883a mov r5,r6 - 7f80: 20c00007 ldb r3,0(r4) - 7f84: 1800051e bne r3,zero,7f9c - 7f88: 00000606 br 7fa4 - 7f8c: 21000044 addi r4,r4,1 - 7f90: 20c00007 ldb r3,0(r4) - 7f94: 29400044 addi r5,r5,1 - 7f98: 18000226 beq r3,zero,7fa4 - 7f9c: 28800007 ldb r2,0(r5) - 7fa0: 18bffa26 beq r3,r2,7f8c - 7fa4: 20c00003 ldbu r3,0(r4) - 7fa8: 28800003 ldbu r2,0(r5) - 7fac: 1885c83a sub r2,r3,r2 - 7fb0: f800283a ret - 7fb4: 0005883a mov r2,zero - 7fb8: f800283a ret - -00007fbc <_calloc_r>: - 7fbc: defffe04 addi sp,sp,-8 - 7fc0: dc400015 stw r17,0(sp) - 7fc4: 2023883a mov r17,r4 - 7fc8: 2809883a mov r4,r5 - 7fcc: 300b883a mov r5,r6 - 7fd0: dfc00115 stw ra,4(sp) - 7fd4: 0009fc80 call 9fc8 <__mulsi3> - 7fd8: 100b883a mov r5,r2 - 7fdc: 8809883a mov r4,r17 - 7fe0: 00017640 call 1764 <_malloc_r> - 7fe4: 1023883a mov r17,r2 - 7fe8: 01c00904 movi r7,36 - 7fec: 10000d26 beq r2,zero,8024 <_calloc_r+0x68> - 7ff0: 10ffff17 ldw r3,-4(r2) - 7ff4: 1009883a mov r4,r2 - 7ff8: 00bfff04 movi r2,-4 - 7ffc: 1886703a and r3,r3,r2 - 8000: 1887883a add r3,r3,r2 - 8004: 180d883a mov r6,r3 - 8008: 000b883a mov r5,zero - 800c: 38c01736 bltu r7,r3,806c <_calloc_r+0xb0> - 8010: 008004c4 movi r2,19 - 8014: 10c00836 bltu r2,r3,8038 <_calloc_r+0x7c> - 8018: 20000215 stw zero,8(r4) - 801c: 20000015 stw zero,0(r4) - 8020: 20000115 stw zero,4(r4) - 8024: 8805883a mov r2,r17 - 8028: dfc00117 ldw ra,4(sp) - 802c: dc400017 ldw r17,0(sp) - 8030: dec00204 addi sp,sp,8 - 8034: f800283a ret - 8038: 008006c4 movi r2,27 - 803c: 88000015 stw zero,0(r17) - 8040: 88000115 stw zero,4(r17) - 8044: 89000204 addi r4,r17,8 - 8048: 10fff32e bgeu r2,r3,8018 <_calloc_r+0x5c> - 804c: 88000215 stw zero,8(r17) - 8050: 88000315 stw zero,12(r17) - 8054: 89000404 addi r4,r17,16 - 8058: 19ffef1e bne r3,r7,8018 <_calloc_r+0x5c> - 805c: 89000604 addi r4,r17,24 - 8060: 88000415 stw zero,16(r17) - 8064: 88000515 stw zero,20(r17) - 8068: 003feb06 br 8018 <_calloc_r+0x5c> - 806c: 0001ea40 call 1ea4 - 8070: 8805883a mov r2,r17 - 8074: dfc00117 ldw ra,4(sp) - 8078: dc400017 ldw r17,0(sp) - 807c: dec00204 addi sp,sp,8 - 8080: f800283a ret - -00008084 <__udivdi3>: - 8084: defff104 addi sp,sp,-60 - 8088: 0015883a mov r10,zero - 808c: 2005883a mov r2,r4 - 8090: 3011883a mov r8,r6 - 8094: df000d15 stw fp,52(sp) - 8098: dd400a15 stw r21,40(sp) - 809c: dcc00815 stw r19,32(sp) - 80a0: dfc00e15 stw ra,56(sp) - 80a4: ddc00c15 stw r23,48(sp) - 80a8: dd800b15 stw r22,44(sp) - 80ac: dd000915 stw r20,36(sp) - 80b0: dc800715 stw r18,28(sp) - 80b4: dc400615 stw r17,24(sp) - 80b8: dc000515 stw r16,20(sp) - 80bc: da800315 stw r10,12(sp) - 80c0: 4027883a mov r19,r8 - 80c4: 1039883a mov fp,r2 - 80c8: 282b883a mov r21,r5 - 80cc: da800415 stw r10,16(sp) - 80d0: 3800401e bne r7,zero,81d4 <__udivdi3+0x150> - 80d4: 2a006536 bltu r5,r8,826c <__udivdi3+0x1e8> - 80d8: 4000b526 beq r8,zero,83b0 <__udivdi3+0x32c> - 80dc: 00bfffd4 movui r2,65535 - 80e0: 14c0ad36 bltu r2,r19,8398 <__udivdi3+0x314> - 80e4: 00803fc4 movi r2,255 - 80e8: 14c15e36 bltu r2,r19,8664 <__udivdi3+0x5e0> - 80ec: 000b883a mov r5,zero - 80f0: 0005883a mov r2,zero - 80f4: 9884d83a srl r2,r19,r2 - 80f8: 01000074 movhi r4,1 - 80fc: 2138f204 addi r4,r4,-7224 - 8100: 01800804 movi r6,32 - 8104: 1105883a add r2,r2,r4 - 8108: 10c00003 ldbu r3,0(r2) - 810c: 28c7883a add r3,r5,r3 - 8110: 30e9c83a sub r20,r6,r3 - 8114: a0010a1e bne r20,zero,8540 <__udivdi3+0x4bc> - 8118: 982ed43a srli r23,r19,16 - 811c: acebc83a sub r21,r21,r19 - 8120: 9dbfffcc andi r22,r19,65535 - 8124: 05000044 movi r20,1 - 8128: a809883a mov r4,r21 - 812c: b80b883a mov r5,r23 - 8130: 0009fb80 call 9fb8 <__udivsi3> - 8134: 100b883a mov r5,r2 - 8138: b009883a mov r4,r22 - 813c: 1021883a mov r16,r2 - 8140: 0009fc80 call 9fc8 <__mulsi3> - 8144: a809883a mov r4,r21 - 8148: b80b883a mov r5,r23 - 814c: 1023883a mov r17,r2 - 8150: 0009fc00 call 9fc0 <__umodsi3> - 8154: 1004943a slli r2,r2,16 - 8158: e006d43a srli r3,fp,16 - 815c: 10c4b03a or r2,r2,r3 - 8160: 1440042e bgeu r2,r17,8174 <__udivdi3+0xf0> - 8164: 14c5883a add r2,r2,r19 - 8168: 843fffc4 addi r16,r16,-1 - 816c: 14c00136 bltu r2,r19,8174 <__udivdi3+0xf0> - 8170: 14415c36 bltu r2,r17,86e4 <__udivdi3+0x660> - 8174: 1463c83a sub r17,r2,r17 - 8178: 8809883a mov r4,r17 - 817c: b80b883a mov r5,r23 - 8180: 0009fb80 call 9fb8 <__udivsi3> - 8184: 100b883a mov r5,r2 - 8188: b009883a mov r4,r22 - 818c: 102b883a mov r21,r2 - 8190: 0009fc80 call 9fc8 <__mulsi3> - 8194: 8809883a mov r4,r17 - 8198: b80b883a mov r5,r23 - 819c: 1025883a mov r18,r2 - 81a0: 0009fc00 call 9fc0 <__umodsi3> - 81a4: 1004943a slli r2,r2,16 - 81a8: e0ffffcc andi r3,fp,65535 - 81ac: 10c4b03a or r2,r2,r3 - 81b0: 1480042e bgeu r2,r18,81c4 <__udivdi3+0x140> - 81b4: 9885883a add r2,r19,r2 - 81b8: ad7fffc4 addi r21,r21,-1 - 81bc: 14c00136 bltu r2,r19,81c4 <__udivdi3+0x140> - 81c0: 14813c36 bltu r2,r18,86b4 <__udivdi3+0x630> - 81c4: 8004943a slli r2,r16,16 - 81c8: a009883a mov r4,r20 - 81cc: a884b03a or r2,r21,r2 - 81d0: 00001506 br 8228 <__udivdi3+0x1a4> - 81d4: 380d883a mov r6,r7 - 81d8: 29c06c36 bltu r5,r7,838c <__udivdi3+0x308> - 81dc: 00bfffd4 movui r2,65535 - 81e0: 11c06436 bltu r2,r7,8374 <__udivdi3+0x2f0> - 81e4: 00803fc4 movi r2,255 - 81e8: 11c11836 bltu r2,r7,864c <__udivdi3+0x5c8> - 81ec: 000b883a mov r5,zero - 81f0: 0005883a mov r2,zero - 81f4: 3084d83a srl r2,r6,r2 - 81f8: 01000074 movhi r4,1 - 81fc: 2138f204 addi r4,r4,-7224 - 8200: 01c00804 movi r7,32 - 8204: 1105883a add r2,r2,r4 - 8208: 10c00003 ldbu r3,0(r2) - 820c: 28c7883a add r3,r5,r3 - 8210: 38edc83a sub r22,r7,r3 - 8214: b000731e bne r22,zero,83e4 <__udivdi3+0x360> - 8218: 35400136 bltu r6,r21,8220 <__udivdi3+0x19c> - 821c: e4c05b36 bltu fp,r19,838c <__udivdi3+0x308> - 8220: 00800044 movi r2,1 - 8224: 0009883a mov r4,zero - 8228: d8800315 stw r2,12(sp) - 822c: d9400317 ldw r5,12(sp) - 8230: 2007883a mov r3,r4 - 8234: d9000415 stw r4,16(sp) - 8238: 2805883a mov r2,r5 - 823c: dfc00e17 ldw ra,56(sp) - 8240: df000d17 ldw fp,52(sp) - 8244: ddc00c17 ldw r23,48(sp) - 8248: dd800b17 ldw r22,44(sp) - 824c: dd400a17 ldw r21,40(sp) - 8250: dd000917 ldw r20,36(sp) - 8254: dcc00817 ldw r19,32(sp) - 8258: dc800717 ldw r18,28(sp) - 825c: dc400617 ldw r17,24(sp) - 8260: dc000517 ldw r16,20(sp) - 8264: dec00f04 addi sp,sp,60 - 8268: f800283a ret - 826c: 00bfffd4 movui r2,65535 - 8270: 12005636 bltu r2,r8,83cc <__udivdi3+0x348> - 8274: 00803fc4 movi r2,255 - 8278: 12010036 bltu r2,r8,867c <__udivdi3+0x5f8> - 827c: 000b883a mov r5,zero - 8280: 0005883a mov r2,zero - 8284: 9884d83a srl r2,r19,r2 - 8288: 01000074 movhi r4,1 - 828c: 2138f204 addi r4,r4,-7224 - 8290: 01800804 movi r6,32 - 8294: 1105883a add r2,r2,r4 - 8298: 10c00003 ldbu r3,0(r2) - 829c: 28c7883a add r3,r5,r3 - 82a0: 30cbc83a sub r5,r6,r3 - 82a4: 28000626 beq r5,zero,82c0 <__udivdi3+0x23c> - 82a8: 3145c83a sub r2,r6,r5 - 82ac: e084d83a srl r2,fp,r2 - 82b0: a946983a sll r3,r21,r5 - 82b4: e178983a sll fp,fp,r5 - 82b8: 9966983a sll r19,r19,r5 - 82bc: 18aab03a or r21,r3,r2 - 82c0: 982ed43a srli r23,r19,16 - 82c4: a809883a mov r4,r21 - 82c8: 9cbfffcc andi r18,r19,65535 - 82cc: b80b883a mov r5,r23 - 82d0: 0009fb80 call 9fb8 <__udivsi3> - 82d4: 100b883a mov r5,r2 - 82d8: 9009883a mov r4,r18 - 82dc: 1021883a mov r16,r2 - 82e0: 0009fc80 call 9fc8 <__mulsi3> - 82e4: a809883a mov r4,r21 - 82e8: b80b883a mov r5,r23 - 82ec: 1023883a mov r17,r2 - 82f0: 0009fc00 call 9fc0 <__umodsi3> - 82f4: 1004943a slli r2,r2,16 - 82f8: e006d43a srli r3,fp,16 - 82fc: 10c4b03a or r2,r2,r3 - 8300: 1440042e bgeu r2,r17,8314 <__udivdi3+0x290> - 8304: 14c5883a add r2,r2,r19 - 8308: 843fffc4 addi r16,r16,-1 - 830c: 14c00136 bltu r2,r19,8314 <__udivdi3+0x290> - 8310: 1440ea36 bltu r2,r17,86bc <__udivdi3+0x638> - 8314: 1463c83a sub r17,r2,r17 - 8318: 8809883a mov r4,r17 - 831c: b80b883a mov r5,r23 - 8320: 0009fb80 call 9fb8 <__udivsi3> - 8324: 100b883a mov r5,r2 - 8328: 9009883a mov r4,r18 - 832c: 102b883a mov r21,r2 - 8330: 0009fc80 call 9fc8 <__mulsi3> - 8334: 8809883a mov r4,r17 - 8338: b80b883a mov r5,r23 - 833c: 1025883a mov r18,r2 - 8340: 0009fc00 call 9fc0 <__umodsi3> - 8344: 1004943a slli r2,r2,16 - 8348: e0ffffcc andi r3,fp,65535 - 834c: 10c4b03a or r2,r2,r3 - 8350: 1480042e bgeu r2,r18,8364 <__udivdi3+0x2e0> - 8354: 9885883a add r2,r19,r2 - 8358: ad7fffc4 addi r21,r21,-1 - 835c: 14c00136 bltu r2,r19,8364 <__udivdi3+0x2e0> - 8360: 1480d936 bltu r2,r18,86c8 <__udivdi3+0x644> - 8364: 8004943a slli r2,r16,16 - 8368: 0009883a mov r4,zero - 836c: a884b03a or r2,r21,r2 - 8370: 003fad06 br 8228 <__udivdi3+0x1a4> - 8374: 00804034 movhi r2,256 - 8378: 10bfffc4 addi r2,r2,-1 - 837c: 11c0b636 bltu r2,r7,8658 <__udivdi3+0x5d4> - 8380: 01400404 movi r5,16 - 8384: 2805883a mov r2,r5 - 8388: 003f9a06 br 81f4 <__udivdi3+0x170> - 838c: 0005883a mov r2,zero - 8390: 0009883a mov r4,zero - 8394: 003fa406 br 8228 <__udivdi3+0x1a4> - 8398: 00804034 movhi r2,256 - 839c: 10bfffc4 addi r2,r2,-1 - 83a0: 14c0b336 bltu r2,r19,8670 <__udivdi3+0x5ec> - 83a4: 01400404 movi r5,16 - 83a8: 2805883a mov r2,r5 - 83ac: 003f5106 br 80f4 <__udivdi3+0x70> - 83b0: 01000044 movi r4,1 - 83b4: 000b883a mov r5,zero - 83b8: 0009fb80 call 9fb8 <__udivsi3> - 83bc: 1027883a mov r19,r2 - 83c0: 00bfffd4 movui r2,65535 - 83c4: 14fff436 bltu r2,r19,8398 <__udivdi3+0x314> - 83c8: 003f4606 br 80e4 <__udivdi3+0x60> - 83cc: 00804034 movhi r2,256 - 83d0: 10bfffc4 addi r2,r2,-1 - 83d4: 1200ac36 bltu r2,r8,8688 <__udivdi3+0x604> - 83d8: 01400404 movi r5,16 - 83dc: 2805883a mov r2,r5 - 83e0: 003fa806 br 8284 <__udivdi3+0x200> - 83e4: 3d85c83a sub r2,r7,r22 - 83e8: 3588983a sll r4,r6,r22 - 83ec: 9886d83a srl r3,r19,r2 - 83f0: a8a2d83a srl r17,r21,r2 - 83f4: e084d83a srl r2,fp,r2 - 83f8: 20eeb03a or r23,r4,r3 - 83fc: b824d43a srli r18,r23,16 - 8400: ad86983a sll r3,r21,r22 - 8404: 8809883a mov r4,r17 - 8408: 900b883a mov r5,r18 - 840c: 1886b03a or r3,r3,r2 - 8410: d8c00115 stw r3,4(sp) - 8414: bc3fffcc andi r16,r23,65535 - 8418: 0009fb80 call 9fb8 <__udivsi3> - 841c: 100b883a mov r5,r2 - 8420: 8009883a mov r4,r16 - 8424: 1029883a mov r20,r2 - 8428: 0009fc80 call 9fc8 <__mulsi3> - 842c: 900b883a mov r5,r18 - 8430: 8809883a mov r4,r17 - 8434: 102b883a mov r21,r2 - 8438: 0009fc00 call 9fc0 <__umodsi3> - 843c: d9400117 ldw r5,4(sp) - 8440: 1004943a slli r2,r2,16 - 8444: 9da6983a sll r19,r19,r22 - 8448: 2806d43a srli r3,r5,16 - 844c: 10c4b03a or r2,r2,r3 - 8450: 1540032e bgeu r2,r21,8460 <__udivdi3+0x3dc> - 8454: 15c5883a add r2,r2,r23 - 8458: a53fffc4 addi r20,r20,-1 - 845c: 15c0912e bgeu r2,r23,86a4 <__udivdi3+0x620> - 8460: 1563c83a sub r17,r2,r21 - 8464: 8809883a mov r4,r17 - 8468: 900b883a mov r5,r18 - 846c: 0009fb80 call 9fb8 <__udivsi3> - 8470: 100b883a mov r5,r2 - 8474: 8009883a mov r4,r16 - 8478: 102b883a mov r21,r2 - 847c: 0009fc80 call 9fc8 <__mulsi3> - 8480: 8809883a mov r4,r17 - 8484: 900b883a mov r5,r18 - 8488: 1021883a mov r16,r2 - 848c: 0009fc00 call 9fc0 <__umodsi3> - 8490: da800117 ldw r10,4(sp) - 8494: 1004943a slli r2,r2,16 - 8498: 50ffffcc andi r3,r10,65535 - 849c: 10c6b03a or r3,r2,r3 - 84a0: 1c00032e bgeu r3,r16,84b0 <__udivdi3+0x42c> - 84a4: 1dc7883a add r3,r3,r23 - 84a8: ad7fffc4 addi r21,r21,-1 - 84ac: 1dc0792e bgeu r3,r23,8694 <__udivdi3+0x610> - 84b0: a004943a slli r2,r20,16 - 84b4: 982ed43a srli r23,r19,16 - 84b8: 9cffffcc andi r19,r19,65535 - 84bc: a8a4b03a or r18,r21,r2 - 84c0: 947fffcc andi r17,r18,65535 - 84c4: 902ad43a srli r21,r18,16 - 84c8: 8809883a mov r4,r17 - 84cc: 980b883a mov r5,r19 - 84d0: 1c21c83a sub r16,r3,r16 - 84d4: 0009fc80 call 9fc8 <__mulsi3> - 84d8: 8809883a mov r4,r17 - 84dc: b80b883a mov r5,r23 - 84e0: 1029883a mov r20,r2 - 84e4: 0009fc80 call 9fc8 <__mulsi3> - 84e8: 980b883a mov r5,r19 - 84ec: a809883a mov r4,r21 - 84f0: 1023883a mov r17,r2 - 84f4: 0009fc80 call 9fc8 <__mulsi3> - 84f8: a809883a mov r4,r21 - 84fc: b80b883a mov r5,r23 - 8500: 1027883a mov r19,r2 - 8504: 0009fc80 call 9fc8 <__mulsi3> - 8508: 1009883a mov r4,r2 - 850c: a004d43a srli r2,r20,16 - 8510: 8ce3883a add r17,r17,r19 - 8514: 1447883a add r3,r2,r17 - 8518: 1cc0022e bgeu r3,r19,8524 <__udivdi3+0x4a0> - 851c: 00800074 movhi r2,1 - 8520: 2089883a add r4,r4,r2 - 8524: 1804d43a srli r2,r3,16 - 8528: 2085883a add r2,r4,r2 - 852c: 80804436 bltu r16,r2,8640 <__udivdi3+0x5bc> - 8530: 80803e26 beq r16,r2,862c <__udivdi3+0x5a8> - 8534: 9005883a mov r2,r18 - 8538: 0009883a mov r4,zero - 853c: 003f3a06 br 8228 <__udivdi3+0x1a4> - 8540: 9d26983a sll r19,r19,r20 - 8544: 3505c83a sub r2,r6,r20 - 8548: a8a2d83a srl r17,r21,r2 - 854c: 982ed43a srli r23,r19,16 - 8550: e084d83a srl r2,fp,r2 - 8554: ad06983a sll r3,r21,r20 - 8558: 8809883a mov r4,r17 - 855c: b80b883a mov r5,r23 - 8560: 1886b03a or r3,r3,r2 - 8564: d8c00015 stw r3,0(sp) - 8568: 9dbfffcc andi r22,r19,65535 - 856c: 0009fb80 call 9fb8 <__udivsi3> - 8570: 100b883a mov r5,r2 - 8574: b009883a mov r4,r22 - 8578: d8800215 stw r2,8(sp) - 857c: 0009fc80 call 9fc8 <__mulsi3> - 8580: 8809883a mov r4,r17 - 8584: b80b883a mov r5,r23 - 8588: 102b883a mov r21,r2 - 858c: 0009fc00 call 9fc0 <__umodsi3> - 8590: d9000017 ldw r4,0(sp) - 8594: 1004943a slli r2,r2,16 - 8598: 2006d43a srli r3,r4,16 - 859c: 10c4b03a or r2,r2,r3 - 85a0: 1540052e bgeu r2,r21,85b8 <__udivdi3+0x534> - 85a4: d9400217 ldw r5,8(sp) - 85a8: 14c5883a add r2,r2,r19 - 85ac: 297fffc4 addi r5,r5,-1 - 85b0: d9400215 stw r5,8(sp) - 85b4: 14c0462e bgeu r2,r19,86d0 <__udivdi3+0x64c> - 85b8: 1563c83a sub r17,r2,r21 - 85bc: 8809883a mov r4,r17 - 85c0: b80b883a mov r5,r23 - 85c4: 0009fb80 call 9fb8 <__udivsi3> - 85c8: 100b883a mov r5,r2 - 85cc: b009883a mov r4,r22 - 85d0: 1025883a mov r18,r2 - 85d4: 0009fc80 call 9fc8 <__mulsi3> - 85d8: 8809883a mov r4,r17 - 85dc: b80b883a mov r5,r23 - 85e0: 1021883a mov r16,r2 - 85e4: 0009fc00 call 9fc0 <__umodsi3> - 85e8: da800017 ldw r10,0(sp) - 85ec: 1004943a slli r2,r2,16 - 85f0: 50ffffcc andi r3,r10,65535 - 85f4: 10c6b03a or r3,r2,r3 - 85f8: 1c00062e bgeu r3,r16,8614 <__udivdi3+0x590> - 85fc: 1cc7883a add r3,r3,r19 - 8600: 94bfffc4 addi r18,r18,-1 - 8604: 1cc00336 bltu r3,r19,8614 <__udivdi3+0x590> - 8608: 1c00022e bgeu r3,r16,8614 <__udivdi3+0x590> - 860c: 94bfffc4 addi r18,r18,-1 - 8610: 1cc7883a add r3,r3,r19 - 8614: d9000217 ldw r4,8(sp) - 8618: e538983a sll fp,fp,r20 - 861c: 1c2bc83a sub r21,r3,r16 - 8620: 2004943a slli r2,r4,16 - 8624: 90a8b03a or r20,r18,r2 - 8628: 003ebf06 br 8128 <__udivdi3+0xa4> - 862c: 1804943a slli r2,r3,16 - 8630: e588983a sll r4,fp,r22 - 8634: a0ffffcc andi r3,r20,65535 - 8638: 10c5883a add r2,r2,r3 - 863c: 20bfbd2e bgeu r4,r2,8534 <__udivdi3+0x4b0> - 8640: 90bfffc4 addi r2,r18,-1 - 8644: 0009883a mov r4,zero - 8648: 003ef706 br 8228 <__udivdi3+0x1a4> - 864c: 01400204 movi r5,8 - 8650: 2805883a mov r2,r5 - 8654: 003ee706 br 81f4 <__udivdi3+0x170> - 8658: 01400604 movi r5,24 - 865c: 2805883a mov r2,r5 - 8660: 003ee406 br 81f4 <__udivdi3+0x170> - 8664: 01400204 movi r5,8 - 8668: 2805883a mov r2,r5 - 866c: 003ea106 br 80f4 <__udivdi3+0x70> - 8670: 01400604 movi r5,24 - 8674: 2805883a mov r2,r5 - 8678: 003e9e06 br 80f4 <__udivdi3+0x70> - 867c: 01400204 movi r5,8 - 8680: 2805883a mov r2,r5 - 8684: 003eff06 br 8284 <__udivdi3+0x200> - 8688: 01400604 movi r5,24 - 868c: 2805883a mov r2,r5 - 8690: 003efc06 br 8284 <__udivdi3+0x200> - 8694: 1c3f862e bgeu r3,r16,84b0 <__udivdi3+0x42c> - 8698: 1dc7883a add r3,r3,r23 - 869c: ad7fffc4 addi r21,r21,-1 - 86a0: 003f8306 br 84b0 <__udivdi3+0x42c> - 86a4: 157f6e2e bgeu r2,r21,8460 <__udivdi3+0x3dc> - 86a8: a53fffc4 addi r20,r20,-1 - 86ac: 15c5883a add r2,r2,r23 - 86b0: 003f6b06 br 8460 <__udivdi3+0x3dc> - 86b4: ad7fffc4 addi r21,r21,-1 - 86b8: 003ec206 br 81c4 <__udivdi3+0x140> - 86bc: 843fffc4 addi r16,r16,-1 - 86c0: 14c5883a add r2,r2,r19 - 86c4: 003f1306 br 8314 <__udivdi3+0x290> - 86c8: ad7fffc4 addi r21,r21,-1 - 86cc: 003f2506 br 8364 <__udivdi3+0x2e0> - 86d0: 157fb92e bgeu r2,r21,85b8 <__udivdi3+0x534> - 86d4: 297fffc4 addi r5,r5,-1 - 86d8: 14c5883a add r2,r2,r19 - 86dc: d9400215 stw r5,8(sp) - 86e0: 003fb506 br 85b8 <__udivdi3+0x534> - 86e4: 843fffc4 addi r16,r16,-1 - 86e8: 14c5883a add r2,r2,r19 - 86ec: 003ea106 br 8174 <__udivdi3+0xf0> - -000086f0 <__umoddi3>: - 86f0: defff004 addi sp,sp,-64 - 86f4: 3011883a mov r8,r6 - 86f8: 000d883a mov r6,zero - 86fc: dd400b15 stw r21,44(sp) - 8700: dcc00915 stw r19,36(sp) - 8704: dc000615 stw r16,24(sp) - 8708: dfc00f15 stw ra,60(sp) - 870c: df000e15 stw fp,56(sp) - 8710: ddc00d15 stw r23,52(sp) - 8714: dd800c15 stw r22,48(sp) - 8718: dd000a15 stw r20,40(sp) - 871c: dc800815 stw r18,32(sp) - 8720: dc400715 stw r17,28(sp) - 8724: 2817883a mov r11,r5 - 8728: d9800415 stw r6,16(sp) - 872c: 4027883a mov r19,r8 - 8730: d9800515 stw r6,20(sp) - 8734: 2021883a mov r16,r4 - 8738: 282b883a mov r21,r5 - 873c: 38002c1e bne r7,zero,87f0 <__umoddi3+0x100> - 8740: 2a005636 bltu r5,r8,889c <__umoddi3+0x1ac> - 8744: 40009a26 beq r8,zero,89b0 <__umoddi3+0x2c0> - 8748: 00bfffd4 movui r2,65535 - 874c: 14c09236 bltu r2,r19,8998 <__umoddi3+0x2a8> - 8750: 00803fc4 movi r2,255 - 8754: 14c15c36 bltu r2,r19,8cc8 <__umoddi3+0x5d8> - 8758: 000b883a mov r5,zero - 875c: 0005883a mov r2,zero - 8760: 9884d83a srl r2,r19,r2 - 8764: 01000074 movhi r4,1 - 8768: 2138f204 addi r4,r4,-7224 - 876c: 01800804 movi r6,32 - 8770: 1105883a add r2,r2,r4 - 8774: 10c00003 ldbu r3,0(r2) - 8778: 28c7883a add r3,r5,r3 - 877c: 30e5c83a sub r18,r6,r3 - 8780: 9000a41e bne r18,zero,8a14 <__umoddi3+0x324> - 8784: 982ed43a srli r23,r19,16 - 8788: acebc83a sub r21,r21,r19 - 878c: 9d3fffcc andi r20,r19,65535 - 8790: 002d883a mov r22,zero - 8794: a809883a mov r4,r21 - 8798: b80b883a mov r5,r23 - 879c: 0009fb80 call 9fb8 <__udivsi3> - 87a0: 100b883a mov r5,r2 - 87a4: a009883a mov r4,r20 - 87a8: 0009fc80 call 9fc8 <__mulsi3> - 87ac: a809883a mov r4,r21 - 87b0: b80b883a mov r5,r23 - 87b4: 1023883a mov r17,r2 - 87b8: 0009fc00 call 9fc0 <__umodsi3> - 87bc: 1004943a slli r2,r2,16 - 87c0: 8006d43a srli r3,r16,16 - 87c4: 10c4b03a or r2,r2,r3 - 87c8: 1440032e bgeu r2,r17,87d8 <__umoddi3+0xe8> - 87cc: 14c5883a add r2,r2,r19 - 87d0: 14c00136 bltu r2,r19,87d8 <__umoddi3+0xe8> - 87d4: 14415836 bltu r2,r17,8d38 <__umoddi3+0x648> - 87d8: 1463c83a sub r17,r2,r17 - 87dc: 8809883a mov r4,r17 - 87e0: b80b883a mov r5,r23 - 87e4: 0009fb80 call 9fb8 <__udivsi3> - 87e8: a009883a mov r4,r20 - 87ec: 00005306 br 893c <__umoddi3+0x24c> - 87f0: 380d883a mov r6,r7 - 87f4: 29c0132e bgeu r5,r7,8844 <__umoddi3+0x154> - 87f8: d9000415 stw r4,16(sp) - 87fc: d9400515 stw r5,20(sp) - 8800: d9400417 ldw r5,16(sp) - 8804: 5813883a mov r9,r11 - 8808: 2811883a mov r8,r5 - 880c: 4005883a mov r2,r8 - 8810: 4807883a mov r3,r9 - 8814: dfc00f17 ldw ra,60(sp) - 8818: df000e17 ldw fp,56(sp) - 881c: ddc00d17 ldw r23,52(sp) - 8820: dd800c17 ldw r22,48(sp) - 8824: dd400b17 ldw r21,44(sp) - 8828: dd000a17 ldw r20,40(sp) - 882c: dcc00917 ldw r19,36(sp) - 8830: dc800817 ldw r18,32(sp) - 8834: dc400717 ldw r17,28(sp) - 8838: dc000617 ldw r16,24(sp) - 883c: dec01004 addi sp,sp,64 - 8840: f800283a ret - 8844: 00bfffd4 movui r2,65535 - 8848: 11c06636 bltu r2,r7,89e4 <__umoddi3+0x2f4> - 884c: 00803fc4 movi r2,255 - 8850: 11c12036 bltu r2,r7,8cd4 <__umoddi3+0x5e4> - 8854: 000b883a mov r5,zero - 8858: 0005883a mov r2,zero - 885c: 3084d83a srl r2,r6,r2 - 8860: 01000074 movhi r4,1 - 8864: 2138f204 addi r4,r4,-7224 - 8868: 01c00804 movi r7,32 - 886c: 1105883a add r2,r2,r4 - 8870: 10c00003 ldbu r3,0(r2) - 8874: 28c7883a add r3,r5,r3 - 8878: 38e5c83a sub r18,r7,r3 - 887c: 9000941e bne r18,zero,8ad0 <__umoddi3+0x3e0> - 8880: 35405e36 bltu r6,r21,89fc <__umoddi3+0x30c> - 8884: 84c05d2e bgeu r16,r19,89fc <__umoddi3+0x30c> - 8888: 8011883a mov r8,r16 - 888c: a813883a mov r9,r21 - 8890: dc000415 stw r16,16(sp) - 8894: dd400515 stw r21,20(sp) - 8898: 003fdc06 br 880c <__umoddi3+0x11c> - 889c: 00bfffd4 movui r2,65535 - 88a0: 12004a36 bltu r2,r8,89cc <__umoddi3+0x2dc> - 88a4: 00803fc4 movi r2,255 - 88a8: 12010d36 bltu r2,r8,8ce0 <__umoddi3+0x5f0> - 88ac: 000b883a mov r5,zero - 88b0: 0005883a mov r2,zero - 88b4: 9884d83a srl r2,r19,r2 - 88b8: 01000074 movhi r4,1 - 88bc: 2138f204 addi r4,r4,-7224 - 88c0: 01800804 movi r6,32 - 88c4: 1105883a add r2,r2,r4 - 88c8: 10c00003 ldbu r3,0(r2) - 88cc: 28c7883a add r3,r5,r3 - 88d0: 30c7c83a sub r3,r6,r3 - 88d4: 1800dc1e bne r3,zero,8c48 <__umoddi3+0x558> - 88d8: 002d883a mov r22,zero - 88dc: 982ed43a srli r23,r19,16 - 88e0: a809883a mov r4,r21 - 88e4: 9cbfffcc andi r18,r19,65535 - 88e8: b80b883a mov r5,r23 - 88ec: 0009fb80 call 9fb8 <__udivsi3> - 88f0: 100b883a mov r5,r2 - 88f4: 9009883a mov r4,r18 - 88f8: 0009fc80 call 9fc8 <__mulsi3> - 88fc: a809883a mov r4,r21 - 8900: b80b883a mov r5,r23 - 8904: 1023883a mov r17,r2 - 8908: 0009fc00 call 9fc0 <__umodsi3> - 890c: 1004943a slli r2,r2,16 - 8910: 8006d43a srli r3,r16,16 - 8914: 10c4b03a or r2,r2,r3 - 8918: 1440032e bgeu r2,r17,8928 <__umoddi3+0x238> - 891c: 14c5883a add r2,r2,r19 - 8920: 14c00136 bltu r2,r19,8928 <__umoddi3+0x238> - 8924: 14410236 bltu r2,r17,8d30 <__umoddi3+0x640> - 8928: 1463c83a sub r17,r2,r17 - 892c: 8809883a mov r4,r17 - 8930: b80b883a mov r5,r23 - 8934: 0009fb80 call 9fb8 <__udivsi3> - 8938: 9009883a mov r4,r18 - 893c: 100b883a mov r5,r2 - 8940: 0009fc80 call 9fc8 <__mulsi3> - 8944: 8809883a mov r4,r17 - 8948: b80b883a mov r5,r23 - 894c: 102b883a mov r21,r2 - 8950: 0009fc00 call 9fc0 <__umodsi3> - 8954: 1004943a slli r2,r2,16 - 8958: 80ffffcc andi r3,r16,65535 - 895c: 10c4b03a or r2,r2,r3 - 8960: 1540042e bgeu r2,r21,8974 <__umoddi3+0x284> - 8964: 14c5883a add r2,r2,r19 - 8968: 14c00236 bltu r2,r19,8974 <__umoddi3+0x284> - 896c: 1540012e bgeu r2,r21,8974 <__umoddi3+0x284> - 8970: 14c5883a add r2,r2,r19 - 8974: 1545c83a sub r2,r2,r21 - 8978: 1584d83a srl r2,r2,r22 - 897c: 0013883a mov r9,zero - 8980: d8800415 stw r2,16(sp) - 8984: d8c00417 ldw r3,16(sp) - 8988: 0005883a mov r2,zero - 898c: d8800515 stw r2,20(sp) - 8990: 1811883a mov r8,r3 - 8994: 003f9d06 br 880c <__umoddi3+0x11c> - 8998: 00804034 movhi r2,256 - 899c: 10bfffc4 addi r2,r2,-1 - 89a0: 14c0c636 bltu r2,r19,8cbc <__umoddi3+0x5cc> - 89a4: 01400404 movi r5,16 - 89a8: 2805883a mov r2,r5 - 89ac: 003f6c06 br 8760 <__umoddi3+0x70> - 89b0: 01000044 movi r4,1 - 89b4: 000b883a mov r5,zero - 89b8: 0009fb80 call 9fb8 <__udivsi3> - 89bc: 1027883a mov r19,r2 - 89c0: 00bfffd4 movui r2,65535 - 89c4: 14fff436 bltu r2,r19,8998 <__umoddi3+0x2a8> - 89c8: 003f6106 br 8750 <__umoddi3+0x60> - 89cc: 00804034 movhi r2,256 - 89d0: 10bfffc4 addi r2,r2,-1 - 89d4: 1200c536 bltu r2,r8,8cec <__umoddi3+0x5fc> - 89d8: 01400404 movi r5,16 - 89dc: 2805883a mov r2,r5 - 89e0: 003fb406 br 88b4 <__umoddi3+0x1c4> - 89e4: 00804034 movhi r2,256 - 89e8: 10bfffc4 addi r2,r2,-1 - 89ec: 11c0c236 bltu r2,r7,8cf8 <__umoddi3+0x608> - 89f0: 01400404 movi r5,16 - 89f4: 2805883a mov r2,r5 - 89f8: 003f9806 br 885c <__umoddi3+0x16c> - 89fc: 84c9c83a sub r4,r16,r19 - 8a00: 8105803a cmpltu r2,r16,r4 - 8a04: a987c83a sub r3,r21,r6 - 8a08: 18abc83a sub r21,r3,r2 - 8a0c: 2021883a mov r16,r4 - 8a10: 003f9d06 br 8888 <__umoddi3+0x198> - 8a14: 9ca6983a sll r19,r19,r18 - 8a18: 3485c83a sub r2,r6,r18 - 8a1c: a8a2d83a srl r17,r21,r2 - 8a20: 982ed43a srli r23,r19,16 - 8a24: ac86983a sll r3,r21,r18 - 8a28: 8084d83a srl r2,r16,r2 - 8a2c: 8809883a mov r4,r17 - 8a30: b80b883a mov r5,r23 - 8a34: 18b8b03a or fp,r3,r2 - 8a38: 9d3fffcc andi r20,r19,65535 - 8a3c: 0009fb80 call 9fb8 <__udivsi3> - 8a40: 100b883a mov r5,r2 - 8a44: a009883a mov r4,r20 - 8a48: 0009fc80 call 9fc8 <__mulsi3> - 8a4c: 8809883a mov r4,r17 - 8a50: b80b883a mov r5,r23 - 8a54: 102b883a mov r21,r2 - 8a58: 0009fc00 call 9fc0 <__umodsi3> - 8a5c: 1004943a slli r2,r2,16 - 8a60: e006d43a srli r3,fp,16 - 8a64: 902d883a mov r22,r18 - 8a68: 10c4b03a or r2,r2,r3 - 8a6c: 1540022e bgeu r2,r21,8a78 <__umoddi3+0x388> - 8a70: 14c5883a add r2,r2,r19 - 8a74: 14c0ab2e bgeu r2,r19,8d24 <__umoddi3+0x634> - 8a78: 1563c83a sub r17,r2,r21 - 8a7c: 8809883a mov r4,r17 - 8a80: b80b883a mov r5,r23 - 8a84: 0009fb80 call 9fb8 <__udivsi3> - 8a88: 100b883a mov r5,r2 - 8a8c: a009883a mov r4,r20 - 8a90: 0009fc80 call 9fc8 <__mulsi3> - 8a94: 8809883a mov r4,r17 - 8a98: b80b883a mov r5,r23 - 8a9c: 102b883a mov r21,r2 - 8aa0: 0009fc00 call 9fc0 <__umodsi3> - 8aa4: 1004943a slli r2,r2,16 - 8aa8: e0ffffcc andi r3,fp,65535 - 8aac: 10c4b03a or r2,r2,r3 - 8ab0: 1540042e bgeu r2,r21,8ac4 <__umoddi3+0x3d4> - 8ab4: 14c5883a add r2,r2,r19 - 8ab8: 14c00236 bltu r2,r19,8ac4 <__umoddi3+0x3d4> - 8abc: 1540012e bgeu r2,r21,8ac4 <__umoddi3+0x3d4> - 8ac0: 14c5883a add r2,r2,r19 - 8ac4: 84a0983a sll r16,r16,r18 - 8ac8: 156bc83a sub r21,r2,r21 - 8acc: 003f3106 br 8794 <__umoddi3+0xa4> - 8ad0: 3c8fc83a sub r7,r7,r18 - 8ad4: 3486983a sll r3,r6,r18 - 8ad8: 99c4d83a srl r2,r19,r7 - 8adc: a9e2d83a srl r17,r21,r7 - 8ae0: ac8c983a sll r6,r21,r18 - 8ae4: 18acb03a or r22,r3,r2 - 8ae8: b02ed43a srli r23,r22,16 - 8aec: 81c4d83a srl r2,r16,r7 - 8af0: 8809883a mov r4,r17 - 8af4: b80b883a mov r5,r23 - 8af8: 308cb03a or r6,r6,r2 - 8afc: d9c00315 stw r7,12(sp) - 8b00: d9800215 stw r6,8(sp) - 8b04: b53fffcc andi r20,r22,65535 - 8b08: 0009fb80 call 9fb8 <__udivsi3> - 8b0c: 100b883a mov r5,r2 - 8b10: a009883a mov r4,r20 - 8b14: 1039883a mov fp,r2 - 8b18: 0009fc80 call 9fc8 <__mulsi3> - 8b1c: 8809883a mov r4,r17 - 8b20: b80b883a mov r5,r23 - 8b24: 102b883a mov r21,r2 - 8b28: 0009fc00 call 9fc0 <__umodsi3> - 8b2c: d9000217 ldw r4,8(sp) - 8b30: 1004943a slli r2,r2,16 - 8b34: 9ca6983a sll r19,r19,r18 - 8b38: 2006d43a srli r3,r4,16 - 8b3c: 84a0983a sll r16,r16,r18 - 8b40: dcc00015 stw r19,0(sp) - 8b44: 10c4b03a or r2,r2,r3 - 8b48: dc000115 stw r16,4(sp) - 8b4c: 1540032e bgeu r2,r21,8b5c <__umoddi3+0x46c> - 8b50: 1585883a add r2,r2,r22 - 8b54: e73fffc4 addi fp,fp,-1 - 8b58: 15806e2e bgeu r2,r22,8d14 <__umoddi3+0x624> - 8b5c: 1563c83a sub r17,r2,r21 - 8b60: 8809883a mov r4,r17 - 8b64: b80b883a mov r5,r23 - 8b68: 0009fb80 call 9fb8 <__udivsi3> - 8b6c: 100b883a mov r5,r2 - 8b70: a009883a mov r4,r20 - 8b74: 1021883a mov r16,r2 - 8b78: 0009fc80 call 9fc8 <__mulsi3> - 8b7c: b80b883a mov r5,r23 - 8b80: 8809883a mov r4,r17 - 8b84: 1029883a mov r20,r2 - 8b88: 0009fc00 call 9fc0 <__umodsi3> - 8b8c: d9400217 ldw r5,8(sp) - 8b90: 1004943a slli r2,r2,16 - 8b94: 28ffffcc andi r3,r5,65535 - 8b98: 10c4b03a or r2,r2,r3 - 8b9c: 1500032e bgeu r2,r20,8bac <__umoddi3+0x4bc> - 8ba0: 1585883a add r2,r2,r22 - 8ba4: 843fffc4 addi r16,r16,-1 - 8ba8: 1580562e bgeu r2,r22,8d04 <__umoddi3+0x614> - 8bac: d9800017 ldw r6,0(sp) - 8bb0: e022943a slli r17,fp,16 - 8bb4: 302ed43a srli r23,r6,16 - 8bb8: 8462b03a or r17,r16,r17 - 8bbc: 34ffffcc andi r19,r6,65535 - 8bc0: 882ad43a srli r21,r17,16 - 8bc4: 8c7fffcc andi r17,r17,65535 - 8bc8: 8809883a mov r4,r17 - 8bcc: 980b883a mov r5,r19 - 8bd0: 1521c83a sub r16,r2,r20 - 8bd4: 0009fc80 call 9fc8 <__mulsi3> - 8bd8: 8809883a mov r4,r17 - 8bdc: b80b883a mov r5,r23 - 8be0: 1029883a mov r20,r2 - 8be4: 0009fc80 call 9fc8 <__mulsi3> - 8be8: 980b883a mov r5,r19 - 8bec: a809883a mov r4,r21 - 8bf0: 1023883a mov r17,r2 - 8bf4: 0009fc80 call 9fc8 <__mulsi3> - 8bf8: a809883a mov r4,r21 - 8bfc: b80b883a mov r5,r23 - 8c00: 1027883a mov r19,r2 - 8c04: 0009fc80 call 9fc8 <__mulsi3> - 8c08: 100b883a mov r5,r2 - 8c0c: a004d43a srli r2,r20,16 - 8c10: 8ce3883a add r17,r17,r19 - 8c14: 1449883a add r4,r2,r17 - 8c18: 24c0022e bgeu r4,r19,8c24 <__umoddi3+0x534> - 8c1c: 00800074 movhi r2,1 - 8c20: 288b883a add r5,r5,r2 - 8c24: 2004d43a srli r2,r4,16 - 8c28: 2008943a slli r4,r4,16 - 8c2c: a0ffffcc andi r3,r20,65535 - 8c30: 288d883a add r6,r5,r2 - 8c34: 20c9883a add r4,r4,r3 - 8c38: 81800b36 bltu r16,r6,8c68 <__umoddi3+0x578> - 8c3c: 81804026 beq r16,r6,8d40 <__umoddi3+0x650> - 8c40: 818dc83a sub r6,r16,r6 - 8c44: 00000f06 br 8c84 <__umoddi3+0x594> - 8c48: 30c5c83a sub r2,r6,r3 - 8c4c: 182d883a mov r22,r3 - 8c50: 8084d83a srl r2,r16,r2 - 8c54: a8c6983a sll r3,r21,r3 - 8c58: 9da6983a sll r19,r19,r22 - 8c5c: 85a0983a sll r16,r16,r22 - 8c60: 18aab03a or r21,r3,r2 - 8c64: 003f1d06 br 88dc <__umoddi3+0x1ec> - 8c68: d8c00017 ldw r3,0(sp) - 8c6c: 20c5c83a sub r2,r4,r3 - 8c70: 2089803a cmpltu r4,r4,r2 - 8c74: 3587c83a sub r3,r6,r22 - 8c78: 1907c83a sub r3,r3,r4 - 8c7c: 80cdc83a sub r6,r16,r3 - 8c80: 1009883a mov r4,r2 - 8c84: d9400117 ldw r5,4(sp) - 8c88: 2905c83a sub r2,r5,r4 - 8c8c: 2887803a cmpltu r3,r5,r2 - 8c90: 30c7c83a sub r3,r6,r3 - 8c94: d9800317 ldw r6,12(sp) - 8c98: 1484d83a srl r2,r2,r18 - 8c9c: 1988983a sll r4,r3,r6 - 8ca0: 1c86d83a srl r3,r3,r18 - 8ca4: 2088b03a or r4,r4,r2 - 8ca8: 2011883a mov r8,r4 - 8cac: 1813883a mov r9,r3 - 8cb0: d9000415 stw r4,16(sp) - 8cb4: d8c00515 stw r3,20(sp) - 8cb8: 003ed406 br 880c <__umoddi3+0x11c> - 8cbc: 01400604 movi r5,24 - 8cc0: 2805883a mov r2,r5 - 8cc4: 003ea606 br 8760 <__umoddi3+0x70> - 8cc8: 01400204 movi r5,8 - 8ccc: 2805883a mov r2,r5 - 8cd0: 003ea306 br 8760 <__umoddi3+0x70> - 8cd4: 01400204 movi r5,8 - 8cd8: 2805883a mov r2,r5 - 8cdc: 003edf06 br 885c <__umoddi3+0x16c> - 8ce0: 01400204 movi r5,8 - 8ce4: 2805883a mov r2,r5 - 8ce8: 003ef206 br 88b4 <__umoddi3+0x1c4> - 8cec: 01400604 movi r5,24 - 8cf0: 2805883a mov r2,r5 - 8cf4: 003eef06 br 88b4 <__umoddi3+0x1c4> - 8cf8: 01400604 movi r5,24 - 8cfc: 2805883a mov r2,r5 - 8d00: 003ed606 br 885c <__umoddi3+0x16c> - 8d04: 153fa92e bgeu r2,r20,8bac <__umoddi3+0x4bc> - 8d08: 843fffc4 addi r16,r16,-1 - 8d0c: 1585883a add r2,r2,r22 - 8d10: 003fa606 br 8bac <__umoddi3+0x4bc> - 8d14: 157f912e bgeu r2,r21,8b5c <__umoddi3+0x46c> - 8d18: e73fffc4 addi fp,fp,-1 - 8d1c: 1585883a add r2,r2,r22 - 8d20: 003f8e06 br 8b5c <__umoddi3+0x46c> - 8d24: 157f542e bgeu r2,r21,8a78 <__umoddi3+0x388> - 8d28: 14c5883a add r2,r2,r19 - 8d2c: 003f5206 br 8a78 <__umoddi3+0x388> - 8d30: 14c5883a add r2,r2,r19 - 8d34: 003efc06 br 8928 <__umoddi3+0x238> - 8d38: 14c5883a add r2,r2,r19 - 8d3c: 003ea606 br 87d8 <__umoddi3+0xe8> - 8d40: d8800117 ldw r2,4(sp) - 8d44: 113fc836 bltu r2,r4,8c68 <__umoddi3+0x578> - 8d48: 000d883a mov r6,zero - 8d4c: 003fcd06 br 8c84 <__umoddi3+0x594> - -00008d50 <_fpadd_parts>: - 8d50: defff804 addi sp,sp,-32 - 8d54: dcc00315 stw r19,12(sp) - 8d58: 2027883a mov r19,r4 - 8d5c: 21000017 ldw r4,0(r4) - 8d60: 00c00044 movi r3,1 - 8d64: dd400515 stw r21,20(sp) - 8d68: dd000415 stw r20,16(sp) - 8d6c: ddc00715 stw r23,28(sp) - 8d70: dd800615 stw r22,24(sp) - 8d74: dc800215 stw r18,8(sp) - 8d78: dc400115 stw r17,4(sp) - 8d7c: dc000015 stw r16,0(sp) - 8d80: 282b883a mov r21,r5 - 8d84: 3029883a mov r20,r6 - 8d88: 1900632e bgeu r3,r4,8f18 <_fpadd_parts+0x1c8> - 8d8c: 28800017 ldw r2,0(r5) - 8d90: 1880812e bgeu r3,r2,8f98 <_fpadd_parts+0x248> - 8d94: 00c00104 movi r3,4 - 8d98: 20c0dc26 beq r4,r3,910c <_fpadd_parts+0x3bc> - 8d9c: 10c07e26 beq r2,r3,8f98 <_fpadd_parts+0x248> - 8da0: 00c00084 movi r3,2 - 8da4: 10c06726 beq r2,r3,8f44 <_fpadd_parts+0x1f4> - 8da8: 20c07b26 beq r4,r3,8f98 <_fpadd_parts+0x248> - 8dac: 9dc00217 ldw r23,8(r19) - 8db0: 28c00217 ldw r3,8(r5) - 8db4: 9c400317 ldw r17,12(r19) - 8db8: 2bc00317 ldw r15,12(r5) - 8dbc: b8cdc83a sub r6,r23,r3 - 8dc0: 9c800417 ldw r18,16(r19) - 8dc4: 2c000417 ldw r16,16(r5) - 8dc8: 3009883a mov r4,r6 - 8dcc: 30009716 blt r6,zero,902c <_fpadd_parts+0x2dc> - 8dd0: 00800fc4 movi r2,63 - 8dd4: 11806b16 blt r2,r6,8f84 <_fpadd_parts+0x234> - 8dd8: 0100a40e bge zero,r4,906c <_fpadd_parts+0x31c> - 8ddc: 35bff804 addi r22,r6,-32 - 8de0: b000bc16 blt r22,zero,90d4 <_fpadd_parts+0x384> - 8de4: 8596d83a srl r11,r16,r22 - 8de8: 0019883a mov r12,zero - 8dec: 0013883a mov r9,zero - 8df0: 01000044 movi r4,1 - 8df4: 0015883a mov r10,zero - 8df8: b000be16 blt r22,zero,90f4 <_fpadd_parts+0x3a4> - 8dfc: 2590983a sll r8,r4,r22 - 8e00: 000f883a mov r7,zero - 8e04: 00bfffc4 movi r2,-1 - 8e08: 3889883a add r4,r7,r2 - 8e0c: 408b883a add r5,r8,r2 - 8e10: 21cd803a cmpltu r6,r4,r7 - 8e14: 314b883a add r5,r6,r5 - 8e18: 7904703a and r2,r15,r4 - 8e1c: 8146703a and r3,r16,r5 - 8e20: 10c4b03a or r2,r2,r3 - 8e24: 10000226 beq r2,zero,8e30 <_fpadd_parts+0xe0> - 8e28: 02400044 movi r9,1 - 8e2c: 0015883a mov r10,zero - 8e30: 5a5eb03a or r15,r11,r9 - 8e34: 62a0b03a or r16,r12,r10 - 8e38: 99400117 ldw r5,4(r19) - 8e3c: a8800117 ldw r2,4(r21) - 8e40: 28806e26 beq r5,r2,8ffc <_fpadd_parts+0x2ac> - 8e44: 28006626 beq r5,zero,8fe0 <_fpadd_parts+0x290> - 8e48: 7c45c83a sub r2,r15,r17 - 8e4c: 7889803a cmpltu r4,r15,r2 - 8e50: 8487c83a sub r3,r16,r18 - 8e54: 1909c83a sub r4,r3,r4 - 8e58: 100d883a mov r6,r2 - 8e5c: 200f883a mov r7,r4 - 8e60: 38007716 blt r7,zero,9040 <_fpadd_parts+0x2f0> - 8e64: a5c00215 stw r23,8(r20) - 8e68: a1c00415 stw r7,16(r20) - 8e6c: a0000115 stw zero,4(r20) - 8e70: a1800315 stw r6,12(r20) - 8e74: a2000317 ldw r8,12(r20) - 8e78: a2400417 ldw r9,16(r20) - 8e7c: 00bfffc4 movi r2,-1 - 8e80: 408b883a add r5,r8,r2 - 8e84: 2a09803a cmpltu r4,r5,r8 - 8e88: 488d883a add r6,r9,r2 - 8e8c: 01c40034 movhi r7,4096 - 8e90: 39ffffc4 addi r7,r7,-1 - 8e94: 218d883a add r6,r4,r6 - 8e98: 39801736 bltu r7,r6,8ef8 <_fpadd_parts+0x1a8> - 8e9c: 31c06526 beq r6,r7,9034 <_fpadd_parts+0x2e4> - 8ea0: a3000217 ldw r12,8(r20) - 8ea4: 4209883a add r4,r8,r8 - 8ea8: 00bfffc4 movi r2,-1 - 8eac: 220f803a cmpltu r7,r4,r8 - 8eb0: 4a4b883a add r5,r9,r9 - 8eb4: 394f883a add r7,r7,r5 - 8eb8: 2095883a add r10,r4,r2 - 8ebc: 3897883a add r11,r7,r2 - 8ec0: 510d803a cmpltu r6,r10,r4 - 8ec4: 6099883a add r12,r12,r2 - 8ec8: 32d7883a add r11,r6,r11 - 8ecc: 00840034 movhi r2,4096 - 8ed0: 10bfffc4 addi r2,r2,-1 - 8ed4: 2011883a mov r8,r4 - 8ed8: 3813883a mov r9,r7 - 8edc: a1000315 stw r4,12(r20) - 8ee0: a1c00415 stw r7,16(r20) - 8ee4: a3000215 stw r12,8(r20) - 8ee8: 12c00336 bltu r2,r11,8ef8 <_fpadd_parts+0x1a8> - 8eec: 58bfed1e bne r11,r2,8ea4 <_fpadd_parts+0x154> - 8ef0: 00bfff84 movi r2,-2 - 8ef4: 12bfeb2e bgeu r2,r10,8ea4 <_fpadd_parts+0x154> - 8ef8: a2800417 ldw r10,16(r20) - 8efc: 008000c4 movi r2,3 - 8f00: 00c80034 movhi r3,8192 - 8f04: 18ffffc4 addi r3,r3,-1 - 8f08: a2400317 ldw r9,12(r20) - 8f0c: a0800015 stw r2,0(r20) - 8f10: 1a802336 bltu r3,r10,8fa0 <_fpadd_parts+0x250> - 8f14: a027883a mov r19,r20 - 8f18: 9805883a mov r2,r19 - 8f1c: ddc00717 ldw r23,28(sp) - 8f20: dd800617 ldw r22,24(sp) - 8f24: dd400517 ldw r21,20(sp) - 8f28: dd000417 ldw r20,16(sp) - 8f2c: dcc00317 ldw r19,12(sp) - 8f30: dc800217 ldw r18,8(sp) - 8f34: dc400117 ldw r17,4(sp) - 8f38: dc000017 ldw r16,0(sp) - 8f3c: dec00804 addi sp,sp,32 - 8f40: f800283a ret - 8f44: 20fff41e bne r4,r3,8f18 <_fpadd_parts+0x1c8> - 8f48: 31000015 stw r4,0(r6) - 8f4c: 98800117 ldw r2,4(r19) - 8f50: 30800115 stw r2,4(r6) - 8f54: 98c00217 ldw r3,8(r19) - 8f58: 30c00215 stw r3,8(r6) - 8f5c: 98800317 ldw r2,12(r19) - 8f60: 30800315 stw r2,12(r6) - 8f64: 98c00417 ldw r3,16(r19) - 8f68: 30c00415 stw r3,16(r6) - 8f6c: 98800117 ldw r2,4(r19) - 8f70: 28c00117 ldw r3,4(r5) - 8f74: 3027883a mov r19,r6 - 8f78: 10c4703a and r2,r2,r3 - 8f7c: 30800115 stw r2,4(r6) - 8f80: 003fe506 br 8f18 <_fpadd_parts+0x1c8> - 8f84: 1dc02616 blt r3,r23,9020 <_fpadd_parts+0x2d0> - 8f88: 0023883a mov r17,zero - 8f8c: 182f883a mov r23,r3 - 8f90: 0025883a mov r18,zero - 8f94: 003fa806 br 8e38 <_fpadd_parts+0xe8> - 8f98: a827883a mov r19,r21 - 8f9c: 003fde06 br 8f18 <_fpadd_parts+0x1c8> - 8fa0: 01800044 movi r6,1 - 8fa4: 500497fa slli r2,r10,31 - 8fa8: 4808d07a srli r4,r9,1 - 8fac: 518ad83a srl r5,r10,r6 - 8fb0: a2000217 ldw r8,8(r20) - 8fb4: 1108b03a or r4,r2,r4 - 8fb8: 0007883a mov r3,zero - 8fbc: 4984703a and r2,r9,r6 - 8fc0: 208cb03a or r6,r4,r2 - 8fc4: 28ceb03a or r7,r5,r3 - 8fc8: 42000044 addi r8,r8,1 - 8fcc: a027883a mov r19,r20 - 8fd0: a1c00415 stw r7,16(r20) - 8fd4: a2000215 stw r8,8(r20) - 8fd8: a1800315 stw r6,12(r20) - 8fdc: 003fce06 br 8f18 <_fpadd_parts+0x1c8> - 8fe0: 8bc5c83a sub r2,r17,r15 - 8fe4: 8889803a cmpltu r4,r17,r2 - 8fe8: 9407c83a sub r3,r18,r16 - 8fec: 1909c83a sub r4,r3,r4 - 8ff0: 100d883a mov r6,r2 - 8ff4: 200f883a mov r7,r4 - 8ff8: 003f9906 br 8e60 <_fpadd_parts+0x110> - 8ffc: 7c45883a add r2,r15,r17 - 9000: 13c9803a cmpltu r4,r2,r15 - 9004: 8487883a add r3,r16,r18 - 9008: 20c9883a add r4,r4,r3 - 900c: a1400115 stw r5,4(r20) - 9010: a5c00215 stw r23,8(r20) - 9014: a0800315 stw r2,12(r20) - 9018: a1000415 stw r4,16(r20) - 901c: 003fb606 br 8ef8 <_fpadd_parts+0x1a8> - 9020: 001f883a mov r15,zero - 9024: 0021883a mov r16,zero - 9028: 003f8306 br 8e38 <_fpadd_parts+0xe8> - 902c: 018dc83a sub r6,zero,r6 - 9030: 003f6706 br 8dd0 <_fpadd_parts+0x80> - 9034: 00bfff84 movi r2,-2 - 9038: 117faf36 bltu r2,r5,8ef8 <_fpadd_parts+0x1a8> - 903c: 003f9806 br 8ea0 <_fpadd_parts+0x150> - 9040: 0005883a mov r2,zero - 9044: 1189c83a sub r4,r2,r6 - 9048: 1105803a cmpltu r2,r2,r4 - 904c: 01cbc83a sub r5,zero,r7 - 9050: 2885c83a sub r2,r5,r2 - 9054: 01800044 movi r6,1 - 9058: a1800115 stw r6,4(r20) - 905c: a5c00215 stw r23,8(r20) - 9060: a1000315 stw r4,12(r20) - 9064: a0800415 stw r2,16(r20) - 9068: 003f8206 br 8e74 <_fpadd_parts+0x124> - 906c: 203f7226 beq r4,zero,8e38 <_fpadd_parts+0xe8> - 9070: 35bff804 addi r22,r6,-32 - 9074: b9af883a add r23,r23,r6 - 9078: b0003116 blt r22,zero,9140 <_fpadd_parts+0x3f0> - 907c: 959ad83a srl r13,r18,r22 - 9080: 001d883a mov r14,zero - 9084: 000f883a mov r7,zero - 9088: 01000044 movi r4,1 - 908c: 0011883a mov r8,zero - 9090: b0002516 blt r22,zero,9128 <_fpadd_parts+0x3d8> - 9094: 2594983a sll r10,r4,r22 - 9098: 0013883a mov r9,zero - 909c: 00bfffc4 movi r2,-1 - 90a0: 4889883a add r4,r9,r2 - 90a4: 508b883a add r5,r10,r2 - 90a8: 224d803a cmpltu r6,r4,r9 - 90ac: 314b883a add r5,r6,r5 - 90b0: 8904703a and r2,r17,r4 - 90b4: 9146703a and r3,r18,r5 - 90b8: 10c4b03a or r2,r2,r3 - 90bc: 10000226 beq r2,zero,90c8 <_fpadd_parts+0x378> - 90c0: 01c00044 movi r7,1 - 90c4: 0011883a mov r8,zero - 90c8: 69e2b03a or r17,r13,r7 - 90cc: 7224b03a or r18,r14,r8 - 90d0: 003f5906 br 8e38 <_fpadd_parts+0xe8> - 90d4: 8407883a add r3,r16,r16 - 90d8: 008007c4 movi r2,31 - 90dc: 1185c83a sub r2,r2,r6 - 90e0: 1886983a sll r3,r3,r2 - 90e4: 7996d83a srl r11,r15,r6 - 90e8: 8198d83a srl r12,r16,r6 - 90ec: 1ad6b03a or r11,r3,r11 - 90f0: 003f3e06 br 8dec <_fpadd_parts+0x9c> - 90f4: 2006d07a srli r3,r4,1 - 90f8: 008007c4 movi r2,31 - 90fc: 1185c83a sub r2,r2,r6 - 9100: 1890d83a srl r8,r3,r2 - 9104: 218e983a sll r7,r4,r6 - 9108: 003f3e06 br 8e04 <_fpadd_parts+0xb4> - 910c: 113f821e bne r2,r4,8f18 <_fpadd_parts+0x1c8> - 9110: 28c00117 ldw r3,4(r5) - 9114: 98800117 ldw r2,4(r19) - 9118: 10ff7f26 beq r2,r3,8f18 <_fpadd_parts+0x1c8> - 911c: 04c00074 movhi r19,1 - 9120: 9cf8ed04 addi r19,r19,-7244 - 9124: 003f7c06 br 8f18 <_fpadd_parts+0x1c8> - 9128: 2006d07a srli r3,r4,1 - 912c: 008007c4 movi r2,31 - 9130: 1185c83a sub r2,r2,r6 - 9134: 1894d83a srl r10,r3,r2 - 9138: 2192983a sll r9,r4,r6 - 913c: 003fd706 br 909c <_fpadd_parts+0x34c> - 9140: 9487883a add r3,r18,r18 - 9144: 008007c4 movi r2,31 - 9148: 1185c83a sub r2,r2,r6 - 914c: 1886983a sll r3,r3,r2 - 9150: 899ad83a srl r13,r17,r6 - 9154: 919cd83a srl r14,r18,r6 - 9158: 1b5ab03a or r13,r3,r13 - 915c: 003fc906 br 9084 <_fpadd_parts+0x334> - -00009160 <__subdf3>: - 9160: deffea04 addi sp,sp,-88 - 9164: dcc01415 stw r19,80(sp) - 9168: dcc00404 addi r19,sp,16 - 916c: 2011883a mov r8,r4 - 9170: 2813883a mov r9,r5 - 9174: dc401315 stw r17,76(sp) - 9178: d809883a mov r4,sp - 917c: 980b883a mov r5,r19 - 9180: dc400904 addi r17,sp,36 - 9184: dfc01515 stw ra,84(sp) - 9188: da400115 stw r9,4(sp) - 918c: d9c00315 stw r7,12(sp) - 9190: da000015 stw r8,0(sp) - 9194: d9800215 stw r6,8(sp) - 9198: 000a4b80 call a4b8 <__unpack_d> - 919c: d9000204 addi r4,sp,8 - 91a0: 880b883a mov r5,r17 - 91a4: 000a4b80 call a4b8 <__unpack_d> - 91a8: d8800a17 ldw r2,40(sp) - 91ac: 880b883a mov r5,r17 - 91b0: 9809883a mov r4,r19 - 91b4: d9800e04 addi r6,sp,56 - 91b8: 1080005c xori r2,r2,1 - 91bc: d8800a15 stw r2,40(sp) - 91c0: 0008d500 call 8d50 <_fpadd_parts> - 91c4: 1009883a mov r4,r2 - 91c8: 000a1a40 call a1a4 <__pack_d> - 91cc: dfc01517 ldw ra,84(sp) - 91d0: dcc01417 ldw r19,80(sp) - 91d4: dc401317 ldw r17,76(sp) - 91d8: dec01604 addi sp,sp,88 - 91dc: f800283a ret - -000091e0 <__adddf3>: - 91e0: deffea04 addi sp,sp,-88 - 91e4: dcc01415 stw r19,80(sp) - 91e8: dcc00404 addi r19,sp,16 - 91ec: 2011883a mov r8,r4 - 91f0: 2813883a mov r9,r5 - 91f4: dc401315 stw r17,76(sp) - 91f8: d809883a mov r4,sp - 91fc: 980b883a mov r5,r19 - 9200: dc400904 addi r17,sp,36 - 9204: dfc01515 stw ra,84(sp) - 9208: da400115 stw r9,4(sp) - 920c: d9c00315 stw r7,12(sp) - 9210: da000015 stw r8,0(sp) - 9214: d9800215 stw r6,8(sp) - 9218: 000a4b80 call a4b8 <__unpack_d> - 921c: d9000204 addi r4,sp,8 - 9220: 880b883a mov r5,r17 - 9224: 000a4b80 call a4b8 <__unpack_d> - 9228: d9800e04 addi r6,sp,56 - 922c: 9809883a mov r4,r19 - 9230: 880b883a mov r5,r17 - 9234: 0008d500 call 8d50 <_fpadd_parts> - 9238: 1009883a mov r4,r2 - 923c: 000a1a40 call a1a4 <__pack_d> - 9240: dfc01517 ldw ra,84(sp) - 9244: dcc01417 ldw r19,80(sp) - 9248: dc401317 ldw r17,76(sp) - 924c: dec01604 addi sp,sp,88 - 9250: f800283a ret - -00009254 <__muldf3>: - 9254: deffe004 addi sp,sp,-128 - 9258: dc401815 stw r17,96(sp) - 925c: dc400404 addi r17,sp,16 - 9260: 2011883a mov r8,r4 - 9264: 2813883a mov r9,r5 - 9268: dc001715 stw r16,92(sp) - 926c: d809883a mov r4,sp - 9270: 880b883a mov r5,r17 - 9274: dc000904 addi r16,sp,36 - 9278: dfc01f15 stw ra,124(sp) - 927c: da400115 stw r9,4(sp) - 9280: d9c00315 stw r7,12(sp) - 9284: da000015 stw r8,0(sp) - 9288: d9800215 stw r6,8(sp) - 928c: ddc01e15 stw r23,120(sp) - 9290: dd801d15 stw r22,116(sp) - 9294: dd401c15 stw r21,112(sp) - 9298: dd001b15 stw r20,108(sp) - 929c: dcc01a15 stw r19,104(sp) - 92a0: dc801915 stw r18,100(sp) - 92a4: 000a4b80 call a4b8 <__unpack_d> - 92a8: d9000204 addi r4,sp,8 - 92ac: 800b883a mov r5,r16 - 92b0: 000a4b80 call a4b8 <__unpack_d> - 92b4: d9000417 ldw r4,16(sp) - 92b8: 00800044 movi r2,1 - 92bc: 1100102e bgeu r2,r4,9300 <__muldf3+0xac> - 92c0: d8c00917 ldw r3,36(sp) - 92c4: 10c0062e bgeu r2,r3,92e0 <__muldf3+0x8c> - 92c8: 00800104 movi r2,4 - 92cc: 20800a26 beq r4,r2,92f8 <__muldf3+0xa4> - 92d0: 1880cc26 beq r3,r2,9604 <__muldf3+0x3b0> - 92d4: 00800084 movi r2,2 - 92d8: 20800926 beq r4,r2,9300 <__muldf3+0xac> - 92dc: 1880191e bne r3,r2,9344 <__muldf3+0xf0> - 92e0: d8c00a17 ldw r3,40(sp) - 92e4: d8800517 ldw r2,20(sp) - 92e8: 8009883a mov r4,r16 - 92ec: 10c4c03a cmpne r2,r2,r3 - 92f0: d8800a15 stw r2,40(sp) - 92f4: 00000706 br 9314 <__muldf3+0xc0> - 92f8: 00800084 movi r2,2 - 92fc: 1880c326 beq r3,r2,960c <__muldf3+0x3b8> - 9300: d8800517 ldw r2,20(sp) - 9304: d8c00a17 ldw r3,40(sp) - 9308: 8809883a mov r4,r17 - 930c: 10c4c03a cmpne r2,r2,r3 - 9310: d8800515 stw r2,20(sp) - 9314: 000a1a40 call a1a4 <__pack_d> - 9318: dfc01f17 ldw ra,124(sp) - 931c: ddc01e17 ldw r23,120(sp) - 9320: dd801d17 ldw r22,116(sp) - 9324: dd401c17 ldw r21,112(sp) - 9328: dd001b17 ldw r20,108(sp) - 932c: dcc01a17 ldw r19,104(sp) - 9330: dc801917 ldw r18,100(sp) - 9334: dc401817 ldw r17,96(sp) - 9338: dc001717 ldw r16,92(sp) - 933c: dec02004 addi sp,sp,128 - 9340: f800283a ret - 9344: dd800717 ldw r22,28(sp) - 9348: dc800c17 ldw r18,48(sp) - 934c: 002b883a mov r21,zero - 9350: 0023883a mov r17,zero - 9354: a80b883a mov r5,r21 - 9358: b00d883a mov r6,r22 - 935c: 880f883a mov r7,r17 - 9360: ddc00817 ldw r23,32(sp) - 9364: dcc00d17 ldw r19,52(sp) - 9368: 9009883a mov r4,r18 - 936c: 000a0000 call a000 <__muldi3> - 9370: 001b883a mov r13,zero - 9374: 680f883a mov r7,r13 - 9378: b009883a mov r4,r22 - 937c: 000b883a mov r5,zero - 9380: 980d883a mov r6,r19 - 9384: b82d883a mov r22,r23 - 9388: 002f883a mov r23,zero - 938c: db401615 stw r13,88(sp) - 9390: d8801315 stw r2,76(sp) - 9394: d8c01415 stw r3,80(sp) - 9398: dcc01515 stw r19,84(sp) - 939c: 000a0000 call a000 <__muldi3> - 93a0: b00d883a mov r6,r22 - 93a4: 000b883a mov r5,zero - 93a8: 9009883a mov r4,r18 - 93ac: b80f883a mov r7,r23 - 93b0: 1021883a mov r16,r2 - 93b4: 1823883a mov r17,r3 - 93b8: 000a0000 call a000 <__muldi3> - 93bc: 8085883a add r2,r16,r2 - 93c0: 140d803a cmpltu r6,r2,r16 - 93c4: 88c7883a add r3,r17,r3 - 93c8: 30cd883a add r6,r6,r3 - 93cc: 1029883a mov r20,r2 - 93d0: 302b883a mov r21,r6 - 93d4: da801317 ldw r10,76(sp) - 93d8: dac01417 ldw r11,80(sp) - 93dc: db001517 ldw r12,84(sp) - 93e0: db401617 ldw r13,88(sp) - 93e4: 3440612e bgeu r6,r17,956c <__muldf3+0x318> - 93e8: 0009883a mov r4,zero - 93ec: 5105883a add r2,r10,r4 - 93f0: 128d803a cmpltu r6,r2,r10 - 93f4: 5d07883a add r3,r11,r20 - 93f8: 30cd883a add r6,r6,r3 - 93fc: 0021883a mov r16,zero - 9400: 04400044 movi r17,1 - 9404: 1025883a mov r18,r2 - 9408: 3027883a mov r19,r6 - 940c: 32c06236 bltu r6,r11,9598 <__muldf3+0x344> - 9410: 59807a26 beq r11,r6,95fc <__muldf3+0x3a8> - 9414: 680b883a mov r5,r13 - 9418: b80f883a mov r7,r23 - 941c: 6009883a mov r4,r12 - 9420: b00d883a mov r6,r22 - 9424: 000a0000 call a000 <__muldi3> - 9428: 1009883a mov r4,r2 - 942c: 000f883a mov r7,zero - 9430: 1545883a add r2,r2,r21 - 9434: 1111803a cmpltu r8,r2,r4 - 9438: 19c7883a add r3,r3,r7 - 943c: 40c7883a add r3,r8,r3 - 9440: 88cb883a add r5,r17,r3 - 9444: d8c00617 ldw r3,24(sp) - 9448: 8089883a add r4,r16,r2 - 944c: d8800b17 ldw r2,44(sp) - 9450: 18c00104 addi r3,r3,4 - 9454: 240d803a cmpltu r6,r4,r16 - 9458: 10c7883a add r3,r2,r3 - 945c: 2013883a mov r9,r4 - 9460: d8800a17 ldw r2,40(sp) - 9464: d9000517 ldw r4,20(sp) - 9468: 314d883a add r6,r6,r5 - 946c: 3015883a mov r10,r6 - 9470: 2088c03a cmpne r4,r4,r2 - 9474: 00880034 movhi r2,8192 - 9478: 10bfffc4 addi r2,r2,-1 - 947c: d9000f15 stw r4,60(sp) - 9480: d8c01015 stw r3,64(sp) - 9484: 1180162e bgeu r2,r6,94e0 <__muldf3+0x28c> - 9488: 1811883a mov r8,r3 - 948c: 101f883a mov r15,r2 - 9490: 980497fa slli r2,r19,31 - 9494: 9016d07a srli r11,r18,1 - 9498: 500697fa slli r3,r10,31 - 949c: 480cd07a srli r6,r9,1 - 94a0: 500ed07a srli r7,r10,1 - 94a4: 12d6b03a or r11,r2,r11 - 94a8: 00800044 movi r2,1 - 94ac: 198cb03a or r6,r3,r6 - 94b0: 4888703a and r4,r9,r2 - 94b4: 9818d07a srli r12,r19,1 - 94b8: 001b883a mov r13,zero - 94bc: 03a00034 movhi r14,32768 - 94c0: 3013883a mov r9,r6 - 94c4: 3815883a mov r10,r7 - 94c8: 4091883a add r8,r8,r2 - 94cc: 20000226 beq r4,zero,94d8 <__muldf3+0x284> - 94d0: 5b64b03a or r18,r11,r13 - 94d4: 63a6b03a or r19,r12,r14 - 94d8: 7abfed36 bltu r15,r10,9490 <__muldf3+0x23c> - 94dc: da001015 stw r8,64(sp) - 94e0: 00840034 movhi r2,4096 - 94e4: 10bfffc4 addi r2,r2,-1 - 94e8: 12801436 bltu r2,r10,953c <__muldf3+0x2e8> - 94ec: da001017 ldw r8,64(sp) - 94f0: 101f883a mov r15,r2 - 94f4: 4a45883a add r2,r9,r9 - 94f8: 124d803a cmpltu r6,r2,r9 - 94fc: 5287883a add r3,r10,r10 - 9500: 9497883a add r11,r18,r18 - 9504: 5c8f803a cmpltu r7,r11,r18 - 9508: 9cd9883a add r12,r19,r19 - 950c: 01000044 movi r4,1 - 9510: 30cd883a add r6,r6,r3 - 9514: 3b0f883a add r7,r7,r12 - 9518: 423fffc4 addi r8,r8,-1 - 951c: 1013883a mov r9,r2 - 9520: 3015883a mov r10,r6 - 9524: 111ab03a or r13,r2,r4 - 9528: 98003016 blt r19,zero,95ec <__muldf3+0x398> - 952c: 5825883a mov r18,r11 - 9530: 3827883a mov r19,r7 - 9534: 7abfef2e bgeu r15,r10,94f4 <__muldf3+0x2a0> - 9538: da001015 stw r8,64(sp) - 953c: 00803fc4 movi r2,255 - 9540: 488e703a and r7,r9,r2 - 9544: 00802004 movi r2,128 - 9548: 0007883a mov r3,zero - 954c: 0011883a mov r8,zero - 9550: 38801826 beq r7,r2,95b4 <__muldf3+0x360> - 9554: 008000c4 movi r2,3 - 9558: d9000e04 addi r4,sp,56 - 955c: da801215 stw r10,72(sp) - 9560: d8800e15 stw r2,56(sp) - 9564: da401115 stw r9,68(sp) - 9568: 003f6a06 br 9314 <__muldf3+0xc0> - 956c: 89802126 beq r17,r6,95f4 <__muldf3+0x3a0> - 9570: 0009883a mov r4,zero - 9574: 5105883a add r2,r10,r4 - 9578: 128d803a cmpltu r6,r2,r10 - 957c: 5d07883a add r3,r11,r20 - 9580: 30cd883a add r6,r6,r3 - 9584: 0021883a mov r16,zero - 9588: 0023883a mov r17,zero - 958c: 1025883a mov r18,r2 - 9590: 3027883a mov r19,r6 - 9594: 32ff9e2e bgeu r6,r11,9410 <__muldf3+0x1bc> - 9598: 00800044 movi r2,1 - 959c: 8089883a add r4,r16,r2 - 95a0: 240d803a cmpltu r6,r4,r16 - 95a4: 344d883a add r6,r6,r17 - 95a8: 2021883a mov r16,r4 - 95ac: 3023883a mov r17,r6 - 95b0: 003f9806 br 9414 <__muldf3+0x1c0> - 95b4: 403fe71e bne r8,zero,9554 <__muldf3+0x300> - 95b8: 01004004 movi r4,256 - 95bc: 4904703a and r2,r9,r4 - 95c0: 10c4b03a or r2,r2,r3 - 95c4: 103fe31e bne r2,zero,9554 <__muldf3+0x300> - 95c8: 94c4b03a or r2,r18,r19 - 95cc: 103fe126 beq r2,zero,9554 <__muldf3+0x300> - 95d0: 49c5883a add r2,r9,r7 - 95d4: 1251803a cmpltu r8,r2,r9 - 95d8: 4291883a add r8,r8,r10 - 95dc: 013fc004 movi r4,-256 - 95e0: 1112703a and r9,r2,r4 - 95e4: 4015883a mov r10,r8 - 95e8: 003fda06 br 9554 <__muldf3+0x300> - 95ec: 6813883a mov r9,r13 - 95f0: 003fce06 br 952c <__muldf3+0x2d8> - 95f4: 143f7c36 bltu r2,r16,93e8 <__muldf3+0x194> - 95f8: 003fdd06 br 9570 <__muldf3+0x31c> - 95fc: 12bf852e bgeu r2,r10,9414 <__muldf3+0x1c0> - 9600: 003fe506 br 9598 <__muldf3+0x344> - 9604: 00800084 movi r2,2 - 9608: 20bf351e bne r4,r2,92e0 <__muldf3+0x8c> - 960c: 01000074 movhi r4,1 - 9610: 2138ed04 addi r4,r4,-7244 - 9614: 003f3f06 br 9314 <__muldf3+0xc0> - -00009618 <__divdf3>: - 9618: deffed04 addi sp,sp,-76 - 961c: dcc01115 stw r19,68(sp) - 9620: dcc00404 addi r19,sp,16 - 9624: 2011883a mov r8,r4 - 9628: 2813883a mov r9,r5 - 962c: dc000e15 stw r16,56(sp) - 9630: d809883a mov r4,sp - 9634: 980b883a mov r5,r19 - 9638: dc000904 addi r16,sp,36 - 963c: dfc01215 stw ra,72(sp) - 9640: da400115 stw r9,4(sp) - 9644: d9c00315 stw r7,12(sp) - 9648: da000015 stw r8,0(sp) - 964c: d9800215 stw r6,8(sp) - 9650: dc801015 stw r18,64(sp) - 9654: dc400f15 stw r17,60(sp) - 9658: 000a4b80 call a4b8 <__unpack_d> - 965c: d9000204 addi r4,sp,8 - 9660: 800b883a mov r5,r16 - 9664: 000a4b80 call a4b8 <__unpack_d> - 9668: d9000417 ldw r4,16(sp) - 966c: 00800044 movi r2,1 - 9670: 11000b2e bgeu r2,r4,96a0 <__divdf3+0x88> - 9674: d9400917 ldw r5,36(sp) - 9678: 1140762e bgeu r2,r5,9854 <__divdf3+0x23c> - 967c: d8800517 ldw r2,20(sp) - 9680: d8c00a17 ldw r3,40(sp) - 9684: 01800104 movi r6,4 - 9688: 10c4f03a xor r2,r2,r3 - 968c: d8800515 stw r2,20(sp) - 9690: 21800226 beq r4,r6,969c <__divdf3+0x84> - 9694: 00800084 movi r2,2 - 9698: 2080141e bne r4,r2,96ec <__divdf3+0xd4> - 969c: 29000926 beq r5,r4,96c4 <__divdf3+0xac> - 96a0: 9809883a mov r4,r19 - 96a4: 000a1a40 call a1a4 <__pack_d> - 96a8: dfc01217 ldw ra,72(sp) - 96ac: dcc01117 ldw r19,68(sp) - 96b0: dc801017 ldw r18,64(sp) - 96b4: dc400f17 ldw r17,60(sp) - 96b8: dc000e17 ldw r16,56(sp) - 96bc: dec01304 addi sp,sp,76 - 96c0: f800283a ret - 96c4: 01000074 movhi r4,1 - 96c8: 2138ed04 addi r4,r4,-7244 - 96cc: 000a1a40 call a1a4 <__pack_d> - 96d0: dfc01217 ldw ra,72(sp) - 96d4: dcc01117 ldw r19,68(sp) - 96d8: dc801017 ldw r18,64(sp) - 96dc: dc400f17 ldw r17,60(sp) - 96e0: dc000e17 ldw r16,56(sp) - 96e4: dec01304 addi sp,sp,76 - 96e8: f800283a ret - 96ec: 29805b26 beq r5,r6,985c <__divdf3+0x244> - 96f0: 28802d26 beq r5,r2,97a8 <__divdf3+0x190> - 96f4: d8c00617 ldw r3,24(sp) - 96f8: d8800b17 ldw r2,44(sp) - 96fc: d9c00817 ldw r7,32(sp) - 9700: dc400d17 ldw r17,52(sp) - 9704: 188bc83a sub r5,r3,r2 - 9708: d9800717 ldw r6,28(sp) - 970c: dc000c17 ldw r16,48(sp) - 9710: d9400615 stw r5,24(sp) - 9714: 3c403836 bltu r7,r17,97f8 <__divdf3+0x1e0> - 9718: 89c03626 beq r17,r7,97f4 <__divdf3+0x1dc> - 971c: 0015883a mov r10,zero - 9720: 001d883a mov r14,zero - 9724: 02c40034 movhi r11,4096 - 9728: 001f883a mov r15,zero - 972c: 003f883a mov ra,zero - 9730: 04800f44 movi r18,61 - 9734: 00000f06 br 9774 <__divdf3+0x15c> - 9738: 601d883a mov r14,r12 - 973c: 681f883a mov r15,r13 - 9740: 400d883a mov r6,r8 - 9744: 100f883a mov r7,r2 - 9748: 3191883a add r8,r6,r6 - 974c: 5808d07a srli r4,r11,1 - 9750: 4185803a cmpltu r2,r8,r6 - 9754: 39d3883a add r9,r7,r7 - 9758: 28c6b03a or r3,r5,r3 - 975c: 1245883a add r2,r2,r9 - 9760: 1815883a mov r10,r3 - 9764: 2017883a mov r11,r4 - 9768: 400d883a mov r6,r8 - 976c: 100f883a mov r7,r2 - 9770: fc801726 beq ra,r18,97d0 <__divdf3+0x1b8> - 9774: 580a97fa slli r5,r11,31 - 9778: 5006d07a srli r3,r10,1 - 977c: ffc00044 addi ra,ra,1 - 9780: 3c7ff136 bltu r7,r17,9748 <__divdf3+0x130> - 9784: 3411c83a sub r8,r6,r16 - 9788: 3205803a cmpltu r2,r6,r8 - 978c: 3c53c83a sub r9,r7,r17 - 9790: 7298b03a or r12,r14,r10 - 9794: 7adab03a or r13,r15,r11 - 9798: 4885c83a sub r2,r9,r2 - 979c: 89ffe61e bne r17,r7,9738 <__divdf3+0x120> - 97a0: 343fe936 bltu r6,r16,9748 <__divdf3+0x130> - 97a4: 003fe406 br 9738 <__divdf3+0x120> - 97a8: 9809883a mov r4,r19 - 97ac: d9800415 stw r6,16(sp) - 97b0: 000a1a40 call a1a4 <__pack_d> - 97b4: dfc01217 ldw ra,72(sp) - 97b8: dcc01117 ldw r19,68(sp) - 97bc: dc801017 ldw r18,64(sp) - 97c0: dc400f17 ldw r17,60(sp) - 97c4: dc000e17 ldw r16,56(sp) - 97c8: dec01304 addi sp,sp,76 - 97cc: f800283a ret - 97d0: 00803fc4 movi r2,255 - 97d4: 7090703a and r8,r14,r2 - 97d8: 00802004 movi r2,128 - 97dc: 0007883a mov r3,zero - 97e0: 0013883a mov r9,zero - 97e4: 40800d26 beq r8,r2,981c <__divdf3+0x204> - 97e8: dbc00815 stw r15,32(sp) - 97ec: db800715 stw r14,28(sp) - 97f0: 003fab06 br 96a0 <__divdf3+0x88> - 97f4: 343fc92e bgeu r6,r16,971c <__divdf3+0x104> - 97f8: 3185883a add r2,r6,r6 - 97fc: 1189803a cmpltu r4,r2,r6 - 9800: 39c7883a add r3,r7,r7 - 9804: 20c9883a add r4,r4,r3 - 9808: 297fffc4 addi r5,r5,-1 - 980c: 100d883a mov r6,r2 - 9810: 200f883a mov r7,r4 - 9814: d9400615 stw r5,24(sp) - 9818: 003fc006 br 971c <__divdf3+0x104> - 981c: 483ff21e bne r9,zero,97e8 <__divdf3+0x1d0> - 9820: 01004004 movi r4,256 - 9824: 7104703a and r2,r14,r4 - 9828: 10c4b03a or r2,r2,r3 - 982c: 103fee1e bne r2,zero,97e8 <__divdf3+0x1d0> - 9830: 31c4b03a or r2,r6,r7 - 9834: 103fec26 beq r2,zero,97e8 <__divdf3+0x1d0> - 9838: 7205883a add r2,r14,r8 - 983c: 1391803a cmpltu r8,r2,r14 - 9840: 43d1883a add r8,r8,r15 - 9844: 013fc004 movi r4,-256 - 9848: 111c703a and r14,r2,r4 - 984c: 401f883a mov r15,r8 - 9850: 003fe506 br 97e8 <__divdf3+0x1d0> - 9854: 8009883a mov r4,r16 - 9858: 003f9206 br 96a4 <__divdf3+0x8c> - 985c: 9809883a mov r4,r19 - 9860: d8000715 stw zero,28(sp) - 9864: d8000815 stw zero,32(sp) - 9868: d8000615 stw zero,24(sp) - 986c: 003f8d06 br 96a4 <__divdf3+0x8c> - -00009870 <__eqdf2>: - 9870: deffef04 addi sp,sp,-68 - 9874: dc400f15 stw r17,60(sp) - 9878: dc400404 addi r17,sp,16 - 987c: 2005883a mov r2,r4 - 9880: 2807883a mov r3,r5 - 9884: dc000e15 stw r16,56(sp) - 9888: d809883a mov r4,sp - 988c: 880b883a mov r5,r17 - 9890: dc000904 addi r16,sp,36 - 9894: d8c00115 stw r3,4(sp) - 9898: d8800015 stw r2,0(sp) - 989c: d9800215 stw r6,8(sp) - 98a0: dfc01015 stw ra,64(sp) - 98a4: d9c00315 stw r7,12(sp) - 98a8: 000a4b80 call a4b8 <__unpack_d> - 98ac: d9000204 addi r4,sp,8 - 98b0: 800b883a mov r5,r16 - 98b4: 000a4b80 call a4b8 <__unpack_d> - 98b8: d8800417 ldw r2,16(sp) - 98bc: 00c00044 movi r3,1 - 98c0: 180d883a mov r6,r3 - 98c4: 1880062e bgeu r3,r2,98e0 <__eqdf2+0x70> - 98c8: d8800917 ldw r2,36(sp) - 98cc: 8809883a mov r4,r17 - 98d0: 800b883a mov r5,r16 - 98d4: 1880022e bgeu r3,r2,98e0 <__eqdf2+0x70> - 98d8: 000a5f00 call a5f0 <__fpcmp_parts_d> - 98dc: 100d883a mov r6,r2 - 98e0: 3005883a mov r2,r6 - 98e4: dfc01017 ldw ra,64(sp) - 98e8: dc400f17 ldw r17,60(sp) - 98ec: dc000e17 ldw r16,56(sp) - 98f0: dec01104 addi sp,sp,68 - 98f4: f800283a ret - -000098f8 <__nedf2>: - 98f8: deffef04 addi sp,sp,-68 - 98fc: dc400f15 stw r17,60(sp) - 9900: dc400404 addi r17,sp,16 - 9904: 2005883a mov r2,r4 - 9908: 2807883a mov r3,r5 - 990c: dc000e15 stw r16,56(sp) - 9910: d809883a mov r4,sp - 9914: 880b883a mov r5,r17 - 9918: dc000904 addi r16,sp,36 - 991c: d8c00115 stw r3,4(sp) - 9920: d8800015 stw r2,0(sp) - 9924: d9800215 stw r6,8(sp) - 9928: dfc01015 stw ra,64(sp) - 992c: d9c00315 stw r7,12(sp) - 9930: 000a4b80 call a4b8 <__unpack_d> - 9934: d9000204 addi r4,sp,8 - 9938: 800b883a mov r5,r16 - 993c: 000a4b80 call a4b8 <__unpack_d> - 9940: d8800417 ldw r2,16(sp) - 9944: 00c00044 movi r3,1 - 9948: 180d883a mov r6,r3 - 994c: 1880062e bgeu r3,r2,9968 <__nedf2+0x70> - 9950: d8800917 ldw r2,36(sp) - 9954: 8809883a mov r4,r17 - 9958: 800b883a mov r5,r16 - 995c: 1880022e bgeu r3,r2,9968 <__nedf2+0x70> - 9960: 000a5f00 call a5f0 <__fpcmp_parts_d> - 9964: 100d883a mov r6,r2 - 9968: 3005883a mov r2,r6 - 996c: dfc01017 ldw ra,64(sp) - 9970: dc400f17 ldw r17,60(sp) - 9974: dc000e17 ldw r16,56(sp) - 9978: dec01104 addi sp,sp,68 - 997c: f800283a ret - -00009980 <__gtdf2>: - 9980: deffef04 addi sp,sp,-68 - 9984: dc400f15 stw r17,60(sp) - 9988: dc400404 addi r17,sp,16 - 998c: 2005883a mov r2,r4 - 9990: 2807883a mov r3,r5 - 9994: dc000e15 stw r16,56(sp) - 9998: d809883a mov r4,sp - 999c: 880b883a mov r5,r17 - 99a0: dc000904 addi r16,sp,36 - 99a4: d8c00115 stw r3,4(sp) - 99a8: d8800015 stw r2,0(sp) - 99ac: d9800215 stw r6,8(sp) - 99b0: dfc01015 stw ra,64(sp) - 99b4: d9c00315 stw r7,12(sp) - 99b8: 000a4b80 call a4b8 <__unpack_d> - 99bc: d9000204 addi r4,sp,8 - 99c0: 800b883a mov r5,r16 - 99c4: 000a4b80 call a4b8 <__unpack_d> - 99c8: d8800417 ldw r2,16(sp) - 99cc: 00c00044 movi r3,1 - 99d0: 01bfffc4 movi r6,-1 - 99d4: 1880062e bgeu r3,r2,99f0 <__gtdf2+0x70> - 99d8: d8800917 ldw r2,36(sp) - 99dc: 8809883a mov r4,r17 - 99e0: 800b883a mov r5,r16 - 99e4: 1880022e bgeu r3,r2,99f0 <__gtdf2+0x70> - 99e8: 000a5f00 call a5f0 <__fpcmp_parts_d> - 99ec: 100d883a mov r6,r2 - 99f0: 3005883a mov r2,r6 - 99f4: dfc01017 ldw ra,64(sp) - 99f8: dc400f17 ldw r17,60(sp) - 99fc: dc000e17 ldw r16,56(sp) - 9a00: dec01104 addi sp,sp,68 - 9a04: f800283a ret - -00009a08 <__gedf2>: - 9a08: deffef04 addi sp,sp,-68 - 9a0c: dc400f15 stw r17,60(sp) - 9a10: dc400404 addi r17,sp,16 - 9a14: 2005883a mov r2,r4 - 9a18: 2807883a mov r3,r5 - 9a1c: dc000e15 stw r16,56(sp) - 9a20: d809883a mov r4,sp - 9a24: 880b883a mov r5,r17 - 9a28: dc000904 addi r16,sp,36 - 9a2c: d8c00115 stw r3,4(sp) - 9a30: d8800015 stw r2,0(sp) - 9a34: d9800215 stw r6,8(sp) - 9a38: dfc01015 stw ra,64(sp) - 9a3c: d9c00315 stw r7,12(sp) - 9a40: 000a4b80 call a4b8 <__unpack_d> - 9a44: d9000204 addi r4,sp,8 - 9a48: 800b883a mov r5,r16 - 9a4c: 000a4b80 call a4b8 <__unpack_d> - 9a50: d8800417 ldw r2,16(sp) - 9a54: 00c00044 movi r3,1 - 9a58: 01bfffc4 movi r6,-1 - 9a5c: 1880062e bgeu r3,r2,9a78 <__gedf2+0x70> - 9a60: d8800917 ldw r2,36(sp) - 9a64: 8809883a mov r4,r17 - 9a68: 800b883a mov r5,r16 - 9a6c: 1880022e bgeu r3,r2,9a78 <__gedf2+0x70> - 9a70: 000a5f00 call a5f0 <__fpcmp_parts_d> - 9a74: 100d883a mov r6,r2 - 9a78: 3005883a mov r2,r6 - 9a7c: dfc01017 ldw ra,64(sp) - 9a80: dc400f17 ldw r17,60(sp) - 9a84: dc000e17 ldw r16,56(sp) - 9a88: dec01104 addi sp,sp,68 - 9a8c: f800283a ret - -00009a90 <__ltdf2>: - 9a90: deffef04 addi sp,sp,-68 - 9a94: dc400f15 stw r17,60(sp) - 9a98: dc400404 addi r17,sp,16 - 9a9c: 2005883a mov r2,r4 - 9aa0: 2807883a mov r3,r5 - 9aa4: dc000e15 stw r16,56(sp) - 9aa8: d809883a mov r4,sp - 9aac: 880b883a mov r5,r17 - 9ab0: dc000904 addi r16,sp,36 - 9ab4: d8c00115 stw r3,4(sp) - 9ab8: d8800015 stw r2,0(sp) - 9abc: d9800215 stw r6,8(sp) - 9ac0: dfc01015 stw ra,64(sp) - 9ac4: d9c00315 stw r7,12(sp) - 9ac8: 000a4b80 call a4b8 <__unpack_d> - 9acc: d9000204 addi r4,sp,8 - 9ad0: 800b883a mov r5,r16 - 9ad4: 000a4b80 call a4b8 <__unpack_d> - 9ad8: d8800417 ldw r2,16(sp) - 9adc: 00c00044 movi r3,1 - 9ae0: 180d883a mov r6,r3 - 9ae4: 1880062e bgeu r3,r2,9b00 <__ltdf2+0x70> - 9ae8: d8800917 ldw r2,36(sp) - 9aec: 8809883a mov r4,r17 - 9af0: 800b883a mov r5,r16 - 9af4: 1880022e bgeu r3,r2,9b00 <__ltdf2+0x70> - 9af8: 000a5f00 call a5f0 <__fpcmp_parts_d> - 9afc: 100d883a mov r6,r2 - 9b00: 3005883a mov r2,r6 - 9b04: dfc01017 ldw ra,64(sp) - 9b08: dc400f17 ldw r17,60(sp) - 9b0c: dc000e17 ldw r16,56(sp) - 9b10: dec01104 addi sp,sp,68 - 9b14: f800283a ret - -00009b18 <__floatsidf>: - 9b18: 2006d7fa srli r3,r4,31 - 9b1c: defff604 addi sp,sp,-40 - 9b20: 008000c4 movi r2,3 - 9b24: dfc00915 stw ra,36(sp) - 9b28: dcc00815 stw r19,32(sp) - 9b2c: dc800715 stw r18,28(sp) - 9b30: dc400615 stw r17,24(sp) - 9b34: dc000515 stw r16,20(sp) - 9b38: d8800015 stw r2,0(sp) - 9b3c: d8c00115 stw r3,4(sp) - 9b40: 20000f1e bne r4,zero,9b80 <__floatsidf+0x68> - 9b44: 00800084 movi r2,2 - 9b48: d8800015 stw r2,0(sp) - 9b4c: d809883a mov r4,sp - 9b50: 000a1a40 call a1a4 <__pack_d> - 9b54: 1009883a mov r4,r2 - 9b58: 180b883a mov r5,r3 - 9b5c: 2005883a mov r2,r4 - 9b60: 2807883a mov r3,r5 - 9b64: dfc00917 ldw ra,36(sp) - 9b68: dcc00817 ldw r19,32(sp) - 9b6c: dc800717 ldw r18,28(sp) - 9b70: dc400617 ldw r17,24(sp) - 9b74: dc000517 ldw r16,20(sp) - 9b78: dec00a04 addi sp,sp,40 - 9b7c: f800283a ret - 9b80: 00800f04 movi r2,60 - 9b84: 1807003a cmpeq r3,r3,zero - 9b88: d8800215 stw r2,8(sp) - 9b8c: 18001126 beq r3,zero,9bd4 <__floatsidf+0xbc> - 9b90: 0027883a mov r19,zero - 9b94: 2025883a mov r18,r4 - 9b98: d9000315 stw r4,12(sp) - 9b9c: dcc00415 stw r19,16(sp) - 9ba0: 000a1240 call a124 <__clzsi2> - 9ba4: 11000744 addi r4,r2,29 - 9ba8: 013fe80e bge zero,r4,9b4c <__floatsidf+0x34> - 9bac: 10bfff44 addi r2,r2,-3 - 9bb0: 10000c16 blt r2,zero,9be4 <__floatsidf+0xcc> - 9bb4: 90a2983a sll r17,r18,r2 - 9bb8: 0021883a mov r16,zero - 9bbc: d8800217 ldw r2,8(sp) - 9bc0: dc400415 stw r17,16(sp) - 9bc4: dc000315 stw r16,12(sp) - 9bc8: 1105c83a sub r2,r2,r4 - 9bcc: d8800215 stw r2,8(sp) - 9bd0: 003fde06 br 9b4c <__floatsidf+0x34> - 9bd4: 00a00034 movhi r2,32768 - 9bd8: 20800a26 beq r4,r2,9c04 <__floatsidf+0xec> - 9bdc: 0109c83a sub r4,zero,r4 - 9be0: 003feb06 br 9b90 <__floatsidf+0x78> - 9be4: 9006d07a srli r3,r18,1 - 9be8: 008007c4 movi r2,31 - 9bec: 1105c83a sub r2,r2,r4 - 9bf0: 1886d83a srl r3,r3,r2 - 9bf4: 9922983a sll r17,r19,r4 - 9bf8: 9120983a sll r16,r18,r4 - 9bfc: 1c62b03a or r17,r3,r17 - 9c00: 003fee06 br 9bbc <__floatsidf+0xa4> - 9c04: 0009883a mov r4,zero - 9c08: 01707834 movhi r5,49632 - 9c0c: 003fd306 br 9b5c <__floatsidf+0x44> - -00009c10 <__fixdfsi>: - 9c10: defff804 addi sp,sp,-32 - 9c14: 2005883a mov r2,r4 - 9c18: 2807883a mov r3,r5 - 9c1c: d809883a mov r4,sp - 9c20: d9400204 addi r5,sp,8 - 9c24: d8c00115 stw r3,4(sp) - 9c28: d8800015 stw r2,0(sp) - 9c2c: dfc00715 stw ra,28(sp) - 9c30: 000a4b80 call a4b8 <__unpack_d> - 9c34: d8c00217 ldw r3,8(sp) - 9c38: 00800084 movi r2,2 - 9c3c: 1880051e bne r3,r2,9c54 <__fixdfsi+0x44> - 9c40: 0007883a mov r3,zero - 9c44: 1805883a mov r2,r3 - 9c48: dfc00717 ldw ra,28(sp) - 9c4c: dec00804 addi sp,sp,32 - 9c50: f800283a ret - 9c54: 00800044 movi r2,1 - 9c58: 10fff92e bgeu r2,r3,9c40 <__fixdfsi+0x30> - 9c5c: 00800104 movi r2,4 - 9c60: 18800426 beq r3,r2,9c74 <__fixdfsi+0x64> - 9c64: d8c00417 ldw r3,16(sp) - 9c68: 183ff516 blt r3,zero,9c40 <__fixdfsi+0x30> - 9c6c: 00800784 movi r2,30 - 9c70: 10c0080e bge r2,r3,9c94 <__fixdfsi+0x84> - 9c74: d8800317 ldw r2,12(sp) - 9c78: 1000121e bne r2,zero,9cc4 <__fixdfsi+0xb4> - 9c7c: 00e00034 movhi r3,32768 - 9c80: 18ffffc4 addi r3,r3,-1 - 9c84: 1805883a mov r2,r3 - 9c88: dfc00717 ldw ra,28(sp) - 9c8c: dec00804 addi sp,sp,32 - 9c90: f800283a ret - 9c94: 00800f04 movi r2,60 - 9c98: 10d1c83a sub r8,r2,r3 - 9c9c: 40bff804 addi r2,r8,-32 - 9ca0: d9800517 ldw r6,20(sp) - 9ca4: d9c00617 ldw r7,24(sp) - 9ca8: 10000816 blt r2,zero,9ccc <__fixdfsi+0xbc> - 9cac: 3888d83a srl r4,r7,r2 - 9cb0: d8800317 ldw r2,12(sp) - 9cb4: 2007883a mov r3,r4 - 9cb8: 103fe226 beq r2,zero,9c44 <__fixdfsi+0x34> - 9cbc: 0107c83a sub r3,zero,r4 - 9cc0: 003fe006 br 9c44 <__fixdfsi+0x34> - 9cc4: 00e00034 movhi r3,32768 - 9cc8: 003fde06 br 9c44 <__fixdfsi+0x34> - 9ccc: 39c7883a add r3,r7,r7 - 9cd0: 008007c4 movi r2,31 - 9cd4: 1205c83a sub r2,r2,r8 - 9cd8: 1886983a sll r3,r3,r2 - 9cdc: 3208d83a srl r4,r6,r8 - 9ce0: 1908b03a or r4,r3,r4 - 9ce4: 003ff206 br 9cb0 <__fixdfsi+0xa0> - -00009ce8 <__floatunsidf>: - 9ce8: defff204 addi sp,sp,-56 - 9cec: dfc00d15 stw ra,52(sp) - 9cf0: ddc00c15 stw r23,48(sp) - 9cf4: dd800b15 stw r22,44(sp) - 9cf8: dd400a15 stw r21,40(sp) - 9cfc: dd000915 stw r20,36(sp) - 9d00: dcc00815 stw r19,32(sp) - 9d04: dc800715 stw r18,28(sp) - 9d08: dc400615 stw r17,24(sp) - 9d0c: dc000515 stw r16,20(sp) - 9d10: d8000115 stw zero,4(sp) - 9d14: 20000f1e bne r4,zero,9d54 <__floatunsidf+0x6c> - 9d18: 00800084 movi r2,2 - 9d1c: d8800015 stw r2,0(sp) - 9d20: d809883a mov r4,sp - 9d24: 000a1a40 call a1a4 <__pack_d> - 9d28: dfc00d17 ldw ra,52(sp) - 9d2c: ddc00c17 ldw r23,48(sp) - 9d30: dd800b17 ldw r22,44(sp) - 9d34: dd400a17 ldw r21,40(sp) - 9d38: dd000917 ldw r20,36(sp) - 9d3c: dcc00817 ldw r19,32(sp) - 9d40: dc800717 ldw r18,28(sp) - 9d44: dc400617 ldw r17,24(sp) - 9d48: dc000517 ldw r16,20(sp) - 9d4c: dec00e04 addi sp,sp,56 - 9d50: f800283a ret - 9d54: 008000c4 movi r2,3 - 9d58: 00c00f04 movi r3,60 - 9d5c: 002f883a mov r23,zero - 9d60: 202d883a mov r22,r4 - 9d64: d8800015 stw r2,0(sp) - 9d68: d8c00215 stw r3,8(sp) - 9d6c: d9000315 stw r4,12(sp) - 9d70: ddc00415 stw r23,16(sp) - 9d74: 000a1240 call a124 <__clzsi2> - 9d78: 12400744 addi r9,r2,29 - 9d7c: 48000b16 blt r9,zero,9dac <__floatunsidf+0xc4> - 9d80: 483fe726 beq r9,zero,9d20 <__floatunsidf+0x38> - 9d84: 10bfff44 addi r2,r2,-3 - 9d88: 10002e16 blt r2,zero,9e44 <__floatunsidf+0x15c> - 9d8c: b0a2983a sll r17,r22,r2 - 9d90: 0021883a mov r16,zero - 9d94: d8800217 ldw r2,8(sp) - 9d98: dc400415 stw r17,16(sp) - 9d9c: dc000315 stw r16,12(sp) - 9da0: 1245c83a sub r2,r2,r9 - 9da4: d8800215 stw r2,8(sp) - 9da8: 003fdd06 br 9d20 <__floatunsidf+0x38> - 9dac: 0255c83a sub r10,zero,r9 - 9db0: 51bff804 addi r6,r10,-32 - 9db4: 30001b16 blt r6,zero,9e24 <__floatunsidf+0x13c> - 9db8: b9a8d83a srl r20,r23,r6 - 9dbc: 002b883a mov r21,zero - 9dc0: 000f883a mov r7,zero - 9dc4: 01000044 movi r4,1 - 9dc8: 0011883a mov r8,zero - 9dcc: 30002516 blt r6,zero,9e64 <__floatunsidf+0x17c> - 9dd0: 21a6983a sll r19,r4,r6 - 9dd4: 0025883a mov r18,zero - 9dd8: 00bfffc4 movi r2,-1 - 9ddc: 9089883a add r4,r18,r2 - 9de0: 988b883a add r5,r19,r2 - 9de4: 248d803a cmpltu r6,r4,r18 - 9de8: 314b883a add r5,r6,r5 - 9dec: b104703a and r2,r22,r4 - 9df0: b946703a and r3,r23,r5 - 9df4: 10c4b03a or r2,r2,r3 - 9df8: 10000226 beq r2,zero,9e04 <__floatunsidf+0x11c> - 9dfc: 01c00044 movi r7,1 - 9e00: 0011883a mov r8,zero - 9e04: d9000217 ldw r4,8(sp) - 9e08: a1c4b03a or r2,r20,r7 - 9e0c: aa06b03a or r3,r21,r8 - 9e10: 2249c83a sub r4,r4,r9 - 9e14: d8c00415 stw r3,16(sp) - 9e18: d9000215 stw r4,8(sp) - 9e1c: d8800315 stw r2,12(sp) - 9e20: 003fbf06 br 9d20 <__floatunsidf+0x38> - 9e24: bdc7883a add r3,r23,r23 - 9e28: 008007c4 movi r2,31 - 9e2c: 1285c83a sub r2,r2,r10 - 9e30: 1886983a sll r3,r3,r2 - 9e34: b2a8d83a srl r20,r22,r10 - 9e38: baaad83a srl r21,r23,r10 - 9e3c: 1d28b03a or r20,r3,r20 - 9e40: 003fdf06 br 9dc0 <__floatunsidf+0xd8> - 9e44: b006d07a srli r3,r22,1 - 9e48: 008007c4 movi r2,31 - 9e4c: 1245c83a sub r2,r2,r9 - 9e50: 1886d83a srl r3,r3,r2 - 9e54: ba62983a sll r17,r23,r9 - 9e58: b260983a sll r16,r22,r9 - 9e5c: 1c62b03a or r17,r3,r17 - 9e60: 003fcc06 br 9d94 <__floatunsidf+0xac> - 9e64: 2006d07a srli r3,r4,1 - 9e68: 008007c4 movi r2,31 - 9e6c: 1285c83a sub r2,r2,r10 - 9e70: 18a6d83a srl r19,r3,r2 - 9e74: 22a4983a sll r18,r4,r10 - 9e78: 003fd706 br 9dd8 <__floatunsidf+0xf0> - -00009e7c : - 9e7c: 29001b2e bgeu r5,r4,9eec - 9e80: 28001a16 blt r5,zero,9eec - 9e84: 00800044 movi r2,1 - 9e88: 0007883a mov r3,zero - 9e8c: 01c007c4 movi r7,31 - 9e90: 00000306 br 9ea0 - 9e94: 19c01326 beq r3,r7,9ee4 - 9e98: 18c00044 addi r3,r3,1 - 9e9c: 28000416 blt r5,zero,9eb0 - 9ea0: 294b883a add r5,r5,r5 - 9ea4: 1085883a add r2,r2,r2 - 9ea8: 293ffa36 bltu r5,r4,9e94 - 9eac: 10000d26 beq r2,zero,9ee4 - 9eb0: 0007883a mov r3,zero - 9eb4: 21400236 bltu r4,r5,9ec0 - 9eb8: 2149c83a sub r4,r4,r5 - 9ebc: 1886b03a or r3,r3,r2 - 9ec0: 1004d07a srli r2,r2,1 - 9ec4: 280ad07a srli r5,r5,1 - 9ec8: 103ffa1e bne r2,zero,9eb4 - 9ecc: 30000226 beq r6,zero,9ed8 - 9ed0: 2005883a mov r2,r4 - 9ed4: f800283a ret - 9ed8: 1809883a mov r4,r3 - 9edc: 2005883a mov r2,r4 - 9ee0: f800283a ret - 9ee4: 0007883a mov r3,zero - 9ee8: 003ff806 br 9ecc - 9eec: 00800044 movi r2,1 - 9ef0: 0007883a mov r3,zero - 9ef4: 003fef06 br 9eb4 - -00009ef8 <__divsi3>: - 9ef8: defffe04 addi sp,sp,-8 - 9efc: dc000015 stw r16,0(sp) - 9f00: dfc00115 stw ra,4(sp) - 9f04: 0021883a mov r16,zero - 9f08: 20000c16 blt r4,zero,9f3c <__divsi3+0x44> - 9f0c: 000d883a mov r6,zero - 9f10: 28000e16 blt r5,zero,9f4c <__divsi3+0x54> - 9f14: 0009e7c0 call 9e7c - 9f18: 1007883a mov r3,r2 - 9f1c: 8005003a cmpeq r2,r16,zero - 9f20: 1000011e bne r2,zero,9f28 <__divsi3+0x30> - 9f24: 00c7c83a sub r3,zero,r3 - 9f28: 1805883a mov r2,r3 - 9f2c: dfc00117 ldw ra,4(sp) - 9f30: dc000017 ldw r16,0(sp) - 9f34: dec00204 addi sp,sp,8 - 9f38: f800283a ret - 9f3c: 0109c83a sub r4,zero,r4 - 9f40: 04000044 movi r16,1 - 9f44: 000d883a mov r6,zero - 9f48: 283ff20e bge r5,zero,9f14 <__divsi3+0x1c> - 9f4c: 014bc83a sub r5,zero,r5 - 9f50: 8021003a cmpeq r16,r16,zero - 9f54: 003fef06 br 9f14 <__divsi3+0x1c> - -00009f58 <__modsi3>: - 9f58: deffff04 addi sp,sp,-4 - 9f5c: dfc00015 stw ra,0(sp) - 9f60: 01800044 movi r6,1 - 9f64: 2807883a mov r3,r5 - 9f68: 20000416 blt r4,zero,9f7c <__modsi3+0x24> - 9f6c: 28000c16 blt r5,zero,9fa0 <__modsi3+0x48> - 9f70: dfc00017 ldw ra,0(sp) - 9f74: dec00104 addi sp,sp,4 - 9f78: 0009e7c1 jmpi 9e7c - 9f7c: 0109c83a sub r4,zero,r4 - 9f80: 28000b16 blt r5,zero,9fb0 <__modsi3+0x58> - 9f84: 180b883a mov r5,r3 - 9f88: 01800044 movi r6,1 - 9f8c: 0009e7c0 call 9e7c - 9f90: 0085c83a sub r2,zero,r2 - 9f94: dfc00017 ldw ra,0(sp) - 9f98: dec00104 addi sp,sp,4 - 9f9c: f800283a ret - 9fa0: 014bc83a sub r5,zero,r5 - 9fa4: dfc00017 ldw ra,0(sp) - 9fa8: dec00104 addi sp,sp,4 - 9fac: 0009e7c1 jmpi 9e7c - 9fb0: 0147c83a sub r3,zero,r5 - 9fb4: 003ff306 br 9f84 <__modsi3+0x2c> - -00009fb8 <__udivsi3>: - 9fb8: 000d883a mov r6,zero - 9fbc: 0009e7c1 jmpi 9e7c - -00009fc0 <__umodsi3>: - 9fc0: 01800044 movi r6,1 - 9fc4: 0009e7c1 jmpi 9e7c - -00009fc8 <__mulsi3>: - 9fc8: 20000a26 beq r4,zero,9ff4 <__mulsi3+0x2c> - 9fcc: 0007883a mov r3,zero - 9fd0: 2080004c andi r2,r4,1 - 9fd4: 1005003a cmpeq r2,r2,zero - 9fd8: 2008d07a srli r4,r4,1 - 9fdc: 1000011e bne r2,zero,9fe4 <__mulsi3+0x1c> - 9fe0: 1947883a add r3,r3,r5 - 9fe4: 294b883a add r5,r5,r5 - 9fe8: 203ff91e bne r4,zero,9fd0 <__mulsi3+0x8> - 9fec: 1805883a mov r2,r3 - 9ff0: f800283a ret - 9ff4: 0007883a mov r3,zero - 9ff8: 1805883a mov r2,r3 - 9ffc: f800283a ret - -0000a000 <__muldi3>: - a000: defff204 addi sp,sp,-56 - a004: df000c15 stw fp,48(sp) - a008: 3038d43a srli fp,r6,16 - a00c: dd000815 stw r20,32(sp) - a010: dc400515 stw r17,20(sp) - a014: 2028d43a srli r20,r4,16 - a018: 247fffcc andi r17,r4,65535 - a01c: dc000415 stw r16,16(sp) - a020: 343fffcc andi r16,r6,65535 - a024: dcc00715 stw r19,28(sp) - a028: d9000015 stw r4,0(sp) - a02c: 2827883a mov r19,r5 - a030: 8809883a mov r4,r17 - a034: d9400115 stw r5,4(sp) - a038: 800b883a mov r5,r16 - a03c: d9800215 stw r6,8(sp) - a040: dfc00d15 stw ra,52(sp) - a044: d9c00315 stw r7,12(sp) - a048: dd800a15 stw r22,40(sp) - a04c: dd400915 stw r21,36(sp) - a050: 302d883a mov r22,r6 - a054: ddc00b15 stw r23,44(sp) - a058: dc800615 stw r18,24(sp) - a05c: 0009fc80 call 9fc8 <__mulsi3> - a060: 8809883a mov r4,r17 - a064: e00b883a mov r5,fp - a068: 102b883a mov r21,r2 - a06c: 0009fc80 call 9fc8 <__mulsi3> - a070: 800b883a mov r5,r16 - a074: a009883a mov r4,r20 - a078: 1023883a mov r17,r2 - a07c: 0009fc80 call 9fc8 <__mulsi3> - a080: a009883a mov r4,r20 - a084: e00b883a mov r5,fp - a088: 1021883a mov r16,r2 - a08c: 0009fc80 call 9fc8 <__mulsi3> - a090: a8ffffcc andi r3,r21,65535 - a094: a82ad43a srli r21,r21,16 - a098: 8c23883a add r17,r17,r16 - a09c: 1011883a mov r8,r2 - a0a0: ac6b883a add r21,r21,r17 - a0a4: a804943a slli r2,r21,16 - a0a8: b009883a mov r4,r22 - a0ac: 980b883a mov r5,r19 - a0b0: 10c7883a add r3,r2,r3 - a0b4: a812d43a srli r9,r21,16 - a0b8: 180d883a mov r6,r3 - a0bc: ac00022e bgeu r21,r16,a0c8 <__muldi3+0xc8> - a0c0: 00800074 movhi r2,1 - a0c4: 4091883a add r8,r8,r2 - a0c8: 4267883a add r19,r8,r9 - a0cc: 302d883a mov r22,r6 - a0d0: 0009fc80 call 9fc8 <__mulsi3> - a0d4: d9400317 ldw r5,12(sp) - a0d8: d9000017 ldw r4,0(sp) - a0dc: 1023883a mov r17,r2 - a0e0: 0009fc80 call 9fc8 <__mulsi3> - a0e4: 14cb883a add r5,r2,r19 - a0e8: 894b883a add r5,r17,r5 - a0ec: b005883a mov r2,r22 - a0f0: 2807883a mov r3,r5 - a0f4: dfc00d17 ldw ra,52(sp) - a0f8: df000c17 ldw fp,48(sp) - a0fc: ddc00b17 ldw r23,44(sp) - a100: dd800a17 ldw r22,40(sp) - a104: dd400917 ldw r21,36(sp) - a108: dd000817 ldw r20,32(sp) - a10c: dcc00717 ldw r19,28(sp) - a110: dc800617 ldw r18,24(sp) - a114: dc400517 ldw r17,20(sp) - a118: dc000417 ldw r16,16(sp) - a11c: dec00e04 addi sp,sp,56 - a120: f800283a ret - -0000a124 <__clzsi2>: - a124: 00bfffd4 movui r2,65535 - a128: 11000e36 bltu r2,r4,a164 <__clzsi2+0x40> - a12c: 00803fc4 movi r2,255 - a130: 01400204 movi r5,8 - a134: 0007883a mov r3,zero - a138: 11001036 bltu r2,r4,a17c <__clzsi2+0x58> - a13c: 000b883a mov r5,zero - a140: 20c6d83a srl r3,r4,r3 - a144: 00800074 movhi r2,1 - a148: 10b8f204 addi r2,r2,-7224 - a14c: 1887883a add r3,r3,r2 - a150: 18800003 ldbu r2,0(r3) - a154: 00c00804 movi r3,32 - a158: 2885883a add r2,r5,r2 - a15c: 1885c83a sub r2,r3,r2 - a160: f800283a ret - a164: 01400404 movi r5,16 - a168: 00804034 movhi r2,256 - a16c: 10bfffc4 addi r2,r2,-1 - a170: 2807883a mov r3,r5 - a174: 113ff22e bgeu r2,r4,a140 <__clzsi2+0x1c> - a178: 01400604 movi r5,24 - a17c: 2807883a mov r3,r5 - a180: 20c6d83a srl r3,r4,r3 - a184: 00800074 movhi r2,1 - a188: 10b8f204 addi r2,r2,-7224 - a18c: 1887883a add r3,r3,r2 - a190: 18800003 ldbu r2,0(r3) - a194: 00c00804 movi r3,32 - a198: 2885883a add r2,r5,r2 - a19c: 1885c83a sub r2,r3,r2 - a1a0: f800283a ret - -0000a1a4 <__pack_d>: - a1a4: 20c00017 ldw r3,0(r4) - a1a8: defffd04 addi sp,sp,-12 - a1ac: dc000015 stw r16,0(sp) - a1b0: dc800215 stw r18,8(sp) - a1b4: dc400115 stw r17,4(sp) - a1b8: 00800044 movi r2,1 - a1bc: 22000317 ldw r8,12(r4) - a1c0: 001f883a mov r15,zero - a1c4: 22400417 ldw r9,16(r4) - a1c8: 24000117 ldw r16,4(r4) - a1cc: 10c0552e bgeu r2,r3,a324 <__pack_d+0x180> - a1d0: 00800104 movi r2,4 - a1d4: 18804f26 beq r3,r2,a314 <__pack_d+0x170> - a1d8: 00800084 movi r2,2 - a1dc: 18800226 beq r3,r2,a1e8 <__pack_d+0x44> - a1e0: 4244b03a or r2,r8,r9 - a1e4: 10001a1e bne r2,zero,a250 <__pack_d+0xac> - a1e8: 000d883a mov r6,zero - a1ec: 000f883a mov r7,zero - a1f0: 0011883a mov r8,zero - a1f4: 00800434 movhi r2,16 - a1f8: 10bfffc4 addi r2,r2,-1 - a1fc: 301d883a mov r14,r6 - a200: 3884703a and r2,r7,r2 - a204: 400a953a slli r5,r8,20 - a208: 79bffc2c andhi r6,r15,65520 - a20c: 308cb03a or r6,r6,r2 - a210: 00e00434 movhi r3,32784 - a214: 18ffffc4 addi r3,r3,-1 - a218: 800497fa slli r2,r16,31 - a21c: 30c6703a and r3,r6,r3 - a220: 1946b03a or r3,r3,r5 - a224: 01600034 movhi r5,32768 - a228: 297fffc4 addi r5,r5,-1 - a22c: 194a703a and r5,r3,r5 - a230: 288ab03a or r5,r5,r2 - a234: 2807883a mov r3,r5 - a238: 7005883a mov r2,r14 - a23c: dc800217 ldw r18,8(sp) - a240: dc400117 ldw r17,4(sp) - a244: dc000017 ldw r16,0(sp) - a248: dec00304 addi sp,sp,12 - a24c: f800283a ret - a250: 21000217 ldw r4,8(r4) - a254: 00bf0084 movi r2,-1022 - a258: 20803f16 blt r4,r2,a358 <__pack_d+0x1b4> - a25c: 0080ffc4 movi r2,1023 - a260: 11002c16 blt r2,r4,a314 <__pack_d+0x170> - a264: 00803fc4 movi r2,255 - a268: 408c703a and r6,r8,r2 - a26c: 00802004 movi r2,128 - a270: 0007883a mov r3,zero - a274: 000f883a mov r7,zero - a278: 2280ffc4 addi r10,r4,1023 - a27c: 30801e26 beq r6,r2,a2f8 <__pack_d+0x154> - a280: 00801fc4 movi r2,127 - a284: 4089883a add r4,r8,r2 - a288: 220d803a cmpltu r6,r4,r8 - a28c: 324d883a add r6,r6,r9 - a290: 2011883a mov r8,r4 - a294: 3013883a mov r9,r6 - a298: 00880034 movhi r2,8192 - a29c: 10bfffc4 addi r2,r2,-1 - a2a0: 12400d36 bltu r2,r9,a2d8 <__pack_d+0x134> - a2a4: 4804963a slli r2,r9,24 - a2a8: 400cd23a srli r6,r8,8 - a2ac: 480ed23a srli r7,r9,8 - a2b0: 013fffc4 movi r4,-1 - a2b4: 118cb03a or r6,r2,r6 - a2b8: 01400434 movhi r5,16 - a2bc: 297fffc4 addi r5,r5,-1 - a2c0: 3104703a and r2,r6,r4 - a2c4: 3946703a and r3,r7,r5 - a2c8: 5201ffcc andi r8,r10,2047 - a2cc: 100d883a mov r6,r2 - a2d0: 180f883a mov r7,r3 - a2d4: 003fc706 br a1f4 <__pack_d+0x50> - a2d8: 480897fa slli r4,r9,31 - a2dc: 4004d07a srli r2,r8,1 - a2e0: 4806d07a srli r3,r9,1 - a2e4: 52800044 addi r10,r10,1 - a2e8: 2084b03a or r2,r4,r2 - a2ec: 1011883a mov r8,r2 - a2f0: 1813883a mov r9,r3 - a2f4: 003feb06 br a2a4 <__pack_d+0x100> - a2f8: 383fe11e bne r7,zero,a280 <__pack_d+0xdc> - a2fc: 01004004 movi r4,256 - a300: 4104703a and r2,r8,r4 - a304: 10c4b03a or r2,r2,r3 - a308: 103fe326 beq r2,zero,a298 <__pack_d+0xf4> - a30c: 3005883a mov r2,r6 - a310: 003fdc06 br a284 <__pack_d+0xe0> - a314: 000d883a mov r6,zero - a318: 000f883a mov r7,zero - a31c: 0201ffc4 movi r8,2047 - a320: 003fb406 br a1f4 <__pack_d+0x50> - a324: 0005883a mov r2,zero - a328: 00c00234 movhi r3,8 - a32c: 408cb03a or r6,r8,r2 - a330: 48ceb03a or r7,r9,r3 - a334: 013fffc4 movi r4,-1 - a338: 01400434 movhi r5,16 - a33c: 297fffc4 addi r5,r5,-1 - a340: 3104703a and r2,r6,r4 - a344: 3946703a and r3,r7,r5 - a348: 100d883a mov r6,r2 - a34c: 180f883a mov r7,r3 - a350: 0201ffc4 movi r8,2047 - a354: 003fa706 br a1f4 <__pack_d+0x50> - a358: 1109c83a sub r4,r2,r4 - a35c: 00800e04 movi r2,56 - a360: 11004316 blt r2,r4,a470 <__pack_d+0x2cc> - a364: 21fff804 addi r7,r4,-32 - a368: 38004516 blt r7,zero,a480 <__pack_d+0x2dc> - a36c: 49d8d83a srl r12,r9,r7 - a370: 001b883a mov r13,zero - a374: 0023883a mov r17,zero - a378: 01400044 movi r5,1 - a37c: 0025883a mov r18,zero - a380: 38004716 blt r7,zero,a4a0 <__pack_d+0x2fc> - a384: 29d6983a sll r11,r5,r7 - a388: 0015883a mov r10,zero - a38c: 00bfffc4 movi r2,-1 - a390: 5089883a add r4,r10,r2 - a394: 588b883a add r5,r11,r2 - a398: 228d803a cmpltu r6,r4,r10 - a39c: 314b883a add r5,r6,r5 - a3a0: 4104703a and r2,r8,r4 - a3a4: 4946703a and r3,r9,r5 - a3a8: 10c4b03a or r2,r2,r3 - a3ac: 10000226 beq r2,zero,a3b8 <__pack_d+0x214> - a3b0: 04400044 movi r17,1 - a3b4: 0025883a mov r18,zero - a3b8: 00803fc4 movi r2,255 - a3bc: 644eb03a or r7,r12,r17 - a3c0: 3892703a and r9,r7,r2 - a3c4: 00802004 movi r2,128 - a3c8: 6c90b03a or r8,r13,r18 - a3cc: 0015883a mov r10,zero - a3d0: 48801626 beq r9,r2,a42c <__pack_d+0x288> - a3d4: 01001fc4 movi r4,127 - a3d8: 3905883a add r2,r7,r4 - a3dc: 11cd803a cmpltu r6,r2,r7 - a3e0: 320d883a add r6,r6,r8 - a3e4: 100f883a mov r7,r2 - a3e8: 00840034 movhi r2,4096 - a3ec: 10bfffc4 addi r2,r2,-1 - a3f0: 3011883a mov r8,r6 - a3f4: 0007883a mov r3,zero - a3f8: 11801b36 bltu r2,r6,a468 <__pack_d+0x2c4> - a3fc: 4004963a slli r2,r8,24 - a400: 3808d23a srli r4,r7,8 - a404: 400ad23a srli r5,r8,8 - a408: 1813883a mov r9,r3 - a40c: 1108b03a or r4,r2,r4 - a410: 00bfffc4 movi r2,-1 - a414: 00c00434 movhi r3,16 - a418: 18ffffc4 addi r3,r3,-1 - a41c: 208c703a and r6,r4,r2 - a420: 28ce703a and r7,r5,r3 - a424: 4a01ffcc andi r8,r9,2047 - a428: 003f7206 br a1f4 <__pack_d+0x50> - a42c: 503fe91e bne r10,zero,a3d4 <__pack_d+0x230> - a430: 01004004 movi r4,256 - a434: 3904703a and r2,r7,r4 - a438: 0007883a mov r3,zero - a43c: 10c4b03a or r2,r2,r3 - a440: 10000626 beq r2,zero,a45c <__pack_d+0x2b8> - a444: 3a45883a add r2,r7,r9 - a448: 11cd803a cmpltu r6,r2,r7 - a44c: 320d883a add r6,r6,r8 - a450: 100f883a mov r7,r2 - a454: 3011883a mov r8,r6 - a458: 0007883a mov r3,zero - a45c: 00840034 movhi r2,4096 - a460: 10bfffc4 addi r2,r2,-1 - a464: 123fe52e bgeu r2,r8,a3fc <__pack_d+0x258> - a468: 00c00044 movi r3,1 - a46c: 003fe306 br a3fc <__pack_d+0x258> - a470: 0009883a mov r4,zero - a474: 0013883a mov r9,zero - a478: 000b883a mov r5,zero - a47c: 003fe406 br a410 <__pack_d+0x26c> - a480: 4a47883a add r3,r9,r9 - a484: 008007c4 movi r2,31 - a488: 1105c83a sub r2,r2,r4 - a48c: 1886983a sll r3,r3,r2 - a490: 4118d83a srl r12,r8,r4 - a494: 491ad83a srl r13,r9,r4 - a498: 1b18b03a or r12,r3,r12 - a49c: 003fb506 br a374 <__pack_d+0x1d0> - a4a0: 2806d07a srli r3,r5,1 - a4a4: 008007c4 movi r2,31 - a4a8: 1105c83a sub r2,r2,r4 - a4ac: 1896d83a srl r11,r3,r2 - a4b0: 2914983a sll r10,r5,r4 - a4b4: 003fb506 br a38c <__pack_d+0x1e8> - -0000a4b8 <__unpack_d>: - a4b8: 20c00117 ldw r3,4(r4) - a4bc: 22400017 ldw r9,0(r4) - a4c0: 00800434 movhi r2,16 - a4c4: 10bfffc4 addi r2,r2,-1 - a4c8: 1808d53a srli r4,r3,20 - a4cc: 180cd7fa srli r6,r3,31 - a4d0: 1894703a and r10,r3,r2 - a4d4: 2201ffcc andi r8,r4,2047 - a4d8: 281b883a mov r13,r5 - a4dc: 4817883a mov r11,r9 - a4e0: 29800115 stw r6,4(r5) - a4e4: 5019883a mov r12,r10 - a4e8: 40001e1e bne r8,zero,a564 <__unpack_d+0xac> - a4ec: 4a84b03a or r2,r9,r10 - a4f0: 10001926 beq r2,zero,a558 <__unpack_d+0xa0> - a4f4: 4804d63a srli r2,r9,24 - a4f8: 500c923a slli r6,r10,8 - a4fc: 013f0084 movi r4,-1022 - a500: 00c40034 movhi r3,4096 - a504: 18ffffc4 addi r3,r3,-1 - a508: 118cb03a or r6,r2,r6 - a50c: 008000c4 movi r2,3 - a510: 480a923a slli r5,r9,8 - a514: 68800015 stw r2,0(r13) - a518: 69000215 stw r4,8(r13) - a51c: 19800b36 bltu r3,r6,a54c <__unpack_d+0x94> - a520: 200f883a mov r7,r4 - a524: 1811883a mov r8,r3 - a528: 2945883a add r2,r5,r5 - a52c: 1149803a cmpltu r4,r2,r5 - a530: 3187883a add r3,r6,r6 - a534: 20c9883a add r4,r4,r3 - a538: 100b883a mov r5,r2 - a53c: 200d883a mov r6,r4 - a540: 39ffffc4 addi r7,r7,-1 - a544: 413ff82e bgeu r8,r4,a528 <__unpack_d+0x70> - a548: 69c00215 stw r7,8(r13) - a54c: 69800415 stw r6,16(r13) - a550: 69400315 stw r5,12(r13) - a554: f800283a ret - a558: 00800084 movi r2,2 - a55c: 28800015 stw r2,0(r5) - a560: f800283a ret - a564: 0081ffc4 movi r2,2047 - a568: 40800f26 beq r8,r2,a5a8 <__unpack_d+0xf0> - a56c: 480cd63a srli r6,r9,24 - a570: 5006923a slli r3,r10,8 - a574: 4804923a slli r2,r9,8 - a578: 0009883a mov r4,zero - a57c: 30c6b03a or r3,r6,r3 - a580: 01440034 movhi r5,4096 - a584: 110cb03a or r6,r2,r4 - a588: 423f0044 addi r8,r8,-1023 - a58c: 194eb03a or r7,r3,r5 - a590: 008000c4 movi r2,3 - a594: 69c00415 stw r7,16(r13) - a598: 6a000215 stw r8,8(r13) - a59c: 68800015 stw r2,0(r13) - a5a0: 69800315 stw r6,12(r13) - a5a4: f800283a ret - a5a8: 4a84b03a or r2,r9,r10 - a5ac: 1000031e bne r2,zero,a5bc <__unpack_d+0x104> - a5b0: 00800104 movi r2,4 - a5b4: 28800015 stw r2,0(r5) - a5b8: f800283a ret - a5bc: 0009883a mov r4,zero - a5c0: 01400234 movhi r5,8 - a5c4: 4904703a and r2,r9,r4 - a5c8: 5146703a and r3,r10,r5 - a5cc: 10c4b03a or r2,r2,r3 - a5d0: 10000526 beq r2,zero,a5e8 <__unpack_d+0x130> - a5d4: 00800044 movi r2,1 - a5d8: 68800015 stw r2,0(r13) - a5dc: 6b000415 stw r12,16(r13) - a5e0: 6ac00315 stw r11,12(r13) - a5e4: f800283a ret - a5e8: 68000015 stw zero,0(r13) - a5ec: 003ffb06 br a5dc <__unpack_d+0x124> - -0000a5f0 <__fpcmp_parts_d>: - a5f0: 21800017 ldw r6,0(r4) - a5f4: 00c00044 movi r3,1 - a5f8: 19800a2e bgeu r3,r6,a624 <__fpcmp_parts_d+0x34> - a5fc: 28800017 ldw r2,0(r5) - a600: 1880082e bgeu r3,r2,a624 <__fpcmp_parts_d+0x34> - a604: 00c00104 movi r3,4 - a608: 30c02626 beq r6,r3,a6a4 <__fpcmp_parts_d+0xb4> - a60c: 10c02226 beq r2,r3,a698 <__fpcmp_parts_d+0xa8> - a610: 00c00084 movi r3,2 - a614: 30c00526 beq r6,r3,a62c <__fpcmp_parts_d+0x3c> - a618: 10c0071e bne r2,r3,a638 <__fpcmp_parts_d+0x48> - a61c: 20800117 ldw r2,4(r4) - a620: 1000091e bne r2,zero,a648 <__fpcmp_parts_d+0x58> - a624: 00800044 movi r2,1 - a628: f800283a ret - a62c: 10c01a1e bne r2,r3,a698 <__fpcmp_parts_d+0xa8> - a630: 0005883a mov r2,zero - a634: f800283a ret - a638: 22000117 ldw r8,4(r4) - a63c: 28800117 ldw r2,4(r5) - a640: 40800326 beq r8,r2,a650 <__fpcmp_parts_d+0x60> - a644: 403ff726 beq r8,zero,a624 <__fpcmp_parts_d+0x34> - a648: 00bfffc4 movi r2,-1 - a64c: f800283a ret - a650: 20c00217 ldw r3,8(r4) - a654: 28800217 ldw r2,8(r5) - a658: 10fffa16 blt r2,r3,a644 <__fpcmp_parts_d+0x54> - a65c: 18800916 blt r3,r2,a684 <__fpcmp_parts_d+0x94> - a660: 21c00417 ldw r7,16(r4) - a664: 28c00417 ldw r3,16(r5) - a668: 21800317 ldw r6,12(r4) - a66c: 28800317 ldw r2,12(r5) - a670: 19fff436 bltu r3,r7,a644 <__fpcmp_parts_d+0x54> - a674: 38c00526 beq r7,r3,a68c <__fpcmp_parts_d+0x9c> - a678: 38c00236 bltu r7,r3,a684 <__fpcmp_parts_d+0x94> - a67c: 19ffec1e bne r3,r7,a630 <__fpcmp_parts_d+0x40> - a680: 30bfeb2e bgeu r6,r2,a630 <__fpcmp_parts_d+0x40> - a684: 403fe71e bne r8,zero,a624 <__fpcmp_parts_d+0x34> - a688: 003fef06 br a648 <__fpcmp_parts_d+0x58> - a68c: 11bffa2e bgeu r2,r6,a678 <__fpcmp_parts_d+0x88> - a690: 403fe426 beq r8,zero,a624 <__fpcmp_parts_d+0x34> - a694: 003fec06 br a648 <__fpcmp_parts_d+0x58> - a698: 28800117 ldw r2,4(r5) - a69c: 103fe11e bne r2,zero,a624 <__fpcmp_parts_d+0x34> - a6a0: 003fe906 br a648 <__fpcmp_parts_d+0x58> - a6a4: 11bfdd1e bne r2,r6,a61c <__fpcmp_parts_d+0x2c> - a6a8: 28c00117 ldw r3,4(r5) - a6ac: 20800117 ldw r2,4(r4) - a6b0: 1885c83a sub r2,r3,r2 - a6b4: f800283a ret - -0000a6b8 : - * - * ALT_CLOSE is mapped onto the close() system call in alt_syscall.h - */ - -int ALT_CLOSE (int fildes) -{ - a6b8: defff804 addi sp,sp,-32 - a6bc: dfc00715 stw ra,28(sp) - a6c0: df000615 stw fp,24(sp) - a6c4: df000604 addi fp,sp,24 - a6c8: e13ffc15 stw r4,-16(fp) - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (fildes < 0) ? NULL : &alt_fd_list[fildes]; - a6cc: e0bffc17 ldw r2,-16(fp) - a6d0: 1004803a cmplt r2,r2,zero - a6d4: 1000091e bne r2,zero,a6fc - a6d8: e13ffc17 ldw r4,-16(fp) - a6dc: 01400304 movi r5,12 - a6e0: 0009fc80 call 9fc8 <__mulsi3> - a6e4: 1007883a mov r3,r2 - a6e8: 00800074 movhi r2,1 - a6ec: 10bbf204 addi r2,r2,-4152 - a6f0: 1887883a add r3,r3,r2 - a6f4: e0ffff15 stw r3,-4(fp) - a6f8: 00000106 br a700 - a6fc: e03fff15 stw zero,-4(fp) - a700: e0bfff17 ldw r2,-4(fp) - a704: e0bffb15 stw r2,-20(fp) - - if (fd) - a708: e0bffb17 ldw r2,-20(fp) - a70c: 1005003a cmpeq r2,r2,zero - a710: 10001d1e bne r2,zero,a788 - /* - * If the associated file system/device has a close function, call it so - * that any necessary cleanup code can run. - */ - - rval = (fd->dev->close) ? fd->dev->close(fd) : 0; - a714: e0bffb17 ldw r2,-20(fp) - a718: 10800017 ldw r2,0(r2) - a71c: 10800417 ldw r2,16(r2) - a720: 1005003a cmpeq r2,r2,zero - a724: 1000071e bne r2,zero,a744 - a728: e0bffb17 ldw r2,-20(fp) - a72c: 10800017 ldw r2,0(r2) - a730: 10800417 ldw r2,16(r2) - a734: e13ffb17 ldw r4,-20(fp) - a738: 103ee83a callr r2 - a73c: e0bffe15 stw r2,-8(fp) - a740: 00000106 br a748 - a744: e03ffe15 stw zero,-8(fp) - a748: e0bffe17 ldw r2,-8(fp) - a74c: e0bffa15 stw r2,-24(fp) - - /* Free the file descriptor structure and return. */ - - alt_release_fd (fildes); - a750: e13ffc17 ldw r4,-16(fp) - a754: 000b1f40 call b1f4 - if (rval < 0) - a758: e0bffa17 ldw r2,-24(fp) - a75c: 1004403a cmpge r2,r2,zero - a760: 1000071e bne r2,zero,a780 - { - ALT_ERRNO = -rval; - a764: 000a7b80 call a7b8 - a768: e0fffa17 ldw r3,-24(fp) - a76c: 00c7c83a sub r3,zero,r3 - a770: 10c00015 stw r3,0(r2) - return -1; - a774: 00bfffc4 movi r2,-1 - a778: e0bffd15 stw r2,-12(fp) - a77c: 00000806 br a7a0 - } - return 0; - a780: e03ffd15 stw zero,-12(fp) - a784: 00000606 br a7a0 - } - else - { - ALT_ERRNO = EBADFD; - a788: 000a7b80 call a7b8 - a78c: 1007883a mov r3,r2 - a790: 00801444 movi r2,81 - a794: 18800015 stw r2,0(r3) - return -1; - a798: 00bfffc4 movi r2,-1 - a79c: e0bffd15 stw r2,-12(fp) - a7a0: e0bffd17 ldw r2,-12(fp) - } -} - a7a4: e037883a mov sp,fp - a7a8: dfc00117 ldw ra,4(sp) - a7ac: df000017 ldw fp,0(sp) - a7b0: dec00204 addi sp,sp,8 - a7b4: f800283a ret - -0000a7b8 : -#undef errno - -extern int errno; - -static ALT_INLINE int* alt_get_errno(void) -{ - a7b8: defffd04 addi sp,sp,-12 - a7bc: dfc00215 stw ra,8(sp) - a7c0: df000115 stw fp,4(sp) - a7c4: df000104 addi fp,sp,4 - return ((alt_errno) ? alt_errno() : &errno); - a7c8: 00800074 movhi r2,1 - a7cc: 1080bd04 addi r2,r2,756 - a7d0: 10800017 ldw r2,0(r2) - a7d4: 1005003a cmpeq r2,r2,zero - a7d8: 1000061e bne r2,zero,a7f4 - a7dc: 00800074 movhi r2,1 - a7e0: 1080bd04 addi r2,r2,756 - a7e4: 10800017 ldw r2,0(r2) - a7e8: 103ee83a callr r2 - a7ec: e0bfff15 stw r2,-4(fp) - a7f0: 00000306 br a800 - a7f4: 00800074 movhi r2,1 - a7f8: 1087a504 addi r2,r2,7828 - a7fc: e0bfff15 stw r2,-4(fp) - a800: e0bfff17 ldw r2,-4(fp) -} - a804: e037883a mov sp,fp - a808: dfc00117 ldw ra,4(sp) - a80c: df000017 ldw fp,0(sp) - a810: dec00204 addi sp,sp,8 - a814: f800283a ret - -0000a818 : - * by the alt_dev_null device. It simple discards all data passed to it, and - * indicates that the data has been successfully transmitted. - */ - -static int alt_dev_null_write (alt_fd* fd, const char* ptr, int len) -{ - a818: defffc04 addi sp,sp,-16 - a81c: df000315 stw fp,12(sp) - a820: df000304 addi fp,sp,12 - a824: e13ffd15 stw r4,-12(fp) - a828: e17ffe15 stw r5,-8(fp) - a82c: e1bfff15 stw r6,-4(fp) - return len; - a830: e0bfff17 ldw r2,-4(fp) -} - a834: e037883a mov sp,fp - a838: df000017 ldw fp,0(sp) - a83c: dec00104 addi sp,sp,4 - a840: f800283a ret - -0000a844 : -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -int ALT_FSTAT (int file, struct stat *st) -{ - a844: defff904 addi sp,sp,-28 - a848: dfc00615 stw ra,24(sp) - a84c: df000515 stw fp,20(sp) - a850: df000504 addi fp,sp,20 - a854: e13ffc15 stw r4,-16(fp) - a858: e17ffd15 stw r5,-12(fp) - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - a85c: e0bffc17 ldw r2,-16(fp) - a860: 1004803a cmplt r2,r2,zero - a864: 1000091e bne r2,zero,a88c - a868: e13ffc17 ldw r4,-16(fp) - a86c: 01400304 movi r5,12 - a870: 0009fc80 call 9fc8 <__mulsi3> - a874: 1007883a mov r3,r2 - a878: 00800074 movhi r2,1 - a87c: 10bbf204 addi r2,r2,-4152 - a880: 1887883a add r3,r3,r2 - a884: e0ffff15 stw r3,-4(fp) - a888: 00000106 br a890 - a88c: e03fff15 stw zero,-4(fp) - a890: e0bfff17 ldw r2,-4(fp) - a894: e0bffb15 stw r2,-20(fp) - - if (fd) - a898: e0bffb17 ldw r2,-20(fp) - a89c: 1005003a cmpeq r2,r2,zero - a8a0: 1000121e bne r2,zero,a8ec - { - /* Call the drivers fstat() function to fill out the "st" structure. */ - - if (fd->dev->fstat) - a8a4: e0bffb17 ldw r2,-20(fp) - a8a8: 10800017 ldw r2,0(r2) - a8ac: 10800817 ldw r2,32(r2) - a8b0: 1005003a cmpeq r2,r2,zero - a8b4: 1000081e bne r2,zero,a8d8 - { - return fd->dev->fstat(fd, st); - a8b8: e0bffb17 ldw r2,-20(fp) - a8bc: 10800017 ldw r2,0(r2) - a8c0: 10800817 ldw r2,32(r2) - a8c4: e13ffb17 ldw r4,-20(fp) - a8c8: e17ffd17 ldw r5,-12(fp) - a8cc: 103ee83a callr r2 - a8d0: e0bffe15 stw r2,-8(fp) - a8d4: 00000b06 br a904 - * device. - */ - - else - { - st->st_mode = _IFCHR; - a8d8: e0fffd17 ldw r3,-12(fp) - a8dc: 00880004 movi r2,8192 - a8e0: 18800115 stw r2,4(r3) - return 0; - a8e4: e03ffe15 stw zero,-8(fp) - a8e8: 00000606 br a904 - } - } - else - { - ALT_ERRNO = EBADFD; - a8ec: 000a91c0 call a91c - a8f0: 1007883a mov r3,r2 - a8f4: 00801444 movi r2,81 - a8f8: 18800015 stw r2,0(r3) - return -1; - a8fc: 00bfffc4 movi r2,-1 - a900: e0bffe15 stw r2,-8(fp) - a904: e0bffe17 ldw r2,-8(fp) - } -} - a908: e037883a mov sp,fp - a90c: dfc00117 ldw ra,4(sp) - a910: df000017 ldw fp,0(sp) - a914: dec00204 addi sp,sp,8 - a918: f800283a ret - -0000a91c : -#undef errno - -extern int errno; - -static ALT_INLINE int* alt_get_errno(void) -{ - a91c: defffd04 addi sp,sp,-12 - a920: dfc00215 stw ra,8(sp) - a924: df000115 stw fp,4(sp) - a928: df000104 addi fp,sp,4 - return ((alt_errno) ? alt_errno() : &errno); - a92c: 00800074 movhi r2,1 - a930: 1080bd04 addi r2,r2,756 - a934: 10800017 ldw r2,0(r2) - a938: 1005003a cmpeq r2,r2,zero - a93c: 1000061e bne r2,zero,a958 - a940: 00800074 movhi r2,1 - a944: 1080bd04 addi r2,r2,756 - a948: 10800017 ldw r2,0(r2) - a94c: 103ee83a callr r2 - a950: e0bfff15 stw r2,-4(fp) - a954: 00000306 br a964 - a958: 00800074 movhi r2,1 - a95c: 1087a504 addi r2,r2,7828 - a960: e0bfff15 stw r2,-4(fp) - a964: e0bfff17 ldw r2,-4(fp) -} - a968: e037883a mov sp,fp - a96c: dfc00117 ldw ra,4(sp) - a970: df000017 ldw fp,0(sp) - a974: dec00204 addi sp,sp,8 - a978: f800283a ret - -0000a97c : - * - * ALT_ISATTY is mapped onto the isatty() system call in alt_syscall.h - */ - -int ALT_ISATTY (int file) -{ - a97c: deffeb04 addi sp,sp,-84 - a980: dfc01415 stw ra,80(sp) - a984: df001315 stw fp,76(sp) - a988: df001304 addi fp,sp,76 - a98c: e13ffd15 stw r4,-12(fp) - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - a990: e0bffd17 ldw r2,-12(fp) - a994: 1004803a cmplt r2,r2,zero - a998: 1000091e bne r2,zero,a9c0 - a99c: e13ffd17 ldw r4,-12(fp) - a9a0: 01400304 movi r5,12 - a9a4: 0009fc80 call 9fc8 <__mulsi3> - a9a8: 1007883a mov r3,r2 - a9ac: 00800074 movhi r2,1 - a9b0: 10bbf204 addi r2,r2,-4152 - a9b4: 1887883a add r3,r3,r2 - a9b8: e0ffff15 stw r3,-4(fp) - a9bc: 00000106 br a9c4 - a9c0: e03fff15 stw zero,-4(fp) - a9c4: e0bfff17 ldw r2,-4(fp) - a9c8: e0bfed15 stw r2,-76(fp) - - if (fd) - a9cc: e0bfed17 ldw r2,-76(fp) - a9d0: 1005003a cmpeq r2,r2,zero - a9d4: 10000f1e bne r2,zero,aa14 - /* - * If a device driver does not provide an fstat() function, then it is - * treated as a terminal device by default. - */ - - if (!fd->dev->fstat) - a9d8: e0bfed17 ldw r2,-76(fp) - a9dc: 10800017 ldw r2,0(r2) - a9e0: 10800817 ldw r2,32(r2) - a9e4: 1004c03a cmpne r2,r2,zero - a9e8: 1000031e bne r2,zero,a9f8 - { - return 1; - a9ec: 00800044 movi r2,1 - a9f0: e0bffe15 stw r2,-8(fp) - a9f4: 00000c06 br aa28 - * this is called so that the device can identify itself. - */ - - else - { - fstat (file, &stat); - a9f8: e17fee04 addi r5,fp,-72 - a9fc: e13ffd17 ldw r4,-12(fp) - aa00: 000a8440 call a844 - return (stat.st_mode == _IFCHR) ? 1 : 0; - aa04: e0bfef17 ldw r2,-68(fp) - aa08: 10880020 cmpeqi r2,r2,8192 - aa0c: e0bffe15 stw r2,-8(fp) - aa10: 00000506 br aa28 - } - } - else - { - ALT_ERRNO = EBADFD; - aa14: 000aa400 call aa40 - aa18: 1007883a mov r3,r2 - aa1c: 00801444 movi r2,81 - aa20: 18800015 stw r2,0(r3) - return 0; - aa24: e03ffe15 stw zero,-8(fp) - aa28: e0bffe17 ldw r2,-8(fp) - } -} - aa2c: e037883a mov sp,fp - aa30: dfc00117 ldw ra,4(sp) - aa34: df000017 ldw fp,0(sp) - aa38: dec00204 addi sp,sp,8 - aa3c: f800283a ret - -0000aa40 : -#undef errno - -extern int errno; - -static ALT_INLINE int* alt_get_errno(void) -{ - aa40: defffd04 addi sp,sp,-12 - aa44: dfc00215 stw ra,8(sp) - aa48: df000115 stw fp,4(sp) - aa4c: df000104 addi fp,sp,4 - return ((alt_errno) ? alt_errno() : &errno); - aa50: 00800074 movhi r2,1 - aa54: 1080bd04 addi r2,r2,756 - aa58: 10800017 ldw r2,0(r2) - aa5c: 1005003a cmpeq r2,r2,zero - aa60: 1000061e bne r2,zero,aa7c - aa64: 00800074 movhi r2,1 - aa68: 1080bd04 addi r2,r2,756 - aa6c: 10800017 ldw r2,0(r2) - aa70: 103ee83a callr r2 - aa74: e0bfff15 stw r2,-4(fp) - aa78: 00000306 br aa88 - aa7c: 00800074 movhi r2,1 - aa80: 1087a504 addi r2,r2,7828 - aa84: e0bfff15 stw r2,-4(fp) - aa88: e0bfff17 ldw r2,-4(fp) -} - aa8c: e037883a mov sp,fp - aa90: dfc00117 ldw ra,4(sp) - aa94: df000017 ldw fp,0(sp) - aa98: dec00204 addi sp,sp,8 - aa9c: f800283a ret - -0000aaa0 : - * there is no bootloader, so this application is responsible for loading to - * RAM any sections that are required. - */ - -void alt_load (void) -{ - aaa0: defffe04 addi sp,sp,-8 - aaa4: dfc00115 stw ra,4(sp) - aaa8: df000015 stw fp,0(sp) - aaac: d839883a mov fp,sp - /* - * Copy the .rwdata section. - */ - - alt_load_section (&__flash_rwdata_start, - aab0: 01000074 movhi r4,1 - aab4: 2100c404 addi r4,r4,784 - aab8: 01400074 movhi r5,1 - aabc: 2979e304 addi r5,r5,-6260 - aac0: 01800074 movhi r6,1 - aac4: 3180c404 addi r6,r6,784 - aac8: 000ab200 call ab20 - - /* - * Copy the exception handler. - */ - - alt_load_section (&__flash_exceptions_start, - aacc: 01000034 movhi r4,0 - aad0: 21000804 addi r4,r4,32 - aad4: 01400034 movhi r5,0 - aad8: 29400804 addi r5,r5,32 - aadc: 01800034 movhi r6,0 - aae0: 31806d04 addi r6,r6,436 - aae4: 000ab200 call ab20 - - /* - * Copy the .rodata section. - */ - - alt_load_section (&__flash_rodata_start, - aae8: 01000074 movhi r4,1 - aaec: 21385704 addi r4,r4,-7844 - aaf0: 01400074 movhi r5,1 - aaf4: 29785704 addi r5,r5,-7844 - aaf8: 01800074 movhi r6,1 - aafc: 31b9e304 addi r6,r6,-6260 - ab00: 000ab200 call ab20 - - /* - * Now ensure that the caches are in synch. - */ - - alt_dcache_flush_all(); - ab04: 000d14c0 call d14c - alt_icache_flush_all(); - ab08: 000d5c80 call d5c8 -} - ab0c: e037883a mov sp,fp - ab10: dfc00117 ldw ra,4(sp) - ab14: df000017 ldw fp,0(sp) - ab18: dec00204 addi sp,sp,8 - ab1c: f800283a ret - -0000ab20 : - */ - -static void ALT_INLINE alt_load_section (alt_u32* from, - alt_u32* to, - alt_u32* end) -{ - ab20: defffc04 addi sp,sp,-16 - ab24: df000315 stw fp,12(sp) - ab28: df000304 addi fp,sp,12 - ab2c: e13ffd15 stw r4,-12(fp) - ab30: e17ffe15 stw r5,-8(fp) - ab34: e1bfff15 stw r6,-4(fp) - if (to != from) - ab38: e0fffe17 ldw r3,-8(fp) - ab3c: e0bffd17 ldw r2,-12(fp) - ab40: 18800e26 beq r3,r2,ab7c - { - while( to != end ) - ab44: 00000a06 br ab70 - { - *to++ = *from++; - ab48: e0bffd17 ldw r2,-12(fp) - ab4c: 10c00017 ldw r3,0(r2) - ab50: e0bffe17 ldw r2,-8(fp) - ab54: 10c00015 stw r3,0(r2) - ab58: e0bffe17 ldw r2,-8(fp) - ab5c: 10800104 addi r2,r2,4 - ab60: e0bffe15 stw r2,-8(fp) - ab64: e0bffd17 ldw r2,-12(fp) - ab68: 10800104 addi r2,r2,4 - ab6c: e0bffd15 stw r2,-12(fp) - alt_u32* to, - alt_u32* end) -{ - if (to != from) - { - while( to != end ) - ab70: e0fffe17 ldw r3,-8(fp) - ab74: e0bfff17 ldw r2,-4(fp) - ab78: 18bff31e bne r3,r2,ab48 - { - *to++ = *from++; - } - } -} - ab7c: e037883a mov sp,fp - ab80: df000017 ldw fp,0(sp) - ab84: dec00104 addi sp,sp,4 - ab88: f800283a ret - -0000ab8c : - * ALT_LSEEK is mapped onto the lseek() system call in alt_syscall.h - * - */ - -off_t ALT_LSEEK (int file, off_t ptr, int dir) -{ - ab8c: defff804 addi sp,sp,-32 - ab90: dfc00715 stw ra,28(sp) - ab94: df000615 stw fp,24(sp) - ab98: df000604 addi fp,sp,24 - ab9c: e13ffc15 stw r4,-16(fp) - aba0: e17ffd15 stw r5,-12(fp) - aba4: e1bffe15 stw r6,-8(fp) - alt_fd* fd; - off_t rc = 0; - aba8: e03ffa15 stw zero,-24(fp) - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - abac: e0bffc17 ldw r2,-16(fp) - abb0: 1004803a cmplt r2,r2,zero - abb4: 1000091e bne r2,zero,abdc - abb8: e13ffc17 ldw r4,-16(fp) - abbc: 01400304 movi r5,12 - abc0: 0009fc80 call 9fc8 <__mulsi3> - abc4: 1007883a mov r3,r2 - abc8: 00800074 movhi r2,1 - abcc: 10bbf204 addi r2,r2,-4152 - abd0: 1887883a add r3,r3,r2 - abd4: e0ffff15 stw r3,-4(fp) - abd8: 00000106 br abe0 - abdc: e03fff15 stw zero,-4(fp) - abe0: e0bfff17 ldw r2,-4(fp) - abe4: e0bffb15 stw r2,-20(fp) - - if (fd) - abe8: e0bffb17 ldw r2,-20(fp) - abec: 1005003a cmpeq r2,r2,zero - abf0: 1000111e bne r2,zero,ac38 - /* - * If the device driver provides an implementation of the lseek() function, - * then call that to process the request. - */ - - if (fd->dev->lseek) - abf4: e0bffb17 ldw r2,-20(fp) - abf8: 10800017 ldw r2,0(r2) - abfc: 10800717 ldw r2,28(r2) - ac00: 1005003a cmpeq r2,r2,zero - ac04: 1000091e bne r2,zero,ac2c - { - rc = fd->dev->lseek(fd, ptr, dir); - ac08: e0bffb17 ldw r2,-20(fp) - ac0c: 10800017 ldw r2,0(r2) - ac10: 10800717 ldw r2,28(r2) - ac14: e13ffb17 ldw r4,-20(fp) - ac18: e17ffd17 ldw r5,-12(fp) - ac1c: e1bffe17 ldw r6,-8(fp) - ac20: 103ee83a callr r2 - ac24: e0bffa15 stw r2,-24(fp) - ac28: 00000506 br ac40 - * Otherwise return an error. - */ - - else - { - rc = -ENOTSUP; - ac2c: 00bfde84 movi r2,-134 - ac30: e0bffa15 stw r2,-24(fp) - ac34: 00000206 br ac40 - } - } - else - { - rc = -EBADFD; - ac38: 00bfebc4 movi r2,-81 - ac3c: e0bffa15 stw r2,-24(fp) - } - - if (rc < 0) - ac40: e0bffa17 ldw r2,-24(fp) - ac44: 1004403a cmpge r2,r2,zero - ac48: 1000071e bne r2,zero,ac68 - { - ALT_ERRNO = -rc; - ac4c: 000ac800 call ac80 - ac50: 1007883a mov r3,r2 - ac54: e0bffa17 ldw r2,-24(fp) - ac58: 0085c83a sub r2,zero,r2 - ac5c: 18800015 stw r2,0(r3) - rc = -1; - ac60: 00bfffc4 movi r2,-1 - ac64: e0bffa15 stw r2,-24(fp) - } - - return rc; - ac68: e0bffa17 ldw r2,-24(fp) -} - ac6c: e037883a mov sp,fp - ac70: dfc00117 ldw ra,4(sp) - ac74: df000017 ldw fp,0(sp) - ac78: dec00204 addi sp,sp,8 - ac7c: f800283a ret - -0000ac80 : -#undef errno - -extern int errno; - -static ALT_INLINE int* alt_get_errno(void) -{ - ac80: defffd04 addi sp,sp,-12 - ac84: dfc00215 stw ra,8(sp) - ac88: df000115 stw fp,4(sp) - ac8c: df000104 addi fp,sp,4 - return ((alt_errno) ? alt_errno() : &errno); - ac90: 00800074 movhi r2,1 - ac94: 1080bd04 addi r2,r2,756 - ac98: 10800017 ldw r2,0(r2) - ac9c: 1005003a cmpeq r2,r2,zero - aca0: 1000061e bne r2,zero,acbc - aca4: 00800074 movhi r2,1 - aca8: 1080bd04 addi r2,r2,756 - acac: 10800017 ldw r2,0(r2) - acb0: 103ee83a callr r2 - acb4: e0bfff15 stw r2,-4(fp) - acb8: 00000306 br acc8 - acbc: 00800074 movhi r2,1 - acc0: 1087a504 addi r2,r2,7828 - acc4: e0bfff15 stw r2,-4(fp) - acc8: e0bfff17 ldw r2,-4(fp) -} - accc: e037883a mov sp,fp - acd0: dfc00117 ldw ra,4(sp) - acd4: df000017 ldw fp,0(sp) - acd8: dec00204 addi sp,sp,8 - acdc: f800283a ret - -0000ace0 : - * devices/filesystems/components in the system; and call the entry point for - * the users application, i.e. main(). - */ - -void alt_main (void) -{ - ace0: defffd04 addi sp,sp,-12 - ace4: dfc00215 stw ra,8(sp) - ace8: df000115 stw fp,4(sp) - acec: df000104 addi fp,sp,4 -#endif - - /* ALT LOG - please see HAL/sys/alt_log_printf.h for details */ - ALT_LOG_PRINT_BOOT("[alt_main.c] Entering alt_main, calling alt_irq_init.\r\n"); - /* Initialize the interrupt controller. */ - alt_irq_init (NULL); - acf0: 0009883a mov r4,zero - acf4: 000b4ac0 call b4ac - ALT_LOG_PRINT_BOOT("[alt_main.c] Done OS Init, calling alt_sem_create.\r\n"); - ALT_SEM_CREATE (&alt_fd_list_lock, 1); - - /* Initialize the device drivers/software components. */ - ALT_LOG_PRINT_BOOT("[alt_main.c] Calling alt_sys_init.\r\n"); - alt_sys_init(); - acf8: 000b4e00 call b4e0 - * devices be present (not equal to /dev/null) and if direct drivers - * aren't being used. - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Redirecting IO.\r\n"); - alt_io_redirect(ALT_STDOUT, ALT_STDIN, ALT_STDERR); - acfc: 01000074 movhi r4,1 - ad00: 21393504 addi r4,r4,-6956 - ad04: 01400074 movhi r5,1 - ad08: 29793504 addi r5,r5,-6956 - ad0c: 01800074 movhi r6,1 - ad10: 31b93504 addi r6,r6,-6956 - ad14: 000d9880 call d988 - /* - * Call the C++ constructors - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Calling C++ constructors.\r\n"); - _do_ctors (); - ad18: 000d27c0 call d27c <_do_ctors> - * redefined as _exit()). This is in the interest of reducing code footprint, - * in that the atexit() overhead is removed when it's not needed. - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Calling atexit.\r\n"); - atexit (_do_dtors); - ad1c: 01000074 movhi r4,1 - ad20: 2134b804 addi r4,r4,-11552 - ad24: 000dd500 call dd50 - ALT_LOG_PRINT_BOOT("[alt_main.c] Calling main.\r\n"); - -#ifdef ALT_NO_EXIT - main (alt_argc, alt_argv, alt_envp); -#else - result = main (alt_argc, alt_argv, alt_envp); - ad28: d126fa17 ldw r4,-25624(gp) - ad2c: d166fb17 ldw r5,-25620(gp) - ad30: d1a6fc17 ldw r6,-25616(gp) - ad34: 00001f00 call 1f0
- ad38: e0bfff15 stw r2,-4(fp) - close(STDOUT_FILENO); - ad3c: 01000044 movi r4,1 - ad40: 000a6b80 call a6b8 - exit (result); - ad44: e13fff17 ldw r4,-4(fp) - ad48: 000dd640 call dd64 - -0000ad4c <__malloc_lock>: - * configuration is single threaded, so there is nothing to do here. Note that - * this requires that malloc is never called by an interrupt service routine. - */ - -void __malloc_lock ( struct _reent *_r ) -{ - ad4c: defffe04 addi sp,sp,-8 - ad50: df000115 stw fp,4(sp) - ad54: df000104 addi fp,sp,4 - ad58: e13fff15 stw r4,-4(fp) -} - ad5c: e037883a mov sp,fp - ad60: df000017 ldw fp,0(sp) - ad64: dec00104 addi sp,sp,4 - ad68: f800283a ret - -0000ad6c <__malloc_unlock>: -/* - * - */ - -void __malloc_unlock ( struct _reent *_r ) -{ - ad6c: defffe04 addi sp,sp,-8 - ad70: df000115 stw fp,4(sp) - ad74: df000104 addi fp,sp,4 - ad78: e13fff15 stw r4,-4(fp) -} - ad7c: e037883a mov sp,fp - ad80: df000017 ldw fp,0(sp) - ad84: dec00104 addi sp,sp,4 - ad88: f800283a ret - -0000ad8c : - * performed for devices. Filesystems are required to handle the ioctl() call - * themselves, and report the error from the filesystems open() function. - */ - -static int alt_file_locked (alt_fd* fd) -{ - ad8c: defffa04 addi sp,sp,-24 - ad90: dfc00515 stw ra,20(sp) - ad94: df000415 stw fp,16(sp) - ad98: dc000315 stw r16,12(sp) - ad9c: df000304 addi fp,sp,12 - ada0: e13ffe15 stw r4,-8(fp) - - /* - * Mark the file descriptor as belonging to a device. - */ - - fd->fd_flags |= ALT_FD_DEV; - ada4: e0bffe17 ldw r2,-8(fp) - ada8: 10800217 ldw r2,8(r2) - adac: 10d00034 orhi r3,r2,16384 - adb0: e0bffe17 ldw r2,-8(fp) - adb4: 10c00215 stw r3,8(r2) - /* - * Loop through all current file descriptors searching for one that's locked - * for exclusive access. If a match is found, generate an error. - */ - - for (i = 0; i <= alt_max_fd; i++) - adb8: e03ffd15 stw zero,-12(fp) - adbc: 00002306 br ae4c - { - if ((alt_fd_list[i].dev == fd->dev) && - adc0: e13ffd17 ldw r4,-12(fp) - adc4: 04000074 movhi r16,1 - adc8: 843bf204 addi r16,r16,-4152 - adcc: 01400304 movi r5,12 - add0: 0009fc80 call 9fc8 <__mulsi3> - add4: 1405883a add r2,r2,r16 - add8: 10c00017 ldw r3,0(r2) - addc: e0bffe17 ldw r2,-8(fp) - ade0: 10800017 ldw r2,0(r2) - ade4: 1880161e bne r3,r2,ae40 - ade8: e13ffd17 ldw r4,-12(fp) - adec: 04000074 movhi r16,1 - adf0: 843bf204 addi r16,r16,-4152 - adf4: 01400304 movi r5,12 - adf8: 0009fc80 call 9fc8 <__mulsi3> - adfc: 1405883a add r2,r2,r16 - ae00: 10800204 addi r2,r2,8 - ae04: 10800017 ldw r2,0(r2) - ae08: 1004403a cmpge r2,r2,zero - ae0c: 10000c1e bne r2,zero,ae40 - ae10: e13ffd17 ldw r4,-12(fp) - ae14: 01400304 movi r5,12 - ae18: 0009fc80 call 9fc8 <__mulsi3> - ae1c: 1007883a mov r3,r2 - ae20: 00800074 movhi r2,1 - ae24: 10bbf204 addi r2,r2,-4152 - ae28: 1887883a add r3,r3,r2 - ae2c: e0bffe17 ldw r2,-8(fp) - ae30: 18800326 beq r3,r2,ae40 - (alt_fd_list[i].fd_flags & ALT_FD_EXCL) && - (&alt_fd_list[i] != fd)) - { - return -EACCES; - ae34: 00bffcc4 movi r2,-13 - ae38: e0bfff15 stw r2,-4(fp) - ae3c: 00000a06 br ae68 - /* - * Loop through all current file descriptors searching for one that's locked - * for exclusive access. If a match is found, generate an error. - */ - - for (i = 0; i <= alt_max_fd; i++) - ae40: e0bffd17 ldw r2,-12(fp) - ae44: 10800044 addi r2,r2,1 - ae48: e0bffd15 stw r2,-12(fp) - ae4c: 00800074 movhi r2,1 - ae50: 1080bc04 addi r2,r2,752 - ae54: 10800017 ldw r2,0(r2) - ae58: 1007883a mov r3,r2 - ae5c: e0bffd17 ldw r2,-12(fp) - ae60: 18bfd72e bgeu r3,r2,adc0 - } - } - - /* The device is not locked */ - - return 0; - ae64: e03fff15 stw zero,-4(fp) - ae68: e0bfff17 ldw r2,-4(fp) -} - ae6c: e037883a mov sp,fp - ae70: dfc00217 ldw ra,8(sp) - ae74: df000117 ldw fp,4(sp) - ae78: dc000017 ldw r16,0(sp) - ae7c: dec00304 addi sp,sp,12 - ae80: f800283a ret - -0000ae84 : - * - * ALT_OPEN is mapped onto the open() system call in alt_syscall.h - */ - -int ALT_OPEN (const char* file, int flags, int mode) -{ - ae84: defff404 addi sp,sp,-48 - ae88: dfc00b15 stw ra,44(sp) - ae8c: df000a15 stw fp,40(sp) - ae90: df000a04 addi fp,sp,40 - ae94: e13ffb15 stw r4,-20(fp) - ae98: e17ffc15 stw r5,-16(fp) - ae9c: e1bffd15 stw r6,-12(fp) - alt_dev* dev; - alt_fd* fd; - int index = -1; - aea0: 00bfffc4 movi r2,-1 - aea4: e0bff815 stw r2,-32(fp) - int status = -ENODEV; - aea8: 00bffb44 movi r2,-19 - aeac: e0bff715 stw r2,-36(fp) - int isafs = 0; - aeb0: e03ff615 stw zero,-40(fp) - /* - * Check the device list, to see if a device with a matching name is - * registered. - */ - - if (!(dev = alt_find_dev (file, &alt_dev_list))) - aeb4: e13ffb17 ldw r4,-20(fp) - aeb8: 01400074 movhi r5,1 - aebc: 2940ba04 addi r5,r5,744 - aec0: 000d3440 call d344 - aec4: e0bffa15 stw r2,-24(fp) - aec8: e0bffa17 ldw r2,-24(fp) - aecc: 1004c03a cmpne r2,r2,zero - aed0: 1000051e bne r2,zero,aee8 - { - /* No matching device, so try the filesystem list */ - - dev = alt_find_file (file); - aed4: e13ffb17 ldw r4,-20(fp) - aed8: 000d3d80 call d3d8 - aedc: e0bffa15 stw r2,-24(fp) - isafs = 1; - aee0: 00800044 movi r2,1 - aee4: e0bff615 stw r2,-40(fp) - - /* - * If a matching device or filesystem is found, allocate a file descriptor. - */ - - if (dev) - aee8: e0bffa17 ldw r2,-24(fp) - aeec: 1005003a cmpeq r2,r2,zero - aef0: 1000311e bne r2,zero,afb8 - { - if ((index = alt_get_fd (dev)) < 0) - aef4: e13ffa17 ldw r4,-24(fp) - aef8: 000d4f80 call d4f8 - aefc: e0bff815 stw r2,-32(fp) - af00: e0bff817 ldw r2,-32(fp) - af04: 1004403a cmpge r2,r2,zero - af08: 1000031e bne r2,zero,af18 - { - status = index; - af0c: e0bff817 ldw r2,-32(fp) - af10: e0bff715 stw r2,-36(fp) - af14: 00002a06 br afc0 - } - else - { - fd = &alt_fd_list[index]; - af18: e13ff817 ldw r4,-32(fp) - af1c: 01400304 movi r5,12 - af20: 0009fc80 call 9fc8 <__mulsi3> - af24: 1007883a mov r3,r2 - af28: 00800074 movhi r2,1 - af2c: 10bbf204 addi r2,r2,-4152 - af30: 1885883a add r2,r3,r2 - af34: e0bff915 stw r2,-28(fp) - fd->fd_flags = (flags & ~ALT_FD_FLAGS_MASK); - af38: e0fffc17 ldw r3,-16(fp) - af3c: 00900034 movhi r2,16384 - af40: 10bfffc4 addi r2,r2,-1 - af44: 1886703a and r3,r3,r2 - af48: e0bff917 ldw r2,-28(fp) - af4c: 10c00215 stw r3,8(r2) - - /* If this is a device, ensure it isn't already locked */ - - if (isafs || ((status = alt_file_locked (fd)) >= 0)) - af50: e0bff617 ldw r2,-40(fp) - af54: 1004c03a cmpne r2,r2,zero - af58: 1000061e bne r2,zero,af74 - af5c: e13ff917 ldw r4,-28(fp) - af60: 000ad8c0 call ad8c - af64: e0bff715 stw r2,-36(fp) - af68: e0bff717 ldw r2,-36(fp) - af6c: 1004803a cmplt r2,r2,zero - af70: 1000131e bne r2,zero,afc0 - /* - * If the device or filesystem provides an open() callback function, - * call it now to perform any device/filesystem specific operations. - */ - - status = (dev->open) ? dev->open(fd, file, flags, mode): 0; - af74: e0bffa17 ldw r2,-24(fp) - af78: 10800317 ldw r2,12(r2) - af7c: 1005003a cmpeq r2,r2,zero - af80: 1000091e bne r2,zero,afa8 - af84: e0bffa17 ldw r2,-24(fp) - af88: 10800317 ldw r2,12(r2) - af8c: e13ff917 ldw r4,-28(fp) - af90: e17ffb17 ldw r5,-20(fp) - af94: e1bffc17 ldw r6,-16(fp) - af98: e1fffd17 ldw r7,-12(fp) - af9c: 103ee83a callr r2 - afa0: e0bfff15 stw r2,-4(fp) - afa4: 00000106 br afac - afa8: e03fff15 stw zero,-4(fp) - afac: e0bfff17 ldw r2,-4(fp) - afb0: e0bff715 stw r2,-36(fp) - afb4: 00000206 br afc0 - } - } - } - else - { - status = -ENODEV; - afb8: 00bffb44 movi r2,-19 - afbc: e0bff715 stw r2,-36(fp) - } - - /* Allocation failed, so clean up and return an error */ - - if (status < 0) - afc0: e0bff717 ldw r2,-36(fp) - afc4: 1004403a cmpge r2,r2,zero - afc8: 1000091e bne r2,zero,aff0 - { - alt_release_fd (index); - afcc: e13ff817 ldw r4,-32(fp) - afd0: 000b1f40 call b1f4 - ALT_ERRNO = -status; - afd4: 000b0100 call b010 - afd8: e0fff717 ldw r3,-36(fp) - afdc: 00c7c83a sub r3,zero,r3 - afe0: 10c00015 stw r3,0(r2) - return -1; - afe4: 00bfffc4 movi r2,-1 - afe8: e0bffe15 stw r2,-8(fp) - afec: 00000206 br aff8 - } - - /* return the reference upon success */ - - return index; - aff0: e0bff817 ldw r2,-32(fp) - aff4: e0bffe15 stw r2,-8(fp) - aff8: e0bffe17 ldw r2,-8(fp) -} - affc: e037883a mov sp,fp - b000: dfc00117 ldw ra,4(sp) - b004: df000017 ldw fp,0(sp) - b008: dec00204 addi sp,sp,8 - b00c: f800283a ret - -0000b010 : -#undef errno - -extern int errno; - -static ALT_INLINE int* alt_get_errno(void) -{ - b010: defffd04 addi sp,sp,-12 - b014: dfc00215 stw ra,8(sp) - b018: df000115 stw fp,4(sp) - b01c: df000104 addi fp,sp,4 - return ((alt_errno) ? alt_errno() : &errno); - b020: 00800074 movhi r2,1 - b024: 1080bd04 addi r2,r2,756 - b028: 10800017 ldw r2,0(r2) - b02c: 1005003a cmpeq r2,r2,zero - b030: 1000061e bne r2,zero,b04c - b034: 00800074 movhi r2,1 - b038: 1080bd04 addi r2,r2,756 - b03c: 10800017 ldw r2,0(r2) - b040: 103ee83a callr r2 - b044: e0bfff15 stw r2,-4(fp) - b048: 00000306 br b058 - b04c: 00800074 movhi r2,1 - b050: 1087a504 addi r2,r2,7828 - b054: e0bfff15 stw r2,-4(fp) - b058: e0bfff17 ldw r2,-4(fp) -} - b05c: e037883a mov sp,fp - b060: dfc00117 ldw ra,4(sp) - b064: df000017 ldw fp,0(sp) - b068: dec00204 addi sp,sp,8 - b06c: f800283a ret - -0000b070 : -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -int ALT_READ (int file, void *ptr, size_t len) -{ - b070: defff704 addi sp,sp,-36 - b074: dfc00815 stw ra,32(sp) - b078: df000715 stw fp,28(sp) - b07c: df000704 addi fp,sp,28 - b080: e13ffb15 stw r4,-20(fp) - b084: e17ffc15 stw r5,-16(fp) - b088: e1bffd15 stw r6,-12(fp) - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - b08c: e0bffb17 ldw r2,-20(fp) - b090: 1004803a cmplt r2,r2,zero - b094: 1000091e bne r2,zero,b0bc - b098: e13ffb17 ldw r4,-20(fp) - b09c: 01400304 movi r5,12 - b0a0: 0009fc80 call 9fc8 <__mulsi3> - b0a4: 1007883a mov r3,r2 - b0a8: 00800074 movhi r2,1 - b0ac: 10bbf204 addi r2,r2,-4152 - b0b0: 1887883a add r3,r3,r2 - b0b4: e0ffff15 stw r3,-4(fp) - b0b8: 00000106 br b0c0 - b0bc: e03fff15 stw zero,-4(fp) - b0c0: e0bfff17 ldw r2,-4(fp) - b0c4: e0bffa15 stw r2,-24(fp) - - if (fd) - b0c8: e0bffa17 ldw r2,-24(fp) - b0cc: 1005003a cmpeq r2,r2,zero - b0d0: 1000241e bne r2,zero,b164 - * If the file has not been opened with read access, or if the driver does - * not provide an implementation of read(), generate an error. Otherwise - * call the drivers read() function to process the request. - */ - - if (((fd->fd_flags & O_ACCMODE) != O_WRONLY) && - b0d4: e0bffa17 ldw r2,-24(fp) - b0d8: 10800217 ldw r2,8(r2) - b0dc: 108000cc andi r2,r2,3 - b0e0: 10800060 cmpeqi r2,r2,1 - b0e4: 10001a1e bne r2,zero,b150 - b0e8: e0bffa17 ldw r2,-24(fp) - b0ec: 10800017 ldw r2,0(r2) - b0f0: 10800517 ldw r2,20(r2) - b0f4: 1005003a cmpeq r2,r2,zero - b0f8: 1000151e bne r2,zero,b150 - (fd->dev->read)) - { - if ((rval = fd->dev->read(fd, ptr, len)) < 0) - b0fc: e0bffa17 ldw r2,-24(fp) - b100: 10800017 ldw r2,0(r2) - b104: 10800517 ldw r2,20(r2) - b108: e17ffc17 ldw r5,-16(fp) - b10c: e1bffd17 ldw r6,-12(fp) - b110: e13ffa17 ldw r4,-24(fp) - b114: 103ee83a callr r2 - b118: e0bff915 stw r2,-28(fp) - b11c: e0bff917 ldw r2,-28(fp) - b120: 1004403a cmpge r2,r2,zero - b124: 1000071e bne r2,zero,b144 - { - ALT_ERRNO = -rval; - b128: 000b1940 call b194 - b12c: e0fff917 ldw r3,-28(fp) - b130: 00c7c83a sub r3,zero,r3 - b134: 10c00015 stw r3,0(r2) - return -1; - b138: 00bfffc4 movi r2,-1 - b13c: e0bffe15 stw r2,-8(fp) - b140: 00000e06 br b17c - } - return rval; - b144: e0bff917 ldw r2,-28(fp) - b148: e0bffe15 stw r2,-8(fp) - b14c: 00000b06 br b17c - } - else - { - ALT_ERRNO = EACCES; - b150: 000b1940 call b194 - b154: 1007883a mov r3,r2 - b158: 00800344 movi r2,13 - b15c: 18800015 stw r2,0(r3) - b160: 00000406 br b174 - } - } - else - { - ALT_ERRNO = EBADFD; - b164: 000b1940 call b194 - b168: 1007883a mov r3,r2 - b16c: 00801444 movi r2,81 - b170: 18800015 stw r2,0(r3) - } - return -1; - b174: 00bfffc4 movi r2,-1 - b178: e0bffe15 stw r2,-8(fp) - b17c: e0bffe17 ldw r2,-8(fp) -} - b180: e037883a mov sp,fp - b184: dfc00117 ldw ra,4(sp) - b188: df000017 ldw fp,0(sp) - b18c: dec00204 addi sp,sp,8 - b190: f800283a ret - -0000b194 : -#undef errno - -extern int errno; - -static ALT_INLINE int* alt_get_errno(void) -{ - b194: defffd04 addi sp,sp,-12 - b198: dfc00215 stw ra,8(sp) - b19c: df000115 stw fp,4(sp) - b1a0: df000104 addi fp,sp,4 - return ((alt_errno) ? alt_errno() : &errno); - b1a4: 00800074 movhi r2,1 - b1a8: 1080bd04 addi r2,r2,756 - b1ac: 10800017 ldw r2,0(r2) - b1b0: 1005003a cmpeq r2,r2,zero - b1b4: 1000061e bne r2,zero,b1d0 - b1b8: 00800074 movhi r2,1 - b1bc: 1080bd04 addi r2,r2,756 - b1c0: 10800017 ldw r2,0(r2) - b1c4: 103ee83a callr r2 - b1c8: e0bfff15 stw r2,-4(fp) - b1cc: 00000306 br b1dc - b1d0: 00800074 movhi r2,1 - b1d4: 1087a504 addi r2,r2,7828 - b1d8: e0bfff15 stw r2,-4(fp) - b1dc: e0bfff17 ldw r2,-4(fp) -} - b1e0: e037883a mov sp,fp - b1e4: dfc00117 ldw ra,4(sp) - b1e8: df000017 ldw fp,0(sp) - b1ec: dec00204 addi sp,sp,8 - b1f0: f800283a ret - -0000b1f4 : - * File descriptors correcponding to standard in, standard out and standard - * error cannont be released backed to the pool. They are always reserved. - */ - -void alt_release_fd (int fd) -{ - b1f4: defffc04 addi sp,sp,-16 - b1f8: dfc00315 stw ra,12(sp) - b1fc: df000215 stw fp,8(sp) - b200: dc000115 stw r16,4(sp) - b204: df000104 addi fp,sp,4 - b208: e13fff15 stw r4,-4(fp) - if (fd > 2) - b20c: e0bfff17 ldw r2,-4(fp) - b210: 108000d0 cmplti r2,r2,3 - b214: 10000f1e bne r2,zero,b254 - { - alt_fd_list[fd].fd_flags = 0; - b218: e13fff17 ldw r4,-4(fp) - b21c: 04000074 movhi r16,1 - b220: 843bf204 addi r16,r16,-4152 - b224: 01400304 movi r5,12 - b228: 0009fc80 call 9fc8 <__mulsi3> - b22c: 1405883a add r2,r2,r16 - b230: 10800204 addi r2,r2,8 - b234: 10000015 stw zero,0(r2) - alt_fd_list[fd].dev = 0; - b238: e13fff17 ldw r4,-4(fp) - b23c: 04000074 movhi r16,1 - b240: 843bf204 addi r16,r16,-4152 - b244: 01400304 movi r5,12 - b248: 0009fc80 call 9fc8 <__mulsi3> - b24c: 1405883a add r2,r2,r16 - b250: 10000015 stw zero,0(r2) - } -} - b254: e037883a mov sp,fp - b258: dfc00217 ldw ra,8(sp) - b25c: df000117 ldw fp,4(sp) - b260: dc000017 ldw r16,0(sp) - b264: dec00304 addi sp,sp,12 - b268: f800283a ret - -0000b26c : -#endif - -caddr_t ALT_SBRK (int incr) __attribute__ ((no_instrument_function )); - -caddr_t ALT_SBRK (int incr) -{ - b26c: defff804 addi sp,sp,-32 - b270: df000715 stw fp,28(sp) - b274: df000704 addi fp,sp,28 - b278: e13ffe15 stw r4,-8(fp) -static ALT_INLINE alt_irq_context ALT_ALWAYS_INLINE - alt_irq_disable_all (void) -{ - alt_irq_context context; - - NIOS2_READ_STATUS (context); - b27c: 0005303a rdctl r2,status - b280: e0bffb15 stw r2,-20(fp) - - NIOS2_WRITE_STATUS (context & ~NIOS2_STATUS_PIE_MSK); - b284: e0fffb17 ldw r3,-20(fp) - b288: 00bfff84 movi r2,-2 - b28c: 1884703a and r2,r3,r2 - b290: 1001703a wrctl status,r2 - - return context; - b294: e0bffb17 ldw r2,-20(fp) - alt_irq_context context; - char *prev_heap_end; - - context = alt_irq_disable_all(); - b298: e0bffd15 stw r2,-12(fp) - - /* Always return data aligned on a word boundary */ - heap_end = (char *)(((unsigned int)heap_end + 3) & ~3); - b29c: d0a00c17 ldw r2,-32720(gp) - b2a0: 10c000c4 addi r3,r2,3 - b2a4: 00bfff04 movi r2,-4 - b2a8: 1884703a and r2,r3,r2 - b2ac: d0a00c15 stw r2,-32720(gp) - if (((heap_end + incr) - __alt_heap_start) > ALT_MAX_HEAP_BYTES) { - alt_irq_enable_all(context); - return (caddr_t)-1; - } -#else - if ((heap_end + incr) > __alt_heap_limit) { - b2b0: d0e00c17 ldw r3,-32720(gp) - b2b4: e0bffe17 ldw r2,-8(fp) - b2b8: 1887883a add r3,r3,r2 - b2bc: 008000f4 movhi r2,3 - b2c0: 10880004 addi r2,r2,8192 - b2c4: 10c0072e bgeu r2,r3,b2e4 - b2c8: e0bffd17 ldw r2,-12(fp) - b2cc: e0bffa15 stw r2,-24(fp) - status &= ~NIOS2_STATUS_PIE_MSK; - status |= (context & NIOS2_STATUS_PIE_MSK); - - NIOS2_WRITE_STATUS (status); -#else - NIOS2_WRITE_STATUS (context); - b2d0: e0bffa17 ldw r2,-24(fp) - b2d4: 1001703a wrctl status,r2 - alt_irq_enable_all(context); - return (caddr_t)-1; - b2d8: 00bfffc4 movi r2,-1 - b2dc: e0bfff15 stw r2,-4(fp) - b2e0: 00000c06 br b314 - } -#endif - - prev_heap_end = heap_end; - b2e4: d0a00c17 ldw r2,-32720(gp) - b2e8: e0bffc15 stw r2,-16(fp) - heap_end += incr; - b2ec: d0e00c17 ldw r3,-32720(gp) - b2f0: e0bffe17 ldw r2,-8(fp) - b2f4: 1885883a add r2,r3,r2 - b2f8: d0a00c15 stw r2,-32720(gp) - b2fc: e0bffd17 ldw r2,-12(fp) - b300: e0bff915 stw r2,-28(fp) - b304: e0bff917 ldw r2,-28(fp) - b308: 1001703a wrctl status,r2 - -#endif - - alt_irq_enable_all(context); - - return (caddr_t) prev_heap_end; - b30c: e0bffc17 ldw r2,-16(fp) - b310: e0bfff15 stw r2,-4(fp) - b314: e0bfff17 ldw r2,-4(fp) -} - b318: e037883a mov sp,fp - b31c: df000017 ldw fp,0(sp) - b320: dec00104 addi sp,sp,4 - b324: f800283a ret - -0000b328 : -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -int ALT_WRITE (int file, const void *ptr, size_t len) -{ - b328: defff704 addi sp,sp,-36 - b32c: dfc00815 stw ra,32(sp) - b330: df000715 stw fp,28(sp) - b334: df000704 addi fp,sp,28 - b338: e13ffb15 stw r4,-20(fp) - b33c: e17ffc15 stw r5,-16(fp) - b340: e1bffd15 stw r6,-12(fp) - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - b344: e0bffb17 ldw r2,-20(fp) - b348: 1004803a cmplt r2,r2,zero - b34c: 1000091e bne r2,zero,b374 - b350: e13ffb17 ldw r4,-20(fp) - b354: 01400304 movi r5,12 - b358: 0009fc80 call 9fc8 <__mulsi3> - b35c: 1007883a mov r3,r2 - b360: 00800074 movhi r2,1 - b364: 10bbf204 addi r2,r2,-4152 - b368: 1887883a add r3,r3,r2 - b36c: e0ffff15 stw r3,-4(fp) - b370: 00000106 br b378 - b374: e03fff15 stw zero,-4(fp) - b378: e0bfff17 ldw r2,-4(fp) - b37c: e0bffa15 stw r2,-24(fp) - - if (fd) - b380: e0bffa17 ldw r2,-24(fp) - b384: 1005003a cmpeq r2,r2,zero - b388: 1000241e bne r2,zero,b41c - * If the file has not been opened with write access, or if the driver does - * not provide an implementation of write(), generate an error. Otherwise - * call the drivers write() function to process the request. - */ - - if (((fd->fd_flags & O_ACCMODE) != O_RDONLY) && fd->dev->write) - b38c: e0bffa17 ldw r2,-24(fp) - b390: 10800217 ldw r2,8(r2) - b394: 108000cc andi r2,r2,3 - b398: 1005003a cmpeq r2,r2,zero - b39c: 10001a1e bne r2,zero,b408 - b3a0: e0bffa17 ldw r2,-24(fp) - b3a4: 10800017 ldw r2,0(r2) - b3a8: 10800617 ldw r2,24(r2) - b3ac: 1005003a cmpeq r2,r2,zero - b3b0: 1000151e bne r2,zero,b408 - { - - /* ALT_LOG - see altera_hal/HAL/inc/sys/alt_log_printf.h */ - ALT_LOG_WRITE_FUNCTION(ptr,len); - - if ((rval = fd->dev->write(fd, ptr, len)) < 0) - b3b4: e0bffa17 ldw r2,-24(fp) - b3b8: 10800017 ldw r2,0(r2) - b3bc: 10800617 ldw r2,24(r2) - b3c0: e17ffc17 ldw r5,-16(fp) - b3c4: e1bffd17 ldw r6,-12(fp) - b3c8: e13ffa17 ldw r4,-24(fp) - b3cc: 103ee83a callr r2 - b3d0: e0bff915 stw r2,-28(fp) - b3d4: e0bff917 ldw r2,-28(fp) - b3d8: 1004403a cmpge r2,r2,zero - b3dc: 1000071e bne r2,zero,b3fc - { - ALT_ERRNO = -rval; - b3e0: 000b44c0 call b44c - b3e4: e0fff917 ldw r3,-28(fp) - b3e8: 00c7c83a sub r3,zero,r3 - b3ec: 10c00015 stw r3,0(r2) - return -1; - b3f0: 00bfffc4 movi r2,-1 - b3f4: e0bffe15 stw r2,-8(fp) - b3f8: 00000e06 br b434 - } - return rval; - b3fc: e0bff917 ldw r2,-28(fp) - b400: e0bffe15 stw r2,-8(fp) - b404: 00000b06 br b434 - } - else - { - ALT_ERRNO = EACCES; - b408: 000b44c0 call b44c - b40c: 1007883a mov r3,r2 - b410: 00800344 movi r2,13 - b414: 18800015 stw r2,0(r3) - b418: 00000406 br b42c - } - } - else - { - ALT_ERRNO = EBADFD; - b41c: 000b44c0 call b44c - b420: 1007883a mov r3,r2 - b424: 00801444 movi r2,81 - b428: 18800015 stw r2,0(r3) - } - return -1; - b42c: 00bfffc4 movi r2,-1 - b430: e0bffe15 stw r2,-8(fp) - b434: e0bffe17 ldw r2,-8(fp) -} - b438: e037883a mov sp,fp - b43c: dfc00117 ldw ra,4(sp) - b440: df000017 ldw fp,0(sp) - b444: dec00204 addi sp,sp,8 - b448: f800283a ret - -0000b44c : -#undef errno - -extern int errno; - -static ALT_INLINE int* alt_get_errno(void) -{ - b44c: defffd04 addi sp,sp,-12 - b450: dfc00215 stw ra,8(sp) - b454: df000115 stw fp,4(sp) - b458: df000104 addi fp,sp,4 - return ((alt_errno) ? alt_errno() : &errno); - b45c: 00800074 movhi r2,1 - b460: 1080bd04 addi r2,r2,756 - b464: 10800017 ldw r2,0(r2) - b468: 1005003a cmpeq r2,r2,zero - b46c: 1000061e bne r2,zero,b488 - b470: 00800074 movhi r2,1 - b474: 1080bd04 addi r2,r2,756 - b478: 10800017 ldw r2,0(r2) - b47c: 103ee83a callr r2 - b480: e0bfff15 stw r2,-4(fp) - b484: 00000306 br b494 - b488: 00800074 movhi r2,1 - b48c: 1087a504 addi r2,r2,7828 - b490: e0bfff15 stw r2,-4(fp) - b494: e0bfff17 ldw r2,-4(fp) -} - b498: e037883a mov sp,fp - b49c: dfc00117 ldw ra,4(sp) - b4a0: df000017 ldw fp,0(sp) - b4a4: dec00204 addi sp,sp,8 - b4a8: f800283a ret - -0000b4ac : - * The "base" parameter is ignored and only - * present for backwards-compatibility. - */ - -void alt_irq_init ( const void* base ) -{ - b4ac: defffd04 addi sp,sp,-12 - b4b0: dfc00215 stw ra,8(sp) - b4b4: df000115 stw fp,4(sp) - b4b8: df000104 addi fp,sp,4 - b4bc: e13fff15 stw r4,-4(fp) - ALTERA_NIOS2_QSYS_IRQ_INIT ( NIOS2_PROCESSOR, nios2_processor); - b4c0: 000dbd40 call dbd4 - * alt_irq_cpu_enable_interrupts() enables the CPU to start taking interrupts. - */ -static ALT_INLINE void ALT_ALWAYS_INLINE - alt_irq_cpu_enable_interrupts () -{ - NIOS2_WRITE_STATUS(NIOS2_STATUS_PIE_MSK - b4c4: 00800044 movi r2,1 - b4c8: 1001703a wrctl status,r2 - alt_irq_cpu_enable_interrupts(); -} - b4cc: e037883a mov sp,fp - b4d0: dfc00117 ldw ra,4(sp) - b4d4: df000017 ldw fp,0(sp) - b4d8: dec00204 addi sp,sp,8 - b4dc: f800283a ret - -0000b4e0 : - * Initialize the non-interrupt controller devices. - * Called after alt_irq_init(). - */ - -void alt_sys_init( void ) -{ - b4e0: defffe04 addi sp,sp,-8 - b4e4: dfc00115 stw ra,4(sp) - b4e8: df000015 stw fp,0(sp) - b4ec: d839883a mov fp,sp - ALTERA_AVALON_JTAG_UART_INIT ( JTAG_UART, jtag_uart); - b4f0: 01000074 movhi r4,1 - b4f4: 213c5c04 addi r4,r4,-3728 - b4f8: 000b883a mov r5,zero - b4fc: 01800144 movi r6,5 - b500: 000b6bc0 call b6bc - b504: 01000074 movhi r4,1 - b508: 213c5204 addi r4,r4,-3768 - b50c: 000b53c0 call b53c - ALTERA_AVALON_LCD_16207_INIT ( LCD_16207_0, lcd_16207_0); - b510: 01000074 movhi r4,1 - b514: 21007404 addi r4,r4,464 - b518: 000ce640 call ce64 - b51c: 01000074 movhi r4,1 - b520: 21006a04 addi r4,r4,424 - b524: 000b53c0 call b53c -} - b528: e037883a mov sp,fp - b52c: dfc00117 ldw ra,4(sp) - b530: df000017 ldw fp,0(sp) - b534: dec00204 addi sp,sp,8 - b538: f800283a ret - -0000b53c : - */ - -extern int alt_fs_reg (alt_dev* dev); - -static ALT_INLINE int alt_dev_reg (alt_dev* dev) -{ - b53c: defffd04 addi sp,sp,-12 - b540: dfc00215 stw ra,8(sp) - b544: df000115 stw fp,4(sp) - b548: df000104 addi fp,sp,4 - b54c: e13fff15 stw r4,-4(fp) - extern alt_llist alt_dev_list; - - return alt_dev_llist_insert ((alt_dev_llist*) dev, &alt_dev_list); - b550: e13fff17 ldw r4,-4(fp) - b554: 01400074 movhi r5,1 - b558: 2940ba04 addi r5,r5,744 - b55c: 000d1680 call d168 -} - b560: e037883a mov sp,fp - b564: dfc00117 ldw ra,4(sp) - b568: df000017 ldw fp,0(sp) - b56c: dec00204 addi sp,sp,8 - b570: f800283a ret - -0000b574 : - * - */ - -int -altera_avalon_jtag_uart_read_fd(alt_fd* fd, char* buffer, int space) -{ - b574: defffa04 addi sp,sp,-24 - b578: dfc00515 stw ra,20(sp) - b57c: df000415 stw fp,16(sp) - b580: df000404 addi fp,sp,16 - b584: e13ffd15 stw r4,-12(fp) - b588: e17ffe15 stw r5,-8(fp) - b58c: e1bfff15 stw r6,-4(fp) - altera_avalon_jtag_uart_dev* dev = (altera_avalon_jtag_uart_dev*) fd->dev; - b590: e0bffd17 ldw r2,-12(fp) - b594: 10800017 ldw r2,0(r2) - b598: e0bffc15 stw r2,-16(fp) - - return altera_avalon_jtag_uart_read(&dev->state, buffer, space, - b59c: e0bffc17 ldw r2,-16(fp) - b5a0: 11000a04 addi r4,r2,40 - b5a4: e0bffd17 ldw r2,-12(fp) - b5a8: 11c00217 ldw r7,8(r2) - b5ac: e17ffe17 ldw r5,-8(fp) - b5b0: e1bfff17 ldw r6,-4(fp) - b5b4: 000bbbc0 call bbbc - fd->fd_flags); -} - b5b8: e037883a mov sp,fp - b5bc: dfc00117 ldw ra,4(sp) - b5c0: df000017 ldw fp,0(sp) - b5c4: dec00204 addi sp,sp,8 - b5c8: f800283a ret - -0000b5cc : - -int -altera_avalon_jtag_uart_write_fd(alt_fd* fd, const char* buffer, int space) -{ - b5cc: defffa04 addi sp,sp,-24 - b5d0: dfc00515 stw ra,20(sp) - b5d4: df000415 stw fp,16(sp) - b5d8: df000404 addi fp,sp,16 - b5dc: e13ffd15 stw r4,-12(fp) - b5e0: e17ffe15 stw r5,-8(fp) - b5e4: e1bfff15 stw r6,-4(fp) - altera_avalon_jtag_uart_dev* dev = (altera_avalon_jtag_uart_dev*) fd->dev; - b5e8: e0bffd17 ldw r2,-12(fp) - b5ec: 10800017 ldw r2,0(r2) - b5f0: e0bffc15 stw r2,-16(fp) - - return altera_avalon_jtag_uart_write(&dev->state, buffer, space, - b5f4: e0bffc17 ldw r2,-16(fp) - b5f8: 11000a04 addi r4,r2,40 - b5fc: e0bffd17 ldw r2,-12(fp) - b600: 11c00217 ldw r7,8(r2) - b604: e17ffe17 ldw r5,-8(fp) - b608: e1bfff17 ldw r6,-4(fp) - b60c: 000bde00 call bde0 - fd->fd_flags); -} - b610: e037883a mov sp,fp - b614: dfc00117 ldw ra,4(sp) - b618: df000017 ldw fp,0(sp) - b61c: dec00204 addi sp,sp,8 - b620: f800283a ret - -0000b624 : - -#ifndef ALTERA_AVALON_JTAG_UART_SMALL - -int -altera_avalon_jtag_uart_close_fd(alt_fd* fd) -{ - b624: defffc04 addi sp,sp,-16 - b628: dfc00315 stw ra,12(sp) - b62c: df000215 stw fp,8(sp) - b630: df000204 addi fp,sp,8 - b634: e13fff15 stw r4,-4(fp) - altera_avalon_jtag_uart_dev* dev = (altera_avalon_jtag_uart_dev*) fd->dev; - b638: e0bfff17 ldw r2,-4(fp) - b63c: 10800017 ldw r2,0(r2) - b640: e0bffe15 stw r2,-8(fp) - - return altera_avalon_jtag_uart_close(&dev->state, fd->fd_flags); - b644: e0bffe17 ldw r2,-8(fp) - b648: 11000a04 addi r4,r2,40 - b64c: e0bfff17 ldw r2,-4(fp) - b650: 11400217 ldw r5,8(r2) - b654: 000ba540 call ba54 -} - b658: e037883a mov sp,fp - b65c: dfc00117 ldw ra,4(sp) - b660: df000017 ldw fp,0(sp) - b664: dec00204 addi sp,sp,8 - b668: f800283a ret - -0000b66c : - -int -altera_avalon_jtag_uart_ioctl_fd(alt_fd* fd, int req, void* arg) -{ - b66c: defffa04 addi sp,sp,-24 - b670: dfc00515 stw ra,20(sp) - b674: df000415 stw fp,16(sp) - b678: df000404 addi fp,sp,16 - b67c: e13ffd15 stw r4,-12(fp) - b680: e17ffe15 stw r5,-8(fp) - b684: e1bfff15 stw r6,-4(fp) - altera_avalon_jtag_uart_dev* dev = (altera_avalon_jtag_uart_dev*) fd->dev; - b688: e0bffd17 ldw r2,-12(fp) - b68c: 10800017 ldw r2,0(r2) - b690: e0bffc15 stw r2,-16(fp) - - return altera_avalon_jtag_uart_ioctl(&dev->state, req, arg); - b694: e0bffc17 ldw r2,-16(fp) - b698: 11000a04 addi r4,r2,40 - b69c: e17ffe17 ldw r5,-8(fp) - b6a0: e1bfff17 ldw r6,-4(fp) - b6a4: 000bac80 call bac8 -} - b6a8: e037883a mov sp,fp - b6ac: dfc00117 ldw ra,4(sp) - b6b0: df000017 ldw fp,0(sp) - b6b4: dec00204 addi sp,sp,8 - b6b8: f800283a ret - -0000b6bc : - * Return 1 on sucessful IRQ register and 0 on failure. - */ - -void altera_avalon_jtag_uart_init(altera_avalon_jtag_uart_state* sp, - int irq_controller_id, int irq) -{ - b6bc: defffa04 addi sp,sp,-24 - b6c0: dfc00515 stw ra,20(sp) - b6c4: df000415 stw fp,16(sp) - b6c8: df000404 addi fp,sp,16 - b6cc: e13ffd15 stw r4,-12(fp) - b6d0: e17ffe15 stw r5,-8(fp) - b6d4: e1bfff15 stw r6,-4(fp) - ALT_FLAG_CREATE(&sp->events, 0); - ALT_SEM_CREATE(&sp->read_lock, 1); - ALT_SEM_CREATE(&sp->write_lock, 1); - - /* enable read interrupts at the device */ - sp->irq_enable = ALTERA_AVALON_JTAG_UART_CONTROL_RE_MSK; - b6d8: e0fffd17 ldw r3,-12(fp) - b6dc: 00800044 movi r2,1 - b6e0: 18800815 stw r2,32(r3) - - IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base, sp->irq_enable); - b6e4: e0bffd17 ldw r2,-12(fp) - b6e8: 10800017 ldw r2,0(r2) - b6ec: 11000104 addi r4,r2,4 - b6f0: e0bffd17 ldw r2,-12(fp) - b6f4: 10800817 ldw r2,32(r2) - b6f8: 1007883a mov r3,r2 - b6fc: 2005883a mov r2,r4 - b700: 10c00035 stwio r3,0(r2) - - /* register the interrupt handler */ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - alt_ic_isr_register(irq_controller_id, irq, altera_avalon_jtag_uart_irq, - b704: e13ffe17 ldw r4,-8(fp) - b708: e17fff17 ldw r5,-4(fp) - b70c: d8000015 stw zero,0(sp) - b710: 01800074 movhi r6,1 - b714: 31addf04 addi r6,r6,-18564 - b718: e1fffd17 ldw r7,-12(fp) - b71c: 000d5e40 call d5e4 -#else - alt_irq_register(irq, sp, altera_avalon_jtag_uart_irq); -#endif - - /* Register an alarm to go off every second to check for presence of host */ - sp->host_inactive = 0; - b720: e0bffd17 ldw r2,-12(fp) - b724: 10000915 stw zero,36(r2) - - if (alt_alarm_start(&sp->alarm, alt_ticks_per_second(), - b728: e0bffd17 ldw r2,-12(fp) - b72c: 11000204 addi r4,r2,8 - * Obtain the system clock rate in ticks/s. - */ - -static ALT_INLINE alt_u32 ALT_ALWAYS_INLINE alt_ticks_per_second (void) -{ - return _alt_tick_rate; - b730: 00800074 movhi r2,1 - b734: 1087b004 addi r2,r2,7872 - b738: 10800017 ldw r2,0(r2) - b73c: 100b883a mov r5,r2 - b740: 01800074 movhi r6,1 - b744: 31ae6904 addi r6,r6,-18012 - b748: e1fffd17 ldw r7,-12(fp) - b74c: 000cff80 call cff8 - b750: 1004403a cmpge r2,r2,zero - b754: 1000041e bne r2,zero,b768 - &altera_avalon_jtag_uart_timeout, sp) < 0) - { - /* If we can't set the alarm then record "don't know if host present" - * and behave as though the host is present. - */ - sp->timeout = INT_MAX; - b758: e0fffd17 ldw r3,-12(fp) - b75c: 00a00034 movhi r2,32768 - b760: 10bfffc4 addi r2,r2,-1 - b764: 18800115 stw r2,4(r3) - } - - /* ALT_LOG - see altera_hal/HAL/inc/sys/alt_log_printf.h */ - ALT_LOG_JTAG_UART_ALARM_REGISTER(sp, sp->base); -} - b768: e037883a mov sp,fp - b76c: dfc00117 ldw ra,4(sp) - b770: df000017 ldw fp,0(sp) - b774: dec00204 addi sp,sp,8 - b778: f800283a ret - -0000b77c : -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT -static void altera_avalon_jtag_uart_irq(void* context) -#else -static void altera_avalon_jtag_uart_irq(void* context, alt_u32 id) -#endif -{ - b77c: defff804 addi sp,sp,-32 - b780: df000715 stw fp,28(sp) - b784: df000704 addi fp,sp,28 - b788: e13fff15 stw r4,-4(fp) - altera_avalon_jtag_uart_state* sp = (altera_avalon_jtag_uart_state*) context; - b78c: e0bfff17 ldw r2,-4(fp) - b790: e0bffe15 stw r2,-8(fp) - unsigned int base = sp->base; - b794: e0bffe17 ldw r2,-8(fp) - b798: 10800017 ldw r2,0(r2) - b79c: e0bffd15 stw r2,-12(fp) - b7a0: 00000006 br b7a4 - /* ALT_LOG - see altera_hal/HAL/inc/sys/alt_log_printf.h */ - ALT_LOG_JTAG_UART_ISR_FUNCTION(base, sp); - - for ( ; ; ) - { - unsigned int control = IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base); - b7a4: e0bffd17 ldw r2,-12(fp) - b7a8: 10800104 addi r2,r2,4 - b7ac: 10800037 ldwio r2,0(r2) - b7b0: e0bffc15 stw r2,-16(fp) - - /* Return once nothing more to do */ - if ((control & (ALTERA_AVALON_JTAG_UART_CONTROL_RI_MSK | ALTERA_AVALON_JTAG_UART_CONTROL_WI_MSK)) == 0) - b7b4: e0bffc17 ldw r2,-16(fp) - b7b8: 1080c00c andi r2,r2,768 - b7bc: 1005003a cmpeq r2,r2,zero - b7c0: 1000741e bne r2,zero,b994 - break; - - if (control & ALTERA_AVALON_JTAG_UART_CONTROL_RI_MSK) - b7c4: e0bffc17 ldw r2,-16(fp) - b7c8: 1080400c andi r2,r2,256 - b7cc: 1005003a cmpeq r2,r2,zero - b7d0: 1000351e bne r2,zero,b8a8 - { - /* process a read irq. Start by assuming that there is data in the - * receive FIFO (otherwise why would we have been interrupted?) - */ - unsigned int data = 1 << ALTERA_AVALON_JTAG_UART_DATA_RAVAIL_OFST; - b7d4: 00800074 movhi r2,1 - b7d8: e0bffb15 stw r2,-20(fp) - for ( ; ; ) - { - /* Check whether there is space in the buffer. If not then we must not - * read any characters from the buffer as they will be lost. - */ - unsigned int next = (sp->rx_in + 1) % ALTERA_AVALON_JTAG_UART_BUF_LEN; - b7dc: e0bffe17 ldw r2,-8(fp) - b7e0: 10800a17 ldw r2,40(r2) - b7e4: 10800044 addi r2,r2,1 - b7e8: 1081ffcc andi r2,r2,2047 - b7ec: e0bffa15 stw r2,-24(fp) - if (next == sp->rx_out) - b7f0: e0bffe17 ldw r2,-8(fp) - b7f4: 10c00b17 ldw r3,44(r2) - b7f8: e0bffa17 ldw r2,-24(fp) - b7fc: 18801626 beq r3,r2,b858 - break; - - /* Try to remove a character from the FIFO and find out whether there - * are any more characters remaining. - */ - data = IORD_ALTERA_AVALON_JTAG_UART_DATA(base); - b800: e0bffd17 ldw r2,-12(fp) - b804: 10800037 ldwio r2,0(r2) - b808: e0bffb15 stw r2,-20(fp) - - if ((data & ALTERA_AVALON_JTAG_UART_DATA_RVALID_MSK) == 0) - b80c: e0bffb17 ldw r2,-20(fp) - b810: 10a0000c andi r2,r2,32768 - b814: 1005003a cmpeq r2,r2,zero - b818: 10000f1e bne r2,zero,b858 - break; - - sp->rx_buf[sp->rx_in] = (data & ALTERA_AVALON_JTAG_UART_DATA_DATA_MSK) >> ALTERA_AVALON_JTAG_UART_DATA_DATA_OFST; - b81c: e0bffe17 ldw r2,-8(fp) - b820: 10c00a17 ldw r3,40(r2) - b824: e0bffb17 ldw r2,-20(fp) - b828: 1009883a mov r4,r2 - b82c: e0bffe17 ldw r2,-8(fp) - b830: 1885883a add r2,r3,r2 - b834: 10800e04 addi r2,r2,56 - b838: 11000005 stb r4,0(r2) - sp->rx_in = (sp->rx_in + 1) % ALTERA_AVALON_JTAG_UART_BUF_LEN; - b83c: e0bffe17 ldw r2,-8(fp) - b840: 10800a17 ldw r2,40(r2) - b844: 10800044 addi r2,r2,1 - b848: 10c1ffcc andi r3,r2,2047 - b84c: e0bffe17 ldw r2,-8(fp) - b850: 10c00a15 stw r3,40(r2) - - /* Post an event to notify jtag_uart_read that a character has been read */ - ALT_FLAG_POST (sp->events, ALT_JTAG_UART_READ_RDY, OS_FLAG_SET); - } - b854: 003fe106 br b7dc - - if (data & ALTERA_AVALON_JTAG_UART_DATA_RAVAIL_MSK) - b858: e0bffb17 ldw r2,-20(fp) - b85c: 10bfffec andhi r2,r2,65535 - b860: 1005003a cmpeq r2,r2,zero - b864: 1000101e bne r2,zero,b8a8 - { - /* If there is still data available here then the buffer is full - * so turn off receive interrupts until some space becomes available. - */ - sp->irq_enable &= ~ALTERA_AVALON_JTAG_UART_CONTROL_RE_MSK; - b868: e0bffe17 ldw r2,-8(fp) - b86c: 10c00817 ldw r3,32(r2) - b870: 00bfff84 movi r2,-2 - b874: 1886703a and r3,r3,r2 - b878: e0bffe17 ldw r2,-8(fp) - b87c: 10c00815 stw r3,32(r2) - IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(base, sp->irq_enable); - b880: e0bffd17 ldw r2,-12(fp) - b884: 11000104 addi r4,r2,4 - b888: e0bffe17 ldw r2,-8(fp) - b88c: 10800817 ldw r2,32(r2) - b890: 1007883a mov r3,r2 - b894: 2005883a mov r2,r4 - b898: 10c00035 stwio r3,0(r2) - - /* Dummy read to ensure IRQ is cleared prior to ISR completion */ - IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base); - b89c: e0bffd17 ldw r2,-12(fp) - b8a0: 10800104 addi r2,r2,4 - b8a4: 10800037 ldwio r2,0(r2) - } - } - - if (control & ALTERA_AVALON_JTAG_UART_CONTROL_WI_MSK) - b8a8: e0bffc17 ldw r2,-16(fp) - b8ac: 1080800c andi r2,r2,512 - b8b0: 1005003a cmpeq r2,r2,zero - b8b4: 103fbb1e bne r2,zero,b7a4 - { - /* process a write irq */ - unsigned int space = (control & ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_MSK) >> ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_OFST; - b8b8: e0bffc17 ldw r2,-16(fp) - b8bc: 10bfffec andhi r2,r2,65535 - b8c0: 1004d43a srli r2,r2,16 - b8c4: e0bff915 stw r2,-28(fp) - - while (space > 0 && sp->tx_out != sp->tx_in) - b8c8: 00001506 br b920 - { - IOWR_ALTERA_AVALON_JTAG_UART_DATA(base, sp->tx_buf[sp->tx_out]); - b8cc: e13ffd17 ldw r4,-12(fp) - b8d0: e0bffe17 ldw r2,-8(fp) - b8d4: 10c00d17 ldw r3,52(r2) - b8d8: e0bffe17 ldw r2,-8(fp) - b8dc: 1885883a add r2,r3,r2 - b8e0: 10820e04 addi r2,r2,2104 - b8e4: 10800003 ldbu r2,0(r2) - b8e8: 10c03fcc andi r3,r2,255 - b8ec: 18c0201c xori r3,r3,128 - b8f0: 18ffe004 addi r3,r3,-128 - b8f4: 2005883a mov r2,r4 - b8f8: 10c00035 stwio r3,0(r2) - - sp->tx_out = (sp->tx_out + 1) % ALTERA_AVALON_JTAG_UART_BUF_LEN; - b8fc: e0bffe17 ldw r2,-8(fp) - b900: 10800d17 ldw r2,52(r2) - b904: 10800044 addi r2,r2,1 - b908: 10c1ffcc andi r3,r2,2047 - b90c: e0bffe17 ldw r2,-8(fp) - b910: 10c00d15 stw r3,52(r2) - - /* Post an event to notify jtag_uart_write that a character has been written */ - ALT_FLAG_POST (sp->events, ALT_JTAG_UART_WRITE_RDY, OS_FLAG_SET); - - space--; - b914: e0bff917 ldw r2,-28(fp) - b918: 10bfffc4 addi r2,r2,-1 - b91c: e0bff915 stw r2,-28(fp) - if (control & ALTERA_AVALON_JTAG_UART_CONTROL_WI_MSK) - { - /* process a write irq */ - unsigned int space = (control & ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_MSK) >> ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_OFST; - - while (space > 0 && sp->tx_out != sp->tx_in) - b920: e0bff917 ldw r2,-28(fp) - b924: 1005003a cmpeq r2,r2,zero - b928: 1000051e bne r2,zero,b940 - b92c: e0bffe17 ldw r2,-8(fp) - b930: 10c00d17 ldw r3,52(r2) - b934: e0bffe17 ldw r2,-8(fp) - b938: 10800c17 ldw r2,48(r2) - b93c: 18bfe31e bne r3,r2,b8cc - ALT_FLAG_POST (sp->events, ALT_JTAG_UART_WRITE_RDY, OS_FLAG_SET); - - space--; - } - - if (space > 0) - b940: e0bff917 ldw r2,-28(fp) - b944: 1005003a cmpeq r2,r2,zero - b948: 103f961e bne r2,zero,b7a4 - { - /* If we don't have any more data available then turn off the TX interrupt */ - sp->irq_enable &= ~ALTERA_AVALON_JTAG_UART_CONTROL_WE_MSK; - b94c: e0bffe17 ldw r2,-8(fp) - b950: 10c00817 ldw r3,32(r2) - b954: 00bfff44 movi r2,-3 - b958: 1886703a and r3,r3,r2 - b95c: e0bffe17 ldw r2,-8(fp) - b960: 10c00815 stw r3,32(r2) - IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base, sp->irq_enable); - b964: e0bffe17 ldw r2,-8(fp) - b968: 10800017 ldw r2,0(r2) - b96c: 11000104 addi r4,r2,4 - b970: e0bffe17 ldw r2,-8(fp) - b974: 10800817 ldw r2,32(r2) - b978: 1007883a mov r3,r2 - b97c: 2005883a mov r2,r4 - b980: 10c00035 stwio r3,0(r2) - - /* Dummy read to ensure IRQ is cleared prior to ISR completion */ - IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base); - b984: e0bffd17 ldw r2,-12(fp) - b988: 10800104 addi r2,r2,4 - b98c: 10800037 ldwio r2,0(r2) - } - } - } - b990: 003f8406 br b7a4 -} - b994: e037883a mov sp,fp - b998: df000017 ldw fp,0(sp) - b99c: dec00104 addi sp,sp,4 - b9a0: f800283a ret - -0000b9a4 : - * Timeout routine is called every second - */ - -static alt_u32 -altera_avalon_jtag_uart_timeout(void* context) -{ - b9a4: defffc04 addi sp,sp,-16 - b9a8: df000315 stw fp,12(sp) - b9ac: df000304 addi fp,sp,12 - b9b0: e13fff15 stw r4,-4(fp) - altera_avalon_jtag_uart_state* sp = (altera_avalon_jtag_uart_state *) context; - b9b4: e0bfff17 ldw r2,-4(fp) - b9b8: e0bffe15 stw r2,-8(fp) - - unsigned int control = IORD_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base); - b9bc: e0bffe17 ldw r2,-8(fp) - b9c0: 10800017 ldw r2,0(r2) - b9c4: 10800104 addi r2,r2,4 - b9c8: 10800037 ldwio r2,0(r2) - b9cc: e0bffd15 stw r2,-12(fp) - - if (control & ALTERA_AVALON_JTAG_UART_CONTROL_AC_MSK) - b9d0: e0bffd17 ldw r2,-12(fp) - b9d4: 1081000c andi r2,r2,1024 - b9d8: 1005003a cmpeq r2,r2,zero - b9dc: 10000c1e bne r2,zero,ba10 - { - IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base, sp->irq_enable | ALTERA_AVALON_JTAG_UART_CONTROL_AC_MSK); - b9e0: e0bffe17 ldw r2,-8(fp) - b9e4: 10800017 ldw r2,0(r2) - b9e8: 11000104 addi r4,r2,4 - b9ec: e0bffe17 ldw r2,-8(fp) - b9f0: 10800817 ldw r2,32(r2) - b9f4: 10810014 ori r2,r2,1024 - b9f8: 1007883a mov r3,r2 - b9fc: 2005883a mov r2,r4 - ba00: 10c00035 stwio r3,0(r2) - sp->host_inactive = 0; - ba04: e0bffe17 ldw r2,-8(fp) - ba08: 10000915 stw zero,36(r2) - ba0c: 00000a06 br ba38 - } - else if (sp->host_inactive < INT_MAX - 2) { - ba10: e0bffe17 ldw r2,-8(fp) - ba14: 10c00917 ldw r3,36(r2) - ba18: 00a00034 movhi r2,32768 - ba1c: 10bfff04 addi r2,r2,-4 - ba20: 10c00536 bltu r2,r3,ba38 - sp->host_inactive++; - ba24: e0bffe17 ldw r2,-8(fp) - ba28: 10800917 ldw r2,36(r2) - ba2c: 10c00044 addi r3,r2,1 - ba30: e0bffe17 ldw r2,-8(fp) - ba34: 10c00915 stw r3,36(r2) - ba38: 00800074 movhi r2,1 - ba3c: 1087b004 addi r2,r2,7872 - ba40: 10800017 ldw r2,0(r2) - ALT_FLAG_POST (sp->events, ALT_JTAG_UART_TIMEOUT, OS_FLAG_SET); - } - } - - return alt_ticks_per_second(); -} - ba44: e037883a mov sp,fp - ba48: df000017 ldw fp,0(sp) - ba4c: dec00104 addi sp,sp,4 - ba50: f800283a ret - -0000ba54 : - * The close routine is not implemented for the small driver; instead it will - * map to null. This is because the small driver simply waits while characters - * are transmitted; there is no interrupt-serviced buffer to empty - */ -int altera_avalon_jtag_uart_close(altera_avalon_jtag_uart_state* sp, int flags) -{ - ba54: defffc04 addi sp,sp,-16 - ba58: df000315 stw fp,12(sp) - ba5c: df000304 addi fp,sp,12 - ba60: e13ffd15 stw r4,-12(fp) - ba64: e17ffe15 stw r5,-8(fp) - /* - * Wait for all transmit data to be emptied by the JTAG UART ISR, or - * for a host-inactivity timeout, in which case transmit data will be lost - */ - while ( (sp->tx_out != sp->tx_in) && (sp->host_inactive < sp->timeout) ) { - ba68: 00000706 br ba88 - if (flags & O_NONBLOCK) { - ba6c: e0bffe17 ldw r2,-8(fp) - ba70: 1090000c andi r2,r2,16384 - ba74: 1005003a cmpeq r2,r2,zero - ba78: 1000031e bne r2,zero,ba88 - return -EWOULDBLOCK; - ba7c: 00bffd44 movi r2,-11 - ba80: e0bfff15 stw r2,-4(fp) - ba84: 00000b06 br bab4 -{ - /* - * Wait for all transmit data to be emptied by the JTAG UART ISR, or - * for a host-inactivity timeout, in which case transmit data will be lost - */ - while ( (sp->tx_out != sp->tx_in) && (sp->host_inactive < sp->timeout) ) { - ba88: e0bffd17 ldw r2,-12(fp) - ba8c: 10c00d17 ldw r3,52(r2) - ba90: e0bffd17 ldw r2,-12(fp) - ba94: 10800c17 ldw r2,48(r2) - ba98: 18800526 beq r3,r2,bab0 - ba9c: e0bffd17 ldw r2,-12(fp) - baa0: 10c00917 ldw r3,36(r2) - baa4: e0bffd17 ldw r2,-12(fp) - baa8: 10800117 ldw r2,4(r2) - baac: 18bfef36 bltu r3,r2,ba6c - if (flags & O_NONBLOCK) { - return -EWOULDBLOCK; - } - } - - return 0; - bab0: e03fff15 stw zero,-4(fp) - bab4: e0bfff17 ldw r2,-4(fp) -} - bab8: e037883a mov sp,fp - babc: df000017 ldw fp,0(sp) - bac0: dec00104 addi sp,sp,4 - bac4: f800283a ret - -0000bac8 : -/* ----------------------------------------------------------- */ - -int -altera_avalon_jtag_uart_ioctl(altera_avalon_jtag_uart_state* sp, int req, - void* arg) -{ - bac8: defff804 addi sp,sp,-32 - bacc: df000715 stw fp,28(sp) - bad0: df000704 addi fp,sp,28 - bad4: e13ffb15 stw r4,-20(fp) - bad8: e17ffc15 stw r5,-16(fp) - badc: e1bffd15 stw r6,-12(fp) - int rc = -ENOTTY; - bae0: 00bff9c4 movi r2,-25 - bae4: e0bffa15 stw r2,-24(fp) - - switch (req) - bae8: e0bffc17 ldw r2,-16(fp) - baec: e0bfff15 stw r2,-4(fp) - baf0: e0ffff17 ldw r3,-4(fp) - baf4: 189a8060 cmpeqi r2,r3,27137 - baf8: 1000041e bne r2,zero,bb0c - bafc: e0ffff17 ldw r3,-4(fp) - bb00: 189a80a0 cmpeqi r2,r3,27138 - bb04: 10001b1e bne r2,zero,bb74 - bb08: 00002706 br bba8 - { - case TIOCSTIMEOUT: - /* Set the time to wait until assuming host is not connected */ - if (sp->timeout != INT_MAX) - bb0c: e0bffb17 ldw r2,-20(fp) - bb10: 10c00117 ldw r3,4(r2) - bb14: 00a00034 movhi r2,32768 - bb18: 10bfffc4 addi r2,r2,-1 - bb1c: 18802226 beq r3,r2,bba8 - { - int timeout = *((int *)arg); - bb20: e0bffd17 ldw r2,-12(fp) - bb24: 10800017 ldw r2,0(r2) - bb28: e0bff915 stw r2,-28(fp) - sp->timeout = (timeout >= 2 && timeout < INT_MAX) ? timeout : INT_MAX - 1; - bb2c: e0bff917 ldw r2,-28(fp) - bb30: 10800090 cmplti r2,r2,2 - bb34: 1000071e bne r2,zero,bb54 - bb38: e0fff917 ldw r3,-28(fp) - bb3c: 00a00034 movhi r2,32768 - bb40: 10bfffc4 addi r2,r2,-1 - bb44: 18800326 beq r3,r2,bb54 - bb48: e0bff917 ldw r2,-28(fp) - bb4c: e0bffe15 stw r2,-8(fp) - bb50: 00000306 br bb60 - bb54: 00e00034 movhi r3,32768 - bb58: 18ffff84 addi r3,r3,-2 - bb5c: e0fffe15 stw r3,-8(fp) - bb60: e0bffb17 ldw r2,-20(fp) - bb64: e0fffe17 ldw r3,-8(fp) - bb68: 10c00115 stw r3,4(r2) - rc = 0; - bb6c: e03ffa15 stw zero,-24(fp) - } - break; - bb70: 00000d06 br bba8 - - case TIOCGCONNECTED: - /* Find out whether host is connected */ - if (sp->timeout != INT_MAX) - bb74: e0bffb17 ldw r2,-20(fp) - bb78: 10c00117 ldw r3,4(r2) - bb7c: 00a00034 movhi r2,32768 - bb80: 10bfffc4 addi r2,r2,-1 - bb84: 18800826 beq r3,r2,bba8 - { - *((int *)arg) = (sp->host_inactive < sp->timeout) ? 1 : 0; - bb88: e13ffd17 ldw r4,-12(fp) - bb8c: e0bffb17 ldw r2,-20(fp) - bb90: 10c00917 ldw r3,36(r2) - bb94: e0bffb17 ldw r2,-20(fp) - bb98: 10800117 ldw r2,4(r2) - bb9c: 1885803a cmpltu r2,r3,r2 - bba0: 20800015 stw r2,0(r4) - rc = 0; - bba4: e03ffa15 stw zero,-24(fp) - - default: - break; - } - - return rc; - bba8: e0bffa17 ldw r2,-24(fp) -} - bbac: e037883a mov sp,fp - bbb0: df000017 ldw fp,0(sp) - bbb4: dec00104 addi sp,sp,4 - bbb8: f800283a ret - -0000bbbc : -/* ----------------------------------------------------------- */ - -int -altera_avalon_jtag_uart_read(altera_avalon_jtag_uart_state* sp, - char * buffer, int space, int flags) -{ - bbbc: defff204 addi sp,sp,-56 - bbc0: dfc00d15 stw ra,52(sp) - bbc4: df000c15 stw fp,48(sp) - bbc8: df000c04 addi fp,sp,48 - bbcc: e13ffb15 stw r4,-20(fp) - bbd0: e17ffc15 stw r5,-16(fp) - bbd4: e1bffd15 stw r6,-12(fp) - bbd8: e1fffe15 stw r7,-8(fp) - char * ptr = buffer; - bbdc: e0bffc17 ldw r2,-16(fp) - bbe0: e0bffa15 stw r2,-24(fp) - * When running in a multi threaded environment, obtain the "read_lock" - * semaphore. This ensures that reading from the device is thread-safe. - */ - ALT_SEM_PEND (sp->read_lock, 0); - - while (space > 0) - bbe4: 00004806 br bd08 - unsigned int in, out; - - /* Read as much data as possible */ - do - { - in = sp->rx_in; - bbe8: e0bffb17 ldw r2,-20(fp) - bbec: 10800a17 ldw r2,40(r2) - bbf0: e0bff715 stw r2,-36(fp) - out = sp->rx_out; - bbf4: e0bffb17 ldw r2,-20(fp) - bbf8: 10800b17 ldw r2,44(r2) - bbfc: e0bff615 stw r2,-40(fp) - - if (in >= out) - bc00: e0fff717 ldw r3,-36(fp) - bc04: e0bff617 ldw r2,-40(fp) - bc08: 18800536 bltu r3,r2,bc20 - n = in - out; - bc0c: e0bff717 ldw r2,-36(fp) - bc10: e0fff617 ldw r3,-40(fp) - bc14: 10c5c83a sub r2,r2,r3 - bc18: e0bff815 stw r2,-32(fp) - bc1c: 00000406 br bc30 - else - n = ALTERA_AVALON_JTAG_UART_BUF_LEN - out; - bc20: 00820004 movi r2,2048 - bc24: e0fff617 ldw r3,-40(fp) - bc28: 10c5c83a sub r2,r2,r3 - bc2c: e0bff815 stw r2,-32(fp) - - if (n == 0) - bc30: e0bff817 ldw r2,-32(fp) - bc34: 1005003a cmpeq r2,r2,zero - bc38: 10001f1e bne r2,zero,bcb8 - break; /* No more data available */ - - if (n > space) - bc3c: e0fffd17 ldw r3,-12(fp) - bc40: e0bff817 ldw r2,-32(fp) - bc44: 1880022e bgeu r3,r2,bc50 - n = space; - bc48: e0bffd17 ldw r2,-12(fp) - bc4c: e0bff815 stw r2,-32(fp) - - memcpy(ptr, sp->rx_buf + out, n); - bc50: e0bffb17 ldw r2,-20(fp) - bc54: 10c00e04 addi r3,r2,56 - bc58: e0bff617 ldw r2,-40(fp) - bc5c: 1887883a add r3,r3,r2 - bc60: e0bffa17 ldw r2,-24(fp) - bc64: 1009883a mov r4,r2 - bc68: 180b883a mov r5,r3 - bc6c: e1bff817 ldw r6,-32(fp) - bc70: 00066180 call 6618 - ptr += n; - bc74: e0fff817 ldw r3,-32(fp) - bc78: e0bffa17 ldw r2,-24(fp) - bc7c: 10c5883a add r2,r2,r3 - bc80: e0bffa15 stw r2,-24(fp) - space -= n; - bc84: e0fffd17 ldw r3,-12(fp) - bc88: e0bff817 ldw r2,-32(fp) - bc8c: 1885c83a sub r2,r3,r2 - bc90: e0bffd15 stw r2,-12(fp) - - sp->rx_out = (out + n) % ALTERA_AVALON_JTAG_UART_BUF_LEN; - bc94: e0fff617 ldw r3,-40(fp) - bc98: e0bff817 ldw r2,-32(fp) - bc9c: 1885883a add r2,r3,r2 - bca0: 10c1ffcc andi r3,r2,2047 - bca4: e0bffb17 ldw r2,-20(fp) - bca8: 10c00b15 stw r3,44(r2) - } - while (space > 0); - bcac: e0bffd17 ldw r2,-12(fp) - bcb0: 10800048 cmpgei r2,r2,1 - bcb4: 103fcc1e bne r2,zero,bbe8 - - /* If we read any data then return it */ - if (ptr != buffer) - bcb8: e0fffa17 ldw r3,-24(fp) - bcbc: e0bffc17 ldw r2,-16(fp) - bcc0: 1880141e bne r3,r2,bd14 - break; - - /* If in non-blocking mode then return error */ - if (flags & O_NONBLOCK) - bcc4: e0bffe17 ldw r2,-8(fp) - bcc8: 1090000c andi r2,r2,16384 - bccc: 1004c03a cmpne r2,r2,zero - bcd0: 1000101e bne r2,zero,bd14 - while (in == sp->rx_in && sp->host_inactive < sp->timeout) - ; - } -#else - /* No OS: Always spin */ - while (in == sp->rx_in && sp->host_inactive < sp->timeout) - bcd4: e0bffb17 ldw r2,-20(fp) - bcd8: 10c00a17 ldw r3,40(r2) - bcdc: e0bff717 ldw r2,-36(fp) - bce0: 1880051e bne r3,r2,bcf8 - bce4: e0bffb17 ldw r2,-20(fp) - bce8: 10c00917 ldw r3,36(r2) - bcec: e0bffb17 ldw r2,-20(fp) - bcf0: 10800117 ldw r2,4(r2) - bcf4: 18bff736 bltu r3,r2,bcd4 - ; -#endif /* __ucosii__ */ - - if (in == sp->rx_in) - bcf8: e0bffb17 ldw r2,-20(fp) - bcfc: 10c00a17 ldw r3,40(r2) - bd00: e0bff717 ldw r2,-36(fp) - bd04: 18800326 beq r3,r2,bd14 - * When running in a multi threaded environment, obtain the "read_lock" - * semaphore. This ensures that reading from the device is thread-safe. - */ - ALT_SEM_PEND (sp->read_lock, 0); - - while (space > 0) - bd08: e0bffd17 ldw r2,-12(fp) - bd0c: 10800048 cmpgei r2,r2,1 - bd10: 103fb51e bne r2,zero,bbe8 - * semaphore so that other threads can access the buffer. - */ - - ALT_SEM_POST (sp->read_lock); - - if (ptr != buffer) - bd14: e0fffa17 ldw r3,-24(fp) - bd18: e0bffc17 ldw r2,-16(fp) - bd1c: 18801926 beq r3,r2,bd84 -static ALT_INLINE alt_irq_context ALT_ALWAYS_INLINE - alt_irq_disable_all (void) -{ - alt_irq_context context; - - NIOS2_READ_STATUS (context); - bd20: 0005303a rdctl r2,status - bd24: e0bff515 stw r2,-44(fp) - - NIOS2_WRITE_STATUS (context & ~NIOS2_STATUS_PIE_MSK); - bd28: e0fff517 ldw r3,-44(fp) - bd2c: 00bfff84 movi r2,-2 - bd30: 1884703a and r2,r3,r2 - bd34: 1001703a wrctl status,r2 - - return context; - bd38: e0bff517 ldw r2,-44(fp) - { - /* If we read any data then there is space in the buffer so enable interrupts */ - context = alt_irq_disable_all(); - bd3c: e0bff915 stw r2,-28(fp) - sp->irq_enable |= ALTERA_AVALON_JTAG_UART_CONTROL_RE_MSK; - bd40: e0bffb17 ldw r2,-20(fp) - bd44: 10800817 ldw r2,32(r2) - bd48: 10c00054 ori r3,r2,1 - bd4c: e0bffb17 ldw r2,-20(fp) - bd50: 10c00815 stw r3,32(r2) - IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base, sp->irq_enable); - bd54: e0bffb17 ldw r2,-20(fp) - bd58: 10800017 ldw r2,0(r2) - bd5c: 11000104 addi r4,r2,4 - bd60: e0bffb17 ldw r2,-20(fp) - bd64: 10800817 ldw r2,32(r2) - bd68: 1007883a mov r3,r2 - bd6c: 2005883a mov r2,r4 - bd70: 10c00035 stwio r3,0(r2) - bd74: e0bff917 ldw r2,-28(fp) - bd78: e0bff415 stw r2,-48(fp) - status &= ~NIOS2_STATUS_PIE_MSK; - status |= (context & NIOS2_STATUS_PIE_MSK); - - NIOS2_WRITE_STATUS (status); -#else - NIOS2_WRITE_STATUS (context); - bd7c: e0bff417 ldw r2,-48(fp) - bd80: 1001703a wrctl status,r2 - alt_irq_enable_all(context); - } - - if (ptr != buffer) - bd84: e0fffa17 ldw r3,-24(fp) - bd88: e0bffc17 ldw r2,-16(fp) - bd8c: 18800526 beq r3,r2,bda4 - return ptr - buffer; - bd90: e0fffa17 ldw r3,-24(fp) - bd94: e0bffc17 ldw r2,-16(fp) - bd98: 1887c83a sub r3,r3,r2 - bd9c: e0ffff15 stw r3,-4(fp) - bda0: 00000906 br bdc8 - else if (flags & O_NONBLOCK) - bda4: e0bffe17 ldw r2,-8(fp) - bda8: 1090000c andi r2,r2,16384 - bdac: 1005003a cmpeq r2,r2,zero - bdb0: 1000031e bne r2,zero,bdc0 - return -EWOULDBLOCK; - bdb4: 00bffd44 movi r2,-11 - bdb8: e0bfff15 stw r2,-4(fp) - bdbc: 00000206 br bdc8 - else - return -EIO; - bdc0: 00bffec4 movi r2,-5 - bdc4: e0bfff15 stw r2,-4(fp) - bdc8: e0bfff17 ldw r2,-4(fp) -} - bdcc: e037883a mov sp,fp - bdd0: dfc00117 ldw ra,4(sp) - bdd4: df000017 ldw fp,0(sp) - bdd8: dec00204 addi sp,sp,8 - bddc: f800283a ret - -0000bde0 : -/* ----------------------------------------------------------- */ - -int -altera_avalon_jtag_uart_write(altera_avalon_jtag_uart_state* sp, - const char * ptr, int count, int flags) -{ - bde0: defff204 addi sp,sp,-56 - bde4: dfc00d15 stw ra,52(sp) - bde8: df000c15 stw fp,48(sp) - bdec: df000c04 addi fp,sp,48 - bdf0: e13ffb15 stw r4,-20(fp) - bdf4: e17ffc15 stw r5,-16(fp) - bdf8: e1bffd15 stw r6,-12(fp) - bdfc: e1fffe15 stw r7,-8(fp) - /* Remove warning at optimisation level 03 by seting out to 0 */ - unsigned int in, out=0; - be00: e03ff915 stw zero,-28(fp) - unsigned int n; - alt_irq_context context; - - const char * start = ptr; - be04: e0bffc17 ldw r2,-16(fp) - be08: e0bff615 stw r2,-40(fp) - ALT_SEM_PEND (sp->write_lock, 0); - - do - { - /* Copy as much as we can into the transmit buffer */ - while (count > 0) - be0c: 00003a06 br bef8 - { - /* We need a stable value of the out pointer to calculate the space available */ - in = sp->tx_in; - be10: e0bffb17 ldw r2,-20(fp) - be14: 10800c17 ldw r2,48(r2) - be18: e0bffa15 stw r2,-24(fp) - out = sp->tx_out; - be1c: e0bffb17 ldw r2,-20(fp) - be20: 10800d17 ldw r2,52(r2) - be24: e0bff915 stw r2,-28(fp) - - if (in < out) - be28: e0fffa17 ldw r3,-24(fp) - be2c: e0bff917 ldw r2,-28(fp) - be30: 1880062e bgeu r3,r2,be4c - n = out - 1 - in; - be34: e0fff917 ldw r3,-28(fp) - be38: e0bffa17 ldw r2,-24(fp) - be3c: 1885c83a sub r2,r3,r2 - be40: 10bfffc4 addi r2,r2,-1 - be44: e0bff815 stw r2,-32(fp) - be48: 00000c06 br be7c - else if (out > 0) - be4c: e0bff917 ldw r2,-28(fp) - be50: 1005003a cmpeq r2,r2,zero - be54: 1000051e bne r2,zero,be6c - n = ALTERA_AVALON_JTAG_UART_BUF_LEN - in; - be58: 00820004 movi r2,2048 - be5c: e0fffa17 ldw r3,-24(fp) - be60: 10c5c83a sub r2,r2,r3 - be64: e0bff815 stw r2,-32(fp) - be68: 00000406 br be7c - else - n = ALTERA_AVALON_JTAG_UART_BUF_LEN - 1 - in; - be6c: 0081ffc4 movi r2,2047 - be70: e0fffa17 ldw r3,-24(fp) - be74: 10c5c83a sub r2,r2,r3 - be78: e0bff815 stw r2,-32(fp) - - if (n == 0) - be7c: e0bff817 ldw r2,-32(fp) - be80: 1005003a cmpeq r2,r2,zero - be84: 10001f1e bne r2,zero,bf04 - break; - - if (n > count) - be88: e0fffd17 ldw r3,-12(fp) - be8c: e0bff817 ldw r2,-32(fp) - be90: 1880022e bgeu r3,r2,be9c - n = count; - be94: e0bffd17 ldw r2,-12(fp) - be98: e0bff815 stw r2,-32(fp) - - memcpy(sp->tx_buf + in, ptr, n); - be9c: e0bffb17 ldw r2,-20(fp) - bea0: 10c20e04 addi r3,r2,2104 - bea4: e0bffa17 ldw r2,-24(fp) - bea8: 1885883a add r2,r3,r2 - beac: e0fffc17 ldw r3,-16(fp) - beb0: 1009883a mov r4,r2 - beb4: 180b883a mov r5,r3 - beb8: e1bff817 ldw r6,-32(fp) - bebc: 00066180 call 6618 - ptr += n; - bec0: e0fff817 ldw r3,-32(fp) - bec4: e0bffc17 ldw r2,-16(fp) - bec8: 10c5883a add r2,r2,r3 - becc: e0bffc15 stw r2,-16(fp) - count -= n; - bed0: e0fffd17 ldw r3,-12(fp) - bed4: e0bff817 ldw r2,-32(fp) - bed8: 1885c83a sub r2,r3,r2 - bedc: e0bffd15 stw r2,-12(fp) - - sp->tx_in = (in + n) % ALTERA_AVALON_JTAG_UART_BUF_LEN; - bee0: e0fffa17 ldw r3,-24(fp) - bee4: e0bff817 ldw r2,-32(fp) - bee8: 1885883a add r2,r3,r2 - beec: 10c1ffcc andi r3,r2,2047 - bef0: e0bffb17 ldw r2,-20(fp) - bef4: 10c00c15 stw r3,48(r2) - ALT_SEM_PEND (sp->write_lock, 0); - - do - { - /* Copy as much as we can into the transmit buffer */ - while (count > 0) - bef8: e0bffd17 ldw r2,-12(fp) - befc: 10800048 cmpgei r2,r2,1 - bf00: 103fc31e bne r2,zero,be10 -static ALT_INLINE alt_irq_context ALT_ALWAYS_INLINE - alt_irq_disable_all (void) -{ - alt_irq_context context; - - NIOS2_READ_STATUS (context); - bf04: 0005303a rdctl r2,status - bf08: e0bff515 stw r2,-44(fp) - - NIOS2_WRITE_STATUS (context & ~NIOS2_STATUS_PIE_MSK); - bf0c: e0fff517 ldw r3,-44(fp) - bf10: 00bfff84 movi r2,-2 - bf14: 1884703a and r2,r3,r2 - bf18: 1001703a wrctl status,r2 - - return context; - bf1c: e0bff517 ldw r2,-44(fp) - * to enable interrupts if there is no space left in the FIFO - * - * For now kick the interrupt routine every time to make it transmit - * the data - */ - context = alt_irq_disable_all(); - bf20: e0bff715 stw r2,-36(fp) - sp->irq_enable |= ALTERA_AVALON_JTAG_UART_CONTROL_WE_MSK; - bf24: e0bffb17 ldw r2,-20(fp) - bf28: 10800817 ldw r2,32(r2) - bf2c: 10c00094 ori r3,r2,2 - bf30: e0bffb17 ldw r2,-20(fp) - bf34: 10c00815 stw r3,32(r2) - IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base, sp->irq_enable); - bf38: e0bffb17 ldw r2,-20(fp) - bf3c: 10800017 ldw r2,0(r2) - bf40: 11000104 addi r4,r2,4 - bf44: e0bffb17 ldw r2,-20(fp) - bf48: 10800817 ldw r2,32(r2) - bf4c: 1007883a mov r3,r2 - bf50: 2005883a mov r2,r4 - bf54: 10c00035 stwio r3,0(r2) - bf58: e0bff717 ldw r2,-36(fp) - bf5c: e0bff415 stw r2,-48(fp) - status &= ~NIOS2_STATUS_PIE_MSK; - status |= (context & NIOS2_STATUS_PIE_MSK); - - NIOS2_WRITE_STATUS (status); -#else - NIOS2_WRITE_STATUS (context); - bf60: e0bff417 ldw r2,-48(fp) - bf64: 1001703a wrctl status,r2 - /* - * If there is any data left then either return now or block until - * some has been sent - */ - /* consider: test whether there is anything there while doing this and delay for at most 2s. */ - if (count > 0) - bf68: e0bffd17 ldw r2,-12(fp) - bf6c: 10800050 cmplti r2,r2,1 - bf70: 1000111e bne r2,zero,bfb8 - { - if (flags & O_NONBLOCK) - bf74: e0bffe17 ldw r2,-8(fp) - bf78: 1090000c andi r2,r2,16384 - bf7c: 1004c03a cmpne r2,r2,zero - bf80: 1000101e bne r2,zero,bfc4 - /* - * No OS present: Always wait for data to be removed from buffer. Once - * the interrupt routine has removed some data then we will be able to - * insert some more. - */ - while (out == sp->tx_out && sp->host_inactive < sp->timeout) - bf84: e0bffb17 ldw r2,-20(fp) - bf88: 10c00d17 ldw r3,52(r2) - bf8c: e0bff917 ldw r2,-28(fp) - bf90: 1880051e bne r3,r2,bfa8 - bf94: e0bffb17 ldw r2,-20(fp) - bf98: 10c00917 ldw r3,36(r2) - bf9c: e0bffb17 ldw r2,-20(fp) - bfa0: 10800117 ldw r2,4(r2) - bfa4: 18bff736 bltu r3,r2,bf84 - ; -#endif /* __ucosii__ */ - - if (out == sp->tx_out) - bfa8: e0bffb17 ldw r2,-20(fp) - bfac: 10c00d17 ldw r3,52(r2) - bfb0: e0bff917 ldw r2,-28(fp) - bfb4: 18800326 beq r3,r2,bfc4 - break; - } - } - while (count > 0); - bfb8: e0bffd17 ldw r2,-12(fp) - bfbc: 10800048 cmpgei r2,r2,1 - bfc0: 103fcd1e bne r2,zero,bef8 - * Now that access to the circular buffer is complete, release the write - * semaphore so that other threads can access the buffer. - */ - ALT_SEM_POST (sp->write_lock); - - if (ptr != start) - bfc4: e0fffc17 ldw r3,-16(fp) - bfc8: e0bff617 ldw r2,-40(fp) - bfcc: 18800526 beq r3,r2,bfe4 - return ptr - start; - bfd0: e0fffc17 ldw r3,-16(fp) - bfd4: e0bff617 ldw r2,-40(fp) - bfd8: 1887c83a sub r3,r3,r2 - bfdc: e0ffff15 stw r3,-4(fp) - bfe0: 00000906 br c008 - else if (flags & O_NONBLOCK) - bfe4: e0bffe17 ldw r2,-8(fp) - bfe8: 1090000c andi r2,r2,16384 - bfec: 1005003a cmpeq r2,r2,zero - bff0: 1000031e bne r2,zero,c000 - return -EWOULDBLOCK; - bff4: 00bffd44 movi r2,-11 - bff8: e0bfff15 stw r2,-4(fp) - bffc: 00000206 br c008 - sp->tx_out = sp->tx_in = 0; - return ptr - start + count; - } -#endif - else - return -EIO; /* Host not connected */ - c000: 00bffec4 movi r2,-5 - c004: e0bfff15 stw r2,-4(fp) - c008: e0bfff17 ldw r2,-4(fp) -} - c00c: e037883a mov sp,fp - c010: dfc00117 ldw ra,4(sp) - c014: df000017 ldw fp,0(sp) - c018: dec00204 addi sp,sp,8 - c01c: f800283a ret - -0000c020 : - -/* --------------------------------------------------------------------- */ - -static void lcd_write_command(altera_avalon_lcd_16207_state* sp, - unsigned char command) -{ - c020: defffa04 addi sp,sp,-24 - c024: dfc00515 stw ra,20(sp) - c028: df000415 stw fp,16(sp) - c02c: df000404 addi fp,sp,16 - c030: e13ffe15 stw r4,-8(fp) - c034: e17fff05 stb r5,-4(fp) - unsigned int base = sp->base; - c038: e0bffe17 ldw r2,-8(fp) - c03c: 10800017 ldw r2,0(r2) - c040: e0bffd15 stw r2,-12(fp) - /* We impose a timeout on the driver in case the LCD panel isn't connected. - * The first time we call this function the timeout is approx 25ms - * (assuming 5 cycles per loop and a 200MHz clock). Obviously systems - * with slower clocks, or debug builds, or slower memory will take longer. - */ - int i = 1000000; - c044: 008003f4 movhi r2,15 - c048: 10909004 addi r2,r2,16960 - c04c: e0bffc15 stw r2,-16(fp) - - /* Don't bother if the LCD panel didn't work before */ - if (sp->broken) - c050: e0bffe17 ldw r2,-8(fp) - c054: 10800803 ldbu r2,32(r2) - c058: 10803fcc andi r2,r2,255 - c05c: 1080201c xori r2,r2,128 - c060: 10bfe004 addi r2,r2,-128 - c064: 1004c03a cmpne r2,r2,zero - c068: 1000161e bne r2,zero,c0c4 - return; - - /* Wait until LCD isn't busy. */ - while (IORD_ALTERA_AVALON_LCD_16207_STATUS(base) & ALTERA_AVALON_LCD_16207_STATUS_BUSY_MSK) - c06c: 00000a06 br c098 - if (--i == 0) - c070: e0bffc17 ldw r2,-16(fp) - c074: 10bfffc4 addi r2,r2,-1 - c078: e0bffc15 stw r2,-16(fp) - c07c: e0bffc17 ldw r2,-16(fp) - c080: 1004c03a cmpne r2,r2,zero - c084: 1000041e bne r2,zero,c098 - { - sp->broken = 1; - c088: e0fffe17 ldw r3,-8(fp) - c08c: 00800044 movi r2,1 - c090: 18800805 stb r2,32(r3) - return; - c094: 00000b06 br c0c4 - /* Don't bother if the LCD panel didn't work before */ - if (sp->broken) - return; - - /* Wait until LCD isn't busy. */ - while (IORD_ALTERA_AVALON_LCD_16207_STATUS(base) & ALTERA_AVALON_LCD_16207_STATUS_BUSY_MSK) - c098: e0bffd17 ldw r2,-12(fp) - c09c: 10800104 addi r2,r2,4 - c0a0: 10800037 ldwio r2,0(r2) - c0a4: 1080200c andi r2,r2,128 - c0a8: 1004c03a cmpne r2,r2,zero - c0ac: 103ff01e bne r2,zero,c070 - } - - /* Despite what it says in the datasheet, the LCD isn't ready to accept - * a write immediately after it returns BUSY=0. Wait for 100us more. - */ - usleep(100); - c0b0: 01001904 movi r4,100 - c0b4: 000dba40 call dba4 - - IOWR_ALTERA_AVALON_LCD_16207_COMMAND(base, command); - c0b8: e0bffd17 ldw r2,-12(fp) - c0bc: e0ffff03 ldbu r3,-4(fp) - c0c0: 10c00035 stwio r3,0(r2) -} - c0c4: e037883a mov sp,fp - c0c8: dfc00117 ldw ra,4(sp) - c0cc: df000017 ldw fp,0(sp) - c0d0: dec00204 addi sp,sp,8 - c0d4: f800283a ret - -0000c0d8 : - -/* --------------------------------------------------------------------- */ - -static void lcd_write_data(altera_avalon_lcd_16207_state* sp, - unsigned char data) -{ - c0d8: defffa04 addi sp,sp,-24 - c0dc: dfc00515 stw ra,20(sp) - c0e0: df000415 stw fp,16(sp) - c0e4: df000404 addi fp,sp,16 - c0e8: e13ffe15 stw r4,-8(fp) - c0ec: e17fff05 stb r5,-4(fp) - unsigned int base = sp->base; - c0f0: e0bffe17 ldw r2,-8(fp) - c0f4: 10800017 ldw r2,0(r2) - c0f8: e0bffd15 stw r2,-12(fp) - /* We impose a timeout on the driver in case the LCD panel isn't connected. - * The first time we call this function the timeout is approx 25ms - * (assuming 5 cycles per loop and a 200MHz clock). Obviously systems - * with slower clocks, or debug builds, or slower memory will take longer. - */ - int i = 1000000; - c0fc: 008003f4 movhi r2,15 - c100: 10909004 addi r2,r2,16960 - c104: e0bffc15 stw r2,-16(fp) - - /* Don't bother if the LCD panel didn't work before */ - if (sp->broken) - c108: e0bffe17 ldw r2,-8(fp) - c10c: 10800803 ldbu r2,32(r2) - c110: 10803fcc andi r2,r2,255 - c114: 1080201c xori r2,r2,128 - c118: 10bfe004 addi r2,r2,-128 - c11c: 1004c03a cmpne r2,r2,zero - c120: 10001d1e bne r2,zero,c198 - return; - - /* Wait until LCD isn't busy. */ - while (IORD_ALTERA_AVALON_LCD_16207_STATUS(base) & ALTERA_AVALON_LCD_16207_STATUS_BUSY_MSK) - c124: 00000a06 br c150 - if (--i == 0) - c128: e0bffc17 ldw r2,-16(fp) - c12c: 10bfffc4 addi r2,r2,-1 - c130: e0bffc15 stw r2,-16(fp) - c134: e0bffc17 ldw r2,-16(fp) - c138: 1004c03a cmpne r2,r2,zero - c13c: 1000041e bne r2,zero,c150 - { - sp->broken = 1; - c140: e0fffe17 ldw r3,-8(fp) - c144: 00800044 movi r2,1 - c148: 18800805 stb r2,32(r3) - return; - c14c: 00001206 br c198 - /* Don't bother if the LCD panel didn't work before */ - if (sp->broken) - return; - - /* Wait until LCD isn't busy. */ - while (IORD_ALTERA_AVALON_LCD_16207_STATUS(base) & ALTERA_AVALON_LCD_16207_STATUS_BUSY_MSK) - c150: e0bffd17 ldw r2,-12(fp) - c154: 10800104 addi r2,r2,4 - c158: 10800037 ldwio r2,0(r2) - c15c: 1080200c andi r2,r2,128 - c160: 1004c03a cmpne r2,r2,zero - c164: 103ff01e bne r2,zero,c128 - } - - /* Despite what it says in the datasheet, the LCD isn't ready to accept - * a write immediately after it returns BUSY=0. Wait for 100us more. - */ - usleep(100); - c168: 01001904 movi r4,100 - c16c: 000dba40 call dba4 - - IOWR_ALTERA_AVALON_LCD_16207_DATA(base, data); - c170: e0bffd17 ldw r2,-12(fp) - c174: 10800204 addi r2,r2,8 - c178: e0ffff03 ldbu r3,-4(fp) - c17c: 10c00035 stwio r3,0(r2) - - sp->address++; - c180: e0bffe17 ldw r2,-8(fp) - c184: 108008c3 ldbu r2,35(r2) - c188: 10800044 addi r2,r2,1 - c18c: 1007883a mov r3,r2 - c190: e0bffe17 ldw r2,-8(fp) - c194: 10c008c5 stb r3,35(r2) -} - c198: e037883a mov sp,fp - c19c: dfc00117 ldw ra,4(sp) - c1a0: df000017 ldw fp,0(sp) - c1a4: dec00204 addi sp,sp,8 - c1a8: f800283a ret - -0000c1ac : - -/* --------------------------------------------------------------------- */ - -static void lcd_clear_screen(altera_avalon_lcd_16207_state* sp) -{ - c1ac: defffb04 addi sp,sp,-20 - c1b0: dfc00415 stw ra,16(sp) - c1b4: df000315 stw fp,12(sp) - c1b8: dc000215 stw r16,8(sp) - c1bc: df000204 addi fp,sp,8 - c1c0: e13fff15 stw r4,-4(fp) - int y; - - lcd_write_command(sp, LCD_CMD_CLEAR); - c1c4: e13fff17 ldw r4,-4(fp) - c1c8: 01400044 movi r5,1 - c1cc: 000c0200 call c020 - - sp->x = 0; - c1d0: e0bfff17 ldw r2,-4(fp) - c1d4: 10000845 stb zero,33(r2) - sp->y = 0; - c1d8: e0bfff17 ldw r2,-4(fp) - c1dc: 10000885 stb zero,34(r2) - sp->address = 0; - c1e0: e0bfff17 ldw r2,-4(fp) - c1e4: 100008c5 stb zero,35(r2) - - for (y = 0 ; y < ALT_LCD_HEIGHT ; y++) - c1e8: e03ffe15 stw zero,-8(fp) - c1ec: 00001c06 br c260 - { - memset(sp->line[y].data, ' ', sizeof(sp->line[0].data)); - c1f0: e13ffe17 ldw r4,-8(fp) - c1f4: 014018c4 movi r5,99 - c1f8: 0009fc80 call 9fc8 <__mulsi3> - c1fc: 10c01004 addi r3,r2,64 - c200: e0bfff17 ldw r2,-4(fp) - c204: 1889883a add r4,r3,r2 - c208: 01400804 movi r5,32 - c20c: 01801444 movi r6,81 - c210: 0001ea40 call 1ea4 - memset(sp->line[y].visible, ' ', sizeof(sp->line[0].visible)); - c214: e13ffe17 ldw r4,-8(fp) - c218: 014018c4 movi r5,99 - c21c: 0009fc80 call 9fc8 <__mulsi3> - c220: 10c00c04 addi r3,r2,48 - c224: e0bfff17 ldw r2,-4(fp) - c228: 1889883a add r4,r3,r2 - c22c: 01400804 movi r5,32 - c230: 01800404 movi r6,16 - c234: 0001ea40 call 1ea4 - sp->line[y].width = 0; - c238: e13ffe17 ldw r4,-8(fp) - c23c: e43fff17 ldw r16,-4(fp) - c240: 014018c4 movi r5,99 - c244: 0009fc80 call 9fc8 <__mulsi3> - c248: 1405883a add r2,r2,r16 - c24c: 10802404 addi r2,r2,144 - c250: 10000045 stb zero,1(r2) - - sp->x = 0; - sp->y = 0; - sp->address = 0; - - for (y = 0 ; y < ALT_LCD_HEIGHT ; y++) - c254: e0bffe17 ldw r2,-8(fp) - c258: 10800044 addi r2,r2,1 - c25c: e0bffe15 stw r2,-8(fp) - c260: e0bffe17 ldw r2,-8(fp) - c264: 10800090 cmplti r2,r2,2 - c268: 103fe11e bne r2,zero,c1f0 - { - memset(sp->line[y].data, ' ', sizeof(sp->line[0].data)); - memset(sp->line[y].visible, ' ', sizeof(sp->line[0].visible)); - sp->line[y].width = 0; - } -} - c26c: e037883a mov sp,fp - c270: dfc00217 ldw ra,8(sp) - c274: df000117 ldw fp,4(sp) - c278: dc000017 ldw r16,0(sp) - c27c: dec00304 addi sp,sp,12 - c280: f800283a ret - -0000c284 : - -/* --------------------------------------------------------------------- */ - -static void lcd_repaint_screen(altera_avalon_lcd_16207_state* sp) -{ - c284: defff404 addi sp,sp,-48 - c288: dfc00b15 stw ra,44(sp) - c28c: df000a15 stw fp,40(sp) - c290: dc800915 stw r18,36(sp) - c294: dc400815 stw r17,32(sp) - c298: dc000715 stw r16,28(sp) - c29c: df000704 addi fp,sp,28 - c2a0: e13fff15 stw r4,-4(fp) - /* scrollpos controls how much the lines have scrolled round. The speed - * each line scrolls at is controlled by its speed variable - while - * scrolline lines will wrap at the position set by width - */ - - int scrollpos = sp->scrollpos; - c2a4: e0bfff17 ldw r2,-4(fp) - c2a8: 10800943 ldbu r2,37(r2) - c2ac: 10803fcc andi r2,r2,255 - c2b0: 1080201c xori r2,r2,128 - c2b4: 10bfe004 addi r2,r2,-128 - c2b8: e0bffc15 stw r2,-16(fp) - - for (y = 0 ; y < ALT_LCD_HEIGHT ; y++) - c2bc: e03ffe15 stw zero,-8(fp) - c2c0: 00006a06 br c46c - { - int width = sp->line[y].width; - c2c4: e13ffe17 ldw r4,-8(fp) - c2c8: e43fff17 ldw r16,-4(fp) - c2cc: 014018c4 movi r5,99 - c2d0: 0009fc80 call 9fc8 <__mulsi3> - c2d4: 1405883a add r2,r2,r16 - c2d8: 10802404 addi r2,r2,144 - c2dc: 10800043 ldbu r2,1(r2) - c2e0: 10803fcc andi r2,r2,255 - c2e4: 1080201c xori r2,r2,128 - c2e8: 10bfe004 addi r2,r2,-128 - c2ec: e0bffb15 stw r2,-20(fp) - int offset = (scrollpos * sp->line[y].speed) >> 8; - c2f0: e13ffe17 ldw r4,-8(fp) - c2f4: e43fff17 ldw r16,-4(fp) - c2f8: 014018c4 movi r5,99 - c2fc: 0009fc80 call 9fc8 <__mulsi3> - c300: 1405883a add r2,r2,r16 - c304: 10802404 addi r2,r2,144 - c308: 10800083 ldbu r2,2(r2) - c30c: 11003fcc andi r4,r2,255 - c310: e17ffc17 ldw r5,-16(fp) - c314: 0009fc80 call 9fc8 <__mulsi3> - c318: 1005d23a srai r2,r2,8 - c31c: e0bffa15 stw r2,-24(fp) - if (offset >= width) - c320: e0fffa17 ldw r3,-24(fp) - c324: e0bffb17 ldw r2,-20(fp) - c328: 18800116 blt r3,r2,c330 - offset = 0; - c32c: e03ffa15 stw zero,-24(fp) - - for (x = 0 ; x < ALT_LCD_WIDTH ; x++) - c330: e03ffd15 stw zero,-12(fp) - c334: 00004706 br c454 - { - char c = sp->line[y].data[(x + offset) % width]; - c338: e47ffe17 ldw r17,-8(fp) - c33c: e0fffd17 ldw r3,-12(fp) - c340: e0bffa17 ldw r2,-24(fp) - c344: 1889883a add r4,r3,r2 - c348: e17ffb17 ldw r5,-20(fp) - c34c: 0009f580 call 9f58 <__modsi3> - c350: 1025883a mov r18,r2 - c354: e43fff17 ldw r16,-4(fp) - c358: 8809883a mov r4,r17 - c35c: 014018c4 movi r5,99 - c360: 0009fc80 call 9fc8 <__mulsi3> - c364: 1405883a add r2,r2,r16 - c368: 1485883a add r2,r2,r18 - c36c: 10801004 addi r2,r2,64 - c370: 10800003 ldbu r2,0(r2) - c374: e0bff945 stb r2,-27(fp) - - /* Writing data takes 40us, so don't do it unless required */ - if (sp->line[y].visible[x] != c) - c378: e13ffe17 ldw r4,-8(fp) - c37c: e47ffd17 ldw r17,-12(fp) - c380: e43fff17 ldw r16,-4(fp) - c384: 014018c4 movi r5,99 - c388: 0009fc80 call 9fc8 <__mulsi3> - c38c: 1405883a add r2,r2,r16 - c390: 1445883a add r2,r2,r17 - c394: 10800c04 addi r2,r2,48 - c398: 10800003 ldbu r2,0(r2) - c39c: 10c03fcc andi r3,r2,255 - c3a0: 18c0201c xori r3,r3,128 - c3a4: 18ffe004 addi r3,r3,-128 - c3a8: e0bff947 ldb r2,-27(fp) - c3ac: 18802626 beq r3,r2,c448 - { - unsigned char address = x + colstart[y]; - c3b0: e0fffe17 ldw r3,-8(fp) - c3b4: d0a00d04 addi r2,gp,-32716 - c3b8: 1885883a add r2,r3,r2 - c3bc: 10800003 ldbu r2,0(r2) - c3c0: 1007883a mov r3,r2 - c3c4: e0bffd17 ldw r2,-12(fp) - c3c8: 1885883a add r2,r3,r2 - c3cc: e0bff905 stb r2,-28(fp) - - if (address != sp->address) - c3d0: e0fff903 ldbu r3,-28(fp) - c3d4: e0bfff17 ldw r2,-4(fp) - c3d8: 108008c3 ldbu r2,35(r2) - c3dc: 10803fcc andi r2,r2,255 - c3e0: 1080201c xori r2,r2,128 - c3e4: 10bfe004 addi r2,r2,-128 - c3e8: 18800926 beq r3,r2,c410 - { - lcd_write_command(sp, LCD_CMD_WRITE_DATA | address); - c3ec: e0fff903 ldbu r3,-28(fp) - c3f0: 00bfe004 movi r2,-128 - c3f4: 1884b03a or r2,r3,r2 - c3f8: 11403fcc andi r5,r2,255 - c3fc: e13fff17 ldw r4,-4(fp) - c400: 000c0200 call c020 - sp->address = address; - c404: e0fff903 ldbu r3,-28(fp) - c408: e0bfff17 ldw r2,-4(fp) - c40c: 10c008c5 stb r3,35(r2) - } - - lcd_write_data(sp, c); - c410: e0bff943 ldbu r2,-27(fp) - c414: 11403fcc andi r5,r2,255 - c418: e13fff17 ldw r4,-4(fp) - c41c: 000c0d80 call c0d8 - sp->line[y].visible[x] = c; - c420: e13ffe17 ldw r4,-8(fp) - c424: e47ffd17 ldw r17,-12(fp) - c428: e43fff17 ldw r16,-4(fp) - c42c: 014018c4 movi r5,99 - c430: 0009fc80 call 9fc8 <__mulsi3> - c434: 1405883a add r2,r2,r16 - c438: 1445883a add r2,r2,r17 - c43c: 10c00c04 addi r3,r2,48 - c440: e0bff943 ldbu r2,-27(fp) - c444: 18800005 stb r2,0(r3) - int width = sp->line[y].width; - int offset = (scrollpos * sp->line[y].speed) >> 8; - if (offset >= width) - offset = 0; - - for (x = 0 ; x < ALT_LCD_WIDTH ; x++) - c448: e0bffd17 ldw r2,-12(fp) - c44c: 10800044 addi r2,r2,1 - c450: e0bffd15 stw r2,-12(fp) - c454: e0bffd17 ldw r2,-12(fp) - c458: 10800410 cmplti r2,r2,16 - c45c: 103fb61e bne r2,zero,c338 - * scrolline lines will wrap at the position set by width - */ - - int scrollpos = sp->scrollpos; - - for (y = 0 ; y < ALT_LCD_HEIGHT ; y++) - c460: e0bffe17 ldw r2,-8(fp) - c464: 10800044 addi r2,r2,1 - c468: e0bffe15 stw r2,-8(fp) - c46c: e0bffe17 ldw r2,-8(fp) - c470: 10800090 cmplti r2,r2,2 - c474: 103f931e bne r2,zero,c2c4 - lcd_write_data(sp, c); - sp->line[y].visible[x] = c; - } - } - } -} - c478: e037883a mov sp,fp - c47c: dfc00417 ldw ra,16(sp) - c480: df000317 ldw fp,12(sp) - c484: dc800217 ldw r18,8(sp) - c488: dc400117 ldw r17,4(sp) - c48c: dc000017 ldw r16,0(sp) - c490: dec00504 addi sp,sp,20 - c494: f800283a ret - -0000c498 : - -/* --------------------------------------------------------------------- */ - -static void lcd_scroll_up(altera_avalon_lcd_16207_state* sp) -{ - c498: defffb04 addi sp,sp,-20 - c49c: dfc00415 stw ra,16(sp) - c4a0: df000315 stw fp,12(sp) - c4a4: dc000215 stw r16,8(sp) - c4a8: df000204 addi fp,sp,8 - c4ac: e13fff15 stw r4,-4(fp) - int y; - - for (y = 0 ; y < ALT_LCD_HEIGHT ; y++) - c4b0: e03ffe15 stw zero,-8(fp) - c4b4: 00002106 br c53c - { - if (y < ALT_LCD_HEIGHT-1) - c4b8: e0bffe17 ldw r2,-8(fp) - c4bc: 10800048 cmpgei r2,r2,1 - c4c0: 1000121e bne r2,zero,c50c - memcpy(sp->line[y].data, sp->line[y+1].data, ALT_LCD_VIRTUAL_WIDTH); - c4c4: e13ffe17 ldw r4,-8(fp) - c4c8: 014018c4 movi r5,99 - c4cc: 0009fc80 call 9fc8 <__mulsi3> - c4d0: 10c01004 addi r3,r2,64 - c4d4: e0bfff17 ldw r2,-4(fp) - c4d8: 18a1883a add r16,r3,r2 - c4dc: e0bffe17 ldw r2,-8(fp) - c4e0: 11000044 addi r4,r2,1 - c4e4: 014018c4 movi r5,99 - c4e8: 0009fc80 call 9fc8 <__mulsi3> - c4ec: 10c01004 addi r3,r2,64 - c4f0: e0bfff17 ldw r2,-4(fp) - c4f4: 1885883a add r2,r3,r2 - c4f8: 8009883a mov r4,r16 - c4fc: 100b883a mov r5,r2 - c500: 01801404 movi r6,80 - c504: 00066180 call 6618 - c508: 00000906 br c530 - else - memset(sp->line[y].data, ' ', ALT_LCD_VIRTUAL_WIDTH); - c50c: e13ffe17 ldw r4,-8(fp) - c510: 014018c4 movi r5,99 - c514: 0009fc80 call 9fc8 <__mulsi3> - c518: 10c01004 addi r3,r2,64 - c51c: e0bfff17 ldw r2,-4(fp) - c520: 1889883a add r4,r3,r2 - c524: 01400804 movi r5,32 - c528: 01801404 movi r6,80 - c52c: 0001ea40 call 1ea4 - -static void lcd_scroll_up(altera_avalon_lcd_16207_state* sp) -{ - int y; - - for (y = 0 ; y < ALT_LCD_HEIGHT ; y++) - c530: e0bffe17 ldw r2,-8(fp) - c534: 10800044 addi r2,r2,1 - c538: e0bffe15 stw r2,-8(fp) - c53c: e0bffe17 ldw r2,-8(fp) - c540: 10800090 cmplti r2,r2,2 - c544: 103fdc1e bne r2,zero,c4b8 - memcpy(sp->line[y].data, sp->line[y+1].data, ALT_LCD_VIRTUAL_WIDTH); - else - memset(sp->line[y].data, ' ', ALT_LCD_VIRTUAL_WIDTH); - } - - sp->y--; - c548: e0bfff17 ldw r2,-4(fp) - c54c: 10800883 ldbu r2,34(r2) - c550: 10bfffc4 addi r2,r2,-1 - c554: 1007883a mov r3,r2 - c558: e0bfff17 ldw r2,-4(fp) - c55c: 10c00885 stb r3,34(r2) -} - c560: e037883a mov sp,fp - c564: dfc00217 ldw ra,8(sp) - c568: df000117 ldw fp,4(sp) - c56c: dc000017 ldw r16,0(sp) - c570: dec00304 addi sp,sp,12 - c574: f800283a ret - -0000c578 : - -/* --------------------------------------------------------------------- */ - -static void lcd_handle_escape(altera_avalon_lcd_16207_state* sp, char c) -{ - c578: defff804 addi sp,sp,-32 - c57c: dfc00715 stw ra,28(sp) - c580: df000615 stw fp,24(sp) - c584: df000604 addi fp,sp,24 - c588: e13ffd15 stw r4,-12(fp) - c58c: e17ffe05 stb r5,-8(fp) - int parm1 = 0, parm2 = 0; - c590: e03ffc15 stw zero,-16(fp) - c594: e03ffb15 stw zero,-20(fp) - - if (sp->escape[0] == '[') - c598: e0bffd17 ldw r2,-12(fp) - c59c: 10800a03 ldbu r2,40(r2) - c5a0: 10803fcc andi r2,r2,255 - c5a4: 1080201c xori r2,r2,128 - c5a8: 10bfe004 addi r2,r2,-128 - c5ac: 108016d8 cmpnei r2,r2,91 - c5b0: 10004d1e bne r2,zero,c6e8 - { - char * ptr = sp->escape+1; - c5b4: e0bffd17 ldw r2,-12(fp) - c5b8: 10800a04 addi r2,r2,40 - c5bc: 10800044 addi r2,r2,1 - c5c0: e0bffa15 stw r2,-24(fp) - while (isdigit(*ptr)) - c5c4: 00000f06 br c604 - parm1 = (parm1 * 10) + (*ptr++ - '0'); - c5c8: e13ffc17 ldw r4,-16(fp) - c5cc: 01400284 movi r5,10 - c5d0: 0009fc80 call 9fc8 <__mulsi3> - c5d4: 1007883a mov r3,r2 - c5d8: e0bffa17 ldw r2,-24(fp) - c5dc: 10800003 ldbu r2,0(r2) - c5e0: 10803fcc andi r2,r2,255 - c5e4: 1080201c xori r2,r2,128 - c5e8: 10bfe004 addi r2,r2,-128 - c5ec: 1885883a add r2,r3,r2 - c5f0: 10bff404 addi r2,r2,-48 - c5f4: e0bffc15 stw r2,-16(fp) - c5f8: e0bffa17 ldw r2,-24(fp) - c5fc: 10800044 addi r2,r2,1 - c600: e0bffa15 stw r2,-24(fp) - int parm1 = 0, parm2 = 0; - - if (sp->escape[0] == '[') - { - char * ptr = sp->escape+1; - while (isdigit(*ptr)) - c604: e0bffa17 ldw r2,-24(fp) - c608: 10800003 ldbu r2,0(r2) - c60c: 10803fcc andi r2,r2,255 - c610: 1080201c xori r2,r2,128 - c614: 10bfe004 addi r2,r2,-128 - c618: 1007883a mov r3,r2 - c61c: 00800074 movhi r2,1 - c620: 1080c304 addi r2,r2,780 - c624: 10800017 ldw r2,0(r2) - c628: 1885883a add r2,r3,r2 - c62c: 10800003 ldbu r2,0(r2) - c630: 10803fcc andi r2,r2,255 - c634: 1080010c andi r2,r2,4 - c638: 1004c03a cmpne r2,r2,zero - c63c: 103fe21e bne r2,zero,c5c8 - parm1 = (parm1 * 10) + (*ptr++ - '0'); - - if (*ptr == ';') - c640: e0bffa17 ldw r2,-24(fp) - c644: 10800003 ldbu r2,0(r2) - c648: 10803fcc andi r2,r2,255 - c64c: 1080201c xori r2,r2,128 - c650: 10bfe004 addi r2,r2,-128 - c654: 10800ed8 cmpnei r2,r2,59 - c658: 1000251e bne r2,zero,c6f0 - { - ptr++; - c65c: e0bffa17 ldw r2,-24(fp) - c660: 10800044 addi r2,r2,1 - c664: e0bffa15 stw r2,-24(fp) - while (isdigit(*ptr)) - c668: 00000f06 br c6a8 - parm2 = (parm2 * 10) + (*ptr++ - '0'); - c66c: e13ffb17 ldw r4,-20(fp) - c670: 01400284 movi r5,10 - c674: 0009fc80 call 9fc8 <__mulsi3> - c678: 1007883a mov r3,r2 - c67c: e0bffa17 ldw r2,-24(fp) - c680: 10800003 ldbu r2,0(r2) - c684: 10803fcc andi r2,r2,255 - c688: 1080201c xori r2,r2,128 - c68c: 10bfe004 addi r2,r2,-128 - c690: 1885883a add r2,r3,r2 - c694: 10bff404 addi r2,r2,-48 - c698: e0bffb15 stw r2,-20(fp) - c69c: e0bffa17 ldw r2,-24(fp) - c6a0: 10800044 addi r2,r2,1 - c6a4: e0bffa15 stw r2,-24(fp) - parm1 = (parm1 * 10) + (*ptr++ - '0'); - - if (*ptr == ';') - { - ptr++; - while (isdigit(*ptr)) - c6a8: e0bffa17 ldw r2,-24(fp) - c6ac: 10800003 ldbu r2,0(r2) - c6b0: 10803fcc andi r2,r2,255 - c6b4: 1080201c xori r2,r2,128 - c6b8: 10bfe004 addi r2,r2,-128 - c6bc: 1007883a mov r3,r2 - c6c0: 00800074 movhi r2,1 - c6c4: 1080c304 addi r2,r2,780 - c6c8: 10800017 ldw r2,0(r2) - c6cc: 1885883a add r2,r3,r2 - c6d0: 10800003 ldbu r2,0(r2) - c6d4: 10803fcc andi r2,r2,255 - c6d8: 1080010c andi r2,r2,4 - c6dc: 1004c03a cmpne r2,r2,zero - c6e0: 103fe21e bne r2,zero,c66c - c6e4: 00000206 br c6f0 - parm2 = (parm2 * 10) + (*ptr++ - '0'); - } - } - else - parm1 = -1; - c6e8: 00bfffc4 movi r2,-1 - c6ec: e0bffc15 stw r2,-16(fp) - - switch (c) - c6f0: e0bffe07 ldb r2,-8(fp) - c6f4: e0bfff15 stw r2,-4(fp) - c6f8: e0ffff17 ldw r3,-4(fp) - c6fc: 188012a0 cmpeqi r2,r3,74 - c700: 10002f1e bne r2,zero,c7c0 - c704: e0ffff17 ldw r3,-4(fp) - c708: 188012c8 cmpgei r2,r3,75 - c70c: 1000041e bne r2,zero,c720 - c710: e0ffff17 ldw r3,-4(fp) - c714: 18801220 cmpeqi r2,r3,72 - c718: 1000081e bne r2,zero,c73c - c71c: 00004a06 br c848 - c720: e0ffff17 ldw r3,-4(fp) - c724: 188012e0 cmpeqi r2,r3,75 - c728: 10002b1e bne r2,zero,c7d8 - c72c: e0ffff17 ldw r3,-4(fp) - c730: 188019a0 cmpeqi r2,r3,102 - c734: 1000011e bne r2,zero,c73c - c738: 00004306 br c848 - { - case 'H': /* ESC '[' ';' 'H' : Move cursor to location */ - case 'f': /* Same as above */ - if (parm2 > 0) - c73c: e0bffb17 ldw r2,-20(fp) - c740: 10800050 cmplti r2,r2,1 - c744: 1000051e bne r2,zero,c75c - sp->x = parm2 - 1; - c748: e0bffb17 ldw r2,-20(fp) - c74c: 10bfffc4 addi r2,r2,-1 - c750: 1007883a mov r3,r2 - c754: e0bffd17 ldw r2,-12(fp) - c758: 10c00845 stb r3,33(r2) - if (parm1 > 0) - c75c: e0bffc17 ldw r2,-16(fp) - c760: 10800050 cmplti r2,r2,1 - c764: 1000381e bne r2,zero,c848 - { - sp->y = parm1 - 1; - c768: e0bffc17 ldw r2,-16(fp) - c76c: 10bfffc4 addi r2,r2,-1 - c770: 1007883a mov r3,r2 - c774: e0bffd17 ldw r2,-12(fp) - c778: 10c00885 stb r3,34(r2) - if (sp->y > ALT_LCD_HEIGHT * 2) - c77c: e0bffd17 ldw r2,-12(fp) - c780: 10800883 ldbu r2,34(r2) - c784: 10803fcc andi r2,r2,255 - c788: 10800170 cmpltui r2,r2,5 - c78c: 1000061e bne r2,zero,c7a8 - sp->y = ALT_LCD_HEIGHT * 2; - c790: e0fffd17 ldw r3,-12(fp) - c794: 00800104 movi r2,4 - c798: 18800885 stb r2,34(r3) - while (sp->y > ALT_LCD_HEIGHT) - c79c: 00000206 br c7a8 - lcd_scroll_up(sp); - c7a0: e13ffd17 ldw r4,-12(fp) - c7a4: 000c4980 call c498 - if (parm1 > 0) - { - sp->y = parm1 - 1; - if (sp->y > ALT_LCD_HEIGHT * 2) - sp->y = ALT_LCD_HEIGHT * 2; - while (sp->y > ALT_LCD_HEIGHT) - c7a8: e0bffd17 ldw r2,-12(fp) - c7ac: 10800883 ldbu r2,34(r2) - c7b0: 10803fcc andi r2,r2,255 - c7b4: 108000e8 cmpgeui r2,r2,3 - c7b8: 103ff91e bne r2,zero,c7a0 - lcd_scroll_up(sp); - } - break; - c7bc: 00002206 br c848 - /* ESC J is clear to beginning of line [unimplemented] - * ESC [ 0 J is clear to bottom of screen [unimplemented] - * ESC [ 1 J is clear to beginning of screen [unimplemented] - * ESC [ 2 J is clear screen - */ - if (parm1 == 2) - c7c0: e0bffc17 ldw r2,-16(fp) - c7c4: 10800098 cmpnei r2,r2,2 - c7c8: 10001f1e bne r2,zero,c848 - lcd_clear_screen(sp); - c7cc: e13ffd17 ldw r4,-12(fp) - c7d0: 000c1ac0 call c1ac - break; - c7d4: 00001c06 br c848 - /* ESC K is clear to end of line - * ESC [ 0 K is clear to end of line - * ESC [ 1 K is clear to beginning of line [unimplemented] - * ESC [ 2 K is clear line [unimplemented] - */ - if (parm1 < 1) - c7d8: e0bffc17 ldw r2,-16(fp) - c7dc: 10800048 cmpgei r2,r2,1 - c7e0: 1000191e bne r2,zero,c848 - { - if (sp->x < ALT_LCD_VIRTUAL_WIDTH) - c7e4: e0bffd17 ldw r2,-12(fp) - c7e8: 10800843 ldbu r2,33(r2) - c7ec: 10803fcc andi r2,r2,255 - c7f0: 10801428 cmpgeui r2,r2,80 - c7f4: 1000141e bne r2,zero,c848 - memset(sp->line[sp->y].data + sp->x, ' ', ALT_LCD_VIRTUAL_WIDTH - sp->x); - c7f8: e0bffd17 ldw r2,-12(fp) - c7fc: 10800883 ldbu r2,34(r2) - c800: 11003fcc andi r4,r2,255 - c804: 014018c4 movi r5,99 - c808: 0009fc80 call 9fc8 <__mulsi3> - c80c: 10c01004 addi r3,r2,64 - c810: e0bffd17 ldw r2,-12(fp) - c814: 1887883a add r3,r3,r2 - c818: e0bffd17 ldw r2,-12(fp) - c81c: 10800843 ldbu r2,33(r2) - c820: 10803fcc andi r2,r2,255 - c824: 1889883a add r4,r3,r2 - c828: e0bffd17 ldw r2,-12(fp) - c82c: 10800843 ldbu r2,33(r2) - c830: 10c03fcc andi r3,r2,255 - c834: 00801404 movi r2,80 - c838: 10c5c83a sub r2,r2,r3 - c83c: 100d883a mov r6,r2 - c840: 01400804 movi r5,32 - c844: 0001ea40 call 1ea4 - } - break; - } -} - c848: e037883a mov sp,fp - c84c: dfc00117 ldw ra,4(sp) - c850: df000017 ldw fp,0(sp) - c854: dec00204 addi sp,sp,8 - c858: f800283a ret - -0000c85c : - -/* --------------------------------------------------------------------- */ - -int altera_avalon_lcd_16207_write(altera_avalon_lcd_16207_state* sp, - const char* ptr, int len, int flags) -{ - c85c: defff004 addi sp,sp,-64 - c860: dfc00f15 stw ra,60(sp) - c864: df000e15 stw fp,56(sp) - c868: dc800d15 stw r18,52(sp) - c86c: dc400c15 stw r17,48(sp) - c870: dc000b15 stw r16,44(sp) - c874: df000b04 addi fp,sp,44 - c878: e13ffc15 stw r4,-16(fp) - c87c: e17ffd15 stw r5,-12(fp) - c880: e1bffe15 stw r6,-8(fp) - c884: e1ffff15 stw r7,-4(fp) - const char* end = ptr + len; - c888: e0bffe17 ldw r2,-8(fp) - c88c: 1007883a mov r3,r2 - c890: e0bffd17 ldw r2,-12(fp) - c894: 10c5883a add r2,r2,r3 - c898: e0bffb15 stw r2,-20(fp) - - ALT_SEM_PEND (sp->write_lock, 0); - - /* Tell the routine which is called off the timer interrupt that the - * foreground routines are active so it must not repaint the display. */ - sp->active = 1; - c89c: e0fffc17 ldw r3,-16(fp) - c8a0: 00800044 movi r2,1 - c8a4: 188009c5 stb r2,39(r3) - - for ( ; ptr < end ; ptr++) - c8a8: 0000a306 br cb38 - { - char c = *ptr; - c8ac: e0bffd17 ldw r2,-12(fp) - c8b0: 10800003 ldbu r2,0(r2) - c8b4: e0bff805 stb r2,-32(fp) - - if (sp->esccount >= 0) - c8b8: e0bffc17 ldw r2,-16(fp) - c8bc: 10800903 ldbu r2,36(r2) - c8c0: 10803fcc andi r2,r2,255 - c8c4: 1080201c xori r2,r2,128 - c8c8: 10bfe004 addi r2,r2,-128 - c8cc: 1004803a cmplt r2,r2,zero - c8d0: 10003b1e bne r2,zero,c9c0 - { - unsigned int esccount = sp->esccount; - c8d4: e0bffc17 ldw r2,-16(fp) - c8d8: 10800903 ldbu r2,36(r2) - c8dc: 10803fcc andi r2,r2,255 - c8e0: 1080201c xori r2,r2,128 - c8e4: 10bfe004 addi r2,r2,-128 - c8e8: e0bff715 stw r2,-36(fp) - - /* Single character escape sequences can end with any character - * Multi character escape sequences start with '[' and contain - * digits and semicolons before terminating - */ - if ((esccount == 0 && c != '[') || - c8ec: e0bff717 ldw r2,-36(fp) - c8f0: 1004c03a cmpne r2,r2,zero - c8f4: 1000031e bne r2,zero,c904 - c8f8: e0bff807 ldb r2,-32(fp) - c8fc: 108016d8 cmpnei r2,r2,91 - c900: 1000111e bne r2,zero,c948 - c904: e0bff717 ldw r2,-36(fp) - c908: 1005003a cmpeq r2,r2,zero - c90c: 10001a1e bne r2,zero,c978 - c910: e0bff807 ldb r2,-32(fp) - c914: 1007883a mov r3,r2 - c918: 00800074 movhi r2,1 - c91c: 1080c304 addi r2,r2,780 - c920: 10800017 ldw r2,0(r2) - c924: 1885883a add r2,r3,r2 - c928: 10800003 ldbu r2,0(r2) - c92c: 10803fcc andi r2,r2,255 - c930: 1080010c andi r2,r2,4 - c934: 1004c03a cmpne r2,r2,zero - c938: 10000f1e bne r2,zero,c978 - c93c: e0bff807 ldb r2,-32(fp) - c940: 10800ee0 cmpeqi r2,r2,59 - c944: 10000c1e bne r2,zero,c978 - (esccount > 0 && !isdigit(c) && c != ';')) - { - sp->escape[esccount] = 0; - c948: e0fff717 ldw r3,-36(fp) - c94c: e0bffc17 ldw r2,-16(fp) - c950: 1885883a add r2,r3,r2 - c954: 10800a04 addi r2,r2,40 - c958: 10000005 stb zero,0(r2) - - lcd_handle_escape(sp, c); - c95c: e17ff807 ldb r5,-32(fp) - c960: e13ffc17 ldw r4,-16(fp) - c964: 000c5780 call c578 - - sp->esccount = -1; - c968: e0fffc17 ldw r3,-16(fp) - c96c: 00bfffc4 movi r2,-1 - c970: 18800905 stb r2,36(r3) - - /* Single character escape sequences can end with any character - * Multi character escape sequences start with '[' and contain - * digits and semicolons before terminating - */ - if ((esccount == 0 && c != '[') || - c974: 00006d06 br cb2c - - lcd_handle_escape(sp, c); - - sp->esccount = -1; - } - else if (sp->esccount < sizeof(sp->escape)-1) - c978: e0bffc17 ldw r2,-16(fp) - c97c: 10800903 ldbu r2,36(r2) - c980: 10803fcc andi r2,r2,255 - c984: 108001e8 cmpgeui r2,r2,7 - c988: 1000681e bne r2,zero,cb2c - { - sp->escape[esccount] = c; - c98c: e0fff717 ldw r3,-36(fp) - c990: e0bffc17 ldw r2,-16(fp) - c994: 1885883a add r2,r3,r2 - c998: 10c00a04 addi r3,r2,40 - c99c: e0bff803 ldbu r2,-32(fp) - c9a0: 18800005 stb r2,0(r3) - sp->esccount++; - c9a4: e0bffc17 ldw r2,-16(fp) - c9a8: 10800903 ldbu r2,36(r2) - c9ac: 10800044 addi r2,r2,1 - c9b0: 1007883a mov r3,r2 - c9b4: e0bffc17 ldw r2,-16(fp) - c9b8: 10c00905 stb r3,36(r2) - c9bc: 00005b06 br cb2c - } - } - else if (c == 27) /* ESC */ - c9c0: e0bff807 ldb r2,-32(fp) - c9c4: 108006d8 cmpnei r2,r2,27 - c9c8: 1000031e bne r2,zero,c9d8 - { - sp->esccount = 0; - c9cc: e0bffc17 ldw r2,-16(fp) - c9d0: 10000905 stb zero,36(r2) - c9d4: 00005506 br cb2c - } - else if (c == '\r') - c9d8: e0bff807 ldb r2,-32(fp) - c9dc: 10800358 cmpnei r2,r2,13 - c9e0: 1000031e bne r2,zero,c9f0 - { - sp->x = 0; - c9e4: e0bffc17 ldw r2,-16(fp) - c9e8: 10000845 stb zero,33(r2) - c9ec: 00004f06 br cb2c - } - else if (c == '\n') - c9f0: e0bff807 ldb r2,-32(fp) - c9f4: 10800298 cmpnei r2,r2,10 - c9f8: 1000101e bne r2,zero,ca3c - { - sp->x = 0; - c9fc: e0bffc17 ldw r2,-16(fp) - ca00: 10000845 stb zero,33(r2) - sp->y++; - ca04: e0bffc17 ldw r2,-16(fp) - ca08: 10800883 ldbu r2,34(r2) - ca0c: 10800044 addi r2,r2,1 - ca10: 1007883a mov r3,r2 - ca14: e0bffc17 ldw r2,-16(fp) - ca18: 10c00885 stb r3,34(r2) - - /* Let the cursor sit at X=0, Y=HEIGHT without scrolling so the user - * can print two lines of data without losing one. - */ - if (sp->y > ALT_LCD_HEIGHT) - ca1c: e0bffc17 ldw r2,-16(fp) - ca20: 10800883 ldbu r2,34(r2) - ca24: 10803fcc andi r2,r2,255 - ca28: 108000f0 cmpltui r2,r2,3 - ca2c: 10003f1e bne r2,zero,cb2c - lcd_scroll_up(sp); - ca30: e13ffc17 ldw r4,-16(fp) - ca34: 000c4980 call c498 - ca38: 00003c06 br cb2c - } - else if (c == '\b') - ca3c: e0bff807 ldb r2,-32(fp) - ca40: 10800218 cmpnei r2,r2,8 - ca44: 10000c1e bne r2,zero,ca78 - { - if (sp->x > 0) - ca48: e0bffc17 ldw r2,-16(fp) - ca4c: 10800843 ldbu r2,33(r2) - ca50: 10803fcc andi r2,r2,255 - ca54: 1005003a cmpeq r2,r2,zero - ca58: 1000341e bne r2,zero,cb2c - sp->x--; - ca5c: e0bffc17 ldw r2,-16(fp) - ca60: 10800843 ldbu r2,33(r2) - ca64: 10bfffc4 addi r2,r2,-1 - ca68: 1007883a mov r3,r2 - ca6c: e0bffc17 ldw r2,-16(fp) - ca70: 10c00845 stb r3,33(r2) - ca74: 00002d06 br cb2c - } - else if (isprint(c)) - ca78: e0bff807 ldb r2,-32(fp) - ca7c: 1007883a mov r3,r2 - ca80: 00800074 movhi r2,1 - ca84: 1080c304 addi r2,r2,780 - ca88: 10800017 ldw r2,0(r2) - ca8c: 1885883a add r2,r3,r2 - ca90: 10800003 ldbu r2,0(r2) - ca94: 10803fcc andi r2,r2,255 - ca98: 1080201c xori r2,r2,128 - ca9c: 10bfe004 addi r2,r2,-128 - caa0: 108025cc andi r2,r2,151 - caa4: 1005003a cmpeq r2,r2,zero - caa8: 1000201e bne r2,zero,cb2c - { - /* If we didn't scroll on the last linefeed then we might need to do - * it now. */ - if (sp->y >= ALT_LCD_HEIGHT) - caac: e0bffc17 ldw r2,-16(fp) - cab0: 10800883 ldbu r2,34(r2) - cab4: 10803fcc andi r2,r2,255 - cab8: 108000b0 cmpltui r2,r2,2 - cabc: 1000021e bne r2,zero,cac8 - lcd_scroll_up(sp); - cac0: e13ffc17 ldw r4,-16(fp) - cac4: 000c4980 call c498 - - if (sp->x < ALT_LCD_VIRTUAL_WIDTH) - cac8: e0bffc17 ldw r2,-16(fp) - cacc: 10800843 ldbu r2,33(r2) - cad0: 10803fcc andi r2,r2,255 - cad4: 10801428 cmpgeui r2,r2,80 - cad8: 10000e1e bne r2,zero,cb14 - sp->line[sp->y].data[sp->x] = c; - cadc: e0bffc17 ldw r2,-16(fp) - cae0: 10800883 ldbu r2,34(r2) - cae4: 11003fcc andi r4,r2,255 - cae8: e0bffc17 ldw r2,-16(fp) - caec: 10800843 ldbu r2,33(r2) - caf0: 14403fcc andi r17,r2,255 - caf4: e43ffc17 ldw r16,-16(fp) - caf8: 014018c4 movi r5,99 - cafc: 0009fc80 call 9fc8 <__mulsi3> - cb00: 1405883a add r2,r2,r16 - cb04: 1445883a add r2,r2,r17 - cb08: 10c01004 addi r3,r2,64 - cb0c: e0bff803 ldbu r2,-32(fp) - cb10: 18800005 stb r2,0(r3) - - sp->x++; - cb14: e0bffc17 ldw r2,-16(fp) - cb18: 10800843 ldbu r2,33(r2) - cb1c: 10800044 addi r2,r2,1 - cb20: 1007883a mov r3,r2 - cb24: e0bffc17 ldw r2,-16(fp) - cb28: 10c00845 stb r3,33(r2) - - /* Tell the routine which is called off the timer interrupt that the - * foreground routines are active so it must not repaint the display. */ - sp->active = 1; - - for ( ; ptr < end ; ptr++) - cb2c: e0bffd17 ldw r2,-12(fp) - cb30: 10800044 addi r2,r2,1 - cb34: e0bffd15 stw r2,-12(fp) - cb38: e0fffd17 ldw r3,-12(fp) - cb3c: e0bffb17 ldw r2,-20(fp) - cb40: 18bf5a36 bltu r3,r2,c8ac - sp->x++; - } - } - - /* Recalculate the scrolling parameters */ - widthmax = ALT_LCD_WIDTH; - cb44: 00800404 movi r2,16 - cb48: e0bff915 stw r2,-28(fp) - for (y = 0 ; y < ALT_LCD_HEIGHT ; y++) - cb4c: e03ffa15 stw zero,-24(fp) - cb50: 00003906 br cc38 - { - int width; - for (width = ALT_LCD_VIRTUAL_WIDTH ; width > 0 ; width--) - cb54: 00801404 movi r2,80 - cb58: e0bff615 stw r2,-40(fp) - cb5c: 00001206 br cba8 - if (sp->line[y].data[width-1] != ' ') - cb60: e13ffa17 ldw r4,-24(fp) - cb64: e0bff617 ldw r2,-40(fp) - cb68: 147fffc4 addi r17,r2,-1 - cb6c: e43ffc17 ldw r16,-16(fp) - cb70: 014018c4 movi r5,99 - cb74: 0009fc80 call 9fc8 <__mulsi3> - cb78: 1405883a add r2,r2,r16 - cb7c: 1445883a add r2,r2,r17 - cb80: 10801004 addi r2,r2,64 - cb84: 10800003 ldbu r2,0(r2) - cb88: 10803fcc andi r2,r2,255 - cb8c: 1080201c xori r2,r2,128 - cb90: 10bfe004 addi r2,r2,-128 - cb94: 10800818 cmpnei r2,r2,32 - cb98: 1000061e bne r2,zero,cbb4 - /* Recalculate the scrolling parameters */ - widthmax = ALT_LCD_WIDTH; - for (y = 0 ; y < ALT_LCD_HEIGHT ; y++) - { - int width; - for (width = ALT_LCD_VIRTUAL_WIDTH ; width > 0 ; width--) - cb9c: e0bff617 ldw r2,-40(fp) - cba0: 10bfffc4 addi r2,r2,-1 - cba4: e0bff615 stw r2,-40(fp) - cba8: e0bff617 ldw r2,-40(fp) - cbac: 10800048 cmpgei r2,r2,1 - cbb0: 103feb1e bne r2,zero,cb60 - - /* The minimum width is the size of the LCD panel. If the real width - * is long enough to require scrolling then add an extra space so the - * end of the message doesn't run into the beginning of it. - */ - if (width <= ALT_LCD_WIDTH) - cbb4: e0bff617 ldw r2,-40(fp) - cbb8: 10800448 cmpgei r2,r2,17 - cbbc: 1000031e bne r2,zero,cbcc - width = ALT_LCD_WIDTH; - cbc0: 00800404 movi r2,16 - cbc4: e0bff615 stw r2,-40(fp) - cbc8: 00000306 br cbd8 - else - width++; - cbcc: e0bff617 ldw r2,-40(fp) - cbd0: 10800044 addi r2,r2,1 - cbd4: e0bff615 stw r2,-40(fp) - - sp->line[y].width = width; - cbd8: e13ffa17 ldw r4,-24(fp) - cbdc: e0bff617 ldw r2,-40(fp) - cbe0: 1023883a mov r17,r2 - cbe4: e43ffc17 ldw r16,-16(fp) - cbe8: 014018c4 movi r5,99 - cbec: 0009fc80 call 9fc8 <__mulsi3> - cbf0: 1405883a add r2,r2,r16 - cbf4: 10802404 addi r2,r2,144 - cbf8: 14400045 stb r17,1(r2) - if (widthmax < width) - cbfc: e0fff917 ldw r3,-28(fp) - cc00: e0bff617 ldw r2,-40(fp) - cc04: 1880020e bge r3,r2,cc10 - widthmax = width; - cc08: e0bff617 ldw r2,-40(fp) - cc0c: e0bff915 stw r2,-28(fp) - sp->line[y].speed = 0; /* By default lines don't scroll */ - cc10: e13ffa17 ldw r4,-24(fp) - cc14: e43ffc17 ldw r16,-16(fp) - cc18: 014018c4 movi r5,99 - cc1c: 0009fc80 call 9fc8 <__mulsi3> - cc20: 1405883a add r2,r2,r16 - cc24: 10802404 addi r2,r2,144 - cc28: 10000085 stb zero,2(r2) - } - } - - /* Recalculate the scrolling parameters */ - widthmax = ALT_LCD_WIDTH; - for (y = 0 ; y < ALT_LCD_HEIGHT ; y++) - cc2c: e0bffa17 ldw r2,-24(fp) - cc30: 10800044 addi r2,r2,1 - cc34: e0bffa15 stw r2,-24(fp) - cc38: e0bffa17 ldw r2,-24(fp) - cc3c: 10800090 cmplti r2,r2,2 - cc40: 103fc41e bne r2,zero,cb54 - if (widthmax < width) - widthmax = width; - sp->line[y].speed = 0; /* By default lines don't scroll */ - } - - if (widthmax <= ALT_LCD_WIDTH) - cc44: e0bff917 ldw r2,-28(fp) - cc48: 10800448 cmpgei r2,r2,17 - cc4c: 1000031e bne r2,zero,cc5c - sp->scrollmax = 0; - cc50: e0bffc17 ldw r2,-16(fp) - cc54: 10000985 stb zero,38(r2) - cc58: 00003106 br cd20 - else - { - widthmax *= 2; - cc5c: e0bff917 ldw r2,-28(fp) - cc60: 1085883a add r2,r2,r2 - cc64: e0bff915 stw r2,-28(fp) - sp->scrollmax = widthmax; - cc68: e0bff917 ldw r2,-28(fp) - cc6c: 1007883a mov r3,r2 - cc70: e0bffc17 ldw r2,-16(fp) - cc74: 10c00985 stb r3,38(r2) - - /* Now calculate how fast each of the other lines should go */ - for (y = 0 ; y < ALT_LCD_HEIGHT ; y++) - cc78: e03ffa15 stw zero,-24(fp) - cc7c: 00002506 br cd14 - if (sp->line[y].width > ALT_LCD_WIDTH) - cc80: e13ffa17 ldw r4,-24(fp) - cc84: e43ffc17 ldw r16,-16(fp) - cc88: 014018c4 movi r5,99 - cc8c: 0009fc80 call 9fc8 <__mulsi3> - cc90: 1405883a add r2,r2,r16 - cc94: 10802404 addi r2,r2,144 - cc98: 10800043 ldbu r2,1(r2) - cc9c: 10803fcc andi r2,r2,255 - cca0: 1080201c xori r2,r2,128 - cca4: 10bfe004 addi r2,r2,-128 - cca8: 10800450 cmplti r2,r2,17 - ccac: 1000161e bne r2,zero,cd08 - */ -#if 1 - /* This option makes all the lines scroll round at different speeds - * which are chosen so that all the scrolls finish at the same time. - */ - sp->line[y].speed = 256 * sp->line[y].width / widthmax; - ccb0: e4bffa17 ldw r18,-24(fp) - ccb4: e13ffa17 ldw r4,-24(fp) - ccb8: e43ffc17 ldw r16,-16(fp) - ccbc: 014018c4 movi r5,99 - ccc0: 0009fc80 call 9fc8 <__mulsi3> - ccc4: 1405883a add r2,r2,r16 - ccc8: 10802404 addi r2,r2,144 - cccc: 10800043 ldbu r2,1(r2) - ccd0: 10803fcc andi r2,r2,255 - ccd4: 1080201c xori r2,r2,128 - ccd8: 10bfe004 addi r2,r2,-128 - ccdc: 1008923a slli r4,r2,8 - cce0: e17ff917 ldw r5,-28(fp) - cce4: 0009ef80 call 9ef8 <__divsi3> - cce8: 1023883a mov r17,r2 - ccec: e43ffc17 ldw r16,-16(fp) - ccf0: 9009883a mov r4,r18 - ccf4: 014018c4 movi r5,99 - ccf8: 0009fc80 call 9fc8 <__mulsi3> - ccfc: 1405883a add r2,r2,r16 - cd00: 10802404 addi r2,r2,144 - cd04: 14400085 stb r17,2(r2) - { - widthmax *= 2; - sp->scrollmax = widthmax; - - /* Now calculate how fast each of the other lines should go */ - for (y = 0 ; y < ALT_LCD_HEIGHT ; y++) - cd08: e0bffa17 ldw r2,-24(fp) - cd0c: 10800044 addi r2,r2,1 - cd10: e0bffa15 stw r2,-24(fp) - cd14: e0bffa17 ldw r2,-24(fp) - cd18: 10800090 cmplti r2,r2,2 - cd1c: 103fd81e bne r2,zero,cc80 - * (because active was set when the timer interrupt occurred). If there - * has been a missed repaint then paint again. And again. etc. - */ - for ( ; ; ) - { - int old_scrollpos = sp->scrollpos; - cd20: e0bffc17 ldw r2,-16(fp) - cd24: 10800943 ldbu r2,37(r2) - cd28: 10803fcc andi r2,r2,255 - cd2c: 1080201c xori r2,r2,128 - cd30: 10bfe004 addi r2,r2,-128 - cd34: e0bff515 stw r2,-44(fp) - - lcd_repaint_screen(sp); - cd38: e13ffc17 ldw r4,-16(fp) - cd3c: 000c2840 call c284 - - /* Let the timer routines repaint the display again */ - sp->active = 0; - cd40: e0bffc17 ldw r2,-16(fp) - cd44: 100009c5 stb zero,39(r2) - - /* Have the timer routines tried to scroll while we were painting? - * If not then we can exit */ - if (sp->scrollpos == old_scrollpos) - cd48: e0bffc17 ldw r2,-16(fp) - cd4c: 10800943 ldbu r2,37(r2) - cd50: 10c03fcc andi r3,r2,255 - cd54: 18c0201c xori r3,r3,128 - cd58: 18ffe004 addi r3,r3,-128 - cd5c: e0bff517 ldw r2,-44(fp) - cd60: 18800426 beq r3,r2,cd74 - break; - - /* We need to repaint again since the display scrolled while we were - * painting last time */ - sp->active = 1; - cd64: e0fffc17 ldw r3,-16(fp) - cd68: 00800044 movi r2,1 - cd6c: 188009c5 stb r2,39(r3) - } - cd70: 003feb06 br cd20 - * semaphore so that other threads can access the buffer. - */ - - ALT_SEM_POST (sp->write_lock); - - return len; - cd74: e0bffe17 ldw r2,-8(fp) -} - cd78: e037883a mov sp,fp - cd7c: dfc00417 ldw ra,16(sp) - cd80: df000317 ldw fp,12(sp) - cd84: dc800217 ldw r18,8(sp) - cd88: dc400117 ldw r17,4(sp) - cd8c: dc000017 ldw r16,0(sp) - cd90: dec00504 addi sp,sp,20 - cd94: f800283a ret - -0000cd98 : -/* - * Timeout routine is called every second - */ - -static alt_u32 alt_lcd_16207_timeout(void* context) -{ - cd98: defffc04 addi sp,sp,-16 - cd9c: dfc00315 stw ra,12(sp) - cda0: df000215 stw fp,8(sp) - cda4: df000204 addi fp,sp,8 - cda8: e13fff15 stw r4,-4(fp) - altera_avalon_lcd_16207_state* sp = (altera_avalon_lcd_16207_state*)context; - cdac: e0bfff17 ldw r2,-4(fp) - cdb0: e0bffe15 stw r2,-8(fp) - - /* Update the scrolling position */ - if (sp->scrollpos + 1 >= sp->scrollmax) - cdb4: e0bffe17 ldw r2,-8(fp) - cdb8: 10800943 ldbu r2,37(r2) - cdbc: 10803fcc andi r2,r2,255 - cdc0: 1080201c xori r2,r2,128 - cdc4: 10bfe004 addi r2,r2,-128 - cdc8: 10c00044 addi r3,r2,1 - cdcc: e0bffe17 ldw r2,-8(fp) - cdd0: 10800983 ldbu r2,38(r2) - cdd4: 10803fcc andi r2,r2,255 - cdd8: 1080201c xori r2,r2,128 - cddc: 10bfe004 addi r2,r2,-128 - cde0: 18800316 blt r3,r2,cdf0 - sp->scrollpos = 0; - cde4: e0bffe17 ldw r2,-8(fp) - cde8: 10000945 stb zero,37(r2) - cdec: 00000606 br ce08 - else - sp->scrollpos = sp->scrollpos + 1; - cdf0: e0bffe17 ldw r2,-8(fp) - cdf4: 10800943 ldbu r2,37(r2) - cdf8: 10800044 addi r2,r2,1 - cdfc: 1007883a mov r3,r2 - ce00: e0bffe17 ldw r2,-8(fp) - ce04: 10c00945 stb r3,37(r2) - - /* Repaint the panel unless the foreground will do it again soon */ - if (sp->scrollmax > 0 && !sp->active) - ce08: e0bffe17 ldw r2,-8(fp) - ce0c: 10800983 ldbu r2,38(r2) - ce10: 10803fcc andi r2,r2,255 - ce14: 1080201c xori r2,r2,128 - ce18: 10bfe004 addi r2,r2,-128 - ce1c: 10800050 cmplti r2,r2,1 - ce20: 1000091e bne r2,zero,ce48 - ce24: e0bffe17 ldw r2,-8(fp) - ce28: 108009c3 ldbu r2,39(r2) - ce2c: 10803fcc andi r2,r2,255 - ce30: 1080201c xori r2,r2,128 - ce34: 10bfe004 addi r2,r2,-128 - ce38: 1004c03a cmpne r2,r2,zero - ce3c: 1000021e bne r2,zero,ce48 - lcd_repaint_screen(sp); - ce40: e13ffe17 ldw r4,-8(fp) - ce44: 000c2840 call c284 - - return sp->period; - ce48: e0bffe17 ldw r2,-8(fp) - ce4c: 10800717 ldw r2,28(r2) -} - ce50: e037883a mov sp,fp - ce54: dfc00117 ldw ra,4(sp) - ce58: df000017 ldw fp,0(sp) - ce5c: dec00204 addi sp,sp,8 - ce60: f800283a ret - -0000ce64 : - -/* - * Called at boot time to initialise the LCD driver - */ -void altera_avalon_lcd_16207_init(altera_avalon_lcd_16207_state* sp) -{ - ce64: defffc04 addi sp,sp,-16 - ce68: dfc00315 stw ra,12(sp) - ce6c: df000215 stw fp,8(sp) - ce70: df000204 addi fp,sp,8 - ce74: e13fff15 stw r4,-4(fp) - unsigned int base = sp->base; - ce78: e0bfff17 ldw r2,-4(fp) - ce7c: 10800017 ldw r2,0(r2) - ce80: e0bffe15 stw r2,-8(fp) - - /* Mark the device as functional */ - sp->broken = 0; - ce84: e0bfff17 ldw r2,-4(fp) - ce88: 10000805 stb zero,32(r2) - * the BUSY bit in the status register doesn't work until the display - * has been reset three times. - */ - - /* Wait for 15 ms then reset */ - usleep(15000); - ce8c: 010ea604 movi r4,15000 - ce90: 000dba40 call dba4 - IOWR_ALTERA_AVALON_LCD_16207_COMMAND(base, LCD_CMD_FUNCTION_SET | LCD_CMD_8BIT); - ce94: e0bffe17 ldw r2,-8(fp) - ce98: 1007883a mov r3,r2 - ce9c: 00800c04 movi r2,48 - cea0: 18800035 stwio r2,0(r3) - - /* Wait for another 4.1ms and reset again */ - usleep(4100); - cea4: 01040104 movi r4,4100 - cea8: 000dba40 call dba4 - IOWR_ALTERA_AVALON_LCD_16207_COMMAND(base, LCD_CMD_FUNCTION_SET | LCD_CMD_8BIT); - ceac: e0bffe17 ldw r2,-8(fp) - ceb0: 1007883a mov r3,r2 - ceb4: 00800c04 movi r2,48 - ceb8: 18800035 stwio r2,0(r3) - - /* Wait a further 1 ms and reset a third time */ - usleep(1000); - cebc: 0100fa04 movi r4,1000 - cec0: 000dba40 call dba4 - IOWR_ALTERA_AVALON_LCD_16207_COMMAND(base, LCD_CMD_FUNCTION_SET | LCD_CMD_8BIT); - cec4: e0bffe17 ldw r2,-8(fp) - cec8: 1007883a mov r3,r2 - cecc: 00800c04 movi r2,48 - ced0: 18800035 stwio r2,0(r3) - - /* Setup interface parameters: 8 bit bus, 2 rows, 5x7 font */ - lcd_write_command(sp, LCD_CMD_FUNCTION_SET | LCD_CMD_8BIT | LCD_CMD_TWO_LINE); - ced4: e13fff17 ldw r4,-4(fp) - ced8: 01400e04 movi r5,56 - cedc: 000c0200 call c020 - - /* Turn display off */ - lcd_write_command(sp, LCD_CMD_ONOFF); - cee0: e13fff17 ldw r4,-4(fp) - cee4: 01400204 movi r5,8 - cee8: 000c0200 call c020 - - /* Clear display */ - lcd_clear_screen(sp); - ceec: e13fff17 ldw r4,-4(fp) - cef0: 000c1ac0 call c1ac - - /* Set mode: increment after writing, don't shift display */ - lcd_write_command(sp, LCD_CMD_MODES | LCD_CMD_MODE_INC); - cef4: e13fff17 ldw r4,-4(fp) - cef8: 01400184 movi r5,6 - cefc: 000c0200 call c020 - - /* Turn display on */ - lcd_write_command(sp, LCD_CMD_ONOFF | LCD_CMD_ENABLE_DISP); - cf00: e13fff17 ldw r4,-4(fp) - cf04: 01400304 movi r5,12 - cf08: 000c0200 call c020 - - sp->esccount = -1; - cf0c: e0ffff17 ldw r3,-4(fp) - cf10: 00bfffc4 movi r2,-1 - cf14: 18800905 stb r2,36(r3) - memset(sp->escape, 0, sizeof(sp->escape)); - cf18: e0bfff17 ldw r2,-4(fp) - cf1c: 11000a04 addi r4,r2,40 - cf20: 000b883a mov r5,zero - cf24: 01800204 movi r6,8 - cf28: 0001ea40 call 1ea4 - - sp->scrollpos = 0; - cf2c: e0bfff17 ldw r2,-4(fp) - cf30: 10000945 stb zero,37(r2) - sp->scrollmax = 0; - cf34: e0bfff17 ldw r2,-4(fp) - cf38: 10000985 stb zero,38(r2) - sp->active = 0; - cf3c: e0bfff17 ldw r2,-4(fp) - cf40: 100009c5 stb zero,39(r2) - cf44: 00800074 movhi r2,1 - cf48: 1087b004 addi r2,r2,7872 - cf4c: 10800017 ldw r2,0(r2) - cf50: 1009883a mov r4,r2 - - sp->period = alt_ticks_per_second() / 10; /* Call every 100ms */ - cf54: 01400284 movi r5,10 - cf58: 0009fb80 call 9fb8 <__udivsi3> - cf5c: 1007883a mov r3,r2 - cf60: e0bfff17 ldw r2,-4(fp) - cf64: 10c00715 stw r3,28(r2) - - alt_alarm_start(&sp->alarm, sp->period, &alt_lcd_16207_timeout, sp); - cf68: e0bfff17 ldw r2,-4(fp) - cf6c: 11000104 addi r4,r2,4 - cf70: e0bfff17 ldw r2,-4(fp) - cf74: 10800717 ldw r2,28(r2) - cf78: 100b883a mov r5,r2 - cf7c: 01800074 movhi r6,1 - cf80: 31b36604 addi r6,r6,-12904 - cf84: e1ffff17 ldw r7,-4(fp) - cf88: 000cff80 call cff8 -} - cf8c: e037883a mov sp,fp - cf90: dfc00117 ldw ra,4(sp) - cf94: df000017 ldw fp,0(sp) - cf98: dec00204 addi sp,sp,8 - cf9c: f800283a ret - -0000cfa0 : -extern int altera_avalon_lcd_16207_write(altera_avalon_lcd_16207_state* sp, - const char* ptr, int count, int flags); - -int -altera_avalon_lcd_16207_write_fd(alt_fd* fd, const char* buffer, int space) -{ - cfa0: defffa04 addi sp,sp,-24 - cfa4: dfc00515 stw ra,20(sp) - cfa8: df000415 stw fp,16(sp) - cfac: df000404 addi fp,sp,16 - cfb0: e13ffd15 stw r4,-12(fp) - cfb4: e17ffe15 stw r5,-8(fp) - cfb8: e1bfff15 stw r6,-4(fp) - altera_avalon_lcd_16207_dev* dev = (altera_avalon_lcd_16207_dev*) fd->dev; - cfbc: e0bffd17 ldw r2,-12(fp) - cfc0: 10800017 ldw r2,0(r2) - cfc4: e0bffc15 stw r2,-16(fp) - - return altera_avalon_lcd_16207_write(&dev->state, buffer, space, - cfc8: e0bffc17 ldw r2,-16(fp) - cfcc: 11000a04 addi r4,r2,40 - cfd0: e0bffd17 ldw r2,-12(fp) - cfd4: 11c00217 ldw r7,8(r2) - cfd8: e17ffe17 ldw r5,-8(fp) - cfdc: e1bfff17 ldw r6,-4(fp) - cfe0: 000c85c0 call c85c - fd->fd_flags); -} - cfe4: e037883a mov sp,fp - cfe8: dfc00117 ldw ra,4(sp) - cfec: df000017 ldw fp,0(sp) - cff0: dec00204 addi sp,sp,8 - cff4: f800283a ret - -0000cff8 : - */ - -int alt_alarm_start (alt_alarm* alarm, alt_u32 nticks, - alt_u32 (*callback) (void* context), - void* context) -{ - cff8: defff404 addi sp,sp,-48 - cffc: df000b15 stw fp,44(sp) - d000: df000b04 addi fp,sp,44 - d004: e13ffb15 stw r4,-20(fp) - d008: e17ffc15 stw r5,-16(fp) - d00c: e1bffd15 stw r6,-12(fp) - d010: e1fffe15 stw r7,-8(fp) - alt_irq_context irq_context; - alt_u32 current_nticks = 0; - d014: e03ff915 stw zero,-28(fp) - d018: 00800074 movhi r2,1 - d01c: 1087b004 addi r2,r2,7872 - d020: 10800017 ldw r2,0(r2) - - if (alt_ticks_per_second ()) - d024: 1005003a cmpeq r2,r2,zero - d028: 1000411e bne r2,zero,d130 - { - if (alarm) - d02c: e0bffb17 ldw r2,-20(fp) - d030: 1005003a cmpeq r2,r2,zero - d034: 10003b1e bne r2,zero,d124 - { - alarm->callback = callback; - d038: e0fffb17 ldw r3,-20(fp) - d03c: e0bffd17 ldw r2,-12(fp) - d040: 18800315 stw r2,12(r3) - alarm->context = context; - d044: e0fffb17 ldw r3,-20(fp) - d048: e0bffe17 ldw r2,-8(fp) - d04c: 18800515 stw r2,20(r3) -static ALT_INLINE alt_irq_context ALT_ALWAYS_INLINE - alt_irq_disable_all (void) -{ - alt_irq_context context; - - NIOS2_READ_STATUS (context); - d050: 0005303a rdctl r2,status - d054: e0bff815 stw r2,-32(fp) - - NIOS2_WRITE_STATUS (context & ~NIOS2_STATUS_PIE_MSK); - d058: e0fff817 ldw r3,-32(fp) - d05c: 00bfff84 movi r2,-2 - d060: 1884703a and r2,r3,r2 - d064: 1001703a wrctl status,r2 - - return context; - d068: e0bff817 ldw r2,-32(fp) - - irq_context = alt_irq_disable_all (); - d06c: e0bffa15 stw r2,-24(fp) - * alt_nticks() returns the elapsed number of system clock ticks since reset. - */ - -static ALT_INLINE alt_u32 ALT_ALWAYS_INLINE alt_nticks (void) -{ - return _alt_nticks; - d070: 00800074 movhi r2,1 - d074: 1087b104 addi r2,r2,7876 - d078: 10800017 ldw r2,0(r2) - - current_nticks = alt_nticks(); - d07c: e0bff915 stw r2,-28(fp) - - alarm->time = nticks + current_nticks + 1; - d080: e0fffc17 ldw r3,-16(fp) - d084: e0bff917 ldw r2,-28(fp) - d088: 1885883a add r2,r3,r2 - d08c: 10c00044 addi r3,r2,1 - d090: e0bffb17 ldw r2,-20(fp) - d094: 10c00215 stw r3,8(r2) - /* - * If the desired alarm time causes a roll-over, set the rollover - * flag. This will prevent the subsequent tick event from causing - * an alarm too early. - */ - if(alarm->time < current_nticks) - d098: e0bffb17 ldw r2,-20(fp) - d09c: 10c00217 ldw r3,8(r2) - d0a0: e0bff917 ldw r2,-28(fp) - d0a4: 1880042e bgeu r3,r2,d0b8 - { - alarm->rollover = 1; - d0a8: e0fffb17 ldw r3,-20(fp) - d0ac: 00800044 movi r2,1 - d0b0: 18800405 stb r2,16(r3) - d0b4: 00000206 br d0c0 - } - else - { - alarm->rollover = 0; - d0b8: e0bffb17 ldw r2,-20(fp) - d0bc: 10000405 stb zero,16(r2) - } - - alt_llist_insert (&alt_alarm_list, &alarm->llist); - d0c0: e0fffb17 ldw r3,-20(fp) - d0c4: 00800074 movhi r2,1 - d0c8: 1080c104 addi r2,r2,772 - d0cc: e0bff615 stw r2,-40(fp) - d0d0: e0fff715 stw r3,-36(fp) - */ - -static ALT_INLINE void ALT_ALWAYS_INLINE alt_llist_insert(alt_llist* list, - alt_llist* entry) -{ - entry->previous = list; - d0d4: e0fff717 ldw r3,-36(fp) - d0d8: e0bff617 ldw r2,-40(fp) - d0dc: 18800115 stw r2,4(r3) - entry->next = list->next; - d0e0: e0bff617 ldw r2,-40(fp) - d0e4: 10c00017 ldw r3,0(r2) - d0e8: e0bff717 ldw r2,-36(fp) - d0ec: 10c00015 stw r3,0(r2) - - list->next->previous = entry; - d0f0: e0bff617 ldw r2,-40(fp) - d0f4: 10c00017 ldw r3,0(r2) - d0f8: e0bff717 ldw r2,-36(fp) - d0fc: 18800115 stw r2,4(r3) - list->next = entry; - d100: e0fff617 ldw r3,-40(fp) - d104: e0bff717 ldw r2,-36(fp) - d108: 18800015 stw r2,0(r3) - d10c: e0bffa17 ldw r2,-24(fp) - d110: e0bff515 stw r2,-44(fp) - status &= ~NIOS2_STATUS_PIE_MSK; - status |= (context & NIOS2_STATUS_PIE_MSK); - - NIOS2_WRITE_STATUS (status); -#else - NIOS2_WRITE_STATUS (context); - d114: e0bff517 ldw r2,-44(fp) - d118: 1001703a wrctl status,r2 - alt_irq_enable_all (irq_context); - - return 0; - d11c: e03fff15 stw zero,-4(fp) - d120: 00000506 br d138 - } - else - { - return -EINVAL; - d124: 00bffa84 movi r2,-22 - d128: e0bfff15 stw r2,-4(fp) - d12c: 00000206 br d138 - } - } - else - { - return -ENOTSUP; - d130: 00bfde84 movi r2,-134 - d134: e0bfff15 stw r2,-4(fp) - d138: e0bfff17 ldw r2,-4(fp) - } -} - d13c: e037883a mov sp,fp - d140: df000017 ldw fp,0(sp) - d144: dec00104 addi sp,sp,4 - d148: f800283a ret - -0000d14c : -/* - * alt_dcache_flush_all() is called to flush the entire data cache. - */ - -void alt_dcache_flush_all (void) -{ - d14c: deffff04 addi sp,sp,-4 - d150: df000015 stw fp,0(sp) - d154: d839883a mov fp,sp - for (i = (char*) 0; i < (char*) NIOS2_DCACHE_SIZE; i+= NIOS2_DCACHE_LINE_SIZE) - { - __asm__ volatile ("flushd (%0)" :: "r" (i)); - } -#endif /* NIOS2_DCACHE_SIZE > 0 */ -} - d158: e037883a mov sp,fp - d15c: df000017 ldw fp,0(sp) - d160: dec00104 addi sp,sp,4 - d164: f800283a ret - -0000d168 : -/* - * - */ - -int alt_dev_llist_insert (alt_dev_llist* dev, alt_llist* list) -{ - d168: defff904 addi sp,sp,-28 - d16c: dfc00615 stw ra,24(sp) - d170: df000515 stw fp,20(sp) - d174: df000504 addi fp,sp,20 - d178: e13ffd15 stw r4,-12(fp) - d17c: e17ffe15 stw r5,-8(fp) - /* - * check that the device exists, and that it has a valid name. - */ - - if (!dev || !dev->name) - d180: e0bffd17 ldw r2,-12(fp) - d184: 1005003a cmpeq r2,r2,zero - d188: 1000041e bne r2,zero,d19c - d18c: e0bffd17 ldw r2,-12(fp) - d190: 10800217 ldw r2,8(r2) - d194: 1004c03a cmpne r2,r2,zero - d198: 1000071e bne r2,zero,d1b8 - { - ALT_ERRNO = EINVAL; - d19c: 000d21c0 call d21c - d1a0: 1007883a mov r3,r2 - d1a4: 00800584 movi r2,22 - d1a8: 18800015 stw r2,0(r3) - return -EINVAL; - d1ac: 00bffa84 movi r2,-22 - d1b0: e0bfff15 stw r2,-4(fp) - d1b4: 00001306 br d204 - - /* - * register the device. - */ - - alt_llist_insert(list, &dev->llist); - d1b8: e0fffd17 ldw r3,-12(fp) - d1bc: e0bffe17 ldw r2,-8(fp) - d1c0: e0bffb15 stw r2,-20(fp) - d1c4: e0fffc15 stw r3,-16(fp) - */ - -static ALT_INLINE void ALT_ALWAYS_INLINE alt_llist_insert(alt_llist* list, - alt_llist* entry) -{ - entry->previous = list; - d1c8: e0fffc17 ldw r3,-16(fp) - d1cc: e0bffb17 ldw r2,-20(fp) - d1d0: 18800115 stw r2,4(r3) - entry->next = list->next; - d1d4: e0bffb17 ldw r2,-20(fp) - d1d8: 10c00017 ldw r3,0(r2) - d1dc: e0bffc17 ldw r2,-16(fp) - d1e0: 10c00015 stw r3,0(r2) - - list->next->previous = entry; - d1e4: e0bffb17 ldw r2,-20(fp) - d1e8: 10c00017 ldw r3,0(r2) - d1ec: e0bffc17 ldw r2,-16(fp) - d1f0: 18800115 stw r2,4(r3) - list->next = entry; - d1f4: e0fffb17 ldw r3,-20(fp) - d1f8: e0bffc17 ldw r2,-16(fp) - d1fc: 18800015 stw r2,0(r3) - - return 0; - d200: e03fff15 stw zero,-4(fp) - d204: e0bfff17 ldw r2,-4(fp) -} - d208: e037883a mov sp,fp - d20c: dfc00117 ldw ra,4(sp) - d210: df000017 ldw fp,0(sp) - d214: dec00204 addi sp,sp,8 - d218: f800283a ret - -0000d21c : -#undef errno - -extern int errno; - -static ALT_INLINE int* alt_get_errno(void) -{ - d21c: defffd04 addi sp,sp,-12 - d220: dfc00215 stw ra,8(sp) - d224: df000115 stw fp,4(sp) - d228: df000104 addi fp,sp,4 - return ((alt_errno) ? alt_errno() : &errno); - d22c: 00800074 movhi r2,1 - d230: 1080bd04 addi r2,r2,756 - d234: 10800017 ldw r2,0(r2) - d238: 1005003a cmpeq r2,r2,zero - d23c: 1000061e bne r2,zero,d258 - d240: 00800074 movhi r2,1 - d244: 1080bd04 addi r2,r2,756 - d248: 10800017 ldw r2,0(r2) - d24c: 103ee83a callr r2 - d250: e0bfff15 stw r2,-4(fp) - d254: 00000306 br d264 - d258: 00800074 movhi r2,1 - d25c: 1087a504 addi r2,r2,7828 - d260: e0bfff15 stw r2,-4(fp) - d264: e0bfff17 ldw r2,-4(fp) -} - d268: e037883a mov sp,fp - d26c: dfc00117 ldw ra,4(sp) - d270: df000017 ldw fp,0(sp) - d274: dec00204 addi sp,sp,8 - d278: f800283a ret - -0000d27c <_do_ctors>: -/* - * Run the C++ static constructors. - */ - -void _do_ctors(void) -{ - d27c: defffd04 addi sp,sp,-12 - d280: dfc00215 stw ra,8(sp) - d284: df000115 stw fp,4(sp) - d288: df000104 addi fp,sp,4 - constructor* ctor; - - for (ctor = &__CTOR_END__[-1]; ctor >= __CTOR_LIST__; ctor--) - d28c: 00bfff04 movi r2,-4 - d290: 00c00074 movhi r3,1 - d294: 18f85704 addi r3,r3,-7844 - d298: 1885883a add r2,r3,r2 - d29c: e0bfff15 stw r2,-4(fp) - d2a0: 00000606 br d2bc <_do_ctors+0x40> - (*ctor) (); - d2a4: e0bfff17 ldw r2,-4(fp) - d2a8: 10800017 ldw r2,0(r2) - d2ac: 103ee83a callr r2 - -void _do_ctors(void) -{ - constructor* ctor; - - for (ctor = &__CTOR_END__[-1]; ctor >= __CTOR_LIST__; ctor--) - d2b0: e0bfff17 ldw r2,-4(fp) - d2b4: 10bfff04 addi r2,r2,-4 - d2b8: e0bfff15 stw r2,-4(fp) - d2bc: e0ffff17 ldw r3,-4(fp) - d2c0: 00800074 movhi r2,1 - d2c4: 10b85604 addi r2,r2,-7848 - d2c8: 18bff62e bgeu r3,r2,d2a4 <_do_ctors+0x28> - (*ctor) (); -} - d2cc: e037883a mov sp,fp - d2d0: dfc00117 ldw ra,4(sp) - d2d4: df000017 ldw fp,0(sp) - d2d8: dec00204 addi sp,sp,8 - d2dc: f800283a ret - -0000d2e0 <_do_dtors>: -/* - * Run the C++ static destructors. - */ - -void _do_dtors(void) -{ - d2e0: defffd04 addi sp,sp,-12 - d2e4: dfc00215 stw ra,8(sp) - d2e8: df000115 stw fp,4(sp) - d2ec: df000104 addi fp,sp,4 - destructor* dtor; - - for (dtor = &__DTOR_END__[-1]; dtor >= __DTOR_LIST__; dtor--) - d2f0: 00bfff04 movi r2,-4 - d2f4: 00c00074 movhi r3,1 - d2f8: 18f85704 addi r3,r3,-7844 - d2fc: 1885883a add r2,r3,r2 - d300: e0bfff15 stw r2,-4(fp) - d304: 00000606 br d320 <_do_dtors+0x40> - (*dtor) (); - d308: e0bfff17 ldw r2,-4(fp) - d30c: 10800017 ldw r2,0(r2) - d310: 103ee83a callr r2 - -void _do_dtors(void) -{ - destructor* dtor; - - for (dtor = &__DTOR_END__[-1]; dtor >= __DTOR_LIST__; dtor--) - d314: e0bfff17 ldw r2,-4(fp) - d318: 10bfff04 addi r2,r2,-4 - d31c: e0bfff15 stw r2,-4(fp) - d320: e0ffff17 ldw r3,-4(fp) - d324: 00800074 movhi r2,1 - d328: 10b85704 addi r2,r2,-7844 - d32c: 18bff62e bgeu r3,r2,d308 <_do_dtors+0x28> - (*dtor) (); -} - d330: e037883a mov sp,fp - d334: dfc00117 ldw ra,4(sp) - d338: df000017 ldw fp,0(sp) - d33c: dec00204 addi sp,sp,8 - d340: f800283a ret - -0000d344 : - * "name" must be an exact match for the devices registered name for a match to - * be found. - */ - -alt_dev* alt_find_dev(const char* name, alt_llist* llist) -{ - d344: defff904 addi sp,sp,-28 - d348: dfc00615 stw ra,24(sp) - d34c: df000515 stw fp,20(sp) - d350: df000504 addi fp,sp,20 - d354: e13ffd15 stw r4,-12(fp) - d358: e17ffe15 stw r5,-8(fp) - alt_dev* next = (alt_dev*) llist->next; - d35c: e0bffe17 ldw r2,-8(fp) - d360: 10800017 ldw r2,0(r2) - d364: e0bffc15 stw r2,-16(fp) - alt_32 len; - - len = strlen(name) + 1; - d368: e13ffd17 ldw r4,-12(fp) - d36c: 000247c0 call 247c - d370: 10800044 addi r2,r2,1 - d374: e0bffb15 stw r2,-20(fp) - /* - * Check each list entry in turn, until a match is found, or we reach the - * end of the list (i.e. next winds up pointing back to the list head). - */ - - while (next != (alt_dev*) llist) - d378: 00000d06 br d3b0 - /* - * memcmp() is used here rather than strcmp() in order to reduce the size - * of the executable. - */ - - if (!memcmp (next->name, name, len)) - d37c: e0bffc17 ldw r2,-16(fp) - d380: 11000217 ldw r4,8(r2) - d384: e1bffb17 ldw r6,-20(fp) - d388: e17ffd17 ldw r5,-12(fp) - d38c: 000dd9c0 call dd9c - d390: 1004c03a cmpne r2,r2,zero - d394: 1000031e bne r2,zero,d3a4 - { - /* match found */ - - return next; - d398: e0bffc17 ldw r2,-16(fp) - d39c: e0bfff15 stw r2,-4(fp) - d3a0: 00000706 br d3c0 - } - next = (alt_dev*) next->llist.next; - d3a4: e0bffc17 ldw r2,-16(fp) - d3a8: 10800017 ldw r2,0(r2) - d3ac: e0bffc15 stw r2,-16(fp) - /* - * Check each list entry in turn, until a match is found, or we reach the - * end of the list (i.e. next winds up pointing back to the list head). - */ - - while (next != (alt_dev*) llist) - d3b0: e0fffe17 ldw r3,-8(fp) - d3b4: e0bffc17 ldw r2,-16(fp) - d3b8: 10fff01e bne r2,r3,d37c - next = (alt_dev*) next->llist.next; - } - - /* No match found */ - - return NULL; - d3bc: e03fff15 stw zero,-4(fp) - d3c0: e0bfff17 ldw r2,-4(fp) -} - d3c4: e037883a mov sp,fp - d3c8: dfc00117 ldw ra,4(sp) - d3cc: df000017 ldw fp,0(sp) - d3d0: dec00204 addi sp,sp,8 - d3d4: f800283a ret - -0000d3d8 : - * either '/' or '\0' is the prefix of the filename. For example the filename: - * "/myfilesystem/junk.txt" would match: "/myfilesystem", but not: "/myfile". - */ - -alt_dev* alt_find_file (const char* name) -{ - d3d8: defffa04 addi sp,sp,-24 - d3dc: dfc00515 stw ra,20(sp) - d3e0: df000415 stw fp,16(sp) - d3e4: df000404 addi fp,sp,16 - d3e8: e13ffe15 stw r4,-8(fp) - alt_dev* next = (alt_dev*) alt_fs_list.next; - d3ec: 00800074 movhi r2,1 - d3f0: 1080b804 addi r2,r2,736 - d3f4: 10800017 ldw r2,0(r2) - d3f8: e0bffd15 stw r2,-12(fp) - /* - * Check each list entry in turn, until a match is found, or we reach the - * end of the list (i.e. next winds up pointing back to the list head). - */ - - while (next != (alt_dev*) &alt_fs_list) - d3fc: 00003306 br d4cc - { - len = strlen(next->name); - d400: e0bffd17 ldw r2,-12(fp) - d404: 11000217 ldw r4,8(r2) - d408: 000247c0 call 247c - d40c: e0bffc15 stw r2,-16(fp) - - if (next->name[len-1] == '/') - d410: e0bffd17 ldw r2,-12(fp) - d414: 10c00217 ldw r3,8(r2) - d418: e0bffc17 ldw r2,-16(fp) - d41c: 1885883a add r2,r3,r2 - d420: 10bfffc4 addi r2,r2,-1 - d424: 10800003 ldbu r2,0(r2) - d428: 10803fcc andi r2,r2,255 - d42c: 1080201c xori r2,r2,128 - d430: 10bfe004 addi r2,r2,-128 - d434: 10800bd8 cmpnei r2,r2,47 - d438: 1000031e bne r2,zero,d448 - { - len -= 1; - d43c: e0bffc17 ldw r2,-16(fp) - d440: 10bfffc4 addi r2,r2,-1 - d444: e0bffc15 stw r2,-16(fp) - } - - if (((name[len] == '/') || (name[len] == '\0')) && - d448: e0bffc17 ldw r2,-16(fp) - d44c: 1007883a mov r3,r2 - d450: e0bffe17 ldw r2,-8(fp) - d454: 1885883a add r2,r3,r2 - d458: 10800003 ldbu r2,0(r2) - d45c: 10803fcc andi r2,r2,255 - d460: 1080201c xori r2,r2,128 - d464: 10bfe004 addi r2,r2,-128 - d468: 10800be0 cmpeqi r2,r2,47 - d46c: 10000a1e bne r2,zero,d498 - d470: e0bffc17 ldw r2,-16(fp) - d474: 1007883a mov r3,r2 - d478: e0bffe17 ldw r2,-8(fp) - d47c: 1885883a add r2,r3,r2 - d480: 10800003 ldbu r2,0(r2) - d484: 10803fcc andi r2,r2,255 - d488: 1080201c xori r2,r2,128 - d48c: 10bfe004 addi r2,r2,-128 - d490: 1004c03a cmpne r2,r2,zero - d494: 10000a1e bne r2,zero,d4c0 - d498: e0bffd17 ldw r2,-12(fp) - d49c: 11000217 ldw r4,8(r2) - d4a0: e1bffc17 ldw r6,-16(fp) - d4a4: e17ffe17 ldw r5,-8(fp) - d4a8: 000dd9c0 call dd9c - d4ac: 1004c03a cmpne r2,r2,zero - d4b0: 1000031e bne r2,zero,d4c0 - !memcmp (next->name, name, len)) - { - /* match found */ - - return next; - d4b4: e0bffd17 ldw r2,-12(fp) - d4b8: e0bfff15 stw r2,-4(fp) - d4bc: 00000806 br d4e0 - } - next = (alt_dev*) next->llist.next; - d4c0: e0bffd17 ldw r2,-12(fp) - d4c4: 10800017 ldw r2,0(r2) - d4c8: e0bffd15 stw r2,-12(fp) - /* - * Check each list entry in turn, until a match is found, or we reach the - * end of the list (i.e. next winds up pointing back to the list head). - */ - - while (next != (alt_dev*) &alt_fs_list) - d4cc: 00c00074 movhi r3,1 - d4d0: 18c0b804 addi r3,r3,736 - d4d4: e0bffd17 ldw r2,-12(fp) - d4d8: 10ffc91e bne r2,r3,d400 - next = (alt_dev*) next->llist.next; - } - - /* No match found */ - - return NULL; - d4dc: e03fff15 stw zero,-4(fp) - d4e0: e0bfff17 ldw r2,-4(fp) -} - d4e4: e037883a mov sp,fp - d4e8: dfc00117 ldw ra,4(sp) - d4ec: df000017 ldw fp,0(sp) - d4f0: dec00204 addi sp,sp,8 - d4f4: f800283a ret - -0000d4f8 : - * the offset of the file descriptor within the file descriptor array). A - * negative value indicates failure. - */ - -int alt_get_fd (alt_dev* dev) -{ - d4f8: defffa04 addi sp,sp,-24 - d4fc: dfc00515 stw ra,20(sp) - d500: df000415 stw fp,16(sp) - d504: dc000315 stw r16,12(sp) - d508: df000304 addi fp,sp,12 - d50c: e13fff15 stw r4,-4(fp) - alt_32 i; - int rc = -EMFILE; - d510: 00bffa04 movi r2,-24 - d514: e0bffd15 stw r2,-12(fp) - * indicates the highest file descriptor ever allocated. This is used to - * improve efficency when searching the file descriptor list, and - * therefore reduce contention on the alt_fd_list_lock semaphore. - */ - - for (i = 0; i < ALT_MAX_FD; i++) - d518: e03ffe15 stw zero,-8(fp) - d51c: 00002006 br d5a0 - { - if (!alt_fd_list[i].dev) - d520: e13ffe17 ldw r4,-8(fp) - d524: 04000074 movhi r16,1 - d528: 843bf204 addi r16,r16,-4152 - d52c: 01400304 movi r5,12 - d530: 0009fc80 call 9fc8 <__mulsi3> - d534: 1405883a add r2,r2,r16 - d538: 10800017 ldw r2,0(r2) - d53c: 1004c03a cmpne r2,r2,zero - d540: 1000141e bne r2,zero,d594 - { - alt_fd_list[i].dev = dev; - d544: e13ffe17 ldw r4,-8(fp) - d548: 04000074 movhi r16,1 - d54c: 843bf204 addi r16,r16,-4152 - d550: 01400304 movi r5,12 - d554: 0009fc80 call 9fc8 <__mulsi3> - d558: 1407883a add r3,r2,r16 - d55c: e0bfff17 ldw r2,-4(fp) - d560: 18800015 stw r2,0(r3) - if (i > alt_max_fd) - d564: 00800074 movhi r2,1 - d568: 1080bc04 addi r2,r2,752 - d56c: 10c00017 ldw r3,0(r2) - d570: e0bffe17 ldw r2,-8(fp) - d574: 1880040e bge r3,r2,d588 - { - alt_max_fd = i; - d578: 00c00074 movhi r3,1 - d57c: 18c0bc04 addi r3,r3,752 - d580: e0bffe17 ldw r2,-8(fp) - d584: 18800015 stw r2,0(r3) - } - rc = i; - d588: e0bffe17 ldw r2,-8(fp) - d58c: e0bffd15 stw r2,-12(fp) - goto alt_get_fd_exit; - d590: 00000606 br d5ac - * indicates the highest file descriptor ever allocated. This is used to - * improve efficency when searching the file descriptor list, and - * therefore reduce contention on the alt_fd_list_lock semaphore. - */ - - for (i = 0; i < ALT_MAX_FD; i++) - d594: e0bffe17 ldw r2,-8(fp) - d598: 10800044 addi r2,r2,1 - d59c: e0bffe15 stw r2,-8(fp) - d5a0: e0bffe17 ldw r2,-8(fp) - d5a4: 10800810 cmplti r2,r2,32 - d5a8: 103fdd1e bne r2,zero,d520 - * file descriptor pool. - */ - - ALT_SEM_POST(alt_fd_list_lock); - - return rc; - d5ac: e0bffd17 ldw r2,-12(fp) -} - d5b0: e037883a mov sp,fp - d5b4: dfc00217 ldw ra,8(sp) - d5b8: df000117 ldw fp,4(sp) - d5bc: dc000017 ldw r16,0(sp) - d5c0: dec00304 addi sp,sp,12 - d5c4: f800283a ret - -0000d5c8 : -/* - * alt_icache_flush_all() is called to flush the entire instruction cache. - */ - -void alt_icache_flush_all (void) -{ - d5c8: deffff04 addi sp,sp,-4 - d5cc: df000015 stw fp,0(sp) - d5d0: d839883a mov fp,sp -#if NIOS2_ICACHE_SIZE > 0 - alt_icache_flush (0, NIOS2_ICACHE_SIZE); -#endif -} - d5d4: e037883a mov sp,fp - d5d8: df000017 ldw fp,0(sp) - d5dc: dec00104 addi sp,sp,4 - d5e0: f800283a ret - -0000d5e4 : - * @param irq IRQ number - * @return 0 if successful, else error (-1) - */ -int alt_ic_isr_register(alt_u32 ic_id, alt_u32 irq, alt_isr_func isr, - void *isr_context, void *flags) -{ - d5e4: defff904 addi sp,sp,-28 - d5e8: dfc00615 stw ra,24(sp) - d5ec: df000515 stw fp,20(sp) - d5f0: df000504 addi fp,sp,20 - d5f4: e13ffc15 stw r4,-16(fp) - d5f8: e17ffd15 stw r5,-12(fp) - d5fc: e1bffe15 stw r6,-8(fp) - d600: e1ffff15 stw r7,-4(fp) - return alt_iic_isr_register(ic_id, irq, isr, isr_context, flags); - d604: e0800217 ldw r2,8(fp) - d608: d8800015 stw r2,0(sp) - d60c: e13ffc17 ldw r4,-16(fp) - d610: e17ffd17 ldw r5,-12(fp) - d614: e1bffe17 ldw r6,-8(fp) - d618: e1ffff17 ldw r7,-4(fp) - d61c: 000d7b80 call d7b8 -} - d620: e037883a mov sp,fp - d624: dfc00117 ldw ra,4(sp) - d628: df000017 ldw fp,0(sp) - d62c: dec00204 addi sp,sp,8 - d630: f800283a ret - -0000d634 : - * @param ic_id Ignored. - * @param irq IRQ number - * @return 0 if successful, else error (-1) - */ -int alt_ic_irq_enable (alt_u32 ic_id, alt_u32 irq) -{ - d634: defff904 addi sp,sp,-28 - d638: df000615 stw fp,24(sp) - d63c: df000604 addi fp,sp,24 - d640: e13ffe15 stw r4,-8(fp) - d644: e17fff15 stw r5,-4(fp) - d648: e0bfff17 ldw r2,-4(fp) - d64c: e0bffc15 stw r2,-16(fp) -static ALT_INLINE alt_irq_context ALT_ALWAYS_INLINE - alt_irq_disable_all (void) -{ - alt_irq_context context; - - NIOS2_READ_STATUS (context); - d650: 0005303a rdctl r2,status - d654: e0bffb15 stw r2,-20(fp) - - NIOS2_WRITE_STATUS (context & ~NIOS2_STATUS_PIE_MSK); - d658: e0fffb17 ldw r3,-20(fp) - d65c: 00bfff84 movi r2,-2 - d660: 1884703a and r2,r3,r2 - d664: 1001703a wrctl status,r2 - - return context; - d668: e0bffb17 ldw r2,-20(fp) -static ALT_INLINE int ALT_ALWAYS_INLINE alt_irq_enable (alt_u32 id) -{ - alt_irq_context status; - extern volatile alt_u32 alt_irq_active; - - status = alt_irq_disable_all (); - d66c: e0bffd15 stw r2,-12(fp) - - alt_irq_active |= (1 << id); - d670: e0fffc17 ldw r3,-16(fp) - d674: 00800044 movi r2,1 - d678: 10c4983a sll r2,r2,r3 - d67c: 1007883a mov r3,r2 - d680: 00800074 movhi r2,1 - d684: 1087af04 addi r2,r2,7868 - d688: 10800017 ldw r2,0(r2) - d68c: 1886b03a or r3,r3,r2 - d690: 00800074 movhi r2,1 - d694: 1087af04 addi r2,r2,7868 - d698: 10c00015 stw r3,0(r2) - NIOS2_WRITE_IENABLE (alt_irq_active); - d69c: 00800074 movhi r2,1 - d6a0: 1087af04 addi r2,r2,7868 - d6a4: 10800017 ldw r2,0(r2) - d6a8: 100170fa wrctl ienable,r2 - d6ac: e0bffd17 ldw r2,-12(fp) - d6b0: e0bffa15 stw r2,-24(fp) - status &= ~NIOS2_STATUS_PIE_MSK; - status |= (context & NIOS2_STATUS_PIE_MSK); - - NIOS2_WRITE_STATUS (status); -#else - NIOS2_WRITE_STATUS (context); - d6b4: e0bffa17 ldw r2,-24(fp) - d6b8: 1001703a wrctl status,r2 - - alt_irq_enable_all(status); - - return 0; - d6bc: 0005883a mov r2,zero - return alt_irq_enable(irq); -} - d6c0: e037883a mov sp,fp - d6c4: df000017 ldw fp,0(sp) - d6c8: dec00104 addi sp,sp,4 - d6cc: f800283a ret - -0000d6d0 : - * @param ic_id Ignored. - * @param irq IRQ number - * @return 0 if successful, else error (-1) - */ -int alt_ic_irq_disable(alt_u32 ic_id, alt_u32 irq) -{ - d6d0: defff904 addi sp,sp,-28 - d6d4: df000615 stw fp,24(sp) - d6d8: df000604 addi fp,sp,24 - d6dc: e13ffe15 stw r4,-8(fp) - d6e0: e17fff15 stw r5,-4(fp) - d6e4: e0bfff17 ldw r2,-4(fp) - d6e8: e0bffc15 stw r2,-16(fp) -static ALT_INLINE alt_irq_context ALT_ALWAYS_INLINE - alt_irq_disable_all (void) -{ - alt_irq_context context; - - NIOS2_READ_STATUS (context); - d6ec: 0005303a rdctl r2,status - d6f0: e0bffb15 stw r2,-20(fp) - - NIOS2_WRITE_STATUS (context & ~NIOS2_STATUS_PIE_MSK); - d6f4: e0fffb17 ldw r3,-20(fp) - d6f8: 00bfff84 movi r2,-2 - d6fc: 1884703a and r2,r3,r2 - d700: 1001703a wrctl status,r2 - - return context; - d704: e0bffb17 ldw r2,-20(fp) -static ALT_INLINE int ALT_ALWAYS_INLINE alt_irq_disable (alt_u32 id) -{ - alt_irq_context status; - extern volatile alt_u32 alt_irq_active; - - status = alt_irq_disable_all (); - d708: e0bffd15 stw r2,-12(fp) - - alt_irq_active &= ~(1 << id); - d70c: e0fffc17 ldw r3,-16(fp) - d710: 00800044 movi r2,1 - d714: 10c4983a sll r2,r2,r3 - d718: 0084303a nor r2,zero,r2 - d71c: 1007883a mov r3,r2 - d720: 00800074 movhi r2,1 - d724: 1087af04 addi r2,r2,7868 - d728: 10800017 ldw r2,0(r2) - d72c: 1886703a and r3,r3,r2 - d730: 00800074 movhi r2,1 - d734: 1087af04 addi r2,r2,7868 - d738: 10c00015 stw r3,0(r2) - NIOS2_WRITE_IENABLE (alt_irq_active); - d73c: 00800074 movhi r2,1 - d740: 1087af04 addi r2,r2,7868 - d744: 10800017 ldw r2,0(r2) - d748: 100170fa wrctl ienable,r2 - d74c: e0bffd17 ldw r2,-12(fp) - d750: e0bffa15 stw r2,-24(fp) - status &= ~NIOS2_STATUS_PIE_MSK; - status |= (context & NIOS2_STATUS_PIE_MSK); - - NIOS2_WRITE_STATUS (status); -#else - NIOS2_WRITE_STATUS (context); - d754: e0bffa17 ldw r2,-24(fp) - d758: 1001703a wrctl status,r2 - - alt_irq_enable_all(status); - - return 0; - d75c: 0005883a mov r2,zero - return alt_irq_disable(irq); -} - d760: e037883a mov sp,fp - d764: df000017 ldw fp,0(sp) - d768: dec00104 addi sp,sp,4 - d76c: f800283a ret - -0000d770 : - * @param irq IRQ number - * @return Zero if corresponding interrupt is disabled and - * non-zero otherwise. - */ -alt_u32 alt_ic_irq_enabled(alt_u32 ic_id, alt_u32 irq) -{ - d770: defffc04 addi sp,sp,-16 - d774: df000315 stw fp,12(sp) - d778: df000304 addi fp,sp,12 - d77c: e13ffe15 stw r4,-8(fp) - d780: e17fff15 stw r5,-4(fp) - alt_u32 irq_enabled; - - NIOS2_READ_IENABLE(irq_enabled); - d784: 000530fa rdctl r2,ienable - d788: e0bffd15 stw r2,-12(fp) - - return (irq_enabled & (1 << irq)) ? 1: 0; - d78c: e0ffff17 ldw r3,-4(fp) - d790: 00800044 movi r2,1 - d794: 10c4983a sll r2,r2,r3 - d798: 1007883a mov r3,r2 - d79c: e0bffd17 ldw r2,-12(fp) - d7a0: 1884703a and r2,r3,r2 - d7a4: 1004c03a cmpne r2,r2,zero -} - d7a8: e037883a mov sp,fp - d7ac: df000017 ldw fp,0(sp) - d7b0: dec00104 addi sp,sp,4 - d7b4: f800283a ret - -0000d7b8 : - * @param flags - * @return 0 if successful, else error (-1) - */ -int alt_iic_isr_register(alt_u32 ic_id, alt_u32 irq, alt_isr_func isr, - void *isr_context, void *flags) -{ - d7b8: defff404 addi sp,sp,-48 - d7bc: dfc00b15 stw ra,44(sp) - d7c0: df000a15 stw fp,40(sp) - d7c4: df000a04 addi fp,sp,40 - d7c8: e13ffb15 stw r4,-20(fp) - d7cc: e17ffc15 stw r5,-16(fp) - d7d0: e1bffd15 stw r6,-12(fp) - d7d4: e1fffe15 stw r7,-8(fp) - int rc = -EINVAL; - d7d8: 00bffa84 movi r2,-22 - d7dc: e0bffa15 stw r2,-24(fp) - int id = irq; /* IRQ interpreted as the interrupt ID. */ - d7e0: e0bffc17 ldw r2,-16(fp) - d7e4: e0bff915 stw r2,-28(fp) - alt_irq_context status; - - if (id < ALT_NIRQ) - d7e8: e0bff917 ldw r2,-28(fp) - d7ec: 10800808 cmpgei r2,r2,32 - d7f0: 1000291e bne r2,zero,d898 -static ALT_INLINE alt_irq_context ALT_ALWAYS_INLINE - alt_irq_disable_all (void) -{ - alt_irq_context context; - - NIOS2_READ_STATUS (context); - d7f4: 0005303a rdctl r2,status - d7f8: e0bff715 stw r2,-36(fp) - - NIOS2_WRITE_STATUS (context & ~NIOS2_STATUS_PIE_MSK); - d7fc: e0fff717 ldw r3,-36(fp) - d800: 00bfff84 movi r2,-2 - d804: 1884703a and r2,r3,r2 - d808: 1001703a wrctl status,r2 - - return context; - d80c: e0bff717 ldw r2,-36(fp) - * interrupts are disabled while the handler tables are updated to ensure - * that an interrupt doesn't occur while the tables are in an inconsistant - * state. - */ - - status = alt_irq_disable_all(); - d810: e0bff815 stw r2,-32(fp) - - alt_irq[id].handler = isr; - d814: e0bff917 ldw r2,-28(fp) - d818: 00c00074 movhi r3,1 - d81c: 18c7bc04 addi r3,r3,7920 - d820: 100490fa slli r2,r2,3 - d824: 10c7883a add r3,r2,r3 - d828: e0bffd17 ldw r2,-12(fp) - d82c: 18800015 stw r2,0(r3) - alt_irq[id].context = isr_context; - d830: e0bff917 ldw r2,-28(fp) - d834: 00c00074 movhi r3,1 - d838: 18c7bc04 addi r3,r3,7920 - d83c: 100490fa slli r2,r2,3 - d840: 10c5883a add r2,r2,r3 - d844: 10c00104 addi r3,r2,4 - d848: e0bffe17 ldw r2,-8(fp) - d84c: 18800015 stw r2,0(r3) - - rc = (isr) ? alt_ic_irq_enable(ic_id, id) : alt_ic_irq_disable(ic_id, id); - d850: e0bffd17 ldw r2,-12(fp) - d854: 1005003a cmpeq r2,r2,zero - d858: 1000051e bne r2,zero,d870 - d85c: e17ff917 ldw r5,-28(fp) - d860: e13ffb17 ldw r4,-20(fp) - d864: 000d6340 call d634 - d868: e0bfff15 stw r2,-4(fp) - d86c: 00000406 br d880 - d870: e17ff917 ldw r5,-28(fp) - d874: e13ffb17 ldw r4,-20(fp) - d878: 000d6d00 call d6d0 - d87c: e0bfff15 stw r2,-4(fp) - d880: e0bfff17 ldw r2,-4(fp) - d884: e0bffa15 stw r2,-24(fp) - d888: e0bff817 ldw r2,-32(fp) - d88c: e0bff615 stw r2,-40(fp) - status &= ~NIOS2_STATUS_PIE_MSK; - status |= (context & NIOS2_STATUS_PIE_MSK); - - NIOS2_WRITE_STATUS (status); -#else - NIOS2_WRITE_STATUS (context); - d890: e0bff617 ldw r2,-40(fp) - d894: 1001703a wrctl status,r2 - - alt_irq_enable_all(status); - } - - return rc; - d898: e0bffa17 ldw r2,-24(fp) -} - d89c: e037883a mov sp,fp - d8a0: dfc00117 ldw ra,4(sp) - d8a4: df000017 ldw fp,0(sp) - d8a8: dec00204 addi sp,sp,8 - d8ac: f800283a ret - -0000d8b0 : - * If the device can not be succesfully opened, then the input file descriptor - * remains unchanged. - */ - -static void alt_open_fd(alt_fd* fd, const char* name, int flags, int mode) -{ - d8b0: defff804 addi sp,sp,-32 - d8b4: dfc00715 stw ra,28(sp) - d8b8: df000615 stw fp,24(sp) - d8bc: dc000515 stw r16,20(sp) - d8c0: df000504 addi fp,sp,20 - d8c4: e13ffc15 stw r4,-16(fp) - d8c8: e17ffd15 stw r5,-12(fp) - d8cc: e1bffe15 stw r6,-8(fp) - d8d0: e1ffff15 stw r7,-4(fp) - int old; - - old = open (name, flags, mode); - d8d4: e13ffd17 ldw r4,-12(fp) - d8d8: e17ffe17 ldw r5,-8(fp) - d8dc: e1bfff17 ldw r6,-4(fp) - d8e0: 000ae840 call ae84 - d8e4: e0bffb15 stw r2,-20(fp) - - if (old >= 0) - d8e8: e0bffb17 ldw r2,-20(fp) - d8ec: 1004803a cmplt r2,r2,zero - d8f0: 10001f1e bne r2,zero,d970 - { - fd->dev = alt_fd_list[old].dev; - d8f4: e13ffb17 ldw r4,-20(fp) - d8f8: 04000074 movhi r16,1 - d8fc: 843bf204 addi r16,r16,-4152 - d900: 01400304 movi r5,12 - d904: 0009fc80 call 9fc8 <__mulsi3> - d908: 1405883a add r2,r2,r16 - d90c: 10c00017 ldw r3,0(r2) - d910: e0bffc17 ldw r2,-16(fp) - d914: 10c00015 stw r3,0(r2) - fd->priv = alt_fd_list[old].priv; - d918: e13ffb17 ldw r4,-20(fp) - d91c: 04000074 movhi r16,1 - d920: 843bf204 addi r16,r16,-4152 - d924: 01400304 movi r5,12 - d928: 0009fc80 call 9fc8 <__mulsi3> - d92c: 1405883a add r2,r2,r16 - d930: 10800104 addi r2,r2,4 - d934: 10c00017 ldw r3,0(r2) - d938: e0bffc17 ldw r2,-16(fp) - d93c: 10c00115 stw r3,4(r2) - fd->fd_flags = alt_fd_list[old].fd_flags; - d940: e13ffb17 ldw r4,-20(fp) - d944: 04000074 movhi r16,1 - d948: 843bf204 addi r16,r16,-4152 - d94c: 01400304 movi r5,12 - d950: 0009fc80 call 9fc8 <__mulsi3> - d954: 1405883a add r2,r2,r16 - d958: 10800204 addi r2,r2,8 - d95c: 10c00017 ldw r3,0(r2) - d960: e0bffc17 ldw r2,-16(fp) - d964: 10c00215 stw r3,8(r2) - - alt_release_fd (old); - d968: e13ffb17 ldw r4,-20(fp) - d96c: 000b1f40 call b1f4 - } -} - d970: e037883a mov sp,fp - d974: dfc00217 ldw ra,8(sp) - d978: df000117 ldw fp,4(sp) - d97c: dc000017 ldw r16,0(sp) - d980: dec00304 addi sp,sp,12 - d984: f800283a ret - -0000d988 : - */ - -void alt_io_redirect(const char* stdout_dev, - const char* stdin_dev, - const char* stderr_dev) -{ - d988: defffb04 addi sp,sp,-20 - d98c: dfc00415 stw ra,16(sp) - d990: df000315 stw fp,12(sp) - d994: df000304 addi fp,sp,12 - d998: e13ffd15 stw r4,-12(fp) - d99c: e17ffe15 stw r5,-8(fp) - d9a0: e1bfff15 stw r6,-4(fp) - /* Redirect the channels */ - - alt_open_fd (&alt_fd_list[STDOUT_FILENO], stdout_dev, O_WRONLY, 0777); - d9a4: 01000074 movhi r4,1 - d9a8: 213bf504 addi r4,r4,-4140 - d9ac: e17ffd17 ldw r5,-12(fp) - d9b0: 01800044 movi r6,1 - d9b4: 01c07fc4 movi r7,511 - d9b8: 000d8b00 call d8b0 - alt_open_fd (&alt_fd_list[STDIN_FILENO], stdin_dev, O_RDONLY, 0777); - d9bc: 01000074 movhi r4,1 - d9c0: 213bf204 addi r4,r4,-4152 - d9c4: e17ffe17 ldw r5,-8(fp) - d9c8: 000d883a mov r6,zero - d9cc: 01c07fc4 movi r7,511 - d9d0: 000d8b00 call d8b0 - alt_open_fd (&alt_fd_list[STDERR_FILENO], stderr_dev, O_WRONLY, 0777); - d9d4: 01000074 movhi r4,1 - d9d8: 213bf804 addi r4,r4,-4128 - d9dc: e17fff17 ldw r5,-4(fp) - d9e0: 01800044 movi r6,1 - d9e4: 01c07fc4 movi r7,511 - d9e8: 000d8b00 call d8b0 -} - d9ec: e037883a mov sp,fp - d9f0: dfc00117 ldw ra,4(sp) - d9f4: df000017 ldw fp,0(sp) - d9f8: dec00204 addi sp,sp,8 - d9fc: f800283a ret - -0000da00 : - * alarms. Alternatively an alarm can unregister itself by returning zero when - * the alarm executes. - */ - -void alt_alarm_stop (alt_alarm* alarm) -{ - da00: defffa04 addi sp,sp,-24 - da04: df000515 stw fp,20(sp) - da08: df000504 addi fp,sp,20 - da0c: e13fff15 stw r4,-4(fp) -static ALT_INLINE alt_irq_context ALT_ALWAYS_INLINE - alt_irq_disable_all (void) -{ - alt_irq_context context; - - NIOS2_READ_STATUS (context); - da10: 0005303a rdctl r2,status - da14: e0bffd15 stw r2,-12(fp) - - NIOS2_WRITE_STATUS (context & ~NIOS2_STATUS_PIE_MSK); - da18: e0fffd17 ldw r3,-12(fp) - da1c: 00bfff84 movi r2,-2 - da20: 1884703a and r2,r3,r2 - da24: 1001703a wrctl status,r2 - - return context; - da28: e0bffd17 ldw r2,-12(fp) - alt_irq_context irq_context; - - irq_context = alt_irq_disable_all(); - da2c: e0bffe15 stw r2,-8(fp) - alt_llist_remove (&alarm->llist); - da30: e0bfff17 ldw r2,-4(fp) - da34: e0bffc15 stw r2,-16(fp) - * input argument is the element to remove. - */ - -static ALT_INLINE void ALT_ALWAYS_INLINE alt_llist_remove(alt_llist* entry) -{ - entry->next->previous = entry->previous; - da38: e0bffc17 ldw r2,-16(fp) - da3c: 10c00017 ldw r3,0(r2) - da40: e0bffc17 ldw r2,-16(fp) - da44: 10800117 ldw r2,4(r2) - da48: 18800115 stw r2,4(r3) - entry->previous->next = entry->next; - da4c: e0bffc17 ldw r2,-16(fp) - da50: 10c00117 ldw r3,4(r2) - da54: e0bffc17 ldw r2,-16(fp) - da58: 10800017 ldw r2,0(r2) - da5c: 18800015 stw r2,0(r3) - /* - * Set the entry to point to itself, so that any further calls to - * alt_llist_remove() are harmless. - */ - - entry->previous = entry; - da60: e0fffc17 ldw r3,-16(fp) - da64: e0bffc17 ldw r2,-16(fp) - da68: 18800115 stw r2,4(r3) - entry->next = entry; - da6c: e0fffc17 ldw r3,-16(fp) - da70: e0bffc17 ldw r2,-16(fp) - da74: 18800015 stw r2,0(r3) - da78: e0bffe17 ldw r2,-8(fp) - da7c: e0bffb15 stw r2,-20(fp) - status &= ~NIOS2_STATUS_PIE_MSK; - status |= (context & NIOS2_STATUS_PIE_MSK); - - NIOS2_WRITE_STATUS (status); -#else - NIOS2_WRITE_STATUS (context); - da80: e0bffb17 ldw r2,-20(fp) - da84: 1001703a wrctl status,r2 - alt_irq_enable_all (irq_context); -} - da88: e037883a mov sp,fp - da8c: df000017 ldw fp,0(sp) - da90: dec00104 addi sp,sp,4 - da94: f800283a ret - -0000da98 : - * - * alt_tick() is expected to run at interrupt level. - */ - -void alt_tick (void) -{ - da98: defffb04 addi sp,sp,-20 - da9c: dfc00415 stw ra,16(sp) - daa0: df000315 stw fp,12(sp) - daa4: df000304 addi fp,sp,12 - alt_alarm* next; - alt_alarm* alarm = (alt_alarm*) alt_alarm_list.next; - daa8: d0a00f17 ldw r2,-32708(gp) - daac: e0bffe15 stw r2,-8(fp) - - alt_u32 next_callback; - - /* update the tick counter */ - - _alt_nticks++; - dab0: d0a6ff17 ldw r2,-25604(gp) - dab4: 10800044 addi r2,r2,1 - dab8: d0a6ff15 stw r2,-25604(gp) - - /* process the registered callbacks */ - - while (alarm != (alt_alarm*) &alt_alarm_list) - dabc: 00003106 br db84 - { - next = (alt_alarm*) alarm->llist.next; - dac0: e0bffe17 ldw r2,-8(fp) - dac4: 10800017 ldw r2,0(r2) - dac8: e0bfff15 stw r2,-4(fp) - /* - * Upon the tick-counter rolling over it is safe to clear the - * roll-over flag; once the flag is cleared this (or subsequnt) - * tick events are enabled to generate an alarm event. - */ - if ((alarm->rollover) && (_alt_nticks == 0)) - dacc: e0bffe17 ldw r2,-8(fp) - dad0: 10800403 ldbu r2,16(r2) - dad4: 10803fcc andi r2,r2,255 - dad8: 1005003a cmpeq r2,r2,zero - dadc: 1000051e bne r2,zero,daf4 - dae0: d0a6ff17 ldw r2,-25604(gp) - dae4: 1004c03a cmpne r2,r2,zero - dae8: 1000021e bne r2,zero,daf4 - { - alarm->rollover = 0; - daec: e0bffe17 ldw r2,-8(fp) - daf0: 10000405 stb zero,16(r2) - } - - /* if the alarm period has expired, make the callback */ - if ((alarm->time <= _alt_nticks) && (alarm->rollover == 0)) - daf4: e0bffe17 ldw r2,-8(fp) - daf8: 10c00217 ldw r3,8(r2) - dafc: d0a6ff17 ldw r2,-25604(gp) - db00: 10c01e36 bltu r2,r3,db7c - db04: e0bffe17 ldw r2,-8(fp) - db08: 10800403 ldbu r2,16(r2) - db0c: 10803fcc andi r2,r2,255 - db10: 1004c03a cmpne r2,r2,zero - db14: 1000191e bne r2,zero,db7c - { - next_callback = alarm->callback (alarm->context); - db18: e0bffe17 ldw r2,-8(fp) - db1c: 10c00317 ldw r3,12(r2) - db20: e0bffe17 ldw r2,-8(fp) - db24: 11000517 ldw r4,20(r2) - db28: 183ee83a callr r3 - db2c: e0bffd15 stw r2,-12(fp) - - /* deactivate the alarm if the return value is zero */ - - if (next_callback == 0) - db30: e0bffd17 ldw r2,-12(fp) - db34: 1004c03a cmpne r2,r2,zero - db38: 1000031e bne r2,zero,db48 - { - alt_alarm_stop (alarm); - db3c: e13ffe17 ldw r4,-8(fp) - db40: 000da000 call da00 - db44: 00000d06 br db7c - } - else - { - alarm->time += next_callback; - db48: e0bffe17 ldw r2,-8(fp) - db4c: 10c00217 ldw r3,8(r2) - db50: e0bffd17 ldw r2,-12(fp) - db54: 1887883a add r3,r3,r2 - db58: e0bffe17 ldw r2,-8(fp) - db5c: 10c00215 stw r3,8(r2) - /* - * If the desired alarm time causes a roll-over, set the rollover - * flag. This will prevent the subsequent tick event from causing - * an alarm too early. - */ - if(alarm->time < _alt_nticks) - db60: e0bffe17 ldw r2,-8(fp) - db64: 10c00217 ldw r3,8(r2) - db68: d0a6ff17 ldw r2,-25604(gp) - db6c: 1880032e bgeu r3,r2,db7c - { - alarm->rollover = 1; - db70: e0fffe17 ldw r3,-8(fp) - db74: 00800044 movi r2,1 - db78: 18800405 stb r2,16(r3) - } - } - } - alarm = next; - db7c: e0bfff17 ldw r2,-4(fp) - db80: e0bffe15 stw r2,-8(fp) - - _alt_nticks++; - - /* process the registered callbacks */ - - while (alarm != (alt_alarm*) &alt_alarm_list) - db84: d0e00f04 addi r3,gp,-32708 - db88: e0bffe17 ldw r2,-8(fp) - db8c: 10ffcc1e bne r2,r3,dac0 - /* - * Update the operating system specific timer facilities. - */ - - ALT_OS_TIME_TICK(); -} - db90: e037883a mov sp,fp - db94: dfc00117 ldw ra,4(sp) - db98: df000017 ldw fp,0(sp) - db9c: dec00204 addi sp,sp,8 - dba0: f800283a ret - -0000dba4 : -#if defined (__GNUC__) && __GNUC__ >= 4 -int ALT_USLEEP (useconds_t us) -#else -unsigned int ALT_USLEEP (unsigned int us) -#endif -{ - dba4: defffd04 addi sp,sp,-12 - dba8: dfc00215 stw ra,8(sp) - dbac: df000115 stw fp,4(sp) - dbb0: df000104 addi fp,sp,4 - dbb4: e13fff15 stw r4,-4(fp) - return alt_busy_sleep(us); - dbb8: e13fff17 ldw r4,-4(fp) - dbbc: 000dbf40 call dbf4 -} - dbc0: e037883a mov sp,fp - dbc4: dfc00117 ldw ra,4(sp) - dbc8: df000017 ldw fp,0(sp) - dbcc: dec00204 addi sp,sp,8 - dbd0: f800283a ret - -0000dbd4 : -/* - * To initialize the internal interrupt controller, just clear the IENABLE - * register so that all possible IRQs are disabled. - */ -void altera_nios2_qsys_irq_init(void) -{ - dbd4: deffff04 addi sp,sp,-4 - dbd8: df000015 stw fp,0(sp) - dbdc: d839883a mov fp,sp - NIOS2_WRITE_IENABLE(0); - dbe0: 000170fa wrctl ienable,zero -} - dbe4: e037883a mov sp,fp - dbe8: df000017 ldw fp,0(sp) - dbec: dec00104 addi sp,sp,4 - dbf0: f800283a ret - -0000dbf4 : -#include "alt_types.h" - -#include "priv/alt_busy_sleep.h" - -unsigned int alt_busy_sleep (unsigned int us) -{ - dbf4: defffa04 addi sp,sp,-24 - dbf8: dfc00515 stw ra,20(sp) - dbfc: df000415 stw fp,16(sp) - dc00: df000404 addi fp,sp,16 - dc04: e13fff15 stw r4,-4(fp) - int big_loops; - alt_u32 cycles_per_loop; - - if (!strcmp(NIOS2_CPU_IMPLEMENTATION,"tiny")) - { - cycles_per_loop = 9; - dc08: 00800244 movi r2,9 - dc0c: e0bffc15 stw r2,-16(fp) - { - cycles_per_loop = 3; - } - - - big_loops = us / (INT_MAX/ - dc10: e13ffc17 ldw r4,-16(fp) - dc14: 014003f4 movhi r5,15 - dc18: 29509004 addi r5,r5,16960 - dc1c: 0009fc80 call 9fc8 <__mulsi3> - dc20: 100b883a mov r5,r2 - dc24: 0100bef4 movhi r4,763 - dc28: 213c2004 addi r4,r4,-3968 - dc2c: 0009fb80 call 9fb8 <__udivsi3> - dc30: 100b883a mov r5,r2 - dc34: 01200034 movhi r4,32768 - dc38: 213fffc4 addi r4,r4,-1 - dc3c: 0009fb80 call 9fb8 <__udivsi3> - dc40: 100b883a mov r5,r2 - dc44: e13fff17 ldw r4,-4(fp) - dc48: 0009fb80 call 9fb8 <__udivsi3> - dc4c: e0bffd15 stw r2,-12(fp) - (ALT_CPU_FREQ/(cycles_per_loop * 1000000))); - - if (big_loops) - dc50: e0bffd17 ldw r2,-12(fp) - dc54: 1005003a cmpeq r2,r2,zero - dc58: 10002a1e bne r2,zero,dd04 - { - for(i=0;i - /* - * Do NOT Try to single step the asm statement below - * (single step will never return) - * Step out of this function or set a breakpoint after the asm statements - */ - __asm__ volatile ( - dc64: 00a00034 movhi r2,32768 - dc68: 10bfffc4 addi r2,r2,-1 - dc6c: 10bfffc4 addi r2,r2,-1 - dc70: 103ffe1e bne r2,zero,dc6c - "\n1:" - "\n\t.pushsection .debug_alt_sim_info" - "\n\t.int 4, 0, 0b, 1b" - "\n\t.popsection" - :: "r" (INT_MAX)); - us -= (INT_MAX/(ALT_CPU_FREQ/ - dc74: e13ffc17 ldw r4,-16(fp) - dc78: 014003f4 movhi r5,15 - dc7c: 29509004 addi r5,r5,16960 - dc80: 0009fc80 call 9fc8 <__mulsi3> - dc84: 100b883a mov r5,r2 - dc88: 0100bef4 movhi r4,763 - dc8c: 213c2004 addi r4,r4,-3968 - dc90: 0009fb80 call 9fb8 <__udivsi3> - dc94: 100b883a mov r5,r2 - dc98: 01200034 movhi r4,32768 - dc9c: 213fffc4 addi r4,r4,-1 - dca0: 0009fb80 call 9fb8 <__udivsi3> - dca4: 1007883a mov r3,r2 - dca8: e0bfff17 ldw r2,-4(fp) - dcac: 10c5c83a sub r2,r2,r3 - dcb0: e0bfff15 stw r2,-4(fp) - big_loops = us / (INT_MAX/ - (ALT_CPU_FREQ/(cycles_per_loop * 1000000))); - - if (big_loops) - { - for(i=0;i - /* - * Do NOT Try to single step the asm statement below - * (single step will never return) - * Step out of this function or set a breakpoint after the asm statements - */ - __asm__ volatile ( - dccc: e13ffc17 ldw r4,-16(fp) - dcd0: 014003f4 movhi r5,15 - dcd4: 29509004 addi r5,r5,16960 - dcd8: 0009fc80 call 9fc8 <__mulsi3> - dcdc: 100b883a mov r5,r2 - dce0: 0100bef4 movhi r4,763 - dce4: 213c2004 addi r4,r4,-3968 - dce8: 0009fb80 call 9fb8 <__udivsi3> - dcec: 1009883a mov r4,r2 - dcf0: e17fff17 ldw r5,-4(fp) - dcf4: 0009fc80 call 9fc8 <__mulsi3> - dcf8: 10bfffc4 addi r2,r2,-1 - dcfc: 103ffe1e bne r2,zero,dcf8 - dd00: 00000d06 br dd38 - /* - * Do NOT Try to single step the asm statement below - * (single step will never return) - * Step out of this function or set a breakpoint after the asm statements - */ - __asm__ volatile ( - dd04: e13ffc17 ldw r4,-16(fp) - dd08: 014003f4 movhi r5,15 - dd0c: 29509004 addi r5,r5,16960 - dd10: 0009fc80 call 9fc8 <__mulsi3> - dd14: 100b883a mov r5,r2 - dd18: 0100bef4 movhi r4,763 - dd1c: 213c2004 addi r4,r4,-3968 - dd20: 0009fb80 call 9fb8 <__udivsi3> - dd24: 1009883a mov r4,r2 - dd28: e17fff17 ldw r5,-4(fp) - dd2c: 0009fc80 call 9fc8 <__mulsi3> - dd30: 10bfffc4 addi r2,r2,-1 - dd34: 00bffe16 blt zero,r2,dd30 - "\n\t.int 4, 0, 0b, 1b" - "\n\t.popsection" - :: "r" (us*(ALT_CPU_FREQ/(cycles_per_loop * 1000000)))); - } -#endif /* #ifndef ALT_SIM_OPTIMIZE */ - return 0; - dd38: 0005883a mov r2,zero -} - dd3c: e037883a mov sp,fp - dd40: dfc00117 ldw ra,4(sp) - dd44: df000017 ldw fp,0(sp) - dd48: dec00204 addi sp,sp,8 - dd4c: f800283a ret - -0000dd50 : - dd50: 200b883a mov r5,r4 - dd54: 000d883a mov r6,zero - dd58: 0009883a mov r4,zero - dd5c: 000f883a mov r7,zero - dd60: 000de101 jmpi de10 <__register_exitproc> - -0000dd64 : - dd64: defffe04 addi sp,sp,-8 - dd68: 000b883a mov r5,zero - dd6c: dc000015 stw r16,0(sp) - dd70: dfc00115 stw ra,4(sp) - dd74: 2021883a mov r16,r4 - dd78: 000df480 call df48 <__call_exitprocs> - dd7c: 00800074 movhi r2,1 - dd80: 1080b304 addi r2,r2,716 - dd84: 11000017 ldw r4,0(r2) - dd88: 20800f17 ldw r2,60(r4) - dd8c: 10000126 beq r2,zero,dd94 - dd90: 103ee83a callr r2 - dd94: 8009883a mov r4,r16 - dd98: 000e1380 call e138 <_exit> - -0000dd9c : - dd9c: 00c000c4 movi r3,3 - dda0: 1980032e bgeu r3,r6,ddb0 - dda4: 2144b03a or r2,r4,r5 - dda8: 10c4703a and r2,r2,r3 - ddac: 10000f26 beq r2,zero,ddec - ddb0: 31ffffc4 addi r7,r6,-1 - ddb4: 3000061e bne r6,zero,ddd0 - ddb8: 00000a06 br dde4 - ddbc: 39ffffc4 addi r7,r7,-1 - ddc0: 00bfffc4 movi r2,-1 - ddc4: 21000044 addi r4,r4,1 - ddc8: 29400044 addi r5,r5,1 - ddcc: 38800526 beq r7,r2,dde4 - ddd0: 20c00003 ldbu r3,0(r4) - ddd4: 28800003 ldbu r2,0(r5) - ddd8: 18bff826 beq r3,r2,ddbc - dddc: 1885c83a sub r2,r3,r2 - dde0: f800283a ret - dde4: 0005883a mov r2,zero - dde8: f800283a ret - ddec: 180f883a mov r7,r3 - ddf0: 20c00017 ldw r3,0(r4) - ddf4: 28800017 ldw r2,0(r5) - ddf8: 18bfed1e bne r3,r2,ddb0 - ddfc: 31bfff04 addi r6,r6,-4 - de00: 21000104 addi r4,r4,4 - de04: 29400104 addi r5,r5,4 - de08: 39bff936 bltu r7,r6,ddf0 - de0c: 003fe806 br ddb0 - -0000de10 <__register_exitproc>: - de10: defffa04 addi sp,sp,-24 - de14: 00800074 movhi r2,1 - de18: 1080b304 addi r2,r2,716 - de1c: dc000015 stw r16,0(sp) - de20: 14000017 ldw r16,0(r2) - de24: dd000415 stw r20,16(sp) - de28: 2829883a mov r20,r5 - de2c: 81405217 ldw r5,328(r16) - de30: dcc00315 stw r19,12(sp) - de34: dc800215 stw r18,8(sp) - de38: dc400115 stw r17,4(sp) - de3c: dfc00515 stw ra,20(sp) - de40: 2023883a mov r17,r4 - de44: 3027883a mov r19,r6 - de48: 3825883a mov r18,r7 - de4c: 28002526 beq r5,zero,dee4 <__register_exitproc+0xd4> - de50: 29000117 ldw r4,4(r5) - de54: 008007c4 movi r2,31 - de58: 11002716 blt r2,r4,def8 <__register_exitproc+0xe8> - de5c: 8800101e bne r17,zero,dea0 <__register_exitproc+0x90> - de60: 2105883a add r2,r4,r4 - de64: 1085883a add r2,r2,r2 - de68: 20c00044 addi r3,r4,1 - de6c: 1145883a add r2,r2,r5 - de70: 0009883a mov r4,zero - de74: 15000215 stw r20,8(r2) - de78: 28c00115 stw r3,4(r5) - de7c: 2005883a mov r2,r4 - de80: dfc00517 ldw ra,20(sp) - de84: dd000417 ldw r20,16(sp) - de88: dcc00317 ldw r19,12(sp) - de8c: dc800217 ldw r18,8(sp) - de90: dc400117 ldw r17,4(sp) - de94: dc000017 ldw r16,0(sp) - de98: dec00604 addi sp,sp,24 - de9c: f800283a ret - dea0: 29802204 addi r6,r5,136 - dea4: 00800044 movi r2,1 - dea8: 110e983a sll r7,r2,r4 - deac: 30c04017 ldw r3,256(r6) - deb0: 2105883a add r2,r4,r4 - deb4: 1085883a add r2,r2,r2 - deb8: 1185883a add r2,r2,r6 - debc: 19c6b03a or r3,r3,r7 - dec0: 14802015 stw r18,128(r2) - dec4: 14c00015 stw r19,0(r2) - dec8: 00800084 movi r2,2 - decc: 30c04015 stw r3,256(r6) - ded0: 88bfe31e bne r17,r2,de60 <__register_exitproc+0x50> - ded4: 30804117 ldw r2,260(r6) - ded8: 11c4b03a or r2,r2,r7 - dedc: 30804115 stw r2,260(r6) - dee0: 003fdf06 br de60 <__register_exitproc+0x50> - dee4: 00800074 movhi r2,1 - dee8: 1087fc04 addi r2,r2,8176 - deec: 100b883a mov r5,r2 - def0: 80805215 stw r2,328(r16) - def4: 003fd606 br de50 <__register_exitproc+0x40> - def8: 00800034 movhi r2,0 - defc: 10800004 addi r2,r2,0 - df00: 1000021e bne r2,zero,df0c <__register_exitproc+0xfc> - df04: 013fffc4 movi r4,-1 - df08: 003fdc06 br de7c <__register_exitproc+0x6c> - df0c: 01006404 movi r4,400 - df10: 103ee83a callr r2 - df14: 1007883a mov r3,r2 - df18: 103ffa26 beq r2,zero,df04 <__register_exitproc+0xf4> - df1c: 80805217 ldw r2,328(r16) - df20: 180b883a mov r5,r3 - df24: 18000115 stw zero,4(r3) - df28: 18800015 stw r2,0(r3) - df2c: 80c05215 stw r3,328(r16) - df30: 18006215 stw zero,392(r3) - df34: 18006315 stw zero,396(r3) - df38: 0009883a mov r4,zero - df3c: 883fc826 beq r17,zero,de60 <__register_exitproc+0x50> - df40: 003fd706 br dea0 <__register_exitproc+0x90> - -0000df44 : - df44: f800283a ret - -0000df48 <__call_exitprocs>: - df48: 00800074 movhi r2,1 - df4c: 1080b304 addi r2,r2,716 - df50: 10800017 ldw r2,0(r2) - df54: defff304 addi sp,sp,-52 - df58: df000b15 stw fp,44(sp) - df5c: d8800115 stw r2,4(sp) - df60: 00800034 movhi r2,0 - df64: 10800004 addi r2,r2,0 - df68: 1005003a cmpeq r2,r2,zero - df6c: d8800215 stw r2,8(sp) - df70: d8800117 ldw r2,4(sp) - df74: dd400815 stw r21,32(sp) - df78: dd000715 stw r20,28(sp) - df7c: 10805204 addi r2,r2,328 - df80: dfc00c15 stw ra,48(sp) - df84: ddc00a15 stw r23,40(sp) - df88: dd800915 stw r22,36(sp) - df8c: dcc00615 stw r19,24(sp) - df90: dc800515 stw r18,20(sp) - df94: dc400415 stw r17,16(sp) - df98: dc000315 stw r16,12(sp) - df9c: 282b883a mov r21,r5 - dfa0: 2039883a mov fp,r4 - dfa4: d8800015 stw r2,0(sp) - dfa8: 2829003a cmpeq r20,r5,zero - dfac: d8800117 ldw r2,4(sp) - dfb0: 14405217 ldw r17,328(r2) - dfb4: 88001026 beq r17,zero,dff8 <__call_exitprocs+0xb0> - dfb8: ddc00017 ldw r23,0(sp) - dfbc: 88800117 ldw r2,4(r17) - dfc0: 8c802204 addi r18,r17,136 - dfc4: 143fffc4 addi r16,r2,-1 - dfc8: 80000916 blt r16,zero,dff0 <__call_exitprocs+0xa8> - dfcc: 05bfffc4 movi r22,-1 - dfd0: a000151e bne r20,zero,e028 <__call_exitprocs+0xe0> - dfd4: 8409883a add r4,r16,r16 - dfd8: 2105883a add r2,r4,r4 - dfdc: 1485883a add r2,r2,r18 - dfe0: 10c02017 ldw r3,128(r2) - dfe4: a8c01126 beq r21,r3,e02c <__call_exitprocs+0xe4> - dfe8: 843fffc4 addi r16,r16,-1 - dfec: 85bff81e bne r16,r22,dfd0 <__call_exitprocs+0x88> - dff0: d8800217 ldw r2,8(sp) - dff4: 10003126 beq r2,zero,e0bc <__call_exitprocs+0x174> - dff8: dfc00c17 ldw ra,48(sp) - dffc: df000b17 ldw fp,44(sp) - e000: ddc00a17 ldw r23,40(sp) - e004: dd800917 ldw r22,36(sp) - e008: dd400817 ldw r21,32(sp) - e00c: dd000717 ldw r20,28(sp) - e010: dcc00617 ldw r19,24(sp) - e014: dc800517 ldw r18,20(sp) - e018: dc400417 ldw r17,16(sp) - e01c: dc000317 ldw r16,12(sp) - e020: dec00d04 addi sp,sp,52 - e024: f800283a ret - e028: 8409883a add r4,r16,r16 - e02c: 88c00117 ldw r3,4(r17) - e030: 2105883a add r2,r4,r4 - e034: 1445883a add r2,r2,r17 - e038: 18ffffc4 addi r3,r3,-1 - e03c: 11800217 ldw r6,8(r2) - e040: 1c001526 beq r3,r16,e098 <__call_exitprocs+0x150> - e044: 10000215 stw zero,8(r2) - e048: 303fe726 beq r6,zero,dfe8 <__call_exitprocs+0xa0> - e04c: 00c00044 movi r3,1 - e050: 1c06983a sll r3,r3,r16 - e054: 90804017 ldw r2,256(r18) - e058: 8cc00117 ldw r19,4(r17) - e05c: 1884703a and r2,r3,r2 - e060: 10001426 beq r2,zero,e0b4 <__call_exitprocs+0x16c> - e064: 90804117 ldw r2,260(r18) - e068: 1884703a and r2,r3,r2 - e06c: 10000c1e bne r2,zero,e0a0 <__call_exitprocs+0x158> - e070: 2105883a add r2,r4,r4 - e074: 1485883a add r2,r2,r18 - e078: 11400017 ldw r5,0(r2) - e07c: e009883a mov r4,fp - e080: 303ee83a callr r6 - e084: 88800117 ldw r2,4(r17) - e088: 98bfc81e bne r19,r2,dfac <__call_exitprocs+0x64> - e08c: b8800017 ldw r2,0(r23) - e090: 147fd526 beq r2,r17,dfe8 <__call_exitprocs+0xa0> - e094: 003fc506 br dfac <__call_exitprocs+0x64> - e098: 8c000115 stw r16,4(r17) - e09c: 003fea06 br e048 <__call_exitprocs+0x100> - e0a0: 2105883a add r2,r4,r4 - e0a4: 1485883a add r2,r2,r18 - e0a8: 11000017 ldw r4,0(r2) - e0ac: 303ee83a callr r6 - e0b0: 003ff406 br e084 <__call_exitprocs+0x13c> - e0b4: 303ee83a callr r6 - e0b8: 003ff206 br e084 <__call_exitprocs+0x13c> - e0bc: 88800117 ldw r2,4(r17) - e0c0: 1000081e bne r2,zero,e0e4 <__call_exitprocs+0x19c> - e0c4: 89000017 ldw r4,0(r17) - e0c8: 20000726 beq r4,zero,e0e8 <__call_exitprocs+0x1a0> - e0cc: b9000015 stw r4,0(r23) - e0d0: 8809883a mov r4,r17 - e0d4: 00000000 call 0 <__alt_mem_onchip_memory> - e0d8: bc400017 ldw r17,0(r23) - e0dc: 883fb71e bne r17,zero,dfbc <__call_exitprocs+0x74> - e0e0: 003fc506 br dff8 <__call_exitprocs+0xb0> - e0e4: 89000017 ldw r4,0(r17) - e0e8: 882f883a mov r23,r17 - e0ec: 2023883a mov r17,r4 - e0f0: 883fb21e bne r17,zero,dfbc <__call_exitprocs+0x74> - e0f4: 003fc006 br dff8 <__call_exitprocs+0xb0> - -0000e0f8 : - -/* - * Routine called on exit. - */ -static ALT_ALWAYS_INLINE void alt_sim_halt(int exit_code) -{ - e0f8: defffd04 addi sp,sp,-12 - e0fc: df000215 stw fp,8(sp) - e100: df000204 addi fp,sp,8 - e104: e13fff15 stw r4,-4(fp) - int r2 = exit_code; - e108: e0bfff17 ldw r2,-4(fp) - e10c: e0bffe15 stw r2,-8(fp) - __asm__ volatile ("\n0:\n\taddi %0,%0, -1\n\tbgt %0,zero,0b" : : "r" (ALT_CPU_FREQ/100) ); /* Delay for >30ms */ - - __asm__ volatile ("break 2" : : "D02"(r2), "D03"(r3) ALT_GMON_DATA ); - -#else /* !DEBUG_STUB */ - if (r2) { - e110: e0bffe17 ldw r2,-8(fp) - e114: 1005003a cmpeq r2,r2,zero - e118: 1000021e bne r2,zero,e124 - ALT_SIM_FAIL(); - e11c: 002af070 cmpltui zero,zero,43969 - e120: 00000106 br e128 - } else { - ALT_SIM_PASS(); - e124: 002af0b0 cmpltui zero,zero,43970 - } -#endif /* DEBUG_STUB */ -} - e128: e037883a mov sp,fp - e12c: df000017 ldw fp,0(sp) - e130: dec00104 addi sp,sp,4 - e134: f800283a ret - -0000e138 <_exit>: - * - * ALT_EXIT is mapped onto the _exit() system call in alt_syscall.h - */ - -void ALT_EXIT (int exit_code) -{ - e138: defffd04 addi sp,sp,-12 - e13c: dfc00215 stw ra,8(sp) - e140: df000115 stw fp,4(sp) - e144: df000104 addi fp,sp,4 - e148: e13fff15 stw r4,-4(fp) - ALT_OS_STOP(); - - /* Provide notification to the simulator that we've stopped */ - - ALT_LOG_PRINT_BOOT("[alt_exit.c] Calling ALT_SIM_HALT().\r\n"); - ALT_SIM_HALT(exit_code); - e14c: e13fff17 ldw r4,-4(fp) - e150: 000e0f80 call e0f8 - - /* spin forever, since there's no where to go back to */ - - ALT_LOG_PRINT_BOOT("[alt_exit.c] Spinning forever.\r\n"); - while (1); - e154: 003fff06 br e154 <_exit+0x1c> - e158: 0000df44 movi zero,893 diff --git a/software/qsys_tutorial_lcd3/readme.txt b/software/qsys_tutorial_lcd3/readme.txt deleted file mode 100644 index 7d0742f..0000000 --- a/software/qsys_tutorial_lcd3/readme.txt +++ /dev/null @@ -1,26 +0,0 @@ -Readme - Hello World Software Example - -DESCRIPTION: -Simple program that prints "Hello from Nios II" - -The memory footprint of this hosted application is intended to be small (under 100 kbytes) by default -using a standard reference deisgn. - -For an even smaller, reduced footprint version of this template, and an explanation of how -to reduce the memory footprint for a given application, see the -"small_hello_world" template. - - -PERIPHERALS USED: -This example exercises the following peripherals: -- STDOUT device (UART or JTAG UART) - -SOFTWARE SOURCE FILES: -This example includes the following software source files: -- hello_world.c: Everyone needs a Hello World program, right? - -BOARD/HOST REQUIREMENTS: -This example requires only a JTAG connection with a Nios Development board. If -the host communication settings are changed from JTAG UART (default) to use a -conventional UART, a serial cable between board DB-9 connector and the host is -required. diff --git a/software/qsys_tutorial_lcd3_bsp/.cproject b/software/qsys_tutorial_lcd3_bsp/.cproject deleted file mode 100644 index 07708a0..0000000 --- a/software/qsys_tutorial_lcd3_bsp/.cproject +++ /dev/null @@ -1,481 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/software/qsys_tutorial_lcd3_bsp/.project b/software/qsys_tutorial_lcd3_bsp/.project deleted file mode 100644 index 41778ab..0000000 --- a/software/qsys_tutorial_lcd3_bsp/.project +++ /dev/null @@ -1,85 +0,0 @@ - - - qsys_tutorial_lcd3_bsp - - - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - ?name? - - - - org.eclipse.cdt.make.core.append_environment - true - - - org.eclipse.cdt.make.core.autoBuildTarget - all - - - org.eclipse.cdt.make.core.buildArguments - - - - org.eclipse.cdt.make.core.buildCommand - make - - - org.eclipse.cdt.make.core.buildLocation - ${workspace_loc://qsys_tutorial_lcd3_bsp} - - - org.eclipse.cdt.make.core.cleanBuildTarget - clean - - - org.eclipse.cdt.make.core.contents - org.eclipse.cdt.make.core.activeConfigSettings - - - org.eclipse.cdt.make.core.enableAutoBuild - false - - - org.eclipse.cdt.make.core.enableCleanBuild - true - - - org.eclipse.cdt.make.core.enableFullBuild - true - - - org.eclipse.cdt.make.core.fullBuildTarget - all - - - org.eclipse.cdt.make.core.stopOnError - true - - - org.eclipse.cdt.make.core.useDefaultBuildCmd - true - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - org.eclipse.cdt.core.ccnature - com.altera.sbtgui.project.SBTGUINature - com.altera.sbtgui.project.SBTGUIBspNature - - diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/inc/alt_types.h b/software/qsys_tutorial_lcd3_bsp/HAL/inc/alt_types.h deleted file mode 100644 index d02f171..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/inc/alt_types.h +++ /dev/null @@ -1,54 +0,0 @@ -#ifndef __ALT_TYPES_H__ -#define __ALT_TYPES_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/* - * Don't declare these typedefs if this file is included by assembly source. - */ -#ifndef ALT_ASM_SRC -typedef signed char alt_8; -typedef unsigned char alt_u8; -typedef signed short alt_16; -typedef unsigned short alt_u16; -typedef signed long alt_32; -typedef unsigned long alt_u32; -typedef long long alt_64; -typedef unsigned long long alt_u64; -#endif - -#define ALT_INLINE __inline__ -#define ALT_ALWAYS_INLINE __attribute__ ((always_inline)) -#define ALT_WEAK __attribute__((weak)) - -#endif /* __ALT_TYPES_H__ */ diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/inc/altera_nios2_qsys_irq.h b/software/qsys_tutorial_lcd3_bsp/HAL/inc/altera_nios2_qsys_irq.h deleted file mode 100644 index 6629ec9..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/inc/altera_nios2_qsys_irq.h +++ /dev/null @@ -1,80 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * Support for the Nios II internal interrupt controller. - */ - -#ifndef __ALT_NIOS2_QSYS_IRQ_H__ -#define __ALT_NIOS2_QSYS_IRQ_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The macro ALTERA_NIOS2_IRQ_INSTANCE is used by the alt_irq_init() - * function in the auto-generated file alt_sys_init.c to create an - * instance of this interrupt controller device driver state if this - * module contains an interrupt controller. - * Only one instance of a Nios II is allowed so this macro is just empty. - */ - -#define ALTERA_NIOS2_QSYS_IRQ_INSTANCE(name, state) - -/* - * altera_nios2_irq_init() is called by the auto-generated function - * alt_irq_init() once for the Nios II if it contains an interrupt controller. - * The altera_nios2_irq_init() routine is called using the - * ALTERA_NIOS2_IRQ_INIT macro given below. - * - * This function initializes the internal interrupt controller - * so is not called if the Nios II contains an external interrupt - * controller port (because the internal interrupt controller - * is removed if this port is present). - */ - -extern void altera_nios2_qsys_irq_init( void ); - -/* - * The macro ALTERA_NIOS2_IRQ_INIT is used by the alt_irq_init() routine - * in the auto-generated file alt_sys_init.c to initialize an instance - * of the interrupt controller device driver state. - */ - -#define ALTERA_NIOS2_QSYS_IRQ_INIT(name, state) altera_nios2_qsys_irq_init() - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_NIOS2_QSYS_IRQ_H__ */ - diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/inc/io.h b/software/qsys_tutorial_lcd3_bsp/HAL/inc/io.h deleted file mode 100644 index 362f103..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/inc/io.h +++ /dev/null @@ -1,81 +0,0 @@ -#ifndef __IO_H__ -#define __IO_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/* IO Header file for Nios II Toolchain */ - -#include "alt_types.h" -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#ifndef SYSTEM_BUS_WIDTH -#error SYSTEM_BUS_WIDTH undefined -#endif - -/* Dynamic bus access functions */ - -#define __IO_CALC_ADDRESS_DYNAMIC(BASE, OFFSET) \ - ((void *)(((alt_u8*)BASE) + (OFFSET))) - -#define IORD_32DIRECT(BASE, OFFSET) \ - __builtin_ldwio (__IO_CALC_ADDRESS_DYNAMIC ((BASE), (OFFSET))) -#define IORD_16DIRECT(BASE, OFFSET) \ - __builtin_ldhuio (__IO_CALC_ADDRESS_DYNAMIC ((BASE), (OFFSET))) -#define IORD_8DIRECT(BASE, OFFSET) \ - __builtin_ldbuio (__IO_CALC_ADDRESS_DYNAMIC ((BASE), (OFFSET))) - -#define IOWR_32DIRECT(BASE, OFFSET, DATA) \ - __builtin_stwio (__IO_CALC_ADDRESS_DYNAMIC ((BASE), (OFFSET)), (DATA)) -#define IOWR_16DIRECT(BASE, OFFSET, DATA) \ - __builtin_sthio (__IO_CALC_ADDRESS_DYNAMIC ((BASE), (OFFSET)), (DATA)) -#define IOWR_8DIRECT(BASE, OFFSET, DATA) \ - __builtin_stbio (__IO_CALC_ADDRESS_DYNAMIC ((BASE), (OFFSET)), (DATA)) - -/* Native bus access functions */ - -#define __IO_CALC_ADDRESS_NATIVE(BASE, REGNUM) \ - ((void *)(((alt_u8*)BASE) + ((REGNUM) * (SYSTEM_BUS_WIDTH/8)))) - -#define IORD(BASE, REGNUM) \ - __builtin_ldwio (__IO_CALC_ADDRESS_NATIVE ((BASE), (REGNUM))) -#define IOWR(BASE, REGNUM, DATA) \ - __builtin_stwio (__IO_CALC_ADDRESS_NATIVE ((BASE), (REGNUM)), (DATA)) - -#ifdef __cplusplus -} -#endif - -#endif /* __IO_H__ */ diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/inc/nios2.h b/software/qsys_tutorial_lcd3_bsp/HAL/inc/nios2.h deleted file mode 100644 index 72cefba..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/inc/nios2.h +++ /dev/null @@ -1,230 +0,0 @@ -#ifndef __NIOS2_H__ -#define __NIOS2_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2008 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * This header provides processor specific macros for accessing the Nios2 - * control registers. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * Macros for accessing selected processor registers - */ - -#define NIOS2_READ_ET(et) \ - do { __asm ("mov %0, et" : "=r" (et) ); } while (0) - -#define NIOS2_WRITE_ET(et) \ - do { __asm volatile ("mov et, %z0" : : "rM" (et)); } while (0) - -#define NIOS2_READ_SP(sp) \ - do { __asm ("mov %0, sp" : "=r" (sp) ); } while (0) - -/* - * Macros for useful processor instructions - */ - -#define NIOS2_BREAK() \ - do { __asm volatile ("break"); } while (0) - -#define NIOS2_REPORT_STACK_OVERFLOW() \ - do { __asm volatile("break 3"); } while (0) - -/* - * Macros for accessing the control registers. - */ - -#define NIOS2_READ_STATUS(dest) \ - do { dest = __builtin_rdctl(0); } while (0) - -#define NIOS2_WRITE_STATUS(src) \ - do { __builtin_wrctl(0, src); } while (0) - -#define NIOS2_READ_ESTATUS(dest) \ - do { dest = __builtin_rdctl(1); } while (0) - -#define NIOS2_READ_BSTATUS(dest) \ - do { dest = __builtin_rdctl(2); } while (0) - -#define NIOS2_READ_IENABLE(dest) \ - do { dest = __builtin_rdctl(3); } while (0) - -#define NIOS2_WRITE_IENABLE(src) \ - do { __builtin_wrctl(3, src); } while (0) - -#define NIOS2_READ_IPENDING(dest) \ - do { dest = __builtin_rdctl(4); } while (0) - -#define NIOS2_READ_CPUID(dest) \ - do { dest = __builtin_rdctl(5); } while (0) - - -/* - * Macros for accessing extra exception registers. These - * are always enabled wit the MPU or MMU, and optionally - * with other advanced exception types/ - */ -#define NIOS2_READ_EXCEPTION(dest) \ - do { dest = __builtin_rdctl(7); } while (0) - -#define NIOS2_READ_BADADDR(dest) \ - do { dest = __builtin_rdctl(12); } while (0) - - -/* - * Macros for accessing control registers for MPU - * operation. These should not be used unless the - * MPU is enabled. - * - * The config register may be augmented for future - * enhancements. For now, only MPU support is provided. - */ -/* Config register */ -#define NIOS2_WRITE_CONFIG(src) \ - do { __builtin_wrctl(13, src); } while (0) - -#define NIOS2_READ_CONFIG(dest) \ - do { dest = __builtin_rdctl(13); } while (0) - -/* MPU Base Address Register */ -#define NIOS2_WRITE_MPUBASE(src) \ - do { __builtin_wrctl(14, src); } while (0) - -#define NIOS2_READ_MPUBASE(dest) \ - do { dest = __builtin_rdctl(14); } while (0) - -/* MPU Access Register */ -#define NIOS2_WRITE_MPUACC(src) \ - do { __builtin_wrctl(15, src); } while (0) - -#define NIOS2_READ_MPUACC(dest) \ - do { dest = __builtin_rdctl(15); } while (0) - - -/* - * Nios II control registers that are always present - */ -#define NIOS2_STATUS status -#define NIOS2_ESTATUS estatus -#define NIOS2_BSTATUS bstatus -#define NIOS2_IENABLE ienable -#define NIOS2_IPENDING ipending -#define NIOS2_CPUID cpuid - -/* - * STATUS, BSTATUS, ESTATUS, and SSTATUS fields. - * The presence of fields is a function of the Nios II configuration. - */ -#define NIOS2_STATUS_PIE_MSK (0x00000001) -#define NIOS2_STATUS_PIE_OFST (0) -#define NIOS2_STATUS_U_MSK (0x00000002) -#define NIOS2_STATUS_U_OFST (1) -#define NIOS2_STATUS_EH_MSK (0x00000004) -#define NIOS2_STATUS_EH_OFST (2) -#define NIOS2_STATUS_IH_MSK (0x00000008) -#define NIOS2_STATUS_IH_OFST (3) -#define NIOS2_STATUS_IL_MSK (0x000003f0) -#define NIOS2_STATUS_IL_OFST (4) -#define NIOS2_STATUS_CRS_MSK (0x0000fc00) -#define NIOS2_STATUS_CRS_OFST (10) -#define NIOS2_STATUS_PRS_MSK (0x003f0000) -#define NIOS2_STATUS_PRS_OFST (16) -#define NIOS2_STATUS_NMI_MSK (0x00400000) -#define NIOS2_STATUS_NMI_OFST (22) -#define NIOS2_STATUS_RSIE_MSK (0x00800000) -#define NIOS2_STATUS_RSIE_OFST (23) -#define NIOS2_STATUS_SRS_MSK (0x80000000) -#define NIOS2_STATUS_SRS_OFST (31) - -/* - * Bit masks & offsets available with extra exceptions support - */ - -/* Exception register */ -#define NIOS2_EXCEPTION_REG_CAUSE_MASK (0x0000007c) -#define NIOS2_EXCEPTION_REG_CAUSE_OFST (2) - -/* - * Bit masks & offsets for MPU support - * - * All bit-masks are expressed relative to the position - * of the data with a register. To read data that is LSB- - * aligned, the register read data should be masked, then - * right-shifted by the designated "OFST" macro value. The - * opposite should be used for register writes when starting - * with LSB-aligned data. - */ - -/* Config register */ -#define NIOS2_CONFIG_REG_PE_MASK (0x00000001) -#define NIOS2_CONFIG_REG_PE_OFST (0) -#define NIOS2_CONFIG_REG_ANI_MASK (0x00000002) -#define NIOS2_CONFIG_REG_ANI_OFST (1) - -/* MPU Base Address Register */ -#define NIOS2_MPUBASE_D_MASK (0x00000001) -#define NIOS2_MPUBASE_D_OFST (0) -#define NIOS2_MPUBASE_INDEX_MASK (0x0000003e) -#define NIOS2_MPUBASE_INDEX_OFST (1) -#define NIOS2_MPUBASE_BASE_ADDR_MASK (0xffffffc0) -#define NIOS2_MPUBASE_BASE_ADDR_OFST (6) - -/* MPU Access Register */ -#define NIOS2_MPUACC_LIMIT_MASK (0xffffffc0) -#define NIOS2_MPUACC_LIMIT_OFST (6) -#define NIOS2_MPUACC_MASK_MASK (0xffffffc0) -#define NIOS2_MPUACC_MASK_OFST (6) -#define NIOS2_MPUACC_C_MASK (0x00000020) -#define NIOS2_MPUACC_C_OFST (5) -#define NIOS2_MPUACC_PERM_MASK (0x0000001c) -#define NIOS2_MPUACC_PERM_OFST (2) -#define NIOS2_MPUACC_RD_MASK (0x00000002) -#define NIOS2_MPUACC_RD_OFST (1) -#define NIOS2_MPUACC_WR_MASK (0x00000001) -#define NIOS2_MPUACC_WR_OFST (0) - -/* - * Number of available IRQs in internal interrupt controller. - */ -#define NIOS2_NIRQ 32 - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __NIOS2_H__ */ diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/inc/os/alt_flag.h b/software/qsys_tutorial_lcd3_bsp/HAL/inc/os/alt_flag.h deleted file mode 100644 index b9b4605..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/inc/os/alt_flag.h +++ /dev/null @@ -1,98 +0,0 @@ -#ifndef __ALT_FLAG_H__ -#define __ALT_FLAG_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * This header provides macro definitions that can be used to create and use - * uc/OS-II style event flags. These macros can be used in both a uC/OS-II based - * environment, and a single threaded HAL based environment. - * - * The motivation for these macros is to allow code to be developed which is - * thread safe under uC/OS-II, but incurs no additional overhead when used in a - * single threaded HAL environment. - * - * In the case of a single threaded HAL environment, they compile to - * "do nothing" directives, which ensures they do not contribute to the final - * executable. - * - * The following macros are available: - * - * ALT_FLAG_GRP - Create a flag group instance. - * ALT_EXTERN_FLAG_GRP - Create a reference to an external flag group instance. - * ALT_STATIC_FLAG_GRP - Create a static flag group instance. - * ALT_FLAG_CREATE - Initialise a flag group. - * ALT_FLAG_PEND - Pend on a flag group. - * ALT_FLAG_POST - Set a flag condition. - - * - * Input arguments and return codes are all consistant with the equivalent - * uC/OS-II function. - * - * It's important to be careful in the use of the macros: ALT_FLAG_GRP, - * ALT_EXTERN_FLAG_GRP, and ALT_STATIC_FLAG_GRP. In these three cases the - * semi-colon is included in the macro definition; so, for example, you should - * use: - * - * ALT_FLAG_GRP(mygroup) - * - * not: - * - * ALT_FLAG_GRP(mygroup); - * - * The inclusion of the semi-colon has been necessary to ensure the macros can - * compile with no warnings when used in a single threaded HAL environment. - * - */ - -#include "priv/alt_no_error.h" - -#define ALT_FLAG_GRP(group) -#define ALT_EXTERN_FLAG_GRP(group) -#define ALT_STATIC_FLAG_GRP(group) - -#define ALT_FLAG_CREATE(group, flags) alt_no_error () -#define ALT_FLAG_PEND(group, flags, wait_type, timeout) alt_no_error () -#define ALT_FLAG_POST(group, flags, opt) alt_no_error () - -#ifndef ALT_SINGLE_THREADED -#define ALT_SINGLE_THREADED -#endif - -#endif /* __ALT_FLAG_H__ */ diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/inc/os/alt_hooks.h b/software/qsys_tutorial_lcd3_bsp/HAL/inc/os/alt_hooks.h deleted file mode 100644 index 9054e3f..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/inc/os/alt_hooks.h +++ /dev/null @@ -1,61 +0,0 @@ -#ifndef __ALT_HOOKS_H__ -#define __ALT_HOOKS_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * This header provides "do-nothing" macro definitions for operating system - * hooks within the HAL. The O/S component can override these to provide it's - * own implementation. - */ - -#define ALT_OS_TIME_TICK() while(0) -#define ALT_OS_INIT() while(0) -#define ALT_OS_STOP() while(0) - -/* Call from assembly code */ -#define ALT_OS_INT_ENTER_ASM -#define ALT_OS_INT_EXIT_ASM - -/* Call from C code */ -#define ALT_OS_INT_ENTER() while(0) -#define ALT_OS_INT_EXIT() while(0) - - -#endif /* __ALT_HOOKS_H__ */ diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/inc/os/alt_sem.h b/software/qsys_tutorial_lcd3_bsp/HAL/inc/os/alt_sem.h deleted file mode 100644 index 753943e..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/inc/os/alt_sem.h +++ /dev/null @@ -1,96 +0,0 @@ -#ifndef __ALT_SEM_H__ -#define __ALT_SEM_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * This header provides macro definitions that can be used to create and use - * semaphores. These macros can be used in both a uC/OS-II based environment, - * and a single threaded HAL based environment. - * - * The motivation for these macros is to allow code to be developed which is - * thread safe under uC/OS-II, but incurs no additional overhead when used in a - * single threaded HAL environment. - * - * In the case of a single threaded HAL environment, they compile to - * "do nothing" directives, which ensures they do not contribute to the final - * executable. - * - * The following macros are available: - * - * ALT_SEM - Create a semaphore instance. - * ALT_EXTERN_SEM - Create a reference to an external semaphore instance. - * ALT_STATIC_SEM - Create a static semaphore instance. - * ALT_SEM_CREATE - Initialise a semaphore. - * ALT_SEM_PEND - Pend on a semaphore. - * ALT_SEM_POST - Increment a semaphore. - * - * Input arguments and return codes are all consistant with the equivalent - * uC/OS-II function. - * - * It's important to be careful in the use of the macros: ALT_SEM, - * ALT_EXTERN_SEM, and ALT_STATIC_SEM. In these three cases the semi-colon is - * included in the macro definition; so, for example, you should use: - * - * ALT_SEM(mysem) - * - * not: - * - * ALT_SEM(mysem); - * - * The inclusion of the semi-colon has been necessary to ensure the macros can - * compile with no warnings when used in a single threaded HAL environment. - * - */ - -#include "priv/alt_no_error.h" - -#define ALT_SEM(sem) -#define ALT_EXTERN_SEM(sem) -#define ALT_STATIC_SEM(sem) - -#define ALT_SEM_CREATE(sem, value) alt_no_error () -#define ALT_SEM_PEND(sem, timeout) alt_no_error () -#define ALT_SEM_POST(sem) alt_no_error () - -#ifndef ALT_SINGLE_THREADED -#define ALT_SINGLE_THREADED -#endif - -#endif /* __ALT_SEM_H__ */ diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/inc/os/alt_syscall.h b/software/qsys_tutorial_lcd3_bsp/HAL/inc/os/alt_syscall.h deleted file mode 100644 index 507c6aa..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/inc/os/alt_syscall.h +++ /dev/null @@ -1,75 +0,0 @@ -#ifndef __ALT_SYSCALL_H__ -#define __ALT_SYSCALL_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * The macros defined in this file are used to provide the function names used - * for the HAL 'UNIX style' interface, e.g. read(), write() etc. - * - * Operating systems which are ported to the HAL can provide their own - * version of this file, which will be used in preference. This allows - * the operating system to provide it's own implementation of the top level - * system calls, while retaining the HAL functions under a different name, - * for example, alt_read(), alt_write() etc. - */ - -#define ALT_CLOSE close -#define ALT_ENVIRON environ -#define ALT_EXECVE execve -#define ALT_EXIT _exit -#define ALT_FCNTL fcntl -#define ALT_FORK fork -#define ALT_FSTAT fstat -#define ALT_GETPID getpid -#define ALT_GETTIMEOFDAY gettimeofday -#define ALT_IOCTL ioctl -#define ALT_ISATTY isatty -#define ALT_KILL kill -#define ALT_LINK link -#define ALT_LSEEK lseek -#define ALT_OPEN open -#define ALT_READ read -#define ALT_RENAME _rename -#define ALT_SBRK sbrk -#define ALT_SETTIMEOFDAY settimeofday -#define ALT_STAT stat -#define ALT_UNLINK unlink -#define ALT_USLEEP usleep -#define ALT_WAIT wait -#define ALT_WRITE write -#define ALT_TIMES times - -/* - * - */ - -#endif /* __ALT_SYSCALL_H__ */ diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/inc/priv/alt_alarm.h b/software/qsys_tutorial_lcd3_bsp/HAL/inc/priv/alt_alarm.h deleted file mode 100644 index 45d6a0e..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/inc/priv/alt_alarm.h +++ /dev/null @@ -1,101 +0,0 @@ -#ifndef __ALT_PRIV_ALARM_H__ -#define __ALT_PRIV_ALARM_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "alt_types.h" - -/* - * This header provides the internal defenitions required by the public - * interface alt_alarm.h. These variables and structures are not guaranteed to - * exist in future implementations of the HAL. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * "alt_alarm_s" is a structure type used to maintain lists of alarm callback - * functions. - */ - -struct alt_alarm_s -{ - alt_llist llist; /* linked list */ - alt_u32 time; /* time in system ticks of the callback */ - alt_u32 (*callback) (void* context); /* callback function. The return - * value is the period for the next callback; where - * zero indicates that the alarm should be removed - * from the list. - */ - alt_u8 rollover; /* set when desired alarm time + current time causes - overflow, to prevent premature alarm */ - void* context; /* Argument for the callback */ -}; - -/* - * "_alt_tick_rate" is a global variable used to store the system clock rate - * in ticks per second. This is initialised to zero, which coresponds to there - * being no system clock available. - * - * It is then set to it's final value by the system clock driver through a call - * to alt_sysclk_init(). - */ - -extern alt_u32 _alt_tick_rate; - -/* - * "_alt_nticks" is a global variable which records the elapsed number of - * system clock ticks since the last call to settimeofday() or since reset if - * settimeofday() has not been called. - */ - -extern volatile alt_u32 _alt_nticks; - -/* The list of registered alarms. */ - -extern alt_llist alt_alarm_list; - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_PRIV_ALARM_H__ */ diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/inc/priv/alt_busy_sleep.h b/software/qsys_tutorial_lcd3_bsp/HAL/inc/priv/alt_busy_sleep.h deleted file mode 100644 index b1af849..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/inc/priv/alt_busy_sleep.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef __ALT_BUSY_SLEEP_H -#define __ALT_BUSY_SLEEP_H - -/* - * Copyright (c) 2003 Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - */ - -/* - * The function alt_busy_sleep provides a busy loop implementation of usleep. - * This is used to provide usleep for the standalone HAL, or when the timer is - * unavailable in uC/OS-II. - */ - -extern unsigned int alt_busy_sleep (unsigned int us); - -#endif /* __ALT_BUSY_SLEEP_H */ diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/inc/priv/alt_dev_llist.h b/software/qsys_tutorial_lcd3_bsp/HAL/inc/priv/alt_dev_llist.h deleted file mode 100644 index 451b063..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/inc/priv/alt_dev_llist.h +++ /dev/null @@ -1,77 +0,0 @@ -#ifndef __ALT_DEV_LLIST_H__ -#define __ALT_DEV_LLIST_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "sys/alt_llist.h" -#include "alt_types.h" - -/* - * This header provides the internal defenitions required to control file - * access. These variables and functions are not guaranteed to exist in - * future implementations of the HAL. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The alt_dev_llist is an internal structure used to form a common base - * class for all device types. The use of this structure allows common code - * to be used to manipulate the various device lists. - */ - -typedef struct { - alt_llist llist; - const char* name; -} alt_dev_llist; - -/* - * - */ - -extern int alt_dev_llist_insert (alt_dev_llist* dev, alt_llist* list); - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_DEV_LLIST_H__ */ diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/inc/priv/alt_exception_handler_registry.h b/software/qsys_tutorial_lcd3_bsp/HAL/inc/priv/alt_exception_handler_registry.h deleted file mode 100644 index c6905fa..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/inc/priv/alt_exception_handler_registry.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef __ALT_EXCEPTION_HANDLER_REGISTRY_H__ -#define __ALT_EXCEPTION_HANDLER_REGISTRY_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2008 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ -#include "sys/alt_exceptions.h" - -/* Function pointer to exception callback routine */ -extern alt_exception_result (*alt_instruction_exception_handler) - (alt_exception_cause, alt_u32, alt_u32); - -#endif /* __ALT_EXCEPTION_HANDLER_REGISTRY_H__ */ diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/inc/priv/alt_file.h b/software/qsys_tutorial_lcd3_bsp/HAL/inc/priv/alt_file.h deleted file mode 100644 index 2c3e843..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/inc/priv/alt_file.h +++ /dev/null @@ -1,179 +0,0 @@ -#ifndef __ALT_FILE_H__ -#define __ALT_FILE_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "sys/alt_dev.h" -#include "sys/alt_llist.h" -#include "os/alt_sem.h" - -#include "alt_types.h" - -/* - * This header provides the internal defenitions required to control file - * access. These variables and functions are not guaranteed to exist in - * future implementations of the HAL. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The function alt_find_dev() is used to search the device list "list" to - * locate a device named "name". If a match is found, then a pointer to the - * device is returned, otherwise NULL is returned. - */ - -extern alt_dev* alt_find_dev (const char* name, alt_llist* list); - -/* - * alt_find_file() is used to search the list of registered file systems to - * find the filesystem that the file named "name" belongs to. If a match is - * found, then a pointer to the filesystems alt_dev structure is returned, - * otherwise NULL is returned. - * - * Note that a match does not indicate that the file exists, only that a - * filesystem exists that is registered for a partition that could contain - * the file. The filesystems open() function would need to be called in order - * to determine if the file exists. - */ - -extern alt_dev* alt_find_file (const char* name); - -/* - * alt_get_fd() is used to allocate a file descriptor for the device or - * filesystem "dev". A negative return value indicates an error, otherwise the - * return value is the index of the file descriptor within the file descriptor - * pool. - */ - -extern int alt_get_fd (alt_dev* dev); - -/* - * alt_release_fd() is called to free the file descriptor with index "fd". - */ - -extern void alt_release_fd (int fd); - -/* - * alt_fd_lock() is called by ioctl() to mark the file descriptor "fd" as - * being open for exclusive access. Subsequent calls to open() for the device - * associated with "fd" will fail. A device is unlocked by either calling - * close() for "fd", or by an alternate call to ioctl() (see ioctl.c for - * details). - */ - -extern int alt_fd_lock (alt_fd* fd); - -/* - * alt_fd_unlock() is called by ioctl() to unlock a descriptor previously - * locked by a call to alt_fd_lock(). - */ - -extern int alt_fd_unlock (alt_fd* fd); - -/* - * "alt_fd_list" is the pool of file descriptors. - */ - -extern alt_fd alt_fd_list[]; - -/* - * flags used by alt_fd. - * - * ALT_FD_EXCL is used to mark a file descriptor as locked for exclusive - * access, i.e. further calls to open() for the associated device should - * fail. - * - * ALT_FD_DEV marks a dile descriptor as belonging to a device as oposed to a - * filesystem. - */ - -#define ALT_FD_EXCL 0x80000000 -#define ALT_FD_DEV 0x40000000 - -#define ALT_FD_FLAGS_MASK (ALT_FD_EXCL | ALT_FD_DEV) - -/* - * "alt_dev_list" is the head of the linked list of registered devices. - */ - -extern alt_llist alt_dev_list; - -/* - * "alt_fs_list" is the head of the linked list of registered filesystems. - */ - -extern alt_llist alt_fs_list; - -/* - * "alt_fd_list_lock" is a semaphore used to ensure that access to the pool - * of file descriptors is thread safe. - */ - -ALT_EXTERN_SEM(alt_fd_list_lock) - -/* - * "alt_max_fd" is a 'high water mark'. It indicates the highest file - * descriptor allocated. Use of this can save searching the entire pool - * for active file descriptors, which helps avoid contention on access - * to the file descriptor pool. - */ - -extern alt_32 alt_max_fd; - -/* - * alt_io_redirect() is called at startup to redirect stdout, stdin, and - * stderr to the devices named in the input arguments. By default these streams - * are directed at /dev/null, and are then redirected using this function once - * all of the devices have been registered within the system. - */ - -extern void alt_io_redirect(const char* stdout_dev, - const char* stdin_dev, - const char* stderr_dev); - - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_FILE_H__ */ diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/inc/priv/alt_iic_isr_register.h b/software/qsys_tutorial_lcd3_bsp/HAL/inc/priv/alt_iic_isr_register.h deleted file mode 100644 index a0cb01c..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/inc/priv/alt_iic_isr_register.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef __ALT_IIC_ISR_REGISTER_H_ -#define __ALT_IIC_ISR_REGISTER_H_ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ -#include "alt_types.h" -#include "sys/alt_irq.h" - -extern int alt_iic_isr_register(alt_u32 ic_id, alt_u32 irq, alt_isr_func isr, - void *isr_context, void *flags); - -#endif /* __ALT_IIC_ISR_REGISTER_H_ */ diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/inc/priv/alt_irq_table.h b/software/qsys_tutorial_lcd3_bsp/HAL/inc/priv/alt_irq_table.h deleted file mode 100644 index 694ef06..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/inc/priv/alt_irq_table.h +++ /dev/null @@ -1,59 +0,0 @@ -#ifndef __ALT_IRQ_TABLE_H__ -#define __ALT_IRQ_TABLE_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * Definition of a table describing each interrupt handler. The index into - * the array is the interrupt id associated with the handler. - * - * When an interrupt occurs, the associated handler is called with - * the argument stored in the context member. - * - * The table is physically created in alt_irq_handler.c - */ -extern struct ALT_IRQ_HANDLER -{ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - void (*handler)(void*); -#else - void (*handler)(void*, alt_u32); -#endif - void *context; -} alt_irq[ALT_NIRQ]; - -#endif diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/inc/priv/alt_legacy_irq.h b/software/qsys_tutorial_lcd3_bsp/HAL/inc/priv/alt_legacy_irq.h deleted file mode 100644 index c7aec02..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/inc/priv/alt_legacy_irq.h +++ /dev/null @@ -1,158 +0,0 @@ -#ifndef __ALT_LEGACY_IRQ_H__ -#define __ALT_LEGACY_IRQ_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * This file provides prototypes and inline implementations of certain routines - * used by the legacy interrupt API. Do not include this in your driver or - * application source files, use "sys/alt_irq.h" instead to access the proper - * public API. - */ - -#include -#include "system.h" - -#ifndef NIOS2_EIC_PRESENT - -#include "nios2.h" -#include "alt_types.h" - -#include "sys/alt_irq.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * alt_irq_register() can be used to register an interrupt handler. If the - * function is succesful, then the requested interrupt will be enabled upon - * return. - */ -extern int alt_irq_register (alt_u32 id, - void* context, - alt_isr_func handler); - -/* - * alt_irq_disable() disables the individual interrupt indicated by "id". - */ -static ALT_INLINE int ALT_ALWAYS_INLINE alt_irq_disable (alt_u32 id) -{ - alt_irq_context status; - extern volatile alt_u32 alt_irq_active; - - status = alt_irq_disable_all (); - - alt_irq_active &= ~(1 << id); - NIOS2_WRITE_IENABLE (alt_irq_active); - - alt_irq_enable_all(status); - - return 0; -} - -/* - * alt_irq_enable() enables the individual interrupt indicated by "id". - */ -static ALT_INLINE int ALT_ALWAYS_INLINE alt_irq_enable (alt_u32 id) -{ - alt_irq_context status; - extern volatile alt_u32 alt_irq_active; - - status = alt_irq_disable_all (); - - alt_irq_active |= (1 << id); - NIOS2_WRITE_IENABLE (alt_irq_active); - - alt_irq_enable_all(status); - - return 0; -} - -#ifndef ALT_EXCEPTION_STACK -/* - * alt_irq_initerruptable() should only be called from within an ISR. It is used - * to allow higer priority interrupts to interrupt the current ISR. The input - * argument, "priority", is the priority, i.e. interrupt number of the current - * interrupt. - * - * If this function is called, then the ISR is required to make a call to - * alt_irq_non_interruptible() before returning. The input argument to - * alt_irq_non_interruptible() is the return value from alt_irq_interruptible(). - * - * Care should be taken when using this pair of functions, since they increasing - * the system overhead associated with interrupt handling. - * - * If you are using an exception stack then nested interrupts won't work, so - * these functions are not available in that case. - */ -static ALT_INLINE alt_u32 ALT_ALWAYS_INLINE alt_irq_interruptible (alt_u32 priority) -{ - extern volatile alt_u32 alt_priority_mask; - extern volatile alt_u32 alt_irq_active; - - alt_u32 old_priority; - - old_priority = alt_priority_mask; - alt_priority_mask = (1 << priority) - 1; - - NIOS2_WRITE_IENABLE (alt_irq_active & alt_priority_mask); - - NIOS2_WRITE_STATUS (1); - - return old_priority; -} - -/* - * See Comments above for alt_irq_interruptible() for an explanation of the use of this - * function. - */ -static ALT_INLINE void ALT_ALWAYS_INLINE alt_irq_non_interruptible (alt_u32 mask) -{ - extern volatile alt_u32 alt_priority_mask; - extern volatile alt_u32 alt_irq_active; - - NIOS2_WRITE_STATUS (0); - - alt_priority_mask = mask; - - NIOS2_WRITE_IENABLE (mask & alt_irq_active); -} -#endif /* ALT_EXCEPTION_STACK */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* NIOS2_EIC_PRESENT */ - -#endif /* __ALT_LEGACY_IRQ_H__ */ diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/inc/priv/alt_no_error.h b/software/qsys_tutorial_lcd3_bsp/HAL/inc/priv/alt_no_error.h deleted file mode 100644 index 6143fc9..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/inc/priv/alt_no_error.h +++ /dev/null @@ -1,77 +0,0 @@ -#ifndef __ALT_NO_ERROR_H__ -#define __ALT_NO_ERROR_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "alt_types.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * alt_no_error() is a dummy function used by alt_sem.h and alt_flag.h. It - * substitutes for functions that have a return code by creating a function - * that always returns zero. - * - * This may seem a little obscure, but what happens is that the compiler can - * then optomise away the call to this function, and any code written which - * handles the error path (i.e. non zero return values). - * - * This allows code to be written which correctly use the uC/OS-II semaphore - * and flag utilities, without the use of those utilities impacting on - * excutables built for a single threaded HAL environment. - * - * This function is considered to be part of the internal implementation of - * the HAL, and should not be called directly by application code or device - * drivers. It is not guaranteed to be preserved in future versions of the - * HAL. - */ - -static ALT_INLINE int ALT_ALWAYS_INLINE alt_no_error (void) -{ - return 0; -} - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_NO_ERROR_H__ */ diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/inc/priv/nios2_gmon_data.h b/software/qsys_tutorial_lcd3_bsp/HAL/inc/priv/nios2_gmon_data.h deleted file mode 100644 index 3f43f12..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/inc/priv/nios2_gmon_data.h +++ /dev/null @@ -1,47 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ -#ifndef NIOS2_GMON_DATA_H -#define NIOS2_GMON_DATA_H - -#define GMON_DATA_SIG 0 -#define GMON_DATA_WORDS 1 -#define GMON_DATA_PROFILE_DATA 2 -#define GMON_DATA_PROFILE_LOWPC 3 -#define GMON_DATA_PROFILE_HIGHPC 4 -#define GMON_DATA_PROFILE_BUCKET 5 -#define GMON_DATA_PROFILE_RATE 6 -#define GMON_DATA_MCOUNT_START 7 -#define GMON_DATA_MCOUNT_LIMIT 8 - -#define GMON_DATA_SIZE 9 - -extern unsigned int alt_gmon_data[GMON_DATA_SIZE]; - -#endif diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_alarm.h b/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_alarm.h deleted file mode 100644 index 68a2f5d..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_alarm.h +++ /dev/null @@ -1,126 +0,0 @@ -#ifndef __ALT_ALARM_H__ -#define __ALT_ALARM_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "alt_llist.h" -#include "alt_types.h" - -#include "priv/alt_alarm.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * "alt_alarm" is a structure type used by applications to register an alarm - * callback function. An instance of this type must be passed as an input - * argument to alt_alarm_start(). The user is not responsible for initialising - * the contents of the instance. This is done by alt_alarm_start(). - */ - -typedef struct alt_alarm_s alt_alarm; - -/* - * alt_alarm_start() can be called by an application/driver in order to register - * a function for periodic callback at the system clock frequency. Be aware that - * this callback is likely to occur in interrupt context. - */ - -extern int alt_alarm_start (alt_alarm* the_alarm, - alt_u32 nticks, - alt_u32 (*callback) (void* context), - void* context); - -/* - * alt_alarm_stop() is used to unregister a callback. Alternatively the callback - * can return zero to unregister. - */ - -extern void alt_alarm_stop (alt_alarm* the_alarm); - -/* - * Obtain the system clock rate in ticks/s. - */ - -static ALT_INLINE alt_u32 ALT_ALWAYS_INLINE alt_ticks_per_second (void) -{ - return _alt_tick_rate; -} - -/* - * alt_sysclk_init() is intended to be only used by the system clock driver - * in order to initialise the value of the clock frequency. - */ - -static ALT_INLINE int ALT_ALWAYS_INLINE alt_sysclk_init (alt_u32 nticks) -{ - if (! _alt_tick_rate) - { - _alt_tick_rate = nticks; - return 0; - } - else - { - return -1; - } -} - -/* - * alt_nticks() returns the elapsed number of system clock ticks since reset. - */ - -static ALT_INLINE alt_u32 ALT_ALWAYS_INLINE alt_nticks (void) -{ - return _alt_nticks; -} - -/* - * alt_tick() should only be called by the system clock driver. This is used - * to notify the system that the system timer period has expired. - */ - -extern void alt_tick (void); - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_ALARM_H__ */ diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_cache.h b/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_cache.h deleted file mode 100644 index c4d8db9..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_cache.h +++ /dev/null @@ -1,117 +0,0 @@ -#ifndef __ALT_CACHE_H__ -#define __ALT_CACHE_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003, 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include - -#include "alt_types.h" - -/* - * alt_cache.h defines the processor specific functions for manipulating the - * cache. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * alt_icache_flush() is called to flush the instruction cache for a memory - * region of length "len" bytes, starting at address "start". - */ - -extern void alt_icache_flush (void* start, alt_u32 len); - -/* - * alt_dcache_flush() is called to flush the data cache for a memory - * region of length "len" bytes, starting at address "start". - * Any dirty lines in the data cache are written back to memory. - */ - -extern void alt_dcache_flush (void* start, alt_u32 len); - -/* - * alt_dcache_flush() is called to flush the data cache for a memory - * region of length "len" bytes, starting at address "start". - * Any dirty lines in the data cache are NOT written back to memory. - */ - -extern void alt_dcache_flush_no_writeback (void* start, alt_u32 len); - -/* - * Flush the entire instruction cache. - */ - -extern void alt_icache_flush_all (void); - -/* - * Flush the entire data cache. - */ - -extern void alt_dcache_flush_all (void); - -/* - * Allocate a block of uncached memory. - */ - -extern volatile void* alt_uncached_malloc (size_t size); - -/* - * Free a block of uncached memory. - */ - -extern void alt_uncached_free (volatile void* ptr); - -/* - * Convert a pointer to a block of cached memory, into a block of - * uncached memory. - */ - -extern volatile void* alt_remap_uncached (void* ptr, alt_u32 len); - -/* - * Convert a pointer to a block of uncached memory, into a block of - * cached memory. - */ - -extern void* alt_remap_cached (volatile void* ptr, alt_u32 len); - -/* - * - */ - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_CACHE_H__ */ diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_debug.h b/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_debug.h deleted file mode 100644 index d9f9599..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_debug.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef __ALT_DEBUG_H__ -#define __ALT_DEBUG_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * The ALT_DEVUG_ASSERT macro can be used to generate a debugger break - * from within software. The break is generated if "condition" evaluates to - * false. - */ - -#define ALT_DEBUG_ASSERT(condition) if (!condition) \ -{ \ - __asm__ volatile ("break"); \ -} - -#endif /* __ALT_DEBUG_H__ */ diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_dev.h b/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_dev.h deleted file mode 100644 index 66c5e41..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_dev.h +++ /dev/null @@ -1,115 +0,0 @@ -#ifndef __ALT_DEV_H__ -#define __ALT_DEV_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "system.h" -#include "sys/alt_llist.h" -#include "priv/alt_dev_llist.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The value ALT_IRQ_NOT_CONNECTED is used to represent an unconnected - * interrupt line. It cannot evaluate to a valid interrupt number. - */ - -#define ALT_IRQ_NOT_CONNECTED (-1) - -typedef struct alt_dev_s alt_dev; - -struct stat; - -/* - * The file descriptor structure definition. - */ - -typedef struct alt_fd_s -{ - alt_dev* dev; - alt_u8* priv; - int fd_flags; -} alt_fd; - -/* - * The device structure definition. - */ - -struct alt_dev_s { - alt_llist llist; /* for internal use */ - const char* name; - int (*open) (alt_fd* fd, const char* name, int flags, int mode); - int (*close) (alt_fd* fd); - int (*read) (alt_fd* fd, char* ptr, int len); - int (*write) (alt_fd* fd, const char* ptr, int len); - int (*lseek) (alt_fd* fd, int ptr, int dir); - int (*fstat) (alt_fd* fd, struct stat* buf); - int (*ioctl) (alt_fd* fd, int req, void* arg); -}; - -/* - * Functions used to register device for access through the C standard - * library. - * - * The only difference between alt_dev_reg() and alt_fs_reg() is the - * interpretation that open() places on the device name. In the case of - * alt_dev_reg the device is assumed to be a particular character device, - * and so there must be an exact match in the name for open to succeed. - * In the case of alt_fs_reg() the name of the device is treated as the - * mount point for a directory, and so any call to open() where the name - * is the root of the device filename will succeed. - */ - -extern int alt_fs_reg (alt_dev* dev); - -static ALT_INLINE int alt_dev_reg (alt_dev* dev) -{ - extern alt_llist alt_dev_list; - - return alt_dev_llist_insert ((alt_dev_llist*) dev, &alt_dev_list); -} - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_DEV_H__ */ diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_dma.h b/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_dma.h deleted file mode 100644 index 9f9b2ff..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_dma.h +++ /dev/null @@ -1,226 +0,0 @@ -#ifndef __ALT_DMA_H__ -#define __ALT_DMA_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "sys/alt_dma_dev.h" -#include "alt_types.h" - -#include - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * This header contains the application side interface for accessing DMA - * resources. See alt_dma_dev.h for the dma device driver interface. - * - * The interface model treats a DMA transaction as being composed of two - * halves (read and write). - * - * The application can supply data for transmit using an "alt_dma_txchan" - * descriptor. Alternatively an "alt_dma_rxchan" descriptor can be used to - * receive data. - */ - -/* - * alt_dma_txchan_open() is used to obtain an "alt_dma_txchan" descriptor for - * a DMA transmit device. The name is the name of the associated physical - * device (e.g. "/dev/dma_0"). - * - * The return value will be NULL on failure, and non-NULL otherwise. - */ - -extern alt_dma_txchan alt_dma_txchan_open (const char* name); - -/* - * alt_dma_txchan_close() is provided so that an application can notify the - * system that it has finished with a given DMA transmit channel. This is only - * provided for completness. - */ - -static ALT_INLINE int alt_dma_txchan_close (alt_dma_txchan dma) -{ - return 0; -} - -/* - * alt_dma_txchan_send() posts a transmit request to a DMA transmit channel. - * The input arguments are: - * - * dma: the channel to use. - * from: a pointer to the start of the data to send. - * length: the length of the data to send in bytes. - * done: callback function that will be called once the data has been sent. - * handle: opaque value passed to "done". - * - * The return value will be negative if the request cannot be posted, and - * zero otherwise. - */ - -static ALT_INLINE int alt_dma_txchan_send (alt_dma_txchan dma, - const void* from, - alt_u32 length, - alt_txchan_done* done, - void* handle) -{ - return dma ? dma->dma_send (dma, - from, - length, - done, - handle) : -ENODEV; -} - -/* - * alt_dma_txchan_space() returns the number of tranmit requests that can be - * posted to the specified DMA transmit channel. - * - * A negative value indicates that the value could not be determined. - */ - -static ALT_INLINE int alt_dma_txchan_space (alt_dma_txchan dma) -{ - return dma ? dma->space (dma) : -ENODEV; -} - -/* - * alt_dma_txchan_ioctl() can be used to perform device specific I/O - * operations on the indicated DMA transmit channel. For example some drivers - * support options to control the width of the transfer operations. See - * alt_dma_dev.h for the list of generic requests. - * - * A negative return value indicates failure, otherwise the interpretation - * of the return value is request specific. - */ - -static ALT_INLINE int alt_dma_txchan_ioctl (alt_dma_txchan dma, - int req, - void* arg) -{ - return dma ? dma->ioctl (dma, req, arg) : -ENODEV; -} - -/* - * alt_dma_rxchan_open() is used to obtain an "alt_dma_rxchan" descriptor for - * a DMA receive channel. The name is the name of the associated physical - * device (e.g. "/dev/dma_0"). - * - * The return value will be NULL on failure, and non-NULL otherwise. - */ - -extern alt_dma_rxchan alt_dma_rxchan_open (const char* dev); - -/* - * alt_dma_rxchan_close() is provided so that an application can notify the - * system that it has finished with a given DMA receive channel. This is only - * provided for completness. - */ - -static ALT_INLINE int alt_dma_rxchan_close (alt_dma_rxchan dma) -{ - return 0; -} - -/* - * - */ - -/* - * alt_dma_rxchan_prepare() posts a receive request to a DMA receive channel. - * - * The input arguments are: - * - * dma: the channel to use. - * data: a pointer to the location that data is to be received to. - * len: the maximum length of the data to receive. - * done: callback function that will be called once the data has been - * received. - * handle: opaque value passed to "done". - * - * The return value will be negative if the request cannot be posted, and - * zero otherwise. - */ - -static ALT_INLINE int alt_dma_rxchan_prepare (alt_dma_rxchan dma, - void* data, - alt_u32 len, - alt_rxchan_done* done, - void* handle) -{ - return dma ? dma->prepare (dma, data, len, done, handle) : -ENODEV; -} - -/* - * alt_dma_rxchan_ioctl() can be used to perform device specific I/O - * operations on the indicated DMA receive channel. For example some drivers - * support options to control the width of the transfer operations. See - * alt_dma_dev.h for the list of generic requests. - * - * A negative return value indicates failure, otherwise the interpretation - * of the return value is request specific. - */ - -static ALT_INLINE int alt_dma_rxchan_ioctl (alt_dma_rxchan dma, - int req, - void* arg) -{ - return dma ? dma->ioctl (dma, req, arg) : -ENODEV; -} - -/* - * alt_dma_rxchan_depth() returns the depth of the receive FIFO used to store - * receive requests. - */ - -static ALT_INLINE alt_u32 alt_dma_rxchan_depth(alt_dma_rxchan dma) -{ - return dma->depth; -} - -/* - * - */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_DMA_H__ */ diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_dma_dev.h b/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_dma_dev.h deleted file mode 100644 index 832463d..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_dma_dev.h +++ /dev/null @@ -1,200 +0,0 @@ -#ifndef __ALT_DMA_DEV_H__ -#define __ALT_DMA_DEV_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "priv/alt_dev_llist.h" - -#include "alt_types.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * This header contains the device driver interface for accessing DMA - * resources. See alt_dma.h for the DMA application side interface. - * - * The interface model treats a DMA transaction as being composed of two - * halves (read and write). - * - * An "alt_dma_txchan_dev" is used to describe the device associated with a - * DMA transmit channel. An "alt_dma_rxchan_dev" is used to describe the - * device associated with a DMA receive channel. - */ - -/* - * List of generic ioctl requests that may be supported by a DMA device. - * - * ALT_DMA_RX_ONLY_ON: This causes a DMA channel to operate in a mode - * where only the receiver is under software control. - * The other side reads continously from a single - * location. The address to read is the argument to - * this request. - * ALT_DMA_RX_ONLY_OFF: Return to the default mode where both the receive - * and transmit sides of the DMA can be under software - * control. - * ALT_DMA_TX_ONLY_ON: This causes a DMA channel to operate in a mode - * where only the transmitter is under software control. - * The other side writes continously to a single - * location. The address to write to is the argument to - * this request. - * ALT_DMA_TX_ONLY_OFF: Return to the default mode where both the receive - * and transmit sides of the DMA can be under software - * control. - * ALT_DMA_SET_MODE_8: Transfer data in units of 8 bits. - * ALT_DMA_SET_MODE_16: Transfer data in units of 16 bits. - * ALT_DMA_SET_MODE_32: Transfer data in units of 32 bits. - * ALT_DMA_SET_MODE_64: Transfer data in units of 64 bits. - * ALT_DMA_SET_MODE_128: Transfer data in units of 128 bits. - * ALT_DMA_GET_MODE: Get the current transfer mode. - * - * The use of the macros: ALT_DMA_TX_STREAM_ON, ALT_DMA_TX_STREAM_OFF - * ALT_DMA_RX_STREAM_OFF and ALT_DMA_RX_STREAM_ON are depreciated. You should - * instead use the macros: ALT_DMA_RX_ONLY_ON, ALT_DMA_RX_ONLY_OFF, - * ALT_DMA_TX_ONLY_ON and ALT_DMA_TX_ONLY_OFF. - */ - -#define ALT_DMA_TX_STREAM_ON (0x1) -#define ALT_DMA_TX_STREAM_OFF (0x2) -#define ALT_DMA_RX_STREAM_ON (0x3) -#define ALT_DMA_RX_STREAM_OFF (0x4) -#define ALT_DMA_SET_MODE_8 (0x5) -#define ALT_DMA_SET_MODE_16 (0x6) -#define ALT_DMA_SET_MODE_32 (0x7) -#define ALT_DMA_SET_MODE_64 (0x8) -#define ALT_DMA_SET_MODE_128 (0x9) -#define ALT_DMA_GET_MODE (0xa) - -#define ALT_DMA_RX_ONLY_ON ALT_DMA_TX_STREAM_ON -#define ALT_DMA_RX_ONLY_OFF ALT_DMA_TX_STREAM_OFF -#define ALT_DMA_TX_ONLY_ON ALT_DMA_RX_STREAM_ON -#define ALT_DMA_TX_ONLY_OFF ALT_DMA_RX_STREAM_OFF - -/* - * - */ - -typedef struct alt_dma_txchan_dev_s alt_dma_txchan_dev; -typedef struct alt_dma_rxchan_dev_s alt_dma_rxchan_dev; - -typedef alt_dma_txchan_dev* alt_dma_txchan; -typedef alt_dma_rxchan_dev* alt_dma_rxchan; - -typedef void (alt_txchan_done)(void* handle); -typedef void (alt_rxchan_done)(void* handle, void* data); - -/* - * devices that provide a DMA transmit channel are required to provide an - * instance of the "alt_dma_txchan_dev" structure. - */ - -struct alt_dma_txchan_dev_s { - alt_llist llist; /* for internal use */ - const char* name; /* name of the device instance - * (e.g. "/dev/dma_0"). - */ - int (*space) (alt_dma_txchan dma); /* returns the maximum number of - * transmit requests that can be posted - */ - int (*dma_send) (alt_dma_txchan dma, - const void* from, - alt_u32 len, - alt_txchan_done* done, - void* handle); /* post a transmit request */ - int (*ioctl) (alt_dma_txchan dma, int req, void* arg); /* perform device - * specific I/O control. - */ -}; - -/* - * devices that provide a DMA receive channel are required to provide an - * instance of the "alt_dma_rxchan_dev" structure. - */ - -struct alt_dma_rxchan_dev_s { - alt_llist list; /* for internal use */ - const char* name; /* name of the device instance - * (e.g. "/dev/dma_0"). - */ - alt_u32 depth; /* maximum number of receive requests that - * can be posted. - */ - int (*prepare) (alt_dma_rxchan dma, - void* data, - alt_u32 len, - alt_rxchan_done* done, - void* handle); /* post a receive request */ - int (*ioctl) (alt_dma_rxchan dma, int req, void* arg); /* perform device - * specific I/O control. - */ -}; - -/* - * Register a DMA transmit channel with the system. - */ - -static ALT_INLINE int alt_dma_txchan_reg (alt_dma_txchan_dev* dev) -{ - extern alt_llist alt_dma_txchan_list; - - return alt_dev_llist_insert((alt_dev_llist*) dev, &alt_dma_txchan_list); -} - -/* - * Register a DMA receive channel with the system. - */ - -static ALT_INLINE int alt_dma_rxchan_reg (alt_dma_rxchan_dev* dev) -{ - extern alt_llist alt_dma_rxchan_list; - - return alt_dev_llist_insert((alt_dev_llist*) dev, &alt_dma_rxchan_list); -} - -/* - * - */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_DMA_DEV_H__ */ diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_driver.h b/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_driver.h deleted file mode 100644 index eb0f23b..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_driver.h +++ /dev/null @@ -1,168 +0,0 @@ -#ifndef __ALT_DRIVER_H__ -#define __ALT_DRIVER_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/* - * Macros used to access a driver without HAL file descriptors. - */ - -/* - * ALT_MODULE_CLASS - * - * This macro returns the module class name for the specified module instance. - * It uses information in the system.h file. - * Neither the instance name or class name are quoted (so that they can - * be used with other pre-processor macros). - * - * Example: - * Assume the design has an instance of an altera_avalon_uart called uart1. - * Calling ALT_MODULE_CLASS(uart1) returns altera_avalon_uart. - */ - -#define ALT_MODULE_CLASS(instance) ALT_MODULE_CLASS_ ## instance - - -/* - * ALT_DRIVER_FUNC_NAME - * - * --> instance Instance name. - * --> func Function name. - * - * This macro returns the device driver function name of the specified - * module instance for the specified function name. - * - * Example: - * Assume the design has an instance of an altera_avalon_uart called uart1. - * Calling ALT_DRIVER_FUNC_NAME(uart1, write) returns - * altera_avalon_uart_write. - */ - -#define ALT_DRIVER_FUNC_NAME(instance, func) \ - ALT_DRIVER_FUNC_NAME1(ALT_MODULE_CLASS(instance), func) -#define ALT_DRIVER_FUNC_NAME1(module_class, func) \ - ALT_DRIVER_FUNC_NAME2(module_class, func) -#define ALT_DRIVER_FUNC_NAME2(module_class, func) \ - module_class ## _ ## func - -/* - * ALT_DRIVER_STATE_STRUCT - * - * --> instance Instance name. - * - * This macro returns the device driver state type name of the specified - * module instance. - * - * Example: - * Assume the design has an instance of an altera_avalon_uart called uart1. - * Calling ALT_DRIVER_STATE_STRUCT(uart1) returns: - * struct altera_avalon_uart_state_s - * - * Note that the ALT_DRIVER_FUNC_NAME macro is used even though "state" isn't - * really a function but it does match the required naming convention. - */ -#define ALT_DRIVER_STATE_STRUCT(instance) \ - struct ALT_DRIVER_FUNC_NAME(instance, state_s) - -/* - * ALT_DRIVER_STATE - * - * --> instance Instance name. - * - * This macro returns the device driver state name of the specified - * module instance. - * - * Example: - * Assume the design has an instance of an altera_avalon_uart called uart1. - * Calling ALT_DRIVER_STATE(uart1) returns uart1. - */ -#define ALT_DRIVER_STATE(instance) instance - -/* - * ALT_DRIVER_WRITE - * - * --> instance Instance name. - * --> buffer Write buffer. - * --> len Length of write buffer data. - * --> flags Control flags (e.g. O_NONBLOCK) - * - * This macro calls the "write" function of the specified driver instance. - */ - -#define ALT_DRIVER_WRITE_EXTERNS(instance) \ - extern ALT_DRIVER_STATE_STRUCT(instance) ALT_DRIVER_STATE(instance); \ - extern int ALT_DRIVER_FUNC_NAME(instance, write) \ - (ALT_DRIVER_STATE_STRUCT(instance) *, const char *, int, int); - -#define ALT_DRIVER_WRITE(instance, buffer, len, flags) \ - ALT_DRIVER_FUNC_NAME(instance, write)(&ALT_DRIVER_STATE(instance), buffer, len, flags) - - -/* - * ALT_DRIVER_READ - * - * --> instance Instance name. - * <-- buffer Read buffer. - * --> len Length of read buffer. - * --> flags Control flags (e.g. O_NONBLOCK) - * - * This macro calls the "read" function of the specified driver instance. - */ - -#define ALT_DRIVER_READ_EXTERNS(instance) \ - extern ALT_DRIVER_STATE_STRUCT(instance) ALT_DRIVER_STATE(instance); \ - extern int ALT_DRIVER_FUNC_NAME(instance, read) \ - (ALT_DRIVER_STATE_STRUCT(instance) *, const char *, int, int); - -#define ALT_DRIVER_READ(instance, buffer, len, flags) \ - ALT_DRIVER_FUNC_NAME(instance, read)(&ALT_DRIVER_STATE(instance), buffer, len, flags) - -/* - * ALT_DRIVER_IOCTL - * - * --> instance Instance name. - * --> req ioctl request (e.g. TIOCSTIMEOUT) - * --> arg Optional argument (void*) - * - * This macro calls the "ioctl" function of the specified driver instance - */ - -#define ALT_DRIVER_IOCTL_EXTERNS(instance) \ - extern ALT_DRIVER_STATE_STRUCT(instance) ALT_DRIVER_STATE(instance); \ - extern int ALT_DRIVER_FUNC_NAME(instance, ioctl) \ - (ALT_DRIVER_STATE_STRUCT(instance) *, int, void*); - -#define ALT_DRIVER_IOCTL(instance, req, arg) \ - ALT_DRIVER_FUNC_NAME(instance, ioctl)(&ALT_DRIVER_STATE(instance), req, arg) - -#endif /* __ALT_DRIVER_H__ */ diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_errno.h b/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_errno.h deleted file mode 100644 index 4d3e50f..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_errno.h +++ /dev/null @@ -1,87 +0,0 @@ -#ifndef __ALT_ERRNO_H__ -#define __ALT_ERRNO_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * errno is defined in so that it uses the thread local version - * stored in the location pointed to by "_impure_ptr". This means that the - * accesses to errno within the HAL library can cause the entirety of - * of the structure pointed to by "_impure_ptr" to be added to the - * users application. This can be undesirable in very small footprint systems. - * - * To avoid this happening, the HAL uses the macro ALT_ERRNO, defined below, - * to access errno, rather than accessing it directly. This macro will only - * use the thread local version if some other code has already caused it to be - * included into the system, otherwise it will use the global errno value. - * - * This causes a slight increases in code size where errno is accessed, but - * can lead to significant overall benefits in very small systems. The - * increase is inconsequential when compared to the size of the structure - * pointed to by _impure_ptr. - * - * Note that this macro accesses __errno() using an externally declared - * function pointer (alt_errno). This is done so that the function call uses the - * subroutine call instruction via a register rather than an immediate address. - * This is important in the case that the code has been linked for a high - * address, but __errno() is not being used. In this case the weak linkage - * would have resulted in the instruction: "call 0" which would fail to link. - */ - -extern int* (*alt_errno) (void); - -/* Must define this so that values such as EBADFD are defined in errno.h. */ -#define __LINUX_ERRNO_EXTENSIONS__ - -#include - -#include "alt_types.h" - -#undef errno - -extern int errno; - -static ALT_INLINE int* alt_get_errno(void) -{ - return ((alt_errno) ? alt_errno() : &errno); -} - -#define ALT_ERRNO *alt_get_errno() - -#endif /* __ALT_ERRNO_H__ */ diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_exceptions.h b/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_exceptions.h deleted file mode 100644 index 3576a52..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_exceptions.h +++ /dev/null @@ -1,127 +0,0 @@ -#ifndef __ALT_EXCEPTIONS_H__ -#define __ALT_EXCEPTIONS_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2008 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ -#include "alt_types.h" -#include "system.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * This file defines instruction-generated exception handling and registry - * API, exception type enumeration, and handler return value enumeration for - * Nios II. - */ - -/* - * The following enumeration describes the value in the CPU EXCEPTION - * register CAUSE bit field. Not all exception types will cause the - * processor to go to the exception vector; these are provided for - * reference. - */ -enum alt_exception_cause_e { - /* Exeption causes that will cause jump to exception vector */ - NIOS2_EXCEPTION_INTERRUPT = 2, - NIOS2_EXCEPTION_TRAP_INST = 3, - NIOS2_EXCEPTION_UNIMPLEMENTED_INST = 4, - NIOS2_EXCEPTION_ILLEGAL_INST = 5, - NIOS2_EXCEPTION_MISALIGNED_DATA_ADDR = 6, - NIOS2_EXCEPTION_MISALIGNED_TARGET_PC = 7, - NIOS2_EXCEPTION_DIVISION_ERROR = 8, - NIOS2_EXCEPTION_SUPERVISOR_ONLY_INST_ADDR = 9, - NIOS2_EXCEPTION_SUPERVISOR_ONLY_INST = 10, - NIOS2_EXCEPTION_SUPERVISOR_ONLY_DATA_ADDR = 11, - NIOS2_EXCEPTION_TLB_MISS = 12, - NIOS2_EXCEPTION_TLB_EXECUTE_PERM_VIOLATION = 13, - NIOS2_EXCEPTION_MPU_INST_REGION_VIOLATION = 16, - - /* Exception causes that will NOT cause a jump to exception vector */ - NIOS2_EXCEPTION_RESET = 0, - NIOS2_EXCEPTION_CPU_ONLY_RESET_REQUEST = 1, - NIOS2_EXCEPTION_TLB_READ_PERM_VIOLATION = 14, - NIOS2_EXCEPTION_TLB_WRITE_PERM_VIOLATION = 15, - NIOS2_EXCEPTION_MPU_DATA_REGION_VIOLATION = 17, - /* - * This value is passed to an exception handler's cause argument if - * "extra exceptions" information (EXECPTION) register is not - * present in the processor hardware configuration. - */ - NIOS2_EXCEPTION_CAUSE_NOT_PRESENT = -1 -}; -typedef enum alt_exception_cause_e alt_exception_cause; - -/* - * These define valid return values for a user-defined instruction-generated - * exception handler. The handler should return one of these to indicate - * whether to re-issue the instruction that triggered the exception, or to - * skip it. - */ -enum alt_exception_result_e { - NIOS2_EXCEPTION_RETURN_REISSUE_INST = 0, - NIOS2_EXCEPTION_RETURN_SKIP_INST = 1 -}; -typedef enum alt_exception_result_e alt_exception_result; - -/* - * alt_instruction_exception_register() can be used to register an exception - * handler for instruction-generated exceptions that are not handled by the - * built-in exception handler (i.e. for interrupts). - * - * The registry API is optionally enabled through the "Enable - * Instruction-related Exception API" HAL BSP setting, which will - * define the macro below. - */ -#ifdef ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API -void alt_instruction_exception_register ( - alt_exception_result (*exception_handler)( - alt_exception_cause cause, - alt_u32 exception_pc, - alt_u32 bad_addr) ); -#endif /*ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API */ - -/* - * alt_exception_cause_generated_bad_addr() indicates whether a particular - * exception cause value was from an exception-type that generated a valid - * address in the BADADDR register. The contents of BADADDR is passed to - * a user-registered exception handler in all cases, whether valid or not. - * This routine should be called to validate the bad_addr argument to - * your exception handler. - */ -int alt_exception_cause_generated_bad_addr(alt_exception_cause cause); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_EXCEPTIONS_H__ */ diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_flash.h b/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_flash.h deleted file mode 100644 index 527328d..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_flash.h +++ /dev/null @@ -1,166 +0,0 @@ -#ifndef __ALT_FLASH_H__ -#define __ALT_FLASH_H__ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/****************************************************************************** -* * -* Alt_flash.h - User interface for flash code * -* * -* Use this interface to avoid being exposed to the internals of the device * -* driver architecture. If you chose to use the flash driver internal * -* structures we don't guarantee not to change them * -* * -* Author PRR * -* * -******************************************************************************/ - - - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#include "alt_types.h" -#include "alt_flash_types.h" -#include "alt_flash_dev.h" -#include "sys/alt_cache.h" - -alt_flash_fd* alt_flash_open_dev(const char* name); -void alt_flash_close_dev(alt_flash_fd* fd ); - -/* - * alt_write_flash - * - * Program a buffer into flash. - * - * This routine erases all the affected erase blocks (if necessary) - * and then programs the data. However it does not read the data out first - * and preserve and none overwritten data, because this would require very - * large buffers on the target. If you need - * that functionality use the functions below. - */ -static __inline__ int __attribute__ ((always_inline)) alt_write_flash( - alt_flash_fd* fd, - int offset, - const void* src_addr, - int length ) -{ - return fd->write( fd, offset, src_addr, length ); -} - -/* - * alt_read_flash - * - * Read a block of flash for most flashes this is just memcpy - * it's here for completeness in case we need it for some serial flash device - * - */ -static __inline__ int __attribute__ ((always_inline)) alt_read_flash( - alt_flash_fd* fd, int offset, - void* dest_addr, int length ) -{ - return fd->read( fd, offset, dest_addr, length ); -} - -/* - * alt_get_flash_info - * - * Return the information on the flash sectors. - * - */ -static __inline__ int __attribute__ ((always_inline)) alt_get_flash_info( - alt_flash_fd* fd, flash_region** info, - int* number_of_regions) -{ - return fd->get_info( fd, info, number_of_regions); -} - -/* - * alt_erase_flash_block - * - * Erase a particular erase block, pass in the offset to the start of - * the block and it's size - */ -static __inline__ int __attribute__ ((always_inline)) alt_erase_flash_block( - alt_flash_fd* fd, int offset, int length) -{ - int ret_code; - ret_code = fd->erase_block( fd, offset ); - - if(!ret_code) - alt_dcache_flush((alt_u8*)fd->base_addr + offset, length); - - return ret_code; -} - -/* - * alt_write_flash_block - * - * Write a particular flash block, block_offset is the offset - * (from the base of flash) to start of the block - * data_offset is the offset (from the base of flash) - * where you wish to start programming - * - * NB this function DOES NOT check that you are only writing a single - * block of data as that would slow down this function. - * - * Use alt_write_flash if you want that level of error checking. - */ - -static __inline__ int __attribute__ ((always_inline)) alt_write_flash_block( - alt_flash_fd* fd, int block_offset, - int data_offset, - const void *data, int length) -{ - - int ret_code; - ret_code = fd->write_block( fd, block_offset, data_offset, data, length ); - - if(!ret_code) - alt_dcache_flush((alt_u8*)fd->base_addr + data_offset, length); - - return ret_code; -} - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_FLASH_H__ */ diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_flash_dev.h b/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_flash_dev.h deleted file mode 100644 index 8bab601..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_flash_dev.h +++ /dev/null @@ -1,98 +0,0 @@ -#ifndef __ALT_FLASH_DEV_H__ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/****************************************************************************** -* * -* Alt_flash_dev.h - Generic Flash device interfaces * -* * -* Author PRR * -* * -******************************************************************************/ -#define __ALT_FLASH_DEV_H__ - -#include "alt_flash_types.h" -#include "sys/alt_llist.h" -#include "priv/alt_dev_llist.h" - -#include "alt_types.h" - -typedef struct alt_flash_dev alt_flash_dev; -typedef alt_flash_dev alt_flash_fd; - -static ALT_INLINE int alt_flash_device_register( alt_flash_fd* fd) -{ - extern alt_llist alt_flash_dev_list; - - return alt_dev_llist_insert ((alt_dev_llist*) fd, &alt_flash_dev_list); -} - -typedef alt_flash_dev* (*alt_flash_open)(alt_flash_dev* flash, - const char* name ); -typedef int (*alt_flash_close)(alt_flash_dev* flash_info); - -typedef int (*alt_flash_write)( alt_flash_dev* flash, int offset, - const void* src_addr, int length ); - -typedef int (*alt_flash_get_flash_info)( alt_flash_dev* flash, flash_region** info, - int* number_of_regions); -typedef int (*alt_flash_write_block)( alt_flash_dev* flash, int block_offset, - int data_offset, const void* data, - int length); -typedef int (*alt_flash_erase_block)( alt_flash_dev* flash, int offset); -typedef int (*alt_flash_read)(alt_flash_dev* flash, int offset, - void* dest_addr, int length ); - -struct alt_flash_dev -{ - alt_llist llist; - const char* name; - alt_flash_open open; - alt_flash_close close; - alt_flash_write write; - alt_flash_read read; - alt_flash_get_flash_info get_info; - alt_flash_erase_block erase_block; - alt_flash_write_block write_block; - void* base_addr; - int length; - int number_of_regions; - flash_region region_info[ALT_MAX_NUMBER_OF_FLASH_REGIONS]; -}; - -#endif /* __ALT_FLASH_DEV_H__ */ diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_flash_types.h b/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_flash_types.h deleted file mode 100644 index 884cbf8..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_flash_types.h +++ /dev/null @@ -1,64 +0,0 @@ -#ifndef __ALT_FLASH_TYPES_H__ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/****************************************************************************** -* * -* Alt_flash_types.h - Some generic types and defines used by the flash code * -* * -* Author PRR * -* * -******************************************************************************/ -#define __ALT_FLASH_TYPES_H__ - -#ifndef ALT_MAX_NUMBER_OF_FLASH_REGIONS -#define ALT_MAX_NUMBER_OF_FLASH_REGIONS 8 -#endif /* ALT_MAX_NUMBER_OF_FLASH_REGIONS */ - -/* - * Description of a single Erase region - */ -typedef struct flash_region -{ - int offset; - int region_size; - int number_of_blocks; - int block_size; -}flash_region; - -#endif /* __ALT_FLASH_TYPES_H__ */ diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_irq.h b/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_irq.h deleted file mode 100644 index 6666e52..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_irq.h +++ /dev/null @@ -1,245 +0,0 @@ -#ifndef __ALT_IRQ_H__ -#define __ALT_IRQ_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * alt_irq.h is the Nios II specific implementation of the interrupt controller - * interface. - * - * Nios II includes optional support for an external interrupt controller. - * When an external controller is present, the "Enhanced" interrupt API - * must be used to manage individual interrupts. The enhanced API also - * supports the processor's internal interrupt controller. Certain API - * members are accessible from either the "legacy" or "enhanced" interrpt - * API. - * - * Regardless of which API is in use, this file should be included by - * application code and device drivers that register ISRs or manage interrpts. - */ -#include - -#include "nios2.h" -#include "alt_types.h" -#include "system.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * Macros used by alt_irq_enabled - */ -#define ALT_IRQ_ENABLED 1 -#define ALT_IRQ_DISABLED 0 - -/* - * Number of available interrupts in internal interrupt controller. - */ -#define ALT_NIRQ NIOS2_NIRQ - -/* - * Used by alt_irq_disable_all() and alt_irq_enable_all(). - */ -typedef int alt_irq_context; - -/* ISR Prototype */ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT -typedef void (*alt_isr_func)(void* isr_context); -#else -typedef void (*alt_isr_func)(void* isr_context, alt_u32 id); -#endif - -/* - * The following protypes and routines are supported by both - * the enhanced and legacy interrupt APIs - */ - -/* - * alt_irq_enabled can be called to determine if the processor's global - * interrupt enable is asserted. The return value is zero if interrupts - * are disabled, and non-zero otherwise. - * - * Whether the internal or external interrupt controller is present, - * individual interrupts may still be disabled. Use the other API to query - * a specific interrupt. - */ -static ALT_INLINE int ALT_ALWAYS_INLINE alt_irq_enabled (void) -{ - int status; - - NIOS2_READ_STATUS (status); - - return status & NIOS2_STATUS_PIE_MSK; -} - -/* - * alt_irq_disable_all() - * - * This routine inhibits all interrupts by negating the status register PIE - * bit. It returns the previous contents of the CPU status register (IRQ - * context) which can be used to restore the status register PIE bit to its - * state before this routine was called. - */ -static ALT_INLINE alt_irq_context ALT_ALWAYS_INLINE - alt_irq_disable_all (void) -{ - alt_irq_context context; - - NIOS2_READ_STATUS (context); - - NIOS2_WRITE_STATUS (context & ~NIOS2_STATUS_PIE_MSK); - - return context; -} - -/* - * alt_irq_enable_all() - * - * Enable all interrupts that were previously disabled by alt_irq_disable_all() - * - * This routine accepts a context to restore the CPU status register PIE bit - * to the state prior to a call to alt_irq_disable_all(). - - * In the case of nested calls to alt_irq_disable_all()/alt_irq_enable_all(), - * this means that alt_irq_enable_all() does not necessarily re-enable - * interrupts. - * - * This routine will perform a read-modify-write sequence to restore only - * status.PIE if the processor is configured with options that add additional - * writeable status register bits. These include the MMU, MPU, the enhanced - * interrupt controller port, and shadow registers. Otherwise, as a performance - * enhancement, status is overwritten with the prior context. - */ -static ALT_INLINE void ALT_ALWAYS_INLINE - alt_irq_enable_all (alt_irq_context context) -{ -#if (NIOS2_NUM_OF_SHADOW_REG_SETS > 0) || (defined NIOS2_EIC_PRESENT) || \ - (defined NIOS2_MMU_PRESENT) || (defined NIOS2_MPU_PRESENT) - alt_irq_context status; - - NIOS2_READ_STATUS (status); - - status &= ~NIOS2_STATUS_PIE_MSK; - status |= (context & NIOS2_STATUS_PIE_MSK); - - NIOS2_WRITE_STATUS (status); -#else - NIOS2_WRITE_STATUS (context); -#endif -} - -/* - * The function alt_irq_init() is defined within the auto-generated file - * alt_sys_init.c. This function calls the initilization macros for all - * interrupt controllers in the system at config time, before any other - * non-interrupt controller driver is initialized. - * - * The "base" parameter is ignored and only present for backwards-compatibility. - * It is recommended that NULL is passed in for the "base" parameter. - */ -extern void alt_irq_init (const void* base); - -/* - * alt_irq_cpu_enable_interrupts() enables the CPU to start taking interrupts. - */ -static ALT_INLINE void ALT_ALWAYS_INLINE - alt_irq_cpu_enable_interrupts () -{ - NIOS2_WRITE_STATUS(NIOS2_STATUS_PIE_MSK -#if defined(NIOS2_EIC_PRESENT) && (NIOS2_NUM_OF_SHADOW_REG_SETS > 0) - | NIOS2_STATUS_RSIE_MSK -#endif - ); -} - - -/* - * Prototypes for the enhanced interrupt API. - */ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT -/* - * alt_ic_isr_register() can be used to register an interrupt handler. If the - * function is succesful, then the requested interrupt will be enabled upon - * return. - */ -extern int alt_ic_isr_register(alt_u32 ic_id, - alt_u32 irq, - alt_isr_func isr, - void *isr_context, - void *flags); - -/* - * alt_ic_irq_enable() and alt_ic_irq_disable() enable/disable a specific - * interrupt by using IRQ port and interrupt controller instance. - */ -int alt_ic_irq_enable (alt_u32 ic_id, alt_u32 irq); -int alt_ic_irq_disable(alt_u32 ic_id, alt_u32 irq); - - /* - * alt_ic_irq_enabled() indicates whether a specific interrupt, as - * specified by IRQ port and interrupt controller instance is enabled. - */ -alt_u32 alt_ic_irq_enabled(alt_u32 ic_id, alt_u32 irq); - -#else -/* - * Prototypes for the legacy interrupt API. - */ -#include "priv/alt_legacy_irq.h" -#endif - - -/* - * alt_irq_pending() returns a bit list of the current pending interrupts. - * This is used by alt_irq_handler() to determine which registered interrupt - * handlers should be called. - * - * This routine is only available for the Nios II internal interrupt - * controller. - */ -#ifndef NIOS2_EIC_PRESENT -static ALT_INLINE alt_u32 ALT_ALWAYS_INLINE alt_irq_pending (void) -{ - alt_u32 active; - - NIOS2_READ_IPENDING (active); - - return active; -} -#endif - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_IRQ_H__ */ diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_irq_entry.h b/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_irq_entry.h deleted file mode 100644 index e2008d9..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_irq_entry.h +++ /dev/null @@ -1,39 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * This file pulls in the IRQ entry assembler and C code, which is only - * required if there are any interruptes in the system. - */ - -__asm__( "\n\t.globl alt_irq_entry" ); - -__asm__( "\n\t.globl alt_irq_handler" ); - diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_license_reminder_ucosii.h b/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_license_reminder_ucosii.h deleted file mode 100644 index 2fe649c..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_license_reminder_ucosii.h +++ /dev/null @@ -1,77 +0,0 @@ -#ifndef __ALT_LICENSE_REMINDER_UCOSII_H__ -#define __ALT_LICENSE_REMINDER_UCOSII_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include - -#define ALT_LICENSE_REMINDER_UCOSII_STRING \ - "============== Software License Reminder ===============\n" \ - "\n" \ - "uC/OS-II is provided in source form for FREE evaluation,\n" \ - "for educational use, or for peaceful research. If you\n" \ - "plan on using uC/OS-II in a commercial product you need\n" \ - "to contact Micrium to properly license its use in your\n" \ - "product. Micrium provides ALL the source code on the\n" \ - "Altera distribution for your convenience and to help you\n" \ - "experience uC/OS-II. The fact that the source is provided\n" \ - "does NOT mean that you can use it without paying a\n" \ - "licensing fee. Please help us continue to provide the\n" \ - "Embedded community with the finest software available.\n" \ - "Your honesty is greatly appreciated.\n" \ - "\n" \ - "Please contact:\n" \ - "\n" \ - "M I C R I U M\n" \ - "949 Crestview Circle\n" \ - "Weston, FL 33327-1848\n" \ - "U.S.A.\n" \ - "\n" \ - "Phone : +1 954 217 2036\n" \ - "FAX : +1 954 217 2037\n" \ - "WEB : www.micrium.com\n" \ - "E-mail: Sales@Micrium.com\n" \ - "\n" \ - "========================================================\n" - -#define alt_license_reminder_ucosii() puts(ALT_LICENSE_REMINDER_UCOSII_STRING) - - -#endif /* __ALT_LICENSE_REMINDER_UCOSII_H__ */ - diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_llist.h b/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_llist.h deleted file mode 100644 index 46f81ce..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_llist.h +++ /dev/null @@ -1,123 +0,0 @@ -#ifndef __ALT_LIST_H__ -#define __ALT_LIST_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "alt_types.h" - -/* - * alt_llist.h defines structures and functions for use in manipulating linked - * lists. A list is considered to be constructed from a chain of objects of - * type alt_llist, with one object being defined to be the head element. - * - * A list is considered to be empty if it only contains the head element. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * alt_llist is the structure used to represent an element within a linked - * list. - */ - -typedef struct alt_llist_s alt_llist; - -struct alt_llist_s { - alt_llist* next; /* Pointer to the next element in the list. */ - alt_llist* previous; /* Pointer to the previous element in the list. */ -}; - -/* - * ALT_LLIST_HEAD is a macro that can be used to create the head of a new - * linked list. This is named "head". The head element is initialised to - * represent an empty list. - */ - -#define ALT_LLIST_HEAD(head) alt_llist head = {&head, &head} - -/* - * ALT_LLIST_ENTRY is a macro used to define an uninitialised linked list - * entry. This is used to reserve space in structure initialisation for - * structures that inherit form alt_llist. - */ - -#define ALT_LLIST_ENTRY {0, 0} - -/* - * alt_llist_insert() insert adds the linked list entry "entry" as the - * first entry in the linked list "list". "list" is the list head element. - */ - -static ALT_INLINE void ALT_ALWAYS_INLINE alt_llist_insert(alt_llist* list, - alt_llist* entry) -{ - entry->previous = list; - entry->next = list->next; - - list->next->previous = entry; - list->next = entry; -} - -/* - * alt_llist_remove() is called to remove an element from a linked list. The - * input argument is the element to remove. - */ - -static ALT_INLINE void ALT_ALWAYS_INLINE alt_llist_remove(alt_llist* entry) -{ - entry->next->previous = entry->previous; - entry->previous->next = entry->next; - - /* - * Set the entry to point to itself, so that any further calls to - * alt_llist_remove() are harmless. - */ - - entry->previous = entry; - entry->next = entry; -} - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_LLIST_H__ */ diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_load.h b/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_load.h deleted file mode 100644 index 432e9f2..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_load.h +++ /dev/null @@ -1,78 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "alt_types.h" - -/* - * This macro is used to load code/data from its load address to its - * execution address for a given section. The section name is the input - * argument. Note that a leading '.' is assumed in the name. For example - * to load the section .onchip_ram, use: - * - * ALT_LOAD_SECTION_BY_NAME(onchip_ram); - * - * This requires that the apropriate linker symbols have been generated - * for the section in question. This will be the case if you are using the - * default linker script. - */ - -#define ALT_LOAD_SECTION_BY_NAME(name) \ - { \ - extern void _alt_partition_##name##_start; \ - extern void _alt_partition_##name##_end; \ - extern void _alt_partition_##name##_load_addr; \ - \ - alt_load_section(&_alt_partition_##name##_load_addr, \ - &_alt_partition_##name##_start, \ - &_alt_partition_##name##_end); \ - } - -/* - * Function used to load an individual section from flash to RAM. - * - * There is an implicit assumption here that the linker script will ensure - * that all sections are word aligned. - * - */ - -static void ALT_INLINE alt_load_section (alt_u32* from, - alt_u32* to, - alt_u32* end) -{ - if (to != from) - { - while( to != end ) - { - *to++ = *from++; - } - } -} diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_log_printf.h b/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_log_printf.h deleted file mode 100644 index c15ca05..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_log_printf.h +++ /dev/null @@ -1,349 +0,0 @@ -/* alt_log_printf.h - * - * ALT_LOG is designed to provide extra logging/debugging messages from HAL - * through a different port than stdout. It is enabled by the ALT_LOG_ENABLE - * define, which needs to supplied at compile time. When logging is turned off, - * code size is unaffected. Thus, this should be transparent to the user - * when it is not actively turned on, and should not affect projects in any way. - * - * There are macros sprinkled within different components, such as the jtag uart - * and timer, in the HAL code. They are always named ALT_LOG_, and can be - * safely ignored if ALT_LOG is turned off. - * - * To turn on ALT_LOG, ALT_LOG_ENABLE must be defined, and ALT_LOG_PORT_TYPE and - * ALT_LOG_PORT_BASE must be set in system.h. This is done through editing - * .ptf, by editing the alt_log_port_type & alt_log_port_base settings. - * See the documentation html file for examples. - * - * When it is turned on, it will output extra HAL messages to a port specified - * in system.h. This can be a UART or JTAG UART port. By default it will - * output boot messages, detailing every step of the boot process. - * - * Extra logging is designed to be enabled by flags, which are defined in - * alt_log_printf.c. The default value is that all flags are off, so only the - * boot up logging messages show up. ALT_LOG_FLAGS can be set to enable certain - * groupings of flags, and that grouping is done in this file. Each flag can - * also be overridden with a -D at compile time. - * - * This header file includes the necessary prototypes for using the alt_log - * functions. It also contains all the macros that are used to remove the code - * from alt log is turned off. Also, the macros in other HAL files are defined - * here at the bottom. These macros all call some C function that is in - * alt_log_printf.c. - * - * The logging has functions for printing in C (ALT_LOG_PRINTF) and in assembly - * (ALT_LOG_PUTS). This was needed because the assembly printing occurs before - * the device is initialized. The assembly function corrupts register R4-R7, - * which are not used in the normal boot process. For this reason, do not call - * the assembly function in C. - * - * author: gkwan - */ - - -#ifndef __ALT_LOG_PRINTF_H__ -#define __ALT_LOG_PRINTF_H__ - -#include - -/* Global switch to turn on logging functions */ -#ifdef ALT_LOG_ENABLE - - /* ALT_LOG_PORT_TYPE values as defined in system.h. They are defined as - * numbers here first becasue the C preprocessor does not handle string - * comparisons. */ - #define ALTERA_AVALON_JTAG_UART 1 - #define ALTERA_AVALON_UART 0 - - /* If this .h file is included by an assembly file, skip over include files - * that won't compile in assembly. */ - #ifndef ALT_ASM_SRC - #include - #include "sys/alt_alarm.h" - #include "sys/alt_dev.h" - #ifdef __ALTERA_AVALON_JTAG_UART - #include "altera_avalon_jtag_uart.h" - #endif - #endif /* ALT_ASM_SRC */ - - /* These are included for the port register offsets and masks, needed - * to write to the port. Only include if the port type is set correctly, - * otherwise error. If alt_log is turned on and the port to output to is - * incorrect or does not exist, then should exit. */ - #if ALT_LOG_PORT_TYPE == ALTERA_AVALON_JTAG_UART - #ifdef __ALTERA_AVALON_JTAG_UART - #include - #else - #error ALT_LOG: JTAG_UART port chosen, but no JTAG_UART in system. - #endif - #elif ALT_LOG_PORT_TYPE == ALTERA_AVALON_UART - #ifdef __ALTERA_AVALON_UART - #include - #else - #error ALT_LOG: UART Port chosen, but no UART in system. - #endif - #else - #error ALT_LOG: alt_log_port_type declaration invalid! - #endif - - /* ALT_LOG_ENABLE turns on the basic printing function */ - #define ALT_LOG_PRINTF(...) do {alt_log_printf_proc(__VA_ARGS__);} while (0) - - /* Assembly macro for printing in assembly, calls tx_log_str - * which is in alt_log_macro.S. - * If alt_log_boot_on_flag is 0, skips the printing */ - #define ALT_LOG_PUTS(str) movhi r4, %hiadj(alt_log_boot_on_flag) ; \ - addi r4, r4, %lo(alt_log_boot_on_flag) ; \ - ldwio r5, 0(r4) ; \ - beq r0, r5, 0f ; \ - movhi r4, %hiadj(str) ; \ - addi r4, r4, %lo(str) ; \ - call tx_log_str ; \ - 0: - - /* These defines are here to faciliate the use of one output function - * (alt_log_txchar) to print to both the JTAG UART or the UART. Depending - * on the port type, the status register, read mask, and output register - * are set to the appropriate value for the port. */ - #if ALT_LOG_PORT_TYPE == ALTERA_AVALON_JTAG_UART - #define ALT_LOG_PRINT_REG_RD IORD_ALTERA_AVALON_JTAG_UART_CONTROL - #define ALT_LOG_PRINT_MSK ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_MSK - #define ALT_LOG_PRINT_TXDATA_WR IOWR_ALTERA_AVALON_JTAG_UART_DATA - #define ALT_LOG_PRINT_REG_OFFSET (ALTERA_AVALON_JTAG_UART_CONTROL_REG*0x4) - #define ALT_LOG_PRINT_TXDATA_REG_OFFSET (ALTERA_AVALON_JTAG_UART_DATA_REG*0x4) - #elif ALT_LOG_PORT_TYPE == ALTERA_AVALON_UART - #define ALT_LOG_PRINT_REG_RD IORD_ALTERA_AVALON_UART_STATUS - #define ALT_LOG_PRINT_MSK ALTERA_AVALON_UART_STATUS_TRDY_MSK - #define ALT_LOG_PRINT_TXDATA_WR IOWR_ALTERA_AVALON_UART_TXDATA - #define ALT_LOG_PRINT_REG_OFFSET (ALTERA_AVALON_UART_STATUS_REG*0x4) - #define ALT_LOG_PRINT_TXDATA_REG_OFFSET (ALTERA_AVALON_UART_TXDATA_REG*0x4) - #endif /* ALT_LOG_PORT */ - - /* Grouping of flags via ALT_LOG_FLAGS. Each specific flag can be set via - * -D at compile time, or else they'll be set to a default value according - * to ALT_LOG_FLAGS. ALT_LOG_FLAGS = 0 or not set is the default, where - * only the boot messages will be printed. As ALT_LOG_FLAGS increase, they - * increase in intrusiveness to the program, and will affect performance. - * - * Flag Level 1 - turns on system clock and JTAG UART startup status - * 2 - turns on write echo and JTAG_UART alarm (periodic report) - * 3 - turns on JTAG UART ISR logging - will slow performance - * significantly. - * -1 - All logging output is off, but if ALT_LOG_ENABLE is - * defined all logging function is built and code size - * remains constant - * - * Flag settings - 1 = on, 0 = off. */ - - /* This flag turns on "boot" messages for printing. This includes messages - * during crt0.S, then alt_main, and finally alt_exit. */ - #ifndef ALT_LOG_BOOT_ON_FLAG_SETTING - #if ALT_LOG_FLAGS == 1 - #define ALT_LOG_BOOT_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 2 - #define ALT_LOG_BOOT_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 3 - #define ALT_LOG_BOOT_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == -1 /* silent mode */ - #define ALT_LOG_BOOT_ON_FLAG_SETTING 0x0 - #else /* default setting */ - #define ALT_LOG_BOOT_ON_FLAG_SETTING 0x1 - #endif - #endif /* ALT_LOG_BOOT_ON_FLAG_SETTING */ - - #ifndef ALT_LOG_SYS_CLK_ON_FLAG_SETTING - #if ALT_LOG_FLAGS == 1 - #define ALT_LOG_SYS_CLK_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 2 - #define ALT_LOG_SYS_CLK_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 3 - #define ALT_LOG_SYS_CLK_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == -1 /* silent mode */ - #define ALT_LOG_SYS_CLK_ON_FLAG_SETTING 0x0 - #else /* default setting */ - #define ALT_LOG_SYS_CLK_ON_FLAG_SETTING 0x0 - #endif - #endif /* ALT_LOG_SYS_CLK_ON_FLAG_SETTING */ - - #ifndef ALT_LOG_WRITE_ON_FLAG_SETTING - #if ALT_LOG_FLAGS == 1 - #define ALT_LOG_WRITE_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 2 - #define ALT_LOG_WRITE_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 3 - #define ALT_LOG_WRITE_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == -1 /* silent mode */ - #define ALT_LOG_WRITE_ON_FLAG_SETTING 0x0 - #else /* default setting */ - #define ALT_LOG_WRITE_ON_FLAG_SETTING 0x0 - #endif - #endif /* ALT_LOG_WRITE_ON_FLAG_SETTING */ - - #ifndef ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING - #ifndef __ALTERA_AVALON_JTAG_UART - #define ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 1 - #define ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 2 - #define ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 3 - #define ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == -1 /* silent mode */ - #define ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING 0x0 - #else /* default setting */ - #define ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING 0x0 - #endif - #endif /* ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING */ - - #ifndef ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING - #ifndef __ALTERA_AVALON_JTAG_UART - #define ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 1 - #define ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 2 - #define ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 3 - #define ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == -1 /* silent mode */ - #define ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING 0x0 - #else /* default setting */ - #define ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING 0x0 - #endif - #endif /* ALT_LOG_JTAG_UART_STARTUP_INFO_FLAG_SETTING */ - - #ifndef ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING - #ifndef __ALTERA_AVALON_JTAG_UART - #define ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 1 - #define ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 2 - #define ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 3 - #define ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == -1 /* silent mode */ - #define ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING 0x0 - #else /* default setting */ - #define ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING 0x0 - #endif - #endif /* ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING */ - -#ifndef ALT_ASM_SRC - /* Function Prototypes */ - void alt_log_txchar(int c,char *uartBase); - void alt_log_private_printf(const char *fmt,int base,va_list args); - void alt_log_repchar(char c,int r,int base); - int alt_log_printf_proc(const char *fmt, ... ); - void alt_log_system_clock(); - #ifdef __ALTERA_AVALON_JTAG_UART - alt_u32 altera_avalon_jtag_uart_report_log(void * context); - void alt_log_jtag_uart_startup_info(altera_avalon_jtag_uart_state* dev, int base); - void alt_log_jtag_uart_print_control_reg(altera_avalon_jtag_uart_state* dev, \ - int base, const char* header); - void alt_log_jtag_uart_isr_proc(int base, altera_avalon_jtag_uart_state* dev); - #endif - void alt_log_write(const void *ptr, size_t len); - - /* extern all global variables */ - extern volatile alt_u32 alt_log_boot_on_flag; - extern volatile alt_u8 alt_log_write_on_flag; - extern volatile alt_u8 alt_log_sys_clk_on_flag; - extern volatile alt_u8 alt_log_jtag_uart_alarm_on_flag; - extern volatile alt_u8 alt_log_jtag_uart_isr_on_flag; - extern volatile alt_u8 alt_log_jtag_uart_startup_info_on_flag; - extern volatile int alt_log_sys_clk_count; - extern volatile int alt_system_clock_in_sec; - extern alt_alarm alt_log_jtag_uart_alarm_1; -#endif /* ALT_ASM_SRC */ - - - /* Below are the MACRO defines used in various HAL files. They check - * if their specific flag is turned on; if it is, then it executes its - * code. - * - * To keep this file reasonable, most of these macros calls functions, - * which are defined in alt_log_printf.c. Look there for implementation - * details. */ - - /* Boot Messages Logging */ - #define ALT_LOG_PRINT_BOOT(...) \ - do { if (alt_log_boot_on_flag==1) {ALT_LOG_PRINTF(__VA_ARGS__);} \ - } while (0) - - /* JTAG UART Logging */ - /* number of ticks before alarm runs logging function */ - #ifndef ALT_LOG_JTAG_UART_TICKS_DIVISOR - #define ALT_LOG_JTAG_UART_TICKS_DIVISOR 10 - #endif - #ifndef ALT_LOG_JTAG_UART_TICKS - #define ALT_LOG_JTAG_UART_TICKS \ - (alt_ticks_per_second()/ALT_LOG_JTAG_UART_TICKS_DIVISOR) - #endif - - /* if there's a JTAG UART defined, then enable these macros */ - #ifdef __ALTERA_AVALON_JTAG_UART - - /* Macro in altera_avalon_jtag_uart.c, to register the alarm function. - * Also, the startup register info is also printed here, as this is - * called within the device driver initialization. */ - #define ALT_LOG_JTAG_UART_ALARM_REGISTER(dev, base) \ - do { if (alt_log_jtag_uart_alarm_on_flag==1) { \ - alt_alarm_start(&alt_log_jtag_uart_alarm_1, \ - ALT_LOG_JTAG_UART_TICKS, &altera_avalon_jtag_uart_report_log,\ - dev);} \ - if (alt_log_jtag_uart_startup_info_on_flag==1) {\ - alt_log_jtag_uart_startup_info(dev, base);} \ - } while (0) - - /* JTAG UART IRQ Logging (when buffer is empty) - * Inserted in the ISR in altera_avalon_jtag_uart.c */ - #define ALT_LOG_JTAG_UART_ISR_FUNCTION(base, dev) \ - do { alt_log_jtag_uart_isr_proc(base, dev); } while (0) - /* else, define macros to nothing. Or else the jtag_uart specific types - * will throw compiler errors */ - #else - #define ALT_LOG_JTAG_UART_ALARM_REGISTER(dev, base) - #define ALT_LOG_JTAG_UART_ISR_FUNCTION(base, dev) - #endif - - /* System clock logging - * How often (in seconds) the system clock logging prints. - * The default value is every 1 second */ - #ifndef ALT_LOG_SYS_CLK_INTERVAL_MULTIPLIER - #define ALT_LOG_SYS_CLK_INTERVAL_MULTIPLIER 1 - #endif - #ifndef ALT_LOG_SYS_CLK_INTERVAL - #define ALT_LOG_SYS_CLK_INTERVAL \ - (alt_ticks_per_second()*ALT_LOG_SYS_CLK_INTERVAL_MULTIPLIER) - #endif - - /* System clock logging - prints a message every interval (set above) - * to show that the system clock is alive. - * This macro is used in altera_avalon_timer_sc.c */ - #define ALT_LOG_SYS_CLK_HEARTBEAT() \ - do { alt_log_system_clock(); } while (0) - - /* alt_write_logging - echos a message every time write() is called, - * displays the first ALT_LOG_WRITE_ECHO_LEN characters. - * This macro is used in alt_write.c */ - #ifndef ALT_LOG_WRITE_ECHO_LEN - #define ALT_LOG_WRITE_ECHO_LEN 15 - #endif - - #define ALT_LOG_WRITE_FUNCTION(ptr,len) \ - do { alt_log_write(ptr,len); } while (0) - -#else /* ALT_LOG_ENABLE not defined */ - - /* logging is off, set all relevant macros to null */ - #define ALT_LOG_PRINT_BOOT(...) - #define ALT_LOG_PRINTF(...) - #define ALT_LOG_JTAG_UART_ISR_FUNCTION(base, dev) - #define ALT_LOG_JTAG_UART_ALARM_REGISTER(dev, base) - #define ALT_LOG_SYS_CLK_HEARTBEAT() - #define ALT_LOG_PUTS(str) - #define ALT_LOG_WRITE_FUNCTION(ptr,len) - -#endif /* ALT_LOG_ENABLE */ - -#endif /* __ALT_LOG_PRINTF_H__ */ - diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_set_args.h b/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_set_args.h deleted file mode 100644 index 3750e67..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_set_args.h +++ /dev/null @@ -1,71 +0,0 @@ -#ifndef __ALT_SET_ARGS_H__ -#define __ALT_SET_ARGS_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The function alt_set_args() is provided in order to define the input - * arguments to main(). If this function is not called before main() then the - * argument list passed to main() will be empty. - * - * It is expected that this function will only be used by the ihost/iclient - * utility. - */ - -static inline void alt_set_args (int argc, char** argv, char** envp) -{ - extern int alt_argc; - extern char** alt_argv; - extern char** alt_envp; - - alt_argc = argc; - alt_argv = argv; - alt_envp = envp; -} - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_SET_ARGS_H__ */ diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_sim.h b/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_sim.h deleted file mode 100644 index 06bd27a..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_sim.h +++ /dev/null @@ -1,91 +0,0 @@ -#ifndef __ALT_SIM_H__ -#define __ALT_SIM_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ -#include "system.h" -#include "alt_types.h" - -/* - * Instructions that might mean something special to a simulator. - * These have no special effect on real hardware (they are just nops). - */ -#define ALT_SIM_FAIL() \ - do { __asm volatile ("cmpltui r0, r0, 0xabc1"); } while (0) - -#define ALT_SIM_PASS() \ - do { __asm volatile ("cmpltui r0, r0, 0xabc2"); } while (0) - -#define ALT_SIM_IN_TOP_OF_HOT_LOOP() \ - do { __asm volatile ("cmpltui r0, r0, 0xabc3"); } while (0) - -/* - * Routine called on exit. - */ -static ALT_ALWAYS_INLINE void alt_sim_halt(int exit_code) -{ - int r2 = exit_code; - -#if defined(NIOS2_HAS_DEBUG_STUB) && (defined(ALT_BREAK_ON_EXIT) || defined(ALT_PROVIDE_GMON)) - - int r3 = (1 << 2); - -#ifdef ALT_PROVIDE_GMON - extern unsigned int alt_gmon_data[]; - int r4 = (int)alt_gmon_data; - r3 |= (1 << 4); -#define ALT_GMON_DATA ,"D04"(r4) -#else -#define ALT_GMON_DATA -#endif /* ALT_PROVIDE_GMON */ - - if (r2) { - ALT_SIM_FAIL(); - } else { - ALT_SIM_PASS(); - } - - __asm__ volatile ("\n0:\n\taddi %0,%0, -1\n\tbgt %0,zero,0b" : : "r" (ALT_CPU_FREQ/100) ); /* Delay for >30ms */ - - __asm__ volatile ("break 2" : : "D02"(r2), "D03"(r3) ALT_GMON_DATA ); - -#else /* !DEBUG_STUB */ - if (r2) { - ALT_SIM_FAIL(); - } else { - ALT_SIM_PASS(); - } -#endif /* DEBUG_STUB */ -} - -#define ALT_SIM_HALT(exit_code) \ - alt_sim_halt(exit_code) - -#endif /* __ALT_SIM_H__ */ diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_stack.h b/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_stack.h deleted file mode 100644 index e30652a..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_stack.h +++ /dev/null @@ -1,126 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#ifndef __ALT_STACK_H__ -#define __ALT_STACK_H__ - -/* - * alt_stack.h is the nios2 specific implementation of functions used by the - * stack overflow code. - */ - -#include "nios2.h" - -#include "alt_types.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - - -extern char * alt_stack_limit_value; - -#ifdef ALT_EXCEPTION_STACK -extern char __alt_exception_stack_pointer[]; /* set by the linker */ -#endif /* ALT_EXCEPTION_STACK */ - - -/* - * alt_stack_limit can be called to determine the current value of the stack - * limit register. - */ - -static ALT_INLINE char * ALT_ALWAYS_INLINE alt_stack_limit (void) -{ - char * limit; - NIOS2_READ_ET(limit); - - return limit; -} - -/* - * alt_stack_pointer can be called to determine the current value of the stack - * pointer register. - */ - -static ALT_INLINE char * ALT_ALWAYS_INLINE alt_stack_pointer (void) -{ - char * pointer; - NIOS2_READ_SP(pointer); - - return pointer; -} - - -#ifdef ALT_EXCEPTION_STACK - -/* - * alt_exception_stack_pointer returns the normal stack pointer from - * where it is stored on the exception stack (uppermost 4 bytes). This - * is really only useful during exception processing, and is only - * available if a separate exception stack has been configured. - */ - -static ALT_INLINE char * ALT_ALWAYS_INLINE alt_exception_stack_pointer (void) -{ - return (char *) *(alt_u32 *)(__alt_exception_stack_pointer - sizeof(alt_u32)); -} - -#endif /* ALT_EXCEPTION_STACK */ - - -/* - * alt_set_stack_limit can be called to update the current value of the stack - * limit register. - */ - -static ALT_INLINE void ALT_ALWAYS_INLINE alt_set_stack_limit (char * limit) -{ - alt_stack_limit_value = limit; - NIOS2_WRITE_ET(limit); -} - -/* - * alt_report_stack_overflow reports that a stack overflow happened. - */ - -static ALT_INLINE void ALT_ALWAYS_INLINE alt_report_stack_overflow (void) -{ - NIOS2_REPORT_STACK_OVERFLOW(); -} - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_STACK_H__ */ - diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_stdio.h b/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_stdio.h deleted file mode 100644 index 1730360..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_stdio.h +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef __ALT_STDIO_H__ -#define __ALT_STDIO_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * Definitions for ALT stdio routines. - */ - -#include - - -#ifdef __cplusplus -extern "C" { -#endif - -int alt_getchar(); -int alt_putchar(int c); -int alt_putstr(const char* str); -void alt_printf(const char *fmt, ...); - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_STDIO_H__ */ diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_sys_init.h b/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_sys_init.h deleted file mode 100644 index e4abc28..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_sys_init.h +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef __ALT_SYS_INIT_H__ -#define __ALT_SYS_INIT_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The function alt_sys_init() is defined within the auto-generated file: - * alt_sys_init.c. This function calls the initilisation macros for all - * devices, file systems, and software components within the system. - * - * The list of initilisation macros to use is constructed using the PTF and - * STF files associated with the system. - */ - -extern void alt_sys_init (void); - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_SYS_INIT_H__ */ diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_sys_wrappers.h b/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_sys_wrappers.h deleted file mode 100644 index 044833b..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_sys_wrappers.h +++ /dev/null @@ -1,100 +0,0 @@ -#ifndef __ALT_SYS_WRAPPERS_H__ -#define __ALT_SYS_WRAPPERS_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * This file provides the prototypes for the HAL 'UNIX style functions. The - * names of these functions are defined in alt_syscall.h. THese are defined to - * be the standard names when running the standalone HAL, e.g. open(), close() - * etc., but the names may be redefined as a part of an operating system port - * in order to avoid name clashes. - */ - -#include "os/alt_syscall.h" - -#include -#include -#include -#include -#include -#include - -extern int ALT_CLOSE (int __fd); -extern int ALT_EXECVE (const char *__path, - char * const __argv[], - char * const __envp[]); -extern void ALT_EXIT (int __status); -extern int ALT_FSTAT (int file, struct stat *st); -extern int ALT_FCNTL (int file, int cmd, ...); -extern pid_t ALT_FORK (void); -extern pid_t ALT_GETPID (void); - -#if defined (__GNUC__) && __GNUC__ >= 4 -extern int ALT_GETTIMEOFDAY (struct timeval *ptimeval, - void *ptimezone); -#else -extern int ALT_GETTIMEOFDAY (struct timeval *ptimeval, - struct timezone *ptimezone); -#endif - -extern int ALT_IOCTL (int file, int req, void* arg); -extern int ALT_ISATTY (int file); -extern int ALT_KILL (int pid, int sig); -extern int ALT_LINK (const char *existing, const char *new); -extern off_t ALT_LSEEK (int file, off_t ptr, int dir); -extern int ALT_OPEN (const char* file, int flags, ...); -extern int ALT_READ (int file, void *ptr, size_t len); -extern int ALT_RENAME (char *existing, char *new); -extern void* ALT_SBRK (ptrdiff_t incr); -extern int ALT_SETTIMEOFDAY (const struct timeval *t, - const struct timezone *tz); -extern int ALT_STAT (const char *file, struct stat *st); -extern clock_t ALT_TIMES (struct tms *buf); -extern int ALT_UNLINK (const char *name); - -#if defined (__GNUC__) && __GNUC__ >= 4 -int ALT_USLEEP (useconds_t us); -#else -unsigned int ALT_USLEEP (unsigned int us); -#endif - -extern int ALT_WAIT (int *status); -extern int ALT_WRITE (int file, const void *ptr, size_t len); - - -extern char** ALT_ENVIRON; - -/* - * - */ - -#endif /* __ALT_SYS_WRAPPERS_H__ */ diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_timestamp.h b/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_timestamp.h deleted file mode 100644 index 8a18da2..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_timestamp.h +++ /dev/null @@ -1,60 +0,0 @@ -#ifndef __ALT_TIMESTAMP_H__ -#define __ALT_TIMESTAMP_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "alt_types.h" -#include "altera_avalon_timer.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -extern int alt_timestamp_start (void); - -extern alt_timestamp_type alt_timestamp (void); - -extern alt_u32 alt_timestamp_freq (void); - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_TIMESTAMP_H__ */ diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_warning.h b/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_warning.h deleted file mode 100644 index b66e71a..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/alt_warning.h +++ /dev/null @@ -1,75 +0,0 @@ -#ifndef __WARNING_H__ -#define __WARNING_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * alt_warning.h provides macro definitions that can be used to generate link - * time warnings. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The symbol "__alt_invalid" is used to force a link error. There should be - * no corresponding implementation of this function. - */ - -extern void __alt_invalid (void); - -#define ALT_LINK_WARNING(symbol, msg) \ - __asm__(".ifndef __evoke_link_warning_" #symbol \ - "\n\t .section .gnu.warning." #symbol \ - "\n__evoke_link_warning_" #symbol ":\n\t .string \x22" msg "\x22 \n\t .previous" \ - "\n .endif"); - -/* A canned warning for sysdeps/stub functions. */ - -#define ALT_STUB_WARNING(name) \ - ALT_LINK_WARNING (name, \ - "warning: " #name " is not implemented and will always fail") - -#define ALT_OBSOLETE_FUNCTION_WARNING(name) \ - ALT_LINK_WARNING (name, \ - "warning: " #name " is a deprecated function") - -#define ALT_LINK_ERROR(msg) \ - ALT_LINK_WARNING (__alt_invalid, msg); \ - __alt_invalid() - -#ifdef __cplusplus -} -#endif - -#endif /* __WARNING_H__ */ diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/ioctl.h b/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/ioctl.h deleted file mode 100644 index 4d565df..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/ioctl.h +++ /dev/null @@ -1,90 +0,0 @@ -#ifndef __IOCTL_H__ -#define __IOCTL_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The ioctl() system call be used to initiate a variety of control operations - * on a file descriptor. For the most part this simply translates to a call to - * the ioctl() function of the associated device driver (TIOCEXCL and - * TIOCNXCL are notable exceptions - see ioctl.c for details). - * - * The interpretation of the ioctl requests are therefore device specific. - * - * This function is equivalent to the standard Posix ioctl() call. - */ - -extern int ioctl (int fd, int req, void* arg); - -/* - * list of ioctl calls handled by the system ioctl implementation. - */ - -#define TIOCEXCL 0x740d /* exclusive use of the device */ -#define TIOCNXCL 0x740e /* allow multiple use of the device */ - -/* - * ioctl calls which can be handled by device drivers. - */ - -#define TIOCOUTQ 0x7472 /* get output queue size */ -#define TIOCMGET 0x741d /* get termios flags */ -#define TIOCMSET 0x741a /* set termios flags */ - -/* - * ioctl calls specific to JTAG UART. - */ - -#define TIOCSTIMEOUT 0x6a01 /* Set Timeout before assuming no host present */ -#define TIOCGCONNECTED 0x6a02 /* Get indication of whether host is connected */ - -/* - * - */ - -#ifdef __cplusplus -} -#endif - -#endif /* __IOCTL_H__ */ diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/termios.h b/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/termios.h deleted file mode 100644 index cd09539..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/inc/sys/termios.h +++ /dev/null @@ -1,181 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * This is the termios.h file provided with newlib. The only modification has - * been to the baud rate macro definitions, and an increase in the size of the - * termios structure to accomodate this. - */ - - -#ifndef _SYS_TERMIOS_H -# define _SYS_TERMIOS_H - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -# define _XCGETA (('x'<<8)|1) -# define _XCSETA (('x'<<8)|2) -# define _XCSETAW (('x'<<8)|3) -# define _XCSETAF (('x'<<8)|4) -# define _TCSBRK (('T'<<8)|5) -# define _TCFLSH (('T'<<8)|7) -# define _TCXONC (('T'<<8)|6) - -# define TCOOFF 0 -# define TCOON 1 -# define TCIOFF 2 -# define TCION 3 - -# define TCIFLUSH 0 -# define TCOFLUSH 1 -# define TCIOFLUSH 2 - -# define NCCS 13 - -# define TCSAFLUSH _XCSETAF -# define TCSANOW _XCSETA -# define TCSADRAIN _XCSETAW -# define TCSADFLUSH _XCSETAF - -# define IGNBRK 000001 -# define BRKINT 000002 -# define IGNPAR 000004 -# define INPCK 000020 -# define ISTRIP 000040 -# define INLCR 000100 -# define IGNCR 000200 -# define ICRNL 000400 -# define IXON 002000 -# define IXOFF 010000 - -# define OPOST 000001 -# define OCRNL 000004 -# define ONLCR 000010 -# define ONOCR 000020 -# define TAB3 014000 - -# define CLOCAL 004000 -# define CREAD 000200 -# define CSIZE 000060 -# define CS5 0 -# define CS6 020 -# define CS7 040 -# define CS8 060 -# define CSTOPB 000100 -# define HUPCL 002000 -# define PARENB 000400 -# define PAODD 001000 - -#define CCTS_OFLOW 010000 -#define CRTS_IFLOW 020000 -#define CRTSCTS (CCTS_OFLOW | CRTS_IFLOW) - -# define ECHO 0000010 -# define ECHOE 0000020 -# define ECHOK 0000040 -# define ECHONL 0000100 -# define ICANON 0000002 -# define IEXTEN 0000400 /* anybody know *what* this does?! */ -# define ISIG 0000001 -# define NOFLSH 0000200 -# define TOSTOP 0001000 - -# define VEOF 4 /* also VMIN -- thanks, AT&T */ -# define VEOL 5 /* also VTIME -- thanks again */ -# define VERASE 2 -# define VINTR 0 -# define VKILL 3 -# define VMIN 4 /* also VEOF */ -# define VQUIT 1 -# define VSUSP 10 -# define VTIME 5 /* also VEOL */ -# define VSTART 11 -# define VSTOP 12 - -# define B0 0 -# define B50 50 -# define B75 75 -# define B110 110 -# define B134 134 -# define B150 150 -# define B200 200 -# define B300 300 -# define B600 600 -# define B1200 1200 -# define B1800 1800 -# define B2400 2400 -# define B4800 4800 -# define B9600 9600 -# define B19200 19200 -# define B38400 38400 -# define B57600 57600 -# define B115200 115200 - -typedef unsigned char cc_t; -typedef unsigned short tcflag_t; -typedef unsigned long speed_t; - -struct termios { - tcflag_t c_iflag; - tcflag_t c_oflag; - tcflag_t c_cflag; - tcflag_t c_lflag; - char c_line; - cc_t c_cc[NCCS]; - speed_t c_ispeed; - speed_t c_ospeed; -}; - -# ifndef _NO_MACROS - -# define cfgetospeed(tp) ((tp)->c_ospeed) -# define cfgetispeed(tp) ((tp)->c_ispeed) -# define cfsetospeed(tp,s) (((tp)->c_ospeed = (s)), 0) -# define cfsetispeed(tp,s) (((tp)->c_ispeed = (s)), 0) -# define tcdrain(fd) _ioctl (fd, _TCSBRK, 1) -# endif /* _NO_MACROS */ - -#ifdef __cplusplus -} -#endif - -#endif /* _SYS_TERMIOS_H */ - diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_alarm_start.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_alarm_start.c deleted file mode 100644 index 7739959..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_alarm_start.c +++ /dev/null @@ -1,112 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "sys/alt_alarm.h" -#include "sys/alt_irq.h" - -/* - * alt_alarm_start is called to register an alarm with the system. The - * "alarm" structure passed as an input argument does not need to be - * initialised by the user. This is done within this function. - * - * The remaining input arguments are: - * - * nticks - The time to elapse until the alarm executes. This is specified in - * system clock ticks. - * callback - The function to run when the indicated time has elapsed. - * context - An opaque value, passed to the callback function. -* - * Care should be taken when defining the callback function since it is - * likely to execute in interrupt context. In particular, this mean that - * library calls like printf() should not be made, since they can result in - * deadlock. - * - * The interval to be used for the next callback is the return - * value from the callback function. A return value of zero indicates that the - * alarm should be unregistered. - * - * alt_alarm_start() will fail if the timer facility has not been enabled - * (i.e. there is no system clock). Failure is indicated by a negative return - * value. - */ - -int alt_alarm_start (alt_alarm* alarm, alt_u32 nticks, - alt_u32 (*callback) (void* context), - void* context) -{ - alt_irq_context irq_context; - alt_u32 current_nticks = 0; - - if (alt_ticks_per_second ()) - { - if (alarm) - { - alarm->callback = callback; - alarm->context = context; - - irq_context = alt_irq_disable_all (); - - current_nticks = alt_nticks(); - - alarm->time = nticks + current_nticks + 1; - - /* - * If the desired alarm time causes a roll-over, set the rollover - * flag. This will prevent the subsequent tick event from causing - * an alarm too early. - */ - if(alarm->time < current_nticks) - { - alarm->rollover = 1; - } - else - { - alarm->rollover = 0; - } - - alt_llist_insert (&alt_alarm_list, &alarm->llist); - alt_irq_enable_all (irq_context); - - return 0; - } - else - { - return -EINVAL; - } - } - else - { - return -ENOTSUP; - } -} diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_busy_sleep.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_busy_sleep.c deleted file mode 100644 index 561c0be..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_busy_sleep.c +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright (c) 2003-2004 Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - * - * ------------ - * - * Altera does not recommend, suggest or require that this reference design - * file be used in conjunction or combination with any other product. - * - * alt_busy_sleep.c - Microsecond delay routine which uses a calibrated busy - * loop to perform the delay. This is used to implement - * usleep for both uC/OS-II and the standalone HAL. - * - * Author PRR - * - * Calibrated delay with no timer required - * - * The ASM instructions in the routine are equivalent to - * - * for (i=0;i -#include - -#include "system.h" -#include "alt_types.h" - -#include "priv/alt_busy_sleep.h" - -unsigned int alt_busy_sleep (unsigned int us) -{ -/* - * Only delay if ALT_SIM_OPTIMIZE is not defined; i.e., if software - * is built targetting ModelSim RTL simulation, the delay will be - * skipped to speed up simulation. - */ -#ifndef ALT_SIM_OPTIMIZE - int i; - int big_loops; - alt_u32 cycles_per_loop; - - if (!strcmp(NIOS2_CPU_IMPLEMENTATION,"tiny")) - { - cycles_per_loop = 9; - } - else - { - cycles_per_loop = 3; - } - - - big_loops = us / (INT_MAX/ - (ALT_CPU_FREQ/(cycles_per_loop * 1000000))); - - if (big_loops) - { - for(i=0;i - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -#ifdef ALT_USE_DIRECT_DRIVERS - -int ALT_CLOSE (int fildes) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(close); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -/* - * close() is called by an application to release a file descriptor. If the - * associated file system/device has a close() callback function registered - * then this called. The file descriptor is then marked as free. - * - * ALT_CLOSE is mapped onto the close() system call in alt_syscall.h - */ - -int ALT_CLOSE (int fildes) -{ - alt_fd* fd; - int rval; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (fildes < 0) ? NULL : &alt_fd_list[fildes]; - - if (fd) - { - /* - * If the associated file system/device has a close function, call it so - * that any necessary cleanup code can run. - */ - - rval = (fd->dev->close) ? fd->dev->close(fd) : 0; - - /* Free the file descriptor structure and return. */ - - alt_release_fd (fildes); - if (rval < 0) - { - ALT_ERRNO = -rval; - return -1; - } - return 0; - } - else - { - ALT_ERRNO = EBADFD; - return -1; - } -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_dcache_flush.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_dcache_flush.c deleted file mode 100644 index 7ecc91a..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_dcache_flush.c +++ /dev/null @@ -1,97 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "nios2.h" -#include "system.h" - -#include "alt_types.h" -#include "sys/alt_cache.h" - -/* - * Nios II version 1.2 and newer supports the "flush by address" instruction, in - * addition to the "flush by line" instruction provided by older versions of - * the core. This newer instruction is used by preference when it is - * available. - */ - -#ifdef NIOS2_FLUSHDA_SUPPORTED -#define ALT_FLUSH_DATA(i) __asm__ volatile ("flushda (%0)" :: "r" (i)); -#else -#define ALT_FLUSH_DATA(i) __asm__ volatile ("flushd (%0)" :: "r" (i)); -#endif /* NIOS2_FLUSHDA_SUPPORTED */ - -/* - * alt_dcache_flush() is called to flush the data cache for a memory - * region of length "len" bytes, starting at address "start". - * - * Any dirty lines in the data cache are written back to memory. - */ - -void alt_dcache_flush (void* start, alt_u32 len) -{ -#if NIOS2_DCACHE_SIZE > 0 - - char* i; - char* end; - - /* - * This is the most we would ever need to flush. - * - * SPR 196942, 2006.01.13: The cache flush loop below will use the - * 'flushda' instruction if its available; in that case each line - * must be flushed individually, and thus 'len' cannot be trimmed. - */ - #ifndef NIOS2_FLUSHDA_SUPPORTED - if (len > NIOS2_DCACHE_SIZE) - { - len = NIOS2_DCACHE_SIZE; - } - #endif - - end = ((char*) start) + len; - - for (i = start; i < end; i+= NIOS2_DCACHE_LINE_SIZE) - { - ALT_FLUSH_DATA(i); - } - - /* - * For an unaligned flush request, we've got one more line left. - * Note that this is dependent on NIOS2_DCACHE_LINE_SIZE to be a - * multiple of 2 (which it always is). - */ - - if (((alt_u32) start) & (NIOS2_DCACHE_LINE_SIZE - 1)) - { - ALT_FLUSH_DATA(i); - } - -#endif /* NIOS2_DCACHE_SIZE > 0 */ -} diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_dcache_flush_all.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_dcache_flush_all.c deleted file mode 100644 index 6529231..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_dcache_flush_all.c +++ /dev/null @@ -1,51 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "nios2.h" -#include "system.h" - -#include "alt_types.h" -#include "sys/alt_cache.h" - -/* - * alt_dcache_flush_all() is called to flush the entire data cache. - */ - -void alt_dcache_flush_all (void) -{ -#if NIOS2_DCACHE_SIZE > 0 - char* i; - - for (i = (char*) 0; i < (char*) NIOS2_DCACHE_SIZE; i+= NIOS2_DCACHE_LINE_SIZE) - { - __asm__ volatile ("flushd (%0)" :: "r" (i)); - } -#endif /* NIOS2_DCACHE_SIZE > 0 */ -} diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_dcache_flush_no_writeback.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_dcache_flush_no_writeback.c deleted file mode 100644 index c65ca7d..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_dcache_flush_no_writeback.c +++ /dev/null @@ -1,88 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "nios2.h" -#include "system.h" - -#include "alt_types.h" -#include "sys/alt_cache.h" - -/* - * The INITDA instruction was added to Nios II in the 8.0 release. - * - * The INITDA instruction has one of the following possible behaviors - * depending on the processor configuration: - * 1) Flushes a line by address but does NOT write back dirty data. - * Occurs when a data cache is present that supports INITDA. - * The macro NIOS2_INITDA_SUPPORTED is defined in system.h. - * 2) Takes an unimplemented instruction exception. - * Occurs when a data cache is present that doesn't support INITDA. - * 3) Performs no operation - * Occurs when there is no data cache present. - * The macro NIOS2_DCACHE_SIZE is 0 in system.h. - */ - -#define ALT_FLUSH_DATA_NO_WRITEBACK(i) \ - __asm__ volatile ("initda (%0)" :: "r" (i)); - -/* - * alt_dcache_flush_no_writeback() is called to flush the data cache for a - * memory region of length "len" bytes, starting at address "start". - * - * Any dirty lines in the data cache are NOT written back to memory. - * Make sure you really want this behavior. If you aren't 100% sure, - * use the alt_dcache_flush() routine instead. - */ - -void alt_dcache_flush_no_writeback (void* start, alt_u32 len) -{ -#if defined(NIOS2_INITDA_SUPPORTED) - - char* i; - char* end = ((char*) start) + len; - - for (i = start; i < end; i+= NIOS2_DCACHE_LINE_SIZE) - { - ALT_FLUSH_DATA_NO_WRITEBACK(i); - } - - /* - * For an unaligned flush request, we've got one more line left. - * Note that this is dependent on NIOS2_DCACHE_LINE_SIZE to be a - * multiple of 2 (which it always is). - */ - - if (((alt_u32) start) & (NIOS2_DCACHE_LINE_SIZE - 1)) - { - ALT_FLUSH_DATA_NO_WRITEBACK(i); - } - -#endif /* NIOS2_INITDA_SUPPORTED */ -} diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_dev.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_dev.c deleted file mode 100644 index ebc15e5..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_dev.c +++ /dev/null @@ -1,149 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include -#include -#include - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - -#include "alt_types.h" - -#include "system.h" - -/* - * This file contains the data constructs used to control access to device and - * filesytems. - */ - -/* - * "alt_fs_list" is the head of a linked list of registered filesystems. It is - * initialised as an empty list. New entries can be added using the - * alt_fs_reg() function. - */ - -ALT_LLIST_HEAD(alt_fs_list); - - -/* - * "alt_dev_list" is the head of a linked list of registered devices. It is - * configured at startup to include a single device, "alt_dev_null". This - * device is discussed below. - */ - -extern alt_dev alt_dev_null; /* forward declaration */ - -alt_llist alt_dev_list = {&alt_dev_null.llist, &alt_dev_null.llist}; - -/* - * alt_dev_null_write() is the implementation of the write() function used - * by the alt_dev_null device. It simple discards all data passed to it, and - * indicates that the data has been successfully transmitted. - */ - -static int alt_dev_null_write (alt_fd* fd, const char* ptr, int len) -{ - return len; -} - -/* - * "alt_dev_null" is used to allow output to be redirected to nowhere. It is - * the only device registered before the call to alt_sys_init(). At startup - * stin, stdout & stderr are all directed towards this device so that library - * calls like printf() will be safe but inefectual. - */ - -alt_dev alt_dev_null = { - { - &alt_dev_list, - &alt_dev_list - }, - "/dev/null", - NULL, /* open */ - NULL, /* close */ - NULL, /* write */ - alt_dev_null_write, /* write */ - NULL, /* lseek */ - NULL, /* fstat */ - NULL /* ioctl */ - }; - -/* - * "alt_fd_list_lock" is a semaphore used to control access to the file - * descriptor list. This is used to ensure that access to the list is thread - * safe. - */ - -ALT_SEM(alt_fd_list_lock) - -/* - * "alt_max_fd" is used to make access to the file descriptor list more - * efficent. It is set to be the value of the highest allocated file - * descriptor. This saves having to search the entire pool of unallocated - * file descriptors when looking for a match. - */ - -alt_32 alt_max_fd = -1; - -/* - * "alt_fd_list" is the file descriptor pool. The first three entries in the - * array are configured as standard in, standard out, and standard error. These - * are all initialised so that accesses are directed to the alt_dev_null - * device. The remaining file descriptors are initialised as unallocated. - * - * The maximum number of file descriptors within the system is specified by the - * user defined macro "ALT_MAX_FD". This is defined in "system.h", which is - * auto-genereated using the projects PTF and STF files. - */ - -alt_fd alt_fd_list[ALT_MAX_FD] = - { - { - &alt_dev_null, /* standard in */ - 0, - 0 - }, - { - &alt_dev_null, /* standard out */ - 0, - 0 - }, - { - &alt_dev_null, /* standard error */ - 0, - 0 - } - /* all other elements are set to zero */ - }; diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_dev_llist_insert.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_dev_llist_insert.c deleted file mode 100644 index fa7239d..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_dev_llist_insert.c +++ /dev/null @@ -1,59 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "priv/alt_dev_llist.h" -#include "sys/alt_errno.h" - -/* - * - */ - -int alt_dev_llist_insert (alt_dev_llist* dev, alt_llist* list) -{ - /* - * check that the device exists, and that it has a valid name. - */ - - if (!dev || !dev->name) - { - ALT_ERRNO = EINVAL; - return -EINVAL; - } - - /* - * register the device. - */ - - alt_llist_insert(list, &dev->llist); - - return 0; -} diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_dma_rxchan_open.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_dma_rxchan_open.c deleted file mode 100644 index 6ea3b78..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_dma_rxchan_open.c +++ /dev/null @@ -1,63 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_dma.h" -#include "sys/alt_errno.h" -#include "priv/alt_file.h" - -/* - * The list of registered DMA receive channels. - */ - -ALT_LLIST_HEAD(alt_dma_rxchan_list); - -/* - * alt_dma_txchan_open() is used to obtain an "alt_dma_txchan" descriptor for - * a DMA transmit device. The name is the name of the associated physical - * device (e.g. "/dev/dma_0"). - * - * The return value will be NULL on failure, and non-NULL otherwise. - */ - -alt_dma_rxchan alt_dma_rxchan_open (const char* name) -{ - alt_dma_rxchan dev; - - dev = (alt_dma_rxchan) alt_find_dev (name, &alt_dma_rxchan_list); - - if (!dev) - { - ALT_ERRNO = ENODEV; - } - - return dev; -} diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_dma_txchan_open.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_dma_txchan_open.c deleted file mode 100644 index f41fa81..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_dma_txchan_open.c +++ /dev/null @@ -1,63 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_dma.h" -#include "sys/alt_errno.h" -#include "priv/alt_file.h" - -/* - * The list of registered receive channels. - */ - -ALT_LLIST_HEAD(alt_dma_txchan_list); - -/* - * alt_dma_txchan_open() is used to obtain an "alt_dma_txchan" descriptor for - * a DMA transmit device. The name is the name of the associated physical - * device (e.g. "/dev/dma_0"). - * - * The return value will be NULL on failure, and non-NULL otherwise. - */ - -alt_dma_txchan alt_dma_txchan_open (const char* name) -{ - alt_dma_txchan dev; - - dev = (alt_dma_txchan) alt_find_dev (name, &alt_dma_txchan_list); - - if (!dev) - { - ALT_ERRNO = ENODEV; - } - - return dev; -} diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_do_ctors.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_do_ctors.c deleted file mode 100644 index ff5a1f7..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_do_ctors.c +++ /dev/null @@ -1,64 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT IT DIRECTLY. * -* * -* Overriding HAL Functions * -* * -* To provide your own implementation of a HAL function, include the file in * -* your Nios II IDE application project. When building the executable, the * -* Nios II IDE finds your function first, and uses it in place of the HAL * -* version. * -* * -******************************************************************************/ - -/* - * - */ - -typedef void (*constructor) (void); -extern constructor __CTOR_LIST__[]; -extern constructor __CTOR_END__[]; - -/* - * Run the C++ static constructors. - */ - -void _do_ctors(void) -{ - constructor* ctor; - - for (ctor = &__CTOR_END__[-1]; ctor >= __CTOR_LIST__; ctor--) - (*ctor) (); -} diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_do_dtors.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_do_dtors.c deleted file mode 100644 index 565c99f..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_do_dtors.c +++ /dev/null @@ -1,64 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT IT DIRECTLY. * -* * -* Overriding HAL Functions * -* * -* To provide your own implementation of a HAL function, include the file in * -* your Nios II IDE application project. When building the executable, the * -* Nios II IDE finds your function first, and uses it in place of the HAL * -* version. * -* * -******************************************************************************/ - -/* - * - */ - -typedef void (*destructor) (void); -extern destructor __DTOR_LIST__[]; -extern destructor __DTOR_END__[]; - -/* - * Run the C++ static destructors. - */ - -void _do_dtors(void) -{ - destructor* dtor; - - for (dtor = &__DTOR_END__[-1]; dtor >= __DTOR_LIST__; dtor--) - (*dtor) (); -} diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_env_lock.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_env_lock.c deleted file mode 100644 index fc25a0c..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_env_lock.c +++ /dev/null @@ -1,53 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -/* - * These are the empty env lock/unlock stubs required by newlib. These are - * used to make accesses to environment variables thread safe. The default HAL - * configuration is single threaded, so there is nothing to do here. Note that - * this requires that environment variables are never manipulated by an interrupt - * service routine. - */ - -void __env_lock ( struct _reent *_r ) -{ -} - -/* - * - */ - -void __env_unlock ( struct _reent *_r ) -{ -} diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_environ.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_environ.c deleted file mode 100644 index 404efc4..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_environ.c +++ /dev/null @@ -1,42 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "os/alt_syscall.h" - -/* - * These are the environment variables passed to the C code. By default there - * are no variables registered. An application can manipulate this list using - * getenv() and setenv(). - */ - -char *__env[1] = { 0 }; -char **ALT_ENVIRON = __env; diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_errno.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_errno.c deleted file mode 100644 index 1d8368d..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_errno.c +++ /dev/null @@ -1,44 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/* - * This file defines the alt_errno global variable. See comments in - * alt_errno.h for the use of this variable. - */ - - -#include "sys/alt_errno.h" -#include "alt_types.h" - -extern int ALT_WEAK *__errno (void); - -int* (*alt_errno) (void) = __errno; diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_exception_entry.S b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_exception_entry.S deleted file mode 100644 index 3afab93..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_exception_entry.S +++ /dev/null @@ -1,360 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2008 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "system.h" - -/* - * This is the exception entry point code, which saves all the caller saved - * registers and then handles the appropriate exception. It should be pulled - * in using a .globl from all the exception handler routines. This scheme is - * used so that if an interrupt is never registered, then this code will not - * appear in the generated executable, thereby improving code footprint. - * - * If an external interrpt controller (EIC) is present, it will supply an - * interrupt vector address to the processor when an interrupt occurs. For - * The Altera Vectored Interrupt Controller (VIC) driver will establish a - * vector table and the processor will jump directly to the appropriate - * table entry, funnel routine, and then user ISR. This will bypass this code - * in entirety. This code might still be linked into a system with an EIC, - * but would then be used only for non-interrupt exceptions. - */ - - /* - * Explicitly allow the use of r1 (the assembler temporary register) - * within this code. This register is normally reserved for the use of - * the assembler. - */ - .set noat - - /* - * The top and bottom of the exception stack - */ -#ifdef ALT_EXCEPTION_STACK - - .globl __alt_exception_stack_pointer - -#ifdef ALT_STACK_CHECK - - .globl __alt_exception_stack_limit - - /* - * We need to store the value of the stack limit after interrupt somewhere. - */ - .globl alt_exception_old_stack_limit - -#endif -#endif - - .section .exceptions.entry.label, "xa" - - .globl alt_exception - .type alt_exception, @function -alt_exception: - - .section .exceptions.entry, "xa" - -#ifdef ALT_EXCEPTION_STACK - -#ifdef ALT_STACK_CHECK - stw et, %gprel(alt_exception_old_stack_limit)(gp) -#endif - - movhi et, %hiadj(__alt_exception_stack_pointer - 80) - addi et, et, %lo(__alt_exception_stack_pointer - 80) - stw sp, 76(et) - mov sp, et - -#ifdef ALT_STACK_CHECK - movhi et, %hiadj(__alt_exception_stack_limit) - addi et, et, %lo(__alt_exception_stack_limit) - stw et, %gprel(alt_stack_limit_value)(gp) -#endif - -#else - /* - * Process an exception. For all exceptions we must preserve all - * caller saved registers on the stack (See the Nios2 ABI - * documentation for details). - */ - - addi sp, sp, -76 - -#ifdef ALT_STACK_CHECK - - bltu sp, et, .Lstack_overflow - -#endif - -#endif - - stw ra, 0(sp) - - /* - * Leave a gap in the stack frame at 4(sp) for the muldiv handler to - * store zero into. - */ - - stw r1, 8(sp) - stw r2, 12(sp) - stw r3, 16(sp) - stw r4, 20(sp) - stw r5, 24(sp) - stw r6, 28(sp) - stw r7, 32(sp) - - rdctl r5, estatus - - stw r8, 36(sp) - stw r9, 40(sp) - stw r10, 44(sp) - stw r11, 48(sp) - stw r12, 52(sp) - stw r13, 56(sp) - stw r14, 60(sp) - stw r15, 64(sp) - - /* - * ea-4 contains the address of the instruction being executed - * when the exception occured. For interrupt exceptions, we will - * will be re-issue the isntruction. Store it in 72(sp) - */ - stw r5, 68(sp) /* estatus */ - addi r15, ea, -4 /* instruction that caused exception */ - stw r15, 72(sp) - - /* - * The interrupt testing code (.exceptions.irqtest) will be - * linked here. If the Internal Interrupt Controller (IIC) is - * present (an EIC is not present), the presense of an interrupt - * is determined by examining CPU control registers or an interrupt - * custom instruction, if present. - * - * If the IIC is used and an interrupt is active, the code linked - * here will call the HAL IRQ handler (alt_irq_handler()) which - * successively calls registered interrupt handler(s) until no - * interrupts remain pending. It then jumps to .exceptions.exit. If - * there is no interrupt then it continues to .exception.notirq, below. - */ - - .section .exceptions.notirq, "xa" - - /* - * Prepare to service unimplemtned instructions or traps, - * each of which is optionally inked into section .exceptions.soft, - * which will preceed .exceptions.unknown below. - * - * Unlike interrupts, we want to skip the exception-causing instructon - * upon completion, so we write ea (address of instruction *after* - * the one where the exception occured) into 72(sp). The actual - * instruction that caused the exception is written in r2, which these - * handlers will utilize. - */ - stw ea, 72(sp) /* Don't re-issue */ - ldw r2, -4(ea) /* Instruction that caused exception */ - - /* - * Other exception handling code, if enabled, will be linked here. - * This includes unimplemted (multiply/divide) instruction support - * (a BSP generaton option), and a trap handler (that would typically - * be augmented with user-specific code). These are not linked in by - * default. - */ - - /* - * In the context of linker sections, "unknown" are all exceptions - * not handled by the built-in handlers above (interupt, and trap or - * unimplemented instruction decoding, if enabled). - * - * Advanced exception types can be serviced by registering a handler. - * To do so, enable the "Enable Instruction-related Exception API" HAL - * BSP setting. If this setting is disabled, this handler code will - * either break (if the debug core is present) or enter an infinite - * loop because we don't how how to handle the exception. - */ - .section .exceptions.unknown -#ifdef ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API - /* - * The C-based HAL routine alt_instruction_exception_entry() will - * attempt to service the exception by calling a user-registered - * exception handler using alt_instruction_exception_register(). - * If no handler was registered it will either break (if the - * debugger is present) or go into an infinite loop since the - * handling behavior is undefined; in that case we will not return here. - */ - - /* Load exception-causing address as first argument (r4) */ - addi r4, ea, -4 - - /* Call the instruction-exception entry */ - call alt_instruction_exception_entry - - /* - * If alt_instruction_exception_entry() returned, the exception was - * serviced by a user-registered routine. Its return code (now in r2) - * indicates whether to re-issue or skip the exception-causing - * instruction - * - * Return code was 0: Skip. The instruction after the exception is - * already stored in 72(sp). - */ - bne r2, r0, .Lexception_exit - - /* - * Otherwise, modify 72(sp) to re-issue the instruction that caused the - * exception. - */ - addi r15, ea, -4 /* instruction that caused exception */ - stw r15, 72(sp) - -#else /* ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API disabled */ - - /* - * We got here because an instruction-related exception occured, but the - * handler API was not compiled in. We do not presume to know how to - * handle it. If the debugger is present, break, otherwise hang. - * - * If you get here then one of the following could have happened: - * - * - An instruction-generated exception occured, and the processor - * does not have the extra exceptions feature enabled, or you - * have not registered a handler using - * alt_instruction_exception_register() - * - * Some examples of instruction-generated exceptions and why they - * might occur: - * - * - Your program could have been compiled for a full-featured - * Nios II core, but it is running on a smaller core, and - * instruction emulation has been disabled by defining - * ALT_NO_INSTRUCTION_EMULATION. - * - * You can work around the problem by re-enabling instruction - * emulation, or you can figure out why your program is being - * compiled for a system other than the one that it is running on. - * - * - Your program has executed a trap instruction, but has not - * implemented a handler for this instruction. - * - * - Your program has executed an illegal instruction (one which is - * not defined in the instruction set). - * - * - Your processor includes an MMU or MPU, and you have enabled it - * before registering an exception handler to service exceptions it - * generates. - * - * The problem could also be hardware related: - * - If your hardware is broken and is generating spurious interrupts - * (a peripheral which negates its interrupt output before its - * interrupt handler has been executed will cause spurious - * interrupts) - */ -#ifdef NIOS2_HAS_DEBUG_STUB - /* - * Either tell the user now (if there is a debugger attached) or go into - * the debug monitor which will loop until a debugger is attached. - */ - break -#else - /* - * If there is no debug stub then a BREAK will probably cause a reboot. - * An infinate loop will probably be more useful. - */ -0: - br 0b -#endif /* NIOS2_HAS_DEBUG_STUB */ - -#endif /* ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API */ - - .section .exceptions.exit.label -.Lexception_exit: - - .section .exceptions.exit, "xa" - - /* - * Restore the saved registers, so that all general purpose registers - * have been restored to their state at the time the interrupt occured. - */ - - ldw r5, 68(sp) - ldw ea, 72(sp) /* This becomes the PC once eret is executed */ - ldw ra, 0(sp) - - wrctl estatus, r5 - - ldw r1, 8(sp) - ldw r2, 12(sp) - ldw r3, 16(sp) - ldw r4, 20(sp) - ldw r5, 24(sp) - ldw r6, 28(sp) - ldw r7, 32(sp) - -#ifdef ALT_EXCEPTION_STACK -#ifdef ALT_STACK_CHECK - ldw et, %gprel(alt_exception_old_stack_limit)(gp) -#endif -#endif - - ldw r8, 36(sp) - ldw r9, 40(sp) - ldw r10, 44(sp) - ldw r11, 48(sp) - ldw r12, 52(sp) - ldw r13, 56(sp) - ldw r14, 60(sp) - ldw r15, 64(sp) - -#ifdef ALT_EXCEPTION_STACK - -#ifdef ALT_STACK_CHECK - stw et, %gprel(alt_stack_limit_value)(gp) - stw zero, %gprel(alt_exception_old_stack_limit)(gp) -#endif - - ldw sp, 76(sp) - -#else - addi sp, sp, 76 - -#endif - - /* - * Return to the interrupted instruction. - */ - - eret - -#ifdef ALT_STACK_CHECK - -.Lstack_overflow: - break 3 - -#endif - diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_exception_muldiv.S b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_exception_muldiv.S deleted file mode 100644 index 55617a6..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_exception_muldiv.S +++ /dev/null @@ -1,583 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - - /* - * This is the software multiply/divide handler for Nios2. - */ - - /* - * Provide a label which can be used to pull this file in. - */ - - .section .exceptions.start - .globl alt_exception_muldiv -alt_exception_muldiv: - - /* - * Pull in the entry/exit code. - */ - .globl alt_exception - - - .section .exceptions.soft, "xa" - - - /* INSTRUCTION EMULATION - * --------------------- - * - * Nios II processors generate exceptions for unimplemented instructions. - * The routines below emulate these instructions. Depending on the - * processor core, the only instructions that might need to be emulated - * are div, divu, mul, muli, mulxss, mulxsu, and mulxuu. - * - * The emulations match the instructions, except for the following - * limitations: - * - * 1) The emulation routines do not emulate the use of the exception - * temporary register (et) as a source operand because the exception - * handler already has modified it. - * - * 2) The routines do not emulate the use of the stack pointer (sp) or the - * exception return address register (ea) as a destination because - * modifying these registers crashes the exception handler or the - * interrupted routine. - * - * 3) To save code size, the routines do not emulate the use of the - * breakpoint registers (ba and bt) as operands. - * - * Detailed Design - * --------------- - * - * The emulation routines expect the contents of integer registers r0-r31 - * to be on the stack at addresses sp, 4(sp), 8(sp), ... 124(sp). The - * routines retrieve source operands from the stack and modify the - * destination register's value on the stack prior to the end of the - * exception handler. Then all registers except the destination register - * are restored to their previous values. - * - * The instruction that causes the exception is found at address -4(ea). - * The instruction's OP and OPX fields identify the operation to be - * performed. - * - * One instruction, muli, is an I-type instruction that is identified by - * an OP field of 0x24. - * - * muli AAAAA,BBBBB,IIIIIIIIIIIIIIII,-0x24- - * 27 22 6 0 <-- LSB of field - * - * The remaining emulated instructions are R-type and have an OP field - * of 0x3a. Their OPX fields identify them. - * - * R-type AAAAA,BBBBB,CCCCC,XXXXXX,NNNNN,-0x3a- - * 27 22 17 11 6 0 <-- LSB of field - * - * - */ - - - /* - * Split the instruction into its fields. We need 4*A, 4*B, and 4*C as - * offsets to the stack pointer for access to the stored register values. - */ - /* r2 = AAAAA,BBBBB,IIIIIIIIIIIIIIII,PPPPPP */ - roli r3, r2, 7 /* r3 = BBB,IIIIIIIIIIIIIIII,PPPPPP,AAAAA,BB */ - roli r4, r3, 3 /* r4 = IIIIIIIIIIIIIIII,PPPPPP,AAAAA,BBBBB */ - roli r6, r4, 2 /* r6 = IIIIIIIIIIIIII,PPPPPP,AAAAA,BBBBB,II */ - srai r4, r4, 16 /* r4 = (sign-extended) IMM16 */ - xori r6, r6, 0x42 /* r6 = CCC,XXXXXX,NNNNN,PPPPPP,AAAAA,bBBBB,cC */ - roli r7, r6, 5 /* r7 = XXXX,NNNNN,PPPPPP,AAAAA,bBBBB,cCCCC,XX */ - andi r5, r2, 0x3f /* r5 = 00000000000000000000000000,PPPPPP */ - xori r3, r3, 0x40 - andi r3, r3, 0x7c /* r3 = 0000000000000000000000000,aAAAA,00 */ - andi r6, r6, 0x7c /* r6 = 0000000000000000000000000,bBBBB,00 */ - andi r7, r7, 0x7c /* r7 = 0000000000000000000000000,cCCCC,00 */ - - /* Now either - * r5 = OP - * r3 = 4*(A^16) - * r4 = IMM16 (sign extended) - * r6 = 4*(B^16) - * r7 = 4*(C^16) - * or - * r5 = OP - */ - - - /* - * Save everything on the stack to make it easy for the emulation routines - * to retrieve the source register operands. The exception entry code has - * already saved some of this so we don't need to do it all again. - */ - - addi sp, sp, -60 - stw zero, 64(sp) /* Save zero on stack to avoid special case for r0. */ - /* Register at and r2-r15 have already been saved. */ - - stw r16, 0(sp) - stw r17, 4(sp) - stw r18, 8(sp) - stw r19, 12(sp) - stw r20, 16(sp) - stw r21, 20(sp) - stw r22, 24(sp) - stw r23, 28(sp) - /* et @ 32 - Has already been changed.*/ - /* bt @ 36 - Usually isn't an operand. */ - stw gp, 40(sp) - stw sp, 44(sp) - stw fp, 48(sp) - /* ea @ 52 - Don't bother to save - it's already been changed */ - /* ba @ 56 - Breakpoint register usually isn't an operand */ - /* ra @ 60 - Has already been saved */ - - - /* - * Prepare for either multiplication or division loop. - * They both loop 32 times. - */ - movi r14, 32 - - - /* - * Get the operands. - * - * It is necessary to check for muli because it uses an I-type instruction - * format, while the other instructions are have an R-type format. - */ - add r3, r3, sp /* r3 = address of A-operand. */ - ldw r3, 0(r3) /* r3 = A-operand. */ - movi r15, 0x24 /* muli opcode (I-type instruction format) */ - beq r5, r15, .Lmul_immed /* muli doesn't use the B register as a source */ - - add r6, r6, sp /* r6 = address of B-operand. */ - ldw r6, 0(r6) /* r6 = B-operand. */ - /* r4 = SSSSSSSSSSSSSSSS,-----IMM16------ */ - /* IMM16 not needed, align OPX portion */ - /* r4 = SSSSSSSSSSSSSSSS,CCCCC,-OPX--,00000 */ - srli r4, r4, 5 /* r4 = 00000,SSSSSSSSSSSSSSSS,CCCCC,-OPX-- */ - andi r4, r4, 0x3f /* r4 = 00000000000000000000000000,-OPX-- */ - - /* Now - * r5 = OP - * r3 = src1 - * r6 = src2 - * r4 = OPX (no longer can be muli) - * r7 = 4*(C^16) - * r14 = loop counter - */ - - /* ILLEGAL-INSTRUCTION EXCEPTION - * ----------------------------- - * - * This code is for Nios II cores that generate exceptions when attempting - * to execute illegal instructions. Nios II cores that support an - * illegal-instruction exception are identified by the presence of the - * macro definition NIOS2_HAS_ILLEGAL_INSTRUCTION_EXCEPTION in system.h . - * - * Remember that illegal instructions are different than unimplemented - * instructions. Illegal instructions are instruction encodings that - * have not been defined by the Nios II ISA. Unimplemented instructions - * are legal instructions that must be emulated by some Nios II cores. - * - * If we get here, all instructions except multiplies and divides - * are illegal. - * - * This code assumes that OP is not muli (because muli was tested above). - * All other multiplies and divides are legal. Anything else is illegal. - */ - - movi r8, 0x3a /* OP for R-type mul* and div* */ - bne r5, r8, .Lnot_muldiv - - /* r15 already is 0x24 */ /* OPX of divu */ - beq r4, r15, .Ldivide - - movi r15,0x27 /* OPX of mul */ - beq r4, r15, .Lmultiply - - movi r15,0x07 /* OPX of mulxuu */ - beq r4, r15, .Lmultiply - - movi r15,0x17 /* OPX of mulxsu */ - beq r4, r15, .Lmultiply - - movi r15,0x1f /* OPX of mulxss */ - beq r4, r15, .Lmultiply - - movi r15,0x25 /* OPX of div */ - bne r4, r15, .Lnot_muldiv - - - /* DIVISION - * - * Divide an unsigned dividend by an unsigned divisor using - * a shift-and-subtract algorithm. The example below shows - * 43 div 7 = 6 for 8-bit integers. This classic algorithm uses a - * single register to store both the dividend and the quotient, - * allowing both values to be shifted with a single instruction. - * - * remainder dividend:quotient - * --------- ----------------- - * initialize 00000000 00101011: - * shift 00000000 0101011:_ - * remainder >= divisor? no 00000000 0101011:0 - * shift 00000000 101011:0_ - * remainder >= divisor? no 00000000 101011:00 - * shift 00000001 01011:00_ - * remainder >= divisor? no 00000001 01011:000 - * shift 00000010 1011:000_ - * remainder >= divisor? no 00000010 1011:0000 - * shift 00000101 011:0000_ - * remainder >= divisor? no 00000101 011:00000 - * shift 00001010 11:00000_ - * remainder >= divisor? yes 00001010 11:000001 - * remainder -= divisor - 00000111 - * ---------- - * 00000011 11:000001 - * shift 00000111 1:000001_ - * remainder >= divisor? yes 00000111 1:0000011 - * remainder -= divisor - 00000111 - * ---------- - * 00000000 1:0000011 - * shift 00000001 :0000011_ - * remainder >= divisor? no 00000001 :00000110 - * - * The quotient is 00000110. - */ - -.Ldivide: - /* - * Prepare for division by assuming the result - * is unsigned, and storing its "sign" as 0. - */ - movi r17, 0 - - - /* Which division opcode? */ - xori r15, r4, 0x25 /* OPX of div */ - bne r15, zero, .Lunsigned_division - - - /* - * OPX is div. Determine and store the sign of the quotient. - * Then take the absolute value of both operands. - */ - xor r17, r3, r6 /* MSB contains sign of quotient */ - bge r3, zero, 0f - sub r3, zero, r3 /* -r3 */ -0: - bge r6, zero, 0f - sub r6, zero, r6 /* -r6 */ -0: - - -.Lunsigned_division: - /* Initialize the unsigned-division loop. */ - movi r13, 0 /* remainder = 0 */ - - /* Now - * r3 = dividend : quotient - * r4 = 0x25 for div, 0x24 for divu - * r6 = divisor - * r13 = remainder - * r14 = loop counter (already initialized to 32) - * r17 = MSB contains sign of quotient - */ - - - /* - * for (count = 32; count > 0; --count) - * { - */ -.Ldivide_loop: - - /* - * Division: - * - * (remainder:dividend:quotient) <<= 1; - */ - slli r13, r13, 1 - cmplt r15, r3, zero /* r15 = MSB of r3 */ - or r13, r13, r15 - slli r3, r3, 1 - - - /* - * if (remainder >= divisor) - * { - * set LSB of quotient - * remainder -= divisor; - * } - */ - bltu r13, r6, .Ldiv_skip - ori r3, r3, 1 - sub r13, r13, r6 -.Ldiv_skip: - - /* - * } - */ - subi r14, r14, 1 - bne r14, zero, .Ldivide_loop - - mov r9, r3 - - - /* Now - * r9 = quotient - * r4 = 0x25 for div, 0x24 for divu - * r7 = 4*(C^16) - * r17 = MSB contains sign of quotient - */ - - - /* - * Conditionally negate signed quotient. If quotient is unsigned, - * the sign already is initialized to 0. - */ - bge r17, zero, .Lstore_result - sub r9, zero, r9 /* -r9 */ - - br .Lstore_result - - - - - /* MULTIPLICATION - * - * A "product" is the number that one gets by summing a "multiplicand" - * several times. The "multiplier" specifies the number of copies of the - * multiplicand that are summed. - * - * Actual multiplication algorithms don't use repeated addition, however. - * Shift-and-add algorithms get the same answer as repeated addition, and - * they are faster. To compute the lower half of a product (pppp below) - * one shifts the product left before adding in each of the partial products - * (a * mmmm) through (d * mmmm). - * - * To compute the upper half of a product (PPPP below), one adds in the - * partial products (d * mmmm) through (a * mmmm), each time following the - * add by a right shift of the product. - * - * mmmm - * * abcd - * ------ - * #### = d * mmmm - * #### = c * mmmm - * #### = b * mmmm - * #### = a * mmmm - * -------- - * PPPPpppp - * - * The example above shows 4 partial products. Computing actual Nios II - * products requires 32 partials. - * - * It is possible to compute the result of mulxsu from the result of mulxuu - * because the only difference between the results of these two opcodes is - * the value of the partial product associated with the sign bit of rA. - * - * mulxsu = mulxuu - ((rA < 0) ? rB : 0); - * - * It is possible to compute the result of mulxss from the result of mulxsu - * because the only difference between the results of these two opcodes is - * the value of the partial product associated with the sign bit of rB. - * - * mulxss = mulxsu - ((rB < 0) ? rA : 0); - * - */ - -.Lmul_immed: - /* Opcode is muli. Change it into mul for remainder of algorithm. */ - mov r7, r6 /* Field B is dest register, not field C. */ - mov r6, r4 /* Field IMM16 is src2, not field B. */ - movi r4, 0x27 /* OPX of mul is 0x27 */ - -.Lmultiply: - /* Initialize the multiplication loop. */ - movi r9, 0 /* mul_product = 0 */ - movi r10, 0 /* mulxuu_product = 0 */ - mov r11, r6 /* save original multiplier for mulxsu and mulxss */ - mov r12, r6 /* mulxuu_multiplier (will be shifted) */ - movi r16, 1 /* used to create "rori B,A,1" from "ror B,A,r16" */ - - /* Now - * r3 = multiplicand - * r6 = mul_multiplier - * r7 = 4 * dest_register (used later as offset to sp) - * r9 = mul_product - * r10 = mulxuu_product - * r11 = original multiplier - * r12 = mulxuu_multiplier - * r14 = loop counter (already initialized) - * r15 = temp - * r16 = 1 - */ - - - /* - * for (count = 32; count > 0; --count) - * { - */ -.Lmultiply_loop: - - /* - * mul_product <<= 1; - * lsb = multiplier & 1; - */ - slli r9, r9, 1 - andi r15, r12, 1 - - /* - * if (lsb == 1) - * { - * mulxuu_product += multiplicand; - * } - */ - beq r15, zero, .Lmulx_skip - add r10, r10, r3 - cmpltu r15, r10, r3 /* Save the carry from the MSB of mulxuu_product. */ - ror r15, r15, r16 /* r15 = 0x80000000 on carry, or else 0x00000000 */ -.Lmulx_skip: - - /* - * if (MSB of mul_multiplier == 1) - * { - * mul_product += multiplicand; - * } - */ - bge r6, zero, .Lmul_skip - add r9, r9, r3 -.Lmul_skip: - - /* - * mulxuu_product >>= 1; logical shift - * mul_multiplier <<= 1; done with MSB - * mulx_multiplier >>= 1; done with LSB - */ - srli r10, r10, 1 - or r10, r10, r15 /* OR in the saved carry bit. */ - slli r6, r6, 1 - srli r12, r12, 1 - - - /* - * } - */ - subi r14, r14, 1 - bne r14, zero, .Lmultiply_loop - - - /* - * Multiply emulation loop done. - */ - - /* Now - * r3 = multiplicand - * r4 = OPX - * r7 = 4 * dest_register (used later as offset to sp) - * r9 = mul_product - * r10 = mulxuu_product - * r11 = original multiplier - * r15 = temp - */ - - - /* - * Select/compute the result based on OPX. - */ - - - /* OPX == mul? Then store. */ - xori r15, r4, 0x27 - beq r15, zero, .Lstore_result - - /* It's one of the mulx.. opcodes. Move over the result. */ - mov r9, r10 - - /* OPX == mulxuu? Then store. */ - xori r15, r4, 0x07 - beq r15, zero, .Lstore_result - - /* Compute mulxsu - * - * mulxsu = mulxuu - ((rA < 0) ? rB : 0); - */ - bge r3, zero, .Lmulxsu_skip - sub r9, r9, r11 -.Lmulxsu_skip: - - /* OPX == mulxsu? Then store. */ - xori r15, r4, 0x17 - beq r15, zero, .Lstore_result - - /* Compute mulxss - * - * mulxss = mulxsu - ((rB < 0) ? rA : 0); - */ - bge r11, zero, .Lmulxss_skip - sub r9, r9, r3 -.Lmulxss_skip: - /* At this point, assume that OPX is mulxss, so store */ - - -.Lstore_result: - add r7, r7, sp - stw r9, 0(r7) - - ldw r16, 0(sp) - ldw r17, 4(sp) - ldw r18, 8(sp) - ldw r19, 12(sp) - ldw r20, 16(sp) - ldw r21, 20(sp) - ldw r22, 24(sp) - ldw r23, 28(sp) - - /* bt @ 32 - Breakpoint register usually isn't an operand. */ - /* et @ 36 - Don't corrupt et. */ - /* gp @ 40 - Don't corrupt gp. */ - /* sp @ 44 - Don't corrupt sp. */ - ldw fp, 48(sp) - /* ea @ 52 - Don't corrupt ea. */ - /* ba @ 56 - Breakpoint register usually isn't an operand. */ - - addi sp, sp, 60 - - br .Lexception_exit - - -.Lnot_muldiv: - - addi sp, sp, 60 - - - .section .exceptions.exit.label -.Lexception_exit: - diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_exception_trap.S b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_exception_trap.S deleted file mode 100644 index 60a3d40..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_exception_trap.S +++ /dev/null @@ -1,81 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - - /* - * This is the trap exception handler for Nios2. - */ - - /* - * Provide a label which can be used to pull this file in. - */ - - .section .exceptions.start - .globl alt_exception_trap -alt_exception_trap: - - /* - * Pull in the entry/exit code. - */ - .globl alt_exception - - .section .exceptions.soft, "xa" - -.Ltrap_handler: - - /* - * Did a trap instruction cause the exception? - * - * The instruction which the exception occurred on has been loaded - * into r2 by code in alt_exception_entry.S - * - */ - - movhi r3,0x003b /* upper half of trap opcode */ - ori r3,r3,0x683a /* lower half of trap opcode */ - bne r2,r3,.Lnot_trap - - /* - * There is no trap handler defined here, and so executing a trap - * instruction causes a software break. If you provide a trap handler, - * then you must replace the break instruction below with your handler. - * Your handler must preserve ea and the usual callee saved registers. - */ - - break - - br .Lexception_exit - -.Lnot_trap: - - - .section .exceptions.exit.label -.Lexception_exit: - - diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_execve.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_execve.c deleted file mode 100644 index 27b99cf..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_execve.c +++ /dev/null @@ -1,55 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "os/alt_syscall.h" - -/* - * execve() is used by newlib to launch new processes. This is unsupported in - * the HAL environment. However a "do-nothing" implementation is still - * provied for newlib compatability. - * - * ALT_EXECVE is mapped onto the execve() system call in alt_syscall.h - */ - -int ALT_EXECVE (char *name, char ** argv, char** env) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(execve); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_exit.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_exit.c deleted file mode 100644 index 971b35e..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_exit.c +++ /dev/null @@ -1,71 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_irq.h" -#include "sys/alt_sim.h" -#include "os/alt_hooks.h" -#include "os/alt_syscall.h" - -#include "alt_types.h" -#include "sys/alt_log_printf.h" -/* - * _exit() is called by exit() in order to terminate the current process. - * Typically this is called when main() completes. It should never return. - * Since there is nowhere to go once this process completes, this - * implementation simply blocks forever. - * - * Note that interrupts are not disabled so that execution outside of this - * thread is allowed to continue. - * - * ALT_EXIT is mapped onto the _exit() system call in alt_syscall.h - */ - -void ALT_EXIT (int exit_code) -{ - /* ALT_LOG - please see HAL/inc/alt_log_printf.h for details */ - ALT_LOG_PRINT_BOOT("[alt_exit.c] Entering _exit() function.\r\n"); - ALT_LOG_PRINT_BOOT("[alt_exit.c] Exit code from main was %d.\r\n",exit_code); - /* Stop all other threads */ - - ALT_LOG_PRINT_BOOT("[alt_exit.c] Calling ALT_OS_STOP().\r\n"); - ALT_OS_STOP(); - - /* Provide notification to the simulator that we've stopped */ - - ALT_LOG_PRINT_BOOT("[alt_exit.c] Calling ALT_SIM_HALT().\r\n"); - ALT_SIM_HALT(exit_code); - - /* spin forever, since there's no where to go back to */ - - ALT_LOG_PRINT_BOOT("[alt_exit.c] Spinning forever.\r\n"); - while (1); -} diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_fcntl.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_fcntl.c deleted file mode 100644 index 69c1544..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_fcntl.c +++ /dev/null @@ -1,101 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include -#include - -#include "sys/alt_errno.h" -#include "priv/alt_file.h" -#include "alt_types.h" -#include "os/alt_syscall.h" - -#define ALT_FCNTL_FLAGS_MASK ((alt_u32) (O_APPEND | O_NONBLOCK)) - -/* - * fcntl() is a limited implementation of the standard fcntl() system call. - * It can be used to change the state of the flags associated with an open - * file descriptor. Normally these flags are set during the call to - * open(). It is anticipated that the main use of this function will be to - * change the state of a device from blocking to non-blocking (where this is - * supported). - * - * The input argument "fd" is the file descriptor to be manipulated. "cmd" - * is the command to execute. This can be either F_GETFL (return the - * current value of the flags) or F_SETFL (set the value of the flags). - * - * If "cmd" is F_SETFL then the argument "arg" is the new value of flags, - * otherwise "arg" is ignored. Only the flags: O_APPEND and O_NONBLOCK - * can be updated by a call to fcntl(). All other flags remain - * unchanged. - * - * ALT_FCNTL is mapped onto the fcntl() system call in alt_syscall.h - */ - -int ALT_FCNTL (int file, int cmd, ...) -{ - alt_fd* fd; - long flags; - va_list argp; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - switch (cmd) - { - case F_GETFL: - return fd->fd_flags & ~((alt_u32) ALT_FD_FLAGS_MASK); - case F_SETFL: - va_start(argp, cmd); - flags = va_arg(argp, long); - fd->fd_flags &= ~ALT_FCNTL_FLAGS_MASK; - fd->fd_flags |= (flags & ALT_FCNTL_FLAGS_MASK); - va_end(argp); - return 0; - default: - ALT_ERRNO = EINVAL; - return -1; - } - } - - ALT_ERRNO = EBADFD; - return -1; -} diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_fd_lock.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_fd_lock.c deleted file mode 100644 index 0e2a85d..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_fd_lock.c +++ /dev/null @@ -1,75 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "priv/alt_file.h" - -/* - * alt_fd_lock() is called as a consequence of an ioctl call to gain exclusive - * access to a device, i.e.: - * - * ioctl (fd, TIOCEXCL, NULL); - * - * If there are no other open file descriptors which reference the same - * device, then alt_fd_lock() will grant the lock. Further calls to open() - * for this device will fail until the lock is released. - * - * This is done by calling close() for this file descriptor, or by calling: - * - * ioctl (fd, TIOCNXCL, NULL); - * - * The return value is zero for success, or negative in the case of failure. - */ - -int alt_fd_lock (alt_fd* fd) -{ - int i; - int rc = 0; - - ALT_SEM_PEND(alt_fd_list_lock, 0); - - for (i = 0; i < alt_max_fd; i++) - { - if ((&alt_fd_list[i] != fd) && (alt_fd_list[i].dev == fd->dev)) - { - rc = -EACCES; - goto alt_fd_lock_exit; - } - } - fd->fd_flags |= ALT_FD_EXCL; - - alt_fd_lock_exit: - - ALT_SEM_POST(alt_fd_list_lock); - return rc; -} diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_fd_unlock.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_fd_unlock.c deleted file mode 100644 index fb700dc..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_fd_unlock.c +++ /dev/null @@ -1,56 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "priv/alt_file.h" - -/* - * alt_fd_unlock() is the inverse of alt_fd_lock(). It is called as a - * consequence of a TIOCNXCL ioctl request, e.g: - * - * ioctl (fd, TIOCNXCL, NULL); - * - * It enables multiple file descriptors to exist for the same device. This - * is normally the case, but it may have been disabled by a previous call to - * alt_fd_lock(). - * - * Return zero on sucess, and a negative value on failure. - * - * The current implementation always succeeds. - */ - -int alt_fd_unlock (alt_fd* fd) -{ - fd->fd_flags &= ~ALT_FD_EXCL; - return 0; -} diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_find_dev.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_find_dev.c deleted file mode 100644 index 37aefa4..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_find_dev.c +++ /dev/null @@ -1,88 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - -#include "alt_types.h" - -/* - * alt_find_dev() is used by open() in order to locate a previously registered - * device with the name "name". The input argument "llist" is a pointer to the - * head of the device list to search. - * - * The return value is a pointer to the matching device, or NULL if there is - * no match. - * - * "name" must be an exact match for the devices registered name for a match to - * be found. - */ - -alt_dev* alt_find_dev(const char* name, alt_llist* llist) -{ - alt_dev* next = (alt_dev*) llist->next; - alt_32 len; - - len = strlen(name) + 1; - - /* - * Check each list entry in turn, until a match is found, or we reach the - * end of the list (i.e. next winds up pointing back to the list head). - */ - - while (next != (alt_dev*) llist) - { - - /* - * memcmp() is used here rather than strcmp() in order to reduce the size - * of the executable. - */ - - if (!memcmp (next->name, name, len)) - { - /* match found */ - - return next; - } - next = (alt_dev*) next->llist.next; - } - - /* No match found */ - - return NULL; -} - - diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_find_file.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_find_file.c deleted file mode 100644 index 2d97ec2..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_find_file.c +++ /dev/null @@ -1,89 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - -#include "alt_types.h" - -/* - * alt_find_file() is used by open() in order to locate a previously registered - * filesystem that owns that mount point that contains the file named "name". - * - * The return value is a pointer to the matching filesystem, or NULL if there is - * no match. - * - * A match is considered to have been found if the filesystem name followed by - * either '/' or '\0' is the prefix of the filename. For example the filename: - * "/myfilesystem/junk.txt" would match: "/myfilesystem", but not: "/myfile". - */ - -alt_dev* alt_find_file (const char* name) -{ - alt_dev* next = (alt_dev*) alt_fs_list.next; - - alt_32 len; - - /* - * Check each list entry in turn, until a match is found, or we reach the - * end of the list (i.e. next winds up pointing back to the list head). - */ - - while (next != (alt_dev*) &alt_fs_list) - { - len = strlen(next->name); - - if (next->name[len-1] == '/') - { - len -= 1; - } - - if (((name[len] == '/') || (name[len] == '\0')) && - !memcmp (next->name, name, len)) - { - /* match found */ - - return next; - } - next = (alt_dev*) next->llist.next; - } - - /* No match found */ - - return NULL; -} - - diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_flash_dev.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_flash_dev.c deleted file mode 100644 index 213f721..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_flash_dev.c +++ /dev/null @@ -1,69 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* Alt_flash.c - Functions to register a flash device to the "generic" flash * -* interface * -* * -* Author PRR * -* * -******************************************************************************/ - -#include -#include "sys/alt_llist.h" -#include "sys/alt_flash_dev.h" -#include "priv/alt_file.h" - -ALT_LLIST_HEAD(alt_flash_dev_list); - -alt_flash_fd* alt_flash_open_dev(const char* name) -{ - alt_flash_dev* dev = (alt_flash_dev*)alt_find_dev(name, &alt_flash_dev_list); - - if ((dev) && dev->open) - { - return dev->open(dev, name); - } - - return dev; -} - -void alt_flash_close_dev(alt_flash_fd* fd) -{ - if (fd && fd->close) - { - fd->close(fd); - } - return; -} - diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_fork.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_fork.c deleted file mode 100644 index ce74df0..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_fork.c +++ /dev/null @@ -1,57 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_warning.h" -#include "sys/alt_errno.h" -#include "os/alt_syscall.h" - -/* - * The fork() system call is used by newlib to create a duplicate copy of the - * curent process. This is unsupported in the HAL environment. However a - * "do-nothing" implementation is still provied for newlib compatability. - * - * ALT_FORK is mapped onto the fork() system call in alt_syscall.h - */ - -int ALT_FORK (void) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(fork); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} - - diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_fs_reg.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_fs_reg.c deleted file mode 100644 index 13437a1..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_fs_reg.c +++ /dev/null @@ -1,75 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - -/* - * The alt_fs_reg() function is used to register a file system. Once registered - * a device can be accessed using the standard posix calls: open(), read(), - * write() etc. - * - * System behaviour is undefined in the event that a file system is registered - * with a name that conflicts with an existing device or file system. - * - * alt_fs_reg() is not thread safe in the sense that there should be no other - * thread using the file system list at the time that alt_dev_reg() is called. In - * practice this means that alt_fs_reg() should only be called while operating - * in a single threaded mode. The expectation is that it will only be called - * by the file system initilisation functions invoked by alt_sys_init(), which in - * turn should only be called by the single threaded C startup code. - * - * A return value of zero indicates success. A negative return value indicates - * failure. - */ - -int alt_fs_reg (alt_dev* dev) -{ - /* - * check that the device has a name. - */ - - if (!dev->name) - { - return -ENODEV; - } - - /* - * register the file system. - */ - - alt_llist_insert(&alt_fs_list, &dev->llist); - - return 0; -} diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_fstat.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_fstat.c deleted file mode 100644 index af5d527..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_fstat.c +++ /dev/null @@ -1,128 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include "sys/alt_dev.h" -#include "sys/alt_warning.h" -#include "sys/alt_errno.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -/* - * The fstat() system call is used to obtain information about the capabilities - * of an open file descriptor. By default file descriptors are marked as - * being character devices. If a device or file system wishes to advertise - * alternative capabilities then they can register an fstat() function within - * their associated alt_dev structure. This will be called to fill in the - * entries in the imput "st" structure. - * - * This function is provided for compatability with newlib. - * - * ALT_FSTAT is mapped onto the fstat() system call in alt_syscall.h - */ - -#ifdef ALT_USE_DIRECT_DRIVERS - -#include "system.h" - -/* - * Provide minimal version that just describes all file descriptors - * as character devices for provided stdio devices. - */ -int ALT_FSTAT (int file, struct stat *st) -{ - switch (file) { -#ifdef ALT_STDIN_PRESENT - case 0: /* stdin file descriptor */ -#endif /* ALT_STDIN_PRESENT */ -#ifdef ALT_STDOUT_PRESENT - case 1: /* stdout file descriptor */ -#endif /* ALT_STDOUT_PRESENT */ -#ifdef ALT_STDERR_PRESENT - case 2: /* stderr file descriptor */ -#endif /* ALT_STDERR_PRESENT */ - st->st_mode = _IFCHR; - return 0; - default: - return -1; - } - -#if !defined(ALT_STDIN_PRESENT) && !defined(ALT_STDOUT_PRESENT) && !defined(ALT_STDERR_PRESENT) - /* Generate a link time warning, should this function ever be called. */ - ALT_STUB_WARNING(fstat); -#endif -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -int ALT_FSTAT (int file, struct stat *st) -{ - alt_fd* fd; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - /* Call the drivers fstat() function to fill out the "st" structure. */ - - if (fd->dev->fstat) - { - return fd->dev->fstat(fd, st); - } - - /* - * If no function is provided, mark the fd as belonging to a character - * device. - */ - - else - { - st->st_mode = _IFCHR; - return 0; - } - } - else - { - ALT_ERRNO = EBADFD; - return -1; - } -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_get_fd.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_get_fd.c deleted file mode 100644 index db17b2c..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_get_fd.c +++ /dev/null @@ -1,105 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - -#include "alt_types.h" - -#include "system.h" - -/* - * alt_get_fd() is called to allocate a new file descriptor from the file - * descriptor pool. If a file descriptor is succesfully allocated, it is - * configured to refer to device "dev". - * - * The return value is the index of the file descriptor structure (i.e. - * the offset of the file descriptor within the file descriptor array). A - * negative value indicates failure. - */ - -int alt_get_fd (alt_dev* dev) -{ - alt_32 i; - int rc = -EMFILE; - - /* - * Take the alt_fd_list_lock semaphore in order to avoid races when - * accessing the file descriptor pool. - */ - - ALT_SEM_PEND(alt_fd_list_lock, 0); - - /* - * Search through the list of file descriptors, and allocate the first - * free descriptor that's found. - * - * If a free descriptor is found, then the value of "alt_max_fd" is - * updated accordingly. "alt_max_fd" is a 'highwater mark' which - * indicates the highest file descriptor ever allocated. This is used to - * improve efficency when searching the file descriptor list, and - * therefore reduce contention on the alt_fd_list_lock semaphore. - */ - - for (i = 0; i < ALT_MAX_FD; i++) - { - if (!alt_fd_list[i].dev) - { - alt_fd_list[i].dev = dev; - if (i > alt_max_fd) - { - alt_max_fd = i; - } - rc = i; - goto alt_get_fd_exit; - } - } - - alt_get_fd_exit: - - /* - * Release the alt_fd_list_lock semaphore now that we are done with the - * file descriptor pool. - */ - - ALT_SEM_POST(alt_fd_list_lock); - - return rc; -} - - - - diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_getchar.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_getchar.c deleted file mode 100644 index a8f50d5..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_getchar.c +++ /dev/null @@ -1,61 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#ifdef ALT_USE_DIRECT_DRIVERS -#include "system.h" -#include "sys/alt_driver.h" -#include "sys/alt_stdio.h" -#include "priv/alt_file.h" -#include "unistd.h" -#endif - -/* - * Uses the ALT_DRIVER_READ() macro to call directly to driver if available. - * Otherwise, uses newlib provided getchar() routine. - */ -int -alt_getchar(void) -{ -#ifdef ALT_USE_DIRECT_DRIVERS - ALT_DRIVER_READ_EXTERNS(ALT_STDIN_DEV); - char c; - - if (ALT_DRIVER_READ(ALT_STDIN_DEV, &c, 1, alt_fd_list[STDIN_FILENO].fd_flags) <= 0) { - return -1; - } - return c; -#else - return getchar(); -#endif -} diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_getpid.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_getpid.c deleted file mode 100644 index 2228c7e..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_getpid.c +++ /dev/null @@ -1,47 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "os/alt_syscall.h" - -/* - * The getpid() system call is used by newlib to obtain the current process - * id. Since there is only ever a single process in the HAL environment, - * this just returns a constant. - * - * ALT_GETPID is mapped onto the getpid() system call in alt_syscall.h - */ - -int ALT_GETPID (void) -{ - return 0; -} - diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_gettod.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_gettod.c deleted file mode 100644 index ed86cba..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_gettod.c +++ /dev/null @@ -1,125 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include - -#include "sys/alt_alarm.h" -#include "alt_types.h" -#include "os/alt_syscall.h" - -/* - * Macro defining the number of micoseconds in a second. - */ - -#define ALT_US (1000000) - -/* - * "alt_timezone" and "alt_resettime" are the values of the the reset time and - * time zone set through the last call to settimeofday(). By default they are - * zero initialised. - */ - -struct timezone alt_timezone = {0, 0}; -struct timeval alt_resettime = {0, 0}; - -/* - * gettimeofday() can be called to obtain a time structure which indicates the - * current "wall clock" time. This is calculated using the elapsed number of - * system clock ticks, and the value of "alt_resettime" and "alt_timezone" set - * through the last call to settimeofday(). - * - * Warning: if this function is called concurrently with a call to - * settimeofday(), the value returned by gettimeofday() will be unreliable. - * - * ALT_GETTIMEOFDAY is mapped onto the gettimeofday() system call in - * alt_syscall.h - */ - - -#if defined (__GNUC__) && (__GNUC__ >= 4) -int ALT_GETTIMEOFDAY (struct timeval *ptimeval, void *ptimezone_vptr) -{ - struct timezone *ptimezone = (struct timezone*)ptimezone_vptr; -#else -int ALT_GETTIMEOFDAY (struct timeval *ptimeval, struct timezone *ptimezone) -{ -#endif - - alt_u32 nticks = alt_nticks (); - alt_u32 tick_rate = alt_ticks_per_second (); - - /* - * Check to see if the system clock is running. This is indicated by a - * non-zero system clock rate. If the system clock is not running, an error - * is generated and the contents of "ptimeval" and "ptimezone" are not - * updated. - */ - - if (tick_rate) - { - ptimeval->tv_sec = alt_resettime.tv_sec + nticks/tick_rate; - ptimeval->tv_usec = alt_resettime.tv_usec + - (alt_u32)(((alt_u64)nticks*(ALT_US/tick_rate))%ALT_US); - - while(ptimeval->tv_usec < 0) { - if (ptimeval->tv_sec <= 0) - { - ptimeval->tv_sec = 0; - ptimeval->tv_usec = 0; - break; - } - else - { - ptimeval->tv_sec--; - ptimeval->tv_usec += ALT_US; - } - } - - while(ptimeval->tv_usec >= ALT_US) { - ptimeval->tv_sec++; - ptimeval->tv_usec -= ALT_US; - } - - if (ptimezone) - { - ptimezone->tz_minuteswest = alt_timezone.tz_minuteswest; - ptimezone->tz_dsttime = alt_timezone.tz_dsttime; - } - - return 0; - } - - return -ENOTSUP; -} - diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_gmon.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_gmon.c deleted file mode 100644 index 6add9f1..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_gmon.c +++ /dev/null @@ -1,272 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include -#include -#include - -#include "priv/nios2_gmon_data.h" - -#include "sys/alt_irq.h" -#include "sys/alt_alarm.h" - - -/* Macros */ - -/* How large should the bins be which we use to generate the histogram */ -#define PCSAMPLE_BYTES_PER_BUCKET 32 - -#define NIOS2_READ_EA(dest) __asm__ ("mov %0, ea" : "=r" (dest)) - -/* The compiler inserts calls to mcount() at the start of - * every function call. The structure mcount_fn_arc records t - * he return address of the function called (in from_pc) - * and the return address of the mcount function - * (in self_pc). The number of times this arc is executed is - * recorded in the field count. - */ -struct mcount_fn_arc -{ - struct mcount_fn_arc * next; - void * from_pc; - unsigned int count; -}; - -/* We need to maintain a list of pointers to the heads of each adjacency - * list so that we can find them when writing out the gmon.out file. Since - * we don't know at the start of program execution how many functions will - * be called we use a list structure to do this. - */ -struct mcount_fn_entry -{ - struct mcount_fn_entry * next; - void * self_pc; - struct mcount_fn_arc * arc_head; -}; - -/* function prototypes */ - -void __mcount_record(void * self_pc, void * from_pc, struct mcount_fn_entry * fn_entry, struct mcount_fn_entry * * fn_head) __attribute__ ((no_instrument_function)); - -static __inline__ void * mcount_allocate(unsigned int size) __attribute__ ((no_instrument_function)); -static int nios2_pcsample_init(void) __attribute__ ((no_instrument_function)); -static alt_u32 nios2_pcsample(void* alarm) __attribute__ ((no_instrument_function)); - -/* global variables */ - -/* stext and etext are defined in the linker script */ -extern char stext[]; -extern char etext[]; - -/* Is the PC sampling stuff enabled yet? */ -static int pcsample_need_init = 1; - -#define HASH_BUCKETS 64 /* Must be a power of 2 */ - -/* This points to the list of adjacency list pointers. */ -struct mcount_fn_entry * __mcount_fn_head[HASH_BUCKETS]; - -/* pointer to the in-memory buffer containing the histogram */ -static unsigned short* s_pcsamples = 0; - -/* the address of the start and end of text section */ -static const unsigned int s_low_pc = (unsigned int)stext; -static const unsigned int s_high_pc = (unsigned int)etext; - -/* the alarm structure to register for pc sampling */ -static alt_alarm s_nios2_pcsample_alarm; - -unsigned int alt_gmon_data[GMON_DATA_SIZE] = -{ - 0x6e6f6d67, /* "gmon" */ - GMON_DATA_SIZE, - 0, - (unsigned int)stext, - (unsigned int)etext, - PCSAMPLE_BYTES_PER_BUCKET, - 0, - (unsigned int)__mcount_fn_head, - (unsigned int)(__mcount_fn_head + HASH_BUCKETS) -}; - -/* This holds the current slab of memory we're allocating out of */ -static char * mcount_slab_ptr = 0; -static int mcount_slab_size = 0; - -#define MCOUNT_SLAB_INCREMENT 1020 - - -/* - * We can't use malloc to allocate memory because that's too complicated, and - * can't be called at interrupt time. Use the lower level allocator instead - * because that's interrupt safe (and because we never free anything). - * - * For speed, we allocate a block of data at once. - */ -static __inline__ void * mcount_allocate(unsigned int size) -{ - void * data; - - if (size > mcount_slab_size) - { - mcount_slab_ptr = sbrk(MCOUNT_SLAB_INCREMENT); - mcount_slab_size = MCOUNT_SLAB_INCREMENT; - } - - data = mcount_slab_ptr; - mcount_slab_ptr += size; - mcount_slab_size -= size; - - return data; -} - - -/* - * Add the arc with the values of frompc and topc given to the graph. - * This function might be called at interrupt time so must be able to - * cope with reentrancy. - * - * The fast case, where we have already allocated a function arc, has been - * handled by the assmebler code. - */ -void __mcount_record(void * self_pc, void * from_pc, struct mcount_fn_entry * fn_entry, struct mcount_fn_entry * * fn_head) -{ - alt_irq_context context; - struct mcount_fn_arc * arc_entry; - - /* Keep trying to start up the PC sampler until it is running. - * (It can't start until the timer is going). - */ - if (pcsample_need_init) - { - pcsample_need_init = 0; - pcsample_need_init = nios2_pcsample_init(); - } - - /* - * We must disable interrupts around the allocation and the list update to - * prevent corruption if the instrumented function is re-entrant. - * - * It's safe for the code above to be stepping through the chain and be - * interrupted by this code modifying it - there is an edge case which will - * leave two copies of the same arc on the list (both with count=1), but - * this is dealt with on the host. - */ - context = alt_irq_disable_all(); - - if (fn_entry == NULL) - { - /* Add it to the list of functions we must output later. */ - fn_entry = (struct mcount_fn_entry *)mcount_allocate(sizeof(struct mcount_fn_entry)); - - fn_entry->self_pc = self_pc; - fn_entry->arc_head = NULL; - - fn_entry->next = *fn_head; - *fn_head = fn_entry; - } - - /* We will need a new list entry - if there was a list entry before - * then the assembler code would have handled it. */ - arc_entry = (struct mcount_fn_arc *)mcount_allocate(sizeof(struct mcount_fn_arc)); - - arc_entry->from_pc = from_pc; - arc_entry->count = 1; - - arc_entry->next = fn_entry->arc_head; - fn_entry->arc_head = arc_entry; - - alt_irq_enable_all(context); -} - - -/* - * nios2_pcsample_init starts profiling. - * It is called the first time mcount is called, and on subsequent calls to - * mcount until it returns zero. It initializes the pc histogram and turns on - * timer driven pc sampling. - */ -static int nios2_pcsample_init(void) -{ - unsigned int pcsamples_size; - - /* We sample the PC every tick */ - unsigned int prof_rate = alt_ticks_per_second(); - if (prof_rate == 0) - return 1; - - /* allocate the histogram buffer s_pcsamples */ - pcsamples_size = (s_high_pc - s_low_pc)/PCSAMPLE_BYTES_PER_BUCKET; - s_pcsamples = (unsigned short*)sbrk(pcsamples_size * sizeof(unsigned short)); - - if (s_pcsamples != 0) - { - /* initialize the buffer to zero */ - memset(s_pcsamples, 0, pcsamples_size * sizeof(unsigned short)); - - alt_gmon_data[GMON_DATA_PROFILE_DATA] = (int)s_pcsamples; - alt_gmon_data[GMON_DATA_PROFILE_RATE] = prof_rate; - - /* Sample every tick (it's cheap) */ - alt_alarm_start(&s_nios2_pcsample_alarm, 1, nios2_pcsample, 0); - } - - return 0; -} - - -/* - * Sample the PC value and store it in the histogram - */ -static alt_u32 nios2_pcsample(void* context) -{ - unsigned int pc; - unsigned int bucket; - - /* read the exception return address - this will be - * inaccurate if there are nested interrupts but we - * assume that this is rare and the inaccuracy will - * not be great */ - NIOS2_READ_EA(pc); - - /* - * If we're within the profilable range then increment the relevant - * bucket in the histogram - */ - if (pc >= s_low_pc && pc < s_high_pc && s_pcsamples != 0) - { - bucket = (pc - s_low_pc)/PCSAMPLE_BYTES_PER_BUCKET; - s_pcsamples[bucket]++; - } - - /* Sample every tick */ - return 1; -} - diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_icache_flush.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_icache_flush.c deleted file mode 100644 index 4b706ed..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_icache_flush.c +++ /dev/null @@ -1,84 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "nios2.h" -#include "system.h" - -#include "alt_types.h" -#include "sys/alt_cache.h" - -/* - * alt_icache_flush() is called to flush the instruction cache for a memory - * region of length "len" bytes, starting at address "start". - */ - -void alt_icache_flush (void* start, alt_u32 len) -{ -#if NIOS2_ICACHE_SIZE > 0 - - char* i; - char* end; - - /* - * This is the most we would ever need to flush. - */ - - if (len > NIOS2_ICACHE_SIZE) - { - len = NIOS2_ICACHE_SIZE; - } - - end = ((char*) start) + len; - - for (i = start; i < end; i+= NIOS2_ICACHE_LINE_SIZE) - { - __asm__ volatile ("flushi %0" :: "r" (i)); - } - - /* - * For an unaligned flush request, we've got one more line left. - * Note that this is dependent on NIOS2_ICACHE_LINE_SIZE to be a - * multiple of 2 (which it always is). - */ - - if (((alt_u32) start) & (NIOS2_ICACHE_LINE_SIZE - 1)) - { - __asm__ volatile ("flushi %0" :: "r" (i)); - } - - /* - * Having flushed the cache, flush any stale instructions in the - * pipeline - */ - - __asm__ volatile ("flushp"); - -#endif /* NIOS2_ICACHE_SIZE > 0 */ -} diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_icache_flush_all.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_icache_flush_all.c deleted file mode 100644 index 5088552..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_icache_flush_all.c +++ /dev/null @@ -1,46 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "nios2.h" -#include "system.h" - -#include "alt_types.h" -#include "sys/alt_cache.h" - -/* - * alt_icache_flush_all() is called to flush the entire instruction cache. - */ - -void alt_icache_flush_all (void) -{ -#if NIOS2_ICACHE_SIZE > 0 - alt_icache_flush (0, NIOS2_ICACHE_SIZE); -#endif -} diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_iic.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_iic.c deleted file mode 100644 index 1db5afa..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_iic.c +++ /dev/null @@ -1,106 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ -#include "system.h" - -/* - * This file implements the HAL Enhanced interrupt API for Nios II processors - * with an internal interrupt controller (IIC). For most routines, this serves - * as a wrapper layer over the legacy interrupt API (which must be used with - * the IIC only). - * - * Use of the enhanced API is recommended so that application and device - * drivers are compatible with a Nios II system configured with an external - * interrupt controller (EIC), or IIC. This will afford maximum portability. - * - * If an EIC is present, the EIC device driver must provide these routines, - * because their operation will be specific to that EIC type. - */ -#ifndef NIOS2_EIC_PRESENT -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - -#include "sys/alt_irq.h" -#include "priv/alt_iic_isr_register.h" -#include "priv/alt_legacy_irq.h" - -/** @Function Description: This function registers an interrupt handler. - * If the function is succesful, then the requested interrupt will be enabled upon - * return. Registering a NULL handler will disable the interrupt. - * @API Type: External - * @param ic_id Ignored. - * @param irq IRQ number - * @return 0 if successful, else error (-1) - */ -int alt_ic_isr_register(alt_u32 ic_id, alt_u32 irq, alt_isr_func isr, - void *isr_context, void *flags) -{ - return alt_iic_isr_register(ic_id, irq, isr, isr_context, flags); -} - -/** @Function Description: This function enables a single interrupt. - * @API Type: External - * @param ic_id Ignored. - * @param irq IRQ number - * @return 0 if successful, else error (-1) - */ -int alt_ic_irq_enable (alt_u32 ic_id, alt_u32 irq) -{ - return alt_irq_enable(irq); -} - -/** @Function Description: This function disables a single interrupt. - * @API Type: External - * @param ic_id Ignored. - * @param irq IRQ number - * @return 0 if successful, else error (-1) - */ -int alt_ic_irq_disable(alt_u32 ic_id, alt_u32 irq) -{ - return alt_irq_disable(irq); -} - -/** @Function Description: This function to determine if corresponding - * interrupt is enabled. - * @API Type: External - * @param ic_id Ignored. - * @param irq IRQ number - * @return Zero if corresponding interrupt is disabled and - * non-zero otherwise. - */ -alt_u32 alt_ic_irq_enabled(alt_u32 ic_id, alt_u32 irq) -{ - alt_u32 irq_enabled; - - NIOS2_READ_IENABLE(irq_enabled); - - return (irq_enabled & (1 << irq)) ? 1: 0; -} - -#endif /* ALT_ENHANCED_INTERRUPT_API_PRESENT */ -#endif /* NIOS2_EIC_PRESENT */ diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_iic_isr_register.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_iic_isr_register.c deleted file mode 100644 index b104395..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_iic_isr_register.c +++ /dev/null @@ -1,104 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ -#include -#include "system.h" - -/* - * Provides an interrupt registry mechanism for the any CPUs internal interrupt - * controller (IIC) when the enhanced interrupt API is active. - */ -#ifndef ALT_CPU_EIC_PRESENT -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - -#include "alt_types.h" -#include "sys/alt_irq.h" -#include "priv/alt_iic_isr_register.h" - -/* - * The header, alt_irq_entry.h, contains the exception entry point, and is - * provided by the processor component. It is included here, so that the code - * will be added to the executable only if alt_irq_register() is present, i.e. - * if no interrupts are registered - there's no need to provide any - * interrupt handling. - */ - -#include "sys/alt_irq_entry.h" - -/* - * The header, alt_irq_table.h contains a table describing which function - * handles each interrupt. - */ - -#include "priv/alt_irq_table.h" - -/** @Function Description: This function registers an interrupt handler. - * If the function is succesful, then the requested interrupt will be enabled - * upon return. Registering a NULL handler will disable the interrupt. - * - * @API Type: External - * @param ic_id Interrupt controller ID - * @param irq IRQ ID number - * @param isr Pointer to interrupt service routine - * @param isr_context Opaque pointer passed to ISR - * @param flags - * @return 0 if successful, else error (-1) - */ -int alt_iic_isr_register(alt_u32 ic_id, alt_u32 irq, alt_isr_func isr, - void *isr_context, void *flags) -{ - int rc = -EINVAL; - int id = irq; /* IRQ interpreted as the interrupt ID. */ - alt_irq_context status; - - if (id < ALT_NIRQ) - { - /* - * interrupts are disabled while the handler tables are updated to ensure - * that an interrupt doesn't occur while the tables are in an inconsistant - * state. - */ - - status = alt_irq_disable_all(); - - alt_irq[id].handler = isr; - alt_irq[id].context = isr_context; - - rc = (isr) ? alt_ic_irq_enable(ic_id, id) : alt_ic_irq_disable(ic_id, id); - - alt_irq_enable_all(status); - } - - return rc; -} - -#endif /* ALT_ENHANCED_INTERRUPT_API_PRESENT */ -#endif /* ALT_CPU_EIC_PRESENT */ diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_instruction_exception_entry.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_instruction_exception_entry.c deleted file mode 100644 index f4f52fc..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_instruction_exception_entry.c +++ /dev/null @@ -1,203 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2008 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ -#include "sys/alt_exceptions.h" -#include "nios2.h" -#include "alt_types.h" -#include "system.h" - -/* - * This file implements support for calling user-registered handlers for - * instruction-generated exceptions. This handler could also be reached - * in the event of a spurious interrupt. - * - * The handler code is optionally enabled through the "Enable - * Instruction-related Exception API" HAL BSP setting, which will - * define the macro below. - */ -#ifdef ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API - -/* Function pointer to exception callback routine */ -alt_exception_result (*alt_instruction_exception_handler) - (alt_exception_cause, alt_u32, alt_u32) = 0x0; - -/* Link entry routine to .exceptions section */ -int alt_instruction_exception_entry (alt_u32 exception_pc) - __attribute__ ((section (".exceptions"))); - -/* - * This is the entry point for instruction-generated exceptions handling. - * This routine will be called by alt_exceptions_entry.S, after it determines - * that an exception could not be handled by handlers that preceed that - * of instruction-generated exceptions (such as interrupts). - * - * For this to function properly, you must register an exception handler - * using alt_instruction_exception_register(). This routine will call - * that handler if it has been registered. Absent a handler, it will - * break break or hang as discussed below. - */ -int alt_instruction_exception_entry (alt_u32 exception_pc) -{ - alt_u32 cause, badaddr; - -/* - * If the processor hardware has the optional EXCEPTIONS & BADADDR registers, - * read them and pass their content to the user handler. These are always - * present if the MMU or MPU is enabled, and optionally for other advanced - * exception types via the "Extra exceptions information" setting in the - * processor (hardware) configuration. - * - * If these registers are not present, the cause field will be set to - * NIOS2_EXCEPTION_CAUSE_NOT_PRESENT. Your handling routine should - * check the validity of the cause argument before proceeding. - */ -#ifdef NIOS2_HAS_EXTRA_EXCEPTION_INFO - /* Get exception cause & "badaddr" */ - NIOS2_READ_EXCEPTION(cause); - cause = ( (cause & NIOS2_EXCEPTION_REG_CAUSE_MASK) >> - NIOS2_EXCEPTION_REG_CAUSE_OFST ); - - NIOS2_READ_BADADDR(badaddr); -#else - cause = NIOS2_EXCEPTION_CAUSE_NOT_PRESENT; - badaddr = 0; -#endif /* NIOS2_HAS_EXTRA_EXCEPTION_INFO */ - - if(alt_instruction_exception_handler) { - /* - * Call handler. Its return value indicates whether the exception-causing - * instruction should be re-issued. The code that called us, - * alt_eceptions_entry.S, will look at this value and adjust the ea - * register as necessary - */ - return alt_instruction_exception_handler(cause, exception_pc, badaddr); - } - /* - * We got here because an instruction-generated exception occured, but no - * handler is present. We do not presume to know how to handle it. If the - * debugger is present, break, otherwise hang. - * - * If you've reached here in the debugger, consider examining the - * EXCEPTIONS register cause bit-field, which was read into the 'cause' - * variable above, and compare it against the exceptions-type enumeration - * in alt_exceptions.h. This register is availabe if the MMU or MPU is - * present, or if the "Extra exceptions information" hardware option is - * selected. - * - * If you get here then one of the following could have happened: - * - * - An instruction-generated exception occured, and the processor - * does not have the extra exceptions feature enabled, or you - * have not registered a handler using - * alt_instruction_exception_register() - * - * Some examples of instruction-generated exceptions and why they - * might occur: - * - * - Your program could have been compiled for a full-featured - * Nios II core, but it is running on a smaller core, and - * instruction emulation has been disabled by defining - * ALT_NO_INSTRUCTION_EMULATION. - * - * You can work around the problem by re-enabling instruction - * emulation, or you can figure out why your program is being - * compiled for a system other than the one that it is running on. - * - * - Your program has executed a trap instruction, but has not - * implemented a handler for this instruction. - * - * - Your program has executed an illegal instruction (one which is - * not defined in the instruction set). - * - * - Your processor includes an MMU or MPU, and you have enabled it - * before registering an exception handler to service exceptions it - * generates. - * - * The problem could also be hardware related: - * - If your hardware is broken and is generating spurious interrupts - * (a peripheral which negates its interrupt output before its - * interrupt handler has been executed will cause spurious interrupts) - */ - else { -#ifdef NIOS2_HAS_DEBUG_STUB - NIOS2_BREAK(); -#else - while(1) - ; -#endif /* NIOS2_HAS_DEBUG_STUB */ - } - - /* // We should not get here. Remove compiler warning. */ - return NIOS2_EXCEPTION_RETURN_REISSUE_INST; -} - -#endif /* ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API */ - -/* - * This routine indicates whether a particular exception cause will have - * set a valid address into the BADADDR register, which is included - * in the arguments to a user-registered instruction-generated exception - * handler. Many exception types do not set valid contents in BADADDR; - * this is a convenience routine to easily test the validity of that - * argument in your handler. - * - * Note that this routine will return false (0) for cause '12', - * TLB miss. This is because there are four exception types that - * share that cause, two of which do not have a valid BADADDR. You - * must determine BADADDR's validity for these. - * - * Arguments: - * cause: The 5-bit exception cause field of the EXCEPTIONS register, - * shifted to the LSB position. You may pass the 'cause' argument - * in a handler you registered directy to this routine. - * - * Return: 1: BADADDR (bad_addr argument to handler) is valid - * 0: BADADDR is not valid - */ -int alt_exception_cause_generated_bad_addr(alt_exception_cause cause) -{ - switch (cause) { - case NIOS2_EXCEPTION_SUPERVISOR_ONLY_DATA_ADDR: - return 1; - case NIOS2_EXCEPTION_MISALIGNED_DATA_ADDR: - return 1; - case NIOS2_EXCEPTION_MISALIGNED_TARGET_PC: - return 1; - case NIOS2_EXCEPTION_TLB_READ_PERM_VIOLATION: - return 1; - case NIOS2_EXCEPTION_TLB_WRITE_PERM_VIOLATION: - return 1; - case NIOS2_EXCEPTION_MPU_DATA_REGION_VIOLATION: - return 1; - default: - return 0; - } -} diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_instruction_exception_register.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_instruction_exception_register.c deleted file mode 100644 index b059e1d..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_instruction_exception_register.c +++ /dev/null @@ -1,82 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2008 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ -#include "sys/alt_exceptions.h" -#include "alt_types.h" -#include "system.h" - -/* - * This file implements support for calling user-registered handlers for - * instruction-generated exceptions. - * - * The registry API is optionally enabled through the "Enable - * Instruction-related Exception API" HAL BSP setting, which will - * define the macro below. - */ -#ifdef ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API - -/* - * The header, alt_exception_handler_registry.h contains a struct describing - * the registered exception handler - */ -#include "priv/alt_exception_handler_registry.h" - -/* - * Pull in the exception entry assembly code. This will not be linked in - * unless this object is linked into the executable (i.e. only if - * alt_instruction_exception_register() is called). - */ -__asm__( "\n\t.globl alt_exception" ); - -/* - * alt_instruction_exception_register() is called to register a handler to - * service instruction-generated exceptions that are not handled by the - * default exception handler code (interrupts, and optionally unimplemented - * instructions and traps). - * - * Passing null (0x0) in the handler argument will disable a previously- - * registered handler. - * - * Note that if no handler is registered, exceptions that are not processed - * using the built-in handler (interrupts, and optionally unimplemented - * instructions and traps) are treated as unknown exceptions, resulting - * in either a break or an infinite loop. - */ -void alt_instruction_exception_register ( - alt_exception_result (*exception_handler)( - alt_exception_cause cause, - alt_u32 exception_pc, - alt_u32 bad_addr) ) -{ - alt_instruction_exception_handler = exception_handler; -} - -#endif /* ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API */ diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_io_redirect.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_io_redirect.c deleted file mode 100644 index 8c862f7..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_io_redirect.c +++ /dev/null @@ -1,98 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include -#include - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - - -/* - * alt_open_fd() is similar to open() in that it is used to obtain a file - * descriptor for the file named "name". The "flags" and "mode" arguments are - * identical to the "flags" and "mode" arguments of open(). - * - * The distinction between the two functions is that the file descriptor - * structure to use is passed in as an argument, rather than allocated from the - * list of free file descriptors. - * - * This is used by alt_io_redirect() to redirect the stdin, stdout and stderr - * file descriptors to point to new devices. - * - * If the device can not be succesfully opened, then the input file descriptor - * remains unchanged. - */ - -static void alt_open_fd(alt_fd* fd, const char* name, int flags, int mode) -{ - int old; - - old = open (name, flags, mode); - - if (old >= 0) - { - fd->dev = alt_fd_list[old].dev; - fd->priv = alt_fd_list[old].priv; - fd->fd_flags = alt_fd_list[old].fd_flags; - - alt_release_fd (old); - } -} - -/* - * alt_io_redirect() is called once the device/filesystem lists have been - * initialised, but before main(). Its function is to redirect standard in, - * standard out and standard error so that they point to the devices selected by - * the user (as defined in system.h). - * - * Prior to the call to this function, io is directed towards /dev/null. If - * i/o can not be redirected to the requested device, for example if the device - * does not exist, then it remains directed at /dev/null. - */ - -void alt_io_redirect(const char* stdout_dev, - const char* stdin_dev, - const char* stderr_dev) -{ - /* Redirect the channels */ - - alt_open_fd (&alt_fd_list[STDOUT_FILENO], stdout_dev, O_WRONLY, 0777); - alt_open_fd (&alt_fd_list[STDIN_FILENO], stdin_dev, O_RDONLY, 0777); - alt_open_fd (&alt_fd_list[STDERR_FILENO], stderr_dev, O_WRONLY, 0777); -} - - - - diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_ioctl.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_ioctl.c deleted file mode 100644 index f5d7ef1..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_ioctl.c +++ /dev/null @@ -1,170 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "sys/ioctl.h" -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -/* - * The ioctl() system call is provided so that application code can manipulate - * the i/o capabilities of a device in device specific ways. This is identical - * to the standard posix ioctl() function. - * - * In general this implementation simply vectors ioctl requests to the - * apropriate drivers ioctl function (as registered in the drivers alt_dev - * structure). - * - * However in the case of devices (as oposed to filesystem), the TIOCEXCL and - * TIOCNXCL requests are handled without reference to the driver. These - * requests are used to lock/release a device for exclusive access. - * - * Handling these requests centrally eases the task of device driver - * development. - * - * ALT_IOCTL is mapped onto the ioctl() system call in alt_syscall.h - */ - -#ifdef ALT_USE_DIRECT_DRIVERS - -#include "system.h" -#include "sys/alt_driver.h" - -/* - * Provide minimal version that calls ioctl routine of provided stdio devices. - */ -int ALT_IOCTL (int file, int req, void* arg) -{ -#ifdef ALT_STDIN_PRESENT - ALT_DRIVER_IOCTL_EXTERNS(ALT_STDIN_DEV); -#endif -#ifdef ALT_STDOUT_PRESENT - ALT_DRIVER_IOCTL_EXTERNS(ALT_STDOUT_DEV); -#endif -#ifdef ALT_STDERR_PRESENT - ALT_DRIVER_IOCTL_EXTERNS(ALT_STDERR_DEV); -#endif - -#if !defined(ALT_STDIN_PRESENT) && !defined(ALT_STDOUT_PRESENT) && !defined(ALT_STDERR_PRESENT) - /* Generate a link time warning, should this function ever be called. */ - ALT_STUB_WARNING(ioctl); -#endif - - switch (file) { -#ifdef ALT_STDIN_PRESENT - case 0: /* stdin file descriptor */ - return ALT_DRIVER_IOCTL(ALT_STDIN_DEV, req, arg); -#endif /* ALT_STDIN_PRESENT */ -#ifdef ALT_STDOUT_PRESENT - case 1: /* stdout file descriptor */ - return ALT_DRIVER_IOCTL(ALT_STDOUT_DEV, req, arg); -#endif /* ALT_STDOUT_PRESENT */ -#ifdef ALT_STDERR_PRESENT - case 2: /* stderr file descriptor */ - return ALT_DRIVER_IOCTL(ALT_STDERR_DEV, req, arg); -#endif /* ALT_STDERR_PRESENT */ - default: - ALT_ERRNO = EBADFD; - return -1; - } -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -int ALT_IOCTL (int file, int req, void* arg) -{ - alt_fd* fd; - int rc; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - - /* - * In the case of device drivers (not file systems) handle the TIOCEXCL - * and TIOCNXCL requests as special cases. - */ - - if (fd->fd_flags & ALT_FD_DEV) - { - if (req == TIOCEXCL) - { - rc = alt_fd_lock (fd); - goto ioctl_done; - } - else if (req == TIOCNXCL) - { - rc = alt_fd_unlock (fd); - goto ioctl_done; - } - } - - /* - * If the driver provides an ioctl() function, call that to handle the - * request, otherwise set the return code to indicate that the request - * could not be processed. - */ - - if (fd->dev->ioctl) - { - rc = fd->dev->ioctl(fd, req, arg); - } - else - { - rc = -ENOTTY; - } - } - else - { - rc = -EBADFD; - } - -ioctl_done: - - if (rc < 0) - { - ALT_ERRNO = -rc; - } - return rc; -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_irq_entry.S b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_irq_entry.S deleted file mode 100644 index d3efe7d..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_irq_entry.S +++ /dev/null @@ -1,108 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "system.h" - -/* - * This is the interrupt exception entry point code, which saves all the - * registers and calls the interrupt handler. It should be pulled in using - * a .globl from alt_irq_register.c. This scheme is used so that if an - * interrupt is never registered, then this code will not appear in the - * generated executable, thereby improving code footprint. - */ - - /* - * Explicitly allow the use of r1 (the assembler temporary register) - * within this code. This register is normally reserved for the use of - * the compiler. - */ - .set noat - - /* - * Pull in the exception handler register save code. - */ - .globl alt_exception - - .globl alt_irq_entry - .section .exceptions.entry.label, "xa" -alt_irq_entry: - - /* - * Section .exceptions.entry is in alt_exception_entry.S - * This saves all the caller saved registers and reads estatus into r5 - */ - - .section .exceptions.irqtest, "xa" - -#ifdef ALT_CI_INTERRUPT_VECTOR_N - /* - * Use the interrupt vector custom instruction if present to accelerate - * this code. - * If the interrupt vector custom instruction returns a negative - * value, there are no interrupts active (estatus.pie is 0 - * or ipending is 0) so assume it is a software exception. - */ - custom ALT_CI_INTERRUPT_VECTOR_N, r4, r0, r0 - blt r4, r0, .Lnot_irq -#else - /* - * Test to see if the exception was a software exception or caused - * by an external interrupt, and vector accordingly. - */ - rdctl r4, ipending - andi r2, r5, 1 - beq r2, zero, .Lnot_irq - beq r4, zero, .Lnot_irq -#endif /* ALT_CI_INTERRUPT_VECTOR_N */ - - .section .exceptions.irqhandler, "xa" - /* - * Now that all necessary registers have been preserved, call - * alt_irq_handler() to process the interrupts. - */ - - call alt_irq_handler - - .section .exceptions.irqreturn, "xa" - - br .Lexception_exit - - .section .exceptions.notirq.label, "xa" - -.Lnot_irq: - - /* - * Section .exceptions.exit is in alt_exception_entry.S - * This restores all the caller saved registers - */ - - .section .exceptions.exit.label -.Lexception_exit: - diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_irq_handler.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_irq_handler.c deleted file mode 100644 index 3253d02..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_irq_handler.c +++ /dev/null @@ -1,169 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include "system.h" - -/* - * This interrupt handler only works with an internal interrupt controller - * (IIC). Processors with an external interrupt controller (EIC) use an - * implementation provided by an EIC driver. - */ -#ifndef ALT_CPU_EIC_PRESENT - -#include "sys/alt_irq.h" -#include "os/alt_hooks.h" - -#include "alt_types.h" - -/* - * A table describing each interrupt handler. The index into the array is the - * interrupt id associated with the handler. - * - * When an interrupt occurs, the associated handler is called with - * the argument stored in the context member. - */ -struct ALT_IRQ_HANDLER -{ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - void (*handler)(void*); -#else - void (*handler)(void*, alt_u32); -#endif - void *context; -} alt_irq[ALT_NIRQ]; - -/* - * alt_irq_handler() is called by the interrupt exception handler in order to - * process any outstanding interrupts. - * - * It is defined here since it is linked in using weak linkage. - * This means that if there is never a call to alt_irq_register() (above) then - * this function will not get linked in to the executable. This is acceptable - * since if no handler is ever registered, then an interrupt can never occur. - * - * If Nios II interrupt vector custom instruction exists, use it to accelerate - * the dispatch of interrupt handlers. The Nios II interrupt vector custom - * instruction is present if the macro ALT_CI_INTERRUPT_VECTOR defined. - */ - -void alt_irq_handler (void) __attribute__ ((section (".exceptions"))); -void alt_irq_handler (void) -{ -#ifdef ALT_CI_INTERRUPT_VECTOR - alt_32 offset; - char* alt_irq_base = (char*)alt_irq; -#else - alt_u32 active; - alt_u32 mask; - alt_u32 i; -#endif /* ALT_CI_INTERRUPT_VECTOR */ - - /* - * Notify the operating system that we are at interrupt level. - */ - - ALT_OS_INT_ENTER(); - -#ifdef ALT_CI_INTERRUPT_VECTOR - /* - * Call the interrupt vector custom instruction using the - * ALT_CI_INTERRUPT_VECTOR macro. - * It returns the offset into the vector table of the lowest-valued pending - * interrupt (corresponds to highest priority) or a negative value if none. - * The custom instruction assumes that each table entry is eight bytes. - */ - while ((offset = ALT_CI_INTERRUPT_VECTOR) >= 0) { - struct ALT_IRQ_HANDLER* handler_entry = - (struct ALT_IRQ_HANDLER*)(alt_irq_base + offset); -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - handler_entry->handler(handler_entry->context); -#else - handler_entry->handler(handler_entry->context, offset >> 3); -#endif - } -#else /* ALT_CI_INTERRUPT_VECTOR */ - /* - * Obtain from the interrupt controller a bit list of pending interrupts, - * and then process the highest priority interrupt. This process loops, - * loading the active interrupt list on each pass until alt_irq_pending() - * return zero. - * - * The maximum interrupt latency for the highest priority interrupt is - * reduced by finding out which interrupts are pending as late as possible. - * Consider the case where the high priority interupt is asserted during - * the interrupt entry sequence for a lower priority interrupt to see why - * this is the case. - */ - - active = alt_irq_pending (); - - do - { - i = 0; - mask = 1; - - /* - * Test each bit in turn looking for an active interrupt. Once one is - * found, the interrupt handler asigned by a call to alt_irq_register() is - * called to clear the interrupt condition. - */ - - do - { - if (active & mask) - { -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - alt_irq[i].handler(alt_irq[i].context); -#else - alt_irq[i].handler(alt_irq[i].context, i); -#endif - break; - } - mask <<= 1; - i++; - - } while (1); - - active = alt_irq_pending (); - - } while (active); -#endif /* ALT_CI_INTERRUPT_VECTOR */ - - /* - * Notify the operating system that interrupt processing is complete. - */ - - ALT_OS_INT_EXIT(); -} - -#endif /* ALT_CPU_EIC_PRESENT */ diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_irq_register.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_irq_register.c deleted file mode 100644 index b5ea474..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_irq_register.c +++ /dev/null @@ -1,102 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ -#include -#include "system.h" - -/* - * This interrupt registry mechanism works with the Nios II internal interrupt - * controller (IIC) only. Systems with an external interrupt controller (EIC), - * or those with the IIC who are using the enhanced interrupt API will - * utilize the alt_ic_isr_register() routine to register an interrupt. - */ -#ifndef NIOS2_EIC_PRESENT - -#include "sys/alt_irq.h" -#include "priv/alt_legacy_irq.h" -#include "os/alt_hooks.h" - -#include "alt_types.h" - -/* - * The header, alt_irq_entry.h, contains the exception entry point, and is - * provided by the processor component. It is included here, so that the code - * will be added to the executable only if alt_irq_register() is present, i.e. - * if no interrupts are registered - there's no need to provide any - * interrupt handling. - */ - -#include "sys/alt_irq_entry.h" - -/* - * The header, alt_irq_table.h contains a table describing which function - * handles each interrupt. - */ - -#include "priv/alt_irq_table.h" - -/* - * alt_irq_handler() is called to register an interrupt handler. If the - * function is succesful, then the requested interrupt will be enabled upon - * return. Registering a NULL handler will disable the interrupt. - * - * The return value is 0 if the interrupt handler was registered and the - * interrupt was enabled, otherwise it is negative. - */ - -int alt_irq_register (alt_u32 id, - void* context, - alt_isr_func handler) -{ - int rc = -EINVAL; - alt_irq_context status; - - if (id < ALT_NIRQ) - { - /* - * interrupts are disabled while the handler tables are updated to ensure - * that an interrupt doesn't occur while the tables are in an inconsistant - * state. - */ - - status = alt_irq_disable_all (); - - alt_irq[id].handler = handler; - alt_irq[id].context = context; - - rc = (handler) ? alt_irq_enable (id): alt_irq_disable (id); - - alt_irq_enable_all(status); - } - return rc; -} -#endif /* NIOS2_EIC_PRESENT */ - diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_irq_vars.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_irq_vars.c deleted file mode 100644 index 8c0a18d..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_irq_vars.c +++ /dev/null @@ -1,47 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "alt_types.h" - -#include "system.h" - -/* - * These global variables are used to save the current list of enabled - * interrupts. See alt_irq.h for further details. - */ - -volatile alt_u32 alt_irq_active = 0; - -#ifndef ALT_EXCEPTION_STACK - -volatile alt_u32 alt_priority_mask = (alt_u32) -1; - -#endif - diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_isatty.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_isatty.c deleted file mode 100644 index 9276472..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_isatty.c +++ /dev/null @@ -1,125 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include "sys/alt_dev.h" -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -#ifdef ALT_USE_DIRECT_DRIVERS - -#include "system.h" - -/* - * Provide minimal version that just describes all file descriptors - * as tty devices for provided stdio devices. - */ -int ALT_ISATTY (int file) -{ - switch (file) { -#ifdef ALT_STDIN_PRESENT - case 0: /* stdin file descriptor */ -#endif /* ALT_STDIN_PRESENT */ -#ifdef ALT_STDOUT_PRESENT - case 1: /* stdout file descriptor */ -#endif /* ALT_STDOUT_PRESENT */ -#ifdef ALT_STDERR_PRESENT - case 2: /* stderr file descriptor */ -#endif /* ALT_STDERR_PRESENT */ - return 1; - default: - return 0; - } - -#if !defined(ALT_STDIN_PRESENT) && !defined(ALT_STDOUT_PRESENT) && !defined(ALT_STDERR_PRESENT) - /* Generate a link time warning, should this function ever be called. */ - ALT_STUB_WARNING(isatty); -#endif -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ -/* - * isatty() can be used to determine whether the input file descriptor "file" - * refers to a terminal device or not. If it is a terminal device then the - * return value is one, otherwise it is zero. - * - * ALT_ISATTY is mapped onto the isatty() system call in alt_syscall.h - */ - -int ALT_ISATTY (int file) -{ - alt_fd* fd; - struct stat stat; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - /* - * If a device driver does not provide an fstat() function, then it is - * treated as a terminal device by default. - */ - - if (!fd->dev->fstat) - { - return 1; - } - - /* - * If a driver does provide an implementation of the fstat() function, then - * this is called so that the device can identify itself. - */ - - else - { - fstat (file, &stat); - return (stat.st_mode == _IFCHR) ? 1 : 0; - } - } - else - { - ALT_ERRNO = EBADFD; - return 0; - } -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_kill.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_kill.c deleted file mode 100644 index 42c2e1d..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_kill.c +++ /dev/null @@ -1,121 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include "sys/alt_errno.h" -#include "os/alt_syscall.h" - - -/* - * kill() is used by newlib in order to send signals to processes. Since there - * is only a single process in the HAL, the only valid values for pid are - * either the current process id, or the broadcast values, i.e. pid must be - * less than or equal to zero. - * - * ALT_KILL is mapped onto the kill() system call in alt_syscall.h - */ - -int ALT_KILL (int pid, int sig) -{ - int status = 0; - - if (pid <= 0) - { - switch (sig) - { - case 0: - - /* The null signal is used to check that a pid is valid. */ - - break; - - case SIGABRT: - case SIGALRM: - case SIGFPE: - case SIGILL: - case SIGKILL: - case SIGPIPE: - case SIGQUIT: - case SIGSEGV: - case SIGTERM: - case SIGUSR1: - case SIGUSR2: - case SIGBUS: - case SIGPOLL: - case SIGPROF: - case SIGSYS: - case SIGTRAP: - case SIGVTALRM: - case SIGXCPU: - case SIGXFSZ: - - /* - * The Posix standard defines the default behaviour for all these signals - * as being eqivalent to a call to _exit(). No mechanism is provided to - * change this behaviour. - */ - - _exit(0); - case SIGCHLD: - case SIGURG: - - /* - * The Posix standard defines these signals to be ignored by default. No - * mechanism is provided to change this behaviour. - */ - - break; - default: - - /* Tried to send an unsupported signal */ - - status = EINVAL; - } - } - - else if (pid > 0) - { - /* Attempted to signal a non-existant process */ - - status = ESRCH; - } - - if (status) - { - ALT_ERRNO = status; - return -1; - } - - return 0; -} diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_link.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_link.c deleted file mode 100644 index d796c59..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_link.c +++ /dev/null @@ -1,56 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_warning.h" -#include "sys/alt_errno.h" -#include "os/alt_syscall.h" - -/* - * link() is used by newlib to create a new link to an existing file. This is - * unsupported in the HAL environment. However a "do-nothing" implementation - * is still provied for newlib compatability. - * - * ALT_LINK is mapped onto the link() system call in alt_syscall.h - */ - -int ALT_LINK ( char *existing, char *new) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(link); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} - diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_load.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_load.c deleted file mode 100644 index ffab4b9..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_load.c +++ /dev/null @@ -1,88 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_load.h" -#include "sys/alt_cache.h" - -/* - * Linker defined symbols. - */ - -extern void __flash_rwdata_start; -extern void __ram_rwdata_start; -extern void __ram_rwdata_end; -extern void __flash_rodata_start; -extern void __ram_rodata_start; -extern void __ram_rodata_end; -extern void __flash_exceptions_start; -extern void __ram_exceptions_start; -extern void __ram_exceptions_end; - -/* - * alt_load() is called when the code is executing from flash. In this case - * there is no bootloader, so this application is responsible for loading to - * RAM any sections that are required. - */ - -void alt_load (void) -{ - /* - * Copy the .rwdata section. - */ - - alt_load_section (&__flash_rwdata_start, - &__ram_rwdata_start, - &__ram_rwdata_end); - - /* - * Copy the exception handler. - */ - - alt_load_section (&__flash_exceptions_start, - &__ram_exceptions_start, - &__ram_exceptions_end); - - /* - * Copy the .rodata section. - */ - - alt_load_section (&__flash_rodata_start, - &__ram_rodata_start, - &__ram_rodata_end); - - /* - * Now ensure that the caches are in synch. - */ - - alt_dcache_flush_all(); - alt_icache_flush_all(); -} diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_log_macro.S b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_log_macro.S deleted file mode 100644 index 499c4ad..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_log_macro.S +++ /dev/null @@ -1,56 +0,0 @@ -/* alt_log_macro.S - * - * Implements the function tx_log_str, called by the assembly macro - * ALT_LOG_PUTS(). The macro will be empty when logging is turned off, - * and this function will not be compiled. When logging is on, - * this function is used to print out the strings defined in the beginning - * of alt_log_printf.c, using port information taken from system.h and - * alt_log_printf.h. - * - * This routine only handles strings, and sends a character into the defined - * output device's output buffer when the device is ready. It's intended for - * debugging purposes, where messages can be set to print out at certain - * points in the boot code to indicate the progress of the program. - * - */ - -#ifndef __ALT_LOG_MACROS__ -#define __ALT_LOG_MACROS__ - -/* define this flag to skip assembly-incompatible parts - * of various include files. */ -#define ALT_ASM_SRC - -#ifdef ALT_LOG_ENABLE // only compile this function if this flag is defined. - - #include "system.h" - #include "sys/alt_log_printf.h" - - .global tx_log_str -tx_log_str: - /* load base uart / jtag uart address into r6 */ - movhi r6, %hiadj(ALT_LOG_PORT_BASE) - addi r6, r6, %lo(ALT_LOG_PORT_BASE) -tx_next_char: - /* if pointer points to null, return - * r4 is the pointer to the str to be printed, set by ALT_LOG_PUTS */ - ldb r7, (r4) - beq r0, r7, end_tx - - /* check device transmit ready */ -wait_tx_ready_loop: - ldwio r5, ALT_LOG_PRINT_REG_OFFSET(r6) - andi r5, r5, ALT_LOG_PRINT_MSK - beq r5, r0, wait_tx_ready_loop - /* write char */ - stwio r7, ALT_LOG_PRINT_TXDATA_REG_OFFSET (r6) - /* advance string pointer */ - addi r4, r4, 1 - br tx_next_char -end_tx: - ret - -#endif - -#endif /* __ALT_LOG_MACROS__ */ - diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_log_printf.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_log_printf.c deleted file mode 100644 index 1f7056d..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_log_printf.c +++ /dev/null @@ -1,479 +0,0 @@ - -/* alt_log_printf.c - * - * This file implements the various C functions used for the - * alt_log logging/debugging print functions. The functions - * sit as is here - the job of hiding them from the compiler - * if logging is disabled is accomplished in the .h file. - * - * All the global variables for alt_log are defined here. - * These include the various flags that turn on additional - * logging options; the strings for assembly printing; and - * other globals needed by different logging options. - * - * There are 4 functions that handle the actual printing: - * alt_log_txchar: Actual function that puts 1 char to UART/JTAG UART. - * alt_log_repchar: Calls alt_log_txchar 'n' times - used by - * alt_log_private_printf for formatting. - * alt_log_private_printf: - * Stripped down implementation of printf - no floats. - * alt_log_printf_proc: - * Wrapper function for private_printf. - * - * The rest of the functions are called by the macros which - * were called by code in the other components. Each function - * is preceded by a comment, about which file it gets called - * in, and what its purpose is. - * - * author: gkwan - */ - -/* skip all code if enable is off */ -#ifdef ALT_LOG_ENABLE - -#include -#include -#include -#ifdef __ALTERA_AVALON_JTAG_UART - #include "altera_avalon_jtag_uart.h" - #include -#endif -#include "sys/alt_log_printf.h" - -/* strings for assembly puts */ -char alt_log_msg_bss[] = "[crt0.S] Clearing BSS \r\n";; -char alt_log_msg_alt_main[] = "[crt0.S] Calling alt_main.\r\n"; -char alt_log_msg_stackpointer[] \ - = "[crt0.S] Setting up stack and global pointers.\r\n"; -char alt_log_msg_cache[] = "[crt0.S] Inst & Data Cache Initialized.\r\n"; -/* char array allocation for alt_write */ -char alt_log_write_buf[ALT_LOG_WRITE_ECHO_LEN+2]; - -/* global variables for all 'on' flags */ - -/* - * The boot message flag is linked into the data (rwdata) section - * because if it is zero, it would otherwise be placed in the bss section. - * alt_log examines this variable before the BSS is cleared in the boot-up - * process. - */ -volatile alt_u32 alt_log_boot_on_flag \ - __attribute__ ((section (".data"))) = ALT_LOG_BOOT_ON_FLAG_SETTING; - -volatile alt_u8 alt_log_write_on_flag = ALT_LOG_WRITE_ON_FLAG_SETTING; - -volatile alt_u8 alt_log_sys_clk_on_flag = ALT_LOG_SYS_CLK_ON_FLAG_SETTING; - -volatile alt_u8 alt_log_jtag_uart_alarm_on_flag = \ - ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING; - -volatile alt_u8 alt_log_jtag_uart_isr_on_flag = \ - ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING; - -volatile alt_u8 alt_log_jtag_uart_startup_info_on_flag = \ - ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING; - -/* Global alarm object for recurrent JTAG UART status printing */ -alt_alarm alt_log_jtag_uart_alarm_1; - -/* Global ints for system clock printing and count */ -volatile int alt_log_sys_clk_count; -volatile int alt_system_clock_in_sec; - -/* enum used by alt_log_private_printf */ -enum -{ - pfState_chars, - pfState_firstFmtChar, - pfState_otherFmtChar -}; - - - - -/* Function to put one char onto the UART/JTAG UART txdata register. */ -void alt_log_txchar(int c,char *base) -{ - /* Wait until the device is ready for a character */ - while((ALT_LOG_PRINT_REG_RD(base) & ALT_LOG_PRINT_MSK) == 0) - ; - /* And pop the character into the register */ - ALT_LOG_PRINT_TXDATA_WR(base,c); -} - - -/* Called by alt_log_private_printf to print out characters repeatedly */ -void alt_log_repchar(char c,int r,int base) -{ - while(r-- > 0) - alt_log_txchar(c,(char*) base); -} - - -/* Stripped down printf function */ -void alt_log_private_printf(const char *fmt,int base,va_list args) - { - const char *w; - char c; - int state; - int fmtLeadingZero = 0; /* init these all to 0 for -W warnings. */ - int fmtLong = 0; - int fmtBeforeDecimal = 0; - int fmtAfterDecimal = 0; - int fmtBase = 0; - int fmtSigned = 0; - int fmtCase = 0; /* For hex format, if 1, A-F, else a-f. */ - - w = fmt; - state = pfState_chars; - - while(0 != (c = *w++)) - { - switch(state) - { - case pfState_chars: - if(c == '%') - { - fmtLeadingZero = 0; - fmtLong = 0; - fmtBase = 10; - fmtSigned = 1; - fmtCase = 0; /* Only %X sets this. */ - fmtBeforeDecimal = -1; - fmtAfterDecimal = -1; - state = pfState_firstFmtChar; - } - else - { - alt_log_txchar(c,(char*)base); - } - break; - - case pfState_firstFmtChar: - if(c == '0') - { - fmtLeadingZero = 1; - state = pfState_otherFmtChar; - } - else if(c == '%') - { - alt_log_txchar(c,(char*)base); - state = pfState_chars; - } - else - { - state = pfState_otherFmtChar; - goto otherFmtChar; - } - break; - - case pfState_otherFmtChar: -otherFmtChar: - if(c == '.') - { - fmtAfterDecimal = 0; - } - else if('0' <= c && c <= '9') - { - c -= '0'; - if(fmtAfterDecimal < 0) /* still before decimal */ - { - if(fmtBeforeDecimal < 0) - { - fmtBeforeDecimal = 0; - } - else - { - fmtBeforeDecimal *= 10; - } - fmtBeforeDecimal += c; - } - else - { - fmtAfterDecimal = (fmtAfterDecimal * 10) + c; - } - } - else if(c == 'l') - { - fmtLong = 1; - } - else /* we're up to the letter which determines type */ - { - switch(c) - { - case 'd': - case 'i': -doIntegerPrint: - { - unsigned long v; - unsigned long p; /* biggest power of fmtBase */ - unsigned long vShrink; /* used to count digits */ - int sign; - int digitCount; - - /* Get the value */ - if(fmtLong) - { - if (fmtSigned) - { - v = va_arg(args,long); - } - else - { - v = va_arg(args,unsigned long); - } - } - else - { - if (fmtSigned) - { - v = va_arg(args,int); - } - else - { - v = va_arg(args,unsigned int); - } - } - - /* Strip sign */ - sign = 0; - /* (assumes sign bit is #31) */ - if( fmtSigned && (v & (0x80000000)) ) - { - v = ~v + 1; - sign = 1; - } - - /* Count digits, and get largest place value */ - vShrink = v; - p = 1; - digitCount = 1; - while( (vShrink = vShrink / fmtBase) > 0 ) - { - digitCount++; - p *= fmtBase; - } - - /* Print leading characters & sign */ - fmtBeforeDecimal -= digitCount; - if(fmtLeadingZero) - { - if(sign) - { - alt_log_txchar('-',(char*)base); - fmtBeforeDecimal--; - } - alt_log_repchar('0',fmtBeforeDecimal,base); - } - else - { - if(sign) - { - fmtBeforeDecimal--; - } - alt_log_repchar(' ',fmtBeforeDecimal,base); - if(sign) - { - alt_log_txchar('-',(char*)base); - } - } - - /* Print numbery parts */ - while(p) - { - unsigned char d; - - d = v / p; - d += '0'; - if(d > '9') - { - d += (fmtCase ? 'A' : 'a') - '0' - 10; - } - alt_log_txchar(d,(char*)base); - - v = v % p; - p = p / fmtBase; - } - } - - state = pfState_chars; - break; - - case 'u': - fmtSigned = 0; - goto doIntegerPrint; - case 'o': - fmtSigned = 0; - fmtBase = 8; - goto doIntegerPrint; - case 'x': - fmtSigned = 0; - fmtBase = 16; - goto doIntegerPrint; - case 'X': - fmtSigned = 0; - fmtBase = 16; - fmtCase = 1; - goto doIntegerPrint; - - case 'c': - alt_log_repchar(' ',fmtBeforeDecimal-1,base); - alt_log_txchar(va_arg(args,int),(char*)base); - break; - - case 's': - { - char *s; - - s = va_arg(args,char *); - alt_log_repchar(' ',fmtBeforeDecimal-strlen(s),base); - - while(*s) - alt_log_txchar(*s++,(char*)base); - } - break; - } /* switch last letter of fmt */ - state=pfState_chars; - } - break; - } /* switch */ - } /* while chars left */ - } /* printf */ - -/* Main logging printf function */ -int alt_log_printf_proc(const char *fmt, ... ) -{ - va_list args; - - va_start (args, fmt); - alt_log_private_printf(fmt,ALT_LOG_PORT_BASE,args); - return (0); -} - -/* Below are the functions called by different macros in various components. */ - -/* If the system has a JTAG_UART, include JTAG_UART debugging functions */ -#ifdef __ALTERA_AVALON_JTAG_UART - -/* The alarm function in altera_avalon_jtag_uart.c. - * This function, when turned on, prints out the status - * of the JTAG UART Control register, every ALT_LOG_JTAG_UART_TICKS. - * If the flag is off, the alarm should never be registered, and this - * function should never run */ -alt_u32 altera_avalon_jtag_uart_report_log(void * context) -{ - if (alt_log_jtag_uart_alarm_on_flag) { - altera_avalon_jtag_uart_state* dev = (altera_avalon_jtag_uart_state*) context; - const char* header="JTAG Alarm:"; - alt_log_jtag_uart_print_control_reg(dev, dev->base, header); - return ALT_LOG_JTAG_UART_TICKS; - } - else - { - /* If flag is not on, return 0 to disable future alarms. - * Should never be here, alarm should not be enabled at all. */ - return 0; - } -} - -void alt_log_jtag_uart_print_control_reg(altera_avalon_jtag_uart_state* dev, int base, const char* header) -{ - unsigned int control, space, ac, wi, ri, we, re; - control = IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base); - space = (control & ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_MSK) >> - ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_OFST; - we= (control & ALTERA_AVALON_JTAG_UART_CONTROL_WE_MSK) >> - ALTERA_AVALON_JTAG_UART_CONTROL_WE_OFST; - re= (control & ALTERA_AVALON_JTAG_UART_CONTROL_RE_MSK) >> - ALTERA_AVALON_JTAG_UART_CONTROL_RE_OFST; - ri= (control & ALTERA_AVALON_JTAG_UART_CONTROL_RI_MSK) >> - ALTERA_AVALON_JTAG_UART_CONTROL_RI_OFST; - wi= (control & ALTERA_AVALON_JTAG_UART_CONTROL_WI_MSK) >> - ALTERA_AVALON_JTAG_UART_CONTROL_WI_OFST; - ac= (control & ALTERA_AVALON_JTAG_UART_CONTROL_AC_MSK) >> - ALTERA_AVALON_JTAG_UART_CONTROL_AC_OFST; - -#ifdef ALTERA_AVALON_JTAG_UART_SMALL - ALT_LOG_PRINTF( - "%s HW FIFO wspace=%d AC=%d WI=%d RI=%d WE=%d RE=%d\r\n", - header,space,ac,wi,ri,we,re); -#else - ALT_LOG_PRINTF( - "%s SW CirBuf = %d, HW FIFO wspace=%d AC=%d WI=%d RI=%d WE=%d RE=%d\r\n", - header,(dev->tx_out-dev->tx_in),space,ac,wi,ri,we,re); -#endif - - return; - -} - -/* In altera_avalon_jtag_uart.c - * Same output as the alarm function above, but this is called in the driver - * init function. Hence, it gives the status of the JTAG UART control register - * right at the initialization of the driver */ -void alt_log_jtag_uart_startup_info(altera_avalon_jtag_uart_state* dev, int base) -{ - const char* header="JTAG Startup Info:"; - alt_log_jtag_uart_print_control_reg(dev, base, header); - return; -} - -/* In altera_avalon_jtag_uart.c - * When turned on, this function will print out the status of the jtag uart - * control register every time there is a jtag uart "almost-empty" interrupt. */ -void alt_log_jtag_uart_isr_proc(int base, altera_avalon_jtag_uart_state* dev) -{ - if (alt_log_jtag_uart_isr_on_flag) { - const char* header="JTAG IRQ:"; - alt_log_jtag_uart_print_control_reg(dev, base, header); - } - return; -} - -#endif /* __ALTERA_AVALON_JTAG_UART */ - -/* In alt_write.c - * When the alt_log_write_on_flag is turned on, this function gets called - * every time alt_write gets called. The first - * ALT_LOG_WRITE_ECHO_LEN characters of every printf command (or any command - * that eventually calls write()) gets echoed to the alt_log output. */ -void alt_log_write(const void *ptr, size_t len) -{ - if (alt_log_write_on_flag) { - int temp_cnt; - int length=(ALT_LOG_WRITE_ECHO_LEN>len) ? len : ALT_LOG_WRITE_ECHO_LEN; - - if (length < 2) return; - - strncpy (alt_log_write_buf,ptr,length); - alt_log_write_buf[length-1]='\n'; - alt_log_write_buf[length]='\r'; - alt_log_write_buf[length+1]='\0'; - - /* Escape Ctrl-D's. If the Ctrl-D gets sent it might kill the terminal - * connection of alt_log. It will get replaced by 'D'. */ - for (temp_cnt=0;temp_cnt < length; temp_cnt++) { - if (alt_log_write_buf[temp_cnt]== 0x4) { - alt_log_write_buf[temp_cnt]='D'; - } - } - ALT_LOG_PRINTF("Write Echo: %s",alt_log_write_buf); - } -} - -/* In altera_avalon_timer_sc - * This function prints out a system clock is alive message - * every ALT_LOG_SYS_CLK_INTERVAL (in ticks). */ -void alt_log_system_clock() -{ - if (alt_log_sys_clk_on_flag) { - alt_log_sys_clk_count++; - if (alt_log_sys_clk_count > ALT_LOG_SYS_CLK_INTERVAL) { - alt_log_sys_clk_count = 0; - ALT_LOG_PRINTF("System Clock On %u\r\n",alt_system_clock_in_sec++); - } - } -} - - -#endif diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_lseek.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_lseek.c deleted file mode 100644 index 7857b0d..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_lseek.c +++ /dev/null @@ -1,117 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -#ifdef ALT_USE_DIRECT_DRIVERS - -off_t ALT_LSEEK (int file, off_t ptr, int dir) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(lseek); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -/* - * lseek() can be called to move the read/write pointer associated with the - * file descriptor "file". This function simply vectors the call to the lseek() - * function provided by the driver associated with the file descriptor. - * - * If the driver does not provide an implementation of lseek() an error is - * indicated. - * - * lseek() corresponds to the standard lseek() function. - * - * ALT_LSEEK is mapped onto the lseek() system call in alt_syscall.h - * - */ - -off_t ALT_LSEEK (int file, off_t ptr, int dir) -{ - alt_fd* fd; - off_t rc = 0; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - /* - * If the device driver provides an implementation of the lseek() function, - * then call that to process the request. - */ - - if (fd->dev->lseek) - { - rc = fd->dev->lseek(fd, ptr, dir); - } - /* - * Otherwise return an error. - */ - - else - { - rc = -ENOTSUP; - } - } - else - { - rc = -EBADFD; - } - - if (rc < 0) - { - ALT_ERRNO = -rc; - rc = -1; - } - - return rc; -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_main.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_main.c deleted file mode 100644 index a96229b..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_main.c +++ /dev/null @@ -1,161 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include -#include -#include -#include - -#include "sys/alt_dev.h" -#include "sys/alt_sys_init.h" -#include "sys/alt_irq.h" -#include "sys/alt_dev.h" - -#include "os/alt_hooks.h" - -#include "priv/alt_file.h" -#include "alt_types.h" - -#include "system.h" - -#include "sys/alt_log_printf.h" - -extern void _do_ctors(void); -extern void _do_dtors(void); - -/* - * Standard arguments for main. By default, no arguments are passed to main. - * However a device driver may choose to configure these arguments by calling - * alt_set_args(). The expectation is that this facility will only be used by - * the iclient/ihost utility. - */ - -int alt_argc = 0; -char** alt_argv = {NULL}; -char** alt_envp = {NULL}; - -/* - * Prototype for the entry point to the users application. - */ - -extern int main (int, char **, char **); - -/* - * alt_main is the C entry point for the HAL. It is called by the assembler - * startup code in the processor specific crt0.S. It is responsible for: - * completing the C runtime configuration; configuring all the - * devices/filesystems/components in the system; and call the entry point for - * the users application, i.e. main(). - */ - -void alt_main (void) -{ -#ifndef ALT_NO_EXIT - int result; -#endif - - /* ALT LOG - please see HAL/sys/alt_log_printf.h for details */ - ALT_LOG_PRINT_BOOT("[alt_main.c] Entering alt_main, calling alt_irq_init.\r\n"); - /* Initialize the interrupt controller. */ - alt_irq_init (NULL); - - /* Initialize the operating system */ - ALT_LOG_PRINT_BOOT("[alt_main.c] Done alt_irq_init, calling alt_os_init.\r\n"); - ALT_OS_INIT(); - - /* - * Initialize the semaphore used to control access to the file descriptor - * list. - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Done OS Init, calling alt_sem_create.\r\n"); - ALT_SEM_CREATE (&alt_fd_list_lock, 1); - - /* Initialize the device drivers/software components. */ - ALT_LOG_PRINT_BOOT("[alt_main.c] Calling alt_sys_init.\r\n"); - alt_sys_init(); - ALT_LOG_PRINT_BOOT("[alt_main.c] Done alt_sys_init.\r\n"); - -#if !defined(ALT_USE_DIRECT_DRIVERS) && (defined(ALT_STDIN_PRESENT) || defined(ALT_STDOUT_PRESENT) || defined(ALT_STDERR_PRESENT)) - - /* - * Redirect stdio to the apropriate devices now that the devices have - * been initialized. This is only done if the user has requested these - * devices be present (not equal to /dev/null) and if direct drivers - * aren't being used. - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Redirecting IO.\r\n"); - alt_io_redirect(ALT_STDOUT, ALT_STDIN, ALT_STDERR); -#endif - -#ifndef ALT_NO_C_PLUS_PLUS - /* - * Call the C++ constructors - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Calling C++ constructors.\r\n"); - _do_ctors (); -#endif /* ALT_NO_C_PLUS_PLUS */ - -#if !defined(ALT_NO_C_PLUS_PLUS) && !defined(ALT_NO_CLEAN_EXIT) && !defined(ALT_NO_EXIT) - /* - * Set the C++ destructors to be called at system shutdown. This is only done - * if a clean exit has been requested (i.e. the exit() function has not been - * redefined as _exit()). This is in the interest of reducing code footprint, - * in that the atexit() overhead is removed when it's not needed. - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Calling atexit.\r\n"); - atexit (_do_dtors); -#endif - - /* - * Finally, call main(). The return code is then passed to a subsequent - * call to exit() unless the application is never supposed to exit. - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Calling main.\r\n"); - -#ifdef ALT_NO_EXIT - main (alt_argc, alt_argv, alt_envp); -#else - result = main (alt_argc, alt_argv, alt_envp); - close(STDOUT_FILENO); - exit (result); -#endif - - ALT_LOG_PRINT_BOOT("[alt_main.c] After main - we should not be here?.\r\n"); -} - diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_malloc_lock.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_malloc_lock.c deleted file mode 100644 index 8c78f46..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_malloc_lock.c +++ /dev/null @@ -1,52 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -/* - * These are the empty malloc lock/unlock stubs required by newlib. These are - * used to make newlib's malloc() function thread safe. The default HAL - * configuration is single threaded, so there is nothing to do here. Note that - * this requires that malloc is never called by an interrupt service routine. - */ - -void __malloc_lock ( struct _reent *_r ) -{ -} - -/* - * - */ - -void __malloc_unlock ( struct _reent *_r ) -{ -} diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_mcount.S b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_mcount.S deleted file mode 100644 index 3837523..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_mcount.S +++ /dev/null @@ -1,198 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2010 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* mcount or _mcount is inserted by GCC before the function prologue of every - * function when a program is compiled for profiling. At the start of mcount, - * we guarantee that: - * ra = self_pc (an address in the function which called mcount) - * r8 = from_pc (an address in the function which called mcount's caller) - * - * Because this is always called at the start of a function we can corrupt - * r2,r3 and r11-r15. We must not corrupt r4-r7 (because they might contain - * function arguments for the instrumented function) or r8 (which holds ra - * for the instrumented function). - */ - - .global __mcount_fn_head - - .global mcount - - /* _mcount is used by gcc4 */ - .global _mcount - -_mcount: -mcount: - /* Use a hash to speed up locating fn_entry. We use bits 5 upwards to choose - * the bucket because bits 1:0 will always be 0, and because the distribution - * of values for bits 4:2 won't be even (aligning on cache line boundaries - * will skew it). Higher bits should be fairly random. - */ - /* fn_head = mcount_fn_head + (((unsigned int)self_pc >> 5) & (HASH_BUCKETS - 1)); */ - - srli r2, ra, 3 - movhi r3, %hiadj(__mcount_fn_head) - addi r3, r3, %lo(__mcount_fn_head) - andi r2, r2, 0xFC - add r11, r2, r3 - - /* The fast case is where we have already allocated a function arc, and so - * also a function pointer. - */ - - /* First find the function being called (using self_pc) */ - mov r10, r11 -0: - ldw r10, 0(r10) - beq r10, zero, .Lnew_arc - ldw r2, 4(r10) - bne r2, ra, 0b - - /* Found a function entry for this PC. Now look for an arc with a matching - * from_pc value. There will always be at least one arc. */ - ldw r3, 8(r10) -0: - ldw r2, 4(r3) - beq r2, r8, .Lfound_arc - ldw r3, 0(r3) - bne r3, zero, 0b - -.Lnew_arc: - addi sp, sp, -24 - -.LCFI0: - stw ra, 0(sp) - stw r4, 4(sp) - stw r5, 8(sp) - stw r6, 12(sp) - stw r7, 16(sp) - stw r8, 20(sp) - -.LCFI1: - /* __mcount_record(orig_ra, orig_r8, fn_entry, *fn_head); */ - mov r4, ra - mov r5, r8 - mov r6, r10 - mov r7, r11 - call __mcount_record - - /* restore registers from the stack */ - ldw ra, 0(sp) - ldw r4, 4(sp) - ldw r5, 8(sp) - ldw r6, 12(sp) - ldw r7, 16(sp) - ldw r8, 20(sp) - - addi sp, sp, 24 - -.LCFI2: - ret - -.Lfound_arc: - /* We've found the correct arc record. Increment the count and return */ - ldw r2, 8(r3) - addi r2, r2, 1 - stw r2, 8(r3) - ret - -.Lmcount_end: - - - -/* - * Dwarf2 debug information for the function. This provides GDB with the - * information it needs to backtrace out of this function. - */ - - .section .debug_frame,"",@progbits -.LCIE: - .4byte 2f - 1f /* Length */ -1: - .4byte 0xffffffff /* CIE id */ - .byte 0x1 /* Version */ - .string "" /* Augmentation */ - .uleb128 0x1 /* Code alignment factor */ - .sleb128 -4 /* Data alignment factor */ - .byte 0x1f /* Return address register */ - - .byte 0xc /* Define CFA */ - .uleb128 0x1b /* Register 27 (sp) */ - .uleb128 0x0 /* Offset 0 */ - - .align 2 /* Padding */ -2: - -.LFDE_mcount: - .4byte 2f - 1f /* Length */ -1: - .4byte .LCIE /* Pointer to CIE */ - .4byte mcount /* Start of table entry */ - .4byte .Lmcount_end - mcount /* Size of table entry */ - - .byte 0x4 /* Advance location */ - .4byte .LCFI0 - mcount /* to .LCFI0 */ - .byte 0xe /* Define CFA offset */ - .uleb128 24 /* to 24 */ - - .byte 0x4 /* Advance location */ - .4byte .LCFI1 - .LCFI0 /* to .LCFI1 */ - .byte 0x9f /* Store ra */ - .uleb128 0x6 /* at CFA-24 */ - .byte 0x84 /* Store r4 */ - .uleb128 0x5 /* at CFA-20 */ - .byte 0x85 /* Store r5 */ - .uleb128 0x4 /* at CFA-16 */ - .byte 0x86 /* Store r6 */ - .uleb128 0x3 /* at CFA-12 */ - .byte 0x87 /* Store r7 */ - .uleb128 0x2 /* at CFA-8 */ - .byte 0x88 /* Store r8 */ - .uleb128 0x1 /* at CFA-4 */ - - .byte 0x4 /* Advance location */ - .4byte .LCFI2 - .LCFI1 /* to .LCFI2 */ - .byte 0xe /* Define CFA offset */ - .uleb128 0 /* to 0 */ - .byte 0x8 /* Same value */ - .uleb128 31 /* for ra */ - .byte 0x8 /* Same value */ - .uleb128 4 /* for r4 */ - .byte 0x8 /* Same value */ - .uleb128 5 /* for r5 */ - .byte 0x8 /* Same value */ - .uleb128 6 /* for r6 */ - .byte 0x8 /* Same value */ - .uleb128 7 /* for r7 */ - .byte 0x8 /* Same value */ - .uleb128 8 /* for r8 */ - - .align 2 -2: - diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_open.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_open.c deleted file mode 100644 index 4790f53..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_open.c +++ /dev/null @@ -1,173 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "alt_types.h" -#include "os/alt_syscall.h" - -#ifdef ALT_USE_DIRECT_DRIVERS - -int ALT_OPEN (const char* file, int flags, int mode) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(open); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -extern alt_llist alt_dev_list; - -/* - * alt_file_locked() is used by open() to ensure that a device has not been - * previously locked for exclusive access using ioctl(). This test is only - * performed for devices. Filesystems are required to handle the ioctl() call - * themselves, and report the error from the filesystems open() function. - */ - -static int alt_file_locked (alt_fd* fd) -{ - alt_u32 i; - - /* - * Mark the file descriptor as belonging to a device. - */ - - fd->fd_flags |= ALT_FD_DEV; - - /* - * Loop through all current file descriptors searching for one that's locked - * for exclusive access. If a match is found, generate an error. - */ - - for (i = 0; i <= alt_max_fd; i++) - { - if ((alt_fd_list[i].dev == fd->dev) && - (alt_fd_list[i].fd_flags & ALT_FD_EXCL) && - (&alt_fd_list[i] != fd)) - { - return -EACCES; - } - } - - /* The device is not locked */ - - return 0; -} - -/* - * open() is called in order to get a file descriptor that reference the file - * or device named "name". This descriptor can then be used to manipulate the - * file/device using the standard system calls, e.g. write(), read(), ioctl() - * etc. - * - * This is equivalent to the standard open() system call. - * - * ALT_OPEN is mapped onto the open() system call in alt_syscall.h - */ - -int ALT_OPEN (const char* file, int flags, int mode) -{ - alt_dev* dev; - alt_fd* fd; - int index = -1; - int status = -ENODEV; - int isafs = 0; - - /* - * Check the device list, to see if a device with a matching name is - * registered. - */ - - if (!(dev = alt_find_dev (file, &alt_dev_list))) - { - /* No matching device, so try the filesystem list */ - - dev = alt_find_file (file); - isafs = 1; - } - - /* - * If a matching device or filesystem is found, allocate a file descriptor. - */ - - if (dev) - { - if ((index = alt_get_fd (dev)) < 0) - { - status = index; - } - else - { - fd = &alt_fd_list[index]; - fd->fd_flags = (flags & ~ALT_FD_FLAGS_MASK); - - /* If this is a device, ensure it isn't already locked */ - - if (isafs || ((status = alt_file_locked (fd)) >= 0)) - { - /* - * If the device or filesystem provides an open() callback function, - * call it now to perform any device/filesystem specific operations. - */ - - status = (dev->open) ? dev->open(fd, file, flags, mode): 0; - } - } - } - else - { - status = -ENODEV; - } - - /* Allocation failed, so clean up and return an error */ - - if (status < 0) - { - alt_release_fd (index); - ALT_ERRNO = -status; - return -1; - } - - /* return the reference upon success */ - - return index; -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_printf.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_printf.c deleted file mode 100644 index e742b57..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_printf.c +++ /dev/null @@ -1,127 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/* - * This file provides a very minimal printf implementation for use with very - * small applications. Only the following format strings are supported: - * %x - * %s - * %c - * %% - */ - -#include -#include "sys/alt_stdio.h" - -/* - * ALT printf function - */ -void -alt_printf(const char* fmt, ... ) -{ - va_list args; - va_start(args, fmt); - const char *w; - char c; - - /* Process format string. */ - w = fmt; - while ((c = *w++) != 0) - { - /* If not a format escape character, just print */ - /* character. Otherwise, process format string. */ - if (c != '%') - { - alt_putchar(c); - } - else - { - /* Get format character. If none */ - /* available, processing is complete. */ - if ((c = *w++) != 0) - { - if (c == '%') - { - /* Process "%" escape sequence. */ - alt_putchar(c); - } - else if (c == 'c') - { - int v = va_arg(args, int); - alt_putchar(v); - } - else if (c == 'x') - { - /* Process hexadecimal number format. */ - unsigned long v = va_arg(args, unsigned long); - unsigned long digit; - int digit_shift; - - /* If the number value is zero, just print and continue. */ - if (v == 0) - { - alt_putchar('0'); - continue; - } - - /* Find first non-zero digit. */ - digit_shift = 28; - while (!(v & (0xF << digit_shift))) - digit_shift -= 4; - - /* Print digits. */ - for (; digit_shift >= 0; digit_shift -= 4) - { - digit = (v & (0xF << digit_shift)) >> digit_shift; - if (digit <= 9) - c = '0' + digit; - else - c = 'a' + digit - 10; - alt_putchar(c); - } - } - else if (c == 's') - { - /* Process string format. */ - char *s = va_arg(args, char *); - - while(*s) - alt_putchar(*s++); - } - } - else - { - break; - } - } - } -} diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_putchar.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_putchar.c deleted file mode 100644 index badaa02..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_putchar.c +++ /dev/null @@ -1,59 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#ifdef ALT_USE_DIRECT_DRIVERS -#include "system.h" -#include "sys/alt_driver.h" -#include "sys/alt_stdio.h" -#endif - -/* - * Uses the ALT_DRIVER_WRITE() macro to call directly to driver if available. - * Otherwise, uses newlib provided putchar() routine. - */ -int -alt_putchar(int c) -{ -#ifdef ALT_USE_DIRECT_DRIVERS - ALT_DRIVER_WRITE_EXTERNS(ALT_STDOUT_DEV); - char c1 = (char)(c & 0xff); - - if (ALT_DRIVER_WRITE(ALT_STDOUT_DEV, &c1, 1, 0) == -1) { - return -1; - } - return c; -#else - return putchar(c); -#endif -} diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_putstr.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_putstr.c deleted file mode 100644 index 5345945..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_putstr.c +++ /dev/null @@ -1,55 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#ifdef ALT_USE_DIRECT_DRIVERS -#include -#include "system.h" -#include "sys/alt_driver.h" -#include "sys/alt_stdio.h" -#endif - -/* - * Uses the ALT_DRIVER_WRITE() macro to call directly to driver if available. - * Otherwise, uses newlib provided fputs() routine. - */ -int -alt_putstr(const char* str) -{ -#ifdef ALT_USE_DIRECT_DRIVERS - ALT_DRIVER_WRITE_EXTERNS(ALT_STDOUT_DEV); - return ALT_DRIVER_WRITE(ALT_STDOUT_DEV, str, strlen(str), 0); -#else - return fputs(str, stdout); -#endif -} diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_read.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_read.c deleted file mode 100644 index 1c89777..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_read.c +++ /dev/null @@ -1,125 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -/* - * The read() system call is used to read a block of data from a file or device. - * This function simply vectors the request to the device driver associated - * with the input file descriptor "file". - * - * ALT_READ is mapped onto the read() system call in alt_syscall.h - */ - -#ifdef ALT_USE_DIRECT_DRIVERS - -#include "system.h" -#include "sys/alt_driver.h" - -/* - * Provide minimal version that just reads from the stdin device when provided. - */ - -int ALT_READ (int file, void *ptr, size_t len) -{ -#ifdef ALT_STDIN_PRESENT - ALT_DRIVER_READ_EXTERNS(ALT_STDIN_DEV); -#endif - -#if !defined(ALT_STDIN_PRESENT) - /* Generate a link time warning, should this function ever be called. */ - ALT_STUB_WARNING(read); -#endif - - switch (file) { -#ifdef ALT_STDIN_PRESENT - case 0: /* stdin file descriptor */ - return ALT_DRIVER_READ(ALT_STDIN_DEV, ptr, len, 0); -#endif /* ALT_STDIN_PRESENT */ - default: - ALT_ERRNO = EBADFD; - return -1; - } -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -int ALT_READ (int file, void *ptr, size_t len) -{ - alt_fd* fd; - int rval; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - /* - * If the file has not been opened with read access, or if the driver does - * not provide an implementation of read(), generate an error. Otherwise - * call the drivers read() function to process the request. - */ - - if (((fd->fd_flags & O_ACCMODE) != O_WRONLY) && - (fd->dev->read)) - { - if ((rval = fd->dev->read(fd, ptr, len)) < 0) - { - ALT_ERRNO = -rval; - return -1; - } - return rval; - } - else - { - ALT_ERRNO = EACCES; - } - } - else - { - ALT_ERRNO = EBADFD; - } - return -1; -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_release_fd.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_release_fd.c deleted file mode 100644 index 84733a7..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_release_fd.c +++ /dev/null @@ -1,54 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - -/* - * alt_release_fd() is called to free an allocated file descriptor. This is - * done by setting the device pointer in the file descriptor structure to zero. - * - * File descriptors correcponding to standard in, standard out and standard - * error cannont be released backed to the pool. They are always reserved. - */ - -void alt_release_fd (int fd) -{ - if (fd > 2) - { - alt_fd_list[fd].fd_flags = 0; - alt_fd_list[fd].dev = 0; - } -} - - - diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_remap_cached.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_remap_cached.c deleted file mode 100644 index f61cb9c..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_remap_cached.c +++ /dev/null @@ -1,50 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003,2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "sys/alt_cache.h" -#include "system.h" - -#ifdef NIOS2_MMU_PRESENT -/* Convert KERNEL region address to IO region address */ -#define BYPASS_DCACHE_MASK (0x1 << 29) -#else -/* Set bit 31 of address to bypass D-cache */ -#define BYPASS_DCACHE_MASK (0x1 << 31) -#endif - -/* - * Convert a pointer to a block of uncached memory, into a block of - * cached memory. - */ - -void* alt_remap_cached (volatile void* ptr, alt_u32 len) -{ - return (void*) (((alt_u32) ptr) & ~BYPASS_DCACHE_MASK); -} diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_remap_uncached.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_remap_uncached.c deleted file mode 100644 index 7ff6302..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_remap_uncached.c +++ /dev/null @@ -1,51 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003,2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "sys/alt_cache.h" -#include "system.h" - -#ifdef NIOS2_MMU_PRESENT -/* Convert KERNEL region address to IO region address */ -#define BYPASS_DCACHE_MASK (0x1 << 29) -#else -/* Set bit 31 of address to bypass D-cache */ -#define BYPASS_DCACHE_MASK (0x1 << 31) -#endif - -/* - * Convert a pointer to a block of cached memory, into a block of - * uncached memory. - */ - -volatile void* alt_remap_uncached (void* ptr, alt_u32 len) -{ - alt_dcache_flush (ptr, len); - return (volatile void*) (((alt_u32) ptr) | BYPASS_DCACHE_MASK); -} diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_rename.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_rename.c deleted file mode 100644 index 48afac0..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_rename.c +++ /dev/null @@ -1,55 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "os/alt_syscall.h" - -/* - * _rename() is used by newlib to rename an existing file. This is unsupported - * in the HAL environment. However a "do-nothing" implementation is still - * provied for newlib compatability. - * - * ALT_RENAME is mapped onto the _rename() system call in alt_syscall.h - */ - -int ALT_RENAME (char *existing, char *new) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(_rename); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_sbrk.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_sbrk.c deleted file mode 100644 index b8c3799..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_sbrk.c +++ /dev/null @@ -1,136 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "os/alt_syscall.h" - -#include "sys/alt_irq.h" -#include "sys/alt_stack.h" - -#include "system.h" - -/* - * sbrk() is called to dynamically extend the data segment for the application. - * Thie input argument "incr" is the size of the block to allocate. - * - * This simple implementation does not perform any bounds checking. Memory will - * be allocated, even if the request region colides with the stack or overflows - * the available physical memory. - * - * ALT_SBRK is mapped onto the sbrk() system call in alt_syscall.h - * - * This function is called by the profiling code to allocate memory so must be - * safe if called from an interrupt context. It must also not be instrumented - * because that would lead to an infinate loop. - */ - -extern char __alt_heap_start[]; /* set by linker */ -extern char __alt_heap_limit[]; /* set by linker */ - -static char *heap_end = __alt_heap_start; - -#if defined(ALT_EXCEPTION_STACK) && defined(ALT_STACK_CHECK) -char * alt_exception_old_stack_limit = NULL; -#endif - -caddr_t ALT_SBRK (int incr) __attribute__ ((no_instrument_function )); - -caddr_t ALT_SBRK (int incr) -{ - alt_irq_context context; - char *prev_heap_end; - - context = alt_irq_disable_all(); - - /* Always return data aligned on a word boundary */ - heap_end = (char *)(((unsigned int)heap_end + 3) & ~3); - -#ifdef ALT_MAX_HEAP_BYTES - /* - * User specified a maximum heap size. Return -1 if it would - * be exceeded by this sbrk call. - */ - if (((heap_end + incr) - __alt_heap_start) > ALT_MAX_HEAP_BYTES) { - alt_irq_enable_all(context); - return (caddr_t)-1; - } -#else - if ((heap_end + incr) > __alt_heap_limit) { - alt_irq_enable_all(context); - return (caddr_t)-1; - } -#endif - - prev_heap_end = heap_end; - heap_end += incr; - -#ifdef ALT_STACK_CHECK - /* - * If the stack and heap are contiguous then extending the heap reduces the - * space available for the stack. If we are still using the default stack - * then adjust the stack limit to note this, while checking for stack - * pointer overflow. - * If the stack limit isn't pointing at the top of the heap then the code - * is using a different stack so none of this needs to be done. - */ - - if (alt_stack_limit() == prev_heap_end) - { - if (alt_stack_pointer() <= heap_end) - alt_report_stack_overflow(); - - alt_set_stack_limit(heap_end); - } - -#ifdef ALT_EXCEPTION_STACK - /* - * If we are executing from the exception stack then compare against the - * stack we switched away from as well. The exception stack is a fixed - * size so doesn't need to be checked. - */ - - if (alt_exception_old_stack_limit == prev_heap_end) - { - if (alt_exception_old_stack_limit <= heap_end) - alt_report_stack_overflow(); - - alt_exception_old_stack_limit = heap_end; - } -#endif - -#endif - - alt_irq_enable_all(context); - - return (caddr_t) prev_heap_end; -} diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_settod.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_settod.c deleted file mode 100644 index 59db0f8..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_settod.c +++ /dev/null @@ -1,96 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include "sys/alt_errno.h" -#include "sys/alt_alarm.h" -#include "os/alt_syscall.h" - -/* - * "alt_timezone" and "alt_resettime" are the values of the the reset time and - * time zone set through the last call to settimeofday(). By default they are - * zero initialised. - */ - -extern struct timezone alt_timezone; -extern struct timeval alt_resettime; - -/* - * Macro defining the number of micoseconds in a second. - */ - -#define ALT_US (1000000) - - -/* - * settimeofday() can be called to calibrate the system clock, so that - * subsequent calls to gettimeofday() will return the elapsed "wall clock" - * time. - * - * This is done by updating the global structures "alt_resettime" and - * "alt_timezone" so that an immediate call to gettimeofday() would return - * the value specified by "t" and "tz". - * - * Warning: if this function is called concurrently with a call to - * gettimeofday(), the value returned by gettimeofday() will be unreliable. - * - * ALT_SETTIMEOFDAY is mapped onto the settimeofday() system call in - * alt_syscall.h - */ - -int ALT_SETTIMEOFDAY (const struct timeval *t, - const struct timezone *tz) -{ - alt_u32 nticks = alt_nticks (); - alt_u32 tick_rate = alt_ticks_per_second (); - - /* If there is a system clock available, update the current time */ - - if (tick_rate) - { - alt_resettime.tv_sec = t->tv_sec - nticks/tick_rate; - alt_resettime.tv_usec = t->tv_usec - - ((nticks*(ALT_US/tick_rate))%ALT_US); - - alt_timezone.tz_minuteswest = tz->tz_minuteswest; - alt_timezone.tz_dsttime = tz->tz_dsttime; - - return 0; - } - - /* There's no system clock available */ - - ALT_ERRNO = ENOSYS; - return -1; -} diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_software_exception.S b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_software_exception.S deleted file mode 100644 index 2142594..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_software_exception.S +++ /dev/null @@ -1,53 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - - /* - * This file provides the global symbol: software_exception. It is provided to - * support legacy code, and should not be used by new software. - * - * It is used by legacy code to invoke the software exception handler as - * defined by version 1.0 of the Nios II kit. It should only be used when you - * are providing your own interrupt entry point, i.e. you are not using - * alt_irq_entry. - */ - -#include "system.h" - - /* - * Pull in the exception handler. - */ - - .globl alt_exception - - .section .exceptions.entry.label, "xa" - - .globl software_exception - .type software_exception, @function -software_exception: diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_stat.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_stat.c deleted file mode 100644 index 44e207b..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_stat.c +++ /dev/null @@ -1,59 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include -#include - -#include "os/alt_syscall.h" - -/* - * The stat() function is similar to the fstat() function in that it is used to - * obtain status information about a file. Instead of using an open file - * descriptor (like fstat()), stat() takes the name of a file as an input - * argument. - * - * ALT_STAT is mapped onto the stat() system call in alt_syscall.h - */ - -int ALT_STAT (const char *file, struct stat *st) -{ - int fd; - int rc; - - fd = open (file, 0); - rc = fstat (fd, st); - close (fd); - - return rc; -} diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_tick.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_tick.c deleted file mode 100644 index c73488d..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_tick.c +++ /dev/null @@ -1,149 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_irq.h" -#include "sys/alt_alarm.h" -#include "os/alt_hooks.h" -#include "alt_types.h" - -/* - * "_alt_tick_rate" is used to store the value of the system clock frequency - * in ticks per second. It is initialised to zero, which corresponds to there - * being no system clock facility available. - */ - -alt_u32 _alt_tick_rate = 0; - -/* - * "_alt_nticks" is the number of system clock ticks that have elapsed since - * reset. - */ - -volatile alt_u32 _alt_nticks = 0; - -/* - * "alt_alarm_list" is the head of a linked list of registered alarms. This is - * initialised to be an empty list. - */ - -ALT_LLIST_HEAD(alt_alarm_list); - -/* - * alt_alarm_stop() is called to remove an alarm from the list of registered - * alarms. Alternatively an alarm can unregister itself by returning zero when - * the alarm executes. - */ - -void alt_alarm_stop (alt_alarm* alarm) -{ - alt_irq_context irq_context; - - irq_context = alt_irq_disable_all(); - alt_llist_remove (&alarm->llist); - alt_irq_enable_all (irq_context); -} - -/* - * alt_tick() is periodically called by the system clock driver in order to - * process the registered list of alarms. Each alarm is registed with a - * callback interval, and a callback function, "callback". - * - * The return value of the callback function indicates how many ticks are to - * elapse until the next callback. A return value of zero indicates that the - * alarm should be deactivated. - * - * alt_tick() is expected to run at interrupt level. - */ - -void alt_tick (void) -{ - alt_alarm* next; - alt_alarm* alarm = (alt_alarm*) alt_alarm_list.next; - - alt_u32 next_callback; - - /* update the tick counter */ - - _alt_nticks++; - - /* process the registered callbacks */ - - while (alarm != (alt_alarm*) &alt_alarm_list) - { - next = (alt_alarm*) alarm->llist.next; - - /* - * Upon the tick-counter rolling over it is safe to clear the - * roll-over flag; once the flag is cleared this (or subsequnt) - * tick events are enabled to generate an alarm event. - */ - if ((alarm->rollover) && (_alt_nticks == 0)) - { - alarm->rollover = 0; - } - - /* if the alarm period has expired, make the callback */ - if ((alarm->time <= _alt_nticks) && (alarm->rollover == 0)) - { - next_callback = alarm->callback (alarm->context); - - /* deactivate the alarm if the return value is zero */ - - if (next_callback == 0) - { - alt_alarm_stop (alarm); - } - else - { - alarm->time += next_callback; - - /* - * If the desired alarm time causes a roll-over, set the rollover - * flag. This will prevent the subsequent tick event from causing - * an alarm too early. - */ - if(alarm->time < _alt_nticks) - { - alarm->rollover = 1; - } - } - } - alarm = next; - } - - /* - * Update the operating system specific timer facilities. - */ - - ALT_OS_TIME_TICK(); -} - diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_times.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_times.c deleted file mode 100644 index 4dd965d..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_times.c +++ /dev/null @@ -1,71 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "sys/alt_errno.h" -#include "sys/alt_alarm.h" -#include "os/alt_syscall.h" - -/* - * The times() function is used by newlib to obtain elapsed time information. - * The return value is the elapsed time since reset in system clock ticks. Note - * that this is distinct from the strict Posix version of times(), which should - * return the time since: 0 hours, 0 minutes, 0 seconds, January 1, 1970, GMT. - * - * The input structure is filled in with time accounting information. This - * implementation attributes all cpu time to the system. - * - * ALT_TIMES is mapped onto the times() system call in alt_syscall.h - */ - -clock_t ALT_TIMES (struct tms *buf) -{ - clock_t ticks = alt_nticks(); - - /* If there is no system clock present, generate an error */ - - if (!alt_ticks_per_second()) - { - ALT_ERRNO = ENOSYS; - return 0; - } - - /* Otherwise return the elapsed time */ - - buf->tms_utime = 0; - buf->tms_stime = ticks; - buf->tms_cutime = 0; - buf->tms_cstime = 0; - - return ticks; -} diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_uncached_free.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_uncached_free.c deleted file mode 100644 index 6e362ba..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_uncached_free.c +++ /dev/null @@ -1,49 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003,2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "sys/alt_cache.h" -#include "system.h" - -#ifdef NIOS2_MMU_PRESENT -/* Convert KERNEL region address to IO region address */ -#define BYPASS_DCACHE_MASK (0x1 << 29) -#else -/* Set bit 31 of address to bypass D-cache */ -#define BYPASS_DCACHE_MASK (0x1 << 31) -#endif - -/* - * Free a block of uncached memory. - */ - -void alt_uncached_free (volatile void* ptr) -{ - free ((void*) (((alt_u32) ptr) & ~BYPASS_DCACHE_MASK)); -} diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_uncached_malloc.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_uncached_malloc.c deleted file mode 100644 index ab3416d..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_uncached_malloc.c +++ /dev/null @@ -1,55 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003,2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "sys/alt_cache.h" -#include "system.h" - -#ifdef NIOS2_MMU_PRESENT -/* Convert KERNEL region address to IO region address */ -#define BYPASS_DCACHE_MASK (0x1 << 29) -#else -/* Set bit 31 of address to bypass D-cache */ -#define BYPASS_DCACHE_MASK (0x1 << 31) -#endif - -/* - * Allocate a block of uncached memory. - */ - -volatile void* alt_uncached_malloc (size_t size) -{ - void* ptr; - - ptr = malloc (size); - - alt_dcache_flush (ptr, size); - - return ptr ? (volatile void*) (((alt_u32) ptr) | BYPASS_DCACHE_MASK) : NULL; -} diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_unlink.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_unlink.c deleted file mode 100644 index 29e35d6..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_unlink.c +++ /dev/null @@ -1,55 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "os/alt_syscall.h" - -/* - * unlink() is used by newlib to delete an existing link to a file. This is - * unsupported in the HAL environment. However a "do-nothing" implementation - * is still provied for newlib compatability. - * - * ALT_UNLINK is mapped onto the unlink() system call in alt_syscall.h - */ - -int ALT_UNLINK (char *name) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(unlink); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_usleep.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_usleep.c deleted file mode 100644 index 2330eb8..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_usleep.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2003 Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - * - * ------------ - * - * Altera does not recommend, suggest or require that this reference design - * file be used in conjunction or combination with any other product. - * - * usleep.c - Microsecond delay routine - */ - -#include - -#include "priv/alt_busy_sleep.h" -#include "os/alt_syscall.h" - -/* - * This function simply calls alt_busy_sleep() to perform the delay. This - * function implements the delay as a calibrated "busy loop". - * - * ALT_USLEEP is mapped onto the usleep() system call in alt_syscall.h - */ - - - -#if defined (__GNUC__) && __GNUC__ >= 4 -int ALT_USLEEP (useconds_t us) -#else -unsigned int ALT_USLEEP (unsigned int us) -#endif -{ - return alt_busy_sleep(us); -} diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_wait.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_wait.c deleted file mode 100644 index a42f80f..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_wait.c +++ /dev/null @@ -1,52 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_errno.h" -#include "os/alt_syscall.h" - -/* - * wait() is used by newlib to wait for all child processes to exit. Since the - * HAL does not support spawning child processes, this returns immediately as - * there can't be anythign to wait for. - * - * ALT_WAIT is mapped onto the wait() system call in alt_syscall.h - */ - -int ALT_WAIT (int *status) -{ - *status = 0; - - ALT_ERRNO = ECHILD; - - return -1; -} - diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_write.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_write.c deleted file mode 100644 index 51debb5..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/alt_write.c +++ /dev/null @@ -1,138 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -#include "sys/alt_log_printf.h" - -/* - * The write() system call is used to write a block of data to a file or - * device. This function simply vectors the request to the device driver - * associated with the input file descriptor "file". - * - * ALT_WRITE is mapped onto the write() system call in alt_syscall.h - */ - -#ifdef ALT_USE_DIRECT_DRIVERS - -#include "system.h" -#include "sys/alt_driver.h" - -/* - * Provide minimal version that just writes to the stdout/stderr devices - * when provided. - */ - -int ALT_WRITE (int file, const void *ptr, size_t len) -{ -#ifdef ALT_STDOUT_PRESENT - ALT_DRIVER_WRITE_EXTERNS(ALT_STDOUT_DEV); -#endif -#ifdef ALT_STDERR_PRESENT - ALT_DRIVER_WRITE_EXTERNS(ALT_STDERR_DEV); -#endif - -#if !defined(ALT_STDOUT_PRESENT) && !defined(ALT_STDERR_PRESENT) - /* Generate a link time warning, should this function ever be called. */ - ALT_STUB_WARNING(write); -#endif - - switch (file) { -#ifdef ALT_STDOUT_PRESENT - case 1: /* stdout file descriptor */ - return ALT_DRIVER_WRITE(ALT_STDOUT_DEV, ptr, len, 0); -#endif /* ALT_STDOUT_PRESENT */ -#ifdef ALT_STDERR_PRESENT - case 2: /* stderr file descriptor */ - return ALT_DRIVER_WRITE(ALT_STDERR_DEV, ptr, len, 0); -#endif /* ALT_STDERR_PRESENT */ - default: - ALT_ERRNO = EBADFD; - return -1; - } -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -int ALT_WRITE (int file, const void *ptr, size_t len) -{ - alt_fd* fd; - int rval; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - /* - * If the file has not been opened with write access, or if the driver does - * not provide an implementation of write(), generate an error. Otherwise - * call the drivers write() function to process the request. - */ - - if (((fd->fd_flags & O_ACCMODE) != O_RDONLY) && fd->dev->write) - { - - /* ALT_LOG - see altera_hal/HAL/inc/sys/alt_log_printf.h */ - ALT_LOG_WRITE_FUNCTION(ptr,len); - - if ((rval = fd->dev->write(fd, ptr, len)) < 0) - { - ALT_ERRNO = -rval; - return -1; - } - return rval; - } - else - { - ALT_ERRNO = EACCES; - } - } - else - { - ALT_ERRNO = EBADFD; - } - return -1; -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/altera_nios2_qsys_irq.c b/software/qsys_tutorial_lcd3_bsp/HAL/src/altera_nios2_qsys_irq.c deleted file mode 100644 index c7a4f93..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/altera_nios2_qsys_irq.c +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2009 Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - * - * altera_nios2_irq.c - Support for Nios II internal interrupt controller. - * - */ - -#include "sys/alt_irq.h" -#include "altera_nios2_qsys_irq.h" - -/* - * To initialize the internal interrupt controller, just clear the IENABLE - * register so that all possible IRQs are disabled. - */ -void altera_nios2_qsys_irq_init(void) -{ - NIOS2_WRITE_IENABLE(0); -} diff --git a/software/qsys_tutorial_lcd3_bsp/HAL/src/crt0.S b/software/qsys_tutorial_lcd3_bsp/HAL/src/crt0.S deleted file mode 100644 index 582445d..0000000 --- a/software/qsys_tutorial_lcd3_bsp/HAL/src/crt0.S +++ /dev/null @@ -1,456 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "system.h" -#include "nios2.h" - -/* Setup header files to work with assembler code. */ -#define ALT_ASM_SRC - -/* Debug logging facility */ -#include "sys/alt_log_printf.h" - -/*************************************************************************\ -| MACROS | -\*************************************************************************/ - -/* - * The new build tools explicitly define macros when alt_load() - * must be called. The define ALT_LOAD_EXPLICITLY_CONTROLLED tells us that - * those macros are controlling if alt_load() needs to be called. - */ -#ifdef ALT_LOAD_EXPLICITLY_CONTROLLED - -/* Need to call alt_load() if any of these sections are being copied. */ -#if defined(ALT_LOAD_COPY_RODATA) || defined(ALT_LOAD_COPY_RWDATA) || defined(ALT_LOAD_COPY_EXCEPTIONS) -#define CALL_ALT_LOAD -#endif - -#else /* !ALT_LOAD_EXPLICITLY_CONTROLLED */ - -/* - * The legacy build tools use the following macros to detect when alt_load() - * needs to be called. - */ - -#define __ALT_LOAD_SECTIONS(res, text, rodata, exc) \ - ((res##_BASE != rodata##_BASE) || \ - (res##_BASE != rwdata##_BASE) || \ - (res##_BASE != exc##_BASE)) - -#define _ALT_LOAD_SECTIONS(res, text, rodata, exc) \ - __ALT_LOAD_SECTIONS(res, text, rodata, exc) - -#define ALT_LOAD_SECTIONS _ALT_LOAD_SECTIONS(ALT_RESET_DEVICE, \ - ALT_RODATA_DEVICE, \ - ALT_RWDATA_DEVICE, \ - ALT_EXCEPTIONS_DEVICE) - -/* Call alt_load() if there is no bootloader and ALT_LOAD_SECTIONS isn't 0. */ -#if defined(ALT_NO_BOOTLOADER) && ALT_LOAD_SECTIONS -#define CALL_ALT_LOAD -#endif - -#endif /* !ALT_LOAD_EXPLICITLY_CONTROLLED */ - -/* - * When the legacy build tools define a macro called ALT_NO_BOOTLOADER, - * it indicates that initialization code is allowed at the reset address. - * The new build tools define a macro called ALT_ALLOW_CODE_AT_RESET for - * the same purpose. - */ -#ifdef ALT_NO_BOOTLOADER -#define ALT_ALLOW_CODE_AT_RESET -#endif - -/*************************************************************************\ -| EXTERNAL REFERENCES | -\*************************************************************************/ - -/* - * The entry point for user code is either "main" in hosted mode, or - * "alt_main" in standalone mode. These are explicitly referenced here, - * to ensure they are built into the executable. This allows the user - * to build them into libraries, rather than supplying them in object - * files at link time. - */ - .globl main - .globl alt_main - -/* - * Create a reference to the software multiply/divide and trap handers, - * so that if they are provided, they will appear in the executable. - */ -#ifndef ALT_NO_INSTRUCTION_EMULATION - .globl alt_exception_muldiv -#endif -#ifdef ALT_TRAP_HANDLER - .globl alt_exception_trap -#endif - -/* - * Linker defined symbols used to initialize bss. - */ -.globl __bss_start -.globl __bss_end - -/*************************************************************************\ -| RESET SECTION (.entry) | -\*************************************************************************/ - -/* - * This is the reset entry point for Nios II. - * - * At reset, only the cache line which contain the reset vector is - * initialized by the hardware. The code within the first cache line - * initializes the remainder of the instruction cache. - */ - - .section .entry, "xa" - .align 5 - -/* - * Explicitly allow the use of r1 (the assembler temporary register) - * within this code. This register is normally reserved for the use of - * the assembler. - */ - .set noat - -/* - * Some tools want to know where the reset vector is. - * Code isn't always provided at the reset vector but at least the - * __reset label always contains the reset vector address because - * it is defined at the start of the .entry section. - */ - - .globl __reset - .type __reset, @function -__reset: - -/* - * Initialize the instruction cache if present (i.e. size > 0) and - * reset code is allowed unless optimizing for RTL simulation. - * RTL simulations can ensure the instruction cache is already initialized - * so skipping this loop speeds up RTL simulation. - */ - -#if NIOS2_ICACHE_SIZE > 0 && defined(ALT_ALLOW_CODE_AT_RESET) && !defined(ALT_SIM_OPTIMIZE) - /* Assume the instruction cache size is always a power of two. */ -#if NIOS2_ICACHE_SIZE > 0x8000 - movhi r2, %hi(NIOS2_ICACHE_SIZE) -#else - movui r2, NIOS2_ICACHE_SIZE -#endif - -0: - initi r2 - addi r2, r2, -NIOS2_ICACHE_LINE_SIZE - bgt r2, zero, 0b -1: - - /* - * The following debug information tells the ISS not to run the loop above - * but to perform its actions using faster internal code. - */ - .pushsection .debug_alt_sim_info - .int 1, 1, 0b, 1b - .popsection -#endif /* Initialize Instruction Cache */ - -/* - * Jump to the _start entry point in the .text section if reset code - * is allowed or if optimizing for RTL simulation. - */ -#if defined(ALT_ALLOW_CODE_AT_RESET) || defined(ALT_SIM_OPTIMIZE) - /* Jump to the _start entry point in the .text section. */ - movhi r1, %hi(_start) - ori r1, r1, %lo(_start) - jmp r1 - - .size __reset, . - __reset -#endif /* Jump to _start */ - -/* - * When not using exit, provide an _exit symbol to prevent unresolved - * references to _exit from the linker script. - */ -#ifdef ALT_NO_EXIT - .globl _exit -_exit: -#endif - -/*************************************************************************\ -| TEXT SECTION (.text) | -\*************************************************************************/ - -/* - * Start of the .text section, and also the code entry point when - * the code is executed by a bootloader rather than directly from reset. - */ - .section .text - .align 2 - - .globl _start - .type _start, @function -_start: - -/* - * Initialize the data cache if present (i.e. size > 0) and not - * optimizing for RTL simulation. - * RTL simulations can ensure the data cache is already initialized - * so skipping this loop speeds up RTL simulation. - */ - -#if NIOS2_DCACHE_SIZE > 0 && !defined(ALT_SIM_OPTIMIZE) - - /* Assume the data cache size is always a power of two. */ -#if NIOS2_DCACHE_SIZE > 0x8000 - movhi r2, %hi(NIOS2_DCACHE_SIZE) -#else - movui r2, NIOS2_DCACHE_SIZE -#endif - -0: - initd 0(r2) - addi r2, r2, -NIOS2_DCACHE_LINE_SIZE - bgt r2, zero, 0b -1: - - /* - * The following debug information tells the ISS not to run the loop above - * but to perform its actions using faster internal code. - */ - .pushsection .debug_alt_sim_info - .int 2, 1, 0b, 1b - .popsection - -#endif /* Initialize Data Cache */ - - /* Log that caches have been initialized. */ - ALT_LOG_PUTS(alt_log_msg_cache) - - /* Log that the stack pointer is about to be setup. */ - ALT_LOG_PUTS(alt_log_msg_stackpointer) - -#if (NIOS2_NUM_OF_SHADOW_REG_SETS == 0) - /* - * Now that the caches are initialized, set up the stack pointer. - * The value provided by the linker is assumed to be correctly aligned. - */ - movhi sp, %hi(__alt_stack_pointer) - ori sp, sp, %lo(__alt_stack_pointer) - - /* Set up the global pointer. */ - movhi gp, %hi(_gp) - ori gp, gp, %lo(_gp) - -#else /* NIOS2_NUM_OF_SHADOW_REG_SETS > 0 */ - - /* - * Set up the GP and SP in all shadow register sets. - */ - - /* - * Check current register set number, if CPU resets into a shadow register - * set, switch register set to 0 by writing zero to SSTATUS register and - * execute an ERET instruction that just jumps to the next PC address - * (use the NEXTPC instruction to get this). - */ - - rdctl r2, status - - /* Get the current register set number (STATUS.CRS). */ - andi r3, r2, NIOS2_STATUS_CRS_MSK - - /* Skip switch register set if STATUS.CRS is 0. */ - beq r3, zero, .Lskip_switch_reg_set - - .set nobreak - - /* Current register set is non-zero, set SSTATUS to 0. */ - mov sstatus, zero - - /* Get next pc and store in ea. */ - nextpc ea - - /* Point to instruction after eret. */ - addi ea, ea, 8 - - /* - * Execute ERET instruction that just jumps to the next PC address - */ - eret - -.Lskip_switch_reg_set: - mov r2, zero - - /* Reset STATUS register */ - wrctl status, r2 - - movui r3, NIOS2_NUM_OF_SHADOW_REG_SETS - - /* Set up the stack pointer in register set 0. */ - movhi sp, %hi(__alt_stack_pointer) - ori sp, sp, %lo(__alt_stack_pointer) - - /* Set up the global pointer in register set 0. */ - movhi gp, %hi(_gp) - ori gp, gp, %lo(_gp) - -.Lsetup_sp_and_gp_loop: - /* - * Setup GP and SP for shadow register set - * from NIOS2_NUM_OF_SHADOW_REG_SETS to 0 - */ - - /* Skip if number of register sets is 0. */ - beq r3, zero, .Lno_shadow_register_set - - - /* Add previous register set STATUS.PRS by 1 */ - movhi r4, 1 - add r2, r2, r4 - - /* Write STATUS */ - wrctl status, r2 - - /* Clear r0 in the shadow register set (not done by hardware) */ - wrprs r0, r0 - - /* Write the GP in previous register set */ - wrprs gp, gp - - /* Only write the SP in previous register set - * if using the seperate exception stack. For normal case (single stack), - * funnel code would read the SP from previous register set. - */ -#ifdef ALT_INTERRUPT_STACK - - movhi et, %hiadj(__alt_interrupt_stack_pointer) - addi et, et, %lo(__alt_interrupt_stack_pointer) - wrprs sp, et - -#endif /* ALT_INTERRUPT_STACK */ - - /* Decrease number of register set counter by 1 */ - addi r3, r3, -1 - - br .Lsetup_sp_and_gp_loop -.Lno_shadow_register_set: - -#endif /* NIOS2_NUM_OF_SHADOW_REG_SETS */ -/* - * Clear the BSS if not optimizing for RTL simulation. - * - * This uses the symbols: __bss_start and __bss_end, which are defined - * by the linker script. They mark the begining and the end of the bss - * region. The linker script guarantees that these values are word aligned. - */ -#ifndef ALT_SIM_OPTIMIZE - /* Log that the BSS is about to be cleared. */ - ALT_LOG_PUTS(alt_log_msg_bss) - - movhi r2, %hi(__bss_start) - ori r2, r2, %lo(__bss_start) - - movhi r3, %hi(__bss_end) - ori r3, r3, %lo(__bss_end) - - beq r2, r3, 1f - -0: - stw zero, (r2) - addi r2, r2, 4 - bltu r2, r3, 0b - -1: - - /* - * The following debug information tells the ISS not to run the loop above - * but to perform its actions using faster internal code. - */ - .pushsection .debug_alt_sim_info - .int 3, 1, 0b, 1b - .popsection -#endif /* ALT_SIM_OPTIMIZE */ - -/* - * The alt_load() facility is normally used when there is no bootloader. - * It copies some sections into RAM so it acts like a mini-bootloader. - */ -#ifdef CALL_ALT_LOAD - -#ifdef ALT_STACK_CHECK - /* - * If the user has selected stack checking then we need to set up a safe - * value in the stack limit register so that the relocation functions - * don't think the stack has overflowed (the contents of the rwdata - * section aren't defined until alt_load() has been called). - */ - mov et, zero -#endif - - call alt_load - -#endif /* CALL_ALT_LOAD */ - -#ifdef ALT_STACK_CHECK - /* - * Set up the stack limit (if required). The linker has set up the - * copy of the variable which is in memory. - */ - - ldw et, %gprel(alt_stack_limit_value)(gp) -#endif - - /* Log that alt_main is about to be called. */ - ALT_LOG_PUTS(alt_log_msg_alt_main) - - /* Call the C entry point. It should never return. */ - call alt_main - - /* Wait in infinite loop in case alt_main does return. */ -alt_after_alt_main: - br alt_after_alt_main - - .size _start, . - _start - -/* - * Add information about the stack base if stack overflow checking is enabled. - */ -#ifdef ALT_STACK_CHECK - .globl alt_stack_limit_value - .section .sdata,"aws",@progbits - .align 2 - .type alt_stack_limit_value, @object - .size alt_stack_limit_value, 4 -alt_stack_limit_value: - .long __alt_stack_limit -#endif diff --git a/software/qsys_tutorial_lcd3_bsp/Makefile b/software/qsys_tutorial_lcd3_bsp/Makefile deleted file mode 100644 index 168b158..0000000 --- a/software/qsys_tutorial_lcd3_bsp/Makefile +++ /dev/null @@ -1,775 +0,0 @@ -#------------------------------------------------------------------------------ -# BSP MAKEFILE -# -# This makefile was automatically generated by the nios2-bsp-generate-files -# command. Its purpose is to build a custom Board Support Package (BSP) -# targeting a specific Nios II processor in an SOPC Builder-based design. -# -# To create an application or library Makefile which uses this BSP, try the -# nios2-app-generate-makefile or nios2-lib-generate-makefile commands. -#------------------------------------------------------------------------------ - -#------------------------------------------------------------------------------ -# TOOLS -#------------------------------------------------------------------------------ - -MKDIR := mkdir -p -ECHO := echo -SPACE := $(empty) $(empty) - -#------------------------------------------------------------------------------ -# The adjust-path macro -# -# If COMSPEC is defined, Make is launched from Windows through -# Cygwin. This adjust-path macro will call 'cygpath -u' on all -# paths to ensure they are readable by Make. -# -# If COMSPEC is not defined, Make is launched from *nix, and no adjustment -# is necessary -#------------------------------------------------------------------------------ - -ifndef COMSPEC -ifdef ComSpec -COMSPEC = $(ComSpec) -endif # ComSpec -endif # !COMSPEC - -ifdef COMSPEC - adjust-path = $(subst $(SPACE),\$(SPACE),$(shell cygpath -u "$1")) - adjust-path-mixed = $(subst $(SPACE),\$(SPACE),$(shell cygpath -m "$1")) -else - adjust-path = $(subst $(SPACE),\$(SPACE),$1) - adjust-path-mixed = $(subst $(SPACE),\$(SPACE),$1) -endif - -#------------------------------------------------------------------------------ -# DEFAULT TARGET -# -# The default target, "all", must appear before any other target in the -# Makefile. Note that extra prerequisites are added to the "all" rule later. -#------------------------------------------------------------------------------ -.PHONY: all -all: - @$(ECHO) [BSP build complete] - - -#------------------------------------------------------------------------------ -# PATHS & DIRECTORY NAMES -# -# Explicitly locate absolute path of the BSP root -#------------------------------------------------------------------------------ - -BSP_ROOT_DIR := . - -# Define absolute path to the root of the BSP. -ABS_BSP_ROOT := $(call adjust-path-mixed,$(shell pwd)) - -# Stash all BSP object files here -OBJ_DIR := ./obj - -NEWLIB_DIR = $(BSP_ROOT_DIR)/newlib - - -#------------------------------------------------------------------------------ -# MANAGED CONTENT -# -# All content between the lines "START MANAGED" and "END MANAGED" below is -# generated based on variables in the BSP settings file when the -# nios2-bsp-generate-files command is invoked. If you wish to persist any -# information pertaining to the build process, it is recomended that you -# utilize the BSP settings mechanism to do so. -# -# Note that most variable assignments in this section have a corresponding BSP -# setting that can be changed by using the nios2-bsp-create-settings or -# nios2-bsp-update-settings command before nios2-bsp-generate-files; if you -# want any variable set to a specific value when this Makefile is re-generated -# (to prevent hand-edits from being over-written), use the BSP settings -# facilities above. -#------------------------------------------------------------------------------ - -#START MANAGED - -# The following TYPE comment allows tools to identify the 'type' of target this -# makefile is associated with. -# TYPE: BSP_PRIVATE_MAKEFILE - -# This following VERSION comment indicates the version of the tool used to -# generate this makefile. A makefile variable is provided for VERSION as well. -# ACDS_VERSION: 13.0sp1 -ACDS_VERSION := 13.0sp1 - -# This following BUILD_NUMBER comment indicates the build number of the tool -# used to generate this makefile. -# BUILD_NUMBER: 232 - -SETTINGS_FILE := settings.bsp -SOPC_FILE := C:/Users/takayun/Documents/DE2-115/qsys_tutorial/nios_system.sopcinfo - -#------------------------------------------------------------------------------- -# TOOL & COMMAND DEFINITIONS -# -# The base command for each build operation are expressed here. Additional -# switches may be expressed here. They will run for all instances of the -# utility. -#------------------------------------------------------------------------------- - -# Archiver command. Creates library files. -AR = nios2-elf-ar - -# Assembler command. Note that CC is used for .S files. -AS = nios2-elf-gcc - -# Custom flags only passed to the archiver. This content of this variable is -# directly passed to the archiver rather than the more standard "ARFLAGS". The -# reason for this is that GNU Make assumes some default content in ARFLAGS. -# This setting defines the value of BSP_ARFLAGS in Makefile. -BSP_ARFLAGS = -src - -# Custom flags only passed to the assembler. This setting defines the value of -# BSP_ASFLAGS in Makefile. -BSP_ASFLAGS = -Wa,-gdwarf2 - -# C/C++ compiler debug level. '-g' provides the default set of debug symbols -# typically required to debug a typical application. Omitting '-g' removes -# debug symbols from the ELF. This setting defines the value of -# BSP_CFLAGS_DEBUG in Makefile. -BSP_CFLAGS_DEBUG = -g - -# C/C++ compiler optimization level. "-O0" = no optimization,"-O2" = "normal" -# optimization, etc. "-O0" is recommended for code that you want to debug since -# compiler optimization can remove variables and produce non-sequential -# execution of code while debugging. This setting defines the value of -# BSP_CFLAGS_OPTIMIZATION in Makefile. -BSP_CFLAGS_OPTIMIZATION = -O0 - -# C/C++ compiler warning level. "-Wall" is commonly used.This setting defines -# the value of BSP_CFLAGS_WARNINGS in Makefile. -BSP_CFLAGS_WARNINGS = -Wall - -# C compiler command. -CC = nios2-elf-gcc -xc - -# C++ compiler command. -CXX = nios2-elf-gcc -xc++ - -# Command used to remove files during 'clean' target. -RM = rm -f - - -#------------------------------------------------------------------------------- -# BUILD PRE & POST PROCESS COMMANDS -# -# The following variables are treated as shell commands in the rule -# definitions for each file-type associated with the BSP build, as well as -# commands run at the beginning and end of the entire BSP build operation. -# Pre-process commands are executed before the relevant command (for example, -# a command defined in the "CC_PRE_PROCESS" variable executes before the C -# compiler for building .c files), while post-process commands are executed -# immediately afterwards. -# -# You can view each pre/post-process command in the "Build Rules: All & -# Clean", "Pattern Rules to Build Objects", and "Library Rules" sections of -# this Makefile. -#------------------------------------------------------------------------------- - - -#------------------------------------------------------------------------------- -# BSP SOURCE BUILD SETTINGS (FLAG GENERATION) -# -# Software build settings such as compiler optimization, debug level, warning -# flags, etc., may be defined in the following variables. The variables below -# are concatenated together in the 'Flags' section of this Makefile to form -# final variables of flags passed to the build tools. -# -# These settings are considered private to the BSP and apply to all library & -# driver files in it; they do NOT automatically propagate to, for example, the -# build settings for an application. -# # For additional detail and syntax requirements, please refer to GCC help -# (example: "nios2-elf-gcc --help --verbose"). -# -# Unless indicated otherwise, multiple entries in each variable should be -# space-separated. -#------------------------------------------------------------------------------- - -# Altera HAL alt_sys_init.c generated source file -GENERATED_C_FILES := $(ABS_BSP_ROOT)/alt_sys_init.c -GENERATED_C_LIB_SRCS += alt_sys_init.c - - -#------------------------------------------------------------------------------- -# BSP SOURCE FILE LISTING -# -# All source files that comprise the BSP are listed here, along with path -# information to each file expressed relative to the BSP root. The precise -# list and location of each file is derived from the driver, operating system, -# or software package source file declarations. -# -# Following specification of the source files for each component, driver, etc., -# each source file type (C, assembly, etc.) is concatenated together and used -# to construct a list of objects. Pattern rules to build each object are then -# used to build each file. -#------------------------------------------------------------------------------- - -# altera_avalon_jtag_uart_driver sources root -altera_avalon_jtag_uart_driver_SRCS_ROOT := drivers - -# altera_avalon_jtag_uart_driver sources -altera_avalon_jtag_uart_driver_C_LIB_SRCS := \ - $(altera_avalon_jtag_uart_driver_SRCS_ROOT)/src/altera_avalon_jtag_uart_init.c \ - $(altera_avalon_jtag_uart_driver_SRCS_ROOT)/src/altera_avalon_jtag_uart_read.c \ - $(altera_avalon_jtag_uart_driver_SRCS_ROOT)/src/altera_avalon_jtag_uart_write.c \ - $(altera_avalon_jtag_uart_driver_SRCS_ROOT)/src/altera_avalon_jtag_uart_ioctl.c \ - $(altera_avalon_jtag_uart_driver_SRCS_ROOT)/src/altera_avalon_jtag_uart_fd.c - -# altera_avalon_lcd_16207_driver sources root -altera_avalon_lcd_16207_driver_SRCS_ROOT := drivers - -# altera_avalon_lcd_16207_driver sources -altera_avalon_lcd_16207_driver_C_LIB_SRCS := \ - $(altera_avalon_lcd_16207_driver_SRCS_ROOT)/src/altera_avalon_lcd_16207.c \ - $(altera_avalon_lcd_16207_driver_SRCS_ROOT)/src/altera_avalon_lcd_16207_fd.c - -# altera_avalon_pio_driver sources root -altera_avalon_pio_driver_SRCS_ROOT := drivers - -# altera_avalon_pio_driver sources -# altera_nios2_qsys_hal_driver sources root -altera_nios2_qsys_hal_driver_SRCS_ROOT := HAL - -# altera_nios2_qsys_hal_driver sources -altera_nios2_qsys_hal_driver_C_LIB_SRCS := \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/altera_nios2_qsys_irq.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_usleep.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_busy_sleep.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_irq_vars.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_icache_flush.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_icache_flush_all.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_dcache_flush.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_dcache_flush_all.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_dcache_flush_no_writeback.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_instruction_exception_entry.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_irq_register.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_iic.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_remap_cached.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_remap_uncached.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_uncached_free.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_uncached_malloc.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_do_ctors.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_do_dtors.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_gmon.c - -altera_nios2_qsys_hal_driver_ASM_LIB_SRCS := \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_exception_entry.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_exception_trap.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_exception_muldiv.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_irq_entry.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_software_exception.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_mcount.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_log_macro.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/crt0.S - -# hal sources root -hal_SRCS_ROOT := HAL - -# hal sources -hal_C_LIB_SRCS := \ - $(hal_SRCS_ROOT)/src/alt_alarm_start.c \ - $(hal_SRCS_ROOT)/src/alt_close.c \ - $(hal_SRCS_ROOT)/src/alt_dev.c \ - $(hal_SRCS_ROOT)/src/alt_dev_llist_insert.c \ - $(hal_SRCS_ROOT)/src/alt_dma_rxchan_open.c \ - $(hal_SRCS_ROOT)/src/alt_dma_txchan_open.c \ - $(hal_SRCS_ROOT)/src/alt_environ.c \ - $(hal_SRCS_ROOT)/src/alt_env_lock.c \ - $(hal_SRCS_ROOT)/src/alt_errno.c \ - $(hal_SRCS_ROOT)/src/alt_execve.c \ - $(hal_SRCS_ROOT)/src/alt_exit.c \ - $(hal_SRCS_ROOT)/src/alt_fcntl.c \ - $(hal_SRCS_ROOT)/src/alt_fd_lock.c \ - $(hal_SRCS_ROOT)/src/alt_fd_unlock.c \ - $(hal_SRCS_ROOT)/src/alt_find_dev.c \ - $(hal_SRCS_ROOT)/src/alt_find_file.c \ - $(hal_SRCS_ROOT)/src/alt_flash_dev.c \ - $(hal_SRCS_ROOT)/src/alt_fork.c \ - $(hal_SRCS_ROOT)/src/alt_fs_reg.c \ - $(hal_SRCS_ROOT)/src/alt_fstat.c \ - $(hal_SRCS_ROOT)/src/alt_get_fd.c \ - $(hal_SRCS_ROOT)/src/alt_getchar.c \ - $(hal_SRCS_ROOT)/src/alt_getpid.c \ - $(hal_SRCS_ROOT)/src/alt_gettod.c \ - $(hal_SRCS_ROOT)/src/alt_iic_isr_register.c \ - $(hal_SRCS_ROOT)/src/alt_instruction_exception_register.c \ - $(hal_SRCS_ROOT)/src/alt_ioctl.c \ - $(hal_SRCS_ROOT)/src/alt_io_redirect.c \ - $(hal_SRCS_ROOT)/src/alt_irq_handler.c \ - $(hal_SRCS_ROOT)/src/alt_isatty.c \ - $(hal_SRCS_ROOT)/src/alt_kill.c \ - $(hal_SRCS_ROOT)/src/alt_link.c \ - $(hal_SRCS_ROOT)/src/alt_load.c \ - $(hal_SRCS_ROOT)/src/alt_log_printf.c \ - $(hal_SRCS_ROOT)/src/alt_lseek.c \ - $(hal_SRCS_ROOT)/src/alt_main.c \ - $(hal_SRCS_ROOT)/src/alt_malloc_lock.c \ - $(hal_SRCS_ROOT)/src/alt_open.c \ - $(hal_SRCS_ROOT)/src/alt_printf.c \ - $(hal_SRCS_ROOT)/src/alt_putchar.c \ - $(hal_SRCS_ROOT)/src/alt_putstr.c \ - $(hal_SRCS_ROOT)/src/alt_read.c \ - $(hal_SRCS_ROOT)/src/alt_release_fd.c \ - $(hal_SRCS_ROOT)/src/alt_rename.c \ - $(hal_SRCS_ROOT)/src/alt_sbrk.c \ - $(hal_SRCS_ROOT)/src/alt_settod.c \ - $(hal_SRCS_ROOT)/src/alt_stat.c \ - $(hal_SRCS_ROOT)/src/alt_tick.c \ - $(hal_SRCS_ROOT)/src/alt_times.c \ - $(hal_SRCS_ROOT)/src/alt_unlink.c \ - $(hal_SRCS_ROOT)/src/alt_wait.c \ - $(hal_SRCS_ROOT)/src/alt_write.c - - -# Assemble all component C source files -COMPONENT_C_LIB_SRCS += \ - $(altera_avalon_jtag_uart_driver_C_LIB_SRCS) \ - $(altera_avalon_lcd_16207_driver_C_LIB_SRCS) \ - $(altera_nios2_qsys_hal_driver_C_LIB_SRCS) \ - $(hal_C_LIB_SRCS) - -# Assemble all component assembly source files -COMPONENT_ASM_LIB_SRCS += \ - $(altera_nios2_qsys_hal_driver_ASM_LIB_SRCS) - -# Assemble all component C++ source files -COMPONENT_CPP_LIB_SRCS += \ - -#END MANAGED - -#------------------------------------------------------------------------------ -# PUBLIC.MK -# -# The generated public.mk file contains BSP information that is shared with -# other external makefiles, such as a Nios II application makefile. System- -# dependent information such as hardware-specific compiler flags and -# simulation file generation are stored here. -# -# In addition, public.mk contains include paths that various software, -# such as a device driver, may need for the C compiler. These paths are -# written to public.mk with respect to the BSP root. In public.mk, each -# path is prefixed with a special variable, $(ALT_LIBRARY_ROOT_DIR). The -# purpose of this variable is to allow an external Makefile to append on -# path information to precisely locate paths expressed in public.mk -# Since this is the BSP Makefile, we set ALT_LIBRARY_ROOT_DIR to point right -# here ("."), at the BSP root. -# -# ALT_LIBRARY_ROOT_DIR must always be set before public.mk is included. -#------------------------------------------------------------------------------ -ALT_LIBRARY_ROOT_DIR := . -include public.mk - - -#------------------------------------------------------------------------------ -# FLAGS -# -# Include paths for BSP files are written into the public.mk file and must -# be added to the existing list of pre-processor flags. In addition, "hooks" -# for standard flags left intentionally empty (CFLAGS, CPPFLAGS, ASFLAGS, -# and CXXFLAGS) are provided for conveniently adding to the relevant flags -# on the command-line or via script that calls make. -#------------------------------------------------------------------------------ -# Assemble final list of compiler flags from generated content -BSP_CFLAGS += \ - $(BSP_CFLAGS_DEFINED_SYMBOLS) \ - $(BSP_CFLAGS_UNDEFINED_SYMBOLS) \ - $(BSP_CFLAGS_OPTIMIZATION) \ - $(BSP_CFLAGS_DEBUG) \ - $(BSP_CFLAGS_WARNINGS) \ - $(BSP_CFLAGS_USER_FLAGS) \ - $(ALT_CFLAGS) \ - $(CFLAGS) - -# Make ready the final list of include directories and other C pre-processor -# flags. Each include path is made ready by prefixing it with "-I". -BSP_CPPFLAGS += \ - $(addprefix -I, $(BSP_INC_DIRS)) \ - $(addprefix -I, $(ALT_INCLUDE_DIRS)) \ - $(ALT_CPPFLAGS) \ - $(CPPFLAGS) - -# Finish off assembler flags with any user-provided flags -BSP_ASFLAGS += $(ASFLAGS) - -# Finish off C++ flags with any user-provided flags -BSP_CXXFLAGS += $(CXXFLAGS) - -# And finally, the ordered list -C_SRCS += $(GENERATED_C_LIB_SRCS) \ - $(COMPONENT_C_LIB_SRCS) - -CXX_SRCS += $(GENERATED_CPP_LIB_SRCS) \ - $(COMPONENT_CPP_LIB_SRCS) - -ASM_SRCS += $(GENERATED_ASM_LIB_SRCS) \ - $(COMPONENT_ASM_LIB_SRCS) - - -#------------------------------------------------------------------------------ -# LIST OF GENERATED FILES -# -# A Nios II BSP relies on the generation of several source files used -# by both the BSP and any applications referencing the BSP. -#------------------------------------------------------------------------------ - - -GENERATED_H_FILES := $(ABS_BSP_ROOT)/system.h - -GENERATED_LINKER_SCRIPT := $(ABS_BSP_ROOT)/linker.x - -GENERATED_FILES += $(GENERATED_H_FILES) \ - $(GENERATED_LINKER_SCRIPT) - - -#------------------------------------------------------------------------------ -# SETUP TO BUILD OBJECTS -# -# List of object files which are to be built. This is constructed from the input -# list of C source files (C_SRCS), C++ source files (CXX_SRCS), and assembler -# source file (ASM_SRCS). The permitted file extensions are: -# -# .c .C - for C files -# .cxx .cc .cpp .CXX .CC .CPP - for C++ files -# .S .s - for assembly files -# -# Extended description: The list of objects is a sorted list (duplicates -# removed) of all possible objects, placed beneath the ./obj directory, -# including any path information stored in the "*_SRCS" variable. The -# "patsubst" commands are used to concatenate together multiple file suffix -# types for common files (i.e. c++ as .cxx, .cc, .cpp). -# -# File extensions are case-insensitive in build rules with the exception of -# assembly sources. Nios II assembly sources with the ".S" extension are first -# run through the C preprocessor. Sources with the ".s" extension are not. -#------------------------------------------------------------------------------ -OBJS = $(sort $(addprefix $(OBJ_DIR)/, \ - $(patsubst %.c, %.o, $(patsubst %.C, %.o, $(C_SRCS))) \ - $(patsubst %.cxx, %.o, $(patsubst %.CXX, %.o, \ - $(patsubst %.cc, %.o, $(patsubst %.CC, %.o, \ - $(patsubst %.cpp, %.o, $(patsubst %.CPP, %.o, \ - $(CXX_SRCS) )))))) \ - $(patsubst %.S, %.o, $(patsubst %.s, %.o, $(ASM_SRCS))) )) - -# List of dependancy files for each object file. -DEPS = $(OBJS:.o=.d) - - -# Rules to force your project to rebuild or relink -# .force_relink file will cause any application that depends on this project to relink -# .force_rebuild file will cause this project to rebuild object files -# .force_rebuild_all file will cause this project and any project that depends on this project to rebuild object files - -FORCE_RELINK_DEP := .force_relink -FORCE_REBUILD_DEP := .force_rebuild -FORCE_REBUILD_ALL_DEP := .force_rebuild_all -FORCE_REBUILD_DEP_LIST := $(FORCE_RELINK_DEP) $(FORCE_REBUILD_DEP) $(FORCE_REBUILD_ALL_DEP) - -$(FORCE_REBUILD_DEP_LIST): - -$(OBJS): $(wildcard $(FORCE_REBUILD_DEP)) $(wildcard $(FORCE_REBUILD_ALL_DEP)) - - -#------------------------------------------------------------------------------ -# BUILD RULES: ALL & CLEAN -#------------------------------------------------------------------------------ -.DELETE_ON_ERROR: - -.PHONY: all -all: build_pre_process -all: Makefile $(GENERATED_FILES) $(BSP_LIB) $(NEWLIB_DIR) -all: build_post_process - - -# clean: remove .o/.a/.d -.PHONY: clean -clean: - @$(RM) -r $(BSP_LIB) $(OBJ_DIR) $(FORCE_REBUILD_DEP_LIST) -ifneq ($(wildcard $(NEWLIB_DIR)),) - @$(RM) -r $(NEWLIB_DIR) -endif - @$(ECHO) [BSP clean complete] - - -#------------------------------------------------------------------------------ -# BUILD PRE/POST PROCESS -#------------------------------------------------------------------------------ -build_pre_process : - $(BUILD_PRE_PROCESS) - -build_post_process : - $(BUILD_POST_PROCESS) - -.PHONY: build_pre_process build_post_process - - - -#------------------------------------------------------------------------------ -# MAKEFILE UP TO DATE? -# -# Is this very Makefile up to date? Someone may have changed the BSP settings -# file or the associated target hardware. -#------------------------------------------------------------------------------ -# Skip this check when clean is the only target -ifneq ($(MAKECMDGOALS),clean) - -ifneq ($(wildcard $(SETTINGS_FILE)),$(SETTINGS_FILE)) -$(warning Warning: BSP Settings File $(SETTINGS_FILE) could not be found.) -endif - -Makefile: $(wildcard $(SETTINGS_FILE)) - @$(ECHO) Makefile not up to date. - @$(ECHO) $(SETTINGS_FILE) has been modified since the BSP Makefile was generated. - @$(ECHO) - @$(ECHO) Generate the BSP to update the Makefile, and then build again. - @$(ECHO) - @$(ECHO) To generate from Eclipse: - @$(ECHO) " 1. Right-click the BSP project." - @$(ECHO) " 2. In the Nios II Menu, click Generate BSP." - @$(ECHO) - @$(ECHO) To generate from the command line: - @$(ECHO) " nios2-bsp-generate-files --settings= --bsp-dir=" - @$(ECHO) - @exit 1 - -ifneq ($(wildcard $(SOPC_FILE)),$(SOPC_FILE)) -$(warning Warning: SOPC File $(SOPC_FILE) could not be found.) -endif - -public.mk: $(wildcard $(SOPC_FILE)) - @$(ECHO) Makefile not up to date. - @$(ECHO) $(SOPC_FILE) has been modified since the BSP was generated. - @$(ECHO) - @$(ECHO) Generate the BSP to update the Makefile, and then build again. - @$(ECHO) - @$(ECHO) To generate from Eclipse: - @$(ECHO) " 1. Right-click the BSP project." - @$(ECHO) " 2. In the Nios II Menu, click Generate BSP." - @$(ECHO) - @$(ECHO) To generate from the command line: - @$(ECHO) " nios2-bsp-generate-files --settings= --bsp-dir=" - @$(ECHO) - @exit 1 - -endif # $(MAKECMDGOALS) != clean - -#------------------------------------------------------------------------------ -# PATTERN RULES TO BUILD OBJECTS -#------------------------------------------------------------------------------ -$(OBJ_DIR)/%.o: %.c - @$(ECHO) Compiling $( - -/* - * Device headers - */ - -#include "altera_nios2_qsys_irq.h" -#include "altera_avalon_jtag_uart.h" -#include "altera_avalon_lcd_16207.h" - -/* - * Allocate the device storage - */ - -ALTERA_NIOS2_QSYS_IRQ_INSTANCE ( NIOS2_PROCESSOR, nios2_processor); -ALTERA_AVALON_JTAG_UART_INSTANCE ( JTAG_UART, jtag_uart); -ALTERA_AVALON_LCD_16207_INSTANCE ( LCD_16207_0, lcd_16207_0); - -/* - * Initialize the interrupt controller devices - * and then enable interrupts in the CPU. - * Called before alt_sys_init(). - * The "base" parameter is ignored and only - * present for backwards-compatibility. - */ - -void alt_irq_init ( const void* base ) -{ - ALTERA_NIOS2_QSYS_IRQ_INIT ( NIOS2_PROCESSOR, nios2_processor); - alt_irq_cpu_enable_interrupts(); -} - -/* - * Initialize the non-interrupt controller devices. - * Called after alt_irq_init(). - */ - -void alt_sys_init( void ) -{ - ALTERA_AVALON_JTAG_UART_INIT ( JTAG_UART, jtag_uart); - ALTERA_AVALON_LCD_16207_INIT ( LCD_16207_0, lcd_16207_0); -} diff --git a/software/qsys_tutorial_lcd3_bsp/create-this-bsp b/software/qsys_tutorial_lcd3_bsp/create-this-bsp deleted file mode 100644 index e8d0dc7..0000000 --- a/software/qsys_tutorial_lcd3_bsp/create-this-bsp +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/bash -# -# This script creates the ucosii_net_zipfs Board Support Package (BSP). - -BSP_TYPE=hal -BSP_DIR=. -SOPC_DIR=../../ -SOPC_FILE=C:/Users/takayun/Documents/DE2-115/qsys_tutorial/nios_system.sopcinfo -NIOS2_BSP_ARGS="" -CPU_NAME= - - -# Don't run make if create-this-app script is called with --no-make arg -SKIP_MAKE= -while [ $# -gt 0 ] -do - case "$1" in - --no-make) - SKIP_MAKE=1 - ;; - *) - NIOS2_BSP_ARGS="$NIOS2_BSP_ARGS $1" - ;; - esac - shift -done - - -# Run nios2-bsp utility to create a hal BSP in this directory -# for the system with a .sopc file in $SOPC_FILE. -# Deprecating $SOPC_DIR in 10.1. Multiple .sopcinfo files in a directory may exist. - -if [ -z "$SOPC_FILE" ]; then - echo "WARNING: Use of a directory for locating a .sopcinfo file is deprecated in 10.1. Multiple .sopcinfo files may exist. You must specify the full .sopcinfo path." - cmd="nios2-bsp $BSP_TYPE $BSP_DIR $SOPC_DIR $NIOS2_BSP_ARGS $CPU_NAME" -else - cmd="nios2-bsp $BSP_TYPE $BSP_DIR $SOPC_FILE $NIOS2_BSP_ARGS $CPU_NAME" -fi - - -echo "create-this-bsp: Running \"$cmd\"" -$cmd || { - echo "$cmd failed" - exit 1 -} -if [ -z "$SKIP_MAKE" ]; then - echo "create-this-bsp: Running make" - make -fi diff --git a/software/qsys_tutorial_lcd3_bsp/drivers/inc/altera_avalon_jtag_uart.h b/software/qsys_tutorial_lcd3_bsp/drivers/inc/altera_avalon_jtag_uart.h deleted file mode 100644 index 95d4a99..0000000 --- a/software/qsys_tutorial_lcd3_bsp/drivers/inc/altera_avalon_jtag_uart.h +++ /dev/null @@ -1,198 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#ifndef __ALT_AVALON_JTAG_UART_H__ -#define __ALT_AVALON_JTAG_UART_H__ - -#include - -#include "sys/alt_alarm.h" -#include "sys/alt_warning.h" - -#include "os/alt_sem.h" -#include "os/alt_flag.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * If the user wants all drivers to be small rather than fast then make sure - * this one is marked as needing to be small. - */ -#if defined ALT_USE_SMALL_DRIVERS && !defined ALTERA_AVALON_JTAG_UART_SMALL -#define ALTERA_AVALON_JTAG_UART_SMALL -#endif - -/* - * If the user wants to ignore FIFO full error after timeout - */ -#if defined ALT_JTAG_UART_IGNORE_FIFO_FULL_ERROR && !defined ALTERA_AVALON_JTAG_UART_IGNORE_FIFO_FULL_ERROR -#define ALTERA_AVALON_JTAG_UART_IGNORE_FIFO_FULL_ERROR -#endif - -/* - * Constants that can be overriden. - */ -#ifndef ALTERA_AVALON_JTAG_UART_DEFAULT_TIMEOUT -#define ALTERA_AVALON_JTAG_UART_DEFAULT_TIMEOUT 10 -#endif - -#ifndef ALTERA_AVALON_JTAG_UART_BUF_LEN -#define ALTERA_AVALON_JTAG_UART_BUF_LEN 2048 -#endif - -/* - * ALT_JTAG_UART_READ_RDY and ALT_JTAG_UART_WRITE_RDY are the bitmasks - * that define uC/OS-II event flags that are releated to this device. - * - * ALT_JTAG_UART_READ_RDY indicates that there is read data in the buffer - * ready to be processed. ALT_JTAG_UART_WRITE_RDY indicates that the transmitter is - * ready for more data. - */ -#define ALT_JTAG_UART_READ_RDY 0x1 -#define ALT_JTAG_UART_WRITE_RDY 0x2 -#define ALT_JTAG_UART_TIMEOUT 0x4 - -/* - * State structure definition. Each instance of the driver uses one - * of these structures to hold its associated state. - */ - -typedef struct altera_avalon_jtag_uart_state_s -{ - unsigned int base; - -#ifndef ALTERA_AVALON_JTAG_UART_SMALL - - unsigned int timeout; /* Timeout until host is assumed inactive */ - alt_alarm alarm; - unsigned int irq_enable; - unsigned int host_inactive; - - ALT_SEM (read_lock) - ALT_SEM (write_lock) - ALT_FLAG_GRP (events) - - /* The variables below are volatile because they are modified by the - * interrupt routine. Making them volatile and reading them atomically - * means that we don't need any large critical sections. - */ - volatile unsigned int rx_in; - unsigned int rx_out; - unsigned int tx_in; - volatile unsigned int tx_out; - char rx_buf[ALTERA_AVALON_JTAG_UART_BUF_LEN]; - char tx_buf[ALTERA_AVALON_JTAG_UART_BUF_LEN]; - -#endif /* !ALTERA_AVALON_JTAG_UART_SMALL */ - -} altera_avalon_jtag_uart_state; - -/* - * Macros used by alt_sys_init when the ALT file descriptor facility isn't used. - */ - -#ifdef ALTERA_AVALON_JTAG_UART_SMALL - -#define ALTERA_AVALON_JTAG_UART_STATE_INSTANCE(name, state) \ - altera_avalon_jtag_uart_state state = \ - { \ - name##_BASE, \ - } - -#define ALTERA_AVALON_JTAG_UART_STATE_INIT(name, state) - -#else /* !ALTERA_AVALON_JTAG_UART_SMALL */ - -#define ALTERA_AVALON_JTAG_UART_STATE_INSTANCE(name, state) \ - altera_avalon_jtag_uart_state state = \ - { \ - name##_BASE, \ - ALTERA_AVALON_JTAG_UART_DEFAULT_TIMEOUT, \ - } - -/* - * Externally referenced routines - */ -extern void altera_avalon_jtag_uart_init(altera_avalon_jtag_uart_state* sp, - int irq_controller_id, int irq); - -#define ALTERA_AVALON_JTAG_UART_STATE_INIT(name, state) \ - { \ - if (name##_IRQ == ALT_IRQ_NOT_CONNECTED) \ - { \ - ALT_LINK_ERROR ("Error: Interrupt not connected for " #name ". " \ - "You have selected the interrupt driven version of " \ - "the ALTERA Avalon JTAG UART driver, but the " \ - "interrupt is not connected for this device. You can " \ - "select a polled mode driver by checking the 'small " \ - "driver' option in the HAL configuration window, or " \ - "by using the -DALTERA_AVALON_JTAG_UART_SMALL " \ - "preprocessor flag."); \ - } \ - else \ - altera_avalon_jtag_uart_init(&state, \ - name##_IRQ_INTERRUPT_CONTROLLER_ID, \ - name##_IRQ); \ - } - -#endif /* ALTERA_AVALON_JTAG_UART_SMALL */ - -/* - * Include in case non-direct version of driver required. - */ -#include "altera_avalon_jtag_uart_fd.h" - -/* - * Map alt_sys_init macros to direct or non-direct versions. - */ -#ifdef ALT_USE_DIRECT_DRIVERS - -#define ALTERA_AVALON_JTAG_UART_INSTANCE(name, state) \ - ALTERA_AVALON_JTAG_UART_STATE_INSTANCE(name, state) -#define ALTERA_AVALON_JTAG_UART_INIT(name, state) \ - ALTERA_AVALON_JTAG_UART_STATE_INIT(name, state) - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -#define ALTERA_AVALON_JTAG_UART_INSTANCE(name, dev) \ - ALTERA_AVALON_JTAG_UART_DEV_INSTANCE(name, dev) -#define ALTERA_AVALON_JTAG_UART_INIT(name, dev) \ - ALTERA_AVALON_JTAG_UART_DEV_INIT(name, dev) - -#endif /* ALT_USE_DIRECT_DRIVERS */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_AVALON_JTAG_UART_H__ */ diff --git a/software/qsys_tutorial_lcd3_bsp/drivers/inc/altera_avalon_jtag_uart_fd.h b/software/qsys_tutorial_lcd3_bsp/drivers/inc/altera_avalon_jtag_uart_fd.h deleted file mode 100644 index b3c3200..0000000 --- a/software/qsys_tutorial_lcd3_bsp/drivers/inc/altera_avalon_jtag_uart_fd.h +++ /dev/null @@ -1,125 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#ifndef __ALT_AVALON_JTAG_UART_FD_H__ -#define __ALT_AVALON_JTAG_UART_FD_H__ - -#include "sys/alt_dev.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * Externally referenced routines - */ -extern int altera_avalon_jtag_uart_read_fd (alt_fd* fd, char* ptr, int len); -extern int altera_avalon_jtag_uart_write_fd (alt_fd* fd, const char* ptr, - int len); - -/* - * Device structure definition. This is needed by alt_sys_init in order to - * reserve memory for the device instance. - */ - -typedef struct altera_avalon_jtag_uart_dev_s -{ - alt_dev dev; - altera_avalon_jtag_uart_state state; -} altera_avalon_jtag_uart_dev; - -/* - * Macros used by alt_sys_init when the ALT file descriptor facility is used. - */ - -#ifdef ALTERA_AVALON_JTAG_UART_SMALL - -#define ALTERA_AVALON_JTAG_UART_DEV_INSTANCE(name, d) \ - static altera_avalon_jtag_uart_dev d = \ - { \ - { \ - ALT_LLIST_ENTRY, \ - name##_NAME, \ - NULL, /* open */ \ - NULL, /* close */ \ - altera_avalon_jtag_uart_read_fd, \ - altera_avalon_jtag_uart_write_fd, \ - NULL, /* lseek */ \ - NULL, /* fstat */ \ - NULL, /* ioctl */ \ - }, \ - { \ - name##_BASE, \ - } \ - } - -#define ALTERA_AVALON_JTAG_UART_DEV_INIT(name, d) alt_dev_reg (&d.dev) - -#else /* !ALTERA_AVALON_JTAG_UART_SMALL */ - -extern int altera_avalon_jtag_uart_close_fd(alt_fd* fd); -extern int altera_avalon_jtag_uart_ioctl_fd (alt_fd* fd, int req, void* arg); - -#define ALTERA_AVALON_JTAG_UART_DEV_INSTANCE(name, d) \ - static altera_avalon_jtag_uart_dev d = \ - { \ - { \ - ALT_LLIST_ENTRY, \ - name##_NAME, \ - NULL, /* open */ \ - altera_avalon_jtag_uart_close_fd, \ - altera_avalon_jtag_uart_read_fd, \ - altera_avalon_jtag_uart_write_fd, \ - NULL, /* lseek */ \ - NULL, /* fstat */ \ - altera_avalon_jtag_uart_ioctl_fd, \ - }, \ - { \ - name##_BASE, \ - ALTERA_AVALON_JTAG_UART_DEFAULT_TIMEOUT, \ - } \ - } - -#define ALTERA_AVALON_JTAG_UART_DEV_INIT(name, d) \ - { \ - ALTERA_AVALON_JTAG_UART_STATE_INIT(name, d.state); \ - \ - /* make the device available to the system */ \ - alt_dev_reg(&d.dev); \ - } - -#endif /* ALTERA_AVALON_JTAG_UART_SMALL */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_AVALON_JTAG_UART_FD_H__ */ diff --git a/software/qsys_tutorial_lcd3_bsp/drivers/inc/altera_avalon_jtag_uart_regs.h b/software/qsys_tutorial_lcd3_bsp/drivers/inc/altera_avalon_jtag_uart_regs.h deleted file mode 100644 index 7f97160..0000000 --- a/software/qsys_tutorial_lcd3_bsp/drivers/inc/altera_avalon_jtag_uart_regs.h +++ /dev/null @@ -1,73 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#ifndef __ALTERA_AVALON_JTAG_UART_REGS_H__ -#define __ALTERA_AVALON_JTAG_UART_REGS_H__ - -#include - -#define ALTERA_AVALON_JTAG_UART_DATA_REG 0 -#define IOADDR_ALTERA_AVALON_JTAG_UART_DATA(base) \ - __IO_CALC_ADDRESS_NATIVE(base, ALTERA_AVALON_JTAG_UART_DATA_REG) -#define IORD_ALTERA_AVALON_JTAG_UART_DATA(base) \ - IORD(base, ALTERA_AVALON_JTAG_UART_DATA_REG) -#define IOWR_ALTERA_AVALON_JTAG_UART_DATA(base, data) \ - IOWR(base, ALTERA_AVALON_JTAG_UART_DATA_REG, data) - -#define ALTERA_AVALON_JTAG_UART_DATA_DATA_MSK (0x000000FF) -#define ALTERA_AVALON_JTAG_UART_DATA_DATA_OFST (0) -#define ALTERA_AVALON_JTAG_UART_DATA_RVALID_MSK (0x00008000) -#define ALTERA_AVALON_JTAG_UART_DATA_RVALID_OFST (15) -#define ALTERA_AVALON_JTAG_UART_DATA_RAVAIL_MSK (0xFFFF0000) -#define ALTERA_AVALON_JTAG_UART_DATA_RAVAIL_OFST (16) - - -#define ALTERA_AVALON_JTAG_UART_CONTROL_REG 1 -#define IOADDR_ALTERA_AVALON_JTAG_UART_CONTROL(base) \ - __IO_CALC_ADDRESS_NATIVE(base, ALTERA_AVALON_JTAG_UART_CONTROL_REG) -#define IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base) \ - IORD(base, ALTERA_AVALON_JTAG_UART_CONTROL_REG) -#define IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(base, data) \ - IOWR(base, ALTERA_AVALON_JTAG_UART_CONTROL_REG, data) - -#define ALTERA_AVALON_JTAG_UART_CONTROL_RE_MSK (0x00000001) -#define ALTERA_AVALON_JTAG_UART_CONTROL_RE_OFST (0) -#define ALTERA_AVALON_JTAG_UART_CONTROL_WE_MSK (0x00000002) -#define ALTERA_AVALON_JTAG_UART_CONTROL_WE_OFST (1) -#define ALTERA_AVALON_JTAG_UART_CONTROL_RI_MSK (0x00000100) -#define ALTERA_AVALON_JTAG_UART_CONTROL_RI_OFST (8) -#define ALTERA_AVALON_JTAG_UART_CONTROL_WI_MSK (0x00000200) -#define ALTERA_AVALON_JTAG_UART_CONTROL_WI_OFST (9) -#define ALTERA_AVALON_JTAG_UART_CONTROL_AC_MSK (0x00000400) -#define ALTERA_AVALON_JTAG_UART_CONTROL_AC_OFST (10) -#define ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_MSK (0xFFFF0000) -#define ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_OFST (16) - -#endif /* __ALTERA_AVALON_JTAG_UART_REGS_H__ */ diff --git a/software/qsys_tutorial_lcd3_bsp/drivers/inc/altera_avalon_lcd_16207.h b/software/qsys_tutorial_lcd3_bsp/drivers/inc/altera_avalon_lcd_16207.h deleted file mode 100644 index 2024b9a..0000000 --- a/software/qsys_tutorial_lcd3_bsp/drivers/inc/altera_avalon_lcd_16207.h +++ /dev/null @@ -1,158 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#ifndef __ALTERA_AVALON_LCD_16207_H__ -#define __ALTERA_AVALON_LCD_16207_H__ - -#include - -#include "sys/alt_alarm.h" -#include "os/alt_sem.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The altera_avalon_lcd_16207_dev structure is used to hold device specific - * data. This includes the transmit and receive buffers. - * - * An instance of this structure is created in the auto-generated - * alt_sys_init.c file for each UART listed in the systems PTF file. This is - * done using the ALTERA_AVALON_LCD_16207_STATE_INSTANCE macro given below. - */ - -#define ALT_LCD_HEIGHT 2 -#define ALT_LCD_WIDTH 16 -#define ALT_LCD_VIRTUAL_WIDTH 80 - -typedef struct altera_avalon_lcd_16207_state_s -{ - int base; - - alt_alarm alarm; - int period; - - char broken; - - unsigned char x; - unsigned char y; - char address; - char esccount; - - char scrollpos; - char scrollmax; - char active; /* If non-zero then the foreground routines are - * active so the timer call must not update the - * display. */ - - char escape[8]; - - struct - { - char visible[ALT_LCD_WIDTH]; - char data[ALT_LCD_VIRTUAL_WIDTH+1]; - char width; - unsigned char speed; - - } line[ALT_LCD_HEIGHT]; - - ALT_SEM (write_lock)/* Semaphore used to control access to the - * write buffer in multi-threaded mode */ -} altera_avalon_lcd_16207_state; - -/* - * Called by alt_sys_init.c to initialize the driver. - */ -extern void altera_avalon_lcd_16207_init(altera_avalon_lcd_16207_state* sp); - -/* - * The LCD panel driver is not trivial, so leave it out in the small - * drivers case. Also leave it out in simulation because there is no - * simulated hardware for the LCD panel. These two can be overridden - * by defining ALT_USE_LCE_16207 if you really want it. - */ - -#if (!defined(ALT_USE_SMALL_DRIVERS) && !defined(ALT_SIM_OPTIMIZE)) || defined ALT_USE_LCD_16207 - -/* - * Used by the auto-generated file - * alt_sys_init.c to create an instance of this device driver. - */ -#define ALTERA_AVALON_LCD_16207_STATE_INSTANCE(name, state) \ - altera_avalon_lcd_16207_state state = \ - { \ - name##_BASE \ - } - -/* - * The macro ALTERA_AVALON_LCD_16207_INIT is used by the auto-generated file - * alt_sys_init.c to initialize an instance of the device driver. - */ -#define ALTERA_AVALON_LCD_16207_STATE_INIT(name, state) \ - altera_avalon_lcd_16207_init(&state) - -#else /* exclude driver */ - -#define ALTERA_AVALON_LCD_16207_STATE_INSTANCE(name, state) extern int alt_no_storage -#define ALTERA_AVALON_LCD_16207_STATE_INIT(name, state) while (0) - -#endif /* exclude driver */ - -/* - * Include in case non-direct version of driver required. - */ -#include "altera_avalon_lcd_16207_fd.h" - -/* - * Map alt_sys_init macros to direct or non-direct versions. - */ -#ifdef ALT_USE_DIRECT_DRIVERS - -#define ALTERA_AVALON_LCD_16207_INSTANCE(name, state) \ - ALTERA_AVALON_LCD_16207_STATE_INSTANCE(name, state) -#define ALTERA_AVALON_LCD_16207_INIT(name, state) \ - ALTERA_AVALON_LCD_16207_STATE_INIT(name, state) - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -#define ALTERA_AVALON_LCD_16207_INSTANCE(name, dev) \ - ALTERA_AVALON_LCD_16207_DEV_INSTANCE(name, dev) -#define ALTERA_AVALON_LCD_16207_INIT(name, dev) \ - ALTERA_AVALON_LCD_16207_DEV_INIT(name, dev) - -#endif /* ALT_USE_DIRECT_DRIVERS */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALTERA_AVALON_LCD_16207_H__ */ diff --git a/software/qsys_tutorial_lcd3_bsp/drivers/inc/altera_avalon_lcd_16207_fd.h b/software/qsys_tutorial_lcd3_bsp/drivers/inc/altera_avalon_lcd_16207_fd.h deleted file mode 100644 index 370927b..0000000 --- a/software/qsys_tutorial_lcd3_bsp/drivers/inc/altera_avalon_lcd_16207_fd.h +++ /dev/null @@ -1,108 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#ifndef __ALTERA_AVALON_LCD_16207_FD_H__ -#define __ALTERA_AVALON_LCD_16207_FD_H__ - -#include "sys/alt_dev.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * Externally referenced routines - */ -extern int altera_avalon_lcd_16207_write_fd(alt_fd* fd, const char* ptr, - int len); - -/* - * Device structure definition. This is needed by alt_sys_init in order to - * reserve memory for the device instance. - */ - -typedef struct altera_avalon_lcd_16207_dev_s -{ - alt_dev dev; - altera_avalon_lcd_16207_state state; -} altera_avalon_lcd_16207_dev; - -/* - * The LCD panel driver is not trivial, so leave it out in the small - * drivers case. Also leave it out in simulation because there is no - * simulated hardware for the LCD panel. These two can be overridden - * by defining ALT_USE_LCE_16207 if you really want it. - */ - -#if (!defined(ALT_USE_SMALL_DRIVERS) && !defined(ALT_SIM_OPTIMIZE)) || defined ALT_USE_LCD_16207 - -/* - * Macros used by alt_sys_init when the ALT file descriptor facility is used. - */ -#define ALTERA_AVALON_LCD_16207_DEV_INSTANCE(name, d) \ - static altera_avalon_lcd_16207_dev d = \ - { \ - { \ - ALT_LLIST_ENTRY, \ - name##_NAME, \ - NULL, /* open */ \ - NULL, /* close */ \ - NULL, /* read */ \ - altera_avalon_lcd_16207_write_fd, \ - NULL, /* lseek */ \ - NULL, /* fstat */ \ - NULL, /* ioctl */ \ - }, \ - { \ - name##_BASE \ - }, \ - } - -#define ALTERA_AVALON_LCD_16207_DEV_INIT(name, d) \ - { \ - ALTERA_AVALON_LCD_16207_STATE_INIT(name, d.state); \ - \ - /* make the device available to the system */ \ - alt_dev_reg(&d.dev); \ - } - -#else /* exclude driver */ - -#define ALTERA_AVALON_LCD_16207_DEV_INSTANCE(name, d) extern int alt_no_storage -#define ALTERA_AVALON_LCD_16207_DEV_INIT(name, d) while (0) - -#endif - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALTERA_AVALON_LCD_16207_FD_H__ */ diff --git a/software/qsys_tutorial_lcd3_bsp/drivers/inc/altera_avalon_lcd_16207_regs.h b/software/qsys_tutorial_lcd3_bsp/drivers/inc/altera_avalon_lcd_16207_regs.h deleted file mode 100644 index 79e29a6..0000000 --- a/software/qsys_tutorial_lcd3_bsp/drivers/inc/altera_avalon_lcd_16207_regs.h +++ /dev/null @@ -1,83 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#ifndef __ALTERA_AVALON_LCD_16207_REGS_H__ -#define __ALTERA_AVALON_LCD_16207_REGS_H__ - -/* -/////////////////////////////////////////////////////////////////////////// -// -// ALTERA_AVALON_LCD_16207 PERIPHERAL -// -// Provides a hardware interface that allows software to -// access the two (2) internal 8-bit registers in an Optrex -// model 16207 (or equivalent) character LCD display (the kind -// shipped with the Nios Development Kit, 2 rows x 16 columns). -// -// Because the interface to the LCD module is "not quite Avalon," -// the hardware in this module ends-up mapping the module's -// two physical read-write registers into four Avalon-visible -// registers: Two read-only registers and two write-only registers. -// A picture is worth a thousand words: -// -// THE REGISTER MAP -// -// 7 6 5 4 3 2 1 0 Offset -// +-----+-----+-----+-----+-----+-----+-----+-----+ -// RS = 0 | Command Register (WRITE-Only) | 0 -// +-----+-----+-----+-----+-----+-----+-----+-----+ -// RS = 0 | Status Register (READ -Only) | 1 -// +-----+-----+-----+-----+-----+-----+-----+-----+ -// RS = 1 | Data Register (WRITE-Only) | 2 -// +-----+-----+-----+-----+-----+-----+-----+-----+ -// RS = 1 | Data Register (READ -Only) | 3 -// +-----+-----+-----+-----+-----+-----+-----+-----+ -// -/////////////////////////////////////////////////////////////////////////// -*/ - -#include - -#define IOADDR_ALTERA_AVALON_LCD_16207_COMMAND(base) __IO_CALC_ADDRESS_NATIVE(base, 0) -#define IOWR_ALTERA_AVALON_LCD_16207_COMMAND(base, data) IOWR(base, 0, data) - -#define IOADDR_ALTERA_AVALON_LCD_16207_STATUS(base) __IO_CALC_ADDRESS_NATIVE(base, 1) -#define IORD_ALTERA_AVALON_LCD_16207_STATUS(base) IORD(base, 1) - -#define ALTERA_AVALON_LCD_16207_STATUS_BUSY_MSK (0x00000080u) -#define ALTERA_AVALON_LCD_16207_STATUS_BUSY_OFST (7) - -#define IOADDR_ALTERA_AVALON_LCD_16207_DATA_WR(base) __IO_CALC_ADDRESS_NATIVE(base, 2) -#define IOWR_ALTERA_AVALON_LCD_16207_DATA(base, data) IOWR(base, 2, data) - -#define IOADDR_ALTERA_AVALON_LCD_16207_DATA_RD(base) __IO_CALC_ADDRESS_NATIVE(base, 3) -#define IORD_ALTERA_AVALON_LCD_16207_DATA(base) IORD(base, 3) - -#endif diff --git a/software/qsys_tutorial_lcd3_bsp/drivers/inc/altera_avalon_pio_regs.h b/software/qsys_tutorial_lcd3_bsp/drivers/inc/altera_avalon_pio_regs.h deleted file mode 100644 index 052439f..0000000 --- a/software/qsys_tutorial_lcd3_bsp/drivers/inc/altera_avalon_pio_regs.h +++ /dev/null @@ -1,67 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#ifndef __ALTERA_AVALON_PIO_REGS_H__ -#define __ALTERA_AVALON_PIO_REGS_H__ - -#include - -#define IOADDR_ALTERA_AVALON_PIO_DATA(base) __IO_CALC_ADDRESS_NATIVE(base, 0) -#define IORD_ALTERA_AVALON_PIO_DATA(base) IORD(base, 0) -#define IOWR_ALTERA_AVALON_PIO_DATA(base, data) IOWR(base, 0, data) - -#define IOADDR_ALTERA_AVALON_PIO_DIRECTION(base) __IO_CALC_ADDRESS_NATIVE(base, 1) -#define IORD_ALTERA_AVALON_PIO_DIRECTION(base) IORD(base, 1) -#define IOWR_ALTERA_AVALON_PIO_DIRECTION(base, data) IOWR(base, 1, data) - -#define IOADDR_ALTERA_AVALON_PIO_IRQ_MASK(base) __IO_CALC_ADDRESS_NATIVE(base, 2) -#define IORD_ALTERA_AVALON_PIO_IRQ_MASK(base) IORD(base, 2) -#define IOWR_ALTERA_AVALON_PIO_IRQ_MASK(base, data) IOWR(base, 2, data) - -#define IOADDR_ALTERA_AVALON_PIO_EDGE_CAP(base) __IO_CALC_ADDRESS_NATIVE(base, 3) -#define IORD_ALTERA_AVALON_PIO_EDGE_CAP(base) IORD(base, 3) -#define IOWR_ALTERA_AVALON_PIO_EDGE_CAP(base, data) IOWR(base, 3, data) - - -#define IOADDR_ALTERA_AVALON_PIO_SET_BIT(base) __IO_CALC_ADDRESS_NATIVE(base, 4) -#define IORD_ALTERA_AVALON_PIO_SET_BITS(base) IORD(base, 4) -#define IOWR_ALTERA_AVALON_PIO_SET_BITS(base, data) IOWR(base, 4, data) - -#define IOADDR_ALTERA_AVALON_PIO_CLEAR_BITS(base) __IO_CALC_ADDRESS_NATIVE(base, 5) -#define IORD_ALTERA_AVALON_PIO_CLEAR_BITS(base) IORD(base, 5) -#define IOWR_ALTERA_AVALON_PIO_CLEAR_BITS(base, data) IOWR(base, 5, data) - - - -/* Defintions for direction-register operation with bi-directional PIOs */ -#define ALTERA_AVALON_PIO_DIRECTION_INPUT 0 -#define ALTERA_AVALON_PIO_DIRECTION_OUTPUT 1 - -#endif /* __ALTERA_AVALON_PIO_REGS_H__ */ diff --git a/software/qsys_tutorial_lcd3_bsp/drivers/src/altera_avalon_jtag_uart_fd.c b/software/qsys_tutorial_lcd3_bsp/drivers/src/altera_avalon_jtag_uart_fd.c deleted file mode 100644 index 53dfc3b..0000000 --- a/software/qsys_tutorial_lcd3_bsp/drivers/src/altera_avalon_jtag_uart_fd.c +++ /dev/null @@ -1,86 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "alt_types.h" -#include "sys/alt_dev.h" -#include "altera_avalon_jtag_uart.h" - -extern int altera_avalon_jtag_uart_read(altera_avalon_jtag_uart_state* sp, - char* buffer, int space, int flags); -extern int altera_avalon_jtag_uart_write(altera_avalon_jtag_uart_state* sp, - const char* ptr, int count, int flags); -extern int altera_avalon_jtag_uart_ioctl(altera_avalon_jtag_uart_state* sp, - int req, void* arg); -extern int altera_avalon_jtag_uart_close(altera_avalon_jtag_uart_state* sp, - int flags); - -/* ----------------------------------------------------------------------- */ -/* --------------------- WRAPPERS FOR ALT FD SUPPORT --------------------- */ -/* - * - */ - -int -altera_avalon_jtag_uart_read_fd(alt_fd* fd, char* buffer, int space) -{ - altera_avalon_jtag_uart_dev* dev = (altera_avalon_jtag_uart_dev*) fd->dev; - - return altera_avalon_jtag_uart_read(&dev->state, buffer, space, - fd->fd_flags); -} - -int -altera_avalon_jtag_uart_write_fd(alt_fd* fd, const char* buffer, int space) -{ - altera_avalon_jtag_uart_dev* dev = (altera_avalon_jtag_uart_dev*) fd->dev; - - return altera_avalon_jtag_uart_write(&dev->state, buffer, space, - fd->fd_flags); -} - -#ifndef ALTERA_AVALON_JTAG_UART_SMALL - -int -altera_avalon_jtag_uart_close_fd(alt_fd* fd) -{ - altera_avalon_jtag_uart_dev* dev = (altera_avalon_jtag_uart_dev*) fd->dev; - - return altera_avalon_jtag_uart_close(&dev->state, fd->fd_flags); -} - -int -altera_avalon_jtag_uart_ioctl_fd(alt_fd* fd, int req, void* arg) -{ - altera_avalon_jtag_uart_dev* dev = (altera_avalon_jtag_uart_dev*) fd->dev; - - return altera_avalon_jtag_uart_ioctl(&dev->state, req, arg); -} - -#endif /* ALTERA_AVALON_JTAG_UART_SMALL */ diff --git a/software/qsys_tutorial_lcd3_bsp/drivers/src/altera_avalon_jtag_uart_init.c b/software/qsys_tutorial_lcd3_bsp/drivers/src/altera_avalon_jtag_uart_init.c deleted file mode 100644 index 7317bec..0000000 --- a/software/qsys_tutorial_lcd3_bsp/drivers/src/altera_avalon_jtag_uart_init.c +++ /dev/null @@ -1,256 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include -#include -#include -#include - -#include - -#include "sys/alt_irq.h" -#include "sys/alt_alarm.h" -#include "sys/ioctl.h" -#include "alt_types.h" - -#include "altera_avalon_jtag_uart_regs.h" -#include "altera_avalon_jtag_uart.h" - -#include "sys/alt_log_printf.h" - -#ifndef ALTERA_AVALON_JTAG_UART_SMALL - -/* ----------------------------------------------------------- */ -/* ------------------------- FAST DRIVER --------------------- */ -/* ----------------------------------------------------------- */ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT -static void altera_avalon_jtag_uart_irq(void* context); -#else -static void altera_avalon_jtag_uart_irq(void* context, alt_u32 id); -#endif -static alt_u32 altera_avalon_jtag_uart_timeout(void* context); - -/* - * Driver initialization code. Register interrupts and start a timer - * which we can use to check whether the host is there. - * Return 1 on sucessful IRQ register and 0 on failure. - */ - -void altera_avalon_jtag_uart_init(altera_avalon_jtag_uart_state* sp, - int irq_controller_id, int irq) -{ - ALT_FLAG_CREATE(&sp->events, 0); - ALT_SEM_CREATE(&sp->read_lock, 1); - ALT_SEM_CREATE(&sp->write_lock, 1); - - /* enable read interrupts at the device */ - sp->irq_enable = ALTERA_AVALON_JTAG_UART_CONTROL_RE_MSK; - - IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base, sp->irq_enable); - - /* register the interrupt handler */ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - alt_ic_isr_register(irq_controller_id, irq, altera_avalon_jtag_uart_irq, - sp, NULL); -#else - alt_irq_register(irq, sp, altera_avalon_jtag_uart_irq); -#endif - - /* Register an alarm to go off every second to check for presence of host */ - sp->host_inactive = 0; - - if (alt_alarm_start(&sp->alarm, alt_ticks_per_second(), - &altera_avalon_jtag_uart_timeout, sp) < 0) - { - /* If we can't set the alarm then record "don't know if host present" - * and behave as though the host is present. - */ - sp->timeout = INT_MAX; - } - - /* ALT_LOG - see altera_hal/HAL/inc/sys/alt_log_printf.h */ - ALT_LOG_JTAG_UART_ALARM_REGISTER(sp, sp->base); -} - -/* - * Interrupt routine - */ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT -static void altera_avalon_jtag_uart_irq(void* context) -#else -static void altera_avalon_jtag_uart_irq(void* context, alt_u32 id) -#endif -{ - altera_avalon_jtag_uart_state* sp = (altera_avalon_jtag_uart_state*) context; - unsigned int base = sp->base; - - /* ALT_LOG - see altera_hal/HAL/inc/sys/alt_log_printf.h */ - ALT_LOG_JTAG_UART_ISR_FUNCTION(base, sp); - - for ( ; ; ) - { - unsigned int control = IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base); - - /* Return once nothing more to do */ - if ((control & (ALTERA_AVALON_JTAG_UART_CONTROL_RI_MSK | ALTERA_AVALON_JTAG_UART_CONTROL_WI_MSK)) == 0) - break; - - if (control & ALTERA_AVALON_JTAG_UART_CONTROL_RI_MSK) - { - /* process a read irq. Start by assuming that there is data in the - * receive FIFO (otherwise why would we have been interrupted?) - */ - unsigned int data = 1 << ALTERA_AVALON_JTAG_UART_DATA_RAVAIL_OFST; - - for ( ; ; ) - { - /* Check whether there is space in the buffer. If not then we must not - * read any characters from the buffer as they will be lost. - */ - unsigned int next = (sp->rx_in + 1) % ALTERA_AVALON_JTAG_UART_BUF_LEN; - if (next == sp->rx_out) - break; - - /* Try to remove a character from the FIFO and find out whether there - * are any more characters remaining. - */ - data = IORD_ALTERA_AVALON_JTAG_UART_DATA(base); - - if ((data & ALTERA_AVALON_JTAG_UART_DATA_RVALID_MSK) == 0) - break; - - sp->rx_buf[sp->rx_in] = (data & ALTERA_AVALON_JTAG_UART_DATA_DATA_MSK) >> ALTERA_AVALON_JTAG_UART_DATA_DATA_OFST; - sp->rx_in = (sp->rx_in + 1) % ALTERA_AVALON_JTAG_UART_BUF_LEN; - - /* Post an event to notify jtag_uart_read that a character has been read */ - ALT_FLAG_POST (sp->events, ALT_JTAG_UART_READ_RDY, OS_FLAG_SET); - } - - if (data & ALTERA_AVALON_JTAG_UART_DATA_RAVAIL_MSK) - { - /* If there is still data available here then the buffer is full - * so turn off receive interrupts until some space becomes available. - */ - sp->irq_enable &= ~ALTERA_AVALON_JTAG_UART_CONTROL_RE_MSK; - IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(base, sp->irq_enable); - - /* Dummy read to ensure IRQ is cleared prior to ISR completion */ - IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base); - } - } - - if (control & ALTERA_AVALON_JTAG_UART_CONTROL_WI_MSK) - { - /* process a write irq */ - unsigned int space = (control & ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_MSK) >> ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_OFST; - - while (space > 0 && sp->tx_out != sp->tx_in) - { - IOWR_ALTERA_AVALON_JTAG_UART_DATA(base, sp->tx_buf[sp->tx_out]); - - sp->tx_out = (sp->tx_out + 1) % ALTERA_AVALON_JTAG_UART_BUF_LEN; - - /* Post an event to notify jtag_uart_write that a character has been written */ - ALT_FLAG_POST (sp->events, ALT_JTAG_UART_WRITE_RDY, OS_FLAG_SET); - - space--; - } - - if (space > 0) - { - /* If we don't have any more data available then turn off the TX interrupt */ - sp->irq_enable &= ~ALTERA_AVALON_JTAG_UART_CONTROL_WE_MSK; - IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base, sp->irq_enable); - - /* Dummy read to ensure IRQ is cleared prior to ISR completion */ - IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base); - } - } - } -} - -/* - * Timeout routine is called every second - */ - -static alt_u32 -altera_avalon_jtag_uart_timeout(void* context) -{ - altera_avalon_jtag_uart_state* sp = (altera_avalon_jtag_uart_state *) context; - - unsigned int control = IORD_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base); - - if (control & ALTERA_AVALON_JTAG_UART_CONTROL_AC_MSK) - { - IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base, sp->irq_enable | ALTERA_AVALON_JTAG_UART_CONTROL_AC_MSK); - sp->host_inactive = 0; - } - else if (sp->host_inactive < INT_MAX - 2) { - sp->host_inactive++; - - if (sp->host_inactive >= sp->timeout) { - /* Post an event to indicate host is inactive (for jtag_uart_read */ - ALT_FLAG_POST (sp->events, ALT_JTAG_UART_TIMEOUT, OS_FLAG_SET); - } - } - - return alt_ticks_per_second(); -} - -/* - * The close() routine is implemented to drain the JTAG UART transmit buffer - * when not in "small" mode. This routine will wait for transimt data to be - * emptied unless a timeout from host-activity occurs. If the driver flags - * have been set to non-blocking mode, this routine will exit immediately if - * any data remains. This routine should be called indirectly (i.e. though - * the C library close() routine) so that the file descriptor associated - * with the relevant stream (i.e. stdout) can be closed as well. This routine - * does not manage file descriptors. - * - * The close routine is not implemented for the small driver; instead it will - * map to null. This is because the small driver simply waits while characters - * are transmitted; there is no interrupt-serviced buffer to empty - */ -int altera_avalon_jtag_uart_close(altera_avalon_jtag_uart_state* sp, int flags) -{ - /* - * Wait for all transmit data to be emptied by the JTAG UART ISR, or - * for a host-inactivity timeout, in which case transmit data will be lost - */ - while ( (sp->tx_out != sp->tx_in) && (sp->host_inactive < sp->timeout) ) { - if (flags & O_NONBLOCK) { - return -EWOULDBLOCK; - } - } - - return 0; -} - -#endif /* !ALTERA_AVALON_JTAG_UART_SMALL */ diff --git a/software/qsys_tutorial_lcd3_bsp/drivers/src/altera_avalon_jtag_uart_ioctl.c b/software/qsys_tutorial_lcd3_bsp/drivers/src/altera_avalon_jtag_uart_ioctl.c deleted file mode 100644 index cf71e6f..0000000 --- a/software/qsys_tutorial_lcd3_bsp/drivers/src/altera_avalon_jtag_uart_ioctl.c +++ /dev/null @@ -1,86 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include -#include -#include -#include - -#include - -#include "sys/ioctl.h" -#include "alt_types.h" - -#include "altera_avalon_jtag_uart_regs.h" -#include "altera_avalon_jtag_uart.h" - -#include "sys/alt_log_printf.h" - -#ifndef ALTERA_AVALON_JTAG_UART_SMALL - -/* ----------------------------------------------------------- */ -/* ------------------------- FAST DRIVER --------------------- */ -/* ----------------------------------------------------------- */ - -int -altera_avalon_jtag_uart_ioctl(altera_avalon_jtag_uart_state* sp, int req, - void* arg) -{ - int rc = -ENOTTY; - - switch (req) - { - case TIOCSTIMEOUT: - /* Set the time to wait until assuming host is not connected */ - if (sp->timeout != INT_MAX) - { - int timeout = *((int *)arg); - sp->timeout = (timeout >= 2 && timeout < INT_MAX) ? timeout : INT_MAX - 1; - rc = 0; - } - break; - - case TIOCGCONNECTED: - /* Find out whether host is connected */ - if (sp->timeout != INT_MAX) - { - *((int *)arg) = (sp->host_inactive < sp->timeout) ? 1 : 0; - rc = 0; - } - break; - - default: - break; - } - - return rc; -} - -#endif /* !ALTERA_AVALON_JTAG_UART_SMALL */ diff --git a/software/qsys_tutorial_lcd3_bsp/drivers/src/altera_avalon_jtag_uart_read.c b/software/qsys_tutorial_lcd3_bsp/drivers/src/altera_avalon_jtag_uart_read.c deleted file mode 100644 index 5657adb..0000000 --- a/software/qsys_tutorial_lcd3_bsp/drivers/src/altera_avalon_jtag_uart_read.c +++ /dev/null @@ -1,205 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include -#include -#include -#include - -#include - -#include "sys/alt_irq.h" -#include "sys/alt_alarm.h" -#include "sys/ioctl.h" -#include "alt_types.h" - -#include "altera_avalon_jtag_uart_regs.h" -#include "altera_avalon_jtag_uart.h" - -#include "sys/alt_log_printf.h" - -#ifdef __ucosii__ -#include "includes.h" -#endif /* __ucosii__ */ - -#ifdef ALTERA_AVALON_JTAG_UART_SMALL - -/* ----------------------------------------------------------- */ -/* ----------------------- SMALL DRIVER ---------------------- */ -/* ----------------------------------------------------------- */ - -/* Read routine. The small version blocks until it has at least one byte - * available, it then returns as much as is immediately available without - * waiting any more. It's performance will be very poor without - * interrupts. - */ - -int -altera_avalon_jtag_uart_read(altera_avalon_jtag_uart_state* sp, - char* buffer, int space, int flags) -{ - unsigned int base = sp->base; - - char * ptr = buffer; - char * end = buffer + space; - - while (ptr < end) - { - unsigned int data = IORD_ALTERA_AVALON_JTAG_UART_DATA(base); - - if (data & ALTERA_AVALON_JTAG_UART_DATA_RVALID_MSK) - *ptr++ = (data & ALTERA_AVALON_JTAG_UART_DATA_DATA_MSK) >> ALTERA_AVALON_JTAG_UART_DATA_DATA_OFST; - else if (ptr != buffer) - break; - else if(flags & O_NONBLOCK) - break; - - } - - if (ptr != buffer) - return ptr - buffer; - else if (flags & O_NONBLOCK) - return -EWOULDBLOCK; - else - return -EIO; -} - -#else /* !ALTERA_AVALON_JTAG_UART_SMALL */ - -/* ----------------------------------------------------------- */ -/* ----------------------- FAST DRIVER ----------------------- */ -/* ----------------------------------------------------------- */ - -int -altera_avalon_jtag_uart_read(altera_avalon_jtag_uart_state* sp, - char * buffer, int space, int flags) -{ - char * ptr = buffer; - - alt_irq_context context; - unsigned int n; - - /* - * When running in a multi threaded environment, obtain the "read_lock" - * semaphore. This ensures that reading from the device is thread-safe. - */ - ALT_SEM_PEND (sp->read_lock, 0); - - while (space > 0) - { - unsigned int in, out; - - /* Read as much data as possible */ - do - { - in = sp->rx_in; - out = sp->rx_out; - - if (in >= out) - n = in - out; - else - n = ALTERA_AVALON_JTAG_UART_BUF_LEN - out; - - if (n == 0) - break; /* No more data available */ - - if (n > space) - n = space; - - memcpy(ptr, sp->rx_buf + out, n); - ptr += n; - space -= n; - - sp->rx_out = (out + n) % ALTERA_AVALON_JTAG_UART_BUF_LEN; - } - while (space > 0); - - /* If we read any data then return it */ - if (ptr != buffer) - break; - - /* If in non-blocking mode then return error */ - if (flags & O_NONBLOCK) - break; - -#ifdef __ucosii__ - /* OS Present: Pend on a flag if the OS is running, otherwise spin */ - if(OSRunning == OS_TRUE) { - /* - * When running in a multi-threaded mode, we pend on the read event - * flag set and timeout event flag set in the isr. This avoids wasting CPU - * cycles waiting in this thread, when we could be doing something more - * profitable elsewhere. - */ - ALT_FLAG_PEND (sp->events, - ALT_JTAG_UART_READ_RDY | ALT_JTAG_UART_TIMEOUT, - OS_FLAG_WAIT_SET_ANY + OS_FLAG_CONSUME, - 0); - } - else { - /* Spin until more data arrives or until host disconnects */ - while (in == sp->rx_in && sp->host_inactive < sp->timeout) - ; - } -#else - /* No OS: Always spin */ - while (in == sp->rx_in && sp->host_inactive < sp->timeout) - ; -#endif /* __ucosii__ */ - - if (in == sp->rx_in) - break; - } - - /* - * Now that access to the circular buffer is complete, release the read - * semaphore so that other threads can access the buffer. - */ - - ALT_SEM_POST (sp->read_lock); - - if (ptr != buffer) - { - /* If we read any data then there is space in the buffer so enable interrupts */ - context = alt_irq_disable_all(); - sp->irq_enable |= ALTERA_AVALON_JTAG_UART_CONTROL_RE_MSK; - IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base, sp->irq_enable); - alt_irq_enable_all(context); - } - - if (ptr != buffer) - return ptr - buffer; - else if (flags & O_NONBLOCK) - return -EWOULDBLOCK; - else - return -EIO; -} - -#endif /* ALTERA_AVALON_JTAG_UART_SMALL */ diff --git a/software/qsys_tutorial_lcd3_bsp/drivers/src/altera_avalon_jtag_uart_write.c b/software/qsys_tutorial_lcd3_bsp/drivers/src/altera_avalon_jtag_uart_write.c deleted file mode 100644 index 11aeca1..0000000 --- a/software/qsys_tutorial_lcd3_bsp/drivers/src/altera_avalon_jtag_uart_write.c +++ /dev/null @@ -1,217 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include -#include -#include -#include - -#include - -#include "sys/alt_irq.h" -#include "sys/alt_alarm.h" -#include "sys/ioctl.h" -#include "alt_types.h" - -#include "altera_avalon_jtag_uart_regs.h" -#include "altera_avalon_jtag_uart.h" - -#include "sys/alt_log_printf.h" - -#ifdef __ucosii__ -#include "includes.h" -#endif /* __ucosii__ */ - -#ifdef ALTERA_AVALON_JTAG_UART_SMALL - -/* ----------------------------------------------------------- */ -/* ------------------------ SMALL DRIVER --------------------- */ -/* ----------------------------------------------------------- */ - -/* Write routine. The small version blocks when there is no space to write - * into, so it's performance will be very bad if you are writing more than - * one FIFOs worth of data. But you said you didn't want to use interrupts :-) - */ - -int altera_avalon_jtag_uart_write(altera_avalon_jtag_uart_state* sp, - const char * ptr, int count, int flags) -{ - unsigned int base = sp->base; - - const char * end = ptr + count; - - while (ptr < end) - if ((IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base) & ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_MSK) != 0) - IOWR_ALTERA_AVALON_JTAG_UART_DATA(base, *ptr++); - - return count; -} - -#else /* !ALTERA_AVALON_JTAG_UART_SMALL */ - -/* ----------------------------------------------------------- */ -/* ------------------------- FAST DRIVER --------------------- */ -/* ----------------------------------------------------------- */ - -int -altera_avalon_jtag_uart_write(altera_avalon_jtag_uart_state* sp, - const char * ptr, int count, int flags) -{ - /* Remove warning at optimisation level 03 by seting out to 0 */ - unsigned int in, out=0; - unsigned int n; - alt_irq_context context; - - const char * start = ptr; - - /* - * When running in a multi threaded environment, obtain the "write_lock" - * semaphore. This ensures that writing to the device is thread-safe. - */ - ALT_SEM_PEND (sp->write_lock, 0); - - do - { - /* Copy as much as we can into the transmit buffer */ - while (count > 0) - { - /* We need a stable value of the out pointer to calculate the space available */ - in = sp->tx_in; - out = sp->tx_out; - - if (in < out) - n = out - 1 - in; - else if (out > 0) - n = ALTERA_AVALON_JTAG_UART_BUF_LEN - in; - else - n = ALTERA_AVALON_JTAG_UART_BUF_LEN - 1 - in; - - if (n == 0) - break; - - if (n > count) - n = count; - - memcpy(sp->tx_buf + in, ptr, n); - ptr += n; - count -= n; - - sp->tx_in = (in + n) % ALTERA_AVALON_JTAG_UART_BUF_LEN; - } - - /* - * If interrupts are disabled then we could transmit here, we only need - * to enable interrupts if there is no space left in the FIFO - * - * For now kick the interrupt routine every time to make it transmit - * the data - */ - context = alt_irq_disable_all(); - sp->irq_enable |= ALTERA_AVALON_JTAG_UART_CONTROL_WE_MSK; - IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base, sp->irq_enable); - alt_irq_enable_all(context); - - /* - * If there is any data left then either return now or block until - * some has been sent - */ - /* consider: test whether there is anything there while doing this and delay for at most 2s. */ - if (count > 0) - { - if (flags & O_NONBLOCK) - break; - -#ifdef __ucosii__ - /* OS Present: Pend on a flag if the OS is running, otherwise spin */ - if(OSRunning == OS_TRUE) { - /* - * When running in a multi-threaded mode, we pend on the write event - * flag set or the timeout flag in the isr. This avoids wasting CPU - * cycles waiting in this thread, when we could be doing something - * more profitable elsewhere. - */ -#ifdef ALTERA_AVALON_JTAG_UART_IGNORE_FIFO_FULL_ERROR - if(!sp->host_inactive) -#endif - ALT_FLAG_PEND (sp->events, - ALT_JTAG_UART_WRITE_RDY | ALT_JTAG_UART_TIMEOUT, - OS_FLAG_WAIT_SET_ANY + OS_FLAG_CONSUME, - 0); - } - else { - /* - * OS not running: Wait for data to be removed from buffer. - * Once the interrupt routine has removed some data then we - * will be able to insert some more. - */ - while (out == sp->tx_out && sp->host_inactive < sp->timeout) - ; - } -#else - /* - * No OS present: Always wait for data to be removed from buffer. Once - * the interrupt routine has removed some data then we will be able to - * insert some more. - */ - while (out == sp->tx_out && sp->host_inactive < sp->timeout) - ; -#endif /* __ucosii__ */ - - if (out == sp->tx_out) - break; - } - } - while (count > 0); - - /* - * Now that access to the circular buffer is complete, release the write - * semaphore so that other threads can access the buffer. - */ - ALT_SEM_POST (sp->write_lock); - - if (ptr != start) - return ptr - start; - else if (flags & O_NONBLOCK) - return -EWOULDBLOCK; -#ifdef ALTERA_AVALON_JTAG_UART_IGNORE_FIFO_FULL_ERROR - else if (sp->host_inactive >= sp->timeout) { - /* - * Reset the software FIFO, hardware FIFO could not be reset. - * Just throw away characters without reporting error. - */ - sp->tx_out = sp->tx_in = 0; - return ptr - start + count; - } -#endif - else - return -EIO; /* Host not connected */ -} - -#endif /* ALTERA_AVALON_JTAG_UART_SMALL */ diff --git a/software/qsys_tutorial_lcd3_bsp/drivers/src/altera_avalon_lcd_16207.c b/software/qsys_tutorial_lcd3_bsp/drivers/src/altera_avalon_lcd_16207.c deleted file mode 100644 index 1fefba3..0000000 --- a/software/qsys_tutorial_lcd3_bsp/drivers/src/altera_avalon_lcd_16207.c +++ /dev/null @@ -1,605 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* ===================================================================== */ - -/* - * This file provides the implementation of the functions used to drive a - * LCD panel. - * - * Characters written to the device will appear on the LCD panel as though - * it is a very small terminal. If the lines written to the terminal are - * longer than the number of characters on the terminal then it will scroll - * the lines of text automatically to display them all. - * - * If more lines are written than will fit on the terminal then it will scroll - * when characters are written to the line "below" the last displayed one - - * the cursor is allowed to sit below the visible area of the screen providing - * that this line is entirely blank. - * - * The following control sequences may be used to move around and do useful - * stuff: - * CR Moves back to the start of the current line - * LF Moves down a line and back to the start - * BS Moves back a character without erasing - * ESC Starts a VT100 style escape sequence - * - * The following escape sequences are recognised: - * ESC [ ; H Move to row and column specified (positions are - * counted from the top left which is 1;1) - * ESC [ K Clear from current position to end of line - * ESC [ 2 J Clear screen and go to top left - * - */ - -/* ===================================================================== */ - -#include -#include - -#include -#include -#include - -#include "sys/alt_alarm.h" - -#include "altera_avalon_lcd_16207_regs.h" -#include "altera_avalon_lcd_16207.h" - -/* --------------------------------------------------------------------- */ - -/* Commands which can be written to the COMMAND register */ - -enum /* Write to character RAM */ -{ - LCD_CMD_WRITE_DATA = 0x80 - /* Bits 6:0 hold character RAM address */ -}; - -enum /* Write to character generator RAM */ -{ - LCD_CMD_WRITE_CGR = 0x40 - /* Bits 5:0 hold character generator RAM address */ -}; - -enum /* Function Set command */ -{ - LCD_CMD_FUNCTION_SET = 0x20, - LCD_CMD_8BIT = 0x10, - LCD_CMD_TWO_LINE = 0x08, - LCD_CMD_BIGFONT = 0x04 -}; - -enum /* Shift command */ -{ - LCD_CMD_SHIFT = 0x10, - LCD_CMD_SHIFT_DISPLAY = 0x08, - LCD_CMD_SHIFT_RIGHT = 0x04 -}; - -enum /* On/Off command */ -{ - LCD_CMD_ONOFF = 0x08, - LCD_CMD_ENABLE_DISP = 0x04, - LCD_CMD_ENABLE_CURSOR = 0x02, - LCD_CMD_ENABLE_BLINK = 0x01 -}; - -enum /* Entry Mode command */ -{ - LCD_CMD_MODES = 0x04, - LCD_CMD_MODE_INC = 0x02, - LCD_CMD_MODE_SHIFT = 0x01 -}; - -enum /* Home command */ -{ - LCD_CMD_HOME = 0x02 -}; - -enum /* Clear command */ -{ - LCD_CMD_CLEAR = 0x01 -}; - -/* Where in LCD character space do the rows start */ -static char colstart[4] = { 0x00, 0x40, 0x20, 0x60 }; - -/* --------------------------------------------------------------------- */ - -static void lcd_write_command(altera_avalon_lcd_16207_state* sp, - unsigned char command) -{ - unsigned int base = sp->base; - - /* We impose a timeout on the driver in case the LCD panel isn't connected. - * The first time we call this function the timeout is approx 25ms - * (assuming 5 cycles per loop and a 200MHz clock). Obviously systems - * with slower clocks, or debug builds, or slower memory will take longer. - */ - int i = 1000000; - - /* Don't bother if the LCD panel didn't work before */ - if (sp->broken) - return; - - /* Wait until LCD isn't busy. */ - while (IORD_ALTERA_AVALON_LCD_16207_STATUS(base) & ALTERA_AVALON_LCD_16207_STATUS_BUSY_MSK) - if (--i == 0) - { - sp->broken = 1; - return; - } - - /* Despite what it says in the datasheet, the LCD isn't ready to accept - * a write immediately after it returns BUSY=0. Wait for 100us more. - */ - usleep(100); - - IOWR_ALTERA_AVALON_LCD_16207_COMMAND(base, command); -} - -/* --------------------------------------------------------------------- */ - -static void lcd_write_data(altera_avalon_lcd_16207_state* sp, - unsigned char data) -{ - unsigned int base = sp->base; - - /* We impose a timeout on the driver in case the LCD panel isn't connected. - * The first time we call this function the timeout is approx 25ms - * (assuming 5 cycles per loop and a 200MHz clock). Obviously systems - * with slower clocks, or debug builds, or slower memory will take longer. - */ - int i = 1000000; - - /* Don't bother if the LCD panel didn't work before */ - if (sp->broken) - return; - - /* Wait until LCD isn't busy. */ - while (IORD_ALTERA_AVALON_LCD_16207_STATUS(base) & ALTERA_AVALON_LCD_16207_STATUS_BUSY_MSK) - if (--i == 0) - { - sp->broken = 1; - return; - } - - /* Despite what it says in the datasheet, the LCD isn't ready to accept - * a write immediately after it returns BUSY=0. Wait for 100us more. - */ - usleep(100); - - IOWR_ALTERA_AVALON_LCD_16207_DATA(base, data); - - sp->address++; -} - -/* --------------------------------------------------------------------- */ - -static void lcd_clear_screen(altera_avalon_lcd_16207_state* sp) -{ - int y; - - lcd_write_command(sp, LCD_CMD_CLEAR); - - sp->x = 0; - sp->y = 0; - sp->address = 0; - - for (y = 0 ; y < ALT_LCD_HEIGHT ; y++) - { - memset(sp->line[y].data, ' ', sizeof(sp->line[0].data)); - memset(sp->line[y].visible, ' ', sizeof(sp->line[0].visible)); - sp->line[y].width = 0; - } -} - -/* --------------------------------------------------------------------- */ - -static void lcd_repaint_screen(altera_avalon_lcd_16207_state* sp) -{ - int y, x; - - /* scrollpos controls how much the lines have scrolled round. The speed - * each line scrolls at is controlled by its speed variable - while - * scrolline lines will wrap at the position set by width - */ - - int scrollpos = sp->scrollpos; - - for (y = 0 ; y < ALT_LCD_HEIGHT ; y++) - { - int width = sp->line[y].width; - int offset = (scrollpos * sp->line[y].speed) >> 8; - if (offset >= width) - offset = 0; - - for (x = 0 ; x < ALT_LCD_WIDTH ; x++) - { - char c = sp->line[y].data[(x + offset) % width]; - - /* Writing data takes 40us, so don't do it unless required */ - if (sp->line[y].visible[x] != c) - { - unsigned char address = x + colstart[y]; - - if (address != sp->address) - { - lcd_write_command(sp, LCD_CMD_WRITE_DATA | address); - sp->address = address; - } - - lcd_write_data(sp, c); - sp->line[y].visible[x] = c; - } - } - } -} - -/* --------------------------------------------------------------------- */ - -static void lcd_scroll_up(altera_avalon_lcd_16207_state* sp) -{ - int y; - - for (y = 0 ; y < ALT_LCD_HEIGHT ; y++) - { - if (y < ALT_LCD_HEIGHT-1) - memcpy(sp->line[y].data, sp->line[y+1].data, ALT_LCD_VIRTUAL_WIDTH); - else - memset(sp->line[y].data, ' ', ALT_LCD_VIRTUAL_WIDTH); - } - - sp->y--; -} - -/* --------------------------------------------------------------------- */ - -static void lcd_handle_escape(altera_avalon_lcd_16207_state* sp, char c) -{ - int parm1 = 0, parm2 = 0; - - if (sp->escape[0] == '[') - { - char * ptr = sp->escape+1; - while (isdigit(*ptr)) - parm1 = (parm1 * 10) + (*ptr++ - '0'); - - if (*ptr == ';') - { - ptr++; - while (isdigit(*ptr)) - parm2 = (parm2 * 10) + (*ptr++ - '0'); - } - } - else - parm1 = -1; - - switch (c) - { - case 'H': /* ESC '[' ';' 'H' : Move cursor to location */ - case 'f': /* Same as above */ - if (parm2 > 0) - sp->x = parm2 - 1; - if (parm1 > 0) - { - sp->y = parm1 - 1; - if (sp->y > ALT_LCD_HEIGHT * 2) - sp->y = ALT_LCD_HEIGHT * 2; - while (sp->y > ALT_LCD_HEIGHT) - lcd_scroll_up(sp); - } - break; - - case 'J': - /* ESC J is clear to beginning of line [unimplemented] - * ESC [ 0 J is clear to bottom of screen [unimplemented] - * ESC [ 1 J is clear to beginning of screen [unimplemented] - * ESC [ 2 J is clear screen - */ - if (parm1 == 2) - lcd_clear_screen(sp); - break; - - case 'K': - /* ESC K is clear to end of line - * ESC [ 0 K is clear to end of line - * ESC [ 1 K is clear to beginning of line [unimplemented] - * ESC [ 2 K is clear line [unimplemented] - */ - if (parm1 < 1) - { - if (sp->x < ALT_LCD_VIRTUAL_WIDTH) - memset(sp->line[sp->y].data + sp->x, ' ', ALT_LCD_VIRTUAL_WIDTH - sp->x); - } - break; - } -} - -/* --------------------------------------------------------------------- */ - -int altera_avalon_lcd_16207_write(altera_avalon_lcd_16207_state* sp, - const char* ptr, int len, int flags) -{ - const char* end = ptr + len; - - int y; - int widthmax; - - /* When running in a multi threaded environment, obtain the "write_lock" - * semaphore. This ensures that writing to the device is thread-safe. - */ - - ALT_SEM_PEND (sp->write_lock, 0); - - /* Tell the routine which is called off the timer interrupt that the - * foreground routines are active so it must not repaint the display. */ - sp->active = 1; - - for ( ; ptr < end ; ptr++) - { - char c = *ptr; - - if (sp->esccount >= 0) - { - unsigned int esccount = sp->esccount; - - /* Single character escape sequences can end with any character - * Multi character escape sequences start with '[' and contain - * digits and semicolons before terminating - */ - if ((esccount == 0 && c != '[') || - (esccount > 0 && !isdigit(c) && c != ';')) - { - sp->escape[esccount] = 0; - - lcd_handle_escape(sp, c); - - sp->esccount = -1; - } - else if (sp->esccount < sizeof(sp->escape)-1) - { - sp->escape[esccount] = c; - sp->esccount++; - } - } - else if (c == 27) /* ESC */ - { - sp->esccount = 0; - } - else if (c == '\r') - { - sp->x = 0; - } - else if (c == '\n') - { - sp->x = 0; - sp->y++; - - /* Let the cursor sit at X=0, Y=HEIGHT without scrolling so the user - * can print two lines of data without losing one. - */ - if (sp->y > ALT_LCD_HEIGHT) - lcd_scroll_up(sp); - } - else if (c == '\b') - { - if (sp->x > 0) - sp->x--; - } - else if (isprint(c)) - { - /* If we didn't scroll on the last linefeed then we might need to do - * it now. */ - if (sp->y >= ALT_LCD_HEIGHT) - lcd_scroll_up(sp); - - if (sp->x < ALT_LCD_VIRTUAL_WIDTH) - sp->line[sp->y].data[sp->x] = c; - - sp->x++; - } - } - - /* Recalculate the scrolling parameters */ - widthmax = ALT_LCD_WIDTH; - for (y = 0 ; y < ALT_LCD_HEIGHT ; y++) - { - int width; - for (width = ALT_LCD_VIRTUAL_WIDTH ; width > 0 ; width--) - if (sp->line[y].data[width-1] != ' ') - break; - - /* The minimum width is the size of the LCD panel. If the real width - * is long enough to require scrolling then add an extra space so the - * end of the message doesn't run into the beginning of it. - */ - if (width <= ALT_LCD_WIDTH) - width = ALT_LCD_WIDTH; - else - width++; - - sp->line[y].width = width; - if (widthmax < width) - widthmax = width; - sp->line[y].speed = 0; /* By default lines don't scroll */ - } - - if (widthmax <= ALT_LCD_WIDTH) - sp->scrollmax = 0; - else - { - widthmax *= 2; - sp->scrollmax = widthmax; - - /* Now calculate how fast each of the other lines should go */ - for (y = 0 ; y < ALT_LCD_HEIGHT ; y++) - if (sp->line[y].width > ALT_LCD_WIDTH) - { - /* You have three options for how to make the display scroll, chosen - * using the preprocessor directives below - */ -#if 1 - /* This option makes all the lines scroll round at different speeds - * which are chosen so that all the scrolls finish at the same time. - */ - sp->line[y].speed = 256 * sp->line[y].width / widthmax; -#elif 1 - /* This option pads the shorter lines with spaces so that they all - * scroll together. - */ - sp->line[y].width = widthmax / 2; - sp->line[y].speed = 256/2; -#else - /* This option makes the shorter lines stop after they have rotated - * and waits for the longer lines to catch up - */ - sp->line[y].speed = 256/2; -#endif - } - } - - /* Repaint once, then check whether there has been a missed repaint - * (because active was set when the timer interrupt occurred). If there - * has been a missed repaint then paint again. And again. etc. - */ - for ( ; ; ) - { - int old_scrollpos = sp->scrollpos; - - lcd_repaint_screen(sp); - - /* Let the timer routines repaint the display again */ - sp->active = 0; - - /* Have the timer routines tried to scroll while we were painting? - * If not then we can exit */ - if (sp->scrollpos == old_scrollpos) - break; - - /* We need to repaint again since the display scrolled while we were - * painting last time */ - sp->active = 1; - } - - /* Now that access to the display is complete, release the write - * semaphore so that other threads can access the buffer. - */ - - ALT_SEM_POST (sp->write_lock); - - return len; -} - -/* --------------------------------------------------------------------- */ - -/* This should be in a top level header file really */ -#define container_of(ptr, type, member) ((type *)((char *)ptr - offsetof(type, member))) - -/* - * Timeout routine is called every second - */ - -static alt_u32 alt_lcd_16207_timeout(void* context) -{ - altera_avalon_lcd_16207_state* sp = (altera_avalon_lcd_16207_state*)context; - - /* Update the scrolling position */ - if (sp->scrollpos + 1 >= sp->scrollmax) - sp->scrollpos = 0; - else - sp->scrollpos = sp->scrollpos + 1; - - /* Repaint the panel unless the foreground will do it again soon */ - if (sp->scrollmax > 0 && !sp->active) - lcd_repaint_screen(sp); - - return sp->period; -} - -/* --------------------------------------------------------------------- */ - -/* - * Called at boot time to initialise the LCD driver - */ -void altera_avalon_lcd_16207_init(altera_avalon_lcd_16207_state* sp) -{ - unsigned int base = sp->base; - - /* Mark the device as functional */ - sp->broken = 0; - - ALT_SEM_CREATE (&sp->write_lock, 1); - - /* The initialisation sequence below is copied from the datasheet for - * the 16207 LCD display. The first commands need to be timed because - * the BUSY bit in the status register doesn't work until the display - * has been reset three times. - */ - - /* Wait for 15 ms then reset */ - usleep(15000); - IOWR_ALTERA_AVALON_LCD_16207_COMMAND(base, LCD_CMD_FUNCTION_SET | LCD_CMD_8BIT); - - /* Wait for another 4.1ms and reset again */ - usleep(4100); - IOWR_ALTERA_AVALON_LCD_16207_COMMAND(base, LCD_CMD_FUNCTION_SET | LCD_CMD_8BIT); - - /* Wait a further 1 ms and reset a third time */ - usleep(1000); - IOWR_ALTERA_AVALON_LCD_16207_COMMAND(base, LCD_CMD_FUNCTION_SET | LCD_CMD_8BIT); - - /* Setup interface parameters: 8 bit bus, 2 rows, 5x7 font */ - lcd_write_command(sp, LCD_CMD_FUNCTION_SET | LCD_CMD_8BIT | LCD_CMD_TWO_LINE); - - /* Turn display off */ - lcd_write_command(sp, LCD_CMD_ONOFF); - - /* Clear display */ - lcd_clear_screen(sp); - - /* Set mode: increment after writing, don't shift display */ - lcd_write_command(sp, LCD_CMD_MODES | LCD_CMD_MODE_INC); - - /* Turn display on */ - lcd_write_command(sp, LCD_CMD_ONOFF | LCD_CMD_ENABLE_DISP); - - sp->esccount = -1; - memset(sp->escape, 0, sizeof(sp->escape)); - - sp->scrollpos = 0; - sp->scrollmax = 0; - sp->active = 0; - - sp->period = alt_ticks_per_second() / 10; /* Call every 100ms */ - - alt_alarm_start(&sp->alarm, sp->period, &alt_lcd_16207_timeout, sp); -} diff --git a/software/qsys_tutorial_lcd3_bsp/drivers/src/altera_avalon_lcd_16207_fd.c b/software/qsys_tutorial_lcd3_bsp/drivers/src/altera_avalon_lcd_16207_fd.c deleted file mode 100644 index 431b094..0000000 --- a/software/qsys_tutorial_lcd3_bsp/drivers/src/altera_avalon_lcd_16207_fd.c +++ /dev/null @@ -1,45 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "alt_types.h" -#include "sys/alt_dev.h" -#include "altera_avalon_lcd_16207.h" - -extern int altera_avalon_lcd_16207_write(altera_avalon_lcd_16207_state* sp, - const char* ptr, int count, int flags); - -int -altera_avalon_lcd_16207_write_fd(alt_fd* fd, const char* buffer, int space) -{ - altera_avalon_lcd_16207_dev* dev = (altera_avalon_lcd_16207_dev*) fd->dev; - - return altera_avalon_lcd_16207_write(&dev->state, buffer, space, - fd->fd_flags); -} diff --git a/software/qsys_tutorial_lcd3_bsp/libhal_bsp.a b/software/qsys_tutorial_lcd3_bsp/libhal_bsp.a deleted file mode 100644 index 4773527..0000000 --- a/software/qsys_tutorial_lcd3_bsp/libhal_bsp.a +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/linker.h b/software/qsys_tutorial_lcd3_bsp/linker.h deleted file mode 100644 index e3d49ae..0000000 --- a/software/qsys_tutorial_lcd3_bsp/linker.h +++ /dev/null @@ -1,101 +0,0 @@ -/* - * linker.h - Linker script mapping information - * - * Machine generated for CPU 'nios2_processor' in SOPC Builder design 'nios_system' - * SOPC Builder design path: C:/Users/takayun/Documents/DE2-115/qsys_tutorial/nios_system.sopcinfo - * - * Generated: Fri Dec 02 01:06:42 JST 2016 - */ - -/* - * DO NOT MODIFY THIS FILE - * - * Changing this file will have subtle consequences - * which will almost certainly lead to a nonfunctioning - * system. If you do modify this file, be aware that your - * changes will be overwritten and lost when this file - * is generated again. - * - * DO NOT MODIFY THIS FILE - */ - -/* - * License Agreement - * - * Copyright (c) 2008 - * Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - * - * This agreement shall be governed in all respects by the laws of the State - * of California and by the laws of the United States of America. - */ - -#ifndef __LINKER_H_ -#define __LINKER_H_ - - -/* - * BSP controls alt_load() behavior in crt0. - * - */ - -#define ALT_LOAD_EXPLICITLY_CONTROLLED - - -/* - * Base address and span (size in bytes) of each linker region - * - */ - -#define ONCHIP_MEMORY_REGION_BASE 0x20 -#define ONCHIP_MEMORY_REGION_SPAN 204768 -#define RESET_REGION_BASE 0x0 -#define RESET_REGION_SPAN 32 - - -/* - * Devices associated with code sections - * - */ - -#define ALT_EXCEPTIONS_DEVICE ONCHIP_MEMORY -#define ALT_RESET_DEVICE ONCHIP_MEMORY -#define ALT_RODATA_DEVICE ONCHIP_MEMORY -#define ALT_RWDATA_DEVICE ONCHIP_MEMORY -#define ALT_TEXT_DEVICE ONCHIP_MEMORY - - -/* - * Initialization code at the reset address is allowed (e.g. no external bootloader). - * - */ - -#define ALT_ALLOW_CODE_AT_RESET - - -/* - * The alt_load() facility is called from crt0 to copy sections into RAM. - * - */ - -#define ALT_LOAD_COPY_RWDATA - -#endif /* __LINKER_H_ */ diff --git a/software/qsys_tutorial_lcd3_bsp/linker.x b/software/qsys_tutorial_lcd3_bsp/linker.x deleted file mode 100644 index 7322ddd..0000000 --- a/software/qsys_tutorial_lcd3_bsp/linker.x +++ /dev/null @@ -1,385 +0,0 @@ -/* - * linker.x - Linker script - * - * Machine generated for CPU 'nios2_processor' in SOPC Builder design 'nios_system' - * SOPC Builder design path: C:/Users/takayun/Documents/DE2-115/qsys_tutorial/nios_system.sopcinfo - * - * Generated: Fri Dec 02 01:06:42 JST 2016 - */ - -/* - * DO NOT MODIFY THIS FILE - * - * Changing this file will have subtle consequences - * which will almost certainly lead to a nonfunctioning - * system. If you do modify this file, be aware that your - * changes will be overwritten and lost when this file - * is generated again. - * - * DO NOT MODIFY THIS FILE - */ - -/* - * License Agreement - * - * Copyright (c) 2008 - * Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - * - * This agreement shall be governed in all respects by the laws of the State - * of California and by the laws of the United States of America. - */ - -MEMORY -{ - reset : ORIGIN = 0x0, LENGTH = 32 - onchip_memory : ORIGIN = 0x20, LENGTH = 204768 -} - -/* Define symbols for each memory base-address */ -__alt_mem_onchip_memory = 0x0; - -OUTPUT_FORMAT( "elf32-littlenios2", - "elf32-littlenios2", - "elf32-littlenios2" ) -OUTPUT_ARCH( nios2 ) -ENTRY( _start ) - -/* - * The alt_load() facility is enabled. This typically happens when there isn't - * an external bootloader (e.g. flash bootloader). - * The LMA (aka physical address) of each loaded section is - * set to the .text memory device. - * The HAL alt_load() routine called from crt0 copies sections from - * the .text memory to RAM as needed. - */ - -SECTIONS -{ - - /* - * Output sections associated with reset and exceptions (they have to be first) - */ - - .entry : - { - KEEP (*(.entry)) - } > reset - - .exceptions : - { - PROVIDE (__ram_exceptions_start = ABSOLUTE(.)); - . = ALIGN(0x20); - KEEP (*(.irq)); - KEEP (*(.exceptions.entry.label)); - KEEP (*(.exceptions.entry.user)); - KEEP (*(.exceptions.entry)); - KEEP (*(.exceptions.irqtest.user)); - KEEP (*(.exceptions.irqtest)); - KEEP (*(.exceptions.irqhandler.user)); - KEEP (*(.exceptions.irqhandler)); - KEEP (*(.exceptions.irqreturn.user)); - KEEP (*(.exceptions.irqreturn)); - KEEP (*(.exceptions.notirq.label)); - KEEP (*(.exceptions.notirq.user)); - KEEP (*(.exceptions.notirq)); - KEEP (*(.exceptions.soft.user)); - KEEP (*(.exceptions.soft)); - KEEP (*(.exceptions.unknown.user)); - KEEP (*(.exceptions.unknown)); - KEEP (*(.exceptions.exit.label)); - KEEP (*(.exceptions.exit.user)); - KEEP (*(.exceptions.exit)); - KEEP (*(.exceptions)); - PROVIDE (__ram_exceptions_end = ABSOLUTE(.)); - } > onchip_memory - - PROVIDE (__flash_exceptions_start = LOADADDR(.exceptions)); - - .text : - { - /* - * All code sections are merged into the text output section, along with - * the read only data sections. - * - */ - - PROVIDE (stext = ABSOLUTE(.)); - - *(.interp) - *(.hash) - *(.dynsym) - *(.dynstr) - *(.gnu.version) - *(.gnu.version_d) - *(.gnu.version_r) - *(.rel.init) - *(.rela.init) - *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) - *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) - *(.rel.fini) - *(.rela.fini) - *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) - *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) - *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) - *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) - *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) - *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) - *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) - *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) - *(.rel.ctors) - *(.rela.ctors) - *(.rel.dtors) - *(.rela.dtors) - *(.rel.got) - *(.rela.got) - *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) - *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) - *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) - *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) - *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) - *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) - *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) - *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) - *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) - *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) - *(.rel.plt) - *(.rela.plt) - *(.rel.dyn) - - KEEP (*(.init)) - *(.plt) - *(.text .stub .text.* .gnu.linkonce.t.*) - - /* .gnu.warning sections are handled specially by elf32.em. */ - - *(.gnu.warning.*) - KEEP (*(.fini)) - PROVIDE (__etext = ABSOLUTE(.)); - PROVIDE (_etext = ABSOLUTE(.)); - PROVIDE (etext = ABSOLUTE(.)); - - *(.eh_frame_hdr) - /* Ensure the __preinit_array_start label is properly aligned. We - could instead move the label definition inside the section, but - the linker would then create the section even if it turns out to - be empty, which isn't pretty. */ - . = ALIGN(4); - PROVIDE (__preinit_array_start = ABSOLUTE(.)); - *(.preinit_array) - PROVIDE (__preinit_array_end = ABSOLUTE(.)); - PROVIDE (__init_array_start = ABSOLUTE(.)); - *(.init_array) - PROVIDE (__init_array_end = ABSOLUTE(.)); - PROVIDE (__fini_array_start = ABSOLUTE(.)); - *(.fini_array) - PROVIDE (__fini_array_end = ABSOLUTE(.)); - SORT(CONSTRUCTORS) - KEEP (*(.eh_frame)) - *(.gcc_except_table) - *(.dynamic) - PROVIDE (__CTOR_LIST__ = ABSOLUTE(.)); - KEEP (*(.ctors)) - KEEP (*(SORT(.ctors.*))) - PROVIDE (__CTOR_END__ = ABSOLUTE(.)); - PROVIDE (__DTOR_LIST__ = ABSOLUTE(.)); - KEEP (*(.dtors)) - KEEP (*(SORT(.dtors.*))) - PROVIDE (__DTOR_END__ = ABSOLUTE(.)); - KEEP (*(.jcr)) - . = ALIGN(4); - } > onchip_memory = 0x3a880100 /* Nios II NOP instruction */ - - .rodata : - { - PROVIDE (__ram_rodata_start = ABSOLUTE(.)); - . = ALIGN(4); - *(.rodata .rodata.* .gnu.linkonce.r.*) - *(.rodata1) - . = ALIGN(4); - PROVIDE (__ram_rodata_end = ABSOLUTE(.)); - } > onchip_memory - - PROVIDE (__flash_rodata_start = LOADADDR(.rodata)); - - /* - * - * This section's LMA is set to the .text region. - * crt0 will copy to this section's specified mapped region virtual memory address (VMA) - * - * .rwdata region equals the .text region, and is set to be loaded into .text region. - * This requires two copies of .rwdata in the .text region. One read writable at VMA. - * and one read-only at LMA. crt0 will copy from LMA to VMA on reset - * - */ - - .rwdata LOADADDR (.rodata) + SIZEOF (.rodata) : AT ( LOADADDR (.rodata) + SIZEOF (.rodata)+ SIZEOF (.rwdata) ) - { - PROVIDE (__ram_rwdata_start = ABSOLUTE(.)); - . = ALIGN(4); - *(.got.plt) *(.got) - *(.data1) - *(.data .data.* .gnu.linkonce.d.*) - - _gp = ABSOLUTE(. + 0x8000); - PROVIDE(gp = _gp); - - *(.rwdata .rwdata.*) - *(.sdata .sdata.* .gnu.linkonce.s.*) - *(.sdata2 .sdata2.* .gnu.linkonce.s2.*) - - . = ALIGN(4); - _edata = ABSOLUTE(.); - PROVIDE (edata = ABSOLUTE(.)); - PROVIDE (__ram_rwdata_end = ABSOLUTE(.)); - } > onchip_memory - - PROVIDE (__flash_rwdata_start = LOADADDR(.rwdata)); - - /* - * - * This section's LMA is set to the .text region. - * crt0 will copy to this section's specified mapped region virtual memory address (VMA) - * - */ - - .bss LOADADDR (.rwdata) + SIZEOF (.rwdata) : AT ( LOADADDR (.rwdata) + SIZEOF (.rwdata) ) - { - __bss_start = ABSOLUTE(.); - PROVIDE (__sbss_start = ABSOLUTE(.)); - PROVIDE (___sbss_start = ABSOLUTE(.)); - - *(.dynsbss) - *(.sbss .sbss.* .gnu.linkonce.sb.*) - *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) - *(.scommon) - - PROVIDE (__sbss_end = ABSOLUTE(.)); - PROVIDE (___sbss_end = ABSOLUTE(.)); - - *(.dynbss) - *(.bss .bss.* .gnu.linkonce.b.*) - *(COMMON) - - . = ALIGN(4); - __bss_end = ABSOLUTE(.); - } > onchip_memory - - /* - * - * One output section mapped to the associated memory device for each of - * the available memory devices. These are not used by default, but can - * be used by user applications by using the .section directive. - * - * The output section used for the heap is treated in a special way, - * i.e. the symbols "end" and "_end" are added to point to the heap start. - * - * Because alt_load() is enabled, these sections have - * their LMA set to be loaded into the .text memory region. - * However, the alt_load() code will NOT automatically copy - * these sections into their mapped memory region. - * - */ - - /* - * - * This section's LMA is set to the .text region. - * crt0 will copy to this section's specified mapped region virtual memory address (VMA) - * - */ - - .onchip_memory LOADADDR (.bss) + SIZEOF (.bss) : AT ( LOADADDR (.bss) + SIZEOF (.bss) ) - { - PROVIDE (_alt_partition_onchip_memory_start = ABSOLUTE(.)); - *(.onchip_memory. onchip_memory.*) - . = ALIGN(4); - PROVIDE (_alt_partition_onchip_memory_end = ABSOLUTE(.)); - _end = ABSOLUTE(.); - end = ABSOLUTE(.); - __alt_stack_base = ABSOLUTE(.); - } > onchip_memory - - PROVIDE (_alt_partition_onchip_memory_load_addr = LOADADDR(.onchip_memory)); - - /* - * Stabs debugging sections. - * - */ - - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - /* DWARF debug sections. - Symbols in the DWARF debugging sections are relative to the beginning - of the section so we begin them at 0. */ - /* DWARF 1 */ - .debug 0 : { *(.debug) } - .line 0 : { *(.line) } - /* GNU DWARF 1 extensions */ - .debug_srcinfo 0 : { *(.debug_srcinfo) } - .debug_sfnames 0 : { *(.debug_sfnames) } - /* DWARF 1.1 and DWARF 2 */ - .debug_aranges 0 : { *(.debug_aranges) } - .debug_pubnames 0 : { *(.debug_pubnames) } - /* DWARF 2 */ - .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_line 0 : { *(.debug_line) } - .debug_frame 0 : { *(.debug_frame) } - .debug_str 0 : { *(.debug_str) } - .debug_loc 0 : { *(.debug_loc) } - .debug_macinfo 0 : { *(.debug_macinfo) } - /* SGI/MIPS DWARF 2 extensions */ - .debug_weaknames 0 : { *(.debug_weaknames) } - .debug_funcnames 0 : { *(.debug_funcnames) } - .debug_typenames 0 : { *(.debug_typenames) } - .debug_varnames 0 : { *(.debug_varnames) } - - /* Altera debug extensions */ - .debug_alt_sim_info 0 : { *(.debug_alt_sim_info) } -} - -/* provide a pointer for the stack */ - -/* - * Don't override this, override the __alt_stack_* symbols instead. - */ -__alt_data_end = 0x32000; - -/* - * The next two symbols define the location of the default stack. You can - * override them to move the stack to a different memory. - */ -PROVIDE( __alt_stack_pointer = __alt_data_end ); -PROVIDE( __alt_stack_limit = __alt_stack_base ); - -/* - * This symbol controls where the start of the heap is. If the stack is - * contiguous with the heap then the stack will contract as memory is - * allocated to the heap. - * Override this symbol to put the heap in a different memory. - */ -PROVIDE( __alt_heap_start = end ); -PROVIDE( __alt_heap_limit = 0x32000 ); diff --git a/software/qsys_tutorial_lcd3_bsp/mem_init.mk b/software/qsys_tutorial_lcd3_bsp/mem_init.mk deleted file mode 100644 index 1f2a48f..0000000 --- a/software/qsys_tutorial_lcd3_bsp/mem_init.mk +++ /dev/null @@ -1,322 +0,0 @@ - -######################################################################### -####### M E M I N I T M A K E F I L E C O N T E N T ###### -######################################################################### - -######################################################################### -# This file is intended to be included by public.mk -# -# -# The following variables must be defined before including this file: -# - ELF -# -# The following variables may be defined to override the default behavior: -# - HDL_SIM_DIR -# - HDL_SIM_INSTALL_DIR -# - MEM_INIT_DIR -# - MEM_INIT_INSTALL_DIR -# - QUARTUS_PROJECT_DIR -# - SOPC_NAME -# - SIM_OPTIMIZE -# - RESET_ADDRESS -# -######################################################################### - -ifeq ($(MEM_INIT_FILE),) -# MEM_INIT_FILE should be set equal to the working relative path to this -# mem_init.mk makefile fragment -MEM_INIT_FILE := $(wildcard $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))) -endif - -ifeq ($(ELF2DAT),) -ELF2DAT := elf2dat -endif - -ifeq ($(ELF2HEX),) -ELF2HEX := elf2hex -endif - -ifeq ($(ELF2FLASH),) -ELF2FLASH := elf2flash -endif - -ifeq ($(FLASH2DAT),) -FLASH2DAT := flash2dat -endif - -ifeq ($(NM),) -NM := nios2-elf-nm -endif - -ifeq ($(MKDIR),) -MKDIR := mkdir -p -endif - -ifeq ($(RM),) -RM := rm -f -endif - -ifeq ($(CP),) -CP := cp -endif - -ifeq ($(ECHO),) -ECHO := echo -endif - -MEM_INIT_DIR ?= mem_init -HDL_SIM_DIR ?= $(MEM_INIT_DIR)/hdl_sim - -ifdef QUARTUS_PROJECT_DIR -MEM_INIT_INSTALL_DIR ?= $(patsubst %/,%,$(QUARTUS_PROJECT_DIR)) -ifdef SOPC_NAME -HDL_SIM_INSTALL_DIR ?= $(patsubst %/,%,$(QUARTUS_PROJECT_DIR))/$(SOPC_NAME)_sim -endif -endif - -MEM_INIT_DESCRIPTOR_FILE ?= $(MEM_INIT_DIR)/meminit.spd - -MEM_INIT_QIP_FILE ?= $(MEM_INIT_DIR)/meminit.qip - -#------------------------------------- -# Default Flash Boot Loaders -#------------------------------------- - -BOOT_LOADER_PATH ?= $(SOPC_KIT_NIOS2)/components/altera_nios2 -BOOT_LOADER_CFI ?= $(BOOT_LOADER_PATH)/boot_loader_cfi.srec -BOOT_LOADER_CFI_BE ?= $(BOOT_LOADER_PATH)/boot_loader_cfi_be.srec - - -#------------------------------------- -# Default Target -#------------------------------------- - -.PHONY: default_mem_init -ifeq ($(QSYS),1) -default_mem_init: mem_init_generate -else -default_mem_init: mem_init_install -endif -#------------------------------------- -# Runtime Macros -#------------------------------------- - -define post-process-info - @echo Post-processing to create $@... -endef - -target_stem = $(notdir $(basename $@)) - -mem_start_address = $($(target_stem)_START) -mem_end_address = $($(target_stem)_END) -mem_width = $($(target_stem)_WIDTH) -mem_endianness = $($(target_stem)_ENDIANNESS) -mem_create_lanes = $($(target_stem)_CREATE_LANES) - -mem_pad_flag = $($(target_stem)_PAD_FLAG) -mem_reloc_input_flag = $($(target_stem)_RELOC_INPUT_FLAG) -mem_no_zero_fill_flag = $($(target_stem)_NO_ZERO_FILL_FLAG) - -flash_mem_epcs_flag = $($(target_stem)_EPCS_FLAGS) -flash_mem_cfi_flag = $($(target_stem)_CFI_FLAGS) -flash_mem_boot_loader_flag = $($(target_stem)_BOOT_LOADER_FLAG) - -elf2dat_extra_args = $(mem_pad_flag) -elf2hex_extra_args = $(mem_no_zero_fill_flag) -elf2flash_extra_args = $(flash_mem_cfi_flag) $(flash_mem_epcs_flag) $(flash_mem_boot_loader_flag) -flash2dat_extra_args = $(mem_pad_flag) $(mem_reloc_input_flag) - -#------------------------------------------------------------------------------ -# BSP SPECIFIC CONTENT -# -# The content below is controlled by the BSP and SOPC System -#------------------------------------------------------------------------------ -#START OF BSP SPECIFIC - -#------------------------------------- -# Global Settings -#------------------------------------- - - -# The following TYPE comment allows tools to identify the 'type' of target this -# makefile is associated with. -# TYPE: BSP_MEMINIT_MAKEFILE - -# This following VERSION comment indicates the version of the tool used to -# generate this makefile. A makefile variable is provided for VERSION as well. -# ACDS_VERSION: 13.0sp1 -ACDS_VERSION := 13.0sp1 - -# This following BUILD_NUMBER comment indicates the build number of the tool -# used to generate this makefile. -# BUILD_NUMBER: 232 - -# Optimize for simulation -SIM_OPTIMIZE ?= 0 - -# The CPU reset address as needed by elf2flash -RESET_ADDRESS ?= 0x00000000 - -#------------------------------------- -# Pre-Initialized Memory Descriptions -#------------------------------------- - -# Memory: onchip_memory -MEM_0 := nios_system_onchip_memory -$(MEM_0)_NAME := onchip_memory -$(MEM_0)_MEM_INIT_FILE_PARAM_NAME := INIT_FILE -HEX_FILES += $(MEM_INIT_DIR)/$(MEM_0).hex -MEM_INIT_INSTALL_FILES += $(MEM_INIT_INSTALL_DIR)/$(MEM_0).hex -DAT_FILES += $(HDL_SIM_DIR)/$(MEM_0).dat -HDL_SIM_INSTALL_FILES += $(HDL_SIM_INSTALL_DIR)/$(MEM_0).dat -SYM_FILES += $(HDL_SIM_DIR)/$(MEM_0).sym -HDL_SIM_INSTALL_FILES += $(HDL_SIM_INSTALL_DIR)/$(MEM_0).sym -$(MEM_0)_START := 0x00000000 -$(MEM_0)_END := 0x00031fff -$(MEM_0)_HIERARCHICAL_PATH := onchip_memory -$(MEM_0)_WIDTH := 32 -$(MEM_0)_ENDIANNESS := --little-endian-mem -$(MEM_0)_CREATE_LANES := 0 - -.PHONY: onchip_memory -onchip_memory: check_elf_exists $(MEM_INIT_DIR)/$(MEM_0).hex $(HDL_SIM_DIR)/$(MEM_0).dat $(HDL_SIM_DIR)/$(MEM_0).sym - - -#END OF BSP SPECIFIC - -#------------------------------------- -# Pre-Initialized Memory Targets -#------------------------------------- - -.PHONY: mem_init_install mem_init_generate mem_init_clean - -ifeq ($(QSYS),1) -# Target mem_init_install is deprecated for QSys based systems -# To initialize onchip memories for Quartus II Synthesis with Qsys based systems: -# 1) Use "make mem_init_genearate" -# 2) Add the generated mem_init/meminit.qip file to your Quartus II Project -# -mem_init_install: - $(error Deprecated Makefile Target: '$@'. Use target 'mem_init_generate' and then add $(MEM_INIT_QIP_FILE) to your Quartus II Project) - -else # QSYS != 1, if SopcBuilder based system - -ifneq ($(MEM_INIT_INSTALL_DIR),) -mem_init_install: $(MEM_INIT_INSTALL_FILES) -endif - -ifneq ($(HDL_SIM_INSTALL_DIR),) -mem_init_install: $(HDL_SIM_INSTALL_FILES) -endif - -mem_init_install: mem_init_generate -ifeq ($(MEM_INIT_INSTALL_DIR),) - @echo "WARNING: MEM_INIT_INSTALL_DIR not set. Set your QUARTUS_PROJECT_DIR environment variable." -endif -ifeq ($(HDL_SIM_INSTALL_DIR),) - @echo "WARNING: HDL_SIM_INSTALL_DIR not set. Set your QUARTUS_PROJECT_DIR and SOPC_NAME environment variable." -endif - -$(MEM_INIT_INSTALL_FILES): $(MEM_INIT_INSTALL_DIR)/%: $(MEM_INIT_DIR)/% - @$(MKDIR) $(@D) - @$(CP) -v $< $@ - -$(HDL_SIM_INSTALL_FILES): $(HDL_SIM_INSTALL_DIR)/%: $(HDL_SIM_DIR)/% - @$(MKDIR) $(@D) - @$(CP) -v $< $@ - -endif # QSYS == 1 - - -mem_init_generate: hex dat sym flash $(MEM_INIT_DESCRIPTOR_FILE) $(MEM_INIT_QIP_FILE) - -mem_init_clean: - @$(RM) -r $(MEM_INIT_DIR) $(HDL_SIM_DIR) $(FLASH_FILES) - -.PHONY: hex dat sym flash - -hex: check_elf_exists $(HEX_FILES) - -dat: check_elf_exists $(DAT_FILES) - -sym: check_elf_exists $(SYM_FILES) - -flash: check_elf_exists $(FLASH_FILES) - -#------------------------------------- -# Pre-Initialized Memory Rules -#------------------------------------- - -.PHONY: check_elf_exists -check_elf_exists: $(ELF) -ifeq ($(ELF),) - $(error ELF var not set in mem_init.mk) -endif - -$(filter-out $(FLASH_DAT_FILES),$(DAT_FILES)): %.dat: $(ELF) - $(post-process-info) - @$(MKDIR) $(@D) - bash -c '$(ELF2DAT) --infile=$< --outfile=$@ \ - --base=$(mem_start_address) --end=$(mem_end_address) --width=$(mem_width) \ - $(mem_endianness) --create-lanes=$(mem_create_lanes) $(elf2dat_extra_args)' - -$(foreach i,0 1 2 3 4 5 6 7,%_lane$(i).dat): %.dat - @true - -$(HEX_FILES): %.hex: $(ELF) - $(post-process-info) - @$(MKDIR) $(@D) - bash -c '$(ELF2HEX) $< $(mem_start_address) $(mem_end_address) --width=$(mem_width) \ - $(mem_endianness) --create-lanes=$(mem_create_lanes) $(elf2hex_extra_args) $@' - -$(SYM_FILES): %.sym: $(ELF) - $(post-process-info) - @$(MKDIR) $(@D) - $(NM) -n $< > $@ - -$(FLASH_FILES): %.flash: $(ELF) - $(post-process-info) - @$(MKDIR) $(@D) - bash -c '$(ELF2FLASH) --input=$< --outfile=$@ --sim_optimize=$(SIM_OPTIMIZE) $(mem_endianness) \ - $(elf2flash_extra_args)' - -# -# Function generate_spd_entry -# Arg1: path to the memory initialization file -# Arg2: Type HEX or DAT -# Arg3: Output spd file to append -gen_spd_entry.BASE_FILE = $(basename $(notdir $1)) -gen_spd_entry.PARAM_NAME = $($(gen_spd_entry.BASE_FILE)_MEM_INIT_FILE_PARAM_NAME) -gen_spd_entry.MEM_PATH = $($(gen_spd_entry.BASE_FILE)_HIERARCHICAL_PATH) -gen_spd_entry.SETTINGS = $(strip \ - path=\"$1\" \ - type=\"$2\" \ - $(if $(gen_spd_entry.PARAM_NAME),initParamName=\"$(gen_spd_entry.PARAM_NAME)\") \ - $(if $(gen_spd_entry.MEM_PATH),memoryPath=\"$(gen_spd_entry.MEM_PATH)\") \ -) -define gen_spd_entry -$(ECHO) "" >> $3 -endef - -$(MEM_INIT_DESCRIPTOR_FILE).DAT_FILESET := $(patsubst $(dir $(MEM_INIT_DESCRIPTOR_FILE))%,%,$(DAT_FILES)) -$(MEM_INIT_DESCRIPTOR_FILE).HEX_FILESET := $(patsubst $(dir $(MEM_INIT_DESCRIPTOR_FILE))%,%,$(HEX_FILES)) - -$(MEM_INIT_DESCRIPTOR_FILE): %.spd: $(MEM_INIT_FILE) - $(post-process-info) - @$(MKDIR) $(@D) - @$(RM) $@ - @$(ECHO) "" > $@ - @$(ECHO) "" >> $@ - @$(foreach dat_file,$($@.DAT_FILESET),$(call gen_spd_entry,$(dat_file),DAT,$@) &&)true - @$(foreach hex_file,$($@.HEX_FILESET),$(call gen_spd_entry,$(hex_file),HEX,$@) &&)true - @$(ECHO) "" >> $@ - -.DELETE_ON_ERROR: $(MEM_INIT_DESCRIPTOR_FILE) - -$(MEM_INIT_QIP_FILE): %.qip: $(MEM_INIT_FILE) - $(post-process-info) - @$(MKDIR) $(@D) - @$(RM) $@ - @$(ECHO) "set_global_assignment -name SEARCH_PATH $$::quartus(qip_path)" > $@ - -.DELETE_ON_ERROR: $(MEM_INIT_QIP_FILE) diff --git a/software/qsys_tutorial_lcd3_bsp/memory.gdb b/software/qsys_tutorial_lcd3_bsp/memory.gdb deleted file mode 100644 index 9ebe96d..0000000 --- a/software/qsys_tutorial_lcd3_bsp/memory.gdb +++ /dev/null @@ -1,50 +0,0 @@ -# memory.gdb - GDB memory region definitions -# -# Machine generated for CPU 'nios2_processor' in SOPC Builder design 'nios_system' -# SOPC Builder design path: C:/Users/takayun/Documents/DE2-115/qsys_tutorial/nios_system.sopcinfo -# -# Generated: Fri Dec 02 01:06:42 JST 2016 - -# DO NOT MODIFY THIS FILE -# -# Changing this file will have subtle consequences -# which will almost certainly lead to a nonfunctioning -# system. If you do modify this file, be aware that your -# changes will be overwritten and lost when this file -# is generated again. -# -# DO NOT MODIFY THIS FILE - -# License Agreement -# -# Copyright (c) 2008 -# Altera Corporation, San Jose, California, USA. -# All rights reserved. -# -# 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. -# -# This agreement shall be governed in all respects by the laws of the State -# of California and by the laws of the United States of America. - -# Define memory regions for each memory connected to the CPU. -# The cache attribute is specified which improves GDB performance -# by allowing GDB to cache memory contents on the host. - -# onchip_memory -memory 0x0 0x32000 cache diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_alarm_start.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_alarm_start.d deleted file mode 100644 index 3bb20ea..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_alarm_start.d +++ /dev/null @@ -1,22 +0,0 @@ -obj/HAL/src/alt_alarm_start.o: HAL/src/alt_alarm_start.c \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h system.h linker.h - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_alarm_start.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_alarm_start.o deleted file mode 100644 index 2418f17..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_alarm_start.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_busy_sleep.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_busy_sleep.d deleted file mode 100644 index e93e80c..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_busy_sleep.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_busy_sleep.o: HAL/src/alt_busy_sleep.c system.h linker.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_busy_sleep.h - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_busy_sleep.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_busy_sleep.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_busy_sleep.o deleted file mode 100644 index 9501d41..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_busy_sleep.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_close.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_close.d deleted file mode 100644 index fbbab9c..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_close.d +++ /dev/null @@ -1,34 +0,0 @@ -obj/HAL/src/alt_close.o: HAL/src/alt_close.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h \ - HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_close.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_close.o deleted file mode 100644 index 96ddd38..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_close.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_dcache_flush.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_dcache_flush.d deleted file mode 100644 index a0eaf8a..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_dcache_flush.d +++ /dev/null @@ -1,15 +0,0 @@ -obj/HAL/src/alt_dcache_flush.o: HAL/src/alt_dcache_flush.c \ - HAL/inc/nios2.h system.h linker.h HAL/inc/alt_types.h \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h - -HAL/inc/nios2.h: - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_dcache_flush.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_dcache_flush.o deleted file mode 100644 index d0f44fc..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_dcache_flush.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_dcache_flush_all.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_dcache_flush_all.d deleted file mode 100644 index 792c3e4..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_dcache_flush_all.d +++ /dev/null @@ -1,15 +0,0 @@ -obj/HAL/src/alt_dcache_flush_all.o: HAL/src/alt_dcache_flush_all.c \ - HAL/inc/nios2.h system.h linker.h HAL/inc/alt_types.h \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h - -HAL/inc/nios2.h: - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_dcache_flush_all.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_dcache_flush_all.o deleted file mode 100644 index ee4c6e1..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_dcache_flush_all.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_dcache_flush_no_writeback.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_dcache_flush_no_writeback.d deleted file mode 100644 index 867c42b..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_dcache_flush_no_writeback.d +++ /dev/null @@ -1,16 +0,0 @@ -obj/HAL/src/alt_dcache_flush_no_writeback.o: \ - HAL/src/alt_dcache_flush_no_writeback.c HAL/inc/nios2.h system.h \ - linker.h HAL/inc/alt_types.h HAL/inc/sys/alt_cache.h \ - HAL/inc/alt_types.h - -HAL/inc/nios2.h: - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_dcache_flush_no_writeback.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_dcache_flush_no_writeback.o deleted file mode 100644 index f7da147..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_dcache_flush_no_writeback.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_dev.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_dev.d deleted file mode 100644 index cd9b1d4..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_dev.d +++ /dev/null @@ -1,34 +0,0 @@ -obj/HAL/src/alt_dev.o: HAL/src/alt_dev.c HAL/inc/sys/alt_dev.h system.h \ - linker.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h \ - HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h HAL/inc/alt_types.h \ - system.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/alt_types.h: - -system.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_dev.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_dev.o deleted file mode 100644 index 7e25d95..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_dev.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_dev_llist_insert.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_dev_llist_insert.d deleted file mode 100644 index 344d065..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_dev_llist_insert.d +++ /dev/null @@ -1,13 +0,0 @@ -obj/HAL/src/alt_dev_llist_insert.o: HAL/src/alt_dev_llist_insert.c \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/alt_types.h HAL/inc/sys/alt_errno.h - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_errno.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_dev_llist_insert.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_dev_llist_insert.o deleted file mode 100644 index 0d370b7..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_dev_llist_insert.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_dma_rxchan_open.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_dma_rxchan_open.d deleted file mode 100644 index fb21fed..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_dma_rxchan_open.d +++ /dev/null @@ -1,35 +0,0 @@ -obj/HAL/src/alt_dma_rxchan_open.o: HAL/src/alt_dma_rxchan_open.c \ - HAL/inc/sys/alt_dma.h HAL/inc/sys/alt_dma_dev.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/alt_types.h HAL/inc/sys/alt_errno.h \ - HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h system.h linker.h \ - HAL/inc/sys/alt_llist.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h - -HAL/inc/sys/alt_dma.h: - -HAL/inc/sys/alt_dma_dev.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_errno.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_dma_rxchan_open.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_dma_rxchan_open.o deleted file mode 100644 index 37f3767..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_dma_rxchan_open.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_dma_txchan_open.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_dma_txchan_open.d deleted file mode 100644 index 500b95c..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_dma_txchan_open.d +++ /dev/null @@ -1,35 +0,0 @@ -obj/HAL/src/alt_dma_txchan_open.o: HAL/src/alt_dma_txchan_open.c \ - HAL/inc/sys/alt_dma.h HAL/inc/sys/alt_dma_dev.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/alt_types.h HAL/inc/sys/alt_errno.h \ - HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h system.h linker.h \ - HAL/inc/sys/alt_llist.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h - -HAL/inc/sys/alt_dma.h: - -HAL/inc/sys/alt_dma_dev.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_errno.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_dma_txchan_open.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_dma_txchan_open.o deleted file mode 100644 index 8c5c058..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_dma_txchan_open.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_do_ctors.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_do_ctors.d deleted file mode 100644 index daf8baf..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_do_ctors.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_do_ctors.o: HAL/src/alt_do_ctors.c diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_do_ctors.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_do_ctors.o deleted file mode 100644 index 4235a19..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_do_ctors.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_do_dtors.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_do_dtors.d deleted file mode 100644 index c3471eb..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_do_dtors.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_do_dtors.o: HAL/src/alt_do_dtors.c diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_do_dtors.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_do_dtors.o deleted file mode 100644 index 261d32a..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_do_dtors.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_env_lock.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_env_lock.d deleted file mode 100644 index 634d7b0..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_env_lock.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_env_lock.o: HAL/src/alt_env_lock.c diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_env_lock.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_env_lock.o deleted file mode 100644 index be19712..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_env_lock.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_environ.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_environ.d deleted file mode 100644 index e9ca295..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_environ.d +++ /dev/null @@ -1,3 +0,0 @@ -obj/HAL/src/alt_environ.o: HAL/src/alt_environ.c HAL/inc/os/alt_syscall.h - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_environ.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_environ.o deleted file mode 100644 index e633e33..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_environ.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_errno.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_errno.d deleted file mode 100644 index 29ca544..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_errno.d +++ /dev/null @@ -1,8 +0,0 @@ -obj/HAL/src/alt_errno.o: HAL/src/alt_errno.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/alt_types.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_errno.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_errno.o deleted file mode 100644 index fa6d846..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_errno.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_exception_entry.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_exception_entry.d deleted file mode 100644 index 540567e..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_exception_entry.d +++ /dev/null @@ -1,6 +0,0 @@ -obj/HAL/src/alt_exception_entry.o: HAL/src/alt_exception_entry.S system.h \ - linker.h - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_exception_entry.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_exception_entry.o deleted file mode 100644 index b045152..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_exception_entry.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_exception_muldiv.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_exception_muldiv.d deleted file mode 100644 index 63d66a7..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_exception_muldiv.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_exception_muldiv.o: HAL/src/alt_exception_muldiv.S diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_exception_muldiv.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_exception_muldiv.o deleted file mode 100644 index 998f167..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_exception_muldiv.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_exception_trap.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_exception_trap.d deleted file mode 100644 index 6e18488..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_exception_trap.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_exception_trap.o: HAL/src/alt_exception_trap.S diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_exception_trap.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_exception_trap.o deleted file mode 100644 index 10825c2..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_exception_trap.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_execve.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_execve.d deleted file mode 100644 index 9cef7d2..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_execve.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_execve.o: HAL/src/alt_execve.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_execve.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_execve.o deleted file mode 100644 index b0bc128..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_execve.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_exit.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_exit.d deleted file mode 100644 index a779da8..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_exit.d +++ /dev/null @@ -1,26 +0,0 @@ -obj/HAL/src/alt_exit.o: HAL/src/alt_exit.c HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h HAL/inc/alt_types.h system.h linker.h \ - HAL/inc/sys/alt_sim.h HAL/inc/os/alt_hooks.h HAL/inc/os/alt_syscall.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_log_printf.h system.h - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_sim.h: - -HAL/inc/os/alt_hooks.h: - -HAL/inc/os/alt_syscall.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_exit.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_exit.o deleted file mode 100644 index f3742d0..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_exit.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_fcntl.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_fcntl.d deleted file mode 100644 index 527f242..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_fcntl.d +++ /dev/null @@ -1,34 +0,0 @@ -obj/HAL/src/alt_fcntl.o: HAL/src/alt_fcntl.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h \ - system.h linker.h HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/alt_types.h \ - HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_fcntl.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_fcntl.o deleted file mode 100644 index 1f19539..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_fcntl.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_fd_lock.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_fd_lock.d deleted file mode 100644 index 93daeac..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_fd_lock.d +++ /dev/null @@ -1,27 +0,0 @@ -obj/HAL/src/alt_fd_lock.o: HAL/src/alt_fd_lock.c HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_fd_lock.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_fd_lock.o deleted file mode 100644 index 4eaacbb..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_fd_lock.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_fd_unlock.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_fd_unlock.d deleted file mode 100644 index 45a3207..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_fd_unlock.d +++ /dev/null @@ -1,27 +0,0 @@ -obj/HAL/src/alt_fd_unlock.o: HAL/src/alt_fd_unlock.c \ - HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h system.h linker.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_fd_unlock.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_fd_unlock.o deleted file mode 100644 index 1ef5ad4..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_fd_unlock.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_find_dev.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_find_dev.d deleted file mode 100644 index 98336f8..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_find_dev.d +++ /dev/null @@ -1,31 +0,0 @@ -obj/HAL/src/alt_find_dev.o: HAL/src/alt_find_dev.c HAL/inc/sys/alt_dev.h \ - system.h linker.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h \ - HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h HAL/inc/alt_types.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_find_dev.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_find_dev.o deleted file mode 100644 index 57e0147..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_find_dev.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_find_file.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_find_file.d deleted file mode 100644 index d1150ca..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_find_file.d +++ /dev/null @@ -1,32 +0,0 @@ -obj/HAL/src/alt_find_file.o: HAL/src/alt_find_file.c \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h \ - HAL/inc/alt_types.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_find_file.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_find_file.o deleted file mode 100644 index 4b25cbe..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_find_file.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_flash_dev.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_flash_dev.d deleted file mode 100644 index 8835e8f..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_flash_dev.d +++ /dev/null @@ -1,34 +0,0 @@ -obj/HAL/src/alt_flash_dev.o: HAL/src/alt_flash_dev.c \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/sys/alt_flash_dev.h \ - HAL/inc/sys/alt_flash_types.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h \ - system.h linker.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_flash_dev.h: - -HAL/inc/sys/alt_flash_types.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_flash_dev.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_flash_dev.o deleted file mode 100644 index 5e4e36f..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_flash_dev.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_fork.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_fork.d deleted file mode 100644 index 492be65..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_fork.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_fork.o: HAL/src/alt_fork.c HAL/inc/sys/alt_warning.h \ - HAL/inc/sys/alt_errno.h HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_warning.h: - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_fork.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_fork.o deleted file mode 100644 index 66f5a76..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_fork.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_fs_reg.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_fs_reg.d deleted file mode 100644 index d8f95ab..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_fs_reg.d +++ /dev/null @@ -1,29 +0,0 @@ -obj/HAL/src/alt_fs_reg.o: HAL/src/alt_fs_reg.c HAL/inc/sys/alt_dev.h \ - system.h linker.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h \ - HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_fs_reg.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_fs_reg.o deleted file mode 100644 index 36d4898..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_fs_reg.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_fstat.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_fstat.d deleted file mode 100644 index 0d021b8..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_fstat.d +++ /dev/null @@ -1,36 +0,0 @@ -obj/HAL/src/alt_fstat.o: HAL/src/alt_fstat.c HAL/inc/sys/alt_dev.h \ - system.h linker.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/sys/alt_errno.h \ - HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/sys/alt_errno.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_fstat.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_fstat.o deleted file mode 100644 index 8c5b30c..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_fstat.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_get_fd.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_get_fd.d deleted file mode 100644 index 9a4daaa..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_get_fd.d +++ /dev/null @@ -1,34 +0,0 @@ -obj/HAL/src/alt_get_fd.o: HAL/src/alt_get_fd.c HAL/inc/sys/alt_dev.h \ - system.h linker.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h \ - HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h HAL/inc/alt_types.h \ - system.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/alt_types.h: - -system.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_get_fd.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_get_fd.o deleted file mode 100644 index 37fb7b0..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_get_fd.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_getchar.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_getchar.d deleted file mode 100644 index 2a468de..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_getchar.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_getchar.o: HAL/src/alt_getchar.c diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_getchar.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_getchar.o deleted file mode 100644 index 3f4ee49..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_getchar.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_getpid.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_getpid.d deleted file mode 100644 index d9499b9..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_getpid.d +++ /dev/null @@ -1,3 +0,0 @@ -obj/HAL/src/alt_getpid.o: HAL/src/alt_getpid.c HAL/inc/os/alt_syscall.h - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_getpid.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_getpid.o deleted file mode 100644 index 98473e2..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_getpid.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_gettod.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_gettod.d deleted file mode 100644 index cf3cf34..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_gettod.d +++ /dev/null @@ -1,17 +0,0 @@ -obj/HAL/src/alt_gettod.o: HAL/src/alt_gettod.c HAL/inc/sys/alt_alarm.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/priv/alt_alarm.h \ - HAL/inc/alt_types.h HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_gettod.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_gettod.o deleted file mode 100644 index c58c109..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_gettod.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_gmon.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_gmon.d deleted file mode 100644 index e9469ab..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_gmon.d +++ /dev/null @@ -1,24 +0,0 @@ -obj/HAL/src/alt_gmon.o: HAL/src/alt_gmon.c HAL/inc/priv/nios2_gmon_data.h \ - HAL/inc/sys/alt_irq.h HAL/inc/nios2.h HAL/inc/alt_types.h system.h \ - linker.h HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h - -HAL/inc/priv/nios2_gmon_data.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_gmon.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_gmon.o deleted file mode 100644 index 1588d7f..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_gmon.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_icache_flush.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_icache_flush.d deleted file mode 100644 index 2e4ddd1..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_icache_flush.d +++ /dev/null @@ -1,15 +0,0 @@ -obj/HAL/src/alt_icache_flush.o: HAL/src/alt_icache_flush.c \ - HAL/inc/nios2.h system.h linker.h HAL/inc/alt_types.h \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h - -HAL/inc/nios2.h: - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_icache_flush.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_icache_flush.o deleted file mode 100644 index 6f5113b..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_icache_flush.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_icache_flush_all.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_icache_flush_all.d deleted file mode 100644 index 47cfbf3..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_icache_flush_all.d +++ /dev/null @@ -1,15 +0,0 @@ -obj/HAL/src/alt_icache_flush_all.o: HAL/src/alt_icache_flush_all.c \ - HAL/inc/nios2.h system.h linker.h HAL/inc/alt_types.h \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h - -HAL/inc/nios2.h: - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_icache_flush_all.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_icache_flush_all.o deleted file mode 100644 index 7cd830a..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_icache_flush_all.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_iic.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_iic.d deleted file mode 100644 index a709e0c..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_iic.d +++ /dev/null @@ -1,29 +0,0 @@ -obj/HAL/src/alt_iic.o: HAL/src/alt_iic.c system.h linker.h \ - HAL/inc/sys/alt_irq.h HAL/inc/nios2.h HAL/inc/alt_types.h system.h \ - HAL/inc/priv/alt_iic_isr_register.h HAL/inc/alt_types.h \ - HAL/inc/sys/alt_irq.h HAL/inc/priv/alt_legacy_irq.h system.h \ - HAL/inc/nios2.h - -system.h: - -linker.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -HAL/inc/priv/alt_iic_isr_register.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/priv/alt_legacy_irq.h: - -system.h: - -HAL/inc/nios2.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_iic.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_iic.o deleted file mode 100644 index 670afe4..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_iic.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_iic_isr_register.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_iic_isr_register.d deleted file mode 100644 index d0470ae..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_iic_isr_register.d +++ /dev/null @@ -1,30 +0,0 @@ -obj/HAL/src/alt_iic_isr_register.o: HAL/src/alt_iic_isr_register.c \ - system.h linker.h HAL/inc/alt_types.h HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h HAL/inc/alt_types.h system.h \ - HAL/inc/priv/alt_iic_isr_register.h HAL/inc/alt_types.h \ - HAL/inc/sys/alt_irq.h HAL/inc/sys/alt_irq_entry.h \ - HAL/inc/priv/alt_irq_table.h - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -HAL/inc/priv/alt_iic_isr_register.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/sys/alt_irq_entry.h: - -HAL/inc/priv/alt_irq_table.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_iic_isr_register.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_iic_isr_register.o deleted file mode 100644 index 676a804..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_iic_isr_register.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_instruction_exception_entry.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_instruction_exception_entry.d deleted file mode 100644 index 6d0705f..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_instruction_exception_entry.d +++ /dev/null @@ -1,18 +0,0 @@ -obj/HAL/src/alt_instruction_exception_entry.o: \ - HAL/src/alt_instruction_exception_entry.c HAL/inc/sys/alt_exceptions.h \ - HAL/inc/alt_types.h system.h linker.h HAL/inc/nios2.h \ - HAL/inc/alt_types.h system.h - -HAL/inc/sys/alt_exceptions.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_instruction_exception_entry.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_instruction_exception_entry.o deleted file mode 100644 index 8ba3e6d..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_instruction_exception_entry.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_instruction_exception_register.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_instruction_exception_register.d deleted file mode 100644 index d4fac04..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_instruction_exception_register.d +++ /dev/null @@ -1,16 +0,0 @@ -obj/HAL/src/alt_instruction_exception_register.o: \ - HAL/src/alt_instruction_exception_register.c \ - HAL/inc/sys/alt_exceptions.h HAL/inc/alt_types.h system.h linker.h \ - HAL/inc/alt_types.h system.h - -HAL/inc/sys/alt_exceptions.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -system.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_instruction_exception_register.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_instruction_exception_register.o deleted file mode 100644 index a2061ed..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_instruction_exception_register.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_io_redirect.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_io_redirect.d deleted file mode 100644 index 8228365..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_io_redirect.d +++ /dev/null @@ -1,29 +0,0 @@ -obj/HAL/src/alt_io_redirect.o: HAL/src/alt_io_redirect.c \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_io_redirect.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_io_redirect.o deleted file mode 100644 index b870eef..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_io_redirect.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_ioctl.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_ioctl.d deleted file mode 100644 index 5a705e4..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_ioctl.d +++ /dev/null @@ -1,36 +0,0 @@ -obj/HAL/src/alt_ioctl.o: HAL/src/alt_ioctl.c HAL/inc/sys/ioctl.h \ - HAL/inc/sys/alt_errno.h HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h \ - HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h system.h linker.h \ - HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/ioctl.h: - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_ioctl.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_ioctl.o deleted file mode 100644 index b18a679..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_ioctl.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_irq_entry.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_irq_entry.d deleted file mode 100644 index 9ec3751..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_irq_entry.d +++ /dev/null @@ -1,5 +0,0 @@ -obj/HAL/src/alt_irq_entry.o: HAL/src/alt_irq_entry.S system.h linker.h - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_irq_entry.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_irq_entry.o deleted file mode 100644 index 9a2941d..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_irq_entry.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_irq_handler.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_irq_handler.d deleted file mode 100644 index 6fb668f..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_irq_handler.d +++ /dev/null @@ -1,19 +0,0 @@ -obj/HAL/src/alt_irq_handler.o: HAL/src/alt_irq_handler.c system.h \ - linker.h HAL/inc/sys/alt_irq.h HAL/inc/nios2.h HAL/inc/alt_types.h \ - system.h HAL/inc/os/alt_hooks.h HAL/inc/alt_types.h - -system.h: - -linker.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -HAL/inc/os/alt_hooks.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_irq_handler.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_irq_handler.o deleted file mode 100644 index 129f63b..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_irq_handler.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_irq_register.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_irq_register.d deleted file mode 100644 index 3df2f8a..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_irq_register.d +++ /dev/null @@ -1,36 +0,0 @@ -obj/HAL/src/alt_irq_register.o: HAL/src/alt_irq_register.c system.h \ - linker.h HAL/inc/sys/alt_irq.h HAL/inc/nios2.h HAL/inc/alt_types.h \ - system.h HAL/inc/priv/alt_legacy_irq.h system.h HAL/inc/nios2.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_irq.h HAL/inc/os/alt_hooks.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_irq_entry.h \ - HAL/inc/priv/alt_irq_table.h - -system.h: - -linker.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -HAL/inc/priv/alt_legacy_irq.h: - -system.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/os/alt_hooks.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_irq_entry.h: - -HAL/inc/priv/alt_irq_table.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_irq_register.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_irq_register.o deleted file mode 100644 index e1077a1..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_irq_register.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_irq_vars.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_irq_vars.d deleted file mode 100644 index f316558..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_irq_vars.d +++ /dev/null @@ -1,8 +0,0 @@ -obj/HAL/src/alt_irq_vars.o: HAL/src/alt_irq_vars.c HAL/inc/alt_types.h \ - system.h linker.h - -HAL/inc/alt_types.h: - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_irq_vars.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_irq_vars.o deleted file mode 100644 index 85354ff..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_irq_vars.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_isatty.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_isatty.d deleted file mode 100644 index 4a21885..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_isatty.d +++ /dev/null @@ -1,36 +0,0 @@ -obj/HAL/src/alt_isatty.o: HAL/src/alt_isatty.c HAL/inc/sys/alt_dev.h \ - system.h linker.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_errno.h HAL/inc/sys/alt_warning.h \ - HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_errno.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_isatty.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_isatty.o deleted file mode 100644 index 607ff43..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_isatty.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_kill.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_kill.d deleted file mode 100644 index 0c14ae8..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_kill.d +++ /dev/null @@ -1,8 +0,0 @@ -obj/HAL/src/alt_kill.o: HAL/src/alt_kill.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_kill.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_kill.o deleted file mode 100644 index f5dd200..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_kill.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_link.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_link.d deleted file mode 100644 index dc844c6..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_link.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_link.o: HAL/src/alt_link.c HAL/inc/sys/alt_warning.h \ - HAL/inc/sys/alt_errno.h HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_warning.h: - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_link.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_link.o deleted file mode 100644 index 993332f..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_link.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_load.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_load.d deleted file mode 100644 index d496ab8..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_load.d +++ /dev/null @@ -1,8 +0,0 @@ -obj/HAL/src/alt_load.o: HAL/src/alt_load.c HAL/inc/sys/alt_load.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_cache.h - -HAL/inc/sys/alt_load.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_cache.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_load.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_load.o deleted file mode 100644 index f8134ab..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_load.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_log_macro.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_log_macro.d deleted file mode 100644 index 9768c1f..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_log_macro.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_log_macro.o: HAL/src/alt_log_macro.S diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_log_macro.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_log_macro.o deleted file mode 100644 index 489e2cc..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_log_macro.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_log_printf.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_log_printf.d deleted file mode 100644 index 251ff6d..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_log_printf.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_log_printf.o: HAL/src/alt_log_printf.c diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_log_printf.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_log_printf.o deleted file mode 100644 index a03c33d..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_log_printf.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_lseek.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_lseek.d deleted file mode 100644 index 25ed783..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_lseek.d +++ /dev/null @@ -1,34 +0,0 @@ -obj/HAL/src/alt_lseek.o: HAL/src/alt_lseek.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h \ - HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_lseek.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_lseek.o deleted file mode 100644 index 6883963..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_lseek.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_main.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_main.d deleted file mode 100644 index afdfda0..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_main.d +++ /dev/null @@ -1,47 +0,0 @@ -obj/HAL/src/alt_main.o: HAL/src/alt_main.c HAL/inc/sys/alt_dev.h system.h \ - linker.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_sys_init.h HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h HAL/inc/os/alt_hooks.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h \ - HAL/inc/alt_types.h system.h HAL/inc/sys/alt_log_printf.h system.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_sys_init.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/os/alt_hooks.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/alt_types.h: - -system.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_main.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_main.o deleted file mode 100644 index e1e1f20..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_main.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_malloc_lock.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_malloc_lock.d deleted file mode 100644 index 4ed35c2..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_malloc_lock.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_malloc_lock.o: HAL/src/alt_malloc_lock.c diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_malloc_lock.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_malloc_lock.o deleted file mode 100644 index 7857d08..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_malloc_lock.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_mcount.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_mcount.d deleted file mode 100644 index 1203efc..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_mcount.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_mcount.o: HAL/src/alt_mcount.S diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_mcount.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_mcount.o deleted file mode 100644 index dc0ce7e..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_mcount.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_open.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_open.d deleted file mode 100644 index a2aacd9..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_open.d +++ /dev/null @@ -1,36 +0,0 @@ -obj/HAL/src/alt_open.o: HAL/src/alt_open.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_open.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_open.o deleted file mode 100644 index 9030e6d..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_open.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_printf.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_printf.d deleted file mode 100644 index 3ce68a4..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_printf.d +++ /dev/null @@ -1,3 +0,0 @@ -obj/HAL/src/alt_printf.o: HAL/src/alt_printf.c HAL/inc/sys/alt_stdio.h - -HAL/inc/sys/alt_stdio.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_printf.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_printf.o deleted file mode 100644 index 2219daf..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_printf.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_putchar.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_putchar.d deleted file mode 100644 index 0f19fb8..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_putchar.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_putchar.o: HAL/src/alt_putchar.c diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_putchar.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_putchar.o deleted file mode 100644 index 24acf7f..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_putchar.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_putstr.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_putstr.d deleted file mode 100644 index ed03fdc..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_putstr.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_putstr.o: HAL/src/alt_putstr.c diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_putstr.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_putstr.o deleted file mode 100644 index 2a7943d..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_putstr.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_read.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_read.d deleted file mode 100644 index 4081a45..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_read.d +++ /dev/null @@ -1,34 +0,0 @@ -obj/HAL/src/alt_read.o: HAL/src/alt_read.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h \ - HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_read.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_read.o deleted file mode 100644 index ebce8f8..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_read.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_release_fd.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_release_fd.d deleted file mode 100644 index 0e3acb5..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_release_fd.d +++ /dev/null @@ -1,29 +0,0 @@ -obj/HAL/src/alt_release_fd.o: HAL/src/alt_release_fd.c \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_release_fd.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_release_fd.o deleted file mode 100644 index 58e66c1..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_release_fd.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_remap_cached.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_remap_cached.d deleted file mode 100644 index b5fb151..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_remap_cached.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_remap_cached.o: HAL/src/alt_remap_cached.c \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h system.h linker.h - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_remap_cached.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_remap_cached.o deleted file mode 100644 index f942389..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_remap_cached.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_remap_uncached.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_remap_uncached.d deleted file mode 100644 index 0423405..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_remap_uncached.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_remap_uncached.o: HAL/src/alt_remap_uncached.c \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h system.h linker.h - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_remap_uncached.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_remap_uncached.o deleted file mode 100644 index 9e95591..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_remap_uncached.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_rename.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_rename.d deleted file mode 100644 index b7af4b2..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_rename.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_rename.o: HAL/src/alt_rename.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_rename.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_rename.o deleted file mode 100644 index b8d09e0..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_rename.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_sbrk.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_sbrk.d deleted file mode 100644 index a0771ae..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_sbrk.d +++ /dev/null @@ -1,19 +0,0 @@ -obj/HAL/src/alt_sbrk.o: HAL/src/alt_sbrk.c HAL/inc/os/alt_syscall.h \ - HAL/inc/sys/alt_irq.h HAL/inc/nios2.h HAL/inc/alt_types.h system.h \ - linker.h HAL/inc/sys/alt_stack.h system.h - -HAL/inc/os/alt_syscall.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_stack.h: - -system.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_sbrk.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_sbrk.o deleted file mode 100644 index fd67c9b..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_sbrk.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_settod.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_settod.d deleted file mode 100644 index 56718d5..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_settod.d +++ /dev/null @@ -1,17 +0,0 @@ -obj/HAL/src/alt_settod.o: HAL/src/alt_settod.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_settod.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_settod.o deleted file mode 100644 index 16cb6b8..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_settod.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_software_exception.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_software_exception.d deleted file mode 100644 index fab4023..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_software_exception.d +++ /dev/null @@ -1,6 +0,0 @@ -obj/HAL/src/alt_software_exception.o: HAL/src/alt_software_exception.S \ - system.h linker.h - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_software_exception.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_software_exception.o deleted file mode 100644 index f9e01c2..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_software_exception.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_stat.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_stat.d deleted file mode 100644 index 8a63c27..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_stat.d +++ /dev/null @@ -1,3 +0,0 @@ -obj/HAL/src/alt_stat.o: HAL/src/alt_stat.c HAL/inc/os/alt_syscall.h - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_stat.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_stat.o deleted file mode 100644 index 0b2f244..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_stat.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_tick.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_tick.d deleted file mode 100644 index ddbb281..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_tick.d +++ /dev/null @@ -1,27 +0,0 @@ -obj/HAL/src/alt_tick.o: HAL/src/alt_tick.c HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h HAL/inc/alt_types.h system.h linker.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/os/alt_hooks.h \ - HAL/inc/alt_types.h - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_hooks.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_tick.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_tick.o deleted file mode 100644 index e3f2ff2..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_tick.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_times.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_times.d deleted file mode 100644 index 4bad83d..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_times.d +++ /dev/null @@ -1,17 +0,0 @@ -obj/HAL/src/alt_times.o: HAL/src/alt_times.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_times.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_times.o deleted file mode 100644 index 6acc882..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_times.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_uncached_free.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_uncached_free.d deleted file mode 100644 index d74ef4b..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_uncached_free.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_uncached_free.o: HAL/src/alt_uncached_free.c \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h system.h linker.h - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_uncached_free.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_uncached_free.o deleted file mode 100644 index e0d5d77..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_uncached_free.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_uncached_malloc.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_uncached_malloc.d deleted file mode 100644 index 16799fb..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_uncached_malloc.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_uncached_malloc.o: HAL/src/alt_uncached_malloc.c \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h system.h linker.h - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_uncached_malloc.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_uncached_malloc.o deleted file mode 100644 index 1d7a10e..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_uncached_malloc.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_unlink.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_unlink.d deleted file mode 100644 index 0205f86..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_unlink.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_unlink.o: HAL/src/alt_unlink.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_unlink.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_unlink.o deleted file mode 100644 index cc9c8c3..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_unlink.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_usleep.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_usleep.d deleted file mode 100644 index b5eca45..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_usleep.d +++ /dev/null @@ -1,6 +0,0 @@ -obj/HAL/src/alt_usleep.o: HAL/src/alt_usleep.c \ - HAL/inc/priv/alt_busy_sleep.h HAL/inc/os/alt_syscall.h - -HAL/inc/priv/alt_busy_sleep.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_usleep.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_usleep.o deleted file mode 100644 index 526196e..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_usleep.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_wait.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_wait.d deleted file mode 100644 index f47f5df..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_wait.d +++ /dev/null @@ -1,8 +0,0 @@ -obj/HAL/src/alt_wait.o: HAL/src/alt_wait.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_wait.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_wait.o deleted file mode 100644 index b2653a9..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_wait.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_write.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_write.d deleted file mode 100644 index 0bc4b7c..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_write.d +++ /dev/null @@ -1,38 +0,0 @@ -obj/HAL/src/alt_write.o: HAL/src/alt_write.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h \ - HAL/inc/os/alt_syscall.h HAL/inc/sys/alt_log_printf.h system.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_syscall.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_write.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_write.o deleted file mode 100644 index 71e9c2c..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/alt_write.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/altera_nios2_qsys_irq.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/altera_nios2_qsys_irq.d deleted file mode 100644 index 47bdd9c..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/altera_nios2_qsys_irq.d +++ /dev/null @@ -1,15 +0,0 @@ -obj/HAL/src/altera_nios2_qsys_irq.o: HAL/src/altera_nios2_qsys_irq.c \ - HAL/inc/sys/alt_irq.h HAL/inc/nios2.h HAL/inc/alt_types.h system.h \ - linker.h HAL/inc/altera_nios2_qsys_irq.h - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/altera_nios2_qsys_irq.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/altera_nios2_qsys_irq.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/altera_nios2_qsys_irq.o deleted file mode 100644 index 2143d01..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/altera_nios2_qsys_irq.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/crt0.d b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/crt0.d deleted file mode 100644 index 3af0bb0..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/crt0.d +++ /dev/null @@ -1,12 +0,0 @@ -obj/HAL/src/crt0.o: HAL/src/crt0.S system.h linker.h HAL/inc/nios2.h \ - HAL/inc/sys/alt_log_printf.h system.h - -system.h: - -linker.h: - -HAL/inc/nios2.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/crt0.o b/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/crt0.o deleted file mode 100644 index a23108f..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/HAL/src/crt0.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/alt_sys_init.d b/software/qsys_tutorial_lcd3_bsp/obj/alt_sys_init.d deleted file mode 100644 index 029ebe0..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/alt_sys_init.d +++ /dev/null @@ -1,59 +0,0 @@ -obj/alt_sys_init.o: alt_sys_init.c system.h linker.h \ - HAL/inc/sys/alt_irq.h HAL/inc/nios2.h HAL/inc/alt_types.h system.h \ - HAL/inc/sys/alt_sys_init.h HAL/inc/altera_nios2_qsys_irq.h \ - drivers/inc/altera_avalon_jtag_uart.h HAL/inc/sys/alt_alarm.h \ - HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h \ - HAL/inc/sys/alt_warning.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_flag.h \ - drivers/inc/altera_avalon_jtag_uart_fd.h HAL/inc/sys/alt_dev.h \ - HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h drivers/inc/altera_avalon_lcd_16207.h \ - drivers/inc/altera_avalon_lcd_16207_fd.h - -system.h: - -linker.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -HAL/inc/sys/alt_sys_init.h: - -HAL/inc/altera_nios2_qsys_irq.h: - -drivers/inc/altera_avalon_jtag_uart.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_flag.h: - -drivers/inc/altera_avalon_jtag_uart_fd.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -drivers/inc/altera_avalon_lcd_16207.h: - -drivers/inc/altera_avalon_lcd_16207_fd.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/alt_sys_init.o b/software/qsys_tutorial_lcd3_bsp/obj/alt_sys_init.o deleted file mode 100644 index 60e5e67..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/alt_sys_init.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/drivers/src/altera_avalon_jtag_uart_fd.d b/software/qsys_tutorial_lcd3_bsp/obj/drivers/src/altera_avalon_jtag_uart_fd.d deleted file mode 100644 index b152697..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/drivers/src/altera_avalon_jtag_uart_fd.d +++ /dev/null @@ -1,48 +0,0 @@ -obj/drivers/src/altera_avalon_jtag_uart_fd.o: \ - drivers/src/altera_avalon_jtag_uart_fd.c HAL/inc/alt_types.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - drivers/inc/altera_avalon_jtag_uart.h HAL/inc/sys/alt_alarm.h \ - HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_alarm.h \ - HAL/inc/sys/alt_warning.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_flag.h \ - drivers/inc/altera_avalon_jtag_uart_fd.h HAL/inc/sys/alt_dev.h - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_flag.h: - -drivers/inc/altera_avalon_jtag_uart_fd.h: - -HAL/inc/sys/alt_dev.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/drivers/src/altera_avalon_jtag_uart_fd.o b/software/qsys_tutorial_lcd3_bsp/obj/drivers/src/altera_avalon_jtag_uart_fd.o deleted file mode 100644 index 24be6a7..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/drivers/src/altera_avalon_jtag_uart_fd.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/drivers/src/altera_avalon_jtag_uart_init.d b/software/qsys_tutorial_lcd3_bsp/obj/drivers/src/altera_avalon_jtag_uart_init.d deleted file mode 100644 index f9460a1..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/drivers/src/altera_avalon_jtag_uart_init.d +++ /dev/null @@ -1,66 +0,0 @@ -obj/drivers/src/altera_avalon_jtag_uart_init.o: \ - drivers/src/altera_avalon_jtag_uart_init.c HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h HAL/inc/alt_types.h system.h linker.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/sys/ioctl.h \ - HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart_regs.h \ - HAL/inc/io.h HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_warning.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_flag.h \ - drivers/inc/altera_avalon_jtag_uart_fd.h HAL/inc/sys/alt_dev.h \ - HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/sys/alt_log_printf.h system.h - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/ioctl.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart_regs.h: - -HAL/inc/io.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_flag.h: - -drivers/inc/altera_avalon_jtag_uart_fd.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/drivers/src/altera_avalon_jtag_uart_init.o b/software/qsys_tutorial_lcd3_bsp/obj/drivers/src/altera_avalon_jtag_uart_init.o deleted file mode 100644 index a612e51..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/drivers/src/altera_avalon_jtag_uart_init.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/drivers/src/altera_avalon_jtag_uart_ioctl.d b/software/qsys_tutorial_lcd3_bsp/obj/drivers/src/altera_avalon_jtag_uart_ioctl.d deleted file mode 100644 index d75a559..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/drivers/src/altera_avalon_jtag_uart_ioctl.d +++ /dev/null @@ -1,58 +0,0 @@ -obj/drivers/src/altera_avalon_jtag_uart_ioctl.o: \ - drivers/src/altera_avalon_jtag_uart_ioctl.c HAL/inc/sys/ioctl.h \ - HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart_regs.h \ - HAL/inc/io.h HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h \ - HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_flag.h \ - drivers/inc/altera_avalon_jtag_uart_fd.h HAL/inc/sys/alt_dev.h system.h \ - linker.h HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/sys/alt_log_printf.h system.h - -HAL/inc/sys/ioctl.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart_regs.h: - -HAL/inc/io.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_flag.h: - -drivers/inc/altera_avalon_jtag_uart_fd.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/drivers/src/altera_avalon_jtag_uart_ioctl.o b/software/qsys_tutorial_lcd3_bsp/obj/drivers/src/altera_avalon_jtag_uart_ioctl.o deleted file mode 100644 index 8fe8058..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/drivers/src/altera_avalon_jtag_uart_ioctl.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/drivers/src/altera_avalon_jtag_uart_read.d b/software/qsys_tutorial_lcd3_bsp/obj/drivers/src/altera_avalon_jtag_uart_read.d deleted file mode 100644 index 9a4846a..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/drivers/src/altera_avalon_jtag_uart_read.d +++ /dev/null @@ -1,66 +0,0 @@ -obj/drivers/src/altera_avalon_jtag_uart_read.o: \ - drivers/src/altera_avalon_jtag_uart_read.c HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h HAL/inc/alt_types.h system.h linker.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/sys/ioctl.h \ - HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart_regs.h \ - HAL/inc/io.h HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_warning.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_flag.h \ - drivers/inc/altera_avalon_jtag_uart_fd.h HAL/inc/sys/alt_dev.h \ - HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/sys/alt_log_printf.h system.h - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/ioctl.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart_regs.h: - -HAL/inc/io.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_flag.h: - -drivers/inc/altera_avalon_jtag_uart_fd.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/drivers/src/altera_avalon_jtag_uart_read.o b/software/qsys_tutorial_lcd3_bsp/obj/drivers/src/altera_avalon_jtag_uart_read.o deleted file mode 100644 index 30dbfbc..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/drivers/src/altera_avalon_jtag_uart_read.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/drivers/src/altera_avalon_jtag_uart_write.d b/software/qsys_tutorial_lcd3_bsp/obj/drivers/src/altera_avalon_jtag_uart_write.d deleted file mode 100644 index 5518b7f..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/drivers/src/altera_avalon_jtag_uart_write.d +++ /dev/null @@ -1,66 +0,0 @@ -obj/drivers/src/altera_avalon_jtag_uart_write.o: \ - drivers/src/altera_avalon_jtag_uart_write.c HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h HAL/inc/alt_types.h system.h linker.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/sys/ioctl.h \ - HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart_regs.h \ - HAL/inc/io.h HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_warning.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_flag.h \ - drivers/inc/altera_avalon_jtag_uart_fd.h HAL/inc/sys/alt_dev.h \ - HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/sys/alt_log_printf.h system.h - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/ioctl.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart_regs.h: - -HAL/inc/io.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_flag.h: - -drivers/inc/altera_avalon_jtag_uart_fd.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/drivers/src/altera_avalon_jtag_uart_write.o b/software/qsys_tutorial_lcd3_bsp/obj/drivers/src/altera_avalon_jtag_uart_write.o deleted file mode 100644 index 1fc68b3..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/drivers/src/altera_avalon_jtag_uart_write.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/drivers/src/altera_avalon_lcd_16207.d b/software/qsys_tutorial_lcd3_bsp/obj/drivers/src/altera_avalon_lcd_16207.d deleted file mode 100644 index dfd0adb..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/drivers/src/altera_avalon_lcd_16207.d +++ /dev/null @@ -1,47 +0,0 @@ -obj/drivers/src/altera_avalon_lcd_16207.o: \ - drivers/src/altera_avalon_lcd_16207.c HAL/inc/sys/alt_alarm.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/priv/alt_alarm.h \ - HAL/inc/alt_types.h drivers/inc/altera_avalon_lcd_16207_regs.h \ - HAL/inc/io.h HAL/inc/alt_types.h drivers/inc/altera_avalon_lcd_16207.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h drivers/inc/altera_avalon_lcd_16207_fd.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_lcd_16207_regs.h: - -HAL/inc/io.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_lcd_16207.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -drivers/inc/altera_avalon_lcd_16207_fd.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/drivers/src/altera_avalon_lcd_16207.o b/software/qsys_tutorial_lcd3_bsp/obj/drivers/src/altera_avalon_lcd_16207.o deleted file mode 100644 index 07542cf..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/drivers/src/altera_avalon_lcd_16207.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/obj/drivers/src/altera_avalon_lcd_16207_fd.d b/software/qsys_tutorial_lcd3_bsp/obj/drivers/src/altera_avalon_lcd_16207_fd.d deleted file mode 100644 index b39dc1d..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/drivers/src/altera_avalon_lcd_16207_fd.d +++ /dev/null @@ -1,43 +0,0 @@ -obj/drivers/src/altera_avalon_lcd_16207_fd.o: \ - drivers/src/altera_avalon_lcd_16207_fd.c HAL/inc/alt_types.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - drivers/inc/altera_avalon_lcd_16207.h HAL/inc/sys/alt_alarm.h \ - HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_alarm.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h drivers/inc/altera_avalon_lcd_16207_fd.h \ - HAL/inc/sys/alt_dev.h - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_lcd_16207.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -drivers/inc/altera_avalon_lcd_16207_fd.h: - -HAL/inc/sys/alt_dev.h: diff --git a/software/qsys_tutorial_lcd3_bsp/obj/drivers/src/altera_avalon_lcd_16207_fd.o b/software/qsys_tutorial_lcd3_bsp/obj/drivers/src/altera_avalon_lcd_16207_fd.o deleted file mode 100644 index c4dd725..0000000 --- a/software/qsys_tutorial_lcd3_bsp/obj/drivers/src/altera_avalon_lcd_16207_fd.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd3_bsp/public.mk b/software/qsys_tutorial_lcd3_bsp/public.mk deleted file mode 100644 index 2fd6fc6..0000000 --- a/software/qsys_tutorial_lcd3_bsp/public.mk +++ /dev/null @@ -1,377 +0,0 @@ -#------------------------------------------------------------------------------ -# BSP "PUBLIC" MAKEFILE CONTENT -# -# This file is intended to be included in an application or library -# Makefile that is using this BSP. You can create such a Makefile with -# the nios2-app-generate-makefile or nios2-lib-generate-makefile -# commands. -# -# The following variables must be defined before including this file: -# -# ALT_LIBRARY_ROOT_DIR -# Contains the path to the BSP top-level (aka root) directory -#------------------------------------------------------------------------------ - -#------------------------------------------------------------------------------ -# PATHS -#------------------------------------------------------------------------------ - - - -# Path to the provided linker script. -BSP_LINKER_SCRIPT := $(ALT_LIBRARY_ROOT_DIR)/linker.x - -# Include paths: -# The path to root of all header files that a library wishes to make -# available for an application's use is specified here. Note that this -# may not be *all* folders within a hierarchy. For example, if it is -# desired that the application developer type: -# #include -# #include -# With files laid out like this: -# /inc/sockets.h -# /inc/ip/tcpip.h -# -# Then, only /inc need be added to the list of include -# directories. Alternatively, if you wish to be able to directly include -# all files in a hierarchy, separate paths to each folder in that -# hierarchy must be defined. - -# The following are the "base" set of include paths for a BSP. -# These paths are appended to the list that individual software -# components, drivers, etc., add in the generated portion of this -# file (below). -ALT_INCLUDE_DIRS_TO_APPEND += \ - $(ALT_LIBRARY_ROOT_DIR) \ - $(ALT_LIBRARY_ROOT_DIR)/drivers/inc - -# Additions to linker library search-path: -# Here we provide a path to "our self" for the application to construct a -# "-L " out of. This should contain a list of directories, -# relative to the library root, of all directories with .a files to link -# against. -ALT_LIBRARY_DIRS += $(ALT_LIBRARY_ROOT_DIR) - - -#------------------------------------------------------------------------------ -# COMPILATION FLAGS -#------------------------------------------------------------------------------ -# Default C pre-processor flags for a BSP: -ALT_CPPFLAGS += -DSYSTEM_BUS_WIDTH=32 \ - -pipe - - -#------------------------------------------------------------------------------ -# MANAGED CONTENT -# -# All content between the lines "START MANAGED" and "END MANAGED" below is -# generated based on variables in the BSP settings file when the -# nios2-bsp-generate-files command is invoked. If you wish to persist any -# information pertaining to the build process, it is recomended that you -# utilize the BSP settings mechanism to do so. -#------------------------------------------------------------------------------ -#START MANAGED - -# The following TYPE comment allows tools to identify the 'type' of target this -# makefile is associated with. -# TYPE: BSP_PUBLIC_MAKEFILE - -# This following VERSION comment indicates the version of the tool used to -# generate this makefile. A makefile variable is provided for VERSION as well. -# ACDS_VERSION: 13.0sp1 -ACDS_VERSION := 13.0sp1 - -# This following BUILD_NUMBER comment indicates the build number of the tool -# used to generate this makefile. -# BUILD_NUMBER: 232 - -# Qsys--generated SOPCINFO file. Required for resolving node instance ID's with -# design component names. -SOPCINFO_FILE := C:/Users/takayun/Documents/DE2-115/qsys_tutorial/nios_system.sopcinfo - -# Big-Endian operation. -# setting BIG_ENDIAN is false -ALT_CFLAGS += -EL - -# Path to the provided C language runtime initialization code. -BSP_CRT0 := $(ALT_LIBRARY_ROOT_DIR)/obj/HAL/src/crt0.o - -# Name of BSP library as provided to linker using the "-msys-lib" flag or -# linker script GROUP command. -# setting BSP_SYS_LIB is hal_bsp -BSP_SYS_LIB := hal_bsp -ELF_PATCH_FLAG += --thread_model hal - -# Type identifier of the BSP library -# setting BSP_TYPE is hal -ALT_CPPFLAGS += -D__hal__ -BSP_TYPE := hal - -# CPU Name -# setting CPU_NAME is nios2_processor -CPU_NAME = nios2_processor -ELF_PATCH_FLAG += --cpu_name $(CPU_NAME) - -# Hardware Divider present. -# setting HARDWARE_DIVIDE is false -ALT_CFLAGS += -mno-hw-div - -# Hardware Multiplier present. -# setting HARDWARE_MULTIPLY is false -ALT_CFLAGS += -mno-hw-mul - -# Hardware Mulx present. -# setting HARDWARE_MULX is false -ALT_CFLAGS += -mno-hw-mulx - -# Debug Core present. -# setting HAS_DEBUG_CORE is true -CPU_HAS_DEBUG_CORE = 1 - -# Qsys generated design -# setting QSYS is 1 -QSYS := 1 -ELF_PATCH_FLAG += --qsys true - -# Design Name -# setting SOPC_NAME is nios_system -SOPC_NAME := nios_system - -# SopcBuilder Simulation Enabled -# setting SOPC_SIMULATION_ENABLED is false -ELF_PATCH_FLAG += --simulation_enabled false - -# Enable JTAG UART driver to recover when host is inactive causing buffer to -# full without returning error. Printf will not fail with this recovery. none -# setting altera_avalon_jtag_uart_driver.enable_jtag_uart_ignore_fifo_full_error is false - -# Small-footprint (polled mode) driver none -# setting altera_avalon_jtag_uart_driver.enable_small_driver is false - -# Build a custom version of newlib with the specified space-separated compiler -# flags. The custom newlib build will be placed in the <bsp root>/newlib -# directory, and will be used only for applications that utilize this BSP. -# setting hal.custom_newlib_flags is none - -# Enable support for a subset of the C++ language. This option increases code -# footprint by adding support for C++ constructors. Certain features, such as -# multiple inheritance and exceptions are not supported. If false, adds -# -DALT_NO_C_PLUS_PLUS to ALT_CPPFLAGS in public.mk, and reduces code -# footprint. none -# setting hal.enable_c_plus_plus is true - -# When your application exits, close file descriptors, call C++ destructors, -# etc. Code footprint can be reduced by disabling clean exit. If disabled, adds -# -DALT_NO_CLEAN_EXIT to ALT_CPPFLAGS and -Wl,--defsym, exit=_exit to -# ALT_LDFLAGS in public.mk. none -# setting hal.enable_clean_exit is true - -# Add exit() support. This option increases code footprint if your "main()" -# routine does "return" or call "exit()". If false, adds -DALT_NO_EXIT to -# ALT_CPPFLAGS in public.mk, and reduces footprint none -# setting hal.enable_exit is true - -# Causes code to be compiled with gprof profiling enabled and the application -# ELF to be linked with the GPROF library. If true, adds -DALT_PROVIDE_GMON to -# ALT_CPPFLAGS and -pg to ALT_CFLAGS in public.mk. none -# setting hal.enable_gprof is false - -# Enables lightweight device driver API. This reduces code and data footprint -# by removing the HAL layer that maps device names (e.g. /dev/uart0) to file -# descriptors. Instead, driver routines are called directly. The open(), -# close(), and lseek() routines will always fail if called. The read(), -# write(), fstat(), ioctl(), and isatty() routines only work for the stdio -# devices. If true, adds -DALT_USE_DIRECT_DRIVERS to ALT_CPPFLAGS in public.mk. -# The Altera Host and read-only ZIP file systems can't be used if -# hal.enable_lightweight_device_driver_api is true. -# setting hal.enable_lightweight_device_driver_api is false - -# Adds code to emulate multiply and divide instructions in case they are -# executed but aren't present in the CPU. Normally this isn't required because -# the compiler won't use multiply and divide instructions that aren't present -# in the CPU. If false, adds -DALT_NO_INSTRUCTION_EMULATION to ALT_CPPFLAGS in -# public.mk. none -# setting hal.enable_mul_div_emulation is false -ALT_CPPFLAGS += -DALT_NO_INSTRUCTION_EMULATION - -# Certain drivers are compiled with reduced functionality to reduce code -# footprint. Not all drivers observe this setting. The altera_avalon_uart and -# altera_avalon_jtag_uart drivers switch from interrupt-driven to polled -# operation. CAUTION: Several device drivers are disabled entirely. These -# include the altera_avalon_cfi_flash, altera_avalon_epcs_flash_controller, and -# altera_avalon_lcd_16207 drivers. This can result in certain API (HAL flash -# access routines) to fail. You can define a symbol provided by each driver to -# prevent it from being removed. If true, adds -DALT_USE_SMALL_DRIVERS to -# ALT_CPPFLAGS in public.mk. none -# setting hal.enable_reduced_device_drivers is false - -# Turns on HAL runtime stack checking feature. Enabling this setting causes -# additional code to be placed into each subroutine call to generate an -# exception if a stack collision occurs with the heap or statically allocated -# data. If true, adds -DALT_STACK_CHECK and -mstack-check to ALT_CPPFLAGS in -# public.mk. none -# setting hal.enable_runtime_stack_checking is false - -# The BSP is compiled with optimizations to speedup HDL simulation such as -# initializing the cache, clearing the .bss section, and skipping long delay -# loops. If true, adds -DALT_SIM_OPTIMIZE to ALT_CPPFLAGS in public.mk. When -# this setting is true, the BSP shouldn't be used to build applications that -# are expected to run real hardware. -# setting hal.enable_sim_optimize is false - -# Causes the small newlib (C library) to be used. This reduces code and data -# footprint at the expense of reduced functionality. Several newlib features -# are removed such as floating-point support in printf(), stdin input routines, -# and buffered I/O. The small C library is not compatible with Micrium -# MicroC/OS-II. If true, adds -msmallc to ALT_LDFLAGS in public.mk. none -# setting hal.enable_small_c_library is false - -# Enable SOPC Builder System ID. If a System ID SOPC Builder component is -# connected to the CPU associated with this BSP, it will be enabled in the -# creation of command-line arguments to download an ELF to the target. -# Otherwise, system ID and timestamp values are left out of public.mk for -# application Makefile "download-elf" target definition. With the system ID -# check disabled, the Nios II EDS tools will not automatically ensure that the -# application .elf file (and BSP it is linked against) corresponds to the -# hardware design on the target. If false, adds --accept-bad-sysid to -# SOPC_SYSID_FLAG in public.mk. none -# setting hal.enable_sopc_sysid_check is true - -# Enable BSP generation to query if SOPC system is big endian. If true ignores -# export of 'ALT_CFLAGS += -EB' to public.mk if big endian system. If true -# ignores export of 'ALT_CFLAGS += -EL' if little endian system. none -# setting hal.make.ignore_system_derived.big_endian is false - -# Enable BSP generation to query if SOPC system has a debug core present. If -# true ignores export of 'CPU_HAS_DEBUG_CORE = 1' to public.mk if a debug core -# is found in the system. If true ignores export of 'CPU_HAS_DEBUG_CORE = 0' if -# no debug core is found in the system. none -# setting hal.make.ignore_system_derived.debug_core_present is false - -# Enable BSP generation to query if SOPC system has FPU present. If true -# ignores export of 'ALT_CFLAGS += -mhard-float' to public.mk if FPU is found -# in the system. If true ignores export of 'ALT_CFLAGS += -mhard-soft' if FPU -# is not found in the system. none -# setting hal.make.ignore_system_derived.fpu_present is false - -# Enable BSP generation to query if SOPC system has hardware divide present. If -# true ignores export of 'ALT_CFLAGS += -mno-hw-div' to public.mk if no -# division is found in system. If true ignores export of 'ALT_CFLAGS += -# -mhw-div' if division is found in the system. none -# setting hal.make.ignore_system_derived.hardware_divide_present is false - -# Enable BSP generation to query if SOPC system floating point custom -# instruction with a divider is present. If true ignores export of 'ALT_CFLAGS -# += -mcustom-fpu-cfg=60-2' and 'ALT_LDFLAGS += -mcustom-fpu-cfg=60-2' to -# public.mk if the custom instruction is found in the system. none -# setting hal.make.ignore_system_derived.hardware_fp_cust_inst_divider_present is false - -# Enable BSP generation to query if SOPC system floating point custom -# instruction without a divider is present. If true ignores export of -# 'ALT_CFLAGS += -mcustom-fpu-cfg=60-1' and 'ALT_LDFLAGS += -# -mcustom-fpu-cfg=60-1' to public.mk if the custom instruction is found in the -# system. none -# setting hal.make.ignore_system_derived.hardware_fp_cust_inst_no_divider_present is false - -# Enable BSP generation to query if SOPC system has multiplier present. If true -# ignores export of 'ALT_CFLAGS += -mno-hw-mul' to public.mk if no multiplier -# is found in the system. If true ignores export of 'ALT_CFLAGS += -mhw-mul' if -# multiplier is found in the system. none -# setting hal.make.ignore_system_derived.hardware_multiplier_present is false - -# Enable BSP generation to query if SOPC system has hardware mulx present. If -# true ignores export of 'ALT_CFLAGS += -mno-hw-mulx' to public.mk if no mulx -# is found in the system. If true ignores export of 'ALT_CFLAGS += -mhw-mulx' -# if mulx is found in the system. none -# setting hal.make.ignore_system_derived.hardware_mulx_present is false - -# Enable BSP generation to query if SOPC system has simulation enabled. If true -# ignores export of 'ELF_PATCH_FLAG += --simulation_enabled' to public.mk. none -# setting hal.make.ignore_system_derived.sopc_simulation_enabled is false - -# Enable BSP generation to query SOPC system for system ID base address. If -# true ignores export of 'SOPC_SYSID_FLAG += --sidp=
' and -# 'ELF_PATCH_FLAG += --sidp=
' to public.mk. none -# setting hal.make.ignore_system_derived.sopc_system_base_address is false - -# Enable BSP generation to query SOPC system for system ID. If true ignores -# export of 'SOPC_SYSID_FLAG += --id=' and 'ELF_PATCH_FLAG += -# --id=' to public.mk. none -# setting hal.make.ignore_system_derived.sopc_system_id is false - -# Enable BSP generation to query SOPC system for system timestamp. If true -# ignores export of 'SOPC_SYSID_FLAG += --timestamp=' and -# 'ELF_PATCH_FLAG += --timestamp=' to public.mk. none -# setting hal.make.ignore_system_derived.sopc_system_timestamp is false - -# Slave descriptor of STDERR character-mode device. This setting is used by the -# ALT_STDERR family of defines in system.h. none -# setting hal.stderr is jtag_uart -ELF_PATCH_FLAG += --stderr_dev jtag_uart - -# Slave descriptor of STDIN character-mode device. This setting is used by the -# ALT_STDIN family of defines in system.h. none -# setting hal.stdin is jtag_uart -ELF_PATCH_FLAG += --stdin_dev jtag_uart - -# Slave descriptor of STDOUT character-mode device. This setting is used by the -# ALT_STDOUT family of defines in system.h. none -# setting hal.stdout is jtag_uart -ELF_PATCH_FLAG += --stdout_dev jtag_uart - - -#------------------------------------------------------------------------------ -# SOFTWARE COMPONENT & DRIVER INCLUDE PATHS -#------------------------------------------------------------------------------ - -ALT_INCLUDE_DIRS += $(ALT_LIBRARY_ROOT_DIR)/HAL/inc - -#------------------------------------------------------------------------------ -# SOFTWARE COMPONENT & DRIVER PRODUCED ALT_CPPFLAGS ADDITIONS -#------------------------------------------------------------------------------ - -ALT_CPPFLAGS += -DALT_SINGLE_THREADED - -#END MANAGED - - -#------------------------------------------------------------------------------ -# LIBRARY INFORMATION -#------------------------------------------------------------------------------ -# Assemble the name of the BSP *.a file using the BSP library name -# (BSP_SYS_LIB) in generated content above. -BSP_LIB := lib$(BSP_SYS_LIB).a - -# Additional libraries to link against: -# An application including this file will prefix each library with "-l". -# For example, to include the Newlib math library "m" is included, which -# becomes "-lm" when linking the application. -ALT_LIBRARY_NAMES += m - -# Additions to linker dependencies: -# An application Makefile will typically add these directly to the list -# of dependencies required to build the executable target(s). The BSP -# library (*.a) file is specified here. -ALT_LDDEPS += $(ALT_LIBRARY_ROOT_DIR)/$(BSP_LIB) - -# Is this library "Makeable"? -# Add to list of root library directories that support running 'make' -# to build them. Because libraries may or may not have a Makefile in their -# root, appending to this variable tells an application to run 'make' in -# the library root to build/update this library. -MAKEABLE_LIBRARY_ROOT_DIRS += $(ALT_LIBRARY_ROOT_DIR) - -# Additional Assembler Flags -# -gdwarf2 flag is required for stepping through assembly code -ALT_ASFLAGS += -gdwarf2 - -#------------------------------------------------------------------------------ -# FINAL INCLUDE PATH LIST -#------------------------------------------------------------------------------ -# Append static include paths to paths specified by OS/driver/sw package -# additions to the BSP thus giving them precedence in case a BSP addition -# is attempting to override BSP sources. -ALT_INCLUDE_DIRS += $(ALT_INCLUDE_DIRS_TO_APPEND) - - - diff --git a/software/qsys_tutorial_lcd3_bsp/settings.bsp b/software/qsys_tutorial_lcd3_bsp/settings.bsp deleted file mode 100644 index 13f012c..0000000 --- a/software/qsys_tutorial_lcd3_bsp/settings.bsp +++ /dev/null @@ -1,991 +0,0 @@ - - - hal - default - 2016/12/02 1:06:41 - 1480608401552 - C:\Users\takayun\Documents\DE2-115\qsys_tutorial\software\qsys_tutorial_lcd3_bsp - .\settings.bsp - C:\Users\takayun\Documents\DE2-115\qsys_tutorial\nios_system.sopcinfo - default - nios2_processor - 1.9 - - hal.sys_clk_timer - ALT_SYS_CLK - UnquotedString - none - none - system_h_define - Slave descriptor of the system clock timer device. This device provides a periodic interrupt ("tick") and is typically required for RTOS use. This setting defines the value of ALT_SYS_CLK in system.h. - none - false - common - - - hal.timestamp_timer - ALT_TIMESTAMP_CLK - UnquotedString - none - none - system_h_define - Slave descriptor of timestamp timer device. This device is used by Altera HAL timestamp drivers for high-resolution time measurement. This setting defines the value of ALT_TIMESTAMP_CLK in system.h. - none - false - common - - - hal.max_file_descriptors - ALT_MAX_FD - DecimalNumber - 32 - 32 - system_h_define - Determines the number of file descriptors statically allocated. This setting defines the value of ALT_MAX_FD in system.h. - If hal.enable_lightweight_device_driver_api is true, there are no file descriptors so this setting is ignored. If hal.enable_lightweight_device_driver_api is false, this setting must be at least 4 because HAL needs a file descriptor for /dev/null, /dev/stdin, /dev/stdout, and /dev/stderr. - false - - - - hal.enable_instruction_related_exceptions_api - ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API - BooleanDefineOnly - false - false - system_h_define - Enables API for registering handlers to service instruction-related exceptions. Enabling this setting increases the size of the exception entry code. - These exception types can be generated if various processor options are enabled, such as the MMU, MPU, or other advanced exception types. - false - - - - hal.linker.allow_code_at_reset - ALT_ALLOW_CODE_AT_RESET - Boolean - 1 - 0 - none - Indicates if initialization code is allowed at the reset address. If true, defines the macro ALT_ALLOW_CODE_AT_RESET in linker.h. - If true, defines the macro ALT_ALLOW_CODE_AT_RESET in linker.h. This setting is typically false if an external bootloader (e.g. flash bootloader) is present. - false - - - - hal.linker.enable_alt_load - NONE - Boolean - 1 - 0 - none - Enables the alt_load() facility. The alt_load() facility copies sections from the .text memory into RAM. If true, this setting sets up the VMA/LMA of sections in linker.x to allow them to be loaded into the .text memory. - This setting is typically false if an external bootloader (e.g. flash bootloader) is present. - false - - - - hal.linker.enable_alt_load_copy_rodata - NONE - Boolean - 0 - 0 - none - Causes the alt_load() facility to copy the .rodata section. If true, this setting defines the macro ALT_LOAD_COPY_RODATA in linker.h. - none - false - - - - hal.linker.enable_alt_load_copy_rwdata - NONE - Boolean - 1 - 0 - none - Causes the alt_load() facility to copy the .rwdata section. If true, this setting defines the macro ALT_LOAD_COPY_RWDATA in linker.h. - none - false - - - - hal.linker.enable_alt_load_copy_exceptions - NONE - Boolean - 0 - 0 - none - Causes the alt_load() facility to copy the .exceptions section. If true, this setting defines the macro ALT_LOAD_COPY_EXCEPTIONS in linker.h. - none - false - - - - hal.linker.enable_exception_stack - NONE - Boolean - 0 - 0 - none - Enables use of a separate exception stack. If true, defines the macro ALT_EXCEPTION_STACK in linker.h, adds a memory region called exception_stack to linker.x, and provides the symbols __alt_exception_stack_pointer and __alt_exception_stack_limit in linker.x. - The hal.linker.exception_stack_size and hal.linker.exception_stack_memory_region_name settings must also be valid. This setting must be false for MicroC/OS-II BSPs. The exception stack can be used to improve interrupt and other exception performance if the EIC is *not* used. - false - common - - - hal.linker.exception_stack_size - NONE - DecimalNumber - 1024 - 1024 - none - Size of the exception stack in bytes. - Only used if hal.linker.enable_exception_stack is true. - false - common - - - hal.linker.exception_stack_memory_region_name - NONE - UnquotedString - onchip_memory - none - none - Name of the existing memory region that will be divided up to create the 'exception_stack' memory region. The selected region name will be adjusted automatically when the BSP is generated to create the 'exception_stack' memory region. - Only used if hal.linker.enable_exception_stack is true. - false - common - - - hal.linker.enable_interrupt_stack - NONE - Boolean - 0 - 0 - none - Enables use of a separate interrupt stack. If true, defines the macro ALT_INTERRUPT_STACK in linker.h, adds a memory region called interrupt_stack to linker.x, and provides the symbols __alt_interrupt_stack_pointer and __alt_interrupt_stack_limit in linker.x. - The hal.linker.interrupt_stack_size and hal.linker.interrupt_stack_memory_region_name settings must also be valid. This setting must be false for MicroC/OS-II BSPs. Only enable if the EIC is used exclusively. The exception stack can be used to improve interrupt and other exception performance if the EIC is *not* used. - false - common - - - hal.linker.interrupt_stack_size - NONE - DecimalNumber - 1024 - 1024 - none - Size of the interrupt stack in bytes. - Only used if hal.linker.enable_interrupt_stack is true. - false - common - - - hal.linker.interrupt_stack_memory_region_name - NONE - UnquotedString - onchip_memory - none - none - Name of the existing memory region that will be divided up to create the 'interrupt_stack' memory region. The selected region name will be adjusted automatically when the BSP is generated to create the 'interrupt_stack' memory region. - Only used if hal.linker.enable_interrupt_stack is true. - false - common - - - hal.stdin - NONE - UnquotedString - jtag_uart - none - system_h_define - Slave descriptor of STDIN character-mode device. This setting is used by the ALT_STDIN family of defines in system.h. - none - false - common - - - hal.stdout - NONE - UnquotedString - jtag_uart - none - system_h_define - Slave descriptor of STDOUT character-mode device. This setting is used by the ALT_STDOUT family of defines in system.h. - none - false - common - - - hal.stderr - NONE - UnquotedString - jtag_uart - none - system_h_define - Slave descriptor of STDERR character-mode device. This setting is used by the ALT_STDERR family of defines in system.h. - none - false - common - - - hal.log_port - NONE - UnquotedString - none - none - public_mk_define - Slave descriptor of debug logging character-mode device. If defined, it enables extra debug messages in the HAL source. This setting is used by the ALT_LOG_PORT family of defines in system.h. - none - false - none - - - hal.make.build_pre_process - BUILD_PRE_PROCESS - UnquotedString - none - none - makefile_variable - Command executed before BSP built. - none - false - none - - - hal.make.ar_pre_process - AR_PRE_PROCESS - UnquotedString - none - none - makefile_variable - Command executed before archiver execution. - none - false - none - - - hal.make.bsp_cflags_defined_symbols - BSP_CFLAGS_DEFINED_SYMBOLS - UnquotedString - none - none - makefile_variable - Preprocessor macros to define. A macro definition in this setting has the same effect as a "#define" in source code. Adding "-DALT_DEBUG" to this setting has the same effect as "#define ALT_DEBUG" in a souce file. Adding "-DFOO=1" to this setting is equivalent to the macro "#define FOO 1" in a source file. Macros defined with this setting are applied to all .S, .c, and C++ files in the BSP. This setting defines the value of BSP_CFLAGS_DEFINED_SYMBOLS in the BSP Makefile. - none - false - none - - - hal.make.ar_post_process - AR_POST_PROCESS - UnquotedString - none - none - makefile_variable - Command executed after archiver execution. - none - false - none - - - hal.make.as - AS - UnquotedString - nios2-elf-gcc - nios2-elf-gcc - makefile_variable - Assembler command. Note that CC is used for .S files. - none - false - none - - - hal.make.build_post_process - BUILD_POST_PROCESS - UnquotedString - none - none - makefile_variable - Command executed after BSP built. - none - false - none - - - hal.make.bsp_cflags_debug - BSP_CFLAGS_DEBUG - UnquotedString - -g - -g - makefile_variable - C/C++ compiler debug level. '-g' provides the default set of debug symbols typically required to debug a typical application. Omitting '-g' removes debug symbols from the ELF. This setting defines the value of BSP_CFLAGS_DEBUG in Makefile. - none - false - common - - - hal.make.ar - AR - UnquotedString - nios2-elf-ar - nios2-elf-ar - makefile_variable - Archiver command. Creates library files. - none - false - none - - - hal.make.rm - RM - UnquotedString - rm -f - rm -f - makefile_variable - Command used to remove files during 'clean' target. - none - false - none - - - hal.make.cxx_pre_process - CXX_PRE_PROCESS - UnquotedString - none - none - makefile_variable - Command executed before each C++ file is compiled. - none - false - none - - - hal.make.bsp_cflags_warnings - BSP_CFLAGS_WARNINGS - UnquotedString - -Wall - -Wall - makefile_variable - C/C++ compiler warning level. "-Wall" is commonly used.This setting defines the value of BSP_CFLAGS_WARNINGS in Makefile. - none - false - none - - - hal.make.bsp_arflags - BSP_ARFLAGS - UnquotedString - -src - -src - makefile_variable - Custom flags only passed to the archiver. This content of this variable is directly passed to the archiver rather than the more standard "ARFLAGS". The reason for this is that GNU Make assumes some default content in ARFLAGS. This setting defines the value of BSP_ARFLAGS in Makefile. - none - false - none - - - hal.make.bsp_cflags_optimization - BSP_CFLAGS_OPTIMIZATION - UnquotedString - -O0 - -O0 - makefile_variable - C/C++ compiler optimization level. "-O0" = no optimization,"-O2" = "normal" optimization, etc. "-O0" is recommended for code that you want to debug since compiler optimization can remove variables and produce non-sequential execution of code while debugging. This setting defines the value of BSP_CFLAGS_OPTIMIZATION in Makefile. - none - false - common - - - hal.make.as_post_process - AS_POST_PROCESS - UnquotedString - none - none - makefile_variable - Command executed after each assembly file is compiled. - none - false - none - - - hal.make.cc_pre_process - CC_PRE_PROCESS - UnquotedString - none - none - makefile_variable - Command executed before each .c/.S file is compiled. - none - false - none - - - hal.make.bsp_asflags - BSP_ASFLAGS - UnquotedString - -Wa,-gdwarf2 - -Wa,-gdwarf2 - makefile_variable - Custom flags only passed to the assembler. This setting defines the value of BSP_ASFLAGS in Makefile. - none - false - none - - - hal.make.as_pre_process - AS_PRE_PROCESS - UnquotedString - none - none - makefile_variable - Command executed before each assembly file is compiled. - none - false - none - - - hal.make.bsp_cflags_undefined_symbols - BSP_CFLAGS_UNDEFINED_SYMBOLS - UnquotedString - none - none - makefile_variable - Preprocessor macros to undefine. Undefined macros are similar to defined macros, but replicate the "#undef" directive in source code. To undefine the macro FOO use the syntax "-u FOO" in this setting. This is equivalent to "#undef FOO" in a source file. Note: the syntax differs from macro definition (there is a space, i.e. "-u FOO" versus "-DFOO"). Macros defined with this setting are applied to all .S, .c, and C++ files in the BSP. This setting defines the value of BSP_CFLAGS_UNDEFINED_SYMBOLS in the BSP Makefile. - none - false - none - - - hal.make.cc_post_process - CC_POST_PROCESS - UnquotedString - none - none - makefile_variable - Command executed after each .c/.S file is compiled. - none - false - none - - - hal.make.cxx_post_process - CXX_POST_PROCESS - UnquotedString - none - none - makefile_variable - Command executed before each C++ file is compiled. - none - false - none - - - hal.make.cc - CC - UnquotedString - nios2-elf-gcc -xc - nios2-elf-gcc -xc - makefile_variable - C compiler command. - none - false - none - - - hal.make.bsp_cxx_flags - BSP_CXXFLAGS - UnquotedString - none - none - makefile_variable - Custom flags only passed to the C++ compiler. This setting defines the value of BSP_CXXFLAGS in Makefile. - none - false - none - - - hal.make.bsp_inc_dirs - BSP_INC_DIRS - UnquotedString - none - none - makefile_variable - Space separated list of extra include directories to scan for header files. Directories are relative to the top-level BSP directory. The -I prefix's added by the makefile so don't add it here. This setting defines the value of BSP_INC_DIRS in Makefile. - none - false - none - - - hal.make.cxx - CXX - UnquotedString - nios2-elf-gcc -xc++ - nios2-elf-gcc -xc++ - makefile_variable - C++ compiler command. - none - false - none - - - hal.make.bsp_cflags_user_flags - BSP_CFLAGS_USER_FLAGS - UnquotedString - none - none - makefile_variable - Custom flags passed to the compiler when compiling C, C++, and .S files. This setting defines the value of BSP_CFLAGS_USER_FLAGS in Makefile. - none - false - none - - - hal.make.ignore_system_derived.sopc_system_id - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query SOPC system for system ID. If true ignores export of 'SOPC_SYSID_FLAG += --id=<sysid>' and 'ELF_PATCH_FLAG += --id=<sysid>' to public.mk. - none - false - none - - - hal.make.ignore_system_derived.sopc_system_timestamp - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query SOPC system for system timestamp. If true ignores export of 'SOPC_SYSID_FLAG += --timestamp=<timestamp>' and 'ELF_PATCH_FLAG += --timestamp=<timestamp>' to public.mk. - none - false - none - - - hal.make.ignore_system_derived.sopc_system_base_address - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query SOPC system for system ID base address. If true ignores export of 'SOPC_SYSID_FLAG += --sidp=<address>' and 'ELF_PATCH_FLAG += --sidp=<address>' to public.mk. - none - false - none - - - hal.make.ignore_system_derived.sopc_simulation_enabled - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system has simulation enabled. If true ignores export of 'ELF_PATCH_FLAG += --simulation_enabled' to public.mk. - none - false - none - - - hal.make.ignore_system_derived.fpu_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system has FPU present. If true ignores export of 'ALT_CFLAGS += -mhard-float' to public.mk if FPU is found in the system. If true ignores export of 'ALT_CFLAGS += -mhard-soft' if FPU is not found in the system. - none - false - none - - - hal.make.ignore_system_derived.hardware_multiplier_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system has multiplier present. If true ignores export of 'ALT_CFLAGS += -mno-hw-mul' to public.mk if no multiplier is found in the system. If true ignores export of 'ALT_CFLAGS += -mhw-mul' if multiplier is found in the system. - none - false - none - - - hal.make.ignore_system_derived.hardware_mulx_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system has hardware mulx present. If true ignores export of 'ALT_CFLAGS += -mno-hw-mulx' to public.mk if no mulx is found in the system. If true ignores export of 'ALT_CFLAGS += -mhw-mulx' if mulx is found in the system. - none - false - none - - - hal.make.ignore_system_derived.hardware_divide_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system has hardware divide present. If true ignores export of 'ALT_CFLAGS += -mno-hw-div' to public.mk if no division is found in system. If true ignores export of 'ALT_CFLAGS += -mhw-div' if division is found in the system. - none - false - none - - - hal.make.ignore_system_derived.debug_core_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system has a debug core present. If true ignores export of 'CPU_HAS_DEBUG_CORE = 1' to public.mk if a debug core is found in the system. If true ignores export of 'CPU_HAS_DEBUG_CORE = 0' if no debug core is found in the system. - none - false - none - - - hal.make.ignore_system_derived.big_endian - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system is big endian. If true ignores export of 'ALT_CFLAGS += -EB' to public.mk if big endian system. If true ignores export of 'ALT_CFLAGS += -EL' if little endian system. - none - false - none - - - hal.make.ignore_system_derived.hardware_fp_cust_inst_divider_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system floating point custom instruction with a divider is present. If true ignores export of 'ALT_CFLAGS += -mcustom-fpu-cfg=60-2' and 'ALT_LDFLAGS += -mcustom-fpu-cfg=60-2' to public.mk if the custom instruction is found in the system. - none - false - none - - - hal.make.ignore_system_derived.hardware_fp_cust_inst_no_divider_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system floating point custom instruction without a divider is present. If true ignores export of 'ALT_CFLAGS += -mcustom-fpu-cfg=60-1' and 'ALT_LDFLAGS += -mcustom-fpu-cfg=60-1' to public.mk if the custom instruction is found in the system. - none - false - none - - - hal.enable_exit - ALT_NO_EXIT - Boolean - 1 - 1 - public_mk_define - Add exit() support. This option increases code footprint if your "main()" routine does "return" or call "exit()". If false, adds -DALT_NO_EXIT to ALT_CPPFLAGS in public.mk, and reduces footprint - none - false - none - - - hal.enable_small_c_library - NONE - Boolean - 0 - 0 - public_mk_define - Causes the small newlib (C library) to be used. This reduces code and data footprint at the expense of reduced functionality. Several newlib features are removed such as floating-point support in printf(), stdin input routines, and buffered I/O. The small C library is not compatible with Micrium MicroC/OS-II. If true, adds -msmallc to ALT_LDFLAGS in public.mk. - none - false - common - - - hal.enable_clean_exit - ALT_NO_CLEAN_EXIT - Boolean - 1 - 1 - public_mk_define - When your application exits, close file descriptors, call C++ destructors, etc. Code footprint can be reduced by disabling clean exit. If disabled, adds -DALT_NO_CLEAN_EXIT to ALT_CPPFLAGS and -Wl,--defsym, exit=_exit to ALT_LDFLAGS in public.mk. - none - false - none - - - hal.enable_runtime_stack_checking - ALT_STACK_CHECK - Boolean - 0 - 0 - public_mk_define - Turns on HAL runtime stack checking feature. Enabling this setting causes additional code to be placed into each subroutine call to generate an exception if a stack collision occurs with the heap or statically allocated data. If true, adds -DALT_STACK_CHECK and -mstack-check to ALT_CPPFLAGS in public.mk. - none - false - none - - - hal.enable_gprof - ALT_PROVIDE_GMON - Boolean - 0 - 0 - public_mk_define - Causes code to be compiled with gprof profiling enabled and the application ELF to be linked with the GPROF library. If true, adds -DALT_PROVIDE_GMON to ALT_CPPFLAGS and -pg to ALT_CFLAGS in public.mk. - none - false - common - - - hal.enable_c_plus_plus - ALT_NO_C_PLUS_PLUS - Boolean - 1 - 1 - public_mk_define - Enable support for a subset of the C++ language. This option increases code footprint by adding support for C++ constructors. Certain features, such as multiple inheritance and exceptions are not supported. If false, adds -DALT_NO_C_PLUS_PLUS to ALT_CPPFLAGS in public.mk, and reduces code footprint. - none - false - none - - - hal.enable_reduced_device_drivers - ALT_USE_SMALL_DRIVERS - Boolean - 0 - 0 - public_mk_define - Certain drivers are compiled with reduced functionality to reduce code footprint. Not all drivers observe this setting. The altera_avalon_uart and altera_avalon_jtag_uart drivers switch from interrupt-driven to polled operation. CAUTION: Several device drivers are disabled entirely. These include the altera_avalon_cfi_flash, altera_avalon_epcs_flash_controller, and altera_avalon_lcd_16207 drivers. This can result in certain API (HAL flash access routines) to fail. You can define a symbol provided by each driver to prevent it from being removed. If true, adds -DALT_USE_SMALL_DRIVERS to ALT_CPPFLAGS in public.mk. - none - false - common - - - hal.enable_lightweight_device_driver_api - ALT_USE_DIRECT_DRIVERS - Boolean - 0 - 0 - public_mk_define - Enables lightweight device driver API. This reduces code and data footprint by removing the HAL layer that maps device names (e.g. /dev/uart0) to file descriptors. Instead, driver routines are called directly. The open(), close(), and lseek() routines will always fail if called. The read(), write(), fstat(), ioctl(), and isatty() routines only work for the stdio devices. If true, adds -DALT_USE_DIRECT_DRIVERS to ALT_CPPFLAGS in public.mk. - The Altera Host and read-only ZIP file systems can't be used if hal.enable_lightweight_device_driver_api is true. - false - none - - - hal.enable_mul_div_emulation - ALT_NO_INSTRUCTION_EMULATION - Boolean - 0 - 0 - public_mk_define - Adds code to emulate multiply and divide instructions in case they are executed but aren't present in the CPU. Normally this isn't required because the compiler won't use multiply and divide instructions that aren't present in the CPU. If false, adds -DALT_NO_INSTRUCTION_EMULATION to ALT_CPPFLAGS in public.mk. - none - false - none - - - hal.enable_sim_optimize - ALT_SIM_OPTIMIZE - Boolean - 0 - 0 - public_mk_define - The BSP is compiled with optimizations to speedup HDL simulation such as initializing the cache, clearing the .bss section, and skipping long delay loops. If true, adds -DALT_SIM_OPTIMIZE to ALT_CPPFLAGS in public.mk. - When this setting is true, the BSP shouldn't be used to build applications that are expected to run real hardware. - false - common - - - hal.enable_sopc_sysid_check - NONE - Boolean - 1 - 1 - public_mk_define - Enable SOPC Builder System ID. If a System ID SOPC Builder component is connected to the CPU associated with this BSP, it will be enabled in the creation of command-line arguments to download an ELF to the target. Otherwise, system ID and timestamp values are left out of public.mk for application Makefile "download-elf" target definition. With the system ID check disabled, the Nios II EDS tools will not automatically ensure that the application .elf file (and BSP it is linked against) corresponds to the hardware design on the target. If false, adds --accept-bad-sysid to SOPC_SYSID_FLAG in public.mk. - none - false - none - - - hal.custom_newlib_flags - CUSTOM_NEWLIB_FLAGS - UnquotedString - none - none - public_mk_define - Build a custom version of newlib with the specified space-separated compiler flags. - The custom newlib build will be placed in the &lt;bsp root>/newlib directory, and will be used only for applications that utilize this BSP. - false - none - - - hal.log_flags - ALT_LOG_FLAGS - DecimalNumber - 0 - 0 - public_mk_define - The value is assigned to ALT_LOG_FLAGS in the generated public.mk. See hal.log_port setting description. Values can be -1 through 3. - hal.log_port must be set for this to be used. - false - none - - - altera_avalon_jtag_uart_driver.enable_small_driver - ALTERA_AVALON_JTAG_UART_SMALL - BooleanDefineOnly - false - false - public_mk_define - Small-footprint (polled mode) driver - none - false - - - - altera_avalon_jtag_uart_driver.enable_jtag_uart_ignore_fifo_full_error - ALTERA_AVALON_JTAG_UART_IGNORE_FIFO_FULL_ERROR - BooleanDefineOnly - false - false - public_mk_define - Enable JTAG UART driver to recover when host is inactive causing buffer to full without returning error. Printf will not fail with this recovery. - none - false - - - - onchip_memory - 0x00000000 - 0x00031FFF - 204800 - memory - - - lcd_on - 0x00041010 - 0x0004101F - 16 - - - - lcd_blon - 0x00041020 - 0x0004102F - 16 - - - - lcd_16207_0 - 0x00041030 - 0x0004103F - 16 - printable - - - hex7 - 0x00041040 - 0x0004104F - 16 - - - - hex6 - 0x00041050 - 0x0004105F - 16 - - - - hex5 - 0x00041060 - 0x0004106F - 16 - - - - hex4 - 0x00041070 - 0x0004107F - 16 - - - - hex3 - 0x00041080 - 0x0004108F - 16 - - - - hex2 - 0x00041090 - 0x0004109F - 16 - - - - hex1 - 0x000410A0 - 0x000410AF - 16 - - - - hex0 - 0x000410B0 - 0x000410BF - 16 - - - - push_switches - 0x000410C0 - 0x000410CF - 16 - - - - switches - 0x000410D0 - 0x000410DF - 16 - - - - LEDRs - 0x000410E0 - 0x000410EF - 16 - - - - LEDs - 0x000410F0 - 0x000410FF - 16 - - - - jtag_uart - 0x00041100 - 0x00041107 - 8 - printable - - - .text - onchip_memory - - - .rodata - onchip_memory - - - .rwdata - onchip_memory - - - .bss - onchip_memory - - - .heap - onchip_memory - - - .stack - onchip_memory - - \ No newline at end of file diff --git a/software/qsys_tutorial_lcd3_bsp/summary.html b/software/qsys_tutorial_lcd3_bsp/summary.html deleted file mode 100644 index ef2ea68..0000000 --- a/software/qsys_tutorial_lcd3_bsp/summary.html +++ /dev/null @@ -1,2047 +0,0 @@ - -Altera Nios II BSP Summary - -

BSP Description

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
BSP Type:hal
SOPC Design File:C:\Users\takayun\Documents\DE2-115\qsys_tutorial\nios_system.sopcinfo
Quartus JDI File:default
CPU:nios2_processor
BSP Settings File:.\settings.bsp
BSP Version:default
BSP Generated On:2016/12/02 1:06:41
BSP Generated Timestamp:1480608401552
BSP Generated Location:C:\Users\takayun\Documents\DE2-115\qsys_tutorial\software\qsys_tutorial_lcd3_bsp
-
-

Nios II Memory Map

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Slave DescriptorAddress RangeSizeAttributes
jtag_uart0x00041100 - 0x000411078printable
LEDs0x000410F0 - 0x000410FF16 
LEDRs0x000410E0 - 0x000410EF16 
switches0x000410D0 - 0x000410DF16 
push_switches0x000410C0 - 0x000410CF16 
hex00x000410B0 - 0x000410BF16 
hex10x000410A0 - 0x000410AF16 
hex20x00041090 - 0x0004109F16 
hex30x00041080 - 0x0004108F16 
hex40x00041070 - 0x0004107F16 
hex50x00041060 - 0x0004106F16 
hex60x00041050 - 0x0004105F16 
hex70x00041040 - 0x0004104F16 
lcd_16207_00x00041030 - 0x0004103F16printable
lcd_blon0x00041020 - 0x0004102F16 
lcd_on0x00041010 - 0x0004101F16 
onchip_memory0x00000000 - 0x00031FFF204800memory
-
-
-

Linker Regions

- - - - -
RegionAddress RangeSizeMemoryOffset
-
-
-

Linker Section Mappings

- - - - - - - - - - - - - - - - - - - - - - -
SectionRegion
.textonchip_memory
.rodataonchip_memory
.rwdataonchip_memory
.bssonchip_memory
.heaponchip_memory
.stackonchip_memory
-

Settings

- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:altera_avalon_jtag_uart_driver.enable_jtag_uart_ignore_fifo_full_error
Identifier:ALTERA_AVALON_JTAG_UART_IGNORE_FIFO_FULL_ERROR
Default Value:false
Value:false
Type:BooleanDefineOnly
Destination:public_mk_define
Description:Enable JTAG UART driver to recover when host is inactive causing buffer to full without returning error. Printf will not fail with this recovery.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:altera_avalon_jtag_uart_driver.enable_small_driver
Identifier:ALTERA_AVALON_JTAG_UART_SMALL
Default Value:false
Value:false
Type:BooleanDefineOnly
Destination:public_mk_define
Description:Small-footprint (polled mode) driver
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.custom_newlib_flags
Identifier:CUSTOM_NEWLIB_FLAGS
Default Value:none
Value:none
Type:UnquotedString
Destination:public_mk_define
Description:Build a custom version of newlib with the specified space-separated compiler flags.
Restrictions:The custom newlib build will be placed in the &lt;bsp root>/newlib directory, and will be used only for applications that utilize this BSP.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_c_plus_plus
Identifier:ALT_NO_C_PLUS_PLUS
Default Value:1
Value:1
Type:Boolean
Destination:public_mk_define
Description:Enable support for a subset of the C++ language. This option increases code footprint by adding support for C++ constructors. Certain features, such as multiple inheritance and exceptions are not supported. If false, adds -DALT_NO_C_PLUS_PLUS to ALT_CPPFLAGS in public.mk, and reduces code footprint.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_clean_exit
Identifier:ALT_NO_CLEAN_EXIT
Default Value:1
Value:1
Type:Boolean
Destination:public_mk_define
Description:When your application exits, close file descriptors, call C++ destructors, etc. Code footprint can be reduced by disabling clean exit. If disabled, adds -DALT_NO_CLEAN_EXIT to ALT_CPPFLAGS and -Wl,--defsym, exit=_exit to ALT_LDFLAGS in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_exit
Identifier:ALT_NO_EXIT
Default Value:1
Value:1
Type:Boolean
Destination:public_mk_define
Description:Add exit() support. This option increases code footprint if your "main()" routine does "return" or call "exit()". If false, adds -DALT_NO_EXIT to ALT_CPPFLAGS in public.mk, and reduces footprint
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_gprof
Identifier:ALT_PROVIDE_GMON
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Causes code to be compiled with gprof profiling enabled and the application ELF to be linked with the GPROF library. If true, adds -DALT_PROVIDE_GMON to ALT_CPPFLAGS and -pg to ALT_CFLAGS in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_instruction_related_exceptions_api
Identifier:ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API
Default Value:false
Value:false
Type:BooleanDefineOnly
Destination:system_h_define
Description:Enables API for registering handlers to service instruction-related exceptions. Enabling this setting increases the size of the exception entry code.
Restrictions:These exception types can be generated if various processor options are enabled, such as the MMU, MPU, or other advanced exception types.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_lightweight_device_driver_api
Identifier:ALT_USE_DIRECT_DRIVERS
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enables lightweight device driver API. This reduces code and data footprint by removing the HAL layer that maps device names (e.g. /dev/uart0) to file descriptors. Instead, driver routines are called directly. The open(), close(), and lseek() routines will always fail if called. The read(), write(), fstat(), ioctl(), and isatty() routines only work for the stdio devices. If true, adds -DALT_USE_DIRECT_DRIVERS to ALT_CPPFLAGS in public.mk.
Restrictions:The Altera Host and read-only ZIP file systems can't be used if hal.enable_lightweight_device_driver_api is true.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_mul_div_emulation
Identifier:ALT_NO_INSTRUCTION_EMULATION
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Adds code to emulate multiply and divide instructions in case they are executed but aren't present in the CPU. Normally this isn't required because the compiler won't use multiply and divide instructions that aren't present in the CPU. If false, adds -DALT_NO_INSTRUCTION_EMULATION to ALT_CPPFLAGS in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_reduced_device_drivers
Identifier:ALT_USE_SMALL_DRIVERS
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Certain drivers are compiled with reduced functionality to reduce code footprint. Not all drivers observe this setting. The altera_avalon_uart and altera_avalon_jtag_uart drivers switch from interrupt-driven to polled operation. CAUTION: Several device drivers are disabled entirely. These include the altera_avalon_cfi_flash, altera_avalon_epcs_flash_controller, and altera_avalon_lcd_16207 drivers. This can result in certain API (HAL flash access routines) to fail. You can define a symbol provided by each driver to prevent it from being removed. If true, adds -DALT_USE_SMALL_DRIVERS to ALT_CPPFLAGS in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_runtime_stack_checking
Identifier:ALT_STACK_CHECK
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Turns on HAL runtime stack checking feature. Enabling this setting causes additional code to be placed into each subroutine call to generate an exception if a stack collision occurs with the heap or statically allocated data. If true, adds -DALT_STACK_CHECK and -mstack-check to ALT_CPPFLAGS in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_sim_optimize
Identifier:ALT_SIM_OPTIMIZE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:The BSP is compiled with optimizations to speedup HDL simulation such as initializing the cache, clearing the .bss section, and skipping long delay loops. If true, adds -DALT_SIM_OPTIMIZE to ALT_CPPFLAGS in public.mk.
Restrictions:When this setting is true, the BSP shouldn't be used to build applications that are expected to run real hardware.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_small_c_library
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Causes the small newlib (C library) to be used. This reduces code and data footprint at the expense of reduced functionality. Several newlib features are removed such as floating-point support in printf(), stdin input routines, and buffered I/O. The small C library is not compatible with Micrium MicroC/OS-II. If true, adds -msmallc to ALT_LDFLAGS in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_sopc_sysid_check
Identifier:NONE
Default Value:1
Value:1
Type:Boolean
Destination:public_mk_define
Description:Enable SOPC Builder System ID. If a System ID SOPC Builder component is connected to the CPU associated with this BSP, it will be enabled in the creation of command-line arguments to download an ELF to the target. Otherwise, system ID and timestamp values are left out of public.mk for application Makefile "download-elf" target definition. With the system ID check disabled, the Nios II EDS tools will not automatically ensure that the application .elf file (and BSP it is linked against) corresponds to the hardware design on the target. If false, adds --accept-bad-sysid to SOPC_SYSID_FLAG in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.allow_code_at_reset
Identifier:ALT_ALLOW_CODE_AT_RESET
Default Value:0
Value:1
Type:Boolean
Destination:none
Description:Indicates if initialization code is allowed at the reset address. If true, defines the macro ALT_ALLOW_CODE_AT_RESET in linker.h.
Restrictions:If true, defines the macro ALT_ALLOW_CODE_AT_RESET in linker.h. This setting is typically false if an external bootloader (e.g. flash bootloader) is present.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.enable_alt_load
Identifier:NONE
Default Value:0
Value:1
Type:Boolean
Destination:none
Description:Enables the alt_load() facility. The alt_load() facility copies sections from the .text memory into RAM. If true, this setting sets up the VMA/LMA of sections in linker.x to allow them to be loaded into the .text memory.
Restrictions:This setting is typically false if an external bootloader (e.g. flash bootloader) is present.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.enable_alt_load_copy_exceptions
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:none
Description:Causes the alt_load() facility to copy the .exceptions section. If true, this setting defines the macro ALT_LOAD_COPY_EXCEPTIONS in linker.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.enable_alt_load_copy_rodata
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:none
Description:Causes the alt_load() facility to copy the .rodata section. If true, this setting defines the macro ALT_LOAD_COPY_RODATA in linker.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.enable_alt_load_copy_rwdata
Identifier:NONE
Default Value:0
Value:1
Type:Boolean
Destination:none
Description:Causes the alt_load() facility to copy the .rwdata section. If true, this setting defines the macro ALT_LOAD_COPY_RWDATA in linker.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.enable_exception_stack
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:none
Description:Enables use of a separate exception stack. If true, defines the macro ALT_EXCEPTION_STACK in linker.h, adds a memory region called exception_stack to linker.x, and provides the symbols __alt_exception_stack_pointer and __alt_exception_stack_limit in linker.x.
Restrictions:The hal.linker.exception_stack_size and hal.linker.exception_stack_memory_region_name settings must also be valid. This setting must be false for MicroC/OS-II BSPs. The exception stack can be used to improve interrupt and other exception performance if the EIC is *not* used.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.enable_interrupt_stack
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:none
Description:Enables use of a separate interrupt stack. If true, defines the macro ALT_INTERRUPT_STACK in linker.h, adds a memory region called interrupt_stack to linker.x, and provides the symbols __alt_interrupt_stack_pointer and __alt_interrupt_stack_limit in linker.x.
Restrictions:The hal.linker.interrupt_stack_size and hal.linker.interrupt_stack_memory_region_name settings must also be valid. This setting must be false for MicroC/OS-II BSPs. Only enable if the EIC is used exclusively. The exception stack can be used to improve interrupt and other exception performance if the EIC is *not* used.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.exception_stack_memory_region_name
Identifier:NONE
Default Value:none
Value:onchip_memory
Type:UnquotedString
Destination:none
Description:Name of the existing memory region that will be divided up to create the 'exception_stack' memory region. The selected region name will be adjusted automatically when the BSP is generated to create the 'exception_stack' memory region.
Restrictions:Only used if hal.linker.enable_exception_stack is true.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.exception_stack_size
Identifier:NONE
Default Value:1024
Value:1024
Type:DecimalNumber
Destination:none
Description:Size of the exception stack in bytes.
Restrictions:Only used if hal.linker.enable_exception_stack is true.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.interrupt_stack_memory_region_name
Identifier:NONE
Default Value:none
Value:onchip_memory
Type:UnquotedString
Destination:none
Description:Name of the existing memory region that will be divided up to create the 'interrupt_stack' memory region. The selected region name will be adjusted automatically when the BSP is generated to create the 'interrupt_stack' memory region.
Restrictions:Only used if hal.linker.enable_interrupt_stack is true.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.interrupt_stack_size
Identifier:NONE
Default Value:1024
Value:1024
Type:DecimalNumber
Destination:none
Description:Size of the interrupt stack in bytes.
Restrictions:Only used if hal.linker.enable_interrupt_stack is true.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.log_flags
Identifier:ALT_LOG_FLAGS
Default Value:0
Value:0
Type:DecimalNumber
Destination:public_mk_define
Description:The value is assigned to ALT_LOG_FLAGS in the generated public.mk. See hal.log_port setting description. Values can be -1 through 3.
Restrictions:hal.log_port must be set for this to be used.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.log_port
Identifier:NONE
Default Value:none
Value:none
Type:UnquotedString
Destination:public_mk_define
Description:Slave descriptor of debug logging character-mode device. If defined, it enables extra debug messages in the HAL source. This setting is used by the ALT_LOG_PORT family of defines in system.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ar
Identifier:AR
Default Value:nios2-elf-ar
Value:nios2-elf-ar
Type:UnquotedString
Destination:makefile_variable
Description:Archiver command. Creates library files.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ar_post_process
Identifier:AR_POST_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed after archiver execution.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ar_pre_process
Identifier:AR_PRE_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed before archiver execution.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.as
Identifier:AS
Default Value:nios2-elf-gcc
Value:nios2-elf-gcc
Type:UnquotedString
Destination:makefile_variable
Description:Assembler command. Note that CC is used for .S files.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.as_post_process
Identifier:AS_POST_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed after each assembly file is compiled.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.as_pre_process
Identifier:AS_PRE_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed before each assembly file is compiled.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_arflags
Identifier:BSP_ARFLAGS
Default Value:-src
Value:-src
Type:UnquotedString
Destination:makefile_variable
Description:Custom flags only passed to the archiver. This content of this variable is directly passed to the archiver rather than the more standard "ARFLAGS". The reason for this is that GNU Make assumes some default content in ARFLAGS. This setting defines the value of BSP_ARFLAGS in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_asflags
Identifier:BSP_ASFLAGS
Default Value:-Wa,-gdwarf2
Value:-Wa,-gdwarf2
Type:UnquotedString
Destination:makefile_variable
Description:Custom flags only passed to the assembler. This setting defines the value of BSP_ASFLAGS in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cflags_debug
Identifier:BSP_CFLAGS_DEBUG
Default Value:-g
Value:-g
Type:UnquotedString
Destination:makefile_variable
Description:C/C++ compiler debug level. '-g' provides the default set of debug symbols typically required to debug a typical application. Omitting '-g' removes debug symbols from the ELF. This setting defines the value of BSP_CFLAGS_DEBUG in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cflags_defined_symbols
Identifier:BSP_CFLAGS_DEFINED_SYMBOLS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Preprocessor macros to define. A macro definition in this setting has the same effect as a "#define" in source code. Adding "-DALT_DEBUG" to this setting has the same effect as "#define ALT_DEBUG" in a souce file. Adding "-DFOO=1" to this setting is equivalent to the macro "#define FOO 1" in a source file. Macros defined with this setting are applied to all .S, .c, and C++ files in the BSP. This setting defines the value of BSP_CFLAGS_DEFINED_SYMBOLS in the BSP Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cflags_optimization
Identifier:BSP_CFLAGS_OPTIMIZATION
Default Value:-O0
Value:-O0
Type:UnquotedString
Destination:makefile_variable
Description:C/C++ compiler optimization level. "-O0" = no optimization,"-O2" = "normal" optimization, etc. "-O0" is recommended for code that you want to debug since compiler optimization can remove variables and produce non-sequential execution of code while debugging. This setting defines the value of BSP_CFLAGS_OPTIMIZATION in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cflags_undefined_symbols
Identifier:BSP_CFLAGS_UNDEFINED_SYMBOLS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Preprocessor macros to undefine. Undefined macros are similar to defined macros, but replicate the "#undef" directive in source code. To undefine the macro FOO use the syntax "-u FOO" in this setting. This is equivalent to "#undef FOO" in a source file. Note: the syntax differs from macro definition (there is a space, i.e. "-u FOO" versus "-DFOO"). Macros defined with this setting are applied to all .S, .c, and C++ files in the BSP. This setting defines the value of BSP_CFLAGS_UNDEFINED_SYMBOLS in the BSP Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cflags_user_flags
Identifier:BSP_CFLAGS_USER_FLAGS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Custom flags passed to the compiler when compiling C, C++, and .S files. This setting defines the value of BSP_CFLAGS_USER_FLAGS in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cflags_warnings
Identifier:BSP_CFLAGS_WARNINGS
Default Value:-Wall
Value:-Wall
Type:UnquotedString
Destination:makefile_variable
Description:C/C++ compiler warning level. "-Wall" is commonly used.This setting defines the value of BSP_CFLAGS_WARNINGS in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cxx_flags
Identifier:BSP_CXXFLAGS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Custom flags only passed to the C++ compiler. This setting defines the value of BSP_CXXFLAGS in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_inc_dirs
Identifier:BSP_INC_DIRS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Space separated list of extra include directories to scan for header files. Directories are relative to the top-level BSP directory. The -I prefix's added by the makefile so don't add it here. This setting defines the value of BSP_INC_DIRS in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.build_post_process
Identifier:BUILD_POST_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed after BSP built.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.build_pre_process
Identifier:BUILD_PRE_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed before BSP built.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.cc
Identifier:CC
Default Value:nios2-elf-gcc -xc
Value:nios2-elf-gcc -xc
Type:UnquotedString
Destination:makefile_variable
Description:C compiler command.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.cc_post_process
Identifier:CC_POST_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed after each .c/.S file is compiled.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.cc_pre_process
Identifier:CC_PRE_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed before each .c/.S file is compiled.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.cxx
Identifier:CXX
Default Value:nios2-elf-gcc -xc++
Value:nios2-elf-gcc -xc++
Type:UnquotedString
Destination:makefile_variable
Description:C++ compiler command.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.cxx_post_process
Identifier:CXX_POST_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed before each C++ file is compiled.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.cxx_pre_process
Identifier:CXX_PRE_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed before each C++ file is compiled.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.big_endian
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system is big endian. If true ignores export of 'ALT_CFLAGS += -EB' to public.mk if big endian system. If true ignores export of 'ALT_CFLAGS += -EL' if little endian system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.debug_core_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system has a debug core present. If true ignores export of 'CPU_HAS_DEBUG_CORE = 1' to public.mk if a debug core is found in the system. If true ignores export of 'CPU_HAS_DEBUG_CORE = 0' if no debug core is found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.fpu_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system has FPU present. If true ignores export of 'ALT_CFLAGS += -mhard-float' to public.mk if FPU is found in the system. If true ignores export of 'ALT_CFLAGS += -mhard-soft' if FPU is not found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.hardware_divide_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system has hardware divide present. If true ignores export of 'ALT_CFLAGS += -mno-hw-div' to public.mk if no division is found in system. If true ignores export of 'ALT_CFLAGS += -mhw-div' if division is found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.hardware_fp_cust_inst_divider_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system floating point custom instruction with a divider is present. If true ignores export of 'ALT_CFLAGS += -mcustom-fpu-cfg=60-2' and 'ALT_LDFLAGS += -mcustom-fpu-cfg=60-2' to public.mk if the custom instruction is found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.hardware_fp_cust_inst_no_divider_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system floating point custom instruction without a divider is present. If true ignores export of 'ALT_CFLAGS += -mcustom-fpu-cfg=60-1' and 'ALT_LDFLAGS += -mcustom-fpu-cfg=60-1' to public.mk if the custom instruction is found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.hardware_multiplier_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system has multiplier present. If true ignores export of 'ALT_CFLAGS += -mno-hw-mul' to public.mk if no multiplier is found in the system. If true ignores export of 'ALT_CFLAGS += -mhw-mul' if multiplier is found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.hardware_mulx_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system has hardware mulx present. If true ignores export of 'ALT_CFLAGS += -mno-hw-mulx' to public.mk if no mulx is found in the system. If true ignores export of 'ALT_CFLAGS += -mhw-mulx' if mulx is found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.sopc_simulation_enabled
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system has simulation enabled. If true ignores export of 'ELF_PATCH_FLAG += --simulation_enabled' to public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.sopc_system_base_address
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query SOPC system for system ID base address. If true ignores export of 'SOPC_SYSID_FLAG += --sidp=<address>' and 'ELF_PATCH_FLAG += --sidp=<address>' to public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.sopc_system_id
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query SOPC system for system ID. If true ignores export of 'SOPC_SYSID_FLAG += --id=<sysid>' and 'ELF_PATCH_FLAG += --id=<sysid>' to public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.sopc_system_timestamp
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query SOPC system for system timestamp. If true ignores export of 'SOPC_SYSID_FLAG += --timestamp=<timestamp>' and 'ELF_PATCH_FLAG += --timestamp=<timestamp>' to public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.rm
Identifier:RM
Default Value:rm -f
Value:rm -f
Type:UnquotedString
Destination:makefile_variable
Description:Command used to remove files during 'clean' target.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.max_file_descriptors
Identifier:ALT_MAX_FD
Default Value:32
Value:32
Type:DecimalNumber
Destination:system_h_define
Description:Determines the number of file descriptors statically allocated. This setting defines the value of ALT_MAX_FD in system.h.
Restrictions:If hal.enable_lightweight_device_driver_api is true, there are no file descriptors so this setting is ignored. If hal.enable_lightweight_device_driver_api is false, this setting must be at least 4 because HAL needs a file descriptor for /dev/null, /dev/stdin, /dev/stdout, and /dev/stderr.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.stderr
Identifier:NONE
Default Value:none
Value:jtag_uart
Type:UnquotedString
Destination:system_h_define
Description:Slave descriptor of STDERR character-mode device. This setting is used by the ALT_STDERR family of defines in system.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.stdin
Identifier:NONE
Default Value:none
Value:jtag_uart
Type:UnquotedString
Destination:system_h_define
Description:Slave descriptor of STDIN character-mode device. This setting is used by the ALT_STDIN family of defines in system.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.stdout
Identifier:NONE
Default Value:none
Value:jtag_uart
Type:UnquotedString
Destination:system_h_define
Description:Slave descriptor of STDOUT character-mode device. This setting is used by the ALT_STDOUT family of defines in system.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.sys_clk_timer
Identifier:ALT_SYS_CLK
Default Value:none
Value:none
Type:UnquotedString
Destination:system_h_define
Description:Slave descriptor of the system clock timer device. This device provides a periodic interrupt ("tick") and is typically required for RTOS use. This setting defines the value of ALT_SYS_CLK in system.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.timestamp_timer
Identifier:ALT_TIMESTAMP_CLK
Default Value:none
Value:none
Type:UnquotedString
Destination:system_h_define
Description:Slave descriptor of timestamp timer device. This device is used by Altera HAL timestamp drivers for high-resolution time measurement. This setting defines the value of ALT_TIMESTAMP_CLK in system.h.
Restrictions:none
-
-
-
- - diff --git a/software/qsys_tutorial_lcd3_bsp/system.h b/software/qsys_tutorial_lcd3_bsp/system.h deleted file mode 100644 index c6d28dc..0000000 --- a/software/qsys_tutorial_lcd3_bsp/system.h +++ /dev/null @@ -1,617 +0,0 @@ -/* - * system.h - SOPC Builder system and BSP software package information - * - * Machine generated for CPU 'nios2_processor' in SOPC Builder design 'nios_system' - * SOPC Builder design path: C:/Users/takayun/Documents/DE2-115/qsys_tutorial/nios_system.sopcinfo - * - * Generated: Fri Dec 02 01:06:42 JST 2016 - */ - -/* - * DO NOT MODIFY THIS FILE - * - * Changing this file will have subtle consequences - * which will almost certainly lead to a nonfunctioning - * system. If you do modify this file, be aware that your - * changes will be overwritten and lost when this file - * is generated again. - * - * DO NOT MODIFY THIS FILE - */ - -/* - * License Agreement - * - * Copyright (c) 2008 - * Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - * - * This agreement shall be governed in all respects by the laws of the State - * of California and by the laws of the United States of America. - */ - -#ifndef __SYSTEM_H_ -#define __SYSTEM_H_ - -/* Include definitions from linker script generator */ -#include "linker.h" - - -/* - * CPU configuration - * - */ - -#define ALT_CPU_ARCHITECTURE "altera_nios2_qsys" -#define ALT_CPU_BIG_ENDIAN 0 -#define ALT_CPU_BREAK_ADDR 0x40820 -#define ALT_CPU_CPU_FREQ 50000000u -#define ALT_CPU_CPU_ID_SIZE 1 -#define ALT_CPU_CPU_ID_VALUE 0x00000000 -#define ALT_CPU_CPU_IMPLEMENTATION "tiny" -#define ALT_CPU_DATA_ADDR_WIDTH 0x13 -#define ALT_CPU_DCACHE_LINE_SIZE 0 -#define ALT_CPU_DCACHE_LINE_SIZE_LOG2 0 -#define ALT_CPU_DCACHE_SIZE 0 -#define ALT_CPU_EXCEPTION_ADDR 0x20 -#define ALT_CPU_FLUSHDA_SUPPORTED -#define ALT_CPU_FREQ 50000000 -#define ALT_CPU_HARDWARE_DIVIDE_PRESENT 0 -#define ALT_CPU_HARDWARE_MULTIPLY_PRESENT 0 -#define ALT_CPU_HARDWARE_MULX_PRESENT 0 -#define ALT_CPU_HAS_DEBUG_CORE 1 -#define ALT_CPU_HAS_DEBUG_STUB -#define ALT_CPU_HAS_JMPI_INSTRUCTION -#define ALT_CPU_ICACHE_LINE_SIZE 0 -#define ALT_CPU_ICACHE_LINE_SIZE_LOG2 0 -#define ALT_CPU_ICACHE_SIZE 0 -#define ALT_CPU_INST_ADDR_WIDTH 0x13 -#define ALT_CPU_NAME "nios2_processor" -#define ALT_CPU_RESET_ADDR 0x0 - - -/* - * CPU configuration (with legacy prefix - don't use these anymore) - * - */ - -#define NIOS2_BIG_ENDIAN 0 -#define NIOS2_BREAK_ADDR 0x40820 -#define NIOS2_CPU_FREQ 50000000u -#define NIOS2_CPU_ID_SIZE 1 -#define NIOS2_CPU_ID_VALUE 0x00000000 -#define NIOS2_CPU_IMPLEMENTATION "tiny" -#define NIOS2_DATA_ADDR_WIDTH 0x13 -#define NIOS2_DCACHE_LINE_SIZE 0 -#define NIOS2_DCACHE_LINE_SIZE_LOG2 0 -#define NIOS2_DCACHE_SIZE 0 -#define NIOS2_EXCEPTION_ADDR 0x20 -#define NIOS2_FLUSHDA_SUPPORTED -#define NIOS2_HARDWARE_DIVIDE_PRESENT 0 -#define NIOS2_HARDWARE_MULTIPLY_PRESENT 0 -#define NIOS2_HARDWARE_MULX_PRESENT 0 -#define NIOS2_HAS_DEBUG_CORE 1 -#define NIOS2_HAS_DEBUG_STUB -#define NIOS2_HAS_JMPI_INSTRUCTION -#define NIOS2_ICACHE_LINE_SIZE 0 -#define NIOS2_ICACHE_LINE_SIZE_LOG2 0 -#define NIOS2_ICACHE_SIZE 0 -#define NIOS2_INST_ADDR_WIDTH 0x13 -#define NIOS2_RESET_ADDR 0x0 - - -/* - * Define for each module class mastered by the CPU - * - */ - -#define __ALTERA_AVALON_JTAG_UART -#define __ALTERA_AVALON_LCD_16207 -#define __ALTERA_AVALON_ONCHIP_MEMORY2 -#define __ALTERA_AVALON_PIO -#define __ALTERA_NIOS2_QSYS - - -/* - * LEDRs configuration - * - */ - -#define ALT_MODULE_CLASS_LEDRs altera_avalon_pio -#define LEDRS_BASE 0x410e0 -#define LEDRS_BIT_CLEARING_EDGE_REGISTER 0 -#define LEDRS_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define LEDRS_CAPTURE 0 -#define LEDRS_DATA_WIDTH 18 -#define LEDRS_DO_TEST_BENCH_WIRING 0 -#define LEDRS_DRIVEN_SIM_VALUE 0 -#define LEDRS_EDGE_TYPE "NONE" -#define LEDRS_FREQ 50000000 -#define LEDRS_HAS_IN 0 -#define LEDRS_HAS_OUT 1 -#define LEDRS_HAS_TRI 0 -#define LEDRS_IRQ -1 -#define LEDRS_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define LEDRS_IRQ_TYPE "NONE" -#define LEDRS_NAME "/dev/LEDRs" -#define LEDRS_RESET_VALUE 0 -#define LEDRS_SPAN 16 -#define LEDRS_TYPE "altera_avalon_pio" - - -/* - * LEDs configuration - * - */ - -#define ALT_MODULE_CLASS_LEDs altera_avalon_pio -#define LEDS_BASE 0x410f0 -#define LEDS_BIT_CLEARING_EDGE_REGISTER 0 -#define LEDS_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define LEDS_CAPTURE 0 -#define LEDS_DATA_WIDTH 8 -#define LEDS_DO_TEST_BENCH_WIRING 0 -#define LEDS_DRIVEN_SIM_VALUE 0 -#define LEDS_EDGE_TYPE "NONE" -#define LEDS_FREQ 50000000 -#define LEDS_HAS_IN 0 -#define LEDS_HAS_OUT 1 -#define LEDS_HAS_TRI 0 -#define LEDS_IRQ -1 -#define LEDS_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define LEDS_IRQ_TYPE "NONE" -#define LEDS_NAME "/dev/LEDs" -#define LEDS_RESET_VALUE 0 -#define LEDS_SPAN 16 -#define LEDS_TYPE "altera_avalon_pio" - - -/* - * System configuration - * - */ - -#define ALT_DEVICE_FAMILY "Cyclone IV E" -#define ALT_ENHANCED_INTERRUPT_API_PRESENT -#define ALT_IRQ_BASE NULL -#define ALT_LOG_PORT "/dev/null" -#define ALT_LOG_PORT_BASE 0x0 -#define ALT_LOG_PORT_DEV null -#define ALT_LOG_PORT_TYPE "" -#define ALT_NUM_EXTERNAL_INTERRUPT_CONTROLLERS 0 -#define ALT_NUM_INTERNAL_INTERRUPT_CONTROLLERS 1 -#define ALT_NUM_INTERRUPT_CONTROLLERS 1 -#define ALT_STDERR "/dev/jtag_uart" -#define ALT_STDERR_BASE 0x41100 -#define ALT_STDERR_DEV jtag_uart -#define ALT_STDERR_IS_JTAG_UART -#define ALT_STDERR_PRESENT -#define ALT_STDERR_TYPE "altera_avalon_jtag_uart" -#define ALT_STDIN "/dev/jtag_uart" -#define ALT_STDIN_BASE 0x41100 -#define ALT_STDIN_DEV jtag_uart -#define ALT_STDIN_IS_JTAG_UART -#define ALT_STDIN_PRESENT -#define ALT_STDIN_TYPE "altera_avalon_jtag_uart" -#define ALT_STDOUT "/dev/jtag_uart" -#define ALT_STDOUT_BASE 0x41100 -#define ALT_STDOUT_DEV jtag_uart -#define ALT_STDOUT_IS_JTAG_UART -#define ALT_STDOUT_PRESENT -#define ALT_STDOUT_TYPE "altera_avalon_jtag_uart" -#define ALT_SYSTEM_NAME "nios_system" - - -/* - * hal configuration - * - */ - -#define ALT_MAX_FD 32 -#define ALT_SYS_CLK none -#define ALT_TIMESTAMP_CLK none - - -/* - * hex0 configuration - * - */ - -#define ALT_MODULE_CLASS_hex0 altera_avalon_pio -#define HEX0_BASE 0x410b0 -#define HEX0_BIT_CLEARING_EDGE_REGISTER 0 -#define HEX0_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define HEX0_CAPTURE 0 -#define HEX0_DATA_WIDTH 7 -#define HEX0_DO_TEST_BENCH_WIRING 0 -#define HEX0_DRIVEN_SIM_VALUE 0 -#define HEX0_EDGE_TYPE "NONE" -#define HEX0_FREQ 50000000 -#define HEX0_HAS_IN 0 -#define HEX0_HAS_OUT 1 -#define HEX0_HAS_TRI 0 -#define HEX0_IRQ -1 -#define HEX0_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define HEX0_IRQ_TYPE "NONE" -#define HEX0_NAME "/dev/hex0" -#define HEX0_RESET_VALUE 0 -#define HEX0_SPAN 16 -#define HEX0_TYPE "altera_avalon_pio" - - -/* - * hex1 configuration - * - */ - -#define ALT_MODULE_CLASS_hex1 altera_avalon_pio -#define HEX1_BASE 0x410a0 -#define HEX1_BIT_CLEARING_EDGE_REGISTER 0 -#define HEX1_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define HEX1_CAPTURE 0 -#define HEX1_DATA_WIDTH 7 -#define HEX1_DO_TEST_BENCH_WIRING 0 -#define HEX1_DRIVEN_SIM_VALUE 0 -#define HEX1_EDGE_TYPE "NONE" -#define HEX1_FREQ 50000000 -#define HEX1_HAS_IN 0 -#define HEX1_HAS_OUT 1 -#define HEX1_HAS_TRI 0 -#define HEX1_IRQ -1 -#define HEX1_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define HEX1_IRQ_TYPE "NONE" -#define HEX1_NAME "/dev/hex1" -#define HEX1_RESET_VALUE 0 -#define HEX1_SPAN 16 -#define HEX1_TYPE "altera_avalon_pio" - - -/* - * hex2 configuration - * - */ - -#define ALT_MODULE_CLASS_hex2 altera_avalon_pio -#define HEX2_BASE 0x41090 -#define HEX2_BIT_CLEARING_EDGE_REGISTER 0 -#define HEX2_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define HEX2_CAPTURE 0 -#define HEX2_DATA_WIDTH 7 -#define HEX2_DO_TEST_BENCH_WIRING 0 -#define HEX2_DRIVEN_SIM_VALUE 0 -#define HEX2_EDGE_TYPE "NONE" -#define HEX2_FREQ 50000000 -#define HEX2_HAS_IN 0 -#define HEX2_HAS_OUT 1 -#define HEX2_HAS_TRI 0 -#define HEX2_IRQ -1 -#define HEX2_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define HEX2_IRQ_TYPE "NONE" -#define HEX2_NAME "/dev/hex2" -#define HEX2_RESET_VALUE 0 -#define HEX2_SPAN 16 -#define HEX2_TYPE "altera_avalon_pio" - - -/* - * hex3 configuration - * - */ - -#define ALT_MODULE_CLASS_hex3 altera_avalon_pio -#define HEX3_BASE 0x41080 -#define HEX3_BIT_CLEARING_EDGE_REGISTER 0 -#define HEX3_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define HEX3_CAPTURE 0 -#define HEX3_DATA_WIDTH 7 -#define HEX3_DO_TEST_BENCH_WIRING 0 -#define HEX3_DRIVEN_SIM_VALUE 0 -#define HEX3_EDGE_TYPE "NONE" -#define HEX3_FREQ 50000000 -#define HEX3_HAS_IN 0 -#define HEX3_HAS_OUT 1 -#define HEX3_HAS_TRI 0 -#define HEX3_IRQ -1 -#define HEX3_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define HEX3_IRQ_TYPE "NONE" -#define HEX3_NAME "/dev/hex3" -#define HEX3_RESET_VALUE 0 -#define HEX3_SPAN 16 -#define HEX3_TYPE "altera_avalon_pio" - - -/* - * hex4 configuration - * - */ - -#define ALT_MODULE_CLASS_hex4 altera_avalon_pio -#define HEX4_BASE 0x41070 -#define HEX4_BIT_CLEARING_EDGE_REGISTER 0 -#define HEX4_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define HEX4_CAPTURE 0 -#define HEX4_DATA_WIDTH 7 -#define HEX4_DO_TEST_BENCH_WIRING 0 -#define HEX4_DRIVEN_SIM_VALUE 0 -#define HEX4_EDGE_TYPE "NONE" -#define HEX4_FREQ 50000000 -#define HEX4_HAS_IN 0 -#define HEX4_HAS_OUT 1 -#define HEX4_HAS_TRI 0 -#define HEX4_IRQ -1 -#define HEX4_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define HEX4_IRQ_TYPE "NONE" -#define HEX4_NAME "/dev/hex4" -#define HEX4_RESET_VALUE 0 -#define HEX4_SPAN 16 -#define HEX4_TYPE "altera_avalon_pio" - - -/* - * hex5 configuration - * - */ - -#define ALT_MODULE_CLASS_hex5 altera_avalon_pio -#define HEX5_BASE 0x41060 -#define HEX5_BIT_CLEARING_EDGE_REGISTER 0 -#define HEX5_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define HEX5_CAPTURE 0 -#define HEX5_DATA_WIDTH 7 -#define HEX5_DO_TEST_BENCH_WIRING 0 -#define HEX5_DRIVEN_SIM_VALUE 0 -#define HEX5_EDGE_TYPE "NONE" -#define HEX5_FREQ 50000000 -#define HEX5_HAS_IN 0 -#define HEX5_HAS_OUT 1 -#define HEX5_HAS_TRI 0 -#define HEX5_IRQ -1 -#define HEX5_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define HEX5_IRQ_TYPE "NONE" -#define HEX5_NAME "/dev/hex5" -#define HEX5_RESET_VALUE 0 -#define HEX5_SPAN 16 -#define HEX5_TYPE "altera_avalon_pio" - - -/* - * hex6 configuration - * - */ - -#define ALT_MODULE_CLASS_hex6 altera_avalon_pio -#define HEX6_BASE 0x41050 -#define HEX6_BIT_CLEARING_EDGE_REGISTER 0 -#define HEX6_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define HEX6_CAPTURE 0 -#define HEX6_DATA_WIDTH 7 -#define HEX6_DO_TEST_BENCH_WIRING 0 -#define HEX6_DRIVEN_SIM_VALUE 0 -#define HEX6_EDGE_TYPE "NONE" -#define HEX6_FREQ 50000000 -#define HEX6_HAS_IN 0 -#define HEX6_HAS_OUT 1 -#define HEX6_HAS_TRI 0 -#define HEX6_IRQ -1 -#define HEX6_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define HEX6_IRQ_TYPE "NONE" -#define HEX6_NAME "/dev/hex6" -#define HEX6_RESET_VALUE 0 -#define HEX6_SPAN 16 -#define HEX6_TYPE "altera_avalon_pio" - - -/* - * hex7 configuration - * - */ - -#define ALT_MODULE_CLASS_hex7 altera_avalon_pio -#define HEX7_BASE 0x41040 -#define HEX7_BIT_CLEARING_EDGE_REGISTER 0 -#define HEX7_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define HEX7_CAPTURE 0 -#define HEX7_DATA_WIDTH 7 -#define HEX7_DO_TEST_BENCH_WIRING 0 -#define HEX7_DRIVEN_SIM_VALUE 0 -#define HEX7_EDGE_TYPE "NONE" -#define HEX7_FREQ 50000000 -#define HEX7_HAS_IN 0 -#define HEX7_HAS_OUT 1 -#define HEX7_HAS_TRI 0 -#define HEX7_IRQ -1 -#define HEX7_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define HEX7_IRQ_TYPE "NONE" -#define HEX7_NAME "/dev/hex7" -#define HEX7_RESET_VALUE 0 -#define HEX7_SPAN 16 -#define HEX7_TYPE "altera_avalon_pio" - - -/* - * jtag_uart configuration - * - */ - -#define ALT_MODULE_CLASS_jtag_uart altera_avalon_jtag_uart -#define JTAG_UART_BASE 0x41100 -#define JTAG_UART_IRQ 5 -#define JTAG_UART_IRQ_INTERRUPT_CONTROLLER_ID 0 -#define JTAG_UART_NAME "/dev/jtag_uart" -#define JTAG_UART_READ_DEPTH 64 -#define JTAG_UART_READ_THRESHOLD 8 -#define JTAG_UART_SPAN 8 -#define JTAG_UART_TYPE "altera_avalon_jtag_uart" -#define JTAG_UART_WRITE_DEPTH 64 -#define JTAG_UART_WRITE_THRESHOLD 8 - - -/* - * lcd_16207_0 configuration - * - */ - -#define ALT_MODULE_CLASS_lcd_16207_0 altera_avalon_lcd_16207 -#define LCD_16207_0_BASE 0x41030 -#define LCD_16207_0_IRQ -1 -#define LCD_16207_0_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define LCD_16207_0_NAME "/dev/lcd_16207_0" -#define LCD_16207_0_SPAN 16 -#define LCD_16207_0_TYPE "altera_avalon_lcd_16207" - - -/* - * lcd_blon configuration - * - */ - -#define ALT_MODULE_CLASS_lcd_blon altera_avalon_pio -#define LCD_BLON_BASE 0x41020 -#define LCD_BLON_BIT_CLEARING_EDGE_REGISTER 0 -#define LCD_BLON_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define LCD_BLON_CAPTURE 0 -#define LCD_BLON_DATA_WIDTH 1 -#define LCD_BLON_DO_TEST_BENCH_WIRING 0 -#define LCD_BLON_DRIVEN_SIM_VALUE 0 -#define LCD_BLON_EDGE_TYPE "NONE" -#define LCD_BLON_FREQ 50000000 -#define LCD_BLON_HAS_IN 0 -#define LCD_BLON_HAS_OUT 1 -#define LCD_BLON_HAS_TRI 0 -#define LCD_BLON_IRQ -1 -#define LCD_BLON_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define LCD_BLON_IRQ_TYPE "NONE" -#define LCD_BLON_NAME "/dev/lcd_blon" -#define LCD_BLON_RESET_VALUE 0 -#define LCD_BLON_SPAN 16 -#define LCD_BLON_TYPE "altera_avalon_pio" - - -/* - * lcd_on configuration - * - */ - -#define ALT_MODULE_CLASS_lcd_on altera_avalon_pio -#define LCD_ON_BASE 0x41010 -#define LCD_ON_BIT_CLEARING_EDGE_REGISTER 0 -#define LCD_ON_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define LCD_ON_CAPTURE 0 -#define LCD_ON_DATA_WIDTH 1 -#define LCD_ON_DO_TEST_BENCH_WIRING 0 -#define LCD_ON_DRIVEN_SIM_VALUE 0 -#define LCD_ON_EDGE_TYPE "NONE" -#define LCD_ON_FREQ 50000000 -#define LCD_ON_HAS_IN 0 -#define LCD_ON_HAS_OUT 1 -#define LCD_ON_HAS_TRI 0 -#define LCD_ON_IRQ -1 -#define LCD_ON_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define LCD_ON_IRQ_TYPE "NONE" -#define LCD_ON_NAME "/dev/lcd_on" -#define LCD_ON_RESET_VALUE 0 -#define LCD_ON_SPAN 16 -#define LCD_ON_TYPE "altera_avalon_pio" - - -/* - * onchip_memory configuration - * - */ - -#define ALT_MODULE_CLASS_onchip_memory altera_avalon_onchip_memory2 -#define ONCHIP_MEMORY_ALLOW_IN_SYSTEM_MEMORY_CONTENT_EDITOR 0 -#define ONCHIP_MEMORY_ALLOW_MRAM_SIM_CONTENTS_ONLY_FILE 0 -#define ONCHIP_MEMORY_BASE 0x0 -#define ONCHIP_MEMORY_CONTENTS_INFO "" -#define ONCHIP_MEMORY_DUAL_PORT 0 -#define ONCHIP_MEMORY_GUI_RAM_BLOCK_TYPE "AUTO" -#define ONCHIP_MEMORY_INIT_CONTENTS_FILE "nios_system_onchip_memory" -#define ONCHIP_MEMORY_INIT_MEM_CONTENT 1 -#define ONCHIP_MEMORY_INSTANCE_ID "NONE" -#define ONCHIP_MEMORY_IRQ -1 -#define ONCHIP_MEMORY_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define ONCHIP_MEMORY_NAME "/dev/onchip_memory" -#define ONCHIP_MEMORY_NON_DEFAULT_INIT_FILE_ENABLED 0 -#define ONCHIP_MEMORY_RAM_BLOCK_TYPE "AUTO" -#define ONCHIP_MEMORY_READ_DURING_WRITE_MODE "DONT_CARE" -#define ONCHIP_MEMORY_SINGLE_CLOCK_OP 0 -#define ONCHIP_MEMORY_SIZE_MULTIPLE 1 -#define ONCHIP_MEMORY_SIZE_VALUE 204800 -#define ONCHIP_MEMORY_SPAN 204800 -#define ONCHIP_MEMORY_TYPE "altera_avalon_onchip_memory2" -#define ONCHIP_MEMORY_WRITABLE 1 - - -/* - * push_switches configuration - * - */ - -#define ALT_MODULE_CLASS_push_switches altera_avalon_pio -#define PUSH_SWITCHES_BASE 0x410c0 -#define PUSH_SWITCHES_BIT_CLEARING_EDGE_REGISTER 0 -#define PUSH_SWITCHES_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define PUSH_SWITCHES_CAPTURE 0 -#define PUSH_SWITCHES_DATA_WIDTH 3 -#define PUSH_SWITCHES_DO_TEST_BENCH_WIRING 0 -#define PUSH_SWITCHES_DRIVEN_SIM_VALUE 0 -#define PUSH_SWITCHES_EDGE_TYPE "NONE" -#define PUSH_SWITCHES_FREQ 50000000 -#define PUSH_SWITCHES_HAS_IN 1 -#define PUSH_SWITCHES_HAS_OUT 0 -#define PUSH_SWITCHES_HAS_TRI 0 -#define PUSH_SWITCHES_IRQ -1 -#define PUSH_SWITCHES_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define PUSH_SWITCHES_IRQ_TYPE "NONE" -#define PUSH_SWITCHES_NAME "/dev/push_switches" -#define PUSH_SWITCHES_RESET_VALUE 0 -#define PUSH_SWITCHES_SPAN 16 -#define PUSH_SWITCHES_TYPE "altera_avalon_pio" - - -/* - * switches configuration - * - */ - -#define ALT_MODULE_CLASS_switches altera_avalon_pio -#define SWITCHES_BASE 0x410d0 -#define SWITCHES_BIT_CLEARING_EDGE_REGISTER 0 -#define SWITCHES_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define SWITCHES_CAPTURE 0 -#define SWITCHES_DATA_WIDTH 18 -#define SWITCHES_DO_TEST_BENCH_WIRING 0 -#define SWITCHES_DRIVEN_SIM_VALUE 0 -#define SWITCHES_EDGE_TYPE "NONE" -#define SWITCHES_FREQ 50000000 -#define SWITCHES_HAS_IN 1 -#define SWITCHES_HAS_OUT 0 -#define SWITCHES_HAS_TRI 0 -#define SWITCHES_IRQ -1 -#define SWITCHES_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define SWITCHES_IRQ_TYPE "NONE" -#define SWITCHES_NAME "/dev/switches" -#define SWITCHES_RESET_VALUE 0 -#define SWITCHES_SPAN 16 -#define SWITCHES_TYPE "altera_avalon_pio" - -#endif /* __SYSTEM_H_ */ diff --git a/software/qsys_tutorial_lcd_bsp/.cproject b/software/qsys_tutorial_lcd_bsp/.cproject deleted file mode 100644 index a6be1d9..0000000 --- a/software/qsys_tutorial_lcd_bsp/.cproject +++ /dev/null @@ -1,481 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/software/qsys_tutorial_lcd_bsp/.project b/software/qsys_tutorial_lcd_bsp/.project deleted file mode 100644 index 0df0f9a..0000000 --- a/software/qsys_tutorial_lcd_bsp/.project +++ /dev/null @@ -1,85 +0,0 @@ - - - qsys_tutorial_lcd_bsp - - - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - ?name? - - - - org.eclipse.cdt.make.core.append_environment - true - - - org.eclipse.cdt.make.core.autoBuildTarget - all - - - org.eclipse.cdt.make.core.buildArguments - - - - org.eclipse.cdt.make.core.buildCommand - make - - - org.eclipse.cdt.make.core.buildLocation - ${workspace_loc://qsys_tutorial_lcd_bsp} - - - org.eclipse.cdt.make.core.cleanBuildTarget - clean - - - org.eclipse.cdt.make.core.contents - org.eclipse.cdt.make.core.activeConfigSettings - - - org.eclipse.cdt.make.core.enableAutoBuild - false - - - org.eclipse.cdt.make.core.enableCleanBuild - true - - - org.eclipse.cdt.make.core.enableFullBuild - true - - - org.eclipse.cdt.make.core.fullBuildTarget - all - - - org.eclipse.cdt.make.core.stopOnError - true - - - org.eclipse.cdt.make.core.useDefaultBuildCmd - true - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - org.eclipse.cdt.core.ccnature - com.altera.sbtgui.project.SBTGUINature - com.altera.sbtgui.project.SBTGUIBspNature - - diff --git a/software/qsys_tutorial_lcd_bsp/HAL/inc/alt_types.h b/software/qsys_tutorial_lcd_bsp/HAL/inc/alt_types.h deleted file mode 100644 index d02f171..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/inc/alt_types.h +++ /dev/null @@ -1,54 +0,0 @@ -#ifndef __ALT_TYPES_H__ -#define __ALT_TYPES_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/* - * Don't declare these typedefs if this file is included by assembly source. - */ -#ifndef ALT_ASM_SRC -typedef signed char alt_8; -typedef unsigned char alt_u8; -typedef signed short alt_16; -typedef unsigned short alt_u16; -typedef signed long alt_32; -typedef unsigned long alt_u32; -typedef long long alt_64; -typedef unsigned long long alt_u64; -#endif - -#define ALT_INLINE __inline__ -#define ALT_ALWAYS_INLINE __attribute__ ((always_inline)) -#define ALT_WEAK __attribute__((weak)) - -#endif /* __ALT_TYPES_H__ */ diff --git a/software/qsys_tutorial_lcd_bsp/HAL/inc/altera_nios2_qsys_irq.h b/software/qsys_tutorial_lcd_bsp/HAL/inc/altera_nios2_qsys_irq.h deleted file mode 100644 index 6629ec9..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/inc/altera_nios2_qsys_irq.h +++ /dev/null @@ -1,80 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * Support for the Nios II internal interrupt controller. - */ - -#ifndef __ALT_NIOS2_QSYS_IRQ_H__ -#define __ALT_NIOS2_QSYS_IRQ_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The macro ALTERA_NIOS2_IRQ_INSTANCE is used by the alt_irq_init() - * function in the auto-generated file alt_sys_init.c to create an - * instance of this interrupt controller device driver state if this - * module contains an interrupt controller. - * Only one instance of a Nios II is allowed so this macro is just empty. - */ - -#define ALTERA_NIOS2_QSYS_IRQ_INSTANCE(name, state) - -/* - * altera_nios2_irq_init() is called by the auto-generated function - * alt_irq_init() once for the Nios II if it contains an interrupt controller. - * The altera_nios2_irq_init() routine is called using the - * ALTERA_NIOS2_IRQ_INIT macro given below. - * - * This function initializes the internal interrupt controller - * so is not called if the Nios II contains an external interrupt - * controller port (because the internal interrupt controller - * is removed if this port is present). - */ - -extern void altera_nios2_qsys_irq_init( void ); - -/* - * The macro ALTERA_NIOS2_IRQ_INIT is used by the alt_irq_init() routine - * in the auto-generated file alt_sys_init.c to initialize an instance - * of the interrupt controller device driver state. - */ - -#define ALTERA_NIOS2_QSYS_IRQ_INIT(name, state) altera_nios2_qsys_irq_init() - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_NIOS2_QSYS_IRQ_H__ */ - diff --git a/software/qsys_tutorial_lcd_bsp/HAL/inc/io.h b/software/qsys_tutorial_lcd_bsp/HAL/inc/io.h deleted file mode 100644 index 362f103..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/inc/io.h +++ /dev/null @@ -1,81 +0,0 @@ -#ifndef __IO_H__ -#define __IO_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/* IO Header file for Nios II Toolchain */ - -#include "alt_types.h" -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#ifndef SYSTEM_BUS_WIDTH -#error SYSTEM_BUS_WIDTH undefined -#endif - -/* Dynamic bus access functions */ - -#define __IO_CALC_ADDRESS_DYNAMIC(BASE, OFFSET) \ - ((void *)(((alt_u8*)BASE) + (OFFSET))) - -#define IORD_32DIRECT(BASE, OFFSET) \ - __builtin_ldwio (__IO_CALC_ADDRESS_DYNAMIC ((BASE), (OFFSET))) -#define IORD_16DIRECT(BASE, OFFSET) \ - __builtin_ldhuio (__IO_CALC_ADDRESS_DYNAMIC ((BASE), (OFFSET))) -#define IORD_8DIRECT(BASE, OFFSET) \ - __builtin_ldbuio (__IO_CALC_ADDRESS_DYNAMIC ((BASE), (OFFSET))) - -#define IOWR_32DIRECT(BASE, OFFSET, DATA) \ - __builtin_stwio (__IO_CALC_ADDRESS_DYNAMIC ((BASE), (OFFSET)), (DATA)) -#define IOWR_16DIRECT(BASE, OFFSET, DATA) \ - __builtin_sthio (__IO_CALC_ADDRESS_DYNAMIC ((BASE), (OFFSET)), (DATA)) -#define IOWR_8DIRECT(BASE, OFFSET, DATA) \ - __builtin_stbio (__IO_CALC_ADDRESS_DYNAMIC ((BASE), (OFFSET)), (DATA)) - -/* Native bus access functions */ - -#define __IO_CALC_ADDRESS_NATIVE(BASE, REGNUM) \ - ((void *)(((alt_u8*)BASE) + ((REGNUM) * (SYSTEM_BUS_WIDTH/8)))) - -#define IORD(BASE, REGNUM) \ - __builtin_ldwio (__IO_CALC_ADDRESS_NATIVE ((BASE), (REGNUM))) -#define IOWR(BASE, REGNUM, DATA) \ - __builtin_stwio (__IO_CALC_ADDRESS_NATIVE ((BASE), (REGNUM)), (DATA)) - -#ifdef __cplusplus -} -#endif - -#endif /* __IO_H__ */ diff --git a/software/qsys_tutorial_lcd_bsp/HAL/inc/nios2.h b/software/qsys_tutorial_lcd_bsp/HAL/inc/nios2.h deleted file mode 100644 index 72cefba..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/inc/nios2.h +++ /dev/null @@ -1,230 +0,0 @@ -#ifndef __NIOS2_H__ -#define __NIOS2_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2008 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * This header provides processor specific macros for accessing the Nios2 - * control registers. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * Macros for accessing selected processor registers - */ - -#define NIOS2_READ_ET(et) \ - do { __asm ("mov %0, et" : "=r" (et) ); } while (0) - -#define NIOS2_WRITE_ET(et) \ - do { __asm volatile ("mov et, %z0" : : "rM" (et)); } while (0) - -#define NIOS2_READ_SP(sp) \ - do { __asm ("mov %0, sp" : "=r" (sp) ); } while (0) - -/* - * Macros for useful processor instructions - */ - -#define NIOS2_BREAK() \ - do { __asm volatile ("break"); } while (0) - -#define NIOS2_REPORT_STACK_OVERFLOW() \ - do { __asm volatile("break 3"); } while (0) - -/* - * Macros for accessing the control registers. - */ - -#define NIOS2_READ_STATUS(dest) \ - do { dest = __builtin_rdctl(0); } while (0) - -#define NIOS2_WRITE_STATUS(src) \ - do { __builtin_wrctl(0, src); } while (0) - -#define NIOS2_READ_ESTATUS(dest) \ - do { dest = __builtin_rdctl(1); } while (0) - -#define NIOS2_READ_BSTATUS(dest) \ - do { dest = __builtin_rdctl(2); } while (0) - -#define NIOS2_READ_IENABLE(dest) \ - do { dest = __builtin_rdctl(3); } while (0) - -#define NIOS2_WRITE_IENABLE(src) \ - do { __builtin_wrctl(3, src); } while (0) - -#define NIOS2_READ_IPENDING(dest) \ - do { dest = __builtin_rdctl(4); } while (0) - -#define NIOS2_READ_CPUID(dest) \ - do { dest = __builtin_rdctl(5); } while (0) - - -/* - * Macros for accessing extra exception registers. These - * are always enabled wit the MPU or MMU, and optionally - * with other advanced exception types/ - */ -#define NIOS2_READ_EXCEPTION(dest) \ - do { dest = __builtin_rdctl(7); } while (0) - -#define NIOS2_READ_BADADDR(dest) \ - do { dest = __builtin_rdctl(12); } while (0) - - -/* - * Macros for accessing control registers for MPU - * operation. These should not be used unless the - * MPU is enabled. - * - * The config register may be augmented for future - * enhancements. For now, only MPU support is provided. - */ -/* Config register */ -#define NIOS2_WRITE_CONFIG(src) \ - do { __builtin_wrctl(13, src); } while (0) - -#define NIOS2_READ_CONFIG(dest) \ - do { dest = __builtin_rdctl(13); } while (0) - -/* MPU Base Address Register */ -#define NIOS2_WRITE_MPUBASE(src) \ - do { __builtin_wrctl(14, src); } while (0) - -#define NIOS2_READ_MPUBASE(dest) \ - do { dest = __builtin_rdctl(14); } while (0) - -/* MPU Access Register */ -#define NIOS2_WRITE_MPUACC(src) \ - do { __builtin_wrctl(15, src); } while (0) - -#define NIOS2_READ_MPUACC(dest) \ - do { dest = __builtin_rdctl(15); } while (0) - - -/* - * Nios II control registers that are always present - */ -#define NIOS2_STATUS status -#define NIOS2_ESTATUS estatus -#define NIOS2_BSTATUS bstatus -#define NIOS2_IENABLE ienable -#define NIOS2_IPENDING ipending -#define NIOS2_CPUID cpuid - -/* - * STATUS, BSTATUS, ESTATUS, and SSTATUS fields. - * The presence of fields is a function of the Nios II configuration. - */ -#define NIOS2_STATUS_PIE_MSK (0x00000001) -#define NIOS2_STATUS_PIE_OFST (0) -#define NIOS2_STATUS_U_MSK (0x00000002) -#define NIOS2_STATUS_U_OFST (1) -#define NIOS2_STATUS_EH_MSK (0x00000004) -#define NIOS2_STATUS_EH_OFST (2) -#define NIOS2_STATUS_IH_MSK (0x00000008) -#define NIOS2_STATUS_IH_OFST (3) -#define NIOS2_STATUS_IL_MSK (0x000003f0) -#define NIOS2_STATUS_IL_OFST (4) -#define NIOS2_STATUS_CRS_MSK (0x0000fc00) -#define NIOS2_STATUS_CRS_OFST (10) -#define NIOS2_STATUS_PRS_MSK (0x003f0000) -#define NIOS2_STATUS_PRS_OFST (16) -#define NIOS2_STATUS_NMI_MSK (0x00400000) -#define NIOS2_STATUS_NMI_OFST (22) -#define NIOS2_STATUS_RSIE_MSK (0x00800000) -#define NIOS2_STATUS_RSIE_OFST (23) -#define NIOS2_STATUS_SRS_MSK (0x80000000) -#define NIOS2_STATUS_SRS_OFST (31) - -/* - * Bit masks & offsets available with extra exceptions support - */ - -/* Exception register */ -#define NIOS2_EXCEPTION_REG_CAUSE_MASK (0x0000007c) -#define NIOS2_EXCEPTION_REG_CAUSE_OFST (2) - -/* - * Bit masks & offsets for MPU support - * - * All bit-masks are expressed relative to the position - * of the data with a register. To read data that is LSB- - * aligned, the register read data should be masked, then - * right-shifted by the designated "OFST" macro value. The - * opposite should be used for register writes when starting - * with LSB-aligned data. - */ - -/* Config register */ -#define NIOS2_CONFIG_REG_PE_MASK (0x00000001) -#define NIOS2_CONFIG_REG_PE_OFST (0) -#define NIOS2_CONFIG_REG_ANI_MASK (0x00000002) -#define NIOS2_CONFIG_REG_ANI_OFST (1) - -/* MPU Base Address Register */ -#define NIOS2_MPUBASE_D_MASK (0x00000001) -#define NIOS2_MPUBASE_D_OFST (0) -#define NIOS2_MPUBASE_INDEX_MASK (0x0000003e) -#define NIOS2_MPUBASE_INDEX_OFST (1) -#define NIOS2_MPUBASE_BASE_ADDR_MASK (0xffffffc0) -#define NIOS2_MPUBASE_BASE_ADDR_OFST (6) - -/* MPU Access Register */ -#define NIOS2_MPUACC_LIMIT_MASK (0xffffffc0) -#define NIOS2_MPUACC_LIMIT_OFST (6) -#define NIOS2_MPUACC_MASK_MASK (0xffffffc0) -#define NIOS2_MPUACC_MASK_OFST (6) -#define NIOS2_MPUACC_C_MASK (0x00000020) -#define NIOS2_MPUACC_C_OFST (5) -#define NIOS2_MPUACC_PERM_MASK (0x0000001c) -#define NIOS2_MPUACC_PERM_OFST (2) -#define NIOS2_MPUACC_RD_MASK (0x00000002) -#define NIOS2_MPUACC_RD_OFST (1) -#define NIOS2_MPUACC_WR_MASK (0x00000001) -#define NIOS2_MPUACC_WR_OFST (0) - -/* - * Number of available IRQs in internal interrupt controller. - */ -#define NIOS2_NIRQ 32 - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __NIOS2_H__ */ diff --git a/software/qsys_tutorial_lcd_bsp/HAL/inc/os/alt_flag.h b/software/qsys_tutorial_lcd_bsp/HAL/inc/os/alt_flag.h deleted file mode 100644 index b9b4605..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/inc/os/alt_flag.h +++ /dev/null @@ -1,98 +0,0 @@ -#ifndef __ALT_FLAG_H__ -#define __ALT_FLAG_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * This header provides macro definitions that can be used to create and use - * uc/OS-II style event flags. These macros can be used in both a uC/OS-II based - * environment, and a single threaded HAL based environment. - * - * The motivation for these macros is to allow code to be developed which is - * thread safe under uC/OS-II, but incurs no additional overhead when used in a - * single threaded HAL environment. - * - * In the case of a single threaded HAL environment, they compile to - * "do nothing" directives, which ensures they do not contribute to the final - * executable. - * - * The following macros are available: - * - * ALT_FLAG_GRP - Create a flag group instance. - * ALT_EXTERN_FLAG_GRP - Create a reference to an external flag group instance. - * ALT_STATIC_FLAG_GRP - Create a static flag group instance. - * ALT_FLAG_CREATE - Initialise a flag group. - * ALT_FLAG_PEND - Pend on a flag group. - * ALT_FLAG_POST - Set a flag condition. - - * - * Input arguments and return codes are all consistant with the equivalent - * uC/OS-II function. - * - * It's important to be careful in the use of the macros: ALT_FLAG_GRP, - * ALT_EXTERN_FLAG_GRP, and ALT_STATIC_FLAG_GRP. In these three cases the - * semi-colon is included in the macro definition; so, for example, you should - * use: - * - * ALT_FLAG_GRP(mygroup) - * - * not: - * - * ALT_FLAG_GRP(mygroup); - * - * The inclusion of the semi-colon has been necessary to ensure the macros can - * compile with no warnings when used in a single threaded HAL environment. - * - */ - -#include "priv/alt_no_error.h" - -#define ALT_FLAG_GRP(group) -#define ALT_EXTERN_FLAG_GRP(group) -#define ALT_STATIC_FLAG_GRP(group) - -#define ALT_FLAG_CREATE(group, flags) alt_no_error () -#define ALT_FLAG_PEND(group, flags, wait_type, timeout) alt_no_error () -#define ALT_FLAG_POST(group, flags, opt) alt_no_error () - -#ifndef ALT_SINGLE_THREADED -#define ALT_SINGLE_THREADED -#endif - -#endif /* __ALT_FLAG_H__ */ diff --git a/software/qsys_tutorial_lcd_bsp/HAL/inc/os/alt_hooks.h b/software/qsys_tutorial_lcd_bsp/HAL/inc/os/alt_hooks.h deleted file mode 100644 index 9054e3f..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/inc/os/alt_hooks.h +++ /dev/null @@ -1,61 +0,0 @@ -#ifndef __ALT_HOOKS_H__ -#define __ALT_HOOKS_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * This header provides "do-nothing" macro definitions for operating system - * hooks within the HAL. The O/S component can override these to provide it's - * own implementation. - */ - -#define ALT_OS_TIME_TICK() while(0) -#define ALT_OS_INIT() while(0) -#define ALT_OS_STOP() while(0) - -/* Call from assembly code */ -#define ALT_OS_INT_ENTER_ASM -#define ALT_OS_INT_EXIT_ASM - -/* Call from C code */ -#define ALT_OS_INT_ENTER() while(0) -#define ALT_OS_INT_EXIT() while(0) - - -#endif /* __ALT_HOOKS_H__ */ diff --git a/software/qsys_tutorial_lcd_bsp/HAL/inc/os/alt_sem.h b/software/qsys_tutorial_lcd_bsp/HAL/inc/os/alt_sem.h deleted file mode 100644 index 753943e..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/inc/os/alt_sem.h +++ /dev/null @@ -1,96 +0,0 @@ -#ifndef __ALT_SEM_H__ -#define __ALT_SEM_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * This header provides macro definitions that can be used to create and use - * semaphores. These macros can be used in both a uC/OS-II based environment, - * and a single threaded HAL based environment. - * - * The motivation for these macros is to allow code to be developed which is - * thread safe under uC/OS-II, but incurs no additional overhead when used in a - * single threaded HAL environment. - * - * In the case of a single threaded HAL environment, they compile to - * "do nothing" directives, which ensures they do not contribute to the final - * executable. - * - * The following macros are available: - * - * ALT_SEM - Create a semaphore instance. - * ALT_EXTERN_SEM - Create a reference to an external semaphore instance. - * ALT_STATIC_SEM - Create a static semaphore instance. - * ALT_SEM_CREATE - Initialise a semaphore. - * ALT_SEM_PEND - Pend on a semaphore. - * ALT_SEM_POST - Increment a semaphore. - * - * Input arguments and return codes are all consistant with the equivalent - * uC/OS-II function. - * - * It's important to be careful in the use of the macros: ALT_SEM, - * ALT_EXTERN_SEM, and ALT_STATIC_SEM. In these three cases the semi-colon is - * included in the macro definition; so, for example, you should use: - * - * ALT_SEM(mysem) - * - * not: - * - * ALT_SEM(mysem); - * - * The inclusion of the semi-colon has been necessary to ensure the macros can - * compile with no warnings when used in a single threaded HAL environment. - * - */ - -#include "priv/alt_no_error.h" - -#define ALT_SEM(sem) -#define ALT_EXTERN_SEM(sem) -#define ALT_STATIC_SEM(sem) - -#define ALT_SEM_CREATE(sem, value) alt_no_error () -#define ALT_SEM_PEND(sem, timeout) alt_no_error () -#define ALT_SEM_POST(sem) alt_no_error () - -#ifndef ALT_SINGLE_THREADED -#define ALT_SINGLE_THREADED -#endif - -#endif /* __ALT_SEM_H__ */ diff --git a/software/qsys_tutorial_lcd_bsp/HAL/inc/os/alt_syscall.h b/software/qsys_tutorial_lcd_bsp/HAL/inc/os/alt_syscall.h deleted file mode 100644 index 507c6aa..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/inc/os/alt_syscall.h +++ /dev/null @@ -1,75 +0,0 @@ -#ifndef __ALT_SYSCALL_H__ -#define __ALT_SYSCALL_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * The macros defined in this file are used to provide the function names used - * for the HAL 'UNIX style' interface, e.g. read(), write() etc. - * - * Operating systems which are ported to the HAL can provide their own - * version of this file, which will be used in preference. This allows - * the operating system to provide it's own implementation of the top level - * system calls, while retaining the HAL functions under a different name, - * for example, alt_read(), alt_write() etc. - */ - -#define ALT_CLOSE close -#define ALT_ENVIRON environ -#define ALT_EXECVE execve -#define ALT_EXIT _exit -#define ALT_FCNTL fcntl -#define ALT_FORK fork -#define ALT_FSTAT fstat -#define ALT_GETPID getpid -#define ALT_GETTIMEOFDAY gettimeofday -#define ALT_IOCTL ioctl -#define ALT_ISATTY isatty -#define ALT_KILL kill -#define ALT_LINK link -#define ALT_LSEEK lseek -#define ALT_OPEN open -#define ALT_READ read -#define ALT_RENAME _rename -#define ALT_SBRK sbrk -#define ALT_SETTIMEOFDAY settimeofday -#define ALT_STAT stat -#define ALT_UNLINK unlink -#define ALT_USLEEP usleep -#define ALT_WAIT wait -#define ALT_WRITE write -#define ALT_TIMES times - -/* - * - */ - -#endif /* __ALT_SYSCALL_H__ */ diff --git a/software/qsys_tutorial_lcd_bsp/HAL/inc/priv/alt_alarm.h b/software/qsys_tutorial_lcd_bsp/HAL/inc/priv/alt_alarm.h deleted file mode 100644 index 45d6a0e..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/inc/priv/alt_alarm.h +++ /dev/null @@ -1,101 +0,0 @@ -#ifndef __ALT_PRIV_ALARM_H__ -#define __ALT_PRIV_ALARM_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "alt_types.h" - -/* - * This header provides the internal defenitions required by the public - * interface alt_alarm.h. These variables and structures are not guaranteed to - * exist in future implementations of the HAL. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * "alt_alarm_s" is a structure type used to maintain lists of alarm callback - * functions. - */ - -struct alt_alarm_s -{ - alt_llist llist; /* linked list */ - alt_u32 time; /* time in system ticks of the callback */ - alt_u32 (*callback) (void* context); /* callback function. The return - * value is the period for the next callback; where - * zero indicates that the alarm should be removed - * from the list. - */ - alt_u8 rollover; /* set when desired alarm time + current time causes - overflow, to prevent premature alarm */ - void* context; /* Argument for the callback */ -}; - -/* - * "_alt_tick_rate" is a global variable used to store the system clock rate - * in ticks per second. This is initialised to zero, which coresponds to there - * being no system clock available. - * - * It is then set to it's final value by the system clock driver through a call - * to alt_sysclk_init(). - */ - -extern alt_u32 _alt_tick_rate; - -/* - * "_alt_nticks" is a global variable which records the elapsed number of - * system clock ticks since the last call to settimeofday() or since reset if - * settimeofday() has not been called. - */ - -extern volatile alt_u32 _alt_nticks; - -/* The list of registered alarms. */ - -extern alt_llist alt_alarm_list; - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_PRIV_ALARM_H__ */ diff --git a/software/qsys_tutorial_lcd_bsp/HAL/inc/priv/alt_busy_sleep.h b/software/qsys_tutorial_lcd_bsp/HAL/inc/priv/alt_busy_sleep.h deleted file mode 100644 index b1af849..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/inc/priv/alt_busy_sleep.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef __ALT_BUSY_SLEEP_H -#define __ALT_BUSY_SLEEP_H - -/* - * Copyright (c) 2003 Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - */ - -/* - * The function alt_busy_sleep provides a busy loop implementation of usleep. - * This is used to provide usleep for the standalone HAL, or when the timer is - * unavailable in uC/OS-II. - */ - -extern unsigned int alt_busy_sleep (unsigned int us); - -#endif /* __ALT_BUSY_SLEEP_H */ diff --git a/software/qsys_tutorial_lcd_bsp/HAL/inc/priv/alt_dev_llist.h b/software/qsys_tutorial_lcd_bsp/HAL/inc/priv/alt_dev_llist.h deleted file mode 100644 index 451b063..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/inc/priv/alt_dev_llist.h +++ /dev/null @@ -1,77 +0,0 @@ -#ifndef __ALT_DEV_LLIST_H__ -#define __ALT_DEV_LLIST_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "sys/alt_llist.h" -#include "alt_types.h" - -/* - * This header provides the internal defenitions required to control file - * access. These variables and functions are not guaranteed to exist in - * future implementations of the HAL. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The alt_dev_llist is an internal structure used to form a common base - * class for all device types. The use of this structure allows common code - * to be used to manipulate the various device lists. - */ - -typedef struct { - alt_llist llist; - const char* name; -} alt_dev_llist; - -/* - * - */ - -extern int alt_dev_llist_insert (alt_dev_llist* dev, alt_llist* list); - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_DEV_LLIST_H__ */ diff --git a/software/qsys_tutorial_lcd_bsp/HAL/inc/priv/alt_exception_handler_registry.h b/software/qsys_tutorial_lcd_bsp/HAL/inc/priv/alt_exception_handler_registry.h deleted file mode 100644 index c6905fa..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/inc/priv/alt_exception_handler_registry.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef __ALT_EXCEPTION_HANDLER_REGISTRY_H__ -#define __ALT_EXCEPTION_HANDLER_REGISTRY_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2008 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ -#include "sys/alt_exceptions.h" - -/* Function pointer to exception callback routine */ -extern alt_exception_result (*alt_instruction_exception_handler) - (alt_exception_cause, alt_u32, alt_u32); - -#endif /* __ALT_EXCEPTION_HANDLER_REGISTRY_H__ */ diff --git a/software/qsys_tutorial_lcd_bsp/HAL/inc/priv/alt_file.h b/software/qsys_tutorial_lcd_bsp/HAL/inc/priv/alt_file.h deleted file mode 100644 index 2c3e843..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/inc/priv/alt_file.h +++ /dev/null @@ -1,179 +0,0 @@ -#ifndef __ALT_FILE_H__ -#define __ALT_FILE_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "sys/alt_dev.h" -#include "sys/alt_llist.h" -#include "os/alt_sem.h" - -#include "alt_types.h" - -/* - * This header provides the internal defenitions required to control file - * access. These variables and functions are not guaranteed to exist in - * future implementations of the HAL. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The function alt_find_dev() is used to search the device list "list" to - * locate a device named "name". If a match is found, then a pointer to the - * device is returned, otherwise NULL is returned. - */ - -extern alt_dev* alt_find_dev (const char* name, alt_llist* list); - -/* - * alt_find_file() is used to search the list of registered file systems to - * find the filesystem that the file named "name" belongs to. If a match is - * found, then a pointer to the filesystems alt_dev structure is returned, - * otherwise NULL is returned. - * - * Note that a match does not indicate that the file exists, only that a - * filesystem exists that is registered for a partition that could contain - * the file. The filesystems open() function would need to be called in order - * to determine if the file exists. - */ - -extern alt_dev* alt_find_file (const char* name); - -/* - * alt_get_fd() is used to allocate a file descriptor for the device or - * filesystem "dev". A negative return value indicates an error, otherwise the - * return value is the index of the file descriptor within the file descriptor - * pool. - */ - -extern int alt_get_fd (alt_dev* dev); - -/* - * alt_release_fd() is called to free the file descriptor with index "fd". - */ - -extern void alt_release_fd (int fd); - -/* - * alt_fd_lock() is called by ioctl() to mark the file descriptor "fd" as - * being open for exclusive access. Subsequent calls to open() for the device - * associated with "fd" will fail. A device is unlocked by either calling - * close() for "fd", or by an alternate call to ioctl() (see ioctl.c for - * details). - */ - -extern int alt_fd_lock (alt_fd* fd); - -/* - * alt_fd_unlock() is called by ioctl() to unlock a descriptor previously - * locked by a call to alt_fd_lock(). - */ - -extern int alt_fd_unlock (alt_fd* fd); - -/* - * "alt_fd_list" is the pool of file descriptors. - */ - -extern alt_fd alt_fd_list[]; - -/* - * flags used by alt_fd. - * - * ALT_FD_EXCL is used to mark a file descriptor as locked for exclusive - * access, i.e. further calls to open() for the associated device should - * fail. - * - * ALT_FD_DEV marks a dile descriptor as belonging to a device as oposed to a - * filesystem. - */ - -#define ALT_FD_EXCL 0x80000000 -#define ALT_FD_DEV 0x40000000 - -#define ALT_FD_FLAGS_MASK (ALT_FD_EXCL | ALT_FD_DEV) - -/* - * "alt_dev_list" is the head of the linked list of registered devices. - */ - -extern alt_llist alt_dev_list; - -/* - * "alt_fs_list" is the head of the linked list of registered filesystems. - */ - -extern alt_llist alt_fs_list; - -/* - * "alt_fd_list_lock" is a semaphore used to ensure that access to the pool - * of file descriptors is thread safe. - */ - -ALT_EXTERN_SEM(alt_fd_list_lock) - -/* - * "alt_max_fd" is a 'high water mark'. It indicates the highest file - * descriptor allocated. Use of this can save searching the entire pool - * for active file descriptors, which helps avoid contention on access - * to the file descriptor pool. - */ - -extern alt_32 alt_max_fd; - -/* - * alt_io_redirect() is called at startup to redirect stdout, stdin, and - * stderr to the devices named in the input arguments. By default these streams - * are directed at /dev/null, and are then redirected using this function once - * all of the devices have been registered within the system. - */ - -extern void alt_io_redirect(const char* stdout_dev, - const char* stdin_dev, - const char* stderr_dev); - - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_FILE_H__ */ diff --git a/software/qsys_tutorial_lcd_bsp/HAL/inc/priv/alt_iic_isr_register.h b/software/qsys_tutorial_lcd_bsp/HAL/inc/priv/alt_iic_isr_register.h deleted file mode 100644 index a0cb01c..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/inc/priv/alt_iic_isr_register.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef __ALT_IIC_ISR_REGISTER_H_ -#define __ALT_IIC_ISR_REGISTER_H_ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ -#include "alt_types.h" -#include "sys/alt_irq.h" - -extern int alt_iic_isr_register(alt_u32 ic_id, alt_u32 irq, alt_isr_func isr, - void *isr_context, void *flags); - -#endif /* __ALT_IIC_ISR_REGISTER_H_ */ diff --git a/software/qsys_tutorial_lcd_bsp/HAL/inc/priv/alt_irq_table.h b/software/qsys_tutorial_lcd_bsp/HAL/inc/priv/alt_irq_table.h deleted file mode 100644 index 694ef06..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/inc/priv/alt_irq_table.h +++ /dev/null @@ -1,59 +0,0 @@ -#ifndef __ALT_IRQ_TABLE_H__ -#define __ALT_IRQ_TABLE_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * Definition of a table describing each interrupt handler. The index into - * the array is the interrupt id associated with the handler. - * - * When an interrupt occurs, the associated handler is called with - * the argument stored in the context member. - * - * The table is physically created in alt_irq_handler.c - */ -extern struct ALT_IRQ_HANDLER -{ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - void (*handler)(void*); -#else - void (*handler)(void*, alt_u32); -#endif - void *context; -} alt_irq[ALT_NIRQ]; - -#endif diff --git a/software/qsys_tutorial_lcd_bsp/HAL/inc/priv/alt_legacy_irq.h b/software/qsys_tutorial_lcd_bsp/HAL/inc/priv/alt_legacy_irq.h deleted file mode 100644 index c7aec02..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/inc/priv/alt_legacy_irq.h +++ /dev/null @@ -1,158 +0,0 @@ -#ifndef __ALT_LEGACY_IRQ_H__ -#define __ALT_LEGACY_IRQ_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * This file provides prototypes and inline implementations of certain routines - * used by the legacy interrupt API. Do not include this in your driver or - * application source files, use "sys/alt_irq.h" instead to access the proper - * public API. - */ - -#include -#include "system.h" - -#ifndef NIOS2_EIC_PRESENT - -#include "nios2.h" -#include "alt_types.h" - -#include "sys/alt_irq.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * alt_irq_register() can be used to register an interrupt handler. If the - * function is succesful, then the requested interrupt will be enabled upon - * return. - */ -extern int alt_irq_register (alt_u32 id, - void* context, - alt_isr_func handler); - -/* - * alt_irq_disable() disables the individual interrupt indicated by "id". - */ -static ALT_INLINE int ALT_ALWAYS_INLINE alt_irq_disable (alt_u32 id) -{ - alt_irq_context status; - extern volatile alt_u32 alt_irq_active; - - status = alt_irq_disable_all (); - - alt_irq_active &= ~(1 << id); - NIOS2_WRITE_IENABLE (alt_irq_active); - - alt_irq_enable_all(status); - - return 0; -} - -/* - * alt_irq_enable() enables the individual interrupt indicated by "id". - */ -static ALT_INLINE int ALT_ALWAYS_INLINE alt_irq_enable (alt_u32 id) -{ - alt_irq_context status; - extern volatile alt_u32 alt_irq_active; - - status = alt_irq_disable_all (); - - alt_irq_active |= (1 << id); - NIOS2_WRITE_IENABLE (alt_irq_active); - - alt_irq_enable_all(status); - - return 0; -} - -#ifndef ALT_EXCEPTION_STACK -/* - * alt_irq_initerruptable() should only be called from within an ISR. It is used - * to allow higer priority interrupts to interrupt the current ISR. The input - * argument, "priority", is the priority, i.e. interrupt number of the current - * interrupt. - * - * If this function is called, then the ISR is required to make a call to - * alt_irq_non_interruptible() before returning. The input argument to - * alt_irq_non_interruptible() is the return value from alt_irq_interruptible(). - * - * Care should be taken when using this pair of functions, since they increasing - * the system overhead associated with interrupt handling. - * - * If you are using an exception stack then nested interrupts won't work, so - * these functions are not available in that case. - */ -static ALT_INLINE alt_u32 ALT_ALWAYS_INLINE alt_irq_interruptible (alt_u32 priority) -{ - extern volatile alt_u32 alt_priority_mask; - extern volatile alt_u32 alt_irq_active; - - alt_u32 old_priority; - - old_priority = alt_priority_mask; - alt_priority_mask = (1 << priority) - 1; - - NIOS2_WRITE_IENABLE (alt_irq_active & alt_priority_mask); - - NIOS2_WRITE_STATUS (1); - - return old_priority; -} - -/* - * See Comments above for alt_irq_interruptible() for an explanation of the use of this - * function. - */ -static ALT_INLINE void ALT_ALWAYS_INLINE alt_irq_non_interruptible (alt_u32 mask) -{ - extern volatile alt_u32 alt_priority_mask; - extern volatile alt_u32 alt_irq_active; - - NIOS2_WRITE_STATUS (0); - - alt_priority_mask = mask; - - NIOS2_WRITE_IENABLE (mask & alt_irq_active); -} -#endif /* ALT_EXCEPTION_STACK */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* NIOS2_EIC_PRESENT */ - -#endif /* __ALT_LEGACY_IRQ_H__ */ diff --git a/software/qsys_tutorial_lcd_bsp/HAL/inc/priv/alt_no_error.h b/software/qsys_tutorial_lcd_bsp/HAL/inc/priv/alt_no_error.h deleted file mode 100644 index 6143fc9..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/inc/priv/alt_no_error.h +++ /dev/null @@ -1,77 +0,0 @@ -#ifndef __ALT_NO_ERROR_H__ -#define __ALT_NO_ERROR_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "alt_types.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * alt_no_error() is a dummy function used by alt_sem.h and alt_flag.h. It - * substitutes for functions that have a return code by creating a function - * that always returns zero. - * - * This may seem a little obscure, but what happens is that the compiler can - * then optomise away the call to this function, and any code written which - * handles the error path (i.e. non zero return values). - * - * This allows code to be written which correctly use the uC/OS-II semaphore - * and flag utilities, without the use of those utilities impacting on - * excutables built for a single threaded HAL environment. - * - * This function is considered to be part of the internal implementation of - * the HAL, and should not be called directly by application code or device - * drivers. It is not guaranteed to be preserved in future versions of the - * HAL. - */ - -static ALT_INLINE int ALT_ALWAYS_INLINE alt_no_error (void) -{ - return 0; -} - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_NO_ERROR_H__ */ diff --git a/software/qsys_tutorial_lcd_bsp/HAL/inc/priv/nios2_gmon_data.h b/software/qsys_tutorial_lcd_bsp/HAL/inc/priv/nios2_gmon_data.h deleted file mode 100644 index 3f43f12..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/inc/priv/nios2_gmon_data.h +++ /dev/null @@ -1,47 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ -#ifndef NIOS2_GMON_DATA_H -#define NIOS2_GMON_DATA_H - -#define GMON_DATA_SIG 0 -#define GMON_DATA_WORDS 1 -#define GMON_DATA_PROFILE_DATA 2 -#define GMON_DATA_PROFILE_LOWPC 3 -#define GMON_DATA_PROFILE_HIGHPC 4 -#define GMON_DATA_PROFILE_BUCKET 5 -#define GMON_DATA_PROFILE_RATE 6 -#define GMON_DATA_MCOUNT_START 7 -#define GMON_DATA_MCOUNT_LIMIT 8 - -#define GMON_DATA_SIZE 9 - -extern unsigned int alt_gmon_data[GMON_DATA_SIZE]; - -#endif diff --git a/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_alarm.h b/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_alarm.h deleted file mode 100644 index 68a2f5d..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_alarm.h +++ /dev/null @@ -1,126 +0,0 @@ -#ifndef __ALT_ALARM_H__ -#define __ALT_ALARM_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "alt_llist.h" -#include "alt_types.h" - -#include "priv/alt_alarm.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * "alt_alarm" is a structure type used by applications to register an alarm - * callback function. An instance of this type must be passed as an input - * argument to alt_alarm_start(). The user is not responsible for initialising - * the contents of the instance. This is done by alt_alarm_start(). - */ - -typedef struct alt_alarm_s alt_alarm; - -/* - * alt_alarm_start() can be called by an application/driver in order to register - * a function for periodic callback at the system clock frequency. Be aware that - * this callback is likely to occur in interrupt context. - */ - -extern int alt_alarm_start (alt_alarm* the_alarm, - alt_u32 nticks, - alt_u32 (*callback) (void* context), - void* context); - -/* - * alt_alarm_stop() is used to unregister a callback. Alternatively the callback - * can return zero to unregister. - */ - -extern void alt_alarm_stop (alt_alarm* the_alarm); - -/* - * Obtain the system clock rate in ticks/s. - */ - -static ALT_INLINE alt_u32 ALT_ALWAYS_INLINE alt_ticks_per_second (void) -{ - return _alt_tick_rate; -} - -/* - * alt_sysclk_init() is intended to be only used by the system clock driver - * in order to initialise the value of the clock frequency. - */ - -static ALT_INLINE int ALT_ALWAYS_INLINE alt_sysclk_init (alt_u32 nticks) -{ - if (! _alt_tick_rate) - { - _alt_tick_rate = nticks; - return 0; - } - else - { - return -1; - } -} - -/* - * alt_nticks() returns the elapsed number of system clock ticks since reset. - */ - -static ALT_INLINE alt_u32 ALT_ALWAYS_INLINE alt_nticks (void) -{ - return _alt_nticks; -} - -/* - * alt_tick() should only be called by the system clock driver. This is used - * to notify the system that the system timer period has expired. - */ - -extern void alt_tick (void); - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_ALARM_H__ */ diff --git a/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_cache.h b/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_cache.h deleted file mode 100644 index c4d8db9..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_cache.h +++ /dev/null @@ -1,117 +0,0 @@ -#ifndef __ALT_CACHE_H__ -#define __ALT_CACHE_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003, 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include - -#include "alt_types.h" - -/* - * alt_cache.h defines the processor specific functions for manipulating the - * cache. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * alt_icache_flush() is called to flush the instruction cache for a memory - * region of length "len" bytes, starting at address "start". - */ - -extern void alt_icache_flush (void* start, alt_u32 len); - -/* - * alt_dcache_flush() is called to flush the data cache for a memory - * region of length "len" bytes, starting at address "start". - * Any dirty lines in the data cache are written back to memory. - */ - -extern void alt_dcache_flush (void* start, alt_u32 len); - -/* - * alt_dcache_flush() is called to flush the data cache for a memory - * region of length "len" bytes, starting at address "start". - * Any dirty lines in the data cache are NOT written back to memory. - */ - -extern void alt_dcache_flush_no_writeback (void* start, alt_u32 len); - -/* - * Flush the entire instruction cache. - */ - -extern void alt_icache_flush_all (void); - -/* - * Flush the entire data cache. - */ - -extern void alt_dcache_flush_all (void); - -/* - * Allocate a block of uncached memory. - */ - -extern volatile void* alt_uncached_malloc (size_t size); - -/* - * Free a block of uncached memory. - */ - -extern void alt_uncached_free (volatile void* ptr); - -/* - * Convert a pointer to a block of cached memory, into a block of - * uncached memory. - */ - -extern volatile void* alt_remap_uncached (void* ptr, alt_u32 len); - -/* - * Convert a pointer to a block of uncached memory, into a block of - * cached memory. - */ - -extern void* alt_remap_cached (volatile void* ptr, alt_u32 len); - -/* - * - */ - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_CACHE_H__ */ diff --git a/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_debug.h b/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_debug.h deleted file mode 100644 index d9f9599..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_debug.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef __ALT_DEBUG_H__ -#define __ALT_DEBUG_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * The ALT_DEVUG_ASSERT macro can be used to generate a debugger break - * from within software. The break is generated if "condition" evaluates to - * false. - */ - -#define ALT_DEBUG_ASSERT(condition) if (!condition) \ -{ \ - __asm__ volatile ("break"); \ -} - -#endif /* __ALT_DEBUG_H__ */ diff --git a/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_dev.h b/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_dev.h deleted file mode 100644 index 66c5e41..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_dev.h +++ /dev/null @@ -1,115 +0,0 @@ -#ifndef __ALT_DEV_H__ -#define __ALT_DEV_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "system.h" -#include "sys/alt_llist.h" -#include "priv/alt_dev_llist.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The value ALT_IRQ_NOT_CONNECTED is used to represent an unconnected - * interrupt line. It cannot evaluate to a valid interrupt number. - */ - -#define ALT_IRQ_NOT_CONNECTED (-1) - -typedef struct alt_dev_s alt_dev; - -struct stat; - -/* - * The file descriptor structure definition. - */ - -typedef struct alt_fd_s -{ - alt_dev* dev; - alt_u8* priv; - int fd_flags; -} alt_fd; - -/* - * The device structure definition. - */ - -struct alt_dev_s { - alt_llist llist; /* for internal use */ - const char* name; - int (*open) (alt_fd* fd, const char* name, int flags, int mode); - int (*close) (alt_fd* fd); - int (*read) (alt_fd* fd, char* ptr, int len); - int (*write) (alt_fd* fd, const char* ptr, int len); - int (*lseek) (alt_fd* fd, int ptr, int dir); - int (*fstat) (alt_fd* fd, struct stat* buf); - int (*ioctl) (alt_fd* fd, int req, void* arg); -}; - -/* - * Functions used to register device for access through the C standard - * library. - * - * The only difference between alt_dev_reg() and alt_fs_reg() is the - * interpretation that open() places on the device name. In the case of - * alt_dev_reg the device is assumed to be a particular character device, - * and so there must be an exact match in the name for open to succeed. - * In the case of alt_fs_reg() the name of the device is treated as the - * mount point for a directory, and so any call to open() where the name - * is the root of the device filename will succeed. - */ - -extern int alt_fs_reg (alt_dev* dev); - -static ALT_INLINE int alt_dev_reg (alt_dev* dev) -{ - extern alt_llist alt_dev_list; - - return alt_dev_llist_insert ((alt_dev_llist*) dev, &alt_dev_list); -} - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_DEV_H__ */ diff --git a/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_dma.h b/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_dma.h deleted file mode 100644 index 9f9b2ff..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_dma.h +++ /dev/null @@ -1,226 +0,0 @@ -#ifndef __ALT_DMA_H__ -#define __ALT_DMA_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "sys/alt_dma_dev.h" -#include "alt_types.h" - -#include - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * This header contains the application side interface for accessing DMA - * resources. See alt_dma_dev.h for the dma device driver interface. - * - * The interface model treats a DMA transaction as being composed of two - * halves (read and write). - * - * The application can supply data for transmit using an "alt_dma_txchan" - * descriptor. Alternatively an "alt_dma_rxchan" descriptor can be used to - * receive data. - */ - -/* - * alt_dma_txchan_open() is used to obtain an "alt_dma_txchan" descriptor for - * a DMA transmit device. The name is the name of the associated physical - * device (e.g. "/dev/dma_0"). - * - * The return value will be NULL on failure, and non-NULL otherwise. - */ - -extern alt_dma_txchan alt_dma_txchan_open (const char* name); - -/* - * alt_dma_txchan_close() is provided so that an application can notify the - * system that it has finished with a given DMA transmit channel. This is only - * provided for completness. - */ - -static ALT_INLINE int alt_dma_txchan_close (alt_dma_txchan dma) -{ - return 0; -} - -/* - * alt_dma_txchan_send() posts a transmit request to a DMA transmit channel. - * The input arguments are: - * - * dma: the channel to use. - * from: a pointer to the start of the data to send. - * length: the length of the data to send in bytes. - * done: callback function that will be called once the data has been sent. - * handle: opaque value passed to "done". - * - * The return value will be negative if the request cannot be posted, and - * zero otherwise. - */ - -static ALT_INLINE int alt_dma_txchan_send (alt_dma_txchan dma, - const void* from, - alt_u32 length, - alt_txchan_done* done, - void* handle) -{ - return dma ? dma->dma_send (dma, - from, - length, - done, - handle) : -ENODEV; -} - -/* - * alt_dma_txchan_space() returns the number of tranmit requests that can be - * posted to the specified DMA transmit channel. - * - * A negative value indicates that the value could not be determined. - */ - -static ALT_INLINE int alt_dma_txchan_space (alt_dma_txchan dma) -{ - return dma ? dma->space (dma) : -ENODEV; -} - -/* - * alt_dma_txchan_ioctl() can be used to perform device specific I/O - * operations on the indicated DMA transmit channel. For example some drivers - * support options to control the width of the transfer operations. See - * alt_dma_dev.h for the list of generic requests. - * - * A negative return value indicates failure, otherwise the interpretation - * of the return value is request specific. - */ - -static ALT_INLINE int alt_dma_txchan_ioctl (alt_dma_txchan dma, - int req, - void* arg) -{ - return dma ? dma->ioctl (dma, req, arg) : -ENODEV; -} - -/* - * alt_dma_rxchan_open() is used to obtain an "alt_dma_rxchan" descriptor for - * a DMA receive channel. The name is the name of the associated physical - * device (e.g. "/dev/dma_0"). - * - * The return value will be NULL on failure, and non-NULL otherwise. - */ - -extern alt_dma_rxchan alt_dma_rxchan_open (const char* dev); - -/* - * alt_dma_rxchan_close() is provided so that an application can notify the - * system that it has finished with a given DMA receive channel. This is only - * provided for completness. - */ - -static ALT_INLINE int alt_dma_rxchan_close (alt_dma_rxchan dma) -{ - return 0; -} - -/* - * - */ - -/* - * alt_dma_rxchan_prepare() posts a receive request to a DMA receive channel. - * - * The input arguments are: - * - * dma: the channel to use. - * data: a pointer to the location that data is to be received to. - * len: the maximum length of the data to receive. - * done: callback function that will be called once the data has been - * received. - * handle: opaque value passed to "done". - * - * The return value will be negative if the request cannot be posted, and - * zero otherwise. - */ - -static ALT_INLINE int alt_dma_rxchan_prepare (alt_dma_rxchan dma, - void* data, - alt_u32 len, - alt_rxchan_done* done, - void* handle) -{ - return dma ? dma->prepare (dma, data, len, done, handle) : -ENODEV; -} - -/* - * alt_dma_rxchan_ioctl() can be used to perform device specific I/O - * operations on the indicated DMA receive channel. For example some drivers - * support options to control the width of the transfer operations. See - * alt_dma_dev.h for the list of generic requests. - * - * A negative return value indicates failure, otherwise the interpretation - * of the return value is request specific. - */ - -static ALT_INLINE int alt_dma_rxchan_ioctl (alt_dma_rxchan dma, - int req, - void* arg) -{ - return dma ? dma->ioctl (dma, req, arg) : -ENODEV; -} - -/* - * alt_dma_rxchan_depth() returns the depth of the receive FIFO used to store - * receive requests. - */ - -static ALT_INLINE alt_u32 alt_dma_rxchan_depth(alt_dma_rxchan dma) -{ - return dma->depth; -} - -/* - * - */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_DMA_H__ */ diff --git a/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_dma_dev.h b/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_dma_dev.h deleted file mode 100644 index 832463d..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_dma_dev.h +++ /dev/null @@ -1,200 +0,0 @@ -#ifndef __ALT_DMA_DEV_H__ -#define __ALT_DMA_DEV_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "priv/alt_dev_llist.h" - -#include "alt_types.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * This header contains the device driver interface for accessing DMA - * resources. See alt_dma.h for the DMA application side interface. - * - * The interface model treats a DMA transaction as being composed of two - * halves (read and write). - * - * An "alt_dma_txchan_dev" is used to describe the device associated with a - * DMA transmit channel. An "alt_dma_rxchan_dev" is used to describe the - * device associated with a DMA receive channel. - */ - -/* - * List of generic ioctl requests that may be supported by a DMA device. - * - * ALT_DMA_RX_ONLY_ON: This causes a DMA channel to operate in a mode - * where only the receiver is under software control. - * The other side reads continously from a single - * location. The address to read is the argument to - * this request. - * ALT_DMA_RX_ONLY_OFF: Return to the default mode where both the receive - * and transmit sides of the DMA can be under software - * control. - * ALT_DMA_TX_ONLY_ON: This causes a DMA channel to operate in a mode - * where only the transmitter is under software control. - * The other side writes continously to a single - * location. The address to write to is the argument to - * this request. - * ALT_DMA_TX_ONLY_OFF: Return to the default mode where both the receive - * and transmit sides of the DMA can be under software - * control. - * ALT_DMA_SET_MODE_8: Transfer data in units of 8 bits. - * ALT_DMA_SET_MODE_16: Transfer data in units of 16 bits. - * ALT_DMA_SET_MODE_32: Transfer data in units of 32 bits. - * ALT_DMA_SET_MODE_64: Transfer data in units of 64 bits. - * ALT_DMA_SET_MODE_128: Transfer data in units of 128 bits. - * ALT_DMA_GET_MODE: Get the current transfer mode. - * - * The use of the macros: ALT_DMA_TX_STREAM_ON, ALT_DMA_TX_STREAM_OFF - * ALT_DMA_RX_STREAM_OFF and ALT_DMA_RX_STREAM_ON are depreciated. You should - * instead use the macros: ALT_DMA_RX_ONLY_ON, ALT_DMA_RX_ONLY_OFF, - * ALT_DMA_TX_ONLY_ON and ALT_DMA_TX_ONLY_OFF. - */ - -#define ALT_DMA_TX_STREAM_ON (0x1) -#define ALT_DMA_TX_STREAM_OFF (0x2) -#define ALT_DMA_RX_STREAM_ON (0x3) -#define ALT_DMA_RX_STREAM_OFF (0x4) -#define ALT_DMA_SET_MODE_8 (0x5) -#define ALT_DMA_SET_MODE_16 (0x6) -#define ALT_DMA_SET_MODE_32 (0x7) -#define ALT_DMA_SET_MODE_64 (0x8) -#define ALT_DMA_SET_MODE_128 (0x9) -#define ALT_DMA_GET_MODE (0xa) - -#define ALT_DMA_RX_ONLY_ON ALT_DMA_TX_STREAM_ON -#define ALT_DMA_RX_ONLY_OFF ALT_DMA_TX_STREAM_OFF -#define ALT_DMA_TX_ONLY_ON ALT_DMA_RX_STREAM_ON -#define ALT_DMA_TX_ONLY_OFF ALT_DMA_RX_STREAM_OFF - -/* - * - */ - -typedef struct alt_dma_txchan_dev_s alt_dma_txchan_dev; -typedef struct alt_dma_rxchan_dev_s alt_dma_rxchan_dev; - -typedef alt_dma_txchan_dev* alt_dma_txchan; -typedef alt_dma_rxchan_dev* alt_dma_rxchan; - -typedef void (alt_txchan_done)(void* handle); -typedef void (alt_rxchan_done)(void* handle, void* data); - -/* - * devices that provide a DMA transmit channel are required to provide an - * instance of the "alt_dma_txchan_dev" structure. - */ - -struct alt_dma_txchan_dev_s { - alt_llist llist; /* for internal use */ - const char* name; /* name of the device instance - * (e.g. "/dev/dma_0"). - */ - int (*space) (alt_dma_txchan dma); /* returns the maximum number of - * transmit requests that can be posted - */ - int (*dma_send) (alt_dma_txchan dma, - const void* from, - alt_u32 len, - alt_txchan_done* done, - void* handle); /* post a transmit request */ - int (*ioctl) (alt_dma_txchan dma, int req, void* arg); /* perform device - * specific I/O control. - */ -}; - -/* - * devices that provide a DMA receive channel are required to provide an - * instance of the "alt_dma_rxchan_dev" structure. - */ - -struct alt_dma_rxchan_dev_s { - alt_llist list; /* for internal use */ - const char* name; /* name of the device instance - * (e.g. "/dev/dma_0"). - */ - alt_u32 depth; /* maximum number of receive requests that - * can be posted. - */ - int (*prepare) (alt_dma_rxchan dma, - void* data, - alt_u32 len, - alt_rxchan_done* done, - void* handle); /* post a receive request */ - int (*ioctl) (alt_dma_rxchan dma, int req, void* arg); /* perform device - * specific I/O control. - */ -}; - -/* - * Register a DMA transmit channel with the system. - */ - -static ALT_INLINE int alt_dma_txchan_reg (alt_dma_txchan_dev* dev) -{ - extern alt_llist alt_dma_txchan_list; - - return alt_dev_llist_insert((alt_dev_llist*) dev, &alt_dma_txchan_list); -} - -/* - * Register a DMA receive channel with the system. - */ - -static ALT_INLINE int alt_dma_rxchan_reg (alt_dma_rxchan_dev* dev) -{ - extern alt_llist alt_dma_rxchan_list; - - return alt_dev_llist_insert((alt_dev_llist*) dev, &alt_dma_rxchan_list); -} - -/* - * - */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_DMA_DEV_H__ */ diff --git a/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_driver.h b/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_driver.h deleted file mode 100644 index eb0f23b..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_driver.h +++ /dev/null @@ -1,168 +0,0 @@ -#ifndef __ALT_DRIVER_H__ -#define __ALT_DRIVER_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/* - * Macros used to access a driver without HAL file descriptors. - */ - -/* - * ALT_MODULE_CLASS - * - * This macro returns the module class name for the specified module instance. - * It uses information in the system.h file. - * Neither the instance name or class name are quoted (so that they can - * be used with other pre-processor macros). - * - * Example: - * Assume the design has an instance of an altera_avalon_uart called uart1. - * Calling ALT_MODULE_CLASS(uart1) returns altera_avalon_uart. - */ - -#define ALT_MODULE_CLASS(instance) ALT_MODULE_CLASS_ ## instance - - -/* - * ALT_DRIVER_FUNC_NAME - * - * --> instance Instance name. - * --> func Function name. - * - * This macro returns the device driver function name of the specified - * module instance for the specified function name. - * - * Example: - * Assume the design has an instance of an altera_avalon_uart called uart1. - * Calling ALT_DRIVER_FUNC_NAME(uart1, write) returns - * altera_avalon_uart_write. - */ - -#define ALT_DRIVER_FUNC_NAME(instance, func) \ - ALT_DRIVER_FUNC_NAME1(ALT_MODULE_CLASS(instance), func) -#define ALT_DRIVER_FUNC_NAME1(module_class, func) \ - ALT_DRIVER_FUNC_NAME2(module_class, func) -#define ALT_DRIVER_FUNC_NAME2(module_class, func) \ - module_class ## _ ## func - -/* - * ALT_DRIVER_STATE_STRUCT - * - * --> instance Instance name. - * - * This macro returns the device driver state type name of the specified - * module instance. - * - * Example: - * Assume the design has an instance of an altera_avalon_uart called uart1. - * Calling ALT_DRIVER_STATE_STRUCT(uart1) returns: - * struct altera_avalon_uart_state_s - * - * Note that the ALT_DRIVER_FUNC_NAME macro is used even though "state" isn't - * really a function but it does match the required naming convention. - */ -#define ALT_DRIVER_STATE_STRUCT(instance) \ - struct ALT_DRIVER_FUNC_NAME(instance, state_s) - -/* - * ALT_DRIVER_STATE - * - * --> instance Instance name. - * - * This macro returns the device driver state name of the specified - * module instance. - * - * Example: - * Assume the design has an instance of an altera_avalon_uart called uart1. - * Calling ALT_DRIVER_STATE(uart1) returns uart1. - */ -#define ALT_DRIVER_STATE(instance) instance - -/* - * ALT_DRIVER_WRITE - * - * --> instance Instance name. - * --> buffer Write buffer. - * --> len Length of write buffer data. - * --> flags Control flags (e.g. O_NONBLOCK) - * - * This macro calls the "write" function of the specified driver instance. - */ - -#define ALT_DRIVER_WRITE_EXTERNS(instance) \ - extern ALT_DRIVER_STATE_STRUCT(instance) ALT_DRIVER_STATE(instance); \ - extern int ALT_DRIVER_FUNC_NAME(instance, write) \ - (ALT_DRIVER_STATE_STRUCT(instance) *, const char *, int, int); - -#define ALT_DRIVER_WRITE(instance, buffer, len, flags) \ - ALT_DRIVER_FUNC_NAME(instance, write)(&ALT_DRIVER_STATE(instance), buffer, len, flags) - - -/* - * ALT_DRIVER_READ - * - * --> instance Instance name. - * <-- buffer Read buffer. - * --> len Length of read buffer. - * --> flags Control flags (e.g. O_NONBLOCK) - * - * This macro calls the "read" function of the specified driver instance. - */ - -#define ALT_DRIVER_READ_EXTERNS(instance) \ - extern ALT_DRIVER_STATE_STRUCT(instance) ALT_DRIVER_STATE(instance); \ - extern int ALT_DRIVER_FUNC_NAME(instance, read) \ - (ALT_DRIVER_STATE_STRUCT(instance) *, const char *, int, int); - -#define ALT_DRIVER_READ(instance, buffer, len, flags) \ - ALT_DRIVER_FUNC_NAME(instance, read)(&ALT_DRIVER_STATE(instance), buffer, len, flags) - -/* - * ALT_DRIVER_IOCTL - * - * --> instance Instance name. - * --> req ioctl request (e.g. TIOCSTIMEOUT) - * --> arg Optional argument (void*) - * - * This macro calls the "ioctl" function of the specified driver instance - */ - -#define ALT_DRIVER_IOCTL_EXTERNS(instance) \ - extern ALT_DRIVER_STATE_STRUCT(instance) ALT_DRIVER_STATE(instance); \ - extern int ALT_DRIVER_FUNC_NAME(instance, ioctl) \ - (ALT_DRIVER_STATE_STRUCT(instance) *, int, void*); - -#define ALT_DRIVER_IOCTL(instance, req, arg) \ - ALT_DRIVER_FUNC_NAME(instance, ioctl)(&ALT_DRIVER_STATE(instance), req, arg) - -#endif /* __ALT_DRIVER_H__ */ diff --git a/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_errno.h b/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_errno.h deleted file mode 100644 index 4d3e50f..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_errno.h +++ /dev/null @@ -1,87 +0,0 @@ -#ifndef __ALT_ERRNO_H__ -#define __ALT_ERRNO_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * errno is defined in so that it uses the thread local version - * stored in the location pointed to by "_impure_ptr". This means that the - * accesses to errno within the HAL library can cause the entirety of - * of the structure pointed to by "_impure_ptr" to be added to the - * users application. This can be undesirable in very small footprint systems. - * - * To avoid this happening, the HAL uses the macro ALT_ERRNO, defined below, - * to access errno, rather than accessing it directly. This macro will only - * use the thread local version if some other code has already caused it to be - * included into the system, otherwise it will use the global errno value. - * - * This causes a slight increases in code size where errno is accessed, but - * can lead to significant overall benefits in very small systems. The - * increase is inconsequential when compared to the size of the structure - * pointed to by _impure_ptr. - * - * Note that this macro accesses __errno() using an externally declared - * function pointer (alt_errno). This is done so that the function call uses the - * subroutine call instruction via a register rather than an immediate address. - * This is important in the case that the code has been linked for a high - * address, but __errno() is not being used. In this case the weak linkage - * would have resulted in the instruction: "call 0" which would fail to link. - */ - -extern int* (*alt_errno) (void); - -/* Must define this so that values such as EBADFD are defined in errno.h. */ -#define __LINUX_ERRNO_EXTENSIONS__ - -#include - -#include "alt_types.h" - -#undef errno - -extern int errno; - -static ALT_INLINE int* alt_get_errno(void) -{ - return ((alt_errno) ? alt_errno() : &errno); -} - -#define ALT_ERRNO *alt_get_errno() - -#endif /* __ALT_ERRNO_H__ */ diff --git a/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_exceptions.h b/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_exceptions.h deleted file mode 100644 index 3576a52..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_exceptions.h +++ /dev/null @@ -1,127 +0,0 @@ -#ifndef __ALT_EXCEPTIONS_H__ -#define __ALT_EXCEPTIONS_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2008 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ -#include "alt_types.h" -#include "system.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * This file defines instruction-generated exception handling and registry - * API, exception type enumeration, and handler return value enumeration for - * Nios II. - */ - -/* - * The following enumeration describes the value in the CPU EXCEPTION - * register CAUSE bit field. Not all exception types will cause the - * processor to go to the exception vector; these are provided for - * reference. - */ -enum alt_exception_cause_e { - /* Exeption causes that will cause jump to exception vector */ - NIOS2_EXCEPTION_INTERRUPT = 2, - NIOS2_EXCEPTION_TRAP_INST = 3, - NIOS2_EXCEPTION_UNIMPLEMENTED_INST = 4, - NIOS2_EXCEPTION_ILLEGAL_INST = 5, - NIOS2_EXCEPTION_MISALIGNED_DATA_ADDR = 6, - NIOS2_EXCEPTION_MISALIGNED_TARGET_PC = 7, - NIOS2_EXCEPTION_DIVISION_ERROR = 8, - NIOS2_EXCEPTION_SUPERVISOR_ONLY_INST_ADDR = 9, - NIOS2_EXCEPTION_SUPERVISOR_ONLY_INST = 10, - NIOS2_EXCEPTION_SUPERVISOR_ONLY_DATA_ADDR = 11, - NIOS2_EXCEPTION_TLB_MISS = 12, - NIOS2_EXCEPTION_TLB_EXECUTE_PERM_VIOLATION = 13, - NIOS2_EXCEPTION_MPU_INST_REGION_VIOLATION = 16, - - /* Exception causes that will NOT cause a jump to exception vector */ - NIOS2_EXCEPTION_RESET = 0, - NIOS2_EXCEPTION_CPU_ONLY_RESET_REQUEST = 1, - NIOS2_EXCEPTION_TLB_READ_PERM_VIOLATION = 14, - NIOS2_EXCEPTION_TLB_WRITE_PERM_VIOLATION = 15, - NIOS2_EXCEPTION_MPU_DATA_REGION_VIOLATION = 17, - /* - * This value is passed to an exception handler's cause argument if - * "extra exceptions" information (EXECPTION) register is not - * present in the processor hardware configuration. - */ - NIOS2_EXCEPTION_CAUSE_NOT_PRESENT = -1 -}; -typedef enum alt_exception_cause_e alt_exception_cause; - -/* - * These define valid return values for a user-defined instruction-generated - * exception handler. The handler should return one of these to indicate - * whether to re-issue the instruction that triggered the exception, or to - * skip it. - */ -enum alt_exception_result_e { - NIOS2_EXCEPTION_RETURN_REISSUE_INST = 0, - NIOS2_EXCEPTION_RETURN_SKIP_INST = 1 -}; -typedef enum alt_exception_result_e alt_exception_result; - -/* - * alt_instruction_exception_register() can be used to register an exception - * handler for instruction-generated exceptions that are not handled by the - * built-in exception handler (i.e. for interrupts). - * - * The registry API is optionally enabled through the "Enable - * Instruction-related Exception API" HAL BSP setting, which will - * define the macro below. - */ -#ifdef ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API -void alt_instruction_exception_register ( - alt_exception_result (*exception_handler)( - alt_exception_cause cause, - alt_u32 exception_pc, - alt_u32 bad_addr) ); -#endif /*ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API */ - -/* - * alt_exception_cause_generated_bad_addr() indicates whether a particular - * exception cause value was from an exception-type that generated a valid - * address in the BADADDR register. The contents of BADADDR is passed to - * a user-registered exception handler in all cases, whether valid or not. - * This routine should be called to validate the bad_addr argument to - * your exception handler. - */ -int alt_exception_cause_generated_bad_addr(alt_exception_cause cause); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_EXCEPTIONS_H__ */ diff --git a/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_flash.h b/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_flash.h deleted file mode 100644 index 527328d..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_flash.h +++ /dev/null @@ -1,166 +0,0 @@ -#ifndef __ALT_FLASH_H__ -#define __ALT_FLASH_H__ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/****************************************************************************** -* * -* Alt_flash.h - User interface for flash code * -* * -* Use this interface to avoid being exposed to the internals of the device * -* driver architecture. If you chose to use the flash driver internal * -* structures we don't guarantee not to change them * -* * -* Author PRR * -* * -******************************************************************************/ - - - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#include "alt_types.h" -#include "alt_flash_types.h" -#include "alt_flash_dev.h" -#include "sys/alt_cache.h" - -alt_flash_fd* alt_flash_open_dev(const char* name); -void alt_flash_close_dev(alt_flash_fd* fd ); - -/* - * alt_write_flash - * - * Program a buffer into flash. - * - * This routine erases all the affected erase blocks (if necessary) - * and then programs the data. However it does not read the data out first - * and preserve and none overwritten data, because this would require very - * large buffers on the target. If you need - * that functionality use the functions below. - */ -static __inline__ int __attribute__ ((always_inline)) alt_write_flash( - alt_flash_fd* fd, - int offset, - const void* src_addr, - int length ) -{ - return fd->write( fd, offset, src_addr, length ); -} - -/* - * alt_read_flash - * - * Read a block of flash for most flashes this is just memcpy - * it's here for completeness in case we need it for some serial flash device - * - */ -static __inline__ int __attribute__ ((always_inline)) alt_read_flash( - alt_flash_fd* fd, int offset, - void* dest_addr, int length ) -{ - return fd->read( fd, offset, dest_addr, length ); -} - -/* - * alt_get_flash_info - * - * Return the information on the flash sectors. - * - */ -static __inline__ int __attribute__ ((always_inline)) alt_get_flash_info( - alt_flash_fd* fd, flash_region** info, - int* number_of_regions) -{ - return fd->get_info( fd, info, number_of_regions); -} - -/* - * alt_erase_flash_block - * - * Erase a particular erase block, pass in the offset to the start of - * the block and it's size - */ -static __inline__ int __attribute__ ((always_inline)) alt_erase_flash_block( - alt_flash_fd* fd, int offset, int length) -{ - int ret_code; - ret_code = fd->erase_block( fd, offset ); - - if(!ret_code) - alt_dcache_flush((alt_u8*)fd->base_addr + offset, length); - - return ret_code; -} - -/* - * alt_write_flash_block - * - * Write a particular flash block, block_offset is the offset - * (from the base of flash) to start of the block - * data_offset is the offset (from the base of flash) - * where you wish to start programming - * - * NB this function DOES NOT check that you are only writing a single - * block of data as that would slow down this function. - * - * Use alt_write_flash if you want that level of error checking. - */ - -static __inline__ int __attribute__ ((always_inline)) alt_write_flash_block( - alt_flash_fd* fd, int block_offset, - int data_offset, - const void *data, int length) -{ - - int ret_code; - ret_code = fd->write_block( fd, block_offset, data_offset, data, length ); - - if(!ret_code) - alt_dcache_flush((alt_u8*)fd->base_addr + data_offset, length); - - return ret_code; -} - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_FLASH_H__ */ diff --git a/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_flash_dev.h b/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_flash_dev.h deleted file mode 100644 index 8bab601..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_flash_dev.h +++ /dev/null @@ -1,98 +0,0 @@ -#ifndef __ALT_FLASH_DEV_H__ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/****************************************************************************** -* * -* Alt_flash_dev.h - Generic Flash device interfaces * -* * -* Author PRR * -* * -******************************************************************************/ -#define __ALT_FLASH_DEV_H__ - -#include "alt_flash_types.h" -#include "sys/alt_llist.h" -#include "priv/alt_dev_llist.h" - -#include "alt_types.h" - -typedef struct alt_flash_dev alt_flash_dev; -typedef alt_flash_dev alt_flash_fd; - -static ALT_INLINE int alt_flash_device_register( alt_flash_fd* fd) -{ - extern alt_llist alt_flash_dev_list; - - return alt_dev_llist_insert ((alt_dev_llist*) fd, &alt_flash_dev_list); -} - -typedef alt_flash_dev* (*alt_flash_open)(alt_flash_dev* flash, - const char* name ); -typedef int (*alt_flash_close)(alt_flash_dev* flash_info); - -typedef int (*alt_flash_write)( alt_flash_dev* flash, int offset, - const void* src_addr, int length ); - -typedef int (*alt_flash_get_flash_info)( alt_flash_dev* flash, flash_region** info, - int* number_of_regions); -typedef int (*alt_flash_write_block)( alt_flash_dev* flash, int block_offset, - int data_offset, const void* data, - int length); -typedef int (*alt_flash_erase_block)( alt_flash_dev* flash, int offset); -typedef int (*alt_flash_read)(alt_flash_dev* flash, int offset, - void* dest_addr, int length ); - -struct alt_flash_dev -{ - alt_llist llist; - const char* name; - alt_flash_open open; - alt_flash_close close; - alt_flash_write write; - alt_flash_read read; - alt_flash_get_flash_info get_info; - alt_flash_erase_block erase_block; - alt_flash_write_block write_block; - void* base_addr; - int length; - int number_of_regions; - flash_region region_info[ALT_MAX_NUMBER_OF_FLASH_REGIONS]; -}; - -#endif /* __ALT_FLASH_DEV_H__ */ diff --git a/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_flash_types.h b/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_flash_types.h deleted file mode 100644 index 884cbf8..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_flash_types.h +++ /dev/null @@ -1,64 +0,0 @@ -#ifndef __ALT_FLASH_TYPES_H__ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/****************************************************************************** -* * -* Alt_flash_types.h - Some generic types and defines used by the flash code * -* * -* Author PRR * -* * -******************************************************************************/ -#define __ALT_FLASH_TYPES_H__ - -#ifndef ALT_MAX_NUMBER_OF_FLASH_REGIONS -#define ALT_MAX_NUMBER_OF_FLASH_REGIONS 8 -#endif /* ALT_MAX_NUMBER_OF_FLASH_REGIONS */ - -/* - * Description of a single Erase region - */ -typedef struct flash_region -{ - int offset; - int region_size; - int number_of_blocks; - int block_size; -}flash_region; - -#endif /* __ALT_FLASH_TYPES_H__ */ diff --git a/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_irq.h b/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_irq.h deleted file mode 100644 index 6666e52..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_irq.h +++ /dev/null @@ -1,245 +0,0 @@ -#ifndef __ALT_IRQ_H__ -#define __ALT_IRQ_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * alt_irq.h is the Nios II specific implementation of the interrupt controller - * interface. - * - * Nios II includes optional support for an external interrupt controller. - * When an external controller is present, the "Enhanced" interrupt API - * must be used to manage individual interrupts. The enhanced API also - * supports the processor's internal interrupt controller. Certain API - * members are accessible from either the "legacy" or "enhanced" interrpt - * API. - * - * Regardless of which API is in use, this file should be included by - * application code and device drivers that register ISRs or manage interrpts. - */ -#include - -#include "nios2.h" -#include "alt_types.h" -#include "system.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * Macros used by alt_irq_enabled - */ -#define ALT_IRQ_ENABLED 1 -#define ALT_IRQ_DISABLED 0 - -/* - * Number of available interrupts in internal interrupt controller. - */ -#define ALT_NIRQ NIOS2_NIRQ - -/* - * Used by alt_irq_disable_all() and alt_irq_enable_all(). - */ -typedef int alt_irq_context; - -/* ISR Prototype */ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT -typedef void (*alt_isr_func)(void* isr_context); -#else -typedef void (*alt_isr_func)(void* isr_context, alt_u32 id); -#endif - -/* - * The following protypes and routines are supported by both - * the enhanced and legacy interrupt APIs - */ - -/* - * alt_irq_enabled can be called to determine if the processor's global - * interrupt enable is asserted. The return value is zero if interrupts - * are disabled, and non-zero otherwise. - * - * Whether the internal or external interrupt controller is present, - * individual interrupts may still be disabled. Use the other API to query - * a specific interrupt. - */ -static ALT_INLINE int ALT_ALWAYS_INLINE alt_irq_enabled (void) -{ - int status; - - NIOS2_READ_STATUS (status); - - return status & NIOS2_STATUS_PIE_MSK; -} - -/* - * alt_irq_disable_all() - * - * This routine inhibits all interrupts by negating the status register PIE - * bit. It returns the previous contents of the CPU status register (IRQ - * context) which can be used to restore the status register PIE bit to its - * state before this routine was called. - */ -static ALT_INLINE alt_irq_context ALT_ALWAYS_INLINE - alt_irq_disable_all (void) -{ - alt_irq_context context; - - NIOS2_READ_STATUS (context); - - NIOS2_WRITE_STATUS (context & ~NIOS2_STATUS_PIE_MSK); - - return context; -} - -/* - * alt_irq_enable_all() - * - * Enable all interrupts that were previously disabled by alt_irq_disable_all() - * - * This routine accepts a context to restore the CPU status register PIE bit - * to the state prior to a call to alt_irq_disable_all(). - - * In the case of nested calls to alt_irq_disable_all()/alt_irq_enable_all(), - * this means that alt_irq_enable_all() does not necessarily re-enable - * interrupts. - * - * This routine will perform a read-modify-write sequence to restore only - * status.PIE if the processor is configured with options that add additional - * writeable status register bits. These include the MMU, MPU, the enhanced - * interrupt controller port, and shadow registers. Otherwise, as a performance - * enhancement, status is overwritten with the prior context. - */ -static ALT_INLINE void ALT_ALWAYS_INLINE - alt_irq_enable_all (alt_irq_context context) -{ -#if (NIOS2_NUM_OF_SHADOW_REG_SETS > 0) || (defined NIOS2_EIC_PRESENT) || \ - (defined NIOS2_MMU_PRESENT) || (defined NIOS2_MPU_PRESENT) - alt_irq_context status; - - NIOS2_READ_STATUS (status); - - status &= ~NIOS2_STATUS_PIE_MSK; - status |= (context & NIOS2_STATUS_PIE_MSK); - - NIOS2_WRITE_STATUS (status); -#else - NIOS2_WRITE_STATUS (context); -#endif -} - -/* - * The function alt_irq_init() is defined within the auto-generated file - * alt_sys_init.c. This function calls the initilization macros for all - * interrupt controllers in the system at config time, before any other - * non-interrupt controller driver is initialized. - * - * The "base" parameter is ignored and only present for backwards-compatibility. - * It is recommended that NULL is passed in for the "base" parameter. - */ -extern void alt_irq_init (const void* base); - -/* - * alt_irq_cpu_enable_interrupts() enables the CPU to start taking interrupts. - */ -static ALT_INLINE void ALT_ALWAYS_INLINE - alt_irq_cpu_enable_interrupts () -{ - NIOS2_WRITE_STATUS(NIOS2_STATUS_PIE_MSK -#if defined(NIOS2_EIC_PRESENT) && (NIOS2_NUM_OF_SHADOW_REG_SETS > 0) - | NIOS2_STATUS_RSIE_MSK -#endif - ); -} - - -/* - * Prototypes for the enhanced interrupt API. - */ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT -/* - * alt_ic_isr_register() can be used to register an interrupt handler. If the - * function is succesful, then the requested interrupt will be enabled upon - * return. - */ -extern int alt_ic_isr_register(alt_u32 ic_id, - alt_u32 irq, - alt_isr_func isr, - void *isr_context, - void *flags); - -/* - * alt_ic_irq_enable() and alt_ic_irq_disable() enable/disable a specific - * interrupt by using IRQ port and interrupt controller instance. - */ -int alt_ic_irq_enable (alt_u32 ic_id, alt_u32 irq); -int alt_ic_irq_disable(alt_u32 ic_id, alt_u32 irq); - - /* - * alt_ic_irq_enabled() indicates whether a specific interrupt, as - * specified by IRQ port and interrupt controller instance is enabled. - */ -alt_u32 alt_ic_irq_enabled(alt_u32 ic_id, alt_u32 irq); - -#else -/* - * Prototypes for the legacy interrupt API. - */ -#include "priv/alt_legacy_irq.h" -#endif - - -/* - * alt_irq_pending() returns a bit list of the current pending interrupts. - * This is used by alt_irq_handler() to determine which registered interrupt - * handlers should be called. - * - * This routine is only available for the Nios II internal interrupt - * controller. - */ -#ifndef NIOS2_EIC_PRESENT -static ALT_INLINE alt_u32 ALT_ALWAYS_INLINE alt_irq_pending (void) -{ - alt_u32 active; - - NIOS2_READ_IPENDING (active); - - return active; -} -#endif - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_IRQ_H__ */ diff --git a/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_irq_entry.h b/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_irq_entry.h deleted file mode 100644 index e2008d9..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_irq_entry.h +++ /dev/null @@ -1,39 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * This file pulls in the IRQ entry assembler and C code, which is only - * required if there are any interruptes in the system. - */ - -__asm__( "\n\t.globl alt_irq_entry" ); - -__asm__( "\n\t.globl alt_irq_handler" ); - diff --git a/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_license_reminder_ucosii.h b/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_license_reminder_ucosii.h deleted file mode 100644 index 2fe649c..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_license_reminder_ucosii.h +++ /dev/null @@ -1,77 +0,0 @@ -#ifndef __ALT_LICENSE_REMINDER_UCOSII_H__ -#define __ALT_LICENSE_REMINDER_UCOSII_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include - -#define ALT_LICENSE_REMINDER_UCOSII_STRING \ - "============== Software License Reminder ===============\n" \ - "\n" \ - "uC/OS-II is provided in source form for FREE evaluation,\n" \ - "for educational use, or for peaceful research. If you\n" \ - "plan on using uC/OS-II in a commercial product you need\n" \ - "to contact Micrium to properly license its use in your\n" \ - "product. Micrium provides ALL the source code on the\n" \ - "Altera distribution for your convenience and to help you\n" \ - "experience uC/OS-II. The fact that the source is provided\n" \ - "does NOT mean that you can use it without paying a\n" \ - "licensing fee. Please help us continue to provide the\n" \ - "Embedded community with the finest software available.\n" \ - "Your honesty is greatly appreciated.\n" \ - "\n" \ - "Please contact:\n" \ - "\n" \ - "M I C R I U M\n" \ - "949 Crestview Circle\n" \ - "Weston, FL 33327-1848\n" \ - "U.S.A.\n" \ - "\n" \ - "Phone : +1 954 217 2036\n" \ - "FAX : +1 954 217 2037\n" \ - "WEB : www.micrium.com\n" \ - "E-mail: Sales@Micrium.com\n" \ - "\n" \ - "========================================================\n" - -#define alt_license_reminder_ucosii() puts(ALT_LICENSE_REMINDER_UCOSII_STRING) - - -#endif /* __ALT_LICENSE_REMINDER_UCOSII_H__ */ - diff --git a/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_llist.h b/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_llist.h deleted file mode 100644 index 46f81ce..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_llist.h +++ /dev/null @@ -1,123 +0,0 @@ -#ifndef __ALT_LIST_H__ -#define __ALT_LIST_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "alt_types.h" - -/* - * alt_llist.h defines structures and functions for use in manipulating linked - * lists. A list is considered to be constructed from a chain of objects of - * type alt_llist, with one object being defined to be the head element. - * - * A list is considered to be empty if it only contains the head element. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * alt_llist is the structure used to represent an element within a linked - * list. - */ - -typedef struct alt_llist_s alt_llist; - -struct alt_llist_s { - alt_llist* next; /* Pointer to the next element in the list. */ - alt_llist* previous; /* Pointer to the previous element in the list. */ -}; - -/* - * ALT_LLIST_HEAD is a macro that can be used to create the head of a new - * linked list. This is named "head". The head element is initialised to - * represent an empty list. - */ - -#define ALT_LLIST_HEAD(head) alt_llist head = {&head, &head} - -/* - * ALT_LLIST_ENTRY is a macro used to define an uninitialised linked list - * entry. This is used to reserve space in structure initialisation for - * structures that inherit form alt_llist. - */ - -#define ALT_LLIST_ENTRY {0, 0} - -/* - * alt_llist_insert() insert adds the linked list entry "entry" as the - * first entry in the linked list "list". "list" is the list head element. - */ - -static ALT_INLINE void ALT_ALWAYS_INLINE alt_llist_insert(alt_llist* list, - alt_llist* entry) -{ - entry->previous = list; - entry->next = list->next; - - list->next->previous = entry; - list->next = entry; -} - -/* - * alt_llist_remove() is called to remove an element from a linked list. The - * input argument is the element to remove. - */ - -static ALT_INLINE void ALT_ALWAYS_INLINE alt_llist_remove(alt_llist* entry) -{ - entry->next->previous = entry->previous; - entry->previous->next = entry->next; - - /* - * Set the entry to point to itself, so that any further calls to - * alt_llist_remove() are harmless. - */ - - entry->previous = entry; - entry->next = entry; -} - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_LLIST_H__ */ diff --git a/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_load.h b/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_load.h deleted file mode 100644 index 432e9f2..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_load.h +++ /dev/null @@ -1,78 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "alt_types.h" - -/* - * This macro is used to load code/data from its load address to its - * execution address for a given section. The section name is the input - * argument. Note that a leading '.' is assumed in the name. For example - * to load the section .onchip_ram, use: - * - * ALT_LOAD_SECTION_BY_NAME(onchip_ram); - * - * This requires that the apropriate linker symbols have been generated - * for the section in question. This will be the case if you are using the - * default linker script. - */ - -#define ALT_LOAD_SECTION_BY_NAME(name) \ - { \ - extern void _alt_partition_##name##_start; \ - extern void _alt_partition_##name##_end; \ - extern void _alt_partition_##name##_load_addr; \ - \ - alt_load_section(&_alt_partition_##name##_load_addr, \ - &_alt_partition_##name##_start, \ - &_alt_partition_##name##_end); \ - } - -/* - * Function used to load an individual section from flash to RAM. - * - * There is an implicit assumption here that the linker script will ensure - * that all sections are word aligned. - * - */ - -static void ALT_INLINE alt_load_section (alt_u32* from, - alt_u32* to, - alt_u32* end) -{ - if (to != from) - { - while( to != end ) - { - *to++ = *from++; - } - } -} diff --git a/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_log_printf.h b/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_log_printf.h deleted file mode 100644 index c15ca05..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_log_printf.h +++ /dev/null @@ -1,349 +0,0 @@ -/* alt_log_printf.h - * - * ALT_LOG is designed to provide extra logging/debugging messages from HAL - * through a different port than stdout. It is enabled by the ALT_LOG_ENABLE - * define, which needs to supplied at compile time. When logging is turned off, - * code size is unaffected. Thus, this should be transparent to the user - * when it is not actively turned on, and should not affect projects in any way. - * - * There are macros sprinkled within different components, such as the jtag uart - * and timer, in the HAL code. They are always named ALT_LOG_, and can be - * safely ignored if ALT_LOG is turned off. - * - * To turn on ALT_LOG, ALT_LOG_ENABLE must be defined, and ALT_LOG_PORT_TYPE and - * ALT_LOG_PORT_BASE must be set in system.h. This is done through editing - * .ptf, by editing the alt_log_port_type & alt_log_port_base settings. - * See the documentation html file for examples. - * - * When it is turned on, it will output extra HAL messages to a port specified - * in system.h. This can be a UART or JTAG UART port. By default it will - * output boot messages, detailing every step of the boot process. - * - * Extra logging is designed to be enabled by flags, which are defined in - * alt_log_printf.c. The default value is that all flags are off, so only the - * boot up logging messages show up. ALT_LOG_FLAGS can be set to enable certain - * groupings of flags, and that grouping is done in this file. Each flag can - * also be overridden with a -D at compile time. - * - * This header file includes the necessary prototypes for using the alt_log - * functions. It also contains all the macros that are used to remove the code - * from alt log is turned off. Also, the macros in other HAL files are defined - * here at the bottom. These macros all call some C function that is in - * alt_log_printf.c. - * - * The logging has functions for printing in C (ALT_LOG_PRINTF) and in assembly - * (ALT_LOG_PUTS). This was needed because the assembly printing occurs before - * the device is initialized. The assembly function corrupts register R4-R7, - * which are not used in the normal boot process. For this reason, do not call - * the assembly function in C. - * - * author: gkwan - */ - - -#ifndef __ALT_LOG_PRINTF_H__ -#define __ALT_LOG_PRINTF_H__ - -#include - -/* Global switch to turn on logging functions */ -#ifdef ALT_LOG_ENABLE - - /* ALT_LOG_PORT_TYPE values as defined in system.h. They are defined as - * numbers here first becasue the C preprocessor does not handle string - * comparisons. */ - #define ALTERA_AVALON_JTAG_UART 1 - #define ALTERA_AVALON_UART 0 - - /* If this .h file is included by an assembly file, skip over include files - * that won't compile in assembly. */ - #ifndef ALT_ASM_SRC - #include - #include "sys/alt_alarm.h" - #include "sys/alt_dev.h" - #ifdef __ALTERA_AVALON_JTAG_UART - #include "altera_avalon_jtag_uart.h" - #endif - #endif /* ALT_ASM_SRC */ - - /* These are included for the port register offsets and masks, needed - * to write to the port. Only include if the port type is set correctly, - * otherwise error. If alt_log is turned on and the port to output to is - * incorrect or does not exist, then should exit. */ - #if ALT_LOG_PORT_TYPE == ALTERA_AVALON_JTAG_UART - #ifdef __ALTERA_AVALON_JTAG_UART - #include - #else - #error ALT_LOG: JTAG_UART port chosen, but no JTAG_UART in system. - #endif - #elif ALT_LOG_PORT_TYPE == ALTERA_AVALON_UART - #ifdef __ALTERA_AVALON_UART - #include - #else - #error ALT_LOG: UART Port chosen, but no UART in system. - #endif - #else - #error ALT_LOG: alt_log_port_type declaration invalid! - #endif - - /* ALT_LOG_ENABLE turns on the basic printing function */ - #define ALT_LOG_PRINTF(...) do {alt_log_printf_proc(__VA_ARGS__);} while (0) - - /* Assembly macro for printing in assembly, calls tx_log_str - * which is in alt_log_macro.S. - * If alt_log_boot_on_flag is 0, skips the printing */ - #define ALT_LOG_PUTS(str) movhi r4, %hiadj(alt_log_boot_on_flag) ; \ - addi r4, r4, %lo(alt_log_boot_on_flag) ; \ - ldwio r5, 0(r4) ; \ - beq r0, r5, 0f ; \ - movhi r4, %hiadj(str) ; \ - addi r4, r4, %lo(str) ; \ - call tx_log_str ; \ - 0: - - /* These defines are here to faciliate the use of one output function - * (alt_log_txchar) to print to both the JTAG UART or the UART. Depending - * on the port type, the status register, read mask, and output register - * are set to the appropriate value for the port. */ - #if ALT_LOG_PORT_TYPE == ALTERA_AVALON_JTAG_UART - #define ALT_LOG_PRINT_REG_RD IORD_ALTERA_AVALON_JTAG_UART_CONTROL - #define ALT_LOG_PRINT_MSK ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_MSK - #define ALT_LOG_PRINT_TXDATA_WR IOWR_ALTERA_AVALON_JTAG_UART_DATA - #define ALT_LOG_PRINT_REG_OFFSET (ALTERA_AVALON_JTAG_UART_CONTROL_REG*0x4) - #define ALT_LOG_PRINT_TXDATA_REG_OFFSET (ALTERA_AVALON_JTAG_UART_DATA_REG*0x4) - #elif ALT_LOG_PORT_TYPE == ALTERA_AVALON_UART - #define ALT_LOG_PRINT_REG_RD IORD_ALTERA_AVALON_UART_STATUS - #define ALT_LOG_PRINT_MSK ALTERA_AVALON_UART_STATUS_TRDY_MSK - #define ALT_LOG_PRINT_TXDATA_WR IOWR_ALTERA_AVALON_UART_TXDATA - #define ALT_LOG_PRINT_REG_OFFSET (ALTERA_AVALON_UART_STATUS_REG*0x4) - #define ALT_LOG_PRINT_TXDATA_REG_OFFSET (ALTERA_AVALON_UART_TXDATA_REG*0x4) - #endif /* ALT_LOG_PORT */ - - /* Grouping of flags via ALT_LOG_FLAGS. Each specific flag can be set via - * -D at compile time, or else they'll be set to a default value according - * to ALT_LOG_FLAGS. ALT_LOG_FLAGS = 0 or not set is the default, where - * only the boot messages will be printed. As ALT_LOG_FLAGS increase, they - * increase in intrusiveness to the program, and will affect performance. - * - * Flag Level 1 - turns on system clock and JTAG UART startup status - * 2 - turns on write echo and JTAG_UART alarm (periodic report) - * 3 - turns on JTAG UART ISR logging - will slow performance - * significantly. - * -1 - All logging output is off, but if ALT_LOG_ENABLE is - * defined all logging function is built and code size - * remains constant - * - * Flag settings - 1 = on, 0 = off. */ - - /* This flag turns on "boot" messages for printing. This includes messages - * during crt0.S, then alt_main, and finally alt_exit. */ - #ifndef ALT_LOG_BOOT_ON_FLAG_SETTING - #if ALT_LOG_FLAGS == 1 - #define ALT_LOG_BOOT_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 2 - #define ALT_LOG_BOOT_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 3 - #define ALT_LOG_BOOT_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == -1 /* silent mode */ - #define ALT_LOG_BOOT_ON_FLAG_SETTING 0x0 - #else /* default setting */ - #define ALT_LOG_BOOT_ON_FLAG_SETTING 0x1 - #endif - #endif /* ALT_LOG_BOOT_ON_FLAG_SETTING */ - - #ifndef ALT_LOG_SYS_CLK_ON_FLAG_SETTING - #if ALT_LOG_FLAGS == 1 - #define ALT_LOG_SYS_CLK_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 2 - #define ALT_LOG_SYS_CLK_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 3 - #define ALT_LOG_SYS_CLK_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == -1 /* silent mode */ - #define ALT_LOG_SYS_CLK_ON_FLAG_SETTING 0x0 - #else /* default setting */ - #define ALT_LOG_SYS_CLK_ON_FLAG_SETTING 0x0 - #endif - #endif /* ALT_LOG_SYS_CLK_ON_FLAG_SETTING */ - - #ifndef ALT_LOG_WRITE_ON_FLAG_SETTING - #if ALT_LOG_FLAGS == 1 - #define ALT_LOG_WRITE_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 2 - #define ALT_LOG_WRITE_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 3 - #define ALT_LOG_WRITE_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == -1 /* silent mode */ - #define ALT_LOG_WRITE_ON_FLAG_SETTING 0x0 - #else /* default setting */ - #define ALT_LOG_WRITE_ON_FLAG_SETTING 0x0 - #endif - #endif /* ALT_LOG_WRITE_ON_FLAG_SETTING */ - - #ifndef ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING - #ifndef __ALTERA_AVALON_JTAG_UART - #define ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 1 - #define ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 2 - #define ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 3 - #define ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == -1 /* silent mode */ - #define ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING 0x0 - #else /* default setting */ - #define ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING 0x0 - #endif - #endif /* ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING */ - - #ifndef ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING - #ifndef __ALTERA_AVALON_JTAG_UART - #define ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 1 - #define ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 2 - #define ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 3 - #define ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == -1 /* silent mode */ - #define ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING 0x0 - #else /* default setting */ - #define ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING 0x0 - #endif - #endif /* ALT_LOG_JTAG_UART_STARTUP_INFO_FLAG_SETTING */ - - #ifndef ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING - #ifndef __ALTERA_AVALON_JTAG_UART - #define ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 1 - #define ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 2 - #define ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 3 - #define ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == -1 /* silent mode */ - #define ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING 0x0 - #else /* default setting */ - #define ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING 0x0 - #endif - #endif /* ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING */ - -#ifndef ALT_ASM_SRC - /* Function Prototypes */ - void alt_log_txchar(int c,char *uartBase); - void alt_log_private_printf(const char *fmt,int base,va_list args); - void alt_log_repchar(char c,int r,int base); - int alt_log_printf_proc(const char *fmt, ... ); - void alt_log_system_clock(); - #ifdef __ALTERA_AVALON_JTAG_UART - alt_u32 altera_avalon_jtag_uart_report_log(void * context); - void alt_log_jtag_uart_startup_info(altera_avalon_jtag_uart_state* dev, int base); - void alt_log_jtag_uart_print_control_reg(altera_avalon_jtag_uart_state* dev, \ - int base, const char* header); - void alt_log_jtag_uart_isr_proc(int base, altera_avalon_jtag_uart_state* dev); - #endif - void alt_log_write(const void *ptr, size_t len); - - /* extern all global variables */ - extern volatile alt_u32 alt_log_boot_on_flag; - extern volatile alt_u8 alt_log_write_on_flag; - extern volatile alt_u8 alt_log_sys_clk_on_flag; - extern volatile alt_u8 alt_log_jtag_uart_alarm_on_flag; - extern volatile alt_u8 alt_log_jtag_uart_isr_on_flag; - extern volatile alt_u8 alt_log_jtag_uart_startup_info_on_flag; - extern volatile int alt_log_sys_clk_count; - extern volatile int alt_system_clock_in_sec; - extern alt_alarm alt_log_jtag_uart_alarm_1; -#endif /* ALT_ASM_SRC */ - - - /* Below are the MACRO defines used in various HAL files. They check - * if their specific flag is turned on; if it is, then it executes its - * code. - * - * To keep this file reasonable, most of these macros calls functions, - * which are defined in alt_log_printf.c. Look there for implementation - * details. */ - - /* Boot Messages Logging */ - #define ALT_LOG_PRINT_BOOT(...) \ - do { if (alt_log_boot_on_flag==1) {ALT_LOG_PRINTF(__VA_ARGS__);} \ - } while (0) - - /* JTAG UART Logging */ - /* number of ticks before alarm runs logging function */ - #ifndef ALT_LOG_JTAG_UART_TICKS_DIVISOR - #define ALT_LOG_JTAG_UART_TICKS_DIVISOR 10 - #endif - #ifndef ALT_LOG_JTAG_UART_TICKS - #define ALT_LOG_JTAG_UART_TICKS \ - (alt_ticks_per_second()/ALT_LOG_JTAG_UART_TICKS_DIVISOR) - #endif - - /* if there's a JTAG UART defined, then enable these macros */ - #ifdef __ALTERA_AVALON_JTAG_UART - - /* Macro in altera_avalon_jtag_uart.c, to register the alarm function. - * Also, the startup register info is also printed here, as this is - * called within the device driver initialization. */ - #define ALT_LOG_JTAG_UART_ALARM_REGISTER(dev, base) \ - do { if (alt_log_jtag_uart_alarm_on_flag==1) { \ - alt_alarm_start(&alt_log_jtag_uart_alarm_1, \ - ALT_LOG_JTAG_UART_TICKS, &altera_avalon_jtag_uart_report_log,\ - dev);} \ - if (alt_log_jtag_uart_startup_info_on_flag==1) {\ - alt_log_jtag_uart_startup_info(dev, base);} \ - } while (0) - - /* JTAG UART IRQ Logging (when buffer is empty) - * Inserted in the ISR in altera_avalon_jtag_uart.c */ - #define ALT_LOG_JTAG_UART_ISR_FUNCTION(base, dev) \ - do { alt_log_jtag_uart_isr_proc(base, dev); } while (0) - /* else, define macros to nothing. Or else the jtag_uart specific types - * will throw compiler errors */ - #else - #define ALT_LOG_JTAG_UART_ALARM_REGISTER(dev, base) - #define ALT_LOG_JTAG_UART_ISR_FUNCTION(base, dev) - #endif - - /* System clock logging - * How often (in seconds) the system clock logging prints. - * The default value is every 1 second */ - #ifndef ALT_LOG_SYS_CLK_INTERVAL_MULTIPLIER - #define ALT_LOG_SYS_CLK_INTERVAL_MULTIPLIER 1 - #endif - #ifndef ALT_LOG_SYS_CLK_INTERVAL - #define ALT_LOG_SYS_CLK_INTERVAL \ - (alt_ticks_per_second()*ALT_LOG_SYS_CLK_INTERVAL_MULTIPLIER) - #endif - - /* System clock logging - prints a message every interval (set above) - * to show that the system clock is alive. - * This macro is used in altera_avalon_timer_sc.c */ - #define ALT_LOG_SYS_CLK_HEARTBEAT() \ - do { alt_log_system_clock(); } while (0) - - /* alt_write_logging - echos a message every time write() is called, - * displays the first ALT_LOG_WRITE_ECHO_LEN characters. - * This macro is used in alt_write.c */ - #ifndef ALT_LOG_WRITE_ECHO_LEN - #define ALT_LOG_WRITE_ECHO_LEN 15 - #endif - - #define ALT_LOG_WRITE_FUNCTION(ptr,len) \ - do { alt_log_write(ptr,len); } while (0) - -#else /* ALT_LOG_ENABLE not defined */ - - /* logging is off, set all relevant macros to null */ - #define ALT_LOG_PRINT_BOOT(...) - #define ALT_LOG_PRINTF(...) - #define ALT_LOG_JTAG_UART_ISR_FUNCTION(base, dev) - #define ALT_LOG_JTAG_UART_ALARM_REGISTER(dev, base) - #define ALT_LOG_SYS_CLK_HEARTBEAT() - #define ALT_LOG_PUTS(str) - #define ALT_LOG_WRITE_FUNCTION(ptr,len) - -#endif /* ALT_LOG_ENABLE */ - -#endif /* __ALT_LOG_PRINTF_H__ */ - diff --git a/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_set_args.h b/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_set_args.h deleted file mode 100644 index 3750e67..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_set_args.h +++ /dev/null @@ -1,71 +0,0 @@ -#ifndef __ALT_SET_ARGS_H__ -#define __ALT_SET_ARGS_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The function alt_set_args() is provided in order to define the input - * arguments to main(). If this function is not called before main() then the - * argument list passed to main() will be empty. - * - * It is expected that this function will only be used by the ihost/iclient - * utility. - */ - -static inline void alt_set_args (int argc, char** argv, char** envp) -{ - extern int alt_argc; - extern char** alt_argv; - extern char** alt_envp; - - alt_argc = argc; - alt_argv = argv; - alt_envp = envp; -} - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_SET_ARGS_H__ */ diff --git a/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_sim.h b/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_sim.h deleted file mode 100644 index 06bd27a..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_sim.h +++ /dev/null @@ -1,91 +0,0 @@ -#ifndef __ALT_SIM_H__ -#define __ALT_SIM_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ -#include "system.h" -#include "alt_types.h" - -/* - * Instructions that might mean something special to a simulator. - * These have no special effect on real hardware (they are just nops). - */ -#define ALT_SIM_FAIL() \ - do { __asm volatile ("cmpltui r0, r0, 0xabc1"); } while (0) - -#define ALT_SIM_PASS() \ - do { __asm volatile ("cmpltui r0, r0, 0xabc2"); } while (0) - -#define ALT_SIM_IN_TOP_OF_HOT_LOOP() \ - do { __asm volatile ("cmpltui r0, r0, 0xabc3"); } while (0) - -/* - * Routine called on exit. - */ -static ALT_ALWAYS_INLINE void alt_sim_halt(int exit_code) -{ - int r2 = exit_code; - -#if defined(NIOS2_HAS_DEBUG_STUB) && (defined(ALT_BREAK_ON_EXIT) || defined(ALT_PROVIDE_GMON)) - - int r3 = (1 << 2); - -#ifdef ALT_PROVIDE_GMON - extern unsigned int alt_gmon_data[]; - int r4 = (int)alt_gmon_data; - r3 |= (1 << 4); -#define ALT_GMON_DATA ,"D04"(r4) -#else -#define ALT_GMON_DATA -#endif /* ALT_PROVIDE_GMON */ - - if (r2) { - ALT_SIM_FAIL(); - } else { - ALT_SIM_PASS(); - } - - __asm__ volatile ("\n0:\n\taddi %0,%0, -1\n\tbgt %0,zero,0b" : : "r" (ALT_CPU_FREQ/100) ); /* Delay for >30ms */ - - __asm__ volatile ("break 2" : : "D02"(r2), "D03"(r3) ALT_GMON_DATA ); - -#else /* !DEBUG_STUB */ - if (r2) { - ALT_SIM_FAIL(); - } else { - ALT_SIM_PASS(); - } -#endif /* DEBUG_STUB */ -} - -#define ALT_SIM_HALT(exit_code) \ - alt_sim_halt(exit_code) - -#endif /* __ALT_SIM_H__ */ diff --git a/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_stack.h b/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_stack.h deleted file mode 100644 index e30652a..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_stack.h +++ /dev/null @@ -1,126 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#ifndef __ALT_STACK_H__ -#define __ALT_STACK_H__ - -/* - * alt_stack.h is the nios2 specific implementation of functions used by the - * stack overflow code. - */ - -#include "nios2.h" - -#include "alt_types.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - - -extern char * alt_stack_limit_value; - -#ifdef ALT_EXCEPTION_STACK -extern char __alt_exception_stack_pointer[]; /* set by the linker */ -#endif /* ALT_EXCEPTION_STACK */ - - -/* - * alt_stack_limit can be called to determine the current value of the stack - * limit register. - */ - -static ALT_INLINE char * ALT_ALWAYS_INLINE alt_stack_limit (void) -{ - char * limit; - NIOS2_READ_ET(limit); - - return limit; -} - -/* - * alt_stack_pointer can be called to determine the current value of the stack - * pointer register. - */ - -static ALT_INLINE char * ALT_ALWAYS_INLINE alt_stack_pointer (void) -{ - char * pointer; - NIOS2_READ_SP(pointer); - - return pointer; -} - - -#ifdef ALT_EXCEPTION_STACK - -/* - * alt_exception_stack_pointer returns the normal stack pointer from - * where it is stored on the exception stack (uppermost 4 bytes). This - * is really only useful during exception processing, and is only - * available if a separate exception stack has been configured. - */ - -static ALT_INLINE char * ALT_ALWAYS_INLINE alt_exception_stack_pointer (void) -{ - return (char *) *(alt_u32 *)(__alt_exception_stack_pointer - sizeof(alt_u32)); -} - -#endif /* ALT_EXCEPTION_STACK */ - - -/* - * alt_set_stack_limit can be called to update the current value of the stack - * limit register. - */ - -static ALT_INLINE void ALT_ALWAYS_INLINE alt_set_stack_limit (char * limit) -{ - alt_stack_limit_value = limit; - NIOS2_WRITE_ET(limit); -} - -/* - * alt_report_stack_overflow reports that a stack overflow happened. - */ - -static ALT_INLINE void ALT_ALWAYS_INLINE alt_report_stack_overflow (void) -{ - NIOS2_REPORT_STACK_OVERFLOW(); -} - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_STACK_H__ */ - diff --git a/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_stdio.h b/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_stdio.h deleted file mode 100644 index 1730360..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_stdio.h +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef __ALT_STDIO_H__ -#define __ALT_STDIO_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * Definitions for ALT stdio routines. - */ - -#include - - -#ifdef __cplusplus -extern "C" { -#endif - -int alt_getchar(); -int alt_putchar(int c); -int alt_putstr(const char* str); -void alt_printf(const char *fmt, ...); - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_STDIO_H__ */ diff --git a/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_sys_init.h b/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_sys_init.h deleted file mode 100644 index e4abc28..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_sys_init.h +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef __ALT_SYS_INIT_H__ -#define __ALT_SYS_INIT_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The function alt_sys_init() is defined within the auto-generated file: - * alt_sys_init.c. This function calls the initilisation macros for all - * devices, file systems, and software components within the system. - * - * The list of initilisation macros to use is constructed using the PTF and - * STF files associated with the system. - */ - -extern void alt_sys_init (void); - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_SYS_INIT_H__ */ diff --git a/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_sys_wrappers.h b/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_sys_wrappers.h deleted file mode 100644 index 044833b..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_sys_wrappers.h +++ /dev/null @@ -1,100 +0,0 @@ -#ifndef __ALT_SYS_WRAPPERS_H__ -#define __ALT_SYS_WRAPPERS_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * This file provides the prototypes for the HAL 'UNIX style functions. The - * names of these functions are defined in alt_syscall.h. THese are defined to - * be the standard names when running the standalone HAL, e.g. open(), close() - * etc., but the names may be redefined as a part of an operating system port - * in order to avoid name clashes. - */ - -#include "os/alt_syscall.h" - -#include -#include -#include -#include -#include -#include - -extern int ALT_CLOSE (int __fd); -extern int ALT_EXECVE (const char *__path, - char * const __argv[], - char * const __envp[]); -extern void ALT_EXIT (int __status); -extern int ALT_FSTAT (int file, struct stat *st); -extern int ALT_FCNTL (int file, int cmd, ...); -extern pid_t ALT_FORK (void); -extern pid_t ALT_GETPID (void); - -#if defined (__GNUC__) && __GNUC__ >= 4 -extern int ALT_GETTIMEOFDAY (struct timeval *ptimeval, - void *ptimezone); -#else -extern int ALT_GETTIMEOFDAY (struct timeval *ptimeval, - struct timezone *ptimezone); -#endif - -extern int ALT_IOCTL (int file, int req, void* arg); -extern int ALT_ISATTY (int file); -extern int ALT_KILL (int pid, int sig); -extern int ALT_LINK (const char *existing, const char *new); -extern off_t ALT_LSEEK (int file, off_t ptr, int dir); -extern int ALT_OPEN (const char* file, int flags, ...); -extern int ALT_READ (int file, void *ptr, size_t len); -extern int ALT_RENAME (char *existing, char *new); -extern void* ALT_SBRK (ptrdiff_t incr); -extern int ALT_SETTIMEOFDAY (const struct timeval *t, - const struct timezone *tz); -extern int ALT_STAT (const char *file, struct stat *st); -extern clock_t ALT_TIMES (struct tms *buf); -extern int ALT_UNLINK (const char *name); - -#if defined (__GNUC__) && __GNUC__ >= 4 -int ALT_USLEEP (useconds_t us); -#else -unsigned int ALT_USLEEP (unsigned int us); -#endif - -extern int ALT_WAIT (int *status); -extern int ALT_WRITE (int file, const void *ptr, size_t len); - - -extern char** ALT_ENVIRON; - -/* - * - */ - -#endif /* __ALT_SYS_WRAPPERS_H__ */ diff --git a/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_timestamp.h b/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_timestamp.h deleted file mode 100644 index 8a18da2..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_timestamp.h +++ /dev/null @@ -1,60 +0,0 @@ -#ifndef __ALT_TIMESTAMP_H__ -#define __ALT_TIMESTAMP_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "alt_types.h" -#include "altera_avalon_timer.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -extern int alt_timestamp_start (void); - -extern alt_timestamp_type alt_timestamp (void); - -extern alt_u32 alt_timestamp_freq (void); - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_TIMESTAMP_H__ */ diff --git a/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_warning.h b/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_warning.h deleted file mode 100644 index b66e71a..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/alt_warning.h +++ /dev/null @@ -1,75 +0,0 @@ -#ifndef __WARNING_H__ -#define __WARNING_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * alt_warning.h provides macro definitions that can be used to generate link - * time warnings. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The symbol "__alt_invalid" is used to force a link error. There should be - * no corresponding implementation of this function. - */ - -extern void __alt_invalid (void); - -#define ALT_LINK_WARNING(symbol, msg) \ - __asm__(".ifndef __evoke_link_warning_" #symbol \ - "\n\t .section .gnu.warning." #symbol \ - "\n__evoke_link_warning_" #symbol ":\n\t .string \x22" msg "\x22 \n\t .previous" \ - "\n .endif"); - -/* A canned warning for sysdeps/stub functions. */ - -#define ALT_STUB_WARNING(name) \ - ALT_LINK_WARNING (name, \ - "warning: " #name " is not implemented and will always fail") - -#define ALT_OBSOLETE_FUNCTION_WARNING(name) \ - ALT_LINK_WARNING (name, \ - "warning: " #name " is a deprecated function") - -#define ALT_LINK_ERROR(msg) \ - ALT_LINK_WARNING (__alt_invalid, msg); \ - __alt_invalid() - -#ifdef __cplusplus -} -#endif - -#endif /* __WARNING_H__ */ diff --git a/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/ioctl.h b/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/ioctl.h deleted file mode 100644 index 4d565df..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/ioctl.h +++ /dev/null @@ -1,90 +0,0 @@ -#ifndef __IOCTL_H__ -#define __IOCTL_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The ioctl() system call be used to initiate a variety of control operations - * on a file descriptor. For the most part this simply translates to a call to - * the ioctl() function of the associated device driver (TIOCEXCL and - * TIOCNXCL are notable exceptions - see ioctl.c for details). - * - * The interpretation of the ioctl requests are therefore device specific. - * - * This function is equivalent to the standard Posix ioctl() call. - */ - -extern int ioctl (int fd, int req, void* arg); - -/* - * list of ioctl calls handled by the system ioctl implementation. - */ - -#define TIOCEXCL 0x740d /* exclusive use of the device */ -#define TIOCNXCL 0x740e /* allow multiple use of the device */ - -/* - * ioctl calls which can be handled by device drivers. - */ - -#define TIOCOUTQ 0x7472 /* get output queue size */ -#define TIOCMGET 0x741d /* get termios flags */ -#define TIOCMSET 0x741a /* set termios flags */ - -/* - * ioctl calls specific to JTAG UART. - */ - -#define TIOCSTIMEOUT 0x6a01 /* Set Timeout before assuming no host present */ -#define TIOCGCONNECTED 0x6a02 /* Get indication of whether host is connected */ - -/* - * - */ - -#ifdef __cplusplus -} -#endif - -#endif /* __IOCTL_H__ */ diff --git a/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/termios.h b/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/termios.h deleted file mode 100644 index cd09539..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/inc/sys/termios.h +++ /dev/null @@ -1,181 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * This is the termios.h file provided with newlib. The only modification has - * been to the baud rate macro definitions, and an increase in the size of the - * termios structure to accomodate this. - */ - - -#ifndef _SYS_TERMIOS_H -# define _SYS_TERMIOS_H - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -# define _XCGETA (('x'<<8)|1) -# define _XCSETA (('x'<<8)|2) -# define _XCSETAW (('x'<<8)|3) -# define _XCSETAF (('x'<<8)|4) -# define _TCSBRK (('T'<<8)|5) -# define _TCFLSH (('T'<<8)|7) -# define _TCXONC (('T'<<8)|6) - -# define TCOOFF 0 -# define TCOON 1 -# define TCIOFF 2 -# define TCION 3 - -# define TCIFLUSH 0 -# define TCOFLUSH 1 -# define TCIOFLUSH 2 - -# define NCCS 13 - -# define TCSAFLUSH _XCSETAF -# define TCSANOW _XCSETA -# define TCSADRAIN _XCSETAW -# define TCSADFLUSH _XCSETAF - -# define IGNBRK 000001 -# define BRKINT 000002 -# define IGNPAR 000004 -# define INPCK 000020 -# define ISTRIP 000040 -# define INLCR 000100 -# define IGNCR 000200 -# define ICRNL 000400 -# define IXON 002000 -# define IXOFF 010000 - -# define OPOST 000001 -# define OCRNL 000004 -# define ONLCR 000010 -# define ONOCR 000020 -# define TAB3 014000 - -# define CLOCAL 004000 -# define CREAD 000200 -# define CSIZE 000060 -# define CS5 0 -# define CS6 020 -# define CS7 040 -# define CS8 060 -# define CSTOPB 000100 -# define HUPCL 002000 -# define PARENB 000400 -# define PAODD 001000 - -#define CCTS_OFLOW 010000 -#define CRTS_IFLOW 020000 -#define CRTSCTS (CCTS_OFLOW | CRTS_IFLOW) - -# define ECHO 0000010 -# define ECHOE 0000020 -# define ECHOK 0000040 -# define ECHONL 0000100 -# define ICANON 0000002 -# define IEXTEN 0000400 /* anybody know *what* this does?! */ -# define ISIG 0000001 -# define NOFLSH 0000200 -# define TOSTOP 0001000 - -# define VEOF 4 /* also VMIN -- thanks, AT&T */ -# define VEOL 5 /* also VTIME -- thanks again */ -# define VERASE 2 -# define VINTR 0 -# define VKILL 3 -# define VMIN 4 /* also VEOF */ -# define VQUIT 1 -# define VSUSP 10 -# define VTIME 5 /* also VEOL */ -# define VSTART 11 -# define VSTOP 12 - -# define B0 0 -# define B50 50 -# define B75 75 -# define B110 110 -# define B134 134 -# define B150 150 -# define B200 200 -# define B300 300 -# define B600 600 -# define B1200 1200 -# define B1800 1800 -# define B2400 2400 -# define B4800 4800 -# define B9600 9600 -# define B19200 19200 -# define B38400 38400 -# define B57600 57600 -# define B115200 115200 - -typedef unsigned char cc_t; -typedef unsigned short tcflag_t; -typedef unsigned long speed_t; - -struct termios { - tcflag_t c_iflag; - tcflag_t c_oflag; - tcflag_t c_cflag; - tcflag_t c_lflag; - char c_line; - cc_t c_cc[NCCS]; - speed_t c_ispeed; - speed_t c_ospeed; -}; - -# ifndef _NO_MACROS - -# define cfgetospeed(tp) ((tp)->c_ospeed) -# define cfgetispeed(tp) ((tp)->c_ispeed) -# define cfsetospeed(tp,s) (((tp)->c_ospeed = (s)), 0) -# define cfsetispeed(tp,s) (((tp)->c_ispeed = (s)), 0) -# define tcdrain(fd) _ioctl (fd, _TCSBRK, 1) -# endif /* _NO_MACROS */ - -#ifdef __cplusplus -} -#endif - -#endif /* _SYS_TERMIOS_H */ - diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_alarm_start.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_alarm_start.c deleted file mode 100644 index 7739959..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_alarm_start.c +++ /dev/null @@ -1,112 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "sys/alt_alarm.h" -#include "sys/alt_irq.h" - -/* - * alt_alarm_start is called to register an alarm with the system. The - * "alarm" structure passed as an input argument does not need to be - * initialised by the user. This is done within this function. - * - * The remaining input arguments are: - * - * nticks - The time to elapse until the alarm executes. This is specified in - * system clock ticks. - * callback - The function to run when the indicated time has elapsed. - * context - An opaque value, passed to the callback function. -* - * Care should be taken when defining the callback function since it is - * likely to execute in interrupt context. In particular, this mean that - * library calls like printf() should not be made, since they can result in - * deadlock. - * - * The interval to be used for the next callback is the return - * value from the callback function. A return value of zero indicates that the - * alarm should be unregistered. - * - * alt_alarm_start() will fail if the timer facility has not been enabled - * (i.e. there is no system clock). Failure is indicated by a negative return - * value. - */ - -int alt_alarm_start (alt_alarm* alarm, alt_u32 nticks, - alt_u32 (*callback) (void* context), - void* context) -{ - alt_irq_context irq_context; - alt_u32 current_nticks = 0; - - if (alt_ticks_per_second ()) - { - if (alarm) - { - alarm->callback = callback; - alarm->context = context; - - irq_context = alt_irq_disable_all (); - - current_nticks = alt_nticks(); - - alarm->time = nticks + current_nticks + 1; - - /* - * If the desired alarm time causes a roll-over, set the rollover - * flag. This will prevent the subsequent tick event from causing - * an alarm too early. - */ - if(alarm->time < current_nticks) - { - alarm->rollover = 1; - } - else - { - alarm->rollover = 0; - } - - alt_llist_insert (&alt_alarm_list, &alarm->llist); - alt_irq_enable_all (irq_context); - - return 0; - } - else - { - return -EINVAL; - } - } - else - { - return -ENOTSUP; - } -} diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_busy_sleep.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_busy_sleep.c deleted file mode 100644 index 561c0be..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_busy_sleep.c +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright (c) 2003-2004 Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - * - * ------------ - * - * Altera does not recommend, suggest or require that this reference design - * file be used in conjunction or combination with any other product. - * - * alt_busy_sleep.c - Microsecond delay routine which uses a calibrated busy - * loop to perform the delay. This is used to implement - * usleep for both uC/OS-II and the standalone HAL. - * - * Author PRR - * - * Calibrated delay with no timer required - * - * The ASM instructions in the routine are equivalent to - * - * for (i=0;i -#include - -#include "system.h" -#include "alt_types.h" - -#include "priv/alt_busy_sleep.h" - -unsigned int alt_busy_sleep (unsigned int us) -{ -/* - * Only delay if ALT_SIM_OPTIMIZE is not defined; i.e., if software - * is built targetting ModelSim RTL simulation, the delay will be - * skipped to speed up simulation. - */ -#ifndef ALT_SIM_OPTIMIZE - int i; - int big_loops; - alt_u32 cycles_per_loop; - - if (!strcmp(NIOS2_CPU_IMPLEMENTATION,"tiny")) - { - cycles_per_loop = 9; - } - else - { - cycles_per_loop = 3; - } - - - big_loops = us / (INT_MAX/ - (ALT_CPU_FREQ/(cycles_per_loop * 1000000))); - - if (big_loops) - { - for(i=0;i - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -#ifdef ALT_USE_DIRECT_DRIVERS - -int ALT_CLOSE (int fildes) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(close); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -/* - * close() is called by an application to release a file descriptor. If the - * associated file system/device has a close() callback function registered - * then this called. The file descriptor is then marked as free. - * - * ALT_CLOSE is mapped onto the close() system call in alt_syscall.h - */ - -int ALT_CLOSE (int fildes) -{ - alt_fd* fd; - int rval; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (fildes < 0) ? NULL : &alt_fd_list[fildes]; - - if (fd) - { - /* - * If the associated file system/device has a close function, call it so - * that any necessary cleanup code can run. - */ - - rval = (fd->dev->close) ? fd->dev->close(fd) : 0; - - /* Free the file descriptor structure and return. */ - - alt_release_fd (fildes); - if (rval < 0) - { - ALT_ERRNO = -rval; - return -1; - } - return 0; - } - else - { - ALT_ERRNO = EBADFD; - return -1; - } -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_dcache_flush.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_dcache_flush.c deleted file mode 100644 index 7ecc91a..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_dcache_flush.c +++ /dev/null @@ -1,97 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "nios2.h" -#include "system.h" - -#include "alt_types.h" -#include "sys/alt_cache.h" - -/* - * Nios II version 1.2 and newer supports the "flush by address" instruction, in - * addition to the "flush by line" instruction provided by older versions of - * the core. This newer instruction is used by preference when it is - * available. - */ - -#ifdef NIOS2_FLUSHDA_SUPPORTED -#define ALT_FLUSH_DATA(i) __asm__ volatile ("flushda (%0)" :: "r" (i)); -#else -#define ALT_FLUSH_DATA(i) __asm__ volatile ("flushd (%0)" :: "r" (i)); -#endif /* NIOS2_FLUSHDA_SUPPORTED */ - -/* - * alt_dcache_flush() is called to flush the data cache for a memory - * region of length "len" bytes, starting at address "start". - * - * Any dirty lines in the data cache are written back to memory. - */ - -void alt_dcache_flush (void* start, alt_u32 len) -{ -#if NIOS2_DCACHE_SIZE > 0 - - char* i; - char* end; - - /* - * This is the most we would ever need to flush. - * - * SPR 196942, 2006.01.13: The cache flush loop below will use the - * 'flushda' instruction if its available; in that case each line - * must be flushed individually, and thus 'len' cannot be trimmed. - */ - #ifndef NIOS2_FLUSHDA_SUPPORTED - if (len > NIOS2_DCACHE_SIZE) - { - len = NIOS2_DCACHE_SIZE; - } - #endif - - end = ((char*) start) + len; - - for (i = start; i < end; i+= NIOS2_DCACHE_LINE_SIZE) - { - ALT_FLUSH_DATA(i); - } - - /* - * For an unaligned flush request, we've got one more line left. - * Note that this is dependent on NIOS2_DCACHE_LINE_SIZE to be a - * multiple of 2 (which it always is). - */ - - if (((alt_u32) start) & (NIOS2_DCACHE_LINE_SIZE - 1)) - { - ALT_FLUSH_DATA(i); - } - -#endif /* NIOS2_DCACHE_SIZE > 0 */ -} diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_dcache_flush_all.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_dcache_flush_all.c deleted file mode 100644 index 6529231..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_dcache_flush_all.c +++ /dev/null @@ -1,51 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "nios2.h" -#include "system.h" - -#include "alt_types.h" -#include "sys/alt_cache.h" - -/* - * alt_dcache_flush_all() is called to flush the entire data cache. - */ - -void alt_dcache_flush_all (void) -{ -#if NIOS2_DCACHE_SIZE > 0 - char* i; - - for (i = (char*) 0; i < (char*) NIOS2_DCACHE_SIZE; i+= NIOS2_DCACHE_LINE_SIZE) - { - __asm__ volatile ("flushd (%0)" :: "r" (i)); - } -#endif /* NIOS2_DCACHE_SIZE > 0 */ -} diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_dcache_flush_no_writeback.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_dcache_flush_no_writeback.c deleted file mode 100644 index c65ca7d..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_dcache_flush_no_writeback.c +++ /dev/null @@ -1,88 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "nios2.h" -#include "system.h" - -#include "alt_types.h" -#include "sys/alt_cache.h" - -/* - * The INITDA instruction was added to Nios II in the 8.0 release. - * - * The INITDA instruction has one of the following possible behaviors - * depending on the processor configuration: - * 1) Flushes a line by address but does NOT write back dirty data. - * Occurs when a data cache is present that supports INITDA. - * The macro NIOS2_INITDA_SUPPORTED is defined in system.h. - * 2) Takes an unimplemented instruction exception. - * Occurs when a data cache is present that doesn't support INITDA. - * 3) Performs no operation - * Occurs when there is no data cache present. - * The macro NIOS2_DCACHE_SIZE is 0 in system.h. - */ - -#define ALT_FLUSH_DATA_NO_WRITEBACK(i) \ - __asm__ volatile ("initda (%0)" :: "r" (i)); - -/* - * alt_dcache_flush_no_writeback() is called to flush the data cache for a - * memory region of length "len" bytes, starting at address "start". - * - * Any dirty lines in the data cache are NOT written back to memory. - * Make sure you really want this behavior. If you aren't 100% sure, - * use the alt_dcache_flush() routine instead. - */ - -void alt_dcache_flush_no_writeback (void* start, alt_u32 len) -{ -#if defined(NIOS2_INITDA_SUPPORTED) - - char* i; - char* end = ((char*) start) + len; - - for (i = start; i < end; i+= NIOS2_DCACHE_LINE_SIZE) - { - ALT_FLUSH_DATA_NO_WRITEBACK(i); - } - - /* - * For an unaligned flush request, we've got one more line left. - * Note that this is dependent on NIOS2_DCACHE_LINE_SIZE to be a - * multiple of 2 (which it always is). - */ - - if (((alt_u32) start) & (NIOS2_DCACHE_LINE_SIZE - 1)) - { - ALT_FLUSH_DATA_NO_WRITEBACK(i); - } - -#endif /* NIOS2_INITDA_SUPPORTED */ -} diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_dev.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_dev.c deleted file mode 100644 index ebc15e5..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_dev.c +++ /dev/null @@ -1,149 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include -#include -#include - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - -#include "alt_types.h" - -#include "system.h" - -/* - * This file contains the data constructs used to control access to device and - * filesytems. - */ - -/* - * "alt_fs_list" is the head of a linked list of registered filesystems. It is - * initialised as an empty list. New entries can be added using the - * alt_fs_reg() function. - */ - -ALT_LLIST_HEAD(alt_fs_list); - - -/* - * "alt_dev_list" is the head of a linked list of registered devices. It is - * configured at startup to include a single device, "alt_dev_null". This - * device is discussed below. - */ - -extern alt_dev alt_dev_null; /* forward declaration */ - -alt_llist alt_dev_list = {&alt_dev_null.llist, &alt_dev_null.llist}; - -/* - * alt_dev_null_write() is the implementation of the write() function used - * by the alt_dev_null device. It simple discards all data passed to it, and - * indicates that the data has been successfully transmitted. - */ - -static int alt_dev_null_write (alt_fd* fd, const char* ptr, int len) -{ - return len; -} - -/* - * "alt_dev_null" is used to allow output to be redirected to nowhere. It is - * the only device registered before the call to alt_sys_init(). At startup - * stin, stdout & stderr are all directed towards this device so that library - * calls like printf() will be safe but inefectual. - */ - -alt_dev alt_dev_null = { - { - &alt_dev_list, - &alt_dev_list - }, - "/dev/null", - NULL, /* open */ - NULL, /* close */ - NULL, /* write */ - alt_dev_null_write, /* write */ - NULL, /* lseek */ - NULL, /* fstat */ - NULL /* ioctl */ - }; - -/* - * "alt_fd_list_lock" is a semaphore used to control access to the file - * descriptor list. This is used to ensure that access to the list is thread - * safe. - */ - -ALT_SEM(alt_fd_list_lock) - -/* - * "alt_max_fd" is used to make access to the file descriptor list more - * efficent. It is set to be the value of the highest allocated file - * descriptor. This saves having to search the entire pool of unallocated - * file descriptors when looking for a match. - */ - -alt_32 alt_max_fd = -1; - -/* - * "alt_fd_list" is the file descriptor pool. The first three entries in the - * array are configured as standard in, standard out, and standard error. These - * are all initialised so that accesses are directed to the alt_dev_null - * device. The remaining file descriptors are initialised as unallocated. - * - * The maximum number of file descriptors within the system is specified by the - * user defined macro "ALT_MAX_FD". This is defined in "system.h", which is - * auto-genereated using the projects PTF and STF files. - */ - -alt_fd alt_fd_list[ALT_MAX_FD] = - { - { - &alt_dev_null, /* standard in */ - 0, - 0 - }, - { - &alt_dev_null, /* standard out */ - 0, - 0 - }, - { - &alt_dev_null, /* standard error */ - 0, - 0 - } - /* all other elements are set to zero */ - }; diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_dev_llist_insert.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_dev_llist_insert.c deleted file mode 100644 index fa7239d..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_dev_llist_insert.c +++ /dev/null @@ -1,59 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "priv/alt_dev_llist.h" -#include "sys/alt_errno.h" - -/* - * - */ - -int alt_dev_llist_insert (alt_dev_llist* dev, alt_llist* list) -{ - /* - * check that the device exists, and that it has a valid name. - */ - - if (!dev || !dev->name) - { - ALT_ERRNO = EINVAL; - return -EINVAL; - } - - /* - * register the device. - */ - - alt_llist_insert(list, &dev->llist); - - return 0; -} diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_dma_rxchan_open.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_dma_rxchan_open.c deleted file mode 100644 index 6ea3b78..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_dma_rxchan_open.c +++ /dev/null @@ -1,63 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_dma.h" -#include "sys/alt_errno.h" -#include "priv/alt_file.h" - -/* - * The list of registered DMA receive channels. - */ - -ALT_LLIST_HEAD(alt_dma_rxchan_list); - -/* - * alt_dma_txchan_open() is used to obtain an "alt_dma_txchan" descriptor for - * a DMA transmit device. The name is the name of the associated physical - * device (e.g. "/dev/dma_0"). - * - * The return value will be NULL on failure, and non-NULL otherwise. - */ - -alt_dma_rxchan alt_dma_rxchan_open (const char* name) -{ - alt_dma_rxchan dev; - - dev = (alt_dma_rxchan) alt_find_dev (name, &alt_dma_rxchan_list); - - if (!dev) - { - ALT_ERRNO = ENODEV; - } - - return dev; -} diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_dma_txchan_open.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_dma_txchan_open.c deleted file mode 100644 index f41fa81..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_dma_txchan_open.c +++ /dev/null @@ -1,63 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_dma.h" -#include "sys/alt_errno.h" -#include "priv/alt_file.h" - -/* - * The list of registered receive channels. - */ - -ALT_LLIST_HEAD(alt_dma_txchan_list); - -/* - * alt_dma_txchan_open() is used to obtain an "alt_dma_txchan" descriptor for - * a DMA transmit device. The name is the name of the associated physical - * device (e.g. "/dev/dma_0"). - * - * The return value will be NULL on failure, and non-NULL otherwise. - */ - -alt_dma_txchan alt_dma_txchan_open (const char* name) -{ - alt_dma_txchan dev; - - dev = (alt_dma_txchan) alt_find_dev (name, &alt_dma_txchan_list); - - if (!dev) - { - ALT_ERRNO = ENODEV; - } - - return dev; -} diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_do_ctors.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_do_ctors.c deleted file mode 100644 index ff5a1f7..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_do_ctors.c +++ /dev/null @@ -1,64 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT IT DIRECTLY. * -* * -* Overriding HAL Functions * -* * -* To provide your own implementation of a HAL function, include the file in * -* your Nios II IDE application project. When building the executable, the * -* Nios II IDE finds your function first, and uses it in place of the HAL * -* version. * -* * -******************************************************************************/ - -/* - * - */ - -typedef void (*constructor) (void); -extern constructor __CTOR_LIST__[]; -extern constructor __CTOR_END__[]; - -/* - * Run the C++ static constructors. - */ - -void _do_ctors(void) -{ - constructor* ctor; - - for (ctor = &__CTOR_END__[-1]; ctor >= __CTOR_LIST__; ctor--) - (*ctor) (); -} diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_do_dtors.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_do_dtors.c deleted file mode 100644 index 565c99f..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_do_dtors.c +++ /dev/null @@ -1,64 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT IT DIRECTLY. * -* * -* Overriding HAL Functions * -* * -* To provide your own implementation of a HAL function, include the file in * -* your Nios II IDE application project. When building the executable, the * -* Nios II IDE finds your function first, and uses it in place of the HAL * -* version. * -* * -******************************************************************************/ - -/* - * - */ - -typedef void (*destructor) (void); -extern destructor __DTOR_LIST__[]; -extern destructor __DTOR_END__[]; - -/* - * Run the C++ static destructors. - */ - -void _do_dtors(void) -{ - destructor* dtor; - - for (dtor = &__DTOR_END__[-1]; dtor >= __DTOR_LIST__; dtor--) - (*dtor) (); -} diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_env_lock.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_env_lock.c deleted file mode 100644 index fc25a0c..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_env_lock.c +++ /dev/null @@ -1,53 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -/* - * These are the empty env lock/unlock stubs required by newlib. These are - * used to make accesses to environment variables thread safe. The default HAL - * configuration is single threaded, so there is nothing to do here. Note that - * this requires that environment variables are never manipulated by an interrupt - * service routine. - */ - -void __env_lock ( struct _reent *_r ) -{ -} - -/* - * - */ - -void __env_unlock ( struct _reent *_r ) -{ -} diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_environ.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_environ.c deleted file mode 100644 index 404efc4..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_environ.c +++ /dev/null @@ -1,42 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "os/alt_syscall.h" - -/* - * These are the environment variables passed to the C code. By default there - * are no variables registered. An application can manipulate this list using - * getenv() and setenv(). - */ - -char *__env[1] = { 0 }; -char **ALT_ENVIRON = __env; diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_errno.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_errno.c deleted file mode 100644 index 1d8368d..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_errno.c +++ /dev/null @@ -1,44 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/* - * This file defines the alt_errno global variable. See comments in - * alt_errno.h for the use of this variable. - */ - - -#include "sys/alt_errno.h" -#include "alt_types.h" - -extern int ALT_WEAK *__errno (void); - -int* (*alt_errno) (void) = __errno; diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_exception_entry.S b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_exception_entry.S deleted file mode 100644 index 3afab93..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_exception_entry.S +++ /dev/null @@ -1,360 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2008 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "system.h" - -/* - * This is the exception entry point code, which saves all the caller saved - * registers and then handles the appropriate exception. It should be pulled - * in using a .globl from all the exception handler routines. This scheme is - * used so that if an interrupt is never registered, then this code will not - * appear in the generated executable, thereby improving code footprint. - * - * If an external interrpt controller (EIC) is present, it will supply an - * interrupt vector address to the processor when an interrupt occurs. For - * The Altera Vectored Interrupt Controller (VIC) driver will establish a - * vector table and the processor will jump directly to the appropriate - * table entry, funnel routine, and then user ISR. This will bypass this code - * in entirety. This code might still be linked into a system with an EIC, - * but would then be used only for non-interrupt exceptions. - */ - - /* - * Explicitly allow the use of r1 (the assembler temporary register) - * within this code. This register is normally reserved for the use of - * the assembler. - */ - .set noat - - /* - * The top and bottom of the exception stack - */ -#ifdef ALT_EXCEPTION_STACK - - .globl __alt_exception_stack_pointer - -#ifdef ALT_STACK_CHECK - - .globl __alt_exception_stack_limit - - /* - * We need to store the value of the stack limit after interrupt somewhere. - */ - .globl alt_exception_old_stack_limit - -#endif -#endif - - .section .exceptions.entry.label, "xa" - - .globl alt_exception - .type alt_exception, @function -alt_exception: - - .section .exceptions.entry, "xa" - -#ifdef ALT_EXCEPTION_STACK - -#ifdef ALT_STACK_CHECK - stw et, %gprel(alt_exception_old_stack_limit)(gp) -#endif - - movhi et, %hiadj(__alt_exception_stack_pointer - 80) - addi et, et, %lo(__alt_exception_stack_pointer - 80) - stw sp, 76(et) - mov sp, et - -#ifdef ALT_STACK_CHECK - movhi et, %hiadj(__alt_exception_stack_limit) - addi et, et, %lo(__alt_exception_stack_limit) - stw et, %gprel(alt_stack_limit_value)(gp) -#endif - -#else - /* - * Process an exception. For all exceptions we must preserve all - * caller saved registers on the stack (See the Nios2 ABI - * documentation for details). - */ - - addi sp, sp, -76 - -#ifdef ALT_STACK_CHECK - - bltu sp, et, .Lstack_overflow - -#endif - -#endif - - stw ra, 0(sp) - - /* - * Leave a gap in the stack frame at 4(sp) for the muldiv handler to - * store zero into. - */ - - stw r1, 8(sp) - stw r2, 12(sp) - stw r3, 16(sp) - stw r4, 20(sp) - stw r5, 24(sp) - stw r6, 28(sp) - stw r7, 32(sp) - - rdctl r5, estatus - - stw r8, 36(sp) - stw r9, 40(sp) - stw r10, 44(sp) - stw r11, 48(sp) - stw r12, 52(sp) - stw r13, 56(sp) - stw r14, 60(sp) - stw r15, 64(sp) - - /* - * ea-4 contains the address of the instruction being executed - * when the exception occured. For interrupt exceptions, we will - * will be re-issue the isntruction. Store it in 72(sp) - */ - stw r5, 68(sp) /* estatus */ - addi r15, ea, -4 /* instruction that caused exception */ - stw r15, 72(sp) - - /* - * The interrupt testing code (.exceptions.irqtest) will be - * linked here. If the Internal Interrupt Controller (IIC) is - * present (an EIC is not present), the presense of an interrupt - * is determined by examining CPU control registers or an interrupt - * custom instruction, if present. - * - * If the IIC is used and an interrupt is active, the code linked - * here will call the HAL IRQ handler (alt_irq_handler()) which - * successively calls registered interrupt handler(s) until no - * interrupts remain pending. It then jumps to .exceptions.exit. If - * there is no interrupt then it continues to .exception.notirq, below. - */ - - .section .exceptions.notirq, "xa" - - /* - * Prepare to service unimplemtned instructions or traps, - * each of which is optionally inked into section .exceptions.soft, - * which will preceed .exceptions.unknown below. - * - * Unlike interrupts, we want to skip the exception-causing instructon - * upon completion, so we write ea (address of instruction *after* - * the one where the exception occured) into 72(sp). The actual - * instruction that caused the exception is written in r2, which these - * handlers will utilize. - */ - stw ea, 72(sp) /* Don't re-issue */ - ldw r2, -4(ea) /* Instruction that caused exception */ - - /* - * Other exception handling code, if enabled, will be linked here. - * This includes unimplemted (multiply/divide) instruction support - * (a BSP generaton option), and a trap handler (that would typically - * be augmented with user-specific code). These are not linked in by - * default. - */ - - /* - * In the context of linker sections, "unknown" are all exceptions - * not handled by the built-in handlers above (interupt, and trap or - * unimplemented instruction decoding, if enabled). - * - * Advanced exception types can be serviced by registering a handler. - * To do so, enable the "Enable Instruction-related Exception API" HAL - * BSP setting. If this setting is disabled, this handler code will - * either break (if the debug core is present) or enter an infinite - * loop because we don't how how to handle the exception. - */ - .section .exceptions.unknown -#ifdef ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API - /* - * The C-based HAL routine alt_instruction_exception_entry() will - * attempt to service the exception by calling a user-registered - * exception handler using alt_instruction_exception_register(). - * If no handler was registered it will either break (if the - * debugger is present) or go into an infinite loop since the - * handling behavior is undefined; in that case we will not return here. - */ - - /* Load exception-causing address as first argument (r4) */ - addi r4, ea, -4 - - /* Call the instruction-exception entry */ - call alt_instruction_exception_entry - - /* - * If alt_instruction_exception_entry() returned, the exception was - * serviced by a user-registered routine. Its return code (now in r2) - * indicates whether to re-issue or skip the exception-causing - * instruction - * - * Return code was 0: Skip. The instruction after the exception is - * already stored in 72(sp). - */ - bne r2, r0, .Lexception_exit - - /* - * Otherwise, modify 72(sp) to re-issue the instruction that caused the - * exception. - */ - addi r15, ea, -4 /* instruction that caused exception */ - stw r15, 72(sp) - -#else /* ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API disabled */ - - /* - * We got here because an instruction-related exception occured, but the - * handler API was not compiled in. We do not presume to know how to - * handle it. If the debugger is present, break, otherwise hang. - * - * If you get here then one of the following could have happened: - * - * - An instruction-generated exception occured, and the processor - * does not have the extra exceptions feature enabled, or you - * have not registered a handler using - * alt_instruction_exception_register() - * - * Some examples of instruction-generated exceptions and why they - * might occur: - * - * - Your program could have been compiled for a full-featured - * Nios II core, but it is running on a smaller core, and - * instruction emulation has been disabled by defining - * ALT_NO_INSTRUCTION_EMULATION. - * - * You can work around the problem by re-enabling instruction - * emulation, or you can figure out why your program is being - * compiled for a system other than the one that it is running on. - * - * - Your program has executed a trap instruction, but has not - * implemented a handler for this instruction. - * - * - Your program has executed an illegal instruction (one which is - * not defined in the instruction set). - * - * - Your processor includes an MMU or MPU, and you have enabled it - * before registering an exception handler to service exceptions it - * generates. - * - * The problem could also be hardware related: - * - If your hardware is broken and is generating spurious interrupts - * (a peripheral which negates its interrupt output before its - * interrupt handler has been executed will cause spurious - * interrupts) - */ -#ifdef NIOS2_HAS_DEBUG_STUB - /* - * Either tell the user now (if there is a debugger attached) or go into - * the debug monitor which will loop until a debugger is attached. - */ - break -#else - /* - * If there is no debug stub then a BREAK will probably cause a reboot. - * An infinate loop will probably be more useful. - */ -0: - br 0b -#endif /* NIOS2_HAS_DEBUG_STUB */ - -#endif /* ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API */ - - .section .exceptions.exit.label -.Lexception_exit: - - .section .exceptions.exit, "xa" - - /* - * Restore the saved registers, so that all general purpose registers - * have been restored to their state at the time the interrupt occured. - */ - - ldw r5, 68(sp) - ldw ea, 72(sp) /* This becomes the PC once eret is executed */ - ldw ra, 0(sp) - - wrctl estatus, r5 - - ldw r1, 8(sp) - ldw r2, 12(sp) - ldw r3, 16(sp) - ldw r4, 20(sp) - ldw r5, 24(sp) - ldw r6, 28(sp) - ldw r7, 32(sp) - -#ifdef ALT_EXCEPTION_STACK -#ifdef ALT_STACK_CHECK - ldw et, %gprel(alt_exception_old_stack_limit)(gp) -#endif -#endif - - ldw r8, 36(sp) - ldw r9, 40(sp) - ldw r10, 44(sp) - ldw r11, 48(sp) - ldw r12, 52(sp) - ldw r13, 56(sp) - ldw r14, 60(sp) - ldw r15, 64(sp) - -#ifdef ALT_EXCEPTION_STACK - -#ifdef ALT_STACK_CHECK - stw et, %gprel(alt_stack_limit_value)(gp) - stw zero, %gprel(alt_exception_old_stack_limit)(gp) -#endif - - ldw sp, 76(sp) - -#else - addi sp, sp, 76 - -#endif - - /* - * Return to the interrupted instruction. - */ - - eret - -#ifdef ALT_STACK_CHECK - -.Lstack_overflow: - break 3 - -#endif - diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_exception_muldiv.S b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_exception_muldiv.S deleted file mode 100644 index 55617a6..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_exception_muldiv.S +++ /dev/null @@ -1,583 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - - /* - * This is the software multiply/divide handler for Nios2. - */ - - /* - * Provide a label which can be used to pull this file in. - */ - - .section .exceptions.start - .globl alt_exception_muldiv -alt_exception_muldiv: - - /* - * Pull in the entry/exit code. - */ - .globl alt_exception - - - .section .exceptions.soft, "xa" - - - /* INSTRUCTION EMULATION - * --------------------- - * - * Nios II processors generate exceptions for unimplemented instructions. - * The routines below emulate these instructions. Depending on the - * processor core, the only instructions that might need to be emulated - * are div, divu, mul, muli, mulxss, mulxsu, and mulxuu. - * - * The emulations match the instructions, except for the following - * limitations: - * - * 1) The emulation routines do not emulate the use of the exception - * temporary register (et) as a source operand because the exception - * handler already has modified it. - * - * 2) The routines do not emulate the use of the stack pointer (sp) or the - * exception return address register (ea) as a destination because - * modifying these registers crashes the exception handler or the - * interrupted routine. - * - * 3) To save code size, the routines do not emulate the use of the - * breakpoint registers (ba and bt) as operands. - * - * Detailed Design - * --------------- - * - * The emulation routines expect the contents of integer registers r0-r31 - * to be on the stack at addresses sp, 4(sp), 8(sp), ... 124(sp). The - * routines retrieve source operands from the stack and modify the - * destination register's value on the stack prior to the end of the - * exception handler. Then all registers except the destination register - * are restored to their previous values. - * - * The instruction that causes the exception is found at address -4(ea). - * The instruction's OP and OPX fields identify the operation to be - * performed. - * - * One instruction, muli, is an I-type instruction that is identified by - * an OP field of 0x24. - * - * muli AAAAA,BBBBB,IIIIIIIIIIIIIIII,-0x24- - * 27 22 6 0 <-- LSB of field - * - * The remaining emulated instructions are R-type and have an OP field - * of 0x3a. Their OPX fields identify them. - * - * R-type AAAAA,BBBBB,CCCCC,XXXXXX,NNNNN,-0x3a- - * 27 22 17 11 6 0 <-- LSB of field - * - * - */ - - - /* - * Split the instruction into its fields. We need 4*A, 4*B, and 4*C as - * offsets to the stack pointer for access to the stored register values. - */ - /* r2 = AAAAA,BBBBB,IIIIIIIIIIIIIIII,PPPPPP */ - roli r3, r2, 7 /* r3 = BBB,IIIIIIIIIIIIIIII,PPPPPP,AAAAA,BB */ - roli r4, r3, 3 /* r4 = IIIIIIIIIIIIIIII,PPPPPP,AAAAA,BBBBB */ - roli r6, r4, 2 /* r6 = IIIIIIIIIIIIII,PPPPPP,AAAAA,BBBBB,II */ - srai r4, r4, 16 /* r4 = (sign-extended) IMM16 */ - xori r6, r6, 0x42 /* r6 = CCC,XXXXXX,NNNNN,PPPPPP,AAAAA,bBBBB,cC */ - roli r7, r6, 5 /* r7 = XXXX,NNNNN,PPPPPP,AAAAA,bBBBB,cCCCC,XX */ - andi r5, r2, 0x3f /* r5 = 00000000000000000000000000,PPPPPP */ - xori r3, r3, 0x40 - andi r3, r3, 0x7c /* r3 = 0000000000000000000000000,aAAAA,00 */ - andi r6, r6, 0x7c /* r6 = 0000000000000000000000000,bBBBB,00 */ - andi r7, r7, 0x7c /* r7 = 0000000000000000000000000,cCCCC,00 */ - - /* Now either - * r5 = OP - * r3 = 4*(A^16) - * r4 = IMM16 (sign extended) - * r6 = 4*(B^16) - * r7 = 4*(C^16) - * or - * r5 = OP - */ - - - /* - * Save everything on the stack to make it easy for the emulation routines - * to retrieve the source register operands. The exception entry code has - * already saved some of this so we don't need to do it all again. - */ - - addi sp, sp, -60 - stw zero, 64(sp) /* Save zero on stack to avoid special case for r0. */ - /* Register at and r2-r15 have already been saved. */ - - stw r16, 0(sp) - stw r17, 4(sp) - stw r18, 8(sp) - stw r19, 12(sp) - stw r20, 16(sp) - stw r21, 20(sp) - stw r22, 24(sp) - stw r23, 28(sp) - /* et @ 32 - Has already been changed.*/ - /* bt @ 36 - Usually isn't an operand. */ - stw gp, 40(sp) - stw sp, 44(sp) - stw fp, 48(sp) - /* ea @ 52 - Don't bother to save - it's already been changed */ - /* ba @ 56 - Breakpoint register usually isn't an operand */ - /* ra @ 60 - Has already been saved */ - - - /* - * Prepare for either multiplication or division loop. - * They both loop 32 times. - */ - movi r14, 32 - - - /* - * Get the operands. - * - * It is necessary to check for muli because it uses an I-type instruction - * format, while the other instructions are have an R-type format. - */ - add r3, r3, sp /* r3 = address of A-operand. */ - ldw r3, 0(r3) /* r3 = A-operand. */ - movi r15, 0x24 /* muli opcode (I-type instruction format) */ - beq r5, r15, .Lmul_immed /* muli doesn't use the B register as a source */ - - add r6, r6, sp /* r6 = address of B-operand. */ - ldw r6, 0(r6) /* r6 = B-operand. */ - /* r4 = SSSSSSSSSSSSSSSS,-----IMM16------ */ - /* IMM16 not needed, align OPX portion */ - /* r4 = SSSSSSSSSSSSSSSS,CCCCC,-OPX--,00000 */ - srli r4, r4, 5 /* r4 = 00000,SSSSSSSSSSSSSSSS,CCCCC,-OPX-- */ - andi r4, r4, 0x3f /* r4 = 00000000000000000000000000,-OPX-- */ - - /* Now - * r5 = OP - * r3 = src1 - * r6 = src2 - * r4 = OPX (no longer can be muli) - * r7 = 4*(C^16) - * r14 = loop counter - */ - - /* ILLEGAL-INSTRUCTION EXCEPTION - * ----------------------------- - * - * This code is for Nios II cores that generate exceptions when attempting - * to execute illegal instructions. Nios II cores that support an - * illegal-instruction exception are identified by the presence of the - * macro definition NIOS2_HAS_ILLEGAL_INSTRUCTION_EXCEPTION in system.h . - * - * Remember that illegal instructions are different than unimplemented - * instructions. Illegal instructions are instruction encodings that - * have not been defined by the Nios II ISA. Unimplemented instructions - * are legal instructions that must be emulated by some Nios II cores. - * - * If we get here, all instructions except multiplies and divides - * are illegal. - * - * This code assumes that OP is not muli (because muli was tested above). - * All other multiplies and divides are legal. Anything else is illegal. - */ - - movi r8, 0x3a /* OP for R-type mul* and div* */ - bne r5, r8, .Lnot_muldiv - - /* r15 already is 0x24 */ /* OPX of divu */ - beq r4, r15, .Ldivide - - movi r15,0x27 /* OPX of mul */ - beq r4, r15, .Lmultiply - - movi r15,0x07 /* OPX of mulxuu */ - beq r4, r15, .Lmultiply - - movi r15,0x17 /* OPX of mulxsu */ - beq r4, r15, .Lmultiply - - movi r15,0x1f /* OPX of mulxss */ - beq r4, r15, .Lmultiply - - movi r15,0x25 /* OPX of div */ - bne r4, r15, .Lnot_muldiv - - - /* DIVISION - * - * Divide an unsigned dividend by an unsigned divisor using - * a shift-and-subtract algorithm. The example below shows - * 43 div 7 = 6 for 8-bit integers. This classic algorithm uses a - * single register to store both the dividend and the quotient, - * allowing both values to be shifted with a single instruction. - * - * remainder dividend:quotient - * --------- ----------------- - * initialize 00000000 00101011: - * shift 00000000 0101011:_ - * remainder >= divisor? no 00000000 0101011:0 - * shift 00000000 101011:0_ - * remainder >= divisor? no 00000000 101011:00 - * shift 00000001 01011:00_ - * remainder >= divisor? no 00000001 01011:000 - * shift 00000010 1011:000_ - * remainder >= divisor? no 00000010 1011:0000 - * shift 00000101 011:0000_ - * remainder >= divisor? no 00000101 011:00000 - * shift 00001010 11:00000_ - * remainder >= divisor? yes 00001010 11:000001 - * remainder -= divisor - 00000111 - * ---------- - * 00000011 11:000001 - * shift 00000111 1:000001_ - * remainder >= divisor? yes 00000111 1:0000011 - * remainder -= divisor - 00000111 - * ---------- - * 00000000 1:0000011 - * shift 00000001 :0000011_ - * remainder >= divisor? no 00000001 :00000110 - * - * The quotient is 00000110. - */ - -.Ldivide: - /* - * Prepare for division by assuming the result - * is unsigned, and storing its "sign" as 0. - */ - movi r17, 0 - - - /* Which division opcode? */ - xori r15, r4, 0x25 /* OPX of div */ - bne r15, zero, .Lunsigned_division - - - /* - * OPX is div. Determine and store the sign of the quotient. - * Then take the absolute value of both operands. - */ - xor r17, r3, r6 /* MSB contains sign of quotient */ - bge r3, zero, 0f - sub r3, zero, r3 /* -r3 */ -0: - bge r6, zero, 0f - sub r6, zero, r6 /* -r6 */ -0: - - -.Lunsigned_division: - /* Initialize the unsigned-division loop. */ - movi r13, 0 /* remainder = 0 */ - - /* Now - * r3 = dividend : quotient - * r4 = 0x25 for div, 0x24 for divu - * r6 = divisor - * r13 = remainder - * r14 = loop counter (already initialized to 32) - * r17 = MSB contains sign of quotient - */ - - - /* - * for (count = 32; count > 0; --count) - * { - */ -.Ldivide_loop: - - /* - * Division: - * - * (remainder:dividend:quotient) <<= 1; - */ - slli r13, r13, 1 - cmplt r15, r3, zero /* r15 = MSB of r3 */ - or r13, r13, r15 - slli r3, r3, 1 - - - /* - * if (remainder >= divisor) - * { - * set LSB of quotient - * remainder -= divisor; - * } - */ - bltu r13, r6, .Ldiv_skip - ori r3, r3, 1 - sub r13, r13, r6 -.Ldiv_skip: - - /* - * } - */ - subi r14, r14, 1 - bne r14, zero, .Ldivide_loop - - mov r9, r3 - - - /* Now - * r9 = quotient - * r4 = 0x25 for div, 0x24 for divu - * r7 = 4*(C^16) - * r17 = MSB contains sign of quotient - */ - - - /* - * Conditionally negate signed quotient. If quotient is unsigned, - * the sign already is initialized to 0. - */ - bge r17, zero, .Lstore_result - sub r9, zero, r9 /* -r9 */ - - br .Lstore_result - - - - - /* MULTIPLICATION - * - * A "product" is the number that one gets by summing a "multiplicand" - * several times. The "multiplier" specifies the number of copies of the - * multiplicand that are summed. - * - * Actual multiplication algorithms don't use repeated addition, however. - * Shift-and-add algorithms get the same answer as repeated addition, and - * they are faster. To compute the lower half of a product (pppp below) - * one shifts the product left before adding in each of the partial products - * (a * mmmm) through (d * mmmm). - * - * To compute the upper half of a product (PPPP below), one adds in the - * partial products (d * mmmm) through (a * mmmm), each time following the - * add by a right shift of the product. - * - * mmmm - * * abcd - * ------ - * #### = d * mmmm - * #### = c * mmmm - * #### = b * mmmm - * #### = a * mmmm - * -------- - * PPPPpppp - * - * The example above shows 4 partial products. Computing actual Nios II - * products requires 32 partials. - * - * It is possible to compute the result of mulxsu from the result of mulxuu - * because the only difference between the results of these two opcodes is - * the value of the partial product associated with the sign bit of rA. - * - * mulxsu = mulxuu - ((rA < 0) ? rB : 0); - * - * It is possible to compute the result of mulxss from the result of mulxsu - * because the only difference between the results of these two opcodes is - * the value of the partial product associated with the sign bit of rB. - * - * mulxss = mulxsu - ((rB < 0) ? rA : 0); - * - */ - -.Lmul_immed: - /* Opcode is muli. Change it into mul for remainder of algorithm. */ - mov r7, r6 /* Field B is dest register, not field C. */ - mov r6, r4 /* Field IMM16 is src2, not field B. */ - movi r4, 0x27 /* OPX of mul is 0x27 */ - -.Lmultiply: - /* Initialize the multiplication loop. */ - movi r9, 0 /* mul_product = 0 */ - movi r10, 0 /* mulxuu_product = 0 */ - mov r11, r6 /* save original multiplier for mulxsu and mulxss */ - mov r12, r6 /* mulxuu_multiplier (will be shifted) */ - movi r16, 1 /* used to create "rori B,A,1" from "ror B,A,r16" */ - - /* Now - * r3 = multiplicand - * r6 = mul_multiplier - * r7 = 4 * dest_register (used later as offset to sp) - * r9 = mul_product - * r10 = mulxuu_product - * r11 = original multiplier - * r12 = mulxuu_multiplier - * r14 = loop counter (already initialized) - * r15 = temp - * r16 = 1 - */ - - - /* - * for (count = 32; count > 0; --count) - * { - */ -.Lmultiply_loop: - - /* - * mul_product <<= 1; - * lsb = multiplier & 1; - */ - slli r9, r9, 1 - andi r15, r12, 1 - - /* - * if (lsb == 1) - * { - * mulxuu_product += multiplicand; - * } - */ - beq r15, zero, .Lmulx_skip - add r10, r10, r3 - cmpltu r15, r10, r3 /* Save the carry from the MSB of mulxuu_product. */ - ror r15, r15, r16 /* r15 = 0x80000000 on carry, or else 0x00000000 */ -.Lmulx_skip: - - /* - * if (MSB of mul_multiplier == 1) - * { - * mul_product += multiplicand; - * } - */ - bge r6, zero, .Lmul_skip - add r9, r9, r3 -.Lmul_skip: - - /* - * mulxuu_product >>= 1; logical shift - * mul_multiplier <<= 1; done with MSB - * mulx_multiplier >>= 1; done with LSB - */ - srli r10, r10, 1 - or r10, r10, r15 /* OR in the saved carry bit. */ - slli r6, r6, 1 - srli r12, r12, 1 - - - /* - * } - */ - subi r14, r14, 1 - bne r14, zero, .Lmultiply_loop - - - /* - * Multiply emulation loop done. - */ - - /* Now - * r3 = multiplicand - * r4 = OPX - * r7 = 4 * dest_register (used later as offset to sp) - * r9 = mul_product - * r10 = mulxuu_product - * r11 = original multiplier - * r15 = temp - */ - - - /* - * Select/compute the result based on OPX. - */ - - - /* OPX == mul? Then store. */ - xori r15, r4, 0x27 - beq r15, zero, .Lstore_result - - /* It's one of the mulx.. opcodes. Move over the result. */ - mov r9, r10 - - /* OPX == mulxuu? Then store. */ - xori r15, r4, 0x07 - beq r15, zero, .Lstore_result - - /* Compute mulxsu - * - * mulxsu = mulxuu - ((rA < 0) ? rB : 0); - */ - bge r3, zero, .Lmulxsu_skip - sub r9, r9, r11 -.Lmulxsu_skip: - - /* OPX == mulxsu? Then store. */ - xori r15, r4, 0x17 - beq r15, zero, .Lstore_result - - /* Compute mulxss - * - * mulxss = mulxsu - ((rB < 0) ? rA : 0); - */ - bge r11, zero, .Lmulxss_skip - sub r9, r9, r3 -.Lmulxss_skip: - /* At this point, assume that OPX is mulxss, so store */ - - -.Lstore_result: - add r7, r7, sp - stw r9, 0(r7) - - ldw r16, 0(sp) - ldw r17, 4(sp) - ldw r18, 8(sp) - ldw r19, 12(sp) - ldw r20, 16(sp) - ldw r21, 20(sp) - ldw r22, 24(sp) - ldw r23, 28(sp) - - /* bt @ 32 - Breakpoint register usually isn't an operand. */ - /* et @ 36 - Don't corrupt et. */ - /* gp @ 40 - Don't corrupt gp. */ - /* sp @ 44 - Don't corrupt sp. */ - ldw fp, 48(sp) - /* ea @ 52 - Don't corrupt ea. */ - /* ba @ 56 - Breakpoint register usually isn't an operand. */ - - addi sp, sp, 60 - - br .Lexception_exit - - -.Lnot_muldiv: - - addi sp, sp, 60 - - - .section .exceptions.exit.label -.Lexception_exit: - diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_exception_trap.S b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_exception_trap.S deleted file mode 100644 index 60a3d40..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_exception_trap.S +++ /dev/null @@ -1,81 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - - /* - * This is the trap exception handler for Nios2. - */ - - /* - * Provide a label which can be used to pull this file in. - */ - - .section .exceptions.start - .globl alt_exception_trap -alt_exception_trap: - - /* - * Pull in the entry/exit code. - */ - .globl alt_exception - - .section .exceptions.soft, "xa" - -.Ltrap_handler: - - /* - * Did a trap instruction cause the exception? - * - * The instruction which the exception occurred on has been loaded - * into r2 by code in alt_exception_entry.S - * - */ - - movhi r3,0x003b /* upper half of trap opcode */ - ori r3,r3,0x683a /* lower half of trap opcode */ - bne r2,r3,.Lnot_trap - - /* - * There is no trap handler defined here, and so executing a trap - * instruction causes a software break. If you provide a trap handler, - * then you must replace the break instruction below with your handler. - * Your handler must preserve ea and the usual callee saved registers. - */ - - break - - br .Lexception_exit - -.Lnot_trap: - - - .section .exceptions.exit.label -.Lexception_exit: - - diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_execve.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_execve.c deleted file mode 100644 index 27b99cf..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_execve.c +++ /dev/null @@ -1,55 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "os/alt_syscall.h" - -/* - * execve() is used by newlib to launch new processes. This is unsupported in - * the HAL environment. However a "do-nothing" implementation is still - * provied for newlib compatability. - * - * ALT_EXECVE is mapped onto the execve() system call in alt_syscall.h - */ - -int ALT_EXECVE (char *name, char ** argv, char** env) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(execve); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_exit.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_exit.c deleted file mode 100644 index 971b35e..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_exit.c +++ /dev/null @@ -1,71 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_irq.h" -#include "sys/alt_sim.h" -#include "os/alt_hooks.h" -#include "os/alt_syscall.h" - -#include "alt_types.h" -#include "sys/alt_log_printf.h" -/* - * _exit() is called by exit() in order to terminate the current process. - * Typically this is called when main() completes. It should never return. - * Since there is nowhere to go once this process completes, this - * implementation simply blocks forever. - * - * Note that interrupts are not disabled so that execution outside of this - * thread is allowed to continue. - * - * ALT_EXIT is mapped onto the _exit() system call in alt_syscall.h - */ - -void ALT_EXIT (int exit_code) -{ - /* ALT_LOG - please see HAL/inc/alt_log_printf.h for details */ - ALT_LOG_PRINT_BOOT("[alt_exit.c] Entering _exit() function.\r\n"); - ALT_LOG_PRINT_BOOT("[alt_exit.c] Exit code from main was %d.\r\n",exit_code); - /* Stop all other threads */ - - ALT_LOG_PRINT_BOOT("[alt_exit.c] Calling ALT_OS_STOP().\r\n"); - ALT_OS_STOP(); - - /* Provide notification to the simulator that we've stopped */ - - ALT_LOG_PRINT_BOOT("[alt_exit.c] Calling ALT_SIM_HALT().\r\n"); - ALT_SIM_HALT(exit_code); - - /* spin forever, since there's no where to go back to */ - - ALT_LOG_PRINT_BOOT("[alt_exit.c] Spinning forever.\r\n"); - while (1); -} diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_fcntl.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_fcntl.c deleted file mode 100644 index 69c1544..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_fcntl.c +++ /dev/null @@ -1,101 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include -#include - -#include "sys/alt_errno.h" -#include "priv/alt_file.h" -#include "alt_types.h" -#include "os/alt_syscall.h" - -#define ALT_FCNTL_FLAGS_MASK ((alt_u32) (O_APPEND | O_NONBLOCK)) - -/* - * fcntl() is a limited implementation of the standard fcntl() system call. - * It can be used to change the state of the flags associated with an open - * file descriptor. Normally these flags are set during the call to - * open(). It is anticipated that the main use of this function will be to - * change the state of a device from blocking to non-blocking (where this is - * supported). - * - * The input argument "fd" is the file descriptor to be manipulated. "cmd" - * is the command to execute. This can be either F_GETFL (return the - * current value of the flags) or F_SETFL (set the value of the flags). - * - * If "cmd" is F_SETFL then the argument "arg" is the new value of flags, - * otherwise "arg" is ignored. Only the flags: O_APPEND and O_NONBLOCK - * can be updated by a call to fcntl(). All other flags remain - * unchanged. - * - * ALT_FCNTL is mapped onto the fcntl() system call in alt_syscall.h - */ - -int ALT_FCNTL (int file, int cmd, ...) -{ - alt_fd* fd; - long flags; - va_list argp; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - switch (cmd) - { - case F_GETFL: - return fd->fd_flags & ~((alt_u32) ALT_FD_FLAGS_MASK); - case F_SETFL: - va_start(argp, cmd); - flags = va_arg(argp, long); - fd->fd_flags &= ~ALT_FCNTL_FLAGS_MASK; - fd->fd_flags |= (flags & ALT_FCNTL_FLAGS_MASK); - va_end(argp); - return 0; - default: - ALT_ERRNO = EINVAL; - return -1; - } - } - - ALT_ERRNO = EBADFD; - return -1; -} diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_fd_lock.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_fd_lock.c deleted file mode 100644 index 0e2a85d..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_fd_lock.c +++ /dev/null @@ -1,75 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "priv/alt_file.h" - -/* - * alt_fd_lock() is called as a consequence of an ioctl call to gain exclusive - * access to a device, i.e.: - * - * ioctl (fd, TIOCEXCL, NULL); - * - * If there are no other open file descriptors which reference the same - * device, then alt_fd_lock() will grant the lock. Further calls to open() - * for this device will fail until the lock is released. - * - * This is done by calling close() for this file descriptor, or by calling: - * - * ioctl (fd, TIOCNXCL, NULL); - * - * The return value is zero for success, or negative in the case of failure. - */ - -int alt_fd_lock (alt_fd* fd) -{ - int i; - int rc = 0; - - ALT_SEM_PEND(alt_fd_list_lock, 0); - - for (i = 0; i < alt_max_fd; i++) - { - if ((&alt_fd_list[i] != fd) && (alt_fd_list[i].dev == fd->dev)) - { - rc = -EACCES; - goto alt_fd_lock_exit; - } - } - fd->fd_flags |= ALT_FD_EXCL; - - alt_fd_lock_exit: - - ALT_SEM_POST(alt_fd_list_lock); - return rc; -} diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_fd_unlock.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_fd_unlock.c deleted file mode 100644 index fb700dc..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_fd_unlock.c +++ /dev/null @@ -1,56 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "priv/alt_file.h" - -/* - * alt_fd_unlock() is the inverse of alt_fd_lock(). It is called as a - * consequence of a TIOCNXCL ioctl request, e.g: - * - * ioctl (fd, TIOCNXCL, NULL); - * - * It enables multiple file descriptors to exist for the same device. This - * is normally the case, but it may have been disabled by a previous call to - * alt_fd_lock(). - * - * Return zero on sucess, and a negative value on failure. - * - * The current implementation always succeeds. - */ - -int alt_fd_unlock (alt_fd* fd) -{ - fd->fd_flags &= ~ALT_FD_EXCL; - return 0; -} diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_find_dev.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_find_dev.c deleted file mode 100644 index 37aefa4..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_find_dev.c +++ /dev/null @@ -1,88 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - -#include "alt_types.h" - -/* - * alt_find_dev() is used by open() in order to locate a previously registered - * device with the name "name". The input argument "llist" is a pointer to the - * head of the device list to search. - * - * The return value is a pointer to the matching device, or NULL if there is - * no match. - * - * "name" must be an exact match for the devices registered name for a match to - * be found. - */ - -alt_dev* alt_find_dev(const char* name, alt_llist* llist) -{ - alt_dev* next = (alt_dev*) llist->next; - alt_32 len; - - len = strlen(name) + 1; - - /* - * Check each list entry in turn, until a match is found, or we reach the - * end of the list (i.e. next winds up pointing back to the list head). - */ - - while (next != (alt_dev*) llist) - { - - /* - * memcmp() is used here rather than strcmp() in order to reduce the size - * of the executable. - */ - - if (!memcmp (next->name, name, len)) - { - /* match found */ - - return next; - } - next = (alt_dev*) next->llist.next; - } - - /* No match found */ - - return NULL; -} - - diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_find_file.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_find_file.c deleted file mode 100644 index 2d97ec2..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_find_file.c +++ /dev/null @@ -1,89 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - -#include "alt_types.h" - -/* - * alt_find_file() is used by open() in order to locate a previously registered - * filesystem that owns that mount point that contains the file named "name". - * - * The return value is a pointer to the matching filesystem, or NULL if there is - * no match. - * - * A match is considered to have been found if the filesystem name followed by - * either '/' or '\0' is the prefix of the filename. For example the filename: - * "/myfilesystem/junk.txt" would match: "/myfilesystem", but not: "/myfile". - */ - -alt_dev* alt_find_file (const char* name) -{ - alt_dev* next = (alt_dev*) alt_fs_list.next; - - alt_32 len; - - /* - * Check each list entry in turn, until a match is found, or we reach the - * end of the list (i.e. next winds up pointing back to the list head). - */ - - while (next != (alt_dev*) &alt_fs_list) - { - len = strlen(next->name); - - if (next->name[len-1] == '/') - { - len -= 1; - } - - if (((name[len] == '/') || (name[len] == '\0')) && - !memcmp (next->name, name, len)) - { - /* match found */ - - return next; - } - next = (alt_dev*) next->llist.next; - } - - /* No match found */ - - return NULL; -} - - diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_flash_dev.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_flash_dev.c deleted file mode 100644 index 213f721..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_flash_dev.c +++ /dev/null @@ -1,69 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* Alt_flash.c - Functions to register a flash device to the "generic" flash * -* interface * -* * -* Author PRR * -* * -******************************************************************************/ - -#include -#include "sys/alt_llist.h" -#include "sys/alt_flash_dev.h" -#include "priv/alt_file.h" - -ALT_LLIST_HEAD(alt_flash_dev_list); - -alt_flash_fd* alt_flash_open_dev(const char* name) -{ - alt_flash_dev* dev = (alt_flash_dev*)alt_find_dev(name, &alt_flash_dev_list); - - if ((dev) && dev->open) - { - return dev->open(dev, name); - } - - return dev; -} - -void alt_flash_close_dev(alt_flash_fd* fd) -{ - if (fd && fd->close) - { - fd->close(fd); - } - return; -} - diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_fork.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_fork.c deleted file mode 100644 index ce74df0..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_fork.c +++ /dev/null @@ -1,57 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_warning.h" -#include "sys/alt_errno.h" -#include "os/alt_syscall.h" - -/* - * The fork() system call is used by newlib to create a duplicate copy of the - * curent process. This is unsupported in the HAL environment. However a - * "do-nothing" implementation is still provied for newlib compatability. - * - * ALT_FORK is mapped onto the fork() system call in alt_syscall.h - */ - -int ALT_FORK (void) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(fork); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} - - diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_fs_reg.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_fs_reg.c deleted file mode 100644 index 13437a1..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_fs_reg.c +++ /dev/null @@ -1,75 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - -/* - * The alt_fs_reg() function is used to register a file system. Once registered - * a device can be accessed using the standard posix calls: open(), read(), - * write() etc. - * - * System behaviour is undefined in the event that a file system is registered - * with a name that conflicts with an existing device or file system. - * - * alt_fs_reg() is not thread safe in the sense that there should be no other - * thread using the file system list at the time that alt_dev_reg() is called. In - * practice this means that alt_fs_reg() should only be called while operating - * in a single threaded mode. The expectation is that it will only be called - * by the file system initilisation functions invoked by alt_sys_init(), which in - * turn should only be called by the single threaded C startup code. - * - * A return value of zero indicates success. A negative return value indicates - * failure. - */ - -int alt_fs_reg (alt_dev* dev) -{ - /* - * check that the device has a name. - */ - - if (!dev->name) - { - return -ENODEV; - } - - /* - * register the file system. - */ - - alt_llist_insert(&alt_fs_list, &dev->llist); - - return 0; -} diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_fstat.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_fstat.c deleted file mode 100644 index af5d527..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_fstat.c +++ /dev/null @@ -1,128 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include "sys/alt_dev.h" -#include "sys/alt_warning.h" -#include "sys/alt_errno.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -/* - * The fstat() system call is used to obtain information about the capabilities - * of an open file descriptor. By default file descriptors are marked as - * being character devices. If a device or file system wishes to advertise - * alternative capabilities then they can register an fstat() function within - * their associated alt_dev structure. This will be called to fill in the - * entries in the imput "st" structure. - * - * This function is provided for compatability with newlib. - * - * ALT_FSTAT is mapped onto the fstat() system call in alt_syscall.h - */ - -#ifdef ALT_USE_DIRECT_DRIVERS - -#include "system.h" - -/* - * Provide minimal version that just describes all file descriptors - * as character devices for provided stdio devices. - */ -int ALT_FSTAT (int file, struct stat *st) -{ - switch (file) { -#ifdef ALT_STDIN_PRESENT - case 0: /* stdin file descriptor */ -#endif /* ALT_STDIN_PRESENT */ -#ifdef ALT_STDOUT_PRESENT - case 1: /* stdout file descriptor */ -#endif /* ALT_STDOUT_PRESENT */ -#ifdef ALT_STDERR_PRESENT - case 2: /* stderr file descriptor */ -#endif /* ALT_STDERR_PRESENT */ - st->st_mode = _IFCHR; - return 0; - default: - return -1; - } - -#if !defined(ALT_STDIN_PRESENT) && !defined(ALT_STDOUT_PRESENT) && !defined(ALT_STDERR_PRESENT) - /* Generate a link time warning, should this function ever be called. */ - ALT_STUB_WARNING(fstat); -#endif -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -int ALT_FSTAT (int file, struct stat *st) -{ - alt_fd* fd; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - /* Call the drivers fstat() function to fill out the "st" structure. */ - - if (fd->dev->fstat) - { - return fd->dev->fstat(fd, st); - } - - /* - * If no function is provided, mark the fd as belonging to a character - * device. - */ - - else - { - st->st_mode = _IFCHR; - return 0; - } - } - else - { - ALT_ERRNO = EBADFD; - return -1; - } -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_get_fd.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_get_fd.c deleted file mode 100644 index db17b2c..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_get_fd.c +++ /dev/null @@ -1,105 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - -#include "alt_types.h" - -#include "system.h" - -/* - * alt_get_fd() is called to allocate a new file descriptor from the file - * descriptor pool. If a file descriptor is succesfully allocated, it is - * configured to refer to device "dev". - * - * The return value is the index of the file descriptor structure (i.e. - * the offset of the file descriptor within the file descriptor array). A - * negative value indicates failure. - */ - -int alt_get_fd (alt_dev* dev) -{ - alt_32 i; - int rc = -EMFILE; - - /* - * Take the alt_fd_list_lock semaphore in order to avoid races when - * accessing the file descriptor pool. - */ - - ALT_SEM_PEND(alt_fd_list_lock, 0); - - /* - * Search through the list of file descriptors, and allocate the first - * free descriptor that's found. - * - * If a free descriptor is found, then the value of "alt_max_fd" is - * updated accordingly. "alt_max_fd" is a 'highwater mark' which - * indicates the highest file descriptor ever allocated. This is used to - * improve efficency when searching the file descriptor list, and - * therefore reduce contention on the alt_fd_list_lock semaphore. - */ - - for (i = 0; i < ALT_MAX_FD; i++) - { - if (!alt_fd_list[i].dev) - { - alt_fd_list[i].dev = dev; - if (i > alt_max_fd) - { - alt_max_fd = i; - } - rc = i; - goto alt_get_fd_exit; - } - } - - alt_get_fd_exit: - - /* - * Release the alt_fd_list_lock semaphore now that we are done with the - * file descriptor pool. - */ - - ALT_SEM_POST(alt_fd_list_lock); - - return rc; -} - - - - diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_getchar.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_getchar.c deleted file mode 100644 index a8f50d5..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_getchar.c +++ /dev/null @@ -1,61 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#ifdef ALT_USE_DIRECT_DRIVERS -#include "system.h" -#include "sys/alt_driver.h" -#include "sys/alt_stdio.h" -#include "priv/alt_file.h" -#include "unistd.h" -#endif - -/* - * Uses the ALT_DRIVER_READ() macro to call directly to driver if available. - * Otherwise, uses newlib provided getchar() routine. - */ -int -alt_getchar(void) -{ -#ifdef ALT_USE_DIRECT_DRIVERS - ALT_DRIVER_READ_EXTERNS(ALT_STDIN_DEV); - char c; - - if (ALT_DRIVER_READ(ALT_STDIN_DEV, &c, 1, alt_fd_list[STDIN_FILENO].fd_flags) <= 0) { - return -1; - } - return c; -#else - return getchar(); -#endif -} diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_getpid.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_getpid.c deleted file mode 100644 index 2228c7e..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_getpid.c +++ /dev/null @@ -1,47 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "os/alt_syscall.h" - -/* - * The getpid() system call is used by newlib to obtain the current process - * id. Since there is only ever a single process in the HAL environment, - * this just returns a constant. - * - * ALT_GETPID is mapped onto the getpid() system call in alt_syscall.h - */ - -int ALT_GETPID (void) -{ - return 0; -} - diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_gettod.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_gettod.c deleted file mode 100644 index ed86cba..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_gettod.c +++ /dev/null @@ -1,125 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include - -#include "sys/alt_alarm.h" -#include "alt_types.h" -#include "os/alt_syscall.h" - -/* - * Macro defining the number of micoseconds in a second. - */ - -#define ALT_US (1000000) - -/* - * "alt_timezone" and "alt_resettime" are the values of the the reset time and - * time zone set through the last call to settimeofday(). By default they are - * zero initialised. - */ - -struct timezone alt_timezone = {0, 0}; -struct timeval alt_resettime = {0, 0}; - -/* - * gettimeofday() can be called to obtain a time structure which indicates the - * current "wall clock" time. This is calculated using the elapsed number of - * system clock ticks, and the value of "alt_resettime" and "alt_timezone" set - * through the last call to settimeofday(). - * - * Warning: if this function is called concurrently with a call to - * settimeofday(), the value returned by gettimeofday() will be unreliable. - * - * ALT_GETTIMEOFDAY is mapped onto the gettimeofday() system call in - * alt_syscall.h - */ - - -#if defined (__GNUC__) && (__GNUC__ >= 4) -int ALT_GETTIMEOFDAY (struct timeval *ptimeval, void *ptimezone_vptr) -{ - struct timezone *ptimezone = (struct timezone*)ptimezone_vptr; -#else -int ALT_GETTIMEOFDAY (struct timeval *ptimeval, struct timezone *ptimezone) -{ -#endif - - alt_u32 nticks = alt_nticks (); - alt_u32 tick_rate = alt_ticks_per_second (); - - /* - * Check to see if the system clock is running. This is indicated by a - * non-zero system clock rate. If the system clock is not running, an error - * is generated and the contents of "ptimeval" and "ptimezone" are not - * updated. - */ - - if (tick_rate) - { - ptimeval->tv_sec = alt_resettime.tv_sec + nticks/tick_rate; - ptimeval->tv_usec = alt_resettime.tv_usec + - (alt_u32)(((alt_u64)nticks*(ALT_US/tick_rate))%ALT_US); - - while(ptimeval->tv_usec < 0) { - if (ptimeval->tv_sec <= 0) - { - ptimeval->tv_sec = 0; - ptimeval->tv_usec = 0; - break; - } - else - { - ptimeval->tv_sec--; - ptimeval->tv_usec += ALT_US; - } - } - - while(ptimeval->tv_usec >= ALT_US) { - ptimeval->tv_sec++; - ptimeval->tv_usec -= ALT_US; - } - - if (ptimezone) - { - ptimezone->tz_minuteswest = alt_timezone.tz_minuteswest; - ptimezone->tz_dsttime = alt_timezone.tz_dsttime; - } - - return 0; - } - - return -ENOTSUP; -} - diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_gmon.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_gmon.c deleted file mode 100644 index 6add9f1..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_gmon.c +++ /dev/null @@ -1,272 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include -#include -#include - -#include "priv/nios2_gmon_data.h" - -#include "sys/alt_irq.h" -#include "sys/alt_alarm.h" - - -/* Macros */ - -/* How large should the bins be which we use to generate the histogram */ -#define PCSAMPLE_BYTES_PER_BUCKET 32 - -#define NIOS2_READ_EA(dest) __asm__ ("mov %0, ea" : "=r" (dest)) - -/* The compiler inserts calls to mcount() at the start of - * every function call. The structure mcount_fn_arc records t - * he return address of the function called (in from_pc) - * and the return address of the mcount function - * (in self_pc). The number of times this arc is executed is - * recorded in the field count. - */ -struct mcount_fn_arc -{ - struct mcount_fn_arc * next; - void * from_pc; - unsigned int count; -}; - -/* We need to maintain a list of pointers to the heads of each adjacency - * list so that we can find them when writing out the gmon.out file. Since - * we don't know at the start of program execution how many functions will - * be called we use a list structure to do this. - */ -struct mcount_fn_entry -{ - struct mcount_fn_entry * next; - void * self_pc; - struct mcount_fn_arc * arc_head; -}; - -/* function prototypes */ - -void __mcount_record(void * self_pc, void * from_pc, struct mcount_fn_entry * fn_entry, struct mcount_fn_entry * * fn_head) __attribute__ ((no_instrument_function)); - -static __inline__ void * mcount_allocate(unsigned int size) __attribute__ ((no_instrument_function)); -static int nios2_pcsample_init(void) __attribute__ ((no_instrument_function)); -static alt_u32 nios2_pcsample(void* alarm) __attribute__ ((no_instrument_function)); - -/* global variables */ - -/* stext and etext are defined in the linker script */ -extern char stext[]; -extern char etext[]; - -/* Is the PC sampling stuff enabled yet? */ -static int pcsample_need_init = 1; - -#define HASH_BUCKETS 64 /* Must be a power of 2 */ - -/* This points to the list of adjacency list pointers. */ -struct mcount_fn_entry * __mcount_fn_head[HASH_BUCKETS]; - -/* pointer to the in-memory buffer containing the histogram */ -static unsigned short* s_pcsamples = 0; - -/* the address of the start and end of text section */ -static const unsigned int s_low_pc = (unsigned int)stext; -static const unsigned int s_high_pc = (unsigned int)etext; - -/* the alarm structure to register for pc sampling */ -static alt_alarm s_nios2_pcsample_alarm; - -unsigned int alt_gmon_data[GMON_DATA_SIZE] = -{ - 0x6e6f6d67, /* "gmon" */ - GMON_DATA_SIZE, - 0, - (unsigned int)stext, - (unsigned int)etext, - PCSAMPLE_BYTES_PER_BUCKET, - 0, - (unsigned int)__mcount_fn_head, - (unsigned int)(__mcount_fn_head + HASH_BUCKETS) -}; - -/* This holds the current slab of memory we're allocating out of */ -static char * mcount_slab_ptr = 0; -static int mcount_slab_size = 0; - -#define MCOUNT_SLAB_INCREMENT 1020 - - -/* - * We can't use malloc to allocate memory because that's too complicated, and - * can't be called at interrupt time. Use the lower level allocator instead - * because that's interrupt safe (and because we never free anything). - * - * For speed, we allocate a block of data at once. - */ -static __inline__ void * mcount_allocate(unsigned int size) -{ - void * data; - - if (size > mcount_slab_size) - { - mcount_slab_ptr = sbrk(MCOUNT_SLAB_INCREMENT); - mcount_slab_size = MCOUNT_SLAB_INCREMENT; - } - - data = mcount_slab_ptr; - mcount_slab_ptr += size; - mcount_slab_size -= size; - - return data; -} - - -/* - * Add the arc with the values of frompc and topc given to the graph. - * This function might be called at interrupt time so must be able to - * cope with reentrancy. - * - * The fast case, where we have already allocated a function arc, has been - * handled by the assmebler code. - */ -void __mcount_record(void * self_pc, void * from_pc, struct mcount_fn_entry * fn_entry, struct mcount_fn_entry * * fn_head) -{ - alt_irq_context context; - struct mcount_fn_arc * arc_entry; - - /* Keep trying to start up the PC sampler until it is running. - * (It can't start until the timer is going). - */ - if (pcsample_need_init) - { - pcsample_need_init = 0; - pcsample_need_init = nios2_pcsample_init(); - } - - /* - * We must disable interrupts around the allocation and the list update to - * prevent corruption if the instrumented function is re-entrant. - * - * It's safe for the code above to be stepping through the chain and be - * interrupted by this code modifying it - there is an edge case which will - * leave two copies of the same arc on the list (both with count=1), but - * this is dealt with on the host. - */ - context = alt_irq_disable_all(); - - if (fn_entry == NULL) - { - /* Add it to the list of functions we must output later. */ - fn_entry = (struct mcount_fn_entry *)mcount_allocate(sizeof(struct mcount_fn_entry)); - - fn_entry->self_pc = self_pc; - fn_entry->arc_head = NULL; - - fn_entry->next = *fn_head; - *fn_head = fn_entry; - } - - /* We will need a new list entry - if there was a list entry before - * then the assembler code would have handled it. */ - arc_entry = (struct mcount_fn_arc *)mcount_allocate(sizeof(struct mcount_fn_arc)); - - arc_entry->from_pc = from_pc; - arc_entry->count = 1; - - arc_entry->next = fn_entry->arc_head; - fn_entry->arc_head = arc_entry; - - alt_irq_enable_all(context); -} - - -/* - * nios2_pcsample_init starts profiling. - * It is called the first time mcount is called, and on subsequent calls to - * mcount until it returns zero. It initializes the pc histogram and turns on - * timer driven pc sampling. - */ -static int nios2_pcsample_init(void) -{ - unsigned int pcsamples_size; - - /* We sample the PC every tick */ - unsigned int prof_rate = alt_ticks_per_second(); - if (prof_rate == 0) - return 1; - - /* allocate the histogram buffer s_pcsamples */ - pcsamples_size = (s_high_pc - s_low_pc)/PCSAMPLE_BYTES_PER_BUCKET; - s_pcsamples = (unsigned short*)sbrk(pcsamples_size * sizeof(unsigned short)); - - if (s_pcsamples != 0) - { - /* initialize the buffer to zero */ - memset(s_pcsamples, 0, pcsamples_size * sizeof(unsigned short)); - - alt_gmon_data[GMON_DATA_PROFILE_DATA] = (int)s_pcsamples; - alt_gmon_data[GMON_DATA_PROFILE_RATE] = prof_rate; - - /* Sample every tick (it's cheap) */ - alt_alarm_start(&s_nios2_pcsample_alarm, 1, nios2_pcsample, 0); - } - - return 0; -} - - -/* - * Sample the PC value and store it in the histogram - */ -static alt_u32 nios2_pcsample(void* context) -{ - unsigned int pc; - unsigned int bucket; - - /* read the exception return address - this will be - * inaccurate if there are nested interrupts but we - * assume that this is rare and the inaccuracy will - * not be great */ - NIOS2_READ_EA(pc); - - /* - * If we're within the profilable range then increment the relevant - * bucket in the histogram - */ - if (pc >= s_low_pc && pc < s_high_pc && s_pcsamples != 0) - { - bucket = (pc - s_low_pc)/PCSAMPLE_BYTES_PER_BUCKET; - s_pcsamples[bucket]++; - } - - /* Sample every tick */ - return 1; -} - diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_icache_flush.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_icache_flush.c deleted file mode 100644 index 4b706ed..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_icache_flush.c +++ /dev/null @@ -1,84 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "nios2.h" -#include "system.h" - -#include "alt_types.h" -#include "sys/alt_cache.h" - -/* - * alt_icache_flush() is called to flush the instruction cache for a memory - * region of length "len" bytes, starting at address "start". - */ - -void alt_icache_flush (void* start, alt_u32 len) -{ -#if NIOS2_ICACHE_SIZE > 0 - - char* i; - char* end; - - /* - * This is the most we would ever need to flush. - */ - - if (len > NIOS2_ICACHE_SIZE) - { - len = NIOS2_ICACHE_SIZE; - } - - end = ((char*) start) + len; - - for (i = start; i < end; i+= NIOS2_ICACHE_LINE_SIZE) - { - __asm__ volatile ("flushi %0" :: "r" (i)); - } - - /* - * For an unaligned flush request, we've got one more line left. - * Note that this is dependent on NIOS2_ICACHE_LINE_SIZE to be a - * multiple of 2 (which it always is). - */ - - if (((alt_u32) start) & (NIOS2_ICACHE_LINE_SIZE - 1)) - { - __asm__ volatile ("flushi %0" :: "r" (i)); - } - - /* - * Having flushed the cache, flush any stale instructions in the - * pipeline - */ - - __asm__ volatile ("flushp"); - -#endif /* NIOS2_ICACHE_SIZE > 0 */ -} diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_icache_flush_all.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_icache_flush_all.c deleted file mode 100644 index 5088552..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_icache_flush_all.c +++ /dev/null @@ -1,46 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "nios2.h" -#include "system.h" - -#include "alt_types.h" -#include "sys/alt_cache.h" - -/* - * alt_icache_flush_all() is called to flush the entire instruction cache. - */ - -void alt_icache_flush_all (void) -{ -#if NIOS2_ICACHE_SIZE > 0 - alt_icache_flush (0, NIOS2_ICACHE_SIZE); -#endif -} diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_iic.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_iic.c deleted file mode 100644 index 1db5afa..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_iic.c +++ /dev/null @@ -1,106 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ -#include "system.h" - -/* - * This file implements the HAL Enhanced interrupt API for Nios II processors - * with an internal interrupt controller (IIC). For most routines, this serves - * as a wrapper layer over the legacy interrupt API (which must be used with - * the IIC only). - * - * Use of the enhanced API is recommended so that application and device - * drivers are compatible with a Nios II system configured with an external - * interrupt controller (EIC), or IIC. This will afford maximum portability. - * - * If an EIC is present, the EIC device driver must provide these routines, - * because their operation will be specific to that EIC type. - */ -#ifndef NIOS2_EIC_PRESENT -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - -#include "sys/alt_irq.h" -#include "priv/alt_iic_isr_register.h" -#include "priv/alt_legacy_irq.h" - -/** @Function Description: This function registers an interrupt handler. - * If the function is succesful, then the requested interrupt will be enabled upon - * return. Registering a NULL handler will disable the interrupt. - * @API Type: External - * @param ic_id Ignored. - * @param irq IRQ number - * @return 0 if successful, else error (-1) - */ -int alt_ic_isr_register(alt_u32 ic_id, alt_u32 irq, alt_isr_func isr, - void *isr_context, void *flags) -{ - return alt_iic_isr_register(ic_id, irq, isr, isr_context, flags); -} - -/** @Function Description: This function enables a single interrupt. - * @API Type: External - * @param ic_id Ignored. - * @param irq IRQ number - * @return 0 if successful, else error (-1) - */ -int alt_ic_irq_enable (alt_u32 ic_id, alt_u32 irq) -{ - return alt_irq_enable(irq); -} - -/** @Function Description: This function disables a single interrupt. - * @API Type: External - * @param ic_id Ignored. - * @param irq IRQ number - * @return 0 if successful, else error (-1) - */ -int alt_ic_irq_disable(alt_u32 ic_id, alt_u32 irq) -{ - return alt_irq_disable(irq); -} - -/** @Function Description: This function to determine if corresponding - * interrupt is enabled. - * @API Type: External - * @param ic_id Ignored. - * @param irq IRQ number - * @return Zero if corresponding interrupt is disabled and - * non-zero otherwise. - */ -alt_u32 alt_ic_irq_enabled(alt_u32 ic_id, alt_u32 irq) -{ - alt_u32 irq_enabled; - - NIOS2_READ_IENABLE(irq_enabled); - - return (irq_enabled & (1 << irq)) ? 1: 0; -} - -#endif /* ALT_ENHANCED_INTERRUPT_API_PRESENT */ -#endif /* NIOS2_EIC_PRESENT */ diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_iic_isr_register.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_iic_isr_register.c deleted file mode 100644 index b104395..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_iic_isr_register.c +++ /dev/null @@ -1,104 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ -#include -#include "system.h" - -/* - * Provides an interrupt registry mechanism for the any CPUs internal interrupt - * controller (IIC) when the enhanced interrupt API is active. - */ -#ifndef ALT_CPU_EIC_PRESENT -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - -#include "alt_types.h" -#include "sys/alt_irq.h" -#include "priv/alt_iic_isr_register.h" - -/* - * The header, alt_irq_entry.h, contains the exception entry point, and is - * provided by the processor component. It is included here, so that the code - * will be added to the executable only if alt_irq_register() is present, i.e. - * if no interrupts are registered - there's no need to provide any - * interrupt handling. - */ - -#include "sys/alt_irq_entry.h" - -/* - * The header, alt_irq_table.h contains a table describing which function - * handles each interrupt. - */ - -#include "priv/alt_irq_table.h" - -/** @Function Description: This function registers an interrupt handler. - * If the function is succesful, then the requested interrupt will be enabled - * upon return. Registering a NULL handler will disable the interrupt. - * - * @API Type: External - * @param ic_id Interrupt controller ID - * @param irq IRQ ID number - * @param isr Pointer to interrupt service routine - * @param isr_context Opaque pointer passed to ISR - * @param flags - * @return 0 if successful, else error (-1) - */ -int alt_iic_isr_register(alt_u32 ic_id, alt_u32 irq, alt_isr_func isr, - void *isr_context, void *flags) -{ - int rc = -EINVAL; - int id = irq; /* IRQ interpreted as the interrupt ID. */ - alt_irq_context status; - - if (id < ALT_NIRQ) - { - /* - * interrupts are disabled while the handler tables are updated to ensure - * that an interrupt doesn't occur while the tables are in an inconsistant - * state. - */ - - status = alt_irq_disable_all(); - - alt_irq[id].handler = isr; - alt_irq[id].context = isr_context; - - rc = (isr) ? alt_ic_irq_enable(ic_id, id) : alt_ic_irq_disable(ic_id, id); - - alt_irq_enable_all(status); - } - - return rc; -} - -#endif /* ALT_ENHANCED_INTERRUPT_API_PRESENT */ -#endif /* ALT_CPU_EIC_PRESENT */ diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_instruction_exception_entry.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_instruction_exception_entry.c deleted file mode 100644 index f4f52fc..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_instruction_exception_entry.c +++ /dev/null @@ -1,203 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2008 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ -#include "sys/alt_exceptions.h" -#include "nios2.h" -#include "alt_types.h" -#include "system.h" - -/* - * This file implements support for calling user-registered handlers for - * instruction-generated exceptions. This handler could also be reached - * in the event of a spurious interrupt. - * - * The handler code is optionally enabled through the "Enable - * Instruction-related Exception API" HAL BSP setting, which will - * define the macro below. - */ -#ifdef ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API - -/* Function pointer to exception callback routine */ -alt_exception_result (*alt_instruction_exception_handler) - (alt_exception_cause, alt_u32, alt_u32) = 0x0; - -/* Link entry routine to .exceptions section */ -int alt_instruction_exception_entry (alt_u32 exception_pc) - __attribute__ ((section (".exceptions"))); - -/* - * This is the entry point for instruction-generated exceptions handling. - * This routine will be called by alt_exceptions_entry.S, after it determines - * that an exception could not be handled by handlers that preceed that - * of instruction-generated exceptions (such as interrupts). - * - * For this to function properly, you must register an exception handler - * using alt_instruction_exception_register(). This routine will call - * that handler if it has been registered. Absent a handler, it will - * break break or hang as discussed below. - */ -int alt_instruction_exception_entry (alt_u32 exception_pc) -{ - alt_u32 cause, badaddr; - -/* - * If the processor hardware has the optional EXCEPTIONS & BADADDR registers, - * read them and pass their content to the user handler. These are always - * present if the MMU or MPU is enabled, and optionally for other advanced - * exception types via the "Extra exceptions information" setting in the - * processor (hardware) configuration. - * - * If these registers are not present, the cause field will be set to - * NIOS2_EXCEPTION_CAUSE_NOT_PRESENT. Your handling routine should - * check the validity of the cause argument before proceeding. - */ -#ifdef NIOS2_HAS_EXTRA_EXCEPTION_INFO - /* Get exception cause & "badaddr" */ - NIOS2_READ_EXCEPTION(cause); - cause = ( (cause & NIOS2_EXCEPTION_REG_CAUSE_MASK) >> - NIOS2_EXCEPTION_REG_CAUSE_OFST ); - - NIOS2_READ_BADADDR(badaddr); -#else - cause = NIOS2_EXCEPTION_CAUSE_NOT_PRESENT; - badaddr = 0; -#endif /* NIOS2_HAS_EXTRA_EXCEPTION_INFO */ - - if(alt_instruction_exception_handler) { - /* - * Call handler. Its return value indicates whether the exception-causing - * instruction should be re-issued. The code that called us, - * alt_eceptions_entry.S, will look at this value and adjust the ea - * register as necessary - */ - return alt_instruction_exception_handler(cause, exception_pc, badaddr); - } - /* - * We got here because an instruction-generated exception occured, but no - * handler is present. We do not presume to know how to handle it. If the - * debugger is present, break, otherwise hang. - * - * If you've reached here in the debugger, consider examining the - * EXCEPTIONS register cause bit-field, which was read into the 'cause' - * variable above, and compare it against the exceptions-type enumeration - * in alt_exceptions.h. This register is availabe if the MMU or MPU is - * present, or if the "Extra exceptions information" hardware option is - * selected. - * - * If you get here then one of the following could have happened: - * - * - An instruction-generated exception occured, and the processor - * does not have the extra exceptions feature enabled, or you - * have not registered a handler using - * alt_instruction_exception_register() - * - * Some examples of instruction-generated exceptions and why they - * might occur: - * - * - Your program could have been compiled for a full-featured - * Nios II core, but it is running on a smaller core, and - * instruction emulation has been disabled by defining - * ALT_NO_INSTRUCTION_EMULATION. - * - * You can work around the problem by re-enabling instruction - * emulation, or you can figure out why your program is being - * compiled for a system other than the one that it is running on. - * - * - Your program has executed a trap instruction, but has not - * implemented a handler for this instruction. - * - * - Your program has executed an illegal instruction (one which is - * not defined in the instruction set). - * - * - Your processor includes an MMU or MPU, and you have enabled it - * before registering an exception handler to service exceptions it - * generates. - * - * The problem could also be hardware related: - * - If your hardware is broken and is generating spurious interrupts - * (a peripheral which negates its interrupt output before its - * interrupt handler has been executed will cause spurious interrupts) - */ - else { -#ifdef NIOS2_HAS_DEBUG_STUB - NIOS2_BREAK(); -#else - while(1) - ; -#endif /* NIOS2_HAS_DEBUG_STUB */ - } - - /* // We should not get here. Remove compiler warning. */ - return NIOS2_EXCEPTION_RETURN_REISSUE_INST; -} - -#endif /* ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API */ - -/* - * This routine indicates whether a particular exception cause will have - * set a valid address into the BADADDR register, which is included - * in the arguments to a user-registered instruction-generated exception - * handler. Many exception types do not set valid contents in BADADDR; - * this is a convenience routine to easily test the validity of that - * argument in your handler. - * - * Note that this routine will return false (0) for cause '12', - * TLB miss. This is because there are four exception types that - * share that cause, two of which do not have a valid BADADDR. You - * must determine BADADDR's validity for these. - * - * Arguments: - * cause: The 5-bit exception cause field of the EXCEPTIONS register, - * shifted to the LSB position. You may pass the 'cause' argument - * in a handler you registered directy to this routine. - * - * Return: 1: BADADDR (bad_addr argument to handler) is valid - * 0: BADADDR is not valid - */ -int alt_exception_cause_generated_bad_addr(alt_exception_cause cause) -{ - switch (cause) { - case NIOS2_EXCEPTION_SUPERVISOR_ONLY_DATA_ADDR: - return 1; - case NIOS2_EXCEPTION_MISALIGNED_DATA_ADDR: - return 1; - case NIOS2_EXCEPTION_MISALIGNED_TARGET_PC: - return 1; - case NIOS2_EXCEPTION_TLB_READ_PERM_VIOLATION: - return 1; - case NIOS2_EXCEPTION_TLB_WRITE_PERM_VIOLATION: - return 1; - case NIOS2_EXCEPTION_MPU_DATA_REGION_VIOLATION: - return 1; - default: - return 0; - } -} diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_instruction_exception_register.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_instruction_exception_register.c deleted file mode 100644 index b059e1d..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_instruction_exception_register.c +++ /dev/null @@ -1,82 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2008 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ -#include "sys/alt_exceptions.h" -#include "alt_types.h" -#include "system.h" - -/* - * This file implements support for calling user-registered handlers for - * instruction-generated exceptions. - * - * The registry API is optionally enabled through the "Enable - * Instruction-related Exception API" HAL BSP setting, which will - * define the macro below. - */ -#ifdef ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API - -/* - * The header, alt_exception_handler_registry.h contains a struct describing - * the registered exception handler - */ -#include "priv/alt_exception_handler_registry.h" - -/* - * Pull in the exception entry assembly code. This will not be linked in - * unless this object is linked into the executable (i.e. only if - * alt_instruction_exception_register() is called). - */ -__asm__( "\n\t.globl alt_exception" ); - -/* - * alt_instruction_exception_register() is called to register a handler to - * service instruction-generated exceptions that are not handled by the - * default exception handler code (interrupts, and optionally unimplemented - * instructions and traps). - * - * Passing null (0x0) in the handler argument will disable a previously- - * registered handler. - * - * Note that if no handler is registered, exceptions that are not processed - * using the built-in handler (interrupts, and optionally unimplemented - * instructions and traps) are treated as unknown exceptions, resulting - * in either a break or an infinite loop. - */ -void alt_instruction_exception_register ( - alt_exception_result (*exception_handler)( - alt_exception_cause cause, - alt_u32 exception_pc, - alt_u32 bad_addr) ) -{ - alt_instruction_exception_handler = exception_handler; -} - -#endif /* ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API */ diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_io_redirect.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_io_redirect.c deleted file mode 100644 index 8c862f7..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_io_redirect.c +++ /dev/null @@ -1,98 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include -#include - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - - -/* - * alt_open_fd() is similar to open() in that it is used to obtain a file - * descriptor for the file named "name". The "flags" and "mode" arguments are - * identical to the "flags" and "mode" arguments of open(). - * - * The distinction between the two functions is that the file descriptor - * structure to use is passed in as an argument, rather than allocated from the - * list of free file descriptors. - * - * This is used by alt_io_redirect() to redirect the stdin, stdout and stderr - * file descriptors to point to new devices. - * - * If the device can not be succesfully opened, then the input file descriptor - * remains unchanged. - */ - -static void alt_open_fd(alt_fd* fd, const char* name, int flags, int mode) -{ - int old; - - old = open (name, flags, mode); - - if (old >= 0) - { - fd->dev = alt_fd_list[old].dev; - fd->priv = alt_fd_list[old].priv; - fd->fd_flags = alt_fd_list[old].fd_flags; - - alt_release_fd (old); - } -} - -/* - * alt_io_redirect() is called once the device/filesystem lists have been - * initialised, but before main(). Its function is to redirect standard in, - * standard out and standard error so that they point to the devices selected by - * the user (as defined in system.h). - * - * Prior to the call to this function, io is directed towards /dev/null. If - * i/o can not be redirected to the requested device, for example if the device - * does not exist, then it remains directed at /dev/null. - */ - -void alt_io_redirect(const char* stdout_dev, - const char* stdin_dev, - const char* stderr_dev) -{ - /* Redirect the channels */ - - alt_open_fd (&alt_fd_list[STDOUT_FILENO], stdout_dev, O_WRONLY, 0777); - alt_open_fd (&alt_fd_list[STDIN_FILENO], stdin_dev, O_RDONLY, 0777); - alt_open_fd (&alt_fd_list[STDERR_FILENO], stderr_dev, O_WRONLY, 0777); -} - - - - diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_ioctl.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_ioctl.c deleted file mode 100644 index f5d7ef1..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_ioctl.c +++ /dev/null @@ -1,170 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "sys/ioctl.h" -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -/* - * The ioctl() system call is provided so that application code can manipulate - * the i/o capabilities of a device in device specific ways. This is identical - * to the standard posix ioctl() function. - * - * In general this implementation simply vectors ioctl requests to the - * apropriate drivers ioctl function (as registered in the drivers alt_dev - * structure). - * - * However in the case of devices (as oposed to filesystem), the TIOCEXCL and - * TIOCNXCL requests are handled without reference to the driver. These - * requests are used to lock/release a device for exclusive access. - * - * Handling these requests centrally eases the task of device driver - * development. - * - * ALT_IOCTL is mapped onto the ioctl() system call in alt_syscall.h - */ - -#ifdef ALT_USE_DIRECT_DRIVERS - -#include "system.h" -#include "sys/alt_driver.h" - -/* - * Provide minimal version that calls ioctl routine of provided stdio devices. - */ -int ALT_IOCTL (int file, int req, void* arg) -{ -#ifdef ALT_STDIN_PRESENT - ALT_DRIVER_IOCTL_EXTERNS(ALT_STDIN_DEV); -#endif -#ifdef ALT_STDOUT_PRESENT - ALT_DRIVER_IOCTL_EXTERNS(ALT_STDOUT_DEV); -#endif -#ifdef ALT_STDERR_PRESENT - ALT_DRIVER_IOCTL_EXTERNS(ALT_STDERR_DEV); -#endif - -#if !defined(ALT_STDIN_PRESENT) && !defined(ALT_STDOUT_PRESENT) && !defined(ALT_STDERR_PRESENT) - /* Generate a link time warning, should this function ever be called. */ - ALT_STUB_WARNING(ioctl); -#endif - - switch (file) { -#ifdef ALT_STDIN_PRESENT - case 0: /* stdin file descriptor */ - return ALT_DRIVER_IOCTL(ALT_STDIN_DEV, req, arg); -#endif /* ALT_STDIN_PRESENT */ -#ifdef ALT_STDOUT_PRESENT - case 1: /* stdout file descriptor */ - return ALT_DRIVER_IOCTL(ALT_STDOUT_DEV, req, arg); -#endif /* ALT_STDOUT_PRESENT */ -#ifdef ALT_STDERR_PRESENT - case 2: /* stderr file descriptor */ - return ALT_DRIVER_IOCTL(ALT_STDERR_DEV, req, arg); -#endif /* ALT_STDERR_PRESENT */ - default: - ALT_ERRNO = EBADFD; - return -1; - } -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -int ALT_IOCTL (int file, int req, void* arg) -{ - alt_fd* fd; - int rc; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - - /* - * In the case of device drivers (not file systems) handle the TIOCEXCL - * and TIOCNXCL requests as special cases. - */ - - if (fd->fd_flags & ALT_FD_DEV) - { - if (req == TIOCEXCL) - { - rc = alt_fd_lock (fd); - goto ioctl_done; - } - else if (req == TIOCNXCL) - { - rc = alt_fd_unlock (fd); - goto ioctl_done; - } - } - - /* - * If the driver provides an ioctl() function, call that to handle the - * request, otherwise set the return code to indicate that the request - * could not be processed. - */ - - if (fd->dev->ioctl) - { - rc = fd->dev->ioctl(fd, req, arg); - } - else - { - rc = -ENOTTY; - } - } - else - { - rc = -EBADFD; - } - -ioctl_done: - - if (rc < 0) - { - ALT_ERRNO = -rc; - } - return rc; -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_irq_entry.S b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_irq_entry.S deleted file mode 100644 index d3efe7d..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_irq_entry.S +++ /dev/null @@ -1,108 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "system.h" - -/* - * This is the interrupt exception entry point code, which saves all the - * registers and calls the interrupt handler. It should be pulled in using - * a .globl from alt_irq_register.c. This scheme is used so that if an - * interrupt is never registered, then this code will not appear in the - * generated executable, thereby improving code footprint. - */ - - /* - * Explicitly allow the use of r1 (the assembler temporary register) - * within this code. This register is normally reserved for the use of - * the compiler. - */ - .set noat - - /* - * Pull in the exception handler register save code. - */ - .globl alt_exception - - .globl alt_irq_entry - .section .exceptions.entry.label, "xa" -alt_irq_entry: - - /* - * Section .exceptions.entry is in alt_exception_entry.S - * This saves all the caller saved registers and reads estatus into r5 - */ - - .section .exceptions.irqtest, "xa" - -#ifdef ALT_CI_INTERRUPT_VECTOR_N - /* - * Use the interrupt vector custom instruction if present to accelerate - * this code. - * If the interrupt vector custom instruction returns a negative - * value, there are no interrupts active (estatus.pie is 0 - * or ipending is 0) so assume it is a software exception. - */ - custom ALT_CI_INTERRUPT_VECTOR_N, r4, r0, r0 - blt r4, r0, .Lnot_irq -#else - /* - * Test to see if the exception was a software exception or caused - * by an external interrupt, and vector accordingly. - */ - rdctl r4, ipending - andi r2, r5, 1 - beq r2, zero, .Lnot_irq - beq r4, zero, .Lnot_irq -#endif /* ALT_CI_INTERRUPT_VECTOR_N */ - - .section .exceptions.irqhandler, "xa" - /* - * Now that all necessary registers have been preserved, call - * alt_irq_handler() to process the interrupts. - */ - - call alt_irq_handler - - .section .exceptions.irqreturn, "xa" - - br .Lexception_exit - - .section .exceptions.notirq.label, "xa" - -.Lnot_irq: - - /* - * Section .exceptions.exit is in alt_exception_entry.S - * This restores all the caller saved registers - */ - - .section .exceptions.exit.label -.Lexception_exit: - diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_irq_handler.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_irq_handler.c deleted file mode 100644 index 3253d02..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_irq_handler.c +++ /dev/null @@ -1,169 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include "system.h" - -/* - * This interrupt handler only works with an internal interrupt controller - * (IIC). Processors with an external interrupt controller (EIC) use an - * implementation provided by an EIC driver. - */ -#ifndef ALT_CPU_EIC_PRESENT - -#include "sys/alt_irq.h" -#include "os/alt_hooks.h" - -#include "alt_types.h" - -/* - * A table describing each interrupt handler. The index into the array is the - * interrupt id associated with the handler. - * - * When an interrupt occurs, the associated handler is called with - * the argument stored in the context member. - */ -struct ALT_IRQ_HANDLER -{ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - void (*handler)(void*); -#else - void (*handler)(void*, alt_u32); -#endif - void *context; -} alt_irq[ALT_NIRQ]; - -/* - * alt_irq_handler() is called by the interrupt exception handler in order to - * process any outstanding interrupts. - * - * It is defined here since it is linked in using weak linkage. - * This means that if there is never a call to alt_irq_register() (above) then - * this function will not get linked in to the executable. This is acceptable - * since if no handler is ever registered, then an interrupt can never occur. - * - * If Nios II interrupt vector custom instruction exists, use it to accelerate - * the dispatch of interrupt handlers. The Nios II interrupt vector custom - * instruction is present if the macro ALT_CI_INTERRUPT_VECTOR defined. - */ - -void alt_irq_handler (void) __attribute__ ((section (".exceptions"))); -void alt_irq_handler (void) -{ -#ifdef ALT_CI_INTERRUPT_VECTOR - alt_32 offset; - char* alt_irq_base = (char*)alt_irq; -#else - alt_u32 active; - alt_u32 mask; - alt_u32 i; -#endif /* ALT_CI_INTERRUPT_VECTOR */ - - /* - * Notify the operating system that we are at interrupt level. - */ - - ALT_OS_INT_ENTER(); - -#ifdef ALT_CI_INTERRUPT_VECTOR - /* - * Call the interrupt vector custom instruction using the - * ALT_CI_INTERRUPT_VECTOR macro. - * It returns the offset into the vector table of the lowest-valued pending - * interrupt (corresponds to highest priority) or a negative value if none. - * The custom instruction assumes that each table entry is eight bytes. - */ - while ((offset = ALT_CI_INTERRUPT_VECTOR) >= 0) { - struct ALT_IRQ_HANDLER* handler_entry = - (struct ALT_IRQ_HANDLER*)(alt_irq_base + offset); -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - handler_entry->handler(handler_entry->context); -#else - handler_entry->handler(handler_entry->context, offset >> 3); -#endif - } -#else /* ALT_CI_INTERRUPT_VECTOR */ - /* - * Obtain from the interrupt controller a bit list of pending interrupts, - * and then process the highest priority interrupt. This process loops, - * loading the active interrupt list on each pass until alt_irq_pending() - * return zero. - * - * The maximum interrupt latency for the highest priority interrupt is - * reduced by finding out which interrupts are pending as late as possible. - * Consider the case where the high priority interupt is asserted during - * the interrupt entry sequence for a lower priority interrupt to see why - * this is the case. - */ - - active = alt_irq_pending (); - - do - { - i = 0; - mask = 1; - - /* - * Test each bit in turn looking for an active interrupt. Once one is - * found, the interrupt handler asigned by a call to alt_irq_register() is - * called to clear the interrupt condition. - */ - - do - { - if (active & mask) - { -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - alt_irq[i].handler(alt_irq[i].context); -#else - alt_irq[i].handler(alt_irq[i].context, i); -#endif - break; - } - mask <<= 1; - i++; - - } while (1); - - active = alt_irq_pending (); - - } while (active); -#endif /* ALT_CI_INTERRUPT_VECTOR */ - - /* - * Notify the operating system that interrupt processing is complete. - */ - - ALT_OS_INT_EXIT(); -} - -#endif /* ALT_CPU_EIC_PRESENT */ diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_irq_register.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_irq_register.c deleted file mode 100644 index b5ea474..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_irq_register.c +++ /dev/null @@ -1,102 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ -#include -#include "system.h" - -/* - * This interrupt registry mechanism works with the Nios II internal interrupt - * controller (IIC) only. Systems with an external interrupt controller (EIC), - * or those with the IIC who are using the enhanced interrupt API will - * utilize the alt_ic_isr_register() routine to register an interrupt. - */ -#ifndef NIOS2_EIC_PRESENT - -#include "sys/alt_irq.h" -#include "priv/alt_legacy_irq.h" -#include "os/alt_hooks.h" - -#include "alt_types.h" - -/* - * The header, alt_irq_entry.h, contains the exception entry point, and is - * provided by the processor component. It is included here, so that the code - * will be added to the executable only if alt_irq_register() is present, i.e. - * if no interrupts are registered - there's no need to provide any - * interrupt handling. - */ - -#include "sys/alt_irq_entry.h" - -/* - * The header, alt_irq_table.h contains a table describing which function - * handles each interrupt. - */ - -#include "priv/alt_irq_table.h" - -/* - * alt_irq_handler() is called to register an interrupt handler. If the - * function is succesful, then the requested interrupt will be enabled upon - * return. Registering a NULL handler will disable the interrupt. - * - * The return value is 0 if the interrupt handler was registered and the - * interrupt was enabled, otherwise it is negative. - */ - -int alt_irq_register (alt_u32 id, - void* context, - alt_isr_func handler) -{ - int rc = -EINVAL; - alt_irq_context status; - - if (id < ALT_NIRQ) - { - /* - * interrupts are disabled while the handler tables are updated to ensure - * that an interrupt doesn't occur while the tables are in an inconsistant - * state. - */ - - status = alt_irq_disable_all (); - - alt_irq[id].handler = handler; - alt_irq[id].context = context; - - rc = (handler) ? alt_irq_enable (id): alt_irq_disable (id); - - alt_irq_enable_all(status); - } - return rc; -} -#endif /* NIOS2_EIC_PRESENT */ - diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_irq_vars.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_irq_vars.c deleted file mode 100644 index 8c0a18d..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_irq_vars.c +++ /dev/null @@ -1,47 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "alt_types.h" - -#include "system.h" - -/* - * These global variables are used to save the current list of enabled - * interrupts. See alt_irq.h for further details. - */ - -volatile alt_u32 alt_irq_active = 0; - -#ifndef ALT_EXCEPTION_STACK - -volatile alt_u32 alt_priority_mask = (alt_u32) -1; - -#endif - diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_isatty.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_isatty.c deleted file mode 100644 index 9276472..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_isatty.c +++ /dev/null @@ -1,125 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include "sys/alt_dev.h" -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -#ifdef ALT_USE_DIRECT_DRIVERS - -#include "system.h" - -/* - * Provide minimal version that just describes all file descriptors - * as tty devices for provided stdio devices. - */ -int ALT_ISATTY (int file) -{ - switch (file) { -#ifdef ALT_STDIN_PRESENT - case 0: /* stdin file descriptor */ -#endif /* ALT_STDIN_PRESENT */ -#ifdef ALT_STDOUT_PRESENT - case 1: /* stdout file descriptor */ -#endif /* ALT_STDOUT_PRESENT */ -#ifdef ALT_STDERR_PRESENT - case 2: /* stderr file descriptor */ -#endif /* ALT_STDERR_PRESENT */ - return 1; - default: - return 0; - } - -#if !defined(ALT_STDIN_PRESENT) && !defined(ALT_STDOUT_PRESENT) && !defined(ALT_STDERR_PRESENT) - /* Generate a link time warning, should this function ever be called. */ - ALT_STUB_WARNING(isatty); -#endif -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ -/* - * isatty() can be used to determine whether the input file descriptor "file" - * refers to a terminal device or not. If it is a terminal device then the - * return value is one, otherwise it is zero. - * - * ALT_ISATTY is mapped onto the isatty() system call in alt_syscall.h - */ - -int ALT_ISATTY (int file) -{ - alt_fd* fd; - struct stat stat; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - /* - * If a device driver does not provide an fstat() function, then it is - * treated as a terminal device by default. - */ - - if (!fd->dev->fstat) - { - return 1; - } - - /* - * If a driver does provide an implementation of the fstat() function, then - * this is called so that the device can identify itself. - */ - - else - { - fstat (file, &stat); - return (stat.st_mode == _IFCHR) ? 1 : 0; - } - } - else - { - ALT_ERRNO = EBADFD; - return 0; - } -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_kill.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_kill.c deleted file mode 100644 index 42c2e1d..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_kill.c +++ /dev/null @@ -1,121 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include "sys/alt_errno.h" -#include "os/alt_syscall.h" - - -/* - * kill() is used by newlib in order to send signals to processes. Since there - * is only a single process in the HAL, the only valid values for pid are - * either the current process id, or the broadcast values, i.e. pid must be - * less than or equal to zero. - * - * ALT_KILL is mapped onto the kill() system call in alt_syscall.h - */ - -int ALT_KILL (int pid, int sig) -{ - int status = 0; - - if (pid <= 0) - { - switch (sig) - { - case 0: - - /* The null signal is used to check that a pid is valid. */ - - break; - - case SIGABRT: - case SIGALRM: - case SIGFPE: - case SIGILL: - case SIGKILL: - case SIGPIPE: - case SIGQUIT: - case SIGSEGV: - case SIGTERM: - case SIGUSR1: - case SIGUSR2: - case SIGBUS: - case SIGPOLL: - case SIGPROF: - case SIGSYS: - case SIGTRAP: - case SIGVTALRM: - case SIGXCPU: - case SIGXFSZ: - - /* - * The Posix standard defines the default behaviour for all these signals - * as being eqivalent to a call to _exit(). No mechanism is provided to - * change this behaviour. - */ - - _exit(0); - case SIGCHLD: - case SIGURG: - - /* - * The Posix standard defines these signals to be ignored by default. No - * mechanism is provided to change this behaviour. - */ - - break; - default: - - /* Tried to send an unsupported signal */ - - status = EINVAL; - } - } - - else if (pid > 0) - { - /* Attempted to signal a non-existant process */ - - status = ESRCH; - } - - if (status) - { - ALT_ERRNO = status; - return -1; - } - - return 0; -} diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_link.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_link.c deleted file mode 100644 index d796c59..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_link.c +++ /dev/null @@ -1,56 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_warning.h" -#include "sys/alt_errno.h" -#include "os/alt_syscall.h" - -/* - * link() is used by newlib to create a new link to an existing file. This is - * unsupported in the HAL environment. However a "do-nothing" implementation - * is still provied for newlib compatability. - * - * ALT_LINK is mapped onto the link() system call in alt_syscall.h - */ - -int ALT_LINK ( char *existing, char *new) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(link); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} - diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_load.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_load.c deleted file mode 100644 index ffab4b9..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_load.c +++ /dev/null @@ -1,88 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_load.h" -#include "sys/alt_cache.h" - -/* - * Linker defined symbols. - */ - -extern void __flash_rwdata_start; -extern void __ram_rwdata_start; -extern void __ram_rwdata_end; -extern void __flash_rodata_start; -extern void __ram_rodata_start; -extern void __ram_rodata_end; -extern void __flash_exceptions_start; -extern void __ram_exceptions_start; -extern void __ram_exceptions_end; - -/* - * alt_load() is called when the code is executing from flash. In this case - * there is no bootloader, so this application is responsible for loading to - * RAM any sections that are required. - */ - -void alt_load (void) -{ - /* - * Copy the .rwdata section. - */ - - alt_load_section (&__flash_rwdata_start, - &__ram_rwdata_start, - &__ram_rwdata_end); - - /* - * Copy the exception handler. - */ - - alt_load_section (&__flash_exceptions_start, - &__ram_exceptions_start, - &__ram_exceptions_end); - - /* - * Copy the .rodata section. - */ - - alt_load_section (&__flash_rodata_start, - &__ram_rodata_start, - &__ram_rodata_end); - - /* - * Now ensure that the caches are in synch. - */ - - alt_dcache_flush_all(); - alt_icache_flush_all(); -} diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_log_macro.S b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_log_macro.S deleted file mode 100644 index 499c4ad..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_log_macro.S +++ /dev/null @@ -1,56 +0,0 @@ -/* alt_log_macro.S - * - * Implements the function tx_log_str, called by the assembly macro - * ALT_LOG_PUTS(). The macro will be empty when logging is turned off, - * and this function will not be compiled. When logging is on, - * this function is used to print out the strings defined in the beginning - * of alt_log_printf.c, using port information taken from system.h and - * alt_log_printf.h. - * - * This routine only handles strings, and sends a character into the defined - * output device's output buffer when the device is ready. It's intended for - * debugging purposes, where messages can be set to print out at certain - * points in the boot code to indicate the progress of the program. - * - */ - -#ifndef __ALT_LOG_MACROS__ -#define __ALT_LOG_MACROS__ - -/* define this flag to skip assembly-incompatible parts - * of various include files. */ -#define ALT_ASM_SRC - -#ifdef ALT_LOG_ENABLE // only compile this function if this flag is defined. - - #include "system.h" - #include "sys/alt_log_printf.h" - - .global tx_log_str -tx_log_str: - /* load base uart / jtag uart address into r6 */ - movhi r6, %hiadj(ALT_LOG_PORT_BASE) - addi r6, r6, %lo(ALT_LOG_PORT_BASE) -tx_next_char: - /* if pointer points to null, return - * r4 is the pointer to the str to be printed, set by ALT_LOG_PUTS */ - ldb r7, (r4) - beq r0, r7, end_tx - - /* check device transmit ready */ -wait_tx_ready_loop: - ldwio r5, ALT_LOG_PRINT_REG_OFFSET(r6) - andi r5, r5, ALT_LOG_PRINT_MSK - beq r5, r0, wait_tx_ready_loop - /* write char */ - stwio r7, ALT_LOG_PRINT_TXDATA_REG_OFFSET (r6) - /* advance string pointer */ - addi r4, r4, 1 - br tx_next_char -end_tx: - ret - -#endif - -#endif /* __ALT_LOG_MACROS__ */ - diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_log_printf.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_log_printf.c deleted file mode 100644 index 1f7056d..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_log_printf.c +++ /dev/null @@ -1,479 +0,0 @@ - -/* alt_log_printf.c - * - * This file implements the various C functions used for the - * alt_log logging/debugging print functions. The functions - * sit as is here - the job of hiding them from the compiler - * if logging is disabled is accomplished in the .h file. - * - * All the global variables for alt_log are defined here. - * These include the various flags that turn on additional - * logging options; the strings for assembly printing; and - * other globals needed by different logging options. - * - * There are 4 functions that handle the actual printing: - * alt_log_txchar: Actual function that puts 1 char to UART/JTAG UART. - * alt_log_repchar: Calls alt_log_txchar 'n' times - used by - * alt_log_private_printf for formatting. - * alt_log_private_printf: - * Stripped down implementation of printf - no floats. - * alt_log_printf_proc: - * Wrapper function for private_printf. - * - * The rest of the functions are called by the macros which - * were called by code in the other components. Each function - * is preceded by a comment, about which file it gets called - * in, and what its purpose is. - * - * author: gkwan - */ - -/* skip all code if enable is off */ -#ifdef ALT_LOG_ENABLE - -#include -#include -#include -#ifdef __ALTERA_AVALON_JTAG_UART - #include "altera_avalon_jtag_uart.h" - #include -#endif -#include "sys/alt_log_printf.h" - -/* strings for assembly puts */ -char alt_log_msg_bss[] = "[crt0.S] Clearing BSS \r\n";; -char alt_log_msg_alt_main[] = "[crt0.S] Calling alt_main.\r\n"; -char alt_log_msg_stackpointer[] \ - = "[crt0.S] Setting up stack and global pointers.\r\n"; -char alt_log_msg_cache[] = "[crt0.S] Inst & Data Cache Initialized.\r\n"; -/* char array allocation for alt_write */ -char alt_log_write_buf[ALT_LOG_WRITE_ECHO_LEN+2]; - -/* global variables for all 'on' flags */ - -/* - * The boot message flag is linked into the data (rwdata) section - * because if it is zero, it would otherwise be placed in the bss section. - * alt_log examines this variable before the BSS is cleared in the boot-up - * process. - */ -volatile alt_u32 alt_log_boot_on_flag \ - __attribute__ ((section (".data"))) = ALT_LOG_BOOT_ON_FLAG_SETTING; - -volatile alt_u8 alt_log_write_on_flag = ALT_LOG_WRITE_ON_FLAG_SETTING; - -volatile alt_u8 alt_log_sys_clk_on_flag = ALT_LOG_SYS_CLK_ON_FLAG_SETTING; - -volatile alt_u8 alt_log_jtag_uart_alarm_on_flag = \ - ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING; - -volatile alt_u8 alt_log_jtag_uart_isr_on_flag = \ - ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING; - -volatile alt_u8 alt_log_jtag_uart_startup_info_on_flag = \ - ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING; - -/* Global alarm object for recurrent JTAG UART status printing */ -alt_alarm alt_log_jtag_uart_alarm_1; - -/* Global ints for system clock printing and count */ -volatile int alt_log_sys_clk_count; -volatile int alt_system_clock_in_sec; - -/* enum used by alt_log_private_printf */ -enum -{ - pfState_chars, - pfState_firstFmtChar, - pfState_otherFmtChar -}; - - - - -/* Function to put one char onto the UART/JTAG UART txdata register. */ -void alt_log_txchar(int c,char *base) -{ - /* Wait until the device is ready for a character */ - while((ALT_LOG_PRINT_REG_RD(base) & ALT_LOG_PRINT_MSK) == 0) - ; - /* And pop the character into the register */ - ALT_LOG_PRINT_TXDATA_WR(base,c); -} - - -/* Called by alt_log_private_printf to print out characters repeatedly */ -void alt_log_repchar(char c,int r,int base) -{ - while(r-- > 0) - alt_log_txchar(c,(char*) base); -} - - -/* Stripped down printf function */ -void alt_log_private_printf(const char *fmt,int base,va_list args) - { - const char *w; - char c; - int state; - int fmtLeadingZero = 0; /* init these all to 0 for -W warnings. */ - int fmtLong = 0; - int fmtBeforeDecimal = 0; - int fmtAfterDecimal = 0; - int fmtBase = 0; - int fmtSigned = 0; - int fmtCase = 0; /* For hex format, if 1, A-F, else a-f. */ - - w = fmt; - state = pfState_chars; - - while(0 != (c = *w++)) - { - switch(state) - { - case pfState_chars: - if(c == '%') - { - fmtLeadingZero = 0; - fmtLong = 0; - fmtBase = 10; - fmtSigned = 1; - fmtCase = 0; /* Only %X sets this. */ - fmtBeforeDecimal = -1; - fmtAfterDecimal = -1; - state = pfState_firstFmtChar; - } - else - { - alt_log_txchar(c,(char*)base); - } - break; - - case pfState_firstFmtChar: - if(c == '0') - { - fmtLeadingZero = 1; - state = pfState_otherFmtChar; - } - else if(c == '%') - { - alt_log_txchar(c,(char*)base); - state = pfState_chars; - } - else - { - state = pfState_otherFmtChar; - goto otherFmtChar; - } - break; - - case pfState_otherFmtChar: -otherFmtChar: - if(c == '.') - { - fmtAfterDecimal = 0; - } - else if('0' <= c && c <= '9') - { - c -= '0'; - if(fmtAfterDecimal < 0) /* still before decimal */ - { - if(fmtBeforeDecimal < 0) - { - fmtBeforeDecimal = 0; - } - else - { - fmtBeforeDecimal *= 10; - } - fmtBeforeDecimal += c; - } - else - { - fmtAfterDecimal = (fmtAfterDecimal * 10) + c; - } - } - else if(c == 'l') - { - fmtLong = 1; - } - else /* we're up to the letter which determines type */ - { - switch(c) - { - case 'd': - case 'i': -doIntegerPrint: - { - unsigned long v; - unsigned long p; /* biggest power of fmtBase */ - unsigned long vShrink; /* used to count digits */ - int sign; - int digitCount; - - /* Get the value */ - if(fmtLong) - { - if (fmtSigned) - { - v = va_arg(args,long); - } - else - { - v = va_arg(args,unsigned long); - } - } - else - { - if (fmtSigned) - { - v = va_arg(args,int); - } - else - { - v = va_arg(args,unsigned int); - } - } - - /* Strip sign */ - sign = 0; - /* (assumes sign bit is #31) */ - if( fmtSigned && (v & (0x80000000)) ) - { - v = ~v + 1; - sign = 1; - } - - /* Count digits, and get largest place value */ - vShrink = v; - p = 1; - digitCount = 1; - while( (vShrink = vShrink / fmtBase) > 0 ) - { - digitCount++; - p *= fmtBase; - } - - /* Print leading characters & sign */ - fmtBeforeDecimal -= digitCount; - if(fmtLeadingZero) - { - if(sign) - { - alt_log_txchar('-',(char*)base); - fmtBeforeDecimal--; - } - alt_log_repchar('0',fmtBeforeDecimal,base); - } - else - { - if(sign) - { - fmtBeforeDecimal--; - } - alt_log_repchar(' ',fmtBeforeDecimal,base); - if(sign) - { - alt_log_txchar('-',(char*)base); - } - } - - /* Print numbery parts */ - while(p) - { - unsigned char d; - - d = v / p; - d += '0'; - if(d > '9') - { - d += (fmtCase ? 'A' : 'a') - '0' - 10; - } - alt_log_txchar(d,(char*)base); - - v = v % p; - p = p / fmtBase; - } - } - - state = pfState_chars; - break; - - case 'u': - fmtSigned = 0; - goto doIntegerPrint; - case 'o': - fmtSigned = 0; - fmtBase = 8; - goto doIntegerPrint; - case 'x': - fmtSigned = 0; - fmtBase = 16; - goto doIntegerPrint; - case 'X': - fmtSigned = 0; - fmtBase = 16; - fmtCase = 1; - goto doIntegerPrint; - - case 'c': - alt_log_repchar(' ',fmtBeforeDecimal-1,base); - alt_log_txchar(va_arg(args,int),(char*)base); - break; - - case 's': - { - char *s; - - s = va_arg(args,char *); - alt_log_repchar(' ',fmtBeforeDecimal-strlen(s),base); - - while(*s) - alt_log_txchar(*s++,(char*)base); - } - break; - } /* switch last letter of fmt */ - state=pfState_chars; - } - break; - } /* switch */ - } /* while chars left */ - } /* printf */ - -/* Main logging printf function */ -int alt_log_printf_proc(const char *fmt, ... ) -{ - va_list args; - - va_start (args, fmt); - alt_log_private_printf(fmt,ALT_LOG_PORT_BASE,args); - return (0); -} - -/* Below are the functions called by different macros in various components. */ - -/* If the system has a JTAG_UART, include JTAG_UART debugging functions */ -#ifdef __ALTERA_AVALON_JTAG_UART - -/* The alarm function in altera_avalon_jtag_uart.c. - * This function, when turned on, prints out the status - * of the JTAG UART Control register, every ALT_LOG_JTAG_UART_TICKS. - * If the flag is off, the alarm should never be registered, and this - * function should never run */ -alt_u32 altera_avalon_jtag_uart_report_log(void * context) -{ - if (alt_log_jtag_uart_alarm_on_flag) { - altera_avalon_jtag_uart_state* dev = (altera_avalon_jtag_uart_state*) context; - const char* header="JTAG Alarm:"; - alt_log_jtag_uart_print_control_reg(dev, dev->base, header); - return ALT_LOG_JTAG_UART_TICKS; - } - else - { - /* If flag is not on, return 0 to disable future alarms. - * Should never be here, alarm should not be enabled at all. */ - return 0; - } -} - -void alt_log_jtag_uart_print_control_reg(altera_avalon_jtag_uart_state* dev, int base, const char* header) -{ - unsigned int control, space, ac, wi, ri, we, re; - control = IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base); - space = (control & ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_MSK) >> - ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_OFST; - we= (control & ALTERA_AVALON_JTAG_UART_CONTROL_WE_MSK) >> - ALTERA_AVALON_JTAG_UART_CONTROL_WE_OFST; - re= (control & ALTERA_AVALON_JTAG_UART_CONTROL_RE_MSK) >> - ALTERA_AVALON_JTAG_UART_CONTROL_RE_OFST; - ri= (control & ALTERA_AVALON_JTAG_UART_CONTROL_RI_MSK) >> - ALTERA_AVALON_JTAG_UART_CONTROL_RI_OFST; - wi= (control & ALTERA_AVALON_JTAG_UART_CONTROL_WI_MSK) >> - ALTERA_AVALON_JTAG_UART_CONTROL_WI_OFST; - ac= (control & ALTERA_AVALON_JTAG_UART_CONTROL_AC_MSK) >> - ALTERA_AVALON_JTAG_UART_CONTROL_AC_OFST; - -#ifdef ALTERA_AVALON_JTAG_UART_SMALL - ALT_LOG_PRINTF( - "%s HW FIFO wspace=%d AC=%d WI=%d RI=%d WE=%d RE=%d\r\n", - header,space,ac,wi,ri,we,re); -#else - ALT_LOG_PRINTF( - "%s SW CirBuf = %d, HW FIFO wspace=%d AC=%d WI=%d RI=%d WE=%d RE=%d\r\n", - header,(dev->tx_out-dev->tx_in),space,ac,wi,ri,we,re); -#endif - - return; - -} - -/* In altera_avalon_jtag_uart.c - * Same output as the alarm function above, but this is called in the driver - * init function. Hence, it gives the status of the JTAG UART control register - * right at the initialization of the driver */ -void alt_log_jtag_uart_startup_info(altera_avalon_jtag_uart_state* dev, int base) -{ - const char* header="JTAG Startup Info:"; - alt_log_jtag_uart_print_control_reg(dev, base, header); - return; -} - -/* In altera_avalon_jtag_uart.c - * When turned on, this function will print out the status of the jtag uart - * control register every time there is a jtag uart "almost-empty" interrupt. */ -void alt_log_jtag_uart_isr_proc(int base, altera_avalon_jtag_uart_state* dev) -{ - if (alt_log_jtag_uart_isr_on_flag) { - const char* header="JTAG IRQ:"; - alt_log_jtag_uart_print_control_reg(dev, base, header); - } - return; -} - -#endif /* __ALTERA_AVALON_JTAG_UART */ - -/* In alt_write.c - * When the alt_log_write_on_flag is turned on, this function gets called - * every time alt_write gets called. The first - * ALT_LOG_WRITE_ECHO_LEN characters of every printf command (or any command - * that eventually calls write()) gets echoed to the alt_log output. */ -void alt_log_write(const void *ptr, size_t len) -{ - if (alt_log_write_on_flag) { - int temp_cnt; - int length=(ALT_LOG_WRITE_ECHO_LEN>len) ? len : ALT_LOG_WRITE_ECHO_LEN; - - if (length < 2) return; - - strncpy (alt_log_write_buf,ptr,length); - alt_log_write_buf[length-1]='\n'; - alt_log_write_buf[length]='\r'; - alt_log_write_buf[length+1]='\0'; - - /* Escape Ctrl-D's. If the Ctrl-D gets sent it might kill the terminal - * connection of alt_log. It will get replaced by 'D'. */ - for (temp_cnt=0;temp_cnt < length; temp_cnt++) { - if (alt_log_write_buf[temp_cnt]== 0x4) { - alt_log_write_buf[temp_cnt]='D'; - } - } - ALT_LOG_PRINTF("Write Echo: %s",alt_log_write_buf); - } -} - -/* In altera_avalon_timer_sc - * This function prints out a system clock is alive message - * every ALT_LOG_SYS_CLK_INTERVAL (in ticks). */ -void alt_log_system_clock() -{ - if (alt_log_sys_clk_on_flag) { - alt_log_sys_clk_count++; - if (alt_log_sys_clk_count > ALT_LOG_SYS_CLK_INTERVAL) { - alt_log_sys_clk_count = 0; - ALT_LOG_PRINTF("System Clock On %u\r\n",alt_system_clock_in_sec++); - } - } -} - - -#endif diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_lseek.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_lseek.c deleted file mode 100644 index 7857b0d..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_lseek.c +++ /dev/null @@ -1,117 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -#ifdef ALT_USE_DIRECT_DRIVERS - -off_t ALT_LSEEK (int file, off_t ptr, int dir) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(lseek); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -/* - * lseek() can be called to move the read/write pointer associated with the - * file descriptor "file". This function simply vectors the call to the lseek() - * function provided by the driver associated with the file descriptor. - * - * If the driver does not provide an implementation of lseek() an error is - * indicated. - * - * lseek() corresponds to the standard lseek() function. - * - * ALT_LSEEK is mapped onto the lseek() system call in alt_syscall.h - * - */ - -off_t ALT_LSEEK (int file, off_t ptr, int dir) -{ - alt_fd* fd; - off_t rc = 0; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - /* - * If the device driver provides an implementation of the lseek() function, - * then call that to process the request. - */ - - if (fd->dev->lseek) - { - rc = fd->dev->lseek(fd, ptr, dir); - } - /* - * Otherwise return an error. - */ - - else - { - rc = -ENOTSUP; - } - } - else - { - rc = -EBADFD; - } - - if (rc < 0) - { - ALT_ERRNO = -rc; - rc = -1; - } - - return rc; -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_main.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_main.c deleted file mode 100644 index a96229b..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_main.c +++ /dev/null @@ -1,161 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include -#include -#include -#include - -#include "sys/alt_dev.h" -#include "sys/alt_sys_init.h" -#include "sys/alt_irq.h" -#include "sys/alt_dev.h" - -#include "os/alt_hooks.h" - -#include "priv/alt_file.h" -#include "alt_types.h" - -#include "system.h" - -#include "sys/alt_log_printf.h" - -extern void _do_ctors(void); -extern void _do_dtors(void); - -/* - * Standard arguments for main. By default, no arguments are passed to main. - * However a device driver may choose to configure these arguments by calling - * alt_set_args(). The expectation is that this facility will only be used by - * the iclient/ihost utility. - */ - -int alt_argc = 0; -char** alt_argv = {NULL}; -char** alt_envp = {NULL}; - -/* - * Prototype for the entry point to the users application. - */ - -extern int main (int, char **, char **); - -/* - * alt_main is the C entry point for the HAL. It is called by the assembler - * startup code in the processor specific crt0.S. It is responsible for: - * completing the C runtime configuration; configuring all the - * devices/filesystems/components in the system; and call the entry point for - * the users application, i.e. main(). - */ - -void alt_main (void) -{ -#ifndef ALT_NO_EXIT - int result; -#endif - - /* ALT LOG - please see HAL/sys/alt_log_printf.h for details */ - ALT_LOG_PRINT_BOOT("[alt_main.c] Entering alt_main, calling alt_irq_init.\r\n"); - /* Initialize the interrupt controller. */ - alt_irq_init (NULL); - - /* Initialize the operating system */ - ALT_LOG_PRINT_BOOT("[alt_main.c] Done alt_irq_init, calling alt_os_init.\r\n"); - ALT_OS_INIT(); - - /* - * Initialize the semaphore used to control access to the file descriptor - * list. - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Done OS Init, calling alt_sem_create.\r\n"); - ALT_SEM_CREATE (&alt_fd_list_lock, 1); - - /* Initialize the device drivers/software components. */ - ALT_LOG_PRINT_BOOT("[alt_main.c] Calling alt_sys_init.\r\n"); - alt_sys_init(); - ALT_LOG_PRINT_BOOT("[alt_main.c] Done alt_sys_init.\r\n"); - -#if !defined(ALT_USE_DIRECT_DRIVERS) && (defined(ALT_STDIN_PRESENT) || defined(ALT_STDOUT_PRESENT) || defined(ALT_STDERR_PRESENT)) - - /* - * Redirect stdio to the apropriate devices now that the devices have - * been initialized. This is only done if the user has requested these - * devices be present (not equal to /dev/null) and if direct drivers - * aren't being used. - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Redirecting IO.\r\n"); - alt_io_redirect(ALT_STDOUT, ALT_STDIN, ALT_STDERR); -#endif - -#ifndef ALT_NO_C_PLUS_PLUS - /* - * Call the C++ constructors - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Calling C++ constructors.\r\n"); - _do_ctors (); -#endif /* ALT_NO_C_PLUS_PLUS */ - -#if !defined(ALT_NO_C_PLUS_PLUS) && !defined(ALT_NO_CLEAN_EXIT) && !defined(ALT_NO_EXIT) - /* - * Set the C++ destructors to be called at system shutdown. This is only done - * if a clean exit has been requested (i.e. the exit() function has not been - * redefined as _exit()). This is in the interest of reducing code footprint, - * in that the atexit() overhead is removed when it's not needed. - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Calling atexit.\r\n"); - atexit (_do_dtors); -#endif - - /* - * Finally, call main(). The return code is then passed to a subsequent - * call to exit() unless the application is never supposed to exit. - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Calling main.\r\n"); - -#ifdef ALT_NO_EXIT - main (alt_argc, alt_argv, alt_envp); -#else - result = main (alt_argc, alt_argv, alt_envp); - close(STDOUT_FILENO); - exit (result); -#endif - - ALT_LOG_PRINT_BOOT("[alt_main.c] After main - we should not be here?.\r\n"); -} - diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_malloc_lock.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_malloc_lock.c deleted file mode 100644 index 8c78f46..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_malloc_lock.c +++ /dev/null @@ -1,52 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -/* - * These are the empty malloc lock/unlock stubs required by newlib. These are - * used to make newlib's malloc() function thread safe. The default HAL - * configuration is single threaded, so there is nothing to do here. Note that - * this requires that malloc is never called by an interrupt service routine. - */ - -void __malloc_lock ( struct _reent *_r ) -{ -} - -/* - * - */ - -void __malloc_unlock ( struct _reent *_r ) -{ -} diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_mcount.S b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_mcount.S deleted file mode 100644 index 3837523..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_mcount.S +++ /dev/null @@ -1,198 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2010 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* mcount or _mcount is inserted by GCC before the function prologue of every - * function when a program is compiled for profiling. At the start of mcount, - * we guarantee that: - * ra = self_pc (an address in the function which called mcount) - * r8 = from_pc (an address in the function which called mcount's caller) - * - * Because this is always called at the start of a function we can corrupt - * r2,r3 and r11-r15. We must not corrupt r4-r7 (because they might contain - * function arguments for the instrumented function) or r8 (which holds ra - * for the instrumented function). - */ - - .global __mcount_fn_head - - .global mcount - - /* _mcount is used by gcc4 */ - .global _mcount - -_mcount: -mcount: - /* Use a hash to speed up locating fn_entry. We use bits 5 upwards to choose - * the bucket because bits 1:0 will always be 0, and because the distribution - * of values for bits 4:2 won't be even (aligning on cache line boundaries - * will skew it). Higher bits should be fairly random. - */ - /* fn_head = mcount_fn_head + (((unsigned int)self_pc >> 5) & (HASH_BUCKETS - 1)); */ - - srli r2, ra, 3 - movhi r3, %hiadj(__mcount_fn_head) - addi r3, r3, %lo(__mcount_fn_head) - andi r2, r2, 0xFC - add r11, r2, r3 - - /* The fast case is where we have already allocated a function arc, and so - * also a function pointer. - */ - - /* First find the function being called (using self_pc) */ - mov r10, r11 -0: - ldw r10, 0(r10) - beq r10, zero, .Lnew_arc - ldw r2, 4(r10) - bne r2, ra, 0b - - /* Found a function entry for this PC. Now look for an arc with a matching - * from_pc value. There will always be at least one arc. */ - ldw r3, 8(r10) -0: - ldw r2, 4(r3) - beq r2, r8, .Lfound_arc - ldw r3, 0(r3) - bne r3, zero, 0b - -.Lnew_arc: - addi sp, sp, -24 - -.LCFI0: - stw ra, 0(sp) - stw r4, 4(sp) - stw r5, 8(sp) - stw r6, 12(sp) - stw r7, 16(sp) - stw r8, 20(sp) - -.LCFI1: - /* __mcount_record(orig_ra, orig_r8, fn_entry, *fn_head); */ - mov r4, ra - mov r5, r8 - mov r6, r10 - mov r7, r11 - call __mcount_record - - /* restore registers from the stack */ - ldw ra, 0(sp) - ldw r4, 4(sp) - ldw r5, 8(sp) - ldw r6, 12(sp) - ldw r7, 16(sp) - ldw r8, 20(sp) - - addi sp, sp, 24 - -.LCFI2: - ret - -.Lfound_arc: - /* We've found the correct arc record. Increment the count and return */ - ldw r2, 8(r3) - addi r2, r2, 1 - stw r2, 8(r3) - ret - -.Lmcount_end: - - - -/* - * Dwarf2 debug information for the function. This provides GDB with the - * information it needs to backtrace out of this function. - */ - - .section .debug_frame,"",@progbits -.LCIE: - .4byte 2f - 1f /* Length */ -1: - .4byte 0xffffffff /* CIE id */ - .byte 0x1 /* Version */ - .string "" /* Augmentation */ - .uleb128 0x1 /* Code alignment factor */ - .sleb128 -4 /* Data alignment factor */ - .byte 0x1f /* Return address register */ - - .byte 0xc /* Define CFA */ - .uleb128 0x1b /* Register 27 (sp) */ - .uleb128 0x0 /* Offset 0 */ - - .align 2 /* Padding */ -2: - -.LFDE_mcount: - .4byte 2f - 1f /* Length */ -1: - .4byte .LCIE /* Pointer to CIE */ - .4byte mcount /* Start of table entry */ - .4byte .Lmcount_end - mcount /* Size of table entry */ - - .byte 0x4 /* Advance location */ - .4byte .LCFI0 - mcount /* to .LCFI0 */ - .byte 0xe /* Define CFA offset */ - .uleb128 24 /* to 24 */ - - .byte 0x4 /* Advance location */ - .4byte .LCFI1 - .LCFI0 /* to .LCFI1 */ - .byte 0x9f /* Store ra */ - .uleb128 0x6 /* at CFA-24 */ - .byte 0x84 /* Store r4 */ - .uleb128 0x5 /* at CFA-20 */ - .byte 0x85 /* Store r5 */ - .uleb128 0x4 /* at CFA-16 */ - .byte 0x86 /* Store r6 */ - .uleb128 0x3 /* at CFA-12 */ - .byte 0x87 /* Store r7 */ - .uleb128 0x2 /* at CFA-8 */ - .byte 0x88 /* Store r8 */ - .uleb128 0x1 /* at CFA-4 */ - - .byte 0x4 /* Advance location */ - .4byte .LCFI2 - .LCFI1 /* to .LCFI2 */ - .byte 0xe /* Define CFA offset */ - .uleb128 0 /* to 0 */ - .byte 0x8 /* Same value */ - .uleb128 31 /* for ra */ - .byte 0x8 /* Same value */ - .uleb128 4 /* for r4 */ - .byte 0x8 /* Same value */ - .uleb128 5 /* for r5 */ - .byte 0x8 /* Same value */ - .uleb128 6 /* for r6 */ - .byte 0x8 /* Same value */ - .uleb128 7 /* for r7 */ - .byte 0x8 /* Same value */ - .uleb128 8 /* for r8 */ - - .align 2 -2: - diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_open.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_open.c deleted file mode 100644 index 4790f53..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_open.c +++ /dev/null @@ -1,173 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "alt_types.h" -#include "os/alt_syscall.h" - -#ifdef ALT_USE_DIRECT_DRIVERS - -int ALT_OPEN (const char* file, int flags, int mode) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(open); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -extern alt_llist alt_dev_list; - -/* - * alt_file_locked() is used by open() to ensure that a device has not been - * previously locked for exclusive access using ioctl(). This test is only - * performed for devices. Filesystems are required to handle the ioctl() call - * themselves, and report the error from the filesystems open() function. - */ - -static int alt_file_locked (alt_fd* fd) -{ - alt_u32 i; - - /* - * Mark the file descriptor as belonging to a device. - */ - - fd->fd_flags |= ALT_FD_DEV; - - /* - * Loop through all current file descriptors searching for one that's locked - * for exclusive access. If a match is found, generate an error. - */ - - for (i = 0; i <= alt_max_fd; i++) - { - if ((alt_fd_list[i].dev == fd->dev) && - (alt_fd_list[i].fd_flags & ALT_FD_EXCL) && - (&alt_fd_list[i] != fd)) - { - return -EACCES; - } - } - - /* The device is not locked */ - - return 0; -} - -/* - * open() is called in order to get a file descriptor that reference the file - * or device named "name". This descriptor can then be used to manipulate the - * file/device using the standard system calls, e.g. write(), read(), ioctl() - * etc. - * - * This is equivalent to the standard open() system call. - * - * ALT_OPEN is mapped onto the open() system call in alt_syscall.h - */ - -int ALT_OPEN (const char* file, int flags, int mode) -{ - alt_dev* dev; - alt_fd* fd; - int index = -1; - int status = -ENODEV; - int isafs = 0; - - /* - * Check the device list, to see if a device with a matching name is - * registered. - */ - - if (!(dev = alt_find_dev (file, &alt_dev_list))) - { - /* No matching device, so try the filesystem list */ - - dev = alt_find_file (file); - isafs = 1; - } - - /* - * If a matching device or filesystem is found, allocate a file descriptor. - */ - - if (dev) - { - if ((index = alt_get_fd (dev)) < 0) - { - status = index; - } - else - { - fd = &alt_fd_list[index]; - fd->fd_flags = (flags & ~ALT_FD_FLAGS_MASK); - - /* If this is a device, ensure it isn't already locked */ - - if (isafs || ((status = alt_file_locked (fd)) >= 0)) - { - /* - * If the device or filesystem provides an open() callback function, - * call it now to perform any device/filesystem specific operations. - */ - - status = (dev->open) ? dev->open(fd, file, flags, mode): 0; - } - } - } - else - { - status = -ENODEV; - } - - /* Allocation failed, so clean up and return an error */ - - if (status < 0) - { - alt_release_fd (index); - ALT_ERRNO = -status; - return -1; - } - - /* return the reference upon success */ - - return index; -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_printf.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_printf.c deleted file mode 100644 index e742b57..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_printf.c +++ /dev/null @@ -1,127 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/* - * This file provides a very minimal printf implementation for use with very - * small applications. Only the following format strings are supported: - * %x - * %s - * %c - * %% - */ - -#include -#include "sys/alt_stdio.h" - -/* - * ALT printf function - */ -void -alt_printf(const char* fmt, ... ) -{ - va_list args; - va_start(args, fmt); - const char *w; - char c; - - /* Process format string. */ - w = fmt; - while ((c = *w++) != 0) - { - /* If not a format escape character, just print */ - /* character. Otherwise, process format string. */ - if (c != '%') - { - alt_putchar(c); - } - else - { - /* Get format character. If none */ - /* available, processing is complete. */ - if ((c = *w++) != 0) - { - if (c == '%') - { - /* Process "%" escape sequence. */ - alt_putchar(c); - } - else if (c == 'c') - { - int v = va_arg(args, int); - alt_putchar(v); - } - else if (c == 'x') - { - /* Process hexadecimal number format. */ - unsigned long v = va_arg(args, unsigned long); - unsigned long digit; - int digit_shift; - - /* If the number value is zero, just print and continue. */ - if (v == 0) - { - alt_putchar('0'); - continue; - } - - /* Find first non-zero digit. */ - digit_shift = 28; - while (!(v & (0xF << digit_shift))) - digit_shift -= 4; - - /* Print digits. */ - for (; digit_shift >= 0; digit_shift -= 4) - { - digit = (v & (0xF << digit_shift)) >> digit_shift; - if (digit <= 9) - c = '0' + digit; - else - c = 'a' + digit - 10; - alt_putchar(c); - } - } - else if (c == 's') - { - /* Process string format. */ - char *s = va_arg(args, char *); - - while(*s) - alt_putchar(*s++); - } - } - else - { - break; - } - } - } -} diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_putchar.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_putchar.c deleted file mode 100644 index badaa02..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_putchar.c +++ /dev/null @@ -1,59 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#ifdef ALT_USE_DIRECT_DRIVERS -#include "system.h" -#include "sys/alt_driver.h" -#include "sys/alt_stdio.h" -#endif - -/* - * Uses the ALT_DRIVER_WRITE() macro to call directly to driver if available. - * Otherwise, uses newlib provided putchar() routine. - */ -int -alt_putchar(int c) -{ -#ifdef ALT_USE_DIRECT_DRIVERS - ALT_DRIVER_WRITE_EXTERNS(ALT_STDOUT_DEV); - char c1 = (char)(c & 0xff); - - if (ALT_DRIVER_WRITE(ALT_STDOUT_DEV, &c1, 1, 0) == -1) { - return -1; - } - return c; -#else - return putchar(c); -#endif -} diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_putstr.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_putstr.c deleted file mode 100644 index 5345945..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_putstr.c +++ /dev/null @@ -1,55 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#ifdef ALT_USE_DIRECT_DRIVERS -#include -#include "system.h" -#include "sys/alt_driver.h" -#include "sys/alt_stdio.h" -#endif - -/* - * Uses the ALT_DRIVER_WRITE() macro to call directly to driver if available. - * Otherwise, uses newlib provided fputs() routine. - */ -int -alt_putstr(const char* str) -{ -#ifdef ALT_USE_DIRECT_DRIVERS - ALT_DRIVER_WRITE_EXTERNS(ALT_STDOUT_DEV); - return ALT_DRIVER_WRITE(ALT_STDOUT_DEV, str, strlen(str), 0); -#else - return fputs(str, stdout); -#endif -} diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_read.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_read.c deleted file mode 100644 index 1c89777..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_read.c +++ /dev/null @@ -1,125 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -/* - * The read() system call is used to read a block of data from a file or device. - * This function simply vectors the request to the device driver associated - * with the input file descriptor "file". - * - * ALT_READ is mapped onto the read() system call in alt_syscall.h - */ - -#ifdef ALT_USE_DIRECT_DRIVERS - -#include "system.h" -#include "sys/alt_driver.h" - -/* - * Provide minimal version that just reads from the stdin device when provided. - */ - -int ALT_READ (int file, void *ptr, size_t len) -{ -#ifdef ALT_STDIN_PRESENT - ALT_DRIVER_READ_EXTERNS(ALT_STDIN_DEV); -#endif - -#if !defined(ALT_STDIN_PRESENT) - /* Generate a link time warning, should this function ever be called. */ - ALT_STUB_WARNING(read); -#endif - - switch (file) { -#ifdef ALT_STDIN_PRESENT - case 0: /* stdin file descriptor */ - return ALT_DRIVER_READ(ALT_STDIN_DEV, ptr, len, 0); -#endif /* ALT_STDIN_PRESENT */ - default: - ALT_ERRNO = EBADFD; - return -1; - } -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -int ALT_READ (int file, void *ptr, size_t len) -{ - alt_fd* fd; - int rval; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - /* - * If the file has not been opened with read access, or if the driver does - * not provide an implementation of read(), generate an error. Otherwise - * call the drivers read() function to process the request. - */ - - if (((fd->fd_flags & O_ACCMODE) != O_WRONLY) && - (fd->dev->read)) - { - if ((rval = fd->dev->read(fd, ptr, len)) < 0) - { - ALT_ERRNO = -rval; - return -1; - } - return rval; - } - else - { - ALT_ERRNO = EACCES; - } - } - else - { - ALT_ERRNO = EBADFD; - } - return -1; -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_release_fd.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_release_fd.c deleted file mode 100644 index 84733a7..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_release_fd.c +++ /dev/null @@ -1,54 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - -/* - * alt_release_fd() is called to free an allocated file descriptor. This is - * done by setting the device pointer in the file descriptor structure to zero. - * - * File descriptors correcponding to standard in, standard out and standard - * error cannont be released backed to the pool. They are always reserved. - */ - -void alt_release_fd (int fd) -{ - if (fd > 2) - { - alt_fd_list[fd].fd_flags = 0; - alt_fd_list[fd].dev = 0; - } -} - - - diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_remap_cached.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_remap_cached.c deleted file mode 100644 index f61cb9c..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_remap_cached.c +++ /dev/null @@ -1,50 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003,2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "sys/alt_cache.h" -#include "system.h" - -#ifdef NIOS2_MMU_PRESENT -/* Convert KERNEL region address to IO region address */ -#define BYPASS_DCACHE_MASK (0x1 << 29) -#else -/* Set bit 31 of address to bypass D-cache */ -#define BYPASS_DCACHE_MASK (0x1 << 31) -#endif - -/* - * Convert a pointer to a block of uncached memory, into a block of - * cached memory. - */ - -void* alt_remap_cached (volatile void* ptr, alt_u32 len) -{ - return (void*) (((alt_u32) ptr) & ~BYPASS_DCACHE_MASK); -} diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_remap_uncached.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_remap_uncached.c deleted file mode 100644 index 7ff6302..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_remap_uncached.c +++ /dev/null @@ -1,51 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003,2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "sys/alt_cache.h" -#include "system.h" - -#ifdef NIOS2_MMU_PRESENT -/* Convert KERNEL region address to IO region address */ -#define BYPASS_DCACHE_MASK (0x1 << 29) -#else -/* Set bit 31 of address to bypass D-cache */ -#define BYPASS_DCACHE_MASK (0x1 << 31) -#endif - -/* - * Convert a pointer to a block of cached memory, into a block of - * uncached memory. - */ - -volatile void* alt_remap_uncached (void* ptr, alt_u32 len) -{ - alt_dcache_flush (ptr, len); - return (volatile void*) (((alt_u32) ptr) | BYPASS_DCACHE_MASK); -} diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_rename.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_rename.c deleted file mode 100644 index 48afac0..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_rename.c +++ /dev/null @@ -1,55 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "os/alt_syscall.h" - -/* - * _rename() is used by newlib to rename an existing file. This is unsupported - * in the HAL environment. However a "do-nothing" implementation is still - * provied for newlib compatability. - * - * ALT_RENAME is mapped onto the _rename() system call in alt_syscall.h - */ - -int ALT_RENAME (char *existing, char *new) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(_rename); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_sbrk.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_sbrk.c deleted file mode 100644 index b8c3799..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_sbrk.c +++ /dev/null @@ -1,136 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "os/alt_syscall.h" - -#include "sys/alt_irq.h" -#include "sys/alt_stack.h" - -#include "system.h" - -/* - * sbrk() is called to dynamically extend the data segment for the application. - * Thie input argument "incr" is the size of the block to allocate. - * - * This simple implementation does not perform any bounds checking. Memory will - * be allocated, even if the request region colides with the stack or overflows - * the available physical memory. - * - * ALT_SBRK is mapped onto the sbrk() system call in alt_syscall.h - * - * This function is called by the profiling code to allocate memory so must be - * safe if called from an interrupt context. It must also not be instrumented - * because that would lead to an infinate loop. - */ - -extern char __alt_heap_start[]; /* set by linker */ -extern char __alt_heap_limit[]; /* set by linker */ - -static char *heap_end = __alt_heap_start; - -#if defined(ALT_EXCEPTION_STACK) && defined(ALT_STACK_CHECK) -char * alt_exception_old_stack_limit = NULL; -#endif - -caddr_t ALT_SBRK (int incr) __attribute__ ((no_instrument_function )); - -caddr_t ALT_SBRK (int incr) -{ - alt_irq_context context; - char *prev_heap_end; - - context = alt_irq_disable_all(); - - /* Always return data aligned on a word boundary */ - heap_end = (char *)(((unsigned int)heap_end + 3) & ~3); - -#ifdef ALT_MAX_HEAP_BYTES - /* - * User specified a maximum heap size. Return -1 if it would - * be exceeded by this sbrk call. - */ - if (((heap_end + incr) - __alt_heap_start) > ALT_MAX_HEAP_BYTES) { - alt_irq_enable_all(context); - return (caddr_t)-1; - } -#else - if ((heap_end + incr) > __alt_heap_limit) { - alt_irq_enable_all(context); - return (caddr_t)-1; - } -#endif - - prev_heap_end = heap_end; - heap_end += incr; - -#ifdef ALT_STACK_CHECK - /* - * If the stack and heap are contiguous then extending the heap reduces the - * space available for the stack. If we are still using the default stack - * then adjust the stack limit to note this, while checking for stack - * pointer overflow. - * If the stack limit isn't pointing at the top of the heap then the code - * is using a different stack so none of this needs to be done. - */ - - if (alt_stack_limit() == prev_heap_end) - { - if (alt_stack_pointer() <= heap_end) - alt_report_stack_overflow(); - - alt_set_stack_limit(heap_end); - } - -#ifdef ALT_EXCEPTION_STACK - /* - * If we are executing from the exception stack then compare against the - * stack we switched away from as well. The exception stack is a fixed - * size so doesn't need to be checked. - */ - - if (alt_exception_old_stack_limit == prev_heap_end) - { - if (alt_exception_old_stack_limit <= heap_end) - alt_report_stack_overflow(); - - alt_exception_old_stack_limit = heap_end; - } -#endif - -#endif - - alt_irq_enable_all(context); - - return (caddr_t) prev_heap_end; -} diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_settod.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_settod.c deleted file mode 100644 index 59db0f8..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_settod.c +++ /dev/null @@ -1,96 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include "sys/alt_errno.h" -#include "sys/alt_alarm.h" -#include "os/alt_syscall.h" - -/* - * "alt_timezone" and "alt_resettime" are the values of the the reset time and - * time zone set through the last call to settimeofday(). By default they are - * zero initialised. - */ - -extern struct timezone alt_timezone; -extern struct timeval alt_resettime; - -/* - * Macro defining the number of micoseconds in a second. - */ - -#define ALT_US (1000000) - - -/* - * settimeofday() can be called to calibrate the system clock, so that - * subsequent calls to gettimeofday() will return the elapsed "wall clock" - * time. - * - * This is done by updating the global structures "alt_resettime" and - * "alt_timezone" so that an immediate call to gettimeofday() would return - * the value specified by "t" and "tz". - * - * Warning: if this function is called concurrently with a call to - * gettimeofday(), the value returned by gettimeofday() will be unreliable. - * - * ALT_SETTIMEOFDAY is mapped onto the settimeofday() system call in - * alt_syscall.h - */ - -int ALT_SETTIMEOFDAY (const struct timeval *t, - const struct timezone *tz) -{ - alt_u32 nticks = alt_nticks (); - alt_u32 tick_rate = alt_ticks_per_second (); - - /* If there is a system clock available, update the current time */ - - if (tick_rate) - { - alt_resettime.tv_sec = t->tv_sec - nticks/tick_rate; - alt_resettime.tv_usec = t->tv_usec - - ((nticks*(ALT_US/tick_rate))%ALT_US); - - alt_timezone.tz_minuteswest = tz->tz_minuteswest; - alt_timezone.tz_dsttime = tz->tz_dsttime; - - return 0; - } - - /* There's no system clock available */ - - ALT_ERRNO = ENOSYS; - return -1; -} diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_software_exception.S b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_software_exception.S deleted file mode 100644 index 2142594..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_software_exception.S +++ /dev/null @@ -1,53 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - - /* - * This file provides the global symbol: software_exception. It is provided to - * support legacy code, and should not be used by new software. - * - * It is used by legacy code to invoke the software exception handler as - * defined by version 1.0 of the Nios II kit. It should only be used when you - * are providing your own interrupt entry point, i.e. you are not using - * alt_irq_entry. - */ - -#include "system.h" - - /* - * Pull in the exception handler. - */ - - .globl alt_exception - - .section .exceptions.entry.label, "xa" - - .globl software_exception - .type software_exception, @function -software_exception: diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_stat.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_stat.c deleted file mode 100644 index 44e207b..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_stat.c +++ /dev/null @@ -1,59 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include -#include - -#include "os/alt_syscall.h" - -/* - * The stat() function is similar to the fstat() function in that it is used to - * obtain status information about a file. Instead of using an open file - * descriptor (like fstat()), stat() takes the name of a file as an input - * argument. - * - * ALT_STAT is mapped onto the stat() system call in alt_syscall.h - */ - -int ALT_STAT (const char *file, struct stat *st) -{ - int fd; - int rc; - - fd = open (file, 0); - rc = fstat (fd, st); - close (fd); - - return rc; -} diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_tick.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_tick.c deleted file mode 100644 index c73488d..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_tick.c +++ /dev/null @@ -1,149 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_irq.h" -#include "sys/alt_alarm.h" -#include "os/alt_hooks.h" -#include "alt_types.h" - -/* - * "_alt_tick_rate" is used to store the value of the system clock frequency - * in ticks per second. It is initialised to zero, which corresponds to there - * being no system clock facility available. - */ - -alt_u32 _alt_tick_rate = 0; - -/* - * "_alt_nticks" is the number of system clock ticks that have elapsed since - * reset. - */ - -volatile alt_u32 _alt_nticks = 0; - -/* - * "alt_alarm_list" is the head of a linked list of registered alarms. This is - * initialised to be an empty list. - */ - -ALT_LLIST_HEAD(alt_alarm_list); - -/* - * alt_alarm_stop() is called to remove an alarm from the list of registered - * alarms. Alternatively an alarm can unregister itself by returning zero when - * the alarm executes. - */ - -void alt_alarm_stop (alt_alarm* alarm) -{ - alt_irq_context irq_context; - - irq_context = alt_irq_disable_all(); - alt_llist_remove (&alarm->llist); - alt_irq_enable_all (irq_context); -} - -/* - * alt_tick() is periodically called by the system clock driver in order to - * process the registered list of alarms. Each alarm is registed with a - * callback interval, and a callback function, "callback". - * - * The return value of the callback function indicates how many ticks are to - * elapse until the next callback. A return value of zero indicates that the - * alarm should be deactivated. - * - * alt_tick() is expected to run at interrupt level. - */ - -void alt_tick (void) -{ - alt_alarm* next; - alt_alarm* alarm = (alt_alarm*) alt_alarm_list.next; - - alt_u32 next_callback; - - /* update the tick counter */ - - _alt_nticks++; - - /* process the registered callbacks */ - - while (alarm != (alt_alarm*) &alt_alarm_list) - { - next = (alt_alarm*) alarm->llist.next; - - /* - * Upon the tick-counter rolling over it is safe to clear the - * roll-over flag; once the flag is cleared this (or subsequnt) - * tick events are enabled to generate an alarm event. - */ - if ((alarm->rollover) && (_alt_nticks == 0)) - { - alarm->rollover = 0; - } - - /* if the alarm period has expired, make the callback */ - if ((alarm->time <= _alt_nticks) && (alarm->rollover == 0)) - { - next_callback = alarm->callback (alarm->context); - - /* deactivate the alarm if the return value is zero */ - - if (next_callback == 0) - { - alt_alarm_stop (alarm); - } - else - { - alarm->time += next_callback; - - /* - * If the desired alarm time causes a roll-over, set the rollover - * flag. This will prevent the subsequent tick event from causing - * an alarm too early. - */ - if(alarm->time < _alt_nticks) - { - alarm->rollover = 1; - } - } - } - alarm = next; - } - - /* - * Update the operating system specific timer facilities. - */ - - ALT_OS_TIME_TICK(); -} - diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_times.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_times.c deleted file mode 100644 index 4dd965d..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_times.c +++ /dev/null @@ -1,71 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "sys/alt_errno.h" -#include "sys/alt_alarm.h" -#include "os/alt_syscall.h" - -/* - * The times() function is used by newlib to obtain elapsed time information. - * The return value is the elapsed time since reset in system clock ticks. Note - * that this is distinct from the strict Posix version of times(), which should - * return the time since: 0 hours, 0 minutes, 0 seconds, January 1, 1970, GMT. - * - * The input structure is filled in with time accounting information. This - * implementation attributes all cpu time to the system. - * - * ALT_TIMES is mapped onto the times() system call in alt_syscall.h - */ - -clock_t ALT_TIMES (struct tms *buf) -{ - clock_t ticks = alt_nticks(); - - /* If there is no system clock present, generate an error */ - - if (!alt_ticks_per_second()) - { - ALT_ERRNO = ENOSYS; - return 0; - } - - /* Otherwise return the elapsed time */ - - buf->tms_utime = 0; - buf->tms_stime = ticks; - buf->tms_cutime = 0; - buf->tms_cstime = 0; - - return ticks; -} diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_uncached_free.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_uncached_free.c deleted file mode 100644 index 6e362ba..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_uncached_free.c +++ /dev/null @@ -1,49 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003,2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "sys/alt_cache.h" -#include "system.h" - -#ifdef NIOS2_MMU_PRESENT -/* Convert KERNEL region address to IO region address */ -#define BYPASS_DCACHE_MASK (0x1 << 29) -#else -/* Set bit 31 of address to bypass D-cache */ -#define BYPASS_DCACHE_MASK (0x1 << 31) -#endif - -/* - * Free a block of uncached memory. - */ - -void alt_uncached_free (volatile void* ptr) -{ - free ((void*) (((alt_u32) ptr) & ~BYPASS_DCACHE_MASK)); -} diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_uncached_malloc.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_uncached_malloc.c deleted file mode 100644 index ab3416d..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_uncached_malloc.c +++ /dev/null @@ -1,55 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003,2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "sys/alt_cache.h" -#include "system.h" - -#ifdef NIOS2_MMU_PRESENT -/* Convert KERNEL region address to IO region address */ -#define BYPASS_DCACHE_MASK (0x1 << 29) -#else -/* Set bit 31 of address to bypass D-cache */ -#define BYPASS_DCACHE_MASK (0x1 << 31) -#endif - -/* - * Allocate a block of uncached memory. - */ - -volatile void* alt_uncached_malloc (size_t size) -{ - void* ptr; - - ptr = malloc (size); - - alt_dcache_flush (ptr, size); - - return ptr ? (volatile void*) (((alt_u32) ptr) | BYPASS_DCACHE_MASK) : NULL; -} diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_unlink.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_unlink.c deleted file mode 100644 index 29e35d6..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_unlink.c +++ /dev/null @@ -1,55 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "os/alt_syscall.h" - -/* - * unlink() is used by newlib to delete an existing link to a file. This is - * unsupported in the HAL environment. However a "do-nothing" implementation - * is still provied for newlib compatability. - * - * ALT_UNLINK is mapped onto the unlink() system call in alt_syscall.h - */ - -int ALT_UNLINK (char *name) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(unlink); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_usleep.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_usleep.c deleted file mode 100644 index 2330eb8..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_usleep.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2003 Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - * - * ------------ - * - * Altera does not recommend, suggest or require that this reference design - * file be used in conjunction or combination with any other product. - * - * usleep.c - Microsecond delay routine - */ - -#include - -#include "priv/alt_busy_sleep.h" -#include "os/alt_syscall.h" - -/* - * This function simply calls alt_busy_sleep() to perform the delay. This - * function implements the delay as a calibrated "busy loop". - * - * ALT_USLEEP is mapped onto the usleep() system call in alt_syscall.h - */ - - - -#if defined (__GNUC__) && __GNUC__ >= 4 -int ALT_USLEEP (useconds_t us) -#else -unsigned int ALT_USLEEP (unsigned int us) -#endif -{ - return alt_busy_sleep(us); -} diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_wait.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_wait.c deleted file mode 100644 index a42f80f..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_wait.c +++ /dev/null @@ -1,52 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_errno.h" -#include "os/alt_syscall.h" - -/* - * wait() is used by newlib to wait for all child processes to exit. Since the - * HAL does not support spawning child processes, this returns immediately as - * there can't be anythign to wait for. - * - * ALT_WAIT is mapped onto the wait() system call in alt_syscall.h - */ - -int ALT_WAIT (int *status) -{ - *status = 0; - - ALT_ERRNO = ECHILD; - - return -1; -} - diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_write.c b/software/qsys_tutorial_lcd_bsp/HAL/src/alt_write.c deleted file mode 100644 index 51debb5..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/alt_write.c +++ /dev/null @@ -1,138 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -#include "sys/alt_log_printf.h" - -/* - * The write() system call is used to write a block of data to a file or - * device. This function simply vectors the request to the device driver - * associated with the input file descriptor "file". - * - * ALT_WRITE is mapped onto the write() system call in alt_syscall.h - */ - -#ifdef ALT_USE_DIRECT_DRIVERS - -#include "system.h" -#include "sys/alt_driver.h" - -/* - * Provide minimal version that just writes to the stdout/stderr devices - * when provided. - */ - -int ALT_WRITE (int file, const void *ptr, size_t len) -{ -#ifdef ALT_STDOUT_PRESENT - ALT_DRIVER_WRITE_EXTERNS(ALT_STDOUT_DEV); -#endif -#ifdef ALT_STDERR_PRESENT - ALT_DRIVER_WRITE_EXTERNS(ALT_STDERR_DEV); -#endif - -#if !defined(ALT_STDOUT_PRESENT) && !defined(ALT_STDERR_PRESENT) - /* Generate a link time warning, should this function ever be called. */ - ALT_STUB_WARNING(write); -#endif - - switch (file) { -#ifdef ALT_STDOUT_PRESENT - case 1: /* stdout file descriptor */ - return ALT_DRIVER_WRITE(ALT_STDOUT_DEV, ptr, len, 0); -#endif /* ALT_STDOUT_PRESENT */ -#ifdef ALT_STDERR_PRESENT - case 2: /* stderr file descriptor */ - return ALT_DRIVER_WRITE(ALT_STDERR_DEV, ptr, len, 0); -#endif /* ALT_STDERR_PRESENT */ - default: - ALT_ERRNO = EBADFD; - return -1; - } -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -int ALT_WRITE (int file, const void *ptr, size_t len) -{ - alt_fd* fd; - int rval; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - /* - * If the file has not been opened with write access, or if the driver does - * not provide an implementation of write(), generate an error. Otherwise - * call the drivers write() function to process the request. - */ - - if (((fd->fd_flags & O_ACCMODE) != O_RDONLY) && fd->dev->write) - { - - /* ALT_LOG - see altera_hal/HAL/inc/sys/alt_log_printf.h */ - ALT_LOG_WRITE_FUNCTION(ptr,len); - - if ((rval = fd->dev->write(fd, ptr, len)) < 0) - { - ALT_ERRNO = -rval; - return -1; - } - return rval; - } - else - { - ALT_ERRNO = EACCES; - } - } - else - { - ALT_ERRNO = EBADFD; - } - return -1; -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/altera_nios2_qsys_irq.c b/software/qsys_tutorial_lcd_bsp/HAL/src/altera_nios2_qsys_irq.c deleted file mode 100644 index c7a4f93..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/altera_nios2_qsys_irq.c +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2009 Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - * - * altera_nios2_irq.c - Support for Nios II internal interrupt controller. - * - */ - -#include "sys/alt_irq.h" -#include "altera_nios2_qsys_irq.h" - -/* - * To initialize the internal interrupt controller, just clear the IENABLE - * register so that all possible IRQs are disabled. - */ -void altera_nios2_qsys_irq_init(void) -{ - NIOS2_WRITE_IENABLE(0); -} diff --git a/software/qsys_tutorial_lcd_bsp/HAL/src/crt0.S b/software/qsys_tutorial_lcd_bsp/HAL/src/crt0.S deleted file mode 100644 index 582445d..0000000 --- a/software/qsys_tutorial_lcd_bsp/HAL/src/crt0.S +++ /dev/null @@ -1,456 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "system.h" -#include "nios2.h" - -/* Setup header files to work with assembler code. */ -#define ALT_ASM_SRC - -/* Debug logging facility */ -#include "sys/alt_log_printf.h" - -/*************************************************************************\ -| MACROS | -\*************************************************************************/ - -/* - * The new build tools explicitly define macros when alt_load() - * must be called. The define ALT_LOAD_EXPLICITLY_CONTROLLED tells us that - * those macros are controlling if alt_load() needs to be called. - */ -#ifdef ALT_LOAD_EXPLICITLY_CONTROLLED - -/* Need to call alt_load() if any of these sections are being copied. */ -#if defined(ALT_LOAD_COPY_RODATA) || defined(ALT_LOAD_COPY_RWDATA) || defined(ALT_LOAD_COPY_EXCEPTIONS) -#define CALL_ALT_LOAD -#endif - -#else /* !ALT_LOAD_EXPLICITLY_CONTROLLED */ - -/* - * The legacy build tools use the following macros to detect when alt_load() - * needs to be called. - */ - -#define __ALT_LOAD_SECTIONS(res, text, rodata, exc) \ - ((res##_BASE != rodata##_BASE) || \ - (res##_BASE != rwdata##_BASE) || \ - (res##_BASE != exc##_BASE)) - -#define _ALT_LOAD_SECTIONS(res, text, rodata, exc) \ - __ALT_LOAD_SECTIONS(res, text, rodata, exc) - -#define ALT_LOAD_SECTIONS _ALT_LOAD_SECTIONS(ALT_RESET_DEVICE, \ - ALT_RODATA_DEVICE, \ - ALT_RWDATA_DEVICE, \ - ALT_EXCEPTIONS_DEVICE) - -/* Call alt_load() if there is no bootloader and ALT_LOAD_SECTIONS isn't 0. */ -#if defined(ALT_NO_BOOTLOADER) && ALT_LOAD_SECTIONS -#define CALL_ALT_LOAD -#endif - -#endif /* !ALT_LOAD_EXPLICITLY_CONTROLLED */ - -/* - * When the legacy build tools define a macro called ALT_NO_BOOTLOADER, - * it indicates that initialization code is allowed at the reset address. - * The new build tools define a macro called ALT_ALLOW_CODE_AT_RESET for - * the same purpose. - */ -#ifdef ALT_NO_BOOTLOADER -#define ALT_ALLOW_CODE_AT_RESET -#endif - -/*************************************************************************\ -| EXTERNAL REFERENCES | -\*************************************************************************/ - -/* - * The entry point for user code is either "main" in hosted mode, or - * "alt_main" in standalone mode. These are explicitly referenced here, - * to ensure they are built into the executable. This allows the user - * to build them into libraries, rather than supplying them in object - * files at link time. - */ - .globl main - .globl alt_main - -/* - * Create a reference to the software multiply/divide and trap handers, - * so that if they are provided, they will appear in the executable. - */ -#ifndef ALT_NO_INSTRUCTION_EMULATION - .globl alt_exception_muldiv -#endif -#ifdef ALT_TRAP_HANDLER - .globl alt_exception_trap -#endif - -/* - * Linker defined symbols used to initialize bss. - */ -.globl __bss_start -.globl __bss_end - -/*************************************************************************\ -| RESET SECTION (.entry) | -\*************************************************************************/ - -/* - * This is the reset entry point for Nios II. - * - * At reset, only the cache line which contain the reset vector is - * initialized by the hardware. The code within the first cache line - * initializes the remainder of the instruction cache. - */ - - .section .entry, "xa" - .align 5 - -/* - * Explicitly allow the use of r1 (the assembler temporary register) - * within this code. This register is normally reserved for the use of - * the assembler. - */ - .set noat - -/* - * Some tools want to know where the reset vector is. - * Code isn't always provided at the reset vector but at least the - * __reset label always contains the reset vector address because - * it is defined at the start of the .entry section. - */ - - .globl __reset - .type __reset, @function -__reset: - -/* - * Initialize the instruction cache if present (i.e. size > 0) and - * reset code is allowed unless optimizing for RTL simulation. - * RTL simulations can ensure the instruction cache is already initialized - * so skipping this loop speeds up RTL simulation. - */ - -#if NIOS2_ICACHE_SIZE > 0 && defined(ALT_ALLOW_CODE_AT_RESET) && !defined(ALT_SIM_OPTIMIZE) - /* Assume the instruction cache size is always a power of two. */ -#if NIOS2_ICACHE_SIZE > 0x8000 - movhi r2, %hi(NIOS2_ICACHE_SIZE) -#else - movui r2, NIOS2_ICACHE_SIZE -#endif - -0: - initi r2 - addi r2, r2, -NIOS2_ICACHE_LINE_SIZE - bgt r2, zero, 0b -1: - - /* - * The following debug information tells the ISS not to run the loop above - * but to perform its actions using faster internal code. - */ - .pushsection .debug_alt_sim_info - .int 1, 1, 0b, 1b - .popsection -#endif /* Initialize Instruction Cache */ - -/* - * Jump to the _start entry point in the .text section if reset code - * is allowed or if optimizing for RTL simulation. - */ -#if defined(ALT_ALLOW_CODE_AT_RESET) || defined(ALT_SIM_OPTIMIZE) - /* Jump to the _start entry point in the .text section. */ - movhi r1, %hi(_start) - ori r1, r1, %lo(_start) - jmp r1 - - .size __reset, . - __reset -#endif /* Jump to _start */ - -/* - * When not using exit, provide an _exit symbol to prevent unresolved - * references to _exit from the linker script. - */ -#ifdef ALT_NO_EXIT - .globl _exit -_exit: -#endif - -/*************************************************************************\ -| TEXT SECTION (.text) | -\*************************************************************************/ - -/* - * Start of the .text section, and also the code entry point when - * the code is executed by a bootloader rather than directly from reset. - */ - .section .text - .align 2 - - .globl _start - .type _start, @function -_start: - -/* - * Initialize the data cache if present (i.e. size > 0) and not - * optimizing for RTL simulation. - * RTL simulations can ensure the data cache is already initialized - * so skipping this loop speeds up RTL simulation. - */ - -#if NIOS2_DCACHE_SIZE > 0 && !defined(ALT_SIM_OPTIMIZE) - - /* Assume the data cache size is always a power of two. */ -#if NIOS2_DCACHE_SIZE > 0x8000 - movhi r2, %hi(NIOS2_DCACHE_SIZE) -#else - movui r2, NIOS2_DCACHE_SIZE -#endif - -0: - initd 0(r2) - addi r2, r2, -NIOS2_DCACHE_LINE_SIZE - bgt r2, zero, 0b -1: - - /* - * The following debug information tells the ISS not to run the loop above - * but to perform its actions using faster internal code. - */ - .pushsection .debug_alt_sim_info - .int 2, 1, 0b, 1b - .popsection - -#endif /* Initialize Data Cache */ - - /* Log that caches have been initialized. */ - ALT_LOG_PUTS(alt_log_msg_cache) - - /* Log that the stack pointer is about to be setup. */ - ALT_LOG_PUTS(alt_log_msg_stackpointer) - -#if (NIOS2_NUM_OF_SHADOW_REG_SETS == 0) - /* - * Now that the caches are initialized, set up the stack pointer. - * The value provided by the linker is assumed to be correctly aligned. - */ - movhi sp, %hi(__alt_stack_pointer) - ori sp, sp, %lo(__alt_stack_pointer) - - /* Set up the global pointer. */ - movhi gp, %hi(_gp) - ori gp, gp, %lo(_gp) - -#else /* NIOS2_NUM_OF_SHADOW_REG_SETS > 0 */ - - /* - * Set up the GP and SP in all shadow register sets. - */ - - /* - * Check current register set number, if CPU resets into a shadow register - * set, switch register set to 0 by writing zero to SSTATUS register and - * execute an ERET instruction that just jumps to the next PC address - * (use the NEXTPC instruction to get this). - */ - - rdctl r2, status - - /* Get the current register set number (STATUS.CRS). */ - andi r3, r2, NIOS2_STATUS_CRS_MSK - - /* Skip switch register set if STATUS.CRS is 0. */ - beq r3, zero, .Lskip_switch_reg_set - - .set nobreak - - /* Current register set is non-zero, set SSTATUS to 0. */ - mov sstatus, zero - - /* Get next pc and store in ea. */ - nextpc ea - - /* Point to instruction after eret. */ - addi ea, ea, 8 - - /* - * Execute ERET instruction that just jumps to the next PC address - */ - eret - -.Lskip_switch_reg_set: - mov r2, zero - - /* Reset STATUS register */ - wrctl status, r2 - - movui r3, NIOS2_NUM_OF_SHADOW_REG_SETS - - /* Set up the stack pointer in register set 0. */ - movhi sp, %hi(__alt_stack_pointer) - ori sp, sp, %lo(__alt_stack_pointer) - - /* Set up the global pointer in register set 0. */ - movhi gp, %hi(_gp) - ori gp, gp, %lo(_gp) - -.Lsetup_sp_and_gp_loop: - /* - * Setup GP and SP for shadow register set - * from NIOS2_NUM_OF_SHADOW_REG_SETS to 0 - */ - - /* Skip if number of register sets is 0. */ - beq r3, zero, .Lno_shadow_register_set - - - /* Add previous register set STATUS.PRS by 1 */ - movhi r4, 1 - add r2, r2, r4 - - /* Write STATUS */ - wrctl status, r2 - - /* Clear r0 in the shadow register set (not done by hardware) */ - wrprs r0, r0 - - /* Write the GP in previous register set */ - wrprs gp, gp - - /* Only write the SP in previous register set - * if using the seperate exception stack. For normal case (single stack), - * funnel code would read the SP from previous register set. - */ -#ifdef ALT_INTERRUPT_STACK - - movhi et, %hiadj(__alt_interrupt_stack_pointer) - addi et, et, %lo(__alt_interrupt_stack_pointer) - wrprs sp, et - -#endif /* ALT_INTERRUPT_STACK */ - - /* Decrease number of register set counter by 1 */ - addi r3, r3, -1 - - br .Lsetup_sp_and_gp_loop -.Lno_shadow_register_set: - -#endif /* NIOS2_NUM_OF_SHADOW_REG_SETS */ -/* - * Clear the BSS if not optimizing for RTL simulation. - * - * This uses the symbols: __bss_start and __bss_end, which are defined - * by the linker script. They mark the begining and the end of the bss - * region. The linker script guarantees that these values are word aligned. - */ -#ifndef ALT_SIM_OPTIMIZE - /* Log that the BSS is about to be cleared. */ - ALT_LOG_PUTS(alt_log_msg_bss) - - movhi r2, %hi(__bss_start) - ori r2, r2, %lo(__bss_start) - - movhi r3, %hi(__bss_end) - ori r3, r3, %lo(__bss_end) - - beq r2, r3, 1f - -0: - stw zero, (r2) - addi r2, r2, 4 - bltu r2, r3, 0b - -1: - - /* - * The following debug information tells the ISS not to run the loop above - * but to perform its actions using faster internal code. - */ - .pushsection .debug_alt_sim_info - .int 3, 1, 0b, 1b - .popsection -#endif /* ALT_SIM_OPTIMIZE */ - -/* - * The alt_load() facility is normally used when there is no bootloader. - * It copies some sections into RAM so it acts like a mini-bootloader. - */ -#ifdef CALL_ALT_LOAD - -#ifdef ALT_STACK_CHECK - /* - * If the user has selected stack checking then we need to set up a safe - * value in the stack limit register so that the relocation functions - * don't think the stack has overflowed (the contents of the rwdata - * section aren't defined until alt_load() has been called). - */ - mov et, zero -#endif - - call alt_load - -#endif /* CALL_ALT_LOAD */ - -#ifdef ALT_STACK_CHECK - /* - * Set up the stack limit (if required). The linker has set up the - * copy of the variable which is in memory. - */ - - ldw et, %gprel(alt_stack_limit_value)(gp) -#endif - - /* Log that alt_main is about to be called. */ - ALT_LOG_PUTS(alt_log_msg_alt_main) - - /* Call the C entry point. It should never return. */ - call alt_main - - /* Wait in infinite loop in case alt_main does return. */ -alt_after_alt_main: - br alt_after_alt_main - - .size _start, . - _start - -/* - * Add information about the stack base if stack overflow checking is enabled. - */ -#ifdef ALT_STACK_CHECK - .globl alt_stack_limit_value - .section .sdata,"aws",@progbits - .align 2 - .type alt_stack_limit_value, @object - .size alt_stack_limit_value, 4 -alt_stack_limit_value: - .long __alt_stack_limit -#endif diff --git a/software/qsys_tutorial_lcd_bsp/Makefile b/software/qsys_tutorial_lcd_bsp/Makefile deleted file mode 100644 index dcf3b22..0000000 --- a/software/qsys_tutorial_lcd_bsp/Makefile +++ /dev/null @@ -1,766 +0,0 @@ -#------------------------------------------------------------------------------ -# BSP MAKEFILE -# -# This makefile was automatically generated by the nios2-bsp-generate-files -# command. Its purpose is to build a custom Board Support Package (BSP) -# targeting a specific Nios II processor in an SOPC Builder-based design. -# -# To create an application or library Makefile which uses this BSP, try the -# nios2-app-generate-makefile or nios2-lib-generate-makefile commands. -#------------------------------------------------------------------------------ - -#------------------------------------------------------------------------------ -# TOOLS -#------------------------------------------------------------------------------ - -MKDIR := mkdir -p -ECHO := echo -SPACE := $(empty) $(empty) - -#------------------------------------------------------------------------------ -# The adjust-path macro -# -# If COMSPEC is defined, Make is launched from Windows through -# Cygwin. This adjust-path macro will call 'cygpath -u' on all -# paths to ensure they are readable by Make. -# -# If COMSPEC is not defined, Make is launched from *nix, and no adjustment -# is necessary -#------------------------------------------------------------------------------ - -ifndef COMSPEC -ifdef ComSpec -COMSPEC = $(ComSpec) -endif # ComSpec -endif # !COMSPEC - -ifdef COMSPEC - adjust-path = $(subst $(SPACE),\$(SPACE),$(shell cygpath -u "$1")) - adjust-path-mixed = $(subst $(SPACE),\$(SPACE),$(shell cygpath -m "$1")) -else - adjust-path = $(subst $(SPACE),\$(SPACE),$1) - adjust-path-mixed = $(subst $(SPACE),\$(SPACE),$1) -endif - -#------------------------------------------------------------------------------ -# DEFAULT TARGET -# -# The default target, "all", must appear before any other target in the -# Makefile. Note that extra prerequisites are added to the "all" rule later. -#------------------------------------------------------------------------------ -.PHONY: all -all: - @$(ECHO) [BSP build complete] - - -#------------------------------------------------------------------------------ -# PATHS & DIRECTORY NAMES -# -# Explicitly locate absolute path of the BSP root -#------------------------------------------------------------------------------ - -BSP_ROOT_DIR := . - -# Define absolute path to the root of the BSP. -ABS_BSP_ROOT := $(call adjust-path-mixed,$(shell pwd)) - -# Stash all BSP object files here -OBJ_DIR := ./obj - -NEWLIB_DIR = $(BSP_ROOT_DIR)/newlib - - -#------------------------------------------------------------------------------ -# MANAGED CONTENT -# -# All content between the lines "START MANAGED" and "END MANAGED" below is -# generated based on variables in the BSP settings file when the -# nios2-bsp-generate-files command is invoked. If you wish to persist any -# information pertaining to the build process, it is recomended that you -# utilize the BSP settings mechanism to do so. -# -# Note that most variable assignments in this section have a corresponding BSP -# setting that can be changed by using the nios2-bsp-create-settings or -# nios2-bsp-update-settings command before nios2-bsp-generate-files; if you -# want any variable set to a specific value when this Makefile is re-generated -# (to prevent hand-edits from being over-written), use the BSP settings -# facilities above. -#------------------------------------------------------------------------------ - -#START MANAGED - -# The following TYPE comment allows tools to identify the 'type' of target this -# makefile is associated with. -# TYPE: BSP_PRIVATE_MAKEFILE - -# This following VERSION comment indicates the version of the tool used to -# generate this makefile. A makefile variable is provided for VERSION as well. -# ACDS_VERSION: 13.0sp1 -ACDS_VERSION := 13.0sp1 - -# This following BUILD_NUMBER comment indicates the build number of the tool -# used to generate this makefile. -# BUILD_NUMBER: 232 - -SETTINGS_FILE := settings.bsp -SOPC_FILE := C:/Users/takayun/Documents/DE2-115/qsys_tutorial/nios_system.sopcinfo - -#------------------------------------------------------------------------------- -# TOOL & COMMAND DEFINITIONS -# -# The base command for each build operation are expressed here. Additional -# switches may be expressed here. They will run for all instances of the -# utility. -#------------------------------------------------------------------------------- - -# Archiver command. Creates library files. -AR = nios2-elf-ar - -# Assembler command. Note that CC is used for .S files. -AS = nios2-elf-gcc - -# Custom flags only passed to the archiver. This content of this variable is -# directly passed to the archiver rather than the more standard "ARFLAGS". The -# reason for this is that GNU Make assumes some default content in ARFLAGS. -# This setting defines the value of BSP_ARFLAGS in Makefile. -BSP_ARFLAGS = -src - -# Custom flags only passed to the assembler. This setting defines the value of -# BSP_ASFLAGS in Makefile. -BSP_ASFLAGS = -Wa,-gdwarf2 - -# C/C++ compiler debug level. '-g' provides the default set of debug symbols -# typically required to debug a typical application. Omitting '-g' removes -# debug symbols from the ELF. This setting defines the value of -# BSP_CFLAGS_DEBUG in Makefile. -BSP_CFLAGS_DEBUG = -g - -# C/C++ compiler optimization level. "-O0" = no optimization,"-O2" = "normal" -# optimization, etc. "-O0" is recommended for code that you want to debug since -# compiler optimization can remove variables and produce non-sequential -# execution of code while debugging. This setting defines the value of -# BSP_CFLAGS_OPTIMIZATION in Makefile. -BSP_CFLAGS_OPTIMIZATION = '-Os' - -# C/C++ compiler warning level. "-Wall" is commonly used.This setting defines -# the value of BSP_CFLAGS_WARNINGS in Makefile. -BSP_CFLAGS_WARNINGS = -Wall - -# C compiler command. -CC = nios2-elf-gcc -xc - -# C++ compiler command. -CXX = nios2-elf-gcc -xc++ - -# Command used to remove files during 'clean' target. -RM = rm -f - - -#------------------------------------------------------------------------------- -# BUILD PRE & POST PROCESS COMMANDS -# -# The following variables are treated as shell commands in the rule -# definitions for each file-type associated with the BSP build, as well as -# commands run at the beginning and end of the entire BSP build operation. -# Pre-process commands are executed before the relevant command (for example, -# a command defined in the "CC_PRE_PROCESS" variable executes before the C -# compiler for building .c files), while post-process commands are executed -# immediately afterwards. -# -# You can view each pre/post-process command in the "Build Rules: All & -# Clean", "Pattern Rules to Build Objects", and "Library Rules" sections of -# this Makefile. -#------------------------------------------------------------------------------- - - -#------------------------------------------------------------------------------- -# BSP SOURCE BUILD SETTINGS (FLAG GENERATION) -# -# Software build settings such as compiler optimization, debug level, warning -# flags, etc., may be defined in the following variables. The variables below -# are concatenated together in the 'Flags' section of this Makefile to form -# final variables of flags passed to the build tools. -# -# These settings are considered private to the BSP and apply to all library & -# driver files in it; they do NOT automatically propagate to, for example, the -# build settings for an application. -# # For additional detail and syntax requirements, please refer to GCC help -# (example: "nios2-elf-gcc --help --verbose"). -# -# Unless indicated otherwise, multiple entries in each variable should be -# space-separated. -#------------------------------------------------------------------------------- - -# Altera HAL alt_sys_init.c generated source file -GENERATED_C_FILES := $(ABS_BSP_ROOT)/alt_sys_init.c -GENERATED_C_LIB_SRCS += alt_sys_init.c - - -#------------------------------------------------------------------------------- -# BSP SOURCE FILE LISTING -# -# All source files that comprise the BSP are listed here, along with path -# information to each file expressed relative to the BSP root. The precise -# list and location of each file is derived from the driver, operating system, -# or software package source file declarations. -# -# Following specification of the source files for each component, driver, etc., -# each source file type (C, assembly, etc.) is concatenated together and used -# to construct a list of objects. Pattern rules to build each object are then -# used to build each file. -#------------------------------------------------------------------------------- - -# altera_avalon_jtag_uart_driver sources root -altera_avalon_jtag_uart_driver_SRCS_ROOT := drivers - -# altera_avalon_jtag_uart_driver sources -altera_avalon_jtag_uart_driver_C_LIB_SRCS := \ - $(altera_avalon_jtag_uart_driver_SRCS_ROOT)/src/altera_avalon_jtag_uart_init.c \ - $(altera_avalon_jtag_uart_driver_SRCS_ROOT)/src/altera_avalon_jtag_uart_read.c \ - $(altera_avalon_jtag_uart_driver_SRCS_ROOT)/src/altera_avalon_jtag_uart_write.c \ - $(altera_avalon_jtag_uart_driver_SRCS_ROOT)/src/altera_avalon_jtag_uart_ioctl.c \ - $(altera_avalon_jtag_uart_driver_SRCS_ROOT)/src/altera_avalon_jtag_uart_fd.c - -# altera_avalon_pio_driver sources root -altera_avalon_pio_driver_SRCS_ROOT := drivers - -# altera_avalon_pio_driver sources -# altera_nios2_qsys_hal_driver sources root -altera_nios2_qsys_hal_driver_SRCS_ROOT := HAL - -# altera_nios2_qsys_hal_driver sources -altera_nios2_qsys_hal_driver_C_LIB_SRCS := \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/altera_nios2_qsys_irq.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_usleep.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_busy_sleep.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_irq_vars.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_icache_flush.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_icache_flush_all.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_dcache_flush.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_dcache_flush_all.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_dcache_flush_no_writeback.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_instruction_exception_entry.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_irq_register.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_iic.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_remap_cached.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_remap_uncached.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_uncached_free.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_uncached_malloc.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_do_ctors.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_do_dtors.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_gmon.c - -altera_nios2_qsys_hal_driver_ASM_LIB_SRCS := \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_exception_entry.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_exception_trap.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_exception_muldiv.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_irq_entry.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_software_exception.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_mcount.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_log_macro.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/crt0.S - -# hal sources root -hal_SRCS_ROOT := HAL - -# hal sources -hal_C_LIB_SRCS := \ - $(hal_SRCS_ROOT)/src/alt_alarm_start.c \ - $(hal_SRCS_ROOT)/src/alt_close.c \ - $(hal_SRCS_ROOT)/src/alt_dev.c \ - $(hal_SRCS_ROOT)/src/alt_dev_llist_insert.c \ - $(hal_SRCS_ROOT)/src/alt_dma_rxchan_open.c \ - $(hal_SRCS_ROOT)/src/alt_dma_txchan_open.c \ - $(hal_SRCS_ROOT)/src/alt_environ.c \ - $(hal_SRCS_ROOT)/src/alt_env_lock.c \ - $(hal_SRCS_ROOT)/src/alt_errno.c \ - $(hal_SRCS_ROOT)/src/alt_execve.c \ - $(hal_SRCS_ROOT)/src/alt_exit.c \ - $(hal_SRCS_ROOT)/src/alt_fcntl.c \ - $(hal_SRCS_ROOT)/src/alt_fd_lock.c \ - $(hal_SRCS_ROOT)/src/alt_fd_unlock.c \ - $(hal_SRCS_ROOT)/src/alt_find_dev.c \ - $(hal_SRCS_ROOT)/src/alt_find_file.c \ - $(hal_SRCS_ROOT)/src/alt_flash_dev.c \ - $(hal_SRCS_ROOT)/src/alt_fork.c \ - $(hal_SRCS_ROOT)/src/alt_fs_reg.c \ - $(hal_SRCS_ROOT)/src/alt_fstat.c \ - $(hal_SRCS_ROOT)/src/alt_get_fd.c \ - $(hal_SRCS_ROOT)/src/alt_getchar.c \ - $(hal_SRCS_ROOT)/src/alt_getpid.c \ - $(hal_SRCS_ROOT)/src/alt_gettod.c \ - $(hal_SRCS_ROOT)/src/alt_iic_isr_register.c \ - $(hal_SRCS_ROOT)/src/alt_instruction_exception_register.c \ - $(hal_SRCS_ROOT)/src/alt_ioctl.c \ - $(hal_SRCS_ROOT)/src/alt_io_redirect.c \ - $(hal_SRCS_ROOT)/src/alt_irq_handler.c \ - $(hal_SRCS_ROOT)/src/alt_isatty.c \ - $(hal_SRCS_ROOT)/src/alt_kill.c \ - $(hal_SRCS_ROOT)/src/alt_link.c \ - $(hal_SRCS_ROOT)/src/alt_load.c \ - $(hal_SRCS_ROOT)/src/alt_log_printf.c \ - $(hal_SRCS_ROOT)/src/alt_lseek.c \ - $(hal_SRCS_ROOT)/src/alt_main.c \ - $(hal_SRCS_ROOT)/src/alt_malloc_lock.c \ - $(hal_SRCS_ROOT)/src/alt_open.c \ - $(hal_SRCS_ROOT)/src/alt_printf.c \ - $(hal_SRCS_ROOT)/src/alt_putchar.c \ - $(hal_SRCS_ROOT)/src/alt_putstr.c \ - $(hal_SRCS_ROOT)/src/alt_read.c \ - $(hal_SRCS_ROOT)/src/alt_release_fd.c \ - $(hal_SRCS_ROOT)/src/alt_rename.c \ - $(hal_SRCS_ROOT)/src/alt_sbrk.c \ - $(hal_SRCS_ROOT)/src/alt_settod.c \ - $(hal_SRCS_ROOT)/src/alt_stat.c \ - $(hal_SRCS_ROOT)/src/alt_tick.c \ - $(hal_SRCS_ROOT)/src/alt_times.c \ - $(hal_SRCS_ROOT)/src/alt_unlink.c \ - $(hal_SRCS_ROOT)/src/alt_wait.c \ - $(hal_SRCS_ROOT)/src/alt_write.c - - -# Assemble all component C source files -COMPONENT_C_LIB_SRCS += \ - $(altera_avalon_jtag_uart_driver_C_LIB_SRCS) \ - $(altera_nios2_qsys_hal_driver_C_LIB_SRCS) \ - $(hal_C_LIB_SRCS) - -# Assemble all component assembly source files -COMPONENT_ASM_LIB_SRCS += \ - $(altera_nios2_qsys_hal_driver_ASM_LIB_SRCS) - -# Assemble all component C++ source files -COMPONENT_CPP_LIB_SRCS += \ - -#END MANAGED - -#------------------------------------------------------------------------------ -# PUBLIC.MK -# -# The generated public.mk file contains BSP information that is shared with -# other external makefiles, such as a Nios II application makefile. System- -# dependent information such as hardware-specific compiler flags and -# simulation file generation are stored here. -# -# In addition, public.mk contains include paths that various software, -# such as a device driver, may need for the C compiler. These paths are -# written to public.mk with respect to the BSP root. In public.mk, each -# path is prefixed with a special variable, $(ALT_LIBRARY_ROOT_DIR). The -# purpose of this variable is to allow an external Makefile to append on -# path information to precisely locate paths expressed in public.mk -# Since this is the BSP Makefile, we set ALT_LIBRARY_ROOT_DIR to point right -# here ("."), at the BSP root. -# -# ALT_LIBRARY_ROOT_DIR must always be set before public.mk is included. -#------------------------------------------------------------------------------ -ALT_LIBRARY_ROOT_DIR := . -include public.mk - - -#------------------------------------------------------------------------------ -# FLAGS -# -# Include paths for BSP files are written into the public.mk file and must -# be added to the existing list of pre-processor flags. In addition, "hooks" -# for standard flags left intentionally empty (CFLAGS, CPPFLAGS, ASFLAGS, -# and CXXFLAGS) are provided for conveniently adding to the relevant flags -# on the command-line or via script that calls make. -#------------------------------------------------------------------------------ -# Assemble final list of compiler flags from generated content -BSP_CFLAGS += \ - $(BSP_CFLAGS_DEFINED_SYMBOLS) \ - $(BSP_CFLAGS_UNDEFINED_SYMBOLS) \ - $(BSP_CFLAGS_OPTIMIZATION) \ - $(BSP_CFLAGS_DEBUG) \ - $(BSP_CFLAGS_WARNINGS) \ - $(BSP_CFLAGS_USER_FLAGS) \ - $(ALT_CFLAGS) \ - $(CFLAGS) - -# Make ready the final list of include directories and other C pre-processor -# flags. Each include path is made ready by prefixing it with "-I". -BSP_CPPFLAGS += \ - $(addprefix -I, $(BSP_INC_DIRS)) \ - $(addprefix -I, $(ALT_INCLUDE_DIRS)) \ - $(ALT_CPPFLAGS) \ - $(CPPFLAGS) - -# Finish off assembler flags with any user-provided flags -BSP_ASFLAGS += $(ASFLAGS) - -# Finish off C++ flags with any user-provided flags -BSP_CXXFLAGS += $(CXXFLAGS) - -# And finally, the ordered list -C_SRCS += $(GENERATED_C_LIB_SRCS) \ - $(COMPONENT_C_LIB_SRCS) - -CXX_SRCS += $(GENERATED_CPP_LIB_SRCS) \ - $(COMPONENT_CPP_LIB_SRCS) - -ASM_SRCS += $(GENERATED_ASM_LIB_SRCS) \ - $(COMPONENT_ASM_LIB_SRCS) - - -#------------------------------------------------------------------------------ -# LIST OF GENERATED FILES -# -# A Nios II BSP relies on the generation of several source files used -# by both the BSP and any applications referencing the BSP. -#------------------------------------------------------------------------------ - - -GENERATED_H_FILES := $(ABS_BSP_ROOT)/system.h - -GENERATED_LINKER_SCRIPT := $(ABS_BSP_ROOT)/linker.x - -GENERATED_FILES += $(GENERATED_H_FILES) \ - $(GENERATED_LINKER_SCRIPT) - - -#------------------------------------------------------------------------------ -# SETUP TO BUILD OBJECTS -# -# List of object files which are to be built. This is constructed from the input -# list of C source files (C_SRCS), C++ source files (CXX_SRCS), and assembler -# source file (ASM_SRCS). The permitted file extensions are: -# -# .c .C - for C files -# .cxx .cc .cpp .CXX .CC .CPP - for C++ files -# .S .s - for assembly files -# -# Extended description: The list of objects is a sorted list (duplicates -# removed) of all possible objects, placed beneath the ./obj directory, -# including any path information stored in the "*_SRCS" variable. The -# "patsubst" commands are used to concatenate together multiple file suffix -# types for common files (i.e. c++ as .cxx, .cc, .cpp). -# -# File extensions are case-insensitive in build rules with the exception of -# assembly sources. Nios II assembly sources with the ".S" extension are first -# run through the C preprocessor. Sources with the ".s" extension are not. -#------------------------------------------------------------------------------ -OBJS = $(sort $(addprefix $(OBJ_DIR)/, \ - $(patsubst %.c, %.o, $(patsubst %.C, %.o, $(C_SRCS))) \ - $(patsubst %.cxx, %.o, $(patsubst %.CXX, %.o, \ - $(patsubst %.cc, %.o, $(patsubst %.CC, %.o, \ - $(patsubst %.cpp, %.o, $(patsubst %.CPP, %.o, \ - $(CXX_SRCS) )))))) \ - $(patsubst %.S, %.o, $(patsubst %.s, %.o, $(ASM_SRCS))) )) - -# List of dependancy files for each object file. -DEPS = $(OBJS:.o=.d) - - -# Rules to force your project to rebuild or relink -# .force_relink file will cause any application that depends on this project to relink -# .force_rebuild file will cause this project to rebuild object files -# .force_rebuild_all file will cause this project and any project that depends on this project to rebuild object files - -FORCE_RELINK_DEP := .force_relink -FORCE_REBUILD_DEP := .force_rebuild -FORCE_REBUILD_ALL_DEP := .force_rebuild_all -FORCE_REBUILD_DEP_LIST := $(FORCE_RELINK_DEP) $(FORCE_REBUILD_DEP) $(FORCE_REBUILD_ALL_DEP) - -$(FORCE_REBUILD_DEP_LIST): - -$(OBJS): $(wildcard $(FORCE_REBUILD_DEP)) $(wildcard $(FORCE_REBUILD_ALL_DEP)) - - -#------------------------------------------------------------------------------ -# BUILD RULES: ALL & CLEAN -#------------------------------------------------------------------------------ -.DELETE_ON_ERROR: - -.PHONY: all -all: build_pre_process -all: Makefile $(GENERATED_FILES) $(BSP_LIB) $(NEWLIB_DIR) -all: build_post_process - - -# clean: remove .o/.a/.d -.PHONY: clean -clean: - @$(RM) -r $(BSP_LIB) $(OBJ_DIR) $(FORCE_REBUILD_DEP_LIST) -ifneq ($(wildcard $(NEWLIB_DIR)),) - @$(RM) -r $(NEWLIB_DIR) -endif - @$(ECHO) [BSP clean complete] - - -#------------------------------------------------------------------------------ -# BUILD PRE/POST PROCESS -#------------------------------------------------------------------------------ -build_pre_process : - $(BUILD_PRE_PROCESS) - -build_post_process : - $(BUILD_POST_PROCESS) - -.PHONY: build_pre_process build_post_process - - - -#------------------------------------------------------------------------------ -# MAKEFILE UP TO DATE? -# -# Is this very Makefile up to date? Someone may have changed the BSP settings -# file or the associated target hardware. -#------------------------------------------------------------------------------ -# Skip this check when clean is the only target -ifneq ($(MAKECMDGOALS),clean) - -ifneq ($(wildcard $(SETTINGS_FILE)),$(SETTINGS_FILE)) -$(warning Warning: BSP Settings File $(SETTINGS_FILE) could not be found.) -endif - -Makefile: $(wildcard $(SETTINGS_FILE)) - @$(ECHO) Makefile not up to date. - @$(ECHO) $(SETTINGS_FILE) has been modified since the BSP Makefile was generated. - @$(ECHO) - @$(ECHO) Generate the BSP to update the Makefile, and then build again. - @$(ECHO) - @$(ECHO) To generate from Eclipse: - @$(ECHO) " 1. Right-click the BSP project." - @$(ECHO) " 2. In the Nios II Menu, click Generate BSP." - @$(ECHO) - @$(ECHO) To generate from the command line: - @$(ECHO) " nios2-bsp-generate-files --settings= --bsp-dir=" - @$(ECHO) - @exit 1 - -ifneq ($(wildcard $(SOPC_FILE)),$(SOPC_FILE)) -$(warning Warning: SOPC File $(SOPC_FILE) could not be found.) -endif - -public.mk: $(wildcard $(SOPC_FILE)) - @$(ECHO) Makefile not up to date. - @$(ECHO) $(SOPC_FILE) has been modified since the BSP was generated. - @$(ECHO) - @$(ECHO) Generate the BSP to update the Makefile, and then build again. - @$(ECHO) - @$(ECHO) To generate from Eclipse: - @$(ECHO) " 1. Right-click the BSP project." - @$(ECHO) " 2. In the Nios II Menu, click Generate BSP." - @$(ECHO) - @$(ECHO) To generate from the command line: - @$(ECHO) " nios2-bsp-generate-files --settings= --bsp-dir=" - @$(ECHO) - @exit 1 - -endif # $(MAKECMDGOALS) != clean - -#------------------------------------------------------------------------------ -# PATTERN RULES TO BUILD OBJECTS -#------------------------------------------------------------------------------ -$(OBJ_DIR)/%.o: %.c - @$(ECHO) Compiling $( - -/* - * Device headers - */ - -#include "altera_nios2_qsys_irq.h" -#include "altera_avalon_jtag_uart.h" - -/* - * Allocate the device storage - */ - -ALTERA_NIOS2_QSYS_IRQ_INSTANCE ( NIOS2_PROCESSOR, nios2_processor); -ALTERA_AVALON_JTAG_UART_INSTANCE ( JTAG_UART, jtag_uart); - -/* - * Initialize the interrupt controller devices - * and then enable interrupts in the CPU. - * Called before alt_sys_init(). - * The "base" parameter is ignored and only - * present for backwards-compatibility. - */ - -void alt_irq_init ( const void* base ) -{ - ALTERA_NIOS2_QSYS_IRQ_INIT ( NIOS2_PROCESSOR, nios2_processor); - alt_irq_cpu_enable_interrupts(); -} - -/* - * Initialize the non-interrupt controller devices. - * Called after alt_irq_init(). - */ - -void alt_sys_init( void ) -{ - ALTERA_AVALON_JTAG_UART_INIT ( JTAG_UART, jtag_uart); -} diff --git a/software/qsys_tutorial_lcd_bsp/create-this-bsp b/software/qsys_tutorial_lcd_bsp/create-this-bsp deleted file mode 100644 index 49e6175..0000000 --- a/software/qsys_tutorial_lcd_bsp/create-this-bsp +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/bash -# -# This script creates the ucosii_net_zipfs Board Support Package (BSP). - -BSP_TYPE=hal -BSP_DIR=. -SOPC_DIR=../../ -SOPC_FILE=C:/Users/takayun/Documents/DE2-115/qsys_tutorial/nios_system.sopcinfo -NIOS2_BSP_ARGS="--set hal.max_file_descriptors 4 --set hal.enable_small_c_library true --set hal.sys_clk_timer none --set hal.timestamp_timer none --set hal.enable_exit false --set hal.enable_c_plus_plus false --set hal.enable_lightweight_device_driver_api true --set hal.enable_clean_exit false --set hal.enable_sim_optimize false --set hal.enable_reduced_device_drivers true --set hal.make.bsp_cflags_optimization '-Os'" -CPU_NAME= - - -# Don't run make if create-this-app script is called with --no-make arg -SKIP_MAKE= -while [ $# -gt 0 ] -do - case "$1" in - --no-make) - SKIP_MAKE=1 - ;; - *) - NIOS2_BSP_ARGS="$NIOS2_BSP_ARGS $1" - ;; - esac - shift -done - - -# Run nios2-bsp utility to create a hal BSP in this directory -# for the system with a .sopc file in $SOPC_FILE. -# Deprecating $SOPC_DIR in 10.1. Multiple .sopcinfo files in a directory may exist. - -if [ -z "$SOPC_FILE" ]; then - echo "WARNING: Use of a directory for locating a .sopcinfo file is deprecated in 10.1. Multiple .sopcinfo files may exist. You must specify the full .sopcinfo path." - cmd="nios2-bsp $BSP_TYPE $BSP_DIR $SOPC_DIR $NIOS2_BSP_ARGS $CPU_NAME" -else - cmd="nios2-bsp $BSP_TYPE $BSP_DIR $SOPC_FILE $NIOS2_BSP_ARGS $CPU_NAME" -fi - - -echo "create-this-bsp: Running \"$cmd\"" -$cmd || { - echo "$cmd failed" - exit 1 -} -if [ -z "$SKIP_MAKE" ]; then - echo "create-this-bsp: Running make" - make -fi diff --git a/software/qsys_tutorial_lcd_bsp/drivers/inc/altera_avalon_jtag_uart.h b/software/qsys_tutorial_lcd_bsp/drivers/inc/altera_avalon_jtag_uart.h deleted file mode 100644 index 95d4a99..0000000 --- a/software/qsys_tutorial_lcd_bsp/drivers/inc/altera_avalon_jtag_uart.h +++ /dev/null @@ -1,198 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#ifndef __ALT_AVALON_JTAG_UART_H__ -#define __ALT_AVALON_JTAG_UART_H__ - -#include - -#include "sys/alt_alarm.h" -#include "sys/alt_warning.h" - -#include "os/alt_sem.h" -#include "os/alt_flag.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * If the user wants all drivers to be small rather than fast then make sure - * this one is marked as needing to be small. - */ -#if defined ALT_USE_SMALL_DRIVERS && !defined ALTERA_AVALON_JTAG_UART_SMALL -#define ALTERA_AVALON_JTAG_UART_SMALL -#endif - -/* - * If the user wants to ignore FIFO full error after timeout - */ -#if defined ALT_JTAG_UART_IGNORE_FIFO_FULL_ERROR && !defined ALTERA_AVALON_JTAG_UART_IGNORE_FIFO_FULL_ERROR -#define ALTERA_AVALON_JTAG_UART_IGNORE_FIFO_FULL_ERROR -#endif - -/* - * Constants that can be overriden. - */ -#ifndef ALTERA_AVALON_JTAG_UART_DEFAULT_TIMEOUT -#define ALTERA_AVALON_JTAG_UART_DEFAULT_TIMEOUT 10 -#endif - -#ifndef ALTERA_AVALON_JTAG_UART_BUF_LEN -#define ALTERA_AVALON_JTAG_UART_BUF_LEN 2048 -#endif - -/* - * ALT_JTAG_UART_READ_RDY and ALT_JTAG_UART_WRITE_RDY are the bitmasks - * that define uC/OS-II event flags that are releated to this device. - * - * ALT_JTAG_UART_READ_RDY indicates that there is read data in the buffer - * ready to be processed. ALT_JTAG_UART_WRITE_RDY indicates that the transmitter is - * ready for more data. - */ -#define ALT_JTAG_UART_READ_RDY 0x1 -#define ALT_JTAG_UART_WRITE_RDY 0x2 -#define ALT_JTAG_UART_TIMEOUT 0x4 - -/* - * State structure definition. Each instance of the driver uses one - * of these structures to hold its associated state. - */ - -typedef struct altera_avalon_jtag_uart_state_s -{ - unsigned int base; - -#ifndef ALTERA_AVALON_JTAG_UART_SMALL - - unsigned int timeout; /* Timeout until host is assumed inactive */ - alt_alarm alarm; - unsigned int irq_enable; - unsigned int host_inactive; - - ALT_SEM (read_lock) - ALT_SEM (write_lock) - ALT_FLAG_GRP (events) - - /* The variables below are volatile because they are modified by the - * interrupt routine. Making them volatile and reading them atomically - * means that we don't need any large critical sections. - */ - volatile unsigned int rx_in; - unsigned int rx_out; - unsigned int tx_in; - volatile unsigned int tx_out; - char rx_buf[ALTERA_AVALON_JTAG_UART_BUF_LEN]; - char tx_buf[ALTERA_AVALON_JTAG_UART_BUF_LEN]; - -#endif /* !ALTERA_AVALON_JTAG_UART_SMALL */ - -} altera_avalon_jtag_uart_state; - -/* - * Macros used by alt_sys_init when the ALT file descriptor facility isn't used. - */ - -#ifdef ALTERA_AVALON_JTAG_UART_SMALL - -#define ALTERA_AVALON_JTAG_UART_STATE_INSTANCE(name, state) \ - altera_avalon_jtag_uart_state state = \ - { \ - name##_BASE, \ - } - -#define ALTERA_AVALON_JTAG_UART_STATE_INIT(name, state) - -#else /* !ALTERA_AVALON_JTAG_UART_SMALL */ - -#define ALTERA_AVALON_JTAG_UART_STATE_INSTANCE(name, state) \ - altera_avalon_jtag_uart_state state = \ - { \ - name##_BASE, \ - ALTERA_AVALON_JTAG_UART_DEFAULT_TIMEOUT, \ - } - -/* - * Externally referenced routines - */ -extern void altera_avalon_jtag_uart_init(altera_avalon_jtag_uart_state* sp, - int irq_controller_id, int irq); - -#define ALTERA_AVALON_JTAG_UART_STATE_INIT(name, state) \ - { \ - if (name##_IRQ == ALT_IRQ_NOT_CONNECTED) \ - { \ - ALT_LINK_ERROR ("Error: Interrupt not connected for " #name ". " \ - "You have selected the interrupt driven version of " \ - "the ALTERA Avalon JTAG UART driver, but the " \ - "interrupt is not connected for this device. You can " \ - "select a polled mode driver by checking the 'small " \ - "driver' option in the HAL configuration window, or " \ - "by using the -DALTERA_AVALON_JTAG_UART_SMALL " \ - "preprocessor flag."); \ - } \ - else \ - altera_avalon_jtag_uart_init(&state, \ - name##_IRQ_INTERRUPT_CONTROLLER_ID, \ - name##_IRQ); \ - } - -#endif /* ALTERA_AVALON_JTAG_UART_SMALL */ - -/* - * Include in case non-direct version of driver required. - */ -#include "altera_avalon_jtag_uart_fd.h" - -/* - * Map alt_sys_init macros to direct or non-direct versions. - */ -#ifdef ALT_USE_DIRECT_DRIVERS - -#define ALTERA_AVALON_JTAG_UART_INSTANCE(name, state) \ - ALTERA_AVALON_JTAG_UART_STATE_INSTANCE(name, state) -#define ALTERA_AVALON_JTAG_UART_INIT(name, state) \ - ALTERA_AVALON_JTAG_UART_STATE_INIT(name, state) - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -#define ALTERA_AVALON_JTAG_UART_INSTANCE(name, dev) \ - ALTERA_AVALON_JTAG_UART_DEV_INSTANCE(name, dev) -#define ALTERA_AVALON_JTAG_UART_INIT(name, dev) \ - ALTERA_AVALON_JTAG_UART_DEV_INIT(name, dev) - -#endif /* ALT_USE_DIRECT_DRIVERS */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_AVALON_JTAG_UART_H__ */ diff --git a/software/qsys_tutorial_lcd_bsp/drivers/inc/altera_avalon_jtag_uart_fd.h b/software/qsys_tutorial_lcd_bsp/drivers/inc/altera_avalon_jtag_uart_fd.h deleted file mode 100644 index b3c3200..0000000 --- a/software/qsys_tutorial_lcd_bsp/drivers/inc/altera_avalon_jtag_uart_fd.h +++ /dev/null @@ -1,125 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#ifndef __ALT_AVALON_JTAG_UART_FD_H__ -#define __ALT_AVALON_JTAG_UART_FD_H__ - -#include "sys/alt_dev.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * Externally referenced routines - */ -extern int altera_avalon_jtag_uart_read_fd (alt_fd* fd, char* ptr, int len); -extern int altera_avalon_jtag_uart_write_fd (alt_fd* fd, const char* ptr, - int len); - -/* - * Device structure definition. This is needed by alt_sys_init in order to - * reserve memory for the device instance. - */ - -typedef struct altera_avalon_jtag_uart_dev_s -{ - alt_dev dev; - altera_avalon_jtag_uart_state state; -} altera_avalon_jtag_uart_dev; - -/* - * Macros used by alt_sys_init when the ALT file descriptor facility is used. - */ - -#ifdef ALTERA_AVALON_JTAG_UART_SMALL - -#define ALTERA_AVALON_JTAG_UART_DEV_INSTANCE(name, d) \ - static altera_avalon_jtag_uart_dev d = \ - { \ - { \ - ALT_LLIST_ENTRY, \ - name##_NAME, \ - NULL, /* open */ \ - NULL, /* close */ \ - altera_avalon_jtag_uart_read_fd, \ - altera_avalon_jtag_uart_write_fd, \ - NULL, /* lseek */ \ - NULL, /* fstat */ \ - NULL, /* ioctl */ \ - }, \ - { \ - name##_BASE, \ - } \ - } - -#define ALTERA_AVALON_JTAG_UART_DEV_INIT(name, d) alt_dev_reg (&d.dev) - -#else /* !ALTERA_AVALON_JTAG_UART_SMALL */ - -extern int altera_avalon_jtag_uart_close_fd(alt_fd* fd); -extern int altera_avalon_jtag_uart_ioctl_fd (alt_fd* fd, int req, void* arg); - -#define ALTERA_AVALON_JTAG_UART_DEV_INSTANCE(name, d) \ - static altera_avalon_jtag_uart_dev d = \ - { \ - { \ - ALT_LLIST_ENTRY, \ - name##_NAME, \ - NULL, /* open */ \ - altera_avalon_jtag_uart_close_fd, \ - altera_avalon_jtag_uart_read_fd, \ - altera_avalon_jtag_uart_write_fd, \ - NULL, /* lseek */ \ - NULL, /* fstat */ \ - altera_avalon_jtag_uart_ioctl_fd, \ - }, \ - { \ - name##_BASE, \ - ALTERA_AVALON_JTAG_UART_DEFAULT_TIMEOUT, \ - } \ - } - -#define ALTERA_AVALON_JTAG_UART_DEV_INIT(name, d) \ - { \ - ALTERA_AVALON_JTAG_UART_STATE_INIT(name, d.state); \ - \ - /* make the device available to the system */ \ - alt_dev_reg(&d.dev); \ - } - -#endif /* ALTERA_AVALON_JTAG_UART_SMALL */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_AVALON_JTAG_UART_FD_H__ */ diff --git a/software/qsys_tutorial_lcd_bsp/drivers/inc/altera_avalon_jtag_uart_regs.h b/software/qsys_tutorial_lcd_bsp/drivers/inc/altera_avalon_jtag_uart_regs.h deleted file mode 100644 index 7f97160..0000000 --- a/software/qsys_tutorial_lcd_bsp/drivers/inc/altera_avalon_jtag_uart_regs.h +++ /dev/null @@ -1,73 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#ifndef __ALTERA_AVALON_JTAG_UART_REGS_H__ -#define __ALTERA_AVALON_JTAG_UART_REGS_H__ - -#include - -#define ALTERA_AVALON_JTAG_UART_DATA_REG 0 -#define IOADDR_ALTERA_AVALON_JTAG_UART_DATA(base) \ - __IO_CALC_ADDRESS_NATIVE(base, ALTERA_AVALON_JTAG_UART_DATA_REG) -#define IORD_ALTERA_AVALON_JTAG_UART_DATA(base) \ - IORD(base, ALTERA_AVALON_JTAG_UART_DATA_REG) -#define IOWR_ALTERA_AVALON_JTAG_UART_DATA(base, data) \ - IOWR(base, ALTERA_AVALON_JTAG_UART_DATA_REG, data) - -#define ALTERA_AVALON_JTAG_UART_DATA_DATA_MSK (0x000000FF) -#define ALTERA_AVALON_JTAG_UART_DATA_DATA_OFST (0) -#define ALTERA_AVALON_JTAG_UART_DATA_RVALID_MSK (0x00008000) -#define ALTERA_AVALON_JTAG_UART_DATA_RVALID_OFST (15) -#define ALTERA_AVALON_JTAG_UART_DATA_RAVAIL_MSK (0xFFFF0000) -#define ALTERA_AVALON_JTAG_UART_DATA_RAVAIL_OFST (16) - - -#define ALTERA_AVALON_JTAG_UART_CONTROL_REG 1 -#define IOADDR_ALTERA_AVALON_JTAG_UART_CONTROL(base) \ - __IO_CALC_ADDRESS_NATIVE(base, ALTERA_AVALON_JTAG_UART_CONTROL_REG) -#define IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base) \ - IORD(base, ALTERA_AVALON_JTAG_UART_CONTROL_REG) -#define IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(base, data) \ - IOWR(base, ALTERA_AVALON_JTAG_UART_CONTROL_REG, data) - -#define ALTERA_AVALON_JTAG_UART_CONTROL_RE_MSK (0x00000001) -#define ALTERA_AVALON_JTAG_UART_CONTROL_RE_OFST (0) -#define ALTERA_AVALON_JTAG_UART_CONTROL_WE_MSK (0x00000002) -#define ALTERA_AVALON_JTAG_UART_CONTROL_WE_OFST (1) -#define ALTERA_AVALON_JTAG_UART_CONTROL_RI_MSK (0x00000100) -#define ALTERA_AVALON_JTAG_UART_CONTROL_RI_OFST (8) -#define ALTERA_AVALON_JTAG_UART_CONTROL_WI_MSK (0x00000200) -#define ALTERA_AVALON_JTAG_UART_CONTROL_WI_OFST (9) -#define ALTERA_AVALON_JTAG_UART_CONTROL_AC_MSK (0x00000400) -#define ALTERA_AVALON_JTAG_UART_CONTROL_AC_OFST (10) -#define ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_MSK (0xFFFF0000) -#define ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_OFST (16) - -#endif /* __ALTERA_AVALON_JTAG_UART_REGS_H__ */ diff --git a/software/qsys_tutorial_lcd_bsp/drivers/inc/altera_avalon_pio_regs.h b/software/qsys_tutorial_lcd_bsp/drivers/inc/altera_avalon_pio_regs.h deleted file mode 100644 index 052439f..0000000 --- a/software/qsys_tutorial_lcd_bsp/drivers/inc/altera_avalon_pio_regs.h +++ /dev/null @@ -1,67 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#ifndef __ALTERA_AVALON_PIO_REGS_H__ -#define __ALTERA_AVALON_PIO_REGS_H__ - -#include - -#define IOADDR_ALTERA_AVALON_PIO_DATA(base) __IO_CALC_ADDRESS_NATIVE(base, 0) -#define IORD_ALTERA_AVALON_PIO_DATA(base) IORD(base, 0) -#define IOWR_ALTERA_AVALON_PIO_DATA(base, data) IOWR(base, 0, data) - -#define IOADDR_ALTERA_AVALON_PIO_DIRECTION(base) __IO_CALC_ADDRESS_NATIVE(base, 1) -#define IORD_ALTERA_AVALON_PIO_DIRECTION(base) IORD(base, 1) -#define IOWR_ALTERA_AVALON_PIO_DIRECTION(base, data) IOWR(base, 1, data) - -#define IOADDR_ALTERA_AVALON_PIO_IRQ_MASK(base) __IO_CALC_ADDRESS_NATIVE(base, 2) -#define IORD_ALTERA_AVALON_PIO_IRQ_MASK(base) IORD(base, 2) -#define IOWR_ALTERA_AVALON_PIO_IRQ_MASK(base, data) IOWR(base, 2, data) - -#define IOADDR_ALTERA_AVALON_PIO_EDGE_CAP(base) __IO_CALC_ADDRESS_NATIVE(base, 3) -#define IORD_ALTERA_AVALON_PIO_EDGE_CAP(base) IORD(base, 3) -#define IOWR_ALTERA_AVALON_PIO_EDGE_CAP(base, data) IOWR(base, 3, data) - - -#define IOADDR_ALTERA_AVALON_PIO_SET_BIT(base) __IO_CALC_ADDRESS_NATIVE(base, 4) -#define IORD_ALTERA_AVALON_PIO_SET_BITS(base) IORD(base, 4) -#define IOWR_ALTERA_AVALON_PIO_SET_BITS(base, data) IOWR(base, 4, data) - -#define IOADDR_ALTERA_AVALON_PIO_CLEAR_BITS(base) __IO_CALC_ADDRESS_NATIVE(base, 5) -#define IORD_ALTERA_AVALON_PIO_CLEAR_BITS(base) IORD(base, 5) -#define IOWR_ALTERA_AVALON_PIO_CLEAR_BITS(base, data) IOWR(base, 5, data) - - - -/* Defintions for direction-register operation with bi-directional PIOs */ -#define ALTERA_AVALON_PIO_DIRECTION_INPUT 0 -#define ALTERA_AVALON_PIO_DIRECTION_OUTPUT 1 - -#endif /* __ALTERA_AVALON_PIO_REGS_H__ */ diff --git a/software/qsys_tutorial_lcd_bsp/drivers/src/altera_avalon_jtag_uart_fd.c b/software/qsys_tutorial_lcd_bsp/drivers/src/altera_avalon_jtag_uart_fd.c deleted file mode 100644 index 53dfc3b..0000000 --- a/software/qsys_tutorial_lcd_bsp/drivers/src/altera_avalon_jtag_uart_fd.c +++ /dev/null @@ -1,86 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "alt_types.h" -#include "sys/alt_dev.h" -#include "altera_avalon_jtag_uart.h" - -extern int altera_avalon_jtag_uart_read(altera_avalon_jtag_uart_state* sp, - char* buffer, int space, int flags); -extern int altera_avalon_jtag_uart_write(altera_avalon_jtag_uart_state* sp, - const char* ptr, int count, int flags); -extern int altera_avalon_jtag_uart_ioctl(altera_avalon_jtag_uart_state* sp, - int req, void* arg); -extern int altera_avalon_jtag_uart_close(altera_avalon_jtag_uart_state* sp, - int flags); - -/* ----------------------------------------------------------------------- */ -/* --------------------- WRAPPERS FOR ALT FD SUPPORT --------------------- */ -/* - * - */ - -int -altera_avalon_jtag_uart_read_fd(alt_fd* fd, char* buffer, int space) -{ - altera_avalon_jtag_uart_dev* dev = (altera_avalon_jtag_uart_dev*) fd->dev; - - return altera_avalon_jtag_uart_read(&dev->state, buffer, space, - fd->fd_flags); -} - -int -altera_avalon_jtag_uart_write_fd(alt_fd* fd, const char* buffer, int space) -{ - altera_avalon_jtag_uart_dev* dev = (altera_avalon_jtag_uart_dev*) fd->dev; - - return altera_avalon_jtag_uart_write(&dev->state, buffer, space, - fd->fd_flags); -} - -#ifndef ALTERA_AVALON_JTAG_UART_SMALL - -int -altera_avalon_jtag_uart_close_fd(alt_fd* fd) -{ - altera_avalon_jtag_uart_dev* dev = (altera_avalon_jtag_uart_dev*) fd->dev; - - return altera_avalon_jtag_uart_close(&dev->state, fd->fd_flags); -} - -int -altera_avalon_jtag_uart_ioctl_fd(alt_fd* fd, int req, void* arg) -{ - altera_avalon_jtag_uart_dev* dev = (altera_avalon_jtag_uart_dev*) fd->dev; - - return altera_avalon_jtag_uart_ioctl(&dev->state, req, arg); -} - -#endif /* ALTERA_AVALON_JTAG_UART_SMALL */ diff --git a/software/qsys_tutorial_lcd_bsp/drivers/src/altera_avalon_jtag_uart_init.c b/software/qsys_tutorial_lcd_bsp/drivers/src/altera_avalon_jtag_uart_init.c deleted file mode 100644 index 7317bec..0000000 --- a/software/qsys_tutorial_lcd_bsp/drivers/src/altera_avalon_jtag_uart_init.c +++ /dev/null @@ -1,256 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include -#include -#include -#include - -#include - -#include "sys/alt_irq.h" -#include "sys/alt_alarm.h" -#include "sys/ioctl.h" -#include "alt_types.h" - -#include "altera_avalon_jtag_uart_regs.h" -#include "altera_avalon_jtag_uart.h" - -#include "sys/alt_log_printf.h" - -#ifndef ALTERA_AVALON_JTAG_UART_SMALL - -/* ----------------------------------------------------------- */ -/* ------------------------- FAST DRIVER --------------------- */ -/* ----------------------------------------------------------- */ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT -static void altera_avalon_jtag_uart_irq(void* context); -#else -static void altera_avalon_jtag_uart_irq(void* context, alt_u32 id); -#endif -static alt_u32 altera_avalon_jtag_uart_timeout(void* context); - -/* - * Driver initialization code. Register interrupts and start a timer - * which we can use to check whether the host is there. - * Return 1 on sucessful IRQ register and 0 on failure. - */ - -void altera_avalon_jtag_uart_init(altera_avalon_jtag_uart_state* sp, - int irq_controller_id, int irq) -{ - ALT_FLAG_CREATE(&sp->events, 0); - ALT_SEM_CREATE(&sp->read_lock, 1); - ALT_SEM_CREATE(&sp->write_lock, 1); - - /* enable read interrupts at the device */ - sp->irq_enable = ALTERA_AVALON_JTAG_UART_CONTROL_RE_MSK; - - IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base, sp->irq_enable); - - /* register the interrupt handler */ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - alt_ic_isr_register(irq_controller_id, irq, altera_avalon_jtag_uart_irq, - sp, NULL); -#else - alt_irq_register(irq, sp, altera_avalon_jtag_uart_irq); -#endif - - /* Register an alarm to go off every second to check for presence of host */ - sp->host_inactive = 0; - - if (alt_alarm_start(&sp->alarm, alt_ticks_per_second(), - &altera_avalon_jtag_uart_timeout, sp) < 0) - { - /* If we can't set the alarm then record "don't know if host present" - * and behave as though the host is present. - */ - sp->timeout = INT_MAX; - } - - /* ALT_LOG - see altera_hal/HAL/inc/sys/alt_log_printf.h */ - ALT_LOG_JTAG_UART_ALARM_REGISTER(sp, sp->base); -} - -/* - * Interrupt routine - */ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT -static void altera_avalon_jtag_uart_irq(void* context) -#else -static void altera_avalon_jtag_uart_irq(void* context, alt_u32 id) -#endif -{ - altera_avalon_jtag_uart_state* sp = (altera_avalon_jtag_uart_state*) context; - unsigned int base = sp->base; - - /* ALT_LOG - see altera_hal/HAL/inc/sys/alt_log_printf.h */ - ALT_LOG_JTAG_UART_ISR_FUNCTION(base, sp); - - for ( ; ; ) - { - unsigned int control = IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base); - - /* Return once nothing more to do */ - if ((control & (ALTERA_AVALON_JTAG_UART_CONTROL_RI_MSK | ALTERA_AVALON_JTAG_UART_CONTROL_WI_MSK)) == 0) - break; - - if (control & ALTERA_AVALON_JTAG_UART_CONTROL_RI_MSK) - { - /* process a read irq. Start by assuming that there is data in the - * receive FIFO (otherwise why would we have been interrupted?) - */ - unsigned int data = 1 << ALTERA_AVALON_JTAG_UART_DATA_RAVAIL_OFST; - - for ( ; ; ) - { - /* Check whether there is space in the buffer. If not then we must not - * read any characters from the buffer as they will be lost. - */ - unsigned int next = (sp->rx_in + 1) % ALTERA_AVALON_JTAG_UART_BUF_LEN; - if (next == sp->rx_out) - break; - - /* Try to remove a character from the FIFO and find out whether there - * are any more characters remaining. - */ - data = IORD_ALTERA_AVALON_JTAG_UART_DATA(base); - - if ((data & ALTERA_AVALON_JTAG_UART_DATA_RVALID_MSK) == 0) - break; - - sp->rx_buf[sp->rx_in] = (data & ALTERA_AVALON_JTAG_UART_DATA_DATA_MSK) >> ALTERA_AVALON_JTAG_UART_DATA_DATA_OFST; - sp->rx_in = (sp->rx_in + 1) % ALTERA_AVALON_JTAG_UART_BUF_LEN; - - /* Post an event to notify jtag_uart_read that a character has been read */ - ALT_FLAG_POST (sp->events, ALT_JTAG_UART_READ_RDY, OS_FLAG_SET); - } - - if (data & ALTERA_AVALON_JTAG_UART_DATA_RAVAIL_MSK) - { - /* If there is still data available here then the buffer is full - * so turn off receive interrupts until some space becomes available. - */ - sp->irq_enable &= ~ALTERA_AVALON_JTAG_UART_CONTROL_RE_MSK; - IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(base, sp->irq_enable); - - /* Dummy read to ensure IRQ is cleared prior to ISR completion */ - IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base); - } - } - - if (control & ALTERA_AVALON_JTAG_UART_CONTROL_WI_MSK) - { - /* process a write irq */ - unsigned int space = (control & ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_MSK) >> ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_OFST; - - while (space > 0 && sp->tx_out != sp->tx_in) - { - IOWR_ALTERA_AVALON_JTAG_UART_DATA(base, sp->tx_buf[sp->tx_out]); - - sp->tx_out = (sp->tx_out + 1) % ALTERA_AVALON_JTAG_UART_BUF_LEN; - - /* Post an event to notify jtag_uart_write that a character has been written */ - ALT_FLAG_POST (sp->events, ALT_JTAG_UART_WRITE_RDY, OS_FLAG_SET); - - space--; - } - - if (space > 0) - { - /* If we don't have any more data available then turn off the TX interrupt */ - sp->irq_enable &= ~ALTERA_AVALON_JTAG_UART_CONTROL_WE_MSK; - IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base, sp->irq_enable); - - /* Dummy read to ensure IRQ is cleared prior to ISR completion */ - IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base); - } - } - } -} - -/* - * Timeout routine is called every second - */ - -static alt_u32 -altera_avalon_jtag_uart_timeout(void* context) -{ - altera_avalon_jtag_uart_state* sp = (altera_avalon_jtag_uart_state *) context; - - unsigned int control = IORD_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base); - - if (control & ALTERA_AVALON_JTAG_UART_CONTROL_AC_MSK) - { - IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base, sp->irq_enable | ALTERA_AVALON_JTAG_UART_CONTROL_AC_MSK); - sp->host_inactive = 0; - } - else if (sp->host_inactive < INT_MAX - 2) { - sp->host_inactive++; - - if (sp->host_inactive >= sp->timeout) { - /* Post an event to indicate host is inactive (for jtag_uart_read */ - ALT_FLAG_POST (sp->events, ALT_JTAG_UART_TIMEOUT, OS_FLAG_SET); - } - } - - return alt_ticks_per_second(); -} - -/* - * The close() routine is implemented to drain the JTAG UART transmit buffer - * when not in "small" mode. This routine will wait for transimt data to be - * emptied unless a timeout from host-activity occurs. If the driver flags - * have been set to non-blocking mode, this routine will exit immediately if - * any data remains. This routine should be called indirectly (i.e. though - * the C library close() routine) so that the file descriptor associated - * with the relevant stream (i.e. stdout) can be closed as well. This routine - * does not manage file descriptors. - * - * The close routine is not implemented for the small driver; instead it will - * map to null. This is because the small driver simply waits while characters - * are transmitted; there is no interrupt-serviced buffer to empty - */ -int altera_avalon_jtag_uart_close(altera_avalon_jtag_uart_state* sp, int flags) -{ - /* - * Wait for all transmit data to be emptied by the JTAG UART ISR, or - * for a host-inactivity timeout, in which case transmit data will be lost - */ - while ( (sp->tx_out != sp->tx_in) && (sp->host_inactive < sp->timeout) ) { - if (flags & O_NONBLOCK) { - return -EWOULDBLOCK; - } - } - - return 0; -} - -#endif /* !ALTERA_AVALON_JTAG_UART_SMALL */ diff --git a/software/qsys_tutorial_lcd_bsp/drivers/src/altera_avalon_jtag_uart_ioctl.c b/software/qsys_tutorial_lcd_bsp/drivers/src/altera_avalon_jtag_uart_ioctl.c deleted file mode 100644 index cf71e6f..0000000 --- a/software/qsys_tutorial_lcd_bsp/drivers/src/altera_avalon_jtag_uart_ioctl.c +++ /dev/null @@ -1,86 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include -#include -#include -#include - -#include - -#include "sys/ioctl.h" -#include "alt_types.h" - -#include "altera_avalon_jtag_uart_regs.h" -#include "altera_avalon_jtag_uart.h" - -#include "sys/alt_log_printf.h" - -#ifndef ALTERA_AVALON_JTAG_UART_SMALL - -/* ----------------------------------------------------------- */ -/* ------------------------- FAST DRIVER --------------------- */ -/* ----------------------------------------------------------- */ - -int -altera_avalon_jtag_uart_ioctl(altera_avalon_jtag_uart_state* sp, int req, - void* arg) -{ - int rc = -ENOTTY; - - switch (req) - { - case TIOCSTIMEOUT: - /* Set the time to wait until assuming host is not connected */ - if (sp->timeout != INT_MAX) - { - int timeout = *((int *)arg); - sp->timeout = (timeout >= 2 && timeout < INT_MAX) ? timeout : INT_MAX - 1; - rc = 0; - } - break; - - case TIOCGCONNECTED: - /* Find out whether host is connected */ - if (sp->timeout != INT_MAX) - { - *((int *)arg) = (sp->host_inactive < sp->timeout) ? 1 : 0; - rc = 0; - } - break; - - default: - break; - } - - return rc; -} - -#endif /* !ALTERA_AVALON_JTAG_UART_SMALL */ diff --git a/software/qsys_tutorial_lcd_bsp/drivers/src/altera_avalon_jtag_uart_read.c b/software/qsys_tutorial_lcd_bsp/drivers/src/altera_avalon_jtag_uart_read.c deleted file mode 100644 index 5657adb..0000000 --- a/software/qsys_tutorial_lcd_bsp/drivers/src/altera_avalon_jtag_uart_read.c +++ /dev/null @@ -1,205 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include -#include -#include -#include - -#include - -#include "sys/alt_irq.h" -#include "sys/alt_alarm.h" -#include "sys/ioctl.h" -#include "alt_types.h" - -#include "altera_avalon_jtag_uart_regs.h" -#include "altera_avalon_jtag_uart.h" - -#include "sys/alt_log_printf.h" - -#ifdef __ucosii__ -#include "includes.h" -#endif /* __ucosii__ */ - -#ifdef ALTERA_AVALON_JTAG_UART_SMALL - -/* ----------------------------------------------------------- */ -/* ----------------------- SMALL DRIVER ---------------------- */ -/* ----------------------------------------------------------- */ - -/* Read routine. The small version blocks until it has at least one byte - * available, it then returns as much as is immediately available without - * waiting any more. It's performance will be very poor without - * interrupts. - */ - -int -altera_avalon_jtag_uart_read(altera_avalon_jtag_uart_state* sp, - char* buffer, int space, int flags) -{ - unsigned int base = sp->base; - - char * ptr = buffer; - char * end = buffer + space; - - while (ptr < end) - { - unsigned int data = IORD_ALTERA_AVALON_JTAG_UART_DATA(base); - - if (data & ALTERA_AVALON_JTAG_UART_DATA_RVALID_MSK) - *ptr++ = (data & ALTERA_AVALON_JTAG_UART_DATA_DATA_MSK) >> ALTERA_AVALON_JTAG_UART_DATA_DATA_OFST; - else if (ptr != buffer) - break; - else if(flags & O_NONBLOCK) - break; - - } - - if (ptr != buffer) - return ptr - buffer; - else if (flags & O_NONBLOCK) - return -EWOULDBLOCK; - else - return -EIO; -} - -#else /* !ALTERA_AVALON_JTAG_UART_SMALL */ - -/* ----------------------------------------------------------- */ -/* ----------------------- FAST DRIVER ----------------------- */ -/* ----------------------------------------------------------- */ - -int -altera_avalon_jtag_uart_read(altera_avalon_jtag_uart_state* sp, - char * buffer, int space, int flags) -{ - char * ptr = buffer; - - alt_irq_context context; - unsigned int n; - - /* - * When running in a multi threaded environment, obtain the "read_lock" - * semaphore. This ensures that reading from the device is thread-safe. - */ - ALT_SEM_PEND (sp->read_lock, 0); - - while (space > 0) - { - unsigned int in, out; - - /* Read as much data as possible */ - do - { - in = sp->rx_in; - out = sp->rx_out; - - if (in >= out) - n = in - out; - else - n = ALTERA_AVALON_JTAG_UART_BUF_LEN - out; - - if (n == 0) - break; /* No more data available */ - - if (n > space) - n = space; - - memcpy(ptr, sp->rx_buf + out, n); - ptr += n; - space -= n; - - sp->rx_out = (out + n) % ALTERA_AVALON_JTAG_UART_BUF_LEN; - } - while (space > 0); - - /* If we read any data then return it */ - if (ptr != buffer) - break; - - /* If in non-blocking mode then return error */ - if (flags & O_NONBLOCK) - break; - -#ifdef __ucosii__ - /* OS Present: Pend on a flag if the OS is running, otherwise spin */ - if(OSRunning == OS_TRUE) { - /* - * When running in a multi-threaded mode, we pend on the read event - * flag set and timeout event flag set in the isr. This avoids wasting CPU - * cycles waiting in this thread, when we could be doing something more - * profitable elsewhere. - */ - ALT_FLAG_PEND (sp->events, - ALT_JTAG_UART_READ_RDY | ALT_JTAG_UART_TIMEOUT, - OS_FLAG_WAIT_SET_ANY + OS_FLAG_CONSUME, - 0); - } - else { - /* Spin until more data arrives or until host disconnects */ - while (in == sp->rx_in && sp->host_inactive < sp->timeout) - ; - } -#else - /* No OS: Always spin */ - while (in == sp->rx_in && sp->host_inactive < sp->timeout) - ; -#endif /* __ucosii__ */ - - if (in == sp->rx_in) - break; - } - - /* - * Now that access to the circular buffer is complete, release the read - * semaphore so that other threads can access the buffer. - */ - - ALT_SEM_POST (sp->read_lock); - - if (ptr != buffer) - { - /* If we read any data then there is space in the buffer so enable interrupts */ - context = alt_irq_disable_all(); - sp->irq_enable |= ALTERA_AVALON_JTAG_UART_CONTROL_RE_MSK; - IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base, sp->irq_enable); - alt_irq_enable_all(context); - } - - if (ptr != buffer) - return ptr - buffer; - else if (flags & O_NONBLOCK) - return -EWOULDBLOCK; - else - return -EIO; -} - -#endif /* ALTERA_AVALON_JTAG_UART_SMALL */ diff --git a/software/qsys_tutorial_lcd_bsp/drivers/src/altera_avalon_jtag_uart_write.c b/software/qsys_tutorial_lcd_bsp/drivers/src/altera_avalon_jtag_uart_write.c deleted file mode 100644 index 11aeca1..0000000 --- a/software/qsys_tutorial_lcd_bsp/drivers/src/altera_avalon_jtag_uart_write.c +++ /dev/null @@ -1,217 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include -#include -#include -#include - -#include - -#include "sys/alt_irq.h" -#include "sys/alt_alarm.h" -#include "sys/ioctl.h" -#include "alt_types.h" - -#include "altera_avalon_jtag_uart_regs.h" -#include "altera_avalon_jtag_uart.h" - -#include "sys/alt_log_printf.h" - -#ifdef __ucosii__ -#include "includes.h" -#endif /* __ucosii__ */ - -#ifdef ALTERA_AVALON_JTAG_UART_SMALL - -/* ----------------------------------------------------------- */ -/* ------------------------ SMALL DRIVER --------------------- */ -/* ----------------------------------------------------------- */ - -/* Write routine. The small version blocks when there is no space to write - * into, so it's performance will be very bad if you are writing more than - * one FIFOs worth of data. But you said you didn't want to use interrupts :-) - */ - -int altera_avalon_jtag_uart_write(altera_avalon_jtag_uart_state* sp, - const char * ptr, int count, int flags) -{ - unsigned int base = sp->base; - - const char * end = ptr + count; - - while (ptr < end) - if ((IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base) & ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_MSK) != 0) - IOWR_ALTERA_AVALON_JTAG_UART_DATA(base, *ptr++); - - return count; -} - -#else /* !ALTERA_AVALON_JTAG_UART_SMALL */ - -/* ----------------------------------------------------------- */ -/* ------------------------- FAST DRIVER --------------------- */ -/* ----------------------------------------------------------- */ - -int -altera_avalon_jtag_uart_write(altera_avalon_jtag_uart_state* sp, - const char * ptr, int count, int flags) -{ - /* Remove warning at optimisation level 03 by seting out to 0 */ - unsigned int in, out=0; - unsigned int n; - alt_irq_context context; - - const char * start = ptr; - - /* - * When running in a multi threaded environment, obtain the "write_lock" - * semaphore. This ensures that writing to the device is thread-safe. - */ - ALT_SEM_PEND (sp->write_lock, 0); - - do - { - /* Copy as much as we can into the transmit buffer */ - while (count > 0) - { - /* We need a stable value of the out pointer to calculate the space available */ - in = sp->tx_in; - out = sp->tx_out; - - if (in < out) - n = out - 1 - in; - else if (out > 0) - n = ALTERA_AVALON_JTAG_UART_BUF_LEN - in; - else - n = ALTERA_AVALON_JTAG_UART_BUF_LEN - 1 - in; - - if (n == 0) - break; - - if (n > count) - n = count; - - memcpy(sp->tx_buf + in, ptr, n); - ptr += n; - count -= n; - - sp->tx_in = (in + n) % ALTERA_AVALON_JTAG_UART_BUF_LEN; - } - - /* - * If interrupts are disabled then we could transmit here, we only need - * to enable interrupts if there is no space left in the FIFO - * - * For now kick the interrupt routine every time to make it transmit - * the data - */ - context = alt_irq_disable_all(); - sp->irq_enable |= ALTERA_AVALON_JTAG_UART_CONTROL_WE_MSK; - IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base, sp->irq_enable); - alt_irq_enable_all(context); - - /* - * If there is any data left then either return now or block until - * some has been sent - */ - /* consider: test whether there is anything there while doing this and delay for at most 2s. */ - if (count > 0) - { - if (flags & O_NONBLOCK) - break; - -#ifdef __ucosii__ - /* OS Present: Pend on a flag if the OS is running, otherwise spin */ - if(OSRunning == OS_TRUE) { - /* - * When running in a multi-threaded mode, we pend on the write event - * flag set or the timeout flag in the isr. This avoids wasting CPU - * cycles waiting in this thread, when we could be doing something - * more profitable elsewhere. - */ -#ifdef ALTERA_AVALON_JTAG_UART_IGNORE_FIFO_FULL_ERROR - if(!sp->host_inactive) -#endif - ALT_FLAG_PEND (sp->events, - ALT_JTAG_UART_WRITE_RDY | ALT_JTAG_UART_TIMEOUT, - OS_FLAG_WAIT_SET_ANY + OS_FLAG_CONSUME, - 0); - } - else { - /* - * OS not running: Wait for data to be removed from buffer. - * Once the interrupt routine has removed some data then we - * will be able to insert some more. - */ - while (out == sp->tx_out && sp->host_inactive < sp->timeout) - ; - } -#else - /* - * No OS present: Always wait for data to be removed from buffer. Once - * the interrupt routine has removed some data then we will be able to - * insert some more. - */ - while (out == sp->tx_out && sp->host_inactive < sp->timeout) - ; -#endif /* __ucosii__ */ - - if (out == sp->tx_out) - break; - } - } - while (count > 0); - - /* - * Now that access to the circular buffer is complete, release the write - * semaphore so that other threads can access the buffer. - */ - ALT_SEM_POST (sp->write_lock); - - if (ptr != start) - return ptr - start; - else if (flags & O_NONBLOCK) - return -EWOULDBLOCK; -#ifdef ALTERA_AVALON_JTAG_UART_IGNORE_FIFO_FULL_ERROR - else if (sp->host_inactive >= sp->timeout) { - /* - * Reset the software FIFO, hardware FIFO could not be reset. - * Just throw away characters without reporting error. - */ - sp->tx_out = sp->tx_in = 0; - return ptr - start + count; - } -#endif - else - return -EIO; /* Host not connected */ -} - -#endif /* ALTERA_AVALON_JTAG_UART_SMALL */ diff --git a/software/qsys_tutorial_lcd_bsp/libhal_bsp.a b/software/qsys_tutorial_lcd_bsp/libhal_bsp.a deleted file mode 100644 index e23a44e..0000000 --- a/software/qsys_tutorial_lcd_bsp/libhal_bsp.a +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/linker.h b/software/qsys_tutorial_lcd_bsp/linker.h deleted file mode 100644 index 473b8af..0000000 --- a/software/qsys_tutorial_lcd_bsp/linker.h +++ /dev/null @@ -1,101 +0,0 @@ -/* - * linker.h - Linker script mapping information - * - * Machine generated for CPU 'nios2_processor' in SOPC Builder design 'nios_system' - * SOPC Builder design path: C:/Users/takayun/Documents/DE2-115/qsys_tutorial/nios_system.sopcinfo - * - * Generated: Thu Dec 01 23:23:48 JST 2016 - */ - -/* - * DO NOT MODIFY THIS FILE - * - * Changing this file will have subtle consequences - * which will almost certainly lead to a nonfunctioning - * system. If you do modify this file, be aware that your - * changes will be overwritten and lost when this file - * is generated again. - * - * DO NOT MODIFY THIS FILE - */ - -/* - * License Agreement - * - * Copyright (c) 2008 - * Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - * - * This agreement shall be governed in all respects by the laws of the State - * of California and by the laws of the United States of America. - */ - -#ifndef __LINKER_H_ -#define __LINKER_H_ - - -/* - * BSP controls alt_load() behavior in crt0. - * - */ - -#define ALT_LOAD_EXPLICITLY_CONTROLLED - - -/* - * Base address and span (size in bytes) of each linker region - * - */ - -#define ONCHIP_MEMORY_REGION_BASE 0x20 -#define ONCHIP_MEMORY_REGION_SPAN 16352 -#define RESET_REGION_BASE 0x0 -#define RESET_REGION_SPAN 32 - - -/* - * Devices associated with code sections - * - */ - -#define ALT_EXCEPTIONS_DEVICE ONCHIP_MEMORY -#define ALT_RESET_DEVICE ONCHIP_MEMORY -#define ALT_RODATA_DEVICE ONCHIP_MEMORY -#define ALT_RWDATA_DEVICE ONCHIP_MEMORY -#define ALT_TEXT_DEVICE ONCHIP_MEMORY - - -/* - * Initialization code at the reset address is allowed (e.g. no external bootloader). - * - */ - -#define ALT_ALLOW_CODE_AT_RESET - - -/* - * The alt_load() facility is called from crt0 to copy sections into RAM. - * - */ - -#define ALT_LOAD_COPY_RWDATA - -#endif /* __LINKER_H_ */ diff --git a/software/qsys_tutorial_lcd_bsp/linker.x b/software/qsys_tutorial_lcd_bsp/linker.x deleted file mode 100644 index 4f94b86..0000000 --- a/software/qsys_tutorial_lcd_bsp/linker.x +++ /dev/null @@ -1,385 +0,0 @@ -/* - * linker.x - Linker script - * - * Machine generated for CPU 'nios2_processor' in SOPC Builder design 'nios_system' - * SOPC Builder design path: C:/Users/takayun/Documents/DE2-115/qsys_tutorial/nios_system.sopcinfo - * - * Generated: Thu Dec 01 23:23:48 JST 2016 - */ - -/* - * DO NOT MODIFY THIS FILE - * - * Changing this file will have subtle consequences - * which will almost certainly lead to a nonfunctioning - * system. If you do modify this file, be aware that your - * changes will be overwritten and lost when this file - * is generated again. - * - * DO NOT MODIFY THIS FILE - */ - -/* - * License Agreement - * - * Copyright (c) 2008 - * Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - * - * This agreement shall be governed in all respects by the laws of the State - * of California and by the laws of the United States of America. - */ - -MEMORY -{ - reset : ORIGIN = 0x0, LENGTH = 32 - onchip_memory : ORIGIN = 0x20, LENGTH = 16352 -} - -/* Define symbols for each memory base-address */ -__alt_mem_onchip_memory = 0x0; - -OUTPUT_FORMAT( "elf32-littlenios2", - "elf32-littlenios2", - "elf32-littlenios2" ) -OUTPUT_ARCH( nios2 ) -ENTRY( _start ) - -/* - * The alt_load() facility is enabled. This typically happens when there isn't - * an external bootloader (e.g. flash bootloader). - * The LMA (aka physical address) of each loaded section is - * set to the .text memory device. - * The HAL alt_load() routine called from crt0 copies sections from - * the .text memory to RAM as needed. - */ - -SECTIONS -{ - - /* - * Output sections associated with reset and exceptions (they have to be first) - */ - - .entry : - { - KEEP (*(.entry)) - } > reset - - .exceptions : - { - PROVIDE (__ram_exceptions_start = ABSOLUTE(.)); - . = ALIGN(0x20); - KEEP (*(.irq)); - KEEP (*(.exceptions.entry.label)); - KEEP (*(.exceptions.entry.user)); - KEEP (*(.exceptions.entry)); - KEEP (*(.exceptions.irqtest.user)); - KEEP (*(.exceptions.irqtest)); - KEEP (*(.exceptions.irqhandler.user)); - KEEP (*(.exceptions.irqhandler)); - KEEP (*(.exceptions.irqreturn.user)); - KEEP (*(.exceptions.irqreturn)); - KEEP (*(.exceptions.notirq.label)); - KEEP (*(.exceptions.notirq.user)); - KEEP (*(.exceptions.notirq)); - KEEP (*(.exceptions.soft.user)); - KEEP (*(.exceptions.soft)); - KEEP (*(.exceptions.unknown.user)); - KEEP (*(.exceptions.unknown)); - KEEP (*(.exceptions.exit.label)); - KEEP (*(.exceptions.exit.user)); - KEEP (*(.exceptions.exit)); - KEEP (*(.exceptions)); - PROVIDE (__ram_exceptions_end = ABSOLUTE(.)); - } > onchip_memory - - PROVIDE (__flash_exceptions_start = LOADADDR(.exceptions)); - - .text : - { - /* - * All code sections are merged into the text output section, along with - * the read only data sections. - * - */ - - PROVIDE (stext = ABSOLUTE(.)); - - *(.interp) - *(.hash) - *(.dynsym) - *(.dynstr) - *(.gnu.version) - *(.gnu.version_d) - *(.gnu.version_r) - *(.rel.init) - *(.rela.init) - *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) - *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) - *(.rel.fini) - *(.rela.fini) - *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) - *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) - *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) - *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) - *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) - *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) - *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) - *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) - *(.rel.ctors) - *(.rela.ctors) - *(.rel.dtors) - *(.rela.dtors) - *(.rel.got) - *(.rela.got) - *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) - *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) - *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) - *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) - *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) - *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) - *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) - *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) - *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) - *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) - *(.rel.plt) - *(.rela.plt) - *(.rel.dyn) - - KEEP (*(.init)) - *(.plt) - *(.text .stub .text.* .gnu.linkonce.t.*) - - /* .gnu.warning sections are handled specially by elf32.em. */ - - *(.gnu.warning.*) - KEEP (*(.fini)) - PROVIDE (__etext = ABSOLUTE(.)); - PROVIDE (_etext = ABSOLUTE(.)); - PROVIDE (etext = ABSOLUTE(.)); - - *(.eh_frame_hdr) - /* Ensure the __preinit_array_start label is properly aligned. We - could instead move the label definition inside the section, but - the linker would then create the section even if it turns out to - be empty, which isn't pretty. */ - . = ALIGN(4); - PROVIDE (__preinit_array_start = ABSOLUTE(.)); - *(.preinit_array) - PROVIDE (__preinit_array_end = ABSOLUTE(.)); - PROVIDE (__init_array_start = ABSOLUTE(.)); - *(.init_array) - PROVIDE (__init_array_end = ABSOLUTE(.)); - PROVIDE (__fini_array_start = ABSOLUTE(.)); - *(.fini_array) - PROVIDE (__fini_array_end = ABSOLUTE(.)); - SORT(CONSTRUCTORS) - KEEP (*(.eh_frame)) - *(.gcc_except_table) - *(.dynamic) - PROVIDE (__CTOR_LIST__ = ABSOLUTE(.)); - KEEP (*(.ctors)) - KEEP (*(SORT(.ctors.*))) - PROVIDE (__CTOR_END__ = ABSOLUTE(.)); - PROVIDE (__DTOR_LIST__ = ABSOLUTE(.)); - KEEP (*(.dtors)) - KEEP (*(SORT(.dtors.*))) - PROVIDE (__DTOR_END__ = ABSOLUTE(.)); - KEEP (*(.jcr)) - . = ALIGN(4); - } > onchip_memory = 0x3a880100 /* Nios II NOP instruction */ - - .rodata : - { - PROVIDE (__ram_rodata_start = ABSOLUTE(.)); - . = ALIGN(4); - *(.rodata .rodata.* .gnu.linkonce.r.*) - *(.rodata1) - . = ALIGN(4); - PROVIDE (__ram_rodata_end = ABSOLUTE(.)); - } > onchip_memory - - PROVIDE (__flash_rodata_start = LOADADDR(.rodata)); - - /* - * - * This section's LMA is set to the .text region. - * crt0 will copy to this section's specified mapped region virtual memory address (VMA) - * - * .rwdata region equals the .text region, and is set to be loaded into .text region. - * This requires two copies of .rwdata in the .text region. One read writable at VMA. - * and one read-only at LMA. crt0 will copy from LMA to VMA on reset - * - */ - - .rwdata LOADADDR (.rodata) + SIZEOF (.rodata) : AT ( LOADADDR (.rodata) + SIZEOF (.rodata)+ SIZEOF (.rwdata) ) - { - PROVIDE (__ram_rwdata_start = ABSOLUTE(.)); - . = ALIGN(4); - *(.got.plt) *(.got) - *(.data1) - *(.data .data.* .gnu.linkonce.d.*) - - _gp = ABSOLUTE(. + 0x8000); - PROVIDE(gp = _gp); - - *(.rwdata .rwdata.*) - *(.sdata .sdata.* .gnu.linkonce.s.*) - *(.sdata2 .sdata2.* .gnu.linkonce.s2.*) - - . = ALIGN(4); - _edata = ABSOLUTE(.); - PROVIDE (edata = ABSOLUTE(.)); - PROVIDE (__ram_rwdata_end = ABSOLUTE(.)); - } > onchip_memory - - PROVIDE (__flash_rwdata_start = LOADADDR(.rwdata)); - - /* - * - * This section's LMA is set to the .text region. - * crt0 will copy to this section's specified mapped region virtual memory address (VMA) - * - */ - - .bss LOADADDR (.rwdata) + SIZEOF (.rwdata) : AT ( LOADADDR (.rwdata) + SIZEOF (.rwdata) ) - { - __bss_start = ABSOLUTE(.); - PROVIDE (__sbss_start = ABSOLUTE(.)); - PROVIDE (___sbss_start = ABSOLUTE(.)); - - *(.dynsbss) - *(.sbss .sbss.* .gnu.linkonce.sb.*) - *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) - *(.scommon) - - PROVIDE (__sbss_end = ABSOLUTE(.)); - PROVIDE (___sbss_end = ABSOLUTE(.)); - - *(.dynbss) - *(.bss .bss.* .gnu.linkonce.b.*) - *(COMMON) - - . = ALIGN(4); - __bss_end = ABSOLUTE(.); - } > onchip_memory - - /* - * - * One output section mapped to the associated memory device for each of - * the available memory devices. These are not used by default, but can - * be used by user applications by using the .section directive. - * - * The output section used for the heap is treated in a special way, - * i.e. the symbols "end" and "_end" are added to point to the heap start. - * - * Because alt_load() is enabled, these sections have - * their LMA set to be loaded into the .text memory region. - * However, the alt_load() code will NOT automatically copy - * these sections into their mapped memory region. - * - */ - - /* - * - * This section's LMA is set to the .text region. - * crt0 will copy to this section's specified mapped region virtual memory address (VMA) - * - */ - - .onchip_memory LOADADDR (.bss) + SIZEOF (.bss) : AT ( LOADADDR (.bss) + SIZEOF (.bss) ) - { - PROVIDE (_alt_partition_onchip_memory_start = ABSOLUTE(.)); - *(.onchip_memory. onchip_memory.*) - . = ALIGN(4); - PROVIDE (_alt_partition_onchip_memory_end = ABSOLUTE(.)); - _end = ABSOLUTE(.); - end = ABSOLUTE(.); - __alt_stack_base = ABSOLUTE(.); - } > onchip_memory - - PROVIDE (_alt_partition_onchip_memory_load_addr = LOADADDR(.onchip_memory)); - - /* - * Stabs debugging sections. - * - */ - - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - /* DWARF debug sections. - Symbols in the DWARF debugging sections are relative to the beginning - of the section so we begin them at 0. */ - /* DWARF 1 */ - .debug 0 : { *(.debug) } - .line 0 : { *(.line) } - /* GNU DWARF 1 extensions */ - .debug_srcinfo 0 : { *(.debug_srcinfo) } - .debug_sfnames 0 : { *(.debug_sfnames) } - /* DWARF 1.1 and DWARF 2 */ - .debug_aranges 0 : { *(.debug_aranges) } - .debug_pubnames 0 : { *(.debug_pubnames) } - /* DWARF 2 */ - .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_line 0 : { *(.debug_line) } - .debug_frame 0 : { *(.debug_frame) } - .debug_str 0 : { *(.debug_str) } - .debug_loc 0 : { *(.debug_loc) } - .debug_macinfo 0 : { *(.debug_macinfo) } - /* SGI/MIPS DWARF 2 extensions */ - .debug_weaknames 0 : { *(.debug_weaknames) } - .debug_funcnames 0 : { *(.debug_funcnames) } - .debug_typenames 0 : { *(.debug_typenames) } - .debug_varnames 0 : { *(.debug_varnames) } - - /* Altera debug extensions */ - .debug_alt_sim_info 0 : { *(.debug_alt_sim_info) } -} - -/* provide a pointer for the stack */ - -/* - * Don't override this, override the __alt_stack_* symbols instead. - */ -__alt_data_end = 0x4000; - -/* - * The next two symbols define the location of the default stack. You can - * override them to move the stack to a different memory. - */ -PROVIDE( __alt_stack_pointer = __alt_data_end ); -PROVIDE( __alt_stack_limit = __alt_stack_base ); - -/* - * This symbol controls where the start of the heap is. If the stack is - * contiguous with the heap then the stack will contract as memory is - * allocated to the heap. - * Override this symbol to put the heap in a different memory. - */ -PROVIDE( __alt_heap_start = end ); -PROVIDE( __alt_heap_limit = 0x4000 ); diff --git a/software/qsys_tutorial_lcd_bsp/mem_init.mk b/software/qsys_tutorial_lcd_bsp/mem_init.mk deleted file mode 100644 index 8529cc2..0000000 --- a/software/qsys_tutorial_lcd_bsp/mem_init.mk +++ /dev/null @@ -1,322 +0,0 @@ - -######################################################################### -####### M E M I N I T M A K E F I L E C O N T E N T ###### -######################################################################### - -######################################################################### -# This file is intended to be included by public.mk -# -# -# The following variables must be defined before including this file: -# - ELF -# -# The following variables may be defined to override the default behavior: -# - HDL_SIM_DIR -# - HDL_SIM_INSTALL_DIR -# - MEM_INIT_DIR -# - MEM_INIT_INSTALL_DIR -# - QUARTUS_PROJECT_DIR -# - SOPC_NAME -# - SIM_OPTIMIZE -# - RESET_ADDRESS -# -######################################################################### - -ifeq ($(MEM_INIT_FILE),) -# MEM_INIT_FILE should be set equal to the working relative path to this -# mem_init.mk makefile fragment -MEM_INIT_FILE := $(wildcard $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))) -endif - -ifeq ($(ELF2DAT),) -ELF2DAT := elf2dat -endif - -ifeq ($(ELF2HEX),) -ELF2HEX := elf2hex -endif - -ifeq ($(ELF2FLASH),) -ELF2FLASH := elf2flash -endif - -ifeq ($(FLASH2DAT),) -FLASH2DAT := flash2dat -endif - -ifeq ($(NM),) -NM := nios2-elf-nm -endif - -ifeq ($(MKDIR),) -MKDIR := mkdir -p -endif - -ifeq ($(RM),) -RM := rm -f -endif - -ifeq ($(CP),) -CP := cp -endif - -ifeq ($(ECHO),) -ECHO := echo -endif - -MEM_INIT_DIR ?= mem_init -HDL_SIM_DIR ?= $(MEM_INIT_DIR)/hdl_sim - -ifdef QUARTUS_PROJECT_DIR -MEM_INIT_INSTALL_DIR ?= $(patsubst %/,%,$(QUARTUS_PROJECT_DIR)) -ifdef SOPC_NAME -HDL_SIM_INSTALL_DIR ?= $(patsubst %/,%,$(QUARTUS_PROJECT_DIR))/$(SOPC_NAME)_sim -endif -endif - -MEM_INIT_DESCRIPTOR_FILE ?= $(MEM_INIT_DIR)/meminit.spd - -MEM_INIT_QIP_FILE ?= $(MEM_INIT_DIR)/meminit.qip - -#------------------------------------- -# Default Flash Boot Loaders -#------------------------------------- - -BOOT_LOADER_PATH ?= $(SOPC_KIT_NIOS2)/components/altera_nios2 -BOOT_LOADER_CFI ?= $(BOOT_LOADER_PATH)/boot_loader_cfi.srec -BOOT_LOADER_CFI_BE ?= $(BOOT_LOADER_PATH)/boot_loader_cfi_be.srec - - -#------------------------------------- -# Default Target -#------------------------------------- - -.PHONY: default_mem_init -ifeq ($(QSYS),1) -default_mem_init: mem_init_generate -else -default_mem_init: mem_init_install -endif -#------------------------------------- -# Runtime Macros -#------------------------------------- - -define post-process-info - @echo Post-processing to create $@... -endef - -target_stem = $(notdir $(basename $@)) - -mem_start_address = $($(target_stem)_START) -mem_end_address = $($(target_stem)_END) -mem_width = $($(target_stem)_WIDTH) -mem_endianness = $($(target_stem)_ENDIANNESS) -mem_create_lanes = $($(target_stem)_CREATE_LANES) - -mem_pad_flag = $($(target_stem)_PAD_FLAG) -mem_reloc_input_flag = $($(target_stem)_RELOC_INPUT_FLAG) -mem_no_zero_fill_flag = $($(target_stem)_NO_ZERO_FILL_FLAG) - -flash_mem_epcs_flag = $($(target_stem)_EPCS_FLAGS) -flash_mem_cfi_flag = $($(target_stem)_CFI_FLAGS) -flash_mem_boot_loader_flag = $($(target_stem)_BOOT_LOADER_FLAG) - -elf2dat_extra_args = $(mem_pad_flag) -elf2hex_extra_args = $(mem_no_zero_fill_flag) -elf2flash_extra_args = $(flash_mem_cfi_flag) $(flash_mem_epcs_flag) $(flash_mem_boot_loader_flag) -flash2dat_extra_args = $(mem_pad_flag) $(mem_reloc_input_flag) - -#------------------------------------------------------------------------------ -# BSP SPECIFIC CONTENT -# -# The content below is controlled by the BSP and SOPC System -#------------------------------------------------------------------------------ -#START OF BSP SPECIFIC - -#------------------------------------- -# Global Settings -#------------------------------------- - - -# The following TYPE comment allows tools to identify the 'type' of target this -# makefile is associated with. -# TYPE: BSP_MEMINIT_MAKEFILE - -# This following VERSION comment indicates the version of the tool used to -# generate this makefile. A makefile variable is provided for VERSION as well. -# ACDS_VERSION: 13.0sp1 -ACDS_VERSION := 13.0sp1 - -# This following BUILD_NUMBER comment indicates the build number of the tool -# used to generate this makefile. -# BUILD_NUMBER: 232 - -# Optimize for simulation -SIM_OPTIMIZE ?= 0 - -# The CPU reset address as needed by elf2flash -RESET_ADDRESS ?= 0x00000000 - -#------------------------------------- -# Pre-Initialized Memory Descriptions -#------------------------------------- - -# Memory: onchip_memory -MEM_0 := nios_system_onchip_memory -$(MEM_0)_NAME := onchip_memory -$(MEM_0)_MEM_INIT_FILE_PARAM_NAME := INIT_FILE -HEX_FILES += $(MEM_INIT_DIR)/$(MEM_0).hex -MEM_INIT_INSTALL_FILES += $(MEM_INIT_INSTALL_DIR)/$(MEM_0).hex -DAT_FILES += $(HDL_SIM_DIR)/$(MEM_0).dat -HDL_SIM_INSTALL_FILES += $(HDL_SIM_INSTALL_DIR)/$(MEM_0).dat -SYM_FILES += $(HDL_SIM_DIR)/$(MEM_0).sym -HDL_SIM_INSTALL_FILES += $(HDL_SIM_INSTALL_DIR)/$(MEM_0).sym -$(MEM_0)_START := 0x00000000 -$(MEM_0)_END := 0x00003fff -$(MEM_0)_HIERARCHICAL_PATH := onchip_memory -$(MEM_0)_WIDTH := 32 -$(MEM_0)_ENDIANNESS := --little-endian-mem -$(MEM_0)_CREATE_LANES := 0 - -.PHONY: onchip_memory -onchip_memory: check_elf_exists $(MEM_INIT_DIR)/$(MEM_0).hex $(HDL_SIM_DIR)/$(MEM_0).dat $(HDL_SIM_DIR)/$(MEM_0).sym - - -#END OF BSP SPECIFIC - -#------------------------------------- -# Pre-Initialized Memory Targets -#------------------------------------- - -.PHONY: mem_init_install mem_init_generate mem_init_clean - -ifeq ($(QSYS),1) -# Target mem_init_install is deprecated for QSys based systems -# To initialize onchip memories for Quartus II Synthesis with Qsys based systems: -# 1) Use "make mem_init_genearate" -# 2) Add the generated mem_init/meminit.qip file to your Quartus II Project -# -mem_init_install: - $(error Deprecated Makefile Target: '$@'. Use target 'mem_init_generate' and then add $(MEM_INIT_QIP_FILE) to your Quartus II Project) - -else # QSYS != 1, if SopcBuilder based system - -ifneq ($(MEM_INIT_INSTALL_DIR),) -mem_init_install: $(MEM_INIT_INSTALL_FILES) -endif - -ifneq ($(HDL_SIM_INSTALL_DIR),) -mem_init_install: $(HDL_SIM_INSTALL_FILES) -endif - -mem_init_install: mem_init_generate -ifeq ($(MEM_INIT_INSTALL_DIR),) - @echo "WARNING: MEM_INIT_INSTALL_DIR not set. Set your QUARTUS_PROJECT_DIR environment variable." -endif -ifeq ($(HDL_SIM_INSTALL_DIR),) - @echo "WARNING: HDL_SIM_INSTALL_DIR not set. Set your QUARTUS_PROJECT_DIR and SOPC_NAME environment variable." -endif - -$(MEM_INIT_INSTALL_FILES): $(MEM_INIT_INSTALL_DIR)/%: $(MEM_INIT_DIR)/% - @$(MKDIR) $(@D) - @$(CP) -v $< $@ - -$(HDL_SIM_INSTALL_FILES): $(HDL_SIM_INSTALL_DIR)/%: $(HDL_SIM_DIR)/% - @$(MKDIR) $(@D) - @$(CP) -v $< $@ - -endif # QSYS == 1 - - -mem_init_generate: hex dat sym flash $(MEM_INIT_DESCRIPTOR_FILE) $(MEM_INIT_QIP_FILE) - -mem_init_clean: - @$(RM) -r $(MEM_INIT_DIR) $(HDL_SIM_DIR) $(FLASH_FILES) - -.PHONY: hex dat sym flash - -hex: check_elf_exists $(HEX_FILES) - -dat: check_elf_exists $(DAT_FILES) - -sym: check_elf_exists $(SYM_FILES) - -flash: check_elf_exists $(FLASH_FILES) - -#------------------------------------- -# Pre-Initialized Memory Rules -#------------------------------------- - -.PHONY: check_elf_exists -check_elf_exists: $(ELF) -ifeq ($(ELF),) - $(error ELF var not set in mem_init.mk) -endif - -$(filter-out $(FLASH_DAT_FILES),$(DAT_FILES)): %.dat: $(ELF) - $(post-process-info) - @$(MKDIR) $(@D) - bash -c '$(ELF2DAT) --infile=$< --outfile=$@ \ - --base=$(mem_start_address) --end=$(mem_end_address) --width=$(mem_width) \ - $(mem_endianness) --create-lanes=$(mem_create_lanes) $(elf2dat_extra_args)' - -$(foreach i,0 1 2 3 4 5 6 7,%_lane$(i).dat): %.dat - @true - -$(HEX_FILES): %.hex: $(ELF) - $(post-process-info) - @$(MKDIR) $(@D) - bash -c '$(ELF2HEX) $< $(mem_start_address) $(mem_end_address) --width=$(mem_width) \ - $(mem_endianness) --create-lanes=$(mem_create_lanes) $(elf2hex_extra_args) $@' - -$(SYM_FILES): %.sym: $(ELF) - $(post-process-info) - @$(MKDIR) $(@D) - $(NM) -n $< > $@ - -$(FLASH_FILES): %.flash: $(ELF) - $(post-process-info) - @$(MKDIR) $(@D) - bash -c '$(ELF2FLASH) --input=$< --outfile=$@ --sim_optimize=$(SIM_OPTIMIZE) $(mem_endianness) \ - $(elf2flash_extra_args)' - -# -# Function generate_spd_entry -# Arg1: path to the memory initialization file -# Arg2: Type HEX or DAT -# Arg3: Output spd file to append -gen_spd_entry.BASE_FILE = $(basename $(notdir $1)) -gen_spd_entry.PARAM_NAME = $($(gen_spd_entry.BASE_FILE)_MEM_INIT_FILE_PARAM_NAME) -gen_spd_entry.MEM_PATH = $($(gen_spd_entry.BASE_FILE)_HIERARCHICAL_PATH) -gen_spd_entry.SETTINGS = $(strip \ - path=\"$1\" \ - type=\"$2\" \ - $(if $(gen_spd_entry.PARAM_NAME),initParamName=\"$(gen_spd_entry.PARAM_NAME)\") \ - $(if $(gen_spd_entry.MEM_PATH),memoryPath=\"$(gen_spd_entry.MEM_PATH)\") \ -) -define gen_spd_entry -$(ECHO) "" >> $3 -endef - -$(MEM_INIT_DESCRIPTOR_FILE).DAT_FILESET := $(patsubst $(dir $(MEM_INIT_DESCRIPTOR_FILE))%,%,$(DAT_FILES)) -$(MEM_INIT_DESCRIPTOR_FILE).HEX_FILESET := $(patsubst $(dir $(MEM_INIT_DESCRIPTOR_FILE))%,%,$(HEX_FILES)) - -$(MEM_INIT_DESCRIPTOR_FILE): %.spd: $(MEM_INIT_FILE) - $(post-process-info) - @$(MKDIR) $(@D) - @$(RM) $@ - @$(ECHO) "" > $@ - @$(ECHO) "" >> $@ - @$(foreach dat_file,$($@.DAT_FILESET),$(call gen_spd_entry,$(dat_file),DAT,$@) &&)true - @$(foreach hex_file,$($@.HEX_FILESET),$(call gen_spd_entry,$(hex_file),HEX,$@) &&)true - @$(ECHO) "" >> $@ - -.DELETE_ON_ERROR: $(MEM_INIT_DESCRIPTOR_FILE) - -$(MEM_INIT_QIP_FILE): %.qip: $(MEM_INIT_FILE) - $(post-process-info) - @$(MKDIR) $(@D) - @$(RM) $@ - @$(ECHO) "set_global_assignment -name SEARCH_PATH $$::quartus(qip_path)" > $@ - -.DELETE_ON_ERROR: $(MEM_INIT_QIP_FILE) diff --git a/software/qsys_tutorial_lcd_bsp/memory.gdb b/software/qsys_tutorial_lcd_bsp/memory.gdb deleted file mode 100644 index 3460a0c..0000000 --- a/software/qsys_tutorial_lcd_bsp/memory.gdb +++ /dev/null @@ -1,50 +0,0 @@ -# memory.gdb - GDB memory region definitions -# -# Machine generated for CPU 'nios2_processor' in SOPC Builder design 'nios_system' -# SOPC Builder design path: C:/Users/takayun/Documents/DE2-115/qsys_tutorial/nios_system.sopcinfo -# -# Generated: Thu Dec 01 23:23:48 JST 2016 - -# DO NOT MODIFY THIS FILE -# -# Changing this file will have subtle consequences -# which will almost certainly lead to a nonfunctioning -# system. If you do modify this file, be aware that your -# changes will be overwritten and lost when this file -# is generated again. -# -# DO NOT MODIFY THIS FILE - -# License Agreement -# -# Copyright (c) 2008 -# Altera Corporation, San Jose, California, USA. -# All rights reserved. -# -# 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. -# -# This agreement shall be governed in all respects by the laws of the State -# of California and by the laws of the United States of America. - -# Define memory regions for each memory connected to the CPU. -# The cache attribute is specified which improves GDB performance -# by allowing GDB to cache memory contents on the host. - -# onchip_memory -memory 0x0 0x4000 cache diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_alarm_start.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_alarm_start.d deleted file mode 100644 index 3bb20ea..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_alarm_start.d +++ /dev/null @@ -1,22 +0,0 @@ -obj/HAL/src/alt_alarm_start.o: HAL/src/alt_alarm_start.c \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h system.h linker.h - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_alarm_start.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_alarm_start.o deleted file mode 100644 index 9230056..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_alarm_start.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_busy_sleep.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_busy_sleep.d deleted file mode 100644 index e93e80c..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_busy_sleep.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_busy_sleep.o: HAL/src/alt_busy_sleep.c system.h linker.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_busy_sleep.h - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_busy_sleep.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_busy_sleep.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_busy_sleep.o deleted file mode 100644 index 1af7c51..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_busy_sleep.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_close.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_close.d deleted file mode 100644 index fbbab9c..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_close.d +++ /dev/null @@ -1,34 +0,0 @@ -obj/HAL/src/alt_close.o: HAL/src/alt_close.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h \ - HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_close.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_close.o deleted file mode 100644 index 07989d2..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_close.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_dcache_flush.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_dcache_flush.d deleted file mode 100644 index a0eaf8a..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_dcache_flush.d +++ /dev/null @@ -1,15 +0,0 @@ -obj/HAL/src/alt_dcache_flush.o: HAL/src/alt_dcache_flush.c \ - HAL/inc/nios2.h system.h linker.h HAL/inc/alt_types.h \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h - -HAL/inc/nios2.h: - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_dcache_flush.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_dcache_flush.o deleted file mode 100644 index 43f3d9e..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_dcache_flush.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_dcache_flush_all.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_dcache_flush_all.d deleted file mode 100644 index 792c3e4..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_dcache_flush_all.d +++ /dev/null @@ -1,15 +0,0 @@ -obj/HAL/src/alt_dcache_flush_all.o: HAL/src/alt_dcache_flush_all.c \ - HAL/inc/nios2.h system.h linker.h HAL/inc/alt_types.h \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h - -HAL/inc/nios2.h: - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_dcache_flush_all.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_dcache_flush_all.o deleted file mode 100644 index 0614288..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_dcache_flush_all.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_dcache_flush_no_writeback.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_dcache_flush_no_writeback.d deleted file mode 100644 index 867c42b..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_dcache_flush_no_writeback.d +++ /dev/null @@ -1,16 +0,0 @@ -obj/HAL/src/alt_dcache_flush_no_writeback.o: \ - HAL/src/alt_dcache_flush_no_writeback.c HAL/inc/nios2.h system.h \ - linker.h HAL/inc/alt_types.h HAL/inc/sys/alt_cache.h \ - HAL/inc/alt_types.h - -HAL/inc/nios2.h: - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_dcache_flush_no_writeback.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_dcache_flush_no_writeback.o deleted file mode 100644 index 3009310..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_dcache_flush_no_writeback.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_dev.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_dev.d deleted file mode 100644 index cd9b1d4..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_dev.d +++ /dev/null @@ -1,34 +0,0 @@ -obj/HAL/src/alt_dev.o: HAL/src/alt_dev.c HAL/inc/sys/alt_dev.h system.h \ - linker.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h \ - HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h HAL/inc/alt_types.h \ - system.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/alt_types.h: - -system.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_dev.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_dev.o deleted file mode 100644 index 60d1325..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_dev.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_dev_llist_insert.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_dev_llist_insert.d deleted file mode 100644 index 344d065..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_dev_llist_insert.d +++ /dev/null @@ -1,13 +0,0 @@ -obj/HAL/src/alt_dev_llist_insert.o: HAL/src/alt_dev_llist_insert.c \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/alt_types.h HAL/inc/sys/alt_errno.h - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_errno.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_dev_llist_insert.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_dev_llist_insert.o deleted file mode 100644 index 33e5290..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_dev_llist_insert.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_dma_rxchan_open.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_dma_rxchan_open.d deleted file mode 100644 index fb21fed..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_dma_rxchan_open.d +++ /dev/null @@ -1,35 +0,0 @@ -obj/HAL/src/alt_dma_rxchan_open.o: HAL/src/alt_dma_rxchan_open.c \ - HAL/inc/sys/alt_dma.h HAL/inc/sys/alt_dma_dev.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/alt_types.h HAL/inc/sys/alt_errno.h \ - HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h system.h linker.h \ - HAL/inc/sys/alt_llist.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h - -HAL/inc/sys/alt_dma.h: - -HAL/inc/sys/alt_dma_dev.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_errno.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_dma_rxchan_open.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_dma_rxchan_open.o deleted file mode 100644 index 7769ea8..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_dma_rxchan_open.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_dma_txchan_open.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_dma_txchan_open.d deleted file mode 100644 index 500b95c..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_dma_txchan_open.d +++ /dev/null @@ -1,35 +0,0 @@ -obj/HAL/src/alt_dma_txchan_open.o: HAL/src/alt_dma_txchan_open.c \ - HAL/inc/sys/alt_dma.h HAL/inc/sys/alt_dma_dev.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/alt_types.h HAL/inc/sys/alt_errno.h \ - HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h system.h linker.h \ - HAL/inc/sys/alt_llist.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h - -HAL/inc/sys/alt_dma.h: - -HAL/inc/sys/alt_dma_dev.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_errno.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_dma_txchan_open.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_dma_txchan_open.o deleted file mode 100644 index 6354724..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_dma_txchan_open.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_do_ctors.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_do_ctors.d deleted file mode 100644 index daf8baf..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_do_ctors.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_do_ctors.o: HAL/src/alt_do_ctors.c diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_do_ctors.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_do_ctors.o deleted file mode 100644 index ac72eb7..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_do_ctors.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_do_dtors.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_do_dtors.d deleted file mode 100644 index c3471eb..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_do_dtors.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_do_dtors.o: HAL/src/alt_do_dtors.c diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_do_dtors.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_do_dtors.o deleted file mode 100644 index 0870e9d..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_do_dtors.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_env_lock.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_env_lock.d deleted file mode 100644 index 634d7b0..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_env_lock.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_env_lock.o: HAL/src/alt_env_lock.c diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_env_lock.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_env_lock.o deleted file mode 100644 index 60db716..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_env_lock.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_environ.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_environ.d deleted file mode 100644 index e9ca295..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_environ.d +++ /dev/null @@ -1,3 +0,0 @@ -obj/HAL/src/alt_environ.o: HAL/src/alt_environ.c HAL/inc/os/alt_syscall.h - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_environ.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_environ.o deleted file mode 100644 index 0f92e79..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_environ.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_errno.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_errno.d deleted file mode 100644 index 29ca544..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_errno.d +++ /dev/null @@ -1,8 +0,0 @@ -obj/HAL/src/alt_errno.o: HAL/src/alt_errno.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/alt_types.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_errno.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_errno.o deleted file mode 100644 index 77160ac..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_errno.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_exception_entry.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_exception_entry.d deleted file mode 100644 index 540567e..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_exception_entry.d +++ /dev/null @@ -1,6 +0,0 @@ -obj/HAL/src/alt_exception_entry.o: HAL/src/alt_exception_entry.S system.h \ - linker.h - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_exception_entry.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_exception_entry.o deleted file mode 100644 index 845374d..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_exception_entry.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_exception_muldiv.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_exception_muldiv.d deleted file mode 100644 index 63d66a7..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_exception_muldiv.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_exception_muldiv.o: HAL/src/alt_exception_muldiv.S diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_exception_muldiv.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_exception_muldiv.o deleted file mode 100644 index 89e684e..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_exception_muldiv.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_exception_trap.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_exception_trap.d deleted file mode 100644 index 6e18488..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_exception_trap.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_exception_trap.o: HAL/src/alt_exception_trap.S diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_exception_trap.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_exception_trap.o deleted file mode 100644 index 9541c51..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_exception_trap.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_execve.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_execve.d deleted file mode 100644 index 9cef7d2..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_execve.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_execve.o: HAL/src/alt_execve.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_execve.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_execve.o deleted file mode 100644 index 8539ab2..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_execve.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_exit.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_exit.d deleted file mode 100644 index a779da8..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_exit.d +++ /dev/null @@ -1,26 +0,0 @@ -obj/HAL/src/alt_exit.o: HAL/src/alt_exit.c HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h HAL/inc/alt_types.h system.h linker.h \ - HAL/inc/sys/alt_sim.h HAL/inc/os/alt_hooks.h HAL/inc/os/alt_syscall.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_log_printf.h system.h - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_sim.h: - -HAL/inc/os/alt_hooks.h: - -HAL/inc/os/alt_syscall.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_exit.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_exit.o deleted file mode 100644 index 69eccde..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_exit.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_fcntl.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_fcntl.d deleted file mode 100644 index 527f242..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_fcntl.d +++ /dev/null @@ -1,34 +0,0 @@ -obj/HAL/src/alt_fcntl.o: HAL/src/alt_fcntl.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h \ - system.h linker.h HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/alt_types.h \ - HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_fcntl.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_fcntl.o deleted file mode 100644 index 4ed174e..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_fcntl.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_fd_lock.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_fd_lock.d deleted file mode 100644 index 93daeac..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_fd_lock.d +++ /dev/null @@ -1,27 +0,0 @@ -obj/HAL/src/alt_fd_lock.o: HAL/src/alt_fd_lock.c HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_fd_lock.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_fd_lock.o deleted file mode 100644 index 6fb07e2..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_fd_lock.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_fd_unlock.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_fd_unlock.d deleted file mode 100644 index 45a3207..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_fd_unlock.d +++ /dev/null @@ -1,27 +0,0 @@ -obj/HAL/src/alt_fd_unlock.o: HAL/src/alt_fd_unlock.c \ - HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h system.h linker.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_fd_unlock.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_fd_unlock.o deleted file mode 100644 index 415002b..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_fd_unlock.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_find_dev.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_find_dev.d deleted file mode 100644 index 98336f8..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_find_dev.d +++ /dev/null @@ -1,31 +0,0 @@ -obj/HAL/src/alt_find_dev.o: HAL/src/alt_find_dev.c HAL/inc/sys/alt_dev.h \ - system.h linker.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h \ - HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h HAL/inc/alt_types.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_find_dev.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_find_dev.o deleted file mode 100644 index 4b6da5e..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_find_dev.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_find_file.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_find_file.d deleted file mode 100644 index d1150ca..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_find_file.d +++ /dev/null @@ -1,32 +0,0 @@ -obj/HAL/src/alt_find_file.o: HAL/src/alt_find_file.c \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h \ - HAL/inc/alt_types.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_find_file.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_find_file.o deleted file mode 100644 index f2ea44e..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_find_file.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_flash_dev.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_flash_dev.d deleted file mode 100644 index 8835e8f..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_flash_dev.d +++ /dev/null @@ -1,34 +0,0 @@ -obj/HAL/src/alt_flash_dev.o: HAL/src/alt_flash_dev.c \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/sys/alt_flash_dev.h \ - HAL/inc/sys/alt_flash_types.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h \ - system.h linker.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_flash_dev.h: - -HAL/inc/sys/alt_flash_types.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_flash_dev.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_flash_dev.o deleted file mode 100644 index 54f20f5..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_flash_dev.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_fork.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_fork.d deleted file mode 100644 index 492be65..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_fork.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_fork.o: HAL/src/alt_fork.c HAL/inc/sys/alt_warning.h \ - HAL/inc/sys/alt_errno.h HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_warning.h: - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_fork.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_fork.o deleted file mode 100644 index ea127d0..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_fork.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_fs_reg.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_fs_reg.d deleted file mode 100644 index d8f95ab..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_fs_reg.d +++ /dev/null @@ -1,29 +0,0 @@ -obj/HAL/src/alt_fs_reg.o: HAL/src/alt_fs_reg.c HAL/inc/sys/alt_dev.h \ - system.h linker.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h \ - HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_fs_reg.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_fs_reg.o deleted file mode 100644 index 1a01890..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_fs_reg.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_fstat.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_fstat.d deleted file mode 100644 index 942fcbc..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_fstat.d +++ /dev/null @@ -1,38 +0,0 @@ -obj/HAL/src/alt_fstat.o: HAL/src/alt_fstat.c HAL/inc/sys/alt_dev.h \ - system.h linker.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/sys/alt_errno.h \ - HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_syscall.h system.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/sys/alt_errno.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_syscall.h: - -system.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_fstat.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_fstat.o deleted file mode 100644 index 4d60497..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_fstat.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_get_fd.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_get_fd.d deleted file mode 100644 index 9a4daaa..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_get_fd.d +++ /dev/null @@ -1,34 +0,0 @@ -obj/HAL/src/alt_get_fd.o: HAL/src/alt_get_fd.c HAL/inc/sys/alt_dev.h \ - system.h linker.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h \ - HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h HAL/inc/alt_types.h \ - system.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/alt_types.h: - -system.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_get_fd.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_get_fd.o deleted file mode 100644 index a027bcf..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_get_fd.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_getchar.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_getchar.d deleted file mode 100644 index bcccdf7..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_getchar.d +++ /dev/null @@ -1,34 +0,0 @@ -obj/HAL/src/alt_getchar.o: HAL/src/alt_getchar.c system.h linker.h \ - HAL/inc/sys/alt_driver.h HAL/inc/sys/alt_stdio.h \ - HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h system.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h - -system.h: - -linker.h: - -HAL/inc/sys/alt_driver.h: - -HAL/inc/sys/alt_stdio.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_getchar.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_getchar.o deleted file mode 100644 index 790913e..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_getchar.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_getpid.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_getpid.d deleted file mode 100644 index d9499b9..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_getpid.d +++ /dev/null @@ -1,3 +0,0 @@ -obj/HAL/src/alt_getpid.o: HAL/src/alt_getpid.c HAL/inc/os/alt_syscall.h - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_getpid.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_getpid.o deleted file mode 100644 index 269a834..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_getpid.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_gettod.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_gettod.d deleted file mode 100644 index cf3cf34..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_gettod.d +++ /dev/null @@ -1,17 +0,0 @@ -obj/HAL/src/alt_gettod.o: HAL/src/alt_gettod.c HAL/inc/sys/alt_alarm.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/priv/alt_alarm.h \ - HAL/inc/alt_types.h HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_gettod.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_gettod.o deleted file mode 100644 index 193b60d..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_gettod.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_gmon.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_gmon.d deleted file mode 100644 index e9469ab..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_gmon.d +++ /dev/null @@ -1,24 +0,0 @@ -obj/HAL/src/alt_gmon.o: HAL/src/alt_gmon.c HAL/inc/priv/nios2_gmon_data.h \ - HAL/inc/sys/alt_irq.h HAL/inc/nios2.h HAL/inc/alt_types.h system.h \ - linker.h HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h - -HAL/inc/priv/nios2_gmon_data.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_gmon.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_gmon.o deleted file mode 100644 index 1a44284..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_gmon.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_icache_flush.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_icache_flush.d deleted file mode 100644 index 2e4ddd1..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_icache_flush.d +++ /dev/null @@ -1,15 +0,0 @@ -obj/HAL/src/alt_icache_flush.o: HAL/src/alt_icache_flush.c \ - HAL/inc/nios2.h system.h linker.h HAL/inc/alt_types.h \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h - -HAL/inc/nios2.h: - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_icache_flush.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_icache_flush.o deleted file mode 100644 index 91c0515..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_icache_flush.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_icache_flush_all.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_icache_flush_all.d deleted file mode 100644 index 47cfbf3..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_icache_flush_all.d +++ /dev/null @@ -1,15 +0,0 @@ -obj/HAL/src/alt_icache_flush_all.o: HAL/src/alt_icache_flush_all.c \ - HAL/inc/nios2.h system.h linker.h HAL/inc/alt_types.h \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h - -HAL/inc/nios2.h: - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_icache_flush_all.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_icache_flush_all.o deleted file mode 100644 index 9a489ad..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_icache_flush_all.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_iic.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_iic.d deleted file mode 100644 index a709e0c..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_iic.d +++ /dev/null @@ -1,29 +0,0 @@ -obj/HAL/src/alt_iic.o: HAL/src/alt_iic.c system.h linker.h \ - HAL/inc/sys/alt_irq.h HAL/inc/nios2.h HAL/inc/alt_types.h system.h \ - HAL/inc/priv/alt_iic_isr_register.h HAL/inc/alt_types.h \ - HAL/inc/sys/alt_irq.h HAL/inc/priv/alt_legacy_irq.h system.h \ - HAL/inc/nios2.h - -system.h: - -linker.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -HAL/inc/priv/alt_iic_isr_register.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/priv/alt_legacy_irq.h: - -system.h: - -HAL/inc/nios2.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_iic.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_iic.o deleted file mode 100644 index 7c10e66..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_iic.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_iic_isr_register.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_iic_isr_register.d deleted file mode 100644 index d0470ae..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_iic_isr_register.d +++ /dev/null @@ -1,30 +0,0 @@ -obj/HAL/src/alt_iic_isr_register.o: HAL/src/alt_iic_isr_register.c \ - system.h linker.h HAL/inc/alt_types.h HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h HAL/inc/alt_types.h system.h \ - HAL/inc/priv/alt_iic_isr_register.h HAL/inc/alt_types.h \ - HAL/inc/sys/alt_irq.h HAL/inc/sys/alt_irq_entry.h \ - HAL/inc/priv/alt_irq_table.h - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -HAL/inc/priv/alt_iic_isr_register.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/sys/alt_irq_entry.h: - -HAL/inc/priv/alt_irq_table.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_iic_isr_register.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_iic_isr_register.o deleted file mode 100644 index c10787b..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_iic_isr_register.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_instruction_exception_entry.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_instruction_exception_entry.d deleted file mode 100644 index 6d0705f..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_instruction_exception_entry.d +++ /dev/null @@ -1,18 +0,0 @@ -obj/HAL/src/alt_instruction_exception_entry.o: \ - HAL/src/alt_instruction_exception_entry.c HAL/inc/sys/alt_exceptions.h \ - HAL/inc/alt_types.h system.h linker.h HAL/inc/nios2.h \ - HAL/inc/alt_types.h system.h - -HAL/inc/sys/alt_exceptions.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_instruction_exception_entry.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_instruction_exception_entry.o deleted file mode 100644 index a73bd8d..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_instruction_exception_entry.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_instruction_exception_register.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_instruction_exception_register.d deleted file mode 100644 index d4fac04..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_instruction_exception_register.d +++ /dev/null @@ -1,16 +0,0 @@ -obj/HAL/src/alt_instruction_exception_register.o: \ - HAL/src/alt_instruction_exception_register.c \ - HAL/inc/sys/alt_exceptions.h HAL/inc/alt_types.h system.h linker.h \ - HAL/inc/alt_types.h system.h - -HAL/inc/sys/alt_exceptions.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -system.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_instruction_exception_register.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_instruction_exception_register.o deleted file mode 100644 index ca14cc3..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_instruction_exception_register.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_io_redirect.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_io_redirect.d deleted file mode 100644 index 8228365..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_io_redirect.d +++ /dev/null @@ -1,29 +0,0 @@ -obj/HAL/src/alt_io_redirect.o: HAL/src/alt_io_redirect.c \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_io_redirect.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_io_redirect.o deleted file mode 100644 index 6dd56fc..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_io_redirect.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_ioctl.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_ioctl.d deleted file mode 100644 index d70ad97..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_ioctl.d +++ /dev/null @@ -1,41 +0,0 @@ -obj/HAL/src/alt_ioctl.o: HAL/src/alt_ioctl.c HAL/inc/sys/ioctl.h \ - HAL/inc/sys/alt_errno.h HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h \ - HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h system.h linker.h \ - HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_syscall.h system.h \ - HAL/inc/sys/alt_driver.h - -HAL/inc/sys/ioctl.h: - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_syscall.h: - -system.h: - -HAL/inc/sys/alt_driver.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_ioctl.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_ioctl.o deleted file mode 100644 index 3546dd7..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_ioctl.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_irq_entry.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_irq_entry.d deleted file mode 100644 index 9ec3751..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_irq_entry.d +++ /dev/null @@ -1,5 +0,0 @@ -obj/HAL/src/alt_irq_entry.o: HAL/src/alt_irq_entry.S system.h linker.h - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_irq_entry.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_irq_entry.o deleted file mode 100644 index 3c3c702..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_irq_entry.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_irq_handler.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_irq_handler.d deleted file mode 100644 index 6fb668f..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_irq_handler.d +++ /dev/null @@ -1,19 +0,0 @@ -obj/HAL/src/alt_irq_handler.o: HAL/src/alt_irq_handler.c system.h \ - linker.h HAL/inc/sys/alt_irq.h HAL/inc/nios2.h HAL/inc/alt_types.h \ - system.h HAL/inc/os/alt_hooks.h HAL/inc/alt_types.h - -system.h: - -linker.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -HAL/inc/os/alt_hooks.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_irq_handler.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_irq_handler.o deleted file mode 100644 index d4c51f3..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_irq_handler.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_irq_register.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_irq_register.d deleted file mode 100644 index 3df2f8a..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_irq_register.d +++ /dev/null @@ -1,36 +0,0 @@ -obj/HAL/src/alt_irq_register.o: HAL/src/alt_irq_register.c system.h \ - linker.h HAL/inc/sys/alt_irq.h HAL/inc/nios2.h HAL/inc/alt_types.h \ - system.h HAL/inc/priv/alt_legacy_irq.h system.h HAL/inc/nios2.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_irq.h HAL/inc/os/alt_hooks.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_irq_entry.h \ - HAL/inc/priv/alt_irq_table.h - -system.h: - -linker.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -HAL/inc/priv/alt_legacy_irq.h: - -system.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/os/alt_hooks.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_irq_entry.h: - -HAL/inc/priv/alt_irq_table.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_irq_register.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_irq_register.o deleted file mode 100644 index 3093fc8..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_irq_register.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_irq_vars.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_irq_vars.d deleted file mode 100644 index f316558..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_irq_vars.d +++ /dev/null @@ -1,8 +0,0 @@ -obj/HAL/src/alt_irq_vars.o: HAL/src/alt_irq_vars.c HAL/inc/alt_types.h \ - system.h linker.h - -HAL/inc/alt_types.h: - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_irq_vars.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_irq_vars.o deleted file mode 100644 index 2c19885..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_irq_vars.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_isatty.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_isatty.d deleted file mode 100644 index f8b1f07..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_isatty.d +++ /dev/null @@ -1,38 +0,0 @@ -obj/HAL/src/alt_isatty.o: HAL/src/alt_isatty.c HAL/inc/sys/alt_dev.h \ - system.h linker.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_errno.h HAL/inc/sys/alt_warning.h \ - HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_syscall.h system.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_errno.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_syscall.h: - -system.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_isatty.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_isatty.o deleted file mode 100644 index 0f41105..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_isatty.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_kill.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_kill.d deleted file mode 100644 index 0c14ae8..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_kill.d +++ /dev/null @@ -1,8 +0,0 @@ -obj/HAL/src/alt_kill.o: HAL/src/alt_kill.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_kill.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_kill.o deleted file mode 100644 index 5ee9255..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_kill.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_link.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_link.d deleted file mode 100644 index dc844c6..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_link.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_link.o: HAL/src/alt_link.c HAL/inc/sys/alt_warning.h \ - HAL/inc/sys/alt_errno.h HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_warning.h: - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_link.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_link.o deleted file mode 100644 index 5347ed2..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_link.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_load.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_load.d deleted file mode 100644 index d496ab8..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_load.d +++ /dev/null @@ -1,8 +0,0 @@ -obj/HAL/src/alt_load.o: HAL/src/alt_load.c HAL/inc/sys/alt_load.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_cache.h - -HAL/inc/sys/alt_load.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_cache.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_load.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_load.o deleted file mode 100644 index 6737e2e..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_load.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_log_macro.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_log_macro.d deleted file mode 100644 index 9768c1f..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_log_macro.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_log_macro.o: HAL/src/alt_log_macro.S diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_log_macro.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_log_macro.o deleted file mode 100644 index 489e2cc..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_log_macro.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_log_printf.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_log_printf.d deleted file mode 100644 index 251ff6d..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_log_printf.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_log_printf.o: HAL/src/alt_log_printf.c diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_log_printf.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_log_printf.o deleted file mode 100644 index a03c33d..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_log_printf.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_lseek.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_lseek.d deleted file mode 100644 index 25ed783..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_lseek.d +++ /dev/null @@ -1,34 +0,0 @@ -obj/HAL/src/alt_lseek.o: HAL/src/alt_lseek.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h \ - HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_lseek.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_lseek.o deleted file mode 100644 index 3b5d857..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_lseek.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_main.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_main.d deleted file mode 100644 index afdfda0..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_main.d +++ /dev/null @@ -1,47 +0,0 @@ -obj/HAL/src/alt_main.o: HAL/src/alt_main.c HAL/inc/sys/alt_dev.h system.h \ - linker.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_sys_init.h HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h HAL/inc/os/alt_hooks.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h \ - HAL/inc/alt_types.h system.h HAL/inc/sys/alt_log_printf.h system.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_sys_init.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/os/alt_hooks.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/alt_types.h: - -system.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_main.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_main.o deleted file mode 100644 index 98a8281..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_main.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_malloc_lock.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_malloc_lock.d deleted file mode 100644 index 4ed35c2..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_malloc_lock.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_malloc_lock.o: HAL/src/alt_malloc_lock.c diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_malloc_lock.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_malloc_lock.o deleted file mode 100644 index dfc614d..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_malloc_lock.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_mcount.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_mcount.d deleted file mode 100644 index 1203efc..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_mcount.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_mcount.o: HAL/src/alt_mcount.S diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_mcount.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_mcount.o deleted file mode 100644 index 21bd730..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_mcount.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_open.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_open.d deleted file mode 100644 index a2aacd9..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_open.d +++ /dev/null @@ -1,36 +0,0 @@ -obj/HAL/src/alt_open.o: HAL/src/alt_open.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_open.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_open.o deleted file mode 100644 index e56efdf..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_open.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_printf.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_printf.d deleted file mode 100644 index 3ce68a4..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_printf.d +++ /dev/null @@ -1,3 +0,0 @@ -obj/HAL/src/alt_printf.o: HAL/src/alt_printf.c HAL/inc/sys/alt_stdio.h - -HAL/inc/sys/alt_stdio.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_printf.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_printf.o deleted file mode 100644 index 6a09c9f..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_printf.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_putchar.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_putchar.d deleted file mode 100644 index 9a0dde3..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_putchar.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_putchar.o: HAL/src/alt_putchar.c system.h linker.h \ - HAL/inc/sys/alt_driver.h HAL/inc/sys/alt_stdio.h - -system.h: - -linker.h: - -HAL/inc/sys/alt_driver.h: - -HAL/inc/sys/alt_stdio.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_putchar.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_putchar.o deleted file mode 100644 index b300e01..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_putchar.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_putstr.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_putstr.d deleted file mode 100644 index 3cf528a..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_putstr.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_putstr.o: HAL/src/alt_putstr.c system.h linker.h \ - HAL/inc/sys/alt_driver.h HAL/inc/sys/alt_stdio.h - -system.h: - -linker.h: - -HAL/inc/sys/alt_driver.h: - -HAL/inc/sys/alt_stdio.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_putstr.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_putstr.o deleted file mode 100644 index a7959ee..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_putstr.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_read.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_read.d deleted file mode 100644 index 2bb0d95..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_read.d +++ /dev/null @@ -1,38 +0,0 @@ -obj/HAL/src/alt_read.o: HAL/src/alt_read.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h \ - HAL/inc/os/alt_syscall.h system.h HAL/inc/sys/alt_driver.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_syscall.h: - -system.h: - -HAL/inc/sys/alt_driver.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_read.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_read.o deleted file mode 100644 index 209e0ae..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_read.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_release_fd.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_release_fd.d deleted file mode 100644 index 0e3acb5..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_release_fd.d +++ /dev/null @@ -1,29 +0,0 @@ -obj/HAL/src/alt_release_fd.o: HAL/src/alt_release_fd.c \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_release_fd.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_release_fd.o deleted file mode 100644 index 5ede051..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_release_fd.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_remap_cached.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_remap_cached.d deleted file mode 100644 index b5fb151..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_remap_cached.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_remap_cached.o: HAL/src/alt_remap_cached.c \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h system.h linker.h - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_remap_cached.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_remap_cached.o deleted file mode 100644 index 0e87cfb..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_remap_cached.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_remap_uncached.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_remap_uncached.d deleted file mode 100644 index 0423405..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_remap_uncached.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_remap_uncached.o: HAL/src/alt_remap_uncached.c \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h system.h linker.h - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_remap_uncached.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_remap_uncached.o deleted file mode 100644 index 3b48b12..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_remap_uncached.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_rename.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_rename.d deleted file mode 100644 index b7af4b2..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_rename.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_rename.o: HAL/src/alt_rename.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_rename.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_rename.o deleted file mode 100644 index 4af5333..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_rename.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_sbrk.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_sbrk.d deleted file mode 100644 index a0771ae..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_sbrk.d +++ /dev/null @@ -1,19 +0,0 @@ -obj/HAL/src/alt_sbrk.o: HAL/src/alt_sbrk.c HAL/inc/os/alt_syscall.h \ - HAL/inc/sys/alt_irq.h HAL/inc/nios2.h HAL/inc/alt_types.h system.h \ - linker.h HAL/inc/sys/alt_stack.h system.h - -HAL/inc/os/alt_syscall.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_stack.h: - -system.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_sbrk.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_sbrk.o deleted file mode 100644 index 70fc7d9..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_sbrk.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_settod.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_settod.d deleted file mode 100644 index 56718d5..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_settod.d +++ /dev/null @@ -1,17 +0,0 @@ -obj/HAL/src/alt_settod.o: HAL/src/alt_settod.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_settod.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_settod.o deleted file mode 100644 index 746a391..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_settod.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_software_exception.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_software_exception.d deleted file mode 100644 index fab4023..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_software_exception.d +++ /dev/null @@ -1,6 +0,0 @@ -obj/HAL/src/alt_software_exception.o: HAL/src/alt_software_exception.S \ - system.h linker.h - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_software_exception.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_software_exception.o deleted file mode 100644 index f9e01c2..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_software_exception.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_stat.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_stat.d deleted file mode 100644 index 8a63c27..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_stat.d +++ /dev/null @@ -1,3 +0,0 @@ -obj/HAL/src/alt_stat.o: HAL/src/alt_stat.c HAL/inc/os/alt_syscall.h - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_stat.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_stat.o deleted file mode 100644 index 29db367..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_stat.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_tick.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_tick.d deleted file mode 100644 index ddbb281..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_tick.d +++ /dev/null @@ -1,27 +0,0 @@ -obj/HAL/src/alt_tick.o: HAL/src/alt_tick.c HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h HAL/inc/alt_types.h system.h linker.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/os/alt_hooks.h \ - HAL/inc/alt_types.h - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_hooks.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_tick.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_tick.o deleted file mode 100644 index 874f458..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_tick.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_times.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_times.d deleted file mode 100644 index 4bad83d..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_times.d +++ /dev/null @@ -1,17 +0,0 @@ -obj/HAL/src/alt_times.o: HAL/src/alt_times.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_times.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_times.o deleted file mode 100644 index 04b8fd6..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_times.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_uncached_free.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_uncached_free.d deleted file mode 100644 index d74ef4b..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_uncached_free.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_uncached_free.o: HAL/src/alt_uncached_free.c \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h system.h linker.h - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_uncached_free.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_uncached_free.o deleted file mode 100644 index 4a54cff..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_uncached_free.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_uncached_malloc.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_uncached_malloc.d deleted file mode 100644 index 16799fb..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_uncached_malloc.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_uncached_malloc.o: HAL/src/alt_uncached_malloc.c \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h system.h linker.h - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_uncached_malloc.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_uncached_malloc.o deleted file mode 100644 index 1c54418..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_uncached_malloc.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_unlink.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_unlink.d deleted file mode 100644 index 0205f86..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_unlink.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_unlink.o: HAL/src/alt_unlink.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_unlink.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_unlink.o deleted file mode 100644 index f776aaa..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_unlink.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_usleep.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_usleep.d deleted file mode 100644 index b5eca45..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_usleep.d +++ /dev/null @@ -1,6 +0,0 @@ -obj/HAL/src/alt_usleep.o: HAL/src/alt_usleep.c \ - HAL/inc/priv/alt_busy_sleep.h HAL/inc/os/alt_syscall.h - -HAL/inc/priv/alt_busy_sleep.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_usleep.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_usleep.o deleted file mode 100644 index c2c48af..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_usleep.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_wait.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_wait.d deleted file mode 100644 index f47f5df..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_wait.d +++ /dev/null @@ -1,8 +0,0 @@ -obj/HAL/src/alt_wait.o: HAL/src/alt_wait.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_wait.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_wait.o deleted file mode 100644 index ba0f21d..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_wait.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_write.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_write.d deleted file mode 100644 index 2b54a68..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_write.d +++ /dev/null @@ -1,41 +0,0 @@ -obj/HAL/src/alt_write.o: HAL/src/alt_write.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h \ - HAL/inc/os/alt_syscall.h HAL/inc/sys/alt_log_printf.h system.h \ - HAL/inc/sys/alt_driver.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_syscall.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: - -HAL/inc/sys/alt_driver.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_write.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_write.o deleted file mode 100644 index 0f4e096..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/alt_write.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/altera_nios2_qsys_irq.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/altera_nios2_qsys_irq.d deleted file mode 100644 index 47bdd9c..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/altera_nios2_qsys_irq.d +++ /dev/null @@ -1,15 +0,0 @@ -obj/HAL/src/altera_nios2_qsys_irq.o: HAL/src/altera_nios2_qsys_irq.c \ - HAL/inc/sys/alt_irq.h HAL/inc/nios2.h HAL/inc/alt_types.h system.h \ - linker.h HAL/inc/altera_nios2_qsys_irq.h - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/altera_nios2_qsys_irq.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/altera_nios2_qsys_irq.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/altera_nios2_qsys_irq.o deleted file mode 100644 index 2d45c87..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/altera_nios2_qsys_irq.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/crt0.d b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/crt0.d deleted file mode 100644 index 3af0bb0..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/crt0.d +++ /dev/null @@ -1,12 +0,0 @@ -obj/HAL/src/crt0.o: HAL/src/crt0.S system.h linker.h HAL/inc/nios2.h \ - HAL/inc/sys/alt_log_printf.h system.h - -system.h: - -linker.h: - -HAL/inc/nios2.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/crt0.o b/software/qsys_tutorial_lcd_bsp/obj/HAL/src/crt0.o deleted file mode 100644 index 8327828..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/HAL/src/crt0.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/alt_sys_init.d b/software/qsys_tutorial_lcd_bsp/obj/alt_sys_init.d deleted file mode 100644 index 2087a7a..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/alt_sys_init.d +++ /dev/null @@ -1,54 +0,0 @@ -obj/alt_sys_init.o: alt_sys_init.c system.h linker.h \ - HAL/inc/sys/alt_irq.h HAL/inc/nios2.h HAL/inc/alt_types.h system.h \ - HAL/inc/sys/alt_sys_init.h HAL/inc/altera_nios2_qsys_irq.h \ - drivers/inc/altera_avalon_jtag_uart.h HAL/inc/sys/alt_alarm.h \ - HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h \ - HAL/inc/sys/alt_warning.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_flag.h \ - drivers/inc/altera_avalon_jtag_uart_fd.h HAL/inc/sys/alt_dev.h \ - HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h - -system.h: - -linker.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -HAL/inc/sys/alt_sys_init.h: - -HAL/inc/altera_nios2_qsys_irq.h: - -drivers/inc/altera_avalon_jtag_uart.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_flag.h: - -drivers/inc/altera_avalon_jtag_uart_fd.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/alt_sys_init.o b/software/qsys_tutorial_lcd_bsp/obj/alt_sys_init.o deleted file mode 100644 index 9292284..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/alt_sys_init.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/drivers/src/altera_avalon_jtag_uart_fd.d b/software/qsys_tutorial_lcd_bsp/obj/drivers/src/altera_avalon_jtag_uart_fd.d deleted file mode 100644 index b152697..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/drivers/src/altera_avalon_jtag_uart_fd.d +++ /dev/null @@ -1,48 +0,0 @@ -obj/drivers/src/altera_avalon_jtag_uart_fd.o: \ - drivers/src/altera_avalon_jtag_uart_fd.c HAL/inc/alt_types.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - drivers/inc/altera_avalon_jtag_uart.h HAL/inc/sys/alt_alarm.h \ - HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_alarm.h \ - HAL/inc/sys/alt_warning.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_flag.h \ - drivers/inc/altera_avalon_jtag_uart_fd.h HAL/inc/sys/alt_dev.h - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_flag.h: - -drivers/inc/altera_avalon_jtag_uart_fd.h: - -HAL/inc/sys/alt_dev.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/drivers/src/altera_avalon_jtag_uart_fd.o b/software/qsys_tutorial_lcd_bsp/obj/drivers/src/altera_avalon_jtag_uart_fd.o deleted file mode 100644 index 5908c3f..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/drivers/src/altera_avalon_jtag_uart_fd.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/drivers/src/altera_avalon_jtag_uart_init.d b/software/qsys_tutorial_lcd_bsp/obj/drivers/src/altera_avalon_jtag_uart_init.d deleted file mode 100644 index f9460a1..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/drivers/src/altera_avalon_jtag_uart_init.d +++ /dev/null @@ -1,66 +0,0 @@ -obj/drivers/src/altera_avalon_jtag_uart_init.o: \ - drivers/src/altera_avalon_jtag_uart_init.c HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h HAL/inc/alt_types.h system.h linker.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/sys/ioctl.h \ - HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart_regs.h \ - HAL/inc/io.h HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_warning.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_flag.h \ - drivers/inc/altera_avalon_jtag_uart_fd.h HAL/inc/sys/alt_dev.h \ - HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/sys/alt_log_printf.h system.h - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/ioctl.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart_regs.h: - -HAL/inc/io.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_flag.h: - -drivers/inc/altera_avalon_jtag_uart_fd.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/drivers/src/altera_avalon_jtag_uart_init.o b/software/qsys_tutorial_lcd_bsp/obj/drivers/src/altera_avalon_jtag_uart_init.o deleted file mode 100644 index b0d65b8..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/drivers/src/altera_avalon_jtag_uart_init.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/drivers/src/altera_avalon_jtag_uart_ioctl.d b/software/qsys_tutorial_lcd_bsp/obj/drivers/src/altera_avalon_jtag_uart_ioctl.d deleted file mode 100644 index d75a559..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/drivers/src/altera_avalon_jtag_uart_ioctl.d +++ /dev/null @@ -1,58 +0,0 @@ -obj/drivers/src/altera_avalon_jtag_uart_ioctl.o: \ - drivers/src/altera_avalon_jtag_uart_ioctl.c HAL/inc/sys/ioctl.h \ - HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart_regs.h \ - HAL/inc/io.h HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h \ - HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_flag.h \ - drivers/inc/altera_avalon_jtag_uart_fd.h HAL/inc/sys/alt_dev.h system.h \ - linker.h HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/sys/alt_log_printf.h system.h - -HAL/inc/sys/ioctl.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart_regs.h: - -HAL/inc/io.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_flag.h: - -drivers/inc/altera_avalon_jtag_uart_fd.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/drivers/src/altera_avalon_jtag_uart_ioctl.o b/software/qsys_tutorial_lcd_bsp/obj/drivers/src/altera_avalon_jtag_uart_ioctl.o deleted file mode 100644 index 3315910..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/drivers/src/altera_avalon_jtag_uart_ioctl.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/drivers/src/altera_avalon_jtag_uart_read.d b/software/qsys_tutorial_lcd_bsp/obj/drivers/src/altera_avalon_jtag_uart_read.d deleted file mode 100644 index 9a4846a..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/drivers/src/altera_avalon_jtag_uart_read.d +++ /dev/null @@ -1,66 +0,0 @@ -obj/drivers/src/altera_avalon_jtag_uart_read.o: \ - drivers/src/altera_avalon_jtag_uart_read.c HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h HAL/inc/alt_types.h system.h linker.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/sys/ioctl.h \ - HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart_regs.h \ - HAL/inc/io.h HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_warning.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_flag.h \ - drivers/inc/altera_avalon_jtag_uart_fd.h HAL/inc/sys/alt_dev.h \ - HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/sys/alt_log_printf.h system.h - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/ioctl.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart_regs.h: - -HAL/inc/io.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_flag.h: - -drivers/inc/altera_avalon_jtag_uart_fd.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/drivers/src/altera_avalon_jtag_uart_read.o b/software/qsys_tutorial_lcd_bsp/obj/drivers/src/altera_avalon_jtag_uart_read.o deleted file mode 100644 index 14422e5..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/drivers/src/altera_avalon_jtag_uart_read.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/obj/drivers/src/altera_avalon_jtag_uart_write.d b/software/qsys_tutorial_lcd_bsp/obj/drivers/src/altera_avalon_jtag_uart_write.d deleted file mode 100644 index 5518b7f..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/drivers/src/altera_avalon_jtag_uart_write.d +++ /dev/null @@ -1,66 +0,0 @@ -obj/drivers/src/altera_avalon_jtag_uart_write.o: \ - drivers/src/altera_avalon_jtag_uart_write.c HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h HAL/inc/alt_types.h system.h linker.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/sys/ioctl.h \ - HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart_regs.h \ - HAL/inc/io.h HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_warning.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_flag.h \ - drivers/inc/altera_avalon_jtag_uart_fd.h HAL/inc/sys/alt_dev.h \ - HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/sys/alt_log_printf.h system.h - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/ioctl.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart_regs.h: - -HAL/inc/io.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_flag.h: - -drivers/inc/altera_avalon_jtag_uart_fd.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: diff --git a/software/qsys_tutorial_lcd_bsp/obj/drivers/src/altera_avalon_jtag_uart_write.o b/software/qsys_tutorial_lcd_bsp/obj/drivers/src/altera_avalon_jtag_uart_write.o deleted file mode 100644 index 387f1f2..0000000 --- a/software/qsys_tutorial_lcd_bsp/obj/drivers/src/altera_avalon_jtag_uart_write.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_lcd_bsp/public.mk b/software/qsys_tutorial_lcd_bsp/public.mk deleted file mode 100644 index 5eb883d..0000000 --- a/software/qsys_tutorial_lcd_bsp/public.mk +++ /dev/null @@ -1,385 +0,0 @@ -#------------------------------------------------------------------------------ -# BSP "PUBLIC" MAKEFILE CONTENT -# -# This file is intended to be included in an application or library -# Makefile that is using this BSP. You can create such a Makefile with -# the nios2-app-generate-makefile or nios2-lib-generate-makefile -# commands. -# -# The following variables must be defined before including this file: -# -# ALT_LIBRARY_ROOT_DIR -# Contains the path to the BSP top-level (aka root) directory -#------------------------------------------------------------------------------ - -#------------------------------------------------------------------------------ -# PATHS -#------------------------------------------------------------------------------ - - - -# Path to the provided linker script. -BSP_LINKER_SCRIPT := $(ALT_LIBRARY_ROOT_DIR)/linker.x - -# Include paths: -# The path to root of all header files that a library wishes to make -# available for an application's use is specified here. Note that this -# may not be *all* folders within a hierarchy. For example, if it is -# desired that the application developer type: -# #include -# #include -# With files laid out like this: -# /inc/sockets.h -# /inc/ip/tcpip.h -# -# Then, only /inc need be added to the list of include -# directories. Alternatively, if you wish to be able to directly include -# all files in a hierarchy, separate paths to each folder in that -# hierarchy must be defined. - -# The following are the "base" set of include paths for a BSP. -# These paths are appended to the list that individual software -# components, drivers, etc., add in the generated portion of this -# file (below). -ALT_INCLUDE_DIRS_TO_APPEND += \ - $(ALT_LIBRARY_ROOT_DIR) \ - $(ALT_LIBRARY_ROOT_DIR)/drivers/inc - -# Additions to linker library search-path: -# Here we provide a path to "our self" for the application to construct a -# "-L " out of. This should contain a list of directories, -# relative to the library root, of all directories with .a files to link -# against. -ALT_LIBRARY_DIRS += $(ALT_LIBRARY_ROOT_DIR) - - -#------------------------------------------------------------------------------ -# COMPILATION FLAGS -#------------------------------------------------------------------------------ -# Default C pre-processor flags for a BSP: -ALT_CPPFLAGS += -DSYSTEM_BUS_WIDTH=32 \ - -pipe - - -#------------------------------------------------------------------------------ -# MANAGED CONTENT -# -# All content between the lines "START MANAGED" and "END MANAGED" below is -# generated based on variables in the BSP settings file when the -# nios2-bsp-generate-files command is invoked. If you wish to persist any -# information pertaining to the build process, it is recomended that you -# utilize the BSP settings mechanism to do so. -#------------------------------------------------------------------------------ -#START MANAGED - -# The following TYPE comment allows tools to identify the 'type' of target this -# makefile is associated with. -# TYPE: BSP_PUBLIC_MAKEFILE - -# This following VERSION comment indicates the version of the tool used to -# generate this makefile. A makefile variable is provided for VERSION as well. -# ACDS_VERSION: 13.0sp1 -ACDS_VERSION := 13.0sp1 - -# This following BUILD_NUMBER comment indicates the build number of the tool -# used to generate this makefile. -# BUILD_NUMBER: 232 - -# Qsys--generated SOPCINFO file. Required for resolving node instance ID's with -# design component names. -SOPCINFO_FILE := C:/Users/takayun/Documents/DE2-115/qsys_tutorial/nios_system.sopcinfo - -# Big-Endian operation. -# setting BIG_ENDIAN is false -ALT_CFLAGS += -EL - -# Path to the provided C language runtime initialization code. -BSP_CRT0 := $(ALT_LIBRARY_ROOT_DIR)/obj/HAL/src/crt0.o - -# Name of BSP library as provided to linker using the "-msys-lib" flag or -# linker script GROUP command. -# setting BSP_SYS_LIB is hal_bsp -BSP_SYS_LIB := hal_bsp -ELF_PATCH_FLAG += --thread_model hal - -# Type identifier of the BSP library -# setting BSP_TYPE is hal -ALT_CPPFLAGS += -D__hal__ -BSP_TYPE := hal - -# CPU Name -# setting CPU_NAME is nios2_processor -CPU_NAME = nios2_processor -ELF_PATCH_FLAG += --cpu_name $(CPU_NAME) - -# Hardware Divider present. -# setting HARDWARE_DIVIDE is false -ALT_CFLAGS += -mno-hw-div - -# Hardware Multiplier present. -# setting HARDWARE_MULTIPLY is false -ALT_CFLAGS += -mno-hw-mul - -# Hardware Mulx present. -# setting HARDWARE_MULX is false -ALT_CFLAGS += -mno-hw-mulx - -# Debug Core present. -# setting HAS_DEBUG_CORE is true -CPU_HAS_DEBUG_CORE = 1 - -# Qsys generated design -# setting QSYS is 1 -QSYS := 1 -ELF_PATCH_FLAG += --qsys true - -# Design Name -# setting SOPC_NAME is nios_system -SOPC_NAME := nios_system - -# SopcBuilder Simulation Enabled -# setting SOPC_SIMULATION_ENABLED is false -ELF_PATCH_FLAG += --simulation_enabled false - -# Enable JTAG UART driver to recover when host is inactive causing buffer to -# full without returning error. Printf will not fail with this recovery. none -# setting altera_avalon_jtag_uart_driver.enable_jtag_uart_ignore_fifo_full_error is false - -# Small-footprint (polled mode) driver none -# setting altera_avalon_jtag_uart_driver.enable_small_driver is false - -# Build a custom version of newlib with the specified space-separated compiler -# flags. The custom newlib build will be placed in the <bsp root>/newlib -# directory, and will be used only for applications that utilize this BSP. -# setting hal.custom_newlib_flags is none - -# Enable support for a subset of the C++ language. This option increases code -# footprint by adding support for C++ constructors. Certain features, such as -# multiple inheritance and exceptions are not supported. If false, adds -# -DALT_NO_C_PLUS_PLUS to ALT_CPPFLAGS in public.mk, and reduces code -# footprint. none -# setting hal.enable_c_plus_plus is false -ALT_CPPFLAGS += -DALT_NO_C_PLUS_PLUS - -# When your application exits, close file descriptors, call C++ destructors, -# etc. Code footprint can be reduced by disabling clean exit. If disabled, adds -# -DALT_NO_CLEAN_EXIT to ALT_CPPFLAGS and -Wl,--defsym, exit=_exit to -# ALT_LDFLAGS in public.mk. none -# setting hal.enable_clean_exit is false -ALT_CPPFLAGS += -DALT_NO_CLEAN_EXIT -ALT_LDFLAGS += -Wl,--defsym,exit=_exit - -# Add exit() support. This option increases code footprint if your "main()" -# routine does "return" or call "exit()". If false, adds -DALT_NO_EXIT to -# ALT_CPPFLAGS in public.mk, and reduces footprint none -# setting hal.enable_exit is false -ALT_CPPFLAGS += -DALT_NO_EXIT - -# Causes code to be compiled with gprof profiling enabled and the application -# ELF to be linked with the GPROF library. If true, adds -DALT_PROVIDE_GMON to -# ALT_CPPFLAGS and -pg to ALT_CFLAGS in public.mk. none -# setting hal.enable_gprof is false - -# Enables lightweight device driver API. This reduces code and data footprint -# by removing the HAL layer that maps device names (e.g. /dev/uart0) to file -# descriptors. Instead, driver routines are called directly. The open(), -# close(), and lseek() routines will always fail if called. The read(), -# write(), fstat(), ioctl(), and isatty() routines only work for the stdio -# devices. If true, adds -DALT_USE_DIRECT_DRIVERS to ALT_CPPFLAGS in public.mk. -# The Altera Host and read-only ZIP file systems can't be used if -# hal.enable_lightweight_device_driver_api is true. -# setting hal.enable_lightweight_device_driver_api is true -ALT_CPPFLAGS += -DALT_USE_DIRECT_DRIVERS - -# Adds code to emulate multiply and divide instructions in case they are -# executed but aren't present in the CPU. Normally this isn't required because -# the compiler won't use multiply and divide instructions that aren't present -# in the CPU. If false, adds -DALT_NO_INSTRUCTION_EMULATION to ALT_CPPFLAGS in -# public.mk. none -# setting hal.enable_mul_div_emulation is false -ALT_CPPFLAGS += -DALT_NO_INSTRUCTION_EMULATION - -# Certain drivers are compiled with reduced functionality to reduce code -# footprint. Not all drivers observe this setting. The altera_avalon_uart and -# altera_avalon_jtag_uart drivers switch from interrupt-driven to polled -# operation. CAUTION: Several device drivers are disabled entirely. These -# include the altera_avalon_cfi_flash, altera_avalon_epcs_flash_controller, and -# altera_avalon_lcd_16207 drivers. This can result in certain API (HAL flash -# access routines) to fail. You can define a symbol provided by each driver to -# prevent it from being removed. If true, adds -DALT_USE_SMALL_DRIVERS to -# ALT_CPPFLAGS in public.mk. none -# setting hal.enable_reduced_device_drivers is true -ALT_CPPFLAGS += -DALT_USE_SMALL_DRIVERS - -# Turns on HAL runtime stack checking feature. Enabling this setting causes -# additional code to be placed into each subroutine call to generate an -# exception if a stack collision occurs with the heap or statically allocated -# data. If true, adds -DALT_STACK_CHECK and -mstack-check to ALT_CPPFLAGS in -# public.mk. none -# setting hal.enable_runtime_stack_checking is false - -# The BSP is compiled with optimizations to speedup HDL simulation such as -# initializing the cache, clearing the .bss section, and skipping long delay -# loops. If true, adds -DALT_SIM_OPTIMIZE to ALT_CPPFLAGS in public.mk. When -# this setting is true, the BSP shouldn't be used to build applications that -# are expected to run real hardware. -# setting hal.enable_sim_optimize is false - -# Causes the small newlib (C library) to be used. This reduces code and data -# footprint at the expense of reduced functionality. Several newlib features -# are removed such as floating-point support in printf(), stdin input routines, -# and buffered I/O. The small C library is not compatible with Micrium -# MicroC/OS-II. If true, adds -msmallc to ALT_LDFLAGS in public.mk. none -# setting hal.enable_small_c_library is true -ALT_LDFLAGS += -msmallc -ALT_CPPFLAGS += -DSMALL_C_LIB - -# Enable SOPC Builder System ID. If a System ID SOPC Builder component is -# connected to the CPU associated with this BSP, it will be enabled in the -# creation of command-line arguments to download an ELF to the target. -# Otherwise, system ID and timestamp values are left out of public.mk for -# application Makefile "download-elf" target definition. With the system ID -# check disabled, the Nios II EDS tools will not automatically ensure that the -# application .elf file (and BSP it is linked against) corresponds to the -# hardware design on the target. If false, adds --accept-bad-sysid to -# SOPC_SYSID_FLAG in public.mk. none -# setting hal.enable_sopc_sysid_check is true - -# Enable BSP generation to query if SOPC system is big endian. If true ignores -# export of 'ALT_CFLAGS += -EB' to public.mk if big endian system. If true -# ignores export of 'ALT_CFLAGS += -EL' if little endian system. none -# setting hal.make.ignore_system_derived.big_endian is false - -# Enable BSP generation to query if SOPC system has a debug core present. If -# true ignores export of 'CPU_HAS_DEBUG_CORE = 1' to public.mk if a debug core -# is found in the system. If true ignores export of 'CPU_HAS_DEBUG_CORE = 0' if -# no debug core is found in the system. none -# setting hal.make.ignore_system_derived.debug_core_present is false - -# Enable BSP generation to query if SOPC system has FPU present. If true -# ignores export of 'ALT_CFLAGS += -mhard-float' to public.mk if FPU is found -# in the system. If true ignores export of 'ALT_CFLAGS += -mhard-soft' if FPU -# is not found in the system. none -# setting hal.make.ignore_system_derived.fpu_present is false - -# Enable BSP generation to query if SOPC system has hardware divide present. If -# true ignores export of 'ALT_CFLAGS += -mno-hw-div' to public.mk if no -# division is found in system. If true ignores export of 'ALT_CFLAGS += -# -mhw-div' if division is found in the system. none -# setting hal.make.ignore_system_derived.hardware_divide_present is false - -# Enable BSP generation to query if SOPC system floating point custom -# instruction with a divider is present. If true ignores export of 'ALT_CFLAGS -# += -mcustom-fpu-cfg=60-2' and 'ALT_LDFLAGS += -mcustom-fpu-cfg=60-2' to -# public.mk if the custom instruction is found in the system. none -# setting hal.make.ignore_system_derived.hardware_fp_cust_inst_divider_present is false - -# Enable BSP generation to query if SOPC system floating point custom -# instruction without a divider is present. If true ignores export of -# 'ALT_CFLAGS += -mcustom-fpu-cfg=60-1' and 'ALT_LDFLAGS += -# -mcustom-fpu-cfg=60-1' to public.mk if the custom instruction is found in the -# system. none -# setting hal.make.ignore_system_derived.hardware_fp_cust_inst_no_divider_present is false - -# Enable BSP generation to query if SOPC system has multiplier present. If true -# ignores export of 'ALT_CFLAGS += -mno-hw-mul' to public.mk if no multiplier -# is found in the system. If true ignores export of 'ALT_CFLAGS += -mhw-mul' if -# multiplier is found in the system. none -# setting hal.make.ignore_system_derived.hardware_multiplier_present is false - -# Enable BSP generation to query if SOPC system has hardware mulx present. If -# true ignores export of 'ALT_CFLAGS += -mno-hw-mulx' to public.mk if no mulx -# is found in the system. If true ignores export of 'ALT_CFLAGS += -mhw-mulx' -# if mulx is found in the system. none -# setting hal.make.ignore_system_derived.hardware_mulx_present is false - -# Enable BSP generation to query if SOPC system has simulation enabled. If true -# ignores export of 'ELF_PATCH_FLAG += --simulation_enabled' to public.mk. none -# setting hal.make.ignore_system_derived.sopc_simulation_enabled is false - -# Enable BSP generation to query SOPC system for system ID base address. If -# true ignores export of 'SOPC_SYSID_FLAG += --sidp=
' and -# 'ELF_PATCH_FLAG += --sidp=
' to public.mk. none -# setting hal.make.ignore_system_derived.sopc_system_base_address is false - -# Enable BSP generation to query SOPC system for system ID. If true ignores -# export of 'SOPC_SYSID_FLAG += --id=' and 'ELF_PATCH_FLAG += -# --id=' to public.mk. none -# setting hal.make.ignore_system_derived.sopc_system_id is false - -# Enable BSP generation to query SOPC system for system timestamp. If true -# ignores export of 'SOPC_SYSID_FLAG += --timestamp=' and -# 'ELF_PATCH_FLAG += --timestamp=' to public.mk. none -# setting hal.make.ignore_system_derived.sopc_system_timestamp is false - -# Slave descriptor of STDERR character-mode device. This setting is used by the -# ALT_STDERR family of defines in system.h. none -# setting hal.stderr is jtag_uart -ELF_PATCH_FLAG += --stderr_dev jtag_uart - -# Slave descriptor of STDIN character-mode device. This setting is used by the -# ALT_STDIN family of defines in system.h. none -# setting hal.stdin is jtag_uart -ELF_PATCH_FLAG += --stdin_dev jtag_uart - -# Slave descriptor of STDOUT character-mode device. This setting is used by the -# ALT_STDOUT family of defines in system.h. none -# setting hal.stdout is jtag_uart -ELF_PATCH_FLAG += --stdout_dev jtag_uart - - -#------------------------------------------------------------------------------ -# SOFTWARE COMPONENT & DRIVER INCLUDE PATHS -#------------------------------------------------------------------------------ - -ALT_INCLUDE_DIRS += $(ALT_LIBRARY_ROOT_DIR)/HAL/inc - -#------------------------------------------------------------------------------ -# SOFTWARE COMPONENT & DRIVER PRODUCED ALT_CPPFLAGS ADDITIONS -#------------------------------------------------------------------------------ - -ALT_CPPFLAGS += -DALT_SINGLE_THREADED - -#END MANAGED - - -#------------------------------------------------------------------------------ -# LIBRARY INFORMATION -#------------------------------------------------------------------------------ -# Assemble the name of the BSP *.a file using the BSP library name -# (BSP_SYS_LIB) in generated content above. -BSP_LIB := lib$(BSP_SYS_LIB).a - -# Additional libraries to link against: -# An application including this file will prefix each library with "-l". -# For example, to include the Newlib math library "m" is included, which -# becomes "-lm" when linking the application. -ALT_LIBRARY_NAMES += m - -# Additions to linker dependencies: -# An application Makefile will typically add these directly to the list -# of dependencies required to build the executable target(s). The BSP -# library (*.a) file is specified here. -ALT_LDDEPS += $(ALT_LIBRARY_ROOT_DIR)/$(BSP_LIB) - -# Is this library "Makeable"? -# Add to list of root library directories that support running 'make' -# to build them. Because libraries may or may not have a Makefile in their -# root, appending to this variable tells an application to run 'make' in -# the library root to build/update this library. -MAKEABLE_LIBRARY_ROOT_DIRS += $(ALT_LIBRARY_ROOT_DIR) - -# Additional Assembler Flags -# -gdwarf2 flag is required for stepping through assembly code -ALT_ASFLAGS += -gdwarf2 - -#------------------------------------------------------------------------------ -# FINAL INCLUDE PATH LIST -#------------------------------------------------------------------------------ -# Append static include paths to paths specified by OS/driver/sw package -# additions to the BSP thus giving them precedence in case a BSP addition -# is attempting to override BSP sources. -ALT_INCLUDE_DIRS += $(ALT_INCLUDE_DIRS_TO_APPEND) - - - diff --git a/software/qsys_tutorial_lcd_bsp/settings.bsp b/software/qsys_tutorial_lcd_bsp/settings.bsp deleted file mode 100644 index f01ba7c..0000000 --- a/software/qsys_tutorial_lcd_bsp/settings.bsp +++ /dev/null @@ -1,997 +0,0 @@ - - - hal - default - 2016/12/01 23:23:47 - 1480602227537 - C:\Users\takayun\Documents\DE2-115\qsys_tutorial\software\qsys_tutorial_lcd_bsp - .\settings.bsp - C:\Users\takayun\Documents\DE2-115\qsys_tutorial\nios_system.sopcinfo - default - nios2_processor - 1.9 - - hal.sys_clk_timer - ALT_SYS_CLK - UnquotedString - none - none - system_h_define - Slave descriptor of the system clock timer device. This device provides a periodic interrupt ("tick") and is typically required for RTOS use. This setting defines the value of ALT_SYS_CLK in system.h. - none - false - common - - - hal.timestamp_timer - ALT_TIMESTAMP_CLK - UnquotedString - none - none - system_h_define - Slave descriptor of timestamp timer device. This device is used by Altera HAL timestamp drivers for high-resolution time measurement. This setting defines the value of ALT_TIMESTAMP_CLK in system.h. - none - false - common - - - hal.max_file_descriptors - ALT_MAX_FD - DecimalNumber - 4 - 32 - system_h_define - Determines the number of file descriptors statically allocated. This setting defines the value of ALT_MAX_FD in system.h. - If hal.enable_lightweight_device_driver_api is true, there are no file descriptors so this setting is ignored. If hal.enable_lightweight_device_driver_api is false, this setting must be at least 4 because HAL needs a file descriptor for /dev/null, /dev/stdin, /dev/stdout, and /dev/stderr. - false - - - - hal.enable_instruction_related_exceptions_api - ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API - BooleanDefineOnly - false - false - system_h_define - Enables API for registering handlers to service instruction-related exceptions. Enabling this setting increases the size of the exception entry code. - These exception types can be generated if various processor options are enabled, such as the MMU, MPU, or other advanced exception types. - false - - - - hal.linker.allow_code_at_reset - ALT_ALLOW_CODE_AT_RESET - Boolean - 1 - 0 - none - Indicates if initialization code is allowed at the reset address. If true, defines the macro ALT_ALLOW_CODE_AT_RESET in linker.h. - If true, defines the macro ALT_ALLOW_CODE_AT_RESET in linker.h. This setting is typically false if an external bootloader (e.g. flash bootloader) is present. - false - - - - hal.linker.enable_alt_load - NONE - Boolean - 1 - 0 - none - Enables the alt_load() facility. The alt_load() facility copies sections from the .text memory into RAM. If true, this setting sets up the VMA/LMA of sections in linker.x to allow them to be loaded into the .text memory. - This setting is typically false if an external bootloader (e.g. flash bootloader) is present. - false - - - - hal.linker.enable_alt_load_copy_rodata - NONE - Boolean - 0 - 0 - none - Causes the alt_load() facility to copy the .rodata section. If true, this setting defines the macro ALT_LOAD_COPY_RODATA in linker.h. - none - false - - - - hal.linker.enable_alt_load_copy_rwdata - NONE - Boolean - 1 - 0 - none - Causes the alt_load() facility to copy the .rwdata section. If true, this setting defines the macro ALT_LOAD_COPY_RWDATA in linker.h. - none - false - - - - hal.linker.enable_alt_load_copy_exceptions - NONE - Boolean - 0 - 0 - none - Causes the alt_load() facility to copy the .exceptions section. If true, this setting defines the macro ALT_LOAD_COPY_EXCEPTIONS in linker.h. - none - false - - - - hal.linker.enable_exception_stack - NONE - Boolean - 0 - 0 - none - Enables use of a separate exception stack. If true, defines the macro ALT_EXCEPTION_STACK in linker.h, adds a memory region called exception_stack to linker.x, and provides the symbols __alt_exception_stack_pointer and __alt_exception_stack_limit in linker.x. - The hal.linker.exception_stack_size and hal.linker.exception_stack_memory_region_name settings must also be valid. This setting must be false for MicroC/OS-II BSPs. The exception stack can be used to improve interrupt and other exception performance if the EIC is *not* used. - false - common - - - hal.linker.exception_stack_size - NONE - DecimalNumber - 1024 - 1024 - none - Size of the exception stack in bytes. - Only used if hal.linker.enable_exception_stack is true. - false - common - - - hal.linker.exception_stack_memory_region_name - NONE - UnquotedString - onchip_memory - none - none - Name of the existing memory region that will be divided up to create the 'exception_stack' memory region. The selected region name will be adjusted automatically when the BSP is generated to create the 'exception_stack' memory region. - Only used if hal.linker.enable_exception_stack is true. - false - common - - - hal.linker.enable_interrupt_stack - NONE - Boolean - 0 - 0 - none - Enables use of a separate interrupt stack. If true, defines the macro ALT_INTERRUPT_STACK in linker.h, adds a memory region called interrupt_stack to linker.x, and provides the symbols __alt_interrupt_stack_pointer and __alt_interrupt_stack_limit in linker.x. - The hal.linker.interrupt_stack_size and hal.linker.interrupt_stack_memory_region_name settings must also be valid. This setting must be false for MicroC/OS-II BSPs. Only enable if the EIC is used exclusively. The exception stack can be used to improve interrupt and other exception performance if the EIC is *not* used. - false - common - - - hal.linker.interrupt_stack_size - NONE - DecimalNumber - 1024 - 1024 - none - Size of the interrupt stack in bytes. - Only used if hal.linker.enable_interrupt_stack is true. - false - common - - - hal.linker.interrupt_stack_memory_region_name - NONE - UnquotedString - onchip_memory - none - none - Name of the existing memory region that will be divided up to create the 'interrupt_stack' memory region. The selected region name will be adjusted automatically when the BSP is generated to create the 'interrupt_stack' memory region. - Only used if hal.linker.enable_interrupt_stack is true. - false - common - - - hal.stdin - NONE - UnquotedString - jtag_uart - none - system_h_define - Slave descriptor of STDIN character-mode device. This setting is used by the ALT_STDIN family of defines in system.h. - none - false - common - - - hal.stdout - NONE - UnquotedString - jtag_uart - none - system_h_define - Slave descriptor of STDOUT character-mode device. This setting is used by the ALT_STDOUT family of defines in system.h. - none - false - common - - - hal.stderr - NONE - UnquotedString - jtag_uart - none - system_h_define - Slave descriptor of STDERR character-mode device. This setting is used by the ALT_STDERR family of defines in system.h. - none - false - common - - - hal.log_port - NONE - UnquotedString - none - none - public_mk_define - Slave descriptor of debug logging character-mode device. If defined, it enables extra debug messages in the HAL source. This setting is used by the ALT_LOG_PORT family of defines in system.h. - none - false - none - - - hal.make.build_pre_process - BUILD_PRE_PROCESS - UnquotedString - none - none - makefile_variable - Command executed before BSP built. - none - false - none - - - hal.make.ar_pre_process - AR_PRE_PROCESS - UnquotedString - none - none - makefile_variable - Command executed before archiver execution. - none - false - none - - - hal.make.bsp_cflags_defined_symbols - BSP_CFLAGS_DEFINED_SYMBOLS - UnquotedString - none - none - makefile_variable - Preprocessor macros to define. A macro definition in this setting has the same effect as a "#define" in source code. Adding "-DALT_DEBUG" to this setting has the same effect as "#define ALT_DEBUG" in a souce file. Adding "-DFOO=1" to this setting is equivalent to the macro "#define FOO 1" in a source file. Macros defined with this setting are applied to all .S, .c, and C++ files in the BSP. This setting defines the value of BSP_CFLAGS_DEFINED_SYMBOLS in the BSP Makefile. - none - false - none - - - hal.make.ar_post_process - AR_POST_PROCESS - UnquotedString - none - none - makefile_variable - Command executed after archiver execution. - none - false - none - - - hal.make.as - AS - UnquotedString - nios2-elf-gcc - nios2-elf-gcc - makefile_variable - Assembler command. Note that CC is used for .S files. - none - false - none - - - hal.make.build_post_process - BUILD_POST_PROCESS - UnquotedString - none - none - makefile_variable - Command executed after BSP built. - none - false - none - - - hal.make.bsp_cflags_debug - BSP_CFLAGS_DEBUG - UnquotedString - -g - -g - makefile_variable - C/C++ compiler debug level. '-g' provides the default set of debug symbols typically required to debug a typical application. Omitting '-g' removes debug symbols from the ELF. This setting defines the value of BSP_CFLAGS_DEBUG in Makefile. - none - false - common - - - hal.make.ar - AR - UnquotedString - nios2-elf-ar - nios2-elf-ar - makefile_variable - Archiver command. Creates library files. - none - false - none - - - hal.make.rm - RM - UnquotedString - rm -f - rm -f - makefile_variable - Command used to remove files during 'clean' target. - none - false - none - - - hal.make.cxx_pre_process - CXX_PRE_PROCESS - UnquotedString - none - none - makefile_variable - Command executed before each C++ file is compiled. - none - false - none - - - hal.make.bsp_cflags_warnings - BSP_CFLAGS_WARNINGS - UnquotedString - -Wall - -Wall - makefile_variable - C/C++ compiler warning level. "-Wall" is commonly used.This setting defines the value of BSP_CFLAGS_WARNINGS in Makefile. - none - false - none - - - hal.make.bsp_arflags - BSP_ARFLAGS - UnquotedString - -src - -src - makefile_variable - Custom flags only passed to the archiver. This content of this variable is directly passed to the archiver rather than the more standard "ARFLAGS". The reason for this is that GNU Make assumes some default content in ARFLAGS. This setting defines the value of BSP_ARFLAGS in Makefile. - none - false - none - - - hal.make.bsp_cflags_optimization - BSP_CFLAGS_OPTIMIZATION - UnquotedString - '-Os' - -O0 - makefile_variable - C/C++ compiler optimization level. "-O0" = no optimization,"-O2" = "normal" optimization, etc. "-O0" is recommended for code that you want to debug since compiler optimization can remove variables and produce non-sequential execution of code while debugging. This setting defines the value of BSP_CFLAGS_OPTIMIZATION in Makefile. - none - false - common - - - hal.make.as_post_process - AS_POST_PROCESS - UnquotedString - none - none - makefile_variable - Command executed after each assembly file is compiled. - none - false - none - - - hal.make.cc_pre_process - CC_PRE_PROCESS - UnquotedString - none - none - makefile_variable - Command executed before each .c/.S file is compiled. - none - false - none - - - hal.make.bsp_asflags - BSP_ASFLAGS - UnquotedString - -Wa,-gdwarf2 - -Wa,-gdwarf2 - makefile_variable - Custom flags only passed to the assembler. This setting defines the value of BSP_ASFLAGS in Makefile. - none - false - none - - - hal.make.as_pre_process - AS_PRE_PROCESS - UnquotedString - none - none - makefile_variable - Command executed before each assembly file is compiled. - none - false - none - - - hal.make.bsp_cflags_undefined_symbols - BSP_CFLAGS_UNDEFINED_SYMBOLS - UnquotedString - none - none - makefile_variable - Preprocessor macros to undefine. Undefined macros are similar to defined macros, but replicate the "#undef" directive in source code. To undefine the macro FOO use the syntax "-u FOO" in this setting. This is equivalent to "#undef FOO" in a source file. Note: the syntax differs from macro definition (there is a space, i.e. "-u FOO" versus "-DFOO"). Macros defined with this setting are applied to all .S, .c, and C++ files in the BSP. This setting defines the value of BSP_CFLAGS_UNDEFINED_SYMBOLS in the BSP Makefile. - none - false - none - - - hal.make.cc_post_process - CC_POST_PROCESS - UnquotedString - none - none - makefile_variable - Command executed after each .c/.S file is compiled. - none - false - none - - - hal.make.cxx_post_process - CXX_POST_PROCESS - UnquotedString - none - none - makefile_variable - Command executed before each C++ file is compiled. - none - false - none - - - hal.make.cc - CC - UnquotedString - nios2-elf-gcc -xc - nios2-elf-gcc -xc - makefile_variable - C compiler command. - none - false - none - - - hal.make.bsp_cxx_flags - BSP_CXXFLAGS - UnquotedString - none - none - makefile_variable - Custom flags only passed to the C++ compiler. This setting defines the value of BSP_CXXFLAGS in Makefile. - none - false - none - - - hal.make.bsp_inc_dirs - BSP_INC_DIRS - UnquotedString - none - none - makefile_variable - Space separated list of extra include directories to scan for header files. Directories are relative to the top-level BSP directory. The -I prefix's added by the makefile so don't add it here. This setting defines the value of BSP_INC_DIRS in Makefile. - none - false - none - - - hal.make.cxx - CXX - UnquotedString - nios2-elf-gcc -xc++ - nios2-elf-gcc -xc++ - makefile_variable - C++ compiler command. - none - false - none - - - hal.make.bsp_cflags_user_flags - BSP_CFLAGS_USER_FLAGS - UnquotedString - none - none - makefile_variable - Custom flags passed to the compiler when compiling C, C++, and .S files. This setting defines the value of BSP_CFLAGS_USER_FLAGS in Makefile. - none - false - none - - - hal.make.ignore_system_derived.sopc_system_id - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query SOPC system for system ID. If true ignores export of 'SOPC_SYSID_FLAG += --id=<sysid>' and 'ELF_PATCH_FLAG += --id=<sysid>' to public.mk. - none - false - none - - - hal.make.ignore_system_derived.sopc_system_timestamp - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query SOPC system for system timestamp. If true ignores export of 'SOPC_SYSID_FLAG += --timestamp=<timestamp>' and 'ELF_PATCH_FLAG += --timestamp=<timestamp>' to public.mk. - none - false - none - - - hal.make.ignore_system_derived.sopc_system_base_address - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query SOPC system for system ID base address. If true ignores export of 'SOPC_SYSID_FLAG += --sidp=<address>' and 'ELF_PATCH_FLAG += --sidp=<address>' to public.mk. - none - false - none - - - hal.make.ignore_system_derived.sopc_simulation_enabled - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system has simulation enabled. If true ignores export of 'ELF_PATCH_FLAG += --simulation_enabled' to public.mk. - none - false - none - - - hal.make.ignore_system_derived.fpu_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system has FPU present. If true ignores export of 'ALT_CFLAGS += -mhard-float' to public.mk if FPU is found in the system. If true ignores export of 'ALT_CFLAGS += -mhard-soft' if FPU is not found in the system. - none - false - none - - - hal.make.ignore_system_derived.hardware_multiplier_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system has multiplier present. If true ignores export of 'ALT_CFLAGS += -mno-hw-mul' to public.mk if no multiplier is found in the system. If true ignores export of 'ALT_CFLAGS += -mhw-mul' if multiplier is found in the system. - none - false - none - - - hal.make.ignore_system_derived.hardware_mulx_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system has hardware mulx present. If true ignores export of 'ALT_CFLAGS += -mno-hw-mulx' to public.mk if no mulx is found in the system. If true ignores export of 'ALT_CFLAGS += -mhw-mulx' if mulx is found in the system. - none - false - none - - - hal.make.ignore_system_derived.hardware_divide_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system has hardware divide present. If true ignores export of 'ALT_CFLAGS += -mno-hw-div' to public.mk if no division is found in system. If true ignores export of 'ALT_CFLAGS += -mhw-div' if division is found in the system. - none - false - none - - - hal.make.ignore_system_derived.debug_core_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system has a debug core present. If true ignores export of 'CPU_HAS_DEBUG_CORE = 1' to public.mk if a debug core is found in the system. If true ignores export of 'CPU_HAS_DEBUG_CORE = 0' if no debug core is found in the system. - none - false - none - - - hal.make.ignore_system_derived.big_endian - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system is big endian. If true ignores export of 'ALT_CFLAGS += -EB' to public.mk if big endian system. If true ignores export of 'ALT_CFLAGS += -EL' if little endian system. - none - false - none - - - hal.make.ignore_system_derived.hardware_fp_cust_inst_divider_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system floating point custom instruction with a divider is present. If true ignores export of 'ALT_CFLAGS += -mcustom-fpu-cfg=60-2' and 'ALT_LDFLAGS += -mcustom-fpu-cfg=60-2' to public.mk if the custom instruction is found in the system. - none - false - none - - - hal.make.ignore_system_derived.hardware_fp_cust_inst_no_divider_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system floating point custom instruction without a divider is present. If true ignores export of 'ALT_CFLAGS += -mcustom-fpu-cfg=60-1' and 'ALT_LDFLAGS += -mcustom-fpu-cfg=60-1' to public.mk if the custom instruction is found in the system. - none - false - none - - - hal.enable_exit - ALT_NO_EXIT - Boolean - 0 - 1 - public_mk_define - Add exit() support. This option increases code footprint if your "main()" routine does "return" or call "exit()". If false, adds -DALT_NO_EXIT to ALT_CPPFLAGS in public.mk, and reduces footprint - none - false - none - - - hal.enable_small_c_library - NONE - Boolean - 1 - 0 - public_mk_define - Causes the small newlib (C library) to be used. This reduces code and data footprint at the expense of reduced functionality. Several newlib features are removed such as floating-point support in printf(), stdin input routines, and buffered I/O. The small C library is not compatible with Micrium MicroC/OS-II. If true, adds -msmallc to ALT_LDFLAGS in public.mk. - none - false - common - - - hal.enable_clean_exit - ALT_NO_CLEAN_EXIT - Boolean - 0 - 1 - public_mk_define - When your application exits, close file descriptors, call C++ destructors, etc. Code footprint can be reduced by disabling clean exit. If disabled, adds -DALT_NO_CLEAN_EXIT to ALT_CPPFLAGS and -Wl,--defsym, exit=_exit to ALT_LDFLAGS in public.mk. - none - false - none - - - hal.enable_runtime_stack_checking - ALT_STACK_CHECK - Boolean - 0 - 0 - public_mk_define - Turns on HAL runtime stack checking feature. Enabling this setting causes additional code to be placed into each subroutine call to generate an exception if a stack collision occurs with the heap or statically allocated data. If true, adds -DALT_STACK_CHECK and -mstack-check to ALT_CPPFLAGS in public.mk. - none - false - none - - - hal.enable_gprof - ALT_PROVIDE_GMON - Boolean - 0 - 0 - public_mk_define - Causes code to be compiled with gprof profiling enabled and the application ELF to be linked with the GPROF library. If true, adds -DALT_PROVIDE_GMON to ALT_CPPFLAGS and -pg to ALT_CFLAGS in public.mk. - none - false - common - - - hal.enable_c_plus_plus - ALT_NO_C_PLUS_PLUS - Boolean - 0 - 1 - public_mk_define - Enable support for a subset of the C++ language. This option increases code footprint by adding support for C++ constructors. Certain features, such as multiple inheritance and exceptions are not supported. If false, adds -DALT_NO_C_PLUS_PLUS to ALT_CPPFLAGS in public.mk, and reduces code footprint. - none - false - none - - - hal.enable_reduced_device_drivers - ALT_USE_SMALL_DRIVERS - Boolean - 1 - 0 - public_mk_define - Certain drivers are compiled with reduced functionality to reduce code footprint. Not all drivers observe this setting. The altera_avalon_uart and altera_avalon_jtag_uart drivers switch from interrupt-driven to polled operation. CAUTION: Several device drivers are disabled entirely. These include the altera_avalon_cfi_flash, altera_avalon_epcs_flash_controller, and altera_avalon_lcd_16207 drivers. This can result in certain API (HAL flash access routines) to fail. You can define a symbol provided by each driver to prevent it from being removed. If true, adds -DALT_USE_SMALL_DRIVERS to ALT_CPPFLAGS in public.mk. - none - false - common - - - hal.enable_lightweight_device_driver_api - ALT_USE_DIRECT_DRIVERS - Boolean - 1 - 0 - public_mk_define - Enables lightweight device driver API. This reduces code and data footprint by removing the HAL layer that maps device names (e.g. /dev/uart0) to file descriptors. Instead, driver routines are called directly. The open(), close(), and lseek() routines will always fail if called. The read(), write(), fstat(), ioctl(), and isatty() routines only work for the stdio devices. If true, adds -DALT_USE_DIRECT_DRIVERS to ALT_CPPFLAGS in public.mk. - The Altera Host and read-only ZIP file systems can't be used if hal.enable_lightweight_device_driver_api is true. - false - none - - - hal.enable_mul_div_emulation - ALT_NO_INSTRUCTION_EMULATION - Boolean - 0 - 0 - public_mk_define - Adds code to emulate multiply and divide instructions in case they are executed but aren't present in the CPU. Normally this isn't required because the compiler won't use multiply and divide instructions that aren't present in the CPU. If false, adds -DALT_NO_INSTRUCTION_EMULATION to ALT_CPPFLAGS in public.mk. - none - false - none - - - hal.enable_sim_optimize - ALT_SIM_OPTIMIZE - Boolean - 0 - 0 - public_mk_define - The BSP is compiled with optimizations to speedup HDL simulation such as initializing the cache, clearing the .bss section, and skipping long delay loops. If true, adds -DALT_SIM_OPTIMIZE to ALT_CPPFLAGS in public.mk. - When this setting is true, the BSP shouldn't be used to build applications that are expected to run real hardware. - false - common - - - hal.enable_sopc_sysid_check - NONE - Boolean - 1 - 1 - public_mk_define - Enable SOPC Builder System ID. If a System ID SOPC Builder component is connected to the CPU associated with this BSP, it will be enabled in the creation of command-line arguments to download an ELF to the target. Otherwise, system ID and timestamp values are left out of public.mk for application Makefile "download-elf" target definition. With the system ID check disabled, the Nios II EDS tools will not automatically ensure that the application .elf file (and BSP it is linked against) corresponds to the hardware design on the target. If false, adds --accept-bad-sysid to SOPC_SYSID_FLAG in public.mk. - none - false - none - - - hal.custom_newlib_flags - CUSTOM_NEWLIB_FLAGS - UnquotedString - none - none - public_mk_define - Build a custom version of newlib with the specified space-separated compiler flags. - The custom newlib build will be placed in the &lt;bsp root>/newlib directory, and will be used only for applications that utilize this BSP. - false - none - - - hal.log_flags - ALT_LOG_FLAGS - DecimalNumber - 0 - 0 - public_mk_define - The value is assigned to ALT_LOG_FLAGS in the generated public.mk. See hal.log_port setting description. Values can be -1 through 3. - hal.log_port must be set for this to be used. - false - none - - - altera_avalon_jtag_uart_driver.enable_small_driver - ALTERA_AVALON_JTAG_UART_SMALL - BooleanDefineOnly - false - false - public_mk_define - Small-footprint (polled mode) driver - none - false - - - - altera_avalon_jtag_uart_driver.enable_jtag_uart_ignore_fifo_full_error - ALTERA_AVALON_JTAG_UART_IGNORE_FIFO_FULL_ERROR - BooleanDefineOnly - false - false - public_mk_define - Enable JTAG UART driver to recover when host is inactive causing buffer to full without returning error. Printf will not fail with this recovery. - none - false - - - - onchip_memory - 0x00000000 - 0x00003FFF - 16384 - memory - - - lcd_RW - 0x00004000 - 0x0000400F - 16 - - - - lcd_RS - 0x00004010 - 0x0000401F - 16 - - - - lcd_E - 0x00004020 - 0x0000402F - 16 - - - - lcd_data - 0x00004030 - 0x0000403F - 16 - - - - pio_0 - 0x00005000 - 0x0000500F - 16 - - - - hex6 - 0x00005010 - 0x0000501F - 16 - - - - hex5 - 0x00005020 - 0x0000502F - 16 - - - - hex4 - 0x00005030 - 0x0000503F - 16 - - - - hex3 - 0x00005040 - 0x0000504F - 16 - - - - hex2 - 0x00005050 - 0x0000505F - 16 - - - - hex1 - 0x00005060 - 0x0000506F - 16 - - - - hex0 - 0x00005070 - 0x0000507F - 16 - - - - push_switches - 0x00005080 - 0x0000508F - 16 - - - - switches - 0x00005090 - 0x0000509F - 16 - - - - LEDRs - 0x000050A0 - 0x000050AF - 16 - - - - LEDs - 0x000050B0 - 0x000050BF - 16 - - - - jtag_uart - 0x000050C0 - 0x000050C7 - 8 - printable - - - .text - onchip_memory - - - .rodata - onchip_memory - - - .rwdata - onchip_memory - - - .bss - onchip_memory - - - .heap - onchip_memory - - - .stack - onchip_memory - - \ No newline at end of file diff --git a/software/qsys_tutorial_lcd_bsp/summary.html b/software/qsys_tutorial_lcd_bsp/summary.html deleted file mode 100644 index 0fc5f28..0000000 --- a/software/qsys_tutorial_lcd_bsp/summary.html +++ /dev/null @@ -1,2050 +0,0 @@ - -Altera Nios II BSP Summary - -

BSP Description

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
BSP Type:hal
SOPC Design File:C:\Users\takayun\Documents\DE2-115\qsys_tutorial\nios_system.sopcinfo
Quartus JDI File:default
CPU:nios2_processor
BSP Settings File:.\settings.bsp
BSP Version:default
BSP Generated On:2016/12/01 23:23:47
BSP Generated Timestamp:1480602227537
BSP Generated Location:C:\Users\takayun\Documents\DE2-115\qsys_tutorial\software\qsys_tutorial_lcd_bsp
-
-

Nios II Memory Map

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Slave DescriptorAddress RangeSizeAttributes
jtag_uart0x000050C0 - 0x000050C78printable
LEDs0x000050B0 - 0x000050BF16 
LEDRs0x000050A0 - 0x000050AF16 
switches0x00005090 - 0x0000509F16 
push_switches0x00005080 - 0x0000508F16 
hex00x00005070 - 0x0000507F16 
hex10x00005060 - 0x0000506F16 
hex20x00005050 - 0x0000505F16 
hex30x00005040 - 0x0000504F16 
hex40x00005030 - 0x0000503F16 
hex50x00005020 - 0x0000502F16 
hex60x00005010 - 0x0000501F16 
pio_00x00005000 - 0x0000500F16 
lcd_data0x00004030 - 0x0000403F16 
lcd_E0x00004020 - 0x0000402F16 
lcd_RS0x00004010 - 0x0000401F16 
lcd_RW0x00004000 - 0x0000400F16 
onchip_memory0x00000000 - 0x00003FFF16384memory
-
-
-

Linker Regions

- - - - -
RegionAddress RangeSizeMemoryOffset
-
-
-

Linker Section Mappings

- - - - - - - - - - - - - - - - - - - - - - -
SectionRegion
.textonchip_memory
.rodataonchip_memory
.rwdataonchip_memory
.bssonchip_memory
.heaponchip_memory
.stackonchip_memory
-

Settings

- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:altera_avalon_jtag_uart_driver.enable_jtag_uart_ignore_fifo_full_error
Identifier:ALTERA_AVALON_JTAG_UART_IGNORE_FIFO_FULL_ERROR
Default Value:false
Value:false
Type:BooleanDefineOnly
Destination:public_mk_define
Description:Enable JTAG UART driver to recover when host is inactive causing buffer to full without returning error. Printf will not fail with this recovery.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:altera_avalon_jtag_uart_driver.enable_small_driver
Identifier:ALTERA_AVALON_JTAG_UART_SMALL
Default Value:false
Value:false
Type:BooleanDefineOnly
Destination:public_mk_define
Description:Small-footprint (polled mode) driver
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.custom_newlib_flags
Identifier:CUSTOM_NEWLIB_FLAGS
Default Value:none
Value:none
Type:UnquotedString
Destination:public_mk_define
Description:Build a custom version of newlib with the specified space-separated compiler flags.
Restrictions:The custom newlib build will be placed in the &lt;bsp root>/newlib directory, and will be used only for applications that utilize this BSP.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_c_plus_plus
Identifier:ALT_NO_C_PLUS_PLUS
Default Value:1
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable support for a subset of the C++ language. This option increases code footprint by adding support for C++ constructors. Certain features, such as multiple inheritance and exceptions are not supported. If false, adds -DALT_NO_C_PLUS_PLUS to ALT_CPPFLAGS in public.mk, and reduces code footprint.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_clean_exit
Identifier:ALT_NO_CLEAN_EXIT
Default Value:1
Value:0
Type:Boolean
Destination:public_mk_define
Description:When your application exits, close file descriptors, call C++ destructors, etc. Code footprint can be reduced by disabling clean exit. If disabled, adds -DALT_NO_CLEAN_EXIT to ALT_CPPFLAGS and -Wl,--defsym, exit=_exit to ALT_LDFLAGS in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_exit
Identifier:ALT_NO_EXIT
Default Value:1
Value:0
Type:Boolean
Destination:public_mk_define
Description:Add exit() support. This option increases code footprint if your "main()" routine does "return" or call "exit()". If false, adds -DALT_NO_EXIT to ALT_CPPFLAGS in public.mk, and reduces footprint
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_gprof
Identifier:ALT_PROVIDE_GMON
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Causes code to be compiled with gprof profiling enabled and the application ELF to be linked with the GPROF library. If true, adds -DALT_PROVIDE_GMON to ALT_CPPFLAGS and -pg to ALT_CFLAGS in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_instruction_related_exceptions_api
Identifier:ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API
Default Value:false
Value:false
Type:BooleanDefineOnly
Destination:system_h_define
Description:Enables API for registering handlers to service instruction-related exceptions. Enabling this setting increases the size of the exception entry code.
Restrictions:These exception types can be generated if various processor options are enabled, such as the MMU, MPU, or other advanced exception types.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_lightweight_device_driver_api
Identifier:ALT_USE_DIRECT_DRIVERS
Default Value:0
Value:1
Type:Boolean
Destination:public_mk_define
Description:Enables lightweight device driver API. This reduces code and data footprint by removing the HAL layer that maps device names (e.g. /dev/uart0) to file descriptors. Instead, driver routines are called directly. The open(), close(), and lseek() routines will always fail if called. The read(), write(), fstat(), ioctl(), and isatty() routines only work for the stdio devices. If true, adds -DALT_USE_DIRECT_DRIVERS to ALT_CPPFLAGS in public.mk.
Restrictions:The Altera Host and read-only ZIP file systems can't be used if hal.enable_lightweight_device_driver_api is true.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_mul_div_emulation
Identifier:ALT_NO_INSTRUCTION_EMULATION
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Adds code to emulate multiply and divide instructions in case they are executed but aren't present in the CPU. Normally this isn't required because the compiler won't use multiply and divide instructions that aren't present in the CPU. If false, adds -DALT_NO_INSTRUCTION_EMULATION to ALT_CPPFLAGS in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_reduced_device_drivers
Identifier:ALT_USE_SMALL_DRIVERS
Default Value:0
Value:1
Type:Boolean
Destination:public_mk_define
Description:Certain drivers are compiled with reduced functionality to reduce code footprint. Not all drivers observe this setting. The altera_avalon_uart and altera_avalon_jtag_uart drivers switch from interrupt-driven to polled operation. CAUTION: Several device drivers are disabled entirely. These include the altera_avalon_cfi_flash, altera_avalon_epcs_flash_controller, and altera_avalon_lcd_16207 drivers. This can result in certain API (HAL flash access routines) to fail. You can define a symbol provided by each driver to prevent it from being removed. If true, adds -DALT_USE_SMALL_DRIVERS to ALT_CPPFLAGS in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_runtime_stack_checking
Identifier:ALT_STACK_CHECK
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Turns on HAL runtime stack checking feature. Enabling this setting causes additional code to be placed into each subroutine call to generate an exception if a stack collision occurs with the heap or statically allocated data. If true, adds -DALT_STACK_CHECK and -mstack-check to ALT_CPPFLAGS in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_sim_optimize
Identifier:ALT_SIM_OPTIMIZE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:The BSP is compiled with optimizations to speedup HDL simulation such as initializing the cache, clearing the .bss section, and skipping long delay loops. If true, adds -DALT_SIM_OPTIMIZE to ALT_CPPFLAGS in public.mk.
Restrictions:When this setting is true, the BSP shouldn't be used to build applications that are expected to run real hardware.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_small_c_library
Identifier:NONE
Default Value:0
Value:1
Type:Boolean
Destination:public_mk_define
Description:Causes the small newlib (C library) to be used. This reduces code and data footprint at the expense of reduced functionality. Several newlib features are removed such as floating-point support in printf(), stdin input routines, and buffered I/O. The small C library is not compatible with Micrium MicroC/OS-II. If true, adds -msmallc to ALT_LDFLAGS in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_sopc_sysid_check
Identifier:NONE
Default Value:1
Value:1
Type:Boolean
Destination:public_mk_define
Description:Enable SOPC Builder System ID. If a System ID SOPC Builder component is connected to the CPU associated with this BSP, it will be enabled in the creation of command-line arguments to download an ELF to the target. Otherwise, system ID and timestamp values are left out of public.mk for application Makefile "download-elf" target definition. With the system ID check disabled, the Nios II EDS tools will not automatically ensure that the application .elf file (and BSP it is linked against) corresponds to the hardware design on the target. If false, adds --accept-bad-sysid to SOPC_SYSID_FLAG in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.allow_code_at_reset
Identifier:ALT_ALLOW_CODE_AT_RESET
Default Value:0
Value:1
Type:Boolean
Destination:none
Description:Indicates if initialization code is allowed at the reset address. If true, defines the macro ALT_ALLOW_CODE_AT_RESET in linker.h.
Restrictions:If true, defines the macro ALT_ALLOW_CODE_AT_RESET in linker.h. This setting is typically false if an external bootloader (e.g. flash bootloader) is present.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.enable_alt_load
Identifier:NONE
Default Value:0
Value:1
Type:Boolean
Destination:none
Description:Enables the alt_load() facility. The alt_load() facility copies sections from the .text memory into RAM. If true, this setting sets up the VMA/LMA of sections in linker.x to allow them to be loaded into the .text memory.
Restrictions:This setting is typically false if an external bootloader (e.g. flash bootloader) is present.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.enable_alt_load_copy_exceptions
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:none
Description:Causes the alt_load() facility to copy the .exceptions section. If true, this setting defines the macro ALT_LOAD_COPY_EXCEPTIONS in linker.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.enable_alt_load_copy_rodata
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:none
Description:Causes the alt_load() facility to copy the .rodata section. If true, this setting defines the macro ALT_LOAD_COPY_RODATA in linker.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.enable_alt_load_copy_rwdata
Identifier:NONE
Default Value:0
Value:1
Type:Boolean
Destination:none
Description:Causes the alt_load() facility to copy the .rwdata section. If true, this setting defines the macro ALT_LOAD_COPY_RWDATA in linker.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.enable_exception_stack
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:none
Description:Enables use of a separate exception stack. If true, defines the macro ALT_EXCEPTION_STACK in linker.h, adds a memory region called exception_stack to linker.x, and provides the symbols __alt_exception_stack_pointer and __alt_exception_stack_limit in linker.x.
Restrictions:The hal.linker.exception_stack_size and hal.linker.exception_stack_memory_region_name settings must also be valid. This setting must be false for MicroC/OS-II BSPs. The exception stack can be used to improve interrupt and other exception performance if the EIC is *not* used.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.enable_interrupt_stack
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:none
Description:Enables use of a separate interrupt stack. If true, defines the macro ALT_INTERRUPT_STACK in linker.h, adds a memory region called interrupt_stack to linker.x, and provides the symbols __alt_interrupt_stack_pointer and __alt_interrupt_stack_limit in linker.x.
Restrictions:The hal.linker.interrupt_stack_size and hal.linker.interrupt_stack_memory_region_name settings must also be valid. This setting must be false for MicroC/OS-II BSPs. Only enable if the EIC is used exclusively. The exception stack can be used to improve interrupt and other exception performance if the EIC is *not* used.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.exception_stack_memory_region_name
Identifier:NONE
Default Value:none
Value:onchip_memory
Type:UnquotedString
Destination:none
Description:Name of the existing memory region that will be divided up to create the 'exception_stack' memory region. The selected region name will be adjusted automatically when the BSP is generated to create the 'exception_stack' memory region.
Restrictions:Only used if hal.linker.enable_exception_stack is true.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.exception_stack_size
Identifier:NONE
Default Value:1024
Value:1024
Type:DecimalNumber
Destination:none
Description:Size of the exception stack in bytes.
Restrictions:Only used if hal.linker.enable_exception_stack is true.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.interrupt_stack_memory_region_name
Identifier:NONE
Default Value:none
Value:onchip_memory
Type:UnquotedString
Destination:none
Description:Name of the existing memory region that will be divided up to create the 'interrupt_stack' memory region. The selected region name will be adjusted automatically when the BSP is generated to create the 'interrupt_stack' memory region.
Restrictions:Only used if hal.linker.enable_interrupt_stack is true.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.interrupt_stack_size
Identifier:NONE
Default Value:1024
Value:1024
Type:DecimalNumber
Destination:none
Description:Size of the interrupt stack in bytes.
Restrictions:Only used if hal.linker.enable_interrupt_stack is true.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.log_flags
Identifier:ALT_LOG_FLAGS
Default Value:0
Value:0
Type:DecimalNumber
Destination:public_mk_define
Description:The value is assigned to ALT_LOG_FLAGS in the generated public.mk. See hal.log_port setting description. Values can be -1 through 3.
Restrictions:hal.log_port must be set for this to be used.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.log_port
Identifier:NONE
Default Value:none
Value:none
Type:UnquotedString
Destination:public_mk_define
Description:Slave descriptor of debug logging character-mode device. If defined, it enables extra debug messages in the HAL source. This setting is used by the ALT_LOG_PORT family of defines in system.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ar
Identifier:AR
Default Value:nios2-elf-ar
Value:nios2-elf-ar
Type:UnquotedString
Destination:makefile_variable
Description:Archiver command. Creates library files.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ar_post_process
Identifier:AR_POST_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed after archiver execution.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ar_pre_process
Identifier:AR_PRE_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed before archiver execution.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.as
Identifier:AS
Default Value:nios2-elf-gcc
Value:nios2-elf-gcc
Type:UnquotedString
Destination:makefile_variable
Description:Assembler command. Note that CC is used for .S files.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.as_post_process
Identifier:AS_POST_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed after each assembly file is compiled.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.as_pre_process
Identifier:AS_PRE_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed before each assembly file is compiled.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_arflags
Identifier:BSP_ARFLAGS
Default Value:-src
Value:-src
Type:UnquotedString
Destination:makefile_variable
Description:Custom flags only passed to the archiver. This content of this variable is directly passed to the archiver rather than the more standard "ARFLAGS". The reason for this is that GNU Make assumes some default content in ARFLAGS. This setting defines the value of BSP_ARFLAGS in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_asflags
Identifier:BSP_ASFLAGS
Default Value:-Wa,-gdwarf2
Value:-Wa,-gdwarf2
Type:UnquotedString
Destination:makefile_variable
Description:Custom flags only passed to the assembler. This setting defines the value of BSP_ASFLAGS in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cflags_debug
Identifier:BSP_CFLAGS_DEBUG
Default Value:-g
Value:-g
Type:UnquotedString
Destination:makefile_variable
Description:C/C++ compiler debug level. '-g' provides the default set of debug symbols typically required to debug a typical application. Omitting '-g' removes debug symbols from the ELF. This setting defines the value of BSP_CFLAGS_DEBUG in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cflags_defined_symbols
Identifier:BSP_CFLAGS_DEFINED_SYMBOLS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Preprocessor macros to define. A macro definition in this setting has the same effect as a "#define" in source code. Adding "-DALT_DEBUG" to this setting has the same effect as "#define ALT_DEBUG" in a souce file. Adding "-DFOO=1" to this setting is equivalent to the macro "#define FOO 1" in a source file. Macros defined with this setting are applied to all .S, .c, and C++ files in the BSP. This setting defines the value of BSP_CFLAGS_DEFINED_SYMBOLS in the BSP Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cflags_optimization
Identifier:BSP_CFLAGS_OPTIMIZATION
Default Value:-O0
Value:'-Os'
Type:UnquotedString
Destination:makefile_variable
Description:C/C++ compiler optimization level. "-O0" = no optimization,"-O2" = "normal" optimization, etc. "-O0" is recommended for code that you want to debug since compiler optimization can remove variables and produce non-sequential execution of code while debugging. This setting defines the value of BSP_CFLAGS_OPTIMIZATION in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cflags_undefined_symbols
Identifier:BSP_CFLAGS_UNDEFINED_SYMBOLS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Preprocessor macros to undefine. Undefined macros are similar to defined macros, but replicate the "#undef" directive in source code. To undefine the macro FOO use the syntax "-u FOO" in this setting. This is equivalent to "#undef FOO" in a source file. Note: the syntax differs from macro definition (there is a space, i.e. "-u FOO" versus "-DFOO"). Macros defined with this setting are applied to all .S, .c, and C++ files in the BSP. This setting defines the value of BSP_CFLAGS_UNDEFINED_SYMBOLS in the BSP Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cflags_user_flags
Identifier:BSP_CFLAGS_USER_FLAGS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Custom flags passed to the compiler when compiling C, C++, and .S files. This setting defines the value of BSP_CFLAGS_USER_FLAGS in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cflags_warnings
Identifier:BSP_CFLAGS_WARNINGS
Default Value:-Wall
Value:-Wall
Type:UnquotedString
Destination:makefile_variable
Description:C/C++ compiler warning level. "-Wall" is commonly used.This setting defines the value of BSP_CFLAGS_WARNINGS in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cxx_flags
Identifier:BSP_CXXFLAGS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Custom flags only passed to the C++ compiler. This setting defines the value of BSP_CXXFLAGS in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_inc_dirs
Identifier:BSP_INC_DIRS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Space separated list of extra include directories to scan for header files. Directories are relative to the top-level BSP directory. The -I prefix's added by the makefile so don't add it here. This setting defines the value of BSP_INC_DIRS in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.build_post_process
Identifier:BUILD_POST_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed after BSP built.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.build_pre_process
Identifier:BUILD_PRE_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed before BSP built.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.cc
Identifier:CC
Default Value:nios2-elf-gcc -xc
Value:nios2-elf-gcc -xc
Type:UnquotedString
Destination:makefile_variable
Description:C compiler command.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.cc_post_process
Identifier:CC_POST_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed after each .c/.S file is compiled.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.cc_pre_process
Identifier:CC_PRE_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed before each .c/.S file is compiled.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.cxx
Identifier:CXX
Default Value:nios2-elf-gcc -xc++
Value:nios2-elf-gcc -xc++
Type:UnquotedString
Destination:makefile_variable
Description:C++ compiler command.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.cxx_post_process
Identifier:CXX_POST_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed before each C++ file is compiled.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.cxx_pre_process
Identifier:CXX_PRE_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed before each C++ file is compiled.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.big_endian
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system is big endian. If true ignores export of 'ALT_CFLAGS += -EB' to public.mk if big endian system. If true ignores export of 'ALT_CFLAGS += -EL' if little endian system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.debug_core_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system has a debug core present. If true ignores export of 'CPU_HAS_DEBUG_CORE = 1' to public.mk if a debug core is found in the system. If true ignores export of 'CPU_HAS_DEBUG_CORE = 0' if no debug core is found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.fpu_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system has FPU present. If true ignores export of 'ALT_CFLAGS += -mhard-float' to public.mk if FPU is found in the system. If true ignores export of 'ALT_CFLAGS += -mhard-soft' if FPU is not found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.hardware_divide_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system has hardware divide present. If true ignores export of 'ALT_CFLAGS += -mno-hw-div' to public.mk if no division is found in system. If true ignores export of 'ALT_CFLAGS += -mhw-div' if division is found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.hardware_fp_cust_inst_divider_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system floating point custom instruction with a divider is present. If true ignores export of 'ALT_CFLAGS += -mcustom-fpu-cfg=60-2' and 'ALT_LDFLAGS += -mcustom-fpu-cfg=60-2' to public.mk if the custom instruction is found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.hardware_fp_cust_inst_no_divider_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system floating point custom instruction without a divider is present. If true ignores export of 'ALT_CFLAGS += -mcustom-fpu-cfg=60-1' and 'ALT_LDFLAGS += -mcustom-fpu-cfg=60-1' to public.mk if the custom instruction is found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.hardware_multiplier_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system has multiplier present. If true ignores export of 'ALT_CFLAGS += -mno-hw-mul' to public.mk if no multiplier is found in the system. If true ignores export of 'ALT_CFLAGS += -mhw-mul' if multiplier is found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.hardware_mulx_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system has hardware mulx present. If true ignores export of 'ALT_CFLAGS += -mno-hw-mulx' to public.mk if no mulx is found in the system. If true ignores export of 'ALT_CFLAGS += -mhw-mulx' if mulx is found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.sopc_simulation_enabled
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system has simulation enabled. If true ignores export of 'ELF_PATCH_FLAG += --simulation_enabled' to public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.sopc_system_base_address
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query SOPC system for system ID base address. If true ignores export of 'SOPC_SYSID_FLAG += --sidp=<address>' and 'ELF_PATCH_FLAG += --sidp=<address>' to public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.sopc_system_id
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query SOPC system for system ID. If true ignores export of 'SOPC_SYSID_FLAG += --id=<sysid>' and 'ELF_PATCH_FLAG += --id=<sysid>' to public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.sopc_system_timestamp
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query SOPC system for system timestamp. If true ignores export of 'SOPC_SYSID_FLAG += --timestamp=<timestamp>' and 'ELF_PATCH_FLAG += --timestamp=<timestamp>' to public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.rm
Identifier:RM
Default Value:rm -f
Value:rm -f
Type:UnquotedString
Destination:makefile_variable
Description:Command used to remove files during 'clean' target.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.max_file_descriptors
Identifier:ALT_MAX_FD
Default Value:32
Value:4
Type:DecimalNumber
Destination:system_h_define
Description:Determines the number of file descriptors statically allocated. This setting defines the value of ALT_MAX_FD in system.h.
Restrictions:If hal.enable_lightweight_device_driver_api is true, there are no file descriptors so this setting is ignored. If hal.enable_lightweight_device_driver_api is false, this setting must be at least 4 because HAL needs a file descriptor for /dev/null, /dev/stdin, /dev/stdout, and /dev/stderr.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.stderr
Identifier:NONE
Default Value:none
Value:jtag_uart
Type:UnquotedString
Destination:system_h_define
Description:Slave descriptor of STDERR character-mode device. This setting is used by the ALT_STDERR family of defines in system.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.stdin
Identifier:NONE
Default Value:none
Value:jtag_uart
Type:UnquotedString
Destination:system_h_define
Description:Slave descriptor of STDIN character-mode device. This setting is used by the ALT_STDIN family of defines in system.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.stdout
Identifier:NONE
Default Value:none
Value:jtag_uart
Type:UnquotedString
Destination:system_h_define
Description:Slave descriptor of STDOUT character-mode device. This setting is used by the ALT_STDOUT family of defines in system.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.sys_clk_timer
Identifier:ALT_SYS_CLK
Default Value:none
Value:none
Type:UnquotedString
Destination:system_h_define
Description:Slave descriptor of the system clock timer device. This device provides a periodic interrupt ("tick") and is typically required for RTOS use. This setting defines the value of ALT_SYS_CLK in system.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.timestamp_timer
Identifier:ALT_TIMESTAMP_CLK
Default Value:none
Value:none
Type:UnquotedString
Destination:system_h_define
Description:Slave descriptor of timestamp timer device. This device is used by Altera HAL timestamp drivers for high-resolution time measurement. This setting defines the value of ALT_TIMESTAMP_CLK in system.h.
Restrictions:none
-
-
-
- - diff --git a/software/qsys_tutorial_lcd_bsp/system.h b/software/qsys_tutorial_lcd_bsp/system.h deleted file mode 100644 index 1385cd2..0000000 --- a/software/qsys_tutorial_lcd_bsp/system.h +++ /dev/null @@ -1,656 +0,0 @@ -/* - * system.h - SOPC Builder system and BSP software package information - * - * Machine generated for CPU 'nios2_processor' in SOPC Builder design 'nios_system' - * SOPC Builder design path: C:/Users/takayun/Documents/DE2-115/qsys_tutorial/nios_system.sopcinfo - * - * Generated: Thu Dec 01 23:23:48 JST 2016 - */ - -/* - * DO NOT MODIFY THIS FILE - * - * Changing this file will have subtle consequences - * which will almost certainly lead to a nonfunctioning - * system. If you do modify this file, be aware that your - * changes will be overwritten and lost when this file - * is generated again. - * - * DO NOT MODIFY THIS FILE - */ - -/* - * License Agreement - * - * Copyright (c) 2008 - * Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - * - * This agreement shall be governed in all respects by the laws of the State - * of California and by the laws of the United States of America. - */ - -#ifndef __SYSTEM_H_ -#define __SYSTEM_H_ - -/* Include definitions from linker script generator */ -#include "linker.h" - - -/* - * CPU configuration - * - */ - -#define ALT_CPU_ARCHITECTURE "altera_nios2_qsys" -#define ALT_CPU_BIG_ENDIAN 0 -#define ALT_CPU_BREAK_ADDR 0x4820 -#define ALT_CPU_CPU_FREQ 50000000u -#define ALT_CPU_CPU_ID_SIZE 1 -#define ALT_CPU_CPU_ID_VALUE 0x00000000 -#define ALT_CPU_CPU_IMPLEMENTATION "tiny" -#define ALT_CPU_DATA_ADDR_WIDTH 0xf -#define ALT_CPU_DCACHE_LINE_SIZE 0 -#define ALT_CPU_DCACHE_LINE_SIZE_LOG2 0 -#define ALT_CPU_DCACHE_SIZE 0 -#define ALT_CPU_EXCEPTION_ADDR 0x20 -#define ALT_CPU_FLUSHDA_SUPPORTED -#define ALT_CPU_FREQ 50000000 -#define ALT_CPU_HARDWARE_DIVIDE_PRESENT 0 -#define ALT_CPU_HARDWARE_MULTIPLY_PRESENT 0 -#define ALT_CPU_HARDWARE_MULX_PRESENT 0 -#define ALT_CPU_HAS_DEBUG_CORE 1 -#define ALT_CPU_HAS_DEBUG_STUB -#define ALT_CPU_HAS_JMPI_INSTRUCTION -#define ALT_CPU_ICACHE_LINE_SIZE 0 -#define ALT_CPU_ICACHE_LINE_SIZE_LOG2 0 -#define ALT_CPU_ICACHE_SIZE 0 -#define ALT_CPU_INST_ADDR_WIDTH 0xf -#define ALT_CPU_NAME "nios2_processor" -#define ALT_CPU_RESET_ADDR 0x0 - - -/* - * CPU configuration (with legacy prefix - don't use these anymore) - * - */ - -#define NIOS2_BIG_ENDIAN 0 -#define NIOS2_BREAK_ADDR 0x4820 -#define NIOS2_CPU_FREQ 50000000u -#define NIOS2_CPU_ID_SIZE 1 -#define NIOS2_CPU_ID_VALUE 0x00000000 -#define NIOS2_CPU_IMPLEMENTATION "tiny" -#define NIOS2_DATA_ADDR_WIDTH 0xf -#define NIOS2_DCACHE_LINE_SIZE 0 -#define NIOS2_DCACHE_LINE_SIZE_LOG2 0 -#define NIOS2_DCACHE_SIZE 0 -#define NIOS2_EXCEPTION_ADDR 0x20 -#define NIOS2_FLUSHDA_SUPPORTED -#define NIOS2_HARDWARE_DIVIDE_PRESENT 0 -#define NIOS2_HARDWARE_MULTIPLY_PRESENT 0 -#define NIOS2_HARDWARE_MULX_PRESENT 0 -#define NIOS2_HAS_DEBUG_CORE 1 -#define NIOS2_HAS_DEBUG_STUB -#define NIOS2_HAS_JMPI_INSTRUCTION -#define NIOS2_ICACHE_LINE_SIZE 0 -#define NIOS2_ICACHE_LINE_SIZE_LOG2 0 -#define NIOS2_ICACHE_SIZE 0 -#define NIOS2_INST_ADDR_WIDTH 0xf -#define NIOS2_RESET_ADDR 0x0 - - -/* - * Define for each module class mastered by the CPU - * - */ - -#define __ALTERA_AVALON_JTAG_UART -#define __ALTERA_AVALON_ONCHIP_MEMORY2 -#define __ALTERA_AVALON_PIO -#define __ALTERA_NIOS2_QSYS - - -/* - * LEDRs configuration - * - */ - -#define ALT_MODULE_CLASS_LEDRs altera_avalon_pio -#define LEDRS_BASE 0x50a0 -#define LEDRS_BIT_CLEARING_EDGE_REGISTER 0 -#define LEDRS_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define LEDRS_CAPTURE 0 -#define LEDRS_DATA_WIDTH 18 -#define LEDRS_DO_TEST_BENCH_WIRING 0 -#define LEDRS_DRIVEN_SIM_VALUE 0 -#define LEDRS_EDGE_TYPE "NONE" -#define LEDRS_FREQ 50000000 -#define LEDRS_HAS_IN 0 -#define LEDRS_HAS_OUT 1 -#define LEDRS_HAS_TRI 0 -#define LEDRS_IRQ -1 -#define LEDRS_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define LEDRS_IRQ_TYPE "NONE" -#define LEDRS_NAME "/dev/LEDRs" -#define LEDRS_RESET_VALUE 0 -#define LEDRS_SPAN 16 -#define LEDRS_TYPE "altera_avalon_pio" - - -/* - * LEDs configuration - * - */ - -#define ALT_MODULE_CLASS_LEDs altera_avalon_pio -#define LEDS_BASE 0x50b0 -#define LEDS_BIT_CLEARING_EDGE_REGISTER 0 -#define LEDS_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define LEDS_CAPTURE 0 -#define LEDS_DATA_WIDTH 8 -#define LEDS_DO_TEST_BENCH_WIRING 0 -#define LEDS_DRIVEN_SIM_VALUE 0 -#define LEDS_EDGE_TYPE "NONE" -#define LEDS_FREQ 50000000 -#define LEDS_HAS_IN 0 -#define LEDS_HAS_OUT 1 -#define LEDS_HAS_TRI 0 -#define LEDS_IRQ -1 -#define LEDS_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define LEDS_IRQ_TYPE "NONE" -#define LEDS_NAME "/dev/LEDs" -#define LEDS_RESET_VALUE 0 -#define LEDS_SPAN 16 -#define LEDS_TYPE "altera_avalon_pio" - - -/* - * System configuration - * - */ - -#define ALT_DEVICE_FAMILY "Cyclone IV E" -#define ALT_ENHANCED_INTERRUPT_API_PRESENT -#define ALT_IRQ_BASE NULL -#define ALT_LOG_PORT "/dev/null" -#define ALT_LOG_PORT_BASE 0x0 -#define ALT_LOG_PORT_DEV null -#define ALT_LOG_PORT_TYPE "" -#define ALT_NUM_EXTERNAL_INTERRUPT_CONTROLLERS 0 -#define ALT_NUM_INTERNAL_INTERRUPT_CONTROLLERS 1 -#define ALT_NUM_INTERRUPT_CONTROLLERS 1 -#define ALT_STDERR "/dev/jtag_uart" -#define ALT_STDERR_BASE 0x50c0 -#define ALT_STDERR_DEV jtag_uart -#define ALT_STDERR_IS_JTAG_UART -#define ALT_STDERR_PRESENT -#define ALT_STDERR_TYPE "altera_avalon_jtag_uart" -#define ALT_STDIN "/dev/jtag_uart" -#define ALT_STDIN_BASE 0x50c0 -#define ALT_STDIN_DEV jtag_uart -#define ALT_STDIN_IS_JTAG_UART -#define ALT_STDIN_PRESENT -#define ALT_STDIN_TYPE "altera_avalon_jtag_uart" -#define ALT_STDOUT "/dev/jtag_uart" -#define ALT_STDOUT_BASE 0x50c0 -#define ALT_STDOUT_DEV jtag_uart -#define ALT_STDOUT_IS_JTAG_UART -#define ALT_STDOUT_PRESENT -#define ALT_STDOUT_TYPE "altera_avalon_jtag_uart" -#define ALT_SYSTEM_NAME "nios_system" - - -/* - * hal configuration - * - */ - -#define ALT_MAX_FD 4 -#define ALT_SYS_CLK none -#define ALT_TIMESTAMP_CLK none - - -/* - * hex0 configuration - * - */ - -#define ALT_MODULE_CLASS_hex0 altera_avalon_pio -#define HEX0_BASE 0x5070 -#define HEX0_BIT_CLEARING_EDGE_REGISTER 0 -#define HEX0_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define HEX0_CAPTURE 0 -#define HEX0_DATA_WIDTH 7 -#define HEX0_DO_TEST_BENCH_WIRING 0 -#define HEX0_DRIVEN_SIM_VALUE 0 -#define HEX0_EDGE_TYPE "NONE" -#define HEX0_FREQ 50000000 -#define HEX0_HAS_IN 0 -#define HEX0_HAS_OUT 1 -#define HEX0_HAS_TRI 0 -#define HEX0_IRQ -1 -#define HEX0_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define HEX0_IRQ_TYPE "NONE" -#define HEX0_NAME "/dev/hex0" -#define HEX0_RESET_VALUE 0 -#define HEX0_SPAN 16 -#define HEX0_TYPE "altera_avalon_pio" - - -/* - * hex1 configuration - * - */ - -#define ALT_MODULE_CLASS_hex1 altera_avalon_pio -#define HEX1_BASE 0x5060 -#define HEX1_BIT_CLEARING_EDGE_REGISTER 0 -#define HEX1_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define HEX1_CAPTURE 0 -#define HEX1_DATA_WIDTH 7 -#define HEX1_DO_TEST_BENCH_WIRING 0 -#define HEX1_DRIVEN_SIM_VALUE 0 -#define HEX1_EDGE_TYPE "NONE" -#define HEX1_FREQ 50000000 -#define HEX1_HAS_IN 0 -#define HEX1_HAS_OUT 1 -#define HEX1_HAS_TRI 0 -#define HEX1_IRQ -1 -#define HEX1_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define HEX1_IRQ_TYPE "NONE" -#define HEX1_NAME "/dev/hex1" -#define HEX1_RESET_VALUE 0 -#define HEX1_SPAN 16 -#define HEX1_TYPE "altera_avalon_pio" - - -/* - * hex2 configuration - * - */ - -#define ALT_MODULE_CLASS_hex2 altera_avalon_pio -#define HEX2_BASE 0x5050 -#define HEX2_BIT_CLEARING_EDGE_REGISTER 0 -#define HEX2_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define HEX2_CAPTURE 0 -#define HEX2_DATA_WIDTH 7 -#define HEX2_DO_TEST_BENCH_WIRING 0 -#define HEX2_DRIVEN_SIM_VALUE 0 -#define HEX2_EDGE_TYPE "NONE" -#define HEX2_FREQ 50000000 -#define HEX2_HAS_IN 0 -#define HEX2_HAS_OUT 1 -#define HEX2_HAS_TRI 0 -#define HEX2_IRQ -1 -#define HEX2_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define HEX2_IRQ_TYPE "NONE" -#define HEX2_NAME "/dev/hex2" -#define HEX2_RESET_VALUE 0 -#define HEX2_SPAN 16 -#define HEX2_TYPE "altera_avalon_pio" - - -/* - * hex3 configuration - * - */ - -#define ALT_MODULE_CLASS_hex3 altera_avalon_pio -#define HEX3_BASE 0x5040 -#define HEX3_BIT_CLEARING_EDGE_REGISTER 0 -#define HEX3_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define HEX3_CAPTURE 0 -#define HEX3_DATA_WIDTH 7 -#define HEX3_DO_TEST_BENCH_WIRING 0 -#define HEX3_DRIVEN_SIM_VALUE 0 -#define HEX3_EDGE_TYPE "NONE" -#define HEX3_FREQ 50000000 -#define HEX3_HAS_IN 0 -#define HEX3_HAS_OUT 1 -#define HEX3_HAS_TRI 0 -#define HEX3_IRQ -1 -#define HEX3_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define HEX3_IRQ_TYPE "NONE" -#define HEX3_NAME "/dev/hex3" -#define HEX3_RESET_VALUE 0 -#define HEX3_SPAN 16 -#define HEX3_TYPE "altera_avalon_pio" - - -/* - * hex4 configuration - * - */ - -#define ALT_MODULE_CLASS_hex4 altera_avalon_pio -#define HEX4_BASE 0x5030 -#define HEX4_BIT_CLEARING_EDGE_REGISTER 0 -#define HEX4_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define HEX4_CAPTURE 0 -#define HEX4_DATA_WIDTH 7 -#define HEX4_DO_TEST_BENCH_WIRING 0 -#define HEX4_DRIVEN_SIM_VALUE 0 -#define HEX4_EDGE_TYPE "NONE" -#define HEX4_FREQ 50000000 -#define HEX4_HAS_IN 0 -#define HEX4_HAS_OUT 1 -#define HEX4_HAS_TRI 0 -#define HEX4_IRQ -1 -#define HEX4_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define HEX4_IRQ_TYPE "NONE" -#define HEX4_NAME "/dev/hex4" -#define HEX4_RESET_VALUE 0 -#define HEX4_SPAN 16 -#define HEX4_TYPE "altera_avalon_pio" - - -/* - * hex5 configuration - * - */ - -#define ALT_MODULE_CLASS_hex5 altera_avalon_pio -#define HEX5_BASE 0x5020 -#define HEX5_BIT_CLEARING_EDGE_REGISTER 0 -#define HEX5_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define HEX5_CAPTURE 0 -#define HEX5_DATA_WIDTH 7 -#define HEX5_DO_TEST_BENCH_WIRING 0 -#define HEX5_DRIVEN_SIM_VALUE 0 -#define HEX5_EDGE_TYPE "NONE" -#define HEX5_FREQ 50000000 -#define HEX5_HAS_IN 0 -#define HEX5_HAS_OUT 1 -#define HEX5_HAS_TRI 0 -#define HEX5_IRQ -1 -#define HEX5_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define HEX5_IRQ_TYPE "NONE" -#define HEX5_NAME "/dev/hex5" -#define HEX5_RESET_VALUE 0 -#define HEX5_SPAN 16 -#define HEX5_TYPE "altera_avalon_pio" - - -/* - * hex6 configuration - * - */ - -#define ALT_MODULE_CLASS_hex6 altera_avalon_pio -#define HEX6_BASE 0x5010 -#define HEX6_BIT_CLEARING_EDGE_REGISTER 0 -#define HEX6_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define HEX6_CAPTURE 0 -#define HEX6_DATA_WIDTH 7 -#define HEX6_DO_TEST_BENCH_WIRING 0 -#define HEX6_DRIVEN_SIM_VALUE 0 -#define HEX6_EDGE_TYPE "NONE" -#define HEX6_FREQ 50000000 -#define HEX6_HAS_IN 0 -#define HEX6_HAS_OUT 1 -#define HEX6_HAS_TRI 0 -#define HEX6_IRQ -1 -#define HEX6_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define HEX6_IRQ_TYPE "NONE" -#define HEX6_NAME "/dev/hex6" -#define HEX6_RESET_VALUE 0 -#define HEX6_SPAN 16 -#define HEX6_TYPE "altera_avalon_pio" - - -/* - * jtag_uart configuration - * - */ - -#define ALT_MODULE_CLASS_jtag_uart altera_avalon_jtag_uart -#define JTAG_UART_BASE 0x50c0 -#define JTAG_UART_IRQ 5 -#define JTAG_UART_IRQ_INTERRUPT_CONTROLLER_ID 0 -#define JTAG_UART_NAME "/dev/jtag_uart" -#define JTAG_UART_READ_DEPTH 64 -#define JTAG_UART_READ_THRESHOLD 8 -#define JTAG_UART_SPAN 8 -#define JTAG_UART_TYPE "altera_avalon_jtag_uart" -#define JTAG_UART_WRITE_DEPTH 64 -#define JTAG_UART_WRITE_THRESHOLD 8 - - -/* - * lcd_E configuration - * - */ - -#define ALT_MODULE_CLASS_lcd_E altera_avalon_pio -#define LCD_E_BASE 0x4020 -#define LCD_E_BIT_CLEARING_EDGE_REGISTER 0 -#define LCD_E_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define LCD_E_CAPTURE 0 -#define LCD_E_DATA_WIDTH 1 -#define LCD_E_DO_TEST_BENCH_WIRING 0 -#define LCD_E_DRIVEN_SIM_VALUE 0 -#define LCD_E_EDGE_TYPE "NONE" -#define LCD_E_FREQ 50000000 -#define LCD_E_HAS_IN 0 -#define LCD_E_HAS_OUT 1 -#define LCD_E_HAS_TRI 0 -#define LCD_E_IRQ -1 -#define LCD_E_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define LCD_E_IRQ_TYPE "NONE" -#define LCD_E_NAME "/dev/lcd_E" -#define LCD_E_RESET_VALUE 0 -#define LCD_E_SPAN 16 -#define LCD_E_TYPE "altera_avalon_pio" - - -/* - * lcd_RS configuration - * - */ - -#define ALT_MODULE_CLASS_lcd_RS altera_avalon_pio -#define LCD_RS_BASE 0x4010 -#define LCD_RS_BIT_CLEARING_EDGE_REGISTER 0 -#define LCD_RS_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define LCD_RS_CAPTURE 0 -#define LCD_RS_DATA_WIDTH 1 -#define LCD_RS_DO_TEST_BENCH_WIRING 0 -#define LCD_RS_DRIVEN_SIM_VALUE 0 -#define LCD_RS_EDGE_TYPE "NONE" -#define LCD_RS_FREQ 50000000 -#define LCD_RS_HAS_IN 0 -#define LCD_RS_HAS_OUT 1 -#define LCD_RS_HAS_TRI 0 -#define LCD_RS_IRQ -1 -#define LCD_RS_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define LCD_RS_IRQ_TYPE "NONE" -#define LCD_RS_NAME "/dev/lcd_RS" -#define LCD_RS_RESET_VALUE 0 -#define LCD_RS_SPAN 16 -#define LCD_RS_TYPE "altera_avalon_pio" - - -/* - * lcd_RW configuration - * - */ - -#define ALT_MODULE_CLASS_lcd_RW altera_avalon_pio -#define LCD_RW_BASE 0x4000 -#define LCD_RW_BIT_CLEARING_EDGE_REGISTER 0 -#define LCD_RW_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define LCD_RW_CAPTURE 0 -#define LCD_RW_DATA_WIDTH 1 -#define LCD_RW_DO_TEST_BENCH_WIRING 0 -#define LCD_RW_DRIVEN_SIM_VALUE 0 -#define LCD_RW_EDGE_TYPE "NONE" -#define LCD_RW_FREQ 50000000 -#define LCD_RW_HAS_IN 0 -#define LCD_RW_HAS_OUT 1 -#define LCD_RW_HAS_TRI 0 -#define LCD_RW_IRQ -1 -#define LCD_RW_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define LCD_RW_IRQ_TYPE "NONE" -#define LCD_RW_NAME "/dev/lcd_RW" -#define LCD_RW_RESET_VALUE 0 -#define LCD_RW_SPAN 16 -#define LCD_RW_TYPE "altera_avalon_pio" - - -/* - * lcd_data configuration - * - */ - -#define ALT_MODULE_CLASS_lcd_data altera_avalon_pio -#define LCD_DATA_BASE 0x4030 -#define LCD_DATA_BIT_CLEARING_EDGE_REGISTER 0 -#define LCD_DATA_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define LCD_DATA_CAPTURE 0 -#define LCD_DATA_DATA_WIDTH 8 -#define LCD_DATA_DO_TEST_BENCH_WIRING 0 -#define LCD_DATA_DRIVEN_SIM_VALUE 0 -#define LCD_DATA_EDGE_TYPE "NONE" -#define LCD_DATA_FREQ 50000000 -#define LCD_DATA_HAS_IN 0 -#define LCD_DATA_HAS_OUT 1 -#define LCD_DATA_HAS_TRI 0 -#define LCD_DATA_IRQ -1 -#define LCD_DATA_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define LCD_DATA_IRQ_TYPE "NONE" -#define LCD_DATA_NAME "/dev/lcd_data" -#define LCD_DATA_RESET_VALUE 0 -#define LCD_DATA_SPAN 16 -#define LCD_DATA_TYPE "altera_avalon_pio" - - -/* - * onchip_memory configuration - * - */ - -#define ALT_MODULE_CLASS_onchip_memory altera_avalon_onchip_memory2 -#define ONCHIP_MEMORY_ALLOW_IN_SYSTEM_MEMORY_CONTENT_EDITOR 0 -#define ONCHIP_MEMORY_ALLOW_MRAM_SIM_CONTENTS_ONLY_FILE 0 -#define ONCHIP_MEMORY_BASE 0x0 -#define ONCHIP_MEMORY_CONTENTS_INFO "" -#define ONCHIP_MEMORY_DUAL_PORT 0 -#define ONCHIP_MEMORY_GUI_RAM_BLOCK_TYPE "AUTO" -#define ONCHIP_MEMORY_INIT_CONTENTS_FILE "nios_system_onchip_memory" -#define ONCHIP_MEMORY_INIT_MEM_CONTENT 1 -#define ONCHIP_MEMORY_INSTANCE_ID "NONE" -#define ONCHIP_MEMORY_IRQ -1 -#define ONCHIP_MEMORY_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define ONCHIP_MEMORY_NAME "/dev/onchip_memory" -#define ONCHIP_MEMORY_NON_DEFAULT_INIT_FILE_ENABLED 0 -#define ONCHIP_MEMORY_RAM_BLOCK_TYPE "AUTO" -#define ONCHIP_MEMORY_READ_DURING_WRITE_MODE "DONT_CARE" -#define ONCHIP_MEMORY_SINGLE_CLOCK_OP 0 -#define ONCHIP_MEMORY_SIZE_MULTIPLE 1 -#define ONCHIP_MEMORY_SIZE_VALUE 16384 -#define ONCHIP_MEMORY_SPAN 16384 -#define ONCHIP_MEMORY_TYPE "altera_avalon_onchip_memory2" -#define ONCHIP_MEMORY_WRITABLE 1 - - -/* - * pio_0 configuration - * - */ - -#define ALT_MODULE_CLASS_pio_0 altera_avalon_pio -#define PIO_0_BASE 0x5000 -#define PIO_0_BIT_CLEARING_EDGE_REGISTER 0 -#define PIO_0_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define PIO_0_CAPTURE 0 -#define PIO_0_DATA_WIDTH 7 -#define PIO_0_DO_TEST_BENCH_WIRING 0 -#define PIO_0_DRIVEN_SIM_VALUE 0 -#define PIO_0_EDGE_TYPE "NONE" -#define PIO_0_FREQ 50000000 -#define PIO_0_HAS_IN 0 -#define PIO_0_HAS_OUT 1 -#define PIO_0_HAS_TRI 0 -#define PIO_0_IRQ -1 -#define PIO_0_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define PIO_0_IRQ_TYPE "NONE" -#define PIO_0_NAME "/dev/pio_0" -#define PIO_0_RESET_VALUE 0 -#define PIO_0_SPAN 16 -#define PIO_0_TYPE "altera_avalon_pio" - - -/* - * push_switches configuration - * - */ - -#define ALT_MODULE_CLASS_push_switches altera_avalon_pio -#define PUSH_SWITCHES_BASE 0x5080 -#define PUSH_SWITCHES_BIT_CLEARING_EDGE_REGISTER 0 -#define PUSH_SWITCHES_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define PUSH_SWITCHES_CAPTURE 0 -#define PUSH_SWITCHES_DATA_WIDTH 3 -#define PUSH_SWITCHES_DO_TEST_BENCH_WIRING 0 -#define PUSH_SWITCHES_DRIVEN_SIM_VALUE 0 -#define PUSH_SWITCHES_EDGE_TYPE "NONE" -#define PUSH_SWITCHES_FREQ 50000000 -#define PUSH_SWITCHES_HAS_IN 1 -#define PUSH_SWITCHES_HAS_OUT 0 -#define PUSH_SWITCHES_HAS_TRI 0 -#define PUSH_SWITCHES_IRQ -1 -#define PUSH_SWITCHES_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define PUSH_SWITCHES_IRQ_TYPE "NONE" -#define PUSH_SWITCHES_NAME "/dev/push_switches" -#define PUSH_SWITCHES_RESET_VALUE 0 -#define PUSH_SWITCHES_SPAN 16 -#define PUSH_SWITCHES_TYPE "altera_avalon_pio" - - -/* - * switches configuration - * - */ - -#define ALT_MODULE_CLASS_switches altera_avalon_pio -#define SWITCHES_BASE 0x5090 -#define SWITCHES_BIT_CLEARING_EDGE_REGISTER 0 -#define SWITCHES_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define SWITCHES_CAPTURE 0 -#define SWITCHES_DATA_WIDTH 18 -#define SWITCHES_DO_TEST_BENCH_WIRING 0 -#define SWITCHES_DRIVEN_SIM_VALUE 0 -#define SWITCHES_EDGE_TYPE "NONE" -#define SWITCHES_FREQ 50000000 -#define SWITCHES_HAS_IN 1 -#define SWITCHES_HAS_OUT 0 -#define SWITCHES_HAS_TRI 0 -#define SWITCHES_IRQ -1 -#define SWITCHES_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define SWITCHES_IRQ_TYPE "NONE" -#define SWITCHES_NAME "/dev/switches" -#define SWITCHES_RESET_VALUE 0 -#define SWITCHES_SPAN 16 -#define SWITCHES_TYPE "altera_avalon_pio" - -#endif /* __SYSTEM_H_ */ diff --git a/software/qsys_tutorial_mem/.cproject b/software/qsys_tutorial_mem/.cproject deleted file mode 100644 index dd88260..0000000 --- a/software/qsys_tutorial_mem/.cproject +++ /dev/null @@ -1,508 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - make - - mem_init_install - true - false - false - - - make - - mem_init_generate - true - false - false - - - make - - help - true - false - false - - - - diff --git a/software/qsys_tutorial_mem/.project b/software/qsys_tutorial_mem/.project deleted file mode 100644 index de48e99..0000000 --- a/software/qsys_tutorial_mem/.project +++ /dev/null @@ -1,96 +0,0 @@ - - - qsys_tutorial_mem - - - - - - com.altera.sbtgui.project.makefileBuilder - - - - - com.altera.sbtgui.project.makefileBuilder - - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - ?name? - - - - org.eclipse.cdt.make.core.append_environment - true - - - org.eclipse.cdt.make.core.autoBuildTarget - all - - - org.eclipse.cdt.make.core.buildArguments - - - - org.eclipse.cdt.make.core.buildCommand - make - - - org.eclipse.cdt.make.core.buildLocation - ${workspace_loc://qsys_tutorial_mem} - - - org.eclipse.cdt.make.core.cleanBuildTarget - clean - - - org.eclipse.cdt.make.core.contents - org.eclipse.cdt.make.core.activeConfigSettings - - - org.eclipse.cdt.make.core.enableAutoBuild - false - - - org.eclipse.cdt.make.core.enableCleanBuild - true - - - org.eclipse.cdt.make.core.enableFullBuild - true - - - org.eclipse.cdt.make.core.fullBuildTarget - all - - - org.eclipse.cdt.make.core.stopOnError - true - - - org.eclipse.cdt.make.core.useDefaultBuildCmd - true - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - org.eclipse.cdt.core.ccnature - com.altera.sbtgui.project.SBTGUINature - com.altera.sbtgui.project.SBTGUIAppNature - com.altera.sbtgui.project.SBTGUIManagedNature - - diff --git a/software/qsys_tutorial_mem/Makefile b/software/qsys_tutorial_mem/Makefile deleted file mode 100644 index 0b274d9..0000000 --- a/software/qsys_tutorial_mem/Makefile +++ /dev/null @@ -1,1093 +0,0 @@ -#------------------------------------------------------------------------------ -# VARIABLES APPENDED TO BY INCLUDED MAKEFILE FRAGMENTS -#------------------------------------------------------------------------------ - -# List of include directories for -I compiler option (-I added when used). -# Includes the BSP. -ALT_INCLUDE_DIRS := - -# List of library directories for -L linker option (-L added when used). -# Includes the BSP. -ALT_LIBRARY_DIRS := - -# List of library names for -l linker option (-l added when used). -# Includes the BSP. -ALT_LIBRARY_NAMES := - -# List of library names for -msys-lib linker option (-msys-lib added when used). -# These are libraries that might be located in the BSP and depend on the BSP -# library, or vice versa -ALT_BSP_DEP_LIBRARY_NAMES := - -# List of dependencies for the linker. This is usually the full pathname -# of each library (*.a) file. -# Includes the BSP. -ALT_LDDEPS := - -# List of root library directories that support running make to build them. -# Includes the BSP and any ALT libraries. -MAKEABLE_LIBRARY_ROOT_DIRS := - -# Generic flags passed to the compiler for different types of input files. -ALT_CFLAGS := -ALT_CXXFLAGS := -ALT_CPPFLAGS := -ALT_ASFLAGS := -ALT_LDFLAGS := - - -#------------------------------------------------------------------------------ -# The adjust-path macro -# -# If COMSPEC/ComSpec is defined, Make is launched from Windows through -# Cygwin. The adjust-path macro converts absolute windows paths into -# unix style paths (Example: c:/dir -> /c/dir). This will ensture -# paths are readable by GNU Make. -# -# If COMSPEC/ComSpec is not defined, Make is launched from linux, and no -# adjustment is necessary -# -#------------------------------------------------------------------------------ - -ifndef COMSPEC -ifdef ComSpec -COMSPEC = $(ComSpec) -endif # ComSpec -endif # COMSPEC - -ifdef COMSPEC # if Windows OS - -ifeq ($(MAKE_VERSION),3.81) -# -# adjust-path/adjust-path-mixed for Mingw Gnu Make on Windows -# -# Example Usage: -# $(call adjust-path,c:/aaa/bbb) => /c/aaa/bbb -# $(call adjust-path-mixed,/c/aaa/bbb) => c:/aaa/bbb -# $(call adjust-path-mixed,/cygdrive/c/aaa/bbb) => c:/aaa/bbb -# - -# -# adjust-path -# - converts back slash characters into forward slashes -# - if input arg ($1) is an empty string then return the empty string -# - if input arg ($1) does not contain the string ":/", then return input arg -# - using sed, convert mixed path [c:/...] into mingw path [/c/...] -define adjust-path -$(strip \ -$(if $1,\ -$(if $(findstring :/,$(subst \,/,$1)),\ -$(shell echo $(subst \,/,$1) | sed -e 's,^\([a-zA-Z]\):/,/\1/,'),\ -$(subst \,/,$1)))) -endef - -# -# adjust-path-mixed -# - converts back slash characters into forward slashes -# - if input arg ($1) is an empty string then return the empty string -# - if input arg ($1) does not begin with a forward slash '/' char, then -# return input arg -# - using sed, convert mingw path [/c/...] or cygwin path [/c/cygdrive/...] -# into a mixed path [c:/...] -define adjust-path-mixed -$(strip \ -$(if $1,\ -$(if $(findstring $(subst \,/,$1),$(patsubst /%,%,$(subst \,/,$1))),\ -$(subst \,/,$1),\ -$(shell echo $(subst \,/,$1) | sed -e 's,^/cygdrive/\([a-zA-Z]\)/,\1:/,' -e 's,^/\([a-zA-Z]\)/,\1:/,')))) -endef - -else # MAKE_VERSION != 3.81 (MAKE_VERSION == 3.80 or MAKE_VERSION == 3.79) -# -# adjust-path for Cygwin Gnu Make -# $(call adjust-path,c:/aaa/bbb) = /cygdrive/c/aaa/bbb -# $(call adjust-path-mixed,/cygdrive/c/aaa/bbb) = c:/aaa/bbb -# -adjust-path = $(if $1,$(shell cygpath -u "$1"),) -adjust-path-mixed = $(if $1,$(shell cygpath -m "$1"),) -endif - -else # !COMSPEC - -adjust-path = $1 -adjust-path-mixed = $1 - -endif # COMSPEC - - -#vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv -# GENERATED SETTINGS START v -#vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv - -#START GENERATED -ACTIVE_BUILD_CONFIG := default -BUILD_CONFIGS := default - -# The following TYPE comment allows tools to identify the 'type' of target this -# makefile is associated with. -# TYPE: APP_MAKEFILE - -# This following VERSION comment indicates the version of the tool used to -# generate this makefile. A makefile variable is provided for VERSION as well. -# ACDS_VERSION: 13.0sp1 -ACDS_VERSION := 13.0sp1 - -# This following BUILD_NUMBER comment indicates the build number of the tool -# used to generate this makefile. -# BUILD_NUMBER: 232 - -# Define path to the application ELF. -# It may be used by the makefile fragments so is defined before including them. -# -ELF := qsys_tutorial_mem.elf - -# Paths to C, C++, and assembly source files. -C_SRCS += hello_world_small.c -C_SRCS += hex_encoder.c -C_SRCS += hex_out.c -C_SRCS += input_int.c -C_SRCS += sys_memory.c -C_SRCS += sys_register.c -C_SRCS += system.c -C_SRCS += inst_decoder.c -CXX_SRCS := -ASM_SRCS := - - -# Path to root of object file tree. -OBJ_ROOT_DIR := obj - -# Options to control objdump. -CREATE_OBJDUMP := 1 -OBJDUMP_INCLUDE_SOURCE := 1 -OBJDUMP_FULL_CONTENTS := 0 - -# Options to enable/disable optional files. -CREATE_ELF_DERIVED_FILES := 0 -CREATE_LINKER_MAP := 1 - -# Common arguments for ALT_CFLAGSs -APP_CFLAGS_DEFINED_SYMBOLS := -APP_CFLAGS_UNDEFINED_SYMBOLS := -APP_CFLAGS_OPTIMIZATION := -Os -APP_CFLAGS_DEBUG_LEVEL := -g -APP_CFLAGS_WARNINGS := -Wall -APP_CFLAGS_USER_FLAGS := - -APP_ASFLAGS_USER := -APP_LDFLAGS_USER := - -# Linker options that have default values assigned later if not -# assigned here. -LINKER_SCRIPT := -CRT0 := -SYS_LIB := - -# Define path to the root of the BSP. -BSP_ROOT_DIR := ../qsys_tutorial_mem_bsp/ - -# List of application specific include directories, library directories and library names -APP_INCLUDE_DIRS := -APP_LIBRARY_DIRS := -APP_LIBRARY_NAMES := - -# Pre- and post- processor settings. -BUILD_PRE_PROCESS := -BUILD_POST_PROCESS := - -QUARTUS_PROJECT_DIR := ../../ - - -#END GENERATED - -#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -# GENERATED SETTINGS END ^ -#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - -#------------------------------------------------------------------------------ -# DEFAULT TARGET -#------------------------------------------------------------------------------ - -# Define the variable used to echo output if not already defined. -ifeq ($(ECHO),) -ECHO := echo -endif - -# Put "all" rule before included makefile fragments because they may -# define rules and we don't want one of those to become the default rule. -.PHONY : all - -all: - @$(ECHO) [$(APP_NAME) build complete] - -all : build_pre_process libs app build_post_process - - -#------------------------------------------------------------------------------ -# VARIABLES DEPENDENT ON GENERATED CONTENT -#------------------------------------------------------------------------------ - -# Define object file directory per build configuration -CONFIG_OBJ_DIR := $(OBJ_ROOT_DIR)/$(ACTIVE_BUILD_CONFIG) - -ifeq ($(BSP_ROOT_DIR),) -$(error Edit Makefile and provide a value for BSP_ROOT_DIR) -endif - -ifeq ($(wildcard $(BSP_ROOT_DIR)),) -$(error BSP directory does not exist: $(BSP_ROOT_DIR)) -endif - -# Define absolute path to the root of the BSP. -ABS_BSP_ROOT_DIR := $(call adjust-path-mixed,$(shell cd "$(BSP_ROOT_DIR)"; pwd)) - -# Include makefile fragments. Define variable ALT_LIBRARY_ROOT_DIR before -# including each makefile fragment so that it knows the path to itself. -BSP_INCLUDE_FILE := $(BSP_ROOT_DIR)/public.mk -ALT_LIBRARY_ROOT_DIR := $(BSP_ROOT_DIR) -include $(BSP_INCLUDE_FILE) -# C2H will need this to touch the BSP public.mk and avoid the sopc file -# out-of-date error during a BSP make -ABS_BSP_INCLUDE_FILE := $(ABS_BSP_ROOT_DIR)/public.mk - - -ifneq ($(WARNING.SMALL_STACK_SIZE),) -# This WARNING is here to protect you from unknowingly using a very small stack -# If the warning is set, increase your stack size or enable the BSP small stack -# setting to eliminate the warning -$(warning WARNING: $(WARNING.SMALL_STACK_SIZE)) -endif - - -# If the BSP public.mk indicates that ALT_SIM_OPTIMIZE is set, rename the ELF -# by prefixing it with RUN_ON_HDL_SIMULATOR_ONLY_. -ifneq ($(filter -DALT_SIM_OPTIMIZE,$(ALT_CPPFLAGS)),) -ELF := RUN_ON_HDL_SIMULATOR_ONLY_$(ELF) -endif - -# If the BSP public.mk indicates that ALT_PROVIDE_GMON is set, add option to -# download_elf target -ifneq ($(filter -DALT_PROVIDE_GMON,$(ALT_CPPFLAGS)),) -GMON_OUT_FILENAME := gmon.out -WRITE_GMON_OPTION := --write-gmon $(GMON_OUT_FILENAME) -endif - -# Name of ELF application. -APP_NAME := $(basename $(ELF)) - -# Set to defaults if variables not already defined in settings. -ifeq ($(LINKER_SCRIPT),) -LINKER_SCRIPT := $(BSP_LINKER_SCRIPT) -endif -ifeq ($(CRT0),) -CRT0 := $(BSP_CRT0) -endif -ifeq ($(SYS_LIB),) -SYS_LIB := $(BSP_SYS_LIB) -endif - -OBJDUMP_NAME := $(APP_NAME).objdump -OBJDUMP_FLAGS := --disassemble --syms --all-header -ifeq ($(OBJDUMP_INCLUDE_SOURCE),1) -OBJDUMP_FLAGS += --source -endif -ifeq ($(OBJDUMP_FULL_CONTENTS),1) -OBJDUMP_FLAGS += --full-contents -endif - -# Create list of linker dependencies (*.a files). -APP_LDDEPS := $(ALT_LDDEPS) $(LDDEPS) - -# Take lists and add required prefixes. -APP_INC_DIRS := $(addprefix -I, $(ALT_INCLUDE_DIRS) $(APP_INCLUDE_DIRS) $(INC_DIRS)) -ASM_INC_PREFIX := -Wa,-I -APP_ASM_INC_DIRS := $(addprefix $(ASM_INC_PREFIX), $(ALT_INCLUDE_DIRS) $(APP_INCLUDE_DIRS) $(INC_DIRS)) -APP_LIB_DIRS := $(addprefix -L, $(ALT_LIBRARY_DIRS) $(APP_LIBRARY_DIRS) $(LIB_DIRS)) -APP_LIBS := $(addprefix -l, $(ALT_LIBRARY_NAMES) $(APP_LIBRARY_NAMES) $(LIBS)) - -ifneq ($(AVOID_NIOS2_GCC3_OPTIONS),) - -# -# Avoid Nios II GCC 3.X options. -# - -# Detect if small newlib C library is requested. -# If yes, remove the -msmallc option because it is -# now handled by other means. -ifneq ($(filter -msmallc,$(ALT_LDFLAGS)),) - ALT_LDFLAGS := $(filter-out -msmallc,$(ALT_LDFLAGS)) - ALT_C_LIBRARY := smallc -else - ALT_C_LIBRARY := c -endif - -# Put each BSP dependent library in a group to avoid circular dependencies. -APP_BSP_DEP_LIBS := $(foreach l,$(ALT_BSP_DEP_LIBRARY_NAMES),-Wl,--start-group -l$(ALT_C_LIBRARY) -lgcc -l$(l) -Wl,--end-group) - -else # !AVOID_NIOS2_GCC3_OPTIONS - -# -# Use Nios II GCC 3.X options. -# -APP_BSP_DEP_LIBS := $(addprefix -msys-lib=, $(ALT_BSP_DEP_LIBRARY_NAMES)) - -endif # !AVOID_NIOS2_GCC3_OPTIONS - -# Arguments for the C preprocessor, C/C++ compiler, assembler, and linker. -APP_CFLAGS := $(APP_CFLAGS_DEFINED_SYMBOLS) \ - $(APP_CFLAGS_UNDEFINED_SYMBOLS) \ - $(APP_CFLAGS_OPTIMIZATION) \ - $(APP_CFLAGS_DEBUG_LEVEL) \ - $(APP_CFLAGS_WARNINGS) \ - $(APP_CFLAGS_USER_FLAGS) \ - $(ALT_CFLAGS) \ - $(CFLAGS) - -# Arguments only for the C++ compiler. -APP_CXXFLAGS := $(ALT_CXXFLAGS) $(CXXFLAGS) - -# Arguments only for the C preprocessor. -# Prefix each include directory with -I. -APP_CPPFLAGS := $(APP_INC_DIRS) \ - $(ALT_CPPFLAGS) \ - $(CPPFLAGS) - -# Arguments only for the assembler. -APP_ASFLAGS := $(APP_ASM_INC_DIRS) \ - $(ALT_ASFLAGS) \ - $(APP_ASFLAGS_USER) \ - $(ASFLAGS) - -# Arguments only for the linker. -APP_LDFLAGS := $(APP_LDFLAGS_USER) - -ifneq ($(LINKER_SCRIPT),) -APP_LDFLAGS += -T'$(LINKER_SCRIPT)' -endif - -ifneq ($(AVOID_NIOS2_GCC3_OPTIONS),) - -# Avoid Nios II GCC 3.x options. -ifneq ($(CRT0),) -APP_LDFLAGS += $(CRT0) -endif - -# The equivalent of the -msys-lib option is provided -# by the GROUP() command in the linker script. -# Note this means the SYS_LIB variable is now ignored. - -else # !AVOID_NIOS2_GCC3_OPTIONS - -# Use Nios II GCC 3.x options. -ifneq ($(CRT0),) -APP_LDFLAGS += -msys-crt0='$(CRT0)' -endif -ifneq ($(SYS_LIB),) -APP_LDFLAGS += -msys-lib=$(SYS_LIB) -endif - -endif # !AVOID_NIOS2_GCC3_OPTIONS - -APP_LDFLAGS += \ - $(APP_LIB_DIRS) \ - $(ALT_LDFLAGS) \ - $(LDFLAGS) - -LINKER_MAP_NAME := $(APP_NAME).map -ifeq ($(CREATE_LINKER_MAP), 1) -APP_LDFLAGS += -Wl,-Map=$(LINKER_MAP_NAME) -endif - -# QUARTUS_PROJECT_DIR and SOPC_NAME need to be defined if you want the -# mem_init_install target of the mem_init.mk (located in the associated BSP) -# to know how to copy memory initialization files (e.g. .dat, .hex) into -# directories required for Quartus compilation or RTL simulation. - -# Defining QUARTUS_PROJECT_DIR causes mem_init_install to copy memory -# initialization files into your Quartus project directory. This is required -# to provide the initial memory contents of FPGA memories that can be -# initialized by the programming file (.sof) or Hardcopy ROMs. It is also used -# for VHDL simulation of on-chip memories. - -# Defining SOPC_NAME causes the mem_init_install target to copy memory -# initialization files into your RTL simulation directory. This is required -# to provide the initial memory contents of all memories that can be -# initialized by RTL simulation. This variable should be set to the same name -# as your SOPC Builder system name. For example, if you have a system called -# "foo.sopc", this variable should be set to "foo". - -# If SOPC_NAME is not set and QUARTUS_PROJECT_DIR is set, then derive SOPC_NAME. -ifeq ($(SOPC_NAME),) -ifneq ($(QUARTUS_PROJECT_DIR),) -SOPC_NAME := $(basename $(notdir $(wildcard $(QUARTUS_PROJECT_DIR)/*.sopcinfo))) -endif -endif - -# Defining JDI_FILE is required to specify the JTAG Debug Information File -# path. This file is generated by Quartus, and is needed along with the -# .sopcinfo file to resolve processor instance ID's from names in a multi-CPU -# systems. For multi-CPU systems, the processor instance ID is used to select -# from multiple CPU's during ELF download. - -# Both JDI_FILE and SOPCINFO_FILE are provided by the BSP if they found during -# BSP creation. If JDI_FILE is not set and QUARTUS_PROJECT_DIR is set, then -# derive JDI_FILE. We do not attempt to derive SOPCINFO_FILE since there may be -# multiple .sopcinfo files in a Quartus project. -ifeq ($(JDI_FILE),) -ifneq ($(QUARTUS_PROJECT_DIR),) -JDI_FILE := $(wildcard $(QUARTUS_PROJECT_DIR)/*.jdi) -endif -endif - -# Path to root runtime directory used for hdl simulation -RUNTIME_ROOT_DIR := $(CONFIG_OBJ_DIR)/runtime - - - -#------------------------------------------------------------------------------ -# MAKEFILE INCLUDES DEPENDENT ON GENERATED CONTENT -#------------------------------------------------------------------------------ -# mem_init.mk is a generated makefile fragment. This file defines all targets -# used to generate HDL initialization simulation files and pre-initialized -# onchip memory files. -MEM_INIT_FILE := $(BSP_ROOT_DIR)/mem_init.mk -include $(MEM_INIT_FILE) - -# Create list of object files to be built using the list of source files. -# The source file hierarchy is preserved in the object tree. -# The supported file extensions are: -# -# .c - for C files -# .cxx .cc .cpp - for C++ files -# .S .s - for assembler files -# -# Handle source files specified by --src-dir & --src-rdir differently, to -# save some processing time in calling the adjust-path macro. - -OBJ_LIST_C := $(patsubst %.c,%.o,$(filter %.c,$(C_SRCS))) -OBJ_LIST_CPP := $(patsubst %.cpp,%.o,$(filter %.cpp,$(CXX_SRCS))) -OBJ_LIST_CXX := $(patsubst %.cxx,%.o,$(filter %.cxx,$(CXX_SRCS))) -OBJ_LIST_CC := $(patsubst %.cc,%.o,$(filter %.cc,$(CXX_SRCS))) -OBJ_LIST_S := $(patsubst %.S,%.o,$(filter %.S,$(ASM_SRCS))) -OBJ_LIST_SS := $(patsubst %.s,%.o,$(filter %.s,$(ASM_SRCS))) - -OBJ_LIST := $(sort $(OBJ_LIST_C) $(OBJ_LIST_CPP) $(OBJ_LIST_CXX) \ - $(OBJ_LIST_CC) $(OBJ_LIST_S) $(OBJ_LIST_SS)) - -SDIR_OBJ_LIST_C := $(patsubst %.c,%.o,$(filter %.c,$(SDIR_C_SRCS))) -SDIR_OBJ_LIST_CPP := $(patsubst %.cpp,%.o,$(filter %.cpp,$(SDIR_CXX_SRCS))) -SDIR_OBJ_LIST_CXX := $(patsubst %.cxx,%.o,$(filter %.cxx,$(SDIR_CXX_SRCS))) -SDIR_OBJ_LIST_CC := $(patsubst %.cc,%.o,$(filter %.cc,$(SDIR_CXX_SRCS))) -SDIR_OBJ_LIST_S := $(patsubst %.S,%.o,$(filter %.S,$(SDIR_ASM_SRCS))) -SDIR_OBJ_LIST_SS := $(patsubst %.s,%.o,$(filter %.s,$(SDIR_ASM_SRCS))) - -SDIR_OBJ_LIST := $(sort $(SDIR_OBJ_LIST_C) $(SDIR_OBJ_LIST_CPP) \ - $(SDIR_OBJ_LIST_CXX) $(SDIR_OBJ_LIST_CC) $(SDIR_OBJ_LIST_S) \ - $(SDIR_OBJ_LIST_SS)) - -# Relative-pathed objects that being with "../" are handled differently. -# -# Regular objects are created as -# $(CONFIG_OBJ_DIR)//.o -# where the path structure is maintained under the obj directory. This -# applies for both absolute and relative paths; in the absolute path -# case this means the entire source path will be recreated under the obj -# directory. This is done to allow two source files with the same name -# to be included as part of the project. -# -# Note: On Cygwin, the path recreated under the obj directory will be -# the cygpath -u output path. -# -# Relative-path objects that begin with "../" cause problems under this -# scheme, as $(CONFIG_OBJ_DIR)/..// can potentially put the object -# files anywhere in the system, creating clutter and polluting the source tree. -# As such, their paths are flattened - the object file created will be -# $(CONFIG_OBJ_DIR)/.o. Due to this, two files specified with -# "../" in the beginning cannot have the same name in the project. VPATH -# will be set for these sources to allow make to relocate the source file -# via %.o rules. -# -# The following lines separate the object list into the flatten and regular -# lists, and then handles them as appropriate. - -FLATTEN_OBJ_LIST := $(filter ../%,$(OBJ_LIST)) -FLATTEN_APP_OBJS := $(addprefix $(CONFIG_OBJ_DIR)/,$(notdir $(FLATTEN_OBJ_LIST))) - -REGULAR_OBJ_LIST := $(filter-out $(FLATTEN_OBJ_LIST),$(OBJ_LIST)) -REGULAR_OBJ_LIST_C := $(filter $(OBJ_LIST_C),$(REGULAR_OBJ_LIST)) -REGULAR_OBJ_LIST_CPP := $(filter $(OBJ_LIST_CPP),$(REGULAR_OBJ_LIST)) -REGULAR_OBJ_LIST_CXX := $(filter $(OBJ_LIST_CXX),$(REGULAR_OBJ_LIST)) -REGULAR_OBJ_LIST_CC := $(filter $(OBJ_LIST_CC),$(REGULAR_OBJ_LIST)) -REGULAR_OBJ_LIST_S := $(filter $(OBJ_LIST_S),$(REGULAR_OBJ_LIST)) -REGULAR_OBJ_LIST_SS := $(filter $(OBJ_LIST_SS),$(REGULAR_OBJ_LIST)) - -FLATTEN_SDIR_OBJ_LIST := $(filter ../%,$(SDIR_OBJ_LIST)) -FLATTEN_SDIR_APP_OBJS := $(addprefix $(CONFIG_OBJ_DIR)/,$(notdir $(FLATTEN_SDIR_OBJ_LIST))) - -REGULAR_SDIR_OBJ_LIST := $(filter-out $(FLATTEN_SDIR_OBJ_LIST),$(SDIR_OBJ_LIST)) -REGULAR_SDIR_OBJ_LIST_C := $(filter $(SDIR_OBJ_LIST_C),$(REGULAR_SDIR_OBJ_LIST)) -REGULAR_SDIR_OBJ_LIST_CPP := $(filter $(SDIR_OBJ_LIST_CPP),$(REGULAR_SDIR_OBJ_LIST)) -REGULAR_SDIR_OBJ_LIST_CXX := $(filter $(SDIR_OBJ_LIST_CXX),$(REGULAR_SDIR_OBJ_LIST)) -REGULAR_SDIR_OBJ_LIST_CC := $(filter $(SDIR_OBJ_LIST_CC),$(REGULAR_SDIR_OBJ_LIST)) -REGULAR_SDIR_OBJ_LIST_S := $(filter $(SDIR_OBJ_LIST_S),$(REGULAR_SDIR_OBJ_LIST)) -REGULAR_SDIR_OBJ_LIST_SS := $(filter $(SDIR_OBJ_LIST_SS),$(REGULAR_SDIR_OBJ_LIST)) - -VPATH := $(sort $(dir $(FLATTEN_OBJ_LIST)) $(dir $(FLATTEN_SDIR_OBJ_LIST))) - -APP_OBJS_C := $(addprefix $(CONFIG_OBJ_DIR)/,\ - $(REGULAR_SDIR_OBJ_LIST_C) \ - $(foreach s,$(REGULAR_OBJ_LIST_C),$(call adjust-path,$s))) - -APP_OBJS_CPP := $(addprefix $(CONFIG_OBJ_DIR)/,\ - $(REGULAR_SDIR_OBJ_LIST_CPP) \ - $(foreach s,$(REGULAR_OBJ_LIST_CPP),$(call adjust-path,$s))) - -APP_OBJS_CXX := $(addprefix $(CONFIG_OBJ_DIR)/,\ - $(REGULAR_SDIR_OBJ_LIST_CXX) \ - $(foreach s,$(REGULAR_OBJ_LIST_CXX),$(call adjust-path,$s))) - -APP_OBJS_CC := $(addprefix $(CONFIG_OBJ_DIR)/,\ - $(REGULAR_SDIR_OBJ_LIST_CC) \ - $(foreach s,$(REGULAR_OBJ_LIST_CC),$(call adjust-path,$s))) - -APP_OBJS_S := $(addprefix $(CONFIG_OBJ_DIR)/,\ - $(REGULAR_SDIR_OBJ_LIST_S) \ - $(foreach s,$(REGULAR_OBJ_LIST_S),$(call adjust-path,$s))) - -APP_OBJS_SS := $(addprefix $(CONFIG_OBJ_DIR)/,\ - $(REGULAR_SDIR_OBJ_LIST_SS) \ - $(foreach s,$(REGULAR_OBJ_LIST_SS),$(call adjust-path,$s))) - -APP_OBJS := $(APP_OBJS_C) $(APP_OBJS_CPP) $(APP_OBJS_CXX) $(APP_OBJS_CC) \ - $(APP_OBJS_S) $(APP_OBJS_SS) \ - $(FLATTEN_APP_OBJS) $(FLATTEN_SDIR_APP_OBJS) - -# Add any extra user-provided object files. -APP_OBJS += $(OBJS) - -# Create list of dependancy files for each object file. -APP_DEPS := $(APP_OBJS:.o=.d) - -# Patch the Elf file with system specific information - -# Patch the Elf with the name of the sopc system -ifneq ($(SOPC_NAME),) -ELF_PATCH_FLAG += --sopc_system_name $(SOPC_NAME) -endif - -# Patch the Elf with the absolute path to the Quartus Project Directory -ifneq ($(QUARTUS_PROJECT_DIR),) -ABS_QUARTUS_PROJECT_DIR := $(call adjust-path-mixed,$(shell cd "$(QUARTUS_PROJECT_DIR)"; pwd)) -ELF_PATCH_FLAG += --quartus_project_dir "$(ABS_QUARTUS_PROJECT_DIR)" -endif - -# Patch the Elf and download args with the JDI_FILE if specified -ifneq ($(wildcard $(JDI_FILE)),) -ELF_PATCH_FLAG += --jdi $(JDI_FILE) -DOWNLOAD_JDI_FLAG := --jdi $(JDI_FILE) -endif - -# Patch the Elf with the SOPCINFO_FILE if specified -ifneq ($(wildcard $(SOPCINFO_FILE)),) -ELF_PATCH_FLAG += --sopcinfo $(SOPCINFO_FILE) -endif - -# Use the DOWNLOAD_CABLE variable to specify which JTAG cable to use. -# This is not needed if you only have one cable. -ifneq ($(DOWNLOAD_CABLE),) -DOWNLOAD_CABLE_FLAG := --cable '$(DOWNLOAD_CABLE)' -endif - - -#------------------------------------------------------------------------------ -# BUILD PRE/POST PROCESS -#------------------------------------------------------------------------------ -build_pre_process : - $(BUILD_PRE_PROCESS) - -build_post_process : - $(BUILD_POST_PROCESS) - -.PHONY: build_pre_process build_post_process - - -#------------------------------------------------------------------------------ -# TOOLS -#------------------------------------------------------------------------------ - -# -# Set tool default variables if not already defined. -# If these are defined, they would typically be defined in an -# included makefile fragment. -# -ifeq ($(DEFAULT_CROSS_COMPILE),) -DEFAULT_CROSS_COMPILE := nios2-elf- -endif - -ifeq ($(DEFAULT_STACK_REPORT),) -DEFAULT_STACKREPORT := nios2-stackreport -endif - -ifeq ($(DEFAULT_DOWNLOAD),) -DEFAULT_DOWNLOAD := nios2-download -endif - -ifeq ($(DEFAULT_FLASHPROG),) -DEFAULT_FLASHPROG := nios2-flash-programmer -endif - -ifeq ($(DEFAULT_ELFPATCH),) -DEFAULT_ELFPATCH := nios2-elf-insert -endif - -ifeq ($(DEFAULT_RM),) -DEFAULT_RM := rm -f -endif - -ifeq ($(DEFAULT_CP),) -DEFAULT_CP := cp -f -endif - -ifeq ($(DEFAULT_MKDIR),) -DEFAULT_MKDIR := mkdir -p -endif - -# -# Set tool variables to defaults if not already defined. -# If these are defined, they would typically be defined by a -# setting in the generated portion of this makefile. -# -ifeq ($(CROSS_COMPILE),) -CROSS_COMPILE := $(DEFAULT_CROSS_COMPILE) -endif - -ifeq ($(origin CC),default) -CC := $(CROSS_COMPILE)gcc -xc -endif - -ifeq ($(origin CXX),default) -CXX := $(CROSS_COMPILE)gcc -xc++ -endif - -ifeq ($(origin AS),default) -AS := $(CROSS_COMPILE)gcc -endif - -ifeq ($(origin AR),default) -AR := $(CROSS_COMPILE)ar -endif - -ifeq ($(origin LD),default) -LD := $(CROSS_COMPILE)g++ -endif - -ifeq ($(origin NM),default) -NM := $(CROSS_COMPILE)nm -endif - -ifeq ($(origin RM),default) -RM := $(DEFAULT_RM) -endif - -ifeq ($(origin CP),default) -CP := $(DEFAULT_CP) -endif - -ifeq ($(OBJDUMP),) -OBJDUMP := $(CROSS_COMPILE)objdump -endif - -ifeq ($(OBJCOPY),) -OBJCOPY := $(CROSS_COMPILE)objcopy -endif - -ifeq ($(STACKREPORT),) -ifeq ($(CROSS_COMPILE),nios2-elf-) -STACKREPORT := $(DEFAULT_STACKREPORT) -else -DISABLE_STACKREPORT := 1 -endif -endif - -ifeq ($(DOWNLOAD),) -DOWNLOAD := $(DEFAULT_DOWNLOAD) -endif - -ifeq ($(FLASHPROG),) -FLASHPROG := $(DEFAULT_FLASHPROG) -endif - -ifeq ($(ELFPATCH),) -ELFPATCH := $(DEFAULT_ELFPATCH) -endif - -ifeq ($(MKDIR),) -MKDIR := $(DEFAULT_MKDIR) -endif - -#------------------------------------------------------------------------------ -# PATTERN RULES TO BUILD OBJECTS -#------------------------------------------------------------------------------ - -define compile.c -@$(ECHO) Info: Compiling $< to $@ -@$(MKDIR) $(@D) -$(CC) -MP -MMD -c $(APP_CPPFLAGS) $(APP_CFLAGS) -o $@ $< -$(CC_POST_PROCESS) -endef - -define compile.cpp -@$(ECHO) Info: Compiling $< to $@ -@$(MKDIR) $(@D) -$(CXX) -MP -MMD -c $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< -$(CXX_POST_PROCESS) -endef - -# If assembling with the compiler, ensure "-Wa," is prepended to all APP_ASFLAGS -ifeq ($(AS),$(patsubst %as,%,$(AS))) -COMMA := , -APP_ASFLAGS := $(filter-out $(APP_CFLAGS),$(addprefix -Wa$(COMMA),$(patsubst -Wa$(COMMA)%,%,$(APP_ASFLAGS)))) -endif - -define compile.s -@$(ECHO) Info: Assembling $< to $@ -@$(MKDIR) $(@D) -$(AS) -MP -MMD -c $(APP_CPPFLAGS) $(APP_CFLAGS) $(APP_ASFLAGS) -o $@ $< -$(AS_POST_PROCESS) -endef - -ifeq ($(MAKE_VERSION),3.81) -.SECONDEXPANSION: - -$(APP_OBJS_C): $(CONFIG_OBJ_DIR)/%.o: $$(call adjust-path-mixed,%.c) - $(compile.c) - -$(APP_OBJS_CPP): $(CONFIG_OBJ_DIR)/%.o: $$(call adjust-path-mixed,%.cpp) - $(compile.cpp) - -$(APP_OBJS_CC): $(CONFIG_OBJ_DIR)/%.o: $$(call adjust-path-mixed,%.cc) - $(compile.cpp) - -$(APP_OBJS_CXX): $(CONFIG_OBJ_DIR)/%.o: $$(call adjust-path-mixed,%.cxx) - $(compile.cpp) - -$(APP_OBJS_S): $(CONFIG_OBJ_DIR)/%.o: $$(call adjust-path-mixed,%.S) - $(compile.s) - -$(APP_OBJS_SS): $(CONFIG_OBJ_DIR)/%.o: $$(call adjust-path-mixed,%.s) - $(compile.s) - -endif # MAKE_VERSION != 3.81 - -$(CONFIG_OBJ_DIR)/%.o: %.c - $(compile.c) - -$(CONFIG_OBJ_DIR)/%.o: %.cpp - $(compile.cpp) - -$(CONFIG_OBJ_DIR)/%.o: %.cc - $(compile.cpp) - -$(CONFIG_OBJ_DIR)/%.o: %.cxx - $(compile.cpp) - -$(CONFIG_OBJ_DIR)/%.o: %.S - $(compile.s) - -$(CONFIG_OBJ_DIR)/%.o: %.s - $(compile.s) - - -#------------------------------------------------------------------------------ -# PATTERN RULES TO INTERMEDIATE FILES -#------------------------------------------------------------------------------ - -$(CONFIG_OBJ_DIR)/%.s: %.c - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CC) -S $(APP_CPPFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.s: %.cpp - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CXX) -S $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.s: %.cc - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CXX) -S $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.s: %.cxx - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CXX) -S $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.i: %.c - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CC) -E $(APP_CPPFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.i: %.cpp - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CXX) -E $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.i: %.cc - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CXX) -E $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.i: %.cxx - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CXX) -E $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< - - -#------------------------------------------------------------------------------ -# TARGET RULES -#------------------------------------------------------------------------------ - -.PHONY : help -help : - @$(ECHO) "Summary of Makefile targets" - @$(ECHO) " Build targets:" - @$(ECHO) " all (default) - Application and all libraries (including BSP)" - @$(ECHO) " bsp - Just the BSP" - @$(ECHO) " libs - All libraries (including BSP)" - @$(ECHO) " flash - All flash files" - @$(ECHO) " mem_init_generate - All memory initialization files" -ifeq ($(QSYS),1) - @$(ECHO) " mem_init_install - This target is deprecated for QSys Systems" - @$(ECHO) " --> Use the mem_init_generate target and then" - @$(ECHO) " add the generated meminit.qip file to your" - @$(ECHO) " Quartus II Project." -else # if QSYS != 1 - @$(ECHO) " mem_init_install - Copy memory initialization files to Quartus II project" -endif # QSYS == 1 - @$(ECHO) - @$(ECHO) " Clean targets:" - @$(ECHO) " clean_all - Application and all libraries (including BSP)" - @$(ECHO) " clean - Just the application" - @$(ECHO) " clean_bsp - Just the BSP" - @$(ECHO) " clean_libs - All libraries (including BSP)" - @$(ECHO) - @$(ECHO) " Run targets:" - @$(ECHO) " download-elf - Download and run your elf executable" - @$(ECHO) " program-flash - Program flash contents to the board" - -# Handy rule to skip making libraries and just make application. -.PHONY : app -app : $(ELF) - -ifeq ($(CREATE_OBJDUMP), 1) -app : $(OBJDUMP_NAME) -endif - -ifeq ($(CREATE_ELF_DERIVED_FILES),1) -app : elf_derived_files -endif - -.PHONY: elf_derived_files -elf_derived_files: default_mem_init - -# Handy rule for making just the BSP. -.PHONY : bsp -bsp : - @$(ECHO) Info: Building $(BSP_ROOT_DIR) - @$(MAKE) --no-print-directory -C $(BSP_ROOT_DIR) - - -# Make sure all makeable libraries (including the BSP) are up-to-date. -LIB_TARGETS := $(patsubst %,%-recurs-make-lib,$(MAKEABLE_LIBRARY_ROOT_DIRS)) - -.PHONY : libs -libs : $(LIB_TARGETS) - -ifneq ($(strip $(LIB_TARGETS)),) -$(LIB_TARGETS): %-recurs-make-lib: - @$(ECHO) Info: Building $* - $(MAKE) --no-print-directory -C $* -endif - -ifneq ($(strip $(APP_LDDEPS)),) -$(APP_LDDEPS): libs - @true -endif - -# Rules to force your project to rebuild or relink -# .force_relink file will cause any application that depends on this project to relink -# .force_rebuild file will cause this project to rebuild object files -# .force_rebuild_all file will cause this project and any project that depends on this project to rebuild object files - -FORCE_RELINK_DEP := .force_relink -FORCE_REBUILD_DEP := .force_rebuild -FORCE_REBUILD_ALL_DEP := .force_rebuild_all -FORCE_REBUILD_DEP_LIST := $(CONFIG_OBJ_DIR)/$(FORCE_RELINK_DEP) $(CONFIG_OBJ_DIR)/$(FORCE_REBUILD_DEP) $(FORCE_REBUILD_ALL_DEP) - -$(FORCE_REBUILD_DEP_LIST): - -$(APP_OBJS): $(wildcard $(CONFIG_OBJ_DIR)/$(FORCE_REBUILD_DEP)) $(wildcard $(addsuffix /$(FORCE_REBUILD_ALL_DEP), . $(ALT_LIBRARY_DIRS))) - -$(ELF): $(wildcard $(addsuffix /$(FORCE_RELINK_DEP), $(CONFIG_OBJ_DIR) $(ALT_LIBRARY_DIRS))) - - -# Clean just the application. -.PHONY : clean -ifeq ($(CREATE_ELF_DERIVED_FILES),1) -clean : clean_elf_derived_files -endif - -clean : - @$(RM) -r $(ELF) $(OBJDUMP_NAME) $(LINKER_MAP_NAME) $(OBJ_ROOT_DIR) $(RUNTIME_ROOT_DIR) $(FORCE_REBUILD_DEP_LIST) - @$(ECHO) [$(APP_NAME) clean complete] - -# Clean just the BSP. -.PHONY : clean_bsp -clean_bsp : - @$(ECHO) Info: Cleaning $(BSP_ROOT_DIR) - @$(MAKE) --no-print-directory -C $(BSP_ROOT_DIR) clean - -# Clean all makeable libraries including the BSP. -LIB_CLEAN_TARGETS := $(patsubst %,%-recurs-make-clean-lib,$(MAKEABLE_LIBRARY_ROOT_DIRS)) - -.PHONY : clean_libs -clean_libs : $(LIB_CLEAN_TARGETS) - -ifneq ($(strip $(LIB_CLEAN_TARGETS)),) -$(LIB_CLEAN_TARGETS): %-recurs-make-clean-lib: - @$(ECHO) Info: Cleaning $* - $(MAKE) --no-print-directory -C $* clean -endif - -.PHONY: clean_elf_derived_files -clean_elf_derived_files: mem_init_clean - -# Clean application and all makeable libraries including the BSP. -.PHONY : clean_all -clean_all : clean mem_init_clean clean_libs - -# Include the dependency files unless the make goal is performing a clean -# of the application. -ifneq ($(firstword $(MAKECMDGOALS)),clean) -ifneq ($(firstword $(MAKECMDGOALS)),clean_all) --include $(APP_DEPS) -endif -endif - -.PHONY : download-elf -download-elf : $(ELF) - @if [ "$(DOWNLOAD)" = "none" ]; \ - then \ - $(ECHO) Downloading $(ELF) not supported; \ - else \ - $(ECHO) Info: Downloading $(ELF); \ - $(DOWNLOAD) --go --cpu_name=$(CPU_NAME) $(DOWNLOAD_CABLE_FLAG) $(SOPC_SYSID_FLAG) $(DOWNLOAD_JDI_FLAG) $(WRITE_GMON_OPTION) $(ELF); \ - fi - -# Delete the target of a rule if it has changed and its commands exit -# with a nonzero exit status. -.DELETE_ON_ERROR: - -# Rules for flash programming commands -PROGRAM_FLASH_SUFFIX := -program -PROGRAM_FLASH_TARGET := $(addsuffix $(PROGRAM_FLASH_SUFFIX), $(FLASH_FILES)) - -.PHONY : program-flash -program-flash : $(PROGRAM_FLASH_TARGET) - -.PHONY : $(PROGRAM_FLASH_TARGET) -$(PROGRAM_FLASH_TARGET) : flash - @if [ "$(FLASHPROG)" = "none" ]; \ - then \ - $(ECHO) Programming flash not supported; \ - else \ - $(ECHO) Info: Programming $(basename $@).flash; \ - if [ -z "$($(basename $@)_EPCS_FLAGS)" ]; \ - then \ - $(ECHO) $(FLASHPROG) $(SOPC_SYSID_FLAG) --base=$($(basename $@)_START) $(basename $@).flash; \ - $(FLASHPROG) $(DOWNLOAD_CABLE_FLAG) $(SOPC_SYSID_FLAG) --base=$($(basename $@)_START) $(basename $@).flash; \ - else \ - $(ECHO) $(FLASHPROG) $(SOPC_SYSID_FLAG) --epcs --base=$($(basename $@)_START) $(basename $@).flash; \ - $(FLASHPROG) $(DOWNLOAD_CABLE_FLAG) $(SOPC_SYSID_FLAG) --epcs --base=$($(basename $@)_START) $(basename $@).flash; \ - fi \ - fi - - -# Rules for simulating with an HDL Simulator [QSYS only] -ifeq ($(QSYS),1) -IP_MAKE_SIMSCRIPT := ip-make-simscript - -ifeq ($(VSIM),) -VSIM_EXE := "$(if $(VSIM_DIR),$(VSIM_DIR)/,)vsim" -ifeq ($(ENABLE_VSIM_GUI),1) -VSIM := $(VSIM_EXE) -gui -else -VSIM := $(VSIM_EXE) -c -endif # ENABLE_VSIM_GUI == 1 -endif # VSIM not set - -ifeq ($(SPD),) -ifneq ($(ABS_QUARTUS_PROJECT_DIR),) -ifneq ($(SOPC_NAME),) -SPD := $(ABS_QUARTUS_PROJECT_DIR)/$(SOPC_NAME)_tb.spd -endif # SOPC_NAME set -endif # ABS_QUARTUS_PROJECT_DIR set -endif # SPD == empty string - -ifeq ($(MSIM_SCRIPT),) -SIM_SCRIPT_DIR := $(RUNTIME_ROOT_DIR)/sim -MSIM_SCRIPT := $(SIM_SCRIPT_DIR)/mentor/msim_setup.tcl -endif # MSIM_SCRIPT == empty string - -ifeq ($(MAKE_VERSION),3.81) -ABS_MEM_INIT_DESCRIPTOR_FILE := $(abspath $(MEM_INIT_DESCRIPTOR_FILE)) -else -ABS_MEM_INIT_DESCRIPTOR_FILE := $(call adjust-path-mixed,$(shell pwd))/$(MEM_INIT_DESCRIPTOR_FILE) -endif - -$(MSIM_SCRIPT): $(SPD) $(MEM_INIT_DESCRIPTOR_FILE) -ifeq ($(SPD),) - $(error No SPD file specified. Ensure QUARTUS_PROJECT_DIR variable is set) -endif - @$(MKDIR) $(SIM_SCRIPT_DIR) - $(IP_MAKE_SIMSCRIPT) --spd=$(SPD) --spd=$(MEM_INIT_DESCRIPTOR_FILE) --output-directory=$(SIM_SCRIPT_DIR) - -VSIM_COMMAND = \ - cd $(dir $(MSIM_SCRIPT)) && \ - $(VSIM) -do "do $(notdir $(MSIM_SCRIPT)); ld; $(if $(VSIM_RUN_TIME),run ${VSIM_RUN_TIME};quit;)" - -.PHONY: sim -sim: $(MSIM_SCRIPT) mem_init_generate -ifeq ($(MSIM_SCRIPT),) - $(error MSIM_SCRIPT not set) -endif - $(VSIM_COMMAND) - -endif # QSYS == 1 - - -#------------------------------------------------------------------------------ -# ELF TARGET RULE -#------------------------------------------------------------------------------ -# Rule for constructing the executable elf file. -$(ELF) : $(APP_OBJS) $(LINKER_SCRIPT) $(APP_LDDEPS) - @$(ECHO) Info: Linking $@ - $(LD) $(APP_LDFLAGS) $(APP_CFLAGS) -o $@ $(filter-out $(CRT0),$(APP_OBJS)) $(APP_LIBS) $(APP_BSP_DEP_LIBS) -ifneq ($(DISABLE_ELFPATCH),1) - $(ELFPATCH) $@ $(ELF_PATCH_FLAG) -endif -ifneq ($(DISABLE_STACKREPORT),1) - @bash -c "$(STACKREPORT) $@" -endif - -$(OBJDUMP_NAME) : $(ELF) - @$(ECHO) Info: Creating $@ - $(OBJDUMP) $(OBJDUMP_FLAGS) $< >$@ - -# Rule for printing the name of the elf file -.PHONY: print-elf-name -print-elf-name: - @$(ECHO) $(ELF) - - diff --git a/software/qsys_tutorial_mem/create-this-app b/software/qsys_tutorial_mem/create-this-app deleted file mode 100644 index b1515ad..0000000 --- a/software/qsys_tutorial_mem/create-this-app +++ /dev/null @@ -1,114 +0,0 @@ -#!/bin/bash -# -# This script creates the hello_world_small application in this directory. - - -BSP_DIR=../qsys_tutorial_mem_bsp -QUARTUS_PROJECT_DIR=../../ -NIOS2_APP_GEN_ARGS="--elf-name qsys_tutorial_mem.elf --set APP_CFLAGS_OPTIMIZATION -Os --set OBJDUMP_INCLUDE_SOURCE 1 --src-files hello_world_small.c" - - -# First, check to see if $SOPC_KIT_NIOS2 environmental variable is set. -# This variable is required for the command line tools to execute correctly. -if [ -z "${SOPC_KIT_NIOS2}" ] -then - echo Required \$SOPC_KIT_NIOS2 Environmental Variable is not set! - exit 1 -fi - - -# Also make sure that the APP has not been created already. Check for -# existence of Makefile in the app directory -if [ -f ./Makefile ] -then - echo Application has already been created! Delete Makefile if you want to create a new application makefile - exit 1 -fi - - -# We are selecting hal_reduced_footprint bsp because it supports this application. -# Check to see if the hal_reduced_footprint has already been generated by checking for -# existence of the public.mk file. If not, we need to run -# create-this-bsp file to generate the bsp. -if [ ! -f ${BSP_DIR}/public.mk ]; then - # Since BSP doesn't exist, create the BSP - # Pass any command line arguments passed to this script to the BSP. - pushd ${BSP_DIR} >> /dev/null - ./create-this-bsp "$@" || { - echo "create-this-bsp failed" - exit 1 - } - popd >> /dev/null -fi - - -# Don't run make if create-this-app script is called with --no-make arg -SKIP_MAKE= -while [ $# -gt 0 ] -do - case "$1" in - --no-make) - SKIP_MAKE=1 - ;; - esac - shift -done - - -# Now we also need to go copy the sources for this application to the -# local directory. -find "${SOPC_KIT_NIOS2}/examples/software/hello_world_small/" -name '*.c' -or -name '*.h' -or -name 'hostfs*' | xargs -i cp -L {} ./ || { - echo "failed during copying example source files" - exit 1 -} - -find "${SOPC_KIT_NIOS2}/examples/software/hello_world_small/" -name 'readme.txt' -or -name 'Readme.txt' | xargs -i cp -L {} ./ || { - echo "failed copying readme file" -} - -if [ -d "${SOPC_KIT_NIOS2}/examples/software/hello_world_small/system" ] -then - cp -RL "${SOPC_KIT_NIOS2}/examples/software/hello_world_small/system" . || { - echo "failed during copying project support files" - exit 1 - } -fi - -chmod -R +w . || { - echo "failed during changing file permissions" - exit 1 -} - -cmd="nios2-app-generate-makefile --bsp-dir ${BSP_DIR} --set QUARTUS_PROJECT_DIR=${QUARTUS_PROJECT_DIR} ${NIOS2_APP_GEN_ARGS}" - -echo "create-this-app: Running \"${cmd}\"" -$cmd || { - echo "nios2-app-generate-makefile failed" - exit 1 -} - -if [ -z "$SKIP_MAKE" ]; then - cmd="make" - - echo "create-this-app: Running \"$cmd\"" - $cmd || { - echo "make failed" - exit 1 - } - - echo - echo "To download and run the application:" - echo " 1. Make sure the board is connected to the system." - echo " 2. Run 'nios2-configure-sof ' to configure the FPGA with the hardware design." - echo " 3. If you have a stdio device, run 'nios2-terminal' in a different shell." - echo " 4. Run 'make download-elf' from the application directory." - echo - echo "To debug the application:" - echo " Import the project into Nios II Software Build Tools for Eclipse." - echo " Refer to Nios II Software Build Tools for Eclipse Documentation for more information." - echo - echo -e "" -fi - - -exit 0 diff --git a/software/qsys_tutorial_mem/hello_world_small.c b/software/qsys_tutorial_mem/hello_world_small.c deleted file mode 100644 index d43a936..0000000 --- a/software/qsys_tutorial_mem/hello_world_small.c +++ /dev/null @@ -1,130 +0,0 @@ -#include "sys/alt_stdio.h" -#include -#include "system.h" -#include "hex_out.h" -#include "sys_register.h" -#include "sys_memory.h" -#include "input_int.h" -#include "inst_decoder.h" - -#define ledrs (volatile int *) 0x00050a0 - -#define T_MS10 12500 //(10ms) - -void wait(unsigned int s) { - volatile i; - for (i = 0; i < T_MS10*s; i++); -} - -void init() { - registers_init(); - memory_init(); - clear_block(HEX0_3); clear_block(HEX4_5); clear_block(HEX6_7); - print_block("he", 2, HEX6_7); - print_block("lo", 2, HEX4_5); - print_block("you1", 4, HEX0_3); - wait(200); - clear_block(HEX0_3); clear_block(HEX4_5); clear_block(HEX6_7); -} - -char stack[5]; - -void store_value(){ - char buf[5]; - unsigned int memi = global_registers[Ssw_memi]; - memory_store(memi, Ssw_data); - sprintf(buf, "%02x", (unsigned char)memi); - print_block(buf, 2, HEX6_7); - print_block("--", 2, HEX4_5); - sprintf(buf, "%04d", global_registers[Ssw_data]); - print_block(buf, 4, HEX0_3); -} -void store_inst(){ - char inst; - char mem_index; - char reg_index; - struct InstRec inst_rec; - - // �K�v�ȏ��̎擾 - inst = global_registers[Ssw_inst]; - mem_index = global_registers[Ssw_memi]; - reg_index = global_registers[Ssw_regi]; - inst_rec.inst = (unsigned int)inst; - inst_rec.memi = (unsigned int)mem_index; - inst_rec.regi = (unsigned int)reg_index; - - // �X�g�A���� - inst_memory_store((unsigned int)global_registers[Spc], inst_rec); - global_registers[Spc]++; - - { - char buf[5]; - sprintf(buf, "%04d", inst_rec.inst); - print_block(buf, 4, HEX0_3); - sprintf(buf, "%02x", global_registers[Spc]); - print_block(buf, 2, HEX4_5); - } -} -void run_proc() { - volatile struct InstRec inst_rec; - - //print_block(" go ", 4, HEX0_3); - - global_registers[Spc] = 0; - print_block("pc", 2, HEX6_7); - do { - // pc�\�� - { - char buf[5]; - sprintf(buf, "%02x", global_registers[Spc]); - print_block(buf, 2, HEX4_5); - } - // ���߃t�F�b�` - inst_rec = inst_fetch(); - // ���߃f�R�[�h���s - inst_decode(inst_rec); - if ( global_registers[Ssw_run] ) wait(100); - }while( inst_rec.inst != INST_END ); - - //print_block(" end", 4, HEX0_3); -} - -void print_change_memory(unsigned int current_memory) { - char buf[5]; - sprintf(buf, "g %2d", current_memory); - print_block(buf, 4, HEX0_3); - print_block("an", 2, HEX4_5); - print_block("ch", 2, HEX6_7); - wait(200); - clear_block(HEX0_3); clear_block(HEX4_5); clear_block(HEX6_7); -} - -int main() -{ - init(); - while(1) { - // interrupt - in_int(); - - // event - if (PUSH_EVENT == PUSH_VALSTR) { - // �l�̃X�g�A - store_value(); - } - if (PUSH_EVENT == PUSH_INSSTR) { - // ���߂̃X�g�A - store_inst(); - } - if (PUSH_EVENT == PUSH_RUN) { - if (global_current_memory != (unsigned int)global_registers[Ssw_psel]) { - global_current_memory = (unsigned int)global_registers[Ssw_psel]; - print_change_memory(global_current_memory); - } - else { - // �v���O�������s - run_proc(); - } - } - } - return 0; -} diff --git a/software/qsys_tutorial_mem/hex_encoder.c b/software/qsys_tutorial_mem/hex_encoder.c deleted file mode 100644 index ab4eca0..0000000 --- a/software/qsys_tutorial_mem/hex_encoder.c +++ /dev/null @@ -1,205 +0,0 @@ -/* - * hex_encoder.c - * - * Created on: 2016/11/17 - * Author: takayun - */ - -#include "hex_encoder.h" -#include - -void encodeNumHex(int hex_i, int num) { - char encoded = 0; - switch (num) { - case 0: - encoded = (char)0x40; // 100 0000 - break; - case 1: - encoded = (char)0xF9; // 111 1001 - break; - case 2: - encoded = (char)0x24; // 010 0100 - break; - case 3: - encoded = (char)0x30; // 011 0000 - break; - case 4: - encoded = (char)0x19; // 001 1001 - break; - case 5: - encoded = (char)0x12; // 001 0010 - break; - case 6: - encoded = (char)0x02; // 000 0010 - break; - case 7: - encoded = (char)0x58; // 101 1000 - break; - case 8: - encoded = (char)0x00; // 000 0000 - break; - case 9: - encoded = (char)0x10; // 001 0000 - break; - default: - encoded = 0; - break; - } - - switch (hex_i) { - case 0: - *hex0 = encoded; - break; - case 1: - *hex1 = encoded; - break; - case 2: - *hex2 = encoded; - break; - case 3: - *hex3 = encoded; - break; - case 4: - *hex4 = encoded; - break; - case 5: - *hex5 = encoded; - break; - case 6: - *hex6 = encoded; - break; - case 7: - *hex7 = encoded; - break; - default: - break; - } -} - -void encodeLatHex(int hex_i, char c) { - char encoded = 0; - - if (isdigit(c)) { - encodeNumHex(hex_i, c-'0'); - return; - } - - switch (c) { - case ' ': - encoded = (char)0xFF; // 111 1111 - break; - case '-': - encoded = (char)0x3F; // 011 1111 - break; - case 'a': - encoded = (char)0x08; // 000 1000 - break; - case 'b': - encoded = (char)0x03; // 000 0011 - break; - case 'c': - encoded = (char)0x27; // 010 0111 - break; - case 'd': - encoded = (char)0x21; // 010 0001 - break; - case 'e': - encoded = (char)0x06; // 000 0110 - break; - case 'f': - encoded = (char)0x0E; // 000 1110 - break; - case 'g': - encoded = (char)0x42; // 100 0010 - break; - case 'h': - encoded = (char)0x0B; // 000 1011 - break; - case 'i': - encoded = (char)0xFB; // 111 1011 - break; - case 'j': - encoded = (char)0x61; // 110 0001 - break; - case 'k': - encoded = (char)0x0A; // 000 1010 - break; - case 'l': - encoded = (char)0x47; // 100 0111 - break; - case 'm': - encoded = (char)0x48; // 100 1000 - break; - case 'n': - encoded = (char)0x2B; // 010 1011 - break; - case 'o': - encoded = (char)0x23; // 010 0011 - break; - case 'p': - encoded = (char)0x0C; // 000 1100 - break; - case 'q': - encoded = (char)0x04; // 000 0100 - break; - case 'r': - encoded = (char)0x2F; // 010 1111 - break; - case 's': - encoded = (char)0x13; // 001 0011 - break; - case 't': - encoded = (char)0x07; // 000 0111 - break; - case 'u': - encoded = (char)0x63; // 110 0011 - break; - case 'v': - encoded = (char)0x41; // 100 0001 - break; - case 'w': - encoded = (char)0x01; // 000 0001 - break; - case 'x': - encoded = (char)0x09; // 000 1001 - break; - case 'y': - encoded = (char)0x11; // 001 0001 - break; - case 'z': - encoded = (char)0x64; // 110 0100 - break; - default: - encoded = 0; - break; - } - - switch (hex_i) { - case 0: - *hex0 = encoded; - break; - case 1: - *hex1 = encoded; - break; - case 2: - *hex2 = encoded; - break; - case 3: - *hex3 = encoded; - break; - case 4: - *hex4 = encoded; - break; - case 5: - *hex5 = encoded; - break; - case 6: - *hex6 = encoded; - break; - case 7: - *hex7 = encoded; - break; - default: - break; - } -} diff --git a/software/qsys_tutorial_mem/hex_encoder.h b/software/qsys_tutorial_mem/hex_encoder.h deleted file mode 100644 index d04473e..0000000 --- a/software/qsys_tutorial_mem/hex_encoder.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * hex_encoder.h - * - * Created on: 2016/11/17 - * Author: takayun - */ - -#ifndef HEX_ENCODER_H_ -#define HEX_ENCODER_H_ - -/************************************************** - * Defines - **************************************************/ - -#define hex0 (volatile char *) 0x0005070 -#define hex1 (volatile char *) 0x0005060 -#define hex2 (volatile char *) 0x0005050 -#define hex3 (volatile char *) 0x0005040 -#define hex4 (volatile char *) 0x0005030 -#define hex5 (volatile char *) 0x0005020 -#define hex6 (volatile char *) 0x0005010 -#define hex7 (volatile char *) 0x0005000 - -/************************************************** - * Variables - **************************************************/ - - -/************************************************** - * Functions - **************************************************/ - -void encodeNumHex(int hex_i, int num); -void encodeLatHex(int hex_i, char c); - -#endif /* HEX_ENCODER_H_ */ diff --git a/software/qsys_tutorial_mem/hex_out.c b/software/qsys_tutorial_mem/hex_out.c deleted file mode 100644 index 83b37d0..0000000 --- a/software/qsys_tutorial_mem/hex_out.c +++ /dev/null @@ -1,67 +0,0 @@ -/* - * hex_out.c - * - * Created on: 2016/11/24 - * Author: takayun - */ -#include "hex_out.h" -#include "hex_encoder.h" -#include "system.h" - -void print_block(char * str, unsigned int size, enum BLOCK_N block_i) { - int i; - if (block_i == HEX0_3) { - if (size > 4) panic(); - for (i = 0; i < size; i++) { - encodeLatHex(i,str[size-1-i]); - } - } - else if (block_i == HEX4_5) { - if (size > 2) panic(); - for (i = 0; i < size; i++) { - encodeLatHex(i+4,str[size-1-i]); - } - } - else if (block_i == HEX6_7) { - if (size > 2) panic(); - for (i = 0; i < size; i++) { - encodeLatHex(i+6,str[size-1-i]); - } - } -} - -void clear_block(enum BLOCK_N block_i) { - if (block_i == HEX0_3) { - print_block(" ", 4, HEX0_3); - } - else if (block_i == HEX4_5) { - print_block(" ", 2, HEX4_5); - } - else if (block_i == HEX6_7) { - print_block(" ", 2, HEX6_7); - } -} - -void print_number(char num) { - int i; - char buf[5]; - char val; - for (i = 0; i < 4; i++) { - if (num < 0) { - buf[0] = '-'; - val = -num; - } else { - buf[0] = ' '; - val = num; - } - buf[1] = val/100%10 + '0'; - buf[2] = val/10%10 + '0'; - buf[3] = val%10 + '0'; - } - clear_block(HEX0_3); - print_block(buf, 4, HEX0_3); -} - - - - diff --git a/software/qsys_tutorial_mem/hex_out.h b/software/qsys_tutorial_mem/hex_out.h deleted file mode 100644 index 50d6868..0000000 --- a/software/qsys_tutorial_mem/hex_out.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * hex_out.h - * - * Created on: 2016/11/24 - * Author: takayun - */ - -#ifndef HEX_IO_H_ -#define HEX_IO_H_ - -/************************************************** - * Defines - **************************************************/ - -enum BLOCK_N { - HEX0_3, HEX4_5, HEX6_7 -}; - -/************************************************** - * Variables - **************************************************/ - - -/************************************************** - * Functions - **************************************************/ - -void print_block(char * str, unsigned int size, enum BLOCK_N block_i); -void clear_block(enum BLOCK_N block_i); -void print_number(char num); - - -#endif /* HEX_IO_H_ */ diff --git a/software/qsys_tutorial_mem/input_int.c b/software/qsys_tutorial_mem/input_int.c deleted file mode 100644 index 0838b2b..0000000 --- a/software/qsys_tutorial_mem/input_int.c +++ /dev/null @@ -1,67 +0,0 @@ -/* - * input_int.c - * - * Created on: 2016/11/24 - * Author: takayun - */ -#include "input_int.h" -#include "sys_register.h" - -unsigned char PUSH_EVENT = PUSH_NONE; - -void in_int() { - push_int(); -} - -static void update_sw_reg(sw_t s) { - global_registers[Ssw_data] = (char)s.data.value; - global_registers[Ssw_inst] = (char)s.splited.instruction_code; - global_registers[Ssw_memi] = (char)s.splited.memory_index; - global_registers[Ssw_regi] = (char)s.splited.register_index; - global_registers[Ssw_psel] = (char)s.splited.program_selecter; - global_registers[Ssw_rw] = (char)s.splited.rw_mode; - global_registers[Ssw_run] = (char)s.splited.run_mode; -} - -enum PushEvent push_decode(char psw) { - switch(psw) { - case 0x3: - return PUSH_VALSTR; - break; - case 0x5: - return PUSH_INSSTR; - break; - case 0x6: - return PUSH_RUN; - break; - } - return PUSH_NONE; -} - -void push_int() { - static unsigned char status = 0; - static enum PushEvent event_code; - volatile sw_t s; - s.sw = *switches; - - switch (status) { - case 0: - PUSH_EVENT = PUSH_NONE; - if (*push_switches != 7) { - event_code = push_decode(*push_switches); - status = 1; - } - update_sw_reg(s); // �X�C�b�`���W�X�^�X�V - break; - case 1: - if (*push_switches == 7) status = 2; - break; - case 2: - PUSH_EVENT = event_code; - status = 0; - break; - default: - status = 0; - break; - } -} diff --git a/software/qsys_tutorial_mem/input_int.h b/software/qsys_tutorial_mem/input_int.h deleted file mode 100644 index 3cd8cba..0000000 --- a/software/qsys_tutorial_mem/input_int.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * input_int.h - * - * Created on: 2016/11/24 - * Author: takayun - */ - -#ifndef SWITCHES_INT_H_ -#define SWITCHES_INT_H_ - -/************************************************** - * Defines - **************************************************/ - -#define switches (volatile int *) 0x0005090 -#define push_switches (volatile char *) 0x0005080 - -typedef union { - int sw; - struct { - unsigned int run_mode : 1; - unsigned int rw_mode : 1; - unsigned int program_selecter : 4; - unsigned int memory_index : 4; - unsigned int register_index : 4; - unsigned int instruction_code : 4; - } splited; - struct { - unsigned int : 10; - unsigned int value : 8; - } data; -} sw_t; - -enum PushEvent{ - PUSH_NONE, - PUSH_ANY, - PUSH_VALSTR, - PUSH_INSSTR, - PUSH_RUN -}; - -/************************************************** - * Variables - **************************************************/ - -extern unsigned char PUSH_EVENT; - -/************************************************** - * Functions - **************************************************/ - -/* Function: in_int - * Sammary: - * �S�Ă̓��͊��荞�݂��s�� - * */ -void in_int(); - -void push_int(); - -#endif /* SWITCHES_INT_H_ */ diff --git a/software/qsys_tutorial_mem/inst_decoder.c b/software/qsys_tutorial_mem/inst_decoder.c deleted file mode 100644 index d864653..0000000 --- a/software/qsys_tutorial_mem/inst_decoder.c +++ /dev/null @@ -1,109 +0,0 @@ -/* - * inst_decoder.c - * - * Created on: 2016/11/25 - * Author: takayun - */ - -#include "inst_decoder.h" -#include "sys_memory.h" -#include "sys_register.h" -#include "hex_out.h" -#include - -struct InstRec inst_fetch(){ - return inst_memory_load((unsigned int)global_registers[Spc]++); -} - -void inst_decode(struct InstRec inst_rec){ - switch(inst_rec.inst) { - case INST_END: - break; - case INST_JUMP: - inst_jump(inst_rec.regi, inst_rec.memi); - break; - case INST_OUTPUT: - inst_output(inst_rec.regi, inst_rec.memi); - break; - case INST_LOAD: - inst_load(inst_rec.regi, inst_rec.memi); - break; - case INST_STORE: - inst_store(inst_rec.regi, inst_rec.memi); - break; - case INST_DELAY: - inst_delay(inst_rec.regi, inst_rec.memi); - break; - case INST_ADD: - inst_add(inst_rec.regi, inst_rec.memi); - break; - case INST_COMP: - inst_comp(inst_rec.regi, inst_rec.memi); - break; - case INST_JEQ: - inst_jeq(inst_rec.regi, inst_rec.memi); - break; - case INST_JNE: - inst_jne(inst_rec.regi, inst_rec.memi); - break; - case INST_JIEQ: - inst_jieq(inst_rec.regi, inst_rec.memi); - break; - case INST_JINE: - inst_jine(inst_rec.regi, inst_rec.memi); - break; - } -} - -void inst_jump(enum Register reg, unsigned char memory_index){ - global_registers[Spc]=global_registers[reg]+memory_index; -} -void inst_output(enum Register reg, unsigned char memory_index){ - //�������̒l��7�Z�O�ɕ\�� - char buf[5]; - memory_load(memory_index, Sseg); - sprintf(buf, "%04d", global_registers[Sseg]); - print_block(buf, 4, HEX0_3); -} -void inst_load(enum Register reg, unsigned char memory_index){ - memory_load(memory_index, reg); -} -void inst_store(enum Register reg, unsigned char memory_index){ - memory_store(memory_index, reg); -} -void inst_delay(enum Register reg, unsigned char memory_index){ - //���W�X�^�̒l*10ms�҂� -} -void inst_add(enum Register reg, unsigned char memory_index){ - global_registers[Sacc]+=global_registers[reg]; -} -void inst_comp(enum Register reg, unsigned char memory_index){ - if(global_registers[Sacc]==global_registers[reg]){ - global_registers[Sflg]=0; - } else if(global_registers[Sacc] > global_registers[reg]){ - global_registers[Sflg]=-1; - }else{ - global_registers[Sflg]=1; - } -} -void inst_jeq(enum Register reg, unsigned char memory_index){ - if(global_registers[Sflg]==global_registers[reg]){ - global_registers[Spc]++; - } -} -void inst_jne(enum Register reg, unsigned char memory_index){ - if(global_registers[Sflg]!=global_registers[reg]){ - global_registers[Spc]++; - } -} -void inst_jieq(char im, unsigned char memory_index){ - if(global_registers[Sflg]==im){ - global_registers[Spc]++; - } -} -void inst_jine(char im, unsigned char memory_index){ - if(global_registers[Sflg]!=im){ - global_registers[Spc]++; - } -} - diff --git a/software/qsys_tutorial_mem/inst_decoder.h b/software/qsys_tutorial_mem/inst_decoder.h deleted file mode 100644 index 9860750..0000000 --- a/software/qsys_tutorial_mem/inst_decoder.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * inst_decoder.h - * - * Created on: 2016/11/25 - * Author: takayun - */ - -#ifndef INST_DECODER_H_ -#define INST_DECODER_H_ - -#include "sys_register.h" - -#define INST_END 0x0 -#define INST_JUMP 0x1 -#define INST_OUTPUT 0x2 -#define INST_LOAD 0x3 -#define INST_STORE 0x4 -#define INST_DELAY 0x5 -#define INST_ADD 0x6 -#define INST_COMP 0x7 -#define INST_JEQ 0x8 -#define INST_JNE 0x9 -#define INST_JIEQ 0xA -#define INST_JINE 0xB - -struct InstRec { - unsigned int inst : 4; - unsigned int memi : 4; - unsigned int regi : 4; -}; - -struct InstRec inst_fetch(); - -void inst_decode(struct InstRec inst_rec); - -void inst_jump(enum Register reg, unsigned char memory_index); -void inst_output(enum Register reg, unsigned char memory_index); -void inst_load(enum Register reg, unsigned char memory_index); -void inst_store(enum Register reg, unsigned char memory_index); -void inst_delay(enum Register reg, unsigned char memory_index); -void inst_add(enum Register reg, unsigned char memory_index); -void inst_comp(enum Register reg, unsigned char memory_index); -void inst_jeq(enum Register reg, unsigned char memory_index); -void inst_jne(enum Register reg, unsigned char memory_index); -void inst_jieq(char im, unsigned char memory_index); -void inst_jine(char im, unsigned char memory_index); - - -#endif /* INST_DECODER_H_ */ diff --git a/software/qsys_tutorial_mem/obj/default/hello_world_small.d b/software/qsys_tutorial_mem/obj/default/hello_world_small.d deleted file mode 100644 index b00655c..0000000 --- a/software/qsys_tutorial_mem/obj/default/hello_world_small.d +++ /dev/null @@ -1,17 +0,0 @@ -obj/default/hello_world_small.o: hello_world_small.c \ - ../qsys_tutorial_mem_bsp//HAL/inc/sys/alt_stdio.h system.h hex_out.h \ - sys_register.h sys_memory.h inst_decoder.h input_int.h - -../qsys_tutorial_mem_bsp//HAL/inc/sys/alt_stdio.h: - -system.h: - -hex_out.h: - -sys_register.h: - -sys_memory.h: - -inst_decoder.h: - -input_int.h: diff --git a/software/qsys_tutorial_mem/obj/default/hello_world_small.o b/software/qsys_tutorial_mem/obj/default/hello_world_small.o deleted file mode 100644 index cc4b941..0000000 --- a/software/qsys_tutorial_mem/obj/default/hello_world_small.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem/obj/default/hex_encoder.d b/software/qsys_tutorial_mem/obj/default/hex_encoder.d deleted file mode 100644 index e913210..0000000 --- a/software/qsys_tutorial_mem/obj/default/hex_encoder.d +++ /dev/null @@ -1,3 +0,0 @@ -obj/default/hex_encoder.o: hex_encoder.c hex_encoder.h - -hex_encoder.h: diff --git a/software/qsys_tutorial_mem/obj/default/hex_encoder.o b/software/qsys_tutorial_mem/obj/default/hex_encoder.o deleted file mode 100644 index 323d9ee..0000000 --- a/software/qsys_tutorial_mem/obj/default/hex_encoder.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem/obj/default/hex_out.d b/software/qsys_tutorial_mem/obj/default/hex_out.d deleted file mode 100644 index 1000db0..0000000 --- a/software/qsys_tutorial_mem/obj/default/hex_out.d +++ /dev/null @@ -1,7 +0,0 @@ -obj/default/hex_out.o: hex_out.c hex_out.h hex_encoder.h system.h - -hex_out.h: - -hex_encoder.h: - -system.h: diff --git a/software/qsys_tutorial_mem/obj/default/hex_out.o b/software/qsys_tutorial_mem/obj/default/hex_out.o deleted file mode 100644 index b3f7c7f..0000000 --- a/software/qsys_tutorial_mem/obj/default/hex_out.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem/obj/default/input_int.d b/software/qsys_tutorial_mem/obj/default/input_int.d deleted file mode 100644 index 25051be..0000000 --- a/software/qsys_tutorial_mem/obj/default/input_int.d +++ /dev/null @@ -1,5 +0,0 @@ -obj/default/input_int.o: input_int.c input_int.h sys_register.h - -input_int.h: - -sys_register.h: diff --git a/software/qsys_tutorial_mem/obj/default/input_int.o b/software/qsys_tutorial_mem/obj/default/input_int.o deleted file mode 100644 index dba96c1..0000000 --- a/software/qsys_tutorial_mem/obj/default/input_int.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem/obj/default/inst_decoder.d b/software/qsys_tutorial_mem/obj/default/inst_decoder.d deleted file mode 100644 index 3e61d10..0000000 --- a/software/qsys_tutorial_mem/obj/default/inst_decoder.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/default/inst_decoder.o: inst_decoder.c inst_decoder.h sys_register.h \ - sys_memory.h hex_out.h - -inst_decoder.h: - -sys_register.h: - -sys_memory.h: - -hex_out.h: diff --git a/software/qsys_tutorial_mem/obj/default/inst_decoder.o b/software/qsys_tutorial_mem/obj/default/inst_decoder.o deleted file mode 100644 index 1536c61..0000000 --- a/software/qsys_tutorial_mem/obj/default/inst_decoder.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem/obj/default/sys_memory.d b/software/qsys_tutorial_mem/obj/default/sys_memory.d deleted file mode 100644 index 52d4dcd..0000000 --- a/software/qsys_tutorial_mem/obj/default/sys_memory.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/default/sys_memory.o: sys_memory.c system.h sys_memory.h \ - sys_register.h inst_decoder.h - -system.h: - -sys_memory.h: - -sys_register.h: - -inst_decoder.h: diff --git a/software/qsys_tutorial_mem/obj/default/sys_memory.o b/software/qsys_tutorial_mem/obj/default/sys_memory.o deleted file mode 100644 index ccb6584..0000000 --- a/software/qsys_tutorial_mem/obj/default/sys_memory.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem/obj/default/sys_register.d b/software/qsys_tutorial_mem/obj/default/sys_register.d deleted file mode 100644 index ec29589..0000000 --- a/software/qsys_tutorial_mem/obj/default/sys_register.d +++ /dev/null @@ -1,3 +0,0 @@ -obj/default/sys_register.o: sys_register.c sys_register.h - -sys_register.h: diff --git a/software/qsys_tutorial_mem/obj/default/sys_register.o b/software/qsys_tutorial_mem/obj/default/sys_register.o deleted file mode 100644 index 2dd0378..0000000 --- a/software/qsys_tutorial_mem/obj/default/sys_register.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem/obj/default/system.d b/software/qsys_tutorial_mem/obj/default/system.d deleted file mode 100644 index 6c906ae..0000000 --- a/software/qsys_tutorial_mem/obj/default/system.d +++ /dev/null @@ -1,5 +0,0 @@ -obj/default/system.o: system.c system.h hex_out.h - -system.h: - -hex_out.h: diff --git a/software/qsys_tutorial_mem/obj/default/system.o b/software/qsys_tutorial_mem/obj/default/system.o deleted file mode 100644 index 0524d81..0000000 --- a/software/qsys_tutorial_mem/obj/default/system.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem/qsys_tutorial_mem.elf b/software/qsys_tutorial_mem/qsys_tutorial_mem.elf deleted file mode 100644 index e3a5c54..0000000 --- a/software/qsys_tutorial_mem/qsys_tutorial_mem.elf +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem/qsys_tutorial_mem.map b/software/qsys_tutorial_mem/qsys_tutorial_mem.map deleted file mode 100644 index 148d946..0000000 --- a/software/qsys_tutorial_mem/qsys_tutorial_mem.map +++ /dev/null @@ -1,753 +0,0 @@ -Archive member included because of file (symbol) - -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-divmod.o) - obj/default/hex_out.o (__divsi3) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-mul.o) - obj/default/hello_world_small.o (__mulsi3) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-ctype_.o) - obj/default/hex_encoder.o (__ctype_ptr) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-sprintf.o) - obj/default/hello_world_small.o (sprintf) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-vfprintf.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-sprintf.o) (___vfprintf_internal_r) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-fvwrite_small_str.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-sprintf.o) (__sfvwrite_small_str) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-impure.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-sprintf.o) (_impure_ptr) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-memmove.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-fvwrite_small_str.o) (memmove) -c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-strlen.o) - c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-vfprintf.o) (strlen) -../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_load.o) - ../qsys_tutorial_mem_bsp//obj/HAL/src/crt0.o (alt_load) -../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_main.o) - ../qsys_tutorial_mem_bsp//obj/HAL/src/crt0.o (alt_main) -../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_sys_init.o) - ../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_main.o) (alt_sys_init) -../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - ../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_load.o) (alt_dcache_flush_all) -../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - ../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_load.o) (alt_icache_flush_all) -../qsys_tutorial_mem_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - ../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_sys_init.o) (altera_nios2_qsys_irq_init) - -Allocating common symbols -Common symbol size file - -stack 0x5 obj/default/hello_world_small.o -global_registers 0xf obj/default/sys_register.o - -Memory Configuration - -Name Origin Length Attributes -reset 0x00000000 0x00000020 -onchip_memory 0x00000020 0x00003fe0 -*default* 0x00000000 0xffffffff - -Linker script and memory map - -LOAD ../qsys_tutorial_mem_bsp//obj/HAL/src/crt0.o - 0x0000000c exit = _exit -LOAD obj/default/hello_world_small.o -LOAD obj/default/hex_encoder.o -LOAD obj/default/hex_out.o -LOAD obj/default/input_int.o -LOAD obj/default/inst_decoder.o -LOAD obj/default/sys_memory.o -LOAD obj/default/sys_register.o -LOAD obj/default/system.o -LOAD c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libstdc++.a -LOAD c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libm.a -LOAD c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a -START GROUP -LOAD c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a -LOAD c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a -LOAD ../qsys_tutorial_mem_bsp/\libhal_bsp.a -END GROUP -LOAD c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a - 0x00000000 __alt_mem_onchip_memory = 0x0 - -.entry 0x00000000 0x20 - *(.entry) - .entry 0x00000000 0x20 ../qsys_tutorial_mem_bsp//obj/HAL/src/crt0.o - 0x00000000 __reset - 0x0000000c _exit - -.exceptions 0x00000020 0x0 - 0x00000020 PROVIDE (__ram_exceptions_start, ABSOLUTE (.)) - 0x00000020 . = ALIGN (0x20) - *(.irq) - *(.exceptions.entry.label) - *(.exceptions.entry.user) - *(.exceptions.entry) - *(.exceptions.irqtest.user) - *(.exceptions.irqtest) - *(.exceptions.irqhandler.user) - *(.exceptions.irqhandler) - *(.exceptions.irqreturn.user) - *(.exceptions.irqreturn) - *(.exceptions.notirq.label) - *(.exceptions.notirq.user) - *(.exceptions.notirq) - *(.exceptions.soft.user) - *(.exceptions.soft) - *(.exceptions.unknown.user) - *(.exceptions.unknown) - *(.exceptions.exit.label) - *(.exceptions.exit.user) - *(.exceptions.exit) - *(.exceptions) - 0x00000020 PROVIDE (__ram_exceptions_end, ABSOLUTE (.)) - 0x00000020 PROVIDE (__flash_exceptions_start, LOADADDR (.exceptions)) - -.text 0x00000020 0x1d1c - 0x00000020 PROVIDE (stext, ABSOLUTE (.)) - *(.interp) - *(.hash) - *(.dynsym) - *(.dynstr) - *(.gnu.version) - *(.gnu.version_d) - *(.gnu.version_r) - *(.rel.init) - *(.rela.init) - *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) - *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) - *(.rel.fini) - *(.rela.fini) - *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) - *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) - *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) - *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) - *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) - *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) - *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) - *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) - *(.rel.ctors) - *(.rela.ctors) - *(.rel.dtors) - *(.rela.dtors) - *(.rel.got) - *(.rela.got) - *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) - *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) - *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) - *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) - *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) - *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) - *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) - *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) - *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) - *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) - *(.rel.plt) - *(.rela.plt) - *(.rel.dyn) - *(.init) - *(.plt) - *(.text .stub .text.* .gnu.linkonce.t.*) - .text 0x00000020 0x3c ../qsys_tutorial_mem_bsp//obj/HAL/src/crt0.o - 0x00000020 _start - .text 0x0000005c 0x408 obj/default/hello_world_small.o - 0x0000005c wait - 0x00000098 print_change_memory - 0x00000130 run_proc - 0x000001d0 store_inst - 0x000002a0 store_value - 0x00000344 init - 0x000003e8 main - .text 0x00000464 0x3b8 obj/default/hex_encoder.o - 0x00000464 encodeNumHex - 0x00000588 encodeLatHex - .text 0x0000081c 0x228 obj/default/hex_out.o - 0x0000081c print_block - 0x000008f8 clear_block - 0x00000948 print_number - .text 0x00000a44 0x180 obj/default/input_int.o - 0x00000a44 push_decode - 0x00000a84 push_int - 0x00000bc0 in_int - .text 0x00000bc4 0x334 obj/default/inst_decoder.o - 0x00000bc4 inst_jump - 0x00000be0 inst_delay - 0x00000be4 inst_add - 0x00000c04 inst_comp - 0x00000c3c inst_jeq - 0x00000c64 inst_jne - 0x00000c8c inst_jieq - 0x00000cb8 inst_jine - 0x00000ce4 inst_store - 0x00000cf4 inst_load - 0x00000d04 inst_output - 0x00000d50 inst_fetch - 0x00000d88 inst_decode - .text 0x00000ef8 0x220 obj/default/sys_memory.o - 0x00000ef8 memory_init - 0x00000f3c inst_memory_store - 0x00000fbc inst_memory_load - 0x00001038 memory_load - 0x000010a8 memory_store - .text 0x00001118 0x1c obj/default/sys_register.o - 0x00001118 registers_init - .text 0x00001134 0x2c obj/default/system.o - 0x00001134 panic - .text 0x00001160 0x14c c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-divmod.o) - 0x000011dc __divsi3 - 0x0000123c __modsi3 - 0x0000129c __udivsi3 - 0x000012a4 __umodsi3 - .text 0x000012ac 0x38 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-mul.o) - 0x000012ac __mulsi3 - .text 0x000012e4 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-ctype_.o) - .text 0x000012e4 0xf4 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-sprintf.o) - 0x000012e4 sprintf - 0x00001368 _sprintf_r - .text 0x000013d8 0x740 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-vfprintf.o) - 0x00001458 ___vfprintf_internal_r - 0x00001af4 __vfprintf_internal - .text 0x00001b18 0xb8 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-fvwrite_small_str.o) - 0x00001b18 __sfvwrite_small_str - .text 0x00001bd0 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-impure.o) - .text 0x00001bd0 0x60 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-memmove.o) - 0x00001bd0 memmove - .text 0x00001c30 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-strlen.o) - 0x00001c30 strlen - .text 0x00001c50 0x8c ../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_load.o) - 0x00001c70 alt_load - .text 0x00001cdc 0x2c ../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_main.o) - 0x00001cdc alt_main - .text 0x00001d08 0x24 ../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_sys_init.o) - 0x00001d08 alt_sys_init - 0x00001d0c alt_irq_init - .text 0x00001d2c 0x4 ../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - 0x00001d2c alt_dcache_flush_all - .text 0x00001d30 0x4 ../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - 0x00001d30 alt_icache_flush_all - .text 0x00001d34 0x8 ../qsys_tutorial_mem_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - 0x00001d34 altera_nios2_qsys_irq_init - *(.gnu.warning.*) - *(.fini) - 0x00001d3c PROVIDE (__etext, ABSOLUTE (.)) - 0x00001d3c PROVIDE (_etext, ABSOLUTE (.)) - 0x00001d3c PROVIDE (etext, ABSOLUTE (.)) - *(.eh_frame_hdr) - 0x00001d3c . = ALIGN (0x4) - 0x00001d3c PROVIDE (__preinit_array_start, ABSOLUTE (.)) - *(.preinit_array) - 0x00001d3c PROVIDE (__preinit_array_end, ABSOLUTE (.)) - 0x00001d3c PROVIDE (__init_array_start, ABSOLUTE (.)) - *(.init_array) - 0x00001d3c PROVIDE (__init_array_end, ABSOLUTE (.)) - 0x00001d3c PROVIDE (__fini_array_start, ABSOLUTE (.)) - *(.fini_array) - 0x00001d3c PROVIDE (__fini_array_end, ABSOLUTE (.)) - *(.eh_frame) - *(.gcc_except_table) - *(.dynamic) - 0x00001d3c PROVIDE (__CTOR_LIST__, ABSOLUTE (.)) - *(.ctors) - *(SORT(.ctors.*)) - 0x00001d3c PROVIDE (__CTOR_END__, ABSOLUTE (.)) - 0x00001d3c PROVIDE (__DTOR_LIST__, ABSOLUTE (.)) - *(.dtors) - *(SORT(.dtors.*)) - 0x00001d3c PROVIDE (__DTOR_END__, ABSOLUTE (.)) - *(.jcr) - 0x00001d3c . = ALIGN (0x4) - -.rodata 0x00001d3c 0x2d0 - 0x00001d3c PROVIDE (__ram_rodata_start, ABSOLUTE (.)) - 0x00001d3c . = ALIGN (0x4) - *(.rodata .rodata.* .gnu.linkonce.r.*) - .rodata.str1.4 - 0x00001d3c 0x35 obj/default/hello_world_small.o - 0x38 (size before relaxing) - *fill* 0x00001d71 0x3 00 - .rodata.str1.4 - 0x00001d74 0xb obj/default/hex_out.o - 0xc (size before relaxing) - .rodata.str1.4 - 0x00000000 0x8 obj/default/inst_decoder.o - *fill* 0x00001d7f 0x1 00 - .rodata.str1.4 - 0x00001d80 0x8 obj/default/system.o - .rodata 0x00001d88 0x281 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-ctype_.o) - 0x00001d88 _ctype_ - *(.rodata1) - 0x0000200c . = ALIGN (0x4) - *fill* 0x00002009 0x3 00 - 0x0000200c PROVIDE (__ram_rodata_end, ABSOLUTE (.)) - 0x00001d3c PROVIDE (__flash_rodata_start, LOADADDR (.rodata)) - -.rwdata 0x0000200c 0xf0 load address 0x000020fc - 0x0000200c PROVIDE (__ram_rwdata_start, ABSOLUTE (.)) - 0x0000200c . = ALIGN (0x4) - *(.got.plt) - *(.got) - *(.data1) - *(.data .data.* .gnu.linkonce.d.*) - .data 0x0000200c 0x0 ../qsys_tutorial_mem_bsp//obj/HAL/src/crt0.o - .data 0x0000200c 0x0 obj/default/hello_world_small.o - .data 0x0000200c 0x0 obj/default/hex_encoder.o - .data 0x0000200c 0x0 obj/default/hex_out.o - .data 0x0000200c 0x0 obj/default/input_int.o - .data 0x0000200c 0x0 obj/default/inst_decoder.o - .data 0x0000200c 0x0 obj/default/sys_memory.o - .data 0x0000200c 0x0 obj/default/sys_register.o - .data 0x0000200c 0x0 obj/default/system.o - .data 0x0000200c 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-divmod.o) - .data 0x0000200c 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-mul.o) - .data 0x0000200c 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-ctype_.o) - .data 0x0000200c 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-sprintf.o) - .data 0x0000200c 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-vfprintf.o) - .data 0x0000200c 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-fvwrite_small_str.o) - .data 0x0000200c 0xe0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-impure.o) - .data 0x000020ec 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-memmove.o) - .data 0x000020ec 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-strlen.o) - .data 0x000020ec 0x0 ../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_load.o) - .data 0x000020ec 0x0 ../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_main.o) - .data 0x000020ec 0x0 ../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_sys_init.o) - .data 0x000020ec 0x0 ../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .data 0x000020ec 0x0 ../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .data 0x000020ec 0x0 ../qsys_tutorial_mem_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - 0x0000a0ec _gp = ABSOLUTE ((. + 0x8000)) - 0x0000a0ec PROVIDE (gp, _gp) - *(.rwdata .rwdata.*) - *(.sdata .sdata.* .gnu.linkonce.s.*) - .sdata 0x000020ec 0x4 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-ctype_.o) - 0x000020ec __ctype_ptr - .sdata 0x000020f0 0x8 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-impure.o) - 0x000020f0 _impure_ptr - 0x000020f4 _global_impure_ptr - .sdata 0x000020f8 0x4 ../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_sys_init.o) - 0x000020f8 jtag_uart - *(.sdata2 .sdata2.* .gnu.linkonce.s2.*) - 0x000020fc . = ALIGN (0x4) - 0x000020fc _edata = ABSOLUTE (.) - 0x000020fc PROVIDE (edata, ABSOLUTE (.)) - 0x000020fc PROVIDE (__ram_rwdata_end, ABSOLUTE (.)) - 0x000020fc PROVIDE (__flash_rwdata_start, LOADADDR (.rwdata)) - -.bss 0x000021ec 0x174 - 0x000021ec __bss_start = ABSOLUTE (.) - 0x000021ec PROVIDE (__sbss_start, ABSOLUTE (.)) - 0x000021ec PROVIDE (___sbss_start, ABSOLUTE (.)) - *(.dynsbss) - *(.sbss .sbss.* .gnu.linkonce.sb.*) - .sbss 0x000021ec 0x5 obj/default/hello_world_small.o - 0x000021ec stack - *fill* 0x000021f1 0x3 00 - .sbss 0x000021f4 0xc obj/default/input_int.o - 0x000021f4 PUSH_EVENT - .sbss 0x00002200 0x4 obj/default/sys_memory.o - 0x00002200 global_current_memory - .sbss 0x00002204 0xc ../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_main.o) - 0x00002204 alt_argc - 0x00002208 alt_argv - 0x0000220c alt_envp - *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) - *(.scommon) - 0x00002210 PROVIDE (__sbss_end, ABSOLUTE (.)) - 0x00002210 PROVIDE (___sbss_end, ABSOLUTE (.)) - *(.dynbss) - *(.bss .bss.* .gnu.linkonce.b.*) - .bss 0x00002210 0x0 ../qsys_tutorial_mem_bsp//obj/HAL/src/crt0.o - .bss 0x00002210 0x0 obj/default/hello_world_small.o - .bss 0x00002210 0x0 obj/default/hex_encoder.o - .bss 0x00002210 0x0 obj/default/hex_out.o - .bss 0x00002210 0x0 obj/default/input_int.o - .bss 0x00002210 0x0 obj/default/inst_decoder.o - .bss 0x00002210 0x140 obj/default/sys_memory.o - .bss 0x00002350 0x0 obj/default/sys_register.o - .bss 0x00002350 0x0 obj/default/system.o - .bss 0x00002350 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-divmod.o) - .bss 0x00002350 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-mul.o) - .bss 0x00002350 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-ctype_.o) - .bss 0x00002350 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-sprintf.o) - .bss 0x00002350 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-vfprintf.o) - .bss 0x00002350 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-fvwrite_small_str.o) - .bss 0x00002350 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-impure.o) - .bss 0x00002350 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-memmove.o) - .bss 0x00002350 0x0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-strlen.o) - .bss 0x00002350 0x0 ../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_load.o) - .bss 0x00002350 0x0 ../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_main.o) - .bss 0x00002350 0x0 ../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_sys_init.o) - .bss 0x00002350 0x0 ../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .bss 0x00002350 0x0 ../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .bss 0x00002350 0x0 ../qsys_tutorial_mem_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - *(COMMON) - COMMON 0x00002350 0xf obj/default/sys_register.o - 0x00002350 global_registers - 0x00002360 . = ALIGN (0x4) - *fill* 0x0000235f 0x1 00 - 0x00002360 __bss_end = ABSOLUTE (.) - -.onchip_memory 0x00002360 0x0 - 0x00002360 PROVIDE (_alt_partition_onchip_memory_start, ABSOLUTE (.)) - *(.onchip_memory. onchip_memory.*) - 0x00002360 . = ALIGN (0x4) - 0x00002360 PROVIDE (_alt_partition_onchip_memory_end, ABSOLUTE (.)) - 0x00002360 _end = ABSOLUTE (.) - 0x00002360 end = ABSOLUTE (.) - 0x00002360 __alt_stack_base = ABSOLUTE (.) - 0x00002360 PROVIDE (_alt_partition_onchip_memory_load_addr, LOADADDR (.onchip_memory)) - -.stab - *(.stab) - -.stabstr - *(.stabstr) - -.stab.excl - *(.stab.excl) - -.stab.exclstr - *(.stab.exclstr) - -.stab.index - *(.stab.index) - -.stab.indexstr - *(.stab.indexstr) - -.comment 0x00000000 0x26 - *(.comment) - .comment 0x00000000 0x26 obj/default/hello_world_small.o - 0x27 (size before relaxing) - .comment 0x00000000 0x27 obj/default/hex_encoder.o - .comment 0x00000000 0x27 obj/default/hex_out.o - .comment 0x00000000 0x27 obj/default/input_int.o - .comment 0x00000000 0x27 obj/default/inst_decoder.o - .comment 0x00000000 0x27 obj/default/sys_memory.o - .comment 0x00000000 0x27 obj/default/sys_register.o - .comment 0x00000000 0x27 obj/default/system.o - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-divmod.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-mul.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-ctype_.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-sprintf.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-vfprintf.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-fvwrite_small_str.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-impure.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-memmove.o) - .comment 0x00000000 0x27 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-strlen.o) - .comment 0x00000000 0x27 ../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_load.o) - .comment 0x00000000 0x27 ../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_main.o) - .comment 0x00000000 0x27 ../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_sys_init.o) - .comment 0x00000000 0x27 ../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .comment 0x00000000 0x27 ../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .comment 0x00000000 0x27 ../qsys_tutorial_mem_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - -.debug - *(.debug) - -.line - *(.line) - -.debug_srcinfo - *(.debug_srcinfo) - -.debug_sfnames - *(.debug_sfnames) - -.debug_aranges 0x00000000 0x2c8 - *(.debug_aranges) - .debug_aranges - 0x00000000 0x28 ../qsys_tutorial_mem_bsp//obj/HAL/src/crt0.o - .debug_aranges - 0x00000028 0x20 obj/default/hello_world_small.o - .debug_aranges - 0x00000048 0x20 obj/default/hex_encoder.o - .debug_aranges - 0x00000068 0x20 obj/default/hex_out.o - .debug_aranges - 0x00000088 0x20 obj/default/input_int.o - .debug_aranges - 0x000000a8 0x20 obj/default/inst_decoder.o - .debug_aranges - 0x000000c8 0x20 obj/default/sys_memory.o - .debug_aranges - 0x000000e8 0x20 obj/default/sys_register.o - .debug_aranges - 0x00000108 0x20 obj/default/system.o - .debug_aranges - 0x00000128 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-divmod.o) - .debug_aranges - 0x00000148 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-mul.o) - .debug_aranges - 0x00000168 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-sprintf.o) - .debug_aranges - 0x00000188 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-vfprintf.o) - .debug_aranges - 0x000001a8 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-fvwrite_small_str.o) - .debug_aranges - 0x000001c8 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-memmove.o) - .debug_aranges - 0x000001e8 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-strlen.o) - .debug_aranges - 0x00000208 0x20 ../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_load.o) - .debug_aranges - 0x00000228 0x20 ../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_main.o) - .debug_aranges - 0x00000248 0x20 ../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_sys_init.o) - .debug_aranges - 0x00000268 0x20 ../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .debug_aranges - 0x00000288 0x20 ../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .debug_aranges - 0x000002a8 0x20 ../qsys_tutorial_mem_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - -.debug_pubnames - 0x00000000 0x5b9 - *(.debug_pubnames) - .debug_pubnames - 0x00000000 0x7b obj/default/hello_world_small.o - .debug_pubnames - 0x0000007b 0x34 obj/default/hex_encoder.o - .debug_pubnames - 0x000000af 0x43 obj/default/hex_out.o - .debug_pubnames - 0x000000f2 0x49 obj/default/input_int.o - .debug_pubnames - 0x0000013b 0xcc obj/default/inst_decoder.o - .debug_pubnames - 0x00000207 0x88 obj/default/sys_memory.o - .debug_pubnames - 0x0000028f 0x3a obj/default/sys_register.o - .debug_pubnames - 0x000002c9 0x1c obj/default/system.o - .debug_pubnames - 0x000002e5 0x48 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-divmod.o) - .debug_pubnames - 0x0000032d 0x1f c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-mul.o) - .debug_pubnames - 0x0000034c 0x2e c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-ctype_.o) - .debug_pubnames - 0x0000037a 0x2d c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-sprintf.o) - .debug_pubnames - 0x000003a7 0x45 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-vfprintf.o) - .debug_pubnames - 0x000003ec 0x2b c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-fvwrite_small_str.o) - .debug_pubnames - 0x00000417 0x39 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-impure.o) - .debug_pubnames - 0x00000450 0x1e c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-memmove.o) - .debug_pubnames - 0x0000046e 0x1d c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-strlen.o) - .debug_pubnames - 0x0000048b 0x1f ../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_load.o) - .debug_pubnames - 0x000004aa 0x46 ../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_main.o) - .debug_pubnames - 0x000004f0 0x42 ../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_sys_init.o) - .debug_pubnames - 0x00000532 0x2b ../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .debug_pubnames - 0x0000055d 0x2b ../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .debug_pubnames - 0x00000588 0x31 ../qsys_tutorial_mem_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - -.debug_info 0x00000000 0x39d5 - *(.debug_info .gnu.linkonce.wi.*) - .debug_info 0x00000000 0x81 ../qsys_tutorial_mem_bsp//obj/HAL/src/crt0.o - .debug_info 0x00000081 0x28d obj/default/hello_world_small.o - .debug_info 0x0000030e 0xd2 obj/default/hex_encoder.o - .debug_info 0x000003e0 0x145 obj/default/hex_out.o - .debug_info 0x00000525 0x245 obj/default/input_int.o - .debug_info 0x0000076a 0x526 obj/default/inst_decoder.o - .debug_info 0x00000c90 0x272 obj/default/sys_memory.o - .debug_info 0x00000f02 0x7d obj/default/sys_register.o - .debug_info 0x00000f7f 0x3a obj/default/system.o - .debug_info 0x00000fb9 0x21c c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-divmod.o) - .debug_info 0x000011d5 0xf3 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-mul.o) - .debug_info 0x000012c8 0xa0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-ctype_.o) - .debug_info 0x00001368 0x7e7 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-sprintf.o) - .debug_info 0x00001b4f 0x9b6 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-vfprintf.o) - .debug_info 0x00002505 0x75f c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-fvwrite_small_str.o) - .debug_info 0x00002c64 0x636 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-impure.o) - .debug_info 0x0000329a 0x102 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-memmove.o) - .debug_info 0x0000339c 0xc2 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-strlen.o) - .debug_info 0x0000345e 0x12e ../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_load.o) - .debug_info 0x0000358c 0x125 ../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_main.o) - .debug_info 0x000036b1 0x17d ../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_sys_init.o) - .debug_info 0x0000382e 0x8d ../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .debug_info 0x000038bb 0x8d ../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .debug_info 0x00003948 0x8d ../qsys_tutorial_mem_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - -.debug_abbrev 0x00000000 0x13f4 - *(.debug_abbrev) - .debug_abbrev 0x00000000 0x12 ../qsys_tutorial_mem_bsp//obj/HAL/src/crt0.o - .debug_abbrev 0x00000012 0x145 obj/default/hello_world_small.o - .debug_abbrev 0x00000157 0x9e obj/default/hex_encoder.o - .debug_abbrev 0x000001f5 0xc7 obj/default/hex_out.o - .debug_abbrev 0x000002bc 0x185 obj/default/input_int.o - .debug_abbrev 0x00000441 0x186 obj/default/inst_decoder.o - .debug_abbrev 0x000005c7 0x13d obj/default/sys_memory.o - .debug_abbrev 0x00000704 0x6f obj/default/sys_register.o - .debug_abbrev 0x00000773 0x27 obj/default/system.o - .debug_abbrev 0x0000079a 0xe0 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-divmod.o) - .debug_abbrev 0x0000087a 0x7b c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-mul.o) - .debug_abbrev 0x000008f5 0x61 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-ctype_.o) - .debug_abbrev 0x00000956 0x179 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-sprintf.o) - .debug_abbrev 0x00000acf 0x263 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-vfprintf.o) - .debug_abbrev 0x00000d32 0x184 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-fvwrite_small_str.o) - .debug_abbrev 0x00000eb6 0x13f c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-impure.o) - .debug_abbrev 0x00000ff5 0xa8 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-memmove.o) - .debug_abbrev 0x0000109d 0x7a c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-strlen.o) - .debug_abbrev 0x00001117 0x97 ../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_load.o) - .debug_abbrev 0x000011ae 0xa6 ../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_main.o) - .debug_abbrev 0x00001254 0xe3 ../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_sys_init.o) - .debug_abbrev 0x00001337 0x3f ../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .debug_abbrev 0x00001376 0x3f ../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .debug_abbrev 0x000013b5 0x3f ../qsys_tutorial_mem_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - -.debug_line 0x00000000 0x374c - *(.debug_line) - .debug_line 0x00000000 0x66 ../qsys_tutorial_mem_bsp//obj/HAL/src/crt0.o - .debug_line 0x00000066 0x53c obj/default/hello_world_small.o - .debug_line 0x000005a2 0x2b7 obj/default/hex_encoder.o - .debug_line 0x00000859 0x1f5 obj/default/hex_out.o - .debug_line 0x00000a4e 0x1d9 obj/default/input_int.o - .debug_line 0x00000c27 0x44c obj/default/inst_decoder.o - .debug_line 0x00001073 0x18f obj/default/sys_memory.o - .debug_line 0x00001202 0x87 obj/default/sys_register.o - .debug_line 0x00001289 0x94 obj/default/system.o - .debug_line 0x0000131d 0x24f c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-divmod.o) - .debug_line 0x0000156c 0x11a c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-mul.o) - .debug_line 0x00001686 0x81 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-ctype_.o) - .debug_line 0x00001707 0x365 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-sprintf.o) - .debug_line 0x00001a6c 0x666 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-vfprintf.o) - .debug_line 0x000020d2 0x2cf c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-fvwrite_small_str.o) - .debug_line 0x000023a1 0x230 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-impure.o) - .debug_line 0x000025d1 0x294 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-memmove.o) - .debug_line 0x00002865 0x250 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-strlen.o) - .debug_line 0x00002ab5 0x217 ../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_load.o) - .debug_line 0x00002ccc 0x2c2 ../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_main.o) - .debug_line 0x00002f8e 0x286 ../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_sys_init.o) - .debug_line 0x00003214 0x1b5 ../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .debug_line 0x000033c9 0x1b5 ../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .debug_line 0x0000357e 0x1ce ../qsys_tutorial_mem_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - -.debug_frame 0x00000000 0x5ec - *(.debug_frame) - .debug_frame 0x00000000 0xd4 obj/default/hello_world_small.o - .debug_frame 0x000000d4 0x30 obj/default/hex_encoder.o - .debug_frame 0x00000104 0x5c obj/default/hex_out.o - .debug_frame 0x00000160 0x44 obj/default/input_int.o - .debug_frame 0x000001a4 0xf0 obj/default/inst_decoder.o - .debug_frame 0x00000294 0x78 obj/default/sys_memory.o - .debug_frame 0x0000030c 0x20 obj/default/sys_register.o - .debug_frame 0x0000032c 0x28 obj/default/system.o - .debug_frame 0x00000354 0x70 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-divmod.o) - .debug_frame 0x000003c4 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-mul.o) - .debug_frame 0x000003e4 0x40 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-sprintf.o) - .debug_frame 0x00000424 0x64 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-vfprintf.o) - .debug_frame 0x00000488 0x2c c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-fvwrite_small_str.o) - .debug_frame 0x000004b4 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-memmove.o) - .debug_frame 0x000004d4 0x20 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-strlen.o) - .debug_frame 0x000004f4 0x38 ../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_load.o) - .debug_frame 0x0000052c 0x28 ../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_main.o) - .debug_frame 0x00000554 0x38 ../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_sys_init.o) - .debug_frame 0x0000058c 0x20 ../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .debug_frame 0x000005ac 0x20 ../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .debug_frame 0x000005cc 0x20 ../qsys_tutorial_mem_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - -.debug_str 0x00000000 0x1151 - *(.debug_str) - .debug_str 0x00000000 0x152 obj/default/hello_world_small.o - 0x1b3 (size before relaxing) - .debug_str 0x00000152 0x42 obj/default/hex_encoder.o - 0x9f (size before relaxing) - .debug_str 0x00000194 0x54 obj/default/hex_out.o - 0xd5 (size before relaxing) - .debug_str 0x000001e8 0xe2 obj/default/input_int.o - 0x193 (size before relaxing) - .debug_str 0x000002ca 0x107 obj/default/inst_decoder.o - 0x226 (size before relaxing) - .debug_str 0x000003d1 0x51 obj/default/sys_memory.o - 0x1a6 (size before relaxing) - .debug_str 0x00000422 0x1e obj/default/sys_register.o - 0x9e (size before relaxing) - .debug_str 0x00000440 0xf obj/default/system.o - 0x67 (size before relaxing) - .debug_str 0x0000044f 0x10b c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-divmod.o) - 0x1b4 (size before relaxing) - .debug_str 0x0000055a 0x37 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-mul.o) - 0x175 (size before relaxing) - .debug_str 0x00000591 0xea c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-ctype_.o) - 0x119 (size before relaxing) - .debug_str 0x0000067b 0x3d8 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-sprintf.o) - 0x499 (size before relaxing) - .debug_str 0x00000a53 0x162 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-vfprintf.o) - 0x5af (size before relaxing) - .debug_str 0x00000bb5 0x5d c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-fvwrite_small_str.o) - 0x487 (size before relaxing) - .debug_str 0x00000c12 0xf8 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-impure.o) - 0x45d (size before relaxing) - .debug_str 0x00000d0a 0x104 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-memmove.o) - 0x199 (size before relaxing) - .debug_str 0x00000e0e 0x45 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-strlen.o) - 0x184 (size before relaxing) - .debug_str 0x00000e53 0x141 ../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_load.o) - 0x1d6 (size before relaxing) - .debug_str 0x00000f94 0x70 ../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_main.o) - 0x15a (size before relaxing) - .debug_str 0x00001004 0xaa ../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_sys_init.o) - 0x1cd (size before relaxing) - .debug_str 0x000010ae 0x34 ../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - 0x119 (size before relaxing) - .debug_str 0x000010e2 0x34 ../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - 0x119 (size before relaxing) - .debug_str 0x00001116 0x3b ../qsys_tutorial_mem_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - 0x120 (size before relaxing) - -.debug_loc 0x00000000 0x1783 - *(.debug_loc) - .debug_loc 0x00000000 0x161 obj/default/hello_world_small.o - .debug_loc 0x00000161 0x3b9 obj/default/hex_encoder.o - .debug_loc 0x0000051a 0x24c obj/default/hex_out.o - .debug_loc 0x00000766 0x52 obj/default/input_int.o - .debug_loc 0x000007b8 0x192 obj/default/inst_decoder.o - .debug_loc 0x0000094a 0x105 obj/default/sys_memory.o - .debug_loc 0x00000a4f 0x1f obj/default/system.o - .debug_loc 0x00000a6e 0x1d2 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-divmod.o) - .debug_loc 0x00000c40 0x4f c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a(lib2-mul.o) - .debug_loc 0x00000c8f 0xbe c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-sprintf.o) - .debug_loc 0x00000d4d 0x878 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-vfprintf.o) - .debug_loc 0x000015c5 0xe1 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-fvwrite_small_str.o) - .debug_loc 0x000016a6 0x4f c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-memmove.o) - .debug_loc 0x000016f5 0x1e c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-strlen.o) - .debug_loc 0x00001713 0x1f ../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_load.o) - .debug_loc 0x00001732 0x1f ../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_main.o) - .debug_loc 0x00001751 0x32 ../qsys_tutorial_mem_bsp/\libhal_bsp.a(alt_sys_init.o) - -.debug_macinfo - *(.debug_macinfo) - -.debug_weaknames - *(.debug_weaknames) - -.debug_funcnames - *(.debug_funcnames) - -.debug_typenames - *(.debug_typenames) - -.debug_varnames - *(.debug_varnames) - -.debug_alt_sim_info - 0x00000000 0x10 - *(.debug_alt_sim_info) - .debug_alt_sim_info - 0x00000000 0x10 ../qsys_tutorial_mem_bsp//obj/HAL/src/crt0.o - 0x00004000 __alt_data_end = 0x4000 - 0x00004000 PROVIDE (__alt_stack_pointer, __alt_data_end) - 0x00002360 PROVIDE (__alt_stack_limit, __alt_stack_base) - 0x00002360 PROVIDE (__alt_heap_start, end) - 0x00004000 PROVIDE (__alt_heap_limit, 0x4000) -OUTPUT(qsys_tutorial_mem.elf elf32-littlenios2) - -.debug_ranges 0x00000000 0x190 - .debug_ranges 0x00000000 0x20 ../qsys_tutorial_mem_bsp//obj/HAL/src/crt0.o - .debug_ranges 0x00000020 0x18 obj/default/hello_world_small.o - .debug_ranges 0x00000038 0x140 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-vfprintf.o) - .debug_ranges 0x00000178 0x18 c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a(lib_a-fvwrite_small_str.o) diff --git a/software/qsys_tutorial_mem/qsys_tutorial_mem.objdump b/software/qsys_tutorial_mem/qsys_tutorial_mem.objdump deleted file mode 100644 index 90d9ea6..0000000 --- a/software/qsys_tutorial_mem/qsys_tutorial_mem.objdump +++ /dev/null @@ -1,3491 +0,0 @@ - -qsys_tutorial_mem.elf: file format elf32-littlenios2 -qsys_tutorial_mem.elf -architecture: nios2, flags 0x00000112: -EXEC_P, HAS_SYMS, D_PAGED -start address 0x00000020 - -Program Header: - LOAD off 0x00001000 vaddr 0x00000000 paddr 0x00000000 align 2**12 - filesz 0x00000020 memsz 0x00000020 flags r-x - LOAD off 0x00001020 vaddr 0x00000020 paddr 0x00000020 align 2**12 - filesz 0x00001fec memsz 0x00001fec flags r-x - LOAD off 0x0000300c vaddr 0x0000200c paddr 0x000020fc align 2**12 - filesz 0x000000f0 memsz 0x000000f0 flags rw- - LOAD off 0x000031ec vaddr 0x000021ec paddr 0x000021ec align 2**12 - filesz 0x00000000 memsz 0x00000174 flags rw- - -Sections: -Idx Name Size VMA LMA File off Algn - 0 .entry 00000020 00000000 00000000 00001000 2**5 - CONTENTS, ALLOC, LOAD, READONLY, CODE - 1 .text 00001d1c 00000020 00000020 00001020 2**2 - CONTENTS, ALLOC, LOAD, READONLY, CODE - 2 .rodata 000002d0 00001d3c 00001d3c 00002d3c 2**2 - CONTENTS, ALLOC, LOAD, READONLY, DATA - 3 .rwdata 000000f0 0000200c 000020fc 0000300c 2**2 - CONTENTS, ALLOC, LOAD, DATA, SMALL_DATA - 4 .bss 00000174 000021ec 000021ec 000031ec 2**2 - ALLOC, SMALL_DATA - 5 .comment 00000026 00000000 00000000 000030fc 2**0 - CONTENTS, READONLY - 6 .debug_aranges 000002c8 00000000 00000000 00003128 2**3 - CONTENTS, READONLY, DEBUGGING - 7 .debug_pubnames 000005b9 00000000 00000000 000033f0 2**0 - CONTENTS, READONLY, DEBUGGING - 8 .debug_info 000039d5 00000000 00000000 000039a9 2**0 - CONTENTS, READONLY, DEBUGGING - 9 .debug_abbrev 000013f4 00000000 00000000 0000737e 2**0 - CONTENTS, READONLY, DEBUGGING - 10 .debug_line 0000374c 00000000 00000000 00008772 2**0 - CONTENTS, READONLY, DEBUGGING - 11 .debug_frame 000005ec 00000000 00000000 0000bec0 2**2 - CONTENTS, READONLY, DEBUGGING - 12 .debug_str 00001151 00000000 00000000 0000c4ac 2**0 - CONTENTS, READONLY, DEBUGGING - 13 .debug_loc 00001783 00000000 00000000 0000d5fd 2**0 - CONTENTS, READONLY, DEBUGGING - 14 .debug_alt_sim_info 00000010 00000000 00000000 0000ed80 2**2 - CONTENTS, READONLY, DEBUGGING - 15 .debug_ranges 00000190 00000000 00000000 0000ed90 2**3 - CONTENTS, READONLY, DEBUGGING - 16 .thread_model 00000003 00000000 00000000 000103ea 2**0 - CONTENTS, READONLY - 17 .cpu 0000000f 00000000 00000000 000103ed 2**0 - CONTENTS, READONLY - 18 .qsys 00000001 00000000 00000000 000103fc 2**0 - CONTENTS, READONLY - 19 .simulation_enabled 00000001 00000000 00000000 000103fd 2**0 - CONTENTS, READONLY - 20 .stderr_dev 00000009 00000000 00000000 000103fe 2**0 - CONTENTS, READONLY - 21 .stdin_dev 00000009 00000000 00000000 00010407 2**0 - CONTENTS, READONLY - 22 .stdout_dev 00000009 00000000 00000000 00010410 2**0 - CONTENTS, READONLY - 23 .sopc_system_name 0000000b 00000000 00000000 00010419 2**0 - CONTENTS, READONLY - 24 .quartus_project_dir 00000030 00000000 00000000 00010424 2**0 - CONTENTS, READONLY - 25 .sopcinfo 0006c87e 00000000 00000000 00010454 2**0 - CONTENTS, READONLY -SYMBOL TABLE: -00000000 l d .entry 00000000 .entry -00000020 l d .text 00000000 .text -00001d3c l d .rodata 00000000 .rodata -0000200c l d .rwdata 00000000 .rwdata -000021ec l d .bss 00000000 .bss -00000000 l d .comment 00000000 .comment -00000000 l d .debug_aranges 00000000 .debug_aranges -00000000 l d .debug_pubnames 00000000 .debug_pubnames -00000000 l d .debug_info 00000000 .debug_info -00000000 l d .debug_abbrev 00000000 .debug_abbrev -00000000 l d .debug_line 00000000 .debug_line -00000000 l d .debug_frame 00000000 .debug_frame -00000000 l d .debug_str 00000000 .debug_str -00000000 l d .debug_loc 00000000 .debug_loc -00000000 l d .debug_alt_sim_info 00000000 .debug_alt_sim_info -00000000 l d .debug_ranges 00000000 .debug_ranges -00000058 l .text 00000000 alt_after_alt_main -00000000 l df *ABS* 00000000 hello_world_small.c -00000000 l df *ABS* 00000000 hex_encoder.c -00000000 l df *ABS* 00000000 hex_out.c -00000000 l df *ABS* 00000000 input_int.c -000021fc l O .bss 00000001 status.1396 -000021f8 l O .bss 00000004 event_code.1397 -00000000 l df *ABS* 00000000 inst_decoder.c -00000000 l df *ABS* 00000000 sys_memory.c -00002210 l O .bss 00000040 memory -00002250 l O .bss 00000100 inst_memory -00000000 l df *ABS* 00000000 sys_register.c -00000000 l df *ABS* 00000000 system.c -00000000 l df *ABS* 00000000 lib2-divmod.c -00001160 l F .text 0000007c udivmodsi4 -00000000 l df *ABS* 00000000 lib2-mul.c -00000000 l df *ABS* 00000000 ctype_.c -00001e89 l O .rodata 00000180 _ctype_b -00000000 l df *ABS* 00000000 sprintf.c -00000000 l df *ABS* 00000000 vfprintf.c -000013d8 l F .text 00000080 print_repeat -00000000 l df *ABS* 00000000 fvwrite_small_str.c -00000000 l df *ABS* 00000000 impure.c -0000200c l O .rwdata 000000e0 impure_data -00000000 l df *ABS* 00000000 memmove.c -00000000 l df *ABS* 00000000 strlen.c -00000000 l df *ABS* 00000000 alt_load.c -00001c50 l F .text 00000020 alt_load_section -00000000 l df *ABS* 00000000 alt_main.c -00000000 l df *ABS* 00000000 alt_sys_init.c -00000000 l df *ABS* 00000000 alt_dcache_flush_all.c -00000000 l df *ABS* 00000000 alt_icache_flush_all.c -00000000 l df *ABS* 00000000 altera_nios2_qsys_irq.c -00000cf4 g F .text 00000010 inst_load -00001cdc g F .text 0000002c alt_main -000020fc g *ABS* 00000000 __flash_rwdata_start -000008f8 g F .text 00000050 clear_block -000002a0 g F .text 000000a4 store_value -00000be4 g F .text 00000020 inst_add -00000cb8 g F .text 0000002c inst_jine -00001bd0 g F .text 00000060 memmove -000020f8 g O .rwdata 00000004 jtag_uart -00001b18 g F .text 000000b8 __sfvwrite_small_str -00000000 g F .entry 0000000c __reset -00000020 g *ABS* 00000000 __flash_exceptions_start -00002208 g O .bss 00000004 alt_argv -0000a0ec g *ABS* 00000000 _gp -00000bc4 g F .text 0000001c inst_jump -00000130 g F .text 000000a0 run_proc -0000129c g F .text 00000008 __udivsi3 -00000c8c g F .text 0000002c inst_jieq -00000d04 g F .text 0000004c inst_output -000010a8 g F .text 00000070 memory_store -000020f4 g O .rwdata 00000004 _global_impure_ptr -00002360 g *ABS* 00000000 __bss_end -000021ec g O .bss 00000005 stack -000020ec g O .rwdata 00000004 __ctype_ptr -00000d50 g F .text 00000038 inst_fetch -00001d2c g F .text 00000004 alt_dcache_flush_all -00002350 g O .bss 0000000f global_registers -00000c3c g F .text 00000028 inst_jeq -000020fc g *ABS* 00000000 __ram_rwdata_end -00000000 g *ABS* 00000000 __alt_mem_onchip_memory -0000200c g *ABS* 00000000 __ram_rodata_end -000012a4 g F .text 00000008 __umodsi3 -00002360 g *ABS* 00000000 end -00004000 g *ABS* 00000000 __alt_stack_pointer -00001458 g F .text 0000069c ___vfprintf_internal_r -00001368 g F .text 00000070 _sprintf_r -0000005c g F .text 0000003c wait -00000948 g F .text 000000fc print_number -00000020 g F .text 0000003c _start -0000081c g F .text 000000dc print_block -00001d08 g F .text 00000004 alt_sys_init -000012ac g F .text 00000038 __mulsi3 -0000200c g *ABS* 00000000 __ram_rwdata_start -00001d3c g *ABS* 00000000 __ram_rodata_start -00001134 g F .text 0000002c panic -00002360 g *ABS* 00000000 __alt_stack_base -00000be0 g F .text 00000004 inst_delay -00000ce4 g F .text 00000010 inst_store -00000344 g F .text 000000a4 init -000021ec g *ABS* 00000000 __bss_start -000003e8 g F .text 0000007c main -0000220c g O .bss 00000004 alt_envp -00000464 g F .text 00000124 encodeNumHex -00000bc0 g F .text 00000004 in_int -000011dc g F .text 00000060 __divsi3 -00001d3c g *ABS* 00000000 __flash_rodata_start -00001d0c g F .text 00000020 alt_irq_init -000012e4 g F .text 00000084 sprintf -00000098 g F .text 00000098 print_change_memory -00000a84 g F .text 0000013c push_int -000020f0 g O .rwdata 00000004 _impure_ptr -00002204 g O .bss 00000004 alt_argc -00002200 g O .bss 00000004 global_current_memory -00000020 g *ABS* 00000000 __ram_exceptions_start -00000588 g F .text 00000294 encodeLatHex -000020fc g *ABS* 00000000 _edata -00002360 g *ABS* 00000000 _end -00000020 g *ABS* 00000000 __ram_exceptions_end -00000ef8 g F .text 00000044 memory_init -00001d34 g F .text 00000008 altera_nios2_qsys_irq_init -0000000c g .entry 00000000 exit -00001038 g F .text 00000070 memory_load -0000123c g F .text 00000060 __modsi3 -00004000 g *ABS* 00000000 __alt_data_end -00000d88 g F .text 00000170 inst_decode -00001d88 g O .rodata 00000101 _ctype_ -00000c04 g F .text 00000038 inst_comp -00001118 g F .text 0000001c registers_init -0000000c g .entry 00000000 _exit -00000c64 g F .text 00000028 inst_jne -00001c30 g F .text 00000020 strlen -000001d0 g F .text 000000d0 store_inst -00001d30 g F .text 00000004 alt_icache_flush_all -00001af4 g F .text 00000024 __vfprintf_internal -00000f3c g F .text 00000080 inst_memory_store -00000a44 g F .text 00000040 push_decode -00001c70 g F .text 0000006c alt_load -000021f4 g O .bss 00000001 PUSH_EVENT -00000fbc g F .text 0000007c inst_memory_load - - - -Disassembly of section .entry: - -00000000 <__reset>: - * Jump to the _start entry point in the .text section if reset code - * is allowed or if optimizing for RTL simulation. - */ -#if defined(ALT_ALLOW_CODE_AT_RESET) || defined(ALT_SIM_OPTIMIZE) - /* Jump to the _start entry point in the .text section. */ - movhi r1, %hi(_start) - 0: 00400034 movhi at,0 - ori r1, r1, %lo(_start) - 4: 08400814 ori at,at,32 - jmp r1 - 8: 0800683a jmp at - -0000000c <_exit>: - ... - -Disassembly of section .text: - -00000020 <_start>: -#if (NIOS2_NUM_OF_SHADOW_REG_SETS == 0) - /* - * Now that the caches are initialized, set up the stack pointer. - * The value provided by the linker is assumed to be correctly aligned. - */ - movhi sp, %hi(__alt_stack_pointer) - 20: 06c00034 movhi sp,0 - ori sp, sp, %lo(__alt_stack_pointer) - 24: ded00014 ori sp,sp,16384 - - /* Set up the global pointer. */ - movhi gp, %hi(_gp) - 28: 06800034 movhi gp,0 - ori gp, gp, %lo(_gp) - 2c: d6a83b14 ori gp,gp,41196 - */ -#ifndef ALT_SIM_OPTIMIZE - /* Log that the BSS is about to be cleared. */ - ALT_LOG_PUTS(alt_log_msg_bss) - - movhi r2, %hi(__bss_start) - 30: 00800034 movhi r2,0 - ori r2, r2, %lo(__bss_start) - 34: 10887b14 ori r2,r2,8684 - - movhi r3, %hi(__bss_end) - 38: 00c00034 movhi r3,0 - ori r3, r3, %lo(__bss_end) - 3c: 18c8d814 ori r3,r3,9056 - - beq r2, r3, 1f - 40: 10c00326 beq r2,r3,50 <_start+0x30> - -0: - stw zero, (r2) - 44: 10000015 stw zero,0(r2) - addi r2, r2, 4 - 48: 10800104 addi r2,r2,4 - bltu r2, r3, 0b - 4c: 10fffd36 bltu r2,r3,44 <_start+0x24> - * section aren't defined until alt_load() has been called). - */ - mov et, zero -#endif - - call alt_load - 50: 0001c700 call 1c70 - - /* Log that alt_main is about to be called. */ - ALT_LOG_PUTS(alt_log_msg_alt_main) - - /* Call the C entry point. It should never return. */ - call alt_main - 54: 0001cdc0 call 1cdc - -00000058 : - - /* Wait in infinite loop in case alt_main does return. */ -alt_after_alt_main: - br alt_after_alt_main - 58: 003fff06 br 58 - -0000005c : - -#define ledrs (volatile int *) 0x00050a0 - -#define T_MS10 12500 //(10ms) - -void wait(unsigned int s) { - 5c: defffe04 addi sp,sp,-8 - volatile i; - for (i = 0; i < T_MS10*s; i++); - 60: 014c3504 movi r5,12500 - -#define ledrs (volatile int *) 0x00050a0 - -#define T_MS10 12500 //(10ms) - -void wait(unsigned int s) { - 64: dfc00115 stw ra,4(sp) - volatile i; - for (i = 0; i < T_MS10*s; i++); - 68: d8000015 stw zero,0(sp) - 6c: 00012ac0 call 12ac <__mulsi3> - 70: 1007883a mov r3,r2 - 74: 00000306 br 84 - 78: d8800017 ldw r2,0(sp) - 7c: 10800044 addi r2,r2,1 - 80: d8800015 stw r2,0(sp) - 84: d8800017 ldw r2,0(sp) - 88: 10fffb36 bltu r2,r3,78 -} - 8c: dfc00117 ldw ra,4(sp) - 90: dec00204 addi sp,sp,8 - 94: f800283a ret - -00000098 : - }while( inst_rec.inst != INST_END ); - - //print_block(" end", 4, HEX0_3); -} - -void print_change_memory(unsigned int current_memory) { - 98: defffb04 addi sp,sp,-20 - 9c: 200d883a mov r6,r4 - char buf[5]; - sprintf(buf, "g %2d", current_memory); - a0: 01400034 movhi r5,0 - a4: 29474f04 addi r5,r5,7484 - a8: d809883a mov r4,sp - }while( inst_rec.inst != INST_END ); - - //print_block(" end", 4, HEX0_3); -} - -void print_change_memory(unsigned int current_memory) { - ac: dfc00415 stw ra,16(sp) - b0: dc400315 stw r17,12(sp) - b4: dc000215 stw r16,8(sp) - char buf[5]; - sprintf(buf, "g %2d", current_memory); - print_block(buf, 4, HEX0_3); - print_block("an", 2, HEX4_5); - b8: 04400044 movi r17,1 - //print_block(" end", 4, HEX0_3); -} - -void print_change_memory(unsigned int current_memory) { - char buf[5]; - sprintf(buf, "g %2d", current_memory); - bc: 00012e40 call 12e4 - print_block(buf, 4, HEX0_3); - print_block("an", 2, HEX4_5); - c0: 04000084 movi r16,2 -} - -void print_change_memory(unsigned int current_memory) { - char buf[5]; - sprintf(buf, "g %2d", current_memory); - print_block(buf, 4, HEX0_3); - c4: d809883a mov r4,sp - c8: 01400104 movi r5,4 - cc: 000d883a mov r6,zero - d0: 000081c0 call 81c - print_block("an", 2, HEX4_5); - d4: 800b883a mov r5,r16 - d8: 880d883a mov r6,r17 - dc: 01000034 movhi r4,0 - e0: 21075104 addi r4,r4,7492 - e4: 000081c0 call 81c - print_block("ch", 2, HEX6_7); - e8: 800b883a mov r5,r16 - ec: 800d883a mov r6,r16 - f0: 01000034 movhi r4,0 - f4: 21075204 addi r4,r4,7496 - f8: 000081c0 call 81c - wait(200); - fc: 01003204 movi r4,200 - 100: 000005c0 call 5c - clear_block(HEX0_3); clear_block(HEX4_5); clear_block(HEX6_7); - 104: 0009883a mov r4,zero - 108: 00008f80 call 8f8 - 10c: 8809883a mov r4,r17 - 110: 00008f80 call 8f8 - 114: 8009883a mov r4,r16 - 118: 00008f80 call 8f8 -} - 11c: dfc00417 ldw ra,16(sp) - 120: dc400317 ldw r17,12(sp) - 124: dc000217 ldw r16,8(sp) - 128: dec00504 addi sp,sp,20 - 12c: f800283a ret - -00000130 : - print_block(buf, 4, HEX0_3); - sprintf(buf, "%02x", global_registers[Spc]); - print_block(buf, 2, HEX4_5); - } -} -void run_proc() { - 130: defffa04 addi sp,sp,-24 - 134: dfc00515 stw ra,20(sp) - 138: dc400415 stw r17,16(sp) - 13c: dc000315 stw r16,12(sp) - volatile struct InstRec inst_rec; - - //print_block(" go ", 4, HEX0_3); - - global_registers[Spc] = 0; - print_block("pc", 2, HEX6_7); - 140: 01400084 movi r5,2 -void run_proc() { - volatile struct InstRec inst_rec; - - //print_block(" go ", 4, HEX0_3); - - global_registers[Spc] = 0; - 144: 00800034 movhi r2,0 - 148: 1088d404 addi r2,r2,9040 - print_block("pc", 2, HEX6_7); - 14c: 01000034 movhi r4,0 - 150: 21075304 addi r4,r4,7500 - 154: 280d883a mov r6,r5 -void run_proc() { - volatile struct InstRec inst_rec; - - //print_block(" go ", 4, HEX0_3); - - global_registers[Spc] = 0; - 158: 10000045 stb zero,1(r2) - print_block("pc", 2, HEX6_7); - 15c: 000081c0 call 81c - do { - // pc�\�� - { - char buf[5]; - sprintf(buf, "%02x", global_registers[Spc]); - 160: 04400034 movhi r17,0 - 164: 8c48d404 addi r17,r17,9040 - 168: 89800047 ldb r6,1(r17) - 16c: dc000104 addi r16,sp,4 - 170: 01400034 movhi r5,0 - 174: 29475404 addi r5,r5,7504 - 178: 8009883a mov r4,r16 - 17c: 00012e40 call 12e4 - print_block(buf, 2, HEX4_5); - 180: 8009883a mov r4,r16 - 184: 01400084 movi r5,2 - 188: 01800044 movi r6,1 - 18c: 000081c0 call 81c - } - // ���߃t�F�b�` - inst_rec = inst_fetch(); - 190: 0000d500 call d50 - 194: d8800015 stw r2,0(sp) - // ���߃f�R�[�h���s - inst_decode(inst_rec); - 198: d9000017 ldw r4,0(sp) - 19c: 0000d880 call d88 - if ( global_registers[Ssw_run] ) wait(100); - 1a0: 88800347 ldb r2,13(r17) - 1a4: 01001904 movi r4,100 - 1a8: 10000126 beq r2,zero,1b0 - 1ac: 000005c0 call 5c - }while( inst_rec.inst != INST_END ); - 1b0: d8800017 ldw r2,0(sp) - 1b4: 108003cc andi r2,r2,15 - 1b8: 103fe91e bne r2,zero,160 - - //print_block(" end", 4, HEX0_3); -} - 1bc: dfc00517 ldw ra,20(sp) - 1c0: dc400417 ldw r17,16(sp) - 1c4: dc000317 ldw r16,12(sp) - 1c8: dec00604 addi sp,sp,24 - 1cc: f800283a ret - -000001d0 : - print_block(buf, 2, HEX6_7); - print_block("--", 2, HEX4_5); - sprintf(buf, "%04d", global_registers[Ssw_data]); - print_block(buf, 4, HEX0_3); -} -void store_inst(){ - 1d0: defffb04 addi sp,sp,-20 - 1d4: dc000215 stw r16,8(sp) - char reg_index; - struct InstRec inst_rec; - - // �K�v�ȏ��̎擾 - inst = global_registers[Ssw_inst]; - mem_index = global_registers[Ssw_memi]; - 1d8: 04000034 movhi r16,0 - 1dc: 8408d404 addi r16,r16,9040 - reg_index = global_registers[Ssw_regi]; - inst_rec.inst = (unsigned int)inst; - inst_rec.memi = (unsigned int)mem_index; - 1e0: 80c00283 ldbu r3,10(r16) - print_block(buf, 2, HEX6_7); - print_block("--", 2, HEX4_5); - sprintf(buf, "%04d", global_registers[Ssw_data]); - print_block(buf, 4, HEX0_3); -} -void store_inst(){ - 1e4: dc400315 stw r17,12(sp) - - // �K�v�ȏ��̎擾 - inst = global_registers[Ssw_inst]; - mem_index = global_registers[Ssw_memi]; - reg_index = global_registers[Ssw_regi]; - inst_rec.inst = (unsigned int)inst; - 1e8: 84400203 ldbu r17,8(r16) - 1ec: 008003c4 movi r2,15 - inst_rec.memi = (unsigned int)mem_index; - inst_rec.regi = (unsigned int)reg_index; - 1f0: 81800243 ldbu r6,9(r16) - // �K�v�ȏ��̎擾 - inst = global_registers[Ssw_inst]; - mem_index = global_registers[Ssw_memi]; - reg_index = global_registers[Ssw_regi]; - inst_rec.inst = (unsigned int)inst; - inst_rec.memi = (unsigned int)mem_index; - 1f4: 1886703a and r3,r3,r2 - - // �K�v�ȏ��̎擾 - inst = global_registers[Ssw_inst]; - mem_index = global_registers[Ssw_memi]; - reg_index = global_registers[Ssw_regi]; - inst_rec.inst = (unsigned int)inst; - 1f8: 017ffc04 movi r5,-16 - inst_rec.memi = (unsigned int)mem_index; - 1fc: 1806913a slli r3,r3,4 - - // �K�v�ȏ��̎擾 - inst = global_registers[Ssw_inst]; - mem_index = global_registers[Ssw_memi]; - reg_index = global_registers[Ssw_regi]; - inst_rec.inst = (unsigned int)inst; - 200: 88a2703a and r17,r17,r2 - 204: 294a703a and r5,r5,r5 - inst_rec.memi = (unsigned int)mem_index; - inst_rec.regi = (unsigned int)reg_index; - 208: 308c703a and r6,r6,r2 - - // �K�v�ȏ��̎擾 - inst = global_registers[Ssw_inst]; - mem_index = global_registers[Ssw_memi]; - reg_index = global_registers[Ssw_regi]; - inst_rec.inst = (unsigned int)inst; - 20c: 894ab03a or r5,r17,r5 - inst_rec.memi = (unsigned int)mem_index; - 210: 00bfc3c4 movi r2,-241 - inst_rec.regi = (unsigned int)reg_index; - 214: 300c923a slli r6,r6,8 - // �K�v�ȏ��̎擾 - inst = global_registers[Ssw_inst]; - mem_index = global_registers[Ssw_memi]; - reg_index = global_registers[Ssw_regi]; - inst_rec.inst = (unsigned int)inst; - inst_rec.memi = (unsigned int)mem_index; - 218: 288a703a and r5,r5,r2 - 21c: 28cab03a or r5,r5,r3 - inst_rec.regi = (unsigned int)reg_index; - - // �X�g�A���� - inst_memory_store((unsigned int)global_registers[Spc], inst_rec); - 220: 81000047 ldb r4,1(r16) - inst = global_registers[Ssw_inst]; - mem_index = global_registers[Ssw_memi]; - reg_index = global_registers[Ssw_regi]; - inst_rec.inst = (unsigned int)inst; - inst_rec.memi = (unsigned int)mem_index; - inst_rec.regi = (unsigned int)reg_index; - 224: 00bc3fc4 movi r2,-3841 - 228: 288a703a and r5,r5,r2 - - // �X�g�A���� - inst_memory_store((unsigned int)global_registers[Spc], inst_rec); - 22c: 298ab03a or r5,r5,r6 - print_block(buf, 2, HEX6_7); - print_block("--", 2, HEX4_5); - sprintf(buf, "%04d", global_registers[Ssw_data]); - print_block(buf, 4, HEX0_3); -} -void store_inst(){ - 230: dfc00415 stw ra,16(sp) - inst_rec.inst = (unsigned int)inst; - inst_rec.memi = (unsigned int)mem_index; - inst_rec.regi = (unsigned int)reg_index; - - // �X�g�A���� - inst_memory_store((unsigned int)global_registers[Spc], inst_rec); - 234: 0000f3c0 call f3c - global_registers[Spc]++; - 238: 80800043 ldbu r2,1(r16) - - { - char buf[5]; - sprintf(buf, "%04d", inst_rec.inst); - 23c: 880d883a mov r6,r17 - 240: d809883a mov r4,sp - 244: 01400034 movhi r5,0 - 248: 29475604 addi r5,r5,7512 - inst_rec.memi = (unsigned int)mem_index; - inst_rec.regi = (unsigned int)reg_index; - - // �X�g�A���� - inst_memory_store((unsigned int)global_registers[Spc], inst_rec); - global_registers[Spc]++; - 24c: 10800044 addi r2,r2,1 - 250: 80800045 stb r2,1(r16) - - { - char buf[5]; - sprintf(buf, "%04d", inst_rec.inst); - 254: 00012e40 call 12e4 - print_block(buf, 4, HEX0_3); - 258: d809883a mov r4,sp - 25c: 01400104 movi r5,4 - 260: 000d883a mov r6,zero - 264: 000081c0 call 81c - sprintf(buf, "%02x", global_registers[Spc]); - 268: 81800047 ldb r6,1(r16) - 26c: d809883a mov r4,sp - 270: 01400034 movhi r5,0 - 274: 29475404 addi r5,r5,7504 - 278: 00012e40 call 12e4 - print_block(buf, 2, HEX4_5); - 27c: d809883a mov r4,sp - 280: 01400084 movi r5,2 - 284: 01800044 movi r6,1 - 288: 000081c0 call 81c - } -} - 28c: dfc00417 ldw ra,16(sp) - 290: dc400317 ldw r17,12(sp) - 294: dc000217 ldw r16,8(sp) - 298: dec00504 addi sp,sp,20 - 29c: f800283a ret - -000002a0 : - clear_block(HEX0_3); clear_block(HEX4_5); clear_block(HEX6_7); -} - -char stack[5]; - -void store_value(){ - 2a0: defffa04 addi sp,sp,-24 - 2a4: dc800415 stw r18,16(sp) - char buf[5]; - unsigned int memi = global_registers[Ssw_memi]; - 2a8: 04800034 movhi r18,0 - 2ac: 9488d404 addi r18,r18,9040 - clear_block(HEX0_3); clear_block(HEX4_5); clear_block(HEX6_7); -} - -char stack[5]; - -void store_value(){ - 2b0: dc400315 stw r17,12(sp) - char buf[5]; - unsigned int memi = global_registers[Ssw_memi]; - 2b4: 94400287 ldb r17,10(r18) - memory_store(memi, Ssw_data); - 2b8: 014001c4 movi r5,7 - clear_block(HEX0_3); clear_block(HEX4_5); clear_block(HEX6_7); -} - -char stack[5]; - -void store_value(){ - 2bc: dfc00515 stw ra,20(sp) - char buf[5]; - unsigned int memi = global_registers[Ssw_memi]; - memory_store(memi, Ssw_data); - 2c0: 8809883a mov r4,r17 - clear_block(HEX0_3); clear_block(HEX4_5); clear_block(HEX6_7); -} - -char stack[5]; - -void store_value(){ - 2c4: dc000215 stw r16,8(sp) - char buf[5]; - unsigned int memi = global_registers[Ssw_memi]; - memory_store(memi, Ssw_data); - 2c8: 00010a80 call 10a8 - sprintf(buf, "%02x", (unsigned char)memi); - print_block(buf, 2, HEX6_7); - 2cc: 04000084 movi r16,2 - -void store_value(){ - char buf[5]; - unsigned int memi = global_registers[Ssw_memi]; - memory_store(memi, Ssw_data); - sprintf(buf, "%02x", (unsigned char)memi); - 2d0: d809883a mov r4,sp - 2d4: 89803fcc andi r6,r17,255 - 2d8: 01400034 movhi r5,0 - 2dc: 29475404 addi r5,r5,7504 - 2e0: 00012e40 call 12e4 - print_block(buf, 2, HEX6_7); - 2e4: d809883a mov r4,sp - 2e8: 800b883a mov r5,r16 - 2ec: 800d883a mov r6,r16 - 2f0: 000081c0 call 81c - print_block("--", 2, HEX4_5); - 2f4: 800b883a mov r5,r16 - 2f8: 01800044 movi r6,1 - 2fc: 01000034 movhi r4,0 - 300: 21075804 addi r4,r4,7520 - 304: 000081c0 call 81c - sprintf(buf, "%04d", global_registers[Ssw_data]); - 308: 918001c7 ldb r6,7(r18) - 30c: d809883a mov r4,sp - 310: 01400034 movhi r5,0 - 314: 29475604 addi r5,r5,7512 - 318: 00012e40 call 12e4 - print_block(buf, 4, HEX0_3); - 31c: d809883a mov r4,sp - 320: 01400104 movi r5,4 - 324: 000d883a mov r6,zero - 328: 000081c0 call 81c -} - 32c: dfc00517 ldw ra,20(sp) - 330: dc800417 ldw r18,16(sp) - 334: dc400317 ldw r17,12(sp) - 338: dc000217 ldw r16,8(sp) - 33c: dec00604 addi sp,sp,24 - 340: f800283a ret - -00000344 : -void wait(unsigned int s) { - volatile i; - for (i = 0; i < T_MS10*s; i++); -} - -void init() { - 344: defffd04 addi sp,sp,-12 - 348: dfc00215 stw ra,8(sp) - 34c: dc400115 stw r17,4(sp) - 350: dc000015 stw r16,0(sp) - registers_init(); - 354: 00011180 call 1118 - memory_init(); - 358: 0000ef80 call ef8 - clear_block(HEX0_3); clear_block(HEX4_5); clear_block(HEX6_7); - 35c: 04400044 movi r17,1 - 360: 0009883a mov r4,zero - 364: 04000084 movi r16,2 - 368: 00008f80 call 8f8 - 36c: 8809883a mov r4,r17 - 370: 00008f80 call 8f8 - 374: 8009883a mov r4,r16 - 378: 00008f80 call 8f8 - print_block("he", 2, HEX6_7); - 37c: 800b883a mov r5,r16 - 380: 800d883a mov r6,r16 - 384: 01000034 movhi r4,0 - 388: 21075904 addi r4,r4,7524 - 38c: 000081c0 call 81c - print_block("lo", 2, HEX4_5); - 390: 800b883a mov r5,r16 - 394: 880d883a mov r6,r17 - 398: 01000034 movhi r4,0 - 39c: 21075a04 addi r4,r4,7528 - 3a0: 000081c0 call 81c - print_block("you1", 4, HEX0_3); - 3a4: 01400104 movi r5,4 - 3a8: 000d883a mov r6,zero - 3ac: 01000034 movhi r4,0 - 3b0: 21075b04 addi r4,r4,7532 - 3b4: 000081c0 call 81c - wait(200); - 3b8: 01003204 movi r4,200 - 3bc: 000005c0 call 5c - clear_block(HEX0_3); clear_block(HEX4_5); clear_block(HEX6_7); - 3c0: 0009883a mov r4,zero - 3c4: 00008f80 call 8f8 - 3c8: 8809883a mov r4,r17 - 3cc: 00008f80 call 8f8 - 3d0: 8009883a mov r4,r16 -} - 3d4: dfc00217 ldw ra,8(sp) - 3d8: dc400117 ldw r17,4(sp) - 3dc: dc000017 ldw r16,0(sp) - 3e0: dec00304 addi sp,sp,12 - clear_block(HEX0_3); clear_block(HEX4_5); clear_block(HEX6_7); - print_block("he", 2, HEX6_7); - print_block("lo", 2, HEX4_5); - print_block("you1", 4, HEX0_3); - wait(200); - clear_block(HEX0_3); clear_block(HEX4_5); clear_block(HEX6_7); - 3e4: 00008f81 jmpi 8f8 - -000003e8
: - wait(200); - clear_block(HEX0_3); clear_block(HEX4_5); clear_block(HEX6_7); -} - -int main() -{ - 3e8: defffe04 addi sp,sp,-8 - 3ec: dfc00115 stw ra,4(sp) - 3f0: dc000015 stw r16,0(sp) - init(); - 3f4: 00003440 call 344 - while(1) { - // interrupt - in_int(); - - // event - if (PUSH_EVENT == PUSH_VALSTR) { - 3f8: 04000034 movhi r16,0 - 3fc: 84087d04 addi r16,r16,8692 -int main() -{ - init(); - while(1) { - // interrupt - in_int(); - 400: 0000bc00 call bc0 - - // event - if (PUSH_EVENT == PUSH_VALSTR) { - 404: 80c00003 ldbu r3,0(r16) - 408: 00800084 movi r2,2 - 40c: 1880011e bne r3,r2,414 - // �l�̃X�g�A - store_value(); - 410: 00002a00 call 2a0 - } - if (PUSH_EVENT == PUSH_INSSTR) { - 414: 80c00003 ldbu r3,0(r16) - 418: 008000c4 movi r2,3 - 41c: 1880011e bne r3,r2,424 - // ���߂̃X�g�A - store_inst(); - 420: 00001d00 call 1d0 - } - if (PUSH_EVENT == PUSH_RUN) { - 424: 80c00003 ldbu r3,0(r16) - 428: 00800104 movi r2,4 - if (global_current_memory != (unsigned int)global_registers[Ssw_psel]) { - 42c: 01400034 movhi r5,0 - 430: 29488004 addi r5,r5,8704 - } - if (PUSH_EVENT == PUSH_INSSTR) { - // ���߂̃X�g�A - store_inst(); - } - if (PUSH_EVENT == PUSH_RUN) { - 434: 18bff01e bne r3,r2,3f8 - if (global_current_memory != (unsigned int)global_registers[Ssw_psel]) { - 438: 00800034 movhi r2,0 - 43c: 1088d404 addi r2,r2,9040 - 440: 10c002c7 ldb r3,11(r2) - 444: 28800017 ldw r2,0(r5) - global_current_memory = (unsigned int)global_registers[Ssw_psel]; - print_change_memory(global_current_memory); - 448: 1809883a mov r4,r3 - if (PUSH_EVENT == PUSH_INSSTR) { - // ���߂̃X�g�A - store_inst(); - } - if (PUSH_EVENT == PUSH_RUN) { - if (global_current_memory != (unsigned int)global_registers[Ssw_psel]) { - 44c: 10c00326 beq r2,r3,45c - global_current_memory = (unsigned int)global_registers[Ssw_psel]; - 450: 28c00015 stw r3,0(r5) - print_change_memory(global_current_memory); - 454: 00000980 call 98 - 458: 003fe706 br 3f8 - } - else { - // �v���O�������s - run_proc(); - 45c: 00001300 call 130 - 460: 003fe506 br 3f8 - -00000464 : -#include "hex_encoder.h" -#include - -void encodeNumHex(int hex_i, int num) { - char encoded = 0; - switch (num) { - 464: 00800244 movi r2,9 - 468: 11401336 bltu r2,r5,4b8 - 46c: 2945883a add r2,r5,r5 - 470: 1085883a add r2,r2,r2 - 474: 00c00034 movhi r3,0 - 478: 18c12204 addi r3,r3,1160 - 47c: 10c5883a add r2,r2,r3 - 480: 10800017 ldw r2,0(r2) - 484: 1000683a jmp r2 - 488: 000004c0 call 4c <_start+0x2c> - 48c: 000004c8 cmpgei zero,zero,19 - 490: 000004d0 cmplti zero,zero,19 - 494: 000004d8 cmpnei zero,zero,19 - 498: 000004e0 cmpeqi zero,zero,19 - 49c: 000004e8 cmpgeui zero,zero,19 - 4a0: 000004f0 cmpltui zero,zero,19 - 4a4: 000004f8 rdprs zero,zero,19 - 4a8: 000004b8 rdprs zero,zero,18 - 4ac: 000004b0 cmpltui zero,zero,18 - 4b0: 01400404 movi r5,16 - 4b4: 00001106 br 4fc - 4b8: 000b883a mov r5,zero - 4bc: 00000f06 br 4fc - 4c0: 01401004 movi r5,64 - 4c4: 00000d06 br 4fc - case 0: - encoded = (char)0x40; // 100 0000 - break; - 4c8: 017ffe44 movi r5,-7 - 4cc: 00000b06 br 4fc - case 1: - encoded = (char)0xF9; // 111 1001 - break; - 4d0: 01400904 movi r5,36 - 4d4: 00000906 br 4fc - case 2: - encoded = (char)0x24; // 010 0100 - break; - 4d8: 01400c04 movi r5,48 - 4dc: 00000706 br 4fc - case 3: - encoded = (char)0x30; // 011 0000 - break; - 4e0: 01400644 movi r5,25 - 4e4: 00000506 br 4fc - case 4: - encoded = (char)0x19; // 001 1001 - break; - 4e8: 01400484 movi r5,18 - 4ec: 00000306 br 4fc - case 5: - encoded = (char)0x12; // 001 0010 - break; - 4f0: 01400084 movi r5,2 - 4f4: 00000106 br 4fc - case 6: - encoded = (char)0x02; // 000 0010 - break; - 4f8: 01401604 movi r5,88 - default: - encoded = 0; - break; - } - - switch (hex_i) { - 4fc: 008001c4 movi r2,7 - 500: 11002036 bltu r2,r4,584 - 504: 2105883a add r2,r4,r4 - 508: 1085883a add r2,r2,r2 - 50c: 00c00034 movhi r3,0 - 510: 18c14804 addi r3,r3,1312 - 514: 10c5883a add r2,r2,r3 - 518: 10800017 ldw r2,0(r2) - 51c: 1000683a jmp r2 - 520: 00000540 call 54 <_start+0x34> - 524: 00000548 cmpgei zero,zero,21 - 528: 00000550 cmplti zero,zero,21 - 52c: 00000558 cmpnei zero,zero,21 - 530: 00000560 cmpeqi zero,zero,21 - 534: 00000568 cmpgeui zero,zero,21 - 538: 00000570 cmpltui zero,zero,21 - 53c: 0000057c xorhi zero,zero,21 - case 0: - *hex0 = encoded; - 540: 00941c04 movi r2,20592 - 544: 00000b06 br 574 - break; - case 1: - *hex1 = encoded; - 548: 00941804 movi r2,20576 - 54c: 00000906 br 574 - break; - case 2: - *hex2 = encoded; - 550: 00941404 movi r2,20560 - 554: 00000706 br 574 - break; - case 3: - *hex3 = encoded; - 558: 00941004 movi r2,20544 - 55c: 00000506 br 574 - break; - case 4: - *hex4 = encoded; - 560: 00940c04 movi r2,20528 - 564: 00000306 br 574 - break; - case 5: - *hex5 = encoded; - 568: 00940804 movi r2,20512 - 56c: 00000106 br 574 - break; - case 6: - *hex6 = encoded; - 570: 00940404 movi r2,20496 - 574: 11400005 stb r5,0(r2) - 578: f800283a ret - break; - case 7: - *hex7 = encoded; - 57c: 00940004 movi r2,20480 - 580: 11400005 stb r5,0(r2) - 584: f800283a ret - -00000588 : -} - -void encodeLatHex(int hex_i, char c) { - char encoded = 0; - - if (isdigit(c)) { - 588: 00800034 movhi r2,0 - 58c: 10883b04 addi r2,r2,8428 - 590: 10800017 ldw r2,0(r2) - 594: 29403fcc andi r5,r5,255 - 598: 2940201c xori r5,r5,128 - 59c: 297fe004 addi r5,r5,-128 - 5a0: 2885883a add r2,r5,r2 - 5a4: 10800003 ldbu r2,0(r2) - default: - break; - } -} - -void encodeLatHex(int hex_i, char c) { - 5a8: 2007883a mov r3,r4 - char encoded = 0; - - if (isdigit(c)) { - 5ac: 1080010c andi r2,r2,4 - 5b0: 10000226 beq r2,zero,5bc - encodeNumHex(hex_i, c-'0'); - 5b4: 297ff404 addi r5,r5,-48 - 5b8: 00004641 jmpi 464 - return; - } - - switch (c) { - 5bc: 00801b44 movi r2,109 - 5c0: 28805a26 beq r5,r2,72c - 5c4: 11401d16 blt r2,r5,63c - 5c8: 00801984 movi r2,102 - 5cc: 28804926 beq r5,r2,6f4 - 5d0: 11400e16 blt r2,r5,60c - 5d4: 00801884 movi r2,98 - 5d8: 28803e26 beq r5,r2,6d4 - 5dc: 11400716 blt r2,r5,5fc - 5e0: 00800b44 movi r2,45 - 5e4: 28803726 beq r5,r2,6c4 - 5e8: 00801844 movi r2,97 - 5ec: 28803726 beq r5,r2,6cc - 5f0: 00800804 movi r2,32 - 5f4: 28802f1e bne r5,r2,6b4 - 5f8: 00003006 br 6bc - 5fc: 00801904 movi r2,100 - 600: 28803826 beq r5,r2,6e4 - 604: 11403916 blt r2,r5,6ec - 608: 00003406 br 6dc - 60c: 00801a44 movi r2,105 - 610: 28803e26 beq r5,r2,70c - 614: 11400516 blt r2,r5,62c - 618: 008019c4 movi r2,103 - 61c: 28803726 beq r5,r2,6fc - 620: 00801a04 movi r2,104 - 624: 2880231e bne r5,r2,6b4 - 628: 00003606 br 704 - 62c: 00801ac4 movi r2,107 - 630: 28803a26 beq r5,r2,71c - 634: 11403b16 blt r2,r5,724 - 638: 00003606 br 714 - 63c: 00801d04 movi r2,116 - 640: 28804826 beq r5,r2,764 - 644: 11400c16 blt r2,r5,678 - 648: 00801c04 movi r2,112 - 64c: 28803d26 beq r5,r2,744 - 650: 11400516 blt r2,r5,668 - 654: 00801b84 movi r2,110 - 658: 28803626 beq r5,r2,734 - 65c: 00801bc4 movi r2,111 - 660: 2880141e bne r5,r2,6b4 - 664: 00003506 br 73c - 668: 00801c84 movi r2,114 - 66c: 28803926 beq r5,r2,754 - 670: 11403a16 blt r2,r5,75c - 674: 00003506 br 74c - 678: 00801dc4 movi r2,119 - 67c: 28803f26 beq r5,r2,77c - 680: 11400516 blt r2,r5,698 - 684: 00801d44 movi r2,117 - 688: 28803826 beq r5,r2,76c - 68c: 00801d84 movi r2,118 - 690: 2880081e bne r5,r2,6b4 - 694: 00003706 br 774 - 698: 00801e44 movi r2,121 - 69c: 28803b26 beq r5,r2,78c - 6a0: 28803816 blt r5,r2,784 - 6a4: 00801e84 movi r2,122 - 6a8: 2880021e bne r5,r2,6b4 - 6ac: 01401904 movi r5,100 - 6b0: 00003706 br 790 - 6b4: 000b883a mov r5,zero - 6b8: 00003506 br 790 - 6bc: 017fffc4 movi r5,-1 - 6c0: 00003306 br 790 - case ' ': - encoded = (char)0xFF; // 111 1111 - break; - 6c4: 01400fc4 movi r5,63 - 6c8: 00003106 br 790 - case '-': - encoded = (char)0x3F; // 011 1111 - break; - 6cc: 01400204 movi r5,8 - 6d0: 00002f06 br 790 - case 'a': - encoded = (char)0x08; // 000 1000 - break; - 6d4: 014000c4 movi r5,3 - 6d8: 00002d06 br 790 - case 'b': - encoded = (char)0x03; // 000 0011 - break; - 6dc: 014009c4 movi r5,39 - 6e0: 00002b06 br 790 - case 'c': - encoded = (char)0x27; // 010 0111 - break; - 6e4: 01400844 movi r5,33 - 6e8: 00002906 br 790 - case 'd': - encoded = (char)0x21; // 010 0001 - break; - 6ec: 01400184 movi r5,6 - 6f0: 00002706 br 790 - case 'e': - encoded = (char)0x06; // 000 0110 - break; - 6f4: 01400384 movi r5,14 - 6f8: 00002506 br 790 - case 'f': - encoded = (char)0x0E; // 000 1110 - break; - 6fc: 01401084 movi r5,66 - 700: 00002306 br 790 - case 'g': - encoded = (char)0x42; // 100 0010 - break; - 704: 014002c4 movi r5,11 - 708: 00002106 br 790 - case 'h': - encoded = (char)0x0B; // 000 1011 - break; - 70c: 017ffec4 movi r5,-5 - 710: 00001f06 br 790 - case 'i': - encoded = (char)0xFB; // 111 1011 - break; - 714: 01401844 movi r5,97 - 718: 00001d06 br 790 - case 'j': - encoded = (char)0x61; // 110 0001 - break; - 71c: 01400284 movi r5,10 - 720: 00001b06 br 790 - case 'k': - encoded = (char)0x0A; // 000 1010 - break; - 724: 014011c4 movi r5,71 - 728: 00001906 br 790 - case 'l': - encoded = (char)0x47; // 100 0111 - break; - 72c: 01401204 movi r5,72 - 730: 00001706 br 790 - case 'm': - encoded = (char)0x48; // 100 1000 - break; - 734: 01400ac4 movi r5,43 - 738: 00001506 br 790 - case 'n': - encoded = (char)0x2B; // 010 1011 - break; - 73c: 014008c4 movi r5,35 - 740: 00001306 br 790 - case 'o': - encoded = (char)0x23; // 010 0011 - break; - 744: 01400304 movi r5,12 - 748: 00001106 br 790 - case 'p': - encoded = (char)0x0C; // 000 1100 - break; - 74c: 01400104 movi r5,4 - 750: 00000f06 br 790 - case 'q': - encoded = (char)0x04; // 000 0100 - break; - 754: 01400bc4 movi r5,47 - 758: 00000d06 br 790 - case 'r': - encoded = (char)0x2F; // 010 1111 - break; - 75c: 014004c4 movi r5,19 - 760: 00000b06 br 790 - case 's': - encoded = (char)0x13; // 001 0011 - break; - 764: 014001c4 movi r5,7 - 768: 00000906 br 790 - case 't': - encoded = (char)0x07; // 000 0111 - break; - 76c: 014018c4 movi r5,99 - 770: 00000706 br 790 - case 'u': - encoded = (char)0x63; // 110 0011 - break; - 774: 01401044 movi r5,65 - 778: 00000506 br 790 - case 'v': - encoded = (char)0x41; // 100 0001 - break; - 77c: 01400044 movi r5,1 - 780: 00000306 br 790 - case 'w': - encoded = (char)0x01; // 000 0001 - break; - 784: 01400244 movi r5,9 - 788: 00000106 br 790 - case 'x': - encoded = (char)0x09; // 000 1001 - break; - 78c: 01400444 movi r5,17 - default: - encoded = 0; - break; - } - - switch (hex_i) { - 790: 008001c4 movi r2,7 - 794: 10c02036 bltu r2,r3,818 - 798: 18c5883a add r2,r3,r3 - 79c: 1085883a add r2,r2,r2 - 7a0: 00c00034 movhi r3,0 - 7a4: 18c1ed04 addi r3,r3,1972 - 7a8: 10c5883a add r2,r2,r3 - 7ac: 10800017 ldw r2,0(r2) - 7b0: 1000683a jmp r2 - 7b4: 000007d4 movui zero,31 - 7b8: 000007dc xori zero,zero,31 - 7bc: 000007e4 muli zero,zero,31 - 7c0: 000007ec andhi zero,zero,31 - 7c4: 000007f4 movhi zero,31 - 7c8: 000007fc xorhi zero,zero,31 - 7cc: 00000804 movi zero,32 - 7d0: 00000810 cmplti zero,zero,32 - case 0: - *hex0 = encoded; - 7d4: 00941c04 movi r2,20592 - 7d8: 00000b06 br 808 - break; - case 1: - *hex1 = encoded; - 7dc: 00941804 movi r2,20576 - 7e0: 00000906 br 808 - break; - case 2: - *hex2 = encoded; - 7e4: 00941404 movi r2,20560 - 7e8: 00000706 br 808 - break; - case 3: - *hex3 = encoded; - 7ec: 00941004 movi r2,20544 - 7f0: 00000506 br 808 - break; - case 4: - *hex4 = encoded; - 7f4: 00940c04 movi r2,20528 - 7f8: 00000306 br 808 - break; - case 5: - *hex5 = encoded; - 7fc: 00940804 movi r2,20512 - 800: 00000106 br 808 - break; - case 6: - *hex6 = encoded; - 804: 00940404 movi r2,20496 - 808: 11400005 stb r5,0(r2) - 80c: f800283a ret - break; - case 7: - *hex7 = encoded; - 810: 00940004 movi r2,20480 - 814: 11400005 stb r5,0(r2) - 818: f800283a ret - -0000081c : - */ -#include "hex_out.h" -#include "hex_encoder.h" -#include "system.h" - -void print_block(char * str, unsigned int size, enum BLOCK_N block_i) { - 81c: defffc04 addi sp,sp,-16 - 820: dc400115 stw r17,4(sp) - 824: dc000015 stw r16,0(sp) - 828: dfc00315 stw ra,12(sp) - 82c: dc800215 stw r18,8(sp) - 830: 2021883a mov r16,r4 - 834: 2823883a mov r17,r5 - int i; - if (block_i == HEX0_3) { - 838: 30000d1e bne r6,zero,870 - if (size > 4) panic(); - 83c: 00800104 movi r2,4 - 840: 1140012e bgeu r2,r5,848 - 844: 00011340 call 1134 - 848: 8461883a add r16,r16,r17 - 84c: 0025883a mov r18,zero - 850: 00000306 br 860 - for (i = 0; i < size; i++) { - encodeLatHex(i,str[size-1-i]); - 854: 81400007 ldb r5,0(r16) - -void print_block(char * str, unsigned int size, enum BLOCK_N block_i) { - int i; - if (block_i == HEX0_3) { - if (size > 4) panic(); - for (i = 0; i < size; i++) { - 858: 94800044 addi r18,r18,1 - encodeLatHex(i,str[size-1-i]); - 85c: 00005880 call 588 - 860: 9009883a mov r4,r18 - -void print_block(char * str, unsigned int size, enum BLOCK_N block_i) { - int i; - if (block_i == HEX0_3) { - if (size > 4) panic(); - for (i = 0; i < size; i++) { - 864: 843fffc4 addi r16,r16,-1 - 868: 947ffa1e bne r18,r17,854 - 86c: 00001c06 br 8e0 - encodeLatHex(i,str[size-1-i]); - } - } - else if (block_i == HEX4_5) { - 870: 00800044 movi r2,1 - 874: 30800d1e bne r6,r2,8ac - if (size > 2) panic(); - 878: 00800084 movi r2,2 - 87c: 1140012e bgeu r2,r5,884 - 880: 00011340 call 1134 - 884: 8461883a add r16,r16,r17 - 888: 0025883a mov r18,zero - 88c: 00000306 br 89c - for (i = 0; i < size; i++) { - encodeLatHex(i+4,str[size-1-i]); - 890: 81400007 ldb r5,0(r16) - encodeLatHex(i,str[size-1-i]); - } - } - else if (block_i == HEX4_5) { - if (size > 2) panic(); - for (i = 0; i < size; i++) { - 894: 94800044 addi r18,r18,1 - encodeLatHex(i+4,str[size-1-i]); - 898: 00005880 call 588 - 89c: 91000104 addi r4,r18,4 - encodeLatHex(i,str[size-1-i]); - } - } - else if (block_i == HEX4_5) { - if (size > 2) panic(); - for (i = 0; i < size; i++) { - 8a0: 843fffc4 addi r16,r16,-1 - 8a4: 947ffa1e bne r18,r17,890 - 8a8: 00000d06 br 8e0 - encodeLatHex(i+4,str[size-1-i]); - } - } - else if (block_i == HEX6_7) { - 8ac: 00800084 movi r2,2 - 8b0: 30800b1e bne r6,r2,8e0 - if (size > 2) panic(); - 8b4: 3140012e bgeu r6,r5,8bc - 8b8: 00011340 call 1134 - 8bc: 8461883a add r16,r16,r17 - 8c0: 0025883a mov r18,zero - 8c4: 00000306 br 8d4 - for (i = 0; i < size; i++) { - encodeLatHex(i+6,str[size-1-i]); - 8c8: 81400007 ldb r5,0(r16) - encodeLatHex(i+4,str[size-1-i]); - } - } - else if (block_i == HEX6_7) { - if (size > 2) panic(); - for (i = 0; i < size; i++) { - 8cc: 94800044 addi r18,r18,1 - encodeLatHex(i+6,str[size-1-i]); - 8d0: 00005880 call 588 - 8d4: 91000184 addi r4,r18,6 - encodeLatHex(i+4,str[size-1-i]); - } - } - else if (block_i == HEX6_7) { - if (size > 2) panic(); - for (i = 0; i < size; i++) { - 8d8: 843fffc4 addi r16,r16,-1 - 8dc: 947ffa1e bne r18,r17,8c8 - encodeLatHex(i+6,str[size-1-i]); - } - } -} - 8e0: dfc00317 ldw ra,12(sp) - 8e4: dc800217 ldw r18,8(sp) - 8e8: dc400117 ldw r17,4(sp) - 8ec: dc000017 ldw r16,0(sp) - 8f0: dec00404 addi sp,sp,16 - 8f4: f800283a ret - -000008f8 : - -void clear_block(enum BLOCK_N block_i) { - 8f8: 2007883a mov r3,r4 - if (block_i == HEX0_3) { - print_block(" ", 4, HEX0_3); - 8fc: 01400104 movi r5,4 - 900: 000d883a mov r6,zero - 904: 01000034 movhi r4,0 - 908: 21075d04 addi r4,r4,7540 - } - } -} - -void clear_block(enum BLOCK_N block_i) { - if (block_i == HEX0_3) { - 90c: 18000c26 beq r3,zero,940 - print_block(" ", 4, HEX0_3); - } - else if (block_i == HEX4_5) { - 910: 00800044 movi r2,1 - print_block(" ", 2, HEX4_5); - 914: 180d883a mov r6,r3 - 918: 01000034 movhi r4,0 - 91c: 21075f04 addi r4,r4,7548 - 920: 01400084 movi r5,2 - -void clear_block(enum BLOCK_N block_i) { - if (block_i == HEX0_3) { - print_block(" ", 4, HEX0_3); - } - else if (block_i == HEX4_5) { - 924: 18800626 beq r3,r2,940 - print_block(" ", 2, HEX4_5); - } - else if (block_i == HEX6_7) { - 928: 00800084 movi r2,2 - print_block(" ", 2, HEX6_7); - 92c: 180b883a mov r5,r3 - 930: 01000034 movhi r4,0 - 934: 21075f04 addi r4,r4,7548 - 938: 180d883a mov r6,r3 - print_block(" ", 4, HEX0_3); - } - else if (block_i == HEX4_5) { - print_block(" ", 2, HEX4_5); - } - else if (block_i == HEX6_7) { - 93c: 1880011e bne r3,r2,944 - print_block(" ", 2, HEX6_7); - 940: 000081c1 jmpi 81c - 944: f800283a ret - -00000948 : - } -} - -void print_number(char num) { - 948: defff804 addi sp,sp,-32 - 94c: dc800415 stw r18,16(sp) - 950: dc400315 stw r17,12(sp) - 954: dfc00715 stw ra,28(sp) - 958: dd000615 stw r20,24(sp) - 95c: dcc00515 stw r19,20(sp) - 960: dc000215 stw r16,8(sp) - 964: 2023883a mov r17,r4 - 968: 0025883a mov r18,zero - int i; - char buf[5]; - char val; - for (i = 0; i < 4; i++) { - if (num < 0) { - 96c: 88803fcc andi r2,r17,255 - 970: 1080201c xori r2,r2,128 - 974: 10bfe004 addi r2,r2,-128 - buf[0] = '-'; - 978: 05000b44 movi r20,45 - val = -num; - 97c: 0461c83a sub r16,zero,r17 -void print_number(char num) { - int i; - char buf[5]; - char val; - for (i = 0; i < 4; i++) { - if (num < 0) { - 980: 10000216 blt r2,zero,98c - buf[0] = '-'; - val = -num; - } else { - buf[0] = ' '; - 984: 05000804 movi r20,32 - 988: 8821883a mov r16,r17 - val = num; - } - buf[1] = val/100%10 + '0'; - 98c: 84003fcc andi r16,r16,255 - 990: 8400201c xori r16,r16,128 - 994: 843fe004 addi r16,r16,-128 - 998: 8009883a mov r4,r16 - 99c: 01401904 movi r5,100 - 9a0: 00011dc0 call 11dc <__divsi3> - 9a4: 11003fcc andi r4,r2,255 - 9a8: 2100201c xori r4,r4,128 - 9ac: 213fe004 addi r4,r4,-128 - 9b0: 01400284 movi r5,10 - 9b4: 000123c0 call 123c <__modsi3> - buf[2] = val/10%10 + '0'; - 9b8: 8009883a mov r4,r16 - 9bc: 01400284 movi r5,10 - val = -num; - } else { - buf[0] = ' '; - val = num; - } - buf[1] = val/100%10 + '0'; - 9c0: 14c00c04 addi r19,r2,48 - buf[2] = val/10%10 + '0'; - 9c4: 00011dc0 call 11dc <__divsi3> - 9c8: 11003fcc andi r4,r2,255 - 9cc: 2100201c xori r4,r4,128 - 9d0: 213fe004 addi r4,r4,-128 - 9d4: 01400284 movi r5,10 - 9d8: 000123c0 call 123c <__modsi3> - buf[3] = val%10 + '0'; - 9dc: 8009883a mov r4,r16 - 9e0: 01400284 movi r5,10 - } else { - buf[0] = ' '; - val = num; - } - buf[1] = val/100%10 + '0'; - buf[2] = val/10%10 + '0'; - 9e4: 14000c04 addi r16,r2,48 - buf[3] = val%10 + '0'; - 9e8: 000123c0 call 123c <__modsi3> - 9ec: 10c00c04 addi r3,r2,48 - -void print_number(char num) { - int i; - char buf[5]; - char val; - for (i = 0; i < 4; i++) { - 9f0: 94800044 addi r18,r18,1 - 9f4: 00800104 movi r2,4 - 9f8: 90bfdc1e bne r18,r2,96c - } - buf[1] = val/100%10 + '0'; - buf[2] = val/10%10 + '0'; - buf[3] = val%10 + '0'; - } - clear_block(HEX0_3); - 9fc: 0009883a mov r4,zero - a00: d8c000c5 stb r3,3(sp) - a04: dc000085 stb r16,2(sp) - a08: dcc00045 stb r19,1(sp) - a0c: dd000005 stb r20,0(sp) - a10: 00008f80 call 8f8 - print_block(buf, 4, HEX0_3); - a14: 900b883a mov r5,r18 - a18: d809883a mov r4,sp - a1c: 000d883a mov r6,zero - a20: 000081c0 call 81c -} - a24: dfc00717 ldw ra,28(sp) - a28: dd000617 ldw r20,24(sp) - a2c: dcc00517 ldw r19,20(sp) - a30: dc800417 ldw r18,16(sp) - a34: dc400317 ldw r17,12(sp) - a38: dc000217 ldw r16,8(sp) - a3c: dec00804 addi sp,sp,32 - a40: f800283a ret - -00000a44 : - global_registers[Ssw_rw] = (char)s.splited.rw_mode; - global_registers[Ssw_run] = (char)s.splited.run_mode; -} - -enum PushEvent push_decode(char psw) { - switch(psw) { - a44: 21003fcc andi r4,r4,255 - a48: 2100201c xori r4,r4,128 - a4c: 213fe004 addi r4,r4,-128 - a50: 00800144 movi r2,5 - a54: 20800826 beq r4,r2,a78 - a58: 00800184 movi r2,6 - a5c: 00c00104 movi r3,4 - a60: 20800626 beq r4,r2,a7c - a64: 008000c4 movi r2,3 - a68: 0007883a mov r3,zero - a6c: 2080031e bne r4,r2,a7c - a70: 00c00084 movi r3,2 - a74: 00000106 br a7c - case 0x3: - return PUSH_VALSTR; - a78: 00c000c4 movi r3,3 - case 0x6: - return PUSH_RUN; - break; - } - return PUSH_NONE; -} - a7c: 1805883a mov r2,r3 - a80: f800283a ret - -00000a84 : - -void push_int() { - static unsigned char status = 0; - static enum PushEvent event_code; - volatile sw_t s; - s.sw = *switches; - a84: 00942404 movi r2,20624 - a88: 10800017 ldw r2,0(r2) - - switch (status) { - a8c: d0e04403 ldbu r3,-32496(gp) - break; - } - return PUSH_NONE; -} - -void push_int() { - a90: deffff04 addi sp,sp,-4 - static unsigned char status = 0; - static enum PushEvent event_code; - volatile sw_t s; - s.sw = *switches; - - switch (status) { - a94: 01000044 movi r4,1 - -void push_int() { - static unsigned char status = 0; - static enum PushEvent event_code; - volatile sw_t s; - s.sw = *switches; - a98: d8800015 stw r2,0(sp) - - switch (status) { - a9c: 19003726 beq r3,r4,b7c - aa0: 19000336 bltu r3,r4,ab0 - aa4: 00800084 movi r2,2 - aa8: 1880421e bne r3,r2,bb4 - aac: 00003d06 br ba4 - case 0: - PUSH_EVENT = PUSH_NONE; - if (*push_switches != 7) { - ab0: 01142004 movi r4,20608 - ab4: 20800003 ldbu r2,0(r4) - ab8: 00c001c4 movi r3,7 - volatile sw_t s; - s.sw = *switches; - - switch (status) { - case 0: - PUSH_EVENT = PUSH_NONE; - abc: d0204205 stb zero,-32504(gp) - if (*push_switches != 7) { - ac0: 10803fcc andi r2,r2,255 - ac4: 1080201c xori r2,r2,128 - ac8: 10bfe004 addi r2,r2,-128 - acc: 10c01526 beq r2,r3,b24 - event_code = push_decode(*push_switches); - ad0: 20800003 ldbu r2,0(r4) - global_registers[Ssw_rw] = (char)s.splited.rw_mode; - global_registers[Ssw_run] = (char)s.splited.run_mode; -} - -enum PushEvent push_decode(char psw) { - switch(psw) { - ad4: 10c03fcc andi r3,r2,255 - ad8: 18c0201c xori r3,r3,128 - adc: 18ffe004 addi r3,r3,-128 - ae0: 00800144 movi r2,5 - ae4: 18800b26 beq r3,r2,b14 - ae8: 00800184 movi r2,6 - aec: 18800326 beq r3,r2,afc - af0: 008000c4 movi r2,3 - af4: 1880031e bne r3,r2,b04 - af8: 00000406 br b0c - afc: 00800104 movi r2,4 - b00: 00000506 br b18 - b04: 0005883a mov r2,zero - b08: 00000306 br b18 - b0c: 00800084 movi r2,2 - b10: 00000106 br b18 - b14: 008000c4 movi r2,3 - - switch (status) { - case 0: - PUSH_EVENT = PUSH_NONE; - if (*push_switches != 7) { - event_code = push_decode(*push_switches); - b18: d0a04315 stw r2,-32500(gp) - status = 1; - b1c: 00800044 movi r2,1 - b20: d0a04405 stb r2,-32496(gp) - b24: d8800017 ldw r2,0(sp) -void in_int() { - push_int(); -} - -static void update_sw_reg(sw_t s) { - global_registers[Ssw_data] = (char)s.data.value; - b28: 00c00034 movhi r3,0 - b2c: 18c8d404 addi r3,r3,9040 - b30: 1012d2ba srli r9,r2,10 - global_registers[Ssw_inst] = (char)s.splited.instruction_code; - b34: 1008d3ba srli r4,r2,14 - global_registers[Ssw_memi] = (char)s.splited.memory_index; - b38: 100ad1ba srli r5,r2,6 - global_registers[Ssw_regi] = (char)s.splited.register_index; - global_registers[Ssw_psel] = (char)s.splited.program_selecter; - b3c: 100cd0ba srli r6,r2,2 - global_registers[Ssw_rw] = (char)s.splited.rw_mode; - b40: 100ed07a srli r7,r2,1 - push_int(); -} - -static void update_sw_reg(sw_t s) { - global_registers[Ssw_data] = (char)s.data.value; - global_registers[Ssw_inst] = (char)s.splited.instruction_code; - b44: 210003cc andi r4,r4,15 - global_registers[Ssw_memi] = (char)s.splited.memory_index; - b48: 294003cc andi r5,r5,15 - global_registers[Ssw_regi] = (char)s.splited.register_index; - b4c: 4a0003cc andi r8,r9,15 - global_registers[Ssw_psel] = (char)s.splited.program_selecter; - b50: 318003cc andi r6,r6,15 - global_registers[Ssw_rw] = (char)s.splited.rw_mode; - b54: 39c0004c andi r7,r7,1 - global_registers[Ssw_run] = (char)s.splited.run_mode; - b58: 1080004c andi r2,r2,1 - b5c: 18800345 stb r2,13(r3) - push_int(); -} - -static void update_sw_reg(sw_t s) { - global_registers[Ssw_data] = (char)s.data.value; - global_registers[Ssw_inst] = (char)s.splited.instruction_code; - b60: 19000205 stb r4,8(r3) - global_registers[Ssw_memi] = (char)s.splited.memory_index; - b64: 19400285 stb r5,10(r3) - global_registers[Ssw_regi] = (char)s.splited.register_index; - b68: 1a000245 stb r8,9(r3) - global_registers[Ssw_psel] = (char)s.splited.program_selecter; - b6c: 198002c5 stb r6,11(r3) - global_registers[Ssw_rw] = (char)s.splited.rw_mode; - b70: 19c00305 stb r7,12(r3) -void in_int() { - push_int(); -} - -static void update_sw_reg(sw_t s) { - global_registers[Ssw_data] = (char)s.data.value; - b74: 1a4001c5 stb r9,7(r3) - b78: 00000f06 br bb8 - status = 1; - } - update_sw_reg(s); // �X�C�b�`���W�X�^�X�V - break; - case 1: - if (*push_switches == 7) status = 2; - b7c: 00942004 movi r2,20608 - b80: 10800003 ldbu r2,0(r2) - b84: 00c001c4 movi r3,7 - b88: 10803fcc andi r2,r2,255 - b8c: 1080201c xori r2,r2,128 - b90: 10bfe004 addi r2,r2,-128 - b94: 10c0081e bne r2,r3,bb8 - b98: 00800084 movi r2,2 - b9c: d0a04405 stb r2,-32496(gp) - ba0: 00000506 br bb8 - break; - case 2: - PUSH_EVENT = event_code; - ba4: d0a04317 ldw r2,-32500(gp) - status = 0; - ba8: d0204405 stb zero,-32496(gp) - break; - case 1: - if (*push_switches == 7) status = 2; - break; - case 2: - PUSH_EVENT = event_code; - bac: d0a04205 stb r2,-32504(gp) - bb0: 00000106 br bb8 - status = 0; - break; - default: - status = 0; - bb4: d0204405 stb zero,-32496(gp) - break; - } -} - bb8: dec00104 addi sp,sp,4 - bbc: f800283a ret - -00000bc0 : -#include "sys_register.h" - -unsigned char PUSH_EVENT = PUSH_NONE; - -void in_int() { - push_int(); - bc0: 0000a841 jmpi a84 - -00000bc4 : - break; - } -} - -void inst_jump(enum Register reg, unsigned char memory_index){ - global_registers[Spc]=global_registers[reg]+memory_index; - bc4: 00c00034 movhi r3,0 - bc8: 18c8d404 addi r3,r3,9040 - bcc: 20c9883a add r4,r4,r3 - bd0: 20800003 ldbu r2,0(r4) - bd4: 288b883a add r5,r5,r2 - bd8: 19400045 stb r5,1(r3) -} - bdc: f800283a ret - -00000be0 : -void inst_store(enum Register reg, unsigned char memory_index){ - memory_store(memory_index, reg); -} -void inst_delay(enum Register reg, unsigned char memory_index){ - //���W�X�^�̒l*10ms�҂� -} - be0: f800283a ret - -00000be4 : -void inst_add(enum Register reg, unsigned char memory_index){ - global_registers[Sacc]+=global_registers[reg]; - be4: 00c00034 movhi r3,0 - be8: 18c8d404 addi r3,r3,9040 - bec: 20c9883a add r4,r4,r3 - bf0: 21000003 ldbu r4,0(r4) - bf4: 18800143 ldbu r2,5(r3) - bf8: 1105883a add r2,r2,r4 - bfc: 18800145 stb r2,5(r3) -} - c00: f800283a ret - -00000c04 : -void inst_comp(enum Register reg, unsigned char memory_index){ - if(global_registers[Sacc]==global_registers[reg]){ - c04: 00c00034 movhi r3,0 - c08: 18c8d404 addi r3,r3,9040 - c0c: 20c9883a add r4,r4,r3 - c10: 21000007 ldb r4,0(r4) - c14: 18800147 ldb r2,5(r3) - c18: 1100021e bne r2,r4,c24 - global_registers[Sflg]=0; - c1c: 18000185 stb zero,6(r3) - c20: f800283a ret - } else if(global_registers[Sacc] > global_registers[reg]){ - c24: 2080020e bge r4,r2,c30 - global_registers[Sflg]=-1; - c28: 00bfffc4 movi r2,-1 - c2c: 00000106 br c34 - }else{ - global_registers[Sflg]=1; - c30: 00800044 movi r2,1 - c34: 18800185 stb r2,6(r3) - c38: f800283a ret - -00000c3c : - } -} -void inst_jeq(enum Register reg, unsigned char memory_index){ - if(global_registers[Sflg]==global_registers[reg]){ - c3c: 01400034 movhi r5,0 - c40: 2948d404 addi r5,r5,9040 - c44: 2149883a add r4,r4,r5 - c48: 20c00007 ldb r3,0(r4) - c4c: 28800187 ldb r2,6(r5) - c50: 10c0031e bne r2,r3,c60 - global_registers[Spc]++; - c54: 28800043 ldbu r2,1(r5) - c58: 10800044 addi r2,r2,1 - c5c: 28800045 stb r2,1(r5) - c60: f800283a ret - -00000c64 : - } -} -void inst_jne(enum Register reg, unsigned char memory_index){ - if(global_registers[Sflg]!=global_registers[reg]){ - c64: 01400034 movhi r5,0 - c68: 2948d404 addi r5,r5,9040 - c6c: 2149883a add r4,r4,r5 - c70: 20c00007 ldb r3,0(r4) - c74: 28800187 ldb r2,6(r5) - c78: 10c00326 beq r2,r3,c88 - global_registers[Spc]++; - c7c: 28800043 ldbu r2,1(r5) - c80: 10800044 addi r2,r2,1 - c84: 28800045 stb r2,1(r5) - c88: f800283a ret - -00000c8c : - } -} -void inst_jieq(char im, unsigned char memory_index){ - if(global_registers[Sflg]==im){ - c8c: 00c00034 movhi r3,0 - c90: 18c8d404 addi r3,r3,9040 - c94: 21003fcc andi r4,r4,255 - c98: 18800187 ldb r2,6(r3) - c9c: 2100201c xori r4,r4,128 - ca0: 213fe004 addi r4,r4,-128 - ca4: 1100031e bne r2,r4,cb4 - global_registers[Spc]++; - ca8: 18800043 ldbu r2,1(r3) - cac: 10800044 addi r2,r2,1 - cb0: 18800045 stb r2,1(r3) - cb4: f800283a ret - -00000cb8 : - } -} -void inst_jine(char im, unsigned char memory_index){ - if(global_registers[Sflg]!=im){ - cb8: 00c00034 movhi r3,0 - cbc: 18c8d404 addi r3,r3,9040 - cc0: 21003fcc andi r4,r4,255 - cc4: 18800187 ldb r2,6(r3) - cc8: 2100201c xori r4,r4,128 - ccc: 213fe004 addi r4,r4,-128 - cd0: 11000326 beq r2,r4,ce0 - global_registers[Spc]++; - cd4: 18800043 ldbu r2,1(r3) - cd8: 10800044 addi r2,r2,1 - cdc: 18800045 stb r2,1(r3) - ce0: f800283a ret - -00000ce4 : - print_block(buf, 4, HEX0_3); -} -void inst_load(enum Register reg, unsigned char memory_index){ - memory_load(memory_index, reg); -} -void inst_store(enum Register reg, unsigned char memory_index){ - ce4: 2005883a mov r2,r4 - memory_store(memory_index, reg); - ce8: 29003fcc andi r4,r5,255 - cec: 100b883a mov r5,r2 - cf0: 00010a81 jmpi 10a8 - -00000cf4 : - char buf[5]; - memory_load(memory_index, Sseg); - sprintf(buf, "%04d", global_registers[Sseg]); - print_block(buf, 4, HEX0_3); -} -void inst_load(enum Register reg, unsigned char memory_index){ - cf4: 2005883a mov r2,r4 - memory_load(memory_index, reg); - cf8: 29003fcc andi r4,r5,255 - cfc: 100b883a mov r5,r2 - d00: 00010381 jmpi 1038 - -00000d04 : -} - -void inst_jump(enum Register reg, unsigned char memory_index){ - global_registers[Spc]=global_registers[reg]+memory_index; -} -void inst_output(enum Register reg, unsigned char memory_index){ - d04: defffd04 addi sp,sp,-12 - //�������̒l��7�Z�O�ɕ\�� - char buf[5]; - memory_load(memory_index, Sseg); - d08: 29003fcc andi r4,r5,255 - d0c: 01400384 movi r5,14 -} - -void inst_jump(enum Register reg, unsigned char memory_index){ - global_registers[Spc]=global_registers[reg]+memory_index; -} -void inst_output(enum Register reg, unsigned char memory_index){ - d10: dfc00215 stw ra,8(sp) - //�������̒l��7�Z�O�ɕ\�� - char buf[5]; - memory_load(memory_index, Sseg); - d14: 00010380 call 1038 - sprintf(buf, "%04d", global_registers[Sseg]); - d18: 00800034 movhi r2,0 - d1c: 1088d404 addi r2,r2,9040 - d20: 11800387 ldb r6,14(r2) - d24: d809883a mov r4,sp - d28: 01400034 movhi r5,0 - d2c: 29475604 addi r5,r5,7512 - d30: 00012e40 call 12e4 - print_block(buf, 4, HEX0_3); - d34: d809883a mov r4,sp - d38: 01400104 movi r5,4 - d3c: 000d883a mov r6,zero - d40: 000081c0 call 81c -} - d44: dfc00217 ldw ra,8(sp) - d48: dec00304 addi sp,sp,12 - d4c: f800283a ret - -00000d50 : -#include "sys_register.h" -#include "hex_out.h" -#include - -struct InstRec inst_fetch(){ - return inst_memory_load((unsigned int)global_registers[Spc]++); - d50: 00c00034 movhi r3,0 - d54: 18c8d404 addi r3,r3,9040 - d58: 18800043 ldbu r2,1(r3) -#include "sys_memory.h" -#include "sys_register.h" -#include "hex_out.h" -#include - -struct InstRec inst_fetch(){ - d5c: deffff04 addi sp,sp,-4 - d60: dfc00015 stw ra,0(sp) - return inst_memory_load((unsigned int)global_registers[Spc]++); - d64: 11003fcc andi r4,r2,255 - d68: 2100201c xori r4,r4,128 - d6c: 213fe004 addi r4,r4,-128 - d70: 10800044 addi r2,r2,1 - d74: 18800045 stb r2,1(r3) - d78: 0000fbc0 call fbc -} - d7c: dfc00017 ldw ra,0(sp) - d80: dec00104 addi sp,sp,4 - d84: f800283a ret - -00000d88 : - -void inst_decode(struct InstRec inst_rec){ - d88: 2004d13a srli r2,r4,4 - d8c: 2006d23a srli r3,r4,8 - switch(inst_rec.inst) { - d90: 210003cc andi r4,r4,15 - d94: 21bfffc4 addi r6,r4,-1 - -struct InstRec inst_fetch(){ - return inst_memory_load((unsigned int)global_registers[Spc]++); -} - -void inst_decode(struct InstRec inst_rec){ - d98: 114003cc andi r5,r2,15 - switch(inst_rec.inst) { - d9c: 00800284 movi r2,10 - -struct InstRec inst_fetch(){ - return inst_memory_load((unsigned int)global_registers[Spc]++); -} - -void inst_decode(struct InstRec inst_rec){ - da0: 190003cc andi r4,r3,15 - switch(inst_rec.inst) { - da4: 11805336 bltu r2,r6,ef4 - da8: 3185883a add r2,r6,r6 - dac: 1085883a add r2,r2,r2 - db0: 00c00034 movhi r3,0 - db4: 18c37104 addi r3,r3,3524 - db8: 10c5883a add r2,r2,r3 - dbc: 10800017 ldw r2,0(r2) - dc0: 1000683a jmp r2 - dc4: 00000df0 cmpltui zero,zero,55 - dc8: 00000e10 cmplti zero,zero,56 - dcc: 00000e1c xori zero,zero,56 - dd0: 00000e28 cmpgeui zero,zero,56 - dd4: 00000ef4 movhi zero,59 - dd8: 00000e34 movhi zero,56 - ddc: 00000e58 cmpnei zero,zero,57 - de0: 00000e64 muli zero,zero,57 - de4: 00000e84 movi zero,58 - de8: 00000eb0 cmpltui zero,zero,58 - dec: 00000ed4 movui zero,59 - break; - } -} - -void inst_jump(enum Register reg, unsigned char memory_index){ - global_registers[Spc]=global_registers[reg]+memory_index; - df0: 00c00034 movhi r3,0 - df4: 18c8d404 addi r3,r3,9040 - df8: 20803fcc andi r2,r4,255 - dfc: 10c5883a add r2,r2,r3 - e00: 10800003 ldbu r2,0(r2) - e04: 2885883a add r2,r5,r2 - e08: 18800045 stb r2,1(r3) - e0c: f800283a ret - break; - case INST_JUMP: - inst_jump(inst_rec.regi, inst_rec.memi); - break; - case INST_OUTPUT: - inst_output(inst_rec.regi, inst_rec.memi); - e10: 21003fcc andi r4,r4,255 - e14: 29403fcc andi r5,r5,255 - e18: 0000d041 jmpi d04 - break; - case INST_LOAD: - inst_load(inst_rec.regi, inst_rec.memi); - e1c: 21003fcc andi r4,r4,255 - e20: 29403fcc andi r5,r5,255 - e24: 0000cf41 jmpi cf4 - break; - case INST_STORE: - inst_store(inst_rec.regi, inst_rec.memi); - e28: 21003fcc andi r4,r4,255 - e2c: 29403fcc andi r5,r5,255 - e30: 0000ce41 jmpi ce4 -} -void inst_delay(enum Register reg, unsigned char memory_index){ - //���W�X�^�̒l*10ms�҂� -} -void inst_add(enum Register reg, unsigned char memory_index){ - global_registers[Sacc]+=global_registers[reg]; - e34: 00c00034 movhi r3,0 - e38: 18c8d404 addi r3,r3,9040 - e3c: 20803fcc andi r2,r4,255 - e40: 10c5883a add r2,r2,r3 - e44: 11000003 ldbu r4,0(r2) - e48: 18800143 ldbu r2,5(r3) - e4c: 1105883a add r2,r2,r4 - e50: 18800145 stb r2,5(r3) - e54: f800283a ret - break; - case INST_ADD: - inst_add(inst_rec.regi, inst_rec.memi); - break; - case INST_COMP: - inst_comp(inst_rec.regi, inst_rec.memi); - e58: 21003fcc andi r4,r4,255 - e5c: 29403fcc andi r5,r5,255 - e60: 0000c041 jmpi c04 - }else{ - global_registers[Sflg]=1; - } -} -void inst_jeq(enum Register reg, unsigned char memory_index){ - if(global_registers[Sflg]==global_registers[reg]){ - e64: 20803fcc andi r2,r4,255 - e68: 01000034 movhi r4,0 - e6c: 2108d404 addi r4,r4,9040 - e70: 1105883a add r2,r2,r4 - e74: 10c00007 ldb r3,0(r2) - e78: 20800187 ldb r2,6(r4) - e7c: 10c01d1e bne r2,r3,ef4 - e80: 00000706 br ea0 - global_registers[Spc]++; - } -} -void inst_jne(enum Register reg, unsigned char memory_index){ - if(global_registers[Sflg]!=global_registers[reg]){ - e84: 20803fcc andi r2,r4,255 - e88: 01000034 movhi r4,0 - e8c: 2108d404 addi r4,r4,9040 - e90: 1105883a add r2,r2,r4 - e94: 10c00007 ldb r3,0(r2) - e98: 20800187 ldb r2,6(r4) - e9c: 10c01526 beq r2,r3,ef4 - global_registers[Spc]++; - ea0: 20800043 ldbu r2,1(r4) - ea4: 10800044 addi r2,r2,1 - ea8: 20800045 stb r2,1(r4) - eac: f800283a ret - } -} -void inst_jieq(char im, unsigned char memory_index){ - if(global_registers[Sflg]==im){ - eb0: 01400034 movhi r5,0 - eb4: 2948d404 addi r5,r5,9040 - eb8: 28c00187 ldb r3,6(r5) - ebc: 208003cc andi r2,r4,15 - ec0: 18800c1e bne r3,r2,ef4 - global_registers[Spc]++; - ec4: 28800043 ldbu r2,1(r5) - ec8: 10800044 addi r2,r2,1 - ecc: 28800045 stb r2,1(r5) - ed0: f800283a ret - } -} -void inst_jine(char im, unsigned char memory_index){ - if(global_registers[Sflg]!=im){ - ed4: 01400034 movhi r5,0 - ed8: 2948d404 addi r5,r5,9040 - edc: 28c00187 ldb r3,6(r5) - ee0: 208003cc andi r2,r4,15 - ee4: 18800326 beq r3,r2,ef4 - global_registers[Spc]++; - ee8: 28800043 ldbu r2,1(r5) - eec: 10800044 addi r2,r2,1 - ef0: 28800045 stb r2,1(r5) - ef4: f800283a ret - -00000ef8 : - -/************************************************** - * Impl - **************************************************/ - -void memory_init() { - ef8: 000b883a mov r5,zero - efc: 00000806 br f20 - int i, j; - for (i = 0; i < MEMS_COUNT; i++) - for (j = 0; j < MEM_SIZE; j++) { - f00: 21000044 addi r4,r4,1 - f04: 00800404 movi r2,16 - memory[i][j] = 0; - f08: 18000005 stb zero,0(r3) - **************************************************/ - -void memory_init() { - int i, j; - for (i = 0; i < MEMS_COUNT; i++) - for (j = 0; j < MEM_SIZE; j++) { - f0c: 18c00044 addi r3,r3,1 - f10: 20bffb1e bne r4,r2,f00 - * Impl - **************************************************/ - -void memory_init() { - int i, j; - for (i = 0; i < MEMS_COUNT; i++) - f14: 29400044 addi r5,r5,1 - f18: 00800104 movi r2,4 - f1c: 28800626 beq r5,r2,f38 - for (j = 0; j < MEM_SIZE; j++) { - memory[i][j] = 0; - } -} - f20: 2806913a slli r3,r5,4 - f24: 00800034 movhi r2,0 - f28: 10888404 addi r2,r2,8720 - f2c: 0009883a mov r4,zero - f30: 1887883a add r3,r3,r2 - f34: 003ff206 br f00 - f38: f800283a ret - -00000f3c : - -void inst_memory_store(unsigned int mem_addr, struct InstRec inst_rec){ - inst_memory[global_current_memory][mem_addr] = inst_rec; - f3c: d1a04517 ldw r6,-32492(gp) - f40: 2810d23a srli r8,r5,8 - for (j = 0; j < MEM_SIZE; j++) { - memory[i][j] = 0; - } -} - -void inst_memory_store(unsigned int mem_addr, struct InstRec inst_rec){ - f44: 024003c4 movi r9,15 - inst_memory[global_current_memory][mem_addr] = inst_rec; - f48: 300c913a slli r6,r6,4 - for (j = 0; j < MEM_SIZE; j++) { - memory[i][j] = 0; - } -} - -void inst_memory_store(unsigned int mem_addr, struct InstRec inst_rec){ - f4c: 280ed13a srli r7,r5,4 - inst_memory[global_current_memory][mem_addr] = inst_rec; - f50: 00800034 movhi r2,0 - f54: 10889404 addi r2,r2,8784 - f58: 310d883a add r6,r6,r4 - f5c: 318d883a add r6,r6,r6 - f60: 318d883a add r6,r6,r6 - f64: 010003c4 movi r4,15 - f68: 308d883a add r6,r6,r2 - f6c: 4250703a and r8,r8,r9 - f70: 4110703a and r8,r8,r4 - f74: 30800017 ldw r2,0(r6) - for (j = 0; j < MEM_SIZE; j++) { - memory[i][j] = 0; - } -} - -void inst_memory_store(unsigned int mem_addr, struct InstRec inst_rec){ - f78: 3a4e703a and r7,r7,r9 - inst_memory[global_current_memory][mem_addr] = inst_rec; - f7c: 4010923a slli r8,r8,8 - f80: 21ce703a and r7,r4,r7 - f84: 00fc3fc4 movi r3,-3841 - f88: 10c4703a and r2,r2,r3 - f8c: 380e913a slli r7,r7,4 - f90: 00ffc3c4 movi r3,-241 - f94: 1204b03a or r2,r2,r8 - f98: 10c4703a and r2,r2,r3 - f9c: 11c4b03a or r2,r2,r7 - for (j = 0; j < MEM_SIZE; j++) { - memory[i][j] = 0; - } -} - -void inst_memory_store(unsigned int mem_addr, struct InstRec inst_rec){ - fa0: 2a4a703a and r5,r5,r9 - inst_memory[global_current_memory][mem_addr] = inst_rec; - fa4: 00fffc04 movi r3,-16 - fa8: 2148703a and r4,r4,r5 - fac: 10c4703a and r2,r2,r3 - fb0: 1104b03a or r2,r2,r4 - fb4: 30800015 stw r2,0(r6) -} - fb8: f800283a ret - -00000fbc : -struct InstRec inst_memory_load(unsigned int mem_addr){ - return inst_memory[global_current_memory][mem_addr]; - fbc: d0a04517 ldw r2,-32492(gp) - fc0: 00c00034 movhi r3,0 - fc4: 18c89404 addi r3,r3,8784 - fc8: 01c003c4 movi r7,15 - fcc: 1004913a slli r2,r2,4 - fd0: 018003c4 movi r6,15 - fd4: 1105883a add r2,r2,r4 - fd8: 1085883a add r2,r2,r2 - fdc: 1085883a add r2,r2,r2 - fe0: 10c5883a add r2,r2,r3 - fe4: 11400017 ldw r5,0(r2) - fe8: 00bc3fc4 movi r2,-3841 - fec: 1084703a and r2,r2,r2 - ff0: 2806d23a srli r3,r5,8 - ff4: 2808d13a srli r4,r5,4 - ff8: 29ca703a and r5,r5,r7 - ffc: 19c6703a and r3,r3,r7 - 1000: 1986703a and r3,r3,r6 - 1004: 21c8703a and r4,r4,r7 - 1008: 1806923a slli r3,r3,8 - 100c: 3108703a and r4,r6,r4 - 1010: 2008913a slli r4,r4,4 - 1014: 10c4b03a or r2,r2,r3 - 1018: 00ffc3c4 movi r3,-241 - 101c: 10c4703a and r2,r2,r3 - 1020: 1104b03a or r2,r2,r4 - 1024: 00fffc04 movi r3,-16 - 1028: 314c703a and r6,r6,r5 - 102c: 10c4703a and r2,r2,r3 -} - 1030: 1184b03a or r2,r2,r6 - 1034: f800283a ret - -00001038 : - if (!(mem_addr < MEM_SIZE)) panic(); - memory[global_current_memory][mem_addr] = global_registers[reg]; - return memory[global_current_memory][mem_addr]; -} - -char memory_load(unsigned int mem_addr, enum Register reg) { - 1038: defffd04 addi sp,sp,-12 - if (!(mem_addr < MEM_SIZE)) panic(); - 103c: 008003c4 movi r2,15 - if (!(mem_addr < MEM_SIZE)) panic(); - memory[global_current_memory][mem_addr] = global_registers[reg]; - return memory[global_current_memory][mem_addr]; -} - -char memory_load(unsigned int mem_addr, enum Register reg) { - 1040: dc400115 stw r17,4(sp) - 1044: dc000015 stw r16,0(sp) - 1048: dfc00215 stw ra,8(sp) - 104c: 2021883a mov r16,r4 - 1050: 2823883a mov r17,r5 - if (!(mem_addr < MEM_SIZE)) panic(); - 1054: 1100012e bgeu r2,r4,105c - 1058: 00011340 call 1134 - global_registers[reg] = memory[global_current_memory][mem_addr]; - 105c: d0a04517 ldw r2,-32492(gp) - 1060: 00c00034 movhi r3,0 - 1064: 18c88404 addi r3,r3,8720 - 1068: 01000034 movhi r4,0 - 106c: 2108d404 addi r4,r4,9040 - 1070: 1004913a slli r2,r2,4 - 1074: 8909883a add r4,r17,r4 - 1078: 10c5883a add r2,r2,r3 - 107c: 1405883a add r2,r2,r16 - 1080: 10800003 ldbu r2,0(r2) - 1084: 20800005 stb r2,0(r4) - return global_registers[reg]; -} - 1088: 10803fcc andi r2,r2,255 - 108c: 1080201c xori r2,r2,128 - 1090: 10bfe004 addi r2,r2,-128 - 1094: dfc00217 ldw ra,8(sp) - 1098: dc400117 ldw r17,4(sp) - 109c: dc000017 ldw r16,0(sp) - 10a0: dec00304 addi sp,sp,12 - 10a4: f800283a ret - -000010a8 : -} -struct InstRec inst_memory_load(unsigned int mem_addr){ - return inst_memory[global_current_memory][mem_addr]; -} - -char memory_store(unsigned int mem_addr, enum Register reg) { - 10a8: defffd04 addi sp,sp,-12 - if (!(mem_addr < MEM_SIZE)) panic(); - 10ac: 008003c4 movi r2,15 -} -struct InstRec inst_memory_load(unsigned int mem_addr){ - return inst_memory[global_current_memory][mem_addr]; -} - -char memory_store(unsigned int mem_addr, enum Register reg) { - 10b0: dc400115 stw r17,4(sp) - 10b4: dc000015 stw r16,0(sp) - 10b8: dfc00215 stw ra,8(sp) - 10bc: 2023883a mov r17,r4 - 10c0: 2821883a mov r16,r5 - if (!(mem_addr < MEM_SIZE)) panic(); - 10c4: 1100012e bgeu r2,r4,10cc - 10c8: 00011340 call 1134 - memory[global_current_memory][mem_addr] = global_registers[reg]; - 10cc: d0e04517 ldw r3,-32492(gp) - 10d0: 00800034 movhi r2,0 - 10d4: 1088d404 addi r2,r2,9040 - 10d8: 8085883a add r2,r16,r2 - 10dc: 1806913a slli r3,r3,4 - 10e0: 10800003 ldbu r2,0(r2) - 10e4: 01000034 movhi r4,0 - 10e8: 21088404 addi r4,r4,8720 - 10ec: 1907883a add r3,r3,r4 - 10f0: 1c47883a add r3,r3,r17 - 10f4: 18800005 stb r2,0(r3) - return memory[global_current_memory][mem_addr]; -} - 10f8: 10803fcc andi r2,r2,255 - 10fc: 1080201c xori r2,r2,128 - 1100: 10bfe004 addi r2,r2,-128 - 1104: dfc00217 ldw ra,8(sp) - 1108: dc400117 ldw r17,4(sp) - 110c: dc000017 ldw r16,0(sp) - 1110: dec00304 addi sp,sp,12 - 1114: f800283a ret - -00001118 : - */ -#include "sys_register.h" - -char global_registers[REG_MAX_COUNT]; - -void registers_init() { - 1118: 00800034 movhi r2,0 - 111c: 1088d404 addi r2,r2,9040 - 1120: 10c003c4 addi r3,r2,15 - int i; - for (i = 0; i < REG_MAX_COUNT; i++) global_registers[i] = 0; - 1124: 10000005 stb zero,0(r2) - 1128: 10800044 addi r2,r2,1 - 112c: 10fffd1e bne r2,r3,1124 -} - 1130: f800283a ret - -00001134 : - * Author: takayun - */ -#include "system.h" -#include "hex_out.h" - -void panic() { - 1134: deffff04 addi sp,sp,-4 - clear_block(HEX0_3); - 1138: 0009883a mov r4,zero - * Author: takayun - */ -#include "system.h" -#include "hex_out.h" - -void panic() { - 113c: dfc00015 stw ra,0(sp) - clear_block(HEX0_3); - 1140: 00008f80 call 8f8 - print_block("err ", 4, HEX0_3); - 1144: 01400104 movi r5,4 - 1148: 01000034 movhi r4,0 - 114c: 21076004 addi r4,r4,7552 - 1150: 000d883a mov r6,zero -} - 1154: dfc00017 ldw ra,0(sp) - 1158: dec00104 addi sp,sp,4 -#include "system.h" -#include "hex_out.h" - -void panic() { - clear_block(HEX0_3); - print_block("err ", 4, HEX0_3); - 115c: 000081c1 jmpi 81c - -00001160 : - 1160: 29001b2e bgeu r5,r4,11d0 - 1164: 28001a16 blt r5,zero,11d0 - 1168: 00800044 movi r2,1 - 116c: 0007883a mov r3,zero - 1170: 01c007c4 movi r7,31 - 1174: 00000306 br 1184 - 1178: 19c01326 beq r3,r7,11c8 - 117c: 18c00044 addi r3,r3,1 - 1180: 28000416 blt r5,zero,1194 - 1184: 294b883a add r5,r5,r5 - 1188: 1085883a add r2,r2,r2 - 118c: 293ffa36 bltu r5,r4,1178 - 1190: 10000d26 beq r2,zero,11c8 - 1194: 0007883a mov r3,zero - 1198: 21400236 bltu r4,r5,11a4 - 119c: 2149c83a sub r4,r4,r5 - 11a0: 1886b03a or r3,r3,r2 - 11a4: 1004d07a srli r2,r2,1 - 11a8: 280ad07a srli r5,r5,1 - 11ac: 103ffa1e bne r2,zero,1198 - 11b0: 30000226 beq r6,zero,11bc - 11b4: 2005883a mov r2,r4 - 11b8: f800283a ret - 11bc: 1809883a mov r4,r3 - 11c0: 2005883a mov r2,r4 - 11c4: f800283a ret - 11c8: 0007883a mov r3,zero - 11cc: 003ff806 br 11b0 - 11d0: 00800044 movi r2,1 - 11d4: 0007883a mov r3,zero - 11d8: 003fef06 br 1198 - -000011dc <__divsi3>: - 11dc: defffe04 addi sp,sp,-8 - 11e0: dc000015 stw r16,0(sp) - 11e4: dfc00115 stw ra,4(sp) - 11e8: 0021883a mov r16,zero - 11ec: 20000c16 blt r4,zero,1220 <__divsi3+0x44> - 11f0: 000d883a mov r6,zero - 11f4: 28000e16 blt r5,zero,1230 <__divsi3+0x54> - 11f8: 00011600 call 1160 - 11fc: 1007883a mov r3,r2 - 1200: 8005003a cmpeq r2,r16,zero - 1204: 1000011e bne r2,zero,120c <__divsi3+0x30> - 1208: 00c7c83a sub r3,zero,r3 - 120c: 1805883a mov r2,r3 - 1210: dfc00117 ldw ra,4(sp) - 1214: dc000017 ldw r16,0(sp) - 1218: dec00204 addi sp,sp,8 - 121c: f800283a ret - 1220: 0109c83a sub r4,zero,r4 - 1224: 04000044 movi r16,1 - 1228: 000d883a mov r6,zero - 122c: 283ff20e bge r5,zero,11f8 <__divsi3+0x1c> - 1230: 014bc83a sub r5,zero,r5 - 1234: 8021003a cmpeq r16,r16,zero - 1238: 003fef06 br 11f8 <__divsi3+0x1c> - -0000123c <__modsi3>: - 123c: deffff04 addi sp,sp,-4 - 1240: dfc00015 stw ra,0(sp) - 1244: 01800044 movi r6,1 - 1248: 2807883a mov r3,r5 - 124c: 20000416 blt r4,zero,1260 <__modsi3+0x24> - 1250: 28000c16 blt r5,zero,1284 <__modsi3+0x48> - 1254: dfc00017 ldw ra,0(sp) - 1258: dec00104 addi sp,sp,4 - 125c: 00011601 jmpi 1160 - 1260: 0109c83a sub r4,zero,r4 - 1264: 28000b16 blt r5,zero,1294 <__modsi3+0x58> - 1268: 180b883a mov r5,r3 - 126c: 01800044 movi r6,1 - 1270: 00011600 call 1160 - 1274: 0085c83a sub r2,zero,r2 - 1278: dfc00017 ldw ra,0(sp) - 127c: dec00104 addi sp,sp,4 - 1280: f800283a ret - 1284: 014bc83a sub r5,zero,r5 - 1288: dfc00017 ldw ra,0(sp) - 128c: dec00104 addi sp,sp,4 - 1290: 00011601 jmpi 1160 - 1294: 0147c83a sub r3,zero,r5 - 1298: 003ff306 br 1268 <__modsi3+0x2c> - -0000129c <__udivsi3>: - 129c: 000d883a mov r6,zero - 12a0: 00011601 jmpi 1160 - -000012a4 <__umodsi3>: - 12a4: 01800044 movi r6,1 - 12a8: 00011601 jmpi 1160 - -000012ac <__mulsi3>: - 12ac: 20000a26 beq r4,zero,12d8 <__mulsi3+0x2c> - 12b0: 0007883a mov r3,zero - 12b4: 2080004c andi r2,r4,1 - 12b8: 1005003a cmpeq r2,r2,zero - 12bc: 2008d07a srli r4,r4,1 - 12c0: 1000011e bne r2,zero,12c8 <__mulsi3+0x1c> - 12c4: 1947883a add r3,r3,r5 - 12c8: 294b883a add r5,r5,r5 - 12cc: 203ff91e bne r4,zero,12b4 <__mulsi3+0x8> - 12d0: 1805883a mov r2,r3 - 12d4: f800283a ret - 12d8: 0007883a mov r3,zero - 12dc: 1805883a mov r2,r3 - 12e0: f800283a ret - -000012e4 : - 12e4: defff504 addi sp,sp,-44 - 12e8: 2015883a mov r10,r4 - 12ec: dfc00815 stw ra,32(sp) - 12f0: d9800915 stw r6,36(sp) - 12f4: d9c00a15 stw r7,40(sp) - 12f8: d8800904 addi r2,sp,36 - 12fc: d8800015 stw r2,0(sp) - 1300: 00800034 movhi r2,0 - 1304: 10883c04 addi r2,r2,8432 - 1308: 11000017 ldw r4,0(r2) - 130c: d9c00017 ldw r7,0(sp) - 1310: 00808204 movi r2,520 - 1314: 02200034 movhi r8,32768 - 1318: 423fffc4 addi r8,r8,-1 - 131c: 280d883a mov r6,r5 - 1320: d880010d sth r2,4(sp) - 1324: 00c00034 movhi r3,0 - 1328: 18c6c604 addi r3,r3,6936 - 132c: d9400104 addi r5,sp,4 - 1330: 00bfffc4 movi r2,-1 - 1334: d8c00215 stw r3,8(sp) - 1338: da800315 stw r10,12(sp) - 133c: da000415 stw r8,16(sp) - 1340: d880018d sth r2,6(sp) - 1344: da800515 stw r10,20(sp) - 1348: da000615 stw r8,24(sp) - 134c: d8000715 stw zero,28(sp) - 1350: 00014580 call 1458 <___vfprintf_internal_r> - 1354: d8c00517 ldw r3,20(sp) - 1358: 18000005 stb zero,0(r3) - 135c: dfc00817 ldw ra,32(sp) - 1360: dec00b04 addi sp,sp,44 - 1364: f800283a ret - -00001368 <_sprintf_r>: - 1368: defff604 addi sp,sp,-40 - 136c: 2815883a mov r10,r5 - 1370: dfc00815 stw ra,32(sp) - 1374: d9c00915 stw r7,36(sp) - 1378: d8800904 addi r2,sp,36 - 137c: d8800015 stw r2,0(sp) - 1380: 100f883a mov r7,r2 - 1384: 00808204 movi r2,520 - 1388: 02200034 movhi r8,32768 - 138c: 423fffc4 addi r8,r8,-1 - 1390: d880010d sth r2,4(sp) - 1394: 00c00034 movhi r3,0 - 1398: 18c6c604 addi r3,r3,6936 - 139c: d9400104 addi r5,sp,4 - 13a0: 00bfffc4 movi r2,-1 - 13a4: d8c00215 stw r3,8(sp) - 13a8: da800315 stw r10,12(sp) - 13ac: da000415 stw r8,16(sp) - 13b0: d880018d sth r2,6(sp) - 13b4: da800515 stw r10,20(sp) - 13b8: da000615 stw r8,24(sp) - 13bc: d8000715 stw zero,28(sp) - 13c0: 00014580 call 1458 <___vfprintf_internal_r> - 13c4: d8c00517 ldw r3,20(sp) - 13c8: 18000005 stb zero,0(r3) - 13cc: dfc00817 ldw ra,32(sp) - 13d0: dec00a04 addi sp,sp,40 - 13d4: f800283a ret - -000013d8 : - 13d8: defffb04 addi sp,sp,-20 - 13dc: dc800315 stw r18,12(sp) - 13e0: dc400215 stw r17,8(sp) - 13e4: dc000115 stw r16,4(sp) - 13e8: dfc00415 stw ra,16(sp) - 13ec: 2025883a mov r18,r4 - 13f0: 2823883a mov r17,r5 - 13f4: 3821883a mov r16,r7 - 13f8: d9800005 stb r6,0(sp) - 13fc: 9009883a mov r4,r18 - 1400: 880b883a mov r5,r17 - 1404: d80d883a mov r6,sp - 1408: 01c00044 movi r7,1 - 140c: 04000b0e bge zero,r16,143c - 1410: 88c00117 ldw r3,4(r17) - 1414: 843fffc4 addi r16,r16,-1 - 1418: 183ee83a callr r3 - 141c: 103ff726 beq r2,zero,13fc - 1420: 00bfffc4 movi r2,-1 - 1424: dfc00417 ldw ra,16(sp) - 1428: dc800317 ldw r18,12(sp) - 142c: dc400217 ldw r17,8(sp) - 1430: dc000117 ldw r16,4(sp) - 1434: dec00504 addi sp,sp,20 - 1438: f800283a ret - 143c: 0005883a mov r2,zero - 1440: dfc00417 ldw ra,16(sp) - 1444: dc800317 ldw r18,12(sp) - 1448: dc400217 ldw r17,8(sp) - 144c: dc000117 ldw r16,4(sp) - 1450: dec00504 addi sp,sp,20 - 1454: f800283a ret - -00001458 <___vfprintf_internal_r>: - 1458: deffe304 addi sp,sp,-116 - 145c: df001b15 stw fp,108(sp) - 1460: ddc01a15 stw r23,104(sp) - 1464: dd001715 stw r20,92(sp) - 1468: dc801515 stw r18,84(sp) - 146c: dc001315 stw r16,76(sp) - 1470: dfc01c15 stw ra,112(sp) - 1474: dd801915 stw r22,100(sp) - 1478: dd401815 stw r21,96(sp) - 147c: dcc01615 stw r19,88(sp) - 1480: dc401415 stw r17,80(sp) - 1484: d9001015 stw r4,64(sp) - 1488: 2829883a mov r20,r5 - 148c: d9c01115 stw r7,68(sp) - 1490: 3025883a mov r18,r6 - 1494: 0021883a mov r16,zero - 1498: d8000f15 stw zero,60(sp) - 149c: d8000e15 stw zero,56(sp) - 14a0: 0039883a mov fp,zero - 14a4: d8000915 stw zero,36(sp) - 14a8: d8000d15 stw zero,52(sp) - 14ac: d8000c15 stw zero,48(sp) - 14b0: d8000b15 stw zero,44(sp) - 14b4: 002f883a mov r23,zero - 14b8: 91400003 ldbu r5,0(r18) - 14bc: 01c00044 movi r7,1 - 14c0: 94800044 addi r18,r18,1 - 14c4: 29003fcc andi r4,r5,255 - 14c8: 2100201c xori r4,r4,128 - 14cc: 213fe004 addi r4,r4,-128 - 14d0: 20001526 beq r4,zero,1528 <___vfprintf_internal_r+0xd0> - 14d4: 81c03526 beq r16,r7,15ac <___vfprintf_internal_r+0x154> - 14d8: 3c002016 blt r7,r16,155c <___vfprintf_internal_r+0x104> - 14dc: 803ff61e bne r16,zero,14b8 <___vfprintf_internal_r+0x60> - 14e0: 00800944 movi r2,37 - 14e4: 2081501e bne r4,r2,1a28 <___vfprintf_internal_r+0x5d0> - 14e8: 073fffc4 movi fp,-1 - 14ec: 00800284 movi r2,10 - 14f0: d9c00c15 stw r7,48(sp) - 14f4: d8000f15 stw zero,60(sp) - 14f8: d8000e15 stw zero,56(sp) - 14fc: df000915 stw fp,36(sp) - 1500: d8800d15 stw r2,52(sp) - 1504: d8000b15 stw zero,44(sp) - 1508: 91400003 ldbu r5,0(r18) - 150c: 3821883a mov r16,r7 - 1510: 94800044 addi r18,r18,1 - 1514: 29003fcc andi r4,r5,255 - 1518: 2100201c xori r4,r4,128 - 151c: 213fe004 addi r4,r4,-128 - 1520: 01c00044 movi r7,1 - 1524: 203feb1e bne r4,zero,14d4 <___vfprintf_internal_r+0x7c> - 1528: b805883a mov r2,r23 - 152c: dfc01c17 ldw ra,112(sp) - 1530: df001b17 ldw fp,108(sp) - 1534: ddc01a17 ldw r23,104(sp) - 1538: dd801917 ldw r22,100(sp) - 153c: dd401817 ldw r21,96(sp) - 1540: dd001717 ldw r20,92(sp) - 1544: dcc01617 ldw r19,88(sp) - 1548: dc801517 ldw r18,84(sp) - 154c: dc401417 ldw r17,80(sp) - 1550: dc001317 ldw r16,76(sp) - 1554: dec01d04 addi sp,sp,116 - 1558: f800283a ret - 155c: 00800084 movi r2,2 - 1560: 80801726 beq r16,r2,15c0 <___vfprintf_internal_r+0x168> - 1564: 008000c4 movi r2,3 - 1568: 80bfd31e bne r16,r2,14b8 <___vfprintf_internal_r+0x60> - 156c: 2c7ff404 addi r17,r5,-48 - 1570: 88c03fcc andi r3,r17,255 - 1574: 00800244 movi r2,9 - 1578: 10c02136 bltu r2,r3,1600 <___vfprintf_internal_r+0x1a8> - 157c: d8c00917 ldw r3,36(sp) - 1580: 18012716 blt r3,zero,1a20 <___vfprintf_internal_r+0x5c8> - 1584: d9000917 ldw r4,36(sp) - 1588: 01400284 movi r5,10 - 158c: 00012ac0 call 12ac <__mulsi3> - 1590: 1007883a mov r3,r2 - 1594: 88803fcc andi r2,r17,255 - 1598: 1080201c xori r2,r2,128 - 159c: 10bfe004 addi r2,r2,-128 - 15a0: 1887883a add r3,r3,r2 - 15a4: d8c00915 stw r3,36(sp) - 15a8: 003fc306 br 14b8 <___vfprintf_internal_r+0x60> - 15ac: 00800c04 movi r2,48 - 15b0: 2080b326 beq r4,r2,1880 <___vfprintf_internal_r+0x428> - 15b4: 00800944 movi r2,37 - 15b8: 20812726 beq r4,r2,1a58 <___vfprintf_internal_r+0x600> - 15bc: 04000084 movi r16,2 - 15c0: 2c7ff404 addi r17,r5,-48 - 15c4: 88c03fcc andi r3,r17,255 - 15c8: 00800244 movi r2,9 - 15cc: 10c00a36 bltu r2,r3,15f8 <___vfprintf_internal_r+0x1a0> - 15d0: e000b416 blt fp,zero,18a4 <___vfprintf_internal_r+0x44c> - 15d4: e009883a mov r4,fp - 15d8: 01400284 movi r5,10 - 15dc: 00012ac0 call 12ac <__mulsi3> - 15e0: 1007883a mov r3,r2 - 15e4: 88803fcc andi r2,r17,255 - 15e8: 1080201c xori r2,r2,128 - 15ec: 10bfe004 addi r2,r2,-128 - 15f0: 18b9883a add fp,r3,r2 - 15f4: 003fb006 br 14b8 <___vfprintf_internal_r+0x60> - 15f8: 00800b84 movi r2,46 - 15fc: 2080a326 beq r4,r2,188c <___vfprintf_internal_r+0x434> - 1600: 00801b04 movi r2,108 - 1604: 2080a326 beq r4,r2,1894 <___vfprintf_internal_r+0x43c> - 1608: d8c00917 ldw r3,36(sp) - 160c: 1800a716 blt r3,zero,18ac <___vfprintf_internal_r+0x454> - 1610: d8000f15 stw zero,60(sp) - 1614: 28bfea04 addi r2,r5,-88 - 1618: 10803fcc andi r2,r2,255 - 161c: 00c00804 movi r3,32 - 1620: 18802836 bltu r3,r2,16c4 <___vfprintf_internal_r+0x26c> - 1624: 1085883a add r2,r2,r2 - 1628: 1085883a add r2,r2,r2 - 162c: 00c00034 movhi r3,0 - 1630: 18c59004 addi r3,r3,5696 - 1634: 10c5883a add r2,r2,r3 - 1638: 11000017 ldw r4,0(r2) - 163c: 2000683a jmp r4 - 1640: 000016cc andi zero,zero,91 - 1644: 000016c4 movi zero,91 - 1648: 000016c4 movi zero,91 - 164c: 000016c4 movi zero,91 - 1650: 000016c4 movi zero,91 - 1654: 000016c4 movi zero,91 - 1658: 000016c4 movi zero,91 - 165c: 000016c4 movi zero,91 - 1660: 000016c4 movi zero,91 - 1664: 000016c4 movi zero,91 - 1668: 000016c4 movi zero,91 - 166c: 000018f8 rdprs zero,zero,99 - 1670: 000016e0 cmpeqi zero,zero,91 - 1674: 000016c4 movi zero,91 - 1678: 000016c4 movi zero,91 - 167c: 000016c4 movi zero,91 - 1680: 000016c4 movi zero,91 - 1684: 000016e0 cmpeqi zero,zero,91 - 1688: 000016c4 movi zero,91 - 168c: 000016c4 movi zero,91 - 1690: 000016c4 movi zero,91 - 1694: 000016c4 movi zero,91 - 1698: 000016c4 movi zero,91 - 169c: 00001960 cmpeqi zero,zero,101 - 16a0: 000016c4 movi zero,91 - 16a4: 000016c4 movi zero,91 - 16a8: 000016c4 movi zero,91 - 16ac: 00001970 cmpltui zero,zero,101 - 16b0: 000016c4 movi zero,91 - 16b4: 00001844 movi zero,97 - 16b8: 000016c4 movi zero,91 - 16bc: 000016c4 movi zero,91 - 16c0: 0000183c xorhi zero,zero,96 - 16c4: 0021883a mov r16,zero - 16c8: 003f7b06 br 14b8 <___vfprintf_internal_r+0x60> - 16cc: 00c00404 movi r3,16 - 16d0: 00800044 movi r2,1 - 16d4: d8c00d15 stw r3,52(sp) - 16d8: d8000c15 stw zero,48(sp) - 16dc: d8800b15 stw r2,44(sp) - 16e0: d8c00e17 ldw r3,56(sp) - 16e4: 1805003a cmpeq r2,r3,zero - 16e8: 10005a1e bne r2,zero,1854 <___vfprintf_internal_r+0x3fc> - 16ec: d8800c17 ldw r2,48(sp) - 16f0: 1000781e bne r2,zero,18d4 <___vfprintf_internal_r+0x47c> - 16f4: d8801117 ldw r2,68(sp) - 16f8: d8000a15 stw zero,40(sp) - 16fc: 14400017 ldw r17,0(r2) - 1700: 11c00104 addi r7,r2,4 - 1704: d9c01115 stw r7,68(sp) - 1708: 88005a26 beq r17,zero,1874 <___vfprintf_internal_r+0x41c> - 170c: d8c00b17 ldw r3,44(sp) - 1710: dcc00044 addi r19,sp,1 - 1714: 05800244 movi r22,9 - 1718: 182b003a cmpeq r21,r3,zero - 171c: dcc01215 stw r19,72(sp) - 1720: 00000506 br 1738 <___vfprintf_internal_r+0x2e0> - 1724: 21000c04 addi r4,r4,48 - 1728: 99000005 stb r4,0(r19) - 172c: 9cc00044 addi r19,r19,1 - 1730: 80000f26 beq r16,zero,1770 <___vfprintf_internal_r+0x318> - 1734: 8023883a mov r17,r16 - 1738: d9400d17 ldw r5,52(sp) - 173c: 8809883a mov r4,r17 - 1740: 000129c0 call 129c <__udivsi3> - 1744: d9000d17 ldw r4,52(sp) - 1748: 100b883a mov r5,r2 - 174c: 1021883a mov r16,r2 - 1750: 00012ac0 call 12ac <__mulsi3> - 1754: 8889c83a sub r4,r17,r2 - 1758: b13ff20e bge r22,r4,1724 <___vfprintf_internal_r+0x2cc> - 175c: a8009f1e bne r21,zero,19dc <___vfprintf_internal_r+0x584> - 1760: 21000dc4 addi r4,r4,55 - 1764: 99000005 stb r4,0(r19) - 1768: 9cc00044 addi r19,r19,1 - 176c: 803ff11e bne r16,zero,1734 <___vfprintf_internal_r+0x2dc> - 1770: d8801217 ldw r2,72(sp) - 1774: 98a3c83a sub r17,r19,r2 - 1778: d8c00917 ldw r3,36(sp) - 177c: 1c4bc83a sub r5,r3,r17 - 1780: 0140130e bge zero,r5,17d0 <___vfprintf_internal_r+0x378> - 1784: d8c00044 addi r3,sp,1 - 1788: 18800804 addi r2,r3,32 - 178c: 9880102e bgeu r19,r2,17d0 <___vfprintf_internal_r+0x378> - 1790: 00800c04 movi r2,48 - 1794: 28ffffc4 addi r3,r5,-1 - 1798: 98800005 stb r2,0(r19) - 179c: 99000044 addi r4,r19,1 - 17a0: 00c0080e bge zero,r3,17c4 <___vfprintf_internal_r+0x36c> - 17a4: d8c00044 addi r3,sp,1 - 17a8: 18800804 addi r2,r3,32 - 17ac: 2080052e bgeu r4,r2,17c4 <___vfprintf_internal_r+0x36c> - 17b0: 00800c04 movi r2,48 - 17b4: 20800005 stb r2,0(r4) - 17b8: 21000044 addi r4,r4,1 - 17bc: 9945883a add r2,r19,r5 - 17c0: 20bff81e bne r4,r2,17a4 <___vfprintf_internal_r+0x34c> - 17c4: d8801217 ldw r2,72(sp) - 17c8: 2027883a mov r19,r4 - 17cc: 20a3c83a sub r17,r4,r2 - 17d0: d8c00a17 ldw r3,40(sp) - 17d4: 1c45883a add r2,r3,r17 - 17d8: e0a1c83a sub r16,fp,r2 - 17dc: d8800f17 ldw r2,60(sp) - 17e0: 10008026 beq r2,zero,19e4 <___vfprintf_internal_r+0x58c> - 17e4: 1805003a cmpeq r2,r3,zero - 17e8: 1000ae26 beq r2,zero,1aa4 <___vfprintf_internal_r+0x64c> - 17ec: 0400a516 blt zero,r16,1a84 <___vfprintf_internal_r+0x62c> - 17f0: b805883a mov r2,r23 - 17f4: 0440950e bge zero,r17,1a4c <___vfprintf_internal_r+0x5f4> - 17f8: 102f883a mov r23,r2 - 17fc: 1461883a add r16,r2,r17 - 1800: 00000206 br 180c <___vfprintf_internal_r+0x3b4> - 1804: bdc00044 addi r23,r23,1 - 1808: 85ffae26 beq r16,r23,16c4 <___vfprintf_internal_r+0x26c> - 180c: 9cffffc4 addi r19,r19,-1 - 1810: 98800003 ldbu r2,0(r19) - 1814: a0c00117 ldw r3,4(r20) - 1818: d9001017 ldw r4,64(sp) - 181c: d8800005 stb r2,0(sp) - 1820: a00b883a mov r5,r20 - 1824: d80d883a mov r6,sp - 1828: 01c00044 movi r7,1 - 182c: 183ee83a callr r3 - 1830: 103ff426 beq r2,zero,1804 <___vfprintf_internal_r+0x3ac> - 1834: 05ffffc4 movi r23,-1 - 1838: 003f3b06 br 1528 <___vfprintf_internal_r+0xd0> - 183c: 00c00404 movi r3,16 - 1840: d8c00d15 stw r3,52(sp) - 1844: d8000c15 stw zero,48(sp) - 1848: d8c00e17 ldw r3,56(sp) - 184c: 1805003a cmpeq r2,r3,zero - 1850: 103fa626 beq r2,zero,16ec <___vfprintf_internal_r+0x294> - 1854: d8c00c17 ldw r3,48(sp) - 1858: 1800171e bne r3,zero,18b8 <___vfprintf_internal_r+0x460> - 185c: d8c01117 ldw r3,68(sp) - 1860: d8000a15 stw zero,40(sp) - 1864: 1c400017 ldw r17,0(r3) - 1868: 19c00104 addi r7,r3,4 - 186c: d9c01115 stw r7,68(sp) - 1870: 883fa61e bne r17,zero,170c <___vfprintf_internal_r+0x2b4> - 1874: dcc00044 addi r19,sp,1 - 1878: dcc01215 stw r19,72(sp) - 187c: 003fbe06 br 1778 <___vfprintf_internal_r+0x320> - 1880: 04000084 movi r16,2 - 1884: d9c00f15 stw r7,60(sp) - 1888: 003f0b06 br 14b8 <___vfprintf_internal_r+0x60> - 188c: 040000c4 movi r16,3 - 1890: 003f0906 br 14b8 <___vfprintf_internal_r+0x60> - 1894: 00800044 movi r2,1 - 1898: 040000c4 movi r16,3 - 189c: d8800e15 stw r2,56(sp) - 18a0: 003f0506 br 14b8 <___vfprintf_internal_r+0x60> - 18a4: 0007883a mov r3,zero - 18a8: 003f4e06 br 15e4 <___vfprintf_internal_r+0x18c> - 18ac: 00800044 movi r2,1 - 18b0: d8800915 stw r2,36(sp) - 18b4: 003f5706 br 1614 <___vfprintf_internal_r+0x1bc> - 18b8: d8801117 ldw r2,68(sp) - 18bc: 14400017 ldw r17,0(r2) - 18c0: 10800104 addi r2,r2,4 - 18c4: d8801115 stw r2,68(sp) - 18c8: 88000716 blt r17,zero,18e8 <___vfprintf_internal_r+0x490> - 18cc: d8000a15 stw zero,40(sp) - 18d0: 003f8d06 br 1708 <___vfprintf_internal_r+0x2b0> - 18d4: d8c01117 ldw r3,68(sp) - 18d8: 1c400017 ldw r17,0(r3) - 18dc: 18c00104 addi r3,r3,4 - 18e0: d8c01115 stw r3,68(sp) - 18e4: 883ff90e bge r17,zero,18cc <___vfprintf_internal_r+0x474> - 18e8: 00800044 movi r2,1 - 18ec: 0463c83a sub r17,zero,r17 - 18f0: d8800a15 stw r2,40(sp) - 18f4: 003f8406 br 1708 <___vfprintf_internal_r+0x2b0> - 18f8: 04000044 movi r16,1 - 18fc: 8700080e bge r16,fp,1920 <___vfprintf_internal_r+0x4c8> - 1900: d9001017 ldw r4,64(sp) - 1904: a00b883a mov r5,r20 - 1908: 01800804 movi r6,32 - 190c: e1ffffc4 addi r7,fp,-1 - 1910: 00013d80 call 13d8 - 1914: 103fc71e bne r2,zero,1834 <___vfprintf_internal_r+0x3dc> - 1918: e5c5883a add r2,fp,r23 - 191c: 15ffffc4 addi r23,r2,-1 - 1920: d8c01117 ldw r3,68(sp) - 1924: d9001017 ldw r4,64(sp) - 1928: 800f883a mov r7,r16 - 192c: 18800017 ldw r2,0(r3) - 1930: a0c00117 ldw r3,4(r20) - 1934: a00b883a mov r5,r20 - 1938: d8800005 stb r2,0(sp) - 193c: d80d883a mov r6,sp - 1940: 183ee83a callr r3 - 1944: 103fbb1e bne r2,zero,1834 <___vfprintf_internal_r+0x3dc> - 1948: d8801117 ldw r2,68(sp) - 194c: bdc00044 addi r23,r23,1 - 1950: 0021883a mov r16,zero - 1954: 10800104 addi r2,r2,4 - 1958: d8801115 stw r2,68(sp) - 195c: 003ed606 br 14b8 <___vfprintf_internal_r+0x60> - 1960: 00800204 movi r2,8 - 1964: d8800d15 stw r2,52(sp) - 1968: d8000c15 stw zero,48(sp) - 196c: 003fb606 br 1848 <___vfprintf_internal_r+0x3f0> - 1970: d8c01117 ldw r3,68(sp) - 1974: 1cc00017 ldw r19,0(r3) - 1978: 9809883a mov r4,r19 - 197c: 0001c300 call 1c30 - 1980: e0a1c83a sub r16,fp,r2 - 1984: 1023883a mov r17,r2 - 1988: 0400070e bge zero,r16,19a8 <___vfprintf_internal_r+0x550> - 198c: d9001017 ldw r4,64(sp) - 1990: a00b883a mov r5,r20 - 1994: 01800804 movi r6,32 - 1998: 800f883a mov r7,r16 - 199c: 00013d80 call 13d8 - 19a0: 103fa41e bne r2,zero,1834 <___vfprintf_internal_r+0x3dc> - 19a4: bc2f883a add r23,r23,r16 - 19a8: a0c00117 ldw r3,4(r20) - 19ac: d9001017 ldw r4,64(sp) - 19b0: 980d883a mov r6,r19 - 19b4: a00b883a mov r5,r20 - 19b8: 880f883a mov r7,r17 - 19bc: 183ee83a callr r3 - 19c0: 103f9c1e bne r2,zero,1834 <___vfprintf_internal_r+0x3dc> - 19c4: d8801117 ldw r2,68(sp) - 19c8: bc6f883a add r23,r23,r17 - 19cc: 0021883a mov r16,zero - 19d0: 10800104 addi r2,r2,4 - 19d4: d8801115 stw r2,68(sp) - 19d8: 003eb706 br 14b8 <___vfprintf_internal_r+0x60> - 19dc: 210015c4 addi r4,r4,87 - 19e0: 003f5106 br 1728 <___vfprintf_internal_r+0x2d0> - 19e4: 04003b16 blt zero,r16,1ad4 <___vfprintf_internal_r+0x67c> - 19e8: d8c00a17 ldw r3,40(sp) - 19ec: 1805003a cmpeq r2,r3,zero - 19f0: 103f7f1e bne r2,zero,17f0 <___vfprintf_internal_r+0x398> - 19f4: a0c00117 ldw r3,4(r20) - 19f8: d9001017 ldw r4,64(sp) - 19fc: 00800b44 movi r2,45 - 1a00: d8800005 stb r2,0(sp) - 1a04: a00b883a mov r5,r20 - 1a08: d80d883a mov r6,sp - 1a0c: 01c00044 movi r7,1 - 1a10: 183ee83a callr r3 - 1a14: 103f871e bne r2,zero,1834 <___vfprintf_internal_r+0x3dc> - 1a18: b8800044 addi r2,r23,1 - 1a1c: 003f7506 br 17f4 <___vfprintf_internal_r+0x39c> - 1a20: 0007883a mov r3,zero - 1a24: 003edb06 br 1594 <___vfprintf_internal_r+0x13c> - 1a28: a0c00117 ldw r3,4(r20) - 1a2c: d9001017 ldw r4,64(sp) - 1a30: d9400005 stb r5,0(sp) - 1a34: d80d883a mov r6,sp - 1a38: a00b883a mov r5,r20 - 1a3c: 183ee83a callr r3 - 1a40: 103f7c1e bne r2,zero,1834 <___vfprintf_internal_r+0x3dc> - 1a44: bdc00044 addi r23,r23,1 - 1a48: 003e9b06 br 14b8 <___vfprintf_internal_r+0x60> - 1a4c: 102f883a mov r23,r2 - 1a50: 0021883a mov r16,zero - 1a54: 003e9806 br 14b8 <___vfprintf_internal_r+0x60> - 1a58: a0c00117 ldw r3,4(r20) - 1a5c: d9000005 stb r4,0(sp) - 1a60: d9001017 ldw r4,64(sp) - 1a64: a00b883a mov r5,r20 - 1a68: d80d883a mov r6,sp - 1a6c: 800f883a mov r7,r16 - 1a70: 183ee83a callr r3 - 1a74: 103f6f1e bne r2,zero,1834 <___vfprintf_internal_r+0x3dc> - 1a78: bc2f883a add r23,r23,r16 - 1a7c: 0021883a mov r16,zero - 1a80: 003e8d06 br 14b8 <___vfprintf_internal_r+0x60> - 1a84: d9001017 ldw r4,64(sp) - 1a88: a00b883a mov r5,r20 - 1a8c: 01800c04 movi r6,48 - 1a90: 800f883a mov r7,r16 - 1a94: 00013d80 call 13d8 - 1a98: 103f661e bne r2,zero,1834 <___vfprintf_internal_r+0x3dc> - 1a9c: bc05883a add r2,r23,r16 - 1aa0: 003f5406 br 17f4 <___vfprintf_internal_r+0x39c> - 1aa4: a0c00117 ldw r3,4(r20) - 1aa8: d9001017 ldw r4,64(sp) - 1aac: 00800b44 movi r2,45 - 1ab0: d8800005 stb r2,0(sp) - 1ab4: a00b883a mov r5,r20 - 1ab8: d80d883a mov r6,sp - 1abc: 01c00044 movi r7,1 - 1ac0: 183ee83a callr r3 - 1ac4: 103f5b1e bne r2,zero,1834 <___vfprintf_internal_r+0x3dc> - 1ac8: bdc00044 addi r23,r23,1 - 1acc: 043f480e bge zero,r16,17f0 <___vfprintf_internal_r+0x398> - 1ad0: 003fec06 br 1a84 <___vfprintf_internal_r+0x62c> - 1ad4: d9001017 ldw r4,64(sp) - 1ad8: a00b883a mov r5,r20 - 1adc: 01800804 movi r6,32 - 1ae0: 800f883a mov r7,r16 - 1ae4: 00013d80 call 13d8 - 1ae8: 103f521e bne r2,zero,1834 <___vfprintf_internal_r+0x3dc> - 1aec: bc2f883a add r23,r23,r16 - 1af0: 003fbd06 br 19e8 <___vfprintf_internal_r+0x590> - -00001af4 <__vfprintf_internal>: - 1af4: 00800034 movhi r2,0 - 1af8: 10883c04 addi r2,r2,8432 - 1afc: 2013883a mov r9,r4 - 1b00: 11000017 ldw r4,0(r2) - 1b04: 2805883a mov r2,r5 - 1b08: 300f883a mov r7,r6 - 1b0c: 480b883a mov r5,r9 - 1b10: 100d883a mov r6,r2 - 1b14: 00014581 jmpi 1458 <___vfprintf_internal_r> - -00001b18 <__sfvwrite_small_str>: - 1b18: 2900000b ldhu r4,0(r5) - 1b1c: defffd04 addi sp,sp,-12 - 1b20: dc000015 stw r16,0(sp) - 1b24: 20ffffcc andi r3,r4,65535 - 1b28: 1880020c andi r2,r3,8 - 1b2c: 2821883a mov r16,r5 - 1b30: dfc00215 stw ra,8(sp) - 1b34: dc400115 stw r17,4(sp) - 1b38: 300b883a mov r5,r6 - 1b3c: 10001d26 beq r2,zero,1bb4 <__sfvwrite_small_str+0x9c> - 1b40: 8080008f ldh r2,2(r16) - 1b44: 1000190e bge r2,zero,1bac <__sfvwrite_small_str+0x94> - 1b48: 1880800c andi r2,r3,512 - 1b4c: 10001726 beq r2,zero,1bac <__sfvwrite_small_str+0x94> - 1b50: 81800517 ldw r6,20(r16) - 1b54: 31c0020e bge r6,r7,1b60 <__sfvwrite_small_str+0x48> - 1b58: 1880200c andi r2,r3,128 - 1b5c: 1000131e bne r2,zero,1bac <__sfvwrite_small_str+0x94> - 1b60: 3023883a mov r17,r6 - 1b64: 3980010e bge r7,r6,1b6c <__sfvwrite_small_str+0x54> - 1b68: 3823883a mov r17,r7 - 1b6c: 81000417 ldw r4,16(r16) - 1b70: 880d883a mov r6,r17 - 1b74: 0001bd00 call 1bd0 - 1b78: 80800417 ldw r2,16(r16) - 1b7c: 80c00517 ldw r3,20(r16) - 1b80: 0009883a mov r4,zero - 1b84: 1445883a add r2,r2,r17 - 1b88: 1c47c83a sub r3,r3,r17 - 1b8c: 80800415 stw r2,16(r16) - 1b90: 2005883a mov r2,r4 - 1b94: 80c00515 stw r3,20(r16) - 1b98: dfc00217 ldw ra,8(sp) - 1b9c: dc400117 ldw r17,4(sp) - 1ba0: dc000017 ldw r16,0(sp) - 1ba4: dec00304 addi sp,sp,12 - 1ba8: f800283a ret - 1bac: 20801014 ori r2,r4,64 - 1bb0: 8080000d sth r2,0(r16) - 1bb4: 013fffc4 movi r4,-1 - 1bb8: 2005883a mov r2,r4 - 1bbc: dfc00217 ldw ra,8(sp) - 1bc0: dc400117 ldw r17,4(sp) - 1bc4: dc000017 ldw r16,0(sp) - 1bc8: dec00304 addi sp,sp,12 - 1bcc: f800283a ret - -00001bd0 : - 1bd0: 2011883a mov r8,r4 - 1bd4: 2900022e bgeu r5,r4,1be0 - 1bd8: 2989883a add r4,r5,r6 - 1bdc: 41000a36 bltu r8,r4,1c08 - 1be0: 30000726 beq r6,zero,1c00 - 1be4: 000f883a mov r7,zero - 1be8: 29c5883a add r2,r5,r7 - 1bec: 11000003 ldbu r4,0(r2) - 1bf0: 3a07883a add r3,r7,r8 - 1bf4: 39c00044 addi r7,r7,1 - 1bf8: 19000005 stb r4,0(r3) - 1bfc: 31fffa1e bne r6,r7,1be8 - 1c00: 4005883a mov r2,r8 - 1c04: f800283a ret - 1c08: 303ffd26 beq r6,zero,1c00 - 1c0c: 4187883a add r3,r8,r6 - 1c10: 198dc83a sub r6,r3,r6 - 1c14: 213fffc4 addi r4,r4,-1 - 1c18: 20800003 ldbu r2,0(r4) - 1c1c: 18ffffc4 addi r3,r3,-1 - 1c20: 18800005 stb r2,0(r3) - 1c24: 19bffb1e bne r3,r6,1c14 - 1c28: 4005883a mov r2,r8 - 1c2c: f800283a ret - -00001c30 : - 1c30: 20800007 ldb r2,0(r4) - 1c34: 10000526 beq r2,zero,1c4c - 1c38: 2007883a mov r3,r4 - 1c3c: 18c00044 addi r3,r3,1 - 1c40: 18800007 ldb r2,0(r3) - 1c44: 103ffd1e bne r2,zero,1c3c - 1c48: 1905c83a sub r2,r3,r4 - 1c4c: f800283a ret - -00001c50 : - -static void ALT_INLINE alt_load_section (alt_u32* from, - alt_u32* to, - alt_u32* end) -{ - if (to != from) - 1c50: 2900051e bne r5,r4,1c68 - 1c54: f800283a ret - { - while( to != end ) - { - *to++ = *from++; - 1c58: 20800017 ldw r2,0(r4) - 1c5c: 21000104 addi r4,r4,4 - 1c60: 28800015 stw r2,0(r5) - 1c64: 29400104 addi r5,r5,4 - alt_u32* to, - alt_u32* end) -{ - if (to != from) - { - while( to != end ) - 1c68: 29bffb1e bne r5,r6,1c58 - 1c6c: f800283a ret - -00001c70 : - * there is no bootloader, so this application is responsible for loading to - * RAM any sections that are required. - */ - -void alt_load (void) -{ - 1c70: deffff04 addi sp,sp,-4 - /* - * Copy the .rwdata section. - */ - - alt_load_section (&__flash_rwdata_start, - 1c74: 01000034 movhi r4,0 - 1c78: 21083f04 addi r4,r4,8444 - 1c7c: 01400034 movhi r5,0 - 1c80: 29480304 addi r5,r5,8204 - 1c84: 01800034 movhi r6,0 - 1c88: 31883f04 addi r6,r6,8444 - * there is no bootloader, so this application is responsible for loading to - * RAM any sections that are required. - */ - -void alt_load (void) -{ - 1c8c: dfc00015 stw ra,0(sp) - /* - * Copy the .rwdata section. - */ - - alt_load_section (&__flash_rwdata_start, - 1c90: 0001c500 call 1c50 - - /* - * Copy the exception handler. - */ - - alt_load_section (&__flash_exceptions_start, - 1c94: 01000034 movhi r4,0 - 1c98: 21000804 addi r4,r4,32 - 1c9c: 01400034 movhi r5,0 - 1ca0: 29400804 addi r5,r5,32 - 1ca4: 01800034 movhi r6,0 - 1ca8: 31800804 addi r6,r6,32 - 1cac: 0001c500 call 1c50 - - /* - * Copy the .rodata section. - */ - - alt_load_section (&__flash_rodata_start, - 1cb0: 01000034 movhi r4,0 - 1cb4: 21074f04 addi r4,r4,7484 - 1cb8: 01400034 movhi r5,0 - 1cbc: 29474f04 addi r5,r5,7484 - 1cc0: 01800034 movhi r6,0 - 1cc4: 31880304 addi r6,r6,8204 - 1cc8: 0001c500 call 1c50 - - /* - * Now ensure that the caches are in synch. - */ - - alt_dcache_flush_all(); - 1ccc: 0001d2c0 call 1d2c - alt_icache_flush_all(); -} - 1cd0: dfc00017 ldw ra,0(sp) - 1cd4: dec00104 addi sp,sp,4 - /* - * Now ensure that the caches are in synch. - */ - - alt_dcache_flush_all(); - alt_icache_flush_all(); - 1cd8: 0001d301 jmpi 1d30 - -00001cdc : - * devices/filesystems/components in the system; and call the entry point for - * the users application, i.e. main(). - */ - -void alt_main (void) -{ - 1cdc: deffff04 addi sp,sp,-4 -#endif - - /* ALT LOG - please see HAL/sys/alt_log_printf.h for details */ - ALT_LOG_PRINT_BOOT("[alt_main.c] Entering alt_main, calling alt_irq_init.\r\n"); - /* Initialize the interrupt controller. */ - alt_irq_init (NULL); - 1ce0: 0009883a mov r4,zero - * devices/filesystems/components in the system; and call the entry point for - * the users application, i.e. main(). - */ - -void alt_main (void) -{ - 1ce4: dfc00015 stw ra,0(sp) -#endif - - /* ALT LOG - please see HAL/sys/alt_log_printf.h for details */ - ALT_LOG_PRINT_BOOT("[alt_main.c] Entering alt_main, calling alt_irq_init.\r\n"); - /* Initialize the interrupt controller. */ - alt_irq_init (NULL); - 1ce8: 0001d0c0 call 1d0c - ALT_LOG_PRINT_BOOT("[alt_main.c] Done OS Init, calling alt_sem_create.\r\n"); - ALT_SEM_CREATE (&alt_fd_list_lock, 1); - - /* Initialize the device drivers/software components. */ - ALT_LOG_PRINT_BOOT("[alt_main.c] Calling alt_sys_init.\r\n"); - alt_sys_init(); - 1cec: 0001d080 call 1d08 - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Calling main.\r\n"); - -#ifdef ALT_NO_EXIT - main (alt_argc, alt_argv, alt_envp); - 1cf0: d1204617 ldw r4,-32488(gp) - 1cf4: d1604717 ldw r5,-32484(gp) - 1cf8: d1a04817 ldw r6,-32480(gp) - close(STDOUT_FILENO); - exit (result); -#endif - - ALT_LOG_PRINT_BOOT("[alt_main.c] After main - we should not be here?.\r\n"); -} - 1cfc: dfc00017 ldw ra,0(sp) - 1d00: dec00104 addi sp,sp,4 - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Calling main.\r\n"); - -#ifdef ALT_NO_EXIT - main (alt_argc, alt_argv, alt_envp); - 1d04: 00003e81 jmpi 3e8
- -00001d08 : - */ - -void alt_sys_init( void ) -{ - ALTERA_AVALON_JTAG_UART_INIT ( JTAG_UART, jtag_uart); -} - 1d08: f800283a ret - -00001d0c : - * The "base" parameter is ignored and only - * present for backwards-compatibility. - */ - -void alt_irq_init ( const void* base ) -{ - 1d0c: deffff04 addi sp,sp,-4 - 1d10: dfc00015 stw ra,0(sp) - ALTERA_NIOS2_QSYS_IRQ_INIT ( NIOS2_PROCESSOR, nios2_processor); - 1d14: 0001d340 call 1d34 - * alt_irq_cpu_enable_interrupts() enables the CPU to start taking interrupts. - */ -static ALT_INLINE void ALT_ALWAYS_INLINE - alt_irq_cpu_enable_interrupts () -{ - NIOS2_WRITE_STATUS(NIOS2_STATUS_PIE_MSK - 1d18: 00800044 movi r2,1 - 1d1c: 1001703a wrctl status,r2 - alt_irq_cpu_enable_interrupts(); -} - 1d20: dfc00017 ldw ra,0(sp) - 1d24: dec00104 addi sp,sp,4 - 1d28: f800283a ret - -00001d2c : - for (i = (char*) 0; i < (char*) NIOS2_DCACHE_SIZE; i+= NIOS2_DCACHE_LINE_SIZE) - { - __asm__ volatile ("flushd (%0)" :: "r" (i)); - } -#endif /* NIOS2_DCACHE_SIZE > 0 */ -} - 1d2c: f800283a ret - -00001d30 : -void alt_icache_flush_all (void) -{ -#if NIOS2_ICACHE_SIZE > 0 - alt_icache_flush (0, NIOS2_ICACHE_SIZE); -#endif -} - 1d30: f800283a ret - -00001d34 : - * To initialize the internal interrupt controller, just clear the IENABLE - * register so that all possible IRQs are disabled. - */ -void altera_nios2_qsys_irq_init(void) -{ - NIOS2_WRITE_IENABLE(0); - 1d34: 000170fa wrctl ienable,zero -} - 1d38: f800283a ret diff --git a/software/qsys_tutorial_mem/readme.txt b/software/qsys_tutorial_mem/readme.txt deleted file mode 100644 index 3dc3186..0000000 --- a/software/qsys_tutorial_mem/readme.txt +++ /dev/null @@ -1,67 +0,0 @@ -Readme - Hello World Software Example - -DESCRIPTION: -Simple program that prints "Hello from Nios II" - -The purpose of this example is to demonstrate the smallest possible Hello -World application, using the Nios II HAL BSP. The memory footprint -of this hosted application is intended to be less than 1 kbytes by default using a standard -reference design. For a more fully featured Hello World application -example, see the example titled "Hello World". - -The memory footprint of this example has been reduced by making the -following changes to the normal "Hello World" example. -Check in the Nios II Software Developers Handbook for a more complete -description. - -In the SW Application project: - - In the C/C++ Build page - - Set the Optimization Level to -Os - -In BSP project: - - In the C/C++ Build page - - - Set the Optimization Level to -Os - - - Define the preprocessor option ALT_NO_INSTRUCTION_EMULATION - This removes software exception handling, which means that you cannot - run code compiled for Nios II cpu with a hardware multiplier on a core - without a the multiply unit. Check the Nios II Software Developers - Manual for more details. - - - In the BSP: - - Set Periodic system timer and Timestamp timer to none - This prevents the automatic inclusion of the timer driver. - - - Set Max file descriptors to 4 - This reduces the size of the file handle pool. - - - Uncheck Clean exit (flush buffers) - This removes the call to exit, and when main is exitted instead of - calling exit the software will just spin in a loop. - - - Check Small C library - This uses a reduced functionality C library, which lacks - support for buffering, file IO, floating point and getch(), etc. - Check the Nios II Software Developers Manual for a complete list. - - - Check Reduced device drivers - This uses reduced functionality drivers if they're available. For the - standard design this means you get polled UART and JTAG UART drivers, - no support for the LCD driver and you lose the ability to program - CFI compliant flash devices. - - -PERIPHERALS USED: -This example exercises the following peripherals: -- STDOUT device (UART or JTAG UART) - -SOFTWARE SOURCE FILES: -This example includes the following software source files: -- small_hello_world.c: - -BOARD/HOST REQUIREMENTS: -This example requires only a JTAG connection with a Nios Development board. If -the host communication settings are changed from JTAG UART (default) to use a -conventional UART, a serial cable between board DB-9 connector and the host is -required. diff --git a/software/qsys_tutorial_mem/sys_memory.c b/software/qsys_tutorial_mem/sys_memory.c deleted file mode 100644 index c8faff6..0000000 --- a/software/qsys_tutorial_mem/sys_memory.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * sys_memory.c - * - * Created on: 2016/11/24 - * Author: takayun - */ -#include "system.h" -#include "sys_memory.h" -#include "sys_register.h" - -/************************************************** - * Public - **************************************************/ - -// �����������̂ǂ̃�������(0 < global_current_memory < MEMS_COUNT) -unsigned int global_current_memory = 0; - -/************************************************** - * Private - **************************************************/ - -// �����������̕ϐ� -static char memory[MEMS_COUNT][MEM_SIZE]; - -static struct InstRec inst_memory[MEMS_COUNT][MEM_SIZE]; - - -/************************************************** - * Impl - **************************************************/ - -void memory_init() { - int i, j; - for (i = 0; i < MEMS_COUNT; i++) - for (j = 0; j < MEM_SIZE; j++) { - memory[i][j] = 0; - } -} - -void inst_memory_store(unsigned int mem_addr, struct InstRec inst_rec){ - inst_memory[global_current_memory][mem_addr] = inst_rec; -} -struct InstRec inst_memory_load(unsigned int mem_addr){ - return inst_memory[global_current_memory][mem_addr]; -} - -char memory_store(unsigned int mem_addr, enum Register reg) { - if (!(mem_addr < MEM_SIZE)) panic(); - memory[global_current_memory][mem_addr] = global_registers[reg]; - return memory[global_current_memory][mem_addr]; -} - -char memory_load(unsigned int mem_addr, enum Register reg) { - if (!(mem_addr < MEM_SIZE)) panic(); - global_registers[reg] = memory[global_current_memory][mem_addr]; - return global_registers[reg]; -} - diff --git a/software/qsys_tutorial_mem/sys_memory.h b/software/qsys_tutorial_mem/sys_memory.h deleted file mode 100644 index 648fe11..0000000 --- a/software/qsys_tutorial_mem/sys_memory.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * sys_memory.h - * - * Created on: 2016/11/24 - * Author: takayun - */ - -#ifndef SYS_MEMORY_H_ -#define SYS_MEMORY_H_ - -#include "sys_register.h" -#include "inst_decoder.h" - -/************************************************** - * Defines - **************************************************/ - -// �������̐� -#define MEMS_COUNT 4 - -// 1�������̃T�C�Y -#define MEM_SIZE 16 - -/************************************************** - * Variables - **************************************************/ - -extern unsigned int global_current_memory; - -/************************************************** - * Functions - **************************************************/ - -/* Function: memory_init - * Sammary: - * ������������������(All 0) */ -void memory_init(); - -/* ���ߗp�������ɖ��߂̃X�g�A&���[�h */ - -/* Function: memory_store -> char - * Sammary: - * �������̎w��Ԓn�Ɏw�肵�����W�X�^����l���i�[���� - * Return: - * �������Ɋi�[���ꂽ�l */ -void inst_memory_store(unsigned int mem_addr, struct InstRec inst_rec); -struct InstRec inst_memory_load(unsigned int mem_addr); - - -/* ������-���W�X�^�Ԃ̑��� */ - -/* Function: memory_store -> char - * Sammary: - * �������̎w��Ԓn�Ɏw�肵�����W�X�^����l���i�[���� - * Return: - * �������Ɋi�[���ꂽ�l */ -char memory_store(unsigned int mem_addr, enum Register reg); - -/* Function: memory_store -> char - * Sammary: - * �w�肵�����W�X�^�Ƀ������̎w��Ԓn����l���i�[���� - * Return: - * ���W�X�^�Ɋi�[���ꂽ�l */ -char memory_load(unsigned int mem_addr, enum Register reg); - - -#endif /* SYS_MEMORY_H_ */ diff --git a/software/qsys_tutorial_mem/sys_register.c b/software/qsys_tutorial_mem/sys_register.c deleted file mode 100644 index 84ed485..0000000 --- a/software/qsys_tutorial_mem/sys_register.c +++ /dev/null @@ -1,17 +0,0 @@ -/* - * sys_register.c - * - * Created on: 2016/11/24 - * Author: takayun - */ -#include "sys_register.h" - -char global_registers[REG_MAX_COUNT]; - -void registers_init() { - int i; - for (i = 0; i < REG_MAX_COUNT; i++) global_registers[i] = 0; -} - - - diff --git a/software/qsys_tutorial_mem/sys_register.h b/software/qsys_tutorial_mem/sys_register.h deleted file mode 100644 index 65ad219..0000000 --- a/software/qsys_tutorial_mem/sys_register.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * sys_register.h - * - * Created on: 2016/11/24 - * Author: takayun - */ - -#ifndef SYS_REGISTER_H_ -#define SYS_REGISTER_H_ - -/************************************************** - * Defines - **************************************************/ - -// ���W�X�^�̒�` -enum Register { - /* �ʏ�̃��W�X�^ */ - Szero, //�[�����W�X�^ - Spc, //�v���O�����J�E���^ - Ssp, //�X�^�b�N�|�C���^ - Sgp0, //�ėp���W�X�^0 - Sgp1, //�ėp���W�X�^1 - Sacc, //�A�L�������[�^ - Sflg, //�t���O���W�X�^ - /* �X�C�b�`�ǂݏo���p���W�X�^ */ - Ssw_data, //�f�[�^(8bit) - Ssw_inst, //����(4bit) - Ssw_regi, //���W�X�^�ԍ�(4bit) - Ssw_memi, //�������Ԓn(4bit) - Ssw_psel, //�v���O�����Z���N�^(4bit) - Ssw_rw, //�ǂݏ������[�h(1bit) - Ssw_run, //���s���[�h(1bit) - /* 7�Z�O�p���W�X�^ */ - Sseg, - - /* �z��錾�p */ - REG_MAX_COUNT -}; - -/************************************************** - * Variables - **************************************************/ - -// ���W�X�^�p�̕ϐ� -extern char global_registers[REG_MAX_COUNT]; - -/************************************************** - * Functions - **************************************************/ - -void registers_init(); - - -#endif /* SYS_REGISTER_H_ */ diff --git a/software/qsys_tutorial_mem/system.c b/software/qsys_tutorial_mem/system.c deleted file mode 100644 index 30713dd..0000000 --- a/software/qsys_tutorial_mem/system.c +++ /dev/null @@ -1,14 +0,0 @@ -/* - * system.c - * - * Created on: 2016/11/24 - * Author: takayun - */ -#include "system.h" -#include "hex_out.h" - -void panic() { - clear_block(HEX0_3); - print_block("err ", 4, HEX0_3); -} - diff --git a/software/qsys_tutorial_mem/system.h b/software/qsys_tutorial_mem/system.h deleted file mode 100644 index 1a628fa..0000000 --- a/software/qsys_tutorial_mem/system.h +++ /dev/null @@ -1,13 +0,0 @@ -/* - * system.h - * - * Created on: 2016/11/24 - * Author: takayun - */ - -#ifndef SYSTEM_H_ -#define SYSTEM_H_ - -void panic(); - -#endif /* SYSTEM_H_ */ diff --git a/software/qsys_tutorial_mem/system/template.xml b/software/qsys_tutorial_mem/system/template.xml deleted file mode 100644 index b09e912..0000000 --- a/software/qsys_tutorial_mem/system/template.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git a/software/qsys_tutorial_mem_bsp/.cproject b/software/qsys_tutorial_mem_bsp/.cproject deleted file mode 100644 index ed9c556..0000000 --- a/software/qsys_tutorial_mem_bsp/.cproject +++ /dev/null @@ -1,481 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/software/qsys_tutorial_mem_bsp/.project b/software/qsys_tutorial_mem_bsp/.project deleted file mode 100644 index 58df451..0000000 --- a/software/qsys_tutorial_mem_bsp/.project +++ /dev/null @@ -1,85 +0,0 @@ - - - qsys_tutorial_mem_bsp - - - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - ?name? - - - - org.eclipse.cdt.make.core.append_environment - true - - - org.eclipse.cdt.make.core.autoBuildTarget - all - - - org.eclipse.cdt.make.core.buildArguments - - - - org.eclipse.cdt.make.core.buildCommand - make - - - org.eclipse.cdt.make.core.buildLocation - ${workspace_loc://qsys_tutorial_mem_bsp} - - - org.eclipse.cdt.make.core.cleanBuildTarget - clean - - - org.eclipse.cdt.make.core.contents - org.eclipse.cdt.make.core.activeConfigSettings - - - org.eclipse.cdt.make.core.enableAutoBuild - false - - - org.eclipse.cdt.make.core.enableCleanBuild - true - - - org.eclipse.cdt.make.core.enableFullBuild - true - - - org.eclipse.cdt.make.core.fullBuildTarget - all - - - org.eclipse.cdt.make.core.stopOnError - true - - - org.eclipse.cdt.make.core.useDefaultBuildCmd - true - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - org.eclipse.cdt.core.ccnature - com.altera.sbtgui.project.SBTGUINature - com.altera.sbtgui.project.SBTGUIBspNature - - diff --git a/software/qsys_tutorial_mem_bsp/HAL/inc/alt_types.h b/software/qsys_tutorial_mem_bsp/HAL/inc/alt_types.h deleted file mode 100644 index d02f171..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/inc/alt_types.h +++ /dev/null @@ -1,54 +0,0 @@ -#ifndef __ALT_TYPES_H__ -#define __ALT_TYPES_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/* - * Don't declare these typedefs if this file is included by assembly source. - */ -#ifndef ALT_ASM_SRC -typedef signed char alt_8; -typedef unsigned char alt_u8; -typedef signed short alt_16; -typedef unsigned short alt_u16; -typedef signed long alt_32; -typedef unsigned long alt_u32; -typedef long long alt_64; -typedef unsigned long long alt_u64; -#endif - -#define ALT_INLINE __inline__ -#define ALT_ALWAYS_INLINE __attribute__ ((always_inline)) -#define ALT_WEAK __attribute__((weak)) - -#endif /* __ALT_TYPES_H__ */ diff --git a/software/qsys_tutorial_mem_bsp/HAL/inc/altera_nios2_qsys_irq.h b/software/qsys_tutorial_mem_bsp/HAL/inc/altera_nios2_qsys_irq.h deleted file mode 100644 index 6629ec9..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/inc/altera_nios2_qsys_irq.h +++ /dev/null @@ -1,80 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * Support for the Nios II internal interrupt controller. - */ - -#ifndef __ALT_NIOS2_QSYS_IRQ_H__ -#define __ALT_NIOS2_QSYS_IRQ_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The macro ALTERA_NIOS2_IRQ_INSTANCE is used by the alt_irq_init() - * function in the auto-generated file alt_sys_init.c to create an - * instance of this interrupt controller device driver state if this - * module contains an interrupt controller. - * Only one instance of a Nios II is allowed so this macro is just empty. - */ - -#define ALTERA_NIOS2_QSYS_IRQ_INSTANCE(name, state) - -/* - * altera_nios2_irq_init() is called by the auto-generated function - * alt_irq_init() once for the Nios II if it contains an interrupt controller. - * The altera_nios2_irq_init() routine is called using the - * ALTERA_NIOS2_IRQ_INIT macro given below. - * - * This function initializes the internal interrupt controller - * so is not called if the Nios II contains an external interrupt - * controller port (because the internal interrupt controller - * is removed if this port is present). - */ - -extern void altera_nios2_qsys_irq_init( void ); - -/* - * The macro ALTERA_NIOS2_IRQ_INIT is used by the alt_irq_init() routine - * in the auto-generated file alt_sys_init.c to initialize an instance - * of the interrupt controller device driver state. - */ - -#define ALTERA_NIOS2_QSYS_IRQ_INIT(name, state) altera_nios2_qsys_irq_init() - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_NIOS2_QSYS_IRQ_H__ */ - diff --git a/software/qsys_tutorial_mem_bsp/HAL/inc/io.h b/software/qsys_tutorial_mem_bsp/HAL/inc/io.h deleted file mode 100644 index 362f103..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/inc/io.h +++ /dev/null @@ -1,81 +0,0 @@ -#ifndef __IO_H__ -#define __IO_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/* IO Header file for Nios II Toolchain */ - -#include "alt_types.h" -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#ifndef SYSTEM_BUS_WIDTH -#error SYSTEM_BUS_WIDTH undefined -#endif - -/* Dynamic bus access functions */ - -#define __IO_CALC_ADDRESS_DYNAMIC(BASE, OFFSET) \ - ((void *)(((alt_u8*)BASE) + (OFFSET))) - -#define IORD_32DIRECT(BASE, OFFSET) \ - __builtin_ldwio (__IO_CALC_ADDRESS_DYNAMIC ((BASE), (OFFSET))) -#define IORD_16DIRECT(BASE, OFFSET) \ - __builtin_ldhuio (__IO_CALC_ADDRESS_DYNAMIC ((BASE), (OFFSET))) -#define IORD_8DIRECT(BASE, OFFSET) \ - __builtin_ldbuio (__IO_CALC_ADDRESS_DYNAMIC ((BASE), (OFFSET))) - -#define IOWR_32DIRECT(BASE, OFFSET, DATA) \ - __builtin_stwio (__IO_CALC_ADDRESS_DYNAMIC ((BASE), (OFFSET)), (DATA)) -#define IOWR_16DIRECT(BASE, OFFSET, DATA) \ - __builtin_sthio (__IO_CALC_ADDRESS_DYNAMIC ((BASE), (OFFSET)), (DATA)) -#define IOWR_8DIRECT(BASE, OFFSET, DATA) \ - __builtin_stbio (__IO_CALC_ADDRESS_DYNAMIC ((BASE), (OFFSET)), (DATA)) - -/* Native bus access functions */ - -#define __IO_CALC_ADDRESS_NATIVE(BASE, REGNUM) \ - ((void *)(((alt_u8*)BASE) + ((REGNUM) * (SYSTEM_BUS_WIDTH/8)))) - -#define IORD(BASE, REGNUM) \ - __builtin_ldwio (__IO_CALC_ADDRESS_NATIVE ((BASE), (REGNUM))) -#define IOWR(BASE, REGNUM, DATA) \ - __builtin_stwio (__IO_CALC_ADDRESS_NATIVE ((BASE), (REGNUM)), (DATA)) - -#ifdef __cplusplus -} -#endif - -#endif /* __IO_H__ */ diff --git a/software/qsys_tutorial_mem_bsp/HAL/inc/nios2.h b/software/qsys_tutorial_mem_bsp/HAL/inc/nios2.h deleted file mode 100644 index 72cefba..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/inc/nios2.h +++ /dev/null @@ -1,230 +0,0 @@ -#ifndef __NIOS2_H__ -#define __NIOS2_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2008 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * This header provides processor specific macros for accessing the Nios2 - * control registers. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * Macros for accessing selected processor registers - */ - -#define NIOS2_READ_ET(et) \ - do { __asm ("mov %0, et" : "=r" (et) ); } while (0) - -#define NIOS2_WRITE_ET(et) \ - do { __asm volatile ("mov et, %z0" : : "rM" (et)); } while (0) - -#define NIOS2_READ_SP(sp) \ - do { __asm ("mov %0, sp" : "=r" (sp) ); } while (0) - -/* - * Macros for useful processor instructions - */ - -#define NIOS2_BREAK() \ - do { __asm volatile ("break"); } while (0) - -#define NIOS2_REPORT_STACK_OVERFLOW() \ - do { __asm volatile("break 3"); } while (0) - -/* - * Macros for accessing the control registers. - */ - -#define NIOS2_READ_STATUS(dest) \ - do { dest = __builtin_rdctl(0); } while (0) - -#define NIOS2_WRITE_STATUS(src) \ - do { __builtin_wrctl(0, src); } while (0) - -#define NIOS2_READ_ESTATUS(dest) \ - do { dest = __builtin_rdctl(1); } while (0) - -#define NIOS2_READ_BSTATUS(dest) \ - do { dest = __builtin_rdctl(2); } while (0) - -#define NIOS2_READ_IENABLE(dest) \ - do { dest = __builtin_rdctl(3); } while (0) - -#define NIOS2_WRITE_IENABLE(src) \ - do { __builtin_wrctl(3, src); } while (0) - -#define NIOS2_READ_IPENDING(dest) \ - do { dest = __builtin_rdctl(4); } while (0) - -#define NIOS2_READ_CPUID(dest) \ - do { dest = __builtin_rdctl(5); } while (0) - - -/* - * Macros for accessing extra exception registers. These - * are always enabled wit the MPU or MMU, and optionally - * with other advanced exception types/ - */ -#define NIOS2_READ_EXCEPTION(dest) \ - do { dest = __builtin_rdctl(7); } while (0) - -#define NIOS2_READ_BADADDR(dest) \ - do { dest = __builtin_rdctl(12); } while (0) - - -/* - * Macros for accessing control registers for MPU - * operation. These should not be used unless the - * MPU is enabled. - * - * The config register may be augmented for future - * enhancements. For now, only MPU support is provided. - */ -/* Config register */ -#define NIOS2_WRITE_CONFIG(src) \ - do { __builtin_wrctl(13, src); } while (0) - -#define NIOS2_READ_CONFIG(dest) \ - do { dest = __builtin_rdctl(13); } while (0) - -/* MPU Base Address Register */ -#define NIOS2_WRITE_MPUBASE(src) \ - do { __builtin_wrctl(14, src); } while (0) - -#define NIOS2_READ_MPUBASE(dest) \ - do { dest = __builtin_rdctl(14); } while (0) - -/* MPU Access Register */ -#define NIOS2_WRITE_MPUACC(src) \ - do { __builtin_wrctl(15, src); } while (0) - -#define NIOS2_READ_MPUACC(dest) \ - do { dest = __builtin_rdctl(15); } while (0) - - -/* - * Nios II control registers that are always present - */ -#define NIOS2_STATUS status -#define NIOS2_ESTATUS estatus -#define NIOS2_BSTATUS bstatus -#define NIOS2_IENABLE ienable -#define NIOS2_IPENDING ipending -#define NIOS2_CPUID cpuid - -/* - * STATUS, BSTATUS, ESTATUS, and SSTATUS fields. - * The presence of fields is a function of the Nios II configuration. - */ -#define NIOS2_STATUS_PIE_MSK (0x00000001) -#define NIOS2_STATUS_PIE_OFST (0) -#define NIOS2_STATUS_U_MSK (0x00000002) -#define NIOS2_STATUS_U_OFST (1) -#define NIOS2_STATUS_EH_MSK (0x00000004) -#define NIOS2_STATUS_EH_OFST (2) -#define NIOS2_STATUS_IH_MSK (0x00000008) -#define NIOS2_STATUS_IH_OFST (3) -#define NIOS2_STATUS_IL_MSK (0x000003f0) -#define NIOS2_STATUS_IL_OFST (4) -#define NIOS2_STATUS_CRS_MSK (0x0000fc00) -#define NIOS2_STATUS_CRS_OFST (10) -#define NIOS2_STATUS_PRS_MSK (0x003f0000) -#define NIOS2_STATUS_PRS_OFST (16) -#define NIOS2_STATUS_NMI_MSK (0x00400000) -#define NIOS2_STATUS_NMI_OFST (22) -#define NIOS2_STATUS_RSIE_MSK (0x00800000) -#define NIOS2_STATUS_RSIE_OFST (23) -#define NIOS2_STATUS_SRS_MSK (0x80000000) -#define NIOS2_STATUS_SRS_OFST (31) - -/* - * Bit masks & offsets available with extra exceptions support - */ - -/* Exception register */ -#define NIOS2_EXCEPTION_REG_CAUSE_MASK (0x0000007c) -#define NIOS2_EXCEPTION_REG_CAUSE_OFST (2) - -/* - * Bit masks & offsets for MPU support - * - * All bit-masks are expressed relative to the position - * of the data with a register. To read data that is LSB- - * aligned, the register read data should be masked, then - * right-shifted by the designated "OFST" macro value. The - * opposite should be used for register writes when starting - * with LSB-aligned data. - */ - -/* Config register */ -#define NIOS2_CONFIG_REG_PE_MASK (0x00000001) -#define NIOS2_CONFIG_REG_PE_OFST (0) -#define NIOS2_CONFIG_REG_ANI_MASK (0x00000002) -#define NIOS2_CONFIG_REG_ANI_OFST (1) - -/* MPU Base Address Register */ -#define NIOS2_MPUBASE_D_MASK (0x00000001) -#define NIOS2_MPUBASE_D_OFST (0) -#define NIOS2_MPUBASE_INDEX_MASK (0x0000003e) -#define NIOS2_MPUBASE_INDEX_OFST (1) -#define NIOS2_MPUBASE_BASE_ADDR_MASK (0xffffffc0) -#define NIOS2_MPUBASE_BASE_ADDR_OFST (6) - -/* MPU Access Register */ -#define NIOS2_MPUACC_LIMIT_MASK (0xffffffc0) -#define NIOS2_MPUACC_LIMIT_OFST (6) -#define NIOS2_MPUACC_MASK_MASK (0xffffffc0) -#define NIOS2_MPUACC_MASK_OFST (6) -#define NIOS2_MPUACC_C_MASK (0x00000020) -#define NIOS2_MPUACC_C_OFST (5) -#define NIOS2_MPUACC_PERM_MASK (0x0000001c) -#define NIOS2_MPUACC_PERM_OFST (2) -#define NIOS2_MPUACC_RD_MASK (0x00000002) -#define NIOS2_MPUACC_RD_OFST (1) -#define NIOS2_MPUACC_WR_MASK (0x00000001) -#define NIOS2_MPUACC_WR_OFST (0) - -/* - * Number of available IRQs in internal interrupt controller. - */ -#define NIOS2_NIRQ 32 - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __NIOS2_H__ */ diff --git a/software/qsys_tutorial_mem_bsp/HAL/inc/os/alt_flag.h b/software/qsys_tutorial_mem_bsp/HAL/inc/os/alt_flag.h deleted file mode 100644 index b9b4605..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/inc/os/alt_flag.h +++ /dev/null @@ -1,98 +0,0 @@ -#ifndef __ALT_FLAG_H__ -#define __ALT_FLAG_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * This header provides macro definitions that can be used to create and use - * uc/OS-II style event flags. These macros can be used in both a uC/OS-II based - * environment, and a single threaded HAL based environment. - * - * The motivation for these macros is to allow code to be developed which is - * thread safe under uC/OS-II, but incurs no additional overhead when used in a - * single threaded HAL environment. - * - * In the case of a single threaded HAL environment, they compile to - * "do nothing" directives, which ensures they do not contribute to the final - * executable. - * - * The following macros are available: - * - * ALT_FLAG_GRP - Create a flag group instance. - * ALT_EXTERN_FLAG_GRP - Create a reference to an external flag group instance. - * ALT_STATIC_FLAG_GRP - Create a static flag group instance. - * ALT_FLAG_CREATE - Initialise a flag group. - * ALT_FLAG_PEND - Pend on a flag group. - * ALT_FLAG_POST - Set a flag condition. - - * - * Input arguments and return codes are all consistant with the equivalent - * uC/OS-II function. - * - * It's important to be careful in the use of the macros: ALT_FLAG_GRP, - * ALT_EXTERN_FLAG_GRP, and ALT_STATIC_FLAG_GRP. In these three cases the - * semi-colon is included in the macro definition; so, for example, you should - * use: - * - * ALT_FLAG_GRP(mygroup) - * - * not: - * - * ALT_FLAG_GRP(mygroup); - * - * The inclusion of the semi-colon has been necessary to ensure the macros can - * compile with no warnings when used in a single threaded HAL environment. - * - */ - -#include "priv/alt_no_error.h" - -#define ALT_FLAG_GRP(group) -#define ALT_EXTERN_FLAG_GRP(group) -#define ALT_STATIC_FLAG_GRP(group) - -#define ALT_FLAG_CREATE(group, flags) alt_no_error () -#define ALT_FLAG_PEND(group, flags, wait_type, timeout) alt_no_error () -#define ALT_FLAG_POST(group, flags, opt) alt_no_error () - -#ifndef ALT_SINGLE_THREADED -#define ALT_SINGLE_THREADED -#endif - -#endif /* __ALT_FLAG_H__ */ diff --git a/software/qsys_tutorial_mem_bsp/HAL/inc/os/alt_hooks.h b/software/qsys_tutorial_mem_bsp/HAL/inc/os/alt_hooks.h deleted file mode 100644 index 9054e3f..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/inc/os/alt_hooks.h +++ /dev/null @@ -1,61 +0,0 @@ -#ifndef __ALT_HOOKS_H__ -#define __ALT_HOOKS_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * This header provides "do-nothing" macro definitions for operating system - * hooks within the HAL. The O/S component can override these to provide it's - * own implementation. - */ - -#define ALT_OS_TIME_TICK() while(0) -#define ALT_OS_INIT() while(0) -#define ALT_OS_STOP() while(0) - -/* Call from assembly code */ -#define ALT_OS_INT_ENTER_ASM -#define ALT_OS_INT_EXIT_ASM - -/* Call from C code */ -#define ALT_OS_INT_ENTER() while(0) -#define ALT_OS_INT_EXIT() while(0) - - -#endif /* __ALT_HOOKS_H__ */ diff --git a/software/qsys_tutorial_mem_bsp/HAL/inc/os/alt_sem.h b/software/qsys_tutorial_mem_bsp/HAL/inc/os/alt_sem.h deleted file mode 100644 index 753943e..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/inc/os/alt_sem.h +++ /dev/null @@ -1,96 +0,0 @@ -#ifndef __ALT_SEM_H__ -#define __ALT_SEM_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * This header provides macro definitions that can be used to create and use - * semaphores. These macros can be used in both a uC/OS-II based environment, - * and a single threaded HAL based environment. - * - * The motivation for these macros is to allow code to be developed which is - * thread safe under uC/OS-II, but incurs no additional overhead when used in a - * single threaded HAL environment. - * - * In the case of a single threaded HAL environment, they compile to - * "do nothing" directives, which ensures they do not contribute to the final - * executable. - * - * The following macros are available: - * - * ALT_SEM - Create a semaphore instance. - * ALT_EXTERN_SEM - Create a reference to an external semaphore instance. - * ALT_STATIC_SEM - Create a static semaphore instance. - * ALT_SEM_CREATE - Initialise a semaphore. - * ALT_SEM_PEND - Pend on a semaphore. - * ALT_SEM_POST - Increment a semaphore. - * - * Input arguments and return codes are all consistant with the equivalent - * uC/OS-II function. - * - * It's important to be careful in the use of the macros: ALT_SEM, - * ALT_EXTERN_SEM, and ALT_STATIC_SEM. In these three cases the semi-colon is - * included in the macro definition; so, for example, you should use: - * - * ALT_SEM(mysem) - * - * not: - * - * ALT_SEM(mysem); - * - * The inclusion of the semi-colon has been necessary to ensure the macros can - * compile with no warnings when used in a single threaded HAL environment. - * - */ - -#include "priv/alt_no_error.h" - -#define ALT_SEM(sem) -#define ALT_EXTERN_SEM(sem) -#define ALT_STATIC_SEM(sem) - -#define ALT_SEM_CREATE(sem, value) alt_no_error () -#define ALT_SEM_PEND(sem, timeout) alt_no_error () -#define ALT_SEM_POST(sem) alt_no_error () - -#ifndef ALT_SINGLE_THREADED -#define ALT_SINGLE_THREADED -#endif - -#endif /* __ALT_SEM_H__ */ diff --git a/software/qsys_tutorial_mem_bsp/HAL/inc/os/alt_syscall.h b/software/qsys_tutorial_mem_bsp/HAL/inc/os/alt_syscall.h deleted file mode 100644 index 507c6aa..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/inc/os/alt_syscall.h +++ /dev/null @@ -1,75 +0,0 @@ -#ifndef __ALT_SYSCALL_H__ -#define __ALT_SYSCALL_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * The macros defined in this file are used to provide the function names used - * for the HAL 'UNIX style' interface, e.g. read(), write() etc. - * - * Operating systems which are ported to the HAL can provide their own - * version of this file, which will be used in preference. This allows - * the operating system to provide it's own implementation of the top level - * system calls, while retaining the HAL functions under a different name, - * for example, alt_read(), alt_write() etc. - */ - -#define ALT_CLOSE close -#define ALT_ENVIRON environ -#define ALT_EXECVE execve -#define ALT_EXIT _exit -#define ALT_FCNTL fcntl -#define ALT_FORK fork -#define ALT_FSTAT fstat -#define ALT_GETPID getpid -#define ALT_GETTIMEOFDAY gettimeofday -#define ALT_IOCTL ioctl -#define ALT_ISATTY isatty -#define ALT_KILL kill -#define ALT_LINK link -#define ALT_LSEEK lseek -#define ALT_OPEN open -#define ALT_READ read -#define ALT_RENAME _rename -#define ALT_SBRK sbrk -#define ALT_SETTIMEOFDAY settimeofday -#define ALT_STAT stat -#define ALT_UNLINK unlink -#define ALT_USLEEP usleep -#define ALT_WAIT wait -#define ALT_WRITE write -#define ALT_TIMES times - -/* - * - */ - -#endif /* __ALT_SYSCALL_H__ */ diff --git a/software/qsys_tutorial_mem_bsp/HAL/inc/priv/alt_alarm.h b/software/qsys_tutorial_mem_bsp/HAL/inc/priv/alt_alarm.h deleted file mode 100644 index 45d6a0e..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/inc/priv/alt_alarm.h +++ /dev/null @@ -1,101 +0,0 @@ -#ifndef __ALT_PRIV_ALARM_H__ -#define __ALT_PRIV_ALARM_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "alt_types.h" - -/* - * This header provides the internal defenitions required by the public - * interface alt_alarm.h. These variables and structures are not guaranteed to - * exist in future implementations of the HAL. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * "alt_alarm_s" is a structure type used to maintain lists of alarm callback - * functions. - */ - -struct alt_alarm_s -{ - alt_llist llist; /* linked list */ - alt_u32 time; /* time in system ticks of the callback */ - alt_u32 (*callback) (void* context); /* callback function. The return - * value is the period for the next callback; where - * zero indicates that the alarm should be removed - * from the list. - */ - alt_u8 rollover; /* set when desired alarm time + current time causes - overflow, to prevent premature alarm */ - void* context; /* Argument for the callback */ -}; - -/* - * "_alt_tick_rate" is a global variable used to store the system clock rate - * in ticks per second. This is initialised to zero, which coresponds to there - * being no system clock available. - * - * It is then set to it's final value by the system clock driver through a call - * to alt_sysclk_init(). - */ - -extern alt_u32 _alt_tick_rate; - -/* - * "_alt_nticks" is a global variable which records the elapsed number of - * system clock ticks since the last call to settimeofday() or since reset if - * settimeofday() has not been called. - */ - -extern volatile alt_u32 _alt_nticks; - -/* The list of registered alarms. */ - -extern alt_llist alt_alarm_list; - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_PRIV_ALARM_H__ */ diff --git a/software/qsys_tutorial_mem_bsp/HAL/inc/priv/alt_busy_sleep.h b/software/qsys_tutorial_mem_bsp/HAL/inc/priv/alt_busy_sleep.h deleted file mode 100644 index b1af849..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/inc/priv/alt_busy_sleep.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef __ALT_BUSY_SLEEP_H -#define __ALT_BUSY_SLEEP_H - -/* - * Copyright (c) 2003 Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - */ - -/* - * The function alt_busy_sleep provides a busy loop implementation of usleep. - * This is used to provide usleep for the standalone HAL, or when the timer is - * unavailable in uC/OS-II. - */ - -extern unsigned int alt_busy_sleep (unsigned int us); - -#endif /* __ALT_BUSY_SLEEP_H */ diff --git a/software/qsys_tutorial_mem_bsp/HAL/inc/priv/alt_dev_llist.h b/software/qsys_tutorial_mem_bsp/HAL/inc/priv/alt_dev_llist.h deleted file mode 100644 index 451b063..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/inc/priv/alt_dev_llist.h +++ /dev/null @@ -1,77 +0,0 @@ -#ifndef __ALT_DEV_LLIST_H__ -#define __ALT_DEV_LLIST_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "sys/alt_llist.h" -#include "alt_types.h" - -/* - * This header provides the internal defenitions required to control file - * access. These variables and functions are not guaranteed to exist in - * future implementations of the HAL. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The alt_dev_llist is an internal structure used to form a common base - * class for all device types. The use of this structure allows common code - * to be used to manipulate the various device lists. - */ - -typedef struct { - alt_llist llist; - const char* name; -} alt_dev_llist; - -/* - * - */ - -extern int alt_dev_llist_insert (alt_dev_llist* dev, alt_llist* list); - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_DEV_LLIST_H__ */ diff --git a/software/qsys_tutorial_mem_bsp/HAL/inc/priv/alt_exception_handler_registry.h b/software/qsys_tutorial_mem_bsp/HAL/inc/priv/alt_exception_handler_registry.h deleted file mode 100644 index c6905fa..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/inc/priv/alt_exception_handler_registry.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef __ALT_EXCEPTION_HANDLER_REGISTRY_H__ -#define __ALT_EXCEPTION_HANDLER_REGISTRY_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2008 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ -#include "sys/alt_exceptions.h" - -/* Function pointer to exception callback routine */ -extern alt_exception_result (*alt_instruction_exception_handler) - (alt_exception_cause, alt_u32, alt_u32); - -#endif /* __ALT_EXCEPTION_HANDLER_REGISTRY_H__ */ diff --git a/software/qsys_tutorial_mem_bsp/HAL/inc/priv/alt_file.h b/software/qsys_tutorial_mem_bsp/HAL/inc/priv/alt_file.h deleted file mode 100644 index 2c3e843..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/inc/priv/alt_file.h +++ /dev/null @@ -1,179 +0,0 @@ -#ifndef __ALT_FILE_H__ -#define __ALT_FILE_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "sys/alt_dev.h" -#include "sys/alt_llist.h" -#include "os/alt_sem.h" - -#include "alt_types.h" - -/* - * This header provides the internal defenitions required to control file - * access. These variables and functions are not guaranteed to exist in - * future implementations of the HAL. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The function alt_find_dev() is used to search the device list "list" to - * locate a device named "name". If a match is found, then a pointer to the - * device is returned, otherwise NULL is returned. - */ - -extern alt_dev* alt_find_dev (const char* name, alt_llist* list); - -/* - * alt_find_file() is used to search the list of registered file systems to - * find the filesystem that the file named "name" belongs to. If a match is - * found, then a pointer to the filesystems alt_dev structure is returned, - * otherwise NULL is returned. - * - * Note that a match does not indicate that the file exists, only that a - * filesystem exists that is registered for a partition that could contain - * the file. The filesystems open() function would need to be called in order - * to determine if the file exists. - */ - -extern alt_dev* alt_find_file (const char* name); - -/* - * alt_get_fd() is used to allocate a file descriptor for the device or - * filesystem "dev". A negative return value indicates an error, otherwise the - * return value is the index of the file descriptor within the file descriptor - * pool. - */ - -extern int alt_get_fd (alt_dev* dev); - -/* - * alt_release_fd() is called to free the file descriptor with index "fd". - */ - -extern void alt_release_fd (int fd); - -/* - * alt_fd_lock() is called by ioctl() to mark the file descriptor "fd" as - * being open for exclusive access. Subsequent calls to open() for the device - * associated with "fd" will fail. A device is unlocked by either calling - * close() for "fd", or by an alternate call to ioctl() (see ioctl.c for - * details). - */ - -extern int alt_fd_lock (alt_fd* fd); - -/* - * alt_fd_unlock() is called by ioctl() to unlock a descriptor previously - * locked by a call to alt_fd_lock(). - */ - -extern int alt_fd_unlock (alt_fd* fd); - -/* - * "alt_fd_list" is the pool of file descriptors. - */ - -extern alt_fd alt_fd_list[]; - -/* - * flags used by alt_fd. - * - * ALT_FD_EXCL is used to mark a file descriptor as locked for exclusive - * access, i.e. further calls to open() for the associated device should - * fail. - * - * ALT_FD_DEV marks a dile descriptor as belonging to a device as oposed to a - * filesystem. - */ - -#define ALT_FD_EXCL 0x80000000 -#define ALT_FD_DEV 0x40000000 - -#define ALT_FD_FLAGS_MASK (ALT_FD_EXCL | ALT_FD_DEV) - -/* - * "alt_dev_list" is the head of the linked list of registered devices. - */ - -extern alt_llist alt_dev_list; - -/* - * "alt_fs_list" is the head of the linked list of registered filesystems. - */ - -extern alt_llist alt_fs_list; - -/* - * "alt_fd_list_lock" is a semaphore used to ensure that access to the pool - * of file descriptors is thread safe. - */ - -ALT_EXTERN_SEM(alt_fd_list_lock) - -/* - * "alt_max_fd" is a 'high water mark'. It indicates the highest file - * descriptor allocated. Use of this can save searching the entire pool - * for active file descriptors, which helps avoid contention on access - * to the file descriptor pool. - */ - -extern alt_32 alt_max_fd; - -/* - * alt_io_redirect() is called at startup to redirect stdout, stdin, and - * stderr to the devices named in the input arguments. By default these streams - * are directed at /dev/null, and are then redirected using this function once - * all of the devices have been registered within the system. - */ - -extern void alt_io_redirect(const char* stdout_dev, - const char* stdin_dev, - const char* stderr_dev); - - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_FILE_H__ */ diff --git a/software/qsys_tutorial_mem_bsp/HAL/inc/priv/alt_iic_isr_register.h b/software/qsys_tutorial_mem_bsp/HAL/inc/priv/alt_iic_isr_register.h deleted file mode 100644 index a0cb01c..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/inc/priv/alt_iic_isr_register.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef __ALT_IIC_ISR_REGISTER_H_ -#define __ALT_IIC_ISR_REGISTER_H_ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ -#include "alt_types.h" -#include "sys/alt_irq.h" - -extern int alt_iic_isr_register(alt_u32 ic_id, alt_u32 irq, alt_isr_func isr, - void *isr_context, void *flags); - -#endif /* __ALT_IIC_ISR_REGISTER_H_ */ diff --git a/software/qsys_tutorial_mem_bsp/HAL/inc/priv/alt_irq_table.h b/software/qsys_tutorial_mem_bsp/HAL/inc/priv/alt_irq_table.h deleted file mode 100644 index 694ef06..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/inc/priv/alt_irq_table.h +++ /dev/null @@ -1,59 +0,0 @@ -#ifndef __ALT_IRQ_TABLE_H__ -#define __ALT_IRQ_TABLE_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * Definition of a table describing each interrupt handler. The index into - * the array is the interrupt id associated with the handler. - * - * When an interrupt occurs, the associated handler is called with - * the argument stored in the context member. - * - * The table is physically created in alt_irq_handler.c - */ -extern struct ALT_IRQ_HANDLER -{ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - void (*handler)(void*); -#else - void (*handler)(void*, alt_u32); -#endif - void *context; -} alt_irq[ALT_NIRQ]; - -#endif diff --git a/software/qsys_tutorial_mem_bsp/HAL/inc/priv/alt_legacy_irq.h b/software/qsys_tutorial_mem_bsp/HAL/inc/priv/alt_legacy_irq.h deleted file mode 100644 index c7aec02..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/inc/priv/alt_legacy_irq.h +++ /dev/null @@ -1,158 +0,0 @@ -#ifndef __ALT_LEGACY_IRQ_H__ -#define __ALT_LEGACY_IRQ_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * This file provides prototypes and inline implementations of certain routines - * used by the legacy interrupt API. Do not include this in your driver or - * application source files, use "sys/alt_irq.h" instead to access the proper - * public API. - */ - -#include -#include "system.h" - -#ifndef NIOS2_EIC_PRESENT - -#include "nios2.h" -#include "alt_types.h" - -#include "sys/alt_irq.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * alt_irq_register() can be used to register an interrupt handler. If the - * function is succesful, then the requested interrupt will be enabled upon - * return. - */ -extern int alt_irq_register (alt_u32 id, - void* context, - alt_isr_func handler); - -/* - * alt_irq_disable() disables the individual interrupt indicated by "id". - */ -static ALT_INLINE int ALT_ALWAYS_INLINE alt_irq_disable (alt_u32 id) -{ - alt_irq_context status; - extern volatile alt_u32 alt_irq_active; - - status = alt_irq_disable_all (); - - alt_irq_active &= ~(1 << id); - NIOS2_WRITE_IENABLE (alt_irq_active); - - alt_irq_enable_all(status); - - return 0; -} - -/* - * alt_irq_enable() enables the individual interrupt indicated by "id". - */ -static ALT_INLINE int ALT_ALWAYS_INLINE alt_irq_enable (alt_u32 id) -{ - alt_irq_context status; - extern volatile alt_u32 alt_irq_active; - - status = alt_irq_disable_all (); - - alt_irq_active |= (1 << id); - NIOS2_WRITE_IENABLE (alt_irq_active); - - alt_irq_enable_all(status); - - return 0; -} - -#ifndef ALT_EXCEPTION_STACK -/* - * alt_irq_initerruptable() should only be called from within an ISR. It is used - * to allow higer priority interrupts to interrupt the current ISR. The input - * argument, "priority", is the priority, i.e. interrupt number of the current - * interrupt. - * - * If this function is called, then the ISR is required to make a call to - * alt_irq_non_interruptible() before returning. The input argument to - * alt_irq_non_interruptible() is the return value from alt_irq_interruptible(). - * - * Care should be taken when using this pair of functions, since they increasing - * the system overhead associated with interrupt handling. - * - * If you are using an exception stack then nested interrupts won't work, so - * these functions are not available in that case. - */ -static ALT_INLINE alt_u32 ALT_ALWAYS_INLINE alt_irq_interruptible (alt_u32 priority) -{ - extern volatile alt_u32 alt_priority_mask; - extern volatile alt_u32 alt_irq_active; - - alt_u32 old_priority; - - old_priority = alt_priority_mask; - alt_priority_mask = (1 << priority) - 1; - - NIOS2_WRITE_IENABLE (alt_irq_active & alt_priority_mask); - - NIOS2_WRITE_STATUS (1); - - return old_priority; -} - -/* - * See Comments above for alt_irq_interruptible() for an explanation of the use of this - * function. - */ -static ALT_INLINE void ALT_ALWAYS_INLINE alt_irq_non_interruptible (alt_u32 mask) -{ - extern volatile alt_u32 alt_priority_mask; - extern volatile alt_u32 alt_irq_active; - - NIOS2_WRITE_STATUS (0); - - alt_priority_mask = mask; - - NIOS2_WRITE_IENABLE (mask & alt_irq_active); -} -#endif /* ALT_EXCEPTION_STACK */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* NIOS2_EIC_PRESENT */ - -#endif /* __ALT_LEGACY_IRQ_H__ */ diff --git a/software/qsys_tutorial_mem_bsp/HAL/inc/priv/alt_no_error.h b/software/qsys_tutorial_mem_bsp/HAL/inc/priv/alt_no_error.h deleted file mode 100644 index 6143fc9..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/inc/priv/alt_no_error.h +++ /dev/null @@ -1,77 +0,0 @@ -#ifndef __ALT_NO_ERROR_H__ -#define __ALT_NO_ERROR_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "alt_types.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * alt_no_error() is a dummy function used by alt_sem.h and alt_flag.h. It - * substitutes for functions that have a return code by creating a function - * that always returns zero. - * - * This may seem a little obscure, but what happens is that the compiler can - * then optomise away the call to this function, and any code written which - * handles the error path (i.e. non zero return values). - * - * This allows code to be written which correctly use the uC/OS-II semaphore - * and flag utilities, without the use of those utilities impacting on - * excutables built for a single threaded HAL environment. - * - * This function is considered to be part of the internal implementation of - * the HAL, and should not be called directly by application code or device - * drivers. It is not guaranteed to be preserved in future versions of the - * HAL. - */ - -static ALT_INLINE int ALT_ALWAYS_INLINE alt_no_error (void) -{ - return 0; -} - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_NO_ERROR_H__ */ diff --git a/software/qsys_tutorial_mem_bsp/HAL/inc/priv/nios2_gmon_data.h b/software/qsys_tutorial_mem_bsp/HAL/inc/priv/nios2_gmon_data.h deleted file mode 100644 index 3f43f12..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/inc/priv/nios2_gmon_data.h +++ /dev/null @@ -1,47 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ -#ifndef NIOS2_GMON_DATA_H -#define NIOS2_GMON_DATA_H - -#define GMON_DATA_SIG 0 -#define GMON_DATA_WORDS 1 -#define GMON_DATA_PROFILE_DATA 2 -#define GMON_DATA_PROFILE_LOWPC 3 -#define GMON_DATA_PROFILE_HIGHPC 4 -#define GMON_DATA_PROFILE_BUCKET 5 -#define GMON_DATA_PROFILE_RATE 6 -#define GMON_DATA_MCOUNT_START 7 -#define GMON_DATA_MCOUNT_LIMIT 8 - -#define GMON_DATA_SIZE 9 - -extern unsigned int alt_gmon_data[GMON_DATA_SIZE]; - -#endif diff --git a/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_alarm.h b/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_alarm.h deleted file mode 100644 index 68a2f5d..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_alarm.h +++ /dev/null @@ -1,126 +0,0 @@ -#ifndef __ALT_ALARM_H__ -#define __ALT_ALARM_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "alt_llist.h" -#include "alt_types.h" - -#include "priv/alt_alarm.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * "alt_alarm" is a structure type used by applications to register an alarm - * callback function. An instance of this type must be passed as an input - * argument to alt_alarm_start(). The user is not responsible for initialising - * the contents of the instance. This is done by alt_alarm_start(). - */ - -typedef struct alt_alarm_s alt_alarm; - -/* - * alt_alarm_start() can be called by an application/driver in order to register - * a function for periodic callback at the system clock frequency. Be aware that - * this callback is likely to occur in interrupt context. - */ - -extern int alt_alarm_start (alt_alarm* the_alarm, - alt_u32 nticks, - alt_u32 (*callback) (void* context), - void* context); - -/* - * alt_alarm_stop() is used to unregister a callback. Alternatively the callback - * can return zero to unregister. - */ - -extern void alt_alarm_stop (alt_alarm* the_alarm); - -/* - * Obtain the system clock rate in ticks/s. - */ - -static ALT_INLINE alt_u32 ALT_ALWAYS_INLINE alt_ticks_per_second (void) -{ - return _alt_tick_rate; -} - -/* - * alt_sysclk_init() is intended to be only used by the system clock driver - * in order to initialise the value of the clock frequency. - */ - -static ALT_INLINE int ALT_ALWAYS_INLINE alt_sysclk_init (alt_u32 nticks) -{ - if (! _alt_tick_rate) - { - _alt_tick_rate = nticks; - return 0; - } - else - { - return -1; - } -} - -/* - * alt_nticks() returns the elapsed number of system clock ticks since reset. - */ - -static ALT_INLINE alt_u32 ALT_ALWAYS_INLINE alt_nticks (void) -{ - return _alt_nticks; -} - -/* - * alt_tick() should only be called by the system clock driver. This is used - * to notify the system that the system timer period has expired. - */ - -extern void alt_tick (void); - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_ALARM_H__ */ diff --git a/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_cache.h b/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_cache.h deleted file mode 100644 index c4d8db9..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_cache.h +++ /dev/null @@ -1,117 +0,0 @@ -#ifndef __ALT_CACHE_H__ -#define __ALT_CACHE_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003, 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include - -#include "alt_types.h" - -/* - * alt_cache.h defines the processor specific functions for manipulating the - * cache. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * alt_icache_flush() is called to flush the instruction cache for a memory - * region of length "len" bytes, starting at address "start". - */ - -extern void alt_icache_flush (void* start, alt_u32 len); - -/* - * alt_dcache_flush() is called to flush the data cache for a memory - * region of length "len" bytes, starting at address "start". - * Any dirty lines in the data cache are written back to memory. - */ - -extern void alt_dcache_flush (void* start, alt_u32 len); - -/* - * alt_dcache_flush() is called to flush the data cache for a memory - * region of length "len" bytes, starting at address "start". - * Any dirty lines in the data cache are NOT written back to memory. - */ - -extern void alt_dcache_flush_no_writeback (void* start, alt_u32 len); - -/* - * Flush the entire instruction cache. - */ - -extern void alt_icache_flush_all (void); - -/* - * Flush the entire data cache. - */ - -extern void alt_dcache_flush_all (void); - -/* - * Allocate a block of uncached memory. - */ - -extern volatile void* alt_uncached_malloc (size_t size); - -/* - * Free a block of uncached memory. - */ - -extern void alt_uncached_free (volatile void* ptr); - -/* - * Convert a pointer to a block of cached memory, into a block of - * uncached memory. - */ - -extern volatile void* alt_remap_uncached (void* ptr, alt_u32 len); - -/* - * Convert a pointer to a block of uncached memory, into a block of - * cached memory. - */ - -extern void* alt_remap_cached (volatile void* ptr, alt_u32 len); - -/* - * - */ - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_CACHE_H__ */ diff --git a/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_debug.h b/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_debug.h deleted file mode 100644 index d9f9599..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_debug.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef __ALT_DEBUG_H__ -#define __ALT_DEBUG_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * The ALT_DEVUG_ASSERT macro can be used to generate a debugger break - * from within software. The break is generated if "condition" evaluates to - * false. - */ - -#define ALT_DEBUG_ASSERT(condition) if (!condition) \ -{ \ - __asm__ volatile ("break"); \ -} - -#endif /* __ALT_DEBUG_H__ */ diff --git a/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_dev.h b/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_dev.h deleted file mode 100644 index 66c5e41..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_dev.h +++ /dev/null @@ -1,115 +0,0 @@ -#ifndef __ALT_DEV_H__ -#define __ALT_DEV_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "system.h" -#include "sys/alt_llist.h" -#include "priv/alt_dev_llist.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The value ALT_IRQ_NOT_CONNECTED is used to represent an unconnected - * interrupt line. It cannot evaluate to a valid interrupt number. - */ - -#define ALT_IRQ_NOT_CONNECTED (-1) - -typedef struct alt_dev_s alt_dev; - -struct stat; - -/* - * The file descriptor structure definition. - */ - -typedef struct alt_fd_s -{ - alt_dev* dev; - alt_u8* priv; - int fd_flags; -} alt_fd; - -/* - * The device structure definition. - */ - -struct alt_dev_s { - alt_llist llist; /* for internal use */ - const char* name; - int (*open) (alt_fd* fd, const char* name, int flags, int mode); - int (*close) (alt_fd* fd); - int (*read) (alt_fd* fd, char* ptr, int len); - int (*write) (alt_fd* fd, const char* ptr, int len); - int (*lseek) (alt_fd* fd, int ptr, int dir); - int (*fstat) (alt_fd* fd, struct stat* buf); - int (*ioctl) (alt_fd* fd, int req, void* arg); -}; - -/* - * Functions used to register device for access through the C standard - * library. - * - * The only difference between alt_dev_reg() and alt_fs_reg() is the - * interpretation that open() places on the device name. In the case of - * alt_dev_reg the device is assumed to be a particular character device, - * and so there must be an exact match in the name for open to succeed. - * In the case of alt_fs_reg() the name of the device is treated as the - * mount point for a directory, and so any call to open() where the name - * is the root of the device filename will succeed. - */ - -extern int alt_fs_reg (alt_dev* dev); - -static ALT_INLINE int alt_dev_reg (alt_dev* dev) -{ - extern alt_llist alt_dev_list; - - return alt_dev_llist_insert ((alt_dev_llist*) dev, &alt_dev_list); -} - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_DEV_H__ */ diff --git a/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_dma.h b/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_dma.h deleted file mode 100644 index 9f9b2ff..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_dma.h +++ /dev/null @@ -1,226 +0,0 @@ -#ifndef __ALT_DMA_H__ -#define __ALT_DMA_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "sys/alt_dma_dev.h" -#include "alt_types.h" - -#include - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * This header contains the application side interface for accessing DMA - * resources. See alt_dma_dev.h for the dma device driver interface. - * - * The interface model treats a DMA transaction as being composed of two - * halves (read and write). - * - * The application can supply data for transmit using an "alt_dma_txchan" - * descriptor. Alternatively an "alt_dma_rxchan" descriptor can be used to - * receive data. - */ - -/* - * alt_dma_txchan_open() is used to obtain an "alt_dma_txchan" descriptor for - * a DMA transmit device. The name is the name of the associated physical - * device (e.g. "/dev/dma_0"). - * - * The return value will be NULL on failure, and non-NULL otherwise. - */ - -extern alt_dma_txchan alt_dma_txchan_open (const char* name); - -/* - * alt_dma_txchan_close() is provided so that an application can notify the - * system that it has finished with a given DMA transmit channel. This is only - * provided for completness. - */ - -static ALT_INLINE int alt_dma_txchan_close (alt_dma_txchan dma) -{ - return 0; -} - -/* - * alt_dma_txchan_send() posts a transmit request to a DMA transmit channel. - * The input arguments are: - * - * dma: the channel to use. - * from: a pointer to the start of the data to send. - * length: the length of the data to send in bytes. - * done: callback function that will be called once the data has been sent. - * handle: opaque value passed to "done". - * - * The return value will be negative if the request cannot be posted, and - * zero otherwise. - */ - -static ALT_INLINE int alt_dma_txchan_send (alt_dma_txchan dma, - const void* from, - alt_u32 length, - alt_txchan_done* done, - void* handle) -{ - return dma ? dma->dma_send (dma, - from, - length, - done, - handle) : -ENODEV; -} - -/* - * alt_dma_txchan_space() returns the number of tranmit requests that can be - * posted to the specified DMA transmit channel. - * - * A negative value indicates that the value could not be determined. - */ - -static ALT_INLINE int alt_dma_txchan_space (alt_dma_txchan dma) -{ - return dma ? dma->space (dma) : -ENODEV; -} - -/* - * alt_dma_txchan_ioctl() can be used to perform device specific I/O - * operations on the indicated DMA transmit channel. For example some drivers - * support options to control the width of the transfer operations. See - * alt_dma_dev.h for the list of generic requests. - * - * A negative return value indicates failure, otherwise the interpretation - * of the return value is request specific. - */ - -static ALT_INLINE int alt_dma_txchan_ioctl (alt_dma_txchan dma, - int req, - void* arg) -{ - return dma ? dma->ioctl (dma, req, arg) : -ENODEV; -} - -/* - * alt_dma_rxchan_open() is used to obtain an "alt_dma_rxchan" descriptor for - * a DMA receive channel. The name is the name of the associated physical - * device (e.g. "/dev/dma_0"). - * - * The return value will be NULL on failure, and non-NULL otherwise. - */ - -extern alt_dma_rxchan alt_dma_rxchan_open (const char* dev); - -/* - * alt_dma_rxchan_close() is provided so that an application can notify the - * system that it has finished with a given DMA receive channel. This is only - * provided for completness. - */ - -static ALT_INLINE int alt_dma_rxchan_close (alt_dma_rxchan dma) -{ - return 0; -} - -/* - * - */ - -/* - * alt_dma_rxchan_prepare() posts a receive request to a DMA receive channel. - * - * The input arguments are: - * - * dma: the channel to use. - * data: a pointer to the location that data is to be received to. - * len: the maximum length of the data to receive. - * done: callback function that will be called once the data has been - * received. - * handle: opaque value passed to "done". - * - * The return value will be negative if the request cannot be posted, and - * zero otherwise. - */ - -static ALT_INLINE int alt_dma_rxchan_prepare (alt_dma_rxchan dma, - void* data, - alt_u32 len, - alt_rxchan_done* done, - void* handle) -{ - return dma ? dma->prepare (dma, data, len, done, handle) : -ENODEV; -} - -/* - * alt_dma_rxchan_ioctl() can be used to perform device specific I/O - * operations on the indicated DMA receive channel. For example some drivers - * support options to control the width of the transfer operations. See - * alt_dma_dev.h for the list of generic requests. - * - * A negative return value indicates failure, otherwise the interpretation - * of the return value is request specific. - */ - -static ALT_INLINE int alt_dma_rxchan_ioctl (alt_dma_rxchan dma, - int req, - void* arg) -{ - return dma ? dma->ioctl (dma, req, arg) : -ENODEV; -} - -/* - * alt_dma_rxchan_depth() returns the depth of the receive FIFO used to store - * receive requests. - */ - -static ALT_INLINE alt_u32 alt_dma_rxchan_depth(alt_dma_rxchan dma) -{ - return dma->depth; -} - -/* - * - */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_DMA_H__ */ diff --git a/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_dma_dev.h b/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_dma_dev.h deleted file mode 100644 index 832463d..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_dma_dev.h +++ /dev/null @@ -1,200 +0,0 @@ -#ifndef __ALT_DMA_DEV_H__ -#define __ALT_DMA_DEV_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "priv/alt_dev_llist.h" - -#include "alt_types.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * This header contains the device driver interface for accessing DMA - * resources. See alt_dma.h for the DMA application side interface. - * - * The interface model treats a DMA transaction as being composed of two - * halves (read and write). - * - * An "alt_dma_txchan_dev" is used to describe the device associated with a - * DMA transmit channel. An "alt_dma_rxchan_dev" is used to describe the - * device associated with a DMA receive channel. - */ - -/* - * List of generic ioctl requests that may be supported by a DMA device. - * - * ALT_DMA_RX_ONLY_ON: This causes a DMA channel to operate in a mode - * where only the receiver is under software control. - * The other side reads continously from a single - * location. The address to read is the argument to - * this request. - * ALT_DMA_RX_ONLY_OFF: Return to the default mode where both the receive - * and transmit sides of the DMA can be under software - * control. - * ALT_DMA_TX_ONLY_ON: This causes a DMA channel to operate in a mode - * where only the transmitter is under software control. - * The other side writes continously to a single - * location. The address to write to is the argument to - * this request. - * ALT_DMA_TX_ONLY_OFF: Return to the default mode where both the receive - * and transmit sides of the DMA can be under software - * control. - * ALT_DMA_SET_MODE_8: Transfer data in units of 8 bits. - * ALT_DMA_SET_MODE_16: Transfer data in units of 16 bits. - * ALT_DMA_SET_MODE_32: Transfer data in units of 32 bits. - * ALT_DMA_SET_MODE_64: Transfer data in units of 64 bits. - * ALT_DMA_SET_MODE_128: Transfer data in units of 128 bits. - * ALT_DMA_GET_MODE: Get the current transfer mode. - * - * The use of the macros: ALT_DMA_TX_STREAM_ON, ALT_DMA_TX_STREAM_OFF - * ALT_DMA_RX_STREAM_OFF and ALT_DMA_RX_STREAM_ON are depreciated. You should - * instead use the macros: ALT_DMA_RX_ONLY_ON, ALT_DMA_RX_ONLY_OFF, - * ALT_DMA_TX_ONLY_ON and ALT_DMA_TX_ONLY_OFF. - */ - -#define ALT_DMA_TX_STREAM_ON (0x1) -#define ALT_DMA_TX_STREAM_OFF (0x2) -#define ALT_DMA_RX_STREAM_ON (0x3) -#define ALT_DMA_RX_STREAM_OFF (0x4) -#define ALT_DMA_SET_MODE_8 (0x5) -#define ALT_DMA_SET_MODE_16 (0x6) -#define ALT_DMA_SET_MODE_32 (0x7) -#define ALT_DMA_SET_MODE_64 (0x8) -#define ALT_DMA_SET_MODE_128 (0x9) -#define ALT_DMA_GET_MODE (0xa) - -#define ALT_DMA_RX_ONLY_ON ALT_DMA_TX_STREAM_ON -#define ALT_DMA_RX_ONLY_OFF ALT_DMA_TX_STREAM_OFF -#define ALT_DMA_TX_ONLY_ON ALT_DMA_RX_STREAM_ON -#define ALT_DMA_TX_ONLY_OFF ALT_DMA_RX_STREAM_OFF - -/* - * - */ - -typedef struct alt_dma_txchan_dev_s alt_dma_txchan_dev; -typedef struct alt_dma_rxchan_dev_s alt_dma_rxchan_dev; - -typedef alt_dma_txchan_dev* alt_dma_txchan; -typedef alt_dma_rxchan_dev* alt_dma_rxchan; - -typedef void (alt_txchan_done)(void* handle); -typedef void (alt_rxchan_done)(void* handle, void* data); - -/* - * devices that provide a DMA transmit channel are required to provide an - * instance of the "alt_dma_txchan_dev" structure. - */ - -struct alt_dma_txchan_dev_s { - alt_llist llist; /* for internal use */ - const char* name; /* name of the device instance - * (e.g. "/dev/dma_0"). - */ - int (*space) (alt_dma_txchan dma); /* returns the maximum number of - * transmit requests that can be posted - */ - int (*dma_send) (alt_dma_txchan dma, - const void* from, - alt_u32 len, - alt_txchan_done* done, - void* handle); /* post a transmit request */ - int (*ioctl) (alt_dma_txchan dma, int req, void* arg); /* perform device - * specific I/O control. - */ -}; - -/* - * devices that provide a DMA receive channel are required to provide an - * instance of the "alt_dma_rxchan_dev" structure. - */ - -struct alt_dma_rxchan_dev_s { - alt_llist list; /* for internal use */ - const char* name; /* name of the device instance - * (e.g. "/dev/dma_0"). - */ - alt_u32 depth; /* maximum number of receive requests that - * can be posted. - */ - int (*prepare) (alt_dma_rxchan dma, - void* data, - alt_u32 len, - alt_rxchan_done* done, - void* handle); /* post a receive request */ - int (*ioctl) (alt_dma_rxchan dma, int req, void* arg); /* perform device - * specific I/O control. - */ -}; - -/* - * Register a DMA transmit channel with the system. - */ - -static ALT_INLINE int alt_dma_txchan_reg (alt_dma_txchan_dev* dev) -{ - extern alt_llist alt_dma_txchan_list; - - return alt_dev_llist_insert((alt_dev_llist*) dev, &alt_dma_txchan_list); -} - -/* - * Register a DMA receive channel with the system. - */ - -static ALT_INLINE int alt_dma_rxchan_reg (alt_dma_rxchan_dev* dev) -{ - extern alt_llist alt_dma_rxchan_list; - - return alt_dev_llist_insert((alt_dev_llist*) dev, &alt_dma_rxchan_list); -} - -/* - * - */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_DMA_DEV_H__ */ diff --git a/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_driver.h b/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_driver.h deleted file mode 100644 index eb0f23b..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_driver.h +++ /dev/null @@ -1,168 +0,0 @@ -#ifndef __ALT_DRIVER_H__ -#define __ALT_DRIVER_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/* - * Macros used to access a driver without HAL file descriptors. - */ - -/* - * ALT_MODULE_CLASS - * - * This macro returns the module class name for the specified module instance. - * It uses information in the system.h file. - * Neither the instance name or class name are quoted (so that they can - * be used with other pre-processor macros). - * - * Example: - * Assume the design has an instance of an altera_avalon_uart called uart1. - * Calling ALT_MODULE_CLASS(uart1) returns altera_avalon_uart. - */ - -#define ALT_MODULE_CLASS(instance) ALT_MODULE_CLASS_ ## instance - - -/* - * ALT_DRIVER_FUNC_NAME - * - * --> instance Instance name. - * --> func Function name. - * - * This macro returns the device driver function name of the specified - * module instance for the specified function name. - * - * Example: - * Assume the design has an instance of an altera_avalon_uart called uart1. - * Calling ALT_DRIVER_FUNC_NAME(uart1, write) returns - * altera_avalon_uart_write. - */ - -#define ALT_DRIVER_FUNC_NAME(instance, func) \ - ALT_DRIVER_FUNC_NAME1(ALT_MODULE_CLASS(instance), func) -#define ALT_DRIVER_FUNC_NAME1(module_class, func) \ - ALT_DRIVER_FUNC_NAME2(module_class, func) -#define ALT_DRIVER_FUNC_NAME2(module_class, func) \ - module_class ## _ ## func - -/* - * ALT_DRIVER_STATE_STRUCT - * - * --> instance Instance name. - * - * This macro returns the device driver state type name of the specified - * module instance. - * - * Example: - * Assume the design has an instance of an altera_avalon_uart called uart1. - * Calling ALT_DRIVER_STATE_STRUCT(uart1) returns: - * struct altera_avalon_uart_state_s - * - * Note that the ALT_DRIVER_FUNC_NAME macro is used even though "state" isn't - * really a function but it does match the required naming convention. - */ -#define ALT_DRIVER_STATE_STRUCT(instance) \ - struct ALT_DRIVER_FUNC_NAME(instance, state_s) - -/* - * ALT_DRIVER_STATE - * - * --> instance Instance name. - * - * This macro returns the device driver state name of the specified - * module instance. - * - * Example: - * Assume the design has an instance of an altera_avalon_uart called uart1. - * Calling ALT_DRIVER_STATE(uart1) returns uart1. - */ -#define ALT_DRIVER_STATE(instance) instance - -/* - * ALT_DRIVER_WRITE - * - * --> instance Instance name. - * --> buffer Write buffer. - * --> len Length of write buffer data. - * --> flags Control flags (e.g. O_NONBLOCK) - * - * This macro calls the "write" function of the specified driver instance. - */ - -#define ALT_DRIVER_WRITE_EXTERNS(instance) \ - extern ALT_DRIVER_STATE_STRUCT(instance) ALT_DRIVER_STATE(instance); \ - extern int ALT_DRIVER_FUNC_NAME(instance, write) \ - (ALT_DRIVER_STATE_STRUCT(instance) *, const char *, int, int); - -#define ALT_DRIVER_WRITE(instance, buffer, len, flags) \ - ALT_DRIVER_FUNC_NAME(instance, write)(&ALT_DRIVER_STATE(instance), buffer, len, flags) - - -/* - * ALT_DRIVER_READ - * - * --> instance Instance name. - * <-- buffer Read buffer. - * --> len Length of read buffer. - * --> flags Control flags (e.g. O_NONBLOCK) - * - * This macro calls the "read" function of the specified driver instance. - */ - -#define ALT_DRIVER_READ_EXTERNS(instance) \ - extern ALT_DRIVER_STATE_STRUCT(instance) ALT_DRIVER_STATE(instance); \ - extern int ALT_DRIVER_FUNC_NAME(instance, read) \ - (ALT_DRIVER_STATE_STRUCT(instance) *, const char *, int, int); - -#define ALT_DRIVER_READ(instance, buffer, len, flags) \ - ALT_DRIVER_FUNC_NAME(instance, read)(&ALT_DRIVER_STATE(instance), buffer, len, flags) - -/* - * ALT_DRIVER_IOCTL - * - * --> instance Instance name. - * --> req ioctl request (e.g. TIOCSTIMEOUT) - * --> arg Optional argument (void*) - * - * This macro calls the "ioctl" function of the specified driver instance - */ - -#define ALT_DRIVER_IOCTL_EXTERNS(instance) \ - extern ALT_DRIVER_STATE_STRUCT(instance) ALT_DRIVER_STATE(instance); \ - extern int ALT_DRIVER_FUNC_NAME(instance, ioctl) \ - (ALT_DRIVER_STATE_STRUCT(instance) *, int, void*); - -#define ALT_DRIVER_IOCTL(instance, req, arg) \ - ALT_DRIVER_FUNC_NAME(instance, ioctl)(&ALT_DRIVER_STATE(instance), req, arg) - -#endif /* __ALT_DRIVER_H__ */ diff --git a/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_errno.h b/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_errno.h deleted file mode 100644 index 4d3e50f..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_errno.h +++ /dev/null @@ -1,87 +0,0 @@ -#ifndef __ALT_ERRNO_H__ -#define __ALT_ERRNO_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * errno is defined in so that it uses the thread local version - * stored in the location pointed to by "_impure_ptr". This means that the - * accesses to errno within the HAL library can cause the entirety of - * of the structure pointed to by "_impure_ptr" to be added to the - * users application. This can be undesirable in very small footprint systems. - * - * To avoid this happening, the HAL uses the macro ALT_ERRNO, defined below, - * to access errno, rather than accessing it directly. This macro will only - * use the thread local version if some other code has already caused it to be - * included into the system, otherwise it will use the global errno value. - * - * This causes a slight increases in code size where errno is accessed, but - * can lead to significant overall benefits in very small systems. The - * increase is inconsequential when compared to the size of the structure - * pointed to by _impure_ptr. - * - * Note that this macro accesses __errno() using an externally declared - * function pointer (alt_errno). This is done so that the function call uses the - * subroutine call instruction via a register rather than an immediate address. - * This is important in the case that the code has been linked for a high - * address, but __errno() is not being used. In this case the weak linkage - * would have resulted in the instruction: "call 0" which would fail to link. - */ - -extern int* (*alt_errno) (void); - -/* Must define this so that values such as EBADFD are defined in errno.h. */ -#define __LINUX_ERRNO_EXTENSIONS__ - -#include - -#include "alt_types.h" - -#undef errno - -extern int errno; - -static ALT_INLINE int* alt_get_errno(void) -{ - return ((alt_errno) ? alt_errno() : &errno); -} - -#define ALT_ERRNO *alt_get_errno() - -#endif /* __ALT_ERRNO_H__ */ diff --git a/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_exceptions.h b/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_exceptions.h deleted file mode 100644 index 3576a52..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_exceptions.h +++ /dev/null @@ -1,127 +0,0 @@ -#ifndef __ALT_EXCEPTIONS_H__ -#define __ALT_EXCEPTIONS_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2008 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ -#include "alt_types.h" -#include "system.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * This file defines instruction-generated exception handling and registry - * API, exception type enumeration, and handler return value enumeration for - * Nios II. - */ - -/* - * The following enumeration describes the value in the CPU EXCEPTION - * register CAUSE bit field. Not all exception types will cause the - * processor to go to the exception vector; these are provided for - * reference. - */ -enum alt_exception_cause_e { - /* Exeption causes that will cause jump to exception vector */ - NIOS2_EXCEPTION_INTERRUPT = 2, - NIOS2_EXCEPTION_TRAP_INST = 3, - NIOS2_EXCEPTION_UNIMPLEMENTED_INST = 4, - NIOS2_EXCEPTION_ILLEGAL_INST = 5, - NIOS2_EXCEPTION_MISALIGNED_DATA_ADDR = 6, - NIOS2_EXCEPTION_MISALIGNED_TARGET_PC = 7, - NIOS2_EXCEPTION_DIVISION_ERROR = 8, - NIOS2_EXCEPTION_SUPERVISOR_ONLY_INST_ADDR = 9, - NIOS2_EXCEPTION_SUPERVISOR_ONLY_INST = 10, - NIOS2_EXCEPTION_SUPERVISOR_ONLY_DATA_ADDR = 11, - NIOS2_EXCEPTION_TLB_MISS = 12, - NIOS2_EXCEPTION_TLB_EXECUTE_PERM_VIOLATION = 13, - NIOS2_EXCEPTION_MPU_INST_REGION_VIOLATION = 16, - - /* Exception causes that will NOT cause a jump to exception vector */ - NIOS2_EXCEPTION_RESET = 0, - NIOS2_EXCEPTION_CPU_ONLY_RESET_REQUEST = 1, - NIOS2_EXCEPTION_TLB_READ_PERM_VIOLATION = 14, - NIOS2_EXCEPTION_TLB_WRITE_PERM_VIOLATION = 15, - NIOS2_EXCEPTION_MPU_DATA_REGION_VIOLATION = 17, - /* - * This value is passed to an exception handler's cause argument if - * "extra exceptions" information (EXECPTION) register is not - * present in the processor hardware configuration. - */ - NIOS2_EXCEPTION_CAUSE_NOT_PRESENT = -1 -}; -typedef enum alt_exception_cause_e alt_exception_cause; - -/* - * These define valid return values for a user-defined instruction-generated - * exception handler. The handler should return one of these to indicate - * whether to re-issue the instruction that triggered the exception, or to - * skip it. - */ -enum alt_exception_result_e { - NIOS2_EXCEPTION_RETURN_REISSUE_INST = 0, - NIOS2_EXCEPTION_RETURN_SKIP_INST = 1 -}; -typedef enum alt_exception_result_e alt_exception_result; - -/* - * alt_instruction_exception_register() can be used to register an exception - * handler for instruction-generated exceptions that are not handled by the - * built-in exception handler (i.e. for interrupts). - * - * The registry API is optionally enabled through the "Enable - * Instruction-related Exception API" HAL BSP setting, which will - * define the macro below. - */ -#ifdef ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API -void alt_instruction_exception_register ( - alt_exception_result (*exception_handler)( - alt_exception_cause cause, - alt_u32 exception_pc, - alt_u32 bad_addr) ); -#endif /*ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API */ - -/* - * alt_exception_cause_generated_bad_addr() indicates whether a particular - * exception cause value was from an exception-type that generated a valid - * address in the BADADDR register. The contents of BADADDR is passed to - * a user-registered exception handler in all cases, whether valid or not. - * This routine should be called to validate the bad_addr argument to - * your exception handler. - */ -int alt_exception_cause_generated_bad_addr(alt_exception_cause cause); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_EXCEPTIONS_H__ */ diff --git a/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_flash.h b/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_flash.h deleted file mode 100644 index 527328d..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_flash.h +++ /dev/null @@ -1,166 +0,0 @@ -#ifndef __ALT_FLASH_H__ -#define __ALT_FLASH_H__ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/****************************************************************************** -* * -* Alt_flash.h - User interface for flash code * -* * -* Use this interface to avoid being exposed to the internals of the device * -* driver architecture. If you chose to use the flash driver internal * -* structures we don't guarantee not to change them * -* * -* Author PRR * -* * -******************************************************************************/ - - - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#include "alt_types.h" -#include "alt_flash_types.h" -#include "alt_flash_dev.h" -#include "sys/alt_cache.h" - -alt_flash_fd* alt_flash_open_dev(const char* name); -void alt_flash_close_dev(alt_flash_fd* fd ); - -/* - * alt_write_flash - * - * Program a buffer into flash. - * - * This routine erases all the affected erase blocks (if necessary) - * and then programs the data. However it does not read the data out first - * and preserve and none overwritten data, because this would require very - * large buffers on the target. If you need - * that functionality use the functions below. - */ -static __inline__ int __attribute__ ((always_inline)) alt_write_flash( - alt_flash_fd* fd, - int offset, - const void* src_addr, - int length ) -{ - return fd->write( fd, offset, src_addr, length ); -} - -/* - * alt_read_flash - * - * Read a block of flash for most flashes this is just memcpy - * it's here for completeness in case we need it for some serial flash device - * - */ -static __inline__ int __attribute__ ((always_inline)) alt_read_flash( - alt_flash_fd* fd, int offset, - void* dest_addr, int length ) -{ - return fd->read( fd, offset, dest_addr, length ); -} - -/* - * alt_get_flash_info - * - * Return the information on the flash sectors. - * - */ -static __inline__ int __attribute__ ((always_inline)) alt_get_flash_info( - alt_flash_fd* fd, flash_region** info, - int* number_of_regions) -{ - return fd->get_info( fd, info, number_of_regions); -} - -/* - * alt_erase_flash_block - * - * Erase a particular erase block, pass in the offset to the start of - * the block and it's size - */ -static __inline__ int __attribute__ ((always_inline)) alt_erase_flash_block( - alt_flash_fd* fd, int offset, int length) -{ - int ret_code; - ret_code = fd->erase_block( fd, offset ); - - if(!ret_code) - alt_dcache_flush((alt_u8*)fd->base_addr + offset, length); - - return ret_code; -} - -/* - * alt_write_flash_block - * - * Write a particular flash block, block_offset is the offset - * (from the base of flash) to start of the block - * data_offset is the offset (from the base of flash) - * where you wish to start programming - * - * NB this function DOES NOT check that you are only writing a single - * block of data as that would slow down this function. - * - * Use alt_write_flash if you want that level of error checking. - */ - -static __inline__ int __attribute__ ((always_inline)) alt_write_flash_block( - alt_flash_fd* fd, int block_offset, - int data_offset, - const void *data, int length) -{ - - int ret_code; - ret_code = fd->write_block( fd, block_offset, data_offset, data, length ); - - if(!ret_code) - alt_dcache_flush((alt_u8*)fd->base_addr + data_offset, length); - - return ret_code; -} - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_FLASH_H__ */ diff --git a/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_flash_dev.h b/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_flash_dev.h deleted file mode 100644 index 8bab601..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_flash_dev.h +++ /dev/null @@ -1,98 +0,0 @@ -#ifndef __ALT_FLASH_DEV_H__ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/****************************************************************************** -* * -* Alt_flash_dev.h - Generic Flash device interfaces * -* * -* Author PRR * -* * -******************************************************************************/ -#define __ALT_FLASH_DEV_H__ - -#include "alt_flash_types.h" -#include "sys/alt_llist.h" -#include "priv/alt_dev_llist.h" - -#include "alt_types.h" - -typedef struct alt_flash_dev alt_flash_dev; -typedef alt_flash_dev alt_flash_fd; - -static ALT_INLINE int alt_flash_device_register( alt_flash_fd* fd) -{ - extern alt_llist alt_flash_dev_list; - - return alt_dev_llist_insert ((alt_dev_llist*) fd, &alt_flash_dev_list); -} - -typedef alt_flash_dev* (*alt_flash_open)(alt_flash_dev* flash, - const char* name ); -typedef int (*alt_flash_close)(alt_flash_dev* flash_info); - -typedef int (*alt_flash_write)( alt_flash_dev* flash, int offset, - const void* src_addr, int length ); - -typedef int (*alt_flash_get_flash_info)( alt_flash_dev* flash, flash_region** info, - int* number_of_regions); -typedef int (*alt_flash_write_block)( alt_flash_dev* flash, int block_offset, - int data_offset, const void* data, - int length); -typedef int (*alt_flash_erase_block)( alt_flash_dev* flash, int offset); -typedef int (*alt_flash_read)(alt_flash_dev* flash, int offset, - void* dest_addr, int length ); - -struct alt_flash_dev -{ - alt_llist llist; - const char* name; - alt_flash_open open; - alt_flash_close close; - alt_flash_write write; - alt_flash_read read; - alt_flash_get_flash_info get_info; - alt_flash_erase_block erase_block; - alt_flash_write_block write_block; - void* base_addr; - int length; - int number_of_regions; - flash_region region_info[ALT_MAX_NUMBER_OF_FLASH_REGIONS]; -}; - -#endif /* __ALT_FLASH_DEV_H__ */ diff --git a/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_flash_types.h b/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_flash_types.h deleted file mode 100644 index 884cbf8..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_flash_types.h +++ /dev/null @@ -1,64 +0,0 @@ -#ifndef __ALT_FLASH_TYPES_H__ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/****************************************************************************** -* * -* Alt_flash_types.h - Some generic types and defines used by the flash code * -* * -* Author PRR * -* * -******************************************************************************/ -#define __ALT_FLASH_TYPES_H__ - -#ifndef ALT_MAX_NUMBER_OF_FLASH_REGIONS -#define ALT_MAX_NUMBER_OF_FLASH_REGIONS 8 -#endif /* ALT_MAX_NUMBER_OF_FLASH_REGIONS */ - -/* - * Description of a single Erase region - */ -typedef struct flash_region -{ - int offset; - int region_size; - int number_of_blocks; - int block_size; -}flash_region; - -#endif /* __ALT_FLASH_TYPES_H__ */ diff --git a/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_irq.h b/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_irq.h deleted file mode 100644 index 6666e52..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_irq.h +++ /dev/null @@ -1,245 +0,0 @@ -#ifndef __ALT_IRQ_H__ -#define __ALT_IRQ_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * alt_irq.h is the Nios II specific implementation of the interrupt controller - * interface. - * - * Nios II includes optional support for an external interrupt controller. - * When an external controller is present, the "Enhanced" interrupt API - * must be used to manage individual interrupts. The enhanced API also - * supports the processor's internal interrupt controller. Certain API - * members are accessible from either the "legacy" or "enhanced" interrpt - * API. - * - * Regardless of which API is in use, this file should be included by - * application code and device drivers that register ISRs or manage interrpts. - */ -#include - -#include "nios2.h" -#include "alt_types.h" -#include "system.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * Macros used by alt_irq_enabled - */ -#define ALT_IRQ_ENABLED 1 -#define ALT_IRQ_DISABLED 0 - -/* - * Number of available interrupts in internal interrupt controller. - */ -#define ALT_NIRQ NIOS2_NIRQ - -/* - * Used by alt_irq_disable_all() and alt_irq_enable_all(). - */ -typedef int alt_irq_context; - -/* ISR Prototype */ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT -typedef void (*alt_isr_func)(void* isr_context); -#else -typedef void (*alt_isr_func)(void* isr_context, alt_u32 id); -#endif - -/* - * The following protypes and routines are supported by both - * the enhanced and legacy interrupt APIs - */ - -/* - * alt_irq_enabled can be called to determine if the processor's global - * interrupt enable is asserted. The return value is zero if interrupts - * are disabled, and non-zero otherwise. - * - * Whether the internal or external interrupt controller is present, - * individual interrupts may still be disabled. Use the other API to query - * a specific interrupt. - */ -static ALT_INLINE int ALT_ALWAYS_INLINE alt_irq_enabled (void) -{ - int status; - - NIOS2_READ_STATUS (status); - - return status & NIOS2_STATUS_PIE_MSK; -} - -/* - * alt_irq_disable_all() - * - * This routine inhibits all interrupts by negating the status register PIE - * bit. It returns the previous contents of the CPU status register (IRQ - * context) which can be used to restore the status register PIE bit to its - * state before this routine was called. - */ -static ALT_INLINE alt_irq_context ALT_ALWAYS_INLINE - alt_irq_disable_all (void) -{ - alt_irq_context context; - - NIOS2_READ_STATUS (context); - - NIOS2_WRITE_STATUS (context & ~NIOS2_STATUS_PIE_MSK); - - return context; -} - -/* - * alt_irq_enable_all() - * - * Enable all interrupts that were previously disabled by alt_irq_disable_all() - * - * This routine accepts a context to restore the CPU status register PIE bit - * to the state prior to a call to alt_irq_disable_all(). - - * In the case of nested calls to alt_irq_disable_all()/alt_irq_enable_all(), - * this means that alt_irq_enable_all() does not necessarily re-enable - * interrupts. - * - * This routine will perform a read-modify-write sequence to restore only - * status.PIE if the processor is configured with options that add additional - * writeable status register bits. These include the MMU, MPU, the enhanced - * interrupt controller port, and shadow registers. Otherwise, as a performance - * enhancement, status is overwritten with the prior context. - */ -static ALT_INLINE void ALT_ALWAYS_INLINE - alt_irq_enable_all (alt_irq_context context) -{ -#if (NIOS2_NUM_OF_SHADOW_REG_SETS > 0) || (defined NIOS2_EIC_PRESENT) || \ - (defined NIOS2_MMU_PRESENT) || (defined NIOS2_MPU_PRESENT) - alt_irq_context status; - - NIOS2_READ_STATUS (status); - - status &= ~NIOS2_STATUS_PIE_MSK; - status |= (context & NIOS2_STATUS_PIE_MSK); - - NIOS2_WRITE_STATUS (status); -#else - NIOS2_WRITE_STATUS (context); -#endif -} - -/* - * The function alt_irq_init() is defined within the auto-generated file - * alt_sys_init.c. This function calls the initilization macros for all - * interrupt controllers in the system at config time, before any other - * non-interrupt controller driver is initialized. - * - * The "base" parameter is ignored and only present for backwards-compatibility. - * It is recommended that NULL is passed in for the "base" parameter. - */ -extern void alt_irq_init (const void* base); - -/* - * alt_irq_cpu_enable_interrupts() enables the CPU to start taking interrupts. - */ -static ALT_INLINE void ALT_ALWAYS_INLINE - alt_irq_cpu_enable_interrupts () -{ - NIOS2_WRITE_STATUS(NIOS2_STATUS_PIE_MSK -#if defined(NIOS2_EIC_PRESENT) && (NIOS2_NUM_OF_SHADOW_REG_SETS > 0) - | NIOS2_STATUS_RSIE_MSK -#endif - ); -} - - -/* - * Prototypes for the enhanced interrupt API. - */ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT -/* - * alt_ic_isr_register() can be used to register an interrupt handler. If the - * function is succesful, then the requested interrupt will be enabled upon - * return. - */ -extern int alt_ic_isr_register(alt_u32 ic_id, - alt_u32 irq, - alt_isr_func isr, - void *isr_context, - void *flags); - -/* - * alt_ic_irq_enable() and alt_ic_irq_disable() enable/disable a specific - * interrupt by using IRQ port and interrupt controller instance. - */ -int alt_ic_irq_enable (alt_u32 ic_id, alt_u32 irq); -int alt_ic_irq_disable(alt_u32 ic_id, alt_u32 irq); - - /* - * alt_ic_irq_enabled() indicates whether a specific interrupt, as - * specified by IRQ port and interrupt controller instance is enabled. - */ -alt_u32 alt_ic_irq_enabled(alt_u32 ic_id, alt_u32 irq); - -#else -/* - * Prototypes for the legacy interrupt API. - */ -#include "priv/alt_legacy_irq.h" -#endif - - -/* - * alt_irq_pending() returns a bit list of the current pending interrupts. - * This is used by alt_irq_handler() to determine which registered interrupt - * handlers should be called. - * - * This routine is only available for the Nios II internal interrupt - * controller. - */ -#ifndef NIOS2_EIC_PRESENT -static ALT_INLINE alt_u32 ALT_ALWAYS_INLINE alt_irq_pending (void) -{ - alt_u32 active; - - NIOS2_READ_IPENDING (active); - - return active; -} -#endif - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_IRQ_H__ */ diff --git a/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_irq_entry.h b/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_irq_entry.h deleted file mode 100644 index e2008d9..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_irq_entry.h +++ /dev/null @@ -1,39 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * This file pulls in the IRQ entry assembler and C code, which is only - * required if there are any interruptes in the system. - */ - -__asm__( "\n\t.globl alt_irq_entry" ); - -__asm__( "\n\t.globl alt_irq_handler" ); - diff --git a/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_license_reminder_ucosii.h b/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_license_reminder_ucosii.h deleted file mode 100644 index 2fe649c..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_license_reminder_ucosii.h +++ /dev/null @@ -1,77 +0,0 @@ -#ifndef __ALT_LICENSE_REMINDER_UCOSII_H__ -#define __ALT_LICENSE_REMINDER_UCOSII_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include - -#define ALT_LICENSE_REMINDER_UCOSII_STRING \ - "============== Software License Reminder ===============\n" \ - "\n" \ - "uC/OS-II is provided in source form for FREE evaluation,\n" \ - "for educational use, or for peaceful research. If you\n" \ - "plan on using uC/OS-II in a commercial product you need\n" \ - "to contact Micrium to properly license its use in your\n" \ - "product. Micrium provides ALL the source code on the\n" \ - "Altera distribution for your convenience and to help you\n" \ - "experience uC/OS-II. The fact that the source is provided\n" \ - "does NOT mean that you can use it without paying a\n" \ - "licensing fee. Please help us continue to provide the\n" \ - "Embedded community with the finest software available.\n" \ - "Your honesty is greatly appreciated.\n" \ - "\n" \ - "Please contact:\n" \ - "\n" \ - "M I C R I U M\n" \ - "949 Crestview Circle\n" \ - "Weston, FL 33327-1848\n" \ - "U.S.A.\n" \ - "\n" \ - "Phone : +1 954 217 2036\n" \ - "FAX : +1 954 217 2037\n" \ - "WEB : www.micrium.com\n" \ - "E-mail: Sales@Micrium.com\n" \ - "\n" \ - "========================================================\n" - -#define alt_license_reminder_ucosii() puts(ALT_LICENSE_REMINDER_UCOSII_STRING) - - -#endif /* __ALT_LICENSE_REMINDER_UCOSII_H__ */ - diff --git a/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_llist.h b/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_llist.h deleted file mode 100644 index 46f81ce..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_llist.h +++ /dev/null @@ -1,123 +0,0 @@ -#ifndef __ALT_LIST_H__ -#define __ALT_LIST_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "alt_types.h" - -/* - * alt_llist.h defines structures and functions for use in manipulating linked - * lists. A list is considered to be constructed from a chain of objects of - * type alt_llist, with one object being defined to be the head element. - * - * A list is considered to be empty if it only contains the head element. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * alt_llist is the structure used to represent an element within a linked - * list. - */ - -typedef struct alt_llist_s alt_llist; - -struct alt_llist_s { - alt_llist* next; /* Pointer to the next element in the list. */ - alt_llist* previous; /* Pointer to the previous element in the list. */ -}; - -/* - * ALT_LLIST_HEAD is a macro that can be used to create the head of a new - * linked list. This is named "head". The head element is initialised to - * represent an empty list. - */ - -#define ALT_LLIST_HEAD(head) alt_llist head = {&head, &head} - -/* - * ALT_LLIST_ENTRY is a macro used to define an uninitialised linked list - * entry. This is used to reserve space in structure initialisation for - * structures that inherit form alt_llist. - */ - -#define ALT_LLIST_ENTRY {0, 0} - -/* - * alt_llist_insert() insert adds the linked list entry "entry" as the - * first entry in the linked list "list". "list" is the list head element. - */ - -static ALT_INLINE void ALT_ALWAYS_INLINE alt_llist_insert(alt_llist* list, - alt_llist* entry) -{ - entry->previous = list; - entry->next = list->next; - - list->next->previous = entry; - list->next = entry; -} - -/* - * alt_llist_remove() is called to remove an element from a linked list. The - * input argument is the element to remove. - */ - -static ALT_INLINE void ALT_ALWAYS_INLINE alt_llist_remove(alt_llist* entry) -{ - entry->next->previous = entry->previous; - entry->previous->next = entry->next; - - /* - * Set the entry to point to itself, so that any further calls to - * alt_llist_remove() are harmless. - */ - - entry->previous = entry; - entry->next = entry; -} - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_LLIST_H__ */ diff --git a/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_load.h b/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_load.h deleted file mode 100644 index 432e9f2..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_load.h +++ /dev/null @@ -1,78 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "alt_types.h" - -/* - * This macro is used to load code/data from its load address to its - * execution address for a given section. The section name is the input - * argument. Note that a leading '.' is assumed in the name. For example - * to load the section .onchip_ram, use: - * - * ALT_LOAD_SECTION_BY_NAME(onchip_ram); - * - * This requires that the apropriate linker symbols have been generated - * for the section in question. This will be the case if you are using the - * default linker script. - */ - -#define ALT_LOAD_SECTION_BY_NAME(name) \ - { \ - extern void _alt_partition_##name##_start; \ - extern void _alt_partition_##name##_end; \ - extern void _alt_partition_##name##_load_addr; \ - \ - alt_load_section(&_alt_partition_##name##_load_addr, \ - &_alt_partition_##name##_start, \ - &_alt_partition_##name##_end); \ - } - -/* - * Function used to load an individual section from flash to RAM. - * - * There is an implicit assumption here that the linker script will ensure - * that all sections are word aligned. - * - */ - -static void ALT_INLINE alt_load_section (alt_u32* from, - alt_u32* to, - alt_u32* end) -{ - if (to != from) - { - while( to != end ) - { - *to++ = *from++; - } - } -} diff --git a/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_log_printf.h b/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_log_printf.h deleted file mode 100644 index c15ca05..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_log_printf.h +++ /dev/null @@ -1,349 +0,0 @@ -/* alt_log_printf.h - * - * ALT_LOG is designed to provide extra logging/debugging messages from HAL - * through a different port than stdout. It is enabled by the ALT_LOG_ENABLE - * define, which needs to supplied at compile time. When logging is turned off, - * code size is unaffected. Thus, this should be transparent to the user - * when it is not actively turned on, and should not affect projects in any way. - * - * There are macros sprinkled within different components, such as the jtag uart - * and timer, in the HAL code. They are always named ALT_LOG_, and can be - * safely ignored if ALT_LOG is turned off. - * - * To turn on ALT_LOG, ALT_LOG_ENABLE must be defined, and ALT_LOG_PORT_TYPE and - * ALT_LOG_PORT_BASE must be set in system.h. This is done through editing - * .ptf, by editing the alt_log_port_type & alt_log_port_base settings. - * See the documentation html file for examples. - * - * When it is turned on, it will output extra HAL messages to a port specified - * in system.h. This can be a UART or JTAG UART port. By default it will - * output boot messages, detailing every step of the boot process. - * - * Extra logging is designed to be enabled by flags, which are defined in - * alt_log_printf.c. The default value is that all flags are off, so only the - * boot up logging messages show up. ALT_LOG_FLAGS can be set to enable certain - * groupings of flags, and that grouping is done in this file. Each flag can - * also be overridden with a -D at compile time. - * - * This header file includes the necessary prototypes for using the alt_log - * functions. It also contains all the macros that are used to remove the code - * from alt log is turned off. Also, the macros in other HAL files are defined - * here at the bottom. These macros all call some C function that is in - * alt_log_printf.c. - * - * The logging has functions for printing in C (ALT_LOG_PRINTF) and in assembly - * (ALT_LOG_PUTS). This was needed because the assembly printing occurs before - * the device is initialized. The assembly function corrupts register R4-R7, - * which are not used in the normal boot process. For this reason, do not call - * the assembly function in C. - * - * author: gkwan - */ - - -#ifndef __ALT_LOG_PRINTF_H__ -#define __ALT_LOG_PRINTF_H__ - -#include - -/* Global switch to turn on logging functions */ -#ifdef ALT_LOG_ENABLE - - /* ALT_LOG_PORT_TYPE values as defined in system.h. They are defined as - * numbers here first becasue the C preprocessor does not handle string - * comparisons. */ - #define ALTERA_AVALON_JTAG_UART 1 - #define ALTERA_AVALON_UART 0 - - /* If this .h file is included by an assembly file, skip over include files - * that won't compile in assembly. */ - #ifndef ALT_ASM_SRC - #include - #include "sys/alt_alarm.h" - #include "sys/alt_dev.h" - #ifdef __ALTERA_AVALON_JTAG_UART - #include "altera_avalon_jtag_uart.h" - #endif - #endif /* ALT_ASM_SRC */ - - /* These are included for the port register offsets and masks, needed - * to write to the port. Only include if the port type is set correctly, - * otherwise error. If alt_log is turned on and the port to output to is - * incorrect or does not exist, then should exit. */ - #if ALT_LOG_PORT_TYPE == ALTERA_AVALON_JTAG_UART - #ifdef __ALTERA_AVALON_JTAG_UART - #include - #else - #error ALT_LOG: JTAG_UART port chosen, but no JTAG_UART in system. - #endif - #elif ALT_LOG_PORT_TYPE == ALTERA_AVALON_UART - #ifdef __ALTERA_AVALON_UART - #include - #else - #error ALT_LOG: UART Port chosen, but no UART in system. - #endif - #else - #error ALT_LOG: alt_log_port_type declaration invalid! - #endif - - /* ALT_LOG_ENABLE turns on the basic printing function */ - #define ALT_LOG_PRINTF(...) do {alt_log_printf_proc(__VA_ARGS__);} while (0) - - /* Assembly macro for printing in assembly, calls tx_log_str - * which is in alt_log_macro.S. - * If alt_log_boot_on_flag is 0, skips the printing */ - #define ALT_LOG_PUTS(str) movhi r4, %hiadj(alt_log_boot_on_flag) ; \ - addi r4, r4, %lo(alt_log_boot_on_flag) ; \ - ldwio r5, 0(r4) ; \ - beq r0, r5, 0f ; \ - movhi r4, %hiadj(str) ; \ - addi r4, r4, %lo(str) ; \ - call tx_log_str ; \ - 0: - - /* These defines are here to faciliate the use of one output function - * (alt_log_txchar) to print to both the JTAG UART or the UART. Depending - * on the port type, the status register, read mask, and output register - * are set to the appropriate value for the port. */ - #if ALT_LOG_PORT_TYPE == ALTERA_AVALON_JTAG_UART - #define ALT_LOG_PRINT_REG_RD IORD_ALTERA_AVALON_JTAG_UART_CONTROL - #define ALT_LOG_PRINT_MSK ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_MSK - #define ALT_LOG_PRINT_TXDATA_WR IOWR_ALTERA_AVALON_JTAG_UART_DATA - #define ALT_LOG_PRINT_REG_OFFSET (ALTERA_AVALON_JTAG_UART_CONTROL_REG*0x4) - #define ALT_LOG_PRINT_TXDATA_REG_OFFSET (ALTERA_AVALON_JTAG_UART_DATA_REG*0x4) - #elif ALT_LOG_PORT_TYPE == ALTERA_AVALON_UART - #define ALT_LOG_PRINT_REG_RD IORD_ALTERA_AVALON_UART_STATUS - #define ALT_LOG_PRINT_MSK ALTERA_AVALON_UART_STATUS_TRDY_MSK - #define ALT_LOG_PRINT_TXDATA_WR IOWR_ALTERA_AVALON_UART_TXDATA - #define ALT_LOG_PRINT_REG_OFFSET (ALTERA_AVALON_UART_STATUS_REG*0x4) - #define ALT_LOG_PRINT_TXDATA_REG_OFFSET (ALTERA_AVALON_UART_TXDATA_REG*0x4) - #endif /* ALT_LOG_PORT */ - - /* Grouping of flags via ALT_LOG_FLAGS. Each specific flag can be set via - * -D at compile time, or else they'll be set to a default value according - * to ALT_LOG_FLAGS. ALT_LOG_FLAGS = 0 or not set is the default, where - * only the boot messages will be printed. As ALT_LOG_FLAGS increase, they - * increase in intrusiveness to the program, and will affect performance. - * - * Flag Level 1 - turns on system clock and JTAG UART startup status - * 2 - turns on write echo and JTAG_UART alarm (periodic report) - * 3 - turns on JTAG UART ISR logging - will slow performance - * significantly. - * -1 - All logging output is off, but if ALT_LOG_ENABLE is - * defined all logging function is built and code size - * remains constant - * - * Flag settings - 1 = on, 0 = off. */ - - /* This flag turns on "boot" messages for printing. This includes messages - * during crt0.S, then alt_main, and finally alt_exit. */ - #ifndef ALT_LOG_BOOT_ON_FLAG_SETTING - #if ALT_LOG_FLAGS == 1 - #define ALT_LOG_BOOT_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 2 - #define ALT_LOG_BOOT_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 3 - #define ALT_LOG_BOOT_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == -1 /* silent mode */ - #define ALT_LOG_BOOT_ON_FLAG_SETTING 0x0 - #else /* default setting */ - #define ALT_LOG_BOOT_ON_FLAG_SETTING 0x1 - #endif - #endif /* ALT_LOG_BOOT_ON_FLAG_SETTING */ - - #ifndef ALT_LOG_SYS_CLK_ON_FLAG_SETTING - #if ALT_LOG_FLAGS == 1 - #define ALT_LOG_SYS_CLK_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 2 - #define ALT_LOG_SYS_CLK_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 3 - #define ALT_LOG_SYS_CLK_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == -1 /* silent mode */ - #define ALT_LOG_SYS_CLK_ON_FLAG_SETTING 0x0 - #else /* default setting */ - #define ALT_LOG_SYS_CLK_ON_FLAG_SETTING 0x0 - #endif - #endif /* ALT_LOG_SYS_CLK_ON_FLAG_SETTING */ - - #ifndef ALT_LOG_WRITE_ON_FLAG_SETTING - #if ALT_LOG_FLAGS == 1 - #define ALT_LOG_WRITE_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 2 - #define ALT_LOG_WRITE_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 3 - #define ALT_LOG_WRITE_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == -1 /* silent mode */ - #define ALT_LOG_WRITE_ON_FLAG_SETTING 0x0 - #else /* default setting */ - #define ALT_LOG_WRITE_ON_FLAG_SETTING 0x0 - #endif - #endif /* ALT_LOG_WRITE_ON_FLAG_SETTING */ - - #ifndef ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING - #ifndef __ALTERA_AVALON_JTAG_UART - #define ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 1 - #define ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 2 - #define ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 3 - #define ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == -1 /* silent mode */ - #define ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING 0x0 - #else /* default setting */ - #define ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING 0x0 - #endif - #endif /* ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING */ - - #ifndef ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING - #ifndef __ALTERA_AVALON_JTAG_UART - #define ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 1 - #define ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 2 - #define ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 3 - #define ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == -1 /* silent mode */ - #define ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING 0x0 - #else /* default setting */ - #define ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING 0x0 - #endif - #endif /* ALT_LOG_JTAG_UART_STARTUP_INFO_FLAG_SETTING */ - - #ifndef ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING - #ifndef __ALTERA_AVALON_JTAG_UART - #define ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 1 - #define ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 2 - #define ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 3 - #define ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == -1 /* silent mode */ - #define ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING 0x0 - #else /* default setting */ - #define ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING 0x0 - #endif - #endif /* ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING */ - -#ifndef ALT_ASM_SRC - /* Function Prototypes */ - void alt_log_txchar(int c,char *uartBase); - void alt_log_private_printf(const char *fmt,int base,va_list args); - void alt_log_repchar(char c,int r,int base); - int alt_log_printf_proc(const char *fmt, ... ); - void alt_log_system_clock(); - #ifdef __ALTERA_AVALON_JTAG_UART - alt_u32 altera_avalon_jtag_uart_report_log(void * context); - void alt_log_jtag_uart_startup_info(altera_avalon_jtag_uart_state* dev, int base); - void alt_log_jtag_uart_print_control_reg(altera_avalon_jtag_uart_state* dev, \ - int base, const char* header); - void alt_log_jtag_uart_isr_proc(int base, altera_avalon_jtag_uart_state* dev); - #endif - void alt_log_write(const void *ptr, size_t len); - - /* extern all global variables */ - extern volatile alt_u32 alt_log_boot_on_flag; - extern volatile alt_u8 alt_log_write_on_flag; - extern volatile alt_u8 alt_log_sys_clk_on_flag; - extern volatile alt_u8 alt_log_jtag_uart_alarm_on_flag; - extern volatile alt_u8 alt_log_jtag_uart_isr_on_flag; - extern volatile alt_u8 alt_log_jtag_uart_startup_info_on_flag; - extern volatile int alt_log_sys_clk_count; - extern volatile int alt_system_clock_in_sec; - extern alt_alarm alt_log_jtag_uart_alarm_1; -#endif /* ALT_ASM_SRC */ - - - /* Below are the MACRO defines used in various HAL files. They check - * if their specific flag is turned on; if it is, then it executes its - * code. - * - * To keep this file reasonable, most of these macros calls functions, - * which are defined in alt_log_printf.c. Look there for implementation - * details. */ - - /* Boot Messages Logging */ - #define ALT_LOG_PRINT_BOOT(...) \ - do { if (alt_log_boot_on_flag==1) {ALT_LOG_PRINTF(__VA_ARGS__);} \ - } while (0) - - /* JTAG UART Logging */ - /* number of ticks before alarm runs logging function */ - #ifndef ALT_LOG_JTAG_UART_TICKS_DIVISOR - #define ALT_LOG_JTAG_UART_TICKS_DIVISOR 10 - #endif - #ifndef ALT_LOG_JTAG_UART_TICKS - #define ALT_LOG_JTAG_UART_TICKS \ - (alt_ticks_per_second()/ALT_LOG_JTAG_UART_TICKS_DIVISOR) - #endif - - /* if there's a JTAG UART defined, then enable these macros */ - #ifdef __ALTERA_AVALON_JTAG_UART - - /* Macro in altera_avalon_jtag_uart.c, to register the alarm function. - * Also, the startup register info is also printed here, as this is - * called within the device driver initialization. */ - #define ALT_LOG_JTAG_UART_ALARM_REGISTER(dev, base) \ - do { if (alt_log_jtag_uart_alarm_on_flag==1) { \ - alt_alarm_start(&alt_log_jtag_uart_alarm_1, \ - ALT_LOG_JTAG_UART_TICKS, &altera_avalon_jtag_uart_report_log,\ - dev);} \ - if (alt_log_jtag_uart_startup_info_on_flag==1) {\ - alt_log_jtag_uart_startup_info(dev, base);} \ - } while (0) - - /* JTAG UART IRQ Logging (when buffer is empty) - * Inserted in the ISR in altera_avalon_jtag_uart.c */ - #define ALT_LOG_JTAG_UART_ISR_FUNCTION(base, dev) \ - do { alt_log_jtag_uart_isr_proc(base, dev); } while (0) - /* else, define macros to nothing. Or else the jtag_uart specific types - * will throw compiler errors */ - #else - #define ALT_LOG_JTAG_UART_ALARM_REGISTER(dev, base) - #define ALT_LOG_JTAG_UART_ISR_FUNCTION(base, dev) - #endif - - /* System clock logging - * How often (in seconds) the system clock logging prints. - * The default value is every 1 second */ - #ifndef ALT_LOG_SYS_CLK_INTERVAL_MULTIPLIER - #define ALT_LOG_SYS_CLK_INTERVAL_MULTIPLIER 1 - #endif - #ifndef ALT_LOG_SYS_CLK_INTERVAL - #define ALT_LOG_SYS_CLK_INTERVAL \ - (alt_ticks_per_second()*ALT_LOG_SYS_CLK_INTERVAL_MULTIPLIER) - #endif - - /* System clock logging - prints a message every interval (set above) - * to show that the system clock is alive. - * This macro is used in altera_avalon_timer_sc.c */ - #define ALT_LOG_SYS_CLK_HEARTBEAT() \ - do { alt_log_system_clock(); } while (0) - - /* alt_write_logging - echos a message every time write() is called, - * displays the first ALT_LOG_WRITE_ECHO_LEN characters. - * This macro is used in alt_write.c */ - #ifndef ALT_LOG_WRITE_ECHO_LEN - #define ALT_LOG_WRITE_ECHO_LEN 15 - #endif - - #define ALT_LOG_WRITE_FUNCTION(ptr,len) \ - do { alt_log_write(ptr,len); } while (0) - -#else /* ALT_LOG_ENABLE not defined */ - - /* logging is off, set all relevant macros to null */ - #define ALT_LOG_PRINT_BOOT(...) - #define ALT_LOG_PRINTF(...) - #define ALT_LOG_JTAG_UART_ISR_FUNCTION(base, dev) - #define ALT_LOG_JTAG_UART_ALARM_REGISTER(dev, base) - #define ALT_LOG_SYS_CLK_HEARTBEAT() - #define ALT_LOG_PUTS(str) - #define ALT_LOG_WRITE_FUNCTION(ptr,len) - -#endif /* ALT_LOG_ENABLE */ - -#endif /* __ALT_LOG_PRINTF_H__ */ - diff --git a/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_set_args.h b/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_set_args.h deleted file mode 100644 index 3750e67..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_set_args.h +++ /dev/null @@ -1,71 +0,0 @@ -#ifndef __ALT_SET_ARGS_H__ -#define __ALT_SET_ARGS_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The function alt_set_args() is provided in order to define the input - * arguments to main(). If this function is not called before main() then the - * argument list passed to main() will be empty. - * - * It is expected that this function will only be used by the ihost/iclient - * utility. - */ - -static inline void alt_set_args (int argc, char** argv, char** envp) -{ - extern int alt_argc; - extern char** alt_argv; - extern char** alt_envp; - - alt_argc = argc; - alt_argv = argv; - alt_envp = envp; -} - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_SET_ARGS_H__ */ diff --git a/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_sim.h b/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_sim.h deleted file mode 100644 index 06bd27a..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_sim.h +++ /dev/null @@ -1,91 +0,0 @@ -#ifndef __ALT_SIM_H__ -#define __ALT_SIM_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ -#include "system.h" -#include "alt_types.h" - -/* - * Instructions that might mean something special to a simulator. - * These have no special effect on real hardware (they are just nops). - */ -#define ALT_SIM_FAIL() \ - do { __asm volatile ("cmpltui r0, r0, 0xabc1"); } while (0) - -#define ALT_SIM_PASS() \ - do { __asm volatile ("cmpltui r0, r0, 0xabc2"); } while (0) - -#define ALT_SIM_IN_TOP_OF_HOT_LOOP() \ - do { __asm volatile ("cmpltui r0, r0, 0xabc3"); } while (0) - -/* - * Routine called on exit. - */ -static ALT_ALWAYS_INLINE void alt_sim_halt(int exit_code) -{ - int r2 = exit_code; - -#if defined(NIOS2_HAS_DEBUG_STUB) && (defined(ALT_BREAK_ON_EXIT) || defined(ALT_PROVIDE_GMON)) - - int r3 = (1 << 2); - -#ifdef ALT_PROVIDE_GMON - extern unsigned int alt_gmon_data[]; - int r4 = (int)alt_gmon_data; - r3 |= (1 << 4); -#define ALT_GMON_DATA ,"D04"(r4) -#else -#define ALT_GMON_DATA -#endif /* ALT_PROVIDE_GMON */ - - if (r2) { - ALT_SIM_FAIL(); - } else { - ALT_SIM_PASS(); - } - - __asm__ volatile ("\n0:\n\taddi %0,%0, -1\n\tbgt %0,zero,0b" : : "r" (ALT_CPU_FREQ/100) ); /* Delay for >30ms */ - - __asm__ volatile ("break 2" : : "D02"(r2), "D03"(r3) ALT_GMON_DATA ); - -#else /* !DEBUG_STUB */ - if (r2) { - ALT_SIM_FAIL(); - } else { - ALT_SIM_PASS(); - } -#endif /* DEBUG_STUB */ -} - -#define ALT_SIM_HALT(exit_code) \ - alt_sim_halt(exit_code) - -#endif /* __ALT_SIM_H__ */ diff --git a/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_stack.h b/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_stack.h deleted file mode 100644 index e30652a..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_stack.h +++ /dev/null @@ -1,126 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#ifndef __ALT_STACK_H__ -#define __ALT_STACK_H__ - -/* - * alt_stack.h is the nios2 specific implementation of functions used by the - * stack overflow code. - */ - -#include "nios2.h" - -#include "alt_types.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - - -extern char * alt_stack_limit_value; - -#ifdef ALT_EXCEPTION_STACK -extern char __alt_exception_stack_pointer[]; /* set by the linker */ -#endif /* ALT_EXCEPTION_STACK */ - - -/* - * alt_stack_limit can be called to determine the current value of the stack - * limit register. - */ - -static ALT_INLINE char * ALT_ALWAYS_INLINE alt_stack_limit (void) -{ - char * limit; - NIOS2_READ_ET(limit); - - return limit; -} - -/* - * alt_stack_pointer can be called to determine the current value of the stack - * pointer register. - */ - -static ALT_INLINE char * ALT_ALWAYS_INLINE alt_stack_pointer (void) -{ - char * pointer; - NIOS2_READ_SP(pointer); - - return pointer; -} - - -#ifdef ALT_EXCEPTION_STACK - -/* - * alt_exception_stack_pointer returns the normal stack pointer from - * where it is stored on the exception stack (uppermost 4 bytes). This - * is really only useful during exception processing, and is only - * available if a separate exception stack has been configured. - */ - -static ALT_INLINE char * ALT_ALWAYS_INLINE alt_exception_stack_pointer (void) -{ - return (char *) *(alt_u32 *)(__alt_exception_stack_pointer - sizeof(alt_u32)); -} - -#endif /* ALT_EXCEPTION_STACK */ - - -/* - * alt_set_stack_limit can be called to update the current value of the stack - * limit register. - */ - -static ALT_INLINE void ALT_ALWAYS_INLINE alt_set_stack_limit (char * limit) -{ - alt_stack_limit_value = limit; - NIOS2_WRITE_ET(limit); -} - -/* - * alt_report_stack_overflow reports that a stack overflow happened. - */ - -static ALT_INLINE void ALT_ALWAYS_INLINE alt_report_stack_overflow (void) -{ - NIOS2_REPORT_STACK_OVERFLOW(); -} - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_STACK_H__ */ - diff --git a/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_stdio.h b/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_stdio.h deleted file mode 100644 index 1730360..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_stdio.h +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef __ALT_STDIO_H__ -#define __ALT_STDIO_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * Definitions for ALT stdio routines. - */ - -#include - - -#ifdef __cplusplus -extern "C" { -#endif - -int alt_getchar(); -int alt_putchar(int c); -int alt_putstr(const char* str); -void alt_printf(const char *fmt, ...); - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_STDIO_H__ */ diff --git a/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_sys_init.h b/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_sys_init.h deleted file mode 100644 index e4abc28..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_sys_init.h +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef __ALT_SYS_INIT_H__ -#define __ALT_SYS_INIT_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The function alt_sys_init() is defined within the auto-generated file: - * alt_sys_init.c. This function calls the initilisation macros for all - * devices, file systems, and software components within the system. - * - * The list of initilisation macros to use is constructed using the PTF and - * STF files associated with the system. - */ - -extern void alt_sys_init (void); - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_SYS_INIT_H__ */ diff --git a/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_sys_wrappers.h b/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_sys_wrappers.h deleted file mode 100644 index 044833b..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_sys_wrappers.h +++ /dev/null @@ -1,100 +0,0 @@ -#ifndef __ALT_SYS_WRAPPERS_H__ -#define __ALT_SYS_WRAPPERS_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * This file provides the prototypes for the HAL 'UNIX style functions. The - * names of these functions are defined in alt_syscall.h. THese are defined to - * be the standard names when running the standalone HAL, e.g. open(), close() - * etc., but the names may be redefined as a part of an operating system port - * in order to avoid name clashes. - */ - -#include "os/alt_syscall.h" - -#include -#include -#include -#include -#include -#include - -extern int ALT_CLOSE (int __fd); -extern int ALT_EXECVE (const char *__path, - char * const __argv[], - char * const __envp[]); -extern void ALT_EXIT (int __status); -extern int ALT_FSTAT (int file, struct stat *st); -extern int ALT_FCNTL (int file, int cmd, ...); -extern pid_t ALT_FORK (void); -extern pid_t ALT_GETPID (void); - -#if defined (__GNUC__) && __GNUC__ >= 4 -extern int ALT_GETTIMEOFDAY (struct timeval *ptimeval, - void *ptimezone); -#else -extern int ALT_GETTIMEOFDAY (struct timeval *ptimeval, - struct timezone *ptimezone); -#endif - -extern int ALT_IOCTL (int file, int req, void* arg); -extern int ALT_ISATTY (int file); -extern int ALT_KILL (int pid, int sig); -extern int ALT_LINK (const char *existing, const char *new); -extern off_t ALT_LSEEK (int file, off_t ptr, int dir); -extern int ALT_OPEN (const char* file, int flags, ...); -extern int ALT_READ (int file, void *ptr, size_t len); -extern int ALT_RENAME (char *existing, char *new); -extern void* ALT_SBRK (ptrdiff_t incr); -extern int ALT_SETTIMEOFDAY (const struct timeval *t, - const struct timezone *tz); -extern int ALT_STAT (const char *file, struct stat *st); -extern clock_t ALT_TIMES (struct tms *buf); -extern int ALT_UNLINK (const char *name); - -#if defined (__GNUC__) && __GNUC__ >= 4 -int ALT_USLEEP (useconds_t us); -#else -unsigned int ALT_USLEEP (unsigned int us); -#endif - -extern int ALT_WAIT (int *status); -extern int ALT_WRITE (int file, const void *ptr, size_t len); - - -extern char** ALT_ENVIRON; - -/* - * - */ - -#endif /* __ALT_SYS_WRAPPERS_H__ */ diff --git a/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_timestamp.h b/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_timestamp.h deleted file mode 100644 index 8a18da2..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_timestamp.h +++ /dev/null @@ -1,60 +0,0 @@ -#ifndef __ALT_TIMESTAMP_H__ -#define __ALT_TIMESTAMP_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "alt_types.h" -#include "altera_avalon_timer.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -extern int alt_timestamp_start (void); - -extern alt_timestamp_type alt_timestamp (void); - -extern alt_u32 alt_timestamp_freq (void); - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_TIMESTAMP_H__ */ diff --git a/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_warning.h b/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_warning.h deleted file mode 100644 index b66e71a..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/inc/sys/alt_warning.h +++ /dev/null @@ -1,75 +0,0 @@ -#ifndef __WARNING_H__ -#define __WARNING_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * alt_warning.h provides macro definitions that can be used to generate link - * time warnings. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The symbol "__alt_invalid" is used to force a link error. There should be - * no corresponding implementation of this function. - */ - -extern void __alt_invalid (void); - -#define ALT_LINK_WARNING(symbol, msg) \ - __asm__(".ifndef __evoke_link_warning_" #symbol \ - "\n\t .section .gnu.warning." #symbol \ - "\n__evoke_link_warning_" #symbol ":\n\t .string \x22" msg "\x22 \n\t .previous" \ - "\n .endif"); - -/* A canned warning for sysdeps/stub functions. */ - -#define ALT_STUB_WARNING(name) \ - ALT_LINK_WARNING (name, \ - "warning: " #name " is not implemented and will always fail") - -#define ALT_OBSOLETE_FUNCTION_WARNING(name) \ - ALT_LINK_WARNING (name, \ - "warning: " #name " is a deprecated function") - -#define ALT_LINK_ERROR(msg) \ - ALT_LINK_WARNING (__alt_invalid, msg); \ - __alt_invalid() - -#ifdef __cplusplus -} -#endif - -#endif /* __WARNING_H__ */ diff --git a/software/qsys_tutorial_mem_bsp/HAL/inc/sys/ioctl.h b/software/qsys_tutorial_mem_bsp/HAL/inc/sys/ioctl.h deleted file mode 100644 index 4d565df..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/inc/sys/ioctl.h +++ /dev/null @@ -1,90 +0,0 @@ -#ifndef __IOCTL_H__ -#define __IOCTL_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The ioctl() system call be used to initiate a variety of control operations - * on a file descriptor. For the most part this simply translates to a call to - * the ioctl() function of the associated device driver (TIOCEXCL and - * TIOCNXCL are notable exceptions - see ioctl.c for details). - * - * The interpretation of the ioctl requests are therefore device specific. - * - * This function is equivalent to the standard Posix ioctl() call. - */ - -extern int ioctl (int fd, int req, void* arg); - -/* - * list of ioctl calls handled by the system ioctl implementation. - */ - -#define TIOCEXCL 0x740d /* exclusive use of the device */ -#define TIOCNXCL 0x740e /* allow multiple use of the device */ - -/* - * ioctl calls which can be handled by device drivers. - */ - -#define TIOCOUTQ 0x7472 /* get output queue size */ -#define TIOCMGET 0x741d /* get termios flags */ -#define TIOCMSET 0x741a /* set termios flags */ - -/* - * ioctl calls specific to JTAG UART. - */ - -#define TIOCSTIMEOUT 0x6a01 /* Set Timeout before assuming no host present */ -#define TIOCGCONNECTED 0x6a02 /* Get indication of whether host is connected */ - -/* - * - */ - -#ifdef __cplusplus -} -#endif - -#endif /* __IOCTL_H__ */ diff --git a/software/qsys_tutorial_mem_bsp/HAL/inc/sys/termios.h b/software/qsys_tutorial_mem_bsp/HAL/inc/sys/termios.h deleted file mode 100644 index cd09539..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/inc/sys/termios.h +++ /dev/null @@ -1,181 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * This is the termios.h file provided with newlib. The only modification has - * been to the baud rate macro definitions, and an increase in the size of the - * termios structure to accomodate this. - */ - - -#ifndef _SYS_TERMIOS_H -# define _SYS_TERMIOS_H - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -# define _XCGETA (('x'<<8)|1) -# define _XCSETA (('x'<<8)|2) -# define _XCSETAW (('x'<<8)|3) -# define _XCSETAF (('x'<<8)|4) -# define _TCSBRK (('T'<<8)|5) -# define _TCFLSH (('T'<<8)|7) -# define _TCXONC (('T'<<8)|6) - -# define TCOOFF 0 -# define TCOON 1 -# define TCIOFF 2 -# define TCION 3 - -# define TCIFLUSH 0 -# define TCOFLUSH 1 -# define TCIOFLUSH 2 - -# define NCCS 13 - -# define TCSAFLUSH _XCSETAF -# define TCSANOW _XCSETA -# define TCSADRAIN _XCSETAW -# define TCSADFLUSH _XCSETAF - -# define IGNBRK 000001 -# define BRKINT 000002 -# define IGNPAR 000004 -# define INPCK 000020 -# define ISTRIP 000040 -# define INLCR 000100 -# define IGNCR 000200 -# define ICRNL 000400 -# define IXON 002000 -# define IXOFF 010000 - -# define OPOST 000001 -# define OCRNL 000004 -# define ONLCR 000010 -# define ONOCR 000020 -# define TAB3 014000 - -# define CLOCAL 004000 -# define CREAD 000200 -# define CSIZE 000060 -# define CS5 0 -# define CS6 020 -# define CS7 040 -# define CS8 060 -# define CSTOPB 000100 -# define HUPCL 002000 -# define PARENB 000400 -# define PAODD 001000 - -#define CCTS_OFLOW 010000 -#define CRTS_IFLOW 020000 -#define CRTSCTS (CCTS_OFLOW | CRTS_IFLOW) - -# define ECHO 0000010 -# define ECHOE 0000020 -# define ECHOK 0000040 -# define ECHONL 0000100 -# define ICANON 0000002 -# define IEXTEN 0000400 /* anybody know *what* this does?! */ -# define ISIG 0000001 -# define NOFLSH 0000200 -# define TOSTOP 0001000 - -# define VEOF 4 /* also VMIN -- thanks, AT&T */ -# define VEOL 5 /* also VTIME -- thanks again */ -# define VERASE 2 -# define VINTR 0 -# define VKILL 3 -# define VMIN 4 /* also VEOF */ -# define VQUIT 1 -# define VSUSP 10 -# define VTIME 5 /* also VEOL */ -# define VSTART 11 -# define VSTOP 12 - -# define B0 0 -# define B50 50 -# define B75 75 -# define B110 110 -# define B134 134 -# define B150 150 -# define B200 200 -# define B300 300 -# define B600 600 -# define B1200 1200 -# define B1800 1800 -# define B2400 2400 -# define B4800 4800 -# define B9600 9600 -# define B19200 19200 -# define B38400 38400 -# define B57600 57600 -# define B115200 115200 - -typedef unsigned char cc_t; -typedef unsigned short tcflag_t; -typedef unsigned long speed_t; - -struct termios { - tcflag_t c_iflag; - tcflag_t c_oflag; - tcflag_t c_cflag; - tcflag_t c_lflag; - char c_line; - cc_t c_cc[NCCS]; - speed_t c_ispeed; - speed_t c_ospeed; -}; - -# ifndef _NO_MACROS - -# define cfgetospeed(tp) ((tp)->c_ospeed) -# define cfgetispeed(tp) ((tp)->c_ispeed) -# define cfsetospeed(tp,s) (((tp)->c_ospeed = (s)), 0) -# define cfsetispeed(tp,s) (((tp)->c_ispeed = (s)), 0) -# define tcdrain(fd) _ioctl (fd, _TCSBRK, 1) -# endif /* _NO_MACROS */ - -#ifdef __cplusplus -} -#endif - -#endif /* _SYS_TERMIOS_H */ - diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_alarm_start.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_alarm_start.c deleted file mode 100644 index 7739959..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_alarm_start.c +++ /dev/null @@ -1,112 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "sys/alt_alarm.h" -#include "sys/alt_irq.h" - -/* - * alt_alarm_start is called to register an alarm with the system. The - * "alarm" structure passed as an input argument does not need to be - * initialised by the user. This is done within this function. - * - * The remaining input arguments are: - * - * nticks - The time to elapse until the alarm executes. This is specified in - * system clock ticks. - * callback - The function to run when the indicated time has elapsed. - * context - An opaque value, passed to the callback function. -* - * Care should be taken when defining the callback function since it is - * likely to execute in interrupt context. In particular, this mean that - * library calls like printf() should not be made, since they can result in - * deadlock. - * - * The interval to be used for the next callback is the return - * value from the callback function. A return value of zero indicates that the - * alarm should be unregistered. - * - * alt_alarm_start() will fail if the timer facility has not been enabled - * (i.e. there is no system clock). Failure is indicated by a negative return - * value. - */ - -int alt_alarm_start (alt_alarm* alarm, alt_u32 nticks, - alt_u32 (*callback) (void* context), - void* context) -{ - alt_irq_context irq_context; - alt_u32 current_nticks = 0; - - if (alt_ticks_per_second ()) - { - if (alarm) - { - alarm->callback = callback; - alarm->context = context; - - irq_context = alt_irq_disable_all (); - - current_nticks = alt_nticks(); - - alarm->time = nticks + current_nticks + 1; - - /* - * If the desired alarm time causes a roll-over, set the rollover - * flag. This will prevent the subsequent tick event from causing - * an alarm too early. - */ - if(alarm->time < current_nticks) - { - alarm->rollover = 1; - } - else - { - alarm->rollover = 0; - } - - alt_llist_insert (&alt_alarm_list, &alarm->llist); - alt_irq_enable_all (irq_context); - - return 0; - } - else - { - return -EINVAL; - } - } - else - { - return -ENOTSUP; - } -} diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_busy_sleep.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_busy_sleep.c deleted file mode 100644 index 561c0be..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_busy_sleep.c +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright (c) 2003-2004 Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - * - * ------------ - * - * Altera does not recommend, suggest or require that this reference design - * file be used in conjunction or combination with any other product. - * - * alt_busy_sleep.c - Microsecond delay routine which uses a calibrated busy - * loop to perform the delay. This is used to implement - * usleep for both uC/OS-II and the standalone HAL. - * - * Author PRR - * - * Calibrated delay with no timer required - * - * The ASM instructions in the routine are equivalent to - * - * for (i=0;i -#include - -#include "system.h" -#include "alt_types.h" - -#include "priv/alt_busy_sleep.h" - -unsigned int alt_busy_sleep (unsigned int us) -{ -/* - * Only delay if ALT_SIM_OPTIMIZE is not defined; i.e., if software - * is built targetting ModelSim RTL simulation, the delay will be - * skipped to speed up simulation. - */ -#ifndef ALT_SIM_OPTIMIZE - int i; - int big_loops; - alt_u32 cycles_per_loop; - - if (!strcmp(NIOS2_CPU_IMPLEMENTATION,"tiny")) - { - cycles_per_loop = 9; - } - else - { - cycles_per_loop = 3; - } - - - big_loops = us / (INT_MAX/ - (ALT_CPU_FREQ/(cycles_per_loop * 1000000))); - - if (big_loops) - { - for(i=0;i - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -#ifdef ALT_USE_DIRECT_DRIVERS - -int ALT_CLOSE (int fildes) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(close); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -/* - * close() is called by an application to release a file descriptor. If the - * associated file system/device has a close() callback function registered - * then this called. The file descriptor is then marked as free. - * - * ALT_CLOSE is mapped onto the close() system call in alt_syscall.h - */ - -int ALT_CLOSE (int fildes) -{ - alt_fd* fd; - int rval; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (fildes < 0) ? NULL : &alt_fd_list[fildes]; - - if (fd) - { - /* - * If the associated file system/device has a close function, call it so - * that any necessary cleanup code can run. - */ - - rval = (fd->dev->close) ? fd->dev->close(fd) : 0; - - /* Free the file descriptor structure and return. */ - - alt_release_fd (fildes); - if (rval < 0) - { - ALT_ERRNO = -rval; - return -1; - } - return 0; - } - else - { - ALT_ERRNO = EBADFD; - return -1; - } -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_dcache_flush.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_dcache_flush.c deleted file mode 100644 index 7ecc91a..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_dcache_flush.c +++ /dev/null @@ -1,97 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "nios2.h" -#include "system.h" - -#include "alt_types.h" -#include "sys/alt_cache.h" - -/* - * Nios II version 1.2 and newer supports the "flush by address" instruction, in - * addition to the "flush by line" instruction provided by older versions of - * the core. This newer instruction is used by preference when it is - * available. - */ - -#ifdef NIOS2_FLUSHDA_SUPPORTED -#define ALT_FLUSH_DATA(i) __asm__ volatile ("flushda (%0)" :: "r" (i)); -#else -#define ALT_FLUSH_DATA(i) __asm__ volatile ("flushd (%0)" :: "r" (i)); -#endif /* NIOS2_FLUSHDA_SUPPORTED */ - -/* - * alt_dcache_flush() is called to flush the data cache for a memory - * region of length "len" bytes, starting at address "start". - * - * Any dirty lines in the data cache are written back to memory. - */ - -void alt_dcache_flush (void* start, alt_u32 len) -{ -#if NIOS2_DCACHE_SIZE > 0 - - char* i; - char* end; - - /* - * This is the most we would ever need to flush. - * - * SPR 196942, 2006.01.13: The cache flush loop below will use the - * 'flushda' instruction if its available; in that case each line - * must be flushed individually, and thus 'len' cannot be trimmed. - */ - #ifndef NIOS2_FLUSHDA_SUPPORTED - if (len > NIOS2_DCACHE_SIZE) - { - len = NIOS2_DCACHE_SIZE; - } - #endif - - end = ((char*) start) + len; - - for (i = start; i < end; i+= NIOS2_DCACHE_LINE_SIZE) - { - ALT_FLUSH_DATA(i); - } - - /* - * For an unaligned flush request, we've got one more line left. - * Note that this is dependent on NIOS2_DCACHE_LINE_SIZE to be a - * multiple of 2 (which it always is). - */ - - if (((alt_u32) start) & (NIOS2_DCACHE_LINE_SIZE - 1)) - { - ALT_FLUSH_DATA(i); - } - -#endif /* NIOS2_DCACHE_SIZE > 0 */ -} diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_dcache_flush_all.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_dcache_flush_all.c deleted file mode 100644 index 6529231..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_dcache_flush_all.c +++ /dev/null @@ -1,51 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "nios2.h" -#include "system.h" - -#include "alt_types.h" -#include "sys/alt_cache.h" - -/* - * alt_dcache_flush_all() is called to flush the entire data cache. - */ - -void alt_dcache_flush_all (void) -{ -#if NIOS2_DCACHE_SIZE > 0 - char* i; - - for (i = (char*) 0; i < (char*) NIOS2_DCACHE_SIZE; i+= NIOS2_DCACHE_LINE_SIZE) - { - __asm__ volatile ("flushd (%0)" :: "r" (i)); - } -#endif /* NIOS2_DCACHE_SIZE > 0 */ -} diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_dcache_flush_no_writeback.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_dcache_flush_no_writeback.c deleted file mode 100644 index c65ca7d..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_dcache_flush_no_writeback.c +++ /dev/null @@ -1,88 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "nios2.h" -#include "system.h" - -#include "alt_types.h" -#include "sys/alt_cache.h" - -/* - * The INITDA instruction was added to Nios II in the 8.0 release. - * - * The INITDA instruction has one of the following possible behaviors - * depending on the processor configuration: - * 1) Flushes a line by address but does NOT write back dirty data. - * Occurs when a data cache is present that supports INITDA. - * The macro NIOS2_INITDA_SUPPORTED is defined in system.h. - * 2) Takes an unimplemented instruction exception. - * Occurs when a data cache is present that doesn't support INITDA. - * 3) Performs no operation - * Occurs when there is no data cache present. - * The macro NIOS2_DCACHE_SIZE is 0 in system.h. - */ - -#define ALT_FLUSH_DATA_NO_WRITEBACK(i) \ - __asm__ volatile ("initda (%0)" :: "r" (i)); - -/* - * alt_dcache_flush_no_writeback() is called to flush the data cache for a - * memory region of length "len" bytes, starting at address "start". - * - * Any dirty lines in the data cache are NOT written back to memory. - * Make sure you really want this behavior. If you aren't 100% sure, - * use the alt_dcache_flush() routine instead. - */ - -void alt_dcache_flush_no_writeback (void* start, alt_u32 len) -{ -#if defined(NIOS2_INITDA_SUPPORTED) - - char* i; - char* end = ((char*) start) + len; - - for (i = start; i < end; i+= NIOS2_DCACHE_LINE_SIZE) - { - ALT_FLUSH_DATA_NO_WRITEBACK(i); - } - - /* - * For an unaligned flush request, we've got one more line left. - * Note that this is dependent on NIOS2_DCACHE_LINE_SIZE to be a - * multiple of 2 (which it always is). - */ - - if (((alt_u32) start) & (NIOS2_DCACHE_LINE_SIZE - 1)) - { - ALT_FLUSH_DATA_NO_WRITEBACK(i); - } - -#endif /* NIOS2_INITDA_SUPPORTED */ -} diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_dev.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_dev.c deleted file mode 100644 index ebc15e5..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_dev.c +++ /dev/null @@ -1,149 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include -#include -#include - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - -#include "alt_types.h" - -#include "system.h" - -/* - * This file contains the data constructs used to control access to device and - * filesytems. - */ - -/* - * "alt_fs_list" is the head of a linked list of registered filesystems. It is - * initialised as an empty list. New entries can be added using the - * alt_fs_reg() function. - */ - -ALT_LLIST_HEAD(alt_fs_list); - - -/* - * "alt_dev_list" is the head of a linked list of registered devices. It is - * configured at startup to include a single device, "alt_dev_null". This - * device is discussed below. - */ - -extern alt_dev alt_dev_null; /* forward declaration */ - -alt_llist alt_dev_list = {&alt_dev_null.llist, &alt_dev_null.llist}; - -/* - * alt_dev_null_write() is the implementation of the write() function used - * by the alt_dev_null device. It simple discards all data passed to it, and - * indicates that the data has been successfully transmitted. - */ - -static int alt_dev_null_write (alt_fd* fd, const char* ptr, int len) -{ - return len; -} - -/* - * "alt_dev_null" is used to allow output to be redirected to nowhere. It is - * the only device registered before the call to alt_sys_init(). At startup - * stin, stdout & stderr are all directed towards this device so that library - * calls like printf() will be safe but inefectual. - */ - -alt_dev alt_dev_null = { - { - &alt_dev_list, - &alt_dev_list - }, - "/dev/null", - NULL, /* open */ - NULL, /* close */ - NULL, /* write */ - alt_dev_null_write, /* write */ - NULL, /* lseek */ - NULL, /* fstat */ - NULL /* ioctl */ - }; - -/* - * "alt_fd_list_lock" is a semaphore used to control access to the file - * descriptor list. This is used to ensure that access to the list is thread - * safe. - */ - -ALT_SEM(alt_fd_list_lock) - -/* - * "alt_max_fd" is used to make access to the file descriptor list more - * efficent. It is set to be the value of the highest allocated file - * descriptor. This saves having to search the entire pool of unallocated - * file descriptors when looking for a match. - */ - -alt_32 alt_max_fd = -1; - -/* - * "alt_fd_list" is the file descriptor pool. The first three entries in the - * array are configured as standard in, standard out, and standard error. These - * are all initialised so that accesses are directed to the alt_dev_null - * device. The remaining file descriptors are initialised as unallocated. - * - * The maximum number of file descriptors within the system is specified by the - * user defined macro "ALT_MAX_FD". This is defined in "system.h", which is - * auto-genereated using the projects PTF and STF files. - */ - -alt_fd alt_fd_list[ALT_MAX_FD] = - { - { - &alt_dev_null, /* standard in */ - 0, - 0 - }, - { - &alt_dev_null, /* standard out */ - 0, - 0 - }, - { - &alt_dev_null, /* standard error */ - 0, - 0 - } - /* all other elements are set to zero */ - }; diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_dev_llist_insert.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_dev_llist_insert.c deleted file mode 100644 index fa7239d..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_dev_llist_insert.c +++ /dev/null @@ -1,59 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "priv/alt_dev_llist.h" -#include "sys/alt_errno.h" - -/* - * - */ - -int alt_dev_llist_insert (alt_dev_llist* dev, alt_llist* list) -{ - /* - * check that the device exists, and that it has a valid name. - */ - - if (!dev || !dev->name) - { - ALT_ERRNO = EINVAL; - return -EINVAL; - } - - /* - * register the device. - */ - - alt_llist_insert(list, &dev->llist); - - return 0; -} diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_dma_rxchan_open.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_dma_rxchan_open.c deleted file mode 100644 index 6ea3b78..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_dma_rxchan_open.c +++ /dev/null @@ -1,63 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_dma.h" -#include "sys/alt_errno.h" -#include "priv/alt_file.h" - -/* - * The list of registered DMA receive channels. - */ - -ALT_LLIST_HEAD(alt_dma_rxchan_list); - -/* - * alt_dma_txchan_open() is used to obtain an "alt_dma_txchan" descriptor for - * a DMA transmit device. The name is the name of the associated physical - * device (e.g. "/dev/dma_0"). - * - * The return value will be NULL on failure, and non-NULL otherwise. - */ - -alt_dma_rxchan alt_dma_rxchan_open (const char* name) -{ - alt_dma_rxchan dev; - - dev = (alt_dma_rxchan) alt_find_dev (name, &alt_dma_rxchan_list); - - if (!dev) - { - ALT_ERRNO = ENODEV; - } - - return dev; -} diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_dma_txchan_open.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_dma_txchan_open.c deleted file mode 100644 index f41fa81..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_dma_txchan_open.c +++ /dev/null @@ -1,63 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_dma.h" -#include "sys/alt_errno.h" -#include "priv/alt_file.h" - -/* - * The list of registered receive channels. - */ - -ALT_LLIST_HEAD(alt_dma_txchan_list); - -/* - * alt_dma_txchan_open() is used to obtain an "alt_dma_txchan" descriptor for - * a DMA transmit device. The name is the name of the associated physical - * device (e.g. "/dev/dma_0"). - * - * The return value will be NULL on failure, and non-NULL otherwise. - */ - -alt_dma_txchan alt_dma_txchan_open (const char* name) -{ - alt_dma_txchan dev; - - dev = (alt_dma_txchan) alt_find_dev (name, &alt_dma_txchan_list); - - if (!dev) - { - ALT_ERRNO = ENODEV; - } - - return dev; -} diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_do_ctors.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_do_ctors.c deleted file mode 100644 index ff5a1f7..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_do_ctors.c +++ /dev/null @@ -1,64 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT IT DIRECTLY. * -* * -* Overriding HAL Functions * -* * -* To provide your own implementation of a HAL function, include the file in * -* your Nios II IDE application project. When building the executable, the * -* Nios II IDE finds your function first, and uses it in place of the HAL * -* version. * -* * -******************************************************************************/ - -/* - * - */ - -typedef void (*constructor) (void); -extern constructor __CTOR_LIST__[]; -extern constructor __CTOR_END__[]; - -/* - * Run the C++ static constructors. - */ - -void _do_ctors(void) -{ - constructor* ctor; - - for (ctor = &__CTOR_END__[-1]; ctor >= __CTOR_LIST__; ctor--) - (*ctor) (); -} diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_do_dtors.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_do_dtors.c deleted file mode 100644 index 565c99f..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_do_dtors.c +++ /dev/null @@ -1,64 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT IT DIRECTLY. * -* * -* Overriding HAL Functions * -* * -* To provide your own implementation of a HAL function, include the file in * -* your Nios II IDE application project. When building the executable, the * -* Nios II IDE finds your function first, and uses it in place of the HAL * -* version. * -* * -******************************************************************************/ - -/* - * - */ - -typedef void (*destructor) (void); -extern destructor __DTOR_LIST__[]; -extern destructor __DTOR_END__[]; - -/* - * Run the C++ static destructors. - */ - -void _do_dtors(void) -{ - destructor* dtor; - - for (dtor = &__DTOR_END__[-1]; dtor >= __DTOR_LIST__; dtor--) - (*dtor) (); -} diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_env_lock.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_env_lock.c deleted file mode 100644 index fc25a0c..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_env_lock.c +++ /dev/null @@ -1,53 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -/* - * These are the empty env lock/unlock stubs required by newlib. These are - * used to make accesses to environment variables thread safe. The default HAL - * configuration is single threaded, so there is nothing to do here. Note that - * this requires that environment variables are never manipulated by an interrupt - * service routine. - */ - -void __env_lock ( struct _reent *_r ) -{ -} - -/* - * - */ - -void __env_unlock ( struct _reent *_r ) -{ -} diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_environ.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_environ.c deleted file mode 100644 index 404efc4..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_environ.c +++ /dev/null @@ -1,42 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "os/alt_syscall.h" - -/* - * These are the environment variables passed to the C code. By default there - * are no variables registered. An application can manipulate this list using - * getenv() and setenv(). - */ - -char *__env[1] = { 0 }; -char **ALT_ENVIRON = __env; diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_errno.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_errno.c deleted file mode 100644 index 1d8368d..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_errno.c +++ /dev/null @@ -1,44 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/* - * This file defines the alt_errno global variable. See comments in - * alt_errno.h for the use of this variable. - */ - - -#include "sys/alt_errno.h" -#include "alt_types.h" - -extern int ALT_WEAK *__errno (void); - -int* (*alt_errno) (void) = __errno; diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_exception_entry.S b/software/qsys_tutorial_mem_bsp/HAL/src/alt_exception_entry.S deleted file mode 100644 index 3afab93..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_exception_entry.S +++ /dev/null @@ -1,360 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2008 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "system.h" - -/* - * This is the exception entry point code, which saves all the caller saved - * registers and then handles the appropriate exception. It should be pulled - * in using a .globl from all the exception handler routines. This scheme is - * used so that if an interrupt is never registered, then this code will not - * appear in the generated executable, thereby improving code footprint. - * - * If an external interrpt controller (EIC) is present, it will supply an - * interrupt vector address to the processor when an interrupt occurs. For - * The Altera Vectored Interrupt Controller (VIC) driver will establish a - * vector table and the processor will jump directly to the appropriate - * table entry, funnel routine, and then user ISR. This will bypass this code - * in entirety. This code might still be linked into a system with an EIC, - * but would then be used only for non-interrupt exceptions. - */ - - /* - * Explicitly allow the use of r1 (the assembler temporary register) - * within this code. This register is normally reserved for the use of - * the assembler. - */ - .set noat - - /* - * The top and bottom of the exception stack - */ -#ifdef ALT_EXCEPTION_STACK - - .globl __alt_exception_stack_pointer - -#ifdef ALT_STACK_CHECK - - .globl __alt_exception_stack_limit - - /* - * We need to store the value of the stack limit after interrupt somewhere. - */ - .globl alt_exception_old_stack_limit - -#endif -#endif - - .section .exceptions.entry.label, "xa" - - .globl alt_exception - .type alt_exception, @function -alt_exception: - - .section .exceptions.entry, "xa" - -#ifdef ALT_EXCEPTION_STACK - -#ifdef ALT_STACK_CHECK - stw et, %gprel(alt_exception_old_stack_limit)(gp) -#endif - - movhi et, %hiadj(__alt_exception_stack_pointer - 80) - addi et, et, %lo(__alt_exception_stack_pointer - 80) - stw sp, 76(et) - mov sp, et - -#ifdef ALT_STACK_CHECK - movhi et, %hiadj(__alt_exception_stack_limit) - addi et, et, %lo(__alt_exception_stack_limit) - stw et, %gprel(alt_stack_limit_value)(gp) -#endif - -#else - /* - * Process an exception. For all exceptions we must preserve all - * caller saved registers on the stack (See the Nios2 ABI - * documentation for details). - */ - - addi sp, sp, -76 - -#ifdef ALT_STACK_CHECK - - bltu sp, et, .Lstack_overflow - -#endif - -#endif - - stw ra, 0(sp) - - /* - * Leave a gap in the stack frame at 4(sp) for the muldiv handler to - * store zero into. - */ - - stw r1, 8(sp) - stw r2, 12(sp) - stw r3, 16(sp) - stw r4, 20(sp) - stw r5, 24(sp) - stw r6, 28(sp) - stw r7, 32(sp) - - rdctl r5, estatus - - stw r8, 36(sp) - stw r9, 40(sp) - stw r10, 44(sp) - stw r11, 48(sp) - stw r12, 52(sp) - stw r13, 56(sp) - stw r14, 60(sp) - stw r15, 64(sp) - - /* - * ea-4 contains the address of the instruction being executed - * when the exception occured. For interrupt exceptions, we will - * will be re-issue the isntruction. Store it in 72(sp) - */ - stw r5, 68(sp) /* estatus */ - addi r15, ea, -4 /* instruction that caused exception */ - stw r15, 72(sp) - - /* - * The interrupt testing code (.exceptions.irqtest) will be - * linked here. If the Internal Interrupt Controller (IIC) is - * present (an EIC is not present), the presense of an interrupt - * is determined by examining CPU control registers or an interrupt - * custom instruction, if present. - * - * If the IIC is used and an interrupt is active, the code linked - * here will call the HAL IRQ handler (alt_irq_handler()) which - * successively calls registered interrupt handler(s) until no - * interrupts remain pending. It then jumps to .exceptions.exit. If - * there is no interrupt then it continues to .exception.notirq, below. - */ - - .section .exceptions.notirq, "xa" - - /* - * Prepare to service unimplemtned instructions or traps, - * each of which is optionally inked into section .exceptions.soft, - * which will preceed .exceptions.unknown below. - * - * Unlike interrupts, we want to skip the exception-causing instructon - * upon completion, so we write ea (address of instruction *after* - * the one where the exception occured) into 72(sp). The actual - * instruction that caused the exception is written in r2, which these - * handlers will utilize. - */ - stw ea, 72(sp) /* Don't re-issue */ - ldw r2, -4(ea) /* Instruction that caused exception */ - - /* - * Other exception handling code, if enabled, will be linked here. - * This includes unimplemted (multiply/divide) instruction support - * (a BSP generaton option), and a trap handler (that would typically - * be augmented with user-specific code). These are not linked in by - * default. - */ - - /* - * In the context of linker sections, "unknown" are all exceptions - * not handled by the built-in handlers above (interupt, and trap or - * unimplemented instruction decoding, if enabled). - * - * Advanced exception types can be serviced by registering a handler. - * To do so, enable the "Enable Instruction-related Exception API" HAL - * BSP setting. If this setting is disabled, this handler code will - * either break (if the debug core is present) or enter an infinite - * loop because we don't how how to handle the exception. - */ - .section .exceptions.unknown -#ifdef ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API - /* - * The C-based HAL routine alt_instruction_exception_entry() will - * attempt to service the exception by calling a user-registered - * exception handler using alt_instruction_exception_register(). - * If no handler was registered it will either break (if the - * debugger is present) or go into an infinite loop since the - * handling behavior is undefined; in that case we will not return here. - */ - - /* Load exception-causing address as first argument (r4) */ - addi r4, ea, -4 - - /* Call the instruction-exception entry */ - call alt_instruction_exception_entry - - /* - * If alt_instruction_exception_entry() returned, the exception was - * serviced by a user-registered routine. Its return code (now in r2) - * indicates whether to re-issue or skip the exception-causing - * instruction - * - * Return code was 0: Skip. The instruction after the exception is - * already stored in 72(sp). - */ - bne r2, r0, .Lexception_exit - - /* - * Otherwise, modify 72(sp) to re-issue the instruction that caused the - * exception. - */ - addi r15, ea, -4 /* instruction that caused exception */ - stw r15, 72(sp) - -#else /* ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API disabled */ - - /* - * We got here because an instruction-related exception occured, but the - * handler API was not compiled in. We do not presume to know how to - * handle it. If the debugger is present, break, otherwise hang. - * - * If you get here then one of the following could have happened: - * - * - An instruction-generated exception occured, and the processor - * does not have the extra exceptions feature enabled, or you - * have not registered a handler using - * alt_instruction_exception_register() - * - * Some examples of instruction-generated exceptions and why they - * might occur: - * - * - Your program could have been compiled for a full-featured - * Nios II core, but it is running on a smaller core, and - * instruction emulation has been disabled by defining - * ALT_NO_INSTRUCTION_EMULATION. - * - * You can work around the problem by re-enabling instruction - * emulation, or you can figure out why your program is being - * compiled for a system other than the one that it is running on. - * - * - Your program has executed a trap instruction, but has not - * implemented a handler for this instruction. - * - * - Your program has executed an illegal instruction (one which is - * not defined in the instruction set). - * - * - Your processor includes an MMU or MPU, and you have enabled it - * before registering an exception handler to service exceptions it - * generates. - * - * The problem could also be hardware related: - * - If your hardware is broken and is generating spurious interrupts - * (a peripheral which negates its interrupt output before its - * interrupt handler has been executed will cause spurious - * interrupts) - */ -#ifdef NIOS2_HAS_DEBUG_STUB - /* - * Either tell the user now (if there is a debugger attached) or go into - * the debug monitor which will loop until a debugger is attached. - */ - break -#else - /* - * If there is no debug stub then a BREAK will probably cause a reboot. - * An infinate loop will probably be more useful. - */ -0: - br 0b -#endif /* NIOS2_HAS_DEBUG_STUB */ - -#endif /* ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API */ - - .section .exceptions.exit.label -.Lexception_exit: - - .section .exceptions.exit, "xa" - - /* - * Restore the saved registers, so that all general purpose registers - * have been restored to their state at the time the interrupt occured. - */ - - ldw r5, 68(sp) - ldw ea, 72(sp) /* This becomes the PC once eret is executed */ - ldw ra, 0(sp) - - wrctl estatus, r5 - - ldw r1, 8(sp) - ldw r2, 12(sp) - ldw r3, 16(sp) - ldw r4, 20(sp) - ldw r5, 24(sp) - ldw r6, 28(sp) - ldw r7, 32(sp) - -#ifdef ALT_EXCEPTION_STACK -#ifdef ALT_STACK_CHECK - ldw et, %gprel(alt_exception_old_stack_limit)(gp) -#endif -#endif - - ldw r8, 36(sp) - ldw r9, 40(sp) - ldw r10, 44(sp) - ldw r11, 48(sp) - ldw r12, 52(sp) - ldw r13, 56(sp) - ldw r14, 60(sp) - ldw r15, 64(sp) - -#ifdef ALT_EXCEPTION_STACK - -#ifdef ALT_STACK_CHECK - stw et, %gprel(alt_stack_limit_value)(gp) - stw zero, %gprel(alt_exception_old_stack_limit)(gp) -#endif - - ldw sp, 76(sp) - -#else - addi sp, sp, 76 - -#endif - - /* - * Return to the interrupted instruction. - */ - - eret - -#ifdef ALT_STACK_CHECK - -.Lstack_overflow: - break 3 - -#endif - diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_exception_muldiv.S b/software/qsys_tutorial_mem_bsp/HAL/src/alt_exception_muldiv.S deleted file mode 100644 index 55617a6..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_exception_muldiv.S +++ /dev/null @@ -1,583 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - - /* - * This is the software multiply/divide handler for Nios2. - */ - - /* - * Provide a label which can be used to pull this file in. - */ - - .section .exceptions.start - .globl alt_exception_muldiv -alt_exception_muldiv: - - /* - * Pull in the entry/exit code. - */ - .globl alt_exception - - - .section .exceptions.soft, "xa" - - - /* INSTRUCTION EMULATION - * --------------------- - * - * Nios II processors generate exceptions for unimplemented instructions. - * The routines below emulate these instructions. Depending on the - * processor core, the only instructions that might need to be emulated - * are div, divu, mul, muli, mulxss, mulxsu, and mulxuu. - * - * The emulations match the instructions, except for the following - * limitations: - * - * 1) The emulation routines do not emulate the use of the exception - * temporary register (et) as a source operand because the exception - * handler already has modified it. - * - * 2) The routines do not emulate the use of the stack pointer (sp) or the - * exception return address register (ea) as a destination because - * modifying these registers crashes the exception handler or the - * interrupted routine. - * - * 3) To save code size, the routines do not emulate the use of the - * breakpoint registers (ba and bt) as operands. - * - * Detailed Design - * --------------- - * - * The emulation routines expect the contents of integer registers r0-r31 - * to be on the stack at addresses sp, 4(sp), 8(sp), ... 124(sp). The - * routines retrieve source operands from the stack and modify the - * destination register's value on the stack prior to the end of the - * exception handler. Then all registers except the destination register - * are restored to their previous values. - * - * The instruction that causes the exception is found at address -4(ea). - * The instruction's OP and OPX fields identify the operation to be - * performed. - * - * One instruction, muli, is an I-type instruction that is identified by - * an OP field of 0x24. - * - * muli AAAAA,BBBBB,IIIIIIIIIIIIIIII,-0x24- - * 27 22 6 0 <-- LSB of field - * - * The remaining emulated instructions are R-type and have an OP field - * of 0x3a. Their OPX fields identify them. - * - * R-type AAAAA,BBBBB,CCCCC,XXXXXX,NNNNN,-0x3a- - * 27 22 17 11 6 0 <-- LSB of field - * - * - */ - - - /* - * Split the instruction into its fields. We need 4*A, 4*B, and 4*C as - * offsets to the stack pointer for access to the stored register values. - */ - /* r2 = AAAAA,BBBBB,IIIIIIIIIIIIIIII,PPPPPP */ - roli r3, r2, 7 /* r3 = BBB,IIIIIIIIIIIIIIII,PPPPPP,AAAAA,BB */ - roli r4, r3, 3 /* r4 = IIIIIIIIIIIIIIII,PPPPPP,AAAAA,BBBBB */ - roli r6, r4, 2 /* r6 = IIIIIIIIIIIIII,PPPPPP,AAAAA,BBBBB,II */ - srai r4, r4, 16 /* r4 = (sign-extended) IMM16 */ - xori r6, r6, 0x42 /* r6 = CCC,XXXXXX,NNNNN,PPPPPP,AAAAA,bBBBB,cC */ - roli r7, r6, 5 /* r7 = XXXX,NNNNN,PPPPPP,AAAAA,bBBBB,cCCCC,XX */ - andi r5, r2, 0x3f /* r5 = 00000000000000000000000000,PPPPPP */ - xori r3, r3, 0x40 - andi r3, r3, 0x7c /* r3 = 0000000000000000000000000,aAAAA,00 */ - andi r6, r6, 0x7c /* r6 = 0000000000000000000000000,bBBBB,00 */ - andi r7, r7, 0x7c /* r7 = 0000000000000000000000000,cCCCC,00 */ - - /* Now either - * r5 = OP - * r3 = 4*(A^16) - * r4 = IMM16 (sign extended) - * r6 = 4*(B^16) - * r7 = 4*(C^16) - * or - * r5 = OP - */ - - - /* - * Save everything on the stack to make it easy for the emulation routines - * to retrieve the source register operands. The exception entry code has - * already saved some of this so we don't need to do it all again. - */ - - addi sp, sp, -60 - stw zero, 64(sp) /* Save zero on stack to avoid special case for r0. */ - /* Register at and r2-r15 have already been saved. */ - - stw r16, 0(sp) - stw r17, 4(sp) - stw r18, 8(sp) - stw r19, 12(sp) - stw r20, 16(sp) - stw r21, 20(sp) - stw r22, 24(sp) - stw r23, 28(sp) - /* et @ 32 - Has already been changed.*/ - /* bt @ 36 - Usually isn't an operand. */ - stw gp, 40(sp) - stw sp, 44(sp) - stw fp, 48(sp) - /* ea @ 52 - Don't bother to save - it's already been changed */ - /* ba @ 56 - Breakpoint register usually isn't an operand */ - /* ra @ 60 - Has already been saved */ - - - /* - * Prepare for either multiplication or division loop. - * They both loop 32 times. - */ - movi r14, 32 - - - /* - * Get the operands. - * - * It is necessary to check for muli because it uses an I-type instruction - * format, while the other instructions are have an R-type format. - */ - add r3, r3, sp /* r3 = address of A-operand. */ - ldw r3, 0(r3) /* r3 = A-operand. */ - movi r15, 0x24 /* muli opcode (I-type instruction format) */ - beq r5, r15, .Lmul_immed /* muli doesn't use the B register as a source */ - - add r6, r6, sp /* r6 = address of B-operand. */ - ldw r6, 0(r6) /* r6 = B-operand. */ - /* r4 = SSSSSSSSSSSSSSSS,-----IMM16------ */ - /* IMM16 not needed, align OPX portion */ - /* r4 = SSSSSSSSSSSSSSSS,CCCCC,-OPX--,00000 */ - srli r4, r4, 5 /* r4 = 00000,SSSSSSSSSSSSSSSS,CCCCC,-OPX-- */ - andi r4, r4, 0x3f /* r4 = 00000000000000000000000000,-OPX-- */ - - /* Now - * r5 = OP - * r3 = src1 - * r6 = src2 - * r4 = OPX (no longer can be muli) - * r7 = 4*(C^16) - * r14 = loop counter - */ - - /* ILLEGAL-INSTRUCTION EXCEPTION - * ----------------------------- - * - * This code is for Nios II cores that generate exceptions when attempting - * to execute illegal instructions. Nios II cores that support an - * illegal-instruction exception are identified by the presence of the - * macro definition NIOS2_HAS_ILLEGAL_INSTRUCTION_EXCEPTION in system.h . - * - * Remember that illegal instructions are different than unimplemented - * instructions. Illegal instructions are instruction encodings that - * have not been defined by the Nios II ISA. Unimplemented instructions - * are legal instructions that must be emulated by some Nios II cores. - * - * If we get here, all instructions except multiplies and divides - * are illegal. - * - * This code assumes that OP is not muli (because muli was tested above). - * All other multiplies and divides are legal. Anything else is illegal. - */ - - movi r8, 0x3a /* OP for R-type mul* and div* */ - bne r5, r8, .Lnot_muldiv - - /* r15 already is 0x24 */ /* OPX of divu */ - beq r4, r15, .Ldivide - - movi r15,0x27 /* OPX of mul */ - beq r4, r15, .Lmultiply - - movi r15,0x07 /* OPX of mulxuu */ - beq r4, r15, .Lmultiply - - movi r15,0x17 /* OPX of mulxsu */ - beq r4, r15, .Lmultiply - - movi r15,0x1f /* OPX of mulxss */ - beq r4, r15, .Lmultiply - - movi r15,0x25 /* OPX of div */ - bne r4, r15, .Lnot_muldiv - - - /* DIVISION - * - * Divide an unsigned dividend by an unsigned divisor using - * a shift-and-subtract algorithm. The example below shows - * 43 div 7 = 6 for 8-bit integers. This classic algorithm uses a - * single register to store both the dividend and the quotient, - * allowing both values to be shifted with a single instruction. - * - * remainder dividend:quotient - * --------- ----------------- - * initialize 00000000 00101011: - * shift 00000000 0101011:_ - * remainder >= divisor? no 00000000 0101011:0 - * shift 00000000 101011:0_ - * remainder >= divisor? no 00000000 101011:00 - * shift 00000001 01011:00_ - * remainder >= divisor? no 00000001 01011:000 - * shift 00000010 1011:000_ - * remainder >= divisor? no 00000010 1011:0000 - * shift 00000101 011:0000_ - * remainder >= divisor? no 00000101 011:00000 - * shift 00001010 11:00000_ - * remainder >= divisor? yes 00001010 11:000001 - * remainder -= divisor - 00000111 - * ---------- - * 00000011 11:000001 - * shift 00000111 1:000001_ - * remainder >= divisor? yes 00000111 1:0000011 - * remainder -= divisor - 00000111 - * ---------- - * 00000000 1:0000011 - * shift 00000001 :0000011_ - * remainder >= divisor? no 00000001 :00000110 - * - * The quotient is 00000110. - */ - -.Ldivide: - /* - * Prepare for division by assuming the result - * is unsigned, and storing its "sign" as 0. - */ - movi r17, 0 - - - /* Which division opcode? */ - xori r15, r4, 0x25 /* OPX of div */ - bne r15, zero, .Lunsigned_division - - - /* - * OPX is div. Determine and store the sign of the quotient. - * Then take the absolute value of both operands. - */ - xor r17, r3, r6 /* MSB contains sign of quotient */ - bge r3, zero, 0f - sub r3, zero, r3 /* -r3 */ -0: - bge r6, zero, 0f - sub r6, zero, r6 /* -r6 */ -0: - - -.Lunsigned_division: - /* Initialize the unsigned-division loop. */ - movi r13, 0 /* remainder = 0 */ - - /* Now - * r3 = dividend : quotient - * r4 = 0x25 for div, 0x24 for divu - * r6 = divisor - * r13 = remainder - * r14 = loop counter (already initialized to 32) - * r17 = MSB contains sign of quotient - */ - - - /* - * for (count = 32; count > 0; --count) - * { - */ -.Ldivide_loop: - - /* - * Division: - * - * (remainder:dividend:quotient) <<= 1; - */ - slli r13, r13, 1 - cmplt r15, r3, zero /* r15 = MSB of r3 */ - or r13, r13, r15 - slli r3, r3, 1 - - - /* - * if (remainder >= divisor) - * { - * set LSB of quotient - * remainder -= divisor; - * } - */ - bltu r13, r6, .Ldiv_skip - ori r3, r3, 1 - sub r13, r13, r6 -.Ldiv_skip: - - /* - * } - */ - subi r14, r14, 1 - bne r14, zero, .Ldivide_loop - - mov r9, r3 - - - /* Now - * r9 = quotient - * r4 = 0x25 for div, 0x24 for divu - * r7 = 4*(C^16) - * r17 = MSB contains sign of quotient - */ - - - /* - * Conditionally negate signed quotient. If quotient is unsigned, - * the sign already is initialized to 0. - */ - bge r17, zero, .Lstore_result - sub r9, zero, r9 /* -r9 */ - - br .Lstore_result - - - - - /* MULTIPLICATION - * - * A "product" is the number that one gets by summing a "multiplicand" - * several times. The "multiplier" specifies the number of copies of the - * multiplicand that are summed. - * - * Actual multiplication algorithms don't use repeated addition, however. - * Shift-and-add algorithms get the same answer as repeated addition, and - * they are faster. To compute the lower half of a product (pppp below) - * one shifts the product left before adding in each of the partial products - * (a * mmmm) through (d * mmmm). - * - * To compute the upper half of a product (PPPP below), one adds in the - * partial products (d * mmmm) through (a * mmmm), each time following the - * add by a right shift of the product. - * - * mmmm - * * abcd - * ------ - * #### = d * mmmm - * #### = c * mmmm - * #### = b * mmmm - * #### = a * mmmm - * -------- - * PPPPpppp - * - * The example above shows 4 partial products. Computing actual Nios II - * products requires 32 partials. - * - * It is possible to compute the result of mulxsu from the result of mulxuu - * because the only difference between the results of these two opcodes is - * the value of the partial product associated with the sign bit of rA. - * - * mulxsu = mulxuu - ((rA < 0) ? rB : 0); - * - * It is possible to compute the result of mulxss from the result of mulxsu - * because the only difference between the results of these two opcodes is - * the value of the partial product associated with the sign bit of rB. - * - * mulxss = mulxsu - ((rB < 0) ? rA : 0); - * - */ - -.Lmul_immed: - /* Opcode is muli. Change it into mul for remainder of algorithm. */ - mov r7, r6 /* Field B is dest register, not field C. */ - mov r6, r4 /* Field IMM16 is src2, not field B. */ - movi r4, 0x27 /* OPX of mul is 0x27 */ - -.Lmultiply: - /* Initialize the multiplication loop. */ - movi r9, 0 /* mul_product = 0 */ - movi r10, 0 /* mulxuu_product = 0 */ - mov r11, r6 /* save original multiplier for mulxsu and mulxss */ - mov r12, r6 /* mulxuu_multiplier (will be shifted) */ - movi r16, 1 /* used to create "rori B,A,1" from "ror B,A,r16" */ - - /* Now - * r3 = multiplicand - * r6 = mul_multiplier - * r7 = 4 * dest_register (used later as offset to sp) - * r9 = mul_product - * r10 = mulxuu_product - * r11 = original multiplier - * r12 = mulxuu_multiplier - * r14 = loop counter (already initialized) - * r15 = temp - * r16 = 1 - */ - - - /* - * for (count = 32; count > 0; --count) - * { - */ -.Lmultiply_loop: - - /* - * mul_product <<= 1; - * lsb = multiplier & 1; - */ - slli r9, r9, 1 - andi r15, r12, 1 - - /* - * if (lsb == 1) - * { - * mulxuu_product += multiplicand; - * } - */ - beq r15, zero, .Lmulx_skip - add r10, r10, r3 - cmpltu r15, r10, r3 /* Save the carry from the MSB of mulxuu_product. */ - ror r15, r15, r16 /* r15 = 0x80000000 on carry, or else 0x00000000 */ -.Lmulx_skip: - - /* - * if (MSB of mul_multiplier == 1) - * { - * mul_product += multiplicand; - * } - */ - bge r6, zero, .Lmul_skip - add r9, r9, r3 -.Lmul_skip: - - /* - * mulxuu_product >>= 1; logical shift - * mul_multiplier <<= 1; done with MSB - * mulx_multiplier >>= 1; done with LSB - */ - srli r10, r10, 1 - or r10, r10, r15 /* OR in the saved carry bit. */ - slli r6, r6, 1 - srli r12, r12, 1 - - - /* - * } - */ - subi r14, r14, 1 - bne r14, zero, .Lmultiply_loop - - - /* - * Multiply emulation loop done. - */ - - /* Now - * r3 = multiplicand - * r4 = OPX - * r7 = 4 * dest_register (used later as offset to sp) - * r9 = mul_product - * r10 = mulxuu_product - * r11 = original multiplier - * r15 = temp - */ - - - /* - * Select/compute the result based on OPX. - */ - - - /* OPX == mul? Then store. */ - xori r15, r4, 0x27 - beq r15, zero, .Lstore_result - - /* It's one of the mulx.. opcodes. Move over the result. */ - mov r9, r10 - - /* OPX == mulxuu? Then store. */ - xori r15, r4, 0x07 - beq r15, zero, .Lstore_result - - /* Compute mulxsu - * - * mulxsu = mulxuu - ((rA < 0) ? rB : 0); - */ - bge r3, zero, .Lmulxsu_skip - sub r9, r9, r11 -.Lmulxsu_skip: - - /* OPX == mulxsu? Then store. */ - xori r15, r4, 0x17 - beq r15, zero, .Lstore_result - - /* Compute mulxss - * - * mulxss = mulxsu - ((rB < 0) ? rA : 0); - */ - bge r11, zero, .Lmulxss_skip - sub r9, r9, r3 -.Lmulxss_skip: - /* At this point, assume that OPX is mulxss, so store */ - - -.Lstore_result: - add r7, r7, sp - stw r9, 0(r7) - - ldw r16, 0(sp) - ldw r17, 4(sp) - ldw r18, 8(sp) - ldw r19, 12(sp) - ldw r20, 16(sp) - ldw r21, 20(sp) - ldw r22, 24(sp) - ldw r23, 28(sp) - - /* bt @ 32 - Breakpoint register usually isn't an operand. */ - /* et @ 36 - Don't corrupt et. */ - /* gp @ 40 - Don't corrupt gp. */ - /* sp @ 44 - Don't corrupt sp. */ - ldw fp, 48(sp) - /* ea @ 52 - Don't corrupt ea. */ - /* ba @ 56 - Breakpoint register usually isn't an operand. */ - - addi sp, sp, 60 - - br .Lexception_exit - - -.Lnot_muldiv: - - addi sp, sp, 60 - - - .section .exceptions.exit.label -.Lexception_exit: - diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_exception_trap.S b/software/qsys_tutorial_mem_bsp/HAL/src/alt_exception_trap.S deleted file mode 100644 index 60a3d40..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_exception_trap.S +++ /dev/null @@ -1,81 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - - /* - * This is the trap exception handler for Nios2. - */ - - /* - * Provide a label which can be used to pull this file in. - */ - - .section .exceptions.start - .globl alt_exception_trap -alt_exception_trap: - - /* - * Pull in the entry/exit code. - */ - .globl alt_exception - - .section .exceptions.soft, "xa" - -.Ltrap_handler: - - /* - * Did a trap instruction cause the exception? - * - * The instruction which the exception occurred on has been loaded - * into r2 by code in alt_exception_entry.S - * - */ - - movhi r3,0x003b /* upper half of trap opcode */ - ori r3,r3,0x683a /* lower half of trap opcode */ - bne r2,r3,.Lnot_trap - - /* - * There is no trap handler defined here, and so executing a trap - * instruction causes a software break. If you provide a trap handler, - * then you must replace the break instruction below with your handler. - * Your handler must preserve ea and the usual callee saved registers. - */ - - break - - br .Lexception_exit - -.Lnot_trap: - - - .section .exceptions.exit.label -.Lexception_exit: - - diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_execve.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_execve.c deleted file mode 100644 index 27b99cf..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_execve.c +++ /dev/null @@ -1,55 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "os/alt_syscall.h" - -/* - * execve() is used by newlib to launch new processes. This is unsupported in - * the HAL environment. However a "do-nothing" implementation is still - * provied for newlib compatability. - * - * ALT_EXECVE is mapped onto the execve() system call in alt_syscall.h - */ - -int ALT_EXECVE (char *name, char ** argv, char** env) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(execve); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_exit.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_exit.c deleted file mode 100644 index 971b35e..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_exit.c +++ /dev/null @@ -1,71 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_irq.h" -#include "sys/alt_sim.h" -#include "os/alt_hooks.h" -#include "os/alt_syscall.h" - -#include "alt_types.h" -#include "sys/alt_log_printf.h" -/* - * _exit() is called by exit() in order to terminate the current process. - * Typically this is called when main() completes. It should never return. - * Since there is nowhere to go once this process completes, this - * implementation simply blocks forever. - * - * Note that interrupts are not disabled so that execution outside of this - * thread is allowed to continue. - * - * ALT_EXIT is mapped onto the _exit() system call in alt_syscall.h - */ - -void ALT_EXIT (int exit_code) -{ - /* ALT_LOG - please see HAL/inc/alt_log_printf.h for details */ - ALT_LOG_PRINT_BOOT("[alt_exit.c] Entering _exit() function.\r\n"); - ALT_LOG_PRINT_BOOT("[alt_exit.c] Exit code from main was %d.\r\n",exit_code); - /* Stop all other threads */ - - ALT_LOG_PRINT_BOOT("[alt_exit.c] Calling ALT_OS_STOP().\r\n"); - ALT_OS_STOP(); - - /* Provide notification to the simulator that we've stopped */ - - ALT_LOG_PRINT_BOOT("[alt_exit.c] Calling ALT_SIM_HALT().\r\n"); - ALT_SIM_HALT(exit_code); - - /* spin forever, since there's no where to go back to */ - - ALT_LOG_PRINT_BOOT("[alt_exit.c] Spinning forever.\r\n"); - while (1); -} diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_fcntl.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_fcntl.c deleted file mode 100644 index 69c1544..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_fcntl.c +++ /dev/null @@ -1,101 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include -#include - -#include "sys/alt_errno.h" -#include "priv/alt_file.h" -#include "alt_types.h" -#include "os/alt_syscall.h" - -#define ALT_FCNTL_FLAGS_MASK ((alt_u32) (O_APPEND | O_NONBLOCK)) - -/* - * fcntl() is a limited implementation of the standard fcntl() system call. - * It can be used to change the state of the flags associated with an open - * file descriptor. Normally these flags are set during the call to - * open(). It is anticipated that the main use of this function will be to - * change the state of a device from blocking to non-blocking (where this is - * supported). - * - * The input argument "fd" is the file descriptor to be manipulated. "cmd" - * is the command to execute. This can be either F_GETFL (return the - * current value of the flags) or F_SETFL (set the value of the flags). - * - * If "cmd" is F_SETFL then the argument "arg" is the new value of flags, - * otherwise "arg" is ignored. Only the flags: O_APPEND and O_NONBLOCK - * can be updated by a call to fcntl(). All other flags remain - * unchanged. - * - * ALT_FCNTL is mapped onto the fcntl() system call in alt_syscall.h - */ - -int ALT_FCNTL (int file, int cmd, ...) -{ - alt_fd* fd; - long flags; - va_list argp; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - switch (cmd) - { - case F_GETFL: - return fd->fd_flags & ~((alt_u32) ALT_FD_FLAGS_MASK); - case F_SETFL: - va_start(argp, cmd); - flags = va_arg(argp, long); - fd->fd_flags &= ~ALT_FCNTL_FLAGS_MASK; - fd->fd_flags |= (flags & ALT_FCNTL_FLAGS_MASK); - va_end(argp); - return 0; - default: - ALT_ERRNO = EINVAL; - return -1; - } - } - - ALT_ERRNO = EBADFD; - return -1; -} diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_fd_lock.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_fd_lock.c deleted file mode 100644 index 0e2a85d..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_fd_lock.c +++ /dev/null @@ -1,75 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "priv/alt_file.h" - -/* - * alt_fd_lock() is called as a consequence of an ioctl call to gain exclusive - * access to a device, i.e.: - * - * ioctl (fd, TIOCEXCL, NULL); - * - * If there are no other open file descriptors which reference the same - * device, then alt_fd_lock() will grant the lock. Further calls to open() - * for this device will fail until the lock is released. - * - * This is done by calling close() for this file descriptor, or by calling: - * - * ioctl (fd, TIOCNXCL, NULL); - * - * The return value is zero for success, or negative in the case of failure. - */ - -int alt_fd_lock (alt_fd* fd) -{ - int i; - int rc = 0; - - ALT_SEM_PEND(alt_fd_list_lock, 0); - - for (i = 0; i < alt_max_fd; i++) - { - if ((&alt_fd_list[i] != fd) && (alt_fd_list[i].dev == fd->dev)) - { - rc = -EACCES; - goto alt_fd_lock_exit; - } - } - fd->fd_flags |= ALT_FD_EXCL; - - alt_fd_lock_exit: - - ALT_SEM_POST(alt_fd_list_lock); - return rc; -} diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_fd_unlock.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_fd_unlock.c deleted file mode 100644 index fb700dc..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_fd_unlock.c +++ /dev/null @@ -1,56 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "priv/alt_file.h" - -/* - * alt_fd_unlock() is the inverse of alt_fd_lock(). It is called as a - * consequence of a TIOCNXCL ioctl request, e.g: - * - * ioctl (fd, TIOCNXCL, NULL); - * - * It enables multiple file descriptors to exist for the same device. This - * is normally the case, but it may have been disabled by a previous call to - * alt_fd_lock(). - * - * Return zero on sucess, and a negative value on failure. - * - * The current implementation always succeeds. - */ - -int alt_fd_unlock (alt_fd* fd) -{ - fd->fd_flags &= ~ALT_FD_EXCL; - return 0; -} diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_find_dev.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_find_dev.c deleted file mode 100644 index 37aefa4..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_find_dev.c +++ /dev/null @@ -1,88 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - -#include "alt_types.h" - -/* - * alt_find_dev() is used by open() in order to locate a previously registered - * device with the name "name". The input argument "llist" is a pointer to the - * head of the device list to search. - * - * The return value is a pointer to the matching device, or NULL if there is - * no match. - * - * "name" must be an exact match for the devices registered name for a match to - * be found. - */ - -alt_dev* alt_find_dev(const char* name, alt_llist* llist) -{ - alt_dev* next = (alt_dev*) llist->next; - alt_32 len; - - len = strlen(name) + 1; - - /* - * Check each list entry in turn, until a match is found, or we reach the - * end of the list (i.e. next winds up pointing back to the list head). - */ - - while (next != (alt_dev*) llist) - { - - /* - * memcmp() is used here rather than strcmp() in order to reduce the size - * of the executable. - */ - - if (!memcmp (next->name, name, len)) - { - /* match found */ - - return next; - } - next = (alt_dev*) next->llist.next; - } - - /* No match found */ - - return NULL; -} - - diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_find_file.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_find_file.c deleted file mode 100644 index 2d97ec2..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_find_file.c +++ /dev/null @@ -1,89 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - -#include "alt_types.h" - -/* - * alt_find_file() is used by open() in order to locate a previously registered - * filesystem that owns that mount point that contains the file named "name". - * - * The return value is a pointer to the matching filesystem, or NULL if there is - * no match. - * - * A match is considered to have been found if the filesystem name followed by - * either '/' or '\0' is the prefix of the filename. For example the filename: - * "/myfilesystem/junk.txt" would match: "/myfilesystem", but not: "/myfile". - */ - -alt_dev* alt_find_file (const char* name) -{ - alt_dev* next = (alt_dev*) alt_fs_list.next; - - alt_32 len; - - /* - * Check each list entry in turn, until a match is found, or we reach the - * end of the list (i.e. next winds up pointing back to the list head). - */ - - while (next != (alt_dev*) &alt_fs_list) - { - len = strlen(next->name); - - if (next->name[len-1] == '/') - { - len -= 1; - } - - if (((name[len] == '/') || (name[len] == '\0')) && - !memcmp (next->name, name, len)) - { - /* match found */ - - return next; - } - next = (alt_dev*) next->llist.next; - } - - /* No match found */ - - return NULL; -} - - diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_flash_dev.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_flash_dev.c deleted file mode 100644 index 213f721..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_flash_dev.c +++ /dev/null @@ -1,69 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* Alt_flash.c - Functions to register a flash device to the "generic" flash * -* interface * -* * -* Author PRR * -* * -******************************************************************************/ - -#include -#include "sys/alt_llist.h" -#include "sys/alt_flash_dev.h" -#include "priv/alt_file.h" - -ALT_LLIST_HEAD(alt_flash_dev_list); - -alt_flash_fd* alt_flash_open_dev(const char* name) -{ - alt_flash_dev* dev = (alt_flash_dev*)alt_find_dev(name, &alt_flash_dev_list); - - if ((dev) && dev->open) - { - return dev->open(dev, name); - } - - return dev; -} - -void alt_flash_close_dev(alt_flash_fd* fd) -{ - if (fd && fd->close) - { - fd->close(fd); - } - return; -} - diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_fork.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_fork.c deleted file mode 100644 index ce74df0..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_fork.c +++ /dev/null @@ -1,57 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_warning.h" -#include "sys/alt_errno.h" -#include "os/alt_syscall.h" - -/* - * The fork() system call is used by newlib to create a duplicate copy of the - * curent process. This is unsupported in the HAL environment. However a - * "do-nothing" implementation is still provied for newlib compatability. - * - * ALT_FORK is mapped onto the fork() system call in alt_syscall.h - */ - -int ALT_FORK (void) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(fork); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} - - diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_fs_reg.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_fs_reg.c deleted file mode 100644 index 13437a1..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_fs_reg.c +++ /dev/null @@ -1,75 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - -/* - * The alt_fs_reg() function is used to register a file system. Once registered - * a device can be accessed using the standard posix calls: open(), read(), - * write() etc. - * - * System behaviour is undefined in the event that a file system is registered - * with a name that conflicts with an existing device or file system. - * - * alt_fs_reg() is not thread safe in the sense that there should be no other - * thread using the file system list at the time that alt_dev_reg() is called. In - * practice this means that alt_fs_reg() should only be called while operating - * in a single threaded mode. The expectation is that it will only be called - * by the file system initilisation functions invoked by alt_sys_init(), which in - * turn should only be called by the single threaded C startup code. - * - * A return value of zero indicates success. A negative return value indicates - * failure. - */ - -int alt_fs_reg (alt_dev* dev) -{ - /* - * check that the device has a name. - */ - - if (!dev->name) - { - return -ENODEV; - } - - /* - * register the file system. - */ - - alt_llist_insert(&alt_fs_list, &dev->llist); - - return 0; -} diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_fstat.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_fstat.c deleted file mode 100644 index af5d527..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_fstat.c +++ /dev/null @@ -1,128 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include "sys/alt_dev.h" -#include "sys/alt_warning.h" -#include "sys/alt_errno.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -/* - * The fstat() system call is used to obtain information about the capabilities - * of an open file descriptor. By default file descriptors are marked as - * being character devices. If a device or file system wishes to advertise - * alternative capabilities then they can register an fstat() function within - * their associated alt_dev structure. This will be called to fill in the - * entries in the imput "st" structure. - * - * This function is provided for compatability with newlib. - * - * ALT_FSTAT is mapped onto the fstat() system call in alt_syscall.h - */ - -#ifdef ALT_USE_DIRECT_DRIVERS - -#include "system.h" - -/* - * Provide minimal version that just describes all file descriptors - * as character devices for provided stdio devices. - */ -int ALT_FSTAT (int file, struct stat *st) -{ - switch (file) { -#ifdef ALT_STDIN_PRESENT - case 0: /* stdin file descriptor */ -#endif /* ALT_STDIN_PRESENT */ -#ifdef ALT_STDOUT_PRESENT - case 1: /* stdout file descriptor */ -#endif /* ALT_STDOUT_PRESENT */ -#ifdef ALT_STDERR_PRESENT - case 2: /* stderr file descriptor */ -#endif /* ALT_STDERR_PRESENT */ - st->st_mode = _IFCHR; - return 0; - default: - return -1; - } - -#if !defined(ALT_STDIN_PRESENT) && !defined(ALT_STDOUT_PRESENT) && !defined(ALT_STDERR_PRESENT) - /* Generate a link time warning, should this function ever be called. */ - ALT_STUB_WARNING(fstat); -#endif -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -int ALT_FSTAT (int file, struct stat *st) -{ - alt_fd* fd; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - /* Call the drivers fstat() function to fill out the "st" structure. */ - - if (fd->dev->fstat) - { - return fd->dev->fstat(fd, st); - } - - /* - * If no function is provided, mark the fd as belonging to a character - * device. - */ - - else - { - st->st_mode = _IFCHR; - return 0; - } - } - else - { - ALT_ERRNO = EBADFD; - return -1; - } -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_get_fd.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_get_fd.c deleted file mode 100644 index db17b2c..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_get_fd.c +++ /dev/null @@ -1,105 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - -#include "alt_types.h" - -#include "system.h" - -/* - * alt_get_fd() is called to allocate a new file descriptor from the file - * descriptor pool. If a file descriptor is succesfully allocated, it is - * configured to refer to device "dev". - * - * The return value is the index of the file descriptor structure (i.e. - * the offset of the file descriptor within the file descriptor array). A - * negative value indicates failure. - */ - -int alt_get_fd (alt_dev* dev) -{ - alt_32 i; - int rc = -EMFILE; - - /* - * Take the alt_fd_list_lock semaphore in order to avoid races when - * accessing the file descriptor pool. - */ - - ALT_SEM_PEND(alt_fd_list_lock, 0); - - /* - * Search through the list of file descriptors, and allocate the first - * free descriptor that's found. - * - * If a free descriptor is found, then the value of "alt_max_fd" is - * updated accordingly. "alt_max_fd" is a 'highwater mark' which - * indicates the highest file descriptor ever allocated. This is used to - * improve efficency when searching the file descriptor list, and - * therefore reduce contention on the alt_fd_list_lock semaphore. - */ - - for (i = 0; i < ALT_MAX_FD; i++) - { - if (!alt_fd_list[i].dev) - { - alt_fd_list[i].dev = dev; - if (i > alt_max_fd) - { - alt_max_fd = i; - } - rc = i; - goto alt_get_fd_exit; - } - } - - alt_get_fd_exit: - - /* - * Release the alt_fd_list_lock semaphore now that we are done with the - * file descriptor pool. - */ - - ALT_SEM_POST(alt_fd_list_lock); - - return rc; -} - - - - diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_getchar.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_getchar.c deleted file mode 100644 index a8f50d5..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_getchar.c +++ /dev/null @@ -1,61 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#ifdef ALT_USE_DIRECT_DRIVERS -#include "system.h" -#include "sys/alt_driver.h" -#include "sys/alt_stdio.h" -#include "priv/alt_file.h" -#include "unistd.h" -#endif - -/* - * Uses the ALT_DRIVER_READ() macro to call directly to driver if available. - * Otherwise, uses newlib provided getchar() routine. - */ -int -alt_getchar(void) -{ -#ifdef ALT_USE_DIRECT_DRIVERS - ALT_DRIVER_READ_EXTERNS(ALT_STDIN_DEV); - char c; - - if (ALT_DRIVER_READ(ALT_STDIN_DEV, &c, 1, alt_fd_list[STDIN_FILENO].fd_flags) <= 0) { - return -1; - } - return c; -#else - return getchar(); -#endif -} diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_getpid.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_getpid.c deleted file mode 100644 index 2228c7e..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_getpid.c +++ /dev/null @@ -1,47 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "os/alt_syscall.h" - -/* - * The getpid() system call is used by newlib to obtain the current process - * id. Since there is only ever a single process in the HAL environment, - * this just returns a constant. - * - * ALT_GETPID is mapped onto the getpid() system call in alt_syscall.h - */ - -int ALT_GETPID (void) -{ - return 0; -} - diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_gettod.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_gettod.c deleted file mode 100644 index ed86cba..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_gettod.c +++ /dev/null @@ -1,125 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include - -#include "sys/alt_alarm.h" -#include "alt_types.h" -#include "os/alt_syscall.h" - -/* - * Macro defining the number of micoseconds in a second. - */ - -#define ALT_US (1000000) - -/* - * "alt_timezone" and "alt_resettime" are the values of the the reset time and - * time zone set through the last call to settimeofday(). By default they are - * zero initialised. - */ - -struct timezone alt_timezone = {0, 0}; -struct timeval alt_resettime = {0, 0}; - -/* - * gettimeofday() can be called to obtain a time structure which indicates the - * current "wall clock" time. This is calculated using the elapsed number of - * system clock ticks, and the value of "alt_resettime" and "alt_timezone" set - * through the last call to settimeofday(). - * - * Warning: if this function is called concurrently with a call to - * settimeofday(), the value returned by gettimeofday() will be unreliable. - * - * ALT_GETTIMEOFDAY is mapped onto the gettimeofday() system call in - * alt_syscall.h - */ - - -#if defined (__GNUC__) && (__GNUC__ >= 4) -int ALT_GETTIMEOFDAY (struct timeval *ptimeval, void *ptimezone_vptr) -{ - struct timezone *ptimezone = (struct timezone*)ptimezone_vptr; -#else -int ALT_GETTIMEOFDAY (struct timeval *ptimeval, struct timezone *ptimezone) -{ -#endif - - alt_u32 nticks = alt_nticks (); - alt_u32 tick_rate = alt_ticks_per_second (); - - /* - * Check to see if the system clock is running. This is indicated by a - * non-zero system clock rate. If the system clock is not running, an error - * is generated and the contents of "ptimeval" and "ptimezone" are not - * updated. - */ - - if (tick_rate) - { - ptimeval->tv_sec = alt_resettime.tv_sec + nticks/tick_rate; - ptimeval->tv_usec = alt_resettime.tv_usec + - (alt_u32)(((alt_u64)nticks*(ALT_US/tick_rate))%ALT_US); - - while(ptimeval->tv_usec < 0) { - if (ptimeval->tv_sec <= 0) - { - ptimeval->tv_sec = 0; - ptimeval->tv_usec = 0; - break; - } - else - { - ptimeval->tv_sec--; - ptimeval->tv_usec += ALT_US; - } - } - - while(ptimeval->tv_usec >= ALT_US) { - ptimeval->tv_sec++; - ptimeval->tv_usec -= ALT_US; - } - - if (ptimezone) - { - ptimezone->tz_minuteswest = alt_timezone.tz_minuteswest; - ptimezone->tz_dsttime = alt_timezone.tz_dsttime; - } - - return 0; - } - - return -ENOTSUP; -} - diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_gmon.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_gmon.c deleted file mode 100644 index 6add9f1..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_gmon.c +++ /dev/null @@ -1,272 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include -#include -#include - -#include "priv/nios2_gmon_data.h" - -#include "sys/alt_irq.h" -#include "sys/alt_alarm.h" - - -/* Macros */ - -/* How large should the bins be which we use to generate the histogram */ -#define PCSAMPLE_BYTES_PER_BUCKET 32 - -#define NIOS2_READ_EA(dest) __asm__ ("mov %0, ea" : "=r" (dest)) - -/* The compiler inserts calls to mcount() at the start of - * every function call. The structure mcount_fn_arc records t - * he return address of the function called (in from_pc) - * and the return address of the mcount function - * (in self_pc). The number of times this arc is executed is - * recorded in the field count. - */ -struct mcount_fn_arc -{ - struct mcount_fn_arc * next; - void * from_pc; - unsigned int count; -}; - -/* We need to maintain a list of pointers to the heads of each adjacency - * list so that we can find them when writing out the gmon.out file. Since - * we don't know at the start of program execution how many functions will - * be called we use a list structure to do this. - */ -struct mcount_fn_entry -{ - struct mcount_fn_entry * next; - void * self_pc; - struct mcount_fn_arc * arc_head; -}; - -/* function prototypes */ - -void __mcount_record(void * self_pc, void * from_pc, struct mcount_fn_entry * fn_entry, struct mcount_fn_entry * * fn_head) __attribute__ ((no_instrument_function)); - -static __inline__ void * mcount_allocate(unsigned int size) __attribute__ ((no_instrument_function)); -static int nios2_pcsample_init(void) __attribute__ ((no_instrument_function)); -static alt_u32 nios2_pcsample(void* alarm) __attribute__ ((no_instrument_function)); - -/* global variables */ - -/* stext and etext are defined in the linker script */ -extern char stext[]; -extern char etext[]; - -/* Is the PC sampling stuff enabled yet? */ -static int pcsample_need_init = 1; - -#define HASH_BUCKETS 64 /* Must be a power of 2 */ - -/* This points to the list of adjacency list pointers. */ -struct mcount_fn_entry * __mcount_fn_head[HASH_BUCKETS]; - -/* pointer to the in-memory buffer containing the histogram */ -static unsigned short* s_pcsamples = 0; - -/* the address of the start and end of text section */ -static const unsigned int s_low_pc = (unsigned int)stext; -static const unsigned int s_high_pc = (unsigned int)etext; - -/* the alarm structure to register for pc sampling */ -static alt_alarm s_nios2_pcsample_alarm; - -unsigned int alt_gmon_data[GMON_DATA_SIZE] = -{ - 0x6e6f6d67, /* "gmon" */ - GMON_DATA_SIZE, - 0, - (unsigned int)stext, - (unsigned int)etext, - PCSAMPLE_BYTES_PER_BUCKET, - 0, - (unsigned int)__mcount_fn_head, - (unsigned int)(__mcount_fn_head + HASH_BUCKETS) -}; - -/* This holds the current slab of memory we're allocating out of */ -static char * mcount_slab_ptr = 0; -static int mcount_slab_size = 0; - -#define MCOUNT_SLAB_INCREMENT 1020 - - -/* - * We can't use malloc to allocate memory because that's too complicated, and - * can't be called at interrupt time. Use the lower level allocator instead - * because that's interrupt safe (and because we never free anything). - * - * For speed, we allocate a block of data at once. - */ -static __inline__ void * mcount_allocate(unsigned int size) -{ - void * data; - - if (size > mcount_slab_size) - { - mcount_slab_ptr = sbrk(MCOUNT_SLAB_INCREMENT); - mcount_slab_size = MCOUNT_SLAB_INCREMENT; - } - - data = mcount_slab_ptr; - mcount_slab_ptr += size; - mcount_slab_size -= size; - - return data; -} - - -/* - * Add the arc with the values of frompc and topc given to the graph. - * This function might be called at interrupt time so must be able to - * cope with reentrancy. - * - * The fast case, where we have already allocated a function arc, has been - * handled by the assmebler code. - */ -void __mcount_record(void * self_pc, void * from_pc, struct mcount_fn_entry * fn_entry, struct mcount_fn_entry * * fn_head) -{ - alt_irq_context context; - struct mcount_fn_arc * arc_entry; - - /* Keep trying to start up the PC sampler until it is running. - * (It can't start until the timer is going). - */ - if (pcsample_need_init) - { - pcsample_need_init = 0; - pcsample_need_init = nios2_pcsample_init(); - } - - /* - * We must disable interrupts around the allocation and the list update to - * prevent corruption if the instrumented function is re-entrant. - * - * It's safe for the code above to be stepping through the chain and be - * interrupted by this code modifying it - there is an edge case which will - * leave two copies of the same arc on the list (both with count=1), but - * this is dealt with on the host. - */ - context = alt_irq_disable_all(); - - if (fn_entry == NULL) - { - /* Add it to the list of functions we must output later. */ - fn_entry = (struct mcount_fn_entry *)mcount_allocate(sizeof(struct mcount_fn_entry)); - - fn_entry->self_pc = self_pc; - fn_entry->arc_head = NULL; - - fn_entry->next = *fn_head; - *fn_head = fn_entry; - } - - /* We will need a new list entry - if there was a list entry before - * then the assembler code would have handled it. */ - arc_entry = (struct mcount_fn_arc *)mcount_allocate(sizeof(struct mcount_fn_arc)); - - arc_entry->from_pc = from_pc; - arc_entry->count = 1; - - arc_entry->next = fn_entry->arc_head; - fn_entry->arc_head = arc_entry; - - alt_irq_enable_all(context); -} - - -/* - * nios2_pcsample_init starts profiling. - * It is called the first time mcount is called, and on subsequent calls to - * mcount until it returns zero. It initializes the pc histogram and turns on - * timer driven pc sampling. - */ -static int nios2_pcsample_init(void) -{ - unsigned int pcsamples_size; - - /* We sample the PC every tick */ - unsigned int prof_rate = alt_ticks_per_second(); - if (prof_rate == 0) - return 1; - - /* allocate the histogram buffer s_pcsamples */ - pcsamples_size = (s_high_pc - s_low_pc)/PCSAMPLE_BYTES_PER_BUCKET; - s_pcsamples = (unsigned short*)sbrk(pcsamples_size * sizeof(unsigned short)); - - if (s_pcsamples != 0) - { - /* initialize the buffer to zero */ - memset(s_pcsamples, 0, pcsamples_size * sizeof(unsigned short)); - - alt_gmon_data[GMON_DATA_PROFILE_DATA] = (int)s_pcsamples; - alt_gmon_data[GMON_DATA_PROFILE_RATE] = prof_rate; - - /* Sample every tick (it's cheap) */ - alt_alarm_start(&s_nios2_pcsample_alarm, 1, nios2_pcsample, 0); - } - - return 0; -} - - -/* - * Sample the PC value and store it in the histogram - */ -static alt_u32 nios2_pcsample(void* context) -{ - unsigned int pc; - unsigned int bucket; - - /* read the exception return address - this will be - * inaccurate if there are nested interrupts but we - * assume that this is rare and the inaccuracy will - * not be great */ - NIOS2_READ_EA(pc); - - /* - * If we're within the profilable range then increment the relevant - * bucket in the histogram - */ - if (pc >= s_low_pc && pc < s_high_pc && s_pcsamples != 0) - { - bucket = (pc - s_low_pc)/PCSAMPLE_BYTES_PER_BUCKET; - s_pcsamples[bucket]++; - } - - /* Sample every tick */ - return 1; -} - diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_icache_flush.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_icache_flush.c deleted file mode 100644 index 4b706ed..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_icache_flush.c +++ /dev/null @@ -1,84 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "nios2.h" -#include "system.h" - -#include "alt_types.h" -#include "sys/alt_cache.h" - -/* - * alt_icache_flush() is called to flush the instruction cache for a memory - * region of length "len" bytes, starting at address "start". - */ - -void alt_icache_flush (void* start, alt_u32 len) -{ -#if NIOS2_ICACHE_SIZE > 0 - - char* i; - char* end; - - /* - * This is the most we would ever need to flush. - */ - - if (len > NIOS2_ICACHE_SIZE) - { - len = NIOS2_ICACHE_SIZE; - } - - end = ((char*) start) + len; - - for (i = start; i < end; i+= NIOS2_ICACHE_LINE_SIZE) - { - __asm__ volatile ("flushi %0" :: "r" (i)); - } - - /* - * For an unaligned flush request, we've got one more line left. - * Note that this is dependent on NIOS2_ICACHE_LINE_SIZE to be a - * multiple of 2 (which it always is). - */ - - if (((alt_u32) start) & (NIOS2_ICACHE_LINE_SIZE - 1)) - { - __asm__ volatile ("flushi %0" :: "r" (i)); - } - - /* - * Having flushed the cache, flush any stale instructions in the - * pipeline - */ - - __asm__ volatile ("flushp"); - -#endif /* NIOS2_ICACHE_SIZE > 0 */ -} diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_icache_flush_all.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_icache_flush_all.c deleted file mode 100644 index 5088552..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_icache_flush_all.c +++ /dev/null @@ -1,46 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "nios2.h" -#include "system.h" - -#include "alt_types.h" -#include "sys/alt_cache.h" - -/* - * alt_icache_flush_all() is called to flush the entire instruction cache. - */ - -void alt_icache_flush_all (void) -{ -#if NIOS2_ICACHE_SIZE > 0 - alt_icache_flush (0, NIOS2_ICACHE_SIZE); -#endif -} diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_iic.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_iic.c deleted file mode 100644 index 1db5afa..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_iic.c +++ /dev/null @@ -1,106 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ -#include "system.h" - -/* - * This file implements the HAL Enhanced interrupt API for Nios II processors - * with an internal interrupt controller (IIC). For most routines, this serves - * as a wrapper layer over the legacy interrupt API (which must be used with - * the IIC only). - * - * Use of the enhanced API is recommended so that application and device - * drivers are compatible with a Nios II system configured with an external - * interrupt controller (EIC), or IIC. This will afford maximum portability. - * - * If an EIC is present, the EIC device driver must provide these routines, - * because their operation will be specific to that EIC type. - */ -#ifndef NIOS2_EIC_PRESENT -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - -#include "sys/alt_irq.h" -#include "priv/alt_iic_isr_register.h" -#include "priv/alt_legacy_irq.h" - -/** @Function Description: This function registers an interrupt handler. - * If the function is succesful, then the requested interrupt will be enabled upon - * return. Registering a NULL handler will disable the interrupt. - * @API Type: External - * @param ic_id Ignored. - * @param irq IRQ number - * @return 0 if successful, else error (-1) - */ -int alt_ic_isr_register(alt_u32 ic_id, alt_u32 irq, alt_isr_func isr, - void *isr_context, void *flags) -{ - return alt_iic_isr_register(ic_id, irq, isr, isr_context, flags); -} - -/** @Function Description: This function enables a single interrupt. - * @API Type: External - * @param ic_id Ignored. - * @param irq IRQ number - * @return 0 if successful, else error (-1) - */ -int alt_ic_irq_enable (alt_u32 ic_id, alt_u32 irq) -{ - return alt_irq_enable(irq); -} - -/** @Function Description: This function disables a single interrupt. - * @API Type: External - * @param ic_id Ignored. - * @param irq IRQ number - * @return 0 if successful, else error (-1) - */ -int alt_ic_irq_disable(alt_u32 ic_id, alt_u32 irq) -{ - return alt_irq_disable(irq); -} - -/** @Function Description: This function to determine if corresponding - * interrupt is enabled. - * @API Type: External - * @param ic_id Ignored. - * @param irq IRQ number - * @return Zero if corresponding interrupt is disabled and - * non-zero otherwise. - */ -alt_u32 alt_ic_irq_enabled(alt_u32 ic_id, alt_u32 irq) -{ - alt_u32 irq_enabled; - - NIOS2_READ_IENABLE(irq_enabled); - - return (irq_enabled & (1 << irq)) ? 1: 0; -} - -#endif /* ALT_ENHANCED_INTERRUPT_API_PRESENT */ -#endif /* NIOS2_EIC_PRESENT */ diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_iic_isr_register.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_iic_isr_register.c deleted file mode 100644 index b104395..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_iic_isr_register.c +++ /dev/null @@ -1,104 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ -#include -#include "system.h" - -/* - * Provides an interrupt registry mechanism for the any CPUs internal interrupt - * controller (IIC) when the enhanced interrupt API is active. - */ -#ifndef ALT_CPU_EIC_PRESENT -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - -#include "alt_types.h" -#include "sys/alt_irq.h" -#include "priv/alt_iic_isr_register.h" - -/* - * The header, alt_irq_entry.h, contains the exception entry point, and is - * provided by the processor component. It is included here, so that the code - * will be added to the executable only if alt_irq_register() is present, i.e. - * if no interrupts are registered - there's no need to provide any - * interrupt handling. - */ - -#include "sys/alt_irq_entry.h" - -/* - * The header, alt_irq_table.h contains a table describing which function - * handles each interrupt. - */ - -#include "priv/alt_irq_table.h" - -/** @Function Description: This function registers an interrupt handler. - * If the function is succesful, then the requested interrupt will be enabled - * upon return. Registering a NULL handler will disable the interrupt. - * - * @API Type: External - * @param ic_id Interrupt controller ID - * @param irq IRQ ID number - * @param isr Pointer to interrupt service routine - * @param isr_context Opaque pointer passed to ISR - * @param flags - * @return 0 if successful, else error (-1) - */ -int alt_iic_isr_register(alt_u32 ic_id, alt_u32 irq, alt_isr_func isr, - void *isr_context, void *flags) -{ - int rc = -EINVAL; - int id = irq; /* IRQ interpreted as the interrupt ID. */ - alt_irq_context status; - - if (id < ALT_NIRQ) - { - /* - * interrupts are disabled while the handler tables are updated to ensure - * that an interrupt doesn't occur while the tables are in an inconsistant - * state. - */ - - status = alt_irq_disable_all(); - - alt_irq[id].handler = isr; - alt_irq[id].context = isr_context; - - rc = (isr) ? alt_ic_irq_enable(ic_id, id) : alt_ic_irq_disable(ic_id, id); - - alt_irq_enable_all(status); - } - - return rc; -} - -#endif /* ALT_ENHANCED_INTERRUPT_API_PRESENT */ -#endif /* ALT_CPU_EIC_PRESENT */ diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_instruction_exception_entry.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_instruction_exception_entry.c deleted file mode 100644 index f4f52fc..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_instruction_exception_entry.c +++ /dev/null @@ -1,203 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2008 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ -#include "sys/alt_exceptions.h" -#include "nios2.h" -#include "alt_types.h" -#include "system.h" - -/* - * This file implements support for calling user-registered handlers for - * instruction-generated exceptions. This handler could also be reached - * in the event of a spurious interrupt. - * - * The handler code is optionally enabled through the "Enable - * Instruction-related Exception API" HAL BSP setting, which will - * define the macro below. - */ -#ifdef ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API - -/* Function pointer to exception callback routine */ -alt_exception_result (*alt_instruction_exception_handler) - (alt_exception_cause, alt_u32, alt_u32) = 0x0; - -/* Link entry routine to .exceptions section */ -int alt_instruction_exception_entry (alt_u32 exception_pc) - __attribute__ ((section (".exceptions"))); - -/* - * This is the entry point for instruction-generated exceptions handling. - * This routine will be called by alt_exceptions_entry.S, after it determines - * that an exception could not be handled by handlers that preceed that - * of instruction-generated exceptions (such as interrupts). - * - * For this to function properly, you must register an exception handler - * using alt_instruction_exception_register(). This routine will call - * that handler if it has been registered. Absent a handler, it will - * break break or hang as discussed below. - */ -int alt_instruction_exception_entry (alt_u32 exception_pc) -{ - alt_u32 cause, badaddr; - -/* - * If the processor hardware has the optional EXCEPTIONS & BADADDR registers, - * read them and pass their content to the user handler. These are always - * present if the MMU or MPU is enabled, and optionally for other advanced - * exception types via the "Extra exceptions information" setting in the - * processor (hardware) configuration. - * - * If these registers are not present, the cause field will be set to - * NIOS2_EXCEPTION_CAUSE_NOT_PRESENT. Your handling routine should - * check the validity of the cause argument before proceeding. - */ -#ifdef NIOS2_HAS_EXTRA_EXCEPTION_INFO - /* Get exception cause & "badaddr" */ - NIOS2_READ_EXCEPTION(cause); - cause = ( (cause & NIOS2_EXCEPTION_REG_CAUSE_MASK) >> - NIOS2_EXCEPTION_REG_CAUSE_OFST ); - - NIOS2_READ_BADADDR(badaddr); -#else - cause = NIOS2_EXCEPTION_CAUSE_NOT_PRESENT; - badaddr = 0; -#endif /* NIOS2_HAS_EXTRA_EXCEPTION_INFO */ - - if(alt_instruction_exception_handler) { - /* - * Call handler. Its return value indicates whether the exception-causing - * instruction should be re-issued. The code that called us, - * alt_eceptions_entry.S, will look at this value and adjust the ea - * register as necessary - */ - return alt_instruction_exception_handler(cause, exception_pc, badaddr); - } - /* - * We got here because an instruction-generated exception occured, but no - * handler is present. We do not presume to know how to handle it. If the - * debugger is present, break, otherwise hang. - * - * If you've reached here in the debugger, consider examining the - * EXCEPTIONS register cause bit-field, which was read into the 'cause' - * variable above, and compare it against the exceptions-type enumeration - * in alt_exceptions.h. This register is availabe if the MMU or MPU is - * present, or if the "Extra exceptions information" hardware option is - * selected. - * - * If you get here then one of the following could have happened: - * - * - An instruction-generated exception occured, and the processor - * does not have the extra exceptions feature enabled, or you - * have not registered a handler using - * alt_instruction_exception_register() - * - * Some examples of instruction-generated exceptions and why they - * might occur: - * - * - Your program could have been compiled for a full-featured - * Nios II core, but it is running on a smaller core, and - * instruction emulation has been disabled by defining - * ALT_NO_INSTRUCTION_EMULATION. - * - * You can work around the problem by re-enabling instruction - * emulation, or you can figure out why your program is being - * compiled for a system other than the one that it is running on. - * - * - Your program has executed a trap instruction, but has not - * implemented a handler for this instruction. - * - * - Your program has executed an illegal instruction (one which is - * not defined in the instruction set). - * - * - Your processor includes an MMU or MPU, and you have enabled it - * before registering an exception handler to service exceptions it - * generates. - * - * The problem could also be hardware related: - * - If your hardware is broken and is generating spurious interrupts - * (a peripheral which negates its interrupt output before its - * interrupt handler has been executed will cause spurious interrupts) - */ - else { -#ifdef NIOS2_HAS_DEBUG_STUB - NIOS2_BREAK(); -#else - while(1) - ; -#endif /* NIOS2_HAS_DEBUG_STUB */ - } - - /* // We should not get here. Remove compiler warning. */ - return NIOS2_EXCEPTION_RETURN_REISSUE_INST; -} - -#endif /* ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API */ - -/* - * This routine indicates whether a particular exception cause will have - * set a valid address into the BADADDR register, which is included - * in the arguments to a user-registered instruction-generated exception - * handler. Many exception types do not set valid contents in BADADDR; - * this is a convenience routine to easily test the validity of that - * argument in your handler. - * - * Note that this routine will return false (0) for cause '12', - * TLB miss. This is because there are four exception types that - * share that cause, two of which do not have a valid BADADDR. You - * must determine BADADDR's validity for these. - * - * Arguments: - * cause: The 5-bit exception cause field of the EXCEPTIONS register, - * shifted to the LSB position. You may pass the 'cause' argument - * in a handler you registered directy to this routine. - * - * Return: 1: BADADDR (bad_addr argument to handler) is valid - * 0: BADADDR is not valid - */ -int alt_exception_cause_generated_bad_addr(alt_exception_cause cause) -{ - switch (cause) { - case NIOS2_EXCEPTION_SUPERVISOR_ONLY_DATA_ADDR: - return 1; - case NIOS2_EXCEPTION_MISALIGNED_DATA_ADDR: - return 1; - case NIOS2_EXCEPTION_MISALIGNED_TARGET_PC: - return 1; - case NIOS2_EXCEPTION_TLB_READ_PERM_VIOLATION: - return 1; - case NIOS2_EXCEPTION_TLB_WRITE_PERM_VIOLATION: - return 1; - case NIOS2_EXCEPTION_MPU_DATA_REGION_VIOLATION: - return 1; - default: - return 0; - } -} diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_instruction_exception_register.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_instruction_exception_register.c deleted file mode 100644 index b059e1d..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_instruction_exception_register.c +++ /dev/null @@ -1,82 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2008 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ -#include "sys/alt_exceptions.h" -#include "alt_types.h" -#include "system.h" - -/* - * This file implements support for calling user-registered handlers for - * instruction-generated exceptions. - * - * The registry API is optionally enabled through the "Enable - * Instruction-related Exception API" HAL BSP setting, which will - * define the macro below. - */ -#ifdef ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API - -/* - * The header, alt_exception_handler_registry.h contains a struct describing - * the registered exception handler - */ -#include "priv/alt_exception_handler_registry.h" - -/* - * Pull in the exception entry assembly code. This will not be linked in - * unless this object is linked into the executable (i.e. only if - * alt_instruction_exception_register() is called). - */ -__asm__( "\n\t.globl alt_exception" ); - -/* - * alt_instruction_exception_register() is called to register a handler to - * service instruction-generated exceptions that are not handled by the - * default exception handler code (interrupts, and optionally unimplemented - * instructions and traps). - * - * Passing null (0x0) in the handler argument will disable a previously- - * registered handler. - * - * Note that if no handler is registered, exceptions that are not processed - * using the built-in handler (interrupts, and optionally unimplemented - * instructions and traps) are treated as unknown exceptions, resulting - * in either a break or an infinite loop. - */ -void alt_instruction_exception_register ( - alt_exception_result (*exception_handler)( - alt_exception_cause cause, - alt_u32 exception_pc, - alt_u32 bad_addr) ) -{ - alt_instruction_exception_handler = exception_handler; -} - -#endif /* ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API */ diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_io_redirect.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_io_redirect.c deleted file mode 100644 index 8c862f7..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_io_redirect.c +++ /dev/null @@ -1,98 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include -#include - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - - -/* - * alt_open_fd() is similar to open() in that it is used to obtain a file - * descriptor for the file named "name". The "flags" and "mode" arguments are - * identical to the "flags" and "mode" arguments of open(). - * - * The distinction between the two functions is that the file descriptor - * structure to use is passed in as an argument, rather than allocated from the - * list of free file descriptors. - * - * This is used by alt_io_redirect() to redirect the stdin, stdout and stderr - * file descriptors to point to new devices. - * - * If the device can not be succesfully opened, then the input file descriptor - * remains unchanged. - */ - -static void alt_open_fd(alt_fd* fd, const char* name, int flags, int mode) -{ - int old; - - old = open (name, flags, mode); - - if (old >= 0) - { - fd->dev = alt_fd_list[old].dev; - fd->priv = alt_fd_list[old].priv; - fd->fd_flags = alt_fd_list[old].fd_flags; - - alt_release_fd (old); - } -} - -/* - * alt_io_redirect() is called once the device/filesystem lists have been - * initialised, but before main(). Its function is to redirect standard in, - * standard out and standard error so that they point to the devices selected by - * the user (as defined in system.h). - * - * Prior to the call to this function, io is directed towards /dev/null. If - * i/o can not be redirected to the requested device, for example if the device - * does not exist, then it remains directed at /dev/null. - */ - -void alt_io_redirect(const char* stdout_dev, - const char* stdin_dev, - const char* stderr_dev) -{ - /* Redirect the channels */ - - alt_open_fd (&alt_fd_list[STDOUT_FILENO], stdout_dev, O_WRONLY, 0777); - alt_open_fd (&alt_fd_list[STDIN_FILENO], stdin_dev, O_RDONLY, 0777); - alt_open_fd (&alt_fd_list[STDERR_FILENO], stderr_dev, O_WRONLY, 0777); -} - - - - diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_ioctl.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_ioctl.c deleted file mode 100644 index f5d7ef1..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_ioctl.c +++ /dev/null @@ -1,170 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "sys/ioctl.h" -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -/* - * The ioctl() system call is provided so that application code can manipulate - * the i/o capabilities of a device in device specific ways. This is identical - * to the standard posix ioctl() function. - * - * In general this implementation simply vectors ioctl requests to the - * apropriate drivers ioctl function (as registered in the drivers alt_dev - * structure). - * - * However in the case of devices (as oposed to filesystem), the TIOCEXCL and - * TIOCNXCL requests are handled without reference to the driver. These - * requests are used to lock/release a device for exclusive access. - * - * Handling these requests centrally eases the task of device driver - * development. - * - * ALT_IOCTL is mapped onto the ioctl() system call in alt_syscall.h - */ - -#ifdef ALT_USE_DIRECT_DRIVERS - -#include "system.h" -#include "sys/alt_driver.h" - -/* - * Provide minimal version that calls ioctl routine of provided stdio devices. - */ -int ALT_IOCTL (int file, int req, void* arg) -{ -#ifdef ALT_STDIN_PRESENT - ALT_DRIVER_IOCTL_EXTERNS(ALT_STDIN_DEV); -#endif -#ifdef ALT_STDOUT_PRESENT - ALT_DRIVER_IOCTL_EXTERNS(ALT_STDOUT_DEV); -#endif -#ifdef ALT_STDERR_PRESENT - ALT_DRIVER_IOCTL_EXTERNS(ALT_STDERR_DEV); -#endif - -#if !defined(ALT_STDIN_PRESENT) && !defined(ALT_STDOUT_PRESENT) && !defined(ALT_STDERR_PRESENT) - /* Generate a link time warning, should this function ever be called. */ - ALT_STUB_WARNING(ioctl); -#endif - - switch (file) { -#ifdef ALT_STDIN_PRESENT - case 0: /* stdin file descriptor */ - return ALT_DRIVER_IOCTL(ALT_STDIN_DEV, req, arg); -#endif /* ALT_STDIN_PRESENT */ -#ifdef ALT_STDOUT_PRESENT - case 1: /* stdout file descriptor */ - return ALT_DRIVER_IOCTL(ALT_STDOUT_DEV, req, arg); -#endif /* ALT_STDOUT_PRESENT */ -#ifdef ALT_STDERR_PRESENT - case 2: /* stderr file descriptor */ - return ALT_DRIVER_IOCTL(ALT_STDERR_DEV, req, arg); -#endif /* ALT_STDERR_PRESENT */ - default: - ALT_ERRNO = EBADFD; - return -1; - } -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -int ALT_IOCTL (int file, int req, void* arg) -{ - alt_fd* fd; - int rc; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - - /* - * In the case of device drivers (not file systems) handle the TIOCEXCL - * and TIOCNXCL requests as special cases. - */ - - if (fd->fd_flags & ALT_FD_DEV) - { - if (req == TIOCEXCL) - { - rc = alt_fd_lock (fd); - goto ioctl_done; - } - else if (req == TIOCNXCL) - { - rc = alt_fd_unlock (fd); - goto ioctl_done; - } - } - - /* - * If the driver provides an ioctl() function, call that to handle the - * request, otherwise set the return code to indicate that the request - * could not be processed. - */ - - if (fd->dev->ioctl) - { - rc = fd->dev->ioctl(fd, req, arg); - } - else - { - rc = -ENOTTY; - } - } - else - { - rc = -EBADFD; - } - -ioctl_done: - - if (rc < 0) - { - ALT_ERRNO = -rc; - } - return rc; -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_irq_entry.S b/software/qsys_tutorial_mem_bsp/HAL/src/alt_irq_entry.S deleted file mode 100644 index d3efe7d..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_irq_entry.S +++ /dev/null @@ -1,108 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "system.h" - -/* - * This is the interrupt exception entry point code, which saves all the - * registers and calls the interrupt handler. It should be pulled in using - * a .globl from alt_irq_register.c. This scheme is used so that if an - * interrupt is never registered, then this code will not appear in the - * generated executable, thereby improving code footprint. - */ - - /* - * Explicitly allow the use of r1 (the assembler temporary register) - * within this code. This register is normally reserved for the use of - * the compiler. - */ - .set noat - - /* - * Pull in the exception handler register save code. - */ - .globl alt_exception - - .globl alt_irq_entry - .section .exceptions.entry.label, "xa" -alt_irq_entry: - - /* - * Section .exceptions.entry is in alt_exception_entry.S - * This saves all the caller saved registers and reads estatus into r5 - */ - - .section .exceptions.irqtest, "xa" - -#ifdef ALT_CI_INTERRUPT_VECTOR_N - /* - * Use the interrupt vector custom instruction if present to accelerate - * this code. - * If the interrupt vector custom instruction returns a negative - * value, there are no interrupts active (estatus.pie is 0 - * or ipending is 0) so assume it is a software exception. - */ - custom ALT_CI_INTERRUPT_VECTOR_N, r4, r0, r0 - blt r4, r0, .Lnot_irq -#else - /* - * Test to see if the exception was a software exception or caused - * by an external interrupt, and vector accordingly. - */ - rdctl r4, ipending - andi r2, r5, 1 - beq r2, zero, .Lnot_irq - beq r4, zero, .Lnot_irq -#endif /* ALT_CI_INTERRUPT_VECTOR_N */ - - .section .exceptions.irqhandler, "xa" - /* - * Now that all necessary registers have been preserved, call - * alt_irq_handler() to process the interrupts. - */ - - call alt_irq_handler - - .section .exceptions.irqreturn, "xa" - - br .Lexception_exit - - .section .exceptions.notirq.label, "xa" - -.Lnot_irq: - - /* - * Section .exceptions.exit is in alt_exception_entry.S - * This restores all the caller saved registers - */ - - .section .exceptions.exit.label -.Lexception_exit: - diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_irq_handler.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_irq_handler.c deleted file mode 100644 index 3253d02..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_irq_handler.c +++ /dev/null @@ -1,169 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include "system.h" - -/* - * This interrupt handler only works with an internal interrupt controller - * (IIC). Processors with an external interrupt controller (EIC) use an - * implementation provided by an EIC driver. - */ -#ifndef ALT_CPU_EIC_PRESENT - -#include "sys/alt_irq.h" -#include "os/alt_hooks.h" - -#include "alt_types.h" - -/* - * A table describing each interrupt handler. The index into the array is the - * interrupt id associated with the handler. - * - * When an interrupt occurs, the associated handler is called with - * the argument stored in the context member. - */ -struct ALT_IRQ_HANDLER -{ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - void (*handler)(void*); -#else - void (*handler)(void*, alt_u32); -#endif - void *context; -} alt_irq[ALT_NIRQ]; - -/* - * alt_irq_handler() is called by the interrupt exception handler in order to - * process any outstanding interrupts. - * - * It is defined here since it is linked in using weak linkage. - * This means that if there is never a call to alt_irq_register() (above) then - * this function will not get linked in to the executable. This is acceptable - * since if no handler is ever registered, then an interrupt can never occur. - * - * If Nios II interrupt vector custom instruction exists, use it to accelerate - * the dispatch of interrupt handlers. The Nios II interrupt vector custom - * instruction is present if the macro ALT_CI_INTERRUPT_VECTOR defined. - */ - -void alt_irq_handler (void) __attribute__ ((section (".exceptions"))); -void alt_irq_handler (void) -{ -#ifdef ALT_CI_INTERRUPT_VECTOR - alt_32 offset; - char* alt_irq_base = (char*)alt_irq; -#else - alt_u32 active; - alt_u32 mask; - alt_u32 i; -#endif /* ALT_CI_INTERRUPT_VECTOR */ - - /* - * Notify the operating system that we are at interrupt level. - */ - - ALT_OS_INT_ENTER(); - -#ifdef ALT_CI_INTERRUPT_VECTOR - /* - * Call the interrupt vector custom instruction using the - * ALT_CI_INTERRUPT_VECTOR macro. - * It returns the offset into the vector table of the lowest-valued pending - * interrupt (corresponds to highest priority) or a negative value if none. - * The custom instruction assumes that each table entry is eight bytes. - */ - while ((offset = ALT_CI_INTERRUPT_VECTOR) >= 0) { - struct ALT_IRQ_HANDLER* handler_entry = - (struct ALT_IRQ_HANDLER*)(alt_irq_base + offset); -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - handler_entry->handler(handler_entry->context); -#else - handler_entry->handler(handler_entry->context, offset >> 3); -#endif - } -#else /* ALT_CI_INTERRUPT_VECTOR */ - /* - * Obtain from the interrupt controller a bit list of pending interrupts, - * and then process the highest priority interrupt. This process loops, - * loading the active interrupt list on each pass until alt_irq_pending() - * return zero. - * - * The maximum interrupt latency for the highest priority interrupt is - * reduced by finding out which interrupts are pending as late as possible. - * Consider the case where the high priority interupt is asserted during - * the interrupt entry sequence for a lower priority interrupt to see why - * this is the case. - */ - - active = alt_irq_pending (); - - do - { - i = 0; - mask = 1; - - /* - * Test each bit in turn looking for an active interrupt. Once one is - * found, the interrupt handler asigned by a call to alt_irq_register() is - * called to clear the interrupt condition. - */ - - do - { - if (active & mask) - { -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - alt_irq[i].handler(alt_irq[i].context); -#else - alt_irq[i].handler(alt_irq[i].context, i); -#endif - break; - } - mask <<= 1; - i++; - - } while (1); - - active = alt_irq_pending (); - - } while (active); -#endif /* ALT_CI_INTERRUPT_VECTOR */ - - /* - * Notify the operating system that interrupt processing is complete. - */ - - ALT_OS_INT_EXIT(); -} - -#endif /* ALT_CPU_EIC_PRESENT */ diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_irq_register.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_irq_register.c deleted file mode 100644 index b5ea474..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_irq_register.c +++ /dev/null @@ -1,102 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ -#include -#include "system.h" - -/* - * This interrupt registry mechanism works with the Nios II internal interrupt - * controller (IIC) only. Systems with an external interrupt controller (EIC), - * or those with the IIC who are using the enhanced interrupt API will - * utilize the alt_ic_isr_register() routine to register an interrupt. - */ -#ifndef NIOS2_EIC_PRESENT - -#include "sys/alt_irq.h" -#include "priv/alt_legacy_irq.h" -#include "os/alt_hooks.h" - -#include "alt_types.h" - -/* - * The header, alt_irq_entry.h, contains the exception entry point, and is - * provided by the processor component. It is included here, so that the code - * will be added to the executable only if alt_irq_register() is present, i.e. - * if no interrupts are registered - there's no need to provide any - * interrupt handling. - */ - -#include "sys/alt_irq_entry.h" - -/* - * The header, alt_irq_table.h contains a table describing which function - * handles each interrupt. - */ - -#include "priv/alt_irq_table.h" - -/* - * alt_irq_handler() is called to register an interrupt handler. If the - * function is succesful, then the requested interrupt will be enabled upon - * return. Registering a NULL handler will disable the interrupt. - * - * The return value is 0 if the interrupt handler was registered and the - * interrupt was enabled, otherwise it is negative. - */ - -int alt_irq_register (alt_u32 id, - void* context, - alt_isr_func handler) -{ - int rc = -EINVAL; - alt_irq_context status; - - if (id < ALT_NIRQ) - { - /* - * interrupts are disabled while the handler tables are updated to ensure - * that an interrupt doesn't occur while the tables are in an inconsistant - * state. - */ - - status = alt_irq_disable_all (); - - alt_irq[id].handler = handler; - alt_irq[id].context = context; - - rc = (handler) ? alt_irq_enable (id): alt_irq_disable (id); - - alt_irq_enable_all(status); - } - return rc; -} -#endif /* NIOS2_EIC_PRESENT */ - diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_irq_vars.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_irq_vars.c deleted file mode 100644 index 8c0a18d..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_irq_vars.c +++ /dev/null @@ -1,47 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "alt_types.h" - -#include "system.h" - -/* - * These global variables are used to save the current list of enabled - * interrupts. See alt_irq.h for further details. - */ - -volatile alt_u32 alt_irq_active = 0; - -#ifndef ALT_EXCEPTION_STACK - -volatile alt_u32 alt_priority_mask = (alt_u32) -1; - -#endif - diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_isatty.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_isatty.c deleted file mode 100644 index 9276472..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_isatty.c +++ /dev/null @@ -1,125 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include "sys/alt_dev.h" -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -#ifdef ALT_USE_DIRECT_DRIVERS - -#include "system.h" - -/* - * Provide minimal version that just describes all file descriptors - * as tty devices for provided stdio devices. - */ -int ALT_ISATTY (int file) -{ - switch (file) { -#ifdef ALT_STDIN_PRESENT - case 0: /* stdin file descriptor */ -#endif /* ALT_STDIN_PRESENT */ -#ifdef ALT_STDOUT_PRESENT - case 1: /* stdout file descriptor */ -#endif /* ALT_STDOUT_PRESENT */ -#ifdef ALT_STDERR_PRESENT - case 2: /* stderr file descriptor */ -#endif /* ALT_STDERR_PRESENT */ - return 1; - default: - return 0; - } - -#if !defined(ALT_STDIN_PRESENT) && !defined(ALT_STDOUT_PRESENT) && !defined(ALT_STDERR_PRESENT) - /* Generate a link time warning, should this function ever be called. */ - ALT_STUB_WARNING(isatty); -#endif -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ -/* - * isatty() can be used to determine whether the input file descriptor "file" - * refers to a terminal device or not. If it is a terminal device then the - * return value is one, otherwise it is zero. - * - * ALT_ISATTY is mapped onto the isatty() system call in alt_syscall.h - */ - -int ALT_ISATTY (int file) -{ - alt_fd* fd; - struct stat stat; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - /* - * If a device driver does not provide an fstat() function, then it is - * treated as a terminal device by default. - */ - - if (!fd->dev->fstat) - { - return 1; - } - - /* - * If a driver does provide an implementation of the fstat() function, then - * this is called so that the device can identify itself. - */ - - else - { - fstat (file, &stat); - return (stat.st_mode == _IFCHR) ? 1 : 0; - } - } - else - { - ALT_ERRNO = EBADFD; - return 0; - } -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_kill.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_kill.c deleted file mode 100644 index 42c2e1d..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_kill.c +++ /dev/null @@ -1,121 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include "sys/alt_errno.h" -#include "os/alt_syscall.h" - - -/* - * kill() is used by newlib in order to send signals to processes. Since there - * is only a single process in the HAL, the only valid values for pid are - * either the current process id, or the broadcast values, i.e. pid must be - * less than or equal to zero. - * - * ALT_KILL is mapped onto the kill() system call in alt_syscall.h - */ - -int ALT_KILL (int pid, int sig) -{ - int status = 0; - - if (pid <= 0) - { - switch (sig) - { - case 0: - - /* The null signal is used to check that a pid is valid. */ - - break; - - case SIGABRT: - case SIGALRM: - case SIGFPE: - case SIGILL: - case SIGKILL: - case SIGPIPE: - case SIGQUIT: - case SIGSEGV: - case SIGTERM: - case SIGUSR1: - case SIGUSR2: - case SIGBUS: - case SIGPOLL: - case SIGPROF: - case SIGSYS: - case SIGTRAP: - case SIGVTALRM: - case SIGXCPU: - case SIGXFSZ: - - /* - * The Posix standard defines the default behaviour for all these signals - * as being eqivalent to a call to _exit(). No mechanism is provided to - * change this behaviour. - */ - - _exit(0); - case SIGCHLD: - case SIGURG: - - /* - * The Posix standard defines these signals to be ignored by default. No - * mechanism is provided to change this behaviour. - */ - - break; - default: - - /* Tried to send an unsupported signal */ - - status = EINVAL; - } - } - - else if (pid > 0) - { - /* Attempted to signal a non-existant process */ - - status = ESRCH; - } - - if (status) - { - ALT_ERRNO = status; - return -1; - } - - return 0; -} diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_link.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_link.c deleted file mode 100644 index d796c59..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_link.c +++ /dev/null @@ -1,56 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_warning.h" -#include "sys/alt_errno.h" -#include "os/alt_syscall.h" - -/* - * link() is used by newlib to create a new link to an existing file. This is - * unsupported in the HAL environment. However a "do-nothing" implementation - * is still provied for newlib compatability. - * - * ALT_LINK is mapped onto the link() system call in alt_syscall.h - */ - -int ALT_LINK ( char *existing, char *new) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(link); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} - diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_load.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_load.c deleted file mode 100644 index ffab4b9..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_load.c +++ /dev/null @@ -1,88 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_load.h" -#include "sys/alt_cache.h" - -/* - * Linker defined symbols. - */ - -extern void __flash_rwdata_start; -extern void __ram_rwdata_start; -extern void __ram_rwdata_end; -extern void __flash_rodata_start; -extern void __ram_rodata_start; -extern void __ram_rodata_end; -extern void __flash_exceptions_start; -extern void __ram_exceptions_start; -extern void __ram_exceptions_end; - -/* - * alt_load() is called when the code is executing from flash. In this case - * there is no bootloader, so this application is responsible for loading to - * RAM any sections that are required. - */ - -void alt_load (void) -{ - /* - * Copy the .rwdata section. - */ - - alt_load_section (&__flash_rwdata_start, - &__ram_rwdata_start, - &__ram_rwdata_end); - - /* - * Copy the exception handler. - */ - - alt_load_section (&__flash_exceptions_start, - &__ram_exceptions_start, - &__ram_exceptions_end); - - /* - * Copy the .rodata section. - */ - - alt_load_section (&__flash_rodata_start, - &__ram_rodata_start, - &__ram_rodata_end); - - /* - * Now ensure that the caches are in synch. - */ - - alt_dcache_flush_all(); - alt_icache_flush_all(); -} diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_log_macro.S b/software/qsys_tutorial_mem_bsp/HAL/src/alt_log_macro.S deleted file mode 100644 index 499c4ad..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_log_macro.S +++ /dev/null @@ -1,56 +0,0 @@ -/* alt_log_macro.S - * - * Implements the function tx_log_str, called by the assembly macro - * ALT_LOG_PUTS(). The macro will be empty when logging is turned off, - * and this function will not be compiled. When logging is on, - * this function is used to print out the strings defined in the beginning - * of alt_log_printf.c, using port information taken from system.h and - * alt_log_printf.h. - * - * This routine only handles strings, and sends a character into the defined - * output device's output buffer when the device is ready. It's intended for - * debugging purposes, where messages can be set to print out at certain - * points in the boot code to indicate the progress of the program. - * - */ - -#ifndef __ALT_LOG_MACROS__ -#define __ALT_LOG_MACROS__ - -/* define this flag to skip assembly-incompatible parts - * of various include files. */ -#define ALT_ASM_SRC - -#ifdef ALT_LOG_ENABLE // only compile this function if this flag is defined. - - #include "system.h" - #include "sys/alt_log_printf.h" - - .global tx_log_str -tx_log_str: - /* load base uart / jtag uart address into r6 */ - movhi r6, %hiadj(ALT_LOG_PORT_BASE) - addi r6, r6, %lo(ALT_LOG_PORT_BASE) -tx_next_char: - /* if pointer points to null, return - * r4 is the pointer to the str to be printed, set by ALT_LOG_PUTS */ - ldb r7, (r4) - beq r0, r7, end_tx - - /* check device transmit ready */ -wait_tx_ready_loop: - ldwio r5, ALT_LOG_PRINT_REG_OFFSET(r6) - andi r5, r5, ALT_LOG_PRINT_MSK - beq r5, r0, wait_tx_ready_loop - /* write char */ - stwio r7, ALT_LOG_PRINT_TXDATA_REG_OFFSET (r6) - /* advance string pointer */ - addi r4, r4, 1 - br tx_next_char -end_tx: - ret - -#endif - -#endif /* __ALT_LOG_MACROS__ */ - diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_log_printf.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_log_printf.c deleted file mode 100644 index 1f7056d..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_log_printf.c +++ /dev/null @@ -1,479 +0,0 @@ - -/* alt_log_printf.c - * - * This file implements the various C functions used for the - * alt_log logging/debugging print functions. The functions - * sit as is here - the job of hiding them from the compiler - * if logging is disabled is accomplished in the .h file. - * - * All the global variables for alt_log are defined here. - * These include the various flags that turn on additional - * logging options; the strings for assembly printing; and - * other globals needed by different logging options. - * - * There are 4 functions that handle the actual printing: - * alt_log_txchar: Actual function that puts 1 char to UART/JTAG UART. - * alt_log_repchar: Calls alt_log_txchar 'n' times - used by - * alt_log_private_printf for formatting. - * alt_log_private_printf: - * Stripped down implementation of printf - no floats. - * alt_log_printf_proc: - * Wrapper function for private_printf. - * - * The rest of the functions are called by the macros which - * were called by code in the other components. Each function - * is preceded by a comment, about which file it gets called - * in, and what its purpose is. - * - * author: gkwan - */ - -/* skip all code if enable is off */ -#ifdef ALT_LOG_ENABLE - -#include -#include -#include -#ifdef __ALTERA_AVALON_JTAG_UART - #include "altera_avalon_jtag_uart.h" - #include -#endif -#include "sys/alt_log_printf.h" - -/* strings for assembly puts */ -char alt_log_msg_bss[] = "[crt0.S] Clearing BSS \r\n";; -char alt_log_msg_alt_main[] = "[crt0.S] Calling alt_main.\r\n"; -char alt_log_msg_stackpointer[] \ - = "[crt0.S] Setting up stack and global pointers.\r\n"; -char alt_log_msg_cache[] = "[crt0.S] Inst & Data Cache Initialized.\r\n"; -/* char array allocation for alt_write */ -char alt_log_write_buf[ALT_LOG_WRITE_ECHO_LEN+2]; - -/* global variables for all 'on' flags */ - -/* - * The boot message flag is linked into the data (rwdata) section - * because if it is zero, it would otherwise be placed in the bss section. - * alt_log examines this variable before the BSS is cleared in the boot-up - * process. - */ -volatile alt_u32 alt_log_boot_on_flag \ - __attribute__ ((section (".data"))) = ALT_LOG_BOOT_ON_FLAG_SETTING; - -volatile alt_u8 alt_log_write_on_flag = ALT_LOG_WRITE_ON_FLAG_SETTING; - -volatile alt_u8 alt_log_sys_clk_on_flag = ALT_LOG_SYS_CLK_ON_FLAG_SETTING; - -volatile alt_u8 alt_log_jtag_uart_alarm_on_flag = \ - ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING; - -volatile alt_u8 alt_log_jtag_uart_isr_on_flag = \ - ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING; - -volatile alt_u8 alt_log_jtag_uart_startup_info_on_flag = \ - ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING; - -/* Global alarm object for recurrent JTAG UART status printing */ -alt_alarm alt_log_jtag_uart_alarm_1; - -/* Global ints for system clock printing and count */ -volatile int alt_log_sys_clk_count; -volatile int alt_system_clock_in_sec; - -/* enum used by alt_log_private_printf */ -enum -{ - pfState_chars, - pfState_firstFmtChar, - pfState_otherFmtChar -}; - - - - -/* Function to put one char onto the UART/JTAG UART txdata register. */ -void alt_log_txchar(int c,char *base) -{ - /* Wait until the device is ready for a character */ - while((ALT_LOG_PRINT_REG_RD(base) & ALT_LOG_PRINT_MSK) == 0) - ; - /* And pop the character into the register */ - ALT_LOG_PRINT_TXDATA_WR(base,c); -} - - -/* Called by alt_log_private_printf to print out characters repeatedly */ -void alt_log_repchar(char c,int r,int base) -{ - while(r-- > 0) - alt_log_txchar(c,(char*) base); -} - - -/* Stripped down printf function */ -void alt_log_private_printf(const char *fmt,int base,va_list args) - { - const char *w; - char c; - int state; - int fmtLeadingZero = 0; /* init these all to 0 for -W warnings. */ - int fmtLong = 0; - int fmtBeforeDecimal = 0; - int fmtAfterDecimal = 0; - int fmtBase = 0; - int fmtSigned = 0; - int fmtCase = 0; /* For hex format, if 1, A-F, else a-f. */ - - w = fmt; - state = pfState_chars; - - while(0 != (c = *w++)) - { - switch(state) - { - case pfState_chars: - if(c == '%') - { - fmtLeadingZero = 0; - fmtLong = 0; - fmtBase = 10; - fmtSigned = 1; - fmtCase = 0; /* Only %X sets this. */ - fmtBeforeDecimal = -1; - fmtAfterDecimal = -1; - state = pfState_firstFmtChar; - } - else - { - alt_log_txchar(c,(char*)base); - } - break; - - case pfState_firstFmtChar: - if(c == '0') - { - fmtLeadingZero = 1; - state = pfState_otherFmtChar; - } - else if(c == '%') - { - alt_log_txchar(c,(char*)base); - state = pfState_chars; - } - else - { - state = pfState_otherFmtChar; - goto otherFmtChar; - } - break; - - case pfState_otherFmtChar: -otherFmtChar: - if(c == '.') - { - fmtAfterDecimal = 0; - } - else if('0' <= c && c <= '9') - { - c -= '0'; - if(fmtAfterDecimal < 0) /* still before decimal */ - { - if(fmtBeforeDecimal < 0) - { - fmtBeforeDecimal = 0; - } - else - { - fmtBeforeDecimal *= 10; - } - fmtBeforeDecimal += c; - } - else - { - fmtAfterDecimal = (fmtAfterDecimal * 10) + c; - } - } - else if(c == 'l') - { - fmtLong = 1; - } - else /* we're up to the letter which determines type */ - { - switch(c) - { - case 'd': - case 'i': -doIntegerPrint: - { - unsigned long v; - unsigned long p; /* biggest power of fmtBase */ - unsigned long vShrink; /* used to count digits */ - int sign; - int digitCount; - - /* Get the value */ - if(fmtLong) - { - if (fmtSigned) - { - v = va_arg(args,long); - } - else - { - v = va_arg(args,unsigned long); - } - } - else - { - if (fmtSigned) - { - v = va_arg(args,int); - } - else - { - v = va_arg(args,unsigned int); - } - } - - /* Strip sign */ - sign = 0; - /* (assumes sign bit is #31) */ - if( fmtSigned && (v & (0x80000000)) ) - { - v = ~v + 1; - sign = 1; - } - - /* Count digits, and get largest place value */ - vShrink = v; - p = 1; - digitCount = 1; - while( (vShrink = vShrink / fmtBase) > 0 ) - { - digitCount++; - p *= fmtBase; - } - - /* Print leading characters & sign */ - fmtBeforeDecimal -= digitCount; - if(fmtLeadingZero) - { - if(sign) - { - alt_log_txchar('-',(char*)base); - fmtBeforeDecimal--; - } - alt_log_repchar('0',fmtBeforeDecimal,base); - } - else - { - if(sign) - { - fmtBeforeDecimal--; - } - alt_log_repchar(' ',fmtBeforeDecimal,base); - if(sign) - { - alt_log_txchar('-',(char*)base); - } - } - - /* Print numbery parts */ - while(p) - { - unsigned char d; - - d = v / p; - d += '0'; - if(d > '9') - { - d += (fmtCase ? 'A' : 'a') - '0' - 10; - } - alt_log_txchar(d,(char*)base); - - v = v % p; - p = p / fmtBase; - } - } - - state = pfState_chars; - break; - - case 'u': - fmtSigned = 0; - goto doIntegerPrint; - case 'o': - fmtSigned = 0; - fmtBase = 8; - goto doIntegerPrint; - case 'x': - fmtSigned = 0; - fmtBase = 16; - goto doIntegerPrint; - case 'X': - fmtSigned = 0; - fmtBase = 16; - fmtCase = 1; - goto doIntegerPrint; - - case 'c': - alt_log_repchar(' ',fmtBeforeDecimal-1,base); - alt_log_txchar(va_arg(args,int),(char*)base); - break; - - case 's': - { - char *s; - - s = va_arg(args,char *); - alt_log_repchar(' ',fmtBeforeDecimal-strlen(s),base); - - while(*s) - alt_log_txchar(*s++,(char*)base); - } - break; - } /* switch last letter of fmt */ - state=pfState_chars; - } - break; - } /* switch */ - } /* while chars left */ - } /* printf */ - -/* Main logging printf function */ -int alt_log_printf_proc(const char *fmt, ... ) -{ - va_list args; - - va_start (args, fmt); - alt_log_private_printf(fmt,ALT_LOG_PORT_BASE,args); - return (0); -} - -/* Below are the functions called by different macros in various components. */ - -/* If the system has a JTAG_UART, include JTAG_UART debugging functions */ -#ifdef __ALTERA_AVALON_JTAG_UART - -/* The alarm function in altera_avalon_jtag_uart.c. - * This function, when turned on, prints out the status - * of the JTAG UART Control register, every ALT_LOG_JTAG_UART_TICKS. - * If the flag is off, the alarm should never be registered, and this - * function should never run */ -alt_u32 altera_avalon_jtag_uart_report_log(void * context) -{ - if (alt_log_jtag_uart_alarm_on_flag) { - altera_avalon_jtag_uart_state* dev = (altera_avalon_jtag_uart_state*) context; - const char* header="JTAG Alarm:"; - alt_log_jtag_uart_print_control_reg(dev, dev->base, header); - return ALT_LOG_JTAG_UART_TICKS; - } - else - { - /* If flag is not on, return 0 to disable future alarms. - * Should never be here, alarm should not be enabled at all. */ - return 0; - } -} - -void alt_log_jtag_uart_print_control_reg(altera_avalon_jtag_uart_state* dev, int base, const char* header) -{ - unsigned int control, space, ac, wi, ri, we, re; - control = IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base); - space = (control & ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_MSK) >> - ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_OFST; - we= (control & ALTERA_AVALON_JTAG_UART_CONTROL_WE_MSK) >> - ALTERA_AVALON_JTAG_UART_CONTROL_WE_OFST; - re= (control & ALTERA_AVALON_JTAG_UART_CONTROL_RE_MSK) >> - ALTERA_AVALON_JTAG_UART_CONTROL_RE_OFST; - ri= (control & ALTERA_AVALON_JTAG_UART_CONTROL_RI_MSK) >> - ALTERA_AVALON_JTAG_UART_CONTROL_RI_OFST; - wi= (control & ALTERA_AVALON_JTAG_UART_CONTROL_WI_MSK) >> - ALTERA_AVALON_JTAG_UART_CONTROL_WI_OFST; - ac= (control & ALTERA_AVALON_JTAG_UART_CONTROL_AC_MSK) >> - ALTERA_AVALON_JTAG_UART_CONTROL_AC_OFST; - -#ifdef ALTERA_AVALON_JTAG_UART_SMALL - ALT_LOG_PRINTF( - "%s HW FIFO wspace=%d AC=%d WI=%d RI=%d WE=%d RE=%d\r\n", - header,space,ac,wi,ri,we,re); -#else - ALT_LOG_PRINTF( - "%s SW CirBuf = %d, HW FIFO wspace=%d AC=%d WI=%d RI=%d WE=%d RE=%d\r\n", - header,(dev->tx_out-dev->tx_in),space,ac,wi,ri,we,re); -#endif - - return; - -} - -/* In altera_avalon_jtag_uart.c - * Same output as the alarm function above, but this is called in the driver - * init function. Hence, it gives the status of the JTAG UART control register - * right at the initialization of the driver */ -void alt_log_jtag_uart_startup_info(altera_avalon_jtag_uart_state* dev, int base) -{ - const char* header="JTAG Startup Info:"; - alt_log_jtag_uart_print_control_reg(dev, base, header); - return; -} - -/* In altera_avalon_jtag_uart.c - * When turned on, this function will print out the status of the jtag uart - * control register every time there is a jtag uart "almost-empty" interrupt. */ -void alt_log_jtag_uart_isr_proc(int base, altera_avalon_jtag_uart_state* dev) -{ - if (alt_log_jtag_uart_isr_on_flag) { - const char* header="JTAG IRQ:"; - alt_log_jtag_uart_print_control_reg(dev, base, header); - } - return; -} - -#endif /* __ALTERA_AVALON_JTAG_UART */ - -/* In alt_write.c - * When the alt_log_write_on_flag is turned on, this function gets called - * every time alt_write gets called. The first - * ALT_LOG_WRITE_ECHO_LEN characters of every printf command (or any command - * that eventually calls write()) gets echoed to the alt_log output. */ -void alt_log_write(const void *ptr, size_t len) -{ - if (alt_log_write_on_flag) { - int temp_cnt; - int length=(ALT_LOG_WRITE_ECHO_LEN>len) ? len : ALT_LOG_WRITE_ECHO_LEN; - - if (length < 2) return; - - strncpy (alt_log_write_buf,ptr,length); - alt_log_write_buf[length-1]='\n'; - alt_log_write_buf[length]='\r'; - alt_log_write_buf[length+1]='\0'; - - /* Escape Ctrl-D's. If the Ctrl-D gets sent it might kill the terminal - * connection of alt_log. It will get replaced by 'D'. */ - for (temp_cnt=0;temp_cnt < length; temp_cnt++) { - if (alt_log_write_buf[temp_cnt]== 0x4) { - alt_log_write_buf[temp_cnt]='D'; - } - } - ALT_LOG_PRINTF("Write Echo: %s",alt_log_write_buf); - } -} - -/* In altera_avalon_timer_sc - * This function prints out a system clock is alive message - * every ALT_LOG_SYS_CLK_INTERVAL (in ticks). */ -void alt_log_system_clock() -{ - if (alt_log_sys_clk_on_flag) { - alt_log_sys_clk_count++; - if (alt_log_sys_clk_count > ALT_LOG_SYS_CLK_INTERVAL) { - alt_log_sys_clk_count = 0; - ALT_LOG_PRINTF("System Clock On %u\r\n",alt_system_clock_in_sec++); - } - } -} - - -#endif diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_lseek.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_lseek.c deleted file mode 100644 index 7857b0d..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_lseek.c +++ /dev/null @@ -1,117 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -#ifdef ALT_USE_DIRECT_DRIVERS - -off_t ALT_LSEEK (int file, off_t ptr, int dir) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(lseek); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -/* - * lseek() can be called to move the read/write pointer associated with the - * file descriptor "file". This function simply vectors the call to the lseek() - * function provided by the driver associated with the file descriptor. - * - * If the driver does not provide an implementation of lseek() an error is - * indicated. - * - * lseek() corresponds to the standard lseek() function. - * - * ALT_LSEEK is mapped onto the lseek() system call in alt_syscall.h - * - */ - -off_t ALT_LSEEK (int file, off_t ptr, int dir) -{ - alt_fd* fd; - off_t rc = 0; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - /* - * If the device driver provides an implementation of the lseek() function, - * then call that to process the request. - */ - - if (fd->dev->lseek) - { - rc = fd->dev->lseek(fd, ptr, dir); - } - /* - * Otherwise return an error. - */ - - else - { - rc = -ENOTSUP; - } - } - else - { - rc = -EBADFD; - } - - if (rc < 0) - { - ALT_ERRNO = -rc; - rc = -1; - } - - return rc; -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_main.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_main.c deleted file mode 100644 index a96229b..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_main.c +++ /dev/null @@ -1,161 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include -#include -#include -#include - -#include "sys/alt_dev.h" -#include "sys/alt_sys_init.h" -#include "sys/alt_irq.h" -#include "sys/alt_dev.h" - -#include "os/alt_hooks.h" - -#include "priv/alt_file.h" -#include "alt_types.h" - -#include "system.h" - -#include "sys/alt_log_printf.h" - -extern void _do_ctors(void); -extern void _do_dtors(void); - -/* - * Standard arguments for main. By default, no arguments are passed to main. - * However a device driver may choose to configure these arguments by calling - * alt_set_args(). The expectation is that this facility will only be used by - * the iclient/ihost utility. - */ - -int alt_argc = 0; -char** alt_argv = {NULL}; -char** alt_envp = {NULL}; - -/* - * Prototype for the entry point to the users application. - */ - -extern int main (int, char **, char **); - -/* - * alt_main is the C entry point for the HAL. It is called by the assembler - * startup code in the processor specific crt0.S. It is responsible for: - * completing the C runtime configuration; configuring all the - * devices/filesystems/components in the system; and call the entry point for - * the users application, i.e. main(). - */ - -void alt_main (void) -{ -#ifndef ALT_NO_EXIT - int result; -#endif - - /* ALT LOG - please see HAL/sys/alt_log_printf.h for details */ - ALT_LOG_PRINT_BOOT("[alt_main.c] Entering alt_main, calling alt_irq_init.\r\n"); - /* Initialize the interrupt controller. */ - alt_irq_init (NULL); - - /* Initialize the operating system */ - ALT_LOG_PRINT_BOOT("[alt_main.c] Done alt_irq_init, calling alt_os_init.\r\n"); - ALT_OS_INIT(); - - /* - * Initialize the semaphore used to control access to the file descriptor - * list. - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Done OS Init, calling alt_sem_create.\r\n"); - ALT_SEM_CREATE (&alt_fd_list_lock, 1); - - /* Initialize the device drivers/software components. */ - ALT_LOG_PRINT_BOOT("[alt_main.c] Calling alt_sys_init.\r\n"); - alt_sys_init(); - ALT_LOG_PRINT_BOOT("[alt_main.c] Done alt_sys_init.\r\n"); - -#if !defined(ALT_USE_DIRECT_DRIVERS) && (defined(ALT_STDIN_PRESENT) || defined(ALT_STDOUT_PRESENT) || defined(ALT_STDERR_PRESENT)) - - /* - * Redirect stdio to the apropriate devices now that the devices have - * been initialized. This is only done if the user has requested these - * devices be present (not equal to /dev/null) and if direct drivers - * aren't being used. - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Redirecting IO.\r\n"); - alt_io_redirect(ALT_STDOUT, ALT_STDIN, ALT_STDERR); -#endif - -#ifndef ALT_NO_C_PLUS_PLUS - /* - * Call the C++ constructors - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Calling C++ constructors.\r\n"); - _do_ctors (); -#endif /* ALT_NO_C_PLUS_PLUS */ - -#if !defined(ALT_NO_C_PLUS_PLUS) && !defined(ALT_NO_CLEAN_EXIT) && !defined(ALT_NO_EXIT) - /* - * Set the C++ destructors to be called at system shutdown. This is only done - * if a clean exit has been requested (i.e. the exit() function has not been - * redefined as _exit()). This is in the interest of reducing code footprint, - * in that the atexit() overhead is removed when it's not needed. - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Calling atexit.\r\n"); - atexit (_do_dtors); -#endif - - /* - * Finally, call main(). The return code is then passed to a subsequent - * call to exit() unless the application is never supposed to exit. - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Calling main.\r\n"); - -#ifdef ALT_NO_EXIT - main (alt_argc, alt_argv, alt_envp); -#else - result = main (alt_argc, alt_argv, alt_envp); - close(STDOUT_FILENO); - exit (result); -#endif - - ALT_LOG_PRINT_BOOT("[alt_main.c] After main - we should not be here?.\r\n"); -} - diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_malloc_lock.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_malloc_lock.c deleted file mode 100644 index 8c78f46..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_malloc_lock.c +++ /dev/null @@ -1,52 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -/* - * These are the empty malloc lock/unlock stubs required by newlib. These are - * used to make newlib's malloc() function thread safe. The default HAL - * configuration is single threaded, so there is nothing to do here. Note that - * this requires that malloc is never called by an interrupt service routine. - */ - -void __malloc_lock ( struct _reent *_r ) -{ -} - -/* - * - */ - -void __malloc_unlock ( struct _reent *_r ) -{ -} diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_mcount.S b/software/qsys_tutorial_mem_bsp/HAL/src/alt_mcount.S deleted file mode 100644 index 3837523..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_mcount.S +++ /dev/null @@ -1,198 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2010 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* mcount or _mcount is inserted by GCC before the function prologue of every - * function when a program is compiled for profiling. At the start of mcount, - * we guarantee that: - * ra = self_pc (an address in the function which called mcount) - * r8 = from_pc (an address in the function which called mcount's caller) - * - * Because this is always called at the start of a function we can corrupt - * r2,r3 and r11-r15. We must not corrupt r4-r7 (because they might contain - * function arguments for the instrumented function) or r8 (which holds ra - * for the instrumented function). - */ - - .global __mcount_fn_head - - .global mcount - - /* _mcount is used by gcc4 */ - .global _mcount - -_mcount: -mcount: - /* Use a hash to speed up locating fn_entry. We use bits 5 upwards to choose - * the bucket because bits 1:0 will always be 0, and because the distribution - * of values for bits 4:2 won't be even (aligning on cache line boundaries - * will skew it). Higher bits should be fairly random. - */ - /* fn_head = mcount_fn_head + (((unsigned int)self_pc >> 5) & (HASH_BUCKETS - 1)); */ - - srli r2, ra, 3 - movhi r3, %hiadj(__mcount_fn_head) - addi r3, r3, %lo(__mcount_fn_head) - andi r2, r2, 0xFC - add r11, r2, r3 - - /* The fast case is where we have already allocated a function arc, and so - * also a function pointer. - */ - - /* First find the function being called (using self_pc) */ - mov r10, r11 -0: - ldw r10, 0(r10) - beq r10, zero, .Lnew_arc - ldw r2, 4(r10) - bne r2, ra, 0b - - /* Found a function entry for this PC. Now look for an arc with a matching - * from_pc value. There will always be at least one arc. */ - ldw r3, 8(r10) -0: - ldw r2, 4(r3) - beq r2, r8, .Lfound_arc - ldw r3, 0(r3) - bne r3, zero, 0b - -.Lnew_arc: - addi sp, sp, -24 - -.LCFI0: - stw ra, 0(sp) - stw r4, 4(sp) - stw r5, 8(sp) - stw r6, 12(sp) - stw r7, 16(sp) - stw r8, 20(sp) - -.LCFI1: - /* __mcount_record(orig_ra, orig_r8, fn_entry, *fn_head); */ - mov r4, ra - mov r5, r8 - mov r6, r10 - mov r7, r11 - call __mcount_record - - /* restore registers from the stack */ - ldw ra, 0(sp) - ldw r4, 4(sp) - ldw r5, 8(sp) - ldw r6, 12(sp) - ldw r7, 16(sp) - ldw r8, 20(sp) - - addi sp, sp, 24 - -.LCFI2: - ret - -.Lfound_arc: - /* We've found the correct arc record. Increment the count and return */ - ldw r2, 8(r3) - addi r2, r2, 1 - stw r2, 8(r3) - ret - -.Lmcount_end: - - - -/* - * Dwarf2 debug information for the function. This provides GDB with the - * information it needs to backtrace out of this function. - */ - - .section .debug_frame,"",@progbits -.LCIE: - .4byte 2f - 1f /* Length */ -1: - .4byte 0xffffffff /* CIE id */ - .byte 0x1 /* Version */ - .string "" /* Augmentation */ - .uleb128 0x1 /* Code alignment factor */ - .sleb128 -4 /* Data alignment factor */ - .byte 0x1f /* Return address register */ - - .byte 0xc /* Define CFA */ - .uleb128 0x1b /* Register 27 (sp) */ - .uleb128 0x0 /* Offset 0 */ - - .align 2 /* Padding */ -2: - -.LFDE_mcount: - .4byte 2f - 1f /* Length */ -1: - .4byte .LCIE /* Pointer to CIE */ - .4byte mcount /* Start of table entry */ - .4byte .Lmcount_end - mcount /* Size of table entry */ - - .byte 0x4 /* Advance location */ - .4byte .LCFI0 - mcount /* to .LCFI0 */ - .byte 0xe /* Define CFA offset */ - .uleb128 24 /* to 24 */ - - .byte 0x4 /* Advance location */ - .4byte .LCFI1 - .LCFI0 /* to .LCFI1 */ - .byte 0x9f /* Store ra */ - .uleb128 0x6 /* at CFA-24 */ - .byte 0x84 /* Store r4 */ - .uleb128 0x5 /* at CFA-20 */ - .byte 0x85 /* Store r5 */ - .uleb128 0x4 /* at CFA-16 */ - .byte 0x86 /* Store r6 */ - .uleb128 0x3 /* at CFA-12 */ - .byte 0x87 /* Store r7 */ - .uleb128 0x2 /* at CFA-8 */ - .byte 0x88 /* Store r8 */ - .uleb128 0x1 /* at CFA-4 */ - - .byte 0x4 /* Advance location */ - .4byte .LCFI2 - .LCFI1 /* to .LCFI2 */ - .byte 0xe /* Define CFA offset */ - .uleb128 0 /* to 0 */ - .byte 0x8 /* Same value */ - .uleb128 31 /* for ra */ - .byte 0x8 /* Same value */ - .uleb128 4 /* for r4 */ - .byte 0x8 /* Same value */ - .uleb128 5 /* for r5 */ - .byte 0x8 /* Same value */ - .uleb128 6 /* for r6 */ - .byte 0x8 /* Same value */ - .uleb128 7 /* for r7 */ - .byte 0x8 /* Same value */ - .uleb128 8 /* for r8 */ - - .align 2 -2: - diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_open.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_open.c deleted file mode 100644 index 4790f53..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_open.c +++ /dev/null @@ -1,173 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "alt_types.h" -#include "os/alt_syscall.h" - -#ifdef ALT_USE_DIRECT_DRIVERS - -int ALT_OPEN (const char* file, int flags, int mode) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(open); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -extern alt_llist alt_dev_list; - -/* - * alt_file_locked() is used by open() to ensure that a device has not been - * previously locked for exclusive access using ioctl(). This test is only - * performed for devices. Filesystems are required to handle the ioctl() call - * themselves, and report the error from the filesystems open() function. - */ - -static int alt_file_locked (alt_fd* fd) -{ - alt_u32 i; - - /* - * Mark the file descriptor as belonging to a device. - */ - - fd->fd_flags |= ALT_FD_DEV; - - /* - * Loop through all current file descriptors searching for one that's locked - * for exclusive access. If a match is found, generate an error. - */ - - for (i = 0; i <= alt_max_fd; i++) - { - if ((alt_fd_list[i].dev == fd->dev) && - (alt_fd_list[i].fd_flags & ALT_FD_EXCL) && - (&alt_fd_list[i] != fd)) - { - return -EACCES; - } - } - - /* The device is not locked */ - - return 0; -} - -/* - * open() is called in order to get a file descriptor that reference the file - * or device named "name". This descriptor can then be used to manipulate the - * file/device using the standard system calls, e.g. write(), read(), ioctl() - * etc. - * - * This is equivalent to the standard open() system call. - * - * ALT_OPEN is mapped onto the open() system call in alt_syscall.h - */ - -int ALT_OPEN (const char* file, int flags, int mode) -{ - alt_dev* dev; - alt_fd* fd; - int index = -1; - int status = -ENODEV; - int isafs = 0; - - /* - * Check the device list, to see if a device with a matching name is - * registered. - */ - - if (!(dev = alt_find_dev (file, &alt_dev_list))) - { - /* No matching device, so try the filesystem list */ - - dev = alt_find_file (file); - isafs = 1; - } - - /* - * If a matching device or filesystem is found, allocate a file descriptor. - */ - - if (dev) - { - if ((index = alt_get_fd (dev)) < 0) - { - status = index; - } - else - { - fd = &alt_fd_list[index]; - fd->fd_flags = (flags & ~ALT_FD_FLAGS_MASK); - - /* If this is a device, ensure it isn't already locked */ - - if (isafs || ((status = alt_file_locked (fd)) >= 0)) - { - /* - * If the device or filesystem provides an open() callback function, - * call it now to perform any device/filesystem specific operations. - */ - - status = (dev->open) ? dev->open(fd, file, flags, mode): 0; - } - } - } - else - { - status = -ENODEV; - } - - /* Allocation failed, so clean up and return an error */ - - if (status < 0) - { - alt_release_fd (index); - ALT_ERRNO = -status; - return -1; - } - - /* return the reference upon success */ - - return index; -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_printf.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_printf.c deleted file mode 100644 index e742b57..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_printf.c +++ /dev/null @@ -1,127 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/* - * This file provides a very minimal printf implementation for use with very - * small applications. Only the following format strings are supported: - * %x - * %s - * %c - * %% - */ - -#include -#include "sys/alt_stdio.h" - -/* - * ALT printf function - */ -void -alt_printf(const char* fmt, ... ) -{ - va_list args; - va_start(args, fmt); - const char *w; - char c; - - /* Process format string. */ - w = fmt; - while ((c = *w++) != 0) - { - /* If not a format escape character, just print */ - /* character. Otherwise, process format string. */ - if (c != '%') - { - alt_putchar(c); - } - else - { - /* Get format character. If none */ - /* available, processing is complete. */ - if ((c = *w++) != 0) - { - if (c == '%') - { - /* Process "%" escape sequence. */ - alt_putchar(c); - } - else if (c == 'c') - { - int v = va_arg(args, int); - alt_putchar(v); - } - else if (c == 'x') - { - /* Process hexadecimal number format. */ - unsigned long v = va_arg(args, unsigned long); - unsigned long digit; - int digit_shift; - - /* If the number value is zero, just print and continue. */ - if (v == 0) - { - alt_putchar('0'); - continue; - } - - /* Find first non-zero digit. */ - digit_shift = 28; - while (!(v & (0xF << digit_shift))) - digit_shift -= 4; - - /* Print digits. */ - for (; digit_shift >= 0; digit_shift -= 4) - { - digit = (v & (0xF << digit_shift)) >> digit_shift; - if (digit <= 9) - c = '0' + digit; - else - c = 'a' + digit - 10; - alt_putchar(c); - } - } - else if (c == 's') - { - /* Process string format. */ - char *s = va_arg(args, char *); - - while(*s) - alt_putchar(*s++); - } - } - else - { - break; - } - } - } -} diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_putchar.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_putchar.c deleted file mode 100644 index badaa02..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_putchar.c +++ /dev/null @@ -1,59 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#ifdef ALT_USE_DIRECT_DRIVERS -#include "system.h" -#include "sys/alt_driver.h" -#include "sys/alt_stdio.h" -#endif - -/* - * Uses the ALT_DRIVER_WRITE() macro to call directly to driver if available. - * Otherwise, uses newlib provided putchar() routine. - */ -int -alt_putchar(int c) -{ -#ifdef ALT_USE_DIRECT_DRIVERS - ALT_DRIVER_WRITE_EXTERNS(ALT_STDOUT_DEV); - char c1 = (char)(c & 0xff); - - if (ALT_DRIVER_WRITE(ALT_STDOUT_DEV, &c1, 1, 0) == -1) { - return -1; - } - return c; -#else - return putchar(c); -#endif -} diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_putstr.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_putstr.c deleted file mode 100644 index 5345945..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_putstr.c +++ /dev/null @@ -1,55 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#ifdef ALT_USE_DIRECT_DRIVERS -#include -#include "system.h" -#include "sys/alt_driver.h" -#include "sys/alt_stdio.h" -#endif - -/* - * Uses the ALT_DRIVER_WRITE() macro to call directly to driver if available. - * Otherwise, uses newlib provided fputs() routine. - */ -int -alt_putstr(const char* str) -{ -#ifdef ALT_USE_DIRECT_DRIVERS - ALT_DRIVER_WRITE_EXTERNS(ALT_STDOUT_DEV); - return ALT_DRIVER_WRITE(ALT_STDOUT_DEV, str, strlen(str), 0); -#else - return fputs(str, stdout); -#endif -} diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_read.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_read.c deleted file mode 100644 index 1c89777..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_read.c +++ /dev/null @@ -1,125 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -/* - * The read() system call is used to read a block of data from a file or device. - * This function simply vectors the request to the device driver associated - * with the input file descriptor "file". - * - * ALT_READ is mapped onto the read() system call in alt_syscall.h - */ - -#ifdef ALT_USE_DIRECT_DRIVERS - -#include "system.h" -#include "sys/alt_driver.h" - -/* - * Provide minimal version that just reads from the stdin device when provided. - */ - -int ALT_READ (int file, void *ptr, size_t len) -{ -#ifdef ALT_STDIN_PRESENT - ALT_DRIVER_READ_EXTERNS(ALT_STDIN_DEV); -#endif - -#if !defined(ALT_STDIN_PRESENT) - /* Generate a link time warning, should this function ever be called. */ - ALT_STUB_WARNING(read); -#endif - - switch (file) { -#ifdef ALT_STDIN_PRESENT - case 0: /* stdin file descriptor */ - return ALT_DRIVER_READ(ALT_STDIN_DEV, ptr, len, 0); -#endif /* ALT_STDIN_PRESENT */ - default: - ALT_ERRNO = EBADFD; - return -1; - } -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -int ALT_READ (int file, void *ptr, size_t len) -{ - alt_fd* fd; - int rval; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - /* - * If the file has not been opened with read access, or if the driver does - * not provide an implementation of read(), generate an error. Otherwise - * call the drivers read() function to process the request. - */ - - if (((fd->fd_flags & O_ACCMODE) != O_WRONLY) && - (fd->dev->read)) - { - if ((rval = fd->dev->read(fd, ptr, len)) < 0) - { - ALT_ERRNO = -rval; - return -1; - } - return rval; - } - else - { - ALT_ERRNO = EACCES; - } - } - else - { - ALT_ERRNO = EBADFD; - } - return -1; -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_release_fd.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_release_fd.c deleted file mode 100644 index 84733a7..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_release_fd.c +++ /dev/null @@ -1,54 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - -/* - * alt_release_fd() is called to free an allocated file descriptor. This is - * done by setting the device pointer in the file descriptor structure to zero. - * - * File descriptors correcponding to standard in, standard out and standard - * error cannont be released backed to the pool. They are always reserved. - */ - -void alt_release_fd (int fd) -{ - if (fd > 2) - { - alt_fd_list[fd].fd_flags = 0; - alt_fd_list[fd].dev = 0; - } -} - - - diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_remap_cached.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_remap_cached.c deleted file mode 100644 index f61cb9c..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_remap_cached.c +++ /dev/null @@ -1,50 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003,2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "sys/alt_cache.h" -#include "system.h" - -#ifdef NIOS2_MMU_PRESENT -/* Convert KERNEL region address to IO region address */ -#define BYPASS_DCACHE_MASK (0x1 << 29) -#else -/* Set bit 31 of address to bypass D-cache */ -#define BYPASS_DCACHE_MASK (0x1 << 31) -#endif - -/* - * Convert a pointer to a block of uncached memory, into a block of - * cached memory. - */ - -void* alt_remap_cached (volatile void* ptr, alt_u32 len) -{ - return (void*) (((alt_u32) ptr) & ~BYPASS_DCACHE_MASK); -} diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_remap_uncached.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_remap_uncached.c deleted file mode 100644 index 7ff6302..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_remap_uncached.c +++ /dev/null @@ -1,51 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003,2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "sys/alt_cache.h" -#include "system.h" - -#ifdef NIOS2_MMU_PRESENT -/* Convert KERNEL region address to IO region address */ -#define BYPASS_DCACHE_MASK (0x1 << 29) -#else -/* Set bit 31 of address to bypass D-cache */ -#define BYPASS_DCACHE_MASK (0x1 << 31) -#endif - -/* - * Convert a pointer to a block of cached memory, into a block of - * uncached memory. - */ - -volatile void* alt_remap_uncached (void* ptr, alt_u32 len) -{ - alt_dcache_flush (ptr, len); - return (volatile void*) (((alt_u32) ptr) | BYPASS_DCACHE_MASK); -} diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_rename.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_rename.c deleted file mode 100644 index 48afac0..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_rename.c +++ /dev/null @@ -1,55 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "os/alt_syscall.h" - -/* - * _rename() is used by newlib to rename an existing file. This is unsupported - * in the HAL environment. However a "do-nothing" implementation is still - * provied for newlib compatability. - * - * ALT_RENAME is mapped onto the _rename() system call in alt_syscall.h - */ - -int ALT_RENAME (char *existing, char *new) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(_rename); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_sbrk.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_sbrk.c deleted file mode 100644 index b8c3799..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_sbrk.c +++ /dev/null @@ -1,136 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "os/alt_syscall.h" - -#include "sys/alt_irq.h" -#include "sys/alt_stack.h" - -#include "system.h" - -/* - * sbrk() is called to dynamically extend the data segment for the application. - * Thie input argument "incr" is the size of the block to allocate. - * - * This simple implementation does not perform any bounds checking. Memory will - * be allocated, even if the request region colides with the stack or overflows - * the available physical memory. - * - * ALT_SBRK is mapped onto the sbrk() system call in alt_syscall.h - * - * This function is called by the profiling code to allocate memory so must be - * safe if called from an interrupt context. It must also not be instrumented - * because that would lead to an infinate loop. - */ - -extern char __alt_heap_start[]; /* set by linker */ -extern char __alt_heap_limit[]; /* set by linker */ - -static char *heap_end = __alt_heap_start; - -#if defined(ALT_EXCEPTION_STACK) && defined(ALT_STACK_CHECK) -char * alt_exception_old_stack_limit = NULL; -#endif - -caddr_t ALT_SBRK (int incr) __attribute__ ((no_instrument_function )); - -caddr_t ALT_SBRK (int incr) -{ - alt_irq_context context; - char *prev_heap_end; - - context = alt_irq_disable_all(); - - /* Always return data aligned on a word boundary */ - heap_end = (char *)(((unsigned int)heap_end + 3) & ~3); - -#ifdef ALT_MAX_HEAP_BYTES - /* - * User specified a maximum heap size. Return -1 if it would - * be exceeded by this sbrk call. - */ - if (((heap_end + incr) - __alt_heap_start) > ALT_MAX_HEAP_BYTES) { - alt_irq_enable_all(context); - return (caddr_t)-1; - } -#else - if ((heap_end + incr) > __alt_heap_limit) { - alt_irq_enable_all(context); - return (caddr_t)-1; - } -#endif - - prev_heap_end = heap_end; - heap_end += incr; - -#ifdef ALT_STACK_CHECK - /* - * If the stack and heap are contiguous then extending the heap reduces the - * space available for the stack. If we are still using the default stack - * then adjust the stack limit to note this, while checking for stack - * pointer overflow. - * If the stack limit isn't pointing at the top of the heap then the code - * is using a different stack so none of this needs to be done. - */ - - if (alt_stack_limit() == prev_heap_end) - { - if (alt_stack_pointer() <= heap_end) - alt_report_stack_overflow(); - - alt_set_stack_limit(heap_end); - } - -#ifdef ALT_EXCEPTION_STACK - /* - * If we are executing from the exception stack then compare against the - * stack we switched away from as well. The exception stack is a fixed - * size so doesn't need to be checked. - */ - - if (alt_exception_old_stack_limit == prev_heap_end) - { - if (alt_exception_old_stack_limit <= heap_end) - alt_report_stack_overflow(); - - alt_exception_old_stack_limit = heap_end; - } -#endif - -#endif - - alt_irq_enable_all(context); - - return (caddr_t) prev_heap_end; -} diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_settod.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_settod.c deleted file mode 100644 index 59db0f8..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_settod.c +++ /dev/null @@ -1,96 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include "sys/alt_errno.h" -#include "sys/alt_alarm.h" -#include "os/alt_syscall.h" - -/* - * "alt_timezone" and "alt_resettime" are the values of the the reset time and - * time zone set through the last call to settimeofday(). By default they are - * zero initialised. - */ - -extern struct timezone alt_timezone; -extern struct timeval alt_resettime; - -/* - * Macro defining the number of micoseconds in a second. - */ - -#define ALT_US (1000000) - - -/* - * settimeofday() can be called to calibrate the system clock, so that - * subsequent calls to gettimeofday() will return the elapsed "wall clock" - * time. - * - * This is done by updating the global structures "alt_resettime" and - * "alt_timezone" so that an immediate call to gettimeofday() would return - * the value specified by "t" and "tz". - * - * Warning: if this function is called concurrently with a call to - * gettimeofday(), the value returned by gettimeofday() will be unreliable. - * - * ALT_SETTIMEOFDAY is mapped onto the settimeofday() system call in - * alt_syscall.h - */ - -int ALT_SETTIMEOFDAY (const struct timeval *t, - const struct timezone *tz) -{ - alt_u32 nticks = alt_nticks (); - alt_u32 tick_rate = alt_ticks_per_second (); - - /* If there is a system clock available, update the current time */ - - if (tick_rate) - { - alt_resettime.tv_sec = t->tv_sec - nticks/tick_rate; - alt_resettime.tv_usec = t->tv_usec - - ((nticks*(ALT_US/tick_rate))%ALT_US); - - alt_timezone.tz_minuteswest = tz->tz_minuteswest; - alt_timezone.tz_dsttime = tz->tz_dsttime; - - return 0; - } - - /* There's no system clock available */ - - ALT_ERRNO = ENOSYS; - return -1; -} diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_software_exception.S b/software/qsys_tutorial_mem_bsp/HAL/src/alt_software_exception.S deleted file mode 100644 index 2142594..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_software_exception.S +++ /dev/null @@ -1,53 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - - /* - * This file provides the global symbol: software_exception. It is provided to - * support legacy code, and should not be used by new software. - * - * It is used by legacy code to invoke the software exception handler as - * defined by version 1.0 of the Nios II kit. It should only be used when you - * are providing your own interrupt entry point, i.e. you are not using - * alt_irq_entry. - */ - -#include "system.h" - - /* - * Pull in the exception handler. - */ - - .globl alt_exception - - .section .exceptions.entry.label, "xa" - - .globl software_exception - .type software_exception, @function -software_exception: diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_stat.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_stat.c deleted file mode 100644 index 44e207b..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_stat.c +++ /dev/null @@ -1,59 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include -#include - -#include "os/alt_syscall.h" - -/* - * The stat() function is similar to the fstat() function in that it is used to - * obtain status information about a file. Instead of using an open file - * descriptor (like fstat()), stat() takes the name of a file as an input - * argument. - * - * ALT_STAT is mapped onto the stat() system call in alt_syscall.h - */ - -int ALT_STAT (const char *file, struct stat *st) -{ - int fd; - int rc; - - fd = open (file, 0); - rc = fstat (fd, st); - close (fd); - - return rc; -} diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_tick.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_tick.c deleted file mode 100644 index c73488d..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_tick.c +++ /dev/null @@ -1,149 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_irq.h" -#include "sys/alt_alarm.h" -#include "os/alt_hooks.h" -#include "alt_types.h" - -/* - * "_alt_tick_rate" is used to store the value of the system clock frequency - * in ticks per second. It is initialised to zero, which corresponds to there - * being no system clock facility available. - */ - -alt_u32 _alt_tick_rate = 0; - -/* - * "_alt_nticks" is the number of system clock ticks that have elapsed since - * reset. - */ - -volatile alt_u32 _alt_nticks = 0; - -/* - * "alt_alarm_list" is the head of a linked list of registered alarms. This is - * initialised to be an empty list. - */ - -ALT_LLIST_HEAD(alt_alarm_list); - -/* - * alt_alarm_stop() is called to remove an alarm from the list of registered - * alarms. Alternatively an alarm can unregister itself by returning zero when - * the alarm executes. - */ - -void alt_alarm_stop (alt_alarm* alarm) -{ - alt_irq_context irq_context; - - irq_context = alt_irq_disable_all(); - alt_llist_remove (&alarm->llist); - alt_irq_enable_all (irq_context); -} - -/* - * alt_tick() is periodically called by the system clock driver in order to - * process the registered list of alarms. Each alarm is registed with a - * callback interval, and a callback function, "callback". - * - * The return value of the callback function indicates how many ticks are to - * elapse until the next callback. A return value of zero indicates that the - * alarm should be deactivated. - * - * alt_tick() is expected to run at interrupt level. - */ - -void alt_tick (void) -{ - alt_alarm* next; - alt_alarm* alarm = (alt_alarm*) alt_alarm_list.next; - - alt_u32 next_callback; - - /* update the tick counter */ - - _alt_nticks++; - - /* process the registered callbacks */ - - while (alarm != (alt_alarm*) &alt_alarm_list) - { - next = (alt_alarm*) alarm->llist.next; - - /* - * Upon the tick-counter rolling over it is safe to clear the - * roll-over flag; once the flag is cleared this (or subsequnt) - * tick events are enabled to generate an alarm event. - */ - if ((alarm->rollover) && (_alt_nticks == 0)) - { - alarm->rollover = 0; - } - - /* if the alarm period has expired, make the callback */ - if ((alarm->time <= _alt_nticks) && (alarm->rollover == 0)) - { - next_callback = alarm->callback (alarm->context); - - /* deactivate the alarm if the return value is zero */ - - if (next_callback == 0) - { - alt_alarm_stop (alarm); - } - else - { - alarm->time += next_callback; - - /* - * If the desired alarm time causes a roll-over, set the rollover - * flag. This will prevent the subsequent tick event from causing - * an alarm too early. - */ - if(alarm->time < _alt_nticks) - { - alarm->rollover = 1; - } - } - } - alarm = next; - } - - /* - * Update the operating system specific timer facilities. - */ - - ALT_OS_TIME_TICK(); -} - diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_times.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_times.c deleted file mode 100644 index 4dd965d..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_times.c +++ /dev/null @@ -1,71 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "sys/alt_errno.h" -#include "sys/alt_alarm.h" -#include "os/alt_syscall.h" - -/* - * The times() function is used by newlib to obtain elapsed time information. - * The return value is the elapsed time since reset in system clock ticks. Note - * that this is distinct from the strict Posix version of times(), which should - * return the time since: 0 hours, 0 minutes, 0 seconds, January 1, 1970, GMT. - * - * The input structure is filled in with time accounting information. This - * implementation attributes all cpu time to the system. - * - * ALT_TIMES is mapped onto the times() system call in alt_syscall.h - */ - -clock_t ALT_TIMES (struct tms *buf) -{ - clock_t ticks = alt_nticks(); - - /* If there is no system clock present, generate an error */ - - if (!alt_ticks_per_second()) - { - ALT_ERRNO = ENOSYS; - return 0; - } - - /* Otherwise return the elapsed time */ - - buf->tms_utime = 0; - buf->tms_stime = ticks; - buf->tms_cutime = 0; - buf->tms_cstime = 0; - - return ticks; -} diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_uncached_free.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_uncached_free.c deleted file mode 100644 index 6e362ba..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_uncached_free.c +++ /dev/null @@ -1,49 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003,2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "sys/alt_cache.h" -#include "system.h" - -#ifdef NIOS2_MMU_PRESENT -/* Convert KERNEL region address to IO region address */ -#define BYPASS_DCACHE_MASK (0x1 << 29) -#else -/* Set bit 31 of address to bypass D-cache */ -#define BYPASS_DCACHE_MASK (0x1 << 31) -#endif - -/* - * Free a block of uncached memory. - */ - -void alt_uncached_free (volatile void* ptr) -{ - free ((void*) (((alt_u32) ptr) & ~BYPASS_DCACHE_MASK)); -} diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_uncached_malloc.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_uncached_malloc.c deleted file mode 100644 index ab3416d..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_uncached_malloc.c +++ /dev/null @@ -1,55 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003,2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "sys/alt_cache.h" -#include "system.h" - -#ifdef NIOS2_MMU_PRESENT -/* Convert KERNEL region address to IO region address */ -#define BYPASS_DCACHE_MASK (0x1 << 29) -#else -/* Set bit 31 of address to bypass D-cache */ -#define BYPASS_DCACHE_MASK (0x1 << 31) -#endif - -/* - * Allocate a block of uncached memory. - */ - -volatile void* alt_uncached_malloc (size_t size) -{ - void* ptr; - - ptr = malloc (size); - - alt_dcache_flush (ptr, size); - - return ptr ? (volatile void*) (((alt_u32) ptr) | BYPASS_DCACHE_MASK) : NULL; -} diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_unlink.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_unlink.c deleted file mode 100644 index 29e35d6..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_unlink.c +++ /dev/null @@ -1,55 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "os/alt_syscall.h" - -/* - * unlink() is used by newlib to delete an existing link to a file. This is - * unsupported in the HAL environment. However a "do-nothing" implementation - * is still provied for newlib compatability. - * - * ALT_UNLINK is mapped onto the unlink() system call in alt_syscall.h - */ - -int ALT_UNLINK (char *name) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(unlink); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_usleep.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_usleep.c deleted file mode 100644 index 2330eb8..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_usleep.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2003 Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - * - * ------------ - * - * Altera does not recommend, suggest or require that this reference design - * file be used in conjunction or combination with any other product. - * - * usleep.c - Microsecond delay routine - */ - -#include - -#include "priv/alt_busy_sleep.h" -#include "os/alt_syscall.h" - -/* - * This function simply calls alt_busy_sleep() to perform the delay. This - * function implements the delay as a calibrated "busy loop". - * - * ALT_USLEEP is mapped onto the usleep() system call in alt_syscall.h - */ - - - -#if defined (__GNUC__) && __GNUC__ >= 4 -int ALT_USLEEP (useconds_t us) -#else -unsigned int ALT_USLEEP (unsigned int us) -#endif -{ - return alt_busy_sleep(us); -} diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_wait.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_wait.c deleted file mode 100644 index a42f80f..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_wait.c +++ /dev/null @@ -1,52 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_errno.h" -#include "os/alt_syscall.h" - -/* - * wait() is used by newlib to wait for all child processes to exit. Since the - * HAL does not support spawning child processes, this returns immediately as - * there can't be anythign to wait for. - * - * ALT_WAIT is mapped onto the wait() system call in alt_syscall.h - */ - -int ALT_WAIT (int *status) -{ - *status = 0; - - ALT_ERRNO = ECHILD; - - return -1; -} - diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/alt_write.c b/software/qsys_tutorial_mem_bsp/HAL/src/alt_write.c deleted file mode 100644 index 51debb5..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/alt_write.c +++ /dev/null @@ -1,138 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -#include "sys/alt_log_printf.h" - -/* - * The write() system call is used to write a block of data to a file or - * device. This function simply vectors the request to the device driver - * associated with the input file descriptor "file". - * - * ALT_WRITE is mapped onto the write() system call in alt_syscall.h - */ - -#ifdef ALT_USE_DIRECT_DRIVERS - -#include "system.h" -#include "sys/alt_driver.h" - -/* - * Provide minimal version that just writes to the stdout/stderr devices - * when provided. - */ - -int ALT_WRITE (int file, const void *ptr, size_t len) -{ -#ifdef ALT_STDOUT_PRESENT - ALT_DRIVER_WRITE_EXTERNS(ALT_STDOUT_DEV); -#endif -#ifdef ALT_STDERR_PRESENT - ALT_DRIVER_WRITE_EXTERNS(ALT_STDERR_DEV); -#endif - -#if !defined(ALT_STDOUT_PRESENT) && !defined(ALT_STDERR_PRESENT) - /* Generate a link time warning, should this function ever be called. */ - ALT_STUB_WARNING(write); -#endif - - switch (file) { -#ifdef ALT_STDOUT_PRESENT - case 1: /* stdout file descriptor */ - return ALT_DRIVER_WRITE(ALT_STDOUT_DEV, ptr, len, 0); -#endif /* ALT_STDOUT_PRESENT */ -#ifdef ALT_STDERR_PRESENT - case 2: /* stderr file descriptor */ - return ALT_DRIVER_WRITE(ALT_STDERR_DEV, ptr, len, 0); -#endif /* ALT_STDERR_PRESENT */ - default: - ALT_ERRNO = EBADFD; - return -1; - } -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -int ALT_WRITE (int file, const void *ptr, size_t len) -{ - alt_fd* fd; - int rval; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - /* - * If the file has not been opened with write access, or if the driver does - * not provide an implementation of write(), generate an error. Otherwise - * call the drivers write() function to process the request. - */ - - if (((fd->fd_flags & O_ACCMODE) != O_RDONLY) && fd->dev->write) - { - - /* ALT_LOG - see altera_hal/HAL/inc/sys/alt_log_printf.h */ - ALT_LOG_WRITE_FUNCTION(ptr,len); - - if ((rval = fd->dev->write(fd, ptr, len)) < 0) - { - ALT_ERRNO = -rval; - return -1; - } - return rval; - } - else - { - ALT_ERRNO = EACCES; - } - } - else - { - ALT_ERRNO = EBADFD; - } - return -1; -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/altera_nios2_qsys_irq.c b/software/qsys_tutorial_mem_bsp/HAL/src/altera_nios2_qsys_irq.c deleted file mode 100644 index c7a4f93..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/altera_nios2_qsys_irq.c +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2009 Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - * - * altera_nios2_irq.c - Support for Nios II internal interrupt controller. - * - */ - -#include "sys/alt_irq.h" -#include "altera_nios2_qsys_irq.h" - -/* - * To initialize the internal interrupt controller, just clear the IENABLE - * register so that all possible IRQs are disabled. - */ -void altera_nios2_qsys_irq_init(void) -{ - NIOS2_WRITE_IENABLE(0); -} diff --git a/software/qsys_tutorial_mem_bsp/HAL/src/crt0.S b/software/qsys_tutorial_mem_bsp/HAL/src/crt0.S deleted file mode 100644 index 582445d..0000000 --- a/software/qsys_tutorial_mem_bsp/HAL/src/crt0.S +++ /dev/null @@ -1,456 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "system.h" -#include "nios2.h" - -/* Setup header files to work with assembler code. */ -#define ALT_ASM_SRC - -/* Debug logging facility */ -#include "sys/alt_log_printf.h" - -/*************************************************************************\ -| MACROS | -\*************************************************************************/ - -/* - * The new build tools explicitly define macros when alt_load() - * must be called. The define ALT_LOAD_EXPLICITLY_CONTROLLED tells us that - * those macros are controlling if alt_load() needs to be called. - */ -#ifdef ALT_LOAD_EXPLICITLY_CONTROLLED - -/* Need to call alt_load() if any of these sections are being copied. */ -#if defined(ALT_LOAD_COPY_RODATA) || defined(ALT_LOAD_COPY_RWDATA) || defined(ALT_LOAD_COPY_EXCEPTIONS) -#define CALL_ALT_LOAD -#endif - -#else /* !ALT_LOAD_EXPLICITLY_CONTROLLED */ - -/* - * The legacy build tools use the following macros to detect when alt_load() - * needs to be called. - */ - -#define __ALT_LOAD_SECTIONS(res, text, rodata, exc) \ - ((res##_BASE != rodata##_BASE) || \ - (res##_BASE != rwdata##_BASE) || \ - (res##_BASE != exc##_BASE)) - -#define _ALT_LOAD_SECTIONS(res, text, rodata, exc) \ - __ALT_LOAD_SECTIONS(res, text, rodata, exc) - -#define ALT_LOAD_SECTIONS _ALT_LOAD_SECTIONS(ALT_RESET_DEVICE, \ - ALT_RODATA_DEVICE, \ - ALT_RWDATA_DEVICE, \ - ALT_EXCEPTIONS_DEVICE) - -/* Call alt_load() if there is no bootloader and ALT_LOAD_SECTIONS isn't 0. */ -#if defined(ALT_NO_BOOTLOADER) && ALT_LOAD_SECTIONS -#define CALL_ALT_LOAD -#endif - -#endif /* !ALT_LOAD_EXPLICITLY_CONTROLLED */ - -/* - * When the legacy build tools define a macro called ALT_NO_BOOTLOADER, - * it indicates that initialization code is allowed at the reset address. - * The new build tools define a macro called ALT_ALLOW_CODE_AT_RESET for - * the same purpose. - */ -#ifdef ALT_NO_BOOTLOADER -#define ALT_ALLOW_CODE_AT_RESET -#endif - -/*************************************************************************\ -| EXTERNAL REFERENCES | -\*************************************************************************/ - -/* - * The entry point for user code is either "main" in hosted mode, or - * "alt_main" in standalone mode. These are explicitly referenced here, - * to ensure they are built into the executable. This allows the user - * to build them into libraries, rather than supplying them in object - * files at link time. - */ - .globl main - .globl alt_main - -/* - * Create a reference to the software multiply/divide and trap handers, - * so that if they are provided, they will appear in the executable. - */ -#ifndef ALT_NO_INSTRUCTION_EMULATION - .globl alt_exception_muldiv -#endif -#ifdef ALT_TRAP_HANDLER - .globl alt_exception_trap -#endif - -/* - * Linker defined symbols used to initialize bss. - */ -.globl __bss_start -.globl __bss_end - -/*************************************************************************\ -| RESET SECTION (.entry) | -\*************************************************************************/ - -/* - * This is the reset entry point for Nios II. - * - * At reset, only the cache line which contain the reset vector is - * initialized by the hardware. The code within the first cache line - * initializes the remainder of the instruction cache. - */ - - .section .entry, "xa" - .align 5 - -/* - * Explicitly allow the use of r1 (the assembler temporary register) - * within this code. This register is normally reserved for the use of - * the assembler. - */ - .set noat - -/* - * Some tools want to know where the reset vector is. - * Code isn't always provided at the reset vector but at least the - * __reset label always contains the reset vector address because - * it is defined at the start of the .entry section. - */ - - .globl __reset - .type __reset, @function -__reset: - -/* - * Initialize the instruction cache if present (i.e. size > 0) and - * reset code is allowed unless optimizing for RTL simulation. - * RTL simulations can ensure the instruction cache is already initialized - * so skipping this loop speeds up RTL simulation. - */ - -#if NIOS2_ICACHE_SIZE > 0 && defined(ALT_ALLOW_CODE_AT_RESET) && !defined(ALT_SIM_OPTIMIZE) - /* Assume the instruction cache size is always a power of two. */ -#if NIOS2_ICACHE_SIZE > 0x8000 - movhi r2, %hi(NIOS2_ICACHE_SIZE) -#else - movui r2, NIOS2_ICACHE_SIZE -#endif - -0: - initi r2 - addi r2, r2, -NIOS2_ICACHE_LINE_SIZE - bgt r2, zero, 0b -1: - - /* - * The following debug information tells the ISS not to run the loop above - * but to perform its actions using faster internal code. - */ - .pushsection .debug_alt_sim_info - .int 1, 1, 0b, 1b - .popsection -#endif /* Initialize Instruction Cache */ - -/* - * Jump to the _start entry point in the .text section if reset code - * is allowed or if optimizing for RTL simulation. - */ -#if defined(ALT_ALLOW_CODE_AT_RESET) || defined(ALT_SIM_OPTIMIZE) - /* Jump to the _start entry point in the .text section. */ - movhi r1, %hi(_start) - ori r1, r1, %lo(_start) - jmp r1 - - .size __reset, . - __reset -#endif /* Jump to _start */ - -/* - * When not using exit, provide an _exit symbol to prevent unresolved - * references to _exit from the linker script. - */ -#ifdef ALT_NO_EXIT - .globl _exit -_exit: -#endif - -/*************************************************************************\ -| TEXT SECTION (.text) | -\*************************************************************************/ - -/* - * Start of the .text section, and also the code entry point when - * the code is executed by a bootloader rather than directly from reset. - */ - .section .text - .align 2 - - .globl _start - .type _start, @function -_start: - -/* - * Initialize the data cache if present (i.e. size > 0) and not - * optimizing for RTL simulation. - * RTL simulations can ensure the data cache is already initialized - * so skipping this loop speeds up RTL simulation. - */ - -#if NIOS2_DCACHE_SIZE > 0 && !defined(ALT_SIM_OPTIMIZE) - - /* Assume the data cache size is always a power of two. */ -#if NIOS2_DCACHE_SIZE > 0x8000 - movhi r2, %hi(NIOS2_DCACHE_SIZE) -#else - movui r2, NIOS2_DCACHE_SIZE -#endif - -0: - initd 0(r2) - addi r2, r2, -NIOS2_DCACHE_LINE_SIZE - bgt r2, zero, 0b -1: - - /* - * The following debug information tells the ISS not to run the loop above - * but to perform its actions using faster internal code. - */ - .pushsection .debug_alt_sim_info - .int 2, 1, 0b, 1b - .popsection - -#endif /* Initialize Data Cache */ - - /* Log that caches have been initialized. */ - ALT_LOG_PUTS(alt_log_msg_cache) - - /* Log that the stack pointer is about to be setup. */ - ALT_LOG_PUTS(alt_log_msg_stackpointer) - -#if (NIOS2_NUM_OF_SHADOW_REG_SETS == 0) - /* - * Now that the caches are initialized, set up the stack pointer. - * The value provided by the linker is assumed to be correctly aligned. - */ - movhi sp, %hi(__alt_stack_pointer) - ori sp, sp, %lo(__alt_stack_pointer) - - /* Set up the global pointer. */ - movhi gp, %hi(_gp) - ori gp, gp, %lo(_gp) - -#else /* NIOS2_NUM_OF_SHADOW_REG_SETS > 0 */ - - /* - * Set up the GP and SP in all shadow register sets. - */ - - /* - * Check current register set number, if CPU resets into a shadow register - * set, switch register set to 0 by writing zero to SSTATUS register and - * execute an ERET instruction that just jumps to the next PC address - * (use the NEXTPC instruction to get this). - */ - - rdctl r2, status - - /* Get the current register set number (STATUS.CRS). */ - andi r3, r2, NIOS2_STATUS_CRS_MSK - - /* Skip switch register set if STATUS.CRS is 0. */ - beq r3, zero, .Lskip_switch_reg_set - - .set nobreak - - /* Current register set is non-zero, set SSTATUS to 0. */ - mov sstatus, zero - - /* Get next pc and store in ea. */ - nextpc ea - - /* Point to instruction after eret. */ - addi ea, ea, 8 - - /* - * Execute ERET instruction that just jumps to the next PC address - */ - eret - -.Lskip_switch_reg_set: - mov r2, zero - - /* Reset STATUS register */ - wrctl status, r2 - - movui r3, NIOS2_NUM_OF_SHADOW_REG_SETS - - /* Set up the stack pointer in register set 0. */ - movhi sp, %hi(__alt_stack_pointer) - ori sp, sp, %lo(__alt_stack_pointer) - - /* Set up the global pointer in register set 0. */ - movhi gp, %hi(_gp) - ori gp, gp, %lo(_gp) - -.Lsetup_sp_and_gp_loop: - /* - * Setup GP and SP for shadow register set - * from NIOS2_NUM_OF_SHADOW_REG_SETS to 0 - */ - - /* Skip if number of register sets is 0. */ - beq r3, zero, .Lno_shadow_register_set - - - /* Add previous register set STATUS.PRS by 1 */ - movhi r4, 1 - add r2, r2, r4 - - /* Write STATUS */ - wrctl status, r2 - - /* Clear r0 in the shadow register set (not done by hardware) */ - wrprs r0, r0 - - /* Write the GP in previous register set */ - wrprs gp, gp - - /* Only write the SP in previous register set - * if using the seperate exception stack. For normal case (single stack), - * funnel code would read the SP from previous register set. - */ -#ifdef ALT_INTERRUPT_STACK - - movhi et, %hiadj(__alt_interrupt_stack_pointer) - addi et, et, %lo(__alt_interrupt_stack_pointer) - wrprs sp, et - -#endif /* ALT_INTERRUPT_STACK */ - - /* Decrease number of register set counter by 1 */ - addi r3, r3, -1 - - br .Lsetup_sp_and_gp_loop -.Lno_shadow_register_set: - -#endif /* NIOS2_NUM_OF_SHADOW_REG_SETS */ -/* - * Clear the BSS if not optimizing for RTL simulation. - * - * This uses the symbols: __bss_start and __bss_end, which are defined - * by the linker script. They mark the begining and the end of the bss - * region. The linker script guarantees that these values are word aligned. - */ -#ifndef ALT_SIM_OPTIMIZE - /* Log that the BSS is about to be cleared. */ - ALT_LOG_PUTS(alt_log_msg_bss) - - movhi r2, %hi(__bss_start) - ori r2, r2, %lo(__bss_start) - - movhi r3, %hi(__bss_end) - ori r3, r3, %lo(__bss_end) - - beq r2, r3, 1f - -0: - stw zero, (r2) - addi r2, r2, 4 - bltu r2, r3, 0b - -1: - - /* - * The following debug information tells the ISS not to run the loop above - * but to perform its actions using faster internal code. - */ - .pushsection .debug_alt_sim_info - .int 3, 1, 0b, 1b - .popsection -#endif /* ALT_SIM_OPTIMIZE */ - -/* - * The alt_load() facility is normally used when there is no bootloader. - * It copies some sections into RAM so it acts like a mini-bootloader. - */ -#ifdef CALL_ALT_LOAD - -#ifdef ALT_STACK_CHECK - /* - * If the user has selected stack checking then we need to set up a safe - * value in the stack limit register so that the relocation functions - * don't think the stack has overflowed (the contents of the rwdata - * section aren't defined until alt_load() has been called). - */ - mov et, zero -#endif - - call alt_load - -#endif /* CALL_ALT_LOAD */ - -#ifdef ALT_STACK_CHECK - /* - * Set up the stack limit (if required). The linker has set up the - * copy of the variable which is in memory. - */ - - ldw et, %gprel(alt_stack_limit_value)(gp) -#endif - - /* Log that alt_main is about to be called. */ - ALT_LOG_PUTS(alt_log_msg_alt_main) - - /* Call the C entry point. It should never return. */ - call alt_main - - /* Wait in infinite loop in case alt_main does return. */ -alt_after_alt_main: - br alt_after_alt_main - - .size _start, . - _start - -/* - * Add information about the stack base if stack overflow checking is enabled. - */ -#ifdef ALT_STACK_CHECK - .globl alt_stack_limit_value - .section .sdata,"aws",@progbits - .align 2 - .type alt_stack_limit_value, @object - .size alt_stack_limit_value, 4 -alt_stack_limit_value: - .long __alt_stack_limit -#endif diff --git a/software/qsys_tutorial_mem_bsp/Makefile b/software/qsys_tutorial_mem_bsp/Makefile deleted file mode 100644 index dcf3b22..0000000 --- a/software/qsys_tutorial_mem_bsp/Makefile +++ /dev/null @@ -1,766 +0,0 @@ -#------------------------------------------------------------------------------ -# BSP MAKEFILE -# -# This makefile was automatically generated by the nios2-bsp-generate-files -# command. Its purpose is to build a custom Board Support Package (BSP) -# targeting a specific Nios II processor in an SOPC Builder-based design. -# -# To create an application or library Makefile which uses this BSP, try the -# nios2-app-generate-makefile or nios2-lib-generate-makefile commands. -#------------------------------------------------------------------------------ - -#------------------------------------------------------------------------------ -# TOOLS -#------------------------------------------------------------------------------ - -MKDIR := mkdir -p -ECHO := echo -SPACE := $(empty) $(empty) - -#------------------------------------------------------------------------------ -# The adjust-path macro -# -# If COMSPEC is defined, Make is launched from Windows through -# Cygwin. This adjust-path macro will call 'cygpath -u' on all -# paths to ensure they are readable by Make. -# -# If COMSPEC is not defined, Make is launched from *nix, and no adjustment -# is necessary -#------------------------------------------------------------------------------ - -ifndef COMSPEC -ifdef ComSpec -COMSPEC = $(ComSpec) -endif # ComSpec -endif # !COMSPEC - -ifdef COMSPEC - adjust-path = $(subst $(SPACE),\$(SPACE),$(shell cygpath -u "$1")) - adjust-path-mixed = $(subst $(SPACE),\$(SPACE),$(shell cygpath -m "$1")) -else - adjust-path = $(subst $(SPACE),\$(SPACE),$1) - adjust-path-mixed = $(subst $(SPACE),\$(SPACE),$1) -endif - -#------------------------------------------------------------------------------ -# DEFAULT TARGET -# -# The default target, "all", must appear before any other target in the -# Makefile. Note that extra prerequisites are added to the "all" rule later. -#------------------------------------------------------------------------------ -.PHONY: all -all: - @$(ECHO) [BSP build complete] - - -#------------------------------------------------------------------------------ -# PATHS & DIRECTORY NAMES -# -# Explicitly locate absolute path of the BSP root -#------------------------------------------------------------------------------ - -BSP_ROOT_DIR := . - -# Define absolute path to the root of the BSP. -ABS_BSP_ROOT := $(call adjust-path-mixed,$(shell pwd)) - -# Stash all BSP object files here -OBJ_DIR := ./obj - -NEWLIB_DIR = $(BSP_ROOT_DIR)/newlib - - -#------------------------------------------------------------------------------ -# MANAGED CONTENT -# -# All content between the lines "START MANAGED" and "END MANAGED" below is -# generated based on variables in the BSP settings file when the -# nios2-bsp-generate-files command is invoked. If you wish to persist any -# information pertaining to the build process, it is recomended that you -# utilize the BSP settings mechanism to do so. -# -# Note that most variable assignments in this section have a corresponding BSP -# setting that can be changed by using the nios2-bsp-create-settings or -# nios2-bsp-update-settings command before nios2-bsp-generate-files; if you -# want any variable set to a specific value when this Makefile is re-generated -# (to prevent hand-edits from being over-written), use the BSP settings -# facilities above. -#------------------------------------------------------------------------------ - -#START MANAGED - -# The following TYPE comment allows tools to identify the 'type' of target this -# makefile is associated with. -# TYPE: BSP_PRIVATE_MAKEFILE - -# This following VERSION comment indicates the version of the tool used to -# generate this makefile. A makefile variable is provided for VERSION as well. -# ACDS_VERSION: 13.0sp1 -ACDS_VERSION := 13.0sp1 - -# This following BUILD_NUMBER comment indicates the build number of the tool -# used to generate this makefile. -# BUILD_NUMBER: 232 - -SETTINGS_FILE := settings.bsp -SOPC_FILE := C:/Users/takayun/Documents/DE2-115/qsys_tutorial/nios_system.sopcinfo - -#------------------------------------------------------------------------------- -# TOOL & COMMAND DEFINITIONS -# -# The base command for each build operation are expressed here. Additional -# switches may be expressed here. They will run for all instances of the -# utility. -#------------------------------------------------------------------------------- - -# Archiver command. Creates library files. -AR = nios2-elf-ar - -# Assembler command. Note that CC is used for .S files. -AS = nios2-elf-gcc - -# Custom flags only passed to the archiver. This content of this variable is -# directly passed to the archiver rather than the more standard "ARFLAGS". The -# reason for this is that GNU Make assumes some default content in ARFLAGS. -# This setting defines the value of BSP_ARFLAGS in Makefile. -BSP_ARFLAGS = -src - -# Custom flags only passed to the assembler. This setting defines the value of -# BSP_ASFLAGS in Makefile. -BSP_ASFLAGS = -Wa,-gdwarf2 - -# C/C++ compiler debug level. '-g' provides the default set of debug symbols -# typically required to debug a typical application. Omitting '-g' removes -# debug symbols from the ELF. This setting defines the value of -# BSP_CFLAGS_DEBUG in Makefile. -BSP_CFLAGS_DEBUG = -g - -# C/C++ compiler optimization level. "-O0" = no optimization,"-O2" = "normal" -# optimization, etc. "-O0" is recommended for code that you want to debug since -# compiler optimization can remove variables and produce non-sequential -# execution of code while debugging. This setting defines the value of -# BSP_CFLAGS_OPTIMIZATION in Makefile. -BSP_CFLAGS_OPTIMIZATION = '-Os' - -# C/C++ compiler warning level. "-Wall" is commonly used.This setting defines -# the value of BSP_CFLAGS_WARNINGS in Makefile. -BSP_CFLAGS_WARNINGS = -Wall - -# C compiler command. -CC = nios2-elf-gcc -xc - -# C++ compiler command. -CXX = nios2-elf-gcc -xc++ - -# Command used to remove files during 'clean' target. -RM = rm -f - - -#------------------------------------------------------------------------------- -# BUILD PRE & POST PROCESS COMMANDS -# -# The following variables are treated as shell commands in the rule -# definitions for each file-type associated with the BSP build, as well as -# commands run at the beginning and end of the entire BSP build operation. -# Pre-process commands are executed before the relevant command (for example, -# a command defined in the "CC_PRE_PROCESS" variable executes before the C -# compiler for building .c files), while post-process commands are executed -# immediately afterwards. -# -# You can view each pre/post-process command in the "Build Rules: All & -# Clean", "Pattern Rules to Build Objects", and "Library Rules" sections of -# this Makefile. -#------------------------------------------------------------------------------- - - -#------------------------------------------------------------------------------- -# BSP SOURCE BUILD SETTINGS (FLAG GENERATION) -# -# Software build settings such as compiler optimization, debug level, warning -# flags, etc., may be defined in the following variables. The variables below -# are concatenated together in the 'Flags' section of this Makefile to form -# final variables of flags passed to the build tools. -# -# These settings are considered private to the BSP and apply to all library & -# driver files in it; they do NOT automatically propagate to, for example, the -# build settings for an application. -# # For additional detail and syntax requirements, please refer to GCC help -# (example: "nios2-elf-gcc --help --verbose"). -# -# Unless indicated otherwise, multiple entries in each variable should be -# space-separated. -#------------------------------------------------------------------------------- - -# Altera HAL alt_sys_init.c generated source file -GENERATED_C_FILES := $(ABS_BSP_ROOT)/alt_sys_init.c -GENERATED_C_LIB_SRCS += alt_sys_init.c - - -#------------------------------------------------------------------------------- -# BSP SOURCE FILE LISTING -# -# All source files that comprise the BSP are listed here, along with path -# information to each file expressed relative to the BSP root. The precise -# list and location of each file is derived from the driver, operating system, -# or software package source file declarations. -# -# Following specification of the source files for each component, driver, etc., -# each source file type (C, assembly, etc.) is concatenated together and used -# to construct a list of objects. Pattern rules to build each object are then -# used to build each file. -#------------------------------------------------------------------------------- - -# altera_avalon_jtag_uart_driver sources root -altera_avalon_jtag_uart_driver_SRCS_ROOT := drivers - -# altera_avalon_jtag_uart_driver sources -altera_avalon_jtag_uart_driver_C_LIB_SRCS := \ - $(altera_avalon_jtag_uart_driver_SRCS_ROOT)/src/altera_avalon_jtag_uart_init.c \ - $(altera_avalon_jtag_uart_driver_SRCS_ROOT)/src/altera_avalon_jtag_uart_read.c \ - $(altera_avalon_jtag_uart_driver_SRCS_ROOT)/src/altera_avalon_jtag_uart_write.c \ - $(altera_avalon_jtag_uart_driver_SRCS_ROOT)/src/altera_avalon_jtag_uart_ioctl.c \ - $(altera_avalon_jtag_uart_driver_SRCS_ROOT)/src/altera_avalon_jtag_uart_fd.c - -# altera_avalon_pio_driver sources root -altera_avalon_pio_driver_SRCS_ROOT := drivers - -# altera_avalon_pio_driver sources -# altera_nios2_qsys_hal_driver sources root -altera_nios2_qsys_hal_driver_SRCS_ROOT := HAL - -# altera_nios2_qsys_hal_driver sources -altera_nios2_qsys_hal_driver_C_LIB_SRCS := \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/altera_nios2_qsys_irq.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_usleep.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_busy_sleep.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_irq_vars.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_icache_flush.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_icache_flush_all.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_dcache_flush.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_dcache_flush_all.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_dcache_flush_no_writeback.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_instruction_exception_entry.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_irq_register.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_iic.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_remap_cached.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_remap_uncached.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_uncached_free.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_uncached_malloc.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_do_ctors.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_do_dtors.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_gmon.c - -altera_nios2_qsys_hal_driver_ASM_LIB_SRCS := \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_exception_entry.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_exception_trap.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_exception_muldiv.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_irq_entry.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_software_exception.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_mcount.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_log_macro.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/crt0.S - -# hal sources root -hal_SRCS_ROOT := HAL - -# hal sources -hal_C_LIB_SRCS := \ - $(hal_SRCS_ROOT)/src/alt_alarm_start.c \ - $(hal_SRCS_ROOT)/src/alt_close.c \ - $(hal_SRCS_ROOT)/src/alt_dev.c \ - $(hal_SRCS_ROOT)/src/alt_dev_llist_insert.c \ - $(hal_SRCS_ROOT)/src/alt_dma_rxchan_open.c \ - $(hal_SRCS_ROOT)/src/alt_dma_txchan_open.c \ - $(hal_SRCS_ROOT)/src/alt_environ.c \ - $(hal_SRCS_ROOT)/src/alt_env_lock.c \ - $(hal_SRCS_ROOT)/src/alt_errno.c \ - $(hal_SRCS_ROOT)/src/alt_execve.c \ - $(hal_SRCS_ROOT)/src/alt_exit.c \ - $(hal_SRCS_ROOT)/src/alt_fcntl.c \ - $(hal_SRCS_ROOT)/src/alt_fd_lock.c \ - $(hal_SRCS_ROOT)/src/alt_fd_unlock.c \ - $(hal_SRCS_ROOT)/src/alt_find_dev.c \ - $(hal_SRCS_ROOT)/src/alt_find_file.c \ - $(hal_SRCS_ROOT)/src/alt_flash_dev.c \ - $(hal_SRCS_ROOT)/src/alt_fork.c \ - $(hal_SRCS_ROOT)/src/alt_fs_reg.c \ - $(hal_SRCS_ROOT)/src/alt_fstat.c \ - $(hal_SRCS_ROOT)/src/alt_get_fd.c \ - $(hal_SRCS_ROOT)/src/alt_getchar.c \ - $(hal_SRCS_ROOT)/src/alt_getpid.c \ - $(hal_SRCS_ROOT)/src/alt_gettod.c \ - $(hal_SRCS_ROOT)/src/alt_iic_isr_register.c \ - $(hal_SRCS_ROOT)/src/alt_instruction_exception_register.c \ - $(hal_SRCS_ROOT)/src/alt_ioctl.c \ - $(hal_SRCS_ROOT)/src/alt_io_redirect.c \ - $(hal_SRCS_ROOT)/src/alt_irq_handler.c \ - $(hal_SRCS_ROOT)/src/alt_isatty.c \ - $(hal_SRCS_ROOT)/src/alt_kill.c \ - $(hal_SRCS_ROOT)/src/alt_link.c \ - $(hal_SRCS_ROOT)/src/alt_load.c \ - $(hal_SRCS_ROOT)/src/alt_log_printf.c \ - $(hal_SRCS_ROOT)/src/alt_lseek.c \ - $(hal_SRCS_ROOT)/src/alt_main.c \ - $(hal_SRCS_ROOT)/src/alt_malloc_lock.c \ - $(hal_SRCS_ROOT)/src/alt_open.c \ - $(hal_SRCS_ROOT)/src/alt_printf.c \ - $(hal_SRCS_ROOT)/src/alt_putchar.c \ - $(hal_SRCS_ROOT)/src/alt_putstr.c \ - $(hal_SRCS_ROOT)/src/alt_read.c \ - $(hal_SRCS_ROOT)/src/alt_release_fd.c \ - $(hal_SRCS_ROOT)/src/alt_rename.c \ - $(hal_SRCS_ROOT)/src/alt_sbrk.c \ - $(hal_SRCS_ROOT)/src/alt_settod.c \ - $(hal_SRCS_ROOT)/src/alt_stat.c \ - $(hal_SRCS_ROOT)/src/alt_tick.c \ - $(hal_SRCS_ROOT)/src/alt_times.c \ - $(hal_SRCS_ROOT)/src/alt_unlink.c \ - $(hal_SRCS_ROOT)/src/alt_wait.c \ - $(hal_SRCS_ROOT)/src/alt_write.c - - -# Assemble all component C source files -COMPONENT_C_LIB_SRCS += \ - $(altera_avalon_jtag_uart_driver_C_LIB_SRCS) \ - $(altera_nios2_qsys_hal_driver_C_LIB_SRCS) \ - $(hal_C_LIB_SRCS) - -# Assemble all component assembly source files -COMPONENT_ASM_LIB_SRCS += \ - $(altera_nios2_qsys_hal_driver_ASM_LIB_SRCS) - -# Assemble all component C++ source files -COMPONENT_CPP_LIB_SRCS += \ - -#END MANAGED - -#------------------------------------------------------------------------------ -# PUBLIC.MK -# -# The generated public.mk file contains BSP information that is shared with -# other external makefiles, such as a Nios II application makefile. System- -# dependent information such as hardware-specific compiler flags and -# simulation file generation are stored here. -# -# In addition, public.mk contains include paths that various software, -# such as a device driver, may need for the C compiler. These paths are -# written to public.mk with respect to the BSP root. In public.mk, each -# path is prefixed with a special variable, $(ALT_LIBRARY_ROOT_DIR). The -# purpose of this variable is to allow an external Makefile to append on -# path information to precisely locate paths expressed in public.mk -# Since this is the BSP Makefile, we set ALT_LIBRARY_ROOT_DIR to point right -# here ("."), at the BSP root. -# -# ALT_LIBRARY_ROOT_DIR must always be set before public.mk is included. -#------------------------------------------------------------------------------ -ALT_LIBRARY_ROOT_DIR := . -include public.mk - - -#------------------------------------------------------------------------------ -# FLAGS -# -# Include paths for BSP files are written into the public.mk file and must -# be added to the existing list of pre-processor flags. In addition, "hooks" -# for standard flags left intentionally empty (CFLAGS, CPPFLAGS, ASFLAGS, -# and CXXFLAGS) are provided for conveniently adding to the relevant flags -# on the command-line or via script that calls make. -#------------------------------------------------------------------------------ -# Assemble final list of compiler flags from generated content -BSP_CFLAGS += \ - $(BSP_CFLAGS_DEFINED_SYMBOLS) \ - $(BSP_CFLAGS_UNDEFINED_SYMBOLS) \ - $(BSP_CFLAGS_OPTIMIZATION) \ - $(BSP_CFLAGS_DEBUG) \ - $(BSP_CFLAGS_WARNINGS) \ - $(BSP_CFLAGS_USER_FLAGS) \ - $(ALT_CFLAGS) \ - $(CFLAGS) - -# Make ready the final list of include directories and other C pre-processor -# flags. Each include path is made ready by prefixing it with "-I". -BSP_CPPFLAGS += \ - $(addprefix -I, $(BSP_INC_DIRS)) \ - $(addprefix -I, $(ALT_INCLUDE_DIRS)) \ - $(ALT_CPPFLAGS) \ - $(CPPFLAGS) - -# Finish off assembler flags with any user-provided flags -BSP_ASFLAGS += $(ASFLAGS) - -# Finish off C++ flags with any user-provided flags -BSP_CXXFLAGS += $(CXXFLAGS) - -# And finally, the ordered list -C_SRCS += $(GENERATED_C_LIB_SRCS) \ - $(COMPONENT_C_LIB_SRCS) - -CXX_SRCS += $(GENERATED_CPP_LIB_SRCS) \ - $(COMPONENT_CPP_LIB_SRCS) - -ASM_SRCS += $(GENERATED_ASM_LIB_SRCS) \ - $(COMPONENT_ASM_LIB_SRCS) - - -#------------------------------------------------------------------------------ -# LIST OF GENERATED FILES -# -# A Nios II BSP relies on the generation of several source files used -# by both the BSP and any applications referencing the BSP. -#------------------------------------------------------------------------------ - - -GENERATED_H_FILES := $(ABS_BSP_ROOT)/system.h - -GENERATED_LINKER_SCRIPT := $(ABS_BSP_ROOT)/linker.x - -GENERATED_FILES += $(GENERATED_H_FILES) \ - $(GENERATED_LINKER_SCRIPT) - - -#------------------------------------------------------------------------------ -# SETUP TO BUILD OBJECTS -# -# List of object files which are to be built. This is constructed from the input -# list of C source files (C_SRCS), C++ source files (CXX_SRCS), and assembler -# source file (ASM_SRCS). The permitted file extensions are: -# -# .c .C - for C files -# .cxx .cc .cpp .CXX .CC .CPP - for C++ files -# .S .s - for assembly files -# -# Extended description: The list of objects is a sorted list (duplicates -# removed) of all possible objects, placed beneath the ./obj directory, -# including any path information stored in the "*_SRCS" variable. The -# "patsubst" commands are used to concatenate together multiple file suffix -# types for common files (i.e. c++ as .cxx, .cc, .cpp). -# -# File extensions are case-insensitive in build rules with the exception of -# assembly sources. Nios II assembly sources with the ".S" extension are first -# run through the C preprocessor. Sources with the ".s" extension are not. -#------------------------------------------------------------------------------ -OBJS = $(sort $(addprefix $(OBJ_DIR)/, \ - $(patsubst %.c, %.o, $(patsubst %.C, %.o, $(C_SRCS))) \ - $(patsubst %.cxx, %.o, $(patsubst %.CXX, %.o, \ - $(patsubst %.cc, %.o, $(patsubst %.CC, %.o, \ - $(patsubst %.cpp, %.o, $(patsubst %.CPP, %.o, \ - $(CXX_SRCS) )))))) \ - $(patsubst %.S, %.o, $(patsubst %.s, %.o, $(ASM_SRCS))) )) - -# List of dependancy files for each object file. -DEPS = $(OBJS:.o=.d) - - -# Rules to force your project to rebuild or relink -# .force_relink file will cause any application that depends on this project to relink -# .force_rebuild file will cause this project to rebuild object files -# .force_rebuild_all file will cause this project and any project that depends on this project to rebuild object files - -FORCE_RELINK_DEP := .force_relink -FORCE_REBUILD_DEP := .force_rebuild -FORCE_REBUILD_ALL_DEP := .force_rebuild_all -FORCE_REBUILD_DEP_LIST := $(FORCE_RELINK_DEP) $(FORCE_REBUILD_DEP) $(FORCE_REBUILD_ALL_DEP) - -$(FORCE_REBUILD_DEP_LIST): - -$(OBJS): $(wildcard $(FORCE_REBUILD_DEP)) $(wildcard $(FORCE_REBUILD_ALL_DEP)) - - -#------------------------------------------------------------------------------ -# BUILD RULES: ALL & CLEAN -#------------------------------------------------------------------------------ -.DELETE_ON_ERROR: - -.PHONY: all -all: build_pre_process -all: Makefile $(GENERATED_FILES) $(BSP_LIB) $(NEWLIB_DIR) -all: build_post_process - - -# clean: remove .o/.a/.d -.PHONY: clean -clean: - @$(RM) -r $(BSP_LIB) $(OBJ_DIR) $(FORCE_REBUILD_DEP_LIST) -ifneq ($(wildcard $(NEWLIB_DIR)),) - @$(RM) -r $(NEWLIB_DIR) -endif - @$(ECHO) [BSP clean complete] - - -#------------------------------------------------------------------------------ -# BUILD PRE/POST PROCESS -#------------------------------------------------------------------------------ -build_pre_process : - $(BUILD_PRE_PROCESS) - -build_post_process : - $(BUILD_POST_PROCESS) - -.PHONY: build_pre_process build_post_process - - - -#------------------------------------------------------------------------------ -# MAKEFILE UP TO DATE? -# -# Is this very Makefile up to date? Someone may have changed the BSP settings -# file or the associated target hardware. -#------------------------------------------------------------------------------ -# Skip this check when clean is the only target -ifneq ($(MAKECMDGOALS),clean) - -ifneq ($(wildcard $(SETTINGS_FILE)),$(SETTINGS_FILE)) -$(warning Warning: BSP Settings File $(SETTINGS_FILE) could not be found.) -endif - -Makefile: $(wildcard $(SETTINGS_FILE)) - @$(ECHO) Makefile not up to date. - @$(ECHO) $(SETTINGS_FILE) has been modified since the BSP Makefile was generated. - @$(ECHO) - @$(ECHO) Generate the BSP to update the Makefile, and then build again. - @$(ECHO) - @$(ECHO) To generate from Eclipse: - @$(ECHO) " 1. Right-click the BSP project." - @$(ECHO) " 2. In the Nios II Menu, click Generate BSP." - @$(ECHO) - @$(ECHO) To generate from the command line: - @$(ECHO) " nios2-bsp-generate-files --settings= --bsp-dir=" - @$(ECHO) - @exit 1 - -ifneq ($(wildcard $(SOPC_FILE)),$(SOPC_FILE)) -$(warning Warning: SOPC File $(SOPC_FILE) could not be found.) -endif - -public.mk: $(wildcard $(SOPC_FILE)) - @$(ECHO) Makefile not up to date. - @$(ECHO) $(SOPC_FILE) has been modified since the BSP was generated. - @$(ECHO) - @$(ECHO) Generate the BSP to update the Makefile, and then build again. - @$(ECHO) - @$(ECHO) To generate from Eclipse: - @$(ECHO) " 1. Right-click the BSP project." - @$(ECHO) " 2. In the Nios II Menu, click Generate BSP." - @$(ECHO) - @$(ECHO) To generate from the command line: - @$(ECHO) " nios2-bsp-generate-files --settings= --bsp-dir=" - @$(ECHO) - @exit 1 - -endif # $(MAKECMDGOALS) != clean - -#------------------------------------------------------------------------------ -# PATTERN RULES TO BUILD OBJECTS -#------------------------------------------------------------------------------ -$(OBJ_DIR)/%.o: %.c - @$(ECHO) Compiling $( - -/* - * Device headers - */ - -#include "altera_nios2_qsys_irq.h" -#include "altera_avalon_jtag_uart.h" - -/* - * Allocate the device storage - */ - -ALTERA_NIOS2_QSYS_IRQ_INSTANCE ( NIOS2_PROCESSOR, nios2_processor); -ALTERA_AVALON_JTAG_UART_INSTANCE ( JTAG_UART, jtag_uart); - -/* - * Initialize the interrupt controller devices - * and then enable interrupts in the CPU. - * Called before alt_sys_init(). - * The "base" parameter is ignored and only - * present for backwards-compatibility. - */ - -void alt_irq_init ( const void* base ) -{ - ALTERA_NIOS2_QSYS_IRQ_INIT ( NIOS2_PROCESSOR, nios2_processor); - alt_irq_cpu_enable_interrupts(); -} - -/* - * Initialize the non-interrupt controller devices. - * Called after alt_irq_init(). - */ - -void alt_sys_init( void ) -{ - ALTERA_AVALON_JTAG_UART_INIT ( JTAG_UART, jtag_uart); -} diff --git a/software/qsys_tutorial_mem_bsp/create-this-bsp b/software/qsys_tutorial_mem_bsp/create-this-bsp deleted file mode 100644 index 49e6175..0000000 --- a/software/qsys_tutorial_mem_bsp/create-this-bsp +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/bash -# -# This script creates the ucosii_net_zipfs Board Support Package (BSP). - -BSP_TYPE=hal -BSP_DIR=. -SOPC_DIR=../../ -SOPC_FILE=C:/Users/takayun/Documents/DE2-115/qsys_tutorial/nios_system.sopcinfo -NIOS2_BSP_ARGS="--set hal.max_file_descriptors 4 --set hal.enable_small_c_library true --set hal.sys_clk_timer none --set hal.timestamp_timer none --set hal.enable_exit false --set hal.enable_c_plus_plus false --set hal.enable_lightweight_device_driver_api true --set hal.enable_clean_exit false --set hal.enable_sim_optimize false --set hal.enable_reduced_device_drivers true --set hal.make.bsp_cflags_optimization '-Os'" -CPU_NAME= - - -# Don't run make if create-this-app script is called with --no-make arg -SKIP_MAKE= -while [ $# -gt 0 ] -do - case "$1" in - --no-make) - SKIP_MAKE=1 - ;; - *) - NIOS2_BSP_ARGS="$NIOS2_BSP_ARGS $1" - ;; - esac - shift -done - - -# Run nios2-bsp utility to create a hal BSP in this directory -# for the system with a .sopc file in $SOPC_FILE. -# Deprecating $SOPC_DIR in 10.1. Multiple .sopcinfo files in a directory may exist. - -if [ -z "$SOPC_FILE" ]; then - echo "WARNING: Use of a directory for locating a .sopcinfo file is deprecated in 10.1. Multiple .sopcinfo files may exist. You must specify the full .sopcinfo path." - cmd="nios2-bsp $BSP_TYPE $BSP_DIR $SOPC_DIR $NIOS2_BSP_ARGS $CPU_NAME" -else - cmd="nios2-bsp $BSP_TYPE $BSP_DIR $SOPC_FILE $NIOS2_BSP_ARGS $CPU_NAME" -fi - - -echo "create-this-bsp: Running \"$cmd\"" -$cmd || { - echo "$cmd failed" - exit 1 -} -if [ -z "$SKIP_MAKE" ]; then - echo "create-this-bsp: Running make" - make -fi diff --git a/software/qsys_tutorial_mem_bsp/drivers/inc/altera_avalon_jtag_uart.h b/software/qsys_tutorial_mem_bsp/drivers/inc/altera_avalon_jtag_uart.h deleted file mode 100644 index 95d4a99..0000000 --- a/software/qsys_tutorial_mem_bsp/drivers/inc/altera_avalon_jtag_uart.h +++ /dev/null @@ -1,198 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#ifndef __ALT_AVALON_JTAG_UART_H__ -#define __ALT_AVALON_JTAG_UART_H__ - -#include - -#include "sys/alt_alarm.h" -#include "sys/alt_warning.h" - -#include "os/alt_sem.h" -#include "os/alt_flag.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * If the user wants all drivers to be small rather than fast then make sure - * this one is marked as needing to be small. - */ -#if defined ALT_USE_SMALL_DRIVERS && !defined ALTERA_AVALON_JTAG_UART_SMALL -#define ALTERA_AVALON_JTAG_UART_SMALL -#endif - -/* - * If the user wants to ignore FIFO full error after timeout - */ -#if defined ALT_JTAG_UART_IGNORE_FIFO_FULL_ERROR && !defined ALTERA_AVALON_JTAG_UART_IGNORE_FIFO_FULL_ERROR -#define ALTERA_AVALON_JTAG_UART_IGNORE_FIFO_FULL_ERROR -#endif - -/* - * Constants that can be overriden. - */ -#ifndef ALTERA_AVALON_JTAG_UART_DEFAULT_TIMEOUT -#define ALTERA_AVALON_JTAG_UART_DEFAULT_TIMEOUT 10 -#endif - -#ifndef ALTERA_AVALON_JTAG_UART_BUF_LEN -#define ALTERA_AVALON_JTAG_UART_BUF_LEN 2048 -#endif - -/* - * ALT_JTAG_UART_READ_RDY and ALT_JTAG_UART_WRITE_RDY are the bitmasks - * that define uC/OS-II event flags that are releated to this device. - * - * ALT_JTAG_UART_READ_RDY indicates that there is read data in the buffer - * ready to be processed. ALT_JTAG_UART_WRITE_RDY indicates that the transmitter is - * ready for more data. - */ -#define ALT_JTAG_UART_READ_RDY 0x1 -#define ALT_JTAG_UART_WRITE_RDY 0x2 -#define ALT_JTAG_UART_TIMEOUT 0x4 - -/* - * State structure definition. Each instance of the driver uses one - * of these structures to hold its associated state. - */ - -typedef struct altera_avalon_jtag_uart_state_s -{ - unsigned int base; - -#ifndef ALTERA_AVALON_JTAG_UART_SMALL - - unsigned int timeout; /* Timeout until host is assumed inactive */ - alt_alarm alarm; - unsigned int irq_enable; - unsigned int host_inactive; - - ALT_SEM (read_lock) - ALT_SEM (write_lock) - ALT_FLAG_GRP (events) - - /* The variables below are volatile because they are modified by the - * interrupt routine. Making them volatile and reading them atomically - * means that we don't need any large critical sections. - */ - volatile unsigned int rx_in; - unsigned int rx_out; - unsigned int tx_in; - volatile unsigned int tx_out; - char rx_buf[ALTERA_AVALON_JTAG_UART_BUF_LEN]; - char tx_buf[ALTERA_AVALON_JTAG_UART_BUF_LEN]; - -#endif /* !ALTERA_AVALON_JTAG_UART_SMALL */ - -} altera_avalon_jtag_uart_state; - -/* - * Macros used by alt_sys_init when the ALT file descriptor facility isn't used. - */ - -#ifdef ALTERA_AVALON_JTAG_UART_SMALL - -#define ALTERA_AVALON_JTAG_UART_STATE_INSTANCE(name, state) \ - altera_avalon_jtag_uart_state state = \ - { \ - name##_BASE, \ - } - -#define ALTERA_AVALON_JTAG_UART_STATE_INIT(name, state) - -#else /* !ALTERA_AVALON_JTAG_UART_SMALL */ - -#define ALTERA_AVALON_JTAG_UART_STATE_INSTANCE(name, state) \ - altera_avalon_jtag_uart_state state = \ - { \ - name##_BASE, \ - ALTERA_AVALON_JTAG_UART_DEFAULT_TIMEOUT, \ - } - -/* - * Externally referenced routines - */ -extern void altera_avalon_jtag_uart_init(altera_avalon_jtag_uart_state* sp, - int irq_controller_id, int irq); - -#define ALTERA_AVALON_JTAG_UART_STATE_INIT(name, state) \ - { \ - if (name##_IRQ == ALT_IRQ_NOT_CONNECTED) \ - { \ - ALT_LINK_ERROR ("Error: Interrupt not connected for " #name ". " \ - "You have selected the interrupt driven version of " \ - "the ALTERA Avalon JTAG UART driver, but the " \ - "interrupt is not connected for this device. You can " \ - "select a polled mode driver by checking the 'small " \ - "driver' option in the HAL configuration window, or " \ - "by using the -DALTERA_AVALON_JTAG_UART_SMALL " \ - "preprocessor flag."); \ - } \ - else \ - altera_avalon_jtag_uart_init(&state, \ - name##_IRQ_INTERRUPT_CONTROLLER_ID, \ - name##_IRQ); \ - } - -#endif /* ALTERA_AVALON_JTAG_UART_SMALL */ - -/* - * Include in case non-direct version of driver required. - */ -#include "altera_avalon_jtag_uart_fd.h" - -/* - * Map alt_sys_init macros to direct or non-direct versions. - */ -#ifdef ALT_USE_DIRECT_DRIVERS - -#define ALTERA_AVALON_JTAG_UART_INSTANCE(name, state) \ - ALTERA_AVALON_JTAG_UART_STATE_INSTANCE(name, state) -#define ALTERA_AVALON_JTAG_UART_INIT(name, state) \ - ALTERA_AVALON_JTAG_UART_STATE_INIT(name, state) - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -#define ALTERA_AVALON_JTAG_UART_INSTANCE(name, dev) \ - ALTERA_AVALON_JTAG_UART_DEV_INSTANCE(name, dev) -#define ALTERA_AVALON_JTAG_UART_INIT(name, dev) \ - ALTERA_AVALON_JTAG_UART_DEV_INIT(name, dev) - -#endif /* ALT_USE_DIRECT_DRIVERS */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_AVALON_JTAG_UART_H__ */ diff --git a/software/qsys_tutorial_mem_bsp/drivers/inc/altera_avalon_jtag_uart_fd.h b/software/qsys_tutorial_mem_bsp/drivers/inc/altera_avalon_jtag_uart_fd.h deleted file mode 100644 index b3c3200..0000000 --- a/software/qsys_tutorial_mem_bsp/drivers/inc/altera_avalon_jtag_uart_fd.h +++ /dev/null @@ -1,125 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#ifndef __ALT_AVALON_JTAG_UART_FD_H__ -#define __ALT_AVALON_JTAG_UART_FD_H__ - -#include "sys/alt_dev.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * Externally referenced routines - */ -extern int altera_avalon_jtag_uart_read_fd (alt_fd* fd, char* ptr, int len); -extern int altera_avalon_jtag_uart_write_fd (alt_fd* fd, const char* ptr, - int len); - -/* - * Device structure definition. This is needed by alt_sys_init in order to - * reserve memory for the device instance. - */ - -typedef struct altera_avalon_jtag_uart_dev_s -{ - alt_dev dev; - altera_avalon_jtag_uart_state state; -} altera_avalon_jtag_uart_dev; - -/* - * Macros used by alt_sys_init when the ALT file descriptor facility is used. - */ - -#ifdef ALTERA_AVALON_JTAG_UART_SMALL - -#define ALTERA_AVALON_JTAG_UART_DEV_INSTANCE(name, d) \ - static altera_avalon_jtag_uart_dev d = \ - { \ - { \ - ALT_LLIST_ENTRY, \ - name##_NAME, \ - NULL, /* open */ \ - NULL, /* close */ \ - altera_avalon_jtag_uart_read_fd, \ - altera_avalon_jtag_uart_write_fd, \ - NULL, /* lseek */ \ - NULL, /* fstat */ \ - NULL, /* ioctl */ \ - }, \ - { \ - name##_BASE, \ - } \ - } - -#define ALTERA_AVALON_JTAG_UART_DEV_INIT(name, d) alt_dev_reg (&d.dev) - -#else /* !ALTERA_AVALON_JTAG_UART_SMALL */ - -extern int altera_avalon_jtag_uart_close_fd(alt_fd* fd); -extern int altera_avalon_jtag_uart_ioctl_fd (alt_fd* fd, int req, void* arg); - -#define ALTERA_AVALON_JTAG_UART_DEV_INSTANCE(name, d) \ - static altera_avalon_jtag_uart_dev d = \ - { \ - { \ - ALT_LLIST_ENTRY, \ - name##_NAME, \ - NULL, /* open */ \ - altera_avalon_jtag_uart_close_fd, \ - altera_avalon_jtag_uart_read_fd, \ - altera_avalon_jtag_uart_write_fd, \ - NULL, /* lseek */ \ - NULL, /* fstat */ \ - altera_avalon_jtag_uart_ioctl_fd, \ - }, \ - { \ - name##_BASE, \ - ALTERA_AVALON_JTAG_UART_DEFAULT_TIMEOUT, \ - } \ - } - -#define ALTERA_AVALON_JTAG_UART_DEV_INIT(name, d) \ - { \ - ALTERA_AVALON_JTAG_UART_STATE_INIT(name, d.state); \ - \ - /* make the device available to the system */ \ - alt_dev_reg(&d.dev); \ - } - -#endif /* ALTERA_AVALON_JTAG_UART_SMALL */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_AVALON_JTAG_UART_FD_H__ */ diff --git a/software/qsys_tutorial_mem_bsp/drivers/inc/altera_avalon_jtag_uart_regs.h b/software/qsys_tutorial_mem_bsp/drivers/inc/altera_avalon_jtag_uart_regs.h deleted file mode 100644 index 7f97160..0000000 --- a/software/qsys_tutorial_mem_bsp/drivers/inc/altera_avalon_jtag_uart_regs.h +++ /dev/null @@ -1,73 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#ifndef __ALTERA_AVALON_JTAG_UART_REGS_H__ -#define __ALTERA_AVALON_JTAG_UART_REGS_H__ - -#include - -#define ALTERA_AVALON_JTAG_UART_DATA_REG 0 -#define IOADDR_ALTERA_AVALON_JTAG_UART_DATA(base) \ - __IO_CALC_ADDRESS_NATIVE(base, ALTERA_AVALON_JTAG_UART_DATA_REG) -#define IORD_ALTERA_AVALON_JTAG_UART_DATA(base) \ - IORD(base, ALTERA_AVALON_JTAG_UART_DATA_REG) -#define IOWR_ALTERA_AVALON_JTAG_UART_DATA(base, data) \ - IOWR(base, ALTERA_AVALON_JTAG_UART_DATA_REG, data) - -#define ALTERA_AVALON_JTAG_UART_DATA_DATA_MSK (0x000000FF) -#define ALTERA_AVALON_JTAG_UART_DATA_DATA_OFST (0) -#define ALTERA_AVALON_JTAG_UART_DATA_RVALID_MSK (0x00008000) -#define ALTERA_AVALON_JTAG_UART_DATA_RVALID_OFST (15) -#define ALTERA_AVALON_JTAG_UART_DATA_RAVAIL_MSK (0xFFFF0000) -#define ALTERA_AVALON_JTAG_UART_DATA_RAVAIL_OFST (16) - - -#define ALTERA_AVALON_JTAG_UART_CONTROL_REG 1 -#define IOADDR_ALTERA_AVALON_JTAG_UART_CONTROL(base) \ - __IO_CALC_ADDRESS_NATIVE(base, ALTERA_AVALON_JTAG_UART_CONTROL_REG) -#define IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base) \ - IORD(base, ALTERA_AVALON_JTAG_UART_CONTROL_REG) -#define IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(base, data) \ - IOWR(base, ALTERA_AVALON_JTAG_UART_CONTROL_REG, data) - -#define ALTERA_AVALON_JTAG_UART_CONTROL_RE_MSK (0x00000001) -#define ALTERA_AVALON_JTAG_UART_CONTROL_RE_OFST (0) -#define ALTERA_AVALON_JTAG_UART_CONTROL_WE_MSK (0x00000002) -#define ALTERA_AVALON_JTAG_UART_CONTROL_WE_OFST (1) -#define ALTERA_AVALON_JTAG_UART_CONTROL_RI_MSK (0x00000100) -#define ALTERA_AVALON_JTAG_UART_CONTROL_RI_OFST (8) -#define ALTERA_AVALON_JTAG_UART_CONTROL_WI_MSK (0x00000200) -#define ALTERA_AVALON_JTAG_UART_CONTROL_WI_OFST (9) -#define ALTERA_AVALON_JTAG_UART_CONTROL_AC_MSK (0x00000400) -#define ALTERA_AVALON_JTAG_UART_CONTROL_AC_OFST (10) -#define ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_MSK (0xFFFF0000) -#define ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_OFST (16) - -#endif /* __ALTERA_AVALON_JTAG_UART_REGS_H__ */ diff --git a/software/qsys_tutorial_mem_bsp/drivers/inc/altera_avalon_pio_regs.h b/software/qsys_tutorial_mem_bsp/drivers/inc/altera_avalon_pio_regs.h deleted file mode 100644 index 052439f..0000000 --- a/software/qsys_tutorial_mem_bsp/drivers/inc/altera_avalon_pio_regs.h +++ /dev/null @@ -1,67 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#ifndef __ALTERA_AVALON_PIO_REGS_H__ -#define __ALTERA_AVALON_PIO_REGS_H__ - -#include - -#define IOADDR_ALTERA_AVALON_PIO_DATA(base) __IO_CALC_ADDRESS_NATIVE(base, 0) -#define IORD_ALTERA_AVALON_PIO_DATA(base) IORD(base, 0) -#define IOWR_ALTERA_AVALON_PIO_DATA(base, data) IOWR(base, 0, data) - -#define IOADDR_ALTERA_AVALON_PIO_DIRECTION(base) __IO_CALC_ADDRESS_NATIVE(base, 1) -#define IORD_ALTERA_AVALON_PIO_DIRECTION(base) IORD(base, 1) -#define IOWR_ALTERA_AVALON_PIO_DIRECTION(base, data) IOWR(base, 1, data) - -#define IOADDR_ALTERA_AVALON_PIO_IRQ_MASK(base) __IO_CALC_ADDRESS_NATIVE(base, 2) -#define IORD_ALTERA_AVALON_PIO_IRQ_MASK(base) IORD(base, 2) -#define IOWR_ALTERA_AVALON_PIO_IRQ_MASK(base, data) IOWR(base, 2, data) - -#define IOADDR_ALTERA_AVALON_PIO_EDGE_CAP(base) __IO_CALC_ADDRESS_NATIVE(base, 3) -#define IORD_ALTERA_AVALON_PIO_EDGE_CAP(base) IORD(base, 3) -#define IOWR_ALTERA_AVALON_PIO_EDGE_CAP(base, data) IOWR(base, 3, data) - - -#define IOADDR_ALTERA_AVALON_PIO_SET_BIT(base) __IO_CALC_ADDRESS_NATIVE(base, 4) -#define IORD_ALTERA_AVALON_PIO_SET_BITS(base) IORD(base, 4) -#define IOWR_ALTERA_AVALON_PIO_SET_BITS(base, data) IOWR(base, 4, data) - -#define IOADDR_ALTERA_AVALON_PIO_CLEAR_BITS(base) __IO_CALC_ADDRESS_NATIVE(base, 5) -#define IORD_ALTERA_AVALON_PIO_CLEAR_BITS(base) IORD(base, 5) -#define IOWR_ALTERA_AVALON_PIO_CLEAR_BITS(base, data) IOWR(base, 5, data) - - - -/* Defintions for direction-register operation with bi-directional PIOs */ -#define ALTERA_AVALON_PIO_DIRECTION_INPUT 0 -#define ALTERA_AVALON_PIO_DIRECTION_OUTPUT 1 - -#endif /* __ALTERA_AVALON_PIO_REGS_H__ */ diff --git a/software/qsys_tutorial_mem_bsp/drivers/src/altera_avalon_jtag_uart_fd.c b/software/qsys_tutorial_mem_bsp/drivers/src/altera_avalon_jtag_uart_fd.c deleted file mode 100644 index 53dfc3b..0000000 --- a/software/qsys_tutorial_mem_bsp/drivers/src/altera_avalon_jtag_uart_fd.c +++ /dev/null @@ -1,86 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "alt_types.h" -#include "sys/alt_dev.h" -#include "altera_avalon_jtag_uart.h" - -extern int altera_avalon_jtag_uart_read(altera_avalon_jtag_uart_state* sp, - char* buffer, int space, int flags); -extern int altera_avalon_jtag_uart_write(altera_avalon_jtag_uart_state* sp, - const char* ptr, int count, int flags); -extern int altera_avalon_jtag_uart_ioctl(altera_avalon_jtag_uart_state* sp, - int req, void* arg); -extern int altera_avalon_jtag_uart_close(altera_avalon_jtag_uart_state* sp, - int flags); - -/* ----------------------------------------------------------------------- */ -/* --------------------- WRAPPERS FOR ALT FD SUPPORT --------------------- */ -/* - * - */ - -int -altera_avalon_jtag_uart_read_fd(alt_fd* fd, char* buffer, int space) -{ - altera_avalon_jtag_uart_dev* dev = (altera_avalon_jtag_uart_dev*) fd->dev; - - return altera_avalon_jtag_uart_read(&dev->state, buffer, space, - fd->fd_flags); -} - -int -altera_avalon_jtag_uart_write_fd(alt_fd* fd, const char* buffer, int space) -{ - altera_avalon_jtag_uart_dev* dev = (altera_avalon_jtag_uart_dev*) fd->dev; - - return altera_avalon_jtag_uart_write(&dev->state, buffer, space, - fd->fd_flags); -} - -#ifndef ALTERA_AVALON_JTAG_UART_SMALL - -int -altera_avalon_jtag_uart_close_fd(alt_fd* fd) -{ - altera_avalon_jtag_uart_dev* dev = (altera_avalon_jtag_uart_dev*) fd->dev; - - return altera_avalon_jtag_uart_close(&dev->state, fd->fd_flags); -} - -int -altera_avalon_jtag_uart_ioctl_fd(alt_fd* fd, int req, void* arg) -{ - altera_avalon_jtag_uart_dev* dev = (altera_avalon_jtag_uart_dev*) fd->dev; - - return altera_avalon_jtag_uart_ioctl(&dev->state, req, arg); -} - -#endif /* ALTERA_AVALON_JTAG_UART_SMALL */ diff --git a/software/qsys_tutorial_mem_bsp/drivers/src/altera_avalon_jtag_uart_init.c b/software/qsys_tutorial_mem_bsp/drivers/src/altera_avalon_jtag_uart_init.c deleted file mode 100644 index 7317bec..0000000 --- a/software/qsys_tutorial_mem_bsp/drivers/src/altera_avalon_jtag_uart_init.c +++ /dev/null @@ -1,256 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include -#include -#include -#include - -#include - -#include "sys/alt_irq.h" -#include "sys/alt_alarm.h" -#include "sys/ioctl.h" -#include "alt_types.h" - -#include "altera_avalon_jtag_uart_regs.h" -#include "altera_avalon_jtag_uart.h" - -#include "sys/alt_log_printf.h" - -#ifndef ALTERA_AVALON_JTAG_UART_SMALL - -/* ----------------------------------------------------------- */ -/* ------------------------- FAST DRIVER --------------------- */ -/* ----------------------------------------------------------- */ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT -static void altera_avalon_jtag_uart_irq(void* context); -#else -static void altera_avalon_jtag_uart_irq(void* context, alt_u32 id); -#endif -static alt_u32 altera_avalon_jtag_uart_timeout(void* context); - -/* - * Driver initialization code. Register interrupts and start a timer - * which we can use to check whether the host is there. - * Return 1 on sucessful IRQ register and 0 on failure. - */ - -void altera_avalon_jtag_uart_init(altera_avalon_jtag_uart_state* sp, - int irq_controller_id, int irq) -{ - ALT_FLAG_CREATE(&sp->events, 0); - ALT_SEM_CREATE(&sp->read_lock, 1); - ALT_SEM_CREATE(&sp->write_lock, 1); - - /* enable read interrupts at the device */ - sp->irq_enable = ALTERA_AVALON_JTAG_UART_CONTROL_RE_MSK; - - IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base, sp->irq_enable); - - /* register the interrupt handler */ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - alt_ic_isr_register(irq_controller_id, irq, altera_avalon_jtag_uart_irq, - sp, NULL); -#else - alt_irq_register(irq, sp, altera_avalon_jtag_uart_irq); -#endif - - /* Register an alarm to go off every second to check for presence of host */ - sp->host_inactive = 0; - - if (alt_alarm_start(&sp->alarm, alt_ticks_per_second(), - &altera_avalon_jtag_uart_timeout, sp) < 0) - { - /* If we can't set the alarm then record "don't know if host present" - * and behave as though the host is present. - */ - sp->timeout = INT_MAX; - } - - /* ALT_LOG - see altera_hal/HAL/inc/sys/alt_log_printf.h */ - ALT_LOG_JTAG_UART_ALARM_REGISTER(sp, sp->base); -} - -/* - * Interrupt routine - */ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT -static void altera_avalon_jtag_uart_irq(void* context) -#else -static void altera_avalon_jtag_uart_irq(void* context, alt_u32 id) -#endif -{ - altera_avalon_jtag_uart_state* sp = (altera_avalon_jtag_uart_state*) context; - unsigned int base = sp->base; - - /* ALT_LOG - see altera_hal/HAL/inc/sys/alt_log_printf.h */ - ALT_LOG_JTAG_UART_ISR_FUNCTION(base, sp); - - for ( ; ; ) - { - unsigned int control = IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base); - - /* Return once nothing more to do */ - if ((control & (ALTERA_AVALON_JTAG_UART_CONTROL_RI_MSK | ALTERA_AVALON_JTAG_UART_CONTROL_WI_MSK)) == 0) - break; - - if (control & ALTERA_AVALON_JTAG_UART_CONTROL_RI_MSK) - { - /* process a read irq. Start by assuming that there is data in the - * receive FIFO (otherwise why would we have been interrupted?) - */ - unsigned int data = 1 << ALTERA_AVALON_JTAG_UART_DATA_RAVAIL_OFST; - - for ( ; ; ) - { - /* Check whether there is space in the buffer. If not then we must not - * read any characters from the buffer as they will be lost. - */ - unsigned int next = (sp->rx_in + 1) % ALTERA_AVALON_JTAG_UART_BUF_LEN; - if (next == sp->rx_out) - break; - - /* Try to remove a character from the FIFO and find out whether there - * are any more characters remaining. - */ - data = IORD_ALTERA_AVALON_JTAG_UART_DATA(base); - - if ((data & ALTERA_AVALON_JTAG_UART_DATA_RVALID_MSK) == 0) - break; - - sp->rx_buf[sp->rx_in] = (data & ALTERA_AVALON_JTAG_UART_DATA_DATA_MSK) >> ALTERA_AVALON_JTAG_UART_DATA_DATA_OFST; - sp->rx_in = (sp->rx_in + 1) % ALTERA_AVALON_JTAG_UART_BUF_LEN; - - /* Post an event to notify jtag_uart_read that a character has been read */ - ALT_FLAG_POST (sp->events, ALT_JTAG_UART_READ_RDY, OS_FLAG_SET); - } - - if (data & ALTERA_AVALON_JTAG_UART_DATA_RAVAIL_MSK) - { - /* If there is still data available here then the buffer is full - * so turn off receive interrupts until some space becomes available. - */ - sp->irq_enable &= ~ALTERA_AVALON_JTAG_UART_CONTROL_RE_MSK; - IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(base, sp->irq_enable); - - /* Dummy read to ensure IRQ is cleared prior to ISR completion */ - IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base); - } - } - - if (control & ALTERA_AVALON_JTAG_UART_CONTROL_WI_MSK) - { - /* process a write irq */ - unsigned int space = (control & ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_MSK) >> ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_OFST; - - while (space > 0 && sp->tx_out != sp->tx_in) - { - IOWR_ALTERA_AVALON_JTAG_UART_DATA(base, sp->tx_buf[sp->tx_out]); - - sp->tx_out = (sp->tx_out + 1) % ALTERA_AVALON_JTAG_UART_BUF_LEN; - - /* Post an event to notify jtag_uart_write that a character has been written */ - ALT_FLAG_POST (sp->events, ALT_JTAG_UART_WRITE_RDY, OS_FLAG_SET); - - space--; - } - - if (space > 0) - { - /* If we don't have any more data available then turn off the TX interrupt */ - sp->irq_enable &= ~ALTERA_AVALON_JTAG_UART_CONTROL_WE_MSK; - IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base, sp->irq_enable); - - /* Dummy read to ensure IRQ is cleared prior to ISR completion */ - IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base); - } - } - } -} - -/* - * Timeout routine is called every second - */ - -static alt_u32 -altera_avalon_jtag_uart_timeout(void* context) -{ - altera_avalon_jtag_uart_state* sp = (altera_avalon_jtag_uart_state *) context; - - unsigned int control = IORD_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base); - - if (control & ALTERA_AVALON_JTAG_UART_CONTROL_AC_MSK) - { - IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base, sp->irq_enable | ALTERA_AVALON_JTAG_UART_CONTROL_AC_MSK); - sp->host_inactive = 0; - } - else if (sp->host_inactive < INT_MAX - 2) { - sp->host_inactive++; - - if (sp->host_inactive >= sp->timeout) { - /* Post an event to indicate host is inactive (for jtag_uart_read */ - ALT_FLAG_POST (sp->events, ALT_JTAG_UART_TIMEOUT, OS_FLAG_SET); - } - } - - return alt_ticks_per_second(); -} - -/* - * The close() routine is implemented to drain the JTAG UART transmit buffer - * when not in "small" mode. This routine will wait for transimt data to be - * emptied unless a timeout from host-activity occurs. If the driver flags - * have been set to non-blocking mode, this routine will exit immediately if - * any data remains. This routine should be called indirectly (i.e. though - * the C library close() routine) so that the file descriptor associated - * with the relevant stream (i.e. stdout) can be closed as well. This routine - * does not manage file descriptors. - * - * The close routine is not implemented for the small driver; instead it will - * map to null. This is because the small driver simply waits while characters - * are transmitted; there is no interrupt-serviced buffer to empty - */ -int altera_avalon_jtag_uart_close(altera_avalon_jtag_uart_state* sp, int flags) -{ - /* - * Wait for all transmit data to be emptied by the JTAG UART ISR, or - * for a host-inactivity timeout, in which case transmit data will be lost - */ - while ( (sp->tx_out != sp->tx_in) && (sp->host_inactive < sp->timeout) ) { - if (flags & O_NONBLOCK) { - return -EWOULDBLOCK; - } - } - - return 0; -} - -#endif /* !ALTERA_AVALON_JTAG_UART_SMALL */ diff --git a/software/qsys_tutorial_mem_bsp/drivers/src/altera_avalon_jtag_uart_ioctl.c b/software/qsys_tutorial_mem_bsp/drivers/src/altera_avalon_jtag_uart_ioctl.c deleted file mode 100644 index cf71e6f..0000000 --- a/software/qsys_tutorial_mem_bsp/drivers/src/altera_avalon_jtag_uart_ioctl.c +++ /dev/null @@ -1,86 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include -#include -#include -#include - -#include - -#include "sys/ioctl.h" -#include "alt_types.h" - -#include "altera_avalon_jtag_uart_regs.h" -#include "altera_avalon_jtag_uart.h" - -#include "sys/alt_log_printf.h" - -#ifndef ALTERA_AVALON_JTAG_UART_SMALL - -/* ----------------------------------------------------------- */ -/* ------------------------- FAST DRIVER --------------------- */ -/* ----------------------------------------------------------- */ - -int -altera_avalon_jtag_uart_ioctl(altera_avalon_jtag_uart_state* sp, int req, - void* arg) -{ - int rc = -ENOTTY; - - switch (req) - { - case TIOCSTIMEOUT: - /* Set the time to wait until assuming host is not connected */ - if (sp->timeout != INT_MAX) - { - int timeout = *((int *)arg); - sp->timeout = (timeout >= 2 && timeout < INT_MAX) ? timeout : INT_MAX - 1; - rc = 0; - } - break; - - case TIOCGCONNECTED: - /* Find out whether host is connected */ - if (sp->timeout != INT_MAX) - { - *((int *)arg) = (sp->host_inactive < sp->timeout) ? 1 : 0; - rc = 0; - } - break; - - default: - break; - } - - return rc; -} - -#endif /* !ALTERA_AVALON_JTAG_UART_SMALL */ diff --git a/software/qsys_tutorial_mem_bsp/drivers/src/altera_avalon_jtag_uart_read.c b/software/qsys_tutorial_mem_bsp/drivers/src/altera_avalon_jtag_uart_read.c deleted file mode 100644 index 5657adb..0000000 --- a/software/qsys_tutorial_mem_bsp/drivers/src/altera_avalon_jtag_uart_read.c +++ /dev/null @@ -1,205 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include -#include -#include -#include - -#include - -#include "sys/alt_irq.h" -#include "sys/alt_alarm.h" -#include "sys/ioctl.h" -#include "alt_types.h" - -#include "altera_avalon_jtag_uart_regs.h" -#include "altera_avalon_jtag_uart.h" - -#include "sys/alt_log_printf.h" - -#ifdef __ucosii__ -#include "includes.h" -#endif /* __ucosii__ */ - -#ifdef ALTERA_AVALON_JTAG_UART_SMALL - -/* ----------------------------------------------------------- */ -/* ----------------------- SMALL DRIVER ---------------------- */ -/* ----------------------------------------------------------- */ - -/* Read routine. The small version blocks until it has at least one byte - * available, it then returns as much as is immediately available without - * waiting any more. It's performance will be very poor without - * interrupts. - */ - -int -altera_avalon_jtag_uart_read(altera_avalon_jtag_uart_state* sp, - char* buffer, int space, int flags) -{ - unsigned int base = sp->base; - - char * ptr = buffer; - char * end = buffer + space; - - while (ptr < end) - { - unsigned int data = IORD_ALTERA_AVALON_JTAG_UART_DATA(base); - - if (data & ALTERA_AVALON_JTAG_UART_DATA_RVALID_MSK) - *ptr++ = (data & ALTERA_AVALON_JTAG_UART_DATA_DATA_MSK) >> ALTERA_AVALON_JTAG_UART_DATA_DATA_OFST; - else if (ptr != buffer) - break; - else if(flags & O_NONBLOCK) - break; - - } - - if (ptr != buffer) - return ptr - buffer; - else if (flags & O_NONBLOCK) - return -EWOULDBLOCK; - else - return -EIO; -} - -#else /* !ALTERA_AVALON_JTAG_UART_SMALL */ - -/* ----------------------------------------------------------- */ -/* ----------------------- FAST DRIVER ----------------------- */ -/* ----------------------------------------------------------- */ - -int -altera_avalon_jtag_uart_read(altera_avalon_jtag_uart_state* sp, - char * buffer, int space, int flags) -{ - char * ptr = buffer; - - alt_irq_context context; - unsigned int n; - - /* - * When running in a multi threaded environment, obtain the "read_lock" - * semaphore. This ensures that reading from the device is thread-safe. - */ - ALT_SEM_PEND (sp->read_lock, 0); - - while (space > 0) - { - unsigned int in, out; - - /* Read as much data as possible */ - do - { - in = sp->rx_in; - out = sp->rx_out; - - if (in >= out) - n = in - out; - else - n = ALTERA_AVALON_JTAG_UART_BUF_LEN - out; - - if (n == 0) - break; /* No more data available */ - - if (n > space) - n = space; - - memcpy(ptr, sp->rx_buf + out, n); - ptr += n; - space -= n; - - sp->rx_out = (out + n) % ALTERA_AVALON_JTAG_UART_BUF_LEN; - } - while (space > 0); - - /* If we read any data then return it */ - if (ptr != buffer) - break; - - /* If in non-blocking mode then return error */ - if (flags & O_NONBLOCK) - break; - -#ifdef __ucosii__ - /* OS Present: Pend on a flag if the OS is running, otherwise spin */ - if(OSRunning == OS_TRUE) { - /* - * When running in a multi-threaded mode, we pend on the read event - * flag set and timeout event flag set in the isr. This avoids wasting CPU - * cycles waiting in this thread, when we could be doing something more - * profitable elsewhere. - */ - ALT_FLAG_PEND (sp->events, - ALT_JTAG_UART_READ_RDY | ALT_JTAG_UART_TIMEOUT, - OS_FLAG_WAIT_SET_ANY + OS_FLAG_CONSUME, - 0); - } - else { - /* Spin until more data arrives or until host disconnects */ - while (in == sp->rx_in && sp->host_inactive < sp->timeout) - ; - } -#else - /* No OS: Always spin */ - while (in == sp->rx_in && sp->host_inactive < sp->timeout) - ; -#endif /* __ucosii__ */ - - if (in == sp->rx_in) - break; - } - - /* - * Now that access to the circular buffer is complete, release the read - * semaphore so that other threads can access the buffer. - */ - - ALT_SEM_POST (sp->read_lock); - - if (ptr != buffer) - { - /* If we read any data then there is space in the buffer so enable interrupts */ - context = alt_irq_disable_all(); - sp->irq_enable |= ALTERA_AVALON_JTAG_UART_CONTROL_RE_MSK; - IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base, sp->irq_enable); - alt_irq_enable_all(context); - } - - if (ptr != buffer) - return ptr - buffer; - else if (flags & O_NONBLOCK) - return -EWOULDBLOCK; - else - return -EIO; -} - -#endif /* ALTERA_AVALON_JTAG_UART_SMALL */ diff --git a/software/qsys_tutorial_mem_bsp/drivers/src/altera_avalon_jtag_uart_write.c b/software/qsys_tutorial_mem_bsp/drivers/src/altera_avalon_jtag_uart_write.c deleted file mode 100644 index 11aeca1..0000000 --- a/software/qsys_tutorial_mem_bsp/drivers/src/altera_avalon_jtag_uart_write.c +++ /dev/null @@ -1,217 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include -#include -#include -#include - -#include - -#include "sys/alt_irq.h" -#include "sys/alt_alarm.h" -#include "sys/ioctl.h" -#include "alt_types.h" - -#include "altera_avalon_jtag_uart_regs.h" -#include "altera_avalon_jtag_uart.h" - -#include "sys/alt_log_printf.h" - -#ifdef __ucosii__ -#include "includes.h" -#endif /* __ucosii__ */ - -#ifdef ALTERA_AVALON_JTAG_UART_SMALL - -/* ----------------------------------------------------------- */ -/* ------------------------ SMALL DRIVER --------------------- */ -/* ----------------------------------------------------------- */ - -/* Write routine. The small version blocks when there is no space to write - * into, so it's performance will be very bad if you are writing more than - * one FIFOs worth of data. But you said you didn't want to use interrupts :-) - */ - -int altera_avalon_jtag_uart_write(altera_avalon_jtag_uart_state* sp, - const char * ptr, int count, int flags) -{ - unsigned int base = sp->base; - - const char * end = ptr + count; - - while (ptr < end) - if ((IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base) & ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_MSK) != 0) - IOWR_ALTERA_AVALON_JTAG_UART_DATA(base, *ptr++); - - return count; -} - -#else /* !ALTERA_AVALON_JTAG_UART_SMALL */ - -/* ----------------------------------------------------------- */ -/* ------------------------- FAST DRIVER --------------------- */ -/* ----------------------------------------------------------- */ - -int -altera_avalon_jtag_uart_write(altera_avalon_jtag_uart_state* sp, - const char * ptr, int count, int flags) -{ - /* Remove warning at optimisation level 03 by seting out to 0 */ - unsigned int in, out=0; - unsigned int n; - alt_irq_context context; - - const char * start = ptr; - - /* - * When running in a multi threaded environment, obtain the "write_lock" - * semaphore. This ensures that writing to the device is thread-safe. - */ - ALT_SEM_PEND (sp->write_lock, 0); - - do - { - /* Copy as much as we can into the transmit buffer */ - while (count > 0) - { - /* We need a stable value of the out pointer to calculate the space available */ - in = sp->tx_in; - out = sp->tx_out; - - if (in < out) - n = out - 1 - in; - else if (out > 0) - n = ALTERA_AVALON_JTAG_UART_BUF_LEN - in; - else - n = ALTERA_AVALON_JTAG_UART_BUF_LEN - 1 - in; - - if (n == 0) - break; - - if (n > count) - n = count; - - memcpy(sp->tx_buf + in, ptr, n); - ptr += n; - count -= n; - - sp->tx_in = (in + n) % ALTERA_AVALON_JTAG_UART_BUF_LEN; - } - - /* - * If interrupts are disabled then we could transmit here, we only need - * to enable interrupts if there is no space left in the FIFO - * - * For now kick the interrupt routine every time to make it transmit - * the data - */ - context = alt_irq_disable_all(); - sp->irq_enable |= ALTERA_AVALON_JTAG_UART_CONTROL_WE_MSK; - IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base, sp->irq_enable); - alt_irq_enable_all(context); - - /* - * If there is any data left then either return now or block until - * some has been sent - */ - /* consider: test whether there is anything there while doing this and delay for at most 2s. */ - if (count > 0) - { - if (flags & O_NONBLOCK) - break; - -#ifdef __ucosii__ - /* OS Present: Pend on a flag if the OS is running, otherwise spin */ - if(OSRunning == OS_TRUE) { - /* - * When running in a multi-threaded mode, we pend on the write event - * flag set or the timeout flag in the isr. This avoids wasting CPU - * cycles waiting in this thread, when we could be doing something - * more profitable elsewhere. - */ -#ifdef ALTERA_AVALON_JTAG_UART_IGNORE_FIFO_FULL_ERROR - if(!sp->host_inactive) -#endif - ALT_FLAG_PEND (sp->events, - ALT_JTAG_UART_WRITE_RDY | ALT_JTAG_UART_TIMEOUT, - OS_FLAG_WAIT_SET_ANY + OS_FLAG_CONSUME, - 0); - } - else { - /* - * OS not running: Wait for data to be removed from buffer. - * Once the interrupt routine has removed some data then we - * will be able to insert some more. - */ - while (out == sp->tx_out && sp->host_inactive < sp->timeout) - ; - } -#else - /* - * No OS present: Always wait for data to be removed from buffer. Once - * the interrupt routine has removed some data then we will be able to - * insert some more. - */ - while (out == sp->tx_out && sp->host_inactive < sp->timeout) - ; -#endif /* __ucosii__ */ - - if (out == sp->tx_out) - break; - } - } - while (count > 0); - - /* - * Now that access to the circular buffer is complete, release the write - * semaphore so that other threads can access the buffer. - */ - ALT_SEM_POST (sp->write_lock); - - if (ptr != start) - return ptr - start; - else if (flags & O_NONBLOCK) - return -EWOULDBLOCK; -#ifdef ALTERA_AVALON_JTAG_UART_IGNORE_FIFO_FULL_ERROR - else if (sp->host_inactive >= sp->timeout) { - /* - * Reset the software FIFO, hardware FIFO could not be reset. - * Just throw away characters without reporting error. - */ - sp->tx_out = sp->tx_in = 0; - return ptr - start + count; - } -#endif - else - return -EIO; /* Host not connected */ -} - -#endif /* ALTERA_AVALON_JTAG_UART_SMALL */ diff --git a/software/qsys_tutorial_mem_bsp/libhal_bsp.a b/software/qsys_tutorial_mem_bsp/libhal_bsp.a deleted file mode 100644 index 20b96a6..0000000 --- a/software/qsys_tutorial_mem_bsp/libhal_bsp.a +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/linker.h b/software/qsys_tutorial_mem_bsp/linker.h deleted file mode 100644 index c244e99..0000000 --- a/software/qsys_tutorial_mem_bsp/linker.h +++ /dev/null @@ -1,101 +0,0 @@ -/* - * linker.h - Linker script mapping information - * - * Machine generated for CPU 'nios2_processor' in SOPC Builder design 'nios_system' - * SOPC Builder design path: C:/Users/takayun/Documents/DE2-115/qsys_tutorial/nios_system.sopcinfo - * - * Generated: Fri Nov 25 16:59:33 JST 2016 - */ - -/* - * DO NOT MODIFY THIS FILE - * - * Changing this file will have subtle consequences - * which will almost certainly lead to a nonfunctioning - * system. If you do modify this file, be aware that your - * changes will be overwritten and lost when this file - * is generated again. - * - * DO NOT MODIFY THIS FILE - */ - -/* - * License Agreement - * - * Copyright (c) 2008 - * Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - * - * This agreement shall be governed in all respects by the laws of the State - * of California and by the laws of the United States of America. - */ - -#ifndef __LINKER_H_ -#define __LINKER_H_ - - -/* - * BSP controls alt_load() behavior in crt0. - * - */ - -#define ALT_LOAD_EXPLICITLY_CONTROLLED - - -/* - * Base address and span (size in bytes) of each linker region - * - */ - -#define ONCHIP_MEMORY_REGION_BASE 0x20 -#define ONCHIP_MEMORY_REGION_SPAN 16352 -#define RESET_REGION_BASE 0x0 -#define RESET_REGION_SPAN 32 - - -/* - * Devices associated with code sections - * - */ - -#define ALT_EXCEPTIONS_DEVICE ONCHIP_MEMORY -#define ALT_RESET_DEVICE ONCHIP_MEMORY -#define ALT_RODATA_DEVICE ONCHIP_MEMORY -#define ALT_RWDATA_DEVICE ONCHIP_MEMORY -#define ALT_TEXT_DEVICE ONCHIP_MEMORY - - -/* - * Initialization code at the reset address is allowed (e.g. no external bootloader). - * - */ - -#define ALT_ALLOW_CODE_AT_RESET - - -/* - * The alt_load() facility is called from crt0 to copy sections into RAM. - * - */ - -#define ALT_LOAD_COPY_RWDATA - -#endif /* __LINKER_H_ */ diff --git a/software/qsys_tutorial_mem_bsp/linker.x b/software/qsys_tutorial_mem_bsp/linker.x deleted file mode 100644 index b5482ca..0000000 --- a/software/qsys_tutorial_mem_bsp/linker.x +++ /dev/null @@ -1,385 +0,0 @@ -/* - * linker.x - Linker script - * - * Machine generated for CPU 'nios2_processor' in SOPC Builder design 'nios_system' - * SOPC Builder design path: C:/Users/takayun/Documents/DE2-115/qsys_tutorial/nios_system.sopcinfo - * - * Generated: Fri Nov 25 16:59:33 JST 2016 - */ - -/* - * DO NOT MODIFY THIS FILE - * - * Changing this file will have subtle consequences - * which will almost certainly lead to a nonfunctioning - * system. If you do modify this file, be aware that your - * changes will be overwritten and lost when this file - * is generated again. - * - * DO NOT MODIFY THIS FILE - */ - -/* - * License Agreement - * - * Copyright (c) 2008 - * Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - * - * This agreement shall be governed in all respects by the laws of the State - * of California and by the laws of the United States of America. - */ - -MEMORY -{ - reset : ORIGIN = 0x0, LENGTH = 32 - onchip_memory : ORIGIN = 0x20, LENGTH = 16352 -} - -/* Define symbols for each memory base-address */ -__alt_mem_onchip_memory = 0x0; - -OUTPUT_FORMAT( "elf32-littlenios2", - "elf32-littlenios2", - "elf32-littlenios2" ) -OUTPUT_ARCH( nios2 ) -ENTRY( _start ) - -/* - * The alt_load() facility is enabled. This typically happens when there isn't - * an external bootloader (e.g. flash bootloader). - * The LMA (aka physical address) of each loaded section is - * set to the .text memory device. - * The HAL alt_load() routine called from crt0 copies sections from - * the .text memory to RAM as needed. - */ - -SECTIONS -{ - - /* - * Output sections associated with reset and exceptions (they have to be first) - */ - - .entry : - { - KEEP (*(.entry)) - } > reset - - .exceptions : - { - PROVIDE (__ram_exceptions_start = ABSOLUTE(.)); - . = ALIGN(0x20); - KEEP (*(.irq)); - KEEP (*(.exceptions.entry.label)); - KEEP (*(.exceptions.entry.user)); - KEEP (*(.exceptions.entry)); - KEEP (*(.exceptions.irqtest.user)); - KEEP (*(.exceptions.irqtest)); - KEEP (*(.exceptions.irqhandler.user)); - KEEP (*(.exceptions.irqhandler)); - KEEP (*(.exceptions.irqreturn.user)); - KEEP (*(.exceptions.irqreturn)); - KEEP (*(.exceptions.notirq.label)); - KEEP (*(.exceptions.notirq.user)); - KEEP (*(.exceptions.notirq)); - KEEP (*(.exceptions.soft.user)); - KEEP (*(.exceptions.soft)); - KEEP (*(.exceptions.unknown.user)); - KEEP (*(.exceptions.unknown)); - KEEP (*(.exceptions.exit.label)); - KEEP (*(.exceptions.exit.user)); - KEEP (*(.exceptions.exit)); - KEEP (*(.exceptions)); - PROVIDE (__ram_exceptions_end = ABSOLUTE(.)); - } > onchip_memory - - PROVIDE (__flash_exceptions_start = LOADADDR(.exceptions)); - - .text : - { - /* - * All code sections are merged into the text output section, along with - * the read only data sections. - * - */ - - PROVIDE (stext = ABSOLUTE(.)); - - *(.interp) - *(.hash) - *(.dynsym) - *(.dynstr) - *(.gnu.version) - *(.gnu.version_d) - *(.gnu.version_r) - *(.rel.init) - *(.rela.init) - *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) - *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) - *(.rel.fini) - *(.rela.fini) - *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) - *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) - *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) - *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) - *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) - *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) - *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) - *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) - *(.rel.ctors) - *(.rela.ctors) - *(.rel.dtors) - *(.rela.dtors) - *(.rel.got) - *(.rela.got) - *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) - *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) - *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) - *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) - *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) - *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) - *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) - *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) - *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) - *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) - *(.rel.plt) - *(.rela.plt) - *(.rel.dyn) - - KEEP (*(.init)) - *(.plt) - *(.text .stub .text.* .gnu.linkonce.t.*) - - /* .gnu.warning sections are handled specially by elf32.em. */ - - *(.gnu.warning.*) - KEEP (*(.fini)) - PROVIDE (__etext = ABSOLUTE(.)); - PROVIDE (_etext = ABSOLUTE(.)); - PROVIDE (etext = ABSOLUTE(.)); - - *(.eh_frame_hdr) - /* Ensure the __preinit_array_start label is properly aligned. We - could instead move the label definition inside the section, but - the linker would then create the section even if it turns out to - be empty, which isn't pretty. */ - . = ALIGN(4); - PROVIDE (__preinit_array_start = ABSOLUTE(.)); - *(.preinit_array) - PROVIDE (__preinit_array_end = ABSOLUTE(.)); - PROVIDE (__init_array_start = ABSOLUTE(.)); - *(.init_array) - PROVIDE (__init_array_end = ABSOLUTE(.)); - PROVIDE (__fini_array_start = ABSOLUTE(.)); - *(.fini_array) - PROVIDE (__fini_array_end = ABSOLUTE(.)); - SORT(CONSTRUCTORS) - KEEP (*(.eh_frame)) - *(.gcc_except_table) - *(.dynamic) - PROVIDE (__CTOR_LIST__ = ABSOLUTE(.)); - KEEP (*(.ctors)) - KEEP (*(SORT(.ctors.*))) - PROVIDE (__CTOR_END__ = ABSOLUTE(.)); - PROVIDE (__DTOR_LIST__ = ABSOLUTE(.)); - KEEP (*(.dtors)) - KEEP (*(SORT(.dtors.*))) - PROVIDE (__DTOR_END__ = ABSOLUTE(.)); - KEEP (*(.jcr)) - . = ALIGN(4); - } > onchip_memory = 0x3a880100 /* Nios II NOP instruction */ - - .rodata : - { - PROVIDE (__ram_rodata_start = ABSOLUTE(.)); - . = ALIGN(4); - *(.rodata .rodata.* .gnu.linkonce.r.*) - *(.rodata1) - . = ALIGN(4); - PROVIDE (__ram_rodata_end = ABSOLUTE(.)); - } > onchip_memory - - PROVIDE (__flash_rodata_start = LOADADDR(.rodata)); - - /* - * - * This section's LMA is set to the .text region. - * crt0 will copy to this section's specified mapped region virtual memory address (VMA) - * - * .rwdata region equals the .text region, and is set to be loaded into .text region. - * This requires two copies of .rwdata in the .text region. One read writable at VMA. - * and one read-only at LMA. crt0 will copy from LMA to VMA on reset - * - */ - - .rwdata LOADADDR (.rodata) + SIZEOF (.rodata) : AT ( LOADADDR (.rodata) + SIZEOF (.rodata)+ SIZEOF (.rwdata) ) - { - PROVIDE (__ram_rwdata_start = ABSOLUTE(.)); - . = ALIGN(4); - *(.got.plt) *(.got) - *(.data1) - *(.data .data.* .gnu.linkonce.d.*) - - _gp = ABSOLUTE(. + 0x8000); - PROVIDE(gp = _gp); - - *(.rwdata .rwdata.*) - *(.sdata .sdata.* .gnu.linkonce.s.*) - *(.sdata2 .sdata2.* .gnu.linkonce.s2.*) - - . = ALIGN(4); - _edata = ABSOLUTE(.); - PROVIDE (edata = ABSOLUTE(.)); - PROVIDE (__ram_rwdata_end = ABSOLUTE(.)); - } > onchip_memory - - PROVIDE (__flash_rwdata_start = LOADADDR(.rwdata)); - - /* - * - * This section's LMA is set to the .text region. - * crt0 will copy to this section's specified mapped region virtual memory address (VMA) - * - */ - - .bss LOADADDR (.rwdata) + SIZEOF (.rwdata) : AT ( LOADADDR (.rwdata) + SIZEOF (.rwdata) ) - { - __bss_start = ABSOLUTE(.); - PROVIDE (__sbss_start = ABSOLUTE(.)); - PROVIDE (___sbss_start = ABSOLUTE(.)); - - *(.dynsbss) - *(.sbss .sbss.* .gnu.linkonce.sb.*) - *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) - *(.scommon) - - PROVIDE (__sbss_end = ABSOLUTE(.)); - PROVIDE (___sbss_end = ABSOLUTE(.)); - - *(.dynbss) - *(.bss .bss.* .gnu.linkonce.b.*) - *(COMMON) - - . = ALIGN(4); - __bss_end = ABSOLUTE(.); - } > onchip_memory - - /* - * - * One output section mapped to the associated memory device for each of - * the available memory devices. These are not used by default, but can - * be used by user applications by using the .section directive. - * - * The output section used for the heap is treated in a special way, - * i.e. the symbols "end" and "_end" are added to point to the heap start. - * - * Because alt_load() is enabled, these sections have - * their LMA set to be loaded into the .text memory region. - * However, the alt_load() code will NOT automatically copy - * these sections into their mapped memory region. - * - */ - - /* - * - * This section's LMA is set to the .text region. - * crt0 will copy to this section's specified mapped region virtual memory address (VMA) - * - */ - - .onchip_memory LOADADDR (.bss) + SIZEOF (.bss) : AT ( LOADADDR (.bss) + SIZEOF (.bss) ) - { - PROVIDE (_alt_partition_onchip_memory_start = ABSOLUTE(.)); - *(.onchip_memory. onchip_memory.*) - . = ALIGN(4); - PROVIDE (_alt_partition_onchip_memory_end = ABSOLUTE(.)); - _end = ABSOLUTE(.); - end = ABSOLUTE(.); - __alt_stack_base = ABSOLUTE(.); - } > onchip_memory - - PROVIDE (_alt_partition_onchip_memory_load_addr = LOADADDR(.onchip_memory)); - - /* - * Stabs debugging sections. - * - */ - - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - /* DWARF debug sections. - Symbols in the DWARF debugging sections are relative to the beginning - of the section so we begin them at 0. */ - /* DWARF 1 */ - .debug 0 : { *(.debug) } - .line 0 : { *(.line) } - /* GNU DWARF 1 extensions */ - .debug_srcinfo 0 : { *(.debug_srcinfo) } - .debug_sfnames 0 : { *(.debug_sfnames) } - /* DWARF 1.1 and DWARF 2 */ - .debug_aranges 0 : { *(.debug_aranges) } - .debug_pubnames 0 : { *(.debug_pubnames) } - /* DWARF 2 */ - .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_line 0 : { *(.debug_line) } - .debug_frame 0 : { *(.debug_frame) } - .debug_str 0 : { *(.debug_str) } - .debug_loc 0 : { *(.debug_loc) } - .debug_macinfo 0 : { *(.debug_macinfo) } - /* SGI/MIPS DWARF 2 extensions */ - .debug_weaknames 0 : { *(.debug_weaknames) } - .debug_funcnames 0 : { *(.debug_funcnames) } - .debug_typenames 0 : { *(.debug_typenames) } - .debug_varnames 0 : { *(.debug_varnames) } - - /* Altera debug extensions */ - .debug_alt_sim_info 0 : { *(.debug_alt_sim_info) } -} - -/* provide a pointer for the stack */ - -/* - * Don't override this, override the __alt_stack_* symbols instead. - */ -__alt_data_end = 0x4000; - -/* - * The next two symbols define the location of the default stack. You can - * override them to move the stack to a different memory. - */ -PROVIDE( __alt_stack_pointer = __alt_data_end ); -PROVIDE( __alt_stack_limit = __alt_stack_base ); - -/* - * This symbol controls where the start of the heap is. If the stack is - * contiguous with the heap then the stack will contract as memory is - * allocated to the heap. - * Override this symbol to put the heap in a different memory. - */ -PROVIDE( __alt_heap_start = end ); -PROVIDE( __alt_heap_limit = 0x4000 ); diff --git a/software/qsys_tutorial_mem_bsp/mem_init.mk b/software/qsys_tutorial_mem_bsp/mem_init.mk deleted file mode 100644 index 8529cc2..0000000 --- a/software/qsys_tutorial_mem_bsp/mem_init.mk +++ /dev/null @@ -1,322 +0,0 @@ - -######################################################################### -####### M E M I N I T M A K E F I L E C O N T E N T ###### -######################################################################### - -######################################################################### -# This file is intended to be included by public.mk -# -# -# The following variables must be defined before including this file: -# - ELF -# -# The following variables may be defined to override the default behavior: -# - HDL_SIM_DIR -# - HDL_SIM_INSTALL_DIR -# - MEM_INIT_DIR -# - MEM_INIT_INSTALL_DIR -# - QUARTUS_PROJECT_DIR -# - SOPC_NAME -# - SIM_OPTIMIZE -# - RESET_ADDRESS -# -######################################################################### - -ifeq ($(MEM_INIT_FILE),) -# MEM_INIT_FILE should be set equal to the working relative path to this -# mem_init.mk makefile fragment -MEM_INIT_FILE := $(wildcard $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))) -endif - -ifeq ($(ELF2DAT),) -ELF2DAT := elf2dat -endif - -ifeq ($(ELF2HEX),) -ELF2HEX := elf2hex -endif - -ifeq ($(ELF2FLASH),) -ELF2FLASH := elf2flash -endif - -ifeq ($(FLASH2DAT),) -FLASH2DAT := flash2dat -endif - -ifeq ($(NM),) -NM := nios2-elf-nm -endif - -ifeq ($(MKDIR),) -MKDIR := mkdir -p -endif - -ifeq ($(RM),) -RM := rm -f -endif - -ifeq ($(CP),) -CP := cp -endif - -ifeq ($(ECHO),) -ECHO := echo -endif - -MEM_INIT_DIR ?= mem_init -HDL_SIM_DIR ?= $(MEM_INIT_DIR)/hdl_sim - -ifdef QUARTUS_PROJECT_DIR -MEM_INIT_INSTALL_DIR ?= $(patsubst %/,%,$(QUARTUS_PROJECT_DIR)) -ifdef SOPC_NAME -HDL_SIM_INSTALL_DIR ?= $(patsubst %/,%,$(QUARTUS_PROJECT_DIR))/$(SOPC_NAME)_sim -endif -endif - -MEM_INIT_DESCRIPTOR_FILE ?= $(MEM_INIT_DIR)/meminit.spd - -MEM_INIT_QIP_FILE ?= $(MEM_INIT_DIR)/meminit.qip - -#------------------------------------- -# Default Flash Boot Loaders -#------------------------------------- - -BOOT_LOADER_PATH ?= $(SOPC_KIT_NIOS2)/components/altera_nios2 -BOOT_LOADER_CFI ?= $(BOOT_LOADER_PATH)/boot_loader_cfi.srec -BOOT_LOADER_CFI_BE ?= $(BOOT_LOADER_PATH)/boot_loader_cfi_be.srec - - -#------------------------------------- -# Default Target -#------------------------------------- - -.PHONY: default_mem_init -ifeq ($(QSYS),1) -default_mem_init: mem_init_generate -else -default_mem_init: mem_init_install -endif -#------------------------------------- -# Runtime Macros -#------------------------------------- - -define post-process-info - @echo Post-processing to create $@... -endef - -target_stem = $(notdir $(basename $@)) - -mem_start_address = $($(target_stem)_START) -mem_end_address = $($(target_stem)_END) -mem_width = $($(target_stem)_WIDTH) -mem_endianness = $($(target_stem)_ENDIANNESS) -mem_create_lanes = $($(target_stem)_CREATE_LANES) - -mem_pad_flag = $($(target_stem)_PAD_FLAG) -mem_reloc_input_flag = $($(target_stem)_RELOC_INPUT_FLAG) -mem_no_zero_fill_flag = $($(target_stem)_NO_ZERO_FILL_FLAG) - -flash_mem_epcs_flag = $($(target_stem)_EPCS_FLAGS) -flash_mem_cfi_flag = $($(target_stem)_CFI_FLAGS) -flash_mem_boot_loader_flag = $($(target_stem)_BOOT_LOADER_FLAG) - -elf2dat_extra_args = $(mem_pad_flag) -elf2hex_extra_args = $(mem_no_zero_fill_flag) -elf2flash_extra_args = $(flash_mem_cfi_flag) $(flash_mem_epcs_flag) $(flash_mem_boot_loader_flag) -flash2dat_extra_args = $(mem_pad_flag) $(mem_reloc_input_flag) - -#------------------------------------------------------------------------------ -# BSP SPECIFIC CONTENT -# -# The content below is controlled by the BSP and SOPC System -#------------------------------------------------------------------------------ -#START OF BSP SPECIFIC - -#------------------------------------- -# Global Settings -#------------------------------------- - - -# The following TYPE comment allows tools to identify the 'type' of target this -# makefile is associated with. -# TYPE: BSP_MEMINIT_MAKEFILE - -# This following VERSION comment indicates the version of the tool used to -# generate this makefile. A makefile variable is provided for VERSION as well. -# ACDS_VERSION: 13.0sp1 -ACDS_VERSION := 13.0sp1 - -# This following BUILD_NUMBER comment indicates the build number of the tool -# used to generate this makefile. -# BUILD_NUMBER: 232 - -# Optimize for simulation -SIM_OPTIMIZE ?= 0 - -# The CPU reset address as needed by elf2flash -RESET_ADDRESS ?= 0x00000000 - -#------------------------------------- -# Pre-Initialized Memory Descriptions -#------------------------------------- - -# Memory: onchip_memory -MEM_0 := nios_system_onchip_memory -$(MEM_0)_NAME := onchip_memory -$(MEM_0)_MEM_INIT_FILE_PARAM_NAME := INIT_FILE -HEX_FILES += $(MEM_INIT_DIR)/$(MEM_0).hex -MEM_INIT_INSTALL_FILES += $(MEM_INIT_INSTALL_DIR)/$(MEM_0).hex -DAT_FILES += $(HDL_SIM_DIR)/$(MEM_0).dat -HDL_SIM_INSTALL_FILES += $(HDL_SIM_INSTALL_DIR)/$(MEM_0).dat -SYM_FILES += $(HDL_SIM_DIR)/$(MEM_0).sym -HDL_SIM_INSTALL_FILES += $(HDL_SIM_INSTALL_DIR)/$(MEM_0).sym -$(MEM_0)_START := 0x00000000 -$(MEM_0)_END := 0x00003fff -$(MEM_0)_HIERARCHICAL_PATH := onchip_memory -$(MEM_0)_WIDTH := 32 -$(MEM_0)_ENDIANNESS := --little-endian-mem -$(MEM_0)_CREATE_LANES := 0 - -.PHONY: onchip_memory -onchip_memory: check_elf_exists $(MEM_INIT_DIR)/$(MEM_0).hex $(HDL_SIM_DIR)/$(MEM_0).dat $(HDL_SIM_DIR)/$(MEM_0).sym - - -#END OF BSP SPECIFIC - -#------------------------------------- -# Pre-Initialized Memory Targets -#------------------------------------- - -.PHONY: mem_init_install mem_init_generate mem_init_clean - -ifeq ($(QSYS),1) -# Target mem_init_install is deprecated for QSys based systems -# To initialize onchip memories for Quartus II Synthesis with Qsys based systems: -# 1) Use "make mem_init_genearate" -# 2) Add the generated mem_init/meminit.qip file to your Quartus II Project -# -mem_init_install: - $(error Deprecated Makefile Target: '$@'. Use target 'mem_init_generate' and then add $(MEM_INIT_QIP_FILE) to your Quartus II Project) - -else # QSYS != 1, if SopcBuilder based system - -ifneq ($(MEM_INIT_INSTALL_DIR),) -mem_init_install: $(MEM_INIT_INSTALL_FILES) -endif - -ifneq ($(HDL_SIM_INSTALL_DIR),) -mem_init_install: $(HDL_SIM_INSTALL_FILES) -endif - -mem_init_install: mem_init_generate -ifeq ($(MEM_INIT_INSTALL_DIR),) - @echo "WARNING: MEM_INIT_INSTALL_DIR not set. Set your QUARTUS_PROJECT_DIR environment variable." -endif -ifeq ($(HDL_SIM_INSTALL_DIR),) - @echo "WARNING: HDL_SIM_INSTALL_DIR not set. Set your QUARTUS_PROJECT_DIR and SOPC_NAME environment variable." -endif - -$(MEM_INIT_INSTALL_FILES): $(MEM_INIT_INSTALL_DIR)/%: $(MEM_INIT_DIR)/% - @$(MKDIR) $(@D) - @$(CP) -v $< $@ - -$(HDL_SIM_INSTALL_FILES): $(HDL_SIM_INSTALL_DIR)/%: $(HDL_SIM_DIR)/% - @$(MKDIR) $(@D) - @$(CP) -v $< $@ - -endif # QSYS == 1 - - -mem_init_generate: hex dat sym flash $(MEM_INIT_DESCRIPTOR_FILE) $(MEM_INIT_QIP_FILE) - -mem_init_clean: - @$(RM) -r $(MEM_INIT_DIR) $(HDL_SIM_DIR) $(FLASH_FILES) - -.PHONY: hex dat sym flash - -hex: check_elf_exists $(HEX_FILES) - -dat: check_elf_exists $(DAT_FILES) - -sym: check_elf_exists $(SYM_FILES) - -flash: check_elf_exists $(FLASH_FILES) - -#------------------------------------- -# Pre-Initialized Memory Rules -#------------------------------------- - -.PHONY: check_elf_exists -check_elf_exists: $(ELF) -ifeq ($(ELF),) - $(error ELF var not set in mem_init.mk) -endif - -$(filter-out $(FLASH_DAT_FILES),$(DAT_FILES)): %.dat: $(ELF) - $(post-process-info) - @$(MKDIR) $(@D) - bash -c '$(ELF2DAT) --infile=$< --outfile=$@ \ - --base=$(mem_start_address) --end=$(mem_end_address) --width=$(mem_width) \ - $(mem_endianness) --create-lanes=$(mem_create_lanes) $(elf2dat_extra_args)' - -$(foreach i,0 1 2 3 4 5 6 7,%_lane$(i).dat): %.dat - @true - -$(HEX_FILES): %.hex: $(ELF) - $(post-process-info) - @$(MKDIR) $(@D) - bash -c '$(ELF2HEX) $< $(mem_start_address) $(mem_end_address) --width=$(mem_width) \ - $(mem_endianness) --create-lanes=$(mem_create_lanes) $(elf2hex_extra_args) $@' - -$(SYM_FILES): %.sym: $(ELF) - $(post-process-info) - @$(MKDIR) $(@D) - $(NM) -n $< > $@ - -$(FLASH_FILES): %.flash: $(ELF) - $(post-process-info) - @$(MKDIR) $(@D) - bash -c '$(ELF2FLASH) --input=$< --outfile=$@ --sim_optimize=$(SIM_OPTIMIZE) $(mem_endianness) \ - $(elf2flash_extra_args)' - -# -# Function generate_spd_entry -# Arg1: path to the memory initialization file -# Arg2: Type HEX or DAT -# Arg3: Output spd file to append -gen_spd_entry.BASE_FILE = $(basename $(notdir $1)) -gen_spd_entry.PARAM_NAME = $($(gen_spd_entry.BASE_FILE)_MEM_INIT_FILE_PARAM_NAME) -gen_spd_entry.MEM_PATH = $($(gen_spd_entry.BASE_FILE)_HIERARCHICAL_PATH) -gen_spd_entry.SETTINGS = $(strip \ - path=\"$1\" \ - type=\"$2\" \ - $(if $(gen_spd_entry.PARAM_NAME),initParamName=\"$(gen_spd_entry.PARAM_NAME)\") \ - $(if $(gen_spd_entry.MEM_PATH),memoryPath=\"$(gen_spd_entry.MEM_PATH)\") \ -) -define gen_spd_entry -$(ECHO) "" >> $3 -endef - -$(MEM_INIT_DESCRIPTOR_FILE).DAT_FILESET := $(patsubst $(dir $(MEM_INIT_DESCRIPTOR_FILE))%,%,$(DAT_FILES)) -$(MEM_INIT_DESCRIPTOR_FILE).HEX_FILESET := $(patsubst $(dir $(MEM_INIT_DESCRIPTOR_FILE))%,%,$(HEX_FILES)) - -$(MEM_INIT_DESCRIPTOR_FILE): %.spd: $(MEM_INIT_FILE) - $(post-process-info) - @$(MKDIR) $(@D) - @$(RM) $@ - @$(ECHO) "" > $@ - @$(ECHO) "" >> $@ - @$(foreach dat_file,$($@.DAT_FILESET),$(call gen_spd_entry,$(dat_file),DAT,$@) &&)true - @$(foreach hex_file,$($@.HEX_FILESET),$(call gen_spd_entry,$(hex_file),HEX,$@) &&)true - @$(ECHO) "" >> $@ - -.DELETE_ON_ERROR: $(MEM_INIT_DESCRIPTOR_FILE) - -$(MEM_INIT_QIP_FILE): %.qip: $(MEM_INIT_FILE) - $(post-process-info) - @$(MKDIR) $(@D) - @$(RM) $@ - @$(ECHO) "set_global_assignment -name SEARCH_PATH $$::quartus(qip_path)" > $@ - -.DELETE_ON_ERROR: $(MEM_INIT_QIP_FILE) diff --git a/software/qsys_tutorial_mem_bsp/memory.gdb b/software/qsys_tutorial_mem_bsp/memory.gdb deleted file mode 100644 index 4f559e7..0000000 --- a/software/qsys_tutorial_mem_bsp/memory.gdb +++ /dev/null @@ -1,50 +0,0 @@ -# memory.gdb - GDB memory region definitions -# -# Machine generated for CPU 'nios2_processor' in SOPC Builder design 'nios_system' -# SOPC Builder design path: C:/Users/takayun/Documents/DE2-115/qsys_tutorial/nios_system.sopcinfo -# -# Generated: Fri Nov 25 16:59:33 JST 2016 - -# DO NOT MODIFY THIS FILE -# -# Changing this file will have subtle consequences -# which will almost certainly lead to a nonfunctioning -# system. If you do modify this file, be aware that your -# changes will be overwritten and lost when this file -# is generated again. -# -# DO NOT MODIFY THIS FILE - -# License Agreement -# -# Copyright (c) 2008 -# Altera Corporation, San Jose, California, USA. -# All rights reserved. -# -# 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. -# -# This agreement shall be governed in all respects by the laws of the State -# of California and by the laws of the United States of America. - -# Define memory regions for each memory connected to the CPU. -# The cache attribute is specified which improves GDB performance -# by allowing GDB to cache memory contents on the host. - -# onchip_memory -memory 0x0 0x4000 cache diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_alarm_start.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_alarm_start.d deleted file mode 100644 index 3bb20ea..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_alarm_start.d +++ /dev/null @@ -1,22 +0,0 @@ -obj/HAL/src/alt_alarm_start.o: HAL/src/alt_alarm_start.c \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h system.h linker.h - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_alarm_start.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_alarm_start.o deleted file mode 100644 index 365ebcc..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_alarm_start.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_busy_sleep.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_busy_sleep.d deleted file mode 100644 index e93e80c..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_busy_sleep.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_busy_sleep.o: HAL/src/alt_busy_sleep.c system.h linker.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_busy_sleep.h - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_busy_sleep.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_busy_sleep.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_busy_sleep.o deleted file mode 100644 index 128d22d..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_busy_sleep.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_close.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_close.d deleted file mode 100644 index fbbab9c..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_close.d +++ /dev/null @@ -1,34 +0,0 @@ -obj/HAL/src/alt_close.o: HAL/src/alt_close.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h \ - HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_close.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_close.o deleted file mode 100644 index 1cb4a91..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_close.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_dcache_flush.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_dcache_flush.d deleted file mode 100644 index a0eaf8a..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_dcache_flush.d +++ /dev/null @@ -1,15 +0,0 @@ -obj/HAL/src/alt_dcache_flush.o: HAL/src/alt_dcache_flush.c \ - HAL/inc/nios2.h system.h linker.h HAL/inc/alt_types.h \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h - -HAL/inc/nios2.h: - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_dcache_flush.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_dcache_flush.o deleted file mode 100644 index 969dcdf..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_dcache_flush.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_dcache_flush_all.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_dcache_flush_all.d deleted file mode 100644 index 792c3e4..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_dcache_flush_all.d +++ /dev/null @@ -1,15 +0,0 @@ -obj/HAL/src/alt_dcache_flush_all.o: HAL/src/alt_dcache_flush_all.c \ - HAL/inc/nios2.h system.h linker.h HAL/inc/alt_types.h \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h - -HAL/inc/nios2.h: - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_dcache_flush_all.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_dcache_flush_all.o deleted file mode 100644 index 68f957a..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_dcache_flush_all.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_dcache_flush_no_writeback.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_dcache_flush_no_writeback.d deleted file mode 100644 index 867c42b..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_dcache_flush_no_writeback.d +++ /dev/null @@ -1,16 +0,0 @@ -obj/HAL/src/alt_dcache_flush_no_writeback.o: \ - HAL/src/alt_dcache_flush_no_writeback.c HAL/inc/nios2.h system.h \ - linker.h HAL/inc/alt_types.h HAL/inc/sys/alt_cache.h \ - HAL/inc/alt_types.h - -HAL/inc/nios2.h: - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_dcache_flush_no_writeback.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_dcache_flush_no_writeback.o deleted file mode 100644 index cf308b3..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_dcache_flush_no_writeback.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_dev.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_dev.d deleted file mode 100644 index cd9b1d4..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_dev.d +++ /dev/null @@ -1,34 +0,0 @@ -obj/HAL/src/alt_dev.o: HAL/src/alt_dev.c HAL/inc/sys/alt_dev.h system.h \ - linker.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h \ - HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h HAL/inc/alt_types.h \ - system.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/alt_types.h: - -system.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_dev.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_dev.o deleted file mode 100644 index f5fd76c..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_dev.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_dev_llist_insert.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_dev_llist_insert.d deleted file mode 100644 index 344d065..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_dev_llist_insert.d +++ /dev/null @@ -1,13 +0,0 @@ -obj/HAL/src/alt_dev_llist_insert.o: HAL/src/alt_dev_llist_insert.c \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/alt_types.h HAL/inc/sys/alt_errno.h - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_errno.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_dev_llist_insert.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_dev_llist_insert.o deleted file mode 100644 index 4d9c617..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_dev_llist_insert.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_dma_rxchan_open.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_dma_rxchan_open.d deleted file mode 100644 index fb21fed..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_dma_rxchan_open.d +++ /dev/null @@ -1,35 +0,0 @@ -obj/HAL/src/alt_dma_rxchan_open.o: HAL/src/alt_dma_rxchan_open.c \ - HAL/inc/sys/alt_dma.h HAL/inc/sys/alt_dma_dev.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/alt_types.h HAL/inc/sys/alt_errno.h \ - HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h system.h linker.h \ - HAL/inc/sys/alt_llist.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h - -HAL/inc/sys/alt_dma.h: - -HAL/inc/sys/alt_dma_dev.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_errno.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_dma_rxchan_open.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_dma_rxchan_open.o deleted file mode 100644 index cae4f18..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_dma_rxchan_open.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_dma_txchan_open.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_dma_txchan_open.d deleted file mode 100644 index 500b95c..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_dma_txchan_open.d +++ /dev/null @@ -1,35 +0,0 @@ -obj/HAL/src/alt_dma_txchan_open.o: HAL/src/alt_dma_txchan_open.c \ - HAL/inc/sys/alt_dma.h HAL/inc/sys/alt_dma_dev.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/alt_types.h HAL/inc/sys/alt_errno.h \ - HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h system.h linker.h \ - HAL/inc/sys/alt_llist.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h - -HAL/inc/sys/alt_dma.h: - -HAL/inc/sys/alt_dma_dev.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_errno.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_dma_txchan_open.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_dma_txchan_open.o deleted file mode 100644 index 1a82727..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_dma_txchan_open.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_do_ctors.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_do_ctors.d deleted file mode 100644 index daf8baf..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_do_ctors.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_do_ctors.o: HAL/src/alt_do_ctors.c diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_do_ctors.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_do_ctors.o deleted file mode 100644 index 01bf00b..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_do_ctors.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_do_dtors.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_do_dtors.d deleted file mode 100644 index c3471eb..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_do_dtors.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_do_dtors.o: HAL/src/alt_do_dtors.c diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_do_dtors.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_do_dtors.o deleted file mode 100644 index 8b2519f..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_do_dtors.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_env_lock.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_env_lock.d deleted file mode 100644 index 634d7b0..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_env_lock.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_env_lock.o: HAL/src/alt_env_lock.c diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_env_lock.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_env_lock.o deleted file mode 100644 index c942ba8..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_env_lock.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_environ.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_environ.d deleted file mode 100644 index e9ca295..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_environ.d +++ /dev/null @@ -1,3 +0,0 @@ -obj/HAL/src/alt_environ.o: HAL/src/alt_environ.c HAL/inc/os/alt_syscall.h - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_environ.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_environ.o deleted file mode 100644 index 6b3ec93..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_environ.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_errno.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_errno.d deleted file mode 100644 index 29ca544..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_errno.d +++ /dev/null @@ -1,8 +0,0 @@ -obj/HAL/src/alt_errno.o: HAL/src/alt_errno.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/alt_types.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_errno.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_errno.o deleted file mode 100644 index fbc6d64..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_errno.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_exception_entry.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_exception_entry.d deleted file mode 100644 index 540567e..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_exception_entry.d +++ /dev/null @@ -1,6 +0,0 @@ -obj/HAL/src/alt_exception_entry.o: HAL/src/alt_exception_entry.S system.h \ - linker.h - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_exception_entry.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_exception_entry.o deleted file mode 100644 index 4371e8c..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_exception_entry.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_exception_muldiv.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_exception_muldiv.d deleted file mode 100644 index 63d66a7..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_exception_muldiv.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_exception_muldiv.o: HAL/src/alt_exception_muldiv.S diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_exception_muldiv.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_exception_muldiv.o deleted file mode 100644 index d15e838..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_exception_muldiv.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_exception_trap.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_exception_trap.d deleted file mode 100644 index 6e18488..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_exception_trap.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_exception_trap.o: HAL/src/alt_exception_trap.S diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_exception_trap.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_exception_trap.o deleted file mode 100644 index b423470..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_exception_trap.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_execve.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_execve.d deleted file mode 100644 index 9cef7d2..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_execve.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_execve.o: HAL/src/alt_execve.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_execve.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_execve.o deleted file mode 100644 index 9c162eb..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_execve.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_exit.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_exit.d deleted file mode 100644 index a779da8..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_exit.d +++ /dev/null @@ -1,26 +0,0 @@ -obj/HAL/src/alt_exit.o: HAL/src/alt_exit.c HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h HAL/inc/alt_types.h system.h linker.h \ - HAL/inc/sys/alt_sim.h HAL/inc/os/alt_hooks.h HAL/inc/os/alt_syscall.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_log_printf.h system.h - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_sim.h: - -HAL/inc/os/alt_hooks.h: - -HAL/inc/os/alt_syscall.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_exit.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_exit.o deleted file mode 100644 index 149bcd8..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_exit.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_fcntl.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_fcntl.d deleted file mode 100644 index 527f242..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_fcntl.d +++ /dev/null @@ -1,34 +0,0 @@ -obj/HAL/src/alt_fcntl.o: HAL/src/alt_fcntl.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h \ - system.h linker.h HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/alt_types.h \ - HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_fcntl.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_fcntl.o deleted file mode 100644 index 4f0f8c4..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_fcntl.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_fd_lock.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_fd_lock.d deleted file mode 100644 index 93daeac..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_fd_lock.d +++ /dev/null @@ -1,27 +0,0 @@ -obj/HAL/src/alt_fd_lock.o: HAL/src/alt_fd_lock.c HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_fd_lock.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_fd_lock.o deleted file mode 100644 index 30ec87c..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_fd_lock.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_fd_unlock.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_fd_unlock.d deleted file mode 100644 index 45a3207..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_fd_unlock.d +++ /dev/null @@ -1,27 +0,0 @@ -obj/HAL/src/alt_fd_unlock.o: HAL/src/alt_fd_unlock.c \ - HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h system.h linker.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_fd_unlock.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_fd_unlock.o deleted file mode 100644 index 108f7b3..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_fd_unlock.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_find_dev.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_find_dev.d deleted file mode 100644 index 98336f8..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_find_dev.d +++ /dev/null @@ -1,31 +0,0 @@ -obj/HAL/src/alt_find_dev.o: HAL/src/alt_find_dev.c HAL/inc/sys/alt_dev.h \ - system.h linker.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h \ - HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h HAL/inc/alt_types.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_find_dev.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_find_dev.o deleted file mode 100644 index ad8e3b1..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_find_dev.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_find_file.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_find_file.d deleted file mode 100644 index d1150ca..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_find_file.d +++ /dev/null @@ -1,32 +0,0 @@ -obj/HAL/src/alt_find_file.o: HAL/src/alt_find_file.c \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h \ - HAL/inc/alt_types.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_find_file.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_find_file.o deleted file mode 100644 index a7b0541..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_find_file.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_flash_dev.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_flash_dev.d deleted file mode 100644 index 8835e8f..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_flash_dev.d +++ /dev/null @@ -1,34 +0,0 @@ -obj/HAL/src/alt_flash_dev.o: HAL/src/alt_flash_dev.c \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/sys/alt_flash_dev.h \ - HAL/inc/sys/alt_flash_types.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h \ - system.h linker.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_flash_dev.h: - -HAL/inc/sys/alt_flash_types.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_flash_dev.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_flash_dev.o deleted file mode 100644 index 210520b..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_flash_dev.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_fork.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_fork.d deleted file mode 100644 index 492be65..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_fork.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_fork.o: HAL/src/alt_fork.c HAL/inc/sys/alt_warning.h \ - HAL/inc/sys/alt_errno.h HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_warning.h: - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_fork.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_fork.o deleted file mode 100644 index 2327768..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_fork.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_fs_reg.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_fs_reg.d deleted file mode 100644 index d8f95ab..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_fs_reg.d +++ /dev/null @@ -1,29 +0,0 @@ -obj/HAL/src/alt_fs_reg.o: HAL/src/alt_fs_reg.c HAL/inc/sys/alt_dev.h \ - system.h linker.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h \ - HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_fs_reg.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_fs_reg.o deleted file mode 100644 index 9501c68..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_fs_reg.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_fstat.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_fstat.d deleted file mode 100644 index 942fcbc..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_fstat.d +++ /dev/null @@ -1,38 +0,0 @@ -obj/HAL/src/alt_fstat.o: HAL/src/alt_fstat.c HAL/inc/sys/alt_dev.h \ - system.h linker.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/sys/alt_errno.h \ - HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_syscall.h system.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/sys/alt_errno.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_syscall.h: - -system.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_fstat.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_fstat.o deleted file mode 100644 index 7f7b280..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_fstat.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_get_fd.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_get_fd.d deleted file mode 100644 index 9a4daaa..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_get_fd.d +++ /dev/null @@ -1,34 +0,0 @@ -obj/HAL/src/alt_get_fd.o: HAL/src/alt_get_fd.c HAL/inc/sys/alt_dev.h \ - system.h linker.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h \ - HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h HAL/inc/alt_types.h \ - system.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/alt_types.h: - -system.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_get_fd.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_get_fd.o deleted file mode 100644 index 72eb665..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_get_fd.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_getchar.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_getchar.d deleted file mode 100644 index bcccdf7..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_getchar.d +++ /dev/null @@ -1,34 +0,0 @@ -obj/HAL/src/alt_getchar.o: HAL/src/alt_getchar.c system.h linker.h \ - HAL/inc/sys/alt_driver.h HAL/inc/sys/alt_stdio.h \ - HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h system.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h - -system.h: - -linker.h: - -HAL/inc/sys/alt_driver.h: - -HAL/inc/sys/alt_stdio.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_getchar.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_getchar.o deleted file mode 100644 index 85020ca..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_getchar.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_getpid.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_getpid.d deleted file mode 100644 index d9499b9..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_getpid.d +++ /dev/null @@ -1,3 +0,0 @@ -obj/HAL/src/alt_getpid.o: HAL/src/alt_getpid.c HAL/inc/os/alt_syscall.h - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_getpid.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_getpid.o deleted file mode 100644 index 1c5cdba..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_getpid.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_gettod.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_gettod.d deleted file mode 100644 index cf3cf34..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_gettod.d +++ /dev/null @@ -1,17 +0,0 @@ -obj/HAL/src/alt_gettod.o: HAL/src/alt_gettod.c HAL/inc/sys/alt_alarm.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/priv/alt_alarm.h \ - HAL/inc/alt_types.h HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_gettod.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_gettod.o deleted file mode 100644 index 175f100..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_gettod.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_gmon.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_gmon.d deleted file mode 100644 index e9469ab..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_gmon.d +++ /dev/null @@ -1,24 +0,0 @@ -obj/HAL/src/alt_gmon.o: HAL/src/alt_gmon.c HAL/inc/priv/nios2_gmon_data.h \ - HAL/inc/sys/alt_irq.h HAL/inc/nios2.h HAL/inc/alt_types.h system.h \ - linker.h HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h - -HAL/inc/priv/nios2_gmon_data.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_gmon.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_gmon.o deleted file mode 100644 index 6368a48..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_gmon.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_icache_flush.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_icache_flush.d deleted file mode 100644 index 2e4ddd1..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_icache_flush.d +++ /dev/null @@ -1,15 +0,0 @@ -obj/HAL/src/alt_icache_flush.o: HAL/src/alt_icache_flush.c \ - HAL/inc/nios2.h system.h linker.h HAL/inc/alt_types.h \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h - -HAL/inc/nios2.h: - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_icache_flush.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_icache_flush.o deleted file mode 100644 index b865a11..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_icache_flush.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_icache_flush_all.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_icache_flush_all.d deleted file mode 100644 index 47cfbf3..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_icache_flush_all.d +++ /dev/null @@ -1,15 +0,0 @@ -obj/HAL/src/alt_icache_flush_all.o: HAL/src/alt_icache_flush_all.c \ - HAL/inc/nios2.h system.h linker.h HAL/inc/alt_types.h \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h - -HAL/inc/nios2.h: - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_icache_flush_all.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_icache_flush_all.o deleted file mode 100644 index a132413..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_icache_flush_all.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_iic.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_iic.d deleted file mode 100644 index a709e0c..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_iic.d +++ /dev/null @@ -1,29 +0,0 @@ -obj/HAL/src/alt_iic.o: HAL/src/alt_iic.c system.h linker.h \ - HAL/inc/sys/alt_irq.h HAL/inc/nios2.h HAL/inc/alt_types.h system.h \ - HAL/inc/priv/alt_iic_isr_register.h HAL/inc/alt_types.h \ - HAL/inc/sys/alt_irq.h HAL/inc/priv/alt_legacy_irq.h system.h \ - HAL/inc/nios2.h - -system.h: - -linker.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -HAL/inc/priv/alt_iic_isr_register.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/priv/alt_legacy_irq.h: - -system.h: - -HAL/inc/nios2.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_iic.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_iic.o deleted file mode 100644 index f87923f..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_iic.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_iic_isr_register.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_iic_isr_register.d deleted file mode 100644 index d0470ae..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_iic_isr_register.d +++ /dev/null @@ -1,30 +0,0 @@ -obj/HAL/src/alt_iic_isr_register.o: HAL/src/alt_iic_isr_register.c \ - system.h linker.h HAL/inc/alt_types.h HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h HAL/inc/alt_types.h system.h \ - HAL/inc/priv/alt_iic_isr_register.h HAL/inc/alt_types.h \ - HAL/inc/sys/alt_irq.h HAL/inc/sys/alt_irq_entry.h \ - HAL/inc/priv/alt_irq_table.h - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -HAL/inc/priv/alt_iic_isr_register.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/sys/alt_irq_entry.h: - -HAL/inc/priv/alt_irq_table.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_iic_isr_register.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_iic_isr_register.o deleted file mode 100644 index 0d3261c..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_iic_isr_register.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_instruction_exception_entry.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_instruction_exception_entry.d deleted file mode 100644 index 6d0705f..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_instruction_exception_entry.d +++ /dev/null @@ -1,18 +0,0 @@ -obj/HAL/src/alt_instruction_exception_entry.o: \ - HAL/src/alt_instruction_exception_entry.c HAL/inc/sys/alt_exceptions.h \ - HAL/inc/alt_types.h system.h linker.h HAL/inc/nios2.h \ - HAL/inc/alt_types.h system.h - -HAL/inc/sys/alt_exceptions.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_instruction_exception_entry.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_instruction_exception_entry.o deleted file mode 100644 index 1271c60..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_instruction_exception_entry.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_instruction_exception_register.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_instruction_exception_register.d deleted file mode 100644 index d4fac04..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_instruction_exception_register.d +++ /dev/null @@ -1,16 +0,0 @@ -obj/HAL/src/alt_instruction_exception_register.o: \ - HAL/src/alt_instruction_exception_register.c \ - HAL/inc/sys/alt_exceptions.h HAL/inc/alt_types.h system.h linker.h \ - HAL/inc/alt_types.h system.h - -HAL/inc/sys/alt_exceptions.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -system.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_instruction_exception_register.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_instruction_exception_register.o deleted file mode 100644 index 921059f..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_instruction_exception_register.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_io_redirect.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_io_redirect.d deleted file mode 100644 index 8228365..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_io_redirect.d +++ /dev/null @@ -1,29 +0,0 @@ -obj/HAL/src/alt_io_redirect.o: HAL/src/alt_io_redirect.c \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_io_redirect.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_io_redirect.o deleted file mode 100644 index 9dfda33..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_io_redirect.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_ioctl.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_ioctl.d deleted file mode 100644 index d70ad97..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_ioctl.d +++ /dev/null @@ -1,41 +0,0 @@ -obj/HAL/src/alt_ioctl.o: HAL/src/alt_ioctl.c HAL/inc/sys/ioctl.h \ - HAL/inc/sys/alt_errno.h HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h \ - HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h system.h linker.h \ - HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_syscall.h system.h \ - HAL/inc/sys/alt_driver.h - -HAL/inc/sys/ioctl.h: - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_syscall.h: - -system.h: - -HAL/inc/sys/alt_driver.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_ioctl.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_ioctl.o deleted file mode 100644 index f43a058..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_ioctl.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_irq_entry.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_irq_entry.d deleted file mode 100644 index 9ec3751..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_irq_entry.d +++ /dev/null @@ -1,5 +0,0 @@ -obj/HAL/src/alt_irq_entry.o: HAL/src/alt_irq_entry.S system.h linker.h - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_irq_entry.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_irq_entry.o deleted file mode 100644 index e72fca0..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_irq_entry.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_irq_handler.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_irq_handler.d deleted file mode 100644 index 6fb668f..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_irq_handler.d +++ /dev/null @@ -1,19 +0,0 @@ -obj/HAL/src/alt_irq_handler.o: HAL/src/alt_irq_handler.c system.h \ - linker.h HAL/inc/sys/alt_irq.h HAL/inc/nios2.h HAL/inc/alt_types.h \ - system.h HAL/inc/os/alt_hooks.h HAL/inc/alt_types.h - -system.h: - -linker.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -HAL/inc/os/alt_hooks.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_irq_handler.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_irq_handler.o deleted file mode 100644 index d91718f..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_irq_handler.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_irq_register.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_irq_register.d deleted file mode 100644 index 3df2f8a..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_irq_register.d +++ /dev/null @@ -1,36 +0,0 @@ -obj/HAL/src/alt_irq_register.o: HAL/src/alt_irq_register.c system.h \ - linker.h HAL/inc/sys/alt_irq.h HAL/inc/nios2.h HAL/inc/alt_types.h \ - system.h HAL/inc/priv/alt_legacy_irq.h system.h HAL/inc/nios2.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_irq.h HAL/inc/os/alt_hooks.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_irq_entry.h \ - HAL/inc/priv/alt_irq_table.h - -system.h: - -linker.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -HAL/inc/priv/alt_legacy_irq.h: - -system.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/os/alt_hooks.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_irq_entry.h: - -HAL/inc/priv/alt_irq_table.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_irq_register.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_irq_register.o deleted file mode 100644 index 61dde73..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_irq_register.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_irq_vars.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_irq_vars.d deleted file mode 100644 index f316558..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_irq_vars.d +++ /dev/null @@ -1,8 +0,0 @@ -obj/HAL/src/alt_irq_vars.o: HAL/src/alt_irq_vars.c HAL/inc/alt_types.h \ - system.h linker.h - -HAL/inc/alt_types.h: - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_irq_vars.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_irq_vars.o deleted file mode 100644 index c5c604e..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_irq_vars.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_isatty.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_isatty.d deleted file mode 100644 index f8b1f07..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_isatty.d +++ /dev/null @@ -1,38 +0,0 @@ -obj/HAL/src/alt_isatty.o: HAL/src/alt_isatty.c HAL/inc/sys/alt_dev.h \ - system.h linker.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_errno.h HAL/inc/sys/alt_warning.h \ - HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_syscall.h system.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_errno.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_syscall.h: - -system.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_isatty.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_isatty.o deleted file mode 100644 index 327e026..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_isatty.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_kill.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_kill.d deleted file mode 100644 index 0c14ae8..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_kill.d +++ /dev/null @@ -1,8 +0,0 @@ -obj/HAL/src/alt_kill.o: HAL/src/alt_kill.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_kill.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_kill.o deleted file mode 100644 index 9ea29a2..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_kill.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_link.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_link.d deleted file mode 100644 index dc844c6..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_link.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_link.o: HAL/src/alt_link.c HAL/inc/sys/alt_warning.h \ - HAL/inc/sys/alt_errno.h HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_warning.h: - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_link.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_link.o deleted file mode 100644 index 3a38842..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_link.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_load.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_load.d deleted file mode 100644 index d496ab8..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_load.d +++ /dev/null @@ -1,8 +0,0 @@ -obj/HAL/src/alt_load.o: HAL/src/alt_load.c HAL/inc/sys/alt_load.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_cache.h - -HAL/inc/sys/alt_load.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_cache.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_load.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_load.o deleted file mode 100644 index 3ff8aba..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_load.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_log_macro.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_log_macro.d deleted file mode 100644 index 9768c1f..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_log_macro.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_log_macro.o: HAL/src/alt_log_macro.S diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_log_macro.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_log_macro.o deleted file mode 100644 index 489e2cc..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_log_macro.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_log_printf.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_log_printf.d deleted file mode 100644 index 251ff6d..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_log_printf.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_log_printf.o: HAL/src/alt_log_printf.c diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_log_printf.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_log_printf.o deleted file mode 100644 index a03c33d..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_log_printf.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_lseek.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_lseek.d deleted file mode 100644 index 25ed783..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_lseek.d +++ /dev/null @@ -1,34 +0,0 @@ -obj/HAL/src/alt_lseek.o: HAL/src/alt_lseek.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h \ - HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_lseek.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_lseek.o deleted file mode 100644 index 95d4c9d..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_lseek.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_main.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_main.d deleted file mode 100644 index afdfda0..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_main.d +++ /dev/null @@ -1,47 +0,0 @@ -obj/HAL/src/alt_main.o: HAL/src/alt_main.c HAL/inc/sys/alt_dev.h system.h \ - linker.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_sys_init.h HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h HAL/inc/os/alt_hooks.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h \ - HAL/inc/alt_types.h system.h HAL/inc/sys/alt_log_printf.h system.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_sys_init.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/os/alt_hooks.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/alt_types.h: - -system.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_main.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_main.o deleted file mode 100644 index 3bed885..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_main.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_malloc_lock.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_malloc_lock.d deleted file mode 100644 index 4ed35c2..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_malloc_lock.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_malloc_lock.o: HAL/src/alt_malloc_lock.c diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_malloc_lock.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_malloc_lock.o deleted file mode 100644 index 9972628..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_malloc_lock.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_mcount.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_mcount.d deleted file mode 100644 index 1203efc..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_mcount.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_mcount.o: HAL/src/alt_mcount.S diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_mcount.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_mcount.o deleted file mode 100644 index 4d80956..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_mcount.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_open.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_open.d deleted file mode 100644 index a2aacd9..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_open.d +++ /dev/null @@ -1,36 +0,0 @@ -obj/HAL/src/alt_open.o: HAL/src/alt_open.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_open.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_open.o deleted file mode 100644 index ed03084..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_open.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_printf.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_printf.d deleted file mode 100644 index 3ce68a4..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_printf.d +++ /dev/null @@ -1,3 +0,0 @@ -obj/HAL/src/alt_printf.o: HAL/src/alt_printf.c HAL/inc/sys/alt_stdio.h - -HAL/inc/sys/alt_stdio.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_printf.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_printf.o deleted file mode 100644 index 1fb2cf2..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_printf.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_putchar.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_putchar.d deleted file mode 100644 index 9a0dde3..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_putchar.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_putchar.o: HAL/src/alt_putchar.c system.h linker.h \ - HAL/inc/sys/alt_driver.h HAL/inc/sys/alt_stdio.h - -system.h: - -linker.h: - -HAL/inc/sys/alt_driver.h: - -HAL/inc/sys/alt_stdio.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_putchar.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_putchar.o deleted file mode 100644 index 28b182d..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_putchar.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_putstr.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_putstr.d deleted file mode 100644 index 3cf528a..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_putstr.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_putstr.o: HAL/src/alt_putstr.c system.h linker.h \ - HAL/inc/sys/alt_driver.h HAL/inc/sys/alt_stdio.h - -system.h: - -linker.h: - -HAL/inc/sys/alt_driver.h: - -HAL/inc/sys/alt_stdio.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_putstr.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_putstr.o deleted file mode 100644 index 683e076..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_putstr.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_read.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_read.d deleted file mode 100644 index 2bb0d95..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_read.d +++ /dev/null @@ -1,38 +0,0 @@ -obj/HAL/src/alt_read.o: HAL/src/alt_read.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h \ - HAL/inc/os/alt_syscall.h system.h HAL/inc/sys/alt_driver.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_syscall.h: - -system.h: - -HAL/inc/sys/alt_driver.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_read.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_read.o deleted file mode 100644 index 89ece89..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_read.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_release_fd.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_release_fd.d deleted file mode 100644 index 0e3acb5..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_release_fd.d +++ /dev/null @@ -1,29 +0,0 @@ -obj/HAL/src/alt_release_fd.o: HAL/src/alt_release_fd.c \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_release_fd.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_release_fd.o deleted file mode 100644 index 853bc34..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_release_fd.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_remap_cached.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_remap_cached.d deleted file mode 100644 index b5fb151..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_remap_cached.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_remap_cached.o: HAL/src/alt_remap_cached.c \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h system.h linker.h - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_remap_cached.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_remap_cached.o deleted file mode 100644 index 2f217c0..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_remap_cached.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_remap_uncached.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_remap_uncached.d deleted file mode 100644 index 0423405..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_remap_uncached.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_remap_uncached.o: HAL/src/alt_remap_uncached.c \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h system.h linker.h - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_remap_uncached.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_remap_uncached.o deleted file mode 100644 index 468ccf8..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_remap_uncached.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_rename.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_rename.d deleted file mode 100644 index b7af4b2..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_rename.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_rename.o: HAL/src/alt_rename.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_rename.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_rename.o deleted file mode 100644 index dc911e6..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_rename.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_sbrk.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_sbrk.d deleted file mode 100644 index a0771ae..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_sbrk.d +++ /dev/null @@ -1,19 +0,0 @@ -obj/HAL/src/alt_sbrk.o: HAL/src/alt_sbrk.c HAL/inc/os/alt_syscall.h \ - HAL/inc/sys/alt_irq.h HAL/inc/nios2.h HAL/inc/alt_types.h system.h \ - linker.h HAL/inc/sys/alt_stack.h system.h - -HAL/inc/os/alt_syscall.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_stack.h: - -system.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_sbrk.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_sbrk.o deleted file mode 100644 index 2ed8ac1..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_sbrk.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_settod.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_settod.d deleted file mode 100644 index 56718d5..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_settod.d +++ /dev/null @@ -1,17 +0,0 @@ -obj/HAL/src/alt_settod.o: HAL/src/alt_settod.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_settod.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_settod.o deleted file mode 100644 index 404e7f4..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_settod.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_software_exception.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_software_exception.d deleted file mode 100644 index fab4023..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_software_exception.d +++ /dev/null @@ -1,6 +0,0 @@ -obj/HAL/src/alt_software_exception.o: HAL/src/alt_software_exception.S \ - system.h linker.h - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_software_exception.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_software_exception.o deleted file mode 100644 index f9e01c2..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_software_exception.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_stat.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_stat.d deleted file mode 100644 index 8a63c27..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_stat.d +++ /dev/null @@ -1,3 +0,0 @@ -obj/HAL/src/alt_stat.o: HAL/src/alt_stat.c HAL/inc/os/alt_syscall.h - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_stat.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_stat.o deleted file mode 100644 index 12efa40..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_stat.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_tick.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_tick.d deleted file mode 100644 index ddbb281..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_tick.d +++ /dev/null @@ -1,27 +0,0 @@ -obj/HAL/src/alt_tick.o: HAL/src/alt_tick.c HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h HAL/inc/alt_types.h system.h linker.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/os/alt_hooks.h \ - HAL/inc/alt_types.h - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_hooks.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_tick.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_tick.o deleted file mode 100644 index 8179953..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_tick.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_times.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_times.d deleted file mode 100644 index 4bad83d..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_times.d +++ /dev/null @@ -1,17 +0,0 @@ -obj/HAL/src/alt_times.o: HAL/src/alt_times.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_times.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_times.o deleted file mode 100644 index 3cc74be..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_times.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_uncached_free.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_uncached_free.d deleted file mode 100644 index d74ef4b..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_uncached_free.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_uncached_free.o: HAL/src/alt_uncached_free.c \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h system.h linker.h - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_uncached_free.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_uncached_free.o deleted file mode 100644 index a3a3312..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_uncached_free.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_uncached_malloc.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_uncached_malloc.d deleted file mode 100644 index 16799fb..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_uncached_malloc.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_uncached_malloc.o: HAL/src/alt_uncached_malloc.c \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h system.h linker.h - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_uncached_malloc.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_uncached_malloc.o deleted file mode 100644 index 1c615ac..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_uncached_malloc.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_unlink.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_unlink.d deleted file mode 100644 index 0205f86..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_unlink.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_unlink.o: HAL/src/alt_unlink.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_unlink.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_unlink.o deleted file mode 100644 index bc721e9..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_unlink.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_usleep.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_usleep.d deleted file mode 100644 index b5eca45..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_usleep.d +++ /dev/null @@ -1,6 +0,0 @@ -obj/HAL/src/alt_usleep.o: HAL/src/alt_usleep.c \ - HAL/inc/priv/alt_busy_sleep.h HAL/inc/os/alt_syscall.h - -HAL/inc/priv/alt_busy_sleep.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_usleep.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_usleep.o deleted file mode 100644 index 98963a3..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_usleep.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_wait.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_wait.d deleted file mode 100644 index f47f5df..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_wait.d +++ /dev/null @@ -1,8 +0,0 @@ -obj/HAL/src/alt_wait.o: HAL/src/alt_wait.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_wait.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_wait.o deleted file mode 100644 index f8b524e..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_wait.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_write.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_write.d deleted file mode 100644 index 2b54a68..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_write.d +++ /dev/null @@ -1,41 +0,0 @@ -obj/HAL/src/alt_write.o: HAL/src/alt_write.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h \ - HAL/inc/os/alt_syscall.h HAL/inc/sys/alt_log_printf.h system.h \ - HAL/inc/sys/alt_driver.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_syscall.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: - -HAL/inc/sys/alt_driver.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_write.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_write.o deleted file mode 100644 index a001bdf..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/alt_write.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/altera_nios2_qsys_irq.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/altera_nios2_qsys_irq.d deleted file mode 100644 index 47bdd9c..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/altera_nios2_qsys_irq.d +++ /dev/null @@ -1,15 +0,0 @@ -obj/HAL/src/altera_nios2_qsys_irq.o: HAL/src/altera_nios2_qsys_irq.c \ - HAL/inc/sys/alt_irq.h HAL/inc/nios2.h HAL/inc/alt_types.h system.h \ - linker.h HAL/inc/altera_nios2_qsys_irq.h - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/altera_nios2_qsys_irq.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/altera_nios2_qsys_irq.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/altera_nios2_qsys_irq.o deleted file mode 100644 index c1d2837..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/altera_nios2_qsys_irq.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/crt0.d b/software/qsys_tutorial_mem_bsp/obj/HAL/src/crt0.d deleted file mode 100644 index 3af0bb0..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/crt0.d +++ /dev/null @@ -1,12 +0,0 @@ -obj/HAL/src/crt0.o: HAL/src/crt0.S system.h linker.h HAL/inc/nios2.h \ - HAL/inc/sys/alt_log_printf.h system.h - -system.h: - -linker.h: - -HAL/inc/nios2.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/HAL/src/crt0.o b/software/qsys_tutorial_mem_bsp/obj/HAL/src/crt0.o deleted file mode 100644 index 4fb6458..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/HAL/src/crt0.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/alt_sys_init.d b/software/qsys_tutorial_mem_bsp/obj/alt_sys_init.d deleted file mode 100644 index 2087a7a..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/alt_sys_init.d +++ /dev/null @@ -1,54 +0,0 @@ -obj/alt_sys_init.o: alt_sys_init.c system.h linker.h \ - HAL/inc/sys/alt_irq.h HAL/inc/nios2.h HAL/inc/alt_types.h system.h \ - HAL/inc/sys/alt_sys_init.h HAL/inc/altera_nios2_qsys_irq.h \ - drivers/inc/altera_avalon_jtag_uart.h HAL/inc/sys/alt_alarm.h \ - HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h \ - HAL/inc/sys/alt_warning.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_flag.h \ - drivers/inc/altera_avalon_jtag_uart_fd.h HAL/inc/sys/alt_dev.h \ - HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h - -system.h: - -linker.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -HAL/inc/sys/alt_sys_init.h: - -HAL/inc/altera_nios2_qsys_irq.h: - -drivers/inc/altera_avalon_jtag_uart.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_flag.h: - -drivers/inc/altera_avalon_jtag_uart_fd.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/alt_sys_init.o b/software/qsys_tutorial_mem_bsp/obj/alt_sys_init.o deleted file mode 100644 index a6dc60f..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/alt_sys_init.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/drivers/src/altera_avalon_jtag_uart_fd.d b/software/qsys_tutorial_mem_bsp/obj/drivers/src/altera_avalon_jtag_uart_fd.d deleted file mode 100644 index b152697..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/drivers/src/altera_avalon_jtag_uart_fd.d +++ /dev/null @@ -1,48 +0,0 @@ -obj/drivers/src/altera_avalon_jtag_uart_fd.o: \ - drivers/src/altera_avalon_jtag_uart_fd.c HAL/inc/alt_types.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - drivers/inc/altera_avalon_jtag_uart.h HAL/inc/sys/alt_alarm.h \ - HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_alarm.h \ - HAL/inc/sys/alt_warning.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_flag.h \ - drivers/inc/altera_avalon_jtag_uart_fd.h HAL/inc/sys/alt_dev.h - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_flag.h: - -drivers/inc/altera_avalon_jtag_uart_fd.h: - -HAL/inc/sys/alt_dev.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/drivers/src/altera_avalon_jtag_uart_fd.o b/software/qsys_tutorial_mem_bsp/obj/drivers/src/altera_avalon_jtag_uart_fd.o deleted file mode 100644 index 30500f7..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/drivers/src/altera_avalon_jtag_uart_fd.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/drivers/src/altera_avalon_jtag_uart_init.d b/software/qsys_tutorial_mem_bsp/obj/drivers/src/altera_avalon_jtag_uart_init.d deleted file mode 100644 index f9460a1..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/drivers/src/altera_avalon_jtag_uart_init.d +++ /dev/null @@ -1,66 +0,0 @@ -obj/drivers/src/altera_avalon_jtag_uart_init.o: \ - drivers/src/altera_avalon_jtag_uart_init.c HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h HAL/inc/alt_types.h system.h linker.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/sys/ioctl.h \ - HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart_regs.h \ - HAL/inc/io.h HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_warning.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_flag.h \ - drivers/inc/altera_avalon_jtag_uart_fd.h HAL/inc/sys/alt_dev.h \ - HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/sys/alt_log_printf.h system.h - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/ioctl.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart_regs.h: - -HAL/inc/io.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_flag.h: - -drivers/inc/altera_avalon_jtag_uart_fd.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/drivers/src/altera_avalon_jtag_uart_init.o b/software/qsys_tutorial_mem_bsp/obj/drivers/src/altera_avalon_jtag_uart_init.o deleted file mode 100644 index 9dc0109..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/drivers/src/altera_avalon_jtag_uart_init.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/drivers/src/altera_avalon_jtag_uart_ioctl.d b/software/qsys_tutorial_mem_bsp/obj/drivers/src/altera_avalon_jtag_uart_ioctl.d deleted file mode 100644 index d75a559..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/drivers/src/altera_avalon_jtag_uart_ioctl.d +++ /dev/null @@ -1,58 +0,0 @@ -obj/drivers/src/altera_avalon_jtag_uart_ioctl.o: \ - drivers/src/altera_avalon_jtag_uart_ioctl.c HAL/inc/sys/ioctl.h \ - HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart_regs.h \ - HAL/inc/io.h HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h \ - HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_flag.h \ - drivers/inc/altera_avalon_jtag_uart_fd.h HAL/inc/sys/alt_dev.h system.h \ - linker.h HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/sys/alt_log_printf.h system.h - -HAL/inc/sys/ioctl.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart_regs.h: - -HAL/inc/io.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_flag.h: - -drivers/inc/altera_avalon_jtag_uart_fd.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/drivers/src/altera_avalon_jtag_uart_ioctl.o b/software/qsys_tutorial_mem_bsp/obj/drivers/src/altera_avalon_jtag_uart_ioctl.o deleted file mode 100644 index 12f6d49..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/drivers/src/altera_avalon_jtag_uart_ioctl.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/drivers/src/altera_avalon_jtag_uart_read.d b/software/qsys_tutorial_mem_bsp/obj/drivers/src/altera_avalon_jtag_uart_read.d deleted file mode 100644 index 9a4846a..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/drivers/src/altera_avalon_jtag_uart_read.d +++ /dev/null @@ -1,66 +0,0 @@ -obj/drivers/src/altera_avalon_jtag_uart_read.o: \ - drivers/src/altera_avalon_jtag_uart_read.c HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h HAL/inc/alt_types.h system.h linker.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/sys/ioctl.h \ - HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart_regs.h \ - HAL/inc/io.h HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_warning.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_flag.h \ - drivers/inc/altera_avalon_jtag_uart_fd.h HAL/inc/sys/alt_dev.h \ - HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/sys/alt_log_printf.h system.h - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/ioctl.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart_regs.h: - -HAL/inc/io.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_flag.h: - -drivers/inc/altera_avalon_jtag_uart_fd.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/drivers/src/altera_avalon_jtag_uart_read.o b/software/qsys_tutorial_mem_bsp/obj/drivers/src/altera_avalon_jtag_uart_read.o deleted file mode 100644 index 1e894ca..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/drivers/src/altera_avalon_jtag_uart_read.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/obj/drivers/src/altera_avalon_jtag_uart_write.d b/software/qsys_tutorial_mem_bsp/obj/drivers/src/altera_avalon_jtag_uart_write.d deleted file mode 100644 index 5518b7f..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/drivers/src/altera_avalon_jtag_uart_write.d +++ /dev/null @@ -1,66 +0,0 @@ -obj/drivers/src/altera_avalon_jtag_uart_write.o: \ - drivers/src/altera_avalon_jtag_uart_write.c HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h HAL/inc/alt_types.h system.h linker.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/sys/ioctl.h \ - HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart_regs.h \ - HAL/inc/io.h HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_warning.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_flag.h \ - drivers/inc/altera_avalon_jtag_uart_fd.h HAL/inc/sys/alt_dev.h \ - HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/sys/alt_log_printf.h system.h - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/ioctl.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart_regs.h: - -HAL/inc/io.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_flag.h: - -drivers/inc/altera_avalon_jtag_uart_fd.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: diff --git a/software/qsys_tutorial_mem_bsp/obj/drivers/src/altera_avalon_jtag_uart_write.o b/software/qsys_tutorial_mem_bsp/obj/drivers/src/altera_avalon_jtag_uart_write.o deleted file mode 100644 index 3cac8ce..0000000 --- a/software/qsys_tutorial_mem_bsp/obj/drivers/src/altera_avalon_jtag_uart_write.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_mem_bsp/public.mk b/software/qsys_tutorial_mem_bsp/public.mk deleted file mode 100644 index 5eb883d..0000000 --- a/software/qsys_tutorial_mem_bsp/public.mk +++ /dev/null @@ -1,385 +0,0 @@ -#------------------------------------------------------------------------------ -# BSP "PUBLIC" MAKEFILE CONTENT -# -# This file is intended to be included in an application or library -# Makefile that is using this BSP. You can create such a Makefile with -# the nios2-app-generate-makefile or nios2-lib-generate-makefile -# commands. -# -# The following variables must be defined before including this file: -# -# ALT_LIBRARY_ROOT_DIR -# Contains the path to the BSP top-level (aka root) directory -#------------------------------------------------------------------------------ - -#------------------------------------------------------------------------------ -# PATHS -#------------------------------------------------------------------------------ - - - -# Path to the provided linker script. -BSP_LINKER_SCRIPT := $(ALT_LIBRARY_ROOT_DIR)/linker.x - -# Include paths: -# The path to root of all header files that a library wishes to make -# available for an application's use is specified here. Note that this -# may not be *all* folders within a hierarchy. For example, if it is -# desired that the application developer type: -# #include -# #include -# With files laid out like this: -# /inc/sockets.h -# /inc/ip/tcpip.h -# -# Then, only /inc need be added to the list of include -# directories. Alternatively, if you wish to be able to directly include -# all files in a hierarchy, separate paths to each folder in that -# hierarchy must be defined. - -# The following are the "base" set of include paths for a BSP. -# These paths are appended to the list that individual software -# components, drivers, etc., add in the generated portion of this -# file (below). -ALT_INCLUDE_DIRS_TO_APPEND += \ - $(ALT_LIBRARY_ROOT_DIR) \ - $(ALT_LIBRARY_ROOT_DIR)/drivers/inc - -# Additions to linker library search-path: -# Here we provide a path to "our self" for the application to construct a -# "-L " out of. This should contain a list of directories, -# relative to the library root, of all directories with .a files to link -# against. -ALT_LIBRARY_DIRS += $(ALT_LIBRARY_ROOT_DIR) - - -#------------------------------------------------------------------------------ -# COMPILATION FLAGS -#------------------------------------------------------------------------------ -# Default C pre-processor flags for a BSP: -ALT_CPPFLAGS += -DSYSTEM_BUS_WIDTH=32 \ - -pipe - - -#------------------------------------------------------------------------------ -# MANAGED CONTENT -# -# All content between the lines "START MANAGED" and "END MANAGED" below is -# generated based on variables in the BSP settings file when the -# nios2-bsp-generate-files command is invoked. If you wish to persist any -# information pertaining to the build process, it is recomended that you -# utilize the BSP settings mechanism to do so. -#------------------------------------------------------------------------------ -#START MANAGED - -# The following TYPE comment allows tools to identify the 'type' of target this -# makefile is associated with. -# TYPE: BSP_PUBLIC_MAKEFILE - -# This following VERSION comment indicates the version of the tool used to -# generate this makefile. A makefile variable is provided for VERSION as well. -# ACDS_VERSION: 13.0sp1 -ACDS_VERSION := 13.0sp1 - -# This following BUILD_NUMBER comment indicates the build number of the tool -# used to generate this makefile. -# BUILD_NUMBER: 232 - -# Qsys--generated SOPCINFO file. Required for resolving node instance ID's with -# design component names. -SOPCINFO_FILE := C:/Users/takayun/Documents/DE2-115/qsys_tutorial/nios_system.sopcinfo - -# Big-Endian operation. -# setting BIG_ENDIAN is false -ALT_CFLAGS += -EL - -# Path to the provided C language runtime initialization code. -BSP_CRT0 := $(ALT_LIBRARY_ROOT_DIR)/obj/HAL/src/crt0.o - -# Name of BSP library as provided to linker using the "-msys-lib" flag or -# linker script GROUP command. -# setting BSP_SYS_LIB is hal_bsp -BSP_SYS_LIB := hal_bsp -ELF_PATCH_FLAG += --thread_model hal - -# Type identifier of the BSP library -# setting BSP_TYPE is hal -ALT_CPPFLAGS += -D__hal__ -BSP_TYPE := hal - -# CPU Name -# setting CPU_NAME is nios2_processor -CPU_NAME = nios2_processor -ELF_PATCH_FLAG += --cpu_name $(CPU_NAME) - -# Hardware Divider present. -# setting HARDWARE_DIVIDE is false -ALT_CFLAGS += -mno-hw-div - -# Hardware Multiplier present. -# setting HARDWARE_MULTIPLY is false -ALT_CFLAGS += -mno-hw-mul - -# Hardware Mulx present. -# setting HARDWARE_MULX is false -ALT_CFLAGS += -mno-hw-mulx - -# Debug Core present. -# setting HAS_DEBUG_CORE is true -CPU_HAS_DEBUG_CORE = 1 - -# Qsys generated design -# setting QSYS is 1 -QSYS := 1 -ELF_PATCH_FLAG += --qsys true - -# Design Name -# setting SOPC_NAME is nios_system -SOPC_NAME := nios_system - -# SopcBuilder Simulation Enabled -# setting SOPC_SIMULATION_ENABLED is false -ELF_PATCH_FLAG += --simulation_enabled false - -# Enable JTAG UART driver to recover when host is inactive causing buffer to -# full without returning error. Printf will not fail with this recovery. none -# setting altera_avalon_jtag_uart_driver.enable_jtag_uart_ignore_fifo_full_error is false - -# Small-footprint (polled mode) driver none -# setting altera_avalon_jtag_uart_driver.enable_small_driver is false - -# Build a custom version of newlib with the specified space-separated compiler -# flags. The custom newlib build will be placed in the <bsp root>/newlib -# directory, and will be used only for applications that utilize this BSP. -# setting hal.custom_newlib_flags is none - -# Enable support for a subset of the C++ language. This option increases code -# footprint by adding support for C++ constructors. Certain features, such as -# multiple inheritance and exceptions are not supported. If false, adds -# -DALT_NO_C_PLUS_PLUS to ALT_CPPFLAGS in public.mk, and reduces code -# footprint. none -# setting hal.enable_c_plus_plus is false -ALT_CPPFLAGS += -DALT_NO_C_PLUS_PLUS - -# When your application exits, close file descriptors, call C++ destructors, -# etc. Code footprint can be reduced by disabling clean exit. If disabled, adds -# -DALT_NO_CLEAN_EXIT to ALT_CPPFLAGS and -Wl,--defsym, exit=_exit to -# ALT_LDFLAGS in public.mk. none -# setting hal.enable_clean_exit is false -ALT_CPPFLAGS += -DALT_NO_CLEAN_EXIT -ALT_LDFLAGS += -Wl,--defsym,exit=_exit - -# Add exit() support. This option increases code footprint if your "main()" -# routine does "return" or call "exit()". If false, adds -DALT_NO_EXIT to -# ALT_CPPFLAGS in public.mk, and reduces footprint none -# setting hal.enable_exit is false -ALT_CPPFLAGS += -DALT_NO_EXIT - -# Causes code to be compiled with gprof profiling enabled and the application -# ELF to be linked with the GPROF library. If true, adds -DALT_PROVIDE_GMON to -# ALT_CPPFLAGS and -pg to ALT_CFLAGS in public.mk. none -# setting hal.enable_gprof is false - -# Enables lightweight device driver API. This reduces code and data footprint -# by removing the HAL layer that maps device names (e.g. /dev/uart0) to file -# descriptors. Instead, driver routines are called directly. The open(), -# close(), and lseek() routines will always fail if called. The read(), -# write(), fstat(), ioctl(), and isatty() routines only work for the stdio -# devices. If true, adds -DALT_USE_DIRECT_DRIVERS to ALT_CPPFLAGS in public.mk. -# The Altera Host and read-only ZIP file systems can't be used if -# hal.enable_lightweight_device_driver_api is true. -# setting hal.enable_lightweight_device_driver_api is true -ALT_CPPFLAGS += -DALT_USE_DIRECT_DRIVERS - -# Adds code to emulate multiply and divide instructions in case they are -# executed but aren't present in the CPU. Normally this isn't required because -# the compiler won't use multiply and divide instructions that aren't present -# in the CPU. If false, adds -DALT_NO_INSTRUCTION_EMULATION to ALT_CPPFLAGS in -# public.mk. none -# setting hal.enable_mul_div_emulation is false -ALT_CPPFLAGS += -DALT_NO_INSTRUCTION_EMULATION - -# Certain drivers are compiled with reduced functionality to reduce code -# footprint. Not all drivers observe this setting. The altera_avalon_uart and -# altera_avalon_jtag_uart drivers switch from interrupt-driven to polled -# operation. CAUTION: Several device drivers are disabled entirely. These -# include the altera_avalon_cfi_flash, altera_avalon_epcs_flash_controller, and -# altera_avalon_lcd_16207 drivers. This can result in certain API (HAL flash -# access routines) to fail. You can define a symbol provided by each driver to -# prevent it from being removed. If true, adds -DALT_USE_SMALL_DRIVERS to -# ALT_CPPFLAGS in public.mk. none -# setting hal.enable_reduced_device_drivers is true -ALT_CPPFLAGS += -DALT_USE_SMALL_DRIVERS - -# Turns on HAL runtime stack checking feature. Enabling this setting causes -# additional code to be placed into each subroutine call to generate an -# exception if a stack collision occurs with the heap or statically allocated -# data. If true, adds -DALT_STACK_CHECK and -mstack-check to ALT_CPPFLAGS in -# public.mk. none -# setting hal.enable_runtime_stack_checking is false - -# The BSP is compiled with optimizations to speedup HDL simulation such as -# initializing the cache, clearing the .bss section, and skipping long delay -# loops. If true, adds -DALT_SIM_OPTIMIZE to ALT_CPPFLAGS in public.mk. When -# this setting is true, the BSP shouldn't be used to build applications that -# are expected to run real hardware. -# setting hal.enable_sim_optimize is false - -# Causes the small newlib (C library) to be used. This reduces code and data -# footprint at the expense of reduced functionality. Several newlib features -# are removed such as floating-point support in printf(), stdin input routines, -# and buffered I/O. The small C library is not compatible with Micrium -# MicroC/OS-II. If true, adds -msmallc to ALT_LDFLAGS in public.mk. none -# setting hal.enable_small_c_library is true -ALT_LDFLAGS += -msmallc -ALT_CPPFLAGS += -DSMALL_C_LIB - -# Enable SOPC Builder System ID. If a System ID SOPC Builder component is -# connected to the CPU associated with this BSP, it will be enabled in the -# creation of command-line arguments to download an ELF to the target. -# Otherwise, system ID and timestamp values are left out of public.mk for -# application Makefile "download-elf" target definition. With the system ID -# check disabled, the Nios II EDS tools will not automatically ensure that the -# application .elf file (and BSP it is linked against) corresponds to the -# hardware design on the target. If false, adds --accept-bad-sysid to -# SOPC_SYSID_FLAG in public.mk. none -# setting hal.enable_sopc_sysid_check is true - -# Enable BSP generation to query if SOPC system is big endian. If true ignores -# export of 'ALT_CFLAGS += -EB' to public.mk if big endian system. If true -# ignores export of 'ALT_CFLAGS += -EL' if little endian system. none -# setting hal.make.ignore_system_derived.big_endian is false - -# Enable BSP generation to query if SOPC system has a debug core present. If -# true ignores export of 'CPU_HAS_DEBUG_CORE = 1' to public.mk if a debug core -# is found in the system. If true ignores export of 'CPU_HAS_DEBUG_CORE = 0' if -# no debug core is found in the system. none -# setting hal.make.ignore_system_derived.debug_core_present is false - -# Enable BSP generation to query if SOPC system has FPU present. If true -# ignores export of 'ALT_CFLAGS += -mhard-float' to public.mk if FPU is found -# in the system. If true ignores export of 'ALT_CFLAGS += -mhard-soft' if FPU -# is not found in the system. none -# setting hal.make.ignore_system_derived.fpu_present is false - -# Enable BSP generation to query if SOPC system has hardware divide present. If -# true ignores export of 'ALT_CFLAGS += -mno-hw-div' to public.mk if no -# division is found in system. If true ignores export of 'ALT_CFLAGS += -# -mhw-div' if division is found in the system. none -# setting hal.make.ignore_system_derived.hardware_divide_present is false - -# Enable BSP generation to query if SOPC system floating point custom -# instruction with a divider is present. If true ignores export of 'ALT_CFLAGS -# += -mcustom-fpu-cfg=60-2' and 'ALT_LDFLAGS += -mcustom-fpu-cfg=60-2' to -# public.mk if the custom instruction is found in the system. none -# setting hal.make.ignore_system_derived.hardware_fp_cust_inst_divider_present is false - -# Enable BSP generation to query if SOPC system floating point custom -# instruction without a divider is present. If true ignores export of -# 'ALT_CFLAGS += -mcustom-fpu-cfg=60-1' and 'ALT_LDFLAGS += -# -mcustom-fpu-cfg=60-1' to public.mk if the custom instruction is found in the -# system. none -# setting hal.make.ignore_system_derived.hardware_fp_cust_inst_no_divider_present is false - -# Enable BSP generation to query if SOPC system has multiplier present. If true -# ignores export of 'ALT_CFLAGS += -mno-hw-mul' to public.mk if no multiplier -# is found in the system. If true ignores export of 'ALT_CFLAGS += -mhw-mul' if -# multiplier is found in the system. none -# setting hal.make.ignore_system_derived.hardware_multiplier_present is false - -# Enable BSP generation to query if SOPC system has hardware mulx present. If -# true ignores export of 'ALT_CFLAGS += -mno-hw-mulx' to public.mk if no mulx -# is found in the system. If true ignores export of 'ALT_CFLAGS += -mhw-mulx' -# if mulx is found in the system. none -# setting hal.make.ignore_system_derived.hardware_mulx_present is false - -# Enable BSP generation to query if SOPC system has simulation enabled. If true -# ignores export of 'ELF_PATCH_FLAG += --simulation_enabled' to public.mk. none -# setting hal.make.ignore_system_derived.sopc_simulation_enabled is false - -# Enable BSP generation to query SOPC system for system ID base address. If -# true ignores export of 'SOPC_SYSID_FLAG += --sidp=
' and -# 'ELF_PATCH_FLAG += --sidp=
' to public.mk. none -# setting hal.make.ignore_system_derived.sopc_system_base_address is false - -# Enable BSP generation to query SOPC system for system ID. If true ignores -# export of 'SOPC_SYSID_FLAG += --id=' and 'ELF_PATCH_FLAG += -# --id=' to public.mk. none -# setting hal.make.ignore_system_derived.sopc_system_id is false - -# Enable BSP generation to query SOPC system for system timestamp. If true -# ignores export of 'SOPC_SYSID_FLAG += --timestamp=' and -# 'ELF_PATCH_FLAG += --timestamp=' to public.mk. none -# setting hal.make.ignore_system_derived.sopc_system_timestamp is false - -# Slave descriptor of STDERR character-mode device. This setting is used by the -# ALT_STDERR family of defines in system.h. none -# setting hal.stderr is jtag_uart -ELF_PATCH_FLAG += --stderr_dev jtag_uart - -# Slave descriptor of STDIN character-mode device. This setting is used by the -# ALT_STDIN family of defines in system.h. none -# setting hal.stdin is jtag_uart -ELF_PATCH_FLAG += --stdin_dev jtag_uart - -# Slave descriptor of STDOUT character-mode device. This setting is used by the -# ALT_STDOUT family of defines in system.h. none -# setting hal.stdout is jtag_uart -ELF_PATCH_FLAG += --stdout_dev jtag_uart - - -#------------------------------------------------------------------------------ -# SOFTWARE COMPONENT & DRIVER INCLUDE PATHS -#------------------------------------------------------------------------------ - -ALT_INCLUDE_DIRS += $(ALT_LIBRARY_ROOT_DIR)/HAL/inc - -#------------------------------------------------------------------------------ -# SOFTWARE COMPONENT & DRIVER PRODUCED ALT_CPPFLAGS ADDITIONS -#------------------------------------------------------------------------------ - -ALT_CPPFLAGS += -DALT_SINGLE_THREADED - -#END MANAGED - - -#------------------------------------------------------------------------------ -# LIBRARY INFORMATION -#------------------------------------------------------------------------------ -# Assemble the name of the BSP *.a file using the BSP library name -# (BSP_SYS_LIB) in generated content above. -BSP_LIB := lib$(BSP_SYS_LIB).a - -# Additional libraries to link against: -# An application including this file will prefix each library with "-l". -# For example, to include the Newlib math library "m" is included, which -# becomes "-lm" when linking the application. -ALT_LIBRARY_NAMES += m - -# Additions to linker dependencies: -# An application Makefile will typically add these directly to the list -# of dependencies required to build the executable target(s). The BSP -# library (*.a) file is specified here. -ALT_LDDEPS += $(ALT_LIBRARY_ROOT_DIR)/$(BSP_LIB) - -# Is this library "Makeable"? -# Add to list of root library directories that support running 'make' -# to build them. Because libraries may or may not have a Makefile in their -# root, appending to this variable tells an application to run 'make' in -# the library root to build/update this library. -MAKEABLE_LIBRARY_ROOT_DIRS += $(ALT_LIBRARY_ROOT_DIR) - -# Additional Assembler Flags -# -gdwarf2 flag is required for stepping through assembly code -ALT_ASFLAGS += -gdwarf2 - -#------------------------------------------------------------------------------ -# FINAL INCLUDE PATH LIST -#------------------------------------------------------------------------------ -# Append static include paths to paths specified by OS/driver/sw package -# additions to the BSP thus giving them precedence in case a BSP addition -# is attempting to override BSP sources. -ALT_INCLUDE_DIRS += $(ALT_INCLUDE_DIRS_TO_APPEND) - - - diff --git a/software/qsys_tutorial_mem_bsp/settings.bsp b/software/qsys_tutorial_mem_bsp/settings.bsp deleted file mode 100644 index 7e7b906..0000000 --- a/software/qsys_tutorial_mem_bsp/settings.bsp +++ /dev/null @@ -1,973 +0,0 @@ - - - hal - default - 2016/11/25 16:59:32 - 1480060772296 - C:\Users\takayun\Documents\DE2-115\qsys_tutorial\software\qsys_tutorial_mem_bsp - .\settings.bsp - C:\Users\takayun\Documents\DE2-115\qsys_tutorial\nios_system.sopcinfo - default - nios2_processor - 1.9 - - hal.sys_clk_timer - ALT_SYS_CLK - UnquotedString - none - none - system_h_define - Slave descriptor of the system clock timer device. This device provides a periodic interrupt ("tick") and is typically required for RTOS use. This setting defines the value of ALT_SYS_CLK in system.h. - none - false - common - - - hal.timestamp_timer - ALT_TIMESTAMP_CLK - UnquotedString - none - none - system_h_define - Slave descriptor of timestamp timer device. This device is used by Altera HAL timestamp drivers for high-resolution time measurement. This setting defines the value of ALT_TIMESTAMP_CLK in system.h. - none - false - common - - - hal.max_file_descriptors - ALT_MAX_FD - DecimalNumber - 4 - 32 - system_h_define - Determines the number of file descriptors statically allocated. This setting defines the value of ALT_MAX_FD in system.h. - If hal.enable_lightweight_device_driver_api is true, there are no file descriptors so this setting is ignored. If hal.enable_lightweight_device_driver_api is false, this setting must be at least 4 because HAL needs a file descriptor for /dev/null, /dev/stdin, /dev/stdout, and /dev/stderr. - false - - - - hal.enable_instruction_related_exceptions_api - ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API - BooleanDefineOnly - false - false - system_h_define - Enables API for registering handlers to service instruction-related exceptions. Enabling this setting increases the size of the exception entry code. - These exception types can be generated if various processor options are enabled, such as the MMU, MPU, or other advanced exception types. - false - - - - hal.linker.allow_code_at_reset - ALT_ALLOW_CODE_AT_RESET - Boolean - 1 - 0 - none - Indicates if initialization code is allowed at the reset address. If true, defines the macro ALT_ALLOW_CODE_AT_RESET in linker.h. - If true, defines the macro ALT_ALLOW_CODE_AT_RESET in linker.h. This setting is typically false if an external bootloader (e.g. flash bootloader) is present. - false - - - - hal.linker.enable_alt_load - NONE - Boolean - 1 - 0 - none - Enables the alt_load() facility. The alt_load() facility copies sections from the .text memory into RAM. If true, this setting sets up the VMA/LMA of sections in linker.x to allow them to be loaded into the .text memory. - This setting is typically false if an external bootloader (e.g. flash bootloader) is present. - false - - - - hal.linker.enable_alt_load_copy_rodata - NONE - Boolean - 0 - 0 - none - Causes the alt_load() facility to copy the .rodata section. If true, this setting defines the macro ALT_LOAD_COPY_RODATA in linker.h. - none - false - - - - hal.linker.enable_alt_load_copy_rwdata - NONE - Boolean - 1 - 0 - none - Causes the alt_load() facility to copy the .rwdata section. If true, this setting defines the macro ALT_LOAD_COPY_RWDATA in linker.h. - none - false - - - - hal.linker.enable_alt_load_copy_exceptions - NONE - Boolean - 0 - 0 - none - Causes the alt_load() facility to copy the .exceptions section. If true, this setting defines the macro ALT_LOAD_COPY_EXCEPTIONS in linker.h. - none - false - - - - hal.linker.enable_exception_stack - NONE - Boolean - 0 - 0 - none - Enables use of a separate exception stack. If true, defines the macro ALT_EXCEPTION_STACK in linker.h, adds a memory region called exception_stack to linker.x, and provides the symbols __alt_exception_stack_pointer and __alt_exception_stack_limit in linker.x. - The hal.linker.exception_stack_size and hal.linker.exception_stack_memory_region_name settings must also be valid. This setting must be false for MicroC/OS-II BSPs. The exception stack can be used to improve interrupt and other exception performance if the EIC is *not* used. - false - common - - - hal.linker.exception_stack_size - NONE - DecimalNumber - 1024 - 1024 - none - Size of the exception stack in bytes. - Only used if hal.linker.enable_exception_stack is true. - false - common - - - hal.linker.exception_stack_memory_region_name - NONE - UnquotedString - onchip_memory - none - none - Name of the existing memory region that will be divided up to create the 'exception_stack' memory region. The selected region name will be adjusted automatically when the BSP is generated to create the 'exception_stack' memory region. - Only used if hal.linker.enable_exception_stack is true. - false - common - - - hal.linker.enable_interrupt_stack - NONE - Boolean - 0 - 0 - none - Enables use of a separate interrupt stack. If true, defines the macro ALT_INTERRUPT_STACK in linker.h, adds a memory region called interrupt_stack to linker.x, and provides the symbols __alt_interrupt_stack_pointer and __alt_interrupt_stack_limit in linker.x. - The hal.linker.interrupt_stack_size and hal.linker.interrupt_stack_memory_region_name settings must also be valid. This setting must be false for MicroC/OS-II BSPs. Only enable if the EIC is used exclusively. The exception stack can be used to improve interrupt and other exception performance if the EIC is *not* used. - false - common - - - hal.linker.interrupt_stack_size - NONE - DecimalNumber - 1024 - 1024 - none - Size of the interrupt stack in bytes. - Only used if hal.linker.enable_interrupt_stack is true. - false - common - - - hal.linker.interrupt_stack_memory_region_name - NONE - UnquotedString - onchip_memory - none - none - Name of the existing memory region that will be divided up to create the 'interrupt_stack' memory region. The selected region name will be adjusted automatically when the BSP is generated to create the 'interrupt_stack' memory region. - Only used if hal.linker.enable_interrupt_stack is true. - false - common - - - hal.stdin - NONE - UnquotedString - jtag_uart - none - system_h_define - Slave descriptor of STDIN character-mode device. This setting is used by the ALT_STDIN family of defines in system.h. - none - false - common - - - hal.stdout - NONE - UnquotedString - jtag_uart - none - system_h_define - Slave descriptor of STDOUT character-mode device. This setting is used by the ALT_STDOUT family of defines in system.h. - none - false - common - - - hal.stderr - NONE - UnquotedString - jtag_uart - none - system_h_define - Slave descriptor of STDERR character-mode device. This setting is used by the ALT_STDERR family of defines in system.h. - none - false - common - - - hal.log_port - NONE - UnquotedString - none - none - public_mk_define - Slave descriptor of debug logging character-mode device. If defined, it enables extra debug messages in the HAL source. This setting is used by the ALT_LOG_PORT family of defines in system.h. - none - false - none - - - hal.make.build_pre_process - BUILD_PRE_PROCESS - UnquotedString - none - none - makefile_variable - Command executed before BSP built. - none - false - none - - - hal.make.ar_pre_process - AR_PRE_PROCESS - UnquotedString - none - none - makefile_variable - Command executed before archiver execution. - none - false - none - - - hal.make.bsp_cflags_defined_symbols - BSP_CFLAGS_DEFINED_SYMBOLS - UnquotedString - none - none - makefile_variable - Preprocessor macros to define. A macro definition in this setting has the same effect as a "#define" in source code. Adding "-DALT_DEBUG" to this setting has the same effect as "#define ALT_DEBUG" in a souce file. Adding "-DFOO=1" to this setting is equivalent to the macro "#define FOO 1" in a source file. Macros defined with this setting are applied to all .S, .c, and C++ files in the BSP. This setting defines the value of BSP_CFLAGS_DEFINED_SYMBOLS in the BSP Makefile. - none - false - none - - - hal.make.ar_post_process - AR_POST_PROCESS - UnquotedString - none - none - makefile_variable - Command executed after archiver execution. - none - false - none - - - hal.make.as - AS - UnquotedString - nios2-elf-gcc - nios2-elf-gcc - makefile_variable - Assembler command. Note that CC is used for .S files. - none - false - none - - - hal.make.build_post_process - BUILD_POST_PROCESS - UnquotedString - none - none - makefile_variable - Command executed after BSP built. - none - false - none - - - hal.make.bsp_cflags_debug - BSP_CFLAGS_DEBUG - UnquotedString - -g - -g - makefile_variable - C/C++ compiler debug level. '-g' provides the default set of debug symbols typically required to debug a typical application. Omitting '-g' removes debug symbols from the ELF. This setting defines the value of BSP_CFLAGS_DEBUG in Makefile. - none - false - common - - - hal.make.ar - AR - UnquotedString - nios2-elf-ar - nios2-elf-ar - makefile_variable - Archiver command. Creates library files. - none - false - none - - - hal.make.rm - RM - UnquotedString - rm -f - rm -f - makefile_variable - Command used to remove files during 'clean' target. - none - false - none - - - hal.make.cxx_pre_process - CXX_PRE_PROCESS - UnquotedString - none - none - makefile_variable - Command executed before each C++ file is compiled. - none - false - none - - - hal.make.bsp_cflags_warnings - BSP_CFLAGS_WARNINGS - UnquotedString - -Wall - -Wall - makefile_variable - C/C++ compiler warning level. "-Wall" is commonly used.This setting defines the value of BSP_CFLAGS_WARNINGS in Makefile. - none - false - none - - - hal.make.bsp_arflags - BSP_ARFLAGS - UnquotedString - -src - -src - makefile_variable - Custom flags only passed to the archiver. This content of this variable is directly passed to the archiver rather than the more standard "ARFLAGS". The reason for this is that GNU Make assumes some default content in ARFLAGS. This setting defines the value of BSP_ARFLAGS in Makefile. - none - false - none - - - hal.make.bsp_cflags_optimization - BSP_CFLAGS_OPTIMIZATION - UnquotedString - '-Os' - -O0 - makefile_variable - C/C++ compiler optimization level. "-O0" = no optimization,"-O2" = "normal" optimization, etc. "-O0" is recommended for code that you want to debug since compiler optimization can remove variables and produce non-sequential execution of code while debugging. This setting defines the value of BSP_CFLAGS_OPTIMIZATION in Makefile. - none - false - common - - - hal.make.as_post_process - AS_POST_PROCESS - UnquotedString - none - none - makefile_variable - Command executed after each assembly file is compiled. - none - false - none - - - hal.make.cc_pre_process - CC_PRE_PROCESS - UnquotedString - none - none - makefile_variable - Command executed before each .c/.S file is compiled. - none - false - none - - - hal.make.bsp_asflags - BSP_ASFLAGS - UnquotedString - -Wa,-gdwarf2 - -Wa,-gdwarf2 - makefile_variable - Custom flags only passed to the assembler. This setting defines the value of BSP_ASFLAGS in Makefile. - none - false - none - - - hal.make.as_pre_process - AS_PRE_PROCESS - UnquotedString - none - none - makefile_variable - Command executed before each assembly file is compiled. - none - false - none - - - hal.make.bsp_cflags_undefined_symbols - BSP_CFLAGS_UNDEFINED_SYMBOLS - UnquotedString - none - none - makefile_variable - Preprocessor macros to undefine. Undefined macros are similar to defined macros, but replicate the "#undef" directive in source code. To undefine the macro FOO use the syntax "-u FOO" in this setting. This is equivalent to "#undef FOO" in a source file. Note: the syntax differs from macro definition (there is a space, i.e. "-u FOO" versus "-DFOO"). Macros defined with this setting are applied to all .S, .c, and C++ files in the BSP. This setting defines the value of BSP_CFLAGS_UNDEFINED_SYMBOLS in the BSP Makefile. - none - false - none - - - hal.make.cc_post_process - CC_POST_PROCESS - UnquotedString - none - none - makefile_variable - Command executed after each .c/.S file is compiled. - none - false - none - - - hal.make.cxx_post_process - CXX_POST_PROCESS - UnquotedString - none - none - makefile_variable - Command executed before each C++ file is compiled. - none - false - none - - - hal.make.cc - CC - UnquotedString - nios2-elf-gcc -xc - nios2-elf-gcc -xc - makefile_variable - C compiler command. - none - false - none - - - hal.make.bsp_cxx_flags - BSP_CXXFLAGS - UnquotedString - none - none - makefile_variable - Custom flags only passed to the C++ compiler. This setting defines the value of BSP_CXXFLAGS in Makefile. - none - false - none - - - hal.make.bsp_inc_dirs - BSP_INC_DIRS - UnquotedString - none - none - makefile_variable - Space separated list of extra include directories to scan for header files. Directories are relative to the top-level BSP directory. The -I prefix's added by the makefile so don't add it here. This setting defines the value of BSP_INC_DIRS in Makefile. - none - false - none - - - hal.make.cxx - CXX - UnquotedString - nios2-elf-gcc -xc++ - nios2-elf-gcc -xc++ - makefile_variable - C++ compiler command. - none - false - none - - - hal.make.bsp_cflags_user_flags - BSP_CFLAGS_USER_FLAGS - UnquotedString - none - none - makefile_variable - Custom flags passed to the compiler when compiling C, C++, and .S files. This setting defines the value of BSP_CFLAGS_USER_FLAGS in Makefile. - none - false - none - - - hal.make.ignore_system_derived.sopc_system_id - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query SOPC system for system ID. If true ignores export of 'SOPC_SYSID_FLAG += --id=<sysid>' and 'ELF_PATCH_FLAG += --id=<sysid>' to public.mk. - none - false - none - - - hal.make.ignore_system_derived.sopc_system_timestamp - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query SOPC system for system timestamp. If true ignores export of 'SOPC_SYSID_FLAG += --timestamp=<timestamp>' and 'ELF_PATCH_FLAG += --timestamp=<timestamp>' to public.mk. - none - false - none - - - hal.make.ignore_system_derived.sopc_system_base_address - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query SOPC system for system ID base address. If true ignores export of 'SOPC_SYSID_FLAG += --sidp=<address>' and 'ELF_PATCH_FLAG += --sidp=<address>' to public.mk. - none - false - none - - - hal.make.ignore_system_derived.sopc_simulation_enabled - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system has simulation enabled. If true ignores export of 'ELF_PATCH_FLAG += --simulation_enabled' to public.mk. - none - false - none - - - hal.make.ignore_system_derived.fpu_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system has FPU present. If true ignores export of 'ALT_CFLAGS += -mhard-float' to public.mk if FPU is found in the system. If true ignores export of 'ALT_CFLAGS += -mhard-soft' if FPU is not found in the system. - none - false - none - - - hal.make.ignore_system_derived.hardware_multiplier_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system has multiplier present. If true ignores export of 'ALT_CFLAGS += -mno-hw-mul' to public.mk if no multiplier is found in the system. If true ignores export of 'ALT_CFLAGS += -mhw-mul' if multiplier is found in the system. - none - false - none - - - hal.make.ignore_system_derived.hardware_mulx_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system has hardware mulx present. If true ignores export of 'ALT_CFLAGS += -mno-hw-mulx' to public.mk if no mulx is found in the system. If true ignores export of 'ALT_CFLAGS += -mhw-mulx' if mulx is found in the system. - none - false - none - - - hal.make.ignore_system_derived.hardware_divide_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system has hardware divide present. If true ignores export of 'ALT_CFLAGS += -mno-hw-div' to public.mk if no division is found in system. If true ignores export of 'ALT_CFLAGS += -mhw-div' if division is found in the system. - none - false - none - - - hal.make.ignore_system_derived.debug_core_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system has a debug core present. If true ignores export of 'CPU_HAS_DEBUG_CORE = 1' to public.mk if a debug core is found in the system. If true ignores export of 'CPU_HAS_DEBUG_CORE = 0' if no debug core is found in the system. - none - false - none - - - hal.make.ignore_system_derived.big_endian - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system is big endian. If true ignores export of 'ALT_CFLAGS += -EB' to public.mk if big endian system. If true ignores export of 'ALT_CFLAGS += -EL' if little endian system. - none - false - none - - - hal.make.ignore_system_derived.hardware_fp_cust_inst_divider_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system floating point custom instruction with a divider is present. If true ignores export of 'ALT_CFLAGS += -mcustom-fpu-cfg=60-2' and 'ALT_LDFLAGS += -mcustom-fpu-cfg=60-2' to public.mk if the custom instruction is found in the system. - none - false - none - - - hal.make.ignore_system_derived.hardware_fp_cust_inst_no_divider_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system floating point custom instruction without a divider is present. If true ignores export of 'ALT_CFLAGS += -mcustom-fpu-cfg=60-1' and 'ALT_LDFLAGS += -mcustom-fpu-cfg=60-1' to public.mk if the custom instruction is found in the system. - none - false - none - - - hal.enable_exit - ALT_NO_EXIT - Boolean - 0 - 1 - public_mk_define - Add exit() support. This option increases code footprint if your "main()" routine does "return" or call "exit()". If false, adds -DALT_NO_EXIT to ALT_CPPFLAGS in public.mk, and reduces footprint - none - false - none - - - hal.enable_small_c_library - NONE - Boolean - 1 - 0 - public_mk_define - Causes the small newlib (C library) to be used. This reduces code and data footprint at the expense of reduced functionality. Several newlib features are removed such as floating-point support in printf(), stdin input routines, and buffered I/O. The small C library is not compatible with Micrium MicroC/OS-II. If true, adds -msmallc to ALT_LDFLAGS in public.mk. - none - false - common - - - hal.enable_clean_exit - ALT_NO_CLEAN_EXIT - Boolean - 0 - 1 - public_mk_define - When your application exits, close file descriptors, call C++ destructors, etc. Code footprint can be reduced by disabling clean exit. If disabled, adds -DALT_NO_CLEAN_EXIT to ALT_CPPFLAGS and -Wl,--defsym, exit=_exit to ALT_LDFLAGS in public.mk. - none - false - none - - - hal.enable_runtime_stack_checking - ALT_STACK_CHECK - Boolean - 0 - 0 - public_mk_define - Turns on HAL runtime stack checking feature. Enabling this setting causes additional code to be placed into each subroutine call to generate an exception if a stack collision occurs with the heap or statically allocated data. If true, adds -DALT_STACK_CHECK and -mstack-check to ALT_CPPFLAGS in public.mk. - none - false - none - - - hal.enable_gprof - ALT_PROVIDE_GMON - Boolean - 0 - 0 - public_mk_define - Causes code to be compiled with gprof profiling enabled and the application ELF to be linked with the GPROF library. If true, adds -DALT_PROVIDE_GMON to ALT_CPPFLAGS and -pg to ALT_CFLAGS in public.mk. - none - false - common - - - hal.enable_c_plus_plus - ALT_NO_C_PLUS_PLUS - Boolean - 0 - 1 - public_mk_define - Enable support for a subset of the C++ language. This option increases code footprint by adding support for C++ constructors. Certain features, such as multiple inheritance and exceptions are not supported. If false, adds -DALT_NO_C_PLUS_PLUS to ALT_CPPFLAGS in public.mk, and reduces code footprint. - none - false - none - - - hal.enable_reduced_device_drivers - ALT_USE_SMALL_DRIVERS - Boolean - 1 - 0 - public_mk_define - Certain drivers are compiled with reduced functionality to reduce code footprint. Not all drivers observe this setting. The altera_avalon_uart and altera_avalon_jtag_uart drivers switch from interrupt-driven to polled operation. CAUTION: Several device drivers are disabled entirely. These include the altera_avalon_cfi_flash, altera_avalon_epcs_flash_controller, and altera_avalon_lcd_16207 drivers. This can result in certain API (HAL flash access routines) to fail. You can define a symbol provided by each driver to prevent it from being removed. If true, adds -DALT_USE_SMALL_DRIVERS to ALT_CPPFLAGS in public.mk. - none - false - common - - - hal.enable_lightweight_device_driver_api - ALT_USE_DIRECT_DRIVERS - Boolean - 1 - 0 - public_mk_define - Enables lightweight device driver API. This reduces code and data footprint by removing the HAL layer that maps device names (e.g. /dev/uart0) to file descriptors. Instead, driver routines are called directly. The open(), close(), and lseek() routines will always fail if called. The read(), write(), fstat(), ioctl(), and isatty() routines only work for the stdio devices. If true, adds -DALT_USE_DIRECT_DRIVERS to ALT_CPPFLAGS in public.mk. - The Altera Host and read-only ZIP file systems can't be used if hal.enable_lightweight_device_driver_api is true. - false - none - - - hal.enable_mul_div_emulation - ALT_NO_INSTRUCTION_EMULATION - Boolean - 0 - 0 - public_mk_define - Adds code to emulate multiply and divide instructions in case they are executed but aren't present in the CPU. Normally this isn't required because the compiler won't use multiply and divide instructions that aren't present in the CPU. If false, adds -DALT_NO_INSTRUCTION_EMULATION to ALT_CPPFLAGS in public.mk. - none - false - none - - - hal.enable_sim_optimize - ALT_SIM_OPTIMIZE - Boolean - 0 - 0 - public_mk_define - The BSP is compiled with optimizations to speedup HDL simulation such as initializing the cache, clearing the .bss section, and skipping long delay loops. If true, adds -DALT_SIM_OPTIMIZE to ALT_CPPFLAGS in public.mk. - When this setting is true, the BSP shouldn't be used to build applications that are expected to run real hardware. - false - common - - - hal.enable_sopc_sysid_check - NONE - Boolean - 1 - 1 - public_mk_define - Enable SOPC Builder System ID. If a System ID SOPC Builder component is connected to the CPU associated with this BSP, it will be enabled in the creation of command-line arguments to download an ELF to the target. Otherwise, system ID and timestamp values are left out of public.mk for application Makefile "download-elf" target definition. With the system ID check disabled, the Nios II EDS tools will not automatically ensure that the application .elf file (and BSP it is linked against) corresponds to the hardware design on the target. If false, adds --accept-bad-sysid to SOPC_SYSID_FLAG in public.mk. - none - false - none - - - hal.custom_newlib_flags - CUSTOM_NEWLIB_FLAGS - UnquotedString - none - none - public_mk_define - Build a custom version of newlib with the specified space-separated compiler flags. - The custom newlib build will be placed in the &lt;bsp root>/newlib directory, and will be used only for applications that utilize this BSP. - false - none - - - hal.log_flags - ALT_LOG_FLAGS - DecimalNumber - 0 - 0 - public_mk_define - The value is assigned to ALT_LOG_FLAGS in the generated public.mk. See hal.log_port setting description. Values can be -1 through 3. - hal.log_port must be set for this to be used. - false - none - - - altera_avalon_jtag_uart_driver.enable_small_driver - ALTERA_AVALON_JTAG_UART_SMALL - BooleanDefineOnly - false - false - public_mk_define - Small-footprint (polled mode) driver - none - false - - - - altera_avalon_jtag_uart_driver.enable_jtag_uart_ignore_fifo_full_error - ALTERA_AVALON_JTAG_UART_IGNORE_FIFO_FULL_ERROR - BooleanDefineOnly - false - false - public_mk_define - Enable JTAG UART driver to recover when host is inactive causing buffer to full without returning error. Printf will not fail with this recovery. - none - false - - - - onchip_memory - 0x00000000 - 0x00003FFF - 16384 - memory - - - pio_0 - 0x00005000 - 0x0000500F - 16 - - - - hex6 - 0x00005010 - 0x0000501F - 16 - - - - hex5 - 0x00005020 - 0x0000502F - 16 - - - - hex4 - 0x00005030 - 0x0000503F - 16 - - - - hex3 - 0x00005040 - 0x0000504F - 16 - - - - hex2 - 0x00005050 - 0x0000505F - 16 - - - - hex1 - 0x00005060 - 0x0000506F - 16 - - - - hex0 - 0x00005070 - 0x0000507F - 16 - - - - push_switches - 0x00005080 - 0x0000508F - 16 - - - - switches - 0x00005090 - 0x0000509F - 16 - - - - LEDRs - 0x000050A0 - 0x000050AF - 16 - - - - LEDs - 0x000050B0 - 0x000050BF - 16 - - - - jtag_uart - 0x000050C0 - 0x000050C7 - 8 - printable - - - .text - onchip_memory - - - .rodata - onchip_memory - - - .rwdata - onchip_memory - - - .bss - onchip_memory - - - .heap - onchip_memory - - - .stack - onchip_memory - - \ No newline at end of file diff --git a/software/qsys_tutorial_mem_bsp/summary.html b/software/qsys_tutorial_mem_bsp/summary.html deleted file mode 100644 index 79163ee..0000000 --- a/software/qsys_tutorial_mem_bsp/summary.html +++ /dev/null @@ -1,2038 +0,0 @@ - -Altera Nios II BSP Summary - -

BSP Description

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
BSP Type:hal
SOPC Design File:C:\Users\takayun\Documents\DE2-115\qsys_tutorial\nios_system.sopcinfo
Quartus JDI File:default
CPU:nios2_processor
BSP Settings File:.\settings.bsp
BSP Version:default
BSP Generated On:2016/11/25 16:59:32
BSP Generated Timestamp:1480060772296
BSP Generated Location:C:\Users\takayun\Documents\DE2-115\qsys_tutorial\software\qsys_tutorial_mem_bsp
-
-

Nios II Memory Map

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Slave DescriptorAddress RangeSizeAttributes
jtag_uart0x000050C0 - 0x000050C78printable
LEDs0x000050B0 - 0x000050BF16 
LEDRs0x000050A0 - 0x000050AF16 
switches0x00005090 - 0x0000509F16 
push_switches0x00005080 - 0x0000508F16 
hex00x00005070 - 0x0000507F16 
hex10x00005060 - 0x0000506F16 
hex20x00005050 - 0x0000505F16 
hex30x00005040 - 0x0000504F16 
hex40x00005030 - 0x0000503F16 
hex50x00005020 - 0x0000502F16 
hex60x00005010 - 0x0000501F16 
pio_00x00005000 - 0x0000500F16 
onchip_memory0x00000000 - 0x00003FFF16384memory
-
-
-

Linker Regions

- - - - -
RegionAddress RangeSizeMemoryOffset
-
-
-

Linker Section Mappings

- - - - - - - - - - - - - - - - - - - - - - -
SectionRegion
.textonchip_memory
.rodataonchip_memory
.rwdataonchip_memory
.bssonchip_memory
.heaponchip_memory
.stackonchip_memory
-

Settings

- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:altera_avalon_jtag_uart_driver.enable_jtag_uart_ignore_fifo_full_error
Identifier:ALTERA_AVALON_JTAG_UART_IGNORE_FIFO_FULL_ERROR
Default Value:false
Value:false
Type:BooleanDefineOnly
Destination:public_mk_define
Description:Enable JTAG UART driver to recover when host is inactive causing buffer to full without returning error. Printf will not fail with this recovery.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:altera_avalon_jtag_uart_driver.enable_small_driver
Identifier:ALTERA_AVALON_JTAG_UART_SMALL
Default Value:false
Value:false
Type:BooleanDefineOnly
Destination:public_mk_define
Description:Small-footprint (polled mode) driver
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.custom_newlib_flags
Identifier:CUSTOM_NEWLIB_FLAGS
Default Value:none
Value:none
Type:UnquotedString
Destination:public_mk_define
Description:Build a custom version of newlib with the specified space-separated compiler flags.
Restrictions:The custom newlib build will be placed in the &lt;bsp root>/newlib directory, and will be used only for applications that utilize this BSP.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_c_plus_plus
Identifier:ALT_NO_C_PLUS_PLUS
Default Value:1
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable support for a subset of the C++ language. This option increases code footprint by adding support for C++ constructors. Certain features, such as multiple inheritance and exceptions are not supported. If false, adds -DALT_NO_C_PLUS_PLUS to ALT_CPPFLAGS in public.mk, and reduces code footprint.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_clean_exit
Identifier:ALT_NO_CLEAN_EXIT
Default Value:1
Value:0
Type:Boolean
Destination:public_mk_define
Description:When your application exits, close file descriptors, call C++ destructors, etc. Code footprint can be reduced by disabling clean exit. If disabled, adds -DALT_NO_CLEAN_EXIT to ALT_CPPFLAGS and -Wl,--defsym, exit=_exit to ALT_LDFLAGS in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_exit
Identifier:ALT_NO_EXIT
Default Value:1
Value:0
Type:Boolean
Destination:public_mk_define
Description:Add exit() support. This option increases code footprint if your "main()" routine does "return" or call "exit()". If false, adds -DALT_NO_EXIT to ALT_CPPFLAGS in public.mk, and reduces footprint
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_gprof
Identifier:ALT_PROVIDE_GMON
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Causes code to be compiled with gprof profiling enabled and the application ELF to be linked with the GPROF library. If true, adds -DALT_PROVIDE_GMON to ALT_CPPFLAGS and -pg to ALT_CFLAGS in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_instruction_related_exceptions_api
Identifier:ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API
Default Value:false
Value:false
Type:BooleanDefineOnly
Destination:system_h_define
Description:Enables API for registering handlers to service instruction-related exceptions. Enabling this setting increases the size of the exception entry code.
Restrictions:These exception types can be generated if various processor options are enabled, such as the MMU, MPU, or other advanced exception types.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_lightweight_device_driver_api
Identifier:ALT_USE_DIRECT_DRIVERS
Default Value:0
Value:1
Type:Boolean
Destination:public_mk_define
Description:Enables lightweight device driver API. This reduces code and data footprint by removing the HAL layer that maps device names (e.g. /dev/uart0) to file descriptors. Instead, driver routines are called directly. The open(), close(), and lseek() routines will always fail if called. The read(), write(), fstat(), ioctl(), and isatty() routines only work for the stdio devices. If true, adds -DALT_USE_DIRECT_DRIVERS to ALT_CPPFLAGS in public.mk.
Restrictions:The Altera Host and read-only ZIP file systems can't be used if hal.enable_lightweight_device_driver_api is true.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_mul_div_emulation
Identifier:ALT_NO_INSTRUCTION_EMULATION
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Adds code to emulate multiply and divide instructions in case they are executed but aren't present in the CPU. Normally this isn't required because the compiler won't use multiply and divide instructions that aren't present in the CPU. If false, adds -DALT_NO_INSTRUCTION_EMULATION to ALT_CPPFLAGS in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_reduced_device_drivers
Identifier:ALT_USE_SMALL_DRIVERS
Default Value:0
Value:1
Type:Boolean
Destination:public_mk_define
Description:Certain drivers are compiled with reduced functionality to reduce code footprint. Not all drivers observe this setting. The altera_avalon_uart and altera_avalon_jtag_uart drivers switch from interrupt-driven to polled operation. CAUTION: Several device drivers are disabled entirely. These include the altera_avalon_cfi_flash, altera_avalon_epcs_flash_controller, and altera_avalon_lcd_16207 drivers. This can result in certain API (HAL flash access routines) to fail. You can define a symbol provided by each driver to prevent it from being removed. If true, adds -DALT_USE_SMALL_DRIVERS to ALT_CPPFLAGS in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_runtime_stack_checking
Identifier:ALT_STACK_CHECK
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Turns on HAL runtime stack checking feature. Enabling this setting causes additional code to be placed into each subroutine call to generate an exception if a stack collision occurs with the heap or statically allocated data. If true, adds -DALT_STACK_CHECK and -mstack-check to ALT_CPPFLAGS in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_sim_optimize
Identifier:ALT_SIM_OPTIMIZE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:The BSP is compiled with optimizations to speedup HDL simulation such as initializing the cache, clearing the .bss section, and skipping long delay loops. If true, adds -DALT_SIM_OPTIMIZE to ALT_CPPFLAGS in public.mk.
Restrictions:When this setting is true, the BSP shouldn't be used to build applications that are expected to run real hardware.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_small_c_library
Identifier:NONE
Default Value:0
Value:1
Type:Boolean
Destination:public_mk_define
Description:Causes the small newlib (C library) to be used. This reduces code and data footprint at the expense of reduced functionality. Several newlib features are removed such as floating-point support in printf(), stdin input routines, and buffered I/O. The small C library is not compatible with Micrium MicroC/OS-II. If true, adds -msmallc to ALT_LDFLAGS in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_sopc_sysid_check
Identifier:NONE
Default Value:1
Value:1
Type:Boolean
Destination:public_mk_define
Description:Enable SOPC Builder System ID. If a System ID SOPC Builder component is connected to the CPU associated with this BSP, it will be enabled in the creation of command-line arguments to download an ELF to the target. Otherwise, system ID and timestamp values are left out of public.mk for application Makefile "download-elf" target definition. With the system ID check disabled, the Nios II EDS tools will not automatically ensure that the application .elf file (and BSP it is linked against) corresponds to the hardware design on the target. If false, adds --accept-bad-sysid to SOPC_SYSID_FLAG in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.allow_code_at_reset
Identifier:ALT_ALLOW_CODE_AT_RESET
Default Value:0
Value:1
Type:Boolean
Destination:none
Description:Indicates if initialization code is allowed at the reset address. If true, defines the macro ALT_ALLOW_CODE_AT_RESET in linker.h.
Restrictions:If true, defines the macro ALT_ALLOW_CODE_AT_RESET in linker.h. This setting is typically false if an external bootloader (e.g. flash bootloader) is present.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.enable_alt_load
Identifier:NONE
Default Value:0
Value:1
Type:Boolean
Destination:none
Description:Enables the alt_load() facility. The alt_load() facility copies sections from the .text memory into RAM. If true, this setting sets up the VMA/LMA of sections in linker.x to allow them to be loaded into the .text memory.
Restrictions:This setting is typically false if an external bootloader (e.g. flash bootloader) is present.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.enable_alt_load_copy_exceptions
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:none
Description:Causes the alt_load() facility to copy the .exceptions section. If true, this setting defines the macro ALT_LOAD_COPY_EXCEPTIONS in linker.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.enable_alt_load_copy_rodata
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:none
Description:Causes the alt_load() facility to copy the .rodata section. If true, this setting defines the macro ALT_LOAD_COPY_RODATA in linker.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.enable_alt_load_copy_rwdata
Identifier:NONE
Default Value:0
Value:1
Type:Boolean
Destination:none
Description:Causes the alt_load() facility to copy the .rwdata section. If true, this setting defines the macro ALT_LOAD_COPY_RWDATA in linker.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.enable_exception_stack
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:none
Description:Enables use of a separate exception stack. If true, defines the macro ALT_EXCEPTION_STACK in linker.h, adds a memory region called exception_stack to linker.x, and provides the symbols __alt_exception_stack_pointer and __alt_exception_stack_limit in linker.x.
Restrictions:The hal.linker.exception_stack_size and hal.linker.exception_stack_memory_region_name settings must also be valid. This setting must be false for MicroC/OS-II BSPs. The exception stack can be used to improve interrupt and other exception performance if the EIC is *not* used.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.enable_interrupt_stack
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:none
Description:Enables use of a separate interrupt stack. If true, defines the macro ALT_INTERRUPT_STACK in linker.h, adds a memory region called interrupt_stack to linker.x, and provides the symbols __alt_interrupt_stack_pointer and __alt_interrupt_stack_limit in linker.x.
Restrictions:The hal.linker.interrupt_stack_size and hal.linker.interrupt_stack_memory_region_name settings must also be valid. This setting must be false for MicroC/OS-II BSPs. Only enable if the EIC is used exclusively. The exception stack can be used to improve interrupt and other exception performance if the EIC is *not* used.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.exception_stack_memory_region_name
Identifier:NONE
Default Value:none
Value:onchip_memory
Type:UnquotedString
Destination:none
Description:Name of the existing memory region that will be divided up to create the 'exception_stack' memory region. The selected region name will be adjusted automatically when the BSP is generated to create the 'exception_stack' memory region.
Restrictions:Only used if hal.linker.enable_exception_stack is true.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.exception_stack_size
Identifier:NONE
Default Value:1024
Value:1024
Type:DecimalNumber
Destination:none
Description:Size of the exception stack in bytes.
Restrictions:Only used if hal.linker.enable_exception_stack is true.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.interrupt_stack_memory_region_name
Identifier:NONE
Default Value:none
Value:onchip_memory
Type:UnquotedString
Destination:none
Description:Name of the existing memory region that will be divided up to create the 'interrupt_stack' memory region. The selected region name will be adjusted automatically when the BSP is generated to create the 'interrupt_stack' memory region.
Restrictions:Only used if hal.linker.enable_interrupt_stack is true.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.interrupt_stack_size
Identifier:NONE
Default Value:1024
Value:1024
Type:DecimalNumber
Destination:none
Description:Size of the interrupt stack in bytes.
Restrictions:Only used if hal.linker.enable_interrupt_stack is true.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.log_flags
Identifier:ALT_LOG_FLAGS
Default Value:0
Value:0
Type:DecimalNumber
Destination:public_mk_define
Description:The value is assigned to ALT_LOG_FLAGS in the generated public.mk. See hal.log_port setting description. Values can be -1 through 3.
Restrictions:hal.log_port must be set for this to be used.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.log_port
Identifier:NONE
Default Value:none
Value:none
Type:UnquotedString
Destination:public_mk_define
Description:Slave descriptor of debug logging character-mode device. If defined, it enables extra debug messages in the HAL source. This setting is used by the ALT_LOG_PORT family of defines in system.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ar
Identifier:AR
Default Value:nios2-elf-ar
Value:nios2-elf-ar
Type:UnquotedString
Destination:makefile_variable
Description:Archiver command. Creates library files.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ar_post_process
Identifier:AR_POST_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed after archiver execution.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ar_pre_process
Identifier:AR_PRE_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed before archiver execution.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.as
Identifier:AS
Default Value:nios2-elf-gcc
Value:nios2-elf-gcc
Type:UnquotedString
Destination:makefile_variable
Description:Assembler command. Note that CC is used for .S files.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.as_post_process
Identifier:AS_POST_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed after each assembly file is compiled.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.as_pre_process
Identifier:AS_PRE_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed before each assembly file is compiled.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_arflags
Identifier:BSP_ARFLAGS
Default Value:-src
Value:-src
Type:UnquotedString
Destination:makefile_variable
Description:Custom flags only passed to the archiver. This content of this variable is directly passed to the archiver rather than the more standard "ARFLAGS". The reason for this is that GNU Make assumes some default content in ARFLAGS. This setting defines the value of BSP_ARFLAGS in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_asflags
Identifier:BSP_ASFLAGS
Default Value:-Wa,-gdwarf2
Value:-Wa,-gdwarf2
Type:UnquotedString
Destination:makefile_variable
Description:Custom flags only passed to the assembler. This setting defines the value of BSP_ASFLAGS in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cflags_debug
Identifier:BSP_CFLAGS_DEBUG
Default Value:-g
Value:-g
Type:UnquotedString
Destination:makefile_variable
Description:C/C++ compiler debug level. '-g' provides the default set of debug symbols typically required to debug a typical application. Omitting '-g' removes debug symbols from the ELF. This setting defines the value of BSP_CFLAGS_DEBUG in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cflags_defined_symbols
Identifier:BSP_CFLAGS_DEFINED_SYMBOLS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Preprocessor macros to define. A macro definition in this setting has the same effect as a "#define" in source code. Adding "-DALT_DEBUG" to this setting has the same effect as "#define ALT_DEBUG" in a souce file. Adding "-DFOO=1" to this setting is equivalent to the macro "#define FOO 1" in a source file. Macros defined with this setting are applied to all .S, .c, and C++ files in the BSP. This setting defines the value of BSP_CFLAGS_DEFINED_SYMBOLS in the BSP Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cflags_optimization
Identifier:BSP_CFLAGS_OPTIMIZATION
Default Value:-O0
Value:'-Os'
Type:UnquotedString
Destination:makefile_variable
Description:C/C++ compiler optimization level. "-O0" = no optimization,"-O2" = "normal" optimization, etc. "-O0" is recommended for code that you want to debug since compiler optimization can remove variables and produce non-sequential execution of code while debugging. This setting defines the value of BSP_CFLAGS_OPTIMIZATION in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cflags_undefined_symbols
Identifier:BSP_CFLAGS_UNDEFINED_SYMBOLS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Preprocessor macros to undefine. Undefined macros are similar to defined macros, but replicate the "#undef" directive in source code. To undefine the macro FOO use the syntax "-u FOO" in this setting. This is equivalent to "#undef FOO" in a source file. Note: the syntax differs from macro definition (there is a space, i.e. "-u FOO" versus "-DFOO"). Macros defined with this setting are applied to all .S, .c, and C++ files in the BSP. This setting defines the value of BSP_CFLAGS_UNDEFINED_SYMBOLS in the BSP Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cflags_user_flags
Identifier:BSP_CFLAGS_USER_FLAGS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Custom flags passed to the compiler when compiling C, C++, and .S files. This setting defines the value of BSP_CFLAGS_USER_FLAGS in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cflags_warnings
Identifier:BSP_CFLAGS_WARNINGS
Default Value:-Wall
Value:-Wall
Type:UnquotedString
Destination:makefile_variable
Description:C/C++ compiler warning level. "-Wall" is commonly used.This setting defines the value of BSP_CFLAGS_WARNINGS in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cxx_flags
Identifier:BSP_CXXFLAGS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Custom flags only passed to the C++ compiler. This setting defines the value of BSP_CXXFLAGS in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_inc_dirs
Identifier:BSP_INC_DIRS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Space separated list of extra include directories to scan for header files. Directories are relative to the top-level BSP directory. The -I prefix's added by the makefile so don't add it here. This setting defines the value of BSP_INC_DIRS in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.build_post_process
Identifier:BUILD_POST_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed after BSP built.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.build_pre_process
Identifier:BUILD_PRE_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed before BSP built.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.cc
Identifier:CC
Default Value:nios2-elf-gcc -xc
Value:nios2-elf-gcc -xc
Type:UnquotedString
Destination:makefile_variable
Description:C compiler command.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.cc_post_process
Identifier:CC_POST_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed after each .c/.S file is compiled.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.cc_pre_process
Identifier:CC_PRE_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed before each .c/.S file is compiled.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.cxx
Identifier:CXX
Default Value:nios2-elf-gcc -xc++
Value:nios2-elf-gcc -xc++
Type:UnquotedString
Destination:makefile_variable
Description:C++ compiler command.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.cxx_post_process
Identifier:CXX_POST_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed before each C++ file is compiled.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.cxx_pre_process
Identifier:CXX_PRE_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed before each C++ file is compiled.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.big_endian
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system is big endian. If true ignores export of 'ALT_CFLAGS += -EB' to public.mk if big endian system. If true ignores export of 'ALT_CFLAGS += -EL' if little endian system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.debug_core_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system has a debug core present. If true ignores export of 'CPU_HAS_DEBUG_CORE = 1' to public.mk if a debug core is found in the system. If true ignores export of 'CPU_HAS_DEBUG_CORE = 0' if no debug core is found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.fpu_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system has FPU present. If true ignores export of 'ALT_CFLAGS += -mhard-float' to public.mk if FPU is found in the system. If true ignores export of 'ALT_CFLAGS += -mhard-soft' if FPU is not found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.hardware_divide_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system has hardware divide present. If true ignores export of 'ALT_CFLAGS += -mno-hw-div' to public.mk if no division is found in system. If true ignores export of 'ALT_CFLAGS += -mhw-div' if division is found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.hardware_fp_cust_inst_divider_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system floating point custom instruction with a divider is present. If true ignores export of 'ALT_CFLAGS += -mcustom-fpu-cfg=60-2' and 'ALT_LDFLAGS += -mcustom-fpu-cfg=60-2' to public.mk if the custom instruction is found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.hardware_fp_cust_inst_no_divider_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system floating point custom instruction without a divider is present. If true ignores export of 'ALT_CFLAGS += -mcustom-fpu-cfg=60-1' and 'ALT_LDFLAGS += -mcustom-fpu-cfg=60-1' to public.mk if the custom instruction is found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.hardware_multiplier_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system has multiplier present. If true ignores export of 'ALT_CFLAGS += -mno-hw-mul' to public.mk if no multiplier is found in the system. If true ignores export of 'ALT_CFLAGS += -mhw-mul' if multiplier is found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.hardware_mulx_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system has hardware mulx present. If true ignores export of 'ALT_CFLAGS += -mno-hw-mulx' to public.mk if no mulx is found in the system. If true ignores export of 'ALT_CFLAGS += -mhw-mulx' if mulx is found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.sopc_simulation_enabled
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system has simulation enabled. If true ignores export of 'ELF_PATCH_FLAG += --simulation_enabled' to public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.sopc_system_base_address
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query SOPC system for system ID base address. If true ignores export of 'SOPC_SYSID_FLAG += --sidp=<address>' and 'ELF_PATCH_FLAG += --sidp=<address>' to public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.sopc_system_id
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query SOPC system for system ID. If true ignores export of 'SOPC_SYSID_FLAG += --id=<sysid>' and 'ELF_PATCH_FLAG += --id=<sysid>' to public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.sopc_system_timestamp
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query SOPC system for system timestamp. If true ignores export of 'SOPC_SYSID_FLAG += --timestamp=<timestamp>' and 'ELF_PATCH_FLAG += --timestamp=<timestamp>' to public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.rm
Identifier:RM
Default Value:rm -f
Value:rm -f
Type:UnquotedString
Destination:makefile_variable
Description:Command used to remove files during 'clean' target.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.max_file_descriptors
Identifier:ALT_MAX_FD
Default Value:32
Value:4
Type:DecimalNumber
Destination:system_h_define
Description:Determines the number of file descriptors statically allocated. This setting defines the value of ALT_MAX_FD in system.h.
Restrictions:If hal.enable_lightweight_device_driver_api is true, there are no file descriptors so this setting is ignored. If hal.enable_lightweight_device_driver_api is false, this setting must be at least 4 because HAL needs a file descriptor for /dev/null, /dev/stdin, /dev/stdout, and /dev/stderr.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.stderr
Identifier:NONE
Default Value:none
Value:jtag_uart
Type:UnquotedString
Destination:system_h_define
Description:Slave descriptor of STDERR character-mode device. This setting is used by the ALT_STDERR family of defines in system.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.stdin
Identifier:NONE
Default Value:none
Value:jtag_uart
Type:UnquotedString
Destination:system_h_define
Description:Slave descriptor of STDIN character-mode device. This setting is used by the ALT_STDIN family of defines in system.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.stdout
Identifier:NONE
Default Value:none
Value:jtag_uart
Type:UnquotedString
Destination:system_h_define
Description:Slave descriptor of STDOUT character-mode device. This setting is used by the ALT_STDOUT family of defines in system.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.sys_clk_timer
Identifier:ALT_SYS_CLK
Default Value:none
Value:none
Type:UnquotedString
Destination:system_h_define
Description:Slave descriptor of the system clock timer device. This device provides a periodic interrupt ("tick") and is typically required for RTOS use. This setting defines the value of ALT_SYS_CLK in system.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.timestamp_timer
Identifier:ALT_TIMESTAMP_CLK
Default Value:none
Value:none
Type:UnquotedString
Destination:system_h_define
Description:Slave descriptor of timestamp timer device. This device is used by Altera HAL timestamp drivers for high-resolution time measurement. This setting defines the value of ALT_TIMESTAMP_CLK in system.h.
Restrictions:none
-
-
-
- - diff --git a/software/qsys_tutorial_mem_bsp/system.h b/software/qsys_tutorial_mem_bsp/system.h deleted file mode 100644 index 9ec656f..0000000 --- a/software/qsys_tutorial_mem_bsp/system.h +++ /dev/null @@ -1,548 +0,0 @@ -/* - * system.h - SOPC Builder system and BSP software package information - * - * Machine generated for CPU 'nios2_processor' in SOPC Builder design 'nios_system' - * SOPC Builder design path: C:/Users/takayun/Documents/DE2-115/qsys_tutorial/nios_system.sopcinfo - * - * Generated: Fri Nov 25 16:59:33 JST 2016 - */ - -/* - * DO NOT MODIFY THIS FILE - * - * Changing this file will have subtle consequences - * which will almost certainly lead to a nonfunctioning - * system. If you do modify this file, be aware that your - * changes will be overwritten and lost when this file - * is generated again. - * - * DO NOT MODIFY THIS FILE - */ - -/* - * License Agreement - * - * Copyright (c) 2008 - * Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - * - * This agreement shall be governed in all respects by the laws of the State - * of California and by the laws of the United States of America. - */ - -#ifndef __SYSTEM_H_ -#define __SYSTEM_H_ - -/* Include definitions from linker script generator */ -#include "linker.h" - - -/* - * CPU configuration - * - */ - -#define ALT_CPU_ARCHITECTURE "altera_nios2_qsys" -#define ALT_CPU_BIG_ENDIAN 0 -#define ALT_CPU_BREAK_ADDR 0x4820 -#define ALT_CPU_CPU_FREQ 50000000u -#define ALT_CPU_CPU_ID_SIZE 1 -#define ALT_CPU_CPU_ID_VALUE 0x00000000 -#define ALT_CPU_CPU_IMPLEMENTATION "tiny" -#define ALT_CPU_DATA_ADDR_WIDTH 0xf -#define ALT_CPU_DCACHE_LINE_SIZE 0 -#define ALT_CPU_DCACHE_LINE_SIZE_LOG2 0 -#define ALT_CPU_DCACHE_SIZE 0 -#define ALT_CPU_EXCEPTION_ADDR 0x20 -#define ALT_CPU_FLUSHDA_SUPPORTED -#define ALT_CPU_FREQ 50000000 -#define ALT_CPU_HARDWARE_DIVIDE_PRESENT 0 -#define ALT_CPU_HARDWARE_MULTIPLY_PRESENT 0 -#define ALT_CPU_HARDWARE_MULX_PRESENT 0 -#define ALT_CPU_HAS_DEBUG_CORE 1 -#define ALT_CPU_HAS_DEBUG_STUB -#define ALT_CPU_HAS_JMPI_INSTRUCTION -#define ALT_CPU_ICACHE_LINE_SIZE 0 -#define ALT_CPU_ICACHE_LINE_SIZE_LOG2 0 -#define ALT_CPU_ICACHE_SIZE 0 -#define ALT_CPU_INST_ADDR_WIDTH 0xf -#define ALT_CPU_NAME "nios2_processor" -#define ALT_CPU_RESET_ADDR 0x0 - - -/* - * CPU configuration (with legacy prefix - don't use these anymore) - * - */ - -#define NIOS2_BIG_ENDIAN 0 -#define NIOS2_BREAK_ADDR 0x4820 -#define NIOS2_CPU_FREQ 50000000u -#define NIOS2_CPU_ID_SIZE 1 -#define NIOS2_CPU_ID_VALUE 0x00000000 -#define NIOS2_CPU_IMPLEMENTATION "tiny" -#define NIOS2_DATA_ADDR_WIDTH 0xf -#define NIOS2_DCACHE_LINE_SIZE 0 -#define NIOS2_DCACHE_LINE_SIZE_LOG2 0 -#define NIOS2_DCACHE_SIZE 0 -#define NIOS2_EXCEPTION_ADDR 0x20 -#define NIOS2_FLUSHDA_SUPPORTED -#define NIOS2_HARDWARE_DIVIDE_PRESENT 0 -#define NIOS2_HARDWARE_MULTIPLY_PRESENT 0 -#define NIOS2_HARDWARE_MULX_PRESENT 0 -#define NIOS2_HAS_DEBUG_CORE 1 -#define NIOS2_HAS_DEBUG_STUB -#define NIOS2_HAS_JMPI_INSTRUCTION -#define NIOS2_ICACHE_LINE_SIZE 0 -#define NIOS2_ICACHE_LINE_SIZE_LOG2 0 -#define NIOS2_ICACHE_SIZE 0 -#define NIOS2_INST_ADDR_WIDTH 0xf -#define NIOS2_RESET_ADDR 0x0 - - -/* - * Define for each module class mastered by the CPU - * - */ - -#define __ALTERA_AVALON_JTAG_UART -#define __ALTERA_AVALON_ONCHIP_MEMORY2 -#define __ALTERA_AVALON_PIO -#define __ALTERA_NIOS2_QSYS - - -/* - * LEDRs configuration - * - */ - -#define ALT_MODULE_CLASS_LEDRs altera_avalon_pio -#define LEDRS_BASE 0x50a0 -#define LEDRS_BIT_CLEARING_EDGE_REGISTER 0 -#define LEDRS_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define LEDRS_CAPTURE 0 -#define LEDRS_DATA_WIDTH 18 -#define LEDRS_DO_TEST_BENCH_WIRING 0 -#define LEDRS_DRIVEN_SIM_VALUE 0 -#define LEDRS_EDGE_TYPE "NONE" -#define LEDRS_FREQ 50000000 -#define LEDRS_HAS_IN 0 -#define LEDRS_HAS_OUT 1 -#define LEDRS_HAS_TRI 0 -#define LEDRS_IRQ -1 -#define LEDRS_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define LEDRS_IRQ_TYPE "NONE" -#define LEDRS_NAME "/dev/LEDRs" -#define LEDRS_RESET_VALUE 0 -#define LEDRS_SPAN 16 -#define LEDRS_TYPE "altera_avalon_pio" - - -/* - * LEDs configuration - * - */ - -#define ALT_MODULE_CLASS_LEDs altera_avalon_pio -#define LEDS_BASE 0x50b0 -#define LEDS_BIT_CLEARING_EDGE_REGISTER 0 -#define LEDS_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define LEDS_CAPTURE 0 -#define LEDS_DATA_WIDTH 8 -#define LEDS_DO_TEST_BENCH_WIRING 0 -#define LEDS_DRIVEN_SIM_VALUE 0 -#define LEDS_EDGE_TYPE "NONE" -#define LEDS_FREQ 50000000 -#define LEDS_HAS_IN 0 -#define LEDS_HAS_OUT 1 -#define LEDS_HAS_TRI 0 -#define LEDS_IRQ -1 -#define LEDS_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define LEDS_IRQ_TYPE "NONE" -#define LEDS_NAME "/dev/LEDs" -#define LEDS_RESET_VALUE 0 -#define LEDS_SPAN 16 -#define LEDS_TYPE "altera_avalon_pio" - - -/* - * System configuration - * - */ - -#define ALT_DEVICE_FAMILY "Cyclone IV E" -#define ALT_ENHANCED_INTERRUPT_API_PRESENT -#define ALT_IRQ_BASE NULL -#define ALT_LOG_PORT "/dev/null" -#define ALT_LOG_PORT_BASE 0x0 -#define ALT_LOG_PORT_DEV null -#define ALT_LOG_PORT_TYPE "" -#define ALT_NUM_EXTERNAL_INTERRUPT_CONTROLLERS 0 -#define ALT_NUM_INTERNAL_INTERRUPT_CONTROLLERS 1 -#define ALT_NUM_INTERRUPT_CONTROLLERS 1 -#define ALT_STDERR "/dev/jtag_uart" -#define ALT_STDERR_BASE 0x50c0 -#define ALT_STDERR_DEV jtag_uart -#define ALT_STDERR_IS_JTAG_UART -#define ALT_STDERR_PRESENT -#define ALT_STDERR_TYPE "altera_avalon_jtag_uart" -#define ALT_STDIN "/dev/jtag_uart" -#define ALT_STDIN_BASE 0x50c0 -#define ALT_STDIN_DEV jtag_uart -#define ALT_STDIN_IS_JTAG_UART -#define ALT_STDIN_PRESENT -#define ALT_STDIN_TYPE "altera_avalon_jtag_uart" -#define ALT_STDOUT "/dev/jtag_uart" -#define ALT_STDOUT_BASE 0x50c0 -#define ALT_STDOUT_DEV jtag_uart -#define ALT_STDOUT_IS_JTAG_UART -#define ALT_STDOUT_PRESENT -#define ALT_STDOUT_TYPE "altera_avalon_jtag_uart" -#define ALT_SYSTEM_NAME "nios_system" - - -/* - * hal configuration - * - */ - -#define ALT_MAX_FD 4 -#define ALT_SYS_CLK none -#define ALT_TIMESTAMP_CLK none - - -/* - * hex0 configuration - * - */ - -#define ALT_MODULE_CLASS_hex0 altera_avalon_pio -#define HEX0_BASE 0x5070 -#define HEX0_BIT_CLEARING_EDGE_REGISTER 0 -#define HEX0_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define HEX0_CAPTURE 0 -#define HEX0_DATA_WIDTH 7 -#define HEX0_DO_TEST_BENCH_WIRING 0 -#define HEX0_DRIVEN_SIM_VALUE 0 -#define HEX0_EDGE_TYPE "NONE" -#define HEX0_FREQ 50000000 -#define HEX0_HAS_IN 0 -#define HEX0_HAS_OUT 1 -#define HEX0_HAS_TRI 0 -#define HEX0_IRQ -1 -#define HEX0_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define HEX0_IRQ_TYPE "NONE" -#define HEX0_NAME "/dev/hex0" -#define HEX0_RESET_VALUE 0 -#define HEX0_SPAN 16 -#define HEX0_TYPE "altera_avalon_pio" - - -/* - * hex1 configuration - * - */ - -#define ALT_MODULE_CLASS_hex1 altera_avalon_pio -#define HEX1_BASE 0x5060 -#define HEX1_BIT_CLEARING_EDGE_REGISTER 0 -#define HEX1_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define HEX1_CAPTURE 0 -#define HEX1_DATA_WIDTH 7 -#define HEX1_DO_TEST_BENCH_WIRING 0 -#define HEX1_DRIVEN_SIM_VALUE 0 -#define HEX1_EDGE_TYPE "NONE" -#define HEX1_FREQ 50000000 -#define HEX1_HAS_IN 0 -#define HEX1_HAS_OUT 1 -#define HEX1_HAS_TRI 0 -#define HEX1_IRQ -1 -#define HEX1_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define HEX1_IRQ_TYPE "NONE" -#define HEX1_NAME "/dev/hex1" -#define HEX1_RESET_VALUE 0 -#define HEX1_SPAN 16 -#define HEX1_TYPE "altera_avalon_pio" - - -/* - * hex2 configuration - * - */ - -#define ALT_MODULE_CLASS_hex2 altera_avalon_pio -#define HEX2_BASE 0x5050 -#define HEX2_BIT_CLEARING_EDGE_REGISTER 0 -#define HEX2_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define HEX2_CAPTURE 0 -#define HEX2_DATA_WIDTH 7 -#define HEX2_DO_TEST_BENCH_WIRING 0 -#define HEX2_DRIVEN_SIM_VALUE 0 -#define HEX2_EDGE_TYPE "NONE" -#define HEX2_FREQ 50000000 -#define HEX2_HAS_IN 0 -#define HEX2_HAS_OUT 1 -#define HEX2_HAS_TRI 0 -#define HEX2_IRQ -1 -#define HEX2_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define HEX2_IRQ_TYPE "NONE" -#define HEX2_NAME "/dev/hex2" -#define HEX2_RESET_VALUE 0 -#define HEX2_SPAN 16 -#define HEX2_TYPE "altera_avalon_pio" - - -/* - * hex3 configuration - * - */ - -#define ALT_MODULE_CLASS_hex3 altera_avalon_pio -#define HEX3_BASE 0x5040 -#define HEX3_BIT_CLEARING_EDGE_REGISTER 0 -#define HEX3_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define HEX3_CAPTURE 0 -#define HEX3_DATA_WIDTH 7 -#define HEX3_DO_TEST_BENCH_WIRING 0 -#define HEX3_DRIVEN_SIM_VALUE 0 -#define HEX3_EDGE_TYPE "NONE" -#define HEX3_FREQ 50000000 -#define HEX3_HAS_IN 0 -#define HEX3_HAS_OUT 1 -#define HEX3_HAS_TRI 0 -#define HEX3_IRQ -1 -#define HEX3_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define HEX3_IRQ_TYPE "NONE" -#define HEX3_NAME "/dev/hex3" -#define HEX3_RESET_VALUE 0 -#define HEX3_SPAN 16 -#define HEX3_TYPE "altera_avalon_pio" - - -/* - * hex4 configuration - * - */ - -#define ALT_MODULE_CLASS_hex4 altera_avalon_pio -#define HEX4_BASE 0x5030 -#define HEX4_BIT_CLEARING_EDGE_REGISTER 0 -#define HEX4_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define HEX4_CAPTURE 0 -#define HEX4_DATA_WIDTH 7 -#define HEX4_DO_TEST_BENCH_WIRING 0 -#define HEX4_DRIVEN_SIM_VALUE 0 -#define HEX4_EDGE_TYPE "NONE" -#define HEX4_FREQ 50000000 -#define HEX4_HAS_IN 0 -#define HEX4_HAS_OUT 1 -#define HEX4_HAS_TRI 0 -#define HEX4_IRQ -1 -#define HEX4_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define HEX4_IRQ_TYPE "NONE" -#define HEX4_NAME "/dev/hex4" -#define HEX4_RESET_VALUE 0 -#define HEX4_SPAN 16 -#define HEX4_TYPE "altera_avalon_pio" - - -/* - * hex5 configuration - * - */ - -#define ALT_MODULE_CLASS_hex5 altera_avalon_pio -#define HEX5_BASE 0x5020 -#define HEX5_BIT_CLEARING_EDGE_REGISTER 0 -#define HEX5_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define HEX5_CAPTURE 0 -#define HEX5_DATA_WIDTH 7 -#define HEX5_DO_TEST_BENCH_WIRING 0 -#define HEX5_DRIVEN_SIM_VALUE 0 -#define HEX5_EDGE_TYPE "NONE" -#define HEX5_FREQ 50000000 -#define HEX5_HAS_IN 0 -#define HEX5_HAS_OUT 1 -#define HEX5_HAS_TRI 0 -#define HEX5_IRQ -1 -#define HEX5_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define HEX5_IRQ_TYPE "NONE" -#define HEX5_NAME "/dev/hex5" -#define HEX5_RESET_VALUE 0 -#define HEX5_SPAN 16 -#define HEX5_TYPE "altera_avalon_pio" - - -/* - * hex6 configuration - * - */ - -#define ALT_MODULE_CLASS_hex6 altera_avalon_pio -#define HEX6_BASE 0x5010 -#define HEX6_BIT_CLEARING_EDGE_REGISTER 0 -#define HEX6_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define HEX6_CAPTURE 0 -#define HEX6_DATA_WIDTH 7 -#define HEX6_DO_TEST_BENCH_WIRING 0 -#define HEX6_DRIVEN_SIM_VALUE 0 -#define HEX6_EDGE_TYPE "NONE" -#define HEX6_FREQ 50000000 -#define HEX6_HAS_IN 0 -#define HEX6_HAS_OUT 1 -#define HEX6_HAS_TRI 0 -#define HEX6_IRQ -1 -#define HEX6_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define HEX6_IRQ_TYPE "NONE" -#define HEX6_NAME "/dev/hex6" -#define HEX6_RESET_VALUE 0 -#define HEX6_SPAN 16 -#define HEX6_TYPE "altera_avalon_pio" - - -/* - * jtag_uart configuration - * - */ - -#define ALT_MODULE_CLASS_jtag_uart altera_avalon_jtag_uart -#define JTAG_UART_BASE 0x50c0 -#define JTAG_UART_IRQ 5 -#define JTAG_UART_IRQ_INTERRUPT_CONTROLLER_ID 0 -#define JTAG_UART_NAME "/dev/jtag_uart" -#define JTAG_UART_READ_DEPTH 64 -#define JTAG_UART_READ_THRESHOLD 8 -#define JTAG_UART_SPAN 8 -#define JTAG_UART_TYPE "altera_avalon_jtag_uart" -#define JTAG_UART_WRITE_DEPTH 64 -#define JTAG_UART_WRITE_THRESHOLD 8 - - -/* - * onchip_memory configuration - * - */ - -#define ALT_MODULE_CLASS_onchip_memory altera_avalon_onchip_memory2 -#define ONCHIP_MEMORY_ALLOW_IN_SYSTEM_MEMORY_CONTENT_EDITOR 0 -#define ONCHIP_MEMORY_ALLOW_MRAM_SIM_CONTENTS_ONLY_FILE 0 -#define ONCHIP_MEMORY_BASE 0x0 -#define ONCHIP_MEMORY_CONTENTS_INFO "" -#define ONCHIP_MEMORY_DUAL_PORT 0 -#define ONCHIP_MEMORY_GUI_RAM_BLOCK_TYPE "AUTO" -#define ONCHIP_MEMORY_INIT_CONTENTS_FILE "nios_system_onchip_memory" -#define ONCHIP_MEMORY_INIT_MEM_CONTENT 1 -#define ONCHIP_MEMORY_INSTANCE_ID "NONE" -#define ONCHIP_MEMORY_IRQ -1 -#define ONCHIP_MEMORY_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define ONCHIP_MEMORY_NAME "/dev/onchip_memory" -#define ONCHIP_MEMORY_NON_DEFAULT_INIT_FILE_ENABLED 0 -#define ONCHIP_MEMORY_RAM_BLOCK_TYPE "AUTO" -#define ONCHIP_MEMORY_READ_DURING_WRITE_MODE "DONT_CARE" -#define ONCHIP_MEMORY_SINGLE_CLOCK_OP 0 -#define ONCHIP_MEMORY_SIZE_MULTIPLE 1 -#define ONCHIP_MEMORY_SIZE_VALUE 16384 -#define ONCHIP_MEMORY_SPAN 16384 -#define ONCHIP_MEMORY_TYPE "altera_avalon_onchip_memory2" -#define ONCHIP_MEMORY_WRITABLE 1 - - -/* - * pio_0 configuration - * - */ - -#define ALT_MODULE_CLASS_pio_0 altera_avalon_pio -#define PIO_0_BASE 0x5000 -#define PIO_0_BIT_CLEARING_EDGE_REGISTER 0 -#define PIO_0_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define PIO_0_CAPTURE 0 -#define PIO_0_DATA_WIDTH 7 -#define PIO_0_DO_TEST_BENCH_WIRING 0 -#define PIO_0_DRIVEN_SIM_VALUE 0 -#define PIO_0_EDGE_TYPE "NONE" -#define PIO_0_FREQ 50000000 -#define PIO_0_HAS_IN 0 -#define PIO_0_HAS_OUT 1 -#define PIO_0_HAS_TRI 0 -#define PIO_0_IRQ -1 -#define PIO_0_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define PIO_0_IRQ_TYPE "NONE" -#define PIO_0_NAME "/dev/pio_0" -#define PIO_0_RESET_VALUE 0 -#define PIO_0_SPAN 16 -#define PIO_0_TYPE "altera_avalon_pio" - - -/* - * push_switches configuration - * - */ - -#define ALT_MODULE_CLASS_push_switches altera_avalon_pio -#define PUSH_SWITCHES_BASE 0x5080 -#define PUSH_SWITCHES_BIT_CLEARING_EDGE_REGISTER 0 -#define PUSH_SWITCHES_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define PUSH_SWITCHES_CAPTURE 0 -#define PUSH_SWITCHES_DATA_WIDTH 3 -#define PUSH_SWITCHES_DO_TEST_BENCH_WIRING 0 -#define PUSH_SWITCHES_DRIVEN_SIM_VALUE 0 -#define PUSH_SWITCHES_EDGE_TYPE "NONE" -#define PUSH_SWITCHES_FREQ 50000000 -#define PUSH_SWITCHES_HAS_IN 1 -#define PUSH_SWITCHES_HAS_OUT 0 -#define PUSH_SWITCHES_HAS_TRI 0 -#define PUSH_SWITCHES_IRQ -1 -#define PUSH_SWITCHES_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define PUSH_SWITCHES_IRQ_TYPE "NONE" -#define PUSH_SWITCHES_NAME "/dev/push_switches" -#define PUSH_SWITCHES_RESET_VALUE 0 -#define PUSH_SWITCHES_SPAN 16 -#define PUSH_SWITCHES_TYPE "altera_avalon_pio" - - -/* - * switches configuration - * - */ - -#define ALT_MODULE_CLASS_switches altera_avalon_pio -#define SWITCHES_BASE 0x5090 -#define SWITCHES_BIT_CLEARING_EDGE_REGISTER 0 -#define SWITCHES_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define SWITCHES_CAPTURE 0 -#define SWITCHES_DATA_WIDTH 18 -#define SWITCHES_DO_TEST_BENCH_WIRING 0 -#define SWITCHES_DRIVEN_SIM_VALUE 0 -#define SWITCHES_EDGE_TYPE "NONE" -#define SWITCHES_FREQ 50000000 -#define SWITCHES_HAS_IN 1 -#define SWITCHES_HAS_OUT 0 -#define SWITCHES_HAS_TRI 0 -#define SWITCHES_IRQ -1 -#define SWITCHES_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define SWITCHES_IRQ_TYPE "NONE" -#define SWITCHES_NAME "/dev/switches" -#define SWITCHES_RESET_VALUE 0 -#define SWITCHES_SPAN 16 -#define SWITCHES_TYPE "altera_avalon_pio" - -#endif /* __SYSTEM_H_ */ diff --git a/software/qsys_tutorial_switchs18/.cproject b/software/qsys_tutorial_switchs18/.cproject deleted file mode 100644 index c3108e0..0000000 --- a/software/qsys_tutorial_switchs18/.cproject +++ /dev/null @@ -1,508 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - make - - mem_init_install - true - false - false - - - make - - mem_init_generate - true - false - false - - - make - - help - true - false - false - - - - diff --git a/software/qsys_tutorial_switchs18/.project b/software/qsys_tutorial_switchs18/.project deleted file mode 100644 index e339893..0000000 --- a/software/qsys_tutorial_switchs18/.project +++ /dev/null @@ -1,96 +0,0 @@ - - - qsys_tutorial_switchs18 - - - - - - com.altera.sbtgui.project.makefileBuilder - - - - - com.altera.sbtgui.project.makefileBuilder - - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - ?name? - - - - org.eclipse.cdt.make.core.append_environment - true - - - org.eclipse.cdt.make.core.autoBuildTarget - all - - - org.eclipse.cdt.make.core.buildArguments - - - - org.eclipse.cdt.make.core.buildCommand - make - - - org.eclipse.cdt.make.core.buildLocation - ${workspace_loc://qsys_tutorial_switchs18} - - - org.eclipse.cdt.make.core.cleanBuildTarget - clean - - - org.eclipse.cdt.make.core.contents - org.eclipse.cdt.make.core.activeConfigSettings - - - org.eclipse.cdt.make.core.enableAutoBuild - false - - - org.eclipse.cdt.make.core.enableCleanBuild - true - - - org.eclipse.cdt.make.core.enableFullBuild - true - - - org.eclipse.cdt.make.core.fullBuildTarget - all - - - org.eclipse.cdt.make.core.stopOnError - true - - - org.eclipse.cdt.make.core.useDefaultBuildCmd - true - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - org.eclipse.cdt.core.ccnature - com.altera.sbtgui.project.SBTGUINature - com.altera.sbtgui.project.SBTGUIAppNature - com.altera.sbtgui.project.SBTGUIManagedNature - - diff --git a/software/qsys_tutorial_switchs18/Makefile b/software/qsys_tutorial_switchs18/Makefile deleted file mode 100644 index a3fe50a..0000000 --- a/software/qsys_tutorial_switchs18/Makefile +++ /dev/null @@ -1,1086 +0,0 @@ -#------------------------------------------------------------------------------ -# VARIABLES APPENDED TO BY INCLUDED MAKEFILE FRAGMENTS -#------------------------------------------------------------------------------ - -# List of include directories for -I compiler option (-I added when used). -# Includes the BSP. -ALT_INCLUDE_DIRS := - -# List of library directories for -L linker option (-L added when used). -# Includes the BSP. -ALT_LIBRARY_DIRS := - -# List of library names for -l linker option (-l added when used). -# Includes the BSP. -ALT_LIBRARY_NAMES := - -# List of library names for -msys-lib linker option (-msys-lib added when used). -# These are libraries that might be located in the BSP and depend on the BSP -# library, or vice versa -ALT_BSP_DEP_LIBRARY_NAMES := - -# List of dependencies for the linker. This is usually the full pathname -# of each library (*.a) file. -# Includes the BSP. -ALT_LDDEPS := - -# List of root library directories that support running make to build them. -# Includes the BSP and any ALT libraries. -MAKEABLE_LIBRARY_ROOT_DIRS := - -# Generic flags passed to the compiler for different types of input files. -ALT_CFLAGS := -ALT_CXXFLAGS := -ALT_CPPFLAGS := -ALT_ASFLAGS := -ALT_LDFLAGS := - - -#------------------------------------------------------------------------------ -# The adjust-path macro -# -# If COMSPEC/ComSpec is defined, Make is launched from Windows through -# Cygwin. The adjust-path macro converts absolute windows paths into -# unix style paths (Example: c:/dir -> /c/dir). This will ensture -# paths are readable by GNU Make. -# -# If COMSPEC/ComSpec is not defined, Make is launched from linux, and no -# adjustment is necessary -# -#------------------------------------------------------------------------------ - -ifndef COMSPEC -ifdef ComSpec -COMSPEC = $(ComSpec) -endif # ComSpec -endif # COMSPEC - -ifdef COMSPEC # if Windows OS - -ifeq ($(MAKE_VERSION),3.81) -# -# adjust-path/adjust-path-mixed for Mingw Gnu Make on Windows -# -# Example Usage: -# $(call adjust-path,c:/aaa/bbb) => /c/aaa/bbb -# $(call adjust-path-mixed,/c/aaa/bbb) => c:/aaa/bbb -# $(call adjust-path-mixed,/cygdrive/c/aaa/bbb) => c:/aaa/bbb -# - -# -# adjust-path -# - converts back slash characters into forward slashes -# - if input arg ($1) is an empty string then return the empty string -# - if input arg ($1) does not contain the string ":/", then return input arg -# - using sed, convert mixed path [c:/...] into mingw path [/c/...] -define adjust-path -$(strip \ -$(if $1,\ -$(if $(findstring :/,$(subst \,/,$1)),\ -$(shell echo $(subst \,/,$1) | sed -e 's,^\([a-zA-Z]\):/,/\1/,'),\ -$(subst \,/,$1)))) -endef - -# -# adjust-path-mixed -# - converts back slash characters into forward slashes -# - if input arg ($1) is an empty string then return the empty string -# - if input arg ($1) does not begin with a forward slash '/' char, then -# return input arg -# - using sed, convert mingw path [/c/...] or cygwin path [/c/cygdrive/...] -# into a mixed path [c:/...] -define adjust-path-mixed -$(strip \ -$(if $1,\ -$(if $(findstring $(subst \,/,$1),$(patsubst /%,%,$(subst \,/,$1))),\ -$(subst \,/,$1),\ -$(shell echo $(subst \,/,$1) | sed -e 's,^/cygdrive/\([a-zA-Z]\)/,\1:/,' -e 's,^/\([a-zA-Z]\)/,\1:/,')))) -endef - -else # MAKE_VERSION != 3.81 (MAKE_VERSION == 3.80 or MAKE_VERSION == 3.79) -# -# adjust-path for Cygwin Gnu Make -# $(call adjust-path,c:/aaa/bbb) = /cygdrive/c/aaa/bbb -# $(call adjust-path-mixed,/cygdrive/c/aaa/bbb) = c:/aaa/bbb -# -adjust-path = $(if $1,$(shell cygpath -u "$1"),) -adjust-path-mixed = $(if $1,$(shell cygpath -m "$1"),) -endif - -else # !COMSPEC - -adjust-path = $1 -adjust-path-mixed = $1 - -endif # COMSPEC - - -#vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv -# GENERATED SETTINGS START v -#vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv - -#START GENERATED -ACTIVE_BUILD_CONFIG := default -BUILD_CONFIGS := default - -# The following TYPE comment allows tools to identify the 'type' of target this -# makefile is associated with. -# TYPE: APP_MAKEFILE - -# This following VERSION comment indicates the version of the tool used to -# generate this makefile. A makefile variable is provided for VERSION as well. -# ACDS_VERSION: 13.0sp1 -ACDS_VERSION := 13.0sp1 - -# This following BUILD_NUMBER comment indicates the build number of the tool -# used to generate this makefile. -# BUILD_NUMBER: 232 - -# Define path to the application ELF. -# It may be used by the makefile fragments so is defined before including them. -# -ELF := qsys_tutorial_switchs18.elf - -# Paths to C, C++, and assembly source files. -C_SRCS := hello_world_small.c -CXX_SRCS := -ASM_SRCS := - - -# Path to root of object file tree. -OBJ_ROOT_DIR := obj - -# Options to control objdump. -CREATE_OBJDUMP := 1 -OBJDUMP_INCLUDE_SOURCE := 1 -OBJDUMP_FULL_CONTENTS := 0 - -# Options to enable/disable optional files. -CREATE_ELF_DERIVED_FILES := 0 -CREATE_LINKER_MAP := 1 - -# Common arguments for ALT_CFLAGSs -APP_CFLAGS_DEFINED_SYMBOLS := -APP_CFLAGS_UNDEFINED_SYMBOLS := -APP_CFLAGS_OPTIMIZATION := -Os -APP_CFLAGS_DEBUG_LEVEL := -g -APP_CFLAGS_WARNINGS := -Wall -APP_CFLAGS_USER_FLAGS := - -APP_ASFLAGS_USER := -APP_LDFLAGS_USER := - -# Linker options that have default values assigned later if not -# assigned here. -LINKER_SCRIPT := -CRT0 := -SYS_LIB := - -# Define path to the root of the BSP. -BSP_ROOT_DIR := ../qsys_tutorial_switchs18_bsp/ - -# List of application specific include directories, library directories and library names -APP_INCLUDE_DIRS := -APP_LIBRARY_DIRS := -APP_LIBRARY_NAMES := - -# Pre- and post- processor settings. -BUILD_PRE_PROCESS := -BUILD_POST_PROCESS := - -QUARTUS_PROJECT_DIR := ../../ - - -#END GENERATED - -#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -# GENERATED SETTINGS END ^ -#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - -#------------------------------------------------------------------------------ -# DEFAULT TARGET -#------------------------------------------------------------------------------ - -# Define the variable used to echo output if not already defined. -ifeq ($(ECHO),) -ECHO := echo -endif - -# Put "all" rule before included makefile fragments because they may -# define rules and we don't want one of those to become the default rule. -.PHONY : all - -all: - @$(ECHO) [$(APP_NAME) build complete] - -all : build_pre_process libs app build_post_process - - -#------------------------------------------------------------------------------ -# VARIABLES DEPENDENT ON GENERATED CONTENT -#------------------------------------------------------------------------------ - -# Define object file directory per build configuration -CONFIG_OBJ_DIR := $(OBJ_ROOT_DIR)/$(ACTIVE_BUILD_CONFIG) - -ifeq ($(BSP_ROOT_DIR),) -$(error Edit Makefile and provide a value for BSP_ROOT_DIR) -endif - -ifeq ($(wildcard $(BSP_ROOT_DIR)),) -$(error BSP directory does not exist: $(BSP_ROOT_DIR)) -endif - -# Define absolute path to the root of the BSP. -ABS_BSP_ROOT_DIR := $(call adjust-path-mixed,$(shell cd "$(BSP_ROOT_DIR)"; pwd)) - -# Include makefile fragments. Define variable ALT_LIBRARY_ROOT_DIR before -# including each makefile fragment so that it knows the path to itself. -BSP_INCLUDE_FILE := $(BSP_ROOT_DIR)/public.mk -ALT_LIBRARY_ROOT_DIR := $(BSP_ROOT_DIR) -include $(BSP_INCLUDE_FILE) -# C2H will need this to touch the BSP public.mk and avoid the sopc file -# out-of-date error during a BSP make -ABS_BSP_INCLUDE_FILE := $(ABS_BSP_ROOT_DIR)/public.mk - - -ifneq ($(WARNING.SMALL_STACK_SIZE),) -# This WARNING is here to protect you from unknowingly using a very small stack -# If the warning is set, increase your stack size or enable the BSP small stack -# setting to eliminate the warning -$(warning WARNING: $(WARNING.SMALL_STACK_SIZE)) -endif - - -# If the BSP public.mk indicates that ALT_SIM_OPTIMIZE is set, rename the ELF -# by prefixing it with RUN_ON_HDL_SIMULATOR_ONLY_. -ifneq ($(filter -DALT_SIM_OPTIMIZE,$(ALT_CPPFLAGS)),) -ELF := RUN_ON_HDL_SIMULATOR_ONLY_$(ELF) -endif - -# If the BSP public.mk indicates that ALT_PROVIDE_GMON is set, add option to -# download_elf target -ifneq ($(filter -DALT_PROVIDE_GMON,$(ALT_CPPFLAGS)),) -GMON_OUT_FILENAME := gmon.out -WRITE_GMON_OPTION := --write-gmon $(GMON_OUT_FILENAME) -endif - -# Name of ELF application. -APP_NAME := $(basename $(ELF)) - -# Set to defaults if variables not already defined in settings. -ifeq ($(LINKER_SCRIPT),) -LINKER_SCRIPT := $(BSP_LINKER_SCRIPT) -endif -ifeq ($(CRT0),) -CRT0 := $(BSP_CRT0) -endif -ifeq ($(SYS_LIB),) -SYS_LIB := $(BSP_SYS_LIB) -endif - -OBJDUMP_NAME := $(APP_NAME).objdump -OBJDUMP_FLAGS := --disassemble --syms --all-header -ifeq ($(OBJDUMP_INCLUDE_SOURCE),1) -OBJDUMP_FLAGS += --source -endif -ifeq ($(OBJDUMP_FULL_CONTENTS),1) -OBJDUMP_FLAGS += --full-contents -endif - -# Create list of linker dependencies (*.a files). -APP_LDDEPS := $(ALT_LDDEPS) $(LDDEPS) - -# Take lists and add required prefixes. -APP_INC_DIRS := $(addprefix -I, $(ALT_INCLUDE_DIRS) $(APP_INCLUDE_DIRS) $(INC_DIRS)) -ASM_INC_PREFIX := -Wa,-I -APP_ASM_INC_DIRS := $(addprefix $(ASM_INC_PREFIX), $(ALT_INCLUDE_DIRS) $(APP_INCLUDE_DIRS) $(INC_DIRS)) -APP_LIB_DIRS := $(addprefix -L, $(ALT_LIBRARY_DIRS) $(APP_LIBRARY_DIRS) $(LIB_DIRS)) -APP_LIBS := $(addprefix -l, $(ALT_LIBRARY_NAMES) $(APP_LIBRARY_NAMES) $(LIBS)) - -ifneq ($(AVOID_NIOS2_GCC3_OPTIONS),) - -# -# Avoid Nios II GCC 3.X options. -# - -# Detect if small newlib C library is requested. -# If yes, remove the -msmallc option because it is -# now handled by other means. -ifneq ($(filter -msmallc,$(ALT_LDFLAGS)),) - ALT_LDFLAGS := $(filter-out -msmallc,$(ALT_LDFLAGS)) - ALT_C_LIBRARY := smallc -else - ALT_C_LIBRARY := c -endif - -# Put each BSP dependent library in a group to avoid circular dependencies. -APP_BSP_DEP_LIBS := $(foreach l,$(ALT_BSP_DEP_LIBRARY_NAMES),-Wl,--start-group -l$(ALT_C_LIBRARY) -lgcc -l$(l) -Wl,--end-group) - -else # !AVOID_NIOS2_GCC3_OPTIONS - -# -# Use Nios II GCC 3.X options. -# -APP_BSP_DEP_LIBS := $(addprefix -msys-lib=, $(ALT_BSP_DEP_LIBRARY_NAMES)) - -endif # !AVOID_NIOS2_GCC3_OPTIONS - -# Arguments for the C preprocessor, C/C++ compiler, assembler, and linker. -APP_CFLAGS := $(APP_CFLAGS_DEFINED_SYMBOLS) \ - $(APP_CFLAGS_UNDEFINED_SYMBOLS) \ - $(APP_CFLAGS_OPTIMIZATION) \ - $(APP_CFLAGS_DEBUG_LEVEL) \ - $(APP_CFLAGS_WARNINGS) \ - $(APP_CFLAGS_USER_FLAGS) \ - $(ALT_CFLAGS) \ - $(CFLAGS) - -# Arguments only for the C++ compiler. -APP_CXXFLAGS := $(ALT_CXXFLAGS) $(CXXFLAGS) - -# Arguments only for the C preprocessor. -# Prefix each include directory with -I. -APP_CPPFLAGS := $(APP_INC_DIRS) \ - $(ALT_CPPFLAGS) \ - $(CPPFLAGS) - -# Arguments only for the assembler. -APP_ASFLAGS := $(APP_ASM_INC_DIRS) \ - $(ALT_ASFLAGS) \ - $(APP_ASFLAGS_USER) \ - $(ASFLAGS) - -# Arguments only for the linker. -APP_LDFLAGS := $(APP_LDFLAGS_USER) - -ifneq ($(LINKER_SCRIPT),) -APP_LDFLAGS += -T'$(LINKER_SCRIPT)' -endif - -ifneq ($(AVOID_NIOS2_GCC3_OPTIONS),) - -# Avoid Nios II GCC 3.x options. -ifneq ($(CRT0),) -APP_LDFLAGS += $(CRT0) -endif - -# The equivalent of the -msys-lib option is provided -# by the GROUP() command in the linker script. -# Note this means the SYS_LIB variable is now ignored. - -else # !AVOID_NIOS2_GCC3_OPTIONS - -# Use Nios II GCC 3.x options. -ifneq ($(CRT0),) -APP_LDFLAGS += -msys-crt0='$(CRT0)' -endif -ifneq ($(SYS_LIB),) -APP_LDFLAGS += -msys-lib=$(SYS_LIB) -endif - -endif # !AVOID_NIOS2_GCC3_OPTIONS - -APP_LDFLAGS += \ - $(APP_LIB_DIRS) \ - $(ALT_LDFLAGS) \ - $(LDFLAGS) - -LINKER_MAP_NAME := $(APP_NAME).map -ifeq ($(CREATE_LINKER_MAP), 1) -APP_LDFLAGS += -Wl,-Map=$(LINKER_MAP_NAME) -endif - -# QUARTUS_PROJECT_DIR and SOPC_NAME need to be defined if you want the -# mem_init_install target of the mem_init.mk (located in the associated BSP) -# to know how to copy memory initialization files (e.g. .dat, .hex) into -# directories required for Quartus compilation or RTL simulation. - -# Defining QUARTUS_PROJECT_DIR causes mem_init_install to copy memory -# initialization files into your Quartus project directory. This is required -# to provide the initial memory contents of FPGA memories that can be -# initialized by the programming file (.sof) or Hardcopy ROMs. It is also used -# for VHDL simulation of on-chip memories. - -# Defining SOPC_NAME causes the mem_init_install target to copy memory -# initialization files into your RTL simulation directory. This is required -# to provide the initial memory contents of all memories that can be -# initialized by RTL simulation. This variable should be set to the same name -# as your SOPC Builder system name. For example, if you have a system called -# "foo.sopc", this variable should be set to "foo". - -# If SOPC_NAME is not set and QUARTUS_PROJECT_DIR is set, then derive SOPC_NAME. -ifeq ($(SOPC_NAME),) -ifneq ($(QUARTUS_PROJECT_DIR),) -SOPC_NAME := $(basename $(notdir $(wildcard $(QUARTUS_PROJECT_DIR)/*.sopcinfo))) -endif -endif - -# Defining JDI_FILE is required to specify the JTAG Debug Information File -# path. This file is generated by Quartus, and is needed along with the -# .sopcinfo file to resolve processor instance ID's from names in a multi-CPU -# systems. For multi-CPU systems, the processor instance ID is used to select -# from multiple CPU's during ELF download. - -# Both JDI_FILE and SOPCINFO_FILE are provided by the BSP if they found during -# BSP creation. If JDI_FILE is not set and QUARTUS_PROJECT_DIR is set, then -# derive JDI_FILE. We do not attempt to derive SOPCINFO_FILE since there may be -# multiple .sopcinfo files in a Quartus project. -ifeq ($(JDI_FILE),) -ifneq ($(QUARTUS_PROJECT_DIR),) -JDI_FILE := $(wildcard $(QUARTUS_PROJECT_DIR)/*.jdi) -endif -endif - -# Path to root runtime directory used for hdl simulation -RUNTIME_ROOT_DIR := $(CONFIG_OBJ_DIR)/runtime - - - -#------------------------------------------------------------------------------ -# MAKEFILE INCLUDES DEPENDENT ON GENERATED CONTENT -#------------------------------------------------------------------------------ -# mem_init.mk is a generated makefile fragment. This file defines all targets -# used to generate HDL initialization simulation files and pre-initialized -# onchip memory files. -MEM_INIT_FILE := $(BSP_ROOT_DIR)/mem_init.mk -include $(MEM_INIT_FILE) - -# Create list of object files to be built using the list of source files. -# The source file hierarchy is preserved in the object tree. -# The supported file extensions are: -# -# .c - for C files -# .cxx .cc .cpp - for C++ files -# .S .s - for assembler files -# -# Handle source files specified by --src-dir & --src-rdir differently, to -# save some processing time in calling the adjust-path macro. - -OBJ_LIST_C := $(patsubst %.c,%.o,$(filter %.c,$(C_SRCS))) -OBJ_LIST_CPP := $(patsubst %.cpp,%.o,$(filter %.cpp,$(CXX_SRCS))) -OBJ_LIST_CXX := $(patsubst %.cxx,%.o,$(filter %.cxx,$(CXX_SRCS))) -OBJ_LIST_CC := $(patsubst %.cc,%.o,$(filter %.cc,$(CXX_SRCS))) -OBJ_LIST_S := $(patsubst %.S,%.o,$(filter %.S,$(ASM_SRCS))) -OBJ_LIST_SS := $(patsubst %.s,%.o,$(filter %.s,$(ASM_SRCS))) - -OBJ_LIST := $(sort $(OBJ_LIST_C) $(OBJ_LIST_CPP) $(OBJ_LIST_CXX) \ - $(OBJ_LIST_CC) $(OBJ_LIST_S) $(OBJ_LIST_SS)) - -SDIR_OBJ_LIST_C := $(patsubst %.c,%.o,$(filter %.c,$(SDIR_C_SRCS))) -SDIR_OBJ_LIST_CPP := $(patsubst %.cpp,%.o,$(filter %.cpp,$(SDIR_CXX_SRCS))) -SDIR_OBJ_LIST_CXX := $(patsubst %.cxx,%.o,$(filter %.cxx,$(SDIR_CXX_SRCS))) -SDIR_OBJ_LIST_CC := $(patsubst %.cc,%.o,$(filter %.cc,$(SDIR_CXX_SRCS))) -SDIR_OBJ_LIST_S := $(patsubst %.S,%.o,$(filter %.S,$(SDIR_ASM_SRCS))) -SDIR_OBJ_LIST_SS := $(patsubst %.s,%.o,$(filter %.s,$(SDIR_ASM_SRCS))) - -SDIR_OBJ_LIST := $(sort $(SDIR_OBJ_LIST_C) $(SDIR_OBJ_LIST_CPP) \ - $(SDIR_OBJ_LIST_CXX) $(SDIR_OBJ_LIST_CC) $(SDIR_OBJ_LIST_S) \ - $(SDIR_OBJ_LIST_SS)) - -# Relative-pathed objects that being with "../" are handled differently. -# -# Regular objects are created as -# $(CONFIG_OBJ_DIR)//.o -# where the path structure is maintained under the obj directory. This -# applies for both absolute and relative paths; in the absolute path -# case this means the entire source path will be recreated under the obj -# directory. This is done to allow two source files with the same name -# to be included as part of the project. -# -# Note: On Cygwin, the path recreated under the obj directory will be -# the cygpath -u output path. -# -# Relative-path objects that begin with "../" cause problems under this -# scheme, as $(CONFIG_OBJ_DIR)/..// can potentially put the object -# files anywhere in the system, creating clutter and polluting the source tree. -# As such, their paths are flattened - the object file created will be -# $(CONFIG_OBJ_DIR)/.o. Due to this, two files specified with -# "../" in the beginning cannot have the same name in the project. VPATH -# will be set for these sources to allow make to relocate the source file -# via %.o rules. -# -# The following lines separate the object list into the flatten and regular -# lists, and then handles them as appropriate. - -FLATTEN_OBJ_LIST := $(filter ../%,$(OBJ_LIST)) -FLATTEN_APP_OBJS := $(addprefix $(CONFIG_OBJ_DIR)/,$(notdir $(FLATTEN_OBJ_LIST))) - -REGULAR_OBJ_LIST := $(filter-out $(FLATTEN_OBJ_LIST),$(OBJ_LIST)) -REGULAR_OBJ_LIST_C := $(filter $(OBJ_LIST_C),$(REGULAR_OBJ_LIST)) -REGULAR_OBJ_LIST_CPP := $(filter $(OBJ_LIST_CPP),$(REGULAR_OBJ_LIST)) -REGULAR_OBJ_LIST_CXX := $(filter $(OBJ_LIST_CXX),$(REGULAR_OBJ_LIST)) -REGULAR_OBJ_LIST_CC := $(filter $(OBJ_LIST_CC),$(REGULAR_OBJ_LIST)) -REGULAR_OBJ_LIST_S := $(filter $(OBJ_LIST_S),$(REGULAR_OBJ_LIST)) -REGULAR_OBJ_LIST_SS := $(filter $(OBJ_LIST_SS),$(REGULAR_OBJ_LIST)) - -FLATTEN_SDIR_OBJ_LIST := $(filter ../%,$(SDIR_OBJ_LIST)) -FLATTEN_SDIR_APP_OBJS := $(addprefix $(CONFIG_OBJ_DIR)/,$(notdir $(FLATTEN_SDIR_OBJ_LIST))) - -REGULAR_SDIR_OBJ_LIST := $(filter-out $(FLATTEN_SDIR_OBJ_LIST),$(SDIR_OBJ_LIST)) -REGULAR_SDIR_OBJ_LIST_C := $(filter $(SDIR_OBJ_LIST_C),$(REGULAR_SDIR_OBJ_LIST)) -REGULAR_SDIR_OBJ_LIST_CPP := $(filter $(SDIR_OBJ_LIST_CPP),$(REGULAR_SDIR_OBJ_LIST)) -REGULAR_SDIR_OBJ_LIST_CXX := $(filter $(SDIR_OBJ_LIST_CXX),$(REGULAR_SDIR_OBJ_LIST)) -REGULAR_SDIR_OBJ_LIST_CC := $(filter $(SDIR_OBJ_LIST_CC),$(REGULAR_SDIR_OBJ_LIST)) -REGULAR_SDIR_OBJ_LIST_S := $(filter $(SDIR_OBJ_LIST_S),$(REGULAR_SDIR_OBJ_LIST)) -REGULAR_SDIR_OBJ_LIST_SS := $(filter $(SDIR_OBJ_LIST_SS),$(REGULAR_SDIR_OBJ_LIST)) - -VPATH := $(sort $(dir $(FLATTEN_OBJ_LIST)) $(dir $(FLATTEN_SDIR_OBJ_LIST))) - -APP_OBJS_C := $(addprefix $(CONFIG_OBJ_DIR)/,\ - $(REGULAR_SDIR_OBJ_LIST_C) \ - $(foreach s,$(REGULAR_OBJ_LIST_C),$(call adjust-path,$s))) - -APP_OBJS_CPP := $(addprefix $(CONFIG_OBJ_DIR)/,\ - $(REGULAR_SDIR_OBJ_LIST_CPP) \ - $(foreach s,$(REGULAR_OBJ_LIST_CPP),$(call adjust-path,$s))) - -APP_OBJS_CXX := $(addprefix $(CONFIG_OBJ_DIR)/,\ - $(REGULAR_SDIR_OBJ_LIST_CXX) \ - $(foreach s,$(REGULAR_OBJ_LIST_CXX),$(call adjust-path,$s))) - -APP_OBJS_CC := $(addprefix $(CONFIG_OBJ_DIR)/,\ - $(REGULAR_SDIR_OBJ_LIST_CC) \ - $(foreach s,$(REGULAR_OBJ_LIST_CC),$(call adjust-path,$s))) - -APP_OBJS_S := $(addprefix $(CONFIG_OBJ_DIR)/,\ - $(REGULAR_SDIR_OBJ_LIST_S) \ - $(foreach s,$(REGULAR_OBJ_LIST_S),$(call adjust-path,$s))) - -APP_OBJS_SS := $(addprefix $(CONFIG_OBJ_DIR)/,\ - $(REGULAR_SDIR_OBJ_LIST_SS) \ - $(foreach s,$(REGULAR_OBJ_LIST_SS),$(call adjust-path,$s))) - -APP_OBJS := $(APP_OBJS_C) $(APP_OBJS_CPP) $(APP_OBJS_CXX) $(APP_OBJS_CC) \ - $(APP_OBJS_S) $(APP_OBJS_SS) \ - $(FLATTEN_APP_OBJS) $(FLATTEN_SDIR_APP_OBJS) - -# Add any extra user-provided object files. -APP_OBJS += $(OBJS) - -# Create list of dependancy files for each object file. -APP_DEPS := $(APP_OBJS:.o=.d) - -# Patch the Elf file with system specific information - -# Patch the Elf with the name of the sopc system -ifneq ($(SOPC_NAME),) -ELF_PATCH_FLAG += --sopc_system_name $(SOPC_NAME) -endif - -# Patch the Elf with the absolute path to the Quartus Project Directory -ifneq ($(QUARTUS_PROJECT_DIR),) -ABS_QUARTUS_PROJECT_DIR := $(call adjust-path-mixed,$(shell cd "$(QUARTUS_PROJECT_DIR)"; pwd)) -ELF_PATCH_FLAG += --quartus_project_dir "$(ABS_QUARTUS_PROJECT_DIR)" -endif - -# Patch the Elf and download args with the JDI_FILE if specified -ifneq ($(wildcard $(JDI_FILE)),) -ELF_PATCH_FLAG += --jdi $(JDI_FILE) -DOWNLOAD_JDI_FLAG := --jdi $(JDI_FILE) -endif - -# Patch the Elf with the SOPCINFO_FILE if specified -ifneq ($(wildcard $(SOPCINFO_FILE)),) -ELF_PATCH_FLAG += --sopcinfo $(SOPCINFO_FILE) -endif - -# Use the DOWNLOAD_CABLE variable to specify which JTAG cable to use. -# This is not needed if you only have one cable. -ifneq ($(DOWNLOAD_CABLE),) -DOWNLOAD_CABLE_FLAG := --cable '$(DOWNLOAD_CABLE)' -endif - - -#------------------------------------------------------------------------------ -# BUILD PRE/POST PROCESS -#------------------------------------------------------------------------------ -build_pre_process : - $(BUILD_PRE_PROCESS) - -build_post_process : - $(BUILD_POST_PROCESS) - -.PHONY: build_pre_process build_post_process - - -#------------------------------------------------------------------------------ -# TOOLS -#------------------------------------------------------------------------------ - -# -# Set tool default variables if not already defined. -# If these are defined, they would typically be defined in an -# included makefile fragment. -# -ifeq ($(DEFAULT_CROSS_COMPILE),) -DEFAULT_CROSS_COMPILE := nios2-elf- -endif - -ifeq ($(DEFAULT_STACK_REPORT),) -DEFAULT_STACKREPORT := nios2-stackreport -endif - -ifeq ($(DEFAULT_DOWNLOAD),) -DEFAULT_DOWNLOAD := nios2-download -endif - -ifeq ($(DEFAULT_FLASHPROG),) -DEFAULT_FLASHPROG := nios2-flash-programmer -endif - -ifeq ($(DEFAULT_ELFPATCH),) -DEFAULT_ELFPATCH := nios2-elf-insert -endif - -ifeq ($(DEFAULT_RM),) -DEFAULT_RM := rm -f -endif - -ifeq ($(DEFAULT_CP),) -DEFAULT_CP := cp -f -endif - -ifeq ($(DEFAULT_MKDIR),) -DEFAULT_MKDIR := mkdir -p -endif - -# -# Set tool variables to defaults if not already defined. -# If these are defined, they would typically be defined by a -# setting in the generated portion of this makefile. -# -ifeq ($(CROSS_COMPILE),) -CROSS_COMPILE := $(DEFAULT_CROSS_COMPILE) -endif - -ifeq ($(origin CC),default) -CC := $(CROSS_COMPILE)gcc -xc -endif - -ifeq ($(origin CXX),default) -CXX := $(CROSS_COMPILE)gcc -xc++ -endif - -ifeq ($(origin AS),default) -AS := $(CROSS_COMPILE)gcc -endif - -ifeq ($(origin AR),default) -AR := $(CROSS_COMPILE)ar -endif - -ifeq ($(origin LD),default) -LD := $(CROSS_COMPILE)g++ -endif - -ifeq ($(origin NM),default) -NM := $(CROSS_COMPILE)nm -endif - -ifeq ($(origin RM),default) -RM := $(DEFAULT_RM) -endif - -ifeq ($(origin CP),default) -CP := $(DEFAULT_CP) -endif - -ifeq ($(OBJDUMP),) -OBJDUMP := $(CROSS_COMPILE)objdump -endif - -ifeq ($(OBJCOPY),) -OBJCOPY := $(CROSS_COMPILE)objcopy -endif - -ifeq ($(STACKREPORT),) -ifeq ($(CROSS_COMPILE),nios2-elf-) -STACKREPORT := $(DEFAULT_STACKREPORT) -else -DISABLE_STACKREPORT := 1 -endif -endif - -ifeq ($(DOWNLOAD),) -DOWNLOAD := $(DEFAULT_DOWNLOAD) -endif - -ifeq ($(FLASHPROG),) -FLASHPROG := $(DEFAULT_FLASHPROG) -endif - -ifeq ($(ELFPATCH),) -ELFPATCH := $(DEFAULT_ELFPATCH) -endif - -ifeq ($(MKDIR),) -MKDIR := $(DEFAULT_MKDIR) -endif - -#------------------------------------------------------------------------------ -# PATTERN RULES TO BUILD OBJECTS -#------------------------------------------------------------------------------ - -define compile.c -@$(ECHO) Info: Compiling $< to $@ -@$(MKDIR) $(@D) -$(CC) -MP -MMD -c $(APP_CPPFLAGS) $(APP_CFLAGS) -o $@ $< -$(CC_POST_PROCESS) -endef - -define compile.cpp -@$(ECHO) Info: Compiling $< to $@ -@$(MKDIR) $(@D) -$(CXX) -MP -MMD -c $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< -$(CXX_POST_PROCESS) -endef - -# If assembling with the compiler, ensure "-Wa," is prepended to all APP_ASFLAGS -ifeq ($(AS),$(patsubst %as,%,$(AS))) -COMMA := , -APP_ASFLAGS := $(filter-out $(APP_CFLAGS),$(addprefix -Wa$(COMMA),$(patsubst -Wa$(COMMA)%,%,$(APP_ASFLAGS)))) -endif - -define compile.s -@$(ECHO) Info: Assembling $< to $@ -@$(MKDIR) $(@D) -$(AS) -MP -MMD -c $(APP_CPPFLAGS) $(APP_CFLAGS) $(APP_ASFLAGS) -o $@ $< -$(AS_POST_PROCESS) -endef - -ifeq ($(MAKE_VERSION),3.81) -.SECONDEXPANSION: - -$(APP_OBJS_C): $(CONFIG_OBJ_DIR)/%.o: $$(call adjust-path-mixed,%.c) - $(compile.c) - -$(APP_OBJS_CPP): $(CONFIG_OBJ_DIR)/%.o: $$(call adjust-path-mixed,%.cpp) - $(compile.cpp) - -$(APP_OBJS_CC): $(CONFIG_OBJ_DIR)/%.o: $$(call adjust-path-mixed,%.cc) - $(compile.cpp) - -$(APP_OBJS_CXX): $(CONFIG_OBJ_DIR)/%.o: $$(call adjust-path-mixed,%.cxx) - $(compile.cpp) - -$(APP_OBJS_S): $(CONFIG_OBJ_DIR)/%.o: $$(call adjust-path-mixed,%.S) - $(compile.s) - -$(APP_OBJS_SS): $(CONFIG_OBJ_DIR)/%.o: $$(call adjust-path-mixed,%.s) - $(compile.s) - -endif # MAKE_VERSION != 3.81 - -$(CONFIG_OBJ_DIR)/%.o: %.c - $(compile.c) - -$(CONFIG_OBJ_DIR)/%.o: %.cpp - $(compile.cpp) - -$(CONFIG_OBJ_DIR)/%.o: %.cc - $(compile.cpp) - -$(CONFIG_OBJ_DIR)/%.o: %.cxx - $(compile.cpp) - -$(CONFIG_OBJ_DIR)/%.o: %.S - $(compile.s) - -$(CONFIG_OBJ_DIR)/%.o: %.s - $(compile.s) - - -#------------------------------------------------------------------------------ -# PATTERN RULES TO INTERMEDIATE FILES -#------------------------------------------------------------------------------ - -$(CONFIG_OBJ_DIR)/%.s: %.c - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CC) -S $(APP_CPPFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.s: %.cpp - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CXX) -S $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.s: %.cc - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CXX) -S $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.s: %.cxx - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CXX) -S $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.i: %.c - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CC) -E $(APP_CPPFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.i: %.cpp - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CXX) -E $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.i: %.cc - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CXX) -E $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.i: %.cxx - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CXX) -E $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< - - -#------------------------------------------------------------------------------ -# TARGET RULES -#------------------------------------------------------------------------------ - -.PHONY : help -help : - @$(ECHO) "Summary of Makefile targets" - @$(ECHO) " Build targets:" - @$(ECHO) " all (default) - Application and all libraries (including BSP)" - @$(ECHO) " bsp - Just the BSP" - @$(ECHO) " libs - All libraries (including BSP)" - @$(ECHO) " flash - All flash files" - @$(ECHO) " mem_init_generate - All memory initialization files" -ifeq ($(QSYS),1) - @$(ECHO) " mem_init_install - This target is deprecated for QSys Systems" - @$(ECHO) " --> Use the mem_init_generate target and then" - @$(ECHO) " add the generated meminit.qip file to your" - @$(ECHO) " Quartus II Project." -else # if QSYS != 1 - @$(ECHO) " mem_init_install - Copy memory initialization files to Quartus II project" -endif # QSYS == 1 - @$(ECHO) - @$(ECHO) " Clean targets:" - @$(ECHO) " clean_all - Application and all libraries (including BSP)" - @$(ECHO) " clean - Just the application" - @$(ECHO) " clean_bsp - Just the BSP" - @$(ECHO) " clean_libs - All libraries (including BSP)" - @$(ECHO) - @$(ECHO) " Run targets:" - @$(ECHO) " download-elf - Download and run your elf executable" - @$(ECHO) " program-flash - Program flash contents to the board" - -# Handy rule to skip making libraries and just make application. -.PHONY : app -app : $(ELF) - -ifeq ($(CREATE_OBJDUMP), 1) -app : $(OBJDUMP_NAME) -endif - -ifeq ($(CREATE_ELF_DERIVED_FILES),1) -app : elf_derived_files -endif - -.PHONY: elf_derived_files -elf_derived_files: default_mem_init - -# Handy rule for making just the BSP. -.PHONY : bsp -bsp : - @$(ECHO) Info: Building $(BSP_ROOT_DIR) - @$(MAKE) --no-print-directory -C $(BSP_ROOT_DIR) - - -# Make sure all makeable libraries (including the BSP) are up-to-date. -LIB_TARGETS := $(patsubst %,%-recurs-make-lib,$(MAKEABLE_LIBRARY_ROOT_DIRS)) - -.PHONY : libs -libs : $(LIB_TARGETS) - -ifneq ($(strip $(LIB_TARGETS)),) -$(LIB_TARGETS): %-recurs-make-lib: - @$(ECHO) Info: Building $* - $(MAKE) --no-print-directory -C $* -endif - -ifneq ($(strip $(APP_LDDEPS)),) -$(APP_LDDEPS): libs - @true -endif - -# Rules to force your project to rebuild or relink -# .force_relink file will cause any application that depends on this project to relink -# .force_rebuild file will cause this project to rebuild object files -# .force_rebuild_all file will cause this project and any project that depends on this project to rebuild object files - -FORCE_RELINK_DEP := .force_relink -FORCE_REBUILD_DEP := .force_rebuild -FORCE_REBUILD_ALL_DEP := .force_rebuild_all -FORCE_REBUILD_DEP_LIST := $(CONFIG_OBJ_DIR)/$(FORCE_RELINK_DEP) $(CONFIG_OBJ_DIR)/$(FORCE_REBUILD_DEP) $(FORCE_REBUILD_ALL_DEP) - -$(FORCE_REBUILD_DEP_LIST): - -$(APP_OBJS): $(wildcard $(CONFIG_OBJ_DIR)/$(FORCE_REBUILD_DEP)) $(wildcard $(addsuffix /$(FORCE_REBUILD_ALL_DEP), . $(ALT_LIBRARY_DIRS))) - -$(ELF): $(wildcard $(addsuffix /$(FORCE_RELINK_DEP), $(CONFIG_OBJ_DIR) $(ALT_LIBRARY_DIRS))) - - -# Clean just the application. -.PHONY : clean -ifeq ($(CREATE_ELF_DERIVED_FILES),1) -clean : clean_elf_derived_files -endif - -clean : - @$(RM) -r $(ELF) $(OBJDUMP_NAME) $(LINKER_MAP_NAME) $(OBJ_ROOT_DIR) $(RUNTIME_ROOT_DIR) $(FORCE_REBUILD_DEP_LIST) - @$(ECHO) [$(APP_NAME) clean complete] - -# Clean just the BSP. -.PHONY : clean_bsp -clean_bsp : - @$(ECHO) Info: Cleaning $(BSP_ROOT_DIR) - @$(MAKE) --no-print-directory -C $(BSP_ROOT_DIR) clean - -# Clean all makeable libraries including the BSP. -LIB_CLEAN_TARGETS := $(patsubst %,%-recurs-make-clean-lib,$(MAKEABLE_LIBRARY_ROOT_DIRS)) - -.PHONY : clean_libs -clean_libs : $(LIB_CLEAN_TARGETS) - -ifneq ($(strip $(LIB_CLEAN_TARGETS)),) -$(LIB_CLEAN_TARGETS): %-recurs-make-clean-lib: - @$(ECHO) Info: Cleaning $* - $(MAKE) --no-print-directory -C $* clean -endif - -.PHONY: clean_elf_derived_files -clean_elf_derived_files: mem_init_clean - -# Clean application and all makeable libraries including the BSP. -.PHONY : clean_all -clean_all : clean mem_init_clean clean_libs - -# Include the dependency files unless the make goal is performing a clean -# of the application. -ifneq ($(firstword $(MAKECMDGOALS)),clean) -ifneq ($(firstword $(MAKECMDGOALS)),clean_all) --include $(APP_DEPS) -endif -endif - -.PHONY : download-elf -download-elf : $(ELF) - @if [ "$(DOWNLOAD)" = "none" ]; \ - then \ - $(ECHO) Downloading $(ELF) not supported; \ - else \ - $(ECHO) Info: Downloading $(ELF); \ - $(DOWNLOAD) --go --cpu_name=$(CPU_NAME) $(DOWNLOAD_CABLE_FLAG) $(SOPC_SYSID_FLAG) $(DOWNLOAD_JDI_FLAG) $(WRITE_GMON_OPTION) $(ELF); \ - fi - -# Delete the target of a rule if it has changed and its commands exit -# with a nonzero exit status. -.DELETE_ON_ERROR: - -# Rules for flash programming commands -PROGRAM_FLASH_SUFFIX := -program -PROGRAM_FLASH_TARGET := $(addsuffix $(PROGRAM_FLASH_SUFFIX), $(FLASH_FILES)) - -.PHONY : program-flash -program-flash : $(PROGRAM_FLASH_TARGET) - -.PHONY : $(PROGRAM_FLASH_TARGET) -$(PROGRAM_FLASH_TARGET) : flash - @if [ "$(FLASHPROG)" = "none" ]; \ - then \ - $(ECHO) Programming flash not supported; \ - else \ - $(ECHO) Info: Programming $(basename $@).flash; \ - if [ -z "$($(basename $@)_EPCS_FLAGS)" ]; \ - then \ - $(ECHO) $(FLASHPROG) $(SOPC_SYSID_FLAG) --base=$($(basename $@)_START) $(basename $@).flash; \ - $(FLASHPROG) $(DOWNLOAD_CABLE_FLAG) $(SOPC_SYSID_FLAG) --base=$($(basename $@)_START) $(basename $@).flash; \ - else \ - $(ECHO) $(FLASHPROG) $(SOPC_SYSID_FLAG) --epcs --base=$($(basename $@)_START) $(basename $@).flash; \ - $(FLASHPROG) $(DOWNLOAD_CABLE_FLAG) $(SOPC_SYSID_FLAG) --epcs --base=$($(basename $@)_START) $(basename $@).flash; \ - fi \ - fi - - -# Rules for simulating with an HDL Simulator [QSYS only] -ifeq ($(QSYS),1) -IP_MAKE_SIMSCRIPT := ip-make-simscript - -ifeq ($(VSIM),) -VSIM_EXE := "$(if $(VSIM_DIR),$(VSIM_DIR)/,)vsim" -ifeq ($(ENABLE_VSIM_GUI),1) -VSIM := $(VSIM_EXE) -gui -else -VSIM := $(VSIM_EXE) -c -endif # ENABLE_VSIM_GUI == 1 -endif # VSIM not set - -ifeq ($(SPD),) -ifneq ($(ABS_QUARTUS_PROJECT_DIR),) -ifneq ($(SOPC_NAME),) -SPD := $(ABS_QUARTUS_PROJECT_DIR)/$(SOPC_NAME)_tb.spd -endif # SOPC_NAME set -endif # ABS_QUARTUS_PROJECT_DIR set -endif # SPD == empty string - -ifeq ($(MSIM_SCRIPT),) -SIM_SCRIPT_DIR := $(RUNTIME_ROOT_DIR)/sim -MSIM_SCRIPT := $(SIM_SCRIPT_DIR)/mentor/msim_setup.tcl -endif # MSIM_SCRIPT == empty string - -ifeq ($(MAKE_VERSION),3.81) -ABS_MEM_INIT_DESCRIPTOR_FILE := $(abspath $(MEM_INIT_DESCRIPTOR_FILE)) -else -ABS_MEM_INIT_DESCRIPTOR_FILE := $(call adjust-path-mixed,$(shell pwd))/$(MEM_INIT_DESCRIPTOR_FILE) -endif - -$(MSIM_SCRIPT): $(SPD) $(MEM_INIT_DESCRIPTOR_FILE) -ifeq ($(SPD),) - $(error No SPD file specified. Ensure QUARTUS_PROJECT_DIR variable is set) -endif - @$(MKDIR) $(SIM_SCRIPT_DIR) - $(IP_MAKE_SIMSCRIPT) --spd=$(SPD) --spd=$(MEM_INIT_DESCRIPTOR_FILE) --output-directory=$(SIM_SCRIPT_DIR) - -VSIM_COMMAND = \ - cd $(dir $(MSIM_SCRIPT)) && \ - $(VSIM) -do "do $(notdir $(MSIM_SCRIPT)); ld; $(if $(VSIM_RUN_TIME),run ${VSIM_RUN_TIME};quit;)" - -.PHONY: sim -sim: $(MSIM_SCRIPT) mem_init_generate -ifeq ($(MSIM_SCRIPT),) - $(error MSIM_SCRIPT not set) -endif - $(VSIM_COMMAND) - -endif # QSYS == 1 - - -#------------------------------------------------------------------------------ -# ELF TARGET RULE -#------------------------------------------------------------------------------ -# Rule for constructing the executable elf file. -$(ELF) : $(APP_OBJS) $(LINKER_SCRIPT) $(APP_LDDEPS) - @$(ECHO) Info: Linking $@ - $(LD) $(APP_LDFLAGS) $(APP_CFLAGS) -o $@ $(filter-out $(CRT0),$(APP_OBJS)) $(APP_LIBS) $(APP_BSP_DEP_LIBS) -ifneq ($(DISABLE_ELFPATCH),1) - $(ELFPATCH) $@ $(ELF_PATCH_FLAG) -endif -ifneq ($(DISABLE_STACKREPORT),1) - @bash -c "$(STACKREPORT) $@" -endif - -$(OBJDUMP_NAME) : $(ELF) - @$(ECHO) Info: Creating $@ - $(OBJDUMP) $(OBJDUMP_FLAGS) $< >$@ - -# Rule for printing the name of the elf file -.PHONY: print-elf-name -print-elf-name: - @$(ECHO) $(ELF) - - diff --git a/software/qsys_tutorial_switchs18/create-this-app b/software/qsys_tutorial_switchs18/create-this-app deleted file mode 100644 index 62a85f1..0000000 --- a/software/qsys_tutorial_switchs18/create-this-app +++ /dev/null @@ -1,114 +0,0 @@ -#!/bin/bash -# -# This script creates the hello_world_small application in this directory. - - -BSP_DIR=../qsys_tutorial_switchs18_bsp -QUARTUS_PROJECT_DIR=../../ -NIOS2_APP_GEN_ARGS="--elf-name qsys_tutorial_switchs18.elf --set APP_CFLAGS_OPTIMIZATION -Os --set OBJDUMP_INCLUDE_SOURCE 1 --src-files hello_world_small.c" - - -# First, check to see if $SOPC_KIT_NIOS2 environmental variable is set. -# This variable is required for the command line tools to execute correctly. -if [ -z "${SOPC_KIT_NIOS2}" ] -then - echo Required \$SOPC_KIT_NIOS2 Environmental Variable is not set! - exit 1 -fi - - -# Also make sure that the APP has not been created already. Check for -# existence of Makefile in the app directory -if [ -f ./Makefile ] -then - echo Application has already been created! Delete Makefile if you want to create a new application makefile - exit 1 -fi - - -# We are selecting hal_reduced_footprint bsp because it supports this application. -# Check to see if the hal_reduced_footprint has already been generated by checking for -# existence of the public.mk file. If not, we need to run -# create-this-bsp file to generate the bsp. -if [ ! -f ${BSP_DIR}/public.mk ]; then - # Since BSP doesn't exist, create the BSP - # Pass any command line arguments passed to this script to the BSP. - pushd ${BSP_DIR} >> /dev/null - ./create-this-bsp "$@" || { - echo "create-this-bsp failed" - exit 1 - } - popd >> /dev/null -fi - - -# Don't run make if create-this-app script is called with --no-make arg -SKIP_MAKE= -while [ $# -gt 0 ] -do - case "$1" in - --no-make) - SKIP_MAKE=1 - ;; - esac - shift -done - - -# Now we also need to go copy the sources for this application to the -# local directory. -find "${SOPC_KIT_NIOS2}/examples/software/hello_world_small/" -name '*.c' -or -name '*.h' -or -name 'hostfs*' | xargs -i cp -L {} ./ || { - echo "failed during copying example source files" - exit 1 -} - -find "${SOPC_KIT_NIOS2}/examples/software/hello_world_small/" -name 'readme.txt' -or -name 'Readme.txt' | xargs -i cp -L {} ./ || { - echo "failed copying readme file" -} - -if [ -d "${SOPC_KIT_NIOS2}/examples/software/hello_world_small/system" ] -then - cp -RL "${SOPC_KIT_NIOS2}/examples/software/hello_world_small/system" . || { - echo "failed during copying project support files" - exit 1 - } -fi - -chmod -R +w . || { - echo "failed during changing file permissions" - exit 1 -} - -cmd="nios2-app-generate-makefile --bsp-dir ${BSP_DIR} --set QUARTUS_PROJECT_DIR=${QUARTUS_PROJECT_DIR} ${NIOS2_APP_GEN_ARGS}" - -echo "create-this-app: Running \"${cmd}\"" -$cmd || { - echo "nios2-app-generate-makefile failed" - exit 1 -} - -if [ -z "$SKIP_MAKE" ]; then - cmd="make" - - echo "create-this-app: Running \"$cmd\"" - $cmd || { - echo "make failed" - exit 1 - } - - echo - echo "To download and run the application:" - echo " 1. Make sure the board is connected to the system." - echo " 2. Run 'nios2-configure-sof ' to configure the FPGA with the hardware design." - echo " 3. If you have a stdio device, run 'nios2-terminal' in a different shell." - echo " 4. Run 'make download-elf' from the application directory." - echo - echo "To debug the application:" - echo " Import the project into Nios II Software Build Tools for Eclipse." - echo " Refer to Nios II Software Build Tools for Eclipse Documentation for more information." - echo - echo -e "" -fi - - -exit 0 diff --git a/software/qsys_tutorial_switchs18/hello_world_small.c b/software/qsys_tutorial_switchs18/hello_world_small.c deleted file mode 100644 index f4f688e..0000000 --- a/software/qsys_tutorial_switchs18/hello_world_small.c +++ /dev/null @@ -1,118 +0,0 @@ -/* - * "Small Hello World" example. - * - * This example prints 'Hello from Nios II' to the STDOUT stream. It runs on - * the Nios II 'standard', 'full_featured', 'fast', and 'low_cost' example - * designs. It requires a STDOUT device in your system's hardware. - * - * The purpose of this example is to demonstrate the smallest possible Hello - * World application, using the Nios II HAL library. The memory footprint - * of this hosted application is ~332 bytes by default using the standard - * reference design. For a more fully featured Hello World application - * example, see the example titled "Hello World". - * - * The memory footprint of this example has been reduced by making the - * following changes to the normal "Hello World" example. - * Check in the Nios II Software Developers Manual for a more complete - * description. - * - * In the SW Application project (small_hello_world): - * - * - In the C/C++ Build page - * - * - Set the Optimization Level to -Os - * - * In System Library project (small_hello_world_syslib): - * - In the C/C++ Build page - * - * - Set the Optimization Level to -Os - * - * - Define the preprocessor option ALT_NO_INSTRUCTION_EMULATION - * This removes software exception handling, which means that you cannot - * run code compiled for Nios II cpu with a hardware multiplier on a core - * without a the multiply unit. Check the Nios II Software Developers - * Manual for more details. - * - * - In the System Library page: - * - Set Periodic system timer and Timestamp timer to none - * This prevents the automatic inclusion of the timer driver. - * - * - Set Max file descriptors to 4 - * This reduces the size of the file handle pool. - * - * - Check Main function does not exit - * - Uncheck Clean exit (flush buffers) - * This removes the unneeded call to exit when main returns, since it - * won't. - * - * - Check Don't use C++ - * This builds without the C++ support code. - * - * - Check Small C library - * This uses a reduced functionality C library, which lacks - * support for buffering, file IO, floating point and getch(), etc. - * Check the Nios II Software Developers Manual for a complete list. - * - * - Check Reduced device drivers - * This uses reduced functionality drivers if they're available. For the - * standard design this means you get polled UART and JTAG UART drivers, - * no support for the LCD driver and you lose the ability to program - * CFI compliant flash devices. - * - * - Check Access device drivers directly - * This bypasses the device file system to access device drivers directly. - * This eliminates the space required for the device file system services. - * It also provides a HAL version of libc services that access the drivers - * directly, further reducing space. Only a limited number of libc - * functions are available in this configuration. - * - * - Use ALT versions of stdio routines: - * - * Function Description - * =============== ===================================== - * alt_printf Only supports %s, %x, and %c ( < 1 Kbyte) - * alt_putstr Smaller overhead than puts with direct drivers - * Note this function doesn't add a newline. - * alt_putchar Smaller overhead than putchar with direct drivers - * alt_getchar Smaller overhead than getchar with direct drivers - * - */ - -#include "sys/alt_stdio.h" - -#define switches (volatile int *) 0x0002010 -#define ledrs (volatile int *) 0x0002020 -#define push_switches (volatile int *) 0x0002000 - -typedef struct { - unsigned int other : 10; - unsigned int code : 8; -} switches_t; - -typedef union { - int data; - switches_t sw; -} sw_t; - -void main() -{ - while(1) { - //*ledrs = *push_switches; - sw_t s; - s.data = *switches; - *ledrs = s.sw.code; - //alt_putchar(s.sw.code); - } -#if 0 - unsigned long i = 0; - volatile int j = 0; - while(1){ - *ledrs = i++; - if (i > (unsigned long)1<<18) i = 0; - for (j = 0; j < 100; j++); - } - - //while (1) - //*leds = *switches; -#endif -} diff --git a/software/qsys_tutorial_switchs18/obj/default/hello_world_small.d b/software/qsys_tutorial_switchs18/obj/default/hello_world_small.d deleted file mode 100644 index b401e35..0000000 --- a/software/qsys_tutorial_switchs18/obj/default/hello_world_small.d +++ /dev/null @@ -1,4 +0,0 @@ -obj/default/hello_world_small.o: hello_world_small.c \ - ../qsys_tutorial_switchs18_bsp//HAL/inc/sys/alt_stdio.h - -../qsys_tutorial_switchs18_bsp//HAL/inc/sys/alt_stdio.h: diff --git a/software/qsys_tutorial_switchs18/obj/default/hello_world_small.o b/software/qsys_tutorial_switchs18/obj/default/hello_world_small.o deleted file mode 100644 index f87277c..0000000 --- a/software/qsys_tutorial_switchs18/obj/default/hello_world_small.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18/qsys_tutorial_switchs18.elf b/software/qsys_tutorial_switchs18/qsys_tutorial_switchs18.elf deleted file mode 100644 index 78e348a..0000000 --- a/software/qsys_tutorial_switchs18/qsys_tutorial_switchs18.elf +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18/qsys_tutorial_switchs18.map b/software/qsys_tutorial_switchs18/qsys_tutorial_switchs18.map deleted file mode 100644 index c801669..0000000 --- a/software/qsys_tutorial_switchs18/qsys_tutorial_switchs18.map +++ /dev/null @@ -1,411 +0,0 @@ -Archive member included because of file (symbol) - -../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_load.o) - ../qsys_tutorial_switchs18_bsp//obj/HAL/src/crt0.o (alt_load) -../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_main.o) - ../qsys_tutorial_switchs18_bsp//obj/HAL/src/crt0.o (alt_main) -../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_sys_init.o) - ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_main.o) (alt_sys_init) -../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_load.o) (alt_dcache_flush_all) -../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_load.o) (alt_icache_flush_all) -../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_sys_init.o) (altera_nios2_qsys_irq_init) - -Memory Configuration - -Name Origin Length Attributes -reset 0x00000000 0x00000020 -onchip_memory 0x00000020 0x00000fe0 -*default* 0x00000000 0xffffffff - -Linker script and memory map - -LOAD ../qsys_tutorial_switchs18_bsp//obj/HAL/src/crt0.o - 0x0000000c exit = _exit -LOAD obj/default/hello_world_small.o -LOAD c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libstdc++.a -LOAD c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libm.a -LOAD c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a -START GROUP -LOAD c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a -LOAD c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a -LOAD ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a -END GROUP -LOAD c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a - 0x00000000 __alt_mem_onchip_memory = 0x0 - -.entry 0x00000000 0x20 - *(.entry) - .entry 0x00000000 0x20 ../qsys_tutorial_switchs18_bsp//obj/HAL/src/crt0.o - 0x00000000 __reset - 0x0000000c _exit - -.exceptions 0x00000020 0x0 - 0x00000020 PROVIDE (__ram_exceptions_start, ABSOLUTE (.)) - 0x00000020 . = ALIGN (0x20) - *(.irq) - *(.exceptions.entry.label) - *(.exceptions.entry.user) - *(.exceptions.entry) - *(.exceptions.irqtest.user) - *(.exceptions.irqtest) - *(.exceptions.irqhandler.user) - *(.exceptions.irqhandler) - *(.exceptions.irqreturn.user) - *(.exceptions.irqreturn) - *(.exceptions.notirq.label) - *(.exceptions.notirq.user) - *(.exceptions.notirq) - *(.exceptions.soft.user) - *(.exceptions.soft) - *(.exceptions.unknown.user) - *(.exceptions.unknown) - *(.exceptions.exit.label) - *(.exceptions.exit.user) - *(.exceptions.exit) - *(.exceptions) - 0x00000020 PROVIDE (__ram_exceptions_end, ABSOLUTE (.)) - 0x00000020 PROVIDE (__flash_exceptions_start, LOADADDR (.exceptions)) - -.text 0x00000020 0x144 - 0x00000020 PROVIDE (stext, ABSOLUTE (.)) - *(.interp) - *(.hash) - *(.dynsym) - *(.dynstr) - *(.gnu.version) - *(.gnu.version_d) - *(.gnu.version_r) - *(.rel.init) - *(.rela.init) - *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) - *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) - *(.rel.fini) - *(.rela.fini) - *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) - *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) - *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) - *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) - *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) - *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) - *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) - *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) - *(.rel.ctors) - *(.rela.ctors) - *(.rel.dtors) - *(.rela.dtors) - *(.rel.got) - *(.rela.got) - *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) - *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) - *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) - *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) - *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) - *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) - *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) - *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) - *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) - *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) - *(.rel.plt) - *(.rela.plt) - *(.rel.dyn) - *(.init) - *(.plt) - *(.text .stub .text.* .gnu.linkonce.t.*) - .text 0x00000020 0x3c ../qsys_tutorial_switchs18_bsp//obj/HAL/src/crt0.o - 0x00000020 _start - .text 0x0000005c 0x1c obj/default/hello_world_small.o - 0x0000005c main - .text 0x00000078 0x8c ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_load.o) - 0x00000098 alt_load - .text 0x00000104 0x2c ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_main.o) - 0x00000104 alt_main - .text 0x00000130 0x24 ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_sys_init.o) - 0x00000130 alt_sys_init - 0x00000134 alt_irq_init - .text 0x00000154 0x4 ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - 0x00000154 alt_dcache_flush_all - .text 0x00000158 0x4 ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - 0x00000158 alt_icache_flush_all - .text 0x0000015c 0x8 ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - 0x0000015c altera_nios2_qsys_irq_init - *(.gnu.warning.*) - *(.fini) - 0x00000164 PROVIDE (__etext, ABSOLUTE (.)) - 0x00000164 PROVIDE (_etext, ABSOLUTE (.)) - 0x00000164 PROVIDE (etext, ABSOLUTE (.)) - *(.eh_frame_hdr) - 0x00000164 . = ALIGN (0x4) - 0x00000164 PROVIDE (__preinit_array_start, ABSOLUTE (.)) - *(.preinit_array) - 0x00000164 PROVIDE (__preinit_array_end, ABSOLUTE (.)) - 0x00000164 PROVIDE (__init_array_start, ABSOLUTE (.)) - *(.init_array) - 0x00000164 PROVIDE (__init_array_end, ABSOLUTE (.)) - 0x00000164 PROVIDE (__fini_array_start, ABSOLUTE (.)) - *(.fini_array) - 0x00000164 PROVIDE (__fini_array_end, ABSOLUTE (.)) - *(.eh_frame) - *(.gcc_except_table) - *(.dynamic) - 0x00000164 PROVIDE (__CTOR_LIST__, ABSOLUTE (.)) - *(.ctors) - *(SORT(.ctors.*)) - 0x00000164 PROVIDE (__CTOR_END__, ABSOLUTE (.)) - 0x00000164 PROVIDE (__DTOR_LIST__, ABSOLUTE (.)) - *(.dtors) - *(SORT(.dtors.*)) - 0x00000164 PROVIDE (__DTOR_END__, ABSOLUTE (.)) - *(.jcr) - 0x00000164 . = ALIGN (0x4) - -.rodata 0x00000164 0x0 - 0x00000164 PROVIDE (__ram_rodata_start, ABSOLUTE (.)) - 0x00000164 . = ALIGN (0x4) - *(.rodata .rodata.* .gnu.linkonce.r.*) - *(.rodata1) - 0x00000164 . = ALIGN (0x4) - 0x00000164 PROVIDE (__ram_rodata_end, ABSOLUTE (.)) - 0x00000164 PROVIDE (__flash_rodata_start, LOADADDR (.rodata)) - -.rwdata 0x00000164 0x4 load address 0x00000168 - 0x00000164 PROVIDE (__ram_rwdata_start, ABSOLUTE (.)) - 0x00000164 . = ALIGN (0x4) - *(.got.plt) - *(.got) - *(.data1) - *(.data .data.* .gnu.linkonce.d.*) - .data 0x00000164 0x0 ../qsys_tutorial_switchs18_bsp//obj/HAL/src/crt0.o - .data 0x00000164 0x0 obj/default/hello_world_small.o - .data 0x00000164 0x0 ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_load.o) - .data 0x00000164 0x0 ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_main.o) - .data 0x00000164 0x0 ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_sys_init.o) - .data 0x00000164 0x0 ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .data 0x00000164 0x0 ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .data 0x00000164 0x0 ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - 0x00008164 _gp = ABSOLUTE ((. + 0x8000)) - 0x00008164 PROVIDE (gp, _gp) - *(.rwdata .rwdata.*) - *(.sdata .sdata.* .gnu.linkonce.s.*) - .sdata 0x00000164 0x4 ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_sys_init.o) - 0x00000164 jtag_uart - *(.sdata2 .sdata2.* .gnu.linkonce.s2.*) - 0x00000168 . = ALIGN (0x4) - 0x00000168 _edata = ABSOLUTE (.) - 0x00000168 PROVIDE (edata, ABSOLUTE (.)) - 0x00000168 PROVIDE (__ram_rwdata_end, ABSOLUTE (.)) - 0x00000168 PROVIDE (__flash_rwdata_start, LOADADDR (.rwdata)) - -.bss 0x0000016c 0xc - 0x0000016c __bss_start = ABSOLUTE (.) - 0x0000016c PROVIDE (__sbss_start, ABSOLUTE (.)) - 0x0000016c PROVIDE (___sbss_start, ABSOLUTE (.)) - *(.dynsbss) - *(.sbss .sbss.* .gnu.linkonce.sb.*) - .sbss 0x0000016c 0xc ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_main.o) - 0x0000016c alt_argc - 0x00000170 alt_argv - 0x00000174 alt_envp - *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) - *(.scommon) - 0x00000178 PROVIDE (__sbss_end, ABSOLUTE (.)) - 0x00000178 PROVIDE (___sbss_end, ABSOLUTE (.)) - *(.dynbss) - *(.bss .bss.* .gnu.linkonce.b.*) - .bss 0x00000178 0x0 ../qsys_tutorial_switchs18_bsp//obj/HAL/src/crt0.o - .bss 0x00000178 0x0 obj/default/hello_world_small.o - .bss 0x00000178 0x0 ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_load.o) - .bss 0x00000178 0x0 ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_main.o) - .bss 0x00000178 0x0 ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_sys_init.o) - .bss 0x00000178 0x0 ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .bss 0x00000178 0x0 ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .bss 0x00000178 0x0 ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - *(COMMON) - 0x00000178 . = ALIGN (0x4) - 0x00000178 __bss_end = ABSOLUTE (.) - -.onchip_memory 0x00000178 0x0 - 0x00000178 PROVIDE (_alt_partition_onchip_memory_start, ABSOLUTE (.)) - *(.onchip_memory. onchip_memory.*) - 0x00000178 . = ALIGN (0x4) - 0x00000178 PROVIDE (_alt_partition_onchip_memory_end, ABSOLUTE (.)) - 0x00000178 _end = ABSOLUTE (.) - 0x00000178 end = ABSOLUTE (.) - 0x00000178 __alt_stack_base = ABSOLUTE (.) - 0x00000178 PROVIDE (_alt_partition_onchip_memory_load_addr, LOADADDR (.onchip_memory)) - -.stab - *(.stab) - -.stabstr - *(.stabstr) - -.stab.excl - *(.stab.excl) - -.stab.exclstr - *(.stab.exclstr) - -.stab.index - *(.stab.index) - -.stab.indexstr - *(.stab.indexstr) - -.comment 0x00000000 0x26 - *(.comment) - .comment 0x00000000 0x26 obj/default/hello_world_small.o - 0x27 (size before relaxing) - .comment 0x00000000 0x27 ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_load.o) - .comment 0x00000000 0x27 ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_main.o) - .comment 0x00000000 0x27 ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_sys_init.o) - .comment 0x00000000 0x27 ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .comment 0x00000000 0x27 ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .comment 0x00000000 0x27 ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - -.debug - *(.debug) - -.line - *(.line) - -.debug_srcinfo - *(.debug_srcinfo) - -.debug_sfnames - *(.debug_sfnames) - -.debug_aranges 0x00000000 0x108 - *(.debug_aranges) - .debug_aranges - 0x00000000 0x28 ../qsys_tutorial_switchs18_bsp//obj/HAL/src/crt0.o - .debug_aranges - 0x00000028 0x20 obj/default/hello_world_small.o - .debug_aranges - 0x00000048 0x20 ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_load.o) - .debug_aranges - 0x00000068 0x20 ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_main.o) - .debug_aranges - 0x00000088 0x20 ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_sys_init.o) - .debug_aranges - 0x000000a8 0x20 ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .debug_aranges - 0x000000c8 0x20 ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .debug_aranges - 0x000000e8 0x20 ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - -.debug_pubnames - 0x00000000 0x149 - *(.debug_pubnames) - .debug_pubnames - 0x00000000 0x1b obj/default/hello_world_small.o - .debug_pubnames - 0x0000001b 0x1f ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_load.o) - .debug_pubnames - 0x0000003a 0x46 ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_main.o) - .debug_pubnames - 0x00000080 0x42 ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_sys_init.o) - .debug_pubnames - 0x000000c2 0x2b ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .debug_pubnames - 0x000000ed 0x2b ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .debug_pubnames - 0x00000118 0x31 ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - -.debug_info 0x00000000 0x6b7 - *(.debug_info .gnu.linkonce.wi.*) - .debug_info 0x00000000 0x87 ../qsys_tutorial_switchs18_bsp//obj/HAL/src/crt0.o - .debug_info 0x00000087 0xb9 obj/default/hello_world_small.o - .debug_info 0x00000140 0x12e ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_load.o) - .debug_info 0x0000026e 0x125 ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_main.o) - .debug_info 0x00000393 0x17d ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_sys_init.o) - .debug_info 0x00000510 0x8d ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .debug_info 0x0000059d 0x8d ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .debug_info 0x0000062a 0x8d ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - -.debug_abbrev 0x00000000 0x398 - *(.debug_abbrev) - .debug_abbrev 0x00000000 0x12 ../qsys_tutorial_switchs18_bsp//obj/HAL/src/crt0.o - .debug_abbrev 0x00000012 0xa9 obj/default/hello_world_small.o - .debug_abbrev 0x000000bb 0x97 ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_load.o) - .debug_abbrev 0x00000152 0xa6 ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_main.o) - .debug_abbrev 0x000001f8 0xe3 ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_sys_init.o) - .debug_abbrev 0x000002db 0x3f ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .debug_abbrev 0x0000031a 0x3f ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .debug_abbrev 0x00000359 0x3f ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - -.debug_line 0x00000000 0xdd4 - *(.debug_line) - .debug_line 0x00000000 0x66 ../qsys_tutorial_switchs18_bsp//obj/HAL/src/crt0.o - .debug_line 0x00000066 0xd7 obj/default/hello_world_small.o - .debug_line 0x0000013d 0x217 ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_load.o) - .debug_line 0x00000354 0x2c2 ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_main.o) - .debug_line 0x00000616 0x286 ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_sys_init.o) - .debug_line 0x0000089c 0x1b5 ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .debug_line 0x00000a51 0x1b5 ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .debug_line 0x00000c06 0x1ce ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - -.debug_frame 0x00000000 0x118 - *(.debug_frame) - .debug_frame 0x00000000 0x20 obj/default/hello_world_small.o - .debug_frame 0x00000020 0x38 ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_load.o) - .debug_frame 0x00000058 0x28 ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_main.o) - .debug_frame 0x00000080 0x38 ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_sys_init.o) - .debug_frame 0x000000b8 0x20 ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .debug_frame 0x000000d8 0x20 ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .debug_frame 0x000000f8 0x20 ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - -.debug_str 0x00000000 0x3f0 - *(.debug_str) - .debug_str 0x00000000 0x92 obj/default/hello_world_small.o - 0xa4 (size before relaxing) - .debug_str 0x00000092 0x197 ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_load.o) - 0x1dc (size before relaxing) - .debug_str 0x00000229 0x75 ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_main.o) - 0x160 (size before relaxing) - .debug_str 0x0000029e 0xaf ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_sys_init.o) - 0x1d3 (size before relaxing) - .debug_str 0x0000034d 0x34 ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - 0x11f (size before relaxing) - .debug_str 0x00000381 0x34 ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - 0x11f (size before relaxing) - .debug_str 0x000003b5 0x3b ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - 0x126 (size before relaxing) - -.debug_loc 0x00000000 0x70 - *(.debug_loc) - .debug_loc 0x00000000 0x1f ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_load.o) - .debug_loc 0x0000001f 0x1f ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_main.o) - .debug_loc 0x0000003e 0x32 ../qsys_tutorial_switchs18_bsp/\libhal_bsp.a(alt_sys_init.o) - -.debug_macinfo - *(.debug_macinfo) - -.debug_weaknames - *(.debug_weaknames) - -.debug_funcnames - *(.debug_funcnames) - -.debug_typenames - *(.debug_typenames) - -.debug_varnames - *(.debug_varnames) - -.debug_alt_sim_info - 0x00000000 0x10 - *(.debug_alt_sim_info) - .debug_alt_sim_info - 0x00000000 0x10 ../qsys_tutorial_switchs18_bsp//obj/HAL/src/crt0.o - 0x00001000 __alt_data_end = 0x1000 - 0x00001000 PROVIDE (__alt_stack_pointer, __alt_data_end) - 0x00000178 PROVIDE (__alt_stack_limit, __alt_stack_base) - 0x00000178 PROVIDE (__alt_heap_start, end) - 0x00001000 PROVIDE (__alt_heap_limit, 0x1000) -OUTPUT(qsys_tutorial_switchs18.elf elf32-littlenios2) - -.debug_ranges 0x00000000 0x20 - .debug_ranges 0x00000000 0x20 ../qsys_tutorial_switchs18_bsp//obj/HAL/src/crt0.o diff --git a/software/qsys_tutorial_switchs18/qsys_tutorial_switchs18.objdump b/software/qsys_tutorial_switchs18/qsys_tutorial_switchs18.objdump deleted file mode 100644 index 6239361..0000000 --- a/software/qsys_tutorial_switchs18/qsys_tutorial_switchs18.objdump +++ /dev/null @@ -1,460 +0,0 @@ - -qsys_tutorial_switchs18.elf: file format elf32-littlenios2 -qsys_tutorial_switchs18.elf -architecture: nios2, flags 0x00000112: -EXEC_P, HAS_SYMS, D_PAGED -start address 0x00000020 - -Program Header: - LOAD off 0x00001000 vaddr 0x00000000 paddr 0x00000000 align 2**12 - filesz 0x00000020 memsz 0x00000020 flags r-x - LOAD off 0x00001020 vaddr 0x00000020 paddr 0x00000020 align 2**12 - filesz 0x00000144 memsz 0x00000144 flags r-x - LOAD off 0x00001164 vaddr 0x00000164 paddr 0x00000168 align 2**12 - filesz 0x00000004 memsz 0x00000004 flags rw- - LOAD off 0x0000116c vaddr 0x0000016c paddr 0x0000016c align 2**12 - filesz 0x00000000 memsz 0x0000000c flags rw- - -Sections: -Idx Name Size VMA LMA File off Algn - 0 .entry 00000020 00000000 00000000 00001000 2**5 - CONTENTS, ALLOC, LOAD, READONLY, CODE - 1 .text 00000144 00000020 00000020 00001020 2**2 - CONTENTS, ALLOC, LOAD, READONLY, CODE - 2 .rwdata 00000004 00000164 00000168 00001164 2**2 - CONTENTS, ALLOC, LOAD, DATA, SMALL_DATA - 3 .bss 0000000c 0000016c 0000016c 0000116c 2**2 - ALLOC, SMALL_DATA - 4 .comment 00000026 00000000 00000000 00001168 2**0 - CONTENTS, READONLY - 5 .debug_aranges 00000108 00000000 00000000 00001190 2**3 - CONTENTS, READONLY, DEBUGGING - 6 .debug_pubnames 00000149 00000000 00000000 00001298 2**0 - CONTENTS, READONLY, DEBUGGING - 7 .debug_info 000006b7 00000000 00000000 000013e1 2**0 - CONTENTS, READONLY, DEBUGGING - 8 .debug_abbrev 00000398 00000000 00000000 00001a98 2**0 - CONTENTS, READONLY, DEBUGGING - 9 .debug_line 00000dd4 00000000 00000000 00001e30 2**0 - CONTENTS, READONLY, DEBUGGING - 10 .debug_frame 00000118 00000000 00000000 00002c04 2**2 - CONTENTS, READONLY, DEBUGGING - 11 .debug_str 000003f0 00000000 00000000 00002d1c 2**0 - CONTENTS, READONLY, DEBUGGING - 12 .debug_loc 00000070 00000000 00000000 0000310c 2**0 - CONTENTS, READONLY, DEBUGGING - 13 .debug_alt_sim_info 00000010 00000000 00000000 0000317c 2**2 - CONTENTS, READONLY, DEBUGGING - 14 .debug_ranges 00000020 00000000 00000000 00003190 2**3 - CONTENTS, READONLY, DEBUGGING - 15 .thread_model 00000003 00000000 00000000 00003dc7 2**0 - CONTENTS, READONLY - 16 .cpu 0000000f 00000000 00000000 00003dca 2**0 - CONTENTS, READONLY - 17 .qsys 00000001 00000000 00000000 00003dd9 2**0 - CONTENTS, READONLY - 18 .simulation_enabled 00000001 00000000 00000000 00003dda 2**0 - CONTENTS, READONLY - 19 .stderr_dev 00000009 00000000 00000000 00003ddb 2**0 - CONTENTS, READONLY - 20 .stdin_dev 00000009 00000000 00000000 00003de4 2**0 - CONTENTS, READONLY - 21 .stdout_dev 00000009 00000000 00000000 00003ded 2**0 - CONTENTS, READONLY - 22 .sopc_system_name 0000000b 00000000 00000000 00003df6 2**0 - CONTENTS, READONLY - 23 .quartus_project_dir 00000030 00000000 00000000 00003e01 2**0 - CONTENTS, READONLY - 24 .sopcinfo 00037346 00000000 00000000 00003e31 2**0 - CONTENTS, READONLY -SYMBOL TABLE: -00000000 l d .entry 00000000 .entry -00000020 l d .text 00000000 .text -00000164 l d .rwdata 00000000 .rwdata -0000016c l d .bss 00000000 .bss -00000000 l d .comment 00000000 .comment -00000000 l d .debug_aranges 00000000 .debug_aranges -00000000 l d .debug_pubnames 00000000 .debug_pubnames -00000000 l d .debug_info 00000000 .debug_info -00000000 l d .debug_abbrev 00000000 .debug_abbrev -00000000 l d .debug_line 00000000 .debug_line -00000000 l d .debug_frame 00000000 .debug_frame -00000000 l d .debug_str 00000000 .debug_str -00000000 l d .debug_loc 00000000 .debug_loc -00000000 l d .debug_alt_sim_info 00000000 .debug_alt_sim_info -00000000 l d .debug_ranges 00000000 .debug_ranges -00000058 l .text 00000000 alt_after_alt_main -00000000 l df *ABS* 00000000 hello_world_small.c -00000000 l df *ABS* 00000000 alt_load.c -00000078 l F .text 00000020 alt_load_section -00000000 l df *ABS* 00000000 alt_main.c -00000000 l df *ABS* 00000000 alt_sys_init.c -00000000 l df *ABS* 00000000 alt_dcache_flush_all.c -00000000 l df *ABS* 00000000 alt_icache_flush_all.c -00000000 l df *ABS* 00000000 altera_nios2_qsys_irq.c -00000104 g F .text 0000002c alt_main -00000168 g *ABS* 00000000 __flash_rwdata_start -00000164 g O .rwdata 00000004 jtag_uart -00000000 g F .entry 0000000c __reset -00000020 g *ABS* 00000000 __flash_exceptions_start -00000170 g O .bss 00000004 alt_argv -00008164 g *ABS* 00000000 _gp -00000178 g *ABS* 00000000 __bss_end -00000154 g F .text 00000004 alt_dcache_flush_all -00000168 g *ABS* 00000000 __ram_rwdata_end -00000000 g *ABS* 00000000 __alt_mem_onchip_memory -00000164 g *ABS* 00000000 __ram_rodata_end -00000178 g *ABS* 00000000 end -00001000 g *ABS* 00000000 __alt_stack_pointer -00000020 g F .text 0000003c _start -00000130 g F .text 00000004 alt_sys_init -00000164 g *ABS* 00000000 __ram_rwdata_start -00000164 g *ABS* 00000000 __ram_rodata_start -00000178 g *ABS* 00000000 __alt_stack_base -0000016c g *ABS* 00000000 __bss_start -0000005c g F .text 0000001c main -00000174 g O .bss 00000004 alt_envp -00000164 g *ABS* 00000000 __flash_rodata_start -00000134 g F .text 00000020 alt_irq_init -0000016c g O .bss 00000004 alt_argc -00000020 g *ABS* 00000000 __ram_exceptions_start -00000168 g *ABS* 00000000 _edata -00000178 g *ABS* 00000000 _end -00000020 g *ABS* 00000000 __ram_exceptions_end -0000015c g F .text 00000008 altera_nios2_qsys_irq_init -0000000c g .entry 00000000 exit -00001000 g *ABS* 00000000 __alt_data_end -0000000c g .entry 00000000 _exit -00000158 g F .text 00000004 alt_icache_flush_all -00000098 g F .text 0000006c alt_load - - - -Disassembly of section .entry: - -00000000 <__reset>: - * Jump to the _start entry point in the .text section if reset code - * is allowed or if optimizing for RTL simulation. - */ -#if defined(ALT_ALLOW_CODE_AT_RESET) || defined(ALT_SIM_OPTIMIZE) - /* Jump to the _start entry point in the .text section. */ - movhi r1, %hi(_start) - 0: 00400034 movhi at,0 - ori r1, r1, %lo(_start) - 4: 08400814 ori at,at,32 - jmp r1 - 8: 0800683a jmp at - -0000000c <_exit>: - ... - -Disassembly of section .text: - -00000020 <_start>: -#if (NIOS2_NUM_OF_SHADOW_REG_SETS == 0) - /* - * Now that the caches are initialized, set up the stack pointer. - * The value provided by the linker is assumed to be correctly aligned. - */ - movhi sp, %hi(__alt_stack_pointer) - 20: 06c00034 movhi sp,0 - ori sp, sp, %lo(__alt_stack_pointer) - 24: dec40014 ori sp,sp,4096 - - /* Set up the global pointer. */ - movhi gp, %hi(_gp) - 28: 06800034 movhi gp,0 - ori gp, gp, %lo(_gp) - 2c: d6a05914 ori gp,gp,33124 - */ -#ifndef ALT_SIM_OPTIMIZE - /* Log that the BSS is about to be cleared. */ - ALT_LOG_PUTS(alt_log_msg_bss) - - movhi r2, %hi(__bss_start) - 30: 00800034 movhi r2,0 - ori r2, r2, %lo(__bss_start) - 34: 10805b14 ori r2,r2,364 - - movhi r3, %hi(__bss_end) - 38: 00c00034 movhi r3,0 - ori r3, r3, %lo(__bss_end) - 3c: 18c05e14 ori r3,r3,376 - - beq r2, r3, 1f - 40: 10c00326 beq r2,r3,50 <_start+0x30> - -0: - stw zero, (r2) - 44: 10000015 stw zero,0(r2) - addi r2, r2, 4 - 48: 10800104 addi r2,r2,4 - bltu r2, r3, 0b - 4c: 10fffd36 bltu r2,r3,44 <_start+0x24> - * section aren't defined until alt_load() has been called). - */ - mov et, zero -#endif - - call alt_load - 50: 00000980 call 98 - - /* Log that alt_main is about to be called. */ - ALT_LOG_PUTS(alt_log_msg_alt_main) - - /* Call the C entry point. It should never return. */ - call alt_main - 54: 00001040 call 104 - -00000058 : - - /* Wait in infinite loop in case alt_main does return. */ -alt_after_alt_main: - br alt_after_alt_main - 58: 003fff06 br 58 - -0000005c
: - int data; - switches_t sw; -} sw_t; - -void main() -{ - 5c: 01080004 movi r4,8192 - 60: 00c80404 movi r3,8208 - while(1) { - sw_t s; - s.data = *switches; - 64: 20800017 ldw r2,0(r4) - *ledrs = s.sw.code; - 68: 1004d2ba srli r2,r2,10 - 6c: 10803fcc andi r2,r2,255 - 70: 18800015 stw r2,0(r3) - 74: 003ffb06 br 64 - -00000078 : - -static void ALT_INLINE alt_load_section (alt_u32* from, - alt_u32* to, - alt_u32* end) -{ - if (to != from) - 78: 2900051e bne r5,r4,90 - 7c: f800283a ret - { - while( to != end ) - { - *to++ = *from++; - 80: 20800017 ldw r2,0(r4) - 84: 21000104 addi r4,r4,4 - 88: 28800015 stw r2,0(r5) - 8c: 29400104 addi r5,r5,4 - alt_u32* to, - alt_u32* end) -{ - if (to != from) - { - while( to != end ) - 90: 29bffb1e bne r5,r6,80 - 94: f800283a ret - -00000098 : - * there is no bootloader, so this application is responsible for loading to - * RAM any sections that are required. - */ - -void alt_load (void) -{ - 98: deffff04 addi sp,sp,-4 - /* - * Copy the .rwdata section. - */ - - alt_load_section (&__flash_rwdata_start, - 9c: 01000034 movhi r4,0 - a0: 21005a04 addi r4,r4,360 - a4: 01400034 movhi r5,0 - a8: 29405904 addi r5,r5,356 - ac: 01800034 movhi r6,0 - b0: 31805a04 addi r6,r6,360 - * there is no bootloader, so this application is responsible for loading to - * RAM any sections that are required. - */ - -void alt_load (void) -{ - b4: dfc00015 stw ra,0(sp) - /* - * Copy the .rwdata section. - */ - - alt_load_section (&__flash_rwdata_start, - b8: 00000780 call 78 - - /* - * Copy the exception handler. - */ - - alt_load_section (&__flash_exceptions_start, - bc: 01000034 movhi r4,0 - c0: 21000804 addi r4,r4,32 - c4: 01400034 movhi r5,0 - c8: 29400804 addi r5,r5,32 - cc: 01800034 movhi r6,0 - d0: 31800804 addi r6,r6,32 - d4: 00000780 call 78 - - /* - * Copy the .rodata section. - */ - - alt_load_section (&__flash_rodata_start, - d8: 01000034 movhi r4,0 - dc: 21005904 addi r4,r4,356 - e0: 01400034 movhi r5,0 - e4: 29405904 addi r5,r5,356 - e8: 01800034 movhi r6,0 - ec: 31805904 addi r6,r6,356 - f0: 00000780 call 78 - - /* - * Now ensure that the caches are in synch. - */ - - alt_dcache_flush_all(); - f4: 00001540 call 154 - alt_icache_flush_all(); -} - f8: dfc00017 ldw ra,0(sp) - fc: dec00104 addi sp,sp,4 - /* - * Now ensure that the caches are in synch. - */ - - alt_dcache_flush_all(); - alt_icache_flush_all(); - 100: 00001581 jmpi 158 - -00000104 : - * devices/filesystems/components in the system; and call the entry point for - * the users application, i.e. main(). - */ - -void alt_main (void) -{ - 104: deffff04 addi sp,sp,-4 -#endif - - /* ALT LOG - please see HAL/sys/alt_log_printf.h for details */ - ALT_LOG_PRINT_BOOT("[alt_main.c] Entering alt_main, calling alt_irq_init.\r\n"); - /* Initialize the interrupt controller. */ - alt_irq_init (NULL); - 108: 0009883a mov r4,zero - * devices/filesystems/components in the system; and call the entry point for - * the users application, i.e. main(). - */ - -void alt_main (void) -{ - 10c: dfc00015 stw ra,0(sp) -#endif - - /* ALT LOG - please see HAL/sys/alt_log_printf.h for details */ - ALT_LOG_PRINT_BOOT("[alt_main.c] Entering alt_main, calling alt_irq_init.\r\n"); - /* Initialize the interrupt controller. */ - alt_irq_init (NULL); - 110: 00001340 call 134 - ALT_LOG_PRINT_BOOT("[alt_main.c] Done OS Init, calling alt_sem_create.\r\n"); - ALT_SEM_CREATE (&alt_fd_list_lock, 1); - - /* Initialize the device drivers/software components. */ - ALT_LOG_PRINT_BOOT("[alt_main.c] Calling alt_sys_init.\r\n"); - alt_sys_init(); - 114: 00001300 call 130 - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Calling main.\r\n"); - -#ifdef ALT_NO_EXIT - main (alt_argc, alt_argv, alt_envp); - 118: d1200217 ldw r4,-32760(gp) - 11c: d1600317 ldw r5,-32756(gp) - 120: d1a00417 ldw r6,-32752(gp) - close(STDOUT_FILENO); - exit (result); -#endif - - ALT_LOG_PRINT_BOOT("[alt_main.c] After main - we should not be here?.\r\n"); -} - 124: dfc00017 ldw ra,0(sp) - 128: dec00104 addi sp,sp,4 - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Calling main.\r\n"); - -#ifdef ALT_NO_EXIT - main (alt_argc, alt_argv, alt_envp); - 12c: 000005c1 jmpi 5c
- -00000130 : - */ - -void alt_sys_init( void ) -{ - ALTERA_AVALON_JTAG_UART_INIT ( JTAG_UART, jtag_uart); -} - 130: f800283a ret - -00000134 : - * The "base" parameter is ignored and only - * present for backwards-compatibility. - */ - -void alt_irq_init ( const void* base ) -{ - 134: deffff04 addi sp,sp,-4 - 138: dfc00015 stw ra,0(sp) - ALTERA_NIOS2_QSYS_IRQ_INIT ( NIOS2_PROCESSOR, nios2_processor); - 13c: 000015c0 call 15c - * alt_irq_cpu_enable_interrupts() enables the CPU to start taking interrupts. - */ -static ALT_INLINE void ALT_ALWAYS_INLINE - alt_irq_cpu_enable_interrupts () -{ - NIOS2_WRITE_STATUS(NIOS2_STATUS_PIE_MSK - 140: 00800044 movi r2,1 - 144: 1001703a wrctl status,r2 - alt_irq_cpu_enable_interrupts(); -} - 148: dfc00017 ldw ra,0(sp) - 14c: dec00104 addi sp,sp,4 - 150: f800283a ret - -00000154 : - for (i = (char*) 0; i < (char*) NIOS2_DCACHE_SIZE; i+= NIOS2_DCACHE_LINE_SIZE) - { - __asm__ volatile ("flushd (%0)" :: "r" (i)); - } -#endif /* NIOS2_DCACHE_SIZE > 0 */ -} - 154: f800283a ret - -00000158 : -void alt_icache_flush_all (void) -{ -#if NIOS2_ICACHE_SIZE > 0 - alt_icache_flush (0, NIOS2_ICACHE_SIZE); -#endif -} - 158: f800283a ret - -0000015c : - * To initialize the internal interrupt controller, just clear the IENABLE - * register so that all possible IRQs are disabled. - */ -void altera_nios2_qsys_irq_init(void) -{ - NIOS2_WRITE_IENABLE(0); - 15c: 000170fa wrctl ienable,zero -} - 160: f800283a ret diff --git a/software/qsys_tutorial_switchs18/readme.txt b/software/qsys_tutorial_switchs18/readme.txt deleted file mode 100644 index 3dc3186..0000000 --- a/software/qsys_tutorial_switchs18/readme.txt +++ /dev/null @@ -1,67 +0,0 @@ -Readme - Hello World Software Example - -DESCRIPTION: -Simple program that prints "Hello from Nios II" - -The purpose of this example is to demonstrate the smallest possible Hello -World application, using the Nios II HAL BSP. The memory footprint -of this hosted application is intended to be less than 1 kbytes by default using a standard -reference design. For a more fully featured Hello World application -example, see the example titled "Hello World". - -The memory footprint of this example has been reduced by making the -following changes to the normal "Hello World" example. -Check in the Nios II Software Developers Handbook for a more complete -description. - -In the SW Application project: - - In the C/C++ Build page - - Set the Optimization Level to -Os - -In BSP project: - - In the C/C++ Build page - - - Set the Optimization Level to -Os - - - Define the preprocessor option ALT_NO_INSTRUCTION_EMULATION - This removes software exception handling, which means that you cannot - run code compiled for Nios II cpu with a hardware multiplier on a core - without a the multiply unit. Check the Nios II Software Developers - Manual for more details. - - - In the BSP: - - Set Periodic system timer and Timestamp timer to none - This prevents the automatic inclusion of the timer driver. - - - Set Max file descriptors to 4 - This reduces the size of the file handle pool. - - - Uncheck Clean exit (flush buffers) - This removes the call to exit, and when main is exitted instead of - calling exit the software will just spin in a loop. - - - Check Small C library - This uses a reduced functionality C library, which lacks - support for buffering, file IO, floating point and getch(), etc. - Check the Nios II Software Developers Manual for a complete list. - - - Check Reduced device drivers - This uses reduced functionality drivers if they're available. For the - standard design this means you get polled UART and JTAG UART drivers, - no support for the LCD driver and you lose the ability to program - CFI compliant flash devices. - - -PERIPHERALS USED: -This example exercises the following peripherals: -- STDOUT device (UART or JTAG UART) - -SOFTWARE SOURCE FILES: -This example includes the following software source files: -- small_hello_world.c: - -BOARD/HOST REQUIREMENTS: -This example requires only a JTAG connection with a Nios Development board. If -the host communication settings are changed from JTAG UART (default) to use a -conventional UART, a serial cable between board DB-9 connector and the host is -required. diff --git a/software/qsys_tutorial_switchs18/system/template.xml b/software/qsys_tutorial_switchs18/system/template.xml deleted file mode 100644 index b09e912..0000000 --- a/software/qsys_tutorial_switchs18/system/template.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git a/software/qsys_tutorial_switchs18_bsp/.cproject b/software/qsys_tutorial_switchs18_bsp/.cproject deleted file mode 100644 index 48de46a..0000000 --- a/software/qsys_tutorial_switchs18_bsp/.cproject +++ /dev/null @@ -1,481 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/software/qsys_tutorial_switchs18_bsp/.project b/software/qsys_tutorial_switchs18_bsp/.project deleted file mode 100644 index 0b226b8..0000000 --- a/software/qsys_tutorial_switchs18_bsp/.project +++ /dev/null @@ -1,85 +0,0 @@ - - - qsys_tutorial_switchs18_bsp - - - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - ?name? - - - - org.eclipse.cdt.make.core.append_environment - true - - - org.eclipse.cdt.make.core.autoBuildTarget - all - - - org.eclipse.cdt.make.core.buildArguments - - - - org.eclipse.cdt.make.core.buildCommand - make - - - org.eclipse.cdt.make.core.buildLocation - ${workspace_loc://qsys_tutorial_switchs18_bsp} - - - org.eclipse.cdt.make.core.cleanBuildTarget - clean - - - org.eclipse.cdt.make.core.contents - org.eclipse.cdt.make.core.activeConfigSettings - - - org.eclipse.cdt.make.core.enableAutoBuild - false - - - org.eclipse.cdt.make.core.enableCleanBuild - true - - - org.eclipse.cdt.make.core.enableFullBuild - true - - - org.eclipse.cdt.make.core.fullBuildTarget - all - - - org.eclipse.cdt.make.core.stopOnError - true - - - org.eclipse.cdt.make.core.useDefaultBuildCmd - true - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - org.eclipse.cdt.core.ccnature - com.altera.sbtgui.project.SBTGUINature - com.altera.sbtgui.project.SBTGUIBspNature - - diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/inc/alt_types.h b/software/qsys_tutorial_switchs18_bsp/HAL/inc/alt_types.h deleted file mode 100644 index d02f171..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/inc/alt_types.h +++ /dev/null @@ -1,54 +0,0 @@ -#ifndef __ALT_TYPES_H__ -#define __ALT_TYPES_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/* - * Don't declare these typedefs if this file is included by assembly source. - */ -#ifndef ALT_ASM_SRC -typedef signed char alt_8; -typedef unsigned char alt_u8; -typedef signed short alt_16; -typedef unsigned short alt_u16; -typedef signed long alt_32; -typedef unsigned long alt_u32; -typedef long long alt_64; -typedef unsigned long long alt_u64; -#endif - -#define ALT_INLINE __inline__ -#define ALT_ALWAYS_INLINE __attribute__ ((always_inline)) -#define ALT_WEAK __attribute__((weak)) - -#endif /* __ALT_TYPES_H__ */ diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/inc/altera_nios2_qsys_irq.h b/software/qsys_tutorial_switchs18_bsp/HAL/inc/altera_nios2_qsys_irq.h deleted file mode 100644 index 6629ec9..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/inc/altera_nios2_qsys_irq.h +++ /dev/null @@ -1,80 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * Support for the Nios II internal interrupt controller. - */ - -#ifndef __ALT_NIOS2_QSYS_IRQ_H__ -#define __ALT_NIOS2_QSYS_IRQ_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The macro ALTERA_NIOS2_IRQ_INSTANCE is used by the alt_irq_init() - * function in the auto-generated file alt_sys_init.c to create an - * instance of this interrupt controller device driver state if this - * module contains an interrupt controller. - * Only one instance of a Nios II is allowed so this macro is just empty. - */ - -#define ALTERA_NIOS2_QSYS_IRQ_INSTANCE(name, state) - -/* - * altera_nios2_irq_init() is called by the auto-generated function - * alt_irq_init() once for the Nios II if it contains an interrupt controller. - * The altera_nios2_irq_init() routine is called using the - * ALTERA_NIOS2_IRQ_INIT macro given below. - * - * This function initializes the internal interrupt controller - * so is not called if the Nios II contains an external interrupt - * controller port (because the internal interrupt controller - * is removed if this port is present). - */ - -extern void altera_nios2_qsys_irq_init( void ); - -/* - * The macro ALTERA_NIOS2_IRQ_INIT is used by the alt_irq_init() routine - * in the auto-generated file alt_sys_init.c to initialize an instance - * of the interrupt controller device driver state. - */ - -#define ALTERA_NIOS2_QSYS_IRQ_INIT(name, state) altera_nios2_qsys_irq_init() - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_NIOS2_QSYS_IRQ_H__ */ - diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/inc/io.h b/software/qsys_tutorial_switchs18_bsp/HAL/inc/io.h deleted file mode 100644 index 362f103..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/inc/io.h +++ /dev/null @@ -1,81 +0,0 @@ -#ifndef __IO_H__ -#define __IO_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/* IO Header file for Nios II Toolchain */ - -#include "alt_types.h" -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#ifndef SYSTEM_BUS_WIDTH -#error SYSTEM_BUS_WIDTH undefined -#endif - -/* Dynamic bus access functions */ - -#define __IO_CALC_ADDRESS_DYNAMIC(BASE, OFFSET) \ - ((void *)(((alt_u8*)BASE) + (OFFSET))) - -#define IORD_32DIRECT(BASE, OFFSET) \ - __builtin_ldwio (__IO_CALC_ADDRESS_DYNAMIC ((BASE), (OFFSET))) -#define IORD_16DIRECT(BASE, OFFSET) \ - __builtin_ldhuio (__IO_CALC_ADDRESS_DYNAMIC ((BASE), (OFFSET))) -#define IORD_8DIRECT(BASE, OFFSET) \ - __builtin_ldbuio (__IO_CALC_ADDRESS_DYNAMIC ((BASE), (OFFSET))) - -#define IOWR_32DIRECT(BASE, OFFSET, DATA) \ - __builtin_stwio (__IO_CALC_ADDRESS_DYNAMIC ((BASE), (OFFSET)), (DATA)) -#define IOWR_16DIRECT(BASE, OFFSET, DATA) \ - __builtin_sthio (__IO_CALC_ADDRESS_DYNAMIC ((BASE), (OFFSET)), (DATA)) -#define IOWR_8DIRECT(BASE, OFFSET, DATA) \ - __builtin_stbio (__IO_CALC_ADDRESS_DYNAMIC ((BASE), (OFFSET)), (DATA)) - -/* Native bus access functions */ - -#define __IO_CALC_ADDRESS_NATIVE(BASE, REGNUM) \ - ((void *)(((alt_u8*)BASE) + ((REGNUM) * (SYSTEM_BUS_WIDTH/8)))) - -#define IORD(BASE, REGNUM) \ - __builtin_ldwio (__IO_CALC_ADDRESS_NATIVE ((BASE), (REGNUM))) -#define IOWR(BASE, REGNUM, DATA) \ - __builtin_stwio (__IO_CALC_ADDRESS_NATIVE ((BASE), (REGNUM)), (DATA)) - -#ifdef __cplusplus -} -#endif - -#endif /* __IO_H__ */ diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/inc/nios2.h b/software/qsys_tutorial_switchs18_bsp/HAL/inc/nios2.h deleted file mode 100644 index 72cefba..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/inc/nios2.h +++ /dev/null @@ -1,230 +0,0 @@ -#ifndef __NIOS2_H__ -#define __NIOS2_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2008 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * This header provides processor specific macros for accessing the Nios2 - * control registers. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * Macros for accessing selected processor registers - */ - -#define NIOS2_READ_ET(et) \ - do { __asm ("mov %0, et" : "=r" (et) ); } while (0) - -#define NIOS2_WRITE_ET(et) \ - do { __asm volatile ("mov et, %z0" : : "rM" (et)); } while (0) - -#define NIOS2_READ_SP(sp) \ - do { __asm ("mov %0, sp" : "=r" (sp) ); } while (0) - -/* - * Macros for useful processor instructions - */ - -#define NIOS2_BREAK() \ - do { __asm volatile ("break"); } while (0) - -#define NIOS2_REPORT_STACK_OVERFLOW() \ - do { __asm volatile("break 3"); } while (0) - -/* - * Macros for accessing the control registers. - */ - -#define NIOS2_READ_STATUS(dest) \ - do { dest = __builtin_rdctl(0); } while (0) - -#define NIOS2_WRITE_STATUS(src) \ - do { __builtin_wrctl(0, src); } while (0) - -#define NIOS2_READ_ESTATUS(dest) \ - do { dest = __builtin_rdctl(1); } while (0) - -#define NIOS2_READ_BSTATUS(dest) \ - do { dest = __builtin_rdctl(2); } while (0) - -#define NIOS2_READ_IENABLE(dest) \ - do { dest = __builtin_rdctl(3); } while (0) - -#define NIOS2_WRITE_IENABLE(src) \ - do { __builtin_wrctl(3, src); } while (0) - -#define NIOS2_READ_IPENDING(dest) \ - do { dest = __builtin_rdctl(4); } while (0) - -#define NIOS2_READ_CPUID(dest) \ - do { dest = __builtin_rdctl(5); } while (0) - - -/* - * Macros for accessing extra exception registers. These - * are always enabled wit the MPU or MMU, and optionally - * with other advanced exception types/ - */ -#define NIOS2_READ_EXCEPTION(dest) \ - do { dest = __builtin_rdctl(7); } while (0) - -#define NIOS2_READ_BADADDR(dest) \ - do { dest = __builtin_rdctl(12); } while (0) - - -/* - * Macros for accessing control registers for MPU - * operation. These should not be used unless the - * MPU is enabled. - * - * The config register may be augmented for future - * enhancements. For now, only MPU support is provided. - */ -/* Config register */ -#define NIOS2_WRITE_CONFIG(src) \ - do { __builtin_wrctl(13, src); } while (0) - -#define NIOS2_READ_CONFIG(dest) \ - do { dest = __builtin_rdctl(13); } while (0) - -/* MPU Base Address Register */ -#define NIOS2_WRITE_MPUBASE(src) \ - do { __builtin_wrctl(14, src); } while (0) - -#define NIOS2_READ_MPUBASE(dest) \ - do { dest = __builtin_rdctl(14); } while (0) - -/* MPU Access Register */ -#define NIOS2_WRITE_MPUACC(src) \ - do { __builtin_wrctl(15, src); } while (0) - -#define NIOS2_READ_MPUACC(dest) \ - do { dest = __builtin_rdctl(15); } while (0) - - -/* - * Nios II control registers that are always present - */ -#define NIOS2_STATUS status -#define NIOS2_ESTATUS estatus -#define NIOS2_BSTATUS bstatus -#define NIOS2_IENABLE ienable -#define NIOS2_IPENDING ipending -#define NIOS2_CPUID cpuid - -/* - * STATUS, BSTATUS, ESTATUS, and SSTATUS fields. - * The presence of fields is a function of the Nios II configuration. - */ -#define NIOS2_STATUS_PIE_MSK (0x00000001) -#define NIOS2_STATUS_PIE_OFST (0) -#define NIOS2_STATUS_U_MSK (0x00000002) -#define NIOS2_STATUS_U_OFST (1) -#define NIOS2_STATUS_EH_MSK (0x00000004) -#define NIOS2_STATUS_EH_OFST (2) -#define NIOS2_STATUS_IH_MSK (0x00000008) -#define NIOS2_STATUS_IH_OFST (3) -#define NIOS2_STATUS_IL_MSK (0x000003f0) -#define NIOS2_STATUS_IL_OFST (4) -#define NIOS2_STATUS_CRS_MSK (0x0000fc00) -#define NIOS2_STATUS_CRS_OFST (10) -#define NIOS2_STATUS_PRS_MSK (0x003f0000) -#define NIOS2_STATUS_PRS_OFST (16) -#define NIOS2_STATUS_NMI_MSK (0x00400000) -#define NIOS2_STATUS_NMI_OFST (22) -#define NIOS2_STATUS_RSIE_MSK (0x00800000) -#define NIOS2_STATUS_RSIE_OFST (23) -#define NIOS2_STATUS_SRS_MSK (0x80000000) -#define NIOS2_STATUS_SRS_OFST (31) - -/* - * Bit masks & offsets available with extra exceptions support - */ - -/* Exception register */ -#define NIOS2_EXCEPTION_REG_CAUSE_MASK (0x0000007c) -#define NIOS2_EXCEPTION_REG_CAUSE_OFST (2) - -/* - * Bit masks & offsets for MPU support - * - * All bit-masks are expressed relative to the position - * of the data with a register. To read data that is LSB- - * aligned, the register read data should be masked, then - * right-shifted by the designated "OFST" macro value. The - * opposite should be used for register writes when starting - * with LSB-aligned data. - */ - -/* Config register */ -#define NIOS2_CONFIG_REG_PE_MASK (0x00000001) -#define NIOS2_CONFIG_REG_PE_OFST (0) -#define NIOS2_CONFIG_REG_ANI_MASK (0x00000002) -#define NIOS2_CONFIG_REG_ANI_OFST (1) - -/* MPU Base Address Register */ -#define NIOS2_MPUBASE_D_MASK (0x00000001) -#define NIOS2_MPUBASE_D_OFST (0) -#define NIOS2_MPUBASE_INDEX_MASK (0x0000003e) -#define NIOS2_MPUBASE_INDEX_OFST (1) -#define NIOS2_MPUBASE_BASE_ADDR_MASK (0xffffffc0) -#define NIOS2_MPUBASE_BASE_ADDR_OFST (6) - -/* MPU Access Register */ -#define NIOS2_MPUACC_LIMIT_MASK (0xffffffc0) -#define NIOS2_MPUACC_LIMIT_OFST (6) -#define NIOS2_MPUACC_MASK_MASK (0xffffffc0) -#define NIOS2_MPUACC_MASK_OFST (6) -#define NIOS2_MPUACC_C_MASK (0x00000020) -#define NIOS2_MPUACC_C_OFST (5) -#define NIOS2_MPUACC_PERM_MASK (0x0000001c) -#define NIOS2_MPUACC_PERM_OFST (2) -#define NIOS2_MPUACC_RD_MASK (0x00000002) -#define NIOS2_MPUACC_RD_OFST (1) -#define NIOS2_MPUACC_WR_MASK (0x00000001) -#define NIOS2_MPUACC_WR_OFST (0) - -/* - * Number of available IRQs in internal interrupt controller. - */ -#define NIOS2_NIRQ 32 - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __NIOS2_H__ */ diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/inc/os/alt_flag.h b/software/qsys_tutorial_switchs18_bsp/HAL/inc/os/alt_flag.h deleted file mode 100644 index b9b4605..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/inc/os/alt_flag.h +++ /dev/null @@ -1,98 +0,0 @@ -#ifndef __ALT_FLAG_H__ -#define __ALT_FLAG_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * This header provides macro definitions that can be used to create and use - * uc/OS-II style event flags. These macros can be used in both a uC/OS-II based - * environment, and a single threaded HAL based environment. - * - * The motivation for these macros is to allow code to be developed which is - * thread safe under uC/OS-II, but incurs no additional overhead when used in a - * single threaded HAL environment. - * - * In the case of a single threaded HAL environment, they compile to - * "do nothing" directives, which ensures they do not contribute to the final - * executable. - * - * The following macros are available: - * - * ALT_FLAG_GRP - Create a flag group instance. - * ALT_EXTERN_FLAG_GRP - Create a reference to an external flag group instance. - * ALT_STATIC_FLAG_GRP - Create a static flag group instance. - * ALT_FLAG_CREATE - Initialise a flag group. - * ALT_FLAG_PEND - Pend on a flag group. - * ALT_FLAG_POST - Set a flag condition. - - * - * Input arguments and return codes are all consistant with the equivalent - * uC/OS-II function. - * - * It's important to be careful in the use of the macros: ALT_FLAG_GRP, - * ALT_EXTERN_FLAG_GRP, and ALT_STATIC_FLAG_GRP. In these three cases the - * semi-colon is included in the macro definition; so, for example, you should - * use: - * - * ALT_FLAG_GRP(mygroup) - * - * not: - * - * ALT_FLAG_GRP(mygroup); - * - * The inclusion of the semi-colon has been necessary to ensure the macros can - * compile with no warnings when used in a single threaded HAL environment. - * - */ - -#include "priv/alt_no_error.h" - -#define ALT_FLAG_GRP(group) -#define ALT_EXTERN_FLAG_GRP(group) -#define ALT_STATIC_FLAG_GRP(group) - -#define ALT_FLAG_CREATE(group, flags) alt_no_error () -#define ALT_FLAG_PEND(group, flags, wait_type, timeout) alt_no_error () -#define ALT_FLAG_POST(group, flags, opt) alt_no_error () - -#ifndef ALT_SINGLE_THREADED -#define ALT_SINGLE_THREADED -#endif - -#endif /* __ALT_FLAG_H__ */ diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/inc/os/alt_hooks.h b/software/qsys_tutorial_switchs18_bsp/HAL/inc/os/alt_hooks.h deleted file mode 100644 index 9054e3f..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/inc/os/alt_hooks.h +++ /dev/null @@ -1,61 +0,0 @@ -#ifndef __ALT_HOOKS_H__ -#define __ALT_HOOKS_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * This header provides "do-nothing" macro definitions for operating system - * hooks within the HAL. The O/S component can override these to provide it's - * own implementation. - */ - -#define ALT_OS_TIME_TICK() while(0) -#define ALT_OS_INIT() while(0) -#define ALT_OS_STOP() while(0) - -/* Call from assembly code */ -#define ALT_OS_INT_ENTER_ASM -#define ALT_OS_INT_EXIT_ASM - -/* Call from C code */ -#define ALT_OS_INT_ENTER() while(0) -#define ALT_OS_INT_EXIT() while(0) - - -#endif /* __ALT_HOOKS_H__ */ diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/inc/os/alt_sem.h b/software/qsys_tutorial_switchs18_bsp/HAL/inc/os/alt_sem.h deleted file mode 100644 index 753943e..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/inc/os/alt_sem.h +++ /dev/null @@ -1,96 +0,0 @@ -#ifndef __ALT_SEM_H__ -#define __ALT_SEM_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * This header provides macro definitions that can be used to create and use - * semaphores. These macros can be used in both a uC/OS-II based environment, - * and a single threaded HAL based environment. - * - * The motivation for these macros is to allow code to be developed which is - * thread safe under uC/OS-II, but incurs no additional overhead when used in a - * single threaded HAL environment. - * - * In the case of a single threaded HAL environment, they compile to - * "do nothing" directives, which ensures they do not contribute to the final - * executable. - * - * The following macros are available: - * - * ALT_SEM - Create a semaphore instance. - * ALT_EXTERN_SEM - Create a reference to an external semaphore instance. - * ALT_STATIC_SEM - Create a static semaphore instance. - * ALT_SEM_CREATE - Initialise a semaphore. - * ALT_SEM_PEND - Pend on a semaphore. - * ALT_SEM_POST - Increment a semaphore. - * - * Input arguments and return codes are all consistant with the equivalent - * uC/OS-II function. - * - * It's important to be careful in the use of the macros: ALT_SEM, - * ALT_EXTERN_SEM, and ALT_STATIC_SEM. In these three cases the semi-colon is - * included in the macro definition; so, for example, you should use: - * - * ALT_SEM(mysem) - * - * not: - * - * ALT_SEM(mysem); - * - * The inclusion of the semi-colon has been necessary to ensure the macros can - * compile with no warnings when used in a single threaded HAL environment. - * - */ - -#include "priv/alt_no_error.h" - -#define ALT_SEM(sem) -#define ALT_EXTERN_SEM(sem) -#define ALT_STATIC_SEM(sem) - -#define ALT_SEM_CREATE(sem, value) alt_no_error () -#define ALT_SEM_PEND(sem, timeout) alt_no_error () -#define ALT_SEM_POST(sem) alt_no_error () - -#ifndef ALT_SINGLE_THREADED -#define ALT_SINGLE_THREADED -#endif - -#endif /* __ALT_SEM_H__ */ diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/inc/os/alt_syscall.h b/software/qsys_tutorial_switchs18_bsp/HAL/inc/os/alt_syscall.h deleted file mode 100644 index 507c6aa..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/inc/os/alt_syscall.h +++ /dev/null @@ -1,75 +0,0 @@ -#ifndef __ALT_SYSCALL_H__ -#define __ALT_SYSCALL_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * The macros defined in this file are used to provide the function names used - * for the HAL 'UNIX style' interface, e.g. read(), write() etc. - * - * Operating systems which are ported to the HAL can provide their own - * version of this file, which will be used in preference. This allows - * the operating system to provide it's own implementation of the top level - * system calls, while retaining the HAL functions under a different name, - * for example, alt_read(), alt_write() etc. - */ - -#define ALT_CLOSE close -#define ALT_ENVIRON environ -#define ALT_EXECVE execve -#define ALT_EXIT _exit -#define ALT_FCNTL fcntl -#define ALT_FORK fork -#define ALT_FSTAT fstat -#define ALT_GETPID getpid -#define ALT_GETTIMEOFDAY gettimeofday -#define ALT_IOCTL ioctl -#define ALT_ISATTY isatty -#define ALT_KILL kill -#define ALT_LINK link -#define ALT_LSEEK lseek -#define ALT_OPEN open -#define ALT_READ read -#define ALT_RENAME _rename -#define ALT_SBRK sbrk -#define ALT_SETTIMEOFDAY settimeofday -#define ALT_STAT stat -#define ALT_UNLINK unlink -#define ALT_USLEEP usleep -#define ALT_WAIT wait -#define ALT_WRITE write -#define ALT_TIMES times - -/* - * - */ - -#endif /* __ALT_SYSCALL_H__ */ diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/inc/priv/alt_alarm.h b/software/qsys_tutorial_switchs18_bsp/HAL/inc/priv/alt_alarm.h deleted file mode 100644 index 45d6a0e..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/inc/priv/alt_alarm.h +++ /dev/null @@ -1,101 +0,0 @@ -#ifndef __ALT_PRIV_ALARM_H__ -#define __ALT_PRIV_ALARM_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "alt_types.h" - -/* - * This header provides the internal defenitions required by the public - * interface alt_alarm.h. These variables and structures are not guaranteed to - * exist in future implementations of the HAL. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * "alt_alarm_s" is a structure type used to maintain lists of alarm callback - * functions. - */ - -struct alt_alarm_s -{ - alt_llist llist; /* linked list */ - alt_u32 time; /* time in system ticks of the callback */ - alt_u32 (*callback) (void* context); /* callback function. The return - * value is the period for the next callback; where - * zero indicates that the alarm should be removed - * from the list. - */ - alt_u8 rollover; /* set when desired alarm time + current time causes - overflow, to prevent premature alarm */ - void* context; /* Argument for the callback */ -}; - -/* - * "_alt_tick_rate" is a global variable used to store the system clock rate - * in ticks per second. This is initialised to zero, which coresponds to there - * being no system clock available. - * - * It is then set to it's final value by the system clock driver through a call - * to alt_sysclk_init(). - */ - -extern alt_u32 _alt_tick_rate; - -/* - * "_alt_nticks" is a global variable which records the elapsed number of - * system clock ticks since the last call to settimeofday() or since reset if - * settimeofday() has not been called. - */ - -extern volatile alt_u32 _alt_nticks; - -/* The list of registered alarms. */ - -extern alt_llist alt_alarm_list; - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_PRIV_ALARM_H__ */ diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/inc/priv/alt_busy_sleep.h b/software/qsys_tutorial_switchs18_bsp/HAL/inc/priv/alt_busy_sleep.h deleted file mode 100644 index b1af849..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/inc/priv/alt_busy_sleep.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef __ALT_BUSY_SLEEP_H -#define __ALT_BUSY_SLEEP_H - -/* - * Copyright (c) 2003 Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - */ - -/* - * The function alt_busy_sleep provides a busy loop implementation of usleep. - * This is used to provide usleep for the standalone HAL, or when the timer is - * unavailable in uC/OS-II. - */ - -extern unsigned int alt_busy_sleep (unsigned int us); - -#endif /* __ALT_BUSY_SLEEP_H */ diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/inc/priv/alt_dev_llist.h b/software/qsys_tutorial_switchs18_bsp/HAL/inc/priv/alt_dev_llist.h deleted file mode 100644 index 451b063..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/inc/priv/alt_dev_llist.h +++ /dev/null @@ -1,77 +0,0 @@ -#ifndef __ALT_DEV_LLIST_H__ -#define __ALT_DEV_LLIST_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "sys/alt_llist.h" -#include "alt_types.h" - -/* - * This header provides the internal defenitions required to control file - * access. These variables and functions are not guaranteed to exist in - * future implementations of the HAL. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The alt_dev_llist is an internal structure used to form a common base - * class for all device types. The use of this structure allows common code - * to be used to manipulate the various device lists. - */ - -typedef struct { - alt_llist llist; - const char* name; -} alt_dev_llist; - -/* - * - */ - -extern int alt_dev_llist_insert (alt_dev_llist* dev, alt_llist* list); - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_DEV_LLIST_H__ */ diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/inc/priv/alt_exception_handler_registry.h b/software/qsys_tutorial_switchs18_bsp/HAL/inc/priv/alt_exception_handler_registry.h deleted file mode 100644 index c6905fa..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/inc/priv/alt_exception_handler_registry.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef __ALT_EXCEPTION_HANDLER_REGISTRY_H__ -#define __ALT_EXCEPTION_HANDLER_REGISTRY_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2008 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ -#include "sys/alt_exceptions.h" - -/* Function pointer to exception callback routine */ -extern alt_exception_result (*alt_instruction_exception_handler) - (alt_exception_cause, alt_u32, alt_u32); - -#endif /* __ALT_EXCEPTION_HANDLER_REGISTRY_H__ */ diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/inc/priv/alt_file.h b/software/qsys_tutorial_switchs18_bsp/HAL/inc/priv/alt_file.h deleted file mode 100644 index 2c3e843..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/inc/priv/alt_file.h +++ /dev/null @@ -1,179 +0,0 @@ -#ifndef __ALT_FILE_H__ -#define __ALT_FILE_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "sys/alt_dev.h" -#include "sys/alt_llist.h" -#include "os/alt_sem.h" - -#include "alt_types.h" - -/* - * This header provides the internal defenitions required to control file - * access. These variables and functions are not guaranteed to exist in - * future implementations of the HAL. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The function alt_find_dev() is used to search the device list "list" to - * locate a device named "name". If a match is found, then a pointer to the - * device is returned, otherwise NULL is returned. - */ - -extern alt_dev* alt_find_dev (const char* name, alt_llist* list); - -/* - * alt_find_file() is used to search the list of registered file systems to - * find the filesystem that the file named "name" belongs to. If a match is - * found, then a pointer to the filesystems alt_dev structure is returned, - * otherwise NULL is returned. - * - * Note that a match does not indicate that the file exists, only that a - * filesystem exists that is registered for a partition that could contain - * the file. The filesystems open() function would need to be called in order - * to determine if the file exists. - */ - -extern alt_dev* alt_find_file (const char* name); - -/* - * alt_get_fd() is used to allocate a file descriptor for the device or - * filesystem "dev". A negative return value indicates an error, otherwise the - * return value is the index of the file descriptor within the file descriptor - * pool. - */ - -extern int alt_get_fd (alt_dev* dev); - -/* - * alt_release_fd() is called to free the file descriptor with index "fd". - */ - -extern void alt_release_fd (int fd); - -/* - * alt_fd_lock() is called by ioctl() to mark the file descriptor "fd" as - * being open for exclusive access. Subsequent calls to open() for the device - * associated with "fd" will fail. A device is unlocked by either calling - * close() for "fd", or by an alternate call to ioctl() (see ioctl.c for - * details). - */ - -extern int alt_fd_lock (alt_fd* fd); - -/* - * alt_fd_unlock() is called by ioctl() to unlock a descriptor previously - * locked by a call to alt_fd_lock(). - */ - -extern int alt_fd_unlock (alt_fd* fd); - -/* - * "alt_fd_list" is the pool of file descriptors. - */ - -extern alt_fd alt_fd_list[]; - -/* - * flags used by alt_fd. - * - * ALT_FD_EXCL is used to mark a file descriptor as locked for exclusive - * access, i.e. further calls to open() for the associated device should - * fail. - * - * ALT_FD_DEV marks a dile descriptor as belonging to a device as oposed to a - * filesystem. - */ - -#define ALT_FD_EXCL 0x80000000 -#define ALT_FD_DEV 0x40000000 - -#define ALT_FD_FLAGS_MASK (ALT_FD_EXCL | ALT_FD_DEV) - -/* - * "alt_dev_list" is the head of the linked list of registered devices. - */ - -extern alt_llist alt_dev_list; - -/* - * "alt_fs_list" is the head of the linked list of registered filesystems. - */ - -extern alt_llist alt_fs_list; - -/* - * "alt_fd_list_lock" is a semaphore used to ensure that access to the pool - * of file descriptors is thread safe. - */ - -ALT_EXTERN_SEM(alt_fd_list_lock) - -/* - * "alt_max_fd" is a 'high water mark'. It indicates the highest file - * descriptor allocated. Use of this can save searching the entire pool - * for active file descriptors, which helps avoid contention on access - * to the file descriptor pool. - */ - -extern alt_32 alt_max_fd; - -/* - * alt_io_redirect() is called at startup to redirect stdout, stdin, and - * stderr to the devices named in the input arguments. By default these streams - * are directed at /dev/null, and are then redirected using this function once - * all of the devices have been registered within the system. - */ - -extern void alt_io_redirect(const char* stdout_dev, - const char* stdin_dev, - const char* stderr_dev); - - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_FILE_H__ */ diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/inc/priv/alt_iic_isr_register.h b/software/qsys_tutorial_switchs18_bsp/HAL/inc/priv/alt_iic_isr_register.h deleted file mode 100644 index a0cb01c..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/inc/priv/alt_iic_isr_register.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef __ALT_IIC_ISR_REGISTER_H_ -#define __ALT_IIC_ISR_REGISTER_H_ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ -#include "alt_types.h" -#include "sys/alt_irq.h" - -extern int alt_iic_isr_register(alt_u32 ic_id, alt_u32 irq, alt_isr_func isr, - void *isr_context, void *flags); - -#endif /* __ALT_IIC_ISR_REGISTER_H_ */ diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/inc/priv/alt_irq_table.h b/software/qsys_tutorial_switchs18_bsp/HAL/inc/priv/alt_irq_table.h deleted file mode 100644 index 694ef06..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/inc/priv/alt_irq_table.h +++ /dev/null @@ -1,59 +0,0 @@ -#ifndef __ALT_IRQ_TABLE_H__ -#define __ALT_IRQ_TABLE_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * Definition of a table describing each interrupt handler. The index into - * the array is the interrupt id associated with the handler. - * - * When an interrupt occurs, the associated handler is called with - * the argument stored in the context member. - * - * The table is physically created in alt_irq_handler.c - */ -extern struct ALT_IRQ_HANDLER -{ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - void (*handler)(void*); -#else - void (*handler)(void*, alt_u32); -#endif - void *context; -} alt_irq[ALT_NIRQ]; - -#endif diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/inc/priv/alt_legacy_irq.h b/software/qsys_tutorial_switchs18_bsp/HAL/inc/priv/alt_legacy_irq.h deleted file mode 100644 index c7aec02..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/inc/priv/alt_legacy_irq.h +++ /dev/null @@ -1,158 +0,0 @@ -#ifndef __ALT_LEGACY_IRQ_H__ -#define __ALT_LEGACY_IRQ_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * This file provides prototypes and inline implementations of certain routines - * used by the legacy interrupt API. Do not include this in your driver or - * application source files, use "sys/alt_irq.h" instead to access the proper - * public API. - */ - -#include -#include "system.h" - -#ifndef NIOS2_EIC_PRESENT - -#include "nios2.h" -#include "alt_types.h" - -#include "sys/alt_irq.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * alt_irq_register() can be used to register an interrupt handler. If the - * function is succesful, then the requested interrupt will be enabled upon - * return. - */ -extern int alt_irq_register (alt_u32 id, - void* context, - alt_isr_func handler); - -/* - * alt_irq_disable() disables the individual interrupt indicated by "id". - */ -static ALT_INLINE int ALT_ALWAYS_INLINE alt_irq_disable (alt_u32 id) -{ - alt_irq_context status; - extern volatile alt_u32 alt_irq_active; - - status = alt_irq_disable_all (); - - alt_irq_active &= ~(1 << id); - NIOS2_WRITE_IENABLE (alt_irq_active); - - alt_irq_enable_all(status); - - return 0; -} - -/* - * alt_irq_enable() enables the individual interrupt indicated by "id". - */ -static ALT_INLINE int ALT_ALWAYS_INLINE alt_irq_enable (alt_u32 id) -{ - alt_irq_context status; - extern volatile alt_u32 alt_irq_active; - - status = alt_irq_disable_all (); - - alt_irq_active |= (1 << id); - NIOS2_WRITE_IENABLE (alt_irq_active); - - alt_irq_enable_all(status); - - return 0; -} - -#ifndef ALT_EXCEPTION_STACK -/* - * alt_irq_initerruptable() should only be called from within an ISR. It is used - * to allow higer priority interrupts to interrupt the current ISR. The input - * argument, "priority", is the priority, i.e. interrupt number of the current - * interrupt. - * - * If this function is called, then the ISR is required to make a call to - * alt_irq_non_interruptible() before returning. The input argument to - * alt_irq_non_interruptible() is the return value from alt_irq_interruptible(). - * - * Care should be taken when using this pair of functions, since they increasing - * the system overhead associated with interrupt handling. - * - * If you are using an exception stack then nested interrupts won't work, so - * these functions are not available in that case. - */ -static ALT_INLINE alt_u32 ALT_ALWAYS_INLINE alt_irq_interruptible (alt_u32 priority) -{ - extern volatile alt_u32 alt_priority_mask; - extern volatile alt_u32 alt_irq_active; - - alt_u32 old_priority; - - old_priority = alt_priority_mask; - alt_priority_mask = (1 << priority) - 1; - - NIOS2_WRITE_IENABLE (alt_irq_active & alt_priority_mask); - - NIOS2_WRITE_STATUS (1); - - return old_priority; -} - -/* - * See Comments above for alt_irq_interruptible() for an explanation of the use of this - * function. - */ -static ALT_INLINE void ALT_ALWAYS_INLINE alt_irq_non_interruptible (alt_u32 mask) -{ - extern volatile alt_u32 alt_priority_mask; - extern volatile alt_u32 alt_irq_active; - - NIOS2_WRITE_STATUS (0); - - alt_priority_mask = mask; - - NIOS2_WRITE_IENABLE (mask & alt_irq_active); -} -#endif /* ALT_EXCEPTION_STACK */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* NIOS2_EIC_PRESENT */ - -#endif /* __ALT_LEGACY_IRQ_H__ */ diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/inc/priv/alt_no_error.h b/software/qsys_tutorial_switchs18_bsp/HAL/inc/priv/alt_no_error.h deleted file mode 100644 index 6143fc9..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/inc/priv/alt_no_error.h +++ /dev/null @@ -1,77 +0,0 @@ -#ifndef __ALT_NO_ERROR_H__ -#define __ALT_NO_ERROR_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "alt_types.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * alt_no_error() is a dummy function used by alt_sem.h and alt_flag.h. It - * substitutes for functions that have a return code by creating a function - * that always returns zero. - * - * This may seem a little obscure, but what happens is that the compiler can - * then optomise away the call to this function, and any code written which - * handles the error path (i.e. non zero return values). - * - * This allows code to be written which correctly use the uC/OS-II semaphore - * and flag utilities, without the use of those utilities impacting on - * excutables built for a single threaded HAL environment. - * - * This function is considered to be part of the internal implementation of - * the HAL, and should not be called directly by application code or device - * drivers. It is not guaranteed to be preserved in future versions of the - * HAL. - */ - -static ALT_INLINE int ALT_ALWAYS_INLINE alt_no_error (void) -{ - return 0; -} - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_NO_ERROR_H__ */ diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/inc/priv/nios2_gmon_data.h b/software/qsys_tutorial_switchs18_bsp/HAL/inc/priv/nios2_gmon_data.h deleted file mode 100644 index 3f43f12..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/inc/priv/nios2_gmon_data.h +++ /dev/null @@ -1,47 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ -#ifndef NIOS2_GMON_DATA_H -#define NIOS2_GMON_DATA_H - -#define GMON_DATA_SIG 0 -#define GMON_DATA_WORDS 1 -#define GMON_DATA_PROFILE_DATA 2 -#define GMON_DATA_PROFILE_LOWPC 3 -#define GMON_DATA_PROFILE_HIGHPC 4 -#define GMON_DATA_PROFILE_BUCKET 5 -#define GMON_DATA_PROFILE_RATE 6 -#define GMON_DATA_MCOUNT_START 7 -#define GMON_DATA_MCOUNT_LIMIT 8 - -#define GMON_DATA_SIZE 9 - -extern unsigned int alt_gmon_data[GMON_DATA_SIZE]; - -#endif diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_alarm.h b/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_alarm.h deleted file mode 100644 index 68a2f5d..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_alarm.h +++ /dev/null @@ -1,126 +0,0 @@ -#ifndef __ALT_ALARM_H__ -#define __ALT_ALARM_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "alt_llist.h" -#include "alt_types.h" - -#include "priv/alt_alarm.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * "alt_alarm" is a structure type used by applications to register an alarm - * callback function. An instance of this type must be passed as an input - * argument to alt_alarm_start(). The user is not responsible for initialising - * the contents of the instance. This is done by alt_alarm_start(). - */ - -typedef struct alt_alarm_s alt_alarm; - -/* - * alt_alarm_start() can be called by an application/driver in order to register - * a function for periodic callback at the system clock frequency. Be aware that - * this callback is likely to occur in interrupt context. - */ - -extern int alt_alarm_start (alt_alarm* the_alarm, - alt_u32 nticks, - alt_u32 (*callback) (void* context), - void* context); - -/* - * alt_alarm_stop() is used to unregister a callback. Alternatively the callback - * can return zero to unregister. - */ - -extern void alt_alarm_stop (alt_alarm* the_alarm); - -/* - * Obtain the system clock rate in ticks/s. - */ - -static ALT_INLINE alt_u32 ALT_ALWAYS_INLINE alt_ticks_per_second (void) -{ - return _alt_tick_rate; -} - -/* - * alt_sysclk_init() is intended to be only used by the system clock driver - * in order to initialise the value of the clock frequency. - */ - -static ALT_INLINE int ALT_ALWAYS_INLINE alt_sysclk_init (alt_u32 nticks) -{ - if (! _alt_tick_rate) - { - _alt_tick_rate = nticks; - return 0; - } - else - { - return -1; - } -} - -/* - * alt_nticks() returns the elapsed number of system clock ticks since reset. - */ - -static ALT_INLINE alt_u32 ALT_ALWAYS_INLINE alt_nticks (void) -{ - return _alt_nticks; -} - -/* - * alt_tick() should only be called by the system clock driver. This is used - * to notify the system that the system timer period has expired. - */ - -extern void alt_tick (void); - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_ALARM_H__ */ diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_cache.h b/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_cache.h deleted file mode 100644 index c4d8db9..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_cache.h +++ /dev/null @@ -1,117 +0,0 @@ -#ifndef __ALT_CACHE_H__ -#define __ALT_CACHE_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003, 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include - -#include "alt_types.h" - -/* - * alt_cache.h defines the processor specific functions for manipulating the - * cache. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * alt_icache_flush() is called to flush the instruction cache for a memory - * region of length "len" bytes, starting at address "start". - */ - -extern void alt_icache_flush (void* start, alt_u32 len); - -/* - * alt_dcache_flush() is called to flush the data cache for a memory - * region of length "len" bytes, starting at address "start". - * Any dirty lines in the data cache are written back to memory. - */ - -extern void alt_dcache_flush (void* start, alt_u32 len); - -/* - * alt_dcache_flush() is called to flush the data cache for a memory - * region of length "len" bytes, starting at address "start". - * Any dirty lines in the data cache are NOT written back to memory. - */ - -extern void alt_dcache_flush_no_writeback (void* start, alt_u32 len); - -/* - * Flush the entire instruction cache. - */ - -extern void alt_icache_flush_all (void); - -/* - * Flush the entire data cache. - */ - -extern void alt_dcache_flush_all (void); - -/* - * Allocate a block of uncached memory. - */ - -extern volatile void* alt_uncached_malloc (size_t size); - -/* - * Free a block of uncached memory. - */ - -extern void alt_uncached_free (volatile void* ptr); - -/* - * Convert a pointer to a block of cached memory, into a block of - * uncached memory. - */ - -extern volatile void* alt_remap_uncached (void* ptr, alt_u32 len); - -/* - * Convert a pointer to a block of uncached memory, into a block of - * cached memory. - */ - -extern void* alt_remap_cached (volatile void* ptr, alt_u32 len); - -/* - * - */ - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_CACHE_H__ */ diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_debug.h b/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_debug.h deleted file mode 100644 index d9f9599..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_debug.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef __ALT_DEBUG_H__ -#define __ALT_DEBUG_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * The ALT_DEVUG_ASSERT macro can be used to generate a debugger break - * from within software. The break is generated if "condition" evaluates to - * false. - */ - -#define ALT_DEBUG_ASSERT(condition) if (!condition) \ -{ \ - __asm__ volatile ("break"); \ -} - -#endif /* __ALT_DEBUG_H__ */ diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_dev.h b/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_dev.h deleted file mode 100644 index 66c5e41..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_dev.h +++ /dev/null @@ -1,115 +0,0 @@ -#ifndef __ALT_DEV_H__ -#define __ALT_DEV_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "system.h" -#include "sys/alt_llist.h" -#include "priv/alt_dev_llist.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The value ALT_IRQ_NOT_CONNECTED is used to represent an unconnected - * interrupt line. It cannot evaluate to a valid interrupt number. - */ - -#define ALT_IRQ_NOT_CONNECTED (-1) - -typedef struct alt_dev_s alt_dev; - -struct stat; - -/* - * The file descriptor structure definition. - */ - -typedef struct alt_fd_s -{ - alt_dev* dev; - alt_u8* priv; - int fd_flags; -} alt_fd; - -/* - * The device structure definition. - */ - -struct alt_dev_s { - alt_llist llist; /* for internal use */ - const char* name; - int (*open) (alt_fd* fd, const char* name, int flags, int mode); - int (*close) (alt_fd* fd); - int (*read) (alt_fd* fd, char* ptr, int len); - int (*write) (alt_fd* fd, const char* ptr, int len); - int (*lseek) (alt_fd* fd, int ptr, int dir); - int (*fstat) (alt_fd* fd, struct stat* buf); - int (*ioctl) (alt_fd* fd, int req, void* arg); -}; - -/* - * Functions used to register device for access through the C standard - * library. - * - * The only difference between alt_dev_reg() and alt_fs_reg() is the - * interpretation that open() places on the device name. In the case of - * alt_dev_reg the device is assumed to be a particular character device, - * and so there must be an exact match in the name for open to succeed. - * In the case of alt_fs_reg() the name of the device is treated as the - * mount point for a directory, and so any call to open() where the name - * is the root of the device filename will succeed. - */ - -extern int alt_fs_reg (alt_dev* dev); - -static ALT_INLINE int alt_dev_reg (alt_dev* dev) -{ - extern alt_llist alt_dev_list; - - return alt_dev_llist_insert ((alt_dev_llist*) dev, &alt_dev_list); -} - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_DEV_H__ */ diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_dma.h b/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_dma.h deleted file mode 100644 index 9f9b2ff..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_dma.h +++ /dev/null @@ -1,226 +0,0 @@ -#ifndef __ALT_DMA_H__ -#define __ALT_DMA_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "sys/alt_dma_dev.h" -#include "alt_types.h" - -#include - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * This header contains the application side interface for accessing DMA - * resources. See alt_dma_dev.h for the dma device driver interface. - * - * The interface model treats a DMA transaction as being composed of two - * halves (read and write). - * - * The application can supply data for transmit using an "alt_dma_txchan" - * descriptor. Alternatively an "alt_dma_rxchan" descriptor can be used to - * receive data. - */ - -/* - * alt_dma_txchan_open() is used to obtain an "alt_dma_txchan" descriptor for - * a DMA transmit device. The name is the name of the associated physical - * device (e.g. "/dev/dma_0"). - * - * The return value will be NULL on failure, and non-NULL otherwise. - */ - -extern alt_dma_txchan alt_dma_txchan_open (const char* name); - -/* - * alt_dma_txchan_close() is provided so that an application can notify the - * system that it has finished with a given DMA transmit channel. This is only - * provided for completness. - */ - -static ALT_INLINE int alt_dma_txchan_close (alt_dma_txchan dma) -{ - return 0; -} - -/* - * alt_dma_txchan_send() posts a transmit request to a DMA transmit channel. - * The input arguments are: - * - * dma: the channel to use. - * from: a pointer to the start of the data to send. - * length: the length of the data to send in bytes. - * done: callback function that will be called once the data has been sent. - * handle: opaque value passed to "done". - * - * The return value will be negative if the request cannot be posted, and - * zero otherwise. - */ - -static ALT_INLINE int alt_dma_txchan_send (alt_dma_txchan dma, - const void* from, - alt_u32 length, - alt_txchan_done* done, - void* handle) -{ - return dma ? dma->dma_send (dma, - from, - length, - done, - handle) : -ENODEV; -} - -/* - * alt_dma_txchan_space() returns the number of tranmit requests that can be - * posted to the specified DMA transmit channel. - * - * A negative value indicates that the value could not be determined. - */ - -static ALT_INLINE int alt_dma_txchan_space (alt_dma_txchan dma) -{ - return dma ? dma->space (dma) : -ENODEV; -} - -/* - * alt_dma_txchan_ioctl() can be used to perform device specific I/O - * operations on the indicated DMA transmit channel. For example some drivers - * support options to control the width of the transfer operations. See - * alt_dma_dev.h for the list of generic requests. - * - * A negative return value indicates failure, otherwise the interpretation - * of the return value is request specific. - */ - -static ALT_INLINE int alt_dma_txchan_ioctl (alt_dma_txchan dma, - int req, - void* arg) -{ - return dma ? dma->ioctl (dma, req, arg) : -ENODEV; -} - -/* - * alt_dma_rxchan_open() is used to obtain an "alt_dma_rxchan" descriptor for - * a DMA receive channel. The name is the name of the associated physical - * device (e.g. "/dev/dma_0"). - * - * The return value will be NULL on failure, and non-NULL otherwise. - */ - -extern alt_dma_rxchan alt_dma_rxchan_open (const char* dev); - -/* - * alt_dma_rxchan_close() is provided so that an application can notify the - * system that it has finished with a given DMA receive channel. This is only - * provided for completness. - */ - -static ALT_INLINE int alt_dma_rxchan_close (alt_dma_rxchan dma) -{ - return 0; -} - -/* - * - */ - -/* - * alt_dma_rxchan_prepare() posts a receive request to a DMA receive channel. - * - * The input arguments are: - * - * dma: the channel to use. - * data: a pointer to the location that data is to be received to. - * len: the maximum length of the data to receive. - * done: callback function that will be called once the data has been - * received. - * handle: opaque value passed to "done". - * - * The return value will be negative if the request cannot be posted, and - * zero otherwise. - */ - -static ALT_INLINE int alt_dma_rxchan_prepare (alt_dma_rxchan dma, - void* data, - alt_u32 len, - alt_rxchan_done* done, - void* handle) -{ - return dma ? dma->prepare (dma, data, len, done, handle) : -ENODEV; -} - -/* - * alt_dma_rxchan_ioctl() can be used to perform device specific I/O - * operations on the indicated DMA receive channel. For example some drivers - * support options to control the width of the transfer operations. See - * alt_dma_dev.h for the list of generic requests. - * - * A negative return value indicates failure, otherwise the interpretation - * of the return value is request specific. - */ - -static ALT_INLINE int alt_dma_rxchan_ioctl (alt_dma_rxchan dma, - int req, - void* arg) -{ - return dma ? dma->ioctl (dma, req, arg) : -ENODEV; -} - -/* - * alt_dma_rxchan_depth() returns the depth of the receive FIFO used to store - * receive requests. - */ - -static ALT_INLINE alt_u32 alt_dma_rxchan_depth(alt_dma_rxchan dma) -{ - return dma->depth; -} - -/* - * - */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_DMA_H__ */ diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_dma_dev.h b/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_dma_dev.h deleted file mode 100644 index 832463d..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_dma_dev.h +++ /dev/null @@ -1,200 +0,0 @@ -#ifndef __ALT_DMA_DEV_H__ -#define __ALT_DMA_DEV_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "priv/alt_dev_llist.h" - -#include "alt_types.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * This header contains the device driver interface for accessing DMA - * resources. See alt_dma.h for the DMA application side interface. - * - * The interface model treats a DMA transaction as being composed of two - * halves (read and write). - * - * An "alt_dma_txchan_dev" is used to describe the device associated with a - * DMA transmit channel. An "alt_dma_rxchan_dev" is used to describe the - * device associated with a DMA receive channel. - */ - -/* - * List of generic ioctl requests that may be supported by a DMA device. - * - * ALT_DMA_RX_ONLY_ON: This causes a DMA channel to operate in a mode - * where only the receiver is under software control. - * The other side reads continously from a single - * location. The address to read is the argument to - * this request. - * ALT_DMA_RX_ONLY_OFF: Return to the default mode where both the receive - * and transmit sides of the DMA can be under software - * control. - * ALT_DMA_TX_ONLY_ON: This causes a DMA channel to operate in a mode - * where only the transmitter is under software control. - * The other side writes continously to a single - * location. The address to write to is the argument to - * this request. - * ALT_DMA_TX_ONLY_OFF: Return to the default mode where both the receive - * and transmit sides of the DMA can be under software - * control. - * ALT_DMA_SET_MODE_8: Transfer data in units of 8 bits. - * ALT_DMA_SET_MODE_16: Transfer data in units of 16 bits. - * ALT_DMA_SET_MODE_32: Transfer data in units of 32 bits. - * ALT_DMA_SET_MODE_64: Transfer data in units of 64 bits. - * ALT_DMA_SET_MODE_128: Transfer data in units of 128 bits. - * ALT_DMA_GET_MODE: Get the current transfer mode. - * - * The use of the macros: ALT_DMA_TX_STREAM_ON, ALT_DMA_TX_STREAM_OFF - * ALT_DMA_RX_STREAM_OFF and ALT_DMA_RX_STREAM_ON are depreciated. You should - * instead use the macros: ALT_DMA_RX_ONLY_ON, ALT_DMA_RX_ONLY_OFF, - * ALT_DMA_TX_ONLY_ON and ALT_DMA_TX_ONLY_OFF. - */ - -#define ALT_DMA_TX_STREAM_ON (0x1) -#define ALT_DMA_TX_STREAM_OFF (0x2) -#define ALT_DMA_RX_STREAM_ON (0x3) -#define ALT_DMA_RX_STREAM_OFF (0x4) -#define ALT_DMA_SET_MODE_8 (0x5) -#define ALT_DMA_SET_MODE_16 (0x6) -#define ALT_DMA_SET_MODE_32 (0x7) -#define ALT_DMA_SET_MODE_64 (0x8) -#define ALT_DMA_SET_MODE_128 (0x9) -#define ALT_DMA_GET_MODE (0xa) - -#define ALT_DMA_RX_ONLY_ON ALT_DMA_TX_STREAM_ON -#define ALT_DMA_RX_ONLY_OFF ALT_DMA_TX_STREAM_OFF -#define ALT_DMA_TX_ONLY_ON ALT_DMA_RX_STREAM_ON -#define ALT_DMA_TX_ONLY_OFF ALT_DMA_RX_STREAM_OFF - -/* - * - */ - -typedef struct alt_dma_txchan_dev_s alt_dma_txchan_dev; -typedef struct alt_dma_rxchan_dev_s alt_dma_rxchan_dev; - -typedef alt_dma_txchan_dev* alt_dma_txchan; -typedef alt_dma_rxchan_dev* alt_dma_rxchan; - -typedef void (alt_txchan_done)(void* handle); -typedef void (alt_rxchan_done)(void* handle, void* data); - -/* - * devices that provide a DMA transmit channel are required to provide an - * instance of the "alt_dma_txchan_dev" structure. - */ - -struct alt_dma_txchan_dev_s { - alt_llist llist; /* for internal use */ - const char* name; /* name of the device instance - * (e.g. "/dev/dma_0"). - */ - int (*space) (alt_dma_txchan dma); /* returns the maximum number of - * transmit requests that can be posted - */ - int (*dma_send) (alt_dma_txchan dma, - const void* from, - alt_u32 len, - alt_txchan_done* done, - void* handle); /* post a transmit request */ - int (*ioctl) (alt_dma_txchan dma, int req, void* arg); /* perform device - * specific I/O control. - */ -}; - -/* - * devices that provide a DMA receive channel are required to provide an - * instance of the "alt_dma_rxchan_dev" structure. - */ - -struct alt_dma_rxchan_dev_s { - alt_llist list; /* for internal use */ - const char* name; /* name of the device instance - * (e.g. "/dev/dma_0"). - */ - alt_u32 depth; /* maximum number of receive requests that - * can be posted. - */ - int (*prepare) (alt_dma_rxchan dma, - void* data, - alt_u32 len, - alt_rxchan_done* done, - void* handle); /* post a receive request */ - int (*ioctl) (alt_dma_rxchan dma, int req, void* arg); /* perform device - * specific I/O control. - */ -}; - -/* - * Register a DMA transmit channel with the system. - */ - -static ALT_INLINE int alt_dma_txchan_reg (alt_dma_txchan_dev* dev) -{ - extern alt_llist alt_dma_txchan_list; - - return alt_dev_llist_insert((alt_dev_llist*) dev, &alt_dma_txchan_list); -} - -/* - * Register a DMA receive channel with the system. - */ - -static ALT_INLINE int alt_dma_rxchan_reg (alt_dma_rxchan_dev* dev) -{ - extern alt_llist alt_dma_rxchan_list; - - return alt_dev_llist_insert((alt_dev_llist*) dev, &alt_dma_rxchan_list); -} - -/* - * - */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_DMA_DEV_H__ */ diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_driver.h b/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_driver.h deleted file mode 100644 index eb0f23b..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_driver.h +++ /dev/null @@ -1,168 +0,0 @@ -#ifndef __ALT_DRIVER_H__ -#define __ALT_DRIVER_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/* - * Macros used to access a driver without HAL file descriptors. - */ - -/* - * ALT_MODULE_CLASS - * - * This macro returns the module class name for the specified module instance. - * It uses information in the system.h file. - * Neither the instance name or class name are quoted (so that they can - * be used with other pre-processor macros). - * - * Example: - * Assume the design has an instance of an altera_avalon_uart called uart1. - * Calling ALT_MODULE_CLASS(uart1) returns altera_avalon_uart. - */ - -#define ALT_MODULE_CLASS(instance) ALT_MODULE_CLASS_ ## instance - - -/* - * ALT_DRIVER_FUNC_NAME - * - * --> instance Instance name. - * --> func Function name. - * - * This macro returns the device driver function name of the specified - * module instance for the specified function name. - * - * Example: - * Assume the design has an instance of an altera_avalon_uart called uart1. - * Calling ALT_DRIVER_FUNC_NAME(uart1, write) returns - * altera_avalon_uart_write. - */ - -#define ALT_DRIVER_FUNC_NAME(instance, func) \ - ALT_DRIVER_FUNC_NAME1(ALT_MODULE_CLASS(instance), func) -#define ALT_DRIVER_FUNC_NAME1(module_class, func) \ - ALT_DRIVER_FUNC_NAME2(module_class, func) -#define ALT_DRIVER_FUNC_NAME2(module_class, func) \ - module_class ## _ ## func - -/* - * ALT_DRIVER_STATE_STRUCT - * - * --> instance Instance name. - * - * This macro returns the device driver state type name of the specified - * module instance. - * - * Example: - * Assume the design has an instance of an altera_avalon_uart called uart1. - * Calling ALT_DRIVER_STATE_STRUCT(uart1) returns: - * struct altera_avalon_uart_state_s - * - * Note that the ALT_DRIVER_FUNC_NAME macro is used even though "state" isn't - * really a function but it does match the required naming convention. - */ -#define ALT_DRIVER_STATE_STRUCT(instance) \ - struct ALT_DRIVER_FUNC_NAME(instance, state_s) - -/* - * ALT_DRIVER_STATE - * - * --> instance Instance name. - * - * This macro returns the device driver state name of the specified - * module instance. - * - * Example: - * Assume the design has an instance of an altera_avalon_uart called uart1. - * Calling ALT_DRIVER_STATE(uart1) returns uart1. - */ -#define ALT_DRIVER_STATE(instance) instance - -/* - * ALT_DRIVER_WRITE - * - * --> instance Instance name. - * --> buffer Write buffer. - * --> len Length of write buffer data. - * --> flags Control flags (e.g. O_NONBLOCK) - * - * This macro calls the "write" function of the specified driver instance. - */ - -#define ALT_DRIVER_WRITE_EXTERNS(instance) \ - extern ALT_DRIVER_STATE_STRUCT(instance) ALT_DRIVER_STATE(instance); \ - extern int ALT_DRIVER_FUNC_NAME(instance, write) \ - (ALT_DRIVER_STATE_STRUCT(instance) *, const char *, int, int); - -#define ALT_DRIVER_WRITE(instance, buffer, len, flags) \ - ALT_DRIVER_FUNC_NAME(instance, write)(&ALT_DRIVER_STATE(instance), buffer, len, flags) - - -/* - * ALT_DRIVER_READ - * - * --> instance Instance name. - * <-- buffer Read buffer. - * --> len Length of read buffer. - * --> flags Control flags (e.g. O_NONBLOCK) - * - * This macro calls the "read" function of the specified driver instance. - */ - -#define ALT_DRIVER_READ_EXTERNS(instance) \ - extern ALT_DRIVER_STATE_STRUCT(instance) ALT_DRIVER_STATE(instance); \ - extern int ALT_DRIVER_FUNC_NAME(instance, read) \ - (ALT_DRIVER_STATE_STRUCT(instance) *, const char *, int, int); - -#define ALT_DRIVER_READ(instance, buffer, len, flags) \ - ALT_DRIVER_FUNC_NAME(instance, read)(&ALT_DRIVER_STATE(instance), buffer, len, flags) - -/* - * ALT_DRIVER_IOCTL - * - * --> instance Instance name. - * --> req ioctl request (e.g. TIOCSTIMEOUT) - * --> arg Optional argument (void*) - * - * This macro calls the "ioctl" function of the specified driver instance - */ - -#define ALT_DRIVER_IOCTL_EXTERNS(instance) \ - extern ALT_DRIVER_STATE_STRUCT(instance) ALT_DRIVER_STATE(instance); \ - extern int ALT_DRIVER_FUNC_NAME(instance, ioctl) \ - (ALT_DRIVER_STATE_STRUCT(instance) *, int, void*); - -#define ALT_DRIVER_IOCTL(instance, req, arg) \ - ALT_DRIVER_FUNC_NAME(instance, ioctl)(&ALT_DRIVER_STATE(instance), req, arg) - -#endif /* __ALT_DRIVER_H__ */ diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_errno.h b/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_errno.h deleted file mode 100644 index 4d3e50f..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_errno.h +++ /dev/null @@ -1,87 +0,0 @@ -#ifndef __ALT_ERRNO_H__ -#define __ALT_ERRNO_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * errno is defined in so that it uses the thread local version - * stored in the location pointed to by "_impure_ptr". This means that the - * accesses to errno within the HAL library can cause the entirety of - * of the structure pointed to by "_impure_ptr" to be added to the - * users application. This can be undesirable in very small footprint systems. - * - * To avoid this happening, the HAL uses the macro ALT_ERRNO, defined below, - * to access errno, rather than accessing it directly. This macro will only - * use the thread local version if some other code has already caused it to be - * included into the system, otherwise it will use the global errno value. - * - * This causes a slight increases in code size where errno is accessed, but - * can lead to significant overall benefits in very small systems. The - * increase is inconsequential when compared to the size of the structure - * pointed to by _impure_ptr. - * - * Note that this macro accesses __errno() using an externally declared - * function pointer (alt_errno). This is done so that the function call uses the - * subroutine call instruction via a register rather than an immediate address. - * This is important in the case that the code has been linked for a high - * address, but __errno() is not being used. In this case the weak linkage - * would have resulted in the instruction: "call 0" which would fail to link. - */ - -extern int* (*alt_errno) (void); - -/* Must define this so that values such as EBADFD are defined in errno.h. */ -#define __LINUX_ERRNO_EXTENSIONS__ - -#include - -#include "alt_types.h" - -#undef errno - -extern int errno; - -static ALT_INLINE int* alt_get_errno(void) -{ - return ((alt_errno) ? alt_errno() : &errno); -} - -#define ALT_ERRNO *alt_get_errno() - -#endif /* __ALT_ERRNO_H__ */ diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_exceptions.h b/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_exceptions.h deleted file mode 100644 index 3576a52..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_exceptions.h +++ /dev/null @@ -1,127 +0,0 @@ -#ifndef __ALT_EXCEPTIONS_H__ -#define __ALT_EXCEPTIONS_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2008 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ -#include "alt_types.h" -#include "system.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * This file defines instruction-generated exception handling and registry - * API, exception type enumeration, and handler return value enumeration for - * Nios II. - */ - -/* - * The following enumeration describes the value in the CPU EXCEPTION - * register CAUSE bit field. Not all exception types will cause the - * processor to go to the exception vector; these are provided for - * reference. - */ -enum alt_exception_cause_e { - /* Exeption causes that will cause jump to exception vector */ - NIOS2_EXCEPTION_INTERRUPT = 2, - NIOS2_EXCEPTION_TRAP_INST = 3, - NIOS2_EXCEPTION_UNIMPLEMENTED_INST = 4, - NIOS2_EXCEPTION_ILLEGAL_INST = 5, - NIOS2_EXCEPTION_MISALIGNED_DATA_ADDR = 6, - NIOS2_EXCEPTION_MISALIGNED_TARGET_PC = 7, - NIOS2_EXCEPTION_DIVISION_ERROR = 8, - NIOS2_EXCEPTION_SUPERVISOR_ONLY_INST_ADDR = 9, - NIOS2_EXCEPTION_SUPERVISOR_ONLY_INST = 10, - NIOS2_EXCEPTION_SUPERVISOR_ONLY_DATA_ADDR = 11, - NIOS2_EXCEPTION_TLB_MISS = 12, - NIOS2_EXCEPTION_TLB_EXECUTE_PERM_VIOLATION = 13, - NIOS2_EXCEPTION_MPU_INST_REGION_VIOLATION = 16, - - /* Exception causes that will NOT cause a jump to exception vector */ - NIOS2_EXCEPTION_RESET = 0, - NIOS2_EXCEPTION_CPU_ONLY_RESET_REQUEST = 1, - NIOS2_EXCEPTION_TLB_READ_PERM_VIOLATION = 14, - NIOS2_EXCEPTION_TLB_WRITE_PERM_VIOLATION = 15, - NIOS2_EXCEPTION_MPU_DATA_REGION_VIOLATION = 17, - /* - * This value is passed to an exception handler's cause argument if - * "extra exceptions" information (EXECPTION) register is not - * present in the processor hardware configuration. - */ - NIOS2_EXCEPTION_CAUSE_NOT_PRESENT = -1 -}; -typedef enum alt_exception_cause_e alt_exception_cause; - -/* - * These define valid return values for a user-defined instruction-generated - * exception handler. The handler should return one of these to indicate - * whether to re-issue the instruction that triggered the exception, or to - * skip it. - */ -enum alt_exception_result_e { - NIOS2_EXCEPTION_RETURN_REISSUE_INST = 0, - NIOS2_EXCEPTION_RETURN_SKIP_INST = 1 -}; -typedef enum alt_exception_result_e alt_exception_result; - -/* - * alt_instruction_exception_register() can be used to register an exception - * handler for instruction-generated exceptions that are not handled by the - * built-in exception handler (i.e. for interrupts). - * - * The registry API is optionally enabled through the "Enable - * Instruction-related Exception API" HAL BSP setting, which will - * define the macro below. - */ -#ifdef ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API -void alt_instruction_exception_register ( - alt_exception_result (*exception_handler)( - alt_exception_cause cause, - alt_u32 exception_pc, - alt_u32 bad_addr) ); -#endif /*ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API */ - -/* - * alt_exception_cause_generated_bad_addr() indicates whether a particular - * exception cause value was from an exception-type that generated a valid - * address in the BADADDR register. The contents of BADADDR is passed to - * a user-registered exception handler in all cases, whether valid or not. - * This routine should be called to validate the bad_addr argument to - * your exception handler. - */ -int alt_exception_cause_generated_bad_addr(alt_exception_cause cause); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_EXCEPTIONS_H__ */ diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_flash.h b/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_flash.h deleted file mode 100644 index 527328d..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_flash.h +++ /dev/null @@ -1,166 +0,0 @@ -#ifndef __ALT_FLASH_H__ -#define __ALT_FLASH_H__ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/****************************************************************************** -* * -* Alt_flash.h - User interface for flash code * -* * -* Use this interface to avoid being exposed to the internals of the device * -* driver architecture. If you chose to use the flash driver internal * -* structures we don't guarantee not to change them * -* * -* Author PRR * -* * -******************************************************************************/ - - - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#include "alt_types.h" -#include "alt_flash_types.h" -#include "alt_flash_dev.h" -#include "sys/alt_cache.h" - -alt_flash_fd* alt_flash_open_dev(const char* name); -void alt_flash_close_dev(alt_flash_fd* fd ); - -/* - * alt_write_flash - * - * Program a buffer into flash. - * - * This routine erases all the affected erase blocks (if necessary) - * and then programs the data. However it does not read the data out first - * and preserve and none overwritten data, because this would require very - * large buffers on the target. If you need - * that functionality use the functions below. - */ -static __inline__ int __attribute__ ((always_inline)) alt_write_flash( - alt_flash_fd* fd, - int offset, - const void* src_addr, - int length ) -{ - return fd->write( fd, offset, src_addr, length ); -} - -/* - * alt_read_flash - * - * Read a block of flash for most flashes this is just memcpy - * it's here for completeness in case we need it for some serial flash device - * - */ -static __inline__ int __attribute__ ((always_inline)) alt_read_flash( - alt_flash_fd* fd, int offset, - void* dest_addr, int length ) -{ - return fd->read( fd, offset, dest_addr, length ); -} - -/* - * alt_get_flash_info - * - * Return the information on the flash sectors. - * - */ -static __inline__ int __attribute__ ((always_inline)) alt_get_flash_info( - alt_flash_fd* fd, flash_region** info, - int* number_of_regions) -{ - return fd->get_info( fd, info, number_of_regions); -} - -/* - * alt_erase_flash_block - * - * Erase a particular erase block, pass in the offset to the start of - * the block and it's size - */ -static __inline__ int __attribute__ ((always_inline)) alt_erase_flash_block( - alt_flash_fd* fd, int offset, int length) -{ - int ret_code; - ret_code = fd->erase_block( fd, offset ); - - if(!ret_code) - alt_dcache_flush((alt_u8*)fd->base_addr + offset, length); - - return ret_code; -} - -/* - * alt_write_flash_block - * - * Write a particular flash block, block_offset is the offset - * (from the base of flash) to start of the block - * data_offset is the offset (from the base of flash) - * where you wish to start programming - * - * NB this function DOES NOT check that you are only writing a single - * block of data as that would slow down this function. - * - * Use alt_write_flash if you want that level of error checking. - */ - -static __inline__ int __attribute__ ((always_inline)) alt_write_flash_block( - alt_flash_fd* fd, int block_offset, - int data_offset, - const void *data, int length) -{ - - int ret_code; - ret_code = fd->write_block( fd, block_offset, data_offset, data, length ); - - if(!ret_code) - alt_dcache_flush((alt_u8*)fd->base_addr + data_offset, length); - - return ret_code; -} - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_FLASH_H__ */ diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_flash_dev.h b/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_flash_dev.h deleted file mode 100644 index 8bab601..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_flash_dev.h +++ /dev/null @@ -1,98 +0,0 @@ -#ifndef __ALT_FLASH_DEV_H__ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/****************************************************************************** -* * -* Alt_flash_dev.h - Generic Flash device interfaces * -* * -* Author PRR * -* * -******************************************************************************/ -#define __ALT_FLASH_DEV_H__ - -#include "alt_flash_types.h" -#include "sys/alt_llist.h" -#include "priv/alt_dev_llist.h" - -#include "alt_types.h" - -typedef struct alt_flash_dev alt_flash_dev; -typedef alt_flash_dev alt_flash_fd; - -static ALT_INLINE int alt_flash_device_register( alt_flash_fd* fd) -{ - extern alt_llist alt_flash_dev_list; - - return alt_dev_llist_insert ((alt_dev_llist*) fd, &alt_flash_dev_list); -} - -typedef alt_flash_dev* (*alt_flash_open)(alt_flash_dev* flash, - const char* name ); -typedef int (*alt_flash_close)(alt_flash_dev* flash_info); - -typedef int (*alt_flash_write)( alt_flash_dev* flash, int offset, - const void* src_addr, int length ); - -typedef int (*alt_flash_get_flash_info)( alt_flash_dev* flash, flash_region** info, - int* number_of_regions); -typedef int (*alt_flash_write_block)( alt_flash_dev* flash, int block_offset, - int data_offset, const void* data, - int length); -typedef int (*alt_flash_erase_block)( alt_flash_dev* flash, int offset); -typedef int (*alt_flash_read)(alt_flash_dev* flash, int offset, - void* dest_addr, int length ); - -struct alt_flash_dev -{ - alt_llist llist; - const char* name; - alt_flash_open open; - alt_flash_close close; - alt_flash_write write; - alt_flash_read read; - alt_flash_get_flash_info get_info; - alt_flash_erase_block erase_block; - alt_flash_write_block write_block; - void* base_addr; - int length; - int number_of_regions; - flash_region region_info[ALT_MAX_NUMBER_OF_FLASH_REGIONS]; -}; - -#endif /* __ALT_FLASH_DEV_H__ */ diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_flash_types.h b/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_flash_types.h deleted file mode 100644 index 884cbf8..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_flash_types.h +++ /dev/null @@ -1,64 +0,0 @@ -#ifndef __ALT_FLASH_TYPES_H__ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/****************************************************************************** -* * -* Alt_flash_types.h - Some generic types and defines used by the flash code * -* * -* Author PRR * -* * -******************************************************************************/ -#define __ALT_FLASH_TYPES_H__ - -#ifndef ALT_MAX_NUMBER_OF_FLASH_REGIONS -#define ALT_MAX_NUMBER_OF_FLASH_REGIONS 8 -#endif /* ALT_MAX_NUMBER_OF_FLASH_REGIONS */ - -/* - * Description of a single Erase region - */ -typedef struct flash_region -{ - int offset; - int region_size; - int number_of_blocks; - int block_size; -}flash_region; - -#endif /* __ALT_FLASH_TYPES_H__ */ diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_irq.h b/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_irq.h deleted file mode 100644 index 6666e52..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_irq.h +++ /dev/null @@ -1,245 +0,0 @@ -#ifndef __ALT_IRQ_H__ -#define __ALT_IRQ_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * alt_irq.h is the Nios II specific implementation of the interrupt controller - * interface. - * - * Nios II includes optional support for an external interrupt controller. - * When an external controller is present, the "Enhanced" interrupt API - * must be used to manage individual interrupts. The enhanced API also - * supports the processor's internal interrupt controller. Certain API - * members are accessible from either the "legacy" or "enhanced" interrpt - * API. - * - * Regardless of which API is in use, this file should be included by - * application code and device drivers that register ISRs or manage interrpts. - */ -#include - -#include "nios2.h" -#include "alt_types.h" -#include "system.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * Macros used by alt_irq_enabled - */ -#define ALT_IRQ_ENABLED 1 -#define ALT_IRQ_DISABLED 0 - -/* - * Number of available interrupts in internal interrupt controller. - */ -#define ALT_NIRQ NIOS2_NIRQ - -/* - * Used by alt_irq_disable_all() and alt_irq_enable_all(). - */ -typedef int alt_irq_context; - -/* ISR Prototype */ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT -typedef void (*alt_isr_func)(void* isr_context); -#else -typedef void (*alt_isr_func)(void* isr_context, alt_u32 id); -#endif - -/* - * The following protypes and routines are supported by both - * the enhanced and legacy interrupt APIs - */ - -/* - * alt_irq_enabled can be called to determine if the processor's global - * interrupt enable is asserted. The return value is zero if interrupts - * are disabled, and non-zero otherwise. - * - * Whether the internal or external interrupt controller is present, - * individual interrupts may still be disabled. Use the other API to query - * a specific interrupt. - */ -static ALT_INLINE int ALT_ALWAYS_INLINE alt_irq_enabled (void) -{ - int status; - - NIOS2_READ_STATUS (status); - - return status & NIOS2_STATUS_PIE_MSK; -} - -/* - * alt_irq_disable_all() - * - * This routine inhibits all interrupts by negating the status register PIE - * bit. It returns the previous contents of the CPU status register (IRQ - * context) which can be used to restore the status register PIE bit to its - * state before this routine was called. - */ -static ALT_INLINE alt_irq_context ALT_ALWAYS_INLINE - alt_irq_disable_all (void) -{ - alt_irq_context context; - - NIOS2_READ_STATUS (context); - - NIOS2_WRITE_STATUS (context & ~NIOS2_STATUS_PIE_MSK); - - return context; -} - -/* - * alt_irq_enable_all() - * - * Enable all interrupts that were previously disabled by alt_irq_disable_all() - * - * This routine accepts a context to restore the CPU status register PIE bit - * to the state prior to a call to alt_irq_disable_all(). - - * In the case of nested calls to alt_irq_disable_all()/alt_irq_enable_all(), - * this means that alt_irq_enable_all() does not necessarily re-enable - * interrupts. - * - * This routine will perform a read-modify-write sequence to restore only - * status.PIE if the processor is configured with options that add additional - * writeable status register bits. These include the MMU, MPU, the enhanced - * interrupt controller port, and shadow registers. Otherwise, as a performance - * enhancement, status is overwritten with the prior context. - */ -static ALT_INLINE void ALT_ALWAYS_INLINE - alt_irq_enable_all (alt_irq_context context) -{ -#if (NIOS2_NUM_OF_SHADOW_REG_SETS > 0) || (defined NIOS2_EIC_PRESENT) || \ - (defined NIOS2_MMU_PRESENT) || (defined NIOS2_MPU_PRESENT) - alt_irq_context status; - - NIOS2_READ_STATUS (status); - - status &= ~NIOS2_STATUS_PIE_MSK; - status |= (context & NIOS2_STATUS_PIE_MSK); - - NIOS2_WRITE_STATUS (status); -#else - NIOS2_WRITE_STATUS (context); -#endif -} - -/* - * The function alt_irq_init() is defined within the auto-generated file - * alt_sys_init.c. This function calls the initilization macros for all - * interrupt controllers in the system at config time, before any other - * non-interrupt controller driver is initialized. - * - * The "base" parameter is ignored and only present for backwards-compatibility. - * It is recommended that NULL is passed in for the "base" parameter. - */ -extern void alt_irq_init (const void* base); - -/* - * alt_irq_cpu_enable_interrupts() enables the CPU to start taking interrupts. - */ -static ALT_INLINE void ALT_ALWAYS_INLINE - alt_irq_cpu_enable_interrupts () -{ - NIOS2_WRITE_STATUS(NIOS2_STATUS_PIE_MSK -#if defined(NIOS2_EIC_PRESENT) && (NIOS2_NUM_OF_SHADOW_REG_SETS > 0) - | NIOS2_STATUS_RSIE_MSK -#endif - ); -} - - -/* - * Prototypes for the enhanced interrupt API. - */ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT -/* - * alt_ic_isr_register() can be used to register an interrupt handler. If the - * function is succesful, then the requested interrupt will be enabled upon - * return. - */ -extern int alt_ic_isr_register(alt_u32 ic_id, - alt_u32 irq, - alt_isr_func isr, - void *isr_context, - void *flags); - -/* - * alt_ic_irq_enable() and alt_ic_irq_disable() enable/disable a specific - * interrupt by using IRQ port and interrupt controller instance. - */ -int alt_ic_irq_enable (alt_u32 ic_id, alt_u32 irq); -int alt_ic_irq_disable(alt_u32 ic_id, alt_u32 irq); - - /* - * alt_ic_irq_enabled() indicates whether a specific interrupt, as - * specified by IRQ port and interrupt controller instance is enabled. - */ -alt_u32 alt_ic_irq_enabled(alt_u32 ic_id, alt_u32 irq); - -#else -/* - * Prototypes for the legacy interrupt API. - */ -#include "priv/alt_legacy_irq.h" -#endif - - -/* - * alt_irq_pending() returns a bit list of the current pending interrupts. - * This is used by alt_irq_handler() to determine which registered interrupt - * handlers should be called. - * - * This routine is only available for the Nios II internal interrupt - * controller. - */ -#ifndef NIOS2_EIC_PRESENT -static ALT_INLINE alt_u32 ALT_ALWAYS_INLINE alt_irq_pending (void) -{ - alt_u32 active; - - NIOS2_READ_IPENDING (active); - - return active; -} -#endif - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_IRQ_H__ */ diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_irq_entry.h b/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_irq_entry.h deleted file mode 100644 index e2008d9..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_irq_entry.h +++ /dev/null @@ -1,39 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * This file pulls in the IRQ entry assembler and C code, which is only - * required if there are any interruptes in the system. - */ - -__asm__( "\n\t.globl alt_irq_entry" ); - -__asm__( "\n\t.globl alt_irq_handler" ); - diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_license_reminder_ucosii.h b/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_license_reminder_ucosii.h deleted file mode 100644 index 2fe649c..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_license_reminder_ucosii.h +++ /dev/null @@ -1,77 +0,0 @@ -#ifndef __ALT_LICENSE_REMINDER_UCOSII_H__ -#define __ALT_LICENSE_REMINDER_UCOSII_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include - -#define ALT_LICENSE_REMINDER_UCOSII_STRING \ - "============== Software License Reminder ===============\n" \ - "\n" \ - "uC/OS-II is provided in source form for FREE evaluation,\n" \ - "for educational use, or for peaceful research. If you\n" \ - "plan on using uC/OS-II in a commercial product you need\n" \ - "to contact Micrium to properly license its use in your\n" \ - "product. Micrium provides ALL the source code on the\n" \ - "Altera distribution for your convenience and to help you\n" \ - "experience uC/OS-II. The fact that the source is provided\n" \ - "does NOT mean that you can use it without paying a\n" \ - "licensing fee. Please help us continue to provide the\n" \ - "Embedded community with the finest software available.\n" \ - "Your honesty is greatly appreciated.\n" \ - "\n" \ - "Please contact:\n" \ - "\n" \ - "M I C R I U M\n" \ - "949 Crestview Circle\n" \ - "Weston, FL 33327-1848\n" \ - "U.S.A.\n" \ - "\n" \ - "Phone : +1 954 217 2036\n" \ - "FAX : +1 954 217 2037\n" \ - "WEB : www.micrium.com\n" \ - "E-mail: Sales@Micrium.com\n" \ - "\n" \ - "========================================================\n" - -#define alt_license_reminder_ucosii() puts(ALT_LICENSE_REMINDER_UCOSII_STRING) - - -#endif /* __ALT_LICENSE_REMINDER_UCOSII_H__ */ - diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_llist.h b/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_llist.h deleted file mode 100644 index 46f81ce..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_llist.h +++ /dev/null @@ -1,123 +0,0 @@ -#ifndef __ALT_LIST_H__ -#define __ALT_LIST_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "alt_types.h" - -/* - * alt_llist.h defines structures and functions for use in manipulating linked - * lists. A list is considered to be constructed from a chain of objects of - * type alt_llist, with one object being defined to be the head element. - * - * A list is considered to be empty if it only contains the head element. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * alt_llist is the structure used to represent an element within a linked - * list. - */ - -typedef struct alt_llist_s alt_llist; - -struct alt_llist_s { - alt_llist* next; /* Pointer to the next element in the list. */ - alt_llist* previous; /* Pointer to the previous element in the list. */ -}; - -/* - * ALT_LLIST_HEAD is a macro that can be used to create the head of a new - * linked list. This is named "head". The head element is initialised to - * represent an empty list. - */ - -#define ALT_LLIST_HEAD(head) alt_llist head = {&head, &head} - -/* - * ALT_LLIST_ENTRY is a macro used to define an uninitialised linked list - * entry. This is used to reserve space in structure initialisation for - * structures that inherit form alt_llist. - */ - -#define ALT_LLIST_ENTRY {0, 0} - -/* - * alt_llist_insert() insert adds the linked list entry "entry" as the - * first entry in the linked list "list". "list" is the list head element. - */ - -static ALT_INLINE void ALT_ALWAYS_INLINE alt_llist_insert(alt_llist* list, - alt_llist* entry) -{ - entry->previous = list; - entry->next = list->next; - - list->next->previous = entry; - list->next = entry; -} - -/* - * alt_llist_remove() is called to remove an element from a linked list. The - * input argument is the element to remove. - */ - -static ALT_INLINE void ALT_ALWAYS_INLINE alt_llist_remove(alt_llist* entry) -{ - entry->next->previous = entry->previous; - entry->previous->next = entry->next; - - /* - * Set the entry to point to itself, so that any further calls to - * alt_llist_remove() are harmless. - */ - - entry->previous = entry; - entry->next = entry; -} - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_LLIST_H__ */ diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_load.h b/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_load.h deleted file mode 100644 index 432e9f2..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_load.h +++ /dev/null @@ -1,78 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "alt_types.h" - -/* - * This macro is used to load code/data from its load address to its - * execution address for a given section. The section name is the input - * argument. Note that a leading '.' is assumed in the name. For example - * to load the section .onchip_ram, use: - * - * ALT_LOAD_SECTION_BY_NAME(onchip_ram); - * - * This requires that the apropriate linker symbols have been generated - * for the section in question. This will be the case if you are using the - * default linker script. - */ - -#define ALT_LOAD_SECTION_BY_NAME(name) \ - { \ - extern void _alt_partition_##name##_start; \ - extern void _alt_partition_##name##_end; \ - extern void _alt_partition_##name##_load_addr; \ - \ - alt_load_section(&_alt_partition_##name##_load_addr, \ - &_alt_partition_##name##_start, \ - &_alt_partition_##name##_end); \ - } - -/* - * Function used to load an individual section from flash to RAM. - * - * There is an implicit assumption here that the linker script will ensure - * that all sections are word aligned. - * - */ - -static void ALT_INLINE alt_load_section (alt_u32* from, - alt_u32* to, - alt_u32* end) -{ - if (to != from) - { - while( to != end ) - { - *to++ = *from++; - } - } -} diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_log_printf.h b/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_log_printf.h deleted file mode 100644 index c15ca05..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_log_printf.h +++ /dev/null @@ -1,349 +0,0 @@ -/* alt_log_printf.h - * - * ALT_LOG is designed to provide extra logging/debugging messages from HAL - * through a different port than stdout. It is enabled by the ALT_LOG_ENABLE - * define, which needs to supplied at compile time. When logging is turned off, - * code size is unaffected. Thus, this should be transparent to the user - * when it is not actively turned on, and should not affect projects in any way. - * - * There are macros sprinkled within different components, such as the jtag uart - * and timer, in the HAL code. They are always named ALT_LOG_, and can be - * safely ignored if ALT_LOG is turned off. - * - * To turn on ALT_LOG, ALT_LOG_ENABLE must be defined, and ALT_LOG_PORT_TYPE and - * ALT_LOG_PORT_BASE must be set in system.h. This is done through editing - * .ptf, by editing the alt_log_port_type & alt_log_port_base settings. - * See the documentation html file for examples. - * - * When it is turned on, it will output extra HAL messages to a port specified - * in system.h. This can be a UART or JTAG UART port. By default it will - * output boot messages, detailing every step of the boot process. - * - * Extra logging is designed to be enabled by flags, which are defined in - * alt_log_printf.c. The default value is that all flags are off, so only the - * boot up logging messages show up. ALT_LOG_FLAGS can be set to enable certain - * groupings of flags, and that grouping is done in this file. Each flag can - * also be overridden with a -D at compile time. - * - * This header file includes the necessary prototypes for using the alt_log - * functions. It also contains all the macros that are used to remove the code - * from alt log is turned off. Also, the macros in other HAL files are defined - * here at the bottom. These macros all call some C function that is in - * alt_log_printf.c. - * - * The logging has functions for printing in C (ALT_LOG_PRINTF) and in assembly - * (ALT_LOG_PUTS). This was needed because the assembly printing occurs before - * the device is initialized. The assembly function corrupts register R4-R7, - * which are not used in the normal boot process. For this reason, do not call - * the assembly function in C. - * - * author: gkwan - */ - - -#ifndef __ALT_LOG_PRINTF_H__ -#define __ALT_LOG_PRINTF_H__ - -#include - -/* Global switch to turn on logging functions */ -#ifdef ALT_LOG_ENABLE - - /* ALT_LOG_PORT_TYPE values as defined in system.h. They are defined as - * numbers here first becasue the C preprocessor does not handle string - * comparisons. */ - #define ALTERA_AVALON_JTAG_UART 1 - #define ALTERA_AVALON_UART 0 - - /* If this .h file is included by an assembly file, skip over include files - * that won't compile in assembly. */ - #ifndef ALT_ASM_SRC - #include - #include "sys/alt_alarm.h" - #include "sys/alt_dev.h" - #ifdef __ALTERA_AVALON_JTAG_UART - #include "altera_avalon_jtag_uart.h" - #endif - #endif /* ALT_ASM_SRC */ - - /* These are included for the port register offsets and masks, needed - * to write to the port. Only include if the port type is set correctly, - * otherwise error. If alt_log is turned on and the port to output to is - * incorrect or does not exist, then should exit. */ - #if ALT_LOG_PORT_TYPE == ALTERA_AVALON_JTAG_UART - #ifdef __ALTERA_AVALON_JTAG_UART - #include - #else - #error ALT_LOG: JTAG_UART port chosen, but no JTAG_UART in system. - #endif - #elif ALT_LOG_PORT_TYPE == ALTERA_AVALON_UART - #ifdef __ALTERA_AVALON_UART - #include - #else - #error ALT_LOG: UART Port chosen, but no UART in system. - #endif - #else - #error ALT_LOG: alt_log_port_type declaration invalid! - #endif - - /* ALT_LOG_ENABLE turns on the basic printing function */ - #define ALT_LOG_PRINTF(...) do {alt_log_printf_proc(__VA_ARGS__);} while (0) - - /* Assembly macro for printing in assembly, calls tx_log_str - * which is in alt_log_macro.S. - * If alt_log_boot_on_flag is 0, skips the printing */ - #define ALT_LOG_PUTS(str) movhi r4, %hiadj(alt_log_boot_on_flag) ; \ - addi r4, r4, %lo(alt_log_boot_on_flag) ; \ - ldwio r5, 0(r4) ; \ - beq r0, r5, 0f ; \ - movhi r4, %hiadj(str) ; \ - addi r4, r4, %lo(str) ; \ - call tx_log_str ; \ - 0: - - /* These defines are here to faciliate the use of one output function - * (alt_log_txchar) to print to both the JTAG UART or the UART. Depending - * on the port type, the status register, read mask, and output register - * are set to the appropriate value for the port. */ - #if ALT_LOG_PORT_TYPE == ALTERA_AVALON_JTAG_UART - #define ALT_LOG_PRINT_REG_RD IORD_ALTERA_AVALON_JTAG_UART_CONTROL - #define ALT_LOG_PRINT_MSK ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_MSK - #define ALT_LOG_PRINT_TXDATA_WR IOWR_ALTERA_AVALON_JTAG_UART_DATA - #define ALT_LOG_PRINT_REG_OFFSET (ALTERA_AVALON_JTAG_UART_CONTROL_REG*0x4) - #define ALT_LOG_PRINT_TXDATA_REG_OFFSET (ALTERA_AVALON_JTAG_UART_DATA_REG*0x4) - #elif ALT_LOG_PORT_TYPE == ALTERA_AVALON_UART - #define ALT_LOG_PRINT_REG_RD IORD_ALTERA_AVALON_UART_STATUS - #define ALT_LOG_PRINT_MSK ALTERA_AVALON_UART_STATUS_TRDY_MSK - #define ALT_LOG_PRINT_TXDATA_WR IOWR_ALTERA_AVALON_UART_TXDATA - #define ALT_LOG_PRINT_REG_OFFSET (ALTERA_AVALON_UART_STATUS_REG*0x4) - #define ALT_LOG_PRINT_TXDATA_REG_OFFSET (ALTERA_AVALON_UART_TXDATA_REG*0x4) - #endif /* ALT_LOG_PORT */ - - /* Grouping of flags via ALT_LOG_FLAGS. Each specific flag can be set via - * -D at compile time, or else they'll be set to a default value according - * to ALT_LOG_FLAGS. ALT_LOG_FLAGS = 0 or not set is the default, where - * only the boot messages will be printed. As ALT_LOG_FLAGS increase, they - * increase in intrusiveness to the program, and will affect performance. - * - * Flag Level 1 - turns on system clock and JTAG UART startup status - * 2 - turns on write echo and JTAG_UART alarm (periodic report) - * 3 - turns on JTAG UART ISR logging - will slow performance - * significantly. - * -1 - All logging output is off, but if ALT_LOG_ENABLE is - * defined all logging function is built and code size - * remains constant - * - * Flag settings - 1 = on, 0 = off. */ - - /* This flag turns on "boot" messages for printing. This includes messages - * during crt0.S, then alt_main, and finally alt_exit. */ - #ifndef ALT_LOG_BOOT_ON_FLAG_SETTING - #if ALT_LOG_FLAGS == 1 - #define ALT_LOG_BOOT_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 2 - #define ALT_LOG_BOOT_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 3 - #define ALT_LOG_BOOT_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == -1 /* silent mode */ - #define ALT_LOG_BOOT_ON_FLAG_SETTING 0x0 - #else /* default setting */ - #define ALT_LOG_BOOT_ON_FLAG_SETTING 0x1 - #endif - #endif /* ALT_LOG_BOOT_ON_FLAG_SETTING */ - - #ifndef ALT_LOG_SYS_CLK_ON_FLAG_SETTING - #if ALT_LOG_FLAGS == 1 - #define ALT_LOG_SYS_CLK_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 2 - #define ALT_LOG_SYS_CLK_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 3 - #define ALT_LOG_SYS_CLK_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == -1 /* silent mode */ - #define ALT_LOG_SYS_CLK_ON_FLAG_SETTING 0x0 - #else /* default setting */ - #define ALT_LOG_SYS_CLK_ON_FLAG_SETTING 0x0 - #endif - #endif /* ALT_LOG_SYS_CLK_ON_FLAG_SETTING */ - - #ifndef ALT_LOG_WRITE_ON_FLAG_SETTING - #if ALT_LOG_FLAGS == 1 - #define ALT_LOG_WRITE_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 2 - #define ALT_LOG_WRITE_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 3 - #define ALT_LOG_WRITE_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == -1 /* silent mode */ - #define ALT_LOG_WRITE_ON_FLAG_SETTING 0x0 - #else /* default setting */ - #define ALT_LOG_WRITE_ON_FLAG_SETTING 0x0 - #endif - #endif /* ALT_LOG_WRITE_ON_FLAG_SETTING */ - - #ifndef ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING - #ifndef __ALTERA_AVALON_JTAG_UART - #define ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 1 - #define ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 2 - #define ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 3 - #define ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == -1 /* silent mode */ - #define ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING 0x0 - #else /* default setting */ - #define ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING 0x0 - #endif - #endif /* ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING */ - - #ifndef ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING - #ifndef __ALTERA_AVALON_JTAG_UART - #define ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 1 - #define ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 2 - #define ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 3 - #define ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == -1 /* silent mode */ - #define ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING 0x0 - #else /* default setting */ - #define ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING 0x0 - #endif - #endif /* ALT_LOG_JTAG_UART_STARTUP_INFO_FLAG_SETTING */ - - #ifndef ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING - #ifndef __ALTERA_AVALON_JTAG_UART - #define ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 1 - #define ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 2 - #define ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 3 - #define ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == -1 /* silent mode */ - #define ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING 0x0 - #else /* default setting */ - #define ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING 0x0 - #endif - #endif /* ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING */ - -#ifndef ALT_ASM_SRC - /* Function Prototypes */ - void alt_log_txchar(int c,char *uartBase); - void alt_log_private_printf(const char *fmt,int base,va_list args); - void alt_log_repchar(char c,int r,int base); - int alt_log_printf_proc(const char *fmt, ... ); - void alt_log_system_clock(); - #ifdef __ALTERA_AVALON_JTAG_UART - alt_u32 altera_avalon_jtag_uart_report_log(void * context); - void alt_log_jtag_uart_startup_info(altera_avalon_jtag_uart_state* dev, int base); - void alt_log_jtag_uart_print_control_reg(altera_avalon_jtag_uart_state* dev, \ - int base, const char* header); - void alt_log_jtag_uart_isr_proc(int base, altera_avalon_jtag_uart_state* dev); - #endif - void alt_log_write(const void *ptr, size_t len); - - /* extern all global variables */ - extern volatile alt_u32 alt_log_boot_on_flag; - extern volatile alt_u8 alt_log_write_on_flag; - extern volatile alt_u8 alt_log_sys_clk_on_flag; - extern volatile alt_u8 alt_log_jtag_uart_alarm_on_flag; - extern volatile alt_u8 alt_log_jtag_uart_isr_on_flag; - extern volatile alt_u8 alt_log_jtag_uart_startup_info_on_flag; - extern volatile int alt_log_sys_clk_count; - extern volatile int alt_system_clock_in_sec; - extern alt_alarm alt_log_jtag_uart_alarm_1; -#endif /* ALT_ASM_SRC */ - - - /* Below are the MACRO defines used in various HAL files. They check - * if their specific flag is turned on; if it is, then it executes its - * code. - * - * To keep this file reasonable, most of these macros calls functions, - * which are defined in alt_log_printf.c. Look there for implementation - * details. */ - - /* Boot Messages Logging */ - #define ALT_LOG_PRINT_BOOT(...) \ - do { if (alt_log_boot_on_flag==1) {ALT_LOG_PRINTF(__VA_ARGS__);} \ - } while (0) - - /* JTAG UART Logging */ - /* number of ticks before alarm runs logging function */ - #ifndef ALT_LOG_JTAG_UART_TICKS_DIVISOR - #define ALT_LOG_JTAG_UART_TICKS_DIVISOR 10 - #endif - #ifndef ALT_LOG_JTAG_UART_TICKS - #define ALT_LOG_JTAG_UART_TICKS \ - (alt_ticks_per_second()/ALT_LOG_JTAG_UART_TICKS_DIVISOR) - #endif - - /* if there's a JTAG UART defined, then enable these macros */ - #ifdef __ALTERA_AVALON_JTAG_UART - - /* Macro in altera_avalon_jtag_uart.c, to register the alarm function. - * Also, the startup register info is also printed here, as this is - * called within the device driver initialization. */ - #define ALT_LOG_JTAG_UART_ALARM_REGISTER(dev, base) \ - do { if (alt_log_jtag_uart_alarm_on_flag==1) { \ - alt_alarm_start(&alt_log_jtag_uart_alarm_1, \ - ALT_LOG_JTAG_UART_TICKS, &altera_avalon_jtag_uart_report_log,\ - dev);} \ - if (alt_log_jtag_uart_startup_info_on_flag==1) {\ - alt_log_jtag_uart_startup_info(dev, base);} \ - } while (0) - - /* JTAG UART IRQ Logging (when buffer is empty) - * Inserted in the ISR in altera_avalon_jtag_uart.c */ - #define ALT_LOG_JTAG_UART_ISR_FUNCTION(base, dev) \ - do { alt_log_jtag_uart_isr_proc(base, dev); } while (0) - /* else, define macros to nothing. Or else the jtag_uart specific types - * will throw compiler errors */ - #else - #define ALT_LOG_JTAG_UART_ALARM_REGISTER(dev, base) - #define ALT_LOG_JTAG_UART_ISR_FUNCTION(base, dev) - #endif - - /* System clock logging - * How often (in seconds) the system clock logging prints. - * The default value is every 1 second */ - #ifndef ALT_LOG_SYS_CLK_INTERVAL_MULTIPLIER - #define ALT_LOG_SYS_CLK_INTERVAL_MULTIPLIER 1 - #endif - #ifndef ALT_LOG_SYS_CLK_INTERVAL - #define ALT_LOG_SYS_CLK_INTERVAL \ - (alt_ticks_per_second()*ALT_LOG_SYS_CLK_INTERVAL_MULTIPLIER) - #endif - - /* System clock logging - prints a message every interval (set above) - * to show that the system clock is alive. - * This macro is used in altera_avalon_timer_sc.c */ - #define ALT_LOG_SYS_CLK_HEARTBEAT() \ - do { alt_log_system_clock(); } while (0) - - /* alt_write_logging - echos a message every time write() is called, - * displays the first ALT_LOG_WRITE_ECHO_LEN characters. - * This macro is used in alt_write.c */ - #ifndef ALT_LOG_WRITE_ECHO_LEN - #define ALT_LOG_WRITE_ECHO_LEN 15 - #endif - - #define ALT_LOG_WRITE_FUNCTION(ptr,len) \ - do { alt_log_write(ptr,len); } while (0) - -#else /* ALT_LOG_ENABLE not defined */ - - /* logging is off, set all relevant macros to null */ - #define ALT_LOG_PRINT_BOOT(...) - #define ALT_LOG_PRINTF(...) - #define ALT_LOG_JTAG_UART_ISR_FUNCTION(base, dev) - #define ALT_LOG_JTAG_UART_ALARM_REGISTER(dev, base) - #define ALT_LOG_SYS_CLK_HEARTBEAT() - #define ALT_LOG_PUTS(str) - #define ALT_LOG_WRITE_FUNCTION(ptr,len) - -#endif /* ALT_LOG_ENABLE */ - -#endif /* __ALT_LOG_PRINTF_H__ */ - diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_set_args.h b/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_set_args.h deleted file mode 100644 index 3750e67..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_set_args.h +++ /dev/null @@ -1,71 +0,0 @@ -#ifndef __ALT_SET_ARGS_H__ -#define __ALT_SET_ARGS_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The function alt_set_args() is provided in order to define the input - * arguments to main(). If this function is not called before main() then the - * argument list passed to main() will be empty. - * - * It is expected that this function will only be used by the ihost/iclient - * utility. - */ - -static inline void alt_set_args (int argc, char** argv, char** envp) -{ - extern int alt_argc; - extern char** alt_argv; - extern char** alt_envp; - - alt_argc = argc; - alt_argv = argv; - alt_envp = envp; -} - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_SET_ARGS_H__ */ diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_sim.h b/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_sim.h deleted file mode 100644 index 06bd27a..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_sim.h +++ /dev/null @@ -1,91 +0,0 @@ -#ifndef __ALT_SIM_H__ -#define __ALT_SIM_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ -#include "system.h" -#include "alt_types.h" - -/* - * Instructions that might mean something special to a simulator. - * These have no special effect on real hardware (they are just nops). - */ -#define ALT_SIM_FAIL() \ - do { __asm volatile ("cmpltui r0, r0, 0xabc1"); } while (0) - -#define ALT_SIM_PASS() \ - do { __asm volatile ("cmpltui r0, r0, 0xabc2"); } while (0) - -#define ALT_SIM_IN_TOP_OF_HOT_LOOP() \ - do { __asm volatile ("cmpltui r0, r0, 0xabc3"); } while (0) - -/* - * Routine called on exit. - */ -static ALT_ALWAYS_INLINE void alt_sim_halt(int exit_code) -{ - int r2 = exit_code; - -#if defined(NIOS2_HAS_DEBUG_STUB) && (defined(ALT_BREAK_ON_EXIT) || defined(ALT_PROVIDE_GMON)) - - int r3 = (1 << 2); - -#ifdef ALT_PROVIDE_GMON - extern unsigned int alt_gmon_data[]; - int r4 = (int)alt_gmon_data; - r3 |= (1 << 4); -#define ALT_GMON_DATA ,"D04"(r4) -#else -#define ALT_GMON_DATA -#endif /* ALT_PROVIDE_GMON */ - - if (r2) { - ALT_SIM_FAIL(); - } else { - ALT_SIM_PASS(); - } - - __asm__ volatile ("\n0:\n\taddi %0,%0, -1\n\tbgt %0,zero,0b" : : "r" (ALT_CPU_FREQ/100) ); /* Delay for >30ms */ - - __asm__ volatile ("break 2" : : "D02"(r2), "D03"(r3) ALT_GMON_DATA ); - -#else /* !DEBUG_STUB */ - if (r2) { - ALT_SIM_FAIL(); - } else { - ALT_SIM_PASS(); - } -#endif /* DEBUG_STUB */ -} - -#define ALT_SIM_HALT(exit_code) \ - alt_sim_halt(exit_code) - -#endif /* __ALT_SIM_H__ */ diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_stack.h b/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_stack.h deleted file mode 100644 index e30652a..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_stack.h +++ /dev/null @@ -1,126 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#ifndef __ALT_STACK_H__ -#define __ALT_STACK_H__ - -/* - * alt_stack.h is the nios2 specific implementation of functions used by the - * stack overflow code. - */ - -#include "nios2.h" - -#include "alt_types.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - - -extern char * alt_stack_limit_value; - -#ifdef ALT_EXCEPTION_STACK -extern char __alt_exception_stack_pointer[]; /* set by the linker */ -#endif /* ALT_EXCEPTION_STACK */ - - -/* - * alt_stack_limit can be called to determine the current value of the stack - * limit register. - */ - -static ALT_INLINE char * ALT_ALWAYS_INLINE alt_stack_limit (void) -{ - char * limit; - NIOS2_READ_ET(limit); - - return limit; -} - -/* - * alt_stack_pointer can be called to determine the current value of the stack - * pointer register. - */ - -static ALT_INLINE char * ALT_ALWAYS_INLINE alt_stack_pointer (void) -{ - char * pointer; - NIOS2_READ_SP(pointer); - - return pointer; -} - - -#ifdef ALT_EXCEPTION_STACK - -/* - * alt_exception_stack_pointer returns the normal stack pointer from - * where it is stored on the exception stack (uppermost 4 bytes). This - * is really only useful during exception processing, and is only - * available if a separate exception stack has been configured. - */ - -static ALT_INLINE char * ALT_ALWAYS_INLINE alt_exception_stack_pointer (void) -{ - return (char *) *(alt_u32 *)(__alt_exception_stack_pointer - sizeof(alt_u32)); -} - -#endif /* ALT_EXCEPTION_STACK */ - - -/* - * alt_set_stack_limit can be called to update the current value of the stack - * limit register. - */ - -static ALT_INLINE void ALT_ALWAYS_INLINE alt_set_stack_limit (char * limit) -{ - alt_stack_limit_value = limit; - NIOS2_WRITE_ET(limit); -} - -/* - * alt_report_stack_overflow reports that a stack overflow happened. - */ - -static ALT_INLINE void ALT_ALWAYS_INLINE alt_report_stack_overflow (void) -{ - NIOS2_REPORT_STACK_OVERFLOW(); -} - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_STACK_H__ */ - diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_stdio.h b/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_stdio.h deleted file mode 100644 index 1730360..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_stdio.h +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef __ALT_STDIO_H__ -#define __ALT_STDIO_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * Definitions for ALT stdio routines. - */ - -#include - - -#ifdef __cplusplus -extern "C" { -#endif - -int alt_getchar(); -int alt_putchar(int c); -int alt_putstr(const char* str); -void alt_printf(const char *fmt, ...); - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_STDIO_H__ */ diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_sys_init.h b/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_sys_init.h deleted file mode 100644 index e4abc28..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_sys_init.h +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef __ALT_SYS_INIT_H__ -#define __ALT_SYS_INIT_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The function alt_sys_init() is defined within the auto-generated file: - * alt_sys_init.c. This function calls the initilisation macros for all - * devices, file systems, and software components within the system. - * - * The list of initilisation macros to use is constructed using the PTF and - * STF files associated with the system. - */ - -extern void alt_sys_init (void); - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_SYS_INIT_H__ */ diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_sys_wrappers.h b/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_sys_wrappers.h deleted file mode 100644 index 044833b..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_sys_wrappers.h +++ /dev/null @@ -1,100 +0,0 @@ -#ifndef __ALT_SYS_WRAPPERS_H__ -#define __ALT_SYS_WRAPPERS_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * This file provides the prototypes for the HAL 'UNIX style functions. The - * names of these functions are defined in alt_syscall.h. THese are defined to - * be the standard names when running the standalone HAL, e.g. open(), close() - * etc., but the names may be redefined as a part of an operating system port - * in order to avoid name clashes. - */ - -#include "os/alt_syscall.h" - -#include -#include -#include -#include -#include -#include - -extern int ALT_CLOSE (int __fd); -extern int ALT_EXECVE (const char *__path, - char * const __argv[], - char * const __envp[]); -extern void ALT_EXIT (int __status); -extern int ALT_FSTAT (int file, struct stat *st); -extern int ALT_FCNTL (int file, int cmd, ...); -extern pid_t ALT_FORK (void); -extern pid_t ALT_GETPID (void); - -#if defined (__GNUC__) && __GNUC__ >= 4 -extern int ALT_GETTIMEOFDAY (struct timeval *ptimeval, - void *ptimezone); -#else -extern int ALT_GETTIMEOFDAY (struct timeval *ptimeval, - struct timezone *ptimezone); -#endif - -extern int ALT_IOCTL (int file, int req, void* arg); -extern int ALT_ISATTY (int file); -extern int ALT_KILL (int pid, int sig); -extern int ALT_LINK (const char *existing, const char *new); -extern off_t ALT_LSEEK (int file, off_t ptr, int dir); -extern int ALT_OPEN (const char* file, int flags, ...); -extern int ALT_READ (int file, void *ptr, size_t len); -extern int ALT_RENAME (char *existing, char *new); -extern void* ALT_SBRK (ptrdiff_t incr); -extern int ALT_SETTIMEOFDAY (const struct timeval *t, - const struct timezone *tz); -extern int ALT_STAT (const char *file, struct stat *st); -extern clock_t ALT_TIMES (struct tms *buf); -extern int ALT_UNLINK (const char *name); - -#if defined (__GNUC__) && __GNUC__ >= 4 -int ALT_USLEEP (useconds_t us); -#else -unsigned int ALT_USLEEP (unsigned int us); -#endif - -extern int ALT_WAIT (int *status); -extern int ALT_WRITE (int file, const void *ptr, size_t len); - - -extern char** ALT_ENVIRON; - -/* - * - */ - -#endif /* __ALT_SYS_WRAPPERS_H__ */ diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_timestamp.h b/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_timestamp.h deleted file mode 100644 index 8a18da2..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_timestamp.h +++ /dev/null @@ -1,60 +0,0 @@ -#ifndef __ALT_TIMESTAMP_H__ -#define __ALT_TIMESTAMP_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "alt_types.h" -#include "altera_avalon_timer.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -extern int alt_timestamp_start (void); - -extern alt_timestamp_type alt_timestamp (void); - -extern alt_u32 alt_timestamp_freq (void); - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_TIMESTAMP_H__ */ diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_warning.h b/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_warning.h deleted file mode 100644 index b66e71a..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/alt_warning.h +++ /dev/null @@ -1,75 +0,0 @@ -#ifndef __WARNING_H__ -#define __WARNING_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * alt_warning.h provides macro definitions that can be used to generate link - * time warnings. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The symbol "__alt_invalid" is used to force a link error. There should be - * no corresponding implementation of this function. - */ - -extern void __alt_invalid (void); - -#define ALT_LINK_WARNING(symbol, msg) \ - __asm__(".ifndef __evoke_link_warning_" #symbol \ - "\n\t .section .gnu.warning." #symbol \ - "\n__evoke_link_warning_" #symbol ":\n\t .string \x22" msg "\x22 \n\t .previous" \ - "\n .endif"); - -/* A canned warning for sysdeps/stub functions. */ - -#define ALT_STUB_WARNING(name) \ - ALT_LINK_WARNING (name, \ - "warning: " #name " is not implemented and will always fail") - -#define ALT_OBSOLETE_FUNCTION_WARNING(name) \ - ALT_LINK_WARNING (name, \ - "warning: " #name " is a deprecated function") - -#define ALT_LINK_ERROR(msg) \ - ALT_LINK_WARNING (__alt_invalid, msg); \ - __alt_invalid() - -#ifdef __cplusplus -} -#endif - -#endif /* __WARNING_H__ */ diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/ioctl.h b/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/ioctl.h deleted file mode 100644 index 4d565df..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/ioctl.h +++ /dev/null @@ -1,90 +0,0 @@ -#ifndef __IOCTL_H__ -#define __IOCTL_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The ioctl() system call be used to initiate a variety of control operations - * on a file descriptor. For the most part this simply translates to a call to - * the ioctl() function of the associated device driver (TIOCEXCL and - * TIOCNXCL are notable exceptions - see ioctl.c for details). - * - * The interpretation of the ioctl requests are therefore device specific. - * - * This function is equivalent to the standard Posix ioctl() call. - */ - -extern int ioctl (int fd, int req, void* arg); - -/* - * list of ioctl calls handled by the system ioctl implementation. - */ - -#define TIOCEXCL 0x740d /* exclusive use of the device */ -#define TIOCNXCL 0x740e /* allow multiple use of the device */ - -/* - * ioctl calls which can be handled by device drivers. - */ - -#define TIOCOUTQ 0x7472 /* get output queue size */ -#define TIOCMGET 0x741d /* get termios flags */ -#define TIOCMSET 0x741a /* set termios flags */ - -/* - * ioctl calls specific to JTAG UART. - */ - -#define TIOCSTIMEOUT 0x6a01 /* Set Timeout before assuming no host present */ -#define TIOCGCONNECTED 0x6a02 /* Get indication of whether host is connected */ - -/* - * - */ - -#ifdef __cplusplus -} -#endif - -#endif /* __IOCTL_H__ */ diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/termios.h b/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/termios.h deleted file mode 100644 index cd09539..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/inc/sys/termios.h +++ /dev/null @@ -1,181 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * This is the termios.h file provided with newlib. The only modification has - * been to the baud rate macro definitions, and an increase in the size of the - * termios structure to accomodate this. - */ - - -#ifndef _SYS_TERMIOS_H -# define _SYS_TERMIOS_H - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -# define _XCGETA (('x'<<8)|1) -# define _XCSETA (('x'<<8)|2) -# define _XCSETAW (('x'<<8)|3) -# define _XCSETAF (('x'<<8)|4) -# define _TCSBRK (('T'<<8)|5) -# define _TCFLSH (('T'<<8)|7) -# define _TCXONC (('T'<<8)|6) - -# define TCOOFF 0 -# define TCOON 1 -# define TCIOFF 2 -# define TCION 3 - -# define TCIFLUSH 0 -# define TCOFLUSH 1 -# define TCIOFLUSH 2 - -# define NCCS 13 - -# define TCSAFLUSH _XCSETAF -# define TCSANOW _XCSETA -# define TCSADRAIN _XCSETAW -# define TCSADFLUSH _XCSETAF - -# define IGNBRK 000001 -# define BRKINT 000002 -# define IGNPAR 000004 -# define INPCK 000020 -# define ISTRIP 000040 -# define INLCR 000100 -# define IGNCR 000200 -# define ICRNL 000400 -# define IXON 002000 -# define IXOFF 010000 - -# define OPOST 000001 -# define OCRNL 000004 -# define ONLCR 000010 -# define ONOCR 000020 -# define TAB3 014000 - -# define CLOCAL 004000 -# define CREAD 000200 -# define CSIZE 000060 -# define CS5 0 -# define CS6 020 -# define CS7 040 -# define CS8 060 -# define CSTOPB 000100 -# define HUPCL 002000 -# define PARENB 000400 -# define PAODD 001000 - -#define CCTS_OFLOW 010000 -#define CRTS_IFLOW 020000 -#define CRTSCTS (CCTS_OFLOW | CRTS_IFLOW) - -# define ECHO 0000010 -# define ECHOE 0000020 -# define ECHOK 0000040 -# define ECHONL 0000100 -# define ICANON 0000002 -# define IEXTEN 0000400 /* anybody know *what* this does?! */ -# define ISIG 0000001 -# define NOFLSH 0000200 -# define TOSTOP 0001000 - -# define VEOF 4 /* also VMIN -- thanks, AT&T */ -# define VEOL 5 /* also VTIME -- thanks again */ -# define VERASE 2 -# define VINTR 0 -# define VKILL 3 -# define VMIN 4 /* also VEOF */ -# define VQUIT 1 -# define VSUSP 10 -# define VTIME 5 /* also VEOL */ -# define VSTART 11 -# define VSTOP 12 - -# define B0 0 -# define B50 50 -# define B75 75 -# define B110 110 -# define B134 134 -# define B150 150 -# define B200 200 -# define B300 300 -# define B600 600 -# define B1200 1200 -# define B1800 1800 -# define B2400 2400 -# define B4800 4800 -# define B9600 9600 -# define B19200 19200 -# define B38400 38400 -# define B57600 57600 -# define B115200 115200 - -typedef unsigned char cc_t; -typedef unsigned short tcflag_t; -typedef unsigned long speed_t; - -struct termios { - tcflag_t c_iflag; - tcflag_t c_oflag; - tcflag_t c_cflag; - tcflag_t c_lflag; - char c_line; - cc_t c_cc[NCCS]; - speed_t c_ispeed; - speed_t c_ospeed; -}; - -# ifndef _NO_MACROS - -# define cfgetospeed(tp) ((tp)->c_ospeed) -# define cfgetispeed(tp) ((tp)->c_ispeed) -# define cfsetospeed(tp,s) (((tp)->c_ospeed = (s)), 0) -# define cfsetispeed(tp,s) (((tp)->c_ispeed = (s)), 0) -# define tcdrain(fd) _ioctl (fd, _TCSBRK, 1) -# endif /* _NO_MACROS */ - -#ifdef __cplusplus -} -#endif - -#endif /* _SYS_TERMIOS_H */ - diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_alarm_start.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_alarm_start.c deleted file mode 100644 index 7739959..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_alarm_start.c +++ /dev/null @@ -1,112 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "sys/alt_alarm.h" -#include "sys/alt_irq.h" - -/* - * alt_alarm_start is called to register an alarm with the system. The - * "alarm" structure passed as an input argument does not need to be - * initialised by the user. This is done within this function. - * - * The remaining input arguments are: - * - * nticks - The time to elapse until the alarm executes. This is specified in - * system clock ticks. - * callback - The function to run when the indicated time has elapsed. - * context - An opaque value, passed to the callback function. -* - * Care should be taken when defining the callback function since it is - * likely to execute in interrupt context. In particular, this mean that - * library calls like printf() should not be made, since they can result in - * deadlock. - * - * The interval to be used for the next callback is the return - * value from the callback function. A return value of zero indicates that the - * alarm should be unregistered. - * - * alt_alarm_start() will fail if the timer facility has not been enabled - * (i.e. there is no system clock). Failure is indicated by a negative return - * value. - */ - -int alt_alarm_start (alt_alarm* alarm, alt_u32 nticks, - alt_u32 (*callback) (void* context), - void* context) -{ - alt_irq_context irq_context; - alt_u32 current_nticks = 0; - - if (alt_ticks_per_second ()) - { - if (alarm) - { - alarm->callback = callback; - alarm->context = context; - - irq_context = alt_irq_disable_all (); - - current_nticks = alt_nticks(); - - alarm->time = nticks + current_nticks + 1; - - /* - * If the desired alarm time causes a roll-over, set the rollover - * flag. This will prevent the subsequent tick event from causing - * an alarm too early. - */ - if(alarm->time < current_nticks) - { - alarm->rollover = 1; - } - else - { - alarm->rollover = 0; - } - - alt_llist_insert (&alt_alarm_list, &alarm->llist); - alt_irq_enable_all (irq_context); - - return 0; - } - else - { - return -EINVAL; - } - } - else - { - return -ENOTSUP; - } -} diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_busy_sleep.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_busy_sleep.c deleted file mode 100644 index 561c0be..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_busy_sleep.c +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright (c) 2003-2004 Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - * - * ------------ - * - * Altera does not recommend, suggest or require that this reference design - * file be used in conjunction or combination with any other product. - * - * alt_busy_sleep.c - Microsecond delay routine which uses a calibrated busy - * loop to perform the delay. This is used to implement - * usleep for both uC/OS-II and the standalone HAL. - * - * Author PRR - * - * Calibrated delay with no timer required - * - * The ASM instructions in the routine are equivalent to - * - * for (i=0;i -#include - -#include "system.h" -#include "alt_types.h" - -#include "priv/alt_busy_sleep.h" - -unsigned int alt_busy_sleep (unsigned int us) -{ -/* - * Only delay if ALT_SIM_OPTIMIZE is not defined; i.e., if software - * is built targetting ModelSim RTL simulation, the delay will be - * skipped to speed up simulation. - */ -#ifndef ALT_SIM_OPTIMIZE - int i; - int big_loops; - alt_u32 cycles_per_loop; - - if (!strcmp(NIOS2_CPU_IMPLEMENTATION,"tiny")) - { - cycles_per_loop = 9; - } - else - { - cycles_per_loop = 3; - } - - - big_loops = us / (INT_MAX/ - (ALT_CPU_FREQ/(cycles_per_loop * 1000000))); - - if (big_loops) - { - for(i=0;i - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -#ifdef ALT_USE_DIRECT_DRIVERS - -int ALT_CLOSE (int fildes) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(close); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -/* - * close() is called by an application to release a file descriptor. If the - * associated file system/device has a close() callback function registered - * then this called. The file descriptor is then marked as free. - * - * ALT_CLOSE is mapped onto the close() system call in alt_syscall.h - */ - -int ALT_CLOSE (int fildes) -{ - alt_fd* fd; - int rval; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (fildes < 0) ? NULL : &alt_fd_list[fildes]; - - if (fd) - { - /* - * If the associated file system/device has a close function, call it so - * that any necessary cleanup code can run. - */ - - rval = (fd->dev->close) ? fd->dev->close(fd) : 0; - - /* Free the file descriptor structure and return. */ - - alt_release_fd (fildes); - if (rval < 0) - { - ALT_ERRNO = -rval; - return -1; - } - return 0; - } - else - { - ALT_ERRNO = EBADFD; - return -1; - } -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_dcache_flush.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_dcache_flush.c deleted file mode 100644 index 7ecc91a..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_dcache_flush.c +++ /dev/null @@ -1,97 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "nios2.h" -#include "system.h" - -#include "alt_types.h" -#include "sys/alt_cache.h" - -/* - * Nios II version 1.2 and newer supports the "flush by address" instruction, in - * addition to the "flush by line" instruction provided by older versions of - * the core. This newer instruction is used by preference when it is - * available. - */ - -#ifdef NIOS2_FLUSHDA_SUPPORTED -#define ALT_FLUSH_DATA(i) __asm__ volatile ("flushda (%0)" :: "r" (i)); -#else -#define ALT_FLUSH_DATA(i) __asm__ volatile ("flushd (%0)" :: "r" (i)); -#endif /* NIOS2_FLUSHDA_SUPPORTED */ - -/* - * alt_dcache_flush() is called to flush the data cache for a memory - * region of length "len" bytes, starting at address "start". - * - * Any dirty lines in the data cache are written back to memory. - */ - -void alt_dcache_flush (void* start, alt_u32 len) -{ -#if NIOS2_DCACHE_SIZE > 0 - - char* i; - char* end; - - /* - * This is the most we would ever need to flush. - * - * SPR 196942, 2006.01.13: The cache flush loop below will use the - * 'flushda' instruction if its available; in that case each line - * must be flushed individually, and thus 'len' cannot be trimmed. - */ - #ifndef NIOS2_FLUSHDA_SUPPORTED - if (len > NIOS2_DCACHE_SIZE) - { - len = NIOS2_DCACHE_SIZE; - } - #endif - - end = ((char*) start) + len; - - for (i = start; i < end; i+= NIOS2_DCACHE_LINE_SIZE) - { - ALT_FLUSH_DATA(i); - } - - /* - * For an unaligned flush request, we've got one more line left. - * Note that this is dependent on NIOS2_DCACHE_LINE_SIZE to be a - * multiple of 2 (which it always is). - */ - - if (((alt_u32) start) & (NIOS2_DCACHE_LINE_SIZE - 1)) - { - ALT_FLUSH_DATA(i); - } - -#endif /* NIOS2_DCACHE_SIZE > 0 */ -} diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_dcache_flush_all.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_dcache_flush_all.c deleted file mode 100644 index 6529231..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_dcache_flush_all.c +++ /dev/null @@ -1,51 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "nios2.h" -#include "system.h" - -#include "alt_types.h" -#include "sys/alt_cache.h" - -/* - * alt_dcache_flush_all() is called to flush the entire data cache. - */ - -void alt_dcache_flush_all (void) -{ -#if NIOS2_DCACHE_SIZE > 0 - char* i; - - for (i = (char*) 0; i < (char*) NIOS2_DCACHE_SIZE; i+= NIOS2_DCACHE_LINE_SIZE) - { - __asm__ volatile ("flushd (%0)" :: "r" (i)); - } -#endif /* NIOS2_DCACHE_SIZE > 0 */ -} diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_dcache_flush_no_writeback.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_dcache_flush_no_writeback.c deleted file mode 100644 index c65ca7d..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_dcache_flush_no_writeback.c +++ /dev/null @@ -1,88 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "nios2.h" -#include "system.h" - -#include "alt_types.h" -#include "sys/alt_cache.h" - -/* - * The INITDA instruction was added to Nios II in the 8.0 release. - * - * The INITDA instruction has one of the following possible behaviors - * depending on the processor configuration: - * 1) Flushes a line by address but does NOT write back dirty data. - * Occurs when a data cache is present that supports INITDA. - * The macro NIOS2_INITDA_SUPPORTED is defined in system.h. - * 2) Takes an unimplemented instruction exception. - * Occurs when a data cache is present that doesn't support INITDA. - * 3) Performs no operation - * Occurs when there is no data cache present. - * The macro NIOS2_DCACHE_SIZE is 0 in system.h. - */ - -#define ALT_FLUSH_DATA_NO_WRITEBACK(i) \ - __asm__ volatile ("initda (%0)" :: "r" (i)); - -/* - * alt_dcache_flush_no_writeback() is called to flush the data cache for a - * memory region of length "len" bytes, starting at address "start". - * - * Any dirty lines in the data cache are NOT written back to memory. - * Make sure you really want this behavior. If you aren't 100% sure, - * use the alt_dcache_flush() routine instead. - */ - -void alt_dcache_flush_no_writeback (void* start, alt_u32 len) -{ -#if defined(NIOS2_INITDA_SUPPORTED) - - char* i; - char* end = ((char*) start) + len; - - for (i = start; i < end; i+= NIOS2_DCACHE_LINE_SIZE) - { - ALT_FLUSH_DATA_NO_WRITEBACK(i); - } - - /* - * For an unaligned flush request, we've got one more line left. - * Note that this is dependent on NIOS2_DCACHE_LINE_SIZE to be a - * multiple of 2 (which it always is). - */ - - if (((alt_u32) start) & (NIOS2_DCACHE_LINE_SIZE - 1)) - { - ALT_FLUSH_DATA_NO_WRITEBACK(i); - } - -#endif /* NIOS2_INITDA_SUPPORTED */ -} diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_dev.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_dev.c deleted file mode 100644 index ebc15e5..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_dev.c +++ /dev/null @@ -1,149 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include -#include -#include - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - -#include "alt_types.h" - -#include "system.h" - -/* - * This file contains the data constructs used to control access to device and - * filesytems. - */ - -/* - * "alt_fs_list" is the head of a linked list of registered filesystems. It is - * initialised as an empty list. New entries can be added using the - * alt_fs_reg() function. - */ - -ALT_LLIST_HEAD(alt_fs_list); - - -/* - * "alt_dev_list" is the head of a linked list of registered devices. It is - * configured at startup to include a single device, "alt_dev_null". This - * device is discussed below. - */ - -extern alt_dev alt_dev_null; /* forward declaration */ - -alt_llist alt_dev_list = {&alt_dev_null.llist, &alt_dev_null.llist}; - -/* - * alt_dev_null_write() is the implementation of the write() function used - * by the alt_dev_null device. It simple discards all data passed to it, and - * indicates that the data has been successfully transmitted. - */ - -static int alt_dev_null_write (alt_fd* fd, const char* ptr, int len) -{ - return len; -} - -/* - * "alt_dev_null" is used to allow output to be redirected to nowhere. It is - * the only device registered before the call to alt_sys_init(). At startup - * stin, stdout & stderr are all directed towards this device so that library - * calls like printf() will be safe but inefectual. - */ - -alt_dev alt_dev_null = { - { - &alt_dev_list, - &alt_dev_list - }, - "/dev/null", - NULL, /* open */ - NULL, /* close */ - NULL, /* write */ - alt_dev_null_write, /* write */ - NULL, /* lseek */ - NULL, /* fstat */ - NULL /* ioctl */ - }; - -/* - * "alt_fd_list_lock" is a semaphore used to control access to the file - * descriptor list. This is used to ensure that access to the list is thread - * safe. - */ - -ALT_SEM(alt_fd_list_lock) - -/* - * "alt_max_fd" is used to make access to the file descriptor list more - * efficent. It is set to be the value of the highest allocated file - * descriptor. This saves having to search the entire pool of unallocated - * file descriptors when looking for a match. - */ - -alt_32 alt_max_fd = -1; - -/* - * "alt_fd_list" is the file descriptor pool. The first three entries in the - * array are configured as standard in, standard out, and standard error. These - * are all initialised so that accesses are directed to the alt_dev_null - * device. The remaining file descriptors are initialised as unallocated. - * - * The maximum number of file descriptors within the system is specified by the - * user defined macro "ALT_MAX_FD". This is defined in "system.h", which is - * auto-genereated using the projects PTF and STF files. - */ - -alt_fd alt_fd_list[ALT_MAX_FD] = - { - { - &alt_dev_null, /* standard in */ - 0, - 0 - }, - { - &alt_dev_null, /* standard out */ - 0, - 0 - }, - { - &alt_dev_null, /* standard error */ - 0, - 0 - } - /* all other elements are set to zero */ - }; diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_dev_llist_insert.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_dev_llist_insert.c deleted file mode 100644 index fa7239d..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_dev_llist_insert.c +++ /dev/null @@ -1,59 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "priv/alt_dev_llist.h" -#include "sys/alt_errno.h" - -/* - * - */ - -int alt_dev_llist_insert (alt_dev_llist* dev, alt_llist* list) -{ - /* - * check that the device exists, and that it has a valid name. - */ - - if (!dev || !dev->name) - { - ALT_ERRNO = EINVAL; - return -EINVAL; - } - - /* - * register the device. - */ - - alt_llist_insert(list, &dev->llist); - - return 0; -} diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_dma_rxchan_open.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_dma_rxchan_open.c deleted file mode 100644 index 6ea3b78..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_dma_rxchan_open.c +++ /dev/null @@ -1,63 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_dma.h" -#include "sys/alt_errno.h" -#include "priv/alt_file.h" - -/* - * The list of registered DMA receive channels. - */ - -ALT_LLIST_HEAD(alt_dma_rxchan_list); - -/* - * alt_dma_txchan_open() is used to obtain an "alt_dma_txchan" descriptor for - * a DMA transmit device. The name is the name of the associated physical - * device (e.g. "/dev/dma_0"). - * - * The return value will be NULL on failure, and non-NULL otherwise. - */ - -alt_dma_rxchan alt_dma_rxchan_open (const char* name) -{ - alt_dma_rxchan dev; - - dev = (alt_dma_rxchan) alt_find_dev (name, &alt_dma_rxchan_list); - - if (!dev) - { - ALT_ERRNO = ENODEV; - } - - return dev; -} diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_dma_txchan_open.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_dma_txchan_open.c deleted file mode 100644 index f41fa81..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_dma_txchan_open.c +++ /dev/null @@ -1,63 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_dma.h" -#include "sys/alt_errno.h" -#include "priv/alt_file.h" - -/* - * The list of registered receive channels. - */ - -ALT_LLIST_HEAD(alt_dma_txchan_list); - -/* - * alt_dma_txchan_open() is used to obtain an "alt_dma_txchan" descriptor for - * a DMA transmit device. The name is the name of the associated physical - * device (e.g. "/dev/dma_0"). - * - * The return value will be NULL on failure, and non-NULL otherwise. - */ - -alt_dma_txchan alt_dma_txchan_open (const char* name) -{ - alt_dma_txchan dev; - - dev = (alt_dma_txchan) alt_find_dev (name, &alt_dma_txchan_list); - - if (!dev) - { - ALT_ERRNO = ENODEV; - } - - return dev; -} diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_do_ctors.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_do_ctors.c deleted file mode 100644 index ff5a1f7..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_do_ctors.c +++ /dev/null @@ -1,64 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT IT DIRECTLY. * -* * -* Overriding HAL Functions * -* * -* To provide your own implementation of a HAL function, include the file in * -* your Nios II IDE application project. When building the executable, the * -* Nios II IDE finds your function first, and uses it in place of the HAL * -* version. * -* * -******************************************************************************/ - -/* - * - */ - -typedef void (*constructor) (void); -extern constructor __CTOR_LIST__[]; -extern constructor __CTOR_END__[]; - -/* - * Run the C++ static constructors. - */ - -void _do_ctors(void) -{ - constructor* ctor; - - for (ctor = &__CTOR_END__[-1]; ctor >= __CTOR_LIST__; ctor--) - (*ctor) (); -} diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_do_dtors.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_do_dtors.c deleted file mode 100644 index 565c99f..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_do_dtors.c +++ /dev/null @@ -1,64 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT IT DIRECTLY. * -* * -* Overriding HAL Functions * -* * -* To provide your own implementation of a HAL function, include the file in * -* your Nios II IDE application project. When building the executable, the * -* Nios II IDE finds your function first, and uses it in place of the HAL * -* version. * -* * -******************************************************************************/ - -/* - * - */ - -typedef void (*destructor) (void); -extern destructor __DTOR_LIST__[]; -extern destructor __DTOR_END__[]; - -/* - * Run the C++ static destructors. - */ - -void _do_dtors(void) -{ - destructor* dtor; - - for (dtor = &__DTOR_END__[-1]; dtor >= __DTOR_LIST__; dtor--) - (*dtor) (); -} diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_env_lock.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_env_lock.c deleted file mode 100644 index fc25a0c..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_env_lock.c +++ /dev/null @@ -1,53 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -/* - * These are the empty env lock/unlock stubs required by newlib. These are - * used to make accesses to environment variables thread safe. The default HAL - * configuration is single threaded, so there is nothing to do here. Note that - * this requires that environment variables are never manipulated by an interrupt - * service routine. - */ - -void __env_lock ( struct _reent *_r ) -{ -} - -/* - * - */ - -void __env_unlock ( struct _reent *_r ) -{ -} diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_environ.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_environ.c deleted file mode 100644 index 404efc4..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_environ.c +++ /dev/null @@ -1,42 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "os/alt_syscall.h" - -/* - * These are the environment variables passed to the C code. By default there - * are no variables registered. An application can manipulate this list using - * getenv() and setenv(). - */ - -char *__env[1] = { 0 }; -char **ALT_ENVIRON = __env; diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_errno.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_errno.c deleted file mode 100644 index 1d8368d..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_errno.c +++ /dev/null @@ -1,44 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/* - * This file defines the alt_errno global variable. See comments in - * alt_errno.h for the use of this variable. - */ - - -#include "sys/alt_errno.h" -#include "alt_types.h" - -extern int ALT_WEAK *__errno (void); - -int* (*alt_errno) (void) = __errno; diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_exception_entry.S b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_exception_entry.S deleted file mode 100644 index 3afab93..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_exception_entry.S +++ /dev/null @@ -1,360 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2008 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "system.h" - -/* - * This is the exception entry point code, which saves all the caller saved - * registers and then handles the appropriate exception. It should be pulled - * in using a .globl from all the exception handler routines. This scheme is - * used so that if an interrupt is never registered, then this code will not - * appear in the generated executable, thereby improving code footprint. - * - * If an external interrpt controller (EIC) is present, it will supply an - * interrupt vector address to the processor when an interrupt occurs. For - * The Altera Vectored Interrupt Controller (VIC) driver will establish a - * vector table and the processor will jump directly to the appropriate - * table entry, funnel routine, and then user ISR. This will bypass this code - * in entirety. This code might still be linked into a system with an EIC, - * but would then be used only for non-interrupt exceptions. - */ - - /* - * Explicitly allow the use of r1 (the assembler temporary register) - * within this code. This register is normally reserved for the use of - * the assembler. - */ - .set noat - - /* - * The top and bottom of the exception stack - */ -#ifdef ALT_EXCEPTION_STACK - - .globl __alt_exception_stack_pointer - -#ifdef ALT_STACK_CHECK - - .globl __alt_exception_stack_limit - - /* - * We need to store the value of the stack limit after interrupt somewhere. - */ - .globl alt_exception_old_stack_limit - -#endif -#endif - - .section .exceptions.entry.label, "xa" - - .globl alt_exception - .type alt_exception, @function -alt_exception: - - .section .exceptions.entry, "xa" - -#ifdef ALT_EXCEPTION_STACK - -#ifdef ALT_STACK_CHECK - stw et, %gprel(alt_exception_old_stack_limit)(gp) -#endif - - movhi et, %hiadj(__alt_exception_stack_pointer - 80) - addi et, et, %lo(__alt_exception_stack_pointer - 80) - stw sp, 76(et) - mov sp, et - -#ifdef ALT_STACK_CHECK - movhi et, %hiadj(__alt_exception_stack_limit) - addi et, et, %lo(__alt_exception_stack_limit) - stw et, %gprel(alt_stack_limit_value)(gp) -#endif - -#else - /* - * Process an exception. For all exceptions we must preserve all - * caller saved registers on the stack (See the Nios2 ABI - * documentation for details). - */ - - addi sp, sp, -76 - -#ifdef ALT_STACK_CHECK - - bltu sp, et, .Lstack_overflow - -#endif - -#endif - - stw ra, 0(sp) - - /* - * Leave a gap in the stack frame at 4(sp) for the muldiv handler to - * store zero into. - */ - - stw r1, 8(sp) - stw r2, 12(sp) - stw r3, 16(sp) - stw r4, 20(sp) - stw r5, 24(sp) - stw r6, 28(sp) - stw r7, 32(sp) - - rdctl r5, estatus - - stw r8, 36(sp) - stw r9, 40(sp) - stw r10, 44(sp) - stw r11, 48(sp) - stw r12, 52(sp) - stw r13, 56(sp) - stw r14, 60(sp) - stw r15, 64(sp) - - /* - * ea-4 contains the address of the instruction being executed - * when the exception occured. For interrupt exceptions, we will - * will be re-issue the isntruction. Store it in 72(sp) - */ - stw r5, 68(sp) /* estatus */ - addi r15, ea, -4 /* instruction that caused exception */ - stw r15, 72(sp) - - /* - * The interrupt testing code (.exceptions.irqtest) will be - * linked here. If the Internal Interrupt Controller (IIC) is - * present (an EIC is not present), the presense of an interrupt - * is determined by examining CPU control registers or an interrupt - * custom instruction, if present. - * - * If the IIC is used and an interrupt is active, the code linked - * here will call the HAL IRQ handler (alt_irq_handler()) which - * successively calls registered interrupt handler(s) until no - * interrupts remain pending. It then jumps to .exceptions.exit. If - * there is no interrupt then it continues to .exception.notirq, below. - */ - - .section .exceptions.notirq, "xa" - - /* - * Prepare to service unimplemtned instructions or traps, - * each of which is optionally inked into section .exceptions.soft, - * which will preceed .exceptions.unknown below. - * - * Unlike interrupts, we want to skip the exception-causing instructon - * upon completion, so we write ea (address of instruction *after* - * the one where the exception occured) into 72(sp). The actual - * instruction that caused the exception is written in r2, which these - * handlers will utilize. - */ - stw ea, 72(sp) /* Don't re-issue */ - ldw r2, -4(ea) /* Instruction that caused exception */ - - /* - * Other exception handling code, if enabled, will be linked here. - * This includes unimplemted (multiply/divide) instruction support - * (a BSP generaton option), and a trap handler (that would typically - * be augmented with user-specific code). These are not linked in by - * default. - */ - - /* - * In the context of linker sections, "unknown" are all exceptions - * not handled by the built-in handlers above (interupt, and trap or - * unimplemented instruction decoding, if enabled). - * - * Advanced exception types can be serviced by registering a handler. - * To do so, enable the "Enable Instruction-related Exception API" HAL - * BSP setting. If this setting is disabled, this handler code will - * either break (if the debug core is present) or enter an infinite - * loop because we don't how how to handle the exception. - */ - .section .exceptions.unknown -#ifdef ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API - /* - * The C-based HAL routine alt_instruction_exception_entry() will - * attempt to service the exception by calling a user-registered - * exception handler using alt_instruction_exception_register(). - * If no handler was registered it will either break (if the - * debugger is present) or go into an infinite loop since the - * handling behavior is undefined; in that case we will not return here. - */ - - /* Load exception-causing address as first argument (r4) */ - addi r4, ea, -4 - - /* Call the instruction-exception entry */ - call alt_instruction_exception_entry - - /* - * If alt_instruction_exception_entry() returned, the exception was - * serviced by a user-registered routine. Its return code (now in r2) - * indicates whether to re-issue or skip the exception-causing - * instruction - * - * Return code was 0: Skip. The instruction after the exception is - * already stored in 72(sp). - */ - bne r2, r0, .Lexception_exit - - /* - * Otherwise, modify 72(sp) to re-issue the instruction that caused the - * exception. - */ - addi r15, ea, -4 /* instruction that caused exception */ - stw r15, 72(sp) - -#else /* ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API disabled */ - - /* - * We got here because an instruction-related exception occured, but the - * handler API was not compiled in. We do not presume to know how to - * handle it. If the debugger is present, break, otherwise hang. - * - * If you get here then one of the following could have happened: - * - * - An instruction-generated exception occured, and the processor - * does not have the extra exceptions feature enabled, or you - * have not registered a handler using - * alt_instruction_exception_register() - * - * Some examples of instruction-generated exceptions and why they - * might occur: - * - * - Your program could have been compiled for a full-featured - * Nios II core, but it is running on a smaller core, and - * instruction emulation has been disabled by defining - * ALT_NO_INSTRUCTION_EMULATION. - * - * You can work around the problem by re-enabling instruction - * emulation, or you can figure out why your program is being - * compiled for a system other than the one that it is running on. - * - * - Your program has executed a trap instruction, but has not - * implemented a handler for this instruction. - * - * - Your program has executed an illegal instruction (one which is - * not defined in the instruction set). - * - * - Your processor includes an MMU or MPU, and you have enabled it - * before registering an exception handler to service exceptions it - * generates. - * - * The problem could also be hardware related: - * - If your hardware is broken and is generating spurious interrupts - * (a peripheral which negates its interrupt output before its - * interrupt handler has been executed will cause spurious - * interrupts) - */ -#ifdef NIOS2_HAS_DEBUG_STUB - /* - * Either tell the user now (if there is a debugger attached) or go into - * the debug monitor which will loop until a debugger is attached. - */ - break -#else - /* - * If there is no debug stub then a BREAK will probably cause a reboot. - * An infinate loop will probably be more useful. - */ -0: - br 0b -#endif /* NIOS2_HAS_DEBUG_STUB */ - -#endif /* ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API */ - - .section .exceptions.exit.label -.Lexception_exit: - - .section .exceptions.exit, "xa" - - /* - * Restore the saved registers, so that all general purpose registers - * have been restored to their state at the time the interrupt occured. - */ - - ldw r5, 68(sp) - ldw ea, 72(sp) /* This becomes the PC once eret is executed */ - ldw ra, 0(sp) - - wrctl estatus, r5 - - ldw r1, 8(sp) - ldw r2, 12(sp) - ldw r3, 16(sp) - ldw r4, 20(sp) - ldw r5, 24(sp) - ldw r6, 28(sp) - ldw r7, 32(sp) - -#ifdef ALT_EXCEPTION_STACK -#ifdef ALT_STACK_CHECK - ldw et, %gprel(alt_exception_old_stack_limit)(gp) -#endif -#endif - - ldw r8, 36(sp) - ldw r9, 40(sp) - ldw r10, 44(sp) - ldw r11, 48(sp) - ldw r12, 52(sp) - ldw r13, 56(sp) - ldw r14, 60(sp) - ldw r15, 64(sp) - -#ifdef ALT_EXCEPTION_STACK - -#ifdef ALT_STACK_CHECK - stw et, %gprel(alt_stack_limit_value)(gp) - stw zero, %gprel(alt_exception_old_stack_limit)(gp) -#endif - - ldw sp, 76(sp) - -#else - addi sp, sp, 76 - -#endif - - /* - * Return to the interrupted instruction. - */ - - eret - -#ifdef ALT_STACK_CHECK - -.Lstack_overflow: - break 3 - -#endif - diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_exception_muldiv.S b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_exception_muldiv.S deleted file mode 100644 index 55617a6..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_exception_muldiv.S +++ /dev/null @@ -1,583 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - - /* - * This is the software multiply/divide handler for Nios2. - */ - - /* - * Provide a label which can be used to pull this file in. - */ - - .section .exceptions.start - .globl alt_exception_muldiv -alt_exception_muldiv: - - /* - * Pull in the entry/exit code. - */ - .globl alt_exception - - - .section .exceptions.soft, "xa" - - - /* INSTRUCTION EMULATION - * --------------------- - * - * Nios II processors generate exceptions for unimplemented instructions. - * The routines below emulate these instructions. Depending on the - * processor core, the only instructions that might need to be emulated - * are div, divu, mul, muli, mulxss, mulxsu, and mulxuu. - * - * The emulations match the instructions, except for the following - * limitations: - * - * 1) The emulation routines do not emulate the use of the exception - * temporary register (et) as a source operand because the exception - * handler already has modified it. - * - * 2) The routines do not emulate the use of the stack pointer (sp) or the - * exception return address register (ea) as a destination because - * modifying these registers crashes the exception handler or the - * interrupted routine. - * - * 3) To save code size, the routines do not emulate the use of the - * breakpoint registers (ba and bt) as operands. - * - * Detailed Design - * --------------- - * - * The emulation routines expect the contents of integer registers r0-r31 - * to be on the stack at addresses sp, 4(sp), 8(sp), ... 124(sp). The - * routines retrieve source operands from the stack and modify the - * destination register's value on the stack prior to the end of the - * exception handler. Then all registers except the destination register - * are restored to their previous values. - * - * The instruction that causes the exception is found at address -4(ea). - * The instruction's OP and OPX fields identify the operation to be - * performed. - * - * One instruction, muli, is an I-type instruction that is identified by - * an OP field of 0x24. - * - * muli AAAAA,BBBBB,IIIIIIIIIIIIIIII,-0x24- - * 27 22 6 0 <-- LSB of field - * - * The remaining emulated instructions are R-type and have an OP field - * of 0x3a. Their OPX fields identify them. - * - * R-type AAAAA,BBBBB,CCCCC,XXXXXX,NNNNN,-0x3a- - * 27 22 17 11 6 0 <-- LSB of field - * - * - */ - - - /* - * Split the instruction into its fields. We need 4*A, 4*B, and 4*C as - * offsets to the stack pointer for access to the stored register values. - */ - /* r2 = AAAAA,BBBBB,IIIIIIIIIIIIIIII,PPPPPP */ - roli r3, r2, 7 /* r3 = BBB,IIIIIIIIIIIIIIII,PPPPPP,AAAAA,BB */ - roli r4, r3, 3 /* r4 = IIIIIIIIIIIIIIII,PPPPPP,AAAAA,BBBBB */ - roli r6, r4, 2 /* r6 = IIIIIIIIIIIIII,PPPPPP,AAAAA,BBBBB,II */ - srai r4, r4, 16 /* r4 = (sign-extended) IMM16 */ - xori r6, r6, 0x42 /* r6 = CCC,XXXXXX,NNNNN,PPPPPP,AAAAA,bBBBB,cC */ - roli r7, r6, 5 /* r7 = XXXX,NNNNN,PPPPPP,AAAAA,bBBBB,cCCCC,XX */ - andi r5, r2, 0x3f /* r5 = 00000000000000000000000000,PPPPPP */ - xori r3, r3, 0x40 - andi r3, r3, 0x7c /* r3 = 0000000000000000000000000,aAAAA,00 */ - andi r6, r6, 0x7c /* r6 = 0000000000000000000000000,bBBBB,00 */ - andi r7, r7, 0x7c /* r7 = 0000000000000000000000000,cCCCC,00 */ - - /* Now either - * r5 = OP - * r3 = 4*(A^16) - * r4 = IMM16 (sign extended) - * r6 = 4*(B^16) - * r7 = 4*(C^16) - * or - * r5 = OP - */ - - - /* - * Save everything on the stack to make it easy for the emulation routines - * to retrieve the source register operands. The exception entry code has - * already saved some of this so we don't need to do it all again. - */ - - addi sp, sp, -60 - stw zero, 64(sp) /* Save zero on stack to avoid special case for r0. */ - /* Register at and r2-r15 have already been saved. */ - - stw r16, 0(sp) - stw r17, 4(sp) - stw r18, 8(sp) - stw r19, 12(sp) - stw r20, 16(sp) - stw r21, 20(sp) - stw r22, 24(sp) - stw r23, 28(sp) - /* et @ 32 - Has already been changed.*/ - /* bt @ 36 - Usually isn't an operand. */ - stw gp, 40(sp) - stw sp, 44(sp) - stw fp, 48(sp) - /* ea @ 52 - Don't bother to save - it's already been changed */ - /* ba @ 56 - Breakpoint register usually isn't an operand */ - /* ra @ 60 - Has already been saved */ - - - /* - * Prepare for either multiplication or division loop. - * They both loop 32 times. - */ - movi r14, 32 - - - /* - * Get the operands. - * - * It is necessary to check for muli because it uses an I-type instruction - * format, while the other instructions are have an R-type format. - */ - add r3, r3, sp /* r3 = address of A-operand. */ - ldw r3, 0(r3) /* r3 = A-operand. */ - movi r15, 0x24 /* muli opcode (I-type instruction format) */ - beq r5, r15, .Lmul_immed /* muli doesn't use the B register as a source */ - - add r6, r6, sp /* r6 = address of B-operand. */ - ldw r6, 0(r6) /* r6 = B-operand. */ - /* r4 = SSSSSSSSSSSSSSSS,-----IMM16------ */ - /* IMM16 not needed, align OPX portion */ - /* r4 = SSSSSSSSSSSSSSSS,CCCCC,-OPX--,00000 */ - srli r4, r4, 5 /* r4 = 00000,SSSSSSSSSSSSSSSS,CCCCC,-OPX-- */ - andi r4, r4, 0x3f /* r4 = 00000000000000000000000000,-OPX-- */ - - /* Now - * r5 = OP - * r3 = src1 - * r6 = src2 - * r4 = OPX (no longer can be muli) - * r7 = 4*(C^16) - * r14 = loop counter - */ - - /* ILLEGAL-INSTRUCTION EXCEPTION - * ----------------------------- - * - * This code is for Nios II cores that generate exceptions when attempting - * to execute illegal instructions. Nios II cores that support an - * illegal-instruction exception are identified by the presence of the - * macro definition NIOS2_HAS_ILLEGAL_INSTRUCTION_EXCEPTION in system.h . - * - * Remember that illegal instructions are different than unimplemented - * instructions. Illegal instructions are instruction encodings that - * have not been defined by the Nios II ISA. Unimplemented instructions - * are legal instructions that must be emulated by some Nios II cores. - * - * If we get here, all instructions except multiplies and divides - * are illegal. - * - * This code assumes that OP is not muli (because muli was tested above). - * All other multiplies and divides are legal. Anything else is illegal. - */ - - movi r8, 0x3a /* OP for R-type mul* and div* */ - bne r5, r8, .Lnot_muldiv - - /* r15 already is 0x24 */ /* OPX of divu */ - beq r4, r15, .Ldivide - - movi r15,0x27 /* OPX of mul */ - beq r4, r15, .Lmultiply - - movi r15,0x07 /* OPX of mulxuu */ - beq r4, r15, .Lmultiply - - movi r15,0x17 /* OPX of mulxsu */ - beq r4, r15, .Lmultiply - - movi r15,0x1f /* OPX of mulxss */ - beq r4, r15, .Lmultiply - - movi r15,0x25 /* OPX of div */ - bne r4, r15, .Lnot_muldiv - - - /* DIVISION - * - * Divide an unsigned dividend by an unsigned divisor using - * a shift-and-subtract algorithm. The example below shows - * 43 div 7 = 6 for 8-bit integers. This classic algorithm uses a - * single register to store both the dividend and the quotient, - * allowing both values to be shifted with a single instruction. - * - * remainder dividend:quotient - * --------- ----------------- - * initialize 00000000 00101011: - * shift 00000000 0101011:_ - * remainder >= divisor? no 00000000 0101011:0 - * shift 00000000 101011:0_ - * remainder >= divisor? no 00000000 101011:00 - * shift 00000001 01011:00_ - * remainder >= divisor? no 00000001 01011:000 - * shift 00000010 1011:000_ - * remainder >= divisor? no 00000010 1011:0000 - * shift 00000101 011:0000_ - * remainder >= divisor? no 00000101 011:00000 - * shift 00001010 11:00000_ - * remainder >= divisor? yes 00001010 11:000001 - * remainder -= divisor - 00000111 - * ---------- - * 00000011 11:000001 - * shift 00000111 1:000001_ - * remainder >= divisor? yes 00000111 1:0000011 - * remainder -= divisor - 00000111 - * ---------- - * 00000000 1:0000011 - * shift 00000001 :0000011_ - * remainder >= divisor? no 00000001 :00000110 - * - * The quotient is 00000110. - */ - -.Ldivide: - /* - * Prepare for division by assuming the result - * is unsigned, and storing its "sign" as 0. - */ - movi r17, 0 - - - /* Which division opcode? */ - xori r15, r4, 0x25 /* OPX of div */ - bne r15, zero, .Lunsigned_division - - - /* - * OPX is div. Determine and store the sign of the quotient. - * Then take the absolute value of both operands. - */ - xor r17, r3, r6 /* MSB contains sign of quotient */ - bge r3, zero, 0f - sub r3, zero, r3 /* -r3 */ -0: - bge r6, zero, 0f - sub r6, zero, r6 /* -r6 */ -0: - - -.Lunsigned_division: - /* Initialize the unsigned-division loop. */ - movi r13, 0 /* remainder = 0 */ - - /* Now - * r3 = dividend : quotient - * r4 = 0x25 for div, 0x24 for divu - * r6 = divisor - * r13 = remainder - * r14 = loop counter (already initialized to 32) - * r17 = MSB contains sign of quotient - */ - - - /* - * for (count = 32; count > 0; --count) - * { - */ -.Ldivide_loop: - - /* - * Division: - * - * (remainder:dividend:quotient) <<= 1; - */ - slli r13, r13, 1 - cmplt r15, r3, zero /* r15 = MSB of r3 */ - or r13, r13, r15 - slli r3, r3, 1 - - - /* - * if (remainder >= divisor) - * { - * set LSB of quotient - * remainder -= divisor; - * } - */ - bltu r13, r6, .Ldiv_skip - ori r3, r3, 1 - sub r13, r13, r6 -.Ldiv_skip: - - /* - * } - */ - subi r14, r14, 1 - bne r14, zero, .Ldivide_loop - - mov r9, r3 - - - /* Now - * r9 = quotient - * r4 = 0x25 for div, 0x24 for divu - * r7 = 4*(C^16) - * r17 = MSB contains sign of quotient - */ - - - /* - * Conditionally negate signed quotient. If quotient is unsigned, - * the sign already is initialized to 0. - */ - bge r17, zero, .Lstore_result - sub r9, zero, r9 /* -r9 */ - - br .Lstore_result - - - - - /* MULTIPLICATION - * - * A "product" is the number that one gets by summing a "multiplicand" - * several times. The "multiplier" specifies the number of copies of the - * multiplicand that are summed. - * - * Actual multiplication algorithms don't use repeated addition, however. - * Shift-and-add algorithms get the same answer as repeated addition, and - * they are faster. To compute the lower half of a product (pppp below) - * one shifts the product left before adding in each of the partial products - * (a * mmmm) through (d * mmmm). - * - * To compute the upper half of a product (PPPP below), one adds in the - * partial products (d * mmmm) through (a * mmmm), each time following the - * add by a right shift of the product. - * - * mmmm - * * abcd - * ------ - * #### = d * mmmm - * #### = c * mmmm - * #### = b * mmmm - * #### = a * mmmm - * -------- - * PPPPpppp - * - * The example above shows 4 partial products. Computing actual Nios II - * products requires 32 partials. - * - * It is possible to compute the result of mulxsu from the result of mulxuu - * because the only difference between the results of these two opcodes is - * the value of the partial product associated with the sign bit of rA. - * - * mulxsu = mulxuu - ((rA < 0) ? rB : 0); - * - * It is possible to compute the result of mulxss from the result of mulxsu - * because the only difference between the results of these two opcodes is - * the value of the partial product associated with the sign bit of rB. - * - * mulxss = mulxsu - ((rB < 0) ? rA : 0); - * - */ - -.Lmul_immed: - /* Opcode is muli. Change it into mul for remainder of algorithm. */ - mov r7, r6 /* Field B is dest register, not field C. */ - mov r6, r4 /* Field IMM16 is src2, not field B. */ - movi r4, 0x27 /* OPX of mul is 0x27 */ - -.Lmultiply: - /* Initialize the multiplication loop. */ - movi r9, 0 /* mul_product = 0 */ - movi r10, 0 /* mulxuu_product = 0 */ - mov r11, r6 /* save original multiplier for mulxsu and mulxss */ - mov r12, r6 /* mulxuu_multiplier (will be shifted) */ - movi r16, 1 /* used to create "rori B,A,1" from "ror B,A,r16" */ - - /* Now - * r3 = multiplicand - * r6 = mul_multiplier - * r7 = 4 * dest_register (used later as offset to sp) - * r9 = mul_product - * r10 = mulxuu_product - * r11 = original multiplier - * r12 = mulxuu_multiplier - * r14 = loop counter (already initialized) - * r15 = temp - * r16 = 1 - */ - - - /* - * for (count = 32; count > 0; --count) - * { - */ -.Lmultiply_loop: - - /* - * mul_product <<= 1; - * lsb = multiplier & 1; - */ - slli r9, r9, 1 - andi r15, r12, 1 - - /* - * if (lsb == 1) - * { - * mulxuu_product += multiplicand; - * } - */ - beq r15, zero, .Lmulx_skip - add r10, r10, r3 - cmpltu r15, r10, r3 /* Save the carry from the MSB of mulxuu_product. */ - ror r15, r15, r16 /* r15 = 0x80000000 on carry, or else 0x00000000 */ -.Lmulx_skip: - - /* - * if (MSB of mul_multiplier == 1) - * { - * mul_product += multiplicand; - * } - */ - bge r6, zero, .Lmul_skip - add r9, r9, r3 -.Lmul_skip: - - /* - * mulxuu_product >>= 1; logical shift - * mul_multiplier <<= 1; done with MSB - * mulx_multiplier >>= 1; done with LSB - */ - srli r10, r10, 1 - or r10, r10, r15 /* OR in the saved carry bit. */ - slli r6, r6, 1 - srli r12, r12, 1 - - - /* - * } - */ - subi r14, r14, 1 - bne r14, zero, .Lmultiply_loop - - - /* - * Multiply emulation loop done. - */ - - /* Now - * r3 = multiplicand - * r4 = OPX - * r7 = 4 * dest_register (used later as offset to sp) - * r9 = mul_product - * r10 = mulxuu_product - * r11 = original multiplier - * r15 = temp - */ - - - /* - * Select/compute the result based on OPX. - */ - - - /* OPX == mul? Then store. */ - xori r15, r4, 0x27 - beq r15, zero, .Lstore_result - - /* It's one of the mulx.. opcodes. Move over the result. */ - mov r9, r10 - - /* OPX == mulxuu? Then store. */ - xori r15, r4, 0x07 - beq r15, zero, .Lstore_result - - /* Compute mulxsu - * - * mulxsu = mulxuu - ((rA < 0) ? rB : 0); - */ - bge r3, zero, .Lmulxsu_skip - sub r9, r9, r11 -.Lmulxsu_skip: - - /* OPX == mulxsu? Then store. */ - xori r15, r4, 0x17 - beq r15, zero, .Lstore_result - - /* Compute mulxss - * - * mulxss = mulxsu - ((rB < 0) ? rA : 0); - */ - bge r11, zero, .Lmulxss_skip - sub r9, r9, r3 -.Lmulxss_skip: - /* At this point, assume that OPX is mulxss, so store */ - - -.Lstore_result: - add r7, r7, sp - stw r9, 0(r7) - - ldw r16, 0(sp) - ldw r17, 4(sp) - ldw r18, 8(sp) - ldw r19, 12(sp) - ldw r20, 16(sp) - ldw r21, 20(sp) - ldw r22, 24(sp) - ldw r23, 28(sp) - - /* bt @ 32 - Breakpoint register usually isn't an operand. */ - /* et @ 36 - Don't corrupt et. */ - /* gp @ 40 - Don't corrupt gp. */ - /* sp @ 44 - Don't corrupt sp. */ - ldw fp, 48(sp) - /* ea @ 52 - Don't corrupt ea. */ - /* ba @ 56 - Breakpoint register usually isn't an operand. */ - - addi sp, sp, 60 - - br .Lexception_exit - - -.Lnot_muldiv: - - addi sp, sp, 60 - - - .section .exceptions.exit.label -.Lexception_exit: - diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_exception_trap.S b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_exception_trap.S deleted file mode 100644 index 60a3d40..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_exception_trap.S +++ /dev/null @@ -1,81 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - - /* - * This is the trap exception handler for Nios2. - */ - - /* - * Provide a label which can be used to pull this file in. - */ - - .section .exceptions.start - .globl alt_exception_trap -alt_exception_trap: - - /* - * Pull in the entry/exit code. - */ - .globl alt_exception - - .section .exceptions.soft, "xa" - -.Ltrap_handler: - - /* - * Did a trap instruction cause the exception? - * - * The instruction which the exception occurred on has been loaded - * into r2 by code in alt_exception_entry.S - * - */ - - movhi r3,0x003b /* upper half of trap opcode */ - ori r3,r3,0x683a /* lower half of trap opcode */ - bne r2,r3,.Lnot_trap - - /* - * There is no trap handler defined here, and so executing a trap - * instruction causes a software break. If you provide a trap handler, - * then you must replace the break instruction below with your handler. - * Your handler must preserve ea and the usual callee saved registers. - */ - - break - - br .Lexception_exit - -.Lnot_trap: - - - .section .exceptions.exit.label -.Lexception_exit: - - diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_execve.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_execve.c deleted file mode 100644 index 27b99cf..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_execve.c +++ /dev/null @@ -1,55 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "os/alt_syscall.h" - -/* - * execve() is used by newlib to launch new processes. This is unsupported in - * the HAL environment. However a "do-nothing" implementation is still - * provied for newlib compatability. - * - * ALT_EXECVE is mapped onto the execve() system call in alt_syscall.h - */ - -int ALT_EXECVE (char *name, char ** argv, char** env) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(execve); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_exit.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_exit.c deleted file mode 100644 index 971b35e..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_exit.c +++ /dev/null @@ -1,71 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_irq.h" -#include "sys/alt_sim.h" -#include "os/alt_hooks.h" -#include "os/alt_syscall.h" - -#include "alt_types.h" -#include "sys/alt_log_printf.h" -/* - * _exit() is called by exit() in order to terminate the current process. - * Typically this is called when main() completes. It should never return. - * Since there is nowhere to go once this process completes, this - * implementation simply blocks forever. - * - * Note that interrupts are not disabled so that execution outside of this - * thread is allowed to continue. - * - * ALT_EXIT is mapped onto the _exit() system call in alt_syscall.h - */ - -void ALT_EXIT (int exit_code) -{ - /* ALT_LOG - please see HAL/inc/alt_log_printf.h for details */ - ALT_LOG_PRINT_BOOT("[alt_exit.c] Entering _exit() function.\r\n"); - ALT_LOG_PRINT_BOOT("[alt_exit.c] Exit code from main was %d.\r\n",exit_code); - /* Stop all other threads */ - - ALT_LOG_PRINT_BOOT("[alt_exit.c] Calling ALT_OS_STOP().\r\n"); - ALT_OS_STOP(); - - /* Provide notification to the simulator that we've stopped */ - - ALT_LOG_PRINT_BOOT("[alt_exit.c] Calling ALT_SIM_HALT().\r\n"); - ALT_SIM_HALT(exit_code); - - /* spin forever, since there's no where to go back to */ - - ALT_LOG_PRINT_BOOT("[alt_exit.c] Spinning forever.\r\n"); - while (1); -} diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_fcntl.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_fcntl.c deleted file mode 100644 index 69c1544..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_fcntl.c +++ /dev/null @@ -1,101 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include -#include - -#include "sys/alt_errno.h" -#include "priv/alt_file.h" -#include "alt_types.h" -#include "os/alt_syscall.h" - -#define ALT_FCNTL_FLAGS_MASK ((alt_u32) (O_APPEND | O_NONBLOCK)) - -/* - * fcntl() is a limited implementation of the standard fcntl() system call. - * It can be used to change the state of the flags associated with an open - * file descriptor. Normally these flags are set during the call to - * open(). It is anticipated that the main use of this function will be to - * change the state of a device from blocking to non-blocking (where this is - * supported). - * - * The input argument "fd" is the file descriptor to be manipulated. "cmd" - * is the command to execute. This can be either F_GETFL (return the - * current value of the flags) or F_SETFL (set the value of the flags). - * - * If "cmd" is F_SETFL then the argument "arg" is the new value of flags, - * otherwise "arg" is ignored. Only the flags: O_APPEND and O_NONBLOCK - * can be updated by a call to fcntl(). All other flags remain - * unchanged. - * - * ALT_FCNTL is mapped onto the fcntl() system call in alt_syscall.h - */ - -int ALT_FCNTL (int file, int cmd, ...) -{ - alt_fd* fd; - long flags; - va_list argp; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - switch (cmd) - { - case F_GETFL: - return fd->fd_flags & ~((alt_u32) ALT_FD_FLAGS_MASK); - case F_SETFL: - va_start(argp, cmd); - flags = va_arg(argp, long); - fd->fd_flags &= ~ALT_FCNTL_FLAGS_MASK; - fd->fd_flags |= (flags & ALT_FCNTL_FLAGS_MASK); - va_end(argp); - return 0; - default: - ALT_ERRNO = EINVAL; - return -1; - } - } - - ALT_ERRNO = EBADFD; - return -1; -} diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_fd_lock.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_fd_lock.c deleted file mode 100644 index 0e2a85d..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_fd_lock.c +++ /dev/null @@ -1,75 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "priv/alt_file.h" - -/* - * alt_fd_lock() is called as a consequence of an ioctl call to gain exclusive - * access to a device, i.e.: - * - * ioctl (fd, TIOCEXCL, NULL); - * - * If there are no other open file descriptors which reference the same - * device, then alt_fd_lock() will grant the lock. Further calls to open() - * for this device will fail until the lock is released. - * - * This is done by calling close() for this file descriptor, or by calling: - * - * ioctl (fd, TIOCNXCL, NULL); - * - * The return value is zero for success, or negative in the case of failure. - */ - -int alt_fd_lock (alt_fd* fd) -{ - int i; - int rc = 0; - - ALT_SEM_PEND(alt_fd_list_lock, 0); - - for (i = 0; i < alt_max_fd; i++) - { - if ((&alt_fd_list[i] != fd) && (alt_fd_list[i].dev == fd->dev)) - { - rc = -EACCES; - goto alt_fd_lock_exit; - } - } - fd->fd_flags |= ALT_FD_EXCL; - - alt_fd_lock_exit: - - ALT_SEM_POST(alt_fd_list_lock); - return rc; -} diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_fd_unlock.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_fd_unlock.c deleted file mode 100644 index fb700dc..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_fd_unlock.c +++ /dev/null @@ -1,56 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "priv/alt_file.h" - -/* - * alt_fd_unlock() is the inverse of alt_fd_lock(). It is called as a - * consequence of a TIOCNXCL ioctl request, e.g: - * - * ioctl (fd, TIOCNXCL, NULL); - * - * It enables multiple file descriptors to exist for the same device. This - * is normally the case, but it may have been disabled by a previous call to - * alt_fd_lock(). - * - * Return zero on sucess, and a negative value on failure. - * - * The current implementation always succeeds. - */ - -int alt_fd_unlock (alt_fd* fd) -{ - fd->fd_flags &= ~ALT_FD_EXCL; - return 0; -} diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_find_dev.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_find_dev.c deleted file mode 100644 index 37aefa4..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_find_dev.c +++ /dev/null @@ -1,88 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - -#include "alt_types.h" - -/* - * alt_find_dev() is used by open() in order to locate a previously registered - * device with the name "name". The input argument "llist" is a pointer to the - * head of the device list to search. - * - * The return value is a pointer to the matching device, or NULL if there is - * no match. - * - * "name" must be an exact match for the devices registered name for a match to - * be found. - */ - -alt_dev* alt_find_dev(const char* name, alt_llist* llist) -{ - alt_dev* next = (alt_dev*) llist->next; - alt_32 len; - - len = strlen(name) + 1; - - /* - * Check each list entry in turn, until a match is found, or we reach the - * end of the list (i.e. next winds up pointing back to the list head). - */ - - while (next != (alt_dev*) llist) - { - - /* - * memcmp() is used here rather than strcmp() in order to reduce the size - * of the executable. - */ - - if (!memcmp (next->name, name, len)) - { - /* match found */ - - return next; - } - next = (alt_dev*) next->llist.next; - } - - /* No match found */ - - return NULL; -} - - diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_find_file.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_find_file.c deleted file mode 100644 index 2d97ec2..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_find_file.c +++ /dev/null @@ -1,89 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - -#include "alt_types.h" - -/* - * alt_find_file() is used by open() in order to locate a previously registered - * filesystem that owns that mount point that contains the file named "name". - * - * The return value is a pointer to the matching filesystem, or NULL if there is - * no match. - * - * A match is considered to have been found if the filesystem name followed by - * either '/' or '\0' is the prefix of the filename. For example the filename: - * "/myfilesystem/junk.txt" would match: "/myfilesystem", but not: "/myfile". - */ - -alt_dev* alt_find_file (const char* name) -{ - alt_dev* next = (alt_dev*) alt_fs_list.next; - - alt_32 len; - - /* - * Check each list entry in turn, until a match is found, or we reach the - * end of the list (i.e. next winds up pointing back to the list head). - */ - - while (next != (alt_dev*) &alt_fs_list) - { - len = strlen(next->name); - - if (next->name[len-1] == '/') - { - len -= 1; - } - - if (((name[len] == '/') || (name[len] == '\0')) && - !memcmp (next->name, name, len)) - { - /* match found */ - - return next; - } - next = (alt_dev*) next->llist.next; - } - - /* No match found */ - - return NULL; -} - - diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_flash_dev.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_flash_dev.c deleted file mode 100644 index 213f721..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_flash_dev.c +++ /dev/null @@ -1,69 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* Alt_flash.c - Functions to register a flash device to the "generic" flash * -* interface * -* * -* Author PRR * -* * -******************************************************************************/ - -#include -#include "sys/alt_llist.h" -#include "sys/alt_flash_dev.h" -#include "priv/alt_file.h" - -ALT_LLIST_HEAD(alt_flash_dev_list); - -alt_flash_fd* alt_flash_open_dev(const char* name) -{ - alt_flash_dev* dev = (alt_flash_dev*)alt_find_dev(name, &alt_flash_dev_list); - - if ((dev) && dev->open) - { - return dev->open(dev, name); - } - - return dev; -} - -void alt_flash_close_dev(alt_flash_fd* fd) -{ - if (fd && fd->close) - { - fd->close(fd); - } - return; -} - diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_fork.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_fork.c deleted file mode 100644 index ce74df0..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_fork.c +++ /dev/null @@ -1,57 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_warning.h" -#include "sys/alt_errno.h" -#include "os/alt_syscall.h" - -/* - * The fork() system call is used by newlib to create a duplicate copy of the - * curent process. This is unsupported in the HAL environment. However a - * "do-nothing" implementation is still provied for newlib compatability. - * - * ALT_FORK is mapped onto the fork() system call in alt_syscall.h - */ - -int ALT_FORK (void) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(fork); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} - - diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_fs_reg.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_fs_reg.c deleted file mode 100644 index 13437a1..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_fs_reg.c +++ /dev/null @@ -1,75 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - -/* - * The alt_fs_reg() function is used to register a file system. Once registered - * a device can be accessed using the standard posix calls: open(), read(), - * write() etc. - * - * System behaviour is undefined in the event that a file system is registered - * with a name that conflicts with an existing device or file system. - * - * alt_fs_reg() is not thread safe in the sense that there should be no other - * thread using the file system list at the time that alt_dev_reg() is called. In - * practice this means that alt_fs_reg() should only be called while operating - * in a single threaded mode. The expectation is that it will only be called - * by the file system initilisation functions invoked by alt_sys_init(), which in - * turn should only be called by the single threaded C startup code. - * - * A return value of zero indicates success. A negative return value indicates - * failure. - */ - -int alt_fs_reg (alt_dev* dev) -{ - /* - * check that the device has a name. - */ - - if (!dev->name) - { - return -ENODEV; - } - - /* - * register the file system. - */ - - alt_llist_insert(&alt_fs_list, &dev->llist); - - return 0; -} diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_fstat.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_fstat.c deleted file mode 100644 index af5d527..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_fstat.c +++ /dev/null @@ -1,128 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include "sys/alt_dev.h" -#include "sys/alt_warning.h" -#include "sys/alt_errno.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -/* - * The fstat() system call is used to obtain information about the capabilities - * of an open file descriptor. By default file descriptors are marked as - * being character devices. If a device or file system wishes to advertise - * alternative capabilities then they can register an fstat() function within - * their associated alt_dev structure. This will be called to fill in the - * entries in the imput "st" structure. - * - * This function is provided for compatability with newlib. - * - * ALT_FSTAT is mapped onto the fstat() system call in alt_syscall.h - */ - -#ifdef ALT_USE_DIRECT_DRIVERS - -#include "system.h" - -/* - * Provide minimal version that just describes all file descriptors - * as character devices for provided stdio devices. - */ -int ALT_FSTAT (int file, struct stat *st) -{ - switch (file) { -#ifdef ALT_STDIN_PRESENT - case 0: /* stdin file descriptor */ -#endif /* ALT_STDIN_PRESENT */ -#ifdef ALT_STDOUT_PRESENT - case 1: /* stdout file descriptor */ -#endif /* ALT_STDOUT_PRESENT */ -#ifdef ALT_STDERR_PRESENT - case 2: /* stderr file descriptor */ -#endif /* ALT_STDERR_PRESENT */ - st->st_mode = _IFCHR; - return 0; - default: - return -1; - } - -#if !defined(ALT_STDIN_PRESENT) && !defined(ALT_STDOUT_PRESENT) && !defined(ALT_STDERR_PRESENT) - /* Generate a link time warning, should this function ever be called. */ - ALT_STUB_WARNING(fstat); -#endif -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -int ALT_FSTAT (int file, struct stat *st) -{ - alt_fd* fd; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - /* Call the drivers fstat() function to fill out the "st" structure. */ - - if (fd->dev->fstat) - { - return fd->dev->fstat(fd, st); - } - - /* - * If no function is provided, mark the fd as belonging to a character - * device. - */ - - else - { - st->st_mode = _IFCHR; - return 0; - } - } - else - { - ALT_ERRNO = EBADFD; - return -1; - } -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_get_fd.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_get_fd.c deleted file mode 100644 index db17b2c..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_get_fd.c +++ /dev/null @@ -1,105 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - -#include "alt_types.h" - -#include "system.h" - -/* - * alt_get_fd() is called to allocate a new file descriptor from the file - * descriptor pool. If a file descriptor is succesfully allocated, it is - * configured to refer to device "dev". - * - * The return value is the index of the file descriptor structure (i.e. - * the offset of the file descriptor within the file descriptor array). A - * negative value indicates failure. - */ - -int alt_get_fd (alt_dev* dev) -{ - alt_32 i; - int rc = -EMFILE; - - /* - * Take the alt_fd_list_lock semaphore in order to avoid races when - * accessing the file descriptor pool. - */ - - ALT_SEM_PEND(alt_fd_list_lock, 0); - - /* - * Search through the list of file descriptors, and allocate the first - * free descriptor that's found. - * - * If a free descriptor is found, then the value of "alt_max_fd" is - * updated accordingly. "alt_max_fd" is a 'highwater mark' which - * indicates the highest file descriptor ever allocated. This is used to - * improve efficency when searching the file descriptor list, and - * therefore reduce contention on the alt_fd_list_lock semaphore. - */ - - for (i = 0; i < ALT_MAX_FD; i++) - { - if (!alt_fd_list[i].dev) - { - alt_fd_list[i].dev = dev; - if (i > alt_max_fd) - { - alt_max_fd = i; - } - rc = i; - goto alt_get_fd_exit; - } - } - - alt_get_fd_exit: - - /* - * Release the alt_fd_list_lock semaphore now that we are done with the - * file descriptor pool. - */ - - ALT_SEM_POST(alt_fd_list_lock); - - return rc; -} - - - - diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_getchar.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_getchar.c deleted file mode 100644 index a8f50d5..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_getchar.c +++ /dev/null @@ -1,61 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#ifdef ALT_USE_DIRECT_DRIVERS -#include "system.h" -#include "sys/alt_driver.h" -#include "sys/alt_stdio.h" -#include "priv/alt_file.h" -#include "unistd.h" -#endif - -/* - * Uses the ALT_DRIVER_READ() macro to call directly to driver if available. - * Otherwise, uses newlib provided getchar() routine. - */ -int -alt_getchar(void) -{ -#ifdef ALT_USE_DIRECT_DRIVERS - ALT_DRIVER_READ_EXTERNS(ALT_STDIN_DEV); - char c; - - if (ALT_DRIVER_READ(ALT_STDIN_DEV, &c, 1, alt_fd_list[STDIN_FILENO].fd_flags) <= 0) { - return -1; - } - return c; -#else - return getchar(); -#endif -} diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_getpid.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_getpid.c deleted file mode 100644 index 2228c7e..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_getpid.c +++ /dev/null @@ -1,47 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "os/alt_syscall.h" - -/* - * The getpid() system call is used by newlib to obtain the current process - * id. Since there is only ever a single process in the HAL environment, - * this just returns a constant. - * - * ALT_GETPID is mapped onto the getpid() system call in alt_syscall.h - */ - -int ALT_GETPID (void) -{ - return 0; -} - diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_gettod.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_gettod.c deleted file mode 100644 index ed86cba..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_gettod.c +++ /dev/null @@ -1,125 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include - -#include "sys/alt_alarm.h" -#include "alt_types.h" -#include "os/alt_syscall.h" - -/* - * Macro defining the number of micoseconds in a second. - */ - -#define ALT_US (1000000) - -/* - * "alt_timezone" and "alt_resettime" are the values of the the reset time and - * time zone set through the last call to settimeofday(). By default they are - * zero initialised. - */ - -struct timezone alt_timezone = {0, 0}; -struct timeval alt_resettime = {0, 0}; - -/* - * gettimeofday() can be called to obtain a time structure which indicates the - * current "wall clock" time. This is calculated using the elapsed number of - * system clock ticks, and the value of "alt_resettime" and "alt_timezone" set - * through the last call to settimeofday(). - * - * Warning: if this function is called concurrently with a call to - * settimeofday(), the value returned by gettimeofday() will be unreliable. - * - * ALT_GETTIMEOFDAY is mapped onto the gettimeofday() system call in - * alt_syscall.h - */ - - -#if defined (__GNUC__) && (__GNUC__ >= 4) -int ALT_GETTIMEOFDAY (struct timeval *ptimeval, void *ptimezone_vptr) -{ - struct timezone *ptimezone = (struct timezone*)ptimezone_vptr; -#else -int ALT_GETTIMEOFDAY (struct timeval *ptimeval, struct timezone *ptimezone) -{ -#endif - - alt_u32 nticks = alt_nticks (); - alt_u32 tick_rate = alt_ticks_per_second (); - - /* - * Check to see if the system clock is running. This is indicated by a - * non-zero system clock rate. If the system clock is not running, an error - * is generated and the contents of "ptimeval" and "ptimezone" are not - * updated. - */ - - if (tick_rate) - { - ptimeval->tv_sec = alt_resettime.tv_sec + nticks/tick_rate; - ptimeval->tv_usec = alt_resettime.tv_usec + - (alt_u32)(((alt_u64)nticks*(ALT_US/tick_rate))%ALT_US); - - while(ptimeval->tv_usec < 0) { - if (ptimeval->tv_sec <= 0) - { - ptimeval->tv_sec = 0; - ptimeval->tv_usec = 0; - break; - } - else - { - ptimeval->tv_sec--; - ptimeval->tv_usec += ALT_US; - } - } - - while(ptimeval->tv_usec >= ALT_US) { - ptimeval->tv_sec++; - ptimeval->tv_usec -= ALT_US; - } - - if (ptimezone) - { - ptimezone->tz_minuteswest = alt_timezone.tz_minuteswest; - ptimezone->tz_dsttime = alt_timezone.tz_dsttime; - } - - return 0; - } - - return -ENOTSUP; -} - diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_gmon.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_gmon.c deleted file mode 100644 index 6add9f1..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_gmon.c +++ /dev/null @@ -1,272 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include -#include -#include - -#include "priv/nios2_gmon_data.h" - -#include "sys/alt_irq.h" -#include "sys/alt_alarm.h" - - -/* Macros */ - -/* How large should the bins be which we use to generate the histogram */ -#define PCSAMPLE_BYTES_PER_BUCKET 32 - -#define NIOS2_READ_EA(dest) __asm__ ("mov %0, ea" : "=r" (dest)) - -/* The compiler inserts calls to mcount() at the start of - * every function call. The structure mcount_fn_arc records t - * he return address of the function called (in from_pc) - * and the return address of the mcount function - * (in self_pc). The number of times this arc is executed is - * recorded in the field count. - */ -struct mcount_fn_arc -{ - struct mcount_fn_arc * next; - void * from_pc; - unsigned int count; -}; - -/* We need to maintain a list of pointers to the heads of each adjacency - * list so that we can find them when writing out the gmon.out file. Since - * we don't know at the start of program execution how many functions will - * be called we use a list structure to do this. - */ -struct mcount_fn_entry -{ - struct mcount_fn_entry * next; - void * self_pc; - struct mcount_fn_arc * arc_head; -}; - -/* function prototypes */ - -void __mcount_record(void * self_pc, void * from_pc, struct mcount_fn_entry * fn_entry, struct mcount_fn_entry * * fn_head) __attribute__ ((no_instrument_function)); - -static __inline__ void * mcount_allocate(unsigned int size) __attribute__ ((no_instrument_function)); -static int nios2_pcsample_init(void) __attribute__ ((no_instrument_function)); -static alt_u32 nios2_pcsample(void* alarm) __attribute__ ((no_instrument_function)); - -/* global variables */ - -/* stext and etext are defined in the linker script */ -extern char stext[]; -extern char etext[]; - -/* Is the PC sampling stuff enabled yet? */ -static int pcsample_need_init = 1; - -#define HASH_BUCKETS 64 /* Must be a power of 2 */ - -/* This points to the list of adjacency list pointers. */ -struct mcount_fn_entry * __mcount_fn_head[HASH_BUCKETS]; - -/* pointer to the in-memory buffer containing the histogram */ -static unsigned short* s_pcsamples = 0; - -/* the address of the start and end of text section */ -static const unsigned int s_low_pc = (unsigned int)stext; -static const unsigned int s_high_pc = (unsigned int)etext; - -/* the alarm structure to register for pc sampling */ -static alt_alarm s_nios2_pcsample_alarm; - -unsigned int alt_gmon_data[GMON_DATA_SIZE] = -{ - 0x6e6f6d67, /* "gmon" */ - GMON_DATA_SIZE, - 0, - (unsigned int)stext, - (unsigned int)etext, - PCSAMPLE_BYTES_PER_BUCKET, - 0, - (unsigned int)__mcount_fn_head, - (unsigned int)(__mcount_fn_head + HASH_BUCKETS) -}; - -/* This holds the current slab of memory we're allocating out of */ -static char * mcount_slab_ptr = 0; -static int mcount_slab_size = 0; - -#define MCOUNT_SLAB_INCREMENT 1020 - - -/* - * We can't use malloc to allocate memory because that's too complicated, and - * can't be called at interrupt time. Use the lower level allocator instead - * because that's interrupt safe (and because we never free anything). - * - * For speed, we allocate a block of data at once. - */ -static __inline__ void * mcount_allocate(unsigned int size) -{ - void * data; - - if (size > mcount_slab_size) - { - mcount_slab_ptr = sbrk(MCOUNT_SLAB_INCREMENT); - mcount_slab_size = MCOUNT_SLAB_INCREMENT; - } - - data = mcount_slab_ptr; - mcount_slab_ptr += size; - mcount_slab_size -= size; - - return data; -} - - -/* - * Add the arc with the values of frompc and topc given to the graph. - * This function might be called at interrupt time so must be able to - * cope with reentrancy. - * - * The fast case, where we have already allocated a function arc, has been - * handled by the assmebler code. - */ -void __mcount_record(void * self_pc, void * from_pc, struct mcount_fn_entry * fn_entry, struct mcount_fn_entry * * fn_head) -{ - alt_irq_context context; - struct mcount_fn_arc * arc_entry; - - /* Keep trying to start up the PC sampler until it is running. - * (It can't start until the timer is going). - */ - if (pcsample_need_init) - { - pcsample_need_init = 0; - pcsample_need_init = nios2_pcsample_init(); - } - - /* - * We must disable interrupts around the allocation and the list update to - * prevent corruption if the instrumented function is re-entrant. - * - * It's safe for the code above to be stepping through the chain and be - * interrupted by this code modifying it - there is an edge case which will - * leave two copies of the same arc on the list (both with count=1), but - * this is dealt with on the host. - */ - context = alt_irq_disable_all(); - - if (fn_entry == NULL) - { - /* Add it to the list of functions we must output later. */ - fn_entry = (struct mcount_fn_entry *)mcount_allocate(sizeof(struct mcount_fn_entry)); - - fn_entry->self_pc = self_pc; - fn_entry->arc_head = NULL; - - fn_entry->next = *fn_head; - *fn_head = fn_entry; - } - - /* We will need a new list entry - if there was a list entry before - * then the assembler code would have handled it. */ - arc_entry = (struct mcount_fn_arc *)mcount_allocate(sizeof(struct mcount_fn_arc)); - - arc_entry->from_pc = from_pc; - arc_entry->count = 1; - - arc_entry->next = fn_entry->arc_head; - fn_entry->arc_head = arc_entry; - - alt_irq_enable_all(context); -} - - -/* - * nios2_pcsample_init starts profiling. - * It is called the first time mcount is called, and on subsequent calls to - * mcount until it returns zero. It initializes the pc histogram and turns on - * timer driven pc sampling. - */ -static int nios2_pcsample_init(void) -{ - unsigned int pcsamples_size; - - /* We sample the PC every tick */ - unsigned int prof_rate = alt_ticks_per_second(); - if (prof_rate == 0) - return 1; - - /* allocate the histogram buffer s_pcsamples */ - pcsamples_size = (s_high_pc - s_low_pc)/PCSAMPLE_BYTES_PER_BUCKET; - s_pcsamples = (unsigned short*)sbrk(pcsamples_size * sizeof(unsigned short)); - - if (s_pcsamples != 0) - { - /* initialize the buffer to zero */ - memset(s_pcsamples, 0, pcsamples_size * sizeof(unsigned short)); - - alt_gmon_data[GMON_DATA_PROFILE_DATA] = (int)s_pcsamples; - alt_gmon_data[GMON_DATA_PROFILE_RATE] = prof_rate; - - /* Sample every tick (it's cheap) */ - alt_alarm_start(&s_nios2_pcsample_alarm, 1, nios2_pcsample, 0); - } - - return 0; -} - - -/* - * Sample the PC value and store it in the histogram - */ -static alt_u32 nios2_pcsample(void* context) -{ - unsigned int pc; - unsigned int bucket; - - /* read the exception return address - this will be - * inaccurate if there are nested interrupts but we - * assume that this is rare and the inaccuracy will - * not be great */ - NIOS2_READ_EA(pc); - - /* - * If we're within the profilable range then increment the relevant - * bucket in the histogram - */ - if (pc >= s_low_pc && pc < s_high_pc && s_pcsamples != 0) - { - bucket = (pc - s_low_pc)/PCSAMPLE_BYTES_PER_BUCKET; - s_pcsamples[bucket]++; - } - - /* Sample every tick */ - return 1; -} - diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_icache_flush.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_icache_flush.c deleted file mode 100644 index 4b706ed..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_icache_flush.c +++ /dev/null @@ -1,84 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "nios2.h" -#include "system.h" - -#include "alt_types.h" -#include "sys/alt_cache.h" - -/* - * alt_icache_flush() is called to flush the instruction cache for a memory - * region of length "len" bytes, starting at address "start". - */ - -void alt_icache_flush (void* start, alt_u32 len) -{ -#if NIOS2_ICACHE_SIZE > 0 - - char* i; - char* end; - - /* - * This is the most we would ever need to flush. - */ - - if (len > NIOS2_ICACHE_SIZE) - { - len = NIOS2_ICACHE_SIZE; - } - - end = ((char*) start) + len; - - for (i = start; i < end; i+= NIOS2_ICACHE_LINE_SIZE) - { - __asm__ volatile ("flushi %0" :: "r" (i)); - } - - /* - * For an unaligned flush request, we've got one more line left. - * Note that this is dependent on NIOS2_ICACHE_LINE_SIZE to be a - * multiple of 2 (which it always is). - */ - - if (((alt_u32) start) & (NIOS2_ICACHE_LINE_SIZE - 1)) - { - __asm__ volatile ("flushi %0" :: "r" (i)); - } - - /* - * Having flushed the cache, flush any stale instructions in the - * pipeline - */ - - __asm__ volatile ("flushp"); - -#endif /* NIOS2_ICACHE_SIZE > 0 */ -} diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_icache_flush_all.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_icache_flush_all.c deleted file mode 100644 index 5088552..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_icache_flush_all.c +++ /dev/null @@ -1,46 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "nios2.h" -#include "system.h" - -#include "alt_types.h" -#include "sys/alt_cache.h" - -/* - * alt_icache_flush_all() is called to flush the entire instruction cache. - */ - -void alt_icache_flush_all (void) -{ -#if NIOS2_ICACHE_SIZE > 0 - alt_icache_flush (0, NIOS2_ICACHE_SIZE); -#endif -} diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_iic.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_iic.c deleted file mode 100644 index 1db5afa..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_iic.c +++ /dev/null @@ -1,106 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ -#include "system.h" - -/* - * This file implements the HAL Enhanced interrupt API for Nios II processors - * with an internal interrupt controller (IIC). For most routines, this serves - * as a wrapper layer over the legacy interrupt API (which must be used with - * the IIC only). - * - * Use of the enhanced API is recommended so that application and device - * drivers are compatible with a Nios II system configured with an external - * interrupt controller (EIC), or IIC. This will afford maximum portability. - * - * If an EIC is present, the EIC device driver must provide these routines, - * because their operation will be specific to that EIC type. - */ -#ifndef NIOS2_EIC_PRESENT -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - -#include "sys/alt_irq.h" -#include "priv/alt_iic_isr_register.h" -#include "priv/alt_legacy_irq.h" - -/** @Function Description: This function registers an interrupt handler. - * If the function is succesful, then the requested interrupt will be enabled upon - * return. Registering a NULL handler will disable the interrupt. - * @API Type: External - * @param ic_id Ignored. - * @param irq IRQ number - * @return 0 if successful, else error (-1) - */ -int alt_ic_isr_register(alt_u32 ic_id, alt_u32 irq, alt_isr_func isr, - void *isr_context, void *flags) -{ - return alt_iic_isr_register(ic_id, irq, isr, isr_context, flags); -} - -/** @Function Description: This function enables a single interrupt. - * @API Type: External - * @param ic_id Ignored. - * @param irq IRQ number - * @return 0 if successful, else error (-1) - */ -int alt_ic_irq_enable (alt_u32 ic_id, alt_u32 irq) -{ - return alt_irq_enable(irq); -} - -/** @Function Description: This function disables a single interrupt. - * @API Type: External - * @param ic_id Ignored. - * @param irq IRQ number - * @return 0 if successful, else error (-1) - */ -int alt_ic_irq_disable(alt_u32 ic_id, alt_u32 irq) -{ - return alt_irq_disable(irq); -} - -/** @Function Description: This function to determine if corresponding - * interrupt is enabled. - * @API Type: External - * @param ic_id Ignored. - * @param irq IRQ number - * @return Zero if corresponding interrupt is disabled and - * non-zero otherwise. - */ -alt_u32 alt_ic_irq_enabled(alt_u32 ic_id, alt_u32 irq) -{ - alt_u32 irq_enabled; - - NIOS2_READ_IENABLE(irq_enabled); - - return (irq_enabled & (1 << irq)) ? 1: 0; -} - -#endif /* ALT_ENHANCED_INTERRUPT_API_PRESENT */ -#endif /* NIOS2_EIC_PRESENT */ diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_iic_isr_register.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_iic_isr_register.c deleted file mode 100644 index b104395..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_iic_isr_register.c +++ /dev/null @@ -1,104 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ -#include -#include "system.h" - -/* - * Provides an interrupt registry mechanism for the any CPUs internal interrupt - * controller (IIC) when the enhanced interrupt API is active. - */ -#ifndef ALT_CPU_EIC_PRESENT -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - -#include "alt_types.h" -#include "sys/alt_irq.h" -#include "priv/alt_iic_isr_register.h" - -/* - * The header, alt_irq_entry.h, contains the exception entry point, and is - * provided by the processor component. It is included here, so that the code - * will be added to the executable only if alt_irq_register() is present, i.e. - * if no interrupts are registered - there's no need to provide any - * interrupt handling. - */ - -#include "sys/alt_irq_entry.h" - -/* - * The header, alt_irq_table.h contains a table describing which function - * handles each interrupt. - */ - -#include "priv/alt_irq_table.h" - -/** @Function Description: This function registers an interrupt handler. - * If the function is succesful, then the requested interrupt will be enabled - * upon return. Registering a NULL handler will disable the interrupt. - * - * @API Type: External - * @param ic_id Interrupt controller ID - * @param irq IRQ ID number - * @param isr Pointer to interrupt service routine - * @param isr_context Opaque pointer passed to ISR - * @param flags - * @return 0 if successful, else error (-1) - */ -int alt_iic_isr_register(alt_u32 ic_id, alt_u32 irq, alt_isr_func isr, - void *isr_context, void *flags) -{ - int rc = -EINVAL; - int id = irq; /* IRQ interpreted as the interrupt ID. */ - alt_irq_context status; - - if (id < ALT_NIRQ) - { - /* - * interrupts are disabled while the handler tables are updated to ensure - * that an interrupt doesn't occur while the tables are in an inconsistant - * state. - */ - - status = alt_irq_disable_all(); - - alt_irq[id].handler = isr; - alt_irq[id].context = isr_context; - - rc = (isr) ? alt_ic_irq_enable(ic_id, id) : alt_ic_irq_disable(ic_id, id); - - alt_irq_enable_all(status); - } - - return rc; -} - -#endif /* ALT_ENHANCED_INTERRUPT_API_PRESENT */ -#endif /* ALT_CPU_EIC_PRESENT */ diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_instruction_exception_entry.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_instruction_exception_entry.c deleted file mode 100644 index f4f52fc..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_instruction_exception_entry.c +++ /dev/null @@ -1,203 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2008 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ -#include "sys/alt_exceptions.h" -#include "nios2.h" -#include "alt_types.h" -#include "system.h" - -/* - * This file implements support for calling user-registered handlers for - * instruction-generated exceptions. This handler could also be reached - * in the event of a spurious interrupt. - * - * The handler code is optionally enabled through the "Enable - * Instruction-related Exception API" HAL BSP setting, which will - * define the macro below. - */ -#ifdef ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API - -/* Function pointer to exception callback routine */ -alt_exception_result (*alt_instruction_exception_handler) - (alt_exception_cause, alt_u32, alt_u32) = 0x0; - -/* Link entry routine to .exceptions section */ -int alt_instruction_exception_entry (alt_u32 exception_pc) - __attribute__ ((section (".exceptions"))); - -/* - * This is the entry point for instruction-generated exceptions handling. - * This routine will be called by alt_exceptions_entry.S, after it determines - * that an exception could not be handled by handlers that preceed that - * of instruction-generated exceptions (such as interrupts). - * - * For this to function properly, you must register an exception handler - * using alt_instruction_exception_register(). This routine will call - * that handler if it has been registered. Absent a handler, it will - * break break or hang as discussed below. - */ -int alt_instruction_exception_entry (alt_u32 exception_pc) -{ - alt_u32 cause, badaddr; - -/* - * If the processor hardware has the optional EXCEPTIONS & BADADDR registers, - * read them and pass their content to the user handler. These are always - * present if the MMU or MPU is enabled, and optionally for other advanced - * exception types via the "Extra exceptions information" setting in the - * processor (hardware) configuration. - * - * If these registers are not present, the cause field will be set to - * NIOS2_EXCEPTION_CAUSE_NOT_PRESENT. Your handling routine should - * check the validity of the cause argument before proceeding. - */ -#ifdef NIOS2_HAS_EXTRA_EXCEPTION_INFO - /* Get exception cause & "badaddr" */ - NIOS2_READ_EXCEPTION(cause); - cause = ( (cause & NIOS2_EXCEPTION_REG_CAUSE_MASK) >> - NIOS2_EXCEPTION_REG_CAUSE_OFST ); - - NIOS2_READ_BADADDR(badaddr); -#else - cause = NIOS2_EXCEPTION_CAUSE_NOT_PRESENT; - badaddr = 0; -#endif /* NIOS2_HAS_EXTRA_EXCEPTION_INFO */ - - if(alt_instruction_exception_handler) { - /* - * Call handler. Its return value indicates whether the exception-causing - * instruction should be re-issued. The code that called us, - * alt_eceptions_entry.S, will look at this value and adjust the ea - * register as necessary - */ - return alt_instruction_exception_handler(cause, exception_pc, badaddr); - } - /* - * We got here because an instruction-generated exception occured, but no - * handler is present. We do not presume to know how to handle it. If the - * debugger is present, break, otherwise hang. - * - * If you've reached here in the debugger, consider examining the - * EXCEPTIONS register cause bit-field, which was read into the 'cause' - * variable above, and compare it against the exceptions-type enumeration - * in alt_exceptions.h. This register is availabe if the MMU or MPU is - * present, or if the "Extra exceptions information" hardware option is - * selected. - * - * If you get here then one of the following could have happened: - * - * - An instruction-generated exception occured, and the processor - * does not have the extra exceptions feature enabled, or you - * have not registered a handler using - * alt_instruction_exception_register() - * - * Some examples of instruction-generated exceptions and why they - * might occur: - * - * - Your program could have been compiled for a full-featured - * Nios II core, but it is running on a smaller core, and - * instruction emulation has been disabled by defining - * ALT_NO_INSTRUCTION_EMULATION. - * - * You can work around the problem by re-enabling instruction - * emulation, or you can figure out why your program is being - * compiled for a system other than the one that it is running on. - * - * - Your program has executed a trap instruction, but has not - * implemented a handler for this instruction. - * - * - Your program has executed an illegal instruction (one which is - * not defined in the instruction set). - * - * - Your processor includes an MMU or MPU, and you have enabled it - * before registering an exception handler to service exceptions it - * generates. - * - * The problem could also be hardware related: - * - If your hardware is broken and is generating spurious interrupts - * (a peripheral which negates its interrupt output before its - * interrupt handler has been executed will cause spurious interrupts) - */ - else { -#ifdef NIOS2_HAS_DEBUG_STUB - NIOS2_BREAK(); -#else - while(1) - ; -#endif /* NIOS2_HAS_DEBUG_STUB */ - } - - /* // We should not get here. Remove compiler warning. */ - return NIOS2_EXCEPTION_RETURN_REISSUE_INST; -} - -#endif /* ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API */ - -/* - * This routine indicates whether a particular exception cause will have - * set a valid address into the BADADDR register, which is included - * in the arguments to a user-registered instruction-generated exception - * handler. Many exception types do not set valid contents in BADADDR; - * this is a convenience routine to easily test the validity of that - * argument in your handler. - * - * Note that this routine will return false (0) for cause '12', - * TLB miss. This is because there are four exception types that - * share that cause, two of which do not have a valid BADADDR. You - * must determine BADADDR's validity for these. - * - * Arguments: - * cause: The 5-bit exception cause field of the EXCEPTIONS register, - * shifted to the LSB position. You may pass the 'cause' argument - * in a handler you registered directy to this routine. - * - * Return: 1: BADADDR (bad_addr argument to handler) is valid - * 0: BADADDR is not valid - */ -int alt_exception_cause_generated_bad_addr(alt_exception_cause cause) -{ - switch (cause) { - case NIOS2_EXCEPTION_SUPERVISOR_ONLY_DATA_ADDR: - return 1; - case NIOS2_EXCEPTION_MISALIGNED_DATA_ADDR: - return 1; - case NIOS2_EXCEPTION_MISALIGNED_TARGET_PC: - return 1; - case NIOS2_EXCEPTION_TLB_READ_PERM_VIOLATION: - return 1; - case NIOS2_EXCEPTION_TLB_WRITE_PERM_VIOLATION: - return 1; - case NIOS2_EXCEPTION_MPU_DATA_REGION_VIOLATION: - return 1; - default: - return 0; - } -} diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_instruction_exception_register.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_instruction_exception_register.c deleted file mode 100644 index b059e1d..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_instruction_exception_register.c +++ /dev/null @@ -1,82 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2008 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ -#include "sys/alt_exceptions.h" -#include "alt_types.h" -#include "system.h" - -/* - * This file implements support for calling user-registered handlers for - * instruction-generated exceptions. - * - * The registry API is optionally enabled through the "Enable - * Instruction-related Exception API" HAL BSP setting, which will - * define the macro below. - */ -#ifdef ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API - -/* - * The header, alt_exception_handler_registry.h contains a struct describing - * the registered exception handler - */ -#include "priv/alt_exception_handler_registry.h" - -/* - * Pull in the exception entry assembly code. This will not be linked in - * unless this object is linked into the executable (i.e. only if - * alt_instruction_exception_register() is called). - */ -__asm__( "\n\t.globl alt_exception" ); - -/* - * alt_instruction_exception_register() is called to register a handler to - * service instruction-generated exceptions that are not handled by the - * default exception handler code (interrupts, and optionally unimplemented - * instructions and traps). - * - * Passing null (0x0) in the handler argument will disable a previously- - * registered handler. - * - * Note that if no handler is registered, exceptions that are not processed - * using the built-in handler (interrupts, and optionally unimplemented - * instructions and traps) are treated as unknown exceptions, resulting - * in either a break or an infinite loop. - */ -void alt_instruction_exception_register ( - alt_exception_result (*exception_handler)( - alt_exception_cause cause, - alt_u32 exception_pc, - alt_u32 bad_addr) ) -{ - alt_instruction_exception_handler = exception_handler; -} - -#endif /* ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API */ diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_io_redirect.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_io_redirect.c deleted file mode 100644 index 8c862f7..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_io_redirect.c +++ /dev/null @@ -1,98 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include -#include - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - - -/* - * alt_open_fd() is similar to open() in that it is used to obtain a file - * descriptor for the file named "name". The "flags" and "mode" arguments are - * identical to the "flags" and "mode" arguments of open(). - * - * The distinction between the two functions is that the file descriptor - * structure to use is passed in as an argument, rather than allocated from the - * list of free file descriptors. - * - * This is used by alt_io_redirect() to redirect the stdin, stdout and stderr - * file descriptors to point to new devices. - * - * If the device can not be succesfully opened, then the input file descriptor - * remains unchanged. - */ - -static void alt_open_fd(alt_fd* fd, const char* name, int flags, int mode) -{ - int old; - - old = open (name, flags, mode); - - if (old >= 0) - { - fd->dev = alt_fd_list[old].dev; - fd->priv = alt_fd_list[old].priv; - fd->fd_flags = alt_fd_list[old].fd_flags; - - alt_release_fd (old); - } -} - -/* - * alt_io_redirect() is called once the device/filesystem lists have been - * initialised, but before main(). Its function is to redirect standard in, - * standard out and standard error so that they point to the devices selected by - * the user (as defined in system.h). - * - * Prior to the call to this function, io is directed towards /dev/null. If - * i/o can not be redirected to the requested device, for example if the device - * does not exist, then it remains directed at /dev/null. - */ - -void alt_io_redirect(const char* stdout_dev, - const char* stdin_dev, - const char* stderr_dev) -{ - /* Redirect the channels */ - - alt_open_fd (&alt_fd_list[STDOUT_FILENO], stdout_dev, O_WRONLY, 0777); - alt_open_fd (&alt_fd_list[STDIN_FILENO], stdin_dev, O_RDONLY, 0777); - alt_open_fd (&alt_fd_list[STDERR_FILENO], stderr_dev, O_WRONLY, 0777); -} - - - - diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_ioctl.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_ioctl.c deleted file mode 100644 index f5d7ef1..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_ioctl.c +++ /dev/null @@ -1,170 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "sys/ioctl.h" -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -/* - * The ioctl() system call is provided so that application code can manipulate - * the i/o capabilities of a device in device specific ways. This is identical - * to the standard posix ioctl() function. - * - * In general this implementation simply vectors ioctl requests to the - * apropriate drivers ioctl function (as registered in the drivers alt_dev - * structure). - * - * However in the case of devices (as oposed to filesystem), the TIOCEXCL and - * TIOCNXCL requests are handled without reference to the driver. These - * requests are used to lock/release a device for exclusive access. - * - * Handling these requests centrally eases the task of device driver - * development. - * - * ALT_IOCTL is mapped onto the ioctl() system call in alt_syscall.h - */ - -#ifdef ALT_USE_DIRECT_DRIVERS - -#include "system.h" -#include "sys/alt_driver.h" - -/* - * Provide minimal version that calls ioctl routine of provided stdio devices. - */ -int ALT_IOCTL (int file, int req, void* arg) -{ -#ifdef ALT_STDIN_PRESENT - ALT_DRIVER_IOCTL_EXTERNS(ALT_STDIN_DEV); -#endif -#ifdef ALT_STDOUT_PRESENT - ALT_DRIVER_IOCTL_EXTERNS(ALT_STDOUT_DEV); -#endif -#ifdef ALT_STDERR_PRESENT - ALT_DRIVER_IOCTL_EXTERNS(ALT_STDERR_DEV); -#endif - -#if !defined(ALT_STDIN_PRESENT) && !defined(ALT_STDOUT_PRESENT) && !defined(ALT_STDERR_PRESENT) - /* Generate a link time warning, should this function ever be called. */ - ALT_STUB_WARNING(ioctl); -#endif - - switch (file) { -#ifdef ALT_STDIN_PRESENT - case 0: /* stdin file descriptor */ - return ALT_DRIVER_IOCTL(ALT_STDIN_DEV, req, arg); -#endif /* ALT_STDIN_PRESENT */ -#ifdef ALT_STDOUT_PRESENT - case 1: /* stdout file descriptor */ - return ALT_DRIVER_IOCTL(ALT_STDOUT_DEV, req, arg); -#endif /* ALT_STDOUT_PRESENT */ -#ifdef ALT_STDERR_PRESENT - case 2: /* stderr file descriptor */ - return ALT_DRIVER_IOCTL(ALT_STDERR_DEV, req, arg); -#endif /* ALT_STDERR_PRESENT */ - default: - ALT_ERRNO = EBADFD; - return -1; - } -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -int ALT_IOCTL (int file, int req, void* arg) -{ - alt_fd* fd; - int rc; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - - /* - * In the case of device drivers (not file systems) handle the TIOCEXCL - * and TIOCNXCL requests as special cases. - */ - - if (fd->fd_flags & ALT_FD_DEV) - { - if (req == TIOCEXCL) - { - rc = alt_fd_lock (fd); - goto ioctl_done; - } - else if (req == TIOCNXCL) - { - rc = alt_fd_unlock (fd); - goto ioctl_done; - } - } - - /* - * If the driver provides an ioctl() function, call that to handle the - * request, otherwise set the return code to indicate that the request - * could not be processed. - */ - - if (fd->dev->ioctl) - { - rc = fd->dev->ioctl(fd, req, arg); - } - else - { - rc = -ENOTTY; - } - } - else - { - rc = -EBADFD; - } - -ioctl_done: - - if (rc < 0) - { - ALT_ERRNO = -rc; - } - return rc; -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_irq_entry.S b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_irq_entry.S deleted file mode 100644 index d3efe7d..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_irq_entry.S +++ /dev/null @@ -1,108 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "system.h" - -/* - * This is the interrupt exception entry point code, which saves all the - * registers and calls the interrupt handler. It should be pulled in using - * a .globl from alt_irq_register.c. This scheme is used so that if an - * interrupt is never registered, then this code will not appear in the - * generated executable, thereby improving code footprint. - */ - - /* - * Explicitly allow the use of r1 (the assembler temporary register) - * within this code. This register is normally reserved for the use of - * the compiler. - */ - .set noat - - /* - * Pull in the exception handler register save code. - */ - .globl alt_exception - - .globl alt_irq_entry - .section .exceptions.entry.label, "xa" -alt_irq_entry: - - /* - * Section .exceptions.entry is in alt_exception_entry.S - * This saves all the caller saved registers and reads estatus into r5 - */ - - .section .exceptions.irqtest, "xa" - -#ifdef ALT_CI_INTERRUPT_VECTOR_N - /* - * Use the interrupt vector custom instruction if present to accelerate - * this code. - * If the interrupt vector custom instruction returns a negative - * value, there are no interrupts active (estatus.pie is 0 - * or ipending is 0) so assume it is a software exception. - */ - custom ALT_CI_INTERRUPT_VECTOR_N, r4, r0, r0 - blt r4, r0, .Lnot_irq -#else - /* - * Test to see if the exception was a software exception or caused - * by an external interrupt, and vector accordingly. - */ - rdctl r4, ipending - andi r2, r5, 1 - beq r2, zero, .Lnot_irq - beq r4, zero, .Lnot_irq -#endif /* ALT_CI_INTERRUPT_VECTOR_N */ - - .section .exceptions.irqhandler, "xa" - /* - * Now that all necessary registers have been preserved, call - * alt_irq_handler() to process the interrupts. - */ - - call alt_irq_handler - - .section .exceptions.irqreturn, "xa" - - br .Lexception_exit - - .section .exceptions.notirq.label, "xa" - -.Lnot_irq: - - /* - * Section .exceptions.exit is in alt_exception_entry.S - * This restores all the caller saved registers - */ - - .section .exceptions.exit.label -.Lexception_exit: - diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_irq_handler.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_irq_handler.c deleted file mode 100644 index 3253d02..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_irq_handler.c +++ /dev/null @@ -1,169 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include "system.h" - -/* - * This interrupt handler only works with an internal interrupt controller - * (IIC). Processors with an external interrupt controller (EIC) use an - * implementation provided by an EIC driver. - */ -#ifndef ALT_CPU_EIC_PRESENT - -#include "sys/alt_irq.h" -#include "os/alt_hooks.h" - -#include "alt_types.h" - -/* - * A table describing each interrupt handler. The index into the array is the - * interrupt id associated with the handler. - * - * When an interrupt occurs, the associated handler is called with - * the argument stored in the context member. - */ -struct ALT_IRQ_HANDLER -{ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - void (*handler)(void*); -#else - void (*handler)(void*, alt_u32); -#endif - void *context; -} alt_irq[ALT_NIRQ]; - -/* - * alt_irq_handler() is called by the interrupt exception handler in order to - * process any outstanding interrupts. - * - * It is defined here since it is linked in using weak linkage. - * This means that if there is never a call to alt_irq_register() (above) then - * this function will not get linked in to the executable. This is acceptable - * since if no handler is ever registered, then an interrupt can never occur. - * - * If Nios II interrupt vector custom instruction exists, use it to accelerate - * the dispatch of interrupt handlers. The Nios II interrupt vector custom - * instruction is present if the macro ALT_CI_INTERRUPT_VECTOR defined. - */ - -void alt_irq_handler (void) __attribute__ ((section (".exceptions"))); -void alt_irq_handler (void) -{ -#ifdef ALT_CI_INTERRUPT_VECTOR - alt_32 offset; - char* alt_irq_base = (char*)alt_irq; -#else - alt_u32 active; - alt_u32 mask; - alt_u32 i; -#endif /* ALT_CI_INTERRUPT_VECTOR */ - - /* - * Notify the operating system that we are at interrupt level. - */ - - ALT_OS_INT_ENTER(); - -#ifdef ALT_CI_INTERRUPT_VECTOR - /* - * Call the interrupt vector custom instruction using the - * ALT_CI_INTERRUPT_VECTOR macro. - * It returns the offset into the vector table of the lowest-valued pending - * interrupt (corresponds to highest priority) or a negative value if none. - * The custom instruction assumes that each table entry is eight bytes. - */ - while ((offset = ALT_CI_INTERRUPT_VECTOR) >= 0) { - struct ALT_IRQ_HANDLER* handler_entry = - (struct ALT_IRQ_HANDLER*)(alt_irq_base + offset); -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - handler_entry->handler(handler_entry->context); -#else - handler_entry->handler(handler_entry->context, offset >> 3); -#endif - } -#else /* ALT_CI_INTERRUPT_VECTOR */ - /* - * Obtain from the interrupt controller a bit list of pending interrupts, - * and then process the highest priority interrupt. This process loops, - * loading the active interrupt list on each pass until alt_irq_pending() - * return zero. - * - * The maximum interrupt latency for the highest priority interrupt is - * reduced by finding out which interrupts are pending as late as possible. - * Consider the case where the high priority interupt is asserted during - * the interrupt entry sequence for a lower priority interrupt to see why - * this is the case. - */ - - active = alt_irq_pending (); - - do - { - i = 0; - mask = 1; - - /* - * Test each bit in turn looking for an active interrupt. Once one is - * found, the interrupt handler asigned by a call to alt_irq_register() is - * called to clear the interrupt condition. - */ - - do - { - if (active & mask) - { -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - alt_irq[i].handler(alt_irq[i].context); -#else - alt_irq[i].handler(alt_irq[i].context, i); -#endif - break; - } - mask <<= 1; - i++; - - } while (1); - - active = alt_irq_pending (); - - } while (active); -#endif /* ALT_CI_INTERRUPT_VECTOR */ - - /* - * Notify the operating system that interrupt processing is complete. - */ - - ALT_OS_INT_EXIT(); -} - -#endif /* ALT_CPU_EIC_PRESENT */ diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_irq_register.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_irq_register.c deleted file mode 100644 index b5ea474..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_irq_register.c +++ /dev/null @@ -1,102 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ -#include -#include "system.h" - -/* - * This interrupt registry mechanism works with the Nios II internal interrupt - * controller (IIC) only. Systems with an external interrupt controller (EIC), - * or those with the IIC who are using the enhanced interrupt API will - * utilize the alt_ic_isr_register() routine to register an interrupt. - */ -#ifndef NIOS2_EIC_PRESENT - -#include "sys/alt_irq.h" -#include "priv/alt_legacy_irq.h" -#include "os/alt_hooks.h" - -#include "alt_types.h" - -/* - * The header, alt_irq_entry.h, contains the exception entry point, and is - * provided by the processor component. It is included here, so that the code - * will be added to the executable only if alt_irq_register() is present, i.e. - * if no interrupts are registered - there's no need to provide any - * interrupt handling. - */ - -#include "sys/alt_irq_entry.h" - -/* - * The header, alt_irq_table.h contains a table describing which function - * handles each interrupt. - */ - -#include "priv/alt_irq_table.h" - -/* - * alt_irq_handler() is called to register an interrupt handler. If the - * function is succesful, then the requested interrupt will be enabled upon - * return. Registering a NULL handler will disable the interrupt. - * - * The return value is 0 if the interrupt handler was registered and the - * interrupt was enabled, otherwise it is negative. - */ - -int alt_irq_register (alt_u32 id, - void* context, - alt_isr_func handler) -{ - int rc = -EINVAL; - alt_irq_context status; - - if (id < ALT_NIRQ) - { - /* - * interrupts are disabled while the handler tables are updated to ensure - * that an interrupt doesn't occur while the tables are in an inconsistant - * state. - */ - - status = alt_irq_disable_all (); - - alt_irq[id].handler = handler; - alt_irq[id].context = context; - - rc = (handler) ? alt_irq_enable (id): alt_irq_disable (id); - - alt_irq_enable_all(status); - } - return rc; -} -#endif /* NIOS2_EIC_PRESENT */ - diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_irq_vars.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_irq_vars.c deleted file mode 100644 index 8c0a18d..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_irq_vars.c +++ /dev/null @@ -1,47 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "alt_types.h" - -#include "system.h" - -/* - * These global variables are used to save the current list of enabled - * interrupts. See alt_irq.h for further details. - */ - -volatile alt_u32 alt_irq_active = 0; - -#ifndef ALT_EXCEPTION_STACK - -volatile alt_u32 alt_priority_mask = (alt_u32) -1; - -#endif - diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_isatty.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_isatty.c deleted file mode 100644 index 9276472..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_isatty.c +++ /dev/null @@ -1,125 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include "sys/alt_dev.h" -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -#ifdef ALT_USE_DIRECT_DRIVERS - -#include "system.h" - -/* - * Provide minimal version that just describes all file descriptors - * as tty devices for provided stdio devices. - */ -int ALT_ISATTY (int file) -{ - switch (file) { -#ifdef ALT_STDIN_PRESENT - case 0: /* stdin file descriptor */ -#endif /* ALT_STDIN_PRESENT */ -#ifdef ALT_STDOUT_PRESENT - case 1: /* stdout file descriptor */ -#endif /* ALT_STDOUT_PRESENT */ -#ifdef ALT_STDERR_PRESENT - case 2: /* stderr file descriptor */ -#endif /* ALT_STDERR_PRESENT */ - return 1; - default: - return 0; - } - -#if !defined(ALT_STDIN_PRESENT) && !defined(ALT_STDOUT_PRESENT) && !defined(ALT_STDERR_PRESENT) - /* Generate a link time warning, should this function ever be called. */ - ALT_STUB_WARNING(isatty); -#endif -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ -/* - * isatty() can be used to determine whether the input file descriptor "file" - * refers to a terminal device or not. If it is a terminal device then the - * return value is one, otherwise it is zero. - * - * ALT_ISATTY is mapped onto the isatty() system call in alt_syscall.h - */ - -int ALT_ISATTY (int file) -{ - alt_fd* fd; - struct stat stat; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - /* - * If a device driver does not provide an fstat() function, then it is - * treated as a terminal device by default. - */ - - if (!fd->dev->fstat) - { - return 1; - } - - /* - * If a driver does provide an implementation of the fstat() function, then - * this is called so that the device can identify itself. - */ - - else - { - fstat (file, &stat); - return (stat.st_mode == _IFCHR) ? 1 : 0; - } - } - else - { - ALT_ERRNO = EBADFD; - return 0; - } -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_kill.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_kill.c deleted file mode 100644 index 42c2e1d..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_kill.c +++ /dev/null @@ -1,121 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include "sys/alt_errno.h" -#include "os/alt_syscall.h" - - -/* - * kill() is used by newlib in order to send signals to processes. Since there - * is only a single process in the HAL, the only valid values for pid are - * either the current process id, or the broadcast values, i.e. pid must be - * less than or equal to zero. - * - * ALT_KILL is mapped onto the kill() system call in alt_syscall.h - */ - -int ALT_KILL (int pid, int sig) -{ - int status = 0; - - if (pid <= 0) - { - switch (sig) - { - case 0: - - /* The null signal is used to check that a pid is valid. */ - - break; - - case SIGABRT: - case SIGALRM: - case SIGFPE: - case SIGILL: - case SIGKILL: - case SIGPIPE: - case SIGQUIT: - case SIGSEGV: - case SIGTERM: - case SIGUSR1: - case SIGUSR2: - case SIGBUS: - case SIGPOLL: - case SIGPROF: - case SIGSYS: - case SIGTRAP: - case SIGVTALRM: - case SIGXCPU: - case SIGXFSZ: - - /* - * The Posix standard defines the default behaviour for all these signals - * as being eqivalent to a call to _exit(). No mechanism is provided to - * change this behaviour. - */ - - _exit(0); - case SIGCHLD: - case SIGURG: - - /* - * The Posix standard defines these signals to be ignored by default. No - * mechanism is provided to change this behaviour. - */ - - break; - default: - - /* Tried to send an unsupported signal */ - - status = EINVAL; - } - } - - else if (pid > 0) - { - /* Attempted to signal a non-existant process */ - - status = ESRCH; - } - - if (status) - { - ALT_ERRNO = status; - return -1; - } - - return 0; -} diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_link.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_link.c deleted file mode 100644 index d796c59..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_link.c +++ /dev/null @@ -1,56 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_warning.h" -#include "sys/alt_errno.h" -#include "os/alt_syscall.h" - -/* - * link() is used by newlib to create a new link to an existing file. This is - * unsupported in the HAL environment. However a "do-nothing" implementation - * is still provied for newlib compatability. - * - * ALT_LINK is mapped onto the link() system call in alt_syscall.h - */ - -int ALT_LINK ( char *existing, char *new) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(link); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} - diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_load.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_load.c deleted file mode 100644 index ffab4b9..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_load.c +++ /dev/null @@ -1,88 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_load.h" -#include "sys/alt_cache.h" - -/* - * Linker defined symbols. - */ - -extern void __flash_rwdata_start; -extern void __ram_rwdata_start; -extern void __ram_rwdata_end; -extern void __flash_rodata_start; -extern void __ram_rodata_start; -extern void __ram_rodata_end; -extern void __flash_exceptions_start; -extern void __ram_exceptions_start; -extern void __ram_exceptions_end; - -/* - * alt_load() is called when the code is executing from flash. In this case - * there is no bootloader, so this application is responsible for loading to - * RAM any sections that are required. - */ - -void alt_load (void) -{ - /* - * Copy the .rwdata section. - */ - - alt_load_section (&__flash_rwdata_start, - &__ram_rwdata_start, - &__ram_rwdata_end); - - /* - * Copy the exception handler. - */ - - alt_load_section (&__flash_exceptions_start, - &__ram_exceptions_start, - &__ram_exceptions_end); - - /* - * Copy the .rodata section. - */ - - alt_load_section (&__flash_rodata_start, - &__ram_rodata_start, - &__ram_rodata_end); - - /* - * Now ensure that the caches are in synch. - */ - - alt_dcache_flush_all(); - alt_icache_flush_all(); -} diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_log_macro.S b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_log_macro.S deleted file mode 100644 index 499c4ad..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_log_macro.S +++ /dev/null @@ -1,56 +0,0 @@ -/* alt_log_macro.S - * - * Implements the function tx_log_str, called by the assembly macro - * ALT_LOG_PUTS(). The macro will be empty when logging is turned off, - * and this function will not be compiled. When logging is on, - * this function is used to print out the strings defined in the beginning - * of alt_log_printf.c, using port information taken from system.h and - * alt_log_printf.h. - * - * This routine only handles strings, and sends a character into the defined - * output device's output buffer when the device is ready. It's intended for - * debugging purposes, where messages can be set to print out at certain - * points in the boot code to indicate the progress of the program. - * - */ - -#ifndef __ALT_LOG_MACROS__ -#define __ALT_LOG_MACROS__ - -/* define this flag to skip assembly-incompatible parts - * of various include files. */ -#define ALT_ASM_SRC - -#ifdef ALT_LOG_ENABLE // only compile this function if this flag is defined. - - #include "system.h" - #include "sys/alt_log_printf.h" - - .global tx_log_str -tx_log_str: - /* load base uart / jtag uart address into r6 */ - movhi r6, %hiadj(ALT_LOG_PORT_BASE) - addi r6, r6, %lo(ALT_LOG_PORT_BASE) -tx_next_char: - /* if pointer points to null, return - * r4 is the pointer to the str to be printed, set by ALT_LOG_PUTS */ - ldb r7, (r4) - beq r0, r7, end_tx - - /* check device transmit ready */ -wait_tx_ready_loop: - ldwio r5, ALT_LOG_PRINT_REG_OFFSET(r6) - andi r5, r5, ALT_LOG_PRINT_MSK - beq r5, r0, wait_tx_ready_loop - /* write char */ - stwio r7, ALT_LOG_PRINT_TXDATA_REG_OFFSET (r6) - /* advance string pointer */ - addi r4, r4, 1 - br tx_next_char -end_tx: - ret - -#endif - -#endif /* __ALT_LOG_MACROS__ */ - diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_log_printf.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_log_printf.c deleted file mode 100644 index 1f7056d..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_log_printf.c +++ /dev/null @@ -1,479 +0,0 @@ - -/* alt_log_printf.c - * - * This file implements the various C functions used for the - * alt_log logging/debugging print functions. The functions - * sit as is here - the job of hiding them from the compiler - * if logging is disabled is accomplished in the .h file. - * - * All the global variables for alt_log are defined here. - * These include the various flags that turn on additional - * logging options; the strings for assembly printing; and - * other globals needed by different logging options. - * - * There are 4 functions that handle the actual printing: - * alt_log_txchar: Actual function that puts 1 char to UART/JTAG UART. - * alt_log_repchar: Calls alt_log_txchar 'n' times - used by - * alt_log_private_printf for formatting. - * alt_log_private_printf: - * Stripped down implementation of printf - no floats. - * alt_log_printf_proc: - * Wrapper function for private_printf. - * - * The rest of the functions are called by the macros which - * were called by code in the other components. Each function - * is preceded by a comment, about which file it gets called - * in, and what its purpose is. - * - * author: gkwan - */ - -/* skip all code if enable is off */ -#ifdef ALT_LOG_ENABLE - -#include -#include -#include -#ifdef __ALTERA_AVALON_JTAG_UART - #include "altera_avalon_jtag_uart.h" - #include -#endif -#include "sys/alt_log_printf.h" - -/* strings for assembly puts */ -char alt_log_msg_bss[] = "[crt0.S] Clearing BSS \r\n";; -char alt_log_msg_alt_main[] = "[crt0.S] Calling alt_main.\r\n"; -char alt_log_msg_stackpointer[] \ - = "[crt0.S] Setting up stack and global pointers.\r\n"; -char alt_log_msg_cache[] = "[crt0.S] Inst & Data Cache Initialized.\r\n"; -/* char array allocation for alt_write */ -char alt_log_write_buf[ALT_LOG_WRITE_ECHO_LEN+2]; - -/* global variables for all 'on' flags */ - -/* - * The boot message flag is linked into the data (rwdata) section - * because if it is zero, it would otherwise be placed in the bss section. - * alt_log examines this variable before the BSS is cleared in the boot-up - * process. - */ -volatile alt_u32 alt_log_boot_on_flag \ - __attribute__ ((section (".data"))) = ALT_LOG_BOOT_ON_FLAG_SETTING; - -volatile alt_u8 alt_log_write_on_flag = ALT_LOG_WRITE_ON_FLAG_SETTING; - -volatile alt_u8 alt_log_sys_clk_on_flag = ALT_LOG_SYS_CLK_ON_FLAG_SETTING; - -volatile alt_u8 alt_log_jtag_uart_alarm_on_flag = \ - ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING; - -volatile alt_u8 alt_log_jtag_uart_isr_on_flag = \ - ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING; - -volatile alt_u8 alt_log_jtag_uart_startup_info_on_flag = \ - ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING; - -/* Global alarm object for recurrent JTAG UART status printing */ -alt_alarm alt_log_jtag_uart_alarm_1; - -/* Global ints for system clock printing and count */ -volatile int alt_log_sys_clk_count; -volatile int alt_system_clock_in_sec; - -/* enum used by alt_log_private_printf */ -enum -{ - pfState_chars, - pfState_firstFmtChar, - pfState_otherFmtChar -}; - - - - -/* Function to put one char onto the UART/JTAG UART txdata register. */ -void alt_log_txchar(int c,char *base) -{ - /* Wait until the device is ready for a character */ - while((ALT_LOG_PRINT_REG_RD(base) & ALT_LOG_PRINT_MSK) == 0) - ; - /* And pop the character into the register */ - ALT_LOG_PRINT_TXDATA_WR(base,c); -} - - -/* Called by alt_log_private_printf to print out characters repeatedly */ -void alt_log_repchar(char c,int r,int base) -{ - while(r-- > 0) - alt_log_txchar(c,(char*) base); -} - - -/* Stripped down printf function */ -void alt_log_private_printf(const char *fmt,int base,va_list args) - { - const char *w; - char c; - int state; - int fmtLeadingZero = 0; /* init these all to 0 for -W warnings. */ - int fmtLong = 0; - int fmtBeforeDecimal = 0; - int fmtAfterDecimal = 0; - int fmtBase = 0; - int fmtSigned = 0; - int fmtCase = 0; /* For hex format, if 1, A-F, else a-f. */ - - w = fmt; - state = pfState_chars; - - while(0 != (c = *w++)) - { - switch(state) - { - case pfState_chars: - if(c == '%') - { - fmtLeadingZero = 0; - fmtLong = 0; - fmtBase = 10; - fmtSigned = 1; - fmtCase = 0; /* Only %X sets this. */ - fmtBeforeDecimal = -1; - fmtAfterDecimal = -1; - state = pfState_firstFmtChar; - } - else - { - alt_log_txchar(c,(char*)base); - } - break; - - case pfState_firstFmtChar: - if(c == '0') - { - fmtLeadingZero = 1; - state = pfState_otherFmtChar; - } - else if(c == '%') - { - alt_log_txchar(c,(char*)base); - state = pfState_chars; - } - else - { - state = pfState_otherFmtChar; - goto otherFmtChar; - } - break; - - case pfState_otherFmtChar: -otherFmtChar: - if(c == '.') - { - fmtAfterDecimal = 0; - } - else if('0' <= c && c <= '9') - { - c -= '0'; - if(fmtAfterDecimal < 0) /* still before decimal */ - { - if(fmtBeforeDecimal < 0) - { - fmtBeforeDecimal = 0; - } - else - { - fmtBeforeDecimal *= 10; - } - fmtBeforeDecimal += c; - } - else - { - fmtAfterDecimal = (fmtAfterDecimal * 10) + c; - } - } - else if(c == 'l') - { - fmtLong = 1; - } - else /* we're up to the letter which determines type */ - { - switch(c) - { - case 'd': - case 'i': -doIntegerPrint: - { - unsigned long v; - unsigned long p; /* biggest power of fmtBase */ - unsigned long vShrink; /* used to count digits */ - int sign; - int digitCount; - - /* Get the value */ - if(fmtLong) - { - if (fmtSigned) - { - v = va_arg(args,long); - } - else - { - v = va_arg(args,unsigned long); - } - } - else - { - if (fmtSigned) - { - v = va_arg(args,int); - } - else - { - v = va_arg(args,unsigned int); - } - } - - /* Strip sign */ - sign = 0; - /* (assumes sign bit is #31) */ - if( fmtSigned && (v & (0x80000000)) ) - { - v = ~v + 1; - sign = 1; - } - - /* Count digits, and get largest place value */ - vShrink = v; - p = 1; - digitCount = 1; - while( (vShrink = vShrink / fmtBase) > 0 ) - { - digitCount++; - p *= fmtBase; - } - - /* Print leading characters & sign */ - fmtBeforeDecimal -= digitCount; - if(fmtLeadingZero) - { - if(sign) - { - alt_log_txchar('-',(char*)base); - fmtBeforeDecimal--; - } - alt_log_repchar('0',fmtBeforeDecimal,base); - } - else - { - if(sign) - { - fmtBeforeDecimal--; - } - alt_log_repchar(' ',fmtBeforeDecimal,base); - if(sign) - { - alt_log_txchar('-',(char*)base); - } - } - - /* Print numbery parts */ - while(p) - { - unsigned char d; - - d = v / p; - d += '0'; - if(d > '9') - { - d += (fmtCase ? 'A' : 'a') - '0' - 10; - } - alt_log_txchar(d,(char*)base); - - v = v % p; - p = p / fmtBase; - } - } - - state = pfState_chars; - break; - - case 'u': - fmtSigned = 0; - goto doIntegerPrint; - case 'o': - fmtSigned = 0; - fmtBase = 8; - goto doIntegerPrint; - case 'x': - fmtSigned = 0; - fmtBase = 16; - goto doIntegerPrint; - case 'X': - fmtSigned = 0; - fmtBase = 16; - fmtCase = 1; - goto doIntegerPrint; - - case 'c': - alt_log_repchar(' ',fmtBeforeDecimal-1,base); - alt_log_txchar(va_arg(args,int),(char*)base); - break; - - case 's': - { - char *s; - - s = va_arg(args,char *); - alt_log_repchar(' ',fmtBeforeDecimal-strlen(s),base); - - while(*s) - alt_log_txchar(*s++,(char*)base); - } - break; - } /* switch last letter of fmt */ - state=pfState_chars; - } - break; - } /* switch */ - } /* while chars left */ - } /* printf */ - -/* Main logging printf function */ -int alt_log_printf_proc(const char *fmt, ... ) -{ - va_list args; - - va_start (args, fmt); - alt_log_private_printf(fmt,ALT_LOG_PORT_BASE,args); - return (0); -} - -/* Below are the functions called by different macros in various components. */ - -/* If the system has a JTAG_UART, include JTAG_UART debugging functions */ -#ifdef __ALTERA_AVALON_JTAG_UART - -/* The alarm function in altera_avalon_jtag_uart.c. - * This function, when turned on, prints out the status - * of the JTAG UART Control register, every ALT_LOG_JTAG_UART_TICKS. - * If the flag is off, the alarm should never be registered, and this - * function should never run */ -alt_u32 altera_avalon_jtag_uart_report_log(void * context) -{ - if (alt_log_jtag_uart_alarm_on_flag) { - altera_avalon_jtag_uart_state* dev = (altera_avalon_jtag_uart_state*) context; - const char* header="JTAG Alarm:"; - alt_log_jtag_uart_print_control_reg(dev, dev->base, header); - return ALT_LOG_JTAG_UART_TICKS; - } - else - { - /* If flag is not on, return 0 to disable future alarms. - * Should never be here, alarm should not be enabled at all. */ - return 0; - } -} - -void alt_log_jtag_uart_print_control_reg(altera_avalon_jtag_uart_state* dev, int base, const char* header) -{ - unsigned int control, space, ac, wi, ri, we, re; - control = IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base); - space = (control & ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_MSK) >> - ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_OFST; - we= (control & ALTERA_AVALON_JTAG_UART_CONTROL_WE_MSK) >> - ALTERA_AVALON_JTAG_UART_CONTROL_WE_OFST; - re= (control & ALTERA_AVALON_JTAG_UART_CONTROL_RE_MSK) >> - ALTERA_AVALON_JTAG_UART_CONTROL_RE_OFST; - ri= (control & ALTERA_AVALON_JTAG_UART_CONTROL_RI_MSK) >> - ALTERA_AVALON_JTAG_UART_CONTROL_RI_OFST; - wi= (control & ALTERA_AVALON_JTAG_UART_CONTROL_WI_MSK) >> - ALTERA_AVALON_JTAG_UART_CONTROL_WI_OFST; - ac= (control & ALTERA_AVALON_JTAG_UART_CONTROL_AC_MSK) >> - ALTERA_AVALON_JTAG_UART_CONTROL_AC_OFST; - -#ifdef ALTERA_AVALON_JTAG_UART_SMALL - ALT_LOG_PRINTF( - "%s HW FIFO wspace=%d AC=%d WI=%d RI=%d WE=%d RE=%d\r\n", - header,space,ac,wi,ri,we,re); -#else - ALT_LOG_PRINTF( - "%s SW CirBuf = %d, HW FIFO wspace=%d AC=%d WI=%d RI=%d WE=%d RE=%d\r\n", - header,(dev->tx_out-dev->tx_in),space,ac,wi,ri,we,re); -#endif - - return; - -} - -/* In altera_avalon_jtag_uart.c - * Same output as the alarm function above, but this is called in the driver - * init function. Hence, it gives the status of the JTAG UART control register - * right at the initialization of the driver */ -void alt_log_jtag_uart_startup_info(altera_avalon_jtag_uart_state* dev, int base) -{ - const char* header="JTAG Startup Info:"; - alt_log_jtag_uart_print_control_reg(dev, base, header); - return; -} - -/* In altera_avalon_jtag_uart.c - * When turned on, this function will print out the status of the jtag uart - * control register every time there is a jtag uart "almost-empty" interrupt. */ -void alt_log_jtag_uart_isr_proc(int base, altera_avalon_jtag_uart_state* dev) -{ - if (alt_log_jtag_uart_isr_on_flag) { - const char* header="JTAG IRQ:"; - alt_log_jtag_uart_print_control_reg(dev, base, header); - } - return; -} - -#endif /* __ALTERA_AVALON_JTAG_UART */ - -/* In alt_write.c - * When the alt_log_write_on_flag is turned on, this function gets called - * every time alt_write gets called. The first - * ALT_LOG_WRITE_ECHO_LEN characters of every printf command (or any command - * that eventually calls write()) gets echoed to the alt_log output. */ -void alt_log_write(const void *ptr, size_t len) -{ - if (alt_log_write_on_flag) { - int temp_cnt; - int length=(ALT_LOG_WRITE_ECHO_LEN>len) ? len : ALT_LOG_WRITE_ECHO_LEN; - - if (length < 2) return; - - strncpy (alt_log_write_buf,ptr,length); - alt_log_write_buf[length-1]='\n'; - alt_log_write_buf[length]='\r'; - alt_log_write_buf[length+1]='\0'; - - /* Escape Ctrl-D's. If the Ctrl-D gets sent it might kill the terminal - * connection of alt_log. It will get replaced by 'D'. */ - for (temp_cnt=0;temp_cnt < length; temp_cnt++) { - if (alt_log_write_buf[temp_cnt]== 0x4) { - alt_log_write_buf[temp_cnt]='D'; - } - } - ALT_LOG_PRINTF("Write Echo: %s",alt_log_write_buf); - } -} - -/* In altera_avalon_timer_sc - * This function prints out a system clock is alive message - * every ALT_LOG_SYS_CLK_INTERVAL (in ticks). */ -void alt_log_system_clock() -{ - if (alt_log_sys_clk_on_flag) { - alt_log_sys_clk_count++; - if (alt_log_sys_clk_count > ALT_LOG_SYS_CLK_INTERVAL) { - alt_log_sys_clk_count = 0; - ALT_LOG_PRINTF("System Clock On %u\r\n",alt_system_clock_in_sec++); - } - } -} - - -#endif diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_lseek.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_lseek.c deleted file mode 100644 index 7857b0d..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_lseek.c +++ /dev/null @@ -1,117 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -#ifdef ALT_USE_DIRECT_DRIVERS - -off_t ALT_LSEEK (int file, off_t ptr, int dir) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(lseek); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -/* - * lseek() can be called to move the read/write pointer associated with the - * file descriptor "file". This function simply vectors the call to the lseek() - * function provided by the driver associated with the file descriptor. - * - * If the driver does not provide an implementation of lseek() an error is - * indicated. - * - * lseek() corresponds to the standard lseek() function. - * - * ALT_LSEEK is mapped onto the lseek() system call in alt_syscall.h - * - */ - -off_t ALT_LSEEK (int file, off_t ptr, int dir) -{ - alt_fd* fd; - off_t rc = 0; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - /* - * If the device driver provides an implementation of the lseek() function, - * then call that to process the request. - */ - - if (fd->dev->lseek) - { - rc = fd->dev->lseek(fd, ptr, dir); - } - /* - * Otherwise return an error. - */ - - else - { - rc = -ENOTSUP; - } - } - else - { - rc = -EBADFD; - } - - if (rc < 0) - { - ALT_ERRNO = -rc; - rc = -1; - } - - return rc; -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_main.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_main.c deleted file mode 100644 index a96229b..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_main.c +++ /dev/null @@ -1,161 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include -#include -#include -#include - -#include "sys/alt_dev.h" -#include "sys/alt_sys_init.h" -#include "sys/alt_irq.h" -#include "sys/alt_dev.h" - -#include "os/alt_hooks.h" - -#include "priv/alt_file.h" -#include "alt_types.h" - -#include "system.h" - -#include "sys/alt_log_printf.h" - -extern void _do_ctors(void); -extern void _do_dtors(void); - -/* - * Standard arguments for main. By default, no arguments are passed to main. - * However a device driver may choose to configure these arguments by calling - * alt_set_args(). The expectation is that this facility will only be used by - * the iclient/ihost utility. - */ - -int alt_argc = 0; -char** alt_argv = {NULL}; -char** alt_envp = {NULL}; - -/* - * Prototype for the entry point to the users application. - */ - -extern int main (int, char **, char **); - -/* - * alt_main is the C entry point for the HAL. It is called by the assembler - * startup code in the processor specific crt0.S. It is responsible for: - * completing the C runtime configuration; configuring all the - * devices/filesystems/components in the system; and call the entry point for - * the users application, i.e. main(). - */ - -void alt_main (void) -{ -#ifndef ALT_NO_EXIT - int result; -#endif - - /* ALT LOG - please see HAL/sys/alt_log_printf.h for details */ - ALT_LOG_PRINT_BOOT("[alt_main.c] Entering alt_main, calling alt_irq_init.\r\n"); - /* Initialize the interrupt controller. */ - alt_irq_init (NULL); - - /* Initialize the operating system */ - ALT_LOG_PRINT_BOOT("[alt_main.c] Done alt_irq_init, calling alt_os_init.\r\n"); - ALT_OS_INIT(); - - /* - * Initialize the semaphore used to control access to the file descriptor - * list. - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Done OS Init, calling alt_sem_create.\r\n"); - ALT_SEM_CREATE (&alt_fd_list_lock, 1); - - /* Initialize the device drivers/software components. */ - ALT_LOG_PRINT_BOOT("[alt_main.c] Calling alt_sys_init.\r\n"); - alt_sys_init(); - ALT_LOG_PRINT_BOOT("[alt_main.c] Done alt_sys_init.\r\n"); - -#if !defined(ALT_USE_DIRECT_DRIVERS) && (defined(ALT_STDIN_PRESENT) || defined(ALT_STDOUT_PRESENT) || defined(ALT_STDERR_PRESENT)) - - /* - * Redirect stdio to the apropriate devices now that the devices have - * been initialized. This is only done if the user has requested these - * devices be present (not equal to /dev/null) and if direct drivers - * aren't being used. - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Redirecting IO.\r\n"); - alt_io_redirect(ALT_STDOUT, ALT_STDIN, ALT_STDERR); -#endif - -#ifndef ALT_NO_C_PLUS_PLUS - /* - * Call the C++ constructors - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Calling C++ constructors.\r\n"); - _do_ctors (); -#endif /* ALT_NO_C_PLUS_PLUS */ - -#if !defined(ALT_NO_C_PLUS_PLUS) && !defined(ALT_NO_CLEAN_EXIT) && !defined(ALT_NO_EXIT) - /* - * Set the C++ destructors to be called at system shutdown. This is only done - * if a clean exit has been requested (i.e. the exit() function has not been - * redefined as _exit()). This is in the interest of reducing code footprint, - * in that the atexit() overhead is removed when it's not needed. - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Calling atexit.\r\n"); - atexit (_do_dtors); -#endif - - /* - * Finally, call main(). The return code is then passed to a subsequent - * call to exit() unless the application is never supposed to exit. - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Calling main.\r\n"); - -#ifdef ALT_NO_EXIT - main (alt_argc, alt_argv, alt_envp); -#else - result = main (alt_argc, alt_argv, alt_envp); - close(STDOUT_FILENO); - exit (result); -#endif - - ALT_LOG_PRINT_BOOT("[alt_main.c] After main - we should not be here?.\r\n"); -} - diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_malloc_lock.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_malloc_lock.c deleted file mode 100644 index 8c78f46..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_malloc_lock.c +++ /dev/null @@ -1,52 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -/* - * These are the empty malloc lock/unlock stubs required by newlib. These are - * used to make newlib's malloc() function thread safe. The default HAL - * configuration is single threaded, so there is nothing to do here. Note that - * this requires that malloc is never called by an interrupt service routine. - */ - -void __malloc_lock ( struct _reent *_r ) -{ -} - -/* - * - */ - -void __malloc_unlock ( struct _reent *_r ) -{ -} diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_mcount.S b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_mcount.S deleted file mode 100644 index 3837523..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_mcount.S +++ /dev/null @@ -1,198 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2010 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* mcount or _mcount is inserted by GCC before the function prologue of every - * function when a program is compiled for profiling. At the start of mcount, - * we guarantee that: - * ra = self_pc (an address in the function which called mcount) - * r8 = from_pc (an address in the function which called mcount's caller) - * - * Because this is always called at the start of a function we can corrupt - * r2,r3 and r11-r15. We must not corrupt r4-r7 (because they might contain - * function arguments for the instrumented function) or r8 (which holds ra - * for the instrumented function). - */ - - .global __mcount_fn_head - - .global mcount - - /* _mcount is used by gcc4 */ - .global _mcount - -_mcount: -mcount: - /* Use a hash to speed up locating fn_entry. We use bits 5 upwards to choose - * the bucket because bits 1:0 will always be 0, and because the distribution - * of values for bits 4:2 won't be even (aligning on cache line boundaries - * will skew it). Higher bits should be fairly random. - */ - /* fn_head = mcount_fn_head + (((unsigned int)self_pc >> 5) & (HASH_BUCKETS - 1)); */ - - srli r2, ra, 3 - movhi r3, %hiadj(__mcount_fn_head) - addi r3, r3, %lo(__mcount_fn_head) - andi r2, r2, 0xFC - add r11, r2, r3 - - /* The fast case is where we have already allocated a function arc, and so - * also a function pointer. - */ - - /* First find the function being called (using self_pc) */ - mov r10, r11 -0: - ldw r10, 0(r10) - beq r10, zero, .Lnew_arc - ldw r2, 4(r10) - bne r2, ra, 0b - - /* Found a function entry for this PC. Now look for an arc with a matching - * from_pc value. There will always be at least one arc. */ - ldw r3, 8(r10) -0: - ldw r2, 4(r3) - beq r2, r8, .Lfound_arc - ldw r3, 0(r3) - bne r3, zero, 0b - -.Lnew_arc: - addi sp, sp, -24 - -.LCFI0: - stw ra, 0(sp) - stw r4, 4(sp) - stw r5, 8(sp) - stw r6, 12(sp) - stw r7, 16(sp) - stw r8, 20(sp) - -.LCFI1: - /* __mcount_record(orig_ra, orig_r8, fn_entry, *fn_head); */ - mov r4, ra - mov r5, r8 - mov r6, r10 - mov r7, r11 - call __mcount_record - - /* restore registers from the stack */ - ldw ra, 0(sp) - ldw r4, 4(sp) - ldw r5, 8(sp) - ldw r6, 12(sp) - ldw r7, 16(sp) - ldw r8, 20(sp) - - addi sp, sp, 24 - -.LCFI2: - ret - -.Lfound_arc: - /* We've found the correct arc record. Increment the count and return */ - ldw r2, 8(r3) - addi r2, r2, 1 - stw r2, 8(r3) - ret - -.Lmcount_end: - - - -/* - * Dwarf2 debug information for the function. This provides GDB with the - * information it needs to backtrace out of this function. - */ - - .section .debug_frame,"",@progbits -.LCIE: - .4byte 2f - 1f /* Length */ -1: - .4byte 0xffffffff /* CIE id */ - .byte 0x1 /* Version */ - .string "" /* Augmentation */ - .uleb128 0x1 /* Code alignment factor */ - .sleb128 -4 /* Data alignment factor */ - .byte 0x1f /* Return address register */ - - .byte 0xc /* Define CFA */ - .uleb128 0x1b /* Register 27 (sp) */ - .uleb128 0x0 /* Offset 0 */ - - .align 2 /* Padding */ -2: - -.LFDE_mcount: - .4byte 2f - 1f /* Length */ -1: - .4byte .LCIE /* Pointer to CIE */ - .4byte mcount /* Start of table entry */ - .4byte .Lmcount_end - mcount /* Size of table entry */ - - .byte 0x4 /* Advance location */ - .4byte .LCFI0 - mcount /* to .LCFI0 */ - .byte 0xe /* Define CFA offset */ - .uleb128 24 /* to 24 */ - - .byte 0x4 /* Advance location */ - .4byte .LCFI1 - .LCFI0 /* to .LCFI1 */ - .byte 0x9f /* Store ra */ - .uleb128 0x6 /* at CFA-24 */ - .byte 0x84 /* Store r4 */ - .uleb128 0x5 /* at CFA-20 */ - .byte 0x85 /* Store r5 */ - .uleb128 0x4 /* at CFA-16 */ - .byte 0x86 /* Store r6 */ - .uleb128 0x3 /* at CFA-12 */ - .byte 0x87 /* Store r7 */ - .uleb128 0x2 /* at CFA-8 */ - .byte 0x88 /* Store r8 */ - .uleb128 0x1 /* at CFA-4 */ - - .byte 0x4 /* Advance location */ - .4byte .LCFI2 - .LCFI1 /* to .LCFI2 */ - .byte 0xe /* Define CFA offset */ - .uleb128 0 /* to 0 */ - .byte 0x8 /* Same value */ - .uleb128 31 /* for ra */ - .byte 0x8 /* Same value */ - .uleb128 4 /* for r4 */ - .byte 0x8 /* Same value */ - .uleb128 5 /* for r5 */ - .byte 0x8 /* Same value */ - .uleb128 6 /* for r6 */ - .byte 0x8 /* Same value */ - .uleb128 7 /* for r7 */ - .byte 0x8 /* Same value */ - .uleb128 8 /* for r8 */ - - .align 2 -2: - diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_open.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_open.c deleted file mode 100644 index 4790f53..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_open.c +++ /dev/null @@ -1,173 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "alt_types.h" -#include "os/alt_syscall.h" - -#ifdef ALT_USE_DIRECT_DRIVERS - -int ALT_OPEN (const char* file, int flags, int mode) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(open); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -extern alt_llist alt_dev_list; - -/* - * alt_file_locked() is used by open() to ensure that a device has not been - * previously locked for exclusive access using ioctl(). This test is only - * performed for devices. Filesystems are required to handle the ioctl() call - * themselves, and report the error from the filesystems open() function. - */ - -static int alt_file_locked (alt_fd* fd) -{ - alt_u32 i; - - /* - * Mark the file descriptor as belonging to a device. - */ - - fd->fd_flags |= ALT_FD_DEV; - - /* - * Loop through all current file descriptors searching for one that's locked - * for exclusive access. If a match is found, generate an error. - */ - - for (i = 0; i <= alt_max_fd; i++) - { - if ((alt_fd_list[i].dev == fd->dev) && - (alt_fd_list[i].fd_flags & ALT_FD_EXCL) && - (&alt_fd_list[i] != fd)) - { - return -EACCES; - } - } - - /* The device is not locked */ - - return 0; -} - -/* - * open() is called in order to get a file descriptor that reference the file - * or device named "name". This descriptor can then be used to manipulate the - * file/device using the standard system calls, e.g. write(), read(), ioctl() - * etc. - * - * This is equivalent to the standard open() system call. - * - * ALT_OPEN is mapped onto the open() system call in alt_syscall.h - */ - -int ALT_OPEN (const char* file, int flags, int mode) -{ - alt_dev* dev; - alt_fd* fd; - int index = -1; - int status = -ENODEV; - int isafs = 0; - - /* - * Check the device list, to see if a device with a matching name is - * registered. - */ - - if (!(dev = alt_find_dev (file, &alt_dev_list))) - { - /* No matching device, so try the filesystem list */ - - dev = alt_find_file (file); - isafs = 1; - } - - /* - * If a matching device or filesystem is found, allocate a file descriptor. - */ - - if (dev) - { - if ((index = alt_get_fd (dev)) < 0) - { - status = index; - } - else - { - fd = &alt_fd_list[index]; - fd->fd_flags = (flags & ~ALT_FD_FLAGS_MASK); - - /* If this is a device, ensure it isn't already locked */ - - if (isafs || ((status = alt_file_locked (fd)) >= 0)) - { - /* - * If the device or filesystem provides an open() callback function, - * call it now to perform any device/filesystem specific operations. - */ - - status = (dev->open) ? dev->open(fd, file, flags, mode): 0; - } - } - } - else - { - status = -ENODEV; - } - - /* Allocation failed, so clean up and return an error */ - - if (status < 0) - { - alt_release_fd (index); - ALT_ERRNO = -status; - return -1; - } - - /* return the reference upon success */ - - return index; -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_printf.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_printf.c deleted file mode 100644 index e742b57..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_printf.c +++ /dev/null @@ -1,127 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/* - * This file provides a very minimal printf implementation for use with very - * small applications. Only the following format strings are supported: - * %x - * %s - * %c - * %% - */ - -#include -#include "sys/alt_stdio.h" - -/* - * ALT printf function - */ -void -alt_printf(const char* fmt, ... ) -{ - va_list args; - va_start(args, fmt); - const char *w; - char c; - - /* Process format string. */ - w = fmt; - while ((c = *w++) != 0) - { - /* If not a format escape character, just print */ - /* character. Otherwise, process format string. */ - if (c != '%') - { - alt_putchar(c); - } - else - { - /* Get format character. If none */ - /* available, processing is complete. */ - if ((c = *w++) != 0) - { - if (c == '%') - { - /* Process "%" escape sequence. */ - alt_putchar(c); - } - else if (c == 'c') - { - int v = va_arg(args, int); - alt_putchar(v); - } - else if (c == 'x') - { - /* Process hexadecimal number format. */ - unsigned long v = va_arg(args, unsigned long); - unsigned long digit; - int digit_shift; - - /* If the number value is zero, just print and continue. */ - if (v == 0) - { - alt_putchar('0'); - continue; - } - - /* Find first non-zero digit. */ - digit_shift = 28; - while (!(v & (0xF << digit_shift))) - digit_shift -= 4; - - /* Print digits. */ - for (; digit_shift >= 0; digit_shift -= 4) - { - digit = (v & (0xF << digit_shift)) >> digit_shift; - if (digit <= 9) - c = '0' + digit; - else - c = 'a' + digit - 10; - alt_putchar(c); - } - } - else if (c == 's') - { - /* Process string format. */ - char *s = va_arg(args, char *); - - while(*s) - alt_putchar(*s++); - } - } - else - { - break; - } - } - } -} diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_putchar.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_putchar.c deleted file mode 100644 index badaa02..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_putchar.c +++ /dev/null @@ -1,59 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#ifdef ALT_USE_DIRECT_DRIVERS -#include "system.h" -#include "sys/alt_driver.h" -#include "sys/alt_stdio.h" -#endif - -/* - * Uses the ALT_DRIVER_WRITE() macro to call directly to driver if available. - * Otherwise, uses newlib provided putchar() routine. - */ -int -alt_putchar(int c) -{ -#ifdef ALT_USE_DIRECT_DRIVERS - ALT_DRIVER_WRITE_EXTERNS(ALT_STDOUT_DEV); - char c1 = (char)(c & 0xff); - - if (ALT_DRIVER_WRITE(ALT_STDOUT_DEV, &c1, 1, 0) == -1) { - return -1; - } - return c; -#else - return putchar(c); -#endif -} diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_putstr.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_putstr.c deleted file mode 100644 index 5345945..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_putstr.c +++ /dev/null @@ -1,55 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#ifdef ALT_USE_DIRECT_DRIVERS -#include -#include "system.h" -#include "sys/alt_driver.h" -#include "sys/alt_stdio.h" -#endif - -/* - * Uses the ALT_DRIVER_WRITE() macro to call directly to driver if available. - * Otherwise, uses newlib provided fputs() routine. - */ -int -alt_putstr(const char* str) -{ -#ifdef ALT_USE_DIRECT_DRIVERS - ALT_DRIVER_WRITE_EXTERNS(ALT_STDOUT_DEV); - return ALT_DRIVER_WRITE(ALT_STDOUT_DEV, str, strlen(str), 0); -#else - return fputs(str, stdout); -#endif -} diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_read.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_read.c deleted file mode 100644 index 1c89777..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_read.c +++ /dev/null @@ -1,125 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -/* - * The read() system call is used to read a block of data from a file or device. - * This function simply vectors the request to the device driver associated - * with the input file descriptor "file". - * - * ALT_READ is mapped onto the read() system call in alt_syscall.h - */ - -#ifdef ALT_USE_DIRECT_DRIVERS - -#include "system.h" -#include "sys/alt_driver.h" - -/* - * Provide minimal version that just reads from the stdin device when provided. - */ - -int ALT_READ (int file, void *ptr, size_t len) -{ -#ifdef ALT_STDIN_PRESENT - ALT_DRIVER_READ_EXTERNS(ALT_STDIN_DEV); -#endif - -#if !defined(ALT_STDIN_PRESENT) - /* Generate a link time warning, should this function ever be called. */ - ALT_STUB_WARNING(read); -#endif - - switch (file) { -#ifdef ALT_STDIN_PRESENT - case 0: /* stdin file descriptor */ - return ALT_DRIVER_READ(ALT_STDIN_DEV, ptr, len, 0); -#endif /* ALT_STDIN_PRESENT */ - default: - ALT_ERRNO = EBADFD; - return -1; - } -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -int ALT_READ (int file, void *ptr, size_t len) -{ - alt_fd* fd; - int rval; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - /* - * If the file has not been opened with read access, or if the driver does - * not provide an implementation of read(), generate an error. Otherwise - * call the drivers read() function to process the request. - */ - - if (((fd->fd_flags & O_ACCMODE) != O_WRONLY) && - (fd->dev->read)) - { - if ((rval = fd->dev->read(fd, ptr, len)) < 0) - { - ALT_ERRNO = -rval; - return -1; - } - return rval; - } - else - { - ALT_ERRNO = EACCES; - } - } - else - { - ALT_ERRNO = EBADFD; - } - return -1; -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_release_fd.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_release_fd.c deleted file mode 100644 index 84733a7..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_release_fd.c +++ /dev/null @@ -1,54 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - -/* - * alt_release_fd() is called to free an allocated file descriptor. This is - * done by setting the device pointer in the file descriptor structure to zero. - * - * File descriptors correcponding to standard in, standard out and standard - * error cannont be released backed to the pool. They are always reserved. - */ - -void alt_release_fd (int fd) -{ - if (fd > 2) - { - alt_fd_list[fd].fd_flags = 0; - alt_fd_list[fd].dev = 0; - } -} - - - diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_remap_cached.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_remap_cached.c deleted file mode 100644 index f61cb9c..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_remap_cached.c +++ /dev/null @@ -1,50 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003,2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "sys/alt_cache.h" -#include "system.h" - -#ifdef NIOS2_MMU_PRESENT -/* Convert KERNEL region address to IO region address */ -#define BYPASS_DCACHE_MASK (0x1 << 29) -#else -/* Set bit 31 of address to bypass D-cache */ -#define BYPASS_DCACHE_MASK (0x1 << 31) -#endif - -/* - * Convert a pointer to a block of uncached memory, into a block of - * cached memory. - */ - -void* alt_remap_cached (volatile void* ptr, alt_u32 len) -{ - return (void*) (((alt_u32) ptr) & ~BYPASS_DCACHE_MASK); -} diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_remap_uncached.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_remap_uncached.c deleted file mode 100644 index 7ff6302..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_remap_uncached.c +++ /dev/null @@ -1,51 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003,2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "sys/alt_cache.h" -#include "system.h" - -#ifdef NIOS2_MMU_PRESENT -/* Convert KERNEL region address to IO region address */ -#define BYPASS_DCACHE_MASK (0x1 << 29) -#else -/* Set bit 31 of address to bypass D-cache */ -#define BYPASS_DCACHE_MASK (0x1 << 31) -#endif - -/* - * Convert a pointer to a block of cached memory, into a block of - * uncached memory. - */ - -volatile void* alt_remap_uncached (void* ptr, alt_u32 len) -{ - alt_dcache_flush (ptr, len); - return (volatile void*) (((alt_u32) ptr) | BYPASS_DCACHE_MASK); -} diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_rename.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_rename.c deleted file mode 100644 index 48afac0..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_rename.c +++ /dev/null @@ -1,55 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "os/alt_syscall.h" - -/* - * _rename() is used by newlib to rename an existing file. This is unsupported - * in the HAL environment. However a "do-nothing" implementation is still - * provied for newlib compatability. - * - * ALT_RENAME is mapped onto the _rename() system call in alt_syscall.h - */ - -int ALT_RENAME (char *existing, char *new) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(_rename); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_sbrk.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_sbrk.c deleted file mode 100644 index b8c3799..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_sbrk.c +++ /dev/null @@ -1,136 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "os/alt_syscall.h" - -#include "sys/alt_irq.h" -#include "sys/alt_stack.h" - -#include "system.h" - -/* - * sbrk() is called to dynamically extend the data segment for the application. - * Thie input argument "incr" is the size of the block to allocate. - * - * This simple implementation does not perform any bounds checking. Memory will - * be allocated, even if the request region colides with the stack or overflows - * the available physical memory. - * - * ALT_SBRK is mapped onto the sbrk() system call in alt_syscall.h - * - * This function is called by the profiling code to allocate memory so must be - * safe if called from an interrupt context. It must also not be instrumented - * because that would lead to an infinate loop. - */ - -extern char __alt_heap_start[]; /* set by linker */ -extern char __alt_heap_limit[]; /* set by linker */ - -static char *heap_end = __alt_heap_start; - -#if defined(ALT_EXCEPTION_STACK) && defined(ALT_STACK_CHECK) -char * alt_exception_old_stack_limit = NULL; -#endif - -caddr_t ALT_SBRK (int incr) __attribute__ ((no_instrument_function )); - -caddr_t ALT_SBRK (int incr) -{ - alt_irq_context context; - char *prev_heap_end; - - context = alt_irq_disable_all(); - - /* Always return data aligned on a word boundary */ - heap_end = (char *)(((unsigned int)heap_end + 3) & ~3); - -#ifdef ALT_MAX_HEAP_BYTES - /* - * User specified a maximum heap size. Return -1 if it would - * be exceeded by this sbrk call. - */ - if (((heap_end + incr) - __alt_heap_start) > ALT_MAX_HEAP_BYTES) { - alt_irq_enable_all(context); - return (caddr_t)-1; - } -#else - if ((heap_end + incr) > __alt_heap_limit) { - alt_irq_enable_all(context); - return (caddr_t)-1; - } -#endif - - prev_heap_end = heap_end; - heap_end += incr; - -#ifdef ALT_STACK_CHECK - /* - * If the stack and heap are contiguous then extending the heap reduces the - * space available for the stack. If we are still using the default stack - * then adjust the stack limit to note this, while checking for stack - * pointer overflow. - * If the stack limit isn't pointing at the top of the heap then the code - * is using a different stack so none of this needs to be done. - */ - - if (alt_stack_limit() == prev_heap_end) - { - if (alt_stack_pointer() <= heap_end) - alt_report_stack_overflow(); - - alt_set_stack_limit(heap_end); - } - -#ifdef ALT_EXCEPTION_STACK - /* - * If we are executing from the exception stack then compare against the - * stack we switched away from as well. The exception stack is a fixed - * size so doesn't need to be checked. - */ - - if (alt_exception_old_stack_limit == prev_heap_end) - { - if (alt_exception_old_stack_limit <= heap_end) - alt_report_stack_overflow(); - - alt_exception_old_stack_limit = heap_end; - } -#endif - -#endif - - alt_irq_enable_all(context); - - return (caddr_t) prev_heap_end; -} diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_settod.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_settod.c deleted file mode 100644 index 59db0f8..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_settod.c +++ /dev/null @@ -1,96 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include "sys/alt_errno.h" -#include "sys/alt_alarm.h" -#include "os/alt_syscall.h" - -/* - * "alt_timezone" and "alt_resettime" are the values of the the reset time and - * time zone set through the last call to settimeofday(). By default they are - * zero initialised. - */ - -extern struct timezone alt_timezone; -extern struct timeval alt_resettime; - -/* - * Macro defining the number of micoseconds in a second. - */ - -#define ALT_US (1000000) - - -/* - * settimeofday() can be called to calibrate the system clock, so that - * subsequent calls to gettimeofday() will return the elapsed "wall clock" - * time. - * - * This is done by updating the global structures "alt_resettime" and - * "alt_timezone" so that an immediate call to gettimeofday() would return - * the value specified by "t" and "tz". - * - * Warning: if this function is called concurrently with a call to - * gettimeofday(), the value returned by gettimeofday() will be unreliable. - * - * ALT_SETTIMEOFDAY is mapped onto the settimeofday() system call in - * alt_syscall.h - */ - -int ALT_SETTIMEOFDAY (const struct timeval *t, - const struct timezone *tz) -{ - alt_u32 nticks = alt_nticks (); - alt_u32 tick_rate = alt_ticks_per_second (); - - /* If there is a system clock available, update the current time */ - - if (tick_rate) - { - alt_resettime.tv_sec = t->tv_sec - nticks/tick_rate; - alt_resettime.tv_usec = t->tv_usec - - ((nticks*(ALT_US/tick_rate))%ALT_US); - - alt_timezone.tz_minuteswest = tz->tz_minuteswest; - alt_timezone.tz_dsttime = tz->tz_dsttime; - - return 0; - } - - /* There's no system clock available */ - - ALT_ERRNO = ENOSYS; - return -1; -} diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_software_exception.S b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_software_exception.S deleted file mode 100644 index 2142594..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_software_exception.S +++ /dev/null @@ -1,53 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - - /* - * This file provides the global symbol: software_exception. It is provided to - * support legacy code, and should not be used by new software. - * - * It is used by legacy code to invoke the software exception handler as - * defined by version 1.0 of the Nios II kit. It should only be used when you - * are providing your own interrupt entry point, i.e. you are not using - * alt_irq_entry. - */ - -#include "system.h" - - /* - * Pull in the exception handler. - */ - - .globl alt_exception - - .section .exceptions.entry.label, "xa" - - .globl software_exception - .type software_exception, @function -software_exception: diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_stat.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_stat.c deleted file mode 100644 index 44e207b..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_stat.c +++ /dev/null @@ -1,59 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include -#include - -#include "os/alt_syscall.h" - -/* - * The stat() function is similar to the fstat() function in that it is used to - * obtain status information about a file. Instead of using an open file - * descriptor (like fstat()), stat() takes the name of a file as an input - * argument. - * - * ALT_STAT is mapped onto the stat() system call in alt_syscall.h - */ - -int ALT_STAT (const char *file, struct stat *st) -{ - int fd; - int rc; - - fd = open (file, 0); - rc = fstat (fd, st); - close (fd); - - return rc; -} diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_tick.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_tick.c deleted file mode 100644 index c73488d..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_tick.c +++ /dev/null @@ -1,149 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_irq.h" -#include "sys/alt_alarm.h" -#include "os/alt_hooks.h" -#include "alt_types.h" - -/* - * "_alt_tick_rate" is used to store the value of the system clock frequency - * in ticks per second. It is initialised to zero, which corresponds to there - * being no system clock facility available. - */ - -alt_u32 _alt_tick_rate = 0; - -/* - * "_alt_nticks" is the number of system clock ticks that have elapsed since - * reset. - */ - -volatile alt_u32 _alt_nticks = 0; - -/* - * "alt_alarm_list" is the head of a linked list of registered alarms. This is - * initialised to be an empty list. - */ - -ALT_LLIST_HEAD(alt_alarm_list); - -/* - * alt_alarm_stop() is called to remove an alarm from the list of registered - * alarms. Alternatively an alarm can unregister itself by returning zero when - * the alarm executes. - */ - -void alt_alarm_stop (alt_alarm* alarm) -{ - alt_irq_context irq_context; - - irq_context = alt_irq_disable_all(); - alt_llist_remove (&alarm->llist); - alt_irq_enable_all (irq_context); -} - -/* - * alt_tick() is periodically called by the system clock driver in order to - * process the registered list of alarms. Each alarm is registed with a - * callback interval, and a callback function, "callback". - * - * The return value of the callback function indicates how many ticks are to - * elapse until the next callback. A return value of zero indicates that the - * alarm should be deactivated. - * - * alt_tick() is expected to run at interrupt level. - */ - -void alt_tick (void) -{ - alt_alarm* next; - alt_alarm* alarm = (alt_alarm*) alt_alarm_list.next; - - alt_u32 next_callback; - - /* update the tick counter */ - - _alt_nticks++; - - /* process the registered callbacks */ - - while (alarm != (alt_alarm*) &alt_alarm_list) - { - next = (alt_alarm*) alarm->llist.next; - - /* - * Upon the tick-counter rolling over it is safe to clear the - * roll-over flag; once the flag is cleared this (or subsequnt) - * tick events are enabled to generate an alarm event. - */ - if ((alarm->rollover) && (_alt_nticks == 0)) - { - alarm->rollover = 0; - } - - /* if the alarm period has expired, make the callback */ - if ((alarm->time <= _alt_nticks) && (alarm->rollover == 0)) - { - next_callback = alarm->callback (alarm->context); - - /* deactivate the alarm if the return value is zero */ - - if (next_callback == 0) - { - alt_alarm_stop (alarm); - } - else - { - alarm->time += next_callback; - - /* - * If the desired alarm time causes a roll-over, set the rollover - * flag. This will prevent the subsequent tick event from causing - * an alarm too early. - */ - if(alarm->time < _alt_nticks) - { - alarm->rollover = 1; - } - } - } - alarm = next; - } - - /* - * Update the operating system specific timer facilities. - */ - - ALT_OS_TIME_TICK(); -} - diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_times.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_times.c deleted file mode 100644 index 4dd965d..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_times.c +++ /dev/null @@ -1,71 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "sys/alt_errno.h" -#include "sys/alt_alarm.h" -#include "os/alt_syscall.h" - -/* - * The times() function is used by newlib to obtain elapsed time information. - * The return value is the elapsed time since reset in system clock ticks. Note - * that this is distinct from the strict Posix version of times(), which should - * return the time since: 0 hours, 0 minutes, 0 seconds, January 1, 1970, GMT. - * - * The input structure is filled in with time accounting information. This - * implementation attributes all cpu time to the system. - * - * ALT_TIMES is mapped onto the times() system call in alt_syscall.h - */ - -clock_t ALT_TIMES (struct tms *buf) -{ - clock_t ticks = alt_nticks(); - - /* If there is no system clock present, generate an error */ - - if (!alt_ticks_per_second()) - { - ALT_ERRNO = ENOSYS; - return 0; - } - - /* Otherwise return the elapsed time */ - - buf->tms_utime = 0; - buf->tms_stime = ticks; - buf->tms_cutime = 0; - buf->tms_cstime = 0; - - return ticks; -} diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_uncached_free.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_uncached_free.c deleted file mode 100644 index 6e362ba..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_uncached_free.c +++ /dev/null @@ -1,49 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003,2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "sys/alt_cache.h" -#include "system.h" - -#ifdef NIOS2_MMU_PRESENT -/* Convert KERNEL region address to IO region address */ -#define BYPASS_DCACHE_MASK (0x1 << 29) -#else -/* Set bit 31 of address to bypass D-cache */ -#define BYPASS_DCACHE_MASK (0x1 << 31) -#endif - -/* - * Free a block of uncached memory. - */ - -void alt_uncached_free (volatile void* ptr) -{ - free ((void*) (((alt_u32) ptr) & ~BYPASS_DCACHE_MASK)); -} diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_uncached_malloc.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_uncached_malloc.c deleted file mode 100644 index ab3416d..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_uncached_malloc.c +++ /dev/null @@ -1,55 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003,2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "sys/alt_cache.h" -#include "system.h" - -#ifdef NIOS2_MMU_PRESENT -/* Convert KERNEL region address to IO region address */ -#define BYPASS_DCACHE_MASK (0x1 << 29) -#else -/* Set bit 31 of address to bypass D-cache */ -#define BYPASS_DCACHE_MASK (0x1 << 31) -#endif - -/* - * Allocate a block of uncached memory. - */ - -volatile void* alt_uncached_malloc (size_t size) -{ - void* ptr; - - ptr = malloc (size); - - alt_dcache_flush (ptr, size); - - return ptr ? (volatile void*) (((alt_u32) ptr) | BYPASS_DCACHE_MASK) : NULL; -} diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_unlink.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_unlink.c deleted file mode 100644 index 29e35d6..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_unlink.c +++ /dev/null @@ -1,55 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "os/alt_syscall.h" - -/* - * unlink() is used by newlib to delete an existing link to a file. This is - * unsupported in the HAL environment. However a "do-nothing" implementation - * is still provied for newlib compatability. - * - * ALT_UNLINK is mapped onto the unlink() system call in alt_syscall.h - */ - -int ALT_UNLINK (char *name) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(unlink); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_usleep.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_usleep.c deleted file mode 100644 index 2330eb8..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_usleep.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2003 Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - * - * ------------ - * - * Altera does not recommend, suggest or require that this reference design - * file be used in conjunction or combination with any other product. - * - * usleep.c - Microsecond delay routine - */ - -#include - -#include "priv/alt_busy_sleep.h" -#include "os/alt_syscall.h" - -/* - * This function simply calls alt_busy_sleep() to perform the delay. This - * function implements the delay as a calibrated "busy loop". - * - * ALT_USLEEP is mapped onto the usleep() system call in alt_syscall.h - */ - - - -#if defined (__GNUC__) && __GNUC__ >= 4 -int ALT_USLEEP (useconds_t us) -#else -unsigned int ALT_USLEEP (unsigned int us) -#endif -{ - return alt_busy_sleep(us); -} diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_wait.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_wait.c deleted file mode 100644 index a42f80f..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_wait.c +++ /dev/null @@ -1,52 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_errno.h" -#include "os/alt_syscall.h" - -/* - * wait() is used by newlib to wait for all child processes to exit. Since the - * HAL does not support spawning child processes, this returns immediately as - * there can't be anythign to wait for. - * - * ALT_WAIT is mapped onto the wait() system call in alt_syscall.h - */ - -int ALT_WAIT (int *status) -{ - *status = 0; - - ALT_ERRNO = ECHILD; - - return -1; -} - diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_write.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_write.c deleted file mode 100644 index 51debb5..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/alt_write.c +++ /dev/null @@ -1,138 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -#include "sys/alt_log_printf.h" - -/* - * The write() system call is used to write a block of data to a file or - * device. This function simply vectors the request to the device driver - * associated with the input file descriptor "file". - * - * ALT_WRITE is mapped onto the write() system call in alt_syscall.h - */ - -#ifdef ALT_USE_DIRECT_DRIVERS - -#include "system.h" -#include "sys/alt_driver.h" - -/* - * Provide minimal version that just writes to the stdout/stderr devices - * when provided. - */ - -int ALT_WRITE (int file, const void *ptr, size_t len) -{ -#ifdef ALT_STDOUT_PRESENT - ALT_DRIVER_WRITE_EXTERNS(ALT_STDOUT_DEV); -#endif -#ifdef ALT_STDERR_PRESENT - ALT_DRIVER_WRITE_EXTERNS(ALT_STDERR_DEV); -#endif - -#if !defined(ALT_STDOUT_PRESENT) && !defined(ALT_STDERR_PRESENT) - /* Generate a link time warning, should this function ever be called. */ - ALT_STUB_WARNING(write); -#endif - - switch (file) { -#ifdef ALT_STDOUT_PRESENT - case 1: /* stdout file descriptor */ - return ALT_DRIVER_WRITE(ALT_STDOUT_DEV, ptr, len, 0); -#endif /* ALT_STDOUT_PRESENT */ -#ifdef ALT_STDERR_PRESENT - case 2: /* stderr file descriptor */ - return ALT_DRIVER_WRITE(ALT_STDERR_DEV, ptr, len, 0); -#endif /* ALT_STDERR_PRESENT */ - default: - ALT_ERRNO = EBADFD; - return -1; - } -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -int ALT_WRITE (int file, const void *ptr, size_t len) -{ - alt_fd* fd; - int rval; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - /* - * If the file has not been opened with write access, or if the driver does - * not provide an implementation of write(), generate an error. Otherwise - * call the drivers write() function to process the request. - */ - - if (((fd->fd_flags & O_ACCMODE) != O_RDONLY) && fd->dev->write) - { - - /* ALT_LOG - see altera_hal/HAL/inc/sys/alt_log_printf.h */ - ALT_LOG_WRITE_FUNCTION(ptr,len); - - if ((rval = fd->dev->write(fd, ptr, len)) < 0) - { - ALT_ERRNO = -rval; - return -1; - } - return rval; - } - else - { - ALT_ERRNO = EACCES; - } - } - else - { - ALT_ERRNO = EBADFD; - } - return -1; -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/altera_nios2_qsys_irq.c b/software/qsys_tutorial_switchs18_bsp/HAL/src/altera_nios2_qsys_irq.c deleted file mode 100644 index c7a4f93..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/altera_nios2_qsys_irq.c +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2009 Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - * - * altera_nios2_irq.c - Support for Nios II internal interrupt controller. - * - */ - -#include "sys/alt_irq.h" -#include "altera_nios2_qsys_irq.h" - -/* - * To initialize the internal interrupt controller, just clear the IENABLE - * register so that all possible IRQs are disabled. - */ -void altera_nios2_qsys_irq_init(void) -{ - NIOS2_WRITE_IENABLE(0); -} diff --git a/software/qsys_tutorial_switchs18_bsp/HAL/src/crt0.S b/software/qsys_tutorial_switchs18_bsp/HAL/src/crt0.S deleted file mode 100644 index 582445d..0000000 --- a/software/qsys_tutorial_switchs18_bsp/HAL/src/crt0.S +++ /dev/null @@ -1,456 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "system.h" -#include "nios2.h" - -/* Setup header files to work with assembler code. */ -#define ALT_ASM_SRC - -/* Debug logging facility */ -#include "sys/alt_log_printf.h" - -/*************************************************************************\ -| MACROS | -\*************************************************************************/ - -/* - * The new build tools explicitly define macros when alt_load() - * must be called. The define ALT_LOAD_EXPLICITLY_CONTROLLED tells us that - * those macros are controlling if alt_load() needs to be called. - */ -#ifdef ALT_LOAD_EXPLICITLY_CONTROLLED - -/* Need to call alt_load() if any of these sections are being copied. */ -#if defined(ALT_LOAD_COPY_RODATA) || defined(ALT_LOAD_COPY_RWDATA) || defined(ALT_LOAD_COPY_EXCEPTIONS) -#define CALL_ALT_LOAD -#endif - -#else /* !ALT_LOAD_EXPLICITLY_CONTROLLED */ - -/* - * The legacy build tools use the following macros to detect when alt_load() - * needs to be called. - */ - -#define __ALT_LOAD_SECTIONS(res, text, rodata, exc) \ - ((res##_BASE != rodata##_BASE) || \ - (res##_BASE != rwdata##_BASE) || \ - (res##_BASE != exc##_BASE)) - -#define _ALT_LOAD_SECTIONS(res, text, rodata, exc) \ - __ALT_LOAD_SECTIONS(res, text, rodata, exc) - -#define ALT_LOAD_SECTIONS _ALT_LOAD_SECTIONS(ALT_RESET_DEVICE, \ - ALT_RODATA_DEVICE, \ - ALT_RWDATA_DEVICE, \ - ALT_EXCEPTIONS_DEVICE) - -/* Call alt_load() if there is no bootloader and ALT_LOAD_SECTIONS isn't 0. */ -#if defined(ALT_NO_BOOTLOADER) && ALT_LOAD_SECTIONS -#define CALL_ALT_LOAD -#endif - -#endif /* !ALT_LOAD_EXPLICITLY_CONTROLLED */ - -/* - * When the legacy build tools define a macro called ALT_NO_BOOTLOADER, - * it indicates that initialization code is allowed at the reset address. - * The new build tools define a macro called ALT_ALLOW_CODE_AT_RESET for - * the same purpose. - */ -#ifdef ALT_NO_BOOTLOADER -#define ALT_ALLOW_CODE_AT_RESET -#endif - -/*************************************************************************\ -| EXTERNAL REFERENCES | -\*************************************************************************/ - -/* - * The entry point for user code is either "main" in hosted mode, or - * "alt_main" in standalone mode. These are explicitly referenced here, - * to ensure they are built into the executable. This allows the user - * to build them into libraries, rather than supplying them in object - * files at link time. - */ - .globl main - .globl alt_main - -/* - * Create a reference to the software multiply/divide and trap handers, - * so that if they are provided, they will appear in the executable. - */ -#ifndef ALT_NO_INSTRUCTION_EMULATION - .globl alt_exception_muldiv -#endif -#ifdef ALT_TRAP_HANDLER - .globl alt_exception_trap -#endif - -/* - * Linker defined symbols used to initialize bss. - */ -.globl __bss_start -.globl __bss_end - -/*************************************************************************\ -| RESET SECTION (.entry) | -\*************************************************************************/ - -/* - * This is the reset entry point for Nios II. - * - * At reset, only the cache line which contain the reset vector is - * initialized by the hardware. The code within the first cache line - * initializes the remainder of the instruction cache. - */ - - .section .entry, "xa" - .align 5 - -/* - * Explicitly allow the use of r1 (the assembler temporary register) - * within this code. This register is normally reserved for the use of - * the assembler. - */ - .set noat - -/* - * Some tools want to know where the reset vector is. - * Code isn't always provided at the reset vector but at least the - * __reset label always contains the reset vector address because - * it is defined at the start of the .entry section. - */ - - .globl __reset - .type __reset, @function -__reset: - -/* - * Initialize the instruction cache if present (i.e. size > 0) and - * reset code is allowed unless optimizing for RTL simulation. - * RTL simulations can ensure the instruction cache is already initialized - * so skipping this loop speeds up RTL simulation. - */ - -#if NIOS2_ICACHE_SIZE > 0 && defined(ALT_ALLOW_CODE_AT_RESET) && !defined(ALT_SIM_OPTIMIZE) - /* Assume the instruction cache size is always a power of two. */ -#if NIOS2_ICACHE_SIZE > 0x8000 - movhi r2, %hi(NIOS2_ICACHE_SIZE) -#else - movui r2, NIOS2_ICACHE_SIZE -#endif - -0: - initi r2 - addi r2, r2, -NIOS2_ICACHE_LINE_SIZE - bgt r2, zero, 0b -1: - - /* - * The following debug information tells the ISS not to run the loop above - * but to perform its actions using faster internal code. - */ - .pushsection .debug_alt_sim_info - .int 1, 1, 0b, 1b - .popsection -#endif /* Initialize Instruction Cache */ - -/* - * Jump to the _start entry point in the .text section if reset code - * is allowed or if optimizing for RTL simulation. - */ -#if defined(ALT_ALLOW_CODE_AT_RESET) || defined(ALT_SIM_OPTIMIZE) - /* Jump to the _start entry point in the .text section. */ - movhi r1, %hi(_start) - ori r1, r1, %lo(_start) - jmp r1 - - .size __reset, . - __reset -#endif /* Jump to _start */ - -/* - * When not using exit, provide an _exit symbol to prevent unresolved - * references to _exit from the linker script. - */ -#ifdef ALT_NO_EXIT - .globl _exit -_exit: -#endif - -/*************************************************************************\ -| TEXT SECTION (.text) | -\*************************************************************************/ - -/* - * Start of the .text section, and also the code entry point when - * the code is executed by a bootloader rather than directly from reset. - */ - .section .text - .align 2 - - .globl _start - .type _start, @function -_start: - -/* - * Initialize the data cache if present (i.e. size > 0) and not - * optimizing for RTL simulation. - * RTL simulations can ensure the data cache is already initialized - * so skipping this loop speeds up RTL simulation. - */ - -#if NIOS2_DCACHE_SIZE > 0 && !defined(ALT_SIM_OPTIMIZE) - - /* Assume the data cache size is always a power of two. */ -#if NIOS2_DCACHE_SIZE > 0x8000 - movhi r2, %hi(NIOS2_DCACHE_SIZE) -#else - movui r2, NIOS2_DCACHE_SIZE -#endif - -0: - initd 0(r2) - addi r2, r2, -NIOS2_DCACHE_LINE_SIZE - bgt r2, zero, 0b -1: - - /* - * The following debug information tells the ISS not to run the loop above - * but to perform its actions using faster internal code. - */ - .pushsection .debug_alt_sim_info - .int 2, 1, 0b, 1b - .popsection - -#endif /* Initialize Data Cache */ - - /* Log that caches have been initialized. */ - ALT_LOG_PUTS(alt_log_msg_cache) - - /* Log that the stack pointer is about to be setup. */ - ALT_LOG_PUTS(alt_log_msg_stackpointer) - -#if (NIOS2_NUM_OF_SHADOW_REG_SETS == 0) - /* - * Now that the caches are initialized, set up the stack pointer. - * The value provided by the linker is assumed to be correctly aligned. - */ - movhi sp, %hi(__alt_stack_pointer) - ori sp, sp, %lo(__alt_stack_pointer) - - /* Set up the global pointer. */ - movhi gp, %hi(_gp) - ori gp, gp, %lo(_gp) - -#else /* NIOS2_NUM_OF_SHADOW_REG_SETS > 0 */ - - /* - * Set up the GP and SP in all shadow register sets. - */ - - /* - * Check current register set number, if CPU resets into a shadow register - * set, switch register set to 0 by writing zero to SSTATUS register and - * execute an ERET instruction that just jumps to the next PC address - * (use the NEXTPC instruction to get this). - */ - - rdctl r2, status - - /* Get the current register set number (STATUS.CRS). */ - andi r3, r2, NIOS2_STATUS_CRS_MSK - - /* Skip switch register set if STATUS.CRS is 0. */ - beq r3, zero, .Lskip_switch_reg_set - - .set nobreak - - /* Current register set is non-zero, set SSTATUS to 0. */ - mov sstatus, zero - - /* Get next pc and store in ea. */ - nextpc ea - - /* Point to instruction after eret. */ - addi ea, ea, 8 - - /* - * Execute ERET instruction that just jumps to the next PC address - */ - eret - -.Lskip_switch_reg_set: - mov r2, zero - - /* Reset STATUS register */ - wrctl status, r2 - - movui r3, NIOS2_NUM_OF_SHADOW_REG_SETS - - /* Set up the stack pointer in register set 0. */ - movhi sp, %hi(__alt_stack_pointer) - ori sp, sp, %lo(__alt_stack_pointer) - - /* Set up the global pointer in register set 0. */ - movhi gp, %hi(_gp) - ori gp, gp, %lo(_gp) - -.Lsetup_sp_and_gp_loop: - /* - * Setup GP and SP for shadow register set - * from NIOS2_NUM_OF_SHADOW_REG_SETS to 0 - */ - - /* Skip if number of register sets is 0. */ - beq r3, zero, .Lno_shadow_register_set - - - /* Add previous register set STATUS.PRS by 1 */ - movhi r4, 1 - add r2, r2, r4 - - /* Write STATUS */ - wrctl status, r2 - - /* Clear r0 in the shadow register set (not done by hardware) */ - wrprs r0, r0 - - /* Write the GP in previous register set */ - wrprs gp, gp - - /* Only write the SP in previous register set - * if using the seperate exception stack. For normal case (single stack), - * funnel code would read the SP from previous register set. - */ -#ifdef ALT_INTERRUPT_STACK - - movhi et, %hiadj(__alt_interrupt_stack_pointer) - addi et, et, %lo(__alt_interrupt_stack_pointer) - wrprs sp, et - -#endif /* ALT_INTERRUPT_STACK */ - - /* Decrease number of register set counter by 1 */ - addi r3, r3, -1 - - br .Lsetup_sp_and_gp_loop -.Lno_shadow_register_set: - -#endif /* NIOS2_NUM_OF_SHADOW_REG_SETS */ -/* - * Clear the BSS if not optimizing for RTL simulation. - * - * This uses the symbols: __bss_start and __bss_end, which are defined - * by the linker script. They mark the begining and the end of the bss - * region. The linker script guarantees that these values are word aligned. - */ -#ifndef ALT_SIM_OPTIMIZE - /* Log that the BSS is about to be cleared. */ - ALT_LOG_PUTS(alt_log_msg_bss) - - movhi r2, %hi(__bss_start) - ori r2, r2, %lo(__bss_start) - - movhi r3, %hi(__bss_end) - ori r3, r3, %lo(__bss_end) - - beq r2, r3, 1f - -0: - stw zero, (r2) - addi r2, r2, 4 - bltu r2, r3, 0b - -1: - - /* - * The following debug information tells the ISS not to run the loop above - * but to perform its actions using faster internal code. - */ - .pushsection .debug_alt_sim_info - .int 3, 1, 0b, 1b - .popsection -#endif /* ALT_SIM_OPTIMIZE */ - -/* - * The alt_load() facility is normally used when there is no bootloader. - * It copies some sections into RAM so it acts like a mini-bootloader. - */ -#ifdef CALL_ALT_LOAD - -#ifdef ALT_STACK_CHECK - /* - * If the user has selected stack checking then we need to set up a safe - * value in the stack limit register so that the relocation functions - * don't think the stack has overflowed (the contents of the rwdata - * section aren't defined until alt_load() has been called). - */ - mov et, zero -#endif - - call alt_load - -#endif /* CALL_ALT_LOAD */ - -#ifdef ALT_STACK_CHECK - /* - * Set up the stack limit (if required). The linker has set up the - * copy of the variable which is in memory. - */ - - ldw et, %gprel(alt_stack_limit_value)(gp) -#endif - - /* Log that alt_main is about to be called. */ - ALT_LOG_PUTS(alt_log_msg_alt_main) - - /* Call the C entry point. It should never return. */ - call alt_main - - /* Wait in infinite loop in case alt_main does return. */ -alt_after_alt_main: - br alt_after_alt_main - - .size _start, . - _start - -/* - * Add information about the stack base if stack overflow checking is enabled. - */ -#ifdef ALT_STACK_CHECK - .globl alt_stack_limit_value - .section .sdata,"aws",@progbits - .align 2 - .type alt_stack_limit_value, @object - .size alt_stack_limit_value, 4 -alt_stack_limit_value: - .long __alt_stack_limit -#endif diff --git a/software/qsys_tutorial_switchs18_bsp/Makefile b/software/qsys_tutorial_switchs18_bsp/Makefile deleted file mode 100644 index dcf3b22..0000000 --- a/software/qsys_tutorial_switchs18_bsp/Makefile +++ /dev/null @@ -1,766 +0,0 @@ -#------------------------------------------------------------------------------ -# BSP MAKEFILE -# -# This makefile was automatically generated by the nios2-bsp-generate-files -# command. Its purpose is to build a custom Board Support Package (BSP) -# targeting a specific Nios II processor in an SOPC Builder-based design. -# -# To create an application or library Makefile which uses this BSP, try the -# nios2-app-generate-makefile or nios2-lib-generate-makefile commands. -#------------------------------------------------------------------------------ - -#------------------------------------------------------------------------------ -# TOOLS -#------------------------------------------------------------------------------ - -MKDIR := mkdir -p -ECHO := echo -SPACE := $(empty) $(empty) - -#------------------------------------------------------------------------------ -# The adjust-path macro -# -# If COMSPEC is defined, Make is launched from Windows through -# Cygwin. This adjust-path macro will call 'cygpath -u' on all -# paths to ensure they are readable by Make. -# -# If COMSPEC is not defined, Make is launched from *nix, and no adjustment -# is necessary -#------------------------------------------------------------------------------ - -ifndef COMSPEC -ifdef ComSpec -COMSPEC = $(ComSpec) -endif # ComSpec -endif # !COMSPEC - -ifdef COMSPEC - adjust-path = $(subst $(SPACE),\$(SPACE),$(shell cygpath -u "$1")) - adjust-path-mixed = $(subst $(SPACE),\$(SPACE),$(shell cygpath -m "$1")) -else - adjust-path = $(subst $(SPACE),\$(SPACE),$1) - adjust-path-mixed = $(subst $(SPACE),\$(SPACE),$1) -endif - -#------------------------------------------------------------------------------ -# DEFAULT TARGET -# -# The default target, "all", must appear before any other target in the -# Makefile. Note that extra prerequisites are added to the "all" rule later. -#------------------------------------------------------------------------------ -.PHONY: all -all: - @$(ECHO) [BSP build complete] - - -#------------------------------------------------------------------------------ -# PATHS & DIRECTORY NAMES -# -# Explicitly locate absolute path of the BSP root -#------------------------------------------------------------------------------ - -BSP_ROOT_DIR := . - -# Define absolute path to the root of the BSP. -ABS_BSP_ROOT := $(call adjust-path-mixed,$(shell pwd)) - -# Stash all BSP object files here -OBJ_DIR := ./obj - -NEWLIB_DIR = $(BSP_ROOT_DIR)/newlib - - -#------------------------------------------------------------------------------ -# MANAGED CONTENT -# -# All content between the lines "START MANAGED" and "END MANAGED" below is -# generated based on variables in the BSP settings file when the -# nios2-bsp-generate-files command is invoked. If you wish to persist any -# information pertaining to the build process, it is recomended that you -# utilize the BSP settings mechanism to do so. -# -# Note that most variable assignments in this section have a corresponding BSP -# setting that can be changed by using the nios2-bsp-create-settings or -# nios2-bsp-update-settings command before nios2-bsp-generate-files; if you -# want any variable set to a specific value when this Makefile is re-generated -# (to prevent hand-edits from being over-written), use the BSP settings -# facilities above. -#------------------------------------------------------------------------------ - -#START MANAGED - -# The following TYPE comment allows tools to identify the 'type' of target this -# makefile is associated with. -# TYPE: BSP_PRIVATE_MAKEFILE - -# This following VERSION comment indicates the version of the tool used to -# generate this makefile. A makefile variable is provided for VERSION as well. -# ACDS_VERSION: 13.0sp1 -ACDS_VERSION := 13.0sp1 - -# This following BUILD_NUMBER comment indicates the build number of the tool -# used to generate this makefile. -# BUILD_NUMBER: 232 - -SETTINGS_FILE := settings.bsp -SOPC_FILE := C:/Users/takayun/Documents/DE2-115/qsys_tutorial/nios_system.sopcinfo - -#------------------------------------------------------------------------------- -# TOOL & COMMAND DEFINITIONS -# -# The base command for each build operation are expressed here. Additional -# switches may be expressed here. They will run for all instances of the -# utility. -#------------------------------------------------------------------------------- - -# Archiver command. Creates library files. -AR = nios2-elf-ar - -# Assembler command. Note that CC is used for .S files. -AS = nios2-elf-gcc - -# Custom flags only passed to the archiver. This content of this variable is -# directly passed to the archiver rather than the more standard "ARFLAGS". The -# reason for this is that GNU Make assumes some default content in ARFLAGS. -# This setting defines the value of BSP_ARFLAGS in Makefile. -BSP_ARFLAGS = -src - -# Custom flags only passed to the assembler. This setting defines the value of -# BSP_ASFLAGS in Makefile. -BSP_ASFLAGS = -Wa,-gdwarf2 - -# C/C++ compiler debug level. '-g' provides the default set of debug symbols -# typically required to debug a typical application. Omitting '-g' removes -# debug symbols from the ELF. This setting defines the value of -# BSP_CFLAGS_DEBUG in Makefile. -BSP_CFLAGS_DEBUG = -g - -# C/C++ compiler optimization level. "-O0" = no optimization,"-O2" = "normal" -# optimization, etc. "-O0" is recommended for code that you want to debug since -# compiler optimization can remove variables and produce non-sequential -# execution of code while debugging. This setting defines the value of -# BSP_CFLAGS_OPTIMIZATION in Makefile. -BSP_CFLAGS_OPTIMIZATION = '-Os' - -# C/C++ compiler warning level. "-Wall" is commonly used.This setting defines -# the value of BSP_CFLAGS_WARNINGS in Makefile. -BSP_CFLAGS_WARNINGS = -Wall - -# C compiler command. -CC = nios2-elf-gcc -xc - -# C++ compiler command. -CXX = nios2-elf-gcc -xc++ - -# Command used to remove files during 'clean' target. -RM = rm -f - - -#------------------------------------------------------------------------------- -# BUILD PRE & POST PROCESS COMMANDS -# -# The following variables are treated as shell commands in the rule -# definitions for each file-type associated with the BSP build, as well as -# commands run at the beginning and end of the entire BSP build operation. -# Pre-process commands are executed before the relevant command (for example, -# a command defined in the "CC_PRE_PROCESS" variable executes before the C -# compiler for building .c files), while post-process commands are executed -# immediately afterwards. -# -# You can view each pre/post-process command in the "Build Rules: All & -# Clean", "Pattern Rules to Build Objects", and "Library Rules" sections of -# this Makefile. -#------------------------------------------------------------------------------- - - -#------------------------------------------------------------------------------- -# BSP SOURCE BUILD SETTINGS (FLAG GENERATION) -# -# Software build settings such as compiler optimization, debug level, warning -# flags, etc., may be defined in the following variables. The variables below -# are concatenated together in the 'Flags' section of this Makefile to form -# final variables of flags passed to the build tools. -# -# These settings are considered private to the BSP and apply to all library & -# driver files in it; they do NOT automatically propagate to, for example, the -# build settings for an application. -# # For additional detail and syntax requirements, please refer to GCC help -# (example: "nios2-elf-gcc --help --verbose"). -# -# Unless indicated otherwise, multiple entries in each variable should be -# space-separated. -#------------------------------------------------------------------------------- - -# Altera HAL alt_sys_init.c generated source file -GENERATED_C_FILES := $(ABS_BSP_ROOT)/alt_sys_init.c -GENERATED_C_LIB_SRCS += alt_sys_init.c - - -#------------------------------------------------------------------------------- -# BSP SOURCE FILE LISTING -# -# All source files that comprise the BSP are listed here, along with path -# information to each file expressed relative to the BSP root. The precise -# list and location of each file is derived from the driver, operating system, -# or software package source file declarations. -# -# Following specification of the source files for each component, driver, etc., -# each source file type (C, assembly, etc.) is concatenated together and used -# to construct a list of objects. Pattern rules to build each object are then -# used to build each file. -#------------------------------------------------------------------------------- - -# altera_avalon_jtag_uart_driver sources root -altera_avalon_jtag_uart_driver_SRCS_ROOT := drivers - -# altera_avalon_jtag_uart_driver sources -altera_avalon_jtag_uart_driver_C_LIB_SRCS := \ - $(altera_avalon_jtag_uart_driver_SRCS_ROOT)/src/altera_avalon_jtag_uart_init.c \ - $(altera_avalon_jtag_uart_driver_SRCS_ROOT)/src/altera_avalon_jtag_uart_read.c \ - $(altera_avalon_jtag_uart_driver_SRCS_ROOT)/src/altera_avalon_jtag_uart_write.c \ - $(altera_avalon_jtag_uart_driver_SRCS_ROOT)/src/altera_avalon_jtag_uart_ioctl.c \ - $(altera_avalon_jtag_uart_driver_SRCS_ROOT)/src/altera_avalon_jtag_uart_fd.c - -# altera_avalon_pio_driver sources root -altera_avalon_pio_driver_SRCS_ROOT := drivers - -# altera_avalon_pio_driver sources -# altera_nios2_qsys_hal_driver sources root -altera_nios2_qsys_hal_driver_SRCS_ROOT := HAL - -# altera_nios2_qsys_hal_driver sources -altera_nios2_qsys_hal_driver_C_LIB_SRCS := \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/altera_nios2_qsys_irq.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_usleep.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_busy_sleep.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_irq_vars.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_icache_flush.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_icache_flush_all.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_dcache_flush.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_dcache_flush_all.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_dcache_flush_no_writeback.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_instruction_exception_entry.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_irq_register.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_iic.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_remap_cached.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_remap_uncached.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_uncached_free.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_uncached_malloc.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_do_ctors.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_do_dtors.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_gmon.c - -altera_nios2_qsys_hal_driver_ASM_LIB_SRCS := \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_exception_entry.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_exception_trap.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_exception_muldiv.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_irq_entry.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_software_exception.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_mcount.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_log_macro.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/crt0.S - -# hal sources root -hal_SRCS_ROOT := HAL - -# hal sources -hal_C_LIB_SRCS := \ - $(hal_SRCS_ROOT)/src/alt_alarm_start.c \ - $(hal_SRCS_ROOT)/src/alt_close.c \ - $(hal_SRCS_ROOT)/src/alt_dev.c \ - $(hal_SRCS_ROOT)/src/alt_dev_llist_insert.c \ - $(hal_SRCS_ROOT)/src/alt_dma_rxchan_open.c \ - $(hal_SRCS_ROOT)/src/alt_dma_txchan_open.c \ - $(hal_SRCS_ROOT)/src/alt_environ.c \ - $(hal_SRCS_ROOT)/src/alt_env_lock.c \ - $(hal_SRCS_ROOT)/src/alt_errno.c \ - $(hal_SRCS_ROOT)/src/alt_execve.c \ - $(hal_SRCS_ROOT)/src/alt_exit.c \ - $(hal_SRCS_ROOT)/src/alt_fcntl.c \ - $(hal_SRCS_ROOT)/src/alt_fd_lock.c \ - $(hal_SRCS_ROOT)/src/alt_fd_unlock.c \ - $(hal_SRCS_ROOT)/src/alt_find_dev.c \ - $(hal_SRCS_ROOT)/src/alt_find_file.c \ - $(hal_SRCS_ROOT)/src/alt_flash_dev.c \ - $(hal_SRCS_ROOT)/src/alt_fork.c \ - $(hal_SRCS_ROOT)/src/alt_fs_reg.c \ - $(hal_SRCS_ROOT)/src/alt_fstat.c \ - $(hal_SRCS_ROOT)/src/alt_get_fd.c \ - $(hal_SRCS_ROOT)/src/alt_getchar.c \ - $(hal_SRCS_ROOT)/src/alt_getpid.c \ - $(hal_SRCS_ROOT)/src/alt_gettod.c \ - $(hal_SRCS_ROOT)/src/alt_iic_isr_register.c \ - $(hal_SRCS_ROOT)/src/alt_instruction_exception_register.c \ - $(hal_SRCS_ROOT)/src/alt_ioctl.c \ - $(hal_SRCS_ROOT)/src/alt_io_redirect.c \ - $(hal_SRCS_ROOT)/src/alt_irq_handler.c \ - $(hal_SRCS_ROOT)/src/alt_isatty.c \ - $(hal_SRCS_ROOT)/src/alt_kill.c \ - $(hal_SRCS_ROOT)/src/alt_link.c \ - $(hal_SRCS_ROOT)/src/alt_load.c \ - $(hal_SRCS_ROOT)/src/alt_log_printf.c \ - $(hal_SRCS_ROOT)/src/alt_lseek.c \ - $(hal_SRCS_ROOT)/src/alt_main.c \ - $(hal_SRCS_ROOT)/src/alt_malloc_lock.c \ - $(hal_SRCS_ROOT)/src/alt_open.c \ - $(hal_SRCS_ROOT)/src/alt_printf.c \ - $(hal_SRCS_ROOT)/src/alt_putchar.c \ - $(hal_SRCS_ROOT)/src/alt_putstr.c \ - $(hal_SRCS_ROOT)/src/alt_read.c \ - $(hal_SRCS_ROOT)/src/alt_release_fd.c \ - $(hal_SRCS_ROOT)/src/alt_rename.c \ - $(hal_SRCS_ROOT)/src/alt_sbrk.c \ - $(hal_SRCS_ROOT)/src/alt_settod.c \ - $(hal_SRCS_ROOT)/src/alt_stat.c \ - $(hal_SRCS_ROOT)/src/alt_tick.c \ - $(hal_SRCS_ROOT)/src/alt_times.c \ - $(hal_SRCS_ROOT)/src/alt_unlink.c \ - $(hal_SRCS_ROOT)/src/alt_wait.c \ - $(hal_SRCS_ROOT)/src/alt_write.c - - -# Assemble all component C source files -COMPONENT_C_LIB_SRCS += \ - $(altera_avalon_jtag_uart_driver_C_LIB_SRCS) \ - $(altera_nios2_qsys_hal_driver_C_LIB_SRCS) \ - $(hal_C_LIB_SRCS) - -# Assemble all component assembly source files -COMPONENT_ASM_LIB_SRCS += \ - $(altera_nios2_qsys_hal_driver_ASM_LIB_SRCS) - -# Assemble all component C++ source files -COMPONENT_CPP_LIB_SRCS += \ - -#END MANAGED - -#------------------------------------------------------------------------------ -# PUBLIC.MK -# -# The generated public.mk file contains BSP information that is shared with -# other external makefiles, such as a Nios II application makefile. System- -# dependent information such as hardware-specific compiler flags and -# simulation file generation are stored here. -# -# In addition, public.mk contains include paths that various software, -# such as a device driver, may need for the C compiler. These paths are -# written to public.mk with respect to the BSP root. In public.mk, each -# path is prefixed with a special variable, $(ALT_LIBRARY_ROOT_DIR). The -# purpose of this variable is to allow an external Makefile to append on -# path information to precisely locate paths expressed in public.mk -# Since this is the BSP Makefile, we set ALT_LIBRARY_ROOT_DIR to point right -# here ("."), at the BSP root. -# -# ALT_LIBRARY_ROOT_DIR must always be set before public.mk is included. -#------------------------------------------------------------------------------ -ALT_LIBRARY_ROOT_DIR := . -include public.mk - - -#------------------------------------------------------------------------------ -# FLAGS -# -# Include paths for BSP files are written into the public.mk file and must -# be added to the existing list of pre-processor flags. In addition, "hooks" -# for standard flags left intentionally empty (CFLAGS, CPPFLAGS, ASFLAGS, -# and CXXFLAGS) are provided for conveniently adding to the relevant flags -# on the command-line or via script that calls make. -#------------------------------------------------------------------------------ -# Assemble final list of compiler flags from generated content -BSP_CFLAGS += \ - $(BSP_CFLAGS_DEFINED_SYMBOLS) \ - $(BSP_CFLAGS_UNDEFINED_SYMBOLS) \ - $(BSP_CFLAGS_OPTIMIZATION) \ - $(BSP_CFLAGS_DEBUG) \ - $(BSP_CFLAGS_WARNINGS) \ - $(BSP_CFLAGS_USER_FLAGS) \ - $(ALT_CFLAGS) \ - $(CFLAGS) - -# Make ready the final list of include directories and other C pre-processor -# flags. Each include path is made ready by prefixing it with "-I". -BSP_CPPFLAGS += \ - $(addprefix -I, $(BSP_INC_DIRS)) \ - $(addprefix -I, $(ALT_INCLUDE_DIRS)) \ - $(ALT_CPPFLAGS) \ - $(CPPFLAGS) - -# Finish off assembler flags with any user-provided flags -BSP_ASFLAGS += $(ASFLAGS) - -# Finish off C++ flags with any user-provided flags -BSP_CXXFLAGS += $(CXXFLAGS) - -# And finally, the ordered list -C_SRCS += $(GENERATED_C_LIB_SRCS) \ - $(COMPONENT_C_LIB_SRCS) - -CXX_SRCS += $(GENERATED_CPP_LIB_SRCS) \ - $(COMPONENT_CPP_LIB_SRCS) - -ASM_SRCS += $(GENERATED_ASM_LIB_SRCS) \ - $(COMPONENT_ASM_LIB_SRCS) - - -#------------------------------------------------------------------------------ -# LIST OF GENERATED FILES -# -# A Nios II BSP relies on the generation of several source files used -# by both the BSP and any applications referencing the BSP. -#------------------------------------------------------------------------------ - - -GENERATED_H_FILES := $(ABS_BSP_ROOT)/system.h - -GENERATED_LINKER_SCRIPT := $(ABS_BSP_ROOT)/linker.x - -GENERATED_FILES += $(GENERATED_H_FILES) \ - $(GENERATED_LINKER_SCRIPT) - - -#------------------------------------------------------------------------------ -# SETUP TO BUILD OBJECTS -# -# List of object files which are to be built. This is constructed from the input -# list of C source files (C_SRCS), C++ source files (CXX_SRCS), and assembler -# source file (ASM_SRCS). The permitted file extensions are: -# -# .c .C - for C files -# .cxx .cc .cpp .CXX .CC .CPP - for C++ files -# .S .s - for assembly files -# -# Extended description: The list of objects is a sorted list (duplicates -# removed) of all possible objects, placed beneath the ./obj directory, -# including any path information stored in the "*_SRCS" variable. The -# "patsubst" commands are used to concatenate together multiple file suffix -# types for common files (i.e. c++ as .cxx, .cc, .cpp). -# -# File extensions are case-insensitive in build rules with the exception of -# assembly sources. Nios II assembly sources with the ".S" extension are first -# run through the C preprocessor. Sources with the ".s" extension are not. -#------------------------------------------------------------------------------ -OBJS = $(sort $(addprefix $(OBJ_DIR)/, \ - $(patsubst %.c, %.o, $(patsubst %.C, %.o, $(C_SRCS))) \ - $(patsubst %.cxx, %.o, $(patsubst %.CXX, %.o, \ - $(patsubst %.cc, %.o, $(patsubst %.CC, %.o, \ - $(patsubst %.cpp, %.o, $(patsubst %.CPP, %.o, \ - $(CXX_SRCS) )))))) \ - $(patsubst %.S, %.o, $(patsubst %.s, %.o, $(ASM_SRCS))) )) - -# List of dependancy files for each object file. -DEPS = $(OBJS:.o=.d) - - -# Rules to force your project to rebuild or relink -# .force_relink file will cause any application that depends on this project to relink -# .force_rebuild file will cause this project to rebuild object files -# .force_rebuild_all file will cause this project and any project that depends on this project to rebuild object files - -FORCE_RELINK_DEP := .force_relink -FORCE_REBUILD_DEP := .force_rebuild -FORCE_REBUILD_ALL_DEP := .force_rebuild_all -FORCE_REBUILD_DEP_LIST := $(FORCE_RELINK_DEP) $(FORCE_REBUILD_DEP) $(FORCE_REBUILD_ALL_DEP) - -$(FORCE_REBUILD_DEP_LIST): - -$(OBJS): $(wildcard $(FORCE_REBUILD_DEP)) $(wildcard $(FORCE_REBUILD_ALL_DEP)) - - -#------------------------------------------------------------------------------ -# BUILD RULES: ALL & CLEAN -#------------------------------------------------------------------------------ -.DELETE_ON_ERROR: - -.PHONY: all -all: build_pre_process -all: Makefile $(GENERATED_FILES) $(BSP_LIB) $(NEWLIB_DIR) -all: build_post_process - - -# clean: remove .o/.a/.d -.PHONY: clean -clean: - @$(RM) -r $(BSP_LIB) $(OBJ_DIR) $(FORCE_REBUILD_DEP_LIST) -ifneq ($(wildcard $(NEWLIB_DIR)),) - @$(RM) -r $(NEWLIB_DIR) -endif - @$(ECHO) [BSP clean complete] - - -#------------------------------------------------------------------------------ -# BUILD PRE/POST PROCESS -#------------------------------------------------------------------------------ -build_pre_process : - $(BUILD_PRE_PROCESS) - -build_post_process : - $(BUILD_POST_PROCESS) - -.PHONY: build_pre_process build_post_process - - - -#------------------------------------------------------------------------------ -# MAKEFILE UP TO DATE? -# -# Is this very Makefile up to date? Someone may have changed the BSP settings -# file or the associated target hardware. -#------------------------------------------------------------------------------ -# Skip this check when clean is the only target -ifneq ($(MAKECMDGOALS),clean) - -ifneq ($(wildcard $(SETTINGS_FILE)),$(SETTINGS_FILE)) -$(warning Warning: BSP Settings File $(SETTINGS_FILE) could not be found.) -endif - -Makefile: $(wildcard $(SETTINGS_FILE)) - @$(ECHO) Makefile not up to date. - @$(ECHO) $(SETTINGS_FILE) has been modified since the BSP Makefile was generated. - @$(ECHO) - @$(ECHO) Generate the BSP to update the Makefile, and then build again. - @$(ECHO) - @$(ECHO) To generate from Eclipse: - @$(ECHO) " 1. Right-click the BSP project." - @$(ECHO) " 2. In the Nios II Menu, click Generate BSP." - @$(ECHO) - @$(ECHO) To generate from the command line: - @$(ECHO) " nios2-bsp-generate-files --settings= --bsp-dir=" - @$(ECHO) - @exit 1 - -ifneq ($(wildcard $(SOPC_FILE)),$(SOPC_FILE)) -$(warning Warning: SOPC File $(SOPC_FILE) could not be found.) -endif - -public.mk: $(wildcard $(SOPC_FILE)) - @$(ECHO) Makefile not up to date. - @$(ECHO) $(SOPC_FILE) has been modified since the BSP was generated. - @$(ECHO) - @$(ECHO) Generate the BSP to update the Makefile, and then build again. - @$(ECHO) - @$(ECHO) To generate from Eclipse: - @$(ECHO) " 1. Right-click the BSP project." - @$(ECHO) " 2. In the Nios II Menu, click Generate BSP." - @$(ECHO) - @$(ECHO) To generate from the command line: - @$(ECHO) " nios2-bsp-generate-files --settings= --bsp-dir=" - @$(ECHO) - @exit 1 - -endif # $(MAKECMDGOALS) != clean - -#------------------------------------------------------------------------------ -# PATTERN RULES TO BUILD OBJECTS -#------------------------------------------------------------------------------ -$(OBJ_DIR)/%.o: %.c - @$(ECHO) Compiling $( - -/* - * Device headers - */ - -#include "altera_nios2_qsys_irq.h" -#include "altera_avalon_jtag_uart.h" - -/* - * Allocate the device storage - */ - -ALTERA_NIOS2_QSYS_IRQ_INSTANCE ( NIOS2_PROCESSOR, nios2_processor); -ALTERA_AVALON_JTAG_UART_INSTANCE ( JTAG_UART, jtag_uart); - -/* - * Initialize the interrupt controller devices - * and then enable interrupts in the CPU. - * Called before alt_sys_init(). - * The "base" parameter is ignored and only - * present for backwards-compatibility. - */ - -void alt_irq_init ( const void* base ) -{ - ALTERA_NIOS2_QSYS_IRQ_INIT ( NIOS2_PROCESSOR, nios2_processor); - alt_irq_cpu_enable_interrupts(); -} - -/* - * Initialize the non-interrupt controller devices. - * Called after alt_irq_init(). - */ - -void alt_sys_init( void ) -{ - ALTERA_AVALON_JTAG_UART_INIT ( JTAG_UART, jtag_uart); -} diff --git a/software/qsys_tutorial_switchs18_bsp/create-this-bsp b/software/qsys_tutorial_switchs18_bsp/create-this-bsp deleted file mode 100644 index 49e6175..0000000 --- a/software/qsys_tutorial_switchs18_bsp/create-this-bsp +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/bash -# -# This script creates the ucosii_net_zipfs Board Support Package (BSP). - -BSP_TYPE=hal -BSP_DIR=. -SOPC_DIR=../../ -SOPC_FILE=C:/Users/takayun/Documents/DE2-115/qsys_tutorial/nios_system.sopcinfo -NIOS2_BSP_ARGS="--set hal.max_file_descriptors 4 --set hal.enable_small_c_library true --set hal.sys_clk_timer none --set hal.timestamp_timer none --set hal.enable_exit false --set hal.enable_c_plus_plus false --set hal.enable_lightweight_device_driver_api true --set hal.enable_clean_exit false --set hal.enable_sim_optimize false --set hal.enable_reduced_device_drivers true --set hal.make.bsp_cflags_optimization '-Os'" -CPU_NAME= - - -# Don't run make if create-this-app script is called with --no-make arg -SKIP_MAKE= -while [ $# -gt 0 ] -do - case "$1" in - --no-make) - SKIP_MAKE=1 - ;; - *) - NIOS2_BSP_ARGS="$NIOS2_BSP_ARGS $1" - ;; - esac - shift -done - - -# Run nios2-bsp utility to create a hal BSP in this directory -# for the system with a .sopc file in $SOPC_FILE. -# Deprecating $SOPC_DIR in 10.1. Multiple .sopcinfo files in a directory may exist. - -if [ -z "$SOPC_FILE" ]; then - echo "WARNING: Use of a directory for locating a .sopcinfo file is deprecated in 10.1. Multiple .sopcinfo files may exist. You must specify the full .sopcinfo path." - cmd="nios2-bsp $BSP_TYPE $BSP_DIR $SOPC_DIR $NIOS2_BSP_ARGS $CPU_NAME" -else - cmd="nios2-bsp $BSP_TYPE $BSP_DIR $SOPC_FILE $NIOS2_BSP_ARGS $CPU_NAME" -fi - - -echo "create-this-bsp: Running \"$cmd\"" -$cmd || { - echo "$cmd failed" - exit 1 -} -if [ -z "$SKIP_MAKE" ]; then - echo "create-this-bsp: Running make" - make -fi diff --git a/software/qsys_tutorial_switchs18_bsp/drivers/inc/altera_avalon_jtag_uart.h b/software/qsys_tutorial_switchs18_bsp/drivers/inc/altera_avalon_jtag_uart.h deleted file mode 100644 index 95d4a99..0000000 --- a/software/qsys_tutorial_switchs18_bsp/drivers/inc/altera_avalon_jtag_uart.h +++ /dev/null @@ -1,198 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#ifndef __ALT_AVALON_JTAG_UART_H__ -#define __ALT_AVALON_JTAG_UART_H__ - -#include - -#include "sys/alt_alarm.h" -#include "sys/alt_warning.h" - -#include "os/alt_sem.h" -#include "os/alt_flag.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * If the user wants all drivers to be small rather than fast then make sure - * this one is marked as needing to be small. - */ -#if defined ALT_USE_SMALL_DRIVERS && !defined ALTERA_AVALON_JTAG_UART_SMALL -#define ALTERA_AVALON_JTAG_UART_SMALL -#endif - -/* - * If the user wants to ignore FIFO full error after timeout - */ -#if defined ALT_JTAG_UART_IGNORE_FIFO_FULL_ERROR && !defined ALTERA_AVALON_JTAG_UART_IGNORE_FIFO_FULL_ERROR -#define ALTERA_AVALON_JTAG_UART_IGNORE_FIFO_FULL_ERROR -#endif - -/* - * Constants that can be overriden. - */ -#ifndef ALTERA_AVALON_JTAG_UART_DEFAULT_TIMEOUT -#define ALTERA_AVALON_JTAG_UART_DEFAULT_TIMEOUT 10 -#endif - -#ifndef ALTERA_AVALON_JTAG_UART_BUF_LEN -#define ALTERA_AVALON_JTAG_UART_BUF_LEN 2048 -#endif - -/* - * ALT_JTAG_UART_READ_RDY and ALT_JTAG_UART_WRITE_RDY are the bitmasks - * that define uC/OS-II event flags that are releated to this device. - * - * ALT_JTAG_UART_READ_RDY indicates that there is read data in the buffer - * ready to be processed. ALT_JTAG_UART_WRITE_RDY indicates that the transmitter is - * ready for more data. - */ -#define ALT_JTAG_UART_READ_RDY 0x1 -#define ALT_JTAG_UART_WRITE_RDY 0x2 -#define ALT_JTAG_UART_TIMEOUT 0x4 - -/* - * State structure definition. Each instance of the driver uses one - * of these structures to hold its associated state. - */ - -typedef struct altera_avalon_jtag_uart_state_s -{ - unsigned int base; - -#ifndef ALTERA_AVALON_JTAG_UART_SMALL - - unsigned int timeout; /* Timeout until host is assumed inactive */ - alt_alarm alarm; - unsigned int irq_enable; - unsigned int host_inactive; - - ALT_SEM (read_lock) - ALT_SEM (write_lock) - ALT_FLAG_GRP (events) - - /* The variables below are volatile because they are modified by the - * interrupt routine. Making them volatile and reading them atomically - * means that we don't need any large critical sections. - */ - volatile unsigned int rx_in; - unsigned int rx_out; - unsigned int tx_in; - volatile unsigned int tx_out; - char rx_buf[ALTERA_AVALON_JTAG_UART_BUF_LEN]; - char tx_buf[ALTERA_AVALON_JTAG_UART_BUF_LEN]; - -#endif /* !ALTERA_AVALON_JTAG_UART_SMALL */ - -} altera_avalon_jtag_uart_state; - -/* - * Macros used by alt_sys_init when the ALT file descriptor facility isn't used. - */ - -#ifdef ALTERA_AVALON_JTAG_UART_SMALL - -#define ALTERA_AVALON_JTAG_UART_STATE_INSTANCE(name, state) \ - altera_avalon_jtag_uart_state state = \ - { \ - name##_BASE, \ - } - -#define ALTERA_AVALON_JTAG_UART_STATE_INIT(name, state) - -#else /* !ALTERA_AVALON_JTAG_UART_SMALL */ - -#define ALTERA_AVALON_JTAG_UART_STATE_INSTANCE(name, state) \ - altera_avalon_jtag_uart_state state = \ - { \ - name##_BASE, \ - ALTERA_AVALON_JTAG_UART_DEFAULT_TIMEOUT, \ - } - -/* - * Externally referenced routines - */ -extern void altera_avalon_jtag_uart_init(altera_avalon_jtag_uart_state* sp, - int irq_controller_id, int irq); - -#define ALTERA_AVALON_JTAG_UART_STATE_INIT(name, state) \ - { \ - if (name##_IRQ == ALT_IRQ_NOT_CONNECTED) \ - { \ - ALT_LINK_ERROR ("Error: Interrupt not connected for " #name ". " \ - "You have selected the interrupt driven version of " \ - "the ALTERA Avalon JTAG UART driver, but the " \ - "interrupt is not connected for this device. You can " \ - "select a polled mode driver by checking the 'small " \ - "driver' option in the HAL configuration window, or " \ - "by using the -DALTERA_AVALON_JTAG_UART_SMALL " \ - "preprocessor flag."); \ - } \ - else \ - altera_avalon_jtag_uart_init(&state, \ - name##_IRQ_INTERRUPT_CONTROLLER_ID, \ - name##_IRQ); \ - } - -#endif /* ALTERA_AVALON_JTAG_UART_SMALL */ - -/* - * Include in case non-direct version of driver required. - */ -#include "altera_avalon_jtag_uart_fd.h" - -/* - * Map alt_sys_init macros to direct or non-direct versions. - */ -#ifdef ALT_USE_DIRECT_DRIVERS - -#define ALTERA_AVALON_JTAG_UART_INSTANCE(name, state) \ - ALTERA_AVALON_JTAG_UART_STATE_INSTANCE(name, state) -#define ALTERA_AVALON_JTAG_UART_INIT(name, state) \ - ALTERA_AVALON_JTAG_UART_STATE_INIT(name, state) - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -#define ALTERA_AVALON_JTAG_UART_INSTANCE(name, dev) \ - ALTERA_AVALON_JTAG_UART_DEV_INSTANCE(name, dev) -#define ALTERA_AVALON_JTAG_UART_INIT(name, dev) \ - ALTERA_AVALON_JTAG_UART_DEV_INIT(name, dev) - -#endif /* ALT_USE_DIRECT_DRIVERS */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_AVALON_JTAG_UART_H__ */ diff --git a/software/qsys_tutorial_switchs18_bsp/drivers/inc/altera_avalon_jtag_uart_fd.h b/software/qsys_tutorial_switchs18_bsp/drivers/inc/altera_avalon_jtag_uart_fd.h deleted file mode 100644 index b3c3200..0000000 --- a/software/qsys_tutorial_switchs18_bsp/drivers/inc/altera_avalon_jtag_uart_fd.h +++ /dev/null @@ -1,125 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#ifndef __ALT_AVALON_JTAG_UART_FD_H__ -#define __ALT_AVALON_JTAG_UART_FD_H__ - -#include "sys/alt_dev.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * Externally referenced routines - */ -extern int altera_avalon_jtag_uart_read_fd (alt_fd* fd, char* ptr, int len); -extern int altera_avalon_jtag_uart_write_fd (alt_fd* fd, const char* ptr, - int len); - -/* - * Device structure definition. This is needed by alt_sys_init in order to - * reserve memory for the device instance. - */ - -typedef struct altera_avalon_jtag_uart_dev_s -{ - alt_dev dev; - altera_avalon_jtag_uart_state state; -} altera_avalon_jtag_uart_dev; - -/* - * Macros used by alt_sys_init when the ALT file descriptor facility is used. - */ - -#ifdef ALTERA_AVALON_JTAG_UART_SMALL - -#define ALTERA_AVALON_JTAG_UART_DEV_INSTANCE(name, d) \ - static altera_avalon_jtag_uart_dev d = \ - { \ - { \ - ALT_LLIST_ENTRY, \ - name##_NAME, \ - NULL, /* open */ \ - NULL, /* close */ \ - altera_avalon_jtag_uart_read_fd, \ - altera_avalon_jtag_uart_write_fd, \ - NULL, /* lseek */ \ - NULL, /* fstat */ \ - NULL, /* ioctl */ \ - }, \ - { \ - name##_BASE, \ - } \ - } - -#define ALTERA_AVALON_JTAG_UART_DEV_INIT(name, d) alt_dev_reg (&d.dev) - -#else /* !ALTERA_AVALON_JTAG_UART_SMALL */ - -extern int altera_avalon_jtag_uart_close_fd(alt_fd* fd); -extern int altera_avalon_jtag_uart_ioctl_fd (alt_fd* fd, int req, void* arg); - -#define ALTERA_AVALON_JTAG_UART_DEV_INSTANCE(name, d) \ - static altera_avalon_jtag_uart_dev d = \ - { \ - { \ - ALT_LLIST_ENTRY, \ - name##_NAME, \ - NULL, /* open */ \ - altera_avalon_jtag_uart_close_fd, \ - altera_avalon_jtag_uart_read_fd, \ - altera_avalon_jtag_uart_write_fd, \ - NULL, /* lseek */ \ - NULL, /* fstat */ \ - altera_avalon_jtag_uart_ioctl_fd, \ - }, \ - { \ - name##_BASE, \ - ALTERA_AVALON_JTAG_UART_DEFAULT_TIMEOUT, \ - } \ - } - -#define ALTERA_AVALON_JTAG_UART_DEV_INIT(name, d) \ - { \ - ALTERA_AVALON_JTAG_UART_STATE_INIT(name, d.state); \ - \ - /* make the device available to the system */ \ - alt_dev_reg(&d.dev); \ - } - -#endif /* ALTERA_AVALON_JTAG_UART_SMALL */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_AVALON_JTAG_UART_FD_H__ */ diff --git a/software/qsys_tutorial_switchs18_bsp/drivers/inc/altera_avalon_jtag_uart_regs.h b/software/qsys_tutorial_switchs18_bsp/drivers/inc/altera_avalon_jtag_uart_regs.h deleted file mode 100644 index 7f97160..0000000 --- a/software/qsys_tutorial_switchs18_bsp/drivers/inc/altera_avalon_jtag_uart_regs.h +++ /dev/null @@ -1,73 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#ifndef __ALTERA_AVALON_JTAG_UART_REGS_H__ -#define __ALTERA_AVALON_JTAG_UART_REGS_H__ - -#include - -#define ALTERA_AVALON_JTAG_UART_DATA_REG 0 -#define IOADDR_ALTERA_AVALON_JTAG_UART_DATA(base) \ - __IO_CALC_ADDRESS_NATIVE(base, ALTERA_AVALON_JTAG_UART_DATA_REG) -#define IORD_ALTERA_AVALON_JTAG_UART_DATA(base) \ - IORD(base, ALTERA_AVALON_JTAG_UART_DATA_REG) -#define IOWR_ALTERA_AVALON_JTAG_UART_DATA(base, data) \ - IOWR(base, ALTERA_AVALON_JTAG_UART_DATA_REG, data) - -#define ALTERA_AVALON_JTAG_UART_DATA_DATA_MSK (0x000000FF) -#define ALTERA_AVALON_JTAG_UART_DATA_DATA_OFST (0) -#define ALTERA_AVALON_JTAG_UART_DATA_RVALID_MSK (0x00008000) -#define ALTERA_AVALON_JTAG_UART_DATA_RVALID_OFST (15) -#define ALTERA_AVALON_JTAG_UART_DATA_RAVAIL_MSK (0xFFFF0000) -#define ALTERA_AVALON_JTAG_UART_DATA_RAVAIL_OFST (16) - - -#define ALTERA_AVALON_JTAG_UART_CONTROL_REG 1 -#define IOADDR_ALTERA_AVALON_JTAG_UART_CONTROL(base) \ - __IO_CALC_ADDRESS_NATIVE(base, ALTERA_AVALON_JTAG_UART_CONTROL_REG) -#define IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base) \ - IORD(base, ALTERA_AVALON_JTAG_UART_CONTROL_REG) -#define IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(base, data) \ - IOWR(base, ALTERA_AVALON_JTAG_UART_CONTROL_REG, data) - -#define ALTERA_AVALON_JTAG_UART_CONTROL_RE_MSK (0x00000001) -#define ALTERA_AVALON_JTAG_UART_CONTROL_RE_OFST (0) -#define ALTERA_AVALON_JTAG_UART_CONTROL_WE_MSK (0x00000002) -#define ALTERA_AVALON_JTAG_UART_CONTROL_WE_OFST (1) -#define ALTERA_AVALON_JTAG_UART_CONTROL_RI_MSK (0x00000100) -#define ALTERA_AVALON_JTAG_UART_CONTROL_RI_OFST (8) -#define ALTERA_AVALON_JTAG_UART_CONTROL_WI_MSK (0x00000200) -#define ALTERA_AVALON_JTAG_UART_CONTROL_WI_OFST (9) -#define ALTERA_AVALON_JTAG_UART_CONTROL_AC_MSK (0x00000400) -#define ALTERA_AVALON_JTAG_UART_CONTROL_AC_OFST (10) -#define ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_MSK (0xFFFF0000) -#define ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_OFST (16) - -#endif /* __ALTERA_AVALON_JTAG_UART_REGS_H__ */ diff --git a/software/qsys_tutorial_switchs18_bsp/drivers/inc/altera_avalon_pio_regs.h b/software/qsys_tutorial_switchs18_bsp/drivers/inc/altera_avalon_pio_regs.h deleted file mode 100644 index 052439f..0000000 --- a/software/qsys_tutorial_switchs18_bsp/drivers/inc/altera_avalon_pio_regs.h +++ /dev/null @@ -1,67 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#ifndef __ALTERA_AVALON_PIO_REGS_H__ -#define __ALTERA_AVALON_PIO_REGS_H__ - -#include - -#define IOADDR_ALTERA_AVALON_PIO_DATA(base) __IO_CALC_ADDRESS_NATIVE(base, 0) -#define IORD_ALTERA_AVALON_PIO_DATA(base) IORD(base, 0) -#define IOWR_ALTERA_AVALON_PIO_DATA(base, data) IOWR(base, 0, data) - -#define IOADDR_ALTERA_AVALON_PIO_DIRECTION(base) __IO_CALC_ADDRESS_NATIVE(base, 1) -#define IORD_ALTERA_AVALON_PIO_DIRECTION(base) IORD(base, 1) -#define IOWR_ALTERA_AVALON_PIO_DIRECTION(base, data) IOWR(base, 1, data) - -#define IOADDR_ALTERA_AVALON_PIO_IRQ_MASK(base) __IO_CALC_ADDRESS_NATIVE(base, 2) -#define IORD_ALTERA_AVALON_PIO_IRQ_MASK(base) IORD(base, 2) -#define IOWR_ALTERA_AVALON_PIO_IRQ_MASK(base, data) IOWR(base, 2, data) - -#define IOADDR_ALTERA_AVALON_PIO_EDGE_CAP(base) __IO_CALC_ADDRESS_NATIVE(base, 3) -#define IORD_ALTERA_AVALON_PIO_EDGE_CAP(base) IORD(base, 3) -#define IOWR_ALTERA_AVALON_PIO_EDGE_CAP(base, data) IOWR(base, 3, data) - - -#define IOADDR_ALTERA_AVALON_PIO_SET_BIT(base) __IO_CALC_ADDRESS_NATIVE(base, 4) -#define IORD_ALTERA_AVALON_PIO_SET_BITS(base) IORD(base, 4) -#define IOWR_ALTERA_AVALON_PIO_SET_BITS(base, data) IOWR(base, 4, data) - -#define IOADDR_ALTERA_AVALON_PIO_CLEAR_BITS(base) __IO_CALC_ADDRESS_NATIVE(base, 5) -#define IORD_ALTERA_AVALON_PIO_CLEAR_BITS(base) IORD(base, 5) -#define IOWR_ALTERA_AVALON_PIO_CLEAR_BITS(base, data) IOWR(base, 5, data) - - - -/* Defintions for direction-register operation with bi-directional PIOs */ -#define ALTERA_AVALON_PIO_DIRECTION_INPUT 0 -#define ALTERA_AVALON_PIO_DIRECTION_OUTPUT 1 - -#endif /* __ALTERA_AVALON_PIO_REGS_H__ */ diff --git a/software/qsys_tutorial_switchs18_bsp/drivers/src/altera_avalon_jtag_uart_fd.c b/software/qsys_tutorial_switchs18_bsp/drivers/src/altera_avalon_jtag_uart_fd.c deleted file mode 100644 index 53dfc3b..0000000 --- a/software/qsys_tutorial_switchs18_bsp/drivers/src/altera_avalon_jtag_uart_fd.c +++ /dev/null @@ -1,86 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "alt_types.h" -#include "sys/alt_dev.h" -#include "altera_avalon_jtag_uart.h" - -extern int altera_avalon_jtag_uart_read(altera_avalon_jtag_uart_state* sp, - char* buffer, int space, int flags); -extern int altera_avalon_jtag_uart_write(altera_avalon_jtag_uart_state* sp, - const char* ptr, int count, int flags); -extern int altera_avalon_jtag_uart_ioctl(altera_avalon_jtag_uart_state* sp, - int req, void* arg); -extern int altera_avalon_jtag_uart_close(altera_avalon_jtag_uart_state* sp, - int flags); - -/* ----------------------------------------------------------------------- */ -/* --------------------- WRAPPERS FOR ALT FD SUPPORT --------------------- */ -/* - * - */ - -int -altera_avalon_jtag_uart_read_fd(alt_fd* fd, char* buffer, int space) -{ - altera_avalon_jtag_uart_dev* dev = (altera_avalon_jtag_uart_dev*) fd->dev; - - return altera_avalon_jtag_uart_read(&dev->state, buffer, space, - fd->fd_flags); -} - -int -altera_avalon_jtag_uart_write_fd(alt_fd* fd, const char* buffer, int space) -{ - altera_avalon_jtag_uart_dev* dev = (altera_avalon_jtag_uart_dev*) fd->dev; - - return altera_avalon_jtag_uart_write(&dev->state, buffer, space, - fd->fd_flags); -} - -#ifndef ALTERA_AVALON_JTAG_UART_SMALL - -int -altera_avalon_jtag_uart_close_fd(alt_fd* fd) -{ - altera_avalon_jtag_uart_dev* dev = (altera_avalon_jtag_uart_dev*) fd->dev; - - return altera_avalon_jtag_uart_close(&dev->state, fd->fd_flags); -} - -int -altera_avalon_jtag_uart_ioctl_fd(alt_fd* fd, int req, void* arg) -{ - altera_avalon_jtag_uart_dev* dev = (altera_avalon_jtag_uart_dev*) fd->dev; - - return altera_avalon_jtag_uart_ioctl(&dev->state, req, arg); -} - -#endif /* ALTERA_AVALON_JTAG_UART_SMALL */ diff --git a/software/qsys_tutorial_switchs18_bsp/drivers/src/altera_avalon_jtag_uart_init.c b/software/qsys_tutorial_switchs18_bsp/drivers/src/altera_avalon_jtag_uart_init.c deleted file mode 100644 index 7317bec..0000000 --- a/software/qsys_tutorial_switchs18_bsp/drivers/src/altera_avalon_jtag_uart_init.c +++ /dev/null @@ -1,256 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include -#include -#include -#include - -#include - -#include "sys/alt_irq.h" -#include "sys/alt_alarm.h" -#include "sys/ioctl.h" -#include "alt_types.h" - -#include "altera_avalon_jtag_uart_regs.h" -#include "altera_avalon_jtag_uart.h" - -#include "sys/alt_log_printf.h" - -#ifndef ALTERA_AVALON_JTAG_UART_SMALL - -/* ----------------------------------------------------------- */ -/* ------------------------- FAST DRIVER --------------------- */ -/* ----------------------------------------------------------- */ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT -static void altera_avalon_jtag_uart_irq(void* context); -#else -static void altera_avalon_jtag_uart_irq(void* context, alt_u32 id); -#endif -static alt_u32 altera_avalon_jtag_uart_timeout(void* context); - -/* - * Driver initialization code. Register interrupts and start a timer - * which we can use to check whether the host is there. - * Return 1 on sucessful IRQ register and 0 on failure. - */ - -void altera_avalon_jtag_uart_init(altera_avalon_jtag_uart_state* sp, - int irq_controller_id, int irq) -{ - ALT_FLAG_CREATE(&sp->events, 0); - ALT_SEM_CREATE(&sp->read_lock, 1); - ALT_SEM_CREATE(&sp->write_lock, 1); - - /* enable read interrupts at the device */ - sp->irq_enable = ALTERA_AVALON_JTAG_UART_CONTROL_RE_MSK; - - IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base, sp->irq_enable); - - /* register the interrupt handler */ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - alt_ic_isr_register(irq_controller_id, irq, altera_avalon_jtag_uart_irq, - sp, NULL); -#else - alt_irq_register(irq, sp, altera_avalon_jtag_uart_irq); -#endif - - /* Register an alarm to go off every second to check for presence of host */ - sp->host_inactive = 0; - - if (alt_alarm_start(&sp->alarm, alt_ticks_per_second(), - &altera_avalon_jtag_uart_timeout, sp) < 0) - { - /* If we can't set the alarm then record "don't know if host present" - * and behave as though the host is present. - */ - sp->timeout = INT_MAX; - } - - /* ALT_LOG - see altera_hal/HAL/inc/sys/alt_log_printf.h */ - ALT_LOG_JTAG_UART_ALARM_REGISTER(sp, sp->base); -} - -/* - * Interrupt routine - */ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT -static void altera_avalon_jtag_uart_irq(void* context) -#else -static void altera_avalon_jtag_uart_irq(void* context, alt_u32 id) -#endif -{ - altera_avalon_jtag_uart_state* sp = (altera_avalon_jtag_uart_state*) context; - unsigned int base = sp->base; - - /* ALT_LOG - see altera_hal/HAL/inc/sys/alt_log_printf.h */ - ALT_LOG_JTAG_UART_ISR_FUNCTION(base, sp); - - for ( ; ; ) - { - unsigned int control = IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base); - - /* Return once nothing more to do */ - if ((control & (ALTERA_AVALON_JTAG_UART_CONTROL_RI_MSK | ALTERA_AVALON_JTAG_UART_CONTROL_WI_MSK)) == 0) - break; - - if (control & ALTERA_AVALON_JTAG_UART_CONTROL_RI_MSK) - { - /* process a read irq. Start by assuming that there is data in the - * receive FIFO (otherwise why would we have been interrupted?) - */ - unsigned int data = 1 << ALTERA_AVALON_JTAG_UART_DATA_RAVAIL_OFST; - - for ( ; ; ) - { - /* Check whether there is space in the buffer. If not then we must not - * read any characters from the buffer as they will be lost. - */ - unsigned int next = (sp->rx_in + 1) % ALTERA_AVALON_JTAG_UART_BUF_LEN; - if (next == sp->rx_out) - break; - - /* Try to remove a character from the FIFO and find out whether there - * are any more characters remaining. - */ - data = IORD_ALTERA_AVALON_JTAG_UART_DATA(base); - - if ((data & ALTERA_AVALON_JTAG_UART_DATA_RVALID_MSK) == 0) - break; - - sp->rx_buf[sp->rx_in] = (data & ALTERA_AVALON_JTAG_UART_DATA_DATA_MSK) >> ALTERA_AVALON_JTAG_UART_DATA_DATA_OFST; - sp->rx_in = (sp->rx_in + 1) % ALTERA_AVALON_JTAG_UART_BUF_LEN; - - /* Post an event to notify jtag_uart_read that a character has been read */ - ALT_FLAG_POST (sp->events, ALT_JTAG_UART_READ_RDY, OS_FLAG_SET); - } - - if (data & ALTERA_AVALON_JTAG_UART_DATA_RAVAIL_MSK) - { - /* If there is still data available here then the buffer is full - * so turn off receive interrupts until some space becomes available. - */ - sp->irq_enable &= ~ALTERA_AVALON_JTAG_UART_CONTROL_RE_MSK; - IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(base, sp->irq_enable); - - /* Dummy read to ensure IRQ is cleared prior to ISR completion */ - IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base); - } - } - - if (control & ALTERA_AVALON_JTAG_UART_CONTROL_WI_MSK) - { - /* process a write irq */ - unsigned int space = (control & ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_MSK) >> ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_OFST; - - while (space > 0 && sp->tx_out != sp->tx_in) - { - IOWR_ALTERA_AVALON_JTAG_UART_DATA(base, sp->tx_buf[sp->tx_out]); - - sp->tx_out = (sp->tx_out + 1) % ALTERA_AVALON_JTAG_UART_BUF_LEN; - - /* Post an event to notify jtag_uart_write that a character has been written */ - ALT_FLAG_POST (sp->events, ALT_JTAG_UART_WRITE_RDY, OS_FLAG_SET); - - space--; - } - - if (space > 0) - { - /* If we don't have any more data available then turn off the TX interrupt */ - sp->irq_enable &= ~ALTERA_AVALON_JTAG_UART_CONTROL_WE_MSK; - IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base, sp->irq_enable); - - /* Dummy read to ensure IRQ is cleared prior to ISR completion */ - IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base); - } - } - } -} - -/* - * Timeout routine is called every second - */ - -static alt_u32 -altera_avalon_jtag_uart_timeout(void* context) -{ - altera_avalon_jtag_uart_state* sp = (altera_avalon_jtag_uart_state *) context; - - unsigned int control = IORD_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base); - - if (control & ALTERA_AVALON_JTAG_UART_CONTROL_AC_MSK) - { - IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base, sp->irq_enable | ALTERA_AVALON_JTAG_UART_CONTROL_AC_MSK); - sp->host_inactive = 0; - } - else if (sp->host_inactive < INT_MAX - 2) { - sp->host_inactive++; - - if (sp->host_inactive >= sp->timeout) { - /* Post an event to indicate host is inactive (for jtag_uart_read */ - ALT_FLAG_POST (sp->events, ALT_JTAG_UART_TIMEOUT, OS_FLAG_SET); - } - } - - return alt_ticks_per_second(); -} - -/* - * The close() routine is implemented to drain the JTAG UART transmit buffer - * when not in "small" mode. This routine will wait for transimt data to be - * emptied unless a timeout from host-activity occurs. If the driver flags - * have been set to non-blocking mode, this routine will exit immediately if - * any data remains. This routine should be called indirectly (i.e. though - * the C library close() routine) so that the file descriptor associated - * with the relevant stream (i.e. stdout) can be closed as well. This routine - * does not manage file descriptors. - * - * The close routine is not implemented for the small driver; instead it will - * map to null. This is because the small driver simply waits while characters - * are transmitted; there is no interrupt-serviced buffer to empty - */ -int altera_avalon_jtag_uart_close(altera_avalon_jtag_uart_state* sp, int flags) -{ - /* - * Wait for all transmit data to be emptied by the JTAG UART ISR, or - * for a host-inactivity timeout, in which case transmit data will be lost - */ - while ( (sp->tx_out != sp->tx_in) && (sp->host_inactive < sp->timeout) ) { - if (flags & O_NONBLOCK) { - return -EWOULDBLOCK; - } - } - - return 0; -} - -#endif /* !ALTERA_AVALON_JTAG_UART_SMALL */ diff --git a/software/qsys_tutorial_switchs18_bsp/drivers/src/altera_avalon_jtag_uart_ioctl.c b/software/qsys_tutorial_switchs18_bsp/drivers/src/altera_avalon_jtag_uart_ioctl.c deleted file mode 100644 index cf71e6f..0000000 --- a/software/qsys_tutorial_switchs18_bsp/drivers/src/altera_avalon_jtag_uart_ioctl.c +++ /dev/null @@ -1,86 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include -#include -#include -#include - -#include - -#include "sys/ioctl.h" -#include "alt_types.h" - -#include "altera_avalon_jtag_uart_regs.h" -#include "altera_avalon_jtag_uart.h" - -#include "sys/alt_log_printf.h" - -#ifndef ALTERA_AVALON_JTAG_UART_SMALL - -/* ----------------------------------------------------------- */ -/* ------------------------- FAST DRIVER --------------------- */ -/* ----------------------------------------------------------- */ - -int -altera_avalon_jtag_uart_ioctl(altera_avalon_jtag_uart_state* sp, int req, - void* arg) -{ - int rc = -ENOTTY; - - switch (req) - { - case TIOCSTIMEOUT: - /* Set the time to wait until assuming host is not connected */ - if (sp->timeout != INT_MAX) - { - int timeout = *((int *)arg); - sp->timeout = (timeout >= 2 && timeout < INT_MAX) ? timeout : INT_MAX - 1; - rc = 0; - } - break; - - case TIOCGCONNECTED: - /* Find out whether host is connected */ - if (sp->timeout != INT_MAX) - { - *((int *)arg) = (sp->host_inactive < sp->timeout) ? 1 : 0; - rc = 0; - } - break; - - default: - break; - } - - return rc; -} - -#endif /* !ALTERA_AVALON_JTAG_UART_SMALL */ diff --git a/software/qsys_tutorial_switchs18_bsp/drivers/src/altera_avalon_jtag_uart_read.c b/software/qsys_tutorial_switchs18_bsp/drivers/src/altera_avalon_jtag_uart_read.c deleted file mode 100644 index 5657adb..0000000 --- a/software/qsys_tutorial_switchs18_bsp/drivers/src/altera_avalon_jtag_uart_read.c +++ /dev/null @@ -1,205 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include -#include -#include -#include - -#include - -#include "sys/alt_irq.h" -#include "sys/alt_alarm.h" -#include "sys/ioctl.h" -#include "alt_types.h" - -#include "altera_avalon_jtag_uart_regs.h" -#include "altera_avalon_jtag_uart.h" - -#include "sys/alt_log_printf.h" - -#ifdef __ucosii__ -#include "includes.h" -#endif /* __ucosii__ */ - -#ifdef ALTERA_AVALON_JTAG_UART_SMALL - -/* ----------------------------------------------------------- */ -/* ----------------------- SMALL DRIVER ---------------------- */ -/* ----------------------------------------------------------- */ - -/* Read routine. The small version blocks until it has at least one byte - * available, it then returns as much as is immediately available without - * waiting any more. It's performance will be very poor without - * interrupts. - */ - -int -altera_avalon_jtag_uart_read(altera_avalon_jtag_uart_state* sp, - char* buffer, int space, int flags) -{ - unsigned int base = sp->base; - - char * ptr = buffer; - char * end = buffer + space; - - while (ptr < end) - { - unsigned int data = IORD_ALTERA_AVALON_JTAG_UART_DATA(base); - - if (data & ALTERA_AVALON_JTAG_UART_DATA_RVALID_MSK) - *ptr++ = (data & ALTERA_AVALON_JTAG_UART_DATA_DATA_MSK) >> ALTERA_AVALON_JTAG_UART_DATA_DATA_OFST; - else if (ptr != buffer) - break; - else if(flags & O_NONBLOCK) - break; - - } - - if (ptr != buffer) - return ptr - buffer; - else if (flags & O_NONBLOCK) - return -EWOULDBLOCK; - else - return -EIO; -} - -#else /* !ALTERA_AVALON_JTAG_UART_SMALL */ - -/* ----------------------------------------------------------- */ -/* ----------------------- FAST DRIVER ----------------------- */ -/* ----------------------------------------------------------- */ - -int -altera_avalon_jtag_uart_read(altera_avalon_jtag_uart_state* sp, - char * buffer, int space, int flags) -{ - char * ptr = buffer; - - alt_irq_context context; - unsigned int n; - - /* - * When running in a multi threaded environment, obtain the "read_lock" - * semaphore. This ensures that reading from the device is thread-safe. - */ - ALT_SEM_PEND (sp->read_lock, 0); - - while (space > 0) - { - unsigned int in, out; - - /* Read as much data as possible */ - do - { - in = sp->rx_in; - out = sp->rx_out; - - if (in >= out) - n = in - out; - else - n = ALTERA_AVALON_JTAG_UART_BUF_LEN - out; - - if (n == 0) - break; /* No more data available */ - - if (n > space) - n = space; - - memcpy(ptr, sp->rx_buf + out, n); - ptr += n; - space -= n; - - sp->rx_out = (out + n) % ALTERA_AVALON_JTAG_UART_BUF_LEN; - } - while (space > 0); - - /* If we read any data then return it */ - if (ptr != buffer) - break; - - /* If in non-blocking mode then return error */ - if (flags & O_NONBLOCK) - break; - -#ifdef __ucosii__ - /* OS Present: Pend on a flag if the OS is running, otherwise spin */ - if(OSRunning == OS_TRUE) { - /* - * When running in a multi-threaded mode, we pend on the read event - * flag set and timeout event flag set in the isr. This avoids wasting CPU - * cycles waiting in this thread, when we could be doing something more - * profitable elsewhere. - */ - ALT_FLAG_PEND (sp->events, - ALT_JTAG_UART_READ_RDY | ALT_JTAG_UART_TIMEOUT, - OS_FLAG_WAIT_SET_ANY + OS_FLAG_CONSUME, - 0); - } - else { - /* Spin until more data arrives or until host disconnects */ - while (in == sp->rx_in && sp->host_inactive < sp->timeout) - ; - } -#else - /* No OS: Always spin */ - while (in == sp->rx_in && sp->host_inactive < sp->timeout) - ; -#endif /* __ucosii__ */ - - if (in == sp->rx_in) - break; - } - - /* - * Now that access to the circular buffer is complete, release the read - * semaphore so that other threads can access the buffer. - */ - - ALT_SEM_POST (sp->read_lock); - - if (ptr != buffer) - { - /* If we read any data then there is space in the buffer so enable interrupts */ - context = alt_irq_disable_all(); - sp->irq_enable |= ALTERA_AVALON_JTAG_UART_CONTROL_RE_MSK; - IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base, sp->irq_enable); - alt_irq_enable_all(context); - } - - if (ptr != buffer) - return ptr - buffer; - else if (flags & O_NONBLOCK) - return -EWOULDBLOCK; - else - return -EIO; -} - -#endif /* ALTERA_AVALON_JTAG_UART_SMALL */ diff --git a/software/qsys_tutorial_switchs18_bsp/drivers/src/altera_avalon_jtag_uart_write.c b/software/qsys_tutorial_switchs18_bsp/drivers/src/altera_avalon_jtag_uart_write.c deleted file mode 100644 index 11aeca1..0000000 --- a/software/qsys_tutorial_switchs18_bsp/drivers/src/altera_avalon_jtag_uart_write.c +++ /dev/null @@ -1,217 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include -#include -#include -#include - -#include - -#include "sys/alt_irq.h" -#include "sys/alt_alarm.h" -#include "sys/ioctl.h" -#include "alt_types.h" - -#include "altera_avalon_jtag_uart_regs.h" -#include "altera_avalon_jtag_uart.h" - -#include "sys/alt_log_printf.h" - -#ifdef __ucosii__ -#include "includes.h" -#endif /* __ucosii__ */ - -#ifdef ALTERA_AVALON_JTAG_UART_SMALL - -/* ----------------------------------------------------------- */ -/* ------------------------ SMALL DRIVER --------------------- */ -/* ----------------------------------------------------------- */ - -/* Write routine. The small version blocks when there is no space to write - * into, so it's performance will be very bad if you are writing more than - * one FIFOs worth of data. But you said you didn't want to use interrupts :-) - */ - -int altera_avalon_jtag_uart_write(altera_avalon_jtag_uart_state* sp, - const char * ptr, int count, int flags) -{ - unsigned int base = sp->base; - - const char * end = ptr + count; - - while (ptr < end) - if ((IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base) & ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_MSK) != 0) - IOWR_ALTERA_AVALON_JTAG_UART_DATA(base, *ptr++); - - return count; -} - -#else /* !ALTERA_AVALON_JTAG_UART_SMALL */ - -/* ----------------------------------------------------------- */ -/* ------------------------- FAST DRIVER --------------------- */ -/* ----------------------------------------------------------- */ - -int -altera_avalon_jtag_uart_write(altera_avalon_jtag_uart_state* sp, - const char * ptr, int count, int flags) -{ - /* Remove warning at optimisation level 03 by seting out to 0 */ - unsigned int in, out=0; - unsigned int n; - alt_irq_context context; - - const char * start = ptr; - - /* - * When running in a multi threaded environment, obtain the "write_lock" - * semaphore. This ensures that writing to the device is thread-safe. - */ - ALT_SEM_PEND (sp->write_lock, 0); - - do - { - /* Copy as much as we can into the transmit buffer */ - while (count > 0) - { - /* We need a stable value of the out pointer to calculate the space available */ - in = sp->tx_in; - out = sp->tx_out; - - if (in < out) - n = out - 1 - in; - else if (out > 0) - n = ALTERA_AVALON_JTAG_UART_BUF_LEN - in; - else - n = ALTERA_AVALON_JTAG_UART_BUF_LEN - 1 - in; - - if (n == 0) - break; - - if (n > count) - n = count; - - memcpy(sp->tx_buf + in, ptr, n); - ptr += n; - count -= n; - - sp->tx_in = (in + n) % ALTERA_AVALON_JTAG_UART_BUF_LEN; - } - - /* - * If interrupts are disabled then we could transmit here, we only need - * to enable interrupts if there is no space left in the FIFO - * - * For now kick the interrupt routine every time to make it transmit - * the data - */ - context = alt_irq_disable_all(); - sp->irq_enable |= ALTERA_AVALON_JTAG_UART_CONTROL_WE_MSK; - IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base, sp->irq_enable); - alt_irq_enable_all(context); - - /* - * If there is any data left then either return now or block until - * some has been sent - */ - /* consider: test whether there is anything there while doing this and delay for at most 2s. */ - if (count > 0) - { - if (flags & O_NONBLOCK) - break; - -#ifdef __ucosii__ - /* OS Present: Pend on a flag if the OS is running, otherwise spin */ - if(OSRunning == OS_TRUE) { - /* - * When running in a multi-threaded mode, we pend on the write event - * flag set or the timeout flag in the isr. This avoids wasting CPU - * cycles waiting in this thread, when we could be doing something - * more profitable elsewhere. - */ -#ifdef ALTERA_AVALON_JTAG_UART_IGNORE_FIFO_FULL_ERROR - if(!sp->host_inactive) -#endif - ALT_FLAG_PEND (sp->events, - ALT_JTAG_UART_WRITE_RDY | ALT_JTAG_UART_TIMEOUT, - OS_FLAG_WAIT_SET_ANY + OS_FLAG_CONSUME, - 0); - } - else { - /* - * OS not running: Wait for data to be removed from buffer. - * Once the interrupt routine has removed some data then we - * will be able to insert some more. - */ - while (out == sp->tx_out && sp->host_inactive < sp->timeout) - ; - } -#else - /* - * No OS present: Always wait for data to be removed from buffer. Once - * the interrupt routine has removed some data then we will be able to - * insert some more. - */ - while (out == sp->tx_out && sp->host_inactive < sp->timeout) - ; -#endif /* __ucosii__ */ - - if (out == sp->tx_out) - break; - } - } - while (count > 0); - - /* - * Now that access to the circular buffer is complete, release the write - * semaphore so that other threads can access the buffer. - */ - ALT_SEM_POST (sp->write_lock); - - if (ptr != start) - return ptr - start; - else if (flags & O_NONBLOCK) - return -EWOULDBLOCK; -#ifdef ALTERA_AVALON_JTAG_UART_IGNORE_FIFO_FULL_ERROR - else if (sp->host_inactive >= sp->timeout) { - /* - * Reset the software FIFO, hardware FIFO could not be reset. - * Just throw away characters without reporting error. - */ - sp->tx_out = sp->tx_in = 0; - return ptr - start + count; - } -#endif - else - return -EIO; /* Host not connected */ -} - -#endif /* ALTERA_AVALON_JTAG_UART_SMALL */ diff --git a/software/qsys_tutorial_switchs18_bsp/libhal_bsp.a b/software/qsys_tutorial_switchs18_bsp/libhal_bsp.a deleted file mode 100644 index bc7522b..0000000 --- a/software/qsys_tutorial_switchs18_bsp/libhal_bsp.a +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/linker.h b/software/qsys_tutorial_switchs18_bsp/linker.h deleted file mode 100644 index 367204b..0000000 --- a/software/qsys_tutorial_switchs18_bsp/linker.h +++ /dev/null @@ -1,101 +0,0 @@ -/* - * linker.h - Linker script mapping information - * - * Machine generated for CPU 'nios2_processor' in SOPC Builder design 'nios_system' - * SOPC Builder design path: C:/Users/takayun/Documents/DE2-115/qsys_tutorial/nios_system.sopcinfo - * - * Generated: Thu Nov 10 09:22:57 JST 2016 - */ - -/* - * DO NOT MODIFY THIS FILE - * - * Changing this file will have subtle consequences - * which will almost certainly lead to a nonfunctioning - * system. If you do modify this file, be aware that your - * changes will be overwritten and lost when this file - * is generated again. - * - * DO NOT MODIFY THIS FILE - */ - -/* - * License Agreement - * - * Copyright (c) 2008 - * Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - * - * This agreement shall be governed in all respects by the laws of the State - * of California and by the laws of the United States of America. - */ - -#ifndef __LINKER_H_ -#define __LINKER_H_ - - -/* - * BSP controls alt_load() behavior in crt0. - * - */ - -#define ALT_LOAD_EXPLICITLY_CONTROLLED - - -/* - * Base address and span (size in bytes) of each linker region - * - */ - -#define ONCHIP_MEMORY_REGION_BASE 0x20 -#define ONCHIP_MEMORY_REGION_SPAN 4064 -#define RESET_REGION_BASE 0x0 -#define RESET_REGION_SPAN 32 - - -/* - * Devices associated with code sections - * - */ - -#define ALT_EXCEPTIONS_DEVICE ONCHIP_MEMORY -#define ALT_RESET_DEVICE ONCHIP_MEMORY -#define ALT_RODATA_DEVICE ONCHIP_MEMORY -#define ALT_RWDATA_DEVICE ONCHIP_MEMORY -#define ALT_TEXT_DEVICE ONCHIP_MEMORY - - -/* - * Initialization code at the reset address is allowed (e.g. no external bootloader). - * - */ - -#define ALT_ALLOW_CODE_AT_RESET - - -/* - * The alt_load() facility is called from crt0 to copy sections into RAM. - * - */ - -#define ALT_LOAD_COPY_RWDATA - -#endif /* __LINKER_H_ */ diff --git a/software/qsys_tutorial_switchs18_bsp/linker.x b/software/qsys_tutorial_switchs18_bsp/linker.x deleted file mode 100644 index 4ea4f4e..0000000 --- a/software/qsys_tutorial_switchs18_bsp/linker.x +++ /dev/null @@ -1,385 +0,0 @@ -/* - * linker.x - Linker script - * - * Machine generated for CPU 'nios2_processor' in SOPC Builder design 'nios_system' - * SOPC Builder design path: C:/Users/takayun/Documents/DE2-115/qsys_tutorial/nios_system.sopcinfo - * - * Generated: Thu Nov 10 09:22:57 JST 2016 - */ - -/* - * DO NOT MODIFY THIS FILE - * - * Changing this file will have subtle consequences - * which will almost certainly lead to a nonfunctioning - * system. If you do modify this file, be aware that your - * changes will be overwritten and lost when this file - * is generated again. - * - * DO NOT MODIFY THIS FILE - */ - -/* - * License Agreement - * - * Copyright (c) 2008 - * Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - * - * This agreement shall be governed in all respects by the laws of the State - * of California and by the laws of the United States of America. - */ - -MEMORY -{ - reset : ORIGIN = 0x0, LENGTH = 32 - onchip_memory : ORIGIN = 0x20, LENGTH = 4064 -} - -/* Define symbols for each memory base-address */ -__alt_mem_onchip_memory = 0x0; - -OUTPUT_FORMAT( "elf32-littlenios2", - "elf32-littlenios2", - "elf32-littlenios2" ) -OUTPUT_ARCH( nios2 ) -ENTRY( _start ) - -/* - * The alt_load() facility is enabled. This typically happens when there isn't - * an external bootloader (e.g. flash bootloader). - * The LMA (aka physical address) of each loaded section is - * set to the .text memory device. - * The HAL alt_load() routine called from crt0 copies sections from - * the .text memory to RAM as needed. - */ - -SECTIONS -{ - - /* - * Output sections associated with reset and exceptions (they have to be first) - */ - - .entry : - { - KEEP (*(.entry)) - } > reset - - .exceptions : - { - PROVIDE (__ram_exceptions_start = ABSOLUTE(.)); - . = ALIGN(0x20); - KEEP (*(.irq)); - KEEP (*(.exceptions.entry.label)); - KEEP (*(.exceptions.entry.user)); - KEEP (*(.exceptions.entry)); - KEEP (*(.exceptions.irqtest.user)); - KEEP (*(.exceptions.irqtest)); - KEEP (*(.exceptions.irqhandler.user)); - KEEP (*(.exceptions.irqhandler)); - KEEP (*(.exceptions.irqreturn.user)); - KEEP (*(.exceptions.irqreturn)); - KEEP (*(.exceptions.notirq.label)); - KEEP (*(.exceptions.notirq.user)); - KEEP (*(.exceptions.notirq)); - KEEP (*(.exceptions.soft.user)); - KEEP (*(.exceptions.soft)); - KEEP (*(.exceptions.unknown.user)); - KEEP (*(.exceptions.unknown)); - KEEP (*(.exceptions.exit.label)); - KEEP (*(.exceptions.exit.user)); - KEEP (*(.exceptions.exit)); - KEEP (*(.exceptions)); - PROVIDE (__ram_exceptions_end = ABSOLUTE(.)); - } > onchip_memory - - PROVIDE (__flash_exceptions_start = LOADADDR(.exceptions)); - - .text : - { - /* - * All code sections are merged into the text output section, along with - * the read only data sections. - * - */ - - PROVIDE (stext = ABSOLUTE(.)); - - *(.interp) - *(.hash) - *(.dynsym) - *(.dynstr) - *(.gnu.version) - *(.gnu.version_d) - *(.gnu.version_r) - *(.rel.init) - *(.rela.init) - *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) - *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) - *(.rel.fini) - *(.rela.fini) - *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) - *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) - *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) - *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) - *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) - *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) - *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) - *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) - *(.rel.ctors) - *(.rela.ctors) - *(.rel.dtors) - *(.rela.dtors) - *(.rel.got) - *(.rela.got) - *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) - *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) - *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) - *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) - *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) - *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) - *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) - *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) - *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) - *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) - *(.rel.plt) - *(.rela.plt) - *(.rel.dyn) - - KEEP (*(.init)) - *(.plt) - *(.text .stub .text.* .gnu.linkonce.t.*) - - /* .gnu.warning sections are handled specially by elf32.em. */ - - *(.gnu.warning.*) - KEEP (*(.fini)) - PROVIDE (__etext = ABSOLUTE(.)); - PROVIDE (_etext = ABSOLUTE(.)); - PROVIDE (etext = ABSOLUTE(.)); - - *(.eh_frame_hdr) - /* Ensure the __preinit_array_start label is properly aligned. We - could instead move the label definition inside the section, but - the linker would then create the section even if it turns out to - be empty, which isn't pretty. */ - . = ALIGN(4); - PROVIDE (__preinit_array_start = ABSOLUTE(.)); - *(.preinit_array) - PROVIDE (__preinit_array_end = ABSOLUTE(.)); - PROVIDE (__init_array_start = ABSOLUTE(.)); - *(.init_array) - PROVIDE (__init_array_end = ABSOLUTE(.)); - PROVIDE (__fini_array_start = ABSOLUTE(.)); - *(.fini_array) - PROVIDE (__fini_array_end = ABSOLUTE(.)); - SORT(CONSTRUCTORS) - KEEP (*(.eh_frame)) - *(.gcc_except_table) - *(.dynamic) - PROVIDE (__CTOR_LIST__ = ABSOLUTE(.)); - KEEP (*(.ctors)) - KEEP (*(SORT(.ctors.*))) - PROVIDE (__CTOR_END__ = ABSOLUTE(.)); - PROVIDE (__DTOR_LIST__ = ABSOLUTE(.)); - KEEP (*(.dtors)) - KEEP (*(SORT(.dtors.*))) - PROVIDE (__DTOR_END__ = ABSOLUTE(.)); - KEEP (*(.jcr)) - . = ALIGN(4); - } > onchip_memory = 0x3a880100 /* Nios II NOP instruction */ - - .rodata : - { - PROVIDE (__ram_rodata_start = ABSOLUTE(.)); - . = ALIGN(4); - *(.rodata .rodata.* .gnu.linkonce.r.*) - *(.rodata1) - . = ALIGN(4); - PROVIDE (__ram_rodata_end = ABSOLUTE(.)); - } > onchip_memory - - PROVIDE (__flash_rodata_start = LOADADDR(.rodata)); - - /* - * - * This section's LMA is set to the .text region. - * crt0 will copy to this section's specified mapped region virtual memory address (VMA) - * - * .rwdata region equals the .text region, and is set to be loaded into .text region. - * This requires two copies of .rwdata in the .text region. One read writable at VMA. - * and one read-only at LMA. crt0 will copy from LMA to VMA on reset - * - */ - - .rwdata LOADADDR (.rodata) + SIZEOF (.rodata) : AT ( LOADADDR (.rodata) + SIZEOF (.rodata)+ SIZEOF (.rwdata) ) - { - PROVIDE (__ram_rwdata_start = ABSOLUTE(.)); - . = ALIGN(4); - *(.got.plt) *(.got) - *(.data1) - *(.data .data.* .gnu.linkonce.d.*) - - _gp = ABSOLUTE(. + 0x8000); - PROVIDE(gp = _gp); - - *(.rwdata .rwdata.*) - *(.sdata .sdata.* .gnu.linkonce.s.*) - *(.sdata2 .sdata2.* .gnu.linkonce.s2.*) - - . = ALIGN(4); - _edata = ABSOLUTE(.); - PROVIDE (edata = ABSOLUTE(.)); - PROVIDE (__ram_rwdata_end = ABSOLUTE(.)); - } > onchip_memory - - PROVIDE (__flash_rwdata_start = LOADADDR(.rwdata)); - - /* - * - * This section's LMA is set to the .text region. - * crt0 will copy to this section's specified mapped region virtual memory address (VMA) - * - */ - - .bss LOADADDR (.rwdata) + SIZEOF (.rwdata) : AT ( LOADADDR (.rwdata) + SIZEOF (.rwdata) ) - { - __bss_start = ABSOLUTE(.); - PROVIDE (__sbss_start = ABSOLUTE(.)); - PROVIDE (___sbss_start = ABSOLUTE(.)); - - *(.dynsbss) - *(.sbss .sbss.* .gnu.linkonce.sb.*) - *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) - *(.scommon) - - PROVIDE (__sbss_end = ABSOLUTE(.)); - PROVIDE (___sbss_end = ABSOLUTE(.)); - - *(.dynbss) - *(.bss .bss.* .gnu.linkonce.b.*) - *(COMMON) - - . = ALIGN(4); - __bss_end = ABSOLUTE(.); - } > onchip_memory - - /* - * - * One output section mapped to the associated memory device for each of - * the available memory devices. These are not used by default, but can - * be used by user applications by using the .section directive. - * - * The output section used for the heap is treated in a special way, - * i.e. the symbols "end" and "_end" are added to point to the heap start. - * - * Because alt_load() is enabled, these sections have - * their LMA set to be loaded into the .text memory region. - * However, the alt_load() code will NOT automatically copy - * these sections into their mapped memory region. - * - */ - - /* - * - * This section's LMA is set to the .text region. - * crt0 will copy to this section's specified mapped region virtual memory address (VMA) - * - */ - - .onchip_memory LOADADDR (.bss) + SIZEOF (.bss) : AT ( LOADADDR (.bss) + SIZEOF (.bss) ) - { - PROVIDE (_alt_partition_onchip_memory_start = ABSOLUTE(.)); - *(.onchip_memory. onchip_memory.*) - . = ALIGN(4); - PROVIDE (_alt_partition_onchip_memory_end = ABSOLUTE(.)); - _end = ABSOLUTE(.); - end = ABSOLUTE(.); - __alt_stack_base = ABSOLUTE(.); - } > onchip_memory - - PROVIDE (_alt_partition_onchip_memory_load_addr = LOADADDR(.onchip_memory)); - - /* - * Stabs debugging sections. - * - */ - - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - /* DWARF debug sections. - Symbols in the DWARF debugging sections are relative to the beginning - of the section so we begin them at 0. */ - /* DWARF 1 */ - .debug 0 : { *(.debug) } - .line 0 : { *(.line) } - /* GNU DWARF 1 extensions */ - .debug_srcinfo 0 : { *(.debug_srcinfo) } - .debug_sfnames 0 : { *(.debug_sfnames) } - /* DWARF 1.1 and DWARF 2 */ - .debug_aranges 0 : { *(.debug_aranges) } - .debug_pubnames 0 : { *(.debug_pubnames) } - /* DWARF 2 */ - .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_line 0 : { *(.debug_line) } - .debug_frame 0 : { *(.debug_frame) } - .debug_str 0 : { *(.debug_str) } - .debug_loc 0 : { *(.debug_loc) } - .debug_macinfo 0 : { *(.debug_macinfo) } - /* SGI/MIPS DWARF 2 extensions */ - .debug_weaknames 0 : { *(.debug_weaknames) } - .debug_funcnames 0 : { *(.debug_funcnames) } - .debug_typenames 0 : { *(.debug_typenames) } - .debug_varnames 0 : { *(.debug_varnames) } - - /* Altera debug extensions */ - .debug_alt_sim_info 0 : { *(.debug_alt_sim_info) } -} - -/* provide a pointer for the stack */ - -/* - * Don't override this, override the __alt_stack_* symbols instead. - */ -__alt_data_end = 0x1000; - -/* - * The next two symbols define the location of the default stack. You can - * override them to move the stack to a different memory. - */ -PROVIDE( __alt_stack_pointer = __alt_data_end ); -PROVIDE( __alt_stack_limit = __alt_stack_base ); - -/* - * This symbol controls where the start of the heap is. If the stack is - * contiguous with the heap then the stack will contract as memory is - * allocated to the heap. - * Override this symbol to put the heap in a different memory. - */ -PROVIDE( __alt_heap_start = end ); -PROVIDE( __alt_heap_limit = 0x1000 ); diff --git a/software/qsys_tutorial_switchs18_bsp/mem_init.mk b/software/qsys_tutorial_switchs18_bsp/mem_init.mk deleted file mode 100644 index 4caaef9..0000000 --- a/software/qsys_tutorial_switchs18_bsp/mem_init.mk +++ /dev/null @@ -1,322 +0,0 @@ - -######################################################################### -####### M E M I N I T M A K E F I L E C O N T E N T ###### -######################################################################### - -######################################################################### -# This file is intended to be included by public.mk -# -# -# The following variables must be defined before including this file: -# - ELF -# -# The following variables may be defined to override the default behavior: -# - HDL_SIM_DIR -# - HDL_SIM_INSTALL_DIR -# - MEM_INIT_DIR -# - MEM_INIT_INSTALL_DIR -# - QUARTUS_PROJECT_DIR -# - SOPC_NAME -# - SIM_OPTIMIZE -# - RESET_ADDRESS -# -######################################################################### - -ifeq ($(MEM_INIT_FILE),) -# MEM_INIT_FILE should be set equal to the working relative path to this -# mem_init.mk makefile fragment -MEM_INIT_FILE := $(wildcard $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))) -endif - -ifeq ($(ELF2DAT),) -ELF2DAT := elf2dat -endif - -ifeq ($(ELF2HEX),) -ELF2HEX := elf2hex -endif - -ifeq ($(ELF2FLASH),) -ELF2FLASH := elf2flash -endif - -ifeq ($(FLASH2DAT),) -FLASH2DAT := flash2dat -endif - -ifeq ($(NM),) -NM := nios2-elf-nm -endif - -ifeq ($(MKDIR),) -MKDIR := mkdir -p -endif - -ifeq ($(RM),) -RM := rm -f -endif - -ifeq ($(CP),) -CP := cp -endif - -ifeq ($(ECHO),) -ECHO := echo -endif - -MEM_INIT_DIR ?= mem_init -HDL_SIM_DIR ?= $(MEM_INIT_DIR)/hdl_sim - -ifdef QUARTUS_PROJECT_DIR -MEM_INIT_INSTALL_DIR ?= $(patsubst %/,%,$(QUARTUS_PROJECT_DIR)) -ifdef SOPC_NAME -HDL_SIM_INSTALL_DIR ?= $(patsubst %/,%,$(QUARTUS_PROJECT_DIR))/$(SOPC_NAME)_sim -endif -endif - -MEM_INIT_DESCRIPTOR_FILE ?= $(MEM_INIT_DIR)/meminit.spd - -MEM_INIT_QIP_FILE ?= $(MEM_INIT_DIR)/meminit.qip - -#------------------------------------- -# Default Flash Boot Loaders -#------------------------------------- - -BOOT_LOADER_PATH ?= $(SOPC_KIT_NIOS2)/components/altera_nios2 -BOOT_LOADER_CFI ?= $(BOOT_LOADER_PATH)/boot_loader_cfi.srec -BOOT_LOADER_CFI_BE ?= $(BOOT_LOADER_PATH)/boot_loader_cfi_be.srec - - -#------------------------------------- -# Default Target -#------------------------------------- - -.PHONY: default_mem_init -ifeq ($(QSYS),1) -default_mem_init: mem_init_generate -else -default_mem_init: mem_init_install -endif -#------------------------------------- -# Runtime Macros -#------------------------------------- - -define post-process-info - @echo Post-processing to create $@... -endef - -target_stem = $(notdir $(basename $@)) - -mem_start_address = $($(target_stem)_START) -mem_end_address = $($(target_stem)_END) -mem_width = $($(target_stem)_WIDTH) -mem_endianness = $($(target_stem)_ENDIANNESS) -mem_create_lanes = $($(target_stem)_CREATE_LANES) - -mem_pad_flag = $($(target_stem)_PAD_FLAG) -mem_reloc_input_flag = $($(target_stem)_RELOC_INPUT_FLAG) -mem_no_zero_fill_flag = $($(target_stem)_NO_ZERO_FILL_FLAG) - -flash_mem_epcs_flag = $($(target_stem)_EPCS_FLAGS) -flash_mem_cfi_flag = $($(target_stem)_CFI_FLAGS) -flash_mem_boot_loader_flag = $($(target_stem)_BOOT_LOADER_FLAG) - -elf2dat_extra_args = $(mem_pad_flag) -elf2hex_extra_args = $(mem_no_zero_fill_flag) -elf2flash_extra_args = $(flash_mem_cfi_flag) $(flash_mem_epcs_flag) $(flash_mem_boot_loader_flag) -flash2dat_extra_args = $(mem_pad_flag) $(mem_reloc_input_flag) - -#------------------------------------------------------------------------------ -# BSP SPECIFIC CONTENT -# -# The content below is controlled by the BSP and SOPC System -#------------------------------------------------------------------------------ -#START OF BSP SPECIFIC - -#------------------------------------- -# Global Settings -#------------------------------------- - - -# The following TYPE comment allows tools to identify the 'type' of target this -# makefile is associated with. -# TYPE: BSP_MEMINIT_MAKEFILE - -# This following VERSION comment indicates the version of the tool used to -# generate this makefile. A makefile variable is provided for VERSION as well. -# ACDS_VERSION: 13.0sp1 -ACDS_VERSION := 13.0sp1 - -# This following BUILD_NUMBER comment indicates the build number of the tool -# used to generate this makefile. -# BUILD_NUMBER: 232 - -# Optimize for simulation -SIM_OPTIMIZE ?= 0 - -# The CPU reset address as needed by elf2flash -RESET_ADDRESS ?= 0x00000000 - -#------------------------------------- -# Pre-Initialized Memory Descriptions -#------------------------------------- - -# Memory: onchip_memory -MEM_0 := nios_system_onchip_memory -$(MEM_0)_NAME := onchip_memory -$(MEM_0)_MEM_INIT_FILE_PARAM_NAME := INIT_FILE -HEX_FILES += $(MEM_INIT_DIR)/$(MEM_0).hex -MEM_INIT_INSTALL_FILES += $(MEM_INIT_INSTALL_DIR)/$(MEM_0).hex -DAT_FILES += $(HDL_SIM_DIR)/$(MEM_0).dat -HDL_SIM_INSTALL_FILES += $(HDL_SIM_INSTALL_DIR)/$(MEM_0).dat -SYM_FILES += $(HDL_SIM_DIR)/$(MEM_0).sym -HDL_SIM_INSTALL_FILES += $(HDL_SIM_INSTALL_DIR)/$(MEM_0).sym -$(MEM_0)_START := 0x00000000 -$(MEM_0)_END := 0x00000fff -$(MEM_0)_HIERARCHICAL_PATH := onchip_memory -$(MEM_0)_WIDTH := 32 -$(MEM_0)_ENDIANNESS := --little-endian-mem -$(MEM_0)_CREATE_LANES := 0 - -.PHONY: onchip_memory -onchip_memory: check_elf_exists $(MEM_INIT_DIR)/$(MEM_0).hex $(HDL_SIM_DIR)/$(MEM_0).dat $(HDL_SIM_DIR)/$(MEM_0).sym - - -#END OF BSP SPECIFIC - -#------------------------------------- -# Pre-Initialized Memory Targets -#------------------------------------- - -.PHONY: mem_init_install mem_init_generate mem_init_clean - -ifeq ($(QSYS),1) -# Target mem_init_install is deprecated for QSys based systems -# To initialize onchip memories for Quartus II Synthesis with Qsys based systems: -# 1) Use "make mem_init_genearate" -# 2) Add the generated mem_init/meminit.qip file to your Quartus II Project -# -mem_init_install: - $(error Deprecated Makefile Target: '$@'. Use target 'mem_init_generate' and then add $(MEM_INIT_QIP_FILE) to your Quartus II Project) - -else # QSYS != 1, if SopcBuilder based system - -ifneq ($(MEM_INIT_INSTALL_DIR),) -mem_init_install: $(MEM_INIT_INSTALL_FILES) -endif - -ifneq ($(HDL_SIM_INSTALL_DIR),) -mem_init_install: $(HDL_SIM_INSTALL_FILES) -endif - -mem_init_install: mem_init_generate -ifeq ($(MEM_INIT_INSTALL_DIR),) - @echo "WARNING: MEM_INIT_INSTALL_DIR not set. Set your QUARTUS_PROJECT_DIR environment variable." -endif -ifeq ($(HDL_SIM_INSTALL_DIR),) - @echo "WARNING: HDL_SIM_INSTALL_DIR not set. Set your QUARTUS_PROJECT_DIR and SOPC_NAME environment variable." -endif - -$(MEM_INIT_INSTALL_FILES): $(MEM_INIT_INSTALL_DIR)/%: $(MEM_INIT_DIR)/% - @$(MKDIR) $(@D) - @$(CP) -v $< $@ - -$(HDL_SIM_INSTALL_FILES): $(HDL_SIM_INSTALL_DIR)/%: $(HDL_SIM_DIR)/% - @$(MKDIR) $(@D) - @$(CP) -v $< $@ - -endif # QSYS == 1 - - -mem_init_generate: hex dat sym flash $(MEM_INIT_DESCRIPTOR_FILE) $(MEM_INIT_QIP_FILE) - -mem_init_clean: - @$(RM) -r $(MEM_INIT_DIR) $(HDL_SIM_DIR) $(FLASH_FILES) - -.PHONY: hex dat sym flash - -hex: check_elf_exists $(HEX_FILES) - -dat: check_elf_exists $(DAT_FILES) - -sym: check_elf_exists $(SYM_FILES) - -flash: check_elf_exists $(FLASH_FILES) - -#------------------------------------- -# Pre-Initialized Memory Rules -#------------------------------------- - -.PHONY: check_elf_exists -check_elf_exists: $(ELF) -ifeq ($(ELF),) - $(error ELF var not set in mem_init.mk) -endif - -$(filter-out $(FLASH_DAT_FILES),$(DAT_FILES)): %.dat: $(ELF) - $(post-process-info) - @$(MKDIR) $(@D) - bash -c '$(ELF2DAT) --infile=$< --outfile=$@ \ - --base=$(mem_start_address) --end=$(mem_end_address) --width=$(mem_width) \ - $(mem_endianness) --create-lanes=$(mem_create_lanes) $(elf2dat_extra_args)' - -$(foreach i,0 1 2 3 4 5 6 7,%_lane$(i).dat): %.dat - @true - -$(HEX_FILES): %.hex: $(ELF) - $(post-process-info) - @$(MKDIR) $(@D) - bash -c '$(ELF2HEX) $< $(mem_start_address) $(mem_end_address) --width=$(mem_width) \ - $(mem_endianness) --create-lanes=$(mem_create_lanes) $(elf2hex_extra_args) $@' - -$(SYM_FILES): %.sym: $(ELF) - $(post-process-info) - @$(MKDIR) $(@D) - $(NM) -n $< > $@ - -$(FLASH_FILES): %.flash: $(ELF) - $(post-process-info) - @$(MKDIR) $(@D) - bash -c '$(ELF2FLASH) --input=$< --outfile=$@ --sim_optimize=$(SIM_OPTIMIZE) $(mem_endianness) \ - $(elf2flash_extra_args)' - -# -# Function generate_spd_entry -# Arg1: path to the memory initialization file -# Arg2: Type HEX or DAT -# Arg3: Output spd file to append -gen_spd_entry.BASE_FILE = $(basename $(notdir $1)) -gen_spd_entry.PARAM_NAME = $($(gen_spd_entry.BASE_FILE)_MEM_INIT_FILE_PARAM_NAME) -gen_spd_entry.MEM_PATH = $($(gen_spd_entry.BASE_FILE)_HIERARCHICAL_PATH) -gen_spd_entry.SETTINGS = $(strip \ - path=\"$1\" \ - type=\"$2\" \ - $(if $(gen_spd_entry.PARAM_NAME),initParamName=\"$(gen_spd_entry.PARAM_NAME)\") \ - $(if $(gen_spd_entry.MEM_PATH),memoryPath=\"$(gen_spd_entry.MEM_PATH)\") \ -) -define gen_spd_entry -$(ECHO) "" >> $3 -endef - -$(MEM_INIT_DESCRIPTOR_FILE).DAT_FILESET := $(patsubst $(dir $(MEM_INIT_DESCRIPTOR_FILE))%,%,$(DAT_FILES)) -$(MEM_INIT_DESCRIPTOR_FILE).HEX_FILESET := $(patsubst $(dir $(MEM_INIT_DESCRIPTOR_FILE))%,%,$(HEX_FILES)) - -$(MEM_INIT_DESCRIPTOR_FILE): %.spd: $(MEM_INIT_FILE) - $(post-process-info) - @$(MKDIR) $(@D) - @$(RM) $@ - @$(ECHO) "" > $@ - @$(ECHO) "" >> $@ - @$(foreach dat_file,$($@.DAT_FILESET),$(call gen_spd_entry,$(dat_file),DAT,$@) &&)true - @$(foreach hex_file,$($@.HEX_FILESET),$(call gen_spd_entry,$(hex_file),HEX,$@) &&)true - @$(ECHO) "" >> $@ - -.DELETE_ON_ERROR: $(MEM_INIT_DESCRIPTOR_FILE) - -$(MEM_INIT_QIP_FILE): %.qip: $(MEM_INIT_FILE) - $(post-process-info) - @$(MKDIR) $(@D) - @$(RM) $@ - @$(ECHO) "set_global_assignment -name SEARCH_PATH $$::quartus(qip_path)" > $@ - -.DELETE_ON_ERROR: $(MEM_INIT_QIP_FILE) diff --git a/software/qsys_tutorial_switchs18_bsp/memory.gdb b/software/qsys_tutorial_switchs18_bsp/memory.gdb deleted file mode 100644 index f9cc1ca..0000000 --- a/software/qsys_tutorial_switchs18_bsp/memory.gdb +++ /dev/null @@ -1,50 +0,0 @@ -# memory.gdb - GDB memory region definitions -# -# Machine generated for CPU 'nios2_processor' in SOPC Builder design 'nios_system' -# SOPC Builder design path: C:/Users/takayun/Documents/DE2-115/qsys_tutorial/nios_system.sopcinfo -# -# Generated: Thu Nov 10 09:22:57 JST 2016 - -# DO NOT MODIFY THIS FILE -# -# Changing this file will have subtle consequences -# which will almost certainly lead to a nonfunctioning -# system. If you do modify this file, be aware that your -# changes will be overwritten and lost when this file -# is generated again. -# -# DO NOT MODIFY THIS FILE - -# License Agreement -# -# Copyright (c) 2008 -# Altera Corporation, San Jose, California, USA. -# All rights reserved. -# -# 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. -# -# This agreement shall be governed in all respects by the laws of the State -# of California and by the laws of the United States of America. - -# Define memory regions for each memory connected to the CPU. -# The cache attribute is specified which improves GDB performance -# by allowing GDB to cache memory contents on the host. - -# onchip_memory -memory 0x0 0x1000 cache diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_alarm_start.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_alarm_start.d deleted file mode 100644 index 3bb20ea..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_alarm_start.d +++ /dev/null @@ -1,22 +0,0 @@ -obj/HAL/src/alt_alarm_start.o: HAL/src/alt_alarm_start.c \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h system.h linker.h - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_alarm_start.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_alarm_start.o deleted file mode 100644 index 6fe7cfa..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_alarm_start.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_busy_sleep.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_busy_sleep.d deleted file mode 100644 index e93e80c..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_busy_sleep.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_busy_sleep.o: HAL/src/alt_busy_sleep.c system.h linker.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_busy_sleep.h - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_busy_sleep.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_busy_sleep.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_busy_sleep.o deleted file mode 100644 index 62f19fe..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_busy_sleep.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_close.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_close.d deleted file mode 100644 index fbbab9c..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_close.d +++ /dev/null @@ -1,34 +0,0 @@ -obj/HAL/src/alt_close.o: HAL/src/alt_close.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h \ - HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_close.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_close.o deleted file mode 100644 index 2ea7a4b..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_close.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_dcache_flush.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_dcache_flush.d deleted file mode 100644 index a0eaf8a..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_dcache_flush.d +++ /dev/null @@ -1,15 +0,0 @@ -obj/HAL/src/alt_dcache_flush.o: HAL/src/alt_dcache_flush.c \ - HAL/inc/nios2.h system.h linker.h HAL/inc/alt_types.h \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h - -HAL/inc/nios2.h: - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_dcache_flush.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_dcache_flush.o deleted file mode 100644 index 728a60d..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_dcache_flush.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_dcache_flush_all.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_dcache_flush_all.d deleted file mode 100644 index 792c3e4..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_dcache_flush_all.d +++ /dev/null @@ -1,15 +0,0 @@ -obj/HAL/src/alt_dcache_flush_all.o: HAL/src/alt_dcache_flush_all.c \ - HAL/inc/nios2.h system.h linker.h HAL/inc/alt_types.h \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h - -HAL/inc/nios2.h: - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_dcache_flush_all.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_dcache_flush_all.o deleted file mode 100644 index aa0de97..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_dcache_flush_all.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_dcache_flush_no_writeback.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_dcache_flush_no_writeback.d deleted file mode 100644 index 867c42b..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_dcache_flush_no_writeback.d +++ /dev/null @@ -1,16 +0,0 @@ -obj/HAL/src/alt_dcache_flush_no_writeback.o: \ - HAL/src/alt_dcache_flush_no_writeback.c HAL/inc/nios2.h system.h \ - linker.h HAL/inc/alt_types.h HAL/inc/sys/alt_cache.h \ - HAL/inc/alt_types.h - -HAL/inc/nios2.h: - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_dcache_flush_no_writeback.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_dcache_flush_no_writeback.o deleted file mode 100644 index d9ed43f..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_dcache_flush_no_writeback.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_dev.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_dev.d deleted file mode 100644 index cd9b1d4..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_dev.d +++ /dev/null @@ -1,34 +0,0 @@ -obj/HAL/src/alt_dev.o: HAL/src/alt_dev.c HAL/inc/sys/alt_dev.h system.h \ - linker.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h \ - HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h HAL/inc/alt_types.h \ - system.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/alt_types.h: - -system.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_dev.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_dev.o deleted file mode 100644 index ea8331a..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_dev.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_dev_llist_insert.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_dev_llist_insert.d deleted file mode 100644 index 344d065..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_dev_llist_insert.d +++ /dev/null @@ -1,13 +0,0 @@ -obj/HAL/src/alt_dev_llist_insert.o: HAL/src/alt_dev_llist_insert.c \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/alt_types.h HAL/inc/sys/alt_errno.h - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_errno.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_dev_llist_insert.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_dev_llist_insert.o deleted file mode 100644 index e242c2f..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_dev_llist_insert.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_dma_rxchan_open.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_dma_rxchan_open.d deleted file mode 100644 index fb21fed..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_dma_rxchan_open.d +++ /dev/null @@ -1,35 +0,0 @@ -obj/HAL/src/alt_dma_rxchan_open.o: HAL/src/alt_dma_rxchan_open.c \ - HAL/inc/sys/alt_dma.h HAL/inc/sys/alt_dma_dev.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/alt_types.h HAL/inc/sys/alt_errno.h \ - HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h system.h linker.h \ - HAL/inc/sys/alt_llist.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h - -HAL/inc/sys/alt_dma.h: - -HAL/inc/sys/alt_dma_dev.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_errno.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_dma_rxchan_open.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_dma_rxchan_open.o deleted file mode 100644 index 44de728..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_dma_rxchan_open.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_dma_txchan_open.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_dma_txchan_open.d deleted file mode 100644 index 500b95c..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_dma_txchan_open.d +++ /dev/null @@ -1,35 +0,0 @@ -obj/HAL/src/alt_dma_txchan_open.o: HAL/src/alt_dma_txchan_open.c \ - HAL/inc/sys/alt_dma.h HAL/inc/sys/alt_dma_dev.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/alt_types.h HAL/inc/sys/alt_errno.h \ - HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h system.h linker.h \ - HAL/inc/sys/alt_llist.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h - -HAL/inc/sys/alt_dma.h: - -HAL/inc/sys/alt_dma_dev.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_errno.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_dma_txchan_open.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_dma_txchan_open.o deleted file mode 100644 index 9434883..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_dma_txchan_open.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_do_ctors.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_do_ctors.d deleted file mode 100644 index daf8baf..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_do_ctors.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_do_ctors.o: HAL/src/alt_do_ctors.c diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_do_ctors.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_do_ctors.o deleted file mode 100644 index cee2a4e..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_do_ctors.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_do_dtors.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_do_dtors.d deleted file mode 100644 index c3471eb..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_do_dtors.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_do_dtors.o: HAL/src/alt_do_dtors.c diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_do_dtors.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_do_dtors.o deleted file mode 100644 index dfc2525..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_do_dtors.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_env_lock.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_env_lock.d deleted file mode 100644 index 634d7b0..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_env_lock.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_env_lock.o: HAL/src/alt_env_lock.c diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_env_lock.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_env_lock.o deleted file mode 100644 index 3b0702c..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_env_lock.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_environ.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_environ.d deleted file mode 100644 index e9ca295..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_environ.d +++ /dev/null @@ -1,3 +0,0 @@ -obj/HAL/src/alt_environ.o: HAL/src/alt_environ.c HAL/inc/os/alt_syscall.h - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_environ.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_environ.o deleted file mode 100644 index f04f168..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_environ.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_errno.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_errno.d deleted file mode 100644 index 29ca544..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_errno.d +++ /dev/null @@ -1,8 +0,0 @@ -obj/HAL/src/alt_errno.o: HAL/src/alt_errno.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/alt_types.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_errno.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_errno.o deleted file mode 100644 index c1bd2ee..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_errno.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_exception_entry.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_exception_entry.d deleted file mode 100644 index 540567e..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_exception_entry.d +++ /dev/null @@ -1,6 +0,0 @@ -obj/HAL/src/alt_exception_entry.o: HAL/src/alt_exception_entry.S system.h \ - linker.h - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_exception_entry.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_exception_entry.o deleted file mode 100644 index 3c912dd..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_exception_entry.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_exception_muldiv.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_exception_muldiv.d deleted file mode 100644 index 63d66a7..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_exception_muldiv.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_exception_muldiv.o: HAL/src/alt_exception_muldiv.S diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_exception_muldiv.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_exception_muldiv.o deleted file mode 100644 index f807e90..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_exception_muldiv.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_exception_trap.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_exception_trap.d deleted file mode 100644 index 6e18488..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_exception_trap.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_exception_trap.o: HAL/src/alt_exception_trap.S diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_exception_trap.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_exception_trap.o deleted file mode 100644 index a2e80cd..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_exception_trap.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_execve.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_execve.d deleted file mode 100644 index 9cef7d2..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_execve.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_execve.o: HAL/src/alt_execve.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_execve.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_execve.o deleted file mode 100644 index dced4ec..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_execve.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_exit.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_exit.d deleted file mode 100644 index a779da8..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_exit.d +++ /dev/null @@ -1,26 +0,0 @@ -obj/HAL/src/alt_exit.o: HAL/src/alt_exit.c HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h HAL/inc/alt_types.h system.h linker.h \ - HAL/inc/sys/alt_sim.h HAL/inc/os/alt_hooks.h HAL/inc/os/alt_syscall.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_log_printf.h system.h - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_sim.h: - -HAL/inc/os/alt_hooks.h: - -HAL/inc/os/alt_syscall.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_exit.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_exit.o deleted file mode 100644 index 0cd999e..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_exit.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_fcntl.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_fcntl.d deleted file mode 100644 index 527f242..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_fcntl.d +++ /dev/null @@ -1,34 +0,0 @@ -obj/HAL/src/alt_fcntl.o: HAL/src/alt_fcntl.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h \ - system.h linker.h HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/alt_types.h \ - HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_fcntl.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_fcntl.o deleted file mode 100644 index e078c60..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_fcntl.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_fd_lock.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_fd_lock.d deleted file mode 100644 index 93daeac..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_fd_lock.d +++ /dev/null @@ -1,27 +0,0 @@ -obj/HAL/src/alt_fd_lock.o: HAL/src/alt_fd_lock.c HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_fd_lock.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_fd_lock.o deleted file mode 100644 index 48f562e..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_fd_lock.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_fd_unlock.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_fd_unlock.d deleted file mode 100644 index 45a3207..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_fd_unlock.d +++ /dev/null @@ -1,27 +0,0 @@ -obj/HAL/src/alt_fd_unlock.o: HAL/src/alt_fd_unlock.c \ - HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h system.h linker.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_fd_unlock.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_fd_unlock.o deleted file mode 100644 index e4ddba8..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_fd_unlock.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_find_dev.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_find_dev.d deleted file mode 100644 index 98336f8..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_find_dev.d +++ /dev/null @@ -1,31 +0,0 @@ -obj/HAL/src/alt_find_dev.o: HAL/src/alt_find_dev.c HAL/inc/sys/alt_dev.h \ - system.h linker.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h \ - HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h HAL/inc/alt_types.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_find_dev.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_find_dev.o deleted file mode 100644 index f7c9b07..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_find_dev.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_find_file.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_find_file.d deleted file mode 100644 index d1150ca..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_find_file.d +++ /dev/null @@ -1,32 +0,0 @@ -obj/HAL/src/alt_find_file.o: HAL/src/alt_find_file.c \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h \ - HAL/inc/alt_types.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_find_file.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_find_file.o deleted file mode 100644 index dbac54b..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_find_file.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_flash_dev.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_flash_dev.d deleted file mode 100644 index 8835e8f..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_flash_dev.d +++ /dev/null @@ -1,34 +0,0 @@ -obj/HAL/src/alt_flash_dev.o: HAL/src/alt_flash_dev.c \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/sys/alt_flash_dev.h \ - HAL/inc/sys/alt_flash_types.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h \ - system.h linker.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_flash_dev.h: - -HAL/inc/sys/alt_flash_types.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_flash_dev.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_flash_dev.o deleted file mode 100644 index 5b3aab0..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_flash_dev.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_fork.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_fork.d deleted file mode 100644 index 492be65..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_fork.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_fork.o: HAL/src/alt_fork.c HAL/inc/sys/alt_warning.h \ - HAL/inc/sys/alt_errno.h HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_warning.h: - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_fork.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_fork.o deleted file mode 100644 index fdc85e4..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_fork.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_fs_reg.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_fs_reg.d deleted file mode 100644 index d8f95ab..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_fs_reg.d +++ /dev/null @@ -1,29 +0,0 @@ -obj/HAL/src/alt_fs_reg.o: HAL/src/alt_fs_reg.c HAL/inc/sys/alt_dev.h \ - system.h linker.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h \ - HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_fs_reg.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_fs_reg.o deleted file mode 100644 index ee04384..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_fs_reg.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_fstat.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_fstat.d deleted file mode 100644 index 942fcbc..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_fstat.d +++ /dev/null @@ -1,38 +0,0 @@ -obj/HAL/src/alt_fstat.o: HAL/src/alt_fstat.c HAL/inc/sys/alt_dev.h \ - system.h linker.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/sys/alt_errno.h \ - HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_syscall.h system.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/sys/alt_errno.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_syscall.h: - -system.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_fstat.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_fstat.o deleted file mode 100644 index 4c14c2a..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_fstat.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_get_fd.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_get_fd.d deleted file mode 100644 index 9a4daaa..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_get_fd.d +++ /dev/null @@ -1,34 +0,0 @@ -obj/HAL/src/alt_get_fd.o: HAL/src/alt_get_fd.c HAL/inc/sys/alt_dev.h \ - system.h linker.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h \ - HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h HAL/inc/alt_types.h \ - system.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/alt_types.h: - -system.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_get_fd.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_get_fd.o deleted file mode 100644 index bdea58a..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_get_fd.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_getchar.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_getchar.d deleted file mode 100644 index bcccdf7..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_getchar.d +++ /dev/null @@ -1,34 +0,0 @@ -obj/HAL/src/alt_getchar.o: HAL/src/alt_getchar.c system.h linker.h \ - HAL/inc/sys/alt_driver.h HAL/inc/sys/alt_stdio.h \ - HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h system.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h - -system.h: - -linker.h: - -HAL/inc/sys/alt_driver.h: - -HAL/inc/sys/alt_stdio.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_getchar.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_getchar.o deleted file mode 100644 index cbcd55b..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_getchar.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_getpid.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_getpid.d deleted file mode 100644 index d9499b9..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_getpid.d +++ /dev/null @@ -1,3 +0,0 @@ -obj/HAL/src/alt_getpid.o: HAL/src/alt_getpid.c HAL/inc/os/alt_syscall.h - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_getpid.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_getpid.o deleted file mode 100644 index 5739398..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_getpid.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_gettod.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_gettod.d deleted file mode 100644 index cf3cf34..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_gettod.d +++ /dev/null @@ -1,17 +0,0 @@ -obj/HAL/src/alt_gettod.o: HAL/src/alt_gettod.c HAL/inc/sys/alt_alarm.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/priv/alt_alarm.h \ - HAL/inc/alt_types.h HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_gettod.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_gettod.o deleted file mode 100644 index 88384d6..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_gettod.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_gmon.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_gmon.d deleted file mode 100644 index e9469ab..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_gmon.d +++ /dev/null @@ -1,24 +0,0 @@ -obj/HAL/src/alt_gmon.o: HAL/src/alt_gmon.c HAL/inc/priv/nios2_gmon_data.h \ - HAL/inc/sys/alt_irq.h HAL/inc/nios2.h HAL/inc/alt_types.h system.h \ - linker.h HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h - -HAL/inc/priv/nios2_gmon_data.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_gmon.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_gmon.o deleted file mode 100644 index edda138..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_gmon.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_icache_flush.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_icache_flush.d deleted file mode 100644 index 2e4ddd1..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_icache_flush.d +++ /dev/null @@ -1,15 +0,0 @@ -obj/HAL/src/alt_icache_flush.o: HAL/src/alt_icache_flush.c \ - HAL/inc/nios2.h system.h linker.h HAL/inc/alt_types.h \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h - -HAL/inc/nios2.h: - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_icache_flush.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_icache_flush.o deleted file mode 100644 index 658af97..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_icache_flush.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_icache_flush_all.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_icache_flush_all.d deleted file mode 100644 index 47cfbf3..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_icache_flush_all.d +++ /dev/null @@ -1,15 +0,0 @@ -obj/HAL/src/alt_icache_flush_all.o: HAL/src/alt_icache_flush_all.c \ - HAL/inc/nios2.h system.h linker.h HAL/inc/alt_types.h \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h - -HAL/inc/nios2.h: - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_icache_flush_all.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_icache_flush_all.o deleted file mode 100644 index f0f1eb4..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_icache_flush_all.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_iic.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_iic.d deleted file mode 100644 index a709e0c..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_iic.d +++ /dev/null @@ -1,29 +0,0 @@ -obj/HAL/src/alt_iic.o: HAL/src/alt_iic.c system.h linker.h \ - HAL/inc/sys/alt_irq.h HAL/inc/nios2.h HAL/inc/alt_types.h system.h \ - HAL/inc/priv/alt_iic_isr_register.h HAL/inc/alt_types.h \ - HAL/inc/sys/alt_irq.h HAL/inc/priv/alt_legacy_irq.h system.h \ - HAL/inc/nios2.h - -system.h: - -linker.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -HAL/inc/priv/alt_iic_isr_register.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/priv/alt_legacy_irq.h: - -system.h: - -HAL/inc/nios2.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_iic.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_iic.o deleted file mode 100644 index 2acc465..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_iic.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_iic_isr_register.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_iic_isr_register.d deleted file mode 100644 index d0470ae..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_iic_isr_register.d +++ /dev/null @@ -1,30 +0,0 @@ -obj/HAL/src/alt_iic_isr_register.o: HAL/src/alt_iic_isr_register.c \ - system.h linker.h HAL/inc/alt_types.h HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h HAL/inc/alt_types.h system.h \ - HAL/inc/priv/alt_iic_isr_register.h HAL/inc/alt_types.h \ - HAL/inc/sys/alt_irq.h HAL/inc/sys/alt_irq_entry.h \ - HAL/inc/priv/alt_irq_table.h - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -HAL/inc/priv/alt_iic_isr_register.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/sys/alt_irq_entry.h: - -HAL/inc/priv/alt_irq_table.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_iic_isr_register.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_iic_isr_register.o deleted file mode 100644 index 67a8499..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_iic_isr_register.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_instruction_exception_entry.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_instruction_exception_entry.d deleted file mode 100644 index 6d0705f..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_instruction_exception_entry.d +++ /dev/null @@ -1,18 +0,0 @@ -obj/HAL/src/alt_instruction_exception_entry.o: \ - HAL/src/alt_instruction_exception_entry.c HAL/inc/sys/alt_exceptions.h \ - HAL/inc/alt_types.h system.h linker.h HAL/inc/nios2.h \ - HAL/inc/alt_types.h system.h - -HAL/inc/sys/alt_exceptions.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_instruction_exception_entry.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_instruction_exception_entry.o deleted file mode 100644 index b0e4223..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_instruction_exception_entry.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_instruction_exception_register.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_instruction_exception_register.d deleted file mode 100644 index d4fac04..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_instruction_exception_register.d +++ /dev/null @@ -1,16 +0,0 @@ -obj/HAL/src/alt_instruction_exception_register.o: \ - HAL/src/alt_instruction_exception_register.c \ - HAL/inc/sys/alt_exceptions.h HAL/inc/alt_types.h system.h linker.h \ - HAL/inc/alt_types.h system.h - -HAL/inc/sys/alt_exceptions.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -system.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_instruction_exception_register.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_instruction_exception_register.o deleted file mode 100644 index c8f1b3e..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_instruction_exception_register.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_io_redirect.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_io_redirect.d deleted file mode 100644 index 8228365..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_io_redirect.d +++ /dev/null @@ -1,29 +0,0 @@ -obj/HAL/src/alt_io_redirect.o: HAL/src/alt_io_redirect.c \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_io_redirect.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_io_redirect.o deleted file mode 100644 index c218d7c..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_io_redirect.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_ioctl.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_ioctl.d deleted file mode 100644 index d70ad97..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_ioctl.d +++ /dev/null @@ -1,41 +0,0 @@ -obj/HAL/src/alt_ioctl.o: HAL/src/alt_ioctl.c HAL/inc/sys/ioctl.h \ - HAL/inc/sys/alt_errno.h HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h \ - HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h system.h linker.h \ - HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_syscall.h system.h \ - HAL/inc/sys/alt_driver.h - -HAL/inc/sys/ioctl.h: - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_syscall.h: - -system.h: - -HAL/inc/sys/alt_driver.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_ioctl.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_ioctl.o deleted file mode 100644 index 8268c2b..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_ioctl.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_irq_entry.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_irq_entry.d deleted file mode 100644 index 9ec3751..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_irq_entry.d +++ /dev/null @@ -1,5 +0,0 @@ -obj/HAL/src/alt_irq_entry.o: HAL/src/alt_irq_entry.S system.h linker.h - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_irq_entry.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_irq_entry.o deleted file mode 100644 index 3c577f7..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_irq_entry.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_irq_handler.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_irq_handler.d deleted file mode 100644 index 6fb668f..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_irq_handler.d +++ /dev/null @@ -1,19 +0,0 @@ -obj/HAL/src/alt_irq_handler.o: HAL/src/alt_irq_handler.c system.h \ - linker.h HAL/inc/sys/alt_irq.h HAL/inc/nios2.h HAL/inc/alt_types.h \ - system.h HAL/inc/os/alt_hooks.h HAL/inc/alt_types.h - -system.h: - -linker.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -HAL/inc/os/alt_hooks.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_irq_handler.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_irq_handler.o deleted file mode 100644 index 35305a9..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_irq_handler.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_irq_register.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_irq_register.d deleted file mode 100644 index 3df2f8a..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_irq_register.d +++ /dev/null @@ -1,36 +0,0 @@ -obj/HAL/src/alt_irq_register.o: HAL/src/alt_irq_register.c system.h \ - linker.h HAL/inc/sys/alt_irq.h HAL/inc/nios2.h HAL/inc/alt_types.h \ - system.h HAL/inc/priv/alt_legacy_irq.h system.h HAL/inc/nios2.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_irq.h HAL/inc/os/alt_hooks.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_irq_entry.h \ - HAL/inc/priv/alt_irq_table.h - -system.h: - -linker.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -HAL/inc/priv/alt_legacy_irq.h: - -system.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/os/alt_hooks.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_irq_entry.h: - -HAL/inc/priv/alt_irq_table.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_irq_register.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_irq_register.o deleted file mode 100644 index e2a9deb..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_irq_register.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_irq_vars.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_irq_vars.d deleted file mode 100644 index f316558..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_irq_vars.d +++ /dev/null @@ -1,8 +0,0 @@ -obj/HAL/src/alt_irq_vars.o: HAL/src/alt_irq_vars.c HAL/inc/alt_types.h \ - system.h linker.h - -HAL/inc/alt_types.h: - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_irq_vars.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_irq_vars.o deleted file mode 100644 index 6b89096..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_irq_vars.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_isatty.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_isatty.d deleted file mode 100644 index f8b1f07..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_isatty.d +++ /dev/null @@ -1,38 +0,0 @@ -obj/HAL/src/alt_isatty.o: HAL/src/alt_isatty.c HAL/inc/sys/alt_dev.h \ - system.h linker.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_errno.h HAL/inc/sys/alt_warning.h \ - HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_syscall.h system.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_errno.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_syscall.h: - -system.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_isatty.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_isatty.o deleted file mode 100644 index b2850ac..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_isatty.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_kill.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_kill.d deleted file mode 100644 index 0c14ae8..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_kill.d +++ /dev/null @@ -1,8 +0,0 @@ -obj/HAL/src/alt_kill.o: HAL/src/alt_kill.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_kill.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_kill.o deleted file mode 100644 index 322e2a3..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_kill.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_link.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_link.d deleted file mode 100644 index dc844c6..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_link.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_link.o: HAL/src/alt_link.c HAL/inc/sys/alt_warning.h \ - HAL/inc/sys/alt_errno.h HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_warning.h: - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_link.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_link.o deleted file mode 100644 index 7b17419..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_link.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_load.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_load.d deleted file mode 100644 index d496ab8..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_load.d +++ /dev/null @@ -1,8 +0,0 @@ -obj/HAL/src/alt_load.o: HAL/src/alt_load.c HAL/inc/sys/alt_load.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_cache.h - -HAL/inc/sys/alt_load.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_cache.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_load.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_load.o deleted file mode 100644 index 0cf966d..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_load.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_log_macro.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_log_macro.d deleted file mode 100644 index 9768c1f..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_log_macro.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_log_macro.o: HAL/src/alt_log_macro.S diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_log_macro.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_log_macro.o deleted file mode 100644 index 489e2cc..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_log_macro.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_log_printf.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_log_printf.d deleted file mode 100644 index 251ff6d..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_log_printf.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_log_printf.o: HAL/src/alt_log_printf.c diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_log_printf.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_log_printf.o deleted file mode 100644 index a03c33d..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_log_printf.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_lseek.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_lseek.d deleted file mode 100644 index 25ed783..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_lseek.d +++ /dev/null @@ -1,34 +0,0 @@ -obj/HAL/src/alt_lseek.o: HAL/src/alt_lseek.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h \ - HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_lseek.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_lseek.o deleted file mode 100644 index 68ca2aa..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_lseek.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_main.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_main.d deleted file mode 100644 index afdfda0..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_main.d +++ /dev/null @@ -1,47 +0,0 @@ -obj/HAL/src/alt_main.o: HAL/src/alt_main.c HAL/inc/sys/alt_dev.h system.h \ - linker.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_sys_init.h HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h HAL/inc/os/alt_hooks.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h \ - HAL/inc/alt_types.h system.h HAL/inc/sys/alt_log_printf.h system.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_sys_init.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/os/alt_hooks.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/alt_types.h: - -system.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_main.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_main.o deleted file mode 100644 index 73a4506..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_main.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_malloc_lock.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_malloc_lock.d deleted file mode 100644 index 4ed35c2..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_malloc_lock.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_malloc_lock.o: HAL/src/alt_malloc_lock.c diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_malloc_lock.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_malloc_lock.o deleted file mode 100644 index 9a6b8f5..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_malloc_lock.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_mcount.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_mcount.d deleted file mode 100644 index 1203efc..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_mcount.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_mcount.o: HAL/src/alt_mcount.S diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_mcount.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_mcount.o deleted file mode 100644 index 011e43f..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_mcount.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_open.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_open.d deleted file mode 100644 index a2aacd9..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_open.d +++ /dev/null @@ -1,36 +0,0 @@ -obj/HAL/src/alt_open.o: HAL/src/alt_open.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_open.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_open.o deleted file mode 100644 index 1a29bb7..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_open.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_printf.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_printf.d deleted file mode 100644 index 3ce68a4..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_printf.d +++ /dev/null @@ -1,3 +0,0 @@ -obj/HAL/src/alt_printf.o: HAL/src/alt_printf.c HAL/inc/sys/alt_stdio.h - -HAL/inc/sys/alt_stdio.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_printf.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_printf.o deleted file mode 100644 index 762bc54..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_printf.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_putchar.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_putchar.d deleted file mode 100644 index 9a0dde3..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_putchar.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_putchar.o: HAL/src/alt_putchar.c system.h linker.h \ - HAL/inc/sys/alt_driver.h HAL/inc/sys/alt_stdio.h - -system.h: - -linker.h: - -HAL/inc/sys/alt_driver.h: - -HAL/inc/sys/alt_stdio.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_putchar.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_putchar.o deleted file mode 100644 index 5c4ea77..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_putchar.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_putstr.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_putstr.d deleted file mode 100644 index 3cf528a..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_putstr.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_putstr.o: HAL/src/alt_putstr.c system.h linker.h \ - HAL/inc/sys/alt_driver.h HAL/inc/sys/alt_stdio.h - -system.h: - -linker.h: - -HAL/inc/sys/alt_driver.h: - -HAL/inc/sys/alt_stdio.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_putstr.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_putstr.o deleted file mode 100644 index 265b04e..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_putstr.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_read.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_read.d deleted file mode 100644 index 2bb0d95..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_read.d +++ /dev/null @@ -1,38 +0,0 @@ -obj/HAL/src/alt_read.o: HAL/src/alt_read.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h \ - HAL/inc/os/alt_syscall.h system.h HAL/inc/sys/alt_driver.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_syscall.h: - -system.h: - -HAL/inc/sys/alt_driver.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_read.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_read.o deleted file mode 100644 index 1c33078..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_read.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_release_fd.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_release_fd.d deleted file mode 100644 index 0e3acb5..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_release_fd.d +++ /dev/null @@ -1,29 +0,0 @@ -obj/HAL/src/alt_release_fd.o: HAL/src/alt_release_fd.c \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_release_fd.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_release_fd.o deleted file mode 100644 index ae0bf58..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_release_fd.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_remap_cached.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_remap_cached.d deleted file mode 100644 index b5fb151..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_remap_cached.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_remap_cached.o: HAL/src/alt_remap_cached.c \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h system.h linker.h - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_remap_cached.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_remap_cached.o deleted file mode 100644 index e46c498..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_remap_cached.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_remap_uncached.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_remap_uncached.d deleted file mode 100644 index 0423405..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_remap_uncached.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_remap_uncached.o: HAL/src/alt_remap_uncached.c \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h system.h linker.h - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_remap_uncached.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_remap_uncached.o deleted file mode 100644 index 893ead6..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_remap_uncached.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_rename.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_rename.d deleted file mode 100644 index b7af4b2..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_rename.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_rename.o: HAL/src/alt_rename.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_rename.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_rename.o deleted file mode 100644 index 01058df..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_rename.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_sbrk.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_sbrk.d deleted file mode 100644 index a0771ae..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_sbrk.d +++ /dev/null @@ -1,19 +0,0 @@ -obj/HAL/src/alt_sbrk.o: HAL/src/alt_sbrk.c HAL/inc/os/alt_syscall.h \ - HAL/inc/sys/alt_irq.h HAL/inc/nios2.h HAL/inc/alt_types.h system.h \ - linker.h HAL/inc/sys/alt_stack.h system.h - -HAL/inc/os/alt_syscall.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_stack.h: - -system.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_sbrk.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_sbrk.o deleted file mode 100644 index 1636400..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_sbrk.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_settod.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_settod.d deleted file mode 100644 index 56718d5..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_settod.d +++ /dev/null @@ -1,17 +0,0 @@ -obj/HAL/src/alt_settod.o: HAL/src/alt_settod.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_settod.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_settod.o deleted file mode 100644 index 4bb81d0..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_settod.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_software_exception.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_software_exception.d deleted file mode 100644 index fab4023..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_software_exception.d +++ /dev/null @@ -1,6 +0,0 @@ -obj/HAL/src/alt_software_exception.o: HAL/src/alt_software_exception.S \ - system.h linker.h - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_software_exception.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_software_exception.o deleted file mode 100644 index f9e01c2..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_software_exception.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_stat.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_stat.d deleted file mode 100644 index 8a63c27..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_stat.d +++ /dev/null @@ -1,3 +0,0 @@ -obj/HAL/src/alt_stat.o: HAL/src/alt_stat.c HAL/inc/os/alt_syscall.h - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_stat.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_stat.o deleted file mode 100644 index 70cfe9f..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_stat.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_tick.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_tick.d deleted file mode 100644 index ddbb281..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_tick.d +++ /dev/null @@ -1,27 +0,0 @@ -obj/HAL/src/alt_tick.o: HAL/src/alt_tick.c HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h HAL/inc/alt_types.h system.h linker.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/os/alt_hooks.h \ - HAL/inc/alt_types.h - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_hooks.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_tick.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_tick.o deleted file mode 100644 index 66a74b0..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_tick.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_times.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_times.d deleted file mode 100644 index 4bad83d..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_times.d +++ /dev/null @@ -1,17 +0,0 @@ -obj/HAL/src/alt_times.o: HAL/src/alt_times.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_times.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_times.o deleted file mode 100644 index de730d4..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_times.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_uncached_free.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_uncached_free.d deleted file mode 100644 index d74ef4b..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_uncached_free.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_uncached_free.o: HAL/src/alt_uncached_free.c \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h system.h linker.h - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_uncached_free.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_uncached_free.o deleted file mode 100644 index a7c9902..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_uncached_free.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_uncached_malloc.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_uncached_malloc.d deleted file mode 100644 index 16799fb..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_uncached_malloc.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_uncached_malloc.o: HAL/src/alt_uncached_malloc.c \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h system.h linker.h - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_uncached_malloc.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_uncached_malloc.o deleted file mode 100644 index 1921159..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_uncached_malloc.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_unlink.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_unlink.d deleted file mode 100644 index 0205f86..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_unlink.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_unlink.o: HAL/src/alt_unlink.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_unlink.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_unlink.o deleted file mode 100644 index c21d281..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_unlink.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_usleep.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_usleep.d deleted file mode 100644 index b5eca45..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_usleep.d +++ /dev/null @@ -1,6 +0,0 @@ -obj/HAL/src/alt_usleep.o: HAL/src/alt_usleep.c \ - HAL/inc/priv/alt_busy_sleep.h HAL/inc/os/alt_syscall.h - -HAL/inc/priv/alt_busy_sleep.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_usleep.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_usleep.o deleted file mode 100644 index 4df2a79..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_usleep.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_wait.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_wait.d deleted file mode 100644 index f47f5df..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_wait.d +++ /dev/null @@ -1,8 +0,0 @@ -obj/HAL/src/alt_wait.o: HAL/src/alt_wait.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_wait.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_wait.o deleted file mode 100644 index bf409cf..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_wait.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_write.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_write.d deleted file mode 100644 index 2b54a68..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_write.d +++ /dev/null @@ -1,41 +0,0 @@ -obj/HAL/src/alt_write.o: HAL/src/alt_write.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h \ - HAL/inc/os/alt_syscall.h HAL/inc/sys/alt_log_printf.h system.h \ - HAL/inc/sys/alt_driver.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_syscall.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: - -HAL/inc/sys/alt_driver.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_write.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_write.o deleted file mode 100644 index b09418b..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/alt_write.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/altera_nios2_qsys_irq.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/altera_nios2_qsys_irq.d deleted file mode 100644 index 47bdd9c..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/altera_nios2_qsys_irq.d +++ /dev/null @@ -1,15 +0,0 @@ -obj/HAL/src/altera_nios2_qsys_irq.o: HAL/src/altera_nios2_qsys_irq.c \ - HAL/inc/sys/alt_irq.h HAL/inc/nios2.h HAL/inc/alt_types.h system.h \ - linker.h HAL/inc/altera_nios2_qsys_irq.h - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/altera_nios2_qsys_irq.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/altera_nios2_qsys_irq.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/altera_nios2_qsys_irq.o deleted file mode 100644 index b6621f5..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/altera_nios2_qsys_irq.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/crt0.d b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/crt0.d deleted file mode 100644 index 3af0bb0..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/crt0.d +++ /dev/null @@ -1,12 +0,0 @@ -obj/HAL/src/crt0.o: HAL/src/crt0.S system.h linker.h HAL/inc/nios2.h \ - HAL/inc/sys/alt_log_printf.h system.h - -system.h: - -linker.h: - -HAL/inc/nios2.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/crt0.o b/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/crt0.o deleted file mode 100644 index b55bc71..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/HAL/src/crt0.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/alt_sys_init.d b/software/qsys_tutorial_switchs18_bsp/obj/alt_sys_init.d deleted file mode 100644 index 2087a7a..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/alt_sys_init.d +++ /dev/null @@ -1,54 +0,0 @@ -obj/alt_sys_init.o: alt_sys_init.c system.h linker.h \ - HAL/inc/sys/alt_irq.h HAL/inc/nios2.h HAL/inc/alt_types.h system.h \ - HAL/inc/sys/alt_sys_init.h HAL/inc/altera_nios2_qsys_irq.h \ - drivers/inc/altera_avalon_jtag_uart.h HAL/inc/sys/alt_alarm.h \ - HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h \ - HAL/inc/sys/alt_warning.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_flag.h \ - drivers/inc/altera_avalon_jtag_uart_fd.h HAL/inc/sys/alt_dev.h \ - HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h - -system.h: - -linker.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -HAL/inc/sys/alt_sys_init.h: - -HAL/inc/altera_nios2_qsys_irq.h: - -drivers/inc/altera_avalon_jtag_uart.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_flag.h: - -drivers/inc/altera_avalon_jtag_uart_fd.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/alt_sys_init.o b/software/qsys_tutorial_switchs18_bsp/obj/alt_sys_init.o deleted file mode 100644 index 986ac14..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/alt_sys_init.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/drivers/src/altera_avalon_jtag_uart_fd.d b/software/qsys_tutorial_switchs18_bsp/obj/drivers/src/altera_avalon_jtag_uart_fd.d deleted file mode 100644 index b152697..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/drivers/src/altera_avalon_jtag_uart_fd.d +++ /dev/null @@ -1,48 +0,0 @@ -obj/drivers/src/altera_avalon_jtag_uart_fd.o: \ - drivers/src/altera_avalon_jtag_uart_fd.c HAL/inc/alt_types.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - drivers/inc/altera_avalon_jtag_uart.h HAL/inc/sys/alt_alarm.h \ - HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_alarm.h \ - HAL/inc/sys/alt_warning.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_flag.h \ - drivers/inc/altera_avalon_jtag_uart_fd.h HAL/inc/sys/alt_dev.h - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_flag.h: - -drivers/inc/altera_avalon_jtag_uart_fd.h: - -HAL/inc/sys/alt_dev.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/drivers/src/altera_avalon_jtag_uart_fd.o b/software/qsys_tutorial_switchs18_bsp/obj/drivers/src/altera_avalon_jtag_uart_fd.o deleted file mode 100644 index 8ff164b..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/drivers/src/altera_avalon_jtag_uart_fd.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/drivers/src/altera_avalon_jtag_uart_init.d b/software/qsys_tutorial_switchs18_bsp/obj/drivers/src/altera_avalon_jtag_uart_init.d deleted file mode 100644 index f9460a1..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/drivers/src/altera_avalon_jtag_uart_init.d +++ /dev/null @@ -1,66 +0,0 @@ -obj/drivers/src/altera_avalon_jtag_uart_init.o: \ - drivers/src/altera_avalon_jtag_uart_init.c HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h HAL/inc/alt_types.h system.h linker.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/sys/ioctl.h \ - HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart_regs.h \ - HAL/inc/io.h HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_warning.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_flag.h \ - drivers/inc/altera_avalon_jtag_uart_fd.h HAL/inc/sys/alt_dev.h \ - HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/sys/alt_log_printf.h system.h - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/ioctl.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart_regs.h: - -HAL/inc/io.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_flag.h: - -drivers/inc/altera_avalon_jtag_uart_fd.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/drivers/src/altera_avalon_jtag_uart_init.o b/software/qsys_tutorial_switchs18_bsp/obj/drivers/src/altera_avalon_jtag_uart_init.o deleted file mode 100644 index c029c3c..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/drivers/src/altera_avalon_jtag_uart_init.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/drivers/src/altera_avalon_jtag_uart_ioctl.d b/software/qsys_tutorial_switchs18_bsp/obj/drivers/src/altera_avalon_jtag_uart_ioctl.d deleted file mode 100644 index d75a559..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/drivers/src/altera_avalon_jtag_uart_ioctl.d +++ /dev/null @@ -1,58 +0,0 @@ -obj/drivers/src/altera_avalon_jtag_uart_ioctl.o: \ - drivers/src/altera_avalon_jtag_uart_ioctl.c HAL/inc/sys/ioctl.h \ - HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart_regs.h \ - HAL/inc/io.h HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h \ - HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_flag.h \ - drivers/inc/altera_avalon_jtag_uart_fd.h HAL/inc/sys/alt_dev.h system.h \ - linker.h HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/sys/alt_log_printf.h system.h - -HAL/inc/sys/ioctl.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart_regs.h: - -HAL/inc/io.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_flag.h: - -drivers/inc/altera_avalon_jtag_uart_fd.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/drivers/src/altera_avalon_jtag_uart_ioctl.o b/software/qsys_tutorial_switchs18_bsp/obj/drivers/src/altera_avalon_jtag_uart_ioctl.o deleted file mode 100644 index 8999b64..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/drivers/src/altera_avalon_jtag_uart_ioctl.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/drivers/src/altera_avalon_jtag_uart_read.d b/software/qsys_tutorial_switchs18_bsp/obj/drivers/src/altera_avalon_jtag_uart_read.d deleted file mode 100644 index 9a4846a..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/drivers/src/altera_avalon_jtag_uart_read.d +++ /dev/null @@ -1,66 +0,0 @@ -obj/drivers/src/altera_avalon_jtag_uart_read.o: \ - drivers/src/altera_avalon_jtag_uart_read.c HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h HAL/inc/alt_types.h system.h linker.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/sys/ioctl.h \ - HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart_regs.h \ - HAL/inc/io.h HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_warning.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_flag.h \ - drivers/inc/altera_avalon_jtag_uart_fd.h HAL/inc/sys/alt_dev.h \ - HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/sys/alt_log_printf.h system.h - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/ioctl.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart_regs.h: - -HAL/inc/io.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_flag.h: - -drivers/inc/altera_avalon_jtag_uart_fd.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/drivers/src/altera_avalon_jtag_uart_read.o b/software/qsys_tutorial_switchs18_bsp/obj/drivers/src/altera_avalon_jtag_uart_read.o deleted file mode 100644 index ae790c0..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/drivers/src/altera_avalon_jtag_uart_read.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/obj/drivers/src/altera_avalon_jtag_uart_write.d b/software/qsys_tutorial_switchs18_bsp/obj/drivers/src/altera_avalon_jtag_uart_write.d deleted file mode 100644 index 5518b7f..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/drivers/src/altera_avalon_jtag_uart_write.d +++ /dev/null @@ -1,66 +0,0 @@ -obj/drivers/src/altera_avalon_jtag_uart_write.o: \ - drivers/src/altera_avalon_jtag_uart_write.c HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h HAL/inc/alt_types.h system.h linker.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/sys/ioctl.h \ - HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart_regs.h \ - HAL/inc/io.h HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_warning.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_flag.h \ - drivers/inc/altera_avalon_jtag_uart_fd.h HAL/inc/sys/alt_dev.h \ - HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/sys/alt_log_printf.h system.h - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/ioctl.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart_regs.h: - -HAL/inc/io.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_flag.h: - -drivers/inc/altera_avalon_jtag_uart_fd.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: diff --git a/software/qsys_tutorial_switchs18_bsp/obj/drivers/src/altera_avalon_jtag_uart_write.o b/software/qsys_tutorial_switchs18_bsp/obj/drivers/src/altera_avalon_jtag_uart_write.o deleted file mode 100644 index 1d981f7..0000000 --- a/software/qsys_tutorial_switchs18_bsp/obj/drivers/src/altera_avalon_jtag_uart_write.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_switchs18_bsp/public.mk b/software/qsys_tutorial_switchs18_bsp/public.mk deleted file mode 100644 index 5eb883d..0000000 --- a/software/qsys_tutorial_switchs18_bsp/public.mk +++ /dev/null @@ -1,385 +0,0 @@ -#------------------------------------------------------------------------------ -# BSP "PUBLIC" MAKEFILE CONTENT -# -# This file is intended to be included in an application or library -# Makefile that is using this BSP. You can create such a Makefile with -# the nios2-app-generate-makefile or nios2-lib-generate-makefile -# commands. -# -# The following variables must be defined before including this file: -# -# ALT_LIBRARY_ROOT_DIR -# Contains the path to the BSP top-level (aka root) directory -#------------------------------------------------------------------------------ - -#------------------------------------------------------------------------------ -# PATHS -#------------------------------------------------------------------------------ - - - -# Path to the provided linker script. -BSP_LINKER_SCRIPT := $(ALT_LIBRARY_ROOT_DIR)/linker.x - -# Include paths: -# The path to root of all header files that a library wishes to make -# available for an application's use is specified here. Note that this -# may not be *all* folders within a hierarchy. For example, if it is -# desired that the application developer type: -# #include -# #include -# With files laid out like this: -# /inc/sockets.h -# /inc/ip/tcpip.h -# -# Then, only /inc need be added to the list of include -# directories. Alternatively, if you wish to be able to directly include -# all files in a hierarchy, separate paths to each folder in that -# hierarchy must be defined. - -# The following are the "base" set of include paths for a BSP. -# These paths are appended to the list that individual software -# components, drivers, etc., add in the generated portion of this -# file (below). -ALT_INCLUDE_DIRS_TO_APPEND += \ - $(ALT_LIBRARY_ROOT_DIR) \ - $(ALT_LIBRARY_ROOT_DIR)/drivers/inc - -# Additions to linker library search-path: -# Here we provide a path to "our self" for the application to construct a -# "-L " out of. This should contain a list of directories, -# relative to the library root, of all directories with .a files to link -# against. -ALT_LIBRARY_DIRS += $(ALT_LIBRARY_ROOT_DIR) - - -#------------------------------------------------------------------------------ -# COMPILATION FLAGS -#------------------------------------------------------------------------------ -# Default C pre-processor flags for a BSP: -ALT_CPPFLAGS += -DSYSTEM_BUS_WIDTH=32 \ - -pipe - - -#------------------------------------------------------------------------------ -# MANAGED CONTENT -# -# All content between the lines "START MANAGED" and "END MANAGED" below is -# generated based on variables in the BSP settings file when the -# nios2-bsp-generate-files command is invoked. If you wish to persist any -# information pertaining to the build process, it is recomended that you -# utilize the BSP settings mechanism to do so. -#------------------------------------------------------------------------------ -#START MANAGED - -# The following TYPE comment allows tools to identify the 'type' of target this -# makefile is associated with. -# TYPE: BSP_PUBLIC_MAKEFILE - -# This following VERSION comment indicates the version of the tool used to -# generate this makefile. A makefile variable is provided for VERSION as well. -# ACDS_VERSION: 13.0sp1 -ACDS_VERSION := 13.0sp1 - -# This following BUILD_NUMBER comment indicates the build number of the tool -# used to generate this makefile. -# BUILD_NUMBER: 232 - -# Qsys--generated SOPCINFO file. Required for resolving node instance ID's with -# design component names. -SOPCINFO_FILE := C:/Users/takayun/Documents/DE2-115/qsys_tutorial/nios_system.sopcinfo - -# Big-Endian operation. -# setting BIG_ENDIAN is false -ALT_CFLAGS += -EL - -# Path to the provided C language runtime initialization code. -BSP_CRT0 := $(ALT_LIBRARY_ROOT_DIR)/obj/HAL/src/crt0.o - -# Name of BSP library as provided to linker using the "-msys-lib" flag or -# linker script GROUP command. -# setting BSP_SYS_LIB is hal_bsp -BSP_SYS_LIB := hal_bsp -ELF_PATCH_FLAG += --thread_model hal - -# Type identifier of the BSP library -# setting BSP_TYPE is hal -ALT_CPPFLAGS += -D__hal__ -BSP_TYPE := hal - -# CPU Name -# setting CPU_NAME is nios2_processor -CPU_NAME = nios2_processor -ELF_PATCH_FLAG += --cpu_name $(CPU_NAME) - -# Hardware Divider present. -# setting HARDWARE_DIVIDE is false -ALT_CFLAGS += -mno-hw-div - -# Hardware Multiplier present. -# setting HARDWARE_MULTIPLY is false -ALT_CFLAGS += -mno-hw-mul - -# Hardware Mulx present. -# setting HARDWARE_MULX is false -ALT_CFLAGS += -mno-hw-mulx - -# Debug Core present. -# setting HAS_DEBUG_CORE is true -CPU_HAS_DEBUG_CORE = 1 - -# Qsys generated design -# setting QSYS is 1 -QSYS := 1 -ELF_PATCH_FLAG += --qsys true - -# Design Name -# setting SOPC_NAME is nios_system -SOPC_NAME := nios_system - -# SopcBuilder Simulation Enabled -# setting SOPC_SIMULATION_ENABLED is false -ELF_PATCH_FLAG += --simulation_enabled false - -# Enable JTAG UART driver to recover when host is inactive causing buffer to -# full without returning error. Printf will not fail with this recovery. none -# setting altera_avalon_jtag_uart_driver.enable_jtag_uart_ignore_fifo_full_error is false - -# Small-footprint (polled mode) driver none -# setting altera_avalon_jtag_uart_driver.enable_small_driver is false - -# Build a custom version of newlib with the specified space-separated compiler -# flags. The custom newlib build will be placed in the <bsp root>/newlib -# directory, and will be used only for applications that utilize this BSP. -# setting hal.custom_newlib_flags is none - -# Enable support for a subset of the C++ language. This option increases code -# footprint by adding support for C++ constructors. Certain features, such as -# multiple inheritance and exceptions are not supported. If false, adds -# -DALT_NO_C_PLUS_PLUS to ALT_CPPFLAGS in public.mk, and reduces code -# footprint. none -# setting hal.enable_c_plus_plus is false -ALT_CPPFLAGS += -DALT_NO_C_PLUS_PLUS - -# When your application exits, close file descriptors, call C++ destructors, -# etc. Code footprint can be reduced by disabling clean exit. If disabled, adds -# -DALT_NO_CLEAN_EXIT to ALT_CPPFLAGS and -Wl,--defsym, exit=_exit to -# ALT_LDFLAGS in public.mk. none -# setting hal.enable_clean_exit is false -ALT_CPPFLAGS += -DALT_NO_CLEAN_EXIT -ALT_LDFLAGS += -Wl,--defsym,exit=_exit - -# Add exit() support. This option increases code footprint if your "main()" -# routine does "return" or call "exit()". If false, adds -DALT_NO_EXIT to -# ALT_CPPFLAGS in public.mk, and reduces footprint none -# setting hal.enable_exit is false -ALT_CPPFLAGS += -DALT_NO_EXIT - -# Causes code to be compiled with gprof profiling enabled and the application -# ELF to be linked with the GPROF library. If true, adds -DALT_PROVIDE_GMON to -# ALT_CPPFLAGS and -pg to ALT_CFLAGS in public.mk. none -# setting hal.enable_gprof is false - -# Enables lightweight device driver API. This reduces code and data footprint -# by removing the HAL layer that maps device names (e.g. /dev/uart0) to file -# descriptors. Instead, driver routines are called directly. The open(), -# close(), and lseek() routines will always fail if called. The read(), -# write(), fstat(), ioctl(), and isatty() routines only work for the stdio -# devices. If true, adds -DALT_USE_DIRECT_DRIVERS to ALT_CPPFLAGS in public.mk. -# The Altera Host and read-only ZIP file systems can't be used if -# hal.enable_lightweight_device_driver_api is true. -# setting hal.enable_lightweight_device_driver_api is true -ALT_CPPFLAGS += -DALT_USE_DIRECT_DRIVERS - -# Adds code to emulate multiply and divide instructions in case they are -# executed but aren't present in the CPU. Normally this isn't required because -# the compiler won't use multiply and divide instructions that aren't present -# in the CPU. If false, adds -DALT_NO_INSTRUCTION_EMULATION to ALT_CPPFLAGS in -# public.mk. none -# setting hal.enable_mul_div_emulation is false -ALT_CPPFLAGS += -DALT_NO_INSTRUCTION_EMULATION - -# Certain drivers are compiled with reduced functionality to reduce code -# footprint. Not all drivers observe this setting. The altera_avalon_uart and -# altera_avalon_jtag_uart drivers switch from interrupt-driven to polled -# operation. CAUTION: Several device drivers are disabled entirely. These -# include the altera_avalon_cfi_flash, altera_avalon_epcs_flash_controller, and -# altera_avalon_lcd_16207 drivers. This can result in certain API (HAL flash -# access routines) to fail. You can define a symbol provided by each driver to -# prevent it from being removed. If true, adds -DALT_USE_SMALL_DRIVERS to -# ALT_CPPFLAGS in public.mk. none -# setting hal.enable_reduced_device_drivers is true -ALT_CPPFLAGS += -DALT_USE_SMALL_DRIVERS - -# Turns on HAL runtime stack checking feature. Enabling this setting causes -# additional code to be placed into each subroutine call to generate an -# exception if a stack collision occurs with the heap or statically allocated -# data. If true, adds -DALT_STACK_CHECK and -mstack-check to ALT_CPPFLAGS in -# public.mk. none -# setting hal.enable_runtime_stack_checking is false - -# The BSP is compiled with optimizations to speedup HDL simulation such as -# initializing the cache, clearing the .bss section, and skipping long delay -# loops. If true, adds -DALT_SIM_OPTIMIZE to ALT_CPPFLAGS in public.mk. When -# this setting is true, the BSP shouldn't be used to build applications that -# are expected to run real hardware. -# setting hal.enable_sim_optimize is false - -# Causes the small newlib (C library) to be used. This reduces code and data -# footprint at the expense of reduced functionality. Several newlib features -# are removed such as floating-point support in printf(), stdin input routines, -# and buffered I/O. The small C library is not compatible with Micrium -# MicroC/OS-II. If true, adds -msmallc to ALT_LDFLAGS in public.mk. none -# setting hal.enable_small_c_library is true -ALT_LDFLAGS += -msmallc -ALT_CPPFLAGS += -DSMALL_C_LIB - -# Enable SOPC Builder System ID. If a System ID SOPC Builder component is -# connected to the CPU associated with this BSP, it will be enabled in the -# creation of command-line arguments to download an ELF to the target. -# Otherwise, system ID and timestamp values are left out of public.mk for -# application Makefile "download-elf" target definition. With the system ID -# check disabled, the Nios II EDS tools will not automatically ensure that the -# application .elf file (and BSP it is linked against) corresponds to the -# hardware design on the target. If false, adds --accept-bad-sysid to -# SOPC_SYSID_FLAG in public.mk. none -# setting hal.enable_sopc_sysid_check is true - -# Enable BSP generation to query if SOPC system is big endian. If true ignores -# export of 'ALT_CFLAGS += -EB' to public.mk if big endian system. If true -# ignores export of 'ALT_CFLAGS += -EL' if little endian system. none -# setting hal.make.ignore_system_derived.big_endian is false - -# Enable BSP generation to query if SOPC system has a debug core present. If -# true ignores export of 'CPU_HAS_DEBUG_CORE = 1' to public.mk if a debug core -# is found in the system. If true ignores export of 'CPU_HAS_DEBUG_CORE = 0' if -# no debug core is found in the system. none -# setting hal.make.ignore_system_derived.debug_core_present is false - -# Enable BSP generation to query if SOPC system has FPU present. If true -# ignores export of 'ALT_CFLAGS += -mhard-float' to public.mk if FPU is found -# in the system. If true ignores export of 'ALT_CFLAGS += -mhard-soft' if FPU -# is not found in the system. none -# setting hal.make.ignore_system_derived.fpu_present is false - -# Enable BSP generation to query if SOPC system has hardware divide present. If -# true ignores export of 'ALT_CFLAGS += -mno-hw-div' to public.mk if no -# division is found in system. If true ignores export of 'ALT_CFLAGS += -# -mhw-div' if division is found in the system. none -# setting hal.make.ignore_system_derived.hardware_divide_present is false - -# Enable BSP generation to query if SOPC system floating point custom -# instruction with a divider is present. If true ignores export of 'ALT_CFLAGS -# += -mcustom-fpu-cfg=60-2' and 'ALT_LDFLAGS += -mcustom-fpu-cfg=60-2' to -# public.mk if the custom instruction is found in the system. none -# setting hal.make.ignore_system_derived.hardware_fp_cust_inst_divider_present is false - -# Enable BSP generation to query if SOPC system floating point custom -# instruction without a divider is present. If true ignores export of -# 'ALT_CFLAGS += -mcustom-fpu-cfg=60-1' and 'ALT_LDFLAGS += -# -mcustom-fpu-cfg=60-1' to public.mk if the custom instruction is found in the -# system. none -# setting hal.make.ignore_system_derived.hardware_fp_cust_inst_no_divider_present is false - -# Enable BSP generation to query if SOPC system has multiplier present. If true -# ignores export of 'ALT_CFLAGS += -mno-hw-mul' to public.mk if no multiplier -# is found in the system. If true ignores export of 'ALT_CFLAGS += -mhw-mul' if -# multiplier is found in the system. none -# setting hal.make.ignore_system_derived.hardware_multiplier_present is false - -# Enable BSP generation to query if SOPC system has hardware mulx present. If -# true ignores export of 'ALT_CFLAGS += -mno-hw-mulx' to public.mk if no mulx -# is found in the system. If true ignores export of 'ALT_CFLAGS += -mhw-mulx' -# if mulx is found in the system. none -# setting hal.make.ignore_system_derived.hardware_mulx_present is false - -# Enable BSP generation to query if SOPC system has simulation enabled. If true -# ignores export of 'ELF_PATCH_FLAG += --simulation_enabled' to public.mk. none -# setting hal.make.ignore_system_derived.sopc_simulation_enabled is false - -# Enable BSP generation to query SOPC system for system ID base address. If -# true ignores export of 'SOPC_SYSID_FLAG += --sidp=
' and -# 'ELF_PATCH_FLAG += --sidp=
' to public.mk. none -# setting hal.make.ignore_system_derived.sopc_system_base_address is false - -# Enable BSP generation to query SOPC system for system ID. If true ignores -# export of 'SOPC_SYSID_FLAG += --id=' and 'ELF_PATCH_FLAG += -# --id=' to public.mk. none -# setting hal.make.ignore_system_derived.sopc_system_id is false - -# Enable BSP generation to query SOPC system for system timestamp. If true -# ignores export of 'SOPC_SYSID_FLAG += --timestamp=' and -# 'ELF_PATCH_FLAG += --timestamp=' to public.mk. none -# setting hal.make.ignore_system_derived.sopc_system_timestamp is false - -# Slave descriptor of STDERR character-mode device. This setting is used by the -# ALT_STDERR family of defines in system.h. none -# setting hal.stderr is jtag_uart -ELF_PATCH_FLAG += --stderr_dev jtag_uart - -# Slave descriptor of STDIN character-mode device. This setting is used by the -# ALT_STDIN family of defines in system.h. none -# setting hal.stdin is jtag_uart -ELF_PATCH_FLAG += --stdin_dev jtag_uart - -# Slave descriptor of STDOUT character-mode device. This setting is used by the -# ALT_STDOUT family of defines in system.h. none -# setting hal.stdout is jtag_uart -ELF_PATCH_FLAG += --stdout_dev jtag_uart - - -#------------------------------------------------------------------------------ -# SOFTWARE COMPONENT & DRIVER INCLUDE PATHS -#------------------------------------------------------------------------------ - -ALT_INCLUDE_DIRS += $(ALT_LIBRARY_ROOT_DIR)/HAL/inc - -#------------------------------------------------------------------------------ -# SOFTWARE COMPONENT & DRIVER PRODUCED ALT_CPPFLAGS ADDITIONS -#------------------------------------------------------------------------------ - -ALT_CPPFLAGS += -DALT_SINGLE_THREADED - -#END MANAGED - - -#------------------------------------------------------------------------------ -# LIBRARY INFORMATION -#------------------------------------------------------------------------------ -# Assemble the name of the BSP *.a file using the BSP library name -# (BSP_SYS_LIB) in generated content above. -BSP_LIB := lib$(BSP_SYS_LIB).a - -# Additional libraries to link against: -# An application including this file will prefix each library with "-l". -# For example, to include the Newlib math library "m" is included, which -# becomes "-lm" when linking the application. -ALT_LIBRARY_NAMES += m - -# Additions to linker dependencies: -# An application Makefile will typically add these directly to the list -# of dependencies required to build the executable target(s). The BSP -# library (*.a) file is specified here. -ALT_LDDEPS += $(ALT_LIBRARY_ROOT_DIR)/$(BSP_LIB) - -# Is this library "Makeable"? -# Add to list of root library directories that support running 'make' -# to build them. Because libraries may or may not have a Makefile in their -# root, appending to this variable tells an application to run 'make' in -# the library root to build/update this library. -MAKEABLE_LIBRARY_ROOT_DIRS += $(ALT_LIBRARY_ROOT_DIR) - -# Additional Assembler Flags -# -gdwarf2 flag is required for stepping through assembly code -ALT_ASFLAGS += -gdwarf2 - -#------------------------------------------------------------------------------ -# FINAL INCLUDE PATH LIST -#------------------------------------------------------------------------------ -# Append static include paths to paths specified by OS/driver/sw package -# additions to the BSP thus giving them precedence in case a BSP addition -# is attempting to override BSP sources. -ALT_INCLUDE_DIRS += $(ALT_INCLUDE_DIRS_TO_APPEND) - - - diff --git a/software/qsys_tutorial_switchs18_bsp/settings.bsp b/software/qsys_tutorial_switchs18_bsp/settings.bsp deleted file mode 100644 index 388f097..0000000 --- a/software/qsys_tutorial_switchs18_bsp/settings.bsp +++ /dev/null @@ -1,919 +0,0 @@ - - - hal - default - 2016/11/10 9:22:55 - 1478737375996 - C:\Users\takayun\Documents\DE2-115\qsys_tutorial\software\qsys_tutorial_switchs18_bsp - .\settings.bsp - C:\Users\takayun\Documents\DE2-115\qsys_tutorial\nios_system.sopcinfo - default - nios2_processor - 1.9 - - hal.sys_clk_timer - ALT_SYS_CLK - UnquotedString - none - none - system_h_define - Slave descriptor of the system clock timer device. This device provides a periodic interrupt ("tick") and is typically required for RTOS use. This setting defines the value of ALT_SYS_CLK in system.h. - none - false - common - - - hal.timestamp_timer - ALT_TIMESTAMP_CLK - UnquotedString - none - none - system_h_define - Slave descriptor of timestamp timer device. This device is used by Altera HAL timestamp drivers for high-resolution time measurement. This setting defines the value of ALT_TIMESTAMP_CLK in system.h. - none - false - common - - - hal.max_file_descriptors - ALT_MAX_FD - DecimalNumber - 4 - 32 - system_h_define - Determines the number of file descriptors statically allocated. This setting defines the value of ALT_MAX_FD in system.h. - If hal.enable_lightweight_device_driver_api is true, there are no file descriptors so this setting is ignored. If hal.enable_lightweight_device_driver_api is false, this setting must be at least 4 because HAL needs a file descriptor for /dev/null, /dev/stdin, /dev/stdout, and /dev/stderr. - false - - - - hal.enable_instruction_related_exceptions_api - ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API - BooleanDefineOnly - false - false - system_h_define - Enables API for registering handlers to service instruction-related exceptions. Enabling this setting increases the size of the exception entry code. - These exception types can be generated if various processor options are enabled, such as the MMU, MPU, or other advanced exception types. - false - - - - hal.linker.allow_code_at_reset - ALT_ALLOW_CODE_AT_RESET - Boolean - 1 - 0 - none - Indicates if initialization code is allowed at the reset address. If true, defines the macro ALT_ALLOW_CODE_AT_RESET in linker.h. - If true, defines the macro ALT_ALLOW_CODE_AT_RESET in linker.h. This setting is typically false if an external bootloader (e.g. flash bootloader) is present. - false - - - - hal.linker.enable_alt_load - NONE - Boolean - 1 - 0 - none - Enables the alt_load() facility. The alt_load() facility copies sections from the .text memory into RAM. If true, this setting sets up the VMA/LMA of sections in linker.x to allow them to be loaded into the .text memory. - This setting is typically false if an external bootloader (e.g. flash bootloader) is present. - false - - - - hal.linker.enable_alt_load_copy_rodata - NONE - Boolean - 0 - 0 - none - Causes the alt_load() facility to copy the .rodata section. If true, this setting defines the macro ALT_LOAD_COPY_RODATA in linker.h. - none - false - - - - hal.linker.enable_alt_load_copy_rwdata - NONE - Boolean - 1 - 0 - none - Causes the alt_load() facility to copy the .rwdata section. If true, this setting defines the macro ALT_LOAD_COPY_RWDATA in linker.h. - none - false - - - - hal.linker.enable_alt_load_copy_exceptions - NONE - Boolean - 0 - 0 - none - Causes the alt_load() facility to copy the .exceptions section. If true, this setting defines the macro ALT_LOAD_COPY_EXCEPTIONS in linker.h. - none - false - - - - hal.linker.enable_exception_stack - NONE - Boolean - 0 - 0 - none - Enables use of a separate exception stack. If true, defines the macro ALT_EXCEPTION_STACK in linker.h, adds a memory region called exception_stack to linker.x, and provides the symbols __alt_exception_stack_pointer and __alt_exception_stack_limit in linker.x. - The hal.linker.exception_stack_size and hal.linker.exception_stack_memory_region_name settings must also be valid. This setting must be false for MicroC/OS-II BSPs. The exception stack can be used to improve interrupt and other exception performance if the EIC is *not* used. - false - common - - - hal.linker.exception_stack_size - NONE - DecimalNumber - 1024 - 1024 - none - Size of the exception stack in bytes. - Only used if hal.linker.enable_exception_stack is true. - false - common - - - hal.linker.exception_stack_memory_region_name - NONE - UnquotedString - onchip_memory - none - none - Name of the existing memory region that will be divided up to create the 'exception_stack' memory region. The selected region name will be adjusted automatically when the BSP is generated to create the 'exception_stack' memory region. - Only used if hal.linker.enable_exception_stack is true. - false - common - - - hal.linker.enable_interrupt_stack - NONE - Boolean - 0 - 0 - none - Enables use of a separate interrupt stack. If true, defines the macro ALT_INTERRUPT_STACK in linker.h, adds a memory region called interrupt_stack to linker.x, and provides the symbols __alt_interrupt_stack_pointer and __alt_interrupt_stack_limit in linker.x. - The hal.linker.interrupt_stack_size and hal.linker.interrupt_stack_memory_region_name settings must also be valid. This setting must be false for MicroC/OS-II BSPs. Only enable if the EIC is used exclusively. The exception stack can be used to improve interrupt and other exception performance if the EIC is *not* used. - false - common - - - hal.linker.interrupt_stack_size - NONE - DecimalNumber - 1024 - 1024 - none - Size of the interrupt stack in bytes. - Only used if hal.linker.enable_interrupt_stack is true. - false - common - - - hal.linker.interrupt_stack_memory_region_name - NONE - UnquotedString - onchip_memory - none - none - Name of the existing memory region that will be divided up to create the 'interrupt_stack' memory region. The selected region name will be adjusted automatically when the BSP is generated to create the 'interrupt_stack' memory region. - Only used if hal.linker.enable_interrupt_stack is true. - false - common - - - hal.stdin - NONE - UnquotedString - jtag_uart - none - system_h_define - Slave descriptor of STDIN character-mode device. This setting is used by the ALT_STDIN family of defines in system.h. - none - false - common - - - hal.stdout - NONE - UnquotedString - jtag_uart - none - system_h_define - Slave descriptor of STDOUT character-mode device. This setting is used by the ALT_STDOUT family of defines in system.h. - none - false - common - - - hal.stderr - NONE - UnquotedString - jtag_uart - none - system_h_define - Slave descriptor of STDERR character-mode device. This setting is used by the ALT_STDERR family of defines in system.h. - none - false - common - - - hal.log_port - NONE - UnquotedString - none - none - public_mk_define - Slave descriptor of debug logging character-mode device. If defined, it enables extra debug messages in the HAL source. This setting is used by the ALT_LOG_PORT family of defines in system.h. - none - false - none - - - hal.make.build_pre_process - BUILD_PRE_PROCESS - UnquotedString - none - none - makefile_variable - Command executed before BSP built. - none - false - none - - - hal.make.ar_pre_process - AR_PRE_PROCESS - UnquotedString - none - none - makefile_variable - Command executed before archiver execution. - none - false - none - - - hal.make.bsp_cflags_defined_symbols - BSP_CFLAGS_DEFINED_SYMBOLS - UnquotedString - none - none - makefile_variable - Preprocessor macros to define. A macro definition in this setting has the same effect as a "#define" in source code. Adding "-DALT_DEBUG" to this setting has the same effect as "#define ALT_DEBUG" in a souce file. Adding "-DFOO=1" to this setting is equivalent to the macro "#define FOO 1" in a source file. Macros defined with this setting are applied to all .S, .c, and C++ files in the BSP. This setting defines the value of BSP_CFLAGS_DEFINED_SYMBOLS in the BSP Makefile. - none - false - none - - - hal.make.ar_post_process - AR_POST_PROCESS - UnquotedString - none - none - makefile_variable - Command executed after archiver execution. - none - false - none - - - hal.make.as - AS - UnquotedString - nios2-elf-gcc - nios2-elf-gcc - makefile_variable - Assembler command. Note that CC is used for .S files. - none - false - none - - - hal.make.build_post_process - BUILD_POST_PROCESS - UnquotedString - none - none - makefile_variable - Command executed after BSP built. - none - false - none - - - hal.make.bsp_cflags_debug - BSP_CFLAGS_DEBUG - UnquotedString - -g - -g - makefile_variable - C/C++ compiler debug level. '-g' provides the default set of debug symbols typically required to debug a typical application. Omitting '-g' removes debug symbols from the ELF. This setting defines the value of BSP_CFLAGS_DEBUG in Makefile. - none - false - common - - - hal.make.ar - AR - UnquotedString - nios2-elf-ar - nios2-elf-ar - makefile_variable - Archiver command. Creates library files. - none - false - none - - - hal.make.rm - RM - UnquotedString - rm -f - rm -f - makefile_variable - Command used to remove files during 'clean' target. - none - false - none - - - hal.make.cxx_pre_process - CXX_PRE_PROCESS - UnquotedString - none - none - makefile_variable - Command executed before each C++ file is compiled. - none - false - none - - - hal.make.bsp_cflags_warnings - BSP_CFLAGS_WARNINGS - UnquotedString - -Wall - -Wall - makefile_variable - C/C++ compiler warning level. "-Wall" is commonly used.This setting defines the value of BSP_CFLAGS_WARNINGS in Makefile. - none - false - none - - - hal.make.bsp_arflags - BSP_ARFLAGS - UnquotedString - -src - -src - makefile_variable - Custom flags only passed to the archiver. This content of this variable is directly passed to the archiver rather than the more standard "ARFLAGS". The reason for this is that GNU Make assumes some default content in ARFLAGS. This setting defines the value of BSP_ARFLAGS in Makefile. - none - false - none - - - hal.make.bsp_cflags_optimization - BSP_CFLAGS_OPTIMIZATION - UnquotedString - '-Os' - -O0 - makefile_variable - C/C++ compiler optimization level. "-O0" = no optimization,"-O2" = "normal" optimization, etc. "-O0" is recommended for code that you want to debug since compiler optimization can remove variables and produce non-sequential execution of code while debugging. This setting defines the value of BSP_CFLAGS_OPTIMIZATION in Makefile. - none - false - common - - - hal.make.as_post_process - AS_POST_PROCESS - UnquotedString - none - none - makefile_variable - Command executed after each assembly file is compiled. - none - false - none - - - hal.make.cc_pre_process - CC_PRE_PROCESS - UnquotedString - none - none - makefile_variable - Command executed before each .c/.S file is compiled. - none - false - none - - - hal.make.bsp_asflags - BSP_ASFLAGS - UnquotedString - -Wa,-gdwarf2 - -Wa,-gdwarf2 - makefile_variable - Custom flags only passed to the assembler. This setting defines the value of BSP_ASFLAGS in Makefile. - none - false - none - - - hal.make.as_pre_process - AS_PRE_PROCESS - UnquotedString - none - none - makefile_variable - Command executed before each assembly file is compiled. - none - false - none - - - hal.make.bsp_cflags_undefined_symbols - BSP_CFLAGS_UNDEFINED_SYMBOLS - UnquotedString - none - none - makefile_variable - Preprocessor macros to undefine. Undefined macros are similar to defined macros, but replicate the "#undef" directive in source code. To undefine the macro FOO use the syntax "-u FOO" in this setting. This is equivalent to "#undef FOO" in a source file. Note: the syntax differs from macro definition (there is a space, i.e. "-u FOO" versus "-DFOO"). Macros defined with this setting are applied to all .S, .c, and C++ files in the BSP. This setting defines the value of BSP_CFLAGS_UNDEFINED_SYMBOLS in the BSP Makefile. - none - false - none - - - hal.make.cc_post_process - CC_POST_PROCESS - UnquotedString - none - none - makefile_variable - Command executed after each .c/.S file is compiled. - none - false - none - - - hal.make.cxx_post_process - CXX_POST_PROCESS - UnquotedString - none - none - makefile_variable - Command executed before each C++ file is compiled. - none - false - none - - - hal.make.cc - CC - UnquotedString - nios2-elf-gcc -xc - nios2-elf-gcc -xc - makefile_variable - C compiler command. - none - false - none - - - hal.make.bsp_cxx_flags - BSP_CXXFLAGS - UnquotedString - none - none - makefile_variable - Custom flags only passed to the C++ compiler. This setting defines the value of BSP_CXXFLAGS in Makefile. - none - false - none - - - hal.make.bsp_inc_dirs - BSP_INC_DIRS - UnquotedString - none - none - makefile_variable - Space separated list of extra include directories to scan for header files. Directories are relative to the top-level BSP directory. The -I prefix's added by the makefile so don't add it here. This setting defines the value of BSP_INC_DIRS in Makefile. - none - false - none - - - hal.make.cxx - CXX - UnquotedString - nios2-elf-gcc -xc++ - nios2-elf-gcc -xc++ - makefile_variable - C++ compiler command. - none - false - none - - - hal.make.bsp_cflags_user_flags - BSP_CFLAGS_USER_FLAGS - UnquotedString - none - none - makefile_variable - Custom flags passed to the compiler when compiling C, C++, and .S files. This setting defines the value of BSP_CFLAGS_USER_FLAGS in Makefile. - none - false - none - - - hal.make.ignore_system_derived.sopc_system_id - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query SOPC system for system ID. If true ignores export of 'SOPC_SYSID_FLAG += --id=<sysid>' and 'ELF_PATCH_FLAG += --id=<sysid>' to public.mk. - none - false - none - - - hal.make.ignore_system_derived.sopc_system_timestamp - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query SOPC system for system timestamp. If true ignores export of 'SOPC_SYSID_FLAG += --timestamp=<timestamp>' and 'ELF_PATCH_FLAG += --timestamp=<timestamp>' to public.mk. - none - false - none - - - hal.make.ignore_system_derived.sopc_system_base_address - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query SOPC system for system ID base address. If true ignores export of 'SOPC_SYSID_FLAG += --sidp=<address>' and 'ELF_PATCH_FLAG += --sidp=<address>' to public.mk. - none - false - none - - - hal.make.ignore_system_derived.sopc_simulation_enabled - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system has simulation enabled. If true ignores export of 'ELF_PATCH_FLAG += --simulation_enabled' to public.mk. - none - false - none - - - hal.make.ignore_system_derived.fpu_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system has FPU present. If true ignores export of 'ALT_CFLAGS += -mhard-float' to public.mk if FPU is found in the system. If true ignores export of 'ALT_CFLAGS += -mhard-soft' if FPU is not found in the system. - none - false - none - - - hal.make.ignore_system_derived.hardware_multiplier_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system has multiplier present. If true ignores export of 'ALT_CFLAGS += -mno-hw-mul' to public.mk if no multiplier is found in the system. If true ignores export of 'ALT_CFLAGS += -mhw-mul' if multiplier is found in the system. - none - false - none - - - hal.make.ignore_system_derived.hardware_mulx_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system has hardware mulx present. If true ignores export of 'ALT_CFLAGS += -mno-hw-mulx' to public.mk if no mulx is found in the system. If true ignores export of 'ALT_CFLAGS += -mhw-mulx' if mulx is found in the system. - none - false - none - - - hal.make.ignore_system_derived.hardware_divide_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system has hardware divide present. If true ignores export of 'ALT_CFLAGS += -mno-hw-div' to public.mk if no division is found in system. If true ignores export of 'ALT_CFLAGS += -mhw-div' if division is found in the system. - none - false - none - - - hal.make.ignore_system_derived.debug_core_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system has a debug core present. If true ignores export of 'CPU_HAS_DEBUG_CORE = 1' to public.mk if a debug core is found in the system. If true ignores export of 'CPU_HAS_DEBUG_CORE = 0' if no debug core is found in the system. - none - false - none - - - hal.make.ignore_system_derived.big_endian - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system is big endian. If true ignores export of 'ALT_CFLAGS += -EB' to public.mk if big endian system. If true ignores export of 'ALT_CFLAGS += -EL' if little endian system. - none - false - none - - - hal.make.ignore_system_derived.hardware_fp_cust_inst_divider_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system floating point custom instruction with a divider is present. If true ignores export of 'ALT_CFLAGS += -mcustom-fpu-cfg=60-2' and 'ALT_LDFLAGS += -mcustom-fpu-cfg=60-2' to public.mk if the custom instruction is found in the system. - none - false - none - - - hal.make.ignore_system_derived.hardware_fp_cust_inst_no_divider_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system floating point custom instruction without a divider is present. If true ignores export of 'ALT_CFLAGS += -mcustom-fpu-cfg=60-1' and 'ALT_LDFLAGS += -mcustom-fpu-cfg=60-1' to public.mk if the custom instruction is found in the system. - none - false - none - - - hal.enable_exit - ALT_NO_EXIT - Boolean - 0 - 1 - public_mk_define - Add exit() support. This option increases code footprint if your "main()" routine does "return" or call "exit()". If false, adds -DALT_NO_EXIT to ALT_CPPFLAGS in public.mk, and reduces footprint - none - false - none - - - hal.enable_small_c_library - NONE - Boolean - 1 - 0 - public_mk_define - Causes the small newlib (C library) to be used. This reduces code and data footprint at the expense of reduced functionality. Several newlib features are removed such as floating-point support in printf(), stdin input routines, and buffered I/O. The small C library is not compatible with Micrium MicroC/OS-II. If true, adds -msmallc to ALT_LDFLAGS in public.mk. - none - false - common - - - hal.enable_clean_exit - ALT_NO_CLEAN_EXIT - Boolean - 0 - 1 - public_mk_define - When your application exits, close file descriptors, call C++ destructors, etc. Code footprint can be reduced by disabling clean exit. If disabled, adds -DALT_NO_CLEAN_EXIT to ALT_CPPFLAGS and -Wl,--defsym, exit=_exit to ALT_LDFLAGS in public.mk. - none - false - none - - - hal.enable_runtime_stack_checking - ALT_STACK_CHECK - Boolean - 0 - 0 - public_mk_define - Turns on HAL runtime stack checking feature. Enabling this setting causes additional code to be placed into each subroutine call to generate an exception if a stack collision occurs with the heap or statically allocated data. If true, adds -DALT_STACK_CHECK and -mstack-check to ALT_CPPFLAGS in public.mk. - none - false - none - - - hal.enable_gprof - ALT_PROVIDE_GMON - Boolean - 0 - 0 - public_mk_define - Causes code to be compiled with gprof profiling enabled and the application ELF to be linked with the GPROF library. If true, adds -DALT_PROVIDE_GMON to ALT_CPPFLAGS and -pg to ALT_CFLAGS in public.mk. - none - false - common - - - hal.enable_c_plus_plus - ALT_NO_C_PLUS_PLUS - Boolean - 0 - 1 - public_mk_define - Enable support for a subset of the C++ language. This option increases code footprint by adding support for C++ constructors. Certain features, such as multiple inheritance and exceptions are not supported. If false, adds -DALT_NO_C_PLUS_PLUS to ALT_CPPFLAGS in public.mk, and reduces code footprint. - none - false - none - - - hal.enable_reduced_device_drivers - ALT_USE_SMALL_DRIVERS - Boolean - 1 - 0 - public_mk_define - Certain drivers are compiled with reduced functionality to reduce code footprint. Not all drivers observe this setting. The altera_avalon_uart and altera_avalon_jtag_uart drivers switch from interrupt-driven to polled operation. CAUTION: Several device drivers are disabled entirely. These include the altera_avalon_cfi_flash, altera_avalon_epcs_flash_controller, and altera_avalon_lcd_16207 drivers. This can result in certain API (HAL flash access routines) to fail. You can define a symbol provided by each driver to prevent it from being removed. If true, adds -DALT_USE_SMALL_DRIVERS to ALT_CPPFLAGS in public.mk. - none - false - common - - - hal.enable_lightweight_device_driver_api - ALT_USE_DIRECT_DRIVERS - Boolean - 1 - 0 - public_mk_define - Enables lightweight device driver API. This reduces code and data footprint by removing the HAL layer that maps device names (e.g. /dev/uart0) to file descriptors. Instead, driver routines are called directly. The open(), close(), and lseek() routines will always fail if called. The read(), write(), fstat(), ioctl(), and isatty() routines only work for the stdio devices. If true, adds -DALT_USE_DIRECT_DRIVERS to ALT_CPPFLAGS in public.mk. - The Altera Host and read-only ZIP file systems can't be used if hal.enable_lightweight_device_driver_api is true. - false - none - - - hal.enable_mul_div_emulation - ALT_NO_INSTRUCTION_EMULATION - Boolean - 0 - 0 - public_mk_define - Adds code to emulate multiply and divide instructions in case they are executed but aren't present in the CPU. Normally this isn't required because the compiler won't use multiply and divide instructions that aren't present in the CPU. If false, adds -DALT_NO_INSTRUCTION_EMULATION to ALT_CPPFLAGS in public.mk. - none - false - none - - - hal.enable_sim_optimize - ALT_SIM_OPTIMIZE - Boolean - 0 - 0 - public_mk_define - The BSP is compiled with optimizations to speedup HDL simulation such as initializing the cache, clearing the .bss section, and skipping long delay loops. If true, adds -DALT_SIM_OPTIMIZE to ALT_CPPFLAGS in public.mk. - When this setting is true, the BSP shouldn't be used to build applications that are expected to run real hardware. - false - common - - - hal.enable_sopc_sysid_check - NONE - Boolean - 1 - 1 - public_mk_define - Enable SOPC Builder System ID. If a System ID SOPC Builder component is connected to the CPU associated with this BSP, it will be enabled in the creation of command-line arguments to download an ELF to the target. Otherwise, system ID and timestamp values are left out of public.mk for application Makefile "download-elf" target definition. With the system ID check disabled, the Nios II EDS tools will not automatically ensure that the application .elf file (and BSP it is linked against) corresponds to the hardware design on the target. If false, adds --accept-bad-sysid to SOPC_SYSID_FLAG in public.mk. - none - false - none - - - hal.custom_newlib_flags - CUSTOM_NEWLIB_FLAGS - UnquotedString - none - none - public_mk_define - Build a custom version of newlib with the specified space-separated compiler flags. - The custom newlib build will be placed in the &lt;bsp root>/newlib directory, and will be used only for applications that utilize this BSP. - false - none - - - hal.log_flags - ALT_LOG_FLAGS - DecimalNumber - 0 - 0 - public_mk_define - The value is assigned to ALT_LOG_FLAGS in the generated public.mk. See hal.log_port setting description. Values can be -1 through 3. - hal.log_port must be set for this to be used. - false - none - - - altera_avalon_jtag_uart_driver.enable_small_driver - ALTERA_AVALON_JTAG_UART_SMALL - BooleanDefineOnly - false - false - public_mk_define - Small-footprint (polled mode) driver - none - false - - - - altera_avalon_jtag_uart_driver.enable_jtag_uart_ignore_fifo_full_error - ALTERA_AVALON_JTAG_UART_IGNORE_FIFO_FULL_ERROR - BooleanDefineOnly - false - false - public_mk_define - Enable JTAG UART driver to recover when host is inactive causing buffer to full without returning error. Printf will not fail with this recovery. - none - false - - - - onchip_memory - 0x00000000 - 0x00000FFF - 4096 - memory - - - pio_0 - 0x00002000 - 0x0000200F - 16 - - - - LEDRs - 0x00002010 - 0x0000201F - 16 - - - - LEDs - 0x00002030 - 0x0000203F - 16 - - - - jtag_uart - 0x00002040 - 0x00002047 - 8 - printable - - - .text - onchip_memory - - - .rodata - onchip_memory - - - .rwdata - onchip_memory - - - .bss - onchip_memory - - - .heap - onchip_memory - - - .stack - onchip_memory - - \ No newline at end of file diff --git a/software/qsys_tutorial_switchs18_bsp/summary.html b/software/qsys_tutorial_switchs18_bsp/summary.html deleted file mode 100644 index 5179cda..0000000 --- a/software/qsys_tutorial_switchs18_bsp/summary.html +++ /dev/null @@ -1,2011 +0,0 @@ - -Altera Nios II BSP Summary - -

BSP Description

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
BSP Type:hal
SOPC Design File:C:\Users\takayun\Documents\DE2-115\qsys_tutorial\nios_system.sopcinfo
Quartus JDI File:default
CPU:nios2_processor
BSP Settings File:.\settings.bsp
BSP Version:default
BSP Generated On:2016/11/10 9:22:55
BSP Generated Timestamp:1478737375996
BSP Generated Location:C:\Users\takayun\Documents\DE2-115\qsys_tutorial\software\qsys_tutorial_switchs18_bsp
-
-

Nios II Memory Map

- - - - - - - - - - - - - - - - - - - -
Slave DescriptorAddress RangeSizeAttributes
jtag_uart0x00002040 - 0x000020478printable
LEDs0x00002030 - 0x0000203F16 
LEDRs0x00002010 - 0x0000201F16 
pio_00x00002000 - 0x0000200F16 
onchip_memory0x00000000 - 0x00000FFF4096memory
-
-
-

Linker Regions

- - - - -
RegionAddress RangeSizeMemoryOffset
-
-
-

Linker Section Mappings

- - - - - - - - - - - - - - - - - - - - - - -
SectionRegion
.textonchip_memory
.rodataonchip_memory
.rwdataonchip_memory
.bssonchip_memory
.heaponchip_memory
.stackonchip_memory
-

Settings

- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:altera_avalon_jtag_uart_driver.enable_jtag_uart_ignore_fifo_full_error
Identifier:ALTERA_AVALON_JTAG_UART_IGNORE_FIFO_FULL_ERROR
Default Value:false
Value:false
Type:BooleanDefineOnly
Destination:public_mk_define
Description:Enable JTAG UART driver to recover when host is inactive causing buffer to full without returning error. Printf will not fail with this recovery.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:altera_avalon_jtag_uart_driver.enable_small_driver
Identifier:ALTERA_AVALON_JTAG_UART_SMALL
Default Value:false
Value:false
Type:BooleanDefineOnly
Destination:public_mk_define
Description:Small-footprint (polled mode) driver
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.custom_newlib_flags
Identifier:CUSTOM_NEWLIB_FLAGS
Default Value:none
Value:none
Type:UnquotedString
Destination:public_mk_define
Description:Build a custom version of newlib with the specified space-separated compiler flags.
Restrictions:The custom newlib build will be placed in the &lt;bsp root>/newlib directory, and will be used only for applications that utilize this BSP.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_c_plus_plus
Identifier:ALT_NO_C_PLUS_PLUS
Default Value:1
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable support for a subset of the C++ language. This option increases code footprint by adding support for C++ constructors. Certain features, such as multiple inheritance and exceptions are not supported. If false, adds -DALT_NO_C_PLUS_PLUS to ALT_CPPFLAGS in public.mk, and reduces code footprint.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_clean_exit
Identifier:ALT_NO_CLEAN_EXIT
Default Value:1
Value:0
Type:Boolean
Destination:public_mk_define
Description:When your application exits, close file descriptors, call C++ destructors, etc. Code footprint can be reduced by disabling clean exit. If disabled, adds -DALT_NO_CLEAN_EXIT to ALT_CPPFLAGS and -Wl,--defsym, exit=_exit to ALT_LDFLAGS in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_exit
Identifier:ALT_NO_EXIT
Default Value:1
Value:0
Type:Boolean
Destination:public_mk_define
Description:Add exit() support. This option increases code footprint if your "main()" routine does "return" or call "exit()". If false, adds -DALT_NO_EXIT to ALT_CPPFLAGS in public.mk, and reduces footprint
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_gprof
Identifier:ALT_PROVIDE_GMON
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Causes code to be compiled with gprof profiling enabled and the application ELF to be linked with the GPROF library. If true, adds -DALT_PROVIDE_GMON to ALT_CPPFLAGS and -pg to ALT_CFLAGS in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_instruction_related_exceptions_api
Identifier:ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API
Default Value:false
Value:false
Type:BooleanDefineOnly
Destination:system_h_define
Description:Enables API for registering handlers to service instruction-related exceptions. Enabling this setting increases the size of the exception entry code.
Restrictions:These exception types can be generated if various processor options are enabled, such as the MMU, MPU, or other advanced exception types.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_lightweight_device_driver_api
Identifier:ALT_USE_DIRECT_DRIVERS
Default Value:0
Value:1
Type:Boolean
Destination:public_mk_define
Description:Enables lightweight device driver API. This reduces code and data footprint by removing the HAL layer that maps device names (e.g. /dev/uart0) to file descriptors. Instead, driver routines are called directly. The open(), close(), and lseek() routines will always fail if called. The read(), write(), fstat(), ioctl(), and isatty() routines only work for the stdio devices. If true, adds -DALT_USE_DIRECT_DRIVERS to ALT_CPPFLAGS in public.mk.
Restrictions:The Altera Host and read-only ZIP file systems can't be used if hal.enable_lightweight_device_driver_api is true.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_mul_div_emulation
Identifier:ALT_NO_INSTRUCTION_EMULATION
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Adds code to emulate multiply and divide instructions in case they are executed but aren't present in the CPU. Normally this isn't required because the compiler won't use multiply and divide instructions that aren't present in the CPU. If false, adds -DALT_NO_INSTRUCTION_EMULATION to ALT_CPPFLAGS in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_reduced_device_drivers
Identifier:ALT_USE_SMALL_DRIVERS
Default Value:0
Value:1
Type:Boolean
Destination:public_mk_define
Description:Certain drivers are compiled with reduced functionality to reduce code footprint. Not all drivers observe this setting. The altera_avalon_uart and altera_avalon_jtag_uart drivers switch from interrupt-driven to polled operation. CAUTION: Several device drivers are disabled entirely. These include the altera_avalon_cfi_flash, altera_avalon_epcs_flash_controller, and altera_avalon_lcd_16207 drivers. This can result in certain API (HAL flash access routines) to fail. You can define a symbol provided by each driver to prevent it from being removed. If true, adds -DALT_USE_SMALL_DRIVERS to ALT_CPPFLAGS in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_runtime_stack_checking
Identifier:ALT_STACK_CHECK
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Turns on HAL runtime stack checking feature. Enabling this setting causes additional code to be placed into each subroutine call to generate an exception if a stack collision occurs with the heap or statically allocated data. If true, adds -DALT_STACK_CHECK and -mstack-check to ALT_CPPFLAGS in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_sim_optimize
Identifier:ALT_SIM_OPTIMIZE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:The BSP is compiled with optimizations to speedup HDL simulation such as initializing the cache, clearing the .bss section, and skipping long delay loops. If true, adds -DALT_SIM_OPTIMIZE to ALT_CPPFLAGS in public.mk.
Restrictions:When this setting is true, the BSP shouldn't be used to build applications that are expected to run real hardware.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_small_c_library
Identifier:NONE
Default Value:0
Value:1
Type:Boolean
Destination:public_mk_define
Description:Causes the small newlib (C library) to be used. This reduces code and data footprint at the expense of reduced functionality. Several newlib features are removed such as floating-point support in printf(), stdin input routines, and buffered I/O. The small C library is not compatible with Micrium MicroC/OS-II. If true, adds -msmallc to ALT_LDFLAGS in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_sopc_sysid_check
Identifier:NONE
Default Value:1
Value:1
Type:Boolean
Destination:public_mk_define
Description:Enable SOPC Builder System ID. If a System ID SOPC Builder component is connected to the CPU associated with this BSP, it will be enabled in the creation of command-line arguments to download an ELF to the target. Otherwise, system ID and timestamp values are left out of public.mk for application Makefile "download-elf" target definition. With the system ID check disabled, the Nios II EDS tools will not automatically ensure that the application .elf file (and BSP it is linked against) corresponds to the hardware design on the target. If false, adds --accept-bad-sysid to SOPC_SYSID_FLAG in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.allow_code_at_reset
Identifier:ALT_ALLOW_CODE_AT_RESET
Default Value:0
Value:1
Type:Boolean
Destination:none
Description:Indicates if initialization code is allowed at the reset address. If true, defines the macro ALT_ALLOW_CODE_AT_RESET in linker.h.
Restrictions:If true, defines the macro ALT_ALLOW_CODE_AT_RESET in linker.h. This setting is typically false if an external bootloader (e.g. flash bootloader) is present.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.enable_alt_load
Identifier:NONE
Default Value:0
Value:1
Type:Boolean
Destination:none
Description:Enables the alt_load() facility. The alt_load() facility copies sections from the .text memory into RAM. If true, this setting sets up the VMA/LMA of sections in linker.x to allow them to be loaded into the .text memory.
Restrictions:This setting is typically false if an external bootloader (e.g. flash bootloader) is present.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.enable_alt_load_copy_exceptions
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:none
Description:Causes the alt_load() facility to copy the .exceptions section. If true, this setting defines the macro ALT_LOAD_COPY_EXCEPTIONS in linker.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.enable_alt_load_copy_rodata
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:none
Description:Causes the alt_load() facility to copy the .rodata section. If true, this setting defines the macro ALT_LOAD_COPY_RODATA in linker.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.enable_alt_load_copy_rwdata
Identifier:NONE
Default Value:0
Value:1
Type:Boolean
Destination:none
Description:Causes the alt_load() facility to copy the .rwdata section. If true, this setting defines the macro ALT_LOAD_COPY_RWDATA in linker.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.enable_exception_stack
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:none
Description:Enables use of a separate exception stack. If true, defines the macro ALT_EXCEPTION_STACK in linker.h, adds a memory region called exception_stack to linker.x, and provides the symbols __alt_exception_stack_pointer and __alt_exception_stack_limit in linker.x.
Restrictions:The hal.linker.exception_stack_size and hal.linker.exception_stack_memory_region_name settings must also be valid. This setting must be false for MicroC/OS-II BSPs. The exception stack can be used to improve interrupt and other exception performance if the EIC is *not* used.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.enable_interrupt_stack
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:none
Description:Enables use of a separate interrupt stack. If true, defines the macro ALT_INTERRUPT_STACK in linker.h, adds a memory region called interrupt_stack to linker.x, and provides the symbols __alt_interrupt_stack_pointer and __alt_interrupt_stack_limit in linker.x.
Restrictions:The hal.linker.interrupt_stack_size and hal.linker.interrupt_stack_memory_region_name settings must also be valid. This setting must be false for MicroC/OS-II BSPs. Only enable if the EIC is used exclusively. The exception stack can be used to improve interrupt and other exception performance if the EIC is *not* used.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.exception_stack_memory_region_name
Identifier:NONE
Default Value:none
Value:onchip_memory
Type:UnquotedString
Destination:none
Description:Name of the existing memory region that will be divided up to create the 'exception_stack' memory region. The selected region name will be adjusted automatically when the BSP is generated to create the 'exception_stack' memory region.
Restrictions:Only used if hal.linker.enable_exception_stack is true.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.exception_stack_size
Identifier:NONE
Default Value:1024
Value:1024
Type:DecimalNumber
Destination:none
Description:Size of the exception stack in bytes.
Restrictions:Only used if hal.linker.enable_exception_stack is true.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.interrupt_stack_memory_region_name
Identifier:NONE
Default Value:none
Value:onchip_memory
Type:UnquotedString
Destination:none
Description:Name of the existing memory region that will be divided up to create the 'interrupt_stack' memory region. The selected region name will be adjusted automatically when the BSP is generated to create the 'interrupt_stack' memory region.
Restrictions:Only used if hal.linker.enable_interrupt_stack is true.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.interrupt_stack_size
Identifier:NONE
Default Value:1024
Value:1024
Type:DecimalNumber
Destination:none
Description:Size of the interrupt stack in bytes.
Restrictions:Only used if hal.linker.enable_interrupt_stack is true.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.log_flags
Identifier:ALT_LOG_FLAGS
Default Value:0
Value:0
Type:DecimalNumber
Destination:public_mk_define
Description:The value is assigned to ALT_LOG_FLAGS in the generated public.mk. See hal.log_port setting description. Values can be -1 through 3.
Restrictions:hal.log_port must be set for this to be used.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.log_port
Identifier:NONE
Default Value:none
Value:none
Type:UnquotedString
Destination:public_mk_define
Description:Slave descriptor of debug logging character-mode device. If defined, it enables extra debug messages in the HAL source. This setting is used by the ALT_LOG_PORT family of defines in system.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ar
Identifier:AR
Default Value:nios2-elf-ar
Value:nios2-elf-ar
Type:UnquotedString
Destination:makefile_variable
Description:Archiver command. Creates library files.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ar_post_process
Identifier:AR_POST_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed after archiver execution.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ar_pre_process
Identifier:AR_PRE_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed before archiver execution.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.as
Identifier:AS
Default Value:nios2-elf-gcc
Value:nios2-elf-gcc
Type:UnquotedString
Destination:makefile_variable
Description:Assembler command. Note that CC is used for .S files.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.as_post_process
Identifier:AS_POST_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed after each assembly file is compiled.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.as_pre_process
Identifier:AS_PRE_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed before each assembly file is compiled.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_arflags
Identifier:BSP_ARFLAGS
Default Value:-src
Value:-src
Type:UnquotedString
Destination:makefile_variable
Description:Custom flags only passed to the archiver. This content of this variable is directly passed to the archiver rather than the more standard "ARFLAGS". The reason for this is that GNU Make assumes some default content in ARFLAGS. This setting defines the value of BSP_ARFLAGS in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_asflags
Identifier:BSP_ASFLAGS
Default Value:-Wa,-gdwarf2
Value:-Wa,-gdwarf2
Type:UnquotedString
Destination:makefile_variable
Description:Custom flags only passed to the assembler. This setting defines the value of BSP_ASFLAGS in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cflags_debug
Identifier:BSP_CFLAGS_DEBUG
Default Value:-g
Value:-g
Type:UnquotedString
Destination:makefile_variable
Description:C/C++ compiler debug level. '-g' provides the default set of debug symbols typically required to debug a typical application. Omitting '-g' removes debug symbols from the ELF. This setting defines the value of BSP_CFLAGS_DEBUG in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cflags_defined_symbols
Identifier:BSP_CFLAGS_DEFINED_SYMBOLS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Preprocessor macros to define. A macro definition in this setting has the same effect as a "#define" in source code. Adding "-DALT_DEBUG" to this setting has the same effect as "#define ALT_DEBUG" in a souce file. Adding "-DFOO=1" to this setting is equivalent to the macro "#define FOO 1" in a source file. Macros defined with this setting are applied to all .S, .c, and C++ files in the BSP. This setting defines the value of BSP_CFLAGS_DEFINED_SYMBOLS in the BSP Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cflags_optimization
Identifier:BSP_CFLAGS_OPTIMIZATION
Default Value:-O0
Value:'-Os'
Type:UnquotedString
Destination:makefile_variable
Description:C/C++ compiler optimization level. "-O0" = no optimization,"-O2" = "normal" optimization, etc. "-O0" is recommended for code that you want to debug since compiler optimization can remove variables and produce non-sequential execution of code while debugging. This setting defines the value of BSP_CFLAGS_OPTIMIZATION in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cflags_undefined_symbols
Identifier:BSP_CFLAGS_UNDEFINED_SYMBOLS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Preprocessor macros to undefine. Undefined macros are similar to defined macros, but replicate the "#undef" directive in source code. To undefine the macro FOO use the syntax "-u FOO" in this setting. This is equivalent to "#undef FOO" in a source file. Note: the syntax differs from macro definition (there is a space, i.e. "-u FOO" versus "-DFOO"). Macros defined with this setting are applied to all .S, .c, and C++ files in the BSP. This setting defines the value of BSP_CFLAGS_UNDEFINED_SYMBOLS in the BSP Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cflags_user_flags
Identifier:BSP_CFLAGS_USER_FLAGS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Custom flags passed to the compiler when compiling C, C++, and .S files. This setting defines the value of BSP_CFLAGS_USER_FLAGS in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cflags_warnings
Identifier:BSP_CFLAGS_WARNINGS
Default Value:-Wall
Value:-Wall
Type:UnquotedString
Destination:makefile_variable
Description:C/C++ compiler warning level. "-Wall" is commonly used.This setting defines the value of BSP_CFLAGS_WARNINGS in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cxx_flags
Identifier:BSP_CXXFLAGS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Custom flags only passed to the C++ compiler. This setting defines the value of BSP_CXXFLAGS in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_inc_dirs
Identifier:BSP_INC_DIRS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Space separated list of extra include directories to scan for header files. Directories are relative to the top-level BSP directory. The -I prefix's added by the makefile so don't add it here. This setting defines the value of BSP_INC_DIRS in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.build_post_process
Identifier:BUILD_POST_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed after BSP built.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.build_pre_process
Identifier:BUILD_PRE_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed before BSP built.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.cc
Identifier:CC
Default Value:nios2-elf-gcc -xc
Value:nios2-elf-gcc -xc
Type:UnquotedString
Destination:makefile_variable
Description:C compiler command.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.cc_post_process
Identifier:CC_POST_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed after each .c/.S file is compiled.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.cc_pre_process
Identifier:CC_PRE_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed before each .c/.S file is compiled.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.cxx
Identifier:CXX
Default Value:nios2-elf-gcc -xc++
Value:nios2-elf-gcc -xc++
Type:UnquotedString
Destination:makefile_variable
Description:C++ compiler command.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.cxx_post_process
Identifier:CXX_POST_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed before each C++ file is compiled.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.cxx_pre_process
Identifier:CXX_PRE_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed before each C++ file is compiled.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.big_endian
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system is big endian. If true ignores export of 'ALT_CFLAGS += -EB' to public.mk if big endian system. If true ignores export of 'ALT_CFLAGS += -EL' if little endian system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.debug_core_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system has a debug core present. If true ignores export of 'CPU_HAS_DEBUG_CORE = 1' to public.mk if a debug core is found in the system. If true ignores export of 'CPU_HAS_DEBUG_CORE = 0' if no debug core is found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.fpu_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system has FPU present. If true ignores export of 'ALT_CFLAGS += -mhard-float' to public.mk if FPU is found in the system. If true ignores export of 'ALT_CFLAGS += -mhard-soft' if FPU is not found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.hardware_divide_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system has hardware divide present. If true ignores export of 'ALT_CFLAGS += -mno-hw-div' to public.mk if no division is found in system. If true ignores export of 'ALT_CFLAGS += -mhw-div' if division is found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.hardware_fp_cust_inst_divider_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system floating point custom instruction with a divider is present. If true ignores export of 'ALT_CFLAGS += -mcustom-fpu-cfg=60-2' and 'ALT_LDFLAGS += -mcustom-fpu-cfg=60-2' to public.mk if the custom instruction is found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.hardware_fp_cust_inst_no_divider_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system floating point custom instruction without a divider is present. If true ignores export of 'ALT_CFLAGS += -mcustom-fpu-cfg=60-1' and 'ALT_LDFLAGS += -mcustom-fpu-cfg=60-1' to public.mk if the custom instruction is found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.hardware_multiplier_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system has multiplier present. If true ignores export of 'ALT_CFLAGS += -mno-hw-mul' to public.mk if no multiplier is found in the system. If true ignores export of 'ALT_CFLAGS += -mhw-mul' if multiplier is found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.hardware_mulx_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system has hardware mulx present. If true ignores export of 'ALT_CFLAGS += -mno-hw-mulx' to public.mk if no mulx is found in the system. If true ignores export of 'ALT_CFLAGS += -mhw-mulx' if mulx is found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.sopc_simulation_enabled
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system has simulation enabled. If true ignores export of 'ELF_PATCH_FLAG += --simulation_enabled' to public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.sopc_system_base_address
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query SOPC system for system ID base address. If true ignores export of 'SOPC_SYSID_FLAG += --sidp=<address>' and 'ELF_PATCH_FLAG += --sidp=<address>' to public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.sopc_system_id
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query SOPC system for system ID. If true ignores export of 'SOPC_SYSID_FLAG += --id=<sysid>' and 'ELF_PATCH_FLAG += --id=<sysid>' to public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.sopc_system_timestamp
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query SOPC system for system timestamp. If true ignores export of 'SOPC_SYSID_FLAG += --timestamp=<timestamp>' and 'ELF_PATCH_FLAG += --timestamp=<timestamp>' to public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.rm
Identifier:RM
Default Value:rm -f
Value:rm -f
Type:UnquotedString
Destination:makefile_variable
Description:Command used to remove files during 'clean' target.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.max_file_descriptors
Identifier:ALT_MAX_FD
Default Value:32
Value:4
Type:DecimalNumber
Destination:system_h_define
Description:Determines the number of file descriptors statically allocated. This setting defines the value of ALT_MAX_FD in system.h.
Restrictions:If hal.enable_lightweight_device_driver_api is true, there are no file descriptors so this setting is ignored. If hal.enable_lightweight_device_driver_api is false, this setting must be at least 4 because HAL needs a file descriptor for /dev/null, /dev/stdin, /dev/stdout, and /dev/stderr.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.stderr
Identifier:NONE
Default Value:none
Value:jtag_uart
Type:UnquotedString
Destination:system_h_define
Description:Slave descriptor of STDERR character-mode device. This setting is used by the ALT_STDERR family of defines in system.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.stdin
Identifier:NONE
Default Value:none
Value:jtag_uart
Type:UnquotedString
Destination:system_h_define
Description:Slave descriptor of STDIN character-mode device. This setting is used by the ALT_STDIN family of defines in system.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.stdout
Identifier:NONE
Default Value:none
Value:jtag_uart
Type:UnquotedString
Destination:system_h_define
Description:Slave descriptor of STDOUT character-mode device. This setting is used by the ALT_STDOUT family of defines in system.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.sys_clk_timer
Identifier:ALT_SYS_CLK
Default Value:none
Value:none
Type:UnquotedString
Destination:system_h_define
Description:Slave descriptor of the system clock timer device. This device provides a periodic interrupt ("tick") and is typically required for RTOS use. This setting defines the value of ALT_SYS_CLK in system.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.timestamp_timer
Identifier:ALT_TIMESTAMP_CLK
Default Value:none
Value:none
Type:UnquotedString
Destination:system_h_define
Description:Slave descriptor of timestamp timer device. This device is used by Altera HAL timestamp drivers for high-resolution time measurement. This setting defines the value of ALT_TIMESTAMP_CLK in system.h.
Restrictions:none
-
-
-
- - diff --git a/software/qsys_tutorial_switchs18_bsp/system.h b/software/qsys_tutorial_switchs18_bsp/system.h deleted file mode 100644 index da066c6..0000000 --- a/software/qsys_tutorial_switchs18_bsp/system.h +++ /dev/null @@ -1,305 +0,0 @@ -/* - * system.h - SOPC Builder system and BSP software package information - * - * Machine generated for CPU 'nios2_processor' in SOPC Builder design 'nios_system' - * SOPC Builder design path: C:/Users/takayun/Documents/DE2-115/qsys_tutorial/nios_system.sopcinfo - * - * Generated: Thu Nov 10 09:22:57 JST 2016 - */ - -/* - * DO NOT MODIFY THIS FILE - * - * Changing this file will have subtle consequences - * which will almost certainly lead to a nonfunctioning - * system. If you do modify this file, be aware that your - * changes will be overwritten and lost when this file - * is generated again. - * - * DO NOT MODIFY THIS FILE - */ - -/* - * License Agreement - * - * Copyright (c) 2008 - * Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - * - * This agreement shall be governed in all respects by the laws of the State - * of California and by the laws of the United States of America. - */ - -#ifndef __SYSTEM_H_ -#define __SYSTEM_H_ - -/* Include definitions from linker script generator */ -#include "linker.h" - - -/* - * CPU configuration - * - */ - -#define ALT_CPU_ARCHITECTURE "altera_nios2_qsys" -#define ALT_CPU_BIG_ENDIAN 0 -#define ALT_CPU_BREAK_ADDR 0x1820 -#define ALT_CPU_CPU_FREQ 50000000u -#define ALT_CPU_CPU_ID_SIZE 1 -#define ALT_CPU_CPU_ID_VALUE 0x00000000 -#define ALT_CPU_CPU_IMPLEMENTATION "tiny" -#define ALT_CPU_DATA_ADDR_WIDTH 0xe -#define ALT_CPU_DCACHE_LINE_SIZE 0 -#define ALT_CPU_DCACHE_LINE_SIZE_LOG2 0 -#define ALT_CPU_DCACHE_SIZE 0 -#define ALT_CPU_EXCEPTION_ADDR 0x20 -#define ALT_CPU_FLUSHDA_SUPPORTED -#define ALT_CPU_FREQ 50000000 -#define ALT_CPU_HARDWARE_DIVIDE_PRESENT 0 -#define ALT_CPU_HARDWARE_MULTIPLY_PRESENT 0 -#define ALT_CPU_HARDWARE_MULX_PRESENT 0 -#define ALT_CPU_HAS_DEBUG_CORE 1 -#define ALT_CPU_HAS_DEBUG_STUB -#define ALT_CPU_HAS_JMPI_INSTRUCTION -#define ALT_CPU_ICACHE_LINE_SIZE 0 -#define ALT_CPU_ICACHE_LINE_SIZE_LOG2 0 -#define ALT_CPU_ICACHE_SIZE 0 -#define ALT_CPU_INST_ADDR_WIDTH 0xd -#define ALT_CPU_NAME "nios2_processor" -#define ALT_CPU_RESET_ADDR 0x0 - - -/* - * CPU configuration (with legacy prefix - don't use these anymore) - * - */ - -#define NIOS2_BIG_ENDIAN 0 -#define NIOS2_BREAK_ADDR 0x1820 -#define NIOS2_CPU_FREQ 50000000u -#define NIOS2_CPU_ID_SIZE 1 -#define NIOS2_CPU_ID_VALUE 0x00000000 -#define NIOS2_CPU_IMPLEMENTATION "tiny" -#define NIOS2_DATA_ADDR_WIDTH 0xe -#define NIOS2_DCACHE_LINE_SIZE 0 -#define NIOS2_DCACHE_LINE_SIZE_LOG2 0 -#define NIOS2_DCACHE_SIZE 0 -#define NIOS2_EXCEPTION_ADDR 0x20 -#define NIOS2_FLUSHDA_SUPPORTED -#define NIOS2_HARDWARE_DIVIDE_PRESENT 0 -#define NIOS2_HARDWARE_MULTIPLY_PRESENT 0 -#define NIOS2_HARDWARE_MULX_PRESENT 0 -#define NIOS2_HAS_DEBUG_CORE 1 -#define NIOS2_HAS_DEBUG_STUB -#define NIOS2_HAS_JMPI_INSTRUCTION -#define NIOS2_ICACHE_LINE_SIZE 0 -#define NIOS2_ICACHE_LINE_SIZE_LOG2 0 -#define NIOS2_ICACHE_SIZE 0 -#define NIOS2_INST_ADDR_WIDTH 0xd -#define NIOS2_RESET_ADDR 0x0 - - -/* - * Define for each module class mastered by the CPU - * - */ - -#define __ALTERA_AVALON_JTAG_UART -#define __ALTERA_AVALON_ONCHIP_MEMORY2 -#define __ALTERA_AVALON_PIO -#define __ALTERA_NIOS2_QSYS - - -/* - * LEDRs configuration - * - */ - -#define ALT_MODULE_CLASS_LEDRs altera_avalon_pio -#define LEDRS_BASE 0x2010 -#define LEDRS_BIT_CLEARING_EDGE_REGISTER 0 -#define LEDRS_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define LEDRS_CAPTURE 0 -#define LEDRS_DATA_WIDTH 18 -#define LEDRS_DO_TEST_BENCH_WIRING 0 -#define LEDRS_DRIVEN_SIM_VALUE 0 -#define LEDRS_EDGE_TYPE "NONE" -#define LEDRS_FREQ 50000000 -#define LEDRS_HAS_IN 0 -#define LEDRS_HAS_OUT 1 -#define LEDRS_HAS_TRI 0 -#define LEDRS_IRQ -1 -#define LEDRS_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define LEDRS_IRQ_TYPE "NONE" -#define LEDRS_NAME "/dev/LEDRs" -#define LEDRS_RESET_VALUE 0 -#define LEDRS_SPAN 16 -#define LEDRS_TYPE "altera_avalon_pio" - - -/* - * LEDs configuration - * - */ - -#define ALT_MODULE_CLASS_LEDs altera_avalon_pio -#define LEDS_BASE 0x2030 -#define LEDS_BIT_CLEARING_EDGE_REGISTER 0 -#define LEDS_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define LEDS_CAPTURE 0 -#define LEDS_DATA_WIDTH 8 -#define LEDS_DO_TEST_BENCH_WIRING 0 -#define LEDS_DRIVEN_SIM_VALUE 0 -#define LEDS_EDGE_TYPE "NONE" -#define LEDS_FREQ 50000000 -#define LEDS_HAS_IN 0 -#define LEDS_HAS_OUT 1 -#define LEDS_HAS_TRI 0 -#define LEDS_IRQ -1 -#define LEDS_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define LEDS_IRQ_TYPE "NONE" -#define LEDS_NAME "/dev/LEDs" -#define LEDS_RESET_VALUE 0 -#define LEDS_SPAN 16 -#define LEDS_TYPE "altera_avalon_pio" - - -/* - * System configuration - * - */ - -#define ALT_DEVICE_FAMILY "Cyclone IV E" -#define ALT_ENHANCED_INTERRUPT_API_PRESENT -#define ALT_IRQ_BASE NULL -#define ALT_LOG_PORT "/dev/null" -#define ALT_LOG_PORT_BASE 0x0 -#define ALT_LOG_PORT_DEV null -#define ALT_LOG_PORT_TYPE "" -#define ALT_NUM_EXTERNAL_INTERRUPT_CONTROLLERS 0 -#define ALT_NUM_INTERNAL_INTERRUPT_CONTROLLERS 1 -#define ALT_NUM_INTERRUPT_CONTROLLERS 1 -#define ALT_STDERR "/dev/jtag_uart" -#define ALT_STDERR_BASE 0x2040 -#define ALT_STDERR_DEV jtag_uart -#define ALT_STDERR_IS_JTAG_UART -#define ALT_STDERR_PRESENT -#define ALT_STDERR_TYPE "altera_avalon_jtag_uart" -#define ALT_STDIN "/dev/jtag_uart" -#define ALT_STDIN_BASE 0x2040 -#define ALT_STDIN_DEV jtag_uart -#define ALT_STDIN_IS_JTAG_UART -#define ALT_STDIN_PRESENT -#define ALT_STDIN_TYPE "altera_avalon_jtag_uart" -#define ALT_STDOUT "/dev/jtag_uart" -#define ALT_STDOUT_BASE 0x2040 -#define ALT_STDOUT_DEV jtag_uart -#define ALT_STDOUT_IS_JTAG_UART -#define ALT_STDOUT_PRESENT -#define ALT_STDOUT_TYPE "altera_avalon_jtag_uart" -#define ALT_SYSTEM_NAME "nios_system" - - -/* - * hal configuration - * - */ - -#define ALT_MAX_FD 4 -#define ALT_SYS_CLK none -#define ALT_TIMESTAMP_CLK none - - -/* - * jtag_uart configuration - * - */ - -#define ALT_MODULE_CLASS_jtag_uart altera_avalon_jtag_uart -#define JTAG_UART_BASE 0x2040 -#define JTAG_UART_IRQ 5 -#define JTAG_UART_IRQ_INTERRUPT_CONTROLLER_ID 0 -#define JTAG_UART_NAME "/dev/jtag_uart" -#define JTAG_UART_READ_DEPTH 64 -#define JTAG_UART_READ_THRESHOLD 8 -#define JTAG_UART_SPAN 8 -#define JTAG_UART_TYPE "altera_avalon_jtag_uart" -#define JTAG_UART_WRITE_DEPTH 64 -#define JTAG_UART_WRITE_THRESHOLD 8 - - -/* - * onchip_memory configuration - * - */ - -#define ALT_MODULE_CLASS_onchip_memory altera_avalon_onchip_memory2 -#define ONCHIP_MEMORY_ALLOW_IN_SYSTEM_MEMORY_CONTENT_EDITOR 0 -#define ONCHIP_MEMORY_ALLOW_MRAM_SIM_CONTENTS_ONLY_FILE 0 -#define ONCHIP_MEMORY_BASE 0x0 -#define ONCHIP_MEMORY_CONTENTS_INFO "" -#define ONCHIP_MEMORY_DUAL_PORT 0 -#define ONCHIP_MEMORY_GUI_RAM_BLOCK_TYPE "AUTO" -#define ONCHIP_MEMORY_INIT_CONTENTS_FILE "nios_system_onchip_memory" -#define ONCHIP_MEMORY_INIT_MEM_CONTENT 1 -#define ONCHIP_MEMORY_INSTANCE_ID "NONE" -#define ONCHIP_MEMORY_IRQ -1 -#define ONCHIP_MEMORY_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define ONCHIP_MEMORY_NAME "/dev/onchip_memory" -#define ONCHIP_MEMORY_NON_DEFAULT_INIT_FILE_ENABLED 0 -#define ONCHIP_MEMORY_RAM_BLOCK_TYPE "AUTO" -#define ONCHIP_MEMORY_READ_DURING_WRITE_MODE "DONT_CARE" -#define ONCHIP_MEMORY_SINGLE_CLOCK_OP 0 -#define ONCHIP_MEMORY_SIZE_MULTIPLE 1 -#define ONCHIP_MEMORY_SIZE_VALUE 4096 -#define ONCHIP_MEMORY_SPAN 4096 -#define ONCHIP_MEMORY_TYPE "altera_avalon_onchip_memory2" -#define ONCHIP_MEMORY_WRITABLE 1 - - -/* - * pio_0 configuration - * - */ - -#define ALT_MODULE_CLASS_pio_0 altera_avalon_pio -#define PIO_0_BASE 0x2000 -#define PIO_0_BIT_CLEARING_EDGE_REGISTER 0 -#define PIO_0_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define PIO_0_CAPTURE 0 -#define PIO_0_DATA_WIDTH 18 -#define PIO_0_DO_TEST_BENCH_WIRING 0 -#define PIO_0_DRIVEN_SIM_VALUE 0 -#define PIO_0_EDGE_TYPE "NONE" -#define PIO_0_FREQ 50000000 -#define PIO_0_HAS_IN 1 -#define PIO_0_HAS_OUT 0 -#define PIO_0_HAS_TRI 0 -#define PIO_0_IRQ -1 -#define PIO_0_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define PIO_0_IRQ_TYPE "NONE" -#define PIO_0_NAME "/dev/pio_0" -#define PIO_0_RESET_VALUE 0 -#define PIO_0_SPAN 16 -#define PIO_0_TYPE "altera_avalon_pio" - -#endif /* __SYSTEM_H_ */ diff --git a/software/qsys_tutorial_test/.cproject b/software/qsys_tutorial_test/.cproject deleted file mode 100644 index 5951167..0000000 --- a/software/qsys_tutorial_test/.cproject +++ /dev/null @@ -1,508 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - make - - mem_init_install - true - false - false - - - make - - mem_init_generate - true - false - false - - - make - - help - true - false - false - - - - diff --git a/software/qsys_tutorial_test/.project b/software/qsys_tutorial_test/.project deleted file mode 100644 index d17b6f1..0000000 --- a/software/qsys_tutorial_test/.project +++ /dev/null @@ -1,96 +0,0 @@ - - - qsys_tutorial_test - - - - - - com.altera.sbtgui.project.makefileBuilder - - - - - com.altera.sbtgui.project.makefileBuilder - - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - ?name? - - - - org.eclipse.cdt.make.core.append_environment - true - - - org.eclipse.cdt.make.core.autoBuildTarget - all - - - org.eclipse.cdt.make.core.buildArguments - - - - org.eclipse.cdt.make.core.buildCommand - make - - - org.eclipse.cdt.make.core.buildLocation - ${workspace_loc://qsys_tutorial_test} - - - org.eclipse.cdt.make.core.cleanBuildTarget - clean - - - org.eclipse.cdt.make.core.contents - org.eclipse.cdt.make.core.activeConfigSettings - - - org.eclipse.cdt.make.core.enableAutoBuild - false - - - org.eclipse.cdt.make.core.enableCleanBuild - true - - - org.eclipse.cdt.make.core.enableFullBuild - true - - - org.eclipse.cdt.make.core.fullBuildTarget - all - - - org.eclipse.cdt.make.core.stopOnError - true - - - org.eclipse.cdt.make.core.useDefaultBuildCmd - true - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - org.eclipse.cdt.core.ccnature - com.altera.sbtgui.project.SBTGUINature - com.altera.sbtgui.project.SBTGUIAppNature - com.altera.sbtgui.project.SBTGUIManagedNature - - diff --git a/software/qsys_tutorial_test/Makefile b/software/qsys_tutorial_test/Makefile deleted file mode 100644 index 20e0317..0000000 --- a/software/qsys_tutorial_test/Makefile +++ /dev/null @@ -1,1086 +0,0 @@ -#------------------------------------------------------------------------------ -# VARIABLES APPENDED TO BY INCLUDED MAKEFILE FRAGMENTS -#------------------------------------------------------------------------------ - -# List of include directories for -I compiler option (-I added when used). -# Includes the BSP. -ALT_INCLUDE_DIRS := - -# List of library directories for -L linker option (-L added when used). -# Includes the BSP. -ALT_LIBRARY_DIRS := - -# List of library names for -l linker option (-l added when used). -# Includes the BSP. -ALT_LIBRARY_NAMES := - -# List of library names for -msys-lib linker option (-msys-lib added when used). -# These are libraries that might be located in the BSP and depend on the BSP -# library, or vice versa -ALT_BSP_DEP_LIBRARY_NAMES := - -# List of dependencies for the linker. This is usually the full pathname -# of each library (*.a) file. -# Includes the BSP. -ALT_LDDEPS := - -# List of root library directories that support running make to build them. -# Includes the BSP and any ALT libraries. -MAKEABLE_LIBRARY_ROOT_DIRS := - -# Generic flags passed to the compiler for different types of input files. -ALT_CFLAGS := -ALT_CXXFLAGS := -ALT_CPPFLAGS := -ALT_ASFLAGS := -ALT_LDFLAGS := - - -#------------------------------------------------------------------------------ -# The adjust-path macro -# -# If COMSPEC/ComSpec is defined, Make is launched from Windows through -# Cygwin. The adjust-path macro converts absolute windows paths into -# unix style paths (Example: c:/dir -> /c/dir). This will ensture -# paths are readable by GNU Make. -# -# If COMSPEC/ComSpec is not defined, Make is launched from linux, and no -# adjustment is necessary -# -#------------------------------------------------------------------------------ - -ifndef COMSPEC -ifdef ComSpec -COMSPEC = $(ComSpec) -endif # ComSpec -endif # COMSPEC - -ifdef COMSPEC # if Windows OS - -ifeq ($(MAKE_VERSION),3.81) -# -# adjust-path/adjust-path-mixed for Mingw Gnu Make on Windows -# -# Example Usage: -# $(call adjust-path,c:/aaa/bbb) => /c/aaa/bbb -# $(call adjust-path-mixed,/c/aaa/bbb) => c:/aaa/bbb -# $(call adjust-path-mixed,/cygdrive/c/aaa/bbb) => c:/aaa/bbb -# - -# -# adjust-path -# - converts back slash characters into forward slashes -# - if input arg ($1) is an empty string then return the empty string -# - if input arg ($1) does not contain the string ":/", then return input arg -# - using sed, convert mixed path [c:/...] into mingw path [/c/...] -define adjust-path -$(strip \ -$(if $1,\ -$(if $(findstring :/,$(subst \,/,$1)),\ -$(shell echo $(subst \,/,$1) | sed -e 's,^\([a-zA-Z]\):/,/\1/,'),\ -$(subst \,/,$1)))) -endef - -# -# adjust-path-mixed -# - converts back slash characters into forward slashes -# - if input arg ($1) is an empty string then return the empty string -# - if input arg ($1) does not begin with a forward slash '/' char, then -# return input arg -# - using sed, convert mingw path [/c/...] or cygwin path [/c/cygdrive/...] -# into a mixed path [c:/...] -define adjust-path-mixed -$(strip \ -$(if $1,\ -$(if $(findstring $(subst \,/,$1),$(patsubst /%,%,$(subst \,/,$1))),\ -$(subst \,/,$1),\ -$(shell echo $(subst \,/,$1) | sed -e 's,^/cygdrive/\([a-zA-Z]\)/,\1:/,' -e 's,^/\([a-zA-Z]\)/,\1:/,')))) -endef - -else # MAKE_VERSION != 3.81 (MAKE_VERSION == 3.80 or MAKE_VERSION == 3.79) -# -# adjust-path for Cygwin Gnu Make -# $(call adjust-path,c:/aaa/bbb) = /cygdrive/c/aaa/bbb -# $(call adjust-path-mixed,/cygdrive/c/aaa/bbb) = c:/aaa/bbb -# -adjust-path = $(if $1,$(shell cygpath -u "$1"),) -adjust-path-mixed = $(if $1,$(shell cygpath -m "$1"),) -endif - -else # !COMSPEC - -adjust-path = $1 -adjust-path-mixed = $1 - -endif # COMSPEC - - -#vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv -# GENERATED SETTINGS START v -#vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv - -#START GENERATED -ACTIVE_BUILD_CONFIG := default -BUILD_CONFIGS := default - -# The following TYPE comment allows tools to identify the 'type' of target this -# makefile is associated with. -# TYPE: APP_MAKEFILE - -# This following VERSION comment indicates the version of the tool used to -# generate this makefile. A makefile variable is provided for VERSION as well. -# ACDS_VERSION: 13.0sp1 -ACDS_VERSION := 13.0sp1 - -# This following BUILD_NUMBER comment indicates the build number of the tool -# used to generate this makefile. -# BUILD_NUMBER: 232 - -# Define path to the application ELF. -# It may be used by the makefile fragments so is defined before including them. -# -ELF := qsys_tutorial_test.elf - -# Paths to C, C++, and assembly source files. -C_SRCS := hello_world_small.c -CXX_SRCS := -ASM_SRCS := - - -# Path to root of object file tree. -OBJ_ROOT_DIR := obj - -# Options to control objdump. -CREATE_OBJDUMP := 1 -OBJDUMP_INCLUDE_SOURCE := 1 -OBJDUMP_FULL_CONTENTS := 0 - -# Options to enable/disable optional files. -CREATE_ELF_DERIVED_FILES := 0 -CREATE_LINKER_MAP := 1 - -# Common arguments for ALT_CFLAGSs -APP_CFLAGS_DEFINED_SYMBOLS := -APP_CFLAGS_UNDEFINED_SYMBOLS := -APP_CFLAGS_OPTIMIZATION := -Os -APP_CFLAGS_DEBUG_LEVEL := -g -APP_CFLAGS_WARNINGS := -Wall -APP_CFLAGS_USER_FLAGS := - -APP_ASFLAGS_USER := -APP_LDFLAGS_USER := - -# Linker options that have default values assigned later if not -# assigned here. -LINKER_SCRIPT := -CRT0 := -SYS_LIB := - -# Define path to the root of the BSP. -BSP_ROOT_DIR := ../qsys_tutorial_test_bsp/ - -# List of application specific include directories, library directories and library names -APP_INCLUDE_DIRS := -APP_LIBRARY_DIRS := -APP_LIBRARY_NAMES := - -# Pre- and post- processor settings. -BUILD_PRE_PROCESS := -BUILD_POST_PROCESS := - -QUARTUS_PROJECT_DIR := ../../ - - -#END GENERATED - -#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -# GENERATED SETTINGS END ^ -#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - -#------------------------------------------------------------------------------ -# DEFAULT TARGET -#------------------------------------------------------------------------------ - -# Define the variable used to echo output if not already defined. -ifeq ($(ECHO),) -ECHO := echo -endif - -# Put "all" rule before included makefile fragments because they may -# define rules and we don't want one of those to become the default rule. -.PHONY : all - -all: - @$(ECHO) [$(APP_NAME) build complete] - -all : build_pre_process libs app build_post_process - - -#------------------------------------------------------------------------------ -# VARIABLES DEPENDENT ON GENERATED CONTENT -#------------------------------------------------------------------------------ - -# Define object file directory per build configuration -CONFIG_OBJ_DIR := $(OBJ_ROOT_DIR)/$(ACTIVE_BUILD_CONFIG) - -ifeq ($(BSP_ROOT_DIR),) -$(error Edit Makefile and provide a value for BSP_ROOT_DIR) -endif - -ifeq ($(wildcard $(BSP_ROOT_DIR)),) -$(error BSP directory does not exist: $(BSP_ROOT_DIR)) -endif - -# Define absolute path to the root of the BSP. -ABS_BSP_ROOT_DIR := $(call adjust-path-mixed,$(shell cd "$(BSP_ROOT_DIR)"; pwd)) - -# Include makefile fragments. Define variable ALT_LIBRARY_ROOT_DIR before -# including each makefile fragment so that it knows the path to itself. -BSP_INCLUDE_FILE := $(BSP_ROOT_DIR)/public.mk -ALT_LIBRARY_ROOT_DIR := $(BSP_ROOT_DIR) -include $(BSP_INCLUDE_FILE) -# C2H will need this to touch the BSP public.mk and avoid the sopc file -# out-of-date error during a BSP make -ABS_BSP_INCLUDE_FILE := $(ABS_BSP_ROOT_DIR)/public.mk - - -ifneq ($(WARNING.SMALL_STACK_SIZE),) -# This WARNING is here to protect you from unknowingly using a very small stack -# If the warning is set, increase your stack size or enable the BSP small stack -# setting to eliminate the warning -$(warning WARNING: $(WARNING.SMALL_STACK_SIZE)) -endif - - -# If the BSP public.mk indicates that ALT_SIM_OPTIMIZE is set, rename the ELF -# by prefixing it with RUN_ON_HDL_SIMULATOR_ONLY_. -ifneq ($(filter -DALT_SIM_OPTIMIZE,$(ALT_CPPFLAGS)),) -ELF := RUN_ON_HDL_SIMULATOR_ONLY_$(ELF) -endif - -# If the BSP public.mk indicates that ALT_PROVIDE_GMON is set, add option to -# download_elf target -ifneq ($(filter -DALT_PROVIDE_GMON,$(ALT_CPPFLAGS)),) -GMON_OUT_FILENAME := gmon.out -WRITE_GMON_OPTION := --write-gmon $(GMON_OUT_FILENAME) -endif - -# Name of ELF application. -APP_NAME := $(basename $(ELF)) - -# Set to defaults if variables not already defined in settings. -ifeq ($(LINKER_SCRIPT),) -LINKER_SCRIPT := $(BSP_LINKER_SCRIPT) -endif -ifeq ($(CRT0),) -CRT0 := $(BSP_CRT0) -endif -ifeq ($(SYS_LIB),) -SYS_LIB := $(BSP_SYS_LIB) -endif - -OBJDUMP_NAME := $(APP_NAME).objdump -OBJDUMP_FLAGS := --disassemble --syms --all-header -ifeq ($(OBJDUMP_INCLUDE_SOURCE),1) -OBJDUMP_FLAGS += --source -endif -ifeq ($(OBJDUMP_FULL_CONTENTS),1) -OBJDUMP_FLAGS += --full-contents -endif - -# Create list of linker dependencies (*.a files). -APP_LDDEPS := $(ALT_LDDEPS) $(LDDEPS) - -# Take lists and add required prefixes. -APP_INC_DIRS := $(addprefix -I, $(ALT_INCLUDE_DIRS) $(APP_INCLUDE_DIRS) $(INC_DIRS)) -ASM_INC_PREFIX := -Wa,-I -APP_ASM_INC_DIRS := $(addprefix $(ASM_INC_PREFIX), $(ALT_INCLUDE_DIRS) $(APP_INCLUDE_DIRS) $(INC_DIRS)) -APP_LIB_DIRS := $(addprefix -L, $(ALT_LIBRARY_DIRS) $(APP_LIBRARY_DIRS) $(LIB_DIRS)) -APP_LIBS := $(addprefix -l, $(ALT_LIBRARY_NAMES) $(APP_LIBRARY_NAMES) $(LIBS)) - -ifneq ($(AVOID_NIOS2_GCC3_OPTIONS),) - -# -# Avoid Nios II GCC 3.X options. -# - -# Detect if small newlib C library is requested. -# If yes, remove the -msmallc option because it is -# now handled by other means. -ifneq ($(filter -msmallc,$(ALT_LDFLAGS)),) - ALT_LDFLAGS := $(filter-out -msmallc,$(ALT_LDFLAGS)) - ALT_C_LIBRARY := smallc -else - ALT_C_LIBRARY := c -endif - -# Put each BSP dependent library in a group to avoid circular dependencies. -APP_BSP_DEP_LIBS := $(foreach l,$(ALT_BSP_DEP_LIBRARY_NAMES),-Wl,--start-group -l$(ALT_C_LIBRARY) -lgcc -l$(l) -Wl,--end-group) - -else # !AVOID_NIOS2_GCC3_OPTIONS - -# -# Use Nios II GCC 3.X options. -# -APP_BSP_DEP_LIBS := $(addprefix -msys-lib=, $(ALT_BSP_DEP_LIBRARY_NAMES)) - -endif # !AVOID_NIOS2_GCC3_OPTIONS - -# Arguments for the C preprocessor, C/C++ compiler, assembler, and linker. -APP_CFLAGS := $(APP_CFLAGS_DEFINED_SYMBOLS) \ - $(APP_CFLAGS_UNDEFINED_SYMBOLS) \ - $(APP_CFLAGS_OPTIMIZATION) \ - $(APP_CFLAGS_DEBUG_LEVEL) \ - $(APP_CFLAGS_WARNINGS) \ - $(APP_CFLAGS_USER_FLAGS) \ - $(ALT_CFLAGS) \ - $(CFLAGS) - -# Arguments only for the C++ compiler. -APP_CXXFLAGS := $(ALT_CXXFLAGS) $(CXXFLAGS) - -# Arguments only for the C preprocessor. -# Prefix each include directory with -I. -APP_CPPFLAGS := $(APP_INC_DIRS) \ - $(ALT_CPPFLAGS) \ - $(CPPFLAGS) - -# Arguments only for the assembler. -APP_ASFLAGS := $(APP_ASM_INC_DIRS) \ - $(ALT_ASFLAGS) \ - $(APP_ASFLAGS_USER) \ - $(ASFLAGS) - -# Arguments only for the linker. -APP_LDFLAGS := $(APP_LDFLAGS_USER) - -ifneq ($(LINKER_SCRIPT),) -APP_LDFLAGS += -T'$(LINKER_SCRIPT)' -endif - -ifneq ($(AVOID_NIOS2_GCC3_OPTIONS),) - -# Avoid Nios II GCC 3.x options. -ifneq ($(CRT0),) -APP_LDFLAGS += $(CRT0) -endif - -# The equivalent of the -msys-lib option is provided -# by the GROUP() command in the linker script. -# Note this means the SYS_LIB variable is now ignored. - -else # !AVOID_NIOS2_GCC3_OPTIONS - -# Use Nios II GCC 3.x options. -ifneq ($(CRT0),) -APP_LDFLAGS += -msys-crt0='$(CRT0)' -endif -ifneq ($(SYS_LIB),) -APP_LDFLAGS += -msys-lib=$(SYS_LIB) -endif - -endif # !AVOID_NIOS2_GCC3_OPTIONS - -APP_LDFLAGS += \ - $(APP_LIB_DIRS) \ - $(ALT_LDFLAGS) \ - $(LDFLAGS) - -LINKER_MAP_NAME := $(APP_NAME).map -ifeq ($(CREATE_LINKER_MAP), 1) -APP_LDFLAGS += -Wl,-Map=$(LINKER_MAP_NAME) -endif - -# QUARTUS_PROJECT_DIR and SOPC_NAME need to be defined if you want the -# mem_init_install target of the mem_init.mk (located in the associated BSP) -# to know how to copy memory initialization files (e.g. .dat, .hex) into -# directories required for Quartus compilation or RTL simulation. - -# Defining QUARTUS_PROJECT_DIR causes mem_init_install to copy memory -# initialization files into your Quartus project directory. This is required -# to provide the initial memory contents of FPGA memories that can be -# initialized by the programming file (.sof) or Hardcopy ROMs. It is also used -# for VHDL simulation of on-chip memories. - -# Defining SOPC_NAME causes the mem_init_install target to copy memory -# initialization files into your RTL simulation directory. This is required -# to provide the initial memory contents of all memories that can be -# initialized by RTL simulation. This variable should be set to the same name -# as your SOPC Builder system name. For example, if you have a system called -# "foo.sopc", this variable should be set to "foo". - -# If SOPC_NAME is not set and QUARTUS_PROJECT_DIR is set, then derive SOPC_NAME. -ifeq ($(SOPC_NAME),) -ifneq ($(QUARTUS_PROJECT_DIR),) -SOPC_NAME := $(basename $(notdir $(wildcard $(QUARTUS_PROJECT_DIR)/*.sopcinfo))) -endif -endif - -# Defining JDI_FILE is required to specify the JTAG Debug Information File -# path. This file is generated by Quartus, and is needed along with the -# .sopcinfo file to resolve processor instance ID's from names in a multi-CPU -# systems. For multi-CPU systems, the processor instance ID is used to select -# from multiple CPU's during ELF download. - -# Both JDI_FILE and SOPCINFO_FILE are provided by the BSP if they found during -# BSP creation. If JDI_FILE is not set and QUARTUS_PROJECT_DIR is set, then -# derive JDI_FILE. We do not attempt to derive SOPCINFO_FILE since there may be -# multiple .sopcinfo files in a Quartus project. -ifeq ($(JDI_FILE),) -ifneq ($(QUARTUS_PROJECT_DIR),) -JDI_FILE := $(wildcard $(QUARTUS_PROJECT_DIR)/*.jdi) -endif -endif - -# Path to root runtime directory used for hdl simulation -RUNTIME_ROOT_DIR := $(CONFIG_OBJ_DIR)/runtime - - - -#------------------------------------------------------------------------------ -# MAKEFILE INCLUDES DEPENDENT ON GENERATED CONTENT -#------------------------------------------------------------------------------ -# mem_init.mk is a generated makefile fragment. This file defines all targets -# used to generate HDL initialization simulation files and pre-initialized -# onchip memory files. -MEM_INIT_FILE := $(BSP_ROOT_DIR)/mem_init.mk -include $(MEM_INIT_FILE) - -# Create list of object files to be built using the list of source files. -# The source file hierarchy is preserved in the object tree. -# The supported file extensions are: -# -# .c - for C files -# .cxx .cc .cpp - for C++ files -# .S .s - for assembler files -# -# Handle source files specified by --src-dir & --src-rdir differently, to -# save some processing time in calling the adjust-path macro. - -OBJ_LIST_C := $(patsubst %.c,%.o,$(filter %.c,$(C_SRCS))) -OBJ_LIST_CPP := $(patsubst %.cpp,%.o,$(filter %.cpp,$(CXX_SRCS))) -OBJ_LIST_CXX := $(patsubst %.cxx,%.o,$(filter %.cxx,$(CXX_SRCS))) -OBJ_LIST_CC := $(patsubst %.cc,%.o,$(filter %.cc,$(CXX_SRCS))) -OBJ_LIST_S := $(patsubst %.S,%.o,$(filter %.S,$(ASM_SRCS))) -OBJ_LIST_SS := $(patsubst %.s,%.o,$(filter %.s,$(ASM_SRCS))) - -OBJ_LIST := $(sort $(OBJ_LIST_C) $(OBJ_LIST_CPP) $(OBJ_LIST_CXX) \ - $(OBJ_LIST_CC) $(OBJ_LIST_S) $(OBJ_LIST_SS)) - -SDIR_OBJ_LIST_C := $(patsubst %.c,%.o,$(filter %.c,$(SDIR_C_SRCS))) -SDIR_OBJ_LIST_CPP := $(patsubst %.cpp,%.o,$(filter %.cpp,$(SDIR_CXX_SRCS))) -SDIR_OBJ_LIST_CXX := $(patsubst %.cxx,%.o,$(filter %.cxx,$(SDIR_CXX_SRCS))) -SDIR_OBJ_LIST_CC := $(patsubst %.cc,%.o,$(filter %.cc,$(SDIR_CXX_SRCS))) -SDIR_OBJ_LIST_S := $(patsubst %.S,%.o,$(filter %.S,$(SDIR_ASM_SRCS))) -SDIR_OBJ_LIST_SS := $(patsubst %.s,%.o,$(filter %.s,$(SDIR_ASM_SRCS))) - -SDIR_OBJ_LIST := $(sort $(SDIR_OBJ_LIST_C) $(SDIR_OBJ_LIST_CPP) \ - $(SDIR_OBJ_LIST_CXX) $(SDIR_OBJ_LIST_CC) $(SDIR_OBJ_LIST_S) \ - $(SDIR_OBJ_LIST_SS)) - -# Relative-pathed objects that being with "../" are handled differently. -# -# Regular objects are created as -# $(CONFIG_OBJ_DIR)//.o -# where the path structure is maintained under the obj directory. This -# applies for both absolute and relative paths; in the absolute path -# case this means the entire source path will be recreated under the obj -# directory. This is done to allow two source files with the same name -# to be included as part of the project. -# -# Note: On Cygwin, the path recreated under the obj directory will be -# the cygpath -u output path. -# -# Relative-path objects that begin with "../" cause problems under this -# scheme, as $(CONFIG_OBJ_DIR)/..// can potentially put the object -# files anywhere in the system, creating clutter and polluting the source tree. -# As such, their paths are flattened - the object file created will be -# $(CONFIG_OBJ_DIR)/.o. Due to this, two files specified with -# "../" in the beginning cannot have the same name in the project. VPATH -# will be set for these sources to allow make to relocate the source file -# via %.o rules. -# -# The following lines separate the object list into the flatten and regular -# lists, and then handles them as appropriate. - -FLATTEN_OBJ_LIST := $(filter ../%,$(OBJ_LIST)) -FLATTEN_APP_OBJS := $(addprefix $(CONFIG_OBJ_DIR)/,$(notdir $(FLATTEN_OBJ_LIST))) - -REGULAR_OBJ_LIST := $(filter-out $(FLATTEN_OBJ_LIST),$(OBJ_LIST)) -REGULAR_OBJ_LIST_C := $(filter $(OBJ_LIST_C),$(REGULAR_OBJ_LIST)) -REGULAR_OBJ_LIST_CPP := $(filter $(OBJ_LIST_CPP),$(REGULAR_OBJ_LIST)) -REGULAR_OBJ_LIST_CXX := $(filter $(OBJ_LIST_CXX),$(REGULAR_OBJ_LIST)) -REGULAR_OBJ_LIST_CC := $(filter $(OBJ_LIST_CC),$(REGULAR_OBJ_LIST)) -REGULAR_OBJ_LIST_S := $(filter $(OBJ_LIST_S),$(REGULAR_OBJ_LIST)) -REGULAR_OBJ_LIST_SS := $(filter $(OBJ_LIST_SS),$(REGULAR_OBJ_LIST)) - -FLATTEN_SDIR_OBJ_LIST := $(filter ../%,$(SDIR_OBJ_LIST)) -FLATTEN_SDIR_APP_OBJS := $(addprefix $(CONFIG_OBJ_DIR)/,$(notdir $(FLATTEN_SDIR_OBJ_LIST))) - -REGULAR_SDIR_OBJ_LIST := $(filter-out $(FLATTEN_SDIR_OBJ_LIST),$(SDIR_OBJ_LIST)) -REGULAR_SDIR_OBJ_LIST_C := $(filter $(SDIR_OBJ_LIST_C),$(REGULAR_SDIR_OBJ_LIST)) -REGULAR_SDIR_OBJ_LIST_CPP := $(filter $(SDIR_OBJ_LIST_CPP),$(REGULAR_SDIR_OBJ_LIST)) -REGULAR_SDIR_OBJ_LIST_CXX := $(filter $(SDIR_OBJ_LIST_CXX),$(REGULAR_SDIR_OBJ_LIST)) -REGULAR_SDIR_OBJ_LIST_CC := $(filter $(SDIR_OBJ_LIST_CC),$(REGULAR_SDIR_OBJ_LIST)) -REGULAR_SDIR_OBJ_LIST_S := $(filter $(SDIR_OBJ_LIST_S),$(REGULAR_SDIR_OBJ_LIST)) -REGULAR_SDIR_OBJ_LIST_SS := $(filter $(SDIR_OBJ_LIST_SS),$(REGULAR_SDIR_OBJ_LIST)) - -VPATH := $(sort $(dir $(FLATTEN_OBJ_LIST)) $(dir $(FLATTEN_SDIR_OBJ_LIST))) - -APP_OBJS_C := $(addprefix $(CONFIG_OBJ_DIR)/,\ - $(REGULAR_SDIR_OBJ_LIST_C) \ - $(foreach s,$(REGULAR_OBJ_LIST_C),$(call adjust-path,$s))) - -APP_OBJS_CPP := $(addprefix $(CONFIG_OBJ_DIR)/,\ - $(REGULAR_SDIR_OBJ_LIST_CPP) \ - $(foreach s,$(REGULAR_OBJ_LIST_CPP),$(call adjust-path,$s))) - -APP_OBJS_CXX := $(addprefix $(CONFIG_OBJ_DIR)/,\ - $(REGULAR_SDIR_OBJ_LIST_CXX) \ - $(foreach s,$(REGULAR_OBJ_LIST_CXX),$(call adjust-path,$s))) - -APP_OBJS_CC := $(addprefix $(CONFIG_OBJ_DIR)/,\ - $(REGULAR_SDIR_OBJ_LIST_CC) \ - $(foreach s,$(REGULAR_OBJ_LIST_CC),$(call adjust-path,$s))) - -APP_OBJS_S := $(addprefix $(CONFIG_OBJ_DIR)/,\ - $(REGULAR_SDIR_OBJ_LIST_S) \ - $(foreach s,$(REGULAR_OBJ_LIST_S),$(call adjust-path,$s))) - -APP_OBJS_SS := $(addprefix $(CONFIG_OBJ_DIR)/,\ - $(REGULAR_SDIR_OBJ_LIST_SS) \ - $(foreach s,$(REGULAR_OBJ_LIST_SS),$(call adjust-path,$s))) - -APP_OBJS := $(APP_OBJS_C) $(APP_OBJS_CPP) $(APP_OBJS_CXX) $(APP_OBJS_CC) \ - $(APP_OBJS_S) $(APP_OBJS_SS) \ - $(FLATTEN_APP_OBJS) $(FLATTEN_SDIR_APP_OBJS) - -# Add any extra user-provided object files. -APP_OBJS += $(OBJS) - -# Create list of dependancy files for each object file. -APP_DEPS := $(APP_OBJS:.o=.d) - -# Patch the Elf file with system specific information - -# Patch the Elf with the name of the sopc system -ifneq ($(SOPC_NAME),) -ELF_PATCH_FLAG += --sopc_system_name $(SOPC_NAME) -endif - -# Patch the Elf with the absolute path to the Quartus Project Directory -ifneq ($(QUARTUS_PROJECT_DIR),) -ABS_QUARTUS_PROJECT_DIR := $(call adjust-path-mixed,$(shell cd "$(QUARTUS_PROJECT_DIR)"; pwd)) -ELF_PATCH_FLAG += --quartus_project_dir "$(ABS_QUARTUS_PROJECT_DIR)" -endif - -# Patch the Elf and download args with the JDI_FILE if specified -ifneq ($(wildcard $(JDI_FILE)),) -ELF_PATCH_FLAG += --jdi $(JDI_FILE) -DOWNLOAD_JDI_FLAG := --jdi $(JDI_FILE) -endif - -# Patch the Elf with the SOPCINFO_FILE if specified -ifneq ($(wildcard $(SOPCINFO_FILE)),) -ELF_PATCH_FLAG += --sopcinfo $(SOPCINFO_FILE) -endif - -# Use the DOWNLOAD_CABLE variable to specify which JTAG cable to use. -# This is not needed if you only have one cable. -ifneq ($(DOWNLOAD_CABLE),) -DOWNLOAD_CABLE_FLAG := --cable '$(DOWNLOAD_CABLE)' -endif - - -#------------------------------------------------------------------------------ -# BUILD PRE/POST PROCESS -#------------------------------------------------------------------------------ -build_pre_process : - $(BUILD_PRE_PROCESS) - -build_post_process : - $(BUILD_POST_PROCESS) - -.PHONY: build_pre_process build_post_process - - -#------------------------------------------------------------------------------ -# TOOLS -#------------------------------------------------------------------------------ - -# -# Set tool default variables if not already defined. -# If these are defined, they would typically be defined in an -# included makefile fragment. -# -ifeq ($(DEFAULT_CROSS_COMPILE),) -DEFAULT_CROSS_COMPILE := nios2-elf- -endif - -ifeq ($(DEFAULT_STACK_REPORT),) -DEFAULT_STACKREPORT := nios2-stackreport -endif - -ifeq ($(DEFAULT_DOWNLOAD),) -DEFAULT_DOWNLOAD := nios2-download -endif - -ifeq ($(DEFAULT_FLASHPROG),) -DEFAULT_FLASHPROG := nios2-flash-programmer -endif - -ifeq ($(DEFAULT_ELFPATCH),) -DEFAULT_ELFPATCH := nios2-elf-insert -endif - -ifeq ($(DEFAULT_RM),) -DEFAULT_RM := rm -f -endif - -ifeq ($(DEFAULT_CP),) -DEFAULT_CP := cp -f -endif - -ifeq ($(DEFAULT_MKDIR),) -DEFAULT_MKDIR := mkdir -p -endif - -# -# Set tool variables to defaults if not already defined. -# If these are defined, they would typically be defined by a -# setting in the generated portion of this makefile. -# -ifeq ($(CROSS_COMPILE),) -CROSS_COMPILE := $(DEFAULT_CROSS_COMPILE) -endif - -ifeq ($(origin CC),default) -CC := $(CROSS_COMPILE)gcc -xc -endif - -ifeq ($(origin CXX),default) -CXX := $(CROSS_COMPILE)gcc -xc++ -endif - -ifeq ($(origin AS),default) -AS := $(CROSS_COMPILE)gcc -endif - -ifeq ($(origin AR),default) -AR := $(CROSS_COMPILE)ar -endif - -ifeq ($(origin LD),default) -LD := $(CROSS_COMPILE)g++ -endif - -ifeq ($(origin NM),default) -NM := $(CROSS_COMPILE)nm -endif - -ifeq ($(origin RM),default) -RM := $(DEFAULT_RM) -endif - -ifeq ($(origin CP),default) -CP := $(DEFAULT_CP) -endif - -ifeq ($(OBJDUMP),) -OBJDUMP := $(CROSS_COMPILE)objdump -endif - -ifeq ($(OBJCOPY),) -OBJCOPY := $(CROSS_COMPILE)objcopy -endif - -ifeq ($(STACKREPORT),) -ifeq ($(CROSS_COMPILE),nios2-elf-) -STACKREPORT := $(DEFAULT_STACKREPORT) -else -DISABLE_STACKREPORT := 1 -endif -endif - -ifeq ($(DOWNLOAD),) -DOWNLOAD := $(DEFAULT_DOWNLOAD) -endif - -ifeq ($(FLASHPROG),) -FLASHPROG := $(DEFAULT_FLASHPROG) -endif - -ifeq ($(ELFPATCH),) -ELFPATCH := $(DEFAULT_ELFPATCH) -endif - -ifeq ($(MKDIR),) -MKDIR := $(DEFAULT_MKDIR) -endif - -#------------------------------------------------------------------------------ -# PATTERN RULES TO BUILD OBJECTS -#------------------------------------------------------------------------------ - -define compile.c -@$(ECHO) Info: Compiling $< to $@ -@$(MKDIR) $(@D) -$(CC) -MP -MMD -c $(APP_CPPFLAGS) $(APP_CFLAGS) -o $@ $< -$(CC_POST_PROCESS) -endef - -define compile.cpp -@$(ECHO) Info: Compiling $< to $@ -@$(MKDIR) $(@D) -$(CXX) -MP -MMD -c $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< -$(CXX_POST_PROCESS) -endef - -# If assembling with the compiler, ensure "-Wa," is prepended to all APP_ASFLAGS -ifeq ($(AS),$(patsubst %as,%,$(AS))) -COMMA := , -APP_ASFLAGS := $(filter-out $(APP_CFLAGS),$(addprefix -Wa$(COMMA),$(patsubst -Wa$(COMMA)%,%,$(APP_ASFLAGS)))) -endif - -define compile.s -@$(ECHO) Info: Assembling $< to $@ -@$(MKDIR) $(@D) -$(AS) -MP -MMD -c $(APP_CPPFLAGS) $(APP_CFLAGS) $(APP_ASFLAGS) -o $@ $< -$(AS_POST_PROCESS) -endef - -ifeq ($(MAKE_VERSION),3.81) -.SECONDEXPANSION: - -$(APP_OBJS_C): $(CONFIG_OBJ_DIR)/%.o: $$(call adjust-path-mixed,%.c) - $(compile.c) - -$(APP_OBJS_CPP): $(CONFIG_OBJ_DIR)/%.o: $$(call adjust-path-mixed,%.cpp) - $(compile.cpp) - -$(APP_OBJS_CC): $(CONFIG_OBJ_DIR)/%.o: $$(call adjust-path-mixed,%.cc) - $(compile.cpp) - -$(APP_OBJS_CXX): $(CONFIG_OBJ_DIR)/%.o: $$(call adjust-path-mixed,%.cxx) - $(compile.cpp) - -$(APP_OBJS_S): $(CONFIG_OBJ_DIR)/%.o: $$(call adjust-path-mixed,%.S) - $(compile.s) - -$(APP_OBJS_SS): $(CONFIG_OBJ_DIR)/%.o: $$(call adjust-path-mixed,%.s) - $(compile.s) - -endif # MAKE_VERSION != 3.81 - -$(CONFIG_OBJ_DIR)/%.o: %.c - $(compile.c) - -$(CONFIG_OBJ_DIR)/%.o: %.cpp - $(compile.cpp) - -$(CONFIG_OBJ_DIR)/%.o: %.cc - $(compile.cpp) - -$(CONFIG_OBJ_DIR)/%.o: %.cxx - $(compile.cpp) - -$(CONFIG_OBJ_DIR)/%.o: %.S - $(compile.s) - -$(CONFIG_OBJ_DIR)/%.o: %.s - $(compile.s) - - -#------------------------------------------------------------------------------ -# PATTERN RULES TO INTERMEDIATE FILES -#------------------------------------------------------------------------------ - -$(CONFIG_OBJ_DIR)/%.s: %.c - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CC) -S $(APP_CPPFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.s: %.cpp - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CXX) -S $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.s: %.cc - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CXX) -S $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.s: %.cxx - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CXX) -S $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.i: %.c - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CC) -E $(APP_CPPFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.i: %.cpp - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CXX) -E $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.i: %.cc - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CXX) -E $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< - -$(CONFIG_OBJ_DIR)/%.i: %.cxx - @$(ECHO) Info: Compiling $< to $@ - @$(MKDIR) $(@D) - $(CXX) -E $(APP_CPPFLAGS) $(APP_CXXFLAGS) $(APP_CFLAGS) -o $@ $< - - -#------------------------------------------------------------------------------ -# TARGET RULES -#------------------------------------------------------------------------------ - -.PHONY : help -help : - @$(ECHO) "Summary of Makefile targets" - @$(ECHO) " Build targets:" - @$(ECHO) " all (default) - Application and all libraries (including BSP)" - @$(ECHO) " bsp - Just the BSP" - @$(ECHO) " libs - All libraries (including BSP)" - @$(ECHO) " flash - All flash files" - @$(ECHO) " mem_init_generate - All memory initialization files" -ifeq ($(QSYS),1) - @$(ECHO) " mem_init_install - This target is deprecated for QSys Systems" - @$(ECHO) " --> Use the mem_init_generate target and then" - @$(ECHO) " add the generated meminit.qip file to your" - @$(ECHO) " Quartus II Project." -else # if QSYS != 1 - @$(ECHO) " mem_init_install - Copy memory initialization files to Quartus II project" -endif # QSYS == 1 - @$(ECHO) - @$(ECHO) " Clean targets:" - @$(ECHO) " clean_all - Application and all libraries (including BSP)" - @$(ECHO) " clean - Just the application" - @$(ECHO) " clean_bsp - Just the BSP" - @$(ECHO) " clean_libs - All libraries (including BSP)" - @$(ECHO) - @$(ECHO) " Run targets:" - @$(ECHO) " download-elf - Download and run your elf executable" - @$(ECHO) " program-flash - Program flash contents to the board" - -# Handy rule to skip making libraries and just make application. -.PHONY : app -app : $(ELF) - -ifeq ($(CREATE_OBJDUMP), 1) -app : $(OBJDUMP_NAME) -endif - -ifeq ($(CREATE_ELF_DERIVED_FILES),1) -app : elf_derived_files -endif - -.PHONY: elf_derived_files -elf_derived_files: default_mem_init - -# Handy rule for making just the BSP. -.PHONY : bsp -bsp : - @$(ECHO) Info: Building $(BSP_ROOT_DIR) - @$(MAKE) --no-print-directory -C $(BSP_ROOT_DIR) - - -# Make sure all makeable libraries (including the BSP) are up-to-date. -LIB_TARGETS := $(patsubst %,%-recurs-make-lib,$(MAKEABLE_LIBRARY_ROOT_DIRS)) - -.PHONY : libs -libs : $(LIB_TARGETS) - -ifneq ($(strip $(LIB_TARGETS)),) -$(LIB_TARGETS): %-recurs-make-lib: - @$(ECHO) Info: Building $* - $(MAKE) --no-print-directory -C $* -endif - -ifneq ($(strip $(APP_LDDEPS)),) -$(APP_LDDEPS): libs - @true -endif - -# Rules to force your project to rebuild or relink -# .force_relink file will cause any application that depends on this project to relink -# .force_rebuild file will cause this project to rebuild object files -# .force_rebuild_all file will cause this project and any project that depends on this project to rebuild object files - -FORCE_RELINK_DEP := .force_relink -FORCE_REBUILD_DEP := .force_rebuild -FORCE_REBUILD_ALL_DEP := .force_rebuild_all -FORCE_REBUILD_DEP_LIST := $(CONFIG_OBJ_DIR)/$(FORCE_RELINK_DEP) $(CONFIG_OBJ_DIR)/$(FORCE_REBUILD_DEP) $(FORCE_REBUILD_ALL_DEP) - -$(FORCE_REBUILD_DEP_LIST): - -$(APP_OBJS): $(wildcard $(CONFIG_OBJ_DIR)/$(FORCE_REBUILD_DEP)) $(wildcard $(addsuffix /$(FORCE_REBUILD_ALL_DEP), . $(ALT_LIBRARY_DIRS))) - -$(ELF): $(wildcard $(addsuffix /$(FORCE_RELINK_DEP), $(CONFIG_OBJ_DIR) $(ALT_LIBRARY_DIRS))) - - -# Clean just the application. -.PHONY : clean -ifeq ($(CREATE_ELF_DERIVED_FILES),1) -clean : clean_elf_derived_files -endif - -clean : - @$(RM) -r $(ELF) $(OBJDUMP_NAME) $(LINKER_MAP_NAME) $(OBJ_ROOT_DIR) $(RUNTIME_ROOT_DIR) $(FORCE_REBUILD_DEP_LIST) - @$(ECHO) [$(APP_NAME) clean complete] - -# Clean just the BSP. -.PHONY : clean_bsp -clean_bsp : - @$(ECHO) Info: Cleaning $(BSP_ROOT_DIR) - @$(MAKE) --no-print-directory -C $(BSP_ROOT_DIR) clean - -# Clean all makeable libraries including the BSP. -LIB_CLEAN_TARGETS := $(patsubst %,%-recurs-make-clean-lib,$(MAKEABLE_LIBRARY_ROOT_DIRS)) - -.PHONY : clean_libs -clean_libs : $(LIB_CLEAN_TARGETS) - -ifneq ($(strip $(LIB_CLEAN_TARGETS)),) -$(LIB_CLEAN_TARGETS): %-recurs-make-clean-lib: - @$(ECHO) Info: Cleaning $* - $(MAKE) --no-print-directory -C $* clean -endif - -.PHONY: clean_elf_derived_files -clean_elf_derived_files: mem_init_clean - -# Clean application and all makeable libraries including the BSP. -.PHONY : clean_all -clean_all : clean mem_init_clean clean_libs - -# Include the dependency files unless the make goal is performing a clean -# of the application. -ifneq ($(firstword $(MAKECMDGOALS)),clean) -ifneq ($(firstword $(MAKECMDGOALS)),clean_all) --include $(APP_DEPS) -endif -endif - -.PHONY : download-elf -download-elf : $(ELF) - @if [ "$(DOWNLOAD)" = "none" ]; \ - then \ - $(ECHO) Downloading $(ELF) not supported; \ - else \ - $(ECHO) Info: Downloading $(ELF); \ - $(DOWNLOAD) --go --cpu_name=$(CPU_NAME) $(DOWNLOAD_CABLE_FLAG) $(SOPC_SYSID_FLAG) $(DOWNLOAD_JDI_FLAG) $(WRITE_GMON_OPTION) $(ELF); \ - fi - -# Delete the target of a rule if it has changed and its commands exit -# with a nonzero exit status. -.DELETE_ON_ERROR: - -# Rules for flash programming commands -PROGRAM_FLASH_SUFFIX := -program -PROGRAM_FLASH_TARGET := $(addsuffix $(PROGRAM_FLASH_SUFFIX), $(FLASH_FILES)) - -.PHONY : program-flash -program-flash : $(PROGRAM_FLASH_TARGET) - -.PHONY : $(PROGRAM_FLASH_TARGET) -$(PROGRAM_FLASH_TARGET) : flash - @if [ "$(FLASHPROG)" = "none" ]; \ - then \ - $(ECHO) Programming flash not supported; \ - else \ - $(ECHO) Info: Programming $(basename $@).flash; \ - if [ -z "$($(basename $@)_EPCS_FLAGS)" ]; \ - then \ - $(ECHO) $(FLASHPROG) $(SOPC_SYSID_FLAG) --base=$($(basename $@)_START) $(basename $@).flash; \ - $(FLASHPROG) $(DOWNLOAD_CABLE_FLAG) $(SOPC_SYSID_FLAG) --base=$($(basename $@)_START) $(basename $@).flash; \ - else \ - $(ECHO) $(FLASHPROG) $(SOPC_SYSID_FLAG) --epcs --base=$($(basename $@)_START) $(basename $@).flash; \ - $(FLASHPROG) $(DOWNLOAD_CABLE_FLAG) $(SOPC_SYSID_FLAG) --epcs --base=$($(basename $@)_START) $(basename $@).flash; \ - fi \ - fi - - -# Rules for simulating with an HDL Simulator [QSYS only] -ifeq ($(QSYS),1) -IP_MAKE_SIMSCRIPT := ip-make-simscript - -ifeq ($(VSIM),) -VSIM_EXE := "$(if $(VSIM_DIR),$(VSIM_DIR)/,)vsim" -ifeq ($(ENABLE_VSIM_GUI),1) -VSIM := $(VSIM_EXE) -gui -else -VSIM := $(VSIM_EXE) -c -endif # ENABLE_VSIM_GUI == 1 -endif # VSIM not set - -ifeq ($(SPD),) -ifneq ($(ABS_QUARTUS_PROJECT_DIR),) -ifneq ($(SOPC_NAME),) -SPD := $(ABS_QUARTUS_PROJECT_DIR)/$(SOPC_NAME)_tb.spd -endif # SOPC_NAME set -endif # ABS_QUARTUS_PROJECT_DIR set -endif # SPD == empty string - -ifeq ($(MSIM_SCRIPT),) -SIM_SCRIPT_DIR := $(RUNTIME_ROOT_DIR)/sim -MSIM_SCRIPT := $(SIM_SCRIPT_DIR)/mentor/msim_setup.tcl -endif # MSIM_SCRIPT == empty string - -ifeq ($(MAKE_VERSION),3.81) -ABS_MEM_INIT_DESCRIPTOR_FILE := $(abspath $(MEM_INIT_DESCRIPTOR_FILE)) -else -ABS_MEM_INIT_DESCRIPTOR_FILE := $(call adjust-path-mixed,$(shell pwd))/$(MEM_INIT_DESCRIPTOR_FILE) -endif - -$(MSIM_SCRIPT): $(SPD) $(MEM_INIT_DESCRIPTOR_FILE) -ifeq ($(SPD),) - $(error No SPD file specified. Ensure QUARTUS_PROJECT_DIR variable is set) -endif - @$(MKDIR) $(SIM_SCRIPT_DIR) - $(IP_MAKE_SIMSCRIPT) --spd=$(SPD) --spd=$(MEM_INIT_DESCRIPTOR_FILE) --output-directory=$(SIM_SCRIPT_DIR) - -VSIM_COMMAND = \ - cd $(dir $(MSIM_SCRIPT)) && \ - $(VSIM) -do "do $(notdir $(MSIM_SCRIPT)); ld; $(if $(VSIM_RUN_TIME),run ${VSIM_RUN_TIME};quit;)" - -.PHONY: sim -sim: $(MSIM_SCRIPT) mem_init_generate -ifeq ($(MSIM_SCRIPT),) - $(error MSIM_SCRIPT not set) -endif - $(VSIM_COMMAND) - -endif # QSYS == 1 - - -#------------------------------------------------------------------------------ -# ELF TARGET RULE -#------------------------------------------------------------------------------ -# Rule for constructing the executable elf file. -$(ELF) : $(APP_OBJS) $(LINKER_SCRIPT) $(APP_LDDEPS) - @$(ECHO) Info: Linking $@ - $(LD) $(APP_LDFLAGS) $(APP_CFLAGS) -o $@ $(filter-out $(CRT0),$(APP_OBJS)) $(APP_LIBS) $(APP_BSP_DEP_LIBS) -ifneq ($(DISABLE_ELFPATCH),1) - $(ELFPATCH) $@ $(ELF_PATCH_FLAG) -endif -ifneq ($(DISABLE_STACKREPORT),1) - @bash -c "$(STACKREPORT) $@" -endif - -$(OBJDUMP_NAME) : $(ELF) - @$(ECHO) Info: Creating $@ - $(OBJDUMP) $(OBJDUMP_FLAGS) $< >$@ - -# Rule for printing the name of the elf file -.PHONY: print-elf-name -print-elf-name: - @$(ECHO) $(ELF) - - diff --git a/software/qsys_tutorial_test/create-this-app b/software/qsys_tutorial_test/create-this-app deleted file mode 100644 index 2313cea..0000000 --- a/software/qsys_tutorial_test/create-this-app +++ /dev/null @@ -1,114 +0,0 @@ -#!/bin/bash -# -# This script creates the hello_world_small application in this directory. - - -BSP_DIR=../qsys_tutorial_test_bsp -QUARTUS_PROJECT_DIR=../../ -NIOS2_APP_GEN_ARGS="--elf-name qsys_tutorial_test.elf --set APP_CFLAGS_OPTIMIZATION -Os --set OBJDUMP_INCLUDE_SOURCE 1 --src-files hello_world_small.c" - - -# First, check to see if $SOPC_KIT_NIOS2 environmental variable is set. -# This variable is required for the command line tools to execute correctly. -if [ -z "${SOPC_KIT_NIOS2}" ] -then - echo Required \$SOPC_KIT_NIOS2 Environmental Variable is not set! - exit 1 -fi - - -# Also make sure that the APP has not been created already. Check for -# existence of Makefile in the app directory -if [ -f ./Makefile ] -then - echo Application has already been created! Delete Makefile if you want to create a new application makefile - exit 1 -fi - - -# We are selecting hal_reduced_footprint bsp because it supports this application. -# Check to see if the hal_reduced_footprint has already been generated by checking for -# existence of the public.mk file. If not, we need to run -# create-this-bsp file to generate the bsp. -if [ ! -f ${BSP_DIR}/public.mk ]; then - # Since BSP doesn't exist, create the BSP - # Pass any command line arguments passed to this script to the BSP. - pushd ${BSP_DIR} >> /dev/null - ./create-this-bsp "$@" || { - echo "create-this-bsp failed" - exit 1 - } - popd >> /dev/null -fi - - -# Don't run make if create-this-app script is called with --no-make arg -SKIP_MAKE= -while [ $# -gt 0 ] -do - case "$1" in - --no-make) - SKIP_MAKE=1 - ;; - esac - shift -done - - -# Now we also need to go copy the sources for this application to the -# local directory. -find "${SOPC_KIT_NIOS2}/examples/software/hello_world_small/" -name '*.c' -or -name '*.h' -or -name 'hostfs*' | xargs -i cp -L {} ./ || { - echo "failed during copying example source files" - exit 1 -} - -find "${SOPC_KIT_NIOS2}/examples/software/hello_world_small/" -name 'readme.txt' -or -name 'Readme.txt' | xargs -i cp -L {} ./ || { - echo "failed copying readme file" -} - -if [ -d "${SOPC_KIT_NIOS2}/examples/software/hello_world_small/system" ] -then - cp -RL "${SOPC_KIT_NIOS2}/examples/software/hello_world_small/system" . || { - echo "failed during copying project support files" - exit 1 - } -fi - -chmod -R +w . || { - echo "failed during changing file permissions" - exit 1 -} - -cmd="nios2-app-generate-makefile --bsp-dir ${BSP_DIR} --set QUARTUS_PROJECT_DIR=${QUARTUS_PROJECT_DIR} ${NIOS2_APP_GEN_ARGS}" - -echo "create-this-app: Running \"${cmd}\"" -$cmd || { - echo "nios2-app-generate-makefile failed" - exit 1 -} - -if [ -z "$SKIP_MAKE" ]; then - cmd="make" - - echo "create-this-app: Running \"$cmd\"" - $cmd || { - echo "make failed" - exit 1 - } - - echo - echo "To download and run the application:" - echo " 1. Make sure the board is connected to the system." - echo " 2. Run 'nios2-configure-sof ' to configure the FPGA with the hardware design." - echo " 3. If you have a stdio device, run 'nios2-terminal' in a different shell." - echo " 4. Run 'make download-elf' from the application directory." - echo - echo "To debug the application:" - echo " Import the project into Nios II Software Build Tools for Eclipse." - echo " Refer to Nios II Software Build Tools for Eclipse Documentation for more information." - echo - echo -e "" -fi - - -exit 0 diff --git a/software/qsys_tutorial_test/hello_world_small.c b/software/qsys_tutorial_test/hello_world_small.c deleted file mode 100644 index 6b48bb2..0000000 --- a/software/qsys_tutorial_test/hello_world_small.c +++ /dev/null @@ -1,110 +0,0 @@ -/* - * "Small Hello World" example. - * - * This example prints 'Hello from Nios II' to the STDOUT stream. It runs on - * the Nios II 'standard', 'full_featured', 'fast', and 'low_cost' example - * designs. It requires a STDOUT device in your system's hardware. - * - * The purpose of this example is to demonstrate the smallest possible Hello - * World application, using the Nios II HAL library. The memory footprint - * of this hosted application is ~332 bytes by default using the standard - * reference design. For a more fully featured Hello World application - * example, see the example titled "Hello World". - * - * The memory footprint of this example has been reduced by making the - * following changes to the normal "Hello World" example. - * Check in the Nios II Software Developers Manual for a more complete - * description. - * - * In the SW Application project (small_hello_world): - * - * - In the C/C++ Build page - * - * - Set the Optimization Level to -Os - * - * In System Library project (small_hello_world_syslib): - * - In the C/C++ Build page - * - * - Set the Optimization Level to -Os - * - * - Define the preprocessor option ALT_NO_INSTRUCTION_EMULATION - * This removes software exception handling, which means that you cannot - * run code compiled for Nios II cpu with a hardware multiplier on a core - * without a the multiply unit. Check the Nios II Software Developers - * Manual for more details. - * - * - In the System Library page: - * - Set Periodic system timer and Timestamp timer to none - * This prevents the automatic inclusion of the timer driver. - * - * - Set Max file descriptors to 4 - * This reduces the size of the file handle pool. - * - * - Check Main function does not exit - * - Uncheck Clean exit (flush buffers) - * This removes the unneeded call to exit when main returns, since it - * won't. - * - * - Check Don't use C++ - * This builds without the C++ support code. - * - * - Check Small C library - * This uses a reduced functionality C library, which lacks - * support for buffering, file IO, floating point and getch(), etc. - * Check the Nios II Software Developers Manual for a complete list. - * - * - Check Reduced device drivers - * This uses reduced functionality drivers if they're available. For the - * standard design this means you get polled UART and JTAG UART drivers, - * no support for the LCD driver and you lose the ability to program - * CFI compliant flash devices. - * - * - Check Access device drivers directly - * This bypasses the device file system to access device drivers directly. - * This eliminates the space required for the device file system services. - * It also provides a HAL version of libc services that access the drivers - * directly, further reducing space. Only a limited number of libc - * functions are available in this configuration. - * - * - Use ALT versions of stdio routines: - * - * Function Description - * =============== ===================================== - * alt_printf Only supports %s, %x, and %c ( < 1 Kbyte) - * alt_putstr Smaller overhead than puts with direct drivers - * Note this function doesn't add a newline. - * alt_putchar Smaller overhead than putchar with direct drivers - * alt_getchar Smaller overhead than getchar with direct drivers - * - */ - -#include "sys/alt_stdio.h" - -#if 0 -int main() -{ - alt_putstr("Hello from Nios II!\n"); - - /* Event loop never exits. */ - while (1); - - return 0; -} -#endif - -#define switches (volatile char *) 0x0002010 -#define leds (char *) 0x0002020 -void main() -{ - - int i = 0; - volatile int j = 0; - while(1){ - *leds = i++; - if (i > 256) i = 0; - for (j = 0; j < 100000; j++); - } - - //while (1) - //*leds = *switches; -} diff --git a/software/qsys_tutorial_test/obj/default/hello_world_small.d b/software/qsys_tutorial_test/obj/default/hello_world_small.d deleted file mode 100644 index 0b99155..0000000 --- a/software/qsys_tutorial_test/obj/default/hello_world_small.d +++ /dev/null @@ -1,4 +0,0 @@ -obj/default/hello_world_small.o: hello_world_small.c \ - ../qsys_tutorial_test_bsp//HAL/inc/sys/alt_stdio.h - -../qsys_tutorial_test_bsp//HAL/inc/sys/alt_stdio.h: diff --git a/software/qsys_tutorial_test/obj/default/hello_world_small.o b/software/qsys_tutorial_test/obj/default/hello_world_small.o deleted file mode 100644 index 540fd71..0000000 --- a/software/qsys_tutorial_test/obj/default/hello_world_small.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test/qsys_tutorial_test.elf b/software/qsys_tutorial_test/qsys_tutorial_test.elf deleted file mode 100644 index a5f4751..0000000 --- a/software/qsys_tutorial_test/qsys_tutorial_test.elf +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test/qsys_tutorial_test.map b/software/qsys_tutorial_test/qsys_tutorial_test.map deleted file mode 100644 index 7d3dcfa..0000000 --- a/software/qsys_tutorial_test/qsys_tutorial_test.map +++ /dev/null @@ -1,412 +0,0 @@ -Archive member included because of file (symbol) - -../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_load.o) - ../qsys_tutorial_test_bsp//obj/HAL/src/crt0.o (alt_load) -../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_main.o) - ../qsys_tutorial_test_bsp//obj/HAL/src/crt0.o (alt_main) -../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_sys_init.o) - ../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_main.o) (alt_sys_init) -../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - ../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_load.o) (alt_dcache_flush_all) -../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - ../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_load.o) (alt_icache_flush_all) -../qsys_tutorial_test_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - ../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_sys_init.o) (altera_nios2_qsys_irq_init) - -Memory Configuration - -Name Origin Length Attributes -reset 0x00000000 0x00000020 -onchip_memory 0x00000020 0x00000fe0 -*default* 0x00000000 0xffffffff - -Linker script and memory map - -LOAD ../qsys_tutorial_test_bsp//obj/HAL/src/crt0.o - 0x0000000c exit = _exit -LOAD obj/default/hello_world_small.o -LOAD c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libstdc++.a -LOAD c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libm.a -LOAD c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a -START GROUP -LOAD c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/lib/mno-hw-mul\libsmallc.a -LOAD c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a -LOAD ../qsys_tutorial_test_bsp/\libhal_bsp.a -END GROUP -LOAD c:/altera/13.0sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/mno-hw-mul\libgcc.a - 0x00000000 __alt_mem_onchip_memory = 0x0 - -.entry 0x00000000 0x20 - *(.entry) - .entry 0x00000000 0x20 ../qsys_tutorial_test_bsp//obj/HAL/src/crt0.o - 0x00000000 __reset - 0x0000000c _exit - -.exceptions 0x00000020 0x0 - 0x00000020 PROVIDE (__ram_exceptions_start, ABSOLUTE (.)) - 0x00000020 . = ALIGN (0x20) - *(.irq) - *(.exceptions.entry.label) - *(.exceptions.entry.user) - *(.exceptions.entry) - *(.exceptions.irqtest.user) - *(.exceptions.irqtest) - *(.exceptions.irqhandler.user) - *(.exceptions.irqhandler) - *(.exceptions.irqreturn.user) - *(.exceptions.irqreturn) - *(.exceptions.notirq.label) - *(.exceptions.notirq.user) - *(.exceptions.notirq) - *(.exceptions.soft.user) - *(.exceptions.soft) - *(.exceptions.unknown.user) - *(.exceptions.unknown) - *(.exceptions.exit.label) - *(.exceptions.exit.user) - *(.exceptions.exit) - *(.exceptions) - 0x00000020 PROVIDE (__ram_exceptions_end, ABSOLUTE (.)) - 0x00000020 PROVIDE (__flash_exceptions_start, LOADADDR (.exceptions)) - -.text 0x00000020 0x174 - 0x00000020 PROVIDE (stext, ABSOLUTE (.)) - *(.interp) - *(.hash) - *(.dynsym) - *(.dynstr) - *(.gnu.version) - *(.gnu.version_d) - *(.gnu.version_r) - *(.rel.init) - *(.rela.init) - *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) - *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) - *(.rel.fini) - *(.rela.fini) - *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) - *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) - *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) - *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) - *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) - *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) - *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) - *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) - *(.rel.ctors) - *(.rela.ctors) - *(.rel.dtors) - *(.rela.dtors) - *(.rel.got) - *(.rela.got) - *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) - *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) - *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) - *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) - *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) - *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) - *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) - *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) - *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) - *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) - *(.rel.plt) - *(.rela.plt) - *(.rel.dyn) - *(.init) - *(.plt) - *(.text .stub .text.* .gnu.linkonce.t.*) - .text 0x00000020 0x3c ../qsys_tutorial_test_bsp//obj/HAL/src/crt0.o - 0x00000020 _start - .text 0x0000005c 0x4c obj/default/hello_world_small.o - 0x0000005c main - .text 0x000000a8 0x8c ../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_load.o) - 0x000000c8 alt_load - .text 0x00000134 0x2c ../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_main.o) - 0x00000134 alt_main - .text 0x00000160 0x24 ../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_sys_init.o) - 0x00000160 alt_sys_init - 0x00000164 alt_irq_init - .text 0x00000184 0x4 ../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - 0x00000184 alt_dcache_flush_all - .text 0x00000188 0x4 ../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - 0x00000188 alt_icache_flush_all - .text 0x0000018c 0x8 ../qsys_tutorial_test_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - 0x0000018c altera_nios2_qsys_irq_init - *(.gnu.warning.*) - *(.fini) - 0x00000194 PROVIDE (__etext, ABSOLUTE (.)) - 0x00000194 PROVIDE (_etext, ABSOLUTE (.)) - 0x00000194 PROVIDE (etext, ABSOLUTE (.)) - *(.eh_frame_hdr) - 0x00000194 . = ALIGN (0x4) - 0x00000194 PROVIDE (__preinit_array_start, ABSOLUTE (.)) - *(.preinit_array) - 0x00000194 PROVIDE (__preinit_array_end, ABSOLUTE (.)) - 0x00000194 PROVIDE (__init_array_start, ABSOLUTE (.)) - *(.init_array) - 0x00000194 PROVIDE (__init_array_end, ABSOLUTE (.)) - 0x00000194 PROVIDE (__fini_array_start, ABSOLUTE (.)) - *(.fini_array) - 0x00000194 PROVIDE (__fini_array_end, ABSOLUTE (.)) - *(.eh_frame) - *(.gcc_except_table) - *(.dynamic) - 0x00000194 PROVIDE (__CTOR_LIST__, ABSOLUTE (.)) - *(.ctors) - *(SORT(.ctors.*)) - 0x00000194 PROVIDE (__CTOR_END__, ABSOLUTE (.)) - 0x00000194 PROVIDE (__DTOR_LIST__, ABSOLUTE (.)) - *(.dtors) - *(SORT(.dtors.*)) - 0x00000194 PROVIDE (__DTOR_END__, ABSOLUTE (.)) - *(.jcr) - 0x00000194 . = ALIGN (0x4) - -.rodata 0x00000194 0x0 - 0x00000194 PROVIDE (__ram_rodata_start, ABSOLUTE (.)) - 0x00000194 . = ALIGN (0x4) - *(.rodata .rodata.* .gnu.linkonce.r.*) - *(.rodata1) - 0x00000194 . = ALIGN (0x4) - 0x00000194 PROVIDE (__ram_rodata_end, ABSOLUTE (.)) - 0x00000194 PROVIDE (__flash_rodata_start, LOADADDR (.rodata)) - -.rwdata 0x00000194 0x4 load address 0x00000198 - 0x00000194 PROVIDE (__ram_rwdata_start, ABSOLUTE (.)) - 0x00000194 . = ALIGN (0x4) - *(.got.plt) - *(.got) - *(.data1) - *(.data .data.* .gnu.linkonce.d.*) - .data 0x00000194 0x0 ../qsys_tutorial_test_bsp//obj/HAL/src/crt0.o - .data 0x00000194 0x0 obj/default/hello_world_small.o - .data 0x00000194 0x0 ../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_load.o) - .data 0x00000194 0x0 ../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_main.o) - .data 0x00000194 0x0 ../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_sys_init.o) - .data 0x00000194 0x0 ../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .data 0x00000194 0x0 ../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .data 0x00000194 0x0 ../qsys_tutorial_test_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - 0x00008194 _gp = ABSOLUTE ((. + 0x8000)) - 0x00008194 PROVIDE (gp, _gp) - *(.rwdata .rwdata.*) - *(.sdata .sdata.* .gnu.linkonce.s.*) - .sdata 0x00000194 0x4 ../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_sys_init.o) - 0x00000194 jtag_uart - *(.sdata2 .sdata2.* .gnu.linkonce.s2.*) - 0x00000198 . = ALIGN (0x4) - 0x00000198 _edata = ABSOLUTE (.) - 0x00000198 PROVIDE (edata, ABSOLUTE (.)) - 0x00000198 PROVIDE (__ram_rwdata_end, ABSOLUTE (.)) - 0x00000198 PROVIDE (__flash_rwdata_start, LOADADDR (.rwdata)) - -.bss 0x0000019c 0xc - 0x0000019c __bss_start = ABSOLUTE (.) - 0x0000019c PROVIDE (__sbss_start, ABSOLUTE (.)) - 0x0000019c PROVIDE (___sbss_start, ABSOLUTE (.)) - *(.dynsbss) - *(.sbss .sbss.* .gnu.linkonce.sb.*) - .sbss 0x0000019c 0xc ../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_main.o) - 0x0000019c alt_argc - 0x000001a0 alt_argv - 0x000001a4 alt_envp - *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) - *(.scommon) - 0x000001a8 PROVIDE (__sbss_end, ABSOLUTE (.)) - 0x000001a8 PROVIDE (___sbss_end, ABSOLUTE (.)) - *(.dynbss) - *(.bss .bss.* .gnu.linkonce.b.*) - .bss 0x000001a8 0x0 ../qsys_tutorial_test_bsp//obj/HAL/src/crt0.o - .bss 0x000001a8 0x0 obj/default/hello_world_small.o - .bss 0x000001a8 0x0 ../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_load.o) - .bss 0x000001a8 0x0 ../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_main.o) - .bss 0x000001a8 0x0 ../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_sys_init.o) - .bss 0x000001a8 0x0 ../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .bss 0x000001a8 0x0 ../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .bss 0x000001a8 0x0 ../qsys_tutorial_test_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - *(COMMON) - 0x000001a8 . = ALIGN (0x4) - 0x000001a8 __bss_end = ABSOLUTE (.) - -.onchip_memory 0x000001a8 0x0 - 0x000001a8 PROVIDE (_alt_partition_onchip_memory_start, ABSOLUTE (.)) - *(.onchip_memory. onchip_memory.*) - 0x000001a8 . = ALIGN (0x4) - 0x000001a8 PROVIDE (_alt_partition_onchip_memory_end, ABSOLUTE (.)) - 0x000001a8 _end = ABSOLUTE (.) - 0x000001a8 end = ABSOLUTE (.) - 0x000001a8 __alt_stack_base = ABSOLUTE (.) - 0x000001a8 PROVIDE (_alt_partition_onchip_memory_load_addr, LOADADDR (.onchip_memory)) - -.stab - *(.stab) - -.stabstr - *(.stabstr) - -.stab.excl - *(.stab.excl) - -.stab.exclstr - *(.stab.exclstr) - -.stab.index - *(.stab.index) - -.stab.indexstr - *(.stab.indexstr) - -.comment 0x00000000 0x26 - *(.comment) - .comment 0x00000000 0x26 obj/default/hello_world_small.o - 0x27 (size before relaxing) - .comment 0x00000000 0x27 ../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_load.o) - .comment 0x00000000 0x27 ../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_main.o) - .comment 0x00000000 0x27 ../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_sys_init.o) - .comment 0x00000000 0x27 ../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .comment 0x00000000 0x27 ../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .comment 0x00000000 0x27 ../qsys_tutorial_test_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - -.debug - *(.debug) - -.line - *(.line) - -.debug_srcinfo - *(.debug_srcinfo) - -.debug_sfnames - *(.debug_sfnames) - -.debug_aranges 0x00000000 0x108 - *(.debug_aranges) - .debug_aranges - 0x00000000 0x28 ../qsys_tutorial_test_bsp//obj/HAL/src/crt0.o - .debug_aranges - 0x00000028 0x20 obj/default/hello_world_small.o - .debug_aranges - 0x00000048 0x20 ../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_load.o) - .debug_aranges - 0x00000068 0x20 ../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_main.o) - .debug_aranges - 0x00000088 0x20 ../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_sys_init.o) - .debug_aranges - 0x000000a8 0x20 ../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .debug_aranges - 0x000000c8 0x20 ../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .debug_aranges - 0x000000e8 0x20 ../qsys_tutorial_test_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - -.debug_pubnames - 0x00000000 0x149 - *(.debug_pubnames) - .debug_pubnames - 0x00000000 0x1b obj/default/hello_world_small.o - .debug_pubnames - 0x0000001b 0x1f ../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_load.o) - .debug_pubnames - 0x0000003a 0x46 ../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_main.o) - .debug_pubnames - 0x00000080 0x42 ../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_sys_init.o) - .debug_pubnames - 0x000000c2 0x2b ../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .debug_pubnames - 0x000000ed 0x2b ../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .debug_pubnames - 0x00000118 0x31 ../qsys_tutorial_test_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - -.debug_info 0x00000000 0x651 - *(.debug_info .gnu.linkonce.wi.*) - .debug_info 0x00000000 0x78 ../qsys_tutorial_test_bsp//obj/HAL/src/crt0.o - .debug_info 0x00000078 0x62 obj/default/hello_world_small.o - .debug_info 0x000000da 0x12e ../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_load.o) - .debug_info 0x00000208 0x125 ../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_main.o) - .debug_info 0x0000032d 0x17d ../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_sys_init.o) - .debug_info 0x000004aa 0x8d ../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .debug_info 0x00000537 0x8d ../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .debug_info 0x000005c4 0x8d ../qsys_tutorial_test_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - -.debug_abbrev 0x00000000 0x339 - *(.debug_abbrev) - .debug_abbrev 0x00000000 0x12 ../qsys_tutorial_test_bsp//obj/HAL/src/crt0.o - .debug_abbrev 0x00000012 0x4a obj/default/hello_world_small.o - .debug_abbrev 0x0000005c 0x97 ../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_load.o) - .debug_abbrev 0x000000f3 0xa6 ../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_main.o) - .debug_abbrev 0x00000199 0xe3 ../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_sys_init.o) - .debug_abbrev 0x0000027c 0x3f ../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .debug_abbrev 0x000002bb 0x3f ../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .debug_abbrev 0x000002fa 0x3f ../qsys_tutorial_test_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - -.debug_line 0x00000000 0xde4 - *(.debug_line) - .debug_line 0x00000000 0x66 ../qsys_tutorial_test_bsp//obj/HAL/src/crt0.o - .debug_line 0x00000066 0xe7 obj/default/hello_world_small.o - .debug_line 0x0000014d 0x217 ../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_load.o) - .debug_line 0x00000364 0x2c2 ../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_main.o) - .debug_line 0x00000626 0x286 ../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_sys_init.o) - .debug_line 0x000008ac 0x1b5 ../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .debug_line 0x00000a61 0x1b5 ../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .debug_line 0x00000c16 0x1ce ../qsys_tutorial_test_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - -.debug_frame 0x00000000 0x11c - *(.debug_frame) - .debug_frame 0x00000000 0x24 obj/default/hello_world_small.o - .debug_frame 0x00000024 0x38 ../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_load.o) - .debug_frame 0x0000005c 0x28 ../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_main.o) - .debug_frame 0x00000084 0x38 ../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_sys_init.o) - .debug_frame 0x000000bc 0x20 ../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - .debug_frame 0x000000dc 0x20 ../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - .debug_frame 0x000000fc 0x20 ../qsys_tutorial_test_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - -.debug_str 0x00000000 0x3b2 - *(.debug_str) - .debug_str 0x00000000 0x63 obj/default/hello_world_small.o - 0x68 (size before relaxing) - .debug_str 0x00000063 0x188 ../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_load.o) - 0x1cd (size before relaxing) - .debug_str 0x000001eb 0x75 ../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_main.o) - 0x151 (size before relaxing) - .debug_str 0x00000260 0xaf ../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_sys_init.o) - 0x1c4 (size before relaxing) - .debug_str 0x0000030f 0x34 ../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_dcache_flush_all.o) - 0x110 (size before relaxing) - .debug_str 0x00000343 0x34 ../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_icache_flush_all.o) - 0x110 (size before relaxing) - .debug_str 0x00000377 0x3b ../qsys_tutorial_test_bsp/\libhal_bsp.a(altera_nios2_qsys_irq.o) - 0x117 (size before relaxing) - -.debug_loc 0x00000000 0x8f - *(.debug_loc) - .debug_loc 0x00000000 0x1f obj/default/hello_world_small.o - .debug_loc 0x0000001f 0x1f ../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_load.o) - .debug_loc 0x0000003e 0x1f ../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_main.o) - .debug_loc 0x0000005d 0x32 ../qsys_tutorial_test_bsp/\libhal_bsp.a(alt_sys_init.o) - -.debug_macinfo - *(.debug_macinfo) - -.debug_weaknames - *(.debug_weaknames) - -.debug_funcnames - *(.debug_funcnames) - -.debug_typenames - *(.debug_typenames) - -.debug_varnames - *(.debug_varnames) - -.debug_alt_sim_info - 0x00000000 0x10 - *(.debug_alt_sim_info) - .debug_alt_sim_info - 0x00000000 0x10 ../qsys_tutorial_test_bsp//obj/HAL/src/crt0.o - 0x00001000 __alt_data_end = 0x1000 - 0x00001000 PROVIDE (__alt_stack_pointer, __alt_data_end) - 0x000001a8 PROVIDE (__alt_stack_limit, __alt_stack_base) - 0x000001a8 PROVIDE (__alt_heap_start, end) - 0x00001000 PROVIDE (__alt_heap_limit, 0x1000) -OUTPUT(qsys_tutorial_test.elf elf32-littlenios2) - -.debug_ranges 0x00000000 0x20 - .debug_ranges 0x00000000 0x20 ../qsys_tutorial_test_bsp//obj/HAL/src/crt0.o diff --git a/software/qsys_tutorial_test/qsys_tutorial_test.objdump b/software/qsys_tutorial_test/qsys_tutorial_test.objdump deleted file mode 100644 index b670da6..0000000 --- a/software/qsys_tutorial_test/qsys_tutorial_test.objdump +++ /dev/null @@ -1,475 +0,0 @@ - -qsys_tutorial_test.elf: file format elf32-littlenios2 -qsys_tutorial_test.elf -architecture: nios2, flags 0x00000112: -EXEC_P, HAS_SYMS, D_PAGED -start address 0x00000020 - -Program Header: - LOAD off 0x00001000 vaddr 0x00000000 paddr 0x00000000 align 2**12 - filesz 0x00000020 memsz 0x00000020 flags r-x - LOAD off 0x00001020 vaddr 0x00000020 paddr 0x00000020 align 2**12 - filesz 0x00000174 memsz 0x00000174 flags r-x - LOAD off 0x00001194 vaddr 0x00000194 paddr 0x00000198 align 2**12 - filesz 0x00000004 memsz 0x00000004 flags rw- - LOAD off 0x0000119c vaddr 0x0000019c paddr 0x0000019c align 2**12 - filesz 0x00000000 memsz 0x0000000c flags rw- - -Sections: -Idx Name Size VMA LMA File off Algn - 0 .entry 00000020 00000000 00000000 00001000 2**5 - CONTENTS, ALLOC, LOAD, READONLY, CODE - 1 .text 00000174 00000020 00000020 00001020 2**2 - CONTENTS, ALLOC, LOAD, READONLY, CODE - 2 .rwdata 00000004 00000194 00000198 00001194 2**2 - CONTENTS, ALLOC, LOAD, DATA, SMALL_DATA - 3 .bss 0000000c 0000019c 0000019c 0000119c 2**2 - ALLOC, SMALL_DATA - 4 .comment 00000026 00000000 00000000 00001198 2**0 - CONTENTS, READONLY - 5 .debug_aranges 00000108 00000000 00000000 000011c0 2**3 - CONTENTS, READONLY, DEBUGGING - 6 .debug_pubnames 00000149 00000000 00000000 000012c8 2**0 - CONTENTS, READONLY, DEBUGGING - 7 .debug_info 00000651 00000000 00000000 00001411 2**0 - CONTENTS, READONLY, DEBUGGING - 8 .debug_abbrev 00000339 00000000 00000000 00001a62 2**0 - CONTENTS, READONLY, DEBUGGING - 9 .debug_line 00000de4 00000000 00000000 00001d9b 2**0 - CONTENTS, READONLY, DEBUGGING - 10 .debug_frame 0000011c 00000000 00000000 00002b80 2**2 - CONTENTS, READONLY, DEBUGGING - 11 .debug_str 000003b2 00000000 00000000 00002c9c 2**0 - CONTENTS, READONLY, DEBUGGING - 12 .debug_loc 0000008f 00000000 00000000 0000304e 2**0 - CONTENTS, READONLY, DEBUGGING - 13 .debug_alt_sim_info 00000010 00000000 00000000 000030e0 2**2 - CONTENTS, READONLY, DEBUGGING - 14 .debug_ranges 00000020 00000000 00000000 000030f0 2**3 - CONTENTS, READONLY, DEBUGGING - 15 .thread_model 00000003 00000000 00000000 00003d27 2**0 - CONTENTS, READONLY - 16 .cpu 0000000f 00000000 00000000 00003d2a 2**0 - CONTENTS, READONLY - 17 .qsys 00000001 00000000 00000000 00003d39 2**0 - CONTENTS, READONLY - 18 .simulation_enabled 00000001 00000000 00000000 00003d3a 2**0 - CONTENTS, READONLY - 19 .stderr_dev 00000009 00000000 00000000 00003d3b 2**0 - CONTENTS, READONLY - 20 .stdin_dev 00000009 00000000 00000000 00003d44 2**0 - CONTENTS, READONLY - 21 .stdout_dev 00000009 00000000 00000000 00003d4d 2**0 - CONTENTS, READONLY - 22 .sopc_system_name 0000000b 00000000 00000000 00003d56 2**0 - CONTENTS, READONLY - 23 .quartus_project_dir 00000026 00000000 00000000 00003d61 2**0 - CONTENTS, READONLY - 24 .sopcinfo 0003148c 00000000 00000000 00003d87 2**0 - CONTENTS, READONLY -SYMBOL TABLE: -00000000 l d .entry 00000000 .entry -00000020 l d .text 00000000 .text -00000194 l d .rwdata 00000000 .rwdata -0000019c l d .bss 00000000 .bss -00000000 l d .comment 00000000 .comment -00000000 l d .debug_aranges 00000000 .debug_aranges -00000000 l d .debug_pubnames 00000000 .debug_pubnames -00000000 l d .debug_info 00000000 .debug_info -00000000 l d .debug_abbrev 00000000 .debug_abbrev -00000000 l d .debug_line 00000000 .debug_line -00000000 l d .debug_frame 00000000 .debug_frame -00000000 l d .debug_str 00000000 .debug_str -00000000 l d .debug_loc 00000000 .debug_loc -00000000 l d .debug_alt_sim_info 00000000 .debug_alt_sim_info -00000000 l d .debug_ranges 00000000 .debug_ranges -00000058 l .text 00000000 alt_after_alt_main -00000000 l df *ABS* 00000000 hello_world_small.c -00000000 l df *ABS* 00000000 alt_load.c -000000a8 l F .text 00000020 alt_load_section -00000000 l df *ABS* 00000000 alt_main.c -00000000 l df *ABS* 00000000 alt_sys_init.c -00000000 l df *ABS* 00000000 alt_dcache_flush_all.c -00000000 l df *ABS* 00000000 alt_icache_flush_all.c -00000000 l df *ABS* 00000000 altera_nios2_qsys_irq.c -00000134 g F .text 0000002c alt_main -00000198 g *ABS* 00000000 __flash_rwdata_start -00000194 g O .rwdata 00000004 jtag_uart -00000000 g F .entry 0000000c __reset -00000020 g *ABS* 00000000 __flash_exceptions_start -000001a0 g O .bss 00000004 alt_argv -00008194 g *ABS* 00000000 _gp -000001a8 g *ABS* 00000000 __bss_end -00000184 g F .text 00000004 alt_dcache_flush_all -00000198 g *ABS* 00000000 __ram_rwdata_end -00000000 g *ABS* 00000000 __alt_mem_onchip_memory -00000194 g *ABS* 00000000 __ram_rodata_end -000001a8 g *ABS* 00000000 end -00001000 g *ABS* 00000000 __alt_stack_pointer -00000020 g F .text 0000003c _start -00000160 g F .text 00000004 alt_sys_init -00000194 g *ABS* 00000000 __ram_rwdata_start -00000194 g *ABS* 00000000 __ram_rodata_start -000001a8 g *ABS* 00000000 __alt_stack_base -0000019c g *ABS* 00000000 __bss_start -0000005c g F .text 0000004c main -000001a4 g O .bss 00000004 alt_envp -00000194 g *ABS* 00000000 __flash_rodata_start -00000164 g F .text 00000020 alt_irq_init -0000019c g O .bss 00000004 alt_argc -00000020 g *ABS* 00000000 __ram_exceptions_start -00000198 g *ABS* 00000000 _edata -000001a8 g *ABS* 00000000 _end -00000020 g *ABS* 00000000 __ram_exceptions_end -0000018c g F .text 00000008 altera_nios2_qsys_irq_init -0000000c g .entry 00000000 exit -00001000 g *ABS* 00000000 __alt_data_end -0000000c g .entry 00000000 _exit -00000188 g F .text 00000004 alt_icache_flush_all -000000c8 g F .text 0000006c alt_load - - - -Disassembly of section .entry: - -00000000 <__reset>: - * Jump to the _start entry point in the .text section if reset code - * is allowed or if optimizing for RTL simulation. - */ -#if defined(ALT_ALLOW_CODE_AT_RESET) || defined(ALT_SIM_OPTIMIZE) - /* Jump to the _start entry point in the .text section. */ - movhi r1, %hi(_start) - 0: 00400034 movhi at,0 - ori r1, r1, %lo(_start) - 4: 08400814 ori at,at,32 - jmp r1 - 8: 0800683a jmp at - -0000000c <_exit>: - ... - -Disassembly of section .text: - -00000020 <_start>: -#if (NIOS2_NUM_OF_SHADOW_REG_SETS == 0) - /* - * Now that the caches are initialized, set up the stack pointer. - * The value provided by the linker is assumed to be correctly aligned. - */ - movhi sp, %hi(__alt_stack_pointer) - 20: 06c00034 movhi sp,0 - ori sp, sp, %lo(__alt_stack_pointer) - 24: dec40014 ori sp,sp,4096 - - /* Set up the global pointer. */ - movhi gp, %hi(_gp) - 28: 06800034 movhi gp,0 - ori gp, gp, %lo(_gp) - 2c: d6a06514 ori gp,gp,33172 - */ -#ifndef ALT_SIM_OPTIMIZE - /* Log that the BSS is about to be cleared. */ - ALT_LOG_PUTS(alt_log_msg_bss) - - movhi r2, %hi(__bss_start) - 30: 00800034 movhi r2,0 - ori r2, r2, %lo(__bss_start) - 34: 10806714 ori r2,r2,412 - - movhi r3, %hi(__bss_end) - 38: 00c00034 movhi r3,0 - ori r3, r3, %lo(__bss_end) - 3c: 18c06a14 ori r3,r3,424 - - beq r2, r3, 1f - 40: 10c00326 beq r2,r3,50 <_start+0x30> - -0: - stw zero, (r2) - 44: 10000015 stw zero,0(r2) - addi r2, r2, 4 - 48: 10800104 addi r2,r2,4 - bltu r2, r3, 0b - 4c: 10fffd36 bltu r2,r3,44 <_start+0x24> - * section aren't defined until alt_load() has been called). - */ - mov et, zero -#endif - - call alt_load - 50: 00000c80 call c8 - - /* Log that alt_main is about to be called. */ - ALT_LOG_PUTS(alt_log_msg_alt_main) - - /* Call the C entry point. It should never return. */ - call alt_main - 54: 00001340 call 134 - -00000058 : - - /* Wait in infinite loop in case alt_main does return. */ -alt_after_alt_main: - br alt_after_alt_main - 58: 003fff06 br 58 - -0000005c
: -#endif - -#define switches (volatile char *) 0x0002000 -#define leds (char *) 0x0002010 -void main() -{ - 5c: deffff04 addi sp,sp,-4 - - int i = 0; - volatile int j = 0; - 60: d8000015 stw zero,0(sp) - 64: 0007883a mov r3,zero - 68: 01880404 movi r6,8208 - 6c: 01404004 movi r5,256 - while(1){ - *leds = i++; - 70: 30c00005 stb r3,0(r6) - 74: 18c00044 addi r3,r3,1 - if (i > 256) i = 0; - 78: 28c0010e bge r5,r3,80 - 7c: 0007883a mov r3,zero - 80: 010000b4 movhi r4,2 - 84: 2121a7c4 addi r4,r4,-31073 - for (j = 0; j < 100000; j++); - 88: d8000015 stw zero,0(sp) - 8c: 00000306 br 9c - 90: d8800017 ldw r2,0(sp) - 94: 10800044 addi r2,r2,1 - 98: d8800015 stw r2,0(sp) - 9c: d8800017 ldw r2,0(sp) - a0: 20bffb0e bge r4,r2,90 - a4: 003ff206 br 70 - -000000a8 : - -static void ALT_INLINE alt_load_section (alt_u32* from, - alt_u32* to, - alt_u32* end) -{ - if (to != from) - a8: 2900051e bne r5,r4,c0 - ac: f800283a ret - { - while( to != end ) - { - *to++ = *from++; - b0: 20800017 ldw r2,0(r4) - b4: 21000104 addi r4,r4,4 - b8: 28800015 stw r2,0(r5) - bc: 29400104 addi r5,r5,4 - alt_u32* to, - alt_u32* end) -{ - if (to != from) - { - while( to != end ) - c0: 29bffb1e bne r5,r6,b0 - c4: f800283a ret - -000000c8 : - * there is no bootloader, so this application is responsible for loading to - * RAM any sections that are required. - */ - -void alt_load (void) -{ - c8: deffff04 addi sp,sp,-4 - /* - * Copy the .rwdata section. - */ - - alt_load_section (&__flash_rwdata_start, - cc: 01000034 movhi r4,0 - d0: 21006604 addi r4,r4,408 - d4: 01400034 movhi r5,0 - d8: 29406504 addi r5,r5,404 - dc: 01800034 movhi r6,0 - e0: 31806604 addi r6,r6,408 - * there is no bootloader, so this application is responsible for loading to - * RAM any sections that are required. - */ - -void alt_load (void) -{ - e4: dfc00015 stw ra,0(sp) - /* - * Copy the .rwdata section. - */ - - alt_load_section (&__flash_rwdata_start, - e8: 00000a80 call a8 - - /* - * Copy the exception handler. - */ - - alt_load_section (&__flash_exceptions_start, - ec: 01000034 movhi r4,0 - f0: 21000804 addi r4,r4,32 - f4: 01400034 movhi r5,0 - f8: 29400804 addi r5,r5,32 - fc: 01800034 movhi r6,0 - 100: 31800804 addi r6,r6,32 - 104: 00000a80 call a8 - - /* - * Copy the .rodata section. - */ - - alt_load_section (&__flash_rodata_start, - 108: 01000034 movhi r4,0 - 10c: 21006504 addi r4,r4,404 - 110: 01400034 movhi r5,0 - 114: 29406504 addi r5,r5,404 - 118: 01800034 movhi r6,0 - 11c: 31806504 addi r6,r6,404 - 120: 00000a80 call a8 - - /* - * Now ensure that the caches are in synch. - */ - - alt_dcache_flush_all(); - 124: 00001840 call 184 - alt_icache_flush_all(); -} - 128: dfc00017 ldw ra,0(sp) - 12c: dec00104 addi sp,sp,4 - /* - * Now ensure that the caches are in synch. - */ - - alt_dcache_flush_all(); - alt_icache_flush_all(); - 130: 00001881 jmpi 188 - -00000134 : - * devices/filesystems/components in the system; and call the entry point for - * the users application, i.e. main(). - */ - -void alt_main (void) -{ - 134: deffff04 addi sp,sp,-4 -#endif - - /* ALT LOG - please see HAL/sys/alt_log_printf.h for details */ - ALT_LOG_PRINT_BOOT("[alt_main.c] Entering alt_main, calling alt_irq_init.\r\n"); - /* Initialize the interrupt controller. */ - alt_irq_init (NULL); - 138: 0009883a mov r4,zero - * devices/filesystems/components in the system; and call the entry point for - * the users application, i.e. main(). - */ - -void alt_main (void) -{ - 13c: dfc00015 stw ra,0(sp) -#endif - - /* ALT LOG - please see HAL/sys/alt_log_printf.h for details */ - ALT_LOG_PRINT_BOOT("[alt_main.c] Entering alt_main, calling alt_irq_init.\r\n"); - /* Initialize the interrupt controller. */ - alt_irq_init (NULL); - 140: 00001640 call 164 - ALT_LOG_PRINT_BOOT("[alt_main.c] Done OS Init, calling alt_sem_create.\r\n"); - ALT_SEM_CREATE (&alt_fd_list_lock, 1); - - /* Initialize the device drivers/software components. */ - ALT_LOG_PRINT_BOOT("[alt_main.c] Calling alt_sys_init.\r\n"); - alt_sys_init(); - 144: 00001600 call 160 - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Calling main.\r\n"); - -#ifdef ALT_NO_EXIT - main (alt_argc, alt_argv, alt_envp); - 148: d1200217 ldw r4,-32760(gp) - 14c: d1600317 ldw r5,-32756(gp) - 150: d1a00417 ldw r6,-32752(gp) - close(STDOUT_FILENO); - exit (result); -#endif - - ALT_LOG_PRINT_BOOT("[alt_main.c] After main - we should not be here?.\r\n"); -} - 154: dfc00017 ldw ra,0(sp) - 158: dec00104 addi sp,sp,4 - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Calling main.\r\n"); - -#ifdef ALT_NO_EXIT - main (alt_argc, alt_argv, alt_envp); - 15c: 000005c1 jmpi 5c
- -00000160 : - */ - -void alt_sys_init( void ) -{ - ALTERA_AVALON_JTAG_UART_INIT ( JTAG_UART, jtag_uart); -} - 160: f800283a ret - -00000164 : - * The "base" parameter is ignored and only - * present for backwards-compatibility. - */ - -void alt_irq_init ( const void* base ) -{ - 164: deffff04 addi sp,sp,-4 - 168: dfc00015 stw ra,0(sp) - ALTERA_NIOS2_QSYS_IRQ_INIT ( NIOS2_PROCESSOR, nios2_processor); - 16c: 000018c0 call 18c - * alt_irq_cpu_enable_interrupts() enables the CPU to start taking interrupts. - */ -static ALT_INLINE void ALT_ALWAYS_INLINE - alt_irq_cpu_enable_interrupts () -{ - NIOS2_WRITE_STATUS(NIOS2_STATUS_PIE_MSK - 170: 00800044 movi r2,1 - 174: 1001703a wrctl status,r2 - alt_irq_cpu_enable_interrupts(); -} - 178: dfc00017 ldw ra,0(sp) - 17c: dec00104 addi sp,sp,4 - 180: f800283a ret - -00000184 : - for (i = (char*) 0; i < (char*) NIOS2_DCACHE_SIZE; i+= NIOS2_DCACHE_LINE_SIZE) - { - __asm__ volatile ("flushd (%0)" :: "r" (i)); - } -#endif /* NIOS2_DCACHE_SIZE > 0 */ -} - 184: f800283a ret - -00000188 : -void alt_icache_flush_all (void) -{ -#if NIOS2_ICACHE_SIZE > 0 - alt_icache_flush (0, NIOS2_ICACHE_SIZE); -#endif -} - 188: f800283a ret - -0000018c : - * To initialize the internal interrupt controller, just clear the IENABLE - * register so that all possible IRQs are disabled. - */ -void altera_nios2_qsys_irq_init(void) -{ - NIOS2_WRITE_IENABLE(0); - 18c: 000170fa wrctl ienable,zero -} - 190: f800283a ret diff --git a/software/qsys_tutorial_test/readme.txt b/software/qsys_tutorial_test/readme.txt deleted file mode 100644 index 3dc3186..0000000 --- a/software/qsys_tutorial_test/readme.txt +++ /dev/null @@ -1,67 +0,0 @@ -Readme - Hello World Software Example - -DESCRIPTION: -Simple program that prints "Hello from Nios II" - -The purpose of this example is to demonstrate the smallest possible Hello -World application, using the Nios II HAL BSP. The memory footprint -of this hosted application is intended to be less than 1 kbytes by default using a standard -reference design. For a more fully featured Hello World application -example, see the example titled "Hello World". - -The memory footprint of this example has been reduced by making the -following changes to the normal "Hello World" example. -Check in the Nios II Software Developers Handbook for a more complete -description. - -In the SW Application project: - - In the C/C++ Build page - - Set the Optimization Level to -Os - -In BSP project: - - In the C/C++ Build page - - - Set the Optimization Level to -Os - - - Define the preprocessor option ALT_NO_INSTRUCTION_EMULATION - This removes software exception handling, which means that you cannot - run code compiled for Nios II cpu with a hardware multiplier on a core - without a the multiply unit. Check the Nios II Software Developers - Manual for more details. - - - In the BSP: - - Set Periodic system timer and Timestamp timer to none - This prevents the automatic inclusion of the timer driver. - - - Set Max file descriptors to 4 - This reduces the size of the file handle pool. - - - Uncheck Clean exit (flush buffers) - This removes the call to exit, and when main is exitted instead of - calling exit the software will just spin in a loop. - - - Check Small C library - This uses a reduced functionality C library, which lacks - support for buffering, file IO, floating point and getch(), etc. - Check the Nios II Software Developers Manual for a complete list. - - - Check Reduced device drivers - This uses reduced functionality drivers if they're available. For the - standard design this means you get polled UART and JTAG UART drivers, - no support for the LCD driver and you lose the ability to program - CFI compliant flash devices. - - -PERIPHERALS USED: -This example exercises the following peripherals: -- STDOUT device (UART or JTAG UART) - -SOFTWARE SOURCE FILES: -This example includes the following software source files: -- small_hello_world.c: - -BOARD/HOST REQUIREMENTS: -This example requires only a JTAG connection with a Nios Development board. If -the host communication settings are changed from JTAG UART (default) to use a -conventional UART, a serial cable between board DB-9 connector and the host is -required. diff --git a/software/qsys_tutorial_test/system/template.xml b/software/qsys_tutorial_test/system/template.xml deleted file mode 100644 index b09e912..0000000 --- a/software/qsys_tutorial_test/system/template.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git a/software/qsys_tutorial_test_bsp/.cproject b/software/qsys_tutorial_test_bsp/.cproject deleted file mode 100644 index 4a70f4d..0000000 --- a/software/qsys_tutorial_test_bsp/.cproject +++ /dev/null @@ -1,481 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/software/qsys_tutorial_test_bsp/.project b/software/qsys_tutorial_test_bsp/.project deleted file mode 100644 index cab7cc1..0000000 --- a/software/qsys_tutorial_test_bsp/.project +++ /dev/null @@ -1,85 +0,0 @@ - - - qsys_tutorial_test_bsp - - - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - ?name? - - - - org.eclipse.cdt.make.core.append_environment - true - - - org.eclipse.cdt.make.core.autoBuildTarget - all - - - org.eclipse.cdt.make.core.buildArguments - - - - org.eclipse.cdt.make.core.buildCommand - make - - - org.eclipse.cdt.make.core.buildLocation - ${workspace_loc://qsys_tutorial_test_bsp} - - - org.eclipse.cdt.make.core.cleanBuildTarget - clean - - - org.eclipse.cdt.make.core.contents - org.eclipse.cdt.make.core.activeConfigSettings - - - org.eclipse.cdt.make.core.enableAutoBuild - false - - - org.eclipse.cdt.make.core.enableCleanBuild - true - - - org.eclipse.cdt.make.core.enableFullBuild - true - - - org.eclipse.cdt.make.core.fullBuildTarget - all - - - org.eclipse.cdt.make.core.stopOnError - true - - - org.eclipse.cdt.make.core.useDefaultBuildCmd - true - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - org.eclipse.cdt.core.ccnature - com.altera.sbtgui.project.SBTGUINature - com.altera.sbtgui.project.SBTGUIBspNature - - diff --git a/software/qsys_tutorial_test_bsp/HAL/inc/alt_types.h b/software/qsys_tutorial_test_bsp/HAL/inc/alt_types.h deleted file mode 100644 index d02f171..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/inc/alt_types.h +++ /dev/null @@ -1,54 +0,0 @@ -#ifndef __ALT_TYPES_H__ -#define __ALT_TYPES_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/* - * Don't declare these typedefs if this file is included by assembly source. - */ -#ifndef ALT_ASM_SRC -typedef signed char alt_8; -typedef unsigned char alt_u8; -typedef signed short alt_16; -typedef unsigned short alt_u16; -typedef signed long alt_32; -typedef unsigned long alt_u32; -typedef long long alt_64; -typedef unsigned long long alt_u64; -#endif - -#define ALT_INLINE __inline__ -#define ALT_ALWAYS_INLINE __attribute__ ((always_inline)) -#define ALT_WEAK __attribute__((weak)) - -#endif /* __ALT_TYPES_H__ */ diff --git a/software/qsys_tutorial_test_bsp/HAL/inc/altera_nios2_qsys_irq.h b/software/qsys_tutorial_test_bsp/HAL/inc/altera_nios2_qsys_irq.h deleted file mode 100644 index 6629ec9..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/inc/altera_nios2_qsys_irq.h +++ /dev/null @@ -1,80 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * Support for the Nios II internal interrupt controller. - */ - -#ifndef __ALT_NIOS2_QSYS_IRQ_H__ -#define __ALT_NIOS2_QSYS_IRQ_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The macro ALTERA_NIOS2_IRQ_INSTANCE is used by the alt_irq_init() - * function in the auto-generated file alt_sys_init.c to create an - * instance of this interrupt controller device driver state if this - * module contains an interrupt controller. - * Only one instance of a Nios II is allowed so this macro is just empty. - */ - -#define ALTERA_NIOS2_QSYS_IRQ_INSTANCE(name, state) - -/* - * altera_nios2_irq_init() is called by the auto-generated function - * alt_irq_init() once for the Nios II if it contains an interrupt controller. - * The altera_nios2_irq_init() routine is called using the - * ALTERA_NIOS2_IRQ_INIT macro given below. - * - * This function initializes the internal interrupt controller - * so is not called if the Nios II contains an external interrupt - * controller port (because the internal interrupt controller - * is removed if this port is present). - */ - -extern void altera_nios2_qsys_irq_init( void ); - -/* - * The macro ALTERA_NIOS2_IRQ_INIT is used by the alt_irq_init() routine - * in the auto-generated file alt_sys_init.c to initialize an instance - * of the interrupt controller device driver state. - */ - -#define ALTERA_NIOS2_QSYS_IRQ_INIT(name, state) altera_nios2_qsys_irq_init() - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_NIOS2_QSYS_IRQ_H__ */ - diff --git a/software/qsys_tutorial_test_bsp/HAL/inc/io.h b/software/qsys_tutorial_test_bsp/HAL/inc/io.h deleted file mode 100644 index 362f103..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/inc/io.h +++ /dev/null @@ -1,81 +0,0 @@ -#ifndef __IO_H__ -#define __IO_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/* IO Header file for Nios II Toolchain */ - -#include "alt_types.h" -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#ifndef SYSTEM_BUS_WIDTH -#error SYSTEM_BUS_WIDTH undefined -#endif - -/* Dynamic bus access functions */ - -#define __IO_CALC_ADDRESS_DYNAMIC(BASE, OFFSET) \ - ((void *)(((alt_u8*)BASE) + (OFFSET))) - -#define IORD_32DIRECT(BASE, OFFSET) \ - __builtin_ldwio (__IO_CALC_ADDRESS_DYNAMIC ((BASE), (OFFSET))) -#define IORD_16DIRECT(BASE, OFFSET) \ - __builtin_ldhuio (__IO_CALC_ADDRESS_DYNAMIC ((BASE), (OFFSET))) -#define IORD_8DIRECT(BASE, OFFSET) \ - __builtin_ldbuio (__IO_CALC_ADDRESS_DYNAMIC ((BASE), (OFFSET))) - -#define IOWR_32DIRECT(BASE, OFFSET, DATA) \ - __builtin_stwio (__IO_CALC_ADDRESS_DYNAMIC ((BASE), (OFFSET)), (DATA)) -#define IOWR_16DIRECT(BASE, OFFSET, DATA) \ - __builtin_sthio (__IO_CALC_ADDRESS_DYNAMIC ((BASE), (OFFSET)), (DATA)) -#define IOWR_8DIRECT(BASE, OFFSET, DATA) \ - __builtin_stbio (__IO_CALC_ADDRESS_DYNAMIC ((BASE), (OFFSET)), (DATA)) - -/* Native bus access functions */ - -#define __IO_CALC_ADDRESS_NATIVE(BASE, REGNUM) \ - ((void *)(((alt_u8*)BASE) + ((REGNUM) * (SYSTEM_BUS_WIDTH/8)))) - -#define IORD(BASE, REGNUM) \ - __builtin_ldwio (__IO_CALC_ADDRESS_NATIVE ((BASE), (REGNUM))) -#define IOWR(BASE, REGNUM, DATA) \ - __builtin_stwio (__IO_CALC_ADDRESS_NATIVE ((BASE), (REGNUM)), (DATA)) - -#ifdef __cplusplus -} -#endif - -#endif /* __IO_H__ */ diff --git a/software/qsys_tutorial_test_bsp/HAL/inc/nios2.h b/software/qsys_tutorial_test_bsp/HAL/inc/nios2.h deleted file mode 100644 index 72cefba..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/inc/nios2.h +++ /dev/null @@ -1,230 +0,0 @@ -#ifndef __NIOS2_H__ -#define __NIOS2_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2008 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * This header provides processor specific macros for accessing the Nios2 - * control registers. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * Macros for accessing selected processor registers - */ - -#define NIOS2_READ_ET(et) \ - do { __asm ("mov %0, et" : "=r" (et) ); } while (0) - -#define NIOS2_WRITE_ET(et) \ - do { __asm volatile ("mov et, %z0" : : "rM" (et)); } while (0) - -#define NIOS2_READ_SP(sp) \ - do { __asm ("mov %0, sp" : "=r" (sp) ); } while (0) - -/* - * Macros for useful processor instructions - */ - -#define NIOS2_BREAK() \ - do { __asm volatile ("break"); } while (0) - -#define NIOS2_REPORT_STACK_OVERFLOW() \ - do { __asm volatile("break 3"); } while (0) - -/* - * Macros for accessing the control registers. - */ - -#define NIOS2_READ_STATUS(dest) \ - do { dest = __builtin_rdctl(0); } while (0) - -#define NIOS2_WRITE_STATUS(src) \ - do { __builtin_wrctl(0, src); } while (0) - -#define NIOS2_READ_ESTATUS(dest) \ - do { dest = __builtin_rdctl(1); } while (0) - -#define NIOS2_READ_BSTATUS(dest) \ - do { dest = __builtin_rdctl(2); } while (0) - -#define NIOS2_READ_IENABLE(dest) \ - do { dest = __builtin_rdctl(3); } while (0) - -#define NIOS2_WRITE_IENABLE(src) \ - do { __builtin_wrctl(3, src); } while (0) - -#define NIOS2_READ_IPENDING(dest) \ - do { dest = __builtin_rdctl(4); } while (0) - -#define NIOS2_READ_CPUID(dest) \ - do { dest = __builtin_rdctl(5); } while (0) - - -/* - * Macros for accessing extra exception registers. These - * are always enabled wit the MPU or MMU, and optionally - * with other advanced exception types/ - */ -#define NIOS2_READ_EXCEPTION(dest) \ - do { dest = __builtin_rdctl(7); } while (0) - -#define NIOS2_READ_BADADDR(dest) \ - do { dest = __builtin_rdctl(12); } while (0) - - -/* - * Macros for accessing control registers for MPU - * operation. These should not be used unless the - * MPU is enabled. - * - * The config register may be augmented for future - * enhancements. For now, only MPU support is provided. - */ -/* Config register */ -#define NIOS2_WRITE_CONFIG(src) \ - do { __builtin_wrctl(13, src); } while (0) - -#define NIOS2_READ_CONFIG(dest) \ - do { dest = __builtin_rdctl(13); } while (0) - -/* MPU Base Address Register */ -#define NIOS2_WRITE_MPUBASE(src) \ - do { __builtin_wrctl(14, src); } while (0) - -#define NIOS2_READ_MPUBASE(dest) \ - do { dest = __builtin_rdctl(14); } while (0) - -/* MPU Access Register */ -#define NIOS2_WRITE_MPUACC(src) \ - do { __builtin_wrctl(15, src); } while (0) - -#define NIOS2_READ_MPUACC(dest) \ - do { dest = __builtin_rdctl(15); } while (0) - - -/* - * Nios II control registers that are always present - */ -#define NIOS2_STATUS status -#define NIOS2_ESTATUS estatus -#define NIOS2_BSTATUS bstatus -#define NIOS2_IENABLE ienable -#define NIOS2_IPENDING ipending -#define NIOS2_CPUID cpuid - -/* - * STATUS, BSTATUS, ESTATUS, and SSTATUS fields. - * The presence of fields is a function of the Nios II configuration. - */ -#define NIOS2_STATUS_PIE_MSK (0x00000001) -#define NIOS2_STATUS_PIE_OFST (0) -#define NIOS2_STATUS_U_MSK (0x00000002) -#define NIOS2_STATUS_U_OFST (1) -#define NIOS2_STATUS_EH_MSK (0x00000004) -#define NIOS2_STATUS_EH_OFST (2) -#define NIOS2_STATUS_IH_MSK (0x00000008) -#define NIOS2_STATUS_IH_OFST (3) -#define NIOS2_STATUS_IL_MSK (0x000003f0) -#define NIOS2_STATUS_IL_OFST (4) -#define NIOS2_STATUS_CRS_MSK (0x0000fc00) -#define NIOS2_STATUS_CRS_OFST (10) -#define NIOS2_STATUS_PRS_MSK (0x003f0000) -#define NIOS2_STATUS_PRS_OFST (16) -#define NIOS2_STATUS_NMI_MSK (0x00400000) -#define NIOS2_STATUS_NMI_OFST (22) -#define NIOS2_STATUS_RSIE_MSK (0x00800000) -#define NIOS2_STATUS_RSIE_OFST (23) -#define NIOS2_STATUS_SRS_MSK (0x80000000) -#define NIOS2_STATUS_SRS_OFST (31) - -/* - * Bit masks & offsets available with extra exceptions support - */ - -/* Exception register */ -#define NIOS2_EXCEPTION_REG_CAUSE_MASK (0x0000007c) -#define NIOS2_EXCEPTION_REG_CAUSE_OFST (2) - -/* - * Bit masks & offsets for MPU support - * - * All bit-masks are expressed relative to the position - * of the data with a register. To read data that is LSB- - * aligned, the register read data should be masked, then - * right-shifted by the designated "OFST" macro value. The - * opposite should be used for register writes when starting - * with LSB-aligned data. - */ - -/* Config register */ -#define NIOS2_CONFIG_REG_PE_MASK (0x00000001) -#define NIOS2_CONFIG_REG_PE_OFST (0) -#define NIOS2_CONFIG_REG_ANI_MASK (0x00000002) -#define NIOS2_CONFIG_REG_ANI_OFST (1) - -/* MPU Base Address Register */ -#define NIOS2_MPUBASE_D_MASK (0x00000001) -#define NIOS2_MPUBASE_D_OFST (0) -#define NIOS2_MPUBASE_INDEX_MASK (0x0000003e) -#define NIOS2_MPUBASE_INDEX_OFST (1) -#define NIOS2_MPUBASE_BASE_ADDR_MASK (0xffffffc0) -#define NIOS2_MPUBASE_BASE_ADDR_OFST (6) - -/* MPU Access Register */ -#define NIOS2_MPUACC_LIMIT_MASK (0xffffffc0) -#define NIOS2_MPUACC_LIMIT_OFST (6) -#define NIOS2_MPUACC_MASK_MASK (0xffffffc0) -#define NIOS2_MPUACC_MASK_OFST (6) -#define NIOS2_MPUACC_C_MASK (0x00000020) -#define NIOS2_MPUACC_C_OFST (5) -#define NIOS2_MPUACC_PERM_MASK (0x0000001c) -#define NIOS2_MPUACC_PERM_OFST (2) -#define NIOS2_MPUACC_RD_MASK (0x00000002) -#define NIOS2_MPUACC_RD_OFST (1) -#define NIOS2_MPUACC_WR_MASK (0x00000001) -#define NIOS2_MPUACC_WR_OFST (0) - -/* - * Number of available IRQs in internal interrupt controller. - */ -#define NIOS2_NIRQ 32 - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __NIOS2_H__ */ diff --git a/software/qsys_tutorial_test_bsp/HAL/inc/os/alt_flag.h b/software/qsys_tutorial_test_bsp/HAL/inc/os/alt_flag.h deleted file mode 100644 index b9b4605..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/inc/os/alt_flag.h +++ /dev/null @@ -1,98 +0,0 @@ -#ifndef __ALT_FLAG_H__ -#define __ALT_FLAG_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * This header provides macro definitions that can be used to create and use - * uc/OS-II style event flags. These macros can be used in both a uC/OS-II based - * environment, and a single threaded HAL based environment. - * - * The motivation for these macros is to allow code to be developed which is - * thread safe under uC/OS-II, but incurs no additional overhead when used in a - * single threaded HAL environment. - * - * In the case of a single threaded HAL environment, they compile to - * "do nothing" directives, which ensures they do not contribute to the final - * executable. - * - * The following macros are available: - * - * ALT_FLAG_GRP - Create a flag group instance. - * ALT_EXTERN_FLAG_GRP - Create a reference to an external flag group instance. - * ALT_STATIC_FLAG_GRP - Create a static flag group instance. - * ALT_FLAG_CREATE - Initialise a flag group. - * ALT_FLAG_PEND - Pend on a flag group. - * ALT_FLAG_POST - Set a flag condition. - - * - * Input arguments and return codes are all consistant with the equivalent - * uC/OS-II function. - * - * It's important to be careful in the use of the macros: ALT_FLAG_GRP, - * ALT_EXTERN_FLAG_GRP, and ALT_STATIC_FLAG_GRP. In these three cases the - * semi-colon is included in the macro definition; so, for example, you should - * use: - * - * ALT_FLAG_GRP(mygroup) - * - * not: - * - * ALT_FLAG_GRP(mygroup); - * - * The inclusion of the semi-colon has been necessary to ensure the macros can - * compile with no warnings when used in a single threaded HAL environment. - * - */ - -#include "priv/alt_no_error.h" - -#define ALT_FLAG_GRP(group) -#define ALT_EXTERN_FLAG_GRP(group) -#define ALT_STATIC_FLAG_GRP(group) - -#define ALT_FLAG_CREATE(group, flags) alt_no_error () -#define ALT_FLAG_PEND(group, flags, wait_type, timeout) alt_no_error () -#define ALT_FLAG_POST(group, flags, opt) alt_no_error () - -#ifndef ALT_SINGLE_THREADED -#define ALT_SINGLE_THREADED -#endif - -#endif /* __ALT_FLAG_H__ */ diff --git a/software/qsys_tutorial_test_bsp/HAL/inc/os/alt_hooks.h b/software/qsys_tutorial_test_bsp/HAL/inc/os/alt_hooks.h deleted file mode 100644 index 9054e3f..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/inc/os/alt_hooks.h +++ /dev/null @@ -1,61 +0,0 @@ -#ifndef __ALT_HOOKS_H__ -#define __ALT_HOOKS_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * This header provides "do-nothing" macro definitions for operating system - * hooks within the HAL. The O/S component can override these to provide it's - * own implementation. - */ - -#define ALT_OS_TIME_TICK() while(0) -#define ALT_OS_INIT() while(0) -#define ALT_OS_STOP() while(0) - -/* Call from assembly code */ -#define ALT_OS_INT_ENTER_ASM -#define ALT_OS_INT_EXIT_ASM - -/* Call from C code */ -#define ALT_OS_INT_ENTER() while(0) -#define ALT_OS_INT_EXIT() while(0) - - -#endif /* __ALT_HOOKS_H__ */ diff --git a/software/qsys_tutorial_test_bsp/HAL/inc/os/alt_sem.h b/software/qsys_tutorial_test_bsp/HAL/inc/os/alt_sem.h deleted file mode 100644 index 753943e..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/inc/os/alt_sem.h +++ /dev/null @@ -1,96 +0,0 @@ -#ifndef __ALT_SEM_H__ -#define __ALT_SEM_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * This header provides macro definitions that can be used to create and use - * semaphores. These macros can be used in both a uC/OS-II based environment, - * and a single threaded HAL based environment. - * - * The motivation for these macros is to allow code to be developed which is - * thread safe under uC/OS-II, but incurs no additional overhead when used in a - * single threaded HAL environment. - * - * In the case of a single threaded HAL environment, they compile to - * "do nothing" directives, which ensures they do not contribute to the final - * executable. - * - * The following macros are available: - * - * ALT_SEM - Create a semaphore instance. - * ALT_EXTERN_SEM - Create a reference to an external semaphore instance. - * ALT_STATIC_SEM - Create a static semaphore instance. - * ALT_SEM_CREATE - Initialise a semaphore. - * ALT_SEM_PEND - Pend on a semaphore. - * ALT_SEM_POST - Increment a semaphore. - * - * Input arguments and return codes are all consistant with the equivalent - * uC/OS-II function. - * - * It's important to be careful in the use of the macros: ALT_SEM, - * ALT_EXTERN_SEM, and ALT_STATIC_SEM. In these three cases the semi-colon is - * included in the macro definition; so, for example, you should use: - * - * ALT_SEM(mysem) - * - * not: - * - * ALT_SEM(mysem); - * - * The inclusion of the semi-colon has been necessary to ensure the macros can - * compile with no warnings when used in a single threaded HAL environment. - * - */ - -#include "priv/alt_no_error.h" - -#define ALT_SEM(sem) -#define ALT_EXTERN_SEM(sem) -#define ALT_STATIC_SEM(sem) - -#define ALT_SEM_CREATE(sem, value) alt_no_error () -#define ALT_SEM_PEND(sem, timeout) alt_no_error () -#define ALT_SEM_POST(sem) alt_no_error () - -#ifndef ALT_SINGLE_THREADED -#define ALT_SINGLE_THREADED -#endif - -#endif /* __ALT_SEM_H__ */ diff --git a/software/qsys_tutorial_test_bsp/HAL/inc/os/alt_syscall.h b/software/qsys_tutorial_test_bsp/HAL/inc/os/alt_syscall.h deleted file mode 100644 index 507c6aa..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/inc/os/alt_syscall.h +++ /dev/null @@ -1,75 +0,0 @@ -#ifndef __ALT_SYSCALL_H__ -#define __ALT_SYSCALL_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * The macros defined in this file are used to provide the function names used - * for the HAL 'UNIX style' interface, e.g. read(), write() etc. - * - * Operating systems which are ported to the HAL can provide their own - * version of this file, which will be used in preference. This allows - * the operating system to provide it's own implementation of the top level - * system calls, while retaining the HAL functions under a different name, - * for example, alt_read(), alt_write() etc. - */ - -#define ALT_CLOSE close -#define ALT_ENVIRON environ -#define ALT_EXECVE execve -#define ALT_EXIT _exit -#define ALT_FCNTL fcntl -#define ALT_FORK fork -#define ALT_FSTAT fstat -#define ALT_GETPID getpid -#define ALT_GETTIMEOFDAY gettimeofday -#define ALT_IOCTL ioctl -#define ALT_ISATTY isatty -#define ALT_KILL kill -#define ALT_LINK link -#define ALT_LSEEK lseek -#define ALT_OPEN open -#define ALT_READ read -#define ALT_RENAME _rename -#define ALT_SBRK sbrk -#define ALT_SETTIMEOFDAY settimeofday -#define ALT_STAT stat -#define ALT_UNLINK unlink -#define ALT_USLEEP usleep -#define ALT_WAIT wait -#define ALT_WRITE write -#define ALT_TIMES times - -/* - * - */ - -#endif /* __ALT_SYSCALL_H__ */ diff --git a/software/qsys_tutorial_test_bsp/HAL/inc/priv/alt_alarm.h b/software/qsys_tutorial_test_bsp/HAL/inc/priv/alt_alarm.h deleted file mode 100644 index 45d6a0e..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/inc/priv/alt_alarm.h +++ /dev/null @@ -1,101 +0,0 @@ -#ifndef __ALT_PRIV_ALARM_H__ -#define __ALT_PRIV_ALARM_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "alt_types.h" - -/* - * This header provides the internal defenitions required by the public - * interface alt_alarm.h. These variables and structures are not guaranteed to - * exist in future implementations of the HAL. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * "alt_alarm_s" is a structure type used to maintain lists of alarm callback - * functions. - */ - -struct alt_alarm_s -{ - alt_llist llist; /* linked list */ - alt_u32 time; /* time in system ticks of the callback */ - alt_u32 (*callback) (void* context); /* callback function. The return - * value is the period for the next callback; where - * zero indicates that the alarm should be removed - * from the list. - */ - alt_u8 rollover; /* set when desired alarm time + current time causes - overflow, to prevent premature alarm */ - void* context; /* Argument for the callback */ -}; - -/* - * "_alt_tick_rate" is a global variable used to store the system clock rate - * in ticks per second. This is initialised to zero, which coresponds to there - * being no system clock available. - * - * It is then set to it's final value by the system clock driver through a call - * to alt_sysclk_init(). - */ - -extern alt_u32 _alt_tick_rate; - -/* - * "_alt_nticks" is a global variable which records the elapsed number of - * system clock ticks since the last call to settimeofday() or since reset if - * settimeofday() has not been called. - */ - -extern volatile alt_u32 _alt_nticks; - -/* The list of registered alarms. */ - -extern alt_llist alt_alarm_list; - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_PRIV_ALARM_H__ */ diff --git a/software/qsys_tutorial_test_bsp/HAL/inc/priv/alt_busy_sleep.h b/software/qsys_tutorial_test_bsp/HAL/inc/priv/alt_busy_sleep.h deleted file mode 100644 index b1af849..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/inc/priv/alt_busy_sleep.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef __ALT_BUSY_SLEEP_H -#define __ALT_BUSY_SLEEP_H - -/* - * Copyright (c) 2003 Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - */ - -/* - * The function alt_busy_sleep provides a busy loop implementation of usleep. - * This is used to provide usleep for the standalone HAL, or when the timer is - * unavailable in uC/OS-II. - */ - -extern unsigned int alt_busy_sleep (unsigned int us); - -#endif /* __ALT_BUSY_SLEEP_H */ diff --git a/software/qsys_tutorial_test_bsp/HAL/inc/priv/alt_dev_llist.h b/software/qsys_tutorial_test_bsp/HAL/inc/priv/alt_dev_llist.h deleted file mode 100644 index 451b063..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/inc/priv/alt_dev_llist.h +++ /dev/null @@ -1,77 +0,0 @@ -#ifndef __ALT_DEV_LLIST_H__ -#define __ALT_DEV_LLIST_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "sys/alt_llist.h" -#include "alt_types.h" - -/* - * This header provides the internal defenitions required to control file - * access. These variables and functions are not guaranteed to exist in - * future implementations of the HAL. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The alt_dev_llist is an internal structure used to form a common base - * class for all device types. The use of this structure allows common code - * to be used to manipulate the various device lists. - */ - -typedef struct { - alt_llist llist; - const char* name; -} alt_dev_llist; - -/* - * - */ - -extern int alt_dev_llist_insert (alt_dev_llist* dev, alt_llist* list); - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_DEV_LLIST_H__ */ diff --git a/software/qsys_tutorial_test_bsp/HAL/inc/priv/alt_exception_handler_registry.h b/software/qsys_tutorial_test_bsp/HAL/inc/priv/alt_exception_handler_registry.h deleted file mode 100644 index c6905fa..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/inc/priv/alt_exception_handler_registry.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef __ALT_EXCEPTION_HANDLER_REGISTRY_H__ -#define __ALT_EXCEPTION_HANDLER_REGISTRY_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2008 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ -#include "sys/alt_exceptions.h" - -/* Function pointer to exception callback routine */ -extern alt_exception_result (*alt_instruction_exception_handler) - (alt_exception_cause, alt_u32, alt_u32); - -#endif /* __ALT_EXCEPTION_HANDLER_REGISTRY_H__ */ diff --git a/software/qsys_tutorial_test_bsp/HAL/inc/priv/alt_file.h b/software/qsys_tutorial_test_bsp/HAL/inc/priv/alt_file.h deleted file mode 100644 index 2c3e843..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/inc/priv/alt_file.h +++ /dev/null @@ -1,179 +0,0 @@ -#ifndef __ALT_FILE_H__ -#define __ALT_FILE_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "sys/alt_dev.h" -#include "sys/alt_llist.h" -#include "os/alt_sem.h" - -#include "alt_types.h" - -/* - * This header provides the internal defenitions required to control file - * access. These variables and functions are not guaranteed to exist in - * future implementations of the HAL. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The function alt_find_dev() is used to search the device list "list" to - * locate a device named "name". If a match is found, then a pointer to the - * device is returned, otherwise NULL is returned. - */ - -extern alt_dev* alt_find_dev (const char* name, alt_llist* list); - -/* - * alt_find_file() is used to search the list of registered file systems to - * find the filesystem that the file named "name" belongs to. If a match is - * found, then a pointer to the filesystems alt_dev structure is returned, - * otherwise NULL is returned. - * - * Note that a match does not indicate that the file exists, only that a - * filesystem exists that is registered for a partition that could contain - * the file. The filesystems open() function would need to be called in order - * to determine if the file exists. - */ - -extern alt_dev* alt_find_file (const char* name); - -/* - * alt_get_fd() is used to allocate a file descriptor for the device or - * filesystem "dev". A negative return value indicates an error, otherwise the - * return value is the index of the file descriptor within the file descriptor - * pool. - */ - -extern int alt_get_fd (alt_dev* dev); - -/* - * alt_release_fd() is called to free the file descriptor with index "fd". - */ - -extern void alt_release_fd (int fd); - -/* - * alt_fd_lock() is called by ioctl() to mark the file descriptor "fd" as - * being open for exclusive access. Subsequent calls to open() for the device - * associated with "fd" will fail. A device is unlocked by either calling - * close() for "fd", or by an alternate call to ioctl() (see ioctl.c for - * details). - */ - -extern int alt_fd_lock (alt_fd* fd); - -/* - * alt_fd_unlock() is called by ioctl() to unlock a descriptor previously - * locked by a call to alt_fd_lock(). - */ - -extern int alt_fd_unlock (alt_fd* fd); - -/* - * "alt_fd_list" is the pool of file descriptors. - */ - -extern alt_fd alt_fd_list[]; - -/* - * flags used by alt_fd. - * - * ALT_FD_EXCL is used to mark a file descriptor as locked for exclusive - * access, i.e. further calls to open() for the associated device should - * fail. - * - * ALT_FD_DEV marks a dile descriptor as belonging to a device as oposed to a - * filesystem. - */ - -#define ALT_FD_EXCL 0x80000000 -#define ALT_FD_DEV 0x40000000 - -#define ALT_FD_FLAGS_MASK (ALT_FD_EXCL | ALT_FD_DEV) - -/* - * "alt_dev_list" is the head of the linked list of registered devices. - */ - -extern alt_llist alt_dev_list; - -/* - * "alt_fs_list" is the head of the linked list of registered filesystems. - */ - -extern alt_llist alt_fs_list; - -/* - * "alt_fd_list_lock" is a semaphore used to ensure that access to the pool - * of file descriptors is thread safe. - */ - -ALT_EXTERN_SEM(alt_fd_list_lock) - -/* - * "alt_max_fd" is a 'high water mark'. It indicates the highest file - * descriptor allocated. Use of this can save searching the entire pool - * for active file descriptors, which helps avoid contention on access - * to the file descriptor pool. - */ - -extern alt_32 alt_max_fd; - -/* - * alt_io_redirect() is called at startup to redirect stdout, stdin, and - * stderr to the devices named in the input arguments. By default these streams - * are directed at /dev/null, and are then redirected using this function once - * all of the devices have been registered within the system. - */ - -extern void alt_io_redirect(const char* stdout_dev, - const char* stdin_dev, - const char* stderr_dev); - - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_FILE_H__ */ diff --git a/software/qsys_tutorial_test_bsp/HAL/inc/priv/alt_iic_isr_register.h b/software/qsys_tutorial_test_bsp/HAL/inc/priv/alt_iic_isr_register.h deleted file mode 100644 index a0cb01c..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/inc/priv/alt_iic_isr_register.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef __ALT_IIC_ISR_REGISTER_H_ -#define __ALT_IIC_ISR_REGISTER_H_ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ -#include "alt_types.h" -#include "sys/alt_irq.h" - -extern int alt_iic_isr_register(alt_u32 ic_id, alt_u32 irq, alt_isr_func isr, - void *isr_context, void *flags); - -#endif /* __ALT_IIC_ISR_REGISTER_H_ */ diff --git a/software/qsys_tutorial_test_bsp/HAL/inc/priv/alt_irq_table.h b/software/qsys_tutorial_test_bsp/HAL/inc/priv/alt_irq_table.h deleted file mode 100644 index 694ef06..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/inc/priv/alt_irq_table.h +++ /dev/null @@ -1,59 +0,0 @@ -#ifndef __ALT_IRQ_TABLE_H__ -#define __ALT_IRQ_TABLE_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * Definition of a table describing each interrupt handler. The index into - * the array is the interrupt id associated with the handler. - * - * When an interrupt occurs, the associated handler is called with - * the argument stored in the context member. - * - * The table is physically created in alt_irq_handler.c - */ -extern struct ALT_IRQ_HANDLER -{ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - void (*handler)(void*); -#else - void (*handler)(void*, alt_u32); -#endif - void *context; -} alt_irq[ALT_NIRQ]; - -#endif diff --git a/software/qsys_tutorial_test_bsp/HAL/inc/priv/alt_legacy_irq.h b/software/qsys_tutorial_test_bsp/HAL/inc/priv/alt_legacy_irq.h deleted file mode 100644 index c7aec02..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/inc/priv/alt_legacy_irq.h +++ /dev/null @@ -1,158 +0,0 @@ -#ifndef __ALT_LEGACY_IRQ_H__ -#define __ALT_LEGACY_IRQ_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * This file provides prototypes and inline implementations of certain routines - * used by the legacy interrupt API. Do not include this in your driver or - * application source files, use "sys/alt_irq.h" instead to access the proper - * public API. - */ - -#include -#include "system.h" - -#ifndef NIOS2_EIC_PRESENT - -#include "nios2.h" -#include "alt_types.h" - -#include "sys/alt_irq.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * alt_irq_register() can be used to register an interrupt handler. If the - * function is succesful, then the requested interrupt will be enabled upon - * return. - */ -extern int alt_irq_register (alt_u32 id, - void* context, - alt_isr_func handler); - -/* - * alt_irq_disable() disables the individual interrupt indicated by "id". - */ -static ALT_INLINE int ALT_ALWAYS_INLINE alt_irq_disable (alt_u32 id) -{ - alt_irq_context status; - extern volatile alt_u32 alt_irq_active; - - status = alt_irq_disable_all (); - - alt_irq_active &= ~(1 << id); - NIOS2_WRITE_IENABLE (alt_irq_active); - - alt_irq_enable_all(status); - - return 0; -} - -/* - * alt_irq_enable() enables the individual interrupt indicated by "id". - */ -static ALT_INLINE int ALT_ALWAYS_INLINE alt_irq_enable (alt_u32 id) -{ - alt_irq_context status; - extern volatile alt_u32 alt_irq_active; - - status = alt_irq_disable_all (); - - alt_irq_active |= (1 << id); - NIOS2_WRITE_IENABLE (alt_irq_active); - - alt_irq_enable_all(status); - - return 0; -} - -#ifndef ALT_EXCEPTION_STACK -/* - * alt_irq_initerruptable() should only be called from within an ISR. It is used - * to allow higer priority interrupts to interrupt the current ISR. The input - * argument, "priority", is the priority, i.e. interrupt number of the current - * interrupt. - * - * If this function is called, then the ISR is required to make a call to - * alt_irq_non_interruptible() before returning. The input argument to - * alt_irq_non_interruptible() is the return value from alt_irq_interruptible(). - * - * Care should be taken when using this pair of functions, since they increasing - * the system overhead associated with interrupt handling. - * - * If you are using an exception stack then nested interrupts won't work, so - * these functions are not available in that case. - */ -static ALT_INLINE alt_u32 ALT_ALWAYS_INLINE alt_irq_interruptible (alt_u32 priority) -{ - extern volatile alt_u32 alt_priority_mask; - extern volatile alt_u32 alt_irq_active; - - alt_u32 old_priority; - - old_priority = alt_priority_mask; - alt_priority_mask = (1 << priority) - 1; - - NIOS2_WRITE_IENABLE (alt_irq_active & alt_priority_mask); - - NIOS2_WRITE_STATUS (1); - - return old_priority; -} - -/* - * See Comments above for alt_irq_interruptible() for an explanation of the use of this - * function. - */ -static ALT_INLINE void ALT_ALWAYS_INLINE alt_irq_non_interruptible (alt_u32 mask) -{ - extern volatile alt_u32 alt_priority_mask; - extern volatile alt_u32 alt_irq_active; - - NIOS2_WRITE_STATUS (0); - - alt_priority_mask = mask; - - NIOS2_WRITE_IENABLE (mask & alt_irq_active); -} -#endif /* ALT_EXCEPTION_STACK */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* NIOS2_EIC_PRESENT */ - -#endif /* __ALT_LEGACY_IRQ_H__ */ diff --git a/software/qsys_tutorial_test_bsp/HAL/inc/priv/alt_no_error.h b/software/qsys_tutorial_test_bsp/HAL/inc/priv/alt_no_error.h deleted file mode 100644 index 6143fc9..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/inc/priv/alt_no_error.h +++ /dev/null @@ -1,77 +0,0 @@ -#ifndef __ALT_NO_ERROR_H__ -#define __ALT_NO_ERROR_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "alt_types.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * alt_no_error() is a dummy function used by alt_sem.h and alt_flag.h. It - * substitutes for functions that have a return code by creating a function - * that always returns zero. - * - * This may seem a little obscure, but what happens is that the compiler can - * then optomise away the call to this function, and any code written which - * handles the error path (i.e. non zero return values). - * - * This allows code to be written which correctly use the uC/OS-II semaphore - * and flag utilities, without the use of those utilities impacting on - * excutables built for a single threaded HAL environment. - * - * This function is considered to be part of the internal implementation of - * the HAL, and should not be called directly by application code or device - * drivers. It is not guaranteed to be preserved in future versions of the - * HAL. - */ - -static ALT_INLINE int ALT_ALWAYS_INLINE alt_no_error (void) -{ - return 0; -} - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_NO_ERROR_H__ */ diff --git a/software/qsys_tutorial_test_bsp/HAL/inc/priv/nios2_gmon_data.h b/software/qsys_tutorial_test_bsp/HAL/inc/priv/nios2_gmon_data.h deleted file mode 100644 index 3f43f12..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/inc/priv/nios2_gmon_data.h +++ /dev/null @@ -1,47 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ -#ifndef NIOS2_GMON_DATA_H -#define NIOS2_GMON_DATA_H - -#define GMON_DATA_SIG 0 -#define GMON_DATA_WORDS 1 -#define GMON_DATA_PROFILE_DATA 2 -#define GMON_DATA_PROFILE_LOWPC 3 -#define GMON_DATA_PROFILE_HIGHPC 4 -#define GMON_DATA_PROFILE_BUCKET 5 -#define GMON_DATA_PROFILE_RATE 6 -#define GMON_DATA_MCOUNT_START 7 -#define GMON_DATA_MCOUNT_LIMIT 8 - -#define GMON_DATA_SIZE 9 - -extern unsigned int alt_gmon_data[GMON_DATA_SIZE]; - -#endif diff --git a/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_alarm.h b/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_alarm.h deleted file mode 100644 index 68a2f5d..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_alarm.h +++ /dev/null @@ -1,126 +0,0 @@ -#ifndef __ALT_ALARM_H__ -#define __ALT_ALARM_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "alt_llist.h" -#include "alt_types.h" - -#include "priv/alt_alarm.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * "alt_alarm" is a structure type used by applications to register an alarm - * callback function. An instance of this type must be passed as an input - * argument to alt_alarm_start(). The user is not responsible for initialising - * the contents of the instance. This is done by alt_alarm_start(). - */ - -typedef struct alt_alarm_s alt_alarm; - -/* - * alt_alarm_start() can be called by an application/driver in order to register - * a function for periodic callback at the system clock frequency. Be aware that - * this callback is likely to occur in interrupt context. - */ - -extern int alt_alarm_start (alt_alarm* the_alarm, - alt_u32 nticks, - alt_u32 (*callback) (void* context), - void* context); - -/* - * alt_alarm_stop() is used to unregister a callback. Alternatively the callback - * can return zero to unregister. - */ - -extern void alt_alarm_stop (alt_alarm* the_alarm); - -/* - * Obtain the system clock rate in ticks/s. - */ - -static ALT_INLINE alt_u32 ALT_ALWAYS_INLINE alt_ticks_per_second (void) -{ - return _alt_tick_rate; -} - -/* - * alt_sysclk_init() is intended to be only used by the system clock driver - * in order to initialise the value of the clock frequency. - */ - -static ALT_INLINE int ALT_ALWAYS_INLINE alt_sysclk_init (alt_u32 nticks) -{ - if (! _alt_tick_rate) - { - _alt_tick_rate = nticks; - return 0; - } - else - { - return -1; - } -} - -/* - * alt_nticks() returns the elapsed number of system clock ticks since reset. - */ - -static ALT_INLINE alt_u32 ALT_ALWAYS_INLINE alt_nticks (void) -{ - return _alt_nticks; -} - -/* - * alt_tick() should only be called by the system clock driver. This is used - * to notify the system that the system timer period has expired. - */ - -extern void alt_tick (void); - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_ALARM_H__ */ diff --git a/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_cache.h b/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_cache.h deleted file mode 100644 index c4d8db9..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_cache.h +++ /dev/null @@ -1,117 +0,0 @@ -#ifndef __ALT_CACHE_H__ -#define __ALT_CACHE_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003, 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include - -#include "alt_types.h" - -/* - * alt_cache.h defines the processor specific functions for manipulating the - * cache. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * alt_icache_flush() is called to flush the instruction cache for a memory - * region of length "len" bytes, starting at address "start". - */ - -extern void alt_icache_flush (void* start, alt_u32 len); - -/* - * alt_dcache_flush() is called to flush the data cache for a memory - * region of length "len" bytes, starting at address "start". - * Any dirty lines in the data cache are written back to memory. - */ - -extern void alt_dcache_flush (void* start, alt_u32 len); - -/* - * alt_dcache_flush() is called to flush the data cache for a memory - * region of length "len" bytes, starting at address "start". - * Any dirty lines in the data cache are NOT written back to memory. - */ - -extern void alt_dcache_flush_no_writeback (void* start, alt_u32 len); - -/* - * Flush the entire instruction cache. - */ - -extern void alt_icache_flush_all (void); - -/* - * Flush the entire data cache. - */ - -extern void alt_dcache_flush_all (void); - -/* - * Allocate a block of uncached memory. - */ - -extern volatile void* alt_uncached_malloc (size_t size); - -/* - * Free a block of uncached memory. - */ - -extern void alt_uncached_free (volatile void* ptr); - -/* - * Convert a pointer to a block of cached memory, into a block of - * uncached memory. - */ - -extern volatile void* alt_remap_uncached (void* ptr, alt_u32 len); - -/* - * Convert a pointer to a block of uncached memory, into a block of - * cached memory. - */ - -extern void* alt_remap_cached (volatile void* ptr, alt_u32 len); - -/* - * - */ - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_CACHE_H__ */ diff --git a/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_debug.h b/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_debug.h deleted file mode 100644 index d9f9599..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_debug.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef __ALT_DEBUG_H__ -#define __ALT_DEBUG_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * The ALT_DEVUG_ASSERT macro can be used to generate a debugger break - * from within software. The break is generated if "condition" evaluates to - * false. - */ - -#define ALT_DEBUG_ASSERT(condition) if (!condition) \ -{ \ - __asm__ volatile ("break"); \ -} - -#endif /* __ALT_DEBUG_H__ */ diff --git a/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_dev.h b/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_dev.h deleted file mode 100644 index 66c5e41..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_dev.h +++ /dev/null @@ -1,115 +0,0 @@ -#ifndef __ALT_DEV_H__ -#define __ALT_DEV_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "system.h" -#include "sys/alt_llist.h" -#include "priv/alt_dev_llist.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The value ALT_IRQ_NOT_CONNECTED is used to represent an unconnected - * interrupt line. It cannot evaluate to a valid interrupt number. - */ - -#define ALT_IRQ_NOT_CONNECTED (-1) - -typedef struct alt_dev_s alt_dev; - -struct stat; - -/* - * The file descriptor structure definition. - */ - -typedef struct alt_fd_s -{ - alt_dev* dev; - alt_u8* priv; - int fd_flags; -} alt_fd; - -/* - * The device structure definition. - */ - -struct alt_dev_s { - alt_llist llist; /* for internal use */ - const char* name; - int (*open) (alt_fd* fd, const char* name, int flags, int mode); - int (*close) (alt_fd* fd); - int (*read) (alt_fd* fd, char* ptr, int len); - int (*write) (alt_fd* fd, const char* ptr, int len); - int (*lseek) (alt_fd* fd, int ptr, int dir); - int (*fstat) (alt_fd* fd, struct stat* buf); - int (*ioctl) (alt_fd* fd, int req, void* arg); -}; - -/* - * Functions used to register device for access through the C standard - * library. - * - * The only difference between alt_dev_reg() and alt_fs_reg() is the - * interpretation that open() places on the device name. In the case of - * alt_dev_reg the device is assumed to be a particular character device, - * and so there must be an exact match in the name for open to succeed. - * In the case of alt_fs_reg() the name of the device is treated as the - * mount point for a directory, and so any call to open() where the name - * is the root of the device filename will succeed. - */ - -extern int alt_fs_reg (alt_dev* dev); - -static ALT_INLINE int alt_dev_reg (alt_dev* dev) -{ - extern alt_llist alt_dev_list; - - return alt_dev_llist_insert ((alt_dev_llist*) dev, &alt_dev_list); -} - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_DEV_H__ */ diff --git a/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_dma.h b/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_dma.h deleted file mode 100644 index 9f9b2ff..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_dma.h +++ /dev/null @@ -1,226 +0,0 @@ -#ifndef __ALT_DMA_H__ -#define __ALT_DMA_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "sys/alt_dma_dev.h" -#include "alt_types.h" - -#include - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * This header contains the application side interface for accessing DMA - * resources. See alt_dma_dev.h for the dma device driver interface. - * - * The interface model treats a DMA transaction as being composed of two - * halves (read and write). - * - * The application can supply data for transmit using an "alt_dma_txchan" - * descriptor. Alternatively an "alt_dma_rxchan" descriptor can be used to - * receive data. - */ - -/* - * alt_dma_txchan_open() is used to obtain an "alt_dma_txchan" descriptor for - * a DMA transmit device. The name is the name of the associated physical - * device (e.g. "/dev/dma_0"). - * - * The return value will be NULL on failure, and non-NULL otherwise. - */ - -extern alt_dma_txchan alt_dma_txchan_open (const char* name); - -/* - * alt_dma_txchan_close() is provided so that an application can notify the - * system that it has finished with a given DMA transmit channel. This is only - * provided for completness. - */ - -static ALT_INLINE int alt_dma_txchan_close (alt_dma_txchan dma) -{ - return 0; -} - -/* - * alt_dma_txchan_send() posts a transmit request to a DMA transmit channel. - * The input arguments are: - * - * dma: the channel to use. - * from: a pointer to the start of the data to send. - * length: the length of the data to send in bytes. - * done: callback function that will be called once the data has been sent. - * handle: opaque value passed to "done". - * - * The return value will be negative if the request cannot be posted, and - * zero otherwise. - */ - -static ALT_INLINE int alt_dma_txchan_send (alt_dma_txchan dma, - const void* from, - alt_u32 length, - alt_txchan_done* done, - void* handle) -{ - return dma ? dma->dma_send (dma, - from, - length, - done, - handle) : -ENODEV; -} - -/* - * alt_dma_txchan_space() returns the number of tranmit requests that can be - * posted to the specified DMA transmit channel. - * - * A negative value indicates that the value could not be determined. - */ - -static ALT_INLINE int alt_dma_txchan_space (alt_dma_txchan dma) -{ - return dma ? dma->space (dma) : -ENODEV; -} - -/* - * alt_dma_txchan_ioctl() can be used to perform device specific I/O - * operations on the indicated DMA transmit channel. For example some drivers - * support options to control the width of the transfer operations. See - * alt_dma_dev.h for the list of generic requests. - * - * A negative return value indicates failure, otherwise the interpretation - * of the return value is request specific. - */ - -static ALT_INLINE int alt_dma_txchan_ioctl (alt_dma_txchan dma, - int req, - void* arg) -{ - return dma ? dma->ioctl (dma, req, arg) : -ENODEV; -} - -/* - * alt_dma_rxchan_open() is used to obtain an "alt_dma_rxchan" descriptor for - * a DMA receive channel. The name is the name of the associated physical - * device (e.g. "/dev/dma_0"). - * - * The return value will be NULL on failure, and non-NULL otherwise. - */ - -extern alt_dma_rxchan alt_dma_rxchan_open (const char* dev); - -/* - * alt_dma_rxchan_close() is provided so that an application can notify the - * system that it has finished with a given DMA receive channel. This is only - * provided for completness. - */ - -static ALT_INLINE int alt_dma_rxchan_close (alt_dma_rxchan dma) -{ - return 0; -} - -/* - * - */ - -/* - * alt_dma_rxchan_prepare() posts a receive request to a DMA receive channel. - * - * The input arguments are: - * - * dma: the channel to use. - * data: a pointer to the location that data is to be received to. - * len: the maximum length of the data to receive. - * done: callback function that will be called once the data has been - * received. - * handle: opaque value passed to "done". - * - * The return value will be negative if the request cannot be posted, and - * zero otherwise. - */ - -static ALT_INLINE int alt_dma_rxchan_prepare (alt_dma_rxchan dma, - void* data, - alt_u32 len, - alt_rxchan_done* done, - void* handle) -{ - return dma ? dma->prepare (dma, data, len, done, handle) : -ENODEV; -} - -/* - * alt_dma_rxchan_ioctl() can be used to perform device specific I/O - * operations on the indicated DMA receive channel. For example some drivers - * support options to control the width of the transfer operations. See - * alt_dma_dev.h for the list of generic requests. - * - * A negative return value indicates failure, otherwise the interpretation - * of the return value is request specific. - */ - -static ALT_INLINE int alt_dma_rxchan_ioctl (alt_dma_rxchan dma, - int req, - void* arg) -{ - return dma ? dma->ioctl (dma, req, arg) : -ENODEV; -} - -/* - * alt_dma_rxchan_depth() returns the depth of the receive FIFO used to store - * receive requests. - */ - -static ALT_INLINE alt_u32 alt_dma_rxchan_depth(alt_dma_rxchan dma) -{ - return dma->depth; -} - -/* - * - */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_DMA_H__ */ diff --git a/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_dma_dev.h b/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_dma_dev.h deleted file mode 100644 index 832463d..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_dma_dev.h +++ /dev/null @@ -1,200 +0,0 @@ -#ifndef __ALT_DMA_DEV_H__ -#define __ALT_DMA_DEV_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "priv/alt_dev_llist.h" - -#include "alt_types.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * This header contains the device driver interface for accessing DMA - * resources. See alt_dma.h for the DMA application side interface. - * - * The interface model treats a DMA transaction as being composed of two - * halves (read and write). - * - * An "alt_dma_txchan_dev" is used to describe the device associated with a - * DMA transmit channel. An "alt_dma_rxchan_dev" is used to describe the - * device associated with a DMA receive channel. - */ - -/* - * List of generic ioctl requests that may be supported by a DMA device. - * - * ALT_DMA_RX_ONLY_ON: This causes a DMA channel to operate in a mode - * where only the receiver is under software control. - * The other side reads continously from a single - * location. The address to read is the argument to - * this request. - * ALT_DMA_RX_ONLY_OFF: Return to the default mode where both the receive - * and transmit sides of the DMA can be under software - * control. - * ALT_DMA_TX_ONLY_ON: This causes a DMA channel to operate in a mode - * where only the transmitter is under software control. - * The other side writes continously to a single - * location. The address to write to is the argument to - * this request. - * ALT_DMA_TX_ONLY_OFF: Return to the default mode where both the receive - * and transmit sides of the DMA can be under software - * control. - * ALT_DMA_SET_MODE_8: Transfer data in units of 8 bits. - * ALT_DMA_SET_MODE_16: Transfer data in units of 16 bits. - * ALT_DMA_SET_MODE_32: Transfer data in units of 32 bits. - * ALT_DMA_SET_MODE_64: Transfer data in units of 64 bits. - * ALT_DMA_SET_MODE_128: Transfer data in units of 128 bits. - * ALT_DMA_GET_MODE: Get the current transfer mode. - * - * The use of the macros: ALT_DMA_TX_STREAM_ON, ALT_DMA_TX_STREAM_OFF - * ALT_DMA_RX_STREAM_OFF and ALT_DMA_RX_STREAM_ON are depreciated. You should - * instead use the macros: ALT_DMA_RX_ONLY_ON, ALT_DMA_RX_ONLY_OFF, - * ALT_DMA_TX_ONLY_ON and ALT_DMA_TX_ONLY_OFF. - */ - -#define ALT_DMA_TX_STREAM_ON (0x1) -#define ALT_DMA_TX_STREAM_OFF (0x2) -#define ALT_DMA_RX_STREAM_ON (0x3) -#define ALT_DMA_RX_STREAM_OFF (0x4) -#define ALT_DMA_SET_MODE_8 (0x5) -#define ALT_DMA_SET_MODE_16 (0x6) -#define ALT_DMA_SET_MODE_32 (0x7) -#define ALT_DMA_SET_MODE_64 (0x8) -#define ALT_DMA_SET_MODE_128 (0x9) -#define ALT_DMA_GET_MODE (0xa) - -#define ALT_DMA_RX_ONLY_ON ALT_DMA_TX_STREAM_ON -#define ALT_DMA_RX_ONLY_OFF ALT_DMA_TX_STREAM_OFF -#define ALT_DMA_TX_ONLY_ON ALT_DMA_RX_STREAM_ON -#define ALT_DMA_TX_ONLY_OFF ALT_DMA_RX_STREAM_OFF - -/* - * - */ - -typedef struct alt_dma_txchan_dev_s alt_dma_txchan_dev; -typedef struct alt_dma_rxchan_dev_s alt_dma_rxchan_dev; - -typedef alt_dma_txchan_dev* alt_dma_txchan; -typedef alt_dma_rxchan_dev* alt_dma_rxchan; - -typedef void (alt_txchan_done)(void* handle); -typedef void (alt_rxchan_done)(void* handle, void* data); - -/* - * devices that provide a DMA transmit channel are required to provide an - * instance of the "alt_dma_txchan_dev" structure. - */ - -struct alt_dma_txchan_dev_s { - alt_llist llist; /* for internal use */ - const char* name; /* name of the device instance - * (e.g. "/dev/dma_0"). - */ - int (*space) (alt_dma_txchan dma); /* returns the maximum number of - * transmit requests that can be posted - */ - int (*dma_send) (alt_dma_txchan dma, - const void* from, - alt_u32 len, - alt_txchan_done* done, - void* handle); /* post a transmit request */ - int (*ioctl) (alt_dma_txchan dma, int req, void* arg); /* perform device - * specific I/O control. - */ -}; - -/* - * devices that provide a DMA receive channel are required to provide an - * instance of the "alt_dma_rxchan_dev" structure. - */ - -struct alt_dma_rxchan_dev_s { - alt_llist list; /* for internal use */ - const char* name; /* name of the device instance - * (e.g. "/dev/dma_0"). - */ - alt_u32 depth; /* maximum number of receive requests that - * can be posted. - */ - int (*prepare) (alt_dma_rxchan dma, - void* data, - alt_u32 len, - alt_rxchan_done* done, - void* handle); /* post a receive request */ - int (*ioctl) (alt_dma_rxchan dma, int req, void* arg); /* perform device - * specific I/O control. - */ -}; - -/* - * Register a DMA transmit channel with the system. - */ - -static ALT_INLINE int alt_dma_txchan_reg (alt_dma_txchan_dev* dev) -{ - extern alt_llist alt_dma_txchan_list; - - return alt_dev_llist_insert((alt_dev_llist*) dev, &alt_dma_txchan_list); -} - -/* - * Register a DMA receive channel with the system. - */ - -static ALT_INLINE int alt_dma_rxchan_reg (alt_dma_rxchan_dev* dev) -{ - extern alt_llist alt_dma_rxchan_list; - - return alt_dev_llist_insert((alt_dev_llist*) dev, &alt_dma_rxchan_list); -} - -/* - * - */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_DMA_DEV_H__ */ diff --git a/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_driver.h b/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_driver.h deleted file mode 100644 index eb0f23b..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_driver.h +++ /dev/null @@ -1,168 +0,0 @@ -#ifndef __ALT_DRIVER_H__ -#define __ALT_DRIVER_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/* - * Macros used to access a driver without HAL file descriptors. - */ - -/* - * ALT_MODULE_CLASS - * - * This macro returns the module class name for the specified module instance. - * It uses information in the system.h file. - * Neither the instance name or class name are quoted (so that they can - * be used with other pre-processor macros). - * - * Example: - * Assume the design has an instance of an altera_avalon_uart called uart1. - * Calling ALT_MODULE_CLASS(uart1) returns altera_avalon_uart. - */ - -#define ALT_MODULE_CLASS(instance) ALT_MODULE_CLASS_ ## instance - - -/* - * ALT_DRIVER_FUNC_NAME - * - * --> instance Instance name. - * --> func Function name. - * - * This macro returns the device driver function name of the specified - * module instance for the specified function name. - * - * Example: - * Assume the design has an instance of an altera_avalon_uart called uart1. - * Calling ALT_DRIVER_FUNC_NAME(uart1, write) returns - * altera_avalon_uart_write. - */ - -#define ALT_DRIVER_FUNC_NAME(instance, func) \ - ALT_DRIVER_FUNC_NAME1(ALT_MODULE_CLASS(instance), func) -#define ALT_DRIVER_FUNC_NAME1(module_class, func) \ - ALT_DRIVER_FUNC_NAME2(module_class, func) -#define ALT_DRIVER_FUNC_NAME2(module_class, func) \ - module_class ## _ ## func - -/* - * ALT_DRIVER_STATE_STRUCT - * - * --> instance Instance name. - * - * This macro returns the device driver state type name of the specified - * module instance. - * - * Example: - * Assume the design has an instance of an altera_avalon_uart called uart1. - * Calling ALT_DRIVER_STATE_STRUCT(uart1) returns: - * struct altera_avalon_uart_state_s - * - * Note that the ALT_DRIVER_FUNC_NAME macro is used even though "state" isn't - * really a function but it does match the required naming convention. - */ -#define ALT_DRIVER_STATE_STRUCT(instance) \ - struct ALT_DRIVER_FUNC_NAME(instance, state_s) - -/* - * ALT_DRIVER_STATE - * - * --> instance Instance name. - * - * This macro returns the device driver state name of the specified - * module instance. - * - * Example: - * Assume the design has an instance of an altera_avalon_uart called uart1. - * Calling ALT_DRIVER_STATE(uart1) returns uart1. - */ -#define ALT_DRIVER_STATE(instance) instance - -/* - * ALT_DRIVER_WRITE - * - * --> instance Instance name. - * --> buffer Write buffer. - * --> len Length of write buffer data. - * --> flags Control flags (e.g. O_NONBLOCK) - * - * This macro calls the "write" function of the specified driver instance. - */ - -#define ALT_DRIVER_WRITE_EXTERNS(instance) \ - extern ALT_DRIVER_STATE_STRUCT(instance) ALT_DRIVER_STATE(instance); \ - extern int ALT_DRIVER_FUNC_NAME(instance, write) \ - (ALT_DRIVER_STATE_STRUCT(instance) *, const char *, int, int); - -#define ALT_DRIVER_WRITE(instance, buffer, len, flags) \ - ALT_DRIVER_FUNC_NAME(instance, write)(&ALT_DRIVER_STATE(instance), buffer, len, flags) - - -/* - * ALT_DRIVER_READ - * - * --> instance Instance name. - * <-- buffer Read buffer. - * --> len Length of read buffer. - * --> flags Control flags (e.g. O_NONBLOCK) - * - * This macro calls the "read" function of the specified driver instance. - */ - -#define ALT_DRIVER_READ_EXTERNS(instance) \ - extern ALT_DRIVER_STATE_STRUCT(instance) ALT_DRIVER_STATE(instance); \ - extern int ALT_DRIVER_FUNC_NAME(instance, read) \ - (ALT_DRIVER_STATE_STRUCT(instance) *, const char *, int, int); - -#define ALT_DRIVER_READ(instance, buffer, len, flags) \ - ALT_DRIVER_FUNC_NAME(instance, read)(&ALT_DRIVER_STATE(instance), buffer, len, flags) - -/* - * ALT_DRIVER_IOCTL - * - * --> instance Instance name. - * --> req ioctl request (e.g. TIOCSTIMEOUT) - * --> arg Optional argument (void*) - * - * This macro calls the "ioctl" function of the specified driver instance - */ - -#define ALT_DRIVER_IOCTL_EXTERNS(instance) \ - extern ALT_DRIVER_STATE_STRUCT(instance) ALT_DRIVER_STATE(instance); \ - extern int ALT_DRIVER_FUNC_NAME(instance, ioctl) \ - (ALT_DRIVER_STATE_STRUCT(instance) *, int, void*); - -#define ALT_DRIVER_IOCTL(instance, req, arg) \ - ALT_DRIVER_FUNC_NAME(instance, ioctl)(&ALT_DRIVER_STATE(instance), req, arg) - -#endif /* __ALT_DRIVER_H__ */ diff --git a/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_errno.h b/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_errno.h deleted file mode 100644 index 4d3e50f..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_errno.h +++ /dev/null @@ -1,87 +0,0 @@ -#ifndef __ALT_ERRNO_H__ -#define __ALT_ERRNO_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * errno is defined in so that it uses the thread local version - * stored in the location pointed to by "_impure_ptr". This means that the - * accesses to errno within the HAL library can cause the entirety of - * of the structure pointed to by "_impure_ptr" to be added to the - * users application. This can be undesirable in very small footprint systems. - * - * To avoid this happening, the HAL uses the macro ALT_ERRNO, defined below, - * to access errno, rather than accessing it directly. This macro will only - * use the thread local version if some other code has already caused it to be - * included into the system, otherwise it will use the global errno value. - * - * This causes a slight increases in code size where errno is accessed, but - * can lead to significant overall benefits in very small systems. The - * increase is inconsequential when compared to the size of the structure - * pointed to by _impure_ptr. - * - * Note that this macro accesses __errno() using an externally declared - * function pointer (alt_errno). This is done so that the function call uses the - * subroutine call instruction via a register rather than an immediate address. - * This is important in the case that the code has been linked for a high - * address, but __errno() is not being used. In this case the weak linkage - * would have resulted in the instruction: "call 0" which would fail to link. - */ - -extern int* (*alt_errno) (void); - -/* Must define this so that values such as EBADFD are defined in errno.h. */ -#define __LINUX_ERRNO_EXTENSIONS__ - -#include - -#include "alt_types.h" - -#undef errno - -extern int errno; - -static ALT_INLINE int* alt_get_errno(void) -{ - return ((alt_errno) ? alt_errno() : &errno); -} - -#define ALT_ERRNO *alt_get_errno() - -#endif /* __ALT_ERRNO_H__ */ diff --git a/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_exceptions.h b/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_exceptions.h deleted file mode 100644 index 3576a52..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_exceptions.h +++ /dev/null @@ -1,127 +0,0 @@ -#ifndef __ALT_EXCEPTIONS_H__ -#define __ALT_EXCEPTIONS_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2008 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ -#include "alt_types.h" -#include "system.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * This file defines instruction-generated exception handling and registry - * API, exception type enumeration, and handler return value enumeration for - * Nios II. - */ - -/* - * The following enumeration describes the value in the CPU EXCEPTION - * register CAUSE bit field. Not all exception types will cause the - * processor to go to the exception vector; these are provided for - * reference. - */ -enum alt_exception_cause_e { - /* Exeption causes that will cause jump to exception vector */ - NIOS2_EXCEPTION_INTERRUPT = 2, - NIOS2_EXCEPTION_TRAP_INST = 3, - NIOS2_EXCEPTION_UNIMPLEMENTED_INST = 4, - NIOS2_EXCEPTION_ILLEGAL_INST = 5, - NIOS2_EXCEPTION_MISALIGNED_DATA_ADDR = 6, - NIOS2_EXCEPTION_MISALIGNED_TARGET_PC = 7, - NIOS2_EXCEPTION_DIVISION_ERROR = 8, - NIOS2_EXCEPTION_SUPERVISOR_ONLY_INST_ADDR = 9, - NIOS2_EXCEPTION_SUPERVISOR_ONLY_INST = 10, - NIOS2_EXCEPTION_SUPERVISOR_ONLY_DATA_ADDR = 11, - NIOS2_EXCEPTION_TLB_MISS = 12, - NIOS2_EXCEPTION_TLB_EXECUTE_PERM_VIOLATION = 13, - NIOS2_EXCEPTION_MPU_INST_REGION_VIOLATION = 16, - - /* Exception causes that will NOT cause a jump to exception vector */ - NIOS2_EXCEPTION_RESET = 0, - NIOS2_EXCEPTION_CPU_ONLY_RESET_REQUEST = 1, - NIOS2_EXCEPTION_TLB_READ_PERM_VIOLATION = 14, - NIOS2_EXCEPTION_TLB_WRITE_PERM_VIOLATION = 15, - NIOS2_EXCEPTION_MPU_DATA_REGION_VIOLATION = 17, - /* - * This value is passed to an exception handler's cause argument if - * "extra exceptions" information (EXECPTION) register is not - * present in the processor hardware configuration. - */ - NIOS2_EXCEPTION_CAUSE_NOT_PRESENT = -1 -}; -typedef enum alt_exception_cause_e alt_exception_cause; - -/* - * These define valid return values for a user-defined instruction-generated - * exception handler. The handler should return one of these to indicate - * whether to re-issue the instruction that triggered the exception, or to - * skip it. - */ -enum alt_exception_result_e { - NIOS2_EXCEPTION_RETURN_REISSUE_INST = 0, - NIOS2_EXCEPTION_RETURN_SKIP_INST = 1 -}; -typedef enum alt_exception_result_e alt_exception_result; - -/* - * alt_instruction_exception_register() can be used to register an exception - * handler for instruction-generated exceptions that are not handled by the - * built-in exception handler (i.e. for interrupts). - * - * The registry API is optionally enabled through the "Enable - * Instruction-related Exception API" HAL BSP setting, which will - * define the macro below. - */ -#ifdef ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API -void alt_instruction_exception_register ( - alt_exception_result (*exception_handler)( - alt_exception_cause cause, - alt_u32 exception_pc, - alt_u32 bad_addr) ); -#endif /*ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API */ - -/* - * alt_exception_cause_generated_bad_addr() indicates whether a particular - * exception cause value was from an exception-type that generated a valid - * address in the BADADDR register. The contents of BADADDR is passed to - * a user-registered exception handler in all cases, whether valid or not. - * This routine should be called to validate the bad_addr argument to - * your exception handler. - */ -int alt_exception_cause_generated_bad_addr(alt_exception_cause cause); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_EXCEPTIONS_H__ */ diff --git a/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_flash.h b/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_flash.h deleted file mode 100644 index 527328d..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_flash.h +++ /dev/null @@ -1,166 +0,0 @@ -#ifndef __ALT_FLASH_H__ -#define __ALT_FLASH_H__ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/****************************************************************************** -* * -* Alt_flash.h - User interface for flash code * -* * -* Use this interface to avoid being exposed to the internals of the device * -* driver architecture. If you chose to use the flash driver internal * -* structures we don't guarantee not to change them * -* * -* Author PRR * -* * -******************************************************************************/ - - - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#include "alt_types.h" -#include "alt_flash_types.h" -#include "alt_flash_dev.h" -#include "sys/alt_cache.h" - -alt_flash_fd* alt_flash_open_dev(const char* name); -void alt_flash_close_dev(alt_flash_fd* fd ); - -/* - * alt_write_flash - * - * Program a buffer into flash. - * - * This routine erases all the affected erase blocks (if necessary) - * and then programs the data. However it does not read the data out first - * and preserve and none overwritten data, because this would require very - * large buffers on the target. If you need - * that functionality use the functions below. - */ -static __inline__ int __attribute__ ((always_inline)) alt_write_flash( - alt_flash_fd* fd, - int offset, - const void* src_addr, - int length ) -{ - return fd->write( fd, offset, src_addr, length ); -} - -/* - * alt_read_flash - * - * Read a block of flash for most flashes this is just memcpy - * it's here for completeness in case we need it for some serial flash device - * - */ -static __inline__ int __attribute__ ((always_inline)) alt_read_flash( - alt_flash_fd* fd, int offset, - void* dest_addr, int length ) -{ - return fd->read( fd, offset, dest_addr, length ); -} - -/* - * alt_get_flash_info - * - * Return the information on the flash sectors. - * - */ -static __inline__ int __attribute__ ((always_inline)) alt_get_flash_info( - alt_flash_fd* fd, flash_region** info, - int* number_of_regions) -{ - return fd->get_info( fd, info, number_of_regions); -} - -/* - * alt_erase_flash_block - * - * Erase a particular erase block, pass in the offset to the start of - * the block and it's size - */ -static __inline__ int __attribute__ ((always_inline)) alt_erase_flash_block( - alt_flash_fd* fd, int offset, int length) -{ - int ret_code; - ret_code = fd->erase_block( fd, offset ); - - if(!ret_code) - alt_dcache_flush((alt_u8*)fd->base_addr + offset, length); - - return ret_code; -} - -/* - * alt_write_flash_block - * - * Write a particular flash block, block_offset is the offset - * (from the base of flash) to start of the block - * data_offset is the offset (from the base of flash) - * where you wish to start programming - * - * NB this function DOES NOT check that you are only writing a single - * block of data as that would slow down this function. - * - * Use alt_write_flash if you want that level of error checking. - */ - -static __inline__ int __attribute__ ((always_inline)) alt_write_flash_block( - alt_flash_fd* fd, int block_offset, - int data_offset, - const void *data, int length) -{ - - int ret_code; - ret_code = fd->write_block( fd, block_offset, data_offset, data, length ); - - if(!ret_code) - alt_dcache_flush((alt_u8*)fd->base_addr + data_offset, length); - - return ret_code; -} - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_FLASH_H__ */ diff --git a/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_flash_dev.h b/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_flash_dev.h deleted file mode 100644 index 8bab601..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_flash_dev.h +++ /dev/null @@ -1,98 +0,0 @@ -#ifndef __ALT_FLASH_DEV_H__ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/****************************************************************************** -* * -* Alt_flash_dev.h - Generic Flash device interfaces * -* * -* Author PRR * -* * -******************************************************************************/ -#define __ALT_FLASH_DEV_H__ - -#include "alt_flash_types.h" -#include "sys/alt_llist.h" -#include "priv/alt_dev_llist.h" - -#include "alt_types.h" - -typedef struct alt_flash_dev alt_flash_dev; -typedef alt_flash_dev alt_flash_fd; - -static ALT_INLINE int alt_flash_device_register( alt_flash_fd* fd) -{ - extern alt_llist alt_flash_dev_list; - - return alt_dev_llist_insert ((alt_dev_llist*) fd, &alt_flash_dev_list); -} - -typedef alt_flash_dev* (*alt_flash_open)(alt_flash_dev* flash, - const char* name ); -typedef int (*alt_flash_close)(alt_flash_dev* flash_info); - -typedef int (*alt_flash_write)( alt_flash_dev* flash, int offset, - const void* src_addr, int length ); - -typedef int (*alt_flash_get_flash_info)( alt_flash_dev* flash, flash_region** info, - int* number_of_regions); -typedef int (*alt_flash_write_block)( alt_flash_dev* flash, int block_offset, - int data_offset, const void* data, - int length); -typedef int (*alt_flash_erase_block)( alt_flash_dev* flash, int offset); -typedef int (*alt_flash_read)(alt_flash_dev* flash, int offset, - void* dest_addr, int length ); - -struct alt_flash_dev -{ - alt_llist llist; - const char* name; - alt_flash_open open; - alt_flash_close close; - alt_flash_write write; - alt_flash_read read; - alt_flash_get_flash_info get_info; - alt_flash_erase_block erase_block; - alt_flash_write_block write_block; - void* base_addr; - int length; - int number_of_regions; - flash_region region_info[ALT_MAX_NUMBER_OF_FLASH_REGIONS]; -}; - -#endif /* __ALT_FLASH_DEV_H__ */ diff --git a/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_flash_types.h b/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_flash_types.h deleted file mode 100644 index 884cbf8..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_flash_types.h +++ /dev/null @@ -1,64 +0,0 @@ -#ifndef __ALT_FLASH_TYPES_H__ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/****************************************************************************** -* * -* Alt_flash_types.h - Some generic types and defines used by the flash code * -* * -* Author PRR * -* * -******************************************************************************/ -#define __ALT_FLASH_TYPES_H__ - -#ifndef ALT_MAX_NUMBER_OF_FLASH_REGIONS -#define ALT_MAX_NUMBER_OF_FLASH_REGIONS 8 -#endif /* ALT_MAX_NUMBER_OF_FLASH_REGIONS */ - -/* - * Description of a single Erase region - */ -typedef struct flash_region -{ - int offset; - int region_size; - int number_of_blocks; - int block_size; -}flash_region; - -#endif /* __ALT_FLASH_TYPES_H__ */ diff --git a/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_irq.h b/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_irq.h deleted file mode 100644 index 6666e52..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_irq.h +++ /dev/null @@ -1,245 +0,0 @@ -#ifndef __ALT_IRQ_H__ -#define __ALT_IRQ_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * alt_irq.h is the Nios II specific implementation of the interrupt controller - * interface. - * - * Nios II includes optional support for an external interrupt controller. - * When an external controller is present, the "Enhanced" interrupt API - * must be used to manage individual interrupts. The enhanced API also - * supports the processor's internal interrupt controller. Certain API - * members are accessible from either the "legacy" or "enhanced" interrpt - * API. - * - * Regardless of which API is in use, this file should be included by - * application code and device drivers that register ISRs or manage interrpts. - */ -#include - -#include "nios2.h" -#include "alt_types.h" -#include "system.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * Macros used by alt_irq_enabled - */ -#define ALT_IRQ_ENABLED 1 -#define ALT_IRQ_DISABLED 0 - -/* - * Number of available interrupts in internal interrupt controller. - */ -#define ALT_NIRQ NIOS2_NIRQ - -/* - * Used by alt_irq_disable_all() and alt_irq_enable_all(). - */ -typedef int alt_irq_context; - -/* ISR Prototype */ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT -typedef void (*alt_isr_func)(void* isr_context); -#else -typedef void (*alt_isr_func)(void* isr_context, alt_u32 id); -#endif - -/* - * The following protypes and routines are supported by both - * the enhanced and legacy interrupt APIs - */ - -/* - * alt_irq_enabled can be called to determine if the processor's global - * interrupt enable is asserted. The return value is zero if interrupts - * are disabled, and non-zero otherwise. - * - * Whether the internal or external interrupt controller is present, - * individual interrupts may still be disabled. Use the other API to query - * a specific interrupt. - */ -static ALT_INLINE int ALT_ALWAYS_INLINE alt_irq_enabled (void) -{ - int status; - - NIOS2_READ_STATUS (status); - - return status & NIOS2_STATUS_PIE_MSK; -} - -/* - * alt_irq_disable_all() - * - * This routine inhibits all interrupts by negating the status register PIE - * bit. It returns the previous contents of the CPU status register (IRQ - * context) which can be used to restore the status register PIE bit to its - * state before this routine was called. - */ -static ALT_INLINE alt_irq_context ALT_ALWAYS_INLINE - alt_irq_disable_all (void) -{ - alt_irq_context context; - - NIOS2_READ_STATUS (context); - - NIOS2_WRITE_STATUS (context & ~NIOS2_STATUS_PIE_MSK); - - return context; -} - -/* - * alt_irq_enable_all() - * - * Enable all interrupts that were previously disabled by alt_irq_disable_all() - * - * This routine accepts a context to restore the CPU status register PIE bit - * to the state prior to a call to alt_irq_disable_all(). - - * In the case of nested calls to alt_irq_disable_all()/alt_irq_enable_all(), - * this means that alt_irq_enable_all() does not necessarily re-enable - * interrupts. - * - * This routine will perform a read-modify-write sequence to restore only - * status.PIE if the processor is configured with options that add additional - * writeable status register bits. These include the MMU, MPU, the enhanced - * interrupt controller port, and shadow registers. Otherwise, as a performance - * enhancement, status is overwritten with the prior context. - */ -static ALT_INLINE void ALT_ALWAYS_INLINE - alt_irq_enable_all (alt_irq_context context) -{ -#if (NIOS2_NUM_OF_SHADOW_REG_SETS > 0) || (defined NIOS2_EIC_PRESENT) || \ - (defined NIOS2_MMU_PRESENT) || (defined NIOS2_MPU_PRESENT) - alt_irq_context status; - - NIOS2_READ_STATUS (status); - - status &= ~NIOS2_STATUS_PIE_MSK; - status |= (context & NIOS2_STATUS_PIE_MSK); - - NIOS2_WRITE_STATUS (status); -#else - NIOS2_WRITE_STATUS (context); -#endif -} - -/* - * The function alt_irq_init() is defined within the auto-generated file - * alt_sys_init.c. This function calls the initilization macros for all - * interrupt controllers in the system at config time, before any other - * non-interrupt controller driver is initialized. - * - * The "base" parameter is ignored and only present for backwards-compatibility. - * It is recommended that NULL is passed in for the "base" parameter. - */ -extern void alt_irq_init (const void* base); - -/* - * alt_irq_cpu_enable_interrupts() enables the CPU to start taking interrupts. - */ -static ALT_INLINE void ALT_ALWAYS_INLINE - alt_irq_cpu_enable_interrupts () -{ - NIOS2_WRITE_STATUS(NIOS2_STATUS_PIE_MSK -#if defined(NIOS2_EIC_PRESENT) && (NIOS2_NUM_OF_SHADOW_REG_SETS > 0) - | NIOS2_STATUS_RSIE_MSK -#endif - ); -} - - -/* - * Prototypes for the enhanced interrupt API. - */ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT -/* - * alt_ic_isr_register() can be used to register an interrupt handler. If the - * function is succesful, then the requested interrupt will be enabled upon - * return. - */ -extern int alt_ic_isr_register(alt_u32 ic_id, - alt_u32 irq, - alt_isr_func isr, - void *isr_context, - void *flags); - -/* - * alt_ic_irq_enable() and alt_ic_irq_disable() enable/disable a specific - * interrupt by using IRQ port and interrupt controller instance. - */ -int alt_ic_irq_enable (alt_u32 ic_id, alt_u32 irq); -int alt_ic_irq_disable(alt_u32 ic_id, alt_u32 irq); - - /* - * alt_ic_irq_enabled() indicates whether a specific interrupt, as - * specified by IRQ port and interrupt controller instance is enabled. - */ -alt_u32 alt_ic_irq_enabled(alt_u32 ic_id, alt_u32 irq); - -#else -/* - * Prototypes for the legacy interrupt API. - */ -#include "priv/alt_legacy_irq.h" -#endif - - -/* - * alt_irq_pending() returns a bit list of the current pending interrupts. - * This is used by alt_irq_handler() to determine which registered interrupt - * handlers should be called. - * - * This routine is only available for the Nios II internal interrupt - * controller. - */ -#ifndef NIOS2_EIC_PRESENT -static ALT_INLINE alt_u32 ALT_ALWAYS_INLINE alt_irq_pending (void) -{ - alt_u32 active; - - NIOS2_READ_IPENDING (active); - - return active; -} -#endif - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_IRQ_H__ */ diff --git a/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_irq_entry.h b/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_irq_entry.h deleted file mode 100644 index e2008d9..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_irq_entry.h +++ /dev/null @@ -1,39 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * This file pulls in the IRQ entry assembler and C code, which is only - * required if there are any interruptes in the system. - */ - -__asm__( "\n\t.globl alt_irq_entry" ); - -__asm__( "\n\t.globl alt_irq_handler" ); - diff --git a/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_license_reminder_ucosii.h b/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_license_reminder_ucosii.h deleted file mode 100644 index 2fe649c..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_license_reminder_ucosii.h +++ /dev/null @@ -1,77 +0,0 @@ -#ifndef __ALT_LICENSE_REMINDER_UCOSII_H__ -#define __ALT_LICENSE_REMINDER_UCOSII_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include - -#define ALT_LICENSE_REMINDER_UCOSII_STRING \ - "============== Software License Reminder ===============\n" \ - "\n" \ - "uC/OS-II is provided in source form for FREE evaluation,\n" \ - "for educational use, or for peaceful research. If you\n" \ - "plan on using uC/OS-II in a commercial product you need\n" \ - "to contact Micrium to properly license its use in your\n" \ - "product. Micrium provides ALL the source code on the\n" \ - "Altera distribution for your convenience and to help you\n" \ - "experience uC/OS-II. The fact that the source is provided\n" \ - "does NOT mean that you can use it without paying a\n" \ - "licensing fee. Please help us continue to provide the\n" \ - "Embedded community with the finest software available.\n" \ - "Your honesty is greatly appreciated.\n" \ - "\n" \ - "Please contact:\n" \ - "\n" \ - "M I C R I U M\n" \ - "949 Crestview Circle\n" \ - "Weston, FL 33327-1848\n" \ - "U.S.A.\n" \ - "\n" \ - "Phone : +1 954 217 2036\n" \ - "FAX : +1 954 217 2037\n" \ - "WEB : www.micrium.com\n" \ - "E-mail: Sales@Micrium.com\n" \ - "\n" \ - "========================================================\n" - -#define alt_license_reminder_ucosii() puts(ALT_LICENSE_REMINDER_UCOSII_STRING) - - -#endif /* __ALT_LICENSE_REMINDER_UCOSII_H__ */ - diff --git a/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_llist.h b/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_llist.h deleted file mode 100644 index 46f81ce..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_llist.h +++ /dev/null @@ -1,123 +0,0 @@ -#ifndef __ALT_LIST_H__ -#define __ALT_LIST_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "alt_types.h" - -/* - * alt_llist.h defines structures and functions for use in manipulating linked - * lists. A list is considered to be constructed from a chain of objects of - * type alt_llist, with one object being defined to be the head element. - * - * A list is considered to be empty if it only contains the head element. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * alt_llist is the structure used to represent an element within a linked - * list. - */ - -typedef struct alt_llist_s alt_llist; - -struct alt_llist_s { - alt_llist* next; /* Pointer to the next element in the list. */ - alt_llist* previous; /* Pointer to the previous element in the list. */ -}; - -/* - * ALT_LLIST_HEAD is a macro that can be used to create the head of a new - * linked list. This is named "head". The head element is initialised to - * represent an empty list. - */ - -#define ALT_LLIST_HEAD(head) alt_llist head = {&head, &head} - -/* - * ALT_LLIST_ENTRY is a macro used to define an uninitialised linked list - * entry. This is used to reserve space in structure initialisation for - * structures that inherit form alt_llist. - */ - -#define ALT_LLIST_ENTRY {0, 0} - -/* - * alt_llist_insert() insert adds the linked list entry "entry" as the - * first entry in the linked list "list". "list" is the list head element. - */ - -static ALT_INLINE void ALT_ALWAYS_INLINE alt_llist_insert(alt_llist* list, - alt_llist* entry) -{ - entry->previous = list; - entry->next = list->next; - - list->next->previous = entry; - list->next = entry; -} - -/* - * alt_llist_remove() is called to remove an element from a linked list. The - * input argument is the element to remove. - */ - -static ALT_INLINE void ALT_ALWAYS_INLINE alt_llist_remove(alt_llist* entry) -{ - entry->next->previous = entry->previous; - entry->previous->next = entry->next; - - /* - * Set the entry to point to itself, so that any further calls to - * alt_llist_remove() are harmless. - */ - - entry->previous = entry; - entry->next = entry; -} - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_LLIST_H__ */ diff --git a/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_load.h b/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_load.h deleted file mode 100644 index 432e9f2..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_load.h +++ /dev/null @@ -1,78 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "alt_types.h" - -/* - * This macro is used to load code/data from its load address to its - * execution address for a given section. The section name is the input - * argument. Note that a leading '.' is assumed in the name. For example - * to load the section .onchip_ram, use: - * - * ALT_LOAD_SECTION_BY_NAME(onchip_ram); - * - * This requires that the apropriate linker symbols have been generated - * for the section in question. This will be the case if you are using the - * default linker script. - */ - -#define ALT_LOAD_SECTION_BY_NAME(name) \ - { \ - extern void _alt_partition_##name##_start; \ - extern void _alt_partition_##name##_end; \ - extern void _alt_partition_##name##_load_addr; \ - \ - alt_load_section(&_alt_partition_##name##_load_addr, \ - &_alt_partition_##name##_start, \ - &_alt_partition_##name##_end); \ - } - -/* - * Function used to load an individual section from flash to RAM. - * - * There is an implicit assumption here that the linker script will ensure - * that all sections are word aligned. - * - */ - -static void ALT_INLINE alt_load_section (alt_u32* from, - alt_u32* to, - alt_u32* end) -{ - if (to != from) - { - while( to != end ) - { - *to++ = *from++; - } - } -} diff --git a/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_log_printf.h b/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_log_printf.h deleted file mode 100644 index c15ca05..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_log_printf.h +++ /dev/null @@ -1,349 +0,0 @@ -/* alt_log_printf.h - * - * ALT_LOG is designed to provide extra logging/debugging messages from HAL - * through a different port than stdout. It is enabled by the ALT_LOG_ENABLE - * define, which needs to supplied at compile time. When logging is turned off, - * code size is unaffected. Thus, this should be transparent to the user - * when it is not actively turned on, and should not affect projects in any way. - * - * There are macros sprinkled within different components, such as the jtag uart - * and timer, in the HAL code. They are always named ALT_LOG_, and can be - * safely ignored if ALT_LOG is turned off. - * - * To turn on ALT_LOG, ALT_LOG_ENABLE must be defined, and ALT_LOG_PORT_TYPE and - * ALT_LOG_PORT_BASE must be set in system.h. This is done through editing - * .ptf, by editing the alt_log_port_type & alt_log_port_base settings. - * See the documentation html file for examples. - * - * When it is turned on, it will output extra HAL messages to a port specified - * in system.h. This can be a UART or JTAG UART port. By default it will - * output boot messages, detailing every step of the boot process. - * - * Extra logging is designed to be enabled by flags, which are defined in - * alt_log_printf.c. The default value is that all flags are off, so only the - * boot up logging messages show up. ALT_LOG_FLAGS can be set to enable certain - * groupings of flags, and that grouping is done in this file. Each flag can - * also be overridden with a -D at compile time. - * - * This header file includes the necessary prototypes for using the alt_log - * functions. It also contains all the macros that are used to remove the code - * from alt log is turned off. Also, the macros in other HAL files are defined - * here at the bottom. These macros all call some C function that is in - * alt_log_printf.c. - * - * The logging has functions for printing in C (ALT_LOG_PRINTF) and in assembly - * (ALT_LOG_PUTS). This was needed because the assembly printing occurs before - * the device is initialized. The assembly function corrupts register R4-R7, - * which are not used in the normal boot process. For this reason, do not call - * the assembly function in C. - * - * author: gkwan - */ - - -#ifndef __ALT_LOG_PRINTF_H__ -#define __ALT_LOG_PRINTF_H__ - -#include - -/* Global switch to turn on logging functions */ -#ifdef ALT_LOG_ENABLE - - /* ALT_LOG_PORT_TYPE values as defined in system.h. They are defined as - * numbers here first becasue the C preprocessor does not handle string - * comparisons. */ - #define ALTERA_AVALON_JTAG_UART 1 - #define ALTERA_AVALON_UART 0 - - /* If this .h file is included by an assembly file, skip over include files - * that won't compile in assembly. */ - #ifndef ALT_ASM_SRC - #include - #include "sys/alt_alarm.h" - #include "sys/alt_dev.h" - #ifdef __ALTERA_AVALON_JTAG_UART - #include "altera_avalon_jtag_uart.h" - #endif - #endif /* ALT_ASM_SRC */ - - /* These are included for the port register offsets and masks, needed - * to write to the port. Only include if the port type is set correctly, - * otherwise error. If alt_log is turned on and the port to output to is - * incorrect or does not exist, then should exit. */ - #if ALT_LOG_PORT_TYPE == ALTERA_AVALON_JTAG_UART - #ifdef __ALTERA_AVALON_JTAG_UART - #include - #else - #error ALT_LOG: JTAG_UART port chosen, but no JTAG_UART in system. - #endif - #elif ALT_LOG_PORT_TYPE == ALTERA_AVALON_UART - #ifdef __ALTERA_AVALON_UART - #include - #else - #error ALT_LOG: UART Port chosen, but no UART in system. - #endif - #else - #error ALT_LOG: alt_log_port_type declaration invalid! - #endif - - /* ALT_LOG_ENABLE turns on the basic printing function */ - #define ALT_LOG_PRINTF(...) do {alt_log_printf_proc(__VA_ARGS__);} while (0) - - /* Assembly macro for printing in assembly, calls tx_log_str - * which is in alt_log_macro.S. - * If alt_log_boot_on_flag is 0, skips the printing */ - #define ALT_LOG_PUTS(str) movhi r4, %hiadj(alt_log_boot_on_flag) ; \ - addi r4, r4, %lo(alt_log_boot_on_flag) ; \ - ldwio r5, 0(r4) ; \ - beq r0, r5, 0f ; \ - movhi r4, %hiadj(str) ; \ - addi r4, r4, %lo(str) ; \ - call tx_log_str ; \ - 0: - - /* These defines are here to faciliate the use of one output function - * (alt_log_txchar) to print to both the JTAG UART or the UART. Depending - * on the port type, the status register, read mask, and output register - * are set to the appropriate value for the port. */ - #if ALT_LOG_PORT_TYPE == ALTERA_AVALON_JTAG_UART - #define ALT_LOG_PRINT_REG_RD IORD_ALTERA_AVALON_JTAG_UART_CONTROL - #define ALT_LOG_PRINT_MSK ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_MSK - #define ALT_LOG_PRINT_TXDATA_WR IOWR_ALTERA_AVALON_JTAG_UART_DATA - #define ALT_LOG_PRINT_REG_OFFSET (ALTERA_AVALON_JTAG_UART_CONTROL_REG*0x4) - #define ALT_LOG_PRINT_TXDATA_REG_OFFSET (ALTERA_AVALON_JTAG_UART_DATA_REG*0x4) - #elif ALT_LOG_PORT_TYPE == ALTERA_AVALON_UART - #define ALT_LOG_PRINT_REG_RD IORD_ALTERA_AVALON_UART_STATUS - #define ALT_LOG_PRINT_MSK ALTERA_AVALON_UART_STATUS_TRDY_MSK - #define ALT_LOG_PRINT_TXDATA_WR IOWR_ALTERA_AVALON_UART_TXDATA - #define ALT_LOG_PRINT_REG_OFFSET (ALTERA_AVALON_UART_STATUS_REG*0x4) - #define ALT_LOG_PRINT_TXDATA_REG_OFFSET (ALTERA_AVALON_UART_TXDATA_REG*0x4) - #endif /* ALT_LOG_PORT */ - - /* Grouping of flags via ALT_LOG_FLAGS. Each specific flag can be set via - * -D at compile time, or else they'll be set to a default value according - * to ALT_LOG_FLAGS. ALT_LOG_FLAGS = 0 or not set is the default, where - * only the boot messages will be printed. As ALT_LOG_FLAGS increase, they - * increase in intrusiveness to the program, and will affect performance. - * - * Flag Level 1 - turns on system clock and JTAG UART startup status - * 2 - turns on write echo and JTAG_UART alarm (periodic report) - * 3 - turns on JTAG UART ISR logging - will slow performance - * significantly. - * -1 - All logging output is off, but if ALT_LOG_ENABLE is - * defined all logging function is built and code size - * remains constant - * - * Flag settings - 1 = on, 0 = off. */ - - /* This flag turns on "boot" messages for printing. This includes messages - * during crt0.S, then alt_main, and finally alt_exit. */ - #ifndef ALT_LOG_BOOT_ON_FLAG_SETTING - #if ALT_LOG_FLAGS == 1 - #define ALT_LOG_BOOT_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 2 - #define ALT_LOG_BOOT_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 3 - #define ALT_LOG_BOOT_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == -1 /* silent mode */ - #define ALT_LOG_BOOT_ON_FLAG_SETTING 0x0 - #else /* default setting */ - #define ALT_LOG_BOOT_ON_FLAG_SETTING 0x1 - #endif - #endif /* ALT_LOG_BOOT_ON_FLAG_SETTING */ - - #ifndef ALT_LOG_SYS_CLK_ON_FLAG_SETTING - #if ALT_LOG_FLAGS == 1 - #define ALT_LOG_SYS_CLK_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 2 - #define ALT_LOG_SYS_CLK_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 3 - #define ALT_LOG_SYS_CLK_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == -1 /* silent mode */ - #define ALT_LOG_SYS_CLK_ON_FLAG_SETTING 0x0 - #else /* default setting */ - #define ALT_LOG_SYS_CLK_ON_FLAG_SETTING 0x0 - #endif - #endif /* ALT_LOG_SYS_CLK_ON_FLAG_SETTING */ - - #ifndef ALT_LOG_WRITE_ON_FLAG_SETTING - #if ALT_LOG_FLAGS == 1 - #define ALT_LOG_WRITE_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 2 - #define ALT_LOG_WRITE_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 3 - #define ALT_LOG_WRITE_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == -1 /* silent mode */ - #define ALT_LOG_WRITE_ON_FLAG_SETTING 0x0 - #else /* default setting */ - #define ALT_LOG_WRITE_ON_FLAG_SETTING 0x0 - #endif - #endif /* ALT_LOG_WRITE_ON_FLAG_SETTING */ - - #ifndef ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING - #ifndef __ALTERA_AVALON_JTAG_UART - #define ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 1 - #define ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 2 - #define ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 3 - #define ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == -1 /* silent mode */ - #define ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING 0x0 - #else /* default setting */ - #define ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING 0x0 - #endif - #endif /* ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING */ - - #ifndef ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING - #ifndef __ALTERA_AVALON_JTAG_UART - #define ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 1 - #define ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 2 - #define ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == 3 - #define ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == -1 /* silent mode */ - #define ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING 0x0 - #else /* default setting */ - #define ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING 0x0 - #endif - #endif /* ALT_LOG_JTAG_UART_STARTUP_INFO_FLAG_SETTING */ - - #ifndef ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING - #ifndef __ALTERA_AVALON_JTAG_UART - #define ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 1 - #define ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 2 - #define ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING 0x0 - #elif ALT_LOG_FLAGS == 3 - #define ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING 0x1 - #elif ALT_LOG_FLAGS == -1 /* silent mode */ - #define ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING 0x0 - #else /* default setting */ - #define ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING 0x0 - #endif - #endif /* ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING */ - -#ifndef ALT_ASM_SRC - /* Function Prototypes */ - void alt_log_txchar(int c,char *uartBase); - void alt_log_private_printf(const char *fmt,int base,va_list args); - void alt_log_repchar(char c,int r,int base); - int alt_log_printf_proc(const char *fmt, ... ); - void alt_log_system_clock(); - #ifdef __ALTERA_AVALON_JTAG_UART - alt_u32 altera_avalon_jtag_uart_report_log(void * context); - void alt_log_jtag_uart_startup_info(altera_avalon_jtag_uart_state* dev, int base); - void alt_log_jtag_uart_print_control_reg(altera_avalon_jtag_uart_state* dev, \ - int base, const char* header); - void alt_log_jtag_uart_isr_proc(int base, altera_avalon_jtag_uart_state* dev); - #endif - void alt_log_write(const void *ptr, size_t len); - - /* extern all global variables */ - extern volatile alt_u32 alt_log_boot_on_flag; - extern volatile alt_u8 alt_log_write_on_flag; - extern volatile alt_u8 alt_log_sys_clk_on_flag; - extern volatile alt_u8 alt_log_jtag_uart_alarm_on_flag; - extern volatile alt_u8 alt_log_jtag_uart_isr_on_flag; - extern volatile alt_u8 alt_log_jtag_uart_startup_info_on_flag; - extern volatile int alt_log_sys_clk_count; - extern volatile int alt_system_clock_in_sec; - extern alt_alarm alt_log_jtag_uart_alarm_1; -#endif /* ALT_ASM_SRC */ - - - /* Below are the MACRO defines used in various HAL files. They check - * if their specific flag is turned on; if it is, then it executes its - * code. - * - * To keep this file reasonable, most of these macros calls functions, - * which are defined in alt_log_printf.c. Look there for implementation - * details. */ - - /* Boot Messages Logging */ - #define ALT_LOG_PRINT_BOOT(...) \ - do { if (alt_log_boot_on_flag==1) {ALT_LOG_PRINTF(__VA_ARGS__);} \ - } while (0) - - /* JTAG UART Logging */ - /* number of ticks before alarm runs logging function */ - #ifndef ALT_LOG_JTAG_UART_TICKS_DIVISOR - #define ALT_LOG_JTAG_UART_TICKS_DIVISOR 10 - #endif - #ifndef ALT_LOG_JTAG_UART_TICKS - #define ALT_LOG_JTAG_UART_TICKS \ - (alt_ticks_per_second()/ALT_LOG_JTAG_UART_TICKS_DIVISOR) - #endif - - /* if there's a JTAG UART defined, then enable these macros */ - #ifdef __ALTERA_AVALON_JTAG_UART - - /* Macro in altera_avalon_jtag_uart.c, to register the alarm function. - * Also, the startup register info is also printed here, as this is - * called within the device driver initialization. */ - #define ALT_LOG_JTAG_UART_ALARM_REGISTER(dev, base) \ - do { if (alt_log_jtag_uart_alarm_on_flag==1) { \ - alt_alarm_start(&alt_log_jtag_uart_alarm_1, \ - ALT_LOG_JTAG_UART_TICKS, &altera_avalon_jtag_uart_report_log,\ - dev);} \ - if (alt_log_jtag_uart_startup_info_on_flag==1) {\ - alt_log_jtag_uart_startup_info(dev, base);} \ - } while (0) - - /* JTAG UART IRQ Logging (when buffer is empty) - * Inserted in the ISR in altera_avalon_jtag_uart.c */ - #define ALT_LOG_JTAG_UART_ISR_FUNCTION(base, dev) \ - do { alt_log_jtag_uart_isr_proc(base, dev); } while (0) - /* else, define macros to nothing. Or else the jtag_uart specific types - * will throw compiler errors */ - #else - #define ALT_LOG_JTAG_UART_ALARM_REGISTER(dev, base) - #define ALT_LOG_JTAG_UART_ISR_FUNCTION(base, dev) - #endif - - /* System clock logging - * How often (in seconds) the system clock logging prints. - * The default value is every 1 second */ - #ifndef ALT_LOG_SYS_CLK_INTERVAL_MULTIPLIER - #define ALT_LOG_SYS_CLK_INTERVAL_MULTIPLIER 1 - #endif - #ifndef ALT_LOG_SYS_CLK_INTERVAL - #define ALT_LOG_SYS_CLK_INTERVAL \ - (alt_ticks_per_second()*ALT_LOG_SYS_CLK_INTERVAL_MULTIPLIER) - #endif - - /* System clock logging - prints a message every interval (set above) - * to show that the system clock is alive. - * This macro is used in altera_avalon_timer_sc.c */ - #define ALT_LOG_SYS_CLK_HEARTBEAT() \ - do { alt_log_system_clock(); } while (0) - - /* alt_write_logging - echos a message every time write() is called, - * displays the first ALT_LOG_WRITE_ECHO_LEN characters. - * This macro is used in alt_write.c */ - #ifndef ALT_LOG_WRITE_ECHO_LEN - #define ALT_LOG_WRITE_ECHO_LEN 15 - #endif - - #define ALT_LOG_WRITE_FUNCTION(ptr,len) \ - do { alt_log_write(ptr,len); } while (0) - -#else /* ALT_LOG_ENABLE not defined */ - - /* logging is off, set all relevant macros to null */ - #define ALT_LOG_PRINT_BOOT(...) - #define ALT_LOG_PRINTF(...) - #define ALT_LOG_JTAG_UART_ISR_FUNCTION(base, dev) - #define ALT_LOG_JTAG_UART_ALARM_REGISTER(dev, base) - #define ALT_LOG_SYS_CLK_HEARTBEAT() - #define ALT_LOG_PUTS(str) - #define ALT_LOG_WRITE_FUNCTION(ptr,len) - -#endif /* ALT_LOG_ENABLE */ - -#endif /* __ALT_LOG_PRINTF_H__ */ - diff --git a/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_set_args.h b/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_set_args.h deleted file mode 100644 index 3750e67..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_set_args.h +++ /dev/null @@ -1,71 +0,0 @@ -#ifndef __ALT_SET_ARGS_H__ -#define __ALT_SET_ARGS_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The function alt_set_args() is provided in order to define the input - * arguments to main(). If this function is not called before main() then the - * argument list passed to main() will be empty. - * - * It is expected that this function will only be used by the ihost/iclient - * utility. - */ - -static inline void alt_set_args (int argc, char** argv, char** envp) -{ - extern int alt_argc; - extern char** alt_argv; - extern char** alt_envp; - - alt_argc = argc; - alt_argv = argv; - alt_envp = envp; -} - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_SET_ARGS_H__ */ diff --git a/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_sim.h b/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_sim.h deleted file mode 100644 index 06bd27a..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_sim.h +++ /dev/null @@ -1,91 +0,0 @@ -#ifndef __ALT_SIM_H__ -#define __ALT_SIM_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ -#include "system.h" -#include "alt_types.h" - -/* - * Instructions that might mean something special to a simulator. - * These have no special effect on real hardware (they are just nops). - */ -#define ALT_SIM_FAIL() \ - do { __asm volatile ("cmpltui r0, r0, 0xabc1"); } while (0) - -#define ALT_SIM_PASS() \ - do { __asm volatile ("cmpltui r0, r0, 0xabc2"); } while (0) - -#define ALT_SIM_IN_TOP_OF_HOT_LOOP() \ - do { __asm volatile ("cmpltui r0, r0, 0xabc3"); } while (0) - -/* - * Routine called on exit. - */ -static ALT_ALWAYS_INLINE void alt_sim_halt(int exit_code) -{ - int r2 = exit_code; - -#if defined(NIOS2_HAS_DEBUG_STUB) && (defined(ALT_BREAK_ON_EXIT) || defined(ALT_PROVIDE_GMON)) - - int r3 = (1 << 2); - -#ifdef ALT_PROVIDE_GMON - extern unsigned int alt_gmon_data[]; - int r4 = (int)alt_gmon_data; - r3 |= (1 << 4); -#define ALT_GMON_DATA ,"D04"(r4) -#else -#define ALT_GMON_DATA -#endif /* ALT_PROVIDE_GMON */ - - if (r2) { - ALT_SIM_FAIL(); - } else { - ALT_SIM_PASS(); - } - - __asm__ volatile ("\n0:\n\taddi %0,%0, -1\n\tbgt %0,zero,0b" : : "r" (ALT_CPU_FREQ/100) ); /* Delay for >30ms */ - - __asm__ volatile ("break 2" : : "D02"(r2), "D03"(r3) ALT_GMON_DATA ); - -#else /* !DEBUG_STUB */ - if (r2) { - ALT_SIM_FAIL(); - } else { - ALT_SIM_PASS(); - } -#endif /* DEBUG_STUB */ -} - -#define ALT_SIM_HALT(exit_code) \ - alt_sim_halt(exit_code) - -#endif /* __ALT_SIM_H__ */ diff --git a/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_stack.h b/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_stack.h deleted file mode 100644 index e30652a..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_stack.h +++ /dev/null @@ -1,126 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#ifndef __ALT_STACK_H__ -#define __ALT_STACK_H__ - -/* - * alt_stack.h is the nios2 specific implementation of functions used by the - * stack overflow code. - */ - -#include "nios2.h" - -#include "alt_types.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - - -extern char * alt_stack_limit_value; - -#ifdef ALT_EXCEPTION_STACK -extern char __alt_exception_stack_pointer[]; /* set by the linker */ -#endif /* ALT_EXCEPTION_STACK */ - - -/* - * alt_stack_limit can be called to determine the current value of the stack - * limit register. - */ - -static ALT_INLINE char * ALT_ALWAYS_INLINE alt_stack_limit (void) -{ - char * limit; - NIOS2_READ_ET(limit); - - return limit; -} - -/* - * alt_stack_pointer can be called to determine the current value of the stack - * pointer register. - */ - -static ALT_INLINE char * ALT_ALWAYS_INLINE alt_stack_pointer (void) -{ - char * pointer; - NIOS2_READ_SP(pointer); - - return pointer; -} - - -#ifdef ALT_EXCEPTION_STACK - -/* - * alt_exception_stack_pointer returns the normal stack pointer from - * where it is stored on the exception stack (uppermost 4 bytes). This - * is really only useful during exception processing, and is only - * available if a separate exception stack has been configured. - */ - -static ALT_INLINE char * ALT_ALWAYS_INLINE alt_exception_stack_pointer (void) -{ - return (char *) *(alt_u32 *)(__alt_exception_stack_pointer - sizeof(alt_u32)); -} - -#endif /* ALT_EXCEPTION_STACK */ - - -/* - * alt_set_stack_limit can be called to update the current value of the stack - * limit register. - */ - -static ALT_INLINE void ALT_ALWAYS_INLINE alt_set_stack_limit (char * limit) -{ - alt_stack_limit_value = limit; - NIOS2_WRITE_ET(limit); -} - -/* - * alt_report_stack_overflow reports that a stack overflow happened. - */ - -static ALT_INLINE void ALT_ALWAYS_INLINE alt_report_stack_overflow (void) -{ - NIOS2_REPORT_STACK_OVERFLOW(); -} - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_STACK_H__ */ - diff --git a/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_stdio.h b/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_stdio.h deleted file mode 100644 index 1730360..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_stdio.h +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef __ALT_STDIO_H__ -#define __ALT_STDIO_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * Definitions for ALT stdio routines. - */ - -#include - - -#ifdef __cplusplus -extern "C" { -#endif - -int alt_getchar(); -int alt_putchar(int c); -int alt_putstr(const char* str); -void alt_printf(const char *fmt, ...); - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_STDIO_H__ */ diff --git a/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_sys_init.h b/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_sys_init.h deleted file mode 100644 index e4abc28..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_sys_init.h +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef __ALT_SYS_INIT_H__ -#define __ALT_SYS_INIT_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The function alt_sys_init() is defined within the auto-generated file: - * alt_sys_init.c. This function calls the initilisation macros for all - * devices, file systems, and software components within the system. - * - * The list of initilisation macros to use is constructed using the PTF and - * STF files associated with the system. - */ - -extern void alt_sys_init (void); - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_SYS_INIT_H__ */ diff --git a/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_sys_wrappers.h b/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_sys_wrappers.h deleted file mode 100644 index 044833b..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_sys_wrappers.h +++ /dev/null @@ -1,100 +0,0 @@ -#ifndef __ALT_SYS_WRAPPERS_H__ -#define __ALT_SYS_WRAPPERS_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * This file provides the prototypes for the HAL 'UNIX style functions. The - * names of these functions are defined in alt_syscall.h. THese are defined to - * be the standard names when running the standalone HAL, e.g. open(), close() - * etc., but the names may be redefined as a part of an operating system port - * in order to avoid name clashes. - */ - -#include "os/alt_syscall.h" - -#include -#include -#include -#include -#include -#include - -extern int ALT_CLOSE (int __fd); -extern int ALT_EXECVE (const char *__path, - char * const __argv[], - char * const __envp[]); -extern void ALT_EXIT (int __status); -extern int ALT_FSTAT (int file, struct stat *st); -extern int ALT_FCNTL (int file, int cmd, ...); -extern pid_t ALT_FORK (void); -extern pid_t ALT_GETPID (void); - -#if defined (__GNUC__) && __GNUC__ >= 4 -extern int ALT_GETTIMEOFDAY (struct timeval *ptimeval, - void *ptimezone); -#else -extern int ALT_GETTIMEOFDAY (struct timeval *ptimeval, - struct timezone *ptimezone); -#endif - -extern int ALT_IOCTL (int file, int req, void* arg); -extern int ALT_ISATTY (int file); -extern int ALT_KILL (int pid, int sig); -extern int ALT_LINK (const char *existing, const char *new); -extern off_t ALT_LSEEK (int file, off_t ptr, int dir); -extern int ALT_OPEN (const char* file, int flags, ...); -extern int ALT_READ (int file, void *ptr, size_t len); -extern int ALT_RENAME (char *existing, char *new); -extern void* ALT_SBRK (ptrdiff_t incr); -extern int ALT_SETTIMEOFDAY (const struct timeval *t, - const struct timezone *tz); -extern int ALT_STAT (const char *file, struct stat *st); -extern clock_t ALT_TIMES (struct tms *buf); -extern int ALT_UNLINK (const char *name); - -#if defined (__GNUC__) && __GNUC__ >= 4 -int ALT_USLEEP (useconds_t us); -#else -unsigned int ALT_USLEEP (unsigned int us); -#endif - -extern int ALT_WAIT (int *status); -extern int ALT_WRITE (int file, const void *ptr, size_t len); - - -extern char** ALT_ENVIRON; - -/* - * - */ - -#endif /* __ALT_SYS_WRAPPERS_H__ */ diff --git a/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_timestamp.h b/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_timestamp.h deleted file mode 100644 index 8a18da2..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_timestamp.h +++ /dev/null @@ -1,60 +0,0 @@ -#ifndef __ALT_TIMESTAMP_H__ -#define __ALT_TIMESTAMP_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#include "alt_types.h" -#include "altera_avalon_timer.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -extern int alt_timestamp_start (void); - -extern alt_timestamp_type alt_timestamp (void); - -extern alt_u32 alt_timestamp_freq (void); - -#ifdef __cplusplus -} -#endif - -#endif /* __ALT_TIMESTAMP_H__ */ diff --git a/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_warning.h b/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_warning.h deleted file mode 100644 index b66e71a..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/inc/sys/alt_warning.h +++ /dev/null @@ -1,75 +0,0 @@ -#ifndef __WARNING_H__ -#define __WARNING_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* - * alt_warning.h provides macro definitions that can be used to generate link - * time warnings. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The symbol "__alt_invalid" is used to force a link error. There should be - * no corresponding implementation of this function. - */ - -extern void __alt_invalid (void); - -#define ALT_LINK_WARNING(symbol, msg) \ - __asm__(".ifndef __evoke_link_warning_" #symbol \ - "\n\t .section .gnu.warning." #symbol \ - "\n__evoke_link_warning_" #symbol ":\n\t .string \x22" msg "\x22 \n\t .previous" \ - "\n .endif"); - -/* A canned warning for sysdeps/stub functions. */ - -#define ALT_STUB_WARNING(name) \ - ALT_LINK_WARNING (name, \ - "warning: " #name " is not implemented and will always fail") - -#define ALT_OBSOLETE_FUNCTION_WARNING(name) \ - ALT_LINK_WARNING (name, \ - "warning: " #name " is a deprecated function") - -#define ALT_LINK_ERROR(msg) \ - ALT_LINK_WARNING (__alt_invalid, msg); \ - __alt_invalid() - -#ifdef __cplusplus -} -#endif - -#endif /* __WARNING_H__ */ diff --git a/software/qsys_tutorial_test_bsp/HAL/inc/sys/ioctl.h b/software/qsys_tutorial_test_bsp/HAL/inc/sys/ioctl.h deleted file mode 100644 index 4d565df..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/inc/sys/ioctl.h +++ /dev/null @@ -1,90 +0,0 @@ -#ifndef __IOCTL_H__ -#define __IOCTL_H__ - -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * The ioctl() system call be used to initiate a variety of control operations - * on a file descriptor. For the most part this simply translates to a call to - * the ioctl() function of the associated device driver (TIOCEXCL and - * TIOCNXCL are notable exceptions - see ioctl.c for details). - * - * The interpretation of the ioctl requests are therefore device specific. - * - * This function is equivalent to the standard Posix ioctl() call. - */ - -extern int ioctl (int fd, int req, void* arg); - -/* - * list of ioctl calls handled by the system ioctl implementation. - */ - -#define TIOCEXCL 0x740d /* exclusive use of the device */ -#define TIOCNXCL 0x740e /* allow multiple use of the device */ - -/* - * ioctl calls which can be handled by device drivers. - */ - -#define TIOCOUTQ 0x7472 /* get output queue size */ -#define TIOCMGET 0x741d /* get termios flags */ -#define TIOCMSET 0x741a /* set termios flags */ - -/* - * ioctl calls specific to JTAG UART. - */ - -#define TIOCSTIMEOUT 0x6a01 /* Set Timeout before assuming no host present */ -#define TIOCGCONNECTED 0x6a02 /* Get indication of whether host is connected */ - -/* - * - */ - -#ifdef __cplusplus -} -#endif - -#endif /* __IOCTL_H__ */ diff --git a/software/qsys_tutorial_test_bsp/HAL/inc/sys/termios.h b/software/qsys_tutorial_test_bsp/HAL/inc/sys/termios.h deleted file mode 100644 index cd09539..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/inc/sys/termios.h +++ /dev/null @@ -1,181 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * -* * -******************************************************************************/ - -/* - * This is the termios.h file provided with newlib. The only modification has - * been to the baud rate macro definitions, and an increase in the size of the - * termios structure to accomodate this. - */ - - -#ifndef _SYS_TERMIOS_H -# define _SYS_TERMIOS_H - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -# define _XCGETA (('x'<<8)|1) -# define _XCSETA (('x'<<8)|2) -# define _XCSETAW (('x'<<8)|3) -# define _XCSETAF (('x'<<8)|4) -# define _TCSBRK (('T'<<8)|5) -# define _TCFLSH (('T'<<8)|7) -# define _TCXONC (('T'<<8)|6) - -# define TCOOFF 0 -# define TCOON 1 -# define TCIOFF 2 -# define TCION 3 - -# define TCIFLUSH 0 -# define TCOFLUSH 1 -# define TCIOFLUSH 2 - -# define NCCS 13 - -# define TCSAFLUSH _XCSETAF -# define TCSANOW _XCSETA -# define TCSADRAIN _XCSETAW -# define TCSADFLUSH _XCSETAF - -# define IGNBRK 000001 -# define BRKINT 000002 -# define IGNPAR 000004 -# define INPCK 000020 -# define ISTRIP 000040 -# define INLCR 000100 -# define IGNCR 000200 -# define ICRNL 000400 -# define IXON 002000 -# define IXOFF 010000 - -# define OPOST 000001 -# define OCRNL 000004 -# define ONLCR 000010 -# define ONOCR 000020 -# define TAB3 014000 - -# define CLOCAL 004000 -# define CREAD 000200 -# define CSIZE 000060 -# define CS5 0 -# define CS6 020 -# define CS7 040 -# define CS8 060 -# define CSTOPB 000100 -# define HUPCL 002000 -# define PARENB 000400 -# define PAODD 001000 - -#define CCTS_OFLOW 010000 -#define CRTS_IFLOW 020000 -#define CRTSCTS (CCTS_OFLOW | CRTS_IFLOW) - -# define ECHO 0000010 -# define ECHOE 0000020 -# define ECHOK 0000040 -# define ECHONL 0000100 -# define ICANON 0000002 -# define IEXTEN 0000400 /* anybody know *what* this does?! */ -# define ISIG 0000001 -# define NOFLSH 0000200 -# define TOSTOP 0001000 - -# define VEOF 4 /* also VMIN -- thanks, AT&T */ -# define VEOL 5 /* also VTIME -- thanks again */ -# define VERASE 2 -# define VINTR 0 -# define VKILL 3 -# define VMIN 4 /* also VEOF */ -# define VQUIT 1 -# define VSUSP 10 -# define VTIME 5 /* also VEOL */ -# define VSTART 11 -# define VSTOP 12 - -# define B0 0 -# define B50 50 -# define B75 75 -# define B110 110 -# define B134 134 -# define B150 150 -# define B200 200 -# define B300 300 -# define B600 600 -# define B1200 1200 -# define B1800 1800 -# define B2400 2400 -# define B4800 4800 -# define B9600 9600 -# define B19200 19200 -# define B38400 38400 -# define B57600 57600 -# define B115200 115200 - -typedef unsigned char cc_t; -typedef unsigned short tcflag_t; -typedef unsigned long speed_t; - -struct termios { - tcflag_t c_iflag; - tcflag_t c_oflag; - tcflag_t c_cflag; - tcflag_t c_lflag; - char c_line; - cc_t c_cc[NCCS]; - speed_t c_ispeed; - speed_t c_ospeed; -}; - -# ifndef _NO_MACROS - -# define cfgetospeed(tp) ((tp)->c_ospeed) -# define cfgetispeed(tp) ((tp)->c_ispeed) -# define cfsetospeed(tp,s) (((tp)->c_ospeed = (s)), 0) -# define cfsetispeed(tp,s) (((tp)->c_ispeed = (s)), 0) -# define tcdrain(fd) _ioctl (fd, _TCSBRK, 1) -# endif /* _NO_MACROS */ - -#ifdef __cplusplus -} -#endif - -#endif /* _SYS_TERMIOS_H */ - diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_alarm_start.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_alarm_start.c deleted file mode 100644 index 7739959..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_alarm_start.c +++ /dev/null @@ -1,112 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "sys/alt_alarm.h" -#include "sys/alt_irq.h" - -/* - * alt_alarm_start is called to register an alarm with the system. The - * "alarm" structure passed as an input argument does not need to be - * initialised by the user. This is done within this function. - * - * The remaining input arguments are: - * - * nticks - The time to elapse until the alarm executes. This is specified in - * system clock ticks. - * callback - The function to run when the indicated time has elapsed. - * context - An opaque value, passed to the callback function. -* - * Care should be taken when defining the callback function since it is - * likely to execute in interrupt context. In particular, this mean that - * library calls like printf() should not be made, since they can result in - * deadlock. - * - * The interval to be used for the next callback is the return - * value from the callback function. A return value of zero indicates that the - * alarm should be unregistered. - * - * alt_alarm_start() will fail if the timer facility has not been enabled - * (i.e. there is no system clock). Failure is indicated by a negative return - * value. - */ - -int alt_alarm_start (alt_alarm* alarm, alt_u32 nticks, - alt_u32 (*callback) (void* context), - void* context) -{ - alt_irq_context irq_context; - alt_u32 current_nticks = 0; - - if (alt_ticks_per_second ()) - { - if (alarm) - { - alarm->callback = callback; - alarm->context = context; - - irq_context = alt_irq_disable_all (); - - current_nticks = alt_nticks(); - - alarm->time = nticks + current_nticks + 1; - - /* - * If the desired alarm time causes a roll-over, set the rollover - * flag. This will prevent the subsequent tick event from causing - * an alarm too early. - */ - if(alarm->time < current_nticks) - { - alarm->rollover = 1; - } - else - { - alarm->rollover = 0; - } - - alt_llist_insert (&alt_alarm_list, &alarm->llist); - alt_irq_enable_all (irq_context); - - return 0; - } - else - { - return -EINVAL; - } - } - else - { - return -ENOTSUP; - } -} diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_busy_sleep.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_busy_sleep.c deleted file mode 100644 index 561c0be..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_busy_sleep.c +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright (c) 2003-2004 Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - * - * ------------ - * - * Altera does not recommend, suggest or require that this reference design - * file be used in conjunction or combination with any other product. - * - * alt_busy_sleep.c - Microsecond delay routine which uses a calibrated busy - * loop to perform the delay. This is used to implement - * usleep for both uC/OS-II and the standalone HAL. - * - * Author PRR - * - * Calibrated delay with no timer required - * - * The ASM instructions in the routine are equivalent to - * - * for (i=0;i -#include - -#include "system.h" -#include "alt_types.h" - -#include "priv/alt_busy_sleep.h" - -unsigned int alt_busy_sleep (unsigned int us) -{ -/* - * Only delay if ALT_SIM_OPTIMIZE is not defined; i.e., if software - * is built targetting ModelSim RTL simulation, the delay will be - * skipped to speed up simulation. - */ -#ifndef ALT_SIM_OPTIMIZE - int i; - int big_loops; - alt_u32 cycles_per_loop; - - if (!strcmp(NIOS2_CPU_IMPLEMENTATION,"tiny")) - { - cycles_per_loop = 9; - } - else - { - cycles_per_loop = 3; - } - - - big_loops = us / (INT_MAX/ - (ALT_CPU_FREQ/(cycles_per_loop * 1000000))); - - if (big_loops) - { - for(i=0;i - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -#ifdef ALT_USE_DIRECT_DRIVERS - -int ALT_CLOSE (int fildes) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(close); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -/* - * close() is called by an application to release a file descriptor. If the - * associated file system/device has a close() callback function registered - * then this called. The file descriptor is then marked as free. - * - * ALT_CLOSE is mapped onto the close() system call in alt_syscall.h - */ - -int ALT_CLOSE (int fildes) -{ - alt_fd* fd; - int rval; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (fildes < 0) ? NULL : &alt_fd_list[fildes]; - - if (fd) - { - /* - * If the associated file system/device has a close function, call it so - * that any necessary cleanup code can run. - */ - - rval = (fd->dev->close) ? fd->dev->close(fd) : 0; - - /* Free the file descriptor structure and return. */ - - alt_release_fd (fildes); - if (rval < 0) - { - ALT_ERRNO = -rval; - return -1; - } - return 0; - } - else - { - ALT_ERRNO = EBADFD; - return -1; - } -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_dcache_flush.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_dcache_flush.c deleted file mode 100644 index 7ecc91a..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_dcache_flush.c +++ /dev/null @@ -1,97 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "nios2.h" -#include "system.h" - -#include "alt_types.h" -#include "sys/alt_cache.h" - -/* - * Nios II version 1.2 and newer supports the "flush by address" instruction, in - * addition to the "flush by line" instruction provided by older versions of - * the core. This newer instruction is used by preference when it is - * available. - */ - -#ifdef NIOS2_FLUSHDA_SUPPORTED -#define ALT_FLUSH_DATA(i) __asm__ volatile ("flushda (%0)" :: "r" (i)); -#else -#define ALT_FLUSH_DATA(i) __asm__ volatile ("flushd (%0)" :: "r" (i)); -#endif /* NIOS2_FLUSHDA_SUPPORTED */ - -/* - * alt_dcache_flush() is called to flush the data cache for a memory - * region of length "len" bytes, starting at address "start". - * - * Any dirty lines in the data cache are written back to memory. - */ - -void alt_dcache_flush (void* start, alt_u32 len) -{ -#if NIOS2_DCACHE_SIZE > 0 - - char* i; - char* end; - - /* - * This is the most we would ever need to flush. - * - * SPR 196942, 2006.01.13: The cache flush loop below will use the - * 'flushda' instruction if its available; in that case each line - * must be flushed individually, and thus 'len' cannot be trimmed. - */ - #ifndef NIOS2_FLUSHDA_SUPPORTED - if (len > NIOS2_DCACHE_SIZE) - { - len = NIOS2_DCACHE_SIZE; - } - #endif - - end = ((char*) start) + len; - - for (i = start; i < end; i+= NIOS2_DCACHE_LINE_SIZE) - { - ALT_FLUSH_DATA(i); - } - - /* - * For an unaligned flush request, we've got one more line left. - * Note that this is dependent on NIOS2_DCACHE_LINE_SIZE to be a - * multiple of 2 (which it always is). - */ - - if (((alt_u32) start) & (NIOS2_DCACHE_LINE_SIZE - 1)) - { - ALT_FLUSH_DATA(i); - } - -#endif /* NIOS2_DCACHE_SIZE > 0 */ -} diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_dcache_flush_all.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_dcache_flush_all.c deleted file mode 100644 index 6529231..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_dcache_flush_all.c +++ /dev/null @@ -1,51 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "nios2.h" -#include "system.h" - -#include "alt_types.h" -#include "sys/alt_cache.h" - -/* - * alt_dcache_flush_all() is called to flush the entire data cache. - */ - -void alt_dcache_flush_all (void) -{ -#if NIOS2_DCACHE_SIZE > 0 - char* i; - - for (i = (char*) 0; i < (char*) NIOS2_DCACHE_SIZE; i+= NIOS2_DCACHE_LINE_SIZE) - { - __asm__ volatile ("flushd (%0)" :: "r" (i)); - } -#endif /* NIOS2_DCACHE_SIZE > 0 */ -} diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_dcache_flush_no_writeback.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_dcache_flush_no_writeback.c deleted file mode 100644 index c65ca7d..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_dcache_flush_no_writeback.c +++ /dev/null @@ -1,88 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "nios2.h" -#include "system.h" - -#include "alt_types.h" -#include "sys/alt_cache.h" - -/* - * The INITDA instruction was added to Nios II in the 8.0 release. - * - * The INITDA instruction has one of the following possible behaviors - * depending on the processor configuration: - * 1) Flushes a line by address but does NOT write back dirty data. - * Occurs when a data cache is present that supports INITDA. - * The macro NIOS2_INITDA_SUPPORTED is defined in system.h. - * 2) Takes an unimplemented instruction exception. - * Occurs when a data cache is present that doesn't support INITDA. - * 3) Performs no operation - * Occurs when there is no data cache present. - * The macro NIOS2_DCACHE_SIZE is 0 in system.h. - */ - -#define ALT_FLUSH_DATA_NO_WRITEBACK(i) \ - __asm__ volatile ("initda (%0)" :: "r" (i)); - -/* - * alt_dcache_flush_no_writeback() is called to flush the data cache for a - * memory region of length "len" bytes, starting at address "start". - * - * Any dirty lines in the data cache are NOT written back to memory. - * Make sure you really want this behavior. If you aren't 100% sure, - * use the alt_dcache_flush() routine instead. - */ - -void alt_dcache_flush_no_writeback (void* start, alt_u32 len) -{ -#if defined(NIOS2_INITDA_SUPPORTED) - - char* i; - char* end = ((char*) start) + len; - - for (i = start; i < end; i+= NIOS2_DCACHE_LINE_SIZE) - { - ALT_FLUSH_DATA_NO_WRITEBACK(i); - } - - /* - * For an unaligned flush request, we've got one more line left. - * Note that this is dependent on NIOS2_DCACHE_LINE_SIZE to be a - * multiple of 2 (which it always is). - */ - - if (((alt_u32) start) & (NIOS2_DCACHE_LINE_SIZE - 1)) - { - ALT_FLUSH_DATA_NO_WRITEBACK(i); - } - -#endif /* NIOS2_INITDA_SUPPORTED */ -} diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_dev.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_dev.c deleted file mode 100644 index ebc15e5..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_dev.c +++ /dev/null @@ -1,149 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include -#include -#include - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - -#include "alt_types.h" - -#include "system.h" - -/* - * This file contains the data constructs used to control access to device and - * filesytems. - */ - -/* - * "alt_fs_list" is the head of a linked list of registered filesystems. It is - * initialised as an empty list. New entries can be added using the - * alt_fs_reg() function. - */ - -ALT_LLIST_HEAD(alt_fs_list); - - -/* - * "alt_dev_list" is the head of a linked list of registered devices. It is - * configured at startup to include a single device, "alt_dev_null". This - * device is discussed below. - */ - -extern alt_dev alt_dev_null; /* forward declaration */ - -alt_llist alt_dev_list = {&alt_dev_null.llist, &alt_dev_null.llist}; - -/* - * alt_dev_null_write() is the implementation of the write() function used - * by the alt_dev_null device. It simple discards all data passed to it, and - * indicates that the data has been successfully transmitted. - */ - -static int alt_dev_null_write (alt_fd* fd, const char* ptr, int len) -{ - return len; -} - -/* - * "alt_dev_null" is used to allow output to be redirected to nowhere. It is - * the only device registered before the call to alt_sys_init(). At startup - * stin, stdout & stderr are all directed towards this device so that library - * calls like printf() will be safe but inefectual. - */ - -alt_dev alt_dev_null = { - { - &alt_dev_list, - &alt_dev_list - }, - "/dev/null", - NULL, /* open */ - NULL, /* close */ - NULL, /* write */ - alt_dev_null_write, /* write */ - NULL, /* lseek */ - NULL, /* fstat */ - NULL /* ioctl */ - }; - -/* - * "alt_fd_list_lock" is a semaphore used to control access to the file - * descriptor list. This is used to ensure that access to the list is thread - * safe. - */ - -ALT_SEM(alt_fd_list_lock) - -/* - * "alt_max_fd" is used to make access to the file descriptor list more - * efficent. It is set to be the value of the highest allocated file - * descriptor. This saves having to search the entire pool of unallocated - * file descriptors when looking for a match. - */ - -alt_32 alt_max_fd = -1; - -/* - * "alt_fd_list" is the file descriptor pool. The first three entries in the - * array are configured as standard in, standard out, and standard error. These - * are all initialised so that accesses are directed to the alt_dev_null - * device. The remaining file descriptors are initialised as unallocated. - * - * The maximum number of file descriptors within the system is specified by the - * user defined macro "ALT_MAX_FD". This is defined in "system.h", which is - * auto-genereated using the projects PTF and STF files. - */ - -alt_fd alt_fd_list[ALT_MAX_FD] = - { - { - &alt_dev_null, /* standard in */ - 0, - 0 - }, - { - &alt_dev_null, /* standard out */ - 0, - 0 - }, - { - &alt_dev_null, /* standard error */ - 0, - 0 - } - /* all other elements are set to zero */ - }; diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_dev_llist_insert.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_dev_llist_insert.c deleted file mode 100644 index fa7239d..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_dev_llist_insert.c +++ /dev/null @@ -1,59 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "priv/alt_dev_llist.h" -#include "sys/alt_errno.h" - -/* - * - */ - -int alt_dev_llist_insert (alt_dev_llist* dev, alt_llist* list) -{ - /* - * check that the device exists, and that it has a valid name. - */ - - if (!dev || !dev->name) - { - ALT_ERRNO = EINVAL; - return -EINVAL; - } - - /* - * register the device. - */ - - alt_llist_insert(list, &dev->llist); - - return 0; -} diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_dma_rxchan_open.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_dma_rxchan_open.c deleted file mode 100644 index 6ea3b78..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_dma_rxchan_open.c +++ /dev/null @@ -1,63 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_dma.h" -#include "sys/alt_errno.h" -#include "priv/alt_file.h" - -/* - * The list of registered DMA receive channels. - */ - -ALT_LLIST_HEAD(alt_dma_rxchan_list); - -/* - * alt_dma_txchan_open() is used to obtain an "alt_dma_txchan" descriptor for - * a DMA transmit device. The name is the name of the associated physical - * device (e.g. "/dev/dma_0"). - * - * The return value will be NULL on failure, and non-NULL otherwise. - */ - -alt_dma_rxchan alt_dma_rxchan_open (const char* name) -{ - alt_dma_rxchan dev; - - dev = (alt_dma_rxchan) alt_find_dev (name, &alt_dma_rxchan_list); - - if (!dev) - { - ALT_ERRNO = ENODEV; - } - - return dev; -} diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_dma_txchan_open.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_dma_txchan_open.c deleted file mode 100644 index f41fa81..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_dma_txchan_open.c +++ /dev/null @@ -1,63 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_dma.h" -#include "sys/alt_errno.h" -#include "priv/alt_file.h" - -/* - * The list of registered receive channels. - */ - -ALT_LLIST_HEAD(alt_dma_txchan_list); - -/* - * alt_dma_txchan_open() is used to obtain an "alt_dma_txchan" descriptor for - * a DMA transmit device. The name is the name of the associated physical - * device (e.g. "/dev/dma_0"). - * - * The return value will be NULL on failure, and non-NULL otherwise. - */ - -alt_dma_txchan alt_dma_txchan_open (const char* name) -{ - alt_dma_txchan dev; - - dev = (alt_dma_txchan) alt_find_dev (name, &alt_dma_txchan_list); - - if (!dev) - { - ALT_ERRNO = ENODEV; - } - - return dev; -} diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_do_ctors.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_do_ctors.c deleted file mode 100644 index ff5a1f7..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_do_ctors.c +++ /dev/null @@ -1,64 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT IT DIRECTLY. * -* * -* Overriding HAL Functions * -* * -* To provide your own implementation of a HAL function, include the file in * -* your Nios II IDE application project. When building the executable, the * -* Nios II IDE finds your function first, and uses it in place of the HAL * -* version. * -* * -******************************************************************************/ - -/* - * - */ - -typedef void (*constructor) (void); -extern constructor __CTOR_LIST__[]; -extern constructor __CTOR_END__[]; - -/* - * Run the C++ static constructors. - */ - -void _do_ctors(void) -{ - constructor* ctor; - - for (ctor = &__CTOR_END__[-1]; ctor >= __CTOR_LIST__; ctor--) - (*ctor) (); -} diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_do_dtors.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_do_dtors.c deleted file mode 100644 index 565c99f..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_do_dtors.c +++ /dev/null @@ -1,64 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT IT DIRECTLY. * -* * -* Overriding HAL Functions * -* * -* To provide your own implementation of a HAL function, include the file in * -* your Nios II IDE application project. When building the executable, the * -* Nios II IDE finds your function first, and uses it in place of the HAL * -* version. * -* * -******************************************************************************/ - -/* - * - */ - -typedef void (*destructor) (void); -extern destructor __DTOR_LIST__[]; -extern destructor __DTOR_END__[]; - -/* - * Run the C++ static destructors. - */ - -void _do_dtors(void) -{ - destructor* dtor; - - for (dtor = &__DTOR_END__[-1]; dtor >= __DTOR_LIST__; dtor--) - (*dtor) (); -} diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_env_lock.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_env_lock.c deleted file mode 100644 index fc25a0c..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_env_lock.c +++ /dev/null @@ -1,53 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -/* - * These are the empty env lock/unlock stubs required by newlib. These are - * used to make accesses to environment variables thread safe. The default HAL - * configuration is single threaded, so there is nothing to do here. Note that - * this requires that environment variables are never manipulated by an interrupt - * service routine. - */ - -void __env_lock ( struct _reent *_r ) -{ -} - -/* - * - */ - -void __env_unlock ( struct _reent *_r ) -{ -} diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_environ.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_environ.c deleted file mode 100644 index 404efc4..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_environ.c +++ /dev/null @@ -1,42 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "os/alt_syscall.h" - -/* - * These are the environment variables passed to the C code. By default there - * are no variables registered. An application can manipulate this list using - * getenv() and setenv(). - */ - -char *__env[1] = { 0 }; -char **ALT_ENVIRON = __env; diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_errno.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_errno.c deleted file mode 100644 index 1d8368d..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_errno.c +++ /dev/null @@ -1,44 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/* - * This file defines the alt_errno global variable. See comments in - * alt_errno.h for the use of this variable. - */ - - -#include "sys/alt_errno.h" -#include "alt_types.h" - -extern int ALT_WEAK *__errno (void); - -int* (*alt_errno) (void) = __errno; diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_exception_entry.S b/software/qsys_tutorial_test_bsp/HAL/src/alt_exception_entry.S deleted file mode 100644 index 3afab93..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_exception_entry.S +++ /dev/null @@ -1,360 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2008 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "system.h" - -/* - * This is the exception entry point code, which saves all the caller saved - * registers and then handles the appropriate exception. It should be pulled - * in using a .globl from all the exception handler routines. This scheme is - * used so that if an interrupt is never registered, then this code will not - * appear in the generated executable, thereby improving code footprint. - * - * If an external interrpt controller (EIC) is present, it will supply an - * interrupt vector address to the processor when an interrupt occurs. For - * The Altera Vectored Interrupt Controller (VIC) driver will establish a - * vector table and the processor will jump directly to the appropriate - * table entry, funnel routine, and then user ISR. This will bypass this code - * in entirety. This code might still be linked into a system with an EIC, - * but would then be used only for non-interrupt exceptions. - */ - - /* - * Explicitly allow the use of r1 (the assembler temporary register) - * within this code. This register is normally reserved for the use of - * the assembler. - */ - .set noat - - /* - * The top and bottom of the exception stack - */ -#ifdef ALT_EXCEPTION_STACK - - .globl __alt_exception_stack_pointer - -#ifdef ALT_STACK_CHECK - - .globl __alt_exception_stack_limit - - /* - * We need to store the value of the stack limit after interrupt somewhere. - */ - .globl alt_exception_old_stack_limit - -#endif -#endif - - .section .exceptions.entry.label, "xa" - - .globl alt_exception - .type alt_exception, @function -alt_exception: - - .section .exceptions.entry, "xa" - -#ifdef ALT_EXCEPTION_STACK - -#ifdef ALT_STACK_CHECK - stw et, %gprel(alt_exception_old_stack_limit)(gp) -#endif - - movhi et, %hiadj(__alt_exception_stack_pointer - 80) - addi et, et, %lo(__alt_exception_stack_pointer - 80) - stw sp, 76(et) - mov sp, et - -#ifdef ALT_STACK_CHECK - movhi et, %hiadj(__alt_exception_stack_limit) - addi et, et, %lo(__alt_exception_stack_limit) - stw et, %gprel(alt_stack_limit_value)(gp) -#endif - -#else - /* - * Process an exception. For all exceptions we must preserve all - * caller saved registers on the stack (See the Nios2 ABI - * documentation for details). - */ - - addi sp, sp, -76 - -#ifdef ALT_STACK_CHECK - - bltu sp, et, .Lstack_overflow - -#endif - -#endif - - stw ra, 0(sp) - - /* - * Leave a gap in the stack frame at 4(sp) for the muldiv handler to - * store zero into. - */ - - stw r1, 8(sp) - stw r2, 12(sp) - stw r3, 16(sp) - stw r4, 20(sp) - stw r5, 24(sp) - stw r6, 28(sp) - stw r7, 32(sp) - - rdctl r5, estatus - - stw r8, 36(sp) - stw r9, 40(sp) - stw r10, 44(sp) - stw r11, 48(sp) - stw r12, 52(sp) - stw r13, 56(sp) - stw r14, 60(sp) - stw r15, 64(sp) - - /* - * ea-4 contains the address of the instruction being executed - * when the exception occured. For interrupt exceptions, we will - * will be re-issue the isntruction. Store it in 72(sp) - */ - stw r5, 68(sp) /* estatus */ - addi r15, ea, -4 /* instruction that caused exception */ - stw r15, 72(sp) - - /* - * The interrupt testing code (.exceptions.irqtest) will be - * linked here. If the Internal Interrupt Controller (IIC) is - * present (an EIC is not present), the presense of an interrupt - * is determined by examining CPU control registers or an interrupt - * custom instruction, if present. - * - * If the IIC is used and an interrupt is active, the code linked - * here will call the HAL IRQ handler (alt_irq_handler()) which - * successively calls registered interrupt handler(s) until no - * interrupts remain pending. It then jumps to .exceptions.exit. If - * there is no interrupt then it continues to .exception.notirq, below. - */ - - .section .exceptions.notirq, "xa" - - /* - * Prepare to service unimplemtned instructions or traps, - * each of which is optionally inked into section .exceptions.soft, - * which will preceed .exceptions.unknown below. - * - * Unlike interrupts, we want to skip the exception-causing instructon - * upon completion, so we write ea (address of instruction *after* - * the one where the exception occured) into 72(sp). The actual - * instruction that caused the exception is written in r2, which these - * handlers will utilize. - */ - stw ea, 72(sp) /* Don't re-issue */ - ldw r2, -4(ea) /* Instruction that caused exception */ - - /* - * Other exception handling code, if enabled, will be linked here. - * This includes unimplemted (multiply/divide) instruction support - * (a BSP generaton option), and a trap handler (that would typically - * be augmented with user-specific code). These are not linked in by - * default. - */ - - /* - * In the context of linker sections, "unknown" are all exceptions - * not handled by the built-in handlers above (interupt, and trap or - * unimplemented instruction decoding, if enabled). - * - * Advanced exception types can be serviced by registering a handler. - * To do so, enable the "Enable Instruction-related Exception API" HAL - * BSP setting. If this setting is disabled, this handler code will - * either break (if the debug core is present) or enter an infinite - * loop because we don't how how to handle the exception. - */ - .section .exceptions.unknown -#ifdef ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API - /* - * The C-based HAL routine alt_instruction_exception_entry() will - * attempt to service the exception by calling a user-registered - * exception handler using alt_instruction_exception_register(). - * If no handler was registered it will either break (if the - * debugger is present) or go into an infinite loop since the - * handling behavior is undefined; in that case we will not return here. - */ - - /* Load exception-causing address as first argument (r4) */ - addi r4, ea, -4 - - /* Call the instruction-exception entry */ - call alt_instruction_exception_entry - - /* - * If alt_instruction_exception_entry() returned, the exception was - * serviced by a user-registered routine. Its return code (now in r2) - * indicates whether to re-issue or skip the exception-causing - * instruction - * - * Return code was 0: Skip. The instruction after the exception is - * already stored in 72(sp). - */ - bne r2, r0, .Lexception_exit - - /* - * Otherwise, modify 72(sp) to re-issue the instruction that caused the - * exception. - */ - addi r15, ea, -4 /* instruction that caused exception */ - stw r15, 72(sp) - -#else /* ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API disabled */ - - /* - * We got here because an instruction-related exception occured, but the - * handler API was not compiled in. We do not presume to know how to - * handle it. If the debugger is present, break, otherwise hang. - * - * If you get here then one of the following could have happened: - * - * - An instruction-generated exception occured, and the processor - * does not have the extra exceptions feature enabled, or you - * have not registered a handler using - * alt_instruction_exception_register() - * - * Some examples of instruction-generated exceptions and why they - * might occur: - * - * - Your program could have been compiled for a full-featured - * Nios II core, but it is running on a smaller core, and - * instruction emulation has been disabled by defining - * ALT_NO_INSTRUCTION_EMULATION. - * - * You can work around the problem by re-enabling instruction - * emulation, or you can figure out why your program is being - * compiled for a system other than the one that it is running on. - * - * - Your program has executed a trap instruction, but has not - * implemented a handler for this instruction. - * - * - Your program has executed an illegal instruction (one which is - * not defined in the instruction set). - * - * - Your processor includes an MMU or MPU, and you have enabled it - * before registering an exception handler to service exceptions it - * generates. - * - * The problem could also be hardware related: - * - If your hardware is broken and is generating spurious interrupts - * (a peripheral which negates its interrupt output before its - * interrupt handler has been executed will cause spurious - * interrupts) - */ -#ifdef NIOS2_HAS_DEBUG_STUB - /* - * Either tell the user now (if there is a debugger attached) or go into - * the debug monitor which will loop until a debugger is attached. - */ - break -#else - /* - * If there is no debug stub then a BREAK will probably cause a reboot. - * An infinate loop will probably be more useful. - */ -0: - br 0b -#endif /* NIOS2_HAS_DEBUG_STUB */ - -#endif /* ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API */ - - .section .exceptions.exit.label -.Lexception_exit: - - .section .exceptions.exit, "xa" - - /* - * Restore the saved registers, so that all general purpose registers - * have been restored to their state at the time the interrupt occured. - */ - - ldw r5, 68(sp) - ldw ea, 72(sp) /* This becomes the PC once eret is executed */ - ldw ra, 0(sp) - - wrctl estatus, r5 - - ldw r1, 8(sp) - ldw r2, 12(sp) - ldw r3, 16(sp) - ldw r4, 20(sp) - ldw r5, 24(sp) - ldw r6, 28(sp) - ldw r7, 32(sp) - -#ifdef ALT_EXCEPTION_STACK -#ifdef ALT_STACK_CHECK - ldw et, %gprel(alt_exception_old_stack_limit)(gp) -#endif -#endif - - ldw r8, 36(sp) - ldw r9, 40(sp) - ldw r10, 44(sp) - ldw r11, 48(sp) - ldw r12, 52(sp) - ldw r13, 56(sp) - ldw r14, 60(sp) - ldw r15, 64(sp) - -#ifdef ALT_EXCEPTION_STACK - -#ifdef ALT_STACK_CHECK - stw et, %gprel(alt_stack_limit_value)(gp) - stw zero, %gprel(alt_exception_old_stack_limit)(gp) -#endif - - ldw sp, 76(sp) - -#else - addi sp, sp, 76 - -#endif - - /* - * Return to the interrupted instruction. - */ - - eret - -#ifdef ALT_STACK_CHECK - -.Lstack_overflow: - break 3 - -#endif - diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_exception_muldiv.S b/software/qsys_tutorial_test_bsp/HAL/src/alt_exception_muldiv.S deleted file mode 100644 index 55617a6..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_exception_muldiv.S +++ /dev/null @@ -1,583 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - - /* - * This is the software multiply/divide handler for Nios2. - */ - - /* - * Provide a label which can be used to pull this file in. - */ - - .section .exceptions.start - .globl alt_exception_muldiv -alt_exception_muldiv: - - /* - * Pull in the entry/exit code. - */ - .globl alt_exception - - - .section .exceptions.soft, "xa" - - - /* INSTRUCTION EMULATION - * --------------------- - * - * Nios II processors generate exceptions for unimplemented instructions. - * The routines below emulate these instructions. Depending on the - * processor core, the only instructions that might need to be emulated - * are div, divu, mul, muli, mulxss, mulxsu, and mulxuu. - * - * The emulations match the instructions, except for the following - * limitations: - * - * 1) The emulation routines do not emulate the use of the exception - * temporary register (et) as a source operand because the exception - * handler already has modified it. - * - * 2) The routines do not emulate the use of the stack pointer (sp) or the - * exception return address register (ea) as a destination because - * modifying these registers crashes the exception handler or the - * interrupted routine. - * - * 3) To save code size, the routines do not emulate the use of the - * breakpoint registers (ba and bt) as operands. - * - * Detailed Design - * --------------- - * - * The emulation routines expect the contents of integer registers r0-r31 - * to be on the stack at addresses sp, 4(sp), 8(sp), ... 124(sp). The - * routines retrieve source operands from the stack and modify the - * destination register's value on the stack prior to the end of the - * exception handler. Then all registers except the destination register - * are restored to their previous values. - * - * The instruction that causes the exception is found at address -4(ea). - * The instruction's OP and OPX fields identify the operation to be - * performed. - * - * One instruction, muli, is an I-type instruction that is identified by - * an OP field of 0x24. - * - * muli AAAAA,BBBBB,IIIIIIIIIIIIIIII,-0x24- - * 27 22 6 0 <-- LSB of field - * - * The remaining emulated instructions are R-type and have an OP field - * of 0x3a. Their OPX fields identify them. - * - * R-type AAAAA,BBBBB,CCCCC,XXXXXX,NNNNN,-0x3a- - * 27 22 17 11 6 0 <-- LSB of field - * - * - */ - - - /* - * Split the instruction into its fields. We need 4*A, 4*B, and 4*C as - * offsets to the stack pointer for access to the stored register values. - */ - /* r2 = AAAAA,BBBBB,IIIIIIIIIIIIIIII,PPPPPP */ - roli r3, r2, 7 /* r3 = BBB,IIIIIIIIIIIIIIII,PPPPPP,AAAAA,BB */ - roli r4, r3, 3 /* r4 = IIIIIIIIIIIIIIII,PPPPPP,AAAAA,BBBBB */ - roli r6, r4, 2 /* r6 = IIIIIIIIIIIIII,PPPPPP,AAAAA,BBBBB,II */ - srai r4, r4, 16 /* r4 = (sign-extended) IMM16 */ - xori r6, r6, 0x42 /* r6 = CCC,XXXXXX,NNNNN,PPPPPP,AAAAA,bBBBB,cC */ - roli r7, r6, 5 /* r7 = XXXX,NNNNN,PPPPPP,AAAAA,bBBBB,cCCCC,XX */ - andi r5, r2, 0x3f /* r5 = 00000000000000000000000000,PPPPPP */ - xori r3, r3, 0x40 - andi r3, r3, 0x7c /* r3 = 0000000000000000000000000,aAAAA,00 */ - andi r6, r6, 0x7c /* r6 = 0000000000000000000000000,bBBBB,00 */ - andi r7, r7, 0x7c /* r7 = 0000000000000000000000000,cCCCC,00 */ - - /* Now either - * r5 = OP - * r3 = 4*(A^16) - * r4 = IMM16 (sign extended) - * r6 = 4*(B^16) - * r7 = 4*(C^16) - * or - * r5 = OP - */ - - - /* - * Save everything on the stack to make it easy for the emulation routines - * to retrieve the source register operands. The exception entry code has - * already saved some of this so we don't need to do it all again. - */ - - addi sp, sp, -60 - stw zero, 64(sp) /* Save zero on stack to avoid special case for r0. */ - /* Register at and r2-r15 have already been saved. */ - - stw r16, 0(sp) - stw r17, 4(sp) - stw r18, 8(sp) - stw r19, 12(sp) - stw r20, 16(sp) - stw r21, 20(sp) - stw r22, 24(sp) - stw r23, 28(sp) - /* et @ 32 - Has already been changed.*/ - /* bt @ 36 - Usually isn't an operand. */ - stw gp, 40(sp) - stw sp, 44(sp) - stw fp, 48(sp) - /* ea @ 52 - Don't bother to save - it's already been changed */ - /* ba @ 56 - Breakpoint register usually isn't an operand */ - /* ra @ 60 - Has already been saved */ - - - /* - * Prepare for either multiplication or division loop. - * They both loop 32 times. - */ - movi r14, 32 - - - /* - * Get the operands. - * - * It is necessary to check for muli because it uses an I-type instruction - * format, while the other instructions are have an R-type format. - */ - add r3, r3, sp /* r3 = address of A-operand. */ - ldw r3, 0(r3) /* r3 = A-operand. */ - movi r15, 0x24 /* muli opcode (I-type instruction format) */ - beq r5, r15, .Lmul_immed /* muli doesn't use the B register as a source */ - - add r6, r6, sp /* r6 = address of B-operand. */ - ldw r6, 0(r6) /* r6 = B-operand. */ - /* r4 = SSSSSSSSSSSSSSSS,-----IMM16------ */ - /* IMM16 not needed, align OPX portion */ - /* r4 = SSSSSSSSSSSSSSSS,CCCCC,-OPX--,00000 */ - srli r4, r4, 5 /* r4 = 00000,SSSSSSSSSSSSSSSS,CCCCC,-OPX-- */ - andi r4, r4, 0x3f /* r4 = 00000000000000000000000000,-OPX-- */ - - /* Now - * r5 = OP - * r3 = src1 - * r6 = src2 - * r4 = OPX (no longer can be muli) - * r7 = 4*(C^16) - * r14 = loop counter - */ - - /* ILLEGAL-INSTRUCTION EXCEPTION - * ----------------------------- - * - * This code is for Nios II cores that generate exceptions when attempting - * to execute illegal instructions. Nios II cores that support an - * illegal-instruction exception are identified by the presence of the - * macro definition NIOS2_HAS_ILLEGAL_INSTRUCTION_EXCEPTION in system.h . - * - * Remember that illegal instructions are different than unimplemented - * instructions. Illegal instructions are instruction encodings that - * have not been defined by the Nios II ISA. Unimplemented instructions - * are legal instructions that must be emulated by some Nios II cores. - * - * If we get here, all instructions except multiplies and divides - * are illegal. - * - * This code assumes that OP is not muli (because muli was tested above). - * All other multiplies and divides are legal. Anything else is illegal. - */ - - movi r8, 0x3a /* OP for R-type mul* and div* */ - bne r5, r8, .Lnot_muldiv - - /* r15 already is 0x24 */ /* OPX of divu */ - beq r4, r15, .Ldivide - - movi r15,0x27 /* OPX of mul */ - beq r4, r15, .Lmultiply - - movi r15,0x07 /* OPX of mulxuu */ - beq r4, r15, .Lmultiply - - movi r15,0x17 /* OPX of mulxsu */ - beq r4, r15, .Lmultiply - - movi r15,0x1f /* OPX of mulxss */ - beq r4, r15, .Lmultiply - - movi r15,0x25 /* OPX of div */ - bne r4, r15, .Lnot_muldiv - - - /* DIVISION - * - * Divide an unsigned dividend by an unsigned divisor using - * a shift-and-subtract algorithm. The example below shows - * 43 div 7 = 6 for 8-bit integers. This classic algorithm uses a - * single register to store both the dividend and the quotient, - * allowing both values to be shifted with a single instruction. - * - * remainder dividend:quotient - * --------- ----------------- - * initialize 00000000 00101011: - * shift 00000000 0101011:_ - * remainder >= divisor? no 00000000 0101011:0 - * shift 00000000 101011:0_ - * remainder >= divisor? no 00000000 101011:00 - * shift 00000001 01011:00_ - * remainder >= divisor? no 00000001 01011:000 - * shift 00000010 1011:000_ - * remainder >= divisor? no 00000010 1011:0000 - * shift 00000101 011:0000_ - * remainder >= divisor? no 00000101 011:00000 - * shift 00001010 11:00000_ - * remainder >= divisor? yes 00001010 11:000001 - * remainder -= divisor - 00000111 - * ---------- - * 00000011 11:000001 - * shift 00000111 1:000001_ - * remainder >= divisor? yes 00000111 1:0000011 - * remainder -= divisor - 00000111 - * ---------- - * 00000000 1:0000011 - * shift 00000001 :0000011_ - * remainder >= divisor? no 00000001 :00000110 - * - * The quotient is 00000110. - */ - -.Ldivide: - /* - * Prepare for division by assuming the result - * is unsigned, and storing its "sign" as 0. - */ - movi r17, 0 - - - /* Which division opcode? */ - xori r15, r4, 0x25 /* OPX of div */ - bne r15, zero, .Lunsigned_division - - - /* - * OPX is div. Determine and store the sign of the quotient. - * Then take the absolute value of both operands. - */ - xor r17, r3, r6 /* MSB contains sign of quotient */ - bge r3, zero, 0f - sub r3, zero, r3 /* -r3 */ -0: - bge r6, zero, 0f - sub r6, zero, r6 /* -r6 */ -0: - - -.Lunsigned_division: - /* Initialize the unsigned-division loop. */ - movi r13, 0 /* remainder = 0 */ - - /* Now - * r3 = dividend : quotient - * r4 = 0x25 for div, 0x24 for divu - * r6 = divisor - * r13 = remainder - * r14 = loop counter (already initialized to 32) - * r17 = MSB contains sign of quotient - */ - - - /* - * for (count = 32; count > 0; --count) - * { - */ -.Ldivide_loop: - - /* - * Division: - * - * (remainder:dividend:quotient) <<= 1; - */ - slli r13, r13, 1 - cmplt r15, r3, zero /* r15 = MSB of r3 */ - or r13, r13, r15 - slli r3, r3, 1 - - - /* - * if (remainder >= divisor) - * { - * set LSB of quotient - * remainder -= divisor; - * } - */ - bltu r13, r6, .Ldiv_skip - ori r3, r3, 1 - sub r13, r13, r6 -.Ldiv_skip: - - /* - * } - */ - subi r14, r14, 1 - bne r14, zero, .Ldivide_loop - - mov r9, r3 - - - /* Now - * r9 = quotient - * r4 = 0x25 for div, 0x24 for divu - * r7 = 4*(C^16) - * r17 = MSB contains sign of quotient - */ - - - /* - * Conditionally negate signed quotient. If quotient is unsigned, - * the sign already is initialized to 0. - */ - bge r17, zero, .Lstore_result - sub r9, zero, r9 /* -r9 */ - - br .Lstore_result - - - - - /* MULTIPLICATION - * - * A "product" is the number that one gets by summing a "multiplicand" - * several times. The "multiplier" specifies the number of copies of the - * multiplicand that are summed. - * - * Actual multiplication algorithms don't use repeated addition, however. - * Shift-and-add algorithms get the same answer as repeated addition, and - * they are faster. To compute the lower half of a product (pppp below) - * one shifts the product left before adding in each of the partial products - * (a * mmmm) through (d * mmmm). - * - * To compute the upper half of a product (PPPP below), one adds in the - * partial products (d * mmmm) through (a * mmmm), each time following the - * add by a right shift of the product. - * - * mmmm - * * abcd - * ------ - * #### = d * mmmm - * #### = c * mmmm - * #### = b * mmmm - * #### = a * mmmm - * -------- - * PPPPpppp - * - * The example above shows 4 partial products. Computing actual Nios II - * products requires 32 partials. - * - * It is possible to compute the result of mulxsu from the result of mulxuu - * because the only difference between the results of these two opcodes is - * the value of the partial product associated with the sign bit of rA. - * - * mulxsu = mulxuu - ((rA < 0) ? rB : 0); - * - * It is possible to compute the result of mulxss from the result of mulxsu - * because the only difference between the results of these two opcodes is - * the value of the partial product associated with the sign bit of rB. - * - * mulxss = mulxsu - ((rB < 0) ? rA : 0); - * - */ - -.Lmul_immed: - /* Opcode is muli. Change it into mul for remainder of algorithm. */ - mov r7, r6 /* Field B is dest register, not field C. */ - mov r6, r4 /* Field IMM16 is src2, not field B. */ - movi r4, 0x27 /* OPX of mul is 0x27 */ - -.Lmultiply: - /* Initialize the multiplication loop. */ - movi r9, 0 /* mul_product = 0 */ - movi r10, 0 /* mulxuu_product = 0 */ - mov r11, r6 /* save original multiplier for mulxsu and mulxss */ - mov r12, r6 /* mulxuu_multiplier (will be shifted) */ - movi r16, 1 /* used to create "rori B,A,1" from "ror B,A,r16" */ - - /* Now - * r3 = multiplicand - * r6 = mul_multiplier - * r7 = 4 * dest_register (used later as offset to sp) - * r9 = mul_product - * r10 = mulxuu_product - * r11 = original multiplier - * r12 = mulxuu_multiplier - * r14 = loop counter (already initialized) - * r15 = temp - * r16 = 1 - */ - - - /* - * for (count = 32; count > 0; --count) - * { - */ -.Lmultiply_loop: - - /* - * mul_product <<= 1; - * lsb = multiplier & 1; - */ - slli r9, r9, 1 - andi r15, r12, 1 - - /* - * if (lsb == 1) - * { - * mulxuu_product += multiplicand; - * } - */ - beq r15, zero, .Lmulx_skip - add r10, r10, r3 - cmpltu r15, r10, r3 /* Save the carry from the MSB of mulxuu_product. */ - ror r15, r15, r16 /* r15 = 0x80000000 on carry, or else 0x00000000 */ -.Lmulx_skip: - - /* - * if (MSB of mul_multiplier == 1) - * { - * mul_product += multiplicand; - * } - */ - bge r6, zero, .Lmul_skip - add r9, r9, r3 -.Lmul_skip: - - /* - * mulxuu_product >>= 1; logical shift - * mul_multiplier <<= 1; done with MSB - * mulx_multiplier >>= 1; done with LSB - */ - srli r10, r10, 1 - or r10, r10, r15 /* OR in the saved carry bit. */ - slli r6, r6, 1 - srli r12, r12, 1 - - - /* - * } - */ - subi r14, r14, 1 - bne r14, zero, .Lmultiply_loop - - - /* - * Multiply emulation loop done. - */ - - /* Now - * r3 = multiplicand - * r4 = OPX - * r7 = 4 * dest_register (used later as offset to sp) - * r9 = mul_product - * r10 = mulxuu_product - * r11 = original multiplier - * r15 = temp - */ - - - /* - * Select/compute the result based on OPX. - */ - - - /* OPX == mul? Then store. */ - xori r15, r4, 0x27 - beq r15, zero, .Lstore_result - - /* It's one of the mulx.. opcodes. Move over the result. */ - mov r9, r10 - - /* OPX == mulxuu? Then store. */ - xori r15, r4, 0x07 - beq r15, zero, .Lstore_result - - /* Compute mulxsu - * - * mulxsu = mulxuu - ((rA < 0) ? rB : 0); - */ - bge r3, zero, .Lmulxsu_skip - sub r9, r9, r11 -.Lmulxsu_skip: - - /* OPX == mulxsu? Then store. */ - xori r15, r4, 0x17 - beq r15, zero, .Lstore_result - - /* Compute mulxss - * - * mulxss = mulxsu - ((rB < 0) ? rA : 0); - */ - bge r11, zero, .Lmulxss_skip - sub r9, r9, r3 -.Lmulxss_skip: - /* At this point, assume that OPX is mulxss, so store */ - - -.Lstore_result: - add r7, r7, sp - stw r9, 0(r7) - - ldw r16, 0(sp) - ldw r17, 4(sp) - ldw r18, 8(sp) - ldw r19, 12(sp) - ldw r20, 16(sp) - ldw r21, 20(sp) - ldw r22, 24(sp) - ldw r23, 28(sp) - - /* bt @ 32 - Breakpoint register usually isn't an operand. */ - /* et @ 36 - Don't corrupt et. */ - /* gp @ 40 - Don't corrupt gp. */ - /* sp @ 44 - Don't corrupt sp. */ - ldw fp, 48(sp) - /* ea @ 52 - Don't corrupt ea. */ - /* ba @ 56 - Breakpoint register usually isn't an operand. */ - - addi sp, sp, 60 - - br .Lexception_exit - - -.Lnot_muldiv: - - addi sp, sp, 60 - - - .section .exceptions.exit.label -.Lexception_exit: - diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_exception_trap.S b/software/qsys_tutorial_test_bsp/HAL/src/alt_exception_trap.S deleted file mode 100644 index 60a3d40..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_exception_trap.S +++ /dev/null @@ -1,81 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - - /* - * This is the trap exception handler for Nios2. - */ - - /* - * Provide a label which can be used to pull this file in. - */ - - .section .exceptions.start - .globl alt_exception_trap -alt_exception_trap: - - /* - * Pull in the entry/exit code. - */ - .globl alt_exception - - .section .exceptions.soft, "xa" - -.Ltrap_handler: - - /* - * Did a trap instruction cause the exception? - * - * The instruction which the exception occurred on has been loaded - * into r2 by code in alt_exception_entry.S - * - */ - - movhi r3,0x003b /* upper half of trap opcode */ - ori r3,r3,0x683a /* lower half of trap opcode */ - bne r2,r3,.Lnot_trap - - /* - * There is no trap handler defined here, and so executing a trap - * instruction causes a software break. If you provide a trap handler, - * then you must replace the break instruction below with your handler. - * Your handler must preserve ea and the usual callee saved registers. - */ - - break - - br .Lexception_exit - -.Lnot_trap: - - - .section .exceptions.exit.label -.Lexception_exit: - - diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_execve.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_execve.c deleted file mode 100644 index 27b99cf..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_execve.c +++ /dev/null @@ -1,55 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "os/alt_syscall.h" - -/* - * execve() is used by newlib to launch new processes. This is unsupported in - * the HAL environment. However a "do-nothing" implementation is still - * provied for newlib compatability. - * - * ALT_EXECVE is mapped onto the execve() system call in alt_syscall.h - */ - -int ALT_EXECVE (char *name, char ** argv, char** env) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(execve); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_exit.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_exit.c deleted file mode 100644 index 971b35e..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_exit.c +++ /dev/null @@ -1,71 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_irq.h" -#include "sys/alt_sim.h" -#include "os/alt_hooks.h" -#include "os/alt_syscall.h" - -#include "alt_types.h" -#include "sys/alt_log_printf.h" -/* - * _exit() is called by exit() in order to terminate the current process. - * Typically this is called when main() completes. It should never return. - * Since there is nowhere to go once this process completes, this - * implementation simply blocks forever. - * - * Note that interrupts are not disabled so that execution outside of this - * thread is allowed to continue. - * - * ALT_EXIT is mapped onto the _exit() system call in alt_syscall.h - */ - -void ALT_EXIT (int exit_code) -{ - /* ALT_LOG - please see HAL/inc/alt_log_printf.h for details */ - ALT_LOG_PRINT_BOOT("[alt_exit.c] Entering _exit() function.\r\n"); - ALT_LOG_PRINT_BOOT("[alt_exit.c] Exit code from main was %d.\r\n",exit_code); - /* Stop all other threads */ - - ALT_LOG_PRINT_BOOT("[alt_exit.c] Calling ALT_OS_STOP().\r\n"); - ALT_OS_STOP(); - - /* Provide notification to the simulator that we've stopped */ - - ALT_LOG_PRINT_BOOT("[alt_exit.c] Calling ALT_SIM_HALT().\r\n"); - ALT_SIM_HALT(exit_code); - - /* spin forever, since there's no where to go back to */ - - ALT_LOG_PRINT_BOOT("[alt_exit.c] Spinning forever.\r\n"); - while (1); -} diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_fcntl.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_fcntl.c deleted file mode 100644 index 69c1544..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_fcntl.c +++ /dev/null @@ -1,101 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include -#include - -#include "sys/alt_errno.h" -#include "priv/alt_file.h" -#include "alt_types.h" -#include "os/alt_syscall.h" - -#define ALT_FCNTL_FLAGS_MASK ((alt_u32) (O_APPEND | O_NONBLOCK)) - -/* - * fcntl() is a limited implementation of the standard fcntl() system call. - * It can be used to change the state of the flags associated with an open - * file descriptor. Normally these flags are set during the call to - * open(). It is anticipated that the main use of this function will be to - * change the state of a device from blocking to non-blocking (where this is - * supported). - * - * The input argument "fd" is the file descriptor to be manipulated. "cmd" - * is the command to execute. This can be either F_GETFL (return the - * current value of the flags) or F_SETFL (set the value of the flags). - * - * If "cmd" is F_SETFL then the argument "arg" is the new value of flags, - * otherwise "arg" is ignored. Only the flags: O_APPEND and O_NONBLOCK - * can be updated by a call to fcntl(). All other flags remain - * unchanged. - * - * ALT_FCNTL is mapped onto the fcntl() system call in alt_syscall.h - */ - -int ALT_FCNTL (int file, int cmd, ...) -{ - alt_fd* fd; - long flags; - va_list argp; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - switch (cmd) - { - case F_GETFL: - return fd->fd_flags & ~((alt_u32) ALT_FD_FLAGS_MASK); - case F_SETFL: - va_start(argp, cmd); - flags = va_arg(argp, long); - fd->fd_flags &= ~ALT_FCNTL_FLAGS_MASK; - fd->fd_flags |= (flags & ALT_FCNTL_FLAGS_MASK); - va_end(argp); - return 0; - default: - ALT_ERRNO = EINVAL; - return -1; - } - } - - ALT_ERRNO = EBADFD; - return -1; -} diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_fd_lock.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_fd_lock.c deleted file mode 100644 index 0e2a85d..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_fd_lock.c +++ /dev/null @@ -1,75 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "priv/alt_file.h" - -/* - * alt_fd_lock() is called as a consequence of an ioctl call to gain exclusive - * access to a device, i.e.: - * - * ioctl (fd, TIOCEXCL, NULL); - * - * If there are no other open file descriptors which reference the same - * device, then alt_fd_lock() will grant the lock. Further calls to open() - * for this device will fail until the lock is released. - * - * This is done by calling close() for this file descriptor, or by calling: - * - * ioctl (fd, TIOCNXCL, NULL); - * - * The return value is zero for success, or negative in the case of failure. - */ - -int alt_fd_lock (alt_fd* fd) -{ - int i; - int rc = 0; - - ALT_SEM_PEND(alt_fd_list_lock, 0); - - for (i = 0; i < alt_max_fd; i++) - { - if ((&alt_fd_list[i] != fd) && (alt_fd_list[i].dev == fd->dev)) - { - rc = -EACCES; - goto alt_fd_lock_exit; - } - } - fd->fd_flags |= ALT_FD_EXCL; - - alt_fd_lock_exit: - - ALT_SEM_POST(alt_fd_list_lock); - return rc; -} diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_fd_unlock.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_fd_unlock.c deleted file mode 100644 index fb700dc..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_fd_unlock.c +++ /dev/null @@ -1,56 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "priv/alt_file.h" - -/* - * alt_fd_unlock() is the inverse of alt_fd_lock(). It is called as a - * consequence of a TIOCNXCL ioctl request, e.g: - * - * ioctl (fd, TIOCNXCL, NULL); - * - * It enables multiple file descriptors to exist for the same device. This - * is normally the case, but it may have been disabled by a previous call to - * alt_fd_lock(). - * - * Return zero on sucess, and a negative value on failure. - * - * The current implementation always succeeds. - */ - -int alt_fd_unlock (alt_fd* fd) -{ - fd->fd_flags &= ~ALT_FD_EXCL; - return 0; -} diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_find_dev.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_find_dev.c deleted file mode 100644 index 37aefa4..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_find_dev.c +++ /dev/null @@ -1,88 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - -#include "alt_types.h" - -/* - * alt_find_dev() is used by open() in order to locate a previously registered - * device with the name "name". The input argument "llist" is a pointer to the - * head of the device list to search. - * - * The return value is a pointer to the matching device, or NULL if there is - * no match. - * - * "name" must be an exact match for the devices registered name for a match to - * be found. - */ - -alt_dev* alt_find_dev(const char* name, alt_llist* llist) -{ - alt_dev* next = (alt_dev*) llist->next; - alt_32 len; - - len = strlen(name) + 1; - - /* - * Check each list entry in turn, until a match is found, or we reach the - * end of the list (i.e. next winds up pointing back to the list head). - */ - - while (next != (alt_dev*) llist) - { - - /* - * memcmp() is used here rather than strcmp() in order to reduce the size - * of the executable. - */ - - if (!memcmp (next->name, name, len)) - { - /* match found */ - - return next; - } - next = (alt_dev*) next->llist.next; - } - - /* No match found */ - - return NULL; -} - - diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_find_file.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_find_file.c deleted file mode 100644 index 2d97ec2..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_find_file.c +++ /dev/null @@ -1,89 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - -#include "alt_types.h" - -/* - * alt_find_file() is used by open() in order to locate a previously registered - * filesystem that owns that mount point that contains the file named "name". - * - * The return value is a pointer to the matching filesystem, or NULL if there is - * no match. - * - * A match is considered to have been found if the filesystem name followed by - * either '/' or '\0' is the prefix of the filename. For example the filename: - * "/myfilesystem/junk.txt" would match: "/myfilesystem", but not: "/myfile". - */ - -alt_dev* alt_find_file (const char* name) -{ - alt_dev* next = (alt_dev*) alt_fs_list.next; - - alt_32 len; - - /* - * Check each list entry in turn, until a match is found, or we reach the - * end of the list (i.e. next winds up pointing back to the list head). - */ - - while (next != (alt_dev*) &alt_fs_list) - { - len = strlen(next->name); - - if (next->name[len-1] == '/') - { - len -= 1; - } - - if (((name[len] == '/') || (name[len] == '\0')) && - !memcmp (next->name, name, len)) - { - /* match found */ - - return next; - } - next = (alt_dev*) next->llist.next; - } - - /* No match found */ - - return NULL; -} - - diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_flash_dev.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_flash_dev.c deleted file mode 100644 index 213f721..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_flash_dev.c +++ /dev/null @@ -1,69 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/****************************************************************************** -* * -* Alt_flash.c - Functions to register a flash device to the "generic" flash * -* interface * -* * -* Author PRR * -* * -******************************************************************************/ - -#include -#include "sys/alt_llist.h" -#include "sys/alt_flash_dev.h" -#include "priv/alt_file.h" - -ALT_LLIST_HEAD(alt_flash_dev_list); - -alt_flash_fd* alt_flash_open_dev(const char* name) -{ - alt_flash_dev* dev = (alt_flash_dev*)alt_find_dev(name, &alt_flash_dev_list); - - if ((dev) && dev->open) - { - return dev->open(dev, name); - } - - return dev; -} - -void alt_flash_close_dev(alt_flash_fd* fd) -{ - if (fd && fd->close) - { - fd->close(fd); - } - return; -} - diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_fork.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_fork.c deleted file mode 100644 index ce74df0..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_fork.c +++ /dev/null @@ -1,57 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_warning.h" -#include "sys/alt_errno.h" -#include "os/alt_syscall.h" - -/* - * The fork() system call is used by newlib to create a duplicate copy of the - * curent process. This is unsupported in the HAL environment. However a - * "do-nothing" implementation is still provied for newlib compatability. - * - * ALT_FORK is mapped onto the fork() system call in alt_syscall.h - */ - -int ALT_FORK (void) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(fork); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} - - diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_fs_reg.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_fs_reg.c deleted file mode 100644 index 13437a1..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_fs_reg.c +++ /dev/null @@ -1,75 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - -/* - * The alt_fs_reg() function is used to register a file system. Once registered - * a device can be accessed using the standard posix calls: open(), read(), - * write() etc. - * - * System behaviour is undefined in the event that a file system is registered - * with a name that conflicts with an existing device or file system. - * - * alt_fs_reg() is not thread safe in the sense that there should be no other - * thread using the file system list at the time that alt_dev_reg() is called. In - * practice this means that alt_fs_reg() should only be called while operating - * in a single threaded mode. The expectation is that it will only be called - * by the file system initilisation functions invoked by alt_sys_init(), which in - * turn should only be called by the single threaded C startup code. - * - * A return value of zero indicates success. A negative return value indicates - * failure. - */ - -int alt_fs_reg (alt_dev* dev) -{ - /* - * check that the device has a name. - */ - - if (!dev->name) - { - return -ENODEV; - } - - /* - * register the file system. - */ - - alt_llist_insert(&alt_fs_list, &dev->llist); - - return 0; -} diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_fstat.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_fstat.c deleted file mode 100644 index af5d527..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_fstat.c +++ /dev/null @@ -1,128 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include "sys/alt_dev.h" -#include "sys/alt_warning.h" -#include "sys/alt_errno.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -/* - * The fstat() system call is used to obtain information about the capabilities - * of an open file descriptor. By default file descriptors are marked as - * being character devices. If a device or file system wishes to advertise - * alternative capabilities then they can register an fstat() function within - * their associated alt_dev structure. This will be called to fill in the - * entries in the imput "st" structure. - * - * This function is provided for compatability with newlib. - * - * ALT_FSTAT is mapped onto the fstat() system call in alt_syscall.h - */ - -#ifdef ALT_USE_DIRECT_DRIVERS - -#include "system.h" - -/* - * Provide minimal version that just describes all file descriptors - * as character devices for provided stdio devices. - */ -int ALT_FSTAT (int file, struct stat *st) -{ - switch (file) { -#ifdef ALT_STDIN_PRESENT - case 0: /* stdin file descriptor */ -#endif /* ALT_STDIN_PRESENT */ -#ifdef ALT_STDOUT_PRESENT - case 1: /* stdout file descriptor */ -#endif /* ALT_STDOUT_PRESENT */ -#ifdef ALT_STDERR_PRESENT - case 2: /* stderr file descriptor */ -#endif /* ALT_STDERR_PRESENT */ - st->st_mode = _IFCHR; - return 0; - default: - return -1; - } - -#if !defined(ALT_STDIN_PRESENT) && !defined(ALT_STDOUT_PRESENT) && !defined(ALT_STDERR_PRESENT) - /* Generate a link time warning, should this function ever be called. */ - ALT_STUB_WARNING(fstat); -#endif -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -int ALT_FSTAT (int file, struct stat *st) -{ - alt_fd* fd; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - /* Call the drivers fstat() function to fill out the "st" structure. */ - - if (fd->dev->fstat) - { - return fd->dev->fstat(fd, st); - } - - /* - * If no function is provided, mark the fd as belonging to a character - * device. - */ - - else - { - st->st_mode = _IFCHR; - return 0; - } - } - else - { - ALT_ERRNO = EBADFD; - return -1; - } -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_get_fd.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_get_fd.c deleted file mode 100644 index db17b2c..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_get_fd.c +++ /dev/null @@ -1,105 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - -#include "alt_types.h" - -#include "system.h" - -/* - * alt_get_fd() is called to allocate a new file descriptor from the file - * descriptor pool. If a file descriptor is succesfully allocated, it is - * configured to refer to device "dev". - * - * The return value is the index of the file descriptor structure (i.e. - * the offset of the file descriptor within the file descriptor array). A - * negative value indicates failure. - */ - -int alt_get_fd (alt_dev* dev) -{ - alt_32 i; - int rc = -EMFILE; - - /* - * Take the alt_fd_list_lock semaphore in order to avoid races when - * accessing the file descriptor pool. - */ - - ALT_SEM_PEND(alt_fd_list_lock, 0); - - /* - * Search through the list of file descriptors, and allocate the first - * free descriptor that's found. - * - * If a free descriptor is found, then the value of "alt_max_fd" is - * updated accordingly. "alt_max_fd" is a 'highwater mark' which - * indicates the highest file descriptor ever allocated. This is used to - * improve efficency when searching the file descriptor list, and - * therefore reduce contention on the alt_fd_list_lock semaphore. - */ - - for (i = 0; i < ALT_MAX_FD; i++) - { - if (!alt_fd_list[i].dev) - { - alt_fd_list[i].dev = dev; - if (i > alt_max_fd) - { - alt_max_fd = i; - } - rc = i; - goto alt_get_fd_exit; - } - } - - alt_get_fd_exit: - - /* - * Release the alt_fd_list_lock semaphore now that we are done with the - * file descriptor pool. - */ - - ALT_SEM_POST(alt_fd_list_lock); - - return rc; -} - - - - diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_getchar.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_getchar.c deleted file mode 100644 index a8f50d5..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_getchar.c +++ /dev/null @@ -1,61 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#ifdef ALT_USE_DIRECT_DRIVERS -#include "system.h" -#include "sys/alt_driver.h" -#include "sys/alt_stdio.h" -#include "priv/alt_file.h" -#include "unistd.h" -#endif - -/* - * Uses the ALT_DRIVER_READ() macro to call directly to driver if available. - * Otherwise, uses newlib provided getchar() routine. - */ -int -alt_getchar(void) -{ -#ifdef ALT_USE_DIRECT_DRIVERS - ALT_DRIVER_READ_EXTERNS(ALT_STDIN_DEV); - char c; - - if (ALT_DRIVER_READ(ALT_STDIN_DEV, &c, 1, alt_fd_list[STDIN_FILENO].fd_flags) <= 0) { - return -1; - } - return c; -#else - return getchar(); -#endif -} diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_getpid.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_getpid.c deleted file mode 100644 index 2228c7e..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_getpid.c +++ /dev/null @@ -1,47 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "os/alt_syscall.h" - -/* - * The getpid() system call is used by newlib to obtain the current process - * id. Since there is only ever a single process in the HAL environment, - * this just returns a constant. - * - * ALT_GETPID is mapped onto the getpid() system call in alt_syscall.h - */ - -int ALT_GETPID (void) -{ - return 0; -} - diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_gettod.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_gettod.c deleted file mode 100644 index ed86cba..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_gettod.c +++ /dev/null @@ -1,125 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include - -#include "sys/alt_alarm.h" -#include "alt_types.h" -#include "os/alt_syscall.h" - -/* - * Macro defining the number of micoseconds in a second. - */ - -#define ALT_US (1000000) - -/* - * "alt_timezone" and "alt_resettime" are the values of the the reset time and - * time zone set through the last call to settimeofday(). By default they are - * zero initialised. - */ - -struct timezone alt_timezone = {0, 0}; -struct timeval alt_resettime = {0, 0}; - -/* - * gettimeofday() can be called to obtain a time structure which indicates the - * current "wall clock" time. This is calculated using the elapsed number of - * system clock ticks, and the value of "alt_resettime" and "alt_timezone" set - * through the last call to settimeofday(). - * - * Warning: if this function is called concurrently with a call to - * settimeofday(), the value returned by gettimeofday() will be unreliable. - * - * ALT_GETTIMEOFDAY is mapped onto the gettimeofday() system call in - * alt_syscall.h - */ - - -#if defined (__GNUC__) && (__GNUC__ >= 4) -int ALT_GETTIMEOFDAY (struct timeval *ptimeval, void *ptimezone_vptr) -{ - struct timezone *ptimezone = (struct timezone*)ptimezone_vptr; -#else -int ALT_GETTIMEOFDAY (struct timeval *ptimeval, struct timezone *ptimezone) -{ -#endif - - alt_u32 nticks = alt_nticks (); - alt_u32 tick_rate = alt_ticks_per_second (); - - /* - * Check to see if the system clock is running. This is indicated by a - * non-zero system clock rate. If the system clock is not running, an error - * is generated and the contents of "ptimeval" and "ptimezone" are not - * updated. - */ - - if (tick_rate) - { - ptimeval->tv_sec = alt_resettime.tv_sec + nticks/tick_rate; - ptimeval->tv_usec = alt_resettime.tv_usec + - (alt_u32)(((alt_u64)nticks*(ALT_US/tick_rate))%ALT_US); - - while(ptimeval->tv_usec < 0) { - if (ptimeval->tv_sec <= 0) - { - ptimeval->tv_sec = 0; - ptimeval->tv_usec = 0; - break; - } - else - { - ptimeval->tv_sec--; - ptimeval->tv_usec += ALT_US; - } - } - - while(ptimeval->tv_usec >= ALT_US) { - ptimeval->tv_sec++; - ptimeval->tv_usec -= ALT_US; - } - - if (ptimezone) - { - ptimezone->tz_minuteswest = alt_timezone.tz_minuteswest; - ptimezone->tz_dsttime = alt_timezone.tz_dsttime; - } - - return 0; - } - - return -ENOTSUP; -} - diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_gmon.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_gmon.c deleted file mode 100644 index 6add9f1..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_gmon.c +++ /dev/null @@ -1,272 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include -#include -#include - -#include "priv/nios2_gmon_data.h" - -#include "sys/alt_irq.h" -#include "sys/alt_alarm.h" - - -/* Macros */ - -/* How large should the bins be which we use to generate the histogram */ -#define PCSAMPLE_BYTES_PER_BUCKET 32 - -#define NIOS2_READ_EA(dest) __asm__ ("mov %0, ea" : "=r" (dest)) - -/* The compiler inserts calls to mcount() at the start of - * every function call. The structure mcount_fn_arc records t - * he return address of the function called (in from_pc) - * and the return address of the mcount function - * (in self_pc). The number of times this arc is executed is - * recorded in the field count. - */ -struct mcount_fn_arc -{ - struct mcount_fn_arc * next; - void * from_pc; - unsigned int count; -}; - -/* We need to maintain a list of pointers to the heads of each adjacency - * list so that we can find them when writing out the gmon.out file. Since - * we don't know at the start of program execution how many functions will - * be called we use a list structure to do this. - */ -struct mcount_fn_entry -{ - struct mcount_fn_entry * next; - void * self_pc; - struct mcount_fn_arc * arc_head; -}; - -/* function prototypes */ - -void __mcount_record(void * self_pc, void * from_pc, struct mcount_fn_entry * fn_entry, struct mcount_fn_entry * * fn_head) __attribute__ ((no_instrument_function)); - -static __inline__ void * mcount_allocate(unsigned int size) __attribute__ ((no_instrument_function)); -static int nios2_pcsample_init(void) __attribute__ ((no_instrument_function)); -static alt_u32 nios2_pcsample(void* alarm) __attribute__ ((no_instrument_function)); - -/* global variables */ - -/* stext and etext are defined in the linker script */ -extern char stext[]; -extern char etext[]; - -/* Is the PC sampling stuff enabled yet? */ -static int pcsample_need_init = 1; - -#define HASH_BUCKETS 64 /* Must be a power of 2 */ - -/* This points to the list of adjacency list pointers. */ -struct mcount_fn_entry * __mcount_fn_head[HASH_BUCKETS]; - -/* pointer to the in-memory buffer containing the histogram */ -static unsigned short* s_pcsamples = 0; - -/* the address of the start and end of text section */ -static const unsigned int s_low_pc = (unsigned int)stext; -static const unsigned int s_high_pc = (unsigned int)etext; - -/* the alarm structure to register for pc sampling */ -static alt_alarm s_nios2_pcsample_alarm; - -unsigned int alt_gmon_data[GMON_DATA_SIZE] = -{ - 0x6e6f6d67, /* "gmon" */ - GMON_DATA_SIZE, - 0, - (unsigned int)stext, - (unsigned int)etext, - PCSAMPLE_BYTES_PER_BUCKET, - 0, - (unsigned int)__mcount_fn_head, - (unsigned int)(__mcount_fn_head + HASH_BUCKETS) -}; - -/* This holds the current slab of memory we're allocating out of */ -static char * mcount_slab_ptr = 0; -static int mcount_slab_size = 0; - -#define MCOUNT_SLAB_INCREMENT 1020 - - -/* - * We can't use malloc to allocate memory because that's too complicated, and - * can't be called at interrupt time. Use the lower level allocator instead - * because that's interrupt safe (and because we never free anything). - * - * For speed, we allocate a block of data at once. - */ -static __inline__ void * mcount_allocate(unsigned int size) -{ - void * data; - - if (size > mcount_slab_size) - { - mcount_slab_ptr = sbrk(MCOUNT_SLAB_INCREMENT); - mcount_slab_size = MCOUNT_SLAB_INCREMENT; - } - - data = mcount_slab_ptr; - mcount_slab_ptr += size; - mcount_slab_size -= size; - - return data; -} - - -/* - * Add the arc with the values of frompc and topc given to the graph. - * This function might be called at interrupt time so must be able to - * cope with reentrancy. - * - * The fast case, where we have already allocated a function arc, has been - * handled by the assmebler code. - */ -void __mcount_record(void * self_pc, void * from_pc, struct mcount_fn_entry * fn_entry, struct mcount_fn_entry * * fn_head) -{ - alt_irq_context context; - struct mcount_fn_arc * arc_entry; - - /* Keep trying to start up the PC sampler until it is running. - * (It can't start until the timer is going). - */ - if (pcsample_need_init) - { - pcsample_need_init = 0; - pcsample_need_init = nios2_pcsample_init(); - } - - /* - * We must disable interrupts around the allocation and the list update to - * prevent corruption if the instrumented function is re-entrant. - * - * It's safe for the code above to be stepping through the chain and be - * interrupted by this code modifying it - there is an edge case which will - * leave two copies of the same arc on the list (both with count=1), but - * this is dealt with on the host. - */ - context = alt_irq_disable_all(); - - if (fn_entry == NULL) - { - /* Add it to the list of functions we must output later. */ - fn_entry = (struct mcount_fn_entry *)mcount_allocate(sizeof(struct mcount_fn_entry)); - - fn_entry->self_pc = self_pc; - fn_entry->arc_head = NULL; - - fn_entry->next = *fn_head; - *fn_head = fn_entry; - } - - /* We will need a new list entry - if there was a list entry before - * then the assembler code would have handled it. */ - arc_entry = (struct mcount_fn_arc *)mcount_allocate(sizeof(struct mcount_fn_arc)); - - arc_entry->from_pc = from_pc; - arc_entry->count = 1; - - arc_entry->next = fn_entry->arc_head; - fn_entry->arc_head = arc_entry; - - alt_irq_enable_all(context); -} - - -/* - * nios2_pcsample_init starts profiling. - * It is called the first time mcount is called, and on subsequent calls to - * mcount until it returns zero. It initializes the pc histogram and turns on - * timer driven pc sampling. - */ -static int nios2_pcsample_init(void) -{ - unsigned int pcsamples_size; - - /* We sample the PC every tick */ - unsigned int prof_rate = alt_ticks_per_second(); - if (prof_rate == 0) - return 1; - - /* allocate the histogram buffer s_pcsamples */ - pcsamples_size = (s_high_pc - s_low_pc)/PCSAMPLE_BYTES_PER_BUCKET; - s_pcsamples = (unsigned short*)sbrk(pcsamples_size * sizeof(unsigned short)); - - if (s_pcsamples != 0) - { - /* initialize the buffer to zero */ - memset(s_pcsamples, 0, pcsamples_size * sizeof(unsigned short)); - - alt_gmon_data[GMON_DATA_PROFILE_DATA] = (int)s_pcsamples; - alt_gmon_data[GMON_DATA_PROFILE_RATE] = prof_rate; - - /* Sample every tick (it's cheap) */ - alt_alarm_start(&s_nios2_pcsample_alarm, 1, nios2_pcsample, 0); - } - - return 0; -} - - -/* - * Sample the PC value and store it in the histogram - */ -static alt_u32 nios2_pcsample(void* context) -{ - unsigned int pc; - unsigned int bucket; - - /* read the exception return address - this will be - * inaccurate if there are nested interrupts but we - * assume that this is rare and the inaccuracy will - * not be great */ - NIOS2_READ_EA(pc); - - /* - * If we're within the profilable range then increment the relevant - * bucket in the histogram - */ - if (pc >= s_low_pc && pc < s_high_pc && s_pcsamples != 0) - { - bucket = (pc - s_low_pc)/PCSAMPLE_BYTES_PER_BUCKET; - s_pcsamples[bucket]++; - } - - /* Sample every tick */ - return 1; -} - diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_icache_flush.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_icache_flush.c deleted file mode 100644 index 4b706ed..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_icache_flush.c +++ /dev/null @@ -1,84 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "nios2.h" -#include "system.h" - -#include "alt_types.h" -#include "sys/alt_cache.h" - -/* - * alt_icache_flush() is called to flush the instruction cache for a memory - * region of length "len" bytes, starting at address "start". - */ - -void alt_icache_flush (void* start, alt_u32 len) -{ -#if NIOS2_ICACHE_SIZE > 0 - - char* i; - char* end; - - /* - * This is the most we would ever need to flush. - */ - - if (len > NIOS2_ICACHE_SIZE) - { - len = NIOS2_ICACHE_SIZE; - } - - end = ((char*) start) + len; - - for (i = start; i < end; i+= NIOS2_ICACHE_LINE_SIZE) - { - __asm__ volatile ("flushi %0" :: "r" (i)); - } - - /* - * For an unaligned flush request, we've got one more line left. - * Note that this is dependent on NIOS2_ICACHE_LINE_SIZE to be a - * multiple of 2 (which it always is). - */ - - if (((alt_u32) start) & (NIOS2_ICACHE_LINE_SIZE - 1)) - { - __asm__ volatile ("flushi %0" :: "r" (i)); - } - - /* - * Having flushed the cache, flush any stale instructions in the - * pipeline - */ - - __asm__ volatile ("flushp"); - -#endif /* NIOS2_ICACHE_SIZE > 0 */ -} diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_icache_flush_all.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_icache_flush_all.c deleted file mode 100644 index 5088552..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_icache_flush_all.c +++ /dev/null @@ -1,46 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "nios2.h" -#include "system.h" - -#include "alt_types.h" -#include "sys/alt_cache.h" - -/* - * alt_icache_flush_all() is called to flush the entire instruction cache. - */ - -void alt_icache_flush_all (void) -{ -#if NIOS2_ICACHE_SIZE > 0 - alt_icache_flush (0, NIOS2_ICACHE_SIZE); -#endif -} diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_iic.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_iic.c deleted file mode 100644 index 1db5afa..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_iic.c +++ /dev/null @@ -1,106 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ -#include "system.h" - -/* - * This file implements the HAL Enhanced interrupt API for Nios II processors - * with an internal interrupt controller (IIC). For most routines, this serves - * as a wrapper layer over the legacy interrupt API (which must be used with - * the IIC only). - * - * Use of the enhanced API is recommended so that application and device - * drivers are compatible with a Nios II system configured with an external - * interrupt controller (EIC), or IIC. This will afford maximum portability. - * - * If an EIC is present, the EIC device driver must provide these routines, - * because their operation will be specific to that EIC type. - */ -#ifndef NIOS2_EIC_PRESENT -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - -#include "sys/alt_irq.h" -#include "priv/alt_iic_isr_register.h" -#include "priv/alt_legacy_irq.h" - -/** @Function Description: This function registers an interrupt handler. - * If the function is succesful, then the requested interrupt will be enabled upon - * return. Registering a NULL handler will disable the interrupt. - * @API Type: External - * @param ic_id Ignored. - * @param irq IRQ number - * @return 0 if successful, else error (-1) - */ -int alt_ic_isr_register(alt_u32 ic_id, alt_u32 irq, alt_isr_func isr, - void *isr_context, void *flags) -{ - return alt_iic_isr_register(ic_id, irq, isr, isr_context, flags); -} - -/** @Function Description: This function enables a single interrupt. - * @API Type: External - * @param ic_id Ignored. - * @param irq IRQ number - * @return 0 if successful, else error (-1) - */ -int alt_ic_irq_enable (alt_u32 ic_id, alt_u32 irq) -{ - return alt_irq_enable(irq); -} - -/** @Function Description: This function disables a single interrupt. - * @API Type: External - * @param ic_id Ignored. - * @param irq IRQ number - * @return 0 if successful, else error (-1) - */ -int alt_ic_irq_disable(alt_u32 ic_id, alt_u32 irq) -{ - return alt_irq_disable(irq); -} - -/** @Function Description: This function to determine if corresponding - * interrupt is enabled. - * @API Type: External - * @param ic_id Ignored. - * @param irq IRQ number - * @return Zero if corresponding interrupt is disabled and - * non-zero otherwise. - */ -alt_u32 alt_ic_irq_enabled(alt_u32 ic_id, alt_u32 irq) -{ - alt_u32 irq_enabled; - - NIOS2_READ_IENABLE(irq_enabled); - - return (irq_enabled & (1 << irq)) ? 1: 0; -} - -#endif /* ALT_ENHANCED_INTERRUPT_API_PRESENT */ -#endif /* NIOS2_EIC_PRESENT */ diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_iic_isr_register.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_iic_isr_register.c deleted file mode 100644 index b104395..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_iic_isr_register.c +++ /dev/null @@ -1,104 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ -#include -#include "system.h" - -/* - * Provides an interrupt registry mechanism for the any CPUs internal interrupt - * controller (IIC) when the enhanced interrupt API is active. - */ -#ifndef ALT_CPU_EIC_PRESENT -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - -#include "alt_types.h" -#include "sys/alt_irq.h" -#include "priv/alt_iic_isr_register.h" - -/* - * The header, alt_irq_entry.h, contains the exception entry point, and is - * provided by the processor component. It is included here, so that the code - * will be added to the executable only if alt_irq_register() is present, i.e. - * if no interrupts are registered - there's no need to provide any - * interrupt handling. - */ - -#include "sys/alt_irq_entry.h" - -/* - * The header, alt_irq_table.h contains a table describing which function - * handles each interrupt. - */ - -#include "priv/alt_irq_table.h" - -/** @Function Description: This function registers an interrupt handler. - * If the function is succesful, then the requested interrupt will be enabled - * upon return. Registering a NULL handler will disable the interrupt. - * - * @API Type: External - * @param ic_id Interrupt controller ID - * @param irq IRQ ID number - * @param isr Pointer to interrupt service routine - * @param isr_context Opaque pointer passed to ISR - * @param flags - * @return 0 if successful, else error (-1) - */ -int alt_iic_isr_register(alt_u32 ic_id, alt_u32 irq, alt_isr_func isr, - void *isr_context, void *flags) -{ - int rc = -EINVAL; - int id = irq; /* IRQ interpreted as the interrupt ID. */ - alt_irq_context status; - - if (id < ALT_NIRQ) - { - /* - * interrupts are disabled while the handler tables are updated to ensure - * that an interrupt doesn't occur while the tables are in an inconsistant - * state. - */ - - status = alt_irq_disable_all(); - - alt_irq[id].handler = isr; - alt_irq[id].context = isr_context; - - rc = (isr) ? alt_ic_irq_enable(ic_id, id) : alt_ic_irq_disable(ic_id, id); - - alt_irq_enable_all(status); - } - - return rc; -} - -#endif /* ALT_ENHANCED_INTERRUPT_API_PRESENT */ -#endif /* ALT_CPU_EIC_PRESENT */ diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_instruction_exception_entry.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_instruction_exception_entry.c deleted file mode 100644 index f4f52fc..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_instruction_exception_entry.c +++ /dev/null @@ -1,203 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2008 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ -#include "sys/alt_exceptions.h" -#include "nios2.h" -#include "alt_types.h" -#include "system.h" - -/* - * This file implements support for calling user-registered handlers for - * instruction-generated exceptions. This handler could also be reached - * in the event of a spurious interrupt. - * - * The handler code is optionally enabled through the "Enable - * Instruction-related Exception API" HAL BSP setting, which will - * define the macro below. - */ -#ifdef ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API - -/* Function pointer to exception callback routine */ -alt_exception_result (*alt_instruction_exception_handler) - (alt_exception_cause, alt_u32, alt_u32) = 0x0; - -/* Link entry routine to .exceptions section */ -int alt_instruction_exception_entry (alt_u32 exception_pc) - __attribute__ ((section (".exceptions"))); - -/* - * This is the entry point for instruction-generated exceptions handling. - * This routine will be called by alt_exceptions_entry.S, after it determines - * that an exception could not be handled by handlers that preceed that - * of instruction-generated exceptions (such as interrupts). - * - * For this to function properly, you must register an exception handler - * using alt_instruction_exception_register(). This routine will call - * that handler if it has been registered. Absent a handler, it will - * break break or hang as discussed below. - */ -int alt_instruction_exception_entry (alt_u32 exception_pc) -{ - alt_u32 cause, badaddr; - -/* - * If the processor hardware has the optional EXCEPTIONS & BADADDR registers, - * read them and pass their content to the user handler. These are always - * present if the MMU or MPU is enabled, and optionally for other advanced - * exception types via the "Extra exceptions information" setting in the - * processor (hardware) configuration. - * - * If these registers are not present, the cause field will be set to - * NIOS2_EXCEPTION_CAUSE_NOT_PRESENT. Your handling routine should - * check the validity of the cause argument before proceeding. - */ -#ifdef NIOS2_HAS_EXTRA_EXCEPTION_INFO - /* Get exception cause & "badaddr" */ - NIOS2_READ_EXCEPTION(cause); - cause = ( (cause & NIOS2_EXCEPTION_REG_CAUSE_MASK) >> - NIOS2_EXCEPTION_REG_CAUSE_OFST ); - - NIOS2_READ_BADADDR(badaddr); -#else - cause = NIOS2_EXCEPTION_CAUSE_NOT_PRESENT; - badaddr = 0; -#endif /* NIOS2_HAS_EXTRA_EXCEPTION_INFO */ - - if(alt_instruction_exception_handler) { - /* - * Call handler. Its return value indicates whether the exception-causing - * instruction should be re-issued. The code that called us, - * alt_eceptions_entry.S, will look at this value and adjust the ea - * register as necessary - */ - return alt_instruction_exception_handler(cause, exception_pc, badaddr); - } - /* - * We got here because an instruction-generated exception occured, but no - * handler is present. We do not presume to know how to handle it. If the - * debugger is present, break, otherwise hang. - * - * If you've reached here in the debugger, consider examining the - * EXCEPTIONS register cause bit-field, which was read into the 'cause' - * variable above, and compare it against the exceptions-type enumeration - * in alt_exceptions.h. This register is availabe if the MMU or MPU is - * present, or if the "Extra exceptions information" hardware option is - * selected. - * - * If you get here then one of the following could have happened: - * - * - An instruction-generated exception occured, and the processor - * does not have the extra exceptions feature enabled, or you - * have not registered a handler using - * alt_instruction_exception_register() - * - * Some examples of instruction-generated exceptions and why they - * might occur: - * - * - Your program could have been compiled for a full-featured - * Nios II core, but it is running on a smaller core, and - * instruction emulation has been disabled by defining - * ALT_NO_INSTRUCTION_EMULATION. - * - * You can work around the problem by re-enabling instruction - * emulation, or you can figure out why your program is being - * compiled for a system other than the one that it is running on. - * - * - Your program has executed a trap instruction, but has not - * implemented a handler for this instruction. - * - * - Your program has executed an illegal instruction (one which is - * not defined in the instruction set). - * - * - Your processor includes an MMU or MPU, and you have enabled it - * before registering an exception handler to service exceptions it - * generates. - * - * The problem could also be hardware related: - * - If your hardware is broken and is generating spurious interrupts - * (a peripheral which negates its interrupt output before its - * interrupt handler has been executed will cause spurious interrupts) - */ - else { -#ifdef NIOS2_HAS_DEBUG_STUB - NIOS2_BREAK(); -#else - while(1) - ; -#endif /* NIOS2_HAS_DEBUG_STUB */ - } - - /* // We should not get here. Remove compiler warning. */ - return NIOS2_EXCEPTION_RETURN_REISSUE_INST; -} - -#endif /* ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API */ - -/* - * This routine indicates whether a particular exception cause will have - * set a valid address into the BADADDR register, which is included - * in the arguments to a user-registered instruction-generated exception - * handler. Many exception types do not set valid contents in BADADDR; - * this is a convenience routine to easily test the validity of that - * argument in your handler. - * - * Note that this routine will return false (0) for cause '12', - * TLB miss. This is because there are four exception types that - * share that cause, two of which do not have a valid BADADDR. You - * must determine BADADDR's validity for these. - * - * Arguments: - * cause: The 5-bit exception cause field of the EXCEPTIONS register, - * shifted to the LSB position. You may pass the 'cause' argument - * in a handler you registered directy to this routine. - * - * Return: 1: BADADDR (bad_addr argument to handler) is valid - * 0: BADADDR is not valid - */ -int alt_exception_cause_generated_bad_addr(alt_exception_cause cause) -{ - switch (cause) { - case NIOS2_EXCEPTION_SUPERVISOR_ONLY_DATA_ADDR: - return 1; - case NIOS2_EXCEPTION_MISALIGNED_DATA_ADDR: - return 1; - case NIOS2_EXCEPTION_MISALIGNED_TARGET_PC: - return 1; - case NIOS2_EXCEPTION_TLB_READ_PERM_VIOLATION: - return 1; - case NIOS2_EXCEPTION_TLB_WRITE_PERM_VIOLATION: - return 1; - case NIOS2_EXCEPTION_MPU_DATA_REGION_VIOLATION: - return 1; - default: - return 0; - } -} diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_instruction_exception_register.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_instruction_exception_register.c deleted file mode 100644 index b059e1d..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_instruction_exception_register.c +++ /dev/null @@ -1,82 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2008 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ -#include "sys/alt_exceptions.h" -#include "alt_types.h" -#include "system.h" - -/* - * This file implements support for calling user-registered handlers for - * instruction-generated exceptions. - * - * The registry API is optionally enabled through the "Enable - * Instruction-related Exception API" HAL BSP setting, which will - * define the macro below. - */ -#ifdef ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API - -/* - * The header, alt_exception_handler_registry.h contains a struct describing - * the registered exception handler - */ -#include "priv/alt_exception_handler_registry.h" - -/* - * Pull in the exception entry assembly code. This will not be linked in - * unless this object is linked into the executable (i.e. only if - * alt_instruction_exception_register() is called). - */ -__asm__( "\n\t.globl alt_exception" ); - -/* - * alt_instruction_exception_register() is called to register a handler to - * service instruction-generated exceptions that are not handled by the - * default exception handler code (interrupts, and optionally unimplemented - * instructions and traps). - * - * Passing null (0x0) in the handler argument will disable a previously- - * registered handler. - * - * Note that if no handler is registered, exceptions that are not processed - * using the built-in handler (interrupts, and optionally unimplemented - * instructions and traps) are treated as unknown exceptions, resulting - * in either a break or an infinite loop. - */ -void alt_instruction_exception_register ( - alt_exception_result (*exception_handler)( - alt_exception_cause cause, - alt_u32 exception_pc, - alt_u32 bad_addr) ) -{ - alt_instruction_exception_handler = exception_handler; -} - -#endif /* ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API */ diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_io_redirect.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_io_redirect.c deleted file mode 100644 index 8c862f7..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_io_redirect.c +++ /dev/null @@ -1,98 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include -#include - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - - -/* - * alt_open_fd() is similar to open() in that it is used to obtain a file - * descriptor for the file named "name". The "flags" and "mode" arguments are - * identical to the "flags" and "mode" arguments of open(). - * - * The distinction between the two functions is that the file descriptor - * structure to use is passed in as an argument, rather than allocated from the - * list of free file descriptors. - * - * This is used by alt_io_redirect() to redirect the stdin, stdout and stderr - * file descriptors to point to new devices. - * - * If the device can not be succesfully opened, then the input file descriptor - * remains unchanged. - */ - -static void alt_open_fd(alt_fd* fd, const char* name, int flags, int mode) -{ - int old; - - old = open (name, flags, mode); - - if (old >= 0) - { - fd->dev = alt_fd_list[old].dev; - fd->priv = alt_fd_list[old].priv; - fd->fd_flags = alt_fd_list[old].fd_flags; - - alt_release_fd (old); - } -} - -/* - * alt_io_redirect() is called once the device/filesystem lists have been - * initialised, but before main(). Its function is to redirect standard in, - * standard out and standard error so that they point to the devices selected by - * the user (as defined in system.h). - * - * Prior to the call to this function, io is directed towards /dev/null. If - * i/o can not be redirected to the requested device, for example if the device - * does not exist, then it remains directed at /dev/null. - */ - -void alt_io_redirect(const char* stdout_dev, - const char* stdin_dev, - const char* stderr_dev) -{ - /* Redirect the channels */ - - alt_open_fd (&alt_fd_list[STDOUT_FILENO], stdout_dev, O_WRONLY, 0777); - alt_open_fd (&alt_fd_list[STDIN_FILENO], stdin_dev, O_RDONLY, 0777); - alt_open_fd (&alt_fd_list[STDERR_FILENO], stderr_dev, O_WRONLY, 0777); -} - - - - diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_ioctl.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_ioctl.c deleted file mode 100644 index f5d7ef1..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_ioctl.c +++ /dev/null @@ -1,170 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "sys/ioctl.h" -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -/* - * The ioctl() system call is provided so that application code can manipulate - * the i/o capabilities of a device in device specific ways. This is identical - * to the standard posix ioctl() function. - * - * In general this implementation simply vectors ioctl requests to the - * apropriate drivers ioctl function (as registered in the drivers alt_dev - * structure). - * - * However in the case of devices (as oposed to filesystem), the TIOCEXCL and - * TIOCNXCL requests are handled without reference to the driver. These - * requests are used to lock/release a device for exclusive access. - * - * Handling these requests centrally eases the task of device driver - * development. - * - * ALT_IOCTL is mapped onto the ioctl() system call in alt_syscall.h - */ - -#ifdef ALT_USE_DIRECT_DRIVERS - -#include "system.h" -#include "sys/alt_driver.h" - -/* - * Provide minimal version that calls ioctl routine of provided stdio devices. - */ -int ALT_IOCTL (int file, int req, void* arg) -{ -#ifdef ALT_STDIN_PRESENT - ALT_DRIVER_IOCTL_EXTERNS(ALT_STDIN_DEV); -#endif -#ifdef ALT_STDOUT_PRESENT - ALT_DRIVER_IOCTL_EXTERNS(ALT_STDOUT_DEV); -#endif -#ifdef ALT_STDERR_PRESENT - ALT_DRIVER_IOCTL_EXTERNS(ALT_STDERR_DEV); -#endif - -#if !defined(ALT_STDIN_PRESENT) && !defined(ALT_STDOUT_PRESENT) && !defined(ALT_STDERR_PRESENT) - /* Generate a link time warning, should this function ever be called. */ - ALT_STUB_WARNING(ioctl); -#endif - - switch (file) { -#ifdef ALT_STDIN_PRESENT - case 0: /* stdin file descriptor */ - return ALT_DRIVER_IOCTL(ALT_STDIN_DEV, req, arg); -#endif /* ALT_STDIN_PRESENT */ -#ifdef ALT_STDOUT_PRESENT - case 1: /* stdout file descriptor */ - return ALT_DRIVER_IOCTL(ALT_STDOUT_DEV, req, arg); -#endif /* ALT_STDOUT_PRESENT */ -#ifdef ALT_STDERR_PRESENT - case 2: /* stderr file descriptor */ - return ALT_DRIVER_IOCTL(ALT_STDERR_DEV, req, arg); -#endif /* ALT_STDERR_PRESENT */ - default: - ALT_ERRNO = EBADFD; - return -1; - } -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -int ALT_IOCTL (int file, int req, void* arg) -{ - alt_fd* fd; - int rc; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - - /* - * In the case of device drivers (not file systems) handle the TIOCEXCL - * and TIOCNXCL requests as special cases. - */ - - if (fd->fd_flags & ALT_FD_DEV) - { - if (req == TIOCEXCL) - { - rc = alt_fd_lock (fd); - goto ioctl_done; - } - else if (req == TIOCNXCL) - { - rc = alt_fd_unlock (fd); - goto ioctl_done; - } - } - - /* - * If the driver provides an ioctl() function, call that to handle the - * request, otherwise set the return code to indicate that the request - * could not be processed. - */ - - if (fd->dev->ioctl) - { - rc = fd->dev->ioctl(fd, req, arg); - } - else - { - rc = -ENOTTY; - } - } - else - { - rc = -EBADFD; - } - -ioctl_done: - - if (rc < 0) - { - ALT_ERRNO = -rc; - } - return rc; -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_irq_entry.S b/software/qsys_tutorial_test_bsp/HAL/src/alt_irq_entry.S deleted file mode 100644 index d3efe7d..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_irq_entry.S +++ /dev/null @@ -1,108 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "system.h" - -/* - * This is the interrupt exception entry point code, which saves all the - * registers and calls the interrupt handler. It should be pulled in using - * a .globl from alt_irq_register.c. This scheme is used so that if an - * interrupt is never registered, then this code will not appear in the - * generated executable, thereby improving code footprint. - */ - - /* - * Explicitly allow the use of r1 (the assembler temporary register) - * within this code. This register is normally reserved for the use of - * the compiler. - */ - .set noat - - /* - * Pull in the exception handler register save code. - */ - .globl alt_exception - - .globl alt_irq_entry - .section .exceptions.entry.label, "xa" -alt_irq_entry: - - /* - * Section .exceptions.entry is in alt_exception_entry.S - * This saves all the caller saved registers and reads estatus into r5 - */ - - .section .exceptions.irqtest, "xa" - -#ifdef ALT_CI_INTERRUPT_VECTOR_N - /* - * Use the interrupt vector custom instruction if present to accelerate - * this code. - * If the interrupt vector custom instruction returns a negative - * value, there are no interrupts active (estatus.pie is 0 - * or ipending is 0) so assume it is a software exception. - */ - custom ALT_CI_INTERRUPT_VECTOR_N, r4, r0, r0 - blt r4, r0, .Lnot_irq -#else - /* - * Test to see if the exception was a software exception or caused - * by an external interrupt, and vector accordingly. - */ - rdctl r4, ipending - andi r2, r5, 1 - beq r2, zero, .Lnot_irq - beq r4, zero, .Lnot_irq -#endif /* ALT_CI_INTERRUPT_VECTOR_N */ - - .section .exceptions.irqhandler, "xa" - /* - * Now that all necessary registers have been preserved, call - * alt_irq_handler() to process the interrupts. - */ - - call alt_irq_handler - - .section .exceptions.irqreturn, "xa" - - br .Lexception_exit - - .section .exceptions.notirq.label, "xa" - -.Lnot_irq: - - /* - * Section .exceptions.exit is in alt_exception_entry.S - * This restores all the caller saved registers - */ - - .section .exceptions.exit.label -.Lexception_exit: - diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_irq_handler.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_irq_handler.c deleted file mode 100644 index 3253d02..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_irq_handler.c +++ /dev/null @@ -1,169 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include "system.h" - -/* - * This interrupt handler only works with an internal interrupt controller - * (IIC). Processors with an external interrupt controller (EIC) use an - * implementation provided by an EIC driver. - */ -#ifndef ALT_CPU_EIC_PRESENT - -#include "sys/alt_irq.h" -#include "os/alt_hooks.h" - -#include "alt_types.h" - -/* - * A table describing each interrupt handler. The index into the array is the - * interrupt id associated with the handler. - * - * When an interrupt occurs, the associated handler is called with - * the argument stored in the context member. - */ -struct ALT_IRQ_HANDLER -{ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - void (*handler)(void*); -#else - void (*handler)(void*, alt_u32); -#endif - void *context; -} alt_irq[ALT_NIRQ]; - -/* - * alt_irq_handler() is called by the interrupt exception handler in order to - * process any outstanding interrupts. - * - * It is defined here since it is linked in using weak linkage. - * This means that if there is never a call to alt_irq_register() (above) then - * this function will not get linked in to the executable. This is acceptable - * since if no handler is ever registered, then an interrupt can never occur. - * - * If Nios II interrupt vector custom instruction exists, use it to accelerate - * the dispatch of interrupt handlers. The Nios II interrupt vector custom - * instruction is present if the macro ALT_CI_INTERRUPT_VECTOR defined. - */ - -void alt_irq_handler (void) __attribute__ ((section (".exceptions"))); -void alt_irq_handler (void) -{ -#ifdef ALT_CI_INTERRUPT_VECTOR - alt_32 offset; - char* alt_irq_base = (char*)alt_irq; -#else - alt_u32 active; - alt_u32 mask; - alt_u32 i; -#endif /* ALT_CI_INTERRUPT_VECTOR */ - - /* - * Notify the operating system that we are at interrupt level. - */ - - ALT_OS_INT_ENTER(); - -#ifdef ALT_CI_INTERRUPT_VECTOR - /* - * Call the interrupt vector custom instruction using the - * ALT_CI_INTERRUPT_VECTOR macro. - * It returns the offset into the vector table of the lowest-valued pending - * interrupt (corresponds to highest priority) or a negative value if none. - * The custom instruction assumes that each table entry is eight bytes. - */ - while ((offset = ALT_CI_INTERRUPT_VECTOR) >= 0) { - struct ALT_IRQ_HANDLER* handler_entry = - (struct ALT_IRQ_HANDLER*)(alt_irq_base + offset); -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - handler_entry->handler(handler_entry->context); -#else - handler_entry->handler(handler_entry->context, offset >> 3); -#endif - } -#else /* ALT_CI_INTERRUPT_VECTOR */ - /* - * Obtain from the interrupt controller a bit list of pending interrupts, - * and then process the highest priority interrupt. This process loops, - * loading the active interrupt list on each pass until alt_irq_pending() - * return zero. - * - * The maximum interrupt latency for the highest priority interrupt is - * reduced by finding out which interrupts are pending as late as possible. - * Consider the case where the high priority interupt is asserted during - * the interrupt entry sequence for a lower priority interrupt to see why - * this is the case. - */ - - active = alt_irq_pending (); - - do - { - i = 0; - mask = 1; - - /* - * Test each bit in turn looking for an active interrupt. Once one is - * found, the interrupt handler asigned by a call to alt_irq_register() is - * called to clear the interrupt condition. - */ - - do - { - if (active & mask) - { -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - alt_irq[i].handler(alt_irq[i].context); -#else - alt_irq[i].handler(alt_irq[i].context, i); -#endif - break; - } - mask <<= 1; - i++; - - } while (1); - - active = alt_irq_pending (); - - } while (active); -#endif /* ALT_CI_INTERRUPT_VECTOR */ - - /* - * Notify the operating system that interrupt processing is complete. - */ - - ALT_OS_INT_EXIT(); -} - -#endif /* ALT_CPU_EIC_PRESENT */ diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_irq_register.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_irq_register.c deleted file mode 100644 index b5ea474..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_irq_register.c +++ /dev/null @@ -1,102 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2009 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ -#include -#include "system.h" - -/* - * This interrupt registry mechanism works with the Nios II internal interrupt - * controller (IIC) only. Systems with an external interrupt controller (EIC), - * or those with the IIC who are using the enhanced interrupt API will - * utilize the alt_ic_isr_register() routine to register an interrupt. - */ -#ifndef NIOS2_EIC_PRESENT - -#include "sys/alt_irq.h" -#include "priv/alt_legacy_irq.h" -#include "os/alt_hooks.h" - -#include "alt_types.h" - -/* - * The header, alt_irq_entry.h, contains the exception entry point, and is - * provided by the processor component. It is included here, so that the code - * will be added to the executable only if alt_irq_register() is present, i.e. - * if no interrupts are registered - there's no need to provide any - * interrupt handling. - */ - -#include "sys/alt_irq_entry.h" - -/* - * The header, alt_irq_table.h contains a table describing which function - * handles each interrupt. - */ - -#include "priv/alt_irq_table.h" - -/* - * alt_irq_handler() is called to register an interrupt handler. If the - * function is succesful, then the requested interrupt will be enabled upon - * return. Registering a NULL handler will disable the interrupt. - * - * The return value is 0 if the interrupt handler was registered and the - * interrupt was enabled, otherwise it is negative. - */ - -int alt_irq_register (alt_u32 id, - void* context, - alt_isr_func handler) -{ - int rc = -EINVAL; - alt_irq_context status; - - if (id < ALT_NIRQ) - { - /* - * interrupts are disabled while the handler tables are updated to ensure - * that an interrupt doesn't occur while the tables are in an inconsistant - * state. - */ - - status = alt_irq_disable_all (); - - alt_irq[id].handler = handler; - alt_irq[id].context = context; - - rc = (handler) ? alt_irq_enable (id): alt_irq_disable (id); - - alt_irq_enable_all(status); - } - return rc; -} -#endif /* NIOS2_EIC_PRESENT */ - diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_irq_vars.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_irq_vars.c deleted file mode 100644 index 8c0a18d..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_irq_vars.c +++ /dev/null @@ -1,47 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "alt_types.h" - -#include "system.h" - -/* - * These global variables are used to save the current list of enabled - * interrupts. See alt_irq.h for further details. - */ - -volatile alt_u32 alt_irq_active = 0; - -#ifndef ALT_EXCEPTION_STACK - -volatile alt_u32 alt_priority_mask = (alt_u32) -1; - -#endif - diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_isatty.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_isatty.c deleted file mode 100644 index 9276472..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_isatty.c +++ /dev/null @@ -1,125 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include "sys/alt_dev.h" -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -#ifdef ALT_USE_DIRECT_DRIVERS - -#include "system.h" - -/* - * Provide minimal version that just describes all file descriptors - * as tty devices for provided stdio devices. - */ -int ALT_ISATTY (int file) -{ - switch (file) { -#ifdef ALT_STDIN_PRESENT - case 0: /* stdin file descriptor */ -#endif /* ALT_STDIN_PRESENT */ -#ifdef ALT_STDOUT_PRESENT - case 1: /* stdout file descriptor */ -#endif /* ALT_STDOUT_PRESENT */ -#ifdef ALT_STDERR_PRESENT - case 2: /* stderr file descriptor */ -#endif /* ALT_STDERR_PRESENT */ - return 1; - default: - return 0; - } - -#if !defined(ALT_STDIN_PRESENT) && !defined(ALT_STDOUT_PRESENT) && !defined(ALT_STDERR_PRESENT) - /* Generate a link time warning, should this function ever be called. */ - ALT_STUB_WARNING(isatty); -#endif -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ -/* - * isatty() can be used to determine whether the input file descriptor "file" - * refers to a terminal device or not. If it is a terminal device then the - * return value is one, otherwise it is zero. - * - * ALT_ISATTY is mapped onto the isatty() system call in alt_syscall.h - */ - -int ALT_ISATTY (int file) -{ - alt_fd* fd; - struct stat stat; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - /* - * If a device driver does not provide an fstat() function, then it is - * treated as a terminal device by default. - */ - - if (!fd->dev->fstat) - { - return 1; - } - - /* - * If a driver does provide an implementation of the fstat() function, then - * this is called so that the device can identify itself. - */ - - else - { - fstat (file, &stat); - return (stat.st_mode == _IFCHR) ? 1 : 0; - } - } - else - { - ALT_ERRNO = EBADFD; - return 0; - } -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_kill.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_kill.c deleted file mode 100644 index 42c2e1d..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_kill.c +++ /dev/null @@ -1,121 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include "sys/alt_errno.h" -#include "os/alt_syscall.h" - - -/* - * kill() is used by newlib in order to send signals to processes. Since there - * is only a single process in the HAL, the only valid values for pid are - * either the current process id, or the broadcast values, i.e. pid must be - * less than or equal to zero. - * - * ALT_KILL is mapped onto the kill() system call in alt_syscall.h - */ - -int ALT_KILL (int pid, int sig) -{ - int status = 0; - - if (pid <= 0) - { - switch (sig) - { - case 0: - - /* The null signal is used to check that a pid is valid. */ - - break; - - case SIGABRT: - case SIGALRM: - case SIGFPE: - case SIGILL: - case SIGKILL: - case SIGPIPE: - case SIGQUIT: - case SIGSEGV: - case SIGTERM: - case SIGUSR1: - case SIGUSR2: - case SIGBUS: - case SIGPOLL: - case SIGPROF: - case SIGSYS: - case SIGTRAP: - case SIGVTALRM: - case SIGXCPU: - case SIGXFSZ: - - /* - * The Posix standard defines the default behaviour for all these signals - * as being eqivalent to a call to _exit(). No mechanism is provided to - * change this behaviour. - */ - - _exit(0); - case SIGCHLD: - case SIGURG: - - /* - * The Posix standard defines these signals to be ignored by default. No - * mechanism is provided to change this behaviour. - */ - - break; - default: - - /* Tried to send an unsupported signal */ - - status = EINVAL; - } - } - - else if (pid > 0) - { - /* Attempted to signal a non-existant process */ - - status = ESRCH; - } - - if (status) - { - ALT_ERRNO = status; - return -1; - } - - return 0; -} diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_link.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_link.c deleted file mode 100644 index d796c59..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_link.c +++ /dev/null @@ -1,56 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_warning.h" -#include "sys/alt_errno.h" -#include "os/alt_syscall.h" - -/* - * link() is used by newlib to create a new link to an existing file. This is - * unsupported in the HAL environment. However a "do-nothing" implementation - * is still provied for newlib compatability. - * - * ALT_LINK is mapped onto the link() system call in alt_syscall.h - */ - -int ALT_LINK ( char *existing, char *new) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(link); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} - diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_load.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_load.c deleted file mode 100644 index ffab4b9..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_load.c +++ /dev/null @@ -1,88 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_load.h" -#include "sys/alt_cache.h" - -/* - * Linker defined symbols. - */ - -extern void __flash_rwdata_start; -extern void __ram_rwdata_start; -extern void __ram_rwdata_end; -extern void __flash_rodata_start; -extern void __ram_rodata_start; -extern void __ram_rodata_end; -extern void __flash_exceptions_start; -extern void __ram_exceptions_start; -extern void __ram_exceptions_end; - -/* - * alt_load() is called when the code is executing from flash. In this case - * there is no bootloader, so this application is responsible for loading to - * RAM any sections that are required. - */ - -void alt_load (void) -{ - /* - * Copy the .rwdata section. - */ - - alt_load_section (&__flash_rwdata_start, - &__ram_rwdata_start, - &__ram_rwdata_end); - - /* - * Copy the exception handler. - */ - - alt_load_section (&__flash_exceptions_start, - &__ram_exceptions_start, - &__ram_exceptions_end); - - /* - * Copy the .rodata section. - */ - - alt_load_section (&__flash_rodata_start, - &__ram_rodata_start, - &__ram_rodata_end); - - /* - * Now ensure that the caches are in synch. - */ - - alt_dcache_flush_all(); - alt_icache_flush_all(); -} diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_log_macro.S b/software/qsys_tutorial_test_bsp/HAL/src/alt_log_macro.S deleted file mode 100644 index 499c4ad..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_log_macro.S +++ /dev/null @@ -1,56 +0,0 @@ -/* alt_log_macro.S - * - * Implements the function tx_log_str, called by the assembly macro - * ALT_LOG_PUTS(). The macro will be empty when logging is turned off, - * and this function will not be compiled. When logging is on, - * this function is used to print out the strings defined in the beginning - * of alt_log_printf.c, using port information taken from system.h and - * alt_log_printf.h. - * - * This routine only handles strings, and sends a character into the defined - * output device's output buffer when the device is ready. It's intended for - * debugging purposes, where messages can be set to print out at certain - * points in the boot code to indicate the progress of the program. - * - */ - -#ifndef __ALT_LOG_MACROS__ -#define __ALT_LOG_MACROS__ - -/* define this flag to skip assembly-incompatible parts - * of various include files. */ -#define ALT_ASM_SRC - -#ifdef ALT_LOG_ENABLE // only compile this function if this flag is defined. - - #include "system.h" - #include "sys/alt_log_printf.h" - - .global tx_log_str -tx_log_str: - /* load base uart / jtag uart address into r6 */ - movhi r6, %hiadj(ALT_LOG_PORT_BASE) - addi r6, r6, %lo(ALT_LOG_PORT_BASE) -tx_next_char: - /* if pointer points to null, return - * r4 is the pointer to the str to be printed, set by ALT_LOG_PUTS */ - ldb r7, (r4) - beq r0, r7, end_tx - - /* check device transmit ready */ -wait_tx_ready_loop: - ldwio r5, ALT_LOG_PRINT_REG_OFFSET(r6) - andi r5, r5, ALT_LOG_PRINT_MSK - beq r5, r0, wait_tx_ready_loop - /* write char */ - stwio r7, ALT_LOG_PRINT_TXDATA_REG_OFFSET (r6) - /* advance string pointer */ - addi r4, r4, 1 - br tx_next_char -end_tx: - ret - -#endif - -#endif /* __ALT_LOG_MACROS__ */ - diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_log_printf.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_log_printf.c deleted file mode 100644 index 1f7056d..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_log_printf.c +++ /dev/null @@ -1,479 +0,0 @@ - -/* alt_log_printf.c - * - * This file implements the various C functions used for the - * alt_log logging/debugging print functions. The functions - * sit as is here - the job of hiding them from the compiler - * if logging is disabled is accomplished in the .h file. - * - * All the global variables for alt_log are defined here. - * These include the various flags that turn on additional - * logging options; the strings for assembly printing; and - * other globals needed by different logging options. - * - * There are 4 functions that handle the actual printing: - * alt_log_txchar: Actual function that puts 1 char to UART/JTAG UART. - * alt_log_repchar: Calls alt_log_txchar 'n' times - used by - * alt_log_private_printf for formatting. - * alt_log_private_printf: - * Stripped down implementation of printf - no floats. - * alt_log_printf_proc: - * Wrapper function for private_printf. - * - * The rest of the functions are called by the macros which - * were called by code in the other components. Each function - * is preceded by a comment, about which file it gets called - * in, and what its purpose is. - * - * author: gkwan - */ - -/* skip all code if enable is off */ -#ifdef ALT_LOG_ENABLE - -#include -#include -#include -#ifdef __ALTERA_AVALON_JTAG_UART - #include "altera_avalon_jtag_uart.h" - #include -#endif -#include "sys/alt_log_printf.h" - -/* strings for assembly puts */ -char alt_log_msg_bss[] = "[crt0.S] Clearing BSS \r\n";; -char alt_log_msg_alt_main[] = "[crt0.S] Calling alt_main.\r\n"; -char alt_log_msg_stackpointer[] \ - = "[crt0.S] Setting up stack and global pointers.\r\n"; -char alt_log_msg_cache[] = "[crt0.S] Inst & Data Cache Initialized.\r\n"; -/* char array allocation for alt_write */ -char alt_log_write_buf[ALT_LOG_WRITE_ECHO_LEN+2]; - -/* global variables for all 'on' flags */ - -/* - * The boot message flag is linked into the data (rwdata) section - * because if it is zero, it would otherwise be placed in the bss section. - * alt_log examines this variable before the BSS is cleared in the boot-up - * process. - */ -volatile alt_u32 alt_log_boot_on_flag \ - __attribute__ ((section (".data"))) = ALT_LOG_BOOT_ON_FLAG_SETTING; - -volatile alt_u8 alt_log_write_on_flag = ALT_LOG_WRITE_ON_FLAG_SETTING; - -volatile alt_u8 alt_log_sys_clk_on_flag = ALT_LOG_SYS_CLK_ON_FLAG_SETTING; - -volatile alt_u8 alt_log_jtag_uart_alarm_on_flag = \ - ALT_LOG_JTAG_UART_ALARM_ON_FLAG_SETTING; - -volatile alt_u8 alt_log_jtag_uart_isr_on_flag = \ - ALT_LOG_JTAG_UART_ISR_ON_FLAG_SETTING; - -volatile alt_u8 alt_log_jtag_uart_startup_info_on_flag = \ - ALT_LOG_JTAG_UART_STARTUP_INFO_ON_FLAG_SETTING; - -/* Global alarm object for recurrent JTAG UART status printing */ -alt_alarm alt_log_jtag_uart_alarm_1; - -/* Global ints for system clock printing and count */ -volatile int alt_log_sys_clk_count; -volatile int alt_system_clock_in_sec; - -/* enum used by alt_log_private_printf */ -enum -{ - pfState_chars, - pfState_firstFmtChar, - pfState_otherFmtChar -}; - - - - -/* Function to put one char onto the UART/JTAG UART txdata register. */ -void alt_log_txchar(int c,char *base) -{ - /* Wait until the device is ready for a character */ - while((ALT_LOG_PRINT_REG_RD(base) & ALT_LOG_PRINT_MSK) == 0) - ; - /* And pop the character into the register */ - ALT_LOG_PRINT_TXDATA_WR(base,c); -} - - -/* Called by alt_log_private_printf to print out characters repeatedly */ -void alt_log_repchar(char c,int r,int base) -{ - while(r-- > 0) - alt_log_txchar(c,(char*) base); -} - - -/* Stripped down printf function */ -void alt_log_private_printf(const char *fmt,int base,va_list args) - { - const char *w; - char c; - int state; - int fmtLeadingZero = 0; /* init these all to 0 for -W warnings. */ - int fmtLong = 0; - int fmtBeforeDecimal = 0; - int fmtAfterDecimal = 0; - int fmtBase = 0; - int fmtSigned = 0; - int fmtCase = 0; /* For hex format, if 1, A-F, else a-f. */ - - w = fmt; - state = pfState_chars; - - while(0 != (c = *w++)) - { - switch(state) - { - case pfState_chars: - if(c == '%') - { - fmtLeadingZero = 0; - fmtLong = 0; - fmtBase = 10; - fmtSigned = 1; - fmtCase = 0; /* Only %X sets this. */ - fmtBeforeDecimal = -1; - fmtAfterDecimal = -1; - state = pfState_firstFmtChar; - } - else - { - alt_log_txchar(c,(char*)base); - } - break; - - case pfState_firstFmtChar: - if(c == '0') - { - fmtLeadingZero = 1; - state = pfState_otherFmtChar; - } - else if(c == '%') - { - alt_log_txchar(c,(char*)base); - state = pfState_chars; - } - else - { - state = pfState_otherFmtChar; - goto otherFmtChar; - } - break; - - case pfState_otherFmtChar: -otherFmtChar: - if(c == '.') - { - fmtAfterDecimal = 0; - } - else if('0' <= c && c <= '9') - { - c -= '0'; - if(fmtAfterDecimal < 0) /* still before decimal */ - { - if(fmtBeforeDecimal < 0) - { - fmtBeforeDecimal = 0; - } - else - { - fmtBeforeDecimal *= 10; - } - fmtBeforeDecimal += c; - } - else - { - fmtAfterDecimal = (fmtAfterDecimal * 10) + c; - } - } - else if(c == 'l') - { - fmtLong = 1; - } - else /* we're up to the letter which determines type */ - { - switch(c) - { - case 'd': - case 'i': -doIntegerPrint: - { - unsigned long v; - unsigned long p; /* biggest power of fmtBase */ - unsigned long vShrink; /* used to count digits */ - int sign; - int digitCount; - - /* Get the value */ - if(fmtLong) - { - if (fmtSigned) - { - v = va_arg(args,long); - } - else - { - v = va_arg(args,unsigned long); - } - } - else - { - if (fmtSigned) - { - v = va_arg(args,int); - } - else - { - v = va_arg(args,unsigned int); - } - } - - /* Strip sign */ - sign = 0; - /* (assumes sign bit is #31) */ - if( fmtSigned && (v & (0x80000000)) ) - { - v = ~v + 1; - sign = 1; - } - - /* Count digits, and get largest place value */ - vShrink = v; - p = 1; - digitCount = 1; - while( (vShrink = vShrink / fmtBase) > 0 ) - { - digitCount++; - p *= fmtBase; - } - - /* Print leading characters & sign */ - fmtBeforeDecimal -= digitCount; - if(fmtLeadingZero) - { - if(sign) - { - alt_log_txchar('-',(char*)base); - fmtBeforeDecimal--; - } - alt_log_repchar('0',fmtBeforeDecimal,base); - } - else - { - if(sign) - { - fmtBeforeDecimal--; - } - alt_log_repchar(' ',fmtBeforeDecimal,base); - if(sign) - { - alt_log_txchar('-',(char*)base); - } - } - - /* Print numbery parts */ - while(p) - { - unsigned char d; - - d = v / p; - d += '0'; - if(d > '9') - { - d += (fmtCase ? 'A' : 'a') - '0' - 10; - } - alt_log_txchar(d,(char*)base); - - v = v % p; - p = p / fmtBase; - } - } - - state = pfState_chars; - break; - - case 'u': - fmtSigned = 0; - goto doIntegerPrint; - case 'o': - fmtSigned = 0; - fmtBase = 8; - goto doIntegerPrint; - case 'x': - fmtSigned = 0; - fmtBase = 16; - goto doIntegerPrint; - case 'X': - fmtSigned = 0; - fmtBase = 16; - fmtCase = 1; - goto doIntegerPrint; - - case 'c': - alt_log_repchar(' ',fmtBeforeDecimal-1,base); - alt_log_txchar(va_arg(args,int),(char*)base); - break; - - case 's': - { - char *s; - - s = va_arg(args,char *); - alt_log_repchar(' ',fmtBeforeDecimal-strlen(s),base); - - while(*s) - alt_log_txchar(*s++,(char*)base); - } - break; - } /* switch last letter of fmt */ - state=pfState_chars; - } - break; - } /* switch */ - } /* while chars left */ - } /* printf */ - -/* Main logging printf function */ -int alt_log_printf_proc(const char *fmt, ... ) -{ - va_list args; - - va_start (args, fmt); - alt_log_private_printf(fmt,ALT_LOG_PORT_BASE,args); - return (0); -} - -/* Below are the functions called by different macros in various components. */ - -/* If the system has a JTAG_UART, include JTAG_UART debugging functions */ -#ifdef __ALTERA_AVALON_JTAG_UART - -/* The alarm function in altera_avalon_jtag_uart.c. - * This function, when turned on, prints out the status - * of the JTAG UART Control register, every ALT_LOG_JTAG_UART_TICKS. - * If the flag is off, the alarm should never be registered, and this - * function should never run */ -alt_u32 altera_avalon_jtag_uart_report_log(void * context) -{ - if (alt_log_jtag_uart_alarm_on_flag) { - altera_avalon_jtag_uart_state* dev = (altera_avalon_jtag_uart_state*) context; - const char* header="JTAG Alarm:"; - alt_log_jtag_uart_print_control_reg(dev, dev->base, header); - return ALT_LOG_JTAG_UART_TICKS; - } - else - { - /* If flag is not on, return 0 to disable future alarms. - * Should never be here, alarm should not be enabled at all. */ - return 0; - } -} - -void alt_log_jtag_uart_print_control_reg(altera_avalon_jtag_uart_state* dev, int base, const char* header) -{ - unsigned int control, space, ac, wi, ri, we, re; - control = IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base); - space = (control & ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_MSK) >> - ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_OFST; - we= (control & ALTERA_AVALON_JTAG_UART_CONTROL_WE_MSK) >> - ALTERA_AVALON_JTAG_UART_CONTROL_WE_OFST; - re= (control & ALTERA_AVALON_JTAG_UART_CONTROL_RE_MSK) >> - ALTERA_AVALON_JTAG_UART_CONTROL_RE_OFST; - ri= (control & ALTERA_AVALON_JTAG_UART_CONTROL_RI_MSK) >> - ALTERA_AVALON_JTAG_UART_CONTROL_RI_OFST; - wi= (control & ALTERA_AVALON_JTAG_UART_CONTROL_WI_MSK) >> - ALTERA_AVALON_JTAG_UART_CONTROL_WI_OFST; - ac= (control & ALTERA_AVALON_JTAG_UART_CONTROL_AC_MSK) >> - ALTERA_AVALON_JTAG_UART_CONTROL_AC_OFST; - -#ifdef ALTERA_AVALON_JTAG_UART_SMALL - ALT_LOG_PRINTF( - "%s HW FIFO wspace=%d AC=%d WI=%d RI=%d WE=%d RE=%d\r\n", - header,space,ac,wi,ri,we,re); -#else - ALT_LOG_PRINTF( - "%s SW CirBuf = %d, HW FIFO wspace=%d AC=%d WI=%d RI=%d WE=%d RE=%d\r\n", - header,(dev->tx_out-dev->tx_in),space,ac,wi,ri,we,re); -#endif - - return; - -} - -/* In altera_avalon_jtag_uart.c - * Same output as the alarm function above, but this is called in the driver - * init function. Hence, it gives the status of the JTAG UART control register - * right at the initialization of the driver */ -void alt_log_jtag_uart_startup_info(altera_avalon_jtag_uart_state* dev, int base) -{ - const char* header="JTAG Startup Info:"; - alt_log_jtag_uart_print_control_reg(dev, base, header); - return; -} - -/* In altera_avalon_jtag_uart.c - * When turned on, this function will print out the status of the jtag uart - * control register every time there is a jtag uart "almost-empty" interrupt. */ -void alt_log_jtag_uart_isr_proc(int base, altera_avalon_jtag_uart_state* dev) -{ - if (alt_log_jtag_uart_isr_on_flag) { - const char* header="JTAG IRQ:"; - alt_log_jtag_uart_print_control_reg(dev, base, header); - } - return; -} - -#endif /* __ALTERA_AVALON_JTAG_UART */ - -/* In alt_write.c - * When the alt_log_write_on_flag is turned on, this function gets called - * every time alt_write gets called. The first - * ALT_LOG_WRITE_ECHO_LEN characters of every printf command (or any command - * that eventually calls write()) gets echoed to the alt_log output. */ -void alt_log_write(const void *ptr, size_t len) -{ - if (alt_log_write_on_flag) { - int temp_cnt; - int length=(ALT_LOG_WRITE_ECHO_LEN>len) ? len : ALT_LOG_WRITE_ECHO_LEN; - - if (length < 2) return; - - strncpy (alt_log_write_buf,ptr,length); - alt_log_write_buf[length-1]='\n'; - alt_log_write_buf[length]='\r'; - alt_log_write_buf[length+1]='\0'; - - /* Escape Ctrl-D's. If the Ctrl-D gets sent it might kill the terminal - * connection of alt_log. It will get replaced by 'D'. */ - for (temp_cnt=0;temp_cnt < length; temp_cnt++) { - if (alt_log_write_buf[temp_cnt]== 0x4) { - alt_log_write_buf[temp_cnt]='D'; - } - } - ALT_LOG_PRINTF("Write Echo: %s",alt_log_write_buf); - } -} - -/* In altera_avalon_timer_sc - * This function prints out a system clock is alive message - * every ALT_LOG_SYS_CLK_INTERVAL (in ticks). */ -void alt_log_system_clock() -{ - if (alt_log_sys_clk_on_flag) { - alt_log_sys_clk_count++; - if (alt_log_sys_clk_count > ALT_LOG_SYS_CLK_INTERVAL) { - alt_log_sys_clk_count = 0; - ALT_LOG_PRINTF("System Clock On %u\r\n",alt_system_clock_in_sec++); - } - } -} - - -#endif diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_lseek.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_lseek.c deleted file mode 100644 index 7857b0d..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_lseek.c +++ /dev/null @@ -1,117 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -#ifdef ALT_USE_DIRECT_DRIVERS - -off_t ALT_LSEEK (int file, off_t ptr, int dir) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(lseek); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -/* - * lseek() can be called to move the read/write pointer associated with the - * file descriptor "file". This function simply vectors the call to the lseek() - * function provided by the driver associated with the file descriptor. - * - * If the driver does not provide an implementation of lseek() an error is - * indicated. - * - * lseek() corresponds to the standard lseek() function. - * - * ALT_LSEEK is mapped onto the lseek() system call in alt_syscall.h - * - */ - -off_t ALT_LSEEK (int file, off_t ptr, int dir) -{ - alt_fd* fd; - off_t rc = 0; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - /* - * If the device driver provides an implementation of the lseek() function, - * then call that to process the request. - */ - - if (fd->dev->lseek) - { - rc = fd->dev->lseek(fd, ptr, dir); - } - /* - * Otherwise return an error. - */ - - else - { - rc = -ENOTSUP; - } - } - else - { - rc = -EBADFD; - } - - if (rc < 0) - { - ALT_ERRNO = -rc; - rc = -1; - } - - return rc; -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_main.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_main.c deleted file mode 100644 index a96229b..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_main.c +++ /dev/null @@ -1,161 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include -#include -#include -#include - -#include "sys/alt_dev.h" -#include "sys/alt_sys_init.h" -#include "sys/alt_irq.h" -#include "sys/alt_dev.h" - -#include "os/alt_hooks.h" - -#include "priv/alt_file.h" -#include "alt_types.h" - -#include "system.h" - -#include "sys/alt_log_printf.h" - -extern void _do_ctors(void); -extern void _do_dtors(void); - -/* - * Standard arguments for main. By default, no arguments are passed to main. - * However a device driver may choose to configure these arguments by calling - * alt_set_args(). The expectation is that this facility will only be used by - * the iclient/ihost utility. - */ - -int alt_argc = 0; -char** alt_argv = {NULL}; -char** alt_envp = {NULL}; - -/* - * Prototype for the entry point to the users application. - */ - -extern int main (int, char **, char **); - -/* - * alt_main is the C entry point for the HAL. It is called by the assembler - * startup code in the processor specific crt0.S. It is responsible for: - * completing the C runtime configuration; configuring all the - * devices/filesystems/components in the system; and call the entry point for - * the users application, i.e. main(). - */ - -void alt_main (void) -{ -#ifndef ALT_NO_EXIT - int result; -#endif - - /* ALT LOG - please see HAL/sys/alt_log_printf.h for details */ - ALT_LOG_PRINT_BOOT("[alt_main.c] Entering alt_main, calling alt_irq_init.\r\n"); - /* Initialize the interrupt controller. */ - alt_irq_init (NULL); - - /* Initialize the operating system */ - ALT_LOG_PRINT_BOOT("[alt_main.c] Done alt_irq_init, calling alt_os_init.\r\n"); - ALT_OS_INIT(); - - /* - * Initialize the semaphore used to control access to the file descriptor - * list. - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Done OS Init, calling alt_sem_create.\r\n"); - ALT_SEM_CREATE (&alt_fd_list_lock, 1); - - /* Initialize the device drivers/software components. */ - ALT_LOG_PRINT_BOOT("[alt_main.c] Calling alt_sys_init.\r\n"); - alt_sys_init(); - ALT_LOG_PRINT_BOOT("[alt_main.c] Done alt_sys_init.\r\n"); - -#if !defined(ALT_USE_DIRECT_DRIVERS) && (defined(ALT_STDIN_PRESENT) || defined(ALT_STDOUT_PRESENT) || defined(ALT_STDERR_PRESENT)) - - /* - * Redirect stdio to the apropriate devices now that the devices have - * been initialized. This is only done if the user has requested these - * devices be present (not equal to /dev/null) and if direct drivers - * aren't being used. - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Redirecting IO.\r\n"); - alt_io_redirect(ALT_STDOUT, ALT_STDIN, ALT_STDERR); -#endif - -#ifndef ALT_NO_C_PLUS_PLUS - /* - * Call the C++ constructors - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Calling C++ constructors.\r\n"); - _do_ctors (); -#endif /* ALT_NO_C_PLUS_PLUS */ - -#if !defined(ALT_NO_C_PLUS_PLUS) && !defined(ALT_NO_CLEAN_EXIT) && !defined(ALT_NO_EXIT) - /* - * Set the C++ destructors to be called at system shutdown. This is only done - * if a clean exit has been requested (i.e. the exit() function has not been - * redefined as _exit()). This is in the interest of reducing code footprint, - * in that the atexit() overhead is removed when it's not needed. - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Calling atexit.\r\n"); - atexit (_do_dtors); -#endif - - /* - * Finally, call main(). The return code is then passed to a subsequent - * call to exit() unless the application is never supposed to exit. - */ - - ALT_LOG_PRINT_BOOT("[alt_main.c] Calling main.\r\n"); - -#ifdef ALT_NO_EXIT - main (alt_argc, alt_argv, alt_envp); -#else - result = main (alt_argc, alt_argv, alt_envp); - close(STDOUT_FILENO); - exit (result); -#endif - - ALT_LOG_PRINT_BOOT("[alt_main.c] After main - we should not be here?.\r\n"); -} - diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_malloc_lock.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_malloc_lock.c deleted file mode 100644 index 8c78f46..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_malloc_lock.c +++ /dev/null @@ -1,52 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -/* - * These are the empty malloc lock/unlock stubs required by newlib. These are - * used to make newlib's malloc() function thread safe. The default HAL - * configuration is single threaded, so there is nothing to do here. Note that - * this requires that malloc is never called by an interrupt service routine. - */ - -void __malloc_lock ( struct _reent *_r ) -{ -} - -/* - * - */ - -void __malloc_unlock ( struct _reent *_r ) -{ -} diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_mcount.S b/software/qsys_tutorial_test_bsp/HAL/src/alt_mcount.S deleted file mode 100644 index 3837523..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_mcount.S +++ /dev/null @@ -1,198 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2010 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -/* mcount or _mcount is inserted by GCC before the function prologue of every - * function when a program is compiled for profiling. At the start of mcount, - * we guarantee that: - * ra = self_pc (an address in the function which called mcount) - * r8 = from_pc (an address in the function which called mcount's caller) - * - * Because this is always called at the start of a function we can corrupt - * r2,r3 and r11-r15. We must not corrupt r4-r7 (because they might contain - * function arguments for the instrumented function) or r8 (which holds ra - * for the instrumented function). - */ - - .global __mcount_fn_head - - .global mcount - - /* _mcount is used by gcc4 */ - .global _mcount - -_mcount: -mcount: - /* Use a hash to speed up locating fn_entry. We use bits 5 upwards to choose - * the bucket because bits 1:0 will always be 0, and because the distribution - * of values for bits 4:2 won't be even (aligning on cache line boundaries - * will skew it). Higher bits should be fairly random. - */ - /* fn_head = mcount_fn_head + (((unsigned int)self_pc >> 5) & (HASH_BUCKETS - 1)); */ - - srli r2, ra, 3 - movhi r3, %hiadj(__mcount_fn_head) - addi r3, r3, %lo(__mcount_fn_head) - andi r2, r2, 0xFC - add r11, r2, r3 - - /* The fast case is where we have already allocated a function arc, and so - * also a function pointer. - */ - - /* First find the function being called (using self_pc) */ - mov r10, r11 -0: - ldw r10, 0(r10) - beq r10, zero, .Lnew_arc - ldw r2, 4(r10) - bne r2, ra, 0b - - /* Found a function entry for this PC. Now look for an arc with a matching - * from_pc value. There will always be at least one arc. */ - ldw r3, 8(r10) -0: - ldw r2, 4(r3) - beq r2, r8, .Lfound_arc - ldw r3, 0(r3) - bne r3, zero, 0b - -.Lnew_arc: - addi sp, sp, -24 - -.LCFI0: - stw ra, 0(sp) - stw r4, 4(sp) - stw r5, 8(sp) - stw r6, 12(sp) - stw r7, 16(sp) - stw r8, 20(sp) - -.LCFI1: - /* __mcount_record(orig_ra, orig_r8, fn_entry, *fn_head); */ - mov r4, ra - mov r5, r8 - mov r6, r10 - mov r7, r11 - call __mcount_record - - /* restore registers from the stack */ - ldw ra, 0(sp) - ldw r4, 4(sp) - ldw r5, 8(sp) - ldw r6, 12(sp) - ldw r7, 16(sp) - ldw r8, 20(sp) - - addi sp, sp, 24 - -.LCFI2: - ret - -.Lfound_arc: - /* We've found the correct arc record. Increment the count and return */ - ldw r2, 8(r3) - addi r2, r2, 1 - stw r2, 8(r3) - ret - -.Lmcount_end: - - - -/* - * Dwarf2 debug information for the function. This provides GDB with the - * information it needs to backtrace out of this function. - */ - - .section .debug_frame,"",@progbits -.LCIE: - .4byte 2f - 1f /* Length */ -1: - .4byte 0xffffffff /* CIE id */ - .byte 0x1 /* Version */ - .string "" /* Augmentation */ - .uleb128 0x1 /* Code alignment factor */ - .sleb128 -4 /* Data alignment factor */ - .byte 0x1f /* Return address register */ - - .byte 0xc /* Define CFA */ - .uleb128 0x1b /* Register 27 (sp) */ - .uleb128 0x0 /* Offset 0 */ - - .align 2 /* Padding */ -2: - -.LFDE_mcount: - .4byte 2f - 1f /* Length */ -1: - .4byte .LCIE /* Pointer to CIE */ - .4byte mcount /* Start of table entry */ - .4byte .Lmcount_end - mcount /* Size of table entry */ - - .byte 0x4 /* Advance location */ - .4byte .LCFI0 - mcount /* to .LCFI0 */ - .byte 0xe /* Define CFA offset */ - .uleb128 24 /* to 24 */ - - .byte 0x4 /* Advance location */ - .4byte .LCFI1 - .LCFI0 /* to .LCFI1 */ - .byte 0x9f /* Store ra */ - .uleb128 0x6 /* at CFA-24 */ - .byte 0x84 /* Store r4 */ - .uleb128 0x5 /* at CFA-20 */ - .byte 0x85 /* Store r5 */ - .uleb128 0x4 /* at CFA-16 */ - .byte 0x86 /* Store r6 */ - .uleb128 0x3 /* at CFA-12 */ - .byte 0x87 /* Store r7 */ - .uleb128 0x2 /* at CFA-8 */ - .byte 0x88 /* Store r8 */ - .uleb128 0x1 /* at CFA-4 */ - - .byte 0x4 /* Advance location */ - .4byte .LCFI2 - .LCFI1 /* to .LCFI2 */ - .byte 0xe /* Define CFA offset */ - .uleb128 0 /* to 0 */ - .byte 0x8 /* Same value */ - .uleb128 31 /* for ra */ - .byte 0x8 /* Same value */ - .uleb128 4 /* for r4 */ - .byte 0x8 /* Same value */ - .uleb128 5 /* for r5 */ - .byte 0x8 /* Same value */ - .uleb128 6 /* for r6 */ - .byte 0x8 /* Same value */ - .uleb128 7 /* for r7 */ - .byte 0x8 /* Same value */ - .uleb128 8 /* for r8 */ - - .align 2 -2: - diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_open.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_open.c deleted file mode 100644 index 4790f53..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_open.c +++ /dev/null @@ -1,173 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "alt_types.h" -#include "os/alt_syscall.h" - -#ifdef ALT_USE_DIRECT_DRIVERS - -int ALT_OPEN (const char* file, int flags, int mode) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(open); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -extern alt_llist alt_dev_list; - -/* - * alt_file_locked() is used by open() to ensure that a device has not been - * previously locked for exclusive access using ioctl(). This test is only - * performed for devices. Filesystems are required to handle the ioctl() call - * themselves, and report the error from the filesystems open() function. - */ - -static int alt_file_locked (alt_fd* fd) -{ - alt_u32 i; - - /* - * Mark the file descriptor as belonging to a device. - */ - - fd->fd_flags |= ALT_FD_DEV; - - /* - * Loop through all current file descriptors searching for one that's locked - * for exclusive access. If a match is found, generate an error. - */ - - for (i = 0; i <= alt_max_fd; i++) - { - if ((alt_fd_list[i].dev == fd->dev) && - (alt_fd_list[i].fd_flags & ALT_FD_EXCL) && - (&alt_fd_list[i] != fd)) - { - return -EACCES; - } - } - - /* The device is not locked */ - - return 0; -} - -/* - * open() is called in order to get a file descriptor that reference the file - * or device named "name". This descriptor can then be used to manipulate the - * file/device using the standard system calls, e.g. write(), read(), ioctl() - * etc. - * - * This is equivalent to the standard open() system call. - * - * ALT_OPEN is mapped onto the open() system call in alt_syscall.h - */ - -int ALT_OPEN (const char* file, int flags, int mode) -{ - alt_dev* dev; - alt_fd* fd; - int index = -1; - int status = -ENODEV; - int isafs = 0; - - /* - * Check the device list, to see if a device with a matching name is - * registered. - */ - - if (!(dev = alt_find_dev (file, &alt_dev_list))) - { - /* No matching device, so try the filesystem list */ - - dev = alt_find_file (file); - isafs = 1; - } - - /* - * If a matching device or filesystem is found, allocate a file descriptor. - */ - - if (dev) - { - if ((index = alt_get_fd (dev)) < 0) - { - status = index; - } - else - { - fd = &alt_fd_list[index]; - fd->fd_flags = (flags & ~ALT_FD_FLAGS_MASK); - - /* If this is a device, ensure it isn't already locked */ - - if (isafs || ((status = alt_file_locked (fd)) >= 0)) - { - /* - * If the device or filesystem provides an open() callback function, - * call it now to perform any device/filesystem specific operations. - */ - - status = (dev->open) ? dev->open(fd, file, flags, mode): 0; - } - } - } - else - { - status = -ENODEV; - } - - /* Allocation failed, so clean up and return an error */ - - if (status < 0) - { - alt_release_fd (index); - ALT_ERRNO = -status; - return -1; - } - - /* return the reference upon success */ - - return index; -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_printf.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_printf.c deleted file mode 100644 index e742b57..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_printf.c +++ /dev/null @@ -1,127 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -/* - * This file provides a very minimal printf implementation for use with very - * small applications. Only the following format strings are supported: - * %x - * %s - * %c - * %% - */ - -#include -#include "sys/alt_stdio.h" - -/* - * ALT printf function - */ -void -alt_printf(const char* fmt, ... ) -{ - va_list args; - va_start(args, fmt); - const char *w; - char c; - - /* Process format string. */ - w = fmt; - while ((c = *w++) != 0) - { - /* If not a format escape character, just print */ - /* character. Otherwise, process format string. */ - if (c != '%') - { - alt_putchar(c); - } - else - { - /* Get format character. If none */ - /* available, processing is complete. */ - if ((c = *w++) != 0) - { - if (c == '%') - { - /* Process "%" escape sequence. */ - alt_putchar(c); - } - else if (c == 'c') - { - int v = va_arg(args, int); - alt_putchar(v); - } - else if (c == 'x') - { - /* Process hexadecimal number format. */ - unsigned long v = va_arg(args, unsigned long); - unsigned long digit; - int digit_shift; - - /* If the number value is zero, just print and continue. */ - if (v == 0) - { - alt_putchar('0'); - continue; - } - - /* Find first non-zero digit. */ - digit_shift = 28; - while (!(v & (0xF << digit_shift))) - digit_shift -= 4; - - /* Print digits. */ - for (; digit_shift >= 0; digit_shift -= 4) - { - digit = (v & (0xF << digit_shift)) >> digit_shift; - if (digit <= 9) - c = '0' + digit; - else - c = 'a' + digit - 10; - alt_putchar(c); - } - } - else if (c == 's') - { - /* Process string format. */ - char *s = va_arg(args, char *); - - while(*s) - alt_putchar(*s++); - } - } - else - { - break; - } - } - } -} diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_putchar.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_putchar.c deleted file mode 100644 index badaa02..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_putchar.c +++ /dev/null @@ -1,59 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#ifdef ALT_USE_DIRECT_DRIVERS -#include "system.h" -#include "sys/alt_driver.h" -#include "sys/alt_stdio.h" -#endif - -/* - * Uses the ALT_DRIVER_WRITE() macro to call directly to driver if available. - * Otherwise, uses newlib provided putchar() routine. - */ -int -alt_putchar(int c) -{ -#ifdef ALT_USE_DIRECT_DRIVERS - ALT_DRIVER_WRITE_EXTERNS(ALT_STDOUT_DEV); - char c1 = (char)(c & 0xff); - - if (ALT_DRIVER_WRITE(ALT_STDOUT_DEV, &c1, 1, 0) == -1) { - return -1; - } - return c; -#else - return putchar(c); -#endif -} diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_putstr.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_putstr.c deleted file mode 100644 index 5345945..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_putstr.c +++ /dev/null @@ -1,55 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#ifdef ALT_USE_DIRECT_DRIVERS -#include -#include "system.h" -#include "sys/alt_driver.h" -#include "sys/alt_stdio.h" -#endif - -/* - * Uses the ALT_DRIVER_WRITE() macro to call directly to driver if available. - * Otherwise, uses newlib provided fputs() routine. - */ -int -alt_putstr(const char* str) -{ -#ifdef ALT_USE_DIRECT_DRIVERS - ALT_DRIVER_WRITE_EXTERNS(ALT_STDOUT_DEV); - return ALT_DRIVER_WRITE(ALT_STDOUT_DEV, str, strlen(str), 0); -#else - return fputs(str, stdout); -#endif -} diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_read.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_read.c deleted file mode 100644 index 1c89777..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_read.c +++ /dev/null @@ -1,125 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -/* - * The read() system call is used to read a block of data from a file or device. - * This function simply vectors the request to the device driver associated - * with the input file descriptor "file". - * - * ALT_READ is mapped onto the read() system call in alt_syscall.h - */ - -#ifdef ALT_USE_DIRECT_DRIVERS - -#include "system.h" -#include "sys/alt_driver.h" - -/* - * Provide minimal version that just reads from the stdin device when provided. - */ - -int ALT_READ (int file, void *ptr, size_t len) -{ -#ifdef ALT_STDIN_PRESENT - ALT_DRIVER_READ_EXTERNS(ALT_STDIN_DEV); -#endif - -#if !defined(ALT_STDIN_PRESENT) - /* Generate a link time warning, should this function ever be called. */ - ALT_STUB_WARNING(read); -#endif - - switch (file) { -#ifdef ALT_STDIN_PRESENT - case 0: /* stdin file descriptor */ - return ALT_DRIVER_READ(ALT_STDIN_DEV, ptr, len, 0); -#endif /* ALT_STDIN_PRESENT */ - default: - ALT_ERRNO = EBADFD; - return -1; - } -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -int ALT_READ (int file, void *ptr, size_t len) -{ - alt_fd* fd; - int rval; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - /* - * If the file has not been opened with read access, or if the driver does - * not provide an implementation of read(), generate an error. Otherwise - * call the drivers read() function to process the request. - */ - - if (((fd->fd_flags & O_ACCMODE) != O_WRONLY) && - (fd->dev->read)) - { - if ((rval = fd->dev->read(fd, ptr, len)) < 0) - { - ALT_ERRNO = -rval; - return -1; - } - return rval; - } - else - { - ALT_ERRNO = EACCES; - } - } - else - { - ALT_ERRNO = EBADFD; - } - return -1; -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_release_fd.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_release_fd.c deleted file mode 100644 index 84733a7..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_release_fd.c +++ /dev/null @@ -1,54 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_dev.h" -#include "priv/alt_file.h" - -/* - * alt_release_fd() is called to free an allocated file descriptor. This is - * done by setting the device pointer in the file descriptor structure to zero. - * - * File descriptors correcponding to standard in, standard out and standard - * error cannont be released backed to the pool. They are always reserved. - */ - -void alt_release_fd (int fd) -{ - if (fd > 2) - { - alt_fd_list[fd].fd_flags = 0; - alt_fd_list[fd].dev = 0; - } -} - - - diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_remap_cached.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_remap_cached.c deleted file mode 100644 index f61cb9c..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_remap_cached.c +++ /dev/null @@ -1,50 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003,2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "sys/alt_cache.h" -#include "system.h" - -#ifdef NIOS2_MMU_PRESENT -/* Convert KERNEL region address to IO region address */ -#define BYPASS_DCACHE_MASK (0x1 << 29) -#else -/* Set bit 31 of address to bypass D-cache */ -#define BYPASS_DCACHE_MASK (0x1 << 31) -#endif - -/* - * Convert a pointer to a block of uncached memory, into a block of - * cached memory. - */ - -void* alt_remap_cached (volatile void* ptr, alt_u32 len) -{ - return (void*) (((alt_u32) ptr) & ~BYPASS_DCACHE_MASK); -} diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_remap_uncached.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_remap_uncached.c deleted file mode 100644 index 7ff6302..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_remap_uncached.c +++ /dev/null @@ -1,51 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003,2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "sys/alt_cache.h" -#include "system.h" - -#ifdef NIOS2_MMU_PRESENT -/* Convert KERNEL region address to IO region address */ -#define BYPASS_DCACHE_MASK (0x1 << 29) -#else -/* Set bit 31 of address to bypass D-cache */ -#define BYPASS_DCACHE_MASK (0x1 << 31) -#endif - -/* - * Convert a pointer to a block of cached memory, into a block of - * uncached memory. - */ - -volatile void* alt_remap_uncached (void* ptr, alt_u32 len) -{ - alt_dcache_flush (ptr, len); - return (volatile void*) (((alt_u32) ptr) | BYPASS_DCACHE_MASK); -} diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_rename.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_rename.c deleted file mode 100644 index 48afac0..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_rename.c +++ /dev/null @@ -1,55 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "os/alt_syscall.h" - -/* - * _rename() is used by newlib to rename an existing file. This is unsupported - * in the HAL environment. However a "do-nothing" implementation is still - * provied for newlib compatability. - * - * ALT_RENAME is mapped onto the _rename() system call in alt_syscall.h - */ - -int ALT_RENAME (char *existing, char *new) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(_rename); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_sbrk.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_sbrk.c deleted file mode 100644 index b8c3799..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_sbrk.c +++ /dev/null @@ -1,136 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "os/alt_syscall.h" - -#include "sys/alt_irq.h" -#include "sys/alt_stack.h" - -#include "system.h" - -/* - * sbrk() is called to dynamically extend the data segment for the application. - * Thie input argument "incr" is the size of the block to allocate. - * - * This simple implementation does not perform any bounds checking. Memory will - * be allocated, even if the request region colides with the stack or overflows - * the available physical memory. - * - * ALT_SBRK is mapped onto the sbrk() system call in alt_syscall.h - * - * This function is called by the profiling code to allocate memory so must be - * safe if called from an interrupt context. It must also not be instrumented - * because that would lead to an infinate loop. - */ - -extern char __alt_heap_start[]; /* set by linker */ -extern char __alt_heap_limit[]; /* set by linker */ - -static char *heap_end = __alt_heap_start; - -#if defined(ALT_EXCEPTION_STACK) && defined(ALT_STACK_CHECK) -char * alt_exception_old_stack_limit = NULL; -#endif - -caddr_t ALT_SBRK (int incr) __attribute__ ((no_instrument_function )); - -caddr_t ALT_SBRK (int incr) -{ - alt_irq_context context; - char *prev_heap_end; - - context = alt_irq_disable_all(); - - /* Always return data aligned on a word boundary */ - heap_end = (char *)(((unsigned int)heap_end + 3) & ~3); - -#ifdef ALT_MAX_HEAP_BYTES - /* - * User specified a maximum heap size. Return -1 if it would - * be exceeded by this sbrk call. - */ - if (((heap_end + incr) - __alt_heap_start) > ALT_MAX_HEAP_BYTES) { - alt_irq_enable_all(context); - return (caddr_t)-1; - } -#else - if ((heap_end + incr) > __alt_heap_limit) { - alt_irq_enable_all(context); - return (caddr_t)-1; - } -#endif - - prev_heap_end = heap_end; - heap_end += incr; - -#ifdef ALT_STACK_CHECK - /* - * If the stack and heap are contiguous then extending the heap reduces the - * space available for the stack. If we are still using the default stack - * then adjust the stack limit to note this, while checking for stack - * pointer overflow. - * If the stack limit isn't pointing at the top of the heap then the code - * is using a different stack so none of this needs to be done. - */ - - if (alt_stack_limit() == prev_heap_end) - { - if (alt_stack_pointer() <= heap_end) - alt_report_stack_overflow(); - - alt_set_stack_limit(heap_end); - } - -#ifdef ALT_EXCEPTION_STACK - /* - * If we are executing from the exception stack then compare against the - * stack we switched away from as well. The exception stack is a fixed - * size so doesn't need to be checked. - */ - - if (alt_exception_old_stack_limit == prev_heap_end) - { - if (alt_exception_old_stack_limit <= heap_end) - alt_report_stack_overflow(); - - alt_exception_old_stack_limit = heap_end; - } -#endif - -#endif - - alt_irq_enable_all(context); - - return (caddr_t) prev_heap_end; -} diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_settod.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_settod.c deleted file mode 100644 index 59db0f8..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_settod.c +++ /dev/null @@ -1,96 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include "sys/alt_errno.h" -#include "sys/alt_alarm.h" -#include "os/alt_syscall.h" - -/* - * "alt_timezone" and "alt_resettime" are the values of the the reset time and - * time zone set through the last call to settimeofday(). By default they are - * zero initialised. - */ - -extern struct timezone alt_timezone; -extern struct timeval alt_resettime; - -/* - * Macro defining the number of micoseconds in a second. - */ - -#define ALT_US (1000000) - - -/* - * settimeofday() can be called to calibrate the system clock, so that - * subsequent calls to gettimeofday() will return the elapsed "wall clock" - * time. - * - * This is done by updating the global structures "alt_resettime" and - * "alt_timezone" so that an immediate call to gettimeofday() would return - * the value specified by "t" and "tz". - * - * Warning: if this function is called concurrently with a call to - * gettimeofday(), the value returned by gettimeofday() will be unreliable. - * - * ALT_SETTIMEOFDAY is mapped onto the settimeofday() system call in - * alt_syscall.h - */ - -int ALT_SETTIMEOFDAY (const struct timeval *t, - const struct timezone *tz) -{ - alt_u32 nticks = alt_nticks (); - alt_u32 tick_rate = alt_ticks_per_second (); - - /* If there is a system clock available, update the current time */ - - if (tick_rate) - { - alt_resettime.tv_sec = t->tv_sec - nticks/tick_rate; - alt_resettime.tv_usec = t->tv_usec - - ((nticks*(ALT_US/tick_rate))%ALT_US); - - alt_timezone.tz_minuteswest = tz->tz_minuteswest; - alt_timezone.tz_dsttime = tz->tz_dsttime; - - return 0; - } - - /* There's no system clock available */ - - ALT_ERRNO = ENOSYS; - return -1; -} diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_software_exception.S b/software/qsys_tutorial_test_bsp/HAL/src/alt_software_exception.S deleted file mode 100644 index 2142594..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_software_exception.S +++ /dev/null @@ -1,53 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003-2005 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - - /* - * This file provides the global symbol: software_exception. It is provided to - * support legacy code, and should not be used by new software. - * - * It is used by legacy code to invoke the software exception handler as - * defined by version 1.0 of the Nios II kit. It should only be used when you - * are providing your own interrupt entry point, i.e. you are not using - * alt_irq_entry. - */ - -#include "system.h" - - /* - * Pull in the exception handler. - */ - - .globl alt_exception - - .section .exceptions.entry.label, "xa" - - .globl software_exception - .type software_exception, @function -software_exception: diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_stat.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_stat.c deleted file mode 100644 index 44e207b..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_stat.c +++ /dev/null @@ -1,59 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include -#include -#include - -#include "os/alt_syscall.h" - -/* - * The stat() function is similar to the fstat() function in that it is used to - * obtain status information about a file. Instead of using an open file - * descriptor (like fstat()), stat() takes the name of a file as an input - * argument. - * - * ALT_STAT is mapped onto the stat() system call in alt_syscall.h - */ - -int ALT_STAT (const char *file, struct stat *st) -{ - int fd; - int rc; - - fd = open (file, 0); - rc = fstat (fd, st); - close (fd); - - return rc; -} diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_tick.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_tick.c deleted file mode 100644 index c73488d..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_tick.c +++ /dev/null @@ -1,149 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_irq.h" -#include "sys/alt_alarm.h" -#include "os/alt_hooks.h" -#include "alt_types.h" - -/* - * "_alt_tick_rate" is used to store the value of the system clock frequency - * in ticks per second. It is initialised to zero, which corresponds to there - * being no system clock facility available. - */ - -alt_u32 _alt_tick_rate = 0; - -/* - * "_alt_nticks" is the number of system clock ticks that have elapsed since - * reset. - */ - -volatile alt_u32 _alt_nticks = 0; - -/* - * "alt_alarm_list" is the head of a linked list of registered alarms. This is - * initialised to be an empty list. - */ - -ALT_LLIST_HEAD(alt_alarm_list); - -/* - * alt_alarm_stop() is called to remove an alarm from the list of registered - * alarms. Alternatively an alarm can unregister itself by returning zero when - * the alarm executes. - */ - -void alt_alarm_stop (alt_alarm* alarm) -{ - alt_irq_context irq_context; - - irq_context = alt_irq_disable_all(); - alt_llist_remove (&alarm->llist); - alt_irq_enable_all (irq_context); -} - -/* - * alt_tick() is periodically called by the system clock driver in order to - * process the registered list of alarms. Each alarm is registed with a - * callback interval, and a callback function, "callback". - * - * The return value of the callback function indicates how many ticks are to - * elapse until the next callback. A return value of zero indicates that the - * alarm should be deactivated. - * - * alt_tick() is expected to run at interrupt level. - */ - -void alt_tick (void) -{ - alt_alarm* next; - alt_alarm* alarm = (alt_alarm*) alt_alarm_list.next; - - alt_u32 next_callback; - - /* update the tick counter */ - - _alt_nticks++; - - /* process the registered callbacks */ - - while (alarm != (alt_alarm*) &alt_alarm_list) - { - next = (alt_alarm*) alarm->llist.next; - - /* - * Upon the tick-counter rolling over it is safe to clear the - * roll-over flag; once the flag is cleared this (or subsequnt) - * tick events are enabled to generate an alarm event. - */ - if ((alarm->rollover) && (_alt_nticks == 0)) - { - alarm->rollover = 0; - } - - /* if the alarm period has expired, make the callback */ - if ((alarm->time <= _alt_nticks) && (alarm->rollover == 0)) - { - next_callback = alarm->callback (alarm->context); - - /* deactivate the alarm if the return value is zero */ - - if (next_callback == 0) - { - alt_alarm_stop (alarm); - } - else - { - alarm->time += next_callback; - - /* - * If the desired alarm time causes a roll-over, set the rollover - * flag. This will prevent the subsequent tick event from causing - * an alarm too early. - */ - if(alarm->time < _alt_nticks) - { - alarm->rollover = 1; - } - } - } - alarm = next; - } - - /* - * Update the operating system specific timer facilities. - */ - - ALT_OS_TIME_TICK(); -} - diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_times.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_times.c deleted file mode 100644 index 4dd965d..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_times.c +++ /dev/null @@ -1,71 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include - -#include "sys/alt_errno.h" -#include "sys/alt_alarm.h" -#include "os/alt_syscall.h" - -/* - * The times() function is used by newlib to obtain elapsed time information. - * The return value is the elapsed time since reset in system clock ticks. Note - * that this is distinct from the strict Posix version of times(), which should - * return the time since: 0 hours, 0 minutes, 0 seconds, January 1, 1970, GMT. - * - * The input structure is filled in with time accounting information. This - * implementation attributes all cpu time to the system. - * - * ALT_TIMES is mapped onto the times() system call in alt_syscall.h - */ - -clock_t ALT_TIMES (struct tms *buf) -{ - clock_t ticks = alt_nticks(); - - /* If there is no system clock present, generate an error */ - - if (!alt_ticks_per_second()) - { - ALT_ERRNO = ENOSYS; - return 0; - } - - /* Otherwise return the elapsed time */ - - buf->tms_utime = 0; - buf->tms_stime = ticks; - buf->tms_cutime = 0; - buf->tms_cstime = 0; - - return ticks; -} diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_uncached_free.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_uncached_free.c deleted file mode 100644 index 6e362ba..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_uncached_free.c +++ /dev/null @@ -1,49 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003,2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "sys/alt_cache.h" -#include "system.h" - -#ifdef NIOS2_MMU_PRESENT -/* Convert KERNEL region address to IO region address */ -#define BYPASS_DCACHE_MASK (0x1 << 29) -#else -/* Set bit 31 of address to bypass D-cache */ -#define BYPASS_DCACHE_MASK (0x1 << 31) -#endif - -/* - * Free a block of uncached memory. - */ - -void alt_uncached_free (volatile void* ptr) -{ - free ((void*) (((alt_u32) ptr) & ~BYPASS_DCACHE_MASK)); -} diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_uncached_malloc.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_uncached_malloc.c deleted file mode 100644 index ab3416d..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_uncached_malloc.c +++ /dev/null @@ -1,55 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003,2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "sys/alt_cache.h" -#include "system.h" - -#ifdef NIOS2_MMU_PRESENT -/* Convert KERNEL region address to IO region address */ -#define BYPASS_DCACHE_MASK (0x1 << 29) -#else -/* Set bit 31 of address to bypass D-cache */ -#define BYPASS_DCACHE_MASK (0x1 << 31) -#endif - -/* - * Allocate a block of uncached memory. - */ - -volatile void* alt_uncached_malloc (size_t size) -{ - void* ptr; - - ptr = malloc (size); - - alt_dcache_flush (ptr, size); - - return ptr ? (volatile void*) (((alt_u32) ptr) | BYPASS_DCACHE_MASK) : NULL; -} diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_unlink.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_unlink.c deleted file mode 100644 index 29e35d6..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_unlink.c +++ /dev/null @@ -1,55 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "os/alt_syscall.h" - -/* - * unlink() is used by newlib to delete an existing link to a file. This is - * unsupported in the HAL environment. However a "do-nothing" implementation - * is still provied for newlib compatability. - * - * ALT_UNLINK is mapped onto the unlink() system call in alt_syscall.h - */ - -int ALT_UNLINK (char *name) -{ - /* Generate a link time warning, should this function ever be called. */ - - ALT_STUB_WARNING(unlink); - - /* Indicate an error */ - - ALT_ERRNO = ENOSYS; - return -1; -} diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_usleep.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_usleep.c deleted file mode 100644 index 2330eb8..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_usleep.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2003 Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - * - * ------------ - * - * Altera does not recommend, suggest or require that this reference design - * file be used in conjunction or combination with any other product. - * - * usleep.c - Microsecond delay routine - */ - -#include - -#include "priv/alt_busy_sleep.h" -#include "os/alt_syscall.h" - -/* - * This function simply calls alt_busy_sleep() to perform the delay. This - * function implements the delay as a calibrated "busy loop". - * - * ALT_USLEEP is mapped onto the usleep() system call in alt_syscall.h - */ - - - -#if defined (__GNUC__) && __GNUC__ >= 4 -int ALT_USLEEP (useconds_t us) -#else -unsigned int ALT_USLEEP (unsigned int us) -#endif -{ - return alt_busy_sleep(us); -} diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_wait.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_wait.c deleted file mode 100644 index a42f80f..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_wait.c +++ /dev/null @@ -1,52 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include "sys/alt_errno.h" -#include "os/alt_syscall.h" - -/* - * wait() is used by newlib to wait for all child processes to exit. Since the - * HAL does not support spawning child processes, this returns immediately as - * there can't be anythign to wait for. - * - * ALT_WAIT is mapped onto the wait() system call in alt_syscall.h - */ - -int ALT_WAIT (int *status) -{ - *status = 0; - - ALT_ERRNO = ECHILD; - - return -1; -} - diff --git a/software/qsys_tutorial_test_bsp/HAL/src/alt_write.c b/software/qsys_tutorial_test_bsp/HAL/src/alt_write.c deleted file mode 100644 index 51debb5..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/alt_write.c +++ /dev/null @@ -1,138 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -* Altera does not recommend, suggest or require that this reference design * -* file be used in conjunction or combination with any other product. * -******************************************************************************/ - -#include -#include - -#include "sys/alt_errno.h" -#include "sys/alt_warning.h" -#include "priv/alt_file.h" -#include "os/alt_syscall.h" - -#include "sys/alt_log_printf.h" - -/* - * The write() system call is used to write a block of data to a file or - * device. This function simply vectors the request to the device driver - * associated with the input file descriptor "file". - * - * ALT_WRITE is mapped onto the write() system call in alt_syscall.h - */ - -#ifdef ALT_USE_DIRECT_DRIVERS - -#include "system.h" -#include "sys/alt_driver.h" - -/* - * Provide minimal version that just writes to the stdout/stderr devices - * when provided. - */ - -int ALT_WRITE (int file, const void *ptr, size_t len) -{ -#ifdef ALT_STDOUT_PRESENT - ALT_DRIVER_WRITE_EXTERNS(ALT_STDOUT_DEV); -#endif -#ifdef ALT_STDERR_PRESENT - ALT_DRIVER_WRITE_EXTERNS(ALT_STDERR_DEV); -#endif - -#if !defined(ALT_STDOUT_PRESENT) && !defined(ALT_STDERR_PRESENT) - /* Generate a link time warning, should this function ever be called. */ - ALT_STUB_WARNING(write); -#endif - - switch (file) { -#ifdef ALT_STDOUT_PRESENT - case 1: /* stdout file descriptor */ - return ALT_DRIVER_WRITE(ALT_STDOUT_DEV, ptr, len, 0); -#endif /* ALT_STDOUT_PRESENT */ -#ifdef ALT_STDERR_PRESENT - case 2: /* stderr file descriptor */ - return ALT_DRIVER_WRITE(ALT_STDERR_DEV, ptr, len, 0); -#endif /* ALT_STDERR_PRESENT */ - default: - ALT_ERRNO = EBADFD; - return -1; - } -} - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -int ALT_WRITE (int file, const void *ptr, size_t len) -{ - alt_fd* fd; - int rval; - - /* - * A common error case is that when the file descriptor was created, the call - * to open() failed resulting in a negative file descriptor. This is trapped - * below so that we don't try and process an invalid file descriptor. - */ - - fd = (file < 0) ? NULL : &alt_fd_list[file]; - - if (fd) - { - /* - * If the file has not been opened with write access, or if the driver does - * not provide an implementation of write(), generate an error. Otherwise - * call the drivers write() function to process the request. - */ - - if (((fd->fd_flags & O_ACCMODE) != O_RDONLY) && fd->dev->write) - { - - /* ALT_LOG - see altera_hal/HAL/inc/sys/alt_log_printf.h */ - ALT_LOG_WRITE_FUNCTION(ptr,len); - - if ((rval = fd->dev->write(fd, ptr, len)) < 0) - { - ALT_ERRNO = -rval; - return -1; - } - return rval; - } - else - { - ALT_ERRNO = EACCES; - } - } - else - { - ALT_ERRNO = EBADFD; - } - return -1; -} - -#endif /* ALT_USE_DIRECT_DRIVERS */ diff --git a/software/qsys_tutorial_test_bsp/HAL/src/altera_nios2_qsys_irq.c b/software/qsys_tutorial_test_bsp/HAL/src/altera_nios2_qsys_irq.c deleted file mode 100644 index c7a4f93..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/altera_nios2_qsys_irq.c +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2009 Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - * - * altera_nios2_irq.c - Support for Nios II internal interrupt controller. - * - */ - -#include "sys/alt_irq.h" -#include "altera_nios2_qsys_irq.h" - -/* - * To initialize the internal interrupt controller, just clear the IENABLE - * register so that all possible IRQs are disabled. - */ -void altera_nios2_qsys_irq_init(void) -{ - NIOS2_WRITE_IENABLE(0); -} diff --git a/software/qsys_tutorial_test_bsp/HAL/src/crt0.S b/software/qsys_tutorial_test_bsp/HAL/src/crt0.S deleted file mode 100644 index 582445d..0000000 --- a/software/qsys_tutorial_test_bsp/HAL/src/crt0.S +++ /dev/null @@ -1,456 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "system.h" -#include "nios2.h" - -/* Setup header files to work with assembler code. */ -#define ALT_ASM_SRC - -/* Debug logging facility */ -#include "sys/alt_log_printf.h" - -/*************************************************************************\ -| MACROS | -\*************************************************************************/ - -/* - * The new build tools explicitly define macros when alt_load() - * must be called. The define ALT_LOAD_EXPLICITLY_CONTROLLED tells us that - * those macros are controlling if alt_load() needs to be called. - */ -#ifdef ALT_LOAD_EXPLICITLY_CONTROLLED - -/* Need to call alt_load() if any of these sections are being copied. */ -#if defined(ALT_LOAD_COPY_RODATA) || defined(ALT_LOAD_COPY_RWDATA) || defined(ALT_LOAD_COPY_EXCEPTIONS) -#define CALL_ALT_LOAD -#endif - -#else /* !ALT_LOAD_EXPLICITLY_CONTROLLED */ - -/* - * The legacy build tools use the following macros to detect when alt_load() - * needs to be called. - */ - -#define __ALT_LOAD_SECTIONS(res, text, rodata, exc) \ - ((res##_BASE != rodata##_BASE) || \ - (res##_BASE != rwdata##_BASE) || \ - (res##_BASE != exc##_BASE)) - -#define _ALT_LOAD_SECTIONS(res, text, rodata, exc) \ - __ALT_LOAD_SECTIONS(res, text, rodata, exc) - -#define ALT_LOAD_SECTIONS _ALT_LOAD_SECTIONS(ALT_RESET_DEVICE, \ - ALT_RODATA_DEVICE, \ - ALT_RWDATA_DEVICE, \ - ALT_EXCEPTIONS_DEVICE) - -/* Call alt_load() if there is no bootloader and ALT_LOAD_SECTIONS isn't 0. */ -#if defined(ALT_NO_BOOTLOADER) && ALT_LOAD_SECTIONS -#define CALL_ALT_LOAD -#endif - -#endif /* !ALT_LOAD_EXPLICITLY_CONTROLLED */ - -/* - * When the legacy build tools define a macro called ALT_NO_BOOTLOADER, - * it indicates that initialization code is allowed at the reset address. - * The new build tools define a macro called ALT_ALLOW_CODE_AT_RESET for - * the same purpose. - */ -#ifdef ALT_NO_BOOTLOADER -#define ALT_ALLOW_CODE_AT_RESET -#endif - -/*************************************************************************\ -| EXTERNAL REFERENCES | -\*************************************************************************/ - -/* - * The entry point for user code is either "main" in hosted mode, or - * "alt_main" in standalone mode. These are explicitly referenced here, - * to ensure they are built into the executable. This allows the user - * to build them into libraries, rather than supplying them in object - * files at link time. - */ - .globl main - .globl alt_main - -/* - * Create a reference to the software multiply/divide and trap handers, - * so that if they are provided, they will appear in the executable. - */ -#ifndef ALT_NO_INSTRUCTION_EMULATION - .globl alt_exception_muldiv -#endif -#ifdef ALT_TRAP_HANDLER - .globl alt_exception_trap -#endif - -/* - * Linker defined symbols used to initialize bss. - */ -.globl __bss_start -.globl __bss_end - -/*************************************************************************\ -| RESET SECTION (.entry) | -\*************************************************************************/ - -/* - * This is the reset entry point for Nios II. - * - * At reset, only the cache line which contain the reset vector is - * initialized by the hardware. The code within the first cache line - * initializes the remainder of the instruction cache. - */ - - .section .entry, "xa" - .align 5 - -/* - * Explicitly allow the use of r1 (the assembler temporary register) - * within this code. This register is normally reserved for the use of - * the assembler. - */ - .set noat - -/* - * Some tools want to know where the reset vector is. - * Code isn't always provided at the reset vector but at least the - * __reset label always contains the reset vector address because - * it is defined at the start of the .entry section. - */ - - .globl __reset - .type __reset, @function -__reset: - -/* - * Initialize the instruction cache if present (i.e. size > 0) and - * reset code is allowed unless optimizing for RTL simulation. - * RTL simulations can ensure the instruction cache is already initialized - * so skipping this loop speeds up RTL simulation. - */ - -#if NIOS2_ICACHE_SIZE > 0 && defined(ALT_ALLOW_CODE_AT_RESET) && !defined(ALT_SIM_OPTIMIZE) - /* Assume the instruction cache size is always a power of two. */ -#if NIOS2_ICACHE_SIZE > 0x8000 - movhi r2, %hi(NIOS2_ICACHE_SIZE) -#else - movui r2, NIOS2_ICACHE_SIZE -#endif - -0: - initi r2 - addi r2, r2, -NIOS2_ICACHE_LINE_SIZE - bgt r2, zero, 0b -1: - - /* - * The following debug information tells the ISS not to run the loop above - * but to perform its actions using faster internal code. - */ - .pushsection .debug_alt_sim_info - .int 1, 1, 0b, 1b - .popsection -#endif /* Initialize Instruction Cache */ - -/* - * Jump to the _start entry point in the .text section if reset code - * is allowed or if optimizing for RTL simulation. - */ -#if defined(ALT_ALLOW_CODE_AT_RESET) || defined(ALT_SIM_OPTIMIZE) - /* Jump to the _start entry point in the .text section. */ - movhi r1, %hi(_start) - ori r1, r1, %lo(_start) - jmp r1 - - .size __reset, . - __reset -#endif /* Jump to _start */ - -/* - * When not using exit, provide an _exit symbol to prevent unresolved - * references to _exit from the linker script. - */ -#ifdef ALT_NO_EXIT - .globl _exit -_exit: -#endif - -/*************************************************************************\ -| TEXT SECTION (.text) | -\*************************************************************************/ - -/* - * Start of the .text section, and also the code entry point when - * the code is executed by a bootloader rather than directly from reset. - */ - .section .text - .align 2 - - .globl _start - .type _start, @function -_start: - -/* - * Initialize the data cache if present (i.e. size > 0) and not - * optimizing for RTL simulation. - * RTL simulations can ensure the data cache is already initialized - * so skipping this loop speeds up RTL simulation. - */ - -#if NIOS2_DCACHE_SIZE > 0 && !defined(ALT_SIM_OPTIMIZE) - - /* Assume the data cache size is always a power of two. */ -#if NIOS2_DCACHE_SIZE > 0x8000 - movhi r2, %hi(NIOS2_DCACHE_SIZE) -#else - movui r2, NIOS2_DCACHE_SIZE -#endif - -0: - initd 0(r2) - addi r2, r2, -NIOS2_DCACHE_LINE_SIZE - bgt r2, zero, 0b -1: - - /* - * The following debug information tells the ISS not to run the loop above - * but to perform its actions using faster internal code. - */ - .pushsection .debug_alt_sim_info - .int 2, 1, 0b, 1b - .popsection - -#endif /* Initialize Data Cache */ - - /* Log that caches have been initialized. */ - ALT_LOG_PUTS(alt_log_msg_cache) - - /* Log that the stack pointer is about to be setup. */ - ALT_LOG_PUTS(alt_log_msg_stackpointer) - -#if (NIOS2_NUM_OF_SHADOW_REG_SETS == 0) - /* - * Now that the caches are initialized, set up the stack pointer. - * The value provided by the linker is assumed to be correctly aligned. - */ - movhi sp, %hi(__alt_stack_pointer) - ori sp, sp, %lo(__alt_stack_pointer) - - /* Set up the global pointer. */ - movhi gp, %hi(_gp) - ori gp, gp, %lo(_gp) - -#else /* NIOS2_NUM_OF_SHADOW_REG_SETS > 0 */ - - /* - * Set up the GP and SP in all shadow register sets. - */ - - /* - * Check current register set number, if CPU resets into a shadow register - * set, switch register set to 0 by writing zero to SSTATUS register and - * execute an ERET instruction that just jumps to the next PC address - * (use the NEXTPC instruction to get this). - */ - - rdctl r2, status - - /* Get the current register set number (STATUS.CRS). */ - andi r3, r2, NIOS2_STATUS_CRS_MSK - - /* Skip switch register set if STATUS.CRS is 0. */ - beq r3, zero, .Lskip_switch_reg_set - - .set nobreak - - /* Current register set is non-zero, set SSTATUS to 0. */ - mov sstatus, zero - - /* Get next pc and store in ea. */ - nextpc ea - - /* Point to instruction after eret. */ - addi ea, ea, 8 - - /* - * Execute ERET instruction that just jumps to the next PC address - */ - eret - -.Lskip_switch_reg_set: - mov r2, zero - - /* Reset STATUS register */ - wrctl status, r2 - - movui r3, NIOS2_NUM_OF_SHADOW_REG_SETS - - /* Set up the stack pointer in register set 0. */ - movhi sp, %hi(__alt_stack_pointer) - ori sp, sp, %lo(__alt_stack_pointer) - - /* Set up the global pointer in register set 0. */ - movhi gp, %hi(_gp) - ori gp, gp, %lo(_gp) - -.Lsetup_sp_and_gp_loop: - /* - * Setup GP and SP for shadow register set - * from NIOS2_NUM_OF_SHADOW_REG_SETS to 0 - */ - - /* Skip if number of register sets is 0. */ - beq r3, zero, .Lno_shadow_register_set - - - /* Add previous register set STATUS.PRS by 1 */ - movhi r4, 1 - add r2, r2, r4 - - /* Write STATUS */ - wrctl status, r2 - - /* Clear r0 in the shadow register set (not done by hardware) */ - wrprs r0, r0 - - /* Write the GP in previous register set */ - wrprs gp, gp - - /* Only write the SP in previous register set - * if using the seperate exception stack. For normal case (single stack), - * funnel code would read the SP from previous register set. - */ -#ifdef ALT_INTERRUPT_STACK - - movhi et, %hiadj(__alt_interrupt_stack_pointer) - addi et, et, %lo(__alt_interrupt_stack_pointer) - wrprs sp, et - -#endif /* ALT_INTERRUPT_STACK */ - - /* Decrease number of register set counter by 1 */ - addi r3, r3, -1 - - br .Lsetup_sp_and_gp_loop -.Lno_shadow_register_set: - -#endif /* NIOS2_NUM_OF_SHADOW_REG_SETS */ -/* - * Clear the BSS if not optimizing for RTL simulation. - * - * This uses the symbols: __bss_start and __bss_end, which are defined - * by the linker script. They mark the begining and the end of the bss - * region. The linker script guarantees that these values are word aligned. - */ -#ifndef ALT_SIM_OPTIMIZE - /* Log that the BSS is about to be cleared. */ - ALT_LOG_PUTS(alt_log_msg_bss) - - movhi r2, %hi(__bss_start) - ori r2, r2, %lo(__bss_start) - - movhi r3, %hi(__bss_end) - ori r3, r3, %lo(__bss_end) - - beq r2, r3, 1f - -0: - stw zero, (r2) - addi r2, r2, 4 - bltu r2, r3, 0b - -1: - - /* - * The following debug information tells the ISS not to run the loop above - * but to perform its actions using faster internal code. - */ - .pushsection .debug_alt_sim_info - .int 3, 1, 0b, 1b - .popsection -#endif /* ALT_SIM_OPTIMIZE */ - -/* - * The alt_load() facility is normally used when there is no bootloader. - * It copies some sections into RAM so it acts like a mini-bootloader. - */ -#ifdef CALL_ALT_LOAD - -#ifdef ALT_STACK_CHECK - /* - * If the user has selected stack checking then we need to set up a safe - * value in the stack limit register so that the relocation functions - * don't think the stack has overflowed (the contents of the rwdata - * section aren't defined until alt_load() has been called). - */ - mov et, zero -#endif - - call alt_load - -#endif /* CALL_ALT_LOAD */ - -#ifdef ALT_STACK_CHECK - /* - * Set up the stack limit (if required). The linker has set up the - * copy of the variable which is in memory. - */ - - ldw et, %gprel(alt_stack_limit_value)(gp) -#endif - - /* Log that alt_main is about to be called. */ - ALT_LOG_PUTS(alt_log_msg_alt_main) - - /* Call the C entry point. It should never return. */ - call alt_main - - /* Wait in infinite loop in case alt_main does return. */ -alt_after_alt_main: - br alt_after_alt_main - - .size _start, . - _start - -/* - * Add information about the stack base if stack overflow checking is enabled. - */ -#ifdef ALT_STACK_CHECK - .globl alt_stack_limit_value - .section .sdata,"aws",@progbits - .align 2 - .type alt_stack_limit_value, @object - .size alt_stack_limit_value, 4 -alt_stack_limit_value: - .long __alt_stack_limit -#endif diff --git a/software/qsys_tutorial_test_bsp/Makefile b/software/qsys_tutorial_test_bsp/Makefile deleted file mode 100644 index 9b68af8..0000000 --- a/software/qsys_tutorial_test_bsp/Makefile +++ /dev/null @@ -1,766 +0,0 @@ -#------------------------------------------------------------------------------ -# BSP MAKEFILE -# -# This makefile was automatically generated by the nios2-bsp-generate-files -# command. Its purpose is to build a custom Board Support Package (BSP) -# targeting a specific Nios II processor in an SOPC Builder-based design. -# -# To create an application or library Makefile which uses this BSP, try the -# nios2-app-generate-makefile or nios2-lib-generate-makefile commands. -#------------------------------------------------------------------------------ - -#------------------------------------------------------------------------------ -# TOOLS -#------------------------------------------------------------------------------ - -MKDIR := mkdir -p -ECHO := echo -SPACE := $(empty) $(empty) - -#------------------------------------------------------------------------------ -# The adjust-path macro -# -# If COMSPEC is defined, Make is launched from Windows through -# Cygwin. This adjust-path macro will call 'cygpath -u' on all -# paths to ensure they are readable by Make. -# -# If COMSPEC is not defined, Make is launched from *nix, and no adjustment -# is necessary -#------------------------------------------------------------------------------ - -ifndef COMSPEC -ifdef ComSpec -COMSPEC = $(ComSpec) -endif # ComSpec -endif # !COMSPEC - -ifdef COMSPEC - adjust-path = $(subst $(SPACE),\$(SPACE),$(shell cygpath -u "$1")) - adjust-path-mixed = $(subst $(SPACE),\$(SPACE),$(shell cygpath -m "$1")) -else - adjust-path = $(subst $(SPACE),\$(SPACE),$1) - adjust-path-mixed = $(subst $(SPACE),\$(SPACE),$1) -endif - -#------------------------------------------------------------------------------ -# DEFAULT TARGET -# -# The default target, "all", must appear before any other target in the -# Makefile. Note that extra prerequisites are added to the "all" rule later. -#------------------------------------------------------------------------------ -.PHONY: all -all: - @$(ECHO) [BSP build complete] - - -#------------------------------------------------------------------------------ -# PATHS & DIRECTORY NAMES -# -# Explicitly locate absolute path of the BSP root -#------------------------------------------------------------------------------ - -BSP_ROOT_DIR := . - -# Define absolute path to the root of the BSP. -ABS_BSP_ROOT := $(call adjust-path-mixed,$(shell pwd)) - -# Stash all BSP object files here -OBJ_DIR := ./obj - -NEWLIB_DIR = $(BSP_ROOT_DIR)/newlib - - -#------------------------------------------------------------------------------ -# MANAGED CONTENT -# -# All content between the lines "START MANAGED" and "END MANAGED" below is -# generated based on variables in the BSP settings file when the -# nios2-bsp-generate-files command is invoked. If you wish to persist any -# information pertaining to the build process, it is recomended that you -# utilize the BSP settings mechanism to do so. -# -# Note that most variable assignments in this section have a corresponding BSP -# setting that can be changed by using the nios2-bsp-create-settings or -# nios2-bsp-update-settings command before nios2-bsp-generate-files; if you -# want any variable set to a specific value when this Makefile is re-generated -# (to prevent hand-edits from being over-written), use the BSP settings -# facilities above. -#------------------------------------------------------------------------------ - -#START MANAGED - -# The following TYPE comment allows tools to identify the 'type' of target this -# makefile is associated with. -# TYPE: BSP_PRIVATE_MAKEFILE - -# This following VERSION comment indicates the version of the tool used to -# generate this makefile. A makefile variable is provided for VERSION as well. -# ACDS_VERSION: 13.0sp1 -ACDS_VERSION := 13.0sp1 - -# This following BUILD_NUMBER comment indicates the build number of the tool -# used to generate this makefile. -# BUILD_NUMBER: 232 - -SETTINGS_FILE := settings.bsp -SOPC_FILE := C:/Users/takayun/Desktop/qsys_tutorial/nios_system.sopcinfo - -#------------------------------------------------------------------------------- -# TOOL & COMMAND DEFINITIONS -# -# The base command for each build operation are expressed here. Additional -# switches may be expressed here. They will run for all instances of the -# utility. -#------------------------------------------------------------------------------- - -# Archiver command. Creates library files. -AR = nios2-elf-ar - -# Assembler command. Note that CC is used for .S files. -AS = nios2-elf-gcc - -# Custom flags only passed to the archiver. This content of this variable is -# directly passed to the archiver rather than the more standard "ARFLAGS". The -# reason for this is that GNU Make assumes some default content in ARFLAGS. -# This setting defines the value of BSP_ARFLAGS in Makefile. -BSP_ARFLAGS = -src - -# Custom flags only passed to the assembler. This setting defines the value of -# BSP_ASFLAGS in Makefile. -BSP_ASFLAGS = -Wa,-gdwarf2 - -# C/C++ compiler debug level. '-g' provides the default set of debug symbols -# typically required to debug a typical application. Omitting '-g' removes -# debug symbols from the ELF. This setting defines the value of -# BSP_CFLAGS_DEBUG in Makefile. -BSP_CFLAGS_DEBUG = -g - -# C/C++ compiler optimization level. "-O0" = no optimization,"-O2" = "normal" -# optimization, etc. "-O0" is recommended for code that you want to debug since -# compiler optimization can remove variables and produce non-sequential -# execution of code while debugging. This setting defines the value of -# BSP_CFLAGS_OPTIMIZATION in Makefile. -BSP_CFLAGS_OPTIMIZATION = '-Os' - -# C/C++ compiler warning level. "-Wall" is commonly used.This setting defines -# the value of BSP_CFLAGS_WARNINGS in Makefile. -BSP_CFLAGS_WARNINGS = -Wall - -# C compiler command. -CC = nios2-elf-gcc -xc - -# C++ compiler command. -CXX = nios2-elf-gcc -xc++ - -# Command used to remove files during 'clean' target. -RM = rm -f - - -#------------------------------------------------------------------------------- -# BUILD PRE & POST PROCESS COMMANDS -# -# The following variables are treated as shell commands in the rule -# definitions for each file-type associated with the BSP build, as well as -# commands run at the beginning and end of the entire BSP build operation. -# Pre-process commands are executed before the relevant command (for example, -# a command defined in the "CC_PRE_PROCESS" variable executes before the C -# compiler for building .c files), while post-process commands are executed -# immediately afterwards. -# -# You can view each pre/post-process command in the "Build Rules: All & -# Clean", "Pattern Rules to Build Objects", and "Library Rules" sections of -# this Makefile. -#------------------------------------------------------------------------------- - - -#------------------------------------------------------------------------------- -# BSP SOURCE BUILD SETTINGS (FLAG GENERATION) -# -# Software build settings such as compiler optimization, debug level, warning -# flags, etc., may be defined in the following variables. The variables below -# are concatenated together in the 'Flags' section of this Makefile to form -# final variables of flags passed to the build tools. -# -# These settings are considered private to the BSP and apply to all library & -# driver files in it; they do NOT automatically propagate to, for example, the -# build settings for an application. -# # For additional detail and syntax requirements, please refer to GCC help -# (example: "nios2-elf-gcc --help --verbose"). -# -# Unless indicated otherwise, multiple entries in each variable should be -# space-separated. -#------------------------------------------------------------------------------- - -# Altera HAL alt_sys_init.c generated source file -GENERATED_C_FILES := $(ABS_BSP_ROOT)/alt_sys_init.c -GENERATED_C_LIB_SRCS += alt_sys_init.c - - -#------------------------------------------------------------------------------- -# BSP SOURCE FILE LISTING -# -# All source files that comprise the BSP are listed here, along with path -# information to each file expressed relative to the BSP root. The precise -# list and location of each file is derived from the driver, operating system, -# or software package source file declarations. -# -# Following specification of the source files for each component, driver, etc., -# each source file type (C, assembly, etc.) is concatenated together and used -# to construct a list of objects. Pattern rules to build each object are then -# used to build each file. -#------------------------------------------------------------------------------- - -# altera_avalon_jtag_uart_driver sources root -altera_avalon_jtag_uart_driver_SRCS_ROOT := drivers - -# altera_avalon_jtag_uart_driver sources -altera_avalon_jtag_uart_driver_C_LIB_SRCS := \ - $(altera_avalon_jtag_uart_driver_SRCS_ROOT)/src/altera_avalon_jtag_uart_init.c \ - $(altera_avalon_jtag_uart_driver_SRCS_ROOT)/src/altera_avalon_jtag_uart_read.c \ - $(altera_avalon_jtag_uart_driver_SRCS_ROOT)/src/altera_avalon_jtag_uart_write.c \ - $(altera_avalon_jtag_uart_driver_SRCS_ROOT)/src/altera_avalon_jtag_uart_ioctl.c \ - $(altera_avalon_jtag_uart_driver_SRCS_ROOT)/src/altera_avalon_jtag_uart_fd.c - -# altera_avalon_pio_driver sources root -altera_avalon_pio_driver_SRCS_ROOT := drivers - -# altera_avalon_pio_driver sources -# altera_nios2_qsys_hal_driver sources root -altera_nios2_qsys_hal_driver_SRCS_ROOT := HAL - -# altera_nios2_qsys_hal_driver sources -altera_nios2_qsys_hal_driver_C_LIB_SRCS := \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/altera_nios2_qsys_irq.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_usleep.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_busy_sleep.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_irq_vars.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_icache_flush.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_icache_flush_all.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_dcache_flush.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_dcache_flush_all.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_dcache_flush_no_writeback.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_instruction_exception_entry.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_irq_register.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_iic.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_remap_cached.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_remap_uncached.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_uncached_free.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_uncached_malloc.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_do_ctors.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_do_dtors.c \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_gmon.c - -altera_nios2_qsys_hal_driver_ASM_LIB_SRCS := \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_exception_entry.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_exception_trap.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_exception_muldiv.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_irq_entry.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_software_exception.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_mcount.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_log_macro.S \ - $(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/crt0.S - -# hal sources root -hal_SRCS_ROOT := HAL - -# hal sources -hal_C_LIB_SRCS := \ - $(hal_SRCS_ROOT)/src/alt_alarm_start.c \ - $(hal_SRCS_ROOT)/src/alt_close.c \ - $(hal_SRCS_ROOT)/src/alt_dev.c \ - $(hal_SRCS_ROOT)/src/alt_dev_llist_insert.c \ - $(hal_SRCS_ROOT)/src/alt_dma_rxchan_open.c \ - $(hal_SRCS_ROOT)/src/alt_dma_txchan_open.c \ - $(hal_SRCS_ROOT)/src/alt_environ.c \ - $(hal_SRCS_ROOT)/src/alt_env_lock.c \ - $(hal_SRCS_ROOT)/src/alt_errno.c \ - $(hal_SRCS_ROOT)/src/alt_execve.c \ - $(hal_SRCS_ROOT)/src/alt_exit.c \ - $(hal_SRCS_ROOT)/src/alt_fcntl.c \ - $(hal_SRCS_ROOT)/src/alt_fd_lock.c \ - $(hal_SRCS_ROOT)/src/alt_fd_unlock.c \ - $(hal_SRCS_ROOT)/src/alt_find_dev.c \ - $(hal_SRCS_ROOT)/src/alt_find_file.c \ - $(hal_SRCS_ROOT)/src/alt_flash_dev.c \ - $(hal_SRCS_ROOT)/src/alt_fork.c \ - $(hal_SRCS_ROOT)/src/alt_fs_reg.c \ - $(hal_SRCS_ROOT)/src/alt_fstat.c \ - $(hal_SRCS_ROOT)/src/alt_get_fd.c \ - $(hal_SRCS_ROOT)/src/alt_getchar.c \ - $(hal_SRCS_ROOT)/src/alt_getpid.c \ - $(hal_SRCS_ROOT)/src/alt_gettod.c \ - $(hal_SRCS_ROOT)/src/alt_iic_isr_register.c \ - $(hal_SRCS_ROOT)/src/alt_instruction_exception_register.c \ - $(hal_SRCS_ROOT)/src/alt_ioctl.c \ - $(hal_SRCS_ROOT)/src/alt_io_redirect.c \ - $(hal_SRCS_ROOT)/src/alt_irq_handler.c \ - $(hal_SRCS_ROOT)/src/alt_isatty.c \ - $(hal_SRCS_ROOT)/src/alt_kill.c \ - $(hal_SRCS_ROOT)/src/alt_link.c \ - $(hal_SRCS_ROOT)/src/alt_load.c \ - $(hal_SRCS_ROOT)/src/alt_log_printf.c \ - $(hal_SRCS_ROOT)/src/alt_lseek.c \ - $(hal_SRCS_ROOT)/src/alt_main.c \ - $(hal_SRCS_ROOT)/src/alt_malloc_lock.c \ - $(hal_SRCS_ROOT)/src/alt_open.c \ - $(hal_SRCS_ROOT)/src/alt_printf.c \ - $(hal_SRCS_ROOT)/src/alt_putchar.c \ - $(hal_SRCS_ROOT)/src/alt_putstr.c \ - $(hal_SRCS_ROOT)/src/alt_read.c \ - $(hal_SRCS_ROOT)/src/alt_release_fd.c \ - $(hal_SRCS_ROOT)/src/alt_rename.c \ - $(hal_SRCS_ROOT)/src/alt_sbrk.c \ - $(hal_SRCS_ROOT)/src/alt_settod.c \ - $(hal_SRCS_ROOT)/src/alt_stat.c \ - $(hal_SRCS_ROOT)/src/alt_tick.c \ - $(hal_SRCS_ROOT)/src/alt_times.c \ - $(hal_SRCS_ROOT)/src/alt_unlink.c \ - $(hal_SRCS_ROOT)/src/alt_wait.c \ - $(hal_SRCS_ROOT)/src/alt_write.c - - -# Assemble all component C source files -COMPONENT_C_LIB_SRCS += \ - $(altera_avalon_jtag_uart_driver_C_LIB_SRCS) \ - $(altera_nios2_qsys_hal_driver_C_LIB_SRCS) \ - $(hal_C_LIB_SRCS) - -# Assemble all component assembly source files -COMPONENT_ASM_LIB_SRCS += \ - $(altera_nios2_qsys_hal_driver_ASM_LIB_SRCS) - -# Assemble all component C++ source files -COMPONENT_CPP_LIB_SRCS += \ - -#END MANAGED - -#------------------------------------------------------------------------------ -# PUBLIC.MK -# -# The generated public.mk file contains BSP information that is shared with -# other external makefiles, such as a Nios II application makefile. System- -# dependent information such as hardware-specific compiler flags and -# simulation file generation are stored here. -# -# In addition, public.mk contains include paths that various software, -# such as a device driver, may need for the C compiler. These paths are -# written to public.mk with respect to the BSP root. In public.mk, each -# path is prefixed with a special variable, $(ALT_LIBRARY_ROOT_DIR). The -# purpose of this variable is to allow an external Makefile to append on -# path information to precisely locate paths expressed in public.mk -# Since this is the BSP Makefile, we set ALT_LIBRARY_ROOT_DIR to point right -# here ("."), at the BSP root. -# -# ALT_LIBRARY_ROOT_DIR must always be set before public.mk is included. -#------------------------------------------------------------------------------ -ALT_LIBRARY_ROOT_DIR := . -include public.mk - - -#------------------------------------------------------------------------------ -# FLAGS -# -# Include paths for BSP files are written into the public.mk file and must -# be added to the existing list of pre-processor flags. In addition, "hooks" -# for standard flags left intentionally empty (CFLAGS, CPPFLAGS, ASFLAGS, -# and CXXFLAGS) are provided for conveniently adding to the relevant flags -# on the command-line or via script that calls make. -#------------------------------------------------------------------------------ -# Assemble final list of compiler flags from generated content -BSP_CFLAGS += \ - $(BSP_CFLAGS_DEFINED_SYMBOLS) \ - $(BSP_CFLAGS_UNDEFINED_SYMBOLS) \ - $(BSP_CFLAGS_OPTIMIZATION) \ - $(BSP_CFLAGS_DEBUG) \ - $(BSP_CFLAGS_WARNINGS) \ - $(BSP_CFLAGS_USER_FLAGS) \ - $(ALT_CFLAGS) \ - $(CFLAGS) - -# Make ready the final list of include directories and other C pre-processor -# flags. Each include path is made ready by prefixing it with "-I". -BSP_CPPFLAGS += \ - $(addprefix -I, $(BSP_INC_DIRS)) \ - $(addprefix -I, $(ALT_INCLUDE_DIRS)) \ - $(ALT_CPPFLAGS) \ - $(CPPFLAGS) - -# Finish off assembler flags with any user-provided flags -BSP_ASFLAGS += $(ASFLAGS) - -# Finish off C++ flags with any user-provided flags -BSP_CXXFLAGS += $(CXXFLAGS) - -# And finally, the ordered list -C_SRCS += $(GENERATED_C_LIB_SRCS) \ - $(COMPONENT_C_LIB_SRCS) - -CXX_SRCS += $(GENERATED_CPP_LIB_SRCS) \ - $(COMPONENT_CPP_LIB_SRCS) - -ASM_SRCS += $(GENERATED_ASM_LIB_SRCS) \ - $(COMPONENT_ASM_LIB_SRCS) - - -#------------------------------------------------------------------------------ -# LIST OF GENERATED FILES -# -# A Nios II BSP relies on the generation of several source files used -# by both the BSP and any applications referencing the BSP. -#------------------------------------------------------------------------------ - - -GENERATED_H_FILES := $(ABS_BSP_ROOT)/system.h - -GENERATED_LINKER_SCRIPT := $(ABS_BSP_ROOT)/linker.x - -GENERATED_FILES += $(GENERATED_H_FILES) \ - $(GENERATED_LINKER_SCRIPT) - - -#------------------------------------------------------------------------------ -# SETUP TO BUILD OBJECTS -# -# List of object files which are to be built. This is constructed from the input -# list of C source files (C_SRCS), C++ source files (CXX_SRCS), and assembler -# source file (ASM_SRCS). The permitted file extensions are: -# -# .c .C - for C files -# .cxx .cc .cpp .CXX .CC .CPP - for C++ files -# .S .s - for assembly files -# -# Extended description: The list of objects is a sorted list (duplicates -# removed) of all possible objects, placed beneath the ./obj directory, -# including any path information stored in the "*_SRCS" variable. The -# "patsubst" commands are used to concatenate together multiple file suffix -# types for common files (i.e. c++ as .cxx, .cc, .cpp). -# -# File extensions are case-insensitive in build rules with the exception of -# assembly sources. Nios II assembly sources with the ".S" extension are first -# run through the C preprocessor. Sources with the ".s" extension are not. -#------------------------------------------------------------------------------ -OBJS = $(sort $(addprefix $(OBJ_DIR)/, \ - $(patsubst %.c, %.o, $(patsubst %.C, %.o, $(C_SRCS))) \ - $(patsubst %.cxx, %.o, $(patsubst %.CXX, %.o, \ - $(patsubst %.cc, %.o, $(patsubst %.CC, %.o, \ - $(patsubst %.cpp, %.o, $(patsubst %.CPP, %.o, \ - $(CXX_SRCS) )))))) \ - $(patsubst %.S, %.o, $(patsubst %.s, %.o, $(ASM_SRCS))) )) - -# List of dependancy files for each object file. -DEPS = $(OBJS:.o=.d) - - -# Rules to force your project to rebuild or relink -# .force_relink file will cause any application that depends on this project to relink -# .force_rebuild file will cause this project to rebuild object files -# .force_rebuild_all file will cause this project and any project that depends on this project to rebuild object files - -FORCE_RELINK_DEP := .force_relink -FORCE_REBUILD_DEP := .force_rebuild -FORCE_REBUILD_ALL_DEP := .force_rebuild_all -FORCE_REBUILD_DEP_LIST := $(FORCE_RELINK_DEP) $(FORCE_REBUILD_DEP) $(FORCE_REBUILD_ALL_DEP) - -$(FORCE_REBUILD_DEP_LIST): - -$(OBJS): $(wildcard $(FORCE_REBUILD_DEP)) $(wildcard $(FORCE_REBUILD_ALL_DEP)) - - -#------------------------------------------------------------------------------ -# BUILD RULES: ALL & CLEAN -#------------------------------------------------------------------------------ -.DELETE_ON_ERROR: - -.PHONY: all -all: build_pre_process -all: Makefile $(GENERATED_FILES) $(BSP_LIB) $(NEWLIB_DIR) -all: build_post_process - - -# clean: remove .o/.a/.d -.PHONY: clean -clean: - @$(RM) -r $(BSP_LIB) $(OBJ_DIR) $(FORCE_REBUILD_DEP_LIST) -ifneq ($(wildcard $(NEWLIB_DIR)),) - @$(RM) -r $(NEWLIB_DIR) -endif - @$(ECHO) [BSP clean complete] - - -#------------------------------------------------------------------------------ -# BUILD PRE/POST PROCESS -#------------------------------------------------------------------------------ -build_pre_process : - $(BUILD_PRE_PROCESS) - -build_post_process : - $(BUILD_POST_PROCESS) - -.PHONY: build_pre_process build_post_process - - - -#------------------------------------------------------------------------------ -# MAKEFILE UP TO DATE? -# -# Is this very Makefile up to date? Someone may have changed the BSP settings -# file or the associated target hardware. -#------------------------------------------------------------------------------ -# Skip this check when clean is the only target -ifneq ($(MAKECMDGOALS),clean) - -ifneq ($(wildcard $(SETTINGS_FILE)),$(SETTINGS_FILE)) -$(warning Warning: BSP Settings File $(SETTINGS_FILE) could not be found.) -endif - -Makefile: $(wildcard $(SETTINGS_FILE)) - @$(ECHO) Makefile not up to date. - @$(ECHO) $(SETTINGS_FILE) has been modified since the BSP Makefile was generated. - @$(ECHO) - @$(ECHO) Generate the BSP to update the Makefile, and then build again. - @$(ECHO) - @$(ECHO) To generate from Eclipse: - @$(ECHO) " 1. Right-click the BSP project." - @$(ECHO) " 2. In the Nios II Menu, click Generate BSP." - @$(ECHO) - @$(ECHO) To generate from the command line: - @$(ECHO) " nios2-bsp-generate-files --settings= --bsp-dir=" - @$(ECHO) - @exit 1 - -ifneq ($(wildcard $(SOPC_FILE)),$(SOPC_FILE)) -$(warning Warning: SOPC File $(SOPC_FILE) could not be found.) -endif - -public.mk: $(wildcard $(SOPC_FILE)) - @$(ECHO) Makefile not up to date. - @$(ECHO) $(SOPC_FILE) has been modified since the BSP was generated. - @$(ECHO) - @$(ECHO) Generate the BSP to update the Makefile, and then build again. - @$(ECHO) - @$(ECHO) To generate from Eclipse: - @$(ECHO) " 1. Right-click the BSP project." - @$(ECHO) " 2. In the Nios II Menu, click Generate BSP." - @$(ECHO) - @$(ECHO) To generate from the command line: - @$(ECHO) " nios2-bsp-generate-files --settings= --bsp-dir=" - @$(ECHO) - @exit 1 - -endif # $(MAKECMDGOALS) != clean - -#------------------------------------------------------------------------------ -# PATTERN RULES TO BUILD OBJECTS -#------------------------------------------------------------------------------ -$(OBJ_DIR)/%.o: %.c - @$(ECHO) Compiling $( - -/* - * Device headers - */ - -#include "altera_nios2_qsys_irq.h" -#include "altera_avalon_jtag_uart.h" - -/* - * Allocate the device storage - */ - -ALTERA_NIOS2_QSYS_IRQ_INSTANCE ( NIOS2_PROCESSOR, nios2_processor); -ALTERA_AVALON_JTAG_UART_INSTANCE ( JTAG_UART, jtag_uart); - -/* - * Initialize the interrupt controller devices - * and then enable interrupts in the CPU. - * Called before alt_sys_init(). - * The "base" parameter is ignored and only - * present for backwards-compatibility. - */ - -void alt_irq_init ( const void* base ) -{ - ALTERA_NIOS2_QSYS_IRQ_INIT ( NIOS2_PROCESSOR, nios2_processor); - alt_irq_cpu_enable_interrupts(); -} - -/* - * Initialize the non-interrupt controller devices. - * Called after alt_irq_init(). - */ - -void alt_sys_init( void ) -{ - ALTERA_AVALON_JTAG_UART_INIT ( JTAG_UART, jtag_uart); -} diff --git a/software/qsys_tutorial_test_bsp/create-this-bsp b/software/qsys_tutorial_test_bsp/create-this-bsp deleted file mode 100644 index d95439e..0000000 --- a/software/qsys_tutorial_test_bsp/create-this-bsp +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/bash -# -# This script creates the ucosii_net_zipfs Board Support Package (BSP). - -BSP_TYPE=hal -BSP_DIR=. -SOPC_DIR=../../ -SOPC_FILE=C:/Users/takayun/Desktop/qsys_tutorial/nios_system.sopcinfo -NIOS2_BSP_ARGS="--set hal.max_file_descriptors 4 --set hal.enable_small_c_library true --set hal.sys_clk_timer none --set hal.timestamp_timer none --set hal.enable_exit false --set hal.enable_c_plus_plus false --set hal.enable_lightweight_device_driver_api true --set hal.enable_clean_exit false --set hal.enable_sim_optimize false --set hal.enable_reduced_device_drivers true --set hal.make.bsp_cflags_optimization '-Os'" -CPU_NAME= - - -# Don't run make if create-this-app script is called with --no-make arg -SKIP_MAKE= -while [ $# -gt 0 ] -do - case "$1" in - --no-make) - SKIP_MAKE=1 - ;; - *) - NIOS2_BSP_ARGS="$NIOS2_BSP_ARGS $1" - ;; - esac - shift -done - - -# Run nios2-bsp utility to create a hal BSP in this directory -# for the system with a .sopc file in $SOPC_FILE. -# Deprecating $SOPC_DIR in 10.1. Multiple .sopcinfo files in a directory may exist. - -if [ -z "$SOPC_FILE" ]; then - echo "WARNING: Use of a directory for locating a .sopcinfo file is deprecated in 10.1. Multiple .sopcinfo files may exist. You must specify the full .sopcinfo path." - cmd="nios2-bsp $BSP_TYPE $BSP_DIR $SOPC_DIR $NIOS2_BSP_ARGS $CPU_NAME" -else - cmd="nios2-bsp $BSP_TYPE $BSP_DIR $SOPC_FILE $NIOS2_BSP_ARGS $CPU_NAME" -fi - - -echo "create-this-bsp: Running \"$cmd\"" -$cmd || { - echo "$cmd failed" - exit 1 -} -if [ -z "$SKIP_MAKE" ]; then - echo "create-this-bsp: Running make" - make -fi diff --git a/software/qsys_tutorial_test_bsp/drivers/inc/altera_avalon_jtag_uart.h b/software/qsys_tutorial_test_bsp/drivers/inc/altera_avalon_jtag_uart.h deleted file mode 100644 index 95d4a99..0000000 --- a/software/qsys_tutorial_test_bsp/drivers/inc/altera_avalon_jtag_uart.h +++ /dev/null @@ -1,198 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#ifndef __ALT_AVALON_JTAG_UART_H__ -#define __ALT_AVALON_JTAG_UART_H__ - -#include - -#include "sys/alt_alarm.h" -#include "sys/alt_warning.h" - -#include "os/alt_sem.h" -#include "os/alt_flag.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * If the user wants all drivers to be small rather than fast then make sure - * this one is marked as needing to be small. - */ -#if defined ALT_USE_SMALL_DRIVERS && !defined ALTERA_AVALON_JTAG_UART_SMALL -#define ALTERA_AVALON_JTAG_UART_SMALL -#endif - -/* - * If the user wants to ignore FIFO full error after timeout - */ -#if defined ALT_JTAG_UART_IGNORE_FIFO_FULL_ERROR && !defined ALTERA_AVALON_JTAG_UART_IGNORE_FIFO_FULL_ERROR -#define ALTERA_AVALON_JTAG_UART_IGNORE_FIFO_FULL_ERROR -#endif - -/* - * Constants that can be overriden. - */ -#ifndef ALTERA_AVALON_JTAG_UART_DEFAULT_TIMEOUT -#define ALTERA_AVALON_JTAG_UART_DEFAULT_TIMEOUT 10 -#endif - -#ifndef ALTERA_AVALON_JTAG_UART_BUF_LEN -#define ALTERA_AVALON_JTAG_UART_BUF_LEN 2048 -#endif - -/* - * ALT_JTAG_UART_READ_RDY and ALT_JTAG_UART_WRITE_RDY are the bitmasks - * that define uC/OS-II event flags that are releated to this device. - * - * ALT_JTAG_UART_READ_RDY indicates that there is read data in the buffer - * ready to be processed. ALT_JTAG_UART_WRITE_RDY indicates that the transmitter is - * ready for more data. - */ -#define ALT_JTAG_UART_READ_RDY 0x1 -#define ALT_JTAG_UART_WRITE_RDY 0x2 -#define ALT_JTAG_UART_TIMEOUT 0x4 - -/* - * State structure definition. Each instance of the driver uses one - * of these structures to hold its associated state. - */ - -typedef struct altera_avalon_jtag_uart_state_s -{ - unsigned int base; - -#ifndef ALTERA_AVALON_JTAG_UART_SMALL - - unsigned int timeout; /* Timeout until host is assumed inactive */ - alt_alarm alarm; - unsigned int irq_enable; - unsigned int host_inactive; - - ALT_SEM (read_lock) - ALT_SEM (write_lock) - ALT_FLAG_GRP (events) - - /* The variables below are volatile because they are modified by the - * interrupt routine. Making them volatile and reading them atomically - * means that we don't need any large critical sections. - */ - volatile unsigned int rx_in; - unsigned int rx_out; - unsigned int tx_in; - volatile unsigned int tx_out; - char rx_buf[ALTERA_AVALON_JTAG_UART_BUF_LEN]; - char tx_buf[ALTERA_AVALON_JTAG_UART_BUF_LEN]; - -#endif /* !ALTERA_AVALON_JTAG_UART_SMALL */ - -} altera_avalon_jtag_uart_state; - -/* - * Macros used by alt_sys_init when the ALT file descriptor facility isn't used. - */ - -#ifdef ALTERA_AVALON_JTAG_UART_SMALL - -#define ALTERA_AVALON_JTAG_UART_STATE_INSTANCE(name, state) \ - altera_avalon_jtag_uart_state state = \ - { \ - name##_BASE, \ - } - -#define ALTERA_AVALON_JTAG_UART_STATE_INIT(name, state) - -#else /* !ALTERA_AVALON_JTAG_UART_SMALL */ - -#define ALTERA_AVALON_JTAG_UART_STATE_INSTANCE(name, state) \ - altera_avalon_jtag_uart_state state = \ - { \ - name##_BASE, \ - ALTERA_AVALON_JTAG_UART_DEFAULT_TIMEOUT, \ - } - -/* - * Externally referenced routines - */ -extern void altera_avalon_jtag_uart_init(altera_avalon_jtag_uart_state* sp, - int irq_controller_id, int irq); - -#define ALTERA_AVALON_JTAG_UART_STATE_INIT(name, state) \ - { \ - if (name##_IRQ == ALT_IRQ_NOT_CONNECTED) \ - { \ - ALT_LINK_ERROR ("Error: Interrupt not connected for " #name ". " \ - "You have selected the interrupt driven version of " \ - "the ALTERA Avalon JTAG UART driver, but the " \ - "interrupt is not connected for this device. You can " \ - "select a polled mode driver by checking the 'small " \ - "driver' option in the HAL configuration window, or " \ - "by using the -DALTERA_AVALON_JTAG_UART_SMALL " \ - "preprocessor flag."); \ - } \ - else \ - altera_avalon_jtag_uart_init(&state, \ - name##_IRQ_INTERRUPT_CONTROLLER_ID, \ - name##_IRQ); \ - } - -#endif /* ALTERA_AVALON_JTAG_UART_SMALL */ - -/* - * Include in case non-direct version of driver required. - */ -#include "altera_avalon_jtag_uart_fd.h" - -/* - * Map alt_sys_init macros to direct or non-direct versions. - */ -#ifdef ALT_USE_DIRECT_DRIVERS - -#define ALTERA_AVALON_JTAG_UART_INSTANCE(name, state) \ - ALTERA_AVALON_JTAG_UART_STATE_INSTANCE(name, state) -#define ALTERA_AVALON_JTAG_UART_INIT(name, state) \ - ALTERA_AVALON_JTAG_UART_STATE_INIT(name, state) - -#else /* !ALT_USE_DIRECT_DRIVERS */ - -#define ALTERA_AVALON_JTAG_UART_INSTANCE(name, dev) \ - ALTERA_AVALON_JTAG_UART_DEV_INSTANCE(name, dev) -#define ALTERA_AVALON_JTAG_UART_INIT(name, dev) \ - ALTERA_AVALON_JTAG_UART_DEV_INIT(name, dev) - -#endif /* ALT_USE_DIRECT_DRIVERS */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_AVALON_JTAG_UART_H__ */ diff --git a/software/qsys_tutorial_test_bsp/drivers/inc/altera_avalon_jtag_uart_fd.h b/software/qsys_tutorial_test_bsp/drivers/inc/altera_avalon_jtag_uart_fd.h deleted file mode 100644 index b3c3200..0000000 --- a/software/qsys_tutorial_test_bsp/drivers/inc/altera_avalon_jtag_uart_fd.h +++ /dev/null @@ -1,125 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#ifndef __ALT_AVALON_JTAG_UART_FD_H__ -#define __ALT_AVALON_JTAG_UART_FD_H__ - -#include "sys/alt_dev.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* - * Externally referenced routines - */ -extern int altera_avalon_jtag_uart_read_fd (alt_fd* fd, char* ptr, int len); -extern int altera_avalon_jtag_uart_write_fd (alt_fd* fd, const char* ptr, - int len); - -/* - * Device structure definition. This is needed by alt_sys_init in order to - * reserve memory for the device instance. - */ - -typedef struct altera_avalon_jtag_uart_dev_s -{ - alt_dev dev; - altera_avalon_jtag_uart_state state; -} altera_avalon_jtag_uart_dev; - -/* - * Macros used by alt_sys_init when the ALT file descriptor facility is used. - */ - -#ifdef ALTERA_AVALON_JTAG_UART_SMALL - -#define ALTERA_AVALON_JTAG_UART_DEV_INSTANCE(name, d) \ - static altera_avalon_jtag_uart_dev d = \ - { \ - { \ - ALT_LLIST_ENTRY, \ - name##_NAME, \ - NULL, /* open */ \ - NULL, /* close */ \ - altera_avalon_jtag_uart_read_fd, \ - altera_avalon_jtag_uart_write_fd, \ - NULL, /* lseek */ \ - NULL, /* fstat */ \ - NULL, /* ioctl */ \ - }, \ - { \ - name##_BASE, \ - } \ - } - -#define ALTERA_AVALON_JTAG_UART_DEV_INIT(name, d) alt_dev_reg (&d.dev) - -#else /* !ALTERA_AVALON_JTAG_UART_SMALL */ - -extern int altera_avalon_jtag_uart_close_fd(alt_fd* fd); -extern int altera_avalon_jtag_uart_ioctl_fd (alt_fd* fd, int req, void* arg); - -#define ALTERA_AVALON_JTAG_UART_DEV_INSTANCE(name, d) \ - static altera_avalon_jtag_uart_dev d = \ - { \ - { \ - ALT_LLIST_ENTRY, \ - name##_NAME, \ - NULL, /* open */ \ - altera_avalon_jtag_uart_close_fd, \ - altera_avalon_jtag_uart_read_fd, \ - altera_avalon_jtag_uart_write_fd, \ - NULL, /* lseek */ \ - NULL, /* fstat */ \ - altera_avalon_jtag_uart_ioctl_fd, \ - }, \ - { \ - name##_BASE, \ - ALTERA_AVALON_JTAG_UART_DEFAULT_TIMEOUT, \ - } \ - } - -#define ALTERA_AVALON_JTAG_UART_DEV_INIT(name, d) \ - { \ - ALTERA_AVALON_JTAG_UART_STATE_INIT(name, d.state); \ - \ - /* make the device available to the system */ \ - alt_dev_reg(&d.dev); \ - } - -#endif /* ALTERA_AVALON_JTAG_UART_SMALL */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ALT_AVALON_JTAG_UART_FD_H__ */ diff --git a/software/qsys_tutorial_test_bsp/drivers/inc/altera_avalon_jtag_uart_regs.h b/software/qsys_tutorial_test_bsp/drivers/inc/altera_avalon_jtag_uart_regs.h deleted file mode 100644 index 7f97160..0000000 --- a/software/qsys_tutorial_test_bsp/drivers/inc/altera_avalon_jtag_uart_regs.h +++ /dev/null @@ -1,73 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#ifndef __ALTERA_AVALON_JTAG_UART_REGS_H__ -#define __ALTERA_AVALON_JTAG_UART_REGS_H__ - -#include - -#define ALTERA_AVALON_JTAG_UART_DATA_REG 0 -#define IOADDR_ALTERA_AVALON_JTAG_UART_DATA(base) \ - __IO_CALC_ADDRESS_NATIVE(base, ALTERA_AVALON_JTAG_UART_DATA_REG) -#define IORD_ALTERA_AVALON_JTAG_UART_DATA(base) \ - IORD(base, ALTERA_AVALON_JTAG_UART_DATA_REG) -#define IOWR_ALTERA_AVALON_JTAG_UART_DATA(base, data) \ - IOWR(base, ALTERA_AVALON_JTAG_UART_DATA_REG, data) - -#define ALTERA_AVALON_JTAG_UART_DATA_DATA_MSK (0x000000FF) -#define ALTERA_AVALON_JTAG_UART_DATA_DATA_OFST (0) -#define ALTERA_AVALON_JTAG_UART_DATA_RVALID_MSK (0x00008000) -#define ALTERA_AVALON_JTAG_UART_DATA_RVALID_OFST (15) -#define ALTERA_AVALON_JTAG_UART_DATA_RAVAIL_MSK (0xFFFF0000) -#define ALTERA_AVALON_JTAG_UART_DATA_RAVAIL_OFST (16) - - -#define ALTERA_AVALON_JTAG_UART_CONTROL_REG 1 -#define IOADDR_ALTERA_AVALON_JTAG_UART_CONTROL(base) \ - __IO_CALC_ADDRESS_NATIVE(base, ALTERA_AVALON_JTAG_UART_CONTROL_REG) -#define IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base) \ - IORD(base, ALTERA_AVALON_JTAG_UART_CONTROL_REG) -#define IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(base, data) \ - IOWR(base, ALTERA_AVALON_JTAG_UART_CONTROL_REG, data) - -#define ALTERA_AVALON_JTAG_UART_CONTROL_RE_MSK (0x00000001) -#define ALTERA_AVALON_JTAG_UART_CONTROL_RE_OFST (0) -#define ALTERA_AVALON_JTAG_UART_CONTROL_WE_MSK (0x00000002) -#define ALTERA_AVALON_JTAG_UART_CONTROL_WE_OFST (1) -#define ALTERA_AVALON_JTAG_UART_CONTROL_RI_MSK (0x00000100) -#define ALTERA_AVALON_JTAG_UART_CONTROL_RI_OFST (8) -#define ALTERA_AVALON_JTAG_UART_CONTROL_WI_MSK (0x00000200) -#define ALTERA_AVALON_JTAG_UART_CONTROL_WI_OFST (9) -#define ALTERA_AVALON_JTAG_UART_CONTROL_AC_MSK (0x00000400) -#define ALTERA_AVALON_JTAG_UART_CONTROL_AC_OFST (10) -#define ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_MSK (0xFFFF0000) -#define ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_OFST (16) - -#endif /* __ALTERA_AVALON_JTAG_UART_REGS_H__ */ diff --git a/software/qsys_tutorial_test_bsp/drivers/inc/altera_avalon_pio_regs.h b/software/qsys_tutorial_test_bsp/drivers/inc/altera_avalon_pio_regs.h deleted file mode 100644 index 052439f..0000000 --- a/software/qsys_tutorial_test_bsp/drivers/inc/altera_avalon_pio_regs.h +++ /dev/null @@ -1,67 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#ifndef __ALTERA_AVALON_PIO_REGS_H__ -#define __ALTERA_AVALON_PIO_REGS_H__ - -#include - -#define IOADDR_ALTERA_AVALON_PIO_DATA(base) __IO_CALC_ADDRESS_NATIVE(base, 0) -#define IORD_ALTERA_AVALON_PIO_DATA(base) IORD(base, 0) -#define IOWR_ALTERA_AVALON_PIO_DATA(base, data) IOWR(base, 0, data) - -#define IOADDR_ALTERA_AVALON_PIO_DIRECTION(base) __IO_CALC_ADDRESS_NATIVE(base, 1) -#define IORD_ALTERA_AVALON_PIO_DIRECTION(base) IORD(base, 1) -#define IOWR_ALTERA_AVALON_PIO_DIRECTION(base, data) IOWR(base, 1, data) - -#define IOADDR_ALTERA_AVALON_PIO_IRQ_MASK(base) __IO_CALC_ADDRESS_NATIVE(base, 2) -#define IORD_ALTERA_AVALON_PIO_IRQ_MASK(base) IORD(base, 2) -#define IOWR_ALTERA_AVALON_PIO_IRQ_MASK(base, data) IOWR(base, 2, data) - -#define IOADDR_ALTERA_AVALON_PIO_EDGE_CAP(base) __IO_CALC_ADDRESS_NATIVE(base, 3) -#define IORD_ALTERA_AVALON_PIO_EDGE_CAP(base) IORD(base, 3) -#define IOWR_ALTERA_AVALON_PIO_EDGE_CAP(base, data) IOWR(base, 3, data) - - -#define IOADDR_ALTERA_AVALON_PIO_SET_BIT(base) __IO_CALC_ADDRESS_NATIVE(base, 4) -#define IORD_ALTERA_AVALON_PIO_SET_BITS(base) IORD(base, 4) -#define IOWR_ALTERA_AVALON_PIO_SET_BITS(base, data) IOWR(base, 4, data) - -#define IOADDR_ALTERA_AVALON_PIO_CLEAR_BITS(base) __IO_CALC_ADDRESS_NATIVE(base, 5) -#define IORD_ALTERA_AVALON_PIO_CLEAR_BITS(base) IORD(base, 5) -#define IOWR_ALTERA_AVALON_PIO_CLEAR_BITS(base, data) IOWR(base, 5, data) - - - -/* Defintions for direction-register operation with bi-directional PIOs */ -#define ALTERA_AVALON_PIO_DIRECTION_INPUT 0 -#define ALTERA_AVALON_PIO_DIRECTION_OUTPUT 1 - -#endif /* __ALTERA_AVALON_PIO_REGS_H__ */ diff --git a/software/qsys_tutorial_test_bsp/drivers/src/altera_avalon_jtag_uart_fd.c b/software/qsys_tutorial_test_bsp/drivers/src/altera_avalon_jtag_uart_fd.c deleted file mode 100644 index 53dfc3b..0000000 --- a/software/qsys_tutorial_test_bsp/drivers/src/altera_avalon_jtag_uart_fd.c +++ /dev/null @@ -1,86 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include "alt_types.h" -#include "sys/alt_dev.h" -#include "altera_avalon_jtag_uart.h" - -extern int altera_avalon_jtag_uart_read(altera_avalon_jtag_uart_state* sp, - char* buffer, int space, int flags); -extern int altera_avalon_jtag_uart_write(altera_avalon_jtag_uart_state* sp, - const char* ptr, int count, int flags); -extern int altera_avalon_jtag_uart_ioctl(altera_avalon_jtag_uart_state* sp, - int req, void* arg); -extern int altera_avalon_jtag_uart_close(altera_avalon_jtag_uart_state* sp, - int flags); - -/* ----------------------------------------------------------------------- */ -/* --------------------- WRAPPERS FOR ALT FD SUPPORT --------------------- */ -/* - * - */ - -int -altera_avalon_jtag_uart_read_fd(alt_fd* fd, char* buffer, int space) -{ - altera_avalon_jtag_uart_dev* dev = (altera_avalon_jtag_uart_dev*) fd->dev; - - return altera_avalon_jtag_uart_read(&dev->state, buffer, space, - fd->fd_flags); -} - -int -altera_avalon_jtag_uart_write_fd(alt_fd* fd, const char* buffer, int space) -{ - altera_avalon_jtag_uart_dev* dev = (altera_avalon_jtag_uart_dev*) fd->dev; - - return altera_avalon_jtag_uart_write(&dev->state, buffer, space, - fd->fd_flags); -} - -#ifndef ALTERA_AVALON_JTAG_UART_SMALL - -int -altera_avalon_jtag_uart_close_fd(alt_fd* fd) -{ - altera_avalon_jtag_uart_dev* dev = (altera_avalon_jtag_uart_dev*) fd->dev; - - return altera_avalon_jtag_uart_close(&dev->state, fd->fd_flags); -} - -int -altera_avalon_jtag_uart_ioctl_fd(alt_fd* fd, int req, void* arg) -{ - altera_avalon_jtag_uart_dev* dev = (altera_avalon_jtag_uart_dev*) fd->dev; - - return altera_avalon_jtag_uart_ioctl(&dev->state, req, arg); -} - -#endif /* ALTERA_AVALON_JTAG_UART_SMALL */ diff --git a/software/qsys_tutorial_test_bsp/drivers/src/altera_avalon_jtag_uart_init.c b/software/qsys_tutorial_test_bsp/drivers/src/altera_avalon_jtag_uart_init.c deleted file mode 100644 index 7317bec..0000000 --- a/software/qsys_tutorial_test_bsp/drivers/src/altera_avalon_jtag_uart_init.c +++ /dev/null @@ -1,256 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2007 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include -#include -#include -#include - -#include - -#include "sys/alt_irq.h" -#include "sys/alt_alarm.h" -#include "sys/ioctl.h" -#include "alt_types.h" - -#include "altera_avalon_jtag_uart_regs.h" -#include "altera_avalon_jtag_uart.h" - -#include "sys/alt_log_printf.h" - -#ifndef ALTERA_AVALON_JTAG_UART_SMALL - -/* ----------------------------------------------------------- */ -/* ------------------------- FAST DRIVER --------------------- */ -/* ----------------------------------------------------------- */ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT -static void altera_avalon_jtag_uart_irq(void* context); -#else -static void altera_avalon_jtag_uart_irq(void* context, alt_u32 id); -#endif -static alt_u32 altera_avalon_jtag_uart_timeout(void* context); - -/* - * Driver initialization code. Register interrupts and start a timer - * which we can use to check whether the host is there. - * Return 1 on sucessful IRQ register and 0 on failure. - */ - -void altera_avalon_jtag_uart_init(altera_avalon_jtag_uart_state* sp, - int irq_controller_id, int irq) -{ - ALT_FLAG_CREATE(&sp->events, 0); - ALT_SEM_CREATE(&sp->read_lock, 1); - ALT_SEM_CREATE(&sp->write_lock, 1); - - /* enable read interrupts at the device */ - sp->irq_enable = ALTERA_AVALON_JTAG_UART_CONTROL_RE_MSK; - - IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base, sp->irq_enable); - - /* register the interrupt handler */ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT - alt_ic_isr_register(irq_controller_id, irq, altera_avalon_jtag_uart_irq, - sp, NULL); -#else - alt_irq_register(irq, sp, altera_avalon_jtag_uart_irq); -#endif - - /* Register an alarm to go off every second to check for presence of host */ - sp->host_inactive = 0; - - if (alt_alarm_start(&sp->alarm, alt_ticks_per_second(), - &altera_avalon_jtag_uart_timeout, sp) < 0) - { - /* If we can't set the alarm then record "don't know if host present" - * and behave as though the host is present. - */ - sp->timeout = INT_MAX; - } - - /* ALT_LOG - see altera_hal/HAL/inc/sys/alt_log_printf.h */ - ALT_LOG_JTAG_UART_ALARM_REGISTER(sp, sp->base); -} - -/* - * Interrupt routine - */ -#ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT -static void altera_avalon_jtag_uart_irq(void* context) -#else -static void altera_avalon_jtag_uart_irq(void* context, alt_u32 id) -#endif -{ - altera_avalon_jtag_uart_state* sp = (altera_avalon_jtag_uart_state*) context; - unsigned int base = sp->base; - - /* ALT_LOG - see altera_hal/HAL/inc/sys/alt_log_printf.h */ - ALT_LOG_JTAG_UART_ISR_FUNCTION(base, sp); - - for ( ; ; ) - { - unsigned int control = IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base); - - /* Return once nothing more to do */ - if ((control & (ALTERA_AVALON_JTAG_UART_CONTROL_RI_MSK | ALTERA_AVALON_JTAG_UART_CONTROL_WI_MSK)) == 0) - break; - - if (control & ALTERA_AVALON_JTAG_UART_CONTROL_RI_MSK) - { - /* process a read irq. Start by assuming that there is data in the - * receive FIFO (otherwise why would we have been interrupted?) - */ - unsigned int data = 1 << ALTERA_AVALON_JTAG_UART_DATA_RAVAIL_OFST; - - for ( ; ; ) - { - /* Check whether there is space in the buffer. If not then we must not - * read any characters from the buffer as they will be lost. - */ - unsigned int next = (sp->rx_in + 1) % ALTERA_AVALON_JTAG_UART_BUF_LEN; - if (next == sp->rx_out) - break; - - /* Try to remove a character from the FIFO and find out whether there - * are any more characters remaining. - */ - data = IORD_ALTERA_AVALON_JTAG_UART_DATA(base); - - if ((data & ALTERA_AVALON_JTAG_UART_DATA_RVALID_MSK) == 0) - break; - - sp->rx_buf[sp->rx_in] = (data & ALTERA_AVALON_JTAG_UART_DATA_DATA_MSK) >> ALTERA_AVALON_JTAG_UART_DATA_DATA_OFST; - sp->rx_in = (sp->rx_in + 1) % ALTERA_AVALON_JTAG_UART_BUF_LEN; - - /* Post an event to notify jtag_uart_read that a character has been read */ - ALT_FLAG_POST (sp->events, ALT_JTAG_UART_READ_RDY, OS_FLAG_SET); - } - - if (data & ALTERA_AVALON_JTAG_UART_DATA_RAVAIL_MSK) - { - /* If there is still data available here then the buffer is full - * so turn off receive interrupts until some space becomes available. - */ - sp->irq_enable &= ~ALTERA_AVALON_JTAG_UART_CONTROL_RE_MSK; - IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(base, sp->irq_enable); - - /* Dummy read to ensure IRQ is cleared prior to ISR completion */ - IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base); - } - } - - if (control & ALTERA_AVALON_JTAG_UART_CONTROL_WI_MSK) - { - /* process a write irq */ - unsigned int space = (control & ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_MSK) >> ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_OFST; - - while (space > 0 && sp->tx_out != sp->tx_in) - { - IOWR_ALTERA_AVALON_JTAG_UART_DATA(base, sp->tx_buf[sp->tx_out]); - - sp->tx_out = (sp->tx_out + 1) % ALTERA_AVALON_JTAG_UART_BUF_LEN; - - /* Post an event to notify jtag_uart_write that a character has been written */ - ALT_FLAG_POST (sp->events, ALT_JTAG_UART_WRITE_RDY, OS_FLAG_SET); - - space--; - } - - if (space > 0) - { - /* If we don't have any more data available then turn off the TX interrupt */ - sp->irq_enable &= ~ALTERA_AVALON_JTAG_UART_CONTROL_WE_MSK; - IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base, sp->irq_enable); - - /* Dummy read to ensure IRQ is cleared prior to ISR completion */ - IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base); - } - } - } -} - -/* - * Timeout routine is called every second - */ - -static alt_u32 -altera_avalon_jtag_uart_timeout(void* context) -{ - altera_avalon_jtag_uart_state* sp = (altera_avalon_jtag_uart_state *) context; - - unsigned int control = IORD_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base); - - if (control & ALTERA_AVALON_JTAG_UART_CONTROL_AC_MSK) - { - IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base, sp->irq_enable | ALTERA_AVALON_JTAG_UART_CONTROL_AC_MSK); - sp->host_inactive = 0; - } - else if (sp->host_inactive < INT_MAX - 2) { - sp->host_inactive++; - - if (sp->host_inactive >= sp->timeout) { - /* Post an event to indicate host is inactive (for jtag_uart_read */ - ALT_FLAG_POST (sp->events, ALT_JTAG_UART_TIMEOUT, OS_FLAG_SET); - } - } - - return alt_ticks_per_second(); -} - -/* - * The close() routine is implemented to drain the JTAG UART transmit buffer - * when not in "small" mode. This routine will wait for transimt data to be - * emptied unless a timeout from host-activity occurs. If the driver flags - * have been set to non-blocking mode, this routine will exit immediately if - * any data remains. This routine should be called indirectly (i.e. though - * the C library close() routine) so that the file descriptor associated - * with the relevant stream (i.e. stdout) can be closed as well. This routine - * does not manage file descriptors. - * - * The close routine is not implemented for the small driver; instead it will - * map to null. This is because the small driver simply waits while characters - * are transmitted; there is no interrupt-serviced buffer to empty - */ -int altera_avalon_jtag_uart_close(altera_avalon_jtag_uart_state* sp, int flags) -{ - /* - * Wait for all transmit data to be emptied by the JTAG UART ISR, or - * for a host-inactivity timeout, in which case transmit data will be lost - */ - while ( (sp->tx_out != sp->tx_in) && (sp->host_inactive < sp->timeout) ) { - if (flags & O_NONBLOCK) { - return -EWOULDBLOCK; - } - } - - return 0; -} - -#endif /* !ALTERA_AVALON_JTAG_UART_SMALL */ diff --git a/software/qsys_tutorial_test_bsp/drivers/src/altera_avalon_jtag_uart_ioctl.c b/software/qsys_tutorial_test_bsp/drivers/src/altera_avalon_jtag_uart_ioctl.c deleted file mode 100644 index cf71e6f..0000000 --- a/software/qsys_tutorial_test_bsp/drivers/src/altera_avalon_jtag_uart_ioctl.c +++ /dev/null @@ -1,86 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include -#include -#include -#include - -#include - -#include "sys/ioctl.h" -#include "alt_types.h" - -#include "altera_avalon_jtag_uart_regs.h" -#include "altera_avalon_jtag_uart.h" - -#include "sys/alt_log_printf.h" - -#ifndef ALTERA_AVALON_JTAG_UART_SMALL - -/* ----------------------------------------------------------- */ -/* ------------------------- FAST DRIVER --------------------- */ -/* ----------------------------------------------------------- */ - -int -altera_avalon_jtag_uart_ioctl(altera_avalon_jtag_uart_state* sp, int req, - void* arg) -{ - int rc = -ENOTTY; - - switch (req) - { - case TIOCSTIMEOUT: - /* Set the time to wait until assuming host is not connected */ - if (sp->timeout != INT_MAX) - { - int timeout = *((int *)arg); - sp->timeout = (timeout >= 2 && timeout < INT_MAX) ? timeout : INT_MAX - 1; - rc = 0; - } - break; - - case TIOCGCONNECTED: - /* Find out whether host is connected */ - if (sp->timeout != INT_MAX) - { - *((int *)arg) = (sp->host_inactive < sp->timeout) ? 1 : 0; - rc = 0; - } - break; - - default: - break; - } - - return rc; -} - -#endif /* !ALTERA_AVALON_JTAG_UART_SMALL */ diff --git a/software/qsys_tutorial_test_bsp/drivers/src/altera_avalon_jtag_uart_read.c b/software/qsys_tutorial_test_bsp/drivers/src/altera_avalon_jtag_uart_read.c deleted file mode 100644 index 5657adb..0000000 --- a/software/qsys_tutorial_test_bsp/drivers/src/altera_avalon_jtag_uart_read.c +++ /dev/null @@ -1,205 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include -#include -#include -#include - -#include - -#include "sys/alt_irq.h" -#include "sys/alt_alarm.h" -#include "sys/ioctl.h" -#include "alt_types.h" - -#include "altera_avalon_jtag_uart_regs.h" -#include "altera_avalon_jtag_uart.h" - -#include "sys/alt_log_printf.h" - -#ifdef __ucosii__ -#include "includes.h" -#endif /* __ucosii__ */ - -#ifdef ALTERA_AVALON_JTAG_UART_SMALL - -/* ----------------------------------------------------------- */ -/* ----------------------- SMALL DRIVER ---------------------- */ -/* ----------------------------------------------------------- */ - -/* Read routine. The small version blocks until it has at least one byte - * available, it then returns as much as is immediately available without - * waiting any more. It's performance will be very poor without - * interrupts. - */ - -int -altera_avalon_jtag_uart_read(altera_avalon_jtag_uart_state* sp, - char* buffer, int space, int flags) -{ - unsigned int base = sp->base; - - char * ptr = buffer; - char * end = buffer + space; - - while (ptr < end) - { - unsigned int data = IORD_ALTERA_AVALON_JTAG_UART_DATA(base); - - if (data & ALTERA_AVALON_JTAG_UART_DATA_RVALID_MSK) - *ptr++ = (data & ALTERA_AVALON_JTAG_UART_DATA_DATA_MSK) >> ALTERA_AVALON_JTAG_UART_DATA_DATA_OFST; - else if (ptr != buffer) - break; - else if(flags & O_NONBLOCK) - break; - - } - - if (ptr != buffer) - return ptr - buffer; - else if (flags & O_NONBLOCK) - return -EWOULDBLOCK; - else - return -EIO; -} - -#else /* !ALTERA_AVALON_JTAG_UART_SMALL */ - -/* ----------------------------------------------------------- */ -/* ----------------------- FAST DRIVER ----------------------- */ -/* ----------------------------------------------------------- */ - -int -altera_avalon_jtag_uart_read(altera_avalon_jtag_uart_state* sp, - char * buffer, int space, int flags) -{ - char * ptr = buffer; - - alt_irq_context context; - unsigned int n; - - /* - * When running in a multi threaded environment, obtain the "read_lock" - * semaphore. This ensures that reading from the device is thread-safe. - */ - ALT_SEM_PEND (sp->read_lock, 0); - - while (space > 0) - { - unsigned int in, out; - - /* Read as much data as possible */ - do - { - in = sp->rx_in; - out = sp->rx_out; - - if (in >= out) - n = in - out; - else - n = ALTERA_AVALON_JTAG_UART_BUF_LEN - out; - - if (n == 0) - break; /* No more data available */ - - if (n > space) - n = space; - - memcpy(ptr, sp->rx_buf + out, n); - ptr += n; - space -= n; - - sp->rx_out = (out + n) % ALTERA_AVALON_JTAG_UART_BUF_LEN; - } - while (space > 0); - - /* If we read any data then return it */ - if (ptr != buffer) - break; - - /* If in non-blocking mode then return error */ - if (flags & O_NONBLOCK) - break; - -#ifdef __ucosii__ - /* OS Present: Pend on a flag if the OS is running, otherwise spin */ - if(OSRunning == OS_TRUE) { - /* - * When running in a multi-threaded mode, we pend on the read event - * flag set and timeout event flag set in the isr. This avoids wasting CPU - * cycles waiting in this thread, when we could be doing something more - * profitable elsewhere. - */ - ALT_FLAG_PEND (sp->events, - ALT_JTAG_UART_READ_RDY | ALT_JTAG_UART_TIMEOUT, - OS_FLAG_WAIT_SET_ANY + OS_FLAG_CONSUME, - 0); - } - else { - /* Spin until more data arrives or until host disconnects */ - while (in == sp->rx_in && sp->host_inactive < sp->timeout) - ; - } -#else - /* No OS: Always spin */ - while (in == sp->rx_in && sp->host_inactive < sp->timeout) - ; -#endif /* __ucosii__ */ - - if (in == sp->rx_in) - break; - } - - /* - * Now that access to the circular buffer is complete, release the read - * semaphore so that other threads can access the buffer. - */ - - ALT_SEM_POST (sp->read_lock); - - if (ptr != buffer) - { - /* If we read any data then there is space in the buffer so enable interrupts */ - context = alt_irq_disable_all(); - sp->irq_enable |= ALTERA_AVALON_JTAG_UART_CONTROL_RE_MSK; - IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base, sp->irq_enable); - alt_irq_enable_all(context); - } - - if (ptr != buffer) - return ptr - buffer; - else if (flags & O_NONBLOCK) - return -EWOULDBLOCK; - else - return -EIO; -} - -#endif /* ALTERA_AVALON_JTAG_UART_SMALL */ diff --git a/software/qsys_tutorial_test_bsp/drivers/src/altera_avalon_jtag_uart_write.c b/software/qsys_tutorial_test_bsp/drivers/src/altera_avalon_jtag_uart_write.c deleted file mode 100644 index 11aeca1..0000000 --- a/software/qsys_tutorial_test_bsp/drivers/src/altera_avalon_jtag_uart_write.c +++ /dev/null @@ -1,217 +0,0 @@ -/****************************************************************************** -* * -* License Agreement * -* * -* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. * -* All rights reserved. * -* * -* 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. * -* * -* This agreement shall be governed in all respects by the laws of the State * -* of California and by the laws of the United States of America. * -* * -******************************************************************************/ - -#include -#include -#include -#include - -#include - -#include "sys/alt_irq.h" -#include "sys/alt_alarm.h" -#include "sys/ioctl.h" -#include "alt_types.h" - -#include "altera_avalon_jtag_uart_regs.h" -#include "altera_avalon_jtag_uart.h" - -#include "sys/alt_log_printf.h" - -#ifdef __ucosii__ -#include "includes.h" -#endif /* __ucosii__ */ - -#ifdef ALTERA_AVALON_JTAG_UART_SMALL - -/* ----------------------------------------------------------- */ -/* ------------------------ SMALL DRIVER --------------------- */ -/* ----------------------------------------------------------- */ - -/* Write routine. The small version blocks when there is no space to write - * into, so it's performance will be very bad if you are writing more than - * one FIFOs worth of data. But you said you didn't want to use interrupts :-) - */ - -int altera_avalon_jtag_uart_write(altera_avalon_jtag_uart_state* sp, - const char * ptr, int count, int flags) -{ - unsigned int base = sp->base; - - const char * end = ptr + count; - - while (ptr < end) - if ((IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base) & ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_MSK) != 0) - IOWR_ALTERA_AVALON_JTAG_UART_DATA(base, *ptr++); - - return count; -} - -#else /* !ALTERA_AVALON_JTAG_UART_SMALL */ - -/* ----------------------------------------------------------- */ -/* ------------------------- FAST DRIVER --------------------- */ -/* ----------------------------------------------------------- */ - -int -altera_avalon_jtag_uart_write(altera_avalon_jtag_uart_state* sp, - const char * ptr, int count, int flags) -{ - /* Remove warning at optimisation level 03 by seting out to 0 */ - unsigned int in, out=0; - unsigned int n; - alt_irq_context context; - - const char * start = ptr; - - /* - * When running in a multi threaded environment, obtain the "write_lock" - * semaphore. This ensures that writing to the device is thread-safe. - */ - ALT_SEM_PEND (sp->write_lock, 0); - - do - { - /* Copy as much as we can into the transmit buffer */ - while (count > 0) - { - /* We need a stable value of the out pointer to calculate the space available */ - in = sp->tx_in; - out = sp->tx_out; - - if (in < out) - n = out - 1 - in; - else if (out > 0) - n = ALTERA_AVALON_JTAG_UART_BUF_LEN - in; - else - n = ALTERA_AVALON_JTAG_UART_BUF_LEN - 1 - in; - - if (n == 0) - break; - - if (n > count) - n = count; - - memcpy(sp->tx_buf + in, ptr, n); - ptr += n; - count -= n; - - sp->tx_in = (in + n) % ALTERA_AVALON_JTAG_UART_BUF_LEN; - } - - /* - * If interrupts are disabled then we could transmit here, we only need - * to enable interrupts if there is no space left in the FIFO - * - * For now kick the interrupt routine every time to make it transmit - * the data - */ - context = alt_irq_disable_all(); - sp->irq_enable |= ALTERA_AVALON_JTAG_UART_CONTROL_WE_MSK; - IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base, sp->irq_enable); - alt_irq_enable_all(context); - - /* - * If there is any data left then either return now or block until - * some has been sent - */ - /* consider: test whether there is anything there while doing this and delay for at most 2s. */ - if (count > 0) - { - if (flags & O_NONBLOCK) - break; - -#ifdef __ucosii__ - /* OS Present: Pend on a flag if the OS is running, otherwise spin */ - if(OSRunning == OS_TRUE) { - /* - * When running in a multi-threaded mode, we pend on the write event - * flag set or the timeout flag in the isr. This avoids wasting CPU - * cycles waiting in this thread, when we could be doing something - * more profitable elsewhere. - */ -#ifdef ALTERA_AVALON_JTAG_UART_IGNORE_FIFO_FULL_ERROR - if(!sp->host_inactive) -#endif - ALT_FLAG_PEND (sp->events, - ALT_JTAG_UART_WRITE_RDY | ALT_JTAG_UART_TIMEOUT, - OS_FLAG_WAIT_SET_ANY + OS_FLAG_CONSUME, - 0); - } - else { - /* - * OS not running: Wait for data to be removed from buffer. - * Once the interrupt routine has removed some data then we - * will be able to insert some more. - */ - while (out == sp->tx_out && sp->host_inactive < sp->timeout) - ; - } -#else - /* - * No OS present: Always wait for data to be removed from buffer. Once - * the interrupt routine has removed some data then we will be able to - * insert some more. - */ - while (out == sp->tx_out && sp->host_inactive < sp->timeout) - ; -#endif /* __ucosii__ */ - - if (out == sp->tx_out) - break; - } - } - while (count > 0); - - /* - * Now that access to the circular buffer is complete, release the write - * semaphore so that other threads can access the buffer. - */ - ALT_SEM_POST (sp->write_lock); - - if (ptr != start) - return ptr - start; - else if (flags & O_NONBLOCK) - return -EWOULDBLOCK; -#ifdef ALTERA_AVALON_JTAG_UART_IGNORE_FIFO_FULL_ERROR - else if (sp->host_inactive >= sp->timeout) { - /* - * Reset the software FIFO, hardware FIFO could not be reset. - * Just throw away characters without reporting error. - */ - sp->tx_out = sp->tx_in = 0; - return ptr - start + count; - } -#endif - else - return -EIO; /* Host not connected */ -} - -#endif /* ALTERA_AVALON_JTAG_UART_SMALL */ diff --git a/software/qsys_tutorial_test_bsp/libhal_bsp.a b/software/qsys_tutorial_test_bsp/libhal_bsp.a deleted file mode 100644 index 075bae5..0000000 --- a/software/qsys_tutorial_test_bsp/libhal_bsp.a +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/linker.h b/software/qsys_tutorial_test_bsp/linker.h deleted file mode 100644 index f9dcf76..0000000 --- a/software/qsys_tutorial_test_bsp/linker.h +++ /dev/null @@ -1,101 +0,0 @@ -/* - * linker.h - Linker script mapping information - * - * Machine generated for CPU 'nios2_processor' in SOPC Builder design 'nios_system' - * SOPC Builder design path: C:/Users/takayun/Desktop/qsys_tutorial/nios_system.sopcinfo - * - * Generated: Thu Oct 27 09:21:11 JST 2016 - */ - -/* - * DO NOT MODIFY THIS FILE - * - * Changing this file will have subtle consequences - * which will almost certainly lead to a nonfunctioning - * system. If you do modify this file, be aware that your - * changes will be overwritten and lost when this file - * is generated again. - * - * DO NOT MODIFY THIS FILE - */ - -/* - * License Agreement - * - * Copyright (c) 2008 - * Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - * - * This agreement shall be governed in all respects by the laws of the State - * of California and by the laws of the United States of America. - */ - -#ifndef __LINKER_H_ -#define __LINKER_H_ - - -/* - * BSP controls alt_load() behavior in crt0. - * - */ - -#define ALT_LOAD_EXPLICITLY_CONTROLLED - - -/* - * Base address and span (size in bytes) of each linker region - * - */ - -#define ONCHIP_MEMORY_REGION_BASE 0x20 -#define ONCHIP_MEMORY_REGION_SPAN 4064 -#define RESET_REGION_BASE 0x0 -#define RESET_REGION_SPAN 32 - - -/* - * Devices associated with code sections - * - */ - -#define ALT_EXCEPTIONS_DEVICE ONCHIP_MEMORY -#define ALT_RESET_DEVICE ONCHIP_MEMORY -#define ALT_RODATA_DEVICE ONCHIP_MEMORY -#define ALT_RWDATA_DEVICE ONCHIP_MEMORY -#define ALT_TEXT_DEVICE ONCHIP_MEMORY - - -/* - * Initialization code at the reset address is allowed (e.g. no external bootloader). - * - */ - -#define ALT_ALLOW_CODE_AT_RESET - - -/* - * The alt_load() facility is called from crt0 to copy sections into RAM. - * - */ - -#define ALT_LOAD_COPY_RWDATA - -#endif /* __LINKER_H_ */ diff --git a/software/qsys_tutorial_test_bsp/linker.x b/software/qsys_tutorial_test_bsp/linker.x deleted file mode 100644 index 372d4c8..0000000 --- a/software/qsys_tutorial_test_bsp/linker.x +++ /dev/null @@ -1,385 +0,0 @@ -/* - * linker.x - Linker script - * - * Machine generated for CPU 'nios2_processor' in SOPC Builder design 'nios_system' - * SOPC Builder design path: C:/Users/takayun/Desktop/qsys_tutorial/nios_system.sopcinfo - * - * Generated: Thu Oct 27 09:21:11 JST 2016 - */ - -/* - * DO NOT MODIFY THIS FILE - * - * Changing this file will have subtle consequences - * which will almost certainly lead to a nonfunctioning - * system. If you do modify this file, be aware that your - * changes will be overwritten and lost when this file - * is generated again. - * - * DO NOT MODIFY THIS FILE - */ - -/* - * License Agreement - * - * Copyright (c) 2008 - * Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - * - * This agreement shall be governed in all respects by the laws of the State - * of California and by the laws of the United States of America. - */ - -MEMORY -{ - reset : ORIGIN = 0x0, LENGTH = 32 - onchip_memory : ORIGIN = 0x20, LENGTH = 4064 -} - -/* Define symbols for each memory base-address */ -__alt_mem_onchip_memory = 0x0; - -OUTPUT_FORMAT( "elf32-littlenios2", - "elf32-littlenios2", - "elf32-littlenios2" ) -OUTPUT_ARCH( nios2 ) -ENTRY( _start ) - -/* - * The alt_load() facility is enabled. This typically happens when there isn't - * an external bootloader (e.g. flash bootloader). - * The LMA (aka physical address) of each loaded section is - * set to the .text memory device. - * The HAL alt_load() routine called from crt0 copies sections from - * the .text memory to RAM as needed. - */ - -SECTIONS -{ - - /* - * Output sections associated with reset and exceptions (they have to be first) - */ - - .entry : - { - KEEP (*(.entry)) - } > reset - - .exceptions : - { - PROVIDE (__ram_exceptions_start = ABSOLUTE(.)); - . = ALIGN(0x20); - KEEP (*(.irq)); - KEEP (*(.exceptions.entry.label)); - KEEP (*(.exceptions.entry.user)); - KEEP (*(.exceptions.entry)); - KEEP (*(.exceptions.irqtest.user)); - KEEP (*(.exceptions.irqtest)); - KEEP (*(.exceptions.irqhandler.user)); - KEEP (*(.exceptions.irqhandler)); - KEEP (*(.exceptions.irqreturn.user)); - KEEP (*(.exceptions.irqreturn)); - KEEP (*(.exceptions.notirq.label)); - KEEP (*(.exceptions.notirq.user)); - KEEP (*(.exceptions.notirq)); - KEEP (*(.exceptions.soft.user)); - KEEP (*(.exceptions.soft)); - KEEP (*(.exceptions.unknown.user)); - KEEP (*(.exceptions.unknown)); - KEEP (*(.exceptions.exit.label)); - KEEP (*(.exceptions.exit.user)); - KEEP (*(.exceptions.exit)); - KEEP (*(.exceptions)); - PROVIDE (__ram_exceptions_end = ABSOLUTE(.)); - } > onchip_memory - - PROVIDE (__flash_exceptions_start = LOADADDR(.exceptions)); - - .text : - { - /* - * All code sections are merged into the text output section, along with - * the read only data sections. - * - */ - - PROVIDE (stext = ABSOLUTE(.)); - - *(.interp) - *(.hash) - *(.dynsym) - *(.dynstr) - *(.gnu.version) - *(.gnu.version_d) - *(.gnu.version_r) - *(.rel.init) - *(.rela.init) - *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) - *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) - *(.rel.fini) - *(.rela.fini) - *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) - *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) - *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) - *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) - *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) - *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) - *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) - *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) - *(.rel.ctors) - *(.rela.ctors) - *(.rel.dtors) - *(.rela.dtors) - *(.rel.got) - *(.rela.got) - *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) - *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) - *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) - *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) - *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) - *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) - *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) - *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) - *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) - *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) - *(.rel.plt) - *(.rela.plt) - *(.rel.dyn) - - KEEP (*(.init)) - *(.plt) - *(.text .stub .text.* .gnu.linkonce.t.*) - - /* .gnu.warning sections are handled specially by elf32.em. */ - - *(.gnu.warning.*) - KEEP (*(.fini)) - PROVIDE (__etext = ABSOLUTE(.)); - PROVIDE (_etext = ABSOLUTE(.)); - PROVIDE (etext = ABSOLUTE(.)); - - *(.eh_frame_hdr) - /* Ensure the __preinit_array_start label is properly aligned. We - could instead move the label definition inside the section, but - the linker would then create the section even if it turns out to - be empty, which isn't pretty. */ - . = ALIGN(4); - PROVIDE (__preinit_array_start = ABSOLUTE(.)); - *(.preinit_array) - PROVIDE (__preinit_array_end = ABSOLUTE(.)); - PROVIDE (__init_array_start = ABSOLUTE(.)); - *(.init_array) - PROVIDE (__init_array_end = ABSOLUTE(.)); - PROVIDE (__fini_array_start = ABSOLUTE(.)); - *(.fini_array) - PROVIDE (__fini_array_end = ABSOLUTE(.)); - SORT(CONSTRUCTORS) - KEEP (*(.eh_frame)) - *(.gcc_except_table) - *(.dynamic) - PROVIDE (__CTOR_LIST__ = ABSOLUTE(.)); - KEEP (*(.ctors)) - KEEP (*(SORT(.ctors.*))) - PROVIDE (__CTOR_END__ = ABSOLUTE(.)); - PROVIDE (__DTOR_LIST__ = ABSOLUTE(.)); - KEEP (*(.dtors)) - KEEP (*(SORT(.dtors.*))) - PROVIDE (__DTOR_END__ = ABSOLUTE(.)); - KEEP (*(.jcr)) - . = ALIGN(4); - } > onchip_memory = 0x3a880100 /* Nios II NOP instruction */ - - .rodata : - { - PROVIDE (__ram_rodata_start = ABSOLUTE(.)); - . = ALIGN(4); - *(.rodata .rodata.* .gnu.linkonce.r.*) - *(.rodata1) - . = ALIGN(4); - PROVIDE (__ram_rodata_end = ABSOLUTE(.)); - } > onchip_memory - - PROVIDE (__flash_rodata_start = LOADADDR(.rodata)); - - /* - * - * This section's LMA is set to the .text region. - * crt0 will copy to this section's specified mapped region virtual memory address (VMA) - * - * .rwdata region equals the .text region, and is set to be loaded into .text region. - * This requires two copies of .rwdata in the .text region. One read writable at VMA. - * and one read-only at LMA. crt0 will copy from LMA to VMA on reset - * - */ - - .rwdata LOADADDR (.rodata) + SIZEOF (.rodata) : AT ( LOADADDR (.rodata) + SIZEOF (.rodata)+ SIZEOF (.rwdata) ) - { - PROVIDE (__ram_rwdata_start = ABSOLUTE(.)); - . = ALIGN(4); - *(.got.plt) *(.got) - *(.data1) - *(.data .data.* .gnu.linkonce.d.*) - - _gp = ABSOLUTE(. + 0x8000); - PROVIDE(gp = _gp); - - *(.rwdata .rwdata.*) - *(.sdata .sdata.* .gnu.linkonce.s.*) - *(.sdata2 .sdata2.* .gnu.linkonce.s2.*) - - . = ALIGN(4); - _edata = ABSOLUTE(.); - PROVIDE (edata = ABSOLUTE(.)); - PROVIDE (__ram_rwdata_end = ABSOLUTE(.)); - } > onchip_memory - - PROVIDE (__flash_rwdata_start = LOADADDR(.rwdata)); - - /* - * - * This section's LMA is set to the .text region. - * crt0 will copy to this section's specified mapped region virtual memory address (VMA) - * - */ - - .bss LOADADDR (.rwdata) + SIZEOF (.rwdata) : AT ( LOADADDR (.rwdata) + SIZEOF (.rwdata) ) - { - __bss_start = ABSOLUTE(.); - PROVIDE (__sbss_start = ABSOLUTE(.)); - PROVIDE (___sbss_start = ABSOLUTE(.)); - - *(.dynsbss) - *(.sbss .sbss.* .gnu.linkonce.sb.*) - *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) - *(.scommon) - - PROVIDE (__sbss_end = ABSOLUTE(.)); - PROVIDE (___sbss_end = ABSOLUTE(.)); - - *(.dynbss) - *(.bss .bss.* .gnu.linkonce.b.*) - *(COMMON) - - . = ALIGN(4); - __bss_end = ABSOLUTE(.); - } > onchip_memory - - /* - * - * One output section mapped to the associated memory device for each of - * the available memory devices. These are not used by default, but can - * be used by user applications by using the .section directive. - * - * The output section used for the heap is treated in a special way, - * i.e. the symbols "end" and "_end" are added to point to the heap start. - * - * Because alt_load() is enabled, these sections have - * their LMA set to be loaded into the .text memory region. - * However, the alt_load() code will NOT automatically copy - * these sections into their mapped memory region. - * - */ - - /* - * - * This section's LMA is set to the .text region. - * crt0 will copy to this section's specified mapped region virtual memory address (VMA) - * - */ - - .onchip_memory LOADADDR (.bss) + SIZEOF (.bss) : AT ( LOADADDR (.bss) + SIZEOF (.bss) ) - { - PROVIDE (_alt_partition_onchip_memory_start = ABSOLUTE(.)); - *(.onchip_memory. onchip_memory.*) - . = ALIGN(4); - PROVIDE (_alt_partition_onchip_memory_end = ABSOLUTE(.)); - _end = ABSOLUTE(.); - end = ABSOLUTE(.); - __alt_stack_base = ABSOLUTE(.); - } > onchip_memory - - PROVIDE (_alt_partition_onchip_memory_load_addr = LOADADDR(.onchip_memory)); - - /* - * Stabs debugging sections. - * - */ - - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - /* DWARF debug sections. - Symbols in the DWARF debugging sections are relative to the beginning - of the section so we begin them at 0. */ - /* DWARF 1 */ - .debug 0 : { *(.debug) } - .line 0 : { *(.line) } - /* GNU DWARF 1 extensions */ - .debug_srcinfo 0 : { *(.debug_srcinfo) } - .debug_sfnames 0 : { *(.debug_sfnames) } - /* DWARF 1.1 and DWARF 2 */ - .debug_aranges 0 : { *(.debug_aranges) } - .debug_pubnames 0 : { *(.debug_pubnames) } - /* DWARF 2 */ - .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_line 0 : { *(.debug_line) } - .debug_frame 0 : { *(.debug_frame) } - .debug_str 0 : { *(.debug_str) } - .debug_loc 0 : { *(.debug_loc) } - .debug_macinfo 0 : { *(.debug_macinfo) } - /* SGI/MIPS DWARF 2 extensions */ - .debug_weaknames 0 : { *(.debug_weaknames) } - .debug_funcnames 0 : { *(.debug_funcnames) } - .debug_typenames 0 : { *(.debug_typenames) } - .debug_varnames 0 : { *(.debug_varnames) } - - /* Altera debug extensions */ - .debug_alt_sim_info 0 : { *(.debug_alt_sim_info) } -} - -/* provide a pointer for the stack */ - -/* - * Don't override this, override the __alt_stack_* symbols instead. - */ -__alt_data_end = 0x1000; - -/* - * The next two symbols define the location of the default stack. You can - * override them to move the stack to a different memory. - */ -PROVIDE( __alt_stack_pointer = __alt_data_end ); -PROVIDE( __alt_stack_limit = __alt_stack_base ); - -/* - * This symbol controls where the start of the heap is. If the stack is - * contiguous with the heap then the stack will contract as memory is - * allocated to the heap. - * Override this symbol to put the heap in a different memory. - */ -PROVIDE( __alt_heap_start = end ); -PROVIDE( __alt_heap_limit = 0x1000 ); diff --git a/software/qsys_tutorial_test_bsp/mem_init.mk b/software/qsys_tutorial_test_bsp/mem_init.mk deleted file mode 100644 index 4caaef9..0000000 --- a/software/qsys_tutorial_test_bsp/mem_init.mk +++ /dev/null @@ -1,322 +0,0 @@ - -######################################################################### -####### M E M I N I T M A K E F I L E C O N T E N T ###### -######################################################################### - -######################################################################### -# This file is intended to be included by public.mk -# -# -# The following variables must be defined before including this file: -# - ELF -# -# The following variables may be defined to override the default behavior: -# - HDL_SIM_DIR -# - HDL_SIM_INSTALL_DIR -# - MEM_INIT_DIR -# - MEM_INIT_INSTALL_DIR -# - QUARTUS_PROJECT_DIR -# - SOPC_NAME -# - SIM_OPTIMIZE -# - RESET_ADDRESS -# -######################################################################### - -ifeq ($(MEM_INIT_FILE),) -# MEM_INIT_FILE should be set equal to the working relative path to this -# mem_init.mk makefile fragment -MEM_INIT_FILE := $(wildcard $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))) -endif - -ifeq ($(ELF2DAT),) -ELF2DAT := elf2dat -endif - -ifeq ($(ELF2HEX),) -ELF2HEX := elf2hex -endif - -ifeq ($(ELF2FLASH),) -ELF2FLASH := elf2flash -endif - -ifeq ($(FLASH2DAT),) -FLASH2DAT := flash2dat -endif - -ifeq ($(NM),) -NM := nios2-elf-nm -endif - -ifeq ($(MKDIR),) -MKDIR := mkdir -p -endif - -ifeq ($(RM),) -RM := rm -f -endif - -ifeq ($(CP),) -CP := cp -endif - -ifeq ($(ECHO),) -ECHO := echo -endif - -MEM_INIT_DIR ?= mem_init -HDL_SIM_DIR ?= $(MEM_INIT_DIR)/hdl_sim - -ifdef QUARTUS_PROJECT_DIR -MEM_INIT_INSTALL_DIR ?= $(patsubst %/,%,$(QUARTUS_PROJECT_DIR)) -ifdef SOPC_NAME -HDL_SIM_INSTALL_DIR ?= $(patsubst %/,%,$(QUARTUS_PROJECT_DIR))/$(SOPC_NAME)_sim -endif -endif - -MEM_INIT_DESCRIPTOR_FILE ?= $(MEM_INIT_DIR)/meminit.spd - -MEM_INIT_QIP_FILE ?= $(MEM_INIT_DIR)/meminit.qip - -#------------------------------------- -# Default Flash Boot Loaders -#------------------------------------- - -BOOT_LOADER_PATH ?= $(SOPC_KIT_NIOS2)/components/altera_nios2 -BOOT_LOADER_CFI ?= $(BOOT_LOADER_PATH)/boot_loader_cfi.srec -BOOT_LOADER_CFI_BE ?= $(BOOT_LOADER_PATH)/boot_loader_cfi_be.srec - - -#------------------------------------- -# Default Target -#------------------------------------- - -.PHONY: default_mem_init -ifeq ($(QSYS),1) -default_mem_init: mem_init_generate -else -default_mem_init: mem_init_install -endif -#------------------------------------- -# Runtime Macros -#------------------------------------- - -define post-process-info - @echo Post-processing to create $@... -endef - -target_stem = $(notdir $(basename $@)) - -mem_start_address = $($(target_stem)_START) -mem_end_address = $($(target_stem)_END) -mem_width = $($(target_stem)_WIDTH) -mem_endianness = $($(target_stem)_ENDIANNESS) -mem_create_lanes = $($(target_stem)_CREATE_LANES) - -mem_pad_flag = $($(target_stem)_PAD_FLAG) -mem_reloc_input_flag = $($(target_stem)_RELOC_INPUT_FLAG) -mem_no_zero_fill_flag = $($(target_stem)_NO_ZERO_FILL_FLAG) - -flash_mem_epcs_flag = $($(target_stem)_EPCS_FLAGS) -flash_mem_cfi_flag = $($(target_stem)_CFI_FLAGS) -flash_mem_boot_loader_flag = $($(target_stem)_BOOT_LOADER_FLAG) - -elf2dat_extra_args = $(mem_pad_flag) -elf2hex_extra_args = $(mem_no_zero_fill_flag) -elf2flash_extra_args = $(flash_mem_cfi_flag) $(flash_mem_epcs_flag) $(flash_mem_boot_loader_flag) -flash2dat_extra_args = $(mem_pad_flag) $(mem_reloc_input_flag) - -#------------------------------------------------------------------------------ -# BSP SPECIFIC CONTENT -# -# The content below is controlled by the BSP and SOPC System -#------------------------------------------------------------------------------ -#START OF BSP SPECIFIC - -#------------------------------------- -# Global Settings -#------------------------------------- - - -# The following TYPE comment allows tools to identify the 'type' of target this -# makefile is associated with. -# TYPE: BSP_MEMINIT_MAKEFILE - -# This following VERSION comment indicates the version of the tool used to -# generate this makefile. A makefile variable is provided for VERSION as well. -# ACDS_VERSION: 13.0sp1 -ACDS_VERSION := 13.0sp1 - -# This following BUILD_NUMBER comment indicates the build number of the tool -# used to generate this makefile. -# BUILD_NUMBER: 232 - -# Optimize for simulation -SIM_OPTIMIZE ?= 0 - -# The CPU reset address as needed by elf2flash -RESET_ADDRESS ?= 0x00000000 - -#------------------------------------- -# Pre-Initialized Memory Descriptions -#------------------------------------- - -# Memory: onchip_memory -MEM_0 := nios_system_onchip_memory -$(MEM_0)_NAME := onchip_memory -$(MEM_0)_MEM_INIT_FILE_PARAM_NAME := INIT_FILE -HEX_FILES += $(MEM_INIT_DIR)/$(MEM_0).hex -MEM_INIT_INSTALL_FILES += $(MEM_INIT_INSTALL_DIR)/$(MEM_0).hex -DAT_FILES += $(HDL_SIM_DIR)/$(MEM_0).dat -HDL_SIM_INSTALL_FILES += $(HDL_SIM_INSTALL_DIR)/$(MEM_0).dat -SYM_FILES += $(HDL_SIM_DIR)/$(MEM_0).sym -HDL_SIM_INSTALL_FILES += $(HDL_SIM_INSTALL_DIR)/$(MEM_0).sym -$(MEM_0)_START := 0x00000000 -$(MEM_0)_END := 0x00000fff -$(MEM_0)_HIERARCHICAL_PATH := onchip_memory -$(MEM_0)_WIDTH := 32 -$(MEM_0)_ENDIANNESS := --little-endian-mem -$(MEM_0)_CREATE_LANES := 0 - -.PHONY: onchip_memory -onchip_memory: check_elf_exists $(MEM_INIT_DIR)/$(MEM_0).hex $(HDL_SIM_DIR)/$(MEM_0).dat $(HDL_SIM_DIR)/$(MEM_0).sym - - -#END OF BSP SPECIFIC - -#------------------------------------- -# Pre-Initialized Memory Targets -#------------------------------------- - -.PHONY: mem_init_install mem_init_generate mem_init_clean - -ifeq ($(QSYS),1) -# Target mem_init_install is deprecated for QSys based systems -# To initialize onchip memories for Quartus II Synthesis with Qsys based systems: -# 1) Use "make mem_init_genearate" -# 2) Add the generated mem_init/meminit.qip file to your Quartus II Project -# -mem_init_install: - $(error Deprecated Makefile Target: '$@'. Use target 'mem_init_generate' and then add $(MEM_INIT_QIP_FILE) to your Quartus II Project) - -else # QSYS != 1, if SopcBuilder based system - -ifneq ($(MEM_INIT_INSTALL_DIR),) -mem_init_install: $(MEM_INIT_INSTALL_FILES) -endif - -ifneq ($(HDL_SIM_INSTALL_DIR),) -mem_init_install: $(HDL_SIM_INSTALL_FILES) -endif - -mem_init_install: mem_init_generate -ifeq ($(MEM_INIT_INSTALL_DIR),) - @echo "WARNING: MEM_INIT_INSTALL_DIR not set. Set your QUARTUS_PROJECT_DIR environment variable." -endif -ifeq ($(HDL_SIM_INSTALL_DIR),) - @echo "WARNING: HDL_SIM_INSTALL_DIR not set. Set your QUARTUS_PROJECT_DIR and SOPC_NAME environment variable." -endif - -$(MEM_INIT_INSTALL_FILES): $(MEM_INIT_INSTALL_DIR)/%: $(MEM_INIT_DIR)/% - @$(MKDIR) $(@D) - @$(CP) -v $< $@ - -$(HDL_SIM_INSTALL_FILES): $(HDL_SIM_INSTALL_DIR)/%: $(HDL_SIM_DIR)/% - @$(MKDIR) $(@D) - @$(CP) -v $< $@ - -endif # QSYS == 1 - - -mem_init_generate: hex dat sym flash $(MEM_INIT_DESCRIPTOR_FILE) $(MEM_INIT_QIP_FILE) - -mem_init_clean: - @$(RM) -r $(MEM_INIT_DIR) $(HDL_SIM_DIR) $(FLASH_FILES) - -.PHONY: hex dat sym flash - -hex: check_elf_exists $(HEX_FILES) - -dat: check_elf_exists $(DAT_FILES) - -sym: check_elf_exists $(SYM_FILES) - -flash: check_elf_exists $(FLASH_FILES) - -#------------------------------------- -# Pre-Initialized Memory Rules -#------------------------------------- - -.PHONY: check_elf_exists -check_elf_exists: $(ELF) -ifeq ($(ELF),) - $(error ELF var not set in mem_init.mk) -endif - -$(filter-out $(FLASH_DAT_FILES),$(DAT_FILES)): %.dat: $(ELF) - $(post-process-info) - @$(MKDIR) $(@D) - bash -c '$(ELF2DAT) --infile=$< --outfile=$@ \ - --base=$(mem_start_address) --end=$(mem_end_address) --width=$(mem_width) \ - $(mem_endianness) --create-lanes=$(mem_create_lanes) $(elf2dat_extra_args)' - -$(foreach i,0 1 2 3 4 5 6 7,%_lane$(i).dat): %.dat - @true - -$(HEX_FILES): %.hex: $(ELF) - $(post-process-info) - @$(MKDIR) $(@D) - bash -c '$(ELF2HEX) $< $(mem_start_address) $(mem_end_address) --width=$(mem_width) \ - $(mem_endianness) --create-lanes=$(mem_create_lanes) $(elf2hex_extra_args) $@' - -$(SYM_FILES): %.sym: $(ELF) - $(post-process-info) - @$(MKDIR) $(@D) - $(NM) -n $< > $@ - -$(FLASH_FILES): %.flash: $(ELF) - $(post-process-info) - @$(MKDIR) $(@D) - bash -c '$(ELF2FLASH) --input=$< --outfile=$@ --sim_optimize=$(SIM_OPTIMIZE) $(mem_endianness) \ - $(elf2flash_extra_args)' - -# -# Function generate_spd_entry -# Arg1: path to the memory initialization file -# Arg2: Type HEX or DAT -# Arg3: Output spd file to append -gen_spd_entry.BASE_FILE = $(basename $(notdir $1)) -gen_spd_entry.PARAM_NAME = $($(gen_spd_entry.BASE_FILE)_MEM_INIT_FILE_PARAM_NAME) -gen_spd_entry.MEM_PATH = $($(gen_spd_entry.BASE_FILE)_HIERARCHICAL_PATH) -gen_spd_entry.SETTINGS = $(strip \ - path=\"$1\" \ - type=\"$2\" \ - $(if $(gen_spd_entry.PARAM_NAME),initParamName=\"$(gen_spd_entry.PARAM_NAME)\") \ - $(if $(gen_spd_entry.MEM_PATH),memoryPath=\"$(gen_spd_entry.MEM_PATH)\") \ -) -define gen_spd_entry -$(ECHO) "" >> $3 -endef - -$(MEM_INIT_DESCRIPTOR_FILE).DAT_FILESET := $(patsubst $(dir $(MEM_INIT_DESCRIPTOR_FILE))%,%,$(DAT_FILES)) -$(MEM_INIT_DESCRIPTOR_FILE).HEX_FILESET := $(patsubst $(dir $(MEM_INIT_DESCRIPTOR_FILE))%,%,$(HEX_FILES)) - -$(MEM_INIT_DESCRIPTOR_FILE): %.spd: $(MEM_INIT_FILE) - $(post-process-info) - @$(MKDIR) $(@D) - @$(RM) $@ - @$(ECHO) "" > $@ - @$(ECHO) "" >> $@ - @$(foreach dat_file,$($@.DAT_FILESET),$(call gen_spd_entry,$(dat_file),DAT,$@) &&)true - @$(foreach hex_file,$($@.HEX_FILESET),$(call gen_spd_entry,$(hex_file),HEX,$@) &&)true - @$(ECHO) "" >> $@ - -.DELETE_ON_ERROR: $(MEM_INIT_DESCRIPTOR_FILE) - -$(MEM_INIT_QIP_FILE): %.qip: $(MEM_INIT_FILE) - $(post-process-info) - @$(MKDIR) $(@D) - @$(RM) $@ - @$(ECHO) "set_global_assignment -name SEARCH_PATH $$::quartus(qip_path)" > $@ - -.DELETE_ON_ERROR: $(MEM_INIT_QIP_FILE) diff --git a/software/qsys_tutorial_test_bsp/memory.gdb b/software/qsys_tutorial_test_bsp/memory.gdb deleted file mode 100644 index eee0581..0000000 --- a/software/qsys_tutorial_test_bsp/memory.gdb +++ /dev/null @@ -1,50 +0,0 @@ -# memory.gdb - GDB memory region definitions -# -# Machine generated for CPU 'nios2_processor' in SOPC Builder design 'nios_system' -# SOPC Builder design path: C:/Users/takayun/Desktop/qsys_tutorial/nios_system.sopcinfo -# -# Generated: Thu Oct 27 09:21:11 JST 2016 - -# DO NOT MODIFY THIS FILE -# -# Changing this file will have subtle consequences -# which will almost certainly lead to a nonfunctioning -# system. If you do modify this file, be aware that your -# changes will be overwritten and lost when this file -# is generated again. -# -# DO NOT MODIFY THIS FILE - -# License Agreement -# -# Copyright (c) 2008 -# Altera Corporation, San Jose, California, USA. -# All rights reserved. -# -# 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. -# -# This agreement shall be governed in all respects by the laws of the State -# of California and by the laws of the United States of America. - -# Define memory regions for each memory connected to the CPU. -# The cache attribute is specified which improves GDB performance -# by allowing GDB to cache memory contents on the host. - -# onchip_memory -memory 0x0 0x1000 cache diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_alarm_start.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_alarm_start.d deleted file mode 100644 index 3bb20ea..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_alarm_start.d +++ /dev/null @@ -1,22 +0,0 @@ -obj/HAL/src/alt_alarm_start.o: HAL/src/alt_alarm_start.c \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h system.h linker.h - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_alarm_start.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_alarm_start.o deleted file mode 100644 index cc4c174..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_alarm_start.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_busy_sleep.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_busy_sleep.d deleted file mode 100644 index e93e80c..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_busy_sleep.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_busy_sleep.o: HAL/src/alt_busy_sleep.c system.h linker.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_busy_sleep.h - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_busy_sleep.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_busy_sleep.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_busy_sleep.o deleted file mode 100644 index f55915e..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_busy_sleep.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_close.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_close.d deleted file mode 100644 index fbbab9c..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_close.d +++ /dev/null @@ -1,34 +0,0 @@ -obj/HAL/src/alt_close.o: HAL/src/alt_close.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h \ - HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_close.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_close.o deleted file mode 100644 index eeecdd0..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_close.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_dcache_flush.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_dcache_flush.d deleted file mode 100644 index a0eaf8a..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_dcache_flush.d +++ /dev/null @@ -1,15 +0,0 @@ -obj/HAL/src/alt_dcache_flush.o: HAL/src/alt_dcache_flush.c \ - HAL/inc/nios2.h system.h linker.h HAL/inc/alt_types.h \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h - -HAL/inc/nios2.h: - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_dcache_flush.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_dcache_flush.o deleted file mode 100644 index 3b020ca..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_dcache_flush.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_dcache_flush_all.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_dcache_flush_all.d deleted file mode 100644 index 792c3e4..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_dcache_flush_all.d +++ /dev/null @@ -1,15 +0,0 @@ -obj/HAL/src/alt_dcache_flush_all.o: HAL/src/alt_dcache_flush_all.c \ - HAL/inc/nios2.h system.h linker.h HAL/inc/alt_types.h \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h - -HAL/inc/nios2.h: - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_dcache_flush_all.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_dcache_flush_all.o deleted file mode 100644 index 6e74cdd..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_dcache_flush_all.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_dcache_flush_no_writeback.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_dcache_flush_no_writeback.d deleted file mode 100644 index 867c42b..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_dcache_flush_no_writeback.d +++ /dev/null @@ -1,16 +0,0 @@ -obj/HAL/src/alt_dcache_flush_no_writeback.o: \ - HAL/src/alt_dcache_flush_no_writeback.c HAL/inc/nios2.h system.h \ - linker.h HAL/inc/alt_types.h HAL/inc/sys/alt_cache.h \ - HAL/inc/alt_types.h - -HAL/inc/nios2.h: - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_dcache_flush_no_writeback.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_dcache_flush_no_writeback.o deleted file mode 100644 index cf7a3be..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_dcache_flush_no_writeback.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_dev.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_dev.d deleted file mode 100644 index cd9b1d4..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_dev.d +++ /dev/null @@ -1,34 +0,0 @@ -obj/HAL/src/alt_dev.o: HAL/src/alt_dev.c HAL/inc/sys/alt_dev.h system.h \ - linker.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h \ - HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h HAL/inc/alt_types.h \ - system.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/alt_types.h: - -system.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_dev.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_dev.o deleted file mode 100644 index 1107947..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_dev.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_dev_llist_insert.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_dev_llist_insert.d deleted file mode 100644 index 344d065..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_dev_llist_insert.d +++ /dev/null @@ -1,13 +0,0 @@ -obj/HAL/src/alt_dev_llist_insert.o: HAL/src/alt_dev_llist_insert.c \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/alt_types.h HAL/inc/sys/alt_errno.h - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_errno.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_dev_llist_insert.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_dev_llist_insert.o deleted file mode 100644 index 38fb921..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_dev_llist_insert.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_dma_rxchan_open.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_dma_rxchan_open.d deleted file mode 100644 index fb21fed..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_dma_rxchan_open.d +++ /dev/null @@ -1,35 +0,0 @@ -obj/HAL/src/alt_dma_rxchan_open.o: HAL/src/alt_dma_rxchan_open.c \ - HAL/inc/sys/alt_dma.h HAL/inc/sys/alt_dma_dev.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/alt_types.h HAL/inc/sys/alt_errno.h \ - HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h system.h linker.h \ - HAL/inc/sys/alt_llist.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h - -HAL/inc/sys/alt_dma.h: - -HAL/inc/sys/alt_dma_dev.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_errno.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_dma_rxchan_open.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_dma_rxchan_open.o deleted file mode 100644 index 4b85444..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_dma_rxchan_open.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_dma_txchan_open.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_dma_txchan_open.d deleted file mode 100644 index 500b95c..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_dma_txchan_open.d +++ /dev/null @@ -1,35 +0,0 @@ -obj/HAL/src/alt_dma_txchan_open.o: HAL/src/alt_dma_txchan_open.c \ - HAL/inc/sys/alt_dma.h HAL/inc/sys/alt_dma_dev.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/alt_types.h HAL/inc/sys/alt_errno.h \ - HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h system.h linker.h \ - HAL/inc/sys/alt_llist.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h - -HAL/inc/sys/alt_dma.h: - -HAL/inc/sys/alt_dma_dev.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_errno.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_dma_txchan_open.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_dma_txchan_open.o deleted file mode 100644 index fc19931..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_dma_txchan_open.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_do_ctors.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_do_ctors.d deleted file mode 100644 index daf8baf..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_do_ctors.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_do_ctors.o: HAL/src/alt_do_ctors.c diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_do_ctors.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_do_ctors.o deleted file mode 100644 index d50d3e4..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_do_ctors.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_do_dtors.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_do_dtors.d deleted file mode 100644 index c3471eb..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_do_dtors.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_do_dtors.o: HAL/src/alt_do_dtors.c diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_do_dtors.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_do_dtors.o deleted file mode 100644 index 10394b5..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_do_dtors.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_env_lock.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_env_lock.d deleted file mode 100644 index 634d7b0..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_env_lock.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_env_lock.o: HAL/src/alt_env_lock.c diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_env_lock.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_env_lock.o deleted file mode 100644 index aa5f06d..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_env_lock.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_environ.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_environ.d deleted file mode 100644 index e9ca295..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_environ.d +++ /dev/null @@ -1,3 +0,0 @@ -obj/HAL/src/alt_environ.o: HAL/src/alt_environ.c HAL/inc/os/alt_syscall.h - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_environ.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_environ.o deleted file mode 100644 index 8f9dd55..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_environ.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_errno.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_errno.d deleted file mode 100644 index 29ca544..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_errno.d +++ /dev/null @@ -1,8 +0,0 @@ -obj/HAL/src/alt_errno.o: HAL/src/alt_errno.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/alt_types.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_errno.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_errno.o deleted file mode 100644 index 82c8dfb..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_errno.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_exception_entry.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_exception_entry.d deleted file mode 100644 index 540567e..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_exception_entry.d +++ /dev/null @@ -1,6 +0,0 @@ -obj/HAL/src/alt_exception_entry.o: HAL/src/alt_exception_entry.S system.h \ - linker.h - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_exception_entry.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_exception_entry.o deleted file mode 100644 index 3e0d44a..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_exception_entry.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_exception_muldiv.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_exception_muldiv.d deleted file mode 100644 index 63d66a7..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_exception_muldiv.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_exception_muldiv.o: HAL/src/alt_exception_muldiv.S diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_exception_muldiv.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_exception_muldiv.o deleted file mode 100644 index 6ca0c29..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_exception_muldiv.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_exception_trap.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_exception_trap.d deleted file mode 100644 index 6e18488..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_exception_trap.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_exception_trap.o: HAL/src/alt_exception_trap.S diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_exception_trap.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_exception_trap.o deleted file mode 100644 index 8fa2a70..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_exception_trap.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_execve.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_execve.d deleted file mode 100644 index 9cef7d2..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_execve.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_execve.o: HAL/src/alt_execve.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_execve.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_execve.o deleted file mode 100644 index 3c362bf..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_execve.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_exit.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_exit.d deleted file mode 100644 index a779da8..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_exit.d +++ /dev/null @@ -1,26 +0,0 @@ -obj/HAL/src/alt_exit.o: HAL/src/alt_exit.c HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h HAL/inc/alt_types.h system.h linker.h \ - HAL/inc/sys/alt_sim.h HAL/inc/os/alt_hooks.h HAL/inc/os/alt_syscall.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_log_printf.h system.h - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_sim.h: - -HAL/inc/os/alt_hooks.h: - -HAL/inc/os/alt_syscall.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_exit.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_exit.o deleted file mode 100644 index e2e0bec..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_exit.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_fcntl.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_fcntl.d deleted file mode 100644 index 527f242..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_fcntl.d +++ /dev/null @@ -1,34 +0,0 @@ -obj/HAL/src/alt_fcntl.o: HAL/src/alt_fcntl.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h \ - system.h linker.h HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/alt_types.h \ - HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_fcntl.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_fcntl.o deleted file mode 100644 index ee9289e..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_fcntl.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_fd_lock.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_fd_lock.d deleted file mode 100644 index 93daeac..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_fd_lock.d +++ /dev/null @@ -1,27 +0,0 @@ -obj/HAL/src/alt_fd_lock.o: HAL/src/alt_fd_lock.c HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_fd_lock.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_fd_lock.o deleted file mode 100644 index d9ca57b..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_fd_lock.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_fd_unlock.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_fd_unlock.d deleted file mode 100644 index 45a3207..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_fd_unlock.d +++ /dev/null @@ -1,27 +0,0 @@ -obj/HAL/src/alt_fd_unlock.o: HAL/src/alt_fd_unlock.c \ - HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h system.h linker.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_fd_unlock.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_fd_unlock.o deleted file mode 100644 index d1fcc4b..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_fd_unlock.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_find_dev.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_find_dev.d deleted file mode 100644 index 98336f8..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_find_dev.d +++ /dev/null @@ -1,31 +0,0 @@ -obj/HAL/src/alt_find_dev.o: HAL/src/alt_find_dev.c HAL/inc/sys/alt_dev.h \ - system.h linker.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h \ - HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h HAL/inc/alt_types.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_find_dev.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_find_dev.o deleted file mode 100644 index a6b02d5..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_find_dev.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_find_file.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_find_file.d deleted file mode 100644 index d1150ca..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_find_file.d +++ /dev/null @@ -1,32 +0,0 @@ -obj/HAL/src/alt_find_file.o: HAL/src/alt_find_file.c \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h \ - HAL/inc/alt_types.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_find_file.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_find_file.o deleted file mode 100644 index 8f42d55..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_find_file.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_flash_dev.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_flash_dev.d deleted file mode 100644 index 8835e8f..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_flash_dev.d +++ /dev/null @@ -1,34 +0,0 @@ -obj/HAL/src/alt_flash_dev.o: HAL/src/alt_flash_dev.c \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/sys/alt_flash_dev.h \ - HAL/inc/sys/alt_flash_types.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h \ - system.h linker.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_flash_dev.h: - -HAL/inc/sys/alt_flash_types.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_flash_dev.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_flash_dev.o deleted file mode 100644 index b711c40..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_flash_dev.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_fork.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_fork.d deleted file mode 100644 index 492be65..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_fork.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_fork.o: HAL/src/alt_fork.c HAL/inc/sys/alt_warning.h \ - HAL/inc/sys/alt_errno.h HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_warning.h: - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_fork.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_fork.o deleted file mode 100644 index a57e079..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_fork.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_fs_reg.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_fs_reg.d deleted file mode 100644 index d8f95ab..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_fs_reg.d +++ /dev/null @@ -1,29 +0,0 @@ -obj/HAL/src/alt_fs_reg.o: HAL/src/alt_fs_reg.c HAL/inc/sys/alt_dev.h \ - system.h linker.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h \ - HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_fs_reg.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_fs_reg.o deleted file mode 100644 index e615136..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_fs_reg.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_fstat.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_fstat.d deleted file mode 100644 index 942fcbc..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_fstat.d +++ /dev/null @@ -1,38 +0,0 @@ -obj/HAL/src/alt_fstat.o: HAL/src/alt_fstat.c HAL/inc/sys/alt_dev.h \ - system.h linker.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/sys/alt_errno.h \ - HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_syscall.h system.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/sys/alt_errno.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_syscall.h: - -system.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_fstat.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_fstat.o deleted file mode 100644 index e3270dd..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_fstat.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_get_fd.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_get_fd.d deleted file mode 100644 index 9a4daaa..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_get_fd.d +++ /dev/null @@ -1,34 +0,0 @@ -obj/HAL/src/alt_get_fd.o: HAL/src/alt_get_fd.c HAL/inc/sys/alt_dev.h \ - system.h linker.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h \ - HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h HAL/inc/alt_types.h \ - system.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/alt_types.h: - -system.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_get_fd.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_get_fd.o deleted file mode 100644 index 0dc1d9d..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_get_fd.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_getchar.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_getchar.d deleted file mode 100644 index bcccdf7..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_getchar.d +++ /dev/null @@ -1,34 +0,0 @@ -obj/HAL/src/alt_getchar.o: HAL/src/alt_getchar.c system.h linker.h \ - HAL/inc/sys/alt_driver.h HAL/inc/sys/alt_stdio.h \ - HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h system.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h - -system.h: - -linker.h: - -HAL/inc/sys/alt_driver.h: - -HAL/inc/sys/alt_stdio.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_getchar.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_getchar.o deleted file mode 100644 index b4c93b6..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_getchar.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_getpid.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_getpid.d deleted file mode 100644 index d9499b9..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_getpid.d +++ /dev/null @@ -1,3 +0,0 @@ -obj/HAL/src/alt_getpid.o: HAL/src/alt_getpid.c HAL/inc/os/alt_syscall.h - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_getpid.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_getpid.o deleted file mode 100644 index f0f4ef6..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_getpid.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_gettod.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_gettod.d deleted file mode 100644 index cf3cf34..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_gettod.d +++ /dev/null @@ -1,17 +0,0 @@ -obj/HAL/src/alt_gettod.o: HAL/src/alt_gettod.c HAL/inc/sys/alt_alarm.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/priv/alt_alarm.h \ - HAL/inc/alt_types.h HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_gettod.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_gettod.o deleted file mode 100644 index 16668a3..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_gettod.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_gmon.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_gmon.d deleted file mode 100644 index e9469ab..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_gmon.d +++ /dev/null @@ -1,24 +0,0 @@ -obj/HAL/src/alt_gmon.o: HAL/src/alt_gmon.c HAL/inc/priv/nios2_gmon_data.h \ - HAL/inc/sys/alt_irq.h HAL/inc/nios2.h HAL/inc/alt_types.h system.h \ - linker.h HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h - -HAL/inc/priv/nios2_gmon_data.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_gmon.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_gmon.o deleted file mode 100644 index 2fb606d..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_gmon.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_icache_flush.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_icache_flush.d deleted file mode 100644 index 2e4ddd1..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_icache_flush.d +++ /dev/null @@ -1,15 +0,0 @@ -obj/HAL/src/alt_icache_flush.o: HAL/src/alt_icache_flush.c \ - HAL/inc/nios2.h system.h linker.h HAL/inc/alt_types.h \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h - -HAL/inc/nios2.h: - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_icache_flush.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_icache_flush.o deleted file mode 100644 index b6e3939..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_icache_flush.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_icache_flush_all.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_icache_flush_all.d deleted file mode 100644 index 47cfbf3..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_icache_flush_all.d +++ /dev/null @@ -1,15 +0,0 @@ -obj/HAL/src/alt_icache_flush_all.o: HAL/src/alt_icache_flush_all.c \ - HAL/inc/nios2.h system.h linker.h HAL/inc/alt_types.h \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h - -HAL/inc/nios2.h: - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_icache_flush_all.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_icache_flush_all.o deleted file mode 100644 index 37d8921..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_icache_flush_all.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_iic.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_iic.d deleted file mode 100644 index a709e0c..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_iic.d +++ /dev/null @@ -1,29 +0,0 @@ -obj/HAL/src/alt_iic.o: HAL/src/alt_iic.c system.h linker.h \ - HAL/inc/sys/alt_irq.h HAL/inc/nios2.h HAL/inc/alt_types.h system.h \ - HAL/inc/priv/alt_iic_isr_register.h HAL/inc/alt_types.h \ - HAL/inc/sys/alt_irq.h HAL/inc/priv/alt_legacy_irq.h system.h \ - HAL/inc/nios2.h - -system.h: - -linker.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -HAL/inc/priv/alt_iic_isr_register.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/priv/alt_legacy_irq.h: - -system.h: - -HAL/inc/nios2.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_iic.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_iic.o deleted file mode 100644 index 60f6f7f..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_iic.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_iic_isr_register.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_iic_isr_register.d deleted file mode 100644 index d0470ae..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_iic_isr_register.d +++ /dev/null @@ -1,30 +0,0 @@ -obj/HAL/src/alt_iic_isr_register.o: HAL/src/alt_iic_isr_register.c \ - system.h linker.h HAL/inc/alt_types.h HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h HAL/inc/alt_types.h system.h \ - HAL/inc/priv/alt_iic_isr_register.h HAL/inc/alt_types.h \ - HAL/inc/sys/alt_irq.h HAL/inc/sys/alt_irq_entry.h \ - HAL/inc/priv/alt_irq_table.h - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -HAL/inc/priv/alt_iic_isr_register.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/sys/alt_irq_entry.h: - -HAL/inc/priv/alt_irq_table.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_iic_isr_register.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_iic_isr_register.o deleted file mode 100644 index 2216e23..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_iic_isr_register.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_instruction_exception_entry.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_instruction_exception_entry.d deleted file mode 100644 index 6d0705f..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_instruction_exception_entry.d +++ /dev/null @@ -1,18 +0,0 @@ -obj/HAL/src/alt_instruction_exception_entry.o: \ - HAL/src/alt_instruction_exception_entry.c HAL/inc/sys/alt_exceptions.h \ - HAL/inc/alt_types.h system.h linker.h HAL/inc/nios2.h \ - HAL/inc/alt_types.h system.h - -HAL/inc/sys/alt_exceptions.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_instruction_exception_entry.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_instruction_exception_entry.o deleted file mode 100644 index 6f29459..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_instruction_exception_entry.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_instruction_exception_register.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_instruction_exception_register.d deleted file mode 100644 index d4fac04..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_instruction_exception_register.d +++ /dev/null @@ -1,16 +0,0 @@ -obj/HAL/src/alt_instruction_exception_register.o: \ - HAL/src/alt_instruction_exception_register.c \ - HAL/inc/sys/alt_exceptions.h HAL/inc/alt_types.h system.h linker.h \ - HAL/inc/alt_types.h system.h - -HAL/inc/sys/alt_exceptions.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/alt_types.h: - -system.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_instruction_exception_register.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_instruction_exception_register.o deleted file mode 100644 index 5ae2f88..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_instruction_exception_register.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_io_redirect.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_io_redirect.d deleted file mode 100644 index 8228365..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_io_redirect.d +++ /dev/null @@ -1,29 +0,0 @@ -obj/HAL/src/alt_io_redirect.o: HAL/src/alt_io_redirect.c \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_io_redirect.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_io_redirect.o deleted file mode 100644 index a376126..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_io_redirect.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_ioctl.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_ioctl.d deleted file mode 100644 index d70ad97..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_ioctl.d +++ /dev/null @@ -1,41 +0,0 @@ -obj/HAL/src/alt_ioctl.o: HAL/src/alt_ioctl.c HAL/inc/sys/ioctl.h \ - HAL/inc/sys/alt_errno.h HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h \ - HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h system.h linker.h \ - HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_syscall.h system.h \ - HAL/inc/sys/alt_driver.h - -HAL/inc/sys/ioctl.h: - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_syscall.h: - -system.h: - -HAL/inc/sys/alt_driver.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_ioctl.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_ioctl.o deleted file mode 100644 index 18f83ed..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_ioctl.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_irq_entry.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_irq_entry.d deleted file mode 100644 index 9ec3751..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_irq_entry.d +++ /dev/null @@ -1,5 +0,0 @@ -obj/HAL/src/alt_irq_entry.o: HAL/src/alt_irq_entry.S system.h linker.h - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_irq_entry.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_irq_entry.o deleted file mode 100644 index b1819cd..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_irq_entry.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_irq_handler.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_irq_handler.d deleted file mode 100644 index 6fb668f..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_irq_handler.d +++ /dev/null @@ -1,19 +0,0 @@ -obj/HAL/src/alt_irq_handler.o: HAL/src/alt_irq_handler.c system.h \ - linker.h HAL/inc/sys/alt_irq.h HAL/inc/nios2.h HAL/inc/alt_types.h \ - system.h HAL/inc/os/alt_hooks.h HAL/inc/alt_types.h - -system.h: - -linker.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -HAL/inc/os/alt_hooks.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_irq_handler.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_irq_handler.o deleted file mode 100644 index 03ea636..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_irq_handler.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_irq_register.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_irq_register.d deleted file mode 100644 index 3df2f8a..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_irq_register.d +++ /dev/null @@ -1,36 +0,0 @@ -obj/HAL/src/alt_irq_register.o: HAL/src/alt_irq_register.c system.h \ - linker.h HAL/inc/sys/alt_irq.h HAL/inc/nios2.h HAL/inc/alt_types.h \ - system.h HAL/inc/priv/alt_legacy_irq.h system.h HAL/inc/nios2.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_irq.h HAL/inc/os/alt_hooks.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_irq_entry.h \ - HAL/inc/priv/alt_irq_table.h - -system.h: - -linker.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -HAL/inc/priv/alt_legacy_irq.h: - -system.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/os/alt_hooks.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_irq_entry.h: - -HAL/inc/priv/alt_irq_table.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_irq_register.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_irq_register.o deleted file mode 100644 index 9129c94..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_irq_register.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_irq_vars.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_irq_vars.d deleted file mode 100644 index f316558..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_irq_vars.d +++ /dev/null @@ -1,8 +0,0 @@ -obj/HAL/src/alt_irq_vars.o: HAL/src/alt_irq_vars.c HAL/inc/alt_types.h \ - system.h linker.h - -HAL/inc/alt_types.h: - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_irq_vars.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_irq_vars.o deleted file mode 100644 index b52998d..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_irq_vars.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_isatty.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_isatty.d deleted file mode 100644 index f8b1f07..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_isatty.d +++ /dev/null @@ -1,38 +0,0 @@ -obj/HAL/src/alt_isatty.o: HAL/src/alt_isatty.c HAL/inc/sys/alt_dev.h \ - system.h linker.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_errno.h HAL/inc/sys/alt_warning.h \ - HAL/inc/priv/alt_file.h HAL/inc/sys/alt_dev.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_syscall.h system.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_errno.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_syscall.h: - -system.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_isatty.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_isatty.o deleted file mode 100644 index 9b1965d..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_isatty.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_kill.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_kill.d deleted file mode 100644 index 0c14ae8..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_kill.d +++ /dev/null @@ -1,8 +0,0 @@ -obj/HAL/src/alt_kill.o: HAL/src/alt_kill.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_kill.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_kill.o deleted file mode 100644 index 228ae4f..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_kill.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_link.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_link.d deleted file mode 100644 index dc844c6..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_link.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_link.o: HAL/src/alt_link.c HAL/inc/sys/alt_warning.h \ - HAL/inc/sys/alt_errno.h HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_warning.h: - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_link.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_link.o deleted file mode 100644 index 2d15b6b..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_link.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_load.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_load.d deleted file mode 100644 index d496ab8..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_load.d +++ /dev/null @@ -1,8 +0,0 @@ -obj/HAL/src/alt_load.o: HAL/src/alt_load.c HAL/inc/sys/alt_load.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_cache.h - -HAL/inc/sys/alt_load.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_cache.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_load.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_load.o deleted file mode 100644 index 27e505b..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_load.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_log_macro.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_log_macro.d deleted file mode 100644 index 9768c1f..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_log_macro.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_log_macro.o: HAL/src/alt_log_macro.S diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_log_macro.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_log_macro.o deleted file mode 100644 index 489e2cc..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_log_macro.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_log_printf.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_log_printf.d deleted file mode 100644 index 251ff6d..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_log_printf.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_log_printf.o: HAL/src/alt_log_printf.c diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_log_printf.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_log_printf.o deleted file mode 100644 index a03c33d..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_log_printf.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_lseek.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_lseek.d deleted file mode 100644 index 25ed783..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_lseek.d +++ /dev/null @@ -1,34 +0,0 @@ -obj/HAL/src/alt_lseek.o: HAL/src/alt_lseek.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h \ - HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_lseek.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_lseek.o deleted file mode 100644 index 4ae7dec..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_lseek.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_main.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_main.d deleted file mode 100644 index afdfda0..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_main.d +++ /dev/null @@ -1,47 +0,0 @@ -obj/HAL/src/alt_main.o: HAL/src/alt_main.c HAL/inc/sys/alt_dev.h system.h \ - linker.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_sys_init.h HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h HAL/inc/os/alt_hooks.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h \ - HAL/inc/alt_types.h system.h HAL/inc/sys/alt_log_printf.h system.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_sys_init.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/os/alt_hooks.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/alt_types.h: - -system.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_main.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_main.o deleted file mode 100644 index a68037d..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_main.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_malloc_lock.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_malloc_lock.d deleted file mode 100644 index 4ed35c2..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_malloc_lock.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_malloc_lock.o: HAL/src/alt_malloc_lock.c diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_malloc_lock.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_malloc_lock.o deleted file mode 100644 index a4fab48..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_malloc_lock.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_mcount.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_mcount.d deleted file mode 100644 index 1203efc..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_mcount.d +++ /dev/null @@ -1 +0,0 @@ -obj/HAL/src/alt_mcount.o: HAL/src/alt_mcount.S diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_mcount.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_mcount.o deleted file mode 100644 index dc22852..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_mcount.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_open.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_open.d deleted file mode 100644 index a2aacd9..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_open.d +++ /dev/null @@ -1,36 +0,0 @@ -obj/HAL/src/alt_open.o: HAL/src/alt_open.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_open.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_open.o deleted file mode 100644 index b9e93d1..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_open.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_printf.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_printf.d deleted file mode 100644 index 3ce68a4..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_printf.d +++ /dev/null @@ -1,3 +0,0 @@ -obj/HAL/src/alt_printf.o: HAL/src/alt_printf.c HAL/inc/sys/alt_stdio.h - -HAL/inc/sys/alt_stdio.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_printf.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_printf.o deleted file mode 100644 index e9a4a0e..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_printf.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_putchar.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_putchar.d deleted file mode 100644 index 9a0dde3..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_putchar.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_putchar.o: HAL/src/alt_putchar.c system.h linker.h \ - HAL/inc/sys/alt_driver.h HAL/inc/sys/alt_stdio.h - -system.h: - -linker.h: - -HAL/inc/sys/alt_driver.h: - -HAL/inc/sys/alt_stdio.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_putchar.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_putchar.o deleted file mode 100644 index 2c7f53a..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_putchar.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_putstr.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_putstr.d deleted file mode 100644 index 3cf528a..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_putstr.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_putstr.o: HAL/src/alt_putstr.c system.h linker.h \ - HAL/inc/sys/alt_driver.h HAL/inc/sys/alt_stdio.h - -system.h: - -linker.h: - -HAL/inc/sys/alt_driver.h: - -HAL/inc/sys/alt_stdio.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_putstr.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_putstr.o deleted file mode 100644 index 2245e4d..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_putstr.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_read.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_read.d deleted file mode 100644 index 2bb0d95..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_read.d +++ /dev/null @@ -1,38 +0,0 @@ -obj/HAL/src/alt_read.o: HAL/src/alt_read.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h \ - HAL/inc/os/alt_syscall.h system.h HAL/inc/sys/alt_driver.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_syscall.h: - -system.h: - -HAL/inc/sys/alt_driver.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_read.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_read.o deleted file mode 100644 index 0fc3f53..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_read.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_release_fd.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_release_fd.d deleted file mode 100644 index 0e3acb5..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_release_fd.d +++ /dev/null @@ -1,29 +0,0 @@ -obj/HAL/src/alt_release_fd.o: HAL/src/alt_release_fd.c \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_release_fd.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_release_fd.o deleted file mode 100644 index a24adba..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_release_fd.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_remap_cached.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_remap_cached.d deleted file mode 100644 index b5fb151..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_remap_cached.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_remap_cached.o: HAL/src/alt_remap_cached.c \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h system.h linker.h - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_remap_cached.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_remap_cached.o deleted file mode 100644 index d6898ed..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_remap_cached.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_remap_uncached.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_remap_uncached.d deleted file mode 100644 index 0423405..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_remap_uncached.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_remap_uncached.o: HAL/src/alt_remap_uncached.c \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h system.h linker.h - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_remap_uncached.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_remap_uncached.o deleted file mode 100644 index 5b855aa..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_remap_uncached.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_rename.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_rename.d deleted file mode 100644 index b7af4b2..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_rename.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_rename.o: HAL/src/alt_rename.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_rename.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_rename.o deleted file mode 100644 index 7d2ddf1..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_rename.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_sbrk.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_sbrk.d deleted file mode 100644 index a0771ae..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_sbrk.d +++ /dev/null @@ -1,19 +0,0 @@ -obj/HAL/src/alt_sbrk.o: HAL/src/alt_sbrk.c HAL/inc/os/alt_syscall.h \ - HAL/inc/sys/alt_irq.h HAL/inc/nios2.h HAL/inc/alt_types.h system.h \ - linker.h HAL/inc/sys/alt_stack.h system.h - -HAL/inc/os/alt_syscall.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_stack.h: - -system.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_sbrk.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_sbrk.o deleted file mode 100644 index a810095..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_sbrk.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_settod.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_settod.d deleted file mode 100644 index 56718d5..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_settod.d +++ /dev/null @@ -1,17 +0,0 @@ -obj/HAL/src/alt_settod.o: HAL/src/alt_settod.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_settod.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_settod.o deleted file mode 100644 index 09651b0..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_settod.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_software_exception.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_software_exception.d deleted file mode 100644 index fab4023..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_software_exception.d +++ /dev/null @@ -1,6 +0,0 @@ -obj/HAL/src/alt_software_exception.o: HAL/src/alt_software_exception.S \ - system.h linker.h - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_software_exception.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_software_exception.o deleted file mode 100644 index f9e01c2..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_software_exception.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_stat.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_stat.d deleted file mode 100644 index 8a63c27..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_stat.d +++ /dev/null @@ -1,3 +0,0 @@ -obj/HAL/src/alt_stat.o: HAL/src/alt_stat.c HAL/inc/os/alt_syscall.h - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_stat.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_stat.o deleted file mode 100644 index 2d2f97e..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_stat.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_tick.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_tick.d deleted file mode 100644 index ddbb281..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_tick.d +++ /dev/null @@ -1,27 +0,0 @@ -obj/HAL/src/alt_tick.o: HAL/src/alt_tick.c HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h HAL/inc/alt_types.h system.h linker.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/os/alt_hooks.h \ - HAL/inc/alt_types.h - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_hooks.h: - -HAL/inc/alt_types.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_tick.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_tick.o deleted file mode 100644 index e6491e3..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_tick.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_times.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_times.d deleted file mode 100644 index 4bad83d..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_times.d +++ /dev/null @@ -1,17 +0,0 @@ -obj/HAL/src/alt_times.o: HAL/src/alt_times.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_times.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_times.o deleted file mode 100644 index 9047b9b..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_times.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_uncached_free.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_uncached_free.d deleted file mode 100644 index d74ef4b..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_uncached_free.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_uncached_free.o: HAL/src/alt_uncached_free.c \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h system.h linker.h - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_uncached_free.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_uncached_free.o deleted file mode 100644 index 1c31696..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_uncached_free.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_uncached_malloc.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_uncached_malloc.d deleted file mode 100644 index 16799fb..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_uncached_malloc.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_uncached_malloc.o: HAL/src/alt_uncached_malloc.c \ - HAL/inc/sys/alt_cache.h HAL/inc/alt_types.h system.h linker.h - -HAL/inc/sys/alt_cache.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_uncached_malloc.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_uncached_malloc.o deleted file mode 100644 index d6af95a..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_uncached_malloc.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_unlink.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_unlink.d deleted file mode 100644 index 0205f86..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_unlink.d +++ /dev/null @@ -1,10 +0,0 @@ -obj/HAL/src/alt_unlink.o: HAL/src/alt_unlink.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_unlink.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_unlink.o deleted file mode 100644 index 7ed48a5..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_unlink.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_usleep.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_usleep.d deleted file mode 100644 index b5eca45..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_usleep.d +++ /dev/null @@ -1,6 +0,0 @@ -obj/HAL/src/alt_usleep.o: HAL/src/alt_usleep.c \ - HAL/inc/priv/alt_busy_sleep.h HAL/inc/os/alt_syscall.h - -HAL/inc/priv/alt_busy_sleep.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_usleep.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_usleep.o deleted file mode 100644 index 6a81b77..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_usleep.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_wait.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_wait.d deleted file mode 100644 index f47f5df..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_wait.d +++ /dev/null @@ -1,8 +0,0 @@ -obj/HAL/src/alt_wait.o: HAL/src/alt_wait.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_syscall.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_syscall.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_wait.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_wait.o deleted file mode 100644 index 521a15b..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_wait.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_write.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_write.d deleted file mode 100644 index 2b54a68..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_write.d +++ /dev/null @@ -1,41 +0,0 @@ -obj/HAL/src/alt_write.o: HAL/src/alt_write.c HAL/inc/sys/alt_errno.h \ - HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h HAL/inc/priv/alt_file.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_dev_llist.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h \ - HAL/inc/os/alt_syscall.h HAL/inc/sys/alt_log_printf.h system.h \ - HAL/inc/sys/alt_driver.h - -HAL/inc/sys/alt_errno.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/priv/alt_file.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_syscall.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: - -HAL/inc/sys/alt_driver.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_write.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_write.o deleted file mode 100644 index a88a95c..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/alt_write.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/altera_nios2_qsys_irq.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/altera_nios2_qsys_irq.d deleted file mode 100644 index 47bdd9c..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/altera_nios2_qsys_irq.d +++ /dev/null @@ -1,15 +0,0 @@ -obj/HAL/src/altera_nios2_qsys_irq.o: HAL/src/altera_nios2_qsys_irq.c \ - HAL/inc/sys/alt_irq.h HAL/inc/nios2.h HAL/inc/alt_types.h system.h \ - linker.h HAL/inc/altera_nios2_qsys_irq.h - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/altera_nios2_qsys_irq.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/altera_nios2_qsys_irq.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/altera_nios2_qsys_irq.o deleted file mode 100644 index bb7e5e9..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/altera_nios2_qsys_irq.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/crt0.d b/software/qsys_tutorial_test_bsp/obj/HAL/src/crt0.d deleted file mode 100644 index 3af0bb0..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/crt0.d +++ /dev/null @@ -1,12 +0,0 @@ -obj/HAL/src/crt0.o: HAL/src/crt0.S system.h linker.h HAL/inc/nios2.h \ - HAL/inc/sys/alt_log_printf.h system.h - -system.h: - -linker.h: - -HAL/inc/nios2.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: diff --git a/software/qsys_tutorial_test_bsp/obj/HAL/src/crt0.o b/software/qsys_tutorial_test_bsp/obj/HAL/src/crt0.o deleted file mode 100644 index c049ce7..0000000 --- a/software/qsys_tutorial_test_bsp/obj/HAL/src/crt0.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/alt_sys_init.d b/software/qsys_tutorial_test_bsp/obj/alt_sys_init.d deleted file mode 100644 index 2087a7a..0000000 --- a/software/qsys_tutorial_test_bsp/obj/alt_sys_init.d +++ /dev/null @@ -1,54 +0,0 @@ -obj/alt_sys_init.o: alt_sys_init.c system.h linker.h \ - HAL/inc/sys/alt_irq.h HAL/inc/nios2.h HAL/inc/alt_types.h system.h \ - HAL/inc/sys/alt_sys_init.h HAL/inc/altera_nios2_qsys_irq.h \ - drivers/inc/altera_avalon_jtag_uart.h HAL/inc/sys/alt_alarm.h \ - HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h \ - HAL/inc/sys/alt_warning.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_flag.h \ - drivers/inc/altera_avalon_jtag_uart_fd.h HAL/inc/sys/alt_dev.h \ - HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h - -system.h: - -linker.h: - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -HAL/inc/sys/alt_sys_init.h: - -HAL/inc/altera_nios2_qsys_irq.h: - -drivers/inc/altera_avalon_jtag_uart.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_flag.h: - -drivers/inc/altera_avalon_jtag_uart_fd.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: diff --git a/software/qsys_tutorial_test_bsp/obj/alt_sys_init.o b/software/qsys_tutorial_test_bsp/obj/alt_sys_init.o deleted file mode 100644 index 071ebf8..0000000 --- a/software/qsys_tutorial_test_bsp/obj/alt_sys_init.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/drivers/src/altera_avalon_jtag_uart_fd.d b/software/qsys_tutorial_test_bsp/obj/drivers/src/altera_avalon_jtag_uart_fd.d deleted file mode 100644 index b152697..0000000 --- a/software/qsys_tutorial_test_bsp/obj/drivers/src/altera_avalon_jtag_uart_fd.d +++ /dev/null @@ -1,48 +0,0 @@ -obj/drivers/src/altera_avalon_jtag_uart_fd.o: \ - drivers/src/altera_avalon_jtag_uart_fd.c HAL/inc/alt_types.h \ - HAL/inc/sys/alt_dev.h system.h linker.h HAL/inc/sys/alt_llist.h \ - HAL/inc/alt_types.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - drivers/inc/altera_avalon_jtag_uart.h HAL/inc/sys/alt_alarm.h \ - HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_alarm.h \ - HAL/inc/sys/alt_warning.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_flag.h \ - drivers/inc/altera_avalon_jtag_uart_fd.h HAL/inc/sys/alt_dev.h - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_flag.h: - -drivers/inc/altera_avalon_jtag_uart_fd.h: - -HAL/inc/sys/alt_dev.h: diff --git a/software/qsys_tutorial_test_bsp/obj/drivers/src/altera_avalon_jtag_uart_fd.o b/software/qsys_tutorial_test_bsp/obj/drivers/src/altera_avalon_jtag_uart_fd.o deleted file mode 100644 index 7054eac..0000000 --- a/software/qsys_tutorial_test_bsp/obj/drivers/src/altera_avalon_jtag_uart_fd.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/drivers/src/altera_avalon_jtag_uart_init.d b/software/qsys_tutorial_test_bsp/obj/drivers/src/altera_avalon_jtag_uart_init.d deleted file mode 100644 index f9460a1..0000000 --- a/software/qsys_tutorial_test_bsp/obj/drivers/src/altera_avalon_jtag_uart_init.d +++ /dev/null @@ -1,66 +0,0 @@ -obj/drivers/src/altera_avalon_jtag_uart_init.o: \ - drivers/src/altera_avalon_jtag_uart_init.c HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h HAL/inc/alt_types.h system.h linker.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/sys/ioctl.h \ - HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart_regs.h \ - HAL/inc/io.h HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_warning.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_flag.h \ - drivers/inc/altera_avalon_jtag_uart_fd.h HAL/inc/sys/alt_dev.h \ - HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/sys/alt_log_printf.h system.h - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/ioctl.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart_regs.h: - -HAL/inc/io.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_flag.h: - -drivers/inc/altera_avalon_jtag_uart_fd.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: diff --git a/software/qsys_tutorial_test_bsp/obj/drivers/src/altera_avalon_jtag_uart_init.o b/software/qsys_tutorial_test_bsp/obj/drivers/src/altera_avalon_jtag_uart_init.o deleted file mode 100644 index fccbd4e..0000000 --- a/software/qsys_tutorial_test_bsp/obj/drivers/src/altera_avalon_jtag_uart_init.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/drivers/src/altera_avalon_jtag_uart_ioctl.d b/software/qsys_tutorial_test_bsp/obj/drivers/src/altera_avalon_jtag_uart_ioctl.d deleted file mode 100644 index d75a559..0000000 --- a/software/qsys_tutorial_test_bsp/obj/drivers/src/altera_avalon_jtag_uart_ioctl.d +++ /dev/null @@ -1,58 +0,0 @@ -obj/drivers/src/altera_avalon_jtag_uart_ioctl.o: \ - drivers/src/altera_avalon_jtag_uart_ioctl.c HAL/inc/sys/ioctl.h \ - HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart_regs.h \ - HAL/inc/io.h HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h HAL/inc/alt_types.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/sys/alt_warning.h \ - HAL/inc/os/alt_sem.h HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_flag.h \ - drivers/inc/altera_avalon_jtag_uart_fd.h HAL/inc/sys/alt_dev.h system.h \ - linker.h HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/sys/alt_log_printf.h system.h - -HAL/inc/sys/ioctl.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart_regs.h: - -HAL/inc/io.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/alt_types.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_flag.h: - -drivers/inc/altera_avalon_jtag_uart_fd.h: - -HAL/inc/sys/alt_dev.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: diff --git a/software/qsys_tutorial_test_bsp/obj/drivers/src/altera_avalon_jtag_uart_ioctl.o b/software/qsys_tutorial_test_bsp/obj/drivers/src/altera_avalon_jtag_uart_ioctl.o deleted file mode 100644 index 5f8eccf..0000000 --- a/software/qsys_tutorial_test_bsp/obj/drivers/src/altera_avalon_jtag_uart_ioctl.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/drivers/src/altera_avalon_jtag_uart_read.d b/software/qsys_tutorial_test_bsp/obj/drivers/src/altera_avalon_jtag_uart_read.d deleted file mode 100644 index 9a4846a..0000000 --- a/software/qsys_tutorial_test_bsp/obj/drivers/src/altera_avalon_jtag_uart_read.d +++ /dev/null @@ -1,66 +0,0 @@ -obj/drivers/src/altera_avalon_jtag_uart_read.o: \ - drivers/src/altera_avalon_jtag_uart_read.c HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h HAL/inc/alt_types.h system.h linker.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/sys/ioctl.h \ - HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart_regs.h \ - HAL/inc/io.h HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_warning.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_flag.h \ - drivers/inc/altera_avalon_jtag_uart_fd.h HAL/inc/sys/alt_dev.h \ - HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/sys/alt_log_printf.h system.h - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/ioctl.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart_regs.h: - -HAL/inc/io.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_flag.h: - -drivers/inc/altera_avalon_jtag_uart_fd.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: diff --git a/software/qsys_tutorial_test_bsp/obj/drivers/src/altera_avalon_jtag_uart_read.o b/software/qsys_tutorial_test_bsp/obj/drivers/src/altera_avalon_jtag_uart_read.o deleted file mode 100644 index 8a008d7..0000000 --- a/software/qsys_tutorial_test_bsp/obj/drivers/src/altera_avalon_jtag_uart_read.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/obj/drivers/src/altera_avalon_jtag_uart_write.d b/software/qsys_tutorial_test_bsp/obj/drivers/src/altera_avalon_jtag_uart_write.d deleted file mode 100644 index 5518b7f..0000000 --- a/software/qsys_tutorial_test_bsp/obj/drivers/src/altera_avalon_jtag_uart_write.d +++ /dev/null @@ -1,66 +0,0 @@ -obj/drivers/src/altera_avalon_jtag_uart_write.o: \ - drivers/src/altera_avalon_jtag_uart_write.c HAL/inc/sys/alt_irq.h \ - HAL/inc/nios2.h HAL/inc/alt_types.h system.h linker.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_llist.h \ - HAL/inc/priv/alt_alarm.h HAL/inc/alt_types.h HAL/inc/sys/ioctl.h \ - HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart_regs.h \ - HAL/inc/io.h HAL/inc/alt_types.h drivers/inc/altera_avalon_jtag_uart.h \ - HAL/inc/sys/alt_alarm.h HAL/inc/sys/alt_warning.h HAL/inc/os/alt_sem.h \ - HAL/inc/priv/alt_no_error.h HAL/inc/os/alt_flag.h \ - drivers/inc/altera_avalon_jtag_uart_fd.h HAL/inc/sys/alt_dev.h \ - HAL/inc/sys/alt_llist.h HAL/inc/priv/alt_dev_llist.h \ - HAL/inc/sys/alt_llist.h HAL/inc/sys/alt_log_printf.h system.h - -HAL/inc/sys/alt_irq.h: - -HAL/inc/nios2.h: - -HAL/inc/alt_types.h: - -system.h: - -linker.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_alarm.h: - -HAL/inc/alt_types.h: - -HAL/inc/sys/ioctl.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart_regs.h: - -HAL/inc/io.h: - -HAL/inc/alt_types.h: - -drivers/inc/altera_avalon_jtag_uart.h: - -HAL/inc/sys/alt_alarm.h: - -HAL/inc/sys/alt_warning.h: - -HAL/inc/os/alt_sem.h: - -HAL/inc/priv/alt_no_error.h: - -HAL/inc/os/alt_flag.h: - -drivers/inc/altera_avalon_jtag_uart_fd.h: - -HAL/inc/sys/alt_dev.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/priv/alt_dev_llist.h: - -HAL/inc/sys/alt_llist.h: - -HAL/inc/sys/alt_log_printf.h: - -system.h: diff --git a/software/qsys_tutorial_test_bsp/obj/drivers/src/altera_avalon_jtag_uart_write.o b/software/qsys_tutorial_test_bsp/obj/drivers/src/altera_avalon_jtag_uart_write.o deleted file mode 100644 index 91437f2..0000000 --- a/software/qsys_tutorial_test_bsp/obj/drivers/src/altera_avalon_jtag_uart_write.o +++ /dev/null Binary files differ diff --git a/software/qsys_tutorial_test_bsp/public.mk b/software/qsys_tutorial_test_bsp/public.mk deleted file mode 100644 index 397ab19..0000000 --- a/software/qsys_tutorial_test_bsp/public.mk +++ /dev/null @@ -1,385 +0,0 @@ -#------------------------------------------------------------------------------ -# BSP "PUBLIC" MAKEFILE CONTENT -# -# This file is intended to be included in an application or library -# Makefile that is using this BSP. You can create such a Makefile with -# the nios2-app-generate-makefile or nios2-lib-generate-makefile -# commands. -# -# The following variables must be defined before including this file: -# -# ALT_LIBRARY_ROOT_DIR -# Contains the path to the BSP top-level (aka root) directory -#------------------------------------------------------------------------------ - -#------------------------------------------------------------------------------ -# PATHS -#------------------------------------------------------------------------------ - - - -# Path to the provided linker script. -BSP_LINKER_SCRIPT := $(ALT_LIBRARY_ROOT_DIR)/linker.x - -# Include paths: -# The path to root of all header files that a library wishes to make -# available for an application's use is specified here. Note that this -# may not be *all* folders within a hierarchy. For example, if it is -# desired that the application developer type: -# #include -# #include -# With files laid out like this: -# /inc/sockets.h -# /inc/ip/tcpip.h -# -# Then, only /inc need be added to the list of include -# directories. Alternatively, if you wish to be able to directly include -# all files in a hierarchy, separate paths to each folder in that -# hierarchy must be defined. - -# The following are the "base" set of include paths for a BSP. -# These paths are appended to the list that individual software -# components, drivers, etc., add in the generated portion of this -# file (below). -ALT_INCLUDE_DIRS_TO_APPEND += \ - $(ALT_LIBRARY_ROOT_DIR) \ - $(ALT_LIBRARY_ROOT_DIR)/drivers/inc - -# Additions to linker library search-path: -# Here we provide a path to "our self" for the application to construct a -# "-L " out of. This should contain a list of directories, -# relative to the library root, of all directories with .a files to link -# against. -ALT_LIBRARY_DIRS += $(ALT_LIBRARY_ROOT_DIR) - - -#------------------------------------------------------------------------------ -# COMPILATION FLAGS -#------------------------------------------------------------------------------ -# Default C pre-processor flags for a BSP: -ALT_CPPFLAGS += -DSYSTEM_BUS_WIDTH=32 \ - -pipe - - -#------------------------------------------------------------------------------ -# MANAGED CONTENT -# -# All content between the lines "START MANAGED" and "END MANAGED" below is -# generated based on variables in the BSP settings file when the -# nios2-bsp-generate-files command is invoked. If you wish to persist any -# information pertaining to the build process, it is recomended that you -# utilize the BSP settings mechanism to do so. -#------------------------------------------------------------------------------ -#START MANAGED - -# The following TYPE comment allows tools to identify the 'type' of target this -# makefile is associated with. -# TYPE: BSP_PUBLIC_MAKEFILE - -# This following VERSION comment indicates the version of the tool used to -# generate this makefile. A makefile variable is provided for VERSION as well. -# ACDS_VERSION: 13.0sp1 -ACDS_VERSION := 13.0sp1 - -# This following BUILD_NUMBER comment indicates the build number of the tool -# used to generate this makefile. -# BUILD_NUMBER: 232 - -# Qsys--generated SOPCINFO file. Required for resolving node instance ID's with -# design component names. -SOPCINFO_FILE := C:/Users/takayun/Desktop/qsys_tutorial/nios_system.sopcinfo - -# Big-Endian operation. -# setting BIG_ENDIAN is false -ALT_CFLAGS += -EL - -# Path to the provided C language runtime initialization code. -BSP_CRT0 := $(ALT_LIBRARY_ROOT_DIR)/obj/HAL/src/crt0.o - -# Name of BSP library as provided to linker using the "-msys-lib" flag or -# linker script GROUP command. -# setting BSP_SYS_LIB is hal_bsp -BSP_SYS_LIB := hal_bsp -ELF_PATCH_FLAG += --thread_model hal - -# Type identifier of the BSP library -# setting BSP_TYPE is hal -ALT_CPPFLAGS += -D__hal__ -BSP_TYPE := hal - -# CPU Name -# setting CPU_NAME is nios2_processor -CPU_NAME = nios2_processor -ELF_PATCH_FLAG += --cpu_name $(CPU_NAME) - -# Hardware Divider present. -# setting HARDWARE_DIVIDE is false -ALT_CFLAGS += -mno-hw-div - -# Hardware Multiplier present. -# setting HARDWARE_MULTIPLY is false -ALT_CFLAGS += -mno-hw-mul - -# Hardware Mulx present. -# setting HARDWARE_MULX is false -ALT_CFLAGS += -mno-hw-mulx - -# Debug Core present. -# setting HAS_DEBUG_CORE is true -CPU_HAS_DEBUG_CORE = 1 - -# Qsys generated design -# setting QSYS is 1 -QSYS := 1 -ELF_PATCH_FLAG += --qsys true - -# Design Name -# setting SOPC_NAME is nios_system -SOPC_NAME := nios_system - -# SopcBuilder Simulation Enabled -# setting SOPC_SIMULATION_ENABLED is false -ELF_PATCH_FLAG += --simulation_enabled false - -# Enable JTAG UART driver to recover when host is inactive causing buffer to -# full without returning error. Printf will not fail with this recovery. none -# setting altera_avalon_jtag_uart_driver.enable_jtag_uart_ignore_fifo_full_error is false - -# Small-footprint (polled mode) driver none -# setting altera_avalon_jtag_uart_driver.enable_small_driver is false - -# Build a custom version of newlib with the specified space-separated compiler -# flags. The custom newlib build will be placed in the <bsp root>/newlib -# directory, and will be used only for applications that utilize this BSP. -# setting hal.custom_newlib_flags is none - -# Enable support for a subset of the C++ language. This option increases code -# footprint by adding support for C++ constructors. Certain features, such as -# multiple inheritance and exceptions are not supported. If false, adds -# -DALT_NO_C_PLUS_PLUS to ALT_CPPFLAGS in public.mk, and reduces code -# footprint. none -# setting hal.enable_c_plus_plus is false -ALT_CPPFLAGS += -DALT_NO_C_PLUS_PLUS - -# When your application exits, close file descriptors, call C++ destructors, -# etc. Code footprint can be reduced by disabling clean exit. If disabled, adds -# -DALT_NO_CLEAN_EXIT to ALT_CPPFLAGS and -Wl,--defsym, exit=_exit to -# ALT_LDFLAGS in public.mk. none -# setting hal.enable_clean_exit is false -ALT_CPPFLAGS += -DALT_NO_CLEAN_EXIT -ALT_LDFLAGS += -Wl,--defsym,exit=_exit - -# Add exit() support. This option increases code footprint if your "main()" -# routine does "return" or call "exit()". If false, adds -DALT_NO_EXIT to -# ALT_CPPFLAGS in public.mk, and reduces footprint none -# setting hal.enable_exit is false -ALT_CPPFLAGS += -DALT_NO_EXIT - -# Causes code to be compiled with gprof profiling enabled and the application -# ELF to be linked with the GPROF library. If true, adds -DALT_PROVIDE_GMON to -# ALT_CPPFLAGS and -pg to ALT_CFLAGS in public.mk. none -# setting hal.enable_gprof is false - -# Enables lightweight device driver API. This reduces code and data footprint -# by removing the HAL layer that maps device names (e.g. /dev/uart0) to file -# descriptors. Instead, driver routines are called directly. The open(), -# close(), and lseek() routines will always fail if called. The read(), -# write(), fstat(), ioctl(), and isatty() routines only work for the stdio -# devices. If true, adds -DALT_USE_DIRECT_DRIVERS to ALT_CPPFLAGS in public.mk. -# The Altera Host and read-only ZIP file systems can't be used if -# hal.enable_lightweight_device_driver_api is true. -# setting hal.enable_lightweight_device_driver_api is true -ALT_CPPFLAGS += -DALT_USE_DIRECT_DRIVERS - -# Adds code to emulate multiply and divide instructions in case they are -# executed but aren't present in the CPU. Normally this isn't required because -# the compiler won't use multiply and divide instructions that aren't present -# in the CPU. If false, adds -DALT_NO_INSTRUCTION_EMULATION to ALT_CPPFLAGS in -# public.mk. none -# setting hal.enable_mul_div_emulation is false -ALT_CPPFLAGS += -DALT_NO_INSTRUCTION_EMULATION - -# Certain drivers are compiled with reduced functionality to reduce code -# footprint. Not all drivers observe this setting. The altera_avalon_uart and -# altera_avalon_jtag_uart drivers switch from interrupt-driven to polled -# operation. CAUTION: Several device drivers are disabled entirely. These -# include the altera_avalon_cfi_flash, altera_avalon_epcs_flash_controller, and -# altera_avalon_lcd_16207 drivers. This can result in certain API (HAL flash -# access routines) to fail. You can define a symbol provided by each driver to -# prevent it from being removed. If true, adds -DALT_USE_SMALL_DRIVERS to -# ALT_CPPFLAGS in public.mk. none -# setting hal.enable_reduced_device_drivers is true -ALT_CPPFLAGS += -DALT_USE_SMALL_DRIVERS - -# Turns on HAL runtime stack checking feature. Enabling this setting causes -# additional code to be placed into each subroutine call to generate an -# exception if a stack collision occurs with the heap or statically allocated -# data. If true, adds -DALT_STACK_CHECK and -mstack-check to ALT_CPPFLAGS in -# public.mk. none -# setting hal.enable_runtime_stack_checking is false - -# The BSP is compiled with optimizations to speedup HDL simulation such as -# initializing the cache, clearing the .bss section, and skipping long delay -# loops. If true, adds -DALT_SIM_OPTIMIZE to ALT_CPPFLAGS in public.mk. When -# this setting is true, the BSP shouldn't be used to build applications that -# are expected to run real hardware. -# setting hal.enable_sim_optimize is false - -# Causes the small newlib (C library) to be used. This reduces code and data -# footprint at the expense of reduced functionality. Several newlib features -# are removed such as floating-point support in printf(), stdin input routines, -# and buffered I/O. The small C library is not compatible with Micrium -# MicroC/OS-II. If true, adds -msmallc to ALT_LDFLAGS in public.mk. none -# setting hal.enable_small_c_library is true -ALT_LDFLAGS += -msmallc -ALT_CPPFLAGS += -DSMALL_C_LIB - -# Enable SOPC Builder System ID. If a System ID SOPC Builder component is -# connected to the CPU associated with this BSP, it will be enabled in the -# creation of command-line arguments to download an ELF to the target. -# Otherwise, system ID and timestamp values are left out of public.mk for -# application Makefile "download-elf" target definition. With the system ID -# check disabled, the Nios II EDS tools will not automatically ensure that the -# application .elf file (and BSP it is linked against) corresponds to the -# hardware design on the target. If false, adds --accept-bad-sysid to -# SOPC_SYSID_FLAG in public.mk. none -# setting hal.enable_sopc_sysid_check is true - -# Enable BSP generation to query if SOPC system is big endian. If true ignores -# export of 'ALT_CFLAGS += -EB' to public.mk if big endian system. If true -# ignores export of 'ALT_CFLAGS += -EL' if little endian system. none -# setting hal.make.ignore_system_derived.big_endian is false - -# Enable BSP generation to query if SOPC system has a debug core present. If -# true ignores export of 'CPU_HAS_DEBUG_CORE = 1' to public.mk if a debug core -# is found in the system. If true ignores export of 'CPU_HAS_DEBUG_CORE = 0' if -# no debug core is found in the system. none -# setting hal.make.ignore_system_derived.debug_core_present is false - -# Enable BSP generation to query if SOPC system has FPU present. If true -# ignores export of 'ALT_CFLAGS += -mhard-float' to public.mk if FPU is found -# in the system. If true ignores export of 'ALT_CFLAGS += -mhard-soft' if FPU -# is not found in the system. none -# setting hal.make.ignore_system_derived.fpu_present is false - -# Enable BSP generation to query if SOPC system has hardware divide present. If -# true ignores export of 'ALT_CFLAGS += -mno-hw-div' to public.mk if no -# division is found in system. If true ignores export of 'ALT_CFLAGS += -# -mhw-div' if division is found in the system. none -# setting hal.make.ignore_system_derived.hardware_divide_present is false - -# Enable BSP generation to query if SOPC system floating point custom -# instruction with a divider is present. If true ignores export of 'ALT_CFLAGS -# += -mcustom-fpu-cfg=60-2' and 'ALT_LDFLAGS += -mcustom-fpu-cfg=60-2' to -# public.mk if the custom instruction is found in the system. none -# setting hal.make.ignore_system_derived.hardware_fp_cust_inst_divider_present is false - -# Enable BSP generation to query if SOPC system floating point custom -# instruction without a divider is present. If true ignores export of -# 'ALT_CFLAGS += -mcustom-fpu-cfg=60-1' and 'ALT_LDFLAGS += -# -mcustom-fpu-cfg=60-1' to public.mk if the custom instruction is found in the -# system. none -# setting hal.make.ignore_system_derived.hardware_fp_cust_inst_no_divider_present is false - -# Enable BSP generation to query if SOPC system has multiplier present. If true -# ignores export of 'ALT_CFLAGS += -mno-hw-mul' to public.mk if no multiplier -# is found in the system. If true ignores export of 'ALT_CFLAGS += -mhw-mul' if -# multiplier is found in the system. none -# setting hal.make.ignore_system_derived.hardware_multiplier_present is false - -# Enable BSP generation to query if SOPC system has hardware mulx present. If -# true ignores export of 'ALT_CFLAGS += -mno-hw-mulx' to public.mk if no mulx -# is found in the system. If true ignores export of 'ALT_CFLAGS += -mhw-mulx' -# if mulx is found in the system. none -# setting hal.make.ignore_system_derived.hardware_mulx_present is false - -# Enable BSP generation to query if SOPC system has simulation enabled. If true -# ignores export of 'ELF_PATCH_FLAG += --simulation_enabled' to public.mk. none -# setting hal.make.ignore_system_derived.sopc_simulation_enabled is false - -# Enable BSP generation to query SOPC system for system ID base address. If -# true ignores export of 'SOPC_SYSID_FLAG += --sidp=
' and -# 'ELF_PATCH_FLAG += --sidp=
' to public.mk. none -# setting hal.make.ignore_system_derived.sopc_system_base_address is false - -# Enable BSP generation to query SOPC system for system ID. If true ignores -# export of 'SOPC_SYSID_FLAG += --id=' and 'ELF_PATCH_FLAG += -# --id=' to public.mk. none -# setting hal.make.ignore_system_derived.sopc_system_id is false - -# Enable BSP generation to query SOPC system for system timestamp. If true -# ignores export of 'SOPC_SYSID_FLAG += --timestamp=' and -# 'ELF_PATCH_FLAG += --timestamp=' to public.mk. none -# setting hal.make.ignore_system_derived.sopc_system_timestamp is false - -# Slave descriptor of STDERR character-mode device. This setting is used by the -# ALT_STDERR family of defines in system.h. none -# setting hal.stderr is jtag_uart -ELF_PATCH_FLAG += --stderr_dev jtag_uart - -# Slave descriptor of STDIN character-mode device. This setting is used by the -# ALT_STDIN family of defines in system.h. none -# setting hal.stdin is jtag_uart -ELF_PATCH_FLAG += --stdin_dev jtag_uart - -# Slave descriptor of STDOUT character-mode device. This setting is used by the -# ALT_STDOUT family of defines in system.h. none -# setting hal.stdout is jtag_uart -ELF_PATCH_FLAG += --stdout_dev jtag_uart - - -#------------------------------------------------------------------------------ -# SOFTWARE COMPONENT & DRIVER INCLUDE PATHS -#------------------------------------------------------------------------------ - -ALT_INCLUDE_DIRS += $(ALT_LIBRARY_ROOT_DIR)/HAL/inc - -#------------------------------------------------------------------------------ -# SOFTWARE COMPONENT & DRIVER PRODUCED ALT_CPPFLAGS ADDITIONS -#------------------------------------------------------------------------------ - -ALT_CPPFLAGS += -DALT_SINGLE_THREADED - -#END MANAGED - - -#------------------------------------------------------------------------------ -# LIBRARY INFORMATION -#------------------------------------------------------------------------------ -# Assemble the name of the BSP *.a file using the BSP library name -# (BSP_SYS_LIB) in generated content above. -BSP_LIB := lib$(BSP_SYS_LIB).a - -# Additional libraries to link against: -# An application including this file will prefix each library with "-l". -# For example, to include the Newlib math library "m" is included, which -# becomes "-lm" when linking the application. -ALT_LIBRARY_NAMES += m - -# Additions to linker dependencies: -# An application Makefile will typically add these directly to the list -# of dependencies required to build the executable target(s). The BSP -# library (*.a) file is specified here. -ALT_LDDEPS += $(ALT_LIBRARY_ROOT_DIR)/$(BSP_LIB) - -# Is this library "Makeable"? -# Add to list of root library directories that support running 'make' -# to build them. Because libraries may or may not have a Makefile in their -# root, appending to this variable tells an application to run 'make' in -# the library root to build/update this library. -MAKEABLE_LIBRARY_ROOT_DIRS += $(ALT_LIBRARY_ROOT_DIR) - -# Additional Assembler Flags -# -gdwarf2 flag is required for stepping through assembly code -ALT_ASFLAGS += -gdwarf2 - -#------------------------------------------------------------------------------ -# FINAL INCLUDE PATH LIST -#------------------------------------------------------------------------------ -# Append static include paths to paths specified by OS/driver/sw package -# additions to the BSP thus giving them precedence in case a BSP addition -# is attempting to override BSP sources. -ALT_INCLUDE_DIRS += $(ALT_INCLUDE_DIRS_TO_APPEND) - - - diff --git a/software/qsys_tutorial_test_bsp/settings.bsp b/software/qsys_tutorial_test_bsp/settings.bsp deleted file mode 100644 index 2aafe5e..0000000 --- a/software/qsys_tutorial_test_bsp/settings.bsp +++ /dev/null @@ -1,913 +0,0 @@ - - - hal - default - 2016/10/27 9:21:10 - 1477527670120 - C:\Users\takayun\Desktop\qsys_tutorial\software\qsys_tutorial_test_bsp - .\settings.bsp - C:\Users\takayun\Desktop\qsys_tutorial\nios_system.sopcinfo - default - nios2_processor - 1.9 - - hal.sys_clk_timer - ALT_SYS_CLK - UnquotedString - none - none - system_h_define - Slave descriptor of the system clock timer device. This device provides a periodic interrupt ("tick") and is typically required for RTOS use. This setting defines the value of ALT_SYS_CLK in system.h. - none - false - common - - - hal.timestamp_timer - ALT_TIMESTAMP_CLK - UnquotedString - none - none - system_h_define - Slave descriptor of timestamp timer device. This device is used by Altera HAL timestamp drivers for high-resolution time measurement. This setting defines the value of ALT_TIMESTAMP_CLK in system.h. - none - false - common - - - hal.max_file_descriptors - ALT_MAX_FD - DecimalNumber - 4 - 32 - system_h_define - Determines the number of file descriptors statically allocated. This setting defines the value of ALT_MAX_FD in system.h. - If hal.enable_lightweight_device_driver_api is true, there are no file descriptors so this setting is ignored. If hal.enable_lightweight_device_driver_api is false, this setting must be at least 4 because HAL needs a file descriptor for /dev/null, /dev/stdin, /dev/stdout, and /dev/stderr. - false - - - - hal.enable_instruction_related_exceptions_api - ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API - BooleanDefineOnly - false - false - system_h_define - Enables API for registering handlers to service instruction-related exceptions. Enabling this setting increases the size of the exception entry code. - These exception types can be generated if various processor options are enabled, such as the MMU, MPU, or other advanced exception types. - false - - - - hal.linker.allow_code_at_reset - ALT_ALLOW_CODE_AT_RESET - Boolean - 1 - 0 - none - Indicates if initialization code is allowed at the reset address. If true, defines the macro ALT_ALLOW_CODE_AT_RESET in linker.h. - If true, defines the macro ALT_ALLOW_CODE_AT_RESET in linker.h. This setting is typically false if an external bootloader (e.g. flash bootloader) is present. - false - - - - hal.linker.enable_alt_load - NONE - Boolean - 1 - 0 - none - Enables the alt_load() facility. The alt_load() facility copies sections from the .text memory into RAM. If true, this setting sets up the VMA/LMA of sections in linker.x to allow them to be loaded into the .text memory. - This setting is typically false if an external bootloader (e.g. flash bootloader) is present. - false - - - - hal.linker.enable_alt_load_copy_rodata - NONE - Boolean - 0 - 0 - none - Causes the alt_load() facility to copy the .rodata section. If true, this setting defines the macro ALT_LOAD_COPY_RODATA in linker.h. - none - false - - - - hal.linker.enable_alt_load_copy_rwdata - NONE - Boolean - 1 - 0 - none - Causes the alt_load() facility to copy the .rwdata section. If true, this setting defines the macro ALT_LOAD_COPY_RWDATA in linker.h. - none - false - - - - hal.linker.enable_alt_load_copy_exceptions - NONE - Boolean - 0 - 0 - none - Causes the alt_load() facility to copy the .exceptions section. If true, this setting defines the macro ALT_LOAD_COPY_EXCEPTIONS in linker.h. - none - false - - - - hal.linker.enable_exception_stack - NONE - Boolean - 0 - 0 - none - Enables use of a separate exception stack. If true, defines the macro ALT_EXCEPTION_STACK in linker.h, adds a memory region called exception_stack to linker.x, and provides the symbols __alt_exception_stack_pointer and __alt_exception_stack_limit in linker.x. - The hal.linker.exception_stack_size and hal.linker.exception_stack_memory_region_name settings must also be valid. This setting must be false for MicroC/OS-II BSPs. The exception stack can be used to improve interrupt and other exception performance if the EIC is *not* used. - false - common - - - hal.linker.exception_stack_size - NONE - DecimalNumber - 1024 - 1024 - none - Size of the exception stack in bytes. - Only used if hal.linker.enable_exception_stack is true. - false - common - - - hal.linker.exception_stack_memory_region_name - NONE - UnquotedString - onchip_memory - none - none - Name of the existing memory region that will be divided up to create the 'exception_stack' memory region. The selected region name will be adjusted automatically when the BSP is generated to create the 'exception_stack' memory region. - Only used if hal.linker.enable_exception_stack is true. - false - common - - - hal.linker.enable_interrupt_stack - NONE - Boolean - 0 - 0 - none - Enables use of a separate interrupt stack. If true, defines the macro ALT_INTERRUPT_STACK in linker.h, adds a memory region called interrupt_stack to linker.x, and provides the symbols __alt_interrupt_stack_pointer and __alt_interrupt_stack_limit in linker.x. - The hal.linker.interrupt_stack_size and hal.linker.interrupt_stack_memory_region_name settings must also be valid. This setting must be false for MicroC/OS-II BSPs. Only enable if the EIC is used exclusively. The exception stack can be used to improve interrupt and other exception performance if the EIC is *not* used. - false - common - - - hal.linker.interrupt_stack_size - NONE - DecimalNumber - 1024 - 1024 - none - Size of the interrupt stack in bytes. - Only used if hal.linker.enable_interrupt_stack is true. - false - common - - - hal.linker.interrupt_stack_memory_region_name - NONE - UnquotedString - onchip_memory - none - none - Name of the existing memory region that will be divided up to create the 'interrupt_stack' memory region. The selected region name will be adjusted automatically when the BSP is generated to create the 'interrupt_stack' memory region. - Only used if hal.linker.enable_interrupt_stack is true. - false - common - - - hal.stdin - NONE - UnquotedString - jtag_uart - none - system_h_define - Slave descriptor of STDIN character-mode device. This setting is used by the ALT_STDIN family of defines in system.h. - none - false - common - - - hal.stdout - NONE - UnquotedString - jtag_uart - none - system_h_define - Slave descriptor of STDOUT character-mode device. This setting is used by the ALT_STDOUT family of defines in system.h. - none - false - common - - - hal.stderr - NONE - UnquotedString - jtag_uart - none - system_h_define - Slave descriptor of STDERR character-mode device. This setting is used by the ALT_STDERR family of defines in system.h. - none - false - common - - - hal.log_port - NONE - UnquotedString - none - none - public_mk_define - Slave descriptor of debug logging character-mode device. If defined, it enables extra debug messages in the HAL source. This setting is used by the ALT_LOG_PORT family of defines in system.h. - none - false - none - - - hal.make.build_pre_process - BUILD_PRE_PROCESS - UnquotedString - none - none - makefile_variable - Command executed before BSP built. - none - false - none - - - hal.make.ar_pre_process - AR_PRE_PROCESS - UnquotedString - none - none - makefile_variable - Command executed before archiver execution. - none - false - none - - - hal.make.bsp_cflags_defined_symbols - BSP_CFLAGS_DEFINED_SYMBOLS - UnquotedString - none - none - makefile_variable - Preprocessor macros to define. A macro definition in this setting has the same effect as a "#define" in source code. Adding "-DALT_DEBUG" to this setting has the same effect as "#define ALT_DEBUG" in a souce file. Adding "-DFOO=1" to this setting is equivalent to the macro "#define FOO 1" in a source file. Macros defined with this setting are applied to all .S, .c, and C++ files in the BSP. This setting defines the value of BSP_CFLAGS_DEFINED_SYMBOLS in the BSP Makefile. - none - false - none - - - hal.make.ar_post_process - AR_POST_PROCESS - UnquotedString - none - none - makefile_variable - Command executed after archiver execution. - none - false - none - - - hal.make.as - AS - UnquotedString - nios2-elf-gcc - nios2-elf-gcc - makefile_variable - Assembler command. Note that CC is used for .S files. - none - false - none - - - hal.make.build_post_process - BUILD_POST_PROCESS - UnquotedString - none - none - makefile_variable - Command executed after BSP built. - none - false - none - - - hal.make.bsp_cflags_debug - BSP_CFLAGS_DEBUG - UnquotedString - -g - -g - makefile_variable - C/C++ compiler debug level. '-g' provides the default set of debug symbols typically required to debug a typical application. Omitting '-g' removes debug symbols from the ELF. This setting defines the value of BSP_CFLAGS_DEBUG in Makefile. - none - false - common - - - hal.make.ar - AR - UnquotedString - nios2-elf-ar - nios2-elf-ar - makefile_variable - Archiver command. Creates library files. - none - false - none - - - hal.make.rm - RM - UnquotedString - rm -f - rm -f - makefile_variable - Command used to remove files during 'clean' target. - none - false - none - - - hal.make.cxx_pre_process - CXX_PRE_PROCESS - UnquotedString - none - none - makefile_variable - Command executed before each C++ file is compiled. - none - false - none - - - hal.make.bsp_cflags_warnings - BSP_CFLAGS_WARNINGS - UnquotedString - -Wall - -Wall - makefile_variable - C/C++ compiler warning level. "-Wall" is commonly used.This setting defines the value of BSP_CFLAGS_WARNINGS in Makefile. - none - false - none - - - hal.make.bsp_arflags - BSP_ARFLAGS - UnquotedString - -src - -src - makefile_variable - Custom flags only passed to the archiver. This content of this variable is directly passed to the archiver rather than the more standard "ARFLAGS". The reason for this is that GNU Make assumes some default content in ARFLAGS. This setting defines the value of BSP_ARFLAGS in Makefile. - none - false - none - - - hal.make.bsp_cflags_optimization - BSP_CFLAGS_OPTIMIZATION - UnquotedString - '-Os' - -O0 - makefile_variable - C/C++ compiler optimization level. "-O0" = no optimization,"-O2" = "normal" optimization, etc. "-O0" is recommended for code that you want to debug since compiler optimization can remove variables and produce non-sequential execution of code while debugging. This setting defines the value of BSP_CFLAGS_OPTIMIZATION in Makefile. - none - false - common - - - hal.make.as_post_process - AS_POST_PROCESS - UnquotedString - none - none - makefile_variable - Command executed after each assembly file is compiled. - none - false - none - - - hal.make.cc_pre_process - CC_PRE_PROCESS - UnquotedString - none - none - makefile_variable - Command executed before each .c/.S file is compiled. - none - false - none - - - hal.make.bsp_asflags - BSP_ASFLAGS - UnquotedString - -Wa,-gdwarf2 - -Wa,-gdwarf2 - makefile_variable - Custom flags only passed to the assembler. This setting defines the value of BSP_ASFLAGS in Makefile. - none - false - none - - - hal.make.as_pre_process - AS_PRE_PROCESS - UnquotedString - none - none - makefile_variable - Command executed before each assembly file is compiled. - none - false - none - - - hal.make.bsp_cflags_undefined_symbols - BSP_CFLAGS_UNDEFINED_SYMBOLS - UnquotedString - none - none - makefile_variable - Preprocessor macros to undefine. Undefined macros are similar to defined macros, but replicate the "#undef" directive in source code. To undefine the macro FOO use the syntax "-u FOO" in this setting. This is equivalent to "#undef FOO" in a source file. Note: the syntax differs from macro definition (there is a space, i.e. "-u FOO" versus "-DFOO"). Macros defined with this setting are applied to all .S, .c, and C++ files in the BSP. This setting defines the value of BSP_CFLAGS_UNDEFINED_SYMBOLS in the BSP Makefile. - none - false - none - - - hal.make.cc_post_process - CC_POST_PROCESS - UnquotedString - none - none - makefile_variable - Command executed after each .c/.S file is compiled. - none - false - none - - - hal.make.cxx_post_process - CXX_POST_PROCESS - UnquotedString - none - none - makefile_variable - Command executed before each C++ file is compiled. - none - false - none - - - hal.make.cc - CC - UnquotedString - nios2-elf-gcc -xc - nios2-elf-gcc -xc - makefile_variable - C compiler command. - none - false - none - - - hal.make.bsp_cxx_flags - BSP_CXXFLAGS - UnquotedString - none - none - makefile_variable - Custom flags only passed to the C++ compiler. This setting defines the value of BSP_CXXFLAGS in Makefile. - none - false - none - - - hal.make.bsp_inc_dirs - BSP_INC_DIRS - UnquotedString - none - none - makefile_variable - Space separated list of extra include directories to scan for header files. Directories are relative to the top-level BSP directory. The -I prefix's added by the makefile so don't add it here. This setting defines the value of BSP_INC_DIRS in Makefile. - none - false - none - - - hal.make.cxx - CXX - UnquotedString - nios2-elf-gcc -xc++ - nios2-elf-gcc -xc++ - makefile_variable - C++ compiler command. - none - false - none - - - hal.make.bsp_cflags_user_flags - BSP_CFLAGS_USER_FLAGS - UnquotedString - none - none - makefile_variable - Custom flags passed to the compiler when compiling C, C++, and .S files. This setting defines the value of BSP_CFLAGS_USER_FLAGS in Makefile. - none - false - none - - - hal.make.ignore_system_derived.sopc_system_id - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query SOPC system for system ID. If true ignores export of 'SOPC_SYSID_FLAG += --id=<sysid>' and 'ELF_PATCH_FLAG += --id=<sysid>' to public.mk. - none - false - none - - - hal.make.ignore_system_derived.sopc_system_timestamp - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query SOPC system for system timestamp. If true ignores export of 'SOPC_SYSID_FLAG += --timestamp=<timestamp>' and 'ELF_PATCH_FLAG += --timestamp=<timestamp>' to public.mk. - none - false - none - - - hal.make.ignore_system_derived.sopc_system_base_address - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query SOPC system for system ID base address. If true ignores export of 'SOPC_SYSID_FLAG += --sidp=<address>' and 'ELF_PATCH_FLAG += --sidp=<address>' to public.mk. - none - false - none - - - hal.make.ignore_system_derived.sopc_simulation_enabled - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system has simulation enabled. If true ignores export of 'ELF_PATCH_FLAG += --simulation_enabled' to public.mk. - none - false - none - - - hal.make.ignore_system_derived.fpu_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system has FPU present. If true ignores export of 'ALT_CFLAGS += -mhard-float' to public.mk if FPU is found in the system. If true ignores export of 'ALT_CFLAGS += -mhard-soft' if FPU is not found in the system. - none - false - none - - - hal.make.ignore_system_derived.hardware_multiplier_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system has multiplier present. If true ignores export of 'ALT_CFLAGS += -mno-hw-mul' to public.mk if no multiplier is found in the system. If true ignores export of 'ALT_CFLAGS += -mhw-mul' if multiplier is found in the system. - none - false - none - - - hal.make.ignore_system_derived.hardware_mulx_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system has hardware mulx present. If true ignores export of 'ALT_CFLAGS += -mno-hw-mulx' to public.mk if no mulx is found in the system. If true ignores export of 'ALT_CFLAGS += -mhw-mulx' if mulx is found in the system. - none - false - none - - - hal.make.ignore_system_derived.hardware_divide_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system has hardware divide present. If true ignores export of 'ALT_CFLAGS += -mno-hw-div' to public.mk if no division is found in system. If true ignores export of 'ALT_CFLAGS += -mhw-div' if division is found in the system. - none - false - none - - - hal.make.ignore_system_derived.debug_core_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system has a debug core present. If true ignores export of 'CPU_HAS_DEBUG_CORE = 1' to public.mk if a debug core is found in the system. If true ignores export of 'CPU_HAS_DEBUG_CORE = 0' if no debug core is found in the system. - none - false - none - - - hal.make.ignore_system_derived.big_endian - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system is big endian. If true ignores export of 'ALT_CFLAGS += -EB' to public.mk if big endian system. If true ignores export of 'ALT_CFLAGS += -EL' if little endian system. - none - false - none - - - hal.make.ignore_system_derived.hardware_fp_cust_inst_divider_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system floating point custom instruction with a divider is present. If true ignores export of 'ALT_CFLAGS += -mcustom-fpu-cfg=60-2' and 'ALT_LDFLAGS += -mcustom-fpu-cfg=60-2' to public.mk if the custom instruction is found in the system. - none - false - none - - - hal.make.ignore_system_derived.hardware_fp_cust_inst_no_divider_present - NONE - Boolean - 0 - 0 - public_mk_define - Enable BSP generation to query if SOPC system floating point custom instruction without a divider is present. If true ignores export of 'ALT_CFLAGS += -mcustom-fpu-cfg=60-1' and 'ALT_LDFLAGS += -mcustom-fpu-cfg=60-1' to public.mk if the custom instruction is found in the system. - none - false - none - - - hal.enable_exit - ALT_NO_EXIT - Boolean - 0 - 1 - public_mk_define - Add exit() support. This option increases code footprint if your "main()" routine does "return" or call "exit()". If false, adds -DALT_NO_EXIT to ALT_CPPFLAGS in public.mk, and reduces footprint - none - false - none - - - hal.enable_small_c_library - NONE - Boolean - 1 - 0 - public_mk_define - Causes the small newlib (C library) to be used. This reduces code and data footprint at the expense of reduced functionality. Several newlib features are removed such as floating-point support in printf(), stdin input routines, and buffered I/O. The small C library is not compatible with Micrium MicroC/OS-II. If true, adds -msmallc to ALT_LDFLAGS in public.mk. - none - false - common - - - hal.enable_clean_exit - ALT_NO_CLEAN_EXIT - Boolean - 0 - 1 - public_mk_define - When your application exits, close file descriptors, call C++ destructors, etc. Code footprint can be reduced by disabling clean exit. If disabled, adds -DALT_NO_CLEAN_EXIT to ALT_CPPFLAGS and -Wl,--defsym, exit=_exit to ALT_LDFLAGS in public.mk. - none - false - none - - - hal.enable_runtime_stack_checking - ALT_STACK_CHECK - Boolean - 0 - 0 - public_mk_define - Turns on HAL runtime stack checking feature. Enabling this setting causes additional code to be placed into each subroutine call to generate an exception if a stack collision occurs with the heap or statically allocated data. If true, adds -DALT_STACK_CHECK and -mstack-check to ALT_CPPFLAGS in public.mk. - none - false - none - - - hal.enable_gprof - ALT_PROVIDE_GMON - Boolean - 0 - 0 - public_mk_define - Causes code to be compiled with gprof profiling enabled and the application ELF to be linked with the GPROF library. If true, adds -DALT_PROVIDE_GMON to ALT_CPPFLAGS and -pg to ALT_CFLAGS in public.mk. - none - false - common - - - hal.enable_c_plus_plus - ALT_NO_C_PLUS_PLUS - Boolean - 0 - 1 - public_mk_define - Enable support for a subset of the C++ language. This option increases code footprint by adding support for C++ constructors. Certain features, such as multiple inheritance and exceptions are not supported. If false, adds -DALT_NO_C_PLUS_PLUS to ALT_CPPFLAGS in public.mk, and reduces code footprint. - none - false - none - - - hal.enable_reduced_device_drivers - ALT_USE_SMALL_DRIVERS - Boolean - 1 - 0 - public_mk_define - Certain drivers are compiled with reduced functionality to reduce code footprint. Not all drivers observe this setting. The altera_avalon_uart and altera_avalon_jtag_uart drivers switch from interrupt-driven to polled operation. CAUTION: Several device drivers are disabled entirely. These include the altera_avalon_cfi_flash, altera_avalon_epcs_flash_controller, and altera_avalon_lcd_16207 drivers. This can result in certain API (HAL flash access routines) to fail. You can define a symbol provided by each driver to prevent it from being removed. If true, adds -DALT_USE_SMALL_DRIVERS to ALT_CPPFLAGS in public.mk. - none - false - common - - - hal.enable_lightweight_device_driver_api - ALT_USE_DIRECT_DRIVERS - Boolean - 1 - 0 - public_mk_define - Enables lightweight device driver API. This reduces code and data footprint by removing the HAL layer that maps device names (e.g. /dev/uart0) to file descriptors. Instead, driver routines are called directly. The open(), close(), and lseek() routines will always fail if called. The read(), write(), fstat(), ioctl(), and isatty() routines only work for the stdio devices. If true, adds -DALT_USE_DIRECT_DRIVERS to ALT_CPPFLAGS in public.mk. - The Altera Host and read-only ZIP file systems can't be used if hal.enable_lightweight_device_driver_api is true. - false - none - - - hal.enable_mul_div_emulation - ALT_NO_INSTRUCTION_EMULATION - Boolean - 0 - 0 - public_mk_define - Adds code to emulate multiply and divide instructions in case they are executed but aren't present in the CPU. Normally this isn't required because the compiler won't use multiply and divide instructions that aren't present in the CPU. If false, adds -DALT_NO_INSTRUCTION_EMULATION to ALT_CPPFLAGS in public.mk. - none - false - none - - - hal.enable_sim_optimize - ALT_SIM_OPTIMIZE - Boolean - 0 - 0 - public_mk_define - The BSP is compiled with optimizations to speedup HDL simulation such as initializing the cache, clearing the .bss section, and skipping long delay loops. If true, adds -DALT_SIM_OPTIMIZE to ALT_CPPFLAGS in public.mk. - When this setting is true, the BSP shouldn't be used to build applications that are expected to run real hardware. - false - common - - - hal.enable_sopc_sysid_check - NONE - Boolean - 1 - 1 - public_mk_define - Enable SOPC Builder System ID. If a System ID SOPC Builder component is connected to the CPU associated with this BSP, it will be enabled in the creation of command-line arguments to download an ELF to the target. Otherwise, system ID and timestamp values are left out of public.mk for application Makefile "download-elf" target definition. With the system ID check disabled, the Nios II EDS tools will not automatically ensure that the application .elf file (and BSP it is linked against) corresponds to the hardware design on the target. If false, adds --accept-bad-sysid to SOPC_SYSID_FLAG in public.mk. - none - false - none - - - hal.custom_newlib_flags - CUSTOM_NEWLIB_FLAGS - UnquotedString - none - none - public_mk_define - Build a custom version of newlib with the specified space-separated compiler flags. - The custom newlib build will be placed in the &lt;bsp root>/newlib directory, and will be used only for applications that utilize this BSP. - false - none - - - hal.log_flags - ALT_LOG_FLAGS - DecimalNumber - 0 - 0 - public_mk_define - The value is assigned to ALT_LOG_FLAGS in the generated public.mk. See hal.log_port setting description. Values can be -1 through 3. - hal.log_port must be set for this to be used. - false - none - - - altera_avalon_jtag_uart_driver.enable_small_driver - ALTERA_AVALON_JTAG_UART_SMALL - BooleanDefineOnly - false - false - public_mk_define - Small-footprint (polled mode) driver - none - false - - - - altera_avalon_jtag_uart_driver.enable_jtag_uart_ignore_fifo_full_error - ALTERA_AVALON_JTAG_UART_IGNORE_FIFO_FULL_ERROR - BooleanDefineOnly - false - false - public_mk_define - Enable JTAG UART driver to recover when host is inactive causing buffer to full without returning error. Printf will not fail with this recovery. - none - false - - - - onchip_memory - 0x00000000 - 0x00000FFF - 4096 - memory - - - switches - 0x00002000 - 0x0000200F - 16 - - - - LEDs - 0x00002010 - 0x0000201F - 16 - - - - jtag_uart - 0x00002020 - 0x00002027 - 8 - printable - - - .text - onchip_memory - - - .rodata - onchip_memory - - - .rwdata - onchip_memory - - - .bss - onchip_memory - - - .heap - onchip_memory - - - .stack - onchip_memory - - \ No newline at end of file diff --git a/software/qsys_tutorial_test_bsp/summary.html b/software/qsys_tutorial_test_bsp/summary.html deleted file mode 100644 index 7de3224..0000000 --- a/software/qsys_tutorial_test_bsp/summary.html +++ /dev/null @@ -1,2008 +0,0 @@ - -Altera Nios II BSP Summary - -

BSP Description

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
BSP Type:hal
SOPC Design File:C:\Users\takayun\Desktop\qsys_tutorial\nios_system.sopcinfo
Quartus JDI File:default
CPU:nios2_processor
BSP Settings File:.\settings.bsp
BSP Version:default
BSP Generated On:2016/10/27 9:21:10
BSP Generated Timestamp:1477527670120
BSP Generated Location:C:\Users\takayun\Desktop\qsys_tutorial\software\qsys_tutorial_test_bsp
-
-

Nios II Memory Map

- - - - - - - - - - - - - - - - -
Slave DescriptorAddress RangeSizeAttributes
jtag_uart0x00002020 - 0x000020278printable
LEDs0x00002010 - 0x0000201F16 
switches0x00002000 - 0x0000200F16 
onchip_memory0x00000000 - 0x00000FFF4096memory
-
-
-

Linker Regions

- - - - -
RegionAddress RangeSizeMemoryOffset
-
-
-

Linker Section Mappings

- - - - - - - - - - - - - - - - - - - - - - -
SectionRegion
.textonchip_memory
.rodataonchip_memory
.rwdataonchip_memory
.bssonchip_memory
.heaponchip_memory
.stackonchip_memory
-

Settings

- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:altera_avalon_jtag_uart_driver.enable_jtag_uart_ignore_fifo_full_error
Identifier:ALTERA_AVALON_JTAG_UART_IGNORE_FIFO_FULL_ERROR
Default Value:false
Value:false
Type:BooleanDefineOnly
Destination:public_mk_define
Description:Enable JTAG UART driver to recover when host is inactive causing buffer to full without returning error. Printf will not fail with this recovery.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:altera_avalon_jtag_uart_driver.enable_small_driver
Identifier:ALTERA_AVALON_JTAG_UART_SMALL
Default Value:false
Value:false
Type:BooleanDefineOnly
Destination:public_mk_define
Description:Small-footprint (polled mode) driver
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.custom_newlib_flags
Identifier:CUSTOM_NEWLIB_FLAGS
Default Value:none
Value:none
Type:UnquotedString
Destination:public_mk_define
Description:Build a custom version of newlib with the specified space-separated compiler flags.
Restrictions:The custom newlib build will be placed in the &lt;bsp root>/newlib directory, and will be used only for applications that utilize this BSP.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_c_plus_plus
Identifier:ALT_NO_C_PLUS_PLUS
Default Value:1
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable support for a subset of the C++ language. This option increases code footprint by adding support for C++ constructors. Certain features, such as multiple inheritance and exceptions are not supported. If false, adds -DALT_NO_C_PLUS_PLUS to ALT_CPPFLAGS in public.mk, and reduces code footprint.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_clean_exit
Identifier:ALT_NO_CLEAN_EXIT
Default Value:1
Value:0
Type:Boolean
Destination:public_mk_define
Description:When your application exits, close file descriptors, call C++ destructors, etc. Code footprint can be reduced by disabling clean exit. If disabled, adds -DALT_NO_CLEAN_EXIT to ALT_CPPFLAGS and -Wl,--defsym, exit=_exit to ALT_LDFLAGS in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_exit
Identifier:ALT_NO_EXIT
Default Value:1
Value:0
Type:Boolean
Destination:public_mk_define
Description:Add exit() support. This option increases code footprint if your "main()" routine does "return" or call "exit()". If false, adds -DALT_NO_EXIT to ALT_CPPFLAGS in public.mk, and reduces footprint
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_gprof
Identifier:ALT_PROVIDE_GMON
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Causes code to be compiled with gprof profiling enabled and the application ELF to be linked with the GPROF library. If true, adds -DALT_PROVIDE_GMON to ALT_CPPFLAGS and -pg to ALT_CFLAGS in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_instruction_related_exceptions_api
Identifier:ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API
Default Value:false
Value:false
Type:BooleanDefineOnly
Destination:system_h_define
Description:Enables API for registering handlers to service instruction-related exceptions. Enabling this setting increases the size of the exception entry code.
Restrictions:These exception types can be generated if various processor options are enabled, such as the MMU, MPU, or other advanced exception types.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_lightweight_device_driver_api
Identifier:ALT_USE_DIRECT_DRIVERS
Default Value:0
Value:1
Type:Boolean
Destination:public_mk_define
Description:Enables lightweight device driver API. This reduces code and data footprint by removing the HAL layer that maps device names (e.g. /dev/uart0) to file descriptors. Instead, driver routines are called directly. The open(), close(), and lseek() routines will always fail if called. The read(), write(), fstat(), ioctl(), and isatty() routines only work for the stdio devices. If true, adds -DALT_USE_DIRECT_DRIVERS to ALT_CPPFLAGS in public.mk.
Restrictions:The Altera Host and read-only ZIP file systems can't be used if hal.enable_lightweight_device_driver_api is true.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_mul_div_emulation
Identifier:ALT_NO_INSTRUCTION_EMULATION
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Adds code to emulate multiply and divide instructions in case they are executed but aren't present in the CPU. Normally this isn't required because the compiler won't use multiply and divide instructions that aren't present in the CPU. If false, adds -DALT_NO_INSTRUCTION_EMULATION to ALT_CPPFLAGS in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_reduced_device_drivers
Identifier:ALT_USE_SMALL_DRIVERS
Default Value:0
Value:1
Type:Boolean
Destination:public_mk_define
Description:Certain drivers are compiled with reduced functionality to reduce code footprint. Not all drivers observe this setting. The altera_avalon_uart and altera_avalon_jtag_uart drivers switch from interrupt-driven to polled operation. CAUTION: Several device drivers are disabled entirely. These include the altera_avalon_cfi_flash, altera_avalon_epcs_flash_controller, and altera_avalon_lcd_16207 drivers. This can result in certain API (HAL flash access routines) to fail. You can define a symbol provided by each driver to prevent it from being removed. If true, adds -DALT_USE_SMALL_DRIVERS to ALT_CPPFLAGS in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_runtime_stack_checking
Identifier:ALT_STACK_CHECK
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Turns on HAL runtime stack checking feature. Enabling this setting causes additional code to be placed into each subroutine call to generate an exception if a stack collision occurs with the heap or statically allocated data. If true, adds -DALT_STACK_CHECK and -mstack-check to ALT_CPPFLAGS in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_sim_optimize
Identifier:ALT_SIM_OPTIMIZE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:The BSP is compiled with optimizations to speedup HDL simulation such as initializing the cache, clearing the .bss section, and skipping long delay loops. If true, adds -DALT_SIM_OPTIMIZE to ALT_CPPFLAGS in public.mk.
Restrictions:When this setting is true, the BSP shouldn't be used to build applications that are expected to run real hardware.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_small_c_library
Identifier:NONE
Default Value:0
Value:1
Type:Boolean
Destination:public_mk_define
Description:Causes the small newlib (C library) to be used. This reduces code and data footprint at the expense of reduced functionality. Several newlib features are removed such as floating-point support in printf(), stdin input routines, and buffered I/O. The small C library is not compatible with Micrium MicroC/OS-II. If true, adds -msmallc to ALT_LDFLAGS in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.enable_sopc_sysid_check
Identifier:NONE
Default Value:1
Value:1
Type:Boolean
Destination:public_mk_define
Description:Enable SOPC Builder System ID. If a System ID SOPC Builder component is connected to the CPU associated with this BSP, it will be enabled in the creation of command-line arguments to download an ELF to the target. Otherwise, system ID and timestamp values are left out of public.mk for application Makefile "download-elf" target definition. With the system ID check disabled, the Nios II EDS tools will not automatically ensure that the application .elf file (and BSP it is linked against) corresponds to the hardware design on the target. If false, adds --accept-bad-sysid to SOPC_SYSID_FLAG in public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.allow_code_at_reset
Identifier:ALT_ALLOW_CODE_AT_RESET
Default Value:0
Value:1
Type:Boolean
Destination:none
Description:Indicates if initialization code is allowed at the reset address. If true, defines the macro ALT_ALLOW_CODE_AT_RESET in linker.h.
Restrictions:If true, defines the macro ALT_ALLOW_CODE_AT_RESET in linker.h. This setting is typically false if an external bootloader (e.g. flash bootloader) is present.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.enable_alt_load
Identifier:NONE
Default Value:0
Value:1
Type:Boolean
Destination:none
Description:Enables the alt_load() facility. The alt_load() facility copies sections from the .text memory into RAM. If true, this setting sets up the VMA/LMA of sections in linker.x to allow them to be loaded into the .text memory.
Restrictions:This setting is typically false if an external bootloader (e.g. flash bootloader) is present.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.enable_alt_load_copy_exceptions
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:none
Description:Causes the alt_load() facility to copy the .exceptions section. If true, this setting defines the macro ALT_LOAD_COPY_EXCEPTIONS in linker.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.enable_alt_load_copy_rodata
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:none
Description:Causes the alt_load() facility to copy the .rodata section. If true, this setting defines the macro ALT_LOAD_COPY_RODATA in linker.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.enable_alt_load_copy_rwdata
Identifier:NONE
Default Value:0
Value:1
Type:Boolean
Destination:none
Description:Causes the alt_load() facility to copy the .rwdata section. If true, this setting defines the macro ALT_LOAD_COPY_RWDATA in linker.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.enable_exception_stack
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:none
Description:Enables use of a separate exception stack. If true, defines the macro ALT_EXCEPTION_STACK in linker.h, adds a memory region called exception_stack to linker.x, and provides the symbols __alt_exception_stack_pointer and __alt_exception_stack_limit in linker.x.
Restrictions:The hal.linker.exception_stack_size and hal.linker.exception_stack_memory_region_name settings must also be valid. This setting must be false for MicroC/OS-II BSPs. The exception stack can be used to improve interrupt and other exception performance if the EIC is *not* used.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.enable_interrupt_stack
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:none
Description:Enables use of a separate interrupt stack. If true, defines the macro ALT_INTERRUPT_STACK in linker.h, adds a memory region called interrupt_stack to linker.x, and provides the symbols __alt_interrupt_stack_pointer and __alt_interrupt_stack_limit in linker.x.
Restrictions:The hal.linker.interrupt_stack_size and hal.linker.interrupt_stack_memory_region_name settings must also be valid. This setting must be false for MicroC/OS-II BSPs. Only enable if the EIC is used exclusively. The exception stack can be used to improve interrupt and other exception performance if the EIC is *not* used.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.exception_stack_memory_region_name
Identifier:NONE
Default Value:none
Value:onchip_memory
Type:UnquotedString
Destination:none
Description:Name of the existing memory region that will be divided up to create the 'exception_stack' memory region. The selected region name will be adjusted automatically when the BSP is generated to create the 'exception_stack' memory region.
Restrictions:Only used if hal.linker.enable_exception_stack is true.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.exception_stack_size
Identifier:NONE
Default Value:1024
Value:1024
Type:DecimalNumber
Destination:none
Description:Size of the exception stack in bytes.
Restrictions:Only used if hal.linker.enable_exception_stack is true.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.interrupt_stack_memory_region_name
Identifier:NONE
Default Value:none
Value:onchip_memory
Type:UnquotedString
Destination:none
Description:Name of the existing memory region that will be divided up to create the 'interrupt_stack' memory region. The selected region name will be adjusted automatically when the BSP is generated to create the 'interrupt_stack' memory region.
Restrictions:Only used if hal.linker.enable_interrupt_stack is true.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.linker.interrupt_stack_size
Identifier:NONE
Default Value:1024
Value:1024
Type:DecimalNumber
Destination:none
Description:Size of the interrupt stack in bytes.
Restrictions:Only used if hal.linker.enable_interrupt_stack is true.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.log_flags
Identifier:ALT_LOG_FLAGS
Default Value:0
Value:0
Type:DecimalNumber
Destination:public_mk_define
Description:The value is assigned to ALT_LOG_FLAGS in the generated public.mk. See hal.log_port setting description. Values can be -1 through 3.
Restrictions:hal.log_port must be set for this to be used.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.log_port
Identifier:NONE
Default Value:none
Value:none
Type:UnquotedString
Destination:public_mk_define
Description:Slave descriptor of debug logging character-mode device. If defined, it enables extra debug messages in the HAL source. This setting is used by the ALT_LOG_PORT family of defines in system.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ar
Identifier:AR
Default Value:nios2-elf-ar
Value:nios2-elf-ar
Type:UnquotedString
Destination:makefile_variable
Description:Archiver command. Creates library files.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ar_post_process
Identifier:AR_POST_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed after archiver execution.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ar_pre_process
Identifier:AR_PRE_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed before archiver execution.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.as
Identifier:AS
Default Value:nios2-elf-gcc
Value:nios2-elf-gcc
Type:UnquotedString
Destination:makefile_variable
Description:Assembler command. Note that CC is used for .S files.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.as_post_process
Identifier:AS_POST_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed after each assembly file is compiled.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.as_pre_process
Identifier:AS_PRE_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed before each assembly file is compiled.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_arflags
Identifier:BSP_ARFLAGS
Default Value:-src
Value:-src
Type:UnquotedString
Destination:makefile_variable
Description:Custom flags only passed to the archiver. This content of this variable is directly passed to the archiver rather than the more standard "ARFLAGS". The reason for this is that GNU Make assumes some default content in ARFLAGS. This setting defines the value of BSP_ARFLAGS in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_asflags
Identifier:BSP_ASFLAGS
Default Value:-Wa,-gdwarf2
Value:-Wa,-gdwarf2
Type:UnquotedString
Destination:makefile_variable
Description:Custom flags only passed to the assembler. This setting defines the value of BSP_ASFLAGS in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cflags_debug
Identifier:BSP_CFLAGS_DEBUG
Default Value:-g
Value:-g
Type:UnquotedString
Destination:makefile_variable
Description:C/C++ compiler debug level. '-g' provides the default set of debug symbols typically required to debug a typical application. Omitting '-g' removes debug symbols from the ELF. This setting defines the value of BSP_CFLAGS_DEBUG in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cflags_defined_symbols
Identifier:BSP_CFLAGS_DEFINED_SYMBOLS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Preprocessor macros to define. A macro definition in this setting has the same effect as a "#define" in source code. Adding "-DALT_DEBUG" to this setting has the same effect as "#define ALT_DEBUG" in a souce file. Adding "-DFOO=1" to this setting is equivalent to the macro "#define FOO 1" in a source file. Macros defined with this setting are applied to all .S, .c, and C++ files in the BSP. This setting defines the value of BSP_CFLAGS_DEFINED_SYMBOLS in the BSP Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cflags_optimization
Identifier:BSP_CFLAGS_OPTIMIZATION
Default Value:-O0
Value:'-Os'
Type:UnquotedString
Destination:makefile_variable
Description:C/C++ compiler optimization level. "-O0" = no optimization,"-O2" = "normal" optimization, etc. "-O0" is recommended for code that you want to debug since compiler optimization can remove variables and produce non-sequential execution of code while debugging. This setting defines the value of BSP_CFLAGS_OPTIMIZATION in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cflags_undefined_symbols
Identifier:BSP_CFLAGS_UNDEFINED_SYMBOLS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Preprocessor macros to undefine. Undefined macros are similar to defined macros, but replicate the "#undef" directive in source code. To undefine the macro FOO use the syntax "-u FOO" in this setting. This is equivalent to "#undef FOO" in a source file. Note: the syntax differs from macro definition (there is a space, i.e. "-u FOO" versus "-DFOO"). Macros defined with this setting are applied to all .S, .c, and C++ files in the BSP. This setting defines the value of BSP_CFLAGS_UNDEFINED_SYMBOLS in the BSP Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cflags_user_flags
Identifier:BSP_CFLAGS_USER_FLAGS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Custom flags passed to the compiler when compiling C, C++, and .S files. This setting defines the value of BSP_CFLAGS_USER_FLAGS in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cflags_warnings
Identifier:BSP_CFLAGS_WARNINGS
Default Value:-Wall
Value:-Wall
Type:UnquotedString
Destination:makefile_variable
Description:C/C++ compiler warning level. "-Wall" is commonly used.This setting defines the value of BSP_CFLAGS_WARNINGS in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_cxx_flags
Identifier:BSP_CXXFLAGS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Custom flags only passed to the C++ compiler. This setting defines the value of BSP_CXXFLAGS in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.bsp_inc_dirs
Identifier:BSP_INC_DIRS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Space separated list of extra include directories to scan for header files. Directories are relative to the top-level BSP directory. The -I prefix's added by the makefile so don't add it here. This setting defines the value of BSP_INC_DIRS in Makefile.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.build_post_process
Identifier:BUILD_POST_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed after BSP built.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.build_pre_process
Identifier:BUILD_PRE_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed before BSP built.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.cc
Identifier:CC
Default Value:nios2-elf-gcc -xc
Value:nios2-elf-gcc -xc
Type:UnquotedString
Destination:makefile_variable
Description:C compiler command.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.cc_post_process
Identifier:CC_POST_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed after each .c/.S file is compiled.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.cc_pre_process
Identifier:CC_PRE_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed before each .c/.S file is compiled.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.cxx
Identifier:CXX
Default Value:nios2-elf-gcc -xc++
Value:nios2-elf-gcc -xc++
Type:UnquotedString
Destination:makefile_variable
Description:C++ compiler command.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.cxx_post_process
Identifier:CXX_POST_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed before each C++ file is compiled.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.cxx_pre_process
Identifier:CXX_PRE_PROCESS
Default Value:none
Value:none
Type:UnquotedString
Destination:makefile_variable
Description:Command executed before each C++ file is compiled.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.big_endian
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system is big endian. If true ignores export of 'ALT_CFLAGS += -EB' to public.mk if big endian system. If true ignores export of 'ALT_CFLAGS += -EL' if little endian system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.debug_core_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system has a debug core present. If true ignores export of 'CPU_HAS_DEBUG_CORE = 1' to public.mk if a debug core is found in the system. If true ignores export of 'CPU_HAS_DEBUG_CORE = 0' if no debug core is found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.fpu_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system has FPU present. If true ignores export of 'ALT_CFLAGS += -mhard-float' to public.mk if FPU is found in the system. If true ignores export of 'ALT_CFLAGS += -mhard-soft' if FPU is not found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.hardware_divide_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system has hardware divide present. If true ignores export of 'ALT_CFLAGS += -mno-hw-div' to public.mk if no division is found in system. If true ignores export of 'ALT_CFLAGS += -mhw-div' if division is found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.hardware_fp_cust_inst_divider_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system floating point custom instruction with a divider is present. If true ignores export of 'ALT_CFLAGS += -mcustom-fpu-cfg=60-2' and 'ALT_LDFLAGS += -mcustom-fpu-cfg=60-2' to public.mk if the custom instruction is found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.hardware_fp_cust_inst_no_divider_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system floating point custom instruction without a divider is present. If true ignores export of 'ALT_CFLAGS += -mcustom-fpu-cfg=60-1' and 'ALT_LDFLAGS += -mcustom-fpu-cfg=60-1' to public.mk if the custom instruction is found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.hardware_multiplier_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system has multiplier present. If true ignores export of 'ALT_CFLAGS += -mno-hw-mul' to public.mk if no multiplier is found in the system. If true ignores export of 'ALT_CFLAGS += -mhw-mul' if multiplier is found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.hardware_mulx_present
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system has hardware mulx present. If true ignores export of 'ALT_CFLAGS += -mno-hw-mulx' to public.mk if no mulx is found in the system. If true ignores export of 'ALT_CFLAGS += -mhw-mulx' if mulx is found in the system.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.sopc_simulation_enabled
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query if SOPC system has simulation enabled. If true ignores export of 'ELF_PATCH_FLAG += --simulation_enabled' to public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.sopc_system_base_address
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query SOPC system for system ID base address. If true ignores export of 'SOPC_SYSID_FLAG += --sidp=<address>' and 'ELF_PATCH_FLAG += --sidp=<address>' to public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.sopc_system_id
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query SOPC system for system ID. If true ignores export of 'SOPC_SYSID_FLAG += --id=<sysid>' and 'ELF_PATCH_FLAG += --id=<sysid>' to public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.ignore_system_derived.sopc_system_timestamp
Identifier:NONE
Default Value:0
Value:0
Type:Boolean
Destination:public_mk_define
Description:Enable BSP generation to query SOPC system for system timestamp. If true ignores export of 'SOPC_SYSID_FLAG += --timestamp=<timestamp>' and 'ELF_PATCH_FLAG += --timestamp=<timestamp>' to public.mk.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.make.rm
Identifier:RM
Default Value:rm -f
Value:rm -f
Type:UnquotedString
Destination:makefile_variable
Description:Command used to remove files during 'clean' target.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.max_file_descriptors
Identifier:ALT_MAX_FD
Default Value:32
Value:4
Type:DecimalNumber
Destination:system_h_define
Description:Determines the number of file descriptors statically allocated. This setting defines the value of ALT_MAX_FD in system.h.
Restrictions:If hal.enable_lightweight_device_driver_api is true, there are no file descriptors so this setting is ignored. If hal.enable_lightweight_device_driver_api is false, this setting must be at least 4 because HAL needs a file descriptor for /dev/null, /dev/stdin, /dev/stdout, and /dev/stderr.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.stderr
Identifier:NONE
Default Value:none
Value:jtag_uart
Type:UnquotedString
Destination:system_h_define
Description:Slave descriptor of STDERR character-mode device. This setting is used by the ALT_STDERR family of defines in system.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.stdin
Identifier:NONE
Default Value:none
Value:jtag_uart
Type:UnquotedString
Destination:system_h_define
Description:Slave descriptor of STDIN character-mode device. This setting is used by the ALT_STDIN family of defines in system.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.stdout
Identifier:NONE
Default Value:none
Value:jtag_uart
Type:UnquotedString
Destination:system_h_define
Description:Slave descriptor of STDOUT character-mode device. This setting is used by the ALT_STDOUT family of defines in system.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.sys_clk_timer
Identifier:ALT_SYS_CLK
Default Value:none
Value:none
Type:UnquotedString
Destination:system_h_define
Description:Slave descriptor of the system clock timer device. This device provides a periodic interrupt ("tick") and is typically required for RTOS use. This setting defines the value of ALT_SYS_CLK in system.h.
Restrictions:none
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Setting Name:hal.timestamp_timer
Identifier:ALT_TIMESTAMP_CLK
Default Value:none
Value:none
Type:UnquotedString
Destination:system_h_define
Description:Slave descriptor of timestamp timer device. This device is used by Altera HAL timestamp drivers for high-resolution time measurement. This setting defines the value of ALT_TIMESTAMP_CLK in system.h.
Restrictions:none
-
-
-
- - diff --git a/software/qsys_tutorial_test_bsp/system.h b/software/qsys_tutorial_test_bsp/system.h deleted file mode 100644 index 66e5b05..0000000 --- a/software/qsys_tutorial_test_bsp/system.h +++ /dev/null @@ -1,278 +0,0 @@ -/* - * system.h - SOPC Builder system and BSP software package information - * - * Machine generated for CPU 'nios2_processor' in SOPC Builder design 'nios_system' - * SOPC Builder design path: C:/Users/takayun/Desktop/qsys_tutorial/nios_system.sopcinfo - * - * Generated: Thu Oct 27 09:21:11 JST 2016 - */ - -/* - * DO NOT MODIFY THIS FILE - * - * Changing this file will have subtle consequences - * which will almost certainly lead to a nonfunctioning - * system. If you do modify this file, be aware that your - * changes will be overwritten and lost when this file - * is generated again. - * - * DO NOT MODIFY THIS FILE - */ - -/* - * License Agreement - * - * Copyright (c) 2008 - * Altera Corporation, San Jose, California, USA. - * All rights reserved. - * - * 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. - * - * This agreement shall be governed in all respects by the laws of the State - * of California and by the laws of the United States of America. - */ - -#ifndef __SYSTEM_H_ -#define __SYSTEM_H_ - -/* Include definitions from linker script generator */ -#include "linker.h" - - -/* - * CPU configuration - * - */ - -#define ALT_CPU_ARCHITECTURE "altera_nios2_qsys" -#define ALT_CPU_BIG_ENDIAN 0 -#define ALT_CPU_BREAK_ADDR 0x1820 -#define ALT_CPU_CPU_FREQ 50000000u -#define ALT_CPU_CPU_ID_SIZE 1 -#define ALT_CPU_CPU_ID_VALUE 0x00000000 -#define ALT_CPU_CPU_IMPLEMENTATION "tiny" -#define ALT_CPU_DATA_ADDR_WIDTH 0xe -#define ALT_CPU_DCACHE_LINE_SIZE 0 -#define ALT_CPU_DCACHE_LINE_SIZE_LOG2 0 -#define ALT_CPU_DCACHE_SIZE 0 -#define ALT_CPU_EXCEPTION_ADDR 0x20 -#define ALT_CPU_FLUSHDA_SUPPORTED -#define ALT_CPU_FREQ 50000000 -#define ALT_CPU_HARDWARE_DIVIDE_PRESENT 0 -#define ALT_CPU_HARDWARE_MULTIPLY_PRESENT 0 -#define ALT_CPU_HARDWARE_MULX_PRESENT 0 -#define ALT_CPU_HAS_DEBUG_CORE 1 -#define ALT_CPU_HAS_DEBUG_STUB -#define ALT_CPU_HAS_JMPI_INSTRUCTION -#define ALT_CPU_ICACHE_LINE_SIZE 0 -#define ALT_CPU_ICACHE_LINE_SIZE_LOG2 0 -#define ALT_CPU_ICACHE_SIZE 0 -#define ALT_CPU_INST_ADDR_WIDTH 0xd -#define ALT_CPU_NAME "nios2_processor" -#define ALT_CPU_RESET_ADDR 0x0 - - -/* - * CPU configuration (with legacy prefix - don't use these anymore) - * - */ - -#define NIOS2_BIG_ENDIAN 0 -#define NIOS2_BREAK_ADDR 0x1820 -#define NIOS2_CPU_FREQ 50000000u -#define NIOS2_CPU_ID_SIZE 1 -#define NIOS2_CPU_ID_VALUE 0x00000000 -#define NIOS2_CPU_IMPLEMENTATION "tiny" -#define NIOS2_DATA_ADDR_WIDTH 0xe -#define NIOS2_DCACHE_LINE_SIZE 0 -#define NIOS2_DCACHE_LINE_SIZE_LOG2 0 -#define NIOS2_DCACHE_SIZE 0 -#define NIOS2_EXCEPTION_ADDR 0x20 -#define NIOS2_FLUSHDA_SUPPORTED -#define NIOS2_HARDWARE_DIVIDE_PRESENT 0 -#define NIOS2_HARDWARE_MULTIPLY_PRESENT 0 -#define NIOS2_HARDWARE_MULX_PRESENT 0 -#define NIOS2_HAS_DEBUG_CORE 1 -#define NIOS2_HAS_DEBUG_STUB -#define NIOS2_HAS_JMPI_INSTRUCTION -#define NIOS2_ICACHE_LINE_SIZE 0 -#define NIOS2_ICACHE_LINE_SIZE_LOG2 0 -#define NIOS2_ICACHE_SIZE 0 -#define NIOS2_INST_ADDR_WIDTH 0xd -#define NIOS2_RESET_ADDR 0x0 - - -/* - * Define for each module class mastered by the CPU - * - */ - -#define __ALTERA_AVALON_JTAG_UART -#define __ALTERA_AVALON_ONCHIP_MEMORY2 -#define __ALTERA_AVALON_PIO -#define __ALTERA_NIOS2_QSYS - - -/* - * LEDs configuration - * - */ - -#define ALT_MODULE_CLASS_LEDs altera_avalon_pio -#define LEDS_BASE 0x2010 -#define LEDS_BIT_CLEARING_EDGE_REGISTER 0 -#define LEDS_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define LEDS_CAPTURE 0 -#define LEDS_DATA_WIDTH 8 -#define LEDS_DO_TEST_BENCH_WIRING 0 -#define LEDS_DRIVEN_SIM_VALUE 0 -#define LEDS_EDGE_TYPE "NONE" -#define LEDS_FREQ 50000000 -#define LEDS_HAS_IN 0 -#define LEDS_HAS_OUT 1 -#define LEDS_HAS_TRI 0 -#define LEDS_IRQ -1 -#define LEDS_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define LEDS_IRQ_TYPE "NONE" -#define LEDS_NAME "/dev/LEDs" -#define LEDS_RESET_VALUE 0 -#define LEDS_SPAN 16 -#define LEDS_TYPE "altera_avalon_pio" - - -/* - * System configuration - * - */ - -#define ALT_DEVICE_FAMILY "Cyclone IV E" -#define ALT_ENHANCED_INTERRUPT_API_PRESENT -#define ALT_IRQ_BASE NULL -#define ALT_LOG_PORT "/dev/null" -#define ALT_LOG_PORT_BASE 0x0 -#define ALT_LOG_PORT_DEV null -#define ALT_LOG_PORT_TYPE "" -#define ALT_NUM_EXTERNAL_INTERRUPT_CONTROLLERS 0 -#define ALT_NUM_INTERNAL_INTERRUPT_CONTROLLERS 1 -#define ALT_NUM_INTERRUPT_CONTROLLERS 1 -#define ALT_STDERR "/dev/jtag_uart" -#define ALT_STDERR_BASE 0x2020 -#define ALT_STDERR_DEV jtag_uart -#define ALT_STDERR_IS_JTAG_UART -#define ALT_STDERR_PRESENT -#define ALT_STDERR_TYPE "altera_avalon_jtag_uart" -#define ALT_STDIN "/dev/jtag_uart" -#define ALT_STDIN_BASE 0x2020 -#define ALT_STDIN_DEV jtag_uart -#define ALT_STDIN_IS_JTAG_UART -#define ALT_STDIN_PRESENT -#define ALT_STDIN_TYPE "altera_avalon_jtag_uart" -#define ALT_STDOUT "/dev/jtag_uart" -#define ALT_STDOUT_BASE 0x2020 -#define ALT_STDOUT_DEV jtag_uart -#define ALT_STDOUT_IS_JTAG_UART -#define ALT_STDOUT_PRESENT -#define ALT_STDOUT_TYPE "altera_avalon_jtag_uart" -#define ALT_SYSTEM_NAME "nios_system" - - -/* - * hal configuration - * - */ - -#define ALT_MAX_FD 4 -#define ALT_SYS_CLK none -#define ALT_TIMESTAMP_CLK none - - -/* - * jtag_uart configuration - * - */ - -#define ALT_MODULE_CLASS_jtag_uart altera_avalon_jtag_uart -#define JTAG_UART_BASE 0x2020 -#define JTAG_UART_IRQ 5 -#define JTAG_UART_IRQ_INTERRUPT_CONTROLLER_ID 0 -#define JTAG_UART_NAME "/dev/jtag_uart" -#define JTAG_UART_READ_DEPTH 64 -#define JTAG_UART_READ_THRESHOLD 8 -#define JTAG_UART_SPAN 8 -#define JTAG_UART_TYPE "altera_avalon_jtag_uart" -#define JTAG_UART_WRITE_DEPTH 64 -#define JTAG_UART_WRITE_THRESHOLD 8 - - -/* - * onchip_memory configuration - * - */ - -#define ALT_MODULE_CLASS_onchip_memory altera_avalon_onchip_memory2 -#define ONCHIP_MEMORY_ALLOW_IN_SYSTEM_MEMORY_CONTENT_EDITOR 0 -#define ONCHIP_MEMORY_ALLOW_MRAM_SIM_CONTENTS_ONLY_FILE 0 -#define ONCHIP_MEMORY_BASE 0x0 -#define ONCHIP_MEMORY_CONTENTS_INFO "" -#define ONCHIP_MEMORY_DUAL_PORT 0 -#define ONCHIP_MEMORY_GUI_RAM_BLOCK_TYPE "AUTO" -#define ONCHIP_MEMORY_INIT_CONTENTS_FILE "nios_system_onchip_memory" -#define ONCHIP_MEMORY_INIT_MEM_CONTENT 1 -#define ONCHIP_MEMORY_INSTANCE_ID "NONE" -#define ONCHIP_MEMORY_IRQ -1 -#define ONCHIP_MEMORY_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define ONCHIP_MEMORY_NAME "/dev/onchip_memory" -#define ONCHIP_MEMORY_NON_DEFAULT_INIT_FILE_ENABLED 0 -#define ONCHIP_MEMORY_RAM_BLOCK_TYPE "AUTO" -#define ONCHIP_MEMORY_READ_DURING_WRITE_MODE "DONT_CARE" -#define ONCHIP_MEMORY_SINGLE_CLOCK_OP 0 -#define ONCHIP_MEMORY_SIZE_MULTIPLE 1 -#define ONCHIP_MEMORY_SIZE_VALUE 4096 -#define ONCHIP_MEMORY_SPAN 4096 -#define ONCHIP_MEMORY_TYPE "altera_avalon_onchip_memory2" -#define ONCHIP_MEMORY_WRITABLE 1 - - -/* - * switches configuration - * - */ - -#define ALT_MODULE_CLASS_switches altera_avalon_pio -#define SWITCHES_BASE 0x2000 -#define SWITCHES_BIT_CLEARING_EDGE_REGISTER 0 -#define SWITCHES_BIT_MODIFYING_OUTPUT_REGISTER 0 -#define SWITCHES_CAPTURE 0 -#define SWITCHES_DATA_WIDTH 8 -#define SWITCHES_DO_TEST_BENCH_WIRING 0 -#define SWITCHES_DRIVEN_SIM_VALUE 0 -#define SWITCHES_EDGE_TYPE "NONE" -#define SWITCHES_FREQ 50000000 -#define SWITCHES_HAS_IN 1 -#define SWITCHES_HAS_OUT 0 -#define SWITCHES_HAS_TRI 0 -#define SWITCHES_IRQ -1 -#define SWITCHES_IRQ_INTERRUPT_CONTROLLER_ID -1 -#define SWITCHES_IRQ_TYPE "NONE" -#define SWITCHES_NAME "/dev/switches" -#define SWITCHES_RESET_VALUE 0 -#define SWITCHES_SPAN 16 -#define SWITCHES_TYPE "altera_avalon_pio" - -#endif /* __SYSTEM_H_ */