From owner-svn-src-projects@FreeBSD.ORG Sun Mar 28 22:30:15 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 245B71065672; Sun, 28 Mar 2010 22:30:15 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 10E668FC0C; Sun, 28 Mar 2010 22:30:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2SMUF4Z065643; Sun, 28 Mar 2010 22:30:15 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2SMUE6x065614; Sun, 28 Mar 2010 22:30:14 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201003282230.o2SMUE6x065614@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 28 Mar 2010 22:30:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: 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... X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Mar 2010 22:30:15 -0000 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 * 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 *** From owner-svn-src-projects@FreeBSD.ORG Mon Mar 29 16:14:22 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3F7A1065677; Mon, 29 Mar 2010 16:14:22 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B11BE8FC18; Mon, 29 Mar 2010 16:14:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2TGEMfw005249; Mon, 29 Mar 2010 16:14:22 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2TGEMMb005239; Mon, 29 Mar 2010 16:14:22 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201003291614.o2TGEMMb005239@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 29 Mar 2010 16:14:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205839 - in projects/ppc64/sys/boot/powerpc: . ps3 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Mar 2010 16:14:22 -0000 Author: nwhitehorn Date: Mon Mar 29 16:14:22 2010 New Revision: 205839 URL: http://svn.freebsd.org/changeset/base/205839 Log: Judging by this morning's news, we may be a bit late to this party, but: Add the beginnings of a PS3 loader. This is sufficient to be started from Mambo, LV1, or kboot, and can print "Hello World" to the Mambo console. More features will come later. Added: projects/ppc64/sys/boot/powerpc/ps3/ projects/ppc64/sys/boot/powerpc/ps3/Makefile projects/ppc64/sys/boot/powerpc/ps3/conf.c projects/ppc64/sys/boot/powerpc/ps3/help.ps3 projects/ppc64/sys/boot/powerpc/ps3/ldscript.powerpc projects/ppc64/sys/boot/powerpc/ps3/main.c projects/ppc64/sys/boot/powerpc/ps3/metadata.c projects/ppc64/sys/boot/powerpc/ps3/start.S projects/ppc64/sys/boot/powerpc/ps3/version Modified: projects/ppc64/sys/boot/powerpc/Makefile Modified: projects/ppc64/sys/boot/powerpc/Makefile ============================================================================== --- projects/ppc64/sys/boot/powerpc/Makefile Mon Mar 29 15:59:44 2010 (r205838) +++ projects/ppc64/sys/boot/powerpc/Makefile Mon Mar 29 16:14:22 2010 (r205839) @@ -1,5 +1,5 @@ # $FreeBSD$ -SUBDIR= boot1.chrp ofw uboot +SUBDIR= boot1.chrp ofw uboot ps3 .include Added: projects/ppc64/sys/boot/powerpc/ps3/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/ppc64/sys/boot/powerpc/ps3/Makefile Mon Mar 29 16:14:22 2010 (r205839) @@ -0,0 +1,108 @@ +# $FreeBSD: projects/ppc64/sys/boot/powerpc/ofw/Makefile 204217 2010-02-22 18:07:41Z nwhitehorn $ + +.include +MK_SSP= no + +PROG= loader.ps3 +NEWVERSWHAT= "Playstation 3 loader" ${MACHINE_ARCH} +BINDIR?= /boot +INSTALLFLAGS= -b + +# Architecture-specific loader code +SRCS= start.S conf.c metadata.c vers.c main.c +SRCS+= ucmpdi2.c + +LOADER_DISK_SUPPORT?= no +LOADER_UFS_SUPPORT?= no +LOADER_CD9660_SUPPORT?= no +LOADER_EXT2FS_SUPPORT?= no +LOADER_NET_SUPPORT?= no +LOADER_NFS_SUPPORT?= no +LOADER_TFTP_SUPPORT?= no +LOADER_GZIP_SUPPORT?= no +LOADER_BZIP2_SUPPORT?= no + +.if ${LOADER_DISK_SUPPORT} == "yes" +CFLAGS+= -DLOADER_DISK_SUPPORT +.endif +.if ${LOADER_UFS_SUPPORT} == "yes" +CFLAGS+= -DLOADER_UFS_SUPPORT +.endif +.if ${LOADER_CD9660_SUPPORT} == "yes" +CFLAGS+= -DLOADER_CD9660_SUPPORT +.endif +.if ${LOADER_EXT2FS_SUPPORT} == "yes" +CFLAGS+= -DLOADER_EXT2FS_SUPPORT +.endif +.if ${LOADER_GZIP_SUPPORT} == "yes" +CFLAGS+= -DLOADER_GZIP_SUPPORT +.endif +.if ${LOADER_BZIP2_SUPPORT} == "yes" +CFLAGS+= -DLOADER_BZIP2_SUPPORT +.endif +.if ${LOADER_NET_SUPPORT} == "yes" +CFLAGS+= -DLOADER_NET_SUPPORT +.endif +.if ${LOADER_NFS_SUPPORT} == "yes" +CFLAGS+= -DLOADER_NFS_SUPPORT +.endif +.if ${LOADER_TFTP_SUPPORT} == "yes" +CFLAGS+= -DLOADER_TFTP_SUPPORT +.endif + +.if ${MK_FORTH} != "no" +# Enable BootForth +BOOT_FORTH= yes +CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/powerpc +LIBFICL= ${.OBJDIR}/../../ficl/libficl.a +.endif + +# Avoid the open-close-dance for every file access as some firmwares perform +# an auto-negotiation on every open of the network interface and thus causes +# netbooting to take horribly long. +CFLAGS+= -DNETIF_OPEN_CLOSE_ONCE + +# Always add MI sources +.PATH: ${.CURDIR}/../../common ${.CURDIR}/../../../libkern +.include "${.CURDIR}/../../common/Makefile.inc" +CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../../.. +CFLAGS+= -I. + +CLEANFILES+= vers.c loader.help + +CFLAGS+= -ffreestanding -msoft-float +# load address. set in linker script +RELOC?= 0x0 +CFLAGS+= -DRELOC=${RELOC} + +LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.powerpc + +# 64-bit bridge extensions +CFLAGS+= -Wa,-mppc64bridge + +# Pull in common loader code +#.PATH: ${.CURDIR}/../../ofw/common +#.include "${.CURDIR}/../../ofw/common/Makefile.inc" + +# where to get libstand from +CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ + +DPADD= ${LIBFICL} ${LIBOFW} ${LIBSTAND} +LDADD= ${LIBFICL} ${LIBOFW} -lstand + +vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version + sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT} + +loader.help: help.common help.ps3 + cat ${.ALLSRC} | \ + awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET} + +.PATH: ${.CURDIR}/../../forth +FILES= loader.help loader.4th support.4th loader.conf +FILESDIR_loader.conf= /boot/defaults + +.if !exists(${DESTDIR}/boot/loader.rc) +FILES+= loader.rc +.endif + +.include Added: projects/ppc64/sys/boot/powerpc/ps3/conf.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/ppc64/sys/boot/powerpc/ps3/conf.c Mon Mar 29 16:14:22 2010 (r205839) @@ -0,0 +1,120 @@ +/*- + * Copyright (c) 1999 Michael Smith + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: projects/ppc64/sys/boot/powerpc/ofw/conf.c 196951 2009-09-07 20:39:04Z nwhitehorn $"); + +#include +#include "bootstrap.h" + +#if defined(LOADER_NET_SUPPORT) +#include "dev_net.h" +#endif + +/* + * We could use linker sets for some or all of these, but + * then we would have to control what ended up linked into + * the bootstrap. So it's easier to conditionalise things + * here. + * + * XXX rename these arrays to be consistent and less namespace-hostile + */ + +/* Exported for libstand */ +struct devsw *devsw[] = { +#if defined(LOADER_DISK_SUPPORT) || defined(LOADER_CD9660_SUPPORT) + &ofwdisk, +#endif +#if defined(LOADER_NET_SUPPORT) + &netdev, +#endif + NULL +}; + +struct fs_ops *file_system[] = { +#if defined(LOADER_UFS_SUPPORT) + &ufs_fsops, +#endif +#if defined(LOADER_CD9660_SUPPORT) + &cd9660_fsops, +#endif +#if defined(LOADER_EXT2FS_SUPPORT) + &ext2fs_fsops, +#endif +#if defined(LOADER_NFS_SUPPORT) + &nfs_fsops, +#endif +#if defined(LOADER_TFTP_SUPPORT) + &tftp_fsops, +#endif +#if defined(LOADER_GZIP_SUPPORT) + &gzipfs_fsops, +#endif +#if defined(LOADER_BZIP2_SUPPORT) + &bzipfs_fsops, +#endif + NULL +}; + +struct netif_driver *netif_drivers[] = { +#if defined(LOADER_NET_SUPPORT) + &ofwnet, +#endif + NULL, +}; + +/* Exported for PowerPC only */ +/* + * Sort formats so that those that can detect based on arguments + * rather than reading the file go first. + */ + +struct file_format *file_formats[] = { +#if 0 + &ofw_elf64, +#endif + NULL +}; + +/* + * Consoles + * + * We don't prototype these in libofw.h because they require + * data structures from bootstrap.h as well. + */ +extern struct console ofwconsole; + +struct console *consoles[] = { +#if 0 + &mamboconsole, +#endif + NULL +}; + +/* + * reloc - our load address + */ +vm_offset_t reloc = RELOC; Added: projects/ppc64/sys/boot/powerpc/ps3/help.ps3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/ppc64/sys/boot/powerpc/ps3/help.ps3 Mon Mar 29 16:14:22 2010 (r205839) @@ -0,0 +1 @@ +$FreeBSD: projects/ppc64/sys/boot/powerpc/ofw/help.ofw 174722 2007-12-17 22:18:07Z marcel $ Added: projects/ppc64/sys/boot/powerpc/ps3/ldscript.powerpc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/ppc64/sys/boot/powerpc/ps3/ldscript.powerpc Mon Mar 29 16:14:22 2010 (r205839) @@ -0,0 +1,147 @@ +/* $FreeBSD: projects/ppc64/sys/boot/powerpc/ofw/ldscript.powerpc 204915 2010-03-09 17:26:50Z nwhitehorn $ */ + +OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc", "elf32-powerpc") +OUTPUT_ARCH(powerpc:common) +ENTRY(_start) +SEARCH_DIR(/usr/lib); +/* Do we need any of these for elf? + __DYNAMIC = 0; */ +PROVIDE (__stack = 0); +SECTIONS +{ + /* Read-only sections, merged into text segment: */ + . = 0x0; + .text : + { + *(.text) + /* .gnu.warning sections are handled specially by elf32.em. */ + *(.gnu.warning) + *(.gnu.linkonce.t*) + } =0 + _etext = .; + .interp : { *(.interp) } + .hash : { *(.hash) } + .dynsym : { *(.dynsym) } + .dynstr : { *(.dynstr) } + .gnu.version : { *(.gnu.version) } + .gnu.version_d : { *(.gnu.version_d) } + .gnu.version_r : { *(.gnu.version_r) } + .rela.text : + { *(.rela.text) *(.rela.gnu.linkonce.t*) } + .rela.data : + { *(.rela.data) *(.rela.gnu.linkonce.d*) } + .rela.rodata : + { *(.rela.rodata) *(.rela.gnu.linkonce.r*) } + .rela.got : { *(.rela.got) } + .rela.got1 : { *(.rela.got1) } + .rela.got2 : { *(.rela.got2) } + .rela.ctors : { *(.rela.ctors) } + .rela.dtors : { *(.rela.dtors) } + .rela.init : { *(.rela.init) } + .rela.fini : { *(.rela.fini) } + .rela.bss : { *(.rela.bss) } + .rela.plt : { *(.rela.plt) } + .rela.sdata : { *(.rela.sdata) } + .rela.sbss : { *(.rela.sbss) } + .rela.sdata2 : { *(.rela.sdata2) } + .rela.sbss2 : { *(.rela.sbss2) } + .text : + { + *(.text) + /* .gnu.warning sections are handled specially by elf32.em. */ + *(.gnu.warning) + *(.gnu.linkonce.t*) + } =0 + _etext = .; + PROVIDE (etext = .); + .init : { *(.init) } =0 + .fini : { *(.fini) } =0 + .rodata : { *(.rodata) *(.gnu.linkonce.r*) } + .rodata1 : { *(.rodata1) } + .sdata2 : { *(.sdata2) } + .sbss2 : { *(.sbss2) } + /* Adjust the address for the data segment to the next page up. */ + . = ((. + 0x1000) & ~(0x1000 - 1)); + .data : + { + *(.data) + *(.gnu.linkonce.d*) + CONSTRUCTORS + } + .data1 : { *(.data1) } + .got1 : { *(.got1) } + .dynamic : { *(.dynamic) } + /* Put .ctors and .dtors next to the .got2 section, so that the pointers + get relocated with -mrelocatable. Also put in the .fixup pointers. + The current compiler no longer needs this, but keep it around for 2.7.2 */ + PROVIDE (_GOT2_START_ = .); + .got2 : { *(.got2) } + PROVIDE (__CTOR_LIST__ = .); + .ctors : { *(.ctors) } + PROVIDE (__CTOR_END__ = .); + PROVIDE (__DTOR_LIST__ = .); + .dtors : { *(.dtors) } + PROVIDE (__DTOR_END__ = .); + PROVIDE (_FIXUP_START_ = .); + .fixup : { *(.fixup) } + PROVIDE (_FIXUP_END_ = .); + PROVIDE (_GOT2_END_ = .); + PROVIDE (_GOT_START_ = .); + .got : { *(.got) } + .got.plt : { *(.got.plt) } + PROVIDE (_GOT_END_ = .); + /* We want the small data sections together, so single-instruction offsets + can access them all, and initialized data all before uninitialized, so + we can shorten the on-disk segment size. */ + .sdata : { *(.sdata) } + _edata = .; + PROVIDE (edata = .); + .sbss : + { + PROVIDE (__sbss_start = .); + *(.sbss) + *(.scommon) + *(.dynsbss) + PROVIDE (__sbss_end = .); + } + .plt : { *(.plt) } + .bss : + { + PROVIDE (__bss_start = .); + *(.dynbss) + *(.bss) + *(COMMON) + } + _end = . ; + PROVIDE (end = .); + /* Stabs debugging sections. */ + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + /* DWARF debug sections. + Symbols in the DWARF debugging sections are relative to the beginning + of the section so we begin them at 0. */ + /* DWARF 1 */ + .debug 0 : { *(.debug) } + .line 0 : { *(.line) } + /* GNU DWARF 1 extensions */ + .debug_srcinfo 0 : { *(.debug_srcinfo) } + .debug_sfnames 0 : { *(.debug_sfnames) } + /* DWARF 1.1 and DWARF 2 */ + .debug_aranges 0 : { *(.debug_aranges) } + .debug_pubnames 0 : { *(.debug_pubnames) } + /* DWARF 2 */ + .debug_info 0 : { *(.debug_info) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_line 0 : { *(.debug_line) } + .debug_frame 0 : { *(.debug_frame) } + .debug_str 0 : { *(.debug_str) } + .debug_loc 0 : { *(.debug_loc) } + .debug_macinfo 0 : { *(.debug_macinfo) } + /* SGI/MIPS DWARF 2 extensions */ + .debug_weaknames 0 : { *(.debug_weaknames) } + .debug_funcnames 0 : { *(.debug_funcnames) } + .debug_typenames 0 : { *(.debug_typenames) } + .debug_varnames 0 : { *(.debug_varnames) } + /* These must appear regardless of . */ +} + Added: projects/ppc64/sys/boot/powerpc/ps3/main.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/ppc64/sys/boot/powerpc/ps3/main.c Mon Mar 29 16:14:22 2010 (r205839) @@ -0,0 +1,68 @@ +/*- + * Copyright (C) 2010 Nathan Whitehorn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: head/sys/boot/powerpc/ofw/start.c 174722 2007-12-17 22:18:07Z marcel $"); + +#include +#include "bootstrap.h" + + int mambocall(int, ...); + __asm(".text; .globl mambocall; mambocall: .long 0x000EAEB0; blr"); + #define mambo_print(a) mambocall(0,a,strlen(a)); + +struct arch_switch archsw; + +int +main(void) +{ + mambo_print("Hello world\n"); + + return (0); +} + +void +exit(int code) +{ +} + +void +delay(int usecs) +{ +} + +int +getsecs() +{ + return (0); +} + +time_t +time(time_t *tloc) +{ + return (0); +} + + Added: projects/ppc64/sys/boot/powerpc/ps3/metadata.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/ppc64/sys/boot/powerpc/ps3/metadata.c Mon Mar 29 16:14:22 2010 (r205839) @@ -0,0 +1,355 @@ +/*- + * Copyright (c) 1998 Michael Smith + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * from: FreeBSD: src/sys/boot/sparc64/loader/metadata.c,v 1.6 + */ + +#include +__FBSDID("$FreeBSD: projects/ppc64/sys/boot/powerpc/ofw/metadata.c 197113 2009-09-12 05:39:51Z nwhitehorn $"); + +#include +#include +#include +#include + +#include + +#include "bootstrap.h" + +/* + * Return a 'boothowto' value corresponding to the kernel arguments in + * (kargs) and any relevant environment variables. + */ +static struct +{ + const char *ev; + int mask; +} howto_names[] = { + {"boot_askname", RB_ASKNAME}, + {"boot_cdrom", RB_CDROM}, + {"boot_ddb", RB_KDB}, + {"boot_dfltroot", RB_DFLTROOT}, + {"boot_gdb", RB_GDB}, + {"boot_multicons", RB_MULTIPLE}, + {"boot_mute", RB_MUTE}, + {"boot_pause", RB_PAUSE}, + {"boot_serial", RB_SERIAL}, + {"boot_single", RB_SINGLE}, + {"boot_verbose", RB_VERBOSE}, + {NULL, 0} +}; + +int +md_getboothowto(char *kargs) +{ + char *cp; + int howto; + int active; + int i; + + /* Parse kargs */ + howto = 0; + if (kargs != NULL) { + cp = kargs; + active = 0; + while (*cp != 0) { + if (!active && (*cp == '-')) { + active = 1; + } else if (active) + switch (*cp) { + case 'a': + howto |= RB_ASKNAME; + break; + case 'C': + howto |= RB_CDROM; + break; + case 'd': + howto |= RB_KDB; + break; + case 'D': + howto |= RB_MULTIPLE; + break; + case 'm': + howto |= RB_MUTE; + break; + case 'g': + howto |= RB_GDB; + break; + case 'h': + howto |= RB_SERIAL; + break; + case 'p': + howto |= RB_PAUSE; + break; + case 'r': + howto |= RB_DFLTROOT; + break; + case 's': + howto |= RB_SINGLE; + break; + case 'v': + howto |= RB_VERBOSE; + break; + default: + active = 0; + break; + } + cp++; + } + } + /* get equivalents from the environment */ + for (i = 0; howto_names[i].ev != NULL; i++) + if (getenv(howto_names[i].ev) != NULL) + howto |= howto_names[i].mask; + if (!strcmp(getenv("console"), "comconsole")) + howto |= RB_SERIAL; + if (!strcmp(getenv("console"), "nullconsole")) + howto |= RB_MUTE; + return(howto); +} + +/* + * Copy the environment into the load area starting at (addr). + * Each variable is formatted as =, with a single nul + * separating each variable, and a double nul terminating the environment. + */ +vm_offset_t +md_copyenv(vm_offset_t addr) +{ + struct env_var *ep; + + /* traverse the environment */ + for (ep = environ; ep != NULL; ep = ep->ev_next) { + archsw.arch_copyin(ep->ev_name, addr, strlen(ep->ev_name)); + addr += strlen(ep->ev_name); + archsw.arch_copyin("=", addr, 1); + addr++; + if (ep->ev_value != NULL) { + archsw.arch_copyin(ep->ev_value, addr, strlen(ep->ev_value)); + addr += strlen(ep->ev_value); + } + archsw.arch_copyin("", addr, 1); + addr++; + } + archsw.arch_copyin("", addr, 1); + addr++; + return(addr); +} + +/* + * Copy module-related data into the load area, where it can be + * used as a directory for loaded modules. + * + * Module data is presented in a self-describing format. Each datum + * is preceded by a 32-bit identifier and a 32-bit size field. + * + * Currently, the following data are saved: + * + * MOD_NAME (variable) module name (string) + * MOD_TYPE (variable) module type (string) + * MOD_ARGS (variable) module parameters (string) + * MOD_ADDR sizeof(vm_offset_t) module load address + * MOD_SIZE sizeof(size_t) module size + * MOD_METADATA (variable) type-specific metadata + */ + +static int align; + +#define COPY32(v, a, c) { \ + u_int32_t x = (v); \ + if (c) \ + archsw.arch_copyin(&x, a, sizeof(x)); \ + a += sizeof(x); \ +} + +#define MOD_STR(t, a, s, c) { \ + COPY32(t, a, c); \ + COPY32(strlen(s) + 1, a, c) \ + if (c) \ + archsw.arch_copyin(s, a, strlen(s) + 1);\ + a += roundup(strlen(s) + 1, align); \ +} + +#define MOD_NAME(a, s, c) MOD_STR(MODINFO_NAME, a, s, c) +#define MOD_TYPE(a, s, c) MOD_STR(MODINFO_TYPE, a, s, c) +#define MOD_ARGS(a, s, c) MOD_STR(MODINFO_ARGS, a, s, c) + +#define MOD_VAR(t, a, s, c) { \ + COPY32(t, a, c); \ + COPY32(sizeof(s), a, c); \ + if (c) \ + archsw.arch_copyin(&s, a, sizeof(s)); \ + a += roundup(sizeof(s), align); \ +} + +#define MOD_ADDR(a, s, c) MOD_VAR(MODINFO_ADDR, a, s, c) +#define MOD_SIZE(a, s, c) MOD_VAR(MODINFO_SIZE, a, s, c) + +#define MOD_METADATA(a, mm, c) { \ + COPY32(MODINFO_METADATA | mm->md_type, a, c);\ + COPY32(mm->md_size, a, c); \ + if (c) \ + archsw.arch_copyin(mm->md_data, a, mm->md_size);\ + a += roundup(mm->md_size, align); \ +} + +#define MOD_END(a, c) { \ + COPY32(MODINFO_END, a, c); \ + COPY32(0, a, c); \ +} + +vm_offset_t +md_copymodules(vm_offset_t addr, int kern64) +{ + struct preloaded_file *fp; + struct file_metadata *md; + uint64_t scratch64; + int c; + + c = addr != 0; + /* start with the first module on the list, should be the kernel */ + for (fp = file_findfile(NULL, NULL); fp != NULL; fp = fp->f_next) { + + MOD_NAME(addr, fp->f_name, c); /* this field must come first */ + MOD_TYPE(addr, fp->f_type, c); + if (fp->f_args) + MOD_ARGS(addr, fp->f_args, c); + if (kern64) { + scratch64 = fp->f_addr; + MOD_ADDR(addr, scratch64, c); + scratch64 = fp->f_size; + MOD_SIZE(addr, scratch64, c); + } else { + MOD_ADDR(addr, fp->f_addr, c); + MOD_SIZE(addr, fp->f_size, c); + } + for (md = fp->f_metadata; md != NULL; md = md->md_next) { + if (!(md->md_type & MODINFOMD_NOCOPY)) { + MOD_METADATA(addr, md, c); + } + } + } + MOD_END(addr, c); + return(addr); +} + +/* + * Load the information expected by a powerpc kernel. + * + * - The 'boothowto' argument is constructed + * - The 'bootdev' argument is constructed + * - The kernel environment is copied into kernel space. + * - Module metadata are formatted and placed in kernel space. + */ +int +md_load_dual(char *args, vm_offset_t *modulep, int kern64) +{ + struct preloaded_file *kfp; + struct preloaded_file *xp; + struct file_metadata *md; + vm_offset_t kernend; + vm_offset_t addr; + vm_offset_t envp; + vm_offset_t size; + uint64_t scratch64; + char *rootdevname; + int howto; + + align = kern64 ? 8 : 4; + howto = md_getboothowto(args); + + /* + * Allow the environment variable 'rootdev' to override the supplied device + * This should perhaps go to MI code and/or have $rootdev tested/set by + * MI code before launching the kernel. + */ + rootdevname = getenv("rootdev"); + if (rootdevname == NULL) + rootdevname = getenv("currdev"); + /* Try reading the /etc/fstab file to select the root device */ + getrootmount(rootdevname); + + /* find the last module in the chain */ + addr = 0; + for (xp = file_findfile(NULL, NULL); xp != NULL; xp = xp->f_next) { + if (addr < (xp->f_addr + xp->f_size)) + addr = xp->f_addr + xp->f_size; + } + /* pad to a page boundary */ + addr = roundup(addr, PAGE_SIZE); + + /* copy our environment */ + envp = addr; + addr = md_copyenv(addr); + + /* pad to a page boundary */ + addr = roundup(addr, PAGE_SIZE); + + kernend = 0; + kfp = file_findfile(NULL, kern64 ? "elf64 kernel" : "elf32 kernel"); + if (kfp == NULL) + kfp = file_findfile(NULL, "elf kernel"); + if (kfp == NULL) + panic("can't find kernel file"); + file_addmetadata(kfp, MODINFOMD_HOWTO, sizeof howto, &howto); + if (kern64) { + scratch64 = envp; + file_addmetadata(kfp, MODINFOMD_ENVP, sizeof scratch64, &scratch64); + scratch64 = kernend; + file_addmetadata(kfp, MODINFOMD_KERNEND, sizeof scratch64, &scratch64); + } else { + file_addmetadata(kfp, MODINFOMD_ENVP, sizeof envp, &envp); + file_addmetadata(kfp, MODINFOMD_KERNEND, sizeof kernend, &kernend); + } + + *modulep = addr; + size = md_copymodules(0, kern64); + kernend = roundup(addr + size, PAGE_SIZE); + + md = file_findmetadata(kfp, MODINFOMD_KERNEND); + if (kern64) { + scratch64 = kernend; + bcopy(&scratch64, md->md_data, sizeof scratch64); + } else { + bcopy(&kernend, md->md_data, sizeof kernend); + } + + (void)md_copymodules(addr, kern64); + + return(0); +} + +int +md_load(char *args, vm_offset_t *modulep) +{ + return (md_load_dual(args, modulep, 0)); +} + +int +md_load64(char *args, vm_offset_t *modulep) +{ + return (md_load_dual(args, modulep, 1)); +} + Added: projects/ppc64/sys/boot/powerpc/ps3/start.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/ppc64/sys/boot/powerpc/ps3/start.S Mon Mar 29 16:14:22 2010 (r205839) @@ -0,0 +1,109 @@ +/*- + * Copyright (C) 2010 Nathan Whitehorn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + +/* + * KBoot and simulators will start this program from the _start symbol, with + * r3 pointing to a flattened device tree (kexec), r4 the physical address + * at which we were loaded, and r5 0 (kexec) or a pointer to Open Firmware + * (simulator). If r4 is non-zero, the first order of business is relocating + * ourselves to 0. In the kboot case, the PPE secondary thread will enter + * at 0x60. + * + * If started directly by the LV1 hypervisor, we are loaded to address 0 + * and execution on both threads begins at 0x100 (EXC_RST). + */ + +#define CACHELINE_SIZE 128 +#define SPR_CTRL 136 +#define TMPSTKSZ 4096 + +/* KBoot thread 0 entry -- do relocation, then jump to main */ +.global _start +_start: + cmpwi %r4,0 + bne relocate_self +relocated_start: + lis %r1,(tmpstk+TMPSTKSZ-16)@ha + addi %r1,%r1,(tmpstk+TMPSTKSZ-16)@l + bl main + +. = 0x20 +.global secondary_spin_sem +secondary_spin_sem: + .long 0 + +. = 0x60 +thread1_start: + ba thread1_start /* kboot copies the first 256 bytes to + * address 0, so we are safe to jump + * (and stay) there */ + + li %r0,secondary_spin_sem@l +1: lwz %r1,0(%r0) /* Spin on SECONDARY_SPIN_SEM_ADDRESS */ + cmpwi %r1,0 + beq 1b + li %r0,0x100 /* Invalidate reset vector cache line */ + icbi 0,%r0 + ba 0x100 /* If non-zero, jump to the reset vector */ + +. = 0x100 +exc_rst: + mfspr %r0,SPR_CTRL + /* The first two bits of r0 are 01 (thread 1) or 10 (thread 0) */ + cntlzd %r0,%r0 /* Now 0 for thread 0, 1 for thread 1 */ + + cmpwi %r0,0 + bne thread1_start /* Send thread 1 to wait */ + + b relocated_start /* Main entry point for thread 0 */ + +relocate_self: + /* We enter this with r4 the physical offset for our relocation */ + lis %r8,_end@ha /* r8: copy length */ + addi %r8,%r8,_end@l + li %r5,0 /* r5: dest address */ +1: add %r6,%r4,%r5 /* r6: source address */ + ld %r7,0(%r6) + std %r7,0(%r5) + cmpw %r5,%r8 + addi %r5,%r5,8 + blt 1b + + /* Now invalidate the icache */ +2: li %r5,0 + dcbst 0,%r5 + icbi 0,%r5 + cmpw %r5,%r8 + addi %r5,%r5,CACHELINE_SIZE + blt 2b + + /* All done: absolute jump to relocated entry point */ + ba relocated_start + +.data +.align 4 +tmpstk: + .space TMPSTKSZ Added: projects/ppc64/sys/boot/powerpc/ps3/version ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/ppc64/sys/boot/powerpc/ps3/version Mon Mar 29 16:14:22 2010 (r205839) @@ -0,0 +1,6 @@ +$FreeBSD: projects/ppc64/sys/boot/powerpc/ofw/version 174722 2007-12-17 22:18:07Z marcel $ + +NOTE ANY CHANGES YOU MAKE TO THE BOOTBLOCKS HERE. The format of this +file is important. Make sure the current version number is on line 6. + +0.1: Initial PS3/PowerPC version. From owner-svn-src-projects@FreeBSD.ORG Mon Mar 29 16:22:09 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 69C811065672; Mon, 29 Mar 2010 16:22:09 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 58E368FC26; Mon, 29 Mar 2010 16:22:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2TGM9mP007025; Mon, 29 Mar 2010 16:22:09 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2TGM94W007024; Mon, 29 Mar 2010 16:22:09 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201003291622.o2TGM94W007024@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 29 Mar 2010 16:22:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205840 - projects/ppc64/sys/boot/powerpc/ps3 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Mar 2010 16:22:09 -0000 Author: nwhitehorn Date: Mon Mar 29 16:22:09 2010 New Revision: 205840 URL: http://svn.freebsd.org/changeset/base/205840 Log: Fix two obvious bugs. Modified: projects/ppc64/sys/boot/powerpc/ps3/start.S Modified: projects/ppc64/sys/boot/powerpc/ps3/start.S ============================================================================== --- projects/ppc64/sys/boot/powerpc/ps3/start.S Mon Mar 29 16:14:22 2010 (r205839) +++ projects/ppc64/sys/boot/powerpc/ps3/start.S Mon Mar 29 16:22:09 2010 (r205840) @@ -56,11 +56,12 @@ secondary_spin_sem: .long 0 . = 0x60 -thread1_start: +thread1_start_kboot: ba thread1_start /* kboot copies the first 256 bytes to * address 0, so we are safe to jump * (and stay) there */ +thread1_start: li %r0,secondary_spin_sem@l 1: lwz %r1,0(%r0) /* Spin on SECONDARY_SPIN_SEM_ADDRESS */ cmpwi %r1,0 @@ -93,8 +94,8 @@ relocate_self: blt 1b /* Now invalidate the icache */ -2: li %r5,0 - dcbst 0,%r5 + li %r5,0 +2: dcbst 0,%r5 icbi 0,%r5 cmpw %r5,%r8 addi %r5,%r5,CACHELINE_SIZE From owner-svn-src-projects@FreeBSD.ORG Mon Mar 29 16:41:11 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 97317106567B; Mon, 29 Mar 2010 16:41:11 +0000 (UTC) (envelope-from rpaulo@gmail.com) Received: from mail-pw0-f54.google.com (mail-pw0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id 5909F8FC15; Mon, 29 Mar 2010 16:41:11 +0000 (UTC) Received: by pwj4 with SMTP id 4so8584906pwj.13 for ; Mon, 29 Mar 2010 09:41:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:mime-version :content-type:from:in-reply-to:date:cc:content-transfer-encoding :message-id:references:to:x-mailer; bh=bLf52lLWiH/VJ3y0wSgFHpHZObbmCZY4lKmP7tCJ+cI=; b=XWeCxV/NtKReyvDU9OVUV7aMVmxI6oUP95KcP/dZrDXMq0mj+3E22iK5BiEWzX25P6 wMSpT1V+/Uw3SJcklN8j//wfkQdi7QXcRvM87Qi4Gg5Xs/9YgvbFOtfHsTi/IG//54CO h2W6Vo4CnJ81MD9VC/1+3waAY8iW4G9n8uLmI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; b=FDvoIXWHIkYD9pzo6Te7RZsbkfMGLRCo4YB9FEWwAtda7cd1w1J41V+sZjUqjFjrUP VqT/dZMqMbvHjORyi74ry7xxr4+xasocem3pPe4s/JsQov7tB2IeSG+AUXTZSzN7f0Nd xGvC1xjDUElF+H5HmKvt6MnkjZQrIqX4rBG5U= Received: by 10.141.15.5 with SMTP id s5mr3669451rvi.177.1269880869511; Mon, 29 Mar 2010 09:41:09 -0700 (PDT) Received: from [10.0.10.2] (54.81.54.77.rev.vodafone.pt [77.54.81.54]) by mx.google.com with ESMTPS id r27sm1403499rvq.5.2010.03.29.09.41.06 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 29 Mar 2010 09:41:08 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v1077) Content-Type: text/plain; charset=us-ascii From: Rui Paulo In-Reply-To: <201003291614.o2TGEMMb005239@svn.freebsd.org> Date: Mon, 29 Mar 2010 17:41:03 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <268366B2-9F59-4C50-923A-7DC361BFAAF8@gmail.com> References: <201003291614.o2TGEMMb005239@svn.freebsd.org> To: Nathan Whitehorn X-Mailer: Apple Mail (2.1077) Cc: svn-src-projects@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r205839 - in projects/ppc64/sys/boot/powerpc: . ps3 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Mar 2010 16:41:11 -0000 On 29 Mar 2010, at 17:14, Nathan Whitehorn wrote: > Author: nwhitehorn > Date: Mon Mar 29 16:14:22 2010 > New Revision: 205839 > URL: http://svn.freebsd.org/changeset/base/205839 >=20 > Log: > Judging by this morning's news, we may be a bit late to this party, = but: >=20 > Add the beginnings of a PS3 loader. This is sufficient to be started = from > Mambo, LV1, or kboot, and can print "Hello World" to the Mambo = console. > More features will come later. It's very unfortunate that Sony decided to remove Other OS support in = the next firmware update. For me, there's no other choice than to do the firmware update... -- Rui Paulo From owner-svn-src-projects@FreeBSD.ORG Mon Mar 29 18:35:55 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ABE6A1065670; Mon, 29 Mar 2010 18:35:55 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 99F588FC15; Mon, 29 Mar 2010 18:35:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2TIZt3A037624; Mon, 29 Mar 2010 18:35:55 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2TIZtG6037618; Mon, 29 Mar 2010 18:35:55 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201003291835.o2TIZtG6037618@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 29 Mar 2010 18:35:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205849 - projects/ppc64/sys/boot/powerpc/ps3 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Mar 2010 18:35:55 -0000 Author: nwhitehorn Date: Mon Mar 29 18:35:55 2010 New Revision: 205849 URL: http://svn.freebsd.org/changeset/base/205849 Log: Turn on the MMU, which is required to use the frame buffer or to do much of anything. The relevant hypervisor calls are faked, for now, with replacements that set up a regular real page table, but Mambo will soon be a thing of the past. Added: projects/ppc64/sys/boot/powerpc/ps3/lv1call.h projects/ppc64/sys/boot/powerpc/ps3/lv1call_fake.c projects/ppc64/sys/boot/powerpc/ps3/ps3mmu.c Modified: projects/ppc64/sys/boot/powerpc/ps3/Makefile projects/ppc64/sys/boot/powerpc/ps3/main.c Modified: projects/ppc64/sys/boot/powerpc/ps3/Makefile ============================================================================== --- projects/ppc64/sys/boot/powerpc/ps3/Makefile Mon Mar 29 18:24:08 2010 (r205848) +++ projects/ppc64/sys/boot/powerpc/ps3/Makefile Mon Mar 29 18:35:55 2010 (r205849) @@ -9,7 +9,7 @@ BINDIR?= /boot INSTALLFLAGS= -b # Architecture-specific loader code -SRCS= start.S conf.c metadata.c vers.c main.c +SRCS= start.S conf.c metadata.c vers.c main.c lv1call_fake.c ps3mmu.c SRCS+= ucmpdi2.c LOADER_DISK_SUPPORT?= no @@ -70,7 +70,7 @@ CFLAGS+= -I. CLEANFILES+= vers.c loader.help -CFLAGS+= -ffreestanding -msoft-float +CFLAGS+= -ffreestanding -msoft-float -DAIM # load address. set in linker script RELOC?= 0x0 CFLAGS+= -DRELOC=${RELOC} Added: projects/ppc64/sys/boot/powerpc/ps3/lv1call.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/ppc64/sys/boot/powerpc/ps3/lv1call.h Mon Mar 29 18:35:55 2010 (r205849) @@ -0,0 +1,38 @@ +/*- + * Copyright (C) 2010 Nathan Whitehorn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _PS3_LV1CALL_H +#define _PS3_LV1CALL_H + +int lv1_insert_htab_entry(register_t htab_id, register_t ptegidx, + uint64_t pte_hi, uint64_t pte_lo, register_t lockflags, + register_t flags, uint64_t *evict_index, uint64_t *ev_pte_hi, + uint64_t *ev_pte_lo); +int lv1_construct_virtual_address_space(int htab_size, int npgsizes, + uint64_t page_sizes, uint64_t *as_id, uint64_t *ptsize); +int lv1_select_virtual_address_space(uint64_t as); + +#endif + Added: projects/ppc64/sys/boot/powerpc/ps3/lv1call_fake.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/ppc64/sys/boot/powerpc/ps3/lv1call_fake.c Mon Mar 29 18:35:55 2010 (r205849) @@ -0,0 +1,97 @@ +/*- + * Copyright (C) 2010 Nathan Whitehorn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: head/sys/boot/powerpc/ofw/start.c 174722 2007-12-17 22:18:07Z marcel $"); + + +#include +#include + +#include "bootstrap.h" +#include "lv1call.h" + +#define PTEG_COUNT 2048 +#define PTEG_MASK ((uint64_t)PTEG_COUNT - 1) + +static struct lpteg *pagetable = (struct lpteg *)0x80000; + + int mambocall(int, ...); + #define mambo_print(a) mambocall(0,a,strlen(a)); + +int +lv1_insert_htab_entry(register_t htab_id, register_t ptegidx, + uint64_t pte_hi, uint64_t pte_lo, register_t lockflags, + register_t flags, uint64_t *evict_index, uint64_t *ev_pte_hi, + uint64_t *ev_pte_lo) +{ + struct lpte *pt; + int i; + + /* + * First try primary hash. + */ + for (pt = pagetable[ptegidx].pt, i = 0; i < 8; i++, pt++) { + if (!(pt->pte_hi & LPTE_VALID)) { + pte_hi &= ~LPTE_HID; + pt->pte_lo = pte_lo; + pt->pte_hi = pte_hi; + return (0); + } + } + + /* + * Now try secondary hash. + */ + ptegidx ^= PTEG_MASK; + + for (pt = pagetable[ptegidx].pt, i = 0; i < 8; i++, pt++) { + if (!(pt->pte_hi & LPTE_VALID)) { + pte_hi |= LPTE_HID; + pt->pte_lo = pte_lo; + pt->pte_hi = pte_hi; + return (0); + } + } + + return (-1); +} + +int +lv1_construct_virtual_address_space(int htab_size, int npgsizes, + uint64_t page_sizes, uint64_t *as_id, uint64_t *ptsize) +{ + *ptsize = PTEG_COUNT * sizeof(struct lpteg); + *as_id = 0; + return (0); +} + +int +lv1_select_virtual_address_space(uint64_t as) +{ + __asm __volatile("ptesync; mtsdr1 %0; isync" :: "r"((u_int)pagetable | ffs(PTEG_MASK >> 7))); + return (0); +} + Modified: projects/ppc64/sys/boot/powerpc/ps3/main.c ============================================================================== --- projects/ppc64/sys/boot/powerpc/ps3/main.c Mon Mar 29 18:24:08 2010 (r205848) +++ projects/ppc64/sys/boot/powerpc/ps3/main.c Mon Mar 29 18:35:55 2010 (r205849) @@ -35,9 +35,12 @@ __FBSDID("$FreeBSD: head/sys/boot/powerp struct arch_switch archsw; +int ps3mmu_init(int maxmem); + int main(void) { + ps3mmu_init(128*1024*1024); mambo_print("Hello world\n"); return (0); Added: projects/ppc64/sys/boot/powerpc/ps3/ps3mmu.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/ppc64/sys/boot/powerpc/ps3/ps3mmu.c Mon Mar 29 18:35:55 2010 (r205849) @@ -0,0 +1,94 @@ +/*- + * Copyright (C) 2010 Nathan Whitehorn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: head/sys/boot/powerpc/ofw/start.c 174722 2007-12-17 22:18:07Z marcel $"); + +#include +#include + +#define _KERNEL +#include +#include +#include +#include + +#include "bootstrap.h" +#include "lv1call.h" + +#define PS3_LPAR_VAS_ID_CURRENT 0 + +register_t pteg_count, pteg_mask; + +void +ps3mmu_map(uint64_t va, uint64_t pa) +{ + struct lpte pt, expt; + struct lpteg pteg; + uint64_t idx, vsid, ptegidx; + + if (pa < 0x8000000) { /* Phys mem? */ + pt.pte_hi = LPTE_BIG; + pt.pte_lo = LPTE_M; + vsid = 0; + } else { + pt.pte_hi = 0; + pt.pte_lo = LPTE_I | LPTE_G; + vsid = 1; + } + + pt.pte_hi |= (vsid << LPTE_VSID_SHIFT) | + (((uint64_t)(va & ADDR_PIDX) >> ADDR_API_SHFT64) & LPTE_API); + pt.pte_hi |= LPTE_VALID; + + ptegidx = vsid ^ (((uint64_t)va & ADDR_PIDX) >> ADDR_PIDX_SHFT); + ptegidx &= pteg_mask; + + lv1_insert_htab_entry(PS3_LPAR_VAS_ID_CURRENT, ptegidx, pt.pte_hi, + pt.pte_lo, 0x10, 0, &idx, &expt.pte_hi, &expt.pte_lo); +} + +int +ps3mmu_init(int maxmem) +{ + uint64_t as, ptsize; + int i; + + lv1_construct_virtual_address_space(18 /* log2 256 KB */, 1, + 24ULL << 56, &as, &ptsize); + pteg_count = ptsize / sizeof(struct lpteg); + pteg_mask = pteg_count - 1; + + lv1_select_virtual_address_space(as); + for (i = 0; i < maxmem; i += 16*1024*1024) + ps3mmu_map(i,i); + __asm __volatile ("slbia; slbmte %0, %1; slbmte %2,%3" :: + "r"(0 | SLBV_L), "r"(0 | SLBE_VALID), + "r"(1 << SLBV_VSID_SHIFT), + "r"((0xf << SLBE_ESID_SHIFT) | SLBE_VALID | 1)); + + mtmsr(mfmsr() | PSL_IR | PSL_DR); +} + From owner-svn-src-projects@FreeBSD.ORG Tue Mar 30 05:46:32 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B7E5106564A; Tue, 30 Mar 2010 05:46:32 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5A7FC8FC15; Tue, 30 Mar 2010 05:46:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2U5kWtW086348; Tue, 30 Mar 2010 05:46:32 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2U5kWw2086347; Tue, 30 Mar 2010 05:46:32 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201003300546.o2U5kWw2086347@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 30 Mar 2010 05:46:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205870 - projects/ppc64/sys/boot/powerpc/ps3 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Mar 2010 05:46:32 -0000 Author: nwhitehorn Date: Tue Mar 30 05:46:31 2010 New Revision: 205870 URL: http://svn.freebsd.org/changeset/base/205870 Log: Patch some miscellaneous bugs. This gets thing going somewhat on real hardware. lv1_insert_htab_entry() is hanging for some incomprehensible reason, however, so we're not quite to a working MMU on hardware yet. Note also that lv1call.S is an ugly abomination and should be revisited. Added: projects/ppc64/sys/boot/powerpc/ps3/lv1call.S Modified: projects/ppc64/sys/boot/powerpc/ps3/Makefile projects/ppc64/sys/boot/powerpc/ps3/lv1call.h projects/ppc64/sys/boot/powerpc/ps3/lv1call_fake.c projects/ppc64/sys/boot/powerpc/ps3/main.c projects/ppc64/sys/boot/powerpc/ps3/ps3mmu.c projects/ppc64/sys/boot/powerpc/ps3/start.S Modified: projects/ppc64/sys/boot/powerpc/ps3/Makefile ============================================================================== --- projects/ppc64/sys/boot/powerpc/ps3/Makefile Mon Mar 29 23:36:34 2010 (r205869) +++ projects/ppc64/sys/boot/powerpc/ps3/Makefile Tue Mar 30 05:46:31 2010 (r205870) @@ -9,7 +9,8 @@ BINDIR?= /boot INSTALLFLAGS= -b # Architecture-specific loader code -SRCS= start.S conf.c metadata.c vers.c main.c lv1call_fake.c ps3mmu.c +SRCS= start.S conf.c metadata.c vers.c main.c lv1call.S ps3mmu.c +#SRCS= start.S conf.c metadata.c vers.c main.c lv1call_fake.c ps3mmu.c SRCS+= ucmpdi2.c LOADER_DISK_SUPPORT?= no Added: projects/ppc64/sys/boot/powerpc/ps3/lv1call.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/ppc64/sys/boot/powerpc/ps3/lv1call.S Tue Mar 30 05:46:31 2010 (r205870) @@ -0,0 +1,126 @@ +/* Hypercall stubs. Note: this is all a hack and should die. */ + +#define hc .long 0x44000022 + +.global lv1_get_logical_pu_id +lv1_get_logical_pu_id: + mflr %r0 + stw %r0,4(%r1) + + stw %r3,-4(%r1) + li %r11,69 + hc + extsw %r3,%r3 + lwz %r5,-4(%r1) + std %r4,0(%r5) + + lwz %r0,4(%r1) + mtlr %r0 + blr + +.global lv1_get_logical_partition_id +lv1_get_logical_partition_id: + mflr %r0 + stw %r0,4(%r1) + + stw %r3,-4(%r1) + li %r11,74 + hc + extsw %r3,%r3 + lwz %r5,-4(%r1) + std %r4,0(%r5) + + lwz %r0,4(%r1) + mtlr %r0 + blr + +.global lv1_insert_htab_entry +lv1_insert_htab_entry: + mflr %r0 + stw %r0,4(%r1) + + /* Zero high-order bits of arguments */ + clrldi %r3,%r3,32 + clrldi %r4,%r4,32 + clrldi %r5,%r5,32 + clrldi %r6,%r6,32 + clrldi %r7,%r7,32 + clrldi %r8,%r8,32 + clrldi %r9,%r9,32 + clrldi %r10,%r10,32 + /* Move high 32 bits of args 3 and 4 into position */ + sldi %r5,%r5,32 + or %r5,%r5,%r6 + sldi %r6,%r7,32 + or %r6,%r6,%r8 + /* Shift remaining args in */ + mr %r7,%r9 + mr %r8,%r10 + + li %r11,158 + hc + extsw %r3,%r3 + + lwz %r0,4(%r1) + mtlr %r0 + blr + +.global lv1_construct_virtual_address_space +lv1_construct_virtual_address_space: + mflr %r0 + stw %r0,4(%r1) + stwu %r1,-16(%r1) + stw %r7,8(%r1) + stw %r8,12(%r1) + + clrldi %r3,%r3,32 + clrldi %r4,%r4,32 + clrldi %r5,%r5,32 + clrldi %r6,%r6,32 + sldi %r5,%r5,32 + or %r5,%r5,%r6 + + li %r11,2 + hc + extsw %r3,%r3 + + lwz %r7,8(%r1) + lwz %r8,12(%r1) + std %r4,0(%r7) + std %r5,0(%r8) + lwz %r1,0(%r1) + + lwz %r0,4(%r1) + mtlr %r0 + blr + +.global lv1_select_virtual_address_space +lv1_select_virtual_address_space: + mflr %r0 + stw %r0,4(%r1) + + clrldi %r3,%r3,32 + clrldi %r4,%r4,32 + sldi %r3,%r3,32 + or %r3,%r3,%r4 + + li %r11,7 + hc + extsw %r3,%r3 + lwz %r0,4(%r1) + mtlr %r0 + blr + +.global lv1_panic +lv1_panic: + mflr %r0 + stw %r0,4(%r1) + + li %r11,255 + hc + extsw %r3,%r3 + + lwz %r0,4(%r1) + mtlr %r0 + blr + Modified: projects/ppc64/sys/boot/powerpc/ps3/lv1call.h ============================================================================== --- projects/ppc64/sys/boot/powerpc/ps3/lv1call.h Mon Mar 29 23:36:34 2010 (r205869) +++ projects/ppc64/sys/boot/powerpc/ps3/lv1call.h Tue Mar 30 05:46:31 2010 (r205870) @@ -26,13 +26,15 @@ #ifndef _PS3_LV1CALL_H #define _PS3_LV1CALL_H +int lv1_get_logical_pu_id(uint64_t *puid); +int lv1_get_logical_partition_id(uint64_t *puid); int lv1_insert_htab_entry(register_t htab_id, register_t ptegidx, uint64_t pte_hi, uint64_t pte_lo, register_t lockflags, - register_t flags, uint64_t *evict_index, uint64_t *ev_pte_hi, - uint64_t *ev_pte_lo); + register_t flags); int lv1_construct_virtual_address_space(int htab_size, int npgsizes, uint64_t page_sizes, uint64_t *as_id, uint64_t *ptsize); int lv1_select_virtual_address_space(uint64_t as); +int lv1_panic(int reboot); #endif Modified: projects/ppc64/sys/boot/powerpc/ps3/lv1call_fake.c ============================================================================== --- projects/ppc64/sys/boot/powerpc/ps3/lv1call_fake.c Mon Mar 29 23:36:34 2010 (r205869) +++ projects/ppc64/sys/boot/powerpc/ps3/lv1call_fake.c Tue Mar 30 05:46:31 2010 (r205870) @@ -38,14 +38,13 @@ __FBSDID("$FreeBSD: head/sys/boot/powerp static struct lpteg *pagetable = (struct lpteg *)0x80000; - int mambocall(int, ...); - #define mambo_print(a) mambocall(0,a,strlen(a)); +int mambocall(int, ...); +#define mambo_print(a) mambocall(0,a,strlen(a)); int lv1_insert_htab_entry(register_t htab_id, register_t ptegidx, uint64_t pte_hi, uint64_t pte_lo, register_t lockflags, - register_t flags, uint64_t *evict_index, uint64_t *ev_pte_hi, - uint64_t *ev_pte_lo) + register_t flags) { struct lpte *pt; int i; @@ -95,3 +94,8 @@ lv1_select_virtual_address_space(uint64_ return (0); } +int +lv1_panic(int val) +{ + mambo_print("lv1_panic\n"); +} Modified: projects/ppc64/sys/boot/powerpc/ps3/main.c ============================================================================== --- projects/ppc64/sys/boot/powerpc/ps3/main.c Mon Mar 29 23:36:34 2010 (r205869) +++ projects/ppc64/sys/boot/powerpc/ps3/main.c Tue Mar 30 05:46:31 2010 (r205870) @@ -28,6 +28,7 @@ __FBSDID("$FreeBSD: head/sys/boot/powerp #include #include "bootstrap.h" +#include "lv1call.h" int mambocall(int, ...); __asm(".text; .globl mambocall; mambocall: .long 0x000EAEB0; blr"); @@ -40,7 +41,13 @@ int ps3mmu_init(int maxmem); int main(void) { - ps3mmu_init(128*1024*1024); + int maxmem = 16*1024*1024; + uint64_t puid, lpar_id; + + lv1_get_logical_pu_id(&puid); + lv1_get_logical_partition_id(&lpar_id); + + ps3mmu_init(maxmem); mambo_print("Hello world\n"); return (0); Modified: projects/ppc64/sys/boot/powerpc/ps3/ps3mmu.c ============================================================================== --- projects/ppc64/sys/boot/powerpc/ps3/ps3mmu.c Mon Mar 29 23:36:34 2010 (r205869) +++ projects/ppc64/sys/boot/powerpc/ps3/ps3mmu.c Tue Mar 30 05:46:31 2010 (r205870) @@ -41,51 +41,57 @@ __FBSDID("$FreeBSD: head/sys/boot/powerp #define PS3_LPAR_VAS_ID_CURRENT 0 register_t pteg_count, pteg_mask; +uint64_t as_id; void ps3mmu_map(uint64_t va, uint64_t pa) { - struct lpte pt, expt; - struct lpteg pteg; - uint64_t idx, vsid, ptegidx; + struct lpte pt; + int shift; + uint64_t vsid, ptegidx; if (pa < 0x8000000) { /* Phys mem? */ pt.pte_hi = LPTE_BIG; pt.pte_lo = LPTE_M; + shift = 24; vsid = 0; } else { pt.pte_hi = 0; pt.pte_lo = LPTE_I | LPTE_G; + shift = ADDR_PIDX_SHFT; vsid = 1; } pt.pte_hi |= (vsid << LPTE_VSID_SHIFT) | (((uint64_t)(va & ADDR_PIDX) >> ADDR_API_SHFT64) & LPTE_API); - pt.pte_hi |= LPTE_VALID; + pt.pte_lo |= pa; + ptegidx = vsid ^ (((uint64_t)va & ADDR_PIDX) >> shift); - ptegidx = vsid ^ (((uint64_t)va & ADDR_PIDX) >> ADDR_PIDX_SHFT); + pt.pte_hi |= LPTE_LOCKED | LPTE_VALID; ptegidx &= pteg_mask; - lv1_insert_htab_entry(PS3_LPAR_VAS_ID_CURRENT, ptegidx, pt.pte_hi, - pt.pte_lo, 0x10, 0, &idx, &expt.pte_hi, &expt.pte_lo); + i = lv1_insert_htab_entry(0, ptegidx * 8, pt.pte_hi, pt.pte_lo, + LPTE_LOCKED, 0); } int ps3mmu_init(int maxmem) { - uint64_t as, ptsize; + uint64_t ptsize; int i; - lv1_construct_virtual_address_space(18 /* log2 256 KB */, 1, - 24ULL << 56, &as, &ptsize); + lv1_construct_virtual_address_space(18 /* log2 256 KB */, 2, + (24ULL << 56) | (16ULL << 48), &as_id, &ptsize); pteg_count = ptsize / sizeof(struct lpteg); pteg_mask = pteg_count - 1; - lv1_select_virtual_address_space(as); + lv1_select_virtual_address_space(as_id); + for (i = 0; i < maxmem; i += 16*1024*1024) ps3mmu_map(i,i); + __asm __volatile ("slbia; slbmte %0, %1; slbmte %2,%3" :: - "r"(0 | SLBV_L), "r"(0 | SLBE_VALID), + "r"((0 << SLBV_VSID_SHIFT) | SLBV_L), "r"(0 | SLBE_VALID), "r"(1 << SLBV_VSID_SHIFT), "r"((0xf << SLBE_ESID_SHIFT) | SLBE_VALID | 1)); Modified: projects/ppc64/sys/boot/powerpc/ps3/start.S ============================================================================== --- projects/ppc64/sys/boot/powerpc/ps3/start.S Mon Mar 29 23:36:34 2010 (r205869) +++ projects/ppc64/sys/boot/powerpc/ps3/start.S Tue Mar 30 05:46:31 2010 (r205870) @@ -43,6 +43,10 @@ /* KBoot thread 0 entry -- do relocation, then jump to main */ .global _start _start: + mfmsr %r31 + clrldi %r31,%r31,1 + mtmsrd %r31 + isync cmpwi %r4,0 bne relocate_self relocated_start: @@ -50,20 +54,25 @@ relocated_start: addi %r1,%r1,(tmpstk+TMPSTKSZ-16)@l bl main -. = 0x20 +. = 0x40 .global secondary_spin_sem secondary_spin_sem: .long 0 . = 0x60 thread1_start_kboot: + mfmsr %r31 + clrldi %r31,%r31,1 + mtmsrd %r31 + isync + ba thread1_start /* kboot copies the first 256 bytes to * address 0, so we are safe to jump * (and stay) there */ thread1_start: - li %r0,secondary_spin_sem@l -1: lwz %r1,0(%r0) /* Spin on SECONDARY_SPIN_SEM_ADDRESS */ + li %r3,secondary_spin_sem@l +1: lwz %r1,0(%r3) /* Spin on SECONDARY_SPIN_SEM_ADDRESS */ cmpwi %r1,0 beq 1b li %r0,0x100 /* Invalidate reset vector cache line */ @@ -72,6 +81,11 @@ thread1_start: . = 0x100 exc_rst: + mfmsr %r31 + clrldi %r31,%r31,1 + mtmsrd %r31 + isync + mfspr %r0,SPR_CTRL /* The first two bits of r0 are 01 (thread 1) or 10 (thread 0) */ cntlzd %r0,%r0 /* Now 0 for thread 0, 1 for thread 1 */ From owner-svn-src-projects@FreeBSD.ORG Tue Mar 30 05:48:16 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E14551065670; Tue, 30 Mar 2010 05:48:16 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D1C9E8FC20; Tue, 30 Mar 2010 05:48:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2U5mGJE086766; Tue, 30 Mar 2010 05:48:16 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2U5mGZa086764; Tue, 30 Mar 2010 05:48:16 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201003300548.o2U5mGZa086764@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 30 Mar 2010 05:48:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205871 - projects/ppc64/sys/boot/powerpc/ps3 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Mar 2010 05:48:17 -0000 Author: nwhitehorn Date: Tue Mar 30 05:48:16 2010 New Revision: 205871 URL: http://svn.freebsd.org/changeset/base/205871 Log: Missed a bit. Modified: projects/ppc64/sys/boot/powerpc/ps3/ps3mmu.c Modified: projects/ppc64/sys/boot/powerpc/ps3/ps3mmu.c ============================================================================== --- projects/ppc64/sys/boot/powerpc/ps3/ps3mmu.c Tue Mar 30 05:46:31 2010 (r205870) +++ projects/ppc64/sys/boot/powerpc/ps3/ps3mmu.c Tue Mar 30 05:48:16 2010 (r205871) @@ -70,7 +70,7 @@ ps3mmu_map(uint64_t va, uint64_t pa) pt.pte_hi |= LPTE_LOCKED | LPTE_VALID; ptegidx &= pteg_mask; - i = lv1_insert_htab_entry(0, ptegidx * 8, pt.pte_hi, pt.pte_lo, + lv1_insert_htab_entry(0, ptegidx * 8, pt.pte_hi, pt.pte_lo, LPTE_LOCKED, 0); } From owner-svn-src-projects@FreeBSD.ORG Tue Mar 30 19:06:54 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A83D1106568D; Tue, 30 Mar 2010 19:06:54 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 970C58FC1B; Tue, 30 Mar 2010 19:06:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2UJ6sxS067060; Tue, 30 Mar 2010 19:06:54 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2UJ6snJ067055; Tue, 30 Mar 2010 19:06:54 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201003301906.o2UJ6snJ067055@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 30 Mar 2010 19:06:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205899 - projects/ppc64/sys/boot/powerpc/ps3 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Mar 2010 19:06:54 -0000 Author: nwhitehorn Date: Tue Mar 30 19:06:54 2010 New Revision: 205899 URL: http://svn.freebsd.org/changeset/base/205899 Log: Bring up the MMU and set up the framebuffer. Now I can make a chunk of my screen red, and printf() is soon to follow. Much easier than debugging by rebooting, which it turns out isn't even reliable! Modified: projects/ppc64/sys/boot/powerpc/ps3/lv1call.S projects/ppc64/sys/boot/powerpc/ps3/lv1call.h projects/ppc64/sys/boot/powerpc/ps3/main.c projects/ppc64/sys/boot/powerpc/ps3/ps3mmu.c Modified: projects/ppc64/sys/boot/powerpc/ps3/lv1call.S ============================================================================== --- projects/ppc64/sys/boot/powerpc/ps3/lv1call.S Tue Mar 30 19:06:37 2010 (r205898) +++ projects/ppc64/sys/boot/powerpc/ps3/lv1call.S Tue Mar 30 19:06:54 2010 (r205899) @@ -2,61 +2,94 @@ #define hc .long 0x44000022 -.global lv1_get_logical_pu_id -lv1_get_logical_pu_id: +#define LD64_IM(r, highest, higher, high, low) \ + lis r,highest; \ + addi r,r,higher; \ + sldi r,r,32; \ + addis r,r,high; \ + addi r,r,low; + +.global lv1_get_physmem +lv1_get_physmem: mflr %r0 stw %r0,4(%r1) + stw %r3,-8(%r1) /* Address for maxmem */ - stw %r3,-4(%r1) - li %r11,69 + li %r11,69 /* Get PU ID */ + hc + std %r4,-16(%r1) + + li %r11,74 /* Get LPAR ID */ + hc + std %r4,-24(%r1) + + ld %r3,-24(%r1) + LD64_IM(%r4,0x0000,0x0000,0x6269,0x0000 /* "bi" */) + LD64_IM(%r5,0x7075,0x0000,0x0000,0x0000 /* "pu" */) + ld %r6,-16(%r1) + LD64_IM(%r7,0x726d,0x5f73,0x697a,0x6500 /* "rm_size" */) + li %r11,91 hc extsw %r3,%r3 - lwz %r5,-4(%r1) + + lwz %r5,-8(%r1) std %r4,0(%r5) - + lwz %r0,4(%r1) mtlr %r0 blr - -.global lv1_get_logical_partition_id -lv1_get_logical_partition_id: + +.global lv1_setup_address_space +lv1_setup_address_space: mflr %r0 stw %r0,4(%r1) stw %r3,-4(%r1) - li %r11,74 + stw %r4,-8(%r1) + + li %r3,18 /* PT size: log2(256 KB) */ + li %r4,2 /* Two page sizes */ + li %r5,24 /* Page sizes: (24 << 56) | (16 << 48) */ + sldi %r5,%r5,24 + li %r6,16 + sldi %r6,%r6,16 + or %r5,%r5,%r6 + sldi %r5,%r5,32 + + li %r11,2 /* lv1_construct_virtual_address_space */ + hc + + lwz %r6,-4(%r1) + lwz %r7,-8(%r1) + std %r4,0(%r6) + std %r5,0(%r7) + + /* AS_ID in r4 */ + mr %r3,%r4 + li %r11,7 /* lv1_select_virtual_address_space */ hc extsw %r3,%r3 - lwz %r5,-4(%r1) - std %r4,0(%r5) - + lwz %r0,4(%r1) mtlr %r0 blr -.global lv1_insert_htab_entry -lv1_insert_htab_entry: +.global lv1_insert_pte +lv1_insert_pte: mflr %r0 stw %r0,4(%r1) - /* Zero high-order bits of arguments */ + mr %r11,%r4 /* Save R4 */ + clrldi %r3,%r3,32 - clrldi %r4,%r4,32 - clrldi %r5,%r5,32 - clrldi %r6,%r6,32 - clrldi %r7,%r7,32 - clrldi %r8,%r8,32 - clrldi %r9,%r9,32 - clrldi %r10,%r10,32 - /* Move high 32 bits of args 3 and 4 into position */ - sldi %r5,%r5,32 - or %r5,%r5,%r6 - sldi %r6,%r7,32 - or %r6,%r6,%r8 - /* Shift remaining args in */ - mr %r7,%r9 - mr %r8,%r10 + clrldi %r7,%r5,32 + sldi %r4,%r3,3 /* Convert ptegidx into base PTE slot */ + li %r3,0 /* Current address space */ + ld %r5,0(%r11) + ld %r6,8(%r11) + li %r8,0 /* No other flags */ + li %r11,158 hc extsw %r3,%r3 @@ -65,62 +98,85 @@ lv1_insert_htab_entry: mtlr %r0 blr -.global lv1_construct_virtual_address_space -lv1_construct_virtual_address_space: +.global lv1_panic +lv1_panic: mflr %r0 stw %r0,4(%r1) - stwu %r1,-16(%r1) - stw %r7,8(%r1) - stw %r8,12(%r1) - - clrldi %r3,%r3,32 - clrldi %r4,%r4,32 - clrldi %r5,%r5,32 - clrldi %r6,%r6,32 - sldi %r5,%r5,32 - or %r5,%r5,%r6 - li %r11,2 + li %r11,255 hc extsw %r3,%r3 - lwz %r7,8(%r1) - lwz %r8,12(%r1) - std %r4,0(%r7) - std %r5,0(%r8) - lwz %r1,0(%r1) + lwz %r0,4(%r1) + mtlr %r0 + blr + +.global lv1_gpu_open +lv1_gpu_open: + mflr %r0 + stw %r0,4(%r1) + + li %r11,210 + hc + extsw %r3,%r3 lwz %r0,4(%r1) mtlr %r0 blr -.global lv1_select_virtual_address_space -lv1_select_virtual_address_space: +.global lv1_gpu_context_attribute +lv1_gpu_context_attribute: mflr %r0 stw %r0,4(%r1) - clrldi %r3,%r3,32 - clrldi %r4,%r4,32 + li %r11,225 + hc + extsw %r3,%r3 + + lwz %r0,4(%r1) + mtlr %r0 + blr + +.global lv1_gpu_context_allocate +lv1_gpu_context_allocate: + mflr %r0 + stw %r0,4(%r1) + stw %r7,-4(%r1) + sldi %r3,%r3,32 - or %r3,%r3,%r4 + clrldi %r4,%r4,32 + ori %r3,%r3,%r4 + clrldi %r4,%r5,32 + clrldi %r5,%r6,32 - li %r11,7 + li %r11,217 hc extsw %r3,%r3 + + lwz %r7,-4(%r1) + std %r4,0(%r7) + lwz %r0,4(%r1) mtlr %r0 blr - -.global lv1_panic -lv1_panic: + +.global lv1_gpu_memory_allocate +lv1_gpu_memory_allocate: mflr %r0 stw %r0,4(%r1) + stw %r8,-4(%r1) + stw %r9,-8(%r1) - li %r11,255 + li %r11,214 hc extsw %r3,%r3 + lwz %r8,-4(%r1) + lwz %r9,-8(%r1) + std %r4,0(%r8) + std %r5,0(%r9) + lwz %r0,4(%r1) mtlr %r0 blr - + Modified: projects/ppc64/sys/boot/powerpc/ps3/lv1call.h ============================================================================== --- projects/ppc64/sys/boot/powerpc/ps3/lv1call.h Tue Mar 30 19:06:37 2010 (r205898) +++ projects/ppc64/sys/boot/powerpc/ps3/lv1call.h Tue Mar 30 19:06:54 2010 (r205899) @@ -26,15 +26,24 @@ #ifndef _PS3_LV1CALL_H #define _PS3_LV1CALL_H -int lv1_get_logical_pu_id(uint64_t *puid); -int lv1_get_logical_partition_id(uint64_t *puid); -int lv1_insert_htab_entry(register_t htab_id, register_t ptegidx, - uint64_t pte_hi, uint64_t pte_lo, register_t lockflags, - register_t flags); -int lv1_construct_virtual_address_space(int htab_size, int npgsizes, - uint64_t page_sizes, uint64_t *as_id, uint64_t *ptsize); -int lv1_select_virtual_address_space(uint64_t as); +#include + +int lv1_get_physmem(uint64_t *maxmem); +int lv1_setup_address_space(uint64_t *as_id, uint64_t *ptsize); +int lv1_insert_pte(u_int ptegidx, struct lpte *pte, int lockflags); int lv1_panic(int reboot); +#define L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_MODE_SET 0x0100 +#define L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_SYNC 0x0101 +#define L1GPU_DISPLAY_SYNC_HSYNC 1 +#define L1GPU_DISPLAY_SYNC_VSYNC 2 +#define L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_FLIP 0x0102 + +int lv1_gpu_open(int); +int lv1_gpu_context_attribute(int context, int op, int, int, int, int); +int lv1_gpu_memory_allocate(int size, int, int, int, int, uint64_t *handle, + uint64_t *paddr); +int lv1_gpu_context_allocate(uint64_t handle, int, uint64_t *context); + #endif Modified: projects/ppc64/sys/boot/powerpc/ps3/main.c ============================================================================== --- projects/ppc64/sys/boot/powerpc/ps3/main.c Tue Mar 30 19:06:37 2010 (r205898) +++ projects/ppc64/sys/boot/powerpc/ps3/main.c Tue Mar 30 19:06:54 2010 (r205899) @@ -30,25 +30,52 @@ __FBSDID("$FreeBSD: head/sys/boot/powerp #include "bootstrap.h" #include "lv1call.h" - int mambocall(int, ...); - __asm(".text; .globl mambocall; mambocall: .long 0x000EAEB0; blr"); - #define mambo_print(a) mambocall(0,a,strlen(a)); - struct arch_switch archsw; int ps3mmu_init(int maxmem); +uint64_t fb_paddr = 0; +uint32_t *fb_vaddr; + int -main(void) +fb_init(void) { - int maxmem = 16*1024*1024; - uint64_t puid, lpar_id; + uint64_t fbhandle, fbcontext; + + lv1_gpu_open(0); + lv1_gpu_context_attribute(0, L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_MODE_SET, + 0,0,0,0); + lv1_gpu_context_attribute(0, L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_MODE_SET, + 0,0,1,0); + lv1_gpu_context_attribute(0, L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_SYNC, + 0,L1GPU_DISPLAY_SYNC_VSYNC,0,0); + lv1_gpu_context_attribute(0, L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_SYNC, + 1,L1GPU_DISPLAY_SYNC_VSYNC,0,0); + lv1_gpu_memory_allocate(16*1024*1024, 0, 0, 0, 0, &fbhandle, &fb_paddr); + lv1_gpu_context_allocate(fbhandle, 0, &fbcontext); + + lv1_gpu_context_attribute(fbcontext, + L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_FLIP, 0, 0, 0, 0); + lv1_gpu_context_attribute(fbcontext, + L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_FLIP, 1, 0, 0, 0); +} - lv1_get_logical_pu_id(&puid); - lv1_get_logical_partition_id(&lpar_id); +int +main(void) +{ + int i = 0; + uint64_t maxmem = 0; + lv1_get_physmem(&maxmem); + + fb_init(); ps3mmu_init(maxmem); - mambo_print("Hello world\n"); + + /* Turn the top of the screen red */ + for (i = 0; i < 81920; i++) + fb_vaddr[i] = 0x00ff0000; + + while (1) {} return (0); } Modified: projects/ppc64/sys/boot/powerpc/ps3/ps3mmu.c ============================================================================== --- projects/ppc64/sys/boot/powerpc/ps3/ps3mmu.c Tue Mar 30 19:06:37 2010 (r205898) +++ projects/ppc64/sys/boot/powerpc/ps3/ps3mmu.c Tue Mar 30 19:06:54 2010 (r205899) @@ -43,7 +43,10 @@ __FBSDID("$FreeBSD: head/sys/boot/powerp register_t pteg_count, pteg_mask; uint64_t as_id; -void +extern uint64_t fb_paddr; +extern uint32_t *fb_vaddr; + +int ps3mmu_map(uint64_t va, uint64_t pa) { struct lpte pt; @@ -57,7 +60,7 @@ ps3mmu_map(uint64_t va, uint64_t pa) vsid = 0; } else { pt.pte_hi = 0; - pt.pte_lo = LPTE_I | LPTE_G; + pt.pte_lo = LPTE_I | LPTE_G | LPTE_M | LPTE_NOEXEC; shift = ADDR_PIDX_SHFT; vsid = 1; } @@ -70,8 +73,7 @@ ps3mmu_map(uint64_t va, uint64_t pa) pt.pte_hi |= LPTE_LOCKED | LPTE_VALID; ptegidx &= pteg_mask; - lv1_insert_htab_entry(0, ptegidx * 8, pt.pte_hi, pt.pte_lo, - LPTE_LOCKED, 0); + return (lv1_insert_pte(ptegidx, &pt, LPTE_LOCKED)); } int @@ -80,21 +82,22 @@ ps3mmu_init(int maxmem) uint64_t ptsize; int i; - lv1_construct_virtual_address_space(18 /* log2 256 KB */, 2, - (24ULL << 56) | (16ULL << 48), &as_id, &ptsize); + i = lv1_setup_address_space(&as_id, &ptsize); pteg_count = ptsize / sizeof(struct lpteg); pteg_mask = pteg_count - 1; - lv1_select_virtual_address_space(as_id); - for (i = 0; i < maxmem; i += 16*1024*1024) ps3mmu_map(i,i); + for (i = 0; i < 16*1024*1024; i += 4096) + ps3mmu_map(0x10000000 + i, fb_paddr + i); + fb_vaddr = (uint32_t *)0x10000000; + __asm __volatile ("slbia; slbmte %0, %1; slbmte %2,%3" :: "r"((0 << SLBV_VSID_SHIFT) | SLBV_L), "r"(0 | SLBE_VALID), "r"(1 << SLBV_VSID_SHIFT), - "r"((0xf << SLBE_ESID_SHIFT) | SLBE_VALID | 1)); + "r"((1 << SLBE_ESID_SHIFT) | SLBE_VALID | 1)); - mtmsr(mfmsr() | PSL_IR | PSL_DR); + mtmsr(mfmsr() | PSL_IR | PSL_DR | PSL_RI | PSL_ME); } From owner-svn-src-projects@FreeBSD.ORG Tue Mar 30 23:15:07 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 14224106564A; Tue, 30 Mar 2010 23:15:07 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 027AA8FC16; Tue, 30 Mar 2010 23:15:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2UNF6GT024009; Tue, 30 Mar 2010 23:15:06 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2UNF6dM024002; Tue, 30 Mar 2010 23:15:06 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201003302315.o2UNF6dM024002@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 30 Mar 2010 23:15:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205943 - projects/ppc64/sys/boot/powerpc/ps3 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Mar 2010 23:15:07 -0000 Author: nwhitehorn Date: Tue Mar 30 23:15:06 2010 New Revision: 205943 URL: http://svn.freebsd.org/changeset/base/205943 Log: Add a framebuffer console, and print the standard things that loader prints when it begins. printf() will make development much, much easier. Added: projects/ppc64/sys/boot/powerpc/ps3/ps3.h projects/ppc64/sys/boot/powerpc/ps3/ps3cons.c Deleted: projects/ppc64/sys/boot/powerpc/ps3/lv1call_fake.c Modified: projects/ppc64/sys/boot/powerpc/ps3/Makefile projects/ppc64/sys/boot/powerpc/ps3/conf.c projects/ppc64/sys/boot/powerpc/ps3/main.c projects/ppc64/sys/boot/powerpc/ps3/ps3mmu.c Modified: projects/ppc64/sys/boot/powerpc/ps3/Makefile ============================================================================== --- projects/ppc64/sys/boot/powerpc/ps3/Makefile Tue Mar 30 23:14:35 2010 (r205942) +++ projects/ppc64/sys/boot/powerpc/ps3/Makefile Tue Mar 30 23:15:06 2010 (r205943) @@ -9,8 +9,8 @@ BINDIR?= /boot INSTALLFLAGS= -b # Architecture-specific loader code -SRCS= start.S conf.c metadata.c vers.c main.c lv1call.S ps3mmu.c -#SRCS= start.S conf.c metadata.c vers.c main.c lv1call_fake.c ps3mmu.c +SRCS= start.S conf.c metadata.c vers.c main.c lv1call.S +SRCS+= ps3cons.c font.h ps3mmu.c SRCS+= ucmpdi2.c LOADER_DISK_SUPPORT?= no @@ -71,7 +71,7 @@ CFLAGS+= -I. CLEANFILES+= vers.c loader.help -CFLAGS+= -ffreestanding -msoft-float -DAIM +CFLAGS+= -Wall -ffreestanding -msoft-float -DAIM # load address. set in linker script RELOC?= 0x0 CFLAGS+= -DRELOC=${RELOC} @@ -91,6 +91,11 @@ CFLAGS+= -I${.CURDIR}/../../../../lib/li DPADD= ${LIBFICL} ${LIBOFW} ${LIBSTAND} LDADD= ${LIBFICL} ${LIBOFW} -lstand +SC_DFLT_FONT=cp437 + +font.h: + uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x16.fnt && file2c 'u_char dflt_font_16[16*256] = {' '};' < ${SC_DFLT_FONT}-8x16 > font.h && uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x14.fnt && file2c 'u_char dflt_font_14[14*256] = {' '};' < ${SC_DFLT_FONT}-8x14 >> font.h && uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x8.fnt && file2c 'u_char dflt_font_8[8*256] = {' '};' < ${SC_DFLT_FONT}-8x8 >> font.h + vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT} Modified: projects/ppc64/sys/boot/powerpc/ps3/conf.c ============================================================================== --- projects/ppc64/sys/boot/powerpc/ps3/conf.c Tue Mar 30 23:14:35 2010 (r205942) +++ projects/ppc64/sys/boot/powerpc/ps3/conf.c Tue Mar 30 23:15:06 2010 (r205943) @@ -101,16 +101,11 @@ struct file_format *file_formats[] = { /* * Consoles - * - * We don't prototype these in libofw.h because they require - * data structures from bootstrap.h as well. */ -extern struct console ofwconsole; +extern struct console ps3console; struct console *consoles[] = { -#if 0 - &mamboconsole, -#endif + &ps3console, NULL }; Modified: projects/ppc64/sys/boot/powerpc/ps3/main.c ============================================================================== --- projects/ppc64/sys/boot/powerpc/ps3/main.c Tue Mar 30 23:14:35 2010 (r205942) +++ projects/ppc64/sys/boot/powerpc/ps3/main.c Tue Mar 30 23:15:06 2010 (r205943) @@ -27,55 +27,55 @@ __FBSDID("$FreeBSD: head/sys/boot/powerpc/ofw/start.c 174722 2007-12-17 22:18:07Z marcel $"); #include +#include + #include "bootstrap.h" #include "lv1call.h" +#include "ps3.h" struct arch_switch archsw; +extern void *_end; -int ps3mmu_init(int maxmem); - -uint64_t fb_paddr = 0; -uint32_t *fb_vaddr; - -int -fb_init(void) -{ - uint64_t fbhandle, fbcontext; - - lv1_gpu_open(0); - lv1_gpu_context_attribute(0, L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_MODE_SET, - 0,0,0,0); - lv1_gpu_context_attribute(0, L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_MODE_SET, - 0,0,1,0); - lv1_gpu_context_attribute(0, L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_SYNC, - 0,L1GPU_DISPLAY_SYNC_VSYNC,0,0); - lv1_gpu_context_attribute(0, L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_SYNC, - 1,L1GPU_DISPLAY_SYNC_VSYNC,0,0); - lv1_gpu_memory_allocate(16*1024*1024, 0, 0, 0, 0, &fbhandle, &fb_paddr); - lv1_gpu_context_allocate(fbhandle, 0, &fbcontext); - - lv1_gpu_context_attribute(fbcontext, - L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_FLIP, 0, 0, 0, 0); - lv1_gpu_context_attribute(fbcontext, - L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_FLIP, 1, 0, 0, 0); -} +extern char bootprog_name[]; +extern char bootprog_rev[]; +extern char bootprog_date[]; +extern char bootprog_maker[]; int main(void) { - int i = 0; uint64_t maxmem = 0; + void *heapbase; + int i; lv1_get_physmem(&maxmem); - fb_init(); ps3mmu_init(maxmem); - /* Turn the top of the screen red */ - for (i = 0; i < 81920; i++) - fb_vaddr[i] = 0x00ff0000; + /* + * Set up console. + */ + cons_probe(); + + /* + * Set the heap to one page after the end of the loader. + */ + heapbase = (void *)((((u_long)&_end) + PAGE_SIZE) & ~PAGE_MASK); + setheap(heapbase, heapbase + 0x80000); + + /* + * March through the device switch probing for things. + */ + for (i = 0; devsw[i] != NULL; i++) + if (devsw[i]->dv_init != NULL) + (devsw[i]->dv_init)(); + + printf("\n"); + printf("%s, Revision %s\n", bootprog_name, bootprog_rev); + printf("(%s, %s)\n", bootprog_maker, bootprog_date); + printf("Memory: %lldKB\n", maxmem / 1024); - while (1) {} + interact(); /* doesn't return */ return (0); } Added: projects/ppc64/sys/boot/powerpc/ps3/ps3.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/ppc64/sys/boot/powerpc/ps3/ps3.h Tue Mar 30 23:15:06 2010 (r205943) @@ -0,0 +1,33 @@ +/*- + * Copyright (C) 2010 Nathan Whitehorn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _PS3_H +#define _PS3_H + +int ps3mmu_init(int maxmem); +int ps3mmu_map(uint64_t va, uint64_t pa); +void *ps3mmu_mapdev(uint64_t pa, size_t length); + +#endif Added: projects/ppc64/sys/boot/powerpc/ps3/ps3cons.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/ppc64/sys/boot/powerpc/ps3/ps3cons.c Tue Mar 30 23:15:06 2010 (r205943) @@ -0,0 +1,166 @@ +/*- + * Copyright (C) 2010 Nathan Whitehorn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: head/sys/boot/powerpc/ofw/start.c 174722 2007-12-17 22:18:07Z marcel $"); + +#include +#include "bootstrap.h" +#include "font.h" +#include "lv1call.h" +#include "ps3.h" + +#define FONT_SIZE 14 +#define FONT dflt_font_14 +#define XMARGIN 40 +#define YMARGIN 30 +#define BG_COLOR 0x00000000 +#define FG_COLOR 0xffffffff + +#define FB_SIZE (16*1024*1024) +uint64_t fb_paddr = 0; +uint32_t *fb_vaddr; + +int fb_width, fb_height; +int x, y; + +static void ps3cons_probe(struct console *cp); +static int ps3cons_init(int arg); +static void ps3cons_putchar(int c); +static int ps3cons_getchar(); +static int ps3cons_poll(); + +struct console ps3console = { + "ps3", + "Playstation 3 Framebuffer", + 0, + ps3cons_probe, + ps3cons_init, + ps3cons_putchar, + ps3cons_getchar, + ps3cons_poll, +}; + +static void +ps3cons_probe(struct console *cp) +{ + /* XXX: Get from HV */ + fb_width = 720; + fb_height = 480; + + cp->c_flags |= C_PRESENTIN|C_PRESENTOUT; +} + +static int +ps3cons_init(int arg) +{ + uint64_t fbhandle, fbcontext; + int i; + + lv1_gpu_open(0); + lv1_gpu_context_attribute(0, L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_MODE_SET, + 0,0,0,0); + lv1_gpu_context_attribute(0, L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_MODE_SET, + 0,0,1,0); + lv1_gpu_context_attribute(0, L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_SYNC, + 0,L1GPU_DISPLAY_SYNC_VSYNC,0,0); + lv1_gpu_context_attribute(0, L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_SYNC, + 1,L1GPU_DISPLAY_SYNC_VSYNC,0,0); + lv1_gpu_memory_allocate(FB_SIZE, 0, 0, 0, 0, &fbhandle, &fb_paddr); + lv1_gpu_context_allocate(fbhandle, 0, &fbcontext); + + lv1_gpu_context_attribute(fbcontext, + L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_FLIP, 0, 0, 0, 0); + lv1_gpu_context_attribute(fbcontext, + L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_FLIP, 1, 0, 0, 0); + + fb_vaddr = ps3mmu_mapdev(fb_paddr, FB_SIZE); + + x = y = 0; + + /* Blank console */ + for (i = 0; i < fb_width*fb_height; i++) + fb_vaddr[i] = BG_COLOR; + + return (0); +} + +static void +ps3cons_putchar(int c) +{ + uint32_t fg, bg; + uint32_t *addr; + int i, j, k; + u_char *p; + + if (c == 0 || c == '\r') + return; + + /* Move down on newlines */ + if (c == '\n') { + y += FONT_SIZE; + x = 0; + return; + } + + /* Wrap long lines */ + if (x + XMARGIN + FONT_SIZE > fb_width - XMARGIN) { + y += FONT_SIZE; + x = 0; + } + + + fg = FG_COLOR; + bg = BG_COLOR; + + addr = fb_vaddr + (y + YMARGIN)*fb_width + (x + XMARGIN); + p = FONT + c*FONT_SIZE; + + for (i = 0; i < FONT_SIZE; i++) { + for (j = 0, k = 7; j < 8; j++, k--) { + if ((p[i] & (1 << k)) == 0) + *(addr + j) = bg; + else + *(addr + j) = fg; + } + + addr += fb_width; + } + + x += 8; +} + +static int +ps3cons_getchar() +{ + return (-1); +} + +static int +ps3cons_poll() +{ + return (0); +} + Modified: projects/ppc64/sys/boot/powerpc/ps3/ps3mmu.c ============================================================================== --- projects/ppc64/sys/boot/powerpc/ps3/ps3mmu.c Tue Mar 30 23:14:35 2010 (r205942) +++ projects/ppc64/sys/boot/powerpc/ps3/ps3mmu.c Tue Mar 30 23:15:06 2010 (r205943) @@ -34,17 +34,15 @@ __FBSDID("$FreeBSD: head/sys/boot/powerp #include #include #include +#include #include "bootstrap.h" #include "lv1call.h" - -#define PS3_LPAR_VAS_ID_CURRENT 0 +#include "ps3.h" register_t pteg_count, pteg_mask; uint64_t as_id; - -extern uint64_t fb_paddr; -extern uint32_t *fb_vaddr; +uint64_t virtual_avail; int ps3mmu_map(uint64_t va, uint64_t pa) @@ -76,6 +74,25 @@ ps3mmu_map(uint64_t va, uint64_t pa) return (lv1_insert_pte(ptegidx, &pt, LPTE_LOCKED)); } +void * +ps3mmu_mapdev(uint64_t pa, size_t length) +{ + uint64_t spa; + void *mapstart; + int err; + + mapstart = (void *)(uintptr_t)virtual_avail; + + for (spa = pa; spa < pa + length; spa += PAGE_SIZE) { + err = ps3mmu_map(virtual_avail, spa); + virtual_avail += PAGE_SIZE; + if (err != 0) + return (NULL); + } + + return (mapstart); +} + int ps3mmu_init(int maxmem) { @@ -89,9 +106,7 @@ ps3mmu_init(int maxmem) for (i = 0; i < maxmem; i += 16*1024*1024) ps3mmu_map(i,i); - for (i = 0; i < 16*1024*1024; i += 4096) - ps3mmu_map(0x10000000 + i, fb_paddr + i); - fb_vaddr = (uint32_t *)0x10000000; + virtual_avail = 0x10000000; __asm __volatile ("slbia; slbmte %0, %1; slbmte %2,%3" :: "r"((0 << SLBV_VSID_SHIFT) | SLBV_L), "r"(0 | SLBE_VALID), @@ -99,5 +114,7 @@ ps3mmu_init(int maxmem) "r"((1 << SLBE_ESID_SHIFT) | SLBE_VALID | 1)); mtmsr(mfmsr() | PSL_IR | PSL_DR | PSL_RI | PSL_ME); + + return (0); } From owner-svn-src-projects@FreeBSD.ORG Fri Apr 2 04:30:22 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5BD781065672; Fri, 2 Apr 2010 04:30:22 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 472748FC22; Fri, 2 Apr 2010 04:30:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o324UMTh047034; Fri, 2 Apr 2010 04:30:22 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o324ULkY047019; Fri, 2 Apr 2010 04:30:21 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201004020430.o324ULkY047019@svn.freebsd.org> From: Marcel Moolenaar Date: Fri, 2 Apr 2010 04:30:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206064 - in projects/altix: lib/libstand sys/amd64/amd64 sys/amd64/include sys/arm/conf sys/arm/mv sys/cam sys/cam/scsi sys/conf sys/dev/ata sys/dev/cxgb sys/dev/cxgb/common sys/dev/e1... X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Apr 2010 04:30:22 -0000 Author: marcel Date: Fri Apr 2 04:30:21 2010 New Revision: 206064 URL: http://svn.freebsd.org/changeset/base/206064 Log: Merge svn+ssh://svn.freebsd.org/base/head@206063 Added: projects/altix/sys/dev/e1000/if_lem.c - copied unchanged from r206063, head/sys/dev/e1000/if_lem.c projects/altix/sys/dev/e1000/if_lem.h - copied unchanged from r206063, head/sys/dev/e1000/if_lem.h projects/altix/sys/modules/alq/ - copied from r206063, head/sys/modules/alq/ Modified: projects/altix/lib/libstand/assert.c projects/altix/sys/amd64/amd64/apic_vector.S projects/altix/sys/amd64/amd64/local_apic.c projects/altix/sys/amd64/include/apicvar.h projects/altix/sys/amd64/include/reg.h projects/altix/sys/arm/conf/KB920X projects/altix/sys/arm/mv/mv_sata.c projects/altix/sys/cam/cam_xpt.c projects/altix/sys/cam/scsi/scsi_all.h projects/altix/sys/conf/NOTES projects/altix/sys/conf/files projects/altix/sys/dev/ata/ata-all.h projects/altix/sys/dev/cxgb/common/cxgb_ael1002.c projects/altix/sys/dev/cxgb/common/cxgb_common.h projects/altix/sys/dev/cxgb/common/cxgb_t3_hw.c projects/altix/sys/dev/cxgb/cxgb_adapter.h projects/altix/sys/dev/cxgb/cxgb_main.c projects/altix/sys/dev/cxgb/cxgb_sge.c projects/altix/sys/dev/e1000/e1000_80003es2lan.c projects/altix/sys/dev/e1000/e1000_82571.c projects/altix/sys/dev/e1000/e1000_82575.c projects/altix/sys/dev/e1000/e1000_82575.h projects/altix/sys/dev/e1000/e1000_defines.h projects/altix/sys/dev/e1000/e1000_hw.h projects/altix/sys/dev/e1000/e1000_ich8lan.c projects/altix/sys/dev/e1000/e1000_ich8lan.h projects/altix/sys/dev/e1000/e1000_mac.c projects/altix/sys/dev/e1000/e1000_manage.c projects/altix/sys/dev/e1000/e1000_phy.c projects/altix/sys/dev/e1000/e1000_regs.h projects/altix/sys/dev/e1000/if_em.c projects/altix/sys/dev/e1000/if_em.h projects/altix/sys/dev/e1000/if_igb.c projects/altix/sys/dev/e1000/if_igb.h projects/altix/sys/dev/firewire/sbp.c projects/altix/sys/dev/hwpmc/hwpmc_mod.c projects/altix/sys/dev/ixgbe/ixgbe.c projects/altix/sys/dev/ixgbe/ixgbe.h projects/altix/sys/dev/malo/if_malo.c projects/altix/sys/dev/mpt/mpt_cam.c projects/altix/sys/dev/sound/pci/envy24.c projects/altix/sys/dev/sound/pci/envy24.h projects/altix/sys/dev/sound/pci/envy24ht.c projects/altix/sys/dev/sound/pci/envy24ht.h projects/altix/sys/dev/sound/pci/es137x.c projects/altix/sys/dev/sound/pci/spicds.c projects/altix/sys/dev/sound/pci/spicds.h projects/altix/sys/dev/syscons/scvidctl.c projects/altix/sys/dev/syscons/syscons.c projects/altix/sys/dev/ubsec/ubsec.c projects/altix/sys/fs/nfs/nfs_commonport.c projects/altix/sys/fs/nfs/nfs_commonsubs.c projects/altix/sys/fs/nfs/nfs_var.h projects/altix/sys/fs/nfs/nfsport.h projects/altix/sys/fs/nfs/nfsrvstate.h projects/altix/sys/fs/nfsserver/nfs_nfsdport.c projects/altix/sys/fs/nfsserver/nfs_nfsdserv.c projects/altix/sys/fs/nfsserver/nfs_nfsdstate.c projects/altix/sys/geom/geom_vfs.c projects/altix/sys/geom/multipath/g_multipath.c projects/altix/sys/i386/i386/apic_vector.s projects/altix/sys/i386/i386/local_apic.c projects/altix/sys/i386/include/apicvar.h projects/altix/sys/kern/kern_alq.c projects/altix/sys/kern/kern_event.c projects/altix/sys/mips/conf/AR71XX projects/altix/sys/modules/Makefile projects/altix/sys/modules/em/Makefile projects/altix/sys/net/bpf.c projects/altix/sys/net80211/ieee80211_input.c projects/altix/sys/net80211/ieee80211_var.h projects/altix/sys/netgraph/ng_deflate.c projects/altix/sys/netgraph/ng_ksocket.c projects/altix/sys/netgraph/ng_l2tp.c projects/altix/sys/netgraph/ng_mppc.c projects/altix/sys/netgraph/ng_ppp.c projects/altix/sys/netgraph/ng_pptpgre.c projects/altix/sys/netgraph/ng_tcpmss.c projects/altix/sys/netinet/in.h projects/altix/sys/netinet/ipfw/ip_dn_io.c projects/altix/sys/netinet/ipfw/ip_fw_sockopt.c projects/altix/sys/sparc64/fhc/fhc.c projects/altix/sys/sparc64/pci/apb.c projects/altix/sys/sparc64/pci/psycho.c projects/altix/sys/sparc64/pci/schizo.c projects/altix/sys/sparc64/sbus/sbus.c projects/altix/sys/sys/ioccom.h projects/altix/sys/sys/pcpu.h projects/altix/sys/sys/vtoc.h Directory Properties: projects/altix/lib/libstand/ (props changed) projects/altix/sys/ (props changed) Modified: projects/altix/lib/libstand/assert.c ============================================================================== --- projects/altix/lib/libstand/assert.c Fri Apr 2 02:19:28 2010 (r206063) +++ projects/altix/lib/libstand/assert.c Fri Apr 2 04:30:21 2010 (r206064) @@ -35,10 +35,10 @@ void __assert(const char *func, const char *file, int line, const char *expression) { if (func == NULL) - printf("Assertion failed: (%s), file %s, line %d.\n", + panic("Assertion failed: (%s), file %s, line %d.\n", expression, file, line); else - printf("Assertion failed: (%s), function %s, file %s, line " - "%d.\n", expression, func, file, line); - exit(); + panic( + "Assertion failed: (%s), function %s, file %s, line %d.\n", + expression, func, file, line); } Modified: projects/altix/sys/amd64/amd64/apic_vector.S ============================================================================== --- projects/altix/sys/amd64/amd64/apic_vector.S Fri Apr 2 02:19:28 2010 (r206063) +++ projects/altix/sys/amd64/amd64/apic_vector.S Fri Apr 2 04:30:21 2010 (r206064) @@ -104,6 +104,18 @@ IDTVEC(timerint) MEXITCOUNT jmp doreti +/* + * Local APIC error interrupt handler. + */ + .text + SUPERALIGN_TEXT +IDTVEC(errorint) + PUSH_FRAME + FAKE_MCOUNT(TF_RIP(%rsp)) + call lapic_handle_error + MEXITCOUNT + jmp doreti + #ifdef SMP /* * Global address space TLB shootdown. Modified: projects/altix/sys/amd64/amd64/local_apic.c ============================================================================== --- projects/altix/sys/amd64/amd64/local_apic.c Fri Apr 2 02:19:28 2010 (r206063) +++ projects/altix/sys/amd64/amd64/local_apic.c Fri Apr 2 04:30:21 2010 (r206064) @@ -115,14 +115,12 @@ struct lapic { int la_ioint_irqs[APIC_NUM_IOINTS + 1]; } static lapics[MAX_APIC_ID + 1]; -/* XXX: should thermal be an NMI? */ - /* Global defaults for local APIC LVT entries. */ static struct lvt lvts[LVT_MAX + 1] = { { 1, 1, 1, 1, APIC_LVT_DM_EXTINT, 0 }, /* LINT0: masked ExtINT */ { 1, 1, 0, 1, APIC_LVT_DM_NMI, 0 }, /* LINT1: NMI */ { 1, 1, 1, 1, APIC_LVT_DM_FIXED, APIC_TIMER_INT }, /* Timer */ - { 1, 1, 1, 1, APIC_LVT_DM_FIXED, APIC_ERROR_INT }, /* Error */ + { 1, 1, 0, 1, APIC_LVT_DM_FIXED, APIC_ERROR_INT }, /* Error */ { 1, 1, 1, 1, APIC_LVT_DM_NMI, 0 }, /* PMC */ { 1, 1, 1, 1, APIC_LVT_DM_FIXED, APIC_THERMAL_INT }, /* Thermal */ }; @@ -225,7 +223,10 @@ lapic_init(vm_paddr_t addr) /* Local APIC timer interrupt. */ setidt(APIC_TIMER_INT, IDTVEC(timerint), SDT_SYSIGT, SEL_KPL, 0); - /* XXX: error/thermal interrupts */ + /* Local APIC error interrupt. */ + setidt(APIC_ERROR_INT, IDTVEC(errorint), SDT_SYSIGT, SEL_KPL, 0); + + /* XXX: Thermal interrupt */ } /* @@ -278,7 +279,7 @@ lapic_dump(const char* str) lapic->id, lapic->version, lapic->ldr, lapic->dfr); printf(" lint0: 0x%08x lint1: 0x%08x TPR: 0x%08x SVR: 0x%08x\n", lapic->lvt_lint0, lapic->lvt_lint1, lapic->tpr, lapic->svr); - printf(" timer: 0x%08x therm: 0x%08x err: 0x%08x pcm: 0x%08x\n", + printf(" timer: 0x%08x therm: 0x%08x err: 0x%08x pmc: 0x%08x\n", lapic->lvt_timer, lapic->lvt_thermal, lapic->lvt_error, lapic->lvt_pcint); } @@ -326,7 +327,11 @@ lapic_setup(int boot) lapic_timer_enable_intr(); } - /* XXX: Error and thermal LVTs */ + /* Program error LVT and clear any existing errors. */ + lapic->lvt_error = lvt_mode(la, LVT_ERROR, lapic->lvt_error); + lapic->esr = 0; + + /* XXX: Thermal LVT */ intr_restore(eflags); } @@ -725,18 +730,6 @@ lapic_eoi(void) lapic->eoi = 0; } -/* - * Read the contents of the error status register. We have to write - * to the register first before reading from it. - */ -u_int -lapic_error(void) -{ - - lapic->esr = 0; - return (lapic->esr); -} - void lapic_handle_intr(int vector, struct trapframe *frame) { @@ -863,6 +856,24 @@ lapic_timer_enable_intr(void) lapic->lvt_timer = value; } +void +lapic_handle_error(void) +{ + u_int32_t esr; + + /* + * Read the contents of the error status register. Write to + * the register first before reading from it to force the APIC + * to update its value to indicate any errors that have + * occurred since the previous write to the register. + */ + lapic->esr = 0; + esr = lapic->esr; + + printf("CPU%d: local APIC error 0x%x\n", PCPU_GET(cpuid), esr); + lapic_eoi(); +} + u_int apic_cpuid(u_int apic_id) { Modified: projects/altix/sys/amd64/include/apicvar.h ============================================================================== --- projects/altix/sys/amd64/include/apicvar.h Fri Apr 2 02:19:28 2010 (r206063) +++ projects/altix/sys/amd64/include/apicvar.h Fri Apr 2 04:30:21 2010 (r206064) @@ -179,7 +179,8 @@ struct apic_enumerator { inthand_t IDTVEC(apic_isr1), IDTVEC(apic_isr2), IDTVEC(apic_isr3), IDTVEC(apic_isr4), IDTVEC(apic_isr5), IDTVEC(apic_isr6), - IDTVEC(apic_isr7), IDTVEC(spuriousint), IDTVEC(timerint); + IDTVEC(apic_isr7), IDTVEC(errorint), IDTVEC(spuriousint), + IDTVEC(timerint); extern vm_paddr_t lapic_paddr; extern int apic_cpuids[]; @@ -211,13 +212,13 @@ void lapic_disable_pmc(void); void lapic_dump(const char *str); int lapic_enable_pmc(void); void lapic_eoi(void); -u_int lapic_error(void); int lapic_id(void); void lapic_init(vm_paddr_t addr); int lapic_intr_pending(u_int vector); void lapic_ipi_raw(register_t icrlo, u_int dest); void lapic_ipi_vectored(u_int vector, int dest); int lapic_ipi_wait(int delay); +void lapic_handle_error(void); void lapic_handle_intr(int vector, struct trapframe *frame); void lapic_handle_timer(struct trapframe *frame); void lapic_reenable_pmc(void); Modified: projects/altix/sys/amd64/include/reg.h ============================================================================== --- projects/altix/sys/amd64/include/reg.h Fri Apr 2 02:19:28 2010 (r206063) +++ projects/altix/sys/amd64/include/reg.h Fri Apr 2 04:30:21 2010 (r206064) @@ -109,7 +109,7 @@ struct dbreg { #define DBREG_DR7_EXEC 0x00 /* break on execute */ #define DBREG_DR7_WRONLY 0x01 /* break on write */ #define DBREG_DR7_RDWR 0x03 /* break on read or write */ -#define DBREG_DR7_MASK(i) ((u_long)0xf << ((i) * 4 + 16) | 0x3 << (i) * 2) +#define DBREG_DR7_MASK(i) (0xful << ((i) * 4 + 16) | 0x3 << (i) * 2) #define DBREG_DR7_SET(i, len, access, enable) \ ((u_long)((len) << 2 | (access)) << ((i) * 4 + 16) | (enable) << (i) * 2) #define DBREG_DR7_GD 0x2000 Modified: projects/altix/sys/arm/conf/KB920X ============================================================================== --- projects/altix/sys/arm/conf/KB920X Fri Apr 2 02:19:28 2010 (r206063) +++ projects/altix/sys/arm/conf/KB920X Fri Apr 2 04:30:21 2010 (r206064) @@ -24,7 +24,7 @@ include "../at91/std.kb920x" # The AT91 platform doesn't use /boot/loader, so we have to statically wire # hints. hints "KB920X.hints" -makeoptions MODULES_OVERRIDE="" +#makeoptions MODULES_OVERRIDE="" makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols options DDB Modified: projects/altix/sys/arm/mv/mv_sata.c ============================================================================== --- projects/altix/sys/arm/mv/mv_sata.c Fri Apr 2 02:19:28 2010 (r206063) +++ projects/altix/sys/arm/mv/mv_sata.c Fri Apr 2 04:30:21 2010 (r206064) @@ -600,7 +600,12 @@ sata_channel_begin_transaction(struct at crqb->crqb_ata_lba_mid = request->u.ata.lba >> 8; crqb->crqb_ata_lba_high = request->u.ata.lba >> 16; crqb->crqb_ata_device = ((request->u.ata.lba >> 24) & 0x0F) | (1 << 6); + crqb->crqb_ata_lba_low_p = request->u.ata.lba >> 24; + crqb->crqb_ata_lba_mid_p = request->u.ata.lba >> 32; + crqb->crqb_ata_lba_high_p = request->u.ata.lba >> 40; + crqb->crqb_ata_feature_p = request->u.ata.feature >> 8; crqb->crqb_ata_count = request->u.ata.count; + crqb->crqb_ata_count_p = request->u.ata.count >> 8; bus_dmamap_sync(ch->dma.work_tag, ch->dma.work_map, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); Modified: projects/altix/sys/cam/cam_xpt.c ============================================================================== --- projects/altix/sys/cam/cam_xpt.c Fri Apr 2 02:19:28 2010 (r206063) +++ projects/altix/sys/cam/cam_xpt.c Fri Apr 2 04:30:21 2010 (r206064) @@ -2380,6 +2380,7 @@ xpt_action_default(union ccb *start_ccb) if (start_ccb->ccb_h.func_code == XPT_ATA_IO) { start_ccb->ataio.resid = 0; } + /* FALLTHROUGH */ case XPT_RESET_DEV: case XPT_ENG_EXEC: { @@ -2888,6 +2889,9 @@ xpt_action_default(union ccb *start_ccb) case XPT_ENG_INQ: /* XXX Implement */ start_ccb->ccb_h.status = CAM_PROVIDE_FAIL; + if (start_ccb->ccb_h.func_code & XPT_FC_DEV_QUEUED) { + xpt_done(start_ccb); + } break; } } @@ -3930,7 +3934,7 @@ xpt_dev_async_default(u_int32_t async_co struct cam_et *target, struct cam_ed *device, void *async_arg) { - printf("xpt_dev_async called\n"); + printf("%s called\n", __func__); } u_int32_t @@ -4919,4 +4923,3 @@ camisr_runqueue(void *V_queue) (*ccb_h->cbfcnp)(ccb_h->path->periph, (union ccb *)ccb_h); } } - Modified: projects/altix/sys/cam/scsi/scsi_all.h ============================================================================== --- projects/altix/sys/cam/scsi/scsi_all.h Fri Apr 2 02:19:28 2010 (r206063) +++ projects/altix/sys/cam/scsi/scsi_all.h Fri Apr 2 04:30:21 2010 (r206064) @@ -170,6 +170,8 @@ struct scsi_mode_sense_6 #define SMS_PAGE_CODE 0x3F #define SMS_VENDOR_SPECIFIC_PAGE 0x00 #define SMS_DISCONNECT_RECONNECT_PAGE 0x02 +#define SMS_FORMAT_DEVICE_PAGE 0x03 +#define SMS_GEOMETRY_PAGE 0x04 #define SMS_CACHE_PAGE 0x08 #define SMS_PERIPHERAL_DEVICE_PAGE 0x09 #define SMS_CONTROL_MODE_PAGE 0x0A Modified: projects/altix/sys/conf/NOTES ============================================================================== --- projects/altix/sys/conf/NOTES Fri Apr 2 02:19:28 2010 (r206063) +++ projects/altix/sys/conf/NOTES Fri Apr 2 04:30:21 2010 (r206064) @@ -2091,6 +2091,7 @@ device ath_hal # pci/cardbus chip supp options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors #device ath_ar9160 # AR9160 chips #device ath_ar9280 # AR9280 chips +#device ath_ar9285 # AR9285 chips device ath_rate_sample # SampleRate tx rate control for ath device bwi # Broadcom BCM430* BCM431* device bwn # Broadcom BCM43xx Modified: projects/altix/sys/conf/files ============================================================================== --- projects/altix/sys/conf/files Fri Apr 2 02:19:28 2010 (r206063) +++ projects/altix/sys/conf/files Fri Apr 2 04:30:21 2010 (r206064) @@ -912,6 +912,8 @@ dev/eisa/eisa_if.m standard dev/eisa/eisaconf.c optional eisa dev/e1000/if_em.c optional em inet \ compile-with "${NORMAL_C} -I$S/dev/e1000" +dev/e1000/if_lem.c optional em inet \ + compile-with "${NORMAL_C} -I$S/dev/e1000" dev/e1000/if_igb.c optional igb inet \ compile-with "${NORMAL_C} -I$S/dev/e1000" dev/e1000/e1000_80003es2lan.c optional em | igb \ @@ -2320,7 +2322,7 @@ net/if_ethersubr.c optional ether \ net/if_faith.c optional faith net/if_fddisubr.c optional fddi net/if_fwsubr.c optional fwip -net/if_gif.c optional gif +net/if_gif.c optional gif | netgraph_gif net/if_gre.c optional gre inet net/if_iso88025subr.c optional token net/if_lagg.c optional lagg @@ -2483,7 +2485,7 @@ netinet/if_ether.c optional inet ether netinet/igmp.c optional inet netinet/in.c optional inet netinet/ip_carp.c optional inet carp | inet6 carp -netinet/in_gif.c optional gif inet +netinet/in_gif.c optional gif inet | netgraph_gif inet netinet/ip_gre.c optional gre inet netinet/ip_id.c optional inet netinet/in_mcast.c optional inet @@ -2558,7 +2560,7 @@ netinet6/frag6.c optional inet6 netinet6/icmp6.c optional inet6 netinet6/in6.c optional inet6 netinet6/in6_cksum.c optional inet6 -netinet6/in6_gif.c optional gif inet6 +netinet6/in6_gif.c optional gif inet6 | netgraph_gif inet6 netinet6/in6_ifattach.c optional inet6 netinet6/in6_mcast.c optional inet6 netinet6/in6_pcb.c optional inet6 Modified: projects/altix/sys/dev/ata/ata-all.h ============================================================================== --- projects/altix/sys/dev/ata/ata-all.h Fri Apr 2 02:19:28 2010 (r206063) +++ projects/altix/sys/dev/ata/ata-all.h Fri Apr 2 04:30:21 2010 (r206064) @@ -26,6 +26,8 @@ * $FreeBSD$ */ +#include "opt_ata.h" + #if 0 #define ATA_LEGACY_SUPPORT /* Enable obsolete features that break * some modern devices */ Modified: projects/altix/sys/dev/cxgb/common/cxgb_ael1002.c ============================================================================== --- projects/altix/sys/dev/cxgb/common/cxgb_ael1002.c Fri Apr 2 02:19:28 2010 (r206063) +++ projects/altix/sys/dev/cxgb/common/cxgb_ael1002.c Fri Apr 2 04:30:21 2010 (r206064) @@ -1447,395 +1447,439 @@ static int ael2020_setup_twinax_edc(stru 0xd803, 0x40aa, 0xd804, 0x401c, 0xd805, 0x401e, - 0xd806, 0x2ff4, - 0xd807, 0x3dc4, - 0xd808, 0x2035, - 0xd809, 0x3035, - 0xd80a, 0x6524, - 0xd80b, 0x2cb2, - 0xd80c, 0x3012, - 0xd80d, 0x1002, - 0xd80e, 0x26e2, - 0xd80f, 0x3022, - 0xd810, 0x1002, - 0xd811, 0x27d2, - 0xd812, 0x3022, + 0xd806, 0x20c5, + 0xd807, 0x3c05, + 0xd808, 0x6536, + 0xd809, 0x2fe4, + 0xd80a, 0x3dc4, + 0xd80b, 0x6624, + 0xd80c, 0x2ff4, + 0xd80d, 0x3dc4, + 0xd80e, 0x2035, + 0xd80f, 0x30a5, + 0xd810, 0x6524, + 0xd811, 0x2ca2, + 0xd812, 0x3012, 0xd813, 0x1002, - 0xd814, 0x2822, - 0xd815, 0x3012, + 0xd814, 0x27e2, + 0xd815, 0x3022, 0xd816, 0x1002, - 0xd817, 0x2492, + 0xd817, 0x28d2, 0xd818, 0x3022, 0xd819, 0x1002, - 0xd81a, 0x2772, + 0xd81a, 0x2892, 0xd81b, 0x3012, 0xd81c, 0x1002, - 0xd81d, 0x23d2, + 0xd81d, 0x24e2, 0xd81e, 0x3022, 0xd81f, 0x1002, - 0xd820, 0x22cd, - 0xd821, 0x301d, - 0xd822, 0x27f2, - 0xd823, 0x3022, - 0xd824, 0x1002, - 0xd825, 0x5553, - 0xd826, 0x0307, - 0xd827, 0x2522, - 0xd828, 0x3022, - 0xd829, 0x1002, - 0xd82a, 0x2142, - 0xd82b, 0x3012, - 0xd82c, 0x1002, - 0xd82d, 0x4016, - 0xd82e, 0x5e63, - 0xd82f, 0x0344, - 0xd830, 0x2142, + 0xd820, 0x27e2, + 0xd821, 0x3012, + 0xd822, 0x1002, + 0xd823, 0x2422, + 0xd824, 0x3022, + 0xd825, 0x1002, + 0xd826, 0x22cd, + 0xd827, 0x301d, + 0xd828, 0x28f2, + 0xd829, 0x3022, + 0xd82a, 0x1002, + 0xd82b, 0x5553, + 0xd82c, 0x0307, + 0xd82d, 0x2572, + 0xd82e, 0x3022, + 0xd82f, 0x1002, + 0xd830, 0x21a2, 0xd831, 0x3012, 0xd832, 0x1002, - 0xd833, 0x400e, - 0xd834, 0x2522, - 0xd835, 0x3022, - 0xd836, 0x1002, - 0xd837, 0x2b52, - 0xd838, 0x3012, - 0xd839, 0x1002, - 0xd83a, 0x2742, + 0xd833, 0x4016, + 0xd834, 0x5e63, + 0xd835, 0x0344, + 0xd836, 0x21a2, + 0xd837, 0x3012, + 0xd838, 0x1002, + 0xd839, 0x400e, + 0xd83a, 0x2572, 0xd83b, 0x3022, 0xd83c, 0x1002, - 0xd83d, 0x25e2, - 0xd83e, 0x3022, + 0xd83d, 0x2b22, + 0xd83e, 0x3012, 0xd83f, 0x1002, - 0xd840, 0x2fa4, - 0xd841, 0x3dc4, - 0xd842, 0x6624, - 0xd843, 0x414b, - 0xd844, 0x56b3, - 0xd845, 0x03c6, - 0xd846, 0x866b, - 0xd847, 0x400c, - 0xd848, 0x2712, - 0xd849, 0x3012, - 0xd84a, 0x1002, - 0xd84b, 0x2c4b, - 0xd84c, 0x309b, - 0xd84d, 0x56b3, - 0xd84e, 0x03c3, - 0xd84f, 0x866b, - 0xd850, 0x400c, - 0xd851, 0x2272, - 0xd852, 0x3022, - 0xd853, 0x1002, - 0xd854, 0x2742, - 0xd855, 0x3022, - 0xd856, 0x1002, - 0xd857, 0x25e2, - 0xd858, 0x3022, - 0xd859, 0x1002, - 0xd85a, 0x2fb4, - 0xd85b, 0x3dc4, - 0xd85c, 0x6624, - 0xd85d, 0x56b3, - 0xd85e, 0x03c3, - 0xd85f, 0x866b, - 0xd860, 0x401c, - 0xd861, 0x2c45, - 0xd862, 0x3095, - 0xd863, 0x5b53, - 0xd864, 0x2372, - 0xd865, 0x3012, - 0xd866, 0x13c2, - 0xd867, 0x5cc3, - 0xd868, 0x2712, - 0xd869, 0x3012, - 0xd86a, 0x1312, - 0xd86b, 0x2b52, + 0xd840, 0x2842, + 0xd841, 0x3022, + 0xd842, 0x1002, + 0xd843, 0x26e2, + 0xd844, 0x3022, + 0xd845, 0x1002, + 0xd846, 0x2fa4, + 0xd847, 0x3dc4, + 0xd848, 0x6624, + 0xd849, 0x2e8b, + 0xd84a, 0x303b, + 0xd84b, 0x56b3, + 0xd84c, 0x03c6, + 0xd84d, 0x866b, + 0xd84e, 0x400c, + 0xd84f, 0x2782, + 0xd850, 0x3012, + 0xd851, 0x1002, + 0xd852, 0x2c4b, + 0xd853, 0x309b, + 0xd854, 0x56b3, + 0xd855, 0x03c3, + 0xd856, 0x866b, + 0xd857, 0x400c, + 0xd858, 0x22a2, + 0xd859, 0x3022, + 0xd85a, 0x1002, + 0xd85b, 0x2842, + 0xd85c, 0x3022, + 0xd85d, 0x1002, + 0xd85e, 0x26e2, + 0xd85f, 0x3022, + 0xd860, 0x1002, + 0xd861, 0x2fb4, + 0xd862, 0x3dc4, + 0xd863, 0x6624, + 0xd864, 0x56b3, + 0xd865, 0x03c3, + 0xd866, 0x866b, + 0xd867, 0x401c, + 0xd868, 0x2c45, + 0xd869, 0x3095, + 0xd86a, 0x5b53, + 0xd86b, 0x23d2, 0xd86c, 0x3012, - 0xd86d, 0x1002, - 0xd86e, 0x2742, - 0xd86f, 0x3022, - 0xd870, 0x1002, - 0xd871, 0x2582, - 0xd872, 0x3022, - 0xd873, 0x1002, - 0xd874, 0x2142, - 0xd875, 0x3012, - 0xd876, 0x1002, - 0xd877, 0x628f, - 0xd878, 0x2985, - 0xd879, 0x33a5, - 0xd87a, 0x25e2, - 0xd87b, 0x3022, - 0xd87c, 0x1002, - 0xd87d, 0x5653, - 0xd87e, 0x03d2, - 0xd87f, 0x401e, - 0xd880, 0x6f72, - 0xd881, 0x1002, - 0xd882, 0x628f, - 0xd883, 0x2304, - 0xd884, 0x3c84, - 0xd885, 0x6436, - 0xd886, 0xdff4, - 0xd887, 0x6436, - 0xd888, 0x2ff5, - 0xd889, 0x3005, - 0xd88a, 0x8656, - 0xd88b, 0xdfba, - 0xd88c, 0x56a3, - 0xd88d, 0xd05a, - 0xd88e, 0x2972, - 0xd88f, 0x3012, - 0xd890, 0x1392, - 0xd891, 0xd05a, - 0xd892, 0x56a3, - 0xd893, 0xdfba, - 0xd894, 0x0383, - 0xd895, 0x6f72, - 0xd896, 0x1002, - 0xd897, 0x2b45, - 0xd898, 0x3005, - 0xd899, 0x4178, - 0xd89a, 0x5653, - 0xd89b, 0x0384, - 0xd89c, 0x2a62, - 0xd89d, 0x3012, - 0xd89e, 0x1002, - 0xd89f, 0x2f05, - 0xd8a0, 0x3005, - 0xd8a1, 0x41c8, - 0xd8a2, 0x5653, - 0xd8a3, 0x0382, - 0xd8a4, 0x0002, - 0xd8a5, 0x4218, - 0xd8a6, 0x2474, - 0xd8a7, 0x3c84, - 0xd8a8, 0x6437, - 0xd8a9, 0xdff4, - 0xd8aa, 0x6437, - 0xd8ab, 0x2ff5, - 0xd8ac, 0x3c05, - 0xd8ad, 0x8757, - 0xd8ae, 0xb888, - 0xd8af, 0x9787, - 0xd8b0, 0xdff4, - 0xd8b1, 0x6724, - 0xd8b2, 0x866a, - 0xd8b3, 0x6f72, - 0xd8b4, 0x1002, - 0xd8b5, 0x2641, - 0xd8b6, 0x3021, - 0xd8b7, 0x1001, - 0xd8b8, 0xc620, - 0xd8b9, 0x0000, - 0xd8ba, 0xc621, - 0xd8bb, 0x0000, - 0xd8bc, 0xc622, - 0xd8bd, 0x00ce, - 0xd8be, 0xc623, - 0xd8bf, 0x007f, - 0xd8c0, 0xc624, - 0xd8c1, 0x0032, - 0xd8c2, 0xc625, - 0xd8c3, 0x0000, - 0xd8c4, 0xc627, - 0xd8c5, 0x0000, - 0xd8c6, 0xc628, - 0xd8c7, 0x0000, - 0xd8c8, 0xc62c, + 0xd86d, 0x13c2, + 0xd86e, 0x5cc3, + 0xd86f, 0x2782, + 0xd870, 0x3012, + 0xd871, 0x1312, + 0xd872, 0x2b22, + 0xd873, 0x3012, + 0xd874, 0x1002, + 0xd875, 0x2842, + 0xd876, 0x3022, + 0xd877, 0x1002, + 0xd878, 0x2622, + 0xd879, 0x3022, + 0xd87a, 0x1002, + 0xd87b, 0x21a2, + 0xd87c, 0x3012, + 0xd87d, 0x1002, + 0xd87e, 0x628f, + 0xd87f, 0x2985, + 0xd880, 0x33a5, + 0xd881, 0x26e2, + 0xd882, 0x3022, + 0xd883, 0x1002, + 0xd884, 0x5653, + 0xd885, 0x03d2, + 0xd886, 0x401e, + 0xd887, 0x6f72, + 0xd888, 0x1002, + 0xd889, 0x628f, + 0xd88a, 0x2304, + 0xd88b, 0x3c84, + 0xd88c, 0x6436, + 0xd88d, 0xdff4, + 0xd88e, 0x6436, + 0xd88f, 0x2ff5, + 0xd890, 0x3005, + 0xd891, 0x8656, + 0xd892, 0xdfba, + 0xd893, 0x56a3, + 0xd894, 0xd05a, + 0xd895, 0x29e2, + 0xd896, 0x3012, + 0xd897, 0x1392, + 0xd898, 0xd05a, + 0xd899, 0x56a3, + 0xd89a, 0xdfba, + 0xd89b, 0x0383, + 0xd89c, 0x6f72, + 0xd89d, 0x1002, + 0xd89e, 0x2a64, + 0xd89f, 0x3014, + 0xd8a0, 0x2005, + 0xd8a1, 0x3d75, + 0xd8a2, 0xc451, + 0xd8a3, 0x29a2, + 0xd8a4, 0x3022, + 0xd8a5, 0x1002, + 0xd8a6, 0x178c, + 0xd8a7, 0x1898, + 0xd8a8, 0x19a4, + 0xd8a9, 0x1ab0, + 0xd8aa, 0x1bbc, + 0xd8ab, 0x1cc8, + 0xd8ac, 0x1dd3, + 0xd8ad, 0x1ede, + 0xd8ae, 0x1fe9, + 0xd8af, 0x20f4, + 0xd8b0, 0x21ff, + 0xd8b1, 0x0000, + 0xd8b2, 0x2741, + 0xd8b3, 0x3021, + 0xd8b4, 0x1001, + 0xd8b5, 0xc620, + 0xd8b6, 0x0000, + 0xd8b7, 0xc621, + 0xd8b8, 0x0000, + 0xd8b9, 0xc622, + 0xd8ba, 0x00e2, + 0xd8bb, 0xc623, + 0xd8bc, 0x007f, + 0xd8bd, 0xc624, + 0xd8be, 0x00ce, + 0xd8bf, 0xc625, + 0xd8c0, 0x0000, + 0xd8c1, 0xc627, + 0xd8c2, 0x0000, + 0xd8c3, 0xc628, + 0xd8c4, 0x0000, + 0xd8c5, 0xc90a, + 0xd8c6, 0x3a7c, + 0xd8c7, 0xc62c, + 0xd8c8, 0x0000, 0xd8c9, 0x0000, - 0xd8ca, 0x0000, - 0xd8cb, 0x2641, - 0xd8cc, 0x3021, - 0xd8cd, 0x1001, - 0xd8ce, 0xc502, - 0xd8cf, 0x53ac, - 0xd8d0, 0xc503, - 0xd8d1, 0x2cd3, - 0xd8d2, 0xc600, - 0xd8d3, 0x2a6e, - 0xd8d4, 0xc601, - 0xd8d5, 0x2a2c, - 0xd8d6, 0xc605, - 0xd8d7, 0x5557, - 0xd8d8, 0xc60c, - 0xd8d9, 0x5400, - 0xd8da, 0xc710, - 0xd8db, 0x0700, - 0xd8dc, 0xc711, - 0xd8dd, 0x0f06, - 0xd8de, 0xc718, - 0xd8df, 0x0700, - 0xd8e0, 0xc719, - 0xd8e1, 0x0f06, - 0xd8e2, 0xc720, - 0xd8e3, 0x4700, - 0xd8e4, 0xc721, - 0xd8e5, 0x0f06, - 0xd8e6, 0xc728, - 0xd8e7, 0x0700, - 0xd8e8, 0xc729, - 0xd8e9, 0x1207, - 0xd8ea, 0xc801, - 0xd8eb, 0x7f50, - 0xd8ec, 0xc802, - 0xd8ed, 0x7760, - 0xd8ee, 0xc803, - 0xd8ef, 0x7fce, - 0xd8f0, 0xc804, - 0xd8f1, 0x520e, - 0xd8f2, 0xc805, - 0xd8f3, 0x5c11, - 0xd8f4, 0xc806, - 0xd8f5, 0x3c51, - 0xd8f6, 0xc807, - 0xd8f7, 0x4061, - 0xd8f8, 0xc808, - 0xd8f9, 0x49c1, - 0xd8fa, 0xc809, - 0xd8fb, 0x3840, - 0xd8fc, 0xc80a, - 0xd8fd, 0x0000, - 0xd8fe, 0xc821, - 0xd8ff, 0x0002, - 0xd900, 0xc822, - 0xd901, 0x0046, - 0xd902, 0xc844, - 0xd903, 0x182f, - 0xd904, 0xc013, - 0xd905, 0xf341, - 0xd906, 0xc084, - 0xd907, 0x0030, - 0xd908, 0xc904, - 0xd909, 0x1401, - 0xd90a, 0xcb0c, - 0xd90b, 0x0004, - 0xd90c, 0xcb0e, - 0xd90d, 0xa00a, - 0xd90e, 0xcb0f, - 0xd90f, 0xc0c0, - 0xd910, 0xcb10, - 0xd911, 0xc0c0, - 0xd912, 0xcb11, - 0xd913, 0x00a0, - 0xd914, 0xcb12, - 0xd915, 0x0007, - 0xd916, 0xc241, - 0xd917, 0xa000, - 0xd918, 0xc243, - 0xd919, 0x7fe0, - 0xd91a, 0xc604, - 0xd91b, 0x000e, - 0xd91c, 0xc609, - 0xd91d, 0x00f5, - 0xd91e, 0xc611, - 0xd91f, 0x000e, - 0xd920, 0xc660, - 0xd921, 0x9600, - 0xd922, 0xc687, - 0xd923, 0x0004, - 0xd924, 0xc60a, - 0xd925, 0x04f5, - 0xd926, 0x0000, - 0xd927, 0x2641, - 0xd928, 0x3021, - 0xd929, 0x1001, - 0xd92a, 0xc620, - 0xd92b, 0x14e5, - 0xd92c, 0xc621, - 0xd92d, 0xc53d, - 0xd92e, 0xc622, - 0xd92f, 0x3cbe, - 0xd930, 0xc623, - 0xd931, 0x4452, - 0xd932, 0xc624, - 0xd933, 0xc5c5, - 0xd934, 0xc625, - 0xd935, 0xe01e, - 0xd936, 0xc627, - 0xd937, 0x0000, - 0xd938, 0xc628, - 0xd939, 0x0000, - 0xd93a, 0xc62c, - 0xd93b, 0x0000, + 0xd8ca, 0x2741, + 0xd8cb, 0x3021, + 0xd8cc, 0x1001, + 0xd8cd, 0xc502, + 0xd8ce, 0x53ac, + 0xd8cf, 0xc503, + 0xd8d0, 0x2cd3, + 0xd8d1, 0xc600, + 0xd8d2, 0x2a6e, + 0xd8d3, 0xc601, + 0xd8d4, 0x2a2c, + 0xd8d5, 0xc605, + 0xd8d6, 0x5557, + 0xd8d7, 0xc60c, + 0xd8d8, 0x5400, + 0xd8d9, 0xc710, + 0xd8da, 0x0700, + 0xd8db, 0xc711, + 0xd8dc, 0x0f06, + 0xd8dd, 0xc718, + 0xd8de, 0x700, + 0xd8df, 0xc719, + 0xd8e0, 0x0f06, + 0xd8e1, 0xc720, + 0xd8e2, 0x4700, + 0xd8e3, 0xc721, + 0xd8e4, 0x0f06, + 0xd8e5, 0xc728, + 0xd8e6, 0x0700, + 0xd8e7, 0xc729, + 0xd8e8, 0x1207, + 0xd8e9, 0xc801, + 0xd8ea, 0x7f50, + 0xd8eb, 0xc802, + 0xd8ec, 0x7760, + 0xd8ed, 0xc803, + 0xd8ee, 0x7fce, + 0xd8ef, 0xc804, + 0xd8f0, 0x520e, + 0xd8f1, 0xc805, + 0xd8f2, 0x5c11, + 0xd8f3, 0xc806, + 0xd8f4, 0x3c51, + 0xd8f5, 0xc807, + 0xd8f6, 0x4061, + 0xd8f7, 0xc808, + 0xd8f8, 0x49c1, + 0xd8f9, 0xc809, + 0xd8fa, 0x3840, + 0xd8fb, 0xc80a, + 0xd8fc, 0x0000, + 0xd8fd, 0xc821, + 0xd8fe, 0x0002, + 0xd8ff, 0xc822, + 0xd900, 0x0046, + 0xd901, 0xc844, + 0xd902, 0x182f, + 0xd903, 0xc849, + 0xd904, 0x0400, + 0xd905, 0xc84a, + 0xd906, 0x0002, + 0xd907, 0xc013, + 0xd908, 0xf341, + 0xd909, 0xc084, + 0xd90a, 0x0030, + 0xd90b, 0xc904, + 0xd90c, 0x1401, + 0xd90d, 0xcb0c, + 0xd90e, 0x0004, + 0xd90f, 0xcb0e, + 0xd910, 0xa00a, + 0xd911, 0xcb0f, + 0xd912, 0xc0c0, + 0xd913, 0xcb10, + 0xd914, 0xc0c0, + 0xd915, 0xcb11, + 0xd916, 0x00a0, + 0xd917, 0xcb12, + 0xd918, 0x0007, + 0xd919, 0xc241, + 0xd91a, 0xa000, + 0xd91b, 0xc243, + 0xd91c, 0x7fe0, + 0xd91d, 0xc604, + 0xd91e, 0x000e, + 0xd91f, 0xc609, + 0xd920, 0x00f5, + 0xd921, 0xc611, + 0xd922, 0x000e, + 0xd923, 0xc660, + 0xd924, 0x9600, + 0xd925, 0xc687, + 0xd926, 0x0004, + 0xd927, 0xc60a, + 0xd928, 0x04f5, + 0xd929, 0x0000, + 0xd92a, 0x2741, + 0xd92b, 0x3021, + 0xd92c, 0x1001, + 0xd92d, 0xc620, + 0xd92e, 0x14e5, + 0xd92f, 0xc621, + 0xd930, 0xc53d, + 0xd931, 0xc622, + 0xd932, 0x3cbe, + 0xd933, 0xc623, + 0xd934, 0x4452, + 0xd935, 0xc624, + 0xd936, 0xc5c5, + 0xd937, 0xc625, + 0xd938, 0xe01e, + 0xd939, 0xc627, + 0xd93a, 0x0000, + 0xd93b, 0xc628, 0xd93c, 0x0000, - 0xd93d, 0x2b84, - 0xd93e, 0x3c74, - 0xd93f, 0x6435, - 0xd940, 0xdff4, - 0xd941, 0x6435, - 0xd942, 0x2806, - 0xd943, 0x3006, - 0xd944, 0x8565, - 0xd945, 0x2b24, - 0xd946, 0x3c24, - 0xd947, 0x6436, - 0xd948, 0x1002, - 0xd949, 0x2b24, - 0xd94a, 0x3c24, - 0xd94b, 0x6436, - 0xd94c, 0x4045, - 0xd94d, 0x8656, - 0xd94e, 0x5663, - 0xd94f, 0x0302, - 0xd950, 0x401e, - 0xd951, 0x1002, - 0xd952, 0x2807, - 0xd953, 0x31a7, - 0xd954, 0x20c4, - 0xd955, 0x3c24, - 0xd956, 0x6724, - 0xd957, 0x1002, - 0xd958, 0x2807, - 0xd959, 0x3187, - 0xd95a, 0x20c4, - 0xd95b, 0x3c24, - 0xd95c, 0x6724, - 0xd95d, 0x1002, - 0xd95e, 0x24f4, - 0xd95f, 0x3c64, - 0xd960, 0x6436, - 0xd961, 0xdff4, - 0xd962, 0x6436, - 0xd963, 0x1002, - 0xd964, 0x2006, - 0xd965, 0x3d76, - 0xd966, 0xc161, - 0xd967, 0x6134, - 0xd968, 0x6135, - 0xd969, 0x5443, - 0xd96a, 0x0303, - 0xd96b, 0x6524, - 0xd96c, 0x00fb, + 0xd93d, 0xc62c, + 0xd93e, 0x0000, + 0xd93f, 0xc90a, + 0xd940, 0x3a7c, + 0xd941, 0x0000, + 0xd942, 0x2b84, + 0xd943, 0x3c74, + 0xd944, 0x6435, + 0xd945, 0xdff4, + 0xd946, 0x6435, + 0xd947, 0x2806, + 0xd948, 0x3006, + 0xd949, 0x8565, + 0xd94a, 0x2b24, + 0xd94b, 0x3c24, + 0xd94c, 0x6436, + 0xd94d, 0x1002, + 0xd94e, 0x2b24, + 0xd94f, 0x3c24, + 0xd950, 0x6436, + 0xd951, 0x4045, + 0xd952, 0x8656, + 0xd953, 0x5663, + 0xd954, 0x0302, + 0xd955, 0x401e, + 0xd956, 0x1002, + 0xd957, 0x2807, + 0xd958, 0x31a7, + 0xd959, 0x20c4, + 0xd95a, 0x3c24, + 0xd95b, 0x6724, + 0xd95c, 0x2ff7, + 0xd95d, 0x30f7, + 0xd95e, 0x20c4, + 0xd95f, 0x3c04, + 0xd960, 0x6724, + 0xd961, 0x1002, + 0xd962, 0x2807, *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***