From owner-p4-projects@FreeBSD.ORG Sat Apr 21 04:52:56 2007 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id CA77416A409; Sat, 21 Apr 2007 04:52:55 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 69C0B16A400 for ; Sat, 21 Apr 2007 04:52:55 +0000 (UTC) (envelope-from marcel@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id 5847013C45A for ; Sat, 21 Apr 2007 04:52:55 +0000 (UTC) (envelope-from marcel@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.8/8.13.8) with ESMTP id l3L4qtqY058684 for ; Sat, 21 Apr 2007 04:52:55 GMT (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.8/8.13.8/Submit) id l3L4qpWx058660 for perforce@freebsd.org; Sat, 21 Apr 2007 04:52:51 GMT (envelope-from marcel@freebsd.org) Date: Sat, 21 Apr 2007 04:52:51 GMT Message-Id: <200704210452.l3L4qpWx058660@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marcel@freebsd.org using -f From: Marcel Moolenaar To: Perforce Change Reviews Cc: Subject: PERFORCE change 118514 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Apr 2007 04:52:56 -0000 http://perforce.freebsd.org/chv.cgi?CH=118514 Change 118514 by marcel@marcel_xcllnt on 2007/04/21 04:52:24 IFC @118506 Affected files ... .. //depot/projects/uart/Makefile#12 integrate .. //depot/projects/uart/amd64/amd64/busdma_machdep.c#18 integrate .. //depot/projects/uart/amd64/include/vmparam.h#5 integrate .. //depot/projects/uart/amd64/linux32/linux32_dummy.c#8 integrate .. //depot/projects/uart/amd64/linux32/linux32_machdep.c#11 integrate .. //depot/projects/uart/bsm/audit.h#7 integrate .. //depot/projects/uart/bsm/audit_internal.h#5 integrate .. //depot/projects/uart/bsm/audit_kevents.h#7 integrate .. //depot/projects/uart/bsm/audit_record.h#6 integrate .. //depot/projects/uart/cam/cam_ccb.h#10 integrate .. //depot/projects/uart/cam/cam_periph.c#13 integrate .. //depot/projects/uart/cam/cam_periph.h#4 integrate .. //depot/projects/uart/cam/cam_sim.c#4 integrate .. //depot/projects/uart/cam/cam_sim.h#3 integrate .. //depot/projects/uart/cam/cam_xpt.c#17 integrate .. //depot/projects/uart/cam/cam_xpt.h#4 integrate .. //depot/projects/uart/cam/cam_xpt_periph.h#4 integrate .. //depot/projects/uart/cam/scsi/scsi_cd.c#15 integrate .. //depot/projects/uart/cam/scsi/scsi_ch.c#6 integrate .. //depot/projects/uart/cam/scsi/scsi_da.c#23 integrate .. //depot/projects/uart/cam/scsi/scsi_low.c#6 integrate .. //depot/projects/uart/cam/scsi/scsi_pass.c#7 integrate .. //depot/projects/uart/cam/scsi/scsi_pt.c#5 integrate .. //depot/projects/uart/cam/scsi/scsi_sa.c#9 integrate .. //depot/projects/uart/cam/scsi/scsi_ses.c#7 integrate .. //depot/projects/uart/cam/scsi/scsi_sg.c#2 integrate .. //depot/projects/uart/cam/scsi/scsi_targ_bh.c#7 integrate .. //depot/projects/uart/cam/scsi/scsi_target.c#11 integrate .. //depot/projects/uart/compat/linprocfs/linprocfs.c#25 integrate .. //depot/projects/uart/compat/linux/linux_socket.c#16 integrate .. //depot/projects/uart/compat/opensolaris/kern/opensolaris_vfs.c#2 integrate .. //depot/projects/uart/conf/NOTES#51 integrate .. //depot/projects/uart/conf/files#82 integrate .. //depot/projects/uart/conf/options#48 integrate .. //depot/projects/uart/contrib/opensolaris/uts/common/fs/dnlc.c#2 integrate .. //depot/projects/uart/contrib/opensolaris/uts/common/fs/zfs/spa.c#2 integrate .. //depot/projects/uart/contrib/opensolaris/uts/common/fs/zfs/spa_config.c#2 integrate .. //depot/projects/uart/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c#2 integrate .. //depot/projects/uart/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c#2 integrate .. //depot/projects/uart/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c#2 integrate .. //depot/projects/uart/contrib/pf/net/if_pfsync.c#11 integrate .. //depot/projects/uart/dev/aac/aac_cam.c#11 integrate .. //depot/projects/uart/dev/advansys/advansys.c#9 integrate .. //depot/projects/uart/dev/advansys/adwcam.c#9 integrate .. //depot/projects/uart/dev/aha/aha.c#10 integrate .. //depot/projects/uart/dev/ahb/ahb.c#11 integrate .. //depot/projects/uart/dev/aic/aic.c#7 integrate .. //depot/projects/uart/dev/aic7xxx/aic7770.c#5 integrate .. //depot/projects/uart/dev/aic7xxx/aic79xx.c#8 integrate .. //depot/projects/uart/dev/aic7xxx/aic79xx.h#7 integrate .. //depot/projects/uart/dev/aic7xxx/aic79xx_osm.c#10 integrate .. //depot/projects/uart/dev/aic7xxx/aic79xx_osm.h#10 integrate .. //depot/projects/uart/dev/aic7xxx/aic79xx_pci.c#9 integrate .. //depot/projects/uart/dev/aic7xxx/aic7xxx.c#8 integrate .. //depot/projects/uart/dev/aic7xxx/aic7xxx.h#4 integrate .. //depot/projects/uart/dev/aic7xxx/aic7xxx_inline.h#4 integrate .. //depot/projects/uart/dev/aic7xxx/aic7xxx_osm.c#9 integrate .. //depot/projects/uart/dev/aic7xxx/aic7xxx_osm.h#10 integrate .. //depot/projects/uart/dev/aic7xxx/aic7xxx_pci.c#8 integrate .. //depot/projects/uart/dev/aic7xxx/aic_osm_lib.c#3 integrate .. //depot/projects/uart/dev/aic7xxx/aic_osm_lib.h#4 integrate .. //depot/projects/uart/dev/amd/amd.c#12 integrate .. //depot/projects/uart/dev/amr/amr_cam.c#10 integrate .. //depot/projects/uart/dev/arcmsr/arcmsr.c#8 integrate .. //depot/projects/uart/dev/asr/asr.c#15 integrate .. //depot/projects/uart/dev/ata/atapi-cam.c#14 integrate .. //depot/projects/uart/dev/ath/if_ath.c#36 integrate .. //depot/projects/uart/dev/buslogic/bt.c#10 integrate .. //depot/projects/uart/dev/ciss/ciss.c#20 integrate .. //depot/projects/uart/dev/cxgb/cxgb_main.c#4 integrate .. //depot/projects/uart/dev/cxgb/cxgb_sge.c#4 integrate .. //depot/projects/uart/dev/cxgb/sys/mvec.h#2 integrate .. //depot/projects/uart/dev/cxgb/sys/uipc_mvec.c#2 integrate .. //depot/projects/uart/dev/dpt/dpt_scsi.c#11 integrate .. //depot/projects/uart/dev/esp/ncr53c9x.c#7 integrate .. //depot/projects/uart/dev/ex/if_exvar.h#4 integrate .. //depot/projects/uart/dev/firewire/fwdma.c#8 integrate .. //depot/projects/uart/dev/firewire/sbp.c#16 integrate .. //depot/projects/uart/dev/firewire/sbp_targ.c#5 integrate .. //depot/projects/uart/dev/hptmv/entry.c#8 integrate .. //depot/projects/uart/dev/hwpmc/hwpmc_logging.c#5 integrate .. //depot/projects/uart/dev/hwpmc/hwpmc_mod.c#11 integrate .. //depot/projects/uart/dev/hwpmc/hwpmc_piv.c#6 integrate .. //depot/projects/uart/dev/iicbus/icee.c#2 integrate .. //depot/projects/uart/dev/iir/iir.c#11 integrate .. //depot/projects/uart/dev/isp/isp_freebsd.c#22 integrate .. //depot/projects/uart/dev/mly/mly.c#12 integrate .. //depot/projects/uart/dev/mpt/mpt_cam.c#24 integrate .. //depot/projects/uart/dev/ppbus/vpo.c#5 integrate .. //depot/projects/uart/dev/ral/rt2560.c#8 integrate .. //depot/projects/uart/dev/re/if_re.c#23 integrate .. //depot/projects/uart/dev/rr232x/osm_bsd.c#4 integrate .. //depot/projects/uart/dev/sound/isa/ad1816.c#10 integrate .. //depot/projects/uart/dev/sound/isa/ess.c#9 integrate .. //depot/projects/uart/dev/sound/isa/mss.c#11 integrate .. //depot/projects/uart/dev/sound/isa/sb16.c#8 integrate .. //depot/projects/uart/dev/sound/isa/sb8.c#8 integrate .. //depot/projects/uart/dev/sound/pci/als4000.c#11 integrate .. //depot/projects/uart/dev/sound/pci/atiixp.c#9 integrate .. //depot/projects/uart/dev/sound/pci/au88x0.c#9 integrate .. //depot/projects/uart/dev/sound/pci/aureal.c#10 integrate .. //depot/projects/uart/dev/sound/pci/cmi.c#15 integrate .. //depot/projects/uart/dev/sound/pci/cs4281.c#9 integrate .. //depot/projects/uart/dev/sound/pci/csapcm.c#11 integrate .. //depot/projects/uart/dev/sound/pci/ds1.c#11 integrate .. //depot/projects/uart/dev/sound/pci/emu10k1.c#14 integrate .. //depot/projects/uart/dev/sound/pci/emu10kx-pcm.c#4 integrate .. //depot/projects/uart/dev/sound/pci/envy24.c#5 integrate .. //depot/projects/uart/dev/sound/pci/envy24ht.c#3 integrate .. //depot/projects/uart/dev/sound/pci/es137x.c#16 integrate .. //depot/projects/uart/dev/sound/pci/fm801.c#10 integrate .. //depot/projects/uart/dev/sound/pci/hda/hdac.c#5 integrate .. //depot/projects/uart/dev/sound/pci/ich.c#26 integrate .. //depot/projects/uart/dev/sound/pci/maestro3.c#10 integrate .. //depot/projects/uart/dev/sound/pci/solo.c#12 integrate .. //depot/projects/uart/dev/sound/pci/t4dwave.c#10 integrate .. //depot/projects/uart/dev/sound/pci/via8233.c#14 integrate .. //depot/projects/uart/dev/sound/pci/via82c686.c#12 integrate .. //depot/projects/uart/dev/sound/pci/vibes.c#9 integrate .. //depot/projects/uart/dev/sound/pcm/ac97.c#15 integrate .. //depot/projects/uart/dev/sound/pcm/ac97.h#7 integrate .. //depot/projects/uart/dev/sound/pcm/ac97_patch.c#7 integrate .. //depot/projects/uart/dev/sound/pcm/ac97_patch.h#7 integrate .. //depot/projects/uart/dev/sound/pcm/buffer.c#10 integrate .. //depot/projects/uart/dev/sound/pcm/buffer.h#8 integrate .. //depot/projects/uart/dev/sound/pcm/sound.h#14 integrate .. //depot/projects/uart/dev/sound/sbus/cs4231.c#6 integrate .. //depot/projects/uart/dev/sym/sym_hipd.c#14 integrate .. //depot/projects/uart/dev/trm/trm.c#15 integrate .. //depot/projects/uart/dev/twa/tw_osl_cam.c#6 integrate .. //depot/projects/uart/dev/usb/if_ural.c#15 integrate .. //depot/projects/uart/dev/usb/umass.c#22 integrate .. //depot/projects/uart/dev/wds/wd7000.c#7 integrate .. //depot/projects/uart/dev/wi/if_wi.c#21 integrate .. //depot/projects/uart/fs/devfs/devfs_vnops.c#22 integrate .. //depot/projects/uart/fs/procfs/procfs_dbregs.c#5 integrate .. //depot/projects/uart/fs/procfs/procfs_fpregs.c#5 integrate .. //depot/projects/uart/fs/procfs/procfs_map.c#7 integrate .. //depot/projects/uart/fs/procfs/procfs_regs.c#5 integrate .. //depot/projects/uart/fs/pseudofs/pseudofs.c#9 integrate .. //depot/projects/uart/fs/pseudofs/pseudofs.h#8 integrate .. //depot/projects/uart/fs/pseudofs/pseudofs_fileno.c#4 integrate .. //depot/projects/uart/fs/pseudofs/pseudofs_internal.h#4 integrate .. //depot/projects/uart/fs/pseudofs/pseudofs_vncache.c#9 integrate .. //depot/projects/uart/fs/pseudofs/pseudofs_vnops.c#14 integrate .. //depot/projects/uart/i386/i386/bios.c#8 integrate .. //depot/projects/uart/i386/i386/busdma_machdep.c#21 integrate .. //depot/projects/uart/i386/i386/identcpu.c#26 integrate .. //depot/projects/uart/i386/include/vmparam.h#5 integrate .. //depot/projects/uart/ia64/include/vmparam.h#7 integrate .. //depot/projects/uart/isa/isa_common.c#10 integrate .. //depot/projects/uart/kern/kern_intr.c#15 integrate .. //depot/projects/uart/kern/kern_jail.c#12 integrate .. //depot/projects/uart/kern/kern_malloc.c#16 integrate .. //depot/projects/uart/kern/sched_ule.c#22 integrate .. //depot/projects/uart/kern/subr_rman.c#13 integrate .. //depot/projects/uart/kern/subr_witness.c#23 integrate .. //depot/projects/uart/kern/uipc_mbuf.c#17 integrate .. //depot/projects/uart/kern/uipc_syscalls.c#28 integrate .. //depot/projects/uart/kern/vfs_mount.c#33 integrate .. //depot/projects/uart/kern/vfs_subr.c#41 integrate .. //depot/projects/uart/modules/Makefile#48 integrate .. //depot/projects/uart/modules/if_lagg/Makefile#1 branch .. //depot/projects/uart/modules/if_trunk/Makefile#2 delete .. //depot/projects/uart/net/ieee8023ad_lacp.c#2 integrate .. //depot/projects/uart/net/ieee8023ad_lacp.h#2 integrate .. //depot/projects/uart/net/if.c#28 integrate .. //depot/projects/uart/net/if_ethersubr.c#23 integrate .. //depot/projects/uart/net/if_lagg.c#1 branch .. //depot/projects/uart/net/if_lagg.h#1 branch .. //depot/projects/uart/net/if_trunk.c#2 delete .. //depot/projects/uart/net/if_trunk.h#2 delete .. //depot/projects/uart/net/if_var.h#16 integrate .. //depot/projects/uart/netgraph/ng_ppp.c#7 integrate .. //depot/projects/uart/netinet/ip_fw2.c#31 integrate .. //depot/projects/uart/netinet/sctp_constants.h#5 integrate .. //depot/projects/uart/netinet/sctp_crc32.c#3 integrate .. //depot/projects/uart/netinet/sctp_indata.c#5 integrate .. //depot/projects/uart/netinet/sctp_input.c#5 integrate .. //depot/projects/uart/netinet/sctp_lock_bsd.h#3 integrate .. //depot/projects/uart/netinet/sctp_output.c#5 integrate .. //depot/projects/uart/netinet/sctp_pcb.c#5 integrate .. //depot/projects/uart/netinet/sctp_peeloff.c#3 integrate .. //depot/projects/uart/netinet/sctp_structs.h#4 integrate .. //depot/projects/uart/netinet/sctp_timer.c#4 integrate .. //depot/projects/uart/netinet/sctp_uio.h#5 integrate .. //depot/projects/uart/netinet/sctp_usrreq.c#5 integrate .. //depot/projects/uart/netinet/sctp_var.h#3 integrate .. //depot/projects/uart/netinet/sctputil.c#5 integrate .. //depot/projects/uart/netinet/sctputil.h#3 integrate .. //depot/projects/uart/netinet/tcp.h#10 integrate .. //depot/projects/uart/netinet/tcp_input.c#33 integrate .. //depot/projects/uart/netinet/tcp_output.c#15 integrate .. //depot/projects/uart/netinet/tcp_subr.c#28 integrate .. //depot/projects/uart/netinet/tcp_syncache.c#22 integrate .. //depot/projects/uart/netinet/tcp_var.h#18 integrate .. //depot/projects/uart/netinet6/sctp6_usrreq.c#5 integrate .. //depot/projects/uart/netnatm/natm.h#6 integrate .. //depot/projects/uart/nfsserver/nfs_srvsock.c#13 integrate .. //depot/projects/uart/pci/if_rlreg.h#20 integrate .. //depot/projects/uart/pci/if_vr.c#13 integrate .. //depot/projects/uart/pci/if_vrreg.h#8 integrate .. //depot/projects/uart/pci/intpm.c#8 integrate .. //depot/projects/uart/pci/ncr.c#12 integrate .. //depot/projects/uart/powerpc/powerpc/nexus.c#5 integrate .. //depot/projects/uart/security/audit/audit_bsm_token.c#8 integrate .. //depot/projects/uart/sparc64/include/vmparam.h#2 integrate .. //depot/projects/uart/sun4v/include/vmparam.h#2 integrate .. //depot/projects/uart/sys/interrupt.h#8 integrate .. //depot/projects/uart/sys/mbuf.h#19 integrate .. //depot/projects/uart/sys/mount.h#24 integrate .. //depot/projects/uart/sys/priv.h#4 integrate .. //depot/projects/uart/sys/proc.h#29 integrate .. //depot/projects/uart/sys/socket.h#9 integrate .. //depot/projects/uart/vm/vm_contig.c#20 integrate .. //depot/projects/uart/vm/vm_param.h#5 integrate Differences ... ==== //depot/projects/uart/Makefile#12 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/Makefile,v 1.41 2007/03/24 22:21:01 maxim Exp $ +# $FreeBSD: src/sys/Makefile,v 1.42 2007/04/14 16:29:15 maxim Exp $ .include @@ -8,10 +8,10 @@ .endif # Directories to include in cscope name file and TAGS. -CSCOPEDIRS= cam coda compat conf contrib crypto ddb dev fs geom gnu i4b \ - isa kern libkern modules net net80211 netatalk netatm \ +CSCOPEDIRS= bsm cam coda compat conf contrib crypto ddb dev fs geom gnu \ + i4b isa kern libkern modules net net80211 netatalk netatm \ netgraph netinet netinet6 netipx netkey netnatm netncp \ - netsmb nfs nfsclient nfs4client rpc pccard pci sys \ + netsmb nfs nfsclient nfs4client rpc pccard pci security sys \ ufs vm ${ARCHDIR} ARCHDIR ?= ${MACHINE} ==== //depot/projects/uart/amd64/amd64/busdma_machdep.c#18 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/busdma_machdep.c,v 1.79 2007/03/06 18:28:42 scottl Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/busdma_machdep.c,v 1.80 2007/04/17 21:05:34 jhb Exp $"); #include #include @@ -48,6 +48,7 @@ #include #include #include +#include #define MAX_BPAGES 8192 @@ -522,6 +523,9 @@ } else if ((uintptr_t)*vaddr & (dmat->alignment - 1)) { printf("bus_dmamem_alloc failed to align memory properly.\n"); } + if (flags & BUS_DMA_NOCACHE) + pmap_change_attr((vm_offset_t)*vaddr, dmat->maxsize, + PAT_UNCACHEABLE); CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", __func__, dmat, dmat->flags, ENOMEM); return (0); @@ -540,6 +544,7 @@ */ if (map != NULL) panic("bus_dmamem_free: Invalid map freed\n"); + pmap_change_attr((vm_offset_t)vaddr, dmat->maxsize, PAT_WRITE_BACK); if ((dmat->maxsize <= PAGE_SIZE) && (dmat->alignment < dmat->maxsize) && dmat->lowaddr >= ptoa((vm_paddr_t)Maxmem)) ==== //depot/projects/uart/amd64/include/vmparam.h#5 (text+ko) ==== @@ -38,7 +38,7 @@ * SUCH DAMAGE. * * from: @(#)vmparam.h 5.9 (Berkeley) 5/12/91 - * $FreeBSD: src/sys/amd64/include/vmparam.h,v 1.45 2004/10/27 17:21:15 peter Exp $ + * $FreeBSD: src/sys/amd64/include/vmparam.h,v 1.46 2007/04/21 01:14:47 sepotvin Exp $ */ @@ -122,7 +122,8 @@ /* * How many physical pages per KVA page allocated. - * min(max(VM_KMEM_SIZE, Physical memory/VM_KMEM_SIZE_SCALE), VM_KMEM_SIZE_MAX) + * min(max(max(VM_KMEM_SIZE, Physical memory/VM_KMEM_SIZE_SCALE), + * VM_KMEM_SIZE_MIN), VM_KMEM_SIZE_MAX) * is the total KVA space allocated for kmem_map. */ #ifndef VM_KMEM_SIZE_SCALE ==== //depot/projects/uart/amd64/linux32/linux32_dummy.c#8 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_dummy.c,v 1.8 2007/03/29 02:11:46 julian Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_dummy.c,v 1.9 2007/04/18 18:08:12 jkim Exp $"); #include #include @@ -64,7 +64,6 @@ DUMMY(mincore); DUMMY(fadvise64); DUMMY(ptrace); -DUMMY(settimeofday); DUMMY(lookup_dcookie); DUMMY(epoll_create); DUMMY(epoll_ctl); ==== //depot/projects/uart/amd64/linux32/linux32_machdep.c#11 (text+ko) ==== @@ -29,7 +29,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_machdep.c,v 1.39 2007/03/30 17:27:13 jkim Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_machdep.c,v 1.42 2007/04/18 20:12:05 jkim Exp $"); #include #include @@ -252,7 +252,7 @@ if (iovcnt > UIO_MAXIOV) return (EINVAL); iovlen = iovcnt * sizeof(struct iovec); - uio = malloc(iovlen + sizeof *uio, M_IOV, M_WAITOK); + uio = malloc(iovlen + sizeof(*uio), M_IOV, M_WAITOK); iov = (struct iovec *)(uio + 1); for (i = 0; i < iovcnt; i++) { error = copyin(&iovp[i], &iov32, sizeof(struct iovec32)); @@ -526,7 +526,9 @@ td2 = FIRST_THREAD_IN_PROC(p2); - /* make it run */ + /* + * Make this runnable after we are finished with it. + */ mtx_lock_spin(&sched_lock); TD_SET_CAN_RUN(td2); sched_add(td2, SRQ_BORING); @@ -572,8 +574,8 @@ /* * XXX: In Linux, sharing of fs info (chroot/cwd/umask) * and open files is independant. In FreeBSD, its in one - * structure but in reality it does not make any problems - * because both of these flags are set at once usually. + * structure but in reality it does not cause any problems + * because both of these flags are usually set together. */ if (!(args->flags & (LINUX_CLONE_FILES | LINUX_CLONE_FS))) ff |= RFFDG; @@ -660,15 +662,15 @@ if (args->flags & LINUX_CLONE_SETTLS) { struct user_segment_descriptor sd; struct l_user_desc info; - int a[2]; + int a[2]; - error = copyin((void *)td->td_frame->tf_rsi, &info, + error = copyin((void *)td->td_frame->tf_rsi, &info, sizeof(struct l_user_desc)); if (error) { printf(LMSG("copyin failed!")); } else { /* We might copy out the entry_number as GUGS32_SEL. */ - info.entry_number = GUGS32_SEL; + info.entry_number = GUGS32_SEL; error = copyout(&info, (void *)td->td_frame->tf_rsi, sizeof(struct l_user_desc)); if (error) @@ -871,7 +873,7 @@ * * Our mmap with MAP_STACK takes addr as the maximum * downsize limit on BOS, and as len the max size of - * the region. It them maps the top SGROWSIZ bytes, + * the region. It then maps the top SGROWSIZ bytes, * and auto grows the region down, up to the limit * in addr. * @@ -1167,17 +1169,44 @@ microtime(&atv); atv32.tv_sec = atv.tv_sec; atv32.tv_usec = atv.tv_usec; - error = copyout(&atv32, uap->tp, sizeof (atv32)); + error = copyout(&atv32, uap->tp, sizeof(atv32)); } if (error == 0 && uap->tzp != NULL) { rtz.tz_minuteswest = tz_minuteswest; rtz.tz_dsttime = tz_dsttime; - error = copyout(&rtz, uap->tzp, sizeof (rtz)); + error = copyout(&rtz, uap->tzp, sizeof(rtz)); } return (error); } int +linux_settimeofday(struct thread *td, struct linux_settimeofday_args *uap) +{ + l_timeval atv32; + struct timeval atv, *tvp; + struct timezone atz, *tzp; + int error; + + if (uap->tp) { + error = copyin(uap->tp, &atv32, sizeof(atv32)); + if (error) + return (error); + atv.tv_sec = atv32.tv_sec; + atv.tv_usec = atv32.tv_usec; + tvp = &atv; + } else + tvp = NULL; + if (uap->tzp) { + error = copyin(uap->tzp, &atz, sizeof(atz)); + if (error) + return (error); + tzp = &atz; + } else + tzp = NULL; + return (kern_settimeofday(td, tvp, tzp)); +} + +int linux_getrusage(struct thread *td, struct linux_getrusage_args *uap) { struct l_rusage s32; @@ -1242,7 +1271,7 @@ #ifdef DEBUG if (ldebug(set_thread_area)) - printf(ARGS(set_thread_area, "%i, %x, %x, %i, %i, %i, " + printf(ARGS(set_thread_area, "%i, %x, %x, %i, %i, %i, " "%i, %i, %i"), info.entry_number, info.base_addr, info.limit, info.seg_32bit, info.contents, info.read_exec_only, info.limit_in_pages, @@ -1261,9 +1290,10 @@ * The tls_array[] is used only in [gs]et_thread_area() syscalls and * for loading the GDT descriptors. We use just one GDT descriptor * for TLS, so we will load just one. - * XXX: This doesnt work when user-space process tries to use more + * + * XXX: This doesn't work when a user space process tries to use more * than one TLS segment. Comment in the Linux source says wine might - * do that. + * do this. */ /* @@ -1284,8 +1314,9 @@ /* * We have to copy out the GDT entry we use. - * XXX: What if userspace program does not check return value and - * tries to use 6, 7 or 8? + * + * XXX: What if a user space program does not check the return value + * and tries to use 6, 7 or 8? */ error = copyout(&info, args->desc, sizeof(struct l_user_desc)); if (error) ==== //depot/projects/uart/bsm/audit.h#7 (text+ko) ==== @@ -30,8 +30,8 @@ * * @APPLE_BSD_LICENSE_HEADER_END@ * - * $P4: //depot/projects/uart/bsm/audit.h#6 $ - * $FreeBSD: src/sys/bsm/audit.h,v 1.6 2006/09/21 07:27:02 rwatson Exp $ + * P4: //depot/projects/trustedbsd/audit3/sys/bsm/audit.h#36 + * $FreeBSD: src/sys/bsm/audit.h,v 1.8 2007/04/17 12:27:08 rwatson Exp $ */ #ifndef _BSM_AUDIT_H ==== //depot/projects/uart/bsm/audit_internal.h#5 (text) ==== @@ -34,8 +34,8 @@ * * @APPLE_BSD_LICENSE_HEADER_END@ * - * $P4: //depot/projects/trustedbsd/audit3/sys/bsm/audit_internal.h#14 $ - * $FreeBSD: src/sys/bsm/audit_internal.h,v 1.5 2006/09/21 07:27:02 rwatson Exp $ + * P4: //depot/projects/trustedbsd/audit3/sys/bsm/audit_internal.h#16 + * $FreeBSD: src/sys/bsm/audit_internal.h,v 1.7 2007/04/17 12:27:08 rwatson Exp $ */ #ifndef _AUDIT_INTERNAL_H ==== //depot/projects/uart/bsm/audit_kevents.h#7 (text+ko) ==== @@ -30,8 +30,8 @@ * * @APPLE_BSD_LICENSE_HEADER_END@ * - * $P4: //depot/projects/uart/bsm/audit_kevents.h#6 $ - * $FreeBSD: src/sys/bsm/audit_kevents.h,v 1.9 2006/09/25 12:22:07 rwatson Exp $ + * P4: //depot/projects/trustedbsd/audit3/sys/bsm/audit_kevents.h#32 + * $FreeBSD: src/sys/bsm/audit_kevents.h,v 1.11 2007/04/17 12:27:08 rwatson Exp $ */ #ifndef _BSM_AUDIT_KEVENTS_H_ @@ -475,6 +475,28 @@ #define AUE_READDIR 43118 /* Linux. */ #define AUE_IOPL 43119 /* Linux. */ #define AUE_VM86 43120 /* Linux. */ +#define AUE_MAC_GET_PROC 43121 /* FreeBSD. */ +#define AUE_MAC_SET_PROC 43122 /* FreeBSD. */ +#define AUE_MAC_GET_FD 43123 /* FreeBSD. */ +#define AUE_MAC_GET_FILE 43124 /* FreeBSD. */ +#define AUE_MAC_SET_FD 43125 /* FreeBSD. */ +#define AUE_MAC_SET_FILE 43126 /* FreeBSD. */ +#define AUE_MAC_SYSCALL 43127 /* FreeBSD. */ +#define AUE_MAC_GET_PID 43128 /* FreeBSD. */ +#define AUE_MAC_GET_LINK 43129 /* FreeBSD. */ +#define AUE_MAC_SET_LINK 43130 /* FreeBSD. */ +#define AUE_MAC_EXECVE 43131 /* FreeBSD. */ +#define AUE_GETPATH_FROMFD 43132 /* FreeBSD. */ +#define AUE_GETPATH_FROMADDR 43133 /* FreeBSD. */ +#define AUE_MQ_OPEN 43134 /* FreeBSD. */ +#define AUE_MQ_SETATTR 43135 /* FreeBSD. */ +#define AUE_MQ_TIMEDRECEIVE 43136 /* FreeBSD. */ +#define AUE_MQ_TIMEDSEND 43137 /* FreeBSD. */ +#define AUE_MQ_NOTIFY 43138 /* FreeBSD. */ +#define AUE_MQ_UNLINK 43139 /* FreeBSD. */ +#define AUE_LISTEN 43140 /* FreeBSD/Darwin/Linux. */ +#define AUE_MLOCKALL 43141 /* FreeBSD. */ +#define AUE_MUNLOCKALL 43142 /* FreeBSD. */ /* * Darwin BSM uses a number of AUE_O_* definitions, which are aliased to the @@ -572,16 +594,13 @@ #define AUE_GETSOCKOPT AUE_NULL #define AUE_GTSOCKOPT AUE_GETSOCKOPT /* XXX: Typo in Darwin. */ #define AUE_ISSETUGID AUE_NULL -#define AUE_LISTEN AUE_NULL #define AUE_LSTATV AUE_NULL #define AUE_MADVISE AUE_NULL #define AUE_MINCORE AUE_NULL #define AUE_MKCOMPLEX AUE_NULL -#define AUE_MLOCKALL AUE_NULL #define AUE_MODWATCH AUE_NULL #define AUE_MSGCL AUE_NULL #define AUE_MSYNC AUE_NULL -#define AUE_MUNLOCKALL AUE_NULL #define AUE_PREAD AUE_NULL #define AUE_PWRITE AUE_NULL #define AUE_PREADV AUE_NULL ==== //depot/projects/uart/bsm/audit_record.h#6 (text) ==== @@ -30,8 +30,8 @@ * * @APPLE_BSD_LICENSE_HEADER_END@ * - * $P4: //depot/projects/trustedbsd/audit3/sys/bsm/audit_record.h#21 $ - * $FreeBSD: src/sys/bsm/audit_record.h,v 1.6 2006/09/21 07:27:02 rwatson Exp $ + * P4: //depot/projects/trustedbsd/audit3/sys/bsm/audit_record.h#24 + * $FreeBSD: src/sys/bsm/audit_record.h,v 1.9 2007/04/17 12:27:08 rwatson Exp $ */ #ifndef _BSM_AUDIT_RECORD_H_ @@ -86,6 +86,7 @@ /* XXXRW: Additional X11 tokens not defined? */ #define AUT_CMD 0x51 #define AUT_EXIT 0x52 +#define AUT_ZONENAME 0x60 /* XXXRW: OpenBSM AUT_HOST 0x70? */ #define AUT_ARG64 0x71 #define AUT_RETURN64 0x72 @@ -247,6 +248,8 @@ token_t *au_to_header32_tm(int rec_size, au_event_t e_type, au_emod_t e_mod, struct timeval tm); +token_t *au_to_header64_tm(int rec_size, au_event_t e_type, au_emod_t e_mod, + struct timeval tm); #if !defined(KERNEL) && !defined(_KERNEL) token_t *au_to_header(int rec_size, au_event_t e_type, au_emod_t e_mod); token_t *au_to_header32(int rec_size, au_event_t e_type, au_emod_t e_mod); @@ -329,6 +332,7 @@ token_t *au_to_text(char *text); token_t *au_to_kevent(struct kevent *kev); token_t *au_to_trailer(int rec_size); +token_t *au_to_zonename(char *zonename); __END_DECLS ==== //depot/projects/uart/cam/cam_ccb.h#10 (text+ko) ==== @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/cam/cam_ccb.h,v 1.34 2006/12/03 07:19:28 mjacob Exp $ + * $FreeBSD: src/sys/cam/cam_ccb.h,v 1.35 2007/04/15 08:49:09 scottl Exp $ */ #ifndef _CAM_CAM_CCB_H @@ -242,8 +242,7 @@ typedef union { void *ptr; u_long field; - u_int8_t bytes[sizeof(void *) > sizeof(u_long) - ? sizeof(void *) : sizeof(u_long)]; + u_int8_t bytes[sizeof(uintptr_t)]; } ccb_priv_entry; typedef union { @@ -274,8 +273,12 @@ ccb_ppriv_area periph_priv; ccb_spriv_area sim_priv; u_int32_t timeout; /* Timeout value */ + + /* + * Deprecated, only for use by non-MPSAFE SIMs. All others must + * allocate and initialize their own callout storage. + */ struct callout_handle timeout_ch; - /* Callout handle used for timeouts */ }; /* Get Device Information CCB */ ==== //depot/projects/uart/cam/cam_periph.c#13 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/cam/cam_periph.c,v 1.64 2006/12/05 07:45:27 mjacob Exp $"); +__FBSDID("$FreeBSD: src/sys/cam/cam_periph.c,v 1.68 2007/04/19 23:34:51 scottl Exp $"); #include #include @@ -51,6 +51,7 @@ #include #include #include +#include #include #include @@ -122,6 +123,7 @@ ac_callback_t *ac_callback, ac_code code, void *arg) { struct periph_driver **p_drv; + struct cam_sim *sim; struct cam_periph *periph; struct cam_periph *cur_periph; path_id_t path_id; @@ -129,7 +131,6 @@ lun_id_t lun_id; cam_status status; u_int init_level; - int s; init_level = 0; /* @@ -163,11 +164,14 @@ init_level++; + xpt_lock_buses(); for (p_drv = periph_drivers; *p_drv != NULL; p_drv++) { if (strcmp((*p_drv)->driver_name, name) == 0) break; } - + xpt_unlock_buses(); + + sim = xpt_path_sim(path); path_id = xpt_path_path_id(path); target_id = xpt_path_target_id(path); lun_id = xpt_path_lun_id(path); @@ -181,6 +185,7 @@ periph->unit_number = camperiphunit(*p_drv, path_id, target_id, lun_id); periph->immediate_priority = CAM_PRIORITY_NONE; periph->refcount = 0; + periph->sim = sim; SLIST_INIT(&periph->ccb_list); status = xpt_create_path(&path, periph, path_id, target_id, lun_id); if (status != CAM_REQ_CMP) @@ -194,7 +199,6 @@ if (status != CAM_REQ_CMP) goto failure; - s = splsoftcam(); cur_periph = TAILQ_FIRST(&(*p_drv)->units); while (cur_periph != NULL && cur_periph->unit_number < periph->unit_number) @@ -207,8 +211,6 @@ (*p_drv)->generation++; } - splx(s); - init_level++; status = periph_ctor(periph, arg); @@ -222,9 +224,7 @@ /* Initialized successfully */ break; case 3: - s = splsoftcam(); TAILQ_REMOVE(&(*p_drv)->units, periph, unit_links); - splx(s); xpt_remove_periph(periph); /* FALLTHROUGH */ case 2: @@ -252,38 +252,38 @@ { struct periph_driver **p_drv; struct cam_periph *periph; - int s; + xpt_lock_buses(); for (p_drv = periph_drivers; *p_drv != NULL; p_drv++) { if (name != NULL && (strcmp((*p_drv)->driver_name, name) != 0)) continue; - s = splsoftcam(); TAILQ_FOREACH(periph, &(*p_drv)->units, unit_links) { if (xpt_path_comp(periph->path, path) == 0) { - splx(s); + xpt_unlock_buses(); return(periph); } } - splx(s); - if (name != NULL) + if (name != NULL) { + xpt_unlock_buses(); return(NULL); + } } + xpt_unlock_buses(); return(NULL); } cam_status cam_periph_acquire(struct cam_periph *periph) { - int s; if (periph == NULL) return(CAM_REQ_CMP_ERR); - s = splsoftcam(); + xpt_lock_buses(); periph->refcount++; - splx(s); + xpt_unlock_buses(); return(CAM_REQ_CMP); } @@ -291,18 +291,66 @@ void cam_periph_release(struct cam_periph *periph) { - int s; if (periph == NULL) return; - s = splsoftcam(); + xpt_lock_buses(); if ((--periph->refcount == 0) && (periph->flags & CAM_PERIPH_INVALID)) { camperiphfree(periph); } - splx(s); + xpt_unlock_buses(); + +} + +int +cam_periph_hold(struct cam_periph *periph, int priority) +{ + struct mtx *mtx; + int error; + + mtx_assert(periph->sim->mtx, MA_OWNED); + + /* + * Increment the reference count on the peripheral + * while we wait for our lock attempt to succeed + * to ensure the peripheral doesn't disappear out + * from user us while we sleep. + */ + + if (cam_periph_acquire(periph) != CAM_REQ_CMP) + return (ENXIO); + + mtx = periph->sim->mtx; + if (mtx == &Giant) + mtx = NULL; + + while ((periph->flags & CAM_PERIPH_LOCKED) != 0) { + periph->flags |= CAM_PERIPH_LOCK_WANTED; + if ((error = msleep(periph, mtx, priority, "caplck", 0)) != 0) { + cam_periph_release(periph); + return (error); + } + } + + periph->flags |= CAM_PERIPH_LOCKED; + return (0); +} + +void +cam_periph_unhold(struct cam_periph *periph) +{ + + mtx_assert(periph->sim->mtx, MA_OWNED); + + periph->flags &= ~CAM_PERIPH_LOCKED; + if ((periph->flags & CAM_PERIPH_LOCK_WANTED) != 0) { + periph->flags &= ~CAM_PERIPH_LOCK_WANTED; + wakeup(periph); + } + cam_periph_release(periph); } /* @@ -319,11 +367,9 @@ { struct cam_periph *periph; char *periph_name; - int s; int i, val, dunit, r; const char *dname, *strval; - s = splsoftcam(); periph_name = p_drv->driver_name; for (;;newunit++) { @@ -369,7 +415,6 @@ if (r != 0) break; } - splx(s); return (newunit); } @@ -424,13 +469,10 @@ void cam_periph_invalidate(struct cam_periph *periph) { - int s; - s = splsoftcam(); /* * We only call this routine the first time a peripheral is - * invalidated. The oninvalidate() routine is always called at - * splsoftcam(). + * invalidated. */ if (((periph->flags & CAM_PERIPH_INVALID) == 0) && (periph->periph_oninval != NULL)) @@ -439,17 +481,17 @@ periph->flags |= CAM_PERIPH_INVALID; periph->flags &= ~CAM_PERIPH_NEW_DEV_FOUND; + xpt_lock_buses(); if (periph->refcount == 0) camperiphfree(periph); else if (periph->refcount < 0) printf("cam_invalidate_periph: refcount < 0!!\n"); - splx(s); + xpt_unlock_buses(); } static void camperiphfree(struct cam_periph *periph) { - int s; struct periph_driver **p_drv; for (p_drv = periph_drivers; *p_drv != NULL; p_drv++) { @@ -460,15 +502,13 @@ printf("camperiphfree: attempt to free non-existant periph\n"); return; } - - if (periph->periph_dtor != NULL) - periph->periph_dtor(periph); - - s = splsoftcam(); + TAILQ_REMOVE(&(*p_drv)->units, periph, unit_links); (*p_drv)->generation++; - splx(s); + xpt_unlock_buses(); + if (periph->periph_dtor != NULL) + periph->periph_dtor(periph); xpt_remove_periph(periph); if (periph->flags & CAM_PERIPH_NEW_DEV_FOUND) { @@ -497,53 +537,10 @@ } xpt_free_path(periph->path); free(periph, M_CAMPERIPH); + xpt_lock_buses(); } /* - * Wait interruptibly for an exclusive lock. - */ -int -cam_periph_lock(struct cam_periph *periph, int priority) -{ - int error; - - /* - * Increment the reference count on the peripheral - * while we wait for our lock attempt to succeed - * to ensure the peripheral doesn't disappear out - * from under us while we sleep. - */ - if (cam_periph_acquire(periph) != CAM_REQ_CMP) - return(ENXIO); - - while ((periph->flags & CAM_PERIPH_LOCKED) != 0) { - periph->flags |= CAM_PERIPH_LOCK_WANTED; - if ((error = tsleep(periph, priority, "caplck", 0)) != 0) { - cam_periph_release(periph); - return error; - } - } - - periph->flags |= CAM_PERIPH_LOCKED; - return 0; -} - -/* - * Unlock and wake up any waiters. - */ -void -cam_periph_unlock(struct cam_periph *periph) -{ - periph->flags &= ~CAM_PERIPH_LOCKED; - if ((periph->flags & CAM_PERIPH_LOCK_WANTED) != 0) { - periph->flags &= ~CAM_PERIPH_LOCK_WANTED; - wakeup(periph); - } - - cam_periph_release(periph); -} - -/* * Map user virtual pointers into kernel virtual address space, so we can * access the memory. This won't work on physical pointers, for now it's * up to the caller to check for that. (XXX KDM -- should we do that here @@ -752,12 +749,11 @@ cam_periph_getccb(struct cam_periph *periph, u_int32_t priority) { struct ccb_hdr *ccb_h; - int s; + struct mtx *mtx; + mtx_assert(periph->sim->mtx, MA_OWNED); CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("entering cdgetccb\n")); - s = splsoftcam(); - while (SLIST_FIRST(&periph->ccb_list) == NULL) { if (periph->immediate_priority > priority) periph->immediate_priority = priority; @@ -765,26 +761,33 @@ if ((SLIST_FIRST(&periph->ccb_list) != NULL) && (SLIST_FIRST(&periph->ccb_list)->pinfo.priority == priority)) break; - tsleep(&periph->ccb_list, PRIBIO, "cgticb", 0); + mtx_assert(periph->sim->mtx, MA_OWNED); + if (periph->sim->mtx == &Giant) + mtx = NULL; + else >>> TRUNCATED FOR MAIL (1000 lines) <<<