Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Oct 2003 12:52:10 -0700 (PDT)
From:      Sam Leffler <sam@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 40332 for review
Message-ID:  <200310231952.h9NJqAkW083064@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=40332

Change 40332 by sam@sam_ebb on 2003/10/23 12:51:31

	IFC @ 40331

Affected files ...

.. //depot/projects/netperf/sys/amd64/include/sysarch.h#2 integrate
.. //depot/projects/netperf/sys/conf/NOTES#13 integrate
.. //depot/projects/netperf/sys/conf/files#16 integrate
.. //depot/projects/netperf/sys/conf/files.ia64#7 integrate
.. //depot/projects/netperf/sys/conf/options#12 integrate
.. //depot/projects/netperf/sys/contrib/dev/acpica/exfldio.c#2 integrate
.. //depot/projects/netperf/sys/dev/aic7xxx/ahc_pci.c#4 integrate
.. //depot/projects/netperf/sys/dev/aic7xxx/ahd_pci.c#4 integrate
.. //depot/projects/netperf/sys/dev/ep/if_ep.c#6 integrate
.. //depot/projects/netperf/sys/dev/firewire/fwmem.c#4 integrate
.. //depot/projects/netperf/sys/dev/usb/if_cue.c#4 integrate
.. //depot/projects/netperf/sys/dev/vx/if_vxreg.h#2 integrate
.. //depot/projects/netperf/sys/geom/geom_fox.c#2 integrate
.. //depot/projects/netperf/sys/i386/conf/NOTES#5 integrate
.. //depot/projects/netperf/sys/ia64/disasm/disasm.h#1 branch
.. //depot/projects/netperf/sys/ia64/disasm/disasm_decode.c#1 branch
.. //depot/projects/netperf/sys/ia64/disasm/disasm_extract.c#1 branch
.. //depot/projects/netperf/sys/ia64/disasm/disasm_format.c#1 branch
.. //depot/projects/netperf/sys/ia64/disasm/disasm_int.h#1 branch
.. //depot/projects/netperf/sys/ia64/ia64/db_trace.c#2 integrate
.. //depot/projects/netperf/sys/ia64/ia64/support.S#3 integrate
.. //depot/projects/netperf/sys/ia64/ia64/trap.c#7 integrate
.. //depot/projects/netperf/sys/ia64/ia64/unaligned.c#2 integrate
.. //depot/projects/netperf/sys/ia64/include/md_var.h#4 integrate
.. //depot/projects/netperf/sys/ia64/include/proc.h#3 integrate
.. //depot/projects/netperf/sys/isa/fd.c#6 integrate
.. //depot/projects/netperf/sys/kern/kern_mac.c#6 integrate
.. //depot/projects/netperf/sys/kern/vfs_subr.c#9 integrate
.. //depot/projects/netperf/sys/net/if.c#9 integrate
.. //depot/projects/netperf/sys/net/if_ethersubr.c#8 integrate
.. //depot/projects/netperf/sys/net/if_fddisubr.c#3 integrate
.. //depot/projects/netperf/sys/net/if_tun.c#3 integrate
.. //depot/projects/netperf/sys/net/net_osdep.h#2 integrate
.. //depot/projects/netperf/sys/netatalk/aarp.c#4 integrate
.. //depot/projects/netperf/sys/netinet6/frag6.c#6 integrate
.. //depot/projects/netperf/sys/netinet6/icmp6.c#10 integrate
.. //depot/projects/netperf/sys/netinet6/in6_src.c#9 edit
.. //depot/projects/netperf/sys/netkey/key.c#4 integrate
.. //depot/projects/netperf/sys/pci/agp.c#3 integrate
.. //depot/projects/netperf/sys/pci/agp_i810.c#4 integrate
.. //depot/projects/netperf/sys/pci/if_dc.c#9 integrate
.. //depot/projects/netperf/sys/security/mac/mac_internal.h#1 branch
.. //depot/projects/netperf/sys/security/mac/mac_net.c#1 branch
.. //depot/projects/netperf/sys/security/mac/mac_pipe.c#1 branch
.. //depot/projects/netperf/sys/security/mac/mac_process.c#1 branch
.. //depot/projects/netperf/sys/security/mac/mac_system.c#1 branch
.. //depot/projects/netperf/sys/security/mac/mac_vfs.c#1 branch
.. //depot/projects/netperf/sys/sys/agpio.h#2 integrate
.. //depot/projects/netperf/sys/sys/vnode.h#4 integrate
.. //depot/projects/netperf/sys/ufs/ffs/ffs_rawread.c#3 integrate
.. //depot/projects/netperf/sys/vm/vm_page.c#10 integrate
.. //depot/projects/netperf/sys/vm/vm_page.h#6 integrate
.. //depot/projects/netperf/sys/vm/vm_pageout.c#10 integrate

Differences ...

==== //depot/projects/netperf/sys/amd64/include/sysarch.h#2 (text+ko) ====

@@ -30,7 +30,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/amd64/include/sysarch.h,v 1.19 2003/05/12 02:37:29 peter Exp $
+ * $FreeBSD: src/sys/amd64/include/sysarch.h,v 1.21 2003/10/23 06:06:14 peter Exp $
  */
 
 /*
@@ -39,22 +39,21 @@
 #ifndef _MACHINE_SYSARCH_H_
 #define _MACHINE_SYSARCH_H_
 
-#define	AMD64_GET_FSBASE	0
-#define	AMD64_SET_FSBASE	1
-#define	AMD64_GET_GSBASE	2
-#define	AMD64_SET_GSBASE	3
+/* Leave space for 0-127 for to avoid translating syscalls */
+#define	AMD64_GET_FSBASE	128
+#define	AMD64_SET_FSBASE	129
+#define	AMD64_GET_GSBASE	130
+#define	AMD64_SET_GSBASE	131
 
