Skip to content

Commit

Permalink
Merge pull request #194 from JamesTimothyMeech/master
Browse files Browse the repository at this point in the history
Issue #193 Move portable code in port out of superh for use in riscv
  • Loading branch information
phillipstanleymarbell authored Jan 14, 2021
2 parents c2867f8 + 9194490 commit 703d013
Show file tree
Hide file tree
Showing 65 changed files with 232 additions and 184 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,6 @@ xudelay(ulong usecs)
}
}

void
xusleep(ulong usecs)
{
ulong time = devrtc_getusecs();

while ((devrtc_getusecs() - time) < usecs)
{
sleep();
}
}

int
pow10(int y)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@

void xudelay(ulong);
int pow10(int y);
extern void sleep(void);
void xusleep(ulong);

15 changes: 15 additions & 0 deletions benchmarks/source/port/superHspecific.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#include "e-types.h"
#include "sh7708.h"
#include "devrtc.h"
#include "misc.h"

void
xusleep(ulong usecs)
{
ulong time = devrtc_getusecs();

while ((devrtc_getusecs() - time) < usecs)
{
sleep();
}
}
2 changes: 2 additions & 0 deletions benchmarks/source/port/superHspecific.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
extern void sleep(void);
void xusleep(ulong);
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ TARGET-ARCH = sh-elf

PROGRAM = virtualSensorExample

PORT = ../port
PORT = ../../port
LIBOS = mOS
TOOLSLIB = $(TREEROOT)/tools/tools-lib
INCLUDES = -I../port/ -I$(TREEROOT)/sys/include -I$(TREEROOT)/sys/kern/superH -I$(TREEROOT)/benchmarks/include -I$(TREEROOT)/sys/libOS/port
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
#include "devsim7708.h"
#include "sh7708.h"
#include "devscc.h"
#include "devrtc.h"
#include "devexcp.h"
#include "devlog.h"
#include "devloc.h"
#include "devsensor.h"
#include "misc.h"
#include "../../port/devrtc.h"
#include "../../port/devexcp.h"
#include "../../port/devlog.h"
#include "../../port/devloc.h"
#include "../../port/devsensor.h"
#include "../../port/misc.h"
#include "print.h"
#include <math.h>
#include <complex.h>
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/source/superh/FourierTransform/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ TARGET-ARCH = sh-elf

PROGRAM = virtualSensorExample

PORT = ../port
PORT = ../../port
LIBOS = mOS
TOOLSLIB = $(TREEROOT)/tools/tools-lib
INCLUDES = -I../port/ -I$(TREEROOT)/sys/include -I$(TREEROOT)/sys/kern/superH -I$(TREEROOT)/benchmarks/include -I$(TREEROOT)/sys/libOS/port
Expand Down
12 changes: 6 additions & 6 deletions benchmarks/source/superh/FourierTransform/virtualSensorExample.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
#include "devsim7708.h"
#include "sh7708.h"
#include "devscc.h"
#include "devrtc.h"
#include "devexcp.h"
#include "devlog.h"
#include "devloc.h"
#include "devsensor.h"
#include "misc.h"
#include "../../port/devrtc.h"
#include "../../port/devexcp.h"
#include "../../port/devlog.h"
#include "../../port/devloc.h"
#include "../../port/devsensor.h"
#include "../../port/misc.h"
#include "print.h"
#include <math.h>
#include <complex.h>
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/source/superh/Schlieren/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ TARGET-ARCH = sh-elf

PROGRAM = virtualSensorExample

PORT = ../port
PORT = ../../port
LIBOS = mOS
TOOLSLIB = $(TREEROOT)/tools/tools-lib
INCLUDES = -I../port/ -I$(TREEROOT)/sys/include -I$(TREEROOT)/sys/kern/superH -I$(TREEROOT)/benchmarks/include -I$(TREEROOT)/sys/libOS/port
Expand Down
12 changes: 6 additions & 6 deletions benchmarks/source/superh/Schlieren/virtualSensorExample.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
#include "devsim7708.h"
#include "sh7708.h"
#include "devscc.h"
#include "devrtc.h"
#include "devexcp.h"
#include "devlog.h"
#include "devloc.h"
#include "devsensor.h"
#include "misc.h"
#include "../../port/devrtc.h"
#include "../../port/devexcp.h"
#include "../../port/devlog.h"
#include "../../port/devloc.h"
#include "../../port/devsensor.h"
#include "../../port/misc.h"
#include "print.h"

