Author: nwhitehorn
Date: Thu Mar 11 14:49:06 2010
New Revision: 205014
URL: http://svn.freebsd.org/changeset/base/205014

Log:
  Provide groundwork for 32-bit binary compatibility on non-x86 platforms,
  for upcoming 64-bit PowerPC and MIPS support. This renames the COMPAT_IA32
  option to COMPAT_FREEBSD32, removes some IA32-specific code from MI parts
  of the kernel and enhances the freebsd32 compatibility code to support
  big-endian platforms.
  
  Reviewed by:  kib, jhb

Modified:
  head/UPDATING
  head/sys/amd64/amd64/db_trace.c
  head/sys/amd64/amd64/exception.S
  head/sys/amd64/amd64/vm_machdep.c
  head/sys/amd64/conf/GENERIC
  head/sys/amd64/conf/NOTES
  head/sys/amd64/conf/XENHVM
  head/sys/amd64/include/elf.h
  head/sys/amd64/include/reg.h
  head/sys/amd64/linux32/linux32_sysvec.c
  head/sys/compat/freebsd32/freebsd32.h
  head/sys/compat/freebsd32/freebsd32_misc.c
  head/sys/compat/freebsd32/freebsd32_proto.h
  head/sys/compat/freebsd32/freebsd32_syscall.h
  head/sys/compat/freebsd32/freebsd32_syscalls.c
  head/sys/compat/freebsd32/freebsd32_sysent.c
  head/sys/compat/freebsd32/freebsd32_util.h
  head/sys/compat/freebsd32/syscalls.master
  head/sys/compat/ia32/ia32_reg.h
  head/sys/compat/ia32/ia32_sysvec.c
  head/sys/conf/files.amd64
  head/sys/conf/files.ia64
  head/sys/conf/options.amd64
  head/sys/conf/options.ia64
  head/sys/fs/procfs/procfs_dbregs.c
  head/sys/fs/procfs/procfs_fpregs.c
  head/sys/fs/procfs/procfs_ioctl.c
  head/sys/fs/procfs/procfs_map.c
  head/sys/fs/procfs/procfs_regs.c
  head/sys/ia64/conf/GENERIC
  head/sys/ia64/conf/NOTES
  head/sys/ia64/ia64/exception.S
  head/sys/ia64/ia64/genassym.c
  head/sys/ia64/ia64/machdep.c
  head/sys/ia64/include/elf.h
  head/sys/ia64/include/reg.h
  head/sys/kern/imgact_elf.c
  head/sys/kern/kern_jail.c
  head/sys/kern/kern_module.c
  head/sys/kern/kern_thr.c
  head/sys/kern/kern_umtx.c
  head/sys/kern/sys_generic.c
  head/sys/kern/sys_process.c
  head/sys/kern/uipc_socket.c
  head/sys/kern/vfs_aio.c
  head/sys/modules/linux/Makefile
  head/sys/modules/procfs/Makefile
  head/sys/sys/ptrace.h

Modified: head/UPDATING
==============================================================================
--- head/UPDATING       Thu Mar 11 14:17:37 2010        (r205013)
+++ head/UPDATING       Thu Mar 11 14:49:06 2010        (r205014)
@@ -22,6 +22,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9.
        machines to maximize performance.  (To disable malloc debugging, run
        ln -s aj /etc/malloc.conf.)
 
+20100311:
+       The kernel option COMPAT_IA32 has been replaced with COMPAT_FREEBSD32
+       to allow 32-bit compatibility on non-x86 platforms. All kernel
+       configurations on amd64 and ia64 platforms using these options must
+       be modified accordingly.
+
 20100113:
        The utmp user accounting database has been replaced with utmpx,
        the user accounting interface standardized by POSIX.

