From ff5deeeeaa4f394931e3c5ccfb4cfd33beda0743 Mon Sep 17 00:00:00 2001 From: David Brownell Date: Thu, 4 Feb 2010 14:39:51 -0800 Subject: 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 --- src/target/armv7m.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/target/armv7m.h') diff --git a/src/target/armv7m.h b/src/target/armv7m.h index 9787e305..b6be1d22 100644 --- a/src/target/armv7m.h +++ b/src/target/armv7m.h @@ -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; -- cgit v1.2.3