diff --git a/DiskImage.cpp b/DiskImage.cpp index e699f981..e7b2c1cf 100644 --- a/DiskImage.cpp +++ b/DiskImage.cpp @@ -2821,7 +2821,7 @@ bool unpack_td0(unsigned char *data, long &size) td0_src = end_packed_data; } } - size = unsigned(td0_dst) - unsigned(data); + size = (unsigned long)td0_dst - (unsigned long)data; delete snbuf; return true; } diff --git a/Makefile b/Makefile index de7936ef..1b61664d 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ SHELL = /bin/bash -o pipefail # using gcc version 10.2.1 -BASE = arm-linux-gnueabihf +BASE = riscv64-unknown-linux-gnu CC = $(BASE)-gcc LD = $(BASE)-ld @@ -32,12 +32,12 @@ C_SRC = $(wildcard *.c) \ $(wildcard ./lib/md5/*.c) \ $(wildcard ./lib/lzma/*.c) \ $(wildcard ./lib/flac/src/*.c) \ - $(wildcard ./lib/libchdr/*.c) \ - lib/libco/arm.c + $(wildcard ./lib/libchdr/*.c) # \ + # lib/libco/arm.c CPP_SRC = $(wildcard *.cpp) \ $(wildcard ./lib/serial_server/library/*.cpp) \ - $(wildcard ./support/*/*.cpp) + $(wildcard ./support/*/*.cpp) IMG = $(wildcard *.png) @@ -47,8 +47,8 @@ OBJ = $(C_SRC:.c=.c.o) $(CPP_SRC:.cpp=.cpp.o) $(IMG:.png=.png.o) DEP = $(C_SRC:.c=.c.d) $(CPP_SRC:.cpp=.cpp.d) DFLAGS = $(INCLUDE) -D_7ZIP_ST -DPACKAGE_VERSION=\"1.3.3\" -DFLAC_API_EXPORTS -DFLAC__HAS_OGG=0 -DHAVE_LROUND -DHAVE_STDINT_H -DHAVE_STDLIB_H -DHAVE_SYS_PARAM_H -DENABLE_64_BIT_WORDS=0 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -DVDATE=\"`date +"%y%m%d"`\" -CFLAGS = $(DFLAGS) -w -Wextra -Wno-strict-aliasing -Wno-stringop-overflow -Wno-stringop-truncation -Wno-format-truncation -Wno-psabi -Wno-restrict -c -O3 -LFLAGS = -lc -lstdc++ -lm -lrt $(IMLIB2_LIB) -Llib/bluetooth -lbluetooth -lpthread +CFLAGS = $(DFLAGS) -w -Wextra -Wno-strict-aliasing -Wno-stringop-overflow -Wno-stringop-truncation -Wno-format-truncation -Wno-psabi -Wno-restrict -c -O3 -march=rv64gc -mabi=lp64d +LFLAGS = -lc -lstdc++ -lm -lrt $(IMLIB2_LIB) -Llib/bluetooth -lbluetooth -lpthread -mabi=lp64d ifeq ($(PROFILING),1) DFLAGS += -DPROFILING @@ -56,7 +56,7 @@ endif $(PRJ): $(OBJ) $(Q)$(info $@) - $(Q)$(CC) -o $@ $+ $(LFLAGS) + $(Q)$(CC) -o $@ $+ $(LFLAGS) $(Q)cp $@ $@.elf $(Q)$(STRIP) $@ @@ -77,6 +77,8 @@ clean: %.png.o: %.png $(Q)$(info $<) $(Q)$(LD) -r -b binary -o $@ $< 2>&1 | sed -e 's/\(.[a-zA-Z]\+\):\([0-9]\+\):\([0-9]\+\):/\1(\2,\ \3):/g' + # change the flags to double flow RV64 (it's just data and the linker does not want to do it) + $(Q)printf '\x05' | dd of=$@ bs=1 seek=48 count=1 conv=notrunc ifneq ($(MAKECMDGOALS), clean) -include $(DEP) diff --git a/scheduler.cpp b/attic/scheduler.cpp similarity index 100% rename from scheduler.cpp rename to attic/scheduler.cpp diff --git a/fpga_io.cpp b/fpga_io.cpp index cc5903ce..2276eefd 100644 --- a/fpga_io.cpp +++ b/fpga_io.cpp @@ -65,7 +65,7 @@ static int fpgamgr_program_init(void) /* Write the RBF data to FPGA Manager */ static void fpgamgr_program_write(const void *rbf_data, unsigned long rbf_size) { - uint32_t src = (uint32_t)rbf_data; + // uint32_t src = (uint32_t)rbf_data; // TODO } @@ -125,7 +125,7 @@ static int socfpga_load(const void *rbf_data, size_t rbf_size) { unsigned long status; - if ((uint32_t)rbf_data & 0x3) { + if ((uint64_t)rbf_data & 0x3) { printf("FPGA: Unaligned data, realign to 32bit boundary.\n"); return -EINVAL; } diff --git a/scheduler.h b/scheduler.h index aeb0c055..89226932 100644 --- a/scheduler.h +++ b/scheduler.h @@ -1,7 +1,7 @@ #ifndef SCHEDULER_H #define SCHEDULER_H -#define USE_SCHEDULER +//#define USE_SCHEDULER void scheduler_init(void); void scheduler_run(void); diff --git a/shmem.cpp b/shmem.cpp index ec6acaac..b3ff2e24 100644 --- a/shmem.cpp +++ b/shmem.cpp @@ -41,7 +41,7 @@ int shmem_unmap(void* map, uint32_t size) { if (munmap(map, size) < 0) { - printf("Error: Unable to unmap(0x%X, %d)!\n", (uint32_t)map, size); + printf("Error: Unable to unmap(0x%X, %d)!\n", (uint64_t)map, size); return 0; }