Modified: head/sys/amd64/amd64/db_trace.c
==============================================================================
--- head/sys/amd64/amd64/db_trace.c     Thu Mar 11 14:17:37 2010        
(r205013)
+++ head/sys/amd64/amd64/db_trace.c     Thu Mar 11 14:49:06 2010        
(r205014)
@@ -319,7 +319,7 @@ db_nextframe(struct amd64_frame **fp, db
                        frame_type = INTERRUPT;
                else if (strcmp(name, "Xfast_syscall") == 0)
                        frame_type = SYSCALL;
-#ifdef COMPAT_IA32
+#ifdef COMPAT_FREEBSD32
                else if (strcmp(name, "Xint0x80_syscall") == 0)
                        frame_type = SYSCALL;
 #endif

Modified: head/sys/amd64/amd64/exception.S
==============================================================================
--- head/sys/amd64/amd64/exception.S    Thu Mar 11 14:17:37 2010        
(r205013)
+++ head/sys/amd64/amd64/exception.S    Thu Mar 11 14:49:06 2010        
(r205014)
@@ -572,7 +572,7 @@ ENTRY(fork_trampoline)
  * included.
  */
 
-#ifdef COMPAT_IA32
+#ifdef COMPAT_FREEBSD32
        .data
        .p2align 4
        .text

Modified: head/sys/amd64/amd64/vm_machdep.c
==============================================================================
--- head/sys/amd64/amd64/vm_machdep.c   Thu Mar 11 14:17:37 2010        
(r205013)
+++ head/sys/amd64/amd64/vm_machdep.c   Thu Mar 11 14:49:06 2010        
(r205014)
@@ -439,7 +439,7 @@ cpu_set_upcall_kse(struct thread *td, vo
         */
        cpu_thread_clean(td);
 
-#ifdef COMPAT_IA32
+#ifdef COMPAT_FREEBSD32
        if (td->td_proc->p_sysent->sv_flags & SV_ILP32) {
                /*
                 * Set the trap frame to point at the beginning of the uts
@@ -490,7 +490,7 @@ cpu_set_user_tls(struct thread *td, void
        if ((u_int64_t)tls_base >= VM_MAXUSER_ADDRESS)
                return (EINVAL);
 
-#ifdef COMPAT_IA32
+#ifdef COMPAT_FREEBSD32
        if (td->td_proc->p_sysent->sv_flags & SV_ILP32) {
                td->td_pcb->pcb_gsbase = (register_t)tls_base;
                return (0);

Modified: head/sys/amd64/conf/GENERIC
==============================================================================
--- head/sys/amd64/conf/GENERIC Thu Mar 11 14:17:37 2010        (r205013)
+++ head/sys/amd64/conf/GENERIC Thu Mar 11 14:49:06 2010        (r205014)
@@ -45,7 +45,7 @@ options       PSEUDOFS                # Pseudo-filesystem f
 options        GEOM_PART_GPT           # GUID Partition Tables.
 options        GEOM_LABEL              # Provides labelization
 options        COMPAT_43TTY            # BSD 4.3 TTY compat (sgtty)
-options        COMPAT_IA32             # Compatible with i386 binaries
+options        COMPAT_FREEBSD32        # Compatible with i386 binaries
 options        COMPAT_FREEBSD4         # Compatible with FreeBSD4
 options        COMPAT_FREEBSD5         # Compatible with FreeBSD5
 options        COMPAT_FREEBSD6         # Compatible with FreeBSD6

Modified: head/sys/amd64/conf/NOTES
==============================================================================
--- head/sys/amd64/conf/NOTES   Thu Mar 11 14:17:37 2010        (r205013)
+++ head/sys/amd64/conf/NOTES   Thu Mar 11 14:49:06 2010        (r205014)
@@ -483,7 +483,7 @@ options     PMAP_SHPGPERPROC=201
 #XXX these 32 bit binaries is added.
 
 # Enable 32-bit runtime support for FreeBSD/i386 binaries.
-options        COMPAT_IA32
+options        COMPAT_FREEBSD32
 
 # Enable iBCS2 runtime support for SCO and ISC binaries
 #XXX#options   IBCS2
@@ -494,7 +494,7 @@ options     COMPAT_IA32
 # Enable Linux ABI emulation
 #XXX#options   COMPAT_LINUX
 
-# Enable 32-bit Linux ABI emulation (requires COMPAT_43 and COMPAT_IA32)
+# Enable 32-bit Linux ABI emulation (requires COMPAT_43 and COMPAT_FREEBSD32)
 options        COMPAT_LINUX32
 
 # Enable the linux-like proc filesystem support (requires COMPAT_LINUX32

Modified: head/sys/amd64/conf/XENHVM
==============================================================================
--- head/sys/amd64/conf/XENHVM  Thu Mar 11 14:17:37 2010        (r205013)
+++ head/sys/amd64/conf/XENHVM  Thu Mar 11 14:49:06 2010        (r205014)
@@ -46,7 +46,7 @@ options       PSEUDOFS                # Pseudo-filesystem f
 options        GEOM_PART_GPT           # GUID Partition Tables.
 options        GEOM_LABEL              # Provides labelization
 options        COMPAT_43TTY            # BSD 4.3 TTY compat (sgtty)
-options        COMPAT_IA32             # Compatible with i386 binaries
+options        COMPAT_FREEBSD32        # Compatible with i386 binaries
 options        COMPAT_FREEBSD4         # Compatible with FreeBSD4
 options        COMPAT_FREEBSD5         # Compatible with FreeBSD5
 options        COMPAT_FREEBSD6         # Compatible with FreeBSD6

Modified: head/sys/amd64/include/elf.h
==============================================================================
--- head/sys/amd64/include/elf.h        Thu Mar 11 14:17:37 2010        
(r205013)
+++ head/sys/amd64/include/elf.h        Thu Mar 11 14:49:06 2010        
(r205014)
@@ -42,6 +42,7 @@
 #include <sys/elf_generic.h>
 
 #define        ELF_ARCH        EM_X86_64
+#define        ELF_ARCH32      EM_386
 
 #define        ELF_MACHINE_OK(x) ((x) == EM_X86_64)
 

Modified: head/sys/amd64/include/reg.h
==============================================================================
--- head/sys/amd64/include/reg.h        Thu Mar 11 14:17:37 2010        
(r205013)
+++ head/sys/amd64/include/reg.h        Thu Mar 11 14:49:06 2010        
(r205014)
@@ -37,6 +37,10 @@
 #ifndef _MACHINE_REG_H_
 #define        _MACHINE_REG_H_
 
+#if defined(_KERNEL) && !defined(_STANDALONE)
+#include "opt_compat.h"
+#endif
+
 /*
  * Register set accessible via /proc/$pid/regs and PT_{SET,GET}REGS.
  */
@@ -116,6 +120,11 @@ struct dbreg {
 #define        DBREG_DRX(d,x)  ((d)->dr[(x)])  /* reference dr0 - dr15 by
                                           register number */
 
+#ifdef COMPAT_FREEBSD32
+#include <machine/fpu.h>
+#include <compat/ia32/ia32_reg.h>
+#endif
+
 #ifdef _KERNEL
 /*
  * XXX these interfaces are MI, so they should be declared in a MI place.

Modified: head/sys/amd64/linux32/linux32_sysvec.c
==============================================================================
--- head/sys/amd64/linux32/linux32_sysvec.c     Thu Mar 11 14:17:37 2010        
(r205013)
+++ head/sys/amd64/linux32/linux32_sysvec.c     Thu Mar 11 14:49:06 2010        
(r205014)
@@ -34,8 +34,8 @@
 __FBSDID("$FreeBSD$");
 #include "opt_compat.h"
 
-#ifndef COMPAT_IA32
-#error "Unable to compile Linux-emulator due to missing COMPAT_IA32 option!"
+#ifndef COMPAT_FREEBSD32
+#error "Unable to compile Linux-emulator due to missing COMPAT_FREEBSD32 
option!"
 #endif
 
 #define        __ELF_WORD_SIZE 32

Modified: head/sys/compat/freebsd32/freebsd32.h
==============================================================================
--- head/sys/compat/freebsd32/freebsd32.h       Thu Mar 11 14:17:37 2010        
(r205013)
+++ head/sys/compat/freebsd32/freebsd32.h       Thu Mar 11 14:49:06 2010        
(r205014)
@@ -29,6 +29,9 @@
 #ifndef _COMPAT_FREEBSD32_FREEBSD32_H_
 #define _COMPAT_FREEBSD32_FREEBSD32_H_
 
+#include <sys/procfs.h>
+#include <sys/socket.h>
+
 #define PTRIN(v)       (void *)(uintptr_t) (v)
 #define PTROUT(v)      (u_int32_t)(uintptr_t) (v)
 
@@ -197,4 +200,25 @@ struct i386_ldt_args32 {
        uint32_t num;
 };
 
+/*
+ * Alternative layouts for <sys/procfs.h>
+ */
+struct prstatus32 {
+        int     pr_version;
+        u_int   pr_statussz;
+        u_int   pr_gregsetsz;
+        u_int   pr_fpregsetsz;
+        int     pr_osreldate;
+        int     pr_cursig;
+        pid_t   pr_pid;
+        struct reg32 pr_reg;
+};
+
+struct prpsinfo32 {
+        int     pr_version;
+        u_int   pr_psinfosz;
+        char    pr_fname[PRFNAMESZ+1];
+        char    pr_psargs[PRARGSZ+1];
+};
+
 #endif /* !_COMPAT_FREEBSD32_FREEBSD32_H_ */

Modified: head/sys/compat/freebsd32/freebsd32_misc.c
==============================================================================
--- head/sys/compat/freebsd32/freebsd32_misc.c  Thu Mar 11 14:17:37 2010        
(r205013)
+++ head/sys/compat/freebsd32/freebsd32_misc.c  Thu Mar 11 14:49:06 2010        
(r205014)
@@ -31,6 +31,8 @@ __FBSDID("$FreeBSD$");
 #include "opt_inet.h"
 #include "opt_inet6.h"
 
+#define __ELF_WORD_SIZE 32
+
 #include <sys/param.h>
 #include <sys/bus.h>
 #include <sys/clock.h>
@@ -44,6 +46,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/lock.h>
 #include <sys/malloc.h>
 #include <sys/file.h>          /* Must come after sys/malloc.h */
+#include <sys/imgact.h>
 #include <sys/mbuf.h>
 #include <sys/mman.h>
 #include <sys/module.h>
@@ -91,6 +94,7 @@ __FBSDID("$FreeBSD$");
 #include <vm/vm_extern.h>
 
 #include <machine/cpu.h>
+#include <machine/elf.h>
 
 #include <security/audit/audit.h>
 
@@ -115,6 +119,16 @@ CTASSERT(sizeof(struct sigaction32) == 2
 static int freebsd32_kevent_copyout(void *arg, struct kevent *kevp, int count);
 static int freebsd32_kevent_copyin(void *arg, struct kevent *kevp, int count);
 
+#if BYTE_ORDER == BIG_ENDIAN
+#define PAIR32TO64(type, name) ((name ## 2) | ((type)(name ## 1) << 32))
+#define RETVAL_HI 0    
+#define RETVAL_LO 1    
+#else
+#define PAIR32TO64(type, name) ((name ## 1) | ((type)(name ## 2) << 32))
+#define RETVAL_HI 1    
+#define RETVAL_LO 0    
+#endif
+
 int
 freebsd32_wait4(struct thread *td, struct freebsd32_wait4_args *uap)
 {
@@ -426,8 +440,7 @@ freebsd32_mmap(struct thread *td, struct
        int prot         = uap->prot;
        int flags        = uap->flags;
        int fd           = uap->fd;
-       off_t pos        = (uap->poslo
-                           | ((off_t)uap->poshi << 32));
+       off_t pos        = PAIR32TO64(off_t,uap->pos);
 #ifdef __ia64__
        vm_size_t pageoff;
        int error;
@@ -523,8 +536,8 @@ freebsd6_freebsd32_mmap(struct thread *t
        ap.prot = uap->prot;
        ap.flags = uap->flags;
        ap.fd = uap->fd;
-       ap.poslo = uap->poslo;
-       ap.poshi = uap->poshi;
+       ap.pos1 = uap->pos1;
+       ap.pos2 = uap->pos2;
 
        return (freebsd32_mmap(td, &ap));
 }
@@ -586,7 +599,6 @@ freebsd32_select(struct thread *td, stru
        } else
                tvp = NULL;
        /*
-        * XXX big-endian needs to convert the fd_sets too.
         * XXX Do pointers need PTRIN()?
         */
        return (kern_select(td, uap->nd, uap->in, uap->ou, uap->ex, tvp,
@@ -620,7 +632,6 @@ freebsd32_pselect(struct thread *td, str
        } else
                uset = NULL;
        /*
-        * XXX big-endian needs to convert the fd_sets too.
         * XXX Do pointers need PTRIN()?
         */
        error = kern_pselect(td, uap->nd, uap->in, uap->ou, uap->ex, tvp,
@@ -843,7 +854,7 @@ freebsd32_preadv(struct thread *td, stru
        error = freebsd32_copyinuio(uap->iovp, uap->iovcnt, &auio);
        if (error)
                return (error);
-       error = kern_preadv(td, uap->fd, auio, uap->offset);
+       error = kern_preadv(td, uap->fd, auio, PAIR32TO64(off_t,uap->offset));
        free(auio, M_IOV);
        return (error);
 }
@@ -857,7 +868,7 @@ freebsd32_pwritev(struct thread *td, str
        error = freebsd32_copyinuio(uap->iovp, uap->iovcnt, &auio);
        if (error)
                return (error);
-       error = kern_pwritev(td, uap->fd, auio, uap->offset);
+       error = kern_pwritev(td, uap->fd, auio, PAIR32TO64(off_t,uap->offset));
        free(auio, M_IOV);
        return (error);
 }
@@ -1982,7 +1993,7 @@ freebsd32_pread(struct thread *td, struc
        ap.fd = uap->fd;
        ap.buf = uap->buf;
        ap.nbyte = uap->nbyte;
-       ap.offset = (uap->offsetlo | ((off_t)uap->offsethi << 32));
+       ap.offset = PAIR32TO64(off_t,uap->offset);
        return (pread(td, &ap));
 }
 
@@ -1994,7 +2005,7 @@ freebsd32_pwrite(struct thread *td, stru
        ap.fd = uap->fd;
        ap.buf = uap->buf;
        ap.nbyte = uap->nbyte;
-       ap.offset = (uap->offsetlo | ((off_t)uap->offsethi << 32));
+       ap.offset = PAIR32TO64(off_t,uap->offset);
        return (pwrite(td, &ap));
 }
 
@@ -2006,13 +2017,13 @@ freebsd32_lseek(struct thread *td, struc
        off_t pos;
 
        ap.fd = uap->fd;
-       ap.offset = (uap->offsetlo | ((off_t)uap->offsethi << 32));
+       ap.offset = PAIR32TO64(off_t,uap->offset);
        ap.whence = uap->whence;
        error = lseek(td, &ap);
        /* Expand the quad return into two parts for eax and edx */
        pos = *(off_t *)(td->td_retval);
-       td->td_retval[0] = pos & 0xffffffff;    /* %eax */
-       td->td_retval[1] = pos >> 32;           /* %edx */
+       td->td_retval[RETVAL_LO] = pos & 0xffffffff;    /* %eax */
+       td->td_retval[RETVAL_HI] = pos >> 32;           /* %edx */
        return error;
 }
 
@@ -2022,7 +2033,7 @@ freebsd32_truncate(struct thread *td, st
        struct truncate_args ap;
 
        ap.path = uap->path;
-       ap.length = (uap->lengthlo | ((off_t)uap->lengthhi << 32));
+       ap.length = PAIR32TO64(off_t,uap->length);
        return (truncate(td, &ap));
 }
 
@@ -2032,7 +2043,7 @@ freebsd32_ftruncate(struct thread *td, s
        struct ftruncate_args ap;
 
        ap.fd = uap->fd;
-       ap.length = (uap->lengthlo | ((off_t)uap->lengthhi << 32));
+       ap.length = PAIR32TO64(off_t,uap->length);
        return (ftruncate(td, &ap));
 }
 
@@ -2064,7 +2075,7 @@ freebsd6_freebsd32_pread(struct thread *
        ap.fd = uap->fd;
        ap.buf = uap->buf;
        ap.nbyte = uap->nbyte;
-       ap.offset = (uap->offsetlo | ((off_t)uap->offsethi << 32));
+       ap.offset = PAIR32TO64(off_t,uap->offset);
        return (pread(td, &ap));
 }
 
@@ -2076,7 +2087,7 @@ freebsd6_freebsd32_pwrite(struct thread 
        ap.fd = uap->fd;
        ap.buf = uap->buf;
        ap.nbyte = uap->nbyte;
-       ap.offset = (uap->offsetlo | ((off_t)uap->offsethi << 32));
+       ap.offset = PAIR32TO64(off_t,uap->offset);
        return (pwrite(td, &ap));
 }
 
@@ -2088,13 +2099,13 @@ freebsd6_freebsd32_lseek(struct thread *
        off_t pos;
 
        ap.fd = uap->fd;
-       ap.offset = (uap->offsetlo | ((off_t)uap->offsethi << 32));
+       ap.offset = PAIR32TO64(off_t,uap->offset);
        ap.whence = uap->whence;
        error = lseek(td, &ap);
        /* Expand the quad return into two parts for eax and edx */
        pos = *(off_t *)(td->td_retval);
-       td->td_retval[0] = pos & 0xffffffff;    /* %eax */
-       td->td_retval[1] = pos >> 32;           /* %edx */
+       td->td_retval[RETVAL_LO] = pos & 0xffffffff;    /* %eax */
+       td->td_retval[RETVAL_HI] = pos >> 32;           /* %edx */
        return error;
 }
 
@@ -2104,7 +2115,7 @@ freebsd6_freebsd32_truncate(struct threa
        struct truncate_args ap;
 
        ap.path = uap->path;
-       ap.length = (uap->lengthlo | ((off_t)uap->lengthhi << 32));
+       ap.length = PAIR32TO64(off_t,uap->length);
        return (truncate(td, &ap));
 }
 
@@ -2114,7 +2125,7 @@ freebsd6_freebsd32_ftruncate(struct thre
        struct ftruncate_args ap;
 
        ap.fd = uap->fd;
-       ap.length = (uap->lengthlo | ((off_t)uap->lengthhi << 32));
+       ap.length = PAIR32TO64(off_t,uap->length);
        return (ftruncate(td, &ap));
 }
 #endif /* COMPAT_FREEBSD6 */
@@ -2141,7 +2152,7 @@ freebsd32_do_sendfile(struct thread *td,
 
        ap.fd = uap->fd;
        ap.s = uap->s;
-       ap.offset = (uap->offsetlo | ((off_t)uap->offsethi << 32));
+       ap.offset = PAIR32TO64(off_t,uap->offset);
        ap.nbytes = uap->nbytes;
        ap.hdtr = (struct sf_hdtr *)uap->hdtr;          /* XXX not used */
        ap.sbytes = uap->sbytes;
@@ -2879,7 +2890,7 @@ freebsd32_cpuset_setid(struct thread *td
        struct cpuset_setid_args ap;
 
        ap.which = uap->which;
-       ap.id = (uap->idlo | ((id_t)uap->idhi << 32));
+       ap.id = PAIR32TO64(id_t,uap->id);
        ap.setid = uap->setid;
 
        return (cpuset_setid(td, &ap));
@@ -2893,7 +2904,7 @@ freebsd32_cpuset_getid(struct thread *td
 
        ap.level = uap->level;
        ap.which = uap->which;
-       ap.id = (uap->idlo | ((id_t)uap->idhi << 32));
+       ap.id = PAIR32TO64(id_t,uap->id);
        ap.setid = uap->setid;
 
        return (cpuset_getid(td, &ap));
@@ -2907,7 +2918,7 @@ freebsd32_cpuset_getaffinity(struct thre
 
        ap.level = uap->level;
        ap.which = uap->which;
-       ap.id = (uap->idlo | ((id_t)uap->idhi << 32));
+       ap.id = PAIR32TO64(id_t,uap->id);
        ap.cpusetsize = uap->cpusetsize;
        ap.mask = uap->mask;
 
@@ -2922,7 +2933,7 @@ freebsd32_cpuset_setaffinity(struct thre
 
        ap.level = uap->level;
        ap.which = uap->which;
-       ap.id = (uap->idlo | ((id_t)uap->idhi << 32));
+       ap.id = PAIR32TO64(id_t,uap->id);
        ap.cpusetsize = uap->cpusetsize;
        ap.mask = uap->mask;
 
@@ -3072,3 +3083,123 @@ syscall32_module_handler(struct module *
                return (error);
        }
 }
+
+register_t *
+freebsd32_copyout_strings(struct image_params *imgp)
+{
+       int argc, envc;
+       u_int32_t *vectp;
+       char *stringp, *destp;
+       u_int32_t *stack_base;
+       struct freebsd32_ps_strings *arginfo;
+       size_t execpath_len;
+       int szsigcode;
+
+       /*
+        * Calculate string base and vector table pointers.
+        * Also deal with signal trampoline code for this exec type.
+        */
+       if (imgp->execpath != NULL && imgp->auxargs != NULL)
+               execpath_len = strlen(imgp->execpath) + 1;
+       else
+               execpath_len = 0;
+       arginfo = (struct freebsd32_ps_strings *)FREEBSD32_PS_STRINGS;
+       szsigcode = *(imgp->proc->p_sysent->sv_szsigcode);
+       destp = (caddr_t)arginfo - szsigcode - SPARE_USRSPACE -
+               roundup(execpath_len, sizeof(char *)) -
+               roundup((ARG_MAX - imgp->args->stringspace), sizeof(char *));
+
+       /*
+        * install sigcode
+        */
+       if (szsigcode)
+               copyout(imgp->proc->p_sysent->sv_sigcode,
+                       ((caddr_t)arginfo - szsigcode), szsigcode);
+
+       /*
+        * Copy the image path for the rtld.
+        */
+       if (execpath_len != 0) {
+               imgp->execpathp = (uintptr_t)arginfo - szsigcode - execpath_len;
+               copyout(imgp->execpath, (void *)imgp->execpathp,
+                   execpath_len);
+       }
+
+       /*
+        * If we have a valid auxargs ptr, prepare some room
+        * on the stack.
+        */
+       if (imgp->auxargs) {
+               /*
+                * 'AT_COUNT*2' is size for the ELF Auxargs data. This is for
+                * lower compatibility.
+                */
+               imgp->auxarg_size = (imgp->auxarg_size) ? imgp->auxarg_size
+                       : (AT_COUNT * 2);
+               /*
+                * The '+ 2' is for the null pointers at the end of each of
+                * the arg and env vector sets,and imgp->auxarg_size is room
+                * for argument of Runtime loader.
+                */
+               vectp = (u_int32_t *) (destp - (imgp->args->argc +
+                   imgp->args->envc + 2 + imgp->auxarg_size + execpath_len) *
+                   sizeof(u_int32_t));
+       } else
+               /*
+                * The '+ 2' is for the null pointers at the end of each of
+                * the arg and env vector sets
+                */
+               vectp = (u_int32_t *)
+                       (destp - (imgp->args->argc + imgp->args->envc + 2) * 
sizeof(u_int32_t));
+
+       /*
+        * vectp also becomes our initial stack base
+        */
+       stack_base = vectp;
+
+       stringp = imgp->args->begin_argv;
+       argc = imgp->args->argc;
+       envc = imgp->args->envc;
+       /*
+        * Copy out strings - arguments and environment.
+        */
+       copyout(stringp, destp, ARG_MAX - imgp->args->stringspace);
+
+       /*
+        * Fill in "ps_strings" struct for ps, w, etc.
+        */
+       suword32(&arginfo->ps_argvstr, (u_int32_t)(intptr_t)vectp);
+       suword32(&arginfo->ps_nargvstr, argc);
+
+       /*
+        * Fill in argument portion of vector table.
+        */
+       for (; argc > 0; --argc) {
+               suword32(vectp++, (u_int32_t)(intptr_t)destp);
+               while (*stringp++ != 0)
+                       destp++;
+               destp++;
+       }
+
+       /* a null vector table pointer separates the argp's from the envp's */
+       suword32(vectp++, 0);
+
+       suword32(&arginfo->ps_envstr, (u_int32_t)(intptr_t)vectp);
+       suword32(&arginfo->ps_nenvstr, envc);
+
+       /*
+        * Fill in environment portion of vector table.
+        */
+       for (; envc > 0; --envc) {
+               suword32(vectp++, (u_int32_t)(intptr_t)destp);
+               while (*stringp++ != 0)
+                       destp++;
+               destp++;
+       }
+
+       /* end of vector table is a null pointer */
+       suword32(vectp, 0);
+
+       return ((register_t *)stack_base);
+}
+

Modified: head/sys/compat/freebsd32/freebsd32_proto.h
==============================================================================
--- head/sys/compat/freebsd32/freebsd32_proto.h Thu Mar 11 14:17:37 2010        
(r205013)
+++ head/sys/compat/freebsd32/freebsd32_proto.h Thu Mar 11 14:49:06 2010        
(r205014)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 200111 
2009-12-04 21:52:31Z kib 
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 203660 
2010-02-08 10:02:01Z ed 
  */
 
 #ifndef _FREEBSD32_SYSPROTO_H_
@@ -32,6 +32,9 @@ struct thread;
 #define        PADR_(t)        0
 #endif
 
+#if !defined(PAD64_REQUIRED) && defined(__powerpc__)
+#define PAD64_REQUIRED
+#endif
 struct freebsd32_wait4_args {
        char pid_l_[PADL_(int)]; int pid; char pid_r_[PADR_(int)];
        char status_l_[PADL_(int *)]; int * status; char status_r_[PADR_(int 
*)];
@@ -223,13 +226,15 @@ struct freebsd32_preadv_args {
        char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
        char iovp_l_[PADL_(struct iovec32 *)]; struct iovec32 * iovp; char 
iovp_r_[PADR_(struct iovec32 *)];
        char iovcnt_l_[PADL_(u_int)]; u_int iovcnt; char 
iovcnt_r_[PADR_(u_int)];
-       char offset_l_[PADL_(off_t)]; off_t offset; char 
offset_r_[PADR_(off_t)];
+       char offset1_l_[PADL_(u_int32_t)]; u_int32_t offset1; char 
offset1_r_[PADR_(u_int32_t)];
+       char offset2_l_[PADL_(u_int32_t)]; u_int32_t offset2; char 
offset2_r_[PADR_(u_int32_t)];
 };
 struct freebsd32_pwritev_args {
        char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
        char iovp_l_[PADL_(struct iovec32 *)]; struct iovec32 * iovp; char 
iovp_r_[PADR_(struct iovec32 *)];
        char iovcnt_l_[PADL_(u_int)]; u_int iovcnt; char 
iovcnt_r_[PADR_(u_int)];
-       char offset_l_[PADL_(off_t)]; off_t offset; char 
offset_r_[PADR_(off_t)];
+       char offset1_l_[PADL_(u_int32_t)]; u_int32_t offset1; char 
offset1_r_[PADR_(u_int32_t)];
+       char offset2_l_[PADL_(u_int32_t)]; u_int32_t offset2; char 
offset2_r_[PADR_(u_int32_t)];
 };
 struct freebsd32_modstat_args {
        char modid_l_[PADL_(int)]; int modid; char modid_r_[PADR_(int)];
@@ -294,8 +299,8 @@ struct freebsd32_nmount_args {
 struct freebsd32_sendfile_args {
        char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
        char s_l_[PADL_(int)]; int s; char s_r_[PADR_(int)];
-       char offsetlo_l_[PADL_(u_int32_t)]; u_int32_t offsetlo; char 
offsetlo_r_[PADR_(u_int32_t)];
-       char offsethi_l_[PADL_(u_int32_t)]; u_int32_t offsethi; char 
offsethi_r_[PADR_(u_int32_t)];
+       char offset1_l_[PADL_(u_int32_t)]; u_int32_t offset1; char 
offset1_r_[PADR_(u_int32_t)];
+       char offset2_l_[PADL_(u_int32_t)]; u_int32_t offset2; char 
offset2_r_[PADR_(u_int32_t)];
        char nbytes_l_[PADL_(size_t)]; size_t nbytes; char 
nbytes_r_[PADR_(size_t)];
        char hdtr_l_[PADL_(struct sf_hdtr32 *)]; struct sf_hdtr32 * hdtr; char 
hdtr_r_[PADR_(struct sf_hdtr32 *)];
        char sbytes_l_[PADL_(off_t *)]; off_t * sbytes; char 
sbytes_r_[PADR_(off_t *)];
@@ -343,19 +348,22 @@ struct freebsd32_aio_fsync_args {
        char op_l_[PADL_(int)]; int op; char op_r_[PADR_(int)];
        char aiocbp_l_[PADL_(struct aiocb32 *)]; struct aiocb32 * aiocbp; char 
aiocbp_r_[PADR_(struct aiocb32 *)];
 };
+#ifdef PAD64_REQUIRED
 struct freebsd32_pread_args {
        char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
        char buf_l_[PADL_(void *)]; void * buf; char buf_r_[PADR_(void *)];
        char nbyte_l_[PADL_(size_t)]; size_t nbyte; char 
nbyte_r_[PADR_(size_t)];
-       char offsetlo_l_[PADL_(u_int32_t)]; u_int32_t offsetlo; char 
offsetlo_r_[PADR_(u_int32_t)];
-       char offsethi_l_[PADL_(u_int32_t)]; u_int32_t offsethi; char 
offsethi_r_[PADR_(u_int32_t)];
+       char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)];
+       char offset1_l_[PADL_(u_int32_t)]; u_int32_t offset1; char 
offset1_r_[PADR_(u_int32_t)];
+       char offset2_l_[PADL_(u_int32_t)]; u_int32_t offset2; char 
offset2_r_[PADR_(u_int32_t)];
 };
 struct freebsd32_pwrite_args {
        char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
        char buf_l_[PADL_(const void *)]; const void * buf; char 
buf_r_[PADR_(const void *)];
        char nbyte_l_[PADL_(size_t)]; size_t nbyte; char 
nbyte_r_[PADR_(size_t)];
-       char offsetlo_l_[PADL_(u_int32_t)]; u_int32_t offsetlo; char 
offsetlo_r_[PADR_(u_int32_t)];
-       char offsethi_l_[PADL_(u_int32_t)]; u_int32_t offsethi; char 
offsethi_r_[PADR_(u_int32_t)];
+       char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)];
+       char offset1_l_[PADL_(u_int32_t)]; u_int32_t offset1; char 
offset1_r_[PADR_(u_int32_t)];
+       char offset2_l_[PADL_(u_int32_t)]; u_int32_t offset2; char 
offset2_r_[PADR_(u_int32_t)];
 };
 struct freebsd32_mmap_args {
        char addr_l_[PADL_(caddr_t)]; caddr_t addr; char 
addr_r_[PADR_(caddr_t)];
@@ -363,51 +371,106 @@ struct freebsd32_mmap_args {
        char prot_l_[PADL_(int)]; int prot; char prot_r_[PADR_(int)];
        char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)];
        char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
-       char poslo_l_[PADL_(u_int32_t)]; u_int32_t poslo; char 
poslo_r_[PADR_(u_int32_t)];
-       char poshi_l_[PADL_(u_int32_t)]; u_int32_t poshi; char 
poshi_r_[PADR_(u_int32_t)];
+       char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)];
+       char pos1_l_[PADL_(u_int32_t)]; u_int32_t pos1; char 
pos1_r_[PADR_(u_int32_t)];
+       char pos2_l_[PADL_(u_int32_t)]; u_int32_t pos2; char 
pos2_r_[PADR_(u_int32_t)];
 };
 struct freebsd32_lseek_args {
        char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
-       char offsetlo_l_[PADL_(u_int32_t)]; u_int32_t offsetlo; char 
offsetlo_r_[PADR_(u_int32_t)];
-       char offsethi_l_[PADL_(u_int32_t)]; u_int32_t offsethi; char 
offsethi_r_[PADR_(u_int32_t)];
+       char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)];
+       char offset1_l_[PADL_(u_int32_t)]; u_int32_t offset1; char 
offset1_r_[PADR_(u_int32_t)];
+       char offset2_l_[PADL_(u_int32_t)]; u_int32_t offset2; char 
offset2_r_[PADR_(u_int32_t)];
        char whence_l_[PADL_(int)]; int whence; char whence_r_[PADR_(int)];
 };
 struct freebsd32_truncate_args {
        char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
-       char lengthlo_l_[PADL_(u_int32_t)]; u_int32_t lengthlo; char 
lengthlo_r_[PADR_(u_int32_t)];
-       char lengthhi_l_[PADL_(u_int32_t)]; u_int32_t lengthhi; char 
lengthhi_r_[PADR_(u_int32_t)];
+       char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)];
+       char length1_l_[PADL_(u_int32_t)]; u_int32_t length1; char 
length1_r_[PADR_(u_int32_t)];
+       char length2_l_[PADL_(u_int32_t)]; u_int32_t length2; char 
length2_r_[PADR_(u_int32_t)];
 };
 struct freebsd32_ftruncate_args {
        char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
-       char lengthlo_l_[PADL_(u_int32_t)]; u_int32_t lengthlo; char 
lengthlo_r_[PADR_(u_int32_t)];
-       char lengthhi_l_[PADL_(u_int32_t)]; u_int32_t lengthhi; char 
lengthhi_r_[PADR_(u_int32_t)];
+       char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)];
+       char length1_l_[PADL_(u_int32_t)]; u_int32_t length1; char 
length1_r_[PADR_(u_int32_t)];
+       char length2_l_[PADL_(u_int32_t)]; u_int32_t length2; char 
length2_r_[PADR_(u_int32_t)];
+};
+#else
+struct freebsd32_pread_args {
+       char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
+       char buf_l_[PADL_(void *)]; void * buf; char buf_r_[PADR_(void *)];
+       char nbyte_l_[PADL_(size_t)]; size_t nbyte; char 
nbyte_r_[PADR_(size_t)];
+       char offset1_l_[PADL_(u_int32_t)]; u_int32_t offset1; char 
offset1_r_[PADR_(u_int32_t)];
+       char offset2_l_[PADL_(u_int32_t)]; u_int32_t offset2; char 
offset2_r_[PADR_(u_int32_t)];
+};
+struct freebsd32_pwrite_args {
+       char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
+       char buf_l_[PADL_(const void *)]; const void * buf; char 
buf_r_[PADR_(const void *)];
+       char nbyte_l_[PADL_(size_t)]; size_t nbyte; char 
nbyte_r_[PADR_(size_t)];
+       char offset1_l_[PADL_(u_int32_t)]; u_int32_t offset1; char 
offset1_r_[PADR_(u_int32_t)];
+       char offset2_l_[PADL_(u_int32_t)]; u_int32_t offset2; char 
offset2_r_[PADR_(u_int32_t)];
+};
+struct freebsd32_mmap_args {
+       char addr_l_[PADL_(caddr_t)]; caddr_t addr; char 
addr_r_[PADR_(caddr_t)];
+       char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)];
+       char prot_l_[PADL_(int)]; int prot; char prot_r_[PADR_(int)];
+       char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)];
+       char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
+       char pos1_l_[PADL_(u_int32_t)]; u_int32_t pos1; char 
pos1_r_[PADR_(u_int32_t)];
+       char pos2_l_[PADL_(u_int32_t)]; u_int32_t pos2; char 
pos2_r_[PADR_(u_int32_t)];
+};
+struct freebsd32_lseek_args {
+       char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
+       char offset1_l_[PADL_(u_int32_t)]; u_int32_t offset1; char 
offset1_r_[PADR_(u_int32_t)];
+       char offset2_l_[PADL_(u_int32_t)]; u_int32_t offset2; char 
offset2_r_[PADR_(u_int32_t)];
+       char whence_l_[PADL_(int)]; int whence; char whence_r_[PADR_(int)];
+};
+struct freebsd32_truncate_args {
+       char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+       char length1_l_[PADL_(u_int32_t)]; u_int32_t length1; char 
length1_r_[PADR_(u_int32_t)];
+       char length2_l_[PADL_(u_int32_t)]; u_int32_t length2; char 
length2_r_[PADR_(u_int32_t)];
+};
+struct freebsd32_ftruncate_args {
+       char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
+       char length1_l_[PADL_(u_int32_t)]; u_int32_t length1; char 
length1_r_[PADR_(u_int32_t)];
+       char length2_l_[PADL_(u_int32_t)]; u_int32_t length2; char 
length2_r_[PADR_(u_int32_t)];
+};
+#endif
+#ifdef PAD64_REQUIRED
+struct freebsd32_cpuset_setid_args {
+       char which_l_[PADL_(cpuwhich_t)]; cpuwhich_t which; char 
which_r_[PADR_(cpuwhich_t)];
+       char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)];
+       char id1_l_[PADL_(u_int32_t)]; u_int32_t id1; char 
id1_r_[PADR_(u_int32_t)];
+       char id2_l_[PADL_(u_int32_t)]; u_int32_t id2; char 
id2_r_[PADR_(u_int32_t)];
+       char setid_l_[PADL_(cpusetid_t)]; cpusetid_t setid; char 
setid_r_[PADR_(cpusetid_t)];
 };