-#if 0 /* these wrappers need to be implemented in libc first */
 #ifndef _KERNEL
 #include <sys/cdefs.h>
 
 __BEGIN_DECLS
-unsigned long amd64_get_fsbase(void);
-unsigned long amd64_set_fsbase(unsigned long);
-unsigned long amd64_get_gsbase(void);
-unsigned long amd64_set_gsbase(unsigned long);
+int amd64_get_fsbase(void **);
+int amd64_set_fsbase(void *);
+int amd64_get_gsbase(void **);
+int amd64_set_gsbase(void *);
 __END_DECLS
 #endif
-#endif
 
 #endif /* !_MACHINE_SYSARCH_H_ */

==== //depot/projects/netperf/sys/conf/NOTES#13 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/NOTES,v 1.1178 2003/09/26 20:26:22 fjoe Exp $
+# $FreeBSD: src/sys/conf/NOTES,v 1.1179 2003/10/22 22:27:49 njl Exp $
 #
 # NOTES -- Lines that can be cut/pasted into kernel and hints configs.
 #
@@ -2394,8 +2394,6 @@
 
 # Yet more undocumented options for linting.
 options 	AAC_DEBUG
-options 	ACPI_MAX_THREADS=1
-#!options 	ACPI_NO_SEMAPHORES
 # Broken:
 ##options 	ASR_MEASURE_PERFORMANCE
 # BKTR_ALLOC_PAGES has no effect except to cause warnings, and

==== //depot/projects/netperf/sys/conf/files#16 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/files,v 1.836 2003/10/19 21:28:33 ume Exp $
+# $FreeBSD: src/sys/conf/files,v 1.837 2003/10/22 20:39:33 rwatson Exp $
 #
 # The long compile-with and dependency lines are required because of
 # limitations in config: backslash-newline doesn't work in strings, and
@@ -1595,6 +1595,11 @@
 posix4/p1003_1b.c	standard
 posix4/posix4_mib.c	standard
 kern/uipc_sem.c		optional p1003_1b_semaphores
+security/mac/mac_net.c		optional mac
+security/mac/mac_pipe.c		optional mac
+security/mac/mac_process.c	optional mac
+security/mac/mac_system.c	optional mac
+security/mac/mac_vfs.c		optional mac
 security/mac_biba/mac_biba.c	optional mac_biba
 security/mac_bsdextended/mac_bsdextended.c	optional mac_bsdextended
 security/mac_ifoff/mac_ifoff.c	optional mac_ifoff

==== //depot/projects/netperf/sys/conf/files.ia64#7 (text+ko) ====

@@ -1,7 +1,7 @@
 # This file tells config what files go into building a kernel,
 # files marked standard are always included.
 #
-# $FreeBSD: src/sys/conf/files.ia64,v 1.59 2003/09/20 19:27:48 marcel Exp $
+# $FreeBSD: src/sys/conf/files.ia64,v 1.60 2003/10/23 06:11:37 marcel Exp $
 #
 # The long compile-with and dependency lines are required because of
 # limitations in config: backslash-newline doesn't work in strings, and
@@ -80,6 +80,9 @@
 ia64/acpica/acpi_machdep.c	optional	acpi
 ia64/acpica/acpi_wakeup.c	optional	acpi
 ia64/acpica/madt.c		optional	acpi
+ia64/disasm/disasm_decode.c	standard
+ia64/disasm/disasm_extract.c	standard
+ia64/disasm/disasm_format.c	standard
 ia64/ia32/ia32_misc.c		optional	ia32
 ia64/ia32/ia32_sysent.c		optional	ia32
 ia64/ia32/ia32_sysvec.c		optional	ia32

==== //depot/projects/netperf/sys/conf/options#12 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/options,v 1.415 2003/09/26 20:26:22 fjoe Exp $
+# $FreeBSD: src/sys/conf/options,v 1.416 2003/10/22 22:27:49 njl Exp $
 #
 #        On the handling of kernel options
 #
@@ -594,8 +594,9 @@
 
 # options for ACPI support
 ACPI_DEBUG		opt_acpi.h
+ACPI_MAX_THREADS	opt_acpi.h
 ACPI_NO_SEMAPHORES	opt_acpi.h
-ACPI_MAX_THREADS	opt_acpi.h
+ACPICA_PEDANTIC		opt_acpi.h
 
 # options for DEVFS, see sys/fs/devfs/devfs.h
 NDEVFSINO		opt_devfs.h

==== //depot/projects/netperf/sys/contrib/dev/acpica/exfldio.c#2 (text+ko) ====

@@ -220,6 +220,25 @@
             FieldDatumByteOffset, ObjDesc->CommonField.AccessByteWidth,
             RgnDesc->Region.Node->Name.Ascii, RgnDesc->Region.Length));
 
+#ifndef ACPICA_PEDANTIC
+        {
+            /*
+             * Allow access to the field if it is within the region size
+             * rounded up to a multiple of the access byte width.  This
+             * overcomes "off-by-one" programming errors in the AML often
+             * found in Toshiba laptops.  These errors were allowed by
+             * the Microsoft ASL compiler.
+             */
+            UINT32 rounded_length = ACPI_ROUND_UP(RgnDesc->Region.Length,
+                ObjDesc->CommonField.AccessByteWidth);
+
+            if (rounded_length >= (ObjDesc->CommonField.BaseByteOffset +
+                                   FieldDatumByteOffset +
+                                   ObjDesc->CommonField.AccessByteWidth)) {
+                return_ACPI_STATUS (AE_OK);
+            }
+        }
+#endif
         return_ACPI_STATUS (AE_AML_REGION_LIMIT);
     }
 

