PERFORCE change 130391 for review
Kip Macy
kmacy at FreeBSD.org
Thu Dec 6 21:28:38 PST 2007
http://perforce.freebsd.org/chv.cgi?CH=130391
Change 130391 by kmacy at entropy_kmacy_xen31 on 2007/12/07 05:27:38
IFC 130385
Affected files ...
.. //depot/projects/xen31/lib/libkse/thread/thr_kern.c#4 integrate
.. //depot/projects/xen31/release/fixit.profile#2 integrate
.. //depot/projects/xen31/share/man/man4/aac.4#3 integrate
.. //depot/projects/xen31/sys/arm/arm/pmap.c#5 integrate
.. //depot/projects/xen31/sys/compat/freebsd32/freebsd32.h#2 integrate
.. //depot/projects/xen31/sys/compat/freebsd32/freebsd32_ipc.h#1 branch
.. //depot/projects/xen31/sys/compat/freebsd32/freebsd32_misc.c#3 integrate
.. //depot/projects/xen31/sys/compat/freebsd32/freebsd32_proto.h#2 integrate
.. //depot/projects/xen31/sys/compat/freebsd32/freebsd32_syscall.h#2 integrate
.. //depot/projects/xen31/sys/compat/freebsd32/freebsd32_syscalls.c#2 integrate
.. //depot/projects/xen31/sys/compat/freebsd32/freebsd32_sysent.c#2 integrate
.. //depot/projects/xen31/sys/compat/freebsd32/syscalls.master#2 integrate
.. //depot/projects/xen31/sys/dev/aac/aac.c#3 integrate
.. //depot/projects/xen31/sys/dev/aac/aac_pci.c#3 integrate
.. //depot/projects/xen31/sys/dev/aac/aacvar.h#2 integrate
.. //depot/projects/xen31/sys/fs/tmpfs/tmpfs_subr.c#3 integrate
.. //depot/projects/xen31/sys/fs/tmpfs/tmpfs_vfsops.c#4 integrate
.. //depot/projects/xen31/sys/geom/geom_bsd.c#2 integrate
.. //depot/projects/xen31/sys/kern/kern_module.c#2 integrate
.. //depot/projects/xen31/sys/net/if_var.h#2 integrate
.. //depot/projects/xen31/sys/net/route.c#3 integrate
.. //depot/projects/xen31/sys/net80211/ieee80211.c#3 integrate
.. //depot/projects/xen31/sys/net80211/ieee80211_output.c#4 integrate
.. //depot/projects/xen31/sys/netinet/in_pcb.h#2 integrate
.. //depot/projects/xen31/sys/netinet/libalias/alias_util.c#3 integrate
.. //depot/projects/xen31/sys/netinet/sctp_output.c#5 integrate
.. //depot/projects/xen31/sys/netinet/sctp_usrreq.c#4 integrate
.. //depot/projects/xen31/sys/netinet/sctputil.c#5 integrate
.. //depot/projects/xen31/sys/netinet/tcp_syncache.c#7 integrate
.. //depot/projects/xen31/sys/netinet/tcp_var.h#2 integrate
.. //depot/projects/xen31/sys/netinet6/in6.c#2 integrate
.. //depot/projects/xen31/sys/sys/param.h#8 integrate
.. //depot/projects/xen31/sys/sys/ucred.h#2 integrate
.. //depot/projects/xen31/usr.bin/kdump/kdump.c#2 integrate
Differences ...
==== //depot/projects/xen31/lib/libkse/thread/thr_kern.c#4 (text+ko) ====
@@ -33,7 +33,7 @@
*
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libkse/thread/thr_kern.c,v 1.127 2007/11/30 17:16:14 deischen Exp $");
+__FBSDID("$FreeBSD: src/lib/libkse/thread/thr_kern.c,v 1.128 2007/12/06 06:04:01 deischen Exp $");
#include <sys/types.h>
#include <sys/kse.h>
@@ -361,6 +361,19 @@
curthread->kse->k_kcb->kcb_kmbx.km_curthread = NULL;
curthread->attr.flags |= PTHREAD_SCOPE_SYSTEM;
+ /*
+ * After a fork, it is possible that an upcall occurs in
+ * the parent KSE that fork()'d before the child process
+ * is fully created and before its vm space is copied.
+ * During the upcall, the tcb is set to null or to another
+ * thread, and this is what gets copied in the child process
+ * when the vm space is cloned sometime after the upcall
+ * occurs. Note that we shouldn't have to set the kcb, but
+ * we do it for completeness.
+ */
+ _kcb_set(curthread->kse->k_kcb);
+ _tcb_set(curthread->kse->k_kcb, curthread->tcb);
+
/* After a fork(), there child should have no pending signals. */
sigemptyset(&curthread->sigpend);
==== //depot/projects/xen31/release/fixit.profile#2 (text+ko) ====
@@ -1,5 +1,5 @@
:
-# $FreeBSD: src/release/fixit.profile,v 1.10 2004/09/02 13:40:34 keramida Exp $
+# $FreeBSD: src/release/fixit.profile,v 1.11 2007/12/06 20:25:31 lulf Exp $
export BLOCKSIZE=K
export PS1="Fixit# "
@@ -8,6 +8,8 @@
export SCSI_MODES="/mnt2/usr/share/misc/scsi_modes"
# the root MFS doesn't have /dev/nrsa0, pick a better default for mt(1)
export TAPE=/mnt2/dev/nrsa0
+# make geom(8) utilities find their modules
+export GEOM_LIBRARY_PATH="/mnt2/lib/geom"
alias ls="ls -F"
alias ll="ls -l"
==== //depot/projects/xen31/share/man/man4/aac.4#3 (text+ko) ====
@@ -22,7 +22,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD: src/share/man/man4/aac.4,v 1.38 2007/11/29 18:53:11 emaste Exp $
+.\" $FreeBSD: src/share/man/man4/aac.4,v 1.39 2007/12/06 18:31:57 emaste Exp $
.Dd November 29, 2007
.Dt AAC 4
.Os
@@ -123,8 +123,16 @@
.It
Adaptec RAID 51205
.It
+Adaptec RAID 51245
+.It
Adaptec RAID 51605
.It
+Adaptec RAID 51645
+.It
+Adaptec RAID 52445
+.It
+Adaptec RAID 5405
+.It
Adaptec RAID 5445
.It
Adaptec RAID 5805
@@ -242,6 +250,26 @@
Legend S220
.It
Legend S230
+.It
+Sun STK RAID REM
+.It
+Sun STK RAID EM
+.It
+SG-XPCIESAS-R-IN
+.It
+SG-XPCIESAS-R-EX
+.It
+AOC-USAS-S4i
+.It
+AOC-USAS-S8i
+.It
+AOC-USAS-S4iR
+.It
+AOC-USAS-S8iR
+.It
+AOC-USAS-S8i-LP
+.It
+AOC-USAS-S8iR-LP
.El
.Sh FILES
.Bl -tag -width /boot/kernel/aac.ko -compact
==== //depot/projects/xen31/sys/arm/arm/pmap.c#5 (text+ko) ====
@@ -147,7 +147,7 @@
#include "opt_vm.h"
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/arm/pmap.c,v 1.90 2007/12/02 15:26:30 cognet Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/arm/pmap.c,v 1.91 2007/12/06 23:17:24 cognet Exp $");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
@@ -1733,7 +1733,7 @@
pg->md.krw_mappings++;
else
pg->md.kro_mappings++;
- }
+ } else
if (flags & PVF_WRITE)
pg->md.urw_mappings++;
else
==== //depot/projects/xen31/sys/compat/freebsd32/freebsd32.h#2 (text+ko) ====
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/compat/freebsd32/freebsd32.h,v 1.6 2006/09/22 15:04:28 davidxu Exp $
+ * $FreeBSD: src/sys/compat/freebsd32/freebsd32.h,v 1.7 2007/12/06 23:11:27 jhb Exp $
*/
#ifndef _COMPAT_FREEBSD32_FREEBSD32_H_
@@ -75,6 +75,11 @@
int32_t ru_nivcsw;
};
+struct itimerval32 {
+ struct timeval32 it_interval;
+ struct timeval32 it_value;
+};
+
#define FREEBSD4_MNAMELEN (88 - 2 * sizeof(int32_t)) /* size of on/from name bufs */
/* 4.x version */
@@ -103,6 +108,57 @@
int32_t f_spare[2];
};
+struct kevent32 {
+ u_int32_t ident; /* identifier for this event */
+ short filter; /* filter for event */
+ u_short flags;
+ u_int fflags;
+ int32_t data;
+ u_int32_t udata; /* opaque user data identifier */
+};
+
+struct iovec32 {
+ u_int32_t iov_base;
+ int iov_len;
+};
+
+struct msghdr32 {
+ u_int32_t msg_name;
+ socklen_t msg_namelen;
+ u_int32_t msg_iov;
+ int msg_iovlen;
+ u_int32_t msg_control;
+ socklen_t msg_controllen;
+ int msg_flags;
+};
+
+struct stat32 {
+ dev_t st_dev;
+ ino_t st_ino;
+ mode_t st_mode;
+ nlink_t st_nlink;
+ uid_t st_uid;
+ gid_t st_gid;
+ dev_t st_rdev;
+ struct timespec32 st_atimespec;
+ struct timespec32 st_mtimespec;
+ struct timespec32 st_ctimespec;
+ off_t st_size;
+ int64_t st_blocks;
+ u_int32_t st_blksize;
+ u_int32_t st_flags;
+ u_int32_t st_gen;
+ struct timespec32 st_birthtimespec;
+ unsigned int :(8 / 2) * (16 - (int)sizeof(struct timespec32));
+ unsigned int :(8 / 2) * (16 - (int)sizeof(struct timespec32));
+};
+
+struct sigaction32 {
+ u_int32_t sa_u;
+ int sa_flags;
+ sigset_t sa_mask;
+};
+
struct thr_param32 {
uint32_t start_func;
uint32_t arg;
==== //depot/projects/xen31/sys/compat/freebsd32/freebsd32_misc.c#3 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/compat/freebsd32/freebsd32_misc.c,v 1.68 2007/12/04 20:25:41 jkim Exp $");
+__FBSDID("$FreeBSD: src/sys/compat/freebsd32/freebsd32_misc.c,v 1.71 2007/12/06 23:35:29 jhb Exp $");
#include "opt_compat.h"
@@ -71,6 +71,8 @@
#include <sys/vnode.h>
#include <sys/wait.h>
#include <sys/ipc.h>
+#include <sys/msg.h>
+#include <sys/sem.h>
#include <sys/shm.h>
#include <vm/vm.h>
@@ -85,14 +87,25 @@
#include <compat/freebsd32/freebsd32_util.h>
#include <compat/freebsd32/freebsd32.h>
+#include <compat/freebsd32/freebsd32_ipc.h>
#include <compat/freebsd32/freebsd32_signal.h>
#include <compat/freebsd32/freebsd32_proto.h>
CTASSERT(sizeof(struct timeval32) == 8);
CTASSERT(sizeof(struct timespec32) == 8);
+CTASSERT(sizeof(struct itimerval32) == 16);
CTASSERT(sizeof(struct statfs32) == 256);
CTASSERT(sizeof(struct rusage32) == 72);
+CTASSERT(sizeof(struct sigaltstack32) == 12);
+CTASSERT(sizeof(struct kevent32) == 20);
+CTASSERT(sizeof(struct iovec32) == 8);
+CTASSERT(sizeof(struct msghdr32) == 28);
+CTASSERT(sizeof(struct stat32) == 96);
+CTASSERT(sizeof(struct sigaction32) == 24);
+static int freebsd32_kevent_copyout(void *arg, struct kevent *kevp, int count);
+static int freebsd32_kevent_copyin(void *arg, struct kevent *kevp, int count);
+
int
freebsd32_wait4(struct thread *td, struct freebsd32_wait4_args *uap)
{
@@ -132,11 +145,14 @@
}
#ifdef COMPAT_FREEBSD4
-static void
+static int
copy_statfs(struct statfs *in, struct statfs32 *out)
{
+ int error;
- statfs_scale_blocks(in, INT32_MAX);
+ error = statfs_scale_blocks(in, INT32_MAX);
+ if (error)
+ return (error);
bzero(out, sizeof(*out));
CP(*in, *out, f_bsize);
out->f_iosize = MIN(in->f_iosize, INT32_MAX);
@@ -144,21 +160,25 @@
CP(*in, *out, f_bfree);
CP(*in, *out, f_bavail);
out->f_files = MIN(in->f_files, INT32_MAX);
- out->f_ffree = MIN(in->f_ffree, INT32_MAX);
+ if (in->f_ffree < 0)
+ out->f_ffree = MAX(in->f_ffree, INT32_MIN);
+ else
+ out->f_ffree = MIN(in->f_ffree, INT32_MAX);
CP(*in, *out, f_fsid);
CP(*in, *out, f_owner);
CP(*in, *out, f_type);
CP(*in, *out, f_flags);
- out->f_syncwrites = MIN(in->f_syncwrites, INT32_MAX);
- out->f_asyncwrites = MIN(in->f_asyncwrites, INT32_MAX);
+ CP(*in, *out, f_syncwrites);
+ CP(*in, *out, f_asyncwrites);
strlcpy(out->f_fstypename,
in->f_fstypename, MFSNAMELEN);
strlcpy(out->f_mntonname,
in->f_mntonname, min(MNAMELEN, FREEBSD4_MNAMELEN));
- out->f_syncreads = MIN(in->f_syncreads, INT32_MAX);
- out->f_asyncreads = MIN(in->f_asyncreads, INT32_MAX);
+ CP(*in, *out, f_syncreads);
+ CP(*in, *out, f_asyncreads);
strlcpy(out->f_mntfromname,
in->f_mntfromname, min(MNAMELEN, FREEBSD4_MNAMELEN));
+ return (0);
}
#endif
@@ -178,7 +198,9 @@
count = td->td_retval[0];
sp = buf;
while (count > 0 && error == 0) {
- copy_statfs(sp, &stat32);
+ error = copy_statfs(sp, &stat32);
+ if (error)
+ break;
error = copyout(&stat32, uap->buf, sizeof(stat32));
sp++;
uap->buf++;
@@ -190,8 +212,6 @@
}
#endif
-CTASSERT(sizeof(struct sigaltstack32) == 12);
-
int
freebsd32_sigaltstack(struct thread *td,
struct freebsd32_sigaltstack_args *uap)
@@ -493,13 +513,6 @@
}
#endif
-struct itimerval32 {
- struct timeval32 it_interval;
- struct timeval32 it_value;
-};
-
-CTASSERT(sizeof(struct itimerval32) == 16);
-
int
freebsd32_setitimer(struct thread *td, struct freebsd32_setitimer_args *uap)
{
@@ -562,19 +575,6 @@
return (kern_select(td, uap->nd, uap->in, uap->ou, uap->ex, tvp));
}
-struct kevent32 {
- u_int32_t ident; /* identifier for this event */
- short filter; /* filter for event */
- u_short flags;
- u_int fflags;
- int32_t data;
- u_int32_t udata; /* opaque user data identifier */
-};
-
-CTASSERT(sizeof(struct kevent32) == 20);
-static int freebsd32_kevent_copyout(void *arg, struct kevent *kevp, int count);
-static int freebsd32_kevent_copyin(void *arg, struct kevent *kevp, int count);
-
/*
* Copy 'count' items into the destination list pointed to by uap->eventlist.
*/
@@ -712,13 +712,6 @@
return (error);
}
-struct iovec32 {
- u_int32_t iov_base;
- int iov_len;
-};
-
-CTASSERT(sizeof(struct iovec32) == 8);
-
static int
freebsd32_copyinuio(struct iovec32 *iovp, u_int iovcnt, struct uio **uiop)
{
@@ -843,17 +836,6 @@
return (0);
}
-struct msghdr32 {
- u_int32_t msg_name;
- socklen_t msg_namelen;
- u_int32_t msg_iov;
- int msg_iovlen;
- u_int32_t msg_control;
- socklen_t msg_controllen;
- int msg_flags;
-};
-CTASSERT(sizeof(struct msghdr32) == 28);
-
static int
freebsd32_copyinmsghdr(struct msghdr32 *msg32, struct msghdr *msg)
{
@@ -1293,7 +1275,9 @@
error = kern_statfs(td, uap->path, UIO_USERSPACE, &s);
if (error)
return (error);
- copy_statfs(&s, &s32);
+ error = copy_statfs(&s, &s32);
+ if (error)
+ return (error);
return (copyout(&s32, uap->buf, sizeof(s32)));
}
#endif
@@ -1309,7 +1293,9 @@
error = kern_fstatfs(td, uap->fd, &s);
if (error)
return (error);
- copy_statfs(&s, &s32);
+ error = copy_statfs(&s, &s32);
+ if (error)
+ return (error);
return (copyout(&s32, uap->buf, sizeof(s32)));
}
#endif
@@ -1328,39 +1314,208 @@
error = kern_fhstatfs(td, fh, &s);
if (error)
return (error);
- copy_statfs(&s, &s32);
+ error = copy_statfs(&s, &s32);
+ if (error)
+ return (error);
return (copyout(&s32, uap->buf, sizeof(s32)));
}
#endif
+static void
+freebsd32_ipcperm_in(struct ipc_perm32 *ip32, struct ipc_perm *ip)
+{
+
+ CP(*ip32, *ip, cuid);
+ CP(*ip32, *ip, cgid);
+ CP(*ip32, *ip, uid);
+ CP(*ip32, *ip, gid);
+ CP(*ip32, *ip, mode);
+ CP(*ip32, *ip, seq);
+ CP(*ip32, *ip, key);
+}
+
+static void
+freebsd32_ipcperm_out(struct ipc_perm *ip, struct ipc_perm32 *ip32)
+{
+
+ CP(*ip, *ip32, cuid);
+ CP(*ip, *ip32, cgid);
+ CP(*ip, *ip32, uid);
+ CP(*ip, *ip32, gid);
+ CP(*ip, *ip32, mode);
+ CP(*ip, *ip32, seq);
+ CP(*ip, *ip32, key);
+}
+
int
freebsd32_semsys(struct thread *td, struct freebsd32_semsys_args *uap)
{
- /*
- * Vector through to semsys if it is loaded.
- */
- return sysent[SYS_semsys].sy_call(td, uap);
+
+ switch (uap->which) {
+ case 0:
+ return (freebsd32_semctl(td,
+ (struct freebsd32_semctl_args *)&uap->a2));
+ default:
+ return (semsys(td, (struct semsys_args *)uap));
+ }
+}
+
+int
+freebsd32_semctl(struct thread *td, struct freebsd32_semctl_args *uap)
+{
+ struct semid_ds32 dsbuf32;
+ struct semid_ds dsbuf;
+ union semun semun;
+ union semun32 arg;
+ register_t rval;
+ int error;
+
+ switch (uap->cmd) {
+ case SEM_STAT:
+ case IPC_SET:
+ case IPC_STAT:
+ case GETALL:
+ case SETVAL:
+ case SETALL:
+ error = copyin(uap->arg, &arg, sizeof(arg));
+ if (error)
+ return (error);
+ break;
+ }
+
+ switch (uap->cmd) {
+ case SEM_STAT:
+ case IPC_STAT:
+ semun.buf = &dsbuf;
+ break;
+ case IPC_SET:
+ error = copyin(PTRIN(arg.buf), &dsbuf32, sizeof(dsbuf32));
+ if (error)
+ return (error);
+ freebsd32_ipcperm_in(&dsbuf32.sem_perm, &dsbuf.sem_perm);
+ PTRIN_CP(dsbuf32, dsbuf, sem_base);
+ CP(dsbuf32, dsbuf, sem_nsems);
+ CP(dsbuf32, dsbuf, sem_otime);
+ CP(dsbuf32, dsbuf, sem_pad1);
+ CP(dsbuf32, dsbuf, sem_ctime);
+ CP(dsbuf32, dsbuf, sem_pad2);
+ CP(dsbuf32, dsbuf, sem_pad3[0]);
+ CP(dsbuf32, dsbuf, sem_pad3[1]);
+ CP(dsbuf32, dsbuf, sem_pad3[2]);
+ CP(dsbuf32, dsbuf, sem_pad3[3]);
+ semun.buf = &dsbuf;
+ break;
+ case GETALL:
+ case SETALL:
+ semun.array = PTRIN(arg.array);
+ break;
+ case SETVAL:
+ semun.val = arg.val;
+ break;
+ }
+
+ error = kern_semctl(td, uap->semid, uap->semnum, uap->cmd, &semun,
+ &rval);
+ if (error)
+ return (error);
+
+ switch (uap->cmd) {
+ case SEM_STAT:
+ case IPC_STAT:
+ freebsd32_ipcperm_out(&dsbuf.sem_perm, &dsbuf32.sem_perm);
+ PTROUT_CP(dsbuf, dsbuf32, sem_base);
+ CP(dsbuf, dsbuf32, sem_nsems);
+ CP(dsbuf, dsbuf32, sem_otime);
+ CP(dsbuf, dsbuf32, sem_pad1);
+ CP(dsbuf, dsbuf32, sem_ctime);
+ CP(dsbuf, dsbuf32, sem_pad2);
+ CP(dsbuf, dsbuf32, sem_pad3[0]);
+ CP(dsbuf, dsbuf32, sem_pad3[1]);
+ CP(dsbuf, dsbuf32, sem_pad3[2]);
+ CP(dsbuf, dsbuf32, sem_pad3[3]);
+ error = copyout(&dsbuf32, PTRIN(arg.buf), sizeof(dsbuf32));
+ break;
+ }
+
+ if (error == 0)
+ td->td_retval[0] = rval;
+ return (error);
}
int
freebsd32_msgsys(struct thread *td, struct freebsd32_msgsys_args *uap)
{
+
switch (uap->which) {
+ case 0:
+ return (freebsd32_msgctl(td,
+ (struct freebsd32_msgctl_args *)&uap->a2));
case 2:
return (freebsd32_msgsnd(td,
(struct freebsd32_msgsnd_args *)&uap->a2));
- break;
case 3:
return (freebsd32_msgrcv(td,
(struct freebsd32_msgrcv_args *)&uap->a2));
- break;
default:
- /*
- * Vector through to msgsys if it is loaded.
- */
- return (sysent[SYS_msgsys].sy_call(td, uap));
- break;
+ return (msgsys(td, (struct msgsys_args *)uap));
+ }
+}
+
+int
+freebsd32_msgctl(struct thread *td, struct freebsd32_msgctl_args *uap)
+{
+ struct msqid_ds msqbuf;
+ struct msqid_ds32 msqbuf32;
+ int error;
+
+ if (uap->cmd == IPC_SET) {
+ error = copyin(uap->buf, &msqbuf32, sizeof(msqbuf32));
+ if (error)
+ return (error);
+ freebsd32_ipcperm_in(&msqbuf32.msg_perm, &msqbuf.msg_perm);
+ PTRIN_CP(msqbuf32, msqbuf, msg_first);
+ PTRIN_CP(msqbuf32, msqbuf, msg_last);
+ CP(msqbuf32, msqbuf, msg_cbytes);
+ CP(msqbuf32, msqbuf, msg_qnum);
+ CP(msqbuf32, msqbuf, msg_qbytes);
+ CP(msqbuf32, msqbuf, msg_lspid);
+ CP(msqbuf32, msqbuf, msg_lrpid);
+ CP(msqbuf32, msqbuf, msg_stime);
+ CP(msqbuf32, msqbuf, msg_pad1);
+ CP(msqbuf32, msqbuf, msg_rtime);
+ CP(msqbuf32, msqbuf, msg_pad2);
+ CP(msqbuf32, msqbuf, msg_ctime);
+ CP(msqbuf32, msqbuf, msg_pad3);
+ CP(msqbuf32, msqbuf, msg_pad4[0]);
+ CP(msqbuf32, msqbuf, msg_pad4[1]);
+ CP(msqbuf32, msqbuf, msg_pad4[2]);
+ CP(msqbuf32, msqbuf, msg_pad4[3]);
+ }
+ error = kern_msgctl(td, uap->msqid, uap->cmd, &msqbuf);
+ if (error)
+ return (error);
+ if (uap->cmd == IPC_STAT) {
+ freebsd32_ipcperm_out(&msqbuf.msg_perm, &msqbuf32.msg_perm);
+ PTROUT_CP(msqbuf, msqbuf32, msg_first);
+ PTROUT_CP(msqbuf, msqbuf32, msg_last);
+ CP(msqbuf, msqbuf32, msg_cbytes);
+ CP(msqbuf, msqbuf32, msg_qnum);
+ CP(msqbuf, msqbuf32, msg_qbytes);
+ CP(msqbuf, msqbuf32, msg_lspid);
+ CP(msqbuf, msqbuf32, msg_lrpid);
+ CP(msqbuf, msqbuf32, msg_stime);
+ CP(msqbuf, msqbuf32, msg_pad1);
+ CP(msqbuf, msqbuf32, msg_rtime);
+ CP(msqbuf, msqbuf32, msg_pad2);
+ CP(msqbuf, msqbuf32, msg_ctime);
+ CP(msqbuf, msqbuf32, msg_pad3);
+ CP(msqbuf, msqbuf32, msg_pad4[0]);
+ CP(msqbuf, msqbuf32, msg_pad4[1]);
+ CP(msqbuf, msqbuf32, msg_pad4[2]);
+ CP(msqbuf, msqbuf32, msg_pad4[3]);
+ error = copyout(&msqbuf32, uap->buf, sizeof(struct msqid_ds32));
}
+ return (error);
}
int
@@ -1438,42 +1593,6 @@
}
}
-struct ipc_perm32 {
- uint16_t cuid;
- uint16_t cgid;
- uint16_t uid;
- uint16_t gid;
- uint16_t mode;
- uint16_t seq;
- uint32_t key;
-};
-struct shmid_ds32 {
- struct ipc_perm32 shm_perm;
- int32_t shm_segsz;
- int32_t shm_lpid;
- int32_t shm_cpid;
- int16_t shm_nattch;
- int32_t shm_atime;
- int32_t shm_dtime;
- int32_t shm_ctime;
- uint32_t shm_internal;
-};
-struct shm_info32 {
- int32_t used_ids;
- uint32_t shm_tot;
- uint32_t shm_rss;
- uint32_t shm_swp;
- uint32_t swap_attempts;
- uint32_t swap_successes;
-};
-struct shminfo32 {
- uint32_t shmmax;
- uint32_t shmmin;
- uint32_t shmmni;
- uint32_t shmseg;
- uint32_t shmall;
-};
-
int
freebsd32_shmctl(struct thread *td, struct freebsd32_shmctl_args *uap)
{
@@ -1494,13 +1613,8 @@
if ((error = copyin(uap->buf, &u32.shmid_ds32,
sizeof(u32.shmid_ds32))))
goto done;
- CP(u32.shmid_ds32, u.shmid_ds, shm_perm.cuid);
- CP(u32.shmid_ds32, u.shmid_ds, shm_perm.cgid);
- CP(u32.shmid_ds32, u.shmid_ds, shm_perm.uid);
- CP(u32.shmid_ds32, u.shmid_ds, shm_perm.gid);
- CP(u32.shmid_ds32, u.shmid_ds, shm_perm.mode);
- CP(u32.shmid_ds32, u.shmid_ds, shm_perm.seq);
- CP(u32.shmid_ds32, u.shmid_ds, shm_perm.key);
+ freebsd32_ipcperm_in(&u32.shmid_ds32.shm_perm,
+ &u.shmid_ds.shm_perm);
CP(u32.shmid_ds32, u.shmid_ds, shm_segsz);
CP(u32.shmid_ds32, u.shmid_ds, shm_lpid);
CP(u32.shmid_ds32, u.shmid_ds, shm_cpid);
@@ -1538,13 +1652,8 @@
break;
case SHM_STAT:
case IPC_STAT:
- CP(u.shmid_ds, u32.shmid_ds32, shm_perm.cuid);
- CP(u.shmid_ds, u32.shmid_ds32, shm_perm.cgid);
- CP(u.shmid_ds, u32.shmid_ds32, shm_perm.uid);
- CP(u.shmid_ds, u32.shmid_ds32, shm_perm.gid);
- CP(u.shmid_ds, u32.shmid_ds32, shm_perm.mode);
- CP(u.shmid_ds, u32.shmid_ds32, shm_perm.seq);
- CP(u.shmid_ds, u32.shmid_ds32, shm_perm.key);
+ freebsd32_ipcperm_out(&u.shmid_ds.shm_perm,
+ &u32.shmid_ds32.shm_perm);
CP(u.shmid_ds, u32.shmid_ds32, shm_segsz);
CP(u.shmid_ds, u32.shmid_ds32, shm_lpid);
CP(u.shmid_ds, u32.shmid_ds32, shm_cpid);
@@ -1772,30 +1881,6 @@
return (freebsd32_do_sendfile(td, uap, 0));
}
-struct stat32 {
- dev_t st_dev;
- ino_t st_ino;
- mode_t st_mode;
- nlink_t st_nlink;
- uid_t st_uid;
- gid_t st_gid;
- dev_t st_rdev;
- struct timespec32 st_atimespec;
- struct timespec32 st_mtimespec;
- struct timespec32 st_ctimespec;
- off_t st_size;
- int64_t st_blocks;
- u_int32_t st_blksize;
- u_int32_t st_flags;
- u_int32_t st_gen;
- struct timespec32 st_birthtimespec;
- unsigned int :(8 / 2) * (16 - (int)sizeof(struct timespec32));
- unsigned int :(8 / 2) * (16 - (int)sizeof(struct timespec32));
-};
-
-
-CTASSERT(sizeof(struct stat32) == 96);
-
static void
copy_stat( struct stat *in, struct stat32 *out)
{
@@ -1892,14 +1977,6 @@
return (error);
}
-struct sigaction32 {
- u_int32_t sa_u;
- int sa_flags;
- sigset_t sa_mask;
-};
-
-CTASSERT(sizeof(struct sigaction32) == 24);
-
int
freebsd32_sigaction(struct thread *td, struct freebsd32_sigaction_args *uap)
{
==== //depot/projects/xen31/sys/compat/freebsd32/freebsd32_proto.h#2 (text+ko) ====
@@ -2,8 +2,8 @@
* System call prototypes.
*
* DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/compat/freebsd32/freebsd32_proto.h,v 1.78 2007/08/16 05:32:25 davidxu Exp $
- * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.90 2007/07/04 23:02:40 peter Exp
+ * $FreeBSD: src/sys/compat/freebsd32/freebsd32_proto.h,v 1.79 2007/12/06 23:37:26 jhb Exp $
+ * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.93 2007/12/06 23:36:57 jhb Exp
*/
#ifndef _FREEBSD32_SYSPROTO_H_
@@ -158,6 +158,17 @@
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
char tptr_l_[PADL_(struct timeval32 *)]; struct timeval32 * tptr; char tptr_r_[PADR_(struct timeval32 *)];
};
+struct 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)];
+ char cmd_l_[PADL_(int)]; int cmd; char cmd_r_[PADR_(int)];
+ char arg_l_[PADL_(union semun32 *)]; union semun32 * arg; char arg_r_[PADR_(union semun32 *)];
+};
+struct freebsd32_msgctl_args {
+ char msqid_l_[PADL_(int)]; int msqid; char msqid_r_[PADR_(int)];
+ char cmd_l_[PADL_(int)]; int cmd; char cmd_r_[PADR_(int)];
+ char buf_l_[PADL_(struct msqid_ds32 *)]; struct msqid_ds32 * buf; char buf_r_[PADR_(struct msqid_ds32 *)];
+};
struct freebsd32_msgsnd_args {
char msqid_l_[PADL_(int)]; int msqid; char msqid_r_[PADR_(int)];
char msgp_l_[PADL_(void *)]; void * msgp; char msgp_r_[PADR_(void *)];
@@ -340,6 +351,8 @@
int freebsd32_lstat(struct thread *, struct freebsd32_lstat_args *);
int freebsd32_sysctl(struct thread *, struct freebsd32_sysctl_args *);
int freebsd32_futimes(struct thread *, struct freebsd32_futimes_args *);
+int freebsd32_semctl(struct thread *, struct freebsd32_semctl_args *);
+int freebsd32_msgctl(struct thread *, struct freebsd32_msgctl_args *);
int freebsd32_msgsnd(struct thread *, struct freebsd32_msgsnd_args *);
int freebsd32_msgrcv(struct thread *, struct freebsd32_msgrcv_args *);
int freebsd32_shmctl(struct thread *, struct freebsd32_shmctl_args *);
@@ -541,6 +554,8 @@
#define FREEBSD32_SYS_AUE_freebsd32_lstat AUE_LSTAT
#define FREEBSD32_SYS_AUE_freebsd32_sysctl AUE_SYSCTL
#define FREEBSD32_SYS_AUE_freebsd32_futimes AUE_FUTIMES
+#define FREEBSD32_SYS_AUE_freebsd32_semctl AUE_SEMCTL
+#define FREEBSD32_SYS_AUE_freebsd32_msgctl AUE_MSGCTL
#define FREEBSD32_SYS_AUE_freebsd32_msgsnd AUE_MSGSND
#define FREEBSD32_SYS_AUE_freebsd32_msgrcv AUE_MSGRCV
#define FREEBSD32_SYS_AUE_freebsd32_shmctl AUE_SHMCTL
==== //depot/projects/xen31/sys/compat/freebsd32/freebsd32_syscall.h#2 (text+ko) ====
@@ -2,8 +2,8 @@
* System call numbers.
*
* DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/compat/freebsd32/freebsd32_syscall.h,v 1.76 2007/08/16 05:32:25 davidxu Exp $
- * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.90 2007/07/04 23:02:40 peter Exp
+ * $FreeBSD: src/sys/compat/freebsd32/freebsd32_syscall.h,v 1.77 2007/12/06 23:37:26 jhb Exp $
+ * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.93 2007/12/06 23:36:57 jhb Exp
*/
#define FREEBSD32_SYS_syscall 0
@@ -190,10 +190,10 @@
#define FREEBSD32_SYS_freebsd32_futimes 206
#define FREEBSD32_SYS_getpgid 207
#define FREEBSD32_SYS_poll 209
-#define FREEBSD32_SYS___semctl 220
+#define FREEBSD32_SYS_freebsd32_semctl 220
#define FREEBSD32_SYS_semget 221
#define FREEBSD32_SYS_semop 222
-#define FREEBSD32_SYS_msgctl 224
+#define FREEBSD32_SYS_freebsd32_msgctl 224
#define FREEBSD32_SYS_msgget 225
#define FREEBSD32_SYS_freebsd32_msgsnd 226
#define FREEBSD32_SYS_freebsd32_msgrcv 227
==== //depot/projects/xen31/sys/compat/freebsd32/freebsd32_syscalls.c#2 (text+ko) ====
@@ -2,8 +2,8 @@
* System call names.
*
* DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/compat/freebsd32/freebsd32_syscalls.c,v 1.67 2007/08/16 05:32:25 davidxu Exp $
- * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.90 2007/07/04 23:02:40 peter Exp
+ * $FreeBSD: src/sys/compat/freebsd32/freebsd32_syscalls.c,v 1.68 2007/12/06 23:37:26 jhb Exp $
+ * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.93 2007/12/06 23:36:57 jhb Exp
*/
const char *freebsd32_syscallnames[] = {
@@ -227,11 +227,11 @@
"#217", /* 217 = */
"#218", /* 218 = */
"#219", /* 219 = */
- "__semctl", /* 220 = __semctl */
+ "freebsd32_semctl", /* 220 = freebsd32_semctl */
"semget", /* 221 = semget */
"semop", /* 222 = semop */
"#223", /* 223 = semconfig */
- "msgctl", /* 224 = msgctl */
+ "freebsd32_msgctl", /* 224 = freebsd32_msgctl */
"msgget", /* 225 = msgget */
"freebsd32_msgsnd", /* 226 = freebsd32_msgsnd */
"freebsd32_msgrcv", /* 227 = freebsd32_msgrcv */
==== //depot/projects/xen31/sys/compat/freebsd32/freebsd32_sysent.c#2 (text+ko) ====
@@ -2,8 +2,8 @@
* System call switch table.
*
* DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/compat/freebsd32/freebsd32_sysent.c,v 1.77 2007/08/16 05:32:25 davidxu Exp $
- * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.90 2007/07/04 23:02:40 peter Exp
+ * $FreeBSD: src/sys/compat/freebsd32/freebsd32_sysent.c,v 1.78 2007/12/06 23:37:26 jhb Exp $
+ * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.93 2007/12/06 23:36:57 jhb Exp
*/
#include "opt_compat.h"
@@ -13,6 +13,7 @@
#include <sys/sysent.h>
#include <sys/sysproto.h>
#include <sys/mount.h>
+#include <sys/socket.h>
#include <compat/freebsd32/freebsd32.h>
#include <compat/freebsd32/freebsd32_proto.h>
@@ -258,11 +259,11 @@
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 217 = */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 218 = */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 219 = */
- { AS(__semctl_args), (sy_call_t *)__semctl, AUE_SEMCTL, NULL, 0, 0 }, /* 220 = __semctl */
+ { AS(freebsd32_semctl_args), (sy_call_t *)freebsd32_semctl, AUE_SEMCTL, NULL, 0, 0 }, /* 220 = freebsd32_semctl */
{ AS(semget_args), (sy_call_t *)semget, AUE_SEMGET, NULL, 0, 0 }, /* 221 = semget */
{ AS(semop_args), (sy_call_t *)semop, AUE_SEMOP, NULL, 0, 0 }, /* 222 = semop */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 223 = semconfig */
- { AS(msgctl_args), (sy_call_t *)msgctl, AUE_MSGCTL, NULL, 0, 0 }, /* 224 = msgctl */
+ { AS(freebsd32_msgctl_args), (sy_call_t *)freebsd32_msgctl, AUE_MSGCTL, NULL, 0, 0 }, /* 224 = freebsd32_msgctl */
{ AS(msgget_args), (sy_call_t *)msgget, AUE_MSGGET, NULL, 0, 0 }, /* 225 = msgget */
{ AS(freebsd32_msgsnd_args), (sy_call_t *)freebsd32_msgsnd, AUE_MSGSND, NULL, 0, 0 }, /* 226 = freebsd32_msgsnd */
{ AS(freebsd32_msgrcv_args), (sy_call_t *)freebsd32_msgrcv, AUE_MSGRCV, NULL, 0, 0 }, /* 227 = freebsd32_msgrcv */
==== //depot/projects/xen31/sys/compat/freebsd32/syscalls.master#2 (text+ko) ====
@@ -1,4 +1,4 @@
- $FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.91 2007/08/16 05:30:04 davidxu Exp $
+ $FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.93 2007/12/06 23:36:57 jhb Exp $
; from: @(#)syscalls.master 8.2 (Berkeley) 1/13/94
; from: src/sys/kern/syscalls.master 1.107
;
@@ -38,6 +38,7 @@
#include <sys/sysent.h>
#include <sys/sysproto.h>
#include <sys/mount.h>
+#include <sys/socket.h>
#include <compat/freebsd32/freebsd32.h>
#include <compat/freebsd32/freebsd32_proto.h>
@@ -394,15 +395,15 @@
; The following were introduced with NetBSD/4.4Lite-2
; They are initialized by thier respective modules/sysinits
; XXX PROBLEM!!
-220 AUE_SEMCTL NOPROTO { int __semctl(int semid, int semnum, \
- int cmd, union semun *arg); }
+220 AUE_SEMCTL STD { int freebsd32_semctl(int semid, int semnum, \
+ int cmd, union semun32 *arg); }
221 AUE_SEMGET NOPROTO { int semget(key_t key, int nsems, \
int semflg); }
222 AUE_SEMOP NOPROTO { int semop(int semid, struct sembuf *sops, \
u_int nsops); }
223 AUE_NULL UNIMPL semconfig
-224 AUE_MSGCTL NOPROTO { int msgctl(int msqid, int cmd, \
- struct msqid_ds *buf); }
+224 AUE_MSGCTL STD { int freebsd32_msgctl(int msqid, int cmd, \
+ struct msqid_ds32 *buf); }
225 AUE_MSGGET NOPROTO { int msgget(key_t key, int msgflg); }
226 AUE_MSGSND STD { int freebsd32_msgsnd(int msqid, void *msgp, \
size_t msgsz, int msgflg); }
==== //depot/projects/xen31/sys/dev/aac/aac.c#3 (text+ko) ====
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/aac/aac.c,v 1.123 2007/11/01 20:45:28 emaste Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/aac/aac.c,v 1.124 2007/12/07 00:22:23 emaste Exp $");
/*
* Driver for the Adaptec 'FSA' family of PCI/SCSI RAID adapters.
@@ -216,8 +216,11 @@
static void aac_handle_aif(struct aac_softc *sc,
struct aac_fib *fib);
static int aac_rev_check(struct aac_softc *sc, caddr_t udata);
+static int aac_open_aif(struct aac_softc *sc, caddr_t arg);
+static int aac_close_aif(struct aac_softc *sc, caddr_t arg);
static int aac_getnext_aif(struct aac_softc *sc, caddr_t arg);
-static int aac_return_aif(struct aac_softc *sc, caddr_t uptr);
+static int aac_return_aif(struct aac_softc *sc,
+ struct aac_fib_context *ctx, caddr_t uptr);
static int aac_query_disk(struct aac_softc *sc, caddr_t uptr);
static int aac_get_pci_info(struct aac_softc *sc, caddr_t uptr);
static void aac_ioctl_event(struct aac_softc *sc,
>>> TRUNCATED FOR MAIL (1000 lines) <<<
More information about the p4-projects
mailing list