+#else
 struct freebsd32_cpuset_setid_args {
        char which_l_[PADL_(cpuwhich_t)]; cpuwhich_t which; char 
which_r_[PADR_(cpuwhich_t)];
-       char idlo_l_[PADL_(uint32_t)]; uint32_t idlo; char 
idlo_r_[PADR_(uint32_t)];
-       char idhi_l_[PADL_(uint32_t)]; uint32_t idhi; char 
idhi_r_[PADR_(uint32_t)];
+       char id1_l_[PADL_(u_int32_t)]; u_int32_t id1; char 
id1_r_[PADR_(u_int32_t)];
+       char id2_l_[PADL_(u_int32_t)]; u_int32_t id2; char 
id2_r_[PADR_(u_int32_t)];
        char setid_l_[PADL_(cpusetid_t)]; cpusetid_t setid; char 
setid_r_[PADR_(cpusetid_t)];
 };
+#endif
 struct freebsd32_cpuset_getid_args {
        char level_l_[PADL_(cpulevel_t)]; cpulevel_t level; char 
level_r_[PADR_(cpulevel_t)];
        char which_l_[PADL_(cpuwhich_t)]; cpuwhich_t which; char 
which_r_[PADR_(cpuwhich_t)];
-       char idlo_l_[PADL_(uint32_t)]; uint32_t idlo; char 
idlo_r_[PADR_(uint32_t)];
-       char idhi_l_[PADL_(uint32_t)]; uint32_t idhi; char 
idhi_r_[PADR_(uint32_t)];
+       char id1_l_[PADL_(u_int32_t)]; u_int32_t id1; char 
id1_r_[PADR_(u_int32_t)];
+       char id2_l_[PADL_(u_int32_t)]; u_int32_t id2; char 
id2_r_[PADR_(u_int32_t)];
        char setid_l_[PADL_(cpusetid_t *)]; cpusetid_t * setid; char 
setid_r_[PADR_(cpusetid_t *)];
 };
 struct freebsd32_cpuset_getaffinity_args {
        char level_l_[PADL_(cpulevel_t)]; cpulevel_t level; char 
level_r_[PADR_(cpulevel_t)];
        char which_l_[PADL_(cpuwhich_t)]; cpuwhich_t which; char 
which_r_[PADR_(cpuwhich_t)];
-       char idlo_l_[PADL_(uint32_t)]; uint32_t idlo; char 
idlo_r_[PADR_(uint32_t)];
-       char idhi_l_[PADL_(uint32_t)]; uint32_t idhi; char 
idhi_r_[PADR_(uint32_t)];
+       char id1_l_[PADL_(u_int32_t)]; u_int32_t id1; char 
id1_r_[PADR_(u_int32_t)];
+       char id2_l_[PADL_(u_int32_t)]; u_int32_t id2; char 
id2_r_[PADR_(u_int32_t)];
        char cpusetsize_l_[PADL_(size_t)]; size_t cpusetsize; char 
cpusetsize_r_[PADR_(size_t)];
        char mask_l_[PADL_(cpuset_t *)]; cpuset_t * mask; char 
mask_r_[PADR_(cpuset_t *)];
 };
 struct freebsd32_cpuset_setaffinity_args {
        char level_l_[PADL_(cpulevel_t)]; cpulevel_t level; char 
level_r_[PADR_(cpulevel_t)];
        char which_l_[PADL_(cpuwhich_t)]; cpuwhich_t which; char 
which_r_[PADR_(cpuwhich_t)];
-       char idlo_l_[PADL_(uint32_t)]; uint32_t idlo; char 
idlo_r_[PADR_(uint32_t)];
-       char idhi_l_[PADL_(uint32_t)]; uint32_t idhi; char 
idhi_r_[PADR_(uint32_t)];
+       char id1_l_[PADL_(u_int32_t)]; u_int32_t id1; char 
id1_r_[PADR_(u_int32_t)];
+       char id2_l_[PADL_(u_int32_t)]; u_int32_t id2; char 
id2_r_[PADR_(u_int32_t)];
        char cpusetsize_l_[PADL_(size_t)]; size_t cpusetsize; char 
cpusetsize_r_[PADR_(size_t)];
        char mask_l_[PADL_(const cpuset_t *)]; const cpuset_t * mask; char 
mask_r_[PADR_(const cpuset_t *)];
 };
