Merge changes I0feda6b2,I22d13fde,I49d7d09d,Ice490bfe into lmp-mr1-dev

* changes:
  Fix the type of u_ar0 in <sys/user.h>.
  Add greg_t for arm64.
  POSIX says <signal.h> gets you ucontext_t.
  Add in_port_t and move it and in_addr_t to the correct header file.
diff --git a/libc/include/arpa/inet.h b/libc/include/arpa/inet.h
index 067be1f..86265bf 100644
--- a/libc/include/arpa/inet.h
+++ b/libc/include/arpa/inet.h
@@ -25,6 +25,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  */
+
 #ifndef _ARPA_INET_H_
 #define _ARPA_INET_H_
 
@@ -34,8 +35,6 @@
 
 __BEGIN_DECLS
 
-typedef uint32_t in_addr_t;
-
 in_addr_t inet_addr(const char*);
 int inet_aton(const char*, struct in_addr*);
 in_addr_t inet_lnaof(struct in_addr);
diff --git a/libc/include/netinet/in.h b/libc/include/netinet/in.h
index bf3b498..44c7fc1 100644
--- a/libc/include/netinet/in.h
+++ b/libc/include/netinet/in.h
@@ -25,6 +25,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  */
+
 #ifndef _NETINET_IN_H_
 #define _NETINET_IN_H_
 
@@ -43,6 +44,9 @@
 
 #define INET_ADDRSTRLEN 16
 
+typedef uint16_t in_port_t;
+typedef uint32_t in_addr_t;
+
 extern int bindresvport (int sd, struct sockaddr_in *sin);
 
 static const struct in6_addr in6addr_any = IN6ADDR_ANY_INIT;
diff --git a/libc/include/signal.h b/libc/include/signal.h
index f1849c5..e23e65b 100644
--- a/libc/include/signal.h
+++ b/libc/include/signal.h
@@ -48,6 +48,9 @@
 #  include <linux/signal.h>
 #endif
 
+#include <sys/ucontext.h>
+#define __BIONIC_HAVE_UCONTEXT_T
+
 __BEGIN_DECLS
 
 typedef int sig_atomic_t;
diff --git a/libc/include/sys/ucontext.h b/libc/include/sys/ucontext.h
index f62380d..dd2a0bb 100644
--- a/libc/include/sys/ucontext.h
+++ b/libc/include/sys/ucontext.h
@@ -68,11 +68,9 @@
   struct ucontext* uc_link;
   stack_t uc_stack;
   mcontext_t uc_mcontext;
+  sigset_t uc_sigmask;
   // Android has a wrong (smaller) sigset_t on ARM.
-  union {
-    sigset_t bionic;
-    uint32_t kernel[2];
-  } uc_sigmask;
+  uint32_t __padding_rt_sigset;
   // The kernel adds extra padding after uc_sigmask to match glibc sigset_t on ARM.
   char __padding[120];
   unsigned long uc_regspace[128] __attribute__((__aligned__(8)));
@@ -80,6 +78,10 @@
 
 #elif defined(__aarch64__)
 
+#define NGREG 34 /* x0..x30 + sp + pc + pstate */
+typedef unsigned long greg_t;
+typedef greg_t gregset_t[NGREG];
+
 #include <asm/sigcontext.h>
 typedef struct sigcontext mcontext_t;
 
@@ -152,11 +154,9 @@
   struct ucontext* uc_link;
   stack_t uc_stack;
   mcontext_t uc_mcontext;
+  sigset_t uc_sigmask;
   // Android has a wrong (smaller) sigset_t on x86.
-  union {
-    sigset_t bionic;
-    uint32_t kernel[2];
-  } uc_sigmask;
+  uint32_t __padding_rt_sigset;
   struct _libc_fpstate __fpregs_mem;
 } ucontext_t;
 
diff --git a/libc/include/sys/user.h b/libc/include/sys/user.h
index 66b371d..0e36825 100644
--- a/libc/include/sys/user.h
+++ b/libc/include/sys/user.h
@@ -91,7 +91,7 @@
   unsigned long start_stack;
   long int signal;
   int reserved;
-  unsigned long u_ar0;
+  struct user_regs_struct* u_ar0;
   struct user_fpregs_struct* u_fpstate;
   unsigned long magic;
   char u_comm[32];
@@ -155,7 +155,7 @@
   long int signal;
   int reserved;
   int pad1;
-  unsigned long u_ar0;
+  struct user_regs_struct* u_ar0;
   struct user_fpregs_struct* u_fpstate;
   unsigned long magic;
   char u_comm[32];
@@ -175,7 +175,7 @@
   unsigned long start_data;
   unsigned long start_stack;
   long int signal;
-  unsigned long u_ar0;
+  void* u_ar0;
   unsigned long magic;
   char u_comm[32];
 };