Fix bug in usage of CONST segment in banked code. Use #pragma constseg

This commit is contained in:
logicog
2025-10-14 18:41:52 +02:00
parent 58c21a1986
commit 7546d0c685
15 changed files with 15 additions and 7 deletions
+2 -2
View File
@@ -47,7 +47,7 @@ $(BUILDDIR)%.rel: $(BUILDDIR)%.asm
${ASM} ${AFLAGS} -o $@ $<
# mv -f $(addprefix $(basename $^), .lst .rel .sym) .
$(BUILDDIR)rtlplayground.ihx: $(BUILDDIR)crtstart.rel $(OBJS)
$(BUILDDIR)rtlplayground.ihx: $(BUILDDIR)crtstart.rel $(OBJS)
$(CC) $(CC_FLAGS) -Wl-bHOME=${BOOTLOADER_ADDRESS} -Wl-bBANK1=0x14000 -Wl-r -o $@ $^
$(BUILDDIR)rtlplayground.img: $(BUILDDIR)rtlplayground.ihx
@@ -63,4 +63,4 @@ $(BUILDDIR)rtlplayground.bin: $(BUILDDIR)rtlplayground.img
tools/$(BUILDDIR)fileadder -a $(HTML_LOCATION) -s $(IMAGESIZE) -d html -p html_data $@
.PHONY: clean all $(SUBDIRS)
.PHONY: clean all $(SUBDIRS)
+1
View File
@@ -18,6 +18,7 @@
#include "uip/uip.h"
#pragma codeseg BANK1
#pragma constseg BANK1
extern __xdata uint8_t minPort;
extern __xdata uint8_t maxPort;
-2
View File
@@ -17,8 +17,6 @@ $(BUILDDIR)%.asm: %.c
$(CC) $(CC_FLAGS) -o $@ -c -S $<
$(BUILDDIR)%.rel: $(BUILDDIR)%.asm
./treatasm.py $^ >$^.new
mv $^.new $^
${ASM} ${AFLAGS} -o $@ $^
clean:
+1
View File
@@ -16,6 +16,7 @@
#define CMARK_S 6
#pragma codeseg BANK1
#pragma constseg BANK1
extern __code struct f_data f_data[];
extern __code char * __code mime_strings[];
+1
View File
@@ -17,6 +17,7 @@
#include "phy.h"
#pragma codeseg BANK1
#pragma constseg BANK1
extern __code uint16_t bit_mask[16];
+1
View File
@@ -15,6 +15,7 @@
#include "phy.h"
#pragma codeseg BANK1
#pragma constseg BANK1
extern __code uint8_t * __code hex;
extern __code uint16_t bit_mask[16];
+1 -1
View File
@@ -276,7 +276,7 @@ int main(int argc, char **argv)
if (arguments.prefix)
ibuf_p += snprintf(&ibuf[ibuf_p], INDEX_SIZE - ibuf_p, "#include \"%s.h\"\n\n", arguments.prefix);
if (arguments.bank)
ibuf_p += snprintf(&ibuf[ibuf_p], INDEX_SIZE - ibuf_p, "#pragma codeseg %s\n\n", arguments.bank);
ibuf_p += snprintf(&ibuf[ibuf_p], INDEX_SIZE - ibuf_p, "#pragma codeseg %s\n#pragma constseg %s\n\n", arguments.bank, arguments.bank);
ibuf_p += snprintf(&ibuf[ibuf_p], INDEX_SIZE - ibuf_p, " __code char * __code mime_strings[] = {\n \"text/html\",\n \"image/svg+xml\",\n"
" \"image/svg+xml\",\n \"image/png\",\n \"text/javascript\",\n \"text/css\",\n \"text/plain\"};\n\n");
ibuf_p += snprintf(&ibuf[ibuf_p], INDEX_SIZE - ibuf_p, "__code struct f_data f_data[] = {\n");
+1
View File
@@ -48,6 +48,7 @@
#define STATE_DATA_SENT 6
#pragma codeseg BANK1
#pragma constseg BANK1
/*
* Return value of the buffering functions that indicates that a
+1
View File
@@ -49,6 +49,7 @@
#include "timer.h"
#pragma codeseg BANK1
#pragma constseg BANK1
/*---------------------------------------------------------------------------*/
/**
+1
View File
@@ -60,6 +60,7 @@
#include "uip-fw.h"
#pragma codeseg BANK1
#pragma constseg BANK1
#include "../rtl837x_common.h"
+1 -1
View File
@@ -44,7 +44,7 @@
#include "../rtl837x_common.h"
#pragma codeseg BANK1
#pragma constseg BANK1
#define MAX_TIME 128
+1 -1
View File
@@ -41,8 +41,8 @@
#include "uip-fw.h"
#include "uip_arch.h"
#pragma codeseg BANK1
#pragma constseg BANK1
#define BUF ((__xdata struct uip_tcpip_hdr *)&uip_buf[UIP_LLH_LEN])
+1
View File
@@ -84,6 +84,7 @@
#include "uip_arch.h"
#pragma codeseg BANK1
#pragma constseg BANK1
#if UIP_CONF_IPV6
#include "uip-neighbor.h"
+1
View File
@@ -64,6 +64,7 @@
#include "../rtl837x_common.h"
#pragma codeseg BANK1
#pragma constseg BANK1
struct arp_hdr_i {
struct uip_eth_hdr ethhdr;
+1
View File
@@ -38,6 +38,7 @@
#include "uiplib.h"
#pragma codeseg BANK1
#pragma constseg BANK1
/*-----------------------------------------------------------------------------------*/
unsigned char