float
Expand Down
10 changes: 5 additions & 5 deletions benchmarks/source/superh/bubblesort/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ TARGET-ARCH = sh-elf
PROGRAM = bsort
LIBOS = eOS

PORT = ../port
PORT = ../../port
LIBOS = eOS
TOOLSLIB = $(TREEROOT)/tools/tools-lib
INCLUDES = -I../port/ -I$(TREEROOT)/sys/include -I$(TREEROOT)/sys/kern/superH -I$(TREEROOT)/benchmarks/include -I$(TREEROOT)/sys/libOS/port
Expand Down Expand Up @@ -36,11 +36,11 @@ $(PROGRAM).sr:$(PROGRAM)
$(PROGRAM).o: $(PROGRAM).c $(PROGRAM)-input.h Makefile
$(CC) $(CFLAGS) $(OPTFLAGS) $(INCLUDES) -c $(PROGRAM).c

misc.o: ../port/misc.c Makefile
$(CC) $(CFLAGS) $(OPTFLAGS) $(INCLUDES) -c ../port/misc.c
misc.o: ../../port/misc.c Makefile
$(CC) $(CFLAGS) $(OPTFLAGS) $(INCLUDES) -c ../../port/misc.c

devrtc.o: ../port/devrtc.c Makefile
$(CC) $(CFLAGS) $(WFLAGS) $(INCLUDES) -c ../port/devrtc.c
devrtc.o: ../../port/devrtc.c Makefile
$(CC) $(CFLAGS) $(WFLAGS) $(INCLUDES) -c ../../port/devrtc.c

init.o: init.S
$(CPP) init.S > init.i; $(AS) init.i -o $@
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/source/superh/fftw-3.3alpha1/tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ INCLUDEDIR = $(TREEROOT)/sys/include
INCLUDES = -I$(INCLUDEDIR) -I. -I../ -I../api -I../dft -I../rdft -I../libbench2 -I../kernel -I../../port -I$(TREEROOT)/sys/libOS/port -I$(TREEROOT)/sys/kern/superH -I$(TREEROOT)/sim
CFLAGS = -nostdlib -fno-builtin $(TARGET-ARCH-FLAGS) -Wall
LDFLAGS = -Ttext $(LOADADDR) -TsuperH.ld -L$(TREEROOT)/tools/tools-lib/superH -L$(TREEROOT)/sys/libOS/eOS -L$(TREEROOT)/benchmarks/source/libsfpthread -L../ -Map $(PROGRAM).map
PORT = ../../port
PORT = ../../../port
OPTFLAGS = -gstabs3 -O0
LOADADDR = 0x08004000

Expand Down
2 changes: 1 addition & 1 deletion benchmarks/source/superh/findTheBugExample/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ TARGET-ARCH = sh-elf
PROGRAM = findTheBugExample
LIBOS = mOS

PORT = ../port
PORT = ../../port
SIMDIR = $(TREEROOT)/sim
TOOLSLIB = $(TREEROOT)/tools/tools-lib
INCLUDES = -I$(MACPATH) -I$(PORT) -I$(TREEROOT)/sys/include -I$(TREEROOT)/sys/kern/superH -I$(SIMDIR) -I$(TREEROOT)/sys/libOS/port
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/source/superh/interruptExample/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ TARGET-ARCH = sh-elf
PROGRAM = interruptExample
LIBOS = eOS

PORT = ../port
PORT = ../../port
SIMDIR = $(TREEROOT)/sim
TOOLSLIB = $(TREEROOT)/tools/tools-lib
INCLUDES = -I$(MACPATH) -I$(PORT) -I$(TREEROOT)/sys/include -I$(TREEROOT)/sys/kern/superH -I$(SIMDIR) -I$(TREEROOT)/sys/libOS/port
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/source/superh/lowPassFilter/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ TARGET-ARCH = sh-elf

