From owner-p4-projects@FreeBSD.ORG Wed Aug 30 03:42:17 2006 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 4341A16A4E0; Wed, 30 Aug 2006 03:42:17 +0000 (UTC) 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 D741316A4DD for ; Wed, 30 Aug 2006 03:42:16 +0000 (UTC) (envelope-from mjacob@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 79CEF43D45 for ; Wed, 30 Aug 2006 03:42:16 +0000 (GMT) (envelope-from mjacob@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k7U3gGGM099525 for ; Wed, 30 Aug 2006 03:42:16 GMT (envelope-from mjacob@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k7U3gF4i099522 for perforce@freebsd.org; Wed, 30 Aug 2006 03:42:15 GMT (envelope-from mjacob@freebsd.org) Date: Wed, 30 Aug 2006 03:42:15 GMT Message-Id: <200608300342.k7U3gF4i099522@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to mjacob@freebsd.org using -f From: Matt Jacob To: Perforce Change Reviews Cc: Subject: PERFORCE change 105304 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: Wed, 30 Aug 2006 03:42:17 -0000 http://perforce.freebsd.org/chv.cgi?CH=105304 Change 105304 by mjacob@newisp on 2006/08/30 03:41:40 Sync with head. Affected files ... .. //depot/projects/newisp/amd64/amd64/support.S#2 integrate .. //depot/projects/newisp/amd64/linux32/linux32_dummy.c#2 integrate .. //depot/projects/newisp/amd64/linux32/linux32_machdep.c#2 integrate .. //depot/projects/newisp/amd64/linux32/linux32_proto.h#2 integrate .. //depot/projects/newisp/amd64/linux32/linux32_syscall.h#2 integrate .. //depot/projects/newisp/amd64/linux32/linux32_sysent.c#2 integrate .. //depot/projects/newisp/amd64/linux32/syscalls.master#2 integrate .. //depot/projects/newisp/arm/arm/fusu.S#2 integrate .. //depot/projects/newisp/arm/arm/pmap.c#2 integrate .. //depot/projects/newisp/arm/at91/at91.c#2 integrate .. //depot/projects/newisp/arm/at91/at91rm92reg.h#2 integrate .. //depot/projects/newisp/arm/at91/kb920x_machdep.c#2 integrate .. //depot/projects/newisp/arm/xscale/i80321/ep80219_machdep.c#2 integrate .. //depot/projects/newisp/compat/linux/linux_emul.c#2 integrate .. //depot/projects/newisp/compat/linux/linux_stats.c#2 integrate .. //depot/projects/newisp/conf/NOTES#2 integrate .. //depot/projects/newisp/crypto/sha2/sha2.c#2 integrate .. //depot/projects/newisp/dev/fdc/fdc.c#2 integrate .. //depot/projects/newisp/i386/i386/support.s#2 integrate .. //depot/projects/newisp/i386/linux/linux_dummy.c#2 integrate .. //depot/projects/newisp/i386/linux/linux_machdep.c#2 integrate .. //depot/projects/newisp/i386/linux/linux_proto.h#2 integrate .. //depot/projects/newisp/i386/linux/linux_syscall.h#2 integrate .. //depot/projects/newisp/i386/linux/linux_sysent.c#2 integrate .. //depot/projects/newisp/i386/linux/syscalls.master#2 integrate .. //depot/projects/newisp/ia64/ia64/support.S#2 integrate .. //depot/projects/newisp/kern/init_sysent.c#2 integrate .. //depot/projects/newisp/kern/kern_thread.c#2 integrate .. //depot/projects/newisp/kern/kern_umtx.c#2 integrate .. //depot/projects/newisp/kern/syscalls.c#2 integrate .. //depot/projects/newisp/kern/syscalls.master#2 integrate .. //depot/projects/newisp/kern/systrace_args.c#2 integrate .. //depot/projects/newisp/nfsclient/nfs_socket.c#2 integrate .. //depot/projects/newisp/powerpc/powerpc/copyinout.c#2 integrate .. //depot/projects/newisp/security/mac_mls/mac_mls.c#2 integrate .. //depot/projects/newisp/sparc64/sparc64/support.S#2 integrate .. //depot/projects/newisp/sys/sx.h#2 integrate .. //depot/projects/newisp/sys/syscall.h#2 integrate .. //depot/projects/newisp/sys/syscall.mk#2 integrate .. //depot/projects/newisp/sys/sysproto.h#2 integrate .. //depot/projects/newisp/sys/systm.h#2 integrate .. //depot/projects/newisp/sys/umtx.h#2 integrate .. //depot/projects/newisp/vm/vm_page.c#2 integrate .. //depot/projects/newisp/vm/vm_page.h#2 integrate Differences ... ==== //depot/projects/newisp/amd64/amd64/support.S#2 (text+ko) ==== @@ -27,7 +27,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/amd64/amd64/support.S,v 1.119 2006/08/16 22:22:28 davidxu Exp $ + * $FreeBSD: src/sys/amd64/amd64/support.S,v 1.120 2006/08/28 02:28:14 davidxu Exp $ */ #include "opt_ddb.h" @@ -314,6 +314,34 @@ ret /* + * casuword32. Compare and set user integer. Returns -1 or the current value. + * dst = %rdi, old = %rsi, new = %rdx + */ +ENTRY(casuword32) + movq PCPU(CURPCB),%rcx + movq $fusufault,PCB_ONFAULT(%rcx) + + movq $VM_MAXUSER_ADDRESS-4,%rax + cmpq %rax,%rdi /* verify address is valid */ + ja fusufault + + movl %esi,%eax /* old */ +#ifdef SMP + lock +#endif + cmpxchgl %edx,(%rdi) /* new = %edx */ + + /* + * The old value is in %eax. If the store succeeded it will be the + * value we expected (old) from before the store, otherwise it will + * be the current value. + */ + + movq PCPU(CURPCB),%rcx + movq $0,PCB_ONFAULT(%rcx) + ret + +/* * casuptr. Compare and set user pointer. Returns -1 or the current value. * dst = %rdi, old = %rsi, new = %rdx */ ==== //depot/projects/newisp/amd64/linux32/linux32_dummy.c#2 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_dummy.c,v 1.4 2006/08/15 12:54:29 netchild Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_dummy.c,v 1.5 2006/08/27 08:56:53 netchild Exp $"); #include #include @@ -77,7 +77,6 @@ DUMMY(timer_gettime); DUMMY(timer_getoverrun); DUMMY(timer_delete); -DUMMY(statfs64); DUMMY(fstatfs64); DUMMY(utimes); DUMMY(fadvise64_64); ==== //depot/projects/newisp/amd64/linux32/linux32_machdep.c#2 (text+ko) ==== @@ -29,7 +29,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_machdep.c,v 1.16 2006/08/25 11:59:56 netchild Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_machdep.c,v 1.17 2006/08/28 13:09:24 netchild Exp $"); #include #include @@ -570,24 +570,24 @@ } } - if (args->flags & CLONE_PARENT) { -#ifdef DEBUG - printf("linux_clone: CLONE_PARENT\n"); -#endif + if (args->flags & (CLONE_PARENT|CLONE_THREAD)) { + sx_xlock(&proctree_lock); + PROC_LOCK(p2); + proc_reparent(p2, td->td_proc->p_pptr); + PROC_UNLOCK(p2); + sx_xunlock(&proctree_lock); } - + if (args->flags & CLONE_THREAD) { /* XXX: linux mangles pgrp and pptr somehow * I think it might be this but I am not sure. */ #ifdef notyet + PROC_LOCK(p2); p2->p_pgrp = td->td_proc->p_pgrp; - p2->p_pptr = td->td_proc->p_pptr; + PROC_UNLOCK(p2); #endif exit_signal = 0; -#ifdef DEBUG - printf("linux_clone: CLONE_THREADS\n"); -#endif } if (args->flags & CLONE_CHILD_SETTID) @@ -599,6 +599,7 @@ em->child_clear_tid = args->child_tidptr; else em->child_clear_tid = NULL; + EMUL_UNLOCK(&emul_lock); PROC_LOCK(p2); ==== //depot/projects/newisp/amd64/linux32/linux32_proto.h#2 (text+ko) ==== @@ -2,8 +2,8 @@ * System call prototypes. * * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD: src/sys/amd64/linux32/linux32_proto.h,v 1.21 2006/08/15 17:36:58 jhb Exp $ - * created from FreeBSD: src/sys/amd64/linux32/syscalls.master,v 1.19 2006/08/15 12:28:14 netchild Exp + * $FreeBSD: src/sys/amd64/linux32/linux32_proto.h,v 1.22 2006/08/27 08:58:00 netchild Exp $ + * created from FreeBSD: src/sys/amd64/linux32/syscalls.master,v 1.20 2006/08/27 08:56:53 netchild Exp */ #ifndef _LINUX_SYSPROTO_H_ @@ -782,7 +782,8 @@ char rmtp_l_[PADL_(struct l_timespec *)]; struct l_timespec * rmtp; char rmtp_r_[PADR_(struct l_timespec *)]; }; struct linux_statfs64_args { - register_t dummy; + char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char buf_l_[PADL_(struct l_statfs64_buf *)]; struct l_statfs64_buf * buf; char buf_r_[PADR_(struct l_statfs64_buf *)]; }; struct linux_fstatfs64_args { register_t dummy; ==== //depot/projects/newisp/amd64/linux32/linux32_syscall.h#2 (text+ko) ==== @@ -2,8 +2,8 @@ * System call numbers. * * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD: src/sys/amd64/linux32/linux32_syscall.h,v 1.21 2006/08/15 17:36:58 jhb Exp $ - * created from FreeBSD: src/sys/amd64/linux32/syscalls.master,v 1.19 2006/08/15 12:28:14 netchild Exp + * $FreeBSD: src/sys/amd64/linux32/linux32_syscall.h,v 1.22 2006/08/27 08:58:00 netchild Exp $ + * created from FreeBSD: src/sys/amd64/linux32/syscalls.master,v 1.20 2006/08/27 08:56:53 netchild Exp */ #define LINUX_SYS_exit 1 ==== //depot/projects/newisp/amd64/linux32/linux32_sysent.c#2 (text+ko) ==== @@ -2,8 +2,8 @@ * System call switch table. * * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD: src/sys/amd64/linux32/linux32_sysent.c,v 1.21 2006/08/15 17:36:58 jhb Exp $ - * created from FreeBSD: src/sys/amd64/linux32/syscalls.master,v 1.19 2006/08/15 12:28:14 netchild Exp + * $FreeBSD: src/sys/amd64/linux32/linux32_sysent.c,v 1.22 2006/08/27 08:58:00 netchild Exp $ + * created from FreeBSD: src/sys/amd64/linux32/syscalls.master,v 1.20 2006/08/27 08:56:53 netchild Exp */ #include @@ -288,7 +288,7 @@ { AS(linux_clock_gettime_args), (sy_call_t *)linux_clock_gettime, AUE_NULL, NULL, 0, 0 }, /* 265 = linux_clock_gettime */ { AS(linux_clock_getres_args), (sy_call_t *)linux_clock_getres, AUE_NULL, NULL, 0, 0 }, /* 266 = linux_clock_getres */ { AS(linux_clock_nanosleep_args), (sy_call_t *)linux_clock_nanosleep, AUE_NULL, NULL, 0, 0 }, /* 267 = linux_clock_nanosleep */ - { 0, (sy_call_t *)linux_statfs64, AUE_NULL, NULL, 0, 0 }, /* 268 = linux_statfs64 */ + { AS(linux_statfs64_args), (sy_call_t *)linux_statfs64, AUE_NULL, NULL, 0, 0 }, /* 268 = linux_statfs64 */ { 0, (sy_call_t *)linux_fstatfs64, AUE_NULL, NULL, 0, 0 }, /* 269 = linux_fstatfs64 */ { AS(linux_tgkill_args), (sy_call_t *)linux_tgkill, AUE_NULL, NULL, 0, 0 }, /* 270 = linux_tgkill */ { 0, (sy_call_t *)linux_utimes, AUE_NULL, NULL, 0, 0 }, /* 271 = linux_utimes */ ==== //depot/projects/newisp/amd64/linux32/syscalls.master#2 (text+ko) ==== @@ -1,4 +1,4 @@ - $FreeBSD: src/sys/amd64/linux32/syscalls.master,v 1.19 2006/08/15 12:28:14 netchild Exp $ + $FreeBSD: src/sys/amd64/linux32/syscalls.master,v 1.20 2006/08/27 08:56:53 netchild Exp $ ; @(#)syscalls.master 8.1 (Berkeley) 7/19/93 ; System call name/number master file (or rather, slave, from LINUX). @@ -430,7 +430,7 @@ 266 AUE_NULL STD { int linux_clock_getres(clockid_t which, struct l_timespec *tp); } 267 AUE_NULL STD { int linux_clock_nanosleep(clockid_t which, int flags, \ struct l_timespec *rqtp, struct l_timespec *rmtp); } -268 AUE_NULL STD { int linux_statfs64(void); } +268 AUE_NULL STD { int linux_statfs64(char *path, struct l_statfs64_buf *buf); } 269 AUE_NULL STD { int linux_fstatfs64(void); } 270 AUE_NULL STD { int linux_tgkill(int tgid, int pid, int sig); } 271 AUE_NULL STD { int linux_utimes(void); } ==== //depot/projects/newisp/arm/arm/fusu.S#2 (text+ko) ==== @@ -37,7 +37,7 @@ #include #include #include "assym.s" -__FBSDID("$FreeBSD: src/sys/arm/arm/fusu.S,v 1.7 2005/04/23 16:45:04 cognet Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/arm/fusu.S,v 1.9 2006/08/29 23:53:34 cognet Exp $"); #ifdef MULTIPROCESSOR .Lcpu_info: @@ -52,6 +52,7 @@ * Fetch an int from the user's address space. */ +ENTRY(casuword32) ENTRY(casuptr) #ifdef MULTIPROCESSOR /* XXX Probably not appropriate for non-Hydra SMPs */ ==== //depot/projects/newisp/arm/arm/pmap.c#2 (text+ko) ==== @@ -147,7 +147,7 @@ #include "opt_vm.h" #include -__FBSDID("$FreeBSD: src/sys/arm/arm/pmap.c,v 1.68 2006/08/08 20:59:38 cognet Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/arm/pmap.c,v 1.69 2006/08/28 21:43:34 cognet Exp $"); #include #include #include @@ -4469,11 +4469,8 @@ pmap_remove_write(vm_page_t m) { - if (m->md.pvh_attrs & PVF_WRITE) + if (m->flags & PG_WRITEABLE) pmap_clearbit(m, PVF_WRITE); - else - KASSERT((m->flags & PG_WRITEABLE) == 0, - ("pmap_clear_write: page %p has PG_WRITEABLE set", m)); } ==== //depot/projects/newisp/arm/at91/at91.c#2 (text) ==== @@ -23,7 +23,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/arm/at91/at91.c,v 1.7 2006/05/19 11:27:02 cognet Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/at91/at91.c,v 1.8 2006/08/28 20:05:00 cognet Exp $"); #include #include @@ -54,7 +54,11 @@ vm_paddr_t pa, endpa; pa = trunc_page(bpa); - if (pa >= 0xfff00000) + if (pa >= 0xfff00000) { + *bshp = pa - 0xf0000000 + 0xd0000000; + return (0); + } + if (pa >= 0xdff00000) return (0); endpa = round_page(bpa + size); @@ -417,8 +421,8 @@ rman_manage_region(&sc->sc_irq_rman, 1, 31) != 0) panic("at91_attach: failed to set up IRQ rman"); if (rman_init(&sc->sc_mem_rman) != 0 || - rman_manage_region(&sc->sc_mem_rman, 0xfff00000ul, - 0xfffffffful) != 0) + rman_manage_region(&sc->sc_mem_rman, 0xdff00000ul, + 0xdffffffful) != 0) panic("at91_attach: failed to set up memory rman"); if (rman_manage_region(&sc->sc_mem_rman, AT91RM92_OHCI_BASE, AT91RM92_OHCI_BASE + AT91RM92_OHCI_SIZE - 1) != 0) @@ -543,7 +547,7 @@ void **cookiep) { struct at91_softc *sc = device_get_softc(dev); - + if (rman_get_start(ires) == AT91RM92_IRQ_SYSTEM && !(flags & INTR_FAST)) panic("All system interrupt ISRs must be type INTR_FAST"); BUS_SETUP_INTR(device_get_parent(dev), child, ires, flags, intr, arg, ==== //depot/projects/newisp/arm/at91/at91rm92reg.h#2 (text) ==== @@ -22,7 +22,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* $FreeBSD: src/sys/arm/at91/at91rm92reg.h,v 1.3 2006/06/20 20:13:40 imp Exp $ */ +/* $FreeBSD: src/sys/arm/at91/at91rm92reg.h,v 1.4 2006/08/28 20:05:00 cognet Exp $ */ #ifndef AT91RM92REG_H_ #define AT91RM92REG_H_ @@ -41,7 +41,7 @@ * 0xf0000000 - 0xfffffffff : Peripherals */ -#define AT91RM92_BASE 0xf0000000 +#define AT91RM92_BASE 0xd0000000 /* Usart */ #define AT91RM92_USART0_BASE 0xffc0000 ==== //depot/projects/newisp/arm/at91/kb920x_machdep.c#2 (text) ==== @@ -48,7 +48,7 @@ #include "opt_at91.h" #include -__FBSDID("$FreeBSD: src/sys/arm/at91/kb920x_machdep.c,v 1.15 2006/08/08 20:59:38 cognet Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/at91/kb920x_machdep.c,v 1.16 2006/08/28 20:05:00 cognet Exp $"); #define _ARM32_BUS_DMA_PRIVATE #include @@ -153,8 +153,8 @@ * and the timer. Other devices should use newbus to * map their memory anyway. */ + 0xdff00000, 0xfff00000, - 0xfff00000, 0x100000, VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, @@ -364,7 +364,7 @@ l1pagetable = kernel_l1pt.pv_va; /* Map the L2 pages tables in the L1 page table */ - pmap_link_l2pt(l1pagetable, ARM_VECTORS_LOW, + pmap_link_l2pt(l1pagetable, ARM_VECTORS_HIGH, &kernel_pt_table[KERNEL_PT_SYS]); for (i = 0; i < KERNEL_PT_KERN_NUM; i++) pmap_link_l2pt(l1pagetable, KERNBASE + i * 0x100000, @@ -383,7 +383,7 @@ /* Map the vector page. */ - pmap_map_entry(l1pagetable, ARM_VECTORS_LOW, systempage.pv_pa, + pmap_map_entry(l1pagetable, ARM_VECTORS_HIGH, systempage.pv_pa, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); /* Map the stack pages */ pmap_map_chunk(l1pagetable, irqstack.pv_va, irqstack.pv_pa, @@ -462,7 +462,7 @@ thread0.td_frame = &proc0_tf; pcpup->pc_curpcb = thread0.td_pcb; - arm_vector_init(ARM_VECTORS_LOW, ARM_VEC_ALL); + arm_vector_init(ARM_VECTORS_HIGH, ARM_VEC_ALL); pmap_curmaxkvaddr = afterkern + 0x100000 * (KERNEL_PT_KERN_NUM - 1); /* ==== //depot/projects/newisp/arm/xscale/i80321/ep80219_machdep.c#2 (text+ko) ==== @@ -49,7 +49,7 @@ #include "opt_ddb.h" #include -__FBSDID("$FreeBSD: src/sys/arm/xscale/i80321/ep80219_machdep.c,v 1.1 2006/08/24 23:51:28 cognet Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/xscale/i80321/ep80219_machdep.c,v 1.2 2006/08/27 13:23:51 cognet Exp $"); #define _ARM32_BUS_DMA_PRIVATE #include @@ -444,6 +444,10 @@ pmap_curmaxkvaddr = afterkern + PAGE_SIZE; + dump_avail[0] = 0xa0000000; + dump_avail[1] = 0xa0000000 + memsize; + dump_avail[2] = 0; + dump_avail[3] = 0; pmap_bootstrap(pmap_curmaxkvaddr, 0xd0000000, &kernel_l1pt); msgbufp = (void*)msgbufpv.pv_va; @@ -462,10 +466,6 @@ phys_avail[i++] = trunc_page(0xa0000000 + memsize - 1); phys_avail[i++] = 0; phys_avail[i] = 0; - dump_avail[0] = 0xa0000000; - dump_avail[1] = 0xa0000000 + memsize; - dump_avail[2] = 0; - dump_avail[3] = 0; /* Do basic tuning, hz etc */ init_param1(); ==== //depot/projects/newisp/compat/linux/linux_emul.c#2 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/compat/linux/linux_emul.c,v 1.4 2006/08/19 11:54:19 ssouhlal Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/linux/linux_emul.c,v 1.5 2006/08/28 13:52:27 ssouhlal Exp $"); #include "opt_compat.h" @@ -232,10 +232,10 @@ em->shared->refs--; if (em->shared->refs == 0) - FREE(em->shared, M_LINUX); + free(em->shared, M_LINUX); EMUL_SHARED_WUNLOCK(&emul_shared_lock); - FREE(em, M_LINUX); + free(em, M_LINUX); } } ==== //depot/projects/newisp/compat/linux/linux_stats.c#2 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/compat/linux/linux_stats.c,v 1.83 2006/05/16 17:57:00 ambrisko Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/linux/linux_stats.c,v 1.84 2006/08/27 08:56:54 netchild Exp $"); #include "opt_compat.h" #include "opt_mac.h" @@ -312,6 +312,19 @@ l_int f_spare[6]; }; +struct l_statfs64 { + l_int f_type; + l_int f_bsize; + uint64_t f_blocks; + uint64_t f_bfree; + uint64_t f_bavail; + uint64_t f_files; + uint64_t f_ffree; + l_fsid_t f_fsid; + l_int f_namelen; + l_int f_spare[6]; +}; + #define LINUX_CODA_SUPER_MAGIC 0x73757245L #define LINUX_EXT2_SUPER_MAGIC 0xEF53L #define LINUX_HPFS_SUPER_MAGIC 0xf995e849L @@ -387,6 +400,44 @@ return copyout(&linux_statfs, args->buf, sizeof(linux_statfs)); } +static void +bsd_to_linux_statfs64(struct statfs *bsd_statfs, struct l_statfs64 *linux_statfs) +{ + + linux_statfs->f_type = bsd_to_linux_ftype(bsd_statfs->f_fstypename); + linux_statfs->f_bsize = bsd_statfs->f_bsize; + linux_statfs->f_blocks = bsd_statfs->f_blocks; + linux_statfs->f_bfree = bsd_statfs->f_bfree; + linux_statfs->f_bavail = bsd_statfs->f_bavail; + linux_statfs->f_ffree = bsd_statfs->f_ffree; + linux_statfs->f_files = bsd_statfs->f_files; + linux_statfs->f_fsid.val[0] = bsd_statfs->f_fsid.val[0]; + linux_statfs->f_fsid.val[1] = bsd_statfs->f_fsid.val[1]; + linux_statfs->f_namelen = MAXNAMLEN; +} + +int +linux_statfs64(struct thread *td, struct linux_statfs64_args *args) +{ + struct l_statfs64 linux_statfs; + struct statfs bsd_statfs; + char *path; + int error; + + LCONVPATHEXIST(td, args->path, &path); + +#ifdef DEBUG + if (ldebug(statfs64)) + printf(ARGS(statfs64, "%s, *"), path); +#endif + error = kern_statfs(td, path, UIO_SYSSPACE, &bsd_statfs); + LFREEPATH(path); + if (error) + return (error); + bsd_to_linux_statfs64(&bsd_statfs, &linux_statfs); + return copyout(&linux_statfs, args->buf, sizeof(linux_statfs)); +} + int linux_fstatfs(struct thread *td, struct linux_fstatfs_args *args) { ==== //depot/projects/newisp/conf/NOTES#2 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/NOTES,v 1.1379 2006/08/24 08:00:02 ru Exp $ +# $FreeBSD: src/sys/conf/NOTES,v 1.1380 2006/08/27 12:57:37 marck Exp $ # # NOTES -- Lines that can be cut/pasted into kernel and hints configs. # @@ -1757,7 +1757,8 @@ # the Sundance/Tamarack TC9021, the D-Link DL-4000 and ASUS NX1101. # ti: Support for PCI gigabit ethernet NICs based on the Alteon Networks # Tigon 1 and Tigon 2 chipsets. This includes the Alteon AceNIC, the -# 3Com 3c985, the Netgear GA620 and various others. +# 3Com 3c985, the Netgear GA620 and various others. Note that you will +# probably want to bump up kern.ipc.nmbclusters a lot to use this driver. # tl: Support for the Texas Instruments TNETE100 series 'ThunderLAN' # cards and integrated ethernet controllers. This includes several # Compaq Netelligent 10/100 cards and the built-in ethernet controllers ==== //depot/projects/newisp/crypto/sha2/sha2.c#2 (text+ko) ==== @@ -35,7 +35,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/crypto/sha2/sha2.c,v 1.7 2003/09/08 18:32:33 phk Exp $"); +__FBSDID("$FreeBSD: src/sys/crypto/sha2/sha2.c,v 1.8 2006/08/26 21:48:00 kan Exp $"); #include #include @@ -750,7 +750,7 @@ void SHA512_Transform(SHA512_CTX* context, const sha2_word64* data) { sha2_word64 a, b, c, d, e, f, g, h, s0, s1; - sha2_word64 T1, T2, *W512 = (sha2_word64*)context->buffer; + sha2_word64 T1, T2 = 0, *W512 = (sha2_word64*)context->buffer; int j; /* Initialize registers with the prev. intermediate value */ ==== //depot/projects/newisp/dev/fdc/fdc.c#2 (text+ko) ==== @@ -51,7 +51,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/fdc/fdc.c,v 1.311 2006/07/12 00:49:46 jkim Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/fdc/fdc.c,v 1.312 2006/08/29 18:19:39 jkim Exp $"); #include "opt_fdc.h" @@ -511,9 +511,9 @@ DELAY(100); /* enable FDC, but defer interrupts a moment */ fdout_wr(fdc, fdc->fdout & ~FDO_FDMAEN); - DELAY(100); - fdout_wr(fdc, fdc->fdout); } + DELAY(100); + fdout_wr(fdc, fdc->fdout); /* XXX after a reset, silently believe the FDC will accept commands */ if (fdc_cmd(fdc, 3, NE7CMD_SPECIFY, spec1, spec2, 0)) ==== //depot/projects/newisp/i386/i386/support.s#2 (text+ko) ==== @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/i386/i386/support.s,v 1.110 2006/08/15 15:27:13 netchild Exp $ + * $FreeBSD: src/sys/i386/i386/support.s,v 1.111 2006/08/28 02:28:15 davidxu Exp $ */ #include "opt_npx.h" @@ -1142,6 +1142,8 @@ /* * casuptr. Compare and set user pointer. Returns -1 or the current value. */ + +ALTENTRY(casuword32) ENTRY(casuptr) movl PCPU(CURPCB),%ecx movl $fusufault,PCB_ONFAULT(%ecx) ==== //depot/projects/newisp/i386/linux/linux_dummy.c#2 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/i386/linux/linux_dummy.c,v 1.42 2006/08/15 12:54:30 netchild Exp $"); +__FBSDID("$FreeBSD: src/sys/i386/linux/linux_dummy.c,v 1.43 2006/08/27 08:56:54 netchild Exp $"); #include #include @@ -73,7 +73,6 @@ DUMMY(epoll_ctl); DUMMY(epoll_wait); DUMMY(remap_file_pages); -DUMMY(statfs64); DUMMY(fstatfs64); DUMMY(utimes); DUMMY(fadvise64_64); ==== //depot/projects/newisp/i386/linux/linux_machdep.c#2 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/i386/linux/linux_machdep.c,v 1.54 2006/08/25 11:59:56 netchild Exp $"); +__FBSDID("$FreeBSD: src/sys/i386/linux/linux_machdep.c,v 1.55 2006/08/27 18:51:32 netchild Exp $"); #include #include @@ -414,24 +414,24 @@ } } - if (args->flags & CLONE_PARENT) { -#ifdef DEBUG - printf("linux_clone: CLONE_PARENT\n"); -#endif + if (args->flags & (CLONE_PARENT|CLONE_THREAD)) { + sx_xlock(&proctree_lock); + PROC_LOCK(p2); + proc_reparent(p2, td->td_proc->p_pptr); + PROC_UNLOCK(p2); + sx_xunlock(&proctree_lock); } - + if (args->flags & CLONE_THREAD) { /* XXX: linux mangles pgrp and pptr somehow * I think it might be this but I am not sure. */ #ifdef notyet + PROC_LOCK(p2); p2->p_pgrp = td->td_proc->p_pgrp; - p2->p_pptr = td->td_proc->p_pptr; + PROC_UNLOCK(p2); #endif exit_signal = 0; -#ifdef DEBUG - printf("linux_clone: CLONE_THREADS\n"); -#endif } if (args->flags & CLONE_CHILD_SETTID) @@ -443,6 +443,7 @@ em->child_clear_tid = args->child_tidptr; else em->child_clear_tid = NULL; + EMUL_UNLOCK(&emul_lock); PROC_LOCK(p2); @@ -502,13 +503,9 @@ sd.sd_gran); #endif - /* this is taken from i386 version of cpu_set_user_tls() */ - critical_enter(); /* set %gs */ td2->td_pcb->pcb_gsd = sd; - PCPU_GET(fsgs_gdt)[1] = sd; - load_gs(GSEL(GUGS_SEL, SEL_UPL)); - critical_exit(); + td2->td_pcb->pcb_gs = GSEL(GUGS_SEL, SEL_UPL); } #ifdef DEBUG ==== //depot/projects/newisp/i386/linux/linux_proto.h#2 (text+ko) ==== @@ -2,8 +2,8 @@ * System call prototypes. * * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD: src/sys/i386/linux/linux_proto.h,v 1.80 2006/08/15 17:37:00 jhb Exp $ - * created from FreeBSD: src/sys/i386/linux/syscalls.master,v 1.77 2006/08/15 12:28:14 netchild Exp + * $FreeBSD: src/sys/i386/linux/linux_proto.h,v 1.81 2006/08/27 08:58:00 netchild Exp $ + * created from FreeBSD: src/sys/i386/linux/syscalls.master,v 1.78 2006/08/27 08:56:54 netchild Exp */ #ifndef _LINUX_SYSPROTO_H_ @@ -784,7 +784,8 @@ char rmtp_l_[PADL_(struct l_timespec *)]; struct l_timespec * rmtp; char rmtp_r_[PADR_(struct l_timespec *)]; }; struct linux_statfs64_args { - register_t dummy; + char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char buf_l_[PADL_(struct l_statfs64_buf *)]; struct l_statfs64_buf * buf; char buf_r_[PADR_(struct l_statfs64_buf *)]; }; struct linux_fstatfs64_args { register_t dummy; ==== //depot/projects/newisp/i386/linux/linux_syscall.h#2 (text+ko) ==== @@ -2,8 +2,8 @@ * System call numbers. * * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD: src/sys/i386/linux/linux_syscall.h,v 1.74 2006/08/15 17:37:00 jhb Exp $ - * created from FreeBSD: src/sys/i386/linux/syscalls.master,v 1.77 2006/08/15 12:28:14 netchild Exp + * $FreeBSD: src/sys/i386/linux/linux_syscall.h,v 1.75 2006/08/27 08:58:00 netchild Exp $ + * created from FreeBSD: src/sys/i386/linux/syscalls.master,v 1.78 2006/08/27 08:56:54 netchild Exp */ #define LINUX_SYS_exit 1 ==== //depot/projects/newisp/i386/linux/linux_sysent.c#2 (text+ko) ==== @@ -2,8 +2,8 @@ * System call switch table. * * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD: src/sys/i386/linux/linux_sysent.c,v 1.81 2006/08/15 17:37:00 jhb Exp $ - * created from FreeBSD: src/sys/i386/linux/syscalls.master,v 1.77 2006/08/15 12:28:14 netchild Exp + * $FreeBSD: src/sys/i386/linux/linux_sysent.c,v 1.82 2006/08/27 08:58:00 netchild Exp $ + * created from FreeBSD: src/sys/i386/linux/syscalls.master,v 1.78 2006/08/27 08:56:54 netchild Exp */ #include @@ -287,7 +287,7 @@ { AS(linux_clock_gettime_args), (sy_call_t *)linux_clock_gettime, AUE_NULL, NULL, 0, 0 }, /* 265 = linux_clock_gettime */ { AS(linux_clock_getres_args), (sy_call_t *)linux_clock_getres, AUE_NULL, NULL, 0, 0 }, /* 266 = linux_clock_getres */ { AS(linux_clock_nanosleep_args), (sy_call_t *)linux_clock_nanosleep, AUE_NULL, NULL, 0, 0 }, /* 267 = linux_clock_nanosleep */ - { 0, (sy_call_t *)linux_statfs64, AUE_NULL, NULL, 0, 0 }, /* 268 = linux_statfs64 */ + { AS(linux_statfs64_args), (sy_call_t *)linux_statfs64, AUE_NULL, NULL, 0, 0 }, /* 268 = linux_statfs64 */ { 0, (sy_call_t *)linux_fstatfs64, AUE_NULL, NULL, 0, 0 }, /* 269 = linux_fstatfs64 */ { AS(linux_tgkill_args), (sy_call_t *)linux_tgkill, AUE_NULL, NULL, 0, 0 }, /* 270 = linux_tgkill */ { 0, (sy_call_t *)linux_utimes, AUE_NULL, NULL, 0, 0 }, /* 271 = linux_utimes */ ==== //depot/projects/newisp/i386/linux/syscalls.master#2 (text+ko) ==== @@ -1,4 +1,4 @@ - $FreeBSD: src/sys/i386/linux/syscalls.master,v 1.77 2006/08/15 12:28:14 netchild Exp $ + $FreeBSD: src/sys/i386/linux/syscalls.master,v 1.78 2006/08/27 08:56:54 netchild Exp $ ; @(#)syscalls.master 8.1 (Berkeley) 7/19/93 ; System call name/number master file (or rather, slave, from LINUX). @@ -434,7 +434,7 @@ 266 AUE_NULL STD { int linux_clock_getres(clockid_t which, struct l_timespec *tp); } 267 AUE_NULL STD { int linux_clock_nanosleep(clockid_t which, int flags, \ struct l_timespec *rqtp, struct l_timespec *rmtp); } -268 AUE_NULL STD { int linux_statfs64(void); } +268 AUE_NULL STD { int linux_statfs64(char *path, struct l_statfs64_buf *buf); } 269 AUE_NULL STD { int linux_fstatfs64(void); } 270 AUE_NULL STD { int linux_tgkill(int tgid, int pid, int sig); } 271 AUE_NULL STD { int linux_utimes(void); } ==== //depot/projects/newisp/ia64/ia64/support.S#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/ia64/ia64/support.S,v 1.25 2005/01/06 22:18:22 imp Exp $ + * $FreeBSD: src/sys/ia64/ia64/support.S,v 1.26 2006/08/28 02:28:15 davidxu Exp $ */ /*- * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University. @@ -242,6 +242,56 @@ END(casuptr) /* + * casuword32(int32_t *p, int32_t old, int32_t new) + * Perform a 32-bit compare-exchange in user space. + */ +ENTRY(casuword32, 3) +{ .mlx + add r15=PC_CURTHREAD,r13 + movl r14=VM_MAX_ADDRESS + ;; +} +{ .mib + ld8 r15=[r15] // r15 = curthread + cmp.geu p6,p0=in0,r14 +(p6) br.dpnt.few 1f + ;; +} +{ .mlx + add r15=TD_PCB,r15 + movl r14=fusufault + ;; +} +{ .mmi + ld8 r15=[r15] // r15 = PCB + ;; + mov ar.ccv=in1 + add r15=PCB_ONFAULT,r15 + ;; +} +{ .mmi + st8 [r15]=r14 // Set onfault + ;; + cmpxchg4.rel ret0=[in0],in2,ar.ccv + nop 0 + ;; +} +{ .mfb + st8.rel [r15]=r0 // Clear onfault + nop 0 + br.ret.sptk rp + ;; +} +1: +{ .mfb + add ret0=-1,r0 + nop 0 + br.ret.sptk rp + ;; +} +END(casuword32) + +/* * subyte(void *addr, int byte) * suword16(void *addr, int word) * suword32(void *addr, int word) ==== //depot/projects/newisp/kern/init_sysent.c#2 (text+ko) ==== @@ -2,8 +2,8 @@ * System call switch table. * * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD: src/sys/kern/init_sysent.c,v 1.218 2006/08/15 17:37:00 jhb Exp $ - * created from FreeBSD: src/sys/kern/syscalls.master,v 1.222 2006/08/15 16:45:41 jhb Exp + * $FreeBSD: src/sys/kern/init_sysent.c,v 1.219 2006/08/28 04:28:24 davidxu Exp $ + * created from FreeBSD: src/sys/kern/syscalls.master,v 1.223 2006/08/16 22:32:50 peter Exp */ #include "opt_compat.h" @@ -498,4 +498,6 @@ { AS(thr_setscheduler_args), (sy_call_t *)thr_setscheduler, AUE_NULL, NULL, 0, 0 }, /* 466 = thr_setscheduler */ { AS(thr_getscheduler_args), (sy_call_t *)thr_getscheduler, AUE_NULL, NULL, 0, 0 }, /* 467 = thr_getscheduler */ { AS(thr_setschedparam_args), (sy_call_t *)thr_setschedparam, AUE_NULL, NULL, 0, 0 }, /* 468 = thr_setschedparam */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 469 = __getpath_fromfd */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 470 = __getpath_fromaddr */ }; ==== //depot/projects/newisp/kern/kern_thread.c#2 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/kern/kern_thread.c,v 1.234 2006/06/30 08:10:55 maxim Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/kern_thread.c,v 1.235 2006/08/28 04:24:51 davidxu Exp $"); #include #include @@ -140,6 +140,7 @@ #ifdef AUDIT audit_thread_alloc(td); #endif + umtx_thread_alloc(td); return (0); } @@ -194,9 +195,9 @@ cpu_thread_setup(td); td->td_sleepqueue = sleepq_alloc(); td->td_turnstile = turnstile_alloc(); - td->td_umtxq = umtxq_alloc(); td->td_sched = (struct td_sched *)&td[1]; sched_newthread(td); + umtx_thread_init(td); return (0); } @@ -211,7 +212,7 @@ td = (struct thread *)mem; turnstile_free(td->td_turnstile); sleepq_free(td->td_sleepqueue); - umtxq_free(td->td_umtxq); + umtx_thread_fini(td); vm_thread_dispose(td); } @@ -486,6 +487,8 @@ td->td_standin = NULL; } + umtx_thread_exit(td); + /* * drop FPU & debug register state storage, or any other * architecture specific resources that ==== //depot/projects/newisp/kern/kern_umtx.c#2 (text+ko) ==== @@ -26,7 +26,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/kern/kern_umtx.c,v 1.39 2006/08/25 06:12:53 davidxu Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/kern_umtx.c,v 1.41 2006/08/28 07:09:27 davidxu Exp $"); #include #include @@ -35,11 +35,12 @@ #include #include #include +#include +#include #include #include #include #include -#include #include #include @@ -48,76 +49,194 @@ #include #include -#define UMTX_PRIVATE 0 -#define UMTX_SHARED 1 +#define TYPE_SIMPLE_LOCK 0 +#define TYPE_SIMPLE_WAIT 1 +#define TYPE_NORMAL_UMUTEX 2 +#define TYPE_PI_UMUTEX 3 +#define TYPE_PP_UMUTEX 4 +#define TYPE_CV 5 +/* Key to represent a unique userland synchronous object */ struct umtx_key { + int hash; int type; + int shared; union { struct { vm_object_t object; - long offset; + uintptr_t offset; } shared; struct { - struct umtx *umtx; - long pid; + struct vmspace *vs; + uintptr_t addr; } private; struct { - void *ptr; - long word; + void *a; >>> TRUNCATED FOR MAIL (1000 lines) <<<