==== //depot/projects/netperf/sys/dev/aic7xxx/ahc_pci.c#4 (text+ko) ====

@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/aic7xxx/ahc_pci.c,v 1.56 2003/09/02 17:30:34 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/aic7xxx/ahc_pci.c,v 1.57 2003/10/23 13:42:03 des Exp $");
 
 #include <dev/aic7xxx/aic7xxx_osm.h>
 
@@ -113,7 +113,7 @@
 	error = bus_dma_tag_create(/*parent*/NULL, /*alignment*/1,
 				   /*boundary*/0,
 				   (ahc->flags & AHC_39BIT_ADDRESSING)
-				   ? 0x7FFFFFFFFF
+				   ? 0x7FFFFFFFFFLL
 				   : BUS_SPACE_MAXADDR_32BIT,
 				   /*highaddr*/BUS_SPACE_MAXADDR,
 				   /*filter*/NULL, /*filterarg*/NULL,

==== //depot/projects/netperf/sys/dev/aic7xxx/ahd_pci.c#4 (text+ko) ====

@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/aic7xxx/ahd_pci.c,v 1.11 2003/09/02 17:30:34 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/aic7xxx/ahd_pci.c,v 1.12 2003/10/23 13:42:03 des Exp $");
 
 #include <dev/aic7xxx/aic79xx_osm.h>
 
@@ -116,7 +116,7 @@
 	error = bus_dma_tag_create(/*parent*/NULL, /*alignment*/1,
 				   /*boundary*/0,
 				   (ahd->flags & AHD_39BIT_ADDRESSING)
-				   ? 0x7FFFFFFFFF
+				   ? 0x7FFFFFFFFFLL
 				   : BUS_SPACE_MAXADDR_32BIT,
 				   /*highaddr*/BUS_SPACE_MAXADDR,
 				   /*filter*/NULL, /*filterarg*/NULL,

==== //depot/projects/netperf/sys/dev/ep/if_ep.c#6 (text+ko) ====

@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ep/if_ep.c,v 1.122 2003/10/18 15:22:43 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ep/if_ep.c,v 1.124 2003/10/23 05:33:53 imp Exp $");
 
 /*
  *	Modified from the FreeBSD 1.1.5.1 version by:
@@ -61,7 +61,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ep/if_ep.c,v 1.122 2003/10/18 15:22:43 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ep/if_ep.c,v 1.124 2003/10/23 05:33:53 imp Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -758,7 +758,7 @@
 		if (EP_FTST(sc, F_ACCESS_32_BITS)) {
 			/* default for EISA configured cards */
 			EP_READ_MULTI_4(sc, EP_W1_RX_PIO_RD_1,
-			    mtod(m, uint32_t *)+m->m_len,
+			    (uint32_t *)(mtod(m, caddr_t)+m->m_len),
 			    lenthisone / 4);
 			m->m_len += (lenthisone & ~3);
 			if (lenthisone & 3)
@@ -767,7 +767,8 @@
 			m->m_len += (lenthisone & 3);
 		} else {
 			EP_READ_MULTI_2(sc, EP_W1_RX_PIO_RD_1,
-			    mtod(m, uint16_t *)+m->m_len, lenthisone / 2);
+			    (uint16_t *)(mtod(m, caddr_t)+m->m_len),
+			    lenthisone / 2);
 			m->m_len += lenthisone;
 			if (lenthisone & 1)
 				*(mtod(m, caddr_t)+m->m_len - 1) =

==== //depot/projects/netperf/sys/dev/firewire/fwmem.c#4 (text+ko) ====

@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/firewire/fwmem.c,v 1.23 2003/10/02 14:33:30 simokawa Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/firewire/fwmem.c,v 1.24 2003/10/23 01:55:03 simokawa Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -295,7 +295,8 @@
 	bp->bio_error = xfer->resp;
 
 	if (bp->bio_error != 0) {
-		printf("%s: err=%d\n", __FUNCTION__, bp->bio_error);
+		if (fwmem_debug)
+			printf("%s: err=%d\n", __FUNCTION__, bp->bio_error);
 		bp->bio_flags |= BIO_ERROR;
 		bp->bio_resid = bp->bio_bcount;
 	}
@@ -362,7 +363,8 @@
 error:
 	splx(s);
 	if (err != 0) {
-		printf("%s: err=%d\n", __FUNCTION__, err);
+		if (fwmem_debug)
+			printf("%s: err=%d\n", __FUNCTION__, err);
 		bp->bio_error = err;
 		bp->bio_flags |= BIO_ERROR;
 		bp->bio_resid = bp->bio_bcount;

==== //depot/projects/netperf/sys/dev/usb/if_cue.c#4 (text+ko) ====

@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/usb/if_cue.c,v 1.39 2003/10/04 21:41:01 joe Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/usb/if_cue.c,v 1.40 2003/10/23 16:55:27 imp Exp $");
 
 /*
  * CATC USB-EL1210A USB to ethernet driver. Used in the CATC Netmate
@@ -52,7 +52,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/usb/if_cue.c,v 1.39 2003/10/04 21:41:01 joe Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/usb/if_cue.c,v 1.40 2003/10/23 16:55:27 imp Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -116,7 +116,7 @@
 Static void cue_shutdown(device_ptr_t);
 
 Static void cue_setmulti(struct cue_softc *);
-Static u_int32_t cue_crc(caddr_t);
+Static u_int32_t cue_crc(const uint8_t *);
 Static void cue_reset(struct cue_softc *);
 
 Static int cue_csr_read_1(struct cue_softc *, int);
@@ -331,9 +331,9 @@
 #define CUE_BITS	9
 
 Static u_int32_t
-cue_crc(caddr_t addr)
+cue_crc(const uint8_t *addr)
 {
-	u_int32_t		idx, bit, data, crc;
+	uint32_t		idx, bit, data, crc;
 
 	/* Compute CRC for the address value. */
 	crc = 0xFFFFFFFF; /* initial value */

==== //depot/projects/netperf/sys/dev/vx/if_vxreg.h#2 (text+ko) ====

@@ -19,7 +19,7 @@
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/dev/vx/if_vxreg.h,v 1.8 2002/03/20 02:07:47 alfred Exp $
+ * $FreeBSD: src/sys/dev/vx/if_vxreg.h,v 1.10 2003/10/23 04:53:33 imp Exp $
  *
  October 2, 1994
 
@@ -103,11 +103,6 @@
 #define VX_ID_PORT      0x100
 
 /*
- * some macros to acces long named fields
- */
-#define BASE 	(sc->vx_io_addr)
-
-/*
  * Commands to read/write EEPROM trough EEPROM command register (Window 0,
  * Offset 0xa)
  */
@@ -466,9 +461,7 @@
 
 #define VX_CONNECTORS 8
 
-extern struct vx_softc *vx_softc[];
 extern u_long vx_count;
-extern struct vx_softc *vxalloc(int);
 extern void vxfree(struct vx_softc *);
 extern int vxattach(struct vx_softc *);
 extern void vxstop(struct vx_softc *);

==== //depot/projects/netperf/sys/geom/geom_fox.c#2 (text+ko) ====

@@ -26,7 +26,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/geom/geom_fox.c,v 1.1 2003/06/18 09:29:27 phk Exp $
+ * $FreeBSD: src/sys/geom/geom_fox.c,v 1.2 2003/10/22 20:28:46 phk Exp $
  *
  * This is a GEOM module for handling path selection for multi-path
  * storage devices.  It is named "fox" because it, like they, prefer
@@ -190,8 +190,8 @@
 	}
 
 	mtx_destroy(&sc->lock);
+	g_free(gp->softc);
 	gp->softc = NULL;
-	g_free(gp->softc);
 	g_wither_geom(gp, ENXIO);
 }
 

