Print this page
OS-3561 lxbrand emulation library should execute on alternate stack
OS-3558 lxbrand add support for full in-kernel syscall handling
OS-3545 lx_syscall_regs should not walk stack
OS-3868 many LTP testcases now hang
OS-3901 lxbrand lx_recvmsg fails to translate control messages when 64-bit
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Reviewed by: Patrick Mooney <patrick.mooney@joyent.com>
Reviewed by: Bryan Cantrill <bryan@joyent.com>
        
@@ -19,11 +19,11 @@
  * CDDL HEADER END
  */
 
 /*
  * Copyright 2015 Nexenta Systems, Inc.  All rights reserved.
- *
+ * Copyright 2015 Joyent, Inc.
  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
 /*      Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
@@ -82,13 +82,20 @@
         unsigned long   uc_flags;
         ucontext_t      *uc_link;
         sigset_t        uc_sigmask;
         stack_t         uc_stack;
         mcontext_t      uc_mcontext;
-        long            uc_filler[5];   /* see ABI spec for Intel386 */
+        /*
+         * The Intel386 ABI specification includes a 5-element array of longs
+         * called "uc_filler", padding the size of the struct to 512 bytes.  To
+         * allow zone brands to communicate extra data right the way through
+         * the signal handling process, from sigacthandler to setcontext, we
+         * steal the first three of these longs as a brand-private member.
+         */
+        void            *uc_brand_data[3];
+        long            uc_filler[2];
 };
-
 #if defined(_SYSCALL32)
 
 /* Kernel view of user ILP32 ucontext structure */
 
 typedef struct ucontext32 {
@@ -95,11 +102,12 @@
         uint32_t        uc_flags;
         caddr32_t       uc_link;
         sigset_t        uc_sigmask;
         stack32_t       uc_stack;
         mcontext32_t    uc_mcontext;
-        int32_t         uc_filler[5];
+        caddr32_t       uc_brand_data[3];
+        int32_t         uc_filler[2];
 } ucontext32_t;
 
 #if defined(_KERNEL)
 extern void ucontext_nto32(const ucontext_t *src, ucontext32_t *dest);
 extern void ucontext_32ton(const ucontext32_t *src, ucontext_t *dest);