summaryrefslogtreecommitdiff
path: root/gcc/config/epiphany/epiphany.h
diff options
context:
space:
mode:
authoramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>2012-02-07 02:28:06 +0000
committeramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>2012-02-07 02:28:06 +0000
commit83debce37b04bed177d54ddcc7eacb7a1b4feb89 (patch)
treee276fcf92c6b5974ac19a30c894e2084e1bb3684 /gcc/config/epiphany/epiphany.h
parent55fc45140a6ac4792813df170bdbfd3e007a9f3b (diff)
downloadgcc-83debce37b04bed177d54ddcc7eacb7a1b4feb89.tar.gz
* config/epiphany/epiphany.h (ASM_DECLARE_FUNCTION_SIZE): Redefine,
adding __forwarder_dst__ prefix if a forwarder_section attribute is present. (epiphany_function_type): Replace types for specific interrupts with EPIPHANY_FUNCTION_INTERRUPT. (EPIPHANY_INTERRUPT_P): Update. * config/epiphany/epiphany.c (epiphany_handle_forwarder_attribute): New static function. (epiphany_attribute_table) <interrupt>: min_len is 0, max_len is 9. <disinterrupt>: Affects type identity. (epiphany_handle_interrupt_attribute): Handle variable number of arguments. (epiphany_compute_function_type): Update for new epiphany_function_type definition. (epiphany_expand_prologue): Don't save (reg:DI GPR_0) for interrupt handlers with a longcall forwarder. (epiphany_start_function): Handle multiple interrupt arguments and/or forwarder_section attribute. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@183953 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/epiphany/epiphany.h')
-rw-r--r--gcc/config/epiphany/epiphany.h36
1 files changed, 27 insertions, 9 deletions
diff --git a/gcc/config/epiphany/epiphany.h b/gcc/config/epiphany/epiphany.h
index f92e1973e36..572ec7ecb3f 100644
--- a/gcc/config/epiphany/epiphany.h
+++ b/gcc/config/epiphany/epiphany.h
@@ -778,6 +778,31 @@ do { \
to a multiple of 2**LOG bytes. */
#define ASM_OUTPUT_ALIGN(FILE,LOG) \
do { if ((LOG) != 0) fprintf (FILE, "\t.balign %d\n", 1 << (LOG)); } while (0)
+
+/* This is how to declare the size of a function. */
+#undef ASM_DECLARE_FUNCTION_SIZE
+#define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \
+ do \
+ { \
+ const char *__name = (FNAME); \
+ tree attrs = DECL_ATTRIBUTES ((DECL)); \
+ \
+ if (!flag_inhibit_size_directive) \
+ { \
+ if (lookup_attribute ("forwarder_section", attrs)) \
+ { \
+ const char *prefix = "__forwarder_dst_"; \
+ char *dst_name \
+ = (char *) alloca (strlen (prefix) + strlen (__name) + 1); \
+ \
+ strcpy (dst_name, prefix); \
+ strcat (dst_name, __name); \
+ __name = dst_name; \
+ } \
+ ASM_OUTPUT_MEASURED_SIZE ((FILE), __name); \
+ } \
+ } \
+ while (0)
/* Debugging information. */
@@ -831,17 +856,10 @@ do { if ((LOG) != 0) fprintf (FILE, "\t.balign %d\n", 1 << (LOG)); } while (0)
enum epiphany_function_type
{
EPIPHANY_FUNCTION_UNKNOWN, EPIPHANY_FUNCTION_NORMAL,
- /* These are interrupt handlers. The name corresponds to which type
- of interrupt handler we're dealing with. */
- EPIPHANY_FUNCTION_RESET, EPIPHANY_FUNCTION_SOFTWARE_EXCEPTION,
- EPIPHANY_FUNCTION_PAGE_MISS,
- EPIPHANY_FUNCTION_TIMER0, EPIPHANY_FUNCTION_TIMER1, EPIPHANY_FUNCTION_MESSAGE,
- EPIPHANY_FUNCTION_DMA0, EPIPHANY_FUNCTION_DMA1, EPIPHANY_FUNCTION_WAND,
- EPIPHANY_FUNCTION_SWI
+ EPIPHANY_FUNCTION_INTERRUPT
};
-#define EPIPHANY_INTERRUPT_P(TYPE) \
- ((TYPE) >= EPIPHANY_FUNCTION_RESET && (TYPE) <= EPIPHANY_FUNCTION_SWI)
+#define EPIPHANY_INTERRUPT_P(TYPE) ((TYPE) == EPIPHANY_FUNCTION_INTERRUPT)
/* Compute the type of a function from its DECL. */