svn commit: r261582 - head/sys/net
Author: glebius Date: Fri Feb 7 10:05:12 2014 New Revision: 261582 URL: http://svnweb.freebsd.org/changeset/base/261582 Log: Spacing. Modified: head/sys/net/flowtable.c Modified: head/sys/net/flowtable.c == --- head/sys/net/flowtable.cFri Feb 7 07:34:47 2014(r261581) +++ head/sys/net/flowtable.cFri Feb 7 10:05:12 2014(r261582) @@ -36,13 +36,13 @@ POSSIBILITY OF SUCH DAMAGE. #include __FBSDID("$FreeBSD$"); -#include +#include #include #include #include #include #include -#include +#include #include #include #include @@ -58,7 +58,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include @@ -167,8 +167,8 @@ struct flowtable { fl_lock_t *ft_unlock; fl_rtalloc_t*ft_rtalloc; /* -* XXX need to pad out -*/ +* XXX need to pad out +*/ struct mtx *ft_locks; union flentryp ft_table; bitstr_t*ft_masks[MAXCPU]; @@ -219,7 +219,7 @@ do {\ * - Make flowtable stats per-cpu, aggregated at sysctl call time, * to avoid extra cache evictions caused by incrementing a shared * counter - * - add sysctls to resize && flush flow tables + * - add sysctls to resize && flush flow tables * - Add per flowtable sysctls for statistics and configuring timeouts * - add saturation counter to rtentry to support per-packet load-balancing * add flag to indicate round-robin flow, add list lookup from head @@ -286,7 +286,7 @@ sysctl_nmbflows(SYSCTL_HANDLER_ARGS) int error, newnmbflows; newnmbflows = V_flowtable_nmbflows; - error = sysctl_handle_int(oidp, &newnmbflows, 0, req); + error = sysctl_handle_int(oidp, &newnmbflows, 0, req); if (error == 0 && req->newptr) { if (newnmbflows > V_flowtable_nmbflows) { V_flowtable_nmbflows = newnmbflows; @@ -532,17 +532,17 @@ ipv4_mbuf_demarshal(struct flowtable *ft if ((*flags & FL_HASH_ALL) && (th->th_flags & (TH_RST|TH_FIN))) *flags |= FL_STALE; - break; + break; case IPPROTO_UDP: uh = (struct udphdr *)((caddr_t)ip + iphlen); sport = uh->uh_sport; dport = uh->uh_dport; - break; + break; case IPPROTO_SCTP: sh = (struct sctphdr *)((caddr_t)ip + iphlen); sport = sh->src_port; dport = sh->dest_port; - break; + break; default: FLDPRINTF(ft, FL_DEBUG_ALL, "proto=0x%x not supported\n", proto); return (ENOTSUP); @@ -560,7 +560,7 @@ skipports: static uint32_t ipv4_flow_lookup_hash_internal( - struct sockaddr_in *ssin, struct sockaddr_in *dsin, + struct sockaddr_in *ssin, struct sockaddr_in *dsin, uint32_t *key, uint16_t flags) { uint16_t sport, dport; @@ -581,7 +581,7 @@ ipv4_flow_lookup_hash_internal( } if (flags & FL_HASH_ALL) { ((uint16_t *)key)[0] = sport; - ((uint16_t *)key)[1] = dport; + ((uint16_t *)key)[1] = dport; } else offset = V_flow_hashjitter + proto; @@ -764,7 +764,7 @@ do {\ static uint32_t ipv6_flow_lookup_hash_internal( - struct sockaddr_in6 *ssin6, struct sockaddr_in6 *dsin6, + struct sockaddr_in6 *ssin6, struct sockaddr_in6 *dsin6, uint32_t *key, uint16_t flags) { uint16_t sport, dport; @@ -787,7 +787,7 @@ ipv6_flow_lookup_hash_internal( } if (flags & FL_HASH_ALL) { ((uint16_t *)key)[0] = sport; - ((uint16_t *)key)[1] = dport; + ((uint16_t *)key)[1] = dport; } else offset = V_flow_hashjitter + proto; @@ -885,7 +885,7 @@ flow_stale(struct flowtable *ft, struct && (idle_time > ft->ft_syn_idle)) || ((fle->f_flags & (TH_SYN|TH_ACK)) == (TH_SYN|TH_ACK) && (idle_time > ft->ft_tcp_idle)) || - ((fle->f_rt->rt_flags & RTF_UP) == 0 || + ((fle->f_rt->rt_flags & RTF_UP) == 0 || (fle->f_rt->rt_ifp == NULL))) return (1); @@ -906,7 +906,7 @@ flowtable_set_hashkey(struct flentry *fl hashkey = ((struct flentry_v6 *)fle)->fl_flow.ipf_key; } - for (i = 0; i < nwords; i++) + for (i = 0; i < nwords; i++) hashkey[i] = key[i]; } @@ -991,7 +991,7 @@ flowtable_insert(struct flowtable *ft, u bit_set(mask, FL_ENTRY_INDEX(ft, hash)); *flep = fle = newfle; goto skip; - } + } depth = 0; fs->ft_co
svn commit: r261583 - head/sys/netinet6
Author: ae Date: Fri Feb 7 10:58:46 2014 New Revision: 261583 URL: http://svnweb.freebsd.org/changeset/base/261583 Log: Unlock entry before retry. Submitted by: melifaro MFC after:1 week Modified: head/sys/netinet6/nd6.c Modified: head/sys/netinet6/nd6.c == --- head/sys/netinet6/nd6.c Fri Feb 7 10:05:12 2014(r261582) +++ head/sys/netinet6/nd6.c Fri Feb 7 10:58:46 2014(r261583) @@ -1925,6 +1925,7 @@ nd6_output_lle(struct ifnet *ifp, struct ln->ln_state < ND6_LLINFO_REACHABLE) { if ((flags & LLE_EXCLUSIVE) == 0) { flags |= LLE_EXCLUSIVE; + LLE_RUNLOCK(ln); goto retry; } ln->ln_state = ND6_LLINFO_STALE; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r261584 - head/share/man/man4
Author: brueffer Date: Fri Feb 7 11:40:50 2014 New Revision: 261584 URL: http://svnweb.freebsd.org/changeset/base/261584 Log: In IPv6 code examples, use the correct v6 socket. MFC after:1 week Modified: head/share/man/man4/multicast.4 Modified: head/share/man/man4/multicast.4 == --- head/share/man/man4/multicast.4 Fri Feb 7 10:58:46 2014 (r261583) +++ head/share/man/man4/multicast.4 Fri Feb 7 11:40:50 2014 (r261584) @@ -326,7 +326,7 @@ mc.mf6cc_parent = iif_index; for (i = 0; i < maxvifs; i++) if (oifs_ttl[i] > 0) IF_SET(i, &mc.mf6cc_ifset); -setsockopt(mrouter_s4, IPPROTO_IPV6, MRT6_ADD_MFC, +setsockopt(mrouter_s6, IPPROTO_IPV6, MRT6_ADD_MFC, (void *)&mc, sizeof(mc)); .Ed .Pp @@ -365,7 +365,7 @@ struct mf6cctl mc; memset(&mc, 0, sizeof(mc)); memcpy(&mc.mf6cc_origin, &source_addr, sizeof(mc.mf6cc_origin)); memcpy(&mc.mf6cc_mcastgrp, &group_addr, sizeof(mf6cc_mcastgrp)); -setsockopt(mrouter_s4, IPPROTO_IPV6, MRT6_DEL_MFC, +setsockopt(mrouter_s6, IPPROTO_IPV6, MRT6_DEL_MFC, (void *)&mc, sizeof(mc)); .Ed .Pp ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r261585 - head/sys/dev/vt/hw/vga
Author: ray Date: Fri Feb 7 12:39:58 2014 New Revision: 261585 URL: http://svnweb.freebsd.org/changeset/base/261585 Log: Implement vd_drawrect and vd_setpixel for vt(9)'s VGA driver. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/vt/hw/vga/vga.c Modified: head/sys/dev/vt/hw/vga/vga.c == --- head/sys/dev/vt/hw/vga/vga.cFri Feb 7 11:40:50 2014 (r261584) +++ head/sys/dev/vt/hw/vga/vga.cFri Feb 7 12:39:58 2014 (r261585) @@ -74,6 +74,8 @@ struct vga_softc { static vd_init_t vga_init; static vd_blank_t vga_blank; static vd_bitbltchr_t vga_bitbltchr; +static vd_drawrect_t vga_drawrect; +static vd_setpixel_t vga_setpixel; static vd_putchar_tvga_putchar; static vd_postswitch_t vga_postswitch; @@ -81,6 +83,8 @@ static const struct vt_driver vt_vga_dri .vd_init= vga_init, .vd_blank = vga_blank, .vd_bitbltchr = vga_bitbltchr, + .vd_drawrect= vga_drawrect, + .vd_setpixel= vga_setpixel, .vd_putchar = vga_putchar, .vd_postswitch = vga_postswitch, .vd_priority= VD_PRIORITY_GENERIC, @@ -139,6 +143,31 @@ vga_bitblt_put(struct vt_device *vd, u_l } } +static void +vga_setpixel(struct vt_device *vd, int x, int y, term_color_t color) +{ + + vga_bitblt_put(vd, (y * VT_VGA_WIDTH / 8) + (x / 8), color, + 0x80 >> (x % 8)); +} + +static void +vga_drawrect(struct vt_device *vd, int x1, int y1, int x2, int y2, int fill, +term_color_t color) +{ + int x, y; + + for (y = y1; y <= y2; y++) { + if (fill || (y == y1) || (y == y2)) { + for (x = x1; x <= x2; x++) + vga_setpixel(vd, x, y, color); + } else { + vga_setpixel(vd, x1, y, color); + vga_setpixel(vd, x2, y, color); + } + } +} + static inline void vga_bitblt_draw(struct vt_device *vd, const uint8_t *src, u_long ldst, uint8_t shift, unsigned int width, unsigned int height, ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r261586 - in head/sys/geom: uncompress uzip
Author: loos Date: Fri Feb 7 13:06:48 2014 New Revision: 261586 URL: http://svnweb.freebsd.org/changeset/base/261586 Log: Fix the build with DEBUG enabled. Where possible, fix style(9) issues. Reviewed by: bde Approved by: adrian (mentor) Modified: head/sys/geom/uncompress/g_uncompress.c head/sys/geom/uzip/g_uzip.c Modified: head/sys/geom/uncompress/g_uncompress.c == --- head/sys/geom/uncompress/g_uncompress.c Fri Feb 7 12:39:58 2014 (r261585) +++ head/sys/geom/uncompress/g_uncompress.c Fri Feb 7 13:06:48 2014 (r261586) @@ -213,10 +213,11 @@ g_uncompress_done(struct bio *bp) pos = sc->offsets[start_blk] % bsize; upos = 0; - DPRINTF(("%s: done: bio_length %lld bio_completed %lld start_blk %d, " - "pos %lld, upos %lld (%lld, %d, %d)\n", - gp->name, bp->bio_length, bp->bio_completed, start_blk, pos, upos, - bp2->bio_offset, sc->blksz, bsize)); + DPRINTF(("%s: done: bio_length %jd bio_completed %jd start_blk %d, " + "pos %jd, upos %jd (%jd, %d, %zu)\n", + gp->name, (intmax_t)bp->bio_length, (intmax_t)bp->bio_completed, + start_blk, (intmax_t)pos, (intmax_t)upos, + (intmax_t)bp2->bio_offset, sc->blksz, bsize)); for (i = start_blk; upos < bp2->bio_length; i++) { off_t len, dlen, ulen, uoff; @@ -225,9 +226,10 @@ g_uncompress_done(struct bio *bp) ulen = MIN(sc->blksz - uoff, bp2->bio_length - upos); dlen = len = sc->offsets[i + 1] - sc->offsets[i]; - DPRINTF(("%s: done: inflate block %d, start %lld, end %lld " - "len %lld\n", - gp->name, i, sc->offsets[i], sc->offsets[i + 1], len)); + DPRINTF(( + "%s: done: inflate block %d, start %ju, end %ju len %jd\n", + gp->name, i, (uintmax_t)sc->offsets[i], + (uintmax_t)sc->offsets[i + 1], (intmax_t)len)); if (len == 0) { /* All zero block: no cache update */ @@ -298,8 +300,9 @@ done: /* * Finish processing the request. */ - DPRINTF(("%s: done: (%d, %lld, %ld)\n", - gp->name, bp2->bio_error, bp2->bio_completed, bp2->bio_resid)); + DPRINTF(("%s: done: (%d, %jd, %ld)\n", + gp->name, bp2->bio_error, (intmax_t)bp2->bio_completed, + bp2->bio_resid)); free(bp->bio_data, M_GEOM_UNCOMPRESS); g_destroy_bio(bp); g_io_deliver(bp2, bp2->bio_error); @@ -319,9 +322,10 @@ g_uncompress_start(struct bio *bp) pp = bp->bio_to; gp = pp->geom; - DPRINTF(("%s: start (%s) to %s off=%lld len=%lld\n", gp->name, - (bp->bio_cmd==BIO_READ) ? "BIO_READ" : "BIO_WRITE*", - pp->name, bp->bio_offset, bp->bio_length)); + DPRINTF(("%s: start (%d:%s) to %s off=%jd len=%jd\n", + gp->name, bp->bio_cmd, + (bp->bio_cmd == BIO_READ) ? "BIO_READ" : "NOTSUPPORTED", + pp->name, (intmax_t)bp->bio_offset, (intmax_t)bp->bio_length)); if (bp->bio_cmd != BIO_READ) { g_io_deliver(bp, EOPNOTSUPP); @@ -353,9 +357,9 @@ g_uncompress_start(struct bio *bp) sc->req_cached++; mtx_unlock(&sc->last_mtx); - DPRINTF(("%s: start: cached 0 + %lld, " - "%lld + 0 + %lld\n", - gp->name, bp->bio_length, uoff, bp->bio_length)); + DPRINTF(("%s: start: cached 0 + %jd, %jd + 0 + %jd\n", + gp->name, (intmax_t)bp->bio_length, (intmax_t)uoff, + (intmax_t)bp->bio_length)); bp->bio_completed = bp->bio_length; g_io_deliver(bp, 0); return; @@ -368,10 +372,10 @@ g_uncompress_start(struct bio *bp) g_io_deliver(bp, ENOMEM); return; } - DPRINTF(("%s: start (%d..%d), %s: %d + %llu, %s: %d + %llu\n", + DPRINTF(("%s: start (%d..%d), %s: %d + %jd, %s: %d + %jd\n", gp->name, start_blk, end_blk, - pp->name, pp->sectorsize, pp->mediasize, - pp2->name, pp2->sectorsize, pp2->mediasize)); + pp->name, pp->sectorsize, (intmax_t)pp->mediasize, + pp2->name, pp2->sectorsize, (intmax_t)pp2->mediasize)); bsize = pp2->sectorsize; @@ -381,12 +385,12 @@ g_uncompress_start(struct bio *bp) bp2->bio_offset; bp2->bio_data = malloc(bp2->bio_length, M_GEOM_UNCOMPRESS, M_NOWAIT); - DPRINTF(("%s: start %lld + %lld -> %lld + %lld -> %lld + %lld\n", + DPRINTF(("%s: start %jd + %jd -> %ju + %ju -> %jd + %jd\n", gp->name, - bp->bio_offset, bp->bio_length, - sc->offsets[start_blk], - sc->offs
svn commit: r261589 - head/lib/libc/gen
Author: jilles Date: Fri Feb 7 13:40:22 2014 New Revision: 261589 URL: http://svnweb.freebsd.org/changeset/base/261589 Log: fts: Fix double-free with conflicting concurrent modifications. If rare conditions such as concurrent conflicting manipulation of the filesystem occur, fts_read() frees the current FTSENT without adjusting the pointers in the FTS accordingly. A later fts_close() then frees the same FTSENT again. Reported by: pho Tested by:pho MFC after:1 week Modified: head/lib/libc/gen/fts.c Modified: head/lib/libc/gen/fts.c == --- head/lib/libc/gen/fts.c Fri Feb 7 13:17:27 2014(r261588) +++ head/lib/libc/gen/fts.c Fri Feb 7 13:40:22 2014(r261589) @@ -406,8 +406,6 @@ fts_read(FTS *sp) /* Move to the next node on this level. */ next: tmp = p; if ((p = p->fts_link) != NULL) { - free(tmp); - /* * If reached the top, return to the original directory (or * the root of the tree), and load the paths for the next root. @@ -417,6 +415,7 @@ next: tmp = p; SET(FTS_STOP); return (NULL); } + free(tmp); fts_load(sp, p); return (sp->fts_cur = p); } @@ -426,8 +425,10 @@ next: tmp = p; * ignore. If followed, get a file descriptor so we can * get back if necessary. */ - if (p->fts_instr == FTS_SKIP) + if (p->fts_instr == FTS_SKIP) { + free(tmp); goto next; + } if (p->fts_instr == FTS_FOLLOW) { p->fts_info = fts_stat(sp, p, 1, -1); if (p->fts_info == FTS_D && !ISSET(FTS_NOCHDIR)) { @@ -441,6 +442,8 @@ next: tmp = p; p->fts_instr = FTS_NOINSTR; } + free(tmp); + name: t = sp->fts_path + NAPPEND(p->fts_parent); *t++ = '/'; memmove(t, p->fts_name, p->fts_namelen + 1); @@ -449,13 +452,13 @@ name: t = sp->fts_path + NAPPEND(p->fts /* Move up to the parent node. */ p = tmp->fts_parent; - free(tmp); if (p->fts_level == FTS_ROOTPARENTLEVEL) { /* * Done; free everything up and set errno to 0 so the user * can distinguish between error and EOF. */ + free(tmp); free(p); errno = 0; return (sp->fts_cur = NULL); @@ -488,6 +491,7 @@ name: t = sp->fts_path + NAPPEND(p->fts SET(FTS_STOP); return (NULL); } + free(tmp); p->fts_info = p->fts_errno ? FTS_ERR : FTS_DP; return (sp->fts_cur = p); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r261590 - in head/sys: kern net
Author: glebius Date: Fri Feb 7 13:47:33 2014 New Revision: 261590 URL: http://svnweb.freebsd.org/changeset/base/261590 Log: Remove identical vnet sysctl handlers, and handle CTLFLAG_VNET in the sysctl_root(). Note: SYSCTL_VNET_* macros can be removed as well. All is needed to virtualize a sysctl oid is set CTLFLAG_VNET on it. But for now keep macros in place to avoid large code churn. Sponsored by: Nginx, Inc. Modified: head/sys/kern/kern_sysctl.c head/sys/net/vnet.c head/sys/net/vnet.h Modified: head/sys/kern/kern_sysctl.c == --- head/sys/kern/kern_sysctl.c Fri Feb 7 13:40:22 2014(r261589) +++ head/sys/kern/kern_sysctl.c Fri Feb 7 13:47:33 2014(r261590) @@ -1491,7 +1491,10 @@ sysctl_root(SYSCTL_HANDLER_ARGS) #endif oid->oid_running++; SYSCTL_XUNLOCK(); - +#ifdef VIMAGE + if ((oid->oid_kind & CTLFLAG_VNET) && arg1 != NULL) + arg1 = (void *)(curvnet->vnet_data_base + (uintptr_t)arg1); +#endif if (!(oid->oid_kind & CTLFLAG_MPSAFE)) mtx_lock(&Giant); error = oid->oid_handler(oid, arg1, arg2, req); Modified: head/sys/net/vnet.c == --- head/sys/net/vnet.c Fri Feb 7 13:40:22 2014(r261589) +++ head/sys/net/vnet.c Fri Feb 7 13:47:33 2014(r261590) @@ -464,47 +464,6 @@ vnet_data_copy(void *start, int size) } /* - * Variants on sysctl_handle_foo that know how to handle virtualized global - * variables: if 'arg1' is a pointer, then we transform it to the local vnet - * offset. - */ -int -vnet_sysctl_handle_int(SYSCTL_HANDLER_ARGS) -{ - - if (arg1 != NULL) - arg1 = (void *)(curvnet->vnet_data_base + (uintptr_t)arg1); - return (sysctl_handle_int(oidp, arg1, arg2, req)); -} - -int -vnet_sysctl_handle_opaque(SYSCTL_HANDLER_ARGS) -{ - - if (arg1 != NULL) - arg1 = (void *)(curvnet->vnet_data_base + (uintptr_t)arg1); - return (sysctl_handle_opaque(oidp, arg1, arg2, req)); -} - -int -vnet_sysctl_handle_string(SYSCTL_HANDLER_ARGS) -{ - - if (arg1 != NULL) - arg1 = (void *)(curvnet->vnet_data_base + (uintptr_t)arg1); - return (sysctl_handle_string(oidp, arg1, arg2, req)); -} - -int -vnet_sysctl_handle_uint(SYSCTL_HANDLER_ARGS) -{ - - if (arg1 != NULL) - arg1 = (void *)(curvnet->vnet_data_base + (uintptr_t)arg1); - return (sysctl_handle_int(oidp, arg1, arg2, req)); -} - -/* * Support for special SYSINIT handlers registered via VNET_SYSINIT() * and VNET_SYSUNINIT(). */ Modified: head/sys/net/vnet.h == --- head/sys/net/vnet.h Fri Feb 7 13:40:22 2014(r261589) +++ head/sys/net/vnet.h Fri Feb 7 13:47:33 2014(r261590) @@ -290,15 +290,10 @@ void vnet_data_free(void *start_arg, in * arguments themselves, if required. */ #ifdef SYSCTL_OID -intvnet_sysctl_handle_int(SYSCTL_HANDLER_ARGS); -intvnet_sysctl_handle_opaque(SYSCTL_HANDLER_ARGS); -intvnet_sysctl_handle_string(SYSCTL_HANDLER_ARGS); -intvnet_sysctl_handle_uint(SYSCTL_HANDLER_ARGS); - #defineSYSCTL_VNET_INT(parent, nbr, name, access, ptr, val, descr) \ SYSCTL_OID(parent, nbr, name, \ CTLTYPE_INT|CTLFLAG_MPSAFE|CTLFLAG_VNET|(access), \ - ptr, val, vnet_sysctl_handle_int, "I", descr) + ptr, val, sysctl_handle_int, "I", descr) #defineSYSCTL_VNET_PROC(parent, nbr, name, access, ptr, arg, handler, \ fmt, descr) \ CTASSERT(((access) & CTLTYPE) != 0);\ @@ -312,16 +307,16 @@ int vnet_sysctl_handle_uint(SYSCTL_HANDL #defineSYSCTL_VNET_STRING(parent, nbr, name, access, arg, len, descr) \ SYSCTL_OID(parent, nbr, name, \ CTLTYPE_STRING|CTLFLAG_VNET|(access), \ - arg, len, vnet_sysctl_handle_string, "A", descr) + arg, len, sysctl_handle_string, "A", descr) #defineSYSCTL_VNET_STRUCT(parent, nbr, name, access, ptr, type, descr) \ SYSCTL_OID(parent, nbr, name, \ CTLTYPE_OPAQUE|CTLFLAG_VNET|(access), ptr, \ - sizeof(struct type), vnet_sysctl_handle_opaque, "S," #type, \ + sizeof(struct type), sysctl_handle_opaque, "S," #type, \ descr) #defineSYSCTL_VNET_UINT(parent, nbr, name, access, ptr, val, descr) \ SYSCTL_OID(parent, nbr, name, \ CTLTYPE_UINT|CTLFLAG_MPSAFE|CTLFLAG_VNET|(access), \ - ptr, val, vnet_sysctl_handle_uint, "IU", descr) + ptr, val, sysctl_handle
Re: svn commit: r261585 - head/sys/dev/vt/hw/vga
Hi Aleksandr, On 7 February 2014 13:39, Aleksandr Rybalko wrote: > +static void > +vga_setpixel(struct vt_device *vd, int x, int y, term_color_t color) > +{ > +} > + > +static void > +vga_drawrect(struct vt_device *vd, int x1, int y1, int x2, int y2, int fill, > +term_color_t color) > +{ > +} > + > static inline void > vga_bitblt_draw(struct vt_device *vd, const uint8_t *src, > u_long ldst, uint8_t shift, unsigned int width, unsigned int height, My question is, why do the setpixel and drawrect functions take signed coordinates, whereas bitblt does not? Wouldn' it be better to use unsigned coordinates all over the place? Furthermore, I think it's a bit weird that vga_bitbltchr() contains explicit bounds checking. What happened there? I remember at one point in time, we had the nice invariant that vt(9) never attempted to draw outside of the display resolution. What caused us to give up on that? -- Ed Schouten ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r261591 - head/lib/libstand/powerpc
Author: nwhitehorn Date: Fri Feb 7 14:24:36 2014 New Revision: 261591 URL: http://svnweb.freebsd.org/changeset/base/261591 Log: Make libstand setjmp work for both 64- and 32-bit ABIs. Modified: head/lib/libstand/powerpc/_setjmp.S Modified: head/lib/libstand/powerpc/_setjmp.S == --- head/lib/libstand/powerpc/_setjmp.S Fri Feb 7 13:47:33 2014 (r261590) +++ head/lib/libstand/powerpc/_setjmp.S Fri Feb 7 14:24:36 2014 (r261591) @@ -1,36 +1,115 @@ -/* $NetBSD: _setjmp.S,v 1.1 1997/03/29 20:55:53 thorpej Exp $ */ +/* $FreeBSD$ */ +/* from: NetBSD: setjmp.S,v 1.1 1998/01/27 15:13:12 sakamoto Exp $ */ +/* from: OpenBSD: setjmp.S,v 1.2 1996/12/28 06:22:18 rahnds Exp */ +/* kernel version of this file, does not have signal goop */ +/* int setjmp(jmp_buf env) */ #include -#if (defined(LIBC_SCCS) || defined(LIBC_RCS)) && !defined(lint) - .text - .asciz "$FreeBSD$" +#ifdef __powerpc64__ +#define LD_REG ld +#defineST_REG std +#defineREGWIDTH 8 +#else +#defineLD_REG lwz +#defineST_REG stw +#defineREGWIDTH 4 #endif -/* - * C library -- _setjmp, _longjmp - * - * _longjmp(a,v) - * will generate a "return(v?v:1)" from the last call to - * _setjmp(a) - * by restoring registers from the stack. - * The previous signal state is NOT restored. - */ - -ENTRY(_setjmp) - mflr11 - mfcr12 - mr 10,1 - mr 9,2 - stmw9,8(3) - li 3,0 +#define JMP_r1 1*REGWIDTH +#define JMP_r2 2*REGWIDTH +#define JMP_r143*REGWIDTH +#define JMP_r15 4*REGWIDTH +#define JMP_r16 5*REGWIDTH +#define JMP_r17 6*REGWIDTH +#define JMP_r18 7*REGWIDTH +#define JMP_r19 8*REGWIDTH +#define JMP_r20 9*REGWIDTH +#define JMP_r21 10*REGWIDTH +#define JMP_r22 11*REGWIDTH +#define JMP_r23 12*REGWIDTH +#define JMP_r24 13*REGWIDTH +#define JMP_r25 14*REGWIDTH +#define JMP_r26 15*REGWIDTH +#define JMP_r27 16*REGWIDTH +#define JMP_r28 17*REGWIDTH +#define JMP_r29 18*REGWIDTH +#define JMP_r30 19*REGWIDTH +#define JMP_r31 20*REGWIDTH +#define JMP_lr 21*REGWIDTH +#define JMP_cr 22*REGWIDTH +#define JMP_ctr23*REGWIDTH +#define JMP_xer24*REGWIDTH +#define JMP_sig25*REGWIDTH + +ASENTRY_NOPROF(setjmp) + ST_REG 31, JMP_r31(3) + /* r1, r2, r14-r30 */ + ST_REG 1, JMP_r1 (3) + ST_REG 2, JMP_r2 (3) + ST_REG 14, JMP_r14(3) + ST_REG 15, JMP_r15(3) + ST_REG 16, JMP_r16(3) + ST_REG 17, JMP_r17(3) + ST_REG 18, JMP_r18(3) + ST_REG 19, JMP_r19(3) + ST_REG 20, JMP_r20(3) + ST_REG 21, JMP_r21(3) + ST_REG 22, JMP_r22(3) + ST_REG 23, JMP_r23(3) + ST_REG 24, JMP_r24(3) + ST_REG 25, JMP_r25(3) + ST_REG 26, JMP_r26(3) + ST_REG 27, JMP_r27(3) + ST_REG 28, JMP_r28(3) + ST_REG 29, JMP_r29(3) + ST_REG 30, JMP_r30(3) + /* cr, lr, ctr, xer */ + mfcr 0 + ST_REG 0, JMP_cr(3) + mflr 0 + ST_REG 0, JMP_lr(3) + mfctr 0 + ST_REG 0, JMP_ctr(3) + mfxer 0 + ST_REG 0, JMP_xer(3) + /* f14-f31, fpscr */ + li 3, 0 blr -ENTRY(_longjmp) - lmw 9,8(3) - mtlr11 - mtcr12 - mr 2,9 - mr 1,10 - mr 3,4 + +.extern sigsetmask +ASENTRY_NOPROF(longjmp) + LD_REG 31, JMP_r31(3) + /* r1, r2, r14-r30 */ + LD_REG 1, JMP_r1 (3) + LD_REG 2, JMP_r2 (3) + LD_REG 14, JMP_r14(3) + LD_REG 15, JMP_r15(3) + LD_REG 16, JMP_r16(3) + LD_REG 17, JMP_r17(3) + LD_REG 18, JMP_r18(3) + LD_REG 19, JMP_r19(3) + LD_REG 20, JMP_r20(3) + LD_REG 21, JMP_r21(3) + LD_REG 22, JMP_r22(3) + LD_REG 23, JMP_r23(3) + LD_REG 24, JMP_r24(3) + LD_REG 25, JMP_r25(3) + LD_REG 26, JMP_r26(3) + LD_REG 27, JMP_r27(3) + LD_REG 28, JMP_r28(3) + LD_REG 29, JMP_r29(3) + LD_REG 30, JMP_r30(3) + /* cr, lr, ctr, xer */ + LD_REG 0, JMP_cr(3) + mtcr 0 + LD_REG 0, JMP_lr(3) + mtlr 0 + LD_REG 0, JMP_ctr(3) + mtctr 0 + LD_REG 0, JMP_xer(3) + mtxer 0 + /* f14-f31, fpscr */ + mr 3, 4 blr ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r261592 - head/sys/netinet
Author: glebius Date: Fri Feb 7 14:26:33 2014 New Revision: 261592 URL: http://svnweb.freebsd.org/changeset/base/261592 Log: Catch up on r261590. Modified: head/sys/netinet/in_pcb.c Modified: head/sys/netinet/in_pcb.c == --- head/sys/netinet/in_pcb.c Fri Feb 7 14:24:36 2014(r261591) +++ head/sys/netinet/in_pcb.c Fri Feb 7 14:26:33 2014(r261592) @@ -145,11 +145,7 @@ sysctl_net_ipport_check(SYSCTL_HANDLER_A { int error; -#ifdef VIMAGE - error = vnet_sysctl_handle_int(oidp, arg1, arg2, req); -#else error = sysctl_handle_int(oidp, arg1, arg2, req); -#endif if (error == 0) { RANGECHK(V_ipport_lowfirstauto, 1, IPPORT_RESERVED - 1); RANGECHK(V_ipport_lowlastauto, 1, IPPORT_RESERVED - 1); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r261593 - in head: share/man/man9 sys/sys sys/vm
Author: glebius Date: Fri Feb 7 14:29:03 2014 New Revision: 261593 URL: http://svnweb.freebsd.org/changeset/base/261593 Log: Provide macros that allow easily export uma(9) zone limits and current usage via sysctl(9): SYSCTL_UMA_MAX() SYSCTL_ADD_UMA_MAX() SYSCTL_UMA_CUR() SYSCTL_ADD_UMA_CUR() Sponsored by: Nginx, Inc. Modified: head/share/man/man9/zone.9 head/sys/sys/sysctl.h head/sys/vm/uma_core.c Modified: head/share/man/man9/zone.9 == --- head/share/man/man9/zone.9 Fri Feb 7 14:26:33 2014(r261592) +++ head/share/man/man9/zone.9 Fri Feb 7 14:29:03 2014(r261593) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 21, 2013 +.Dd February 7, 2014 .Dt ZONE 9 .Os .Sh NAME @@ -71,6 +71,11 @@ .Fn uma_zone_get_cur "uma_zone_t zone" .Ft void .Fn uma_zone_set_warning "uma_zone_t zone" "const char *warning" +.In sys/sysctl.h +.Fn SYSCTL_UMA_MAX parent nbr name access zone descr +.Fn SYSCTL_ADD_UMA_MAX ctx parent nbr name access zone descr +.Fn SYSCTL_UMA_CUR parent nbr name access zone descr +.Fn SYSCTL_ADD_UMA_CUR ctx parent nbr name access zone descr .Sh DESCRIPTION The zone allocator provides an efficient interface for managing dynamically-sized collections of items of similar size. @@ -307,6 +312,38 @@ Warnings can be turned off globally by s .Va vm.zone_warnings sysctl tunable to .Va 0 . +.Pp +The +.Fn SYSCTL_UMA_MAX parent nbr name access zone descr +macro declares a static +.Xr sysctl +oid that exports the effective upper limit number of items for a zone. +The +.Fa zone +argument should be a pointer to +.Vt uma_zone_t . +A read of the oid returns value obtained through +.Fn uma_zone_get_max . +A write to the oid sets new value via +.Fn uma_zone_set_max . +The +.Fn SYSCTL_ADD_UMA_MAX ctx parent nbr name access zone descr +macro is provided to create this type of oid dynamically. +.Pp +The +.Fn SYSCTL_UMA_CUR parent nbr name access zone descr +macro declares a static read only +.Xr sysctl +oid that exports the approximate current occupancy of the zone. +The +.Fa zone +argument should be a pointer to +.Vt uma_zone_t . +A read of the oid returns value obtained through +.Fn uma_zone_get_cur . +The +.Fn SYSCTL_ADD_UMA_CUR ctx parent nbr name zone descr +macro is provided to create this type of oid dynamically. .Sh RETURN VALUES The .Fn uma_zalloc Modified: head/sys/sys/sysctl.h == --- head/sys/sys/sysctl.h Fri Feb 7 14:26:33 2014(r261592) +++ head/sys/sys/sysctl.h Fri Feb 7 14:29:03 2014(r261593) @@ -186,6 +186,9 @@ int sysctl_handle_string(SYSCTL_HANDLER_ int sysctl_handle_opaque(SYSCTL_HANDLER_ARGS); int sysctl_handle_counter_u64(SYSCTL_HANDLER_ARGS); +int sysctl_handle_uma_zone_max(SYSCTL_HANDLER_ARGS); +int sysctl_handle_uma_zone_cur(SYSCTL_HANDLER_ARGS); + int sysctl_dpcpu_int(SYSCTL_HANDLER_ARGS); int sysctl_dpcpu_long(SYSCTL_HANDLER_ARGS); int sysctl_dpcpu_quad(SYSCTL_HANDLER_ARGS); @@ -431,6 +434,30 @@ SYSCTL_ALLOWED_TYPES(UINT64, uint64_t *a sysctl_add_oid(ctx, parent, nbr, name, (access), \ ptr, arg, handler, fmt, __DESCR(descr)) +/* Oid to handle limits on uma(9) zone specified by pointer. */ +#defineSYSCTL_UMA_MAX(parent, nbr, name, access, ptr, descr) \ + SYSCTL_ASSERT_TYPE(INT, ptr, parent, name); \ + SYSCTL_OID(parent, nbr, name, \ + CTLTYPE_INT | CTLFLAG_MPSAFE | (access),\ + ptr, 0, sysctl_handle_uma_zone_max, "I", descr) +#defineSYSCTL_ADD_UMA_MAX(ctx, parent, nbr, name, access, ptr, descr)\ + sysctl_add_oid(ctx, parent, nbr, name, \ + CTLTYPE_INT | CTLFLAG_MPSAFE | (access),\ + SYSCTL_ADD_ASSERT_TYPE(INT, ptr), 0,\ + sysctl_handle_uma_zone_max, "I", __DESCR(descr)) + +/* Oid to obtain current use of uma(9) zone specified by pointer. */ +#defineSYSCTL_UMA_CUR(parent, nbr, name, access, ptr, descr) \ + SYSCTL_ASSERT_TYPE(INT, ptr, parent, name); \ + SYSCTL_OID(parent, nbr, name, \ + CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_RD | (access), \ + ptr, 0, sysctl_handle_uma_zone_cur, "I", descr) +#defineSYSCTL_ADD_UMA_CUR(ctx, parent, nbr, name, access, ptr, descr) \ + sysctl_add_oid(ctx, parent, nbr, name, \ + CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_RD | (access), \ + SYSCTL_ADD_ASSERT_TYPE(INT, ptr), 0,\ + sysctl_handle_uma_zone_cur, "I", __DESCR(descr)) + /* * A macro to generate a read-only sysctl to indicate the presense of optional * kernel features.
svn commit: r261594 - head/sys/netinet
Author: glebius Date: Fri Feb 7 14:31:51 2014 New Revision: 261594 URL: http://svnweb.freebsd.org/changeset/base/261594 Log: Utilize SYSCTL_UMA_CUR() to export usage of syncache and tcp reassembly zones. Sponsored by: Nginx, Inc. Modified: head/sys/netinet/tcp_reass.c head/sys/netinet/tcp_syncache.c Modified: head/sys/netinet/tcp_reass.c == --- head/sys/netinet/tcp_reass.cFri Feb 7 14:29:03 2014 (r261593) +++ head/sys/netinet/tcp_reass.cFri Feb 7 14:31:51 2014 (r261594) @@ -75,8 +75,6 @@ __FBSDID("$FreeBSD$"); #include #endif /* TCPDEBUG */ -static int tcp_reass_sysctl_qsize(SYSCTL_HANDLER_ARGS); - static SYSCTL_NODE(_net_inet_tcp, OID_AUTO, reass, CTLFLAG_RW, 0, "TCP Segment Reassembly Queue"); @@ -86,10 +84,6 @@ SYSCTL_VNET_INT(_net_inet_tcp_reass, OID &VNET_NAME(tcp_reass_maxseg), 0, "Global maximum number of TCP Segments in Reassembly Queue"); -SYSCTL_VNET_PROC(_net_inet_tcp_reass, OID_AUTO, cursegments, -(CTLTYPE_INT | CTLFLAG_RD), NULL, 0, &tcp_reass_sysctl_qsize, "I", -"Global number of TCP Segments currently in Reassembly Queue"); - static VNET_DEFINE(int, tcp_reass_overflows) = 0; #defineV_tcp_reass_overflows VNET(tcp_reass_overflows) SYSCTL_VNET_INT(_net_inet_tcp_reass, OID_AUTO, overflows, @@ -99,6 +93,9 @@ SYSCTL_VNET_INT(_net_inet_tcp_reass, OID static VNET_DEFINE(uma_zone_t, tcp_reass_zone); #defineV_tcp_reass_zoneVNET(tcp_reass_zone) +SYSCTL_UMA_CUR(_net_inet_tcp_reass, OID_AUTO, cursegments, CTLFLAG_VNET, +&VNET_NAME(tcp_reass_zone), +"Global number of TCP Segments currently in Reassembly Queue"); /* Initialize TCP reassembly queue */ static void @@ -155,15 +152,6 @@ tcp_reass_flush(struct tcpcb *tp) tp, tp->t_segqlen)); } -static int -tcp_reass_sysctl_qsize(SYSCTL_HANDLER_ARGS) -{ - int qsize; - - qsize = uma_zone_get_cur(V_tcp_reass_zone); - return (sysctl_handle_int(oidp, &qsize, 0, req)); -} - int tcp_reass(struct tcpcb *tp, struct tcphdr *th, int *tlenp, struct mbuf *m) { Modified: head/sys/netinet/tcp_syncache.c == --- head/sys/netinet/tcp_syncache.c Fri Feb 7 14:29:03 2014 (r261593) +++ head/sys/netinet/tcp_syncache.c Fri Feb 7 14:31:51 2014 (r261594) @@ -126,7 +126,6 @@ struct syncache *syncache_lookup(struct static int syncache_respond(struct syncache *); static struct socket *syncache_socket(struct syncache *, struct socket *, struct mbuf *m); -static int syncache_sysctl_count(SYSCTL_HANDLER_ARGS); static void syncache_timeout(struct syncache *sc, struct syncache_head *sch, int docallout); static void syncache_timer(void *); @@ -170,9 +169,8 @@ SYSCTL_VNET_UINT(_net_inet_tcp_syncache, &VNET_NAME(tcp_syncache.cache_limit), 0, "Overall entry limit for syncache"); -SYSCTL_VNET_PROC(_net_inet_tcp_syncache, OID_AUTO, count, (CTLTYPE_UINT|CTLFLAG_RD), -NULL, 0, &syncache_sysctl_count, "IU", -"Current number of entries in syncache"); +SYSCTL_UMA_CUR(_net_inet_tcp_syncache, OID_AUTO, count, CTLFLAG_VNET, +&VNET_NAME(tcp_syncache.zone), "Current number of entries in syncache"); SYSCTL_VNET_UINT(_net_inet_tcp_syncache, OID_AUTO, hashsize, CTLFLAG_RDTUN, &VNET_NAME(tcp_syncache.hashsize), 0, @@ -328,15 +326,6 @@ syncache_destroy(void) } #endif -static int -syncache_sysctl_count(SYSCTL_HANDLER_ARGS) -{ - int count; - - count = uma_zone_get_cur(V_tcp_syncache.zone); - return (sysctl_handle_int(oidp, &count, 0, req)); -} - /* * Inserts a syncache entry into the specified bucket row. * Locks and unlocks the syncache_head autonomously. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r261595 - in head: share/man/man9 sys/sys
Author: glebius Date: Fri Feb 7 14:34:31 2014 New Revision: 261595 URL: http://svnweb.freebsd.org/changeset/base/261595 Log: sysctl_handle_counter_u64() doesn't use arg2 argument, thus simplify the SYSCTL_COUNTER_U64() macro. Sponsored by: Nginx, Inc. Modified: head/share/man/man9/counter.9 head/sys/sys/sysctl.h Modified: head/share/man/man9/counter.9 == --- head/share/man/man9/counter.9 Fri Feb 7 14:31:51 2014 (r261594) +++ head/share/man/man9/counter.9 Fri Feb 7 14:34:31 2014 (r261595) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 3, 2013 +.Dd February 7, 2014 .Dt COUNTER 9 .Os .Sh NAME @@ -52,7 +52,7 @@ .Ft void .Fn counter_u64_zero "counter_u64_t c" .In sys/sysctl.h -.Fn SYSCTL_COUNTER_U64 parent nbr name access ptr val descr +.Fn SYSCTL_COUNTER_U64 parent nbr name access ptr descr .Fn SYSCTL_ADD_COUNTER_U64 ctx parent nbr name access ptr descr .Sh DESCRIPTION .Nm @@ -126,7 +126,7 @@ value for any moment. Clear the counter .Fa c and set it to zero. -.It Fn SYSCTL_COUNTER_U64 parent nbr name access ptr val descr +.It Fn SYSCTL_COUNTER_U64 parent nbr name access ptr descr Declare a static .Xr sysctl oid that would represent a Modified: head/sys/sys/sysctl.h == --- head/sys/sys/sysctl.h Fri Feb 7 14:31:51 2014(r261594) +++ head/sys/sys/sysctl.h Fri Feb 7 14:34:31 2014(r261595) @@ -393,11 +393,11 @@ SYSCTL_ALLOWED_TYPES(UINT64, uint64_t *a sysctl_handle_64, "QU", __DESCR(descr)) /* Oid for a 64-bit unsigned counter(9). The pointer must be non NULL. */ -#defineSYSCTL_COUNTER_U64(parent, nbr, name, access, ptr, val, descr) \ +#defineSYSCTL_COUNTER_U64(parent, nbr, name, access, ptr, descr) \ SYSCTL_ASSERT_TYPE(UINT64, ptr, parent, name); \ SYSCTL_OID(parent, nbr, name, \ CTLTYPE_U64 | CTLFLAG_MPSAFE | (access),\ - ptr, val, sysctl_handle_counter_u64, "QU", descr) + ptr, 0, sysctl_handle_counter_u64, "QU", descr) #defineSYSCTL_ADD_COUNTER_U64(ctx, parent, nbr, name, access, ptr, descr)\ sysctl_add_oid(ctx, parent, nbr, name, \ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r261597 - head/share/man/man4
Author: hselasky Date: Fri Feb 7 14:56:34 2014 New Revision: 261597 URL: http://svnweb.freebsd.org/changeset/base/261597 Log: Add manual page for wsp driver. MFC after:1 week Added: head/share/man/man4/wsp.4 (contents, props changed) Added: head/share/man/man4/wsp.4 == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/wsp.4 Fri Feb 7 14:56:34 2014(r261597) @@ -0,0 +1,96 @@ +.\" Copyright (c) 2014 Hans Petter Selasky . +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\"notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\"notice, this list of conditions and the following disclaimer in the +.\"documentation and/or other materials provided with the distribution. +.\" 3. Neither the name of the author nor the names of any co-contributors +.\"may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd February 7, 2014 +.Dt WSP 4 +.Os +.Sh NAME +.Nm wsp +.Nd Wellspring touchpad driver +.Sh SYNOPSIS +To compile this driver into the kernel, place the following lines into +your kernel configuration file: +.Bd -ragged -offset indent +.Cd "device wsp" +.Cd "device usb" +.Ed +.Pp +Alternativly, to load the driver as a module at boot time, +place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +wsp_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for the Apple Internal Trackpad +device found in many Apple laptops. +.Pp +The driver simulates a three\-button mouse using multi\-finger tap +detection. +. +A single\-finger press generates a left button click. +A two\-finger tap maps to the right button; whereas a three\-finger tap +gets treated as a middle button click. +. +.Pp +.Nm +supports dynamic reconfiguration using +.Xr sysctl 8 ; +through nodes under +.Nm hw.usb.wsp . +Pointer sensitivity can be controlled using the sysctl tunable +.Nm hw.usb.wsp.scale_factor . +. +.Sh FILES +.Nm +creates a blocking pseudo\-device file, +.Pa /dev/wsp0 , +which presents the mouse as a +.Ar sysmouse +or +.Ar mousesystems +type device\-\-see +.Xr moused 8 +for an explanation of these mouse +types. +.Sh SEE ALSO +.Xr sysmouse 4 , +.Xr usb 4 , +.Xr loader.conf 5 , +.Xr xorg.conf 5 Pq Pa ports/x11/xorg , +.Xr moused 8 , +.Xr sysctl 8 +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was written by +.An Huang Wen Hui Aq huang...@gmail.com ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r261598 - head/share/man/man4
Author: hselasky Date: Fri Feb 7 14:58:40 2014 New Revision: 261598 URL: http://svnweb.freebsd.org/changeset/base/261598 Log: Update atp driver manual page. Moused is now started automatically by devd. MFC after:1 week Modified: head/share/man/man4/atp.4 Modified: head/share/man/man4/atp.4 == --- head/share/man/man4/atp.4 Fri Feb 7 14:56:34 2014(r261597) +++ head/share/man/man4/atp.4 Fri Feb 7 14:58:40 2014(r261598) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 12, 2009 +.Dd February 7, 2014 .Dt ATP 4 .Os .Sh NAME @@ -114,57 +114,6 @@ type device\-\-see .Xr moused 8 for an explanation of these mouse types. -.Xr moused 8 -can be configured to read touchpad data from -.Pa /dev/atp0 -and pass it along to the -.Xr sysmouse 4 -driver so that any process wanting to utilize mouse operation (such as -an X server) may fetch it from -.Pa /dev/sysmouse ; -alternatively, -.Pa /dev/atp0 -may be manipulated via -.Xr read 2 -and -.Xr ioctl 2 -calls to get mouse data directly. -.Sh EXAMPLES -To use a compatible Apple Trackpad as your console mouse: -.Pp -.Dl moused -p /dev/atp0 -t auto -.Pp -To launch -.Xr moused 8 -automatically upon boot, add the following to -.Pa /etc/rc.conf : -.Pp -.Dl moused_enable="YES" -.Dl moused_type="auto" -.Dl moused_port="/dev/atp0" -.Pp -If you want -.Xr moused 8 -to also probe for external USB mice or other devices, then add the -following to -.Pa /etc/rc.conf : -.Pp -.Dl moused_nondefault_enable="YES" -.Dl moused_ums0_enable="YES" -.Dl moused_ums1_enable="YES" -.Pp -To be able to use the trackpad under X, change the "Pointer" section in -.Nm xorg.conf -to the following: -.Pp -.Dl Device "/dev/atp0" -.Dl Protocol "Auto" -.Pp -Better still, if you want to be able to use the mouse in both virtual -consoles as well as in X change it to: -.Pp -.Dl Device "/dev/sysmouse" -.Dl Protocol "Auto" .Sh SEE ALSO .Xr sysmouse 4 , .Xr usb 4 , ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r261585 - head/sys/dev/vt/hw/vga
On Fri, 7 Feb 2014 15:04:47 +0100 Ed Schouten wrote: > Hi Aleksandr, > > On 7 February 2014 13:39, Aleksandr Rybalko wrote: > > +static void > > +vga_setpixel(struct vt_device *vd, int x, int y, term_color_t color) > > +{ > > +} > > + > > +static void > > +vga_drawrect(struct vt_device *vd, int x1, int y1, int x2, int y2, int > > fill, > > +term_color_t color) > > +{ > > +} > > + > > static inline void > > vga_bitblt_draw(struct vt_device *vd, const uint8_t *src, > > u_long ldst, uint8_t shift, unsigned int width, unsigned int height, > > My question is, why do the setpixel and drawrect functions take signed > coordinates, whereas bitblt does not? Wouldn' it be better to use > unsigned coordinates all over the place? Theoretically unsigned a bit better, practically does not matter (+/-2G or 4G). Using signed int we also can ask to draw object which is partially out of screen. (and strlen("int") < strlen("unsigned int") :)) If you have objections, let discuss it. Also people asking me about advanced features of vt(9), like use multiple displays. I'm not sure, but signed coordinates may help with some things on that way (or makes more problems :) ). > > Furthermore, I think it's a bit weird that vga_bitbltchr() contains > explicit bounds checking. What happened there? I remember at one point > in time, we had the nice invariant that vt(9) never attempted to draw > outside of the display resolution. What caused us to give up on that? Mouse cursor allowed to partially go out of screen, so we have to check (or use special function for mouse cursor). > > -- > Ed Schouten -- Aleksandr Rybalko ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r261600 - head/sys/dev/bvm
Author: jhb Date: Fri Feb 7 15:10:24 2014 New Revision: 261600 URL: http://svnweb.freebsd.org/changeset/base/261600 Log: - Use a callout instead of the deprecated timeout_handle. - Set the console name always so that the bvm console device can be used via conscontrol even if it isn't chosen as the default console. Modified: head/sys/dev/bvm/bvm_console.c Modified: head/sys/dev/bvm/bvm_console.c == --- head/sys/dev/bvm/bvm_console.c Fri Feb 7 15:00:08 2014 (r261599) +++ head/sys/dev/bvm/bvm_console.c Fri Feb 7 15:10:24 2014 (r261600) @@ -58,8 +58,7 @@ static struct ttydevsw bvm_ttydevsw = { }; static int polltime; -static struct callout_handle bvm_timeouthandle -= CALLOUT_HANDLE_INITIALIZER(&bvm_timeouthandle); +static struct callout bvm_timer; #if defined(KDB) static int alt_break_state; @@ -107,9 +106,9 @@ cn_drvinit(void *unused) { struct tty *tp; - if (bvm_consdev.cn_pri != CN_DEAD && - bvm_consdev.cn_name[0] != '\0') { + if (bvm_consdev.cn_pri != CN_DEAD) { tp = tty_alloc(&bvm_ttydevsw, NULL); + callout_init_mtx(&bvm_timer, tty_getlock(tp), 0); tty_makedev(tp, NULL, "bvmcons"); } } @@ -120,7 +119,7 @@ bvm_tty_open(struct tty *tp) polltime = hz / BVMCONS_POLL_HZ; if (polltime < 1) polltime = 1; - bvm_timeouthandle = timeout(bvm_timeout, tp, polltime); + callout_reset(&bvm_timer, polltime, bvm_timeout, tp); return (0); } @@ -129,8 +128,9 @@ static void bvm_tty_close(struct tty *tp) { - /* XXX Should be replaced with callout_stop(9) */ - untimeout(bvm_timeout, tp, bvm_timeouthandle); + tty_lock(tp); + callout_stop(&bvm_timer); + tty_unlock(tp); } static void @@ -158,13 +158,12 @@ bvm_timeout(void *v) tp = (struct tty *)v; - tty_lock(tp); + tty_lock_assert(tp, MA_OWNED); while ((c = bvm_cngetc(NULL)) != -1) ttydisc_rint(tp, c, 0); ttydisc_rint_done(tp); - tty_unlock(tp); - bvm_timeouthandle = timeout(bvm_timeout, tp, polltime); + callout_reset(&bvm_timer, polltime, bvm_timeout, tp); } static void @@ -174,6 +173,7 @@ bvm_cnprobe(struct consdev *cp) disabled = 0; cp->cn_pri = CN_DEAD; + strcpy(cp->cn_name, "bvmcons"); resource_int_value("bvmconsole", 0, "disabled", &disabled); if (!disabled) { @@ -195,8 +195,6 @@ bvm_cninit(struct consdev *cp) for (i = 0; i < strlen(bootmsg); i++) bvm_cnputc(cp, bootmsg[i]); } - - strcpy(cp->cn_name, "bvmcons"); } static void ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r261601 - in head: sys/net sys/netinet sys/netinet6 usr.bin/netstat
Author: glebius Date: Fri Feb 7 15:18:23 2014 New Revision: 261601 URL: http://svnweb.freebsd.org/changeset/base/261601 Log: o Revamp API between flowtable and netinet, netinet6. - ip_output() and ip_output6() simply call flowtable_lookup(), passing mbuf and address family. That's the only code under #ifdef FLOWTABLE in the protocols code now. o Revamp statistics gathering and export. - Remove hand made pcpu stats, and utilize counter(9). - Snapshot of statistics is available via 'netstat -rs'. - All sysctls are moved into net.flowtable namespace, since spreading them over net.inet isn't correct. o Properly separate at compile time INET and INET6 parts. o General cleanup. - Remove chain of multiple flowtables. We simply have one for IPv4 and one for IPv6. - Flowtables are allocated in flowtable.c, symbols are static. - With proper argument to SYSINIT() we no longer need flowtable_ready. - Hash salt doesn't need to be per-VNET. - Removed rudimentary debugging, which use quite useless in dtrace era. The runtime behavior of flowtable shouldn't be changed by this commit. Sponsored by: Netflix Sponsored by: Nginx, Inc. Added: head/usr.bin/netstat/flowtable.c (contents, props changed) Modified: head/sys/net/flowtable.c head/sys/net/flowtable.h head/sys/net/route.c head/sys/netinet/ip_input.c head/sys/netinet/ip_output.c head/sys/netinet6/in6_proto.c head/sys/netinet6/ip6_input.c head/sys/netinet6/ip6_output.c head/usr.bin/netstat/Makefile head/usr.bin/netstat/main.c head/usr.bin/netstat/netstat.h Modified: head/sys/net/flowtable.c == --- head/sys/net/flowtable.cFri Feb 7 15:10:24 2014(r261600) +++ head/sys/net/flowtable.cFri Feb 7 15:18:23 2014(r261601) @@ -146,23 +146,13 @@ union flentryp { struct flentry **pcpu[MAXCPU]; }; -struct flowtable_stats { - uint64_tft_collisions; - uint64_tft_allocated; - uint64_tft_misses; - uint64_tft_max_depth; - uint64_tft_free_checks; - uint64_tft_frees; - uint64_tft_hits; - uint64_tft_lookups; -} __aligned(CACHE_LINE_SIZE); - struct flowtable { - struct flowtable_stats ft_stats[MAXCPU]; + counter_u64_t *ft_stat; + uma_zone_t ft_zone; int ft_size; int ft_lock_count; uint32_tft_flags; - char*ft_name; + uint32_tft_max_depth; fl_lock_t *ft_lock; fl_lock_t *ft_unlock; fl_rtalloc_t*ft_rtalloc; @@ -173,9 +163,7 @@ struct flowtable { union flentryp ft_table; bitstr_t*ft_masks[MAXCPU]; bitstr_t*ft_tmpmask; - struct flowtable *ft_next; - uint32_tft_count __aligned(CACHE_LINE_SIZE); uint32_tft_udp_idle __aligned(CACHE_LINE_SIZE); uint32_tft_fin_wait_idle; uint32_tft_syn_idle; @@ -183,17 +171,12 @@ struct flowtable { boolean_t ft_full; } __aligned(CACHE_LINE_SIZE); -static struct proc *flowcleanerproc; -static VNET_DEFINE(struct flowtable *, flow_list_head); -static VNET_DEFINE(uint32_t, flow_hashjitter); -static VNET_DEFINE(uma_zone_t, flow_ipv4_zone); -static VNET_DEFINE(uma_zone_t, flow_ipv6_zone); - -#defineV_flow_list_headVNET(flow_list_head) -#defineV_flow_hashjitter VNET(flow_hashjitter) -#defineV_flow_ipv4_zoneVNET(flow_ipv4_zone) -#defineV_flow_ipv6_zoneVNET(flow_ipv6_zone) +#defineFLOWSTAT_ADD(ft, name, v) \ + counter_u64_add((ft)->ft_stat[offsetof(struct flowtable_stat, name) / sizeof(uint64_t)], (v)) +#defineFLOWSTAT_INC(ft, name) FLOWSTAT_ADD(ft, name, 1) +static struct proc *flowcleanerproc; +static uint32_t flow_hashjitter; static struct cv flowclean_f_cv; static struct cv flowclean_c_cv; @@ -201,24 +184,8 @@ static struct mtx flowclean_lock; static uint32_tflowclean_cycles; static uint32_tflowclean_freq; -#ifdef FLOWTABLE_DEBUG -#define FLDPRINTF(ft, flags, fmt, ...) \ -do { \ - if ((ft)->ft_flags & (flags)) \ - printf((fmt), __VA_ARGS__); \ -} while (0); \ - -#else -#define FLDPRINTF(ft, flags, fmt, ...) - -#endif - - /* * TODO: - * - Make flowtable stats per-cpu, aggregated at sysctl call time, - * to avoid extra cache evictions caused by incrementing a shared - * counter * - add sysctls to resize && flush flow tables * - Add per flowtable sysctls for statistics and configuring timeouts * - add saturation counter to rtentry to support per-packet load-balancing @@ -230,148 +197
svn commit: r261602 - head/lib/libc/inet
Author: kevlo Date: Fri Feb 7 15:26:19 2014 New Revision: 261602 URL: http://svnweb.freebsd.org/changeset/base/261602 Log: Set errno on inet_ntop(3) failure. Reviewed by: glebius Modified: head/lib/libc/inet/inet_ntop.c Modified: head/lib/libc/inet/inet_ntop.c == --- head/lib/libc/inet/inet_ntop.c Fri Feb 7 15:18:23 2014 (r261601) +++ head/lib/libc/inet/inet_ntop.c Fri Feb 7 15:26:19 2014 (r261602) @@ -45,7 +45,7 @@ __FBSDID("$FreeBSD$"); static const char *inet_ntop4(const u_char *src, char *dst, socklen_t size); static const char *inet_ntop6(const u_char *src, char *dst, socklen_t size); -/* char * +/* const char * * inet_ntop(af, src, dst, size) * convert a network format address to presentation format. * return: @@ -169,8 +169,10 @@ inet_ntop6(const u_char *src, char *dst, if (i == 6 && best.base == 0 && (best.len == 6 || (best.len == 7 && words[7] != 0x0001) || (best.len == 5 && words[5] == 0x))) { - if (!inet_ntop4(src+12, tp, sizeof tmp - (tp - tmp))) + if (!inet_ntop4(src+12, tp, sizeof tmp - (tp - tmp))) { + errno = ENOSPC; return (NULL); + } tp += strlen(tp); break; } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r261603 - head/sys/boot/efi
Author: emaste Date: Fri Feb 7 16:28:40 2014 New Revision: 261603 URL: http://svnweb.freebsd.org/changeset/base/261603 Log: Don't force efi to a 32-bit build on amd64 Sponsored by: The FreeBSD Foundation Modified: head/sys/boot/efi/Makefile.inc Modified: head/sys/boot/efi/Makefile.inc == --- head/sys/boot/efi/Makefile.inc Fri Feb 7 15:26:19 2014 (r261602) +++ head/sys/boot/efi/Makefile.inc Fri Feb 7 16:28:40 2014 (r261603) @@ -2,17 +2,10 @@ BINDIR?= /boot -.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "i386" CFLAGS+=-march=i386 .endif -.if ${MACHINE_CPUARCH} == "amd64" -CFLAGS+=-m32 -ACFLAGS+= -m32 -LDFLAGS+= -m elf_i386_fbsd -AFLAGS+=--32 -.endif - # Options used when building app-specific efi components CFLAGS+= -ffreestanding -fshort-wchar -Wformat LDFLAGS+= -nostdlib ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r261601 - in head: sys/net sys/netinet sys/netinet6 usr.bin/netstat
On Fri, Feb 07, 2014 at 03:34:27PM +, Bjoern A. Zeeb wrote: B> > * XXX This does not end up updating timeouts at runtime B> > * and only reflects the value for the last table added :-/ B> > */ B> > -SYSCTL_VNET_INT(_net_inet_flowtable, OID_AUTO, syn_expire, CTLFLAG_RW, B> > +SYSCTL_VNET_INT(_net_flowtable, OID_AUTO, syn_expire, CTLFLAG_RW, B> > &VNET_NAME(flowtable_syn_expire), 0, B> > "seconds after which to remove syn allocated flow."); B> > -SYSCTL_VNET_INT(_net_inet_flowtable, OID_AUTO, udp_expire, CTLFLAG_RW, B> > +SYSCTL_VNET_INT(_net_flowtable, OID_AUTO, udp_expire, CTLFLAG_RW, B> > &VNET_NAME(flowtable_udp_expire), 0, B> > "seconds after which to remove flow allocated to UDP."); B> > -SYSCTL_VNET_INT(_net_inet_flowtable, OID_AUTO, fin_wait_expire, CTLFLAG_RW, B> > +SYSCTL_VNET_INT(_net_flowtable, OID_AUTO, fin_wait_expire, CTLFLAG_RW, B> > &VNET_NAME(flowtable_fin_wait_expire), 0, B> > "seconds after which to remove a flow in FIN_WAIT."); B> > -SYSCTL_VNET_INT(_net_inet_flowtable, OID_AUTO, tcp_expire, CTLFLAG_RW, B> > +SYSCTL_VNET_INT(_net_flowtable, OID_AUTO, tcp_expire, CTLFLAG_RW, B> > &VNET_NAME(flowtable_tcp_expire), 0, B> > "seconds after which to remove flow allocated to a TCP connection."); B> … B> B> B> This is not what we are doing for a lot of other things in the tree which simply treat “inet” as “IP” without version number. Now I know that the floatable sits even between L3 and L2 given it caches pairs, I am still not sure I want to make net.* the “dumping ground” for these. And that's not nice that we are using "inet" as dumping ground for all kind of IP. B> Pending a better solution I don’t care apart from that sysctl.confs entries for the people using floatable after all break with this. Taking into account absence of FLOWTABLE in GENERIC and all the problems that were (are?) there, I'm pretty sure these people are empty set :) -- Totus tuus, Glebius. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r261604 - head/contrib/libc++/include
Author: eadler Date: Fri Feb 7 18:10:34 2014 New Revision: 261604 URL: http://svnweb.freebsd.org/changeset/base/261604 Log: HEAD is not buildable for the past day. Commit a 'quick fix' in order to permit buildworld to complete. Reviewed by: theraven Modified: head/contrib/libc++/include/locale Modified: head/contrib/libc++/include/locale == --- head/contrib/libc++/include/locale Fri Feb 7 16:28:40 2014 (r261603) +++ head/contrib/libc++/include/locale Fri Feb 7 18:10:34 2014 (r261604) @@ -1012,7 +1012,7 @@ num_get<_CharT, _InputIterator>::__do_ge unsigned __dc = 0; for (; __b != __e; ++__b) { -if (__a_end - __a == __buf.size()) +if (__a_end - __a == (long)__buf.size()) { size_t __tmp = __buf.size(); __buf.resize(2*__buf.size()); @@ -1062,7 +1062,7 @@ num_get<_CharT, _InputIterator>::__do_ge unsigned __dc = 0; for (; __b != __e; ++__b) { -if (__a_end - __a == __buf.size()) +if (__a_end - __a == (long)__buf.size()) { size_t __tmp = __buf.size(); __buf.resize(2*__buf.size()); @@ -1116,7 +1116,7 @@ num_get<_CharT, _InputIterator>::__do_ge char __exp = 'E'; for (; __b != __e; ++__b) { -if (__a_end - __a == __buf.size()) +if (__a_end - __a == (long)__buf.size()) { size_t __tmp = __buf.size(); __buf.resize(2*__buf.size()); @@ -1166,7 +1166,7 @@ num_get<_CharT, _InputIterator>::do_get( unsigned __dc = 0; for (; __b != __e; ++__b) { -if (__a_end - __a == __buf.size()) +if (__a_end - __a == (long)__buf.size()) { size_t __tmp = __buf.size(); __buf.resize(2*__buf.size()); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r261604 - head/contrib/libc++/include
On Fri, Feb 7, 2014 at 11:10 AM, Eitan Adler wrote: > Author: eadler > Date: Fri Feb 7 18:10:34 2014 > New Revision: 261604 > URL: http://svnweb.freebsd.org/changeset/base/261604 > > Log: > HEAD is not buildable for the past day. Commit a 'quick fix' in order to > permit > buildworld to complete. > > Reviewed by: theraven > > Modified: > head/contrib/libc++/include/locale Are you sure that this will work on all architectures? It implicitly assumes that ptrdiff_t is the same as long. IMHO, it's better to cast the left side of the comparison to size_t, because it will always be nonnegative as long as __a_end is greater than or equal to __a. They certainly sound like it, based on the names. -Alan ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r261596 - head/sys/arm/arm
Author: ian Date: Fri Feb 7 14:38:51 2014 New Revision: 261596 URL: http://svnweb.freebsd.org/changeset/base/261596 Log: Remove references to PHYSADDR where it's used only in debugging output, and where the code that references it can safely be elided if it's not defined (meaning the code is used for legacy arm platforms that still define the compile-time PHYSADDR but not on newer systems that calculate the value at runtime). Modified: head/sys/arm/arm/elf_trampoline.c head/sys/arm/arm/pmap-v6.c head/sys/arm/arm/pmap.c head/sys/arm/arm/support.S Modified: head/sys/arm/arm/elf_trampoline.c == --- head/sys/arm/arm/elf_trampoline.c Fri Feb 7 14:34:31 2014 (r261595) +++ head/sys/arm/arm/elf_trampoline.c Fri Feb 7 14:38:51 2014 (r261596) @@ -189,7 +189,7 @@ _startC(void) int physaddr = KERNPHYSADDR; int tmp1; unsigned int sp = ((unsigned int)&_end & ~3) + 4; -#if defined(FLASHADDR) && defined(LOADERRAMADDR) +#if defined(FLASHADDR) && defined(PHYSADDR) && defined(LOADERRAMADDR) unsigned int pc; __asm __volatile("mov %0, pc\n" Modified: head/sys/arm/arm/pmap-v6.c == --- head/sys/arm/arm/pmap-v6.c Fri Feb 7 14:34:31 2014(r261595) +++ head/sys/arm/arm/pmap-v6.c Fri Feb 7 14:38:51 2014(r261596) @@ -1312,8 +1312,6 @@ pmap_init(void) vm_size_t s; int i, pv_npg; - PDEBUG(1, printf("pmap_init: phys_start = %08x\n", PHYSADDR)); - l2zone = uma_zcreate("L2 Table", L2_TABLE_SIZE_REAL, pmap_l2ptp_ctor, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM | UMA_ZONE_NOFREE); l2table_zone = uma_zcreate("L2 Table", sizeof(struct l2_dtable), NULL, Modified: head/sys/arm/arm/pmap.c == --- head/sys/arm/arm/pmap.c Fri Feb 7 14:34:31 2014(r261595) +++ head/sys/arm/arm/pmap.c Fri Feb 7 14:38:51 2014(r261596) @@ -1826,8 +1826,6 @@ pmap_init(void) { int shpgperproc = PMAP_SHPGPERPROC; - PDEBUG(1, printf("pmap_init: phys_start = %08x\n", PHYSADDR)); - l2zone = uma_zcreate("L2 Table", L2_TABLE_SIZE_REAL, pmap_l2ptp_ctor, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM | UMA_ZONE_NOFREE); l2table_zone = uma_zcreate("L2 Table", sizeof(struct l2_dtable), NULL, Modified: head/sys/arm/arm/support.S == --- head/sys/arm/arm/support.S Fri Feb 7 14:34:31 2014(r261595) +++ head/sys/arm/arm/support.S Fri Feb 7 14:38:51 2014(r261596) @@ -939,7 +939,7 @@ END(memmove) ENTRY(memcpy) /* save leaf functions having to store this away */ /* Do not check arm_memcpy if we're running from flash */ -#ifdef FLASHADDR +#if defined(FLASHADDR) && defined(PHYSADDR) #if FLASHADDR > PHYSADDR ldr r3, =FLASHADDR cmp r3, pc ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r261605 - head/sys/conf
Author: jhb Date: Fri Feb 7 18:46:27 2014 New Revision: 261605 URL: http://svnweb.freebsd.org/changeset/base/261605 Log: Now that FreeBSD/i386 works as a bhyve guest, allow i386 kernels to include bvmconsole and bvmdebug. Modified: head/sys/conf/files.i386 Modified: head/sys/conf/files.i386 == --- head/sys/conf/files.i386Fri Feb 7 18:10:34 2014(r261604) +++ head/sys/conf/files.i386Fri Feb 7 18:46:27 2014(r261605) @@ -554,6 +554,11 @@ i386/xbox/pic16l.s optional xbox # compat/x86bios/x86bios.c optional x86bios | atkbd | dpms | vesa # +# bvm console +# +dev/bvm/bvm_console.c optionalbvmconsole +dev/bvm/bvm_dbg.c optionalbvmdebug +# # x86 shared code between IA32, AMD64 and PC98 architectures # x86/acpica/OsdEnvironment.coptional acpi ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r261606 - head/sys/arm/arm
Author: andrew Date: Fri Feb 7 19:15:25 2014 New Revision: 261606 URL: http://svnweb.freebsd.org/changeset/base/261606 Log: Dynamically generate the page table. This will allow us to detect the physical address we are loaded at to change the mapping. Modified: head/sys/arm/arm/locore.S Modified: head/sys/arm/arm/locore.S == --- head/sys/arm/arm/locore.S Fri Feb 7 18:46:27 2014(r261605) +++ head/sys/arm/arm/locore.S Fri Feb 7 19:15:25 2014(r261606) @@ -153,22 +153,27 @@ Lunmapped: ldr r2, =(KERNVIRTADDR - KERNPHYSADDR) sub r0, r1, r2 - adr r4, mmu_init_table - b 3f - -2: - str r3, [r0, r2] - add r2, r2, #4 - add r3, r3, #(L1_S_SIZE) - addsr1, r1, #-1 - bhi 2b -3: - ldmia r4!, {r1,r2,r3} /* # of sections, VA, PA|attr */ - cmp r1, #0 - adrne r5, 2b - bicne r5, r5, #0xf000 - orrne r5, r5, #PHYSADDR - movne pc, r5 + /* +* Map PA == VA +*/ + ldr r5, =(PHYSADDR) + mov r1, r5 + mov r2, r5 + /* Map 64MiB, preserved over calls to build_pagetables */ + mov r3, #64 + bl build_pagetables + + /* Create the kernel map to jump to */ + mov r1, r5 + ldr r2, =(KERNBASE) + bl build_pagetables + +#if defined(SOCDEV_PA) && defined(SOCDEV_VA) + /* Create the custom map */ + ldr r1, =SOCDEV_VA + ldr r2, =SOCDEV_PA + bl build_pagetables +#endif #if defined(SMP) orr r0, r0, #2 /* Set TTB shared memory flag */ @@ -238,6 +243,40 @@ virt_done: adr r0, .Lmainreturned b _C_LABEL(panic) /* NOTREACHED */ +END(btext) +END(_start) + +/* + * Builds the page table + * r0 - The table base address + * r1 - The physical address (trashed) + * r2 - The virtual address (trashed) + * r3 - The number of 1MiB sections + * r4 - Trashed + * + * Addresses must be 1MiB aligned + */ +build_pagetables: + /* Set the required page attributed */ + ldr r4, =(L1_TYPE_S|L1_S_C|L1_S_AP(AP_KRW)) +#if defined(SMP) + orr r4, #(L1_SHARED) +#endif + orr r1, r4 + + /* Move the virtual address to the correct bit location */ + lsr r2, #(L1_S_SHIFT - 2) + + mov r4, r3 +1: + str r1, [r0, r2] + add r2, r2, #4 + add r1, r1, #(L1_S_SIZE) + addsr4, r4, #-1 + bhi 1b + + RET + #define MMU_INIT(va,pa,n_sec,attr) \ .word n_sec ; \ .word 4*((va)>>L1_S_SHIFT); \ @@ -257,27 +296,7 @@ Lstartup_pagetable: Lstartup_pagetable_secondary: .word temp_pagetable #endif -END(btext) -END(_start) -mmu_init_table: - /* fill all table VA==PA */ - /* map SDRAM VA==PA, WT cacheable */ -#if !defined(SMP) - MMU_INIT(PHYSADDR, PHYSADDR, 64, L1_TYPE_S|L1_S_C|L1_S_AP(AP_KRW)) - /* map VA 0xc000..0xc3ff to PA */ - MMU_INIT(KERNBASE, PHYSADDR, 64, L1_TYPE_S|L1_S_C|L1_S_AP(AP_KRW)) -#if defined(SOCDEV_PA) && defined(SOCDEV_VA) - /* Map in 0x0400 worth of the SoC's devices for bootstrap debugging */ - MMU_INIT(SOCDEV_VA, SOCDEV_PA, 64, L1_TYPE_S|L1_S_C|L1_S_AP(AP_KRW)) -#endif -#else - MMU_INIT(PHYSADDR, PHYSADDR , 64, L1_TYPE_S|L1_SHARED|L1_S_C|L1_S_AP(AP_KRW)) - /* map VA 0xc000..0xc3ff to PA */ - MMU_INIT(KERNBASE, PHYSADDR, 64, L1_TYPE_S|L1_SHARED|L1_S_C|L1_S_AP(AP_KRW)) - MMU_INIT(0x4800, 0x4800, 1, L1_TYPE_S|L1_SHARED|L1_S_C|L1_S_AP(AP_KRW)) -#endif /* SMP */ - .word 0 /* end of table */ .Lstart: .word _edata .word _ebss ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r261601 - in head: sys/net sys/netinet sys/netinet6 usr.bin/netstat
On 07 Feb 2014, at 15:18 , Gleb Smirnoff wrote: ... > /* > * XXX This does not end up updating timeouts at runtime > * and only reflects the value for the last table added :-/ > */ > -SYSCTL_VNET_INT(_net_inet_flowtable, OID_AUTO, syn_expire, CTLFLAG_RW, > +SYSCTL_VNET_INT(_net_flowtable, OID_AUTO, syn_expire, CTLFLAG_RW, > &VNET_NAME(flowtable_syn_expire), 0, > "seconds after which to remove syn allocated flow."); > -SYSCTL_VNET_INT(_net_inet_flowtable, OID_AUTO, udp_expire, CTLFLAG_RW, > +SYSCTL_VNET_INT(_net_flowtable, OID_AUTO, udp_expire, CTLFLAG_RW, > &VNET_NAME(flowtable_udp_expire), 0, > "seconds after which to remove flow allocated to UDP."); > -SYSCTL_VNET_INT(_net_inet_flowtable, OID_AUTO, fin_wait_expire, CTLFLAG_RW, > +SYSCTL_VNET_INT(_net_flowtable, OID_AUTO, fin_wait_expire, CTLFLAG_RW, > &VNET_NAME(flowtable_fin_wait_expire), 0, > "seconds after which to remove a flow in FIN_WAIT."); > -SYSCTL_VNET_INT(_net_inet_flowtable, OID_AUTO, tcp_expire, CTLFLAG_RW, > +SYSCTL_VNET_INT(_net_flowtable, OID_AUTO, tcp_expire, CTLFLAG_RW, > &VNET_NAME(flowtable_tcp_expire), 0, > "seconds after which to remove flow allocated to a TCP connection."); … This is not what we are doing for a lot of other things in the tree which simply treat “inet” as “IP” without version number. Now I know that the floatable sits even between L3 and L2 given it caches pairs, I am still not sure I want to make net.* the “dumping ground” for these. Pending a better solution I don’t care apart from that sysctl.confs entries for the people using floatable after all break with this. — Bjoern A. Zeeb ? ??? ??? ??: '??? ??? ?? ??? ?? ?? ??? ??? ??? ? ? ?? ?? ? ', ? ?, "??? ? ?? ?", ?.??? ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r261599 - head/share/man/man4
Author: hselasky Date: Fri Feb 7 15:00:08 2014 New Revision: 261599 URL: http://svnweb.freebsd.org/changeset/base/261599 Log: The atp USB driver is generic and its manual page should be available for all platforms. Add wsp manual page to build. MFC after:1 week Modified: head/share/man/man4/Makefile Modified: head/share/man/man4/Makefile == --- head/share/man/man4/MakefileFri Feb 7 14:58:40 2014 (r261598) +++ head/share/man/man4/MakefileFri Feb 7 15:00:08 2014 (r261599) @@ -60,7 +60,7 @@ MAN= aac.4 \ ath_pci.4 \ atkbd.4 \ atkbdc.4 \ - ${_atp.4} \ + atp.4 \ ${_atf_test_case.4} \ ${_atrtc.4} \ ${_attimer.4} \ @@ -568,6 +568,7 @@ MAN=aac.4 \ wlan_wep.4 \ wlan_xauth.4 \ ${_wpi.4} \ + wsp.4 \ xe.4 \ ${_xen.4} \ xhci.4 \ @@ -757,7 +758,6 @@ _amdsbwd.4= amdsbwd.4 _amdsmb.4= amdsmb.4 _amdtemp.4=amdtemp.4 _asmc.4= asmc.4 -_atp.4=atp.4 _bxe.4=bxe.4 _coretemp.4= coretemp.4 _cpuctl.4= cpuctl.4 @@ -830,9 +830,6 @@ MLINKS+=qlxgbe.4 if_qlxgbe.4 MLINKS+=sfxge.4 if_sfxge.4 .endif -.if ${MACHINE_CPUARCH} == "powerpc" -_atp.4=atp.4 -.endif .if ${MACHINE_CPUARCH} == "mips" _nvram2env.4= nvram2env.4 .endif ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r261604 - head/contrib/libc++/include
On Fri, Feb 7, 2014 at 1:14 PM, Alan Somers wrote: > On Fri, Feb 7, 2014 at 11:10 AM, Eitan Adler wrote: >> Author: eadler >> Date: Fri Feb 7 18:10:34 2014 >> New Revision: 261604 >> URL: http://svnweb.freebsd.org/changeset/base/261604 >> >> Log: >> HEAD is not buildable for the past day. Commit a 'quick fix' in order to >> permit >> buildworld to complete. >> >> Reviewed by: theraven >> >> Modified: >> head/contrib/libc++/include/locale > > Are you sure that this will work on all architectures? I didn't run 'make universe' but I think it should work. This was committed this after waiting a day for a real fix to be done. I had / have other work which I needed to get done and did not analize this code in detail. > It implicitly > assumes that ptrdiff_t is the same as long. It assumes that ptrdiff_t is signed and sizeof (ptrdiff_t) <= sizeof(long). Please feel free to modify my hack or otherwise fix the code. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r261607 - head/usr.sbin/bhyve
Author: jhb Date: Fri Feb 7 20:53:41 2014 New Revision: 261607 URL: http://svnweb.freebsd.org/changeset/base/261607 Log: Mark the I/O ports used by the bhyve console and debug devices as system resources. MFC after:1 week Modified: head/usr.sbin/bhyve/consport.c head/usr.sbin/bhyve/dbgport.c Modified: head/usr.sbin/bhyve/consport.c == --- head/usr.sbin/bhyve/consport.c Fri Feb 7 19:15:25 2014 (r261606) +++ head/usr.sbin/bhyve/consport.c Fri Feb 7 20:53:41 2014 (r261607) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include "inout.h" +#include "pci_lpc.h" #defineBVM_CONSOLE_PORT0x220 #defineBVM_CONS_SIG('b' << 8 | 'v') @@ -125,6 +126,8 @@ console_handler(struct vmctx *ctx, int v return (0); } +SYSRES_IO(BVM_CONSOLE_PORT, 4); + static struct inout_port consport = { "bvmcons", BVM_CONSOLE_PORT, Modified: head/usr.sbin/bhyve/dbgport.c == --- head/usr.sbin/bhyve/dbgport.c Fri Feb 7 19:15:25 2014 (r261606) +++ head/usr.sbin/bhyve/dbgport.c Fri Feb 7 20:53:41 2014 (r261607) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include "inout.h" #include "dbgport.h" +#include "pci_lpc.h" #defineBVM_DBG_PORT0x224 #defineBVM_DBG_SIG ('B' << 8 | 'V') @@ -110,6 +111,8 @@ static struct inout_port dbgport = { dbg_handler }; +SYSRES_IO(BVM_DBG_PORT, 4); + void init_dbgport(int sport) { ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r261608 - head/contrib/libc++/include
Author: dim Date: Fri Feb 7 21:17:20 2014 New Revision: 261608 URL: http://svnweb.freebsd.org/changeset/base/261608 Log: Apply a cleaner solution for the sign warnings that can occur when compiling libc++'s header with -Wsystem-headers on. This has also been submitted upstream. Reported by: asomers Modified: head/contrib/libc++/include/locale Modified: head/contrib/libc++/include/locale == --- head/contrib/libc++/include/locale Fri Feb 7 20:53:41 2014 (r261607) +++ head/contrib/libc++/include/locale Fri Feb 7 21:17:20 2014 (r261608) @@ -1012,7 +1012,7 @@ num_get<_CharT, _InputIterator>::__do_ge unsigned __dc = 0; for (; __b != __e; ++__b) { -if (__a_end - __a == (long)__buf.size()) +if (__a_end == __a + __buf.size()) { size_t __tmp = __buf.size(); __buf.resize(2*__buf.size()); @@ -1062,7 +1062,7 @@ num_get<_CharT, _InputIterator>::__do_ge unsigned __dc = 0; for (; __b != __e; ++__b) { -if (__a_end - __a == (long)__buf.size()) +if (__a_end == __a + __buf.size()) { size_t __tmp = __buf.size(); __buf.resize(2*__buf.size()); @@ -1116,7 +1116,7 @@ num_get<_CharT, _InputIterator>::__do_ge char __exp = 'E'; for (; __b != __e; ++__b) { -if (__a_end - __a == (long)__buf.size()) +if (__a_end == __a + __buf.size()) { size_t __tmp = __buf.size(); __buf.resize(2*__buf.size()); @@ -1166,7 +1166,7 @@ num_get<_CharT, _InputIterator>::do_get( unsigned __dc = 0; for (; __b != __e; ++__b) { -if (__a_end - __a == (long)__buf.size()) +if (__a_end == __a + __buf.size()) { size_t __tmp = __buf.size(); __buf.resize(2*__buf.size()); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r261585 - head/sys/dev/vt/hw/vga
Hi Aleksandr, On 7 February 2014 16:10, Aleksandr Rybalko wrote: > On Fri, 7 Feb 2014 15:04:47 +0100 > Ed Schouten wrote: >> On 7 February 2014 13:39, Aleksandr Rybalko wrote: > Also people asking me about advanced features of vt(9), like use > multiple displays. I'm not sure, but signed coordinates may help with > some things on that way (or makes more problems :) ). But if you were to have multiple displays, you should have separate coordinate systems per display. It should not be seen as a single pane. >> Furthermore, I think it's a bit weird that vga_bitbltchr() contains >> explicit bounds checking. What happened there? I remember at one point >> in time, we had the nice invariant that vt(9) never attempted to draw >> outside of the display resolution. What caused us to give up on that? > > Mouse cursor allowed to partially go out of screen, so we have to check > (or use special function for mouse cursor). Well, that's a compelling argument. Still, it's a bit weird then that the bitblt function itself does not take signed coordinates. Would it make sense to bring that in sync then? -- Ed Schouten ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r261609 - head/contrib/libcxxrt
Author: dim Date: Fri Feb 7 21:34:09 2014 New Revision: 261609 URL: http://svnweb.freebsd.org/changeset/base/261609 Log: Pull in upstream libcxxrt commit 8006101, which makes its cxxabi.h file compilable just by itself. PR: kern/184019 MFC after:3 days Modified: head/contrib/libcxxrt/cxxabi.h Modified: head/contrib/libcxxrt/cxxabi.h == --- head/contrib/libcxxrt/cxxabi.h Fri Feb 7 21:17:20 2014 (r261608) +++ head/contrib/libcxxrt/cxxabi.h Fri Feb 7 21:34:09 2014 (r261609) @@ -22,6 +22,7 @@ #ifndef __CXXABI_H_ #define __CXXABI_H_ +#include #include #include "unwind.h" namespace std ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r261585 - head/sys/dev/vt/hw/vga
On 7 лютого 2014 р. 23:27:58 GMT+02:00, Ed Schouten wrote: >Hi Aleksandr, > >On 7 February 2014 16:10, Aleksandr Rybalko wrote: >> On Fri, 7 Feb 2014 15:04:47 +0100 >> Ed Schouten wrote: >>> On 7 February 2014 13:39, Aleksandr Rybalko wrote: >> Also people asking me about advanced features of vt(9), like use >> multiple displays. I'm not sure, but signed coordinates may help with >> some things on that way (or makes more problems :) ). > >But if you were to have multiple displays, you should have separate >coordinate systems per display. It should not be seen as a single >pane. I don't really know yet how that will be implemented. :-) > >>> Furthermore, I think it's a bit weird that vga_bitbltchr() contains >>> explicit bounds checking. What happened there? I remember at one >point >>> in time, we had the nice invariant that vt(9) never attempted to >draw >>> outside of the display resolution. What caused us to give up on >that? >> >> Mouse cursor allowed to partially go out of screen, so we have to >check >> (or use special function for mouse cursor). > >Well, that's a compelling argument. Still, it's a bit weird then that >the bitblt function itself does not take signed coordinates. Would it >make sense to bring that in sync then? Yup, this is good idea to sync them. Will do that a bit later. Thanks a lot Ed! Let me know if you will have something more. WBW -- Aleksandr Rybalko ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r261610 - head/sys/net
Author: glebius Date: Fri Feb 7 21:56:16 2014 New Revision: 261610 URL: http://svnweb.freebsd.org/changeset/base/261610 Log: Remove unused defines. Modified: head/sys/net/flowtable.c Modified: head/sys/net/flowtable.c == --- head/sys/net/flowtable.cFri Feb 7 21:34:09 2014(r261609) +++ head/sys/net/flowtable.cFri Feb 7 21:56:16 2014(r261610) @@ -122,13 +122,6 @@ struct flentry_v6 { union ipv6_flow fl_flow; }; -#definefl_fhashfl_entry.fl_fhash -#definefl_flagsfl_entry.fl_flags -#definefl_protofl_entry.fl_proto -#definefl_uptime fl_entry.fl_uptime -#definefl_rt fl_entry.fl_rt -#definefl_lle fl_entry.fl_lle - #defineSECS_PER_HOUR 3600 #defineSECS_PER_DAY(24*SECS_PER_HOUR) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r261611 - head/share/man/man4
Author: brueffer Date: Fri Feb 7 22:04:56 2014 New Revision: 261611 URL: http://svnweb.freebsd.org/changeset/base/261611 Log: Add some context for the "kldload sem" command; minor other improvements. PR: 183650 Submitted by: Bjorn Heidotting MFC after:1 week Modified: head/share/man/man4/sem.4 Modified: head/share/man/man4/sem.4 == --- head/share/man/man4/sem.4 Fri Feb 7 21:56:16 2014(r261610) +++ head/share/man/man4/sem.4 Fri Feb 7 22:04:56 2014(r261611) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 3, 2011 +.Dd February 7, 2014 .Dt SEM 4 .Os .Sh NAME @@ -32,7 +32,7 @@ .Nd POSIX semaphores .Sh SYNOPSIS To compile this driver into the kernel, -place the following lines in your +place the following line in your kernel configuration file: .Bd -ragged -offset indent .Cd "options P1003_1B_SEMAPHORES" @@ -45,7 +45,11 @@ module at boot time, place the following sem_load="YES" .Ed .Pp -.Dl "kldload sem" +To load the driver as a module at run-time, run the following +command as root: +.Bd -ragged -offset indent +kldload sem +.Ed .Sh DESCRIPTION The .Nm ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r261612 - head/share/man/man4
Author: pjd Date: Fri Feb 7 22:15:48 2014 New Revision: 261612 URL: http://svnweb.freebsd.org/changeset/base/261612 Log: Add cross-references to casperd(8) and libcapsicum(3). Suggested by: rwatson Modified: head/share/man/man4/capsicum.4 Modified: head/share/man/man4/capsicum.4 == --- head/share/man/man4/capsicum.4 Fri Feb 7 22:04:56 2014 (r261611) +++ head/share/man/man4/capsicum.4 Fri Feb 7 22:15:48 2014 (r261612) @@ -104,7 +104,9 @@ associated with file descriptors; descri .Xr shm_open 2 , .Xr write 2 , .Xr cap_rights_get 3 , -.Xr procdesc 4 +.Xr libcapsicum 3 , +.Xr procdesc 4 , +.Xr casperd 8 .Sh HISTORY .Nm first appeared in ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r261613 - head/sys/net
Author: glebius Date: Fri Feb 7 22:30:42 2014 New Revision: 261613 URL: http://svnweb.freebsd.org/changeset/base/261613 Log: Fix comment. Modified: head/sys/net/flowtable.h Modified: head/sys/net/flowtable.h == --- head/sys/net/flowtable.hFri Feb 7 22:15:48 2014(r261612) +++ head/sys/net/flowtable.hFri Feb 7 22:30:42 2014(r261613) @@ -75,4 +75,4 @@ void flow_to_route_in6(struct flentry *f #endif #endif /* _KERNEL */ -#endif /* _NET_FLOWTABLE_H_ */ +#endif /* !_NET_FLOWTABLE_H_ */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r261614 - in head/sys/boot: . powerpc/ofw powerpc/ps3 powerpc/uboot
Author: emaste Date: Fri Feb 7 22:49:42 2014 New Revision: 261614 URL: http://svnweb.freebsd.org/changeset/base/261614 Log: Build a 32-bit libstand under sys/boot/ for ppc64 This change is equivalent to r261567 for i386/amd64. Sponsored by: The FreeBSD Foundation Modified: head/sys/boot/Makefile.powerpc head/sys/boot/powerpc/ofw/Makefile head/sys/boot/powerpc/ps3/Makefile head/sys/boot/powerpc/uboot/Makefile Modified: head/sys/boot/Makefile.powerpc == --- head/sys/boot/Makefile.powerpc Fri Feb 7 22:30:42 2014 (r261613) +++ head/sys/boot/Makefile.powerpc Fri Feb 7 22:49:42 2014 (r261614) @@ -4,5 +4,6 @@ SUBDIR+= fdt .endif +SUBDIR+= libstand32 SUBDIR+= ofw SUBDIR+= uboot Modified: head/sys/boot/powerpc/ofw/Makefile == --- head/sys/boot/powerpc/ofw/Makefile Fri Feb 7 22:30:42 2014 (r261613) +++ head/sys/boot/powerpc/ofw/Makefile Fri Feb 7 22:49:42 2014 (r261614) @@ -89,10 +89,11 @@ LIBOFW= ${.OBJDIR}/../../ofw/libofw/lib CFLAGS+= -I${.CURDIR}/../../ofw/libofw # where to get libstand from +LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ DPADD= ${LIBFICL} ${LIBOFW} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBOFW} -lstand +LDADD= ${LIBFICL} ${LIBOFW} ${LIBSTAND} vers.c:${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT} Modified: head/sys/boot/powerpc/ps3/Makefile == --- head/sys/boot/powerpc/ps3/Makefile Fri Feb 7 22:30:42 2014 (r261613) +++ head/sys/boot/powerpc/ps3/Makefile Fri Feb 7 22:49:42 2014 (r261614) @@ -95,10 +95,11 @@ CFLAGS+= -Wa,-mppc64bridge #.include "${.CURDIR}/../../ofw/common/Makefile.inc" # where to get libstand from +LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ DPADD= ${LIBFICL} ${LIBOFW} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBOFW} -lstand +LDADD= ${LIBFICL} ${LIBOFW} ${LIBSTAND} SC_DFLT_FONT=cp437 Modified: head/sys/boot/powerpc/uboot/Makefile == --- head/sys/boot/powerpc/uboot/MakefileFri Feb 7 22:30:42 2014 (r261613) +++ head/sys/boot/powerpc/uboot/MakefileFri Feb 7 22:49:42 2014 (r261614) @@ -95,10 +95,11 @@ CFLAGS+=-I${.CURDIR}/../../uboot/lib CFLAGS+= -I${.OBJDIR}/../../uboot/lib # where to get libstand from +LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} -lstand +LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBSTAND} vers.c:${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT} ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r261615 - head/tests/sys
Author: asomers Date: Sat Feb 8 00:20:21 2014 New Revision: 261615 URL: http://svnweb.freebsd.org/changeset/base/261615 Log: tests/sys/Makefile use TESTS_SUBDIRS for kern instead of SUBDIRS. I don't think it makes a difference in this case, but TESTS_SUBDIRS is generally correct for subdirectories that contain tests. Sponsored by: Spectra Logic MFC after:5 days X-MFC-With: r261133 Modified: head/tests/sys/Makefile Modified: head/tests/sys/Makefile == --- head/tests/sys/Makefile Fri Feb 7 22:49:42 2014(r261614) +++ head/tests/sys/Makefile Sat Feb 8 00:20:21 2014(r261615) @@ -2,13 +2,11 @@ .include -SUBDIR= kern +.PATH: ${.CURDIR}/.. + +TESTS_SUBDIRS+=kern TESTSDIR= ${TESTSBASE}/sys KYUAFILE= yes -CLEANFILES+= Kyuafile -Kyuafile: ${.CURDIR}/../Kyuafile - cp -f ${.CURDIR}/../Kyuafile . - .include ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r261616 - head/sys/dev/usb/controller
Author: imp Date: Sat Feb 8 04:29:36 2014 New Revision: 261616 URL: http://svnweb.freebsd.org/changeset/base/261616 Log: Remove FreeBSD 6 support Modified: head/sys/dev/usb/controller/at91dci_atmelarm.c head/sys/dev/usb/controller/ohci_atmelarm.c Modified: head/sys/dev/usb/controller/at91dci_atmelarm.c == --- head/sys/dev/usb/controller/at91dci_atmelarm.c Sat Feb 8 00:20:21 2014(r261615) +++ head/sys/dev/usb/controller/at91dci_atmelarm.c Sat Feb 8 04:29:36 2014(r261616) @@ -212,13 +212,8 @@ at91_udp_attach(device_t dev) } device_set_ivars(sc->sc_dci.sc_bus.bdev, &sc->sc_dci.sc_bus); -#if (__FreeBSD_version >= 700031) err = bus_setup_intr(dev, sc->sc_dci.sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, NULL, (driver_intr_t *)at91dci_interrupt, sc, &sc->sc_dci.sc_intr_hdl); -#else - err = bus_setup_intr(dev, sc->sc_dci.sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, - (driver_intr_t *)at91dci_interrupt, sc, &sc->sc_dci.sc_intr_hdl); -#endif if (err) { sc->sc_dci.sc_intr_hdl = NULL; goto error; Modified: head/sys/dev/usb/controller/ohci_atmelarm.c == --- head/sys/dev/usb/controller/ohci_atmelarm.c Sat Feb 8 00:20:21 2014 (r261615) +++ head/sys/dev/usb/controller/ohci_atmelarm.c Sat Feb 8 04:29:36 2014 (r261616) @@ -131,13 +131,8 @@ ohci_atmelarm_attach(device_t dev) strlcpy(sc->sc_ohci.sc_vendor, "Atmel", sizeof(sc->sc_ohci.sc_vendor)); -#if (__FreeBSD_version >= 700031) err = bus_setup_intr(dev, sc->sc_ohci.sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, NULL, (driver_intr_t *)ohci_interrupt, sc, &sc->sc_ohci.sc_intr_hdl); -#else - err = bus_setup_intr(dev, sc->sc_ohci.sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, - (driver_intr_t *)ohci_interrupt, sc, &sc->sc_ohci.sc_intr_hdl); -#endif if (err) { sc->sc_ohci.sc_intr_hdl = NULL; goto error; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r261617 - head/sys/amd64/vmm/intel
Author: neel Date: Sat Feb 8 05:04:34 2014 New Revision: 261617 URL: http://svnweb.freebsd.org/changeset/base/261617 Log: Fix a bug in the handling of VM-exits caused by non-maskable interrupts (NMI). If a VM-exit is caused by an NMI then "blocking by NMI" is in effect on the CPU when the VM-exit is completed. No more NMIs will be recognized until the execution of an "iret". Prior to this change the NMI handler was dispatched via a software interrupt with interrupts enabled. This meant that an interrupt could be recognized by the processor before the NMI handler completed its execution. The "iret" issued by the interrupt handler would then cause the "blocking by NMI" to be cleared prematurely. This is now fixed by handling the NMI with interrupts disabled in addition to "blocking by NMI" already established by the VM-exit. Modified: head/sys/amd64/vmm/intel/vmx.c Modified: head/sys/amd64/vmm/intel/vmx.c == --- head/sys/amd64/vmm/intel/vmx.c Sat Feb 8 04:29:36 2014 (r261616) +++ head/sys/amd64/vmm/intel/vmx.c Sat Feb 8 05:04:34 2014 (r261617) @@ -1719,19 +1719,10 @@ vmx_exit_process(struct vmx *vmx, int vc vmx_restore_nmi_blocking(vmx, vcpu); /* -* If the NMI-exiting VM execution control is set to '1' -* then an NMI in non-root operation causes a VM-exit. -* NMI blocking is in effect for this logical processor so -* it is sufficient to simply vector to the NMI handler via -* a software interrupt. +* The NMI has already been handled in vmx_exit_handle_nmi(). */ - if ((intr_info & VMCS_INTR_T_MASK) == VMCS_INTR_T_NMI) { - KASSERT((intr_info & 0xff) == IDT_NMI, ("VM exit due " - "to NMI has invalid vector: %#x", intr_info)); - VCPU_CTR0(vmx->vm, vcpu, "Vectoring to NMI handler"); - __asm __volatile("int $2"); + if ((intr_info & VMCS_INTR_T_MASK) == VMCS_INTR_T_NMI) return (1); - } break; case EXIT_REASON_EPT_FAULT: vmm_stat_incr(vmx->vm, vcpu, VMEXIT_EPT_FAULT, 1); @@ -1874,6 +1865,36 @@ vmx_exit_inst_error(struct vmxctx *vmxct return (UNHANDLED); } +/* + * If the NMI-exiting VM execution control is set to '1' then an NMI in + * non-root operation causes a VM-exit. NMI blocking is in effect so it is + * sufficient to simply vector to the NMI handler via a software interrupt. + * However, this must be done before maskable interrupts are enabled + * otherwise the "iret" issued by an interrupt handler will incorrectly + * clear NMI blocking. + */ +static __inline void +vmx_exit_handle_nmi(struct vmx *vmx, int vcpuid, struct vm_exit *vmexit) +{ + uint32_t intr_info; + + KASSERT((read_rflags() & PSL_I) == 0, ("interrupts enabled")); + + if (vmexit->u.vmx.exit_reason != EXIT_REASON_EXCEPTION) + return; + + intr_info = vmcs_read(VMCS_EXIT_INTR_INFO); + KASSERT((intr_info & VMCS_INTR_VALID) != 0, + ("VM exit interruption info invalid: %#x", intr_info)); + + if ((intr_info & VMCS_INTR_T_MASK) == VMCS_INTR_T_NMI) { + KASSERT((intr_info & 0xff) == IDT_NMI, ("VM exit due " + "to NMI has invalid vector: %#x", intr_info)); + VCPU_CTR0(vmx->vm, vcpuid, "Vectoring to NMI handler"); + __asm __volatile("int $2"); + } +} + static int vmx_run(void *arg, int vcpu, register_t startrip, pmap_t pmap, void *rendezvous_cookie) @@ -1949,8 +1970,6 @@ vmx_run(void *arg, int vcpu, register_t vmx_run_trace(vmx, vcpu); rc = vmx_enter_guest(vmxctx, vmx, launched); - enable_intr(); - /* Collect some information for VM exit processing */ vmexit->rip = rip = vmcs_guest_rip(); vmexit->inst_length = vmexit_instruction_length(); @@ -1958,12 +1977,14 @@ vmx_run(void *arg, int vcpu, register_t vmexit->u.vmx.exit_qualification = vmcs_exit_qualification(); if (rc == VMX_GUEST_VMEXIT) { - launched = 1; + vmx_exit_handle_nmi(vmx, vcpu, vmexit); + enable_intr(); handled = vmx_exit_process(vmx, vcpu, vmexit); } else { + enable_intr(); handled = vmx_exit_inst_error(vmxctx, rc, vmexit); } - + launched = 1; vmx_exit_trace(vmx, vcpu, rip, exit_reason, handled); } while (handled); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listi
svn commit: r261618 - head/sys/geom/eli
Author: delphij Date: Sat Feb 8 05:17:49 2014 New Revision: 261618 URL: http://svnweb.freebsd.org/changeset/base/261618 Log: In g_eli_crypto_hmac_init(), zero out after using the ipad buffer, k_ipad. Note that the two consumers in geli(4) are not affected by this issue because the way the code is constructed and as such, we believe there is no security impact with or without this change with geli(4)'s usage. Reported by: Serge van den Boom Reviewed by: pjd MFC after:2 weeks Modified: head/sys/geom/eli/g_eli_crypto.c Modified: head/sys/geom/eli/g_eli_crypto.c == --- head/sys/geom/eli/g_eli_crypto.cSat Feb 8 05:04:34 2014 (r261617) +++ head/sys/geom/eli/g_eli_crypto.cSat Feb 8 05:17:49 2014 (r261618) @@ -265,6 +265,7 @@ g_eli_crypto_hmac_init(struct hmac_ctx * /* Perform inner SHA512. */ SHA512_Init(&ctx->shactx); SHA512_Update(&ctx->shactx, k_ipad, sizeof(k_ipad)); + bzero(k_ipad, sizeof(k_ipad)); } void ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r261619 - vendor-sys/illumos/dist/uts/common/fs/zfs
Author: delphij Date: Sat Feb 8 05:30:33 2014 New Revision: 261619 URL: http://svnweb.freebsd.org/changeset/base/261619 Log: 4574 get_clones_stat does not call zap_count in non-debug kernel illumos/illumos-gate@03d1795fa6f720eafbee821ad37f4343c391cfe4 Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c == --- vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c Sat Feb 8 05:17:49 2014(r261618) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c Sat Feb 8 05:30:33 2014(r261619) @@ -22,6 +22,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright (c) 2012, Joyent, Inc. All rights reserved. + * Copyright (c) 2014 RackTop Systems. */ #include @@ -1364,7 +1365,7 @@ get_clones_stat(dsl_dataset_t *ds, nvlis * Only trust it if it has the right number of entries. */ if (ds->ds_phys->ds_next_clones_obj != 0) { - ASSERT0(zap_count(mos, ds->ds_phys->ds_next_clones_obj, + VERIFY0(zap_count(mos, ds->ds_phys->ds_next_clones_obj, &count)); } if (count != ds->ds_phys->ds_num_children - 1) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r261620 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Author: delphij Date: Sat Feb 8 05:35:36 2014 New Revision: 261620 URL: http://svnweb.freebsd.org/changeset/base/261620 Log: MFV r261619: 4574 get_clones_stat does not call zap_count in non-debug kernel zap_count(...) is never called in non-DEBUG kernel. As result "count" variable is always 0, and "goto fail" is always reached. This means get_clones_stat function never makes up list of clones for "clones" properties. MFC after:2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Sat Feb 8 05:30:33 2014(r261619) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Sat Feb 8 05:35:36 2014(r261620) @@ -20,9 +20,10 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Portions Copyright (c) 2011 Martin Matuska * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright (c) 2012, Joyent, Inc. All rights reserved. - * Portions Copyright (c) 2011 Martin Matuska + * Copyright (c) 2014 RackTop Systems. */ #include @@ -1424,7 +1425,7 @@ get_clones_stat(dsl_dataset_t *ds, nvlis * Only trust it if it has the right number of entries. */ if (ds->ds_phys->ds_next_clones_obj != 0) { - ASSERT0(zap_count(mos, ds->ds_phys->ds_next_clones_obj, + VERIFY0(zap_count(mos, ds->ds_phys->ds_next_clones_obj, &count)); } if (count != ds->ds_phys->ds_num_children - 1) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r261621 - in head/sys/amd64/vmm: . intel
Author: neel Date: Sat Feb 8 06:22:09 2014 New Revision: 261621 URL: http://svnweb.freebsd.org/changeset/base/261621 Log: Add a counter to differentiate between VM-exits due to nested paging faults and instruction emulation faults. Modified: head/sys/amd64/vmm/intel/vmx.c head/sys/amd64/vmm/vmm_stat.c head/sys/amd64/vmm/vmm_stat.h Modified: head/sys/amd64/vmm/intel/vmx.c == --- head/sys/amd64/vmm/intel/vmx.c Sat Feb 8 05:35:36 2014 (r261620) +++ head/sys/amd64/vmm/intel/vmx.c Sat Feb 8 06:22:09 2014 (r261621) @@ -1725,7 +1725,6 @@ vmx_exit_process(struct vmx *vmx, int vc return (1); break; case EXIT_REASON_EPT_FAULT: - vmm_stat_incr(vmx->vm, vcpu, VMEXIT_EPT_FAULT, 1); /* * If 'gpa' lies within the address space allocated to * memory then this must be a nested page fault otherwise @@ -1736,6 +1735,7 @@ vmx_exit_process(struct vmx *vmx, int vc vmexit->exitcode = VM_EXITCODE_PAGING; vmexit->u.paging.gpa = gpa; vmexit->u.paging.fault_type = ept_fault_type(qual); + vmm_stat_incr(vmx->vm, vcpu, VMEXIT_NESTED_FAULT, 1); } else if (ept_emulation_fault(qual)) { vmexit->exitcode = VM_EXITCODE_INST_EMUL; vmexit->u.inst_emul.gpa = gpa; @@ -1743,6 +1743,7 @@ vmx_exit_process(struct vmx *vmx, int vc vmexit->u.inst_emul.cr3 = vmcs_guest_cr3(); vmexit->u.inst_emul.cpu_mode = vmx_cpu_mode(); vmexit->u.inst_emul.paging_mode = vmx_paging_mode(); + vmm_stat_incr(vmx->vm, vcpu, VMEXIT_INST_EMUL, 1); } /* * If Virtual NMIs control is 1 and the VM-exit is due to an Modified: head/sys/amd64/vmm/vmm_stat.c == --- head/sys/amd64/vmm/vmm_stat.c Sat Feb 8 05:35:36 2014 (r261620) +++ head/sys/amd64/vmm/vmm_stat.c Sat Feb 8 06:22:09 2014 (r261621) @@ -146,7 +146,8 @@ VMM_STAT(VMEXIT_INTR_WINDOW, "vm exits d VMM_STAT(VMEXIT_NMI_WINDOW, "vm exits due to nmi window opening"); VMM_STAT(VMEXIT_INOUT, "number of times in/out was intercepted"); VMM_STAT(VMEXIT_CPUID, "number of times cpuid was intercepted"); -VMM_STAT(VMEXIT_EPT_FAULT, "vm exits due to nested page fault"); +VMM_STAT(VMEXIT_NESTED_FAULT, "vm exits due to nested page fault"); +VMM_STAT(VMEXIT_INST_EMUL, "vm exits for instruction emulation"); VMM_STAT(VMEXIT_UNKNOWN, "number of vm exits for unknown reason"); VMM_STAT(VMEXIT_ASTPENDING, "number of times astpending at exit"); VMM_STAT(VMEXIT_USERSPACE, "number of vm exits handled in userspace"); Modified: head/sys/amd64/vmm/vmm_stat.h == --- head/sys/amd64/vmm/vmm_stat.h Sat Feb 8 05:35:36 2014 (r261620) +++ head/sys/amd64/vmm/vmm_stat.h Sat Feb 8 06:22:09 2014 (r261621) @@ -116,7 +116,8 @@ VMM_STAT_DECLARE(VMEXIT_INTR_WINDOW); VMM_STAT_DECLARE(VMEXIT_NMI_WINDOW); VMM_STAT_DECLARE(VMEXIT_INOUT); VMM_STAT_DECLARE(VMEXIT_CPUID); -VMM_STAT_DECLARE(VMEXIT_EPT_FAULT); +VMM_STAT_DECLARE(VMEXIT_NESTED_FAULT); +VMM_STAT_DECLARE(VMEXIT_INST_EMUL); VMM_STAT_DECLARE(VMEXIT_UNKNOWN); VMM_STAT_DECLARE(VMEXIT_ASTPENDING); VMM_STAT_DECLARE(VMEXIT_USERSPACE); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r261622 - stable/9/sys/dev/pci
Author: dumbbell Date: Sat Feb 8 07:53:39 2014 New Revision: 261622 URL: http://svnweb.freebsd.org/changeset/base/261622 Log: MFC r254882, r254883, r255571: vga_pci: Add API to map the Video BIOS Here are two new functions to map and unmap the Video BIOS: void * vga_pci_map_bios(device_t dev, size_t *size); void vga_pci_unmap_bios(device_t dev, void *bios); The BIOS is either taken from the shadow copy made by the System BIOS at boot time if the given device was used for the default display (i386, amd64 and ia64 only), or from the PCI expansion ROM. Additionally, one can determine if a given device was the default display at boot time using the following new function: intvga_pci_is_boot_display(device_t dev); Submitted by: jhb@ (r255571) Modified: stable/9/sys/dev/pci/pcivar.h stable/9/sys/dev/pci/vga_pci.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/pci/pcivar.h == --- stable/9/sys/dev/pci/pcivar.h Sat Feb 8 06:22:09 2014 (r261621) +++ stable/9/sys/dev/pci/pcivar.h Sat Feb 8 07:53:39 2014 (r261622) @@ -490,4 +490,11 @@ extern uint32_tpci_generation; struct pci_map *pci_find_bar(device_t dev, int reg); intpci_bar_enabled(device_t dev, struct pci_map *pm); +#defineVGA_PCI_BIOS_SHADOW_ADDR0xC +#defineVGA_PCI_BIOS_SHADOW_SIZE131072 + +intvga_pci_is_boot_display(device_t dev); +void * vga_pci_map_bios(device_t dev, size_t *size); +void vga_pci_unmap_bios(device_t dev, void *bios); + #endif /* _PCIVAR_H_ */ Modified: stable/9/sys/dev/pci/vga_pci.c == --- stable/9/sys/dev/pci/vga_pci.c Sat Feb 8 06:22:09 2014 (r261621) +++ stable/9/sys/dev/pci/vga_pci.c Sat Feb 8 07:53:39 2014 (r261622) @@ -46,6 +46,11 @@ __FBSDID("$FreeBSD$"); #include #include +#if defined(__amd64__) || defined(__i386__) || defined(__ia64__) +#include +#include +#endif + #include #include @@ -62,11 +67,95 @@ struct vga_pci_softc { SYSCTL_DECL(_hw_pci); +static struct vga_resource *lookup_res(struct vga_pci_softc *sc, int rid); +static struct resource *vga_pci_alloc_resource(device_t dev, device_t child, +int type, int *rid, u_long start, u_long end, u_long count, u_int flags); +static int vga_pci_release_resource(device_t dev, device_t child, int type, +int rid, struct resource *r); + int vga_pci_default_unit = -1; TUNABLE_INT("hw.pci.default_vgapci_unit", &vga_pci_default_unit); SYSCTL_INT(_hw_pci, OID_AUTO, default_vgapci_unit, CTLFLAG_RDTUN, &vga_pci_default_unit, -1, "Default VGA-compatible display"); +int +vga_pci_is_boot_display(device_t dev) +{ + + /* +* Return true if the given device is the default display used +* at boot time. +*/ + return ( + (pci_get_class(dev) == PCIC_DISPLAY || +(pci_get_class(dev) == PCIC_OLD && + pci_get_subclass(dev) == PCIS_OLD_VGA)) && + device_get_unit(dev) == vga_pci_default_unit); +} + +void * +vga_pci_map_bios(device_t dev, size_t *size) +{ + int rid; + struct resource *res; + +#if defined(__amd64__) || defined(__i386__) || defined(__ia64__) + if (vga_pci_is_boot_display(dev)) { + /* +* On x86, the System BIOS copy the default display +* device's Video BIOS at a fixed location in system +* memory (0xC, 128 kBytes long) at boot time. +* +* We use this copy for the default boot device, because +* the original ROM may not be valid after boot. +*/ + + *size = VGA_PCI_BIOS_SHADOW_SIZE; + return (pmap_mapbios(VGA_PCI_BIOS_SHADOW_ADDR, *size)); + } +#endif + + rid = PCIR_BIOS; + res = vga_pci_alloc_resource(dev, NULL, SYS_RES_MEMORY, &rid, 0ul, + ~0ul, 1, RF_ACTIVE); + if (res == NULL) { + return (NULL); + } + + *size = rman_get_size(res); + return (rman_get_virtual(res)); +} + +void +vga_pci_unmap_bios(device_t dev, void *bios) +{ + struct vga_resource *vr; + + if (bios == NULL) { + return; + } + +#if defined(__amd64__) || defined(__i386__) || defined(__ia64__) + if (vga_pci_is_boot_display(dev)) { + /* We mapped the BIOS shadow copy located at 0xC. */ + pmap_unmapdev((vm_offset_t)bios, VGA_PCI_BIOS_SHADOW_SIZE); + + return; + } +#endif + + /* +* Look up the PCIR_BIOS resource in our softc. It should match +* the address we returned previously. +*/ + vr = lookup_res(device_get_softc(dev), PCIR_BIOS); + KASSERT(vr->vr_res !=