From a76dd27d273424a260908c88c6b3aa5d04e898b7 Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Sun, 17 Jan 2010 19:01:19 +0100 Subject: gcc: add __ramfunc definition Functions which can be executed during flash programming (this include interrupts) should not be stored in flash. They are copied to RAM at startup. Also disable jump table generation for switch statements as those are stored in .rodata section (which is in flash). --- AT91SAM7S256/Source/stdconst.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'AT91SAM7S256/Source/stdconst.h') diff --git a/AT91SAM7S256/Source/stdconst.h b/AT91SAM7S256/Source/stdconst.h index 29bf239..07ffd87 100644 --- a/AT91SAM7S256/Source/stdconst.h +++ b/AT91SAM7S256/Source/stdconst.h @@ -62,4 +62,8 @@ typedef char* PSZ; #define SIZEOF_DATA(name) (sizeof (name)) #endif +#ifdef __GNUC__ +#define __ramfunc __attribute__ ((section (".fastrun"), optimize ("no-jump-tables"))) +#endif + #endif -- cgit v1.2.3