svn commit: r205456 - in projects/altix/sys: amd64/acpica
amd64/amd64 amd64/include arm/arm arm/conf arm/s3c2xx0
cam/scsi cddl/contrib/opensolaris/uts/common/fs/zfs
compat/freebsd32 compat/linux co...
Marcel Moolenaar
marcel at FreeBSD.org
Mon Mar 22 18:50:57 UTC 2010
Author: marcel
Date: Mon Mar 22 18:50:57 2010
New Revision: 205456
URL: http://svn.freebsd.org/changeset/base/205456
Log:
Merge svn+ssh://svn.freebsd.org/base/head@205454
Added:
projects/altix/sys/arm/conf/LN2410SBC
- copied unchanged from r205454, head/sys/arm/conf/LN2410SBC
projects/altix/sys/arm/s3c2xx0/
- copied from r205454, head/sys/arm/s3c2xx0/
projects/altix/sys/dev/usb/controller/ohci_s3c24x0.c
- copied unchanged from r205454, head/sys/dev/usb/controller/ohci_s3c24x0.c
projects/altix/sys/netinet/ipfw/dn_sched_prio.c
- copied unchanged from r205454, head/sys/netinet/ipfw/dn_sched_prio.c
Modified:
projects/altix/sys/amd64/acpica/acpi_machdep.c
projects/altix/sys/amd64/amd64/mca.c
projects/altix/sys/amd64/amd64/pmap.c
projects/altix/sys/amd64/include/specialreg.h
projects/altix/sys/arm/arm/pmap.c
projects/altix/sys/cam/scsi/scsi_sg.c
projects/altix/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
projects/altix/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
projects/altix/sys/compat/freebsd32/freebsd32.h
projects/altix/sys/compat/freebsd32/freebsd32_ipc.h
projects/altix/sys/compat/freebsd32/freebsd32_misc.c
projects/altix/sys/compat/freebsd32/freebsd32_proto.h
projects/altix/sys/compat/freebsd32/freebsd32_syscall.h
projects/altix/sys/compat/freebsd32/freebsd32_syscalls.c
projects/altix/sys/compat/freebsd32/freebsd32_sysent.c
projects/altix/sys/compat/freebsd32/freebsd32_util.h
projects/altix/sys/compat/freebsd32/syscalls.master
projects/altix/sys/compat/linux/linux_file.c
projects/altix/sys/compat/x86bios/x86bios.c
projects/altix/sys/conf/NOTES
projects/altix/sys/conf/files
projects/altix/sys/dev/ahci/ahci.c
projects/altix/sys/dev/bce/if_bce.c
projects/altix/sys/dev/bce/if_bcefw.h
projects/altix/sys/dev/bce/if_bcereg.h
projects/altix/sys/dev/isp/isp_freebsd.c
projects/altix/sys/dev/isp/isp_freebsd.h
projects/altix/sys/dev/isp/isp_pci.c
projects/altix/sys/dev/isp/isp_sbus.c
projects/altix/sys/dev/mii/brgphy.c
projects/altix/sys/dev/mii/brgphyreg.h
projects/altix/sys/dev/mii/mii.c
projects/altix/sys/dev/mii/miidevs
projects/altix/sys/dev/mxge/if_mxge.c
projects/altix/sys/dev/siis/siis.c
projects/altix/sys/dev/sound/pci/hda/hdac.c
projects/altix/sys/geom/gate/g_gate.c
projects/altix/sys/geom/geom_dump.c
projects/altix/sys/geom/multipath/g_multipath.c
projects/altix/sys/i386/acpica/acpi_machdep.c
projects/altix/sys/i386/i386/pmap.c
projects/altix/sys/i386/i386/trap.c
projects/altix/sys/i386/include/specialreg.h
projects/altix/sys/ia64/ia64/clock.c
projects/altix/sys/ia64/ia64/db_machdep.c
projects/altix/sys/ia64/ia64/exception.S
projects/altix/sys/ia64/ia64/highfp.c
projects/altix/sys/ia64/ia64/interrupt.c
projects/altix/sys/ia64/ia64/machdep.c
projects/altix/sys/ia64/ia64/mp_machdep.c
projects/altix/sys/ia64/ia64/pmap.c
projects/altix/sys/ia64/include/frame.h
projects/altix/sys/ia64/include/pcb.h
projects/altix/sys/ia64/include/pcpu.h
projects/altix/sys/ia64/pci/pci_cfgreg.c
projects/altix/sys/kern/kern_syscalls.c
projects/altix/sys/kern/subr_eventhandler.c
projects/altix/sys/kern/sysv_ipc.c
projects/altix/sys/kern/sysv_msg.c
projects/altix/sys/kern/sysv_sem.c
projects/altix/sys/kern/sysv_shm.c
projects/altix/sys/kern/uipc_mqueue.c
projects/altix/sys/kern/uipc_sem.c
projects/altix/sys/kern/uipc_syscalls.c
projects/altix/sys/kern/vfs_aio.c
projects/altix/sys/kern/vfs_syscalls.c
projects/altix/sys/kern/vfs_vnops.c
projects/altix/sys/mips/include/clock.h
projects/altix/sys/mips/include/db_machdep.h
projects/altix/sys/mips/include/trap.h
projects/altix/sys/mips/mips/db_trace.c
projects/altix/sys/mips/mips/exception.S
projects/altix/sys/mips/mips/nexus.c
projects/altix/sys/mips/mips/pmap.c
projects/altix/sys/mips/mips/tick.c
projects/altix/sys/mips/mips/trap.c
projects/altix/sys/mips/sibyte/sb_asm.S
projects/altix/sys/mips/sibyte/sb_machdep.c
projects/altix/sys/mips/sibyte/sb_scd.c
projects/altix/sys/mips/sibyte/sb_scd.h
projects/altix/sys/net/if_llatbl.c
projects/altix/sys/net/if_vlan.c
projects/altix/sys/net/vnet.c
projects/altix/sys/net/vnet.h
projects/altix/sys/net80211/ieee80211_adhoc.c
projects/altix/sys/net80211/ieee80211_ht.c
projects/altix/sys/net80211/ieee80211_mesh.c
projects/altix/sys/net80211/ieee80211_sta.c
projects/altix/sys/netinet/ip_divert.c
projects/altix/sys/netinet/ipfw/dn_sched.h
projects/altix/sys/netinet/ipfw/ip_fw_private.h
projects/altix/sys/netinet/ipfw/ip_fw_table.c
projects/altix/sys/netinet/ipfw/test/Makefile
projects/altix/sys/netinet/raw_ip.c
projects/altix/sys/netinet/tcp_subr.c
projects/altix/sys/netinet/tcp_timer.c
projects/altix/sys/netinet/udp_usrreq.c
projects/altix/sys/powerpc/aim/mmu_oea64.c
projects/altix/sys/powerpc/powermac/uninorth.c
projects/altix/sys/sparc64/include/dcr.h
projects/altix/sys/sparc64/include/tlb.h
projects/altix/sys/sparc64/include/tte.h
projects/altix/sys/sparc64/include/ver.h
projects/altix/sys/sparc64/include/wstate.h
projects/altix/sys/sparc64/pci/schizo.c
projects/altix/sys/sparc64/pci/schizovar.h
projects/altix/sys/sparc64/sparc64/cheetah.c
projects/altix/sys/sparc64/sparc64/exception.S
projects/altix/sys/sparc64/sparc64/genassym.c
projects/altix/sys/sparc64/sparc64/locore.S
projects/altix/sys/sparc64/sparc64/machdep.c
projects/altix/sys/sparc64/sparc64/pmap.c
projects/altix/sys/sparc64/sparc64/support.S
projects/altix/sys/sparc64/sparc64/swtch.S
projects/altix/sys/sys/eventhandler.h
projects/altix/sys/sys/sysent.h
projects/altix/sys/vm/uma_int.h
Directory Properties:
projects/altix/sys/ (props changed)
Modified: projects/altix/sys/amd64/acpica/acpi_machdep.c
==============================================================================
--- projects/altix/sys/amd64/acpica/acpi_machdep.c Mon Mar 22 18:43:36 2010 (r205455)
+++ projects/altix/sys/amd64/acpica/acpi_machdep.c Mon Mar 22 18:50:57 2010 (r205456)
@@ -627,8 +627,10 @@ map_table(vm_paddr_t pa, int offset, con
if (ACPI_FAILURE(AcpiTbChecksum(table, length))) {
if (bootverbose)
printf("ACPI: Failed checksum for table %s\n", sig);
+#if (ACPI_CHECKSUM_ABORT)
table_unmap(table, length);
return (NULL);
+#endif
}
return (table);
}
Modified: projects/altix/sys/amd64/amd64/mca.c
==============================================================================
--- projects/altix/sys/amd64/amd64/mca.c Mon Mar 22 18:43:36 2010 (r205455)
+++ projects/altix/sys/amd64/amd64/mca.c Mon Mar 22 18:50:57 2010 (r205456)
@@ -565,19 +565,16 @@ mca_init(void)
/*
* Disable logging of level one TLB parity (L1TP) errors by
- * the data and instruction caches as an alternative
- * workaround for AMD Family 10h Erratum 383. Unlike the
- * recommended workaround, there is no performance penalty to
- * this workaround. However, L1TP errors will go unreported.
+ * the data cache as an alternative workaround for AMD Family
+ * 10h Erratum 383. Unlike the recommended workaround, there
+ * is no performance penalty to this workaround. However,
+ * L1TP errors will go unreported.
*/
if (cpu_vendor_id == CPU_VENDOR_AMD &&
CPUID_TO_FAMILY(cpu_id) == 0x10 && !amd10h_L1TP) {
mask = rdmsr(MSR_MC0_CTL_MASK);
if ((mask & (1UL << 5)) == 0)
wrmsr(MSR_MC0_CTL_MASK, mask | (1UL << 5));
- mask = rdmsr(MSR_MC1_CTL_MASK);
- if ((mask & (1UL << 5)) == 0)
- wrmsr(MSR_MC1_CTL_MASK, mask | (1UL << 5));
}
for (i = 0; i < (mcg_cap & MCG_CAP_COUNT); i++) {
/* By default enable logging of all errors. */
Modified: projects/altix/sys/amd64/amd64/pmap.c
==============================================================================
--- projects/altix/sys/amd64/amd64/pmap.c Mon Mar 22 18:43:36 2010 (r205455)
+++ projects/altix/sys/amd64/amd64/pmap.c Mon Mar 22 18:50:57 2010 (r205456)
@@ -576,8 +576,6 @@ pmap_bootstrap(vm_paddr_t *firstaddr)
virtual_avail = va;
- invltlb();
-
/* Initialize the PAT MSR. */
pmap_init_pat();
}
@@ -1123,7 +1121,7 @@ pmap_invalidate_cache_range(vm_offset_t
/*
* No targeted cache flush methods are supported by CPU,
- * or the supplied range is bigger then 2MB.
+ * or the supplied range is bigger than 2MB.
* Globally invalidate cache.
*/
pmap_invalidate_cache();
Modified: projects/altix/sys/amd64/include/specialreg.h
==============================================================================
--- projects/altix/sys/amd64/include/specialreg.h Mon Mar 22 18:43:36 2010 (r205455)
+++ projects/altix/sys/amd64/include/specialreg.h Mon Mar 22 18:50:57 2010 (r205456)
@@ -321,16 +321,16 @@
#define MTRR_N64K 8 /* numbers of fixed-size entries */
#define MTRR_N16K 16
#define MTRR_N4K 64
-#define MTRR_CAP_WC 0x0000000000000400UL
-#define MTRR_CAP_FIXED 0x0000000000000100UL
-#define MTRR_CAP_VCNT 0x00000000000000ffUL
-#define MTRR_DEF_ENABLE 0x0000000000000800UL
-#define MTRR_DEF_FIXED_ENABLE 0x0000000000000400UL
-#define MTRR_DEF_TYPE 0x00000000000000ffUL
-#define MTRR_PHYSBASE_PHYSBASE 0x000ffffffffff000UL
-#define MTRR_PHYSBASE_TYPE 0x00000000000000ffUL
-#define MTRR_PHYSMASK_PHYSMASK 0x000ffffffffff000UL
-#define MTRR_PHYSMASK_VALID 0x0000000000000800UL
+#define MTRR_CAP_WC 0x0000000000000400
+#define MTRR_CAP_FIXED 0x0000000000000100
+#define MTRR_CAP_VCNT 0x00000000000000ff
+#define MTRR_DEF_ENABLE 0x0000000000000800
+#define MTRR_DEF_FIXED_ENABLE 0x0000000000000400
+#define MTRR_DEF_TYPE 0x00000000000000ff
+#define MTRR_PHYSBASE_PHYSBASE 0x000ffffffffff000
+#define MTRR_PHYSBASE_TYPE 0x00000000000000ff
+#define MTRR_PHYSMASK_PHYSMASK 0x000ffffffffff000
+#define MTRR_PHYSMASK_VALID 0x0000000000000800
/* Performance Control Register (5x86 only). */
#define PCR0 0x20
@@ -360,31 +360,31 @@
#define MCG_STATUS_RIPV 0x00000001
#define MCG_STATUS_EIPV 0x00000002
#define MCG_STATUS_MCIP 0x00000004
-#define MCG_CTL_ENABLE 0xffffffffffffffffUL
-#define MCG_CTL_DISABLE 0x0000000000000000UL
+#define MCG_CTL_ENABLE 0xffffffffffffffff
+#define MCG_CTL_DISABLE 0x0000000000000000
#define MSR_MC_CTL(x) (MSR_MC0_CTL + (x) * 4)
#define MSR_MC_STATUS(x) (MSR_MC0_STATUS + (x) * 4)
#define MSR_MC_ADDR(x) (MSR_MC0_ADDR + (x) * 4)
#define MSR_MC_MISC(x) (MSR_MC0_MISC + (x) * 4)
#define MSR_MC_CTL2(x) (MSR_MC0_CTL2 + (x)) /* If MCG_CAP_CMCI_P */
-#define MC_STATUS_MCA_ERROR 0x000000000000ffffUL
-#define MC_STATUS_MODEL_ERROR 0x00000000ffff0000UL
-#define MC_STATUS_OTHER_INFO 0x01ffffff00000000UL
-#define MC_STATUS_COR_COUNT 0x001fffc000000000UL /* If MCG_CAP_TES_P */
-#define MC_STATUS_TES_STATUS 0x0060000000000000UL /* If MCG_CAP_TES_P */
-#define MC_STATUS_AR 0x0080000000000000UL /* If MCG_CAP_CMCI_P */
-#define MC_STATUS_S 0x0100000000000000UL /* If MCG_CAP_CMCI_P */
-#define MC_STATUS_PCC 0x0200000000000000UL
-#define MC_STATUS_ADDRV 0x0400000000000000UL
-#define MC_STATUS_MISCV 0x0800000000000000UL
-#define MC_STATUS_EN 0x1000000000000000UL
-#define MC_STATUS_UC 0x2000000000000000UL
-#define MC_STATUS_OVER 0x4000000000000000UL
-#define MC_STATUS_VAL 0x8000000000000000UL
-#define MC_MISC_RA_LSB 0x000000000000003fUL /* If MCG_CAP_SER_P */
-#define MC_MISC_ADDRESS_MODE 0x00000000000001c0UL /* If MCG_CAP_SER_P */
-#define MC_CTL2_THRESHOLD 0x0000000000003fffUL
-#define MC_CTL2_CMCI_EN 0x0000000040000000UL
+#define MC_STATUS_MCA_ERROR 0x000000000000ffff
+#define MC_STATUS_MODEL_ERROR 0x00000000ffff0000
+#define MC_STATUS_OTHER_INFO 0x01ffffff00000000
+#define MC_STATUS_COR_COUNT 0x001fffc000000000 /* If MCG_CAP_TES_P */
+#define MC_STATUS_TES_STATUS 0x0060000000000000 /* If MCG_CAP_TES_P */
+#define MC_STATUS_AR 0x0080000000000000 /* If MCG_CAP_CMCI_P */
+#define MC_STATUS_S 0x0100000000000000 /* If MCG_CAP_CMCI_P */
+#define MC_STATUS_PCC 0x0200000000000000
+#define MC_STATUS_ADDRV 0x0400000000000000
+#define MC_STATUS_MISCV 0x0800000000000000
+#define MC_STATUS_EN 0x1000000000000000
+#define MC_STATUS_UC 0x2000000000000000
+#define MC_STATUS_OVER 0x4000000000000000
+#define MC_STATUS_VAL 0x8000000000000000
+#define MC_MISC_RA_LSB 0x000000000000003f /* If MCG_CAP_SER_P */
+#define MC_MISC_ADDRESS_MODE 0x00000000000001c0 /* If MCG_CAP_SER_P */
+#define MC_CTL2_THRESHOLD 0x0000000000003fff
+#define MC_CTL2_CMCI_EN 0x0000000040000000
/*
* The following four 3-byte registers control the non-cacheable regions.
@@ -507,7 +507,6 @@
#define MSR_TOP_MEM2 0xc001001d /* boundary for ram above 4G */
#define MSR_K8_UCODE_UPDATE 0xc0010020 /* update microcode */
#define MSR_MC0_CTL_MASK 0xc0010044
-#define MSR_MC1_CTL_MASK 0xc0010045
/* VIA ACE crypto featureset: for via_feature_rng */
#define VIA_HAS_RNG 1 /* cpu has RNG */
Modified: projects/altix/sys/arm/arm/pmap.c
==============================================================================
--- projects/altix/sys/arm/arm/pmap.c Mon Mar 22 18:43:36 2010 (r205455)
+++ projects/altix/sys/arm/arm/pmap.c Mon Mar 22 18:50:57 2010 (r205456)
@@ -1605,10 +1605,11 @@ pmap_enter_pv(struct vm_page *pg, struct
pve->pv_flags = PVF_WRITE | PVF_UNMAN;
pg->md.pv_kva = 0;
+ if (!(km = PMAP_OWNED(pmap_kernel())))
+ PMAP_LOCK(pmap_kernel());
TAILQ_INSERT_HEAD(&pg->md.pv_list, pve, pv_list);
- TAILQ_INSERT_HEAD(&pm->pm_pvlist, pve, pv_plist);
- if ((km = PMAP_OWNED(pmap_kernel())))
- PMAP_UNLOCK(pmap_kernel());
+ TAILQ_INSERT_HEAD(&pve->pv_pmap->pm_pvlist, pve, pv_plist);
+ PMAP_UNLOCK(pmap_kernel());
vm_page_unlock_queues();
if ((pve = pmap_get_pv_entry()) == NULL)
panic("pmap_kenter_internal: no pv entries");
@@ -1712,6 +1713,7 @@ pmap_nuke_pv(struct vm_page *pg, pmap_t
pv = TAILQ_FIRST(&pg->md.pv_list);
if (pv != NULL && (pv->pv_flags & PVF_UNMAN) &&
TAILQ_NEXT(pv, pv_list) == NULL) {
+ pm = kernel_pmap;
pg->md.pv_kva = pv->pv_va;
/* a recursive pmap_nuke_pv */
TAILQ_REMOVE(&pg->md.pv_list, pv, pv_list);
Copied: projects/altix/sys/arm/conf/LN2410SBC (from r205454, head/sys/arm/conf/LN2410SBC)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ projects/altix/sys/arm/conf/LN2410SBC Mon Mar 22 18:50:57 2010 (r205456, copy of r205454, head/sys/arm/conf/LN2410SBC)
@@ -0,0 +1,87 @@
+# LN2410SBC -- Custom kernel configuration for the LN2410SBC
+#
+# For more information on this file, please read the handbook section on
+# Kernel Configuration Files:
+#
+# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html
+#
+# The handbook is also available locally in /usr/share/doc/handbook
+# if you've installed the doc distribution, otherwise always see the
+# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the
+# latest information.
+#
+# An exhaustive list of options and more detailed explanations of the
+# device lines is also present in the ../../conf/NOTES and NOTES files.
+# If you are in doubt as to the purpose or necessity of a line, check first
+# in NOTES.
+#
+# $FreeBSD$
+
+machine arm
+ident LN2410SBC
+
+include "../s3c2xx0/std.ln2410sbc"
+#To statically compile in device wiring instead of /boot/device.hints
+#hints "GENERIC.hints" #Default places to look for devices.
+makeoptions MODULES_OVERRIDE=""
+
+device board_ln2410sbc
+
+makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols
+options HZ=100
+options DDB
+options KDB
+
+options SCHED_4BSD #4BSD scheduler
+options INET #InterNETworking
+#options INET6 #IPv6 communications protocols
+options FFS #Berkeley Fast Filesystem
+#options SOFTUPDATES #Enable FFS soft updates support
+#options UFS_ACL #Support for access control lists
+#options UFS_DIRHASH #Improve performance on big directories
+#options MD_ROOT #MD is a potential root device
+#options MD_ROOT_SIZE=4096 # 4MB ram disk
+options ROOTDEVNAME=\"ufs:da0s1\"
+
+#options BOOTP
+#options BOOTP_NFSROOT # NFS mount root filesystem using BOOTP info
+#options NFSCLIENT #Network File System client
+#options NFS_ROOT #NFS usable as root device
+
+options PSEUDOFS #Pseudo-filesystem framework
+#options SCSI_DELAY=5000 #Delay (in ms) before probing SCSI
+options KTRACE #ktrace(1) support
+options SYSVSHM #SYSV-style shared memory
+options SYSVMSG #SYSV-style message queues
+options SYSVSEM #SYSV-style semaphores
+options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions
+
+options MUTEX_NOINLINE
+options RWLOCK_NOINLINE
+options SX_NOINLINE
+
+options NO_FFS_SNAPSHOT
+options NO_SWAPPING
+device random
+device pty
+
+device loop
+device ether
+device bpf
+
+device uart
+
+# Debugging for use in -current
+options INVARIANTS #Enable calls of extra sanity checking
+options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS
+options WITNESS #Enable checks to detect deadlocks and cycles
+options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed
+
+device md
+
+device usb
+device ohci
+device umass
+device scbus # SCSI bus (required for da)
+device da # Direct Access (disks)
+
Modified: projects/altix/sys/cam/scsi/scsi_sg.c
==============================================================================
--- projects/altix/sys/cam/scsi/scsi_sg.c Mon Mar 22 18:43:36 2010 (r205455)
+++ projects/altix/sys/cam/scsi/scsi_sg.c Mon Mar 22 18:50:57 2010 (r205456)
@@ -586,7 +586,7 @@ sgioctl(struct cdev *dev, u_long cmd, ca
{
struct sg_scsi_id id;
- id.host_no = 0; /* XXX */
+ id.host_no = cam_sim_path(xpt_path_sim(periph->path));
id.channel = xpt_path_path_id(periph->path);
id.scsi_id = xpt_path_target_id(periph->path);
id.lun = xpt_path_lun_id(periph->path);
Modified: projects/altix/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
==============================================================================
--- projects/altix/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Mon Mar 22 18:43:36 2010 (r205455)
+++ projects/altix/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Mon Mar 22 18:50:57 2010 (r205456)
@@ -224,7 +224,7 @@ extern kmem_cache_t *zio_data_buf_cache[
* second level ARC benefit from these fast lookups.
*/
-#define ARCS_LOCK_PAD 128
+#define ARCS_LOCK_PAD CACHE_LINE_SIZE
struct arcs_lock {
kmutex_t arcs_lock;
#ifdef _KERNEL
@@ -244,7 +244,7 @@ typedef struct arc_state {
uint64_t arcs_lsize[ARC_BUFC_NUMTYPES]; /* amount of evictable data */
uint64_t arcs_size; /* total amount of data in this state */
list_t arcs_lists[ARC_BUFC_NUMLISTS]; /* list of evictable buffers */
- struct arcs_lock arcs_locks[ARC_BUFC_NUMLISTS] __aligned(128);
+ struct arcs_lock arcs_locks[ARC_BUFC_NUMLISTS] __aligned(CACHE_LINE_SIZE);
} arc_state_t;
#define ARCS_LOCK(s, i) &((s)->arcs_locks[(i)].arcs_lock)
@@ -568,7 +568,7 @@ static void arc_evict_ghost(arc_state_t
* Hash table routines
*/
-#define HT_LOCK_PAD 128
+#define HT_LOCK_PAD CACHE_LINE_SIZE
struct ht_lock {
kmutex_t ht_lock;
@@ -581,7 +581,7 @@ struct ht_lock {
typedef struct buf_hash_table {
uint64_t ht_mask;
arc_buf_hdr_t **ht_table;
- struct ht_lock ht_locks[BUF_LOCKS];
+ struct ht_lock ht_locks[BUF_LOCKS] __aligned(CACHE_LINE_SIZE);
} buf_hash_table_t;
static buf_hash_table_t buf_hash_table;
Modified: projects/altix/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
==============================================================================
--- projects/altix/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Mon Mar 22 18:43:36 2010 (r205455)
+++ projects/altix/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Mon Mar 22 18:50:57 2010 (r205456)
@@ -29,6 +29,7 @@
#include <sys/bio.h>
#include <sys/disk.h>
#include <sys/spa.h>
+#include <sys/spa_impl.h>
#include <sys/vdev_impl.h>
#include <sys/fs/zfs.h>
#include <sys/zio.h>
@@ -505,17 +506,26 @@ vdev_geom_open(vdev_t *vd, uint64_t *psi
if ((owned = mtx_owned(&Giant)))
mtx_unlock(&Giant);
error = 0;
- cp = vdev_geom_open_by_path(vd, 1);
- if (cp == NULL) {
- /*
- * The device at vd->vdev_path doesn't have the expected guid.
- * The disks might have merely moved around so try all other
- * geom providers to find one with the right guid.
- */
- cp = vdev_geom_open_by_guid(vd);
- }
- if (cp == NULL)
+
+ /*
+ * If we're creating pool, just find GEOM provider by its name
+ * and ignore GUID mismatches.
+ */
+ if (vd->vdev_spa->spa_load_state == SPA_LOAD_NONE)
cp = vdev_geom_open_by_path(vd, 0);
+ else {
+ cp = vdev_geom_open_by_path(vd, 1);
+ if (cp == NULL) {
+ /*
+ * The device at vd->vdev_path doesn't have the
+ * expected guid. The disks might have merely
+ * moved around so try all other GEOM providers
+ * to find one with the right guid.
+ */
+ cp = vdev_geom_open_by_guid(vd);
+ }
+ }
+
if (cp == NULL) {
ZFS_LOG(1, "Provider %s not found.", vd->vdev_path);
error = ENOENT;
Modified: projects/altix/sys/compat/freebsd32/freebsd32.h
==============================================================================
--- projects/altix/sys/compat/freebsd32/freebsd32.h Mon Mar 22 18:43:36 2010 (r205455)
+++ projects/altix/sys/compat/freebsd32/freebsd32.h Mon Mar 22 18:50:57 2010 (r205456)
@@ -221,4 +221,12 @@ struct prpsinfo32 {
char pr_psargs[PRARGSZ+1];
};
+struct mq_attr32 {
+ int mq_flags;
+ int mq_maxmsg;
+ int mq_msgsize;
+ int mq_curmsgs;
+ int __reserved[4];
+};
+
#endif /* !_COMPAT_FREEBSD32_FREEBSD32_H_ */
Modified: projects/altix/sys/compat/freebsd32/freebsd32_ipc.h
==============================================================================
--- projects/altix/sys/compat/freebsd32/freebsd32_ipc.h Mon Mar 22 18:43:36 2010 (r205455)
+++ projects/altix/sys/compat/freebsd32/freebsd32_ipc.h Mon Mar 22 18:50:57 2010 (r205456)
@@ -147,6 +147,14 @@ struct shmid_ds32_old {
int32_t shm_ctime;
uint32_t shm_internal;
};
+
+void freebsd32_ipcperm_old_in(struct ipc_perm32_old *ip32,
+ struct ipc_perm *ip);
+void freebsd32_ipcperm_old_out(struct ipc_perm *ip,
+ struct ipc_perm32_old *ip32);
#endif
+void freebsd32_ipcperm_in(struct ipc_perm32 *ip32, struct ipc_perm *ip);
+void freebsd32_ipcperm_out(struct ipc_perm *ip, struct ipc_perm32 *ip32);
+
#endif /* !_COMPAT_FREEBSD32_FREEBSD32_IPC_H_ */
Modified: projects/altix/sys/compat/freebsd32/freebsd32_misc.c
==============================================================================
--- projects/altix/sys/compat/freebsd32/freebsd32_misc.c Mon Mar 22 18:43:36 2010 (r205455)
+++ projects/altix/sys/compat/freebsd32/freebsd32_misc.c Mon Mar 22 18:50:57 2010 (r205456)
@@ -873,7 +873,7 @@ freebsd32_pwritev(struct thread *td, str
return (error);
}
-static int
+int
freebsd32_copyiniov(struct iovec32 *iovp32, u_int iovcnt, struct iovec **iovp,
int error)
{
@@ -1400,591 +1400,6 @@ freebsd4_freebsd32_fhstatfs(struct threa
}
#endif
-#if defined(COMPAT_FREEBSD4) || defined(COMPAT_FREEBSD5) || \
- defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7)
-static void
-freebsd32_ipcperm_old_in(struct ipc_perm32_old *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_old_out(struct ipc_perm *ip, struct ipc_perm32_old *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);
-}
-#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)
-{
-
-#if defined(COMPAT_FREEBSD4) || defined(COMPAT_FREEBSD5) || \
- defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7)
- switch (uap->which) {
- case 0:
- return (freebsd7_freebsd32_semctl(td,
- (struct freebsd7_freebsd32_semctl_args *)&uap->a2));
- default:
- return (semsys(td, (struct semsys_args *)uap));
- }
-#else
- return (nosys(td, NULL));
-#endif
-}
-
-#if defined(COMPAT_FREEBSD4) || defined(COMPAT_FREEBSD5) || \
- defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7)
-int
-freebsd7_freebsd32_semctl(struct thread *td,
- struct freebsd7_freebsd32_semctl_args *uap)
-{
- struct semid_ds32_old 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_old_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_ctime);
- 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:
- bzero(&dsbuf32, sizeof(dsbuf32));
- freebsd32_ipcperm_old_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_ctime);
- error = copyout(&dsbuf32, PTRIN(arg.buf), sizeof(dsbuf32));
- break;
- }
-
- if (error == 0)
- td->td_retval[0] = rval;
- return (error);
-}
-#endif
-
-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_ctime);
- 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:
- bzero(&dsbuf32, sizeof(dsbuf32));
- 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_ctime);
- 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)
-{
-
-#if defined(COMPAT_FREEBSD4) || defined(COMPAT_FREEBSD5) || \
- defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7)
- switch (uap->which) {
- case 0:
- return (freebsd7_freebsd32_msgctl(td,
- (struct freebsd7_freebsd32_msgctl_args *)&uap->a2));
- case 2:
- return (freebsd32_msgsnd(td,
- (struct freebsd32_msgsnd_args *)&uap->a2));
- case 3:
- return (freebsd32_msgrcv(td,
- (struct freebsd32_msgrcv_args *)&uap->a2));
- default:
- return (msgsys(td, (struct msgsys_args *)uap));
- }
-#else
- return (nosys(td, NULL));
-#endif
-}
-
-#if defined(COMPAT_FREEBSD4) || defined(COMPAT_FREEBSD5) || \
- defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7)
-int
-freebsd7_freebsd32_msgctl(struct thread *td,
- struct freebsd7_freebsd32_msgctl_args *uap)
-{
- struct msqid_ds msqbuf;
- struct msqid_ds32_old msqbuf32;
- int error;
-
- if (uap->cmd == IPC_SET) {
- error = copyin(uap->buf, &msqbuf32, sizeof(msqbuf32));
- if (error)
- return (error);
- freebsd32_ipcperm_old_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_rtime);
- CP(msqbuf32, msqbuf, msg_ctime);
- }
- error = kern_msgctl(td, uap->msqid, uap->cmd, &msqbuf);
- if (error)
- return (error);
- if (uap->cmd == IPC_STAT) {
- bzero(&msqbuf32, sizeof(msqbuf32));
- freebsd32_ipcperm_old_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_rtime);
- CP(msqbuf, msqbuf32, msg_ctime);
- error = copyout(&msqbuf32, uap->buf, sizeof(struct msqid_ds32));
- }
- return (error);
-}
-#endif
-
-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_rtime);
- CP(msqbuf32, msqbuf, msg_ctime);
- }
- 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_rtime);
- CP(msqbuf, msqbuf32, msg_ctime);
- error = copyout(&msqbuf32, uap->buf, sizeof(struct msqid_ds32));
- }
- return (error);
-}
-
-int
-freebsd32_msgsnd(struct thread *td, struct freebsd32_msgsnd_args *uap)
-{
- const void *msgp;
- long mtype;
- int32_t mtype32;
- int error;
-
- msgp = PTRIN(uap->msgp);
- if ((error = copyin(msgp, &mtype32, sizeof(mtype32))) != 0)
- return (error);
- mtype = mtype32;
- return (kern_msgsnd(td, uap->msqid,
- (const char *)msgp + sizeof(mtype32),
- uap->msgsz, uap->msgflg, mtype));
-}
-
-int
-freebsd32_msgrcv(struct thread *td, struct freebsd32_msgrcv_args *uap)
-{
- void *msgp;
- long mtype;
- int32_t mtype32;
- int error;
-
- msgp = PTRIN(uap->msgp);
- if ((error = kern_msgrcv(td, uap->msqid,
- (char *)msgp + sizeof(mtype32), uap->msgsz,
- uap->msgtyp, uap->msgflg, &mtype)) != 0)
- return (error);
- mtype32 = (int32_t)mtype;
- return (copyout(&mtype32, msgp, sizeof(mtype32)));
-}
-
-int
-freebsd32_shmsys(struct thread *td, struct freebsd32_shmsys_args *uap)
-{
-
-#if defined(COMPAT_FREEBSD4) || defined(COMPAT_FREEBSD5) || \
- defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7)
- switch (uap->which) {
- case 0: { /* shmat */
- struct shmat_args ap;
-
- ap.shmid = uap->a2;
- ap.shmaddr = PTRIN(uap->a3);
- ap.shmflg = uap->a4;
- return (sysent[SYS_shmat].sy_call(td, &ap));
- }
- case 2: { /* shmdt */
- struct shmdt_args ap;
-
- ap.shmaddr = PTRIN(uap->a2);
- return (sysent[SYS_shmdt].sy_call(td, &ap));
- }
- case 3: { /* shmget */
- struct shmget_args ap;
-
- ap.key = uap->a2;
- ap.size = uap->a3;
- ap.shmflg = uap->a4;
- return (sysent[SYS_shmget].sy_call(td, &ap));
- }
- case 4: { /* shmctl */
- struct freebsd7_freebsd32_shmctl_args ap;
-
- ap.shmid = uap->a2;
- ap.cmd = uap->a3;
- ap.buf = PTRIN(uap->a4);
- return (freebsd7_freebsd32_shmctl(td, &ap));
- }
- case 1: /* oshmctl */
- default:
- return (EINVAL);
- }
-#else
- return (nosys(td, NULL));
-#endif
-}
-
-#if defined(COMPAT_FREEBSD4) || defined(COMPAT_FREEBSD5) || \
- defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7)
-int
-freebsd7_freebsd32_shmctl(struct thread *td,
- struct freebsd7_freebsd32_shmctl_args *uap)
-{
- int error = 0;
- union {
- struct shmid_ds shmid_ds;
- struct shm_info shm_info;
- struct shminfo shminfo;
- } u;
- union {
- struct shmid_ds32_old shmid_ds32;
- struct shm_info32 shm_info32;
- struct shminfo32 shminfo32;
- } u32;
- size_t sz;
-
- if (uap->cmd == IPC_SET) {
- if ((error = copyin(uap->buf, &u32.shmid_ds32,
- sizeof(u32.shmid_ds32))))
- goto done;
- freebsd32_ipcperm_old_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);
- CP(u32.shmid_ds32, u.shmid_ds, shm_nattch);
- CP(u32.shmid_ds32, u.shmid_ds, shm_atime);
- CP(u32.shmid_ds32, u.shmid_ds, shm_dtime);
- CP(u32.shmid_ds32, u.shmid_ds, shm_ctime);
- }
-
- error = kern_shmctl(td, uap->shmid, uap->cmd, (void *)&u, &sz);
- if (error)
- goto done;
-
- /* Cases in which we need to copyout */
- switch (uap->cmd) {
- case IPC_INFO:
- CP(u.shminfo, u32.shminfo32, shmmax);
- CP(u.shminfo, u32.shminfo32, shmmin);
- CP(u.shminfo, u32.shminfo32, shmmni);
- CP(u.shminfo, u32.shminfo32, shmseg);
- CP(u.shminfo, u32.shminfo32, shmall);
- error = copyout(&u32.shminfo32, uap->buf,
- sizeof(u32.shminfo32));
- break;
- case SHM_INFO:
- CP(u.shm_info, u32.shm_info32, used_ids);
- CP(u.shm_info, u32.shm_info32, shm_rss);
- CP(u.shm_info, u32.shm_info32, shm_tot);
- CP(u.shm_info, u32.shm_info32, shm_swp);
- CP(u.shm_info, u32.shm_info32, swap_attempts);
- CP(u.shm_info, u32.shm_info32, swap_successes);
- error = copyout(&u32.shm_info32, uap->buf,
- sizeof(u32.shm_info32));
- break;
- case SHM_STAT:
- case IPC_STAT:
- freebsd32_ipcperm_old_out(&u.shmid_ds.shm_perm,
- &u32.shmid_ds32.shm_perm);
- if (u.shmid_ds.shm_segsz > INT32_MAX)
- u32.shmid_ds32.shm_segsz = INT32_MAX;
- else
- 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);
- CP(u.shmid_ds, u32.shmid_ds32, shm_nattch);
- CP(u.shmid_ds, u32.shmid_ds32, shm_atime);
- CP(u.shmid_ds, u32.shmid_ds32, shm_dtime);
- CP(u.shmid_ds, u32.shmid_ds32, shm_ctime);
- u32.shmid_ds32.shm_internal = 0;
- error = copyout(&u32.shmid_ds32, uap->buf,
- sizeof(u32.shmid_ds32));
- break;
- }
-
-done:
- if (error) {
- /* Invalidate the return value */
- td->td_retval[0] = -1;
- }
- return (error);
-}
-#endif
-
-int
-freebsd32_shmctl(struct thread *td, struct freebsd32_shmctl_args *uap)
-{
- int error = 0;
- union {
- struct shmid_ds shmid_ds;
- struct shm_info shm_info;
- struct shminfo shminfo;
- } u;
- union {
- struct shmid_ds32 shmid_ds32;
- struct shm_info32 shm_info32;
- struct shminfo32 shminfo32;
- } u32;
- size_t sz;
-
- if (uap->cmd == IPC_SET) {
- if ((error = copyin(uap->buf, &u32.shmid_ds32,
- sizeof(u32.shmid_ds32))))
- goto done;
- 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);
- CP(u32.shmid_ds32, u.shmid_ds, shm_nattch);
- CP(u32.shmid_ds32, u.shmid_ds, shm_atime);
- CP(u32.shmid_ds32, u.shmid_ds, shm_dtime);
- CP(u32.shmid_ds32, u.shmid_ds, shm_ctime);
- }
-
- error = kern_shmctl(td, uap->shmid, uap->cmd, (void *)&u, &sz);
- if (error)
- goto done;
-
- /* Cases in which we need to copyout */
- switch (uap->cmd) {
- case IPC_INFO:
- CP(u.shminfo, u32.shminfo32, shmmax);
- CP(u.shminfo, u32.shminfo32, shmmin);
- CP(u.shminfo, u32.shminfo32, shmmni);
- CP(u.shminfo, u32.shminfo32, shmseg);
- CP(u.shminfo, u32.shminfo32, shmall);
- error = copyout(&u32.shminfo32, uap->buf,
- sizeof(u32.shminfo32));
- break;
- case SHM_INFO:
- CP(u.shm_info, u32.shm_info32, used_ids);
- CP(u.shm_info, u32.shm_info32, shm_rss);
- CP(u.shm_info, u32.shm_info32, shm_tot);
- CP(u.shm_info, u32.shm_info32, shm_swp);
- CP(u.shm_info, u32.shm_info32, swap_attempts);
- CP(u.shm_info, u32.shm_info32, swap_successes);
- error = copyout(&u32.shm_info32, uap->buf,
- sizeof(u32.shm_info32));
- break;
- case SHM_STAT:
- case IPC_STAT:
- freebsd32_ipcperm_out(&u.shmid_ds.shm_perm,
- &u32.shmid_ds32.shm_perm);
- if (u.shmid_ds.shm_segsz > INT32_MAX)
- u32.shmid_ds32.shm_segsz = INT32_MAX;
- else
- 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);
- CP(u.shmid_ds, u32.shmid_ds32, shm_nattch);
- CP(u.shmid_ds, u32.shmid_ds32, shm_atime);
- CP(u.shmid_ds, u32.shmid_ds32, shm_dtime);
- CP(u.shmid_ds, u32.shmid_ds32, shm_ctime);
- error = copyout(&u32.shmid_ds32, uap->buf,
- sizeof(u32.shmid_ds32));
- break;
- }
-
-done:
- if (error) {
- /* Invalidate the return value */
- td->td_retval[0] = -1;
- }
- return (error);
-}
-
int
freebsd32_pread(struct thread *td, struct freebsd32_pread_args *uap)
{
@@ -3084,6 +2499,36 @@ syscall32_module_handler(struct module *
}
}
+int
+syscall32_helper_register(struct syscall_helper_data *sd)
*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
More information about the svn-src-projects
mailing list