Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 28 Mar 2010 22:30:14 +0000 (UTC)
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r205808 - in projects/altix/sys: amd64/amd64 amd64/ia32 amd64/linux32 arm/arm arm/xscale/ixp425 boot/i386/boot2 boot/i386/gptboot boot/i386/zfsboot compat/freebsd32 compat/ia32 compat/l...
Message-ID:  <201003282230.o2SMUE6x065614@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marcel
Date: Sun Mar 28 22:30:14 2010
New Revision: 205808
URL: http://svn.freebsd.org/changeset/base/205808

Log:
  Merge svn+ssh://svn.freebsd.org/base/head@205807

Deleted:
  projects/altix/sys/ia64/include/nexusvar.h
Modified:
  projects/altix/sys/amd64/amd64/machdep.c
  projects/altix/sys/amd64/amd64/pmap.c
  projects/altix/sys/amd64/ia32/ia32_signal.c
  projects/altix/sys/amd64/linux32/linux.h
  projects/altix/sys/amd64/linux32/linux32_sysvec.c
  projects/altix/sys/arm/arm/machdep.c
  projects/altix/sys/arm/xscale/ixp425/cambria_fled.c
  projects/altix/sys/boot/i386/boot2/boot2.c
  projects/altix/sys/boot/i386/gptboot/gptboot.c
  projects/altix/sys/boot/i386/zfsboot/zfsboot.c
  projects/altix/sys/compat/freebsd32/freebsd32.h
  projects/altix/sys/compat/freebsd32/freebsd32_misc.c
  projects/altix/sys/compat/ia32/ia32_signal.h
  projects/altix/sys/compat/linprocfs/linprocfs.c
  projects/altix/sys/compat/linux/linux_ioctl.c
  projects/altix/sys/compat/linux/linux_stats.c
  projects/altix/sys/compat/svr4/svr4_stat.c
  projects/altix/sys/compat/x86bios/x86bios.c
  projects/altix/sys/conf/kern.post.mk
  projects/altix/sys/conf/kmod.mk
  projects/altix/sys/conf/options
  projects/altix/sys/dev/ata/ata-raid.c
  projects/altix/sys/dev/bge/if_bge.c
  projects/altix/sys/dev/bktr/ioctl_bt848.h
  projects/altix/sys/dev/bktr/ioctl_meteor.h
  projects/altix/sys/dev/fb/vesa.c
  projects/altix/sys/dev/fb/vga.c
  projects/altix/sys/dev/hwpmc/hwpmc_logging.c
  projects/altix/sys/dev/isp/isp.c
  projects/altix/sys/dev/isp/isp_freebsd.c
  projects/altix/sys/dev/isp/isp_freebsd.h
  projects/altix/sys/dev/isp/isp_library.c
  projects/altix/sys/dev/isp/ispvar.h
  projects/altix/sys/dev/ixgbe/LICENSE
  projects/altix/sys/dev/ixgbe/ixgbe.c
  projects/altix/sys/dev/ixgbe/ixgbe.h
  projects/altix/sys/dev/ixgbe/ixgbe_82598.c
  projects/altix/sys/dev/ixgbe/ixgbe_82599.c
  projects/altix/sys/dev/ixgbe/ixgbe_api.c
  projects/altix/sys/dev/ixgbe/ixgbe_api.h
  projects/altix/sys/dev/ixgbe/ixgbe_common.c
  projects/altix/sys/dev/ixgbe/ixgbe_phy.c
  projects/altix/sys/dev/ixgbe/ixgbe_phy.h
  projects/altix/sys/dev/ixgbe/ixgbe_type.h
  projects/altix/sys/dev/ofw/ofw_standard.c
  projects/altix/sys/dev/ppc/ppc_pci.c
  projects/altix/sys/dev/sound/pcm/dsp.c
  projects/altix/sys/dev/syscons/scvgarndr.c
  projects/altix/sys/dev/usb/controller/ehci_pci.c
  projects/altix/sys/dev/usb/controller/ohci_pci.c
  projects/altix/sys/dev/usb/input/ukbd.c
  projects/altix/sys/dev/usb/quirk/usb_quirk.c
  projects/altix/sys/dev/usb/usb_compat_linux.c
  projects/altix/sys/dev/usb/usbdevs
  projects/altix/sys/fs/nfs/nfs_commonport.c
  projects/altix/sys/fs/nfsserver/nfs_nfsdport.c
  projects/altix/sys/geom/geom_io.c
  projects/altix/sys/i386/i386/machdep.c
  projects/altix/sys/i386/i386/mca.c
  projects/altix/sys/i386/i386/pmap.c
  projects/altix/sys/i386/ibcs2/ibcs2_stat.c
  projects/altix/sys/i386/include/md_var.h
  projects/altix/sys/i386/include/specialreg.h
  projects/altix/sys/i386/linux/linux.h
  projects/altix/sys/i386/linux/linux_sysvec.c
  projects/altix/sys/ia64/conf/GENERIC
  projects/altix/sys/ia64/ia32/ia32_signal.c
  projects/altix/sys/ia64/ia64/autoconf.c
  projects/altix/sys/ia64/ia64/clock.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/nexus.c
  projects/altix/sys/ia64/ia64/sapic.c
  projects/altix/sys/ia64/ia64/trap.c
  projects/altix/sys/ia64/include/acpica_machdep.h
  projects/altix/sys/ia64/include/cpufunc.h
  projects/altix/sys/ia64/include/intr.h
  projects/altix/sys/ia64/include/pcpu.h
  projects/altix/sys/kern/imgact_elf.c
  projects/altix/sys/kern/kern_exec.c
  projects/altix/sys/kern/kern_rwlock.c
  projects/altix/sys/kern/sys_pipe.c
  projects/altix/sys/kern/tty_pts.c
  projects/altix/sys/kern/uipc_mqueue.c
  projects/altix/sys/kern/uipc_sem.c
  projects/altix/sys/kern/uipc_shm.c
  projects/altix/sys/kern/vfs_lookup.c
  projects/altix/sys/kern/vfs_syscalls.c
  projects/altix/sys/kern/vfs_vnops.c
  projects/altix/sys/mips/include/cpufunc.h
  projects/altix/sys/mips/mips/pm_machdep.c
  projects/altix/sys/mips/mips/support.S
  projects/altix/sys/mips/mips/tick.c
  projects/altix/sys/mips/sibyte/sb_asm.S
  projects/altix/sys/mips/sibyte/sb_scd.c
  projects/altix/sys/modules/Makefile
  projects/altix/sys/modules/dummynet/Makefile
  projects/altix/sys/modules/ixgbe/Makefile
  projects/altix/sys/net/flowtable.c
  projects/altix/sys/net/if_media.h
  projects/altix/sys/net80211/ieee80211.c
  projects/altix/sys/net80211/ieee80211_hostap.c
  projects/altix/sys/net80211/ieee80211_ht.c
  projects/altix/sys/net80211/ieee80211_var.h
  projects/altix/sys/netgraph/netflow/ng_netflow.c
  projects/altix/sys/netinet/ip_input.c
  projects/altix/sys/netinet/ipfw/ip_dn_io.c
  projects/altix/sys/netinet/sctp_indata.c
  projects/altix/sys/netinet/sctp_input.c
  projects/altix/sys/netinet/sctp_output.c
  projects/altix/sys/netinet/sctp_pcb.c
  projects/altix/sys/netinet/sctp_pcb.h
  projects/altix/sys/netinet/sctp_sysctl.c
  projects/altix/sys/netinet/sctp_uio.h
  projects/altix/sys/netinet/sctputil.c
  projects/altix/sys/netinet/sctputil.h
  projects/altix/sys/netinet6/nd6.c
  projects/altix/sys/netipsec/key.c
  projects/altix/sys/nfsserver/nfs_srvsubs.c
  projects/altix/sys/pc98/pc98/machdep.c
  projects/altix/sys/powerpc/aim/machdep.c
  projects/altix/sys/powerpc/aim/nexus.c
  projects/altix/sys/powerpc/aim/ofw_machdep.c
  projects/altix/sys/powerpc/booke/interrupt.c
  projects/altix/sys/powerpc/booke/machdep.c
  projects/altix/sys/powerpc/booke/trap_subr.S
  projects/altix/sys/powerpc/mpc85xx/ocpbus.c
  projects/altix/sys/powerpc/mpc85xx/ocpbus.h
  projects/altix/sys/powerpc/mpc85xx/pci_ocp.c
  projects/altix/sys/powerpc/ofw/ofw_real.c
  projects/altix/sys/powerpc/ofw/ofw_syscons.c
  projects/altix/sys/powerpc/powermac/cuda.c
  projects/altix/sys/powerpc/powermac/cudavar.h
  projects/altix/sys/powerpc/powermac/pmu.c
  projects/altix/sys/powerpc/powermac/smu.c
  projects/altix/sys/powerpc/powerpc/cpu.c
  projects/altix/sys/rpc/svc.c
  projects/altix/sys/sparc64/sparc64/machdep.c
  projects/altix/sys/sun4v/sun4v/machdep.c
  projects/altix/sys/sys/_timespec.h
  projects/altix/sys/sys/imgact.h
  projects/altix/sys/sys/param.h
  projects/altix/sys/sys/stat.h
  projects/altix/sys/sys/sysent.h
  projects/altix/sys/sys/timespec.h
  projects/altix/sys/vm/uma_int.h
  projects/altix/sys/vm/vm_mmap.c
