From owner-p4-projects@FreeBSD.ORG Tue Dec 20 19:09:07 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 391A416A422; Tue, 20 Dec 2005 19:09:07 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EE22116A41F for ; Tue, 20 Dec 2005 19:09:06 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id DB56F43D5A for ; Tue, 20 Dec 2005 19:09:05 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id jBKJ95k5021857 for ; Tue, 20 Dec 2005 19:09:05 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id jBKJ94lQ021854 for perforce@freebsd.org; Tue, 20 Dec 2005 19:09:04 GMT (envelope-from imp@freebsd.org) Date: Tue, 20 Dec 2005 19:09:04 GMT Message-Id: <200512201909.jBKJ94lQ021854@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 88463 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Dec 2005 19:09:08 -0000 http://perforce.freebsd.org/chv.cgi?CH=88463 Change 88463 by imp@imp_Speedy on 2005/12/20 19:08:20 IFC @88461 # I had to hand merge the lcore.s changes that cognet and I made # to this branch, I don't know if they were merged correctly. # I can boot the compressed kernel now. Woo Hoo! Affected files ... .. //depot/projects/arm/src/sys/alpha/alpha/clock.c#4 integrate .. //depot/projects/arm/src/sys/alpha/alpha/elf_machdep.c#2 integrate .. //depot/projects/arm/src/sys/alpha/linux/linux_sysvec.c#3 integrate .. //depot/projects/arm/src/sys/amd64/amd64/apic_vector.S#5 integrate .. //depot/projects/arm/src/sys/amd64/amd64/busdma_machdep.c#5 integrate .. //depot/projects/arm/src/sys/amd64/amd64/elf_machdep.c#3 integrate .. //depot/projects/arm/src/sys/amd64/amd64/local_apic.c#6 integrate .. //depot/projects/arm/src/sys/amd64/isa/clock.c#5 integrate .. //depot/projects/arm/src/sys/amd64/linux32/linux32_sysvec.c#3 integrate .. //depot/projects/arm/src/sys/arm/arm/elf_trampoline.c#4 integrate .. //depot/projects/arm/src/sys/arm/arm/locore.S#15 integrate .. //depot/projects/arm/src/sys/arm/conf/KB920X#9 edit .. //depot/projects/arm/src/sys/boot/common/bootstrap.h#2 integrate .. //depot/projects/arm/src/sys/boot/common/load_elf.c#2 integrate .. //depot/projects/arm/src/sys/boot/common/load_elf_obj.c#2 integrate .. //depot/projects/arm/src/sys/boot/common/reloc_elf.c#2 integrate .. //depot/projects/arm/src/sys/boot/i386/libi386/Makefile#3 integrate .. //depot/projects/arm/src/sys/boot/i386/libi386/biosdisk.c#2 integrate .. //depot/projects/arm/src/sys/boot/i386/libi386/biospnp.c#2 integrate .. //depot/projects/arm/src/sys/boot/i386/libi386/biossmap.c#2 integrate .. //depot/projects/arm/src/sys/boot/i386/libi386/i386_copy.c#2 integrate .. //depot/projects/arm/src/sys/boot/i386/loader/main.c#3 integrate .. //depot/projects/arm/src/sys/boot/pc98/libpc98/Makefile#3 integrate .. //depot/projects/arm/src/sys/cam/scsi/scsi_da.c#4 integrate .. //depot/projects/arm/src/sys/compat/linux/linux_ioctl.c#3 integrate .. //depot/projects/arm/src/sys/compat/linux/linux_mib.c#2 integrate .. //depot/projects/arm/src/sys/compat/linux/linux_mib.h#2 integrate .. //depot/projects/arm/src/sys/compat/ndis/subr_ndis.c#5 integrate .. //depot/projects/arm/src/sys/compat/ndis/subr_ntoskrnl.c#7 integrate .. //depot/projects/arm/src/sys/conf/Makefile.arm#7 integrate .. //depot/projects/arm/src/sys/contrib/pf/net/pf.c#4 integrate .. //depot/projects/arm/src/sys/contrib/pf/net/pfvar.h#3 integrate .. //depot/projects/arm/src/sys/dev/amr/amr.c#6 integrate .. //depot/projects/arm/src/sys/dev/amr/amr_cam.c#3 integrate .. //depot/projects/arm/src/sys/dev/amr/amr_disk.c#3 integrate .. //depot/projects/arm/src/sys/dev/amr/amr_pci.c#4 integrate .. //depot/projects/arm/src/sys/dev/amr/amrio.h#2 integrate .. //depot/projects/arm/src/sys/dev/amr/amrreg.h#2 integrate .. //depot/projects/arm/src/sys/dev/amr/amrvar.h#3 integrate .. //depot/projects/arm/src/sys/dev/ata/ata-chipset.c#5 integrate .. //depot/projects/arm/src/sys/dev/ata/ata-pci.h#4 integrate .. //depot/projects/arm/src/sys/dev/ata/ata-raid.c#5 integrate .. //depot/projects/arm/src/sys/dev/ata/ata-raid.h#5 integrate .. //depot/projects/arm/src/sys/dev/bge/if_bge.c#5 integrate .. //depot/projects/arm/src/sys/dev/bge/if_bgereg.h#5 integrate .. //depot/projects/arm/src/sys/dev/ciss/ciss.c#5 integrate .. //depot/projects/arm/src/sys/dev/cp/cpddk.c#2 integrate .. //depot/projects/arm/src/sys/dev/em/if_em.c#8 integrate .. //depot/projects/arm/src/sys/dev/if_ndis/if_ndis.c#5 integrate .. //depot/projects/arm/src/sys/dev/isp/isp_pci.c#4 integrate .. //depot/projects/arm/src/sys/dev/ixgb/if_ixgb.c#4 integrate .. //depot/projects/arm/src/sys/dev/nge/if_nge.c#4 integrate .. //depot/projects/arm/src/sys/dev/re/if_re.c#6 integrate .. //depot/projects/arm/src/sys/dev/smbus/smb.c#2 integrate .. //depot/projects/arm/src/sys/dev/smbus/smbus.c#2 integrate .. //depot/projects/arm/src/sys/dev/sound/usb/uaudio.c#3 integrate .. //depot/projects/arm/src/sys/dev/ti/if_ti.c#2 integrate .. //depot/projects/arm/src/sys/dev/ti/if_tireg.h#2 integrate .. //depot/projects/arm/src/sys/dev/txp/if_txp.c#4 integrate .. //depot/projects/arm/src/sys/dev/usb/ugen.c#2 integrate .. //depot/projects/arm/src/sys/dev/usb/umass.c#4 integrate .. //depot/projects/arm/src/sys/dev/usb/usb_quirks.c#3 integrate .. //depot/projects/arm/src/sys/dev/usb/usbdevs#5 integrate .. //depot/projects/arm/src/sys/dev/vge/if_vge.c#4 integrate .. //depot/projects/arm/src/sys/fs/nullfs/null_vfsops.c#3 integrate .. //depot/projects/arm/src/sys/fs/nwfs/nwfs_vfsops.c#3 integrate .. //depot/projects/arm/src/sys/fs/smbfs/smbfs_vfsops.c#4 integrate .. //depot/projects/arm/src/sys/geom/nop/g_nop.c#3 integrate .. //depot/projects/arm/src/sys/gnu/fs/xfs/FreeBSD/support/kdb.c#2 integrate .. //depot/projects/arm/src/sys/gnu/fs/xfs/FreeBSD/xfs_freebsd.h#2 integrate .. //depot/projects/arm/src/sys/gnu/fs/xfs/FreeBSD/xfs_mountops.c#2 integrate .. //depot/projects/arm/src/sys/i386/i386/apic_vector.s#5 integrate .. //depot/projects/arm/src/sys/i386/i386/local_apic.c#5 integrate .. //depot/projects/arm/src/sys/i386/isa/clock.c#4 integrate .. //depot/projects/arm/src/sys/i386/linux/linux_sysvec.c#3 integrate .. //depot/projects/arm/src/sys/ia64/ia64/elf_machdep.c#3 integrate .. //depot/projects/arm/src/sys/kern/imgact_elf.c#3 integrate .. //depot/projects/arm/src/sys/kern/kern_clock.c#3 integrate .. //depot/projects/arm/src/sys/kern/kern_mutex.c#3 integrate .. //depot/projects/arm/src/sys/kern/kern_switch.c#3 integrate .. //depot/projects/arm/src/sys/kern/kern_sx.c#2 integrate .. //depot/projects/arm/src/sys/kern/link_elf.c#3 integrate .. //depot/projects/arm/src/sys/kern/link_elf_obj.c#3 integrate .. //depot/projects/arm/src/sys/kern/sched_ule.c#4 integrate .. //depot/projects/arm/src/sys/kern/subr_prof.c#3 integrate .. //depot/projects/arm/src/sys/kern/sys_pipe.c#3 integrate .. //depot/projects/arm/src/sys/kern/uipc_mbuf.c#8 integrate .. //depot/projects/arm/src/sys/kern/uipc_mqueue.c#3 integrate .. //depot/projects/arm/src/sys/kern/uipc_usrreq.c#4 integrate .. //depot/projects/arm/src/sys/kern/vfs_default.c#5 integrate .. //depot/projects/arm/src/sys/kern/vfs_mount.c#7 integrate .. //depot/projects/arm/src/sys/kern/vfs_syscalls.c#4 integrate .. //depot/projects/arm/src/sys/kern/vfs_vnops.c#5 integrate .. //depot/projects/arm/src/sys/kern/vnode_if.src#4 integrate .. //depot/projects/arm/src/sys/net/bridgestp.c#2 integrate .. //depot/projects/arm/src/sys/net/if_bridge.c#3 integrate .. //depot/projects/arm/src/sys/net/if_bridgevar.h#2 integrate .. //depot/projects/arm/src/sys/net/if_ethersubr.c#6 integrate .. //depot/projects/arm/src/sys/net/if_vlan_var.h#4 integrate .. //depot/projects/arm/src/sys/net80211/ieee80211.c#4 integrate .. //depot/projects/arm/src/sys/net80211/ieee80211_input.c#5 integrate .. //depot/projects/arm/src/sys/net80211/ieee80211_ioctl.c#5 integrate .. //depot/projects/arm/src/sys/net80211/ieee80211_ioctl.h#4 integrate .. //depot/projects/arm/src/sys/net80211/ieee80211_node.c#5 integrate .. //depot/projects/arm/src/sys/net80211/ieee80211_proto.c#4 integrate .. //depot/projects/arm/src/sys/net80211/ieee80211_var.h#4 integrate .. //depot/projects/arm/src/sys/netinet/if_ether.c#5 integrate .. //depot/projects/arm/src/sys/netinet/in.h#4 integrate .. //depot/projects/arm/src/sys/netinet/ip_fw.h#4 integrate .. //depot/projects/arm/src/sys/netinet/ip_fw2.c#6 integrate .. //depot/projects/arm/src/sys/netinet/ip_mroute.c#5 integrate .. //depot/projects/arm/src/sys/netinet/raw_ip.c#3 integrate .. //depot/projects/arm/src/sys/netinet/tcp_usrreq.c#5 integrate .. //depot/projects/arm/src/sys/netinet/udp_usrreq.c#5 integrate .. //depot/projects/arm/src/sys/nfsclient/nfs_socket.c#5 integrate .. //depot/projects/arm/src/sys/pc98/cbus/sio.c#2 integrate .. //depot/projects/arm/src/sys/pci/amdpm.c#4 integrate .. //depot/projects/arm/src/sys/powerpc/include/frame.h#2 integrate .. //depot/projects/arm/src/sys/powerpc/powerpc/genassym.c#2 integrate .. //depot/projects/arm/src/sys/sparc64/sparc64/elf_machdep.c#2 integrate .. //depot/projects/arm/src/sys/sys/elf32.h#2 integrate .. //depot/projects/arm/src/sys/sys/elf64.h#2 integrate .. //depot/projects/arm/src/sys/sys/elf_common.h#2 integrate .. //depot/projects/arm/src/sys/sys/elf_generic.h#2 integrate .. //depot/projects/arm/src/sys/sys/imgact_elf.h#2 integrate .. //depot/projects/arm/src/sys/sys/ktr.h#5 integrate .. //depot/projects/arm/src/sys/sys/linker.h#2 integrate .. //depot/projects/arm/src/sys/sys/lock.h#4 integrate .. //depot/projects/arm/src/sys/sys/mount.h#5 integrate .. //depot/projects/arm/src/sys/sys/param.h#6 integrate .. //depot/projects/arm/src/sys/sys/resourcevar.h#3 integrate .. //depot/projects/arm/src/sys/sys/vnode.h#6 integrate .. //depot/projects/arm/src/sys/tools/vnode_if.awk#3 integrate .. //depot/projects/arm/src/sys/ufs/ufs/quota.h#2 integrate .. //depot/projects/arm/src/sys/ufs/ufs/ufs_quota.c#3 integrate .. //depot/projects/arm/src/sys/ufs/ufs/ufs_vfsops.c#4 integrate .. //depot/projects/arm/src/sys/vm/vm_extern.h#3 integrate .. //depot/projects/arm/src/sys/vm/vm_fault.c#4 integrate .. //depot/projects/arm/src/sys/vm/vm_glue.c#3 integrate .. //depot/projects/arm/src/sys/vm/vm_page.c#4 integrate Differences ... ==== //depot/projects/arm/src/sys/alpha/alpha/clock.c#4 (text+ko) ==== @@ -38,7 +38,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/alpha/alpha/clock.c,v 1.40 2005/11/20 01:31:29 marcel Exp $"); +__FBSDID("$FreeBSD: src/sys/alpha/alpha/clock.c,v 1.41 2005/12/14 21:42:12 jhb Exp $"); #include "opt_clock.h" @@ -158,8 +158,8 @@ static u_int32_t last_time; static void handleclock(void* arg); -static void -calibrate_clocks(u_int32_t firmware_freq, u_int32_t *pcc, u_int32_t *timer); +static void calibrate_clocks(u_int32_t firmware_freq, u_int32_t *pcc, + u_int32_t *timer); static void set_timer_freq(u_int freq, int intr_freq); void ==== //depot/projects/arm/src/sys/alpha/alpha/elf_machdep.c#2 (text+ko) ==== @@ -24,7 +24,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/alpha/alpha/elf_machdep.c,v 1.19 2004/08/11 02:35:04 marcel Exp $"); +__FBSDID("$FreeBSD: src/sys/alpha/alpha/elf_machdep.c,v 1.20 2005/12/18 04:52:34 marcel Exp $"); #include #include @@ -121,7 +121,7 @@ Elf_Addr *where; Elf_Addr addr; Elf_Addr addend; - Elf_Word rtype, symidx; + Elf_Size rtype, symidx; const Elf_Rel *rel; const Elf_Rela *rela; ==== //depot/projects/arm/src/sys/alpha/linux/linux_sysvec.c#3 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/alpha/linux/linux_sysvec.c,v 1.96 2005/10/14 12:43:43 davidxu Exp $"); +__FBSDID("$FreeBSD: src/sys/alpha/linux/linux_sysvec.c,v 1.97 2005/12/15 16:30:41 jhb Exp $"); /* XXX we use functions that might not exist. */ #include "opt_compat.h" @@ -265,7 +265,6 @@ linux_ioctl_unregister_handler(*lihp); if (bootverbose) printf("Linux ELF exec handler removed\n"); - linux_mib_destroy(); } else printf("Could not deinstall ELF interpreter entry\n"); break; ==== //depot/projects/arm/src/sys/amd64/amd64/apic_vector.S#5 (text+ko) ==== @@ -28,7 +28,7 @@ * SUCH DAMAGE. * * from: vector.s, 386BSD 0.1 unknown origin - * $FreeBSD: src/sys/amd64/amd64/apic_vector.S,v 1.106 2005/12/08 18:33:29 jhb Exp $ + * $FreeBSD: src/sys/amd64/amd64/apic_vector.S,v 1.107 2005/12/14 21:47:01 jhb Exp $ */ /* @@ -171,8 +171,7 @@ iretq /* - * Forward hardclock to another CPU. Pushes a clockframe and calls - * forwarded_hardclock(). + * Handler for IPIs sent via the per-cpu IPI bitmap. */ .text SUPERALIGN_TEXT ==== //depot/projects/arm/src/sys/amd64/amd64/busdma_machdep.c#5 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/busdma_machdep.c,v 1.71 2005/11/24 15:28:32 le Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/busdma_machdep.c,v 1.72 2005/12/16 05:57:18 scottl Exp $"); #include #include @@ -49,7 +49,7 @@ #include #include -#define MAX_BPAGES 512 +#define MAX_BPAGES 8192 struct bounce_zone; ==== //depot/projects/arm/src/sys/amd64/amd64/elf_machdep.c#3 (text+ko) ==== @@ -24,7 +24,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/elf_machdep.c,v 1.23 2005/09/27 18:18:23 peter Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/elf_machdep.c,v 1.24 2005/12/18 04:52:35 marcel Exp $"); #include #include @@ -119,7 +119,7 @@ Elf32_Addr *where32, val32; Elf_Addr addr; Elf_Addr addend; - Elf_Word rtype, symidx; + Elf_Size rtype, symidx; const Elf_Rel *rel; const Elf_Rela *rela; ==== //depot/projects/arm/src/sys/amd64/amd64/local_apic.c#6 (text+ko) ==== @@ -32,7 +32,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/local_apic.c,v 1.20 2005/12/08 18:33:29 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/local_apic.c,v 1.22 2005/12/13 18:29:09 jhb Exp $"); #include "opt_hwpmc_hooks.h" ==== //depot/projects/arm/src/sys/amd64/isa/clock.c#5 (text+ko) ==== @@ -33,7 +33,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/isa/clock.c,v 1.222 2005/07/13 15:43:19 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/isa/clock.c,v 1.223 2005/12/12 22:27:07 peter Exp $"); /* * Routines to handle clock hardware. @@ -61,6 +61,7 @@ #include #include #include +#include #include #include #include @@ -269,7 +270,21 @@ int getit_calls = 1; int n1; static int state = 0; +#endif + if (tsc_freq != 0 && !tsc_is_broken) { + uint64_t start, end, now; + + sched_pin(); + start = rdtsc(); + end = start + (tsc_freq * n) / 1000000; + do { + now = rdtsc(); + } while (now < end || (now > start && end < start)); + sched_unpin(); + return; + } +#ifdef DELAYDEBUG if (state == 0) { state = 1; for (n1 = 1; n1 <= 10000000; n1 *= 10) ==== //depot/projects/arm/src/sys/amd64/linux32/linux32_sysvec.c#3 (text+ko) ==== @@ -31,7 +31,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_sysvec.c,v 1.12 2005/11/02 21:18:07 ps Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_sysvec.c,v 1.13 2005/12/15 16:30:41 jhb Exp $"); /* XXX we use functions that might not exist. */ #include "opt_compat.h" @@ -1083,7 +1083,6 @@ linux_ioctl_unregister_handler(*lihp); if (bootverbose) printf("Linux ELF exec handler removed\n"); - linux_mib_destroy(); } else printf("Could not deinstall ELF interpreter entry\n"); break; ==== //depot/projects/arm/src/sys/arm/arm/elf_trampoline.c#4 (text+ko) ==== @@ -23,7 +23,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/arm/arm/elf_trampoline.c,v 1.3 2005/12/05 12:55:46 cognet Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/arm/elf_trampoline.c,v 1.4 2005/12/20 01:28:17 cognet Exp $"); #include #include #include @@ -47,9 +47,10 @@ { const char *s = src; char *d = dst; - + while (len) { - if (len >= 4 && !((vm_offset_t)d & 3) && !((vm_offset_t)s & 3)) { + if (0 && len >= 4 && !((vm_offset_t)d & 3) && + !((vm_offset_t)s & 3)) { *(uint32_t *)d = *(uint32_t *)s; s += 4; d += 4; @@ -83,6 +84,29 @@ void _start(void) { + int physaddr = KERNPHYSADDR; + int tmp1; + + __asm __volatile("adr %0, 2f\n" + "bic %0, %0, #0xff000000\n" + "bic sp, sp, #0xff000000\n" + "and %1, %1, #0xff000000\n" + "orr %0, %0, %1\n" + "orr sp, sp, %1\n" + "mrc p15, 0, %1, c1, c0, 0\n" + "bic %1, %1, #1\n" /* Disable MMU */ + "orr %1, %1, #(4 | 8)\n" /* Add DC enable, + WBUF enable */ + "orr %1, %1, #0x1000\n" /* Add IC enable */ + "orr %1, %1, #(0x800)\n" /* BPRD enable */ + + "mcr p15, 0, %1, c1, c0, 0\n" + "nop\n" + "nop\n" + "nop\n" + "mov pc, %0\n" + "2: nop\n" + : "=r" (tmp1), "+r" (physaddr)); __start(); } @@ -156,6 +180,7 @@ char slide[GZ_WSIZE]; orig_input = kernel; + memcnt = memtot = 0; i_input = (char *)kernel + GZ_HEAD; if (((char *)kernel)[3] & 0x18) { while (*i_input) @@ -173,7 +198,6 @@ #endif - void * load_kernel(unsigned int kstart, unsigned int curaddr,unsigned int func_end, int d) @@ -194,6 +218,7 @@ entry_point = (void*)eh->e_entry; memcpy(phdr, (void *)(kstart + eh->e_phoff ), eh->e_phnum * sizeof(phdr[0])); + /* Determine lastaddr. */ for (i = 0; i < eh->e_phnum; i++) { if (lastaddr < (phdr[i].p_vaddr - KERNVIRTADDR + curaddr @@ -204,9 +229,12 @@ /* Save the symbol tables, as there're about to be scratched. */ lastaddr = roundup(lastaddr, sizeof(long)); + shdr = (Elf_Shdr *)lastaddr; + lastaddr += sizeof(*shdr) * eh->e_shnum; + memcpy(shdr, (void *)(kstart + eh->e_shoff), + sizeof(*shdr) * eh->e_shnum); if (eh->e_shnum * eh->e_shentsize != 0 && eh->e_shoff != 0) { - shdr = (Elf_Shdr *)(kstart + eh->e_shoff); for (i = 0; i < eh->e_shnum; i++) { if (shdr[i].sh_type == SHT_SYMTAB) { for (j = 0; j < eh->e_phnum; j++) { @@ -295,6 +323,10 @@ *((Elf_Addr *)curaddr + 2) = lastaddr - curaddr + KERNVIRTADDR; } else *(Elf_Addr *)curaddr = 0; + /* Invalidate the instruction cache. */ + __asm __volatile("mcr p15, 0, %0, c7, c5, 0\n" + "mcr p15, 0, %0, c7, c10, 4\n" + : : "r" (curaddr)); /* Jump to the entry point. */ ((void(*)(void))(entry_point - KERNVIRTADDR + curaddr))(); __asm __volatile(".globl func_end\n" ==== //depot/projects/arm/src/sys/arm/arm/locore.S#15 (text+ko) ==== @@ -37,7 +37,7 @@ #include #include #include -__FBSDID("$FreeBSD: src/sys/arm/arm/locore.S,v 1.11 2005/10/03 14:10:55 cognet Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/arm/locore.S,v 1.12 2005/12/20 01:29:17 cognet Exp $"); /* What size should this really be ? It is only used by init_arm() */ #define INIT_ARM_STACK_SIZE 2048 @@ -140,12 +140,13 @@ Lstart_off: .word start_inram-_C_LABEL(_start) start_inram: adr r7, Lunmapped - bic r7, r7, #0xff000000 - orr r7, r7, #PHYSADDR /* Disable MMU for a while */ mrc p15, 0, r2, c1, c0, 0 - bic r2, r2, #CPU_CONTROL_MMU_ENABLE + bic r2, r2, #(CPU_CONTROL_MMU_ENABLE | CPU_CONTROL_DC_ENABLE |\ + CPU_CONTROL_WBUF_ENABLE) + bic r2, r2, #(CPU_CONTROL_IC_ENABLE) + bic r2, r2, #(CPU_CONTROL_BPRD_ENABLE) mcr p15, 0, r2, c1, c0, 0 nop @@ -159,6 +160,8 @@ /* build page table from scratch */ ldr r0, Lstartup_pagetable adr r4, mmu_init_table + bic r4, r4, #0xff000000 + orr r4, r4, #PHYSADDR b 3f 2: @@ -181,25 +184,27 @@ /* Set the Domain Access register. Very important! */ mov r0, #((DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL*2)) | DOMAIN_CLIENT) mcr p15, 0, r0, c3, c0, 0 - /* Enable MMU */ mrc p15, 0, r0, c1, c0, 0 orr r0, r0, #CPU_CONTROL_MMU_ENABLE mcr p15, 0, r0, c1, c0, 0 + nop + nop + nop CPWAIT(r0) - bl mmu_done +#endif mmu_done: -#endif + nop adr r1, .Lstart ldmia r1, {r1, r2, sp} /* Set initial stack and */ sub r2, r2, r1 /* get zero init data */ mov r3, #0 - .L1: str r3, [r1], #0x0004 /* get zero init data */ subs r2, r2, #4 bgt .L1 + ldr pc, .Lvirt_done mov r0, pc #if KERNVIRTADDR > KERNPHYSADDR @@ -218,7 +223,6 @@ sub pc, pc, r5 #endif virt_done: - nop LED1ON mov fp, #0 /* trace back starts here */ bl _C_LABEL(initarm) /* Off we go */ @@ -260,6 +264,8 @@ .word _end .word svcstk + INIT_ARM_STACK_SIZE +.Lvirt_done: + .word virt_done .Lmainreturned: .asciz "main() returned" .align 0 ==== //depot/projects/arm/src/sys/arm/conf/KB920X#9 (text+ko) ==== @@ -42,7 +42,7 @@ #options UFS_ACL #Support for access control lists #options UFS_DIRHASH #Improve performance on big directories options MD_ROOT #MD is a potential root device -options MD_ROOT_SIZE=4096 # 4MB ram disk +options MD_ROOT_SIZE=1024 # 3MB ram disk options ROOTDEVNAME=\"ufs:md0\" #options NFSCLIENT #Network Filesystem Client #options NFSSERVER #Network Filesystem Server @@ -67,7 +67,6 @@ device loop device ether device nexus -#device saarm device uart # Debugging for use in -current ==== //depot/projects/arm/src/sys/boot/common/bootstrap.h#2 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/boot/common/bootstrap.h,v 1.41 2004/08/29 00:48:41 iedowse Exp $ + * $FreeBSD: src/sys/boot/common/bootstrap.h,v 1.42 2005/12/18 04:52:35 marcel Exp $ */ #include @@ -240,7 +240,7 @@ #define ELF_RELOC_RELA 2 struct elf_file; -typedef Elf_Addr (symaddr_fn)(struct elf_file *ef, Elf_Word symidx); +typedef Elf_Addr (symaddr_fn)(struct elf_file *ef, Elf_Size symidx); int __elfN(loadfile)(char *filename, u_int64_t dest, struct preloaded_file **result); int __elfN(obj_loadfile)(char *filename, u_int64_t dest, ==== //depot/projects/arm/src/sys/boot/common/load_elf.c#2 (text+ko) ==== @@ -26,7 +26,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/boot/common/load_elf.c,v 1.32 2004/08/28 23:03:05 iedowse Exp $"); +__FBSDID("$FreeBSD: src/sys/boot/common/load_elf.c,v 1.33 2005/12/18 04:52:35 marcel Exp $"); #include #include @@ -744,7 +744,7 @@ } static Elf_Addr -__elfN(symaddr)(struct elf_file *ef, Elf_Word symidx) +__elfN(symaddr)(struct elf_file *ef, Elf_Size symidx) { /* Symbol lookup by index not required here. */ ==== //depot/projects/arm/src/sys/boot/common/load_elf_obj.c#2 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/boot/common/load_elf_obj.c,v 1.1 2004/08/29 00:48:41 iedowse Exp $"); +__FBSDID("$FreeBSD: src/sys/boot/common/load_elf_obj.c,v 1.2 2005/12/18 04:52:35 marcel Exp $"); #include #include @@ -70,7 +70,7 @@ Elf_Addr p, void *val, size_t len); static int __elfN(obj_parse_modmetadata)(struct preloaded_file *mp, elf_file_t ef); -static Elf_Addr __elfN(obj_symaddr)(struct elf_file *ef, Elf_Word symidx); +static Elf_Addr __elfN(obj_symaddr)(struct elf_file *ef, Elf_Size symidx); const char *__elfN(obj_kerneltype) = "elf kernel"; const char *__elfN(obj_moduletype) = "elf obj module"; @@ -495,7 +495,7 @@ /* Look up the address of a specified symbol. */ static Elf_Addr -__elfN(obj_symaddr)(struct elf_file *ef, Elf_Word symidx) +__elfN(obj_symaddr)(struct elf_file *ef, Elf_Size symidx) { Elf_Sym sym; Elf_Addr base; ==== //depot/projects/arm/src/sys/boot/common/reloc_elf.c#2 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/boot/common/reloc_elf.c,v 1.1 2004/08/28 23:03:05 iedowse Exp $"); +__FBSDID("$FreeBSD: src/sys/boot/common/reloc_elf.c,v 1.2 2005/12/18 04:52:35 marcel Exp $"); #include #include @@ -54,7 +54,7 @@ int reltype, Elf_Addr relbase, Elf_Addr dataaddr, void *data, size_t len) { #ifdef __sparc__ - Elf_Word w; + Elf_Size w; const Elf_Rela *a; switch (reltype) { @@ -81,7 +81,7 @@ #elif defined(__i386__) && __ELF_WORD_SIZE == 64 Elf64_Addr *where, val; Elf_Addr addend, addr; - Elf_Word rtype, symidx; + Elf_Size rtype, symidx; const Elf_Rel *rel; const Elf_Rela *rela; @@ -138,7 +138,7 @@ return (0); #elif defined(__i386__) && __ELF_WORD_SIZE == 32 Elf_Addr addend, addr, *where, val; - Elf_Word rtype, symidx; + Elf_Size rtype, symidx; const Elf_Rel *rel; const Elf_Rela *rela; ==== //depot/projects/arm/src/sys/boot/i386/libi386/Makefile#3 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/boot/i386/libi386/Makefile,v 1.38 2005/07/14 19:52:22 jkim Exp $ +# $FreeBSD: src/sys/boot/i386/libi386/Makefile,v 1.39 2005/12/19 09:00:11 sobomax Exp $ # LIB= i386 INTERNALLIB= @@ -24,6 +24,9 @@ # Include simple terminal emulation (cons25-compatible) CFLAGS+= -DTERM_EMU +# XXX: make alloca() useable +CFLAGS+= -Dalloca=__builtin_alloca + CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../btx/lib \ -I${.CURDIR}/../../../contrib/dev/acpica \ -I${.CURDIR}/../../.. -I. ==== //depot/projects/arm/src/sys/boot/i386/libi386/biosdisk.c#2 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/boot/i386/libi386/biosdisk.c,v 1.45 2004/09/21 06:46:44 wes Exp $"); +__FBSDID("$FreeBSD: src/sys/boot/i386/libi386/biosdisk.c,v 1.46 2005/12/19 09:00:11 sobomax Exp $"); /* * BIOS disk device handling. @@ -861,17 +861,18 @@ p = dest; /* Decide whether we have to bounce */ - if ((od->od_unit < 0x80) && - ((VTOP(dest) >> 16) != (VTOP(dest + blks * BIOSDISK_SECSIZE) >> 16))) { + if (VTOP(dest) >> 20 != 0 || ((od->od_unit < 0x80) && + ((VTOP(dest) >> 16) != (VTOP(dest + blks * BIOSDISK_SECSIZE) >> 16)))) { /* - * There is a 64k physical boundary somewhere in the destination buffer, so we have + * There is a 64k physical boundary somewhere in the destination buffer, or the + * destination buffer is above first 1MB of physical memory so we have * to arrange a suitable bounce buffer. Allocate a buffer twice as large as we * need to. Use the bottom half unless there is a break there, in which case we * use the top half. */ x = min(FLOPPY_BOUNCEBUF, (unsigned)blks); - bbuf = malloc(x * 2 * BIOSDISK_SECSIZE); + bbuf = alloca(x * 2 * BIOSDISK_SECSIZE); if (((u_int32_t)VTOP(bbuf) & 0xffff0000) == ((u_int32_t)VTOP(bbuf + x * BIOSDISK_SECSIZE) & 0xffff0000)) { breg = bbuf; } else { @@ -960,8 +961,6 @@ DEBUG("ax = 0x%04x cx = 0x%04x dx = 0x%04x status 0x%x", 0x200 | x, ((cyl & 0xff) << 8) | ((cyl & 0x300) >> 2) | sec, (hd << 8) | od->od_unit, (v86.eax >> 8) & 0xff); if (result) { - if (bbuf != NULL) - free(bbuf); return(-1); } if (bbuf != NULL) @@ -972,8 +971,6 @@ } /* hexdump(dest, (blks * BIOSDISK_SECSIZE)); */ - if (bbuf != NULL) - free(bbuf); return(0); } @@ -993,18 +990,18 @@ p = dest; /* Decide whether we have to bounce */ - if ((od->od_unit < 0x80) && - ((VTOP(dest) >> 16) != (VTOP(dest + blks * BIOSDISK_SECSIZE) >> 16))) { + if (VTOP(dest) >> 20 != 0 || ((od->od_unit < 0x80) && + ((VTOP(dest) >> 16) != (VTOP(dest + blks * BIOSDISK_SECSIZE) >> 16)))) { /* - * There is a 64k physical boundary somewhere in the destination buffer, so we have + * There is a 64k physical boundary somewhere in the destination buffer, or the + * destination buffer is above first 1MB of physical memory so we have * to arrange a suitable bounce buffer. Allocate a buffer twice as large as we * need to. Use the bottom half unless there is a break there, in which case we * use the top half. */ - x = min(FLOPPY_BOUNCEBUF, (unsigned)blks); - bbuf = malloc(x * 2 * BIOSDISK_SECSIZE); + bbuf = alloca(x * 2 * BIOSDISK_SECSIZE); if (((u_int32_t)VTOP(bbuf) & 0xffff0000) == ((u_int32_t)VTOP(bbuf + x * BIOSDISK_SECSIZE) & 0xffff0000)) { breg = bbuf; } else { @@ -1104,15 +1101,11 @@ DEBUG("ax = 0x%04x cx = 0x%04x dx = 0x%04x status 0x%x", 0x200 | x, ((cyl & 0xff) << 8) | ((cyl & 0x300) >> 2) | sec, (hd << 8) | od->od_unit, (v86.eax >> 8) & 0xff); if (result) { - if (bbuf != NULL) - free(bbuf); return(-1); } } /* hexdump(dest, (blks * BIOSDISK_SECSIZE)); */ - if (bbuf != NULL) - free(bbuf); return(0); } static int ==== //depot/projects/arm/src/sys/boot/i386/libi386/biospnp.c#2 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/boot/i386/libi386/biospnp.c,v 1.9 2003/08/25 23:28:31 obrien Exp $"); +__FBSDID("$FreeBSD: src/sys/boot/i386/libi386/biospnp.c,v 1.10 2005/12/19 09:00:11 sobomax Exp $"); /* * PnP BIOS enumerator. @@ -165,7 +165,7 @@ if (biospnp_init()) return; - devNodeBuffer = (struct pnp_devNode *)malloc(pnp_NodeSize); + devNodeBuffer = (struct pnp_devNode *)alloca(pnp_NodeSize); Node = 0; count = 1000; while((Node != 0xff) && (count-- > 0)) { ==== //depot/projects/arm/src/sys/boot/i386/libi386/biossmap.c#2 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/boot/i386/libi386/biossmap.c,v 1.3 2004/11/08 23:59:44 peter Exp $"); +__FBSDID("$FreeBSD: src/sys/boot/i386/libi386/biossmap.c,v 1.4 2005/12/19 09:00:11 sobomax Exp $"); /* * Obtain memory configuration information from the BIOS @@ -86,9 +86,10 @@ v86.eax = 0xe820; v86.ecx = sizeof(struct smap); v86.edx = SMAPSIG; - v86.es = VTOPSEG(&smapbase[smaplen]); - v86.edi = VTOPOFF(&smapbase[smaplen]); + v86.es = VTOPSEG(&smap); + v86.edi = VTOPOFF(&smap); v86int(); + bcopy(&smap, &smapbase[smaplen], sizeof(struct smap)); smaplen++; if ((v86.efl & 1) || (v86.eax != SMAPSIG)) break; ==== //depot/projects/arm/src/sys/boot/i386/libi386/i386_copy.c#2 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/boot/i386/libi386/i386_copy.c,v 1.10 2003/08/25 23:28:31 obrien Exp $"); +__FBSDID("$FreeBSD: src/sys/boot/i386/libi386/i386_copy.c,v 1.11 2005/12/19 09:00:11 sobomax Exp $"); /* * MD primitives supporting placement of module data @@ -37,8 +37,6 @@ #include "libi386.h" #include "btxv86.h" -#define READIN_BUF (16 * 1024) - ssize_t i386_copyin(const void *src, vm_offset_t dest, const size_t len) { @@ -67,25 +65,11 @@ ssize_t i386_readin(const int fd, vm_offset_t dest, const size_t len) { - void *buf; - size_t resid, chunk, get; - ssize_t got; - if (dest + len >= memtop) - return(0); + if (dest + len >= memtop) { + errno = EFBIG; + return(-1); + } - chunk = min(READIN_BUF, len); - buf = malloc(chunk); - if (buf == NULL) - return(0); - - for (resid = len; resid > 0; resid -= got, dest += got) { - get = min(chunk, resid); - got = read(fd, buf, get); - if (got <= 0) - break; - bcopy(buf, PTOV(dest), (size_t)got); - } - free(buf); - return(len - resid); + return (read(fd, PTOV(dest), len)); } ==== //depot/projects/arm/src/sys/boot/i386/loader/main.c#3 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/boot/i386/loader/main.c,v 1.33 2005/09/22 15:14:13 ru Exp $"); +__FBSDID("$FreeBSD: src/sys/boot/i386/loader/main.c,v 1.35 2005/12/19 18:39:01 sobomax Exp $"); /* * MD bootstrap main() and assorted miscellaneous @@ -72,6 +72,9 @@ /* XXX debugging */ extern char end[]; +static void *heap_top; +static void *heap_bottom; + int main(void) { @@ -88,7 +91,14 @@ */ bios_getmem(); - setheap((void *)end, (void *)bios_basemem); +#ifdef LOADER_BZIP2_SUPPORT + heap_top = PTOV(0x400000); + heap_bottom = PTOV(0x100000); +#else + heap_top = (void *)bios_basemem; + heap_bottom = (void *)end; +#endif + setheap(heap_bottom, heap_top); /* * XXX Chicken-and-egg problem; we want to have console output early, but some @@ -269,7 +279,8 @@ command_heap(int argc, char *argv[]) { mallocstats(); - printf("heap base at %p, top at %p\n", end, sbrk(0)); + printf("heap base at %p, top at %p, upper limit at %p\n", heap_bottom, + sbrk(0), heap_top); return(CMD_OK); } ==== //depot/projects/arm/src/sys/boot/pc98/libpc98/Makefile#3 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/boot/pc98/libpc98/Makefile,v 1.22 2005/05/08 14:17:28 nyan Exp $ +# $FreeBSD: src/sys/boot/pc98/libpc98/Makefile,v 1.23 2005/12/20 08:54:30 sobomax Exp $ # LIB= pc98 INTERNALLIB= @@ -24,6 +24,9 @@ # Include simple terminal emulation (cons25-compatible) CFLAGS+= -DTERM_EMU +# XXX: make alloca() useable +CFLAGS+= -Dalloca=__builtin_alloca + CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../btx/lib \ -I${.CURDIR}/../../i386/libi386 \ -I${.CURDIR}/../../.. -I. ==== //depot/projects/arm/src/sys/cam/scsi/scsi_da.c#4 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_da.c,v 1.181 2005/11/18 02:43:49 jdp Exp $"); +__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_da.c,v 1.183 2005/12/19 03:43:48 pjd Exp $"); #include @@ -351,8 +351,17 @@ * Kingston DataTraveler II+ USB Pen-Drive. * Reported by: Pawel Jakub Dawidek */ - {T_DIRECT, SIP_MEDIA_REMOVABLE, "Kingston" , "DataTraveler II+", "*"}, - /*quirks*/ DA_Q_NO_SYNC_CACHE + {T_DIRECT, SIP_MEDIA_REMOVABLE, "Kingston" , "DataTraveler II+", + "*"}, /*quirks*/ DA_Q_NO_SYNC_CACHE + }, + { + /* + * Motorola E398 Mobile Phone (TransFlash memory card). + * Reported by: Wojciech A. Koszek + * PR: usb/89889 + */ + {T_DIRECT, SIP_MEDIA_REMOVABLE, "Motorola" , "Motorola Phone", + "*"}, /*quirks*/ DA_Q_NO_SYNC_CACHE }, }; ==== //depot/projects/arm/src/sys/compat/linux/linux_ioctl.c#3 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/compat/linux/linux_ioctl.c,v 1.130 2005/08/28 13:11:08 delphij Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/linux/linux_ioctl.c,v 1.131 2005/12/13 15:32:52 delphij Exp $"); #include #include @@ -806,22 +806,22 @@ } >>> TRUNCATED FOR MAIL (1000 lines) <<<