mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-08-30 14:52:51 +08:00
Merge pull request #29 from logicog/constseg
Fix bug in usage of CONST segment in banked code. Use #pragma constseg
This commit is contained in:
@@ -18,6 +18,7 @@
|
|||||||
#include "uip/uip.h"
|
#include "uip/uip.h"
|
||||||
|
|
||||||
#pragma codeseg BANK1
|
#pragma codeseg BANK1
|
||||||
|
#pragma constseg BANK1
|
||||||
|
|
||||||
extern __xdata uint8_t minPort;
|
extern __xdata uint8_t minPort;
|
||||||
extern __xdata uint8_t maxPort;
|
extern __xdata uint8_t maxPort;
|
||||||
|
|||||||
@@ -17,8 +17,6 @@ $(BUILDDIR)%.asm: %.c
|
|||||||
$(CC) $(CC_FLAGS) -o $@ -c -S $<
|
$(CC) $(CC_FLAGS) -o $@ -c -S $<
|
||||||
|
|
||||||
$(BUILDDIR)%.rel: $(BUILDDIR)%.asm
|
$(BUILDDIR)%.rel: $(BUILDDIR)%.asm
|
||||||
./treatasm.py $^ >$^.new
|
|
||||||
mv $^.new $^
|
|
||||||
${ASM} ${AFLAGS} -o $@ $^
|
${ASM} ${AFLAGS} -o $@ $^
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
#define CMARK_S 6
|
#define CMARK_S 6
|
||||||
|
|
||||||
#pragma codeseg BANK1
|
#pragma codeseg BANK1
|
||||||
|
#pragma constseg BANK1
|
||||||
|
|
||||||
extern __code struct f_data f_data[];
|
extern __code struct f_data f_data[];
|
||||||
extern __code char * __code mime_strings[];
|
extern __code char * __code mime_strings[];
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
#include "phy.h"
|
#include "phy.h"
|
||||||
|
|
||||||
#pragma codeseg BANK1
|
#pragma codeseg BANK1
|
||||||
|
#pragma constseg BANK1
|
||||||
|
|
||||||
extern __code uint16_t bit_mask[16];
|
extern __code uint16_t bit_mask[16];
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
#include "phy.h"
|
#include "phy.h"
|
||||||
|
|
||||||
#pragma codeseg BANK1
|
#pragma codeseg BANK1
|
||||||
|
#pragma constseg BANK1
|
||||||
|
|
||||||
extern __code uint8_t * __code hex;
|
extern __code uint8_t * __code hex;
|
||||||
extern __code uint16_t bit_mask[16];
|
extern __code uint16_t bit_mask[16];
|
||||||
|
|||||||
+1
-1
@@ -276,7 +276,7 @@ int main(int argc, char **argv)
|
|||||||
if (arguments.prefix)
|
if (arguments.prefix)
|
||||||
ibuf_p += snprintf(&ibuf[ibuf_p], INDEX_SIZE - ibuf_p, "#include \"%s.h\"\n\n", arguments.prefix);
|
ibuf_p += snprintf(&ibuf[ibuf_p], INDEX_SIZE - ibuf_p, "#include \"%s.h\"\n\n", arguments.prefix);
|
||||||
if (arguments.bank)
|
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"
|
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");
|
" \"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");
|
ibuf_p += snprintf(&ibuf[ibuf_p], INDEX_SIZE - ibuf_p, "__code struct f_data f_data[] = {\n");
|
||||||
|
|||||||
@@ -48,6 +48,7 @@
|
|||||||
#define STATE_DATA_SENT 6
|
#define STATE_DATA_SENT 6
|
||||||
|
|
||||||
#pragma codeseg BANK1
|
#pragma codeseg BANK1
|
||||||
|
#pragma constseg BANK1
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Return value of the buffering functions that indicates that a
|
* Return value of the buffering functions that indicates that a
|
||||||
|
|||||||
@@ -49,6 +49,7 @@
|
|||||||
#include "timer.h"
|
#include "timer.h"
|
||||||
|
|
||||||
#pragma codeseg BANK1
|
#pragma codeseg BANK1
|
||||||
|
#pragma constseg BANK1
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -60,6 +60,7 @@
|
|||||||
#include "uip-fw.h"
|
#include "uip-fw.h"
|
||||||
|
|
||||||
#pragma codeseg BANK1
|
#pragma codeseg BANK1
|
||||||
|
#pragma constseg BANK1
|
||||||
|
|
||||||
#include "../rtl837x_common.h"
|
#include "../rtl837x_common.h"
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -44,7 +44,7 @@
|
|||||||
#include "../rtl837x_common.h"
|
#include "../rtl837x_common.h"
|
||||||
|
|
||||||
#pragma codeseg BANK1
|
#pragma codeseg BANK1
|
||||||
|
#pragma constseg BANK1
|
||||||
|
|
||||||
#define MAX_TIME 128
|
#define MAX_TIME 128
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -41,8 +41,8 @@
|
|||||||
#include "uip-fw.h"
|
#include "uip-fw.h"
|
||||||
#include "uip_arch.h"
|
#include "uip_arch.h"
|
||||||
|
|
||||||
|
|
||||||
#pragma codeseg BANK1
|
#pragma codeseg BANK1
|
||||||
|
#pragma constseg BANK1
|
||||||
|
|
||||||
#define BUF ((__xdata struct uip_tcpip_hdr *)&uip_buf[UIP_LLH_LEN])
|
#define BUF ((__xdata struct uip_tcpip_hdr *)&uip_buf[UIP_LLH_LEN])
|
||||||
|
|
||||||
|
|||||||
@@ -84,6 +84,7 @@
|
|||||||
#include "uip_arch.h"
|
#include "uip_arch.h"
|
||||||
|
|
||||||
#pragma codeseg BANK1
|
#pragma codeseg BANK1
|
||||||
|
#pragma constseg BANK1
|
||||||
|
|
||||||
#if UIP_CONF_IPV6
|
#if UIP_CONF_IPV6
|
||||||
#include "uip-neighbor.h"
|
#include "uip-neighbor.h"
|
||||||
|
|||||||
@@ -64,6 +64,7 @@
|
|||||||
#include "../rtl837x_common.h"
|
#include "../rtl837x_common.h"
|
||||||
|
|
||||||
#pragma codeseg BANK1
|
#pragma codeseg BANK1
|
||||||
|
#pragma constseg BANK1
|
||||||
|
|
||||||
struct arp_hdr_i {
|
struct arp_hdr_i {
|
||||||
struct uip_eth_hdr ethhdr;
|
struct uip_eth_hdr ethhdr;
|
||||||
|
|||||||
@@ -38,6 +38,7 @@
|
|||||||
#include "uiplib.h"
|
#include "uiplib.h"
|
||||||
|
|
||||||
#pragma codeseg BANK1
|
#pragma codeseg BANK1
|
||||||
|
#pragma constseg BANK1
|
||||||
|
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
unsigned char
|
unsigned char
|
||||||
|
|||||||
Reference in New Issue
Block a user