ARMv7-M: make DAP commands verify target is an ARMv7-M

Init the ARMv7-M magic number.  Define predicate verifying it.
Use it to resolve a lurking bug/FIXME:  make sure the ARMv7-M
specific DAP ops reject non-ARMv7-M targets.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
This commit is contained in:
David Brownell
2010-02-04 14:39:51 -08:00
parent 3ea9e62189
commit ff5deeeeaa
2 changed files with 31 additions and 3 deletions

View File

@@ -131,6 +131,11 @@ target_to_armv7m(struct target *target)
return target->arch_info;
}
static inline bool is_armv7m(struct armv7m_common *armv7m)
{
return armv7m->common_magic == ARMV7M_COMMON_MAGIC;
}
struct armv7m_algorithm
{
int common_magic;