--- a/src/runtime/x86-bsd-os.h
+++ b/src/runtime/x86-bsd-os.h
@@ -13,6 +13,8 @@
 #define CONTEXT_ADDR_FROM_STEM(stem) &context->uc_mcontext.mc_ ## stem
 #elif defined __OpenBSD__
 #define CONTEXT_ADDR_FROM_STEM(stem) &context->sc_ ## stem
+#elif defined __NetBSD__
+#define CONTEXT_ADDR_FROM_STEM(stem) &((context)->uc_mcontext.__gregs[_REG_ ## stem])
 #else
 #error unsupported BSD variant
 #endif