CVS commit: src/sys/arch/arm/vfp
Module Name:src Committed By: skrll Date: Fri Jan 24 08:26:39 UTC 2014 Modified Files: src/sys/arch/arm/vfp: vfp_init.c Log Message: Be consistent about setting fpscr for Runfast. No functional change. To generate a diff of this commit: cvs rdiff -u -r1.31 -r1.32 src/sys/arch/arm/vfp/vfp_init.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/arm/vfp/vfp_init.c diff -u src/sys/arch/arm/vfp/vfp_init.c:1.31 src/sys/arch/arm/vfp/vfp_init.c:1.32 --- src/sys/arch/arm/vfp/vfp_init.c:1.31 Thu Jan 23 17:44:13 2014 +++ src/sys/arch/arm/vfp/vfp_init.c Fri Jan 24 08:26:39 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: vfp_init.c,v 1.31 2014/01/23 17:44:13 skrll Exp $ */ +/* $NetBSD: vfp_init.c,v 1.32 2014/01/24 08:26:39 skrll Exp $ */ /* * Copyright (c) 2008 ARM Ltd @@ -197,7 +197,7 @@ vfp_fpscr_handler(u_int address, u_int i if (__predict_false(!vfp_used_p())) { pcb-pcb_vfp.vfp_fpscr = - (VFP_FPSCR_DN | VFP_FPSCR_FZ); /* Runfast */ + (VFP_FPSCR_DN | VFP_FPSCR_FZ | VFP_FPSCR_RN); /* Runfast */ } #endif @@ -500,8 +500,8 @@ vfp_state_load(lwp_t *l, u_int flags) */ if (__predict_false((flags PCU_LOADED) == 0)) { vfpevent_use.ev_count++; - pcb-pcb_vfp.vfp_fpscr = /* Runfast */ - (VFP_FPSCR_DN | VFP_FPSCR_FZ | VFP_FPSCR_RN); + pcb-pcb_vfp.vfp_fpscr = + (VFP_FPSCR_DN | VFP_FPSCR_FZ | VFP_FPSCR_RN); /* Runfast */ } else { vfpevent_reuse.ev_count++; }
CVS commit: src/lib/libc/compat/arch/alpha/gen
Module Name:src Committed By: skrll Date: Fri Jan 24 10:19:18 UTC 2014 Modified Files: src/lib/libc/compat/arch/alpha/gen: compat__setjmp.S Log Message: Load the magic into the right register for the comparison in _longjmp To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/lib/libc/compat/arch/alpha/gen/compat__setjmp.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/compat/arch/alpha/gen/compat__setjmp.S diff -u src/lib/libc/compat/arch/alpha/gen/compat__setjmp.S:1.3 src/lib/libc/compat/arch/alpha/gen/compat__setjmp.S:1.4 --- src/lib/libc/compat/arch/alpha/gen/compat__setjmp.S:1.3 Fri Jan 24 00:20:54 2014 +++ src/lib/libc/compat/arch/alpha/gen/compat__setjmp.S Fri Jan 24 10:19:18 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: compat__setjmp.S,v 1.3 2014/01/24 00:20:54 christos Exp $ */ +/* $NetBSD: compat__setjmp.S,v 1.4 2014/01/24 10:19:18 skrll Exp $ */ /* * Copyright (c) 1994, 1995 Carnegie-Mellon University. @@ -90,7 +90,7 @@ END(_setjmp) LEAF(_longjmp, 2) LDGP(pv) ldq t0, ((31 + 4) * 8)(a0) /* magic in sc_regs[31] */ - ldq t0, magic /* sigcontext magic number */ + ldq t1, magic /* sigcontext magic number */ cmpeq t0, t1, t0 beq t0, botch /* If the magic was bad, punt */
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: manu Date: Fri Jan 24 10:41:07 UTC 2014 Modified Files: src/sys/compat/netbsd32: netbsd32_ioctl.c netbsd32_ioctl.h Log Message: Add ATAIOCCOMMAND ioctl form COMPAT_NETBSD32 This enables SMART monitoring by a netbsd32 binary. To generate a diff of this commit: cvs rdiff -u -r1.67 -r1.68 src/sys/compat/netbsd32/netbsd32_ioctl.c cvs rdiff -u -r1.43 -r1.44 src/sys/compat/netbsd32/netbsd32_ioctl.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/netbsd32_ioctl.c diff -u src/sys/compat/netbsd32/netbsd32_ioctl.c:1.67 src/sys/compat/netbsd32/netbsd32_ioctl.c:1.68 --- src/sys/compat/netbsd32/netbsd32_ioctl.c:1.67 Mon Aug 6 08:27:49 2012 +++ src/sys/compat/netbsd32/netbsd32_ioctl.c Fri Jan 24 10:41:07 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_ioctl.c,v 1.67 2012/08/06 08:27:49 skrll Exp $ */ +/* $NetBSD: netbsd32_ioctl.c,v 1.68 2014/01/24 10:41:07 manu Exp $ */ /* * Copyright (c) 1998, 2001 Matthew R. Green @@ -31,7 +31,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: netbsd32_ioctl.c,v 1.67 2012/08/06 08:27:49 skrll Exp $); +__KERNEL_RCSID(0, $NetBSD: netbsd32_ioctl.c,v 1.68 2014/01/24 10:41:07 manu Exp $); #include sys/param.h #include sys/systm.h @@ -43,6 +43,7 @@ __KERNEL_RCSID(0, $NetBSD: netbsd32_ioc #include sys/audioio.h #include sys/disklabel.h #include sys/dkio.h +#include sys/ataio.h #include sys/sockio.h #include sys/socket.h #include sys/ttycom.h @@ -187,6 +188,23 @@ netbsd32_to_sioc_sg_req(struct netbsd32_ } static inline void +netbsd32_to_atareq(struct netbsd32_atareq *s32p, struct atareq *p, u_long cmd) +{ + p-flags = (u_long)s32p-flags; + p-command = s32p-command; + p-features = s32p-features; + p-sec_count = s32p-sec_count; + p-sec_num = s32p-sec_num; + p-head = s32p-head; + p-cylinder = s32p-cylinder; + p-databuf = (char *)NETBSD32PTR64(s32p-databuf); + p-datalen = (u_long)s32p-datalen; + p-timeout = s32p-timeout; + p-retsts = s32p-retsts; + p-error = s32p-error; +} + +static inline void netbsd32_to_vnd_ioctl(struct netbsd32_vnd_ioctl *s32p, struct vnd_ioctl *p, u_long cmd) { @@ -481,6 +499,23 @@ netbsd32_from_sioc_sg_req(struct sioc_sg } static inline void +netbsd32_from_atareq(struct atareq *p, struct netbsd32_atareq *s32p, u_long cmd) +{ + s32p-flags = (netbsd32_u_long)p-flags; + s32p-command = p-command; + s32p-features = p-features; + s32p-sec_count = p-sec_count; + s32p-sec_num = p-sec_num; + s32p-head = p-head; + s32p-cylinder = p-cylinder; + NETBSD32PTR32(s32p-databuf, p-databuf); + s32p-datalen = (netbsd32_u_long)p-datalen; + s32p-timeout = p-timeout; + s32p-retsts = p-retsts; + s32p-error = p-error; +} + +static inline void netbsd32_from_vnd_ioctl(struct vnd_ioctl *p, struct netbsd32_vnd_ioctl *s32p, u_long cmd) { @@ -837,6 +872,9 @@ netbsd32_ioctl(struct lwp *l, const stru IOCTL_STRUCT_CONV_TO(DIOCWFORMAT, format_op); #endif + case ATAIOCCOMMAND32: + IOCTL_STRUCT_CONV_TO(ATAIOCCOMMAND, atareq); + /* * only a few ifreq syscalls need conversion and those are * all driver specific... XXX Index: src/sys/compat/netbsd32/netbsd32_ioctl.h diff -u src/sys/compat/netbsd32/netbsd32_ioctl.h:1.43 src/sys/compat/netbsd32/netbsd32_ioctl.h:1.44 --- src/sys/compat/netbsd32/netbsd32_ioctl.h:1.43 Mon May 28 14:19:10 2012 +++ src/sys/compat/netbsd32/netbsd32_ioctl.h Fri Jan 24 10:41:07 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_ioctl.h,v 1.43 2012/05/28 14:19:10 christos Exp $ */ +/* $NetBSD: netbsd32_ioctl.h,v 1.44 2014/01/24 10:41:07 manu Exp $ */ /* * Copyright (c) 1998, 2001 Matthew R. Green @@ -90,6 +90,24 @@ struct netbsd32_format_op { #define DIOCWFORMAT32 _IOWR('d', 106, struct netbsd32_format_op) #endif +/* from sys/ataio.h */ +struct netbsd32_atareq { + netbsd32_u_long flags; + u_char command; + u_char features; + u_char sec_count; + u_char sec_num; + u_char head; + u_short cylinder; + netbsd32_voidp databuf; + netbsd32_u_long datalen; + int timeout; + u_char retsts; + u_char error; +}; +#define ATAIOCCOMMAND32 _IOWR('Q', 8, struct netbsd32_atareq) + + /* from net/bpf.h */ struct netbsd32_bpf_program { u_int bf_len;
CVS commit: src/sys/dev/pci
Module Name:src Committed By: bouyer Date: Fri Jan 24 12:11:40 UTC 2014 Modified Files: src/sys/dev/pci: sisfb.c Log Message: Snapshot of work in progress: Add support xorg wsfb driver. Tested on evbmips/loongson To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/dev/pci/sisfb.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/sisfb.c diff -u src/sys/dev/pci/sisfb.c:1.3 src/sys/dev/pci/sisfb.c:1.4 --- src/sys/dev/pci/sisfb.c:1.3 Sat Jan 18 19:24:46 2014 +++ src/sys/dev/pci/sisfb.c Fri Jan 24 12:11:40 2014 @@ -24,7 +24,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: sisfb.c,v 1.3 2014/01/18 19:24:46 bouyer Exp $); +__KERNEL_RCSID(0, $NetBSD: sisfb.c,v 1.4 2014/01/24 12:11:40 bouyer Exp $); #include sys/param.h #include sys/systm.h @@ -61,6 +61,8 @@ struct sisfb { bus_space_tag_t fbt; bus_space_handle_t fbh; + bus_addr_t fbbase; + bus_size_t fbsize; bus_space_tag_t mmiot; bus_space_handle_t mmioh; @@ -88,6 +90,9 @@ struct sisfb_softc { const struct wsscreen_descr *sc_scrlist[1]; int sc_nscr; int sc_mode; + + pci_chipset_tag_t sc_pc; + pcitag_t sc_pt; }; int sisfb_match(device_t, cfdata_t, void *); @@ -220,7 +225,7 @@ sisfb_attach(device_t parent, device_t s struct pci_attach_args *pa = (struct pci_attach_args *)aux; struct rasops_info *ri; struct wsemuldisplaydev_attach_args waa; - bus_size_t fbsize, mmiosize, iosize; + bus_size_t mmiosize, iosize; struct sisfb *fb; int console; unsigned long defattr; @@ -239,12 +244,16 @@ sisfb_attach(device_t parent, device_t s pci_aprint_devinfo(pa, NULL); + sc-sc_pt = pa-pa_tag; + sc-sc_pc = pa-pa_pc; + if (!console) { fb-fbt = pa-pa_memt; fb-mmiot = pa-pa_memt; fb-iot = pa-pa_iot; if (pci_mapreg_map(pa, PCI_MAPREG_START, PCI_MAPREG_TYPE_MEM, - BUS_SPACE_MAP_LINEAR, fb-fbt, fb-fbh, NULL, fbsize) != 0) { + BUS_SPACE_MAP_LINEAR, fb-fbt, fb-fbh, + fb-fbbase, fb-fbsize) != 0) { aprint_error_dev(self, : can't map frame buffer\n); return; } @@ -318,7 +327,7 @@ fail3: fail2: bus_space_unmap(fb-mmiot, fb-mmioh, mmiosize); fail1: - bus_space_unmap(fb-fbt, fb-fbh, fbsize); + bus_space_unmap(fb-fbt, fb-fbh, fb-fbsize); } /* @@ -368,15 +377,18 @@ sisfb_ioctl(void *v, void *vs, u_long cm *(uint *)data = WSDISPLAY_TYPE_PCIMISC; return 0; case WSDISPLAYIO_GINFO: - wdf = (struct wsdisplay_fbinfo *)data; - wdf-width = ri-ri_width; - wdf-height = ri-ri_height; - wdf-depth = ri-ri_depth; - wdf-cmsize = 256; - return 0; + if (vd-active != NULL) { + wdf = (struct wsdisplay_fbinfo *)data; + wdf-width = ri-ri_width; + wdf-height = ri-ri_height; + wdf-depth = ri-ri_depth; + wdf-cmsize = 256; + return 0; + } else + return ENODEV; case WSDISPLAYIO_LINEBYTES: *(uint *)data = ri-ri_stride; - break; + return 0; case WSDISPLAYIO_GETCMAP: cm = (struct wsdisplay_cmap *)data; rc = sisfb_getcmap(fb-cmap, cm); @@ -389,6 +401,14 @@ sisfb_ioctl(void *v, void *vs, u_long cm if (ri-ri_depth == 8) sisfb_loadcmap(fb, cm-index, cm-count); return 0; + case WSDISPLAYIO_SMODE: + /* XXX */ return 0; + case PCI_IOC_CFGREAD: + case PCI_IOC_CFGWRITE: + return pci_devioctl(sc-sc_pc, sc-sc_pt, cmd, data, flags, l); + case WSDISPLAYIO_GET_BUSID: + return wsdisplayio_busid_pci(sc-sc_dev, sc-sc_pc, + sc-sc_pt, data); } return EPASSTHROUGH; } @@ -406,23 +426,17 @@ sisfb_mmap(void *v, void *vs, off_t offs struct vcons_data *vd = v; struct sisfb_softc *sc = vd-cookie; struct rasops_info *ri = sc-sc_fb-vcs.scr_ri; - - if ((offset PAGE_MASK) != 0) - return -1; - - if (offset 0 || offset = ri-ri_stride * ri-ri_height) - return -1; - - /* - * Don't allow mmap if the frame buffer area is not page aligned. - * XXX we should reprogram it to a page aligned boundary at attach - * XXX time if this isn't the case. - */ - if (((paddr_t)ri-ri_bits PAGE_MASK) != 0) - return -1; - - /* return XKPHYS_TO_PHYS((paddr_t)ri-ri_bits) + offset; */ - /* XXX */ return -1; + struct sisfb *fb = sc-sc_fb; + const uintptr_t fb_offset = + (uintptr_t)bus_space_vaddr(fb-fbt, fb-fbh) - (uintptr_t)fb-fb_addr; + paddr_t pa; + + if (offset = 0 offset ri-ri_stride * ri-ri_height) { + pa = bus_space_mmap(fb-fbt, fb-fbbase, fb_offset + offset, + prot, BUS_SPACE_MAP_LINEAR); + return pa; + } + return -1; } void
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: bouyer Date: Fri Jan 24 12:16:10 UTC 2014 Modified Files: src/sys/compat/netbsd32: netbsd32_ioctl.c Log Message: Support WSDISPLAYIO_GETCMAP/WSDISPLAYIO_PUTCMAP. Tested on evbmips/loongson To generate a diff of this commit: cvs rdiff -u -r1.68 -r1.69 src/sys/compat/netbsd32/netbsd32_ioctl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/netbsd32_ioctl.c diff -u src/sys/compat/netbsd32/netbsd32_ioctl.c:1.68 src/sys/compat/netbsd32/netbsd32_ioctl.c:1.69 --- src/sys/compat/netbsd32/netbsd32_ioctl.c:1.68 Fri Jan 24 10:41:07 2014 +++ src/sys/compat/netbsd32/netbsd32_ioctl.c Fri Jan 24 12:16:10 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_ioctl.c,v 1.68 2014/01/24 10:41:07 manu Exp $ */ +/* $NetBSD: netbsd32_ioctl.c,v 1.69 2014/01/24 12:16:10 bouyer Exp $ */ /* * Copyright (c) 1998, 2001 Matthew R. Green @@ -31,7 +31,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: netbsd32_ioctl.c,v 1.68 2014/01/24 10:41:07 manu Exp $); +__KERNEL_RCSID(0, $NetBSD: netbsd32_ioctl.c,v 1.69 2014/01/24 12:16:10 bouyer Exp $); #include sys/param.h #include sys/systm.h @@ -335,6 +335,18 @@ netbsd32_to_wsdisplay_cursor(struct netb } static inline void +netbsd32_to_wsdisplay_cmap(struct netbsd32_wsdisplay_cmap *c32, + struct wsdisplay_cmap *c, + u_long cmd) +{ + c-index = c32-index; + c-count = c32-count; + c-red = NETBSD32PTR64(c32-red); + c-green = NETBSD32PTR64(c32-green); + c-blue = NETBSD32PTR64(c32-blue); +} + +static inline void netbsd32_to_clockctl_settimeofday( const struct netbsd32_clockctl_settimeofday *s32p, struct clockctl_settimeofday *p, @@ -593,6 +605,18 @@ netbsd32_from_wsdisplay_cursor(struct ws } static inline void +netbsd32_from_wsdisplay_cmap(struct wsdisplay_cmap *c, + struct netbsd32_wsdisplay_cmap *c32, + u_long cmd) +{ + c32-index = c-index; + c32-count = c-count; + NETBSD32PTR32(c32-red, c-red); + NETBSD32PTR32(c32-green, c-green); + NETBSD32PTR32(c32-blue, c-blue); +} + +static inline void netbsd32_from_ieee80211req(struct ieee80211req *ireq, struct netbsd32_ieee80211req *ireq32, u_long cmd) { @@ -1011,6 +1035,11 @@ netbsd32_ioctl(struct lwp *l, const stru case WSDISPLAYIO_SCURSOR32: IOCTL_STRUCT_CONV_TO(WSDISPLAYIO_SCURSOR, wsdisplay_cursor); + case WSDISPLAYIO_GETCMAP32: + IOCTL_STRUCT_CONV_TO(WSDISPLAYIO_GETCMAP, wsdisplay_cmap); + case WSDISPLAYIO_PUTCMAP32: + IOCTL_STRUCT_CONV_TO(WSDISPLAYIO_PUTCMAP, wsdisplay_cmap); + case SIOCS8021132: IOCTL_STRUCT_CONV_TO(SIOCS80211, ieee80211req); case SIOCG8021132:
CVS commit: src/distrib/vax/ramdisk
Module Name:src Committed By: martin Date: Fri Jan 24 12:19:10 UTC 2014 Modified Files: src/distrib/vax/ramdisk: Makefile Log Message: Slightly bump ramdisk size, so the content fits even when compiled with gcc 4.8 (usually binaries are smaller or same size, this increase is strange) To generate a diff of this commit: cvs rdiff -u -r1.32 -r1.33 src/distrib/vax/ramdisk/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/vax/ramdisk/Makefile diff -u src/distrib/vax/ramdisk/Makefile:1.32 src/distrib/vax/ramdisk/Makefile:1.33 --- src/distrib/vax/ramdisk/Makefile:1.32 Wed Nov 27 19:54:10 2013 +++ src/distrib/vax/ramdisk/Makefile Fri Jan 24 12:19:10 2014 @@ -1,10 +1,10 @@ -# $NetBSD: Makefile,v 1.32 2013/11/27 19:54:10 martin Exp $ +# $NetBSD: Makefile,v 1.33 2014/01/24 12:19:10 martin Exp $ .include bsd.own.mk .include ${NETBSDSRCDIR}/distrib/common/Makefile.distrib IMAGE= ramdisk.fs -IMAGESIZE= 1664k +IMAGESIZE= 1760k MAKEFS_FLAGS= -f 15 WARNS= 1
CVS import: src/sys/external/bsd/compiler_rt/dist
Module Name:src Committed By: joerg Date: Fri Jan 24 14:52:08 UTC 2014 Update of /cvsroot/src/sys/external/bsd/compiler_rt/dist In directory ivanova.netbsd.org:/tmp/cvs-serv908 Log Message: Import compiler-rt r27. Use .size on all assembler functions. Reimplement ARM division based on Matt Thomas's common version. Status: Vendor Tag: LLVM Release Tags: compiler-rt-27 U src/sys/external/bsd/compiler_rt/dist/CREDITS.TXT U src/sys/external/bsd/compiler_rt/dist/README.txt U src/sys/external/bsd/compiler_rt/dist/LICENSE.TXT U src/sys/external/bsd/compiler_rt/dist/lib/subsf3.c U src/sys/external/bsd/compiler_rt/dist/lib/udivmoddi4.c U src/sys/external/bsd/compiler_rt/dist/lib/negdi2.c U src/sys/external/bsd/compiler_rt/dist/lib/mulsf3.c U src/sys/external/bsd/compiler_rt/dist/lib/floatunsidf.c U src/sys/external/bsd/compiler_rt/dist/lib/cmpdi2.c U src/sys/external/bsd/compiler_rt/dist/lib/moddi3.c U src/sys/external/bsd/compiler_rt/dist/lib/fixunsdfti.c U src/sys/external/bsd/compiler_rt/dist/lib/popcountsi2.c U src/sys/external/bsd/compiler_rt/dist/lib/adddf3.c U src/sys/external/bsd/compiler_rt/dist/lib/negti2.c U src/sys/external/bsd/compiler_rt/dist/lib/udivmodti4.c U src/sys/external/bsd/compiler_rt/dist/lib/absvdi2.c U src/sys/external/bsd/compiler_rt/dist/lib/cmpti2.c U src/sys/external/bsd/compiler_rt/dist/lib/modti3.c U src/sys/external/bsd/compiler_rt/dist/lib/fixunssfsi.c U src/sys/external/bsd/compiler_rt/dist/lib/clzsi2.c U src/sys/external/bsd/compiler_rt/dist/lib/absvti2.c U src/sys/external/bsd/compiler_rt/dist/lib/ctzsi2.c U src/sys/external/bsd/compiler_rt/dist/lib/comparedf2.c U src/sys/external/bsd/compiler_rt/dist/lib/floatundixf.c U src/sys/external/bsd/compiler_rt/dist/lib/int_lib.h U src/sys/external/bsd/compiler_rt/dist/lib/udivsi3.c U src/sys/external/bsd/compiler_rt/dist/lib/divsc3.c U src/sys/external/bsd/compiler_rt/dist/lib/mulosi4.c U src/sys/external/bsd/compiler_rt/dist/lib/fixsfdi.c U src/sys/external/bsd/compiler_rt/dist/lib/enable_execute_stack.c U src/sys/external/bsd/compiler_rt/dist/lib/floatuntixf.c U src/sys/external/bsd/compiler_rt/dist/lib/fixunsxfsi.c U src/sys/external/bsd/compiler_rt/dist/lib/clear_cache.c U src/sys/external/bsd/compiler_rt/dist/lib/powidf2.c U src/sys/external/bsd/compiler_rt/dist/lib/floatsidf.c U src/sys/external/bsd/compiler_rt/dist/lib/fixsfti.c U src/sys/external/bsd/compiler_rt/dist/lib/ffsdi2.c U src/sys/external/bsd/compiler_rt/dist/lib/negvsi2.c U src/sys/external/bsd/compiler_rt/dist/lib/floatundisf.c U src/sys/external/bsd/compiler_rt/dist/lib/subvdi3.c U src/sys/external/bsd/compiler_rt/dist/lib/umodsi3.c U src/sys/external/bsd/compiler_rt/dist/lib/muldc3.c U src/sys/external/bsd/compiler_rt/dist/lib/trampoline_setup.c U src/sys/external/bsd/compiler_rt/dist/lib/powitf2.c U src/sys/external/bsd/compiler_rt/dist/lib/ffsti2.c U src/sys/external/bsd/compiler_rt/dist/lib/addvsi3.c U src/sys/external/bsd/compiler_rt/dist/lib/powixf2.c U src/sys/external/bsd/compiler_rt/dist/lib/divsf3.c U src/sys/external/bsd/compiler_rt/dist/lib/floatuntisf.c U src/sys/external/bsd/compiler_rt/dist/lib/subvti3.c U src/sys/external/bsd/compiler_rt/dist/lib/fixxfdi.c U src/sys/external/bsd/compiler_rt/dist/lib/mulvsi3.c U src/sys/external/bsd/compiler_rt/dist/lib/paritydi2.c U src/sys/external/bsd/compiler_rt/dist/lib/int_math.h U src/sys/external/bsd/compiler_rt/dist/lib/mulxc3.c U src/sys/external/bsd/compiler_rt/dist/lib/floatdixf.c U src/sys/external/bsd/compiler_rt/dist/lib/fixxfti.c U src/sys/external/bsd/compiler_rt/dist/lib/fixunssfdi.c U src/sys/external/bsd/compiler_rt/dist/lib/divmoddi4.c U src/sys/external/bsd/compiler_rt/dist/lib/negsf2.c U src/sys/external/bsd/compiler_rt/dist/lib/subdf3.c U src/sys/external/bsd/compiler_rt/dist/lib/parityti2.c U src/sys/external/bsd/compiler_rt/dist/lib/muldf3.c U src/sys/external/bsd/compiler_rt/dist/lib/fixdfsi.c U src/sys/external/bsd/compiler_rt/dist/lib/ashrdi3.c U src/sys/external/bsd/compiler_rt/dist/lib/floattixf.c U src/sys/external/bsd/compiler_rt/dist/lib/fp_lib.h U src/sys/external/bsd/compiler_rt/dist/lib/divsi3.c U src/sys/external/bsd/compiler_rt/dist/lib/fixunssfti.c U src/sys/external/bsd/compiler_rt/dist/lib/popcountdi2.c U src/sys/external/bsd/compiler_rt/dist/lib/lshrdi3.c U src/sys/external/bsd/compiler_rt/dist/lib/floatdisf.c U src/sys/external/bsd/compiler_rt/dist/lib/extendsfdf2.c U src/sys/external/bsd/compiler_rt/dist/lib/ashrti3.c U src/sys/external/bsd/compiler_rt/dist/lib/int_types.h U src/sys/external/bsd/compiler_rt/dist/lib/popcountti2.c U src/sys/external/bsd/compiler_rt/dist/lib/clzdi2.c U src/sys/external/bsd/compiler_rt/dist/lib/fixunsxfdi.c U src/sys/external/bsd/compiler_rt/dist/lib/udivmodsi4.c U src/sys/external/bsd/compiler_rt/dist/lib/lshrti3.c U src/sys/external/bsd/compiler_rt/dist/lib/gcc_personality_v0.c U src/sys/external/bsd/compiler_rt/dist/lib/floattisf.c U src/sys/external/bsd/compiler_rt/dist/lib/muldi3.c U
CVS commit: src/sys/opencrypto
Module Name:src Committed By: pgoyette Date: Fri Jan 24 15:11:09 UTC 2014 Modified Files: src/sys/opencrypto: cryptodev.c Log Message: As requested by mrg@, since there is still a small window during which the in-module ref-counting can fail, completely disable auto-unload. To generate a diff of this commit: cvs rdiff -u -r1.74 -r1.75 src/sys/opencrypto/cryptodev.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/opencrypto/cryptodev.c diff -u src/sys/opencrypto/cryptodev.c:1.74 src/sys/opencrypto/cryptodev.c:1.75 --- src/sys/opencrypto/cryptodev.c:1.74 Tue Jan 21 20:33:01 2014 +++ src/sys/opencrypto/cryptodev.c Fri Jan 24 15:11:09 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: cryptodev.c,v 1.74 2014/01/21 20:33:01 pgoyette Exp $ */ +/* $NetBSD: cryptodev.c,v 1.75 2014/01/24 15:11:09 pgoyette Exp $ */ /* $FreeBSD: src/sys/opencrypto/cryptodev.c,v 1.4.2.4 2003/06/03 00:09:02 sam Exp $ */ /* $OpenBSD: cryptodev.c,v 1.53 2002/07/10 22:21:30 mickey Exp $ */ @@ -64,7 +64,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: cryptodev.c,v 1.74 2014/01/21 20:33:01 pgoyette Exp $); +__KERNEL_RCSID(0, $NetBSD: cryptodev.c,v 1.75 2014/01/24 15:11:09 pgoyette Exp $); #include sys/param.h #include sys/systm.h @@ -2224,7 +2224,12 @@ crypto_modcmd(modcmd_t cmd, void *arg) return error; #ifdef _MODULE case MODULE_CMD_AUTOUNLOAD: +#if 0 /* + * XXX Completely disable auto-unload for now, since there is still + * XXX a (small) window where in-module ref-counting doesn't help + */ if (crypto_refcount != 0) +#endif return EBUSY; /* FALLTHROUGH */ #endif
CVS commit: src/lib/libc/net
Module Name:src Committed By: christos Date: Fri Jan 24 17:26:18 UTC 2014 Modified Files: src/lib/libc/net: gethnamaddr.c Log Message: CID 1163170, 1164171, resource leak CID 1161172 double free To generate a diff of this commit: cvs rdiff -u -r1.89 -r1.90 src/lib/libc/net/gethnamaddr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/net/gethnamaddr.c diff -u src/lib/libc/net/gethnamaddr.c:1.89 src/lib/libc/net/gethnamaddr.c:1.90 --- src/lib/libc/net/gethnamaddr.c:1.89 Fri Jan 17 07:39:47 2014 +++ src/lib/libc/net/gethnamaddr.c Fri Jan 24 12:26:18 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: gethnamaddr.c,v 1.89 2014/01/17 12:39:47 drochner Exp $ */ +/* $NetBSD: gethnamaddr.c,v 1.90 2014/01/24 17:26:18 christos Exp $ */ /* * ++Copyright++ 1985, 1988, 1993 @@ -57,7 +57,7 @@ static char sccsid[] = @(#)gethostnamadr.c 8.1 (Berkeley) 6/4/93; static char rcsid[] = Id: gethnamaddr.c,v 8.21 1997/06/01 20:34:37 vixie Exp ; #else -__RCSID($NetBSD: gethnamaddr.c,v 1.89 2014/01/17 12:39:47 drochner Exp $); +__RCSID($NetBSD: gethnamaddr.c,v 1.90 2014/01/24 17:26:18 christos Exp $); #endif #endif /* LIBC_SCCS and not lint */ @@ -199,18 +199,14 @@ debugprintf(const char *msg, res_state r #define BOUNDED_INCR(x) \ do { \ cp += (x); \ - if (cp eom) { \ - h_errno = NO_RECOVERY; \ - return NULL; \ - } \ + if (cp eom) \ + goto no_recovery; \ } while (/*CONSTCOND*/0) #define BOUNDS_CHECK(ptr, count) \ do { \ - if ((ptr) + (count) eom) { \ - h_errno = NO_RECOVERY; \ - return NULL; \ - } \ + if ((ptr) + (count) eom) \ + goto no_recovery; \ } while (/*CONSTCOND*/0) static struct hostent * @@ -503,6 +499,7 @@ success: hent-h_aliases = (void *)bp; memcpy(bp, aliases, qlen); free(aliases); + aliases = NULL; bp += qlen; n = (int)(hap - addr_ptrs);
CVS commit: src/usr.bin/vndcompress
Module Name:src Committed By: christos Date: Fri Jan 24 17:30:18 UTC 2014 Modified Files: src/usr.bin/vndcompress: vndcompress.c Log Message: CID 1164169: integer overflow To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 src/usr.bin/vndcompress/vndcompress.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/vndcompress/vndcompress.c diff -u src/usr.bin/vndcompress/vndcompress.c:1.22 src/usr.bin/vndcompress/vndcompress.c:1.23 --- src/usr.bin/vndcompress/vndcompress.c:1.22 Wed Jan 22 01:18:00 2014 +++ src/usr.bin/vndcompress/vndcompress.c Fri Jan 24 12:30:18 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: vndcompress.c,v 1.22 2014/01/22 06:18:00 riastradh Exp $ */ +/* $NetBSD: vndcompress.c,v 1.23 2014/01/24 17:30:18 christos Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include sys/cdefs.h -__RCSID($NetBSD: vndcompress.c,v 1.22 2014/01/22 06:18:00 riastradh Exp $); +__RCSID($NetBSD: vndcompress.c,v 1.23 2014/01/24 17:30:18 christos Exp $); #include sys/endian.h @@ -598,11 +598,11 @@ compress_restart(struct compress_state * if (!offtab_prepare_get(S-offtab, 0)) return false; const uint64_t first_offset = offtab_get(S-offtab, 0); - if (first_offset != (sizeof(struct cloop2_header) + - (S-n_offsets * sizeof(uint64_t { + const uint64_t expected = sizeof(struct cloop2_header) + + ((uint64_t)S-n_offsets * sizeof(uint64_t)); + if (first_offset != expected) { warnx(first offset is not 0x%PRIx64: 0x%PRIx64, - ((uint64_t)S-n_offsets * sizeof(uint64_t)), - first_offset); + expected, first_offset); return false; }
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: christos Date: Fri Jan 24 22:10:09 UTC 2014 Modified Files: src/sys/compat/netbsd32: netbsd32_compat_20.c Log Message: Fix locking botch, and ... Yes, we want to be careful because the sizes are different. To generate a diff of this commit: cvs rdiff -u -r1.31 -r1.32 src/sys/compat/netbsd32/netbsd32_compat_20.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/netbsd32_compat_20.c diff -u src/sys/compat/netbsd32/netbsd32_compat_20.c:1.31 src/sys/compat/netbsd32/netbsd32_compat_20.c:1.32 --- src/sys/compat/netbsd32/netbsd32_compat_20.c:1.31 Wed Nov 27 12:24:44 2013 +++ src/sys/compat/netbsd32/netbsd32_compat_20.c Fri Jan 24 17:10:09 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_compat_20.c,v 1.31 2013/11/27 17:24:44 christos Exp $ */ +/* $NetBSD: netbsd32_compat_20.c,v 1.32 2014/01/24 22:10:09 christos Exp $ */ /* * Copyright (c) 1998, 2001 Matthew R. Green @@ -27,7 +27,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: netbsd32_compat_20.c,v 1.31 2013/11/27 17:24:44 christos Exp $); +__KERNEL_RCSID(0, $NetBSD: netbsd32_compat_20.c,v 1.32 2014/01/24 22:10:09 christos Exp $); #include sys/param.h #include sys/systm.h @@ -67,21 +67,12 @@ compat_20_netbsd32_from_statvfs(struct s sb32p-f_spare[1] = 0; sb32p-f_spare[2] = 0; sb32p-f_spare[3] = 0; -#if 1 - /* May as well do the whole batch in one go */ - (void)memcpy(sb32p-f_fstypename, sbp-f_fstypename, - sizeof(sb32p-f_fstypename) + - sizeof(sb32p-f_mntonname) + - sizeof(sb32p-f_mntfromname)); -#else - /* If we want to be careful */ (void)memcpy(sb32p-f_fstypename, sbp-f_fstypename, sizeof(sb32p-f_fstypename)); (void)memcpy(sb32p-f_mntonname, sbp-f_mntonname, sizeof(sb32p-f_mntonname)); (void)memcpy(sb32p-f_mntfromname, sbp-f_mntfromname, sizeof(sb32p-f_mntfromname)); -#endif } int @@ -92,12 +83,16 @@ compat_20_netbsd32_getfsstat(struct lwp syscallarg(netbsd32_long) bufsize; syscallarg(int) flags; } */ + int root = 0; + struct proc *p = l-l_proc; struct mount *mp, *nmp; - struct statvfs *sp; + struct statvfs *sb; struct netbsd32_statfs sb32; void *sfsp; - long count, maxcount, error; + size_t count, maxcount; + int error = 0; + sb = STATVFSBUF_GET(); maxcount = SCARG(uap, bufsize) / sizeof(struct netbsd32_statfs); sfsp = SCARG_P32(uap, buf); mutex_enter(mountlist_lock); @@ -107,40 +102,52 @@ compat_20_netbsd32_getfsstat(struct lwp continue; } if (sfsp count maxcount) { - sp = mp-mnt_stat; - /* - * If MNT_NOWAIT or MNT_LAZY is specified, do not - * refresh the fsstat cache. MNT_WAIT or MNT_LAZY - * overrides MNT_NOWAIT. - */ - if (SCARG(uap, flags) != MNT_NOWAIT - SCARG(uap, flags) != MNT_LAZY - (SCARG(uap, flags) == MNT_WAIT || - SCARG(uap, flags) == 0) - (error = VFS_STATVFS(mp, sp)) != 0) { -mutex_enter(mountlist_lock); + error = dostatvfs(mp, sb, l, SCARG(uap, flags), 0); + if (error) { vfs_unbusy(mp, false, nmp); +error = 0; continue; } - sp-f_flag = mp-mnt_flag MNT_VISFLAGMASK; - compat_20_netbsd32_from_statvfs(sp, sb32); + sb-f_flag = mp-mnt_flag MNT_VISFLAGMASK; + compat_20_netbsd32_from_statvfs(sb, sb32); error = copyout(sb32, sfsp, sizeof(sb32)); if (error) { vfs_unbusy(mp, false, NULL); -return (error); +goto out; } sfsp = (char *)sfsp + sizeof(sb32); + root |= strcmp(sb-f_mntonname, /) == 0; } count++; - mutex_enter(mountlist_lock); vfs_unbusy(mp, false, nmp); } mutex_exit(mountlist_lock); + + if (root == 0 p-p_cwdi-cwdi_rdir) { + /* + * fake a root entry + */ + error = dostatvfs(p-p_cwdi-cwdi_rdir-v_mount, + sb, l, SCARG(uap, flags), 1); + if (error != 0) + goto out; + if (sfsp) { + sb-f_flag = mp-mnt_flag MNT_VISFLAGMASK; + compat_20_netbsd32_from_statvfs(sb, sb32); + error = copyout(sb32, sfsp, sizeof(sb32)); + if (error != 0) +goto out; + } + count++; + } + if (sfsp count maxcount) *retval = maxcount; else *retval = count; - return (0); +out: + STATVFSBUF_PUT(sb); + return error; } int @@ -151,7 +158,7 @@ compat_20_netbsd32_statfs(struct lwp *l, syscallarg(netbsd32_statfsp_t) buf; } */ struct mount *mp; - struct statvfs *sp; + struct statvfs *sb; struct netbsd32_statfs s32; int error; struct vnode *vp; @@ -161,12 +168,12 @@ compat_20_netbsd32_statfs(struct lwp *l, if (error != 0) return (error); mp = vp-v_mount; - sp = mp-mnt_stat; + sb = mp-mnt_stat; vrele(vp); - if ((error = VFS_STATVFS(mp, sp)) != 0) + if ((error = dostatvfs(mp, sb, l, 0, 0)) != 0) return (error); - sp-f_flag = mp-mnt_flag MNT_VISFLAGMASK; - compat_20_netbsd32_from_statvfs(sp, s32); + sb-f_flag = mp-mnt_flag MNT_VISFLAGMASK; + compat_20_netbsd32_from_statvfs(sb, s32); return copyout(s32, SCARG_P32(uap, buf),
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: christos Date: Fri Jan 24 22:10:48 UTC 2014 Modified Files: src/sys/compat/netbsd32: netbsd32.h netbsd32_signal.c Log Message: sigaction until 1.4 had an int sigmask, don't trash the stack. To generate a diff of this commit: cvs rdiff -u -r1.97 -r1.98 src/sys/compat/netbsd32/netbsd32.h cvs rdiff -u -r1.37 -r1.38 src/sys/compat/netbsd32/netbsd32_signal.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/netbsd32.h diff -u src/sys/compat/netbsd32/netbsd32.h:1.97 src/sys/compat/netbsd32/netbsd32.h:1.98 --- src/sys/compat/netbsd32/netbsd32.h:1.97 Wed Jan 1 13:57:16 2014 +++ src/sys/compat/netbsd32/netbsd32.h Fri Jan 24 17:10:47 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32.h,v 1.97 2014/01/01 18:57:16 dsl Exp $ */ +/* $NetBSD: netbsd32.h,v 1.98 2014/01/24 22:10:47 christos Exp $ */ /* * Copyright (c) 1998, 2001, 2008 Matthew R. Green @@ -48,6 +48,7 @@ #include sys/ucred.h #include compat/sys/ucontext.h #include compat/sys/mount.h +#include compat/sys/signal.h /* * first, define the basic types we need. @@ -586,6 +587,12 @@ struct netbsd32_shmid_ds14 { /* from sys/signal.h */ typedef netbsd32_pointer_t netbsd32_sigsetp_t; typedef netbsd32_pointer_t netbsd32_sigactionp_t; +struct netbsd32_sigaction13 { + netbsd32_voidp netbsd32_sa_handler; /* signal handler */ + sigset13_t netbsd32_sa_mask; /* signal mask to apply */ + int netbsd32_sa_flags; /* see signal options below */ +}; + struct netbsd32_sigaction { netbsd32_voidp netbsd32_sa_handler; /* signal handler */ sigset_t netbsd32_sa_mask; /* signal mask to apply */ Index: src/sys/compat/netbsd32/netbsd32_signal.c diff -u src/sys/compat/netbsd32/netbsd32_signal.c:1.37 src/sys/compat/netbsd32/netbsd32_signal.c:1.38 --- src/sys/compat/netbsd32/netbsd32_signal.c:1.37 Sun Feb 19 16:06:41 2012 +++ src/sys/compat/netbsd32/netbsd32_signal.c Fri Jan 24 17:10:47 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_signal.c,v 1.37 2012/02/19 21:06:41 rmind Exp $ */ +/* $NetBSD: netbsd32_signal.c,v 1.38 2014/01/24 22:10:47 christos Exp $ */ /* * Copyright (c) 1998, 2001 Matthew R. Green @@ -27,7 +27,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: netbsd32_signal.c,v 1.37 2012/02/19 21:06:41 rmind Exp $); +__KERNEL_RCSID(0, $NetBSD: netbsd32_signal.c,v 1.38 2014/01/24 22:10:47 christos Exp $); #include sys/param.h #include sys/systm.h @@ -65,7 +65,7 @@ netbsd32_sigaction(struct lwp *l, const syscallarg(netbsd32_sigactionp_t) osa; } */ struct sigaction nsa, osa; - struct netbsd32_sigaction *sa32p, sa32; + struct netbsd32_sigaction13 *sa32p, sa32; int error; if (SCARG_P32(uap, nsa)) { @@ -73,7 +73,8 @@ netbsd32_sigaction(struct lwp *l, const if (copyin(sa32p, sa32, sizeof(sa32))) return EFAULT; nsa.sa_handler = (void *)NETBSD32PTR64(sa32.netbsd32_sa_handler); - nsa.sa_mask = sa32.netbsd32_sa_mask; + memset(nsa.sa_mask, 0, sizeof(nsa.sa_mask)); + nsa.sa_mask.__bits[0] = sa32.netbsd32_sa_mask; nsa.sa_flags = sa32.netbsd32_sa_flags; } error = sigaction1(l, SCARG(uap, signum), @@ -86,7 +87,7 @@ netbsd32_sigaction(struct lwp *l, const if (SCARG_P32(uap, osa)) { NETBSD32PTR32(sa32.netbsd32_sa_handler, osa.sa_handler); - sa32.netbsd32_sa_mask = osa.sa_mask; + sa32.netbsd32_sa_mask = osa.sa_mask.__bits[0]; sa32.netbsd32_sa_flags = osa.sa_flags; sa32p = SCARG_P32(uap, osa); if (copyout(sa32, sa32p, sizeof(sa32)))
CVS commit: src/sys/compat/common
Module Name:src Committed By: christos Date: Fri Jan 24 22:11:46 UTC 2014 Modified Files: src/sys/compat/common: vfs_syscalls_12.c Log Message: It is wishful thinking that vn_readdir will return dirent12 structures. To generate a diff of this commit: cvs rdiff -u -r1.29 -r1.30 src/sys/compat/common/vfs_syscalls_12.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/common/vfs_syscalls_12.c diff -u src/sys/compat/common/vfs_syscalls_12.c:1.29 src/sys/compat/common/vfs_syscalls_12.c:1.30 --- src/sys/compat/common/vfs_syscalls_12.c:1.29 Wed Jan 19 05:21:16 2011 +++ src/sys/compat/common/vfs_syscalls_12.c Fri Jan 24 17:11:46 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: vfs_syscalls_12.c,v 1.29 2011/01/19 10:21:16 tsutsui Exp $ */ +/* $NetBSD: vfs_syscalls_12.c,v 1.30 2014/01/24 22:11:46 christos Exp $ */ /* * Copyright (c) 1989, 1993 @@ -37,7 +37,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: vfs_syscalls_12.c,v 1.29 2011/01/19 10:21:16 tsutsui Exp $); +__KERNEL_RCSID(0, $NetBSD: vfs_syscalls_12.c,v 1.30 2014/01/24 22:11:46 christos Exp $); #include sys/param.h #include sys/systm.h @@ -56,6 +56,7 @@ __KERNEL_RCSID(0, $NetBSD: vfs_syscalls #include sys/syscallargs.h #include compat/sys/stat.h +#include compat/sys/dirent.h /* * Convert from a new to an old stat structure. @@ -96,28 +97,140 @@ compat_12_sys_getdirentries(struct lwp * syscallarg(u_int) count; syscallarg(long *) basep; } */ + struct dirent *bdp; + struct vnode *vp; + char *inp, *tbuf; /* Current-format */ + int len, reclen; /* Current-format */ + char *outp; /* Dirent12-format */ + int resid, old_reclen = 0; /* Dirent12-format */ struct file *fp; - int error, done; + struct uio auio; + struct iovec aiov; + struct dirent12 idb; + off_t off; /* true file offset */ + int buflen, error, eofflag, nbytes; + struct vattr va; + off_t *cookiebuf = NULL, *cookie; + int ncookies; long loff; - + /* fd_getvnode() will use the descriptor for us */ if ((error = fd_getvnode(SCARG(uap, fd), fp)) != 0) - return error; + return (error); + if ((fp-f_flag FREAD) == 0) { error = EBADF; - goto out; + goto out1; + } + + vp = (struct vnode *)fp-f_data; + if (vp-v_type != VDIR) { + error = ENOTDIR; + goto out1; } + vn_lock(vp, LK_SHARED | LK_RETRY); + error = VOP_GETATTR(vp, va, l-l_cred); + VOP_UNLOCK(vp); + if (error) + goto out1; + loff = fp-f_offset; + nbytes = SCARG(uap, count); + buflen = min(MAXBSIZE, nbytes); + if (buflen va.va_blocksize) + buflen = va.va_blocksize; + tbuf = malloc(buflen, M_TEMP, M_WAITOK); + + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + off = fp-f_offset; +again: + aiov.iov_base = tbuf; + aiov.iov_len = buflen; + auio.uio_iov = aiov; + auio.uio_iovcnt = 1; + auio.uio_rw = UIO_READ; + auio.uio_resid = buflen; + auio.uio_offset = off; + UIO_SETUP_SYSSPACE(auio); + /* + * First we read into the malloc'ed buffer, then + * we massage it into user space, one record at a time. + */ + error = VOP_READDIR(vp, auio, fp-f_cred, eofflag, cookiebuf, + ncookies); + if (error) + goto out; + + inp = tbuf; + outp = SCARG(uap, buf); + resid = nbytes; + if ((len = buflen - auio.uio_resid) == 0) + goto eof; + + for (cookie = cookiebuf; len 0; len -= reclen) { + bdp = (struct dirent *)inp; + reclen = bdp-d_reclen; + if (reclen 3) + panic(__func__); + if (bdp-d_fileno == 0) { + inp += reclen; /* it is a hole; squish it out */ + if (cookie) +off = *cookie++; + else +off += reclen; + continue; + } + old_reclen = _DIRENT_RECLEN(idb, bdp-d_namlen); + if (reclen len || resid old_reclen) { + /* entry too big for buffer, so just stop */ + outp++; + break; + } + /* + * Massage in place to make a Dirent12-shaped dirent (otherwise + * we have to worry about touching user memory outside of + * the copyout() call). + */ + idb.d_fileno = (uint32_t)bdp-d_fileno; + idb.d_reclen = (uint16_t)old_reclen; + idb.d_type = (uint8_t)bdp-d_type; + idb.d_namlen = (uint8_t)bdp-d_namlen; + strcpy(idb.d_name, bdp-d_name); + if ((error = copyout(idb, outp, old_reclen))) + goto out; + /* advance past this real entry */ + inp += reclen; + if (cookie) + off = *cookie++; /* each entry points to itself */ + else + off += reclen; + /* advance output past Dirent12-shaped entry */ + outp += old_reclen; + resid -= old_reclen; + } - error = vn_readdir(fp, SCARG(uap, buf), UIO_USERSPACE, - SCARG(uap, count), done, l, 0, 0); + /* if we squished out the whole block, try again */ + if (outp == SCARG(uap, buf)) { + if (cookiebuf) + free(cookiebuf, M_TEMP); + cookiebuf = NULL; + goto again; + } + fp-f_offset = off; /* update the vnode offset */ - error = copyout(loff, SCARG(uap, basep), sizeof(long)); - *retval = done; - out: +eof: + *retval = nbytes - resid; +out: + VOP_UNLOCK(vp); + if (cookiebuf) + free(cookiebuf,
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: christos Date: Fri Jan 24 22:44:00 UTC 2014 Modified Files: src/sys/compat/netbsd32: netbsd32_compat_13.c Log Message: need to lock the process. To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 src/sys/compat/netbsd32/netbsd32_compat_13.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/netbsd32_compat_13.c diff -u src/sys/compat/netbsd32/netbsd32_compat_13.c:1.25 src/sys/compat/netbsd32/netbsd32_compat_13.c:1.26 --- src/sys/compat/netbsd32/netbsd32_compat_13.c:1.25 Thu May 29 10:51:26 2008 +++ src/sys/compat/netbsd32/netbsd32_compat_13.c Fri Jan 24 17:44:00 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_compat_13.c,v 1.25 2008/05/29 14:51:26 mrg Exp $ */ +/* $NetBSD: netbsd32_compat_13.c,v 1.26 2014/01/24 22:44:00 christos Exp $ */ /* * Copyright (c) 1998, 2001 Matthew R. Green @@ -27,7 +27,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: netbsd32_compat_13.c,v 1.25 2008/05/29 14:51:26 mrg Exp $); +__KERNEL_RCSID(0, $NetBSD: netbsd32_compat_13.c,v 1.26 2014/01/24 22:44:00 christos Exp $); #include sys/param.h #include sys/systm.h @@ -62,11 +62,14 @@ compat_13_netbsd32_sigprocmask(struct lw } */ sigset13_t ness, oess; sigset_t nbss, obss; + struct proc *p = l-l_proc; int error; ness = SCARG(uap, mask); native_sigset13_to_sigset(ness, nbss); + mutex_enter(p-p_lock); error = sigprocmask1(l, SCARG(uap, how), nbss, obss); + mutex_exit(p-p_lock); if (error) return (error); native_sigset_to_sigset13(obss, oess);
CVS commit: src/sys/arch/alpha/conf
Module Name:src Committed By: martin Date: Fri Jan 24 23:59:53 UTC 2014 Modified Files: src/sys/arch/alpha/conf: INSTALL Log Message: Add raid to the install kernel To generate a diff of this commit: cvs rdiff -u -r1.105 -r1.106 src/sys/arch/alpha/conf/INSTALL Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/alpha/conf/INSTALL diff -u src/sys/arch/alpha/conf/INSTALL:1.105 src/sys/arch/alpha/conf/INSTALL:1.106 --- src/sys/arch/alpha/conf/INSTALL:1.105 Wed Jan 22 11:45:16 2014 +++ src/sys/arch/alpha/conf/INSTALL Fri Jan 24 23:59:53 2014 @@ -1,4 +1,4 @@ -# $NetBSD: INSTALL,v 1.105 2014/01/22 11:45:16 tsutsui Exp $ +# $NetBSD: INSTALL,v 1.106 2014/01/24 23:59:53 martin Exp $ # # Alpha INSTALL kernel. @@ -341,6 +341,9 @@ wsmouse* at vsms? wskbd* at pckbd? wsmouse* at pms? +pseudo-device raid # RAIDframe disk driver +options RAID_AUTOCONFIG # auto-configuration of RAID components + pseudo-device bpfilter pseudo-device loop pseudo-device md
CVS commit: src/sys/arch/x68k/include
Module Name:src Committed By: tsutsui Date: Sat Jan 25 00:07:48 UTC 2014 Modified Files: src/sys/arch/x68k/include: vmparam.h Log Message: Increase VM_KERNEL_PT_PAGES from 2 to 4 for x68k. X68030 with 8MB or 12MB RAM (which is default for most X68030s) now gets pmap_enter_ptpage: can't get KPT page panic again with VM_KERNEL_PT_PAGES=2 while it works with =14MB. 3 is enough to boot for now, but I also add a spare. I guess this is because the post netbsd-6 vmem(9) bootstrap changes require more kernel memory before MD pmap_init(). Note1: netbsd-6 (which also pulls physmem detection changes that affect nptpages) doesn't have this problem. Note2: other hp300 pmap based m68k ports might have the same issue, but at least 12MB luna68k works with VM_KERNEL_PT_PAGES=2 so I think it depends on kernel size and/or iomapsize. To generate a diff of this commit: cvs rdiff -u -r1.35 -r1.36 src/sys/arch/x68k/include/vmparam.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/x68k/include/vmparam.h diff -u src/sys/arch/x68k/include/vmparam.h:1.35 src/sys/arch/x68k/include/vmparam.h:1.36 --- src/sys/arch/x68k/include/vmparam.h:1.35 Sat Jan 21 20:19:55 2012 +++ src/sys/arch/x68k/include/vmparam.h Sat Jan 25 00:07:48 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: vmparam.h,v 1.35 2012/01/21 20:19:55 tsutsui Exp $ */ +/* $NetBSD: vmparam.h,v 1.36 2014/01/25 00:07:48 tsutsui Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -107,7 +107,7 @@ #define VM_PHYS_SIZE (USRIOSIZE*PAGE_SIZE) /* # of kernel PT pages (initial only, can grow dynamically) */ -#define VM_KERNEL_PT_PAGES ((vsize_t)2) /* XXX: SYSPTSIZE */ +#define VM_KERNEL_PT_PAGES ((vsize_t)4) /* XXX: SYSPTSIZE */ /* * Constants which control the way the VM system deals with memory segments.
CVS commit: src/etc/etc.alpha
Module Name:src Committed By: martin Date: Fri Jan 24 23:59:12 UTC 2014 Modified Files: src/etc/etc.alpha: MAKEDEV.conf Log Message: Add raid disk nodes for the install images To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/etc/etc.alpha/MAKEDEV.conf Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/etc/etc.alpha/MAKEDEV.conf diff -u src/etc/etc.alpha/MAKEDEV.conf:1.10 src/etc/etc.alpha/MAKEDEV.conf:1.11 --- src/etc/etc.alpha/MAKEDEV.conf:1.10 Wed Jan 22 11:46:31 2014 +++ src/etc/etc.alpha/MAKEDEV.conf Fri Jan 24 23:59:12 2014 @@ -1,4 +1,4 @@ -# $NetBSD: MAKEDEV.conf,v 1.10 2014/01/22 11:46:31 tsutsui Exp $ +# $NetBSD: MAKEDEV.conf,v 1.11 2014/01/24 23:59:12 martin Exp $ all_md) makedev wscons stic0 sd0 sd1 sd2 sd3 sd4 @@ -28,6 +28,7 @@ minimal) makedev sd0 sd1 sd2 sd3 opty st0 st1 ch0 cd0 cd1 ccd0 ccd1 md0 makedev ld0 ld1 ld2 ld3 makedev wd0 wd1 fd0 fd1 + makedev raid0 raid1 makedev ttyB0 ttyB1 ttyC0 ttyC1 ttyE0 ttyE1 wsmouse0 wskbd0 ttyEcfg ;;
CVS commit: src/sys/net80211
Module Name:src Committed By: christos Date: Sat Jan 25 00:59:44 UTC 2014 Modified Files: src/sys/net80211: ieee80211_ioctl.c Log Message: fix monitor mode channel. To generate a diff of this commit: cvs rdiff -u -r1.58 -r1.59 src/sys/net80211/ieee80211_ioctl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/net80211/ieee80211_ioctl.c diff -u src/sys/net80211/ieee80211_ioctl.c:1.58 src/sys/net80211/ieee80211_ioctl.c:1.59 --- src/sys/net80211/ieee80211_ioctl.c:1.58 Thu Sep 12 16:44:02 2013 +++ src/sys/net80211/ieee80211_ioctl.c Fri Jan 24 19:59:44 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: ieee80211_ioctl.c,v 1.58 2013/09/12 20:44:02 martin Exp $ */ +/* $NetBSD: ieee80211_ioctl.c,v 1.59 2014/01/25 00:59:44 christos Exp $ */ /*- * Copyright (c) 2001 Atsushi Onoe * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting @@ -36,7 +36,7 @@ __FBSDID($FreeBSD: src/sys/net80211/ieee80211_ioctl.c,v 1.35 2005/08/30 14:27:47 avatar Exp $); #endif #ifdef __NetBSD__ -__KERNEL_RCSID(0, $NetBSD: ieee80211_ioctl.c,v 1.58 2013/09/12 20:44:02 martin Exp $); +__KERNEL_RCSID(0, $NetBSD: ieee80211_ioctl.c,v 1.59 2014/01/25 00:59:44 christos Exp $); #endif /* @@ -2837,6 +2837,9 @@ ieee80211_ioctl(struct ieee80211com *ic, if (ic-ic_des_chan != IEEE80211_CHAN_ANYC ic-ic_bss-ni_chan != ic-ic_des_chan) error = ENETRESET; + } else if (ic-ic_opmode == IEEE80211_M_MONITOR) { +ic-ic_curchan = ic-ic_ibss_chan; +error = ENETRESET; } else { if (ic-ic_bss-ni_chan != ic-ic_ibss_chan) error = ENETRESET;
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: christos Date: Sat Jan 25 02:27:41 UTC 2014 Modified Files: src/sys/compat/netbsd32: netbsd32_netbsd.c Log Message: compat_10 fix: open(NULL) == open(.); To generate a diff of this commit: cvs rdiff -u -r1.181 -r1.182 src/sys/compat/netbsd32/netbsd32_netbsd.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/netbsd32_netbsd.c diff -u src/sys/compat/netbsd32/netbsd32_netbsd.c:1.181 src/sys/compat/netbsd32/netbsd32_netbsd.c:1.182 --- src/sys/compat/netbsd32/netbsd32_netbsd.c:1.181 Thu Jul 18 09:43:32 2013 +++ src/sys/compat/netbsd32/netbsd32_netbsd.c Fri Jan 24 21:27:41 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_netbsd.c,v 1.181 2013/07/18 13:43:32 matt Exp $ */ +/* $NetBSD: netbsd32_netbsd.c,v 1.182 2014/01/25 02:27:41 christos Exp $ */ /* * Copyright (c) 1998, 2001, 2008 Matthew R. Green @@ -27,7 +27,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: netbsd32_netbsd.c,v 1.181 2013/07/18 13:43:32 matt Exp $); +__KERNEL_RCSID(0, $NetBSD: netbsd32_netbsd.c,v 1.182 2014/01/25 02:27:41 christos Exp $); #if defined(_KERNEL_OPT) #include opt_ddb.h @@ -54,6 +54,7 @@ __KERNEL_RCSID(0, $NetBSD: netbsd32_net #include sys/sockio.h #include sys/socketvar.h #include sys/mbuf.h +#include sys/mman.h #include sys/stat.h #include sys/time.h #include sys/signalvar.h @@ -227,12 +228,25 @@ netbsd32_open(struct lwp *l, const struc syscallarg(mode_t) mode; } */ struct sys_open_args ua; + struct pathbuf *pb; + int error, fd; NETBSD32TOP_UAP(path, const char); NETBSD32TO64_UAP(flags); NETBSD32TO64_UAP(mode); - - return (sys_open(l, ua, retval)); + + if (SCARG(ua, path) != NULL) { + error = pathbuf_copyin(SCARG(ua, path), pb); + if (error) + return error; + } else + pb = pathbuf_create(.); + +error = do_open(l, NULL, pb, SCARG(ua, flags), SCARG(ua, mode), fd); +pathbuf_destroy(pb); + if (error == 0) + *retval = fd; +return error; } int @@ -1509,9 +1523,24 @@ netbsd32_mmap(struct lwp *l, const struc NETBSD32TOX_UAP(len, size_t); NETBSD32TO64_UAP(prot); NETBSD32TO64_UAP(flags); +#ifdef __x86_64__ + /* + * Ancient kernel on x86 did not obey PROT_EXEC on i386 at least + * and ld.so did not turn it on! + */ + if (SCARG(ua, flags) MAP_COPY) + SCARG(ua, prot) |= PROT_EXEC; +#endif NETBSD32TO64_UAP(fd); NETBSD32TOX_UAP(PAD, long); NETBSD32TOX_UAP(pos, off_t); +printf(mmap(addr=0x%lx, len=0x%lx, prot=0x%lx, flags=0x%lx, fd=%ld, pos=0x%lx);\n, + (long)SCARG(ua, addr), + (long)SCARG(ua, len), + (long)SCARG(ua, prot), + (long)SCARG(ua, flags), + (long)SCARG(ua, fd), + (long)SCARG(ua, pos)); error = sys_mmap(l, ua, retval); if ((u_long)*retval (u_long)UINT_MAX) { printf(netbsd32_mmap: retval out of range: 0x%lx,
CVS commit: src/sys
Module Name:src Committed By: christos Date: Sat Jan 25 02:28:31 UTC 2014 Modified Files: src/sys/kern: vfs_syscalls.c src/sys/sys: vfs_syscalls.h Log Message: expose do_open To generate a diff of this commit: cvs rdiff -u -r1.473 -r1.474 src/sys/kern/vfs_syscalls.c cvs rdiff -u -r1.21 -r1.22 src/sys/sys/vfs_syscalls.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/kern/vfs_syscalls.c diff -u src/sys/kern/vfs_syscalls.c:1.473 src/sys/kern/vfs_syscalls.c:1.474 --- src/sys/kern/vfs_syscalls.c:1.473 Thu Jan 23 05:13:57 2014 +++ src/sys/kern/vfs_syscalls.c Fri Jan 24 21:28:31 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: vfs_syscalls.c,v 1.473 2014/01/23 10:13:57 hannken Exp $ */ +/* $NetBSD: vfs_syscalls.c,v 1.474 2014/01/25 02:28:31 christos Exp $ */ /*- * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. @@ -70,7 +70,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: vfs_syscalls.c,v 1.473 2014/01/23 10:13:57 hannken Exp $); +__KERNEL_RCSID(0, $NetBSD: vfs_syscalls.c,v 1.474 2014/01/25 02:28:31 christos Exp $); #ifdef _KERNEL_OPT #include opt_fileassoc.h @@ -119,7 +119,6 @@ __KERNEL_RCSID(0, $NetBSD: vfs_syscalls static int change_flags(struct vnode *, u_long, struct lwp *); static int change_mode(struct vnode *, int, struct lwp *l); static int change_owner(struct vnode *, uid_t, gid_t, struct lwp *, int); -static int do_open(lwp_t *, struct vnode *, struct pathbuf *, int, int, int *); static int do_sys_openat(lwp_t *, int, const char *, int, int, int *); static int do_sys_mkdirat(struct lwp *l, int, const char *, mode_t, enum uio_seg); @@ -1534,7 +1533,7 @@ chdir_lookup(const char *path, int where * (so we can easily reuse this function from other parts of the kernel, * like posix_spawn post-processing). */ -static int +int do_open(lwp_t *l, struct vnode *dvp, struct pathbuf *pb, int open_flags, int open_mode, int *fd) { Index: src/sys/sys/vfs_syscalls.h diff -u src/sys/sys/vfs_syscalls.h:1.21 src/sys/sys/vfs_syscalls.h:1.22 --- src/sys/sys/vfs_syscalls.h:1.21 Sun Nov 17 20:31:42 2013 +++ src/sys/sys/vfs_syscalls.h Fri Jan 24 21:28:31 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: vfs_syscalls.h,v 1.21 2013/11/18 01:31:42 chs Exp $*/ +/* $NetBSD: vfs_syscalls.h,v 1.22 2014/01/25 02:28:31 christos Exp $*/ /* * Copyright (c) 2007, 2008, 2009 The NetBSD Foundation, Inc. @@ -59,6 +59,9 @@ int do_sys_utimens(struct lwp *, struct int do_sys_utimensat(struct lwp *, int, struct vnode *, const char *, int, const struct timespec *, enum uio_seg); +struct pathbuf; +int do_open(struct lwp *, struct vnode *, struct pathbuf *, int, int, int *); + int vfs_copyinfh_alloc(const void *, size_t, fhandle_t **); void vfs_copyinfh_free(fhandle_t *);
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: christos Date: Sat Jan 25 03:31:12 UTC 2014 Modified Files: src/sys/compat/netbsd32: netbsd32_netbsd.c Log Message: ifdef debug printf To generate a diff of this commit: cvs rdiff -u -r1.182 -r1.183 src/sys/compat/netbsd32/netbsd32_netbsd.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/netbsd32_netbsd.c diff -u src/sys/compat/netbsd32/netbsd32_netbsd.c:1.182 src/sys/compat/netbsd32/netbsd32_netbsd.c:1.183 --- src/sys/compat/netbsd32/netbsd32_netbsd.c:1.182 Fri Jan 24 21:27:41 2014 +++ src/sys/compat/netbsd32/netbsd32_netbsd.c Fri Jan 24 22:31:12 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_netbsd.c,v 1.182 2014/01/25 02:27:41 christos Exp $ */ +/* $NetBSD: netbsd32_netbsd.c,v 1.183 2014/01/25 03:31:12 christos Exp $ */ /* * Copyright (c) 1998, 2001, 2008 Matthew R. Green @@ -27,7 +27,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: netbsd32_netbsd.c,v 1.182 2014/01/25 02:27:41 christos Exp $); +__KERNEL_RCSID(0, $NetBSD: netbsd32_netbsd.c,v 1.183 2014/01/25 03:31:12 christos Exp $); #if defined(_KERNEL_OPT) #include opt_ddb.h @@ -1534,13 +1534,13 @@ netbsd32_mmap(struct lwp *l, const struc NETBSD32TO64_UAP(fd); NETBSD32TOX_UAP(PAD, long); NETBSD32TOX_UAP(pos, off_t); -printf(mmap(addr=0x%lx, len=0x%lx, prot=0x%lx, flags=0x%lx, fd=%ld, pos=0x%lx);\n, - (long)SCARG(ua, addr), - (long)SCARG(ua, len), - (long)SCARG(ua, prot), - (long)SCARG(ua, flags), - (long)SCARG(ua, fd), - (long)SCARG(ua, pos)); +#ifdef DEBUG_MMAP + printf(mmap(addr=0x%lx, len=0x%lx, prot=0x%lx, flags=0x%lx, + fd=%ld, pos=0x%lx);\n, + (long)SCARG(ua, addr), (long)SCARG(ua, len), + (long)SCARG(ua, prot), (long)SCARG(ua, flags), + (long)SCARG(ua, fd), (long)SCARG(ua, pos)); +#endif error = sys_mmap(l, ua, retval); if ((u_long)*retval (u_long)UINT_MAX) { printf(netbsd32_mmap: retval out of range: 0x%lx,
CVS commit: src/sys/arch/amd64
Module Name:src Committed By: christos Date: Sat Jan 25 05:09:59 UTC 2014 Modified Files: src/sys/arch/amd64/amd64: netbsd32_machdep.c src/sys/arch/amd64/include: vmparam.h Log Message: provide propert address defaults for topdown and bottomup allocation To generate a diff of this commit: cvs rdiff -u -r1.87 -r1.88 src/sys/arch/amd64/amd64/netbsd32_machdep.c cvs rdiff -u -r1.32 -r1.33 src/sys/arch/amd64/include/vmparam.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/amd64/amd64/netbsd32_machdep.c diff -u src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.87 src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.88 --- src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.87 Fri Jan 3 19:10:02 2014 +++ src/sys/arch/amd64/amd64/netbsd32_machdep.c Sat Jan 25 00:09:59 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_machdep.c,v 1.87 2014/01/04 00:10:02 dsl Exp $ */ +/* $NetBSD: netbsd32_machdep.c,v 1.88 2014/01/25 05:09:59 christos Exp $ */ /* * Copyright (c) 2001 Wasabi Systems, Inc. @@ -36,7 +36,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: netbsd32_machdep.c,v 1.87 2014/01/04 00:10:02 dsl Exp $); +__KERNEL_RCSID(0, $NetBSD: netbsd32_machdep.c,v 1.88 2014/01/25 05:09:59 christos Exp $); #ifdef _KERNEL_OPT #include opt_compat_netbsd.h @@ -1042,9 +1042,12 @@ cpu_mcontext32_validate(struct lwp *l, c } vaddr_t -netbsd32_vm_default_addr(struct proc *p, vaddr_t base, vsize_t size) +netbsd32_vm_default_addr(struct proc *p, vaddr_t base, vsize_t sz) { - return VM_DEFAULT_ADDRESS32(base, size); +if (p-p_vmspace-vm_map.flags VM_MAP_TOPDOWN) +return VM_DEFAULT_ADDRESS32_TOPDOWN(base, sz); +else +return VM_DEFAULT_ADDRESS32_BOTTOMUP(base, sz); } #ifdef COMPAT_13 Index: src/sys/arch/amd64/include/vmparam.h diff -u src/sys/arch/amd64/include/vmparam.h:1.32 src/sys/arch/amd64/include/vmparam.h:1.33 --- src/sys/arch/amd64/include/vmparam.h:1.32 Tue Nov 13 09:10:24 2012 +++ src/sys/arch/amd64/include/vmparam.h Sat Jan 25 00:09:59 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: vmparam.h,v 1.32 2012/11/13 14:10:24 chs Exp $ */ +/* $NetBSD: vmparam.h,v 1.33 2014/01/25 05:09:59 christos Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -133,10 +133,16 @@ #include opt_uvm.h #endif #define __USE_TOPDOWN_VM -#define VM_DEFAULT_ADDRESS(da, sz) \ - trunc_page(USRSTACK - MAXSSIZ - (sz)) -#define VM_DEFAULT_ADDRESS32(da, sz) \ +#define VM_DEFAULT_ADDRESS_TOPDOWN(da, sz) \ +trunc_page(USRSTACK - MAXSSIZ - (sz)) +#define VM_DEFAULT_ADDRESS(da, sz) VM_DEFAULT_ADDRESS_TOPDOWN(da, sz) + +#define VM_DEFAULT_ADDRESS_BOTTOMUP(da, sz) \ +round_page((vaddr_t)(da) + (vsize_t)maxdmap) +#define VM_DEFAULT_ADDRESS32_TOPDOWN(da, sz) \ trunc_page(USRSTACK32 - MAXSSIZ32 - (sz)) +#define VM_DEFAULT_ADDRESS32_BOTTOMUP(da, sz) \ +round_page((vaddr_t)(da) + (vsize_t)MAXDSIZ32) /* * XXXfvdl we have plenty of KVM now, remove this.
CVS commit: src/sys/uvm
Module Name:src Committed By: christos Date: Sat Jan 25 05:14:03 UTC 2014 Modified Files: src/sys/uvm: uvm_mmap.c uvm_param.h Log Message: provide proper defaults for topdown and bottomup allocation. XXX: Ports that provide their own VM_DEFAULT_ADDRESS() need to provide the two new flavors, otherwise they get the default ones now. To generate a diff of this commit: cvs rdiff -u -r1.145 -r1.146 src/sys/uvm/uvm_mmap.c cvs rdiff -u -r1.31 -r1.32 src/sys/uvm/uvm_param.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/uvm/uvm_mmap.c diff -u src/sys/uvm/uvm_mmap.c:1.145 src/sys/uvm/uvm_mmap.c:1.146 --- src/sys/uvm/uvm_mmap.c:1.145 Wed Sep 11 14:26:14 2013 +++ src/sys/uvm/uvm_mmap.c Sat Jan 25 00:14:03 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_mmap.c,v 1.145 2013/09/11 18:26:14 martin Exp $ */ +/* $NetBSD: uvm_mmap.c,v 1.146 2014/01/25 05:14:03 christos Exp $ */ /* * Copyright (c) 1997 Charles D. Cranor and Washington University. @@ -46,7 +46,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: uvm_mmap.c,v 1.145 2013/09/11 18:26:14 martin Exp $); +__KERNEL_RCSID(0, $NetBSD: uvm_mmap.c,v 1.146 2014/01/25 05:14:03 christos Exp $); #include opt_compat_netbsd.h #include opt_pax.h @@ -1253,5 +1253,8 @@ vaddr_t uvm_default_mapaddr(struct proc *p, vaddr_t base, vsize_t sz) { - return VM_DEFAULT_ADDRESS(base, sz); + if (p-p_vmspace-vm_map.flags VM_MAP_TOPDOWN) + return VM_DEFAULT_ADDRESS_TOPDOWN(base, sz); + else + return VM_DEFAULT_ADDRESS_BOTTOMUP(base, sz); } Index: src/sys/uvm/uvm_param.h diff -u src/sys/uvm/uvm_param.h:1.31 src/sys/uvm/uvm_param.h:1.32 --- src/sys/uvm/uvm_param.h:1.31 Sun Mar 18 20:17:08 2012 +++ src/sys/uvm/uvm_param.h Sat Jan 25 00:14:03 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_param.h,v 1.31 2012/03/19 00:17:08 uebayasi Exp $ */ +/* $NetBSD: uvm_param.h,v 1.32 2014/01/25 05:14:03 christos Exp $ */ /* * Copyright (c) 1991, 1993 @@ -225,6 +225,15 @@ extern const int *const uvmexp_pageshift * NOT defined, then the port can offer topdown as an option, but it * MUST define the VM_DEFAULT_ADDRESS macro itself. */ +#ifndef VM_DEFAULT_ADDRESS_BOTTOMUP +#define VM_DEFAULT_ADDRESS_BOTTOMUP(da, sz) \ +round_page((vaddr_t)(da) + (vsize_t)maxdmap) +#endif +#ifndef VM_DEFAULT_ADDRESS_TOPDOWN +#define VM_DEFAULT_ADDRESS_TOPDOWN(da, sz) \ +trunc_page(VM_MAXUSER_ADDRESS - MAXSSIZ - (sz)) +#endif + #if defined(USE_TOPDOWN_VM) || defined(__USE_TOPDOWN_VM) # if !defined(__HAVE_TOPDOWN_VM) !defined(__USE_TOPDOWN_VM) # error Top down memory allocation not enabled for this system @@ -234,8 +243,7 @@ extern const int *const uvmexp_pageshift # if !defined(__USE_TOPDOWN_VM) #error Top down memory allocation not configured for this system # else /* !__USE_TOPDOWN_VM */ -#define VM_DEFAULT_ADDRESS(da, sz) \ - trunc_page(VM_MAXUSER_ADDRESS - MAXSSIZ - (sz)) +#define VM_DEFAULT_ADDRESS(da, sz) VM_DEFAULT_ADDRESS_TOPDOWN(da, sz) # endif /* !__USE_TOPDOWN_VM */ # endif /* !VM_DEFAULT_ADDRESS */ # endif /* !__HAVE_TOPDOWN_VM !__USE_TOPDOWN_VM */ @@ -245,7 +253,7 @@ extern const int *const uvmexp_pageshift # if defined(VM_DEFAULT_ADDRESS) # error Default vm address should not be defined here # else /* VM_DEFAULT_ADDRESS */ -# define VM_DEFAULT_ADDRESS(da, sz) round_page((vaddr_t)(da) + (vsize_t)maxdmap) +# define VM_DEFAULT_ADDRESS(da, sz) VM_DEFAULT_ADDRESS_BOTTOMUP(da, sz) # endif /* VM_DEFAULT_ADDRESS */ #endif /* !__USING_TOPDOWN_VM */
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: christos Date: Sat Jan 25 05:15:44 UTC 2014 Modified Files: src/sys/compat/netbsd32: netbsd32_exec_aout.c Log Message: a.out binaries can't handle topdown. Now 1.0 binaries work correctly on NetBSD-current. To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 src/sys/compat/netbsd32/netbsd32_exec_aout.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/netbsd32_exec_aout.c diff -u src/sys/compat/netbsd32/netbsd32_exec_aout.c:1.25 src/sys/compat/netbsd32/netbsd32_exec_aout.c:1.26 --- src/sys/compat/netbsd32/netbsd32_exec_aout.c:1.25 Fri Apr 23 11:19:20 2010 +++ src/sys/compat/netbsd32/netbsd32_exec_aout.c Sat Jan 25 00:15:43 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_exec_aout.c,v 1.25 2010/04/23 15:19:20 rmind Exp $ */ +/* $NetBSD: netbsd32_exec_aout.c,v 1.26 2014/01/25 05:15:43 christos Exp $ */ /* from: NetBSD: exec_aout.c,v 1.15 1996/09/26 23:34:46 cgd Exp */ /* @@ -57,7 +57,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: netbsd32_exec_aout.c,v 1.25 2010/04/23 15:19:20 rmind Exp $); +__KERNEL_RCSID(0, $NetBSD: netbsd32_exec_aout.c,v 1.26 2014/01/25 05:15:43 christos Exp $); #include sys/param.h #include sys/systm.h @@ -113,6 +113,7 @@ exec_netbsd32_makecmds(struct lwp *l, st /* this is already needed by setup_stack() */ epp-ep_flags |= EXEC_32; + epp-ep_flags = ~EXEC_TOPDOWN_VM; switch (midmag) { case (NETBSD32_MID_MACHINE 16) | ZMAGIC:
CVS commit: src/sys/kern
Module Name:src Committed By: christos Date: Sat Jan 25 05:15:05 UTC 2014 Modified Files: src/sys/kern: exec_aout.c Log Message: a.out binaries can't handle topdown. To generate a diff of this commit: cvs rdiff -u -r1.36 -r1.37 src/sys/kern/exec_aout.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/kern/exec_aout.c diff -u src/sys/kern/exec_aout.c:1.36 src/sys/kern/exec_aout.c:1.37 --- src/sys/kern/exec_aout.c:1.36 Thu Sep 19 14:50:59 2013 +++ src/sys/kern/exec_aout.c Sat Jan 25 00:15:05 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: exec_aout.c,v 1.36 2013/09/19 18:50:59 christos Exp $ */ +/* $NetBSD: exec_aout.c,v 1.37 2014/01/25 05:15:05 christos Exp $ */ /* * Copyright (c) 1993, 1994 Christopher G. Demetriou @@ -31,7 +31,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: exec_aout.c,v 1.36 2013/09/19 18:50:59 christos Exp $); +__KERNEL_RCSID(0, $NetBSD: exec_aout.c,v 1.37 2014/01/25 05:15:05 christos Exp $); #ifdef _KERNEL_OPT #include opt_coredump.h @@ -116,6 +116,8 @@ exec_aout_makecmds(struct lwp *l, struct midmag = mid 16 | magic; + epp-ep_flags = ~EXEC_TOPDOWN_VM; + switch (midmag) { case (MID_MACHINE 16) | ZMAGIC: error = exec_aout_prep_zmagic(l, epp);