pw_interrupt_cortex_m: adds ARMv6-M context backend

Adds the interrupt context backend for ARMv6-M.

Change-Id: Id19b02a5d2db9da6d47f86c7872eaa9ec33199fe
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/35700
Reviewed-by: Armando Montanez <amontanez@google.com>
Commit-Queue: Ewout van Bekkum <ewout@google.com>
diff --git a/pw_interrupt_cortex_m/BUILD.gn b/pw_interrupt_cortex_m/BUILD.gn
index a7fd954..c4fc14d 100644
--- a/pw_interrupt_cortex_m/BUILD.gn
+++ b/pw_interrupt_cortex_m/BUILD.gn
@@ -27,6 +27,10 @@
   visibility = [ ":*" ]
 }
 
+config("armv6m") {
+  defines = [ "PW_INTERRUPT_CORTEX_M_ARMV6M=1" ]
+}
+
 config("armv7m") {
   defines = [ "PW_INTERRUPT_CORTEX_M_ARMV7M=1" ]
 }
@@ -47,6 +51,12 @@
   ]
 }
 
+# This targets provides the ARMv6-M backend for pw_interrupt's context facade.
+pw_source_set("context_armv6m") {
+  forward_variables_from(_context_common, "*")
+  public_configs += [ ":armv6m" ]
+}
+
 # This targets provides the ARMv7-M backend for pw_interrupt's context facade.
 pw_source_set("context_armv7m") {
   forward_variables_from(_context_common, "*")
diff --git a/pw_interrupt_cortex_m/public/pw_interrupt_cortex_m/context_inline.h b/pw_interrupt_cortex_m/public/pw_interrupt_cortex_m/context_inline.h
index aeec59f..ad20f40 100644
--- a/pw_interrupt_cortex_m/public/pw_interrupt_cortex_m/context_inline.h
+++ b/pw_interrupt_cortex_m/public/pw_interrupt_cortex_m/context_inline.h
@@ -17,7 +17,8 @@
 
 namespace pw::interrupt {
 
-#if defined(PW_INTERRUPT_CORTEX_M_ARMV7M) || \
+#if defined(PW_INTERRUPT_CORTEX_M_ARMV6M) || \
+    defined(PW_INTERRUPT_CORTEX_M_ARMV7M) || \
     defined(PW_INTERRUPT_CORTEX_M_ARMV8M)
 inline bool InInterruptContext() {
   // ARMv7M Reference manual section B1.4.2 describes how the Interrupt