Directory Properties:
  projects/altix/lib/libstand/   (props changed)
  projects/altix/sys/   (props changed)

Modified: projects/altix/sys/amd64/amd64/machdep.c
==============================================================================
--- projects/altix/sys/amd64/amd64/machdep.c	Sun Mar 28 21:14:08 2010	(r205807)
+++ projects/altix/sys/amd64/amd64/machdep.c	Sun Mar 28 22:30:14 2010	(r205808)
@@ -841,11 +841,7 @@ SYSCTL_PROC(_machdep, OID_AUTO, idle, CT
  * Reset registers to default values on exec.
  */
 void
-exec_setregs(td, entry, stack, ps_strings)
-	struct thread *td;
-	u_long entry;
-	u_long stack;
-	u_long ps_strings;
+exec_setregs(struct thread *td, struct image_params *imgp, u_long stack)
 {
 	struct trapframe *regs = td->td_frame;
 	struct pcb *pcb = td->td_pcb;
@@ -863,7 +859,7 @@ exec_setregs(td, entry, stack, ps_string
 	pcb->pcb_full_iret = 1;
 
 	bzero((char *)regs, sizeof(struct trapframe));
-	regs->tf_rip = entry;
+	regs->tf_rip = imgp->entry_addr;
 	regs->tf_rsp = ((stack - 8) & ~0xFul) + 8;
 	regs->tf_rdi = stack;		/* argv */
 	regs->tf_rflags = PSL_USER | (regs->tf_rflags & PSL_T);

Modified: projects/altix/sys/amd64/amd64/pmap.c
==============================================================================
--- projects/altix/sys/amd64/amd64/pmap.c	Sun Mar 28 21:14:08 2010	(r205807)
+++ projects/altix/sys/amd64/amd64/pmap.c	Sun Mar 28 22:30:14 2010	(r205808)
@@ -880,9 +880,12 @@ pmap_update_pde_invalidate(vm_offset_t v
 		load_cr4(cr4 & ~CR4_PGE);
 		/*
 		 * Although preemption at this point could be detrimental to
-		 * performance, it would not lead to an error.
+		 * performance, it would not lead to an error.  PG_G is simply
+		 * ignored if CR4.PGE is clear.  Moreover, in case this block
+		 * is re-entered, the load_cr4() either above or below will
+		 * modify CR4.PGE flushing the TLB.
 		 */
-		load_cr4(cr4);
+		load_cr4(cr4 | CR4_PGE);
 	}
 }
 #ifdef SMP

Modified: projects/altix/sys/amd64/ia32/ia32_signal.c
==============================================================================
--- projects/altix/sys/amd64/ia32/ia32_signal.c	Sun Mar 28 21:14:08 2010	(r205807)
+++ projects/altix/sys/amd64/ia32/ia32_signal.c	Sun Mar 28 22:30:14 2010	(r205808)
@@ -701,11 +701,7 @@ freebsd32_sigreturn(td, uap)
  * Clear registers on exec
  */
 void
-ia32_setregs(td, entry, stack, ps_strings)
-	struct thread *td;
-	u_long entry;
-	u_long stack;
-	u_long ps_strings;
+ia32_setregs(struct thread *td, struct image_params *imgp, u_long stack)
 {
 	struct trapframe *regs = td->td_frame;
 	struct pcb *pcb = td->td_pcb;
@@ -721,12 +717,12 @@ ia32_setregs(td, entry, stack, ps_string
 	pcb->pcb_initial_fpucw = __INITIAL_FPUCW_I386__;
 
 	bzero((char *)regs, sizeof(struct trapframe));
-	regs->tf_rip = entry;
+	regs->tf_rip = imgp->entry_addr;
 	regs->tf_rsp = stack;
 	regs->tf_rflags = PSL_USER | (regs->tf_rflags & PSL_T);
 	regs->tf_ss = _udatasel;
 	regs->tf_cs = _ucode32sel;
-	regs->tf_rbx = ps_strings;
+	regs->tf_rbx = imgp->ps_strings;
 	regs->tf_ds = _udatasel;
 	regs->tf_es = _udatasel;
 	regs->tf_fs = _ufssel;

Modified: projects/altix/sys/amd64/linux32/linux.h
==============================================================================
--- projects/altix/sys/amd64/linux32/linux.h	Sun Mar 28 21:14:08 2010	(r205807)
+++ projects/altix/sys/amd64/linux32/linux.h	Sun Mar 28 22:30:14 2010	(r205808)
@@ -203,9 +203,9 @@ struct l_newstat {
 	l_ulong		st_size;
 	l_ulong		st_blksize;
 	l_ulong		st_blocks;
-	struct l_timespec	st_atimespec;
-	struct l_timespec	st_mtimespec;
-	struct l_timespec	st_ctimespec;
+	struct l_timespec	st_atim;
+	struct l_timespec	st_mtim;
+	struct l_timespec	st_ctim;
 	l_ulong		__unused4;
 	l_ulong		__unused5;
 } __packed;
@@ -219,9 +219,9 @@ struct l_stat {
 	l_ushort	st_gid;
 	l_ushort	st_rdev;
 	l_long		st_size;
-	struct l_timespec	st_atimespec;
-	struct l_timespec	st_mtimespec;
-	struct l_timespec	st_ctimespec;
+	struct l_timespec	st_atim;
+	struct l_timespec	st_mtim;
+	struct l_timespec	st_ctim;
 	l_long		st_blksize;
 	l_long		st_blocks;
 	l_ulong		st_flags;
@@ -242,9 +242,9 @@ struct l_stat64 {
 	l_ulong		st_blksize;
 	l_ulong		st_blocks;
 	l_ulong		__pad4;
-	struct l_timespec	st_atimespec;
-	struct l_timespec	st_mtimespec;
-	struct l_timespec	st_ctimespec;
+	struct l_timespec	st_atim;
+	struct l_timespec	st_mtim;
+	struct l_timespec	st_ctim;
 	l_ulonglong	st_ino;
 } __packed;
 

Modified: projects/altix/sys/amd64/linux32/linux32_sysvec.c
==============================================================================
--- projects/altix/sys/amd64/linux32/linux32_sysvec.c	Sun Mar 28 21:14:08 2010	(r205807)
+++ projects/altix/sys/amd64/linux32/linux32_sysvec.c	Sun Mar 28 22:30:14 2010	(r205808)
@@ -124,8 +124,8 @@ static register_t *linux_copyout_strings
 static void	linux_prepsyscall(struct trapframe *tf, int *args, u_int *code,
 		    caddr_t *params);
 static void     linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask);
-static void	exec_linux_setregs(struct thread *td, u_long entry,
-				   u_long stack, u_long ps_strings);
+static void	exec_linux_setregs(struct thread *td, 
+				   struct image_params *imgp, u_long stack);
 static void	linux32_fixlimit(struct rlimit *rl, int which);
 static boolean_t linux32_trans_osrel(const Elf_Note *note, int32_t *osrel);
 
@@ -828,11 +828,7 @@ exec_linux_imgact_try(struct image_param
  * XXX copied from ia32_signal.c.
  */
 static void
-exec_linux_setregs(td, entry, stack, ps_strings)
-	struct thread *td;
-	u_long entry;
-	u_long stack;
-	u_long ps_strings;
+exec_linux_setregs(struct thread *td, struct image_params *imgp, u_long stack)
 {
 	struct trapframe *regs = td->td_frame;
 	struct pcb *pcb = td->td_pcb;
@@ -852,7 +848,7 @@ exec_linux_setregs(td, entry, stack, ps_
 	pcb->pcb_initial_fpucw = __LINUX_NPXCW__;
 
 	bzero((char *)regs, sizeof(struct trapframe));
-	regs->tf_rip = entry;
+	regs->tf_rip = imgp->entry_addr;
 	regs->tf_rsp = stack;
 	regs->tf_rflags = PSL_USER | (regs->tf_rflags & PSL_T);
 	regs->tf_gs = _ugssel;
@@ -862,7 +858,7 @@ exec_linux_setregs(td, entry, stack, ps_
 	regs->tf_ss = _udatasel;
 	regs->tf_flags = TF_HASSEGS;
 	regs->tf_cs = _ucode32sel;
-	regs->tf_rbx = ps_strings;
+	regs->tf_rbx = imgp->ps_strings;
 	td->td_pcb->pcb_full_iret = 1;
 	load_cr0(rcr0() | CR0_MP | CR0_TS);
 	fpstate_drop(td);

Modified: projects/altix/sys/arm/arm/machdep.c
==============================================================================
--- projects/altix/sys/arm/arm/machdep.c	Sun Mar 28 21:14:08 2010	(r205807)
+++ projects/altix/sys/arm/arm/machdep.c	Sun Mar 28 22:30:14 2010	(r205808)
@@ -516,15 +516,15 @@ spinlock_exit(void)
  * Clear registers on exec
  */
 void
-exec_setregs(struct thread *td, u_long entry, u_long stack, u_long ps_strings)
+exec_setregs(struct thread *td, struct image_params *imgp, u_long stack)
 {
 	struct trapframe *tf = td->td_frame;
 
 	memset(tf, 0, sizeof(*tf));
 	tf->tf_usr_sp = stack;
-	tf->tf_usr_lr = entry;
+	tf->tf_usr_lr = imgp->entry_addr;
 	tf->tf_svc_lr = 0x77777777;
-	tf->tf_pc = entry;
+	tf->tf_pc = imgp->entry_addr;
 	tf->tf_spsr = PSR_USR32_MODE;
 }
 

Modified: projects/altix/sys/arm/xscale/ixp425/cambria_fled.c
==============================================================================
--- projects/altix/sys/arm/xscale/ixp425/cambria_fled.c	Sun Mar 28 21:14:08 2010	(r205807)
+++ projects/altix/sys/arm/xscale/ixp425/cambria_fled.c	Sun Mar 28 22:30:14 2010	(r205808)
@@ -74,7 +74,7 @@ fled_attach(device_t dev)
 
 	sc->sc_led = led_create(fled_cb, dev, "front");
 
-	fled_cb(sc, 1);		/* Turn on LED */
+	fled_cb(dev, 1);		/* Turn on LED */
 
 	return 0;
 }

Modified: projects/altix/sys/boot/i386/boot2/boot2.c
==============================================================================
--- projects/altix/sys/boot/i386/boot2/boot2.c	Sun Mar 28 21:14:08 2010	(r205807)
+++ projects/altix/sys/boot/i386/boot2/boot2.c	Sun Mar 28 22:30:14 2010	(r205808)
@@ -283,7 +283,7 @@ main(void)
 
     for (;;) {
 	if (!autoboot || !OPT_CHECK(RBX_QUIET))
-	    printf("\nFreeBSD/i386 boot\n"
+	    printf("\nFreeBSD/x86 boot\n"
 		   "Default: %u:%s(%u,%c)%s\n"
 		   "boot: ",
 		   dsk.drive & DRV_MASK, dev_nm[dsk.type], dsk.unit,

Modified: projects/altix/sys/boot/i386/gptboot/gptboot.c
==============================================================================
--- projects/altix/sys/boot/i386/gptboot/gptboot.c	Sun Mar 28 21:14:08 2010	(r205807)
+++ projects/altix/sys/boot/i386/gptboot/gptboot.c	Sun Mar 28 22:30:14 2010	(r205808)
@@ -281,7 +281,7 @@ main(void)
 
     for (;;) {
 	if (!autoboot || !OPT_CHECK(RBX_QUIET))
-	    printf("\nFreeBSD/i386 boot\n"
+	    printf("\nFreeBSD/x86 boot\n"
 		   "Default: %u:%s(%up%u)%s\n"
 		   "boot: ",
 		   dsk.drive & DRV_MASK, dev_nm[dsk.type], dsk.unit,

Modified: projects/altix/sys/boot/i386/zfsboot/zfsboot.c
==============================================================================
--- projects/altix/sys/boot/i386/zfsboot/zfsboot.c	Sun Mar 28 21:14:08 2010	(r205807)
+++ projects/altix/sys/boot/i386/zfsboot/zfsboot.c	Sun Mar 28 22:30:14 2010	(r205808)
@@ -730,7 +730,7 @@ main(void)
 
     for (;;) {
 	if (!autoboot || !OPT_CHECK(RBX_QUIET))
-	    printf("\nFreeBSD/i386 boot\n"
+	    printf("\nFreeBSD/x86 boot\n"
 		   "Default: %s:%s\n"
 		   "boot: ",
 		   spa->spa_name, kname);

Modified: projects/altix/sys/compat/freebsd32/freebsd32.h
==============================================================================
--- projects/altix/sys/compat/freebsd32/freebsd32.h	Sun Mar 28 21:14:08 2010	(r205807)
+++ projects/altix/sys/compat/freebsd32/freebsd32.h	Sun Mar 28 22:30:14 2010	(r205808)
@@ -143,15 +143,15 @@ struct stat32 {
 	uid_t	st_uid;
 	gid_t	st_gid;
 	dev_t	st_rdev;
-	struct timespec32 st_atimespec;
-	struct timespec32 st_mtimespec;
-	struct timespec32 st_ctimespec;
+	struct timespec32 st_atim;
+	struct timespec32 st_mtim;
+	struct timespec32 st_ctim;
 	off_t	st_size;
 	int64_t	st_blocks;
 	u_int32_t st_blksize;
 	u_int32_t st_flags;
 	u_int32_t st_gen;
-	struct timespec32 st_birthtimespec;
+	struct timespec32 st_birthtim;
 	unsigned int :(8 / 2) * (16 - (int)sizeof(struct timespec32));
 	unsigned int :(8 / 2) * (16 - (int)sizeof(struct timespec32));
 };

Modified: projects/altix/sys/compat/freebsd32/freebsd32_misc.c
==============================================================================
--- projects/altix/sys/compat/freebsd32/freebsd32_misc.c	Sun Mar 28 21:14:08 2010	(r205807)
+++ projects/altix/sys/compat/freebsd32/freebsd32_misc.c	Sun Mar 28 22:30:14 2010	(r205808)
@@ -1634,9 +1634,9 @@ copy_stat( struct stat *in, struct stat3
 	CP(*in, *out, st_uid);
 	CP(*in, *out, st_gid);
 	CP(*in, *out, st_rdev);
-	TS_CP(*in, *out, st_atimespec);
-	TS_CP(*in, *out, st_mtimespec);
-	TS_CP(*in, *out, st_ctimespec);
+	TS_CP(*in, *out, st_atim);
+	TS_CP(*in, *out, st_mtim);
+	TS_CP(*in, *out, st_ctim);
 	CP(*in, *out, st_size);
 	CP(*in, *out, st_blocks);
 	CP(*in, *out, st_blksize);

Modified: projects/altix/sys/compat/ia32/ia32_signal.h
==============================================================================
--- projects/altix/sys/compat/ia32/ia32_signal.h	Sun Mar 28 21:14:08 2010	(r205807)
+++ projects/altix/sys/compat/ia32/ia32_signal.h	Sun Mar 28 22:30:14 2010	(r205808)
@@ -185,5 +185,5 @@ extern char freebsd4_ia32_sigcode[];
 extern int sz_ia32_sigcode;
 extern int sz_freebsd4_ia32_sigcode;
 extern void ia32_sendsig(sig_t, struct ksiginfo *, sigset_t *);
-extern void ia32_setregs(struct thread *td, u_long entry, u_long stack,
-    u_long ps_strings);
+extern void ia32_setregs(struct thread *td, struct image_params *imgp,
+    u_long stack);

Modified: projects/altix/sys/compat/linprocfs/linprocfs.c
==============================================================================
--- projects/altix/sys/compat/linprocfs/linprocfs.c	Sun Mar 28 21:14:08 2010	(r205807)
+++ projects/altix/sys/compat/linprocfs/linprocfs.c	Sun Mar 28 22:30:14 2010	(r205808)
@@ -1227,6 +1227,24 @@ linprocfs_docmdline(PFS_FILL_ARGS)
 	return (0);
 }
 
+/*
+ * Filler function for proc/filesystems
+ */
+static int
+linprocfs_dofilesystems(PFS_FILL_ARGS)
+{
+	struct vfsconf *vfsp;
+
+	mtx_lock(&Giant);
+	TAILQ_FOREACH(vfsp, &vfsconf, vfc_list) {
+		if (vfsp->vfc_flags & VFCF_SYNTHETIC)
+			sbuf_printf(sb, "nodev");
+		sbuf_printf(sb, "\t%s\n", vfsp->vfc_name);
+	}
+	mtx_unlock(&Giant);
+	return(0);
+}
+
 #if 0
 /*
  * Filler function for proc/modules
@@ -1276,6 +1294,8 @@ linprocfs_init(PFS_INIT_ARGS)
 	    NULL, NULL, NULL, PFS_RD);
 	pfs_create_file(root, "devices", &linprocfs_dodevices,
 	    NULL, NULL, NULL, PFS_RD);
+	pfs_create_file(root, "filesystems", &linprocfs_dofilesystems,
+	    NULL, NULL, NULL, PFS_RD);
 	pfs_create_file(root, "loadavg", &linprocfs_doloadavg,
 	    NULL, NULL, NULL, PFS_RD);
 	pfs_create_file(root, "meminfo", &linprocfs_domeminfo,

Modified: projects/altix/sys/compat/linux/linux_ioctl.c
==============================================================================
--- projects/altix/sys/compat/linux/linux_ioctl.c	Sun Mar 28 21:14:08 2010	(r205807)
+++ projects/altix/sys/compat/linux/linux_ioctl.c	Sun Mar 28 22:30:14 2010	(r205808)
@@ -2711,7 +2711,7 @@ linux_v4l_clip_copy(void *lvc, struct vi
 	/* XXX: If there can be no concurrency: s/M_NOWAIT/M_WAITOK/ */
 	if ((*ppvc = malloc(sizeof(**ppvc), M_LINUX, M_NOWAIT)) == NULL)
 		return (ENOMEM);    /* XXX: linux has no ENOMEM here */
-	memcpy(&vclip, *ppvc, sizeof(vclip));
+	memcpy(*ppvc, &vclip, sizeof(vclip));
 	(*ppvc)->next = NULL;
 	return (0);
 }
@@ -2726,6 +2726,8 @@ linux_v4l_cliplist_free(struct video_win
 		ppvc_next = &((*ppvc)->next);
 		free(*ppvc, M_LINUX);
 	}
+	vw->clips = NULL;
+
 	return (0);
 }
 

Modified: projects/altix/sys/compat/linux/linux_stats.c
==============================================================================
--- projects/altix/sys/compat/linux/linux_stats.c	Sun Mar 28 21:14:08 2010	(r205807)
+++ projects/altix/sys/compat/linux/linux_stats.c	Sun Mar 28 22:30:14 2010	(r205808)
@@ -173,9 +173,12 @@ newstat_copyout(struct stat *buf, void *
 	tbuf.st_gid = buf->st_gid;
 	tbuf.st_rdev = buf->st_rdev;
 	tbuf.st_size = buf->st_size;
-	tbuf.st_atime = buf->st_atime;
-	tbuf.st_mtime = buf->st_mtime;
-	tbuf.st_ctime = buf->st_ctime;
+	tbuf.st_atim.tv_sec = buf->st_atim.tv_sec;
+	tbuf.st_atim.tv_nsec = buf->st_atim.tv_nsec;
+	tbuf.st_mtim.tv_sec = buf->st_mtim.tv_sec;
+	tbuf.st_mtim.tv_nsec = buf->st_mtim.tv_nsec;
+	tbuf.st_ctim.tv_sec = buf->st_ctim.tv_sec;
+	tbuf.st_ctim.tv_nsec = buf->st_ctim.tv_nsec;
 	tbuf.st_blksize = buf->st_blksize;
 	tbuf.st_blocks = buf->st_blocks;
 
@@ -260,9 +263,12 @@ stat_copyout(struct stat *buf, void *ubu
 		lbuf.st_size = buf->st_size;
 	else
 		lbuf.st_size = -2;
-	lbuf.st_atime = buf->st_atime;
-	lbuf.st_mtime = buf->st_mtime;
-	lbuf.st_ctime = buf->st_ctime;
+	lbuf.st_atim.tv_sec = buf->st_atim.tv_sec;
+	lbuf.st_atim.tv_nsec = buf->st_atim.tv_nsec;
+	lbuf.st_mtim.tv_sec = buf->st_mtim.tv_sec;
+	lbuf.st_mtim.tv_nsec = buf->st_mtim.tv_nsec;
+	lbuf.st_ctim.tv_sec = buf->st_ctim.tv_sec;
+	lbuf.st_ctim.tv_nsec = buf->st_ctim.tv_nsec;
 	lbuf.st_blksize = buf->st_blksize;
 	lbuf.st_blocks = buf->st_blocks;
 	lbuf.st_flags = buf->st_flags;
@@ -498,9 +504,12 @@ stat64_copyout(struct stat *buf, void *u
 	lbuf.st_gid = buf->st_gid;
 	lbuf.st_rdev = buf->st_rdev;
 	lbuf.st_size = buf->st_size;
-	lbuf.st_atime = buf->st_atime;
-	lbuf.st_mtime = buf->st_mtime;
-	lbuf.st_ctime = buf->st_ctime;
+	lbuf.st_atim.tv_sec = buf->st_atim.tv_sec;
+	lbuf.st_atim.tv_nsec = buf->st_atim.tv_nsec;
+	lbuf.st_mtim.tv_sec = buf->st_mtim.tv_sec;
+	lbuf.st_mtim.tv_nsec = buf->st_mtim.tv_nsec;
+	lbuf.st_ctim.tv_sec = buf->st_ctim.tv_sec;
+	lbuf.st_ctim.tv_nsec = buf->st_ctim.tv_nsec;
 	lbuf.st_blksize = buf->st_blksize;
 	lbuf.st_blocks = buf->st_blocks;
 

Modified: projects/altix/sys/compat/svr4/svr4_stat.c
==============================================================================
--- projects/altix/sys/compat/svr4/svr4_stat.c	Sun Mar 28 21:14:08 2010	(r205807)
+++ projects/altix/sys/compat/svr4/svr4_stat.c	Sun Mar 28 22:30:14 2010	(r205808)
@@ -106,9 +106,9 @@ bsd_to_svr4_stat(st, st4)
 	st4->st_gid = st->st_gid;
 	st4->st_rdev = bsd_to_svr4_odev_t(st->st_rdev);
 	st4->st_size = st->st_size;
-	st4->st_atim = st->st_atimespec.tv_sec;
-	st4->st_mtim = st->st_mtimespec.tv_sec;
-	st4->st_ctim = st->st_ctimespec.tv_sec;
+	st4->st_atim = st->st_atim.tv_sec;
+	st4->st_mtim = st->st_mtim.tv_sec;
+	st4->st_ctim = st->st_ctim.tv_sec;
 }
 #endif
 
@@ -127,9 +127,9 @@ bsd_to_svr4_xstat(st, st4)
 	st4->st_gid = st->st_gid;
 	st4->st_rdev = bsd_to_svr4_dev_t(st->st_rdev);
 	st4->st_size = st->st_size;
-	st4->st_atim = st->st_atimespec;
-	st4->st_mtim = st->st_mtimespec;
-	st4->st_ctim = st->st_ctimespec;
+	st4->st_atim = st->st_atim;
+	st4->st_mtim = st->st_mtim;
+	st4->st_ctim = st->st_ctim;
 	st4->st_blksize = st->st_blksize;
 	st4->st_blocks = st->st_blocks;
 	strcpy(st4->st_fstype, "unknown");
@@ -150,9 +150,9 @@ bsd_to_svr4_stat64(st, st4)
 	st4->st_gid = st->st_gid;
 	st4->st_rdev = bsd_to_svr4_dev_t(st->st_rdev);
 	st4->st_size = st->st_size;
-	st4->st_atim = st->st_atimespec;
-	st4->st_mtim = st->st_mtimespec;
-	st4->st_ctim = st->st_ctimespec;
+	st4->st_atim = st->st_atim;
+	st4->st_mtim = st->st_mtim;
+	st4->st_ctim = st->st_ctim;
 	st4->st_blksize = st->st_blksize;
 	st4->st_blocks = st->st_blocks;
 	strcpy(st4->st_fstype, "unknown");

Modified: projects/altix/sys/compat/x86bios/x86bios.c
==============================================================================
--- projects/altix/sys/compat/x86bios/x86bios.c	Sun Mar 28 21:14:08 2010	(r205807)
+++ projects/altix/sys/compat/x86bios/x86bios.c	Sun Mar 28 22:30:14 2010	(r205808)
@@ -56,8 +56,7 @@ __FBSDID("$FreeBSD$");
 
 #define	X86BIOS_IVT_SIZE	0x00000500	/* 1K + 256 (BDA) */
 #define	X86BIOS_SEG_SIZE	0x00010000	/* 64K */
-#define	X86BIOS_MEM_SIZE	(0x00100000 + X86BIOS_SEG_SIZE)
-						/* 1M + 64K (high memory) */
+#define	X86BIOS_MEM_SIZE	0x00100000	/* 1M */
 
 #define	X86BIOS_IVT_BASE	0x00000000
 #define	X86BIOS_RAM_BASE	0x00001000
@@ -69,7 +68,6 @@ __FBSDID("$FreeBSD$");
 
 #define	X86BIOS_R_DS		_pad1
 #define	X86BIOS_R_SS		_pad2
-#define	X86BIOS_R_SP		_pad3.I16_reg.x_reg
 
 static struct x86emu x86bios_emu;
 
@@ -113,15 +111,16 @@ x86bios_set_fault(struct x86emu *emu, ui
 static void *
 x86bios_get_pages(uint32_t offset, size_t size)
 {
-	int i;
+	vm_offset_t page;
 
-	if (offset + size > X86BIOS_MEM_SIZE)
+	if (offset + size > X86BIOS_MEM_SIZE + X86BIOS_IVT_SIZE)
 		return (NULL);
 
-	i = offset / X86BIOS_PAGE_SIZE;
-	if (x86bios_map[i] != 0)
-		return ((void *)(x86bios_map[i] + offset -
-		    i * X86BIOS_PAGE_SIZE));
+	if (offset >= X86BIOS_MEM_SIZE)
+		offset -= X86BIOS_MEM_SIZE;
+	page = x86bios_map[offset / X86BIOS_PAGE_SIZE];
+	if (page != 0)
+		return ((void *)(page + offset % X86BIOS_PAGE_SIZE));
 
 	return (NULL);
 }
@@ -306,8 +305,8 @@ x86bios_emu_get_intr(struct x86emu *emu,
 	sp[2] = htole16(emu->x86.R_FLG);
 
 	iv = x86bios_get_intr(intno);
-	emu->x86.R_IP = iv & 0x000f;
-	emu->x86.R_CS = (iv >> 12) & 0xffff;
+	emu->x86.R_IP = iv & 0xffff;
+	emu->x86.R_CS = (iv >> 16) & 0xffff;
 	emu->x86.R_FLG &= ~(F_IF | F_TF);
 }
 
@@ -354,7 +353,6 @@ x86bios_init_regs(struct x86regs *regs)
 	bzero(regs, sizeof(*regs));
 	regs->X86BIOS_R_DS = 0x40;
 	regs->X86BIOS_R_SS = x86bios_seg_phys >> 4;
-	regs->X86BIOS_R_SP = 0xfffe;
 }
 
 void
@@ -526,13 +524,6 @@ x86bios_map_mem(void)
 		return (1);
 	}
 #endif
-	/* Change attribute for high memory. */
-	if (pmap_change_attr((vm_offset_t)x86bios_rom + X86BIOS_ROM_SIZE -
-	    X86BIOS_SEG_SIZE, X86BIOS_SEG_SIZE, PAT_WRITE_BACK) != 0) {
-		pmap_unmapdev((vm_offset_t)x86bios_ivt, X86BIOS_IVT_SIZE);
-		pmap_unmapdev((vm_offset_t)x86bios_rom, X86BIOS_ROM_SIZE);
-		return (1);
-	}
 
 	x86bios_seg = contigmalloc(X86BIOS_SEG_SIZE, M_DEVBUF, M_WAITOK,
 	    X86BIOS_RAM_BASE, x86bios_rom_phys, X86BIOS_PAGE_SIZE, 0);
@@ -556,10 +547,6 @@ x86bios_map_mem(void)
 		    X86BIOS_ROM_BASE, X86BIOS_MEM_SIZE - X86BIOS_SEG_SIZE - 1,
 		    (void *)((vm_offset_t)x86bios_rom + X86BIOS_ROM_BASE -
 		    (vm_offset_t)x86bios_rom_phys));
-		printf("x86bios: HIMEM 0x%06x-0x%06x at %p\n",
-		    X86BIOS_MEM_SIZE - X86BIOS_SEG_SIZE, X86BIOS_MEM_SIZE - 1,
-		    (void *)((vm_offset_t)x86bios_rom + X86BIOS_ROM_SIZE -
-		    X86BIOS_SEG_SIZE));
 	}
 
 	return (0);

Modified: projects/altix/sys/conf/kern.post.mk
==============================================================================
--- projects/altix/sys/conf/kern.post.mk	Sun Mar 28 21:14:08 2010	(r205807)
+++ projects/altix/sys/conf/kern.post.mk	Sun Mar 28 22:30:14 2010	(r205808)
@@ -15,6 +15,10 @@ MKMODULESENV+=	DESTDIR="${DESTDIR}"
 SYSDIR?= ${S:C;^[^/];${.CURDIR}/&;}
 MKMODULESENV+=	KERNBUILDDIR="${.CURDIR}" SYSDIR="${SYSDIR}"
 
+.if defined(CONF_CFLAGS)
+MKMODULESENV+=	CONF_CFLAGS="${CONF_CFLAGS}"
+.endif
+
 .MAIN: all
 
 .for target in all clean cleandepend cleandir clobber depend install \

Modified: projects/altix/sys/conf/kmod.mk
==============================================================================
--- projects/altix/sys/conf/kmod.mk	Sun Mar 28 21:14:08 2010	(r205807)
+++ projects/altix/sys/conf/kmod.mk	Sun Mar 28 22:30:14 2010	(r205808)
@@ -328,6 +328,9 @@ ${_src}:
 .endfor
 .endif
 
+# Respect configuration-specific C flags.
+CFLAGS+=	${CONF_CFLAGS}
+
 MFILES?= dev/acpica/acpi_if.m dev/acpi_support/acpi_wmi_if.m \
 	dev/agp/agp_if.m dev/ata/ata_if.m dev/eisa/eisa_if.m \
 	dev/iicbus/iicbb_if.m dev/iicbus/iicbus_if.m \

Modified: projects/altix/sys/conf/options
==============================================================================
--- projects/altix/sys/conf/options	Sun Mar 28 21:14:08 2010	(r205807)
+++ projects/altix/sys/conf/options	Sun Mar 28 22:30:14 2010	(r205808)
@@ -437,6 +437,7 @@ SCTP_MBCNT_LOGGING	opt_sctp.h # Log to K
 SCTP_PACKET_LOGGING	opt_sctp.h # Log to a packet buffer last N packets
 SCTP_LTRACE_CHUNKS	opt_sctp.h # Log to KTR chunks processed
 SCTP_LTRACE_ERRORS	opt_sctp.h # Log to KTR error returns.
+SCTP_USE_PERCPU_STAT    opt_sctp.h # Use per cpu stats.
 #
 #
 #

Modified: projects/altix/sys/dev/ata/ata-raid.c
==============================================================================
--- projects/altix/sys/dev/ata/ata-raid.c	Sun Mar 28 21:14:08 2010	(r205807)
+++ projects/altix/sys/dev/ata/ata-raid.c	Sun Mar 28 22:30:14 2010	(r205808)
@@ -2568,8 +2568,15 @@ ata_raid_intel_read_meta(device_t dev, s
 	if (meta->generation >= raid->generation) {
 	    for (disk = 0; disk < raid->total_disks; disk++) {
 		struct ata_device *atadev = device_get_softc(parent);
+		int len;
 
-		if (!strncmp(raid->disks[disk].serial, atadev->param.serial,
+		for (len = 0; len < sizeof(atadev->param.serial); len++) {
+		    if (atadev->param.serial[len] < 0x20)
+			break;
+		}
+		len = (len > sizeof(raid->disks[disk].serial)) ?
+		    len - sizeof(raid->disks[disk].serial) : 0;
+		if (!strncmp(raid->disks[disk].serial, atadev->param.serial + len,
 		    sizeof(raid->disks[disk].serial))) {
 		    raid->disks[disk].dev = parent;
 		    raid->disks[disk].flags |= (AR_DF_PRESENT | AR_DF_ONLINE);
@@ -2639,8 +2646,15 @@ ata_raid_intel_write_meta(struct ar_soft
 		device_get_softc(device_get_parent(rdp->disks[disk].dev));
 	    struct ata_device *atadev =
 		device_get_softc(rdp->disks[disk].dev);
+	    int len;
 
-	    bcopy(atadev->param.serial, meta->disk[disk].serial,
+	    for (len = 0; len < sizeof(atadev->param.serial); len++) {
+		if (atadev->param.serial[len] < 0x20)
+		    break;
+	    }
+	    len = (len > sizeof(rdp->disks[disk].serial)) ?
+	        len - sizeof(rdp->disks[disk].serial) : 0;
+	    bcopy(atadev->param.serial + len, meta->disk[disk].serial,
 		  sizeof(rdp->disks[disk].serial));
 	    meta->disk[disk].sectors = rdp->disks[disk].sectors;
 	    meta->disk[disk].id = (ch->unit << 16) | atadev->unit;

Modified: projects/altix/sys/dev/bge/if_bge.c
==============================================================================
--- projects/altix/sys/dev/bge/if_bge.c	Sun Mar 28 21:14:08 2010	(r205807)
+++ projects/altix/sys/dev/bge/if_bge.c	Sun Mar 28 22:30:14 2010	(r205808)
@@ -421,7 +421,6 @@ static uint32_t bge_readreg_ind(struct b
 #endif
 static void bge_writemem_direct(struct bge_softc *, int, int);
 static void bge_writereg_ind(struct bge_softc *, int, int);
-static void bge_set_max_readrq(struct bge_softc *);
 
 static int bge_miibus_readreg(device_t, int, int);
 static int bge_miibus_writereg(device_t, int, int, int);
@@ -561,32 +560,6 @@ bge_writemem_ind(struct bge_softc *sc, i
 	pci_write_config(dev, BGE_PCI_MEMWIN_BASEADDR, 0, 4);
 }
 
-/*
- * PCI Express only
- */
-static void
-bge_set_max_readrq(struct bge_softc *sc)
-{
-	device_t dev;
-	uint16_t val;
-
-	dev = sc->bge_dev;
-
-	val = pci_read_config(dev, sc->bge_expcap + PCIR_EXPRESS_DEVICE_CTL, 2);
-	if ((val & PCIM_EXP_CTL_MAX_READ_REQUEST) !=
-	    BGE_PCIE_DEVCTL_MAX_READRQ_4096) {
-		if (bootverbose)
-			device_printf(dev, "adjust device control 0x%04x ",
-			    val);
-		val &= ~PCIM_EXP_CTL_MAX_READ_REQUEST;
-		val |= BGE_PCIE_DEVCTL_MAX_READRQ_4096;
-		pci_write_config(dev, sc->bge_expcap + PCIR_EXPRESS_DEVICE_CTL,
-		    val, 2);
-		if (bootverbose)
-			printf("-> 0x%04x\n", val);
-	}
-}
-
 #ifdef notdef
 static uint32_t
 bge_readreg_ind(struct bge_softc *sc, int off)
@@ -2695,7 +2668,8 @@ bge_attach(device_t dev)
 		 */
 		sc->bge_flags |= BGE_FLAG_PCIE;
 		sc->bge_expcap = reg;
-		bge_set_max_readrq(sc);
+		if (pci_get_max_read_req(dev) != 4096)
+			pci_set_max_read_req(dev, 4096);
 	} else {
 		/*
 		 * Check if the device is in PCI-X Mode.

Modified: projects/altix/sys/dev/bktr/ioctl_bt848.h
==============================================================================
--- projects/altix/sys/dev/bktr/ioctl_bt848.h	Sun Mar 28 21:14:08 2010	(r205807)
+++ projects/altix/sys/dev/bktr/ioctl_bt848.h	Sun Mar 28 22:30:14 2010	(r205808)
@@ -89,9 +89,9 @@
  * EEProm stuff
  */
 struct eeProm {
-	short	offset;
-	short	count;
-	u_char	bytes[ 256 ];
+	short		offset;
+	short		count;
+	unsigned char	bytes[ 256 ];
 };
 
 
@@ -147,7 +147,7 @@ struct eeProm {
  * b23-b16:  i2c addr (write)
  * b31-b24:  1 = write, 0 = read 
  */
-#define BT848_I2CWR     _IOWR('x', 57, u_long)    /* i2c read-write */
+#define BT848_I2CWR     _IOWR('x', 57, unsigned long)    /* i2c read-write */
 
 struct bktr_msp_control {
 	unsigned char function;
@@ -192,10 +192,10 @@ typedef enum { METEOR_PIXTYPE_RGB, METEO
 
 
 struct meteor_pixfmt {
-	u_int          index;         /* Index in supported pixfmt list     */
+	unsigned int   index;         /* Index in supported pixfmt list     */
 	METEOR_PIXTYPE type;          /* What's the board gonna feed us     */
-	u_int          Bpp;           /* Bytes per pixel                    */
-	u_long         masks[3];      /* R,G,B or Y,U,V masks, respectively */
+	unsigned int   Bpp;           /* Bytes per pixel                    */
+	unsigned long  masks[3];      /* R,G,B or Y,U,V masks, respectively */
 	unsigned       swap_bytes :1; /* Bytes  swapped within shorts       */
 	unsigned       swap_shorts:1; /* Shorts swapped within longs        */
 };

Modified: projects/altix/sys/dev/bktr/ioctl_meteor.h
==============================================================================
--- projects/altix/sys/dev/bktr/ioctl_meteor.h	Sun Mar 28 21:14:08 2010	(r205807)
+++ projects/altix/sys/dev/bktr/ioctl_meteor.h	Sun Mar 28 22:30:14 2010	(r205808)
@@ -50,27 +50,27 @@ struct meteor_capframe {
 
 /* structure for METEOR[GS]ETGEO - get/set geometry  */
 struct meteor_geomet {
-	u_short		rows;
-	u_short		columns;
-	u_short		frames;
-	u_long		oformat;
+	unsigned short		rows;
+	unsigned short		columns;
+	unsigned short		frames;
+	unsigned long		oformat;
 } ;
 
 /* structure for METEORGCOUNT-get count of frames, fifo errors and dma errors */
 struct meteor_counts {
-	u_long fifo_errors;	/* count of fifo errors since open */
-	u_long dma_errors;	/* count of dma errors since open */
-	u_long frames_captured;	/* count of frames captured since open */
-	u_long even_fields_captured; /* count of even fields captured */
-	u_long odd_fields_captured; /* count of odd fields captured */
+	unsigned long fifo_errors;	/* count of fifo errors since open */
+	unsigned long dma_errors;	/* count of dma errors since open */
+	unsigned long frames_captured;	/* count of frames captured since open */
+	unsigned long even_fields_captured; /* count of even fields captured */
+	unsigned long odd_fields_captured; /* count of odd fields captured */
 } ;
 
 /* structure for getting and setting direct transfers to vram */
 struct meteor_video {
-	u_long	addr;	/* Address of location to dma to */
-	u_long	width;	/* Width of memory area */
-	u_long	banksize;	/* Size of Vram bank */
-	u_long	ramsize;	/* Size of Vram */
+	unsigned long	addr;		/* Address of location to dma to */
+	unsigned long	width;		/* Width of memory area */
+	unsigned long	banksize;	/* Size of Vram bank */
+	unsigned long	ramsize;	/* Size of Vram */
 };
 
 #define METEORCAPTUR _IOW('x', 1, int)			 /* capture a frame */

Modified: projects/altix/sys/dev/fb/vesa.c
==============================================================================
--- projects/altix/sys/dev/fb/vesa.c	Sun Mar 28 21:14:08 2010	(r205807)
+++ projects/altix/sys/dev/fb/vesa.c	Sun Mar 28 22:30:14 2010	(r205808)
@@ -1,5 +1,6 @@
 /*-
  * Copyright (c) 1998 Kazutaka YOKOTA and Michael Smith
+ * Copyright (c) 2009-2010 Jung-uk Kim <jkim@FreeBSD.org>
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -188,7 +189,7 @@ static int vesa_bios_load_palette2(int s
 #define STATE_ALL	(STATE_HW | STATE_DATA | STATE_DAC | STATE_REG)
 static ssize_t vesa_bios_state_buf_size(void);
 static int vesa_bios_save_restore(int code, void *p, size_t size);
-#if 0
+#ifdef MODE_TABLE_BROKEN
 static int vesa_bios_get_line_length(void);
 #endif
 static int vesa_bios_set_line_length(int pixel, int *bytes, int *lines);
@@ -199,6 +200,7 @@ static int vesa_bios_set_start(int x, in
 static int vesa_map_gen_mode_num(int type, int color, int mode);
 static int vesa_translate_flags(u_int16_t vflags);
 static int vesa_translate_mmodel(u_int8_t vmodel);
+static int vesa_get_bpscanline(struct vesa_mode *vmode);
 static int vesa_bios_init(void);
 static void vesa_clear_modes(video_info_t *info, int color);
 
@@ -558,7 +560,7 @@ vesa_bios_save_restore(int code, void *p
 	return (regs.R_AX != 0x004f);
 }
 
-#if 0
+#ifdef MODE_TABLE_BROKEN
 static int
 vesa_bios_get_line_length(void)
 {
@@ -709,6 +711,43 @@ vesa_translate_mmodel(u_int8_t vmodel)
 	return (V_INFO_MM_OTHER);
 }
 
+static int
+vesa_get_bpscanline(struct vesa_mode *vmode)
+{
+	int bpsl;
+
+	if ((vmode->v_modeattr & V_MODEGRAPHICS) != 0) {
+		/* Find the minimum length. */
+		switch (vmode->v_bpp / vmode->v_planes) {
+		case 1:
+			bpsl = vmode->v_width / 8;
+			break;
+		case 2:
+			bpsl = vmode->v_width / 4;
+			break;
+		case 4:
+			bpsl = vmode->v_width / 2;
+			break;
+		default:
+			bpsl = vmode->v_width * ((vmode->v_bpp + 7) / 8);
+			bpsl /= vmode->v_planes;
+			break;
+		}
+
+		/* Use VBE 3.0 information if it looks sane. */
+		if ((vmode->v_modeattr & V_MODELFB) != 0 &&
+		    vesa_adp_info->v_version >= 0x0300 &&
+		    vmode->v_linbpscanline > bpsl)
+			return (vmode->v_linbpscanline);
+
+		/* Return the minimum if the mode table looks absurd. */
+		if (vmode->v_bpscanline < bpsl)
+			return (bpsl);
+	}
+
+	return (vmode->v_bpscanline);
+}
+
 #define	VESA_MAXSTR		256
 
 #define	VESA_STRCPY(dst, src)	do {				\
@@ -733,7 +772,6 @@ vesa_bios_init(void)
 	void *vmbuf;
 	uint32_t offs;
 	uint16_t vers;
-	int bpsl;
 	int is_via_cle266;
 	int modes;
 	int i;
@@ -858,9 +896,7 @@ vesa_bios_init(void)
 		}
 #endif
 
-		bpsl = (vmode.v_modeattr & V_MODELFB) != 0 && vers >= 0x0300 ?
-		    vmode.v_linbpscanline : vmode.v_bpscanline;
-		bsize = bpsl * vmode.v_height;
+		bsize = vesa_get_bpscanline(&vmode) * vmode.v_height;
 		if ((vmode.v_modeattr & V_MODEGRAPHICS) != 0)
 			bsize *= vmode.v_planes;
 
@@ -1209,7 +1245,7 @@ vesa_set_mode(video_adapter_t *adp, int 
 			int10_set_mode(adp->va_initial_bios_mode);
 			if (adp->va_info.vi_flags & V_INFO_LINEAR)
 				pmap_unmapdev(adp->va_buffer,
-				    adp->va_buffer_size);
+				    vesa_adp_info->v_memsize * 64 * 1024);
 			/* 
 			 * Once (*prevvidsw->get_info)() succeeded, 
 			 * (*prevvidsw->set_mode)() below won't fail...
@@ -1241,12 +1277,12 @@ vesa_set_mode(video_adapter_t *adp, int 
 
 	if ((vesa_adp_info->v_flags & V_DAC8) != 0 &&
 	    (info.vi_flags & V_INFO_GRAPHICS) != 0 &&
-	    (info.vi_flags & V_INFO_NONVGA) != 0 &&
 	    vesa_bios_set_dac(8) > 6)
 		adp->va_flags |= V_ADP_DAC8;
 
 	if (adp->va_info.vi_flags & V_INFO_LINEAR)
-		pmap_unmapdev(adp->va_buffer, adp->va_buffer_size);
+		pmap_unmapdev(adp->va_buffer,
+		    vesa_adp_info->v_memsize * 64 * 1024);
 
 #if VESA_DEBUG > 0
 	printf("VESA: mode set!\n");
@@ -1257,13 +1293,31 @@ vesa_set_mode(video_adapter_t *adp, int 
 		(info.vi_flags & V_INFO_COLOR) ? V_ADP_COLOR : 0;
 	vesa_adp->va_crtc_addr =
 		(vesa_adp->va_flags & V_ADP_COLOR) ? COLOR_CRTC : MONO_CRTC;
+
+	vesa_adp->va_line_width = info.vi_buffer_size / info.vi_height;
+	if ((info.vi_flags & V_INFO_GRAPHICS) != 0)
+		vesa_adp->va_line_width /= info.vi_planes;
+
+#ifdef MODE_TABLE_BROKEN
+	/* If VBE function returns bigger bytes per scan line, use it. */
+	{
+		int bpsl = vesa_bios_get_line_length();
+		if (bpsl > vesa_adp->va_line_width) {
+			vesa_adp->va_line_width = bpsl;
+			info.vi_buffer_size = bpsl * info.vi_height;
+			if ((info.vi_flags & V_INFO_GRAPHICS) != 0)
+				info.vi_buffer_size *= info.vi_planes;
+		}
+	}
+#endif
+
 	if (info.vi_flags & V_INFO_LINEAR) {
 #if VESA_DEBUG > 1
 		printf("VESA: setting up LFB\n");
 #endif
 		vesa_adp->va_buffer =
 		    (vm_offset_t)pmap_mapdev_attr(info.vi_buffer,
-		    info.vi_buffer_size, PAT_WRITE_COMBINING);
+		    vesa_adp_info->v_memsize * 64 * 1024, PAT_WRITE_COMBINING);
 		vesa_adp->va_window = vesa_adp->va_buffer;
 		vesa_adp->va_window_size = info.vi_buffer_size / info.vi_planes;
 		vesa_adp->va_window_gran = info.vi_buffer_size / info.vi_planes;
@@ -1275,9 +1329,6 @@ vesa_set_mode(video_adapter_t *adp, int 
 	}
 	vesa_adp->va_buffer_size = info.vi_buffer_size;
 	vesa_adp->va_window_orig = 0;
-	vesa_adp->va_line_width = info.vi_buffer_size / info.vi_height;
-	if ((info.vi_flags & V_INFO_GRAPHICS) != 0)
-		vesa_adp->va_line_width /= info.vi_planes;
 	vesa_adp->va_disp_start.x = 0;
 	vesa_adp->va_disp_start.y = 0;
 #if VESA_DEBUG > 0
@@ -1322,10 +1373,10 @@ vesa_save_palette(video_adapter_t *adp, 
 {
 	int bits;
 
-	if (adp == vesa_adp && VESA_MODE(adp->va_mode) &&
-	    (adp->va_info.vi_flags & V_INFO_NONVGA) != 0) {
+	if (adp == vesa_adp && VESA_MODE(adp->va_mode)) {
 		bits = (adp->va_flags & V_ADP_DAC8) != 0 ? 8 : 6;
-		return (vesa_bios_save_palette(0, 256, palette, bits));
+		if (vesa_bios_save_palette(0, 256, palette, bits) == 0)
+			return (0);
 	}
 
 	return ((*prevvidsw->save_palette)(adp, palette));
@@ -1336,10 +1387,10 @@ vesa_load_palette(video_adapter_t *adp, 
 {
 	int bits;
 
-	if (adp == vesa_adp && VESA_MODE(adp->va_mode) &&
-	    (adp->va_info.vi_flags & V_INFO_NONVGA) != 0) {
+	if (adp == vesa_adp && VESA_MODE(adp->va_mode)) {
 		bits = (adp->va_flags & V_ADP_DAC8) != 0 ? 8 : 6;
-		return (vesa_bios_load_palette(0, 256, palette, bits));
+		if (vesa_bios_load_palette(0, 256, palette, bits) == 0)
+			return (0);
 	}
 
 	return ((*prevvidsw->load_palette)(adp, palette));
@@ -1544,8 +1595,6 @@ get_palette(video_adapter_t *adp, int ba
 		return (1);
 	if (!VESA_MODE(adp->va_mode))
 		return (1);
-	if ((adp->va_info.vi_flags & V_INFO_NONVGA) == 0)
-		return (1);
 
 	bits = (adp->va_flags & V_ADP_DAC8) != 0 ? 8 : 6;
 	r = malloc(count * 3, M_DEVBUF, M_WAITOK);
@@ -1582,8 +1631,6 @@ set_palette(video_adapter_t *adp, int ba
 		return (1);
 	if (!VESA_MODE(adp->va_mode))
 		return (1);
-	if ((adp->va_info.vi_flags & V_INFO_NONVGA) == 0)
-		return (1);
 
 	bits = (adp->va_flags & V_ADP_DAC8) != 0 ? 8 : 6;
 	r = malloc(count * 3, M_DEVBUF, M_WAITOK);

Modified: projects/altix/sys/dev/fb/vga.c
==============================================================================
--- projects/altix/sys/dev/fb/vga.c	Sun Mar 28 21:14:08 2010	(r205807)
+++ projects/altix/sys/dev/fb/vga.c	Sun Mar 28 22:30:14 2010	(r205808)
@@ -1979,6 +1979,7 @@ vga_show_font(video_adapter_t *adp, int 
 static int
 vga_save_palette(video_adapter_t *adp, u_char *palette)
 {
+    int bits;
     int i;
 
     prologue(adp, V_ADP_PALETTE, ENODEV);
@@ -1988,8 +1989,9 @@ vga_save_palette(video_adapter_t *adp, u
      * VGA has 6 bit DAC .
      */
     outb(PALRADR, 0x00);
+    bits = (adp->va_flags & V_ADP_DAC8) != 0 ? 0 : 2;
     for (i = 0; i < 256*3; ++i)
-	palette[i] = inb(PALDATA) << 2; 
+	palette[i] = inb(PALDATA) << bits; 
     inb(adp->va_crtc_addr + 6);	/* reset flip/flop */
     return 0;
 }
@@ -1998,15 +2000,17 @@ static int
 vga_save_palette2(video_adapter_t *adp, int base, int count,
 		  u_char *r, u_char *g, u_char *b)
 {
+    int bits;
     int i;
 
     prologue(adp, V_ADP_PALETTE, ENODEV);
 
     outb(PALRADR, base);
+    bits = (adp->va_flags & V_ADP_DAC8) != 0 ? 0 : 2;
     for (i = 0; i < count; ++i) {
-	r[i] = inb(PALDATA) << 2; 
-	g[i] = inb(PALDATA) << 2; 
-	b[i] = inb(PALDATA) << 2; 
+	r[i] = inb(PALDATA) << bits; 
+	g[i] = inb(PALDATA) << bits; 
+	b[i] = inb(PALDATA) << bits;
     }
     inb(adp->va_crtc_addr + 6);		/* reset flip/flop */
     return 0;
@@ -2021,14 +2025,16 @@ vga_save_palette2(video_adapter_t *adp, 
 static int
 vga_load_palette(video_adapter_t *adp, u_char *palette)
 {
+    int bits;
     int i;
 
     prologue(adp, V_ADP_PALETTE, ENODEV);
 
     outb(PIXMASK, 0xff);		/* no pixelmask */
     outb(PALWADR, 0x00);
+    bits = (adp->va_flags & V_ADP_DAC8) != 0 ? 0 : 2;
     for (i = 0; i < 256*3; ++i)
-	outb(PALDATA, palette[i] >> 2);
+	outb(PALDATA, palette[i] >> bits);
     inb(adp->va_crtc_addr + 6);	/* reset flip/flop */
     outb(ATC, 0x20);			/* enable palette */
     return 0;
@@ -2038,16 +2044,18 @@ static int
 vga_load_palette2(video_adapter_t *adp, int base, int count,
 		  u_char *r, u_char *g, u_char *b)
 {
+    int bits;
     int i;
 
     prologue(adp, V_ADP_PALETTE, ENODEV);
 
     outb(PIXMASK, 0xff);		/* no pixelmask */
     outb(PALWADR, base);
+    bits = (adp->va_flags & V_ADP_DAC8) != 0 ? 0 : 2;
     for (i = 0; i < count; ++i) {
-	outb(PALDATA, r[i] >> 2);
-	outb(PALDATA, g[i] >> 2);
-	outb(PALDATA, b[i] >> 2);
+	outb(PALDATA, r[i] >> bits);
+	outb(PALDATA, g[i] >> bits);
+	outb(PALDATA, b[i] >> bits);
     }
     inb(adp->va_crtc_addr + 6);		/* reset flip/flop */
     outb(ATC, 0x20);			/* enable palette */

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***



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