@@ -461,6 +524,9 @@ struct freebsd32_pselect_args {
        char ts_l_[PADL_(const struct timespec32 *)]; const struct timespec32 * 
ts; char ts_r_[PADR_(const struct timespec32 *)];
        char sm_l_[PADL_(const sigset_t *)]; const sigset_t * sm; char 
sm_r_[PADR_(const sigset_t *)];
 };
+#if !defined(PAD64_REQUIRED) && defined(__powerpc__)
+#define PAD64_REQUIRED
+#endif
 int    freebsd32_wait4(struct thread *, struct freebsd32_wait4_args *);
 int    freebsd32_recvmsg(struct thread *, struct freebsd32_recvmsg_args *);
 int    freebsd32_sendmsg(struct thread *, struct freebsd32_sendmsg_args *);
@@ -526,13 +592,26 @@ int       freebsd32_thr_suspend(struct thread 
 int    freebsd32_umtx_op(struct thread *, struct freebsd32_umtx_op_args *);
 int    freebsd32_thr_new(struct thread *, struct freebsd32_thr_new_args *);
 int    freebsd32_aio_fsync(struct thread *, struct freebsd32_aio_fsync_args *);
+#ifdef PAD64_REQUIRED
 int    freebsd32_pread(struct thread *, struct freebsd32_pread_args *);
 int    freebsd32_pwrite(struct thread *, struct freebsd32_pwrite_args *);
 int    freebsd32_mmap(struct thread *, struct freebsd32_mmap_args *);
 int    freebsd32_lseek(struct thread *, struct freebsd32_lseek_args *);
 int    freebsd32_truncate(struct thread *, struct freebsd32_truncate_args *);
 int    freebsd32_ftruncate(struct thread *, struct freebsd32_ftruncate_args *);
+#else
+int    freebsd32_pread(struct thread *, struct freebsd32_pread_args *);
+int    freebsd32_pwrite(struct thread *, struct freebsd32_pwrite_args *);
+int    freebsd32_mmap(struct thread *, struct freebsd32_mmap_args *);
+int    freebsd32_lseek(struct thread *, struct freebsd32_lseek_args *);
+int    freebsd32_truncate(struct thread *, struct freebsd32_truncate_args *);
+int    freebsd32_ftruncate(struct thread *, struct freebsd32_ftruncate_args *);
+#endif
+#ifdef PAD64_REQUIRED
 int    freebsd32_cpuset_setid(struct thread *, struct 
freebsd32_cpuset_setid_args *);
+#else
+int    freebsd32_cpuset_setid(struct thread *, struct 
freebsd32_cpuset_setid_args *);
+#endif
 int    freebsd32_cpuset_getid(struct thread *, struct 
freebsd32_cpuset_getid_args *);
 int    freebsd32_cpuset_getaffinity(struct thread *, struct 
freebsd32_cpuset_getaffinity_args *);
 int    freebsd32_cpuset_setaffinity(struct thread *, struct 
freebsd32_cpuset_setaffinity_args *);
@@ -548,6 +627,9 @@ int freebsd32_pselect(struct thread *, s
 
 #ifdef COMPAT_43
 
+#if !defined(PAD64_REQUIRED) && defined(__powerpc__)
+#define PAD64_REQUIRED
+#endif
 struct ofreebsd32_sigaction_args {
        char signum_l_[PADL_(int)]; int signum; char signum_r_[PADR_(int)];
        char nsa_l_[PADL_(struct osigaction32 *)]; struct osigaction32 * nsa; 
char nsa_r_[PADR_(struct osigaction32 *)];
@@ -575,6 +657,12 @@ struct ofreebsd32_sigstack_args {
        char nss_l_[PADL_(struct sigstack32 *)]; struct sigstack32 * nss; char 
nss_r_[PADR_(struct sigstack32 *)];
        char oss_l_[PADL_(struct sigstack32 *)]; struct sigstack32 * oss; char 
oss_r_[PADR_(struct sigstack32 *)];
 };
+#ifdef PAD64_REQUIRED
+#else
+#endif
+#ifdef PAD64_REQUIRED
+#else
+#endif
 int    ofreebsd32_sigaction(struct thread *, struct ofreebsd32_sigaction_args 
*);
 int    ofreebsd32_sigprocmask(struct thread *, struct 
ofreebsd32_sigprocmask_args *);
 int    ofreebsd32_sigpending(struct thread *, struct 
ofreebsd32_sigpending_args *);
@@ -589,6 +677,9 @@ int ofreebsd32_sigstack(struct thread *,
 
 #ifdef COMPAT_FREEBSD4
 
+#if !defined(PAD64_REQUIRED) && defined(__powerpc__)
+#define PAD64_REQUIRED
+#endif
 struct freebsd4_freebsd32_getfsstat_args {
        char buf_l_[PADL_(struct statfs32 *)]; struct statfs32 * buf; char 
buf_r_[PADR_(struct statfs32 *)];
        char bufsize_l_[PADL_(long)]; long bufsize; char 
bufsize_r_[PADR_(long)];
@@ -609,8 +700,8 @@ struct freebsd4_freebsd32_fhstatfs_args 
 struct freebsd4_freebsd32_sendfile_args {
        char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
        char s_l_[PADL_(int)]; int s; char s_r_[PADR_(int)];
-       char offsetlo_l_[PADL_(u_int32_t)]; u_int32_t offsetlo; char 
offsetlo_r_[PADR_(u_int32_t)];
-       char offsethi_l_[PADL_(u_int32_t)]; u_int32_t offsethi; char 
offsethi_r_[PADR_(u_int32_t)];
+       char offset1_l_[PADL_(u_int32_t)]; u_int32_t offset1; char 
offset1_r_[PADR_(u_int32_t)];
+       char offset2_l_[PADL_(u_int32_t)]; u_int32_t offset2; char 
offset2_r_[PADR_(u_int32_t)];
        char nbytes_l_[PADL_(size_t)]; size_t nbytes; char 
nbytes_r_[PADR_(size_t)];
        char hdtr_l_[PADL_(struct sf_hdtr32 *)]; struct sf_hdtr32 * hdtr; char 
hdtr_r_[PADR_(struct sf_hdtr32 *)];
        char sbytes_l_[PADL_(off_t *)]; off_t * sbytes; char 
sbytes_r_[PADR_(off_t *)];
@@ -624,6 +715,12 @@ struct freebsd4_freebsd32_sigaction_args
 struct freebsd4_freebsd32_sigreturn_args {
        char sigcntxp_l_[PADL_(const struct freebsd4_freebsd32_ucontext *)]; 
const struct freebsd4_freebsd32_ucontext * sigcntxp; char 
sigcntxp_r_[PADR_(const struct freebsd4_freebsd32_ucontext *)];
 };
+#ifdef PAD64_REQUIRED
+#else
+#endif
+#ifdef PAD64_REQUIRED
+#else
+#endif
 int    freebsd4_freebsd32_getfsstat(struct thread *, struct 
freebsd4_freebsd32_getfsstat_args *);
 int    freebsd4_freebsd32_statfs(struct thread *, struct 
freebsd4_freebsd32_statfs_args *);
 int    freebsd4_freebsd32_fstatfs(struct thread *, struct 
freebsd4_freebsd32_fstatfs_args *);
@@ -637,21 +734,24 @@ int       freebsd4_freebsd32_sigreturn(struct 
 
 #ifdef COMPAT_FREEBSD6
 
+#if !defined(PAD64_REQUIRED) && defined(__powerpc__)
+#define PAD64_REQUIRED
+#endif
 struct freebsd6_freebsd32_pread_args {
        char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
        char buf_l_[PADL_(void *)]; void * buf; char buf_r_[PADR_(void *)];
        char nbyte_l_[PADL_(size_t)]; size_t nbyte; char 
nbyte_r_[PADR_(size_t)];
        char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)];
-       char offsetlo_l_[PADL_(u_int32_t)]; u_int32_t offsetlo; char 
offsetlo_r_[PADR_(u_int32_t)];
-       char offsethi_l_[PADL_(u_int32_t)]; u_int32_t offsethi; char 
offsethi_r_[PADR_(u_int32_t)];
+       char offset1_l_[PADL_(u_int32_t)]; u_int32_t offset1; char 
offset1_r_[PADR_(u_int32_t)];
+       char offset2_l_[PADL_(u_int32_t)]; u_int32_t offset2; char 
offset2_r_[PADR_(u_int32_t)];
 };
 struct freebsd6_freebsd32_pwrite_args {
        char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
        char buf_l_[PADL_(const void *)]; const void * buf; char 
buf_r_[PADR_(const void *)];
        char nbyte_l_[PADL_(size_t)]; size_t nbyte; char 
nbyte_r_[PADR_(size_t)];
        char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)];
-       char offsetlo_l_[PADL_(u_int32_t)]; u_int32_t offsetlo; char 
offsetlo_r_[PADR_(u_int32_t)];
-       char offsethi_l_[PADL_(u_int32_t)]; u_int32_t offsethi; char 
offsethi_r_[PADR_(u_int32_t)];
+       char offset1_l_[PADL_(u_int32_t)]; u_int32_t offset1; char 
offset1_r_[PADR_(u_int32_t)];
+       char offset2_l_[PADL_(u_int32_t)]; u_int32_t offset2; char 
offset2_r_[PADR_(u_int32_t)];
 };
 struct freebsd6_freebsd32_mmap_args {
        char addr_l_[PADL_(caddr_t)]; caddr_t addr; char 
addr_r_[PADR_(caddr_t)];
@@ -660,28 +760,34 @@ struct freebsd6_freebsd32_mmap_args {
        char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)];
        char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
        char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)];
-       char poslo_l_[PADL_(u_int32_t)]; u_int32_t poslo; char 
poslo_r_[PADR_(u_int32_t)];
-       char poshi_l_[PADL_(u_int32_t)]; u_int32_t poshi; char 
poshi_r_[PADR_(u_int32_t)];
+       char pos1_l_[PADL_(u_int32_t)]; u_int32_t pos1; char 
pos1_r_[PADR_(u_int32_t)];
+       char pos2_l_[PADL_(u_int32_t)]; u_int32_t pos2; char 
pos2_r_[PADR_(u_int32_t)];
 };
 struct freebsd6_freebsd32_lseek_args {
        char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
        char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)];