==== //depot/projects/netperf/sys/i386/conf/NOTES#5 (text+ko) ====

@@ -4,7 +4,7 @@
 # This file contains machine dependent kernel configuration notes.  For
 # machine independent notes, look in /sys/conf/NOTES.
 #
-# $FreeBSD: src/sys/i386/conf/NOTES,v 1.1094 2003/09/19 01:42:24 sam Exp $
+# $FreeBSD: src/sys/i386/conf/NOTES,v 1.1095 2003/10/22 22:27:49 njl Exp $
 #
 
 #
@@ -410,11 +410,22 @@
 # Intel ACPICA code.  (Note that the Intel code must also have USE_DEBUGGER
 # defined when it is built).
 #
+# ACPI_MAX_THREADS sets the number of task threads started.
+#
+# ACPI_NO_SEMAPHORES makes the AcpiOs*Semaphore routines a no-op.
+#
+# ACPICA_PEDANTIC enables strict checking of AML.  Our default is to
+# relax these checks to allow code generated by the Microsoft compiler
+# to still execute.
+#
 # Note that building ACPI into the kernel is deprecated; the module is
 # normally loaded automatically by the loader.
 #
 device		acpi
 options 	ACPI_DEBUG
+options 	ACPI_MAX_THREADS=1
+#options 	ACPI_NO_SEMAPHORES
+#options 	ACPICA_PEDANTIC
 
 # DRM options:
 # mgadrm:    AGP Matrox G200, G400, G450, G550

==== //depot/projects/netperf/sys/ia64/ia64/db_trace.c#2 (text+ko) ====

@@ -23,12 +23,11 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *	$FreeBSD: src/sys/ia64/ia64/db_trace.c,v 1.17 2003/07/12 04:35:09 marcel Exp $
+ *	$FreeBSD: src/sys/ia64/ia64/db_trace.c,v 1.18 2003/10/23 06:23:55 marcel Exp $
  */
 
 #include <sys/param.h>
 #include <sys/proc.h>
-#include <machine/inst.h>
 #include <machine/db_machdep.h>
 #include <machine/unwind.h>
 #include <machine/vmparam.h>

==== //depot/projects/netperf/sys/ia64/ia64/support.S#3 (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/ia64/ia64/support.S,v 1.20 2003/08/12 03:51:53 marcel Exp $
+ * $FreeBSD: src/sys/ia64/ia64/support.S,v 1.21 2003/10/23 06:19:06 marcel Exp $
  */
 /*
  * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
@@ -890,3 +890,13 @@
 	mov	ret0=EFAULT			// return EFAULT
 	br.ret.sptk.few rp
 END(copyerr)
+
+/*
+ * Support functions for handling of unaligned memory accesses.
+ */
+ENTRY(spillfd, 2)
+	ldfd		f6 = [r32]
+	;;
+	stf.spill	[r33] = f6
+	br.ret.sptk	rp
+END(spillfd)

==== //depot/projects/netperf/sys/ia64/ia64/trap.c#7 (text+ko) ====

