From 0b6d7b1baf2baf1f36a3a92865730c2d78fc12be Mon Sep 17 00:00:00 2001 From: Uros Majstorovic Date: Thu, 11 Jan 2018 18:14:18 +0100 Subject: platforms added --- code/Makefile.fe310 | 12 ++++++++++++ code/Makefile.posix | 7 +++++++ code/config_fe310.h | 1 + code/core/core.h | 5 ++--- code/platform | 14 ++++++++++++++ 5 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 code/Makefile.fe310 create mode 100644 code/Makefile.posix create mode 100644 code/config_fe310.h create mode 100755 code/platform diff --git a/code/Makefile.fe310 b/code/Makefile.fe310 new file mode 100644 index 0000000..aff2784 --- /dev/null +++ b/code/Makefile.fe310 @@ -0,0 +1,12 @@ +htable= +vconn=vconn +platform=fe310 +rbuf_obj= + +FE310_HOME=/Users/majstor/src/sifive/freedom-e-sdk +EOS_HOME=/Users/majstor/src/sifive/hello + +CC=$(FE310_HOME)/work/build/riscv-gnu-toolchain/riscv64-unknown-elf/prefix/bin/riscv64-unknown-elf-gcc +AR=$(FE310_HOME)/work/build/riscv-gnu-toolchain/riscv64-unknown-elf/prefix/bin/riscv64-unknown-elf-ar +CFLAGS_PL=-O3 -fno-builtin-printf -march=rv32imac -mabi=ilp32 -mcmodel=medany -I$(EOS_HOME) -I$(FE310_HOME)/bsp/include -I$(FE310_HOME)/bsp/drivers -I$(FE310_HOME)/bsp/env -I$(FE310_HOME)/bsp/env/freedom-e300-hifive1 +# LDFLAGS_PL=-lm -pthread \ No newline at end of file diff --git a/code/Makefile.posix b/code/Makefile.posix new file mode 100644 index 0000000..2680875 --- /dev/null +++ b/code/Makefile.posix @@ -0,0 +1,7 @@ +htable=htable +vconn=vconn +platform=posix +obj_rbuf=rbuf.o rbuf_send.o rbuf_recv.o msgq.o + +CFLAGS_PL=-O3 +LDFLAGS_PL=-lm -pthread \ No newline at end of file diff --git a/code/config_fe310.h b/code/config_fe310.h new file mode 100644 index 0000000..fc95c26 --- /dev/null +++ b/code/config_fe310.h @@ -0,0 +1 @@ +#define ECP_DEBUG 1 \ No newline at end of file diff --git a/code/core/core.h b/code/core/core.h index 3f8fd38..ce81d9d 100644 --- a/code/core/core.h +++ b/code/core/core.h @@ -81,8 +81,9 @@ #define ecp_conn_is_reg(conn) ((conn->flags) & ECP_CONN_FLAG_REG) #define ecp_conn_is_open(conn) ((conn->flags) & ECP_CONN_FLAG_OPEN) -#include "config.h" +#include "../config.h" +#include #include #include @@ -130,8 +131,6 @@ typedef uint32_t ecp_seq_t; #define ECP_SIZE_PLD_RAW_BUF(X,T,P) (ECP_SIZE_PLD(X,T)+((P) ? ((P)->pcount+1)*(ECP_SIZE_PKT_HDR+ECP_SIZE_MSG_BUF(T,P)+ECP_AEAD_SIZE_TAG) : 0)) #define ECP_SIZE_PKT_RAW_BUF(X,T,P) (ECP_SIZE_PLD_RAW_BUF(X,T,P)+ECP_SIZE_PKT_HDR+ECP_AEAD_SIZE_TAG) -#include - #ifdef ECP_WITH_PTHREAD #include #endif diff --git a/code/platform b/code/platform new file mode 100755 index 0000000..545b475 --- /dev/null +++ b/code/platform @@ -0,0 +1,14 @@ +#!/bin/sh +# + +BASEDIR=$(dirname $0) + +if [ -z $1 ]; then + echo usage $0 "" + exit 1 +fi + +PLATFORM=$1 + +ln -sf $BASEDIR/Makefile.$PLATFORM $BASEDIR/Makefile.platform +ln -sf $BASEDIR/config_$PLATFORM.h $BASEDIR/config.h \ No newline at end of file -- cgit v1.2.3