diff options
Diffstat (limited to 'devel/avr-gcc/files/patch-xx-os_main')
-rw-r--r-- | devel/avr-gcc/files/patch-xx-os_main | 121 |
1 files changed, 56 insertions, 65 deletions
diff --git a/devel/avr-gcc/files/patch-xx-os_main b/devel/avr-gcc/files/patch-xx-os_main index 599661469682..8b69a3c18c69 100644 --- a/devel/avr-gcc/files/patch-xx-os_main +++ b/devel/avr-gcc/files/patch-xx-os_main @@ -1,61 +1,14 @@ -Not committed -Adds OS_main attribute feature. -Written by Anatoly Sokolov. -Apply patch after XMEGA patch. --------------------------------------------------------------------------------- -Index: gcc/function.c -=================================================================== ---- gcc/function.c (revision 133747) -+++ gcc/function.c (working copy) -@@ -4756,6 +4756,14 @@ - } - - int -+prologue_contains (const_rtx insn) -+{ -+ if (contains (insn, &prologue)) -+ return 1; -+ return 0; -+} -+ -+int - prologue_epilogue_contains (const_rtx insn) - { - if (contains (insn, &prologue)) -Index: gcc/rtl.h -=================================================================== ---- gcc/rtl.h (revision 133747) -+++ gcc/rtl.h (working copy) -@@ -2128,6 +2128,7 @@ - - /* In function.c */ - extern void reposition_prologue_and_epilogue_notes (void); -+extern int prologue_contains (const_rtx); - extern int prologue_epilogue_contains (const_rtx); - extern int sibcall_epilogue_contains (const_rtx); - extern void mark_temp_addr_taken (rtx); ---- gcc/config/avr/avr.h.orig 2008-03-31 16:48:03.477537900 -0600 -+++ gcc/config/avr/avr.h 2008-03-31 17:07:51.442457900 -0600 -@@ -1095,4 +1095,8 @@ struct machine_function GTY(()) - /* 'true' - if current function is a task function - as specified by the "OS_task" attribute. */ - int is_OS_task; -+ -+ /* 'true' - if current function is a 'main' function -+ as specified by the "OS_main" attribute. */ -+ int is_OS_main; - }; ---- gcc/config/avr/avr.c.orig Mon Mar 31 19:47:54 2008 -+++ gcc/config/avr/avr.c Mon Mar 31 20:50:08 2008 -@@ -53,6 +53,7 @@ static int interrupt_function_p (tree); +--- ./gcc/config/avr/avr.c.orig 2010-03-05 18:01:20.000000000 +0100 ++++ ./gcc/config/avr/avr.c 2010-03-05 18:01:51.000000000 +0100 +@@ -57,6 +57,7 @@ static int signal_function_p (tree); static int nmi_function_p (tree); static int avr_OS_task_function_p (tree); +static int avr_OS_main_function_p (tree); static int avr_regs_to_save (HARD_REG_SET *); - static void avr_args (HARD_REG_SET *); - static int sequent_regs_live (HARD_REG_SET *); -@@ -509,6 +513,19 @@ avr_OS_task_function_p (tree func) + static int sequent_regs_live (void); + static const char *ptrreg_to_str (int); +@@ -603,6 +604,19 @@ return a != NULL_TREE; } @@ -75,7 +28,7 @@ Index: gcc/rtl.h /* Return the number of hard registers to push/pop in the prologue/epilogue of the current function, and optionally store these registers in SET. */ -@@ -527,9 +544,10 @@ avr_regs_to_save (HARD_REG_SET *set) +@@ -621,9 +635,10 @@ count = 0; /* No need to save any registers if the function never returns or @@ -88,7 +41,7 @@ Index: gcc/rtl.h return 0; for (reg = 0; reg < 32; reg++) -@@ -646,6 +664,8 @@ expand_prologue (void) +@@ -742,6 +757,8 @@ rtx pushword = gen_rtx_MEM (HImode, gen_rtx_POST_DEC (HImode, stack_pointer_rtx)); rtx insn; @@ -97,7 +50,7 @@ Index: gcc/rtl.h last_insn_address = 0; -@@ -655,6 +675,7 @@ expand_prologue (void) +@@ -751,6 +768,7 @@ cfun->machine->is_signal = signal_function_p (current_function_decl); cfun->machine->is_nmi = nmi_function_p (current_function_decl); cfun->machine->is_OS_task = avr_OS_task_function_p (current_function_decl); @@ -105,7 +58,7 @@ Index: gcc/rtl.h /* Prologue: naked. */ if (cfun->machine->is_naked) -@@ -669,6 +690,7 @@ expand_prologue (void) +@@ -764,6 +782,7 @@ && !cfun->machine->is_interrupt && !cfun->machine->is_signal && !cfun->machine->is_OS_task @@ -113,7 +66,7 @@ Index: gcc/rtl.h && live_seq); if (cfun->machine->is_interrupt || cfun->machine->is_signal) -@@ -738,7 +760,7 @@ expand_prologue (void) +@@ -903,7 +922,7 @@ } if (frame_pointer_needed) { @@ -122,7 +75,7 @@ Index: gcc/rtl.h { /* Push frame pointer. */ insn = emit_move_insn (pushword, frame_pointer_rtx); -@@ -768,7 +790,7 @@ expand_prologue (void) +@@ -933,7 +952,7 @@ if (TARGET_TINY_STACK) { if (size < -63 || size > 63) @@ -131,7 +84,7 @@ Index: gcc/rtl.h /* The high byte (r29) doesn't change - prefer 'subi' (1 cycle) over 'sbiw' (2 cycles, same size). */ -@@ -780,7 +802,6 @@ expand_prologue (void) +@@ -945,7 +964,6 @@ myfp = frame_pointer_rtx; } /* Calculate length. */ @@ -139,7 +92,7 @@ Index: gcc/rtl.h method1_length = get_attr_length (gen_move_insn (frame_pointer_rtx, stack_pointer_rtx)); method1_length += -@@ -878,6 +899,7 @@ expand_epilogue (void) +@@ -1043,6 +1061,7 @@ HARD_REG_SET set; int minimize; HOST_WIDE_INT size = get_frame_size(); @@ -147,7 +100,7 @@ Index: gcc/rtl.h /* epilogue: naked */ if (cfun->machine->is_naked) -@@ -893,6 +915,7 @@ expand_epilogue (void) +@@ -1057,6 +1076,7 @@ && !cfun->machine->is_interrupt && !cfun->machine->is_signal && !cfun->machine->is_OS_task @@ -155,7 +108,7 @@ Index: gcc/rtl.h && live_seq); if (minimize && (frame_pointer_needed || live_seq > 4)) -@@ -955,7 +978,7 @@ expand_epilogue (void) +@@ -1119,7 +1139,7 @@ emit_move_insn (stack_pointer_rtx, frame_pointer_rtx); } } @@ -164,7 +117,7 @@ Index: gcc/rtl.h { /* Restore previous frame_pointer. */ emit_insn (gen_pophi (frame_pointer_rtx)); -@@ -1787,10 +1810,18 @@ output_movhi (rtx insn, rtx operands[], +@@ -1939,10 +1959,18 @@ } /* Use simple load of stack pointer if no interrupts are used or inside main or signal function prologue where they disabled. */ @@ -185,7 +138,7 @@ Index: gcc/rtl.h && prologue_epilogue_contains (insn))) { *l = 2; -@@ -4821,6 +4852,7 @@ const struct attribute_spec avr_attribut +@@ -4969,6 +4997,7 @@ { "nmi", 0, 0, true, false, false, avr_handle_fndecl_attribute }, { "naked", 0, 0, false, true, true, avr_handle_fntype_attribute }, { "OS_task", 0, 0, false, true, true, avr_handle_fntype_attribute }, @@ -193,3 +146,41 @@ Index: gcc/rtl.h { NULL, 0, 0, false, false, false, NULL } }; +--- ./gcc/config/avr/avr.h.orig 2010-03-05 18:01:20.000000000 +0100 ++++ ./gcc/config/avr/avr.h 2010-03-05 18:01:51.000000000 +0100 +@@ -1320,4 +1320,8 @@ + /* 'true' - if current function is a task function + as specified by the "OS_task" attribute. */ + int is_OS_task; ++ ++ /* 'true' - if current function is a 'main' function ++ as specified by the "OS_main" attribute. */ ++ int is_OS_main; + }; +--- ./gcc/function.c.orig 2009-06-19 23:44:24.000000000 +0200 ++++ ./gcc/function.c 2010-03-05 18:01:51.000000000 +0100 +@@ -4757,6 +4757,14 @@ + } + + int ++prologue_contains (const_rtx insn) ++{ ++ if (contains (insn, &prologue)) ++ return 1; ++ return 0; ++} ++ ++int + prologue_epilogue_contains (const_rtx insn) + { + if (contains (insn, &prologue)) +--- ./gcc/rtl.h.orig 2009-07-14 11:32:55.000000000 +0200 ++++ ./gcc/rtl.h 2010-03-05 18:01:51.000000000 +0100 +@@ -2145,6 +2145,7 @@ + + /* In function.c */ + extern void reposition_prologue_and_epilogue_notes (void); ++extern int prologue_contains (const_rtx); + extern int prologue_epilogue_contains (const_rtx); + extern int sibcall_epilogue_contains (const_rtx); + extern void mark_temp_addr_taken (rtx); |