$OpenBSD: patch-runtime_flangrti_aarch64-Linux_dumpregs_c,v 1.3 2019/11/24 14:37:25 bcallah Exp $

No ucontext on OpenBSD.

Index: runtime/flangrti/aarch64-Linux/dumpregs.c
--- runtime/flangrti/aarch64-Linux/dumpregs.c.orig
+++ runtime/flangrti/aarch64-Linux/dumpregs.c
@@ -15,6 +15,7 @@
  *
  */
 
+#ifndef __OpenBSD__
 #include <sys/ucontext.h>
 #include <stddef.h>
 #include <stdioInterf.h>
@@ -29,12 +30,28 @@ typedef struct {
 } xregs_t;
 
 
+#else
+
+void
+dumpregs(void *regs)
+{
+}
+  
+
+void *
+getRegs(void *u)
+{ 
+  return (void *)0;
+} 
+
+#endif
 /*
  * The way the structure below is organized, the X registers are all
  * sequential with no gaps - the structure is probably overkill - but
  * allows for some flexibility.
  */
 
+#ifndef __OpenBSD__
 xregs_t xregs[] = {
     { offsetof(mcontext_t, regs[0])/sizeof(uint64_t), "x0" },
     { offsetof(mcontext_t, regs[1])/sizeof(uint64_t), "x1" },
@@ -121,3 +138,4 @@ getRegs(ucontext_t *u)
   mcontext_t *mc = &u->uc_mcontext;
   return (uint64_t *)mc;
 }
+#endif