-       char offsetlo_l_[PADL_(u_int32_t)]; u_int32_t offsetlo; char 
offsetlo_r_[PADR_(u_int32_t)];
-       char offsethi_l_[PADL_(u_int32_t)]; u_int32_t offsethi; char 
offsethi_r_[PADR_(u_int32_t)];
+       char offset1_l_[PADL_(u_int32_t)]; u_int32_t offset1; char 
offset1_r_[PADR_(u_int32_t)];
+       char offset2_l_[PADL_(u_int32_t)]; u_int32_t offset2; char 
offset2_r_[PADR_(u_int32_t)];
        char whence_l_[PADL_(int)]; int whence; char whence_r_[PADR_(int)];
 };
 struct freebsd6_freebsd32_truncate_args {
        char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
        char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)];
-       char lengthlo_l_[PADL_(u_int32_t)]; u_int32_t lengthlo; char 
lengthlo_r_[PADR_(u_int32_t)];
-       char lengthhi_l_[PADL_(u_int32_t)]; u_int32_t lengthhi; char 
lengthhi_r_[PADR_(u_int32_t)];
+       char length1_l_[PADL_(u_int32_t)]; u_int32_t length1; char 
length1_r_[PADR_(u_int32_t)];
+       char length2_l_[PADL_(u_int32_t)]; u_int32_t length2; char 
length2_r_[PADR_(u_int32_t)];
 };
 struct freebsd6_freebsd32_ftruncate_args {
        char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
        char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)];
