From b371818d595946a9c9d6e6e36e16635d92891543 Mon Sep 17 00:00:00 2001 From: MaartenBrock Date: Wed, 18 Apr 2007 19:56:32 +0000 Subject: [PATCH] * device/include/ds400rom.h, * device/lib/ds390/lcd390.c, * device/lib/ds390/memcpyx.c, * device/lib/ds390/rtc390.c, * device/lib/ds400/ds400rom.c, * device/lib/ds400/memcpyx.c, * device/lib/hc08/_ret.c: more replacements of keywords with their double underscore equivalents * device/lib/ds390/Makefile.in, * device/lib/ds400/Makefile.in, * device/lib/gbz80/Makefile.in, * device/lib/hc08/Makefile.in, * device/lib/mcs51/Makefile.in, * device/lib/z80/Makefile.in: added --std-c89 to CFLAGS git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4757 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- ChangeLog | 17 ++++++++++++++ device/include/ds400rom.h | 2 +- device/lib/ds390/Makefile.in | 2 +- device/lib/ds390/lcd390.c | 12 +++++----- device/lib/ds390/memcpyx.c | 12 +++++----- device/lib/ds390/rtc390.c | 4 ++-- device/lib/ds400/Makefile.in | 2 +- device/lib/ds400/ds400rom.c | 44 ++++++++++++++++++------------------ device/lib/ds400/memcpyx.c | 12 +++++----- device/lib/gbz80/Makefile.in | 2 +- device/lib/hc08/Makefile.in | 4 ++-- device/lib/hc08/_ret.c | 4 ++-- device/lib/mcs51/Makefile.in | 4 ++-- device/lib/z80/Makefile.in | 2 +- 14 files changed, 70 insertions(+), 53 deletions(-) diff --git a/ChangeLog b/ChangeLog index 15456744..9a12ceb0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +2007-04-18 Maarten Brock + + * device/include/ds400rom.h, + * device/lib/ds390/lcd390.c, + * device/lib/ds390/memcpyx.c, + * device/lib/ds390/rtc390.c, + * device/lib/ds400/ds400rom.c, + * device/lib/ds400/memcpyx.c, + * device/lib/hc08/_ret.c: more replacements of keywords with their + double underscore equivalents + * device/lib/ds390/Makefile.in, + * device/lib/ds400/Makefile.in, + * device/lib/gbz80/Makefile.in, + * device/lib/hc08/Makefile.in, + * device/lib/mcs51/Makefile.in, + * device/lib/z80/Makefile.in: added --std-c89 to CFLAGS + 2007-04-17 Borut Razem * doc/sdccman.lyx, src/SDCCmain.c, src/SDCCglobal.h, src/ds390/gen.c, diff --git a/device/include/ds400rom.h b/device/include/ds400rom.h index 9f0141d0..11bacd35 100644 --- a/device/include/ds400rom.h +++ b/device/include/ds400rom.h @@ -8,7 +8,7 @@ extern unsigned char init_rom(void __xdata *loMem, extern unsigned long task_gettimemillis_long(void) __naked; -extern unsigned char task_getthreadID(void) _naked; +extern unsigned char task_getthreadID(void) __naked; /** Timer reload value for 14.746 MHz crystal. */ #define RELOAD_14_746 0xfb33 diff --git a/device/lib/ds390/Makefile.in b/device/lib/ds390/Makefile.in index b9d1be79..d1dd7814 100755 --- a/device/lib/ds390/Makefile.in +++ b/device/lib/ds390/Makefile.in @@ -10,7 +10,7 @@ OBJECTS = tinibios.rel memcpyx.rel lcd390.rel i2c390.rel rtc390.rel putchar.rel SOURCES = $(patsubst %.rel,%.c,$(OBJECTS)) CPPFLAGS = -I$(srcdir)/../../include -CFLAGS = -mds390 $(CPPFLAGS) $(VERBOSE) +CFLAGS = -mds390 $(CPPFLAGS) $(VERBOSE) --std-c89 all: $(OBJECTS) libds390.lib diff --git a/device/lib/ds390/lcd390.c b/device/lib/ds390/lcd390.c index d9d071fb..6b0feda1 100644 --- a/device/lib/ds390/lcd390.c +++ b/device/lib/ds390/lcd390.c @@ -41,13 +41,13 @@ static unsigned char lcdLinesStart[LCD_ROWS]={0, 0x40, 0x14, 0x54}; //#define LCD_RW -xdata at 0x380002 static unsigned char lcdIwr; -xdata at 0x38000a static unsigned char lcdDwr; +__xdata __at (0x380002) static unsigned char lcdIwr; +__xdata __at (0x38000a) static unsigned char lcdDwr; #ifdef LCD_RW -xdata at 0x380003 static unsigned char lcdIrd; -xdata at 0x38000b static unsigned char lcdDrd; +__xdata __at (0x380003) static unsigned char lcdIrd; +__xdata __at (0x38000b) static unsigned char lcdDrd; #define LcdWait { while (lcdIrd&0x80) ; } @@ -147,7 +147,7 @@ void LcdLPutString (unsigned int collumnRow, char *string) { // however they will :), so to be sure static char lcdPrintfBuffer[LCD_COLLUMNS*4]; -void LcdPrintf (const char *format, ...) reentrant { +void LcdPrintf (const char *format, ...) __reentrant { va_list arg; va_start (arg, format); @@ -158,7 +158,7 @@ void LcdPrintf (const char *format, ...) reentrant { va_end (arg); } -void LcdLPrintf (unsigned int collumnRow, const char *format, ...) reentrant { +void LcdLPrintf (unsigned int collumnRow, const char *format, ...) __reentrant { va_list arg; LcdGoto(collumnRow); diff --git a/device/lib/ds390/memcpyx.c b/device/lib/ds390/memcpyx.c index 56e5e3a9..efab4504 100644 --- a/device/lib/ds390/memcpyx.c +++ b/device/lib/ds390/memcpyx.c @@ -1,17 +1,17 @@ #include -void xdata * memcpyx ( - void xdata * dst, - void xdata * src, +void __xdata * memcpyx ( + void __xdata * dst, + void __xdata * src, int count - ) _naked + ) __naked { /* Shut compiler up about unused parameters. */ dst; src; count; /* AUTO_TOGGLE uses the '390 DPTS toggle bit. */ #define AUTO_TOGGLE -_asm +__asm ; Destination is in DPTR. Save it on stack so we can return it at end. push dpx @@ -88,6 +88,6 @@ _memcpy_done: pop dph pop dpx ret -_endasm; +__endasm; } diff --git a/device/lib/ds390/rtc390.c b/device/lib/ds390/rtc390.c index 5eff84cc..ec07e98d 100755 --- a/device/lib/ds390/rtc390.c +++ b/device/lib/ds390/rtc390.c @@ -32,10 +32,10 @@ range since the chip only uses CE3* */ -xdata at 0x310000 static volatile unsigned char rtc; +__xdata __at (0x310000) static volatile unsigned char rtc; // this is the 64bit pattern that has to be recognized by the ds1315 -code unsigned char rtcMagic[8]={0xc5,0x3a,0xa3,0x5c,0xc5,0x3a,0xa3,0x5c}; +__code unsigned char rtcMagic[8]={0xc5,0x3a,0xa3,0x5c,0xc5,0x3a,0xa3,0x5c}; #define BCDtoINT(x) (((x)&0x0f)+((x)>>4)*10) #define INTtoBCD(x) (((x)%10)+(((x)/10)<<4)) diff --git a/device/lib/ds400/Makefile.in b/device/lib/ds400/Makefile.in index d4dd1dc4..92287c2d 100755 --- a/device/lib/ds400/Makefile.in +++ b/device/lib/ds400/Makefile.in @@ -10,7 +10,7 @@ OBJECTS = tinibios.rel memcpyx.rel ds400rom.rel SOURCES = $(patsubst %.rel,%.c,$(OBJECTS)) CPPFLAGS = -I$(srcdir)/../../include -CFLAGS = -mds400 $(CPPFLAGS) $(VERBOSE) +CFLAGS = -mds400 $(CPPFLAGS) $(VERBOSE) --std-c89 all: $(OBJECTS) libds400.lib diff --git a/device/lib/ds400/ds400rom.c b/device/lib/ds400/ds400rom.c index 7bba973a..b3b9cf57 100644 --- a/device/lib/ds400/ds400rom.c +++ b/device/lib/ds400/ds400rom.c @@ -31,12 +31,12 @@ #include // ROM globals, taken from startup400.a51 -data unsigned char at 0x68 DSS_wos_crit_count; -data unsigned int at 0x6b DSS_timerReload; -data unsigned char at 0x6d DSS_curr_pc[3]; -data unsigned char at 0x72 DSS_sched[3]; -data unsigned char at 0x74 DSS_ms_count[5]; -data unsigned char at 0x7b DSS_hb_chandle[5]; +__data unsigned char __at (0x68) DSS_wos_crit_count; +__data unsigned int __at (0x6b) DSS_timerReload; +__data unsigned char __at (0x6d) DSS_curr_pc[3]; +__data unsigned char __at (0x72) DSS_sched[3]; +__data unsigned char __at (0x74) DSS_ms_count[5]; +__data unsigned char __at (0x7b) DSS_hb_chandle[5]; // Register bank 3 equates. #define R0_B3 0x18 @@ -241,9 +241,9 @@ data unsigned char at 0x7b DSS_hb_chandle[5]; // expects function number in R6_B3 (low byte) & R7_B3 (high byte) -void _romcall(void) _naked +void _romcall(void) __naked { -_asm +__asm push dpx ; dptr0 preserved here push dph push dpl @@ -286,13 +286,13 @@ _asm ret ; this is not a ret, it is a call! ; the called function ends with a ret which will return to our original caller. -_endasm ; +__endasm ; } // expects function number in R6_B3 (low byte) & R7_B3 (high byte) -void _romredirect(void) _naked +void _romredirect(void) __naked { -_asm +__asm push dpx push dph push dpl @@ -323,7 +323,7 @@ _asm ret ; this is not a ret, it is a call! ; the called function ends with a ret which will return to our original caller. -_endasm; +__endasm; } @@ -343,14 +343,14 @@ _endasm; // init_rom: the ds400 ROM_INIT ROM function. -unsigned char init_rom(void xdata *loMem, - void xdata *hiMem) _naked +unsigned char init_rom(void __xdata *loMem, + void __xdata *hiMem) __naked { // shut compiler up about unused parameters. loMem; hiMem; -_asm +__asm ; load params. ; loMem is already in DPTR. mov r2, dpx @@ -367,14 +367,14 @@ _asm ; result is in acc, move to dpl for C convention. mov dpl, a ret -_endasm ; +__endasm ; } // DSS_gettimemillis: note that the ROM actually returns 5 bytes of time, // we're discarding the high byte here. -unsigned long task_gettimemillis_long(void) _naked +unsigned long task_gettimemillis_long(void) __naked { -_asm +__asm ; no parameters to load. ROMREDIRECT(ROMRT_GETTIMEMILLIS) ; results in r4 - r0, return in DPTR/B @@ -383,18 +383,18 @@ _asm mov dpx, r2 mov b, r3 ret -_endasm; +__endasm; } -unsigned char task_getthreadID(void) _naked +unsigned char task_getthreadID(void) __naked { -_asm +__asm ; no parameters to load. ROMREDIRECT(ROMRT_GETTHREADID) ; results in acc, return in dpl mov dpl, a ret -_endasm; +__endasm; } unsigned int task_gettickreload(void) diff --git a/device/lib/ds400/memcpyx.c b/device/lib/ds400/memcpyx.c index fb9e2991..7f9d8138 100644 --- a/device/lib/ds400/memcpyx.c +++ b/device/lib/ds400/memcpyx.c @@ -2,16 +2,16 @@ // FIXME: can optimize even further on '400 with auto-increment/auto-toggle. -void xdata * memcpyx ( - void xdata * dst, - void xdata * src, +void __xdata * memcpyx ( + void __xdata * dst, + void __xdata * src, int count - ) _naked + ) __naked { /* Shut compiler up about unused parameters. */ dst; src; count; -_asm +__asm ; Destination is in DPTR. Save it on stack so we can return it at end. push dpx @@ -73,6 +73,6 @@ _memcpy_done: pop dph pop dpx ret -_endasm; +__endasm; } diff --git a/device/lib/gbz80/Makefile.in b/device/lib/gbz80/Makefile.in index 04433cd4..cc38628a 100644 --- a/device/lib/gbz80/Makefile.in +++ b/device/lib/gbz80/Makefile.in @@ -13,7 +13,7 @@ OBJ = div.o mul.o putchar.o printf.o shift.o stubs.o crt0_rle.o heap.o fstubs.o LIB = gbz80.lib CC = $(SCC) AS = $(SAS) -CFLAGS = -I$(srcdir)/../../include -I. +CFLAGS = -I$(srcdir)/../../include -I. --std-c89 all: $(LIB) crt0.o diff --git a/device/lib/hc08/Makefile.in b/device/lib/hc08/Makefile.in index b5a81c60..5482da00 100644 --- a/device/lib/hc08/Makefile.in +++ b/device/lib/hc08/Makefile.in @@ -15,7 +15,7 @@ CC = $(SCC) AS = $(SAS) ASFLAGS = -plosgff -CFLAGS = -I$(srcdir)/../../include -I. +CFLAGS = -I$(srcdir)/../../include -I. --std-c89 all: $(LIB) @@ -35,4 +35,4 @@ clean: rm -f *.rel *.sym *.lst *~ $(CLEANSPEC) *.dump* *.asm *.lib distclean: clean - rm -f Makefile \ No newline at end of file + rm -f Makefile diff --git a/device/lib/hc08/_ret.c b/device/lib/hc08/_ret.c index bdfbf40b..c522c6c2 100644 --- a/device/lib/hc08/_ret.c +++ b/device/lib/hc08/_ret.c @@ -1,3 +1,3 @@ -data unsigned char _ret2; -data unsigned char _ret3; +__data unsigned char _ret2; +__data unsigned char _ret3; diff --git a/device/lib/mcs51/Makefile.in b/device/lib/mcs51/Makefile.in index 33fe0d1e..29404842 100644 --- a/device/lib/mcs51/Makefile.in +++ b/device/lib/mcs51/Makefile.in @@ -16,7 +16,7 @@ CC = $(SCC) AS = $(SAS) ASFLAGS = -plosgff -CFLAGS = -I$(top_srcdir)/include +CFLAGS = -I$(top_srcdir)/include --std-c89 all: $(LIB) @@ -37,4 +37,4 @@ clean: rm -f *.rel *.sym *.lst *~ $(CLEANSPEC) *.dump* *.lib distclean: clean - rm -r Makefile \ No newline at end of file + rm -r Makefile diff --git a/device/lib/z80/Makefile.in b/device/lib/z80/Makefile.in index 39976cf4..31b5c64f 100644 --- a/device/lib/z80/Makefile.in +++ b/device/lib/z80/Makefile.in @@ -15,7 +15,7 @@ CC = $(SCC) AS = $(SAS) ASFLAGS = -plosgff -CFLAGS = -I$(srcdir)/../../include -I. +CFLAGS = -I$(srcdir)/../../include -I. --std-c89 all: $(LIB) crt0.o -- 2.30.2