Establish builds according to RV spec version
This commit is contained in:
parent
7dcda38fb2
commit
0a6ef9b1dc
@ -1,43 +0,0 @@
|
||||
#
|
||||
# Makefile for FX-RTOS library.
|
||||
# Use 'make src' to perform dependency injection and to copy kernel files from
|
||||
# FX-RTOS sources root location provided by environment variable FXRTOS_DIR.
|
||||
# Use 'make' or 'make lib' to create library containing the kernel.
|
||||
#
|
||||
|
||||
GCC_PREFIX ?= riscv64-elf-
|
||||
CC=$(GCC_PREFIX)gcc
|
||||
|
||||
C_SRCS = $(wildcard src/*.c)
|
||||
ASM_SRCS = $(wildcard src/*.S)
|
||||
OBJS = $(C_SRCS:.c=.o) $(ASM_SRCS:.S=.o)
|
||||
|
||||
CFLAGS=-pedantic -std=c99 -O2 -Wall -ffunction-sections -march=rv32i -mabi=ilp32 -Isrc -ffreestanding -include includes.inc
|
||||
ASFLAGS=-include includes.inc -march=rv32i -mabi=ilp32 -Isrc
|
||||
|
||||
MAP_FILE ?= lite.map
|
||||
|
||||
all:
|
||||
${MAKE} src
|
||||
${MAKE} lib
|
||||
|
||||
lib: $(OBJS)
|
||||
$(GCC_PREFIX)ar rcs libfxrtos.a $(OBJS)
|
||||
echo '#define FX_INTERFACE(hdr) <stddef.h>' > FXRTOS.h
|
||||
echo '#define FX_METADATA(data)' >> FXRTOS.h
|
||||
for header in $(addsuffix .h, $(shell cat src/fxrtos.lst)); do cat src/$$header >> FXRTOS.h; done
|
||||
|
||||
src:
|
||||
@[ "${FXDJ}" ] || (echo "FXDJ is not set" ; exit 1)
|
||||
@[ "${FXRTOS_DIR}" ] || (echo "FXRTOS_DIR is not set" ; exit 1)
|
||||
@echo Performing dependency injection: sources root = $(FXRTOS_DIR)
|
||||
mkdir src
|
||||
export FX_PREP="$(GCC_PREFIX)gcc -E -Isrc -ffreestanding -include %s %s"; \
|
||||
$(realpath $(FXDJ)) -p .,$(FXRTOS_DIR)/components -a $(MAP_FILE) -t FXRTOS -o src -l src/fxrtos.lst || (rmdir src; exit 1)
|
||||
echo '#define FX_INTERFACE(hdr) <hdr.h>' > src/includes.inc
|
||||
echo '#define FX_METADATA(data)' >> src/includes.inc
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -f $(OBJS) *.tmp FXRTOS.h libfxrtos.a
|
||||
|
@ -1,53 +0,0 @@
|
||||
@echo off
|
||||
echo Cleaning up...
|
||||
|
||||
if exist src\*.o del /F /Q src\*.o
|
||||
if exist *fxrtos.* del /F /Q *fxrtos.*
|
||||
|
||||
if "%1"=="clean" (
|
||||
echo OK
|
||||
exit /b 0
|
||||
)
|
||||
|
||||
if "%MAP_FILE%"=="" (
|
||||
set MAP_FILE=lite.map
|
||||
)
|
||||
|
||||
if not exist src (
|
||||
mkdir src
|
||||
echo Performing dependency injection...
|
||||
set FX_PREP=%GCC_PREFIX%gcc -E -Isrc -include %%s %%s
|
||||
%FXDJ% -p .,%FXRTOS_DIR%\components -t FXRTOS -a %MAP_FILE% -o src -l src\fxrtos.lst
|
||||
echo #define FX_METADATA^(data^) > src/includes.inc
|
||||
echo #define FX_INTERFACE^(hdr^) ^<hdr.h^> >> src/includes.inc
|
||||
)
|
||||
|
||||
if "%1" == "srccopy" (
|
||||
echo OK
|
||||
exit /b 0
|
||||
)
|
||||
|
||||
call set OBJS=
|
||||
cd src
|
||||
echo Compiling...
|
||||
|
||||
for %%f in (*.c) do (
|
||||
echo %%f
|
||||
%GCC_PREFIX%gcc -pedantic -std=c99 -O2 -ffunction-sections -Wall -include includes.inc -march=rv32i -mabi=ilp32 -I. -c -o %%~nf.o %%f
|
||||
call set OBJS=%%OBJS%% %%~nf.o
|
||||
)
|
||||
|
||||
for %%f in (*.S) do (
|
||||
echo %%f
|
||||
%GCC_PREFIX%gcc -march=rv32i -mabi=ilp32 -I. -include includes.inc -c -o %%~nf.o %%f
|
||||
call set OBJS=%%OBJS%% %%~nf.o
|
||||
)
|
||||
|
||||
echo Creating library...
|
||||
%GCC_PREFIX%ar rcs ../libfxrtos.a %OBJS%
|
||||
cd ..
|
||||
echo Creating common header...
|
||||
|
||||
echo #define FX_METADATA^(data^) > FXRTOS.h
|
||||
echo #define FX_INTERFACE^(file^) ^<stdint.h^> >> FXRTOS.h
|
||||
for /F "tokens=*" %%A in (src\fxrtos.lst) do type src\%%A.h >> FXRTOS.h
|
@ -1,37 +0,0 @@
|
||||
LANG_ASM = GCC_RV32I
|
||||
|
||||
HAL_BARRIER = UP
|
||||
HAL_CPU_CONTEXT = KER_FRAME_BASED
|
||||
HAL_MP = STUB_V1
|
||||
HAL_INIT = STD_LIB
|
||||
|
||||
HW_CPU = RV32I
|
||||
HAL_CPU_INTR = RV32I
|
||||
HAL_CLOCK = PROXY
|
||||
HAL_INTR_FRAME = PROXY
|
||||
HAL_ASYNC = PROXY
|
||||
|
||||
FX_SPL = UNIFIED_UP
|
||||
FX_DPC = STUB
|
||||
|
||||
FX_PROCESS = DISABLED
|
||||
FX_PANIC = UP
|
||||
FX_RTP = DISABLED
|
||||
|
||||
FX_SCHED = UP_FIFO
|
||||
FX_SCHED_ALG = MPQ_FIFO
|
||||
FX_SYNC = UP_QUEUE
|
||||
|
||||
FX_TIMER = DIRECT
|
||||
FX_TIMER_INTERNAL = SIMPLE
|
||||
FX_APP_TIMER = PROXY
|
||||
FX_SYS_TIMER = PROXY
|
||||
|
||||
FX_THREAD_APC = LIMITED
|
||||
FX_THREAD_TIMESLICE = ENABLED
|
||||
FX_THREAD_CLEANUP = DISABLED
|
||||
FX_STACKOVF = DISABLED
|
||||
FX_MEM_POOL = TLSF
|
||||
|
||||
TRACE_CORE = STUB
|
||||
TRACE_LOCKS = STUB
|
@ -1,47 +0,0 @@
|
||||
#ifndef _CFG_OPTIONS_RV32I_GNU_HEADER_
|
||||
#define _CFG_OPTIONS_RV32I_GNU_HEADER_
|
||||
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file standard-rv32i-gnu-options.h
|
||||
* @brief Kernel options.
|
||||
******************************************************************************
|
||||
* Copyright (C) JSC EREMEX, 2008-2020.
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#define FX_SCHED_ALG_PRIO_NUM 32
|
||||
#define FX_TIMER_THREAD_PRIO 1
|
||||
#define FX_TIMER_THREAD_STACK_SIZE 0x400
|
||||
#define HAL_INTR_TIMER_MCAUSE 0xb8000007
|
||||
#define HAL_INTR_STACK_SIZE 0x400
|
||||
#define RTL_MEM_POOL_MAX_CHUNK 15
|
||||
|
||||
#define RV_SPEC_MSTATUS_MPP_M (3 << 11)
|
||||
#define RV_SPEC_MSTATUS_MPIE (1 << 7)
|
||||
#define RV_SPEC_MSTATUS_MIE 8
|
||||
#define RV_SPEC_INT_RET mret
|
||||
|
||||
FX_METADATA(({ interface: [CFG_OPTIONS, STANDARD_RV32I_GNU] }))
|
||||
|
||||
#endif
|
@ -1,33 +0,0 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file standard-rv32i-gnu.c
|
||||
* @brief Kernel dependencies root.
|
||||
******************************************************************************
|
||||
* Copyright (C) JSC EREMEX, 2008-2020.
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#include FX_INTERFACE(FXRTOS)
|
||||
|
||||
FX_METADATA(({ implementation: [FXRTOS, STANDARD_RV32I_GNU] }))
|
||||
|
@ -1,51 +0,0 @@
|
||||
#ifndef _FXRTOS_STANDARD_RV32I_GNU_HEADER_
|
||||
#define _FXRTOS_STANDARD_RV32I_GNU_HEADER_
|
||||
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file standard-rv32i-gnu.h
|
||||
* @brief Kernel options.
|
||||
******************************************************************************
|
||||
* Copyright (C) JSC EREMEX, 2008-2020.
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#include FX_INTERFACE(HW_CPU)
|
||||
#include FX_INTERFACE(HAL_INIT)
|
||||
#include FX_INTERFACE(HAL_CPU_INTR)
|
||||
#include FX_INTERFACE(FX_TIMER)
|
||||
#include FX_INTERFACE(FX_THREAD)
|
||||
#include FX_INTERFACE(FX_DPC)
|
||||
#include FX_INTERFACE(FX_SEM)
|
||||
#include FX_INTERFACE(FX_MUTEX)
|
||||
#include FX_INTERFACE(FX_MSGQ)
|
||||
#include FX_INTERFACE(FX_BLOCK_POOL)
|
||||
#include FX_INTERFACE(FX_EV_FLAGS)
|
||||
#include FX_INTERFACE(FX_RWLOCK)
|
||||
#include FX_INTERFACE(FX_COND)
|
||||
#include FX_INTERFACE(FX_MEM_POOL)
|
||||
|
||||
FX_METADATA(({ interface: [FXRTOS, STANDARD_RV32I_GNU] }))
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user