-       char lengthlo_l_[PADL_(u_int32_t)]; u_int32_t lengthlo; char 
lengthlo_r_[PADR_(u_int32_t)];
-       char lengthhi_l_[PADL_(u_int32_t)]; u_int32_t lengthhi; char 
lengthhi_r_[PADR_(u_int32_t)];
+       char length1_l_[PADL_(u_int32_t)]; u_int32_t length1; char 
length1_r_[PADR_(u_int32_t)];
+       char length2_l_[PADL_(u_int32_t)]; u_int32_t length2; char 
length2_r_[PADR_(u_int32_t)];
 };
+#ifdef PAD64_REQUIRED
+#else
+#endif
+#ifdef PAD64_REQUIRED
+#else
+#endif
 int    freebsd6_freebsd32_pread(struct thread *, struct 
freebsd6_freebsd32_pread_args *);
 int    freebsd6_freebsd32_pwrite(struct thread *, struct 
freebsd6_freebsd32_pwrite_args *);
 int    freebsd6_freebsd32_mmap(struct thread *, struct 
freebsd6_freebsd32_mmap_args *);
@@ -694,6 +800,9 @@ int freebsd6_freebsd32_ftruncate(struct 
 
 #ifdef COMPAT_FREEBSD7
 
+#if !defined(PAD64_REQUIRED) && defined(__powerpc__)
+#define PAD64_REQUIRED
+#endif
 struct freebsd7_freebsd32_semctl_args {
        char semid_l_[PADL_(int)]; int semid; char semid_r_[PADR_(int)];
        char semnum_l_[PADL_(int)]; int semnum; char semnum_r_[PADR_(int)];
@@ -710,6 +819,12 @@ struct freebsd7_freebsd32_shmctl_args {
        char cmd_l_[PADL_(int)]; int cmd; char cmd_r_[PADR_(int)];
        char buf_l_[PADL_(struct shmid_ds32_old *)]; struct shmid_ds32_old * 
buf; char buf_r_[PADR_(struct shmid_ds32_old *)];
 };
+#ifdef PAD64_REQUIRED
+#else
+#endif
+#ifdef PAD64_REQUIRED
+#else
+#endif
 int    freebsd7_freebsd32_semctl(struct thread *, struct 
freebsd7_freebsd32_semctl_args *);
 int    freebsd7_freebsd32_msgctl(struct thread *, struct 
freebsd7_freebsd32_msgctl_args *);
 int    freebsd7_freebsd32_shmctl(struct thread *, struct 
freebsd7_freebsd32_shmctl_args *);
@@ -811,6 +926,13 @@ int        freebsd7_freebsd32_shmctl(struct thr
 #define        FREEBSD32_SYS_AUE_freebsd32_lseek       AUE_LSEEK
 #define        FREEBSD32_SYS_AUE_freebsd32_truncate    AUE_TRUNCATE
 #define        FREEBSD32_SYS_AUE_freebsd32_ftruncate   AUE_FTRUNCATE
+#define        FREEBSD32_SYS_AUE_freebsd32_pread       AUE_PREAD
+#define        FREEBSD32_SYS_AUE_freebsd32_pwrite      AUE_PWRITE
+#define        FREEBSD32_SYS_AUE_freebsd32_mmap        AUE_MMAP
+#define        FREEBSD32_SYS_AUE_freebsd32_lseek       AUE_LSEEK
+#define        FREEBSD32_SYS_AUE_freebsd32_truncate    AUE_TRUNCATE
+#define        FREEBSD32_SYS_AUE_freebsd32_ftruncate   AUE_FTRUNCATE
+#define        FREEBSD32_SYS_AUE_freebsd32_cpuset_setid        AUE_NULL
 #define        FREEBSD32_SYS_AUE_freebsd32_cpuset_setid        AUE_NULL
 #define        FREEBSD32_SYS_AUE_freebsd32_cpuset_getid        AUE_NULL
 #define        FREEBSD32_SYS_AUE_freebsd32_cpuset_getaffinity  AUE_NULL

Modified: head/sys/compat/freebsd32/freebsd32_syscall.h
==============================================================================
--- head/sys/compat/freebsd32/freebsd32_syscall.h       Thu Mar 11 14:17:37 
2010        (r205013)
+++ head/sys/compat/freebsd32/freebsd32_syscall.h       Thu Mar 11 14:49:06 
2010        (r205014)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 200111 
2009-12-04 21:52:31Z kib 
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 203660 
2010-02-08 10:02:01Z ed 
  */
 
 #define        FREEBSD32_SYS_syscall   0
@@ -354,11 +354,18 @@
 #define        FREEBSD32_SYS_freebsd32_lseek   478
 #define        FREEBSD32_SYS_freebsd32_truncate        479
 #define        FREEBSD32_SYS_freebsd32_ftruncate       480
+#define        FREEBSD32_SYS_freebsd32_pread   475
+#define        FREEBSD32_SYS_freebsd32_pwrite  476
+#define        FREEBSD32_SYS_freebsd32_mmap    477
+#define        FREEBSD32_SYS_freebsd32_lseek   478
+#define        FREEBSD32_SYS_freebsd32_truncate        479
+#define        FREEBSD32_SYS_freebsd32_ftruncate       480
 #define        FREEBSD32_SYS_thr_kill2 481
 #define        FREEBSD32_SYS_shm_open  482
 #define        FREEBSD32_SYS_shm_unlink        483
 #define        FREEBSD32_SYS_cpuset    484
 #define        FREEBSD32_SYS_freebsd32_cpuset_setid    485
+#define        FREEBSD32_SYS_freebsd32_cpuset_setid    485
 #define        FREEBSD32_SYS_freebsd32_cpuset_getid    486
 #define        FREEBSD32_SYS_freebsd32_cpuset_getaffinity      487
 #define        FREEBSD32_SYS_freebsd32_cpuset_setaffinity      488

Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c
==============================================================================
--- head/sys/compat/freebsd32/freebsd32_syscalls.c      Thu Mar 11 14:17:37 
2010        (r205013)
+++ head/sys/compat/freebsd32/freebsd32_syscalls.c      Thu Mar 11 14:49:06 
2010        (r205014)
@@ -3,10 +3,13 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 200111 
2009-12-04 21:52:31Z kib 
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 203660 
2010-02-08 10:02:01Z ed 

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to