@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/ia64/ia64/trap.c,v 1.91 2003/10/09 10:17:16 robert Exp $");
+__FBSDID("$FreeBSD: src/sys/ia64/ia64/trap.c,v 1.92 2003/10/23 06:21:44 marcel Exp $");
 
 #include "opt_ddb.h"
 #include "opt_ktrace.h"
@@ -81,9 +81,7 @@
 
 static int print_usertrap = 0;
 SYSCTL_INT(_machdep, OID_AUTO, print_usertrap,
-        CTLFLAG_RW, &print_usertrap, 0, "");
-
-extern int unaligned_fixup(struct trapframe *framep, struct thread *td);
+    CTLFLAG_RW, &print_usertrap, 0, "");
 
 static void break_syscall(struct trapframe *tf);
 static void ia32_syscall(struct trapframe *framep);

==== //depot/projects/netperf/sys/ia64/ia64/unaligned.c#2 (text+ko) ====

@@ -1,4 +1,5 @@
 /*-
+ * Copyright (c) 2003 Marcel Moolenaar
  * Copyright (c) 2001 Doug Rabson
  * All rights reserved.
  *
@@ -23,7 +24,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/ia64/ia64/unaligned.c,v 1.4 2003/05/29 06:30:36 marcel Exp $
+ * $FreeBSD: src/sys/ia64/ia64/unaligned.c,v 1.5 2003/10/23 06:32:34 marcel Exp $
  */
 
 #include <sys/param.h>
@@ -34,627 +35,180 @@
 #include <vm/vm.h>
 #include <vm/vm_extern.h>
 #include <machine/frame.h>
-#include <machine/inst.h>
+#include <machine/md_var.h>
+#include <ia64/disasm/disasm.h>
 
-#define sign_extend(imm, w) (((int64_t)(imm) << (64 - (w))) >> (64 - (w)))
+static int ia64_unaligned_print = 1;	/* warn about unaligned accesses. */
+static int ia64_unaligned_sigbus = 0;	/* SIGBUS on all unaligned accesses. */
 
-static int ia64_unaligned_print = 1;	/* warn about unaligned accesses */
-static int ia64_unaligned_fix = 1;	/* fix up unaligned accesses */
-static int ia64_unaligned_sigbus = 0;	/* don't SIGBUS on fixed-up accesses */
-
 SYSCTL_INT(_machdep, OID_AUTO, unaligned_print, CTLFLAG_RW,
     &ia64_unaligned_print, 0, "warn about unaligned accesses");
 
-SYSCTL_INT(_machdep, OID_AUTO, unaligned_fix, CTLFLAG_RW,
-    &ia64_unaligned_fix, 0, "fix up unaligned accesses (if possible)");
-
 SYSCTL_INT(_machdep, OID_AUTO, unaligned_sigbus, CTLFLAG_RW,
     &ia64_unaligned_sigbus, 0, "do not SIGBUS on fixed-up accesses");
 
-int unaligned_fixup(struct trapframe *framep, struct thread *td);
-
-enum type {
-	LD_SA,
-	LD_S,
-	LD_A,
-	LD_C_CLR,
-	LD_C_NC,
-	LD
-};
-
-struct decoding {
-	int isload;		/* non-zero if load */
-	enum type type;		/* type of load or store */
-	int basereg;		/* address to load or store */
-	int reg;		/* register number to load or store */
-	int width;		/* number of bytes */
-	int update;		/* update value for basereg */
-	int updateisreg;	/* non-zero if update is a register */
-	int fence;		/* non-zero if fence needed */
-};
-
-static int
-unaligned_decode_M1(union ia64_instruction ins, struct decoding *d)
+static void *
+fpreg_ptr(mcontext_t *mc, int fr)
 {
-	static enum type types[] = {
-		LD, LD_S, LD_A,	LD_SA, LD,
-		LD, LD, LD_C_CLR, LD_C_NC, LD_C_CLR
-	};
-	d->isload = 1;
-	d->type = types[ins.M1.x6 >> 2];
-	d->basereg = ins.M1.r3;
-	d->reg = ins.M1.r1;
-	d->width = (1 << (ins.M1.x6 & 3));
-	if ((ins.M1.x6 >= 0x14 && ins.M1.x6 <= 0x17)
-	    || (ins.M1.x6 >= 0x28 && ins.M1.x6 <= 0x2b))
-	    d->fence = 1;
-	return 1;
-}
+	union _ia64_fpreg *p;
 
-static int
-unaligned_decode_M2(union ia64_instruction ins, struct decoding *d)
-{
-	static enum type types[] = {
-		LD, LD_S, LD_A,	LD_SA, LD,
-		LD, LD, LD_C_CLR, LD_C_NC, LD_C_CLR
-	};
-	d->isload = 1;
-	d->type = types[ins.M1.x6 >> 2];
-	d->basereg = ins.M2.r3;
-	d->reg = ins.M2.r1;
-	d->width = (1 << (ins.M2.x6 & 3));
-	d->update = ins.M2.r2;
-	d->updateisreg = 1;
-	if ((ins.M2.x6 >= 0x14 && ins.M2.x6 <= 0x17)
-	    || (ins.M2.x6 >= 0x28 && ins.M2.x6 <= 0x2b))
-	    d->fence = 1;
-	return 1;
+	if (fr <= 1 || fr >= 128)
+		return (NULL);
+	if (fr >= 32) {
+		p = &mc->mc_high_fp.fr32;
+		fr -= 32;
+	} else if (fr >= 16) {
+		p = &mc->mc_preserved_fp.fr16;
+		fr -= 16;
+	} else if (fr >= 6) {
+		p = &mc->mc_scratch_fp.fr6;
+		fr -= 6;
+	} else {
+		p = &mc->mc_preserved_fp.fr2;
+		fr -= 2;
+	}
+	return ((void*)(p + fr));
 }
 
