* config/tc-msp430.c (mcu_types): Add some more 430X mcu names.
(OPTION_INTR_NOPS): Define. (gen_interrupt_nops): Default to FALSE. (md_parse_opton): Add support for OPTION_INTR_NOPS. (md_longopts): Add -mn. (md_show_usage): Add -mn. (msp430_operands): Generate NOPs for all MCUs not just 430Xv2. * doc/c-msp430.c: Document -mn.
This commit is contained in:
parent
3046b3d356
commit
a75555d13b
|
@ -1,3 +1,14 @@
|
||||||
|
2013-12-13 Nick Clifton <nickc@redhat.com>
|
||||||
|
|
||||||
|
* config/tc-msp430.c (mcu_types): Add some more 430X mcu names.
|
||||||
|
(OPTION_INTR_NOPS): Define.
|
||||||
|
(gen_interrupt_nops): Default to FALSE.
|
||||||
|
(md_parse_opton): Add support for OPTION_INTR_NOPS.
|
||||||
|
(md_longopts): Add -mn.
|
||||||
|
(md_show_usage): Add -mn.
|
||||||
|
(msp430_operands): Generate NOPs for all MCUs not just 430Xv2.
|
||||||
|
* doc/c-msp430.c: Document -mn.
|
||||||
|
|
||||||
2013-12-13 Kuan-Lin Chen <kuanlinchentw@gmail.com>
|
2013-12-13 Kuan-Lin Chen <kuanlinchentw@gmail.com>
|
||||||
Wei-Cheng Wang <cole945@gmail.com>
|
Wei-Cheng Wang <cole945@gmail.com>
|
||||||
Hsiang-Kai Wang <hsiangkai@gmail.com>
|
Hsiang-Kai Wang <hsiangkai@gmail.com>
|
||||||
|
|
|
@ -528,6 +528,15 @@ static struct mcu_type_s mcu_types[] =
|
||||||
{"msp430fg4618", MSP_ISA_430X},
|
{"msp430fg4618", MSP_ISA_430X},
|
||||||
{"msp430fg4619", MSP_ISA_430X},
|
{"msp430fg4619", MSP_ISA_430X},
|
||||||
|
|
||||||
|
{"msp430x241x", MSP_ISA_430X},
|
||||||
|
{"msp430x26x", MSP_ISA_430X},
|
||||||
|
{"msp430x461x1", MSP_ISA_430X},
|
||||||
|
{"msp430x46x", MSP_ISA_430X},
|
||||||
|
{"msp430x471x3", MSP_ISA_430X},
|
||||||
|
{"msp430x471x6", MSP_ISA_430X},
|
||||||
|
{"msp430x471x7", MSP_ISA_430X},
|
||||||
|
{"msp430xg46x", MSP_ISA_430X},
|
||||||
|
|
||||||
{"msp430f5418", MSP_ISA_430Xv2},
|
{"msp430f5418", MSP_ISA_430Xv2},
|
||||||
{"msp430f5419", MSP_ISA_430Xv2},
|
{"msp430f5419", MSP_ISA_430Xv2},
|
||||||
{"msp430f5435", MSP_ISA_430Xv2},
|
{"msp430f5435", MSP_ISA_430Xv2},
|
||||||
|
@ -1124,8 +1133,9 @@ extract_word (char * from, char * to, int limit)
|
||||||
#define OPTION_POLYMORPHS 'P'
|
#define OPTION_POLYMORPHS 'P'
|
||||||
#define OPTION_LARGE 'l'
|
#define OPTION_LARGE 'l'
|
||||||
static bfd_boolean large_model = FALSE;
|
static bfd_boolean large_model = FALSE;
|
||||||
|
#define OPTION_INTR_NOPS 'n'
|
||||||
#define OPTION_NO_INTR_NOPS 'N'
|
#define OPTION_NO_INTR_NOPS 'N'
|
||||||
static bfd_boolean gen_interrupt_nops = TRUE;
|
static bfd_boolean gen_interrupt_nops = FALSE;
|
||||||
#define OPTION_MCPU 'c'
|
#define OPTION_MCPU 'c'
|
||||||
#define OPTION_MOVE_DATA 'd'
|
#define OPTION_MOVE_DATA 'd'
|
||||||
static bfd_boolean move_data = FALSE;
|
static bfd_boolean move_data = FALSE;
|
||||||
|
@ -1216,6 +1226,9 @@ md_parse_option (int c, char * arg)
|
||||||
case OPTION_NO_INTR_NOPS:
|
case OPTION_NO_INTR_NOPS:
|
||||||
gen_interrupt_nops = FALSE;
|
gen_interrupt_nops = FALSE;
|
||||||
return 1;
|
return 1;
|
||||||
|
case OPTION_INTR_NOPS:
|
||||||
|
gen_interrupt_nops = TRUE;
|
||||||
|
return 1;
|
||||||
|
|
||||||
case OPTION_MOVE_DATA:
|
case OPTION_MOVE_DATA:
|
||||||
move_data = TRUE;
|
move_data = TRUE;
|
||||||
|
@ -1267,6 +1280,7 @@ struct option md_longopts[] =
|
||||||
{"mQ", no_argument, NULL, OPTION_RELAX},
|
{"mQ", no_argument, NULL, OPTION_RELAX},
|
||||||
{"ml", no_argument, NULL, OPTION_LARGE},
|
{"ml", no_argument, NULL, OPTION_LARGE},
|
||||||
{"mN", no_argument, NULL, OPTION_NO_INTR_NOPS},
|
{"mN", no_argument, NULL, OPTION_NO_INTR_NOPS},
|
||||||
|
{"mn", no_argument, NULL, OPTION_INTR_NOPS},
|
||||||
{"md", no_argument, NULL, OPTION_MOVE_DATA},
|
{"md", no_argument, NULL, OPTION_MOVE_DATA},
|
||||||
{NULL, no_argument, NULL, 0}
|
{NULL, no_argument, NULL, 0}
|
||||||
};
|
};
|
||||||
|
@ -1287,6 +1301,8 @@ md_show_usage (FILE * stream)
|
||||||
_(" -ml - enable large code model\n"));
|
_(" -ml - enable large code model\n"));
|
||||||
fprintf (stream,
|
fprintf (stream,
|
||||||
_(" -mN - disable generation of NOP after changing interrupts\n"));
|
_(" -mN - disable generation of NOP after changing interrupts\n"));
|
||||||
|
fprintf (stream,
|
||||||
|
_(" -mn - enable generation of NOP after changing interrupts\n"));
|
||||||
fprintf (stream,
|
fprintf (stream,
|
||||||
_(" -md - Force copying of data from ROM to RAM at startup\n"));
|
_(" -md - Force copying of data from ROM to RAM at startup\n"));
|
||||||
|
|
||||||
|
@ -2289,7 +2305,6 @@ msp430_operands (struct msp430_opcode_s * opcode, char * line)
|
||||||
bfd_putl16 ((bfd_vma) bin, frag);
|
bfd_putl16 ((bfd_vma) bin, frag);
|
||||||
|
|
||||||
if (gen_interrupt_nops
|
if (gen_interrupt_nops
|
||||||
&& target_is_430xv2 ()
|
|
||||||
&& (is_opcode ("eint") || is_opcode ("dint")))
|
&& (is_opcode ("eint") || is_opcode ("dint")))
|
||||||
{
|
{
|
||||||
/* Emit a NOP following interrupt enable/disable.
|
/* Emit a NOP following interrupt enable/disable.
|
||||||
|
@ -2373,7 +2388,6 @@ msp430_operands (struct msp430_opcode_s * opcode, char * line)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gen_interrupt_nops
|
if (gen_interrupt_nops
|
||||||
&& target_is_430xv2 ()
|
|
||||||
&& is_opcode ("clr")
|
&& is_opcode ("clr")
|
||||||
&& bin == 0x4302 /* CLR R2*/)
|
&& bin == 0x4302 /* CLR R2*/)
|
||||||
{
|
{
|
||||||
|
@ -3130,7 +3144,6 @@ msp430_operands (struct msp430_opcode_s * opcode, char * line)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gen_interrupt_nops
|
if (gen_interrupt_nops
|
||||||
&& target_is_430xv2 ()
|
|
||||||
&& ( (is_opcode ("bic") && bin == 0xc232)
|
&& ( (is_opcode ("bic") && bin == 0xc232)
|
||||||
|| (is_opcode ("bis") && bin == 0xd232)
|
|| (is_opcode ("bis") && bin == 0xd232)
|
||||||
|| (is_opcode ("mov") && op2.mode == OP_REG && op2.reg == 2)))
|
|| (is_opcode ("mov") && op2.mode == OP_REG && op2.reg == 2)))
|
||||||
|
|
|
@ -46,16 +46,25 @@ enables relaxation at assembly time. DANGEROUS!
|
||||||
@item -ml
|
@item -ml
|
||||||
indicates that the input uses the large code model.
|
indicates that the input uses the large code model.
|
||||||
|
|
||||||
|
@item -mn
|
||||||
|
enables the generation of a NOP instruction following any instruction
|
||||||
|
that might change the interrupts enabled/disabled state. The
|
||||||
|
pipelined nature of the MSP430 core means that any instruction that
|
||||||
|
changes the interrupt state (@code{EINT}, @code{DINT}, @code{BIC #8,
|
||||||
|
SR}, @code{BIS #8, SR} or @code{MOV.W <>, SR}) must be
|
||||||
|
followed by a NOP instruction in order to ensure the correct
|
||||||
|
processing of interrupts. By default it is up to the programmer to
|
||||||
|
supply these NOP instructions, but this command line option enables
|
||||||
|
the automatic insertion by the assembler. Note - the assembler does
|
||||||
|
not peek ahead to the next instruction so it will insert a NOP even
|
||||||
|
one is already present.
|
||||||
|
|
||||||
|
@c end-sanitize-msp430
|
||||||
|
@c %redact note changed text for mN option
|
||||||
@item -mN
|
@item -mN
|
||||||
disables the generation of a NOP instruction following any instruction
|
disables the generation of a NOP instruction following any instruction
|
||||||
that might change the interrupts enabled/disabled state. For the
|
that might change the interrupts enabled/disabled state. This is the
|
||||||
430Xv2 architecture the instructions: @code{EINT}, @code{DINT},
|
default behaviour.
|
||||||
@code{BIC #8, SR}, @code{BIS #8, SR} and @code{MOV.W <>, SR} must be
|
|
||||||
followed by a NOP instruction in order to ensure the correct
|
|
||||||
processing of interrupts. By default generation of the NOP
|
|
||||||
instruction happens automatically, but this command line option
|
|
||||||
disables this behaviour. It is then up to the programmer to ensure
|
|
||||||
that interrupts are enabled and disabled correctly.
|
|
||||||
|
|
||||||
@item -md
|
@item -md
|
||||||
mark the object file as one that requires data to copied from ROM to
|
mark the object file as one that requires data to copied from ROM to
|
||||||
|
|
Loading…
Reference in New Issue