From 8059eda19d9e67dc411a90ac8c6481f5c9107c4a Mon Sep 17 00:00:00 2001
From: Alex Crichton <alex@alexcrichton.com>
Date: Thu, 2 Jul 2020 09:33:15 -0700
Subject: [PATCH] Add ucontext_t/mcontext_t for aarch64 Android

This ended up just getting copied from Linux as it appears to be the
same.
---
 .../linux_like/android/b64/aarch64/align.rs   | 22 +++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/src/unix/linux_like/android/b64/aarch64/align.rs b/src/unix/linux_like/android/b64/aarch64/align.rs
index 8e949963..154c2c54 100644
--- a/src/unix/linux_like/android/b64/aarch64/align.rs
+++ b/src/unix/linux_like/android/b64/aarch64/align.rs
@@ -5,3 +5,25 @@ s_no_extra_traits! {
         priv_: [f32; 8]
     }
 }
+
+s! {
+    pub struct ucontext_t {
+        pub uc_flags: ::c_ulong,
+        pub uc_link: *mut ucontext_t,
+        pub uc_stack: ::stack_t,
+        pub uc_sigmask: ::sigset_t,
+        pub uc_mcontext: mcontext_t,
+    }
+
+    #[repr(align(16))]
+    pub struct mcontext_t {
+        pub fault_address: ::c_ulonglong,
+        pub regs: [::c_ulonglong; 31],
+        pub sp: ::c_ulonglong,
+        pub pc: ::c_ulonglong,
+        pub pstate: ::c_ulonglong,
+        // nested arrays to get the right size/length while being able to
+        // auto-derive traits like Debug
+        __reserved: [[u64; 32]; 16],
+    }
+}
-- 
GitLab