-static int
-unaligned_decode_M3(union ia64_instruction ins, struct decoding *d)
+static void *
+greg_ptr(mcontext_t *mc, int gr)
 {
-	static enum type types[] = {
-		LD, LD_S, LD_A,	LD_SA, LD,
-		LD, LD, LD_C_CLR, LD_C_NC, LD_C_CLR
-	};
-	d->isload = 1;
-	d->type = types[ins.M1.x6 >> 2];
-	d->basereg = ins.M3.r3;
-	d->reg = ins.M3.r1;
-	d->width = (1 << (ins.M3.x6 & 3));
-	d->update = sign_extend((ins.M3.s << 8)
-				| (ins.M3.i << 7)
-				| ins.M3.imm7b, 9);
-	if ((ins.M3.x6 >= 0x14 && ins.M3.x6 <= 0x17)
-	    || (ins.M3.x6 >= 0x28 && ins.M3.x6 <= 0x2b))
-	    d->fence = 1;
-	return 1;
-}
+	uint64_t *p;
 
-static int
-unaligned_decode_M4(union ia64_instruction ins, struct decoding *d)
-{
-	d->isload = 0;
-	d->basereg = ins.M4.r3;
-	d->reg = ins.M4.r2;
-	d->width = (1 << (ins.M4.x6 & 3));
-	if (ins.M4.x6 >= 0x34 && ins.M4.x6 <= 0x37)
-	    d->fence = 1;
-	return 1;
+	if (gr <= 0 || gr >= 32 + (mc->mc_special.cfm & 0x7f))
+		return (NULL);
+	if (gr >= 32) {
+		p = (void*)mc->mc_special.bspstore;
+		p += gr - 32;
+		gr = 0;
+	} else if (gr >= 14) {
+		p = &mc->mc_scratch.gr14;
+		gr -= 14;
+	} else if (gr == 13) {
+		p = &mc->mc_special.tp;
+		gr = 0;
+	} else if (gr == 12) {
+		p = &mc->mc_special.sp;
+		gr = 0;
+	} else if (gr >= 8) {
+		p = &mc->mc_scratch.gr8;
+		gr -= 8;
+	} else if (gr >= 4) {
+		p = &mc->mc_preserved.gr4;
+		gr -= 4;
+	} else if (gr >= 2) {
+		p = &mc->mc_scratch.gr2;
+		gr -= 2;
+	} else {
+		p = &mc->mc_special.gp;
+		gr = 0;
+	}
+	return ((void*)(p + gr));
 }
 
 static int
-unaligned_decode_M5(union ia64_instruction ins, struct decoding *d)
+fixup(struct asm_inst *i, mcontext_t *mc, uint64_t va)
 {
-	d->isload = 0;
-	d->basereg = ins.M5.r3;
-	d->reg = ins.M5.r2;
-	d->width = (1 << (ins.M5.x6 & 3));
-	d->update = sign_extend((ins.M5.s << 8)
-				| (ins.M5.i << 7)
-				| ins.M5.imm7a, 9);
-	if (ins.M5.x6 >= 0x34 && ins.M5.x6 <= 0x37)
-	    d->fence = 1;
-	return 1;
-}
+	union {
+		double d;
+		uint64_t i;
+	} buf;
+	void *reg;
+	uint64_t postinc;
 
