+2013-12-13 Nick Clifton <nickc@redhat.com>
+
+ * config/msp430/msp430.c (is_wakeup_func): New function. Returns
+ true if the current function has the wakeup attribute.
+ (msp430_start_function): Note if the function has the wakeup
+ attribute.
+ (msp430_attribute_table): Add wakeup attribute.
+ (msp430_expand_epilogue): Add support for wakeup functions.
+ * config/msp430/msp430.md (disable_interrupts): Emit a NOP after
+ the DINT instruction.
+ * doc/extend.texi: Document the wakeup attribute.
+
2013-12-13 Kai Tietz <kitetz@redhat.com>
PR c++/57897
mcu_name[i] = TOUPPER (mcu_name[i]);
return mcu_name;
}
-
+
return msp430x ? "__MSP430XGENERIC__" : "__MSP430GENERIC__";
}
return is_attr_func ("interrupt");
}
+static bool
+is_wakeup_func (void)
+{
+ return msp430_is_interrupt_func () && is_attr_func ("wakeup");
+}
+
static inline bool
is_naked_func (void)
{
fprintf (outfile, "reentrant ");
if (is_critical_func ())
fprintf (outfile, "critical ");
+ if (is_wakeup_func ())
+ fprintf (outfile, "wakeup ");
fprintf (outfile, "\n");
}
{ "naked", 0, 0, true, false, false, msp430_attr, false },
{ "reentrant", 0, 0, true, false, false, msp430_attr, false },
{ "critical", 0, 0, true, false, false, msp430_attr, false },
+ { "wakeup", 0, 0, true, false, false, msp430_attr, false },
{ NULL, 0, 0, false, false, false, NULL, false }
};
emit_insn (gen_epilogue_start_marker ());
+ if (is_wakeup_func ())
+ /* Clear the SCG1, SCG0, OSCOFF and CPUOFF bits in the saved copy of the
+ status register current residing on the stack. When this function
+ executes its RETI instruction the SR will be updated with this saved
+ value, thus ensuring that the processor is woken up from any low power
+ state in which it may be residing. */
+ emit_insn (gen_bic_SR (GEN_INT (0xf0)));
+
fs = cfun->machine->framesize_locals + cfun->machine->framesize_outgoing;
increment_stack (fs);
static void
msp430_print_operand_raw (FILE * file, rtx op)
{
- int i;
+ HOST_WIDE_INT i;
switch (GET_CODE (op))
{
case CONST_INT:
i = INTVAL (op);
if (TARGET_ASM_HEX)
- fprintf (file, "%#x", i);
+ fprintf (file, "%#" HOST_WIDE_INT_PRINT "x", i);
else
- fprintf (file, "%d", i);
+ fprintf (file, "%" HOST_WIDE_INT_PRINT "d", i);
break;
case CONST: