The SVR4 emulator from NetBSD was ported by Mark Newton around 1998 and it should prove very useful for i386, amd64 and SPARC64 now that Solaris is available freely. Mark's Newton TODO list is probably still valid, but I took a quick look at the updates on NetBSD's CVS and tried apply most updates to FreeBSD. The following patch is untested, although I built it on amd64. It would be great if someone that knows more about emulation (and kernels) reviews it. and continues where Mark left off. BTW, checking this patch makes me REALLY appreciate the hard work Mark made to port this. Fix: patch follows: How-To-Repeat: Here is a changelog (mostly stealed from NetBSD's CVS) of the changes I could rip off: svr4_filio.c -Bounds check syscall arguments where appropriate svr4_ioctl.c - Kill register declarations. svr4_misc.c - Add new sysconfig bits. - Replace the statfs() family of system calls with statvfs() *DO CHECK* - fix obvious bug in svr4_sys_resolvepath(): - fix NetBSD security/14444 - use strlcpy - PR/29696 not all filesystems support cookies. TODO: Handle MAP_ANON (see also svr4_mman.h) make signal array handling uniform svr4_resource.c - Kill register declarations. svr4_siginfo.h - Match the Solaris siginfo layout for _LP64. svr4_signal.c - Remove returns after returns(!) svr4_stat.c: - Add support for 64-bit SVR4 (Solaris 8) binaries. - Remove breaks after returns, unreachable returns and returns after returns(!). - use strlcpy - Fix the sysinfo(SI_HW_SERIAL, emulation so that we actually get the hostid of the machine rather than always getting "0". - Fix systeminfo. 1. return length is the string length even if the string would not fit. 2. add SI_ISALIST 3. on 32 bit emulation, don't return sparc64 as the arch! svr4_stat.h: - Translate _PC_FILESIZEBITS - Add support for 64-bit SVR4 (Solaris 8) binaries. svr4_sysconfig.h - Add new sysconfig bits, Fix the bogus numbering of the old bits. svr4_systeminfo.h - Add some IRIX constants svr4_timod.h - Add a few more constants.
Responsible Changed From-To: freebsd-bugs->freebsd-emulation Reclassify to kernel and assign to freebsd-emulation.
Hmm... I already found an issue: there's no kern_statvfs., and I'm not sure kern_statfs will do the right thing. It's probably not too difficult to solve but perhaps we shouldn't do the statfs-->statvfs change for now. I will need to test the patch on i386. ___________________________________ Yahoo! Messenger: chiamate gratuite in tutto il mondo http://it.messenger.yahoo.com
I have greatly reduced the size and scope of the patch by removing all the code for 64bit emulation and things that don't apply to FreeBSd (IRIX defines). This is the log for the changes included: _______________________ svr4_filio.c -Bounds check syscall arguments where appropriate svr4_ioctl.c - Kill register declarations. svr4_misc.c - Add new sysconfig bits. - fix obvious bug in svr4_sys_resolvepath(): - fix NetBSD security/14444 - use strlcpy - PR/29696 not all filesystems support cookies. svr4_resource.c - Kill register declarations. svr4_signal.c - Remove returns after returns(!) svr4_stat.c: - Remove breaks after returns, unreachable returns and returns after returns(!). - use strlcpy - Fix the sysinfo(SI_HW_SERIAL, emulation so that we actually get the hostid of the machine rather than always getting "0". - Fix systeminfo. 1. return length is the string length even if the string would not fit. 2. add SI_ISALIST 3. on 32 bit emulation, don't return sparc64 as the arch! svr4_sysconfig.h - Add new sysconfig bits, Fix the bogus numbering of the old bits. ___________________________ diff -ru svr4.orig/svr4_filio.c svr4/svr4_filio.c --- svr4.orig/svr4_filio.c Tue Jan 3 16:41:01 2006 +++ svr4/svr4_filio.c Tue Jan 3 20:15:13 2006 @@ -209,6 +209,8 @@ *retval = 0; + if ((fp = fd_getfile(fdp, fd)) == NULL) + return EBADF; switch (cmd) { case SVR4_FIOCLEX: FILEDESC_LOCK_FAST(fdp); diff -ru svr4.orig/svr4_misc.c svr4/svr4_misc.c --- svr4.orig/svr4_misc.c Tue Jan 3 16:41:01 2006 +++ svr4/svr4_misc.c Tue Jan 3 21:33:41 2006 @@ -369,7 +369,7 @@ svr4_dirent.d_off = (svr4_off_t)(off + reclen); svr4_dirent.d_reclen = (u_short) svr4reclen; } - strcpy(svr4_dirent.d_name, bdp->d_name); + strlcpy(svr4_dirent.d_name, bdp->d_name, sizeof(svr4_dirent.d_name)); if ((error = copyout((caddr_t)&svr4_dirent, outp, svr4reclen))) goto out; inp += reclen; @@ -483,7 +483,10 @@ reclen = bdp->d_reclen; if (reclen & 3) panic("svr4_sys_getdents64: bad reclen"); - off = *cookie++; /* each entry points to the next */ + if (cookie) + off = *cookie++; /* each entry points to the next */ + else + off += reclen; if ((off >> 32) != 0) { uprintf("svr4_sys_getdents64: dir offset too large for emulated program"); error = EINVAL; @@ -507,7 +510,7 @@ idb.d_ino = (svr4_ino_t)bdp->d_fileno; idb.d_off = (svr4_off_t)off; idb.d_reclen = (u_short)svr4_reclen; - strcpy(idb.d_name, bdp->d_name); + strlcpy(idb.d_name, bdp->d_name,sizeof(idb.d_name)); if ((error = copyout((caddr_t)&idb, outp, svr4_reclen))) goto out; /* advance past this real entry */ @@ -781,7 +784,45 @@ #endif break; #endif /* NOTYET */ - + case SVR4_CONFIG_COHERENCY: + *retval = 0; /* XXX */ + break; + case SVR4_CONFIG_SPLIT_CACHE: + *retval = 0; /* XXX */ + break; + case SVR4_CONFIG_ICACHESZ: + *retval = 256; /* XXX */ + break; + case SVR4_CONFIG_DCACHESZ: + *retval = 256; /* XXX */ + break; + case SVR4_CONFIG_ICACHELINESZ: + *retval = 64; /* XXX */ + break; + case SVR4_CONFIG_DCACHELINESZ: + *retval = 64; /* XXX */ + break; + case SVR4_CONFIG_ICACHEBLKSZ: + *retval = 64; /* XXX */ + break; + case SVR4_CONFIG_DCACHEBLKSZ: + *retval = 64; /* XXX */ + break; + case SVR4_CONFIG_DCACHETBLKSZ: + *retval = 64; /* XXX */ + break; + case SVR4_CONFIG_ICACHE_ASSOC: + *retval = 1; /* XXX */ + break; + case SVR4_CONFIG_DCACHE_ASSOC: + *retval = 1; /* XXX */ + break; + case SVR4_CONFIG_MAXPID: + *retval = PID_MAX; + break; + case SVR4_CONFIG_STACK_PROT: + *retval = PROT_READ|PROT_WRITE|PROT_EXEC; + break; default: return EINVAL; } @@ -1254,16 +1295,16 @@ sx_xlock(&proctree_lock); PROC_LOCK(q); if (q->p_flag & P_TRACED) { - if (q->p_oppid != q->p_pptr->p_pid) { + if (q->p_opptr != q->p_pptr) { PROC_UNLOCK(q); - t = pfind(q->p_oppid); + t = q->p_opptr; if (t == NULL) { t = initproc; PROC_LOCK(initproc); } PROC_LOCK(q); proc_reparent(q, t); - q->p_oppid = 0; + q->p_opptr = NULL; q->p_flag &= ~(P_TRACED | P_WAITED); PROC_UNLOCK(q); psignal(t, SIGCHLD); @@ -1664,6 +1705,6 @@ *retval = ncopy; bad: NDFREE(&nd, NDF_ONLY_PNBUF); - vput(nd.ni_vp); + vrele(nd.ni_vp); return error; } diff -ru svr4.orig/svr4_resource.c svr4/svr4_resource.c --- svr4.orig/svr4_resource.c Tue Jan 3 16:41:01 2006 +++ svr4/svr4_resource.c Tue Jan 3 18:27:46 2006 @@ -127,7 +127,7 @@ int svr4_sys_getrlimit(td, uap) - register struct thread *td; + struct thread *td; struct svr4_sys_getrlimit_args *uap; { int rl = svr4_to_native_rl(uap->which); @@ -174,7 +174,7 @@ int svr4_sys_setrlimit(td, uap) - register struct thread *td; + struct thread *td; struct svr4_sys_setrlimit_args *uap; { int rl = svr4_to_native_rl(uap->which); @@ -225,7 +225,7 @@ int svr4_sys_getrlimit64(td, uap) - register struct thread *td; + struct thread *td; struct svr4_sys_getrlimit64_args *uap; { int rl = svr4_to_native_rl(uap->which); @@ -272,7 +272,7 @@ int svr4_sys_setrlimit64(td, uap) - register struct thread *td; + struct thread *td; struct svr4_sys_setrlimit64_args *uap; { int rl = svr4_to_native_rl(uap->which); diff -ru svr4.orig/svr4_signal.c svr4/svr4_signal.c --- svr4.orig/svr4_signal.c Tue Jan 3 16:41:01 2006 +++ svr4/svr4_signal.c Tue Jan 3 21:59:52 2006 @@ -560,7 +560,6 @@ uap->uc)); return ENOSYS; } - return 0; } int diff -ru svr4.orig/svr4_socket.c svr4/svr4_socket.c --- svr4.orig/svr4_socket.c Tue Jan 3 16:41:01 2006 +++ svr4/svr4_socket.c Tue Jan 3 18:44:04 2006 @@ -114,7 +114,8 @@ struct stat *st; { struct svr4_sockcache_entry *e; - int len, error; + size_t len; + int error; mtx_lock(&Giant); diff -ru svr4.orig/svr4_stat.c svr4/svr4_stat.c --- svr4.orig/svr4_stat.c Tue Jan 3 16:41:01 2006 +++ svr4/svr4_stat.c Tue Jan 3 19:33:39 2006 @@ -444,9 +450,21 @@ case SVR4_SI_ARCHITECTURE: str = machine; break; + case SVR4_SI_ISALIST: +#if defined(__sparc__) + str = "sparcv9 sparcv9-fsmuld sparcv8 sparcv8-fsmuld sparcv7 sparc"; +#elif defined(__i386__) + str = "i386"; +#elif defined(__amd64__) + str = "amd64"; +#else + str = "unknown"; + #endif + break; case SVR4_SI_HW_SERIAL: - str = "0"; + snprintf(buf, sizeof(buf), "%lu", hostid); + str = buf; break; case SVR4_SI_HW_PROVIDER: @@ -543,7 +561,6 @@ default: return ENOSYS; } - return ENOSYS; } diff -ru svr4.orig/svr4_sysconfig.h svr4/svr4_sysconfig.h --- svr4.orig/svr4_sysconfig.h Tue Jan 3 16:41:01 2006 +++ svr4/svr4_sysconfig.h Tue Jan 3 22:25:50 2006 @@ -43,20 +43,36 @@ #define SVR4_CONFIG_PROF_TCK 0x0a #define SVR4_CONFIG_NPROC_CONF 0x0b #define SVR4_CONFIG_NPROC_ONLN 0x0c -#define SVR4_CONFIG_AIO_LISTIO_MAX 0x0e -#define SVR4_CONFIG_AIO_MAX 0x0f -#define SVR4_CONFIG_AIO_PRIO_DELTA_MAX 0x10 -#define SVR4_CONFIG_DELAYTIMER_MAX 0x11 -#define SVR4_CONFIG_MQ_OPEN_MAX 0x12 -#define SVR4_CONFIG_MQ_PRIO_MAX 0x13 -#define SVR4_CONFIG_RTSIG_MAX 0x14 -#define SVR4_CONFIG_SEM_NSEMS_MAX 0x15 -#define SVR4_CONFIG_SEM_VALUE_MAX 0x16 -#define SVR4_CONFIG_SIGQUEUE_MAX 0x17 -#define SVR4_CONFIG_SIGRT_MIN 0x18 -#define SVR4_CONFIG_SIGRT_MAX 0x19 -#define SVR4_CONFIG_TIMER_MAX 0x20 -#define SVR4_CONFIG_PHYS_PAGES 0x21 -#define SVR4_CONFIG_AVPHYS_PAGES 0x22 +#define SVR4_CONFIG_AIO_LISTIO_MAX 0x0d +#define SVR4_CONFIG_AIO_MAX 0x0e +#define SVR4_CONFIG_AIO_PRIO_DELTA_MAX 0x0f +#define SVR4_CONFIG_DELAYTIMER_MAX 0x10 +#define SVR4_CONFIG_MQ_OPEN_MAX 0x11 +#define SVR4_CONFIG_MQ_PRIO_MAX 0x12 +#define SVR4_CONFIG_RTSIG_MAX 0x13 +#define SVR4_CONFIG_SEM_NSEMS_MAX 0x14 +#define SVR4_CONFIG_SEM_VALUE_MAX 0x15 +#define SVR4_CONFIG_SIGQUEUE_MAX 0x16 +#define SVR4_CONFIG_SIGRT_MIN 0x17 +#define SVR4_CONFIG_SIGRT_MAX 0x18 +#define SVR4_CONFIG_TIMER_MAX 0x19 +#define SVR4_CONFIG_PHYS_PAGES 0x1a +#define SVR4_CONFIG_AVPHYS_PAGES 0x1b +#define SVR4_CONFIG_COHERENCY 0x1c +#define SVR4_CONFIG_SPLIT_CACHE 0x1d +#define SVR4_CONFIG_ICACHESZ 0x1e +#define SVR4_CONFIG_DCACHESZ 0x1f +#define SVR4_CONFIG_ICACHELINESZ 0x20 +#define SVR4_CONFIG_DCACHELINESZ 0x21 +#define SVR4_CONFIG_ICACHEBLKSZ 0x22 +#define SVR4_CONFIG_DCACHEBLKSZ 0x23 +#define SVR4_CONFIG_DCACHETBLKSZ 0x24 +#define SVR4_CONFIG_ICACHE_ASSOC 0x25 +#define SVR4_CONFIG_DCACHE_ASSOC 0x26 +#define SVR4_CONFIG_UNUSED_2 0x27 +#define SVR4_CONFIG_UNUSED_3 0x28 +#define SVR4_CONFIG_UNUSED_4 0x29 +#define SVR4_CONFIG_MAXPID 0x2a +#define SVR4_CONFIG_STACK_PROT 0x2b #endif /* !_SVR4_SYSCONFIG_H_ */
Yet another update: This new patch compiled cleanly on my QEMU test environment by cleaning out more NetBSD dependent code, Unfortunately my execution tests were nonconclusive as the combination of old shared libraries (from a deprecated linux svr4 kit) and a recent executable (unzip) core dump with and without my patches! I think the patch is ready but we still lack testing. ________ diff -ru svr4.orig/svr4_misc.c svr4/svr4_misc.c --- svr4.orig/svr4_misc.c Tue Jan 3 16:41:01 2006 +++ svr4/svr4_misc.c Tue Jan 3 21:33:41 2006 @@ -369,7 +369,7 @@ svr4_dirent.d_off = (svr4_off_t)(off + reclen); svr4_dirent.d_reclen = (u_short) svr4reclen; } - strcpy(svr4_dirent.d_name, bdp->d_name); + strlcpy(svr4_dirent.d_name, bdp->d_name, sizeof(svr4_dirent.d_name)); if ((error = copyout((caddr_t)&svr4_dirent, outp, svr4reclen))) goto out; inp += reclen; @@ -483,7 +483,10 @@ reclen = bdp->d_reclen; if (reclen & 3) panic("svr4_sys_getdents64: bad reclen"); - off = *cookie++; /* each entry points to the next */ + if (cookie) + off = *cookie++; /* each entry points to the next */ + else + off += reclen; if ((off >> 32) != 0) { uprintf("svr4_sys_getdents64: dir offset too large for emulated program"); error = EINVAL; @@ -507,7 +510,7 @@ idb.d_ino = (svr4_ino_t)bdp->d_fileno; idb.d_off = (svr4_off_t)off; idb.d_reclen = (u_short)svr4_reclen; - strcpy(idb.d_name, bdp->d_name); + strlcpy(idb.d_name, bdp->d_name,sizeof(idb.d_name)); if ((error = copyout((caddr_t)&idb, outp, svr4_reclen))) goto out; /* advance past this real entry */ @@ -781,7 +784,45 @@ #endif break; #endif /* NOTYET */ - + case SVR4_CONFIG_COHERENCY: + *retval = 0; /* XXX */ + break; + case SVR4_CONFIG_SPLIT_CACHE: + *retval = 0; /* XXX */ + break; + case SVR4_CONFIG_ICACHESZ: + *retval = 256; /* XXX */ + break; + case SVR4_CONFIG_DCACHESZ: + *retval = 256; /* XXX */ + break; + case SVR4_CONFIG_ICACHELINESZ: + *retval = 64; /* XXX */ + break; + case SVR4_CONFIG_DCACHELINESZ: + *retval = 64; /* XXX */ + break; + case SVR4_CONFIG_ICACHEBLKSZ: + *retval = 64; /* XXX */ + break; + case SVR4_CONFIG_DCACHEBLKSZ: + *retval = 64; /* XXX */ + break; + case SVR4_CONFIG_DCACHETBLKSZ: + *retval = 64; /* XXX */ + break; + case SVR4_CONFIG_ICACHE_ASSOC: + *retval = 1; /* XXX */ + break; + case SVR4_CONFIG_DCACHE_ASSOC: + *retval = 1; /* XXX */ + break; + case SVR4_CONFIG_MAXPID: + *retval = PID_MAX; + break; + case SVR4_CONFIG_STACK_PROT: + *retval = PROT_READ|PROT_WRITE|PROT_EXEC; + break; default: return EINVAL; } @@ -1664,6 +1705,6 @@ *retval = ncopy; bad: NDFREE(&nd, NDF_ONLY_PNBUF); - vput(nd.ni_vp); + vrele(nd.ni_vp); return error; } diff -ru svr4.orig/svr4_resource.c svr4/svr4_resource.c --- svr4.orig/svr4_resource.c Tue Jan 3 16:41:01 2006 +++ svr4/svr4_resource.c Tue Jan 3 18:27:46 2006 @@ -127,7 +127,7 @@ int svr4_sys_getrlimit(td, uap) - register struct thread *td; + struct thread *td; struct svr4_sys_getrlimit_args *uap; { int rl = svr4_to_native_rl(uap->which); @@ -174,7 +174,7 @@ int svr4_sys_setrlimit(td, uap) - register struct thread *td; + struct thread *td; struct svr4_sys_setrlimit_args *uap; { int rl = svr4_to_native_rl(uap->which); @@ -225,7 +225,7 @@ int svr4_sys_getrlimit64(td, uap) - register struct thread *td; + struct thread *td; struct svr4_sys_getrlimit64_args *uap; { int rl = svr4_to_native_rl(uap->which); @@ -272,7 +272,7 @@ int svr4_sys_setrlimit64(td, uap) - register struct thread *td; + struct thread *td; struct svr4_sys_setrlimit64_args *uap; { int rl = svr4_to_native_rl(uap->which); diff -ru svr4.orig/svr4_signal.c svr4/svr4_signal.c --- svr4.orig/svr4_signal.c Tue Jan 3 16:41:01 2006 +++ svr4/svr4_signal.c Tue Jan 3 21:59:52 2006 @@ -560,7 +560,6 @@ uap->uc)); return ENOSYS; } - return 0; } int diff -ru svr4.orig/svr4_socket.c svr4/svr4_socket.c --- svr4.orig/svr4_socket.c Tue Jan 3 16:41:01 2006 +++ svr4/svr4_socket.c Tue Jan 3 18:44:04 2006 @@ -114,7 +114,8 @@ struct stat *st; { struct svr4_sockcache_entry *e; - int len, error; + size_t len; + int error; mtx_lock(&Giant); diff -ru svr4.orig/svr4_stat.c svr4/svr4_stat.c --- svr4.orig/svr4_stat.c Tue Jan 3 16:41:01 2006 +++ svr4/svr4_stat.c Tue Jan 3 19:33:39 2006 @@ -444,9 +450,21 @@ case SVR4_SI_ARCHITECTURE: str = machine; break; + case SVR4_SI_ISALIST: +#if defined(__sparc__) + str = "sparcv9 sparcv9-fsmuld sparcv8 sparcv8-fsmuld sparcv7 sparc"; +#elif defined(__i386__) + str = "i386"; +#elif defined(__amd64__) + str = "amd64"; +#else + str = "unknown"; + #endif + break; case SVR4_SI_HW_SERIAL: - str = "0"; + snprintf(buf, sizeof(buf), "%lu", hostid); + str = buf; break; case SVR4_SI_HW_PROVIDER: @@ -543,7 +561,6 @@ default: return ENOSYS; } - return ENOSYS; } diff -ru svr4.orig/svr4_sysconfig.h svr4/svr4_sysconfig.h --- svr4.orig/svr4_sysconfig.h Tue Jan 3 16:41:01 2006 +++ svr4/svr4_sysconfig.h Tue Jan 3 22:25:50 2006 @@ -43,20 +43,36 @@ #define SVR4_CONFIG_PROF_TCK 0x0a #define SVR4_CONFIG_NPROC_CONF 0x0b #define SVR4_CONFIG_NPROC_ONLN 0x0c -#define SVR4_CONFIG_AIO_LISTIO_MAX 0x0e -#define SVR4_CONFIG_AIO_MAX 0x0f -#define SVR4_CONFIG_AIO_PRIO_DELTA_MAX 0x10 -#define SVR4_CONFIG_DELAYTIMER_MAX 0x11 -#define SVR4_CONFIG_MQ_OPEN_MAX 0x12 -#define SVR4_CONFIG_MQ_PRIO_MAX 0x13 -#define SVR4_CONFIG_RTSIG_MAX 0x14 -#define SVR4_CONFIG_SEM_NSEMS_MAX 0x15 -#define SVR4_CONFIG_SEM_VALUE_MAX 0x16 -#define SVR4_CONFIG_SIGQUEUE_MAX 0x17 -#define SVR4_CONFIG_SIGRT_MIN 0x18 -#define SVR4_CONFIG_SIGRT_MAX 0x19 -#define SVR4_CONFIG_TIMER_MAX 0x20 -#define SVR4_CONFIG_PHYS_PAGES 0x21 -#define SVR4_CONFIG_AVPHYS_PAGES 0x22 +#define SVR4_CONFIG_AIO_LISTIO_MAX 0x0d +#define SVR4_CONFIG_AIO_MAX 0x0e +#define SVR4_CONFIG_AIO_PRIO_DELTA_MAX 0x0f +#define SVR4_CONFIG_DELAYTIMER_MAX 0x10 +#define SVR4_CONFIG_MQ_OPEN_MAX 0x11 +#define SVR4_CONFIG_MQ_PRIO_MAX 0x12 +#define SVR4_CONFIG_RTSIG_MAX 0x13 +#define SVR4_CONFIG_SEM_NSEMS_MAX 0x14 +#define SVR4_CONFIG_SEM_VALUE_MAX 0x15 +#define SVR4_CONFIG_SIGQUEUE_MAX 0x16 +#define SVR4_CONFIG_SIGRT_MIN 0x17 +#define SVR4_CONFIG_SIGRT_MAX 0x18 +#define SVR4_CONFIG_TIMER_MAX 0x19 +#define SVR4_CONFIG_PHYS_PAGES 0x1a +#define SVR4_CONFIG_AVPHYS_PAGES 0x1b +#define SVR4_CONFIG_COHERENCY 0x1c +#define SVR4_CONFIG_SPLIT_CACHE 0x1d +#define SVR4_CONFIG_ICACHESZ 0x1e +#define SVR4_CONFIG_DCACHESZ 0x1f +#define SVR4_CONFIG_ICACHELINESZ 0x20 +#define SVR4_CONFIG_DCACHELINESZ 0x21 +#define SVR4_CONFIG_ICACHEBLKSZ 0x22 +#define SVR4_CONFIG_DCACHEBLKSZ 0x23 +#define SVR4_CONFIG_DCACHETBLKSZ 0x24 +#define SVR4_CONFIG_ICACHE_ASSOC 0x25 +#define SVR4_CONFIG_DCACHE_ASSOC 0x26 +#define SVR4_CONFIG_UNUSED_2 0x27 +#define SVR4_CONFIG_UNUSED_3 0x28 +#define SVR4_CONFIG_UNUSED_4 0x29 +#define SVR4_CONFIG_MAXPID 0x2a +#define SVR4_CONFIG_STACK_PROT 0x2b #endif /* !_SVR4_SYSCONFIG_H_ */
Responsible Changed From-To: freebsd-emulation->delphij Take (somehow I touch it and I buy it...)
Author: delphij Date: Fri May 29 05:37:27 2009 New Revision: 193012 URL: http://svn.freebsd.org/changeset/base/193012 Log: Add new sysconfig bits, Fix the bogus numbering of the old bits. Submitted by: "Pedro f. Giffuni" <giffunip asme org> Obtained from: NetBSD PR: kern/91293 Modified: head/sys/compat/svr4/svr4_misc.c head/sys/compat/svr4/svr4_sysconfig.h Modified: head/sys/compat/svr4/svr4_misc.c ============================================================================== --- head/sys/compat/svr4/svr4_misc.c Fri May 29 01:49:27 2009 (r193011) +++ head/sys/compat/svr4/svr4_misc.c Fri May 29 05:37:27 2009 (r193012) @@ -706,9 +706,6 @@ svr4_sys_sysconfig(td, uap) retval = &(td->td_retval[0]); switch (uap->name) { - case SVR4_CONFIG_UNUSED: - *retval = 0; - break; case SVR4_CONFIG_NGROUPS: *retval = NGROUPS_MAX; break; @@ -788,7 +785,45 @@ svr4_sys_sysconfig(td, uap) #endif break; #endif /* NOTYET */ - + case SVR4_CONFIG_COHERENCY: + *retval = 0; /* XXX */ + break; + case SVR4_CONFIG_SPLIT_CACHE: + *retval = 0; /* XXX */ + break; + case SVR4_CONFIG_ICACHESZ: + *retval = 256; /* XXX */ + break; + case SVR4_CONFIG_DCACHESZ: + *retval = 256; /* XXX */ + break; + case SVR4_CONFIG_ICACHELINESZ: + *retval = 64; /* XXX */ + break; + case SVR4_CONFIG_DCACHELINESZ: + *retval = 64; /* XXX */ + break; + case SVR4_CONFIG_ICACHEBLKSZ: + *retval = 64; /* XXX */ + break; + case SVR4_CONFIG_DCACHEBLKSZ: + *retval = 64; /* XXX */ + break; + case SVR4_CONFIG_DCACHETBLKSZ: + *retval = 64; /* XXX */ + break; + case SVR4_CONFIG_ICACHE_ASSOC: + *retval = 1; /* XXX */ + break; + case SVR4_CONFIG_DCACHE_ASSOC: + *retval = 1; /* XXX */ + break; + case SVR4_CONFIG_MAXPID: + *retval = PID_MAX; + break; + case SVR4_CONFIG_STACK_PROT: + *retval = PROT_READ|PROT_WRITE|PROT_EXEC; + break; default: return EINVAL; } Modified: head/sys/compat/svr4/svr4_sysconfig.h ============================================================================== --- head/sys/compat/svr4/svr4_sysconfig.h Fri May 29 01:49:27 2009 (r193011) +++ head/sys/compat/svr4/svr4_sysconfig.h Fri May 29 05:37:27 2009 (r193012) @@ -31,7 +31,7 @@ #ifndef _SVR4_SYSCONFIG_H_ #define _SVR4_SYSCONFIG_H_ -#define SVR4_CONFIG_UNUSED 0x01 +#define SVR4_CONFIG_UNUSED_1 0x01 #define SVR4_CONFIG_NGROUPS 0x02 #define SVR4_CONFIG_CHILD_MAX 0x03 #define SVR4_CONFIG_OPEN_FILES 0x04 @@ -43,20 +43,36 @@ #define SVR4_CONFIG_PROF_TCK 0x0a #define SVR4_CONFIG_NPROC_CONF 0x0b #define SVR4_CONFIG_NPROC_ONLN 0x0c -#define SVR4_CONFIG_AIO_LISTIO_MAX 0x0e -#define SVR4_CONFIG_AIO_MAX 0x0f -#define SVR4_CONFIG_AIO_PRIO_DELTA_MAX 0x10 -#define SVR4_CONFIG_DELAYTIMER_MAX 0x11 -#define SVR4_CONFIG_MQ_OPEN_MAX 0x12 -#define SVR4_CONFIG_MQ_PRIO_MAX 0x13 -#define SVR4_CONFIG_RTSIG_MAX 0x14 -#define SVR4_CONFIG_SEM_NSEMS_MAX 0x15 -#define SVR4_CONFIG_SEM_VALUE_MAX 0x16 -#define SVR4_CONFIG_SIGQUEUE_MAX 0x17 -#define SVR4_CONFIG_SIGRT_MIN 0x18 -#define SVR4_CONFIG_SIGRT_MAX 0x19 -#define SVR4_CONFIG_TIMER_MAX 0x20 -#define SVR4_CONFIG_PHYS_PAGES 0x21 -#define SVR4_CONFIG_AVPHYS_PAGES 0x22 +#define SVR4_CONFIG_AIO_LISTIO_MAX 0x0d +#define SVR4_CONFIG_AIO_MAX 0x0e +#define SVR4_CONFIG_AIO_PRIO_DELTA_MAX 0x0f +#define SVR4_CONFIG_DELAYTIMER_MAX 0x10 +#define SVR4_CONFIG_MQ_OPEN_MAX 0x11 +#define SVR4_CONFIG_MQ_PRIO_MAX 0x12 +#define SVR4_CONFIG_RTSIG_MAX 0x13 +#define SVR4_CONFIG_SEM_NSEMS_MAX 0x14 +#define SVR4_CONFIG_SEM_VALUE_MAX 0x15 +#define SVR4_CONFIG_SIGQUEUE_MAX 0x16 +#define SVR4_CONFIG_SIGRT_MIN 0x17 +#define SVR4_CONFIG_SIGRT_MAX 0x18 +#define SVR4_CONFIG_TIMER_MAX 0x19 +#define SVR4_CONFIG_PHYS_PAGES 0x1a +#define SVR4_CONFIG_AVPHYS_PAGES 0x1b +#define SVR4_CONFIG_COHERENCY 0x1c +#define SVR4_CONFIG_SPLIT_CACHE 0x1d +#define SVR4_CONFIG_ICACHESZ 0x1e +#define SVR4_CONFIG_DCACHESZ 0x1f +#define SVR4_CONFIG_ICACHELINESZ 0x20 +#define SVR4_CONFIG_DCACHELINESZ 0x21 +#define SVR4_CONFIG_ICACHEBLKSZ 0x22 +#define SVR4_CONFIG_DCACHEBLKSZ 0x23 +#define SVR4_CONFIG_DCACHETBLKSZ 0x24 +#define SVR4_CONFIG_ICACHE_ASSOC 0x25 +#define SVR4_CONFIG_DCACHE_ASSOC 0x26 +#define SVR4_CONFIG_UNUSED_2 0x27 +#define SVR4_CONFIG_UNUSED_3 0x28 +#define SVR4_CONFIG_UNUSED_4 0x29 +#define SVR4_CONFIG_MAXPID 0x2a +#define SVR4_CONFIG_STACK_PROT 0x2b #endif /* !_SVR4_SYSCONFIG_H_ */ _______________________________________________ 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-unsubscribe@freebsd.org"
Author: delphij Date: Fri May 29 05:51:19 2009 New Revision: 193013 URL: http://svn.freebsd.org/changeset/base/193013 Log: svr4_sys_getdents64() should not assume that the cookie would exist everywhere. PR: kern/91293 Submitted by: "Pedro f. Giffuni" <giffunip asme org> Obtained from: NetBSD Modified: head/sys/compat/svr4/svr4_misc.c Modified: head/sys/compat/svr4/svr4_misc.c ============================================================================== --- head/sys/compat/svr4/svr4_misc.c Fri May 29 05:37:27 2009 (r193012) +++ head/sys/compat/svr4/svr4_misc.c Fri May 29 05:51:19 2009 (r193013) @@ -487,7 +487,10 @@ again: reclen = bdp->d_reclen; if (reclen & 3) panic("svr4_sys_getdents64: bad reclen"); - off = *cookie++; /* each entry points to the next */ + if (cookie) + off = *cookie++; /* each entry points to the next */ + else + off += reclen; if ((off >> 32) != 0) { uprintf("svr4_sys_getdents64: dir offset too large for emulated program"); error = EINVAL; _______________________________________________ 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-unsubscribe@freebsd.org"
Author: delphij Date: Fri May 29 05:58:46 2009 New Revision: 193014 URL: http://svn.freebsd.org/changeset/base/193014 Log: de-register. Submitted by: "Pedro f. Giffuni" <giffunip asme org> Obtained from: NetBSD PR: kern/91293 Modified: head/sys/compat/svr4/svr4_fcntl.c head/sys/compat/svr4/svr4_ioctl.c head/sys/compat/svr4/svr4_misc.c head/sys/compat/svr4/svr4_resource.c head/sys/compat/svr4/svr4_signal.c head/sys/compat/svr4/svr4_stat.c head/sys/compat/svr4/svr4_stream.c Modified: head/sys/compat/svr4/svr4_fcntl.c ============================================================================== --- head/sys/compat/svr4/svr4_fcntl.c Fri May 29 05:51:19 2009 (r193013) +++ head/sys/compat/svr4/svr4_fcntl.c Fri May 29 05:58:46 2009 (r193014) @@ -367,7 +367,7 @@ fd_truncate(td, fd, flp) int svr4_sys_open(td, uap) - register struct thread *td; + struct thread *td; struct svr4_sys_open_args *uap; { struct proc *p = td->td_proc; @@ -419,7 +419,7 @@ svr4_sys_open(td, uap) int svr4_sys_open64(td, uap) - register struct thread *td; + struct thread *td; struct svr4_sys_open64_args *uap; { return svr4_sys_open(td, (struct svr4_sys_open_args *)uap); @@ -427,7 +427,7 @@ svr4_sys_open64(td, uap) int svr4_sys_creat(td, uap) - register struct thread *td; + struct thread *td; struct svr4_sys_creat_args *uap; { char *newpath; @@ -443,7 +443,7 @@ svr4_sys_creat(td, uap) int svr4_sys_creat64(td, uap) - register struct thread *td; + struct thread *td; struct svr4_sys_creat64_args *uap; { return svr4_sys_creat(td, (struct svr4_sys_creat_args *)uap); @@ -451,7 +451,7 @@ svr4_sys_creat64(td, uap) int svr4_sys_llseek(td, uap) - register struct thread *td; + struct thread *td; struct svr4_sys_llseek_args *uap; { struct lseek_args ap; @@ -472,7 +472,7 @@ svr4_sys_llseek(td, uap) int svr4_sys_access(td, uap) - register struct thread *td; + struct thread *td; struct svr4_sys_access_args *uap; { char *newpath; @@ -487,7 +487,7 @@ svr4_sys_access(td, uap) #if defined(NOTYET) int svr4_sys_pread(td, uap) - register struct thread *td; + struct thread *td; struct svr4_sys_pread_args *uap; { struct pread_args pra; @@ -508,7 +508,7 @@ svr4_sys_pread(td, uap) #if defined(NOTYET) int svr4_sys_pread64(td, v, retval) - register struct thread *td; + struct thread *td; void *v; register_t *retval; { @@ -532,7 +532,7 @@ svr4_sys_pread64(td, v, retval) #if defined(NOTYET) int svr4_sys_pwrite(td, uap) - register struct thread *td; + struct thread *td; struct svr4_sys_pwrite_args *uap; { struct pwrite_args pwa; @@ -553,7 +553,7 @@ svr4_sys_pwrite(td, uap) #if defined(NOTYET) int svr4_sys_pwrite64(td, v, retval) - register struct thread *td; + struct thread *td; void *v; register_t *retval; { @@ -575,7 +575,7 @@ svr4_sys_pwrite64(td, v, retval) int svr4_sys_fcntl(td, uap) - register struct thread *td; + struct thread *td; struct svr4_sys_fcntl_args *uap; { int cmd, error, *retval; Modified: head/sys/compat/svr4/svr4_ioctl.c ============================================================================== --- head/sys/compat/svr4/svr4_ioctl.c Fri May 29 05:51:19 2009 (r193013) +++ head/sys/compat/svr4/svr4_ioctl.c Fri May 29 05:58:46 2009 (r193014) @@ -79,7 +79,7 @@ svr4_decode_cmd(cmd, dir, c, num, argsiz int svr4_sys_ioctl(td, uap) - register struct thread *td; + struct thread *td; struct svr4_sys_ioctl_args *uap; { int *retval; Modified: head/sys/compat/svr4/svr4_misc.c ============================================================================== --- head/sys/compat/svr4/svr4_misc.c Fri May 29 05:51:19 2009 (r193013) +++ head/sys/compat/svr4/svr4_misc.c Fri May 29 05:58:46 2009 (r193014) @@ -121,7 +121,7 @@ static struct proc *svr4_pfind(pid_t pid #if defined(BOGUS) int svr4_sys_setitimer(td, uap) - register struct thread *td; + struct thread *td; struct svr4_sys_setitimer_args *uap; { td->td_retval[0] = 0; @@ -231,7 +231,7 @@ svr4_sys_getdents64(td, uap) struct thread *td; struct svr4_sys_getdents64_args *uap; { - register struct dirent *bdp; + struct dirent *bdp; struct vnode *vp; caddr_t inp, buf; /* BSD-format */ int len, reclen; /* BSD-format */ @@ -668,7 +668,7 @@ svr4_mknod(td, retval, path, mode, dev) int svr4_sys_mknod(td, uap) - register struct thread *td; + struct thread *td; struct svr4_sys_mknod_args *uap; { int *retval = td->td_retval; Modified: head/sys/compat/svr4/svr4_resource.c ============================================================================== --- head/sys/compat/svr4/svr4_resource.c Fri May 29 05:51:19 2009 (r193013) +++ head/sys/compat/svr4/svr4_resource.c Fri May 29 05:58:46 2009 (r193014) @@ -127,7 +127,7 @@ svr4_to_native_rl(rl) int svr4_sys_getrlimit(td, uap) - register struct thread *td; + struct thread *td; struct svr4_sys_getrlimit_args *uap; { int rl = svr4_to_native_rl(uap->which); @@ -174,7 +174,7 @@ svr4_sys_getrlimit(td, uap) int svr4_sys_setrlimit(td, uap) - register struct thread *td; + struct thread *td; struct svr4_sys_setrlimit_args *uap; { int rl = svr4_to_native_rl(uap->which); @@ -225,7 +225,7 @@ svr4_sys_setrlimit(td, uap) int svr4_sys_getrlimit64(td, uap) - register struct thread *td; + struct thread *td; struct svr4_sys_getrlimit64_args *uap; { int rl = svr4_to_native_rl(uap->which); @@ -272,7 +272,7 @@ svr4_sys_getrlimit64(td, uap) int svr4_sys_setrlimit64(td, uap) - register struct thread *td; + struct thread *td; struct svr4_sys_setrlimit64_args *uap; { int rl = svr4_to_native_rl(uap->which); Modified: head/sys/compat/svr4/svr4_signal.c ============================================================================== --- head/sys/compat/svr4/svr4_signal.c Fri May 29 05:51:19 2009 (r193013) +++ head/sys/compat/svr4/svr4_signal.c Fri May 29 05:58:46 2009 (r193014) @@ -259,7 +259,7 @@ bsd_to_svr4_sigaltstack(bss, sss) int svr4_sys_sigaction(td, uap) - register struct thread *td; + struct thread *td; struct svr4_sys_sigaction_args *uap; { struct svr4_sigaction isa; @@ -301,7 +301,7 @@ svr4_sys_sigaction(td, uap) int svr4_sys_sigaltstack(td, uap) - register struct thread *td; + struct thread *td; struct svr4_sys_sigaltstack_args *uap; { struct svr4_sigaltstack sss; @@ -328,7 +328,7 @@ svr4_sys_sigaltstack(td, uap) */ int svr4_sys_signal(td, uap) - register struct thread *td; + struct thread *td; struct svr4_sys_signal_args *uap; { struct proc *p; @@ -493,7 +493,7 @@ svr4_sys_sigpending(td, uap) int svr4_sys_sigsuspend(td, uap) - register struct thread *td; + struct thread *td; struct svr4_sys_sigsuspend_args *uap; { svr4_sigset_t sss; @@ -510,7 +510,7 @@ svr4_sys_sigsuspend(td, uap) int svr4_sys_kill(td, uap) - register struct thread *td; + struct thread *td; struct svr4_sys_kill_args *uap; { struct kill_args ka; @@ -525,7 +525,7 @@ svr4_sys_kill(td, uap) int svr4_sys_context(td, uap) - register struct thread *td; + struct thread *td; struct svr4_sys_context_args *uap; { struct svr4_ucontext uc; @@ -565,7 +565,7 @@ svr4_sys_context(td, uap) int svr4_sys_pause(td, uap) - register struct thread *td; + struct thread *td; struct svr4_sys_pause_args *uap; { sigset_t mask; Modified: head/sys/compat/svr4/svr4_stat.c ============================================================================== --- head/sys/compat/svr4/svr4_stat.c Fri May 29 05:51:19 2009 (r193013) +++ head/sys/compat/svr4/svr4_stat.c Fri May 29 05:58:46 2009 (r193014) @@ -185,7 +185,7 @@ svr4_sys_stat(td, uap) int svr4_sys_lstat(td, uap) - register struct thread *td; + struct thread *td; struct svr4_sys_lstat_args *uap; { struct svr4_stat svr4_st; @@ -210,7 +210,7 @@ svr4_sys_lstat(td, uap) int svr4_sys_fstat(td, uap) - register struct thread *td; + struct thread *td; struct svr4_sys_fstat_args *uap; { struct svr4_stat svr4_st; @@ -228,7 +228,7 @@ svr4_sys_fstat(td, uap) int svr4_sys_xstat(td, uap) - register struct thread *td; + struct thread *td; struct svr4_sys_xstat_args *uap; { struct svr4_xstat svr4_st; @@ -255,7 +255,7 @@ svr4_sys_xstat(td, uap) int svr4_sys_lxstat(td, uap) - register struct thread *td; + struct thread *td; struct svr4_sys_lxstat_args *uap; { struct svr4_xstat svr4_st; @@ -282,7 +282,7 @@ svr4_sys_lxstat(td, uap) int svr4_sys_fxstat(td, uap) - register struct thread *td; + struct thread *td; struct svr4_sys_fxstat_args *uap; { struct svr4_xstat svr4_st; @@ -299,7 +299,7 @@ svr4_sys_fxstat(td, uap) int svr4_sys_stat64(td, uap) - register struct thread *td; + struct thread *td; struct svr4_sys_stat64_args *uap; { struct svr4_stat64 svr4_st; @@ -325,7 +325,7 @@ svr4_sys_stat64(td, uap) int svr4_sys_lstat64(td, uap) - register struct thread *td; + struct thread *td; struct svr4_sys_lstat64_args *uap; { struct svr4_stat64 svr4_st; @@ -351,7 +351,7 @@ svr4_sys_lstat64(td, uap) int svr4_sys_fstat64(td, uap) - register struct thread *td; + struct thread *td; struct svr4_sys_fstat64_args *uap; { struct svr4_stat64 svr4_st; @@ -368,7 +368,7 @@ svr4_sys_fstat64(td, uap) int svr4_ustat(td, uap) - register struct thread *td; + struct thread *td; struct svr4_ustat_args *uap; { struct svr4_ustat us; @@ -390,7 +390,7 @@ svr4_ustat(td, uap) int svr4_sys_uname(td, uap) - register struct thread *td; + struct thread *td; struct svr4_sys_uname_args *uap; { struct svr4_utsname sut; @@ -517,7 +517,7 @@ svr4_sys_systeminfo(td, uap) int svr4_sys_utssys(td, uap) - register struct thread *td; + struct thread *td; struct svr4_sys_utssys_args *uap; { switch (uap->sel) { @@ -548,7 +548,7 @@ svr4_sys_utssys(td, uap) int svr4_sys_utime(td, uap) - register struct thread *td; + struct thread *td; struct svr4_sys_utime_args *uap; { struct svr4_utimbuf ub; @@ -577,7 +577,7 @@ svr4_sys_utime(td, uap) int svr4_sys_utimes(td, uap) - register struct thread *td; + struct thread *td; struct svr4_sys_utimes_args *uap; { char *path; @@ -640,7 +640,7 @@ svr4_to_bsd_pathconf(name) int svr4_sys_pathconf(td, uap) - register struct thread *td; + struct thread *td; struct svr4_sys_pathconf_args *uap; { char *path; @@ -666,7 +666,7 @@ svr4_sys_pathconf(td, uap) int svr4_sys_fpathconf(td, uap) - register struct thread *td; + struct thread *td; struct svr4_sys_fpathconf_args *uap; { register_t *retval = td->td_retval; Modified: head/sys/compat/svr4/svr4_stream.c ============================================================================== --- head/sys/compat/svr4/svr4_stream.c Fri May 29 05:51:19 2009 (r193013) +++ head/sys/compat/svr4/svr4_stream.c Fri May 29 05:58:46 2009 (r193014) @@ -1442,7 +1442,7 @@ svr4_stream_ioctl(fp, td, retval, fd, cm int svr4_sys_putmsg(td, uap) - register struct thread *td; + struct thread *td; struct svr4_sys_putmsg_args *uap; { struct file *fp; @@ -1633,7 +1633,7 @@ svr4_sys_getmsg(td, uap) int svr4_do_getmsg(td, uap, fp) - register struct thread *td; + struct thread *td; struct svr4_sys_getmsg_args *uap; struct file *fp; { _______________________________________________ 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-unsubscribe@freebsd.org"
Author: delphij Date: Fri May 29 06:04:26 2009 New Revision: 193015 URL: http://svn.freebsd.org/changeset/base/193015 Log: copyinstr(9) takes parameter 'len' as a size_t *, not int *. PR: kern/91293 Submitted by: "Pedro f. Giffuni" <giffunip asme org> Obtained from: NetBSD Modified: head/sys/compat/svr4/svr4_socket.c Modified: head/sys/compat/svr4/svr4_socket.c ============================================================================== --- head/sys/compat/svr4/svr4_socket.c Fri May 29 05:58:46 2009 (r193014) +++ head/sys/compat/svr4/svr4_socket.c Fri May 29 06:04:26 2009 (r193015) @@ -120,7 +120,8 @@ svr4_add_socket(td, path, st) struct stat *st; { struct svr4_sockcache_entry *e; - int len, error; + size_t len; + int error; e = malloc(sizeof(*e), M_TEMP, M_WAITOK); e->cookie = NULL; _______________________________________________ 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-unsubscribe@freebsd.org"
Author: delphij Date: Fri May 29 06:19:37 2009 New Revision: 193016 URL: http://svn.freebsd.org/changeset/base/193016 Log: Fix the sysinfo(SI_HW_SERIAL, emulation so that we actually get the hostid of the machine rather than always getting "0". PR: kern/91293 Submitted by: "Pedro f. Giffuni" <giffunip asme org> Obtained from: NetBSD Modified: head/sys/compat/svr4/svr4_stat.c Modified: head/sys/compat/svr4/svr4_stat.c ============================================================================== --- head/sys/compat/svr4/svr4_stat.c Fri May 29 06:04:26 2009 (r193015) +++ head/sys/compat/svr4/svr4_stat.c Fri May 29 06:19:37 2009 (r193016) @@ -417,9 +417,10 @@ svr4_sys_systeminfo(td, uap) int error = 0; register_t *retval = td->td_retval; size_t len = 0; - char buf[1]; /* XXX NetBSD uses 256, but that seems - like awfully excessive kstack usage - for an empty string... */ + char buf[11]; /* XXX NetBSD uses 256, but we use 11 + here as that seems like awfully + excessive kstack usage for hostid + string... */ u_int rlen = uap->len; switch (uap->what) { @@ -448,7 +449,8 @@ svr4_sys_systeminfo(td, uap) break; case SVR4_SI_HW_SERIAL: - str = "0"; + snprintf(buf, sizeof(buf), "%lu", hostid); + str = buf; break; case SVR4_SI_HW_PROVIDER: _______________________________________________ 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-unsubscribe@freebsd.org"
Author: delphij Date: Fri May 29 06:27:30 2009 New Revision: 193017 URL: http://svn.freebsd.org/changeset/base/193017 Log: Implement SI_ISALIST. PR: kern/91293 Submitted by: "Pedro f. Giffuni" <giffunip asme org> Obtained from: NetBSD Modified: head/sys/compat/svr4/svr4_stat.c Modified: head/sys/compat/svr4/svr4_stat.c ============================================================================== --- head/sys/compat/svr4/svr4_stat.c Fri May 29 06:19:37 2009 (r193016) +++ head/sys/compat/svr4/svr4_stat.c Fri May 29 06:27:30 2009 (r193017) @@ -448,6 +448,18 @@ svr4_sys_systeminfo(td, uap) str = machine; break; + case SVR4_SI_ISALIST: +#if defined(__sparc__) + str = "sparcv9 sparcv9-fsmuld sparcv8 sparcv8-fsmuld sparcv7 sparc"; +#elif defined(__i386__) + str = "i386"; +#elif defined(__amd64__) + str = "amd64"; +#else + str = "unknown"; +#endif + break; + case SVR4_SI_HW_SERIAL: snprintf(buf, sizeof(buf), "%lu", hostid); str = buf; @@ -463,7 +475,7 @@ svr4_sys_systeminfo(td, uap) break; case SVR4_SI_PLATFORM: -#ifdef __i386__ +#if defined(__i386__) str = "i86pc"; #else str = "unknown"; _______________________________________________ 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-unsubscribe@freebsd.org"
State Changed From-To: open->patched I have applied most of applicable changes from this PR manually by cross-referencing NetBSD code and verified with some other publicly available sources, so mark this as PATCHED. Note that the actual patch committed is different from this PR, some because of bugs (SVR4_SI_HW_SERIAL wants a bigger buf, for instance). I have also intentionally excluded the removal of unreachable return's for now, as they need more careful inspection and perhaps better code organization. Thanks for your submission!
Author: delphij Date: Sun Jan 3 03:23:17 2010 New Revision: 201413 URL: http://svn.freebsd.org/changeset/base/201413 Log: MFC r193012: Add new sysconfig bits, Fix the bogus numbering of the old bits. Submitted by: "Pedro f. Giffuni" <giffunip asme org> Obtained from: NetBSD PR: kern/91293 Modified: stable/7/sys/compat/svr4/svr4_misc.c stable/7/sys/compat/svr4/svr4_sysconfig.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/compat/svr4/svr4_misc.c ============================================================================== --- stable/7/sys/compat/svr4/svr4_misc.c Sun Jan 3 03:10:28 2010 (r201412) +++ stable/7/sys/compat/svr4/svr4_misc.c Sun Jan 3 03:23:17 2010 (r201413) @@ -706,9 +706,6 @@ svr4_sys_sysconfig(td, uap) retval = &(td->td_retval[0]); switch (uap->name) { - case SVR4_CONFIG_UNUSED: - *retval = 0; - break; case SVR4_CONFIG_NGROUPS: *retval = NGROUPS_MAX; break; @@ -788,7 +785,45 @@ svr4_sys_sysconfig(td, uap) #endif break; #endif /* NOTYET */ - + case SVR4_CONFIG_COHERENCY: + *retval = 0; /* XXX */ + break; + case SVR4_CONFIG_SPLIT_CACHE: + *retval = 0; /* XXX */ + break; + case SVR4_CONFIG_ICACHESZ: + *retval = 256; /* XXX */ + break; + case SVR4_CONFIG_DCACHESZ: + *retval = 256; /* XXX */ + break; + case SVR4_CONFIG_ICACHELINESZ: + *retval = 64; /* XXX */ + break; + case SVR4_CONFIG_DCACHELINESZ: + *retval = 64; /* XXX */ + break; + case SVR4_CONFIG_ICACHEBLKSZ: + *retval = 64; /* XXX */ + break; + case SVR4_CONFIG_DCACHEBLKSZ: + *retval = 64; /* XXX */ + break; + case SVR4_CONFIG_DCACHETBLKSZ: + *retval = 64; /* XXX */ + break; + case SVR4_CONFIG_ICACHE_ASSOC: + *retval = 1; /* XXX */ + break; + case SVR4_CONFIG_DCACHE_ASSOC: + *retval = 1; /* XXX */ + break; + case SVR4_CONFIG_MAXPID: + *retval = PID_MAX; + break; + case SVR4_CONFIG_STACK_PROT: + *retval = PROT_READ|PROT_WRITE|PROT_EXEC; + break; default: return EINVAL; } Modified: stable/7/sys/compat/svr4/svr4_sysconfig.h ============================================================================== --- stable/7/sys/compat/svr4/svr4_sysconfig.h Sun Jan 3 03:10:28 2010 (r201412) +++ stable/7/sys/compat/svr4/svr4_sysconfig.h Sun Jan 3 03:23:17 2010 (r201413) @@ -31,7 +31,7 @@ #ifndef _SVR4_SYSCONFIG_H_ #define _SVR4_SYSCONFIG_H_ -#define SVR4_CONFIG_UNUSED 0x01 +#define SVR4_CONFIG_UNUSED_1 0x01 #define SVR4_CONFIG_NGROUPS 0x02 #define SVR4_CONFIG_CHILD_MAX 0x03 #define SVR4_CONFIG_OPEN_FILES 0x04 @@ -43,20 +43,36 @@ #define SVR4_CONFIG_PROF_TCK 0x0a #define SVR4_CONFIG_NPROC_CONF 0x0b #define SVR4_CONFIG_NPROC_ONLN 0x0c -#define SVR4_CONFIG_AIO_LISTIO_MAX 0x0e -#define SVR4_CONFIG_AIO_MAX 0x0f -#define SVR4_CONFIG_AIO_PRIO_DELTA_MAX 0x10 -#define SVR4_CONFIG_DELAYTIMER_MAX 0x11 -#define SVR4_CONFIG_MQ_OPEN_MAX 0x12 -#define SVR4_CONFIG_MQ_PRIO_MAX 0x13 -#define SVR4_CONFIG_RTSIG_MAX 0x14 -#define SVR4_CONFIG_SEM_NSEMS_MAX 0x15 -#define SVR4_CONFIG_SEM_VALUE_MAX 0x16 -#define SVR4_CONFIG_SIGQUEUE_MAX 0x17 -#define SVR4_CONFIG_SIGRT_MIN 0x18 -#define SVR4_CONFIG_SIGRT_MAX 0x19 -#define SVR4_CONFIG_TIMER_MAX 0x20 -#define SVR4_CONFIG_PHYS_PAGES 0x21 -#define SVR4_CONFIG_AVPHYS_PAGES 0x22 +#define SVR4_CONFIG_AIO_LISTIO_MAX 0x0d +#define SVR4_CONFIG_AIO_MAX 0x0e +#define SVR4_CONFIG_AIO_PRIO_DELTA_MAX 0x0f +#define SVR4_CONFIG_DELAYTIMER_MAX 0x10 +#define SVR4_CONFIG_MQ_OPEN_MAX 0x11 +#define SVR4_CONFIG_MQ_PRIO_MAX 0x12 +#define SVR4_CONFIG_RTSIG_MAX 0x13 +#define SVR4_CONFIG_SEM_NSEMS_MAX 0x14 +#define SVR4_CONFIG_SEM_VALUE_MAX 0x15 +#define SVR4_CONFIG_SIGQUEUE_MAX 0x16 +#define SVR4_CONFIG_SIGRT_MIN 0x17 +#define SVR4_CONFIG_SIGRT_MAX 0x18 +#define SVR4_CONFIG_TIMER_MAX 0x19 +#define SVR4_CONFIG_PHYS_PAGES 0x1a +#define SVR4_CONFIG_AVPHYS_PAGES 0x1b +#define SVR4_CONFIG_COHERENCY 0x1c +#define SVR4_CONFIG_SPLIT_CACHE 0x1d +#define SVR4_CONFIG_ICACHESZ 0x1e +#define SVR4_CONFIG_DCACHESZ 0x1f +#define SVR4_CONFIG_ICACHELINESZ 0x20 +#define SVR4_CONFIG_DCACHELINESZ 0x21 +#define SVR4_CONFIG_ICACHEBLKSZ 0x22 +#define SVR4_CONFIG_DCACHEBLKSZ 0x23 +#define SVR4_CONFIG_DCACHETBLKSZ 0x24 +#define SVR4_CONFIG_ICACHE_ASSOC 0x25 +#define SVR4_CONFIG_DCACHE_ASSOC 0x26 +#define SVR4_CONFIG_UNUSED_2 0x27 +#define SVR4_CONFIG_UNUSED_3 0x28 +#define SVR4_CONFIG_UNUSED_4 0x29 +#define SVR4_CONFIG_MAXPID 0x2a +#define SVR4_CONFIG_STACK_PROT 0x2b #endif /* !_SVR4_SYSCONFIG_H_ */ _______________________________________________ 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-unsubscribe@freebsd.org"
Author: delphij Date: Sun Jan 3 03:35:23 2010 New Revision: 201414 URL: http://svn.freebsd.org/changeset/base/201414 Log: MFC r193012: Add new sysconfig bits, Fix the bogus numbering of the old bits. Submitted by: "Pedro f. Giffuni" <giffunip asme org> Obtained from: NetBSD PR: kern/91293 Modified: stable/6/sys/compat/svr4/svr4_misc.c stable/6/sys/compat/svr4/svr4_sysconfig.h Directory Properties: stable/6/sys/ (props changed) stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) Modified: stable/6/sys/compat/svr4/svr4_misc.c ============================================================================== --- stable/6/sys/compat/svr4/svr4_misc.c Sun Jan 3 03:23:17 2010 (r201413) +++ stable/6/sys/compat/svr4/svr4_misc.c Sun Jan 3 03:35:23 2010 (r201414) @@ -699,9 +699,6 @@ svr4_sys_sysconfig(td, uap) retval = &(td->td_retval[0]); switch (uap->name) { - case SVR4_CONFIG_UNUSED: - *retval = 0; - break; case SVR4_CONFIG_NGROUPS: *retval = NGROUPS_MAX; break; @@ -781,7 +778,45 @@ svr4_sys_sysconfig(td, uap) #endif break; #endif /* NOTYET */ - + case SVR4_CONFIG_COHERENCY: + *retval = 0; /* XXX */ + break; + case SVR4_CONFIG_SPLIT_CACHE: + *retval = 0; /* XXX */ + break; + case SVR4_CONFIG_ICACHESZ: + *retval = 256; /* XXX */ + break; + case SVR4_CONFIG_DCACHESZ: + *retval = 256; /* XXX */ + break; + case SVR4_CONFIG_ICACHELINESZ: + *retval = 64; /* XXX */ + break; + case SVR4_CONFIG_DCACHELINESZ: + *retval = 64; /* XXX */ + break; + case SVR4_CONFIG_ICACHEBLKSZ: + *retval = 64; /* XXX */ + break; + case SVR4_CONFIG_DCACHEBLKSZ: + *retval = 64; /* XXX */ + break; + case SVR4_CONFIG_DCACHETBLKSZ: + *retval = 64; /* XXX */ + break; + case SVR4_CONFIG_ICACHE_ASSOC: + *retval = 1; /* XXX */ + break; + case SVR4_CONFIG_DCACHE_ASSOC: + *retval = 1; /* XXX */ + break; + case SVR4_CONFIG_MAXPID: + *retval = PID_MAX; + break; + case SVR4_CONFIG_STACK_PROT: + *retval = PROT_READ|PROT_WRITE|PROT_EXEC; + break; default: return EINVAL; } Modified: stable/6/sys/compat/svr4/svr4_sysconfig.h ============================================================================== --- stable/6/sys/compat/svr4/svr4_sysconfig.h Sun Jan 3 03:23:17 2010 (r201413) +++ stable/6/sys/compat/svr4/svr4_sysconfig.h Sun Jan 3 03:35:23 2010 (r201414) @@ -31,7 +31,7 @@ #ifndef _SVR4_SYSCONFIG_H_ #define _SVR4_SYSCONFIG_H_ -#define SVR4_CONFIG_UNUSED 0x01 +#define SVR4_CONFIG_UNUSED_1 0x01 #define SVR4_CONFIG_NGROUPS 0x02 #define SVR4_CONFIG_CHILD_MAX 0x03 #define SVR4_CONFIG_OPEN_FILES 0x04 @@ -43,20 +43,36 @@ #define SVR4_CONFIG_PROF_TCK 0x0a #define SVR4_CONFIG_NPROC_CONF 0x0b #define SVR4_CONFIG_NPROC_ONLN 0x0c -#define SVR4_CONFIG_AIO_LISTIO_MAX 0x0e -#define SVR4_CONFIG_AIO_MAX 0x0f -#define SVR4_CONFIG_AIO_PRIO_DELTA_MAX 0x10 -#define SVR4_CONFIG_DELAYTIMER_MAX 0x11 -#define SVR4_CONFIG_MQ_OPEN_MAX 0x12 -#define SVR4_CONFIG_MQ_PRIO_MAX 0x13 -#define SVR4_CONFIG_RTSIG_MAX 0x14 -#define SVR4_CONFIG_SEM_NSEMS_MAX 0x15 -#define SVR4_CONFIG_SEM_VALUE_MAX 0x16 -#define SVR4_CONFIG_SIGQUEUE_MAX 0x17 -#define SVR4_CONFIG_SIGRT_MIN 0x18 -#define SVR4_CONFIG_SIGRT_MAX 0x19 -#define SVR4_CONFIG_TIMER_MAX 0x20 -#define SVR4_CONFIG_PHYS_PAGES 0x21 -#define SVR4_CONFIG_AVPHYS_PAGES 0x22 +#define SVR4_CONFIG_AIO_LISTIO_MAX 0x0d +#define SVR4_CONFIG_AIO_MAX 0x0e +#define SVR4_CONFIG_AIO_PRIO_DELTA_MAX 0x0f +#define SVR4_CONFIG_DELAYTIMER_MAX 0x10 +#define SVR4_CONFIG_MQ_OPEN_MAX 0x11 +#define SVR4_CONFIG_MQ_PRIO_MAX 0x12 +#define SVR4_CONFIG_RTSIG_MAX 0x13 +#define SVR4_CONFIG_SEM_NSEMS_MAX 0x14 +#define SVR4_CONFIG_SEM_VALUE_MAX 0x15 +#define SVR4_CONFIG_SIGQUEUE_MAX 0x16 +#define SVR4_CONFIG_SIGRT_MIN 0x17 +#define SVR4_CONFIG_SIGRT_MAX 0x18 +#define SVR4_CONFIG_TIMER_MAX 0x19 +#define SVR4_CONFIG_PHYS_PAGES 0x1a +#define SVR4_CONFIG_AVPHYS_PAGES 0x1b +#define SVR4_CONFIG_COHERENCY 0x1c +#define SVR4_CONFIG_SPLIT_CACHE 0x1d +#define SVR4_CONFIG_ICACHESZ 0x1e +#define SVR4_CONFIG_DCACHESZ 0x1f +#define SVR4_CONFIG_ICACHELINESZ 0x20 +#define SVR4_CONFIG_DCACHELINESZ 0x21 +#define SVR4_CONFIG_ICACHEBLKSZ 0x22 +#define SVR4_CONFIG_DCACHEBLKSZ 0x23 +#define SVR4_CONFIG_DCACHETBLKSZ 0x24 +#define SVR4_CONFIG_ICACHE_ASSOC 0x25 +#define SVR4_CONFIG_DCACHE_ASSOC 0x26 +#define SVR4_CONFIG_UNUSED_2 0x27 +#define SVR4_CONFIG_UNUSED_3 0x28 +#define SVR4_CONFIG_UNUSED_4 0x29 +#define SVR4_CONFIG_MAXPID 0x2a +#define SVR4_CONFIG_STACK_PROT 0x2b #endif /* !_SVR4_SYSCONFIG_H_ */ _______________________________________________ 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-unsubscribe@freebsd.org"
State Changed From-To: patched->closed Patch applied to 6-STABLE and 7-STABLE, thanks for your submission!