-static int
-read_register(struct trapframe *framep, struct thread *td,
-	      int reg, u_int64_t *valuep)
-{
-
-	if (reg < 32) {
-		switch (reg) {
-		case 0:  *valuep = 0; break;
-		case 1:  *valuep = framep->tf_special.gp; break;
-		case 2:	 *valuep = framep->tf_scratch.gr2; break;
-		case 3:  *valuep = framep->tf_scratch.gr3; break;
-		case 8:  *valuep = framep->tf_scratch.gr8; break;
-		case 9:  *valuep = framep->tf_scratch.gr9; break;
-		case 10: *valuep = framep->tf_scratch.gr10; break;
-		case 11: *valuep = framep->tf_scratch.gr11; break;
-		case 12: *valuep = framep->tf_special.sp; break;
-		case 13: *valuep = framep->tf_special.tp; break;
-		case 14: *valuep = framep->tf_scratch.gr14; break;
-		case 15: *valuep = framep->tf_scratch.gr15; break;
-		case 16: *valuep = framep->tf_scratch.gr16; break;
-		case 17: *valuep = framep->tf_scratch.gr17; break;
-		case 18: *valuep = framep->tf_scratch.gr18; break;
-		case 19: *valuep = framep->tf_scratch.gr19; break;
-		case 20: *valuep = framep->tf_scratch.gr20; break;
-		case 21: *valuep = framep->tf_scratch.gr21; break;
-		case 22: *valuep = framep->tf_scratch.gr22; break;
-		case 23: *valuep = framep->tf_scratch.gr23; break;
-		case 24: *valuep = framep->tf_scratch.gr24; break;
-		case 25: *valuep = framep->tf_scratch.gr25; break;
-		case 26: *valuep = framep->tf_scratch.gr26; break;
-		case 27: *valuep = framep->tf_scratch.gr27; break;
-		case 28: *valuep = framep->tf_scratch.gr28; break;
-		case 29: *valuep = framep->tf_scratch.gr29; break;
-		case 30: *valuep = framep->tf_scratch.gr30; break;
-		case 31: *valuep = framep->tf_scratch.gr31; break;
-		default:
+	switch (i->i_op) {
+	case ASM_OP_LD8:
+		copyin((void*)va, (void*)&buf.i, 8);
+		reg = greg_ptr(mc, (int)i->i_oper[1].o_value);
+		if (reg == NULL)
+			return (EINVAL);
+		suword(reg, buf.i);
+		break;
+	case ASM_OP_LDFD:
+		copyin((void*)va, (void*)&buf.d, 8);
+		reg = fpreg_ptr(mc, (int)i->i_oper[1].o_value);
+		if (reg == NULL)
 			return (EINVAL);
-		}
-	} else {
-#if 0
-		u_int64_t cfm = framep->tf_special.cfm;
-		u_int64_t *bsp = (u_int64_t *)(td->td_kstack +
-		    framep->tf_ndirty);
-		int sof = cfm & 0x7f;
-		int sor = 8*((cfm >> 14) & 15);
-		int rrb_gr = (cfm >> 18) & 0x7f;
-
-		/*
-		 * Skip back to the start of the interrupted frame.
-		 */
-		bsp = ia64_rse_previous_frame(bsp, sof);
-
-		if (reg - 32 > sof)
-			return EINVAL;
-		if (reg - 32 < sor) {
-			if (reg - 32 + rrb_gr >= sor)
-				reg = reg + rrb_gr - sor;
-			else
-				reg = reg + rrb_gr;
-		}
-
-		*valuep = *ia64_rse_register_address(bsp, reg);
-		return (0);
-#else
-		return (EINVAL);
-#endif
+		spillfd((void*)&buf.d, reg);
+		break;
+	default:
+		return (ENOENT);
 	}
-	return (0);
-}
 
-static int
-write_register(struct trapframe *framep, struct thread *td,
-	      int reg, u_int64_t value)
-{
-
-	if (reg < 32) {
-		switch (reg) {
-		case 1:  framep->tf_special.gp = value; break;
-		case 2:	 framep->tf_scratch.gr2 = value; break;
-		case 3:  framep->tf_scratch.gr3 = value; break;
-		case 8:  framep->tf_scratch.gr8 = value; break;
-		case 9:  framep->tf_scratch.gr9 = value; break;
-		case 10: framep->tf_scratch.gr10 = value; break;
-		case 11: framep->tf_scratch.gr11 = value; break;
-		case 12: framep->tf_special.sp = value; break;
-		case 13: framep->tf_special.tp = value; break;
-		case 14: framep->tf_scratch.gr14 = value; break;
-		case 15: framep->tf_scratch.gr15 = value; break;
-		case 16: framep->tf_scratch.gr16 = value; break;
-		case 17: framep->tf_scratch.gr17 = value; break;
-		case 18: framep->tf_scratch.gr18 = value; break;
-		case 19: framep->tf_scratch.gr19 = value; break;
-		case 20: framep->tf_scratch.gr20 = value; break;
-		case 21: framep->tf_scratch.gr21 = value; break;
-		case 22: framep->tf_scratch.gr22 = value; break;
-		case 23: framep->tf_scratch.gr23 = value; break;
-		case 24: framep->tf_scratch.gr24 = value; break;
-		case 25: framep->tf_scratch.gr25 = value; break;
-		case 26: framep->tf_scratch.gr26 = value; break;
-		case 27: framep->tf_scratch.gr27 = value; break;
-		case 28: framep->tf_scratch.gr28 = value; break;
-		case 29: framep->tf_scratch.gr29 = value; break;
-		case 30: framep->tf_scratch.gr30 = value; break;
-		case 31: framep->tf_scratch.gr31 = value; break;
-		default:
+	/* Handle post-increment. */
+	if (i->i_oper[3].o_type == ASM_OPER_GREG) {
+		reg = greg_ptr(mc, (int)i->i_oper[3].o_value);
+		if (reg == NULL)
+			return (EINVAL);
+		postinc = fuword(reg);
+	} else
+		postinc = (i->i_oper[3].o_type == ASM_OPER_IMM)
+		    ? i->i_oper[3].o_value : 0;
+	if (postinc != 0) {
+		reg = greg_ptr(mc, (int)i->i_oper[3].o_value);
+		if (reg == NULL)
 			return (EINVAL);
-		}
-	} else {
-#if 0
-		u_int64_t cfm = framep->tf_special.cfm;
-		u_int64_t *bsp = (u_int64_t *) (td->td_kstack
-						+ framep->tf_ndirty);
-		int sof = cfm & 0x7f;
-		int sor = 8*((cfm >> 14) & 15);
-		int rrb_gr = (cfm >> 18) & 0x7f;
-
-		/*
-		 * Skip back to the start of the interrupted frame.
-		 */
-		bsp = ia64_rse_previous_frame(bsp, sof);
-
-		if (reg - 32 > sof)
-			return EINVAL;
-		if (reg - 32 < sor) {
-			if (reg - 32 + rrb_gr >= sor)
-				reg = reg + rrb_gr - sor;
-			else
-				reg = reg + rrb_gr;
-		}
-
-		*ia64_rse_register_address(bsp, reg) = value;
-		return 0;
-#else
-		return (EINVAL);
-#endif
+		postinc += fuword(reg);
+		suword(reg, postinc);
 	}
 	return (0);
 }
 
-/*
- * Messy.
- */
-static void
-invala_e(int reg)
-{
-	switch (reg) {
-	case   0:	__asm __volatile("invala.e r0"); break;
-	case   1:	__asm __volatile("invala.e r1"); break;
-	case   2:	__asm __volatile("invala.e r2"); break;
-	case   3:	__asm __volatile("invala.e r3"); break;
-	case   4:	__asm __volatile("invala.e r4"); break;
-	case   5:	__asm __volatile("invala.e r5"); break;
-	case   6:	__asm __volatile("invala.e r6"); break;
-	case   7:	__asm __volatile("invala.e r7"); break;
-	case   8:	__asm __volatile("invala.e r8"); break;
-	case   9:	__asm __volatile("invala.e r9"); break;
-	case  10:	__asm __volatile("invala.e r10"); break;
-	case  11:	__asm __volatile("invala.e r11"); break;
-	case  12:	__asm __volatile("invala.e r12"); break;
-	case  13:	__asm __volatile("invala.e r13"); break;
-	case  14:	__asm __volatile("invala.e r14"); break;
-	case  15:	__asm __volatile("invala.e r15"); break;
-	case  16:	__asm __volatile("invala.e r16"); break;
-	case  17:	__asm __volatile("invala.e r17"); break;
-	case  18:	__asm __volatile("invala.e r18"); break;
-	case  19:	__asm __volatile("invala.e r19"); break;
-	case  20:	__asm __volatile("invala.e r20"); break;
-	case  21:	__asm __volatile("invala.e r21"); break;
-	case  22:	__asm __volatile("invala.e r22"); break;
-	case  23:	__asm __volatile("invala.e r23"); break;
-	case  24:	__asm __volatile("invala.e r24"); break;
-	case  25:	__asm __volatile("invala.e r25"); break;
-	case  26:	__asm __volatile("invala.e r26"); break;
-	case  27:	__asm __volatile("invala.e r27"); break;
-	case  28:	__asm __volatile("invala.e r28"); break;
-	case  29:	__asm __volatile("invala.e r29"); break;
-	case  30:	__asm __volatile("invala.e r30"); break;
-	case  31:	__asm __volatile("invala.e r31"); break;
-	case  32:	__asm __volatile("invala.e r32"); break;
-	case  33:	__asm __volatile("invala.e r33"); break;
-	case  34:	__asm __volatile("invala.e r34"); break;
-	case  35:	__asm __volatile("invala.e r35"); break;
-	case  36:	__asm __volatile("invala.e r36"); break;
-	case  37:	__asm __volatile("invala.e r37"); break;
-	case  38:	__asm __volatile("invala.e r38"); break;
-	case  39:	__asm __volatile("invala.e r39"); break;
-	case  40:	__asm __volatile("invala.e r40"); break;
-	case  41:	__asm __volatile("invala.e r41"); break;
-	case  42:	__asm __volatile("invala.e r42"); break;
-	case  43:	__asm __volatile("invala.e r43"); break;
-	case  44:	__asm __volatile("invala.e r44"); break;
-	case  45:	__asm __volatile("invala.e r45"); break;
-	case  46:	__asm __volatile("invala.e r46"); break;
-	case  47:	__asm __volatile("invala.e r47"); break;
-	case  48:	__asm __volatile("invala.e r48"); break;
-	case  49:	__asm __volatile("invala.e r49"); break;
-	case  50:	__asm __volatile("invala.e r50"); break;
-	case  51:	__asm __volatile("invala.e r51"); break;
-	case  52:	__asm __volatile("invala.e r52"); break;
-	case  53:	__asm __volatile("invala.e r53"); break;
-	case  54:	__asm __volatile("invala.e r54"); break;
-	case  55:	__asm __volatile("invala.e r55"); break;
-	case  56:	__asm __volatile("invala.e r56"); break;
-	case  57:	__asm __volatile("invala.e r57"); break;
-	case  58:	__asm __volatile("invala.e r58"); break;
-	case  59:	__asm __volatile("invala.e r59"); break;
-	case  60:	__asm __volatile("invala.e r60"); break;
-	case  61:	__asm __volatile("invala.e r61"); break;
-	case  62:	__asm __volatile("invala.e r62"); break;
-	case  63:	__asm __volatile("invala.e r63"); break;
-	case  64:	__asm __volatile("invala.e r64"); break;
-	case  65:	__asm __volatile("invala.e r65"); break;
-	case  66:	__asm __volatile("invala.e r66"); break;
-	case  67:	__asm __volatile("invala.e r67"); break;
-	case  68:	__asm __volatile("invala.e r68"); break;
-	case  69:	__asm __volatile("invala.e r69"); break;
-	case  70:	__asm __volatile("invala.e r70"); break;
-	case  71:	__asm __volatile("invala.e r71"); break;
-	case  72:	__asm __volatile("invala.e r72"); break;
-	case  73:	__asm __volatile("invala.e r73"); break;
-	case  74:	__asm __volatile("invala.e r74"); break;
-	case  75:	__asm __volatile("invala.e r75"); break;
-	case  76:	__asm __volatile("invala.e r76"); break;
-	case  77:	__asm __volatile("invala.e r77"); break;
-	case  78:	__asm __volatile("invala.e r78"); break;
-	case  79:	__asm __volatile("invala.e r79"); break;
-	case  80:	__asm __volatile("invala.e r80"); break;
-	case  81:	__asm __volatile("invala.e r81"); break;
-	case  82:	__asm __volatile("invala.e r82"); break;
-	case  83:	__asm __volatile("invala.e r83"); break;
-	case  84:	__asm __volatile("invala.e r84"); break;
-	case  85:	__asm __volatile("invala.e r85"); break;
-	case  86:	__asm __volatile("invala.e r86"); break;

>>> TRUNCATED FOR MAIL (1000 lines) <<<



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200310231952.h9NJqAkW083064>