PROGRAM = virtualSensorExample

PORT = ../port
PORT = ../../port
LIBOS = mOS
TOOLSLIB = $(TREEROOT)/tools/tools-lib
INCLUDES = -I../port/ -I$(TREEROOT)/sys/include -I$(TREEROOT)/sys/kern/superH -I$(TREEROOT)/benchmarks/include -I$(TREEROOT)/sys/libOS/port
Expand Down
12 changes: 6 additions & 6 deletions benchmarks/source/superh/lowPassFilter/virtualSensorExample.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
#include "devsim7708.h"
#include "sh7708.h"
#include "devscc.h"
#include "devrtc.h"
#include "devexcp.h"
#include "devlog.h"
#include "devloc.h"
#include "devsensor.h"
#include "misc.h"
#include "../../port/devrtc.h"
#include "../../port/devexcp.h"
#include "../../port/devlog.h"
#include "../../port/devloc.h"
#include "../../port/devsensor.h"
#include "../../port/misc.h"
#include "print.h"

/*
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/source/superh/pedometerExample/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ TARGET-ARCH = sh-elf

PROGRAM = virtualSensorExample

PORT = ../port
PORT = ../../port
LIBOS = mOS
TOOLSLIB = $(TREEROOT)/tools/tools-lib
INCLUDES = -I../port/ -I$(TREEROOT)/sys/include -I$(TREEROOT)/sys/kern/superH -I$(TREEROOT)/benchmarks/include -I$(TREEROOT)/sys/libOS/port
Expand Down
12 changes: 6 additions & 6 deletions benchmarks/source/superh/pedometerExample/virtualSensorExample.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
#include "devsim7708.h"
#include "sh7708.h"
#include "devscc.h"
#include "devrtc.h"
#include "devexcp.h"
#include "devlog.h"
#include "devloc.h"
#include "devsensor.h"
#include "misc.h"
#include "../../port/devrtc.h"
#include "../../port/devexcp.h"
#include "../../port/devlog.h"
#include "../../port/devloc.h"
#include "../../port/devsensor.h"
#include "../../port/misc.h"
#include "print.h"

enum samples {numberOfSamples = 400};
Expand Down
7 changes: 6 additions & 1 deletion benchmarks/source/superh/sbench/DAM+S-MAC+EAR/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ MACPATH = ../S-MAC

LIBOS = eOS

PORT = ../../port
PORT = ../../../port
LIBOS = eOS
SIMDIR = $(TREEROOT)/sim
TOOLSLIB = $(TREEROOT)/tools/tools-lib
Expand All @@ -36,6 +36,7 @@ NODEOBJS =\
devloc.o\
devnet.o\
devmac.o\
superHspecific.o\
$(MAC).o\
$(ROUTE).o\
$(PROGRAM).o\
Expand All @@ -50,6 +51,7 @@ SINKOBJS =\
devloc.o\
devnet.o\
devmac.o\
superHspecific.o\
$(MAC).o\
$(ROUTE).o\
$(SINK).o\
Expand Down Expand Up @@ -111,6 +113,9 @@ devloc.o: $(PORT)/devloc.c Makefile
misc.o: $(PORT)/misc.c Makefile
$(CC) $(CFLAGS) $(OPTFLAGS) $(INCLUDES) -c $(PORT)/misc.c

superHspecific.o: $(PORT)/superHspecific.c Makefile
$(CC) $(CFLAGS) $(OPTFLAGS) $(INCLUDES) -c $(PORT)/superHspecific.c

init.o: init.S
$(CPP) init.S > init.i; $(AS) init.i -o $@

Expand Down
19 changes: 10 additions & 9 deletions benchmarks/source/superh/sbench/DAM+S-MAC+EAR/sink.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@
#include "devsim7708.h"
#include "sh7708.h"
#include "devscc.h"
#include "devnet.h"
#include "devmac.h"
#include "devrtc.h"
#include "devexcp.h"
#include "devlog.h"
#include "devloc.h"
#include "devrand.h"
#include "devsensor.h"
#include "misc.h"
#include "../../../port/devnet.h"
#include "../../../port/devmac.h"
#include "../../../port/devrtc.h"
#include "../../../port/devexcp.h"
#include "../../../port/devlog.h"
#include "../../../port/devloc.h"
#include "../../../port/devrand.h"
#include "../../../port/devsensor.h"
#include "../../../port/misc.h"
#include "../../../port/superHspecific.h"
#include "fault.h"
#include "physics.h"
#include "interrupts-hitachi-sh.h"
Expand Down
6 changes: 5 additions & 1 deletion benchmarks/source/superh/sbench/DAM+S-MAC/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ PROGRAM = damv2
MAC = s-mac
MACPATH = ../S-MAC

PORT = ../../port
PORT = ../../../port
LIBOS = eOS
SIMDIR = $(TREEROOT)/sim
TOOLSLIB = $(TREEROOT)/tools/tools-lib
Expand All @@ -28,6 +28,7 @@ OBJS =\
devsensor.o\
devloc.o\
devmac.o\
superHspecific.o\
$(MAC).o\
$(PROGRAM).o\

Expand Down Expand Up @@ -73,6 +74,9 @@ devloc.o: $(PORT)/devloc.c Makefile
misc.o: $(PORT)/misc.c Makefile
$(CC) $(CFLAGS) $(OPTFLAGS) $(INCLUDES) -c $(PORT)/misc.c

superHspecific.o: $(PORT)/superHspecific.c Makefile
$(CC) $(CFLAGS) $(OPTFLAGS) $(INCLUDES) -c $(PORT)/superHspecific.c

init.o: init.S
$(CPP) init.S > init.i; $(AS) init.i -o $@

Expand Down
17 changes: 9 additions & 8 deletions benchmarks/source/superh/sbench/DAM+S-MAC/damv2.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,15 @@
#include "devsim7708.h"
#include "sh7708.h"
#include "devscc.h"
#include "devnet.h"
#include "devmac.h"
#include "devrtc.h"
#include "devexcp.h"
#include "devlog.h"
#include "devloc.h"
#include "devsensor.h"
#include "misc.h"
#include "../../../port/devnet.h"
#include "../../../port/devmac.h"
#include "../../../port/devrtc.h"
#include "../../../port/devexcp.h"
#include "../../../port/devlog.h"
#include "../../../port/devloc.h"
#include "../../../port/devsensor.h"
#include "../../../port/misc.h"
#include "../../../port/superHspecific.h"
#include "fault.h"
#include "physics.h"
#include "interrupts-hitachi-sh.h"
Expand Down
6 changes: 5 additions & 1 deletion benchmarks/source/superh/sbench/DAM+Sift+EAR/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ MACPATH = ../Sift-MAC

LIBOS = eOS

PORT = ../../port
PORT = ../../../port
LIBOS = eOS
SIMDIR = $(TREEROOT)/sim
TOOLSLIB = $(TREEROOT)/tools/tools-lib
Expand All @@ -36,6 +36,7 @@ NODEOBJS =\
devloc.o\
devnet.o\
devmac.o\
superHspecific.o\
$(MAC).o\
$(ROUTE).o\
$(PROGRAM).o\
Expand Down Expand Up @@ -111,6 +112,9 @@ devloc.o: $(PORT)/devloc.c Makefile
misc.o: $(PORT)/misc.c Makefile
$(CC) $(CFLAGS) $(OPTFLAGS) $(INCLUDES) -c $(PORT)/misc.c

superHspecific.o: $(PORT)/superHspecific.c Makefile
$(CC) $(CFLAGS) $(OPTFLAGS) $(INCLUDES) -c $(PORT)/superHspecific.c

init.o: init.S
$(CPP) init.S > init.i; $(AS) init.i -o $@

Expand Down
Loading

0 comments on commit 703d013

Please sign in to comment.