$OpenBSD: patch-runtime_flangrti_aarch64-Linux_dumpregs_c,v 1.4 2020/07/12 18:06:48 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
@@ -5,6 +5,7 @@
  *
  */
 
+#ifndef __OpenBSD__
 #include <sys/ucontext.h>
 #include <stddef.h>
 #include <stdioInterf.h>
@@ -19,12 +20,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" },
@@ -111,3 +128,4 @@ getRegs(ucontext_t *u)
   mcontext_t *mc = &u->uc_mcontext;
   return (uint64_t *)mc;
 }
+#endif
