From owner-svn-src-head@FreeBSD.ORG Sun Jan 18 04:29:43 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 259D1106566B; Sun, 18 Jan 2009 04:29:43 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 146288FC0C; Sun, 18 Jan 2009 04:29:43 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0I4Tgdm060872; Sun, 18 Jan 2009 04:29:42 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0I4TgUP060871; Sun, 18 Jan 2009 04:29:42 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <200901180429.n0I4TgUP060871@svn.freebsd.org> From: Giorgos Keramidas Date: Sun, 18 Jan 2009 04:29:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187375 - head/sys/dev/sound/pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2009 04:29:43 -0000 Author: keramida (doc committer) Date: Sun Jan 18 04:29:42 2009 New Revision: 187375 URL: http://svn.freebsd.org/changeset/base/187375 Log: Add support for CMedia CMI120. PR: kern/123640 Approved by: ariff MFC after: 2 weeks Modified: head/sys/dev/sound/pci/cmi.c Modified: head/sys/dev/sound/pci/cmi.c ============================================================================== --- head/sys/dev/sound/pci/cmi.c Sat Jan 17 23:01:40 2009 (r187374) +++ head/sys/dev/sound/pci/cmi.c Sun Jan 18 04:29:42 2009 (r187375) @@ -60,6 +60,7 @@ SND_DECLARE_FILE("$FreeBSD$"); #define CMI8338B_PCI_ID 0x010113f6 #define CMI8738_PCI_ID 0x011113f6 #define CMI8738B_PCI_ID 0x011213f6 +#define CMI120_USB_ID 0x01030d8c /* Buffer size max is 64k for permitted DMA boundaries */ #define CMI_DEFAULT_BUFSZ 16384 @@ -916,6 +917,9 @@ cmi_probe(device_t dev) case CMI8738B_PCI_ID: device_set_desc(dev, "CMedia CMI8738B"); return BUS_PROBE_DEFAULT; + case CMI120_USB_ID: + device_set_desc(dev, "CMedia CMI120"); + return BUS_PROBE_DEFAULT; default: return ENXIO; } From owner-svn-src-head@FreeBSD.ORG Sun Jan 18 04:49:02 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 092251065672; Sun, 18 Jan 2009 04:49:02 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EA2B68FC0C; Sun, 18 Jan 2009 04:49:01 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0I4n1cv061370; Sun, 18 Jan 2009 04:49:01 GMT (envelope-from jeff@svn.freebsd.org) Received: (from jeff@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0I4n14m061369; Sun, 18 Jan 2009 04:49:01 GMT (envelope-from jeff@svn.freebsd.org) Message-Id: <200901180449.n0I4n14m061369@svn.freebsd.org> From: Jeff Roberson Date: Sun, 18 Jan 2009 04:49:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187376 - head/tools/sched X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2009 04:49:02 -0000 Author: jeff Date: Sun Jan 18 04:49:01 2009 New Revision: 187376 URL: http://svn.freebsd.org/changeset/base/187376 Log: - Significantly speedup hiding and displaying multiple rows by writing an optimized single pass function for each. This reduces the number of tkinter calls required to the minimum. - Add a right-click context menu for sources. Supported commands hide the source, hide the whole group the source is in, and bring up a stat window. - Add a source stat frame that gives an event frequency table as well as the total duration for each event type that has a duration. This can be used to see, for example, the total time a thread spent running or blocked by a wchan or lock. Modified: head/tools/sched/schedgraph.py Modified: head/tools/sched/schedgraph.py ============================================================================== --- head/tools/sched/schedgraph.py Sun Jan 18 04:29:42 2009 (r187375) +++ head/tools/sched/schedgraph.py Sun Jan 18 04:49:01 2009 (r187376) @@ -315,17 +315,13 @@ class SourceConf(Frame): self.checkbox.grid(row=0, column=1) self.columnconfigure(0, weight=1) - def apply(self): - echange = 0 + def changed(self): if (self.enabled_current != self.enabled.get()): - echange = 1 + return 1 + return 0 + + def apply(self): self.enabled_current = self.enabled.get() - if (echange != 0): - if (self.enabled_current): - graph.sourceshow(self.source) - else: - graph.sourcehide(self.source) - return def revert(self): self.enabled.set(self.enabled_default) @@ -389,6 +385,21 @@ class SourceConfigure(Toplevel): self.buttons.columnconfigure(3, weight=1) def apress(self): + disable_sources = [] + enable_sources = [] + for item in self.sconfig: + if (item.changed() == 0): + continue + if (item.enabled.get() == 1): + enable_sources.append(item.source) + else: + disable_sources.append(item.source) + + if (len(disable_sources)): + graph.sourcehidelist(disable_sources) + if (len(enable_sources)): + graph.sourceshowlist(enable_sources) + for item in self.sconfig: item.apply() @@ -404,6 +415,77 @@ class SourceConfigure(Toplevel): for item in self.sconfig: item.uncheck() +# Reverse compare of second member of the tuple +def cmp_counts(x, y): + return y[1] - x[1] + +class SourceStats(Toplevel): + def __init__(self, source): + self.source = source + Toplevel.__init__(self) + self.resizable(0, 0) + self.title(source.name + " statistics") + self.evframe = LabelFrame(self, + text="Event Frequency and Duration") + self.evframe.grid(row=0, column=0, sticky=E+W) + eventtypes={} + for event in self.source.events: + if (event.type == "pad"): + continue + duration = event.duration + if (eventtypes.has_key(event.name)): + (c, d) = eventtypes[event.name] + c += 1 + d += duration + eventtypes[event.name] = (c, d) + else: + eventtypes[event.name] = (1, duration) + events = [] + for k, v in eventtypes.iteritems(): + (c, d) = v + events.append((k, c, d)) + events.sort(cmp=cmp_counts) + + ypos = 0 + for event in events: + (name, c, d) = event + l = Label(self.evframe, text=name, bd=1, + relief=SUNKEN, anchor=W, width=30) + m = Label(self.evframe, text=str(c), bd=1, + relief=SUNKEN, anchor=W, width=10) + r = Label(self.evframe, text=ticks2sec(d), + bd=1, relief=SUNKEN, width=10) + l.grid(row=ypos, column=0, sticky=E+W) + m.grid(row=ypos, column=1, sticky=E+W) + r.grid(row=ypos, column=2, sticky=E+W) + ypos += 1 + + +class SourceContext(Menu): + def __init__(self, event, source): + self.source = source + Menu.__init__(self, tearoff=0, takefocus=0) + self.add_command(label="hide", command=self.hide) + self.add_command(label="hide group", command=self.hidegroup) + self.add_command(label="stats", command=self.stats) + self.tk_popup(event.x_root-3, event.y_root+3) + + def hide(self): + graph.sourcehide(self.source) + + def hidegroup(self): + grouplist = [] + for source in sources: + if (source.group == self.source.group): + grouplist.append(source) + graph.sourcehidelist(grouplist) + + def show(self): + graph.sourceshow(self.source) + + def stats(self): + SourceStats(self.source) + class EventView(Toplevel): def __init__(self, event, canvas): Toplevel.__init__(self) @@ -510,6 +592,7 @@ class Event: self.idx = None self.item = None self.dispcnt = 0 + self.duration = 0 self.recno = lineno def status(self): @@ -592,8 +675,8 @@ class PointEvent(Event): def draw(self, canvas, xpos, ypos): color = colormap.lookup(self.name) l = canvas.create_oval(xpos - 6, ypos + 1, xpos + 6, ypos - 11, - fill=color, tags=("all", "point", "event", self.name), - width=0) + fill=color, width=0, + tags=("all", "point", "event", self.name, self.source.tag)) Event.draw(self, canvas, xpos, ypos, l) return xpos @@ -607,7 +690,7 @@ class StateEvent(Event): next = self.nexttype("state") if (next == None): return (xpos) - duration = next.timestamp - self.timestamp + self.duration = duration = next.timestamp - self.timestamp self.attrs.insert(0, ("duration", ticks2sec(duration))) color = colormap.lookup(self.name) if (duration < 0): @@ -618,7 +701,7 @@ class StateEvent(Event): delta = duration / canvas.ratio l = canvas.create_rectangle(xpos, ypos, xpos + delta, ypos - 10, fill=color, width=0, - tags=("all", "state", "event", self.name)) + tags=("all", "state", "event", self.name, self.source.tag)) Event.draw(self, canvas, xpos, ypos, l) return (xpos + delta) @@ -635,14 +718,14 @@ class CountEvent(Event): if (next == None): return (xpos) color = colormap.lookup("count") - duration = next.timestamp - self.timestamp + self.duration = duration = next.timestamp - self.timestamp self.attrs.insert(0, ("count", self.count)) self.attrs.insert(1, ("duration", ticks2sec(duration))) delta = duration / canvas.ratio yhight = self.source.yscale() * self.count l = canvas.create_rectangle(xpos, ypos - yhight, xpos + delta, ypos, fill=color, width=0, - tags=("all", "count", "event", self.name)) + tags=("all", "count", "event", self.name, self.source.tag)) Event.draw(self, canvas, xpos, ypos, l) return (xpos + delta) @@ -663,6 +746,10 @@ class PadEvent(StateEvent): Event.draw(self, canvas, xpos, ypos, None) return (xpos + delta) +# Sort function for start y address +def source_cmp_start(x, y): + return x.y - y.y + class EventSource: def __init__(self, group, id): self.name = id @@ -672,6 +759,7 @@ class EventSource: self.y = 0 self.item = None self.hidden = 0 + self.tag = group + id def __cmp__(self, other): if (other == None): @@ -719,14 +807,11 @@ class EventSource: l = canvas.create_rectangle(fromx, ypos - self.ysize() - canvas.bdheight, tox, ypos + canvas.bdheight, fill=color, width=0, - tags=("all", "cpuinfo", cpu), state="hidden") + tags=("all", "cpuinfo", cpu, self.tag), state="hidden") self.cpuitems.append(l) def move(self, canvas, xpos, ypos): - for event in self.events: - event.move(canvas, xpos, ypos) - for item in self.cpuitems: - canvas.move(item, xpos, ypos) + canvas.move(self.tag, xpos, ypos) def movename(self, canvas, xpos, ypos): self.y += ypos @@ -1008,6 +1093,7 @@ class SchedNames(Canvas): self.create_line(0, ypos, self["width"], ypos, width=1, fill="black", tags=("all",)) self.bind("", self.master.mousepress); + self.bind("", self.master.mousepressright); self.bind("", self.master.mouserelease); self.bind("", self.master.mousemotion); @@ -1056,6 +1142,7 @@ class SchedDisplay(Canvas): self.tag_bind("event", "", self.mouseenter) self.tag_bind("event", "", self.mouseexit) self.bind("", self.mousepress) + self.bind("", self.master.mousepressright); self.bind("", self.wheelup) self.bind("", self.wheeldown) self.bind("", self.master.mouserelease); @@ -1146,16 +1233,16 @@ class SchedDisplay(Canvas): class GraphMenu(Frame): def __init__(self, master): Frame.__init__(self, master, bd=2, relief=RAISED) - self.view = Menubutton(self, text="Configure") - self.viewmenu = Menu(self.view, tearoff=0) - self.viewmenu.add_command(label="Event Colors", + self.conf = Menubutton(self, text="Configure") + self.confmenu = Menu(self.conf, tearoff=0) + self.confmenu.add_command(label="Event Colors", command=self.econf) - self.viewmenu.add_command(label="CPU Colors", + self.confmenu.add_command(label="CPU Colors", command=self.cconf) - self.viewmenu.add_command(label="Source Configure", + self.confmenu.add_command(label="Source Configure", command=self.sconf) - self.view["menu"] = self.viewmenu - self.view.pack(side=LEFT) + self.conf["menu"] = self.confmenu + self.conf.pack(side=LEFT) def econf(self): ColorConfigure(eventcolors, "Event Display Configuration") @@ -1166,7 +1253,6 @@ class GraphMenu(Frame): def sconf(self): SourceConfigure() - class SchedGraph(Frame): def __init__(self, master): Frame.__init__(self, master) @@ -1221,6 +1307,12 @@ class SchedGraph(Frame): def mousepress(self, event): self.clicksource = self.sourceat(event.y) + def mousepressright(self, event): + source = self.sourceat(event.y) + if (source == None): + return + SourceContext(event, source) + def mouserelease(self, event): if (self.clicksource == None): return @@ -1287,9 +1379,11 @@ class SchedGraph(Frame): source1.movename(self.names, 0, y1targ - y1) source2.movename(self.names, 0, y2targ - y2) - def sourceshow(self, source): + def sourcepicky(self, source): if (source.hidden == 0): - return; + return self.sourcestart(source) + # Revert to group based sort + sources.sort() prev = None for s in sources: if (s == source): @@ -1300,12 +1394,103 @@ class SchedGraph(Frame): newy = 0 else: newy = self.sourcestart(prev) + self.sourcesize(prev) - self.sourceshiftall(newy-1, self.sourcesize(source)) + return newy + + def sourceshow(self, source): + if (source.hidden == 0): + return; + newy = self.sourcepicky(source) off = newy - self.sourcestart(source) + self.sourceshiftall(newy-1, self.sourcesize(source)) self.sourceshift(source, off) source.hidden = 0 + # + # Optimized source show of multiple entries that only moves each + # existing entry once. Doing sourceshow() iteratively is too + # expensive due to python's canvas.move(). + # + def sourceshowlist(self, srclist): + srclist.sort(cmp=source_cmp_start) + startsize = [] + for source in srclist: + if (source.hidden == 0): + srclist.remove(source) + startsize.append((self.sourcepicky(source), + self.sourcesize(source))) + + sources.sort(cmp=source_cmp_start, reverse=True) + self.status.startup("Updating display..."); + for source in sources: + if (source.hidden == 1): + continue + nstart = self.sourcestart(source) + size = 0 + for hidden in startsize: + (start, sz) = hidden + if (start <= nstart or start+sz <= nstart): + size += sz + self.sourceshift(source, size) + idx = 0 + size = 0 + for source in srclist: + (newy, sz) = startsize[idx] + off = (newy + size) - self.sourcestart(source) + self.sourceshift(source, off) + source.hidden = 0 + size += sz + idx += 1 + self.names.updatescroll() + self.display.updatescroll() + self.status.set("") + + # + # Optimized source hide of multiple entries that only moves each + # remaining entry once. Doing sourcehide() iteratively is too + # expensive due to python's canvas.move(). + # + def sourcehidelist(self, srclist): + srclist.sort(cmp=source_cmp_start) + sources.sort(cmp=source_cmp_start) + startsize = [] + off = len(sources) * 100 + self.status.startup("Updating display..."); + for source in srclist: + if (source.hidden == 1): + srclist.remove(source) + # + # Remember our old position so we can sort things + # below us when we're done. + # + startsize.append((self.sourcestart(source), + self.sourcesize(source))) + self.sourceshift(source, off) + source.hidden = 1 + + idx = 0 + size = 0 + for hidden in startsize: + (start, sz) = hidden + size += sz + if (idx + 1 < len(startsize)): + (stop, sz) = startsize[idx+1] + else: + stop = self.display.ysize() + idx += 1 + for source in sources: + nstart = self.sourcestart(source) + if (nstart < start or source.hidden == 1): + continue + if (nstart >= stop): + break; + self.sourceshift(source, -size) + self.names.updatescroll() + self.display.updatescroll() + self.status.set("") + def sourcehide(self, source): + if (source.hidden == 1): + return; # Move it out of the visible area off = len(sources) * 100 start = self.sourcestart(source) @@ -1319,8 +1504,15 @@ class SchedGraph(Frame): source.movename(self.names, 0, off) self.names.moveline(start, off); self.display.moveline(start, off) + # + # We update the idle tasks to shrink the dirtied area so + # it does not always include the entire screen. + # + self.names.update_idletasks() + self.display.update_idletasks() def sourceshiftall(self, start, off): + self.status.startup("Updating display..."); for source in sources: nstart = self.sourcestart(source) if (nstart < start): @@ -1328,6 +1520,7 @@ class SchedGraph(Frame): self.sourceshift(source, off) self.names.updatescroll() self.display.updatescroll() + self.status.set("") def sourceat(self, ypos): (start, end) = self.names.yview() From owner-svn-src-head@FreeBSD.ORG Sun Jan 18 05:35:59 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A99A81065673; Sun, 18 Jan 2009 05:35:59 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 971498FC16; Sun, 18 Jan 2009 05:35:59 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0I5ZxQ6062520; Sun, 18 Jan 2009 05:35:59 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0I5Zwxr062500; Sun, 18 Jan 2009 05:35:58 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200901180535.n0I5Zwxr062500@svn.freebsd.org> From: Andrew Thompson Date: Sun, 18 Jan 2009 05:35:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187378 - in head/sys/dev/usb2: ethernet wlan X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2009 05:36:00 -0000 Author: thompsa Date: Sun Jan 18 05:35:58 2009 New Revision: 187378 URL: http://svn.freebsd.org/changeset/base/187378 Log: Just put the ifnet pointer first in the softc like it needs to be rather than adding another deliciously evil pointer. Modified: head/sys/dev/usb2/ethernet/if_aue2.c head/sys/dev/usb2/ethernet/if_auereg.h head/sys/dev/usb2/ethernet/if_axe2.c head/sys/dev/usb2/ethernet/if_axereg.h head/sys/dev/usb2/ethernet/if_cdce2.c head/sys/dev/usb2/ethernet/if_cdcereg.h head/sys/dev/usb2/ethernet/if_cue2.c head/sys/dev/usb2/ethernet/if_cuereg.h head/sys/dev/usb2/ethernet/if_kue2.c head/sys/dev/usb2/ethernet/if_kuereg.h head/sys/dev/usb2/ethernet/if_rue2.c head/sys/dev/usb2/ethernet/if_ruereg.h head/sys/dev/usb2/ethernet/if_udav2.c head/sys/dev/usb2/ethernet/if_udavreg.h head/sys/dev/usb2/wlan/if_rum2.c head/sys/dev/usb2/wlan/if_rumvar.h head/sys/dev/usb2/wlan/if_ural2.c head/sys/dev/usb2/wlan/if_uralvar.h head/sys/dev/usb2/wlan/if_zyd2.c head/sys/dev/usb2/wlan/if_zydreg.h Modified: head/sys/dev/usb2/ethernet/if_aue2.c ============================================================================== --- head/sys/dev/usb2/ethernet/if_aue2.c Sun Jan 18 05:23:26 2009 (r187377) +++ head/sys/dev/usb2/ethernet/if_aue2.c Sun Jan 18 05:35:58 2009 (r187378) @@ -834,7 +834,6 @@ aue_cfg_first_time_setup(struct aue_soft sc->sc_name); goto done; } - sc->sc_evilhack = ifp; ifp->if_softc = sc; if_initname(ifp, "aue", sc->sc_unit); Modified: head/sys/dev/usb2/ethernet/if_auereg.h ============================================================================== --- head/sys/dev/usb2/ethernet/if_auereg.h Sun Jan 18 05:23:26 2009 (r187377) +++ head/sys/dev/usb2/ethernet/if_auereg.h Sun Jan 18 05:35:58 2009 (r187378) @@ -205,14 +205,13 @@ struct aue_rxpkt { } __packed; struct aue_softc { - void *sc_evilhack; /* XXX this pointer must be first */ + struct ifnet *sc_ifp; struct usb2_config_td sc_config_td; struct usb2_callout sc_watchdog; struct mtx sc_mtx; struct aue_rxpkt sc_rxpkt; - struct ifnet *sc_ifp; struct usb2_device *sc_udev; struct usb2_xfer *sc_xfer[AUE_N_TRANSFER]; device_t sc_miibus; Modified: head/sys/dev/usb2/ethernet/if_axe2.c ============================================================================== --- head/sys/dev/usb2/ethernet/if_axe2.c Sun Jan 18 05:23:26 2009 (r187377) +++ head/sys/dev/usb2/ethernet/if_axe2.c Sun Jan 18 05:35:58 2009 (r187378) @@ -843,7 +843,6 @@ axe_cfg_first_time_setup(struct axe_soft sc->sc_name); goto done; } - sc->sc_evilhack = ifp; ifp->if_softc = sc; if_initname(ifp, "axe", sc->sc_unit); Modified: head/sys/dev/usb2/ethernet/if_axereg.h ============================================================================== --- head/sys/dev/usb2/ethernet/if_axereg.h Sun Jan 18 05:23:26 2009 (r187377) +++ head/sys/dev/usb2/ethernet/if_axereg.h Sun Jan 18 05:35:58 2009 (r187378) @@ -181,13 +181,12 @@ enum { }; struct axe_softc { - void *sc_evilhack; /* XXX this pointer must be first */ + struct ifnet *sc_ifp; struct usb2_config_td sc_config_td; struct usb2_callout sc_watchdog; struct mtx sc_mtx; - struct ifnet *sc_ifp; struct usb2_device *sc_udev; struct usb2_xfer *sc_xfer[AXE_N_TRANSFER]; device_t sc_miibus; Modified: head/sys/dev/usb2/ethernet/if_cdce2.c ============================================================================== --- head/sys/dev/usb2/ethernet/if_cdce2.c Sun Jan 18 05:23:26 2009 (r187377) +++ head/sys/dev/usb2/ethernet/if_cdce2.c Sun Jan 18 05:35:58 2009 (r187378) @@ -444,7 +444,6 @@ alloc_transfers: device_printf(dev, "cannot if_alloc()\n"); goto detach; } - sc->sc_evilhack = ifp; ifp->if_softc = sc; if_initname(ifp, "cdce", sc->sc_unit); Modified: head/sys/dev/usb2/ethernet/if_cdcereg.h ============================================================================== --- head/sys/dev/usb2/ethernet/if_cdcereg.h Sun Jan 18 05:23:26 2009 (r187377) +++ head/sys/dev/usb2/ethernet/if_cdcereg.h Sun Jan 18 05:35:58 2009 (r187378) @@ -61,7 +61,7 @@ enum { }; struct cdce_softc { - void *sc_evilhack; /* XXX this pointer must be first */ + struct ifnet *sc_ifp; union cdce_eth_tx sc_tx; union cdce_eth_rx sc_rx; @@ -70,7 +70,6 @@ struct cdce_softc { struct cdce_mq sc_rx_mq; struct cdce_mq sc_tx_mq; - struct ifnet *sc_ifp; struct usb2_xfer *sc_xfer[CDCE_N_TRANSFER]; struct usb2_device *sc_udev; device_t sc_dev; Modified: head/sys/dev/usb2/ethernet/if_cue2.c ============================================================================== --- head/sys/dev/usb2/ethernet/if_cue2.c Sun Jan 18 05:23:26 2009 (r187377) +++ head/sys/dev/usb2/ethernet/if_cue2.c Sun Jan 18 05:35:58 2009 (r187378) @@ -468,7 +468,6 @@ cue_cfg_first_time_setup(struct cue_soft sc->sc_unit); goto done; } - sc->sc_evilhack = ifp; ifp->if_softc = sc; if_initname(ifp, "cue", sc->sc_unit); Modified: head/sys/dev/usb2/ethernet/if_cuereg.h ============================================================================== --- head/sys/dev/usb2/ethernet/if_cuereg.h Sun Jan 18 05:23:26 2009 (r187377) +++ head/sys/dev/usb2/ethernet/if_cuereg.h Sun Jan 18 05:35:58 2009 (r187378) @@ -122,13 +122,12 @@ enum { }; struct cue_softc { - void *sc_evilhack; /* XXX this pointer must be first */ + struct ifnet *sc_ifp; struct usb2_config_td sc_config_td; struct usb2_callout sc_watchdog; struct mtx sc_mtx; - struct ifnet *sc_ifp; device_t sc_dev; struct usb2_device *sc_udev; struct usb2_xfer *sc_xfer[CUE_N_TRANSFER]; Modified: head/sys/dev/usb2/ethernet/if_kue2.c ============================================================================== --- head/sys/dev/usb2/ethernet/if_kue2.c Sun Jan 18 05:23:26 2009 (r187377) +++ head/sys/dev/usb2/ethernet/if_kue2.c Sun Jan 18 05:35:58 2009 (r187378) @@ -536,7 +536,6 @@ kue_cfg_first_time_setup(struct kue_soft sc->sc_unit); goto done; } - sc->sc_evilhack = ifp; ifp->if_softc = sc; if_initname(ifp, "kue", sc->sc_unit); Modified: head/sys/dev/usb2/ethernet/if_kuereg.h ============================================================================== --- head/sys/dev/usb2/ethernet/if_kuereg.h Sun Jan 18 05:23:26 2009 (r187377) +++ head/sys/dev/usb2/ethernet/if_kuereg.h Sun Jan 18 05:35:58 2009 (r187378) @@ -125,14 +125,13 @@ enum { }; struct kue_softc { - void *sc_evilhack; /* XXX this pointer must be first */ + struct ifnet *sc_ifp; struct usb2_config_td sc_config_td; struct usb2_callout sc_watchdog; struct mtx sc_mtx; struct kue_ether_desc sc_desc; - struct ifnet *sc_ifp; device_t sc_dev; struct usb2_device *sc_udev; struct usb2_xfer *sc_xfer[KUE_N_TRANSFER]; Modified: head/sys/dev/usb2/ethernet/if_rue2.c ============================================================================== --- head/sys/dev/usb2/ethernet/if_rue2.c Sun Jan 18 05:23:26 2009 (r187377) +++ head/sys/dev/usb2/ethernet/if_rue2.c Sun Jan 18 05:35:58 2009 (r187378) @@ -713,7 +713,6 @@ rue_cfg_first_time_setup(struct rue_soft sc->sc_name); goto done; } - sc->sc_evilhack = ifp; ifp->if_softc = sc; if_initname(ifp, "rue", sc->sc_unit); Modified: head/sys/dev/usb2/ethernet/if_ruereg.h ============================================================================== --- head/sys/dev/usb2/ethernet/if_ruereg.h Sun Jan 18 05:23:26 2009 (r187377) +++ head/sys/dev/usb2/ethernet/if_ruereg.h Sun Jan 18 05:35:58 2009 (r187378) @@ -174,13 +174,12 @@ enum { }; struct rue_softc { - void *sc_evilhack; /* XXX this pointer must be first */ + struct ifnet *sc_ifp; struct usb2_config_td sc_config_td; struct usb2_callout sc_watchdog; struct mtx sc_mtx; - struct ifnet *sc_ifp; struct usb2_device *sc_udev; struct usb2_xfer *sc_xfer[RUE_N_TRANSFER]; device_t sc_miibus; Modified: head/sys/dev/usb2/ethernet/if_udav2.c ============================================================================== --- head/sys/dev/usb2/ethernet/if_udav2.c Sun Jan 18 05:23:26 2009 (r187377) +++ head/sys/dev/usb2/ethernet/if_udav2.c Sun Jan 18 05:35:58 2009 (r187378) @@ -344,7 +344,6 @@ udav_cfg_first_time_setup(struct udav_so sc->sc_name); goto done; } - sc->sc_evilhack = ifp; ifp->if_softc = sc; if_initname(ifp, "udav", sc->sc_unit); Modified: head/sys/dev/usb2/ethernet/if_udavreg.h ============================================================================== --- head/sys/dev/usb2/ethernet/if_udavreg.h Sun Jan 18 05:23:26 2009 (r187377) +++ head/sys/dev/usb2/ethernet/if_udavreg.h Sun Jan 18 05:35:58 2009 (r187378) @@ -145,13 +145,12 @@ enum { }; struct udav_softc { - void *sc_evilhack; /* XXX this pointer must be first */ + struct ifnet *sc_ifp; struct usb2_config_td sc_config_td; struct usb2_callout sc_watchdog; struct mtx sc_mtx; - struct ifnet *sc_ifp; struct usb2_device *sc_udev; struct usb2_xfer *sc_xfer[UDAV_N_TRANSFER]; device_t sc_miibus; Modified: head/sys/dev/usb2/wlan/if_rum2.c ============================================================================== --- head/sys/dev/usb2/wlan/if_rum2.c Sun Jan 18 05:23:26 2009 (r187377) +++ head/sys/dev/usb2/wlan/if_rum2.c Sun Jan 18 05:35:58 2009 (r187378) @@ -789,7 +789,6 @@ rum_cfg_first_time_setup(struct rum_soft DPRINTFN(0, "could not if_alloc()!\n"); goto done; } - sc->sc_evilhack = ifp; sc->sc_ifp = ifp; ic = ifp->if_l2com; Modified: head/sys/dev/usb2/wlan/if_rumvar.h ============================================================================== --- head/sys/dev/usb2/wlan/if_rumvar.h Sun Jan 18 05:23:26 2009 (r187377) +++ head/sys/dev/usb2/wlan/if_rumvar.h Sun Jan 18 05:35:58 2009 (r187378) @@ -120,7 +120,7 @@ enum { }; struct rum_softc { - void *sc_evilhack; /* XXX this pointer must be first */ + struct ifnet *sc_ifp; struct rum_ifq sc_tx_queue; struct usb2_config_td sc_config_td; @@ -133,7 +133,6 @@ struct rum_softc { struct rum_tx_radiotap_header sc_txtap; struct usb2_xfer *sc_xfer[RUM_N_TRANSFER]; - struct ifnet *sc_ifp; struct usb2_device *sc_udev; const struct ieee80211_rate_table *sc_rates; Modified: head/sys/dev/usb2/wlan/if_ural2.c ============================================================================== --- head/sys/dev/usb2/wlan/if_ural2.c Sun Jan 18 05:23:26 2009 (r187377) +++ head/sys/dev/usb2/wlan/if_ural2.c Sun Jan 18 05:35:58 2009 (r187378) @@ -800,7 +800,6 @@ ural_cfg_first_time_setup(struct ural_so DPRINTFN(0, "could not if_alloc()!\n"); goto done; } - sc->sc_evilhack = ifp; sc->sc_ifp = ifp; ic = ifp->if_l2com; Modified: head/sys/dev/usb2/wlan/if_uralvar.h ============================================================================== --- head/sys/dev/usb2/wlan/if_uralvar.h Sun Jan 18 05:23:26 2009 (r187377) +++ head/sys/dev/usb2/wlan/if_uralvar.h Sun Jan 18 05:35:58 2009 (r187378) @@ -120,7 +120,7 @@ enum { }; struct ural_softc { - void *sc_evilhack; /* XXX this pointer must be first */ + struct ifnet *sc_ifp; struct ural_ifq sc_tx_queue; struct usb2_config_td sc_config_td; @@ -133,7 +133,6 @@ struct ural_softc { struct ural_tx_radiotap_header sc_txtap; struct usb2_xfer *sc_xfer[URAL_N_TRANSFER]; - struct ifnet *sc_ifp; struct usb2_device *sc_udev; const struct ieee80211_rate_table *sc_rates; Modified: head/sys/dev/usb2/wlan/if_zyd2.c ============================================================================== --- head/sys/dev/usb2/wlan/if_zyd2.c Sun Jan 18 05:23:26 2009 (r187377) +++ head/sys/dev/usb2/wlan/if_zyd2.c Sun Jan 18 05:35:58 2009 (r187378) @@ -2078,7 +2078,6 @@ zyd_cfg_first_time_setup(struct zyd_soft sc->sc_name); goto done; } - sc->sc_evilhack = ifp; sc->sc_ifp = ifp; ic = ifp->if_l2com; Modified: head/sys/dev/usb2/wlan/if_zydreg.h ============================================================================== --- head/sys/dev/usb2/wlan/if_zydreg.h Sun Jan 18 05:23:26 2009 (r187377) +++ head/sys/dev/usb2/wlan/if_zydreg.h Sun Jan 18 05:35:58 2009 (r187378) @@ -1285,7 +1285,7 @@ enum { }; struct zyd_softc { - void *sc_evilhack; /* XXX this pointer must be first */ + struct ifnet *sc_ifp; struct zyd_rf sc_rf; struct usb2_callout sc_watchdog; @@ -1299,7 +1299,6 @@ struct zyd_softc { struct zyd_ifq sc_tx_queue; struct cv sc_intr_cv; - struct ifnet *sc_ifp; struct usb2_device *sc_udev; struct usb2_xfer *sc_xfer[ZYD_N_TRANSFER]; const struct ieee80211_rate_table *sc_rates; From owner-svn-src-head@FreeBSD.ORG Sun Jan 18 05:44:32 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 621F01065675; Sun, 18 Jan 2009 05:44:32 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3B17A8FC8D; Sun, 18 Jan 2009 05:44:32 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0I5iWeU062744; Sun, 18 Jan 2009 05:44:32 GMT (envelope-from jeff@svn.freebsd.org) Received: (from jeff@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0I5iWl2062743; Sun, 18 Jan 2009 05:44:32 GMT (envelope-from jeff@svn.freebsd.org) Message-Id: <200901180544.n0I5iWl2062743@svn.freebsd.org> From: Jeff Roberson Date: Sun, 18 Jan 2009 05:44:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187379 - head/tools/sched X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2009 05:44:35 -0000 Author: jeff Date: Sun Jan 18 05:44:31 2009 New Revision: 187379 URL: http://svn.freebsd.org/changeset/base/187379 Log: - Add summary information to the title once the file is parsed rather than printing it to the terminal. Now only parse errors go to the terminal. - Speedup drawing by raising and lowering tags only once everything has been drawn. Surprisingly, it now takes a little longer to parse than it does to draw. - Parameterize the layout with X_ and Y_ defines that determine the sizes of various things. - Remove unnecessary tags. Modified: head/tools/sched/schedgraph.py Modified: head/tools/sched/schedgraph.py ============================================================================== --- head/tools/sched/schedgraph.py Sun Jan 18 05:35:58 2009 (r187378) +++ head/tools/sched/schedgraph.py Sun Jan 18 05:44:31 2009 (r187379) @@ -86,7 +86,7 @@ eventcolors = [ ("lock contest", "purple"), ("failed lock try", "red"), ("lock release", "grey"), - ("tick", "black"), + ("statclock", "black"), ("prio", "black"), ("lend prio", "black"), ("wokeup", "black") @@ -125,6 +125,12 @@ clockfreq = None sources = [] lineno = -1 +Y_BORDER = 10 +X_BORDER = 10 +Y_COUNTER = 80 +Y_EVENTSOURCE = 10 +XY_POINT = 4 + class Colormap: def __init__(self, table): self.table = table @@ -674,9 +680,10 @@ class PointEvent(Event): def draw(self, canvas, xpos, ypos): color = colormap.lookup(self.name) - l = canvas.create_oval(xpos - 6, ypos + 1, xpos + 6, ypos - 11, + l = canvas.create_oval(xpos - XY_POINT, ypos, + xpos + XY_POINT, ypos - (XY_POINT * 2), fill=color, width=0, - tags=("all", "point", "event", self.name, self.source.tag)) + tags=("event", self.type, self.name, self.source.tag)) Event.draw(self, canvas, xpos, ypos, l) return xpos @@ -701,7 +708,7 @@ class StateEvent(Event): delta = duration / canvas.ratio l = canvas.create_rectangle(xpos, ypos, xpos + delta, ypos - 10, fill=color, width=0, - tags=("all", "state", "event", self.name, self.source.tag)) + tags=("event", self.type, self.name, self.source.tag)) Event.draw(self, canvas, xpos, ypos, l) return (xpos + delta) @@ -725,7 +732,7 @@ class CountEvent(Event): yhight = self.source.yscale() * self.count l = canvas.create_rectangle(xpos, ypos - yhight, xpos + delta, ypos, fill=color, width=0, - tags=("all", "count", "event", self.name, self.source.tag)) + tags=("event", self.type, self.name, self.source.tag)) Event.draw(self, canvas, xpos, ypos, l) return (xpos + delta) @@ -797,7 +804,8 @@ class EventSource: def drawname(self, canvas, ypos): self.y = ypos ypos = ypos - (self.ysize() / 2) - self.item = canvas.create_text(10, ypos, anchor="w", text=self.name) + self.item = canvas.create_text(X_BORDER, ypos, anchor="w", + text=self.name) return (self.item) def drawcpu(self, canvas, cpu, fromx, tox, ypos): @@ -807,7 +815,7 @@ class EventSource: l = canvas.create_rectangle(fromx, ypos - self.ysize() - canvas.bdheight, tox, ypos + canvas.bdheight, fill=color, width=0, - tags=("all", "cpuinfo", cpu, self.tag), state="hidden") + tags=("cpubg", cpu, self.tag), state="hidden") self.cpuitems.append(l) def move(self, canvas, xpos, ypos): @@ -818,7 +826,7 @@ class EventSource: canvas.move(self.item, xpos, ypos) def ysize(self): - return (10) + return (Y_EVENTSOURCE) def eventat(self, i): if (i >= len(self.events)): @@ -858,7 +866,7 @@ class Counter(EventSource): return (Counter.groups[self.group]) def ysize(self): - return (80) + return (Y_COUNTER) def yscale(self): return (self.ysize() / self.ymax()) @@ -873,16 +881,22 @@ class KTRFile: self.load = {} self.crit = {} self.stathz = 0 + self.eventcnt = 0 self.parse(file) self.fixup() global ticksps ticksps = self.ticksps() - timespan = self.timespan() - print "first tick", self.timestamp_f, - print "last tick", self.timestamp_l - print "Ticks per second", ticksps - print "time span", timespan, "ticks", ticks2sec(timespan) + span = self.timespan() + ghz = float(ticksps) / 1000000000.0 + # + # Update the title with some stats from the file + # + titlestr = "SchedGraph: " + titlestr += ticks2sec(span) + " at %.3f ghz, " % ghz + titlestr += str(len(sources)) + " event sources, " + titlestr += str(self.eventcnt) + " events" + root.title(titlestr) def parse(self, file): try: @@ -990,6 +1004,7 @@ class KTRFile: elif (type == "point"): e = PointEvent(source, *args) if (e != None): + self.eventcnt += 1 source.addevent(e); return e @@ -1132,13 +1147,10 @@ class SchedDisplay(Canvas): ypos += source.ysize() source.draw(self, ypos) ypos += self.bdheight - try: - self.tag_raise("point", "state") - self.tag_lower("cpuinfo", "all") - except: - pass + self.tag_raise("point", "state") + self.tag_lower("cpubg", ALL) self.create_line(0, ypos, xsize, ypos, - width=1, fill="black", tags=("all",)) + width=1, fill="black", tags=("lines",)) self.tag_bind("event", "", self.mouseenter) self.tag_bind("event", "", self.mouseexit) self.bind("", self.mousepress) @@ -1187,7 +1199,7 @@ class SchedDisplay(Canvas): self.parent.display_yview("scroll", -1, "units") def xsize(self): - return ((ktrfile.timespan() / self.ratio) + 20) + return ((ktrfile.timespan() / self.ratio) + (X_BORDER * 2)) def ysize(self): ysize = 0 @@ -1206,7 +1218,7 @@ class SchedDisplay(Canvas): self.ratio = ratio self.updatescroll() - self.scale("all", 0, 0, float(oldratio) / ratio, 1) + self.scale(ALL, 0, 0, float(oldratio) / ratio, 1) xstart, xend = self.xview() xsize = (xend - xstart) / 2 @@ -1261,7 +1273,7 @@ class SchedGraph(Frame): self.display = None self.scale = None self.status = None - self.bdheight = 10 + self.bdheight = Y_BORDER self.clicksource = None self.lastsource = None self.pack(expand=1, fill="both") @@ -1559,7 +1571,7 @@ if (len(sys.argv) > 2): clockfreq = float(sys.argv[2]) root = Tk() -root.title("Scheduler Graph") +root.title("SchedGraph") colormap = Colormap(eventcolors) cpucolormap = Colormap(cpucolors) graph = SchedGraph(root) From owner-svn-src-head@FreeBSD.ORG Sun Jan 18 07:20:03 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0BD2910656D5; Sun, 18 Jan 2009 07:20:03 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EF5968FC16; Sun, 18 Jan 2009 07:20:02 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0I7K23T064627; Sun, 18 Jan 2009 07:20:02 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0I7K2oR064625; Sun, 18 Jan 2009 07:20:02 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200901180720.n0I7K2oR064625@svn.freebsd.org> From: Sam Leffler Date: Sun, 18 Jan 2009 07:20:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187380 - in head/sys: netinet netinet6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2009 07:20:03 -0000 Author: sam Date: Sun Jan 18 07:20:02 2009 New Revision: 187380 URL: http://svn.freebsd.org/changeset/base/187380 Log: remove too noisy DIAGNOSTIC code Reviewed by: qingli Modified: head/sys/netinet/in.c head/sys/netinet6/in6_ifattach.c Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Sun Jan 18 05:44:31 2009 (r187379) +++ head/sys/netinet/in.c Sun Jan 18 07:20:02 2009 (r187380) @@ -1003,9 +1003,6 @@ in_purgemaddrs(struct ifnet *ifp) struct in_multi *inm; struct in_multi *oinm; -#ifdef DIAGNOSTIC - printf("%s: purging ifp %p\n", __func__, ifp); -#endif IFF_LOCKGIANT(ifp); IN_MULTI_LOCK(); LIST_FOREACH_SAFE(inm, &V_in_multihead, inm_link, oinm) { Modified: head/sys/netinet6/in6_ifattach.c ============================================================================== --- head/sys/netinet6/in6_ifattach.c Sun Jan 18 05:44:31 2009 (r187379) +++ head/sys/netinet6/in6_ifattach.c Sun Jan 18 07:20:02 2009 (r187380) @@ -904,10 +904,6 @@ in6_purgemaddrs(struct ifnet *ifp) struct in6_multi *in6m; struct in6_multi *oin6m; -#ifdef DIAGNOSTIC - printf("%s: purging ifp %p\n", __func__, ifp); -#endif - IFF_LOCKGIANT(ifp); LIST_FOREACH_SAFE(in6m, &in6_multihead, in6m_entry, oin6m) { if (in6m->in6m_ifp == ifp) From owner-svn-src-head@FreeBSD.ORG Sun Jan 18 08:00:55 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB3831065673; Sun, 18 Jan 2009 08:00:55 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9A83A8FC12; Sun, 18 Jan 2009 08:00:55 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0I80tTg065480; Sun, 18 Jan 2009 08:00:55 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0I80tdw065479; Sun, 18 Jan 2009 08:00:55 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200901180800.n0I80tdw065479@svn.freebsd.org> From: Alan Cox Date: Sun, 18 Jan 2009 08:00:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187381 - head/sys/ia64/ia64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2009 08:00:56 -0000 Author: alc Date: Sun Jan 18 08:00:55 2009 New Revision: 187381 URL: http://svn.freebsd.org/changeset/base/187381 Log: Correct an error in revision 1.170 of this file. When get_pv_entry() is forced to reclaim pv entries, the one pv entry that it returns should not be freed. Modified: head/sys/ia64/ia64/pmap.c Modified: head/sys/ia64/ia64/pmap.c ============================================================================== --- head/sys/ia64/ia64/pmap.c Sun Jan 18 07:20:02 2009 (r187380) +++ head/sys/ia64/ia64/pmap.c Sun Jan 18 08:00:55 2009 (r187381) @@ -239,9 +239,11 @@ static pv_entry_t get_pv_entry(pmap_t lo static void pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot); +static void pmap_free_pte(struct ia64_lpte *pte, vm_offset_t va); static void pmap_invalidate_all(pmap_t pmap); static int pmap_remove_pte(pmap_t pmap, struct ia64_lpte *pte, vm_offset_t va, pv_entry_t pv, int freepte); +static int pmap_remove_vhpt(vm_offset_t va); static boolean_t pmap_try_insert_pv_entry(pmap_t pmap, vm_offset_t va, vm_page_t m); @@ -799,11 +801,23 @@ retry: PMAP_LOCK(pmap); else if (pmap != locked_pmap && !PMAP_TRYLOCK(pmap)) continue; + pmap->pm_stats.resident_count--; oldpmap = pmap_switch(pmap); pte = pmap_find_vhpt(va); KASSERT(pte != NULL, ("pte")); - pmap_remove_pte(pmap, pte, va, pv, 1); + pmap_remove_vhpt(va); + pmap_invalidate_page(pmap, va); pmap_switch(oldpmap); + if (pmap_accessed(pte)) + vm_page_flag_set(m, PG_REFERENCED); + if (pmap_dirty(pte)) + vm_page_dirty(m); + pmap_free_pte(pte, va); + TAILQ_REMOVE(&pmap->pm_pvlist, pv, pv_plist); + m->md.pv_list_count--; + TAILQ_REMOVE(&m->md.pv_list, pv, pv_list); + if (TAILQ_EMPTY(&m->md.pv_list)) + vm_page_flag_clear(m, PG_WRITEABLE); if (pmap != locked_pmap) PMAP_UNLOCK(pmap); if (allocated_pv == NULL) From owner-svn-src-head@FreeBSD.ORG Sun Jan 18 09:44:33 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C150B1065673; Sun, 18 Jan 2009 09:44:33 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AFBF98FC1C; Sun, 18 Jan 2009 09:44:33 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0I9iXCr067555; Sun, 18 Jan 2009 09:44:33 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0I9iXOC067554; Sun, 18 Jan 2009 09:44:33 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200901180944.n0I9iXOC067554@svn.freebsd.org> From: Ed Schouten Date: Sun, 18 Jan 2009 09:44:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187382 - head/sys/dev/syscons/teken X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2009 09:44:34 -0000 Author: ed Date: Sun Jan 18 09:44:33 2009 New Revision: 187382 URL: http://svn.freebsd.org/changeset/base/187382 Log: Don't forget to mark the color translation array as const. Spotted by: Christoph Mallon Modified: head/sys/dev/syscons/teken/teken_subr_compat.h Modified: head/sys/dev/syscons/teken/teken_subr_compat.h ============================================================================== --- head/sys/dev/syscons/teken/teken_subr_compat.h Sun Jan 18 08:00:55 2009 (r187381) +++ head/sys/dev/syscons/teken/teken_subr_compat.h Sun Jan 18 09:44:33 2009 (r187382) @@ -33,8 +33,8 @@ teken_subr_cons25_set_cursor_type(teken_ teken_funcs_param(t, TP_SHOWCURSOR, type != 1); } -static teken_color_t cons25_colors[8] = { TC_BLACK, TC_BLUE, TC_GREEN, - TC_CYAN, TC_RED, TC_MAGENTA, TC_BROWN, TC_WHITE }; +static const teken_color_t cons25_colors[8] = { TC_BLACK, TC_BLUE, + TC_GREEN, TC_CYAN, TC_RED, TC_MAGENTA, TC_BROWN, TC_WHITE }; static void teken_subr_cons25_set_adapter_background(teken_t *t, unsigned int c) From owner-svn-src-head@FreeBSD.ORG Sun Jan 18 09:47:51 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B42221065676; Sun, 18 Jan 2009 09:47:51 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from mail-bw0-f16.google.com (mail-bw0-f16.google.com [209.85.218.16]) by mx1.freebsd.org (Postfix) with ESMTP id A70AC8FC08; Sun, 18 Jan 2009 09:47:50 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: by bwz9 with SMTP id 9so10185bwz.19 for ; Sun, 18 Jan 2009 01:47:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=qsL2PiNGet4aA1v6u3P/il6yFcSYu3ubUiH211OBTOk=; b=OmK0rlYkLMo32sYmX/LPXLPMoGxNHSsThM8/Gm+dugzYM2LpcfA5vnhJ886JjulxSX MM22wjRcRBgMCVTnie1kXRT9IbGyQ2ivMMwNHn9+MHlYAH+vE6ZKKW2i9y/axEkYwvVM rxOUzM51O8F6yq4TNeYhuABS9HM23h/ziCduM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=TvHhlR/fGCIz2IkQGKWiG1k/pF40hMNbnGOf+IOtF0iZCwprRvhmLFHaPjTkxZQiYy RRTnDYa3QCJMoJJV9H+Bfm9rDkv6Z4jH/QxTrZsMW2kwQiYjrgYx77w+rASW0HYUNzvg Yk3ngN9OnqVKMVVERk2vOp6aQs2SBSsVANp2Q= MIME-Version: 1.0 Received: by 10.180.224.4 with SMTP id w4mr1598571bkg.174.1232272007318; Sun, 18 Jan 2009 01:46:47 -0800 (PST) In-Reply-To: <200901172301.n0HN1ePm054707@svn.freebsd.org> References: <200901172301.n0HN1ePm054707@svn.freebsd.org> Date: Sun, 18 Jan 2009 01:46:47 -0800 Message-ID: <7d6fde3d0901180146v4fe098abmd526e2a2c869282b@mail.gmail.com> From: Garrett Cooper To: Ed Schouten Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r187374 - head/sys/dev/syscons/teken X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2009 09:47:52 -0000 On Sat, Jan 17, 2009 at 3:01 PM, Ed Schouten wrote: [...] > Modified: > head/sys/dev/syscons/teken/teken_subr_compat.h > > Modified: head/sys/dev/syscons/teken/teken_subr_compat.h > ============================================================================== > --- head/sys/dev/syscons/teken/teken_subr_compat.h Sat Jan 17 22:53:53 2009 (r187373) > +++ head/sys/dev/syscons/teken/teken_subr_compat.h Sat Jan 17 23:01:40 2009 (r187374) > @@ -33,20 +33,23 @@ teken_subr_cons25_set_cursor_type(teken_ > teken_funcs_param(t, TP_SHOWCURSOR, type != 1); > } [...] Dumb question: Why are C function definitions in a .h file? I know it's legal, but at least from what I've been coached on in the past, it isn't necessarily the most kosher way of solving the issue. Macros are a different point. Thanks, -Garrett From owner-svn-src-head@FreeBSD.ORG Sun Jan 18 10:11:49 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A21111065676 for ; Sun, 18 Jan 2009 10:11:49 +0000 (UTC) (envelope-from christoph.mallon@gmx.de) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by mx1.freebsd.org (Postfix) with SMTP id E02E58FC1D for ; Sun, 18 Jan 2009 10:11:48 +0000 (UTC) (envelope-from christoph.mallon@gmx.de) Received: (qmail invoked by alias); 18 Jan 2009 10:11:47 -0000 Received: from p54A3EF46.dip.t-dialin.net (EHLO tron.homeunix.org) [84.163.239.70] by mail.gmx.net (mp015) with SMTP; 18 Jan 2009 11:11:47 +0100 X-Authenticated: #1673122 X-Provags-ID: V01U2FsdGVkX1/zoXt63iHzubKtbb6Wabbc68qGezfkVzKXSwTKmq I98VV78zDHLOCD Message-ID: <49730062.2010900@gmx.de> Date: Sun, 18 Jan 2009 11:11:46 +0100 From: Christoph Mallon User-Agent: Thunderbird 2.0.0.19 (X11/20090103) MIME-Version: 1.0 To: Garrett Cooper References: <200901172301.n0HN1ePm054707@svn.freebsd.org> <7d6fde3d0901180146v4fe098abmd526e2a2c869282b@mail.gmail.com> In-Reply-To: <7d6fde3d0901180146v4fe098abmd526e2a2c869282b@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.57 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ed Schouten Subject: Re: svn commit: r187374 - head/sys/dev/syscons/teken X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2009 10:11:50 -0000 Garrett Cooper schrieb: > On Sat, Jan 17, 2009 at 3:01 PM, Ed Schouten wrote: > > [...] > >> Modified: >> head/sys/dev/syscons/teken/teken_subr_compat.h >> >> Modified: head/sys/dev/syscons/teken/teken_subr_compat.h >> ============================================================================== >> --- head/sys/dev/syscons/teken/teken_subr_compat.h Sat Jan 17 22:53:53 2009 (r187373) >> +++ head/sys/dev/syscons/teken/teken_subr_compat.h Sat Jan 17 23:01:40 2009 (r187374) >> @@ -33,20 +33,23 @@ teken_subr_cons25_set_cursor_type(teken_ >> teken_funcs_param(t, TP_SHOWCURSOR, type != 1); >> } > > [...] > > Dumb question: > > Why are C function definitions in a .h file? I know it's legal, but at > least from what I've been coached on in the past, it isn't necessarily > the most kosher way of solving the issue. > > Macros are a different point. This is just a one-time include. I guess Ed used the .h suffix so his $EDITOR chooses the right syntax highlighting. There is some magic going on to call these functions (you probably noticed he didn't add any obvious callers): The callers are generated by a script. The differnt parts are then all included in teken.c. From owner-svn-src-head@FreeBSD.ORG Sun Jan 18 10:58:27 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CCFEA106564A; Sun, 18 Jan 2009 10:58:27 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:613:100::211]) by mx1.freebsd.org (Postfix) with ESMTP id 66B068FC0A; Sun, 18 Jan 2009 10:58:27 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: by palm.hoeg.nl (Postfix, from userid 1000) id E49111CC46; Sun, 18 Jan 2009 11:58:25 +0100 (CET) Date: Sun, 18 Jan 2009 11:58:25 +0100 From: Ed Schouten To: Garrett Cooper Message-ID: <20090118105825.GR1247@hoeg.nl> References: <200901172301.n0HN1ePm054707@svn.freebsd.org> <7d6fde3d0901180146v4fe098abmd526e2a2c869282b@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="0iexB5Bk8cF8G6DP" Content-Disposition: inline In-Reply-To: <7d6fde3d0901180146v4fe098abmd526e2a2c869282b@mail.gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r187374 - head/sys/dev/syscons/teken X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2009 10:58:28 -0000 --0iexB5Bk8cF8G6DP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello Garrett, * Garrett Cooper wrote: > Dumb question: >=20 > Why are C function definitions in a .h file? I know it's legal, but at > least from what I've been coached on in the past, it isn't necessarily > the most kosher way of solving the issue. >=20 > Macros are a different point. The reason why the file ends with .h, is because it is included from teken.c. I could have named it teken_subr_compat.c, but I used the .h extension to make it more clear this file is included somewhere else, it doesn't live on its own. The reason why everything is included in teken.c, is because libteken has a very large amount of small functions. Right now almost all the functions in teken_subr* are inlined into the state machine itself, having a dramatic effect on the binary size. So yes, it's not as elegant/traditional as what we normally have, but there is a reason why I did it. --=20 Ed Schouten WWW: http://80386.nl/ --0iexB5Bk8cF8G6DP Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAklzC1EACgkQ52SDGA2eCwWyzgCfUQm00z3QLDOkG7s0mAvF+rKv tZAAnjx1lOYr1jPjaRQUuJ8pn+bJKvLf =LTby -----END PGP SIGNATURE----- --0iexB5Bk8cF8G6DP-- From owner-svn-src-head@FreeBSD.ORG Sun Jan 18 11:38:35 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA4A21065675; Sun, 18 Jan 2009 11:38:35 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C8B138FC16; Sun, 18 Jan 2009 11:38:35 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0IBcZNK072049; Sun, 18 Jan 2009 11:38:35 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0IBcZSB072048; Sun, 18 Jan 2009 11:38:35 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200901181138.n0IBcZSB072048@svn.freebsd.org> From: Alexander Motin Date: Sun, 18 Jan 2009 11:38:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187384 - head/sbin/route X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2009 11:38:36 -0000 Author: mav Date: Sun Jan 18 11:38:35 2009 New Revision: 187384 URL: http://svn.freebsd.org/changeset/base/187384 Log: Fix regression introduced in rev. 173124: 0.0.0.0/1 is not the same as 0.0.0.0/0. MFC after: 1 month Modified: head/sbin/route/route.c Modified: head/sbin/route/route.c ============================================================================== --- head/sbin/route/route.c Sun Jan 18 11:17:46 2009 (r187383) +++ head/sbin/route/route.c Sun Jan 18 11:38:35 2009 (r187384) @@ -791,33 +791,34 @@ inet_makenetandmask(net, sin, bits) char *cp; rtm_addrs |= RTA_NETMASK; - if (net == 0) - mask = addr = 0; - else { - if (net <= 0xff) - addr = net << IN_CLASSA_NSHIFT; - else if (net <= 0xffff) - addr = net << IN_CLASSB_NSHIFT; - else if (net <= 0xffffff) - addr = net << IN_CLASSC_NSHIFT; - else - addr = net; + /* + * XXX: This approach unable to handle 0.0.0.1/32 correctly + * as inet_network() converts 0.0.0.1 and 1 equally. + */ + if (net <= 0xff) + addr = net << IN_CLASSA_NSHIFT; + else if (net <= 0xffff) + addr = net << IN_CLASSB_NSHIFT; + else if (net <= 0xffffff) + addr = net << IN_CLASSC_NSHIFT; + else + addr = net; + + if (bits != 0) + mask = 0xffffffff << (32 - bits); + else if (net == 0) + mask = 0; + else if (IN_CLASSA(addr)) + mask = IN_CLASSA_NET; + else if (IN_CLASSB(addr)) + mask = IN_CLASSB_NET; + else if (IN_CLASSC(addr)) + mask = IN_CLASSC_NET; + else if (IN_MULTICAST(addr)) + mask = IN_CLASSD_NET; + else + mask = 0xffffffff; - if (bits != 0) - mask = 0xffffffff << (32 - bits); - else { - if (IN_CLASSA(addr)) - mask = IN_CLASSA_NET; - else if (IN_CLASSB(addr)) - mask = IN_CLASSB_NET; - else if (IN_CLASSC(addr)) - mask = IN_CLASSC_NET; - else if (IN_MULTICAST(addr)) - mask = IN_CLASSD_NET; - else - mask = 0xffffffff; - } - } sin->sin_addr.s_addr = htonl(addr); sin = &so_mask.sin; sin->sin_addr.s_addr = htonl(mask); From owner-svn-src-head@FreeBSD.ORG Sun Jan 18 12:03:43 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B912C10656C7; Sun, 18 Jan 2009 12:03:43 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A4B958FC0C; Sun, 18 Jan 2009 12:03:43 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0IC3hS1072722; Sun, 18 Jan 2009 12:03:43 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0IC3h1X072721; Sun, 18 Jan 2009 12:03:43 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200901181203.n0IC3h1X072721@svn.freebsd.org> From: Alexander Motin Date: Sun, 18 Jan 2009 12:03:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187387 - head/sys/netgraph X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2009 12:03:47 -0000 Author: mav Date: Sun Jan 18 12:03:43 2009 New Revision: 187387 URL: http://svn.freebsd.org/changeset/base/187387 Log: Remove strict limitation on minimal multilink MRRU. RFC claims that MRRU of 1500 must be supported, but allows smaller values to be negotiated. Enforce specified MRRU for outgoing frames. MFC after: 2 weeks Modified: head/sys/netgraph/ng_ppp.c Modified: head/sys/netgraph/ng_ppp.c ============================================================================== --- head/sys/netgraph/ng_ppp.c Sun Jan 18 11:47:39 2009 (r187386) +++ head/sys/netgraph/ng_ppp.c Sun Jan 18 12:03:43 2009 (r187387) @@ -128,7 +128,6 @@ MALLOC_DEFINE(M_NETGRAPH_PPP, "netgraph_ #define PROT_VJUNCOMP 0x002f /* Multilink PPP definitions */ -#define MP_MIN_MRRU 1500 /* per RFC 1990 */ #define MP_INITIAL_SEQ 0 /* per RFC 1990 */ #define MP_MIN_LINK_MRU 32 @@ -1985,6 +1984,12 @@ ng_ppp_mp_xmit(node_p node, item_p item, priv->activeLinks[0], plen)); } + /* Check peer's MRRU for this bundle. */ + if (plen > priv->conf.mrru) { + NG_FREE_ITEM(item); + return (EMSGSIZE); + } + /* Extract mbuf. */ NGI_GET_M(item, m); @@ -2540,10 +2545,6 @@ ng_ppp_config_valid(node_p node, const s return (0); } - /* Check bundle parameters */ - if (newConf->bund.enableMultilink && newConf->bund.mrru < MP_MIN_MRRU) - return (0); - /* Disallow changes to multi-link configuration while MP is active */ if (priv->numActiveLinks > 0 && newNumLinksActive > 0) { if (!priv->conf.enableMultilink From owner-svn-src-head@FreeBSD.ORG Sun Jan 18 13:04:38 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CAA2A1065672; Sun, 18 Jan 2009 13:04:38 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B8B2A8FC13; Sun, 18 Jan 2009 13:04:38 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0ID4cpi074356; Sun, 18 Jan 2009 13:04:38 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0ID4cYV074355; Sun, 18 Jan 2009 13:04:38 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200901181304.n0ID4cYV074355@svn.freebsd.org> From: Marius Strobl Date: Sun, 18 Jan 2009 13:04:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187394 - head/sys/sun4v/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2009 13:04:39 -0000 Author: marius Date: Sun Jan 18 13:04:38 2009 New Revision: 187394 URL: http://svn.freebsd.org/changeset/base/187394 Log: Adjust the padding of struct pcpu to r187357. Modified: head/sys/sun4v/include/pcpu.h Modified: head/sys/sun4v/include/pcpu.h ============================================================================== --- head/sys/sun4v/include/pcpu.h Sun Jan 18 12:59:37 2009 (r187393) +++ head/sys/sun4v/include/pcpu.h Sun Jan 18 13:04:38 2009 (r187394) @@ -38,6 +38,12 @@ struct pmap; +#ifdef KTR +#define PCPU_MD_FIELDS_PAD (4 - (PCPU_NAME_LEN + 7) / 8) +#else +#define PCPU_MD_FIELDS_PAD 4 +#endif + /* * Inside the kernel, the globally reserved register g7 is used to * point at the globaldata structure. @@ -72,7 +78,7 @@ struct pmap; u_int pc_kwbuf_full; \ struct rwindow pc_tsbwbuf[2]; \ uint16_t pc_cpulist[MAXCPU]; \ - uint64_t pad[4]; + uint64_t pad[PCPU_MD_FIELDS_PAD]; /* XXX SUN4V_FIXME - as we access the *_ra and *_size fields in quick * succession we _really_ want them to be L1 cache line size aligned From owner-svn-src-head@FreeBSD.ORG Sun Jan 18 14:04:57 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C6F51065670; Sun, 18 Jan 2009 14:04:57 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2A4F18FC0A; Sun, 18 Jan 2009 14:04:57 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0IE4vQw075703; Sun, 18 Jan 2009 14:04:57 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0IE4uXw075698; Sun, 18 Jan 2009 14:04:56 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <200901181404.n0IE4uXw075698@svn.freebsd.org> From: Stanislav Sedov Date: Sun, 18 Jan 2009 14:04:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187395 - head/sys/gnu/fs/ext2fs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2009 14:04:57 -0000 Author: stas Date: Sun Jan 18 14:04:56 2009 New Revision: 187395 URL: http://svn.freebsd.org/changeset/base/187395 Log: - Obtain inode sizes and location of the first inode based on the contents of superblock rather than using hardcoded values. This fixes ext2fs on filesystems with inode sized other than 128. Submitted by: Alex Lyashkov (based on) MFC after: 2 weeks Modified: head/sys/gnu/fs/ext2fs/ext2_fs.h head/sys/gnu/fs/ext2fs/ext2_fs_sb.h head/sys/gnu/fs/ext2fs/ext2_inode.c head/sys/gnu/fs/ext2fs/ext2_linux_ialloc.c head/sys/gnu/fs/ext2fs/ext2_vfsops.c Modified: head/sys/gnu/fs/ext2fs/ext2_fs.h ============================================================================== --- head/sys/gnu/fs/ext2fs/ext2_fs.h Sun Jan 18 13:04:38 2009 (r187394) +++ head/sys/gnu/fs/ext2fs/ext2_fs.h Sun Jan 18 14:04:56 2009 (r187395) @@ -150,8 +150,8 @@ #else /* !notyet */ #define EXT2_INODES_PER_BLOCK(s) ((s)->s_inodes_per_block) /* Should be sizeof(struct ext2_inode): */ -#define EXT2_INODE_SIZE 128 -#define EXT2_FIRST_INO 11 +#define EXT2_INODE_SIZE(s) ((s)->s_inode_size) +#define EXT2_FIRST_INO(s) ((s)->s_first_inode) #endif /* notyet */ /* Modified: head/sys/gnu/fs/ext2fs/ext2_fs_sb.h ============================================================================== --- head/sys/gnu/fs/ext2fs/ext2_fs_sb.h Sun Jan 18 13:04:38 2009 (r187394) +++ head/sys/gnu/fs/ext2fs/ext2_fs_sb.h Sun Jan 18 14:04:56 2009 (r187395) @@ -63,6 +63,8 @@ struct ext2_sb_info { unsigned long s_db_per_group; /* Number of descriptor blocks per group */ unsigned long s_desc_per_block; /* Number of group descriptors per block */ unsigned long s_groups_count; /* Number of groups in the fs */ + unsigned long s_first_inode; /* First inode on fs */ + unsigned int s_inode_size; /* Size for inode with extra data */ struct buffer_head * s_sbh; /* Buffer containing the super block */ struct ext2_super_block * s_es; /* Pointer to the super block in the buffer */ struct buffer_head ** s_group_desc; Modified: head/sys/gnu/fs/ext2fs/ext2_inode.c ============================================================================== --- head/sys/gnu/fs/ext2fs/ext2_inode.c Sun Jan 18 13:04:38 2009 (r187394) +++ head/sys/gnu/fs/ext2fs/ext2_inode.c Sun Jan 18 14:04:56 2009 (r187395) @@ -91,7 +91,7 @@ ext2_update(vp, waitfor) return (error); } ext2_i2ei(ip, (struct ext2_inode *)((char *)bp->b_data + - EXT2_INODE_SIZE * ino_to_fsbo(fs, ip->i_number))); + EXT2_INODE_SIZE(fs) * ino_to_fsbo(fs, ip->i_number))); if (waitfor && (vp->v_mount->mnt_kern_flag & MNTK_ASYNC) == 0) return (bwrite(bp)); else { Modified: head/sys/gnu/fs/ext2fs/ext2_linux_ialloc.c ============================================================================== --- head/sys/gnu/fs/ext2fs/ext2_linux_ialloc.c Sun Jan 18 13:04:38 2009 (r187394) +++ head/sys/gnu/fs/ext2fs/ext2_linux_ialloc.c Sun Jan 18 14:04:56 2009 (r187395) @@ -225,7 +225,7 @@ void ext2_free_inode (struct inode * ino sb = inode->i_e2fs; lock_super (DEVVP(inode)); - if (inode->i_number < EXT2_FIRST_INO || + if (inode->i_number < EXT2_FIRST_INO(sb) || inode->i_number > sb->s_es->s_inodes_count) { printf ("free_inode reserved inode or nonexistent inode"); unlock_super (DEVVP(inode)); @@ -435,7 +435,7 @@ repeat: goto repeat; } j += i * EXT2_INODES_PER_GROUP(sb) + 1; - if (j < EXT2_FIRST_INO || j > es->s_inodes_count) { + if (j < EXT2_FIRST_INO(sb) || j > es->s_inodes_count) { printf ( "ext2_new_inode:" "reserved inode or inode > inodes count - " "block_group = %d,inode=%d", i, j); Modified: head/sys/gnu/fs/ext2fs/ext2_vfsops.c ============================================================================== --- head/sys/gnu/fs/ext2fs/ext2_vfsops.c Sun Jan 18 13:04:38 2009 (r187394) +++ head/sys/gnu/fs/ext2fs/ext2_vfsops.c Sun Jan 18 14:04:56 2009 (r187395) @@ -424,7 +424,11 @@ static int compute_sb_data(devvp, es, fs V(s_frags_per_group) fs->s_inodes_per_group = es->s_inodes_per_group; V(s_inodes_per_group) - fs->s_inodes_per_block = fs->s_blocksize / EXT2_INODE_SIZE; + fs->s_inode_size = es->s_inode_size; + V(s_inode_size) + fs->s_first_inode = es->s_first_ino; + V(s_first_inode); + fs->s_inodes_per_block = fs->s_blocksize / EXT2_INODE_SIZE(fs); V(s_inodes_per_block) fs->s_itb_per_group = fs->s_inodes_per_group /fs->s_inodes_per_block; V(s_itb_per_group) @@ -578,7 +582,7 @@ loop: return (error); } ext2_ei2i((struct ext2_inode *) ((char *)bp->b_data + - EXT2_INODE_SIZE * ino_to_fsbo(fs, ip->i_number)), ip); + EXT2_INODE_SIZE(fs) * ino_to_fsbo(fs, ip->i_number)), ip); brelse(bp); VOP_UNLOCK(vp, 0); vrele(vp); @@ -1012,7 +1016,7 @@ printf("ext2_vget(%d) dbn= %d ", ino, fs return (error); } /* convert ext2 inode to dinode */ - ext2_ei2i((struct ext2_inode *) ((char *)bp->b_data + EXT2_INODE_SIZE * + ext2_ei2i((struct ext2_inode *) ((char *)bp->b_data + EXT2_INODE_SIZE(fs) * ino_to_fsbo(fs, ino)), ip); ip->i_block_group = ino_to_cg(fs, ino); ip->i_next_alloc_block = 0; From owner-svn-src-head@FreeBSD.ORG Sun Jan 18 14:06:48 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E79DF1065673; Sun, 18 Jan 2009 14:06:48 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.terabit.net.ua (mail.terabit.net.ua [195.137.202.147]) by mx1.freebsd.org (Postfix) with ESMTP id 7E9898FC14; Sun, 18 Jan 2009 14:06:48 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from skuns.zoral.com.ua ([91.193.166.194] helo=mail.zoral.com.ua) by mail.terabit.net.ua with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63 (FreeBSD)) (envelope-from ) id 1LOYIZ-000MBf-GD; Sun, 18 Jan 2009 16:06:47 +0200 Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id n0IE6inh087721 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 18 Jan 2009 16:06:44 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3) with ESMTP id n0IE6if5086356; Sun, 18 Jan 2009 16:06:44 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id n0IE6igK086355; Sun, 18 Jan 2009 16:06:44 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 18 Jan 2009 16:06:44 +0200 From: Kostik Belousov To: Stanislav Sedov Message-ID: <20090118140644.GT48057@deviant.kiev.zoral.com.ua> References: <200901181404.n0IE4uXw075698@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Ayym4vmyMU9P4uDb" Content-Disposition: inline In-Reply-To: <200901181404.n0IE4uXw075698@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua X-Virus-Scanned: mail.terabit.net.ua 1LOYIZ-000MBf-GD a0a5832a7a3dbbabd32e125895202e50 X-Terabit: YES Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r187395 - head/sys/gnu/fs/ext2fs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2009 14:06:49 -0000 --Ayym4vmyMU9P4uDb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jan 18, 2009 at 02:04:56PM +0000, Stanislav Sedov wrote: > Author: stas > Date: Sun Jan 18 14:04:56 2009 > New Revision: 187395 > URL: http://svn.freebsd.org/changeset/base/187395 >=20 > Log: > - Obtain inode sizes and location of the first inode based on the conte= nts > of superblock rather than using hardcoded values. This fixes ext2fs on > filesystems with inode sized other than 128. > =20 > Submitted by: Alex Lyashkov (based on) > MFC after: 2 weeks >=20 > Modified: > head/sys/gnu/fs/ext2fs/ext2_fs.h > head/sys/gnu/fs/ext2fs/ext2_fs_sb.h > head/sys/gnu/fs/ext2fs/ext2_inode.c > head/sys/gnu/fs/ext2fs/ext2_linux_ialloc.c > head/sys/gnu/fs/ext2fs/ext2_vfsops.c >=20 > Modified: head/sys/gnu/fs/ext2fs/ext2_fs.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/gnu/fs/ext2fs/ext2_fs.h Sun Jan 18 13:04:38 2009 (r187394) > +++ head/sys/gnu/fs/ext2fs/ext2_fs.h Sun Jan 18 14:04:56 2009 (r187395) > @@ -150,8 +150,8 @@ > #else /* !notyet */ > #define EXT2_INODES_PER_BLOCK(s) ((s)->s_inodes_per_block) > /* Should be sizeof(struct ext2_inode): */ > -#define EXT2_INODE_SIZE 128 > -#define EXT2_FIRST_INO 11 > +#define EXT2_INODE_SIZE(s) ((s)->s_inode_size) > +#define EXT2_FIRST_INO(s) ((s)->s_first_inode) > #endif /* notyet */ > =20 > /* >=20 > Modified: head/sys/gnu/fs/ext2fs/ext2_fs_sb.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/gnu/fs/ext2fs/ext2_fs_sb.h Sun Jan 18 13:04:38 2009 (r187394) > +++ head/sys/gnu/fs/ext2fs/ext2_fs_sb.h Sun Jan 18 14:04:56 2009 (r187395) > @@ -63,6 +63,8 @@ struct ext2_sb_info { > unsigned long s_db_per_group; /* Number of descriptor blocks per group = */ > unsigned long s_desc_per_block; /* Number of group descriptors per bloc= k */ > unsigned long s_groups_count; /* Number of groups in the fs */ > + unsigned long s_first_inode; /* First inode on fs */ > + unsigned int s_inode_size; /* Size for inode with extra data */ > struct buffer_head * s_sbh; /* Buffer containing the super block */ > struct ext2_super_block * s_es; /* Pointer to the super block in the bu= ffer */ > struct buffer_head ** s_group_desc; >=20 > Modified: head/sys/gnu/fs/ext2fs/ext2_inode.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/gnu/fs/ext2fs/ext2_inode.c Sun Jan 18 13:04:38 2009 (r187394) > +++ head/sys/gnu/fs/ext2fs/ext2_inode.c Sun Jan 18 14:04:56 2009 (r187395) > @@ -91,7 +91,7 @@ ext2_update(vp, waitfor) > return (error); > } > ext2_i2ei(ip, (struct ext2_inode *)((char *)bp->b_data + > - EXT2_INODE_SIZE * ino_to_fsbo(fs, ip->i_number))); > + EXT2_INODE_SIZE(fs) * ino_to_fsbo(fs, ip->i_number))); > if (waitfor && (vp->v_mount->mnt_kern_flag & MNTK_ASYNC) =3D=3D 0) > return (bwrite(bp)); > else { >=20 > Modified: head/sys/gnu/fs/ext2fs/ext2_linux_ialloc.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/gnu/fs/ext2fs/ext2_linux_ialloc.c Sun Jan 18 13:04:38 2009 (= r187394) > +++ head/sys/gnu/fs/ext2fs/ext2_linux_ialloc.c Sun Jan 18 14:04:56 2009 (= r187395) > @@ -225,7 +225,7 @@ void ext2_free_inode (struct inode * ino > =20 > sb =3D inode->i_e2fs; > lock_super (DEVVP(inode)); > - if (inode->i_number < EXT2_FIRST_INO || > + if (inode->i_number < EXT2_FIRST_INO(sb) || > inode->i_number > sb->s_es->s_inodes_count) { > printf ("free_inode reserved inode or nonexistent inode"); > unlock_super (DEVVP(inode)); > @@ -435,7 +435,7 @@ repeat: > goto repeat; > } > j +=3D i * EXT2_INODES_PER_GROUP(sb) + 1; > - if (j < EXT2_FIRST_INO || j > es->s_inodes_count) { > + if (j < EXT2_FIRST_INO(sb) || j > es->s_inodes_count) { > printf ( "ext2_new_inode:" > "reserved inode or inode > inodes count - " > "block_group =3D %d,inode=3D%d", i, j); >=20 > Modified: head/sys/gnu/fs/ext2fs/ext2_vfsops.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/gnu/fs/ext2fs/ext2_vfsops.c Sun Jan 18 13:04:38 2009 (r18739= 4) > +++ head/sys/gnu/fs/ext2fs/ext2_vfsops.c Sun Jan 18 14:04:56 2009 (r18739= 5) > @@ -424,7 +424,11 @@ static int compute_sb_data(devvp, es, fs > V(s_frags_per_group) > fs->s_inodes_per_group =3D es->s_inodes_per_group; > V(s_inodes_per_group) > - fs->s_inodes_per_block =3D fs->s_blocksize / EXT2_INODE_SIZE; > + fs->s_inode_size =3D es->s_inode_size; > + V(s_inode_size) > + fs->s_first_inode =3D es->s_first_ino; > + V(s_first_inode); > + fs->s_inodes_per_block =3D fs->s_blocksize / EXT2_INODE_SIZE(fs); > V(s_inodes_per_block) > fs->s_itb_per_group =3D fs->s_inodes_per_group /fs->s_inodes_per_blo= ck; > V(s_itb_per_group) > @@ -578,7 +582,7 @@ loop: > return (error); > } > ext2_ei2i((struct ext2_inode *) ((char *)bp->b_data + > - EXT2_INODE_SIZE * ino_to_fsbo(fs, ip->i_number)), ip); > + EXT2_INODE_SIZE(fs) * ino_to_fsbo(fs, ip->i_number)), ip); > brelse(bp); > VOP_UNLOCK(vp, 0); > vrele(vp); > @@ -1012,7 +1016,7 @@ printf("ext2_vget(%d) dbn=3D %d ", ino, fs > return (error); > } > /* convert ext2 inode to dinode */ > - ext2_ei2i((struct ext2_inode *) ((char *)bp->b_data + EXT2_INODE_SIZE * > + ext2_ei2i((struct ext2_inode *) ((char *)bp->b_data + EXT2_INODE_SIZE(f= s) * > ino_to_fsbo(fs, ino)), ip); > ip->i_block_group =3D ino_to_cg(fs, ino); > ip->i_next_alloc_block =3D 0; Please see a discussion on the fs@ and reasoning why I declined to commit the similar patch. --Ayym4vmyMU9P4uDb Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAklzN3MACgkQC3+MBN1Mb4i13QCgy52qspLplFQyfZL/0HY6b4vk 0iQAoIVa2IbBUbjUF5/KFqVSHTQLALDN =Kg6Z -----END PGP SIGNATURE----- --Ayym4vmyMU9P4uDb-- From owner-svn-src-head@FreeBSD.ORG Sun Jan 18 14:44:03 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B6232106566B for ; Sun, 18 Jan 2009 14:44:03 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from mx0.deglitch.com (backbone.deglitch.com [IPv6:2001:16d8:fffb:4::abba]) by mx1.freebsd.org (Postfix) with ESMTP id 5EA678FC20 for ; Sun, 18 Jan 2009 14:44:03 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from DSPAM-Daemon (localhost [127.0.0.1]) by mx0.deglitch.com (Postfix) with SMTP id 5BCAE8FC51 for ; Sun, 18 Jan 2009 17:44:02 +0300 (MSK) Received: from orion.SpringDaemons.com (drsun1.dialup.corbina.ru [85.21.245.235]) by mx0.deglitch.com (Postfix) with ESMTPA id D93FD8FC18; Sun, 18 Jan 2009 17:43:59 +0300 (MSK) Received: from orion (localhost [127.0.0.1]) by orion.SpringDaemons.com (Postfix) with SMTP id CBF4A398F3; Sun, 18 Jan 2009 17:44:02 +0300 (MSK) Date: Sun, 18 Jan 2009 17:43:57 +0300 From: Stanislav Sedov To: Kostik Belousov Message-Id: <20090118174357.3ed1459d.stas@FreeBSD.org> In-Reply-To: <20090118140644.GT48057@deviant.kiev.zoral.com.ua> References: <200901181404.n0IE4uXw075698@svn.freebsd.org> <20090118140644.GT48057@deviant.kiev.zoral.com.ua> Organization: The FreeBSD Project X-XMPP: ssedov@jabber.ru X-Voice: +7 916 849 20 23 X-PGP-Fingerprint: F21E D6CC 5626 9609 6CE2 A385 2BF5 5993 EB26 9581 X-Mailer: carrier-pigeon Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-DSPAM-Result: Whitelisted X-DSPAM-Processed: Sun Jan 18 17:44:02 2009 X-DSPAM-Confidence: 0.9899 X-DSPAM-Improbability: 1 in 9809 chance of being spam X-DSPAM-Probability: 0.0000 X-DSPAM-Signature: 49734032967001169152874 Cc: Stanislav Sedov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r187395 - head/sys/gnu/fs/ext2fs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2009 14:44:04 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sun, 18 Jan 2009 16:06:44 +0200 Kostik Belousov mentioned: > > Please see a discussion on the fs@ and reasoning why I declined to commit > the similar patch. > I'm sorry I've missed that discussion entirely, but I can admit I had all the same concerns while reviewing the patch, and Alex's comments and Linux code reading made me fully confident that the modifications are safe and correct. Let me explain why I think so. The extra size added in inodes are used to store additional info like extended attributes, ACLs and so on. Each inode now has a field just after the legacy inode format struct that shows hom much additional space has been added to this particular inode. By analyzing this field the operating system can interpret additional data located in inode, if it understand its format (there might be application and/or OS specific data too). Our implementation just ignore this additional fields after sizeof(ext2fs_inode), both while reading and writing. Thus we don't interet this data yet we don't overwrite it. - -- Stanislav Sedov ST4096-RIPE -----BEGIN PGP SIGNATURE----- iEYEARECAAYFAklzQDIACgkQK/VZk+smlYE6TQCcCe7yDdJYU2cxYwiosHjYmK6s NT8An0+9Jom3CgHFhVy4PrvztjNXgpT9 =Cxan -----END PGP SIGNATURE----- !DSPAM:49734032967001169152874! From owner-svn-src-head@FreeBSD.ORG Sun Jan 18 14:49:18 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D3291065672; Sun, 18 Jan 2009 14:49:18 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.terabit.net.ua (mail.terabit.net.ua [195.137.202.147]) by mx1.freebsd.org (Postfix) with ESMTP id E27A68FC25; Sun, 18 Jan 2009 14:49:17 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from skuns.zoral.com.ua ([91.193.166.194] helo=mail.zoral.com.ua) by mail.terabit.net.ua with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63 (FreeBSD)) (envelope-from ) id 1LOYxg-000Oru-5c; Sun, 18 Jan 2009 16:49:16 +0200 Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id n0IEnD9S089982 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 18 Jan 2009 16:49:13 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3) with ESMTP id n0IEnD5d088915; Sun, 18 Jan 2009 16:49:13 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id n0IEnDmZ088914; Sun, 18 Jan 2009 16:49:13 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 18 Jan 2009 16:49:13 +0200 From: Kostik Belousov To: Stanislav Sedov Message-ID: <20090118144913.GU48057@deviant.kiev.zoral.com.ua> References: <200901181404.n0IE4uXw075698@svn.freebsd.org> <20090118140644.GT48057@deviant.kiev.zoral.com.ua> <20090118174357.3ed1459d.stas@FreeBSD.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="PhxIMoEr374zxJm2" Content-Disposition: inline In-Reply-To: <20090118174357.3ed1459d.stas@FreeBSD.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua X-Virus-Scanned: mail.terabit.net.ua 1LOYxg-000Oru-5c 9b513c07f8f0f33d16434a4855b12a18 X-Terabit: YES Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r187395 - head/sys/gnu/fs/ext2fs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2009 14:49:18 -0000 --PhxIMoEr374zxJm2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jan 18, 2009 at 05:43:57PM +0300, Stanislav Sedov wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 >=20 > On Sun, 18 Jan 2009 16:06:44 +0200 > Kostik Belousov mentioned: >=20 > >=20 > > Please see a discussion on the fs@ and reasoning why I declined to comm= it > > the similar patch. > >=20 >=20 > I'm sorry I've missed that discussion entirely, but I can admit I had all= the > same concerns while reviewing the patch, and Alex's comments and Linux co= de > reading made me fully confident that the modifications are safe and corre= ct. > Let me explain why I think so. >=20 > The extra size added in inodes are used to store additional info like ext= ended > attributes, ACLs and so on. Each inode now has a field just after the leg= acy > inode format struct that shows hom much additional space has been added to > this particular inode. By analyzing this field the operating system can i= nterpret > additional data located in inode, if it understand its format (there migh= t be > application and/or OS specific data too). >=20 > Our implementation just ignore this additional fields after sizeof(ext2fs= _inode), > both while reading and writing. Thus we don't interet this data yet we do= n't > overwrite it. =20 Then, it is ok if you did read the code and became assured that ignoring the additional inode data is safe. In any case, consider yourself an appointed ext2fs maintainer onward. --PhxIMoEr374zxJm2 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAklzQWgACgkQC3+MBN1Mb4hvgwCeLfZnxjThRBzNLf5IPCOu8AFH HQUAnR4R3/wHWRa4G3KKmwWLFzjCfKxb =lPTr -----END PGP SIGNATURE----- --PhxIMoEr374zxJm2-- From owner-svn-src-head@FreeBSD.ORG Sun Jan 18 14:54:46 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55CD21065675; Sun, 18 Jan 2009 14:54:46 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 435508FC14; Sun, 18 Jan 2009 14:54:46 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0IEskWO077046; Sun, 18 Jan 2009 14:54:46 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0IEskw4077045; Sun, 18 Jan 2009 14:54:46 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <200901181454.n0IEskw4077045@svn.freebsd.org> From: Stanislav Sedov Date: Sun, 18 Jan 2009 14:54:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187396 - head/sys/gnu/fs/ext2fs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2009 14:54:46 -0000 Author: stas Date: Sun Jan 18 14:54:46 2009 New Revision: 187396 URL: http://svn.freebsd.org/changeset/base/187396 Log: - Whitespace fixes. - s_bmask field doesn't exist. - Use correct flags in debug printf. Modified: head/sys/gnu/fs/ext2fs/ext2_vfsops.c Modified: head/sys/gnu/fs/ext2fs/ext2_vfsops.c ============================================================================== --- head/sys/gnu/fs/ext2fs/ext2_vfsops.c Sun Jan 18 14:04:56 2009 (r187395) +++ head/sys/gnu/fs/ext2fs/ext2_vfsops.c Sun Jan 18 14:54:46 2009 (r187396) @@ -5,7 +5,7 @@ * University of Utah, Department of Computer Science */ /*- - * Copyright (c) 1989, 1991, 1993, 1994 + * Copyright (c) 1989, 1991, 1993, 1994 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -120,7 +120,7 @@ static int compute_sb_data(struct vnode static const char *ext2_opts[] = { "from", "export", "acls", "noexec", "noatime", "union", "suiddir", "multilabel", "nosymfollow", "noclusterr", "noclusterw", "force", NULL }; - + /* * VFS Operations. * @@ -318,7 +318,7 @@ static int ext2_check_descriptors (struc { /* examine next descriptor block */ if ((i % EXT2_DESC_PER_BLOCK(sb)) == 0) - gdp = (struct ext2_group_desc *) + gdp = (struct ext2_group_desc *) sb->s_group_desc[desc_block++]->b_data; if (gdp->bg_block_bitmap < block || gdp->bg_block_bitmap >= block + EXT2_BLOCKS_PER_GROUP(sb)) @@ -398,19 +398,19 @@ static int compute_sb_data(devvp, es, fs int logic_sb_block = 1; /* XXX for now */ #if 1 -#define V(v) +#define V(v) #else #define V(v) printf(#v"= %d\n", fs->v); #endif - fs->s_blocksize = EXT2_MIN_BLOCK_SIZE << es->s_log_block_size; + fs->s_blocksize = EXT2_MIN_BLOCK_SIZE << es->s_log_block_size; V(s_blocksize) fs->s_bshift = EXT2_MIN_BLOCK_LOG_SIZE + es->s_log_block_size; V(s_bshift) fs->s_fsbtodb = es->s_log_block_size + 1; V(s_fsbtodb) fs->s_qbmask = fs->s_blocksize - 1; - V(s_bmask) + V(s_qbmask) fs->s_blocksize_bits = EXT2_BLOCK_SIZE_BITS(es); V(s_blocksize_bits) fs->s_frag_size = EXT2_MIN_FRAG_SIZE << es->s_log_frag_size; @@ -449,14 +449,14 @@ static int compute_sb_data(devvp, es, fs M_EXT2MNT, M_WAITOK); /* adjust logic_sb_block */ - if(fs->s_blocksize > SBSIZE) + if(fs->s_blocksize > SBSIZE) /* Godmar thinks: if the blocksize is greater than 1024, then - the superblock is logically part of block zero. + the superblock is logically part of block zero. */ logic_sb_block = 0; - + for (i = 0; i < db_count; i++) { - error = bread(devvp , fsbtodb(fs, logic_sb_block + i + 1), + error = bread(devvp , fsbtodb(fs, logic_sb_block + i + 1), fs->s_blocksize, NOCRED, &fs->s_group_desc[i]); if(error) { for (j = 0; j < i; j++) @@ -667,9 +667,9 @@ ext2_mountfs(devvp, mp) we dynamically allocate both an ext2_sb_info and an ext2_super_block while Linux keeps the super block in a locked buffer */ - ump->um_e2fs = bsd_malloc(sizeof(struct ext2_sb_info), + ump->um_e2fs = bsd_malloc(sizeof(struct ext2_sb_info), M_EXT2MNT, M_WAITOK); - ump->um_e2fs->s_es = bsd_malloc(sizeof(struct ext2_super_block), + ump->um_e2fs->s_es = bsd_malloc(sizeof(struct ext2_super_block), M_EXT2MNT, M_WAITOK); bcopy(es, ump->um_e2fs->s_es, (u_int)sizeof(struct ext2_super_block)); if ((error = compute_sb_data(devvp, ump->um_e2fs->s_es, ump->um_e2fs))) @@ -682,7 +682,7 @@ ext2_mountfs(devvp, mp) bp = NULL; fs = ump->um_e2fs; fs->s_rd_only = ronly; /* ronly is set according to mnt_flags */ - /* if the fs is not mounted read-only, make sure the super block is + /* if the fs is not mounted read-only, make sure the super block is always written back on a sync() */ fs->s_wasvalid = fs->s_es->s_state & EXT2_VALID_FS ? 1 : 0; @@ -708,7 +708,7 @@ ext2_mountfs(devvp, mp) ump->um_nindir = EXT2_ADDR_PER_BLOCK(fs); ump->um_bptrtodb = fs->s_es->s_log_block_size + 1; ump->um_seqinc = EXT2_FRAGS_PER_BLOCK(fs); - if (ronly == 0) + if (ronly == 0) ext2_sbupdate(ump, MNT_WAIT); return (0); out: @@ -761,7 +761,7 @@ ext2_unmount(mp, mntflags, td) } /* release buffers containing group descriptors */ - for(i = 0; i < fs->s_db_per_group; i++) + for(i = 0; i < fs->s_db_per_group; i++) ULCK_BUF(fs->s_group_desc[i]) bsd_free(fs->s_group_desc, M_EXT2MNT); @@ -838,19 +838,19 @@ ext2_statfs(mp, sbp, td) nsb++; } else nsb = fs->s_groups_count; - overhead = es->s_first_data_block + + overhead = es->s_first_data_block + /* Superblocks and block group descriptors: */ nsb * (1 + fs->s_db_per_group) + /* Inode bitmap, block bitmap, and inode table: */ fs->s_groups_count * (1 + 1 + fs->s_itb_per_group); - sbp->f_bsize = EXT2_FRAG_SIZE(fs); + sbp->f_bsize = EXT2_FRAG_SIZE(fs); sbp->f_iosize = EXT2_BLOCK_SIZE(fs); sbp->f_blocks = es->s_blocks_count - overhead; - sbp->f_bfree = es->s_free_blocks_count; - sbp->f_bavail = sbp->f_bfree - es->s_r_blocks_count; - sbp->f_files = es->s_inodes_count; - sbp->f_ffree = es->s_free_inodes_count; + sbp->f_bfree = es->s_free_blocks_count; + sbp->f_bavail = sbp->f_bfree - es->s_r_blocks_count; + sbp->f_files = es->s_inodes_count; + sbp->f_ffree = es->s_free_inodes_count; return (0); } @@ -1000,7 +1000,7 @@ ext2_vget(mp, ino, flags, vpp) /* Read in the disk contents for the inode, copy into the inode. */ #if 0 -printf("ext2_vget(%d) dbn= %d ", ino, fsbtodb(fs, ino_to_fsba(fs, ino))); +printf("ext2_vget(%d) dbn= %lu ", ino, fsbtodb(fs, ino_to_fsba(fs, ino))); #endif if ((error = bread(ump->um_devvp, fsbtodb(fs, ino_to_fsba(fs, ino)), (int)fs->s_blocksize, NOCRED, &bp)) != 0) { @@ -1024,7 +1024,7 @@ printf("ext2_vget(%d) dbn= %d ", ino, fs ip->i_prealloc_count = 0; ip->i_prealloc_block = 0; /* now we want to make sure that block pointers for unused - blocks are zeroed out - ext2_balloc depends on this + blocks are zeroed out - ext2_balloc depends on this although for regular files and directories only */ if(S_ISDIR(ip->i_mode) || S_ISREG(ip->i_mode)) { From owner-svn-src-head@FreeBSD.ORG Sun Jan 18 15:10:47 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 26EA21065676; Sun, 18 Jan 2009 15:10:47 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 14E8A8FC1D; Sun, 18 Jan 2009 15:10:47 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0IFAkrr077404; Sun, 18 Jan 2009 15:10:46 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0IFAkbt077403; Sun, 18 Jan 2009 15:10:46 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <200901181510.n0IFAkbt077403@svn.freebsd.org> From: Stanislav Sedov Date: Sun, 18 Jan 2009 15:10:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187397 - head/sys/gnu/fs/ext2fs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2009 15:10:48 -0000 Author: stas Date: Sun Jan 18 15:10:46 2009 New Revision: 187397 URL: http://svn.freebsd.org/changeset/base/187397 Log: - Eliminate warnings in debug print macros by explicitly converting all field to unsigned long. Modified: head/sys/gnu/fs/ext2fs/ext2_vfsops.c Modified: head/sys/gnu/fs/ext2fs/ext2_vfsops.c ============================================================================== --- head/sys/gnu/fs/ext2fs/ext2_vfsops.c Sun Jan 18 14:54:46 2009 (r187396) +++ head/sys/gnu/fs/ext2fs/ext2_vfsops.c Sun Jan 18 15:10:46 2009 (r187397) @@ -400,7 +400,7 @@ static int compute_sb_data(devvp, es, fs #if 1 #define V(v) #else -#define V(v) printf(#v"= %d\n", fs->v); +#define V(v) printf(#v"= %lu\n", (unsigned long)fs->v); #endif fs->s_blocksize = EXT2_MIN_BLOCK_SIZE << es->s_log_block_size; From owner-svn-src-head@FreeBSD.ORG Sun Jan 18 19:25:36 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8EC1A106564A; Sun, 18 Jan 2009 19:25:36 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7CEA48FC19; Sun, 18 Jan 2009 19:25:36 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0IJPaYQ084313; Sun, 18 Jan 2009 19:25:36 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0IJPaC5084310; Sun, 18 Jan 2009 19:25:36 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200901181925.n0IJPaC5084310@svn.freebsd.org> From: Alexander Motin Date: Sun, 18 Jan 2009 19:25:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187405 - head/sys/netgraph X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2009 19:25:37 -0000 Author: mav Date: Sun Jan 18 19:25:36 2009 New Revision: 187405 URL: http://svn.freebsd.org/changeset/base/187405 Log: Use m_unshare()+m_copyback() instead of m_freem()+m_devget() to keep original mbuf chain headers. It can be less efficient in some cases, but it looks better then mess of copying headers into the nonempty chain. Modified: head/sys/netgraph/ng_deflate.c head/sys/netgraph/ng_mppc.c head/sys/netgraph/ng_pred1.c Modified: head/sys/netgraph/ng_deflate.c ============================================================================== --- head/sys/netgraph/ng_deflate.c Sun Jan 18 19:20:10 2009 (r187404) +++ head/sys/netgraph/ng_deflate.c Sun Jan 18 19:25:36 2009 (r187405) @@ -459,6 +459,13 @@ ng_deflate_compress(node_p node, struct return (ENOMEM); } + /* We must own the mbuf chain exclusively to modify it. */ + m = m_unshare(m, M_DONTWAIT); + if (m == NULL) { + priv->stats.Errors++; + return (ENOMEM); + } + /* Work with contiguous regions of memory. */ m_copydata(m, 0, inlen, (caddr_t)priv->inbuf); outlen = DEFLATE_BUF_SIZE; @@ -497,19 +504,19 @@ ng_deflate_compress(node_p node, struct priv->stats.FramesUncomp++; priv->stats.OutOctets+=inlen; } else { - NG_FREE_M(m); - /* Install header. */ ((u_int16_t *)priv->outbuf)[0] = htons(PROT_COMPD); ((u_int16_t *)priv->outbuf)[1] = htons(priv->seqnum); /* Return packet in an mbuf. */ - *resultp = m_devget((caddr_t)priv->outbuf, outlen, 0, NULL, - NULL); - if (*resultp == NULL) { + m_copyback(m, 0, outlen, (caddr_t)priv->outbuf); + if (m->m_pkthdr.len < outlen) { + m_freem(m); priv->stats.Errors++; return (ENOMEM); - }; + } else if (outlen < m->m_pkthdr.len) + m_adj(m, outlen - m->m_pkthdr.len); + *resultp = m; priv->stats.FramesComp++; priv->stats.OutOctets+=outlen; } @@ -546,6 +553,13 @@ ng_deflate_decompress(node_p node, struc return (ENOMEM); } + /* We must own the mbuf chain exclusively to modify it. */ + m = m_unshare(m, M_DONTWAIT); + if (m == NULL) { + priv->stats.Errors++; + return (ENOMEM); + } + /* Work with contiguous regions of memory. */ m_copydata(m, 0, inlen, (caddr_t)priv->inbuf); @@ -610,25 +624,24 @@ ng_deflate_decompress(node_p node, struc /* Calculate resulting size. */ outlen -= priv->cx.avail_out; - NG_FREE_M(m); - /* Decompress protocol. */ if ((priv->outbuf[1] & 0x01) != 0) { priv->outbuf[0] = 0; /* Return packet in an mbuf. */ - *resultp = m_devget((caddr_t)priv->outbuf, outlen, 0, - NULL, NULL); + m_copyback(m, 0, outlen, (caddr_t)priv->outbuf); } else { outlen--; /* Return packet in an mbuf. */ - *resultp = m_devget((caddr_t)(priv->outbuf + 1), - outlen, 0, NULL, NULL); + m_copyback(m, 0, outlen, (caddr_t)(priv->outbuf + 1)); } - if (*resultp == NULL) { + if (m->m_pkthdr.len < outlen) { + m_freem(m); priv->stats.Errors++; priv->seqnum = 0; return (ENOMEM); - }; + } else if (outlen < m->m_pkthdr.len) + m_adj(m, outlen - m->m_pkthdr.len); + *resultp = m; priv->stats.FramesPlain++; priv->stats.OutOctets+=outlen; Modified: head/sys/netgraph/ng_mppc.c ============================================================================== --- head/sys/netgraph/ng_mppc.c Sun Jan 18 19:20:10 2009 (r187404) +++ head/sys/netgraph/ng_mppc.c Sun Jan 18 19:25:36 2009 (r187405) @@ -470,6 +470,11 @@ ng_mppc_compress(node_p node, struct mbu u_int16_t header; struct mbuf *m = *datap; + /* We must own the mbuf chain exclusively to modify it. */ + m = m_unshare(m, M_DONTWAIT); + if (m == NULL) + return (ENOMEM); + /* Initialize */ header = d->cc; @@ -529,8 +534,12 @@ err1: header |= MPPC_FLAG_RESTART; /* Replace m by the compresed one. */ - m_freem(m); - m = m_devget((caddr_t)outbuf, outlen, 0, NULL, NULL); + m_copyback(m, 0, outlen, (caddr_t)outbuf); + if (m->m_pkthdr.len < outlen) { + m_freem(m); + m = NULL; + } else if (outlen < m->m_pkthdr.len) + m_adj(m, outlen - m->m_pkthdr.len); } d->flushed = (rtn & MPPC_EXPANDED) != 0 || (flags & MPPC_SAVE_HISTORY) == 0; @@ -538,7 +547,7 @@ err1: free(inbuf, M_NETGRAPH_MPPC); free(outbuf, M_NETGRAPH_MPPC); - /* Check m_devget() result. */ + /* Check mbuf chain reload result. */ if (m == NULL) { if (!d->flushed) { MPPC_InitCompressionHistory(d->history); @@ -557,18 +566,6 @@ err1: /* Set header bits */ header |= MPPC_FLAG_ENCRYPTED; - /* We must own the mbuf chain exclusively to modify it. */ - m = m_unshare(m, M_DONTWAIT); - if (m == NULL) { - if (!d->flushed) { -#ifdef NETGRAPH_MPPC_COMPRESSION - MPPC_InitCompressionHistory(d->history); -#endif - d->flushed = 1; - } - return (ENOMEM); - } - /* Update key if it's time */ if ((d->cfg.bits & MPPE_STATELESS) != 0 || (d->cc & MPPE_UPDATE_MASK) == MPPE_UPDATE_FLAG) { @@ -615,6 +612,11 @@ ng_mppc_decompress(node_p node, struct m u_int numLost; struct mbuf *m = *datap; + /* We must own the mbuf chain exclusively to modify it. */ + m = m_unshare(m, M_DONTWAIT); + if (m == NULL) + return (ENOMEM); + /* Pull off header */ if (m->m_pkthdr.len < MPPC_HDRLEN) { m_freem(m); @@ -694,11 +696,6 @@ ng_mppc_decompress(node_p node, struct m d->cfg.startkey, d->key, &d->rc4); } - /* We must own the mbuf chain exclusively to modify it. */ - m = m_unshare(m, M_DONTWAIT); - if (m == NULL) - return (ENOMEM); - /* Decrypt packet */ m1 = m; while (m1 != NULL) { @@ -786,8 +783,12 @@ failed: free(buf, M_NETGRAPH_MPPC); len = decomplen - destCnt; - m_freem(m); - m = m_devget((caddr_t)decompbuf, len, 0, NULL, NULL); + m_copyback(m, 0, len, (caddr_t)decompbuf); + if (m->m_pkthdr.len < len) { + m_freem(m); + m = NULL; + } else if (len < m->m_pkthdr.len) + m_adj(m, len - m->m_pkthdr.len); free(decompbuf, M_NETGRAPH_MPPC); } #endif Modified: head/sys/netgraph/ng_pred1.c ============================================================================== --- head/sys/netgraph/ng_pred1.c Sun Jan 18 19:20:10 2009 (r187404) +++ head/sys/netgraph/ng_pred1.c Sun Jan 18 19:25:36 2009 (r187405) @@ -400,11 +400,16 @@ ng_pred1_compress(node_p node, struct mb return (ENOMEM); } + /* We must own the mbuf chain exclusively to modify it. */ + m = m_unshare(m, M_DONTWAIT); + if (m == NULL) { + priv->stats.Errors++; + return (ENOMEM); + } + /* Work with contiguous regions of memory. */ m_copydata(m, 0, inlen, (caddr_t)(priv->inbuf + 2)); - NG_FREE_M(m); - lenn = htons(inlen & 0x7FFF); /* Compute FCS. */ @@ -437,12 +442,14 @@ ng_pred1_compress(node_p node, struct mb outlen += 2; /* Return packet in an mbuf. */ - *resultp = m_devget((caddr_t)out, outlen, 0, NULL, NULL); - if (*resultp == NULL) { - priv->stats.Errors++; - return (ENOMEM); - }; - + m_copyback(m, 0, outlen, (caddr_t)out); + if (m->m_pkthdr.len < outlen) { + m_freem(m); + priv->stats.Errors++; + return (ENOMEM); + } else if (outlen < m->m_pkthdr.len) + m_adj(m, outlen - m->m_pkthdr.len); + *resultp = m; priv->stats.OutOctets += outlen; return (0); @@ -471,6 +478,13 @@ ng_pred1_decompress(node_p node, struct return (ENOMEM); } + /* We must own the mbuf chain exclusively to modify it. */ + m = m_unshare(m, M_DONTWAIT); + if (m == NULL) { + priv->stats.Errors++; + return (ENOMEM); + } + /* Work with contiguous regions of memory. */ m_copydata(m, 0, inlen, (caddr_t)priv->inbuf); @@ -485,13 +499,12 @@ ng_pred1_decompress(node_p node, struct /* Is data compressed or not really? */ if (cf) { - NG_FREE_M(m); - priv->stats.FramesComp++; len1 = Pred1Decompress(node, priv->inbuf + 2, priv->outbuf, inlen - 4, PRED1_BUF_SIZE); if (len != len1) { /* Error is detected. Send reset request */ + m_freem(m); priv->stats.Errors++; log(LOG_NOTICE, "ng_pred1: Comp length error (%d) " "--> len (%d)\n", len, len1); @@ -510,17 +523,21 @@ ng_pred1_decompress(node_p node, struct fcs = Crc16(fcs, priv->inbuf + inlen - 2, 2); if (fcs != PPP_GOODFCS) { + m_freem(m); priv->stats.Errors++; log(LOG_NOTICE, "ng_pred1: Pred1: Bad CRC-16\n"); return (EIO); } /* Return packet in an mbuf. */ - *resultp = m_devget((caddr_t)priv->outbuf, len, 0, NULL, NULL); - if (*resultp == NULL) { + m_copyback(m, 0, len, (caddr_t)priv->outbuf); + if (m->m_pkthdr.len < len) { + m_freem(m); priv->stats.Errors++; return (ENOMEM); - }; + } else if (len < m->m_pkthdr.len) + m_adj(m, len - m->m_pkthdr.len); + *resultp = m; } else { priv->stats.FramesUncomp++; From owner-svn-src-head@FreeBSD.ORG Sun Jan 18 20:19:55 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C7DE10656F4; Sun, 18 Jan 2009 20:19:55 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8BFD68FC1E; Sun, 18 Jan 2009 20:19:55 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0IKJt8W086223; Sun, 18 Jan 2009 20:19:55 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0IKJtIQ086222; Sun, 18 Jan 2009 20:19:55 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200901182019.n0IKJtIQ086222@svn.freebsd.org> From: Alexander Motin Date: Sun, 18 Jan 2009 20:19:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187409 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2009 20:19:56 -0000 Author: mav Date: Sun Jan 18 20:19:55 2009 New Revision: 187409 URL: http://svn.freebsd.org/changeset/base/187409 Log: Teach m_copyback() to use trailing space of the last mbuf in chain. Modified: head/sys/kern/uipc_mbuf.c Modified: head/sys/kern/uipc_mbuf.c ============================================================================== --- head/sys/kern/uipc_mbuf.c Sun Jan 18 19:56:13 2009 (r187408) +++ head/sys/kern/uipc_mbuf.c Sun Jan 18 20:19:55 2009 (r187409) @@ -1271,6 +1271,10 @@ m_copyback(struct mbuf *m0, int off, int m = m->m_next; } while (len > 0) { + if (m->m_next == NULL && (len > m->m_len - off)) { + m->m_len += min(len - (m->m_len - off), + M_TRAILINGSPACE(m)); + } mlen = min (m->m_len - off, len); bcopy(cp, off + mtod(m, caddr_t), (u_int)mlen); cp += mlen; From owner-svn-src-head@FreeBSD.ORG Sun Jan 18 21:09:34 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE44C1065674; Sun, 18 Jan 2009 21:09:34 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AC7B38FC12; Sun, 18 Jan 2009 21:09:34 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0IL9YYg087256; Sun, 18 Jan 2009 21:09:34 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0IL9YHY087255; Sun, 18 Jan 2009 21:09:34 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200901182109.n0IL9YHY087255@svn.freebsd.org> From: Alexander Motin Date: Sun, 18 Jan 2009 21:09:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187410 - head/sys/netgraph X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2009 21:09:36 -0000 Author: mav Date: Sun Jan 18 21:09:34 2009 New Revision: 187410 URL: http://svn.freebsd.org/changeset/base/187410 Log: If source mbuf chain consists of only one mbuf, use it directly as source buffer to avoid extra copying. Modified: head/sys/netgraph/ng_mppc.c Modified: head/sys/netgraph/ng_mppc.c ============================================================================== --- head/sys/netgraph/ng_mppc.c Sun Jan 18 20:19:55 2009 (r187409) +++ head/sys/netgraph/ng_mppc.c Sun Jan 18 21:09:34 2009 (r187410) @@ -489,22 +489,29 @@ ng_mppc_compress(node_p node, struct mbu if ((d->cfg.bits & MPPC_BIT) != 0) { u_short flags = MPPC_MANDATORY_COMPRESS_FLAGS; u_char *inbuf, *outbuf; - int outlen, inlen; + int outlen, inlen, ina; u_char *source, *dest; u_long sourceCnt, destCnt; int rtn; /* Work with contiguous regions of memory. */ inlen = m->m_pkthdr.len; - inbuf = malloc(inlen, M_NETGRAPH_MPPC, M_NOWAIT); - if (inbuf == NULL) - goto err1; - m_copydata(m, 0, inlen, (caddr_t)inbuf); + if (m->m_next == NULL) { + inbuf = mtod(m, u_char *); + ina = 0; + } else { + inbuf = malloc(inlen, M_NETGRAPH_MPPC, M_NOWAIT); + if (inbuf == NULL) + goto err1; + m_copydata(m, 0, inlen, (caddr_t)inbuf); + ina = 1; + } outlen = MPPC_MAX_BLOWUP(inlen); outbuf = malloc(outlen, M_NETGRAPH_MPPC, M_NOWAIT); if (outbuf == NULL) { - free(inbuf, M_NETGRAPH_MPPC); + if (ina) + free(inbuf, M_NETGRAPH_MPPC); err1: m_freem(m); MPPC_InitCompressionHistory(d->history); @@ -544,7 +551,8 @@ err1: d->flushed = (rtn & MPPC_EXPANDED) != 0 || (flags & MPPC_SAVE_HISTORY) == 0; - free(inbuf, M_NETGRAPH_MPPC); + if (ina) + free(inbuf, M_NETGRAPH_MPPC); free(outbuf, M_NETGRAPH_MPPC); /* Check mbuf chain reload result. */ @@ -731,36 +739,43 @@ failed: /* Decompress packet */ if ((header & MPPC_FLAG_COMPRESSED) != 0) { int flags = MPPC_MANDATORY_DECOMPRESS_FLAGS; - u_char *decompbuf, *source, *dest; + u_char *inbuf, *outbuf; + int inlen, outlen, ina; + u_char *source, *dest; u_long sourceCnt, destCnt; - int decomplen, rtn; - u_char *buf; - int len; + int rtn; /* Copy payload into a contiguous region of memory. */ - len = m->m_pkthdr.len; - buf = malloc(len, M_NETGRAPH_MPPC, M_NOWAIT); - if (buf == NULL) { - m_freem(m); - return (ENOMEM); + inlen = m->m_pkthdr.len; + if (m->m_next == NULL) { + inbuf = mtod(m, u_char *); + ina = 0; + } else { + inbuf = malloc(inlen, M_NETGRAPH_MPPC, M_NOWAIT); + if (inbuf == NULL) { + m_freem(m); + return (ENOMEM); + } + m_copydata(m, 0, inlen, (caddr_t)inbuf); + ina = 1; } - m_copydata(m, 0, len, (caddr_t)buf); /* Allocate a buffer for decompressed data */ - decompbuf = malloc(MPPC_DECOMP_BUFSIZE + MPPC_DECOMP_SAFETY, + outbuf = malloc(MPPC_DECOMP_BUFSIZE + MPPC_DECOMP_SAFETY, M_NETGRAPH_MPPC, M_NOWAIT); - if (decompbuf == NULL) { + if (outbuf == NULL) { m_freem(m); - free(buf, M_NETGRAPH_MPPC); + if (ina) + free(inbuf, M_NETGRAPH_MPPC); return (ENOMEM); } - decomplen = MPPC_DECOMP_BUFSIZE; + outlen = MPPC_DECOMP_BUFSIZE; /* Prepare to decompress */ - source = buf; - sourceCnt = len; - dest = decompbuf; - destCnt = decomplen; + source = inbuf; + sourceCnt = inlen; + dest = outbuf; + destCnt = outlen; if ((header & MPPC_FLAG_RESTART) != 0) flags |= MPPC_RESTART_HISTORY; @@ -774,22 +789,24 @@ failed: || (rtn & MPPC_DECOMP_OK) != MPPC_DECOMP_OK) { log(LOG_ERR, "%s: decomp returned 0x%x", __func__, rtn); - free(buf, M_NETGRAPH_MPPC); - free(decompbuf, M_NETGRAPH_MPPC); + if (ina) + free(inbuf, M_NETGRAPH_MPPC); + free(outbuf, M_NETGRAPH_MPPC); goto failed; } /* Replace compressed data with decompressed data */ - free(buf, M_NETGRAPH_MPPC); - len = decomplen - destCnt; + if (ina) + free(inbuf, M_NETGRAPH_MPPC); + outlen -= destCnt; - m_copyback(m, 0, len, (caddr_t)decompbuf); - if (m->m_pkthdr.len < len) { + m_copyback(m, 0, outlen, (caddr_t)outbuf); + if (m->m_pkthdr.len < outlen) { m_freem(m); m = NULL; - } else if (len < m->m_pkthdr.len) - m_adj(m, len - m->m_pkthdr.len); - free(decompbuf, M_NETGRAPH_MPPC); + } else if (outlen < m->m_pkthdr.len) + m_adj(m, outlen - m->m_pkthdr.len); + free(outbuf, M_NETGRAPH_MPPC); } #endif From owner-svn-src-head@FreeBSD.ORG Sun Jan 18 23:21:04 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 922371065670; Sun, 18 Jan 2009 23:21:04 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 822978FC12; Sun, 18 Jan 2009 23:21:04 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0INL4VM091018; Sun, 18 Jan 2009 23:21:04 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0INL4BI091017; Sun, 18 Jan 2009 23:21:04 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200901182321.n0INL4BI091017@svn.freebsd.org> From: Andrew Thompson Date: Sun, 18 Jan 2009 23:21:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187413 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2009 23:21:05 -0000 Author: thompsa Date: Sun Jan 18 23:21:04 2009 New Revision: 187413 URL: http://svn.freebsd.org/changeset/base/187413 Log: Also strip the machine arch from SRCDIR in case it is a cross build so svnversion works. Modified: head/sys/conf/newvers.sh Modified: head/sys/conf/newvers.sh ============================================================================== --- head/sys/conf/newvers.sh Sun Jan 18 21:52:01 2009 (r187412) +++ head/sys/conf/newvers.sh Sun Jan 18 23:21:04 2009 (r187413) @@ -91,6 +91,7 @@ for dir in /bin /usr/bin /usr/local/bin; if [ -x "${dir}/svnversion" ]; then svnversion=${dir}/svnversion SRCDIR=${d##*obj} + SRCDIR=${SRCDIR##/$MACHINE} SRCDIR=${SRCDIR%%/sys/*} break fi From owner-svn-src-head@FreeBSD.ORG Mon Jan 19 02:31:28 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C72D1065675; Mon, 19 Jan 2009 02:31:28 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3BA0E8FC17; Mon, 19 Jan 2009 02:31:28 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0J2VSha095242; Mon, 19 Jan 2009 02:31:28 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0J2VSbo095240; Mon, 19 Jan 2009 02:31:28 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200901190231.n0J2VSbo095240@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 19 Jan 2009 02:31:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187417 - in head/sys: dev/re pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jan 2009 02:31:28 -0000 Author: yongari Date: Mon Jan 19 02:31:27 2009 New Revision: 187417 URL: http://svn.freebsd.org/changeset/base/187417 Log: Sometimes RTL8168B seems to take long time to access GMII registers in device attach phase. Double GMII register access timeout value to fix the issue. Reported by: wkoszek Tested by: wkoszek Modified: head/sys/dev/re/if_re.c head/sys/pci/if_rlreg.h Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Mon Jan 19 01:03:42 2009 (r187416) +++ head/sys/dev/re/if_re.c Mon Jan 19 02:31:27 2009 (r187417) @@ -418,14 +418,14 @@ re_gmii_readreg(device_t dev, int phy, i CSR_WRITE_4(sc, RL_PHYAR, reg << 16); - for (i = 0; i < RL_TIMEOUT; i++) { + for (i = 0; i < RL_PHY_TIMEOUT; i++) { rval = CSR_READ_4(sc, RL_PHYAR); if (rval & RL_PHYAR_BUSY) break; DELAY(100); } - if (i == RL_TIMEOUT) { + if (i == RL_PHY_TIMEOUT) { device_printf(sc->rl_dev, "PHY read failed\n"); return (0); } @@ -445,14 +445,14 @@ re_gmii_writereg(device_t dev, int phy, CSR_WRITE_4(sc, RL_PHYAR, (reg << 16) | (data & RL_PHYAR_PHYDATA) | RL_PHYAR_BUSY); - for (i = 0; i < RL_TIMEOUT; i++) { + for (i = 0; i < RL_PHY_TIMEOUT; i++) { rval = CSR_READ_4(sc, RL_PHYAR); if (!(rval & RL_PHYAR_BUSY)) break; DELAY(100); } - if (i == RL_TIMEOUT) { + if (i == RL_PHY_TIMEOUT) { device_printf(sc->rl_dev, "PHY write failed\n"); return (0); } Modified: head/sys/pci/if_rlreg.h ============================================================================== --- head/sys/pci/if_rlreg.h Mon Jan 19 01:03:42 2009 (r187416) +++ head/sys/pci/if_rlreg.h Mon Jan 19 02:31:27 2009 (r187417) @@ -937,6 +937,7 @@ struct rl_softc { CSR_WRITE_4(sc, offset, CSR_READ_4(sc, offset) & ~(val)) #define RL_TIMEOUT 1000 +#define RL_PHY_TIMEOUT 2000 /* * General constants that are fun to know. From owner-svn-src-head@FreeBSD.ORG Mon Jan 19 06:19:39 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4141C1065677; Mon, 19 Jan 2009 06:19:39 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 244378FC17; Mon, 19 Jan 2009 06:19:39 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0J6Jd0F099943; Mon, 19 Jan 2009 06:19:39 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0J6Jcad099941; Mon, 19 Jan 2009 06:19:38 GMT (envelope-from das@svn.freebsd.org) Message-Id: <200901190619.n0J6Jcad099941@svn.freebsd.org> From: David Schultz Date: Mon, 19 Jan 2009 06:19:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187421 - head/lib/libc/stdio X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jan 2009 06:19:39 -0000 Author: das Date: Mon Jan 19 06:19:38 2009 New Revision: 187421 URL: http://svn.freebsd.org/changeset/base/187421 Log: Add support for multibyte decimal_point encodings, e.g., U+066B. Modified: head/lib/libc/stdio/vfprintf.c head/lib/libc/stdio/vfwprintf.c Modified: head/lib/libc/stdio/vfprintf.c ============================================================================== --- head/lib/libc/stdio/vfprintf.c Mon Jan 19 05:20:52 2009 (r187420) +++ head/lib/libc/stdio/vfprintf.c Mon Jan 19 06:19:38 2009 (r187421) @@ -251,6 +251,7 @@ __vfprintf(FILE *fp, const char *fmt0, v * F: at least two digits for decimal, at least one digit for hex */ char *decimal_point; /* locale specific decimal point */ + int decpt_len; /* length of decimal_point */ int signflag; /* true if float is negative */ union { /* floating point arguments %[aAeEfFgG] */ double dbl; @@ -389,6 +390,8 @@ __vfprintf(FILE *fp, const char *fmt0, v #ifndef NO_FLOATING_POINT dtoaresult = NULL; decimal_point = localeconv()->decimal_point; + /* The overwhelmingly common case is decpt_len == 1. */ + decpt_len = (decimal_point[1] == '\0' ? 1 : strlen(decimal_point)); #endif /* @@ -672,7 +675,7 @@ fp_common: expsize = exponent(expstr, expt - 1, expchar); size = expsize + prec; if (prec > 1 || flags & ALT) - ++size; + size += decpt_len; } else { /* space for digits before decimal point */ if (expt > 0) @@ -681,7 +684,7 @@ fp_common: size = 1; /* space for decimal pt and following digits */ if (prec || flags & ALT) - size += prec + 1; + size += prec + decpt_len; if (grouping && expt > 0) { /* space for thousands' grouping */ nseps = nrepeats = 0; @@ -920,7 +923,7 @@ number: if ((dprec = prec) >= 0) if (expt <= 0) { PRINT(zeroes, 1); if (prec || flags & ALT) - PRINT(decimal_point, 1); + PRINT(decimal_point,decpt_len); PAD(-expt, zeroes); /* already handled initial 0's */ prec += expt; @@ -945,14 +948,13 @@ number: if ((dprec = prec) >= 0) cp = dtoaend; } if (prec || flags & ALT) - PRINT(decimal_point,1); + PRINT(decimal_point,decpt_len); } PRINTANDPAD(cp, dtoaend, prec, zeroes); } else { /* %[eE] or sufficiently long %[gG] */ if (prec > 1 || flags & ALT) { - buf[0] = *cp++; - buf[1] = *decimal_point; - PRINT(buf, 2); + PRINT(cp++, 1); + PRINT(decimal_point, decpt_len); PRINT(cp, ndig-1); PAD(prec - ndig, zeroes); } else /* XeYYY */ Modified: head/lib/libc/stdio/vfwprintf.c ============================================================================== --- head/lib/libc/stdio/vfwprintf.c Mon Jan 19 05:20:52 2009 (r187420) +++ head/lib/libc/stdio/vfwprintf.c Mon Jan 19 06:19:38 2009 (r187421) @@ -74,6 +74,22 @@ static wchar_t *__mbsconv(char *, int); #define CHAR wchar_t #include "printfcommon.h" +static const mbstate_t initial_mbs; + +static inline wchar_t +get_decpt(void) +{ + mbstate_t mbs; + wchar_t decpt; + int nconv; + + mbs = initial_mbs; + nconv = mbrtowc(&decpt, localeconv()->decimal_point, MB_CUR_MAX, &mbs); + if (nconv == (size_t)-1 || nconv == (size_t)-2) + decpt = '.'; /* failsafe */ + return (decpt); +} + /* * Flush out all the vectors defined by the given uio, * then reset it so that it can be reused. @@ -147,7 +163,6 @@ __sbprintf(FILE *fp, const wchar_t *fmt, static wint_t __xfputwc(wchar_t wc, FILE *fp) { - static const mbstate_t initial; mbstate_t mbs; char buf[MB_LEN_MAX]; struct __suio uio; @@ -157,7 +172,7 @@ __xfputwc(wchar_t wc, FILE *fp) if ((fp->_flags & __SSTR) == 0) return (__fputwc(wc, fp)); - mbs = initial; + mbs = initial_mbs; if ((len = wcrtomb(buf, wc, &mbs)) == (size_t)-1) { fp->_flags |= __SERR; return (WEOF); @@ -179,7 +194,6 @@ __xfputwc(wchar_t wc, FILE *fp) static wchar_t * __mbsconv(char *mbsarg, int prec) { - static const mbstate_t initial; mbstate_t mbs; wchar_t *convbuf, *wcp; const char *p; @@ -199,7 +213,7 @@ __mbsconv(char *mbsarg, int prec) */ p = mbsarg; insize = nchars = 0; - mbs = initial; + mbs = initial_mbs; while (nchars != (size_t)prec) { nconv = mbrlen(p, MB_CUR_MAX, &mbs); if (nconv == 0 || nconv == (size_t)-1 || @@ -226,7 +240,7 @@ __mbsconv(char *mbsarg, int prec) return (NULL); wcp = convbuf; p = mbsarg; - mbs = initial; + mbs = initial_mbs; while (insize != 0) { nconv = mbrtowc(wcp, p, insize, &mbs); if (nconv == 0 || nconv == (size_t)-1 || nconv == (size_t)-2) @@ -305,7 +319,7 @@ __vfwprintf(FILE *fp, const wchar_t *fmt * D: expchar holds this character; '\0' if no exponent, e.g. %f * F: at least two digits for decimal, at least one digit for hex */ - char *decimal_point; /* locale specific decimal point */ + wchar_t decimal_point; /* locale specific decimal point */ int signflag; /* true if float is negative */ union { /* floating point arguments %[aAeEfFgG] */ double dbl; @@ -438,7 +452,7 @@ __vfwprintf(FILE *fp, const wchar_t *fmt io_init(&io, fp); ret = 0; #ifndef NO_FLOATING_POINT - decimal_point = localeconv()->decimal_point; + decimal_point = get_decpt(); #endif /* @@ -965,10 +979,8 @@ number: if ((dprec = prec) >= 0) if (!expchar) { /* %[fF] or sufficiently short %[gG] */ if (expt <= 0) { PRINT(zeroes, 1); - if (prec || flags & ALT) { - buf[0] = *decimal_point; - PRINT(buf, 1); - } + if (prec || flags & ALT) + PRINT(&decimal_point, 1); PAD(-expt, zeroes); /* already handled initial 0's */ prec += expt; @@ -993,16 +1005,14 @@ number: if ((dprec = prec) >= 0) if (cp > convbuf + ndig) cp = convbuf + ndig; } - if (prec || flags & ALT) { - buf[0] = *decimal_point; - PRINT(buf, 1); - } + if (prec || flags & ALT) + PRINT(&decimal_point, 1); } PRINTANDPAD(cp, convbuf + ndig, prec, zeroes); } else { /* %[eE] or sufficiently long %[gG] */ if (prec > 1 || flags & ALT) { buf[0] = *cp++; - buf[1] = *decimal_point; + buf[1] = decimal_point; PRINT(buf, 2); PRINT(cp, ndig-1); PAD(prec - ndig, zeroes); From owner-svn-src-head@FreeBSD.ORG Mon Jan 19 06:19:51 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C71B9106564A; Mon, 19 Jan 2009 06:19:51 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B57A28FC13; Mon, 19 Jan 2009 06:19:51 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0J6JpRK099983; Mon, 19 Jan 2009 06:19:51 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0J6JpDQ099981; Mon, 19 Jan 2009 06:19:51 GMT (envelope-from das@svn.freebsd.org) Message-Id: <200901190619.n0J6JpDQ099981@svn.freebsd.org> From: David Schultz Date: Mon, 19 Jan 2009 06:19:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187422 - head/lib/libc/stdio X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jan 2009 06:19:52 -0000 Author: das Date: Mon Jan 19 06:19:51 2009 New Revision: 187422 URL: http://svn.freebsd.org/changeset/base/187422 Log: - Add support for multibyte decimal_point encodings, e.g., U+066B. A forthcoming gdtoa import is needed to make this fully work. - Improve the way "nan(...)" is parsed. Modified: head/lib/libc/stdio/vfscanf.c head/lib/libc/stdio/vfwscanf.c Modified: head/lib/libc/stdio/vfscanf.c ============================================================================== --- head/lib/libc/stdio/vfscanf.c Mon Jan 19 06:19:38 2009 (r187421) +++ head/lib/libc/stdio/vfscanf.c Mon Jan 19 06:19:51 2009 (r187422) @@ -911,13 +911,13 @@ static int parsefloat(FILE *fp, char *buf, char *end) { char *commit, *p; - int infnanpos = 0; + int infnanpos = 0, decptpos = 0; enum { - S_START, S_GOTSIGN, S_INF, S_NAN, S_MAYBEHEX, - S_DIGITS, S_FRAC, S_EXP, S_EXPDIGITS + S_START, S_GOTSIGN, S_INF, S_NAN, S_DONE, S_MAYBEHEX, + S_DIGITS, S_DECPT, S_FRAC, S_EXP, S_EXPDIGITS } state = S_START; unsigned char c; - char decpt = *localeconv()->decimal_point; + const char *decpt = localeconv()->decimal_point; _Bool gotmantdig = 0, ishex = 0; /* @@ -970,8 +970,6 @@ reswitch: break; case S_NAN: switch (infnanpos) { - case -1: /* XXX kludge to deal with nan(...) */ - goto parsedone; case 0: if (c != 'A' && c != 'a') goto parsedone; @@ -989,13 +987,15 @@ reswitch: default: if (c == ')') { commit = p; - infnanpos = -2; + state = S_DONE; } else if (!isalnum(c) && c != '_') goto parsedone; break; } infnanpos++; break; + case S_DONE: + goto parsedone; case S_MAYBEHEX: state = S_DIGITS; if (c == 'X' || c == 'x') { @@ -1006,16 +1006,34 @@ reswitch: goto reswitch; } case S_DIGITS: - if ((ishex && isxdigit(c)) || isdigit(c)) + if ((ishex && isxdigit(c)) || isdigit(c)) { gotmantdig = 1; - else { + commit = p; + break; + } else { + state = S_DECPT; + goto reswitch; + } + case S_DECPT: + if (c == decpt[decptpos]) { + if (decpt[++decptpos] == '\0') { + /* We read the complete decpt seq. */ + state = S_FRAC; + if (gotmantdig) + commit = p; + } + break; + } else if (!decptpos) { + /* We didn't read any decpt characters. */ state = S_FRAC; - if (c != decpt) - goto reswitch; + goto reswitch; + } else { + /* + * We read part of a multibyte decimal point, + * but the rest is invalid, so bail. + */ + goto parsedone; } - if (gotmantdig) - commit = p; - break; case S_FRAC: if (((c == 'E' || c == 'e') && !ishex) || ((c == 'P' || c == 'p') && ishex)) { Modified: head/lib/libc/stdio/vfwscanf.c ============================================================================== --- head/lib/libc/stdio/vfwscanf.c Mon Jan 19 06:19:38 2009 (r187421) +++ head/lib/libc/stdio/vfwscanf.c Mon Jan 19 06:19:51 2009 (r187422) @@ -103,6 +103,8 @@ static int parsefloat(FILE *, wchar_t *, (cclcompl ? (wmemchr(ccls, (_c), ccle - ccls) == NULL) : \ (wmemchr(ccls, (_c), ccle - ccls) != NULL)) +static const mbstate_t initial_mbs; + /* * MT-safe version. */ @@ -142,7 +144,6 @@ __vfwscanf(FILE * __restrict fp, const w char *mbp; /* multibyte string pointer for %c %s %[ */ size_t nconv; /* number of bytes in mb. conversion */ char mbbuf[MB_LEN_MAX]; /* temporary mb. character buffer */ - static const mbstate_t initial; mbstate_t mbs; /* `basefix' is used to avoid `if' tests in the integer scanner */ @@ -375,7 +376,7 @@ literal: if (!(flags & SUPPRESS)) mbp = va_arg(ap, char *); n = 0; - mbs = initial; + mbs = initial_mbs; while (width != 0 && (wi = __fgetwc(fp)) != WEOF) { if (width >= MB_CUR_MAX && @@ -440,7 +441,7 @@ literal: if (!(flags & SUPPRESS)) mbp = va_arg(ap, char *); n = 0; - mbs = initial; + mbs = initial_mbs; while ((wi = __fgetwc(fp)) != WEOF && width != 0 && INCCL(wi)) { if (width >= MB_CUR_MAX && @@ -501,7 +502,7 @@ literal: } else { if (!(flags & SUPPRESS)) mbp = va_arg(ap, char *); - mbs = initial; + mbs = initial_mbs; while ((wi = __fgetwc(fp)) != WEOF && width != 0 && !iswspace(wi)) { @@ -721,16 +722,23 @@ match_failure: static int parsefloat(FILE *fp, wchar_t *buf, wchar_t *end) { + mbstate_t mbs; + size_t nconv; wchar_t *commit, *p; int infnanpos = 0; enum { - S_START, S_GOTSIGN, S_INF, S_NAN, S_MAYBEHEX, + S_START, S_GOTSIGN, S_INF, S_NAN, S_DONE, S_MAYBEHEX, S_DIGITS, S_FRAC, S_EXP, S_EXPDIGITS } state = S_START; wchar_t c; - wchar_t decpt = (wchar_t)(unsigned char)*localeconv()->decimal_point; + wchar_t decpt; _Bool gotmantdig = 0, ishex = 0; + mbs = initial_mbs; + nconv = mbrtowc(&decpt, localeconv()->decimal_point, MB_CUR_MAX, &mbs); + if (nconv == (size_t)-1 || nconv == (size_t)-2) + decpt = '.'; /* failsafe */ + /* * We set commit = p whenever the string we have read so far * constitutes a valid representation of a floating point @@ -783,8 +791,6 @@ reswitch: break; case S_NAN: switch (infnanpos) { - case -1: /* XXX kludge to deal with nan(...) */ - goto parsedone; case 0: if (c != 'A' && c != 'a') goto parsedone; @@ -802,13 +808,15 @@ reswitch: default: if (c == ')') { commit = p; - infnanpos = -2; + state = S_DONE; } else if (!iswalnum(c) && c != '_') goto parsedone; break; } infnanpos++; break; + case S_DONE: + goto parsedone; case S_MAYBEHEX: state = S_DIGITS; if (c == 'X' || c == 'x') { From owner-svn-src-head@FreeBSD.ORG Mon Jan 19 07:10:12 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 42E4B106564A; Mon, 19 Jan 2009 07:10:12 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 31B078FC23; Mon, 19 Jan 2009 07:10:12 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0J7ACaS001386; Mon, 19 Jan 2009 07:10:12 GMT (envelope-from sobomax@svn.freebsd.org) Received: (from sobomax@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0J7ACSg001385; Mon, 19 Jan 2009 07:10:12 GMT (envelope-from sobomax@svn.freebsd.org) Message-Id: <200901190710.n0J7ACSg001385@svn.freebsd.org> From: Maxim Sobolev Date: Mon, 19 Jan 2009 07:10:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187426 - head/sys/amd64/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jan 2009 07:10:13 -0000 Author: sobomax Date: Mon Jan 19 07:10:11 2009 New Revision: 187426 URL: http://svn.freebsd.org/changeset/base/187426 Log: Add asr(4) and stge(4) from i386 GENERIC. Both drivers compile on amd64 and there is no particular reason for them to be i386-only. MFC after: 2 weeks Modified: head/sys/amd64/conf/GENERIC Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Mon Jan 19 06:55:29 2009 (r187425) +++ head/sys/amd64/conf/GENERIC Mon Jan 19 07:10:11 2009 (r187426) @@ -138,6 +138,7 @@ device ses # SCSI Environmental Servic # RAID controllers interfaced to the SCSI subsystem device amr # AMI MegaRAID device arcmsr # Areca SATA II RAID +device asr # DPT SmartRAID V, VI and Adaptec SCSI RAID device ciss # Compaq Smart RAID 5* device dpt # DPT Smartcache III, IV - See NOTES for options device hptmv # Highpoint RocketRAID 182x @@ -230,6 +231,7 @@ device sf # Adaptec AIC-6915 (``Starfi device sis # Silicon Integrated Systems SiS 900/SiS 7016 device sk # SysKonnect SK-984x & SK-982x gigabit Ethernet device ste # Sundance ST201 (D-Link DFE-550TX) +device stge # Sundance/Tamarack TC9021 gigabit Ethernet device tl # Texas Instruments ThunderLAN device tx # SMC EtherPower II (83c170 ``EPIC'') device vge # VIA VT612x gigabit Ethernet From owner-svn-src-head@FreeBSD.ORG Mon Jan 19 07:18:33 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0EA7E1065690; Mon, 19 Jan 2009 07:18:33 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F1B308FC12; Mon, 19 Jan 2009 07:18:32 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0J7IWh8001591; Mon, 19 Jan 2009 07:18:32 GMT (envelope-from sobomax@svn.freebsd.org) Received: (from sobomax@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0J7IWeX001590; Mon, 19 Jan 2009 07:18:32 GMT (envelope-from sobomax@svn.freebsd.org) Message-Id: <200901190718.n0J7IWeX001590@svn.freebsd.org> From: Maxim Sobolev Date: Mon, 19 Jan 2009 07:18:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187427 - head/sys/amd64/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jan 2009 07:18:33 -0000 Author: sobomax Date: Mon Jan 19 07:18:32 2009 New Revision: 187427 URL: http://svn.freebsd.org/changeset/base/187427 Log: Whitespace-only: reduce diff to the i386 GENERIC. Modified: head/sys/amd64/conf/GENERIC Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Mon Jan 19 07:10:11 2009 (r187426) +++ head/sys/amd64/conf/GENERIC Mon Jan 19 07:18:32 2009 (r187427) @@ -28,7 +28,7 @@ ident GENERIC # through getenv() (or kenv(1) in userland). The format of the file # is 'variable=value', see kenv(1) # -# env "GENERIC.env" +# env "GENERIC.env" makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols @@ -69,8 +69,8 @@ options SYSVSEM # SYSV-style semaphor options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions options KBD_INSTALL_CDEV # install a CDEV entry in /dev options STOP_NMI # Stop CPUS using NMI instead of IPI +options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) options AUDIT # Security event auditing -options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) #options KDTRACE_FRAME # Ensure frames are compiled in #options KDTRACE_HOOKS # Kernel DTrace hooks @@ -251,8 +251,8 @@ device xe # Xircom pccard Ethernet # Wireless NIC cards device wlan # 802.11 support -options IEEE80211_DEBUG # enable debug msgs -options IEEE80211_AMPDU_AGE # age frames in AMPDU reorder q's +options IEEE80211_DEBUG # enable debug msgs +options IEEE80211_AMPDU_AGE # age frames in AMPDU reorder q's device wlan_wep # 802.11 WEP support device wlan_ccmp # 802.11 CCMP support device wlan_tkip # 802.11 TKIP support From owner-svn-src-head@FreeBSD.ORG Mon Jan 19 07:58:29 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9A401065670; Mon, 19 Jan 2009 07:58:29 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.freebsd.org (Postfix) with ESMTP id 6D0F58FC24; Mon, 19 Jan 2009 07:58:29 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from phobos.local (pooker.samsco.org [168.103.85.57]) by pooker.samsco.org (8.14.2/8.14.2) with ESMTP id n0J7wP47036336; Mon, 19 Jan 2009 00:58:25 -0700 (MST) (envelope-from scottl@samsco.org) Message-ID: <497432A1.9060805@samsco.org> Date: Mon, 19 Jan 2009 00:58:25 -0700 From: Scott Long User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.13) Gecko/20080313 SeaMonkey/1.1.9 MIME-Version: 1.0 To: Maxim Sobolev References: <200901190710.n0J7ACSg001385@svn.freebsd.org> In-Reply-To: <200901190710.n0J7ACSg001385@svn.freebsd.org> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=3.8 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.1.8 X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on pooker.samsco.org Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r187426 - head/sys/amd64/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jan 2009 07:58:30 -0000 Maxim Sobolev wrote: > Author: sobomax > Date: Mon Jan 19 07:10:11 2009 > New Revision: 187426 > URL: http://svn.freebsd.org/changeset/base/187426 > > Log: > Add asr(4) and stge(4) from i386 GENERIC. Both drivers compile on amd64 and > there is no particular reason for them to be i386-only. Yes, there is a particular reason why asr is i386 only. This has been discussed extensively over the years, but to sum it up, no it is not 64-bit clean. Please remove. At this point in the lifecycle of amd64, you can be 100% assured that the list of compatible devices has been checked and rechecked a few dozen times. You are not going to find hidden gems that people have forgotten about. If you think you've found something, ask first, and prepare to be wrong. And above all else, don't put drivers into here that you haven't tested. It's pretty silly to admit in your commit message, for all to see, that you are blatantly committing without testing. Scott From owner-svn-src-head@FreeBSD.ORG Mon Jan 19 08:17:32 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 870BA106564A; Mon, 19 Jan 2009 08:17:32 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from sippysoft.com (gk1.360sip.com [72.236.70.240]) by mx1.freebsd.org (Postfix) with ESMTP id 4F7F58FC0A; Mon, 19 Jan 2009 08:17:32 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from [192.168.1.38] (S0106001372fd1e07.vs.shawcable.net [70.71.171.106]) (authenticated bits=0) by sippysoft.com (8.13.8/8.13.8) with ESMTP id n0J8HUsv086706 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 19 Jan 2009 00:17:31 -0800 (PST) (envelope-from sobomax@FreeBSD.org) Message-ID: <49743712.7030103@FreeBSD.org> Date: Mon, 19 Jan 2009 00:17:22 -0800 From: Maxim Sobolev Organization: Sippy Software, Inc. User-Agent: Thunderbird 2.0.0.19 (Windows/20081209) MIME-Version: 1.0 To: Scott Long References: <200901190710.n0J7ACSg001385@svn.freebsd.org> <497432A1.9060805@samsco.org> In-Reply-To: <497432A1.9060805@samsco.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r187426 - head/sys/amd64/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jan 2009 08:17:33 -0000 Scott Long wrote: > Maxim Sobolev wrote: >> Author: sobomax >> Date: Mon Jan 19 07:10:11 2009 >> New Revision: 187426 >> URL: http://svn.freebsd.org/changeset/base/187426 >> >> Log: >> Add asr(4) and stge(4) from i386 GENERIC. Both drivers compile on >> amd64 and >> there is no particular reason for them to be i386-only. > > Yes, there is a particular reason why asr is i386 only. This has been > discussed extensively over the years, but to sum it up, no it is not > 64-bit clean. Please remove. > > At this point in the lifecycle of amd64, you can be 100% assured that > the list of compatible devices has been checked and rechecked a few > dozen times. You are not going to find hidden gems that people have > forgotten about. If you think you've found something, ask first, and > prepare to be wrong. And above all else, don't put drivers into here > that you haven't tested. It's pretty silly to admit in your commit > message, for all to see, that you are blatantly committing without > testing. Point taken, thanks. Is there any technical reason why stge(4) not in there? -Maxim From owner-svn-src-head@FreeBSD.ORG Mon Jan 19 08:25:41 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 88243106566B; Mon, 19 Jan 2009 08:25:41 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 770978FC12; Mon, 19 Jan 2009 08:25:41 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0J8Pf9l003272; Mon, 19 Jan 2009 08:25:41 GMT (envelope-from sobomax@svn.freebsd.org) Received: (from sobomax@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0J8Pfq6003271; Mon, 19 Jan 2009 08:25:41 GMT (envelope-from sobomax@svn.freebsd.org) Message-Id: <200901190825.n0J8Pfq6003271@svn.freebsd.org> From: Maxim Sobolev Date: Mon, 19 Jan 2009 08:25:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187429 - head/sys/amd64/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jan 2009 08:25:42 -0000 Author: sobomax Date: Mon Jan 19 08:25:41 2009 New Revision: 187429 URL: http://svn.freebsd.org/changeset/base/187429 Log: Comment amr(4) out - according to scottl it's not 64-bit clean. Modified: head/sys/amd64/conf/GENERIC Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Mon Jan 19 07:44:18 2009 (r187428) +++ head/sys/amd64/conf/GENERIC Mon Jan 19 08:25:41 2009 (r187429) @@ -136,7 +136,8 @@ device pass # Passthrough device (dire device ses # SCSI Environmental Services (and SAF-TE) # RAID controllers interfaced to the SCSI subsystem -device amr # AMI MegaRAID +#XXX it is not 64-bit clean, -scottl +#device amr # AMI MegaRAID device arcmsr # Areca SATA II RAID device asr # DPT SmartRAID V, VI and Adaptec SCSI RAID device ciss # Compaq Smart RAID 5* From owner-svn-src-head@FreeBSD.ORG Mon Jan 19 08:44:35 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B2661065696; Mon, 19 Jan 2009 08:44:35 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.freebsd.org (Postfix) with ESMTP id 1D04B8FC20; Mon, 19 Jan 2009 08:44:34 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from phobos.local (pooker.samsco.org [168.103.85.57]) by pooker.samsco.org (8.14.2/8.14.2) with ESMTP id n0J8iVvE036542; Mon, 19 Jan 2009 01:44:32 -0700 (MST) (envelope-from scottl@samsco.org) Message-ID: <49743D6F.3040307@samsco.org> Date: Mon, 19 Jan 2009 01:44:31 -0700 From: Scott Long User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.13) Gecko/20080313 SeaMonkey/1.1.9 MIME-Version: 1.0 To: Maxim Sobolev References: <200901190825.n0J8Pfq6003271@svn.freebsd.org> In-Reply-To: <200901190825.n0J8Pfq6003271@svn.freebsd.org> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.5 required=3.8 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.8 X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on pooker.samsco.org Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r187429 - head/sys/amd64/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jan 2009 08:44:36 -0000 Maxim Sobolev wrote: > Author: sobomax > Date: Mon Jan 19 08:25:41 2009 > New Revision: 187429 > URL: http://svn.freebsd.org/changeset/base/187429 > > Log: > Comment amr(4) out - according to scottl it's not 64-bit clean. > > Modified: > head/sys/amd64/conf/GENERIC > > Modified: head/sys/amd64/conf/GENERIC > ============================================================================== > --- head/sys/amd64/conf/GENERIC Mon Jan 19 07:44:18 2009 (r187428) > +++ head/sys/amd64/conf/GENERIC Mon Jan 19 08:25:41 2009 (r187429) > @@ -136,7 +136,8 @@ device pass # Passthrough device (dire > device ses # SCSI Environmental Services (and SAF-TE) > > # RAID controllers interfaced to the SCSI subsystem > -device amr # AMI MegaRAID > +#XXX it is not 64-bit clean, -scottl > +#device amr # AMI MegaRAID > device arcmsr # Areca SATA II RAID > device asr # DPT SmartRAID V, VI and Adaptec SCSI RAID > device ciss # Compaq Smart RAID 5* Ummmmm ASR is not 64-bit clean. AMR is. Scott From owner-svn-src-head@FreeBSD.ORG Mon Jan 19 08:49:02 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D1F51065689; Mon, 19 Jan 2009 08:49:02 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail06.syd.optusnet.com.au (mail06.syd.optusnet.com.au [211.29.132.187]) by mx1.freebsd.org (Postfix) with ESMTP id 9E3768FC1E; Mon, 19 Jan 2009 08:49:01 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-107-120-227.carlnfd1.nsw.optusnet.com.au (c122-107-120-227.carlnfd1.nsw.optusnet.com.au [122.107.120.227]) by mail06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id n0J8mvF9020492 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 19 Jan 2009 19:48:59 +1100 Date: Mon, 19 Jan 2009 19:48:57 +1100 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Stanislav Sedov In-Reply-To: <200901181454.n0IEskw4077045@svn.freebsd.org> Message-ID: <20090119192954.V37158@delplex.bde.org> References: <200901181454.n0IEskw4077045@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r187396 - head/sys/gnu/fs/ext2fs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jan 2009 08:49:02 -0000 On Sun, 18 Jan 2009, Stanislav Sedov wrote: > Log: > - Whitespace fixes. svn diff or a mailer always mangles whitespace (examples quoted below), so the whitespace fixes are hard to see in svn mail > - s_bmask field doesn't exist. > - Use correct flags in debug printf. The flags are more broken than before, fatally so on 64-bit arches if the code were actually used. > Modified: > head/sys/gnu/fs/ext2fs/ext2_vfsops.c > > Modified: head/sys/gnu/fs/ext2fs/ext2_vfsops.c > ============================================================================== > --- head/sys/gnu/fs/ext2fs/ext2_vfsops.c Sun Jan 18 14:04:56 2009 (r187395) > +++ head/sys/gnu/fs/ext2fs/ext2_vfsops.c Sun Jan 18 14:54:46 2009 (r187396) > @@ -5,7 +5,7 @@ > * University of Utah, Department of Computer Science > */ > /*- > - * Copyright (c) 1989, 1991, 1993, 1994 > + * Copyright (c) 1989, 1991, 1993, 1994 > * The Regents of the University of California. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > @@ -120,7 +120,7 @@ static int compute_sb_data(struct vnode > static const char *ext2_opts[] = { "from", "export", "acls", "noexec", > "noatime", "union", "suiddir", "multilabel", "nosymfollow", > "noclusterr", "noclusterw", "force", NULL }; > - > + The above diff shows null changes, presumably after dropping trailing whitespace in the old version. Oops, actually the diff is invalid since something dropped the leading space in unchanged lines. > @@ -318,7 +318,7 @@ static int ext2_check_descriptors (struc > { > /* examine next descriptor block */ > if ((i % EXT2_DESC_PER_BLOCK(sb)) == 0) > - gdp = (struct ext2_group_desc *) > + gdp = (struct ext2_group_desc *) > sb->s_group_desc[desc_block++]->b_data; > if (gdp->bg_block_bitmap < block || > gdp->bg_block_bitmap >= block + EXT2_BLOCKS_PER_GROUP(sb)) Here most leading tabs are corrupt in both the new and old versions. Please fix all whitespace on a line if fixing any. > @@ -398,19 +398,19 @@ static int compute_sb_data(devvp, es, fs > int logic_sb_block = 1; /* XXX for now */ > > #if 1 > -#define V(v) > +#define V(v) > #else > #define V(v) printf(#v"= %d\n", fs->v); > #endif The existence of this macro is a bug, since it can only work for one type, but fields of different type need to be printed. Most fields don't have type int (the first one printed is s_blocksize which (especially bogusly on 64-bit machines) has type u_long, so the non-'#if 1' case would cause lots of errors. > @@ -1000,7 +1000,7 @@ ext2_vget(mp, ino, flags, vpp) > > /* Read in the disk contents for the inode, copy into the inode. */ > #if 0 > -printf("ext2_vget(%d) dbn= %d ", ino, fsbtodb(fs, ino_to_fsba(fs, ino))); > +printf("ext2_vget(%d) dbn= %lu ", ino, fsbtodb(fs, ino_to_fsba(fs, ino))); > #endif > if ((error = bread(ump->um_devvp, fsbtodb(fs, ino_to_fsba(fs, ino)), > (int)fs->s_blocksize, NOCRED, &bp)) != 0) { ino has type ino_t, so it cannot be printed portably without using a cast. Its actual type is uint32_t. If this code were actually, this would give the following printf format errors on various supported machines: old: sign mismatch only, since plain int happens to have the same size as ino_t on all supported machines. gcc doesn't even warn about this error, so this error would be non-fatal new: now a size mismatch on machines with 64-bit longs (amd64, ia64, sparc64 at least. gcc warns about this error, so the code is now fatally broken on many supported machines, except it is never actually used. Bruce From owner-svn-src-head@FreeBSD.ORG Mon Jan 19 08:51:20 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E4B6E1065670; Mon, 19 Jan 2009 08:51:20 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D39FB8FC1A; Mon, 19 Jan 2009 08:51:20 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0J8pKx4003849; Mon, 19 Jan 2009 08:51:20 GMT (envelope-from sobomax@svn.freebsd.org) Received: (from sobomax@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0J8pKXT003848; Mon, 19 Jan 2009 08:51:20 GMT (envelope-from sobomax@svn.freebsd.org) Message-Id: <200901190851.n0J8pKXT003848@svn.freebsd.org> From: Maxim Sobolev Date: Mon, 19 Jan 2009 08:51:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187430 - head/sys/amd64/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jan 2009 08:51:21 -0000 Author: sobomax Date: Mon Jan 19 08:51:20 2009 New Revision: 187430 URL: http://svn.freebsd.org/changeset/base/187430 Log: asr(4) is not amd64-clean, not amr(4). Pointy hat to: myself Submitted by: scottl Modified: head/sys/amd64/conf/GENERIC Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Mon Jan 19 08:25:41 2009 (r187429) +++ head/sys/amd64/conf/GENERIC Mon Jan 19 08:51:20 2009 (r187430) @@ -136,10 +136,10 @@ device pass # Passthrough device (dire device ses # SCSI Environmental Services (and SAF-TE) # RAID controllers interfaced to the SCSI subsystem -#XXX it is not 64-bit clean, -scottl -#device amr # AMI MegaRAID +device amr # AMI MegaRAID device arcmsr # Areca SATA II RAID -device asr # DPT SmartRAID V, VI and Adaptec SCSI RAID +#XXX it is not 64-bit clean, -scottl +#device asr # DPT SmartRAID V, VI and Adaptec SCSI RAID device ciss # Compaq Smart RAID 5* device dpt # DPT Smartcache III, IV - See NOTES for options device hptmv # Highpoint RocketRAID 182x From owner-svn-src-head@FreeBSD.ORG Mon Jan 19 09:05:39 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E9B17106567D for ; Mon, 19 Jan 2009 09:05:39 +0000 (UTC) (envelope-from christoph.mallon@gmx.de) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by mx1.freebsd.org (Postfix) with SMTP id 39E7F8FC08 for ; Mon, 19 Jan 2009 09:05:37 +0000 (UTC) (envelope-from christoph.mallon@gmx.de) Received: (qmail invoked by alias); 19 Jan 2009 09:05:36 -0000 Received: from p54A3EACA.dip.t-dialin.net (EHLO tron.homeunix.org) [84.163.234.202] by mail.gmx.net (mp017) with SMTP; 19 Jan 2009 10:05:36 +0100 X-Authenticated: #1673122 X-Provags-ID: V01U2FsdGVkX1/V55QPv5XVXy85lShVIPocX/RoCoYYbJkR7zl2On ZNnQd3hGcd/uLQ Message-ID: <4974425F.5060600@gmx.de> Date: Mon, 19 Jan 2009 10:05:35 +0100 From: Christoph Mallon User-Agent: Thunderbird 2.0.0.19 (X11/20090103) MIME-Version: 1.0 To: Bruce Evans References: <200901181454.n0IEskw4077045@svn.freebsd.org> <20090119192954.V37158@delplex.bde.org> In-Reply-To: <20090119192954.V37158@delplex.bde.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.57 Cc: Stanislav Sedov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r187396 - head/sys/gnu/fs/ext2fs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jan 2009 09:05:40 -0000 Bruce Evans schrieb: > On Sun, 18 Jan 2009, Stanislav Sedov wrote: > >> Log: >> - Whitespace fixes. > > svn diff or a mailer always mangles whitespace (examples quoted below), > so the whitespace fixes are hard to see in svn mail [...] >> @@ -5,7 +5,7 @@ >> * University of Utah, Department of Computer Science >> */ >> /*- >> - * Copyright (c) 1989, 1991, 1993, 1994 >> + * Copyright (c) 1989, 1991, 1993, 1994 >> * The Regents of the University of California. All rights reserved. >> * >> * Redistribution and use in source and binary forms, with or without >> @@ -120,7 +120,7 @@ static int compute_sb_data(struct vnode >> static const char *ext2_opts[] = { "from", "export", "acls", "noexec", >> "noatime", "union", "suiddir", "multilabel", "nosymfollow", >> "noclusterr", "noclusterw", "force", NULL }; >> - >> + > > The above diff shows null changes, presumably after dropping trailing > whitespace in the old version. > > Oops, actually the diff is invalid since something dropped the leading > space in unchanged lines. The diff in the original mail looks correct here: I see the removed trailing whitespace in the - lines and the leading space in unchanged lines. Your quoted version is "broken", so I suspect the problem is at your end. Christoph From owner-svn-src-head@FreeBSD.ORG Mon Jan 19 09:14:03 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C864010656C0 for ; Mon, 19 Jan 2009 09:14:03 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.232]) by mx1.freebsd.org (Postfix) with ESMTP id 8ECB78FC1B for ; Mon, 19 Jan 2009 09:14:03 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: by rv-out-0506.google.com with SMTP id b25so2649101rvf.43 for ; Mon, 19 Jan 2009 01:14:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:received:date:from :to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=uPUdKPvfhmJhjHfZXWcnyZq2ZRRIndRO4hSy99M3HRE=; b=kPDkqyuG75SicFRmidDv6nTCd/I/XNLQzf04auoV/QxnUu0lWVra4lBRkBO/LhwjGU FTBM49f+mc9tZ2Py/NvH0CGMsnNQk2xyiNViSJLfhWVvO7K0v76eF4sYum+wGc4K4U7r HRS9nwM6QVIbDwHze85nxCSHPygPBaMe/AaEU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=AIJmW2Mcqb8Yh7hrtL0nYoBopmO7oEK5S3SWzYAVtZ07HHrcEWGSfn30rXHTYzNcYG k9HZQVd+wMJxcMKFcZsIVBCiOTHaK1Q8H4BDBgUHSBdyumy6mq3psMDyslWRKNpyJmOM su9tV24uvzpg11Ps8j10mNY5PMnnm/rUKzpOc= Received: by 10.140.207.2 with SMTP id e2mr981877rvg.251.1232354620777; Mon, 19 Jan 2009 00:43:40 -0800 (PST) Received: from michelle.cdnetworks.co.kr ([211.53.35.84]) by mx.google.com with ESMTPS id f42sm4221490rvb.5.2009.01.19.00.43.36 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 19 Jan 2009 00:43:39 -0800 (PST) Received: from michelle.cdnetworks.co.kr (localhost.cdnetworks.co.kr [127.0.0.1]) by michelle.cdnetworks.co.kr (8.14.3/8.14.3) with ESMTP id n0J8hUqb077134 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 19 Jan 2009 17:43:30 +0900 (KST) (envelope-from pyunyh@gmail.com) Received: (from yongari@localhost) by michelle.cdnetworks.co.kr (8.14.3/8.14.3/Submit) id n0J8hTwl077133; Mon, 19 Jan 2009 17:43:29 +0900 (KST) (envelope-from pyunyh@gmail.com) Date: Mon, 19 Jan 2009 17:43:29 +0900 From: Pyun YongHyeon To: Maxim Sobolev Message-ID: <20090119084329.GF75541@cdnetworks.co.kr> References: <200901190710.n0J7ACSg001385@svn.freebsd.org> <497432A1.9060805@samsco.org> <49743712.7030103@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <49743712.7030103@FreeBSD.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, Scott Long , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r187426 - head/sys/amd64/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jan 2009 09:14:04 -0000 On Mon, Jan 19, 2009 at 12:17:22AM -0800, Maxim Sobolev wrote: > Scott Long wrote: > >Maxim Sobolev wrote: > >>Author: sobomax > >>Date: Mon Jan 19 07:10:11 2009 > >>New Revision: 187426 > >>URL: http://svn.freebsd.org/changeset/base/187426 > >> > >>Log: > >> Add asr(4) and stge(4) from i386 GENERIC. Both drivers compile on > >>amd64 and > >> there is no particular reason for them to be i386-only. > > > >Yes, there is a particular reason why asr is i386 only. This has been > >discussed extensively over the years, but to sum it up, no it is not > >64-bit clean. Please remove. > > > >At this point in the lifecycle of amd64, you can be 100% assured that > >the list of compatible devices has been checked and rechecked a few > >dozen times. You are not going to find hidden gems that people have > >forgotten about. If you think you've found something, ask first, and > >prepare to be wrong. And above all else, don't put drivers into here > >that you haven't tested. It's pretty silly to admit in your commit > >message, for all to see, that you are blatantly committing without > >testing. > > Point taken, thanks. Is there any technical reason why stge(4) not in there? > The only reason I didn't enable it at that time was lack of testing. I think it should work without problems as I had also tested it on sparc64. -- Regards, Pyun YongHyeon From owner-svn-src-head@FreeBSD.ORG Mon Jan 19 09:24:46 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B08DD1065677; Mon, 19 Jan 2009 09:24:46 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from sippysoft.com (gk1.360sip.com [72.236.70.240]) by mx1.freebsd.org (Postfix) with ESMTP id 7850A8FC1C; Mon, 19 Jan 2009 09:24:46 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from [192.168.1.38] (S0106001372fd1e07.vs.shawcable.net [70.71.171.106]) (authenticated bits=0) by sippysoft.com (8.13.8/8.13.8) with ESMTP id n0J9Oil7090153 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 19 Jan 2009 01:24:45 -0800 (PST) (envelope-from sobomax@FreeBSD.org) Message-ID: <497446D4.5020104@FreeBSD.org> Date: Mon, 19 Jan 2009 01:24:36 -0800 From: Maxim Sobolev Organization: Sippy Software, Inc. User-Agent: Thunderbird 2.0.0.19 (Windows/20081209) MIME-Version: 1.0 To: Scott Long References: <200901190710.n0J7ACSg001385@svn.freebsd.org> <497432A1.9060805@samsco.org> In-Reply-To: <497432A1.9060805@samsco.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r187426 - head/sys/amd64/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jan 2009 09:24:47 -0000 Scott Long wrote: > prepare to be wrong. And above all else, don't put drivers into here > that you haven't tested. It's pretty silly to admit in your commit > message, for all to see, that you are blatantly committing without > testing. Actually this is interesting point, what the best strategy for us as the project should be? Should we new put drivers that have been tested on i386 only and don't have any particular reason to be i386-specific (i.e. ISA/EISA drivers, PCMCIA drivers etc) into amd64 GENERIC automatically and wait for somebody to report a problem, or stay on the safe side and enable drivers on amd64 only after somebody actually has tested them and confirms that they are working? Should this policy depend on driver class (for example a storage driver has much higher potential for screwing user's data compared to a network driver or a sound driver) and on release (HEAD / STABLE)? IMHO FreeBSD could benefit by putting at least non-storage untested non i386-specific drivers into amd64 kernel and/or at least in HEAD to give them testing and a wider exposure. This is not just idle interest for me - recently our company has started shipping amd64 version of our FreeBSD-based product, so that we are a little bit concerned about hardware support with amd64 7.1 kernel being a little bit narrower compared to i386 7.1 kernel. I apologize if this topic has been discussed somewhere already. -Maxim From owner-svn-src-head@FreeBSD.ORG Mon Jan 19 09:31:43 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A22E5106564A for ; Mon, 19 Jan 2009 09:31:43 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from mx0.deglitch.com (backbone.deglitch.com [IPv6:2001:16d8:fffb:4::abba]) by mx1.freebsd.org (Postfix) with ESMTP id 3C5148FC1B for ; Mon, 19 Jan 2009 09:31:43 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from DSPAM-Daemon (localhost [127.0.0.1]) by mx0.deglitch.com (Postfix) with SMTP id 0A8848FC51 for ; Mon, 19 Jan 2009 12:31:41 +0300 (MSK) Received: from orion.SpringDaemons.com (drsun1.dialup.corbina.ru [85.21.245.235]) by mx0.deglitch.com (Postfix) with ESMTPA id A677D8FC18; Mon, 19 Jan 2009 12:31:39 +0300 (MSK) Received: from orion (localhost [127.0.0.1]) by orion.SpringDaemons.com (Postfix) with SMTP id EFEE8398F3; Mon, 19 Jan 2009 12:31:42 +0300 (MSK) Date: Mon, 19 Jan 2009 12:31:38 +0300 From: Stanislav Sedov To: Bruce Evans Message-Id: <20090119123138.f5404c60.stas@FreeBSD.org> In-Reply-To: <20090119192954.V37158@delplex.bde.org> References: <200901181454.n0IEskw4077045@svn.freebsd.org> <20090119192954.V37158@delplex.bde.org> Organization: The FreeBSD Project X-XMPP: ssedov@jabber.ru X-Voice: +7 916 849 20 23 X-PGP-Fingerprint: F21E D6CC 5626 9609 6CE2 A385 2BF5 5993 EB26 9581 X-Mailer: carrier-pigeon Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-DSPAM-Result: Whitelisted X-DSPAM-Processed: Mon Jan 19 12:31:41 2009 X-DSPAM-Confidence: 0.9899 X-DSPAM-Improbability: 1 in 9809 chance of being spam X-DSPAM-Probability: 0.0000 X-DSPAM-Signature: 4974487d967001758711833 Cc: Stanislav Sedov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r187396 - head/sys/gnu/fs/ext2fs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jan 2009 09:31:44 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Mon, 19 Jan 2009 19:48:57 +1100 (EST) Bruce Evans mentioned: > > Modified: head/sys/gnu/fs/ext2fs/ext2_vfsops.c > > ============================================================================== > > --- head/sys/gnu/fs/ext2fs/ext2_vfsops.c Sun Jan 18 14:04:56 2009 (r187395) > > +++ head/sys/gnu/fs/ext2fs/ext2_vfsops.c Sun Jan 18 14:54:46 2009 (r187396) > > @@ -5,7 +5,7 @@ > > * University of Utah, Department of Computer Science > > */ > > /*- > > - * Copyright (c) 1989, 1991, 1993, 1994 > > + * Copyright (c) 1989, 1991, 1993, 1994 > > * The Regents of the University of California. All rights reserved. > > * > > * Redistribution and use in source and binary forms, with or without > > @@ -120,7 +120,7 @@ static int compute_sb_data(struct vnode > > static const char *ext2_opts[] = { "from", "export", "acls", "noexec", > > "noatime", "union", "suiddir", "multilabel", "nosymfollow", > > "noclusterr", "noclusterw", "force", NULL }; > > - > > + > > The above diff shows null changes, presumably after dropping trailing > whitespace in the old version. > > Oops, actually the diff is invalid since something dropped the leading > space in unchanged lines. > Yes, seems that svn mail diffs trims the spaces out... > > @@ -318,7 +318,7 @@ static int ext2_check_descriptors (struc > > { > > /* examine next descriptor block */ > > if ((i % EXT2_DESC_PER_BLOCK(sb)) == 0) > > - gdp = (struct ext2_group_desc *) > > + gdp = (struct ext2_group_desc *) > > sb->s_group_desc[desc_block++]->b_data; > > if (gdp->bg_block_bitmap < block || > > gdp->bg_block_bitmap >= block + EXT2_BLOCKS_PER_GROUP(sb)) > > Here most leading tabs are corrupt in both the new and old versions. Please > fix all whitespace on a line if fixing any. > This file has style different from our conventions, so I only stripped leading spaces and left everything else intact. Should I convert the entire file to style(9).? > > @@ -398,19 +398,19 @@ static int compute_sb_data(devvp, es, fs > > int logic_sb_block = 1; /* XXX for now */ > > > > #if 1 > > -#define V(v) > > +#define V(v) > > #else > > #define V(v) printf(#v"= %d\n", fs->v); > > #endif > > The existence of this macro is a bug, since it can only work for one type, > but fields of different type need to be printed. Most fields don't have > type int (the first one printed is s_blocksize which (especially bogusly > on 64-bit machines) has type u_long, so the non-'#if 1' case would cause > lots of errors. > In the following commit I casted all fields to (unsigned long) explicitly, so printfs will work for all fields. > > @@ -1000,7 +1000,7 @@ ext2_vget(mp, ino, flags, vpp) > > > > /* Read in the disk contents for the inode, copy into the inode. */ > > #if 0 > > -printf("ext2_vget(%d) dbn= %d ", ino, fsbtodb(fs, ino_to_fsba(fs, ino))); > > +printf("ext2_vget(%d) dbn= %lu ", ino, fsbtodb(fs, ino_to_fsba(fs, ino))); > > #endif > > if ((error = bread(ump->um_devvp, fsbtodb(fs, ino_to_fsba(fs, ino)), > > (int)fs->s_blocksize, NOCRED, &bp)) != 0) { > > ino has type ino_t, so it cannot be printed portably without using a > cast. Its actual type is uint32_t. If this code were actually, this > would give the following printf format errors on various supported > machines: > > old: sign mismatch only, since plain int happens to have the same size as > ino_t on all supported machines. gcc doesn't even warn about this > error, so this error would be non-fatal > > new: now a size mismatch on machines with 64-bit longs (amd64, ia64, sparc64 > at least. gcc warns about this error, so the code is now fatally > broken on many supported machines, except it is never actually used. > Actually, the third argument of printf has type of unsigned long for ext2fs code thanks to arithmetical operations around ino_to_fsba calculations. Thus the old code has been broken at least for 64-bit platforms, new one should work everywhere (both for 32 bit an 64bit platforms). Thanks for comments! - -- Stanislav Sedov ST4096-RIPE -----BEGIN PGP SIGNATURE----- iEYEARECAAYFAkl0SH4ACgkQK/VZk+smlYE7CQCfYtheq6nRYDh/3DWjDJ41hcem yVMAnjN3sKe8UacMMvH6e1wrR/C/DKES =84cR -----END PGP SIGNATURE----- !DSPAM:4974487d967001758711833! From owner-svn-src-head@FreeBSD.ORG Mon Jan 19 11:09:33 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1E92B10656D6; Mon, 19 Jan 2009 11:09:33 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail11.syd.optusnet.com.au (mail11.syd.optusnet.com.au [211.29.132.192]) by mx1.freebsd.org (Postfix) with ESMTP id A13258FC2A; Mon, 19 Jan 2009 11:09:32 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-107-120-227.carlnfd1.nsw.optusnet.com.au (c122-107-120-227.carlnfd1.nsw.optusnet.com.au [122.107.120.227]) by mail11.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id n0JB9Slj028342 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 19 Jan 2009 22:09:29 +1100 Date: Mon, 19 Jan 2009 22:09:28 +1100 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Stanislav Sedov In-Reply-To: <20090118174357.3ed1459d.stas@FreeBSD.org> Message-ID: <20090119202452.X37158@delplex.bde.org> References: <200901181404.n0IE4uXw075698@svn.freebsd.org> <20090118140644.GT48057@deviant.kiev.zoral.com.ua> <20090118174357.3ed1459d.stas@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Kostik Belousov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r187395 - head/sys/gnu/fs/ext2fs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jan 2009 11:09:41 -0000 On Sun, 18 Jan 2009, Stanislav Sedov wrote: > Kostik Belousov mentioned: > >> >> Please see a discussion on the fs@ and reasoning why I declined to commit >> the similar patch. > ... > The extra size added in inodes are used to store additional info like extended > attributes, ACLs and so on. Each inode now has a field just after the legacy > inode format struct that shows hom much additional space has been added to > this particular inode. By analyzing this field the operating system can interpret > additional data located in inode, if it understand its format (there might be > application and/or OS specific data too). > > Our implementation just ignore this additional fields after sizeof(ext2fs_inode), > both while reading and writing. Thus we don't interet this data yet we don't > overwrite it. If it does this, then it is quite broken, since the garbage data bites implementations that _do_ interpret the data. Writing to the unsupported fields is especially important for either destruction or creation, so that the garbage doesn't leak to new files when a disk inode is reused. The field[s] showing how the additional space is used actually seem to be _inside_ the legacy inode (*). However, this doesn't seem to help, since we seem to never touch them there either (we bzero() new inodes in ext2_vget() but never bzero() the disk inode). There seem to be old bugs in this area. The untouched fields are: - osd1 (sic) I don't understand this - i_file_acl leaking this would security holes - i_dir_acl leaking this would security holes this is abused for the high 32 bits of the file size in the case of regular files. We use it in this case, but a few years ago when we didn't use it, leaking it would have given wrong file sizes. - i_faddr I don't understand this _ osd2 (sic) this has mainly things like an extra 16 bits for the the uid and gid. Leaking these would give security holes more often than for acls. I think there is no actual problem with at least the file acls. What is supposed to happen is: - if the file system has any nonzero acls, then ext[23]fs under linux has set EXT2_FEATURE_COMPAT_EXT_ATTR in the superblock to indicate that this feature is used - FreeBSD ext2fs doesn't support this feature, so mounting such file systems fails - an ext2fs utility should offer to clear EXT2_FEATURE_COMPAT_EXT_ATTR in the superblock. When it clears it there, it must clear all the associated metadata too. Thus the metadata doesn't leak. - hopefully there are compat flags for all the other extensions too. There is one for using the file size extension. I can't find one related to larger disk inodes. (*) In linux-2.6.10, the declaration of struct ext3_inode is lexically identical to struct ext2_inode except for one s/2/3/ and apparent style bugs in the latter (__u16/32 hasn't been converted to __le16/32 in new fields in the latter; this is only a style bug provided the new fields are ignored on read and zeroed on write). Bruce From owner-svn-src-head@FreeBSD.ORG Mon Jan 19 11:45:04 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A253D1065670; Mon, 19 Jan 2009 11:45:04 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail05.syd.optusnet.com.au (mail05.syd.optusnet.com.au [211.29.132.186]) by mx1.freebsd.org (Postfix) with ESMTP id 3F99F8FC1A; Mon, 19 Jan 2009 11:45:04 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-107-120-227.carlnfd1.nsw.optusnet.com.au (c122-107-120-227.carlnfd1.nsw.optusnet.com.au [122.107.120.227]) by mail05.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id n0JBj1MY012601 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 19 Jan 2009 22:45:02 +1100 Date: Mon, 19 Jan 2009 22:45:01 +1100 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Stanislav Sedov In-Reply-To: <200901181404.n0IE4uXw075698@svn.freebsd.org> Message-ID: <20090119220943.P37158@delplex.bde.org> References: <200901181404.n0IE4uXw075698@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r187395 - head/sys/gnu/fs/ext2fs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jan 2009 11:45:05 -0000 On Sun, 18 Jan 2009, Stanislav Sedov wrote: > Author: stas > Date: Sun Jan 18 14:04:56 2009 > New Revision: 187395 > URL: http://svn.freebsd.org/changeset/base/187395 > > Log: > - Obtain inode sizes and location of the first inode based on the contents > of superblock rather than using hardcoded values. This fixes ext2fs on > filesystems with inode sized other than 128. > > Submitted by: Alex Lyashkov (based on) > MFC after: 2 weeks This was not suitable for committing verbatim. > Modified: head/sys/gnu/fs/ext2fs/ext2_fs.h > ============================================================================== > --- head/sys/gnu/fs/ext2fs/ext2_fs.h Sun Jan 18 13:04:38 2009 (r187394) > +++ head/sys/gnu/fs/ext2fs/ext2_fs.h Sun Jan 18 14:04:56 2009 (r187395) > @@ -150,8 +150,8 @@ > #else /* !notyet */ ^^^^^^^^^^^^^^^^^^^ > #define EXT2_INODES_PER_BLOCK(s) ((s)->s_inodes_per_block) > /* Should be sizeof(struct ext2_inode): */ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > -#define EXT2_INODE_SIZE 128 > -#define EXT2_FIRST_INO 11 > +#define EXT2_INODE_SIZE(s) ((s)->s_inode_size) > +#define EXT2_FIRST_INO(s) ((s)->s_first_inode) > #endif /* notyet */ Please read the code before changing parts of it. The comment is now just wrong. One value that EXT2_INODE_SIZE certainly should _not_ be is the fixed size of our data structure, since we are now trying to support a variable size and even have a parameter to do that. The ifdef is now more bogus than before. The "!notyet" part now essentially duplicates the old unchanged "notyet" part, except for having bugs not present in the old version. This ifdef is a FreeBSD hack which should have been removed. Linux ext2fs just has the "notyet" part. Here is complete old ifdef: % #ifdef notyet % #ifdef __KERNEL__ % #define EXT2_ADDR_PER_BLOCK_BITS(s) ((s)->u.ext2_sb.s_addr_per_block_bits) % #define EXT2_INODE_SIZE(s) ((s)->u.ext2_sb.s_inode_size) % #define EXT2_FIRST_INO(s) ((s)->u.ext2_sb.s_first_ino) This is literally the same as in Linux. It cannot be used directly, now for only minor reasons: - FreeBSD doesn't have "u.ext2.sb". After deleting "u.ext2_sb." from the above, it seems to be right. - this was already done in the !notyet part for the 1st macro - your change does this for the other 2 macros, but this is not enough -- see below. % #else % #define EXT2_INODE_SIZE(s) (((s)->s_rev_level == EXT2_GOOD_OLD_REV) ? \ % EXT2_GOOD_OLD_INODE_SIZE : \ % (s)->s_inode_size) % #define EXT2_FIRST_INO(s) (((s)->s_rev_level == EXT2_GOOD_OLD_REV) ? \ % EXT2_GOOD_OLD_FIRST_INO : \ % (s)->s_first_ino) s_inode_size and s_first_ino cannot be used directly because they aren't supported by EXT2_GOOD_OLD_REV file systems. The conversion is done in the above macros for the !KERNEL case. It is done during superblock initialization in Linux ext2fs (at least the in-core copy of the superblock is written to). It is not done in FreeBSD ext2fs. Thus support for EXT2_GOOD_OLD_REV file systems has been broken. The change seems to be correct except for the above, and 1 other major style bug. Bruce From owner-svn-src-head@FreeBSD.ORG Mon Jan 19 14:42:03 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F6C91065674; Mon, 19 Jan 2009 14:42:03 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail06.syd.optusnet.com.au (mail06.syd.optusnet.com.au [211.29.132.187]) by mx1.freebsd.org (Postfix) with ESMTP id 882E68FC13; Mon, 19 Jan 2009 14:42:02 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-107-120-227.carlnfd1.nsw.optusnet.com.au (c122-107-120-227.carlnfd1.nsw.optusnet.com.au [122.107.120.227]) by mail06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id n0JEfwOb025014 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 20 Jan 2009 01:41:59 +1100 Date: Tue, 20 Jan 2009 01:41:58 +1100 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Stanislav Sedov In-Reply-To: <20090119123138.f5404c60.stas@FreeBSD.org> Message-ID: <20090120002911.A37309@delplex.bde.org> References: <200901181454.n0IEskw4077045@svn.freebsd.org> <20090119192954.V37158@delplex.bde.org> <20090119123138.f5404c60.stas@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans Subject: Re: svn commit: r187396 - head/sys/gnu/fs/ext2fs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jan 2009 14:42:04 -0000 On Mon, 19 Jan 2009, Stanislav Sedov wrote: > On Mon, 19 Jan 2009 19:48:57 +1100 (EST) > Bruce Evans mentioned: > >>> Modified: head/sys/gnu/fs/ext2fs/ext2_vfsops.c >>> ============================================================================== >>> --- head/sys/gnu/fs/ext2fs/ext2_vfsops.c Sun Jan 18 14:04:56 2009 (r187395) >>> +++ head/sys/gnu/fs/ext2fs/ext2_vfsops.c Sun Jan 18 14:54:46 2009 (r187396) >>> @@ -5,7 +5,7 @@ >>> * University of Utah, Department of Computer Science >>> */ >>> /*- >>> - * Copyright (c) 1989, 1991, 1993, 1994 >>> + * Copyright (c) 1989, 1991, 1993, 1994 >>> * The Regents of the University of California. All rights reserved. >>> * >>> * Redistribution and use in source and binary forms, with or without >>> @@ -120,7 +120,7 @@ static int compute_sb_data(struct vnode >>> static const char *ext2_opts[] = { "from", "export", "acls", "noexec", >>> "noatime", "union", "suiddir", "multilabel", "nosymfollow", >>> "noclusterr", "noclusterw", "force", NULL }; >>> - >>> + >> >> The above diff shows null changes, presumably after dropping trailing >> whitespace in the old version. >> >> Oops, actually the diff is invalid since something dropped the leading >> space in unchanged lines. > > Yes, seems that svn mail diffs trims the spaces out... The original diffs seem to be correct. Cristoph Mallon replied that he gets good diffs in mail. The spaces seem to be lost here before my mail arrives. >>> @@ -318,7 +318,7 @@ static int ext2_check_descriptors (struc >>> { >>> /* examine next descriptor block */ >>> if ((i % EXT2_DESC_PER_BLOCK(sb)) == 0) >>> - gdp = (struct ext2_group_desc *) >>> + gdp = (struct ext2_group_desc *) >>> sb->s_group_desc[desc_block++]->b_data; >>> if (gdp->bg_block_bitmap < block || >>> gdp->bg_block_bitmap >= block + EXT2_BLOCKS_PER_GROUP(sb)) >> >> Here most leading tabs are corrupt in both the new and old versions. Please >> fix all whitespace on a line if fixing any. > > This file has style different from our conventions, so I only stripped > leading spaces and left everything else intact. Should I convert the entire > file to style(9).? Only lines changed for other reasons. ext2_vnops.c is non-KNF for pure formatting on about 20% of its lines. Fixing tabs using |unexpand reduces this to about 18.5%. > >>> @@ -398,19 +398,19 @@ static int compute_sb_data(devvp, es, fs >>> int logic_sb_block = 1; /* XXX for now */ >>> >>> #if 1 >>> -#define V(v) >>> +#define V(v) >>> #else >>> #define V(v) printf(#v"= %d\n", fs->v); >>> #endif >> >> The existence of this macro is a bug, since it can only work for one type, >> but fields of different type need to be printed. Most fields don't have >> type int (the first one printed is s_blocksize which (especially bogusly >> on 64-bit machines) has type u_long, so the non-'#if 1' case would cause >> lots of errors. Actually, this macro can be made usable using unportable complications like: %%% #include %%% #include /* * Can use even more complications to support FP or to avoid upcasting. * The unportable __typeof() is used so that the signedness can be * determined at compile time. Expressions like (((__typeof(v))0.5 > 0.3) * can be used to determine floating point at compile time, and * expressions involving (((__typeof(v))UINTMAX_MAX == UINTMAX_MAX) can * be used to determine if the full upcast is needed. There should be * a standard flag %I that does all of this automatically. Failing that, * standards permit all of this to be done automatically in the usual * case where a type error gives undefined behaviour. */ #define V(v) __extension__ ({ \ if ((__typeof(v))(-1) < 0) \ printf(#v"= %jd\n", (intmax_t)v); \ else \ printf(#v"= %ju\n", (uintmax_t)v); \ }) %%% > In the following commit I casted all fields to (unsigned long) explicitly, > so printfs will work for all fields. Better, but still technically wrong for the signed fields on all machines and for the 64-bit fields on 32-bit machines, and potentially technically wrong for all the typedefed fields. I think all fields fit in 32-bit u_ints, but most of the types in the in-core superblock are bogusly large or bogusly signed so this is not clear. E.g., s_qbmask is quad_t, but it is less than s_blocksize which is unsigned long, and the largest block size is normally 4K so only int16_t is needed for all of these. The V() for s_qbmask would also be fatal if it were compiled, since it is spelled without a 'q'. >>> @@ -1000,7 +1000,7 @@ ext2_vget(mp, ino, flags, vpp) >>> >>> /* Read in the disk contents for the inode, copy into the inode. */ >>> #if 0 >>> -printf("ext2_vget(%d) dbn= %d ", ino, fsbtodb(fs, ino_to_fsba(fs, ino))); >>> +printf("ext2_vget(%d) dbn= %lu ", ino, fsbtodb(fs, ino_to_fsba(fs, ino))); >>> #endif >>> if ((error = bread(ump->um_devvp, fsbtodb(fs, ino_to_fsba(fs, ino)), >>> (int)fs->s_blocksize, NOCRED, &bp)) != 0) { >> >> ino has type ino_t, so it cannot be printed portably without using a >> cast. Its actual type is uint32_t. If this code were actually, this >> would give the following printf format errors on various supported >> machines: >> >> old: sign mismatch only, since plain int happens to have the same size as >> ino_t on all supported machines. gcc doesn't even warn about this >> error, so this error would be non-fatal >> >> new: now a size mismatch on machines with 64-bit longs (amd64, ia64, sparc64 >> at least. gcc warns about this error, so the code is now fatally >> broken on many supported machines, except it is never actually used. > > Actually, the third argument of printf has type of unsigned long for ext2fs > code thanks to arithmetical operations around ino_to_fsba calculations. Thus > the old code has been broken at least for 64-bit platforms, new one should > work everywhere (both for 32 bit an 64bit platforms). Oops. I looked at the 2nd arg. I suppose ext2fs doesn't support file systems larger than 1TB, especially under FreeBSD, so the result of fsbtodb() fits in an int32_t and using plain int for everything would work. Those arithmetical calculations are very fragile. The corresponding ones in ffs use lots of casts and still used to get the casts wrong so that the shift overflowed at 1TB. In general, the disk block address is int64_t and the correct format is %jd after casting the int64_t up to intmax_t. Bruce From owner-svn-src-head@FreeBSD.ORG Mon Jan 19 15:33:07 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75073106564A; Mon, 19 Jan 2009 15:33:07 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6379F8FC17; Mon, 19 Jan 2009 15:33:07 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0JFX7Qq014017; Mon, 19 Jan 2009 15:33:07 GMT (envelope-from sobomax@svn.freebsd.org) Received: (from sobomax@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0JFX76J014016; Mon, 19 Jan 2009 15:33:07 GMT (envelope-from sobomax@svn.freebsd.org) Message-Id: <200901191533.n0JFX76J014016@svn.freebsd.org> From: Maxim Sobolev Date: Mon, 19 Jan 2009 15:33:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187433 - head/sys/amd64/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jan 2009 15:33:08 -0000 Author: sobomax Date: Mon Jan 19 15:33:06 2009 New Revision: 187433 URL: http://svn.freebsd.org/changeset/base/187433 Log: Take NTFS option out to match i386 GENERIC. Suggested by: phk, luigi Modified: head/sys/amd64/conf/GENERIC Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Mon Jan 19 11:10:02 2009 (r187432) +++ head/sys/amd64/conf/GENERIC Mon Jan 19 15:33:06 2009 (r187433) @@ -47,7 +47,6 @@ options NFSCLIENT # Network Filesystem options NFSSERVER # Network Filesystem Server options NFSLOCKD # Network Lock Manager options NFS_ROOT # NFS usable as /, requires NFSCLIENT -options NTFS # NT File System options MSDOSFS # MSDOS Filesystem options CD9660 # ISO 9660 Filesystem options PROCFS # Process filesystem (requires PSEUDOFS) From owner-svn-src-head@FreeBSD.ORG Mon Jan 19 15:59:05 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B9AE10656D1; Mon, 19 Jan 2009 15:59:05 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 59DBC8FC0A; Mon, 19 Jan 2009 15:59:05 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0JFx5DG014687; Mon, 19 Jan 2009 15:59:05 GMT (envelope-from sobomax@svn.freebsd.org) Received: (from sobomax@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0JFx5Dc014686; Mon, 19 Jan 2009 15:59:05 GMT (envelope-from sobomax@svn.freebsd.org) Message-Id: <200901191559.n0JFx5Dc014686@svn.freebsd.org> From: Maxim Sobolev Date: Mon, 19 Jan 2009 15:59:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187436 - head/sbin/mount_ntfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jan 2009 15:59:06 -0000 Author: sobomax Date: Mon Jan 19 15:59:05 2009 New Revision: 187436 URL: http://svn.freebsd.org/changeset/base/187436 Log: In the CAVEATS section mention the fact that the NTFS kernel support isn't very well maintained and point user to sysutils/fusefs-ntfs, which at the time of this writing seems to be a better alternative. Suggested by: luigi MFC after: 2 weeks Modified: head/sbin/mount_ntfs/mount_ntfs.8 Modified: head/sbin/mount_ntfs/mount_ntfs.8 ============================================================================== --- head/sbin/mount_ntfs/mount_ntfs.8 Mon Jan 19 15:38:26 2009 (r187435) +++ head/sbin/mount_ntfs/mount_ntfs.8 Mon Jan 19 15:59:05 2009 (r187436) @@ -154,6 +154,12 @@ This utility is primarily used for read See the .Sx WRITING section for details about writing to an NTFS volume. +.Pp +Apart from being read-mostly, the NTFS support in the +.Fx +kernel is not actively maintained. For any non-trivial use +sysutils/fusefs-ntfs package, a more complete and better +maintained alternative, is recommended instead. .Sh HISTORY The .Nm From owner-svn-src-head@FreeBSD.ORG Mon Jan 19 16:19:53 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C69EF106564A; Mon, 19 Jan 2009 16:19:53 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B53098FC12; Mon, 19 Jan 2009 16:19:53 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0JGJrLK015124; Mon, 19 Jan 2009 16:19:53 GMT (envelope-from sobomax@svn.freebsd.org) Received: (from sobomax@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0JGJrhJ015123; Mon, 19 Jan 2009 16:19:53 GMT (envelope-from sobomax@svn.freebsd.org) Message-Id: <200901191619.n0JGJrhJ015123@svn.freebsd.org> From: Maxim Sobolev Date: Mon, 19 Jan 2009 16:19:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187437 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jan 2009 16:19:54 -0000 Author: sobomax Date: Mon Jan 19 16:19:53 2009 New Revision: 187437 URL: http://svn.freebsd.org/changeset/base/187437 Log: Mention the fact that the NTFS kernel support isn't very well maintained and point user to sysutils/fusefs-ntfs, which at the time of this writing seems to be a better alternative. Suggested by: luigi MFC after: 2 weeks Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Mon Jan 19 15:59:05 2009 (r187436) +++ head/sys/conf/NOTES Mon Jan 19 16:19:53 2009 (r187437) @@ -942,7 +942,11 @@ options HPFS #OS/2 File system options MSDOSFS #MS DOS File System (FAT, FAT32) options NFSSERVER #Network File System server options NFSLOCKD #Network Lock Manager -options NTFS #NT File System + +# NT File System. Read-mostly and it's not actively maintained. +# For a better NTFS support consider sysutils/fusefs-ntfs port/package. +options NTFS + options NULLFS #NULL filesystem # Broken (depends on NCP): #options NWFS #NetWare filesystem From owner-svn-src-head@FreeBSD.ORG Mon Jan 19 16:35:26 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A6871065688; Mon, 19 Jan 2009 16:35:26 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from ebb.errno.com (ebb.errno.com [69.12.149.25]) by mx1.freebsd.org (Postfix) with ESMTP id ACD728FC26; Mon, 19 Jan 2009 16:35:25 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from trouble.errno.com (trouble.errno.com [10.0.0.248]) (authenticated bits=0) by ebb.errno.com (8.13.6/8.12.6) with ESMTP id n0JGZOaE059006 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 19 Jan 2009 08:35:25 -0800 (PST) (envelope-from sam@freebsd.org) Message-ID: <4974ABCC.7000107@freebsd.org> Date: Mon, 19 Jan 2009 08:35:24 -0800 From: Sam Leffler Organization: FreeBSD Project User-Agent: Thunderbird 2.0.0.18 (X11/20081209) MIME-Version: 1.0 To: Maxim Sobolev References: <200901190710.n0J7ACSg001385@svn.freebsd.org> <497432A1.9060805@samsco.org> <497446D4.5020104@FreeBSD.org> In-Reply-To: <497446D4.5020104@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-DCC-sonic.net-Metrics: ebb.errno.com; whitelist Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r187426 - head/sys/amd64/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jan 2009 16:35:29 -0000 Maxim Sobolev wrote: > Scott Long wrote: >> prepare to be wrong. And above all else, don't put drivers into here >> that you haven't tested. It's pretty silly to admit in your commit >> message, for all to see, that you are blatantly committing without >> testing. > > Actually this is interesting point, what the best strategy for us as > the project should be? Should we new put drivers that have been tested > on i386 only and don't have any particular reason to be i386-specific > (i.e. ISA/EISA drivers, PCMCIA drivers etc) into amd64 GENERIC > automatically and wait for somebody to report a problem, or stay on > the safe side and enable drivers on amd64 only after somebody actually > has tested them and confirms that they are working? Should this policy > depend on driver class (for example a storage driver has much higher > potential for screwing user's data compared to a network driver or a > sound driver) and on release (HEAD / STABLE)? IMHO FreeBSD could > benefit by putting at least non-storage untested non i386-specific > drivers into amd64 kernel and/or at least in HEAD to give them testing > and a wider exposure. > > This is not just idle interest for me - recently our company has > started shipping amd64 version of our FreeBSD-based product, so that > we are a little bit concerned about hardware support with amd64 7.1 > kernel being a little bit narrower compared to i386 7.1 kernel. > > I apologize if this topic has been discussed somewhere already. I think the answer to your question about default-enabling drivers is very clear: it is the decision of the person maintaining the driver. If you're willing to SUPPORT a driver on a platform then feel free to enable it. Otherwise doing a drive-by to enable a driver that may or may not work may easily result in complaints that are unanswered. These have resulted in people concluding wider breakage that easily becomes de-facto and are hard to kill given that people google for help, find old complaints, and stop searching. Sam From owner-svn-src-head@FreeBSD.ORG Mon Jan 19 16:50:31 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9CD31065677; Mon, 19 Jan 2009 16:50:31 +0000 (UTC) (envelope-from obrien@NUXI.org) Received: from dragon.nuxi.org (trang.nuxi.org [74.95.12.85]) by mx1.freebsd.org (Postfix) with ESMTP id 9B9CB8FC12; Mon, 19 Jan 2009 16:50:31 +0000 (UTC) (envelope-from obrien@NUXI.org) Received: from dragon.nuxi.org (obrien@localhost [127.0.0.1]) by dragon.nuxi.org (8.14.2/8.14.2) with ESMTP id n0JGoUPh018643; Mon, 19 Jan 2009 08:50:30 -0800 (PST) (envelope-from obrien@dragon.nuxi.org) Received: (from obrien@localhost) by dragon.nuxi.org (8.14.2/8.14.2/Submit) id n0JGoUgR018642; Mon, 19 Jan 2009 08:50:30 -0800 (PST) (envelope-from obrien) Date: Mon, 19 Jan 2009 08:50:30 -0800 From: "David O'Brien" To: Robert Watson Message-ID: <20090119165030.GA18409@dragon.NUXI.org> References: <200901161547.n0GFlZ4C012008@svn.freebsd.org> <20090117142021.92d5a40b.stas@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD 8.0-CURRENT User-Agent: Mutt/1.5.16 (2007-06-09) Cc: Stanislav Sedov , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Ed Schouten Subject: Re: svn commit: r187332 - head/tools/regression/usr.bin/jot X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: obrien@FreeBSD.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jan 2009 16:50:32 -0000 On Sat, Jan 17, 2009 at 02:00:55PM +0000, Robert Watson wrote: > > On Sat, 17 Jan 2009, Stanislav Sedov wrote: > >> Was this discussed somewhere? I don't understand why we should restrict >> our filesystem naming because of limitation of auxilary filesystems. >> There're even more restrictive filesystems available, we couldn't support >> them all. While previous modifications looked harmless this one seems >> questionable to me. >> >> I understand, this is a bikesched, but I really don't see a reason. You >> can't build FreeBSD on windows anyway. > > Many of us would *very* much like to be able to cross-build FreeBSD from > both Windows and Mac OS X, which would be highly desirable for embedded > systems and appliance shops. Run VMware. Seriously. Or raise a serious discussion on developers@ about this and get conciseness that cross building on MacOS X and MS-Windows is a goal. Juniper Networks creates VM's of FreeBSD build machines when they are upgraded (or decommissioned) so it can build old EOL'ed JUNOS versions if really needed on the same exact FreeBSD version as when the JUNOS version was in full production. If Juniper can do it - FreeBSD developers cannot? For changes like this to be reasoned because of building FreeBSD on Windows there should consensus. For MacOS X - there is a case sensitive FS. > The first obstacle to making that work is > that you can't even check out our source code correctly on those platforms, > so fixing that is an important priority so that the remainder can be worked > on. See above for MacOS X users. -- -- David (obrien@FreeBSD.org) From owner-svn-src-head@FreeBSD.ORG Mon Jan 19 16:55:04 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F4E910656C1; Mon, 19 Jan 2009 16:55:04 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 66F178FC1A; Mon, 19 Jan 2009 16:55:04 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 20F5146B39; Mon, 19 Jan 2009 11:55:04 -0500 (EST) Date: Mon, 19 Jan 2009 16:55:04 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: David O'Brien In-Reply-To: <20090119165030.GA18409@dragon.NUXI.org> Message-ID: References: <200901161547.n0GFlZ4C012008@svn.freebsd.org> <20090117142021.92d5a40b.stas@FreeBSD.org> <20090119165030.GA18409@dragon.NUXI.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Stanislav Sedov , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Ed Schouten Subject: Re: svn commit: r187332 - head/tools/regression/usr.bin/jot X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jan 2009 16:55:05 -0000 On Mon, 19 Jan 2009, David O'Brien wrote: > For changes like this to be reasoned because of building FreeBSD on Windows > there should consensus. For MacOS X - there is a case sensitive FS. So I have to reformat my Mac OS X file systems in order to check out FreeBSD source trees on them because the jot(1) regression test relies on having two files in the same directory that differ only in case? :-) No one is saying you should be able to check out FreeBSD source trees using 8.3 DOS filenames, but I think avoiding case collisions makes a lot of sense. Robert N M Watson Computer Laboratory University of Cambridge From owner-svn-src-head@FreeBSD.ORG Mon Jan 19 17:00:42 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 94B4F1065672; Mon, 19 Jan 2009 17:00:42 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8377F8FC1F; Mon, 19 Jan 2009 17:00:42 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0JH0gdF015996; Mon, 19 Jan 2009 17:00:42 GMT (envelope-from sobomax@svn.freebsd.org) Received: (from sobomax@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0JH0gio015995; Mon, 19 Jan 2009 17:00:42 GMT (envelope-from sobomax@svn.freebsd.org) Message-Id: <200901191700.n0JH0gio015995@svn.freebsd.org> From: Maxim Sobolev Date: Mon, 19 Jan 2009 17:00:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187438 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jan 2009 17:00:43 -0000 Author: sobomax Date: Mon Jan 19 17:00:42 2009 New Revision: 187438 URL: http://svn.freebsd.org/changeset/base/187438 Log: Mention removal of NTFS from GENERIC/amd64. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Mon Jan 19 16:19:53 2009 (r187437) +++ head/UPDATING Mon Jan 19 17:00:42 2009 (r187438) @@ -22,6 +22,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. to maximize performance. (To disable malloc debugging, run ln -s aj /etc/malloc.conf.) +20090119: + NTFS has been removed from GENERIC kernel on amd64 to match + GENERIC on i386. Should not cause any issues since mount_ntfs(8) + will load ntfs.ko module automatically when NTFS support is + actually needed, unless ntfs.ko is not installed or security + level prohibits loading kernel modules. If either is the case, + "options NTFS" has to be added into kernel config. + 20090115: TCP Appropriate Byte Counting (RFC 3465) support added to kernel. New field in struct tcpcb breaks ABI, so bump __FreeBSD_version to From owner-svn-src-head@FreeBSD.ORG Mon Jan 19 17:12:48 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B8305106566B; Mon, 19 Jan 2009 17:12:48 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from sippysoft.com (gk1.360sip.com [72.236.70.240]) by mx1.freebsd.org (Postfix) with ESMTP id 63E738FC1C; Mon, 19 Jan 2009 17:12:48 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from [192.168.1.38] (S0106001372fd1e07.vs.shawcable.net [70.71.171.106]) (authenticated bits=0) by sippysoft.com (8.13.8/8.13.8) with ESMTP id n0JHCkWM014595 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 19 Jan 2009 09:12:47 -0800 (PST) (envelope-from sobomax@FreeBSD.org) Message-ID: <4974B484.7030608@FreeBSD.org> Date: Mon, 19 Jan 2009 09:12:36 -0800 From: Maxim Sobolev Organization: Sippy Software, Inc. User-Agent: Thunderbird 2.0.0.19 (Windows/20081209) MIME-Version: 1.0 To: Sam Leffler References: <200901190710.n0J7ACSg001385@svn.freebsd.org> <497432A1.9060805@samsco.org> <497446D4.5020104@FreeBSD.org> <4974ABCC.7000107@freebsd.org> In-Reply-To: <4974ABCC.7000107@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r187426 - head/sys/amd64/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jan 2009 17:12:49 -0000 Sam Leffler wrote: > Maxim Sobolev wrote: >> Scott Long wrote: >>> prepare to be wrong. And above all else, don't put drivers into here >>> that you haven't tested. It's pretty silly to admit in your commit >>> message, for all to see, that you are blatantly committing without >>> testing. >> >> Actually this is interesting point, what the best strategy for us as >> the project should be? Should we new put drivers that have been tested >> on i386 only and don't have any particular reason to be i386-specific >> (i.e. ISA/EISA drivers, PCMCIA drivers etc) into amd64 GENERIC >> automatically and wait for somebody to report a problem, or stay on >> the safe side and enable drivers on amd64 only after somebody actually >> has tested them and confirms that they are working? Should this policy >> depend on driver class (for example a storage driver has much higher >> potential for screwing user's data compared to a network driver or a >> sound driver) and on release (HEAD / STABLE)? IMHO FreeBSD could >> benefit by putting at least non-storage untested non i386-specific >> drivers into amd64 kernel and/or at least in HEAD to give them testing >> and a wider exposure. >> >> This is not just idle interest for me - recently our company has >> started shipping amd64 version of our FreeBSD-based product, so that >> we are a little bit concerned about hardware support with amd64 7.1 >> kernel being a little bit narrower compared to i386 7.1 kernel. >> >> I apologize if this topic has been discussed somewhere already. > > I think the answer to your question about default-enabling drivers is > very clear: it is the decision of the person maintaining the driver. If > you're willing to SUPPORT a driver on a platform then feel free to > enable it. Otherwise doing a drive-by to enable a driver that may or > may not work may easily result in complaints that are unanswered. These > have resulted in people concluding wider breakage that easily becomes > de-facto and are hard to kill given that people google for help, find > old complaints, and stop searching. OK, makes sense. By the way, there is a question on this topic to you. The wi(4) has been removed from i386 GENERIC, but it is still present in amd64 GENERIC. Is it intentional or just a mistake? -Maxim From owner-svn-src-head@FreeBSD.ORG Mon Jan 19 17:20:09 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CFCFA1065672; Mon, 19 Jan 2009 17:20:09 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BF1348FC14; Mon, 19 Jan 2009 17:20:09 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0JHK9oW016561; Mon, 19 Jan 2009 17:20:09 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0JHK9IQ016560; Mon, 19 Jan 2009 17:20:09 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200901191720.n0JHK9IQ016560@svn.freebsd.org> From: Sam Leffler Date: Mon, 19 Jan 2009 17:20:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187442 - head/sys/i386/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jan 2009 17:20:10 -0000 Author: sam Date: Mon Jan 19 17:20:09 2009 New Revision: 187442 URL: http://svn.freebsd.org/changeset/base/187442 Log: re-enable wi: was accidentally disabled in r1.502 Modified: head/sys/i386/conf/GENERIC Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Mon Jan 19 17:17:32 2009 (r187441) +++ head/sys/i386/conf/GENERIC Mon Jan 19 17:20:09 2009 (r187442) @@ -275,7 +275,7 @@ device ath_hal # pci/cardbus chip supp options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors device ath_rate_sample # SampleRate tx rate control for ath device ral # Ralink Technology RT2500 wireless NICs. -#device wi # WaveLAN/Intersil/Symbol 802.11 wireless NICs. +device wi # WaveLAN/Intersil/Symbol 802.11 wireless NICs. #device wl # Older non 802.11 Wavelan wireless NIC. # Pseudo devices. From owner-svn-src-head@FreeBSD.ORG Mon Jan 19 17:33:40 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E945106568D; Mon, 19 Jan 2009 17:33:40 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:613:100::211]) by mx1.freebsd.org (Postfix) with ESMTP id 358288FC14; Mon, 19 Jan 2009 17:33:40 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: by palm.hoeg.nl (Postfix, from userid 1000) id 089F61CDC2; Mon, 19 Jan 2009 18:33:39 +0100 (CET) Date: Mon, 19 Jan 2009 18:33:39 +0100 From: Ed Schouten To: David O'Brien Message-ID: <20090119173339.GG1247@hoeg.nl> References: <200901161547.n0GFlZ4C012008@svn.freebsd.org> <20090117142021.92d5a40b.stas@FreeBSD.org> <20090119165030.GA18409@dragon.NUXI.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="iY5udFbGw2SsPZe4" Content-Disposition: inline In-Reply-To: <20090119165030.GA18409@dragon.NUXI.org> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: Stanislav Sedov , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Robert Watson Subject: Re: svn commit: r187332 - head/tools/regression/usr.bin/jot X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jan 2009 17:33:41 -0000 --iY5udFbGw2SsPZe4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * David O'Brien wrote: > Run VMware. Seriously. Or raise a serious discussion on developers@ > about this and get conciseness that cross building on MacOS X and > MS-Windows is a goal. It is not about cross compilation. Not being able to check out sources on a common used operating system makes little to no sense at all. An example: I never ever run Linux, but I do have the Git tree of the Linux kernel on one of my systems, so I can do some comparisons between certain FreeBSD and Linux features. This doesn't mean I want to cross compile Linux kernels on my FreeBSD system. I think it would be very useful if I could at least read FreeBSD sources on my laptop, instead of SSH'ing to my development box at home. --=20 Ed Schouten WWW: http://80386.nl/ --iY5udFbGw2SsPZe4 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkl0uXIACgkQ52SDGA2eCwX0OwCfe+ayiC/5Eo7SVtDa3PEw/CIR bYQAn1YWAnajLllka1zWg9otroxPFKOQ =BmHD -----END PGP SIGNATURE----- --iY5udFbGw2SsPZe4-- From owner-svn-src-head@FreeBSD.ORG Mon Jan 19 19:16:52 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35A131065711; Mon, 19 Jan 2009 19:16:51 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 430258FC1D; Mon, 19 Jan 2009 19:16:51 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0JJGpY8018960; Mon, 19 Jan 2009 19:16:51 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0JJGp5K018959; Mon, 19 Jan 2009 19:16:51 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200901191916.n0JJGp5K018959@svn.freebsd.org> From: Alexander Motin Date: Mon, 19 Jan 2009 19:16:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187445 - head/sys/dev/sound/pci/hda X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jan 2009 19:16:53 -0000 Author: mav Date: Mon Jan 19 19:16:50 2009 New Revision: 187445 URL: http://svn.freebsd.org/changeset/base/187445 Log: Add two more nVidia HDMI codec IDs. Modified: head/sys/dev/sound/pci/hda/hdac.c Modified: head/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.c Mon Jan 19 17:32:32 2009 (r187444) +++ head/sys/dev/sound/pci/hda/hdac.c Mon Jan 19 19:16:50 2009 (r187445) @@ -761,8 +761,10 @@ static const struct { /* NVIDIA */ #define HDA_CODEC_NVIDIAMCP78 HDA_CODEC_CONSTRUCT(NVIDIA, 0x0002) +#define HDA_CODEC_NVIDIAMCP78_2 HDA_CODEC_CONSTRUCT(NVIDIA, 0x0006) #define HDA_CODEC_NVIDIAMCP7A HDA_CODEC_CONSTRUCT(NVIDIA, 0x0007) #define HDA_CODEC_NVIDIAMCP67 HDA_CODEC_CONSTRUCT(NVIDIA, 0x0067) +#define HDA_CODEC_NVIDIAMCP73 HDA_CODEC_CONSTRUCT(NVIDIA, 0x8001) #define HDA_CODEC_NVIDIAXXXX HDA_CODEC_CONSTRUCT(NVIDIA, 0xffff) /* INTEL */ @@ -905,7 +907,9 @@ static const struct { { HDA_CODEC_ATIRS690, "ATI RS690/780 HDMI" }, { HDA_CODEC_ATIR6XX, "ATI R6xx HDMI" }, { HDA_CODEC_NVIDIAMCP67, "NVidia MCP67 HDMI" }, + { HDA_CODEC_NVIDIAMCP73, "NVidia MCP73 HDMI" }, { HDA_CODEC_NVIDIAMCP78, "NVidia MCP78 HDMI" }, + { HDA_CODEC_NVIDIAMCP78_2, "NVidia MCP78 HDMI" }, { HDA_CODEC_NVIDIAMCP7A, "NVidia MCP7A HDMI" }, { HDA_CODEC_INTELG45_1, "Intel G45 HDMI" }, { HDA_CODEC_INTELG45_2, "Intel G45 HDMI" }, From owner-svn-src-head@FreeBSD.ORG Mon Jan 19 21:22:10 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC4E91065674; Mon, 19 Jan 2009 21:22:10 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 998E68FC14; Mon, 19 Jan 2009 21:22:10 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0JLMAbj021611; Mon, 19 Jan 2009 21:22:10 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0JLMA57021610; Mon, 19 Jan 2009 21:22:10 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200901192122.n0JLMA57021610@svn.freebsd.org> From: Andrew Thompson Date: Mon, 19 Jan 2009 21:22:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187447 - head/sys/dev/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jan 2009 21:22:11 -0000 Author: thompsa Date: Mon Jan 19 21:22:10 2009 New Revision: 187447 URL: http://svn.freebsd.org/changeset/base/187447 Log: Set the pipe pointer before calling usbd_transfer() as its possible for the xfer callback to be invoked on error. MFC after: 2 weeks Modified: head/sys/dev/usb/usbdi.c Modified: head/sys/dev/usb/usbdi.c ============================================================================== --- head/sys/dev/usb/usbdi.c Mon Jan 19 21:10:04 2009 (r187446) +++ head/sys/dev/usb/usbdi.c Mon Jan 19 21:22:10 2009 (r187447) @@ -237,8 +237,8 @@ usbd_open_pipe_intr(usbd_interface_handl USBD_NO_TIMEOUT, cb); ipipe->intrxfer = xfer; ipipe->repeat = 1; - err = usbd_transfer(xfer); *pipe = ipipe; + err = usbd_transfer(xfer); if (err != USBD_IN_PROGRESS && err) goto bad2; return (USBD_NORMAL_COMPLETION); From owner-svn-src-head@FreeBSD.ORG Mon Jan 19 22:06:35 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 71BC41065674; Mon, 19 Jan 2009 22:06:35 +0000 (UTC) (envelope-from emax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5E9268FC26; Mon, 19 Jan 2009 22:06:35 +0000 (UTC) (envelope-from emax@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0JM6Z1C023097; Mon, 19 Jan 2009 22:06:35 GMT (envelope-from emax@svn.freebsd.org) Received: (from emax@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0JM6Znx023096; Mon, 19 Jan 2009 22:06:35 GMT (envelope-from emax@svn.freebsd.org) Message-Id: <200901192206.n0JM6Znx023096@svn.freebsd.org> From: Maksim Yevmenkin Date: Mon, 19 Jan 2009 22:06:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187454 - head/sys/netgraph/bluetooth/l2cap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jan 2009 22:06:36 -0000 Author: emax Date: Mon Jan 19 22:06:35 2009 New Revision: 187454 URL: http://svn.freebsd.org/changeset/base/187454 Log: Properly return error code to the caller. This should fix the following panic in ng_l2cap(4). panic: ng_l2cap_l2ca_con_req: ubt0l2cap - could not find connection! While i'm here get rid of few goto's. MFC after: 1 week Modified: head/sys/netgraph/bluetooth/l2cap/ng_l2cap_llpi.c Modified: head/sys/netgraph/bluetooth/l2cap/ng_l2cap_llpi.c ============================================================================== --- head/sys/netgraph/bluetooth/l2cap/ng_l2cap_llpi.c Mon Jan 19 21:49:46 2009 (r187453) +++ head/sys/netgraph/bluetooth/l2cap/ng_l2cap_llpi.c Mon Jan 19 22:06:35 2009 (r187454) @@ -116,10 +116,14 @@ ng_l2cap_lp_con_req(ng_l2cap_p l2cap, bd NG_SEND_MSG_HOOK(error, l2cap->node, msg, l2cap->hci, 0); if (error != 0) { - if ((error = ng_l2cap_lp_untimeout(con)) != 0) - return (error); + if (ng_l2cap_lp_untimeout(con) == 0) + ng_l2cap_free_con(con); - ng_l2cap_free_con(con); + /* + * Do not free connection if ng_l2cap_lp_untimeout() failed + * let timeout handler deal with it. Always return error to + * the caller. + */ } return (error); @@ -213,8 +217,8 @@ ng_l2cap_lp_con_ind(ng_l2cap_p l2cap, st NG_L2CAP_ALERT( "%s: %s - invalid LP_ConnectInd message size\n", __func__, NG_NODE_NAME(l2cap->node)); - error = EMSGSIZE; - goto out; + + return (EMSGSIZE); } ep = (ng_hci_lp_con_ind_ep *) (msg->data); @@ -227,8 +231,8 @@ ng_l2cap_lp_con_ind(ng_l2cap_p l2cap, st "Connection already exists, state=%d, con_handle=%d\n", __func__, NG_NODE_NAME(l2cap->node), con->state, con->con_handle); - error = EEXIST; - goto out; + + return (EEXIST); } /* Check if lower layer protocol is still connected */ @@ -236,24 +240,22 @@ ng_l2cap_lp_con_ind(ng_l2cap_p l2cap, st NG_L2CAP_ERR( "%s: %s - hook \"%s\" is not connected or valid", __func__, NG_NODE_NAME(l2cap->node), NG_L2CAP_HOOK_HCI); - error = ENOTCONN; - goto out; + + return (ENOTCONN); } /* Create and intialize new connection descriptor */ con = ng_l2cap_new_con(l2cap, &ep->bdaddr); - if (con == NULL) { - error = ENOMEM; - goto out; - } + if (con == NULL) + return (ENOMEM); /* Create and send LP_ConnectRsp event */ NG_MKMESSAGE(rsp, NGM_HCI_COOKIE, NGM_HCI_LP_CON_RSP, sizeof(*rp), M_NOWAIT); if (rsp == NULL) { ng_l2cap_free_con(con); - error = ENOMEM; - goto out; + + return (ENOMEM); } rp = (ng_hci_lp_con_rsp_ep *)(rsp->data); @@ -266,14 +268,18 @@ ng_l2cap_lp_con_ind(ng_l2cap_p l2cap, st NG_SEND_MSG_HOOK(error, l2cap->node, rsp, l2cap->hci, 0); if (error != 0) { - if ((error = ng_l2cap_lp_untimeout(con)) != 0) - goto out; + if (ng_l2cap_lp_untimeout(con) == 0) + ng_l2cap_free_con(con); - ng_l2cap_free_con(con); + /* + * Do not free connection if ng_l2cap_lp_untimeout() failed + * let timeout handler deal with it. Always return error to + * the caller. + */ } -out: + return (error); -} /* ng_hci_lp_con_ind */ +} /* ng_l2cap_lp_con_ind */ /* * Process LP_DisconnectInd event from the lower layer protocol. We have been From owner-svn-src-head@FreeBSD.ORG Mon Jan 19 23:25:18 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C20D2106564A; Mon, 19 Jan 2009 23:25:18 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B05C58FC17; Mon, 19 Jan 2009 23:25:18 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0JNPIgS024764; Mon, 19 Jan 2009 23:25:18 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0JNPIdr024763; Mon, 19 Jan 2009 23:25:18 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200901192325.n0JNPIdr024763@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 19 Jan 2009 23:25:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187455 - head/sys/powerpc/powermac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jan 2009 23:25:19 -0000 Author: nwhitehorn Date: Mon Jan 19 23:25:18 2009 New Revision: 187455 URL: http://svn.freebsd.org/changeset/base/187455 Log: Provide a device description for macio-attached ATA cells. Modified: head/sys/powerpc/powermac/ata_macio.c Modified: head/sys/powerpc/powermac/ata_macio.c ============================================================================== --- head/sys/powerpc/powermac/ata_macio.c Mon Jan 19 22:06:35 2009 (r187454) +++ head/sys/powerpc/powermac/ata_macio.c Mon Jan 19 23:25:18 2009 (r187455) @@ -164,9 +164,11 @@ ata_macio_probe(device_t dev) ch = &sc->sc_ch.sc_ch; if (strcmp(name,"ata-4") == 0) { + device_set_desc(dev,"Apple MacIO Ultra ATA Controller"); sc->rev = 4; sc->max_mode = ATA_UDMA4; } else { + device_set_desc(dev,"Apple MacIO ATA Controller"); sc->rev = 3; sc->max_mode = ATA_WDMA2; } From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 00:05:44 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C2E81065670; Tue, 20 Jan 2009 00:05:44 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0A7AF8FC16; Tue, 20 Jan 2009 00:05:44 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0K05hUC025669; Tue, 20 Jan 2009 00:05:43 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0K05hUG025667; Tue, 20 Jan 2009 00:05:43 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200901200005.n0K05hUG025667@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 20 Jan 2009 00:05:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187457 - in head/sys/dev: iicbus pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2009 00:05:44 -0000 Author: nwhitehorn Date: Tue Jan 20 00:05:43 2009 New Revision: 187457 URL: http://svn.freebsd.org/changeset/base/187457 Log: Change the probe priority for PCI and I2C generic bus modules from numerical constants to BUS_PROBE_GENERIC. Suggested by: jhb Modified: head/sys/dev/iicbus/iicbus.c head/sys/dev/pci/pci.c Modified: head/sys/dev/iicbus/iicbus.c ============================================================================== --- head/sys/dev/iicbus/iicbus.c Tue Jan 20 00:03:52 2009 (r187456) +++ head/sys/dev/iicbus/iicbus.c Tue Jan 20 00:05:43 2009 (r187457) @@ -55,7 +55,7 @@ iicbus_probe(device_t dev) device_set_desc(dev, "Philips I2C bus"); /* Allow other subclasses to override this driver. */ - return (-1000); + return (BUS_PROBE_GENERIC); } #if SCAN_IICBUS Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Tue Jan 20 00:03:52 2009 (r187456) +++ head/sys/dev/pci/pci.c Tue Jan 20 00:05:43 2009 (r187457) @@ -2644,7 +2644,7 @@ pci_probe(device_t dev) device_set_desc(dev, "PCI bus"); /* Allow other subclasses to override this driver. */ - return (-1000); + return (BUS_PROBE_GENERIC); } static int From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 01:08:45 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7EBC71065673; Tue, 20 Jan 2009 01:08:45 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 053FE8FC14; Tue, 20 Jan 2009 01:08:44 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id n0K17tYu082126; Mon, 19 Jan 2009 18:07:55 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Mon, 19 Jan 2009 18:08:30 -0700 (MST) Message-Id: <20090119.180830.1976921334.imp@bsdimp.com> To: sobomax@FreeBSD.org From: "M. Warner Losh" In-Reply-To: <497446D4.5020104@FreeBSD.org> References: <200901190710.n0J7ACSg001385@svn.freebsd.org> <497432A1.9060805@samsco.org> <497446D4.5020104@FreeBSD.org> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, scottl@samsco.org, src-committers@FreeBSD.org, svn-src-all@FreeBSD.org Subject: Re: svn commit: r187426 - head/sys/amd64/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2009 01:08:45 -0000 In message: <497446D4.5020104@FreeBSD.org> Maxim Sobolev writes: : i386 only and don't have any particular reason to be i386-specific (i.e. : ISA/EISA drivers, PCMCIA drivers etc) into amd64 GENERIC automatically Ahem. PC Card drivers are not, and never have been, i386 specific. At least not since we've moved to NEWCARD. You should remove that from the list of things that you think are processor specific. They have worked on amd64 for a long time, and there are likely to be a few new PC Card bridge drivers in the tree soon for non-x86 platforms. Warner From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 01:15:32 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 30C161065678; Tue, 20 Jan 2009 01:15:32 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id E3E438FC16; Tue, 20 Jan 2009 01:15:31 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id n0K1Cm5x082188; Mon, 19 Jan 2009 18:12:48 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Mon, 19 Jan 2009 18:13:22 -0700 (MST) Message-Id: <20090119.181322.-625070925.imp@bsdimp.com> To: sobomax@FreeBSD.org From: "M. Warner Losh" In-Reply-To: <200901191619.n0JGJrhJ015123@svn.freebsd.org> References: <200901191619.n0JGJrhJ015123@svn.freebsd.org> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r187437 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2009 01:15:33 -0000 In message: <200901191619.n0JGJrhJ015123@svn.freebsd.org> Maxim Sobolev writes: : Author: sobomax : Date: Mon Jan 19 16:19:53 2009 : New Revision: 187437 : URL: http://svn.freebsd.org/changeset/base/187437 : : Log: : Mention the fact that the NTFS kernel support isn't : very well maintained and point user to sysutils/fusefs-ntfs, which : at the time of this writing seems to be a better alternative. : : Suggested by: luigi : MFC after: 2 weeks Again, I'd not MFC this to 6.x for sure and maybe not even to 7.x since ntfs works well there. Warner : Modified: : head/sys/conf/NOTES : : Modified: head/sys/conf/NOTES : ============================================================================== : --- head/sys/conf/NOTES Mon Jan 19 15:59:05 2009 (r187436) : +++ head/sys/conf/NOTES Mon Jan 19 16:19:53 2009 (r187437) : @@ -942,7 +942,11 @@ options HPFS #OS/2 File system : options MSDOSFS #MS DOS File System (FAT, FAT32) : options NFSSERVER #Network File System server : options NFSLOCKD #Network Lock Manager : -options NTFS #NT File System : + : +# NT File System. Read-mostly and it's not actively maintained. : +# For a better NTFS support consider sysutils/fusefs-ntfs port/package. : +options NTFS : + : options NULLFS #NULL filesystem : # Broken (depends on NCP): : #options NWFS #NetWare filesystem : From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 01:15:33 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B12F0106567A; Tue, 20 Jan 2009 01:15:32 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 702648FC17; Tue, 20 Jan 2009 01:15:32 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id n0K1CEsl082184; Mon, 19 Jan 2009 18:12:14 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Mon, 19 Jan 2009 18:12:48 -0700 (MST) Message-Id: <20090119.181248.-1090025543.imp@bsdimp.com> To: sobomax@FreeBSD.org From: "M. Warner Losh" In-Reply-To: <200901191559.n0JFx5Dc014686@svn.freebsd.org> References: <200901191559.n0JFx5Dc014686@svn.freebsd.org> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r187436 - head/sbin/mount_ntfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2009 01:15:33 -0000 In message: <200901191559.n0JFx5Dc014686@svn.freebsd.org> Maxim Sobolev writes: : Author: sobomax : Date: Mon Jan 19 15:59:05 2009 : New Revision: 187436 : URL: http://svn.freebsd.org/changeset/base/187436 : : Log: : In the CAVEATS section mention the fact that the NTFS kernel support isn't : very well maintained and point user to sysutils/fusefs-ntfs, which : at the time of this writing seems to be a better alternative. : : Suggested by: luigi : : MFC after: 2 weeks I'd not MFC this. The 7.0 version worked a lot better for me than the fusefs-ntfs last time I had to do some non-trivial data recovery. The former just worked in the face of an insane number of read errors. The latter paniced the system frequently. Warner : Modified: : head/sbin/mount_ntfs/mount_ntfs.8 : : Modified: head/sbin/mount_ntfs/mount_ntfs.8 : ============================================================================== : --- head/sbin/mount_ntfs/mount_ntfs.8 Mon Jan 19 15:38:26 2009 (r187435) : +++ head/sbin/mount_ntfs/mount_ntfs.8 Mon Jan 19 15:59:05 2009 (r187436) : @@ -154,6 +154,12 @@ This utility is primarily used for read : See the : .Sx WRITING : section for details about writing to an NTFS volume. : +.Pp : +Apart from being read-mostly, the NTFS support in the : +.Fx : +kernel is not actively maintained. For any non-trivial use : +sysutils/fusefs-ntfs package, a more complete and better : +maintained alternative, is recommended instead. : .Sh HISTORY : The : .Nm : From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 01:15:33 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 46D381065674; Tue, 20 Jan 2009 01:15:33 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 00FE28FC1F; Tue, 20 Jan 2009 01:15:32 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id n0K1E1DR082191; Mon, 19 Jan 2009 18:14:01 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Mon, 19 Jan 2009 18:14:35 -0700 (MST) Message-Id: <20090119.181435.-298663465.imp@bsdimp.com> To: obrien@FreeBSD.org From: "M. Warner Losh" In-Reply-To: <20090119165030.GA18409@dragon.NUXI.org> References: <20090117142021.92d5a40b.stas@FreeBSD.org> <20090119165030.GA18409@dragon.NUXI.org> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, ed@FreeBSD.org, stas@FreeBSD.org, rwatson@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r187332 - head/tools/regression/usr.bin/jot X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2009 01:15:34 -0000 In message: <20090119165030.GA18409@dragon.NUXI.org> "David O'Brien" writes: : On Sat, Jan 17, 2009 at 02:00:55PM +0000, Robert Watson wrote: : > : > On Sat, 17 Jan 2009, Stanislav Sedov wrote: : > : >> Was this discussed somewhere? I don't understand why we should restrict : >> our filesystem naming because of limitation of auxilary filesystems. : >> There're even more restrictive filesystems available, we couldn't support : >> them all. While previous modifications looked harmless this one seems : >> questionable to me. : >> : >> I understand, this is a bikesched, but I really don't see a reason. You : >> can't build FreeBSD on windows anyway. : > : > Many of us would *very* much like to be able to cross-build FreeBSD from : > both Windows and Mac OS X, which would be highly desirable for embedded : > systems and appliance shops. : : Run VMware. Seriously. Or raise a serious discussion on developers@ : about this and get conciseness that cross building on MacOS X and : MS-Windows is a goal. I've tried this on my mac. It doesn't work very well at all, and it a pita for file sharing. Since there's little harm, and much benefit, why argue? Warner From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 01:18:18 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 04F7D1065673; Tue, 20 Jan 2009 01:18:18 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 99BFC8FC14; Tue, 20 Jan 2009 01:18:17 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id n0K1FWk1082230; Mon, 19 Jan 2009 18:15:32 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Mon, 19 Jan 2009 18:16:06 -0700 (MST) Message-Id: <20090119.181606.1887043661.imp@bsdimp.com> To: sobomax@freebsd.org From: "M. Warner Losh" In-Reply-To: <4974B484.7030608@FreeBSD.org> References: <497446D4.5020104@FreeBSD.org> <4974ABCC.7000107@freebsd.org> <4974B484.7030608@FreeBSD.org> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, sam@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r187426 - head/sys/amd64/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2009 01:18:18 -0000 In message: <4974B484.7030608@FreeBSD.org> Maxim Sobolev writes: : Sam Leffler wrote: : > Maxim Sobolev wrote: : >> Scott Long wrote: : >>> prepare to be wrong. And above all else, don't put drivers into here : >>> that you haven't tested. It's pretty silly to admit in your commit : >>> message, for all to see, that you are blatantly committing without : >>> testing. : >> : >> Actually this is interesting point, what the best strategy for us as : >> the project should be? Should we new put drivers that have been tested : >> on i386 only and don't have any particular reason to be i386-specific : >> (i.e. ISA/EISA drivers, PCMCIA drivers etc) into amd64 GENERIC : >> automatically and wait for somebody to report a problem, or stay on : >> the safe side and enable drivers on amd64 only after somebody actually : >> has tested them and confirms that they are working? Should this policy : >> depend on driver class (for example a storage driver has much higher : >> potential for screwing user's data compared to a network driver or a : >> sound driver) and on release (HEAD / STABLE)? IMHO FreeBSD could : >> benefit by putting at least non-storage untested non i386-specific : >> drivers into amd64 kernel and/or at least in HEAD to give them testing : >> and a wider exposure. : >> : >> This is not just idle interest for me - recently our company has : >> started shipping amd64 version of our FreeBSD-based product, so that : >> we are a little bit concerned about hardware support with amd64 7.1 : >> kernel being a little bit narrower compared to i386 7.1 kernel. : >> : >> I apologize if this topic has been discussed somewhere already. : > : > I think the answer to your question about default-enabling drivers is : > very clear: it is the decision of the person maintaining the driver. If : > you're willing to SUPPORT a driver on a platform then feel free to : > enable it. Otherwise doing a drive-by to enable a driver that may or : > may not work may easily result in complaints that are unanswered. These : > have resulted in people concluding wider breakage that easily becomes : > de-facto and are hard to kill given that people google for help, find : > old complaints, and stop searching. : : OK, makes sense. : : By the way, there is a question on this topic to you. The wi(4) has been : removed from i386 GENERIC, but it is still present in amd64 GENERIC. Is : it intentional or just a mistake? I'd remove it from amd64 too. It isn't terribly useful these days outside of open access points. Warner From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 01:22:56 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F04211065675; Tue, 20 Jan 2009 01:22:56 +0000 (UTC) (envelope-from obrien@NUXI.org) Received: from dragon.nuxi.org (trang.nuxi.org [74.95.12.85]) by mx1.freebsd.org (Postfix) with ESMTP id CED998FC1A; Tue, 20 Jan 2009 01:22:56 +0000 (UTC) (envelope-from obrien@NUXI.org) Received: from dragon.nuxi.org (obrien@localhost [127.0.0.1]) by dragon.nuxi.org (8.14.2/8.14.2) with ESMTP id n0K1MuEs030665; Mon, 19 Jan 2009 17:22:56 -0800 (PST) (envelope-from obrien@dragon.nuxi.org) Received: (from obrien@localhost) by dragon.nuxi.org (8.14.2/8.14.2/Submit) id n0K1MudR030664; Mon, 19 Jan 2009 17:22:56 -0800 (PST) (envelope-from obrien) Date: Mon, 19 Jan 2009 17:22:56 -0800 From: "David O'Brien" To: "M. Warner Losh" Message-ID: <20090120012256.GB29741@dragon.NUXI.org> References: <20090117142021.92d5a40b.stas@FreeBSD.org> <20090119165030.GA18409@dragon.NUXI.org> <20090119.181435.-298663465.imp@bsdimp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090119.181435.-298663465.imp@bsdimp.com> X-Operating-System: FreeBSD 8.0-CURRENT User-Agent: Mutt/1.5.16 (2007-06-09) Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, ed@FreeBSD.org, stas@FreeBSD.org, rwatson@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r187332 - head/tools/regression/usr.bin/jot X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: obrien@FreeBSD.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2009 01:22:57 -0000 On Mon, Jan 19, 2009 at 06:14:35PM -0700, M. Warner Losh wrote: > In message: <20090119165030.GA18409@dragon.NUXI.org> > "David O'Brien" writes: > : On Sat, Jan 17, 2009 at 02:00:55PM +0000, Robert Watson wrote: > : > > : > On Sat, 17 Jan 2009, Stanislav Sedov wrote: > : > > : >> Was this discussed somewhere? I don't understand why we should restrict > : >> our filesystem naming because of limitation of auxilary filesystems. > : >> There're even more restrictive filesystems available, we couldn't support > : >> them all. While previous modifications looked harmless this one seems > : >> questionable to me. > : >> > : >> I understand, this is a bikesched, but I really don't see a reason. You > : >> can't build FreeBSD on windows anyway. > : > > : > Many of us would *very* much like to be able to cross-build FreeBSD from > : > both Windows and Mac OS X, which would be highly desirable for embedded > : > systems and appliance shops. > : > : Run VMware. Seriously. Or raise a serious discussion on developers@ > : about this and get conciseness that cross building on MacOS X and > : MS-Windows is a goal. > > I've tried this on my mac. It doesn't work very well at all, and it a > pita for file sharing. Sorry - I don't quite follow. What is "it"? -- -- David (obrien@FreeBSD.org) From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 01:25:26 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0088B1065675; Tue, 20 Jan 2009 01:25:26 +0000 (UTC) (envelope-from obrien@NUXI.org) Received: from dragon.nuxi.org (trang.nuxi.org [74.95.12.85]) by mx1.freebsd.org (Postfix) with ESMTP id CFE5C8FC17; Tue, 20 Jan 2009 01:25:25 +0000 (UTC) (envelope-from obrien@NUXI.org) Received: from dragon.nuxi.org (obrien@localhost [127.0.0.1]) by dragon.nuxi.org (8.14.2/8.14.2) with ESMTP id n0K1PPqi030709; Mon, 19 Jan 2009 17:25:25 -0800 (PST) (envelope-from obrien@dragon.nuxi.org) Received: (from obrien@localhost) by dragon.nuxi.org (8.14.2/8.14.2/Submit) id n0K1PPJb030708; Mon, 19 Jan 2009 17:25:25 -0800 (PST) (envelope-from obrien) Date: Mon, 19 Jan 2009 17:25:25 -0800 From: "David O'Brien" To: Robert Watson Message-ID: <20090120012525.GC29741@dragon.NUXI.org> References: <200901161547.n0GFlZ4C012008@svn.freebsd.org> <20090117142021.92d5a40b.stas@FreeBSD.org> <20090119165030.GA18409@dragon.NUXI.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD 8.0-CURRENT User-Agent: Mutt/1.5.16 (2007-06-09) Cc: Stanislav Sedov , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Ed Schouten Subject: Re: svn commit: r187332 - head/tools/regression/usr.bin/jot X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: obrien@FreeBSD.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2009 01:25:26 -0000 On Mon, Jan 19, 2009 at 04:55:04PM +0000, Robert Watson wrote: > On Mon, 19 Jan 2009, David O'Brien wrote: >> For changes like this to be reasoned because of building FreeBSD on >> Windows there should consensus. For MacOS X - there is a case sensitive >> FS. > > So I have to reformat my Mac OS X file systems in order to check out > FreeBSD source trees on them because the jot(1) regression test relies on > having two files in the same directory that differ only in case? :-) No Does it really prevent one from checking out the sources - the file name collision should just cause a file to be overwritten. This case should only be an issue if you're trying to run the tests. > one is saying you should be able to check out FreeBSD source trees using > 8.3 DOS filenames, but I think avoiding case collisions makes a lot of > sense. Its built-in to our UNIX fiber - some source bases have both .c and .C files for instance. -- -- David (obrien@FreeBSD.org) From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 01:33:19 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A84B1065675; Tue, 20 Jan 2009 01:33:19 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from ebb.errno.com (ebb.errno.com [69.12.149.25]) by mx1.freebsd.org (Postfix) with ESMTP id D62BF8FC1F; Tue, 20 Jan 2009 01:33:18 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from trouble.errno.com (trouble.errno.com [10.0.0.248]) (authenticated bits=0) by ebb.errno.com (8.13.6/8.12.6) with ESMTP id n0K1XFqB062616 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 19 Jan 2009 17:33:16 -0800 (PST) (envelope-from sam@freebsd.org) Message-ID: <497529DB.5050903@freebsd.org> Date: Mon, 19 Jan 2009 17:33:15 -0800 From: Sam Leffler Organization: FreeBSD Project User-Agent: Thunderbird 2.0.0.18 (X11/20081209) MIME-Version: 1.0 To: "M. Warner Losh" References: <497446D4.5020104@FreeBSD.org> <4974ABCC.7000107@freebsd.org> <4974B484.7030608@FreeBSD.org> <20090119.181606.1887043661.imp@bsdimp.com> In-Reply-To: <20090119.181606.1887043661.imp@bsdimp.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-DCC-sonic.net-Metrics: ebb.errno.com; whitelist Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r187426 - head/sys/amd64/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2009 01:33:19 -0000 M. Warner Losh wrote: > In message: <4974B484.7030608@FreeBSD.org> > Maxim Sobolev writes: > : Sam Leffler wrote: > : > Maxim Sobolev wrote: > : >> Scott Long wrote: > : >>> prepare to be wrong. And above all else, don't put drivers into here > : >>> that you haven't tested. It's pretty silly to admit in your commit > : >>> message, for all to see, that you are blatantly committing without > : >>> testing. > : >> > : >> Actually this is interesting point, what the best strategy for us as > : >> the project should be? Should we new put drivers that have been tested > : >> on i386 only and don't have any particular reason to be i386-specific > : >> (i.e. ISA/EISA drivers, PCMCIA drivers etc) into amd64 GENERIC > : >> automatically and wait for somebody to report a problem, or stay on > : >> the safe side and enable drivers on amd64 only after somebody actually > : >> has tested them and confirms that they are working? Should this policy > : >> depend on driver class (for example a storage driver has much higher > : >> potential for screwing user's data compared to a network driver or a > : >> sound driver) and on release (HEAD / STABLE)? IMHO FreeBSD could > : >> benefit by putting at least non-storage untested non i386-specific > : >> drivers into amd64 kernel and/or at least in HEAD to give them testing > : >> and a wider exposure. > : >> > : >> This is not just idle interest for me - recently our company has > : >> started shipping amd64 version of our FreeBSD-based product, so that > : >> we are a little bit concerned about hardware support with amd64 7.1 > : >> kernel being a little bit narrower compared to i386 7.1 kernel. > : >> > : >> I apologize if this topic has been discussed somewhere already. > : > > : > I think the answer to your question about default-enabling drivers is > : > very clear: it is the decision of the person maintaining the driver. If > : > you're willing to SUPPORT a driver on a platform then feel free to > : > enable it. Otherwise doing a drive-by to enable a driver that may or > : > may not work may easily result in complaints that are unanswered. These > : > have resulted in people concluding wider breakage that easily becomes > : > de-facto and are hard to kill given that people google for help, find > : > old complaints, and stop searching. > : > : OK, makes sense. > : > : By the way, there is a question on this topic to you. The wi(4) has been > : removed from i386 GENERIC, but it is still present in amd64 GENERIC. Is > : it intentional or just a mistake? > > I'd remove it from amd64 too. It isn't terribly useful these days > outside of open access points. > > Er that's not true; wi supports WPA w/ the cards it works with. And it does WPA w/ hostap too. If someone wanted to make an effort the set of cards it supports could also be brought back to where it was before I took an axe to the code (though older cards wouldn't support WPA). Sam From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 01:42:56 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A98FB106564A; Tue, 20 Jan 2009 01:42:56 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from sippysoft.com (gk1.360sip.com [72.236.70.240]) by mx1.freebsd.org (Postfix) with ESMTP id 70E168FC1F; Tue, 20 Jan 2009 01:42:56 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from [192.168.1.38] (S0106001372fd1e07.vs.shawcable.net [70.71.171.106]) (authenticated bits=0) by sippysoft.com (8.13.8/8.13.8) with ESMTP id n0K1gp9f040532 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 19 Jan 2009 17:42:52 -0800 (PST) (envelope-from sobomax@FreeBSD.org) Message-ID: <49752C10.5010309@FreeBSD.org> Date: Mon, 19 Jan 2009 17:42:40 -0800 From: Maxim Sobolev Organization: Sippy Software, Inc. User-Agent: Thunderbird 2.0.0.19 (Windows/20081209) MIME-Version: 1.0 To: "M. Warner Losh" References: <200901190710.n0J7ACSg001385@svn.freebsd.org> <497432A1.9060805@samsco.org> <497446D4.5020104@FreeBSD.org> <20090119.180830.1976921334.imp@bsdimp.com> In-Reply-To: <20090119.180830.1976921334.imp@bsdimp.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, scottl@samsco.org, src-committers@FreeBSD.org, svn-src-all@FreeBSD.org Subject: Re: svn commit: r187426 - head/sys/amd64/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2009 01:42:57 -0000 M. Warner Losh wrote: > In message: <497446D4.5020104@FreeBSD.org> > Maxim Sobolev writes: > : i386 only and don't have any particular reason to be i386-specific (i.e. > : ISA/EISA drivers, PCMCIA drivers etc) into amd64 GENERIC automatically > > Ahem. PC Card drivers are not, and never have been, i386 specific. > At least not since we've moved to NEWCARD. You should remove that > from the list of things that you think are processor specific. They > have worked on amd64 for a long time, and there are likely to be a few > new PC Card bridge drivers in the tree soon for non-x86 platforms. Well, I supposed it was the reason why few SCSI cards were in i386 kernel, but weren't in amd64. Perhaps I was wrong. I am talking about these: device ncv # NCR 53C500 device nsp # Workbit Ninja SCSI-3 device stg # TMC 18C30/18C50 Perhaps the reason is just that nobody has the hardware to test on amd64. -Maxim From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 02:08:21 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D393C1065672; Tue, 20 Jan 2009 02:08:21 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C31BC8FC1E; Tue, 20 Jan 2009 02:08:21 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0K28LhJ029428; Tue, 20 Jan 2009 02:08:21 GMT (envelope-from sobomax@svn.freebsd.org) Received: (from sobomax@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0K28LBS029426; Tue, 20 Jan 2009 02:08:21 GMT (envelope-from sobomax@svn.freebsd.org) Message-Id: <200901200208.n0K28LBS029426@svn.freebsd.org> From: Maxim Sobolev Date: Tue, 20 Jan 2009 02:08:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187459 - in head: sbin/mount_ntfs sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2009 02:08:22 -0000 Author: sobomax Date: Tue Jan 20 02:08:21 2009 New Revision: 187459 URL: http://svn.freebsd.org/changeset/base/187459 Log: Tone down warning about the quality of the NTFS VFS module. It appears that not all developers share luigi opinion about quality of sysutils/fusefs-ntfs compared to our kernel NTFS module. Modified: head/sbin/mount_ntfs/mount_ntfs.8 head/sys/conf/NOTES Modified: head/sbin/mount_ntfs/mount_ntfs.8 ============================================================================== --- head/sbin/mount_ntfs/mount_ntfs.8 Tue Jan 20 01:54:05 2009 (r187458) +++ head/sbin/mount_ntfs/mount_ntfs.8 Tue Jan 20 02:08:21 2009 (r187459) @@ -155,11 +155,8 @@ See the .Sx WRITING section for details about writing to an NTFS volume. .Pp -Apart from being read-mostly, the NTFS support in the -.Fx -kernel is not actively maintained. For any non-trivial use -sysutils/fusefs-ntfs package, a more complete and better -maintained alternative, is recommended instead. +For a full read-write NTFS support consider sysutils/fusefs-ntfs +port/package. .Sh HISTORY The .Nm Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Tue Jan 20 01:54:05 2009 (r187458) +++ head/sys/conf/NOTES Tue Jan 20 02:08:21 2009 (r187459) @@ -943,8 +943,9 @@ options MSDOSFS #MS DOS File System ( options NFSSERVER #Network File System server options NFSLOCKD #Network Lock Manager -# NT File System. Read-mostly and it's not actively maintained. -# For a better NTFS support consider sysutils/fusefs-ntfs port/package. +# NT File System. Read-mostly, see mount_ntfs(8) for details. +# For a full read-write NTFS support consider sysutils/fusefs-ntfs +# port/package. options NTFS options NULLFS #NULL filesystem From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 02:15:17 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B5AD1065670; Tue, 20 Jan 2009 02:15:17 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id AEEFD8FC08; Tue, 20 Jan 2009 02:15:16 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id n0K2DvjI082925; Mon, 19 Jan 2009 19:13:57 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Mon, 19 Jan 2009 19:14:32 -0700 (MST) Message-Id: <20090119.191432.-2040405057.imp@bsdimp.com> To: sam@FreeBSD.org From: "M. Warner Losh" In-Reply-To: <497529DB.5050903@freebsd.org> References: <4974B484.7030608@FreeBSD.org> <20090119.181606.1887043661.imp@bsdimp.com> <497529DB.5050903@freebsd.org> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r187426 - head/sys/amd64/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2009 02:15:17 -0000 In message: <497529DB.5050903@freebsd.org> Sam Leffler writes: : M. Warner Losh wrote: : > In message: <4974B484.7030608@FreeBSD.org> : > Maxim Sobolev writes: : > : Sam Leffler wrote: : > : > Maxim Sobolev wrote: : > : >> Scott Long wrote: : > : >>> prepare to be wrong. And above all else, don't put drivers into here : > : >>> that you haven't tested. It's pretty silly to admit in your commit : > : >>> message, for all to see, that you are blatantly committing without : > : >>> testing. : > : >> : > : >> Actually this is interesting point, what the best strategy for us as : > : >> the project should be? Should we new put drivers that have been tested : > : >> on i386 only and don't have any particular reason to be i386-specific : > : >> (i.e. ISA/EISA drivers, PCMCIA drivers etc) into amd64 GENERIC : > : >> automatically and wait for somebody to report a problem, or stay on : > : >> the safe side and enable drivers on amd64 only after somebody actually : > : >> has tested them and confirms that they are working? Should this policy : > : >> depend on driver class (for example a storage driver has much higher : > : >> potential for screwing user's data compared to a network driver or a : > : >> sound driver) and on release (HEAD / STABLE)? IMHO FreeBSD could : > : >> benefit by putting at least non-storage untested non i386-specific : > : >> drivers into amd64 kernel and/or at least in HEAD to give them testing : > : >> and a wider exposure. : > : >> : > : >> This is not just idle interest for me - recently our company has : > : >> started shipping amd64 version of our FreeBSD-based product, so that : > : >> we are a little bit concerned about hardware support with amd64 7.1 : > : >> kernel being a little bit narrower compared to i386 7.1 kernel. : > : >> : > : >> I apologize if this topic has been discussed somewhere already. : > : > : > : > I think the answer to your question about default-enabling drivers is : > : > very clear: it is the decision of the person maintaining the driver. If : > : > you're willing to SUPPORT a driver on a platform then feel free to : > : > enable it. Otherwise doing a drive-by to enable a driver that may or : > : > may not work may easily result in complaints that are unanswered. These : > : > have resulted in people concluding wider breakage that easily becomes : > : > de-facto and are hard to kill given that people google for help, find : > : > old complaints, and stop searching. : > : : > : OK, makes sense. : > : : > : By the way, there is a question on this topic to you. The wi(4) has been : > : removed from i386 GENERIC, but it is still present in amd64 GENERIC. Is : > : it intentional or just a mistake? : > : > I'd remove it from amd64 too. It isn't terribly useful these days : > outside of open access points. : > : > : Er that's not true; wi supports WPA w/ the cards it works with. And it : does WPA w/ hostap too. If someone wanted to make an effort the set of : cards it supports could also be brought back to where it was before I : took an axe to the code (though older cards wouldn't support WPA). You are correct. My cards have old crummy firmware on them, and what I said is true about them. Most of the wi cards can support it, but most (many?) of them have firmware that lacks this. The firmware is available, and loading it into RAM isn't a huge deal. Just a tedious one to get right... Warner From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 02:15:17 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4C58106564A; Tue, 20 Jan 2009 02:15:17 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 52A868FC0C; Tue, 20 Jan 2009 02:15:17 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id n0K2C43r082916; Mon, 19 Jan 2009 19:12:04 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Mon, 19 Jan 2009 19:12:38 -0700 (MST) Message-Id: <20090119.191238.1389906774.imp@bsdimp.com> To: obrien@FreeBSD.org From: "M. Warner Losh" In-Reply-To: <20090120012256.GB29741@dragon.NUXI.org> References: <20090119165030.GA18409@dragon.NUXI.org> <20090119.181435.-298663465.imp@bsdimp.com> <20090120012256.GB29741@dragon.NUXI.org> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, ed@FreeBSD.org, stas@FreeBSD.org, rwatson@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r187332 - head/tools/regression/usr.bin/jot X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2009 02:15:18 -0000 In message: <20090120012256.GB29741@dragon.NUXI.org> "David O'Brien" writes: : On Mon, Jan 19, 2009 at 06:14:35PM -0700, M. Warner Losh wrote: : > In message: <20090119165030.GA18409@dragon.NUXI.org> : > "David O'Brien" writes: : > : On Sat, Jan 17, 2009 at 02:00:55PM +0000, Robert Watson wrote: : > : > : > : > On Sat, 17 Jan 2009, Stanislav Sedov wrote: : > : > : > : >> Was this discussed somewhere? I don't understand why we should restrict : > : >> our filesystem naming because of limitation of auxilary filesystems. : > : >> There're even more restrictive filesystems available, we couldn't support : > : >> them all. While previous modifications looked harmless this one seems : > : >> questionable to me. : > : >> : > : >> I understand, this is a bikesched, but I really don't see a reason. You : > : >> can't build FreeBSD on windows anyway. : > : > : > : > Many of us would *very* much like to be able to cross-build FreeBSD from : > : > both Windows and Mac OS X, which would be highly desirable for embedded : > : > systems and appliance shops. : > : : > : Run VMware. Seriously. Or raise a serious discussion on developers@ : > : about this and get conciseness that cross building on MacOS X and : > : MS-Windows is a goal. : > : > I've tried this on my mac. It doesn't work very well at all, and it a : > pita for file sharing. : : Sorry - I don't quite follow. What is "it"? The point I've made several times: minor renaming isn't much of a pain. It has big benefits to those people that wish to use other file systems that have different restrictions than we have. Yelling 'run a VM' isn't a productive suggestion, frankly, and given the low level of pain for a rename, shouldn't be yelled at all. I'm glad JUNOS can build inside its own VM. Kudos. But given that the world is much more than a tightly controlled development environment at a well funded company, I think that we need to be more accommodating. Especially for the embedded world. While a 'vm solution' is OK for today, I think it is too short-sighted and leaves some significant opportunities on the table. We shouldn't, as a project, say "nothing can change at all" for these systems. Rather, we should do a cost benefit analysis. For renaming, the cost seems very low, and the benefit seems very large. For other things, we'll cross that bridge when we come to it... Warner From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 02:18:20 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C8288106566B; Tue, 20 Jan 2009 02:18:20 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 86A4E8FC14; Tue, 20 Jan 2009 02:18:20 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id n0K2FJLx082958; Mon, 19 Jan 2009 19:15:20 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Mon, 19 Jan 2009 19:15:54 -0700 (MST) Message-Id: <20090119.191554.511539281.imp@bsdimp.com> To: sobomax@FreeBSD.org From: "M. Warner Losh" In-Reply-To: <49752C10.5010309@FreeBSD.org> References: <497446D4.5020104@FreeBSD.org> <20090119.180830.1976921334.imp@bsdimp.com> <49752C10.5010309@FreeBSD.org> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, scottl@samsco.org, src-committers@FreeBSD.org, svn-src-all@FreeBSD.org Subject: Re: svn commit: r187426 - head/sys/amd64/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2009 02:18:21 -0000 In message: <49752C10.5010309@FreeBSD.org> Maxim Sobolev writes: : M. Warner Losh wrote: : > In message: <497446D4.5020104@FreeBSD.org> : > Maxim Sobolev writes: : > : i386 only and don't have any particular reason to be i386-specific (i.e. : > : ISA/EISA drivers, PCMCIA drivers etc) into amd64 GENERIC automatically : > : > Ahem. PC Card drivers are not, and never have been, i386 specific. : > At least not since we've moved to NEWCARD. You should remove that : > from the list of things that you think are processor specific. They : > have worked on amd64 for a long time, and there are likely to be a few : > new PC Card bridge drivers in the tree soon for non-x86 platforms. : : Well, I supposed it was the reason why few SCSI cards were in i386 : kernel, but weren't in amd64. Perhaps I was wrong. I am talking about these: : : device ncv # NCR 53C500 : device nsp # Workbit Ninja SCSI-3 : device stg # TMC 18C30/18C50 : : Perhaps the reason is just that nobody has the hardware to test on amd64. Correct. Those drivers have issues with amd64, or did when I did some quick tests. I never revisited them because they are for fairly slow cards to start with. They did work for me when I tried them on i386 last. Of course none of them have been tested by me since about the 7.0 branch. Warner From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 02:38:57 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 959B41065670; Tue, 20 Jan 2009 02:38:57 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.freebsd.org (Postfix) with ESMTP id 29B818FC13; Tue, 20 Jan 2009 02:38:56 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from [10.81.187.172] (mobile-032-152-135-071.mycingular.net [32.152.135.71] (may be forged)) (authenticated bits=0) by pooker.samsco.org (8.14.2/8.14.2) with ESMTP id n0K2cLAd040685; Mon, 19 Jan 2009 19:38:50 -0700 (MST) (envelope-from scottl@samsco.org) References: <497446D4.5020104@FreeBSD.org> <20090119.180830.1976921334.imp@bsdimp.com> <49752C10.5010309@FreeBSD.org> <20090119.191554.511539281.imp@bsdimp.com> Message-Id: From: Scott Long To: "M. Warner Losh" In-Reply-To: <20090119.191554.511539281.imp@bsdimp.com> Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Mailer: iPhone Mail (5G77) Mime-Version: 1.0 (iPhone Mail 5G77) Date: Mon, 19 Jan 2009 19:38:10 -0700 X-Spam-Status: No, score=-2.6 required=3.8 tests=BAYES_00 autolearn=ham version=3.1.8 X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on pooker.samsco.org Cc: "svn-src-head@FreeBSD.org" , "sobomax@FreeBSD.org" , "svn-src-all@FreeBSD.org" , "src-committers@FreeBSD.org" Subject: Re: svn commit: r187426 - head/sys/amd64/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2009 02:38:58 -0000 I thought that at least some ofvthese SCSI cards were specific to pc98, which is exclusively 32bit on freebsd. Scott Sent from my iPhone On Jan 19, 2009, at 7:15 PM, "M. Warner Losh" wrote: > In message: <49752C10.5010309@FreeBSD.org> > Maxim Sobolev writes: > : M. Warner Losh wrote: > : > In message: <497446D4.5020104@FreeBSD.org> > : > Maxim Sobolev writes: > : > : i386 only and don't have any particular reason to be i386- > specific (i.e. > : > : ISA/EISA drivers, PCMCIA drivers etc) into amd64 GENERIC > automatically > : > > : > Ahem. PC Card drivers are not, and never have been, i386 > specific. > : > At least not since we've moved to NEWCARD. You should remove that > : > from the list of things that you think are processor specific. > They > : > have worked on amd64 for a long time, and there are likely to be > a few > : > new PC Card bridge drivers in the tree soon for non-x86 platforms. > : > : Well, I supposed it was the reason why few SCSI cards were in i386 > : kernel, but weren't in amd64. Perhaps I was wrong. I am talking > about these: > : > : device ncv # NCR 53C500 > : device nsp # Workbit Ninja SCSI-3 > : device stg # TMC 18C30/18C50 > : > : Perhaps the reason is just that nobody has the hardware to test on > amd64. > > Correct. Those drivers have issues with amd64, or did when I did some > quick tests. I never revisited them because they are for fairly slow > cards to start with. They did work for me when I tried them on i386 > last. Of course none of them have been tested by me since about the > 7.0 branch. > > Warner From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 03:23:54 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 08B4C106567E; Tue, 20 Jan 2009 03:23:54 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id A33108FC24; Tue, 20 Jan 2009 03:23:53 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id n0K3NAjx083827; Mon, 19 Jan 2009 20:23:11 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Mon, 19 Jan 2009 20:23:45 -0700 (MST) Message-Id: <20090119.202345.282867277.imp@bsdimp.com> To: scottl@samsco.org From: "M. Warner Losh" In-Reply-To: References: <49752C10.5010309@FreeBSD.org> <20090119.191554.511539281.imp@bsdimp.com> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, sobomax@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r187426 - head/sys/amd64/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2009 03:23:55 -0000 In message: Scott Long writes: : I thought that at least some ofvthese SCSI cards were specific to : pc98, which is exclusively 32bit on freebsd. No. they aren't. They all work on vanilla i386. some are marketed to that segment, and there is one network card that is pc98 only. However, the rest work on FreeBSD/i386. Warner From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 04:21:22 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 134F1106566B; Tue, 20 Jan 2009 04:21:22 +0000 (UTC) (envelope-from mckay@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B78AE8FC27; Tue, 20 Jan 2009 04:21:21 +0000 (UTC) (envelope-from mckay@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0K4LLgC032324; Tue, 20 Jan 2009 04:21:21 GMT (envelope-from mckay@svn.freebsd.org) Received: (from mckay@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0K4LLJ6032323; Tue, 20 Jan 2009 04:21:21 GMT (envelope-from mckay@svn.freebsd.org) Message-Id: <200901200421.n0K4LLJ6032323@svn.freebsd.org> From: Stephen McKay Date: Tue, 20 Jan 2009 04:21:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187460 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2009 04:21:22 -0000 Author: mckay Date: Tue Jan 20 04:21:21 2009 New Revision: 187460 URL: http://svn.freebsd.org/changeset/base/187460 Log: Add a limit on namecache entries. In normal operation, the number of cache entries is roughly equal to the number of active vnodes. However, when most of the recently accessed vnodes have many hard links, the number of cache entries can be 32000 times as large, exhausting kernel memory and provoking a panic in kmem_malloc(). MFC after: 2 weeks Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Tue Jan 20 02:08:21 2009 (r187459) +++ head/sys/kern/vfs_cache.c Tue Jan 20 04:21:21 2009 (r187460) @@ -489,6 +489,12 @@ cache_enter(dvp, vp, cnp) if (!doingcache) return; + /* + * Avoid blowout in namecache entries. + */ + if (numcache >= desiredvnodes * 2) + return; + if (cnp->cn_nameptr[0] == '.') { if (cnp->cn_namelen == 1) { return; From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 06:48:13 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00D0E106564A; Tue, 20 Jan 2009 06:48:13 +0000 (UTC) (envelope-from kientzle@freebsd.org) Received: from kientzle.com (kientzle.com [66.166.149.50]) by mx1.freebsd.org (Postfix) with ESMTP id C7D0D8FC17; Tue, 20 Jan 2009 06:48:12 +0000 (UTC) (envelope-from kientzle@freebsd.org) Received: from [10.123.2.23] (h-66-166-149-52.snvacaid.covad.net [66.166.149.52]) by kientzle.com (8.12.9/8.12.9) with ESMTP id n0K6F7C1069219; Mon, 19 Jan 2009 22:15:07 -0800 (PST) (envelope-from kientzle@freebsd.org) Message-ID: <49756BE8.2010607@freebsd.org> Date: Mon, 19 Jan 2009 22:15:04 -0800 From: Tim Kientzle User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.12) Gecko/20060422 X-Accept-Language: en-us, en MIME-Version: 1.0 To: obrien@freebsd.org References: <200901161547.n0GFlZ4C012008@svn.freebsd.org> <20090117142021.92d5a40b.stas@FreeBSD.org> <20090119165030.GA18409@dragon.NUXI.org> <20090120012525.GC29741@dragon.NUXI.org> In-Reply-To: <20090120012525.GC29741@dragon.NUXI.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Robert Watson Subject: Re: svn commit: r187332 - head/tools/regression/usr.bin/jot X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2009 06:48:13 -0000 David O'Brien wrote: > On Mon, Jan 19, 2009 at 04:55:04PM +0000, Robert Watson wrote: > >>So I have to reformat my Mac OS X file systems in order to check out >>FreeBSD source trees on them because the jot(1) regression test relies on >>having two files in the same directory that differ only in case? :-) No > > Does it really prevent one from checking out the sources - the file name > collision should just cause a file to be overwritten. Last time I tried this, it actually caused the checkout to stop when it hit the case conflict. (Though the error message was far from clear.) You can work around this with partial checkouts, but it requires some care. Tim From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 08:55:32 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E812B106567F; Tue, 20 Jan 2009 08:55:32 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from mail-bw0-f11.google.com (mail-bw0-f11.google.com [209.85.218.11]) by mx1.freebsd.org (Postfix) with ESMTP id 954BD8FC1F; Tue, 20 Jan 2009 08:55:31 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: by bwz4 with SMTP id 4so77511bwz.19 for ; Tue, 20 Jan 2009 00:55:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=w3ZPU+cTTwaTJD71JMvNBI4DzHOitOHNnXi61o3iMUI=; b=b+42PIrKBUtMapJzTeNrQxqyGyR5O1EfLQcvzdsIJ6J8ALH7/F80EC/TWKnon6/QZK cGcGqXQpK3+xR0HsSUWvHLtcHmrK7OBRkiHXqvyfCv79mn3kuEmtpadnj5Mb6hMGnC6w E6e4OUd7to9kKofsP3SBHm5fSbnbyAJHdkf+4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=tLQfdRBGvh8ITPXENZ3hY8rQbaellCxvLwcvAAz6EZacW5tvzaRb7+m9RQVGBy8XMs Jf5ZTki1mFxik9G8KI47/UdheB4HZZCucG7C6scSHMTBZqhGz+kDdardonxuoQ7vGpAi WRoMzOjI3emGbz8c1HFDgijZ9aKp0tHAsy7ws= MIME-Version: 1.0 Received: by 10.181.201.18 with SMTP id d18mr2411178bkq.72.1232441548640; Tue, 20 Jan 2009 00:52:28 -0800 (PST) In-Reply-To: <20090119.181322.-625070925.imp@bsdimp.com> References: <200901191619.n0JGJrhJ015123@svn.freebsd.org> <20090119.181322.-625070925.imp@bsdimp.com> Date: Tue, 20 Jan 2009 00:52:28 -0800 Message-ID: <7d6fde3d0901200052w20755420l94f0c02c547f53b7@mail.gmail.com> From: Garrett Cooper To: "M. Warner Losh" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, sobomax@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r187437 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2009 08:55:33 -0000 On Mon, Jan 19, 2009 at 5:13 PM, M. Warner Losh wrote: > In message: <200901191619.n0JGJrhJ015123@svn.freebsd.org> > Maxim Sobolev writes: > : Author: sobomax > : Date: Mon Jan 19 16:19:53 2009 > : New Revision: 187437 > : URL: http://svn.freebsd.org/changeset/base/187437 > : > : Log: > : Mention the fact that the NTFS kernel support isn't > : very well maintained and point user to sysutils/fusefs-ntfs, which > : at the time of this writing seems to be a better alternative. > : > : Suggested by: luigi > : MFC after: 2 weeks > > Again, I'd not MFC this to 6.x for sure and maybe not even to 7.x > since ntfs works well there. > > Warner > > : Modified: > : head/sys/conf/NOTES > : > : Modified: head/sys/conf/NOTES > : ============================================================================== > : --- head/sys/conf/NOTES Mon Jan 19 15:59:05 2009 (r187436) > : +++ head/sys/conf/NOTES Mon Jan 19 16:19:53 2009 (r187437) > : @@ -942,7 +942,11 @@ options HPFS #OS/2 File system > : options MSDOSFS #MS DOS File System (FAT, FAT32) > : options NFSSERVER #Network File System server > : options NFSLOCKD #Network Lock Manager > : -options NTFS #NT File System > : + > : +# NT File System. Read-mostly and it's not actively maintained. > : +# For a better NTFS support consider sysutils/fusefs-ntfs port/package. > : +options NTFS > : + > : options NULLFS #NULL filesystem > : # Broken (depends on NCP): > : #options NWFS #NetWare filesystem Uh, I got consistent panics on 7.x when mounting NTFS partitions created with XP. I was creating the partition without MSDOS 8.3 short filename support though. I personally think that the copy of NTFS in the kernel is stale and unusable for a lot of different use-cases, to be honest.. -Garrett From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 10:09:44 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09B03106564A; Tue, 20 Jan 2009 10:09:44 +0000 (UTC) (envelope-from outi@bytephobia.de) Received: from dd18312.kasserver.com (dd18312.kasserver.com [85.13.138.194]) by mx1.freebsd.org (Postfix) with ESMTP id B884B8FC0C; Tue, 20 Jan 2009 10:09:43 +0000 (UTC) (envelope-from outi@bytephobia.de) Received: from attini-ws2 (pD9E37346.dip.t-dialin.net [217.227.115.70]) by dd18312.kasserver.com (Postfix) with ESMTP id A306218405417; Tue, 20 Jan 2009 10:46:15 +0100 (CET) Date: Tue, 20 Jan 2009 10:46:12 +0100 From: Patrick Hurrelmann To: John Baldwin Message-ID: <20090120104612.2224983f@attini-ws2> In-Reply-To: <200901151031.42725.jhb@freebsd.org> References: <200901072152.n07Lql7h000807@svn.freebsd.org> <200901151031.42725.jhb@freebsd.org> X-Mailer: Claws Mail 3.5.0 (GTK+ 2.14.4; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, Marius Strobl , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r186878 - head/sys/dev/mpt X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2009 10:09:44 -0000 On Thu, 15 Jan 2009 10:31:42 -0500 John Baldwin wrote: > On Wednesday 07 January 2009 4:52:47 pm Marius Strobl wrote: > > Author: marius > > Date: Wed Jan 7 21:52:47 2009 > > New Revision: 186878 > > URL: http://svn.freebsd.org/changeset/base/186878 > > > > Log: > > Make the whole initiator mode part of mpt(4) endian-clean, > > specifically SPI controllers now also work in big-endian > > machines and some conversions relevant for FC and SAS > > controllers as well as support for ILP32 machines which all > > were omitted in previous attempts are now also implemented. > > The IOCTL-interface is intentionally left (and where needed > > actually changed) to be completely little-endian as otherwise > > we would have to add conversion code for every possible > > configuration page to mpt(4), which didn't seem the right > > thing to do, neither did converting only half of the user- > > interface to the native byte order. > > This change was tested on amd64 (SAS+SPI), i386 (SAS) and > > sparc64 (SAS+SPI). Due to lack of the necessary hardware > > the target mode code is still left to be made endian-clean. > > > > Reviewed by: scottl > > MFC after: 1 month > > If you wish to test the mpt_user interface on a big-endian machine > you may use //depot/jhb/raid/usr.sbin/mptutil/... > > It is likely going to need a lot of sprinkled htole*() and letoh*() > though. Hi John, great to hear that! I just checked out mptutil on 7.0 and it works fine with a bunch of Dell PERC 5iR :) Do you mind if i grab the sources and create a port of it? I guess many people are eagerly waiting to monitor their mpt arrays as stated on several lists. This would also give mptutil a much greater base of testers. Best regards Patrick From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 10:24:42 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 40F421065670 for ; Tue, 20 Jan 2009 10:24:42 +0000 (UTC) (envelope-from joao.barros@gmail.com) Received: from mail-bw0-f10.google.com (mail-bw0-f10.google.com [209.85.218.10]) by mx1.freebsd.org (Postfix) with ESMTP id 9537A8FC08 for ; Tue, 20 Jan 2009 10:24:41 +0000 (UTC) (envelope-from joao.barros@gmail.com) Received: by bwz3 with SMTP id 3so67979bwz.19 for ; Tue, 20 Jan 2009 02:24:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=8Cyg0wtoEG0+IHXI30xHPv6DOE8BLNHX3JhxcDqUGK4=; b=kgGRbJh6UYeNRQlSnc9ryp4c1W/CTqOat3o+FQsrwn1b/+ceP6NlfJQGDL24+hmdhy C6/VPO9D3H1I2ny6Cm9g9wW85yE+gMDWn6BcmpF5YPkLJBBDKXjo2CP+Fn12eZ11bWbn O3v1bEqOz/IEeV4L8ZzBbUTKx9Xznz4b8CqJM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=Mv/yG8+fHaE38DVnv9tR1y1zPZxxLTl3K/FdzL1jhpifAUG4aXnq8k6Yw6YZrq/6HI 3EXnVFItDYcaLc54cnQ20nUY7U2fbSa+drleY3KLpxkvTud7NyA5WpmH394iXtmQZQNk LJg0cppAT4ZWU3du8Qg4/DpgatmwM4HM6vijw= MIME-Version: 1.0 Received: by 10.180.229.17 with SMTP id b17mr1544493bkh.156.1232446479654; Tue, 20 Jan 2009 02:14:39 -0800 (PST) In-Reply-To: <200901200208.n0K28LBS029426@svn.freebsd.org> References: <200901200208.n0K28LBS029426@svn.freebsd.org> Date: Tue, 20 Jan 2009 10:14:39 +0000 Message-ID: <70e8236f0901200214h492eec2ci1fa765a44566c0c7@mail.gmail.com> From: =?ISO-8859-1?Q?Jo=E3o_Barros?= To: Maxim Sobolev Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r187459 - in head: sbin/mount_ntfs sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2009 10:24:42 -0000 On Tue, Jan 20, 2009 at 2:08 AM, Maxim Sobolev wrote: > Author: sobomax > Date: Tue Jan 20 02:08:21 2009 > New Revision: 187459 > URL: http://svn.freebsd.org/changeset/base/187459 > > Log: > Tone down warning about the quality of the NTFS VFS module. It appears that > not all developers share luigi opinion about quality of sysutils/fusefs-ntfs > compared to our kernel NTFS module. > > Modified: > head/sbin/mount_ntfs/mount_ntfs.8 > head/sys/conf/NOTES > > Modified: head/sbin/mount_ntfs/mount_ntfs.8 > ============================================================================== > --- head/sbin/mount_ntfs/mount_ntfs.8 Tue Jan 20 01:54:05 2009 (r187458) > +++ head/sbin/mount_ntfs/mount_ntfs.8 Tue Jan 20 02:08:21 2009 (r187459) > @@ -155,11 +155,8 @@ See the > .Sx WRITING > section for details about writing to an NTFS volume. > .Pp > -Apart from being read-mostly, the NTFS support in the > -.Fx > -kernel is not actively maintained. For any non-trivial use > -sysutils/fusefs-ntfs package, a more complete and better > -maintained alternative, is recommended instead. > +For a full read-write NTFS support consider sysutils/fusefs-ntfs > +port/package. > .Sh HISTORY > The > .Nm > > Modified: head/sys/conf/NOTES > ============================================================================== > --- head/sys/conf/NOTES Tue Jan 20 01:54:05 2009 (r187458) > +++ head/sys/conf/NOTES Tue Jan 20 02:08:21 2009 (r187459) > @@ -943,8 +943,9 @@ options MSDOSFS #MS DOS File System ( > options NFSSERVER #Network File System server > options NFSLOCKD #Network Lock Manager > > -# NT File System. Read-mostly and it's not actively maintained. > -# For a better NTFS support consider sysutils/fusefs-ntfs port/package. > +# NT File System. Read-mostly, see mount_ntfs(8) for details. > +# For a full read-write NTFS support consider sysutils/fusefs-ntfs > +# port/package. > options NTFS > > options NULLFS #NULL filesystem "Read-mostly, see mount_ntfs(8) for details." That phrase doesn't sound good. How about: "For kernel read-only support see mount_ntfs(8) for details." ? -- Joao Barros From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 10:26:44 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D134106564A; Tue, 20 Jan 2009 10:26:44 +0000 (UTC) (envelope-from joao.barros@gmail.com) Received: from mail-bw0-f10.google.com (mail-bw0-f10.google.com [209.85.218.10]) by mx1.freebsd.org (Postfix) with ESMTP id 4C6C08FC19; Tue, 20 Jan 2009 10:26:43 +0000 (UTC) (envelope-from joao.barros@gmail.com) Received: by bwz3 with SMTP id 3so69996bwz.19 for ; Tue, 20 Jan 2009 02:26:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=Qh7J355ncMOB1uiKDF+gXyobHxXK6a8Kbi1sNyLMz6Q=; b=skdhX0R17OPFpM7y0kyqp/ni3r2sGPY1j30kFTv2WdK2uA7HDmlazSrpBHAEVf5XSA yeFv01bvsy9HefVIKrDpKIpFa9+BHhag7nf2rytpsmqx/5LrI1PgNjiN8hs4C+S21qQv 1KS9zB0NHPmRewx1mZ2CEB4vVM/H4SA1NKGog= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=n9H4t40lzHhoRk4wR7jWXYj3Y2q944iRKEBydiDKSR4Azp7KRUghP/Q3CvDuu2WM8Z L3uWuCQKMN/cmFiU3okXV+GCyAz56rzIQpF9ZT+4BnGaBvqK8WdIGt/Sv0kvvDge0ZL6 HrDIRoKcPJSSpnu02qbUD5X/q1UhbUxz+2YlQ= MIME-Version: 1.0 Received: by 10.181.141.18 with SMTP id t18mr2421877bkn.205.1232446953385; Tue, 20 Jan 2009 02:22:33 -0800 (PST) In-Reply-To: <7d6fde3d0901200052w20755420l94f0c02c547f53b7@mail.gmail.com> References: <200901191619.n0JGJrhJ015123@svn.freebsd.org> <20090119.181322.-625070925.imp@bsdimp.com> <7d6fde3d0901200052w20755420l94f0c02c547f53b7@mail.gmail.com> Date: Tue, 20 Jan 2009 10:22:33 +0000 Message-ID: <70e8236f0901200222q4b00b7a5h8c3a35ab432f9cb2@mail.gmail.com> From: =?ISO-8859-1?Q?Jo=E3o_Barros?= To: Garrett Cooper Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, sobomax@freebsd.org, svn-src-all@freebsd.org, "M. Warner Losh" Subject: Re: svn commit: r187437 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2009 10:26:44 -0000 On Tue, Jan 20, 2009 at 8:52 AM, Garrett Cooper wrote: > On Mon, Jan 19, 2009 at 5:13 PM, M. Warner Losh wrote: >> In message: <200901191619.n0JGJrhJ015123@svn.freebsd.org> >> Maxim Sobolev writes: >> : Author: sobomax >> : Date: Mon Jan 19 16:19:53 2009 >> : New Revision: 187437 >> : URL: http://svn.freebsd.org/changeset/base/187437 >> : >> : Log: >> : Mention the fact that the NTFS kernel support isn't >> : very well maintained and point user to sysutils/fusefs-ntfs, which >> : at the time of this writing seems to be a better alternative. >> : >> : Suggested by: luigi >> : MFC after: 2 weeks >> >> Again, I'd not MFC this to 6.x for sure and maybe not even to 7.x >> since ntfs works well there. >> >> Warner >> >> : Modified: >> : head/sys/conf/NOTES >> : >> : Modified: head/sys/conf/NOTES >> : ============================================================================== >> : --- head/sys/conf/NOTES Mon Jan 19 15:59:05 2009 (r187436) >> : +++ head/sys/conf/NOTES Mon Jan 19 16:19:53 2009 (r187437) >> : @@ -942,7 +942,11 @@ options HPFS #OS/2 File system >> : options MSDOSFS #MS DOS File System (FAT, FAT32) >> : options NFSSERVER #Network File System server >> : options NFSLOCKD #Network Lock Manager >> : -options NTFS #NT File System >> : + >> : +# NT File System. Read-mostly and it's not actively maintained. >> : +# For a better NTFS support consider sysutils/fusefs-ntfs port/package. >> : +options NTFS >> : + >> : options NULLFS #NULL filesystem >> : # Broken (depends on NCP): >> : #options NWFS #NetWare filesystem > > Uh, I got consistent panics on 7.x when mounting NTFS partitions > created with XP. > I was creating the partition without MSDOS 8.3 short filename > support though. I personally think that the copy of NTFS in the kernel > is stale and unusable for a lot of different use-cases, to be honest.. > -Garrett I moved 2x 320GB almost full NTFS partitions to my ZFS home server using mount_ntfs. ymmv ;-) -- Joao Barros From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 11:00:25 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37A5A10656BF; Tue, 20 Jan 2009 11:00:25 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from fallbackmx08.syd.optusnet.com.au (fallbackmx08.syd.optusnet.com.au [211.29.132.10]) by mx1.freebsd.org (Postfix) with ESMTP id B769F8FC1A; Tue, 20 Jan 2009 11:00:24 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from mail36.syd.optusnet.com.au (mail36.syd.optusnet.com.au [211.29.133.76]) by fallbackmx08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id n0K7qMZv023421; Tue, 20 Jan 2009 18:52:22 +1100 Received: from server.vk2pj.dyndns.org (c122-106-215-175.belrs3.nsw.optusnet.com.au [122.106.215.175]) by mail36.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id n0K7qIVC020013 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 20 Jan 2009 18:52:19 +1100 X-Bogosity: Ham, spamicity=0.000000 Received: from server.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1]) by server.vk2pj.dyndns.org (8.14.3/8.14.3) with ESMTP id n0K7qIRE037048; Tue, 20 Jan 2009 18:52:18 +1100 (EST) (envelope-from peter@server.vk2pj.dyndns.org) Received: (from peter@localhost) by server.vk2pj.dyndns.org (8.14.3/8.14.3/Submit) id n0K7qIjT037047; Tue, 20 Jan 2009 18:52:18 +1100 (EST) (envelope-from peter) Date: Tue, 20 Jan 2009 18:52:18 +1100 From: Peter Jeremy To: "David O'Brien" Message-ID: <20090120075217.GN16116@server.vk2pj.dyndns.org> References: <200901161547.n0GFlZ4C012008@svn.freebsd.org> <20090117142021.92d5a40b.stas@FreeBSD.org> <20090119165030.GA18409@dragon.NUXI.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="bWEb1MG/o7IKOlQF" Content-Disposition: inline In-Reply-To: <20090119165030.GA18409@dragon.NUXI.org> X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc User-Agent: Mutt/1.5.18 (2008-05-17) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r187332 - head/tools/regression/usr.bin/jot X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2009 11:00:26 -0000 --bWEb1MG/o7IKOlQF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2009-Jan-19 08:50:30 -0800, David O'Brien wrote: >Run VMware. Seriously. Or raise a serious discussion on developers@ >about this and get conciseness that cross building on MacOS X and >MS-Windows is a goal. Checking out and cross-building is not something that is limited to committers so I would request that any discussion occur on an open list. IMHO, if someone wants to do the legwork to enable FreeBSD to be built on OS-X or Windows and the result does not adversely impact the native build environment then this would seen to be a Good Thing. --=20 Peter Jeremy Please excuse any delays as the result of my ISP's inability to implement an MTA that is either RFC2821-compliant or matches their claimed behaviour. --bWEb1MG/o7IKOlQF Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.10 (FreeBSD) iEYEARECAAYFAkl1grEACgkQ/opHv/APuIfbnwCfd9qjqiOlxfZKnp5Oq7/lkey9 hFUAoIaAkk1mi3/uYGQiG5hJLgLJC2OF =NSn2 -----END PGP SIGNATURE----- --bWEb1MG/o7IKOlQF-- From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 11:02:35 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BBEF310656C1 for ; Tue, 20 Jan 2009 11:02:35 +0000 (UTC) (envelope-from christoph.mallon@gmx.de) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by mx1.freebsd.org (Postfix) with SMTP id 513438FC21 for ; Tue, 20 Jan 2009 11:02:33 +0000 (UTC) (envelope-from christoph.mallon@gmx.de) Received: (qmail invoked by alias); 20 Jan 2009 11:02:33 -0000 Received: from p54A3DE90.dip.t-dialin.net (EHLO tron.homeunix.org) [84.163.222.144] by mail.gmx.net (mp033) with SMTP; 20 Jan 2009 12:02:33 +0100 X-Authenticated: #1673122 X-Provags-ID: V01U2FsdGVkX1+XEqtffLKXGpws686K+uqNmXdmvmTGWG4zkogKty zGMULTTpYPSaOy Message-ID: <4975AF47.7070506@gmx.de> Date: Tue, 20 Jan 2009 12:02:31 +0100 From: Christoph Mallon User-Agent: Thunderbird 2.0.0.19 (X11/20090103) MIME-Version: 1.0 To: obrien@FreeBSD.org References: <200901161547.n0GFlZ4C012008@svn.freebsd.org> <20090117142021.92d5a40b.stas@FreeBSD.org> <20090119165030.GA18409@dragon.NUXI.org> <20090120012525.GC29741@dragon.NUXI.org> In-Reply-To: <20090120012525.GC29741@dragon.NUXI.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.62 Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, Ed Schouten , Stanislav Sedov , Robert Watson , svn-src-head@FreeBSD.org Subject: Re: svn commit: r187332 - head/tools/regression/usr.bin/jot X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2009 11:02:36 -0000 David O'Brien schrieb: > On Mon, Jan 19, 2009 at 04:55:04PM +0000, Robert Watson wrote: >> On Mon, 19 Jan 2009, David O'Brien wrote: >>> For changes like this to be reasoned because of building FreeBSD on >>> Windows there should consensus. For MacOS X - there is a case sensitive >>> FS. >> So I have to reformat my Mac OS X file systems in order to check out >> FreeBSD source trees on them because the jot(1) regression test relies on >> having two files in the same directory that differ only in case? :-) No > > Does it really prevent one from checking out the sources - the file name > collision should just cause a file to be overwritten. This case should > only be an issue if you're trying to run the tests. Of course SVN complains when it would create a file, which already exists. SVN is a VCS after all. If it would inadvertently plain overwrite existing data it would completely miss one core aspect of a VCS: preserving information. From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 11:27:45 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E5A810657A7; Tue, 20 Jan 2009 11:27:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5B3368FC0A; Tue, 20 Jan 2009 11:27:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0KBRjDu043791; Tue, 20 Jan 2009 11:27:45 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0KBRjui043789; Tue, 20 Jan 2009 11:27:45 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200901201127.n0KBRjui043789@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 20 Jan 2009 11:27:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187467 - in head/sys: kern ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2009 11:27:54 -0000 Author: kib Date: Tue Jan 20 11:27:45 2009 New Revision: 187467 URL: http://svn.freebsd.org/changeset/base/187467 Log: FFS puts the extended attributes blocks at the negative blocks for the vnode, from -1 down. When vinvalbuf(vp, V_ALT) is done for the vnode, it incorrectly does vm_object_page_remove(0, 0), removing all pages from the underlying vm object, not only the pages that back the extended attributes data. Change vinvalbuf() to not remove any pages from the object when V_NORMAL or V_ALT are specified. Instead, the only in-tree caller in ffs_inode.c:ffs_truncate() that specifies V_ALT explicitely removes the corresponding page range. The V_NORMAL caller does vnode_pager_setsize(vp, 0) immediately after the call to vinvalbuf(V_NORMAL) already. Reported by: csjp Reviewed by: ups MFC after: 3 weeks Modified: head/sys/kern/vfs_subr.c head/sys/ufs/ffs/ffs_inode.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Tue Jan 20 08:13:45 2009 (r187466) +++ head/sys/kern/vfs_subr.c Tue Jan 20 11:27:45 2009 (r187467) @@ -1156,7 +1156,7 @@ bufobj_invalbuf(struct bufobj *bo, int f /* * Destroy the copy in the VM cache, too. */ - if (bo->bo_object != NULL) { + if (bo->bo_object != NULL && (flags & (V_ALT | V_NORMAL)) == 0) { VM_OBJECT_LOCK(bo->bo_object); vm_object_page_remove(bo->bo_object, 0, 0, (flags & V_SAVE) ? TRUE : FALSE); Modified: head/sys/ufs/ffs/ffs_inode.c ============================================================================== --- head/sys/ufs/ffs/ffs_inode.c Tue Jan 20 08:13:45 2009 (r187466) +++ head/sys/ufs/ffs/ffs_inode.c Tue Jan 20 11:27:45 2009 (r187467) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -151,6 +152,7 @@ ffs_truncate(vp, length, flags, cred, td struct fs *fs; struct buf *bp; struct ufsmount *ump; + vm_object_t object; int needextclean, softdepslowdown, extblocks; int offset, size, level, nblocks; int i, error, allerror; @@ -205,6 +207,13 @@ ffs_truncate(vp, length, flags, cred, td (void) chkdq(ip, -extblocks, NOCRED, 0); #endif vinvalbuf(vp, V_ALT, 0, 0); + if ((object = vp->v_object) != NULL) { + VM_OBJECT_LOCK(object); + vm_object_page_remove(object, + OFF_TO_IDX(lblktosize(fs, -extblocks)), 0, + FALSE); + VM_OBJECT_UNLOCK(object); + } ip->i_din2->di_extsize = 0; for (i = 0; i < NXADDR; i++) { oldblks[i] = ip->i_din2->di_extb[i]; From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 11:30:22 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DB773106566C; Tue, 20 Jan 2009 11:30:22 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C9F398FC19; Tue, 20 Jan 2009 11:30:22 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0KBUMUn043888; Tue, 20 Jan 2009 11:30:22 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0KBUM01043886; Tue, 20 Jan 2009 11:30:22 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200901201130.n0KBUM01043886@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 20 Jan 2009 11:30:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187468 - head/sys/ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2009 11:30:23 -0000 Author: kib Date: Tue Jan 20 11:30:22 2009 New Revision: 187468 URL: http://svn.freebsd.org/changeset/base/187468 Log: When extending inode size, we call vnode_pager_setsize(), to have a address space where to put vnode pages, and then call UFS_BALLOC(), to actually allocate new block and map it. When UFS_BALLOC() returns error, sometimes we forget to revert the vm object size increase, allowing for the pages that are not backed by the logical disk blocks. Revert vnode_pager_setsize() back when UFS_BALLOC() failed, for ffs_truncate() and ffs_write(). PR: 129956 Reviewed by: ups MFC after: 3 weeks Modified: head/sys/ufs/ffs/ffs_inode.c head/sys/ufs/ffs/ffs_vnops.c Modified: head/sys/ufs/ffs/ffs_inode.c ============================================================================== --- head/sys/ufs/ffs/ffs_inode.c Tue Jan 20 11:27:45 2009 (r187467) +++ head/sys/ufs/ffs/ffs_inode.c Tue Jan 20 11:30:22 2009 (r187468) @@ -305,8 +305,10 @@ ffs_truncate(vp, length, flags, cred, td vnode_pager_setsize(vp, length); flags |= BA_CLRBUF; error = UFS_BALLOC(vp, length - 1, 1, cred, flags, &bp); - if (error) + if (error) { + vnode_pager_setsize(vp, osize); return (error); + } ip->i_size = length; DIP_SET(ip, i_size, length); if (bp->b_bufsize == fs->fs_bsize) Modified: head/sys/ufs/ffs/ffs_vnops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vnops.c Tue Jan 20 11:27:45 2009 (r187467) +++ head/sys/ufs/ffs/ffs_vnops.c Tue Jan 20 11:30:22 2009 (r187468) @@ -723,8 +723,10 @@ ffs_write(ap) /* XXX is uio->uio_offset the right thing here? */ error = UFS_BALLOC(vp, uio->uio_offset, xfersize, ap->a_cred, flags, &bp); - if (error != 0) + if (error != 0) { + vnode_pager_setsize(vp, ip->i_size); break; + } /* * If the buffer is not valid we have to clear out any * garbage data from the pages instantiated for the buffer. From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 11:34:28 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA06F10656D9; Tue, 20 Jan 2009 11:34:28 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C6F468FC24; Tue, 20 Jan 2009 11:34:28 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0KBYSgs044019; Tue, 20 Jan 2009 11:34:28 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0KBYShR044013; Tue, 20 Jan 2009 11:34:28 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200901201134.n0KBYShR044013@svn.freebsd.org> From: Ed Schouten Date: Tue, 20 Jan 2009 11:34:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187469 - head/sys/dev/syscons/teken X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2009 11:34:29 -0000 Author: ed Date: Tue Jan 20 11:34:28 2009 New Revision: 187469 URL: http://svn.freebsd.org/changeset/base/187469 Log: Properly implement the VT100 SCS sequences in xterm-mode. Even though VT100-like devices can display non-ASCII characters, they do not use an 8-bit character set. Special escape sequences allow the VT100 to switch character maps. The special graphics character set stores the box drawing characters, starting at 0x60, ending at 0x7e. This means we now pass the character map tests in vttest, even the save/restore cursor test, combined with character maps. dialog(1) also works a lot better now. This commit also includes some other minor fixes: - Default to 24 lines in teken_demo when using xterm emulation. - Make white foreground and background work in teken_demo. Added: head/sys/dev/syscons/teken/teken_scs.h (contents, props changed) Modified: head/sys/dev/syscons/teken/sequences head/sys/dev/syscons/teken/teken.c head/sys/dev/syscons/teken/teken.h head/sys/dev/syscons/teken/teken_demo.c head/sys/dev/syscons/teken/teken_subr.h Modified: head/sys/dev/syscons/teken/sequences ============================================================================== --- head/sys/dev/syscons/teken/sequences Tue Jan 20 11:30:22 2009 (r187468) +++ head/sys/dev/syscons/teken/sequences Tue Jan 20 11:34:28 2009 (r187469) @@ -71,6 +71,16 @@ DSR Device Status Report ^[ [ ? n r ECH Erase character ^[ [ X n ED Erase display ^[ [ J r EL Erase line ^[ [ K r +G0SCS0 G0 SCS Special Graphics ^[ ( 0 +G0SCS1 G0 SCS US ASCII ^[ ( 1 +G0SCS2 G0 SCS Special Graphics ^[ ( 2 +G0SCSA G0 SCS UK National ^[ ( A +G0SCSB G0 SCS US ASCII ^[ ( B +G1SCS0 G1 SCS Special Graphics ^[ ) 0 +G1SCS1 G1 SCS US ASCII ^[ ) 1 +G1SCS2 G1 SCS Special Graphics ^[ ) 2 +G1SCSA G1 SCS UK National ^[ ) A +G1SCSB G1 SCS US ASCII ^[ ) B HPA Horizontal Position Absolute ^[ [ G n HPA Horizontal Position Absolute ^[ [ ` n HTS Horizontal Tab Set ^[ H @@ -81,16 +91,6 @@ NEL Next line ^[ E RI Reverse index ^[ M RIS Reset to Initial State ^[ c RM Reset Mode ^[ [ l r -SCS SCS ^[ ( 0 -SCS SCS ^[ ( 1 -SCS SCS ^[ ( 2 -SCS SCS ^[ ( A -SCS SCS ^[ ( B -SCS SCS ^[ ) 0 -SCS SCS ^[ ) 1 -SCS SCS ^[ ) 2 -SCS SCS ^[ ) A -SCS SCS ^[ ) B SD Pan Up ^[ [ T n SGR Set Graphic Rendition ^[ [ m v SM Set Mode ^[ [ h r Modified: head/sys/dev/syscons/teken/teken.c ============================================================================== --- head/sys/dev/syscons/teken/teken.c Tue Jan 20 11:30:22 2009 (r187468) +++ head/sys/dev/syscons/teken/teken.c Tue Jan 20 11:34:28 2009 (r187469) @@ -49,21 +49,27 @@ static FILE *df; #endif /* __FreeBSD__ && _KERNEL */ #include "teken.h" + #ifdef TEKEN_UTF8 #include "teken_wcwidth.h" #else /* !TEKEN_UTF8 */ -static inline int -teken_wcwidth(teken_char_t c __unused) -{ - #ifdef TEKEN_XTERM - return (c <= 0x1B) ? -1 : 1; +#define teken_wcwidth(c) ((c <= 0x1B) ? -1 : 1) #else /* !TEKEN_XTERM */ - return (1); +#define teken_wcwidth(c) (1) #endif /* TEKEN_XTERM */ -} #endif /* TEKEN_UTF8 */ +#if defined(TEKEN_XTERM) && defined(TEKEN_UTF8) +#include "teken_scs.h" +#else /* !(TEKEN_XTERM && TEKEN_UTF8) */ +#define teken_scs_process(t, c) (c) +#define teken_scs_restore(t) +#define teken_scs_save(t) +#define teken_scs_set(t, g, ts) +#define teken_scs_switch(t, g) +#endif /* TEKEN_XTERM && TEKEN_UTF8 */ + /* Private flags for teken_format_t. */ #define TF_REVERSE 0x08 @@ -229,6 +235,14 @@ teken_input_char(teken_t *t, teken_char_ case '\x0C': teken_subr_newpage(t); break; +#if defined(TEKEN_XTERM) && defined(TEKEN_UTF8) + case '\x0E': + teken_scs_switch(t, 1); + break; + case '\x0F': + teken_scs_switch(t, 0); + break; +#endif /* TEKEN_XTERM && TEKEN_UTF8 */ case '\r': teken_subr_carriage_return(t); break; Modified: head/sys/dev/syscons/teken/teken.h ============================================================================== --- head/sys/dev/syscons/teken/teken.h Tue Jan 20 11:30:22 2009 (r187468) +++ head/sys/dev/syscons/teken/teken.h Tue Jan 20 11:34:28 2009 (r187469) @@ -117,6 +117,10 @@ typedef struct { tf_respond_t *tf_respond; } teken_funcs_t; +#if defined(TEKEN_XTERM) && defined(TEKEN_UTF8) +typedef teken_char_t teken_scs_t(teken_char_t); +#endif /* TEKEN_XTERM && TEKEN_UTF8 */ + /* * Terminal state. */ @@ -146,12 +150,18 @@ struct __teken { teken_span_t t_originreg; #define T_NUMCOL 160 - unsigned int t_tabstops[T_NUMCOL / (sizeof(unsigned int) * 8)]; + unsigned int t_tabstops[T_NUMCOL / (sizeof(unsigned int) * 8)]; #ifdef TEKEN_UTF8 - unsigned int t_utf8_left; - teken_char_t t_utf8_partial; + unsigned int t_utf8_left; + teken_char_t t_utf8_partial; #endif /* TEKEN_UTF8 */ + +#if defined(TEKEN_XTERM) && defined(TEKEN_UTF8) + unsigned int t_curscs; + teken_scs_t *t_saved_curscs; + teken_scs_t *t_scs[2]; +#endif /* TEKEN_XTERM && TEKEN_UTF8 */ }; /* Initialize teken structure. */ Modified: head/sys/dev/syscons/teken/teken_demo.c ============================================================================== --- head/sys/dev/syscons/teken/teken_demo.c Tue Jan 20 11:30:22 2009 (r187468) +++ head/sys/dev/syscons/teken/teken_demo.c Tue Jan 20 11:34:28 2009 (r187469) @@ -70,7 +70,11 @@ struct pixel { }; #define NCOLS 80 +#ifdef TEKEN_XTERM +#define NROWS 24 +#else /* !TEKEN_XTERM */ #define NROWS 25 +#endif /* TEKEN_XTERM */ struct pixel buffer[NCOLS][NROWS]; static int ptfd; @@ -104,7 +108,7 @@ printchar(const teken_pos_t *p) if (px->a.ta_format & TF_BLINK) attr |= A_BLINK; - bkgdset(attr | COLOR_PAIR(px->a.ta_fgcolor + 8 * px->a.ta_bgcolor + 1)); + bkgdset(attr | COLOR_PAIR(px->a.ta_fgcolor + 8 * px->a.ta_bgcolor)); mvaddch(p->tp_row, p->tp_col, px->c); move(y, x); @@ -301,7 +305,7 @@ main(int argc __unused, char *argv[] __u start_color(); for (i = 0; i < 8; i++) for (j = 0; j < 8; j++) - init_pair(i + 8 * j + 1, ccolors[i], ccolors[j]); + init_pair(i + 8 * j, ccolors[i], ccolors[j]); redraw_border(); Added: head/sys/dev/syscons/teken/teken_scs.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/syscons/teken/teken_scs.h Tue Jan 20 11:34:28 2009 (r187469) @@ -0,0 +1,98 @@ +/*- + * Copyright (c) 2009 Ed Schouten + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +static void +teken_scs_set(teken_t *t, unsigned int g, teken_scs_t *ts) +{ + + t->t_scs[g] = ts; +} + +static void +teken_scs_switch(teken_t *t, unsigned int g) +{ + + t->t_curscs = g; +} + +static void +teken_scs_restore(teken_t *t) +{ + + t->t_scs[t->t_curscs] = t->t_saved_curscs; +} + +static void +teken_scs_save(teken_t *t) +{ + + t->t_saved_curscs = t->t_scs[t->t_curscs]; +} + +static teken_char_t +teken_scs_process(teken_t *t, teken_char_t c) +{ + + return (t->t_scs[t->t_curscs](c)); +} + +/* Unicode points for VT100 box drawing. */ +static const teken_char_t teken_boxdrawing[31] = { + 0x25c6, 0x2592, 0x2409, 0x240c, 0x240d, 0x240a, 0x00b0, 0x00b1, + 0x2424, 0x240b, 0x2518, 0x2510, 0x250c, 0x2514, 0x253c, 0x23ba, + 0x23bb, 0x2500, 0x23bc, 0x23bd, 0x251c, 0x2524, 0x2534, 0x252c, + 0x2502, 0x2264, 0x2265, 0x03c0, 0x2260, 0x00a3, 0x00b7 +}; + +static teken_char_t +teken_scs_special_graphics(teken_char_t c) +{ + + /* Box drawing. */ + if (c >= '`' && c <= '~') + return (teken_boxdrawing[c - '`']); + return (c); +} + +static teken_char_t +teken_scs_uk_national(teken_char_t c) +{ + + /* Pound sign. */ + if (c == '#') + return (0xa3); + return (c); +} + +static teken_char_t +teken_scs_us_ascii(teken_char_t c) +{ + + /* No processing. */ + return (c); +} Modified: head/sys/dev/syscons/teken/teken_subr.h ============================================================================== --- head/sys/dev/syscons/teken/teken_subr.h Tue Jan 20 11:30:22 2009 (r187468) +++ head/sys/dev/syscons/teken/teken_subr.h Tue Jan 20 11:34:28 2009 (r187469) @@ -30,6 +30,7 @@ static void teken_subr_cursor_up(teken_t static void teken_subr_erase_line(teken_t *, unsigned int); static void teken_subr_regular_character(teken_t *, teken_char_t); static void teken_subr_reset_to_initial_state(teken_t *); +static void teken_subr_save_cursor(teken_t *); static inline int teken_tab_isset(teken_t *t, unsigned int col) @@ -528,6 +529,48 @@ teken_subr_erase_line(teken_t *t, unsign } static void +teken_subr_g0_scs_special_graphics(teken_t *t __unused) +{ + + teken_scs_set(t, 0, teken_scs_special_graphics); +} + +static void +teken_subr_g0_scs_uk_national(teken_t *t __unused) +{ + + teken_scs_set(t, 0, teken_scs_uk_national); +} + +static void +teken_subr_g0_scs_us_ascii(teken_t *t __unused) +{ + + teken_scs_set(t, 0, teken_scs_us_ascii); +} + +static void +teken_subr_g1_scs_special_graphics(teken_t *t __unused) +{ + + teken_scs_set(t, 1, teken_scs_special_graphics); +} + +static void +teken_subr_g1_scs_uk_national(teken_t *t __unused) +{ + + teken_scs_set(t, 1, teken_scs_uk_national); +} + +static void +teken_subr_g1_scs_us_ascii(teken_t *t __unused) +{ + + teken_scs_set(t, 1, teken_scs_us_ascii); +} + +static void teken_subr_horizontal_position_absolute(teken_t *t, unsigned int col) { @@ -740,6 +783,8 @@ static void teken_subr_regular_character(teken_t *t, teken_char_t c) { int width; + + c = teken_scs_process(t, c); /* XXX: Don't process zero-width characters yet. */ width = teken_wcwidth(c); @@ -877,11 +922,15 @@ static void teken_subr_do_reset(teken_t *t) { - t->t_curattr = t->t_saved_curattr = t->t_defattr; + t->t_curattr = t->t_defattr; t->t_cursor.tp_row = t->t_cursor.tp_col = 0; - t->t_saved_cursor = t->t_cursor; t->t_stateflags = TS_AUTOWRAP; + teken_scs_set(t, 0, teken_scs_us_ascii); + teken_scs_set(t, 1, teken_scs_us_ascii); + teken_scs_switch(t, 0); + + teken_subr_save_cursor(t); teken_tab_default(t); } @@ -902,6 +951,7 @@ teken_subr_restore_cursor(teken_t *t) t->t_cursor = t->t_saved_cursor; t->t_curattr = t->t_saved_curattr; t->t_stateflags &= ~TS_WRAPPED; + teken_scs_restore(t); teken_funcs_cursor(t); } @@ -924,13 +974,7 @@ teken_subr_save_cursor(teken_t *t) t->t_saved_cursor = t->t_cursor; t->t_saved_curattr = t->t_curattr; -} - -static void -teken_subr_scs(teken_t *t __unused) -{ - - teken_printf("scs???\n"); + teken_scs_save(t); } static void From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 11:53:05 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B87D1065672; Tue, 20 Jan 2009 11:53:05 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (77-93-215-190.static.masterinter.net [77.93.215.190]) by mx1.freebsd.org (Postfix) with ESMTP id D69618FC1C; Tue, 20 Jan 2009 11:53:04 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 4D2EA9CB074; Tue, 20 Jan 2009 12:52:36 +0100 (CET) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by localhost (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZgTPl2q0Wqtr; Tue, 20 Jan 2009 12:52:34 +0100 (CET) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id F21379CB094; Tue, 20 Jan 2009 12:52:33 +0100 (CET) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.2/8.14.2/Submit) id n0KBqXY1044896; Tue, 20 Jan 2009 12:52:33 +0100 (CET) (envelope-from rdivacky) Date: Tue, 20 Jan 2009 12:52:33 +0100 From: Roman Divacky To: Konstantin Belousov Message-ID: <20090120115233.GA43828@freebsd.org> References: <200901201130.n0KBUM01043886@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200901201130.n0KBUM01043886@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r187468 - head/sys/ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2009 11:53:05 -0000 On Tue, Jan 20, 2009 at 11:30:22AM +0000, Konstantin Belousov wrote: > Author: kib > Date: Tue Jan 20 11:30:22 2009 > New Revision: 187468 > URL: http://svn.freebsd.org/changeset/base/187468 > > Log: > When extending inode size, we call vnode_pager_setsize(), to have a > address space where to put vnode pages, and then call UFS_BALLOC(), > to actually allocate new block and map it. When UFS_BALLOC() returns > error, sometimes we forget to revert the vm object size increase, > allowing for the pages that are not backed by the logical disk blocks. > > Revert vnode_pager_setsize() back when UFS_BALLOC() failed, for > ffs_truncate() and ffs_write(). can you describe in what scenario this can trigger? can it be that many smallish (a few tens of kB?) of mmaped files being read/write may cause this? thnx From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 12:07:50 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 372C810656EB; Tue, 20 Jan 2009 12:07:50 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1E2058FC0A; Tue, 20 Jan 2009 12:07:50 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0KC7noK044685; Tue, 20 Jan 2009 12:07:49 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0KC7n57044684; Tue, 20 Jan 2009 12:07:49 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200901201207.n0KC7n57044684@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 20 Jan 2009 12:07:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187470 - head/sys/amd64/amd64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2009 12:07:58 -0000 Author: kib Date: Tue Jan 20 12:07:49 2009 New Revision: 187470 URL: http://svn.freebsd.org/changeset/base/187470 Log: The context switch to the 32bit binary does not properly restore the fsbase value. The switch loads the fs segment register, that invalidates the value in fsbase msr, thus value in %r9 can not be considered the current value for fsbase anymore. Unconditionally reload fsbase when switching to 32bit binary. PR: 130526 MFC after: 3 weeks Modified: head/sys/amd64/amd64/cpu_switch.S Modified: head/sys/amd64/amd64/cpu_switch.S ============================================================================== --- head/sys/amd64/amd64/cpu_switch.S Tue Jan 20 11:34:28 2009 (r187469) +++ head/sys/amd64/amd64/cpu_switch.S Tue Jan 20 12:07:49 2009 (r187470) @@ -199,6 +199,7 @@ done_load_seg: cmpq PCB_FSBASE(%r8),%r9 jz 1f /* Restore userland %fs */ +restore_fsbase: movl $MSR_FSBASE,%ecx movl PCB_FSBASE(%r8),%eax movl PCB_FSBASE+4(%r8),%edx @@ -281,7 +282,7 @@ load_seg: movl PCB_DS(%r8),%ds movl PCB_ES(%r8),%es movl PCB_FS(%r8),%fs - jmp done_load_seg + jmp restore_fsbase /* Restore userland %gs while preserving kernel gsbase */ 2: movq PCPU(GS32P),%rax movq PCB_GS32SD(%r8),%rcx From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 12:30:31 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A44BB106567F; Tue, 20 Jan 2009 12:30:31 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.terabit.net.ua (mail.terabit.net.ua [195.137.202.147]) by mx1.freebsd.org (Postfix) with ESMTP id 461E78FC25; Tue, 20 Jan 2009 12:30:31 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from skuns.zoral.com.ua ([91.193.166.194] helo=mail.zoral.com.ua) by mail.terabit.net.ua with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63 (FreeBSD)) (envelope-from ) id 1LPFkT-0002DO-Lw; Tue, 20 Jan 2009 14:30:29 +0200 Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id n0KCUNo4097271 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 20 Jan 2009 14:30:23 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3) with ESMTP id n0KCUNv4011626; Tue, 20 Jan 2009 14:30:23 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id n0KCUMsL011625; Tue, 20 Jan 2009 14:30:22 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 20 Jan 2009 14:30:22 +0200 From: Kostik Belousov To: Roman Divacky Message-ID: <20090120123022.GB58517@deviant.kiev.zoral.com.ua> References: <200901201130.n0KBUM01043886@svn.freebsd.org> <20090120115233.GA43828@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="K8nIJk4ghYZn606h" Content-Disposition: inline In-Reply-To: <20090120115233.GA43828@freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua X-Virus-Scanned: mail.terabit.net.ua 1LPFkT-0002DO-Lw 62e3c7124d0766103d60a637b5db5861 X-Terabit: YES Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r187468 - head/sys/ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2009 12:30:32 -0000 --K8nIJk4ghYZn606h Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jan 20, 2009 at 12:52:33PM +0100, Roman Divacky wrote: > On Tue, Jan 20, 2009 at 11:30:22AM +0000, Konstantin Belousov wrote: > > Author: kib > > Date: Tue Jan 20 11:30:22 2009 > > New Revision: 187468 > > URL: http://svn.freebsd.org/changeset/base/187468 > >=20 > > Log: > > When extending inode size, we call vnode_pager_setsize(), to have a > > address space where to put vnode pages, and then call UFS_BALLOC(), > > to actually allocate new block and map it. When UFS_BALLOC() returns > > error, sometimes we forget to revert the vm object size increase, > > allowing for the pages that are not backed by the logical disk blocks. > > =20 > > Revert vnode_pager_setsize() back when UFS_BALLOC() failed, for > > ffs_truncate() and ffs_write(). >=20 > can you describe in what scenario this can trigger? can it be that > many smallish (a few tens of kB?) of mmaped files being read/write > may cause this? The usual scenario is either a full partition or exceeded block quotas for the user that writes the file and then mmap it. --K8nIJk4ghYZn606h Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkl1w90ACgkQC3+MBN1Mb4iyHACfSP8J1KUPlxC2ujeEMrrI20El VLUAnitW3DyAtfIJt0uGl5gMRsaag9Ne =5Yfo -----END PGP SIGNATURE----- --K8nIJk4ghYZn606h-- From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 12:33:04 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ECC5A1065672; Tue, 20 Jan 2009 12:33:04 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D0D1D8FC0C; Tue, 20 Jan 2009 12:33:04 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0KCX4Fu045316; Tue, 20 Jan 2009 12:33:04 GMT (envelope-from jeff@svn.freebsd.org) Received: (from jeff@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0KCX4u5045315; Tue, 20 Jan 2009 12:33:04 GMT (envelope-from jeff@svn.freebsd.org) Message-Id: <200901201233.n0KCX4u5045315@svn.freebsd.org> From: Jeff Roberson Date: Tue, 20 Jan 2009 12:33:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187471 - head/tools/sched X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2009 12:33:05 -0000 Author: jeff Date: Tue Jan 20 12:33:04 2009 New Revision: 187471 URL: http://svn.freebsd.org/changeset/base/187471 Log: - Permit timestamps to be as far as 2048 ticks apart before we complain about invalid timestamps. Nehalem CPUs seem to be synchronized but only within a fraction of a microsecond. - Make the Counter code more flexible to poor timestamps. In general we now complain a lot but render as much as we can. - Change the scaler behavior so it works better with very long and very short traces. We now set the maximum scale such that it properly displays the entire file by default and doesn't permit zooming out beyond the file. This improves other awkward navigation behavior. The interval is now set very small which can't be achieved by simply dragging the mouse. Clicking to the left of or right of the scaler bar will produce increments of a single, very small, interval now. Sponsored by: Nokia Modified: head/tools/sched/schedgraph.py Modified: head/tools/sched/schedgraph.py ============================================================================== --- head/tools/sched/schedgraph.py Tue Jan 20 12:07:49 2009 (r187470) +++ head/tools/sched/schedgraph.py Tue Jan 20 12:33:04 2009 (r187471) @@ -162,15 +162,12 @@ def ticks2sec(ticks): class Scaler(Frame): def __init__(self, master, target): Frame.__init__(self, master) - self.scale = Scale(self, command=self.scaleset, - from_=1000, to_=10000000, orient=HORIZONTAL, - resolution=1000) + self.scale = None + self.target = target self.label = Label(self, text="Ticks per pixel") self.label.pack(side=LEFT) - self.scale.pack(fill="both", expand=1) - self.target = target - self.scale.set(target.scaleget()) - self.initialized = 1 + self.resolution = 100 + self.setmax(10000) def scaleset(self, value): self.target.scaleset(int(value)) @@ -178,6 +175,20 @@ class Scaler(Frame): def set(self, value): self.scale.set(value) + def setmax(self, value): + # + # We can't reconfigure the to_ value so we delete the old + # window and make a new one when we resize. + # + if (self.scale != None): + self.scale.pack_forget() + self.scale.destroy() + self.scale = Scale(self, command=self.scaleset, + from_=100, to_=value, orient=HORIZONTAL, + resolution=self.resolution) + self.scale.pack(fill="both", expand=1) + self.scale.set(self.target.scaleget()) + class Status(Frame): def __init__(self, master): Frame.__init__(self, master) @@ -726,6 +737,11 @@ class CountEvent(Event): return (xpos) color = colormap.lookup("count") self.duration = duration = next.timestamp - self.timestamp + if (duration < 0): + duration = 0 + print "Unsynchronized timestamp" + print self.cpu, self.timestamp + print next.cpu, next.timestamp self.attrs.insert(0, ("count", self.count)) self.attrs.insert(1, ("duration", ticks2sec(duration))) delta = duration / canvas.ratio @@ -882,6 +898,7 @@ class KTRFile: self.crit = {} self.stathz = 0 self.eventcnt = 0 + self.taghash = {} self.parse(file) self.fixup() @@ -956,7 +973,8 @@ class KTRFile: if (dat == None): dat = dat1 if (self.checkstamp(timestamp) == 0): - print "Bad timestamp at", lineno, ":", line, + print "Bad timestamp at", lineno, ":", + print cpu, timestamp continue # # Build the table of optional attributes @@ -1021,20 +1039,22 @@ class KTRFile: timestamp = int(timestamp) if (self.timestamp_f == None): self.timestamp_f = timestamp; - if (self.timestamp_l != None and timestamp > self.timestamp_l): + if (self.timestamp_l != None and + timestamp -2048> self.timestamp_l): return (0) self.timestamp_l = timestamp; return (1) def makeid(self, group, id, type): - for source in sources: - if (source.name == id and source.group == group): - return source + tag = group + id + if (self.taghash.has_key(tag)): + return self.taghash[tag] if (type == "counter"): source = Counter(group, id) else: source = EventSource(group, id) sources.append(source) + self.taghash[tag] = source return (source) def findid(self, id): @@ -1053,7 +1073,7 @@ class KTRFile: return int(clockfreq * oneghz) # Check for a discovered clock - if (self.stathz != None): + if (self.stathz != 0): return (self.timespan() / self.ticks[0]) * int(self.stathz) # Pretend we have a 1ns clock print "WARNING: No clock discovered and no frequency ", @@ -1313,8 +1333,16 @@ class SchedGraph(Frame): self.names.draw() self.display.draw() self.status.startup("") - self.scale.set(250000) + # + # Configure scale related values + # + scalemax = ktrfile.timespan() / int(self.display["width"]) + width = int(root.geometry().split('x')[0]) + self.constwidth = width - int(self.display["width"]) + self.scale.setmax(scalemax) + self.scale.set(scalemax) self.display.xview_moveto(0) + self.bind("", self.resize) def mousepress(self, event): self.clicksource = self.sourceat(event.y) @@ -1452,8 +1480,7 @@ class SchedGraph(Frame): source.hidden = 0 size += sz idx += 1 - self.names.updatescroll() - self.display.updatescroll() + self.updatescroll() self.status.set("") # @@ -1496,8 +1523,7 @@ class SchedGraph(Frame): if (nstart >= stop): break; self.sourceshift(source, -size) - self.names.updatescroll() - self.display.updatescroll() + self.updatescroll() self.status.set("") def sourcehide(self, source): @@ -1530,8 +1556,7 @@ class SchedGraph(Frame): if (nstart < start): continue; self.sourceshift(source, off) - self.names.updatescroll() - self.display.updatescroll() + self.updatescroll() self.status.set("") def sourceat(self, ypos): @@ -1551,6 +1576,15 @@ class SchedGraph(Frame): self.names.yview(*args) self.display.yview(*args) + def resize(self, *args): + width = int(root.geometry().split('x')[0]) + scalemax = ktrfile.timespan() / (width - self.constwidth) + self.scale.setmax(scalemax) + + def updatescroll(self): + self.names.updatescroll() + self.display.updatescroll() + def setcolor(self, tag, color): self.display.setcolor(tag, color) From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 14:06:30 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8602A106564A; Tue, 20 Jan 2009 14:06:30 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 745868FC13; Tue, 20 Jan 2009 14:06:30 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0KE6Up6047130; Tue, 20 Jan 2009 14:06:30 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0KE6U67047129; Tue, 20 Jan 2009 14:06:30 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200901201406.n0KE6U67047129@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 20 Jan 2009 14:06:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187472 - head/sys/dev/ofw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2009 14:06:31 -0000 Author: nwhitehorn Date: Tue Jan 20 14:06:30 2009 New Revision: 187472 URL: http://svn.freebsd.org/changeset/base/187472 Log: Set the wrong softc size when defining the ofw_iicbus class. Change it to the correct value. Modified: head/sys/dev/ofw/ofw_iicbus.c Modified: head/sys/dev/ofw/ofw_iicbus.c ============================================================================== --- head/sys/dev/ofw/ofw_iicbus.c Tue Jan 20 12:33:04 2009 (r187471) +++ head/sys/dev/ofw/ofw_iicbus.c Tue Jan 20 14:06:30 2009 (r187472) @@ -78,8 +78,8 @@ struct ofw_iicbus_devinfo { static devclass_t ofwiicbus_devclass; -DEFINE_CLASS_1(iicbus, ofw_iicbus_driver, ofw_iicbus_methods, 1 /* no softc */, - iicbus_driver); +DEFINE_CLASS_1(iicbus, ofw_iicbus_driver, ofw_iicbus_methods, + sizeof(struct iicbus_softc), iicbus_driver); DRIVER_MODULE(ofw_iicbus, iichb, ofw_iicbus_driver, ofwiicbus_devclass, 0, 0); MODULE_VERSION(ofw_iicbus, 1); MODULE_DEPEND(ofw_iicbus, iicbus, 1, 1, 1); From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 14:09:12 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E30B3106566B; Tue, 20 Jan 2009 14:09:12 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B73A08FC1C; Tue, 20 Jan 2009 14:09:12 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0KE9CAK047243; Tue, 20 Jan 2009 14:09:12 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0KE9Ctl047242; Tue, 20 Jan 2009 14:09:12 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200901201409.n0KE9Ctl047242@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 20 Jan 2009 14:09:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187473 - head/sys/powerpc/powermac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2009 14:09:13 -0000 Author: nwhitehorn Date: Tue Jan 20 14:09:12 2009 New Revision: 187473 URL: http://svn.freebsd.org/changeset/base/187473 Log: Fix a race condition in kiic(4) made possible by the way the device's STOP condition is sent. We used to put the bus in the STOP state, but returned without waiting for that to actually occur. Submitted by: Marco Trillo Modified: head/sys/powerpc/powermac/kiic.c Modified: head/sys/powerpc/powermac/kiic.c ============================================================================== --- head/sys/powerpc/powermac/kiic.c Tue Jan 20 14:06:30 2009 (r187472) +++ head/sys/powerpc/powermac/kiic.c Tue Jan 20 14:09:12 2009 (r187473) @@ -230,7 +230,7 @@ static void kiic_writereg(struct kiic_softc *sc, u_int reg, u_int val) { bus_write_1(sc->sc_reg, sc->sc_regstep * reg, val); - DELAY(10); /* XXX why? */ + DELAY(10); /* register access delay */ } static u_int @@ -289,18 +289,22 @@ kiic_intr(void *xsc) } if (isr & I2C_INT_DATA) { - if (sc->sc_resid > 0) { - if (sc->sc_flags & I2C_READING) { + if (sc->sc_flags & I2C_READING) { + if (sc->sc_resid > 0) { *sc->sc_data++ = kiic_readreg(sc, DATA); sc->sc_resid--; + } + + } else { + if (sc->sc_resid == 0) { + x = kiic_readreg(sc, CONTROL); + x |= I2C_CT_STOP; + kiic_writereg(sc, CONTROL, x); } else { kiic_writereg(sc, DATA, *sc->sc_data++); sc->sc_resid--; } } - - if (sc->sc_resid == 0) - wakeup(sc->sc_dev); } if (isr & I2C_INT_STOP) { @@ -317,7 +321,7 @@ static int kiic_transfer(device_t dev, struct iic_msg *msgs, uint32_t nmsgs) { struct kiic_softc *sc; - int i, x, timo; + int i, x, timo, err; uint8_t addr; sc = device_get_softc(dev); @@ -341,6 +345,7 @@ kiic_transfer(device_t dev, struct iic_m sc->sc_flags = I2C_BUSY; addr = msgs[i].slave; timo = 1000 + sc->sc_resid * 200; + timo += 100000; if (msgs[i].flags & IIC_M_RD) { sc->sc_flags |= I2C_READING; @@ -353,19 +358,13 @@ kiic_transfer(device_t dev, struct iic_m x = kiic_readreg(sc, CONTROL) | I2C_CT_ADDR; kiic_writereg(sc, CONTROL, x); - mtx_sleep(dev, &sc->sc_mutex, 0, "kiic", timo); - - if (!(sc->sc_flags & I2C_READING)) { - x = kiic_readreg(sc, CONTROL) | I2C_CT_STOP; - kiic_writereg(sc, CONTROL, x); - } - - mtx_sleep(dev, &sc->sc_mutex, 0, "kiic", timo); - + err = mtx_sleep(dev, &sc->sc_mutex, 0, "kiic", timo); + msgs[i].len -= sc->sc_resid; - if (sc->sc_flags & I2C_ERROR) { - device_printf(sc->sc_dev, "I2C_ERROR\n"); + if ((sc->sc_flags & I2C_ERROR) || err == EWOULDBLOCK) { + device_printf(sc->sc_dev, "I2C error\n"); + sc->sc_flags = 0; mtx_unlock(&sc->sc_mutex); return (-1); } From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 16:35:35 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3BB75106566C; Tue, 20 Jan 2009 16:35:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2AA368FC20; Tue, 20 Jan 2009 16:35:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0KGZZVP050371; Tue, 20 Jan 2009 16:35:35 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0KGZZUd050370; Tue, 20 Jan 2009 16:35:35 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200901201635.n0KGZZUd050370@svn.freebsd.org> From: John Baldwin Date: Tue, 20 Jan 2009 16:35:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187474 - head/sys/ufs/ufs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2009 16:35:35 -0000 Author: jhb Date: Tue Jan 20 16:35:34 2009 New Revision: 187474 URL: http://svn.freebsd.org/changeset/base/187474 Log: Add a comment explaining why the "bufwait" / "dirhash" LOR reported by WITNESS will not actually result in a deadlock. Discussed with: kib MFC after: 1 week Modified: head/sys/ufs/ufs/ufs_dirhash.c Modified: head/sys/ufs/ufs/ufs_dirhash.c ============================================================================== --- head/sys/ufs/ufs/ufs_dirhash.c Tue Jan 20 14:09:12 2009 (r187473) +++ head/sys/ufs/ufs/ufs_dirhash.c Tue Jan 20 16:35:34 2009 (r187474) @@ -126,6 +126,18 @@ static struct mtx ufsdirhash_mtx; * free a dirhash structure that was recycled by ufsdirhash_recycle(). * * The dirhash lock may be held across io operations. + * + * WITNESS reports a lock order reversal between the "bufwait" lock + * and the "dirhash" lock. However, this specific reversal will not + * cause a deadlock. To get a deadlock, one would have to lock a + * buffer followed by the dirhash while a second thread locked a + * buffer while holding the dirhash lock. The second order can happen + * under a shared or exclusive vnode lock for the associated directory + * in lookup(). The first order, however, can only happen under an + * exclusive vnode lock (e.g. unlink(), rename(), etc.). Thus, for + * a thread to be doing a "bufwait" -> "dirhash" order, it has to hold + * an exclusive vnode lock. That exclusive vnode lock will prevent + * any other threads from doing a "dirhash" -> "bufwait" order. */ static void From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 17:15:12 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9DAC9106566B; Tue, 20 Jan 2009 17:15:12 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 71DDD8FC17; Tue, 20 Jan 2009 17:15:12 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0KHFCSq051201; Tue, 20 Jan 2009 17:15:12 GMT (envelope-from rdivacky@svn.freebsd.org) Received: (from rdivacky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0KHFCfw051198; Tue, 20 Jan 2009 17:15:12 GMT (envelope-from rdivacky@svn.freebsd.org) Message-Id: <200901201715.n0KHFCfw051198@svn.freebsd.org> From: Roman Divacky Date: Tue, 20 Jan 2009 17:15:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187475 - head/usr.bin/make X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2009 17:15:13 -0000 Author: rdivacky Date: Tue Jan 20 17:15:12 2009 New Revision: 187475 URL: http://svn.freebsd.org/changeset/base/187475 Log: Remove inlining of functions that are used mostly in different object files. This gets rid of gnu89 style inlining. Also silence gcc by assigning two variables NULL. This lets use to remove NO_WERROR. Approved by: kib (mentor) Approved by: harti Modified: head/usr.bin/make/Makefile head/usr.bin/make/buf.c head/usr.bin/make/suff.c Modified: head/usr.bin/make/Makefile ============================================================================== --- head/usr.bin/make/Makefile Tue Jan 20 16:35:34 2009 (r187474) +++ head/usr.bin/make/Makefile Tue Jan 20 17:15:12 2009 (r187475) @@ -8,7 +8,6 @@ SRCS= arch.c buf.c cond.c dir.c for.c ha lst.c main.c make.c parse.c proc.c shell.c str.c suff.c targ.c \ util.c var.c -NO_WERROR= WARNS?= 6 NO_SHARED?= YES Modified: head/usr.bin/make/buf.c ============================================================================== --- head/usr.bin/make/buf.c Tue Jan 20 16:35:34 2009 (r187474) +++ head/usr.bin/make/buf.c Tue Jan 20 17:15:12 2009 (r187475) @@ -58,7 +58,7 @@ __FBSDID("$FreeBSD$"); * Returns the number of bytes in the buffer. Doesn't include the * null-terminating byte. */ -inline size_t +size_t Buf_Size(const Buffer *buf) { @@ -70,7 +70,7 @@ Buf_Size(const Buffer *buf) * * @note Adding data to the Buffer object may invalidate the reference. */ -inline char * +char * Buf_Data(const Buffer *bp) { @@ -98,7 +98,7 @@ BufExpand(Buffer *bp, size_t nb) /** * Add a single byte to the buffer. */ -inline void +void Buf_AddByte(Buffer *bp, Byte byte) { Modified: head/usr.bin/make/suff.c ============================================================================== --- head/usr.bin/make/suff.c Tue Jan 20 16:35:34 2009 (r187474) +++ head/usr.bin/make/suff.c Tue Jan 20 17:15:12 2009 (r187475) @@ -514,6 +514,7 @@ Suff_AddTransform(char *line) Suff *s; /* source suffix */ Suff *t; /* target suffix */ + s = t = NULL; /* silence gcc */ gn = SuffTransFind(line); if (gn == NULL) { /* From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 17:18:34 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E49810656CE; Tue, 20 Jan 2009 17:18:34 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (77-93-215-190.static.masterinter.net [77.93.215.190]) by mx1.freebsd.org (Postfix) with ESMTP id B9A978FC19; Tue, 20 Jan 2009 17:18:32 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id B212E9CB072; Tue, 20 Jan 2009 18:18:05 +0100 (CET) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by localhost (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4uSRFi2l9l34; Tue, 20 Jan 2009 18:18:03 +0100 (CET) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 6CB659CB094; Tue, 20 Jan 2009 18:18:03 +0100 (CET) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.2/8.14.3/Submit) id n0KHI3tw038059; Tue, 20 Jan 2009 18:18:03 +0100 (CET) (envelope-from rdivacky) Date: Tue, 20 Jan 2009 18:18:03 +0100 From: Roman Divacky To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <20090120171803.GA37717@freebsd.org> References: <200901201715.n0KHFCfw051198@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200901201715.n0KHFCfw051198@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: Subject: Re: svn commit: r187475 - head/usr.bin/make X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2009 17:18:35 -0000 On Tue, Jan 20, 2009 at 05:15:12PM +0000, Roman Divacky wrote: > Author: rdivacky > Date: Tue Jan 20 17:15:12 2009 > New Revision: 187475 > URL: http://svn.freebsd.org/changeset/base/187475 > > Log: > Remove inlining of functions that are used mostly in different object files. > This gets rid of gnu89 style inlining. Also silence gcc by assigning two > variables NULL. This lets use to remove NO_WERROR. does anyone know of some Makefile that is cpu intensive and not io bound? it might make sense to turn on -finline-functions in make but it would be nice to be able to measure the speedup (if any)... do we have some funny stuff written bsd make ? (computation of PI or something like that) roman From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 17:36:58 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8FF8A1065700; Tue, 20 Jan 2009 17:36:58 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7E7B88FC29; Tue, 20 Jan 2009 17:36:58 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0KHawCK051698; Tue, 20 Jan 2009 17:36:58 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0KHawqd051697; Tue, 20 Jan 2009 17:36:58 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200901201736.n0KHawqd051697@svn.freebsd.org> From: Alexander Motin Date: Tue, 20 Jan 2009 17:36:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187476 - head/sys/arm/at91 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2009 17:36:59 -0000 Author: mav Date: Tue Jan 20 17:36:58 2009 New Revision: 187476 URL: http://svn.freebsd.org/changeset/base/187476 Log: Implement MMCBR_IVAR_CAPS. It should better be implemented, or results can be unpredictable. PR: arm/128987 Modified: head/sys/arm/at91/at91_mci.c Modified: head/sys/arm/at91/at91_mci.c ============================================================================== --- head/sys/arm/at91/at91_mci.c Tue Jan 20 17:15:12 2009 (r187475) +++ head/sys/arm/at91/at91_mci.c Tue Jan 20 17:36:58 2009 (r187476) @@ -643,6 +643,9 @@ at91_mci_read_ivar(device_t bus, device_ case MMCBR_IVAR_VDD: *(int *)result = sc->host.ios.vdd; break; + case MMCBR_IVAR_CAPS: + *(int *)result = sc->host.caps; + break; case MMCBR_IVAR_MAX_DATA: *(int *)result = 1; break; @@ -683,6 +686,7 @@ at91_mci_write_ivar(device_t bus, device sc->host.ios.vdd = value; break; /* These are read-only */ + case MMCBR_IVAR_CAPS: case MMCBR_IVAR_HOST_OCR: case MMCBR_IVAR_F_MIN: case MMCBR_IVAR_F_MAX: From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 18:16:32 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 39C4A106566C; Tue, 20 Jan 2009 18:16:32 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0F5FB8FC1B; Tue, 20 Jan 2009 18:16:32 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0KIGV0u052782; Tue, 20 Jan 2009 18:16:31 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0KIGVpR052780; Tue, 20 Jan 2009 18:16:31 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200901201816.n0KIGVpR052780@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 20 Jan 2009 18:16:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187477 - head/sbin/ipfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2009 18:16:32 -0000 Author: luigi Date: Tue Jan 20 18:16:31 2009 New Revision: 187477 URL: http://svn.freebsd.org/changeset/base/187477 Log: Fix a number of (innocuous) warnings, and remove a useless test. There are still several signed/unsigned warnings left, which require a bit more study for a proper fix. This file has grown beyond reasonable limits. We really need to split it into separate components (ipv4, ipv6, dummynet, nat, table, userland-kernel communication ...) so we can make mainteinance easier. MFC after: 1 weeks Modified: head/sbin/ipfw/ipfw2.c Modified: head/sbin/ipfw/ipfw2.c ============================================================================== --- head/sbin/ipfw/ipfw2.c Tue Jan 20 17:36:58 2009 (r187476) +++ head/sbin/ipfw/ipfw2.c Tue Jan 20 18:16:31 2009 (r187477) @@ -787,11 +787,12 @@ altq_set_enabled(int enabled) } static void -altq_fetch() +altq_fetch(void) { struct pfioc_altq pfioc; struct pf_altq *altq; - int pffd, mnr; + int pffd; + unsigned int mnr; if (altq_fetched) return; @@ -1315,7 +1316,7 @@ static struct _s_x ext6hdrcodes[] = { }; /* fills command for the extension header filtering */ -int +static int fill_ext6hdr( ipfw_insn *cmd, char *av) { int tok; @@ -1371,7 +1372,7 @@ fill_ext6hdr( ipfw_insn *cmd, char *av) return 1; } -void +static void print_ext6hdr( ipfw_insn *cmd ) { char sep = ' '; @@ -1432,7 +1433,7 @@ print_ext6hdr( ipfw_insn *cmd ) #define HAVE_IP (HAVE_PROTO | HAVE_SRCIP | HAVE_DSTIP) static void -show_prerequisites(int *flags, int want, int cmd) +show_prerequisites(int *flags, int want, int cmd __unused) { if (comment_only) return; @@ -1440,14 +1441,14 @@ show_prerequisites(int *flags, int want, *flags |= HAVE_OPTIONS; if ( !(*flags & HAVE_OPTIONS)) { - if ( !(*flags & HAVE_PROTO) && (want & HAVE_PROTO)) + if ( !(*flags & HAVE_PROTO) && (want & HAVE_PROTO)) { if ( (*flags & HAVE_PROTO4)) printf(" ip4"); else if ( (*flags & HAVE_PROTO6)) printf(" ip6"); else printf(" ip"); - + } if ( !(*flags & HAVE_SRCIP) && (want & HAVE_SRCIP)) printf(" from any"); if ( !(*flags & HAVE_DSTIP) && (want & HAVE_DSTIP)) @@ -1462,7 +1463,7 @@ show_ipfw(struct ip_fw *rule, int pcwidt static int twidth = 0; int l; ipfw_insn *cmd, *tagptr = NULL; - char *comment = NULL; /* ptr to comment if we have one */ + const char *comment = NULL; /* ptr to comment if we have one */ int proto = 0; /* default */ int flags = 0; /* prerequisites */ ipfw_insn_log *logptr = NULL; /* set if we find an O_LOG */ @@ -2814,7 +2815,7 @@ fill_ip(ipfw_insn_ip *cmd, char *av) */ char *t = NULL, *p = strpbrk(av, "/:,{"); int masklen; - char md, nd; + char md, nd = '\0'; if (p) { md = *p; @@ -3122,7 +3123,7 @@ fill_ip6(ipfw_insn_ip6 *cmd, char *av) * it's supported lists of flow-id, so in the o.arg1 we store how many * additional flow-id we want to filter, the basic is 1 */ -void +static void fill_flow6( ipfw_insn_u32 *cmd, char *av ) { u_int32_t type; /* Current flow number */ @@ -3155,9 +3156,8 @@ add_srcip6(ipfw_insn *cmd, char *av) { fill_ip6((ipfw_insn_ip6 *)cmd, av); - if (F_LEN(cmd) == 0) /* any */ - ; - if (F_LEN(cmd) == F_INSN_SIZE(ipfw_insn)) { /* "me" */ + if (F_LEN(cmd) == 0) { /* any */ + } else if (F_LEN(cmd) == F_INSN_SIZE(ipfw_insn)) { /* "me" */ cmd->opcode = O_IP6_SRC_ME; } else if (F_LEN(cmd) == (F_INSN_SIZE(struct in6_addr) + F_INSN_SIZE(ipfw_insn))) { @@ -3174,9 +3174,8 @@ add_dstip6(ipfw_insn *cmd, char *av) { fill_ip6((ipfw_insn_ip6 *)cmd, av); - if (F_LEN(cmd) == 0) /* any */ - ; - if (F_LEN(cmd) == F_INSN_SIZE(ipfw_insn)) { /* "me" */ + if (F_LEN(cmd) == 0) { /* any */ + } else if (F_LEN(cmd) == F_INSN_SIZE(ipfw_insn)) { /* "me" */ cmd->opcode = O_IP6_DST_ME; } else if (F_LEN(cmd) == (F_INSN_SIZE(struct in6_addr) + F_INSN_SIZE(ipfw_insn))) { @@ -3859,7 +3858,8 @@ static void show_nat(int ac, char **av); static void -print_nat_config(char *buf) { +print_nat_config(unsigned char *buf) +{ struct cfg_nat *n; int i, cnt, flag, off; struct cfg_redir *t; @@ -4227,7 +4227,7 @@ config_pipe(int ac, char **av) "flow_id mask must be 20 bit"); *p20 = (uint32_t)a; } else if (pa6 != NULL) { - if (a < 0 || a > 128) + if (a > 128) errx(EX_DATAERR, "in6addr invalid mask len"); else From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 19:09:41 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EBB9C106564A; Tue, 20 Jan 2009 19:09:41 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id A8CBE8FC17; Tue, 20 Jan 2009 19:09:41 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.3/8.14.2) with ESMTP id n0KJB4RU032928; Tue, 20 Jan 2009 14:11:04 -0500 (EST) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by zim.MIT.EDU (8.14.3/8.14.2/Submit) id n0KJB40f032927; Tue, 20 Jan 2009 14:11:04 -0500 (EST) (envelope-from das@FreeBSD.ORG) Date: Tue, 20 Jan 2009 14:11:04 -0500 From: David Schultz To: Roman Divacky Message-ID: <20090120191104.GA32825@zim.MIT.EDU> Mail-Followup-To: Roman Divacky , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <200901201715.n0KHFCfw051198@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200901201715.n0KHFCfw051198@svn.freebsd.org> Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r187475 - head/usr.bin/make X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2009 19:09:42 -0000 On Tue, Jan 20, 2009, Roman Divacky wrote: > Remove inlining of functions that are used mostly in different object files. > This gets rid of gnu89 style inlining. While I think fixing uses of 'inline' in the tree is a great goal, un-inlining accessor functions that compile down to a single machine instruction anyway may not be the best way to approach it. In cases like this, you can just use '__gnu89_inline', or even 'static inline' without causing any bloat. (In this particular case, I doubt that it really matters one way or the other.) From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 19:43:53 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C1357106566B; Tue, 20 Jan 2009 19:43:53 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 8FF6F8FC18; Tue, 20 Jan 2009 19:43:53 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (pool-98-109-39-197.nwrknj.fios.verizon.net [98.109.39.197]) by cyrus.watson.org (Postfix) with ESMTPSA id 23EC846B38; Tue, 20 Jan 2009 14:43:53 -0500 (EST) Received: from localhost (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id n0KJhaUs026295; Tue, 20 Jan 2009 14:43:47 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: "Antoine Brodin" Date: Tue, 20 Jan 2009 10:29:14 -0500 User-Agent: KMail/1.9.7 References: <200812171957.mBHJvCO2013765@svn.freebsd.org> <9bbcef730812271319g60e190acj4a68ee419edc7277@mail.gmail.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200901201029.14971.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Tue, 20 Jan 2009 14:43:47 -0500 (EST) X-Virus-Scanned: ClamAV 0.94.2/8881/Tue Jan 20 09:48:51 2009 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.1 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00, DATE_IN_PAST_03_06 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, ivoras@freebsd.org Subject: Re: svn commit: r186252 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2009 19:43:54 -0000 On Saturday 27 December 2008 4:47:45 pm Antoine Brodin wrote: > On Sat, Dec 27, 2008 at 10:19 PM, wrote: > > On 27/12/2008, Antoine Brodin wrote: > >> On Wed, Dec 17, 2008 at 8:57 PM, Ivan Voras wrote: > > > >> Modified: head/sys/kern/subr_param.c > >> [snip] > >>> +enum VM_GUEST { VM_GUEST_NO, VM_GUEST_VM, VM_GUEST_XEN }; > >>> + > >> [snip] > >>> - hz = detect_virtual() ? HZ_VM : HZ; > >>> + hz = vm_guest > VM_GUEST_NO ? HZ_VM : HZ; > >> [snip] > >> > >> Hi Ivan, > >> > >> Could you change VM_GUEST_NO / VM_GUEST_VM / VM_GUEST_XEN to a #define > >> or explicitly initialize them? > >> The magnitude comparison between vm_guest and VM_GUEST_NO looks like > >> gratuitous obfuscation. > > > > I think that the "enum" type is very well defined and its behaviour > > widely known so it is not necessary to break it into #defines. Would > > you be happy if I explicitly initalized the first member of the enum > > to signify its values are important? > > > > enum VM_GUEST { VM_GUEST_NO = 0, VM_GUEST_VM, VM_GUEST_XEN }; > > > > I would be happy if you initialized explicitly the 3 values. > You use these values as an index in the vm_guest_sysctl_names array > and you compare them in init_param1() so I think it's better to be > explicit. The definition of enum values is well defined in C. Thus, one should not be explicitly initializing all the values, and using > to compare enum values is perfectly acceptable. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 19:44:16 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 52B06106566B; Tue, 20 Jan 2009 19:44:16 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 22BCD8FC18; Tue, 20 Jan 2009 19:44:16 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (pool-98-109-39-197.nwrknj.fios.verizon.net [98.109.39.197]) by cyrus.watson.org (Postfix) with ESMTPSA id AB36646B3B; Tue, 20 Jan 2009 14:44:15 -0500 (EST) Received: from localhost (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id n0KJhaUw026295; Tue, 20 Jan 2009 14:44:09 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: Patrick Hurrelmann Date: Tue, 20 Jan 2009 13:07:30 -0500 User-Agent: KMail/1.9.7 References: <200901072152.n07Lql7h000807@svn.freebsd.org> <200901151031.42725.jhb@freebsd.org> <20090120104612.2224983f@attini-ws2> In-Reply-To: <20090120104612.2224983f@attini-ws2> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200901201307.30983.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Tue, 20 Jan 2009 14:44:09 -0500 (EST) X-Virus-Scanned: ClamAV 0.94.2/8881/Tue Jan 20 09:48:51 2009 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: svn-src-head@freebsd.org, Marius Strobl , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r186878 - head/sys/dev/mpt X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2009 19:44:17 -0000 On Tuesday 20 January 2009 4:46:12 am Patrick Hurrelmann wrote: > On Thu, 15 Jan 2009 10:31:42 -0500 > John Baldwin wrote: > > > On Wednesday 07 January 2009 4:52:47 pm Marius Strobl wrote: > > > Author: marius > > > Date: Wed Jan 7 21:52:47 2009 > > > New Revision: 186878 > > > URL: http://svn.freebsd.org/changeset/base/186878 > > > > > > Log: > > > Make the whole initiator mode part of mpt(4) endian-clean, > > > specifically SPI controllers now also work in big-endian > > > machines and some conversions relevant for FC and SAS > > > controllers as well as support for ILP32 machines which all > > > were omitted in previous attempts are now also implemented. > > > The IOCTL-interface is intentionally left (and where needed > > > actually changed) to be completely little-endian as otherwise > > > we would have to add conversion code for every possible > > > configuration page to mpt(4), which didn't seem the right > > > thing to do, neither did converting only half of the user- > > > interface to the native byte order. > > > This change was tested on amd64 (SAS+SPI), i386 (SAS) and > > > sparc64 (SAS+SPI). Due to lack of the necessary hardware > > > the target mode code is still left to be made endian-clean. > > > > > > Reviewed by: scottl > > > MFC after: 1 month > > > > If you wish to test the mpt_user interface on a big-endian machine > > you may use //depot/jhb/raid/usr.sbin/mptutil/... > > > > It is likely going to need a lot of sprinkled htole*() and letoh*() > > though. > > Hi John, > > great to hear that! I just checked out mptutil on 7.0 and it works > fine with a bunch of Dell PERC 5iR :) > > Do you mind if i grab the sources and create a port of it? I guess many > people are eagerly waiting to monitor their mpt arrays as stated on > several lists. This would also give mptutil a much greater base of > testers. Actually, I probably want to commit it into HEAD. If you want a monitoring daemon you can look at 'mptd' in the same p4 branch (and 'ard' for monitoring ata-raid volumes). -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 19:58:01 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB9C1106566B; Tue, 20 Jan 2009 19:58:01 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B9ECD8FC0C; Tue, 20 Jan 2009 19:58:01 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0KJw1sW055126; Tue, 20 Jan 2009 19:58:01 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0KJw1vr055125; Tue, 20 Jan 2009 19:58:01 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200901201958.n0KJw1vr055125@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 20 Jan 2009 19:58:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187481 - head/sys/dev/re X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2009 19:58:02 -0000 Author: jkim Date: Tue Jan 20 19:58:01 2009 New Revision: 187481 URL: http://svn.freebsd.org/changeset/base/187481 Log: - Do not read and write RX configuration register multiple times. - Always program RX configuration register from scratch instead of doing read/modify/write. - Rename re_setmulti() to re_set_rxmode() to be reflect reality. - Simplify hash filter logic a little while I am here. Reviewed by: yongari (early version) Modified: head/sys/dev/re/if_re.c Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Tue Jan 20 19:41:18 2009 (r187480) +++ head/sys/dev/re/if_re.c Tue Jan 20 19:58:01 2009 (r187481) @@ -266,7 +266,7 @@ static int re_miibus_readreg (device_t, static int re_miibus_writereg (device_t, int, int, int); static void re_miibus_statchg (device_t); -static void re_setmulti (struct rl_softc *); +static void re_set_rxmode (struct rl_softc *); static void re_reset (struct rl_softc *); static void re_setwol (struct rl_softc *); static void re_clrwol (struct rl_softc *); @@ -607,26 +607,23 @@ re_miibus_statchg(device_t dev) } /* - * Program the 64-bit multicast hash filter. + * Set the RX configuration and 64-bit multicast hash filter. */ static void -re_setmulti(struct rl_softc *sc) +re_set_rxmode(struct rl_softc *sc) { struct ifnet *ifp; - int h = 0; - u_int32_t hashes[2] = { 0, 0 }; struct ifmultiaddr *ifma; - u_int32_t rxfilt; - int mcnt = 0; + uint32_t hashes[2] = { 0, 0 }; + uint32_t h, rxfilt; RL_LOCK_ASSERT(sc); ifp = sc->rl_ifp; + rxfilt = RL_RXCFG_CONFIG | RL_RXCFG_RX_INDIV | RL_RXCFG_RX_BROAD; - rxfilt = CSR_READ_4(sc, RL_RXCFG); - rxfilt &= ~(RL_RXCFG_RX_ALLPHYS | RL_RXCFG_RX_MULTI); - if (ifp->if_flags & IFF_ALLMULTI || ifp->if_flags & IFF_PROMISC) { + if (ifp->if_flags & (IFF_ALLMULTI | IFF_PROMISC)) { if (ifp->if_flags & IFF_PROMISC) rxfilt |= RL_RXCFG_RX_ALLPHYS; /* @@ -635,17 +632,10 @@ re_setmulti(struct rl_softc *sc) * promiscuous mode. */ rxfilt |= RL_RXCFG_RX_MULTI; - CSR_WRITE_4(sc, RL_RXCFG, rxfilt); - CSR_WRITE_4(sc, RL_MAR0, 0xFFFFFFFF); - CSR_WRITE_4(sc, RL_MAR4, 0xFFFFFFFF); - return; + hashes[0] = hashes[1] = 0xffffffff; + goto done; } - /* first, zot all the existing hash bits */ - CSR_WRITE_4(sc, RL_MAR0, 0); - CSR_WRITE_4(sc, RL_MAR4, 0); - - /* now program new ones */ IF_ADDR_LOCK(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) @@ -656,31 +646,29 @@ re_setmulti(struct rl_softc *sc) hashes[0] |= (1 << h); else hashes[1] |= (1 << (h - 32)); - mcnt++; } IF_ADDR_UNLOCK(ifp); - if (mcnt) + if (hashes[0] != 0 || hashes[1] != 0) { + /* + * For some unfathomable reason, RealTek decided to + * reverse the order of the multicast hash registers + * in the PCI Express parts. This means we have to + * write the hash pattern in reverse order for those + * devices. + */ + if ((sc->rl_flags & RL_FLAG_INVMAR) != 0) { + h = bswap32(hashes[0]); + hashes[0] = bswap32(hashes[1]); + hashes[1] = h; + } rxfilt |= RL_RXCFG_RX_MULTI; - else - rxfilt &= ~RL_RXCFG_RX_MULTI; + } +done: + CSR_WRITE_4(sc, RL_MAR0, hashes[0]); + CSR_WRITE_4(sc, RL_MAR4, hashes[1]); CSR_WRITE_4(sc, RL_RXCFG, rxfilt); - - /* - * For some unfathomable reason, RealTek decided to reverse - * the order of the multicast hash registers in the PCI Express - * parts. This means we have to write the hash pattern in reverse - * order for those devices. - */ - - if ((sc->rl_flags & RL_FLAG_INVMAR) != 0) { - CSR_WRITE_4(sc, RL_MAR0, bswap32(hashes[1])); - CSR_WRITE_4(sc, RL_MAR4, bswap32(hashes[0])); - } else { - CSR_WRITE_4(sc, RL_MAR0, hashes[0]); - CSR_WRITE_4(sc, RL_MAR4, hashes[1]); - } } static void @@ -2498,7 +2486,6 @@ re_init_locked(struct rl_softc *sc) { struct ifnet *ifp = sc->rl_ifp; struct mii_data *mii; - u_int32_t rxcfg = 0; uint16_t cfg; union { uint32_t align_dummy; @@ -2583,7 +2570,7 @@ re_init_locked(struct rl_softc *sc) CSR_WRITE_1(sc, RL_COMMAND, RL_CMD_TX_ENB|RL_CMD_RX_ENB); /* - * Set the initial TX and RX configuration. + * Set the initial TX configuration. */ if (sc->rl_testmode) { if (sc->rl_type == RL_8169) @@ -2597,32 +2584,10 @@ re_init_locked(struct rl_softc *sc) CSR_WRITE_1(sc, RL_EARLY_TX_THRESH, 16); - CSR_WRITE_4(sc, RL_RXCFG, RL_RXCFG_CONFIG); - - /* Set the individual bit to receive frames for this host only. */ - rxcfg = CSR_READ_4(sc, RL_RXCFG); - rxcfg |= RL_RXCFG_RX_INDIV; - - /* If we want promiscuous mode, set the allframes bit. */ - if (ifp->if_flags & IFF_PROMISC) - rxcfg |= RL_RXCFG_RX_ALLPHYS; - else - rxcfg &= ~RL_RXCFG_RX_ALLPHYS; - CSR_WRITE_4(sc, RL_RXCFG, rxcfg); - - /* - * Set capture broadcast bit to capture broadcast frames. - */ - if (ifp->if_flags & IFF_BROADCAST) - rxcfg |= RL_RXCFG_RX_BROAD; - else - rxcfg &= ~RL_RXCFG_RX_BROAD; - CSR_WRITE_4(sc, RL_RXCFG, rxcfg); - /* - * Program the multicast filter, if necessary. + * Set the initial RX configuration. */ - re_setmulti(sc); + re_set_rxmode(sc); #ifdef DEVICE_POLLING /* @@ -2761,7 +2726,7 @@ re_ioctl(struct ifnet *ifp, u_long comma if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { if (((ifp->if_flags ^ sc->rl_if_flags) & (IFF_PROMISC | IFF_ALLMULTI)) != 0) - re_setmulti(sc); + re_set_rxmode(sc); } else re_init_locked(sc); } else { @@ -2774,7 +2739,7 @@ re_ioctl(struct ifnet *ifp, u_long comma case SIOCADDMULTI: case SIOCDELMULTI: RL_LOCK(sc); - re_setmulti(sc); + re_set_rxmode(sc); RL_UNLOCK(sc); break; case SIOCGIFMEDIA: From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 20:04:10 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99479106567D; Tue, 20 Jan 2009 20:04:10 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6D07E8FC17; Tue, 20 Jan 2009 20:04:10 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0KK4AlW055303; Tue, 20 Jan 2009 20:04:10 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0KK4AP8055301; Tue, 20 Jan 2009 20:04:10 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200901202004.n0KK4AP8055301@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 20 Jan 2009 20:04:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187482 - in head/sys: dev/re pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2009 20:04:11 -0000 Author: jkim Date: Tue Jan 20 20:04:09 2009 New Revision: 187482 URL: http://svn.freebsd.org/changeset/base/187482 Log: Retire RL_FLAG_INVMAR bit to match its comment and reality. Modified: head/sys/dev/re/if_re.c head/sys/pci/if_rlreg.h Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Tue Jan 20 19:58:01 2009 (r187481) +++ head/sys/dev/re/if_re.c Tue Jan 20 20:04:09 2009 (r187482) @@ -657,7 +657,7 @@ re_set_rxmode(struct rl_softc *sc) * write the hash pattern in reverse order for those * devices. */ - if ((sc->rl_flags & RL_FLAG_INVMAR) != 0) { + if ((sc->rl_flags & RL_FLAG_PCIE) != 0) { h = bswap32(hashes[0]); hashes[0] = bswap32(hashes[1]); hashes[1] = h; @@ -1234,22 +1234,21 @@ re_attach(device_t dev) break; case RL_HWREV_8100E: case RL_HWREV_8101E: - sc->rl_flags |= RL_FLAG_NOJUMBO | RL_FLAG_INVMAR | - RL_FLAG_PHYWAKE | RL_FLAG_FASTETHER; + sc->rl_flags |= RL_FLAG_NOJUMBO | RL_FLAG_PHYWAKE | + RL_FLAG_FASTETHER; break; case RL_HWREV_8102E: case RL_HWREV_8102EL: - sc->rl_flags |= RL_FLAG_NOJUMBO | RL_FLAG_INVMAR | - RL_FLAG_PHYWAKE | RL_FLAG_PAR | RL_FLAG_DESCV2 | - RL_FLAG_MACSTAT | RL_FLAG_FASTETHER | RL_FLAG_CMDSTOP; + sc->rl_flags |= RL_FLAG_NOJUMBO | RL_FLAG_PHYWAKE | + RL_FLAG_PAR | RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | + RL_FLAG_FASTETHER | RL_FLAG_CMDSTOP; break; case RL_HWREV_8168_SPIN1: case RL_HWREV_8168_SPIN2: sc->rl_flags |= RL_FLAG_WOLRXENB; /* FALLTHROUGH */ case RL_HWREV_8168_SPIN3: - sc->rl_flags |= RL_FLAG_INVMAR | RL_FLAG_PHYWAKE | - RL_FLAG_MACSTAT; + sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_MACSTAT; break; case RL_HWREV_8168C_SPIN2: sc->rl_flags |= RL_FLAG_MACSLEEP; @@ -1260,9 +1259,8 @@ re_attach(device_t dev) /* FALLTHROUGH */ case RL_HWREV_8168CP: case RL_HWREV_8168D: - sc->rl_flags |= RL_FLAG_INVMAR | RL_FLAG_PHYWAKE | - RL_FLAG_PAR | RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | - RL_FLAG_CMDSTOP; + sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PAR | + RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | RL_FLAG_CMDSTOP; /* * These controllers support jumbo frame but it seems * that enabling it requires touching additional magic Modified: head/sys/pci/if_rlreg.h ============================================================================== --- head/sys/pci/if_rlreg.h Tue Jan 20 19:58:01 2009 (r187481) +++ head/sys/pci/if_rlreg.h Tue Jan 20 20:04:09 2009 (r187482) @@ -879,7 +879,6 @@ struct rl_softc { int rl_txstart; uint32_t rl_flags; #define RL_FLAG_MSI 0x0001 -#define RL_FLAG_INVMAR 0x0004 #define RL_FLAG_PHYWAKE 0x0008 #define RL_FLAG_NOJUMBO 0x0010 #define RL_FLAG_PAR 0x0020 From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 20:22:29 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F31821065670; Tue, 20 Jan 2009 20:22:28 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E087F8FC13; Tue, 20 Jan 2009 20:22:28 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0KKMSC0055679; Tue, 20 Jan 2009 20:22:28 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0KKMS7f055677; Tue, 20 Jan 2009 20:22:28 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200901202022.n0KKMS7f055677@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 20 Jan 2009 20:22:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187483 - in head/sys: dev/re pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2009 20:22:29 -0000 Author: jkim Date: Tue Jan 20 20:22:28 2009 New Revision: 187483 URL: http://svn.freebsd.org/changeset/base/187483 Log: - Add support for 8110SCe part. Some magic registers were taken from Linux driver. - Swap hardware revisions for 8110S and 8169S as Linux driver claims. Reviewed by: yongari (early version) Modified: head/sys/dev/re/if_re.c head/sys/pci/if_rlreg.h Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Tue Jan 20 20:04:09 2009 (r187482) +++ head/sys/dev/re/if_re.c Tue Jan 20 20:22:28 2009 (r187483) @@ -199,9 +199,10 @@ static struct rl_hwrev re_hwrevs[] = { { RL_HWREV_8169, RL_8169, "8169"}, { RL_HWREV_8169S, RL_8169, "8169S"}, { RL_HWREV_8110S, RL_8169, "8110S"}, - { RL_HWREV_8169_8110SB, RL_8169, "8169SB"}, - { RL_HWREV_8169_8110SC, RL_8169, "8169SC"}, - { RL_HWREV_8169_8110SBL, RL_8169, "8169SBL"}, + { RL_HWREV_8169_8110SB, RL_8169, "8169SB/8110SB"}, + { RL_HWREV_8169_8110SC, RL_8169, "8169SC/8110SC"}, + { RL_HWREV_8169_8110SBL, RL_8169, "8169SBL/8110SBL"}, + { RL_HWREV_8169_8110SCE, RL_8169, "8169SC/8110SC"}, { RL_HWREV_8100, RL_8139, "8100"}, { RL_HWREV_8101, RL_8139, "8101"}, { RL_HWREV_8100E, RL_8169, "8100E"}, @@ -688,12 +689,10 @@ re_reset(struct rl_softc *sc) if (i == RL_TIMEOUT) device_printf(sc->rl_dev, "reset never completed!\n"); - if ((sc->rl_flags & RL_FLAG_PHY8169) != 0) + if ((sc->rl_flags & RL_FLAG_MACRESET) != 0) CSR_WRITE_1(sc, 0x82, 1); - if ((sc->rl_flags & RL_FLAG_PHY8110S) != 0) { - CSR_WRITE_1(sc, 0x82, 1); - re_gmii_writereg(sc->rl_dev, 1, 0x0B, 0); - } + if (sc->rl_hwrev == RL_HWREV_8169S) + re_gmii_writereg(sc->rl_dev, 1, 0x0b, 0); } #ifdef RE_DIAG @@ -1209,12 +1208,22 @@ re_attach(device_t dev) hw_rev = re_hwrevs; hwrev = CSR_READ_4(sc, RL_TXCFG); - device_printf(dev, "Chip rev. 0x%08x\n", hwrev & 0x7c800000); + switch (hwrev & 0x70000000) { + case 0x00000000: + case 0x10000000: + device_printf(dev, "Chip rev. 0x%08x\n", hwrev & 0xfc800000); + hwrev &= (RL_TXCFG_HWREV | 0x80000000); + break; + default: + device_printf(dev, "Chip rev. 0x%08x\n", hwrev & 0x7c800000); + hwrev &= RL_TXCFG_HWREV; + break; + } device_printf(dev, "MAC rev. 0x%08x\n", hwrev & 0x00700000); - hwrev &= RL_TXCFG_HWREV; while (hw_rev->rl_desc != NULL) { if (hw_rev->rl_rev == hwrev) { sc->rl_type = hw_rev->rl_type; + sc->rl_hwrev = hw_rev->rl_rev; break; } hw_rev++; @@ -1229,9 +1238,6 @@ re_attach(device_t dev) case RL_HWREV_8139CPLUS: sc->rl_flags |= RL_FLAG_NOJUMBO | RL_FLAG_FASTETHER; break; - case RL_HWREV_8110S: - sc->rl_flags |= RL_FLAG_PHY8110S; - break; case RL_HWREV_8100E: case RL_HWREV_8101E: sc->rl_flags |= RL_FLAG_NOJUMBO | RL_FLAG_PHYWAKE | @@ -1273,14 +1279,16 @@ re_attach(device_t dev) */ sc->rl_flags |= RL_FLAG_NOJUMBO; break; - case RL_HWREV_8169: - case RL_HWREV_8169S: - sc->rl_flags |= RL_FLAG_PHY8169; - break; case RL_HWREV_8169_8110SB: - case RL_HWREV_8169_8110SC: case RL_HWREV_8169_8110SBL: - sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PHY8169; + case RL_HWREV_8169_8110SC: + case RL_HWREV_8169_8110SCE: + sc->rl_flags |= RL_FLAG_PHYWAKE; + /* FALLTHROUGH */ + case RL_HWREV_8169: + case RL_HWREV_8169S: + case RL_HWREV_8110S: + sc->rl_flags |= RL_FLAG_MACRESET; break; default: break; @@ -2484,6 +2492,7 @@ re_init_locked(struct rl_softc *sc) { struct ifnet *ifp = sc->rl_ifp; struct mii_data *mii; + uint32_t reg; uint16_t cfg; union { uint32_t align_dummy; @@ -2519,6 +2528,17 @@ re_init_locked(struct rl_softc *sc) } else cfg |= RL_CPLUSCMD_RXENB | RL_CPLUSCMD_TXENB; CSR_WRITE_2(sc, RL_CPLUS_CMD, cfg); + if (sc->rl_hwrev == RL_HWREV_8169_8110SC || + sc->rl_hwrev == RL_HWREV_8169_8110SCE) { + reg = 0x000fff00; + if ((CSR_READ_1(sc, RL_CFG2) & RL_CFG2_PCI66MHZ) != 0) + reg |= 0x000000ff; + if (sc->rl_hwrev == RL_HWREV_8169_8110SCE) + reg |= 0x00f00000; + CSR_WRITE_4(sc, 0x7c, reg); + /* Disable interrupt mitigation. */ + CSR_WRITE_2(sc, 0xe2, 0); + } /* * Disable TSO if interface MTU size is greater than MSS * allowed in controller. Modified: head/sys/pci/if_rlreg.h ============================================================================== --- head/sys/pci/if_rlreg.h Tue Jan 20 20:04:09 2009 (r187482) +++ head/sys/pci/if_rlreg.h Tue Jan 20 20:22:28 2009 (r187483) @@ -154,8 +154,8 @@ /* Known revision codes. */ #define RL_HWREV_8169 0x00000000 -#define RL_HWREV_8110S 0x00800000 -#define RL_HWREV_8169S 0x04000000 +#define RL_HWREV_8169S 0x00800000 +#define RL_HWREV_8110S 0x04000000 #define RL_HWREV_8169_8110SB 0x10000000 #define RL_HWREV_8169_8110SC 0x18000000 #define RL_HWREV_8102EL 0x24800000 @@ -180,6 +180,7 @@ #define RL_HWREV_8101 0x74c00000 #define RL_HWREV_8100 0x78800000 #define RL_HWREV_8169_8110SBL 0x7CC00000 +#define RL_HWREV_8169_8110SCE 0x98000000 #define RL_TXDMA_16BYTES 0x00000000 #define RL_TXDMA_32BYTES 0x00000100 @@ -886,8 +887,7 @@ struct rl_softc { #define RL_FLAG_MACSTAT 0x0080 #define RL_FLAG_FASTETHER 0x0100 #define RL_FLAG_CMDSTOP 0x0200 -#define RL_FLAG_PHY8169 0x0400 -#define RL_FLAG_PHY8110S 0x0800 +#define RL_FLAG_MACRESET 0x0400 #define RL_FLAG_WOLRXENB 0x1000 #define RL_FLAG_MACSLEEP 0x2000 #define RL_FLAG_PCIE 0x4000 From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 21:37:41 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 936141065674; Tue, 20 Jan 2009 21:37:41 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 82FED8FC1C; Tue, 20 Jan 2009 21:37:41 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0KLbfqF057260; Tue, 20 Jan 2009 21:37:41 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0KLbfKU057259; Tue, 20 Jan 2009 21:37:41 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200901202137.n0KLbfKU057259@svn.freebsd.org> From: Andrew Thompson Date: Tue, 20 Jan 2009 21:37:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187486 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2009 21:37:42 -0000 Author: thompsa Date: Tue Jan 20 21:37:41 2009 New Revision: 187486 URL: http://svn.freebsd.org/changeset/base/187486 Log: Dont assume $MACHINE is set, this breaks for regular builds. Reported by: pho Modified: head/sys/conf/newvers.sh Modified: head/sys/conf/newvers.sh ============================================================================== --- head/sys/conf/newvers.sh Tue Jan 20 20:41:41 2009 (r187485) +++ head/sys/conf/newvers.sh Tue Jan 20 21:37:41 2009 (r187486) @@ -91,7 +91,9 @@ for dir in /bin /usr/bin /usr/local/bin; if [ -x "${dir}/svnversion" ]; then svnversion=${dir}/svnversion SRCDIR=${d##*obj} - SRCDIR=${SRCDIR##/$MACHINE} + if [ -n "$MACHINE" ]; then + SRCDIR=${SRCDIR##/$MACHINE} + fi SRCDIR=${SRCDIR%%/sys/*} break fi From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 22:00:20 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 099881065709; Tue, 20 Jan 2009 22:00:20 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D0D6F8FC1A; Tue, 20 Jan 2009 22:00:19 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0KM0JrY057841; Tue, 20 Jan 2009 22:00:19 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0KM0JjF057840; Tue, 20 Jan 2009 22:00:19 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200901202200.n0KM0JjF057840@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 20 Jan 2009 22:00:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187490 - head/sys/ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2009 22:00:20 -0000 Author: kib Date: Tue Jan 20 22:00:19 2009 New Revision: 187490 URL: http://svn.freebsd.org/changeset/base/187490 Log: The r187467 should remove all pages for V_NORMAL case too, because indirect block pages are not removed by the mentioned invocation of the vnode_pager_setsize(). Put a common code into the helper function ffs_pages_remove(). Reported and tested by: dchagin Reviewed by: ups MFC after: 3 weeks Modified: head/sys/ufs/ffs/ffs_inode.c Modified: head/sys/ufs/ffs/ffs_inode.c ============================================================================== --- head/sys/ufs/ffs/ffs_inode.c Tue Jan 20 21:57:07 2009 (r187489) +++ head/sys/ufs/ffs/ffs_inode.c Tue Jan 20 22:00:19 2009 (r187490) @@ -129,6 +129,18 @@ ffs_update(vp, waitfor) } } +static void +ffs_pages_remove(struct vnode *vp, vm_pindex_t start, vm_pindex_t end) +{ + vm_object_t object; + + if ((object = vp->v_object) == NULL) + return; + VM_OBJECT_LOCK(object); + vm_object_page_remove(object, start, end, FALSE); + VM_OBJECT_UNLOCK(object); +} + #define SINGLE 0 /* index of single indirect block */ #define DOUBLE 1 /* index of double indirect block */ #define TRIPLE 2 /* index of triple indirect block */ @@ -152,7 +164,6 @@ ffs_truncate(vp, length, flags, cred, td struct fs *fs; struct buf *bp; struct ufsmount *ump; - vm_object_t object; int needextclean, softdepslowdown, extblocks; int offset, size, level, nblocks; int i, error, allerror; @@ -207,13 +218,8 @@ ffs_truncate(vp, length, flags, cred, td (void) chkdq(ip, -extblocks, NOCRED, 0); #endif vinvalbuf(vp, V_ALT, 0, 0); - if ((object = vp->v_object) != NULL) { - VM_OBJECT_LOCK(object); - vm_object_page_remove(object, - OFF_TO_IDX(lblktosize(fs, -extblocks)), 0, - FALSE); - VM_OBJECT_UNLOCK(object); - } + ffs_pages_remove(vp, + OFF_TO_IDX(lblktosize(fs, -extblocks)), 0); ip->i_din2->di_extsize = 0; for (i = 0; i < NXADDR; i++) { oldblks[i] = ip->i_din2->di_extb[i]; @@ -290,6 +296,9 @@ ffs_truncate(vp, length, flags, cred, td IO_EXT | IO_NORMAL : IO_NORMAL); ASSERT_VOP_LOCKED(vp, "ffs_truncate1"); vinvalbuf(vp, needextclean ? 0 : V_NORMAL, 0, 0); + if (!needextclean) + ffs_pages_remove(vp, 0, + OFF_TO_IDX(lblktosize(fs, -extblocks))); vnode_pager_setsize(vp, 0); ip->i_flag |= IN_CHANGE | IN_UPDATE; return (ffs_update(vp, 0)); From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 22:17:06 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 023A9106566B; Tue, 20 Jan 2009 22:17:06 +0000 (UTC) (envelope-from emax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E3C0E8FC08; Tue, 20 Jan 2009 22:17:05 +0000 (UTC) (envelope-from emax@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0KMH5SV058354; Tue, 20 Jan 2009 22:17:05 GMT (envelope-from emax@svn.freebsd.org) Received: (from emax@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0KMH5U8058352; Tue, 20 Jan 2009 22:17:05 GMT (envelope-from emax@svn.freebsd.org) Message-Id: <200901202217.n0KMH5U8058352@svn.freebsd.org> From: Maksim Yevmenkin Date: Tue, 20 Jan 2009 22:17:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187494 - head/sys/dev/usb2/bluetooth X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2009 22:17:06 -0000 Author: emax Date: Tue Jan 20 22:17:05 2009 New Revision: 187494 URL: http://svn.freebsd.org/changeset/base/187494 Log: Update (well, actually rewrite mostly) ng_ubt2 driver for USB2. Reviewed by: HPS, alfred Blessed by: HPS Modified: head/sys/dev/usb2/bluetooth/ng_ubt2.c head/sys/dev/usb2/bluetooth/ng_ubt2_var.h Modified: head/sys/dev/usb2/bluetooth/ng_ubt2.c ============================================================================== --- head/sys/dev/usb2/bluetooth/ng_ubt2.c Tue Jan 20 22:06:07 2009 (r187493) +++ head/sys/dev/usb2/bluetooth/ng_ubt2.c Tue Jan 20 22:17:05 2009 (r187494) @@ -3,7 +3,7 @@ */ /*- - * Copyright (c) 2001-2002 Maksim Yevmenkin + * Copyright (c) 2001-2009 Maksim Yevmenkin * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -31,6 +31,69 @@ * $FreeBSD$ */ +/* + * NOTE: ng_ubt2 driver has a split personality. On one side it is + * a USB2 device driver and on the other it is a Netgraph node. This + * driver will *NOT* create traditional /dev/ enties, only Netgraph + * node. + * + * NOTE ON LOCKS USED: ng_ubt2 drives uses 3 locks (mutexes) + * + * 1) sc_if_mtx[0] - lock for device's interface #0. This lock is used + * by USB2 for any USB request going over device's interface #0, i.e. + * interrupt, control and bulk transfers. + * + * 2) sc_if_mtx[1] - lock for device's interface #1. This lock is used + * by USB2 for any USB request going over device's interface #1, i.e + * isoc. transfers. + * + * 3) sc_mbufq_mtx - lock for mbufq and task flags. This lock is used + * to protect device's outgoing mbuf queues and task flags. This lock + * *SHOULD NOT* be grabbed for a long time. In fact, think of it as a + * spin lock. + * + * NOTE ON LOCKING STRATEGY: ng_ubt2 driver operates in 3 different contexts. + * + * 1) USB context. This is where all the USB related stuff happens. All + * callbacks run in this context. All callbacks are called (by USB2) with + * appropriate interface lock held. It is (generally) allowed to grab + * any additional locks. + * + * 2) Netgraph context. This is where all the Netgraph related stuff happens. + * Since we mark node as WRITER, the Netgraph node will be "locked" (from + * Netgraph point of view). Any variable that is only modified from the + * Netgraph context does not require any additonal locking. It is generally + * *NOT* allowed to grab *ANY* additional lock. Whatever you do, *DO NOT* + * not grab any long-sleep lock in the Netgraph context. In fact, the only + * lock that is allowed in the Netgraph context is the sc_mbufq_mtx lock. + * + * 3) Taskqueue context. This is where ubt_task runs. Since we are NOT allowed + * to grab any locks in the Netgraph context, and, USB2 requires us to + * grab interface lock before doing things with transfers, we need to + * transition from the Netgraph context to the Taskqueue context before + * we can call into USB2 subsystem. + * + * So, to put everything together, the rules are as follows. + * It is OK to call from the USB context or the Taskqueue context into + * the Netgraph context (i.e. call NG_SEND_xxx functions). In other words + * it is allowed to call into the Netgraph context with locks held. + * Is it *NOT* OK to call from the Netgraph context into the USB context, + * because USB2 requires us to grab interface locks and we can not do that. + * To avoid this, we set task flags to indicate which actions we want to + * perform and schedule ubt_task which would run in the Taskqueue context. + * Is is OK to call from the Taskqueue context into the USB context, + * and, ubt_task does just that (i.e. grabs appropriate interface locks + * before calling into USB2). + * Access to the outgoing queues and task flags is controlled by the + * sc_mbufq_mtx lock. It is an unavoidable evil. Again, sc_mbufq_mtx should + * really be a spin lock. + * All USB callbacks accept Netgraph node pointer as private data. To + * ensure that Netgraph node pointer remains valid for the duration of the + * transfer, we grab a referrence to the node. In other words, if transfer is + * pending, then we should have a referrence on the node. NG_NODE_[NOT_]VALID + * macro is used to check if node is still present and pointer is valid. + */ + #include #include #include @@ -44,8 +107,11 @@ #include #include #include +#include +#include #include +#include #include #include @@ -57,71 +123,57 @@ #include #include -/* - * USB methods - */ - -static device_probe_t ubt_probe; -static device_attach_t ubt_attach; -static device_detach_t ubt_detach; - -static devclass_t ubt_devclass; - -static device_method_t ubt_methods[] = { - DEVMETHOD(device_probe, ubt_probe), - DEVMETHOD(device_attach, ubt_attach), - DEVMETHOD(device_detach, ubt_detach), - {0, 0} -}; - -static driver_t ubt_driver = { - .name = "ubt", - .methods = ubt_methods, - .size = sizeof(struct ubt_softc), -}; - -/* - * Netgraph methods - */ - -static ng_constructor_t ng_ubt_constructor; -static ng_shutdown_t ng_ubt_shutdown; -static ng_newhook_t ng_ubt_newhook; -static ng_connect_t ng_ubt_connect; -static ng_disconnect_t ng_ubt_disconnect; -static ng_rcvmsg_t ng_ubt_rcvmsg; -static ng_rcvdata_t ng_ubt_rcvdata; +static int ubt_modevent(module_t, int, void *); +static device_probe_t ubt_probe; +static device_attach_t ubt_attach; +static device_detach_t ubt_detach; + +static int ubt_task_schedule(ubt_softc_p, int); +static task_fn_t ubt_task; +static void ubt_xfer_start(ubt_softc_p, int); + +/* Netgraph methods */ +static ng_constructor_t ng_ubt_constructor; +static ng_shutdown_t ng_ubt_shutdown; +static ng_newhook_t ng_ubt_newhook; +static ng_connect_t ng_ubt_connect; +static ng_disconnect_t ng_ubt_disconnect; +static ng_rcvmsg_t ng_ubt_rcvmsg; +static ng_rcvdata_t ng_ubt_rcvdata; /* Queue length */ -static const struct ng_parse_struct_field ng_ubt_node_qlen_type_fields[] = +static const struct ng_parse_struct_field ng_ubt_node_qlen_type_fields[] = { - {"queue", &ng_parse_int32_type,}, - {"qlen", &ng_parse_int32_type,}, - {NULL,} + { "queue", &ng_parse_int32_type, }, + { "qlen", &ng_parse_int32_type, }, + { NULL, } }; -static const struct ng_parse_type ng_ubt_node_qlen_type = { +static const struct ng_parse_type ng_ubt_node_qlen_type = +{ &ng_parse_struct_type, &ng_ubt_node_qlen_type_fields }; /* Stat info */ -static const struct ng_parse_struct_field ng_ubt_node_stat_type_fields[] = +static const struct ng_parse_struct_field ng_ubt_node_stat_type_fields[] = { - {"pckts_recv", &ng_parse_uint32_type,}, - {"bytes_recv", &ng_parse_uint32_type,}, - {"pckts_sent", &ng_parse_uint32_type,}, - {"bytes_sent", &ng_parse_uint32_type,}, - {"oerrors", &ng_parse_uint32_type,}, - {"ierrors", &ng_parse_uint32_type,}, - {NULL,} + { "pckts_recv", &ng_parse_uint32_type, }, + { "bytes_recv", &ng_parse_uint32_type, }, + { "pckts_sent", &ng_parse_uint32_type, }, + { "bytes_sent", &ng_parse_uint32_type, }, + { "oerrors", &ng_parse_uint32_type, }, + { "ierrors", &ng_parse_uint32_type, }, + { NULL, } }; -static const struct ng_parse_type ng_ubt_node_stat_type = { +static const struct ng_parse_type ng_ubt_node_stat_type = +{ &ng_parse_struct_type, &ng_ubt_node_stat_type_fields }; /* Netgraph node command list */ -static const struct ng_cmdlist ng_ubt_cmdlist[] = { +static const struct ng_cmdlist ng_ubt_cmdlist[] = +{ { NGM_UBT_COOKIE, NGM_UBT_NODE_SET_DEBUG, @@ -164,315 +216,266 @@ static const struct ng_cmdlist ng_ubt_cm NULL, NULL }, - {0,} + { 0, } }; /* Netgraph node type */ -static struct ng_type typestruct = { - .version = NG_ABI_VERSION, - .name = NG_UBT_NODE_TYPE, - .constructor = ng_ubt_constructor, - .rcvmsg = ng_ubt_rcvmsg, - .shutdown = ng_ubt_shutdown, - .newhook = ng_ubt_newhook, - .connect = ng_ubt_connect, - .rcvdata = ng_ubt_rcvdata, - .disconnect = ng_ubt_disconnect, - .cmdlist = ng_ubt_cmdlist -}; - -/* USB methods */ - -static usb2_callback_t ubt_ctrl_write_callback; -static usb2_callback_t ubt_intr_read_callback; -static usb2_callback_t ubt_intr_read_clear_stall_callback; -static usb2_callback_t ubt_bulk_read_callback; -static usb2_callback_t ubt_bulk_read_clear_stall_callback; -static usb2_callback_t ubt_bulk_write_callback; -static usb2_callback_t ubt_bulk_write_clear_stall_callback; -static usb2_callback_t ubt_isoc_read_callback; -static usb2_callback_t ubt_isoc_write_callback; - -static int ubt_modevent(module_t, int, void *); -static void ubt_intr_read_complete(node_p, hook_p, void *, int); -static void ubt_bulk_read_complete(node_p, hook_p, void *, int); -static void ubt_isoc_read_complete(node_p, hook_p, void *, int); - -/* USB config */ -static const struct usb2_config ubt_config_if_0[UBT_IF_0_N_TRANSFER] = { - - [0] = { - .type = UE_BULK, - .endpoint = UE_ADDR_ANY, - .direction = UE_DIR_OUT, - .mh.bufsize = UBT_BULK_WRITE_BUFFER_SIZE, - .mh.flags = {.pipe_bof = 1,}, - .mh.callback = &ubt_bulk_write_callback, - }, - - [1] = { - .type = UE_BULK, - .endpoint = UE_ADDR_ANY, - .direction = UE_DIR_IN, - .mh.bufsize = UBT_BULK_READ_BUFFER_SIZE, - .mh.flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, - .mh.callback = &ubt_bulk_read_callback, - }, - - [2] = { - .type = UE_INTERRUPT, - .endpoint = UE_ADDR_ANY, - .direction = UE_DIR_IN, - .mh.flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, - .mh.bufsize = 0x110, /* bytes */ - .mh.callback = &ubt_intr_read_callback, - }, - - [3] = { - .type = UE_CONTROL, - .endpoint = 0x00, /* Control pipe */ - .direction = UE_DIR_ANY, - .mh.bufsize = (sizeof(struct usb2_device_request) + UBT_CTRL_BUFFER_SIZE), - .mh.callback = &ubt_ctrl_write_callback, - .mh.timeout = 5000, /* 5 seconds */ - }, - - [4] = { - .type = UE_CONTROL, - .endpoint = 0x00, /* Control pipe */ - .direction = UE_DIR_ANY, - .mh.bufsize = sizeof(struct usb2_device_request), - .mh.callback = &ubt_bulk_write_clear_stall_callback, - .mh.timeout = 1000, /* 1 second */ - .mh.interval = 50, /* 50ms */ - }, - - [5] = { - .type = UE_CONTROL, - .endpoint = 0x00, /* Control pipe */ - .direction = UE_DIR_ANY, - .mh.bufsize = sizeof(struct usb2_device_request), - .mh.callback = &ubt_bulk_read_clear_stall_callback, - .mh.timeout = 1000, /* 1 second */ - .mh.interval = 50, /* 50ms */ - }, - - [6] = { - .type = UE_CONTROL, - .endpoint = 0x00, /* Control pipe */ - .direction = UE_DIR_ANY, - .mh.bufsize = sizeof(struct usb2_device_request), - .mh.callback = &ubt_intr_read_clear_stall_callback, - .mh.timeout = 1000, /* 1 second */ - .mh.interval = 50, /* 50ms */ - }, -}; - -/* USB config */ -static const struct usb2_config - ubt_config_if_1_full_speed[UBT_IF_1_N_TRANSFER] = { - - [0] = { - .type = UE_ISOCHRONOUS, - .endpoint = UE_ADDR_ANY, - .direction = UE_DIR_IN, - .mh.bufsize = 0, /* use "wMaxPacketSize * frames" */ - .mh.frames = UBT_ISOC_NFRAMES, - .mh.flags = {.short_xfer_ok = 1,}, - .mh.callback = &ubt_isoc_read_callback, - }, - - [1] = { - .type = UE_ISOCHRONOUS, - .endpoint = UE_ADDR_ANY, - .direction = UE_DIR_IN, - .mh.bufsize = 0, /* use "wMaxPacketSize * frames" */ - .mh.frames = UBT_ISOC_NFRAMES, - .mh.flags = {.short_xfer_ok = 1,}, - .mh.callback = &ubt_isoc_read_callback, - }, - - [2] = { - .type = UE_ISOCHRONOUS, - .endpoint = UE_ADDR_ANY, - .direction = UE_DIR_OUT, - .mh.bufsize = 0, /* use "wMaxPacketSize * frames" */ - .mh.frames = UBT_ISOC_NFRAMES, - .mh.flags = {.short_xfer_ok = 1,}, - .mh.callback = &ubt_isoc_write_callback, - }, - - [3] = { - .type = UE_ISOCHRONOUS, - .endpoint = UE_ADDR_ANY, - .direction = UE_DIR_OUT, - .mh.bufsize = 0, /* use "wMaxPacketSize * frames" */ - .mh.frames = UBT_ISOC_NFRAMES, - .mh.flags = {.short_xfer_ok = 1,}, - .mh.callback = &ubt_isoc_write_callback, - }, -}; - -/* USB config */ -static const struct usb2_config - ubt_config_if_1_high_speed[UBT_IF_1_N_TRANSFER] = { - - [0] = { - .type = UE_ISOCHRONOUS, - .endpoint = UE_ADDR_ANY, - .direction = UE_DIR_IN, - .mh.bufsize = 0, /* use "wMaxPacketSize * frames" */ - .mh.frames = UBT_ISOC_NFRAMES * 8, - .mh.flags = {.short_xfer_ok = 1,}, - .mh.callback = &ubt_isoc_read_callback, - }, - - [1] = { - .type = UE_ISOCHRONOUS, - .endpoint = UE_ADDR_ANY, - .direction = UE_DIR_IN, - .mh.bufsize = 0, /* use "wMaxPacketSize * frames" */ - .mh.frames = UBT_ISOC_NFRAMES * 8, - .mh.flags = {.short_xfer_ok = 1,}, - .mh.callback = &ubt_isoc_read_callback, - }, - - [2] = { - .type = UE_ISOCHRONOUS, - .endpoint = UE_ADDR_ANY, - .direction = UE_DIR_OUT, - .mh.bufsize = 0, /* use "wMaxPacketSize * frames" */ - .mh.frames = UBT_ISOC_NFRAMES * 8, - .mh.flags = {.short_xfer_ok = 1,}, - .mh.callback = &ubt_isoc_write_callback, - }, - - [3] = { - .type = UE_ISOCHRONOUS, - .endpoint = UE_ADDR_ANY, - .direction = UE_DIR_OUT, - .mh.bufsize = 0, /* use "wMaxPacketSize * frames" */ - .mh.frames = UBT_ISOC_NFRAMES * 8, - .mh.flags = {.short_xfer_ok = 1,}, - .mh.callback = &ubt_isoc_write_callback, - }, +static struct ng_type typestruct = +{ + .version = NG_ABI_VERSION, + .name = NG_UBT_NODE_TYPE, + .constructor = ng_ubt_constructor, + .rcvmsg = ng_ubt_rcvmsg, + .shutdown = ng_ubt_shutdown, + .newhook = ng_ubt_newhook, + .connect = ng_ubt_connect, + .rcvdata = ng_ubt_rcvdata, + .disconnect = ng_ubt_disconnect, + .cmdlist = ng_ubt_cmdlist }; -/* - * Module - */ - -DRIVER_MODULE(ng_ubt, ushub, ubt_driver, ubt_devclass, ubt_modevent, 0); -MODULE_VERSION(ng_ubt, NG_BLUETOOTH_VERSION); -MODULE_DEPEND(ng_ubt, netgraph, NG_ABI_VERSION, NG_ABI_VERSION, NG_ABI_VERSION); -MODULE_DEPEND(ng_ubt, ng_hci, NG_BLUETOOTH_VERSION, NG_BLUETOOTH_VERSION, NG_BLUETOOTH_VERSION); -MODULE_DEPEND(ng_ubt, usb2_bluetooth, 1, 1, 1); -MODULE_DEPEND(ng_ubt, usb2_core, 1, 1, 1); - /**************************************************************************** **************************************************************************** ** USB specific **************************************************************************** ****************************************************************************/ +/* USB methods */ +static usb2_callback_t ubt_ctrl_write_callback; +static usb2_callback_t ubt_intr_read_callback; +static usb2_callback_t ubt_intr_read_clear_stall_callback; +static usb2_callback_t ubt_bulk_read_callback; +static usb2_callback_t ubt_bulk_read_clear_stall_callback; +static usb2_callback_t ubt_bulk_write_callback; +static usb2_callback_t ubt_bulk_write_clear_stall_callback; +static usb2_callback_t ubt_isoc_read_callback; +static usb2_callback_t ubt_isoc_write_callback; + +static int ubt_isoc_read_one_frame(struct usb2_xfer *, int); + /* - * Load/Unload the driver module + * USB config + * + * The following desribes usb transfers that could be submitted on USB device. + * + * Interface 0 on the USB device must present the following endpoints + * 1) Interrupt endpoint to receive HCI events + * 2) Bulk IN endpoint to receive ACL data + * 3) Bulk OUT endpoint to send ACL data + * + * Interface 1 on the USB device must present the following endpoints + * 1) Isochronous IN endpoint to receive SCO data + * 2) Isochronous OUT endpoint to send SCO data */ -static int -ubt_modevent(module_t mod, int event, void *data) +static const struct usb2_config ubt_config[UBT_N_TRANSFER] = { - int error; + /* + * Interface #0 + */ - switch (event) { - case MOD_LOAD: - error = ng_newtype(&typestruct); - if (error != 0) { - printf("%s: Could not register " - "Netgraph node type, error=%d\n", - NG_UBT_NODE_TYPE, error); - } - break; + /* Outgoing bulk transfer - ACL packets */ + [UBT_IF_0_BULK_DT_WR] = { + .type = UE_BULK, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_OUT, + .mh.bufsize = UBT_BULK_WRITE_BUFFER_SIZE, + .mh.flags = { .pipe_bof = 1, }, + .mh.callback = &ubt_bulk_write_callback, + }, + /* Incoming bulk transfer - ACL packets */ + [UBT_IF_0_BULK_DT_RD] = { + .type = UE_BULK, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_IN, + .mh.bufsize = UBT_BULK_READ_BUFFER_SIZE, + .mh.flags = { .pipe_bof = 1, .short_xfer_ok = 1, }, + .mh.callback = &ubt_bulk_read_callback, + }, + /* Incoming interrupt transfer - HCI events */ + [UBT_IF_0_INTR_DT_RD] = { + .type = UE_INTERRUPT, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_IN, + .mh.flags = { .pipe_bof = 1, .short_xfer_ok = 1, }, + .mh.bufsize = UBT_INTR_BUFFER_SIZE, + .mh.callback = &ubt_intr_read_callback, + }, + /* Outgoing control transfer - HCI commands */ + [UBT_IF_0_CTRL_DT_WR] = { + .type = UE_CONTROL, + .endpoint = 0x00, /* control pipe */ + .direction = UE_DIR_ANY, + .mh.bufsize = UBT_CTRL_BUFFER_SIZE, + .mh.callback = &ubt_ctrl_write_callback, + .mh.timeout = 5000, /* 5 seconds */ + }, + /* Outgoing control transfer to clear stall on outgoing bulk transfer */ + [UBT_IF_0_BULK_CS_WR] = { + .type = UE_CONTROL, + .endpoint = 0x00, /* control pipe */ + .direction = UE_DIR_ANY, + .mh.bufsize = sizeof(struct usb2_device_request), + .mh.callback = &ubt_bulk_write_clear_stall_callback, + .mh.timeout = 1000, /* 1 second */ + .mh.interval = 50, /* 50ms */ + }, + /* Outgoing control transfer to clear stall on incoming bulk transfer */ + [UBT_IF_0_BULK_CS_RD] = { + .type = UE_CONTROL, + .endpoint = 0x00, /* control pipe */ + .direction = UE_DIR_ANY, + .mh.bufsize = sizeof(struct usb2_device_request), + .mh.callback = &ubt_bulk_read_clear_stall_callback, + .mh.timeout = 1000, /* 1 second */ + .mh.interval = 50, /* 50ms */ + }, + /* + * Outgoing control transfer to clear stall on incoming + * interrupt transfer + */ + [UBT_IF_0_INTR_CS_RD] = { + .type = UE_CONTROL, + .endpoint = 0x00, /* control pipe */ + .direction = UE_DIR_ANY, + .mh.bufsize = sizeof(struct usb2_device_request), + .mh.callback = &ubt_intr_read_clear_stall_callback, + .mh.timeout = 1000, /* 1 second */ + .mh.interval = 50, /* 50ms */ + }, - case MOD_UNLOAD: - error = ng_rmtype(&typestruct); - break; + /* + * Interface #1 + */ - default: - error = EOPNOTSUPP; - break; - } - return (error); -} /* ubt_modevent */ + /* Incoming isochronous transfer #1 - SCO packets */ + [UBT_IF_1_ISOC_DT_RD1] = { + .type = UE_ISOCHRONOUS, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_IN, + .mh.bufsize = 0, /* use "wMaxPacketSize * frames" */ + .mh.frames = UBT_ISOC_NFRAMES, + .mh.flags = { .short_xfer_ok = 1, }, + .mh.callback = &ubt_isoc_read_callback, + }, + /* Incoming isochronous transfer #2 - SCO packets */ + [UBT_IF_1_ISOC_DT_RD2] = { + .type = UE_ISOCHRONOUS, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_IN, + .mh.bufsize = 0, /* use "wMaxPacketSize * frames" */ + .mh.frames = UBT_ISOC_NFRAMES, + .mh.flags = { .short_xfer_ok = 1, }, + .mh.callback = &ubt_isoc_read_callback, + }, + /* Outgoing isochronous transfer #1 - SCO packets */ + [UBT_IF_1_ISOC_DT_WR1] = { + .type = UE_ISOCHRONOUS, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_OUT, + .mh.bufsize = 0, /* use "wMaxPacketSize * frames" */ + .mh.frames = UBT_ISOC_NFRAMES, + .mh.flags = { .short_xfer_ok = 1, }, + .mh.callback = &ubt_isoc_write_callback, + }, + /* Outgoing isochronous transfer #2 - SCO packets */ + [UBT_IF_1_ISOC_DT_WR2] = { + .type = UE_ISOCHRONOUS, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_OUT, + .mh.bufsize = 0, /* use "wMaxPacketSize * frames" */ + .mh.frames = UBT_ISOC_NFRAMES, + .mh.flags = { .short_xfer_ok = 1, }, + .mh.callback = &ubt_isoc_write_callback, + }, +}; /* * If for some reason device should not be attached then put * VendorID/ProductID pair into the list below. The format is * as follows: * - * { VENDOR_ID, PRODUCT_ID }, + * { USB_VPI(VENDOR_ID, PRODUCT_ID, 0) }, * * where VENDOR_ID and PRODUCT_ID are hex numbers. */ static const struct usb2_device_id ubt_ignore_devs[] = { /* AVM USB Bluetooth-Adapter BlueFritz! v1.0 */ - {USB_VPI(USB_VENDOR_AVM, 0x2200, 0)}, + { USB_VPI(USB_VENDOR_AVM, 0x2200, 0) }, }; /* List of supported bluetooth devices */ static const struct usb2_device_id ubt_devs[] = { - /* Generic Bluetooth class devices. */ - {USB_IFACE_CLASS(UDCLASS_WIRELESS), - USB_IFACE_SUBCLASS(UDSUBCLASS_RF), - USB_IFACE_PROTOCOL(UDPROTO_BLUETOOTH)}, + /* Generic Bluetooth class devices */ + { USB_IFACE_CLASS(UDCLASS_WIRELESS), + USB_IFACE_SUBCLASS(UDSUBCLASS_RF), + USB_IFACE_PROTOCOL(UDPROTO_BLUETOOTH) }, /* AVM USB Bluetooth-Adapter BlueFritz! v2.0 */ - {USB_VPI(USB_VENDOR_AVM, 0x3800, 0)}, + { USB_VPI(USB_VENDOR_AVM, 0x3800, 0) }, }; /* - * Probe for a USB Bluetooth device + * Probe for a USB Bluetooth device. + * USB context. */ static int ubt_probe(device_t dev) { - struct usb2_attach_arg *uaa = device_get_ivars(dev); + struct usb2_attach_arg *uaa = device_get_ivars(dev); - if (uaa->usb2_mode != USB_MODE_HOST) { + if (uaa->usb2_mode != USB_MODE_HOST) return (ENXIO); - } - if (uaa->info.bIfaceIndex != 0) { + + if (uaa->info.bIfaceIndex != 0) return (ENXIO); - } + if (usb2_lookup_id_by_uaa(ubt_ignore_devs, - sizeof(ubt_ignore_devs), uaa) == 0) { + sizeof(ubt_ignore_devs), uaa) == 0) return (ENXIO); - } + return (usb2_lookup_id_by_uaa(ubt_devs, sizeof(ubt_devs), uaa)); -} +} /* ubt_probe */ /* - * Attach the device + * Attach the device. + * USB context. */ static int ubt_attach(device_t dev) { - struct usb2_attach_arg *uaa = device_get_ivars(dev); - struct ubt_softc *sc = device_get_softc(dev); - const struct usb2_config *isoc_setup; - struct usb2_endpoint_descriptor *ed; - uint16_t wMaxPacketSize; - uint8_t alt_index; - uint8_t iface_index; - uint8_t i; - uint8_t j; + struct usb2_attach_arg *uaa = device_get_ivars(dev); + struct ubt_softc *sc = device_get_softc(dev); + struct usb2_endpoint_descriptor *ed; + uint16_t wMaxPacketSize; + uint8_t alt_index, iface_index, i, j; device_set_usb2_desc(dev); snprintf(sc->sc_name, sizeof(sc->sc_name), - "%s", device_get_nameunit(dev)); + "%s", device_get_nameunit(dev)); + + /* + * Create Netgraph node + */ + + sc->sc_hook = NULL; + + if (ng_make_node_common(&typestruct, &sc->sc_node) != 0) { + device_printf(dev, "could not create Netgraph node\n"); + return (ENXIO); + } + + /* Name Netgraph node */ + if (ng_name_node(sc->sc_node, sc->sc_name) != 0) { + device_printf(dev, "could not name Netgraph node\n"); + NG_NODE_UNREF(sc->sc_node); + return (ENXIO); + } + NG_NODE_SET_PRIVATE(sc->sc_node, sc); + NG_NODE_FORCE_WRITER(sc->sc_node); /* * Initialize device softc structure @@ -481,34 +484,28 @@ ubt_attach(device_t dev) /* state */ sc->sc_debug = NG_UBT_WARN_LEVEL; sc->sc_flags = 0; - NG_UBT_STAT_RESET(sc->sc_stat); + UBT_STAT_RESET(sc); - /* control pipe */ - NG_BT_MBUFQ_INIT(&sc->sc_cmdq, UBT_DEFAULT_QLEN); + /* initialize locks */ + mtx_init(&sc->sc_mbufq_mtx, "ubt mbufq", NULL, MTX_DEF); + mtx_init(&sc->sc_if_mtx[0], "ubt if0", NULL, MTX_DEF | MTX_RECURSE); + mtx_init(&sc->sc_if_mtx[1], "ubt if1", NULL, MTX_DEF | MTX_RECURSE); - /* bulk-out pipe */ + /* initialize packet queues */ + NG_BT_MBUFQ_INIT(&sc->sc_cmdq, UBT_DEFAULT_QLEN); NG_BT_MBUFQ_INIT(&sc->sc_aclq, UBT_DEFAULT_QLEN); + NG_BT_MBUFQ_INIT(&sc->sc_scoq, UBT_DEFAULT_QLEN); - /* isoc-out pipe */ - NG_BT_MBUFQ_INIT(&sc->sc_scoq, - (usb2_get_speed(uaa->device) == USB_SPEED_HIGH) ? - (2 * UBT_ISOC_NFRAMES * 8) : - (2 * UBT_ISOC_NFRAMES)); - - /* isoc-in pipe */ - NG_BT_MBUFQ_INIT(&sc->sc_sciq, - (usb2_get_speed(uaa->device) == USB_SPEED_HIGH) ? - (2 * UBT_ISOC_NFRAMES * 8) : - (2 * UBT_ISOC_NFRAMES)); - - /* netgraph part */ - sc->sc_node = NULL; - sc->sc_hook = NULL; + /* initialize glue task */ + sc->sc_task_flags = 0; + TASK_INIT(&sc->sc_task, 0, ubt_task, sc->sc_node); /* * Configure Bluetooth USB device. Discover all required USB * interfaces and endpoints. * + * Device is expected to be a high-speed device. + * * USB device must present two interfaces: * 1) Interface 0 that has 3 endpoints * 1) Interrupt endpoint to receive HCI events @@ -523,794 +520,1006 @@ ubt_attach(device_t dev) * configurations with different packet size. */ + bzero(&sc->sc_xfer, sizeof(sc->sc_xfer)); + /* * Interface 0 */ - mtx_init(&sc->sc_mtx, "ubt lock", NULL, MTX_DEF | MTX_RECURSE); - iface_index = 0; - if (usb2_transfer_setup - (uaa->device, &iface_index, sc->sc_xfer_if_0, ubt_config_if_0, - UBT_IF_0_N_TRANSFER, sc, &sc->sc_mtx)) { - device_printf(dev, "Could not allocate transfers " - "for interface 0!\n"); + if (usb2_transfer_setup(uaa->device, &iface_index, sc->sc_xfer, + ubt_config, UBT_IF_0_N_TRANSFER, + sc->sc_node, &sc->sc_if_mtx[0])) { + device_printf(dev, "could not allocate transfers for " \ + "interface 0!\n"); goto detach; } + /* * Interface 1 - * (search alternate settings, and find - * the descriptor with the largest + * (search alternate settings, and find the descriptor with the largest * wMaxPacketSize) */ - isoc_setup = - ((usb2_get_speed(uaa->device) == USB_SPEED_HIGH) ? - ubt_config_if_1_high_speed : - ubt_config_if_1_full_speed); wMaxPacketSize = 0; - - /* search through all the descriptors looking for bidir mode */ - - alt_index = 0 - 1; + alt_index = 0; i = 0; j = 0; + + /* Search through all the descriptors looking for bidir mode */ while (1) { uint16_t temp; - ed = usb2_find_edesc( - usb2_get_config_descriptor(uaa->device), 1, i, j); + ed = usb2_find_edesc(usb2_get_config_descriptor(uaa->device), + 1, i, j); if (ed == NULL) { - if (j == 0) { - /* end of interfaces */ - break; - } else { + if (j != 0) { /* next interface */ j = 0; - i++; + i ++; continue; } + + break; /* end of interfaces */ } + temp = UGETW(ed->wMaxPacketSize); if (temp > wMaxPacketSize) { wMaxPacketSize = temp; alt_index = i; } - j++; - } - if (usb2_set_alt_interface_index(uaa->device, 1, alt_index)) { - device_printf(dev, "Could not set alternate " - "setting %d for interface 1!\n", alt_index); - goto detach; - } - iface_index = 1; - if (usb2_transfer_setup - (uaa->device, &iface_index, sc->sc_xfer_if_1, - isoc_setup, UBT_IF_1_N_TRANSFER, sc, &sc->sc_mtx)) { - device_printf(dev, "Could not allocate transfers " - "for interface 1!\n"); - goto detach; + j ++; } - /* create Netgraph node */ - if (ng_make_node_common(&typestruct, &sc->sc_node) != 0) { - printf("%s: Could not create Netgraph node\n", - sc->sc_name); - sc->sc_node = NULL; + /* Set alt configuration only if we found it */ + if (wMaxPacketSize > 0 && + usb2_set_alt_interface_index(uaa->device, 1, alt_index)) { + device_printf(dev, "could not set alternate setting %d " \ + "for interface 1!\n", alt_index); goto detach; } - /* name node */ - if (ng_name_node(sc->sc_node, sc->sc_name) != 0) { - printf("%s: Could not name Netgraph node\n", - sc->sc_name); - NG_NODE_UNREF(sc->sc_node); - sc->sc_node = NULL; + iface_index = 1; + if (usb2_transfer_setup(uaa->device, &iface_index, + &sc->sc_xfer[UBT_IF_0_N_TRANSFER], + &ubt_config[UBT_IF_0_N_TRANSFER], UBT_IF_1_N_TRANSFER, + sc->sc_node, &sc->sc_if_mtx[1])) { + device_printf(dev, "could not allocate transfers for " \ + "interface 1!\n"); goto detach; } - NG_NODE_SET_PRIVATE(sc->sc_node, sc); - NG_NODE_FORCE_WRITER(sc->sc_node); - /* claim all interfaces on the device */ - - for (i = 1;; i++) { - - if (usb2_get_iface(uaa->device, i) == NULL) { - break; - } + /* Claim all interfaces on the device */ + for (i = 1; usb2_get_iface(uaa->device, i) != NULL; i ++) usb2_set_parent_iface(uaa->device, i, uaa->info.bIfaceIndex); - } - return (0); /* success */ + return (0); /* success */ detach: ubt_detach(dev); return (ENXIO); -} +} /* ubt_attach */ /* - * Detach the device + * Detach the device. + * USB context. */ int ubt_detach(device_t dev) { - struct ubt_softc *sc = device_get_softc(dev); + struct ubt_softc *sc = device_get_softc(dev); + node_p node = sc->sc_node; - /* destroy Netgraph node */ - - if (sc->sc_node != NULL) { - NG_NODE_SET_PRIVATE(sc->sc_node, NULL); - ng_rmnode_self(sc->sc_node); + /* Destroy Netgraph node */ + if (node != NULL) { sc->sc_node = NULL; - } - /* free USB transfers, if any */ - usb2_transfer_unsetup(sc->sc_xfer_if_0, UBT_IF_0_N_TRANSFER); - - usb2_transfer_unsetup(sc->sc_xfer_if_1, UBT_IF_1_N_TRANSFER); + NG_NODE_SET_PRIVATE(node, NULL); + NG_NODE_REALLY_DIE(node); + NG_NODE_REF(node); + ng_rmnode_self(node); + } - mtx_destroy(&sc->sc_mtx); + /* Free USB transfers, if any */ + usb2_transfer_unsetup(sc->sc_xfer, UBT_N_TRANSFER); - /* destroy queues */ + if (node != NULL) + NG_NODE_UNREF(node); + /* Destroy queues */ + UBT_MBUFQ_LOCK(sc); NG_BT_MBUFQ_DESTROY(&sc->sc_cmdq); NG_BT_MBUFQ_DESTROY(&sc->sc_aclq); NG_BT_MBUFQ_DESTROY(&sc->sc_scoq); - NG_BT_MBUFQ_DESTROY(&sc->sc_sciq); + UBT_MBUFQ_UNLOCK(sc); + + mtx_destroy(&sc->sc_if_mtx[0]); + mtx_destroy(&sc->sc_if_mtx[1]); + mtx_destroy(&sc->sc_mbufq_mtx); return (0); -} +} /* ubt_detach */ + +/* + * Called when outgoing control request (HCI command) has completed, i.e. + * HCI command was sent to the device. + * USB context. + */ static void ubt_ctrl_write_callback(struct usb2_xfer *xfer) { - struct ubt_softc *sc = xfer->priv_sc; - struct usb2_device_request req; - struct mbuf *m; + node_p node = xfer->priv_sc; + struct ubt_softc *sc; + struct usb2_device_request req; + struct mbuf *m; + + if (NG_NODE_NOT_VALID(node)) { + NG_NODE_UNREF(node); + return; /* netgraph node is gone */ + } + + sc = NG_NODE_PRIVATE(node); switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: -tr_transferred: + if (xfer->error != 0) + UBT_STAT_OERROR(sc); + else { + UBT_INFO(sc, "sent %d bytes to control pipe\n", + xfer->actlen); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 22:26:09 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B706106566B; Tue, 20 Jan 2009 22:26:09 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8B4938FC13; Tue, 20 Jan 2009 22:26:09 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0KMQ9NB058612; Tue, 20 Jan 2009 22:26:09 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0KMQ9wI058610; Tue, 20 Jan 2009 22:26:09 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200901202226.n0KMQ9wI058610@svn.freebsd.org> From: Alexander Motin Date: Tue, 20 Jan 2009 22:26:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187495 - head/sys/netgraph X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2009 22:26:10 -0000 Author: mav Date: Tue Jan 20 22:26:09 2009 New Revision: 187495 URL: http://svn.freebsd.org/changeset/base/187495 Log: Check for infinite recursion possible on some broken PPTP/L2TP/... VPN setups. Mark packets with mbuf_tag on first interface passage and drop on second. PR: ports/129625, ports/125303, MFC after: 2 weeks Modified: head/sys/netgraph/ng_iface.c head/sys/netgraph/ng_iface.h Modified: head/sys/netgraph/ng_iface.c ============================================================================== --- head/sys/netgraph/ng_iface.c Tue Jan 20 22:17:05 2009 (r187494) +++ head/sys/netgraph/ng_iface.c Tue Jan 20 22:26:09 2009 (r187495) @@ -356,6 +356,7 @@ static int ng_iface_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, struct rtentry *rt0) { + struct m_tag *mtag; uint32_t af; int error; @@ -366,6 +367,23 @@ ng_iface_output(struct ifnet *ifp, struc return (ENETDOWN); } + /* Protect from deadly infinite recursion. */ + while ((mtag = m_tag_locate(m, MTAG_NGIF, MTAG_NGIF_CALLED, NULL))) { + if (*(struct ifnet **)(mtag + 1) == ifp) { + log(LOG_NOTICE, "Loop detected on %s\n", ifp->if_xname); + m_freem(m); + return (EDEADLK); + } + } + mtag = m_tag_alloc(MTAG_NGIF, MTAG_NGIF_CALLED, sizeof(struct ifnet *), + M_NOWAIT); + if (mtag == NULL) { + m_freem(m); + return (ENOMEM); + } + *(struct ifnet **)(mtag + 1) = ifp; + m_tag_prepend(m, mtag); + /* BPF writes need to be handled specially. */ if (dst->sa_family == AF_UNSPEC) { bcopy(dst->sa_data, &af, sizeof(af)); Modified: head/sys/netgraph/ng_iface.h ============================================================================== --- head/sys/netgraph/ng_iface.h Tue Jan 20 22:17:05 2009 (r187494) +++ head/sys/netgraph/ng_iface.h Tue Jan 20 22:26:09 2009 (r187495) @@ -72,4 +72,7 @@ enum { NGM_IFACE_GET_IFINDEX, }; +#define MTAG_NGIF NGM_IFACE_COOKIE +#define MTAG_NGIF_CALLED 0 | MTAG_PERSISTENT + #endif /* _NETGRAPH_NG_IFACE_H_ */ From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 22:49:50 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6850B10656C1; Tue, 20 Jan 2009 22:49:50 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 57AEE8FC18; Tue, 20 Jan 2009 22:49:50 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0KMnoDK059329; Tue, 20 Jan 2009 22:49:50 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0KMno0c059325; Tue, 20 Jan 2009 22:49:50 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200901202249.n0KMno0c059325@svn.freebsd.org> From: Xin LI Date: Tue, 20 Jan 2009 22:49:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187501 - head/sbin/fsck_ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2009 22:49:51 -0000 Author: delphij Date: Tue Jan 20 22:49:49 2009 New Revision: 187501 URL: http://svn.freebsd.org/changeset/base/187501 Log: Rename option 'C' to 'D' (damaged) in order to avoid a conflict with upcoming Juniper 'C' (clean) flag. Requested by: obrien MFC after: 1 week Modified: head/sbin/fsck_ffs/fsck.h head/sbin/fsck_ffs/fsck_ffs.8 head/sbin/fsck_ffs/fsutil.c head/sbin/fsck_ffs/main.c Modified: head/sbin/fsck_ffs/fsck.h ============================================================================== --- head/sbin/fsck_ffs/fsck.h Tue Jan 20 22:48:52 2009 (r187500) +++ head/sbin/fsck_ffs/fsck.h Tue Jan 20 22:49:49 2009 (r187501) @@ -270,7 +270,7 @@ char yflag; /* assume a yes response * int bkgrdflag; /* use a snapshot to run on an active system */ int bflag; /* location of alternate super block */ int debug; /* output debugging info */ -char catastrophicflag; /* run in catastrophic mode */ +char damagedflag; /* run in damaged mode */ int cvtlevel; /* convert to newer file system format */ int bkgrdcheck; /* determine if background check is possible */ int bkgrdsumadj; /* whether the kernel have ability to adjust superblock summary */ Modified: head/sbin/fsck_ffs/fsck_ffs.8 ============================================================================== --- head/sbin/fsck_ffs/fsck_ffs.8 Tue Jan 20 22:48:52 2009 (r187500) +++ head/sbin/fsck_ffs/fsck_ffs.8 Tue Jan 20 22:49:49 2009 (r187501) @@ -29,7 +29,7 @@ .\" @(#)fsck.8 8.4 (Berkeley) 5/9/95 .\" $FreeBSD$ .\" -.Dd April 10, 2008 +.Dd January 20, 2009 .Dt FSCK_FFS 8 .Os .Sh NAME @@ -38,7 +38,7 @@ .Nd file system consistency check and interactive repair .Sh SYNOPSIS .Nm -.Op Fl BCFpfny +.Op Fl BDFpfny .Op Fl b Ar block .Op Fl c Ar level .Op Fl m Ar mode @@ -175,26 +175,6 @@ Use the block specified immediately afte the super block for the file system. An alternate super block is usually located at block 32 for UFS1, and block 160 for UFS2. -.It Fl C -Run -.Nm -in 'catastrophic recovery' mode, which will enable certain aggressive -operations that can make -.Nm -to survive with file systems that has very serious data damage, which -is an useful last resort when on disk data damage is very serious -and causes -.Nm -to crash otherwise. Be -.Em very careful -using this flag, it is dangerous if there are data transmission hazards -because a false positive cylinder group magic number mismatch could -cause -.Em irrevertible data loss! -.Pp -This option implies the -.Fl f -flag. .It Fl c Convert the file system to the specified level. Note that the level of a file system can only be raised. @@ -228,6 +208,26 @@ are being converted at once. The format of a file system can be determined from the first line of output from .Xr dumpfs 8 . +.It Fl D +Run +.Nm +in 'damaged recovery' mode, which will enable certain aggressive +operations that can make +.Nm +to survive with file systems that has very serious data damage, which +is an useful last resort when on disk data damage is very serious +and causes +.Nm +to crash otherwise. Be +.Em very careful +using this flag, it is dangerous if there are data transmission hazards +because a false positive cylinder group magic number mismatch could +cause +.Em irrevertible data loss! +.Pp +This option implies the +.Fl f +flag. .It Fl f Force .Nm Modified: head/sbin/fsck_ffs/fsutil.c ============================================================================== --- head/sbin/fsck_ffs/fsutil.c Tue Jan 20 22:48:52 2009 (r187500) +++ head/sbin/fsck_ffs/fsutil.c Tue Jan 20 22:49:49 2009 (r187501) @@ -427,7 +427,7 @@ check_cgmagic(int cg, struct cg *cgp) if (!cg_chkmagic(cgp)) { pwarn("CG %d: BAD MAGIC NUMBER\n", cg); - if (catastrophicflag) { + if (damagedflag) { if (reply("CLEAR CG")) { memset(cgp, 0, (size_t)sblock.fs_cgsize); cgp->cg_initediblk = sblock.fs_ipg; Modified: head/sbin/fsck_ffs/main.c ============================================================================== --- head/sbin/fsck_ffs/main.c Tue Jan 20 22:48:52 2009 (r187500) +++ head/sbin/fsck_ffs/main.c Tue Jan 20 22:49:49 2009 (r187501) @@ -81,8 +81,8 @@ main(int argc, char *argv[]) sync(); skipclean = 1; - catastrophicflag = 0; - while ((ch = getopt(argc, argv, "b:Bc:CdfFm:npy")) != -1) { + damagedflag = 0; + while ((ch = getopt(argc, argv, "b:Bc:dDfFm:npy")) != -1) { switch (ch) { case 'b': skipclean = 0; @@ -106,8 +106,8 @@ main(int argc, char *argv[]) debug++; break; - case 'C': - catastrophicflag = 1; + case 'D': + damagedflag = 1; /* FALLTHROUGH */ case 'f': From owner-svn-src-head@FreeBSD.ORG Tue Jan 20 23:25:28 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19D31106566C; Tue, 20 Jan 2009 23:25:28 +0000 (UTC) (envelope-from emax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 098238FC16; Tue, 20 Jan 2009 23:25:28 +0000 (UTC) (envelope-from emax@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0KNPRee060227; Tue, 20 Jan 2009 23:25:27 GMT (envelope-from emax@svn.freebsd.org) Received: (from emax@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0KNPR0A060226; Tue, 20 Jan 2009 23:25:27 GMT (envelope-from emax@svn.freebsd.org) Message-Id: <200901202325.n0KNPR0A060226@svn.freebsd.org> From: Maksim Yevmenkin Date: Tue, 20 Jan 2009 23:25:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187505 - head/sys/dev/usb2/bluetooth X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2009 23:25:28 -0000 Author: emax Date: Tue Jan 20 23:25:27 2009 New Revision: 187505 URL: http://svn.freebsd.org/changeset/base/187505 Log: Fix typo in comment Pointed out by: Daan Vreeken / Daan at vehosting dot nl Modified: head/sys/dev/usb2/bluetooth/ng_ubt2.c Modified: head/sys/dev/usb2/bluetooth/ng_ubt2.c ============================================================================== --- head/sys/dev/usb2/bluetooth/ng_ubt2.c Tue Jan 20 23:20:09 2009 (r187504) +++ head/sys/dev/usb2/bluetooth/ng_ubt2.c Tue Jan 20 23:25:27 2009 (r187505) @@ -64,7 +64,7 @@ * Netgraph point of view). Any variable that is only modified from the * Netgraph context does not require any additonal locking. It is generally * *NOT* allowed to grab *ANY* additional lock. Whatever you do, *DO NOT* - * not grab any long-sleep lock in the Netgraph context. In fact, the only + * grab any long-sleep lock in the Netgraph context. In fact, the only * lock that is allowed in the Netgraph context is the sc_mbufq_mtx lock. * * 3) Taskqueue context. This is where ubt_task runs. Since we are NOT allowed From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 02:53:00 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B88FA106564A; Wed, 21 Jan 2009 02:53:00 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A64108FC0C; Wed, 21 Jan 2009 02:53:00 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0L2r0s4064104; Wed, 21 Jan 2009 02:53:00 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0L2r0ms064102; Wed, 21 Jan 2009 02:53:00 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200901210253.n0L2r0ms064102@svn.freebsd.org> From: Sam Leffler Date: Wed, 21 Jan 2009 02:53:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187510 - in head/sys/dev/ath/ath_hal: ar5211 ar5212 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2009 02:53:01 -0000 Author: sam Date: Wed Jan 21 02:53:00 2009 New Revision: 187510 URL: http://svn.freebsd.org/changeset/base/187510 Log: correct typo that left programmed sifs time in the slot time (to be applied on subsequent resets) Submitted by: Jiri Fojtasek Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211_misc.c head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211_misc.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5211/ar5211_misc.c Wed Jan 21 01:31:08 2009 (r187509) +++ head/sys/dev/ath/ath_hal/ar5211/ar5211_misc.c Wed Jan 21 02:53:00 2009 (r187510) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5211_misc.c,v 1.7 2008/11/27 22:29:52 sam Exp $ + * $FreeBSD$ */ #include "opt_ah.h" @@ -432,7 +432,7 @@ ar5211SetSifsTime(struct ath_hal *ah, u_ } else { /* convert to system clocks */ OS_REG_WRITE(ah, AR_D_GBL_IFS_SIFS, ath_hal_mac_clks(ah, us)); - ahp->ah_slottime = us; + ahp->ah_sifstime = us; return AH_TRUE; } } Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c Wed Jan 21 01:31:08 2009 (r187509) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c Wed Jan 21 02:53:00 2009 (r187510) @@ -453,7 +453,7 @@ ar5212SetSifsTime(struct ath_hal *ah, u_ } else { /* convert to system clocks */ OS_REG_WRITE(ah, AR_D_GBL_IFS_SIFS, ath_hal_mac_clks(ah, us)); - ahp->ah_slottime = us; + ahp->ah_sifstime = us; return AH_TRUE; } } From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 04:19:18 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6FFFB10656E1; Wed, 21 Jan 2009 04:19:18 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5DAAC8FC23; Wed, 21 Jan 2009 04:19:18 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0L4JIRS066136; Wed, 21 Jan 2009 04:19:18 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0L4JIG7066134; Wed, 21 Jan 2009 04:19:18 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200901210419.n0L4JIG7066134@svn.freebsd.org> From: Andrew Thompson Date: Wed, 21 Jan 2009 04:19:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187511 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2009 04:19:19 -0000 Author: thompsa Date: Wed Jan 21 04:19:18 2009 New Revision: 187511 URL: http://svn.freebsd.org/changeset/base/187511 Log: Add functions WITNESS so it can be asserted that the lock is not released for a section of code, this uses WITNESS_NORELEASE() and WITNESS_RELEASEOK() to mark the boundaries. Both functions require the lock to be held when calling. This is intended for scenarios like a bus asserting that the bus lock is not dropped during a driver call. There doesn't appear to be a man page to document this in. Reviewed by: jhb Modified: head/sys/kern/subr_witness.c head/sys/sys/lock.h Modified: head/sys/kern/subr_witness.c ============================================================================== --- head/sys/kern/subr_witness.c Wed Jan 21 02:53:00 2009 (r187510) +++ head/sys/kern/subr_witness.c Wed Jan 21 04:19:18 2009 (r187511) @@ -127,6 +127,7 @@ __FBSDID("$FreeBSD$"); #define LI_RECURSEMASK 0x0000ffff /* Recursion depth of lock instance. */ #define LI_EXCLUSIVE 0x00010000 /* Exclusive lock instance. */ +#define LI_NORELEASE 0x00020000 /* Lock not allowed to be released. */ /* Define this to check for blessed mutexes */ #undef BLESSING @@ -367,6 +368,7 @@ static struct witness_lock_order_data *w struct witness *parent, struct witness *child); static void witness_list_lock(struct lock_instance *instance); +static void witness_setflag(struct lock_object *lock, int flag, int set); #ifdef KDB #define witness_debugger(c) _witness_debugger(c, __func__) @@ -1509,6 +1511,11 @@ found: instance->li_line); panic("share->uexcl"); } + if ((instance->li_flags & LI_NORELEASE) != 0 && witness_watch > 0) { + printf("forbidden unlock of (%s) %s @ %s:%d\n", class->lc_name, + lock->lo_name, file, line); + panic("lock marked norelease"); + } /* If we are recursed, unrecurse. */ if ((instance->li_flags & LI_RECURSEMASK) > 0) { @@ -2224,6 +2231,48 @@ witness_assert(struct lock_object *lock, #endif /* INVARIANT_SUPPORT */ } +static void +witness_setflag(struct lock_object *lock, int flag, int set) +{ + struct lock_list_entry *lock_list; + struct lock_instance *instance; + struct lock_class *class; + + if (lock->lo_witness == NULL || witness_watch == -1 || panicstr != NULL) + return; + class = LOCK_CLASS(lock); + if (class->lc_flags & LC_SLEEPLOCK) + lock_list = curthread->td_sleeplocks; + else { + if (witness_skipspin) + return; + lock_list = PCPU_GET(spinlocks); + } + instance = find_instance(lock_list, lock); + if (instance == NULL) + panic("%s: lock (%s) %s not locked", __func__, + class->lc_name, lock->lo_name); + + if (set) + instance->li_flags |= flag; + else + instance->li_flags &= ~flag; +} + +void +witness_norelease(struct lock_object *lock) +{ + + witness_setflag(lock, LI_NORELEASE, 1); +} + +void +witness_releaseok(struct lock_object *lock) +{ + + witness_setflag(lock, LI_NORELEASE, 0); +} + #ifdef DDB static void witness_ddb_list(struct thread *td) Modified: head/sys/sys/lock.h ============================================================================== --- head/sys/sys/lock.h Wed Jan 21 02:53:00 2009 (r187510) +++ head/sys/sys/lock.h Wed Jan 21 04:19:18 2009 (r187511) @@ -216,6 +216,8 @@ int witness_warn(int, struct lock_object void witness_assert(struct lock_object *, int, const char *, int); void witness_display_spinlock(struct lock_object *, struct thread *); int witness_line(struct lock_object *); +void witness_norelease(struct lock_object *); +void witness_releaseok(struct lock_object *); const char *witness_file(struct lock_object *); void witness_thread_exit(struct thread *); @@ -267,6 +269,12 @@ void witness_thread_exit(struct thread * #define WITNESS_RESTORE(lock, n) \ witness_restore((lock), __CONCAT(n, __wf), __CONCAT(n, __wl)) +#define WITNESS_NORELEASE(lock) \ + witness_norelease(&(lock)->lock_object) + +#define WITNESS_RELEASEOK(lock) \ + witness_releaseok(&(lock)->lock_object) + #define WITNESS_FILE(lock) \ witness_file(lock) @@ -287,6 +295,8 @@ void witness_thread_exit(struct thread * #define WITNESS_SAVE_DECL(n) #define WITNESS_SAVE(lock, n) #define WITNESS_RESTORE(lock, n) +#define WITNESS_NORELEASE(lock) +#define WITNESS_RELEASEOK(lock) #define WITNESS_FILE(lock) ("?") #define WITNESS_LINE(lock) (0) #endif /* WITNESS */ From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 04:25:37 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16309106567E; Wed, 21 Jan 2009 04:25:37 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from mail-bw0-f13.google.com (mail-bw0-f13.google.com [209.85.218.13]) by mx1.freebsd.org (Postfix) with ESMTP id 0D5908FC1C; Wed, 21 Jan 2009 04:25:35 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: by bwz6 with SMTP id 6so123921bwz.19 for ; Tue, 20 Jan 2009 20:25:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=Z24l5/Z55f5bJYoiQN28j4YYJBhDDhKWFSRnFlT5RrI=; b=buLv09xbadfuIAHRrUWucwa99myODXw+giM2EsaCQ7i2FHfN42FGifF5cV0KHqm9mX zhsgXGr41r1ZMKmNZ+uMlAXl3Vbhp7nM/EaVdCTeptqIeeG4OvsmPA4/6h/aXW2bDRFo X9n+PicjUGzym5RLTf4tInp6TabkxsYMjBomQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=EVGzYOrpqQFUVofcxM4tstllfs0Oefis3wjRydCNI/3qvrou5CWWExXLGphIX+1HRX ADyIWvJugpqW6siir+sL8vdzgmo60yBb5dfIZ23a3dwFn0bZqFcRDQQTf067zN6J14wD II1A8YRFeXZQ9L2du+4jRagXdq02SENnzptEg= MIME-Version: 1.0 Received: by 10.181.136.4 with SMTP id o4mr1037173bkn.0.1232511934820; Tue, 20 Jan 2009 20:25:34 -0800 (PST) In-Reply-To: <70e8236f0901200222q4b00b7a5h8c3a35ab432f9cb2@mail.gmail.com> References: <200901191619.n0JGJrhJ015123@svn.freebsd.org> <20090119.181322.-625070925.imp@bsdimp.com> <7d6fde3d0901200052w20755420l94f0c02c547f53b7@mail.gmail.com> <70e8236f0901200222q4b00b7a5h8c3a35ab432f9cb2@mail.gmail.com> Date: Tue, 20 Jan 2009 20:25:34 -0800 Message-ID: <7d6fde3d0901202025m5073f93ex93fbf628751a4217@mail.gmail.com> From: Garrett Cooper To: =?ISO-8859-1?Q?Jo=E3o_Barros?= Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, sobomax@freebsd.org, svn-src-all@freebsd.org, "M. Warner Losh" Subject: Re: svn commit: r187437 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2009 04:25:37 -0000 On Tue, Jan 20, 2009 at 2:22 AM, Jo=E3o Barros wrot= e: > On Tue, Jan 20, 2009 at 8:52 AM, Garrett Cooper wrot= e: >> On Mon, Jan 19, 2009 at 5:13 PM, M. Warner Losh wrote: >>> In message: <200901191619.n0JGJrhJ015123@svn.freebsd.org> >>> Maxim Sobolev writes: >>> : Author: sobomax >>> : Date: Mon Jan 19 16:19:53 2009 >>> : New Revision: 187437 >>> : URL: http://svn.freebsd.org/changeset/base/187437 >>> : >>> : Log: >>> : Mention the fact that the NTFS kernel support isn't >>> : very well maintained and point user to sysutils/fusefs-ntfs, which >>> : at the time of this writing seems to be a better alternative. >>> : >>> : Suggested by: luigi >>> : MFC after: 2 weeks >>> >>> Again, I'd not MFC this to 6.x for sure and maybe not even to 7.x >>> since ntfs works well there. >>> >>> Warner >>> >>> : Modified: >>> : head/sys/conf/NOTES >>> : >>> : Modified: head/sys/conf/NOTES >>> : =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>> : --- head/sys/conf/NOTES Mon Jan 19 15:59:05 2009 (r18743= 6) >>> : +++ head/sys/conf/NOTES Mon Jan 19 16:19:53 2009 (r18743= 7) >>> : @@ -942,7 +942,11 @@ options HPFS #OS/2 File syst= em >>> : options MSDOSFS #MS DOS File System (FAT, FAT32= ) >>> : options NFSSERVER #Network File System server >>> : options NFSLOCKD #Network Lock Manager >>> : -options NTFS #NT File System >>> : + >>> : +# NT File System. Read-mostly and it's not actively maintained. >>> : +# For a better NTFS support consider sysutils/fusefs-ntfs port/packa= ge. >>> : +options NTFS >>> : + >>> : options NULLFS #NULL filesystem >>> : # Broken (depends on NCP): >>> : #options NWFS #NetWare filesystem >> >> Uh, I got consistent panics on 7.x when mounting NTFS partitions >> created with XP. >> I was creating the partition without MSDOS 8.3 short filename >> support though. I personally think that the copy of NTFS in the kernel >> is stale and unusable for a lot of different use-cases, to be honest.. >> -Garrett > > I moved 2x 320GB almost full NTFS partitions to my ZFS home server > using mount_ntfs. ymmv ;-) Yeah, I think the problem was either XP SP2 or the fact that I disabled the MSDOS 8.3 charset features in the registry in Windows. Either way, it looks like there are issues on certain architectures according to posters on current@. -Garrett From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 06:55:27 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F190C1065673; Wed, 21 Jan 2009 06:55:27 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DE05E8FC0A; Wed, 21 Jan 2009 06:55:27 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0L6tRaY069445; Wed, 21 Jan 2009 06:55:27 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0L6tRur069441; Wed, 21 Jan 2009 06:55:27 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200901210655.n0L6tRur069441@svn.freebsd.org> From: Tim Kientzle Date: Wed, 21 Jan 2009 06:55:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187521 - in head/lib/libarchive: . test X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2009 06:55:28 -0000 Author: kientzle Date: Wed Jan 21 06:55:27 2009 New Revision: 187521 URL: http://svn.freebsd.org/changeset/base/187521 Log: Merge-from-Googlecode r419 In archive_write_disk: If archive_write_header() fails to create the file, that's a failure and should return ARCHIVE_FAILED. Metadata restore failures still return ARCHIVE_WARN, because that's non-critical. Fix test_write_disk_secure test to verify the correct return code in one case; add test_write_disk_failures to do another very simple test of restore failure. This should fix cpio coredumping when it tries to restore to a write-protected directory. Thanks to: Giorgos Keramidas MFC after: 30 days Added: head/lib/libarchive/test/test_write_disk_failures.c (contents, props changed) Modified: head/lib/libarchive/archive_write_disk.c head/lib/libarchive/test/Makefile head/lib/libarchive/test/test_write_disk_secure.c Modified: head/lib/libarchive/archive_write_disk.c ============================================================================== --- head/lib/libarchive/archive_write_disk.c Wed Jan 21 06:32:32 2009 (r187520) +++ head/lib/libarchive/archive_write_disk.c Wed Jan 21 06:55:27 2009 (r187521) @@ -484,7 +484,7 @@ _archive_write_header(struct archive *_a } /* We've created the object and are ready to pour data into it. */ - if (ret == ARCHIVE_OK) + if (ret >= ARCHIVE_WARN) a->archive.state = ARCHIVE_STATE_DATA; /* * If it's not open, tell our client not to try writing. @@ -843,7 +843,7 @@ edit_deep_directories(struct archive_wri *tail = '\0'; /* Terminate dir portion */ ret = create_dir(a, a->name); if (ret == ARCHIVE_OK && chdir(a->name) != 0) - ret = ARCHIVE_WARN; + ret = ARCHIVE_FAILED; *tail = '/'; /* Restore the / we removed. */ if (ret != ARCHIVE_OK) return; @@ -884,7 +884,7 @@ restore_entry(struct archive_write_disk /* We tried, but couldn't get rid of it. */ archive_set_error(&a->archive, errno, "Could not unlink"); - return(ARCHIVE_WARN); + return(ARCHIVE_FAILED); } } @@ -903,7 +903,7 @@ restore_entry(struct archive_write_disk && (a->flags & ARCHIVE_EXTRACT_NO_OVERWRITE)) { /* If we're not overwriting, we're done. */ archive_set_error(&a->archive, en, "Already exists"); - return (ARCHIVE_WARN); + return (ARCHIVE_FAILED); } /* @@ -918,7 +918,7 @@ restore_entry(struct archive_write_disk if (rmdir(a->name) != 0) { archive_set_error(&a->archive, errno, "Can't remove already-existing dir"); - return (ARCHIVE_WARN); + return (ARCHIVE_FAILED); } a->pst = NULL; /* Try again. */ @@ -945,7 +945,7 @@ restore_entry(struct archive_write_disk if (r != 0) { archive_set_error(&a->archive, errno, "Can't stat existing object"); - return (ARCHIVE_WARN); + return (ARCHIVE_FAILED); } /* @@ -974,7 +974,7 @@ restore_entry(struct archive_write_disk if (unlink(a->name) != 0) { archive_set_error(&a->archive, errno, "Can't unlink already-existing object"); - return (ARCHIVE_WARN); + return (ARCHIVE_FAILED); } a->pst = NULL; /* Try again. */ @@ -984,7 +984,7 @@ restore_entry(struct archive_write_disk if (rmdir(a->name) != 0) { archive_set_error(&a->archive, errno, "Can't remove already-existing dir"); - return (ARCHIVE_WARN); + return (ARCHIVE_FAILED); } /* Try again. */ en = create_filesystem_object(a); @@ -1007,7 +1007,7 @@ restore_entry(struct archive_write_disk if (en) { /* Everything failed; give up here. */ archive_set_error(&a->archive, en, "Can't create '%s'", a->name); - return (ARCHIVE_WARN); + return (ARCHIVE_FAILED); } a->pst = NULL; /* Cached stat data no longer valid. */ @@ -1393,7 +1393,7 @@ check_symlinks(struct archive_write_disk "Could not remove symlink %s", a->name); pn[0] = c; - return (ARCHIVE_WARN); + return (ARCHIVE_FAILED); } a->pst = NULL; /* @@ -1417,7 +1417,7 @@ check_symlinks(struct archive_write_disk "Cannot remove intervening symlink %s", a->name); pn[0] = c; - return (ARCHIVE_WARN); + return (ARCHIVE_FAILED); } a->pst = NULL; } else { @@ -1425,7 +1425,7 @@ check_symlinks(struct archive_write_disk "Cannot extract through symlink %s", a->name); pn[0] = c; - return (ARCHIVE_WARN); + return (ARCHIVE_FAILED); } } } @@ -1551,7 +1551,7 @@ create_parent_dir(struct archive_write_d * Create the specified dir, recursing to create parents as necessary. * * Returns ARCHIVE_OK if the path exists when we're done here. - * Otherwise, returns ARCHIVE_WARN. + * Otherwise, returns ARCHIVE_FAILED. * Assumes path is in mutable storage; path is unchanged on exit. */ static int @@ -1596,18 +1596,18 @@ create_dir(struct archive_write_disk *a, if ((a->flags & ARCHIVE_EXTRACT_NO_OVERWRITE)) { archive_set_error(&a->archive, EEXIST, "Can't create directory '%s'", path); - return (ARCHIVE_WARN); + return (ARCHIVE_FAILED); } if (unlink(path) != 0) { archive_set_error(&a->archive, errno, "Can't create directory '%s': " "Conflicting file cannot be removed"); - return (ARCHIVE_WARN); + return (ARCHIVE_FAILED); } } else if (errno != ENOENT && errno != ENOTDIR) { /* Stat failed? */ archive_set_error(&a->archive, errno, "Can't test directory '%s'", path); - return (ARCHIVE_WARN); + return (ARCHIVE_FAILED); } else if (slash != NULL) { *slash = '\0'; r = create_dir(a, path); @@ -1648,7 +1648,7 @@ create_dir(struct archive_write_disk *a, return (ARCHIVE_OK); archive_set_error(&a->archive, errno, "Failed to create dir '%s'", path); - return (ARCHIVE_WARN); + return (ARCHIVE_FAILED); } /* Modified: head/lib/libarchive/test/Makefile ============================================================================== --- head/lib/libarchive/test/Makefile Wed Jan 21 06:32:32 2009 (r187520) +++ head/lib/libarchive/test/Makefile Wed Jan 21 06:55:27 2009 (r187521) @@ -58,6 +58,7 @@ TESTS= \ test_write_compress.c \ test_write_compress_program.c \ test_write_disk.c \ + test_write_disk_failures.c \ test_write_disk_hardlink.c \ test_write_disk_perms.c \ test_write_disk_secure.c \ Added: head/lib/libarchive/test/test_write_disk_failures.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libarchive/test/test_write_disk_failures.c Wed Jan 21 06:55:27 2009 (r187521) @@ -0,0 +1,62 @@ +/*- + * Copyright (c) 2003-2007 Tim Kientzle + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``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(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD$"); + +#if ARCHIVE_VERSION_NUMBER >= 1009000 + +#define UMASK 022 + + +#endif + +DEFINE_TEST(test_write_disk_failures) +{ +#if ARCHIVE_VERSION_NUMBER < 1009000 + skipping("archive_write_disk interface"); +#else + struct archive_entry *ae; + struct archive *a; + + /* Force the umask to something predictable. */ + umask(UMASK); + + /* A directory that we can't write to. */ + assertEqualInt(0, mkdir("dir", 0555)); + + /* Try to extract a regular file into the directory above. */ + assert((ae = archive_entry_new()) != NULL); + archive_entry_copy_pathname(ae, "dir/file"); + archive_entry_set_mode(ae, S_IFREG | 0755); + archive_entry_set_size(ae, 8); + assert((a = archive_write_disk_new()) != NULL); + archive_write_disk_set_options(a, ARCHIVE_EXTRACT_TIME); + archive_entry_set_mtime(ae, 123456789, 0); + assertEqualIntA(a, ARCHIVE_FAILED, archive_write_header(a, ae)); + assertEqualIntA(a, 0, archive_write_finish_entry(a)); + assertEqualInt(0, archive_write_finish(a)); + archive_entry_free(ae); +#endif +} Modified: head/lib/libarchive/test/test_write_disk_secure.c ============================================================================== --- head/lib/libarchive/test/test_write_disk_secure.c Wed Jan 21 06:32:32 2009 (r187520) +++ head/lib/libarchive/test/test_write_disk_secure.c Wed Jan 21 06:55:27 2009 (r187521) @@ -80,7 +80,7 @@ DEFINE_TEST(test_write_disk_secure) archive_entry_set_mode(ae, S_IFREG | 0777); archive_write_disk_set_options(a, ARCHIVE_EXTRACT_SECURE_SYMLINKS); failure("Extracting a file through a symlink should fail here."); - assertEqualInt(ARCHIVE_WARN, archive_write_header(a, ae)); + assertEqualInt(ARCHIVE_FAILED, archive_write_header(a, ae)); archive_entry_free(ae); assert(0 == archive_write_finish_entry(a)); From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 08:30:04 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 01C13106566C; Wed, 21 Jan 2009 08:30:04 +0000 (UTC) (envelope-from remko@elvandar.org) Received: from websrv01.jr-hosting.nl (websrv01.jr-hosting.nl [78.47.69.233]) by mx1.freebsd.org (Postfix) with ESMTP id AF4E98FC08; Wed, 21 Jan 2009 08:30:03 +0000 (UTC) (envelope-from remko@elvandar.org) Received: from localhost ([127.0.0.1] helo=galain.elvandar.org) by websrv01.jr-hosting.nl with esmtpa (Exim 4.69 (FreeBSD)) (envelope-from ) id 1LPY2c-0002ZX-Fp; Wed, 21 Jan 2009 09:02:26 +0100 Received: from 145.7.91.133 (SquirrelMail authenticated user remko) by galain.elvandar.org with HTTP; Wed, 21 Jan 2009 09:02:26 +0100 (CET) Message-ID: <961384553be4a4a010d185658b355981.squirrel@galain.elvandar.org> In-Reply-To: <200901202217.n0KMH5U8058352@svn.freebsd.org> References: <200901202217.n0KMH5U8058352@svn.freebsd.org> Date: Wed, 21 Jan 2009 09:02:26 +0100 (CET) From: "Remko Lodder" To: "Maksim Yevmenkin" User-Agent: SquirrelMail/1.4.16 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r187494 - head/sys/dev/usb2/bluetooth X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: remko@elvandar.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2009 08:30:04 -0000 On Tue, January 20, 2009 11:17 pm, Maksim Yevmenkin wrote: > Author: emax > Date: Tue Jan 20 22:17:05 2009 > New Revision: 187494 > URL: http://svn.freebsd.org/changeset/base/187494 > > Log: > Update (well, actually rewrite mostly) ng_ubt2 driver for USB2. > > Reviewed by: HPS, alfred > Blessed by: HPS > nice! good work ;) -- /"\ Best regards, | remko@FreeBSD.org \ / Remko Lodder | remko@EFnet X http://www.evilcoder.org/ | / \ ASCII Ribbon Campaign | Against HTML Mail and News From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 10:51:55 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4317D106564A; Wed, 21 Jan 2009 10:51:55 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 320858FC12; Wed, 21 Jan 2009 10:51:55 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0LAptxj073947; Wed, 21 Jan 2009 10:51:55 GMT (envelope-from phk@svn.freebsd.org) Received: (from phk@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0LAptHZ073946; Wed, 21 Jan 2009 10:51:55 GMT (envelope-from phk@svn.freebsd.org) Message-Id: <200901211051.n0LAptHZ073946@svn.freebsd.org> From: Poul-Henning Kamp Date: Wed, 21 Jan 2009 10:51:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187524 - head/share/zoneinfo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2009 10:51:55 -0000 Author: phk Date: Wed Jan 21 10:51:54 2009 New Revision: 187524 URL: http://svn.freebsd.org/changeset/base/187524 Log: Latest bulletin C from Daniel GAMBIS: no leap at the end of june 2009. Modified: head/share/zoneinfo/leapseconds Modified: head/share/zoneinfo/leapseconds ============================================================================== --- head/share/zoneinfo/leapseconds Wed Jan 21 07:41:24 2009 (r187523) +++ head/share/zoneinfo/leapseconds Wed Jan 21 10:51:54 2009 (r187524) @@ -58,28 +58,19 @@ Leap 2008 Dec 31 23:59:60 + S # e-mail : services.iers@obspm.fr # http://hpiers.obspm.fr/eop-pc # -# Paris, 4 July 2008 +# Paris, 15 January 2009 # -# Bulletin C 36 +# Bulletin C 37 # # To authorities responsible # for the measurement and # distribution of time # -# UTC TIME STEP -# on the 1st of January 2009 -# -# A positive leap second will be introduced at the end of December 2008. -# The sequence of dates of the UTC second markers will be: -# -# 2008 December 31, 23h 59m 59s -# 2008 December 31, 23h 59m 60s -# 2009 January 1, 0h 0m 0s -# -# The difference between UTC and the International Atomic Time TAI is: -# -# from 2006 January 1, 0h UTC, to 2009 January 1 0h UTC : UTC-TAI = - 33s -# from 2009 January 1, 0h UTC, until further notice : UTC-TAI = - 34s +# NO positive leap second will be introduced at the end of June 2009. +# The difference between Coordinated Universal Time UTC and the +# International Atomic Time TAI is : +# +# from 2009 January 1, 0h UTC, until further notice : UTC-TAI = -34 s # # Leap seconds can be introduced in UTC at the end of the months of December # or June, depending on the evolution of UT1-TAI. Bulletin C is mailed every From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 14:22:06 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DFA151065AE9; Wed, 21 Jan 2009 14:22:06 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C6E198FC12; Wed, 21 Jan 2009 14:22:06 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0LEM6eU079928; Wed, 21 Jan 2009 14:22:06 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0LEM6g0079927; Wed, 21 Jan 2009 14:22:06 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200901211422.n0LEM6g0079927@svn.freebsd.org> From: Alexander Motin Date: Wed, 21 Jan 2009 14:22:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187525 - head/sys/dev/mmc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2009 14:22:17 -0000 Author: mav Date: Wed Jan 21 14:22:06 2009 New Revision: 187525 URL: http://svn.freebsd.org/changeset/base/187525 Log: Fix copy/paste mistake in variable name. This could lead to using incorrect bus frequency. Modified: head/sys/dev/mmc/mmc.c Modified: head/sys/dev/mmc/mmc.c ============================================================================== --- head/sys/dev/mmc/mmc.c Wed Jan 21 10:51:54 2009 (r187524) +++ head/sys/dev/mmc/mmc.c Wed Jan 21 14:22:06 2009 (r187525) @@ -1326,7 +1326,7 @@ mmc_calculate_clock(struct mmc_softc *sc max_timing = ivar->timing; if (ivar->tran_speed < max_dtr) max_dtr = ivar->tran_speed; - if (ivar->hs_tran_speed < max_dtr) + if (ivar->hs_tran_speed < max_hs_dtr) max_hs_dtr = ivar->hs_tran_speed; } for (i = 0; i < nkid; i++) { From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 14:42:01 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41F871065879; Wed, 21 Jan 2009 14:42:01 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2EE9A8FC2B; Wed, 21 Jan 2009 14:42:01 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0LEg1Mi080310; Wed, 21 Jan 2009 14:42:01 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0LEg09X080306; Wed, 21 Jan 2009 14:42:00 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200901211442.n0LEg09X080306@svn.freebsd.org> From: John Baldwin Date: Wed, 21 Jan 2009 14:42:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187526 - in head/sys: kern nfsclient ufs/ufs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2009 14:42:02 -0000 Author: jhb Date: Wed Jan 21 14:42:00 2009 New Revision: 187526 URL: http://svn.freebsd.org/changeset/base/187526 Log: Move the VA_MARKATIME flag for VOP_SETATTR() out into its own VOP: VOP_MARKATIME() since unlike the rest of VOP_SETATTR(), VA_MARKATIME can be performed while holding a shared vnode lock (the same functionality is done internally by VOP_READ which can run with a shared vnode lock). Add missing locking of the vnode interlock to the ufs implementation and remove a special note and test from the NFS client about not supporting the feature. Inspired by: ups Tested by: pho Modified: head/sys/kern/vfs_subr.c head/sys/kern/vnode_if.src head/sys/nfsclient/nfs_vnops.c head/sys/ufs/ufs/ufs_vnops.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Wed Jan 21 14:22:06 2009 (r187525) +++ head/sys/kern/vfs_subr.c Wed Jan 21 14:42:00 2009 (r187526) @@ -4206,18 +4206,15 @@ vfs_read_dirent(struct vop_readdir_args /* * Mark for update the access time of the file if the filesystem - * supports VA_MARK_ATIME. This functionality is used by execve + * supports VOP_MARKATIME. This functionality is used by execve * and mmap, so we want to avoid the synchronous I/O implied by * directly setting va_atime for the sake of efficiency. */ void vfs_mark_atime(struct vnode *vp, struct ucred *cred) { - struct vattr atimeattr; if ((vp->v_mount->mnt_flag & (MNT_NOATIME | MNT_RDONLY)) == 0) { - VATTR_NULL(&atimeattr); - atimeattr.va_vaflags |= VA_MARK_ATIME; - (void)VOP_SETATTR(vp, &atimeattr, cred); + (void)VOP_MARKATIME(vp); } } Modified: head/sys/kern/vnode_if.src ============================================================================== --- head/sys/kern/vnode_if.src Wed Jan 21 14:22:06 2009 (r187525) +++ head/sys/kern/vnode_if.src Wed Jan 21 14:42:00 2009 (r187526) @@ -171,6 +171,11 @@ vop_setattr { IN struct ucred *cred; }; +%% markatime vp L L L + +vop_markatime { + IN struct vnode *vp; +}; %% read vp L L L Modified: head/sys/nfsclient/nfs_vnops.c ============================================================================== --- head/sys/nfsclient/nfs_vnops.c Wed Jan 21 14:22:06 2009 (r187525) +++ head/sys/nfsclient/nfs_vnops.c Wed Jan 21 14:42:00 2009 (r187526) @@ -707,9 +707,9 @@ nfs_setattr(struct vop_setattr_args *ap) #endif /* - * Setting of flags and marking of atimes are not supported. + * Setting of flags is not supported. */ - if (vap->va_flags != VNOVAL || (vap->va_vaflags & VA_MARK_ATIME)) + if (vap->va_flags != VNOVAL) return (EOPNOTSUPP); /* Modified: head/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- head/sys/ufs/ufs/ufs_vnops.c Wed Jan 21 14:22:06 2009 (r187525) +++ head/sys/ufs/ufs/ufs_vnops.c Wed Jan 21 14:42:00 2009 (r187526) @@ -98,6 +98,7 @@ static vop_create_t ufs_create; static vop_getattr_t ufs_getattr; static vop_link_t ufs_link; static int ufs_makeinode(int mode, struct vnode *, struct vnode **, struct componentname *); +static vop_markatime_t ufs_markatime; static vop_mkdir_t ufs_mkdir; static vop_mknod_t ufs_mknod; static vop_open_t ufs_open; @@ -491,17 +492,6 @@ ufs_setattr(ap) ((int)vap->va_bytes != VNOVAL) || (vap->va_gen != VNOVAL)) { return (EINVAL); } - /* - * Mark for update the file's access time for vfs_mark_atime(). - * We are doing this here to avoid some of the checks done - * below -- this operation is done by request of the kernel and - * should bypass some security checks. Things like read-only - * checks get handled by other levels (e.g., ffs_update()). - */ - if (vap->va_vaflags & VA_MARK_ATIME) { - ip->i_flag |= IN_ACCESS; - return (0); - } if (vap->va_flags != VNOVAL) { if (vp->v_mount->mnt_flag & MNT_RDONLY) return (EROFS); @@ -663,6 +653,25 @@ ufs_setattr(ap) } /* + * Mark this file's access time for update for vfs_mark_atime(). This + * is called from execve() and mmap(). + */ +static int +ufs_markatime(ap) + struct vop_markatime_args /* { + struct vnode *a_vp; + } */ *ap; +{ + struct vnode *vp = ap->a_vp; + struct inode *ip = VTOI(vp); + + VI_LOCK(vp); + ip->i_flag |= IN_ACCESS; + VI_UNLOCK(vp); + return (0); +} + +/* * Change the mode on a file. * Inode must be locked before calling. */ @@ -2481,6 +2490,7 @@ struct vop_vector ufs_vnodeops = { .vop_rename = ufs_rename, .vop_rmdir = ufs_rmdir, .vop_setattr = ufs_setattr, + .vop_markatime = ufs_markatime, #ifdef MAC .vop_setlabel = vop_stdsetlabel_ea, #endif @@ -2511,6 +2521,7 @@ struct vop_vector ufs_fifoops = { .vop_read = VOP_PANIC, .vop_reclaim = ufs_reclaim, .vop_setattr = ufs_setattr, + .vop_markatime = ufs_markatime, #ifdef MAC .vop_setlabel = vop_stdsetlabel_ea, #endif From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 14:43:35 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F2F1106584B; Wed, 21 Jan 2009 14:43:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4D1B88FC13; Wed, 21 Jan 2009 14:43:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0LEhZ4m080377; Wed, 21 Jan 2009 14:43:35 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0LEhZAI080376; Wed, 21 Jan 2009 14:43:35 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200901211443.n0LEhZAI080376@svn.freebsd.org> From: John Baldwin Date: Wed, 21 Jan 2009 14:43:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187527 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2009 14:43:37 -0000 Author: jhb Date: Wed Jan 21 14:43:35 2009 New Revision: 187527 URL: http://svn.freebsd.org/changeset/base/187527 Log: Now that vfs_markatime() no longer requires an exclusive lock due to the VOP_MARKATIME() changes, use a shared vnode lock for mmap(). Submitted by: ups Modified: head/sys/vm/vm_mmap.c Modified: head/sys/vm/vm_mmap.c ============================================================================== --- head/sys/vm/vm_mmap.c Wed Jan 21 14:42:00 2009 (r187526) +++ head/sys/vm/vm_mmap.c Wed Jan 21 14:43:35 2009 (r187527) @@ -1160,7 +1160,7 @@ vm_mmap_vnode(struct thread *td, vm_size mp = vp->v_mount; cred = td->td_ucred; vfslocked = VFS_LOCK_GIANT(mp); - if ((error = vget(vp, LK_EXCLUSIVE, td)) != 0) { + if ((error = vget(vp, LK_SHARED, td)) != 0) { VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -1177,7 +1177,7 @@ vm_mmap_vnode(struct thread *td, vm_size if (obj->handle != vp) { vput(vp); vp = (struct vnode*)obj->handle; - vget(vp, LK_EXCLUSIVE, td); + vget(vp, LK_SHARED, td); } type = OBJT_VNODE; handle = vp; From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 14:51:38 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF9D4106564A; Wed, 21 Jan 2009 14:51:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 92EB48FC08; Wed, 21 Jan 2009 14:51:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0LEpcOD080590; Wed, 21 Jan 2009 14:51:38 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0LEpcN3080587; Wed, 21 Jan 2009 14:51:38 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200901211451.n0LEpcN3080587@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 21 Jan 2009 14:51:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187528 - in head/sys: kern sys ufs/ufs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2009 14:51:39 -0000 Author: kib Date: Wed Jan 21 14:51:38 2009 New Revision: 187528 URL: http://svn.freebsd.org/changeset/base/187528 Log: Move the code from ufs_lookup.c used to do dotdot lookup, into the helper function. It is supposed to be useful for any filesystem that has to unlock dvp to walk to the ".." entry in lookup routine. Requested by: jhb Tested by: pho MFC after: 1 month Modified: head/sys/kern/vfs_vnops.c head/sys/sys/vnode.h head/sys/ufs/ufs/ufs_lookup.c Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Wed Jan 21 14:43:35 2009 (r187527) +++ head/sys/kern/vfs_vnops.c Wed Jan 21 14:51:38 2009 (r187528) @@ -1286,3 +1286,35 @@ vn_extattr_rm(struct vnode *vp, int iofl return (error); } + +int +vn_vget_ino(struct vnode *vp, ino_t ino, int lkflags, struct vnode **rvp) +{ + struct mount *mp; + int ltype, error; + + mp = vp->v_mount; + ltype = VOP_ISLOCKED(vp); + KASSERT(ltype == LK_EXCLUSIVE || ltype == LK_SHARED, + ("vn_vget_ino: vp not locked")); + for (;;) { + error = vfs_busy(mp, MBF_NOWAIT); + if (error == 0) + break; + VOP_UNLOCK(vp, 0); + pause("vn_vget", 1); + vn_lock(vp, ltype | LK_RETRY); + if (vp->v_iflag & VI_DOOMED) + return (ENOENT); + } + VOP_UNLOCK(vp, 0); + error = VFS_VGET(mp, ino, lkflags, rvp); + vfs_unbusy(mp); + vn_lock(vp, ltype | LK_RETRY); + if (vp->v_iflag & VI_DOOMED) { + if (error == 0) + vput(*rvp); + error = ENOENT; + } + return (error); +} Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Wed Jan 21 14:43:35 2009 (r187527) +++ head/sys/sys/vnode.h Wed Jan 21 14:51:38 2009 (r187528) @@ -636,6 +636,9 @@ int vn_extattr_set(struct vnode *vp, int const char *attrname, int buflen, char *buf, struct thread *td); int vn_extattr_rm(struct vnode *vp, int ioflg, int attrnamespace, const char *attrname, struct thread *td); +int vn_vget_ino(struct vnode *vp, ino_t ino, int lkflags, + struct vnode **rvp); + int vfs_cache_lookup(struct vop_lookup_args *ap); void vfs_timestamp(struct timespec *); void vfs_write_resume(struct mount *mp); Modified: head/sys/ufs/ufs/ufs_lookup.c ============================================================================== --- head/sys/ufs/ufs/ufs_lookup.c Wed Jan 21 14:43:35 2009 (r187527) +++ head/sys/ufs/ufs/ufs_lookup.c Wed Jan 21 14:51:38 2009 (r187528) @@ -157,7 +157,6 @@ ufs_lookup(ap) int nameiop = cnp->cn_nameiop; ino_t ino; int ltype; - struct mount *mp; bp = NULL; slotoffset = -1; @@ -578,27 +577,7 @@ found: */ pdp = vdp; if (flags & ISDOTDOT) { - ltype = VOP_ISLOCKED(pdp); - mp = pdp->v_mount; - for (;;) { - error = vfs_busy(mp, MBF_NOWAIT); - if (error == 0) - break; - VOP_UNLOCK(pdp, 0); - pause("ufs_dd", 1); - vn_lock(pdp, ltype | LK_RETRY); - if (pdp->v_iflag & VI_DOOMED) - return (ENOENT); - } - VOP_UNLOCK(pdp, 0); /* race to get the inode */ - error = VFS_VGET(mp, ino, cnp->cn_lkflags, &tdp); - vfs_unbusy(mp); - vn_lock(pdp, ltype | LK_RETRY); - if (pdp->v_iflag & VI_DOOMED) { - if (error == 0) - vput(tdp); - error = ENOENT; - } + error = vn_vget_ino(pdp, ino, cnp->cn_lkflags, &tdp); if (error) return (error); *vpp = tdp; From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 17:28:24 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5FC76106566C; Wed, 21 Jan 2009 17:28:24 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4DD868FC1B; Wed, 21 Jan 2009 17:28:24 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0LHSOXh084771; Wed, 21 Jan 2009 17:28:24 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0LHSO7n084770; Wed, 21 Jan 2009 17:28:24 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200901211728.n0LHSO7n084770@svn.freebsd.org> From: Warner Losh Date: Wed, 21 Jan 2009 17:28:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187543 - head/sys/dev/mmc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2009 17:28:25 -0000 Author: imp Date: Wed Jan 21 17:28:24 2009 New Revision: 187543 URL: http://svn.freebsd.org/changeset/base/187543 Log: Make the command reporting be under boot verbose. Also, report a few other things under boot verbose. Small style nit to make new code look like old code in this file. Modified: head/sys/dev/mmc/mmc.c Modified: head/sys/dev/mmc/mmc.c ============================================================================== --- head/sys/dev/mmc/mmc.c Wed Jan 21 17:23:06 2009 (r187542) +++ head/sys/dev/mmc/mmc.c Wed Jan 21 17:28:24 2009 (r187543) @@ -340,7 +340,9 @@ mmc_wait_for_cmd(struct mmc_softc *sc, s memset(cmd->resp, 0, sizeof(cmd->resp)); cmd->retries = retries; mreq.cmd = cmd; -/* printf("CMD: %x ARG %x\n", cmd->opcode, cmd->arg); */ + if (bootverbose) + device_printf(sc->dev, "CMD: %#x ARG %#x\n", cmd->opcode, + cmd->arg); mmc_wait_for_req(sc, &mreq); return (cmd->error); } @@ -629,6 +631,7 @@ mmc_set_timing(struct mmc_softc *sc, int { int err; uint8_t value; + u_char switch_res[64]; switch (timing) { case bus_timing_normal: @@ -640,14 +643,11 @@ mmc_set_timing(struct mmc_softc *sc, int default: return (MMC_ERR_INVALID); } - if (mmcbr_get_mode(sc->dev) == mode_sd) { - u_char switch_res[64]; - + if (mmcbr_get_mode(sc->dev) == mode_sd) err = mmc_sd_switch(sc, 1, 0, value, switch_res); - } else { + else err = mmc_switch(sc, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_HS_TIMING, value); - } return (err); } @@ -1255,8 +1255,12 @@ mmc_go_discovery(struct mmc_softc *sc) mmcbr_set_mode(dev, mode_sd); mmc_power_up(sc); mmcbr_set_bus_mode(dev, pushpull); + if (bootverbose) + device_printf(sc->dev, "Idle cards for SD probe\n"); mmc_idle_cards(sc); err = mmc_send_if_cond(sc, 1); + if (bootverbose) + device_printf(sc->dev, "SD: SEND_IF_CONF %d\n", err); if (mmc_send_app_op_cond(sc, err ? 0 : MMC_OCR_CCS, &ocr) != MMC_ERR_NONE) { /* From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 17:34:14 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B5174106568C; Wed, 21 Jan 2009 17:34:14 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A383A8FC1C; Wed, 21 Jan 2009 17:34:14 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0LHYEeY085055; Wed, 21 Jan 2009 17:34:14 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0LHYEAG085054; Wed, 21 Jan 2009 17:34:14 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200901211734.n0LHYEAG085054@svn.freebsd.org> From: Warner Losh Date: Wed, 21 Jan 2009 17:34:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187546 - head/sys/dev/mmc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2009 17:34:15 -0000 Author: imp Date: Wed Jan 21 17:34:14 2009 New Revision: 187546 URL: http://svn.freebsd.org/changeset/base/187546 Log: Fix minor style nit for file consistency. Modified: head/sys/dev/mmc/mmc.c Modified: head/sys/dev/mmc/mmc.c ============================================================================== --- head/sys/dev/mmc/mmc.c Wed Jan 21 17:33:45 2009 (r187545) +++ head/sys/dev/mmc/mmc.c Wed Jan 21 17:34:14 2009 (r187546) @@ -586,11 +586,11 @@ mmc_sd_switch(struct mmc_softc *sc, uint static int mmc_set_card_bus_width(struct mmc_softc *sc, uint16_t rca, int width) { + struct mmc_command cmd; int err; + uint8_t value; if (mmcbr_get_mode(sc->dev) == mode_sd) { - struct mmc_command cmd; - memset(&cmd, 0, sizeof(struct mmc_command)); cmd.opcode = ACMD_SET_BUS_WIDTH; cmd.flags = MMC_RSP_R1 | MMC_CMD_AC; @@ -606,8 +606,6 @@ mmc_set_card_bus_width(struct mmc_softc } err = mmc_wait_for_app_cmd(sc, rca, &cmd, CMD_RETRIES); } else { - uint8_t value; - switch (width) { case bus_width_1: value = EXT_CSD_BUS_WIDTH_1; @@ -621,7 +619,8 @@ mmc_set_card_bus_width(struct mmc_softc default: return (MMC_ERR_INVALID); } - err = mmc_switch(sc, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_BUS_WIDTH, value); + err = mmc_switch(sc, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_BUS_WIDTH, + value); } return (err); } From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 17:39:11 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8AF321065670; Wed, 21 Jan 2009 17:39:11 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 787D08FC08; Wed, 21 Jan 2009 17:39:11 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0LHdBDG085218; Wed, 21 Jan 2009 17:39:11 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0LHdBpi085217; Wed, 21 Jan 2009 17:39:11 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200901211739.n0LHdBpi085217@svn.freebsd.org> From: Warner Losh Date: Wed, 21 Jan 2009 17:39:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187548 - head/sys/arm/at91 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2009 17:39:13 -0000 Author: imp Date: Wed Jan 21 17:39:11 2009 New Revision: 187548 URL: http://svn.freebsd.org/changeset/base/187548 Log: o The f_max is really at91_master_clock / 2, not 30MHz, so compute it as such. o Only set 4-bit caps on those boards that have 4-bit caps (this means that because we don't set wire4 yet, this forces us to always use 1-bit bus). o Don't test wire4 when setting up the bus width, since bad things will happen if we do. # This likely won't fix the busted at91 sd card support, but these are # needful changes for correctness. Modified: head/sys/arm/at91/at91_mci.c Modified: head/sys/arm/at91/at91_mci.c ============================================================================== --- head/sys/arm/at91/at91_mci.c Wed Jan 21 17:36:06 2009 (r187547) +++ head/sys/arm/at91/at91_mci.c Wed Jan 21 17:39:11 2009 (r187548) @@ -199,9 +199,12 @@ at91_mci_attach(device_t dev) goto out; } sc->host.f_min = 375000; - sc->host.f_max = 30000000; + sc->host.f_max = at91_master_clock / 2; /* Typically 30MHz */ sc->host.host_ocr = MMC_OCR_320_330 | MMC_OCR_330_340; - sc->host.caps = MMC_CAP_4_BIT_DATA; + if (sc->wire4) + sc->host.caps = MMC_CAP_4_BIT_DATA; + else + sc->host.caps = 0; child = device_add_child(dev, "mmc", 0); device_set_ivars(dev, &sc->host); err = bus_generic_attach(dev); @@ -294,7 +297,7 @@ at91_mci_update_ios(device_t brdev, devi else clkdiv = (at91_master_clock / ios->clock) / 2; } - if (ios->bus_width == bus_width_4 && sc->wire4) + if (ios->bus_width == bus_width_4) WR4(sc, MCI_SDCR, RD4(sc, MCI_SDCR) | MCI_SDCR_SDCBUS); else WR4(sc, MCI_SDCR, RD4(sc, MCI_SDCR) & ~MCI_SDCR_SDCBUS); From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 17:49:24 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 53C42106566B; Wed, 21 Jan 2009 17:49:24 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 429498FC20; Wed, 21 Jan 2009 17:49:24 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0LHnOZg085522; Wed, 21 Jan 2009 17:49:24 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0LHnOTm085521; Wed, 21 Jan 2009 17:49:24 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200901211749.n0LHnOTm085521@svn.freebsd.org> From: Warner Losh Date: Wed, 21 Jan 2009 17:49:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187551 - head/sys/dev/mmc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2009 17:49:24 -0000 Author: imp Date: Wed Jan 21 17:49:23 2009 New Revision: 187551 URL: http://svn.freebsd.org/changeset/base/187551 Log: Default to normal bus timing mode on SD cards. In practice, most cards people have today support high speed mode, so the timing field would be initialized to bus_timing_hs, but there are some slow cards... Modified: head/sys/dev/mmc/mmc.c Modified: head/sys/dev/mmc/mmc.c ============================================================================== --- head/sys/dev/mmc/mmc.c Wed Jan 21 17:42:57 2009 (r187550) +++ head/sys/dev/mmc/mmc.c Wed Jan 21 17:49:23 2009 (r187551) @@ -1118,6 +1118,7 @@ mmc_discover_cards(struct mmc_softc *sc) mmc_app_send_scr(sc, ivar->rca, ivar->raw_scr); mmc_app_decode_scr(ivar->raw_scr, &ivar->scr); /* Get card switch capabilities. */ + ivar->timing = bus_timing_normal; if ((ivar->scr.sda_vsn >= 1) && (ivar->csd.ccc & (1<<10))) { mmc_sd_switch(sc, 0, 0, 0xF, switch_res); From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 19:43:11 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3026410656C1; Wed, 21 Jan 2009 19:43:11 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1CD6C8FC1A; Wed, 21 Jan 2009 19:43:11 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0LJhBXv088176; Wed, 21 Jan 2009 19:43:11 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0LJhADQ088174; Wed, 21 Jan 2009 19:43:10 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200901211943.n0LJhADQ088174@svn.freebsd.org> From: Ed Schouten Date: Wed, 21 Jan 2009 19:43:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187562 - head/sys/dev/syscons/teken X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2009 19:43:12 -0000 Author: ed Date: Wed Jan 21 19:43:10 2009 New Revision: 187562 URL: http://svn.freebsd.org/changeset/base/187562 Log: Add Unicode rendering to the teken demo application. Some time ago I tried adding Unicode rendering to the teken demo application, but I didn't get it working. It seems I forgot to call setlocale(). Polish this code and make sure it doesn't get lost. Also a small fix for my previous commit: all Unicode characters in teken_boxdrawing are below 0x10000, so store them as 16-bit values. Modified: head/sys/dev/syscons/teken/teken_demo.c head/sys/dev/syscons/teken/teken_scs.h Modified: head/sys/dev/syscons/teken/teken_demo.c ============================================================================== --- head/sys/dev/syscons/teken/teken_demo.c Wed Jan 21 18:54:35 2009 (r187561) +++ head/sys/dev/syscons/teken/teken_demo.c Wed Jan 21 19:43:10 2009 (r187562) @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -83,7 +84,8 @@ static void printchar(const teken_pos_t *p) { int y, x, attr = 0; - struct pixel *px, pt; + struct pixel *px; + char str[5] = { 0 }; assert(p->tp_row < NROWS); assert(p->tp_col < NCOLS); @@ -92,14 +94,26 @@ printchar(const teken_pos_t *p) px = &buffer[p->tp_col][p->tp_row]; - if (px->c >= 0x80) { - /* Mark UTF-8 chars (we don't support it). */ - px = &pt; - px->c = '?'; - px->a.ta_format = TF_BOLD; - px->a.ta_fgcolor = TC_BROWN; - px->a.ta_bgcolor = TC_RED; + /* Convert Unicode to UTF-8. */ +#ifdef TEKEN_UTF8 + if (px->c < 0x80) { + str[0] = px->c; + } else if (px->c < 0x800) { + str[0] = 0xc0 | (px->c >> 6); + str[1] = 0x80 | (px->c & 0x3f); + } else if (px->c < 0x10000) { + str[0] = 0xe0 | (px->c >> 12); + str[1] = 0x80 | ((px->c >> 6) & 0x3f); + str[2] = 0x80 | (px->c & 0x3f); + } else { + str[0] = 0xf0 | (px->c >> 18); + str[1] = 0x80 | ((px->c >> 12) & 0x3f); + str[2] = 0x80 | ((px->c >> 6) & 0x3f); + str[3] = 0x80 | (px->c & 0x3f); } +#else /* !TEKEN_UTF8 */ + str[0] = px->c; +#endif /* TEKEN_UTF8 */ if (px->a.ta_format & TF_BOLD) attr |= A_BOLD; @@ -109,7 +123,7 @@ printchar(const teken_pos_t *p) attr |= A_BLINK; bkgdset(attr | COLOR_PAIR(px->a.ta_fgcolor + 8 * px->a.ta_bgcolor)); - mvaddch(p->tp_row, p->tp_col, px->c); + mvaddstr(p->tp_row, p->tp_col, str); move(y, x); } @@ -272,9 +286,16 @@ main(int argc __unused, char *argv[] __u fd_set rfds; char b[256]; ssize_t bl; - const int ccolors[8] = { COLOR_BLACK, COLOR_RED, COLOR_GREEN, COLOR_YELLOW, COLOR_BLUE, COLOR_MAGENTA, COLOR_CYAN, COLOR_WHITE }; + const int ccolors[8] = { + COLOR_BLACK, COLOR_RED, COLOR_GREEN, COLOR_YELLOW, + COLOR_BLUE, COLOR_MAGENTA, COLOR_CYAN, COLOR_WHITE + }; int i, j; +#ifdef TEKEN_UTF8 + setlocale(LC_CTYPE, "UTF-8"); +#endif /* TEKEN_UTF8 */ + tp.tp_row = ws.ws_row = NROWS; tp.tp_col = ws.ws_col = NCOLS; Modified: head/sys/dev/syscons/teken/teken_scs.h ============================================================================== --- head/sys/dev/syscons/teken/teken_scs.h Wed Jan 21 18:54:35 2009 (r187561) +++ head/sys/dev/syscons/teken/teken_scs.h Wed Jan 21 19:43:10 2009 (r187562) @@ -62,7 +62,7 @@ teken_scs_process(teken_t *t, teken_char } /* Unicode points for VT100 box drawing. */ -static const teken_char_t teken_boxdrawing[31] = { +static const uint16_t teken_boxdrawing[31] = { 0x25c6, 0x2592, 0x2409, 0x240c, 0x240d, 0x240a, 0x00b0, 0x00b1, 0x2424, 0x240b, 0x2518, 0x2510, 0x250c, 0x2514, 0x253c, 0x23ba, 0x23bb, 0x2500, 0x23bc, 0x23bd, 0x251c, 0x2524, 0x2534, 0x252c, From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 20:08:17 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E90081065673; Wed, 21 Jan 2009 20:08:17 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D7F098FC18; Wed, 21 Jan 2009 20:08:17 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0LK8HUF088751; Wed, 21 Jan 2009 20:08:17 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0LK8HeN088749; Wed, 21 Jan 2009 20:08:17 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200901212008.n0LK8HeN088749@svn.freebsd.org> From: John Baldwin Date: Wed, 21 Jan 2009 20:08:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187564 - in head/sys: kern ufs/ufs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2009 20:08:18 -0000 Author: jhb Date: Wed Jan 21 20:08:17 2009 New Revision: 187564 URL: http://svn.freebsd.org/changeset/base/187564 Log: Fix a few style bogons. Submitted by: bde Modified: head/sys/kern/vfs_subr.c head/sys/ufs/ufs/ufs_vnops.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Wed Jan 21 20:05:12 2009 (r187563) +++ head/sys/kern/vfs_subr.c Wed Jan 21 20:08:17 2009 (r187564) @@ -4214,7 +4214,6 @@ void vfs_mark_atime(struct vnode *vp, struct ucred *cred) { - if ((vp->v_mount->mnt_flag & (MNT_NOATIME | MNT_RDONLY)) == 0) { + if ((vp->v_mount->mnt_flag & (MNT_NOATIME | MNT_RDONLY)) == 0) (void)VOP_MARKATIME(vp); - } } Modified: head/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- head/sys/ufs/ufs/ufs_vnops.c Wed Jan 21 20:05:12 2009 (r187563) +++ head/sys/ufs/ufs/ufs_vnops.c Wed Jan 21 20:08:17 2009 (r187564) @@ -2477,6 +2477,7 @@ struct vop_vector ufs_vnodeops = { .vop_inactive = ufs_inactive, .vop_link = ufs_link, .vop_lookup = vfs_cache_lookup, + .vop_markatime = ufs_markatime, .vop_mkdir = ufs_mkdir, .vop_mknod = ufs_mknod, .vop_open = ufs_open, @@ -2490,7 +2491,6 @@ struct vop_vector ufs_vnodeops = { .vop_rename = ufs_rename, .vop_rmdir = ufs_rmdir, .vop_setattr = ufs_setattr, - .vop_markatime = ufs_markatime, #ifdef MAC .vop_setlabel = vop_stdsetlabel_ea, #endif @@ -2517,11 +2517,11 @@ struct vop_vector ufs_fifoops = { .vop_getattr = ufs_getattr, .vop_inactive = ufs_inactive, .vop_kqfilter = ufsfifo_kqfilter, + .vop_markatime = ufs_markatime, .vop_print = ufs_print, .vop_read = VOP_PANIC, .vop_reclaim = ufs_reclaim, .vop_setattr = ufs_setattr, - .vop_markatime = ufs_markatime, #ifdef MAC .vop_setlabel = vop_stdsetlabel_ea, #endif From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 20:44:43 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 149631065DD2; Wed, 21 Jan 2009 20:44:43 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 009258FC17; Wed, 21 Jan 2009 20:44:43 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0LKigYJ090753; Wed, 21 Jan 2009 20:44:42 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0LKig3S090752; Wed, 21 Jan 2009 20:44:42 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200901212044.n0LKig3S090752@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 21 Jan 2009 20:44:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187566 - head/sys/contrib/altq/altq X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2009 20:44:44 -0000 Author: jkim Date: Wed Jan 21 20:44:42 2009 New Revision: 187566 URL: http://svn.freebsd.org/changeset/base/187566 Log: Change __FreeBSD_version to prepare for merging r184102. Modified: head/sys/contrib/altq/altq/altq_subr.c Modified: head/sys/contrib/altq/altq/altq_subr.c ============================================================================== --- head/sys/contrib/altq/altq/altq_subr.c Wed Jan 21 20:16:11 2009 (r187565) +++ head/sys/contrib/altq/altq/altq_subr.c Wed Jan 21 20:44:42 2009 (r187566) @@ -910,7 +910,7 @@ tsc_freq_changed(void *arg, const struct if (status != 0) return; -#if (__FreeBSD_version >= 800050) && (defined(__amd64__) || defined(__i386__)) +#if (__FreeBSD_version >= 701102) && (defined(__amd64__) || defined(__i386__)) /* If TSC is P-state invariant, don't do anything. */ if (tsc_is_invariant) return; From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 20:57:28 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8155610656C7; Wed, 21 Jan 2009 20:57:28 +0000 (UTC) (envelope-from joerg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 558858FC13; Wed, 21 Jan 2009 20:57:28 +0000 (UTC) (envelope-from joerg@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0LKvS55091115; Wed, 21 Jan 2009 20:57:28 GMT (envelope-from joerg@svn.freebsd.org) Received: (from joerg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0LKvSAg091113; Wed, 21 Jan 2009 20:57:28 GMT (envelope-from joerg@svn.freebsd.org) Message-Id: <200901212057.n0LKvSAg091113@svn.freebsd.org> From: Joerg Wunsch Date: Wed, 21 Jan 2009 20:57:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187568 - head/sys/dev/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2009 20:57:29 -0000 Author: joerg Date: Wed Jan 21 20:57:28 2009 New Revision: 187568 URL: http://svn.freebsd.org/changeset/base/187568 Log: Add the dresden elektronik SensorTerminalBoard which uses an FT245. Modified: head/sys/dev/usb/uftdi.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/uftdi.c ============================================================================== --- head/sys/dev/usb/uftdi.c Wed Jan 21 20:53:36 2009 (r187567) +++ head/sys/dev/usb/uftdi.c Wed Jan 21 20:57:28 2009 (r187568) @@ -186,6 +186,9 @@ uftdi_match(device_t self) if (uaa->vendor == USB_VENDOR_MELCO && (uaa->product == USB_PRODUCT_MELCO_PCOPRS1)) return (UMATCH_VENDOR_PRODUCT); + if (uaa->vendor == USB_VENDOR_DRESDENELEKTRONIK && + (uaa->product == USB_PRODUCT_DRESDENELEKTRONIK_SENSORTERMINALBOARD)) + return (UMATCH_VENDOR_PRODUCT); return (UMATCH_NONE); } @@ -316,6 +319,18 @@ uftdi_attach(device_t self) } break; + case USB_VENDOR_DRESDENELEKTRONIK: + switch( uaa->product ){ + case USB_PRODUCT_DRESDENELEKTRONIK_SENSORTERMINALBOARD: + sc->sc_type = UFTDI_TYPE_8U232AM; + sc->sc_hdrlen = 0; + break; + + default: /* Can't happen */ + goto bad; + } + break; + default: /* Can't happen */ goto bad; } Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Wed Jan 21 20:53:36 2009 (r187567) +++ head/sys/dev/usb/usbdevs Wed Jan 21 20:57:28 2009 (r187568) @@ -623,6 +623,7 @@ vendor QCOM 0x18e8 Qcom vendor LINKSYS3 0x1915 Linksys vendor QUALCOMMINC 0x19d2 Qualcomm, Incorporated vendor STELERA 0x1a8d Stelera Wireless +vendor DRESDENELEKTRONIK 0x1cf1 dresden elektronik vendor DLINK 0x2001 D-Link vendor PLANEX2 0x2019 Planex Communications vendor ERICSSON 0x2282 Ericsson @@ -1169,6 +1170,9 @@ product DMI CFSM_RW 0xa109 CF/SM Reader /* DrayTek products */ product DRAYTEK VIGOR550 0x0550 Vigor550 +/* dresden elektronik products */ +product DRESDENELEKTRONIK SENSORTERMINALBOARD 0x0001 SensorTerminalBoard + /* Dynastream Innovations */ product DYNASTREAM ANTDEVBOARD 0x1003 ANT dev board From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 21:29:00 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C6529106568C; Wed, 21 Jan 2009 21:29:00 +0000 (UTC) (envelope-from tabthorpe@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B2CC48FC1C; Wed, 21 Jan 2009 21:29:00 +0000 (UTC) (envelope-from tabthorpe@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0LLT0F1091892; Wed, 21 Jan 2009 21:29:00 GMT (envelope-from tabthorpe@svn.freebsd.org) Received: (from tabthorpe@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0LLT0YA091891; Wed, 21 Jan 2009 21:29:00 GMT (envelope-from tabthorpe@svn.freebsd.org) Message-Id: <200901212129.n0LLT0YA091891@svn.freebsd.org> From: Thomas Abthorpe Date: Wed, 21 Jan 2009 21:29:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187573 - head/share/man/man7 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2009 21:29:02 -0000 Author: tabthorpe (ports committer) Date: Wed Jan 21 21:29:00 2009 New Revision: 187573 URL: http://svn.freebsd.org/changeset/base/187573 Log: - Document targets run-depends-list and build-depends-list PR: docs/127575 Submitted by: Walter Venable Approved by: keramida MFC after: 3 days Modified: head/share/man/man7/ports.7 Modified: head/share/man/man7/ports.7 ============================================================================== --- head/share/man/man7/ports.7 Wed Jan 21 21:28:21 2009 (r187572) +++ head/share/man/man7/ports.7 Wed Jan 21 21:29:00 2009 (r187573) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 22, 2008 +.Dd January 21, 2009 .Dt PORTS 7 .Os .Sh NAME @@ -196,11 +196,14 @@ Fetch the distfiles of the port and all .It Cm fetch-recursive-list Show list of files that would be retrieved by .Cm fetch-recursive . +.It Cm run-depends-list , build-depends-list +Print a list of all the compile and run dependencies, and dependencies +of those dependencies, by port directory. .It Cm all-depends-list Print a list of all dependencies for the port. .It Cm pretty-print-run-depends-list , pretty-print-build-depends-list Print a list of all the compile and run dependencies, and dependencies -of those dependencies. +of those dependencies, by port name and version. .It Cm missing Print a list of missing dependencies to be installed for the port. .It Cm clean @@ -251,6 +254,8 @@ and Like .Cm package , but makes a package for each depending port as well. +.It Cm package-name +Prints the name with version of the port. .It Cm readmes Create a port's .Pa README.html . From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 22:05:08 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A0541065672; Wed, 21 Jan 2009 22:05:08 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.cksoft.de (mail.cksoft.de [62.111.66.27]) by mx1.freebsd.org (Postfix) with ESMTP id B2FA68FC17; Wed, 21 Jan 2009 22:05:07 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from localhost (amavis.str.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id 2591D41C705; Wed, 21 Jan 2009 23:05:06 +0100 (CET) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([62.111.66.27]) by localhost (amavis.str.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id C+OoDpzk8zA7; Wed, 21 Jan 2009 23:05:05 +0100 (CET) Received: by mail.cksoft.de (Postfix, from userid 66) id C176C41C6DB; Wed, 21 Jan 2009 23:05:05 +0100 (CET) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id 9657A4448D5; Wed, 21 Jan 2009 22:00:19 +0000 (UTC) Date: Wed, 21 Jan 2009 22:00:19 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Jung-uk Kim In-Reply-To: <200901212044.n0LKig3S090752@svn.freebsd.org> Message-ID: <20090121215905.F45399@maildrop.int.zabbadoz.net> References: <200901212044.n0LKig3S090752@svn.freebsd.org> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r187566 - head/sys/contrib/altq/altq X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2009 22:05:08 -0000 On Wed, 21 Jan 2009, Jung-uk Kim wrote: > Author: jkim > Date: Wed Jan 21 20:44:42 2009 > New Revision: 187566 > URL: http://svn.freebsd.org/changeset/base/187566 > > Log: > Change __FreeBSD_version to prepare for merging r184102. > > Modified: > head/sys/contrib/altq/altq/altq_subr.c > > Modified: head/sys/contrib/altq/altq/altq_subr.c > ============================================================================== > --- head/sys/contrib/altq/altq/altq_subr.c Wed Jan 21 20:16:11 2009 (r187565) > +++ head/sys/contrib/altq/altq/altq_subr.c Wed Jan 21 20:44:42 2009 (r187566) > @@ -910,7 +910,7 @@ tsc_freq_changed(void *arg, const struct > if (status != 0) > return; > > -#if (__FreeBSD_version >= 800050) && (defined(__amd64__) || defined(__i386__)) > +#if (__FreeBSD_version >= 701102) && (defined(__amd64__) || defined(__i386__)) > /* If TSC is P-state invariant, don't do anything. */ > if (tsc_is_invariant) > return; Doesn't that leave a gap now for 800000 to 800050? -- Bjoern A. Zeeb The greatest risk is not taking one. From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 22:12:05 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 5906A106566C; Wed, 21 Jan 2009 22:12:03 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: "Bjoern A. Zeeb" Date: Wed, 21 Jan 2009 17:11:46 -0500 User-Agent: KMail/1.6.2 References: <200901212044.n0LKig3S090752@svn.freebsd.org> <20090121215905.F45399@maildrop.int.zabbadoz.net> In-Reply-To: <20090121215905.F45399@maildrop.int.zabbadoz.net> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200901211711.54287.jkim@FreeBSD.org> Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r187566 - head/sys/contrib/altq/altq X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2009 22:12:05 -0000 On Wednesday 21 January 2009 05:00 pm, Bjoern A. Zeeb wrote: > On Wed, 21 Jan 2009, Jung-uk Kim wrote: > > Author: jkim > > Date: Wed Jan 21 20:44:42 2009 > > New Revision: 187566 > > URL: http://svn.freebsd.org/changeset/base/187566 > > > > Log: > > Change __FreeBSD_version to prepare for merging r184102. > > > > Modified: > > head/sys/contrib/altq/altq/altq_subr.c > > > > Modified: head/sys/contrib/altq/altq/altq_subr.c > > ================================================================= > >============= --- head/sys/contrib/altq/altq/altq_subr.c Wed Jan > > 21 20:16:11 2009 (r187565) +++ > > head/sys/contrib/altq/altq/altq_subr.c Wed Jan 21 20:44:42 > > 2009 (r187566) @@ -910,7 +910,7 @@ tsc_freq_changed(void *arg, > > const struct if (status != 0) > > return; > > > > -#if (__FreeBSD_version >= 800050) && (defined(__amd64__) || > > defined(__i386__)) +#if (__FreeBSD_version >= 701102) && > > (defined(__amd64__) || defined(__i386__)) /* If TSC is P-state > > invariant, don't do anything. */ > > if (tsc_is_invariant) > > return; > > Doesn't that leave a gap now for 800000 to 800050? Don't we have "-CURRENT has no seat belt" policy? Jung-uk Kim From owner-svn-src-head@FreeBSD.ORG Wed Jan 21 23:10:06 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA368106566B; Wed, 21 Jan 2009 23:10:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A742B8FC1B; Wed, 21 Jan 2009 23:10:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0LNA625093949; Wed, 21 Jan 2009 23:10:06 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0LNA6cM093944; Wed, 21 Jan 2009 23:10:06 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200901212310.n0LNA6cM093944@svn.freebsd.org> From: John Baldwin Date: Wed, 21 Jan 2009 23:10:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187576 - in head/sys/dev: ppbus ppc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2009 23:10:07 -0000 Author: jhb Date: Wed Jan 21 23:10:06 2009 New Revision: 187576 URL: http://svn.freebsd.org/changeset/base/187576 Log: Add locking to ppc and ppbus and mark the whole lot MPSAFE: - To avoid having a bunch of locks that end up always getting acquired as a group, give each ppc(4) device a mutex which it shares with all the child devices including ppbus(4), lpt(4), plip(4), etc. This mutex is then used for all the locking. - Rework the interrupt handling stuff yet again. Now ppbus drivers setup their interrupt handler during attach and tear it down during detach like most other drivers. ppbus(4) only invokes the interrupt handler of the device that currently owns the bus (if any) when an interrupt occurs, however. Also, interrupt handlers in general now accept their softc pointers as their argument rather than the device_t. Another feature of the ppbus interrupt handlers is that they are called with the parent ppc device's lock already held. This minimizes the number of lock operations during an interrupt. - Mark plip(4), lpt(4), pcfclock(4), ppi(4), vpo(4) MPSAFE. - lpbb(4) uses the ppc lock instead of Giant. - Other plip(4) changes: - Add a mutex to protect the global tables in plip(4) and free them on module unload. - Add a detach routine. - Split out the init/stop code from the ioctl routine into separate functions. - Other lpt(4) changes: - Use device_printf(). - Use a dedicated callout for the lptout timer. - Allocate the I/O buffers at attach and detach rather than during open and close as this simplifies the locking at the cost of 1024+32 bytes when the driver is attached. - Other ppi(4) changes: - Use an sx lock to serialize open and close. - Remove unused HADBUS flag. - Add a detach routine. - Use a malloc'd buffer for each read and write to avoid races with concurrent read/write. - Other pps(4) changes: - Use a callout rather than a callout handle with timeout(). - Conform to the new ppbus requirements (regular mutex, non-filter interrupt handler). pps(4) is probably going to have to become a standalone driver that doesn't use ppbus(4) to satisfy it's requirements for low latency as a result. - Use an sx lock to serialize open and close. - Other vpo(4) changes: - Use the parent ppc device's lock to create the CAM sim instead of Giant. - Other ppc(4) changes: - Fix ppc_isa's detach method to detach instead of calling attach. Tested by: no one :-( Modified: head/sys/dev/ppbus/if_plip.c head/sys/dev/ppbus/immio.c head/sys/dev/ppbus/lpbb.c head/sys/dev/ppbus/lpt.c head/sys/dev/ppbus/pcfclock.c head/sys/dev/ppbus/ppb_1284.c head/sys/dev/ppbus/ppb_base.c head/sys/dev/ppbus/ppb_msq.c head/sys/dev/ppbus/ppbconf.c head/sys/dev/ppbus/ppbconf.h head/sys/dev/ppbus/ppi.c head/sys/dev/ppbus/pps.c head/sys/dev/ppbus/vpo.c head/sys/dev/ppbus/vpoio.c head/sys/dev/ppc/ppc.c head/sys/dev/ppc/ppc_acpi.c head/sys/dev/ppc/ppc_isa.c head/sys/dev/ppc/ppc_pci.c head/sys/dev/ppc/ppc_puc.c head/sys/dev/ppc/ppcreg.h head/sys/dev/ppc/ppcvar.h Modified: head/sys/dev/ppbus/if_plip.c ============================================================================== --- head/sys/dev/ppbus/if_plip.c Wed Jan 21 21:48:46 2009 (r187575) +++ head/sys/dev/ppbus/if_plip.c Wed Jan 21 23:10:06 2009 (r187576) @@ -152,8 +152,12 @@ struct lp_data { int sc_iferrs; struct resource *res_irq; + void *sc_intr_cookie; }; +static struct mtx lp_tables_lock; +MTX_SYSINIT(lp_tables, &lp_tables_lock, "plip tables", MTX_DEF); + /* Tables for the lp# interface */ static u_char *txmith; #define txmitl (txmith + (1 * LPIPTBLSIZE)) @@ -170,13 +174,41 @@ static int lpinittables(void); static int lpioctl(struct ifnet *, u_long, caddr_t); static int lpoutput(struct ifnet *, struct mbuf *, struct sockaddr *, struct rtentry *); +static void lpstop(struct lp_data *); static void lp_intr(void *); +static int lp_module_handler(module_t, int, void *); #define DEVTOSOFTC(dev) \ ((struct lp_data *)device_get_softc(dev)) static devclass_t lp_devclass; +static int +lp_module_handler(module_t mod, int what, void *arg) +{ + + switch (what) { + case MOD_UNLOAD: + mtx_lock(&lp_tables_lock); + if (txmith != NULL) { + free(txmith, M_DEVBUF); + txmith = NULL; + } + if (ctxmith != NULL) { + free(ctxmith, M_DEVBUF); + ctxmith = NULL; + } + mtx_unlock(&lp_tables_lock); + break; + case MOD_LOAD: + case MOD_QUIESCE: + break; + default: + return (EOPNOTSUPP); + } + return (0); +} + static void lp_identify(driver_t *driver, device_t parent) { @@ -201,7 +233,7 @@ lp_attach(device_t dev) { struct lp_data *lp = DEVTOSOFTC(dev); struct ifnet *ifp; - int rid = 0; + int error, rid = 0; lp->sc_dev = dev; @@ -224,8 +256,7 @@ lp_attach(device_t dev) ifp->if_softc = lp; if_initname(ifp, device_get_name(dev), device_get_unit(dev)); ifp->if_mtu = LPMTU; - ifp->if_flags = IFF_SIMPLEX | IFF_POINTOPOINT | IFF_MULTICAST | - IFF_NEEDSGIANT; + ifp->if_flags = IFF_SIMPLEX | IFF_POINTOPOINT | IFF_MULTICAST; ifp->if_ioctl = lpioctl; ifp->if_output = lpoutput; ifp->if_hdrlen = 0; @@ -235,8 +266,39 @@ lp_attach(device_t dev) bpfattach(ifp, DLT_NULL, sizeof(u_int32_t)); + /* + * Attach our interrupt handler. It is only called while we + * own the ppbus. + */ + error = bus_setup_intr(dev, lp->res_irq, INTR_TYPE_NET | INTR_MPSAFE, + NULL, lp_intr, lp, &lp->sc_intr_cookie); + if (error) { + bpfdetach(ifp); + if_detach(ifp); + bus_release_resource(dev, SYS_RES_IRQ, 0, lp->res_irq); + device_printf(dev, "Unable to register interrupt handler\n"); + return (error); + } + return (0); } + +static int +lp_detach(device_t dev) +{ + struct lp_data *sc = device_get_softc(dev); + device_t ppbus = device_get_parent(dev); + + ppb_lock(ppbus); + lpstop(sc); + ppb_unlock(ppbus); + bpfdetach(sc->sc_ifp); + if_detach(sc->sc_ifp); + bus_teardown_intr(dev, sc->res_irq, sc->sc_intr_cookie); + bus_release_resource(dev, SYS_RES_IRQ, 0, sc->res_irq); + return (0); +} + /* * Build the translation tables for the LPIP (BSD unix) protocol. * We don't want to calculate these nasties in our tight loop, so we @@ -247,17 +309,22 @@ lpinittables(void) { int i; + mtx_lock(&lp_tables_lock); if (txmith == NULL) txmith = malloc(4 * LPIPTBLSIZE, M_DEVBUF, M_NOWAIT); - if (txmith == NULL) + if (txmith == NULL) { + mtx_unlock(&lp_tables_lock); return (1); + } if (ctxmith == NULL) ctxmith = malloc(4 * LPIPTBLSIZE, M_DEVBUF, M_NOWAIT); - if (ctxmith == NULL) + if (ctxmith == NULL) { + mtx_unlock(&lp_tables_lock); return (1); + } for (i = 0; i < LPIPTBLSIZE; i++) { ctxmith[i] = (i & 0xF0) >> 4; @@ -272,10 +339,61 @@ lpinittables(void) trecvh[i] = ((~i) & 0x80) | ((i & 0x38) << 1); trecvl[i] = (((~i) & 0x80) >> 4) | ((i & 0x38) >> 3); } + mtx_unlock(&lp_tables_lock); return (0); } +static void +lpstop(struct lp_data *sc) +{ + device_t ppbus = device_get_parent(sc->sc_dev); + + ppb_assert_locked(ppbus); + ppb_wctr(ppbus, 0x00); + sc->sc_ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); + free(sc->sc_ifbuf, M_DEVBUF); + sc->sc_ifbuf = NULL; + + /* IFF_UP is not set, try to release the bus anyway */ + ppb_release_bus(ppbus, sc->sc_dev); +} + +static int +lpinit_locked(struct ifnet *ifp) +{ + struct lp_data *sc = ifp->if_softc; + device_t dev = sc->sc_dev; + device_t ppbus = device_get_parent(dev); + int error; + + ppb_assert_locked(ppbus); + error = ppb_request_bus(ppbus, dev, PPB_DONTWAIT); + if (error) + return (error); + + /* Now IFF_UP means that we own the bus */ + ppb_set_mode(ppbus, PPB_COMPATIBLE); + + if (lpinittables()) { + ppb_release_bus(ppbus, dev); + return (ENOBUFS); + } + + sc->sc_ifbuf = malloc(sc->sc_ifp->if_mtu + MLPIPHDRLEN, + M_DEVBUF, M_NOWAIT); + if (sc->sc_ifbuf == NULL) { + ppb_release_bus(ppbus, dev); + return (ENOBUFS); + } + + ppb_wctr(ppbus, IRQENABLE); + + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + return (0); +} + /* * Process an ioctl request. */ @@ -288,7 +406,6 @@ lpioctl(struct ifnet *ifp, u_long cmd, c struct ifaddr *ifa = (struct ifaddr *)data; struct ifreq *ifr = (struct ifreq *)data; u_char *ptr; - void *ih; int error; switch (cmd) { @@ -301,67 +418,32 @@ lpioctl(struct ifnet *ifp, u_long cmd, c ifp->if_flags |= IFF_UP; /* FALLTHROUGH */ case SIOCSIFFLAGS: + error = 0; + ppb_lock(ppbus); if ((!(ifp->if_flags & IFF_UP)) && - (ifp->if_drv_flags & IFF_DRV_RUNNING)) { - - ppb_wctr(ppbus, 0x00); - ifp->if_drv_flags &= ~IFF_DRV_RUNNING; - - /* IFF_UP is not set, try to release the bus anyway */ - ppb_release_bus(ppbus, dev); - break; - } - if (((ifp->if_flags & IFF_UP)) && - (!(ifp->if_drv_flags & IFF_DRV_RUNNING))) { - - /* XXX - * Should the request be interruptible? - */ - if ((error = ppb_request_bus(ppbus, dev, PPB_WAIT | - PPB_INTR))) - return (error); + (ifp->if_drv_flags & IFF_DRV_RUNNING)) + lpstop(sc); + else if (((ifp->if_flags & IFF_UP)) && + (!(ifp->if_drv_flags & IFF_DRV_RUNNING))) + error = lpinit_locked(ifp); + ppb_unlock(ppbus); + return (error); - /* Now IFF_UP means that we own the bus */ - ppb_set_mode(ppbus, PPB_COMPATIBLE); - - if (lpinittables()) { - ppb_release_bus(ppbus, dev); - return (ENOBUFS); - } - - sc->sc_ifbuf = malloc(sc->sc_ifp->if_mtu + MLPIPHDRLEN, - M_DEVBUF, M_WAITOK); - if (sc->sc_ifbuf == NULL) { - ppb_release_bus(ppbus, dev); + case SIOCSIFMTU: + ppb_lock(ppbus); + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + ptr = malloc(ifr->ifr_mtu + MLPIPHDRLEN, M_DEVBUF, + M_NOWAIT); + if (ptr == NULL) { + ppb_unlock(ppbus); return (ENOBUFS); } - - /* - * Attach our interrupt handler. It is - * detached later when the bus is released. - */ - if ((error = bus_setup_intr(dev, sc->res_irq, - INTR_TYPE_NET, NULL, lp_intr, dev, &ih))) { - ppb_release_bus(ppbus, dev); - return (error); - } - - ppb_wctr(ppbus, IRQENABLE); - ifp->if_drv_flags |= IFF_DRV_RUNNING; - } - break; - - case SIOCSIFMTU: - ptr = sc->sc_ifbuf; - sc->sc_ifbuf = malloc(ifr->ifr_mtu + MLPIPHDRLEN, M_DEVBUF, - M_NOWAIT); - if (sc->sc_ifbuf == NULL) { + if (sc->sc_ifbuf) + free(sc->sc_ifbuf, M_DEVBUF); sc->sc_ifbuf = ptr; - return (ENOBUFS); } - if (ptr) - free(ptr, M_DEVBUF); sc->sc_ifp->if_mtu = ifr->ifr_mtu; + ppb_unlock(ppbus); break; case SIOCGIFMTU: @@ -417,14 +499,14 @@ clpinbyte(int spin, device_t ppbus) { u_char c, cl; - while((ppb_rstr(ppbus) & CLPIP_SHAKE)) + while ((ppb_rstr(ppbus) & CLPIP_SHAKE)) if (!--spin) { return (-1); } cl = ppb_rstr(ppbus); ppb_wdtr(ppbus, 0x10); - while(!(ppb_rstr(ppbus) & CLPIP_SHAKE)) + while (!(ppb_rstr(ppbus) & CLPIP_SHAKE)) if (!--spin) { return (-1); } @@ -445,16 +527,14 @@ lptap(struct ifnet *ifp, struct mbuf *m) static void lp_intr(void *arg) { - device_t dev = (device_t)arg; - device_t ppbus = device_get_parent(dev); - struct lp_data *sc = DEVTOSOFTC(dev); - int len, s, j; + struct lp_data *sc = arg; + device_t ppbus = device_get_parent(sc->sc_dev); + int len, j; u_char *bp; u_char c, cl; struct mbuf *top; - s = splhigh(); - + ppb_assert_locked(ppbus); if (sc->sc_ifp->if_flags & IFF_LINK0) { /* Ack. the request */ @@ -500,13 +580,15 @@ lp_intr(void *arg) top = m_devget(sc->sc_ifbuf + CLPIPHDRLEN, len, 0, sc->sc_ifp, 0); if (top) { + ppb_unlock(ppbus); if (bpf_peers_present(sc->sc_ifp->if_bpf)) lptap(sc->sc_ifp, top); /* mbuf is free'd on failure. */ netisr_queue(NETISR_IP, top); + ppb_lock(ppbus); } - goto done; + return; } while ((ppb_rstr(ppbus) & LPIP_SHAKE)) { len = sc->sc_ifp->if_mtu + LPIPHDRLEN; @@ -517,7 +599,7 @@ lp_intr(void *arg) ppb_wdtr(ppbus, 8); j = LPMAXSPIN2; - while((ppb_rstr(ppbus) & LPIP_SHAKE)) + while ((ppb_rstr(ppbus) & LPIP_SHAKE)) if (!--j) goto err; @@ -550,14 +632,16 @@ lp_intr(void *arg) top = m_devget(sc->sc_ifbuf + LPIPHDRLEN, len, 0, sc->sc_ifp, 0); if (top) { + ppb_unlock(ppbus); if (bpf_peers_present(sc->sc_ifp->if_bpf)) lptap(sc->sc_ifp, top); /* mbuf is free'd on failure. */ netisr_queue(NETISR_IP, top); + ppb_lock(ppbus); } } - goto done; + return; err: ppb_wdtr(ppbus, 0); @@ -575,9 +659,6 @@ err: sc->sc_ifp->if_drv_flags &= ~IFF_DRV_RUNNING; sc->sc_iferrs = 0; } - -done: - splx(s); } static __inline int @@ -602,7 +683,7 @@ lpoutput(struct ifnet *ifp, struct mbuf struct lp_data *sc = ifp->if_softc; device_t dev = sc->sc_dev; device_t ppbus = device_get_parent(dev); - int s, err; + int err; struct mbuf *mm; u_char *cp = "\0\0"; u_char chksum = 0; @@ -611,19 +692,18 @@ lpoutput(struct ifnet *ifp, struct mbuf /* We need a sensible value if we abort */ cp++; - ifp->if_drv_flags |= IFF_DRV_RUNNING; + ppb_lock(ppbus); + ifp->if_drv_flags |= IFF_DRV_OACTIVE; err = 1; /* assume we're aborting because of an error */ - s = splhigh(); - /* Suspend (on laptops) or receive-errors might have taken us offline */ ppb_wctr(ppbus, IRQENABLE); if (ifp->if_flags & IFF_LINK0) { if (!(ppb_rstr(ppbus) & CLPIP_SHAKE)) { lprintf("&"); - lp_intr(dev); + lp_intr(sc); } /* Alert other end to pending packet */ @@ -681,6 +761,7 @@ lpoutput(struct ifnet *ifp, struct mbuf err = 0; /* No errors */ nend: + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; if (err) { /* if we didn't timeout... */ ifp->if_oerrors++; lprintf("X"); @@ -695,15 +776,15 @@ lpoutput(struct ifnet *ifp, struct mbuf if (!(ppb_rstr(ppbus) & CLPIP_SHAKE)) { lprintf("^"); - lp_intr(dev); + lp_intr(sc); } - (void) splx(s); + ppb_unlock(ppbus); return (0); } if (ppb_rstr(ppbus) & LPIP_SHAKE) { lprintf("&"); - lp_intr(dev); + lp_intr(sc); } if (lpoutbyte(0x08, LPMAXSPIN1, ppbus)) @@ -726,6 +807,7 @@ end: --cp; ppb_wdtr(ppbus, txmitl[*cp] ^ 0x17); + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; if (err) { /* if we didn't timeout... */ ifp->if_oerrors++; lprintf("X"); @@ -740,10 +822,10 @@ end: if (ppb_rstr(ppbus) & LPIP_SHAKE) { lprintf("^"); - lp_intr(dev); + lp_intr(sc); } - (void) splx(s); + ppb_unlock(ppbus); return (0); } @@ -752,6 +834,7 @@ static device_method_t lp_methods[] = { DEVMETHOD(device_identify, lp_identify), DEVMETHOD(device_probe, lp_probe), DEVMETHOD(device_attach, lp_attach), + DEVMETHOD(device_detach, lp_detach), { 0, 0 } }; @@ -762,5 +845,5 @@ static driver_t lp_driver = { sizeof(struct lp_data), }; -DRIVER_MODULE(plip, ppbus, lp_driver, lp_devclass, 0, 0); +DRIVER_MODULE(plip, ppbus, lp_driver, lp_devclass, lp_module_handler, 0); MODULE_DEPEND(plip, ppbus, 1, 1, 1); Modified: head/sys/dev/ppbus/immio.c ============================================================================== --- head/sys/dev/ppbus/immio.c Wed Jan 21 21:48:46 2009 (r187575) +++ head/sys/dev/ppbus/immio.c Wed Jan 21 23:10:06 2009 (r187576) @@ -606,6 +606,7 @@ imm_attach(struct vpoio_data *vpo) /* * Initialize mode dependent in/out microsequences */ + ppb_lock(ppbus); if ((error = ppb_request_bus(ppbus, vpo->vpo_dev, PPB_WAIT))) goto error; @@ -632,6 +633,7 @@ imm_attach(struct vpoio_data *vpo) ppb_release_bus(ppbus, vpo->vpo_dev); error: + ppb_unlock(ppbus); return (error); } Modified: head/sys/dev/ppbus/lpbb.c ============================================================================== --- head/sys/dev/ppbus/lpbb.c Wed Jan 21 21:48:46 2009 (r187575) +++ head/sys/dev/ppbus/lpbb.c Wed Jan 21 23:10:06 2009 (r187576) @@ -103,16 +103,16 @@ lpbb_callback(device_t dev, int index, c case IIC_REQUEST_BUS: /* request the ppbus */ how = *(int *)data; - mtx_lock(&Giant); + ppb_lock(ppbus); error = ppb_request_bus(ppbus, dev, how); - mtx_unlock(&Giant); + ppb_unlock(ppbus); break; case IIC_RELEASE_BUS: /* release the ppbus */ - mtx_lock(&Giant); + ppb_lock(ppbus); error = ppb_release_bus(ppbus, dev); - mtx_unlock(&Giant); + ppb_unlock(ppbus); break; default: @@ -129,25 +129,38 @@ lpbb_callback(device_t dev, int index, c #define ALIM 0x20 #define I2CKEY 0x50 +/* Reset bus by setting SDA first and then SCL. */ +static void +lpbb_reset_bus(device_t dev) +{ + device_t ppbus = device_get_parent(dev); + + ppb_assert_locked(ppbus); + ppb_wdtr(ppbus, (u_char)~SDA_out); + ppb_wctr(ppbus, (u_char)(ppb_rctr(ppbus) | SCL_out)); +} + static int lpbb_getscl(device_t dev) { + device_t ppbus = device_get_parent(dev); int rval; - mtx_lock(&Giant); - rval = ((ppb_rstr(device_get_parent(dev)) & SCL_in) == SCL_in); - mtx_unlock(&Giant); + ppb_lock(ppbus); + rval = ((ppb_rstr(ppbus) & SCL_in) == SCL_in); + ppb_unlock(ppbus); return (rval); } static int lpbb_getsda(device_t dev) { + device_t ppbus = device_get_parent(dev); int rval; - mtx_lock(&Giant); - rval = ((ppb_rstr(device_get_parent(dev)) & SDA_in) == SDA_in); - mtx_unlock(&Giant); + ppb_lock(ppbus); + rval = ((ppb_rstr(ppbus) & SDA_in) == SDA_in); + ppb_unlock(ppbus); return (rval); } @@ -156,12 +169,12 @@ lpbb_setsda(device_t dev, char val) { device_t ppbus = device_get_parent(dev); - mtx_lock(&Giant); + ppb_lock(ppbus); if (val == 0) ppb_wdtr(ppbus, (u_char)SDA_out); else ppb_wdtr(ppbus, (u_char)~SDA_out); - mtx_unlock(&Giant); + ppb_unlock(ppbus); } static void @@ -169,12 +182,12 @@ lpbb_setscl(device_t dev, unsigned char { device_t ppbus = device_get_parent(dev); - mtx_lock(&Giant); + ppb_lock(ppbus); if (val == 0) ppb_wctr(ppbus, (u_char)(ppb_rctr(ppbus) & ~SCL_out)); else ppb_wctr(ppbus, (u_char)(ppb_rctr(ppbus) | SCL_out)); - mtx_unlock(&Giant); + ppb_unlock(ppbus); } static int @@ -182,23 +195,24 @@ lpbb_detect(device_t dev) { device_t ppbus = device_get_parent(dev); + ppb_lock(ppbus); if (ppb_request_bus(ppbus, dev, PPB_DONTWAIT)) { + ppb_unlock(ppbus); device_printf(dev, "can't allocate ppbus\n"); return (0); } - /* reset bus */ - lpbb_setsda(dev, 1); - lpbb_setscl(dev, 1); + lpbb_reset_bus(dev); if ((ppb_rstr(ppbus) & I2CKEY) || ((ppb_rstr(ppbus) & ALIM) != ALIM)) { - ppb_release_bus(ppbus, dev); + ppb_unlock(ppbus); return (0); } ppb_release_bus(ppbus, dev); + ppb_unlock(ppbus); return (1); } @@ -208,18 +222,17 @@ lpbb_reset(device_t dev, u_char speed, u { device_t ppbus = device_get_parent(dev); - mtx_lock(&Giant); + ppb_lock(ppbus); if (ppb_request_bus(ppbus, dev, PPB_DONTWAIT)) { + ppb_unlock(ppbus); device_printf(dev, "can't allocate ppbus\n"); return (0); } - /* reset bus */ - lpbb_setsda(dev, 1); - lpbb_setscl(dev, 1); + lpbb_reset_bus(dev); ppb_release_bus(ppbus, dev); - mtx_unlock(&Giant); + ppb_unlock(ppbus); return (IIC_ENOADDR); } Modified: head/sys/dev/ppbus/lpt.c ============================================================================== --- head/sys/dev/ppbus/lpt.c Wed Jan 21 21:48:46 2009 (r187575) +++ head/sys/dev/ppbus/lpt.c Wed Jan 21 23:10:06 2009 (r187576) @@ -105,9 +105,9 @@ static int volatile lptflag = 1; #define BUFSTATSIZE 32 struct lpt_data { - device_t dev; - struct cdev *cdev; - struct cdev *cdev_bypass; + device_t sc_dev; + struct cdev *sc_cdev; + struct cdev *sc_cdev_bypass; short sc_state; /* default case: negative prime, negative ack, handshake strobe, prime once */ @@ -130,9 +130,10 @@ struct lpt_data { #define LP_ENABLE_IRQ 0x04 /* enable IRQ on open */ #define LP_ENABLE_EXT 0x10 /* we shall use advanced mode when possible */ u_char sc_backoff ; /* time to call lptout() again */ + struct callout sc_timer; - struct resource *intr_resource; /* interrupt resource */ - void *intr_cookie; /* interrupt registration cookie */ + struct resource *sc_intr_resource; /* interrupt resource */ + void *sc_intr_cookie; /* interrupt cookie */ }; #define LPT_NAME "lpt" /* our official name */ @@ -144,8 +145,7 @@ static int lpt_detect(device_t dev); #define DEVTOSOFTC(dev) \ ((struct lpt_data *)device_get_softc(dev)) -static void lptintr(device_t dev); -static void lpt_intr(void *arg); /* without spls */ +static void lptintr(void *arg); static devclass_t lpt_devclass; @@ -183,7 +183,6 @@ static d_ioctl_t lptioctl; static struct cdevsw lpt_cdevsw = { .d_version = D_VERSION, - .d_flags = D_NEEDGIANT, .d_open = lptopen, .d_close = lptclose, .d_read = lptread, @@ -199,13 +198,17 @@ lpt_request_ppbus(device_t dev, int how) struct lpt_data *sc = DEVTOSOFTC(dev); int error; + /* + * We might already have the bus for a write(2) after an interrupted + * write(2) call. + */ + ppb_assert_locked(ppbus); if (sc->sc_state & HAVEBUS) return (0); - /* we have the bus only if the request succeded */ - if ((error = ppb_request_bus(ppbus, dev, how)) == 0) + error = ppb_request_bus(ppbus, dev, how); + if (error == 0) sc->sc_state |= HAVEBUS; - return (error); } @@ -216,9 +219,12 @@ lpt_release_ppbus(device_t dev) struct lpt_data *sc = DEVTOSOFTC(dev); int error = 0; - if ((error = ppb_release_bus(ppbus, dev)) == 0) - sc->sc_state &= ~HAVEBUS; - + ppb_assert_locked(ppbus); + if (sc->sc_state & HAVEBUS) { + error = ppb_release_bus(ppbus, dev); + if (error == 0) + sc->sc_state &= ~HAVEBUS; + } return (error); } @@ -306,24 +312,25 @@ lpt_detect(device_t dev) status = 1; /* assume success */ + ppb_lock(ppbus); if ((error = lpt_request_ppbus(dev, PPB_DONTWAIT))) { - printf(LPT_NAME ": cannot alloc ppbus (%d)!\n", error); - status = 0; - goto end_probe; + ppb_unlock(ppbus); + device_printf(dev, "cannot alloc ppbus (%d)!\n", error); + return (0); } for (i = 0; i < 18 && status; i++) if (!lpt_port_test(ppbus, testbyte[i], 0xff)) { status = 0; - goto end_probe; + break; } -end_probe: /* write 0's to control and data ports */ ppb_wdtr(ppbus, 0); ppb_wctr(ppbus, 0); lpt_release_ppbus(dev); + ppb_unlock(ppbus); return (status); } @@ -363,21 +370,33 @@ lpt_attach(device_t dev) int error; sc->sc_primed = 0; /* not primed yet */ + ppb_init_callout(ppbus, &sc->sc_timer, 0); + ppb_lock(ppbus); if ((error = lpt_request_ppbus(dev, PPB_DONTWAIT))) { - printf(LPT_NAME ": cannot alloc ppbus (%d)!\n", error); + ppb_unlock(ppbus); + device_printf(dev, "cannot alloc ppbus (%d)!\n", error); return (0); } ppb_wctr(ppbus, LPC_NINIT); - - /* check if we can use interrupt, should be done by ppc stuff */ - lprintf(("oldirq %x\n", sc->sc_irq)); + ppb_unlock(ppbus); + lpt_release_ppbus(dev); /* declare our interrupt handler */ - sc->intr_resource = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + sc->sc_intr_resource = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE); - if (sc->intr_resource) { + if (sc->sc_intr_resource) { + error = bus_setup_intr(dev, sc->sc_intr_resource, + INTR_TYPE_TTY | INTR_MPSAFE, NULL, lptintr, sc, + &sc->sc_intr_cookie); + if (error) { + bus_release_resource(dev, SYS_RES_IRQ, rid, + sc->sc_intr_resource); + device_printf(dev, + "Unable to register interrupt handler\n"); + return (error); + } sc->sc_irq = LP_HAS_IRQ | LP_USE_IRQ | LP_ENABLE_IRQ; device_printf(dev, "Interrupt-driven port\n"); } else { @@ -386,17 +405,17 @@ lpt_attach(device_t dev) } lprintf(("irq %x\n", sc->sc_irq)); - lpt_release_ppbus(dev); - - sc->dev = dev; - sc->cdev = make_dev(&lpt_cdevsw, unit, + sc->sc_inbuf = malloc(BUFSIZE, M_DEVBUF, M_WAITOK); + sc->sc_statbuf = malloc(BUFSTATSIZE, M_DEVBUF, M_WAITOK); + sc->sc_dev = dev; + sc->sc_cdev = make_dev(&lpt_cdevsw, unit, UID_ROOT, GID_WHEEL, 0600, LPT_NAME "%d", unit); - sc->cdev->si_drv1 = sc; - sc->cdev->si_drv2 = 0; - sc->cdev_bypass = make_dev(&lpt_cdevsw, unit, + sc->sc_cdev->si_drv1 = sc; + sc->sc_cdev->si_drv2 = 0; + sc->sc_cdev_bypass = make_dev(&lpt_cdevsw, unit, UID_ROOT, GID_WHEEL, 0600, LPT_NAME "%d.ctl", unit); - sc->cdev_bypass->si_drv1 = sc; - sc->cdev_bypass->si_drv2 = (void *)LP_BYPASS; + sc->sc_cdev_bypass->si_drv1 = sc; + sc->sc_cdev_bypass->si_drv2 = (void *)LP_BYPASS; return (0); } @@ -404,15 +423,21 @@ static int lpt_detach(device_t dev) { struct lpt_data *sc = DEVTOSOFTC(dev); + device_t ppbus = device_get_parent(dev); - destroy_dev(sc->cdev); - destroy_dev(sc->cdev_bypass); + destroy_dev(sc->sc_cdev); + destroy_dev(sc->sc_cdev_bypass); + ppb_lock(ppbus); lpt_release_ppbus(dev); - if (sc->intr_resource != 0) { - BUS_TEARDOWN_INTR(device_get_parent(dev), dev, - sc->intr_resource, sc->intr_cookie); - bus_release_resource(dev, SYS_RES_IRQ, 0, sc->intr_resource); + ppb_unlock(ppbus); + callout_drain(&sc->sc_timer); + if (sc->sc_intr_resource != NULL) { + bus_teardown_intr(dev, sc->sc_intr_resource, + sc->sc_intr_cookie); + bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sc_intr_resource); } + free(sc->sc_inbuf, M_DEVBUF); + free(sc->sc_statbuf, M_DEVBUF); return (0); } @@ -420,18 +445,17 @@ lpt_detach(device_t dev) static void lptout(void *arg) { - device_t dev = (device_t)arg; - struct lpt_data *sc = DEVTOSOFTC(dev); -#ifdef LPT_DEBUG + struct lpt_data *sc = arg; + device_t dev = sc->sc_dev; device_t ppbus = device_get_parent(dev); -#endif + ppb_assert_locked(ppbus); lprintf(("T %x ", ppb_rstr(ppbus))); if (sc->sc_state & OPEN) { sc->sc_backoff++; if (sc->sc_backoff > hz/LPTOUTMAX) sc->sc_backoff = sc->sc_backoff > hz/LPTOUTMAX; - timeout(lptout, (caddr_t)dev, sc->sc_backoff); + callout_reset(&sc->sc_timer, sc->sc_backoff, lptout, sc); } else sc->sc_state &= ~TOUT; @@ -442,7 +466,7 @@ lptout(void *arg) * Avoid possible hangs due to missed interrupts */ if (sc->sc_xfercnt) { - lptintr(dev); + lptintr(sc); } else { sc->sc_state &= ~OBUSY; wakeup(dev); @@ -458,17 +482,19 @@ lptout(void *arg) static int lptopen(struct cdev *dev, int flags, int fmt, struct thread *td) { - int s; int trys, err; struct lpt_data *sc = dev->si_drv1; - device_t lptdev = sc->dev; + device_t lptdev = sc->sc_dev; device_t ppbus = device_get_parent(lptdev); if (!sc) return (ENXIO); + ppb_lock(ppbus); if (sc->sc_state) { - lprintf((LPT_NAME ": still open %x\n", sc->sc_state)); + lprintf(("%s: still open %x\n", device_get_nameunit(lptdev), + sc->sc_state)); + ppb_unlock(ppbus); return(EBUSY); } else sc->sc_state |= LPTINIT; @@ -478,6 +504,7 @@ lptopen(struct cdev *dev, int flags, int /* Check for open with BYPASS flag set. */ if (sc->sc_flags & LP_BYPASS) { sc->sc_state = OPEN; + ppb_unlock(ppbus); return(0); } @@ -485,11 +512,12 @@ lptopen(struct cdev *dev, int flags, int if ((err = lpt_request_ppbus(lptdev, PPB_WAIT|PPB_INTR)) != 0) { /* give it a chance to try later */ sc->sc_state = 0; + ppb_unlock(ppbus); return (err); } - s = spltty(); - lprintf((LPT_NAME " flags 0x%x\n", sc->sc_flags)); + lprintf(("%s flags 0x%x\n", device_get_nameunit(lptdev), + sc->sc_flags)); /* set IRQ status according to ENABLE_IRQ flag */ @@ -514,21 +542,21 @@ lptopen(struct cdev *dev, int flags, int do { /* ran out of waiting for the printer */ if (trys++ >= LPINITRDY*4) { - splx(s); sc->sc_state = 0; lprintf(("status %x\n", ppb_rstr(ppbus))); lpt_release_ppbus(lptdev); + ppb_unlock(ppbus); return (EBUSY); } /* wait 1/4 second, give up if we get a signal */ - if (tsleep(lptdev, LPPRI|PCATCH, "lptinit", hz/4) != - EWOULDBLOCK) { + if (ppb_sleep(ppbus, lptdev, LPPRI | PCATCH, "lptinit", + hz / 4) != EWOULDBLOCK) { sc->sc_state = 0; - splx(s); lpt_release_ppbus(lptdev); + ppb_unlock(ppbus); return (EBUSY); } @@ -548,22 +576,20 @@ lptopen(struct cdev *dev, int flags, int ppb_wctr(ppbus, sc->sc_control); sc->sc_state = OPEN; - sc->sc_inbuf = malloc(BUFSIZE, M_DEVBUF, M_WAITOK); - sc->sc_statbuf = malloc(BUFSTATSIZE, M_DEVBUF, M_WAITOK); sc->sc_xfercnt = 0; - splx(s); - - /* release the ppbus */ - lpt_release_ppbus(lptdev); /* only use timeout if using interrupt */ lprintf(("irq %x\n", sc->sc_irq)); if (sc->sc_irq & LP_USE_IRQ) { sc->sc_state |= TOUT; - timeout(lptout, (caddr_t)lptdev, - (sc->sc_backoff = hz/LPTOUTINITIAL)); + sc->sc_backoff = hz / LPTOUTINITIAL; + callout_reset(&sc->sc_timer, sc->sc_backoff, lptout, sc); } + /* release the ppbus */ + lpt_release_ppbus(lptdev); + ppb_unlock(ppbus); + lprintf(("opened.\n")); return(0); } @@ -578,17 +604,21 @@ static int lptclose(struct cdev *dev, int flags, int fmt, struct thread *td) { struct lpt_data *sc = dev->si_drv1; - device_t lptdev = sc->dev; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Thu Jan 22 05:05:57 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0CEC6106564A; Thu, 22 Jan 2009 05:05:57 +0000 (UTC) (envelope-from takawata@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EFB318FC16; Thu, 22 Jan 2009 05:05:56 +0000 (UTC) (envelope-from takawata@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0M55uOC001379; Thu, 22 Jan 2009 05:05:56 GMT (envelope-from takawata@svn.freebsd.org) Received: (from takawata@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0M55uoP001378; Thu, 22 Jan 2009 05:05:56 GMT (envelope-from takawata@svn.freebsd.org) Message-Id: <200901220505.n0M55uoP001378@svn.freebsd.org> From: Takanori Watanabe Date: Thu, 22 Jan 2009 05:05:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187579 - head/sys/dev/usb2/serial X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2009 05:05:57 -0000 Author: takawata Date: Thu Jan 22 05:05:56 2009 New Revision: 187579 URL: http://svn.freebsd.org/changeset/base/187579 Log: Rename sc_is_pseudo to sc_nobulk member in ufoma_softc. That was pseudo ucom because it used home brew tty interface. Now, it is integrated to usb serial framework, so it is not pseudo ucom any more. Modified: head/sys/dev/usb2/serial/ufoma2.c Modified: head/sys/dev/usb2/serial/ufoma2.c ============================================================================== --- head/sys/dev/usb2/serial/ufoma2.c Thu Jan 22 04:24:15 2009 (r187578) +++ head/sys/dev/usb2/serial/ufoma2.c Thu Jan 22 05:05:56 2009 (r187579) @@ -175,7 +175,7 @@ struct ufoma_softc { uint16_t sc_line; uint8_t sc_num_msg; - uint8_t sc_is_pseudo; + uint8_t sc_nobulk; uint8_t sc_ctrl_iface_no; uint8_t sc_ctrl_iface_index; uint8_t sc_data_iface_no; @@ -449,9 +449,9 @@ ufoma_attach(device_t dev) } if ((mad->bType == UMCPC_ACM_TYPE_AB5) || (mad->bType == UMCPC_ACM_TYPE_AB6)) { - sc->sc_is_pseudo = 1; + sc->sc_nobulk = 1; } else { - sc->sc_is_pseudo = 0; + sc->sc_nobulk = 0; if (ufoma_modem_setup(dev, sc, uaa)) { goto detach; } @@ -764,7 +764,7 @@ ufoma_intr_callback(struct usb2_xfer *xf } switch (pkt.bNotification) { case UCDC_N_RESPONSE_AVAILABLE: - if (!(sc->sc_is_pseudo)) { + if (!(sc->sc_nobulk)) { DPRINTF("Wrong serial state!\n"); break; } @@ -775,7 +775,7 @@ ufoma_intr_callback(struct usb2_xfer *xf break; case UCDC_N_SERIAL_STATE: - if (sc->sc_is_pseudo) { + if (sc->sc_nobulk) { DPRINTF("Wrong serial state!\n"); break; } @@ -952,7 +952,7 @@ ufoma_cfg_set_break(struct usb2_com_soft struct usb2_device_request req; uint16_t wValue; - if (sc->sc_is_pseudo || + if (sc->sc_nobulk || (sc->sc_currentmode == UMCPC_ACM_MODE_OBEX)) { return; } @@ -1004,7 +1004,7 @@ ufoma_cfg_set_dtr(struct usb2_com_softc { struct ufoma_softc *sc = ucom->sc_parent; - if (sc->sc_is_pseudo) { + if (sc->sc_nobulk) { return; } if (onoff) @@ -1020,7 +1020,7 @@ ufoma_cfg_set_rts(struct usb2_com_softc { struct ufoma_softc *sc = ucom->sc_parent; - if (sc->sc_is_pseudo) { + if (sc->sc_nobulk) { return; } if (onoff) @@ -1044,7 +1044,7 @@ ufoma_cfg_param(struct usb2_com_softc *u struct usb2_device_request req; struct usb2_cdc_line_state ls; - if (sc->sc_is_pseudo || + if (sc->sc_nobulk || (sc->sc_currentmode == UMCPC_ACM_MODE_OBEX)) { return; } @@ -1175,7 +1175,7 @@ ufoma_start_read(struct usb2_com_softc * usb2_transfer_start(sc->sc_ctrl_xfer[UFOMA_CTRL_ENDPT_INTR]); /* start data transfer */ - if (sc->sc_is_pseudo) { + if (sc->sc_nobulk) { usb2_transfer_start(sc->sc_ctrl_xfer[UFOMA_CTRL_ENDPT_READ]); } else { usb2_transfer_start(sc->sc_bulk_xfer[UFOMA_BULK_ENDPT_READ]); @@ -1192,7 +1192,7 @@ ufoma_stop_read(struct usb2_com_softc *u usb2_transfer_stop(sc->sc_ctrl_xfer[UFOMA_CTRL_ENDPT_INTR_CLEAR]); /* stop data transfer */ - if (sc->sc_is_pseudo) { + if (sc->sc_nobulk) { usb2_transfer_stop(sc->sc_ctrl_xfer[UFOMA_CTRL_ENDPT_READ]); } else { usb2_transfer_stop(sc->sc_bulk_xfer[UFOMA_BULK_ENDPT_READ_CLEAR]); @@ -1205,7 +1205,7 @@ ufoma_start_write(struct usb2_com_softc { struct ufoma_softc *sc = ucom->sc_parent; - if (sc->sc_is_pseudo) { + if (sc->sc_nobulk) { usb2_transfer_start(sc->sc_ctrl_xfer[UFOMA_CTRL_ENDPT_WRITE]); } else { usb2_transfer_start(sc->sc_bulk_xfer[UFOMA_BULK_ENDPT_WRITE]); @@ -1217,7 +1217,7 @@ ufoma_stop_write(struct usb2_com_softc * { struct ufoma_softc *sc = ucom->sc_parent; - if (sc->sc_is_pseudo) { + if (sc->sc_nobulk) { usb2_transfer_stop(sc->sc_ctrl_xfer[UFOMA_CTRL_ENDPT_WRITE]); } else { usb2_transfer_stop(sc->sc_bulk_xfer[UFOMA_BULK_ENDPT_WRITE_CLEAR]); From owner-svn-src-head@FreeBSD.ORG Thu Jan 22 06:21:30 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8FF471065686; Thu, 22 Jan 2009 06:21:30 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7E7A48FC17; Thu, 22 Jan 2009 06:21:30 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0M6LUau002746; Thu, 22 Jan 2009 06:21:30 GMT (envelope-from jeff@svn.freebsd.org) Received: (from jeff@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0M6LU5v002745; Thu, 22 Jan 2009 06:21:30 GMT (envelope-from jeff@svn.freebsd.org) Message-Id: <200901220621.n0M6LU5v002745@svn.freebsd.org> From: Jeff Roberson Date: Thu, 22 Jan 2009 06:21:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187580 - head/tools/sched X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2009 06:21:31 -0000 Author: jeff Date: Thu Jan 22 06:21:30 2009 New Revision: 187580 URL: http://svn.freebsd.org/changeset/base/187580 Log: - Update my copyright. - Print human readable time as a float with two digits of precision. Use ns now as well since clock periods are well into the hundreds of picoseconds now. - Show the average duration in the stats frame. This is often more useful than total duration. Modified: head/tools/sched/schedgraph.py Modified: head/tools/sched/schedgraph.py ============================================================================== --- head/tools/sched/schedgraph.py Thu Jan 22 05:05:56 2009 (r187579) +++ head/tools/sched/schedgraph.py Thu Jan 22 06:21:30 2009 (r187580) @@ -1,6 +1,6 @@ #!/usr/local/bin/python -# Copyright (c) 2002-2003, Jeffrey Roberson +# Copyright (c) 2002-2003, 2009, Jeffrey Roberson # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -149,15 +149,19 @@ class Colormap: return (color) def ticks2sec(ticks): - us = ticksps / 1000000 - ticks /= us + ticks = float(ticks) + ns = float(ticksps) / 1000000000 + ticks /= ns if (ticks < 1000): - return (str(ticks) + "us") + return ("%.2fns" % ticks) ticks /= 1000 if (ticks < 1000): - return (str(ticks) + "ms") + return ("%.2fus" % ticks) ticks /= 1000 - return (str(ticks) + "s") + if (ticks < 1000): + return ("%.2fms" % ticks) + ticks /= 1000 + return ("%.2fs" % ticks) class Scaler(Frame): def __init__(self, master, target): @@ -443,7 +447,7 @@ class SourceStats(Toplevel): self.resizable(0, 0) self.title(source.name + " statistics") self.evframe = LabelFrame(self, - text="Event Frequency and Duration") + text="Event Count, Duration, Avg Duration") self.evframe.grid(row=0, column=0, sticky=E+W) eventtypes={} for event in self.source.events: @@ -466,15 +470,22 @@ class SourceStats(Toplevel): ypos = 0 for event in events: (name, c, d) = event - l = Label(self.evframe, text=name, bd=1, - relief=SUNKEN, anchor=W, width=30) - m = Label(self.evframe, text=str(c), bd=1, - relief=SUNKEN, anchor=W, width=10) - r = Label(self.evframe, text=ticks2sec(d), - bd=1, relief=SUNKEN, width=10) - l.grid(row=ypos, column=0, sticky=E+W) - m.grid(row=ypos, column=1, sticky=E+W) - r.grid(row=ypos, column=2, sticky=E+W) + Label(self.evframe, text=name, bd=1, + relief=SUNKEN, anchor=W, width=30).grid( + row=ypos, column=0, sticky=W+E) + Label(self.evframe, text=str(c), bd=1, + relief=SUNKEN, anchor=W, width=10).grid( + row=ypos, column=1, sticky=W+E) + Label(self.evframe, text=ticks2sec(d), + bd=1, relief=SUNKEN, width=10).grid( + row=ypos, column=2, sticky=W+E) + if (d and c): + d /= c + else: + d = 0 + Label(self.evframe, text=ticks2sec(d), + bd=1, relief=SUNKEN, width=10).grid( + row=ypos, column=3, sticky=W+E) ypos += 1 From owner-svn-src-head@FreeBSD.ORG Thu Jan 22 07:18:18 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22B50106566B for ; Thu, 22 Jan 2009 07:18:18 +0000 (UTC) (envelope-from jroberson@jroberson.net) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.226]) by mx1.freebsd.org (Postfix) with ESMTP id EFB908FC18 for ; Thu, 22 Jan 2009 07:18:17 +0000 (UTC) (envelope-from jroberson@jroberson.net) Received: by rv-out-0506.google.com with SMTP id b25so4145359rvf.43 for ; Wed, 21 Jan 2009 23:18:17 -0800 (PST) Received: by 10.115.32.8 with SMTP id k8mr150251waj.54.1232607100897; Wed, 21 Jan 2009 22:51:40 -0800 (PST) Received: from ?10.0.1.199? (udp005586uds.hawaiiantel.net [72.234.105.237]) by mx.google.com with ESMTPS id m28sm12132947poh.11.2009.01.21.22.51.36 (version=SSLv3 cipher=RC4-MD5); Wed, 21 Jan 2009 22:51:38 -0800 (PST) Date: Wed, 21 Jan 2009 20:48:43 -1000 (HST) From: Jeff Roberson X-X-Sender: jroberson@desktop To: John Baldwin In-Reply-To: <200901212310.n0LNA6cM093944@svn.freebsd.org> Message-ID: <20090121204615.H983@desktop> References: <200901212310.n0LNA6cM093944@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r187576 - in head/sys/dev: ppbus ppc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2009 07:18:18 -0000 On Wed, 21 Jan 2009, John Baldwin wrote: > Author: jhb > Date: Wed Jan 21 23:10:06 2009 > New Revision: 187576 > URL: http://svn.freebsd.org/changeset/base/187576 > > Log: > Add locking to ppc and ppbus and mark the whole lot MPSAFE: Looks like there might be some kinks still: ppc0: port 0x378-0x37f,0x778-0x77f irq 7 drq 3 on acpi0 ppc0: SMC-like chipset (ECP/EPP/PS2/NIBBLE) in COMPATIBLE mode ppc0: FIFO with 16/16/9 bytes threshold ppc0: [ITHREAD] ppbus0: on ppc0 panic: mutex ppc0 not owned at ../../../dev/ppc/ppc.c:1983 cpuid = 0 KDB: enter: panic [thread pid 0 tid 100000 ] Stopped at kdb_enter+0x3d: movq $0,0x652ea8(%rip) _mtx_assert() at _mtx_assert+0xdc ppc_write_ivar() at ppc_write_ivar+0x6e ppbus_attach() at ppbus_attach+0x14b Thanks, Jeff > - To avoid having a bunch of locks that end up always getting acquired as > a group, give each ppc(4) device a mutex which it shares with all the > child devices including ppbus(4), lpt(4), plip(4), etc. This mutex > is then used for all the locking. > - Rework the interrupt handling stuff yet again. Now ppbus drivers setup > their interrupt handler during attach and tear it down during detach > like most other drivers. ppbus(4) only invokes the interrupt handler > of the device that currently owns the bus (if any) when an interrupt > occurs, however. Also, interrupt handlers in general now accept their > softc pointers as their argument rather than the device_t. Another > feature of the ppbus interrupt handlers is that they are called with > the parent ppc device's lock already held. This minimizes the number > of lock operations during an interrupt. > - Mark plip(4), lpt(4), pcfclock(4), ppi(4), vpo(4) MPSAFE. > - lpbb(4) uses the ppc lock instead of Giant. > - Other plip(4) changes: > - Add a mutex to protect the global tables in plip(4) and free them on > module unload. > - Add a detach routine. > - Split out the init/stop code from the ioctl routine into separate > functions. > - Other lpt(4) changes: > - Use device_printf(). > - Use a dedicated callout for the lptout timer. > - Allocate the I/O buffers at attach and detach rather than during > open and close as this simplifies the locking at the cost of > 1024+32 bytes when the driver is attached. > - Other ppi(4) changes: > - Use an sx lock to serialize open and close. > - Remove unused HADBUS flag. > - Add a detach routine. > - Use a malloc'd buffer for each read and write to avoid races with > concurrent read/write. > - Other pps(4) changes: > - Use a callout rather than a callout handle with timeout(). > - Conform to the new ppbus requirements (regular mutex, non-filter > interrupt handler). pps(4) is probably going to have to become a > standalone driver that doesn't use ppbus(4) to satisfy it's > requirements for low latency as a result. > - Use an sx lock to serialize open and close. > - Other vpo(4) changes: > - Use the parent ppc device's lock to create the CAM sim instead of > Giant. > - Other ppc(4) changes: > - Fix ppc_isa's detach method to detach instead of calling attach. > > Tested by: no one :-( > > Modified: > head/sys/dev/ppbus/if_plip.c > head/sys/dev/ppbus/immio.c > head/sys/dev/ppbus/lpbb.c > head/sys/dev/ppbus/lpt.c > head/sys/dev/ppbus/pcfclock.c > head/sys/dev/ppbus/ppb_1284.c > head/sys/dev/ppbus/ppb_base.c > head/sys/dev/ppbus/ppb_msq.c > head/sys/dev/ppbus/ppbconf.c > head/sys/dev/ppbus/ppbconf.h > head/sys/dev/ppbus/ppi.c > head/sys/dev/ppbus/pps.c > head/sys/dev/ppbus/vpo.c > head/sys/dev/ppbus/vpoio.c > head/sys/dev/ppc/ppc.c > head/sys/dev/ppc/ppc_acpi.c > head/sys/dev/ppc/ppc_isa.c > head/sys/dev/ppc/ppc_pci.c > head/sys/dev/ppc/ppc_puc.c > head/sys/dev/ppc/ppcreg.h > head/sys/dev/ppc/ppcvar.h > > Modified: head/sys/dev/ppbus/if_plip.c > ============================================================================== > --- head/sys/dev/ppbus/if_plip.c Wed Jan 21 21:48:46 2009 (r187575) > +++ head/sys/dev/ppbus/if_plip.c Wed Jan 21 23:10:06 2009 (r187576) > @@ -152,8 +152,12 @@ struct lp_data { > int sc_iferrs; > > struct resource *res_irq; > + void *sc_intr_cookie; > }; > > +static struct mtx lp_tables_lock; > +MTX_SYSINIT(lp_tables, &lp_tables_lock, "plip tables", MTX_DEF); > + > /* Tables for the lp# interface */ > static u_char *txmith; > #define txmitl (txmith + (1 * LPIPTBLSIZE)) > @@ -170,13 +174,41 @@ static int lpinittables(void); > static int lpioctl(struct ifnet *, u_long, caddr_t); > static int lpoutput(struct ifnet *, struct mbuf *, struct sockaddr *, > struct rtentry *); > +static void lpstop(struct lp_data *); > static void lp_intr(void *); > +static int lp_module_handler(module_t, int, void *); > > #define DEVTOSOFTC(dev) \ > ((struct lp_data *)device_get_softc(dev)) > > static devclass_t lp_devclass; > > +static int > +lp_module_handler(module_t mod, int what, void *arg) > +{ > + > + switch (what) { > + case MOD_UNLOAD: > + mtx_lock(&lp_tables_lock); > + if (txmith != NULL) { > + free(txmith, M_DEVBUF); > + txmith = NULL; > + } > + if (ctxmith != NULL) { > + free(ctxmith, M_DEVBUF); > + ctxmith = NULL; > + } > + mtx_unlock(&lp_tables_lock); > + break; > + case MOD_LOAD: > + case MOD_QUIESCE: > + break; > + default: > + return (EOPNOTSUPP); > + } > + return (0); > +} > + > static void > lp_identify(driver_t *driver, device_t parent) > { > @@ -201,7 +233,7 @@ lp_attach(device_t dev) > { > struct lp_data *lp = DEVTOSOFTC(dev); > struct ifnet *ifp; > - int rid = 0; > + int error, rid = 0; > > lp->sc_dev = dev; > > @@ -224,8 +256,7 @@ lp_attach(device_t dev) > ifp->if_softc = lp; > if_initname(ifp, device_get_name(dev), device_get_unit(dev)); > ifp->if_mtu = LPMTU; > - ifp->if_flags = IFF_SIMPLEX | IFF_POINTOPOINT | IFF_MULTICAST | > - IFF_NEEDSGIANT; > + ifp->if_flags = IFF_SIMPLEX | IFF_POINTOPOINT | IFF_MULTICAST; > ifp->if_ioctl = lpioctl; > ifp->if_output = lpoutput; > ifp->if_hdrlen = 0; > @@ -235,8 +266,39 @@ lp_attach(device_t dev) > > bpfattach(ifp, DLT_NULL, sizeof(u_int32_t)); > > + /* > + * Attach our interrupt handler. It is only called while we > + * own the ppbus. > + */ > + error = bus_setup_intr(dev, lp->res_irq, INTR_TYPE_NET | INTR_MPSAFE, > + NULL, lp_intr, lp, &lp->sc_intr_cookie); > + if (error) { > + bpfdetach(ifp); > + if_detach(ifp); > + bus_release_resource(dev, SYS_RES_IRQ, 0, lp->res_irq); > + device_printf(dev, "Unable to register interrupt handler\n"); > + return (error); > + } > + > return (0); > } > + > +static int > +lp_detach(device_t dev) > +{ > + struct lp_data *sc = device_get_softc(dev); > + device_t ppbus = device_get_parent(dev); > + > + ppb_lock(ppbus); > + lpstop(sc); > + ppb_unlock(ppbus); > + bpfdetach(sc->sc_ifp); > + if_detach(sc->sc_ifp); > + bus_teardown_intr(dev, sc->res_irq, sc->sc_intr_cookie); > + bus_release_resource(dev, SYS_RES_IRQ, 0, sc->res_irq); > + return (0); > +} > + > /* > * Build the translation tables for the LPIP (BSD unix) protocol. > * We don't want to calculate these nasties in our tight loop, so we > @@ -247,17 +309,22 @@ lpinittables(void) > { > int i; > > + mtx_lock(&lp_tables_lock); > if (txmith == NULL) > txmith = malloc(4 * LPIPTBLSIZE, M_DEVBUF, M_NOWAIT); > > - if (txmith == NULL) > + if (txmith == NULL) { > + mtx_unlock(&lp_tables_lock); > return (1); > + } > > if (ctxmith == NULL) > ctxmith = malloc(4 * LPIPTBLSIZE, M_DEVBUF, M_NOWAIT); > > - if (ctxmith == NULL) > + if (ctxmith == NULL) { > + mtx_unlock(&lp_tables_lock); > return (1); > + } > > for (i = 0; i < LPIPTBLSIZE; i++) { > ctxmith[i] = (i & 0xF0) >> 4; > @@ -272,10 +339,61 @@ lpinittables(void) > trecvh[i] = ((~i) & 0x80) | ((i & 0x38) << 1); > trecvl[i] = (((~i) & 0x80) >> 4) | ((i & 0x38) >> 3); > } > + mtx_unlock(&lp_tables_lock); > > return (0); > } > > +static void > +lpstop(struct lp_data *sc) > +{ > + device_t ppbus = device_get_parent(sc->sc_dev); > + > + ppb_assert_locked(ppbus); > + ppb_wctr(ppbus, 0x00); > + sc->sc_ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); > + free(sc->sc_ifbuf, M_DEVBUF); > + sc->sc_ifbuf = NULL; > + > + /* IFF_UP is not set, try to release the bus anyway */ > + ppb_release_bus(ppbus, sc->sc_dev); > +} > + > +static int > +lpinit_locked(struct ifnet *ifp) > +{ > + struct lp_data *sc = ifp->if_softc; > + device_t dev = sc->sc_dev; > + device_t ppbus = device_get_parent(dev); > + int error; > + > + ppb_assert_locked(ppbus); > + error = ppb_request_bus(ppbus, dev, PPB_DONTWAIT); > + if (error) > + return (error); > + > + /* Now IFF_UP means that we own the bus */ > + ppb_set_mode(ppbus, PPB_COMPATIBLE); > + > + if (lpinittables()) { > + ppb_release_bus(ppbus, dev); > + return (ENOBUFS); > + } > + > + sc->sc_ifbuf = malloc(sc->sc_ifp->if_mtu + MLPIPHDRLEN, > + M_DEVBUF, M_NOWAIT); > + if (sc->sc_ifbuf == NULL) { > + ppb_release_bus(ppbus, dev); > + return (ENOBUFS); > + } > + > + ppb_wctr(ppbus, IRQENABLE); > + > + ifp->if_drv_flags |= IFF_DRV_RUNNING; > + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; > + return (0); > +} > + > /* > * Process an ioctl request. > */ > @@ -288,7 +406,6 @@ lpioctl(struct ifnet *ifp, u_long cmd, c > struct ifaddr *ifa = (struct ifaddr *)data; > struct ifreq *ifr = (struct ifreq *)data; > u_char *ptr; > - void *ih; > int error; > > switch (cmd) { > @@ -301,67 +418,32 @@ lpioctl(struct ifnet *ifp, u_long cmd, c > ifp->if_flags |= IFF_UP; > /* FALLTHROUGH */ > case SIOCSIFFLAGS: > + error = 0; > + ppb_lock(ppbus); > if ((!(ifp->if_flags & IFF_UP)) && > - (ifp->if_drv_flags & IFF_DRV_RUNNING)) { > - > - ppb_wctr(ppbus, 0x00); > - ifp->if_drv_flags &= ~IFF_DRV_RUNNING; > - > - /* IFF_UP is not set, try to release the bus anyway */ > - ppb_release_bus(ppbus, dev); > - break; > - } > - if (((ifp->if_flags & IFF_UP)) && > - (!(ifp->if_drv_flags & IFF_DRV_RUNNING))) { > - > - /* XXX > - * Should the request be interruptible? > - */ > - if ((error = ppb_request_bus(ppbus, dev, PPB_WAIT | > - PPB_INTR))) > - return (error); > + (ifp->if_drv_flags & IFF_DRV_RUNNING)) > + lpstop(sc); > + else if (((ifp->if_flags & IFF_UP)) && > + (!(ifp->if_drv_flags & IFF_DRV_RUNNING))) > + error = lpinit_locked(ifp); > + ppb_unlock(ppbus); > + return (error); > > - /* Now IFF_UP means that we own the bus */ > - ppb_set_mode(ppbus, PPB_COMPATIBLE); > - > - if (lpinittables()) { > - ppb_release_bus(ppbus, dev); > - return (ENOBUFS); > - } > - > - sc->sc_ifbuf = malloc(sc->sc_ifp->if_mtu + MLPIPHDRLEN, > - M_DEVBUF, M_WAITOK); > - if (sc->sc_ifbuf == NULL) { > - ppb_release_bus(ppbus, dev); > + case SIOCSIFMTU: > + ppb_lock(ppbus); > + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { > + ptr = malloc(ifr->ifr_mtu + MLPIPHDRLEN, M_DEVBUF, > + M_NOWAIT); > + if (ptr == NULL) { > + ppb_unlock(ppbus); > return (ENOBUFS); > } > - > - /* > - * Attach our interrupt handler. It is > - * detached later when the bus is released. > - */ > - if ((error = bus_setup_intr(dev, sc->res_irq, > - INTR_TYPE_NET, NULL, lp_intr, dev, &ih))) { > - ppb_release_bus(ppbus, dev); > - return (error); > - } > - > - ppb_wctr(ppbus, IRQENABLE); > - ifp->if_drv_flags |= IFF_DRV_RUNNING; > - } > - break; > - > - case SIOCSIFMTU: > - ptr = sc->sc_ifbuf; > - sc->sc_ifbuf = malloc(ifr->ifr_mtu + MLPIPHDRLEN, M_DEVBUF, > - M_NOWAIT); > - if (sc->sc_ifbuf == NULL) { > + if (sc->sc_ifbuf) > + free(sc->sc_ifbuf, M_DEVBUF); > sc->sc_ifbuf = ptr; > - return (ENOBUFS); > } > - if (ptr) > - free(ptr, M_DEVBUF); > sc->sc_ifp->if_mtu = ifr->ifr_mtu; > + ppb_unlock(ppbus); > break; > > case SIOCGIFMTU: > @@ -417,14 +499,14 @@ clpinbyte(int spin, device_t ppbus) > { > u_char c, cl; > > - while((ppb_rstr(ppbus) & CLPIP_SHAKE)) > + while ((ppb_rstr(ppbus) & CLPIP_SHAKE)) > if (!--spin) { > return (-1); > } > cl = ppb_rstr(ppbus); > ppb_wdtr(ppbus, 0x10); > > - while(!(ppb_rstr(ppbus) & CLPIP_SHAKE)) > + while (!(ppb_rstr(ppbus) & CLPIP_SHAKE)) > if (!--spin) { > return (-1); > } > @@ -445,16 +527,14 @@ lptap(struct ifnet *ifp, struct mbuf *m) > static void > lp_intr(void *arg) > { > - device_t dev = (device_t)arg; > - device_t ppbus = device_get_parent(dev); > - struct lp_data *sc = DEVTOSOFTC(dev); > - int len, s, j; > + struct lp_data *sc = arg; > + device_t ppbus = device_get_parent(sc->sc_dev); > + int len, j; > u_char *bp; > u_char c, cl; > struct mbuf *top; > > - s = splhigh(); > - > + ppb_assert_locked(ppbus); > if (sc->sc_ifp->if_flags & IFF_LINK0) { > > /* Ack. the request */ > @@ -500,13 +580,15 @@ lp_intr(void *arg) > top = m_devget(sc->sc_ifbuf + CLPIPHDRLEN, len, 0, sc->sc_ifp, > 0); > if (top) { > + ppb_unlock(ppbus); > if (bpf_peers_present(sc->sc_ifp->if_bpf)) > lptap(sc->sc_ifp, top); > > /* mbuf is free'd on failure. */ > netisr_queue(NETISR_IP, top); > + ppb_lock(ppbus); > } > - goto done; > + return; > } > while ((ppb_rstr(ppbus) & LPIP_SHAKE)) { > len = sc->sc_ifp->if_mtu + LPIPHDRLEN; > @@ -517,7 +599,7 @@ lp_intr(void *arg) > ppb_wdtr(ppbus, 8); > > j = LPMAXSPIN2; > - while((ppb_rstr(ppbus) & LPIP_SHAKE)) > + while ((ppb_rstr(ppbus) & LPIP_SHAKE)) > if (!--j) > goto err; > > @@ -550,14 +632,16 @@ lp_intr(void *arg) > top = m_devget(sc->sc_ifbuf + LPIPHDRLEN, len, 0, sc->sc_ifp, > 0); > if (top) { > + ppb_unlock(ppbus); > if (bpf_peers_present(sc->sc_ifp->if_bpf)) > lptap(sc->sc_ifp, top); > > /* mbuf is free'd on failure. */ > netisr_queue(NETISR_IP, top); > + ppb_lock(ppbus); > } > } > - goto done; > + return; > > err: > ppb_wdtr(ppbus, 0); > @@ -575,9 +659,6 @@ err: > sc->sc_ifp->if_drv_flags &= ~IFF_DRV_RUNNING; > sc->sc_iferrs = 0; > } > - > -done: > - splx(s); > } > > static __inline int > @@ -602,7 +683,7 @@ lpoutput(struct ifnet *ifp, struct mbuf > struct lp_data *sc = ifp->if_softc; > device_t dev = sc->sc_dev; > device_t ppbus = device_get_parent(dev); > - int s, err; > + int err; > struct mbuf *mm; > u_char *cp = "\0\0"; > u_char chksum = 0; > @@ -611,19 +692,18 @@ lpoutput(struct ifnet *ifp, struct mbuf > > /* We need a sensible value if we abort */ > cp++; > - ifp->if_drv_flags |= IFF_DRV_RUNNING; > + ppb_lock(ppbus); > + ifp->if_drv_flags |= IFF_DRV_OACTIVE; > > err = 1; /* assume we're aborting because of an error */ > > - s = splhigh(); > - > /* Suspend (on laptops) or receive-errors might have taken us offline */ > ppb_wctr(ppbus, IRQENABLE); > > if (ifp->if_flags & IFF_LINK0) { > if (!(ppb_rstr(ppbus) & CLPIP_SHAKE)) { > lprintf("&"); > - lp_intr(dev); > + lp_intr(sc); > } > > /* Alert other end to pending packet */ > @@ -681,6 +761,7 @@ lpoutput(struct ifnet *ifp, struct mbuf > err = 0; /* No errors */ > > nend: > + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; > if (err) { /* if we didn't timeout... */ > ifp->if_oerrors++; > lprintf("X"); > @@ -695,15 +776,15 @@ lpoutput(struct ifnet *ifp, struct mbuf > > if (!(ppb_rstr(ppbus) & CLPIP_SHAKE)) { > lprintf("^"); > - lp_intr(dev); > + lp_intr(sc); > } > - (void) splx(s); > + ppb_unlock(ppbus); > return (0); > } > > if (ppb_rstr(ppbus) & LPIP_SHAKE) { > lprintf("&"); > - lp_intr(dev); > + lp_intr(sc); > } > > if (lpoutbyte(0x08, LPMAXSPIN1, ppbus)) > @@ -726,6 +807,7 @@ end: > --cp; > ppb_wdtr(ppbus, txmitl[*cp] ^ 0x17); > > + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; > if (err) { /* if we didn't timeout... */ > ifp->if_oerrors++; > lprintf("X"); > @@ -740,10 +822,10 @@ end: > > if (ppb_rstr(ppbus) & LPIP_SHAKE) { > lprintf("^"); > - lp_intr(dev); > + lp_intr(sc); > } > > - (void) splx(s); > + ppb_unlock(ppbus); > return (0); > } > > @@ -752,6 +834,7 @@ static device_method_t lp_methods[] = { > DEVMETHOD(device_identify, lp_identify), > DEVMETHOD(device_probe, lp_probe), > DEVMETHOD(device_attach, lp_attach), > + DEVMETHOD(device_detach, lp_detach), > > { 0, 0 } > }; > @@ -762,5 +845,5 @@ static driver_t lp_driver = { > sizeof(struct lp_data), > }; > > -DRIVER_MODULE(plip, ppbus, lp_driver, lp_devclass, 0, 0); > +DRIVER_MODULE(plip, ppbus, lp_driver, lp_devclass, lp_module_handler, 0); > MODULE_DEPEND(plip, ppbus, 1, 1, 1); > > Modified: head/sys/dev/ppbus/immio.c > ============================================================================== > --- head/sys/dev/ppbus/immio.c Wed Jan 21 21:48:46 2009 (r187575) > +++ head/sys/dev/ppbus/immio.c Wed Jan 21 23:10:06 2009 (r187576) > @@ -606,6 +606,7 @@ imm_attach(struct vpoio_data *vpo) > /* > * Initialize mode dependent in/out microsequences > */ > + ppb_lock(ppbus); > if ((error = ppb_request_bus(ppbus, vpo->vpo_dev, PPB_WAIT))) > goto error; > > @@ -632,6 +633,7 @@ imm_attach(struct vpoio_data *vpo) > > ppb_release_bus(ppbus, vpo->vpo_dev); > error: > + ppb_unlock(ppbus); > return (error); > } > > > Modified: head/sys/dev/ppbus/lpbb.c > ============================================================================== > --- head/sys/dev/ppbus/lpbb.c Wed Jan 21 21:48:46 2009 (r187575) > +++ head/sys/dev/ppbus/lpbb.c Wed Jan 21 23:10:06 2009 (r187576) > @@ -103,16 +103,16 @@ lpbb_callback(device_t dev, int index, c > case IIC_REQUEST_BUS: > /* request the ppbus */ > how = *(int *)data; > - mtx_lock(&Giant); > + ppb_lock(ppbus); > error = ppb_request_bus(ppbus, dev, how); > - mtx_unlock(&Giant); > + ppb_unlock(ppbus); > break; > > case IIC_RELEASE_BUS: > /* release the ppbus */ > - mtx_lock(&Giant); > + ppb_lock(ppbus); > error = ppb_release_bus(ppbus, dev); > - mtx_unlock(&Giant); > + ppb_unlock(ppbus); > break; > > default: > @@ -129,25 +129,38 @@ lpbb_callback(device_t dev, int index, c > #define ALIM 0x20 > #define I2CKEY 0x50 > > +/* Reset bus by setting SDA first and then SCL. */ > +static void > +lpbb_reset_bus(device_t dev) > +{ > + device_t ppbus = device_get_parent(dev); > + > + ppb_assert_locked(ppbus); > + ppb_wdtr(ppbus, (u_char)~SDA_out); > + ppb_wctr(ppbus, (u_char)(ppb_rctr(ppbus) | SCL_out)); > +} > + > static int > lpbb_getscl(device_t dev) > { > + device_t ppbus = device_get_parent(dev); > int rval; > > - mtx_lock(&Giant); > - rval = ((ppb_rstr(device_get_parent(dev)) & SCL_in) == SCL_in); > - mtx_unlock(&Giant); > + ppb_lock(ppbus); > + rval = ((ppb_rstr(ppbus) & SCL_in) == SCL_in); > + ppb_unlock(ppbus); > return (rval); > } > > static int > lpbb_getsda(device_t dev) > { > + device_t ppbus = device_get_parent(dev); > int rval; > > - mtx_lock(&Giant); > - rval = ((ppb_rstr(device_get_parent(dev)) & SDA_in) == SDA_in); > - mtx_unlock(&Giant); > + ppb_lock(ppbus); > + rval = ((ppb_rstr(ppbus) & SDA_in) == SDA_in); > + ppb_unlock(ppbus); > return (rval); > } > > @@ -156,12 +169,12 @@ lpbb_setsda(device_t dev, char val) > { > device_t ppbus = device_get_parent(dev); > > - mtx_lock(&Giant); > + ppb_lock(ppbus); > if (val == 0) > ppb_wdtr(ppbus, (u_char)SDA_out); > else > ppb_wdtr(ppbus, (u_char)~SDA_out); > - mtx_unlock(&Giant); > + ppb_unlock(ppbus); > } > > static void > @@ -169,12 +182,12 @@ lpbb_setscl(device_t dev, unsigned char > { > device_t ppbus = device_get_parent(dev); > > - mtx_lock(&Giant); > + ppb_lock(ppbus); > if (val == 0) > ppb_wctr(ppbus, (u_char)(ppb_rctr(ppbus) & ~SCL_out)); > else > ppb_wctr(ppbus, (u_char)(ppb_rctr(ppbus) | SCL_out)); > - mtx_unlock(&Giant); > + ppb_unlock(ppbus); > } > > static int > @@ -182,23 +195,24 @@ lpbb_detect(device_t dev) > { > device_t ppbus = device_get_parent(dev); > > + ppb_lock(ppbus); > if (ppb_request_bus(ppbus, dev, PPB_DONTWAIT)) { > + ppb_unlock(ppbus); > device_printf(dev, "can't allocate ppbus\n"); > return (0); > } > > - /* reset bus */ > - lpbb_setsda(dev, 1); > - lpbb_setscl(dev, 1); > + lpbb_reset_bus(dev); > > if ((ppb_rstr(ppbus) & I2CKEY) || > ((ppb_rstr(ppbus) & ALIM) != ALIM)) { > - > ppb_release_bus(ppbus, dev); > + ppb_unlock(ppbus); > return (0); > } > > ppb_release_bus(ppbus, dev); > + ppb_unlock(ppbus); > > return (1); > } > @@ -208,18 +222,17 @@ lpbb_reset(device_t dev, u_char speed, u > { > device_t ppbus = device_get_parent(dev); > > - mtx_lock(&Giant); > + ppb_lock(ppbus); > if (ppb_request_bus(ppbus, dev, PPB_DONTWAIT)) { > + ppb_unlock(ppbus); > device_printf(dev, "can't allocate ppbus\n"); > return (0); > } > > - /* reset bus */ > - lpbb_setsda(dev, 1); > - lpbb_setscl(dev, 1); > + lpbb_reset_bus(dev); > > ppb_release_bus(ppbus, dev); > - mtx_unlock(&Giant); > + ppb_unlock(ppbus); > > return (IIC_ENOADDR); > } > > Modified: head/sys/dev/ppbus/lpt.c > ============================================================================== > --- head/sys/dev/ppbus/lpt.c Wed Jan 21 21:48:46 2009 (r187575) > +++ head/sys/dev/ppbus/lpt.c Wed Jan 21 23:10:06 2009 (r187576) > @@ -105,9 +105,9 @@ static int volatile lptflag = 1; > #define BUFSTATSIZE 32 > > struct lpt_data { > - device_t dev; > - struct cdev *cdev; > - struct cdev *cdev_bypass; > + device_t sc_dev; > + struct cdev *sc_cdev; > + struct cdev *sc_cdev_bypass; > short sc_state; > /* default case: negative prime, negative ack, handshake strobe, > prime once */ > @@ -130,9 +130,10 @@ struct lpt_data { > #define LP_ENABLE_IRQ 0x04 /* enable IRQ on open */ > #define LP_ENABLE_EXT 0x10 /* we shall use advanced mode when possible */ > u_char sc_backoff ; /* time to call lptout() again */ > + struct callout sc_timer; > > - struct resource *intr_resource; /* interrupt resource */ > - void *intr_cookie; /* interrupt registration cookie */ > + struct resource *sc_intr_resource; /* interrupt resource */ > + void *sc_intr_cookie; /* interrupt cookie */ > }; > > #define LPT_NAME "lpt" /* our official name */ > @@ -144,8 +145,7 @@ static int lpt_detect(device_t dev); > #define DEVTOSOFTC(dev) \ > ((struct lpt_data *)device_get_softc(dev)) > > -static void lptintr(device_t dev); > -static void lpt_intr(void *arg); /* without spls */ > +static void lptintr(void *arg); > > static devclass_t lpt_devclass; > > @@ -183,7 +183,6 @@ static d_ioctl_t lptioctl; > > static struct cdevsw lpt_cdevsw = { > .d_version = D_VERSION, > - .d_flags = D_NEEDGIANT, > .d_open = lptopen, > .d_close = lptclose, > .d_read = lptread, > @@ -199,13 +198,17 @@ lpt_request_ppbus(device_t dev, int how) > struct lpt_data *sc = DEVTOSOFTC(dev); > int error; > > + /* > + * We might already have the bus for a write(2) after an interrupted > + * write(2) call. > + */ > + ppb_assert_locked(ppbus); > if (sc->sc_state & HAVEBUS) > return (0); > > - /* we have the bus only if the request succeded */ > - if ((error = ppb_request_bus(ppbus, dev, how)) == 0) > + error = ppb_request_bus(ppbus, dev, how); > + if (error == 0) > sc->sc_state |= HAVEBUS; > - > return (error); > } > > @@ -216,9 +219,12 @@ lpt_release_ppbus(device_t dev) > struct lpt_data *sc = DEVTOSOFTC(dev); > int error = 0; > > - if ((error = ppb_release_bus(ppbus, dev)) == 0) > - sc->sc_state &= ~HAVEBUS; > - > + ppb_assert_locked(ppbus); > + if (sc->sc_state & HAVEBUS) { > + error = ppb_release_bus(ppbus, dev); > + if (error == 0) > + sc->sc_state &= ~HAVEBUS; > + } > return (error); > } > > @@ -306,24 +312,25 @@ lpt_detect(device_t dev) > > status = 1; /* assume success */ > > + ppb_lock(ppbus); > if ((error = lpt_request_ppbus(dev, PPB_DONTWAIT))) { > - printf(LPT_NAME ": cannot alloc ppbus (%d)!\n", error); > - status = 0; > - goto end_probe; > + ppb_unlock(ppbus); > + device_printf(dev, "cannot alloc ppbus (%d)!\n", error); > + return (0); > } > > for (i = 0; i < 18 && status; i++) > if (!lpt_port_test(ppbus, testbyte[i], 0xff)) { > status = 0; > - goto end_probe; > + break; > } > > -end_probe: > /* write 0's to control and data ports */ > ppb_wdtr(ppbus, 0); > ppb_wctr(ppbus, 0); > > lpt_release_ppbus(dev); > + ppb_unlock(ppbus); > > return (status); > } > @@ -363,21 +370,33 @@ lpt_attach(device_t dev) > int error; > > sc->sc_primed = 0; /* not primed yet */ > + ppb_init_callout(ppbus, &sc->sc_timer, 0); > > + ppb_lock(ppbus); > if ((error = lpt_request_ppbus(dev, PPB_DONTWAIT))) { > - printf(LPT_NAME ": cannot alloc ppbus (%d)!\n", error); > + ppb_unlock(ppbus); > + device_printf(dev, "cannot alloc ppbus (%d)!\n", error); > return (0); > } > > ppb_wctr(ppbus, LPC_NINIT); > - > - /* check if we can use interrupt, should be done by ppc stuff */ > - lprintf(("oldirq %x\n", sc->sc_irq)); > + ppb_unlock(ppbus); > + lpt_release_ppbus(dev); > > /* declare our interrupt handler */ > - sc->intr_resource = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, > + sc->sc_intr_resource = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, > RF_SHAREABLE); > - if (sc->intr_resource) { > + if (sc->sc_intr_resource) { > + error = bus_setup_intr(dev, sc->sc_intr_resource, > + INTR_TYPE_TTY | INTR_MPSAFE, NULL, lptintr, sc, > + &sc->sc_intr_cookie); > + if (error) { > + bus_release_resource(dev, SYS_RES_IRQ, rid, > + sc->sc_intr_resource); > + device_printf(dev, > + "Unable to register interrupt handler\n"); > + return (error); > + } > sc->sc_irq = LP_HAS_IRQ | LP_USE_IRQ | LP_ENABLE_IRQ; > device_printf(dev, "Interrupt-driven port\n"); > } else { > @@ -386,17 +405,17 @@ lpt_attach(device_t dev) > } > lprintf(("irq %x\n", sc->sc_irq)); > > - lpt_release_ppbus(dev); > - > - sc->dev = dev; > - sc->cdev = make_dev(&lpt_cdevsw, unit, > + sc->sc_inbuf = malloc(BUFSIZE, M_DEVBUF, M_WAITOK); > + sc->sc_statbuf = malloc(BUFSTATSIZE, M_DEVBUF, M_WAITOK); > + sc->sc_dev = dev; > + sc->sc_cdev = make_dev(&lpt_cdevsw, unit, > UID_ROOT, GID_WHEEL, 0600, LPT_NAME "%d", unit); > - sc->cdev->si_drv1 = sc; > - sc->cdev->si_drv2 = 0; > - sc->cdev_bypass = make_dev(&lpt_cdevsw, unit, > + sc->sc_cdev->si_drv1 = sc; > + sc->sc_cdev->si_drv2 = 0; > + sc->sc_cdev_bypass = make_dev(&lpt_cdevsw, unit, > UID_ROOT, GID_WHEEL, 0600, LPT_NAME "%d.ctl", unit); > - sc->cdev_bypass->si_drv1 = sc; > - sc->cdev_bypass->si_drv2 = (void *)LP_BYPASS; > + sc->sc_cdev_bypass->si_drv1 = sc; > + sc->sc_cdev_bypass->si_drv2 = (void *)LP_BYPASS; > return (0); > } > > @@ -404,15 +423,21 @@ static int > lpt_detach(device_t dev) > { > struct lpt_data *sc = DEVTOSOFTC(dev); > + device_t ppbus = device_get_parent(dev); > > - destroy_dev(sc->cdev); > - destroy_dev(sc->cdev_bypass); > + destroy_dev(sc->sc_cdev); > + destroy_dev(sc->sc_cdev_bypass); > + ppb_lock(ppbus); > lpt_release_ppbus(dev); > - if (sc->intr_resource != 0) { > - BUS_TEARDOWN_INTR(device_get_parent(dev), dev, > - sc->intr_resource, sc->intr_cookie); > - bus_release_resource(dev, SYS_RES_IRQ, 0, sc->intr_resource); > + ppb_unlock(ppbus); > + callout_drain(&sc->sc_timer); > + if (sc->sc_intr_resource != NULL) { > + bus_teardown_intr(dev, sc->sc_intr_resource, > + sc->sc_intr_cookie); > + bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sc_intr_resource); > } > + free(sc->sc_inbuf, M_DEVBUF); > + free(sc->sc_statbuf, M_DEVBUF); > > return (0); > } > @@ -420,18 +445,17 @@ lpt_detach(device_t dev) > static void > lptout(void *arg) > { > - device_t dev = (device_t)arg; > - struct lpt_data *sc = DEVTOSOFTC(dev); > -#ifdef LPT_DEBUG > + struct lpt_data *sc = arg; > + device_t dev = sc->sc_dev; > device_t ppbus = device_get_parent(dev); > -#endif > > + ppb_assert_locked(ppbus); > lprintf(("T %x ", ppb_rstr(ppbus))); > if (sc->sc_state & OPEN) { > sc->sc_backoff++; > if (sc->sc_backoff > hz/LPTOUTMAX) > sc->sc_backoff = sc->sc_backoff > hz/LPTOUTMAX; > - timeout(lptout, (caddr_t)dev, sc->sc_backoff); > + callout_reset(&sc->sc_timer, sc->sc_backoff, lptout, sc); > } else > sc->sc_state &= ~TOUT; > > @@ -442,7 +466,7 @@ lptout(void *arg) > * Avoid possible hangs due to missed interrupts > */ > if (sc->sc_xfercnt) { > - lptintr(dev); > + lptintr(sc); > } else { > sc->sc_state &= ~OBUSY; > wakeup(dev); > @@ -458,17 +482,19 @@ lptout(void *arg) > static int > lptopen(struct cdev *dev, int flags, int fmt, struct thread *td) > { > - int s; > int trys, err; > struct lpt_data *sc = dev->si_drv1; > - device_t lptdev = sc->dev; > + device_t lptdev = sc->sc_dev; > device_t ppbus = device_get_parent(lptdev); > > if (!sc) > return (ENXIO); > > + ppb_lock(ppbus); > if (sc->sc_state) { > - lprintf((LPT_NAME ": still open %x\n", sc->sc_state)); > + lprintf(("%s: still open %x\n", device_get_nameunit(lptdev), > + sc->sc_state)); > + ppb_unlock(ppbus); > return(EBUSY); > } else > sc->sc_state |= LPTINIT; > @@ -478,6 +504,7 @@ lptopen(struct cdev *dev, int flags, int > /* Check for open with BYPASS flag set. */ > if (sc->sc_flags & LP_BYPASS) { > sc->sc_state = OPEN; > + ppb_unlock(ppbus); > return(0); > } > > @@ -485,11 +512,12 @@ lptopen(struct cdev *dev, int flags, int > if ((err = lpt_request_ppbus(lptdev, PPB_WAIT|PPB_INTR)) != 0) { > /* give it a chance to try later */ > sc->sc_state = 0; > + ppb_unlock(ppbus); > return (err); > } > > - s = spltty(); > - lprintf((LPT_NAME " flags 0x%x\n", sc->sc_flags)); > + lprintf(("%s flags 0x%x\n", device_get_nameunit(lptdev), > + sc->sc_flags)); > > /* set IRQ status according to ENABLE_IRQ flag > */ > @@ -514,21 +542,21 @@ lptopen(struct cdev *dev, int flags, int > do { > /* ran out of waiting for the printer */ > if (trys++ >= LPINITRDY*4) { > - splx(s); > sc->sc_state = 0; > lprintf(("status %x\n", ppb_rstr(ppbus))); > > lpt_release_ppbus(lptdev); > + ppb_unlock(ppbus); > return (EBUSY); > } > > /* wait 1/4 second, give up if we get a signal */ > - if (tsleep(lptdev, LPPRI|PCATCH, "lptinit", hz/4) != > - EWOULDBLOCK) { > + if (ppb_sleep(ppbus, lptdev, LPPRI | PCATCH, "lptinit", > + hz / 4) != EWOULDBLOCK) { > sc->sc_state = 0; > - splx(s); > > lpt_release_ppbus(lptdev); > + ppb_unlock(ppbus); > return (EBUSY); > } > > @@ -548,22 +576,20 @@ lptopen(struct cdev *dev, int flags, int > ppb_wctr(ppbus, sc->sc_control); > > sc->sc_state = OPEN; > - sc->sc_inbuf = malloc(BUFSIZE, M_DEVBUF, M_WAITOK); > - sc->sc_statbuf = malloc(BUFSTATSIZE, M_DEVBUF, M_WAITOK); > sc->sc_xfercnt = 0; > - splx(s); > - > - /* release the ppbus */ > - lpt_release_ppbus(lptdev); > > /* only use timeout if using interrupt */ > lprintf(("irq %x\n", sc->sc_irq)); > if (sc->sc_irq & LP_USE_IRQ) { > sc->sc_state |= TOUT; > - timeout(lptout, (caddr_t)lptdev, > - (sc->sc_backoff = hz/LPTOUTINITIAL)); > + sc->sc_backoff = hz / LPTOUTINITIAL; > + callout_reset(&sc->sc_timer, sc->sc_backoff, lptout, sc); > } > > + /* release the ppbus */ > + lpt_release_ppbus(lptdev); > + ppb_unlock(ppbus); > + > lprintf(("opened.\n")); > return(0); > } > @@ -578,17 +604,21 @@ static int > lptclose(struct cdev *dev, int flags, int fmt, struct thread *td) > { > struct lpt_data *sc = dev->si_drv1; > - device_t lptdev = sc->dev; > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > From owner-svn-src-head@FreeBSD.ORG Thu Jan 22 08:14:29 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 13A3C106568C; Thu, 22 Jan 2009 08:14:29 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 013608FC18; Thu, 22 Jan 2009 08:14:29 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0M8ESMe004933; Thu, 22 Jan 2009 08:14:28 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0M8ESfc004930; Thu, 22 Jan 2009 08:14:28 GMT (envelope-from das@svn.freebsd.org) Message-Id: <200901220814.n0M8ESfc004930@svn.freebsd.org> From: David Schultz Date: Thu, 22 Jan 2009 08:14:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187582 - head/lib/libc/stdio X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2009 08:14:29 -0000 Author: das Date: Thu Jan 22 08:14:28 2009 New Revision: 187582 URL: http://svn.freebsd.org/changeset/base/187582 Log: Add support for multibyte thousands_sep encodings, e.g., U+066C. The integer thousands' separator code is rewritten in order to avoid having to preallocate a buffer for the largest possible digit string with the most possible instances of the longest possible multibyte thousands' separator. The new version inserts thousands' separators for integers using the same code as floating point. Modified: head/lib/libc/stdio/printfcommon.h head/lib/libc/stdio/vfprintf.c head/lib/libc/stdio/vfwprintf.c Modified: head/lib/libc/stdio/printfcommon.h ============================================================================== --- head/lib/libc/stdio/printfcommon.h Thu Jan 22 06:39:31 2009 (r187581) +++ head/lib/libc/stdio/printfcommon.h Thu Jan 22 08:14:28 2009 (r187582) @@ -54,10 +54,8 @@ static int exponent(CHAR *, int, CHAR); #endif /* !NO_FLOATING_POINT */ -static CHAR *__ujtoa(uintmax_t, CHAR *, int, int, const char *, int, char, - const char *); -static CHAR *__ultoa(u_long, CHAR *, int, int, const char *, int, char, - const char *); +static CHAR *__ujtoa(uintmax_t, CHAR *, int, int, const char *); +static CHAR *__ultoa(u_long, CHAR *, int, int, const char *); #define NIOV 8 struct io_state { @@ -158,12 +156,10 @@ io_flush(struct io_state *iop) * use the given digits. */ static CHAR * -__ultoa(u_long val, CHAR *endp, int base, int octzero, const char *xdigs, - int needgrp, char thousep, const char *grp) +__ultoa(u_long val, CHAR *endp, int base, int octzero, const char *xdigs) { CHAR *cp = endp; long sval; - int ndig; /* * Handle the three cases separately, in the hope of getting @@ -175,7 +171,6 @@ __ultoa(u_long val, CHAR *endp, int base *--cp = to_char(val); return (cp); } - ndig = 0; /* * On many machines, unsigned arithmetic is harder than * signed arithmetic, so we do at most one unsigned mod and @@ -184,29 +179,11 @@ __ultoa(u_long val, CHAR *endp, int base */ if (val > LONG_MAX) { *--cp = to_char(val % 10); - ndig++; sval = val / 10; } else sval = val; do { *--cp = to_char(sval % 10); - ndig++; - /* - * If (*grp == CHAR_MAX) then no more grouping - * should be performed. - */ - if (needgrp && ndig == *grp && *grp != CHAR_MAX - && sval > 9) { - *--cp = thousep; - ndig = 0; - /* - * If (*(grp+1) == '\0') then we have to - * use *grp character (last grouping rule) - * for all next cases - */ - if (*(grp+1) != '\0') - grp++; - } sval /= 10; } while (sval != 0); break; @@ -235,50 +212,28 @@ __ultoa(u_long val, CHAR *endp, int base /* Identical to __ultoa, but for intmax_t. */ static CHAR * -__ujtoa(uintmax_t val, CHAR *endp, int base, int octzero, const char *xdigs, - int needgrp, char thousep, const char *grp) +__ujtoa(uintmax_t val, CHAR *endp, int base, int octzero, const char *xdigs) { CHAR *cp = endp; intmax_t sval; - int ndig; /* quick test for small values; __ultoa is typically much faster */ /* (perhaps instead we should run until small, then call __ultoa?) */ if (val <= ULONG_MAX) - return (__ultoa((u_long)val, endp, base, octzero, xdigs, - needgrp, thousep, grp)); + return (__ultoa((u_long)val, endp, base, octzero, xdigs)); switch (base) { case 10: if (val < 10) { *--cp = to_char(val % 10); return (cp); } - ndig = 0; if (val > INTMAX_MAX) { *--cp = to_char(val % 10); - ndig++; sval = val / 10; } else sval = val; do { *--cp = to_char(sval % 10); - ndig++; - /* - * If (*grp == CHAR_MAX) then no more grouping - * should be performed. - */ - if (needgrp && *grp != CHAR_MAX && ndig == *grp - && sval > 9) { - *--cp = thousep; - ndig = 0; - /* - * If (*(grp+1) == '\0') then we have to - * use *grp character (last grouping rule) - * for all next cases - */ - if (*(grp+1) != '\0') - grp++; - } sval /= 10; } while (sval != 0); break; Modified: head/lib/libc/stdio/vfprintf.c ============================================================================== --- head/lib/libc/stdio/vfprintf.c Thu Jan 22 06:39:31 2009 (r187581) +++ head/lib/libc/stdio/vfprintf.c Thu Jan 22 08:14:28 2009 (r187582) @@ -72,6 +72,75 @@ static char *__wcsconv(wchar_t *, int); #define CHAR char #include "printfcommon.h" +struct grouping_state { + char *thousands_sep; /* locale-specific thousands separator */ + int thousep_len; /* length of thousands_sep */ + const char *grouping; /* locale-specific numeric grouping rules */ + int lead; /* sig figs before decimal or group sep */ + int nseps; /* number of group separators with ' */ + int nrepeats; /* number of repeats of the last group */ +}; + +/* + * Initialize the thousands' grouping state in preparation to print a + * number with ndigits digits. This routine returns the total number + * of bytes that will be needed. + */ +static int +grouping_init(struct grouping_state *gs, int ndigits) +{ + struct lconv *locale; + + locale = localeconv(); + gs->grouping = locale->grouping; + gs->thousands_sep = locale->thousands_sep; + gs->thousep_len = strlen(gs->thousands_sep); + + gs->nseps = gs->nrepeats = 0; + gs->lead = ndigits; + while (*gs->grouping != CHAR_MAX) { + if (gs->lead <= *gs->grouping) + break; + gs->lead -= *gs->grouping; + if (*(gs->grouping+1)) { + gs->nseps++; + gs->grouping++; + } else + gs->nrepeats++; + } + return ((gs->nseps + gs->nrepeats) * gs->thousep_len); +} + +/* + * Print a number with thousands' separators. + */ +static int +grouping_print(struct grouping_state *gs, struct io_state *iop, + const CHAR *cp, const CHAR *ep) +{ + const CHAR *cp0 = cp; + + if (io_printandpad(iop, cp, ep, gs->lead, zeroes)) + return (-1); + cp += gs->lead; + while (gs->nseps > 0 || gs->nrepeats > 0) { + if (gs->nrepeats > 0) + gs->nrepeats--; + else { + gs->grouping--; + gs->nseps--; + } + if (io_print(iop, gs->thousands_sep, gs->thousep_len)) + return (-1); + if (io_printandpad(iop, cp, ep, *gs->grouping, zeroes)) + return (-1); + cp += *gs->grouping; + } + if (cp > ep) + cp = ep; + return (cp - cp0); +} + /* * Flush out all the vectors defined by the given uio, * then reset it so that it can be reused. @@ -210,12 +279,14 @@ vfprintf(FILE * __restrict fp, const cha /* * The size of the buffer we use as scratch space for integer - * conversions, among other things. Technically, we would need the - * most space for base 10 conversions with thousands' grouping - * characters between each pair of digits. 100 bytes is a - * conservative overestimate even for a 128-bit uintmax_t. + * conversions, among other things. We need enough space to + * write a uintmax_t in octal (plus one byte). */ -#define BUF 100 +#if UINTMAX_MAX <= UINT64_MAX +#define BUF 32 +#else +#error "BUF must be large enough to format a uintmax_t" +#endif /* * Non-MT-safe version @@ -232,8 +303,7 @@ __vfprintf(FILE *fp, const char *fmt0, v int width; /* width from format (%8d), or 0 */ int prec; /* precision from format; <0 for N/A */ char sign; /* sign prefix (' ', '+', '-', or \0) */ - char thousands_sep; /* locale specific thousands separator */ - const char *grouping; /* locale specific numeric grouping rules */ + struct grouping_state gs; /* thousands' grouping info */ #ifndef NO_FLOATING_POINT /* @@ -261,12 +331,9 @@ __vfprintf(FILE *fp, const char *fmt0, v char expchar; /* exponent character: [eEpP\0] */ char *dtoaend; /* pointer to end of converted digits */ int expsize; /* character count for expstr */ - int lead; /* sig figs before decimal or group sep */ int ndig; /* actual number of digits returned by dtoa */ char expstr[MAXEXPDIG+2]; /* buffer for exponent string: e+ZZZ */ char *dtoaresult; /* buffer allocated by dtoa */ - int nseps; /* number of group separators with ' */ - int nrepeats; /* number of repeats of the last group */ #endif u_long ulval; /* integer arguments %[diouxX] */ uintmax_t ujval; /* %j, %ll, %q, %t, %z integers */ @@ -378,8 +445,6 @@ __vfprintf(FILE *fp, const char *fmt0, v if (prepwrite(fp) != 0) return (EOF); - thousands_sep = '\0'; - grouping = NULL; convbuf = NULL; fmt = (char *)fmt0; argtable = NULL; @@ -416,6 +481,7 @@ __vfprintf(FILE *fp, const char *fmt0, v dprec = 0; width = 0; prec = -1; + gs.grouping = NULL; sign = '\0'; ox[1] = '\0'; @@ -453,8 +519,6 @@ reswitch: switch (ch) { goto rflag; case '\'': flags |= GROUPING; - thousands_sep = *(localeconv()->thousands_sep); - grouping = localeconv()->grouping; goto rflag; case '.': if ((ch = *fmt++) == '*') { @@ -685,23 +749,8 @@ fp_common: /* space for decimal pt and following digits */ if (prec || flags & ALT) size += prec + decpt_len; - if (grouping && expt > 0) { - /* space for thousands' grouping */ - nseps = nrepeats = 0; - lead = expt; - while (*grouping != CHAR_MAX) { - if (lead <= *grouping) - break; - lead -= *grouping; - if (*(grouping+1)) { - nseps++; - grouping++; - } else - nrepeats++; - } - size += nseps + nrepeats; - } else - lead = expt; + if ((flags & GROUPING) && expt > 0) + size += grouping_init(&gs, expt); } break; #endif /* !NO_FLOATING_POINT */ @@ -842,20 +891,18 @@ number: if ((dprec = prec) >= 0) if (ujval != 0 || prec != 0 || (flags & ALT && base == 8)) cp = __ujtoa(ujval, cp, base, - flags & ALT, xdigs, - flags & GROUPING, thousands_sep, - grouping); + flags & ALT, xdigs); } else { if (ulval != 0 || prec != 0 || (flags & ALT && base == 8)) cp = __ultoa(ulval, cp, base, - flags & ALT, xdigs, - flags & GROUPING, thousands_sep, - grouping); + flags & ALT, xdigs); } size = buf + BUF - cp; if (size > BUF) /* should never happen */ abort(); + if ((flags & GROUPING) && size != 0) + size += grouping_init(&gs, size); break; default: /* "%?" prints ?, unless ? is NUL */ if (ch == '\0') @@ -911,13 +958,19 @@ number: if ((dprec = prec) >= 0) if ((flags & (LADJUST|ZEROPAD)) == ZEROPAD) PAD(width - realsz, zeroes); - /* leading zeroes from decimal precision */ - PAD(dprec - size, zeroes); - /* the string or number proper */ #ifndef NO_FLOATING_POINT if ((flags & FPT) == 0) { - PRINT(cp, size); +#endif + /* leading zeroes from decimal precision */ + PAD(dprec - size, zeroes); + if (gs.grouping) { + if (grouping_print(&gs, &io, cp, buf+BUF) < 0) + goto error; + } else { + PRINT(cp, size); + } +#ifndef NO_FLOATING_POINT } else { /* glue together f_p fragments */ if (!expchar) { /* %[fF] or sufficiently short %[gG] */ if (expt <= 0) { @@ -928,24 +981,16 @@ number: if ((dprec = prec) >= 0) /* already handled initial 0's */ prec += expt; } else { - PRINTANDPAD(cp, dtoaend, lead, zeroes); - cp += lead; - if (grouping) { - while (nseps>0 || nrepeats>0) { - if (nrepeats > 0) - nrepeats--; - else { - grouping--; - nseps--; - } - PRINT(&thousands_sep, - 1); - PRINTANDPAD(cp,dtoaend, - *grouping, zeroes); - cp += *grouping; - } - if (cp > dtoaend) - cp = dtoaend; + if (gs.grouping) { + n = grouping_print(&gs, &io, + cp, dtoaend); + if (n < 0) + goto error; + cp += n; + } else { + PRINTANDPAD(cp, dtoaend, + expt, zeroes); + cp += expt; } if (prec || flags & ALT) PRINT(decimal_point,decpt_len); @@ -962,8 +1007,6 @@ number: if ((dprec = prec) >= 0) PRINT(expstr, expsize); } } -#else - PRINT(cp, size); #endif /* left-adjusting padding (always blank) */ if (flags & LADJUST) Modified: head/lib/libc/stdio/vfwprintf.c ============================================================================== --- head/lib/libc/stdio/vfwprintf.c Thu Jan 22 06:39:31 2009 (r187581) +++ head/lib/libc/stdio/vfwprintf.c Thu Jan 22 08:14:28 2009 (r187582) @@ -74,6 +74,14 @@ static wchar_t *__mbsconv(char *, int); #define CHAR wchar_t #include "printfcommon.h" +struct grouping_state { + wchar_t thousands_sep; /* locale-specific thousands separator */ + const char *grouping; /* locale-specific numeric grouping rules */ + int lead; /* sig figs before decimal or group sep */ + int nseps; /* number of group separators with ' */ + int nrepeats; /* number of repeats of the last group */ +}; + static const mbstate_t initial_mbs; static inline wchar_t @@ -90,6 +98,79 @@ get_decpt(void) return (decpt); } +static inline wchar_t +get_thousep(void) +{ + mbstate_t mbs; + wchar_t thousep; + int nconv; + + mbs = initial_mbs; + nconv = mbrtowc(&thousep, localeconv()->thousands_sep, + MB_CUR_MAX, &mbs); + if (nconv == (size_t)-1 || nconv == (size_t)-2) + thousep = '\0'; /* failsafe */ + return (thousep); +} + +/* + * Initialize the thousands' grouping state in preparation to print a + * number with ndigits digits. This routine returns the total number + * of wide characters that will be printed. + */ +static int +grouping_init(struct grouping_state *gs, int ndigits) +{ + + gs->grouping = localeconv()->grouping; + gs->thousands_sep = get_thousep(); + + gs->nseps = gs->nrepeats = 0; + gs->lead = ndigits; + while (*gs->grouping != CHAR_MAX) { + if (gs->lead <= *gs->grouping) + break; + gs->lead -= *gs->grouping; + if (*(gs->grouping+1)) { + gs->nseps++; + gs->grouping++; + } else + gs->nrepeats++; + } + return (gs->nseps + gs->nrepeats); +} + +/* + * Print a number with thousands' separators. + */ +static int +grouping_print(struct grouping_state *gs, struct io_state *iop, + const CHAR *cp, const CHAR *ep) +{ + const CHAR *cp0 = cp; + + if (io_printandpad(iop, cp, ep, gs->lead, zeroes)) + return (-1); + cp += gs->lead; + while (gs->nseps > 0 || gs->nrepeats > 0) { + if (gs->nrepeats > 0) + gs->nrepeats--; + else { + gs->grouping--; + gs->nseps--; + } + if (io_print(iop, &gs->thousands_sep, 1)) + return (-1); + if (io_printandpad(iop, cp, ep, *gs->grouping, zeroes)) + return (-1); + cp += *gs->grouping; + } + if (cp > ep) + cp = ep; + return (cp - cp0); +} + + /* * Flush out all the vectors defined by the given uio, * then reset it so that it can be reused. @@ -280,12 +361,14 @@ vfwprintf(FILE * __restrict fp, const wc /* * The size of the buffer we use as scratch space for integer - * conversions, among other things. Technically, we would need the - * most space for base 10 conversions with thousands' grouping - * characters between each pair of digits. 100 bytes is a - * conservative overestimate even for a 128-bit uintmax_t. + * conversions, among other things. We need enough space to + * write a uintmax_t in octal (plus one byte). */ -#define BUF 100 +#if UINTMAX_MAX <= UINT64_MAX +#define BUF 32 +#else +#error "BUF must be large enough to format a uintmax_t" +#endif /* * Non-MT-safe version @@ -302,8 +385,7 @@ __vfwprintf(FILE *fp, const wchar_t *fmt int width; /* width from format (%8d), or 0 */ int prec; /* precision from format; <0 for N/A */ wchar_t sign; /* sign prefix (' ', '+', '-', or \0) */ - wchar_t thousands_sep; /* locale specific thousands separator */ - const char *grouping; /* locale specific numeric grouping rules */ + struct grouping_state gs; /* thousands' grouping info */ #ifndef NO_FLOATING_POINT /* * We can decompose the printed representation of floating @@ -329,12 +411,9 @@ __vfwprintf(FILE *fp, const wchar_t *fmt char expchar; /* exponent character: [eEpP\0] */ char *dtoaend; /* pointer to end of converted digits */ int expsize; /* character count for expstr */ - int lead; /* sig figs before decimal or group sep */ int ndig; /* actual number of digits returned by dtoa */ wchar_t expstr[MAXEXPDIG+2]; /* buffer for exponent string: e+ZZZ */ char *dtoaresult; /* buffer allocated by dtoa */ - int nseps; /* number of group separators with ' */ - int nrepeats; /* number of repeats of the last group */ #endif u_long ulval; /* integer arguments %[diouxX] */ uintmax_t ujval; /* %j, %ll, %q, %t, %z integers */ @@ -442,8 +521,6 @@ __vfwprintf(FILE *fp, const wchar_t *fmt if (prepwrite(fp) != 0) return (EOF); - thousands_sep = '\0'; - grouping = NULL; convbuf = NULL; fmt = (wchar_t *)fmt0; argtable = NULL; @@ -477,6 +554,7 @@ __vfwprintf(FILE *fp, const wchar_t *fmt dprec = 0; width = 0; prec = -1; + gs.grouping = NULL; sign = '\0'; ox[1] = '\0'; @@ -514,8 +592,6 @@ reswitch: switch (ch) { goto rflag; case '\'': flags |= GROUPING; - thousands_sep = *(localeconv()->thousands_sep); - grouping = localeconv()->grouping; goto rflag; case '.': if ((ch = *fmt++) == '*') { @@ -739,23 +815,8 @@ fp_common: /* space for decimal pt and following digits */ if (prec || flags & ALT) size += prec + 1; - if (grouping && expt > 0) { - /* space for thousands' grouping */ - nseps = nrepeats = 0; - lead = expt; - while (*grouping != CHAR_MAX) { - if (lead <= *grouping) - break; - lead -= *grouping; - if (*(grouping+1)) { - nseps++; - grouping++; - } else - nrepeats++; - } - size += nseps + nrepeats; - } else - lead = expt; + if ((flags & GROUPING) && expt > 0) + size += grouping_init(&gs, expt); } break; #endif /* !NO_FLOATING_POINT */ @@ -899,20 +960,18 @@ number: if ((dprec = prec) >= 0) if (ujval != 0 || prec != 0 || (flags & ALT && base == 8)) cp = __ujtoa(ujval, cp, base, - flags & ALT, xdigs, - flags & GROUPING, thousands_sep, - grouping); + flags & ALT, xdigs); } else { if (ulval != 0 || prec != 0 || (flags & ALT && base == 8)) cp = __ultoa(ulval, cp, base, - flags & ALT, xdigs, - flags & GROUPING, thousands_sep, - grouping); + flags & ALT, xdigs); } size = buf + BUF - cp; if (size > BUF) /* should never happen */ abort(); + if ((flags & GROUPING) && size != 0) + size += grouping_init(&gs, size); break; default: /* "%?" prints ?, unless ? is NUL */ if (ch == '\0') @@ -968,13 +1027,19 @@ number: if ((dprec = prec) >= 0) if ((flags & (LADJUST|ZEROPAD)) == ZEROPAD) PAD(width - realsz, zeroes); - /* leading zeroes from decimal precision */ - PAD(dprec - size, zeroes); - /* the string or number proper */ #ifndef NO_FLOATING_POINT if ((flags & FPT) == 0) { - PRINT(cp, size); +#endif + /* leading zeroes from decimal precision */ + PAD(dprec - size, zeroes); + if (gs.grouping) { + if (grouping_print(&gs, &io, cp, buf+BUF) < 0) + goto error; + } else { + PRINT(cp, size); + } +#ifndef NO_FLOATING_POINT } else { /* glue together f_p fragments */ if (!expchar) { /* %[fF] or sufficiently short %[gG] */ if (expt <= 0) { @@ -985,25 +1050,16 @@ number: if ((dprec = prec) >= 0) /* already handled initial 0's */ prec += expt; } else { - PRINTANDPAD(cp, convbuf + ndig, lead, zeroes); - cp += lead; - if (grouping) { - while (nseps>0 || nrepeats>0) { - if (nrepeats > 0) - nrepeats--; - else { - grouping--; - nseps--; - } - PRINT(&thousands_sep, - 1); - PRINTANDPAD(cp, - convbuf + ndig, - *grouping, zeroes); - cp += *grouping; - } - if (cp > convbuf + ndig) - cp = convbuf + ndig; + if (gs.grouping) { + n = grouping_print(&gs, &io, + cp, convbuf + ndig); + if (n < 0) + goto error; + cp += n; + } else { + PRINTANDPAD(cp, convbuf + ndig, + expt, zeroes); + cp += expt; } if (prec || flags & ALT) PRINT(&decimal_point, 1); @@ -1021,8 +1077,6 @@ number: if ((dprec = prec) >= 0) PRINT(expstr, expsize); } } -#else - PRINT(cp, size); #endif /* left-adjusting padding (always blank) */ if (flags & LADJUST) From owner-svn-src-head@FreeBSD.ORG Thu Jan 22 08:29:39 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A55C106564A; Thu, 22 Jan 2009 08:29:39 +0000 (UTC) (envelope-from trhodes@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6E6C48FC23; Thu, 22 Jan 2009 08:29:39 +0000 (UTC) (envelope-from trhodes@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0M8TdwG005259; Thu, 22 Jan 2009 08:29:39 GMT (envelope-from trhodes@svn.freebsd.org) Received: (from trhodes@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0M8Tdnw005257; Thu, 22 Jan 2009 08:29:39 GMT (envelope-from trhodes@svn.freebsd.org) Message-Id: <200901220829.n0M8Tdnw005257@svn.freebsd.org> From: Tom Rhodes Date: Thu, 22 Jan 2009 08:29:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187583 - head/contrib/smbfs/mount_smbfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2009 08:29:40 -0000 Author: trhodes Date: Thu Jan 22 08:29:39 2009 New Revision: 187583 URL: http://svn.freebsd.org/changeset/base/187583 Log: Document the "-U" option. While it is not part of the getopt(), it is accepted through smb_ctx_init() in lib/smb/ctx.c. PR: 117013 Submitted by: Tom Evans (original version) Modified: head/contrib/smbfs/mount_smbfs/mount_smbfs.8 head/contrib/smbfs/mount_smbfs/mount_smbfs.c Modified: head/contrib/smbfs/mount_smbfs/mount_smbfs.8 ============================================================================== --- head/contrib/smbfs/mount_smbfs/mount_smbfs.8 Thu Jan 22 08:14:28 2009 (r187582) +++ head/contrib/smbfs/mount_smbfs/mount_smbfs.8 Thu Jan 22 08:29:39 2009 (r187583) @@ -1,6 +1,6 @@ .\" $Id: mount_smbfs.8,v 1.10 2002/04/16 02:47:41 bp Exp $ .\" $FreeBSD$ -.Dd March 10, 2000 +.Dd January 21, 2008 .Dt MOUNT_SMBFS 8 .Os .Sh NAME @@ -16,6 +16,7 @@ .Op Fl O Ar cowner : Ns Ar cgroup Ns / Ns Ar sowner : Ns Ar sgroup .Op Fl R Ar retrycount .Op Fl T Ar timeout +.Op Fl U Ar username .Op Fl W Ar workgroup .Op Fl c Ar case .Op Fl d Ar mode @@ -77,6 +78,8 @@ Default is 4. .It Fl T Ar timeout Timeout in seconds for each request. Default is 15. +.It Fl U Ar username +Username to authenticate with. .It Fl W Ar workgroup This option specifies the workgroup to be used in the authentication request. .It Fl c Ar case Modified: head/contrib/smbfs/mount_smbfs/mount_smbfs.c ============================================================================== --- head/contrib/smbfs/mount_smbfs/mount_smbfs.c Thu Jan 22 08:14:28 2009 (r187582) +++ head/contrib/smbfs/mount_smbfs/mount_smbfs.c Thu Jan 22 08:29:39 2009 (r187583) @@ -295,7 +295,7 @@ usage(void) "usage: mount_smbfs [-E cs1:cs2] [-I host] [-L locale] [-M crights:srights]", " [-N] [-O cowner:cgroup/sowner:sgroup] [-R retrycount]", " [-T timeout] [-W workgroup] [-c case] [-d mode] [-f mode]", - " [-g gid] [-n opt] [-u uid] //user@server/share node"); + " [-g gid] [-n opt] [-u uid] [-U username] //user@server/share node"); exit (1); } From owner-svn-src-head@FreeBSD.ORG Thu Jan 22 09:18:43 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0D41106566B for ; Thu, 22 Jan 2009 09:18:43 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from mx0.deglitch.com (backbone.deglitch.com [IPv6:2001:16d8:fffb:4::abba]) by mx1.freebsd.org (Postfix) with ESMTP id 5436A8FC13 for ; Thu, 22 Jan 2009 09:18:43 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from DSPAM-Daemon (localhost [127.0.0.1]) by mx0.deglitch.com (Postfix) with SMTP id 604168FC52 for ; Thu, 22 Jan 2009 12:18:42 +0300 (MSK) Received: from orion.SpringDaemons.com (drsun1.dialup.corbina.ru [85.21.245.235]) by mx0.deglitch.com (Postfix) with ESMTPA id 2728A8FC18; Thu, 22 Jan 2009 12:18:38 +0300 (MSK) Received: from orion (localhost [127.0.0.1]) by orion.SpringDaemons.com (Postfix) with SMTP id D97A8398F3; Thu, 22 Jan 2009 12:18:37 +0300 (MSK) Date: Thu, 22 Jan 2009 12:18:37 +0300 From: Stanislav Sedov To: Garrett Cooper Message-Id: <20090122121837.c647f497.stas@FreeBSD.org> In-Reply-To: <7d6fde3d0901200052w20755420l94f0c02c547f53b7@mail.gmail.com> References: <200901191619.n0JGJrhJ015123@svn.freebsd.org> <20090119.181322.-625070925.imp@bsdimp.com> <7d6fde3d0901200052w20755420l94f0c02c547f53b7@mail.gmail.com> Organization: The FreeBSD Project X-XMPP: ssedov@jabber.ru X-Voice: +7 916 849 20 23 X-PGP-Fingerprint: F21E D6CC 5626 9609 6CE2 A385 2BF5 5993 EB26 9581 X-Mailer: carrier-pigeon Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-DSPAM-Result: Whitelisted X-DSPAM-Processed: Thu Jan 22 12:18:42 2009 X-DSPAM-Confidence: 0.9899 X-DSPAM-Improbability: 1 in 9809 chance of being spam X-DSPAM-Probability: 0.0000 X-DSPAM-Signature: 497839f2967001994737060 Cc: svn-src-head@freebsd.org, sobomax@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, "M. Warner Losh" Subject: Re: svn commit: r187437 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2009 09:18:44 -0000 On Tue, 20 Jan 2009 00:52:28 -0800 Garrett Cooper mentioned: > On Mon, Jan 19, 2009 at 5:13 PM, M. Warner Losh wrote: > > In message: <200901191619.n0JGJrhJ015123@svn.freebsd.org> > > Maxim Sobolev writes: > > : Author: sobomax > > : Date: Mon Jan 19 16:19:53 2009 > > : New Revision: 187437 > > : URL: http://svn.freebsd.org/changeset/base/187437 > > : > > : Log: > > : Mention the fact that the NTFS kernel support isn't > > : very well maintained and point user to sysutils/fusefs-ntfs, which > > : at the time of this writing seems to be a better alternative. > > : > > : Suggested by: luigi > > : MFC after: 2 weeks > > > > Again, I'd not MFC this to 6.x for sure and maybe not even to 7.x > > since ntfs works well there. > > > > Warner > > > > : Modified: > > : head/sys/conf/NOTES > > : > > : Modified: head/sys/conf/NOTES > > : ============================================================================== > > : --- head/sys/conf/NOTES Mon Jan 19 15:59:05 2009 (r187436) > > : +++ head/sys/conf/NOTES Mon Jan 19 16:19:53 2009 (r187437) > > : @@ -942,7 +942,11 @@ options HPFS #OS/2 File system > > : options MSDOSFS #MS DOS File System (FAT, FAT32) > > : options NFSSERVER #Network File System server > > : options NFSLOCKD #Network Lock Manager > > : -options NTFS #NT File System > > : + > > : +# NT File System. Read-mostly and it's not actively maintained. > > : +# For a better NTFS support consider sysutils/fusefs-ntfs port/package. > > : +options NTFS > > : + > > : options NULLFS #NULL filesystem > > : # Broken (depends on NCP): > > : #options NWFS #NetWare filesystem > > Uh, I got consistent panics on 7.x when mounting NTFS partitions > created with XP. > I was creating the partition without MSDOS 8.3 short filename > support though. I personally think that the copy of NTFS in the kernel > is stale and unusable for a lot of different use-cases, to be honest.. But it works well for a lot of cases (e.g. works fine for me on current with Vista NTFS) and much better in some situations than fuse. Thus the latter can't replace its functionality fully. We'd better fix bugs you're experiencing (btw I haven't seen any with ntfs driver so far). -- Stanislav Sedov ST4096-RIPE !DSPAM:497839f2967001994737060! From owner-svn-src-head@FreeBSD.ORG Thu Jan 22 10:29:10 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28213106564A; Thu, 22 Jan 2009 10:29:10 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1728A8FC16; Thu, 22 Jan 2009 10:29:10 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0MAT91d007518; Thu, 22 Jan 2009 10:29:09 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0MAT99j007517; Thu, 22 Jan 2009 10:29:09 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200901221029.n0MAT99j007517@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 22 Jan 2009 10:29:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187585 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2009 10:29:11 -0000 Author: bz Date: Thu Jan 22 10:29:09 2009 New Revision: 187585 URL: http://svn.freebsd.org/changeset/base/187585 Log: Add externs to fix build with VIMAGE_GLOBALS after r187289. Modified: head/sys/netinet/tcp_var.h Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Thu Jan 22 09:39:11 2009 (r187584) +++ head/sys/netinet/tcp_var.h Thu Jan 22 10:29:09 2009 (r187585) @@ -540,6 +540,8 @@ extern int tcp_insecure_rst; extern int tcp_do_autorcvbuf; extern int tcp_autorcvbuf_inc; extern int tcp_autorcvbuf_max; +extern int tcp_do_rfc3465; +extern int tcp_abc_l_var; extern int tcp_do_tso; extern int tcp_do_autosndbuf; From owner-svn-src-head@FreeBSD.ORG Thu Jan 22 11:24:43 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F30DB106566B; Thu, 22 Jan 2009 11:24:42 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DF2B98FC19; Thu, 22 Jan 2009 11:24:42 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0MBOg5u011305; Thu, 22 Jan 2009 11:24:42 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0MBOgPs011300; Thu, 22 Jan 2009 11:24:42 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200901221124.n0MBOgPs011300@svn.freebsd.org> From: Edwin Groothuis Date: Thu, 22 Jan 2009 11:24:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187588 - head/share/zoneinfo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2009 11:24:43 -0000 Author: edwin Date: Thu Jan 22 11:24:42 2009 New Revision: 187588 URL: http://svn.freebsd.org/changeset/base/187588 Log: MFV of tzdata2009a - Asia/Katmandu -> Asia/Kathmandu - Fix historical references to DST in Switzerland - Correct rules for America/Resolute (Nunavut) - Cuba didn't have DST in 2005. MFC after: 1 week Modified: head/share/zoneinfo/ (props changed) head/share/zoneinfo/asia head/share/zoneinfo/backward head/share/zoneinfo/europe head/share/zoneinfo/northamerica head/share/zoneinfo/zone.tab Modified: head/share/zoneinfo/asia ============================================================================== --- head/share/zoneinfo/asia Thu Jan 22 11:22:01 2009 (r187587) +++ head/share/zoneinfo/asia Thu Jan 22 11:24:42 2009 (r187588) @@ -1,4 +1,4 @@ -# @(#)asia 8.24 +# @(#)asia 8.25 #
 
 # This data is by no means authoritative; if you think you know better,
@@ -1474,7 +1474,7 @@ Zone	Asia/Choibalsan	7:38:00 -	LMT	1905 
 
 # Nepal
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Asia/Katmandu	5:41:16 -	LMT	1920
+Zone	Asia/Kathmandu	5:41:16 -	LMT	1920
 			5:30	-	IST	1986
 			5:45	-	NPT	# Nepal Time
 

Modified: head/share/zoneinfo/backward
==============================================================================
--- head/share/zoneinfo/backward	Thu Jan 22 11:22:01 2009	(r187587)
+++ head/share/zoneinfo/backward	Thu Jan 22 11:24:42 2009	(r187588)
@@ -1,4 +1,4 @@
-# @(#)backward	8.6
+# @(#)backward	8.7
 
 # This file provides links between current names for time zones
 # and their old names.  Many names changed in late 1993.
@@ -24,6 +24,7 @@ Link	America/St_Thomas	America/Virgin
 Link	Asia/Ashgabat		Asia/Ashkhabad
 Link	Asia/Chongqing		Asia/Chungking
 Link	Asia/Dhaka		Asia/Dacca
+Link	Asia/Kathmandu		Asia/Katmandu
 Link	Asia/Kolkata		Asia/Calcutta
 Link	Asia/Macau		Asia/Macao
 Link	Asia/Jerusalem		Asia/Tel_Aviv

Modified: head/share/zoneinfo/europe
==============================================================================
--- head/share/zoneinfo/europe	Thu Jan 22 11:22:01 2009	(r187587)
+++ head/share/zoneinfo/europe	Thu Jan 22 11:24:42 2009	(r187588)
@@ -1,4 +1,4 @@
-# @(#)europe	8.18
+# @(#)europe	8.20
 # 
 
 # This data is by no means authoritative; if you think you know better,
@@ -2313,11 +2313,64 @@ Zone Europe/Stockholm	1:12:12 -	LMT	1879
 # mean time in preference to apparent time -- Geneva from 1780 ....
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 # From Whitman (who writes ``Midnight?''):
-Rule	Swiss	1940	only	-	Nov	 2	0:00	1:00	S
-Rule	Swiss	1940	only	-	Dec	31	0:00	0	-
+# Rule	Swiss	1940	only	-	Nov	 2	0:00	1:00	S
+# Rule	Swiss	1940	only	-	Dec	31	0:00	0	-
 # From Shanks & Pottenger:
-Rule	Swiss	1941	1942	-	May	Sun>=1	2:00	1:00	S
-Rule	Swiss	1941	1942	-	Oct	Sun>=1	0:00	0	-
+# Rule	Swiss	1941	1942	-	May	Sun>=1	2:00	1:00	S
+# Rule	Swiss	1941	1942	-	Oct	Sun>=1	0:00	0	-
+
+# From Alois Treindl (2008-12-17):
+# I have researched the DST usage in Switzerland during the 1940ies.
+#
+# As I wrote in an earlier message, I suspected the current tzdata values
+# to be wrong. This is now verified.
+#
+# I have found copies of the original ruling by the Swiss Federal
+# government, in 'Eidgen[o]ssische Gesetzessammlung 1941 and 1942' (Swiss
+# federal law collection)...
+#
+# DST began on Monday 5 May 1941, 1:00 am by shifting the clocks to 2:00 am
+# DST ended on Monday 6 Oct 1941, 2:00 am by shifting the clocks to 1:00 am.
+#
+# DST began on Monday, 4 May 1942 at 01:00 am
+# DST ended on Monday, 5 Oct 1942 at 02:00 am
+#
+# There was no DST in 1940, I have checked the law collection carefully.
+# It is also indicated by the fact that the 1942 entry in the law
+# collection points back to 1941 as a reference, but no reference to any
+# other years are made.
+#
+# Newspaper articles I have read in the archives on 6 May 1941 reported
+# about the introduction of DST (Sommerzeit in German) during the previous
+# night as an absolute novelty, because this was the first time that such
+# a thing had happened in Switzerland.
+#
+# I have also checked 1916, because one book source (Gabriel, Traite de
+# l'heure dans le monde) claims that Switzerland had DST in 1916. This is
+# false, no official document could be found. Probably Gabriel got misled
+# by references to Germany, which introduced DST in 1916 for the first time.
+#
+# The tzdata rules for Switzerland must be changed to:
+# Rule  Swiss   1941    1942    -       May     Mon>=1  1:00    1:00    S
+# Rule  Swiss   1941    1942    -       Oct     Mon>=1  2:00    0       -
+#
+# The 1940 rules must be deleted.
+#
+# One further detail for Switzerland, which is probably out of scope for
+# most users of tzdata:
+# The zone file
+# Zone    Europe/Zurich   0:34:08 -       LMT     1848 Sep 12
+#                          0:29:44 -       BMT     1894 Jun #Bern Mean Time
+#                          1:00    Swiss   CE%sT   1981
+#                          1:00    EU      CE%sT
+# describes all of Switzerland correctly, with the exception of
+# the Cantone Geneve (Geneva, Genf). Between 1848 and 1894 Geneve did not
+# follow Bern Mean Time but kept its own local mean time.
+# To represent this, an extra zone would be needed.
+
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Swiss	1941	1942	-	May	Mon>=1	1:00	1:00	S
+Rule	Swiss	1941	1942	-	Oct	Mon>=1	2:00	0	-
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Europe/Zurich	0:34:08 -	LMT	1848 Sep 12
 			0:29:44	-	BMT	1894 Jun # Bern Mean Time

Modified: head/share/zoneinfo/northamerica
==============================================================================
--- head/share/zoneinfo/northamerica	Thu Jan 22 11:22:01 2009	(r187587)
+++ head/share/zoneinfo/northamerica	Thu Jan 22 11:24:42 2009	(r187588)
@@ -1,4 +1,4 @@
-# @(#)northamerica	8.24
+# @(#)northamerica	8.26
 # 
 
 # also includes Central America and the Caribbean
@@ -1742,9 +1742,13 @@ Zone America/Dawson_Creek -8:00:56 -	LMT
 # The individual that answered the phone confirmed that the clocks did not
 # move at the end of daylight saving on October 29/2006.  He also told me that
 # the clocks did not move this past weekend (March 11/2007)....
-#
-# America/Resolute should use the "Canada" Rule up to October 29/2006.
-# After that it should be fixed on Eastern Standard Time until further notice.
+
+# From Chris Walton (2008-11-13):
+# ...the residents of Resolute believe that they are changing "time zones"
+# twice a year.  In winter months, local time is qualified with "Eastern
+# Time" which is really "Eastern Standard Time (UTC-5)".  In summer
+# months, local time is qualified with "Central Time" which is really
+# "Central Daylight Time (UTC-5)"...
 
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	NT_YK	1918	only	-	Apr	14	2:00	1:00	D
@@ -1772,11 +1776,14 @@ Zone America/Iqaluit	0	-	zzz	1942 Aug # 
 			-6:00	Canada	C%sT	2000 Oct 29 2:00
 			-5:00	Canada	E%sT
 # aka Qausuittuq
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Resolute 2006	max	-	Nov	Sun>=1	2:00	0	ES
+Rule	Resolute 2007	max	-	Mar	Sun>=8	2:00	0	CD
 Zone America/Resolute	0	-	zzz	1947 Aug 31 # Resolute founded
 			-6:00	NT_YK	C%sT	2000 Oct 29 2:00
 			-5:00	-	EST	2001 Apr  1 3:00
 			-6:00	Canada	C%sT	2006 Oct 29 2:00
-			-5:00	-	EST
+			-5:00	Resolute	%sT
 # aka Kangiqiniq
 Zone America/Rankin_Inlet 0	-	zzz	1957 # Rankin Inlet founded
 			-6:00	NT_YK	C%sT	2000 Oct 29 2:00
@@ -2280,7 +2287,7 @@ Rule	Cuba	1996	only	-	Oct	 6	0:00s	0	S
 Rule	Cuba	1997	only	-	Oct	12	0:00s	0	S
 Rule	Cuba	1998	1999	-	Mar	lastSun	0:00s	1:00	D
 Rule	Cuba	1998	2003	-	Oct	lastSun	0:00s	0	S
-Rule	Cuba	2000	2006	-	Apr	Sun>=1	0:00s	1:00	D
+Rule	Cuba	2000	2004	-	Apr	Sun>=1	0:00s	1:00	D
 Rule	Cuba	2006	max	-	Oct	lastSun	0:00s	0	S
 Rule	Cuba	2007	only	-	Mar	Sun>=8	0:00s	1:00	D
 Rule	Cuba	2008	max	-	Mar	Sun>=15	0:00s	1:00	D

Modified: head/share/zoneinfo/zone.tab
==============================================================================
--- head/share/zoneinfo/zone.tab	Thu Jan 22 11:22:01 2009	(r187587)
+++ head/share/zoneinfo/zone.tab	Thu Jan 22 11:24:42 2009	(r187588)
@@ -1,4 +1,4 @@
-# @(#)zone.tab	8.21
+# @(#)zone.tab	8.26
 #
 # TZ zone descriptions
 #
@@ -116,7 +116,7 @@ CA	+4901-08816	America/Nipigon	Eastern T
 CA	+4823-08915	America/Thunder_Bay	Eastern Time - Thunder Bay, Ontario
 CA	+6344-06828	America/Iqaluit	Eastern Time - east Nunavut - most locations
 CA	+6608-06544	America/Pangnirtung	Eastern Time - Pangnirtung, Nunavut
-CA	+744144-0944945	America/Resolute	Eastern Time - Resolute, Nunavut
+CA	+744144-0944945	America/Resolute	Eastern Standard Time - Resolute, Nunavut
 CA	+484531-0913718	America/Atikokan	Eastern Standard Time - Atikokan, Ontario and Southampton I, Nunavut
 CA	+624900-0920459	America/Rankin_Inlet	Central Time - central Nunavut
 CA	+4953-09709	America/Winnipeg	Central Time - Manitoba & west Ontario
@@ -292,7 +292,7 @@ NG	+0627+00324	Africa/Lagos
 NI	+1209-08617	America/Managua
 NL	+5222+00454	Europe/Amsterdam
 NO	+5955+01045	Europe/Oslo
-NP	+2743+08519	Asia/Katmandu
+NP	+2743+08519	Asia/Kathmandu
 NR	-0031+16655	Pacific/Nauru
 NU	-1901-16955	Pacific/Niue
 NZ	-3652+17446	Pacific/Auckland	most locations

From owner-svn-src-head@FreeBSD.ORG  Thu Jan 22 15:35:55 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3F8ED1065673;
	Thu, 22 Jan 2009 15:35:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2F9D68FC16;
	Thu, 22 Jan 2009 15:35:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0MFZs12015986;
	Thu, 22 Jan 2009 15:35:54 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0MFZspe015985;
	Thu, 22 Jan 2009 15:35:54 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <200901221535.n0MFZspe015985@svn.freebsd.org>
From: John Baldwin 
Date: Thu, 22 Jan 2009 15:35:54 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r187591 - head/sys/dev/ppbus
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 22 Jan 2009 15:35:55 -0000

Author: jhb
Date: Thu Jan 22 15:35:54 2009
New Revision: 187591
URL: http://svn.freebsd.org/changeset/base/187591

Log:
  Fix a compile bogon.  'ppbus' is used by two different sets of debug code
  in lptout().
  
  Reported by:	several

Modified:
  head/sys/dev/ppbus/lpt.c

Modified: head/sys/dev/ppbus/lpt.c
==============================================================================
--- head/sys/dev/ppbus/lpt.c	Thu Jan 22 14:30:35 2009	(r187590)
+++ head/sys/dev/ppbus/lpt.c	Thu Jan 22 15:35:54 2009	(r187591)
@@ -447,7 +447,9 @@ lptout(void *arg)
 {
 	struct lpt_data *sc = arg;
 	device_t dev = sc->sc_dev;
+#if defined(INVARIANTS) || defined(LPT_DEBUG)
 	device_t ppbus = device_get_parent(dev);
+#endif
 
 	ppb_assert_locked(ppbus);
 	lprintf(("T %x ", ppb_rstr(ppbus)));

From owner-svn-src-head@FreeBSD.ORG  Thu Jan 22 15:36:12 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 859121065692;
	Thu, 22 Jan 2009 15:36:12 +0000 (UTC)
	(envelope-from cognet@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 753628FC32;
	Thu, 22 Jan 2009 15:36:12 +0000 (UTC)
	(envelope-from cognet@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0MFaCOL016028;
	Thu, 22 Jan 2009 15:36:12 GMT (envelope-from cognet@svn.freebsd.org)
Received: (from cognet@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0MFaCb0016027;
	Thu, 22 Jan 2009 15:36:12 GMT (envelope-from cognet@svn.freebsd.org)
Message-Id: <200901221536.n0MFaCb0016027@svn.freebsd.org>
From: Olivier Houchard 
Date: Thu, 22 Jan 2009 15:36:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r187592 - head/sys/arm/include
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 22 Jan 2009 15:36:15 -0000

Author: cognet
Date: Thu Jan 22 15:36:11 2009
New Revision: 187592
URL: http://svn.freebsd.org/changeset/base/187592

Log:
  Add a comment explaining what ARM_KERN_DIRECTMAP is all about.
  
  Suggested by:	raj

Modified:
  head/sys/arm/include/vmparam.h

Modified: head/sys/arm/include/vmparam.h
==============================================================================
--- head/sys/arm/include/vmparam.h	Thu Jan 22 15:35:54 2009	(r187591)
+++ head/sys/arm/include/vmparam.h	Thu Jan 22 15:36:11 2009	(r187592)
@@ -97,6 +97,13 @@
 
 #define VM_MIN_ADDRESS          (0x00001000)
 #ifdef ARM_USE_SMALL_ALLOC
+/* 
+ * ARM_KERN_DIRECTMAP is used to make sure there's enough space between
+ * VM_MAXUSER_ADDRESS and KERNBASE to map the whole memory.
+ * It has to be a compile-time constant, even if arm_init_smallalloc(),
+ * which will do the mapping, gets the real amount of memory at runtime,
+ * because VM_MAXUSER_ADDRESS is a constant.
+ */
 #ifndef ARM_KERN_DIRECTMAP
 #define ARM_KERN_DIRECTMAP 512 * 1024 * 1024 /* 512 MB */
 #endif

From owner-svn-src-head@FreeBSD.ORG  Thu Jan 22 15:41:54 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E36FA1065670;
	Thu, 22 Jan 2009 15:41:54 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42])
	by mx1.freebsd.org (Postfix) with ESMTP id B61078FC18;
	Thu, 22 Jan 2009 15:41:54 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from server.baldwin.cx (pool-98-109-39-197.nwrknj.fios.verizon.net
	[98.109.39.197])
	by cyrus.watson.org (Postfix) with ESMTPSA id 5AF0E46B0C;
	Thu, 22 Jan 2009 10:41:54 -0500 (EST)
Received: from localhost (john@localhost [127.0.0.1]) (authenticated bits=0)
	by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id n0MFfgo0043174;
	Thu, 22 Jan 2009 10:41:48 -0500 (EST) (envelope-from jhb@freebsd.org)
From: John Baldwin 
To: Jeff Roberson 
Date: Thu, 22 Jan 2009 10:16:57 -0500
User-Agent: KMail/1.9.7
References: <200901212310.n0LNA6cM093944@svn.freebsd.org>
	<20090121204615.H983@desktop>
In-Reply-To: <20090121204615.H983@desktop>
MIME-Version: 1.0
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200901221016.58349.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by
	milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]);
	Thu, 22 Jan 2009 10:41:48 -0500 (EST)
X-Virus-Scanned: ClamAV 0.94.2/8892/Thu Jan 22 09:34:53 2009 on
	server.baldwin.cx
X-Virus-Status: Clean
X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 
	autolearn=ham version=3.1.3
X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r187576 - in head/sys/dev: ppbus ppc
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 22 Jan 2009 15:41:55 -0000

On Thursday 22 January 2009 1:48:43 am Jeff Roberson wrote:
> On Wed, 21 Jan 2009, John Baldwin wrote:
> 
> > Author: jhb
> > Date: Wed Jan 21 23:10:06 2009
> > New Revision: 187576
> > URL: http://svn.freebsd.org/changeset/base/187576
> >
> > Log:
> >  Add locking to ppc and ppbus and mark the whole lot MPSAFE:
> 
> Looks like there might be some kinks still:
> 
> ppc0:  port 0x378-0x37f,0x778-0x77f irq 7 drq 3 on acpi0
> ppc0: SMC-like chipset (ECP/EPP/PS2/NIBBLE) in COMPATIBLE mode
> ppc0: FIFO with 16/16/9 bytes threshold
> ppc0: [ITHREAD]
> ppbus0:  on ppc0
> panic: mutex ppc0 not owned at ../../../dev/ppc/ppc.c:1983
> cpuid = 0
> KDB: enter: panic
> [thread pid 0 tid 100000 ]
> Stopped at      kdb_enter+0x3d: movq    $0,0x652ea8(%rip)
> _mtx_assert() at _mtx_assert+0xdc
> ppc_write_ivar() at ppc_write_ivar+0x6e
> ppbus_attach() at ppbus_attach+0x14b

Grrr, I had booted this a while ago.  This should fix that particular 
assertion:

--- //depot/user/jhb/acpipci/dev/ppbus/ppbconf.c#20
+++ /home/jhb/work/p4/acpipci/dev/ppbus/ppbconf.c
@@ -393,8 +393,10 @@
 	ppb->ppc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid,
 	    RF_SHAREABLE);
 	if (ppb->ppc_irq_res != NULL) {
+		mtx_lock(ppb->ppc_lock);
 		error = BUS_WRITE_IVAR(device_get_parent(dev), dev,
 		    PPC_IVAR_INTR_HANDLER, (uintptr_t)&ppbus_intr);
+		mtx_unlock(ppb->ppc_lock);
 		if (error) {
 			device_printf(dev, "Unable to set interrupt handler\n");
 			return (error);

-- 
John Baldwin

From owner-svn-src-head@FreeBSD.ORG  Thu Jan 22 17:06:34 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 17949106567C;
	Thu, 22 Jan 2009 17:06:34 +0000 (UTC)
	(envelope-from jkim@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id EB30A8FC1A;
	Thu, 22 Jan 2009 17:06:33 +0000 (UTC)
	(envelope-from jkim@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0MH6XLD017770;
	Thu, 22 Jan 2009 17:06:33 GMT (envelope-from jkim@svn.freebsd.org)
Received: (from jkim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0MH6XN1017768;
	Thu, 22 Jan 2009 17:06:33 GMT (envelope-from jkim@svn.freebsd.org)
Message-Id: <200901221706.n0MH6XN1017768@svn.freebsd.org>
From: Jung-uk Kim 
Date: Thu, 22 Jan 2009 17:06:33 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r187594 - in head/sys: compat/linprocfs i386/cpufreq
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 22 Jan 2009 17:06:44 -0000

Author: jkim
Date: Thu Jan 22 17:06:33 2009
New Revision: 187594
URL: http://svn.freebsd.org/changeset/base/187594

Log:
  Replace couple of strcmp(cpu_vendor, "foo") with cpu_vendor_id for i386
  and hide i386-specific code under #ifdef.

Modified:
  head/sys/compat/linprocfs/linprocfs.c
  head/sys/i386/cpufreq/smist.c

Modified: head/sys/compat/linprocfs/linprocfs.c
==============================================================================
--- head/sys/compat/linprocfs/linprocfs.c	Thu Jan 22 15:52:13 2009	(r187593)
+++ head/sys/compat/linprocfs/linprocfs.c	Thu Jan 22 17:06:33 2009	(r187594)
@@ -276,11 +276,17 @@ linprocfs_docpuinfo(PFS_FILL_ARGS)
 
 	sbuf_cat(sb, "flags\t\t:");
 
-	if (!strcmp(cpu_vendor, "AuthenticAMD") && (class < 6)) {
-		flags[16] = "fcmov";
-	} else if (!strcmp(cpu_vendor, "CyrixInstead")) {
+#ifdef __i386__
+	switch (cpu_vendor_id) {
+	case CPU_VENDOR_AMD:
+		if (class < 6)
+			flags[16] = "fcmov";
+		break;
+	case CPU_VENDOR_CYRIX:
 		flags[24] = "cxmmx";
+		break;
 	}
+#endif
 
 	for (i = 0; i < 32; i++)
 		if (cpu_feature & (1 << i))

Modified: head/sys/i386/cpufreq/smist.c
==============================================================================
--- head/sys/i386/cpufreq/smist.c	Thu Jan 22 15:52:13 2009	(r187593)
+++ head/sys/i386/cpufreq/smist.c	Thu Jan 22 17:06:33 2009	(r187594)
@@ -285,7 +285,7 @@ smist_identify(driver_t *driver, device_
 		return;
 
 	/* Check for a supported processor */
-	if (strcmp(cpu_vendor, "GenuineIntel") != 0)
+	if (cpu_vendor_id != CPU_VENDOR_INTEL)
 		return;
 	switch (cpu_id & 0xff0) {
 	case 0x680:	/* Pentium III [coppermine] */

From owner-svn-src-head@FreeBSD.ORG  Thu Jan 22 17:41:57 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5DDDF106566C;
	Thu, 22 Jan 2009 17:41:57 +0000 (UTC) (envelope-from imp@bsdimp.com)
Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85])
	by mx1.freebsd.org (Postfix) with ESMTP id 079B28FC1A;
	Thu, 22 Jan 2009 17:41:56 +0000 (UTC) (envelope-from imp@bsdimp.com)
Received: from localhost (localhost [127.0.0.1])
	by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id n0MHeZqS049487;
	Thu, 22 Jan 2009 10:40:35 -0700 (MST) (envelope-from imp@bsdimp.com)
Date: Thu, 22 Jan 2009 10:41:14 -0700 (MST)
Message-Id: <20090122.104114.1927899760.imp@bsdimp.com>
To: jeff@FreeBSD.org
From: "M. Warner Losh" 
In-Reply-To: <200901220621.n0M6LU5v002745@svn.freebsd.org>
References: <200901220621.n0M6LU5v002745@svn.freebsd.org>
X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org
Subject: Re: svn commit: r187580 - head/tools/sched
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 22 Jan 2009 17:41:57 -0000

In message: <200901220621.n0M6LU5v002745@svn.freebsd.org>
            Jeff Roberson  writes:
: Author: jeff
: Date: Thu Jan 22 06:21:30 2009
: New Revision: 187580
: URL: http://svn.freebsd.org/changeset/base/187580
: 
: Log:
:    - Update my copyright.
: +# Copyright (c) 2002-2003, 2009, Jeffrey Roberson 

Stylistically, this should be 2002-2009.  We don't need to list each
and every year, so the project's policy is to list the earliest and
the latest year.

See, for example, http://www.oppedahl.com/copyrights/ for the
reasoning behind this.

Warner

From owner-svn-src-head@FreeBSD.ORG  Thu Jan 22 18:48:03 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BDEBC1065670;
	Thu, 22 Jan 2009 18:48:03 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42])
	by mx1.freebsd.org (Postfix) with ESMTP id 960D48FC26;
	Thu, 22 Jan 2009 18:48:03 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from fledge.watson.org (fledge.watson.org [65.122.17.41])
	by cyrus.watson.org (Postfix) with ESMTPS id 380ED46B09;
	Thu, 22 Jan 2009 13:48:03 -0500 (EST)
Date: Thu, 22 Jan 2009 18:48:03 +0000 (GMT)
From: Robert Watson 
X-X-Sender: robert@fledge.watson.org
To: "M. Warner Losh" 
In-Reply-To: <20090122.104114.1927899760.imp@bsdimp.com>
Message-ID: 
References: <200901220621.n0M6LU5v002745@svn.freebsd.org>
	<20090122.104114.1927899760.imp@bsdimp.com>
User-Agent: Alpine 2.00 (BSF 1167 2008-08-23)
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: svn-src-head@FreeBSD.org, jeff@FreeBSD.org, src-committers@FreeBSD.org,
	svn-src-all@FreeBSD.org
Subject: Re: svn commit: r187580 - head/tools/sched
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 22 Jan 2009 18:48:05 -0000

On Thu, 22 Jan 2009, M. Warner Losh wrote:

> In message: <200901220621.n0M6LU5v002745@svn.freebsd.org>
>            Jeff Roberson  writes:
> : Author: jeff
> : Date: Thu Jan 22 06:21:30 2009
> : New Revision: 187580
> : URL: http://svn.freebsd.org/changeset/base/187580
> :
> : Log:
> :    - Update my copyright.
> : +# Copyright (c) 2002-2003, 2009, Jeffrey Roberson 
>
> Stylistically, this should be 2002-2009.  We don't need to list each and 
> every year, so the project's policy is to list the earliest and the latest 
> year.
>
> See, for example, http://www.oppedahl.com/copyrights/ for the reasoning 
> behind this.

FWIW, the one case where I don't really do that is when I worked on some code 
on my own and hence hold the copyright for it, then did some work under a 
contract for a customer on it such that they own the copyright on 
enhancements, and then I do some further work on my own.  In that case, I'll 
leave a discontinuity to reflect the fact that the copyright on changes made 
in the gap were assigned elsewhere.  Not clear this is the right thing to do, 
but I'm fairly sure at least some of my customers are more comfortable with 
that as it leaves no confusion in the source as to which bits they 
sponsored/own.

Robert N M Watson
Computer Laboratory
University of Cambridge

From owner-svn-src-head@FreeBSD.ORG  Thu Jan 22 19:42:27 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 43FF010656CE;
	Thu, 22 Jan 2009 19:42:27 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from pele.citylink.co.nz (pele.citylink.co.nz [202.8.44.226])
	by mx1.freebsd.org (Postfix) with ESMTP id 008C28FC29;
	Thu, 22 Jan 2009 19:42:26 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from localhost (localhost [127.0.0.1])
	by pele.citylink.co.nz (Postfix) with ESMTP id 647D9FEEE;
	Fri, 23 Jan 2009 08:42:26 +1300 (NZDT)
X-Virus-Scanned: Debian amavisd-new at citylink.co.nz
Received: from pele.citylink.co.nz ([127.0.0.1])
	by localhost (pele.citylink.co.nz [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id I9qKDwte7fVN; Fri, 23 Jan 2009 08:42:23 +1300 (NZDT)
Received: from citylink.fud.org.nz (unknown [202.8.44.45])
	by pele.citylink.co.nz (Postfix) with ESMTP;
	Fri, 23 Jan 2009 08:42:23 +1300 (NZDT)
Received: by citylink.fud.org.nz (Postfix, from userid 1001)
	id 812291142D; Fri, 23 Jan 2009 08:42:22 +1300 (NZDT)
Date: Thu, 22 Jan 2009 11:42:22 -0800
From: Andrew Thompson 
To: Jung-uk Kim 
Message-ID: <20090122194222.GC84458@citylink.fud.org.nz>
References: <200901221706.n0MH6XN1017768@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <200901221706.n0MH6XN1017768@svn.freebsd.org>
User-Agent: Mutt/1.5.17 (2007-11-01)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r187594 - in head/sys: compat/linprocfs i386/cpufreq
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 22 Jan 2009 19:42:28 -0000

On Thu, Jan 22, 2009 at 05:06:33PM +0000, Jung-uk Kim wrote:
> Author: jkim
> Date: Thu Jan 22 17:06:33 2009
> New Revision: 187594
> URL: http://svn.freebsd.org/changeset/base/187594
> 
> Log:
>   Replace couple of strcmp(cpu_vendor, "foo") with cpu_vendor_id for i386
>   and hide i386-specific code under #ifdef.
> 
> Modified:
>   head/sys/compat/linprocfs/linprocfs.c
>   head/sys/i386/cpufreq/smist.c
> 
> Modified: head/sys/i386/cpufreq/smist.c
> ==============================================================================
> --- head/sys/i386/cpufreq/smist.c	Thu Jan 22 15:52:13 2009	(r187593)
> +++ head/sys/i386/cpufreq/smist.c	Thu Jan 22 17:06:33 2009	(r187594)
> @@ -285,7 +285,7 @@ smist_identify(driver_t *driver, device_
>  		return;
>  
>  	/* Check for a supported processor */
> -	if (strcmp(cpu_vendor, "GenuineIntel") != 0)
> +	if (cpu_vendor_id != CPU_VENDOR_INTEL)
>  		return;
>  	switch (cpu_id & 0xff0) {
>  	case 0x680:	/* Pentium III [coppermine] */

This needs 


cheers,
Andrew

From owner-svn-src-head@FreeBSD.ORG  Thu Jan 22 20:24:54 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 983DE106566C;
	Thu, 22 Jan 2009 20:24:54 +0000 (UTC)
	(envelope-from sobomax@FreeBSD.org)
Received: from sippysoft.com (gk1.360sip.com [72.236.70.240])
	by mx1.freebsd.org (Postfix) with ESMTP id 44BA08FC20;
	Thu, 22 Jan 2009 20:24:54 +0000 (UTC)
	(envelope-from sobomax@FreeBSD.org)
Received: from [192.168.1.38] (S0106001372fd1e07.vs.shawcable.net
	[70.71.171.106]) (authenticated bits=0)
	by sippysoft.com (8.13.8/8.13.8) with ESMTP id n0MKOqLU048519
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 22 Jan 2009 12:24:53 -0800 (PST)
	(envelope-from sobomax@FreeBSD.org)
Message-ID: <4978D5F9.50506@FreeBSD.org>
Date: Thu, 22 Jan 2009 12:24:25 -0800
From: Maxim Sobolev 
Organization: Sippy Software, Inc.
User-Agent: Thunderbird 2.0.0.19 (Windows/20081209)
MIME-Version: 1.0
To: Jung-uk Kim 
References: <200901221706.n0MH6XN1017768@svn.freebsd.org>
In-Reply-To: <200901221706.n0MH6XN1017768@svn.freebsd.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org
Subject: Re: svn: head/sys: compat/linprocfs i386/cpufreq
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 22 Jan 2009 20:24:55 -0000

Jung-uk Kim wrote:
> Author: jkim
> Date: Thu Jan 22 17:06:33 2009
> New Revision: 187594
> URL: http://svn.freebsd.org/changeset/base/187594
> 
> Log:
>   Replace couple of strcmp(cpu_vendor, "foo") with cpu_vendor_id for i386

What about amd64?

-Maxim

From owner-svn-src-head@FreeBSD.ORG  Thu Jan 22 20:29:07 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5B3081065680;
	Thu, 22 Jan 2009 20:29:07 +0000 (UTC)
	(envelope-from jkim@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 49E468FC22;
	Thu, 22 Jan 2009 20:29:07 +0000 (UTC)
	(envelope-from jkim@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0MKT70Z021554;
	Thu, 22 Jan 2009 20:29:07 GMT (envelope-from jkim@svn.freebsd.org)
Received: (from jkim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0MKT7pU021553;
	Thu, 22 Jan 2009 20:29:07 GMT (envelope-from jkim@svn.freebsd.org)
Message-Id: <200901222029.n0MKT7pU021553@svn.freebsd.org>
From: Jung-uk Kim 
Date: Thu, 22 Jan 2009 20:29:07 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r187597 - head/sys/i386/cpufreq
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 22 Jan 2009 20:29:08 -0000

Author: jkim
Date: Thu Jan 22 20:29:07 2009
New Revision: 187597
URL: http://svn.freebsd.org/changeset/base/187597

Log:
  Include a missing header file.
  
  Reported by:	thompsa, "build universe"

Modified:
  head/sys/i386/cpufreq/smist.c

Modified: head/sys/i386/cpufreq/smist.c
==============================================================================
--- head/sys/i386/cpufreq/smist.c	Thu Jan 22 18:45:11 2009	(r187596)
+++ head/sys/i386/cpufreq/smist.c	Thu Jan 22 20:29:07 2009	(r187597)
@@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
+#include 
 #include 
 #include 
 

From owner-svn-src-head@FreeBSD.ORG  Thu Jan 22 20:36:40 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28])
	by hub.freebsd.org (Postfix) with ESMTP id 44E3E10656C1;
	Thu, 22 Jan 2009 20:36:39 +0000 (UTC)
	(envelope-from jkim@FreeBSD.org)
From: Jung-uk Kim 
To: Maxim Sobolev 
Date: Thu, 22 Jan 2009 15:36:17 -0500
User-Agent: KMail/1.6.2
References: <200901221706.n0MH6XN1017768@svn.freebsd.org>
	<4978D5F9.50506@FreeBSD.org>
In-Reply-To: <4978D5F9.50506@FreeBSD.org>
MIME-Version: 1.0
Content-Disposition: inline
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Message-Id: <200901221536.19137.jkim@FreeBSD.org>
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org
Subject: Re: svn: head/sys: compat/linprocfs i386/cpufreq
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 22 Jan 2009 20:36:41 -0000

On Thursday 22 January 2009 03:24 pm, Maxim Sobolev wrote:
> Jung-uk Kim wrote:
> > Author: jkim
> > Date: Thu Jan 22 17:06:33 2009
> > New Revision: 187594
> > URL: http://svn.freebsd.org/changeset/base/187594
> >
> > Log:
> >   Replace couple of strcmp(cpu_vendor, "foo") with cpu_vendor_id
> > for i386
>
> What about amd64?

It is #ifdef'ed out in linprocfs.c and smist.c is i386-specific, i.e., 
it does not compile on amd64.

Jung-uk Kim

From owner-svn-src-head@FreeBSD.ORG  Thu Jan 22 20:55:12 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3827710656D3;
	Thu, 22 Jan 2009 20:55:11 +0000 (UTC)
	(envelope-from ivoras@gmail.com)
Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.157])
	by mx1.freebsd.org (Postfix) with ESMTP id C60598FC14;
	Thu, 22 Jan 2009 20:55:10 +0000 (UTC)
	(envelope-from ivoras@gmail.com)
Received: by fg-out-1718.google.com with SMTP id l26so2774008fgb.35
	for ; Thu, 22 Jan 2009 12:55:10 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:sender:received:in-reply-to
	:references:date:x-google-sender-auth:message-id:subject:from:to:cc
	:content-type:content-transfer-encoding;
	bh=tZGMEXptN6+/huVpBK29a+xBi4v8hpnTE2rmwGQEyvM=;
	b=vBo0npuSq9crf0d6Is6GEl6es9sJ4t4xRhxavzS47WVU01yeiuBS7ImrTGOavmt8vX
	x47kn7I/WuQTPZXIH4oTlM7SAvnYzZzuOxksNHaOTHFXPPl9wPUscTVx2SXs2gWGyJp7
	4ieNVrzV8ldKoqivYT7pOakhn/DmCloBSjYHg=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type
	:content-transfer-encoding;
	b=YOr0JERaLkCC0q8VnDWeS3V9LoDcpXzSPCZQgWvg2c8HXYdhtv8xfXR6liZB2amdSd
	BsiwrNBz8cR4S/ywmu94v9WwH/PS8ro3zE1A8QMBXkwK4ioG8m4sA4kbStZ6G3spZ7/9
	r8sqKoqtYwMzBwhN1ejqF/MELP0ns/q7yQLKI=
MIME-Version: 1.0
Sender: ivoras@gmail.com
Received: by 10.181.154.16 with SMTP id g16mr3428279bko.179.1232657709853; 
	Thu, 22 Jan 2009 12:55:09 -0800 (PST)
In-Reply-To: 
References: <200901220621.n0M6LU5v002745@svn.freebsd.org>
	<20090122.104114.1927899760.imp@bsdimp.com>
	
Date: Thu, 22 Jan 2009 21:55:09 +0100
X-Google-Sender-Auth: bf54f4c895920d90
Message-ID: <9bbcef730901221255u5767d16bo230da23542a171d7@mail.gmail.com>
From: Ivan Voras 
To: Robert Watson 
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@freebsd.org, jeff@freebsd.org, src-committers@freebsd.org,
	svn-src-all@freebsd.org, "M. Warner Losh" 
Subject: Re: svn commit: r187580 - head/tools/sched
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 22 Jan 2009 20:55:13 -0000

2009/1/22 Robert Watson :

> FWIW, the one case where I don't really do that is when I worked on some
> code on my own and hence hold the copyright for it, then did some work under
> a contract for a customer on it such that they own the copyright on
> enhancements, and then I do some further work on my own.  In that case, I'll
> leave a discontinuity to reflect the fact that the copyright on changes made
> in the gap were assigned elsewhere.  Not clear this is the right thing to
> do, but I'm fairly sure at least some of my customers are more comfortable
> with that as it leaves no confusion in the source as to which bits they
> sponsored/own.

Of course this is purely cosmetic as "one year" is a terrible
granularity for commits to a moving target :)

(i.e. legally it's worthless information)

From owner-svn-src-head@FreeBSD.ORG  Thu Jan 22 21:04:46 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B1EF9106566B;
	Thu, 22 Jan 2009 21:04:46 +0000 (UTC)
	(envelope-from jkim@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A039A8FC1D;
	Thu, 22 Jan 2009 21:04:46 +0000 (UTC)
	(envelope-from jkim@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0ML4knS022268;
	Thu, 22 Jan 2009 21:04:46 GMT (envelope-from jkim@svn.freebsd.org)
Received: (from jkim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0ML4kh6022266;
	Thu, 22 Jan 2009 21:04:46 GMT (envelope-from jkim@svn.freebsd.org)
Message-Id: <200901222104.n0ML4kh6022266@svn.freebsd.org>
From: Jung-uk Kim 
Date: Thu, 22 Jan 2009 21:04:46 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r187598 - in head/sys: amd64/amd64 i386/i386
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 22 Jan 2009 21:04:47 -0000

Author: jkim
Date: Thu Jan 22 21:04:46 2009
New Revision: 187598
URL: http://svn.freebsd.org/changeset/base/187598

Log:
  VIA Nano processor has a special MSR (CENT_HARDWARECTRL3) bit 32 to determine
  whether TSC is P-state invariant or not.  In fact, this MSR is writable but
  we just leave it at the BIOS default for now.

Modified:
  head/sys/amd64/amd64/identcpu.c
  head/sys/i386/i386/identcpu.c

Modified: head/sys/amd64/amd64/identcpu.c
==============================================================================
--- head/sys/amd64/amd64/identcpu.c	Thu Jan 22 20:29:07 2009	(r187597)
+++ head/sys/amd64/amd64/identcpu.c	Thu Jan 22 21:04:46 2009	(r187598)
@@ -392,7 +392,8 @@ printcpuinfo(void)
 				break;
 			case CPU_VENDOR_CENTAUR:
 				if (AMD64_CPU_FAMILY(cpu_id) == 0x6 &&
-				    AMD64_CPU_MODEL(cpu_id) >= 0xf)
+				    AMD64_CPU_MODEL(cpu_id) >= 0xf &&
+				    (rdmsr(0x1203) & 0x100000000ULL) == 0)
 					tsc_is_invariant = 1;
 				break;
 			}

Modified: head/sys/i386/i386/identcpu.c
==============================================================================
--- head/sys/i386/i386/identcpu.c	Thu Jan 22 20:29:07 2009	(r187597)
+++ head/sys/i386/i386/identcpu.c	Thu Jan 22 21:04:46 2009	(r187598)
@@ -887,7 +887,8 @@ printcpuinfo(void)
 				break;
 			case CPU_VENDOR_CENTAUR:
 				if (I386_CPU_FAMILY(cpu_id) == 0x6 &&
-				    I386_CPU_MODEL(cpu_id) >= 0xf)
+				    I386_CPU_MODEL(cpu_id) >= 0xf &&
+				    (rdmsr(0x1203) & 0x100000000ULL) == 0)
 					tsc_is_invariant = 1;
 				break;
 			}

From owner-svn-src-head@FreeBSD.ORG  Thu Jan 22 21:54:27 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 31894106566B;
	Thu, 22 Jan 2009 21:54:27 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1E84F8FC0A;
	Thu, 22 Jan 2009 21:54:27 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0MLsRd4023146;
	Thu, 22 Jan 2009 21:54:27 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0MLsRbh023144;
	Thu, 22 Jan 2009 21:54:27 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <200901222154.n0MLsRbh023144@svn.freebsd.org>
From: Warner Losh 
Date: Thu, 22 Jan 2009 21:54:27 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r187599 - head/sys/arm/at91
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 22 Jan 2009 21:54:27 -0000

Author: imp
Date: Thu Jan 22 21:54:26 2009
New Revision: 187599
URL: http://svn.freebsd.org/changeset/base/187599

Log:
  Store at91_master_clock in a global variable as opposed to a compile
  time constant.  This allows us to potentially change it at runtime or
  autodetect it early in the boot (the latter being much more likely to
  have a good outcome).

Modified:
  head/sys/arm/at91/at91.c
  head/sys/arm/at91/at91var.h

Modified: head/sys/arm/at91/at91.c
==============================================================================
--- head/sys/arm/at91/at91.c	Thu Jan 22 21:04:46 2009	(r187598)
+++ head/sys/arm/at91/at91.c	Thu Jan 22 21:54:26 2009	(r187599)
@@ -50,6 +50,8 @@ static struct at91_softc *at91_softc;
 
 static void at91_eoi(void *);
 
+uint32_t at91_master_clock = AT91C_MASTER_CLOCK;
+
 static int
 at91_bs_map(void *t, bus_addr_t bpa, bus_size_t size, int flags,
     bus_space_handle_t *bshp)

Modified: head/sys/arm/at91/at91var.h
==============================================================================
--- head/sys/arm/at91/at91var.h	Thu Jan 22 21:04:46 2009	(r187598)
+++ head/sys/arm/at91/at91var.h	Thu Jan 22 21:54:26 2009	(r187599)
@@ -43,4 +43,6 @@ struct at91_ivar {
 	struct resource_list resources;
 };
 
+extern uint32_t at91_master_clock;
+
 #endif /* _AT91VAR_H_ */

From owner-svn-src-head@FreeBSD.ORG  Thu Jan 22 21:55:04 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B3E441065672;
	Thu, 22 Jan 2009 21:55:04 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A01E18FC18;
	Thu, 22 Jan 2009 21:55:04 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0MLt4CS023210;
	Thu, 22 Jan 2009 21:55:04 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0MLt4mf023209;
	Thu, 22 Jan 2009 21:55:04 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <200901222155.n0MLt4mf023209@svn.freebsd.org>
From: Warner Losh 
Date: Thu, 22 Jan 2009 21:55:04 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r187600 - head/sys/arm/at91
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 22 Jan 2009 21:55:05 -0000

Author: imp
Date: Thu Jan 22 21:55:04 2009
New Revision: 187600
URL: http://svn.freebsd.org/changeset/base/187600

Log:
  Remove now-redundant declaration.

Modified:
  head/sys/arm/at91/at91_mci.c

Modified: head/sys/arm/at91/at91_mci.c
==============================================================================
--- head/sys/arm/at91/at91_mci.c	Thu Jan 22 21:54:26 2009	(r187599)
+++ head/sys/arm/at91/at91_mci.c	Thu Jan 22 21:55:04 2009	(r187600)
@@ -277,7 +277,6 @@ at91_mci_getaddr(void *arg, bus_dma_segm
 static int
 at91_mci_update_ios(device_t brdev, device_t reqdev)
 {
-	uint32_t at91_master_clock = AT91C_MASTER_CLOCK;
 	struct at91_mci_softc *sc;
 	struct mmc_host *host;
 	struct mmc_ios *ios;

From owner-svn-src-head@FreeBSD.ORG  Thu Jan 22 21:55:38 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 120D5106566C;
	Thu, 22 Jan 2009 21:55:38 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id F2FB08FC1B;
	Thu, 22 Jan 2009 21:55:37 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0MLtboM023255;
	Thu, 22 Jan 2009 21:55:37 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0MLtbLj023253;
	Thu, 22 Jan 2009 21:55:37 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <200901222155.n0MLtbLj023253@svn.freebsd.org>
From: Warner Losh 
Date: Thu, 22 Jan 2009 21:55:37 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r187601 - head/sys/arm/at91
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 22 Jan 2009 21:55:39 -0000

Author: imp
Date: Thu Jan 22 21:55:37 2009
New Revision: 187601
URL: http://svn.freebsd.org/changeset/base/187601

Log:
  Use at91_master_clock instead of AT91C_MASTER_CLOCK.

Modified:
  head/sys/arm/at91/at91_twi.c
  head/sys/arm/at91/at91_twireg.h

Modified: head/sys/arm/at91/at91_twi.c
==============================================================================
--- head/sys/arm/at91/at91_twi.c	Thu Jan 22 21:55:04 2009	(r187600)
+++ head/sys/arm/at91/at91_twi.c	Thu Jan 22 21:55:37 2009	(r187601)
@@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -128,7 +129,7 @@ at91_twi_attach(device_t dev)
 		AT91_TWI_LOCK_DESTROY(sc);
 		goto out;
 	}
-	sc->cwgr = TWI_CWGR_CKDIV(8 * AT91C_MASTER_CLOCK / TWI_FASTEST_CLOCK) |
+	sc->cwgr = TWI_CWGR_CKDIV(8 * at91_master_clock / TWI_FASTEST_CLOCK) |
 	    TWI_CWGR_CHDIV(TWI_CWGR_DIV(TWI_DEF_CLK)) |
 	    TWI_CWGR_CLDIV(TWI_CWGR_DIV(TWI_DEF_CLK));
 	WR4(sc, TWI_CR, TWI_CR_SWRST);

Modified: head/sys/arm/at91/at91_twireg.h
==============================================================================
--- head/sys/arm/at91/at91_twireg.h	Thu Jan 22 21:55:04 2009	(r187600)
+++ head/sys/arm/at91/at91_twireg.h	Thu Jan 22 21:55:37 2009	(r187601)
@@ -63,7 +63,7 @@
 #define TWI_CWGR_CKDIV(x) ((x) << 16)	/* Clock Divider */
 #define TWI_CWGR_CHDIV(x) ((x) << 8)	/* Clock High Divider */
 #define TWI_CWGR_CLDIV(x) ((x) << 0)	/* Clock Low Divider */
-#define TWI_CWGR_DIV(rate) ((AT91C_MASTER_CLOCK /(4*(rate))) - 2)
+#define TWI_CWGR_DIV(rate) ((at91_master_clock /(4*(rate))) - 2)
 
 /* TWI_SR */
 /* TWI_IER */

From owner-svn-src-head@FreeBSD.ORG  Thu Jan 22 21:56:41 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7B07A106566B;
	Thu, 22 Jan 2009 21:56:41 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 5D0F58FC14;
	Thu, 22 Jan 2009 21:56:41 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0MLuffw023314;
	Thu, 22 Jan 2009 21:56:41 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0MLufpn023311;
	Thu, 22 Jan 2009 21:56:41 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <200901222156.n0MLufpn023311@svn.freebsd.org>
From: Warner Losh 
Date: Thu, 22 Jan 2009 21:56:41 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r187602 - head/sys/arm/at91
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 22 Jan 2009 21:56:41 -0000

Author: imp
Date: Thu Jan 22 21:56:41 2009
New Revision: 187602
URL: http://svn.freebsd.org/changeset/base/187602

Log:
  Migrate towards using at91_master_clock.  Initialize the clocks for
  the serial port class when we set the devclass since it is now
  no-longer a compile time constant.  Eliminate the pci include, as it
  isn't relevant or necessary.

Modified:
  head/sys/arm/at91/uart_bus_at91usart.c
  head/sys/arm/at91/uart_cpu_at91rm9200usart.c
  head/sys/arm/at91/uart_dev_at91usart.c

Modified: head/sys/arm/at91/uart_bus_at91usart.c
==============================================================================
--- head/sys/arm/at91/uart_bus_at91usart.c	Thu Jan 22 21:55:37 2009	(r187601)
+++ head/sys/arm/at91/uart_bus_at91usart.c	Thu Jan 22 21:56:41 2009	(r187602)
@@ -38,13 +38,12 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#include 
-
 #include 
 #include 
 #include 
 
 #include 
+#include 
 
 #include "uart_if.h"
 
@@ -103,6 +102,8 @@ usart_at91rm92_probe(device_t dev)
 		break;
 	}
 	sc->sc_class = &at91_usart_class;
+	if (sc->sc_class->uc_rclk == 0)
+		sc->sc_class->uc_rclk = at91_master_clock;
 	return (uart_bus_probe(dev, 0, 0, 0, device_get_unit(dev)));
 }
 

Modified: head/sys/arm/at91/uart_cpu_at91rm9200usart.c
==============================================================================
--- head/sys/arm/at91/uart_cpu_at91rm9200usart.c	Thu Jan 22 21:55:37 2009	(r187601)
+++ head/sys/arm/at91/uart_cpu_at91rm9200usart.c	Thu Jan 22 21:56:41 2009	(r187602)
@@ -35,12 +35,16 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 
 #include 
+#include 
 #include 
 
 #include 
+#include 
 
 bus_space_tag_t uart_bus_space_io;
 bus_space_tag_t uart_bus_space_mem;
@@ -60,6 +64,8 @@ uart_cpu_getdev(int devtype, struct uart
 	struct uart_class *class;
 
 	class = &at91_usart_class;
+	if (class->uc_rclk == 0)
+		class->uc_rclk = at91_master_clock;
 	di->ops = uart_getops(class);
 	di->bas.chan = 0;
 	di->bas.bst = &at91_bs_tag;

Modified: head/sys/arm/at91/uart_dev_at91usart.c
==============================================================================
--- head/sys/arm/at91/uart_dev_at91usart.c	Thu Jan 22 21:55:37 2009	(r187601)
+++ head/sys/arm/at91/uart_dev_at91usart.c	Thu Jan 22 21:56:41 2009	(r187602)
@@ -45,10 +45,11 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #include "uart_if.h"
 
-#define DEFAULT_RCLK		AT91C_MASTER_CLOCK
+#define DEFAULT_RCLK		at91_master_clock
 #define	USART_BUFFER_SIZE	128
 
 /*
@@ -684,6 +685,5 @@ struct uart_class at91_usart_class = {
 	at91_usart_methods,
 	sizeof(struct at91_usart_softc),
 	.uc_ops = &at91_usart_ops,
-	.uc_range = 8,
-	.uc_rclk = DEFAULT_RCLK
+	.uc_range = 8
 };

From owner-svn-src-head@FreeBSD.ORG  Thu Jan 22 22:29:21 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 66D04106566C;
	Thu, 22 Jan 2009 22:29:21 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 526DD8FC17;
	Thu, 22 Jan 2009 22:29:21 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0MMTLg5024142;
	Thu, 22 Jan 2009 22:29:21 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0MMTLdF024141;
	Thu, 22 Jan 2009 22:29:21 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <200901222229.n0MMTLdF024141@svn.freebsd.org>
From: Warner Losh 
Date: Thu, 22 Jan 2009 22:29:21 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r187603 - head/sys/arm/at91
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 22 Jan 2009 22:29:22 -0000

Author: imp
Date: Thu Jan 22 22:29:21 2009
New Revision: 187603
URL: http://svn.freebsd.org/changeset/base/187603

Log:
  Don't over-commit the DMA.  Use the passed in size of the transfer
  rather than a fixed 512...  This fixes the mount root problem on at91.
  Prior to the SD card reorg, all data transfers were 512 bytes, so we
  didn't notice.

Modified:
  head/sys/arm/at91/at91_mci.c

Modified: head/sys/arm/at91/at91_mci.c
==============================================================================
--- head/sys/arm/at91/at91_mci.c	Thu Jan 22 21:56:41 2009	(r187602)
+++ head/sys/arm/at91/at91_mci.c	Thu Jan 22 22:29:21 2009	(r187603)
@@ -313,7 +313,6 @@ at91_mci_start_cmd(struct at91_mci_softc
 	int i;
 	struct mmc_data *data;
 	struct mmc_request *req;
-	size_t block_size = 1 << 9;	// Fixed, per mmc/sd spec for 2GB cards
 	void *vaddr;
 	bus_addr_t paddr;
 
@@ -355,7 +354,7 @@ at91_mci_start_cmd(struct at91_mci_softc
 	// Set block size and turn on PDC mode for dma xfer and disable
 	// PDC until we're ready.
 	mr = RD4(sc, MCI_MR) & ~MCI_MR_BLKLEN;
-	WR4(sc, MCI_MR, mr | (block_size << 16) | MCI_MR_PDCMODE);
+	WR4(sc, MCI_MR, mr | (data->len << 16) | MCI_MR_PDCMODE);
 	WR4(sc, PDC_PTCR, PDC_PTCR_RXTDIS | PDC_PTCR_TXTDIS);
 	if (cmdr & MCI_CMDR_TRCMD_START) {
 		if (cmdr & MCI_CMDR_TRDIR)

From owner-svn-src-head@FreeBSD.ORG  Thu Jan 22 22:58:59 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4FC171065707;
	Thu, 22 Jan 2009 22:58:59 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42])
	by mx1.freebsd.org (Postfix) with ESMTP id 218DB8FC19;
	Thu, 22 Jan 2009 22:58:59 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from fledge.watson.org (fledge.watson.org [65.122.17.41])
	by cyrus.watson.org (Postfix) with ESMTPS id BA04446B09;
	Thu, 22 Jan 2009 17:58:58 -0500 (EST)
Date: Thu, 22 Jan 2009 22:58:58 +0000 (GMT)
From: Robert Watson 
X-X-Sender: robert@fledge.watson.org
To: Ivan Voras 
In-Reply-To: <9bbcef730901221255u5767d16bo230da23542a171d7@mail.gmail.com>
Message-ID: 
References: <200901220621.n0M6LU5v002745@svn.freebsd.org>
	<20090122.104114.1927899760.imp@bsdimp.com>
	
	<9bbcef730901221255u5767d16bo230da23542a171d7@mail.gmail.com>
User-Agent: Alpine 2.00 (BSF 1167 2008-08-23)
MIME-Version: 1.0
Content-Type: MULTIPART/MIXED;
	BOUNDARY="621616949-1415937769-1232665138=:66510"
Cc: svn-src-head@freebsd.org, jeff@freebsd.org, src-committers@freebsd.org,
	svn-src-all@freebsd.org, "M. Warner Losh" 
Subject: Re: svn commit: r187580 - head/tools/sched
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 22 Jan 2009 22:59:00 -0000

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--621616949-1415937769-1232665138=:66510
Content-Type: TEXT/PLAIN; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8BIT

On Thu, 22 Jan 2009, Ivan Voras wrote:

> 2009/1/22 Robert Watson :
>
>> FWIW, the one case where I don't really do that is when I worked on some 
>> code on my own and hence hold the copyright for it, then did some work 
>> under a contract for a customer on it such that they own the copyright on 
>> enhancements, and then I do some further work on my own.  In that case, 
>> I'll leave a discontinuity to reflect the fact that the copyright on 
>> changes made in the gap were assigned elsewhere.  Not clear this is the 
>> right thing to do, but I'm fairly sure at least some of my customers are 
>> more comfortable with that as it leaves no confusion in the source as to 
>> which bits they sponsored/own.
>
> Of course this is purely cosmetic as "one year" is a terrible granularity 
> for commits to a moving target :)
>
> (i.e. legally it's worthless information)

Sorry, that simply isn't the case, as copyright expiration doesn't track the 
exact moment at which something was created.  Copyright law varies by country, 
but US copyright law is of particular importance to the FreeBSD Project, so I 
direct you to the US Copyright Office's rather helpful circular 92, which 
provides a useful summary:

   § 305. Duration of copyright: Terminal date

   All terms of copyright provided by sections 302 through 304 run to the end
   of the calendar year in which they would otherwise expire.

So the year of creation really is the date that matters. And as nebulous as 
the far-off expiration of copyright dates may seem to you now, remember that: 
(a) we work on software that includes copyrights almost 30 years old, and (b) 
copyright law has an annoying propensity to change out from under you.

Robert N M Watson
Computer Laboratory
University of Cambridge
--621616949-1415937769-1232665138=:66510--

From owner-svn-src-head@FreeBSD.ORG  Thu Jan 22 23:00:45 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BE2FE106567A;
	Thu, 22 Jan 2009 23:00:45 +0000 (UTC) (envelope-from imp@bsdimp.com)
Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85])
	by mx1.freebsd.org (Postfix) with ESMTP id 7394F8FC1A;
	Thu, 22 Jan 2009 23:00:45 +0000 (UTC) (envelope-from imp@bsdimp.com)
Received: from localhost (localhost [127.0.0.1])
	by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id n0MMw6Tb054105;
	Thu, 22 Jan 2009 15:58:06 -0700 (MST) (envelope-from imp@bsdimp.com)
Date: Thu, 22 Jan 2009 15:58:45 -0700 (MST)
Message-Id: <20090122.155845.-928179489.imp@bsdimp.com>
To: rwatson@FreeBSD.org
From: "M. Warner Losh" 
In-Reply-To: 
References: <200901220621.n0M6LU5v002745@svn.freebsd.org>
	<20090122.104114.1927899760.imp@bsdimp.com>
	
X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@FreeBSD.org, jeff@FreeBSD.org, src-committers@FreeBSD.org,
	svn-src-all@FreeBSD.org
Subject: Re: svn commit: r187580 - head/tools/sched
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 22 Jan 2009 23:00:46 -0000

In message: 
            Robert Watson  writes:
: On Thu, 22 Jan 2009, M. Warner Losh wrote:
: 
: > In message: <200901220621.n0M6LU5v002745@svn.freebsd.org>
: >            Jeff Roberson  writes:
: > : Author: jeff
: > : Date: Thu Jan 22 06:21:30 2009
: > : New Revision: 187580
: > : URL: http://svn.freebsd.org/changeset/base/187580
: > :
: > : Log:
: > :    - Update my copyright.
: > : +# Copyright (c) 2002-2003, 2009, Jeffrey Roberson 
: >
: > Stylistically, this should be 2002-2009.  We don't need to list each and 
: > every year, so the project's policy is to list the earliest and the latest 
: > year.
: >
: > See, for example, http://www.oppedahl.com/copyrights/ for the reasoning 
: > behind this.
: 
: FWIW, the one case where I don't really do that is when I worked on some code 
: on my own and hence hold the copyright for it, then did some work under a 
: contract for a customer on it such that they own the copyright on 
: enhancements, and then I do some further work on my own.  In that case, I'll 
: leave a discontinuity to reflect the fact that the copyright on changes made 
: in the gap were assigned elsewhere.  Not clear this is the right thing to do, 
: but I'm fairly sure at least some of my customers are more comfortable with 
: that as it leaves no confusion in the source as to which bits they 
: sponsored/own.

True, but that's a fairly rare circumstance relative to the project as
a whole.

Warner

From owner-svn-src-head@FreeBSD.ORG  Thu Jan 22 23:03:15 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D9274106566C;
	Thu, 22 Jan 2009 23:03:15 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42])
	by mx1.freebsd.org (Postfix) with ESMTP id AD6588FC1E;
	Thu, 22 Jan 2009 23:03:15 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from fledge.watson.org (fledge.watson.org [65.122.17.41])
	by cyrus.watson.org (Postfix) with ESMTPS id 6674246B06;
	Thu, 22 Jan 2009 18:03:15 -0500 (EST)
Date: Thu, 22 Jan 2009 23:03:15 +0000 (GMT)
From: Robert Watson 
X-X-Sender: robert@fledge.watson.org
To: "M. Warner Losh" 
In-Reply-To: <20090122.155845.-928179489.imp@bsdimp.com>
Message-ID: 
References: <200901220621.n0M6LU5v002745@svn.freebsd.org>
	<20090122.104114.1927899760.imp@bsdimp.com>
	
	<20090122.155845.-928179489.imp@bsdimp.com>
User-Agent: Alpine 2.00 (BSF 1167 2008-08-23)
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: svn-src-head@FreeBSD.org, jeff@FreeBSD.org, src-committers@FreeBSD.org,
	svn-src-all@FreeBSD.org
Subject: Re: svn commit: r187580 - head/tools/sched
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 22 Jan 2009 23:03:16 -0000

On Thu, 22 Jan 2009, M. Warner Losh wrote:

> : FWIW, the one case where I don't really do that is when I worked on some code
> : on my own and hence hold the copyright for it, then did some work under a
> : contract for a customer on it such that they own the copyright on
> : enhancements, and then I do some further work on my own.  In that case, I'll
> : leave a discontinuity to reflect the fact that the copyright on changes made
> : in the gap were assigned elsewhere.  Not clear this is the right thing to do,
> : but I'm fairly sure at least some of my customers are more comfortable with
> : that as it leaves no confusion in the source as to which bits they
> : sponsored/own.
>
> True, but that's a fairly rare circumstance relative to the project as a 
> whole.

Possibly, but I also think that while most committers are quite careful about 
getting the permission of their employers to release code, many are less 
careful than they should be about attributing copyright to their employers as 
they may not understand the implications of work-for-hire.

Robert N M Watson
Computer Laboratory
University of Cambridge

From owner-svn-src-head@FreeBSD.ORG  Thu Jan 22 23:06:41 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A3FE6106567A;
	Thu, 22 Jan 2009 23:06:41 +0000 (UTC) (envelope-from imp@bsdimp.com)
Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85])
	by mx1.freebsd.org (Postfix) with ESMTP id 3A1538FC1A;
	Thu, 22 Jan 2009 23:06:41 +0000 (UTC) (envelope-from imp@bsdimp.com)
Received: from localhost (localhost [127.0.0.1])
	by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id n0MN3V66054227;
	Thu, 22 Jan 2009 16:03:31 -0700 (MST) (envelope-from imp@bsdimp.com)
Date: Thu, 22 Jan 2009 16:04:10 -0700 (MST)
Message-Id: <20090122.160410.-1305646724.imp@bsdimp.com>
To: rwatson@FreeBSD.org
From: "M. Warner Losh" 
In-Reply-To: 
References: 
	<9bbcef730901221255u5767d16bo230da23542a171d7@mail.gmail.com>
	
X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
Cc: svn-src-head@FreeBSD.org, jeff@FreeBSD.org, src-committers@FreeBSD.org,
	ivoras@FreeBSD.org, svn-src-all@FreeBSD.org
Subject: Re: svn commit: r187580 - head/tools/sched
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 22 Jan 2009 23:06:42 -0000

In message: 
            Robert Watson  writes:
: On Thu, 22 Jan 2009, Ivan Voras wrote:
: =

: > 2009/1/22 Robert Watson :
: >
: >> FWIW, the one case where I don't really do that is when I worked o=
n some =

: >> code on my own and hence hold the copyright for it, then did some =
work =

: >> under a contract for a customer on it such that they own the copyr=
ight on =

: >> enhancements, and then I do some further work on my own.  In that =
case, =

: >> I'll leave a discontinuity to reflect the fact that the copyright =
on =

: >> changes made in the gap were assigned elsewhere.  Not clear this i=
s the =

: >> right thing to do, but I'm fairly sure at least some of my custome=
rs are =

: >> more comfortable with that as it leaves no confusion in the source=
 as to =

: >> which bits they sponsored/own.
: >
: > Of course this is purely cosmetic as "one year" is a terrible granu=
larity =

: > for commits to a moving target :)
: >
: > (i.e. legally it's worthless information)
: =

: Sorry, that simply isn't the case, as copyright expiration doesn't tr=
ack the =

: exact moment at which something was created.  Copyright law varies by=
 country, =

: but US copyright law is of particular importance to the FreeBSD Proje=
ct, so I =

: direct you to the US Copyright Office's rather helpful circular 92, w=
hich =

: provides a useful summary:
: =

:    =A7 305. Duration of copyright: Terminal date
: =

:    All terms of copyright provided by sections 302 through 304 run to=
 the end
:    of the calendar year in which they would otherwise expire.
: =

: So the year of creation really is the date that matters. And as nebul=
ous as =

: the far-off expiration of copyright dates may seem to you now, rememb=
er that: =

: (a) we work on software that includes copyrights almost 30 years old,=
 and (b) =

: copyright law has an annoying propensity to change out from under you=
.=


Also, works fixed in tangible form in the last half of the year expire
as if they'd been fixed in that form in the following year.  Which is
why you see books 'Copyright (c) 2009' starting in about October...

Warner

From owner-svn-src-head@FreeBSD.ORG  Thu Jan 22 23:08:23 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2F6E8106564A;
	Thu, 22 Jan 2009 23:08:23 +0000 (UTC)
	(envelope-from sobomax@FreeBSD.org)
Received: from sippysoft.com (gk1.360sip.com [72.236.70.240])
	by mx1.freebsd.org (Postfix) with ESMTP id E58758FC12;
	Thu, 22 Jan 2009 23:08:22 +0000 (UTC)
	(envelope-from sobomax@FreeBSD.org)
Received: from [192.168.1.38] (S0106001372fd1e07.vs.shawcable.net
	[70.71.171.106]) (authenticated bits=0)
	by sippysoft.com (8.13.8/8.13.8) with ESMTP id n0MN8LEm057063
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 22 Jan 2009 15:08:22 -0800 (PST)
	(envelope-from sobomax@FreeBSD.org)
Message-ID: <4978FC49.9080806@FreeBSD.org>
Date: Thu, 22 Jan 2009 15:07:53 -0800
From: Maxim Sobolev 
Organization: Sippy Software, Inc.
User-Agent: Thunderbird 2.0.0.19 (Windows/20081209)
MIME-Version: 1.0
To: Jung-uk Kim 
References: <200901221706.n0MH6XN1017768@svn.freebsd.org>
	<4978D5F9.50506@FreeBSD.org> <200901221536.19137.jkim@FreeBSD.org>
In-Reply-To: <200901221536.19137.jkim@FreeBSD.org>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org
Subject: Re: svn: head/sys: compat/linprocfs i386/cpufreq
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 22 Jan 2009 23:08:23 -0000

Jung-uk Kim wrote:
> On Thursday 22 January 2009 03:24 pm, Maxim Sobolev wrote:
>> Jung-uk Kim wrote:
>>> Author: jkim
>>> Date: Thu Jan 22 17:06:33 2009
>>> New Revision: 187594
>>> URL: http://svn.freebsd.org/changeset/base/187594
>>>
>>> Log:
>>>   Replace couple of strcmp(cpu_vendor, "foo") with cpu_vendor_id
>>> for i386
>> What about amd64?
> 
> It is #ifdef'ed out in linprocfs.c and smist.c is i386-specific, i.e., 
> it does not compile on amd64.

No, it's not. The function linprocfs_docpuinfo() are the same for both 
amd64 and i386, so that you've just broken it for amd64 with this commit.

-Maxim

From owner-svn-src-head@FreeBSD.ORG  Thu Jan 22 23:10:09 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5C3281065675;
	Thu, 22 Jan 2009 23:10:09 +0000 (UTC) (envelope-from imp@bsdimp.com)
Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85])
	by mx1.freebsd.org (Postfix) with ESMTP id EF50F8FC0C;
	Thu, 22 Jan 2009 23:10:08 +0000 (UTC) (envelope-from imp@bsdimp.com)
Received: from localhost (localhost [127.0.0.1])
	by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id n0MN7KDd054286;
	Thu, 22 Jan 2009 16:07:20 -0700 (MST) (envelope-from imp@bsdimp.com)
Date: Thu, 22 Jan 2009 16:07:59 -0700 (MST)
Message-Id: <20090122.160759.1633422730.imp@bsdimp.com>
To: rwatson@FreeBSD.org
From: "M. Warner Losh" 
In-Reply-To: 
References: 
	<20090122.155845.-928179489.imp@bsdimp.com>
	
X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@FreeBSD.org, jeff@FreeBSD.org, src-committers@FreeBSD.org,
	svn-src-all@FreeBSD.org
Subject: Re: svn commit: r187580 - head/tools/sched
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 22 Jan 2009 23:10:12 -0000

In message: 
            Robert Watson  writes:
: On Thu, 22 Jan 2009, M. Warner Losh wrote:
: 
: > : FWIW, the one case where I don't really do that is when I worked on some code
: > : on my own and hence hold the copyright for it, then did some work under a
: > : contract for a customer on it such that they own the copyright on
: > : enhancements, and then I do some further work on my own.  In that case, I'll
: > : leave a discontinuity to reflect the fact that the copyright on changes made
: > : in the gap were assigned elsewhere.  Not clear this is the right thing to do,
: > : but I'm fairly sure at least some of my customers are more comfortable with
: > : that as it leaves no confusion in the source as to which bits they
: > : sponsored/own.
: >
: > True, but that's a fairly rare circumstance relative to the project as a 
: > whole.
: 
: Possibly, but I also think that while most committers are quite careful about 
: getting the permission of their employers to release code, many are less 
: careful than they should be about attributing copyright to their employers as 
: they may not understand the implications of work-for-hire.

Very true.

Warner

From owner-svn-src-head@FreeBSD.ORG  Thu Jan 22 23:25:29 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 13A261065673;
	Thu, 22 Jan 2009 23:25:29 +0000 (UTC)
	(envelope-from luigi@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id F15DE8FC0C;
	Thu, 22 Jan 2009 23:25:28 +0000 (UTC)
	(envelope-from luigi@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0MNPSqR025185;
	Thu, 22 Jan 2009 23:25:28 GMT (envelope-from luigi@svn.freebsd.org)
Received: (from luigi@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0MNPSnD025183;
	Thu, 22 Jan 2009 23:25:28 GMT (envelope-from luigi@svn.freebsd.org)
Message-Id: <200901222325.n0MNPSnD025183@svn.freebsd.org>
From: Luigi Rizzo 
Date: Thu, 22 Jan 2009 23:25:28 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r187604 - head/sbin/ipfw
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 22 Jan 2009 23:25:29 -0000

Author: luigi
Date: Thu Jan 22 23:25:28 2009
New Revision: 187604
URL: http://svn.freebsd.org/changeset/base/187604

Log:
  remove some useless #include,
  document why timeconv.h is needed
  
  MFC after:	3 days

Modified:
  head/sbin/ipfw/ipfw2.c

Modified: head/sbin/ipfw/ipfw2.c
==============================================================================
--- head/sbin/ipfw/ipfw2.c	Thu Jan 22 22:29:21 2009	(r187603)
+++ head/sbin/ipfw/ipfw2.c	Thu Jan 22 23:25:28 2009	(r187604)
@@ -20,30 +20,24 @@
  * $FreeBSD$
  */
 
-#include 
-#include 
+#include 
 #include 
 #include 
 #include 
-#include 
 #include 
-#include 
 
 #include 
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
 #include 
 #include 
-#include 
 #include 
-#include 	/* XXX do we need this ? */
-#include 
 #include 
+#include 	/* _long_to_time */
 #include 
 #include 
 

From owner-svn-src-head@FreeBSD.ORG  Thu Jan 22 23:35:07 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7C0B21065679;
	Thu, 22 Jan 2009 23:35:07 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from mail.cksoft.de (mail.cksoft.de [62.111.66.27])
	by mx1.freebsd.org (Postfix) with ESMTP id 238C58FC12;
	Thu, 22 Jan 2009 23:35:07 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from localhost (amavis.str.cksoft.de [192.168.74.71])
	by mail.cksoft.de (Postfix) with ESMTP id 520F741C615;
	Fri, 23 Jan 2009 00:35:06 +0100 (CET)
X-Virus-Scanned: amavisd-new at cksoft.de
Received: from mail.cksoft.de ([62.111.66.27])
	by localhost (amavis.str.cksoft.de [192.168.74.71]) (amavisd-new,
	port 10024)
	with ESMTP id RvYPliorkkWa; Fri, 23 Jan 2009 00:35:06 +0100 (CET)
Received: by mail.cksoft.de (Postfix, from userid 66)
	id 039E441C60F; Fri, 23 Jan 2009 00:35:06 +0100 (CET)
Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net
	[10.111.66.10])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mail.int.zabbadoz.net (Postfix) with ESMTP id 399664448D5;
	Thu, 22 Jan 2009 23:31:20 +0000 (UTC)
Date: Thu, 22 Jan 2009 23:31:20 +0000 (UTC)
From: "Bjoern A. Zeeb" 
X-X-Sender: bz@maildrop.int.zabbadoz.net
To: John Baldwin 
In-Reply-To: <200812111532.17651.jhb@freebsd.org>
Message-ID: <20090122233042.P45399@maildrop.int.zabbadoz.net>
References: <200812102056.mBAKuJ97042379@svn.freebsd.org>
	<49415FFD.5070400@gritton.org> <200812111532.17651.jhb@freebsd.org>
X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, James Gritton 
Subject: Re: svn commit: r185878 - in head/sys: compat/freebsd32 kern
 modules/aio
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 22 Jan 2009 23:35:08 -0000

On Thu, 11 Dec 2008, John Baldwin wrote:

> On Thursday 11 December 2008 01:46:21 pm James Gritton wrote:
>> freebsd32_aio_waitcomplete() has a small error:
>>
>> @@ -2824,7 +2824,7 @@
>>  freebsd32_aio_waitcomplete(struct thread *td,
>>      struct freebsd32_aio_waitcomplete_args *uap)
>>  {
>> -    struct timespec ts32;
>> +    struct timespec32 ts32;
>>     struct timespec ts, *tsp;
>>     int error;
>>
>> - Jamie
>
> Oof. :(  I think my aiotest thing doesn't call aio_waitcomplete() so I missed
> this. :(

I think this has never been fixed in HEAD?

-- 
Bjoern A. Zeeb                      The greatest risk is not taking one.

From owner-svn-src-head@FreeBSD.ORG  Thu Jan 22 23:50:51 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28])
	by hub.freebsd.org (Postfix) with ESMTP id 916A41065713;
	Thu, 22 Jan 2009 23:50:50 +0000 (UTC)
	(envelope-from jkim@FreeBSD.org)
From: Jung-uk Kim 
To: Maxim Sobolev 
Date: Thu, 22 Jan 2009 18:50:36 -0500
User-Agent: KMail/1.6.2
References: <200901221706.n0MH6XN1017768@svn.freebsd.org>
	<200901221536.19137.jkim@FreeBSD.org>
	<4978FC49.9080806@FreeBSD.org>
In-Reply-To: <4978FC49.9080806@FreeBSD.org>
MIME-Version: 1.0
Content-Disposition: inline
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Message-Id: <200901221850.37708.jkim@FreeBSD.org>
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org
Subject: Re: svn: head/sys: compat/linprocfs i386/cpufreq
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 22 Jan 2009 23:50:51 -0000

On Thursday 22 January 2009 06:07 pm, Maxim Sobolev wrote:
> Jung-uk Kim wrote:
> > On Thursday 22 January 2009 03:24 pm, Maxim Sobolev wrote:
> >> Jung-uk Kim wrote:
> >>> Author: jkim
> >>> Date: Thu Jan 22 17:06:33 2009
> >>> New Revision: 187594
> >>> URL: http://svn.freebsd.org/changeset/base/187594
> >>>
> >>> Log:
> >>>   Replace couple of strcmp(cpu_vendor, "foo") with
> >>> cpu_vendor_id for i386
> >>
> >> What about amd64?
> >
> > It is #ifdef'ed out in linprocfs.c and smist.c is i386-specific,
> > i.e., it does not compile on amd64.
>
> No, it's not. The function linprocfs_docpuinfo() are the same for
> both amd64 and i386, so that you've just broken it for amd64 with
> this commit.

#ifdef was added with it:

http://docs.freebsd.org/cgi/mid.cgi?200901221706.n0MH6XN1017768

Jung-uk Kim

From owner-svn-src-head@FreeBSD.ORG  Fri Jan 23 00:19:16 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7BD29106564A;
	Fri, 23 Jan 2009 00:19:16 +0000 (UTC)
	(envelope-from ivoras@gmail.com)
Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.152])
	by mx1.freebsd.org (Postfix) with ESMTP id 4B0538FC17;
	Fri, 23 Jan 2009 00:19:15 +0000 (UTC)
	(envelope-from ivoras@gmail.com)
Received: by fg-out-1718.google.com with SMTP id l26so2844337fgb.35
	for ; Thu, 22 Jan 2009 16:19:14 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:sender:received:in-reply-to
	:references:date:x-google-sender-auth:message-id:subject:from:to:cc
	:content-type:content-transfer-encoding;
	bh=1ct1D7vdlwVppfHoDB9nGJrimR3i5gGh/JjSS1p545E=;
	b=MPspI9XI4iXq916KBeN0HmdZsXMTIdtOafohu35k/lQuFIWY44ZASYFEhw/Nl1kGtF
	bSz1I8719VXnhXg8GWNeG+j+KRrVMS+dII/a8TlKoXCImlyAkQs1e6vbRbGkCXcTZwfX
	HAZzpVPr4SV25y+zKfHQZP3BGaxOhbZSL2hCQ=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type
	:content-transfer-encoding;
	b=gowDr1gKbtsvrCGqVqqOZ62Yp0y4Y5XxpiYORp7vC3D4EkSHYrlUbB1dlzpLyQw/nP
	mNOE/Ty/HUEPQGtonuAGR1wKuGae7+u/oU+SJZDW55x8HVqn0hO2AEUdDrBFzIcIsa6E
	CYuaJwPqOIiQUjM/zZyFQ8/GGfS9EMFTMuORM=
MIME-Version: 1.0
Sender: ivoras@gmail.com
Received: by 10.181.199.6 with SMTP id b6mr796067bkq.68.1232669953822; Thu, 22 
	Jan 2009 16:19:13 -0800 (PST)
In-Reply-To: 
References: <200901220621.n0M6LU5v002745@svn.freebsd.org>
	<20090122.104114.1927899760.imp@bsdimp.com>
	
	<9bbcef730901221255u5767d16bo230da23542a171d7@mail.gmail.com>
	
Date: Fri, 23 Jan 2009 01:19:13 +0100
X-Google-Sender-Auth: 6041d85ad9255ca7
Message-ID: <9bbcef730901221619x390f3daau8104cf8912c4a237@mail.gmail.com>
From: Ivan Voras 
To: Robert Watson 
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Cc: svn-src-head@freebsd.org, jeff@freebsd.org, src-committers@freebsd.org,
	svn-src-all@freebsd.org, "M. Warner Losh" 
Subject: Re: svn commit: r187580 - head/tools/sched
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 23 Jan 2009 00:19:17 -0000

2009/1/22 Robert Watson :
> On Thu, 22 Jan 2009, Ivan Voras wrote:
>
>> 2009/1/22 Robert Watson :
>>
>>> FWIW, the one case where I don't really do that is when I worked on som=
e
>>> code on my own and hence hold the copyright for it, then did some work =
under
>>> a contract for a customer on it such that they own the copyright on
>>> enhancements, and then I do some further work on my own.  In that case,=
 I'll
>>> leave a discontinuity to reflect the fact that the copyright on changes=
 made
>>> in the gap were assigned elsewhere.  Not clear this is the right thing =
to
>>> do, but I'm fairly sure at least some of my customers are more comforta=
ble
>>> with that as it leaves no confusion in the source as to which bits they
>>> sponsored/own.
>>
>> Of course this is purely cosmetic as "one year" is a terrible granularit=
y
>> for commits to a moving target :)
>>
>> (i.e. legally it's worthless information)
>
> Sorry, that simply isn't the case, as copyright expiration doesn't track =
the
> exact moment at which something was created.  Copyright law varies by
> country, but US copyright law is of particular importance to the FreeBSD
> Project, so I direct you to the US Copyright Office's rather helpful
> circular 92, which provides a useful summary:
>
>  =C2=A7 305. Duration of copyright: Terminal date
>
>  All terms of copyright provided by sections 302 through 304 run to the e=
nd
>  of the calendar year in which they would otherwise expire.
>
> So the year of creation really is the date that matters. And as nebulous =
as
> the far-off expiration of copyright dates may seem to you now, remember
> that: (a) we work on software that includes copyrights almost 30 years ol=
d,
> and (b) copyright law has an annoying propensity to change out from under
> you.

Thanks!

I'm not a lawyer (very obviously - no talent for it all :) ) and was
probably wrongly interpreting the Geneva copyright convention.

Can someone write a "practical guide to FreeBSD copyright matters for
developers" somewhere - wiki perhaps? (it could also include
GPL-related guidelines - GPLv3 even if there's consensus about it).

From owner-svn-src-head@FreeBSD.ORG  Fri Jan 23 00:51:26 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2A1DE1065672;
	Fri, 23 Jan 2009 00:51:26 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 091478FC23;
	Fri, 23 Jan 2009 00:51:26 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0N0pPXO026782;
	Fri, 23 Jan 2009 00:51:25 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0N0pPTp026781;
	Fri, 23 Jan 2009 00:51:25 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <200901230051.n0N0pPTp026781@svn.freebsd.org>
From: Warner Losh 
Date: Fri, 23 Jan 2009 00:51:25 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r187606 - head/sys/arm/at91
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 23 Jan 2009 00:51:26 -0000

Author: imp
Date: Fri Jan 23 00:51:25 2009
New Revision: 187606
URL: http://svn.freebsd.org/changeset/base/187606

Log:
  Move to having a caps flag.  Newer versions of the AT91 family don't
  need the bouncing, so save a few copies in that case.  Also convert
  4-bit code selection to using it.

Modified:
  head/sys/arm/at91/at91_mci.c

Modified: head/sys/arm/at91/at91_mci.c
==============================================================================
--- head/sys/arm/at91/at91_mci.c	Thu Jan 22 23:34:55 2009	(r187605)
+++ head/sys/arm/at91/at91_mci.c	Fri Jan 23 00:51:25 2009	(r187606)
@@ -67,6 +67,9 @@ __FBSDID("$FreeBSD$");
 struct at91_mci_softc {
 	void *intrhand;			/* Interrupt handle */
 	device_t dev;
+	int sc_cap;
+#define	CAP_HAS_4WIRE		1	/* Has 4 wire bus */
+#define	CAP_NEEDS_BOUNCE	2	/* broken hardware needing bounce */
 	int flags;
 #define CMD_STARTED	1
 #define STOP_STARTED	2
@@ -77,7 +80,6 @@ struct at91_mci_softc {
 	bus_dmamap_t map;
 	int mapped;
 	struct mmc_host host;
-	int wire4;
 	int bus_busy;
 	struct mmc_request *req;
 	struct mmc_command *curcmd;
@@ -167,6 +169,7 @@ at91_mci_attach(device_t dev)
 	device_t child;
 
 	sc->dev = dev;
+	sc->sc_cap = CAP_NEEDS_BOUNCE;
 	err = at91_mci_activate(dev);
 	if (err)
 		goto out;
@@ -201,7 +204,7 @@ at91_mci_attach(device_t dev)
 	sc->host.f_min = 375000;
 	sc->host.f_max = at91_master_clock / 2;	/* Typically 30MHz */
 	sc->host.host_ocr = MMC_OCR_320_330 | MMC_OCR_330_340;
-	if (sc->wire4)
+	if (sc->sc_cap & CAP_HAS_4WIRE)
 		sc->host.caps = MMC_CAP_4_BIT_DATA;
 	else
 		sc->host.caps = 0;
@@ -301,6 +304,7 @@ at91_mci_update_ios(device_t brdev, devi
 	else
 		WR4(sc, MCI_SDCR, RD4(sc, MCI_SDCR) & ~MCI_SDCR_SDCBUS);
 	WR4(sc, MCI_MR, (RD4(sc, MCI_MR) & ~MCI_MR_CLKDIV) | clkdiv);
+	/* Do we need a settle time here? */
 	/* XXX We need to turn the device on/off here with a GPIO pin */
 	return (0);
 }
@@ -360,13 +364,15 @@ at91_mci_start_cmd(struct at91_mci_softc
 		if (cmdr & MCI_CMDR_TRDIR)
 			vaddr = cmd->data->data;
 		else {
-			if (data->len != BBSZ)
-				panic("Write multiblock write support");
-			vaddr = sc->bounce_buffer;
-			src = (uint32_t *)cmd->data->data;
-			dst = (uint32_t *)vaddr;
-			for (i = 0; i < data->len / 4; i++)
-				dst[i] = bswap32(src[i]);
+			if (sc->sc_cap & CAP_NEEDS_BOUNCE) {
+				vaddr = sc->bounce_buffer;
+				src = (uint32_t *)cmd->data->data;
+				dst = (uint32_t *)vaddr;
+				for (i = 0; i < data->len / 4; i++)
+					dst[i] = bswap32(src[i]);
+			}
+			else
+				vaddr = cmd->data->data;
 		}
 		data->xfer_len = 0;
 		if (bus_dmamap_load(sc->dmatag, sc->map, vaddr, data->len,
@@ -497,10 +503,12 @@ at91_mci_read_done(struct at91_mci_softc
 	bus_dmamap_sync(sc->dmatag, sc->map, BUS_DMASYNC_POSTREAD);
 	bus_dmamap_unload(sc->dmatag, sc->map);
 	sc->mapped--;
-	walker = (uint32_t *)cmd->data->data;
-	len = cmd->data->len / 4;
-	for (i = 0; i < len; i++)
-		walker[i] = bswap32(walker[i]);
+	if (sc->sc_cap & CAP_NEEDS_BOUNCE) {
+		walker = (uint32_t *)cmd->data->data;
+		len = cmd->data->len / 4;
+		for (i = 0; i < len; i++)
+			walker[i] = bswap32(walker[i]);
+	}
 	// Finish up the sequence...
 	WR4(sc, MCI_IDR, MCI_SR_ENDRX);
 	WR4(sc, MCI_IER, MCI_SR_RXBUFF);

From owner-svn-src-head@FreeBSD.ORG  Fri Jan 23 00:58:15 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 14C77106566B;
	Fri, 23 Jan 2009 00:58:15 +0000 (UTC)
	(envelope-from trhodes@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id F20AA8FC08;
	Fri, 23 Jan 2009 00:58:14 +0000 (UTC)
	(envelope-from trhodes@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0N0wErf026936;
	Fri, 23 Jan 2009 00:58:14 GMT (envelope-from trhodes@svn.freebsd.org)
Received: (from trhodes@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0N0wEjY026935;
	Fri, 23 Jan 2009 00:58:14 GMT (envelope-from trhodes@svn.freebsd.org)
Message-Id: <200901230058.n0N0wEjY026935@svn.freebsd.org>
From: Tom Rhodes 
Date: Fri, 23 Jan 2009 00:58:14 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r187607 - head/usr.bin/truss
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 23 Jan 2009 00:58:15 -0000

Author: trhodes
Date: Fri Jan 23 00:58:14 2009
New Revision: 187607
URL: http://svn.freebsd.org/changeset/base/187607

Log:
  Attaching to the init process returns EINVAL,
  so give an example that is more likely to work.
  Stolen from the ktrace(1) manual page.
  
  PR:		128222
  Submitted by:	Mateusz Guzik 

Modified:
  head/usr.bin/truss/truss.1

Modified: head/usr.bin/truss/truss.1
==============================================================================
--- head/usr.bin/truss/truss.1	Fri Jan 23 00:51:25 2009	(r187606)
+++ head/usr.bin/truss/truss.1	Fri Jan 23 00:58:14 2009	(r187607)
@@ -1,6 +1,6 @@
 .\" $FreeBSD$
 .\"
-.Dd January 2, 2004
+.Dd January 22, 2009
 .Dt TRUSS 1
 .Os
 .Sh NAME
@@ -85,7 +85,7 @@ options are mutually exclusive.)
 # Do the same, but put the output into a file
 .Dl $ truss -o /tmp/truss.out /bin/echo hello
 # Follow an already-running process
-.Dl $ truss -p 1
+.Dl $ truss -p 34
 .Sh SEE ALSO
 .Xr kdump 1 ,
 .Xr ktrace 1 ,

From owner-svn-src-head@FreeBSD.ORG  Fri Jan 23 03:15:29 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3714F106566B;
	Fri, 23 Jan 2009 03:15:29 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 25D3D8FC08;
	Fri, 23 Jan 2009 03:15:29 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0N3FSGU029675;
	Fri, 23 Jan 2009 03:15:28 GMT (envelope-from sam@svn.freebsd.org)
Received: (from sam@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0N3FSOY029674;
	Fri, 23 Jan 2009 03:15:28 GMT (envelope-from sam@svn.freebsd.org)
Message-Id: <200901230315.n0N3FSOY029674@svn.freebsd.org>
From: Sam Leffler 
Date: Fri, 23 Jan 2009 03:15:28 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r187608 - head/sys/dev/ath
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 23 Jan 2009 03:15:29 -0000

Author: sam
Date: Fri Jan 23 03:15:28 2009
New Revision: 187608
URL: http://svn.freebsd.org/changeset/base/187608

Log:
  don't run the calibration code if scanning, we won't be on the home channel

Modified:
  head/sys/dev/ath/if_ath.c

Modified: head/sys/dev/ath/if_ath.c
==============================================================================
--- head/sys/dev/ath/if_ath.c	Fri Jan 23 00:58:14 2009	(r187607)
+++ head/sys/dev/ath/if_ath.c	Fri Jan 23 03:15:28 2009	(r187608)
@@ -5793,9 +5793,12 @@ ath_calibrate(void *arg)
 	struct ath_softc *sc = arg;
 	struct ath_hal *ah = sc->sc_ah;
 	struct ifnet *ifp = sc->sc_ifp;
+	struct ieee80211com *ic = ifp->if_l2com;
 	HAL_BOOL longCal, isCalDone;
 	int nextcal;
 
+	if (ic->ic_flags & IEEE80211_F_SCAN)	/* defer, off channel */
+		goto restart;
 	longCal = (ticks - sc->sc_lastlongcal >= ath_longcalinterval*hz);
 	if (longCal) {
 		sc->sc_stats.ast_per_cal++;
@@ -5833,6 +5836,7 @@ ath_calibrate(void *arg)
 		sc->sc_stats.ast_per_calfail++;
 	}
 	if (!isCalDone) {
+restart:
 		/*
 		 * Use a shorter interval to potentially collect multiple
 		 * data samples required to complete calibration.  Once

From owner-svn-src-head@FreeBSD.ORG  Fri Jan 23 03:46:44 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A2D521065670;
	Fri, 23 Jan 2009 03:46:44 +0000 (UTC)
	(envelope-from keramida@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 921348FC16;
	Fri, 23 Jan 2009 03:46:44 +0000 (UTC)
	(envelope-from keramida@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0N3ki8v030251;
	Fri, 23 Jan 2009 03:46:44 GMT
	(envelope-from keramida@svn.freebsd.org)
Received: (from keramida@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0N3kisr030250;
	Fri, 23 Jan 2009 03:46:44 GMT
	(envelope-from keramida@svn.freebsd.org)
Message-Id: <200901230346.n0N3kisr030250@svn.freebsd.org>
From: Giorgos Keramidas 
Date: Fri, 23 Jan 2009 03:46:44 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r187609 - head/bin/dd
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 23 Jan 2009 03:46:45 -0000

Author: keramida (doc committer)
Date: Fri Jan 23 03:46:44 2009
New Revision: 187609
URL: http://svn.freebsd.org/changeset/base/187609

Log:
  Add an example of using bs=2048 to duplicate data CD-ROMs.
  
  This should be a bit useful for users who look at the manpage and
  then try to copy data CD-ROM disks using dd.  A lot of us know
  that bs=2048 is required, but it still manages to cause a bit of
  grief to those who haven't heard about it.
  
  PR:		bin/130857
  Submitted by:	Tri Brotoharsono < mail at tribrotoharsono.net >
  MFC after:	3 days

Modified:
  head/bin/dd/dd.1

Modified: head/bin/dd/dd.1
==============================================================================
--- head/bin/dd/dd.1	Fri Jan 23 03:15:28 2009	(r187608)
+++ head/bin/dd/dd.1	Fri Jan 23 03:46:44 2009	(r187609)
@@ -392,6 +392,11 @@ Remove parity bit from a file:
 Check for (even) parity errors on a file:
 .Pp
 .Dl "dd if=file conv=pareven | cmp -x - file"
+.Pp
+To create an image of a Mode-1 CD-ROM, which is a commonly used format
+for data CD-ROM disks, use a block size of 2048 bytes:
+.Pp
+.Dl "dd if=/dev/acd0 of=filename.iso bs=2048"
 .Sh SEE ALSO
 .Xr cp 1 ,
 .Xr mt 1 ,

From owner-svn-src-head@FreeBSD.ORG  Fri Jan 23 05:04:50 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 74E7C1065673;
	Fri, 23 Jan 2009 05:04:50 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2EE988FC1D;
	Fri, 23 Jan 2009 05:04:50 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0N54oq1031700;
	Fri, 23 Jan 2009 05:04:50 GMT (envelope-from weongyo@svn.freebsd.org)
Received: (from weongyo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0N54oD8031697;
	Fri, 23 Jan 2009 05:04:50 GMT (envelope-from weongyo@svn.freebsd.org)
Message-Id: <200901230504.n0N54oD8031697@svn.freebsd.org>
From: Weongyo Jeong 
Date: Fri, 23 Jan 2009 05:04:50 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r187610 - in head: share/man/man4 sys/dev/usb
	sys/modules/urtw
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 23 Jan 2009 05:04:50 -0000

Author: weongyo
Date: Fri Jan 23 05:04:49 2009
New Revision: 187610
URL: http://svn.freebsd.org/changeset/base/187610

Log:
  Add a new USB wireless driver, urtw(4) for supporting Realtek's 8187L
  chipset.

Added:
  head/share/man/man4/urtw.4   (contents, props changed)
  head/sys/dev/usb/if_urtw.c   (contents, props changed)
  head/sys/dev/usb/if_urtwreg.h   (contents, props changed)
  head/sys/dev/usb/if_urtwvar.h   (contents, props changed)
  head/sys/modules/urtw/
  head/sys/modules/urtw/Makefile   (contents, props changed)
Modified:
  head/sys/dev/usb/usbdevs

Added: head/share/man/man4/urtw.4
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/share/man/man4/urtw.4	Fri Jan 23 05:04:49 2009	(r187610)
@@ -0,0 +1,118 @@
+.\" Copyright (c) 2008 Weongyo Jeong
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd November 15 2008 $
+.Dt URTW 4
+.Os
+.Sh NAME
+.Nm urtw
+.Nd Realtek RTL8187L USB IEEE 802.11b/g wireless network device
+.Sh SYNOPSIS
+To compile this driver into the kernel,
+place the following lines in your kernel configuration file:
+.Bd -ragged -offset indent
+.Cd "device ehci"
+.Cd "device uhci"
+.Cd "device ohci"
+.Cd "device usb"
+.Cd "device urtw"
+.Cd "device wlan"
+.Ed
+.Pp
+Alternatively, to load the driver as a module at boot time,
+place the following line in
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+if_urtw_load="YES"
+.Ed
+.Sh DESCRIPTION
+The
+.Nm
+driver supports USB 802.11b/g wireless adapters based on the
+Realtek RTL8187L.
+.Pp
+.Nm
+supports
+.Cm station
+and
+.Cm monitor
+mode operation.
+Only one virtual interface may be configured at any time.
+For more information on configuring this device, see
+.Xr ifconfig 8 .
+.Sh HARDWARE
+The following adapters should work:
+.Pp
+.Bl -column "Card                        " "Radio    " "Bus" -compact -offset 6n
+.It Em "Card	Radio	Bus"
+.It Li "Netgear WG111v2" Ta RTL8225 Ta USB
+.It Li "Safehome WLG-1500SMA5" Ta RTL8225 Ta USB
+.It Li "Shuttle XPC Accessory PN20" Ta RTL8225 Ta USB
+.El
+.Sh EXAMPLES
+Join an existing BSS network (i.e., connect to an access point):
+.Pp
+.Bd -literal -offset indent
+ifconfig wlan create wlandev urtw0 inet 192.168.0.20 \e
+    netmask 0xffffff00
+.Ed
+.Pp
+Join a specific BSS network with network name
+.Dq Li my_net :
+.Pp
+.Dl "ifconfig wlan create wlandev urtw0 ssid my_net up"
+.Pp
+Join a specific BSS network with 64-bit WEP encryption:
+.Bd -literal -offset indent
+ifconfig wlan create wlandev urtw0 ssid my_net \e
+	wepmode on wepkey 0x1234567890 weptxkey 1 up
+.Ed
+.Sh SEE ALSO
+.Xr intro 4 ,
+.Xr netintro 4 ,
+.Xr usb 4 ,
+.Xr wlan 4 ,
+.Xr wlan_ccmp 4 ,
+.Xr wlan_tkip 4 ,
+.Xr wlan_wep 4 ,
+.Xr ifconfig 8 ,
+.Xr wpa_supplicant 8
+.Rs
+.%T Realtek
+.%O http://www.realtek.com.tw
+.Re
+.Sh HISTORY
+The
+.Nm
+device driver first appeared in
+.Fx 8.0 .
+.Sh AUTHORS
+.An -nosplit
+The
+.Nm
+driver was written by
+.An Weongyo Jeong
+.Aq weongyo@FreeBSD.org .

Added: head/sys/dev/usb/if_urtw.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/dev/usb/if_urtw.c	Fri Jan 23 05:04:49 2009	(r187610)
@@ -0,0 +1,3324 @@
+/*-
+ * Copyright (c) 2008 Weongyo Jeong 
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#ifdef INET
+#include 
+#include 
+#include 
+#include 
+#include 
+#endif
+
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include "usbdevs.h"
+
+#include 
+#include 
+
+SYSCTL_NODE(_hw_usb, OID_AUTO, urtw, CTLFLAG_RW, 0, "USB Realtek 8187L");
+#ifdef URTW_DEBUG
+int urtw_debug = 0;
+SYSCTL_INT(_hw_usb_urtw, OID_AUTO, debug, CTLFLAG_RW, &urtw_debug, 0,
+    "control debugging printfs");
+TUNABLE_INT("hw.usb.urtw.debug", &urtw_debug);
+enum {
+	URTW_DEBUG_XMIT		= 0x00000001,	/* basic xmit operation */
+	URTW_DEBUG_RECV		= 0x00000002,	/* basic recv operation */
+	URTW_DEBUG_RESET	= 0x00000004,	/* reset processing */
+	URTW_DEBUG_TX_PROC	= 0x00000008,	/* tx ISR proc */
+	URTW_DEBUG_RX_PROC	= 0x00000010,	/* rx ISR proc */
+	URTW_DEBUG_STATE	= 0x00000020,	/* 802.11 state transitions */
+	URTW_DEBUG_STAT		= 0x00000040,	/* statistic */
+	URTW_DEBUG_ANY		= 0xffffffff
+};
+#define	DPRINTF(sc, m, fmt, ...) do {				\
+	if (sc->sc_debug & (m))					\
+		printf(fmt, __VA_ARGS__);			\
+} while (0)
+#else
+#define	DPRINTF(sc, m, fmt, ...) do {				\
+	(void) sc;						\
+} while (0)
+#endif
+int urtw_preamble_mode = URTW_PREAMBLE_MODE_LONG;
+SYSCTL_INT(_hw_usb_urtw, OID_AUTO, preamble_mode, CTLFLAG_RW,
+    &urtw_preamble_mode, 0, "set the preable mode (long or short)");
+TUNABLE_INT("hw.usb.urtw.preamble_mode", &urtw_preamble_mode);
+
+/* recognized device vendors/products */
+static const struct usb_devno urtw_devs[] = {
+#define	URTW_DEV(v,p) { USB_VENDOR_##v, USB_PRODUCT_##v##_##p }
+	URTW_DEV(REALTEK, RTL8187),
+	URTW_DEV(NETGEAR, WG111V2)
+#undef URTW_DEV
+};
+
+#define urtw_read8_m(sc, val, data)	do {			\
+	error = urtw_read8_c(sc, val, data);			\
+	if (error != 0)						\
+		goto fail;					\
+} while (0)
+#define urtw_write8_m(sc, val, data)	do {			\
+	error = urtw_write8_c(sc, val, data);			\
+	if (error != 0)						\
+		goto fail;					\
+} while (0)
+#define urtw_read16_m(sc, val, data)	do {			\
+	error = urtw_read16_c(sc, val, data);			\
+	if (error != 0)						\
+		goto fail;					\
+} while (0)
+#define urtw_write16_m(sc, val, data)	do {			\
+	error = urtw_write16_c(sc, val, data);			\
+	if (error != 0)						\
+		goto fail;					\
+} while (0)
+#define urtw_read32_m(sc, val, data)	do {			\
+	error = urtw_read32_c(sc, val, data);			\
+	if (error != 0)						\
+		goto fail;					\
+} while (0)
+#define urtw_write32_m(sc, val, data)	do {			\
+	error = urtw_write32_c(sc, val, data);			\
+	if (error != 0)						\
+		goto fail;					\
+} while (0)
+#define urtw_8187_write_phy_ofdm(sc, val, data)	do {		\
+	error = urtw_8187_write_phy_ofdm_c(sc, val, data);	\
+	if (error != 0)						\
+		goto fail;					\
+} while (0)
+#define urtw_8187_write_phy_cck(sc, val, data)	do {		\
+	error = urtw_8187_write_phy_cck_c(sc, val, data);	\
+	if (error != 0)						\
+		goto fail;					\
+} while (0)
+#define urtw_8225_write(sc, val, data)	do {			\
+	error = urtw_8225_write_c(sc, val, data);		\
+	if (error != 0)						\
+		goto fail;					\
+} while (0)
+
+struct urtw_pair {
+	uint32_t	reg;
+	uint32_t	val;
+};
+
+static uint8_t urtw_8225_agc[] = {
+	0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9d, 0x9c, 0x9b,
+	0x9a, 0x99, 0x98, 0x97, 0x96, 0x95, 0x94, 0x93, 0x92, 0x91, 0x90,
+	0x8f, 0x8e, 0x8d, 0x8c, 0x8b, 0x8a, 0x89, 0x88, 0x87, 0x86, 0x85,
+	0x84, 0x83, 0x82, 0x81, 0x80, 0x3f, 0x3e, 0x3d, 0x3c, 0x3b, 0x3a,
+	0x39, 0x38, 0x37, 0x36, 0x35, 0x34, 0x33, 0x32, 0x31, 0x30, 0x2f,
+	0x2e, 0x2d, 0x2c, 0x2b, 0x2a, 0x29, 0x28, 0x27, 0x26, 0x25, 0x24,
+	0x23, 0x22, 0x21, 0x20, 0x1f, 0x1e, 0x1d, 0x1c, 0x1b, 0x1a, 0x19,
+	0x18, 0x17, 0x16, 0x15, 0x14, 0x13, 0x12, 0x11, 0x10, 0x0f, 0x0e,
+	0x0d, 0x0c, 0x0b, 0x0a, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03,
+	0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+	0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+	0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01
+};
+
+static uint32_t urtw_8225_channel[] = {
+	0x0000,		/* dummy channel 0  */
+	0x085c,		/* 1  */
+	0x08dc,		/* 2  */
+	0x095c,		/* 3  */
+	0x09dc,		/* 4  */
+	0x0a5c,		/* 5  */
+	0x0adc,		/* 6  */
+	0x0b5c,		/* 7  */
+	0x0bdc,		/* 8  */
+	0x0c5c,		/* 9  */
+	0x0cdc,		/* 10  */
+	0x0d5c,		/* 11  */
+	0x0ddc,		/* 12  */
+	0x0e5c,		/* 13  */
+	0x0f72,		/* 14  */
+};
+
+static uint8_t urtw_8225_gain[] = {
+	0x23, 0x88, 0x7c, 0xa5,		/* -82dbm  */
+	0x23, 0x88, 0x7c, 0xb5,		/* -82dbm  */
+	0x23, 0x88, 0x7c, 0xc5,		/* -82dbm  */
+	0x33, 0x80, 0x79, 0xc5,		/* -78dbm  */
+	0x43, 0x78, 0x76, 0xc5,		/* -74dbm  */
+	0x53, 0x60, 0x73, 0xc5,		/* -70dbm  */
+	0x63, 0x58, 0x70, 0xc5,		/* -66dbm  */
+};
+
+static struct urtw_pair urtw_8225_rf_part1[] = {
+	{ 0x00, 0x0067 }, { 0x01, 0x0fe0 }, { 0x02, 0x044d }, { 0x03, 0x0441 },
+	{ 0x04, 0x0486 }, { 0x05, 0x0bc0 }, { 0x06, 0x0ae6 }, { 0x07, 0x082a },
+	{ 0x08, 0x001f }, { 0x09, 0x0334 }, { 0x0a, 0x0fd4 }, { 0x0b, 0x0391 },
+	{ 0x0c, 0x0050 }, { 0x0d, 0x06db }, { 0x0e, 0x0029 }, { 0x0f, 0x0914 },
+};
+
+static struct urtw_pair urtw_8225_rf_part2[] = {
+	{ 0x00, 0x01 }, { 0x01, 0x02 }, { 0x02, 0x42 }, { 0x03, 0x00 },
+	{ 0x04, 0x00 }, { 0x05, 0x00 }, { 0x06, 0x40 }, { 0x07, 0x00 },
+	{ 0x08, 0x40 }, { 0x09, 0xfe }, { 0x0a, 0x09 }, { 0x0b, 0x80 },
+	{ 0x0c, 0x01 }, { 0x0e, 0xd3 }, { 0x0f, 0x38 }, { 0x10, 0x84 },
+	{ 0x11, 0x06 }, { 0x12, 0x20 }, { 0x13, 0x20 }, { 0x14, 0x00 },
+	{ 0x15, 0x40 }, { 0x16, 0x00 }, { 0x17, 0x40 }, { 0x18, 0xef },
+	{ 0x19, 0x19 }, { 0x1a, 0x20 }, { 0x1b, 0x76 }, { 0x1c, 0x04 },
+	{ 0x1e, 0x95 }, { 0x1f, 0x75 }, { 0x20, 0x1f }, { 0x21, 0x27 },
+	{ 0x22, 0x16 }, { 0x24, 0x46 }, { 0x25, 0x20 }, { 0x26, 0x90 },
+	{ 0x27, 0x88 }
+};
+
+static struct urtw_pair urtw_8225_rf_part3[] = {
+	{ 0x00, 0x98 }, { 0x03, 0x20 }, { 0x04, 0x7e }, { 0x05, 0x12 },
+	{ 0x06, 0xfc }, { 0x07, 0x78 }, { 0x08, 0x2e }, { 0x10, 0x9b },
+	{ 0x11, 0x88 }, { 0x12, 0x47 }, { 0x13, 0xd0 }, { 0x19, 0x00 },
+	{ 0x1a, 0xa0 }, { 0x1b, 0x08 }, { 0x40, 0x86 }, { 0x41, 0x8d },
+	{ 0x42, 0x15 }, { 0x43, 0x18 }, { 0x44, 0x1f }, { 0x45, 0x1e },
+	{ 0x46, 0x1a }, { 0x47, 0x15 }, { 0x48, 0x10 }, { 0x49, 0x0a },
+	{ 0x4a, 0x05 }, { 0x4b, 0x02 }, { 0x4c, 0x05 }
+};
+
+static uint16_t urtw_8225_rxgain[] = {
+	0x0400, 0x0401, 0x0402, 0x0403, 0x0404, 0x0405, 0x0408, 0x0409,
+	0x040a, 0x040b, 0x0502, 0x0503, 0x0504, 0x0505, 0x0540, 0x0541,
+	0x0542, 0x0543, 0x0544, 0x0545, 0x0580, 0x0581, 0x0582, 0x0583,
+	0x0584, 0x0585, 0x0588, 0x0589, 0x058a, 0x058b, 0x0643, 0x0644,
+	0x0645, 0x0680, 0x0681, 0x0682, 0x0683, 0x0684, 0x0685, 0x0688,
+	0x0689, 0x068a, 0x068b, 0x068c, 0x0742, 0x0743, 0x0744, 0x0745,
+	0x0780, 0x0781, 0x0782, 0x0783, 0x0784, 0x0785, 0x0788, 0x0789,
+	0x078a, 0x078b, 0x078c, 0x078d, 0x0790, 0x0791, 0x0792, 0x0793,
+	0x0794, 0x0795, 0x0798, 0x0799, 0x079a, 0x079b, 0x079c, 0x079d,
+	0x07a0, 0x07a1, 0x07a2, 0x07a3, 0x07a4, 0x07a5, 0x07a8, 0x07a9,
+	0x07aa, 0x07ab, 0x07ac, 0x07ad, 0x07b0, 0x07b1, 0x07b2, 0x07b3,
+	0x07b4, 0x07b5, 0x07b8, 0x07b9, 0x07ba, 0x07bb, 0x07bb
+};
+
+static uint8_t urtw_8225_threshold[] = {
+	0x8d, 0x8d, 0x8d, 0x8d, 0x9d, 0xad, 0xbd,
+};
+
+static uint8_t urtw_8225_tx_gain_cck_ofdm[] = {
+	0x02, 0x06, 0x0e, 0x1e, 0x3e, 0x7e
+};
+
+static uint8_t urtw_8225_txpwr_cck[] = {
+	0x18, 0x17, 0x15, 0x11, 0x0c, 0x08, 0x04, 0x02,
+	0x1b, 0x1a, 0x17, 0x13, 0x0e, 0x09, 0x04, 0x02,
+	0x1f, 0x1e, 0x1a, 0x15, 0x10, 0x0a, 0x05, 0x02,
+	0x22, 0x21, 0x1d, 0x18, 0x11, 0x0b, 0x06, 0x02,
+	0x26, 0x25, 0x21, 0x1b, 0x14, 0x0d, 0x06, 0x03,
+	0x2b, 0x2a, 0x25, 0x1e, 0x16, 0x0e, 0x07, 0x03
+};
+
+static uint8_t urtw_8225_txpwr_cck_ch14[] = {
+	0x18, 0x17, 0x15, 0x0c, 0x00, 0x00, 0x00, 0x00,
+	0x1b, 0x1a, 0x17, 0x0e, 0x00, 0x00, 0x00, 0x00,
+	0x1f, 0x1e, 0x1a, 0x0f, 0x00, 0x00, 0x00, 0x00,
+	0x22, 0x21, 0x1d, 0x11, 0x00, 0x00, 0x00, 0x00,
+	0x26, 0x25, 0x21, 0x13, 0x00, 0x00, 0x00, 0x00,
+	0x2b, 0x2a, 0x25, 0x15, 0x00, 0x00, 0x00, 0x00
+};
+
+static uint8_t urtw_8225_txpwr_ofdm[]={
+	0x80, 0x90, 0xa2, 0xb5, 0xcb, 0xe4
+};
+
+static uint8_t urtw_8225v2_gain_bg[]={
+	0x23, 0x15, 0xa5,		/* -82-1dbm  */
+	0x23, 0x15, 0xb5,		/* -82-2dbm  */
+	0x23, 0x15, 0xc5,		/* -82-3dbm  */
+	0x33, 0x15, 0xc5,		/* -78dbm  */
+	0x43, 0x15, 0xc5,		/* -74dbm  */
+	0x53, 0x15, 0xc5,		/* -70dbm  */
+	0x63, 0x15, 0xc5,		/* -66dbm  */
+};
+
+static struct urtw_pair urtw_8225v2_rf_part1[] = {
+	{ 0x00, 0x02bf }, { 0x01, 0x0ee0 }, { 0x02, 0x044d }, { 0x03, 0x0441 },
+	{ 0x04, 0x08c3 }, { 0x05, 0x0c72 }, { 0x06, 0x00e6 }, { 0x07, 0x082a },
+	{ 0x08, 0x003f }, { 0x09, 0x0335 }, { 0x0a, 0x09d4 }, { 0x0b, 0x07bb },
+	{ 0x0c, 0x0850 }, { 0x0d, 0x0cdf }, { 0x0e, 0x002b }, { 0x0f, 0x0114 }
+};
+
+static struct urtw_pair urtw_8225v2_rf_part2[] = {
+	{ 0x00, 0x01 }, { 0x01, 0x02 }, { 0x02, 0x42 }, { 0x03, 0x00 },
+	{ 0x04, 0x00 },	{ 0x05, 0x00 }, { 0x06, 0x40 }, { 0x07, 0x00 },
+	{ 0x08, 0x40 }, { 0x09, 0xfe }, { 0x0a, 0x08 }, { 0x0b, 0x80 },
+	{ 0x0c, 0x01 }, { 0x0d, 0x43 }, { 0x0e, 0xd3 }, { 0x0f, 0x38 },
+	{ 0x10, 0x84 }, { 0x11, 0x07 }, { 0x12, 0x20 }, { 0x13, 0x20 },
+	{ 0x14, 0x00 }, { 0x15, 0x40 }, { 0x16, 0x00 }, { 0x17, 0x40 },
+	{ 0x18, 0xef }, { 0x19, 0x19 }, { 0x1a, 0x20 }, { 0x1b, 0x15 },
+	{ 0x1c, 0x04 }, { 0x1d, 0xc5 }, { 0x1e, 0x95 }, { 0x1f, 0x75 },
+	{ 0x20, 0x1f }, { 0x21, 0x17 }, { 0x22, 0x16 }, { 0x23, 0x80 },
+	{ 0x24, 0x46 }, { 0x25, 0x00 }, { 0x26, 0x90 }, { 0x27, 0x88 }
+};
+
+static struct urtw_pair urtw_8225v2_rf_part3[] = {
+	{ 0x00, 0x98 }, { 0x03, 0x20 }, { 0x04, 0x7e }, { 0x05, 0x12 },
+	{ 0x06, 0xfc }, { 0x07, 0x78 }, { 0x08, 0x2e }, { 0x09, 0x11 },
+	{ 0x0a, 0x17 }, { 0x0b, 0x11 }, { 0x10, 0x9b }, { 0x11, 0x88 },
+	{ 0x12, 0x47 }, { 0x13, 0xd0 }, { 0x19, 0x00 }, { 0x1a, 0xa0 },
+	{ 0x1b, 0x08 }, { 0x1d, 0x00 }, { 0x40, 0x86 }, { 0x41, 0x9d },
+	{ 0x42, 0x15 }, { 0x43, 0x18 }, { 0x44, 0x36 }, { 0x45, 0x35 },
+	{ 0x46, 0x2e }, { 0x47, 0x25 }, { 0x48, 0x1c }, { 0x49, 0x12 },
+	{ 0x4a, 0x09 }, { 0x4b, 0x04 }, { 0x4c, 0x05 }
+};
+
+static uint16_t urtw_8225v2_rxgain[] = {
+	0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0008, 0x0009,
+	0x000a, 0x000b, 0x0102, 0x0103, 0x0104, 0x0105, 0x0140, 0x0141,
+	0x0142, 0x0143, 0x0144, 0x0145, 0x0180, 0x0181, 0x0182, 0x0183,
+	0x0184, 0x0185, 0x0188, 0x0189, 0x018a, 0x018b, 0x0243, 0x0244,
+	0x0245, 0x0280, 0x0281, 0x0282, 0x0283, 0x0284, 0x0285, 0x0288,
+	0x0289, 0x028a, 0x028b, 0x028c, 0x0342, 0x0343, 0x0344, 0x0345,
+	0x0380, 0x0381, 0x0382, 0x0383, 0x0384, 0x0385, 0x0388, 0x0389,
+	0x038a, 0x038b, 0x038c, 0x038d, 0x0390, 0x0391, 0x0392, 0x0393,
+	0x0394, 0x0395, 0x0398, 0x0399, 0x039a, 0x039b, 0x039c, 0x039d,
+	0x03a0, 0x03a1, 0x03a2, 0x03a3, 0x03a4, 0x03a5, 0x03a8, 0x03a9,
+	0x03aa, 0x03ab, 0x03ac, 0x03ad, 0x03b0, 0x03b1, 0x03b2, 0x03b3,
+	0x03b4, 0x03b5, 0x03b8, 0x03b9, 0x03ba, 0x03bb, 0x03bb
+};
+
+static uint8_t urtw_8225v2_tx_gain_cck_ofdm[] = {
+	0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
+	0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b,
+	0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11,
+	0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
+	0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d,
+	0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23,
+};
+
+static uint8_t urtw_8225v2_txpwr_cck[] = {
+	0x36, 0x35, 0x2e, 0x25, 0x1c, 0x12, 0x09, 0x04
+};
+
+static uint8_t urtw_8225v2_txpwr_cck_ch14[] = {
+	0x36, 0x35, 0x2e, 0x1b, 0x00, 0x00, 0x00, 0x00
+};
+
+static struct urtw_pair urtw_ratetable[] = {
+	{  2,  0 }, {   4,  1 }, { 11, 2 }, { 12, 4 }, { 18, 5 },
+	{ 22,  3 }, {  24,  6 }, { 36, 7 }, { 48, 8 }, { 72, 9 },
+	{ 96, 10 }, { 108, 11 }
+};
+
+static struct ieee80211vap *urtw_vap_create(struct ieee80211com *,
+			    const char name[IFNAMSIZ], int unit, int opmode,
+			    int flags, const uint8_t bssid[IEEE80211_ADDR_LEN],
+			    const uint8_t mac[IEEE80211_ADDR_LEN]);
+static void		urtw_vap_delete(struct ieee80211vap *);
+static void		urtw_init(void *);
+static void		urtw_stop(struct ifnet *, int);
+static int		urtw_ioctl(struct ifnet *, u_long, caddr_t);
+static void		urtw_start(struct ifnet *);
+static int		urtw_alloc_rx_data_list(struct urtw_softc *);
+static int		urtw_alloc_tx_data_list(struct urtw_softc *);
+static void		urtw_free_data_list(struct urtw_softc *,
+			    usbd_pipe_handle, usbd_pipe_handle,
+			    struct urtw_data data[], int);
+static int		urtw_raw_xmit(struct ieee80211_node *, struct mbuf *,
+			    const struct ieee80211_bpf_params *);
+static void		urtw_scan_start(struct ieee80211com *);
+static void		urtw_scan_end(struct ieee80211com *);
+static void		urtw_set_channel(struct ieee80211com *);
+static void		urtw_update_mcast(struct ifnet *);
+static void		urtw_rxeof(usbd_xfer_handle, usbd_private_handle,
+			    usbd_status);
+static int		urtw_tx_start(struct urtw_softc *,
+			    struct ieee80211_node *, struct mbuf *, int);
+static void		urtw_txeof_low(usbd_xfer_handle, usbd_private_handle,
+			    usbd_status);
+static void		urtw_txeof_normal(usbd_xfer_handle, 
+			    usbd_private_handle, usbd_status);
+static int		urtw_newstate(struct ieee80211vap *,
+			    enum ieee80211_state, int);
+static void		urtw_ledtask(void *);
+static void		urtw_ledusbtask(void *);
+static void		urtw_ctxtask(void *);
+static void		urtw_task(void *);
+static void		urtw_watchdog(void *);
+static void		urtw_set_multi(void *);
+static int		urtw_isbmode(uint16_t);
+static uint16_t		urtw_rate2rtl(int);
+static uint16_t		urtw_rtl2rate(int);
+static usbd_status	urtw_set_rate(struct urtw_softc *);
+static usbd_status	urtw_update_msr(struct urtw_softc *);
+static usbd_status	urtw_read8_c(struct urtw_softc *, int, uint8_t *);
+static usbd_status	urtw_read16_c(struct urtw_softc *, int, uint16_t *);
+static usbd_status	urtw_read32_c(struct urtw_softc *, int, uint32_t *);
+static usbd_status	urtw_write8_c(struct urtw_softc *, int, uint8_t);
+static usbd_status	urtw_write16_c(struct urtw_softc *, int, uint16_t);
+static usbd_status	urtw_write32_c(struct urtw_softc *, int, uint32_t);
+static usbd_status	urtw_eprom_cs(struct urtw_softc *, int);
+static usbd_status	urtw_eprom_ck(struct urtw_softc *);
+static usbd_status	urtw_eprom_sendbits(struct urtw_softc *, int16_t *,
+			    int);
+static usbd_status	urtw_eprom_read32(struct urtw_softc *, uint32_t,
+			    uint32_t *);
+static usbd_status	urtw_eprom_readbit(struct urtw_softc *, int16_t *);
+static usbd_status	urtw_eprom_writebit(struct urtw_softc *, int16_t);
+static usbd_status	urtw_get_macaddr(struct urtw_softc *);
+static usbd_status	urtw_get_txpwr(struct urtw_softc *);
+static usbd_status	urtw_get_rfchip(struct urtw_softc *);
+static usbd_status	urtw_led_init(struct urtw_softc *);
+static usbd_status	urtw_8185_rf_pins_enable(struct urtw_softc *);
+static usbd_status	urtw_8185_tx_antenna(struct urtw_softc *, uint8_t);
+static usbd_status	urtw_8187_write_phy(struct urtw_softc *, uint8_t,
+			    uint32_t);
+static usbd_status	urtw_8187_write_phy_ofdm_c(struct urtw_softc *,
+			    uint8_t, uint32_t);
+static usbd_status	urtw_8187_write_phy_cck_c(struct urtw_softc *, uint8_t,
+			    uint32_t);
+static usbd_status	urtw_8225_setgain(struct urtw_softc *, int16_t);
+static usbd_status	urtw_8225_usb_init(struct urtw_softc *);
+static usbd_status	urtw_8225_write_c(struct urtw_softc *, uint8_t,
+			    uint16_t);
+static usbd_status	urtw_8225_write_s16(struct urtw_softc *, uint8_t, int,
+			    uint16_t *);
+static usbd_status	urtw_8225_read(struct urtw_softc *, uint8_t,
+			    uint32_t *);
+static usbd_status	urtw_8225_rf_init(struct urtw_softc *);
+static usbd_status	urtw_8225_rf_set_chan(struct urtw_softc *, int);
+static usbd_status	urtw_8225_rf_set_sens(struct urtw_softc *, int);
+static usbd_status	urtw_8225_set_txpwrlvl(struct urtw_softc *, int);
+static usbd_status	urtw_8225v2_rf_init(struct urtw_softc *);
+static usbd_status	urtw_8225v2_rf_set_chan(struct urtw_softc *, int);
+static usbd_status	urtw_8225v2_set_txpwrlvl(struct urtw_softc *, int);
+static usbd_status	urtw_8225v2_setgain(struct urtw_softc *, int16_t);
+static usbd_status	urtw_8225_isv2(struct urtw_softc *, int *);
+static usbd_status	urtw_read8e(struct urtw_softc *, int, uint8_t *);
+static usbd_status	urtw_write8e(struct urtw_softc *, int, uint8_t);
+static usbd_status	urtw_8180_set_anaparam(struct urtw_softc *, uint32_t);
+static usbd_status	urtw_8185_set_anaparam2(struct urtw_softc *, uint32_t);
+static usbd_status	urtw_open_pipes(struct urtw_softc *);
+static usbd_status	urtw_close_pipes(struct urtw_softc *);
+static usbd_status	urtw_intr_enable(struct urtw_softc *);
+static usbd_status	urtw_intr_disable(struct urtw_softc *);
+static usbd_status	urtw_reset(struct urtw_softc *);
+static usbd_status	urtw_led_on(struct urtw_softc *, int);
+static usbd_status	urtw_led_ctl(struct urtw_softc *, int);
+static usbd_status	urtw_led_blink(struct urtw_softc *);
+static usbd_status	urtw_led_mode0(struct urtw_softc *, int);
+static usbd_status	urtw_led_mode1(struct urtw_softc *, int);
+static usbd_status	urtw_led_mode2(struct urtw_softc *, int);
+static usbd_status	urtw_led_mode3(struct urtw_softc *, int);
+static usbd_status	urtw_rx_setconf(struct urtw_softc *);
+static usbd_status	urtw_rx_enable(struct urtw_softc *);
+static usbd_status	urtw_tx_enable(struct urtw_softc *sc);
+
+static int
+urtw_match(device_t dev)
+{
+	struct usb_attach_arg *uaa = device_get_ivars(dev);
+	const struct usb_devno *ud;
+
+	if (uaa->iface != NULL)
+		return UMATCH_NONE;
+	ud = usb_lookup(urtw_devs, uaa->vendor, uaa->product);
+
+	return (ud != NULL ? UMATCH_VENDOR_PRODUCT : UMATCH_NONE);
+}
+
+static int
+urtw_attach(device_t dev)
+{
+	int ret = 0;
+	struct urtw_softc *sc = device_get_softc(dev);
+	struct usb_attach_arg *uaa = device_get_ivars(dev);
+	struct ieee80211com *ic;
+	struct ifnet *ifp;
+	uint8_t bands;
+	uint32_t data;
+	usbd_status error;
+
+	sc->sc_dev = dev;
+	sc->sc_udev = uaa->device;
+#ifdef URTW_DEBUG
+	sc->sc_debug = urtw_debug;
+#endif
+
+	mtx_init(&sc->sc_mtx, device_get_nameunit(sc->sc_dev), MTX_NETWORK_LOCK,
+	    MTX_DEF);
+	callout_init(&sc->sc_led_ch, 0);
+	callout_init(&sc->sc_watchdog_ch, 0);
+	usb_init_task(&sc->sc_ledtask, urtw_ledusbtask, sc);
+	usb_init_task(&sc->sc_ctxtask, urtw_ctxtask, sc);
+	usb_init_task(&sc->sc_task, urtw_task, sc);
+
+	urtw_read32_m(sc, URTW_RX, &data);
+	sc->sc_epromtype = (data & URTW_RX_9356SEL) ? URTW_EEPROM_93C56 :
+	    URTW_EEPROM_93C46;
+
+	error = urtw_get_rfchip(sc);
+	if (error != 0)
+		goto fail;
+	error = urtw_get_macaddr(sc);
+	if (error != 0)
+		goto fail;
+	error = urtw_get_txpwr(sc);
+	if (error != 0)
+		goto fail;
+	error = urtw_led_init(sc);
+	if (error != 0)
+		goto fail;
+
+	sc->sc_rts_retry = URTW_DEFAULT_RTS_RETRY;
+	sc->sc_tx_retry = URTW_DEFAULT_TX_RETRY;
+	sc->sc_currate = 3;
+	sc->sc_preamble_mode = urtw_preamble_mode;
+
+	ifp = sc->sc_ifp = if_alloc(IFT_IEEE80211);
+	if (ifp == NULL) {
+		device_printf(sc->sc_dev, "can not allocate ifnet\n");
+		ret = ENXIO;
+		goto fail;
+	}
+
+	ifp->if_softc = sc;
+	if_initname(ifp, "urtw", device_get_unit(sc->sc_dev));
+	ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST |
+	    IFF_NEEDSGIANT; /* USB stack is still under Giant lock */
+	ifp->if_init = urtw_init;
+	ifp->if_ioctl = urtw_ioctl;
+	ifp->if_start = urtw_start;
+	/* XXX URTW_TX_DATA_LIST_COUNT */
+	IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN);
+	ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN;
+	IFQ_SET_READY(&ifp->if_snd);
+
+	ic = ifp->if_l2com;
+	ic->ic_ifp = ifp;
+	ic->ic_phytype = IEEE80211_T_OFDM;	/* not only, but not used */
+	ic->ic_opmode = IEEE80211_M_STA;	/* default to BSS mode */
+
+	/* set device capabilities */
+	ic->ic_caps =
+	    IEEE80211_C_STA |		/* station mode */
+	    IEEE80211_C_MONITOR |	/* monitor mode supported */
+	    IEEE80211_C_TXPMGT |	/* tx power management */
+	    IEEE80211_C_SHPREAMBLE |	/* short preamble supported */
+	    IEEE80211_C_SHSLOT |	/* short slot time supported */
+	    IEEE80211_C_BGSCAN |	/* capable of bg scanning */
+	    IEEE80211_C_WPA;		/* 802.11i */
+
+	IEEE80211_ADDR_COPY(ic->ic_myaddr, sc->sc_bssid);
+
+	bands = 0;
+	setbit(&bands, IEEE80211_MODE_11B);
+	setbit(&bands, IEEE80211_MODE_11G);
+	ieee80211_init_channels(ic, NULL, &bands);
+
+	ieee80211_ifattach(ic);
+	ic->ic_raw_xmit = urtw_raw_xmit;
+	ic->ic_scan_start = urtw_scan_start;
+	ic->ic_scan_end = urtw_scan_end;
+	ic->ic_set_channel = urtw_set_channel;
+
+	ic->ic_vap_create = urtw_vap_create;
+	ic->ic_vap_delete = urtw_vap_delete;
+	ic->ic_update_mcast = urtw_update_mcast;
+
+	bpfattach(ifp, DLT_IEEE802_11_RADIO,
+	    sizeof (struct ieee80211_frame) + sizeof(sc->sc_txtap));
+
+	sc->sc_rxtap_len = sizeof sc->sc_rxtap;
+	sc->sc_rxtap.wr_ihdr.it_len = htole16(sc->sc_rxtap_len);
+	sc->sc_rxtap.wr_ihdr.it_present = htole32(URTW_RX_RADIOTAP_PRESENT);
+
+	sc->sc_txtap_len = sizeof sc->sc_txtap;
+	sc->sc_txtap.wt_ihdr.it_len = htole16(sc->sc_txtap_len);
+	sc->sc_txtap.wt_ihdr.it_present = htole32(URTW_TX_RADIOTAP_PRESENT);
+
+	if (bootverbose)
+		ieee80211_announce(ic);
+
+	usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev, sc->sc_dev);
+fail:
+	return (ret);
+}
+
+static usbd_status
+urtw_open_pipes(struct urtw_softc *sc)
+{
+	usbd_status error;
+
+	/*
+	 * NB: there is no way to distinguish each pipes so we need to hardcode
+	 * pipe numbers
+	 */
+
+	/* tx pipe - low priority packets  */
+	error = usbd_open_pipe(sc->sc_iface, 0x2, USBD_EXCLUSIVE_USE,
+	    &sc->sc_txpipe_low);
+	if (error != 0) {
+		device_printf(sc->sc_dev, "could not open Tx low pipe: %s\n",
+		    usbd_errstr(error));
+		goto fail;
+	}
+	/* tx pipe - normal priority packets  */
+	error = usbd_open_pipe(sc->sc_iface, 0x3, USBD_EXCLUSIVE_USE,
+	    &sc->sc_txpipe_normal);
+	if (error != 0) {
+		device_printf(sc->sc_dev, "could not open Tx normal pipe: %s\n",
+		    usbd_errstr(error));
+		goto fail;
+	}
+	/* rx pipe  */
+	error = usbd_open_pipe(sc->sc_iface, 0x81, USBD_EXCLUSIVE_USE,
+	    &sc->sc_rxpipe);
+	if (error != 0) {
+		device_printf(sc->sc_dev, "could not open Rx pipe: %s\n",
+		    usbd_errstr(error));
+		goto fail;
+	}
+
+	return (0);
+fail:
+	(void)urtw_close_pipes(sc);
+	return (error);
+}
+
+static usbd_status
+urtw_close_pipes(struct urtw_softc *sc)
+{
+	usbd_status error = 0;
+
+	if (sc->sc_rxpipe != NULL) {
+		error = usbd_close_pipe(sc->sc_rxpipe);
+		if (error != 0)
+			goto fail;
+		sc->sc_rxpipe = NULL;
+	}
+	if (sc->sc_txpipe_low != NULL) {
+		error = usbd_close_pipe(sc->sc_txpipe_low);
+		if (error != 0)
+			goto fail;
+		sc->sc_txpipe_low = NULL;
+	}
+	if (sc->sc_txpipe_normal != NULL) {
+		error = usbd_close_pipe(sc->sc_txpipe_normal);
+		if (error != 0)
+			goto fail;
+		sc->sc_txpipe_normal = NULL;
+	}
+fail:
+	return (error);
+}
+
+static int
+urtw_alloc_data_list(struct urtw_softc *sc, struct urtw_data data[],
+	int ndata, int maxsz, int fillmbuf)
+{
+	int i, error;
+
+	for (i = 0; i < ndata; i++) {
+		struct urtw_data *dp = &data[i];
+
+		dp->sc = sc;
+		dp->xfer = usbd_alloc_xfer(sc->sc_udev);
+		if (dp->xfer == NULL) {
+			device_printf(sc->sc_dev, "could not allocate xfer\n");
+			error = ENOMEM;
+			goto fail;
+		}
+		if (fillmbuf) {
+			dp->m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR);
+			if (dp->m == NULL) {
+				device_printf(sc->sc_dev,
+				    "could not allocate rx mbuf\n");
+				error = ENOMEM;
+				goto fail;
+			}
+			dp->buf = mtod(dp->m, uint8_t *);
+		} else {
+			dp->m = NULL;
+			dp->buf = usbd_alloc_buffer(dp->xfer, maxsz);
+			if (dp->buf == NULL) {
+				device_printf(sc->sc_dev,
+				    "could not allocate buffer\n");
+				error = ENOMEM;
+				goto fail;
+			}
+			if (((unsigned long)dp->buf) % 4)
+				device_printf(sc->sc_dev,
+				    "warn: unaligned buffer %p\n", dp->buf);
+		}
+		dp->ni = NULL;
+	}
+
+	return 0;
+
+fail:	urtw_free_data_list(sc, NULL, NULL, data, ndata);
+	return error;
+}
+
+static void
+urtw_free_data_list(struct urtw_softc *sc, usbd_pipe_handle pipe1,
+    usbd_pipe_handle pipe2, struct urtw_data data[], int ndata)
+{
+	int i;
+
+	/* make sure no transfers are pending */
+	if (pipe1 != NULL)
+		usbd_abort_pipe(pipe1);
+	if (pipe2 != NULL)
+		usbd_abort_pipe(pipe2);
+
+	for (i = 0; i < ndata; i++) {
+		struct urtw_data *dp = &data[i];
+
+		if (dp->xfer != NULL) {
+			usbd_free_xfer(dp->xfer);
+			dp->xfer = NULL;
+		}
+		if (dp->m != NULL) {
+			m_freem(dp->m);
+			dp->m = NULL;
+		}
+		if (dp->ni != NULL) {
+			ieee80211_free_node(dp->ni);
+			dp->ni = NULL;
+		}
+	}
+}
+
+static int
+urtw_alloc_rx_data_list(struct urtw_softc *sc)
+{
+
+	return urtw_alloc_data_list(sc,
+	    sc->sc_rxdata, URTW_RX_DATA_LIST_COUNT, MCLBYTES, 1 /* mbufs */);
+}
+
+static void
+urtw_free_rx_data_list(struct urtw_softc *sc)
+{
+
+	urtw_free_data_list(sc, sc->sc_rxpipe, NULL, sc->sc_rxdata,
+	    URTW_RX_DATA_LIST_COUNT);
+}
+
+static int
+urtw_alloc_tx_data_list(struct urtw_softc *sc)
+{
+
+	return urtw_alloc_data_list(sc,
+	    sc->sc_txdata, URTW_TX_DATA_LIST_COUNT, URTW_TX_MAXSIZE,
+	    0 /* no mbufs */);
+}
+
+static void
+urtw_free_tx_data_list(struct urtw_softc *sc)
+{
+
+	urtw_free_data_list(sc, sc->sc_txpipe_low, sc->sc_txpipe_normal,
+	    sc->sc_txdata, URTW_TX_DATA_LIST_COUNT);
+}
+
+static usbd_status
+urtw_led_init(struct urtw_softc *sc)
+{
+	uint32_t rev;
+	usbd_status error;
+
+	urtw_read8_m(sc, URTW_PSR, &sc->sc_psr);
+	error = urtw_eprom_read32(sc, URTW_EPROM_SWREV, &rev);
+	if (error != 0)
+		goto fail;
+
+	switch (rev & URTW_EPROM_CID_MASK) {
+	case URTW_EPROM_CID_ALPHA0:
+		sc->sc_strategy = URTW_SW_LED_MODE1;
+		break;
+	case URTW_EPROM_CID_SERCOMM_PS:
+		sc->sc_strategy = URTW_SW_LED_MODE3;
+		break;
+	case URTW_EPROM_CID_HW_LED:
+		sc->sc_strategy = URTW_HW_LED;
+		break;
+	case URTW_EPROM_CID_RSVD0:
+	case URTW_EPROM_CID_RSVD1:
+	default:
+		sc->sc_strategy = URTW_SW_LED_MODE0;
+		break;
+	}
+
+	sc->sc_gpio_ledpin = URTW_LED_PIN_GPIO0;
+
+fail:
+	return (error);
+}
+
+/* XXX why we should allocalte memory buffer instead of using memory stack?  */
+static usbd_status
+urtw_8225_write_s16(struct urtw_softc *sc, uint8_t addr, int index,
+    uint16_t *data)
+{
+	uint8_t *buf;
+	uint16_t data16;
+	usb_device_request_t *req;
+	usbd_status error = 0;
+
+	data16 = *data;
+	req = (usb_device_request_t *)malloc(sizeof(usb_device_request_t),
+	    M_80211_VAP, M_NOWAIT | M_ZERO);
+	if (req == NULL) {
+		device_printf(sc->sc_dev, "could not allocate a memory\n");
+		goto fail0;
+	}
+	buf = (uint8_t *)malloc(2, M_80211_VAP, M_NOWAIT | M_ZERO);
+	if (req == NULL) {
+		device_printf(sc->sc_dev, "could not allocate a memory\n");
+		goto fail1;
+	}
+
+	req->bmRequestType = UT_WRITE_VENDOR_DEVICE;
+	req->bRequest = URTW_8187_SETREGS_REQ;
+	USETW(req->wValue, addr);
+	USETW(req->wIndex, index);
+	USETW(req->wLength, sizeof(uint16_t));
+	buf[0] = (data16 & 0x00ff);
+	buf[1] = (data16 & 0xff00) >> 8;
+
+	error = usbd_do_request(sc->sc_udev, req, buf);
+
+	free(buf, M_80211_VAP);
+fail1:	free(req, M_80211_VAP);
+fail0:	return (error);
+}
+
+static usbd_status
+urtw_8225_read(struct urtw_softc *sc, uint8_t addr, uint32_t *data)
+{
+	int i;
+	int16_t bit;
+	uint8_t rlen = 12, wlen = 6;
+	uint16_t o1, o2, o3, tmp;
+	uint32_t d2w = ((uint32_t)(addr & 0x1f)) << 27;
+	uint32_t mask = 0x80000000, value = 0;
+	usbd_status error;
+
+	urtw_read16_m(sc, URTW_RF_PINS_OUTPUT, &o1);
+	urtw_read16_m(sc, URTW_RF_PINS_ENABLE, &o2);
+	urtw_read16_m(sc, URTW_RF_PINS_SELECT, &o3);
+	urtw_write16_m(sc, URTW_RF_PINS_ENABLE, o2 | URTW_RF_PINS_MAGIC4);
+	urtw_write16_m(sc, URTW_RF_PINS_SELECT, o3 | URTW_RF_PINS_MAGIC4);
+	o1 &= ~URTW_RF_PINS_MAGIC4;
+	urtw_write16_m(sc, URTW_RF_PINS_OUTPUT, o1 | URTW_BB_HOST_BANG_EN);
+	DELAY(5);
+	urtw_write16_m(sc, URTW_RF_PINS_OUTPUT, o1);
+	DELAY(5);
+
+	for (i = 0; i < (wlen / 2); i++, mask = mask >> 1) {
+		bit = ((d2w & mask) != 0) ? 1 : 0;
+
+		urtw_write16_m(sc, URTW_RF_PINS_OUTPUT, bit | o1);
+		DELAY(2);
+		urtw_write16_m(sc, URTW_RF_PINS_OUTPUT, bit | o1 |
+		    URTW_BB_HOST_BANG_CLK);
+		DELAY(2);
+		urtw_write16_m(sc, URTW_RF_PINS_OUTPUT, bit | o1 |
+		    URTW_BB_HOST_BANG_CLK);
+		DELAY(2);
+		mask = mask >> 1;
+		if (i == 2)
+			break;
+		bit = ((d2w & mask) != 0) ? 1 : 0;
+		urtw_write16_m(sc, URTW_RF_PINS_OUTPUT, bit | o1 |
+		    URTW_BB_HOST_BANG_CLK);
+		DELAY(2);

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-head@FreeBSD.ORG  Fri Jan 23 05:33:48 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B9985106566B;
	Fri, 23 Jan 2009 05:33:48 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id AA16B8FC0A;
	Fri, 23 Jan 2009 05:33:48 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0N5XmEk032262;
	Fri, 23 Jan 2009 05:33:48 GMT (envelope-from sam@svn.freebsd.org)
Received: (from sam@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0N5Xm1k032257;
	Fri, 23 Jan 2009 05:33:48 GMT (envelope-from sam@svn.freebsd.org)
Message-Id: <200901230533.n0N5Xm1k032257@svn.freebsd.org>
From: Sam Leffler 
Date: Fri, 23 Jan 2009 05:33:48 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r187611 - in head/sys/dev/ath/ath_hal: ar5210 ar5211
	ar5212 ar5312 ar5416
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 23 Jan 2009 05:33:49 -0000

Author: sam
Date: Fri Jan 23 05:33:48 2009
New Revision: 187611
URL: http://svn.freebsd.org/changeset/base/187611

Log:
  fix return status handling by ar5XXXReset; this is the reason the
  driver sometimes reports reset failed w/ status 0

Modified:
  head/sys/dev/ath/ath_hal/ar5210/ar5210_reset.c
  head/sys/dev/ath/ath_hal/ar5211/ar5211_reset.c
  head/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c
  head/sys/dev/ath/ath_hal/ar5312/ar5312_reset.c
  head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c

Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210_reset.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5210/ar5210_reset.c	Fri Jan 23 05:04:49 2009	(r187610)
+++ head/sys/dev/ath/ath_hal/ar5210/ar5210_reset.c	Fri Jan 23 05:33:48 2009	(r187611)
@@ -14,7 +14,7 @@
  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  *
- * $Id: ar5210_reset.c,v 1.8 2008/11/11 17:25:16 sam Exp $
+ * $FreeBSD$
  */
 #include "opt_ah.h"
 
@@ -296,7 +296,7 @@ ar5210Reset(struct ath_hal *ah, HAL_OPMO
 
 	return AH_TRUE;
 bad:
-	if (*status)
+	if (status != AH_NULL)
 		*status = ecode;
 	return AH_FALSE;
 #undef FAIL

Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211_reset.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5211/ar5211_reset.c	Fri Jan 23 05:04:49 2009	(r187610)
+++ head/sys/dev/ath/ath_hal/ar5211/ar5211_reset.c	Fri Jan 23 05:33:48 2009	(r187611)
@@ -14,7 +14,7 @@
  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  *
- * $Id: ar5211_reset.c,v 1.9 2008/11/27 22:29:52 sam Exp $
+ * $FreeBSD$
  */
 #include "opt_ah.h"
 
@@ -552,7 +552,7 @@ uint32_t softLedCfg, softLedState;
 
 	return AH_TRUE;
 bad:
-	if (*status)
+	if (status != AH_NULL)
 		*status = ecode;
 	return AH_FALSE;
 #undef FAIL

Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c	Fri Jan 23 05:04:49 2009	(r187610)
+++ head/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c	Fri Jan 23 05:33:48 2009	(r187611)
@@ -14,7 +14,7 @@
  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  *
- * $Id: ar5212_reset.c,v 1.20 2008/11/27 22:30:00 sam Exp $
+ * $FreeBSD$
  */
 #include "opt_ah.h"
 
@@ -692,7 +692,7 @@ bad:
 	RESTORE_CCK(ah, chan, isBmode);
 
 	OS_MARK(ah, AH_MARK_RESET_DONE, ecode);
-	if (*status)
+	if (status != AH_NULL)
 		*status = ecode;
 	return AH_FALSE;
 #undef FAIL

Modified: head/sys/dev/ath/ath_hal/ar5312/ar5312_reset.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5312/ar5312_reset.c	Fri Jan 23 05:04:49 2009	(r187610)
+++ head/sys/dev/ath/ath_hal/ar5312/ar5312_reset.c	Fri Jan 23 05:33:48 2009	(r187611)
@@ -14,7 +14,7 @@
  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  *
- * $Id: ar5312_reset.c,v 1.10 2008/11/22 07:41:37 sam Exp $
+ * $FreeBSD$
  */
 #include "opt_ah.h"
 
@@ -597,7 +597,7 @@ ar5312Reset(struct ath_hal *ah, HAL_OPMO
 	return AH_TRUE;
 bad:
 	OS_MARK(ah, AH_MARK_RESET_DONE, ecode);
-	if (*status)
+	if (status != AH_NULL)
 		*status = ecode;
 	return AH_FALSE;
 #undef FAIL

Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c	Fri Jan 23 05:04:49 2009	(r187610)
+++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c	Fri Jan 23 05:33:48 2009	(r187611)
@@ -14,7 +14,7 @@
  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  *
- * $Id: ar5416_reset.c,v 1.27 2008/11/27 22:30:08 sam Exp $
+ * $FreeBSD$
  */
 #include "opt_ah.h"
 
@@ -470,7 +470,7 @@ ar5416Reset(struct ath_hal *ah, HAL_OPMO
 	return AH_TRUE;
 bad:
 	OS_MARK(ah, AH_MARK_RESET_DONE, ecode);
-	if (*status)
+	if (status != AH_NULL)
 		*status = ecode;
 	return AH_FALSE;
 #undef FAIL

From owner-svn-src-head@FreeBSD.ORG  Fri Jan 23 05:45:17 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A2612106564A;
	Fri, 23 Jan 2009 05:45:17 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9389C8FC08;
	Fri, 23 Jan 2009 05:45:17 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0N5jHNb032496;
	Fri, 23 Jan 2009 05:45:17 GMT (envelope-from weongyo@svn.freebsd.org)
Received: (from weongyo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0N5jHSK032495;
	Fri, 23 Jan 2009 05:45:17 GMT (envelope-from weongyo@svn.freebsd.org)
Message-Id: <200901230545.n0N5jHSK032495@svn.freebsd.org>
From: Weongyo Jeong 
Date: Fri, 23 Jan 2009 05:45:17 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r187612 - head/sys/modules
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 23 Jan 2009 05:45:18 -0000

Author: weongyo
Date: Fri Jan 23 05:45:17 2009
New Revision: 187612
URL: http://svn.freebsd.org/changeset/base/187612

Log:
  Connect urtw(4) to the i386 build only because it's not tested on amd64
  architecture but expect it'd work.  In cases on other architectures it'd
  not work yet.

Modified:
  head/sys/modules/Makefile

Modified: head/sys/modules/Makefile
==============================================================================
--- head/sys/modules/Makefile	Fri Jan 23 05:33:48 2009	(r187611)
+++ head/sys/modules/Makefile	Fri Jan 23 05:45:17 2009	(r187612)
@@ -299,6 +299,7 @@ SUBDIR=	${_3dfx} \
 	uplcom \
 	ural \
 	urio \
+	${_urtw} \
 	usb \
 	usb2 \
 	uscanner \
@@ -438,6 +439,7 @@ _stg=		stg
 _streams=	streams
 _tmpfs=		tmpfs
 _upgt=		upgt
+_urtw=		urtw
 _wi=		wi
 _xe=		xe
 .if ${MK_ZFS} != "no" || defined(ALL_MODULES)

From owner-svn-src-head@FreeBSD.ORG  Fri Jan 23 05:53:49 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 650C3106566B;
	Fri, 23 Jan 2009 05:53:49 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 566028FC0A;
	Fri, 23 Jan 2009 05:53:49 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0N5rnre032660;
	Fri, 23 Jan 2009 05:53:49 GMT (envelope-from weongyo@svn.freebsd.org)
Received: (from weongyo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0N5rntu032659;
	Fri, 23 Jan 2009 05:53:49 GMT (envelope-from weongyo@svn.freebsd.org)
Message-Id: <200901230553.n0N5rntu032659@svn.freebsd.org>
From: Weongyo Jeong 
Date: Fri, 23 Jan 2009 05:53:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r187613 - head/share/man/man4
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 23 Jan 2009 05:53:49 -0000

Author: weongyo
Date: Fri Jan 23 05:53:49 2009
New Revision: 187613
URL: http://svn.freebsd.org/changeset/base/187613

Log:
  Connect urtw.4 to the build.

Modified:
  head/share/man/man4/Makefile

Modified: head/share/man/man4/Makefile
==============================================================================
--- head/share/man/man4/Makefile	Fri Jan 23 05:45:17 2009	(r187612)
+++ head/share/man/man4/Makefile	Fri Jan 23 05:53:49 2009	(r187613)
@@ -418,6 +418,7 @@ MAN=	aac.4 \
 	uplcom.4 \
 	ural.4 \
 	urio.4 \
+	${_urtw.4} \
 	usb.4 \
 	uscanner.4 \
 	uslcom.4 \
@@ -568,6 +569,7 @@ MLINKS+=u3g.4 u3gstub.4
 MLINKS+=udav.4 if_udav.4
 MLINKS+=upgt.4 if_upgt.4
 MLINKS+=ural.4 if_ural.4
+MLINKS+=${_urtw.4} ${_if_urtw.4}
 MLINKS+=vge.4 if_vge.4
 MLINKS+=vlan.4 if_vlan.4
 MLINKS+=vpo.4 imm.4
@@ -601,6 +603,7 @@ _if_ndis.4=	if_ndis.4
 _if_nfe.4=	if_nfe.4
 _if_nve.4=	if_nve.4
 _if_nxge.4=	if_nxge.4
+_if_urtw.4=	if_urtw.4
 _if_wpi.4=	if_wpi.4
 _ipmi.4=	ipmi.4
 _io.4=		io.4
@@ -614,6 +617,7 @@ _nxge.4=	nxge.4
 _rr232x.4=	rr232x.4
 _speaker.4=	speaker.4
 _spkr.4=	spkr.4
+_urtw.4=	urtw.4
 _wpi.4=		wpi.4
 .endif
 

From owner-svn-src-head@FreeBSD.ORG  Fri Jan 23 05:56:10 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 510041065674;
	Fri, 23 Jan 2009 05:56:10 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 4270C8FC17;
	Fri, 23 Jan 2009 05:56:10 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0N5u9So032752;
	Fri, 23 Jan 2009 05:56:09 GMT (envelope-from weongyo@svn.freebsd.org)
Received: (from weongyo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0N5u90v032751;
	Fri, 23 Jan 2009 05:56:09 GMT (envelope-from weongyo@svn.freebsd.org)
Message-Id: <200901230556.n0N5u90v032751@svn.freebsd.org>
From: Weongyo Jeong 
Date: Fri, 23 Jan 2009 05:56:09 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r187614 - head/sys/boot/forth
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 23 Jan 2009 05:56:10 -0000

Author: weongyo
Date: Fri Jan 23 05:56:09 2009
New Revision: 187614
URL: http://svn.freebsd.org/changeset/base/187614

Log:
  Add an entry for the urtw(4) module.

Modified:
  head/sys/boot/forth/loader.conf

Modified: head/sys/boot/forth/loader.conf
==============================================================================
--- head/sys/boot/forth/loader.conf	Fri Jan 23 05:53:49 2009	(r187613)
+++ head/sys/boot/forth/loader.conf	Fri Jan 23 05:56:09 2009	(r187614)
@@ -278,6 +278,7 @@ if_vge_load="NO"		# VIA VT6122 PCI Gigab
 if_udav_load="NO"		# Davicom DM9601 USB Ethernet
 if_upgt_load="NO"		# Conexant/Intersil PrismGT USB wireless
 if_ural_load="NO"		# Ralink Technology USB wireless
+if_urtw_load="NO"		# Realtek 8187L USB wireless
 if_vr_load="NO"			# VIA Rhine I and Rhine II
 if_vx_load="NO"			# 3Com 3C590 family
 if_wb_load="NO"			# Winbond W89C840F

From owner-svn-src-head@FreeBSD.ORG  Fri Jan 23 05:57:40 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8F6BC106566B;
	Fri, 23 Jan 2009 05:57:40 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 80F6C8FC12;
	Fri, 23 Jan 2009 05:57:40 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0N5veS2032812;
	Fri, 23 Jan 2009 05:57:40 GMT (envelope-from weongyo@svn.freebsd.org)
Received: (from weongyo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0N5veJf032811;
	Fri, 23 Jan 2009 05:57:40 GMT (envelope-from weongyo@svn.freebsd.org)
Message-Id: <200901230557.n0N5veJf032811@svn.freebsd.org>
From: Weongyo Jeong 
Date: Fri, 23 Jan 2009 05:57:40 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r187615 - head/usr.sbin/sysinstall
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 23 Jan 2009 05:57:41 -0000

Author: weongyo
Date: Fri Jan 23 05:57:40 2009
New Revision: 187615
URL: http://svn.freebsd.org/changeset/base/187615

Log:
  Add urtw(4) to the list of supported network interface.

Modified:
  head/usr.sbin/sysinstall/devices.c

Modified: head/usr.sbin/sysinstall/devices.c
==============================================================================
--- head/usr.sbin/sysinstall/devices.c	Fri Jan 23 05:56:09 2009	(r187614)
+++ head/usr.sbin/sysinstall/devices.c	Fri Jan 23 05:57:40 2009	(r187615)
@@ -156,6 +156,7 @@ static struct _devname {
     NETWORK("tl",	"Texas Instruments ThunderLAN PCI Ethernet card"),
     NETWORK("upgt",	"Conexant/Intersil PrismGT USB wireless adapter"),
     NETWORK("ural",	"Ralink Technology RT2500USB 802.11 wireless adapter"),
+    NETWORK("urtw",	"Realtek 8187L USB wireless adapter"),
     NETWORK("vge",	"VIA VT612x PCI Gigabit Ethernet card"),
     NETWORK("vr",	"VIA VT3043/VT86C100A Rhine PCI Ethernet card"),
     NETWORK("vlan",	"IEEE 802.1Q VLAN network interface"),

From owner-svn-src-head@FreeBSD.ORG  Fri Jan 23 08:18:58 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E8C5A106566C;
	Fri, 23 Jan 2009 08:18:58 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id BB4FA8FC0C;
	Fri, 23 Jan 2009 08:18:58 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0N8IwSk035762;
	Fri, 23 Jan 2009 08:18:58 GMT (envelope-from weongyo@svn.freebsd.org)
Received: (from weongyo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0N8IwF6035761;
	Fri, 23 Jan 2009 08:18:58 GMT (envelope-from weongyo@svn.freebsd.org)
Message-Id: <200901230818.n0N8IwF6035761@svn.freebsd.org>
From: Weongyo Jeong 
Date: Fri, 23 Jan 2009 08:18:58 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r187623 - head/sys/modules
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 23 Jan 2009 08:18:59 -0000

Author: weongyo
Date: Fri Jan 23 08:18:58 2009
New Revision: 187623
URL: http://svn.freebsd.org/changeset/base/187623

Log:
  urtw(4) works also on amd64.
  
  Tested by:	kevlo

Modified:
  head/sys/modules/Makefile

Modified: head/sys/modules/Makefile
==============================================================================
--- head/sys/modules/Makefile	Fri Jan 23 08:12:50 2009	(r187622)
+++ head/sys/modules/Makefile	Fri Jan 23 08:18:58 2009	(r187623)
@@ -571,6 +571,7 @@ _sppp=		sppp
 _tmpfs=		tmpfs
 _twa=		twa
 _upgt=		upgt
+_urtw=		urtw
 _wi=		wi
 _wpi=		wpi
 _wpifw=		wpifw

From owner-svn-src-head@FreeBSD.ORG  Fri Jan 23 10:05:07 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0351A1065673;
	Fri, 23 Jan 2009 10:05:07 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42])
	by mx1.freebsd.org (Postfix) with ESMTP id CD5688FC13;
	Fri, 23 Jan 2009 10:05:06 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from fledge.watson.org (fledge.watson.org [65.122.17.41])
	by cyrus.watson.org (Postfix) with ESMTPS id 6EFE846B03;
	Fri, 23 Jan 2009 05:05:06 -0500 (EST)
Date: Fri, 23 Jan 2009 10:05:06 +0000 (GMT)
From: Robert Watson 
X-X-Sender: robert@fledge.watson.org
To: Ivan Voras 
In-Reply-To: <9bbcef730901221619x390f3daau8104cf8912c4a237@mail.gmail.com>
Message-ID: 
References: <200901220621.n0M6LU5v002745@svn.freebsd.org>
	<20090122.104114.1927899760.imp@bsdimp.com>
	
	<9bbcef730901221255u5767d16bo230da23542a171d7@mail.gmail.com>
	
	<9bbcef730901221619x390f3daau8104cf8912c4a237@mail.gmail.com>
User-Agent: Alpine 2.00 (BSF 1167 2008-08-23)
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: svn-src-head@freebsd.org, jeff@freebsd.org, src-committers@freebsd.org,
	svn-src-all@freebsd.org, "M. Warner Losh" 
Subject: Re: svn commit: r187580 - head/tools/sched
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 23 Jan 2009 10:05:07 -0000

On Fri, 23 Jan 2009, Ivan Voras wrote:

> I'm not a lawyer (very obviously - no talent for it all :) ) and was 
> probably wrongly interpreting the Geneva copyright convention.

It's not clear how relevant the Geneva copyright convention is at this point, 
given that most countries of interest are signatories to the Berne convention. 
Certainly once the US signed the convention, things got a lot more consistent. 
One of the interesting things about Circular 92 is how many of the weird 
clauses in it apply only to things created before the US joined the Berne 
convention (almost one hundred years after the date of the original 
convention).

> Can someone write a "practical guide to FreeBSD copyright matters for 
> developers" somewhere - wiki perhaps? (it could also include GPL-related 
> guidelines - GPLv3 even if there's consensus about it).

ORA has quite a nice, if rather US-centric, book on intellectual property and 
open source.  I picked up a copy at EuroBSDCon last year and was favourably 
impressed.  In general, my belief is that open source developers need to pay 
significant attention to intellectual property, as the "open" in open source 
is just as important as the "source" bit -- hacking code is easy, making sure 
everyone can use the result turns out to be a lot harder.  Computer scientists 
often suffer from two or three common misunderstandings of copyright law, 
certainly: that they understand it, that it can't be understood, and/or that 
it doesn't matter.

There is a committer's guide page on licenses, which basically says "if you 
use these licenses then you don't need core approval", but I think producing 
something a bit more substantive would be useful.  The Foundation board and 
the core team have had a number of conversations at various points about 
formalizing things a bit more, including with the Foundation's legal support, 
but the obvious questions arise: how to facilitate work on open source without 
overly constraining it, etc.

Robert N M Watson
Computer Laboratory
University of Cambridge

From owner-svn-src-head@FreeBSD.ORG  Fri Jan 23 11:39:00 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 907FD1065672;
	Fri, 23 Jan 2009 11:39:00 +0000 (UTC)
	(envelope-from trhodes@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7FEC68FC12;
	Fri, 23 Jan 2009 11:39:00 +0000 (UTC)
	(envelope-from trhodes@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0NBd02n041844;
	Fri, 23 Jan 2009 11:39:00 GMT (envelope-from trhodes@svn.freebsd.org)
Received: (from trhodes@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0NBd015041843;
	Fri, 23 Jan 2009 11:39:00 GMT (envelope-from trhodes@svn.freebsd.org)
Message-Id: <200901231139.n0NBd015041843@svn.freebsd.org>
From: Tom Rhodes 
Date: Fri, 23 Jan 2009 11:39:00 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r187627 - head/bin/chmod
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 23 Jan 2009 11:39:01 -0000

Author: trhodes
Date: Fri Jan 23 11:39:00 2009
New Revision: 187627
URL: http://svn.freebsd.org/changeset/base/187627

Log:
  Note the implication of setting the 'w' permission on directories,
  while here, expand the 'naughty bits' comment in BUGS.
  
  PR:		84265 and 84268
  Reviewed by:	keramida
  Obtained from:	hints from ceri, keramida

Modified:
  head/bin/chmod/chmod.1

Modified: head/bin/chmod/chmod.1
==============================================================================
--- head/bin/chmod/chmod.1	Fri Jan 23 11:11:29 2009	(r187626)
+++ head/bin/chmod/chmod.1	Fri Jan 23 11:39:00 2009	(r187627)
@@ -32,7 +32,7 @@
 .\"	@(#)chmod.1	8.4 (Berkeley) 3/31/94
 .\" $FreeBSD$
 .\"
-.Dd December 22, 2006
+.Dd January 23, 2009
 .Dt CHMOD 1
 .Os
 .Sh NAME
@@ -281,6 +281,10 @@ Operations upon the other permissions on
 ``o'' by itself), in combination with the
 .Ar perm
 symbols ``s'' or ``t'', are ignored.
+.Pp
+The ``w'' permission on directories will permit file creation, relocation,
+and copy into that directory.
+Files created within the directory itself will inherit its group ID.
 .Sh EXAMPLES
 .Bl -tag -width "u=rwx,go=u-w" -compact
 .It Li 644
@@ -343,4 +347,5 @@ command appeared in
 .Sh BUGS
 There is no
 .Ar perm
-option for the naughty bits.
+option for the naughty bits which are ``S'' and
+``T'' respectively.

From owner-svn-src-head@FreeBSD.ORG  Fri Jan 23 13:23:17 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A17AA106568C;
	Fri, 23 Jan 2009 13:23:17 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 90AF38FC3E;
	Fri, 23 Jan 2009 13:23:17 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0NDNH9l044115;
	Fri, 23 Jan 2009 13:23:17 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0NDNHZY044114;
	Fri, 23 Jan 2009 13:23:17 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <200901231323.n0NDNHZY044114@svn.freebsd.org>
From: John Baldwin 
Date: Fri, 23 Jan 2009 13:23:17 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r187631 - head/sys/kern
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 23 Jan 2009 13:23:18 -0000

Author: jhb
Date: Fri Jan 23 13:23:17 2009
New Revision: 187631
URL: http://svn.freebsd.org/changeset/base/187631

Log:
  Use the correct type for the timeout parameter to the 32-bit
  compat version aio_waitcomplete().
  
  Reminded by:	bz
  Submitted by:	jamie
  MFC after:	3 days

Modified:
  head/sys/kern/vfs_aio.c

Modified: head/sys/kern/vfs_aio.c
==============================================================================
--- head/sys/kern/vfs_aio.c	Fri Jan 23 12:01:24 2009	(r187630)
+++ head/sys/kern/vfs_aio.c	Fri Jan 23 13:23:17 2009	(r187631)
@@ -2824,7 +2824,7 @@ int
 freebsd32_aio_waitcomplete(struct thread *td,
     struct freebsd32_aio_waitcomplete_args *uap)
 {
-	struct timespec ts32;
+	struct timespec32 ts32;
 	struct timespec ts, *tsp;
 	int error;
 

From owner-svn-src-head@FreeBSD.ORG  Fri Jan 23 13:27:52 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id ADDCF10656FD;
	Fri, 23 Jan 2009 13:27:52 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42])
	by mx1.freebsd.org (Postfix) with ESMTP id 749308FC12;
	Fri, 23 Jan 2009 13:27:52 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from server.baldwin.cx (pool-98-109-39-197.nwrknj.fios.verizon.net
	[98.109.39.197])
	by cyrus.watson.org (Postfix) with ESMTPSA id 22A6746B09;
	Fri, 23 Jan 2009 08:27:52 -0500 (EST)
Received: from localhost (john@localhost [127.0.0.1]) (authenticated bits=0)
	by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id n0NDRIUS050730;
	Fri, 23 Jan 2009 08:27:46 -0500 (EST) (envelope-from jhb@freebsd.org)
From: John Baldwin 
To: "Bjoern A. Zeeb" 
Date: Fri, 23 Jan 2009 08:23:50 -0500
User-Agent: KMail/1.9.7
References: <200812102056.mBAKuJ97042379@svn.freebsd.org>
	<200812111532.17651.jhb@freebsd.org>
	<20090122233042.P45399@maildrop.int.zabbadoz.net>
In-Reply-To: <20090122233042.P45399@maildrop.int.zabbadoz.net>
MIME-Version: 1.0
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200901230823.51326.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by
	milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]);
	Fri, 23 Jan 2009 08:27:46 -0500 (EST)
X-Virus-Scanned: ClamAV 0.94.2/8895/Fri Jan 23 04:13:42 2009 on
	server.baldwin.cx
X-Virus-Status: Clean
X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 
	autolearn=ham version=3.1.3
X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, James Gritton 
Subject: Re: svn commit: r185878 - in head/sys: compat/freebsd32 kern
	modules/aio
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 23 Jan 2009 13:27:55 -0000

On Thursday 22 January 2009 6:31:20 pm Bjoern A. Zeeb wrote:
> On Thu, 11 Dec 2008, John Baldwin wrote:
> 
> > On Thursday 11 December 2008 01:46:21 pm James Gritton wrote:
> >> freebsd32_aio_waitcomplete() has a small error:
> >>
> >> @@ -2824,7 +2824,7 @@
> >>  freebsd32_aio_waitcomplete(struct thread *td,
> >>      struct freebsd32_aio_waitcomplete_args *uap)
> >>  {
> >> -    struct timespec ts32;
> >> +    struct timespec32 ts32;
> >>     struct timespec ts, *tsp;
> >>     int error;
> >>
> >> - Jamie
> >
> > Oof. :(  I think my aiotest thing doesn't call aio_waitcomplete() so I 
missed
> > this. :(
> 
> I think this has never been fixed in HEAD?

Goof, just fixed.  I believe I fixed this at Y! but forgot to fix it here. :(

-- 
John Baldwin

From owner-svn-src-head@FreeBSD.ORG  Fri Jan 23 17:48:19 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 437991065676;
	Fri, 23 Jan 2009 17:48:19 +0000 (UTC)
	(envelope-from jkim@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2FE378FC19;
	Fri, 23 Jan 2009 17:48:19 +0000 (UTC)
	(envelope-from jkim@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0NHmJDh048980;
	Fri, 23 Jan 2009 17:48:19 GMT (envelope-from jkim@svn.freebsd.org)
Received: (from jkim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0NHmIBI048975;
	Fri, 23 Jan 2009 17:48:18 GMT (envelope-from jkim@svn.freebsd.org)
Message-Id: <200901231748.n0NHmIBI048975@svn.freebsd.org>
From: Jung-uk Kim 
Date: Fri, 23 Jan 2009 17:48:18 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r187633 - in head/sys: conf dev/agp modules/agp
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 23 Jan 2009 17:48:19 -0000

Author: jkim
Date: Fri Jan 23 17:48:18 2009
New Revision: 187633
URL: http://svn.freebsd.org/changeset/base/187633

Log:
  - Add few VIA bridges to agp_via.c and connect it to amd64 build
  as they support Intel Core/Core 2 and VIA Nano processors.
  - Align "optional agp" in conf/files.* for consistency while I am here.

Modified:
  head/sys/conf/files.amd64
  head/sys/conf/files.i386
  head/sys/conf/files.pc98
  head/sys/dev/agp/agp_via.c
  head/sys/modules/agp/Makefile

Modified: head/sys/conf/files.amd64
==============================================================================
--- head/sys/conf/files.amd64	Fri Jan 23 16:09:19 2009	(r187632)
+++ head/sys/conf/files.amd64	Fri Jan 23 17:48:18 2009	(r187633)
@@ -132,9 +132,10 @@ crypto/via/padlock.c		optional	padlock
 crypto/via/padlock_cipher.c	optional	padlock
 crypto/via/padlock_hash.c	optional	padlock
 dev/acpica/acpi_if.m		standard
-dev/agp/agp_amd64.c			optional	agp
-dev/agp/agp_i810.c			optional	agp
-dev/agp/agp_intel.c			optional	agp
+dev/agp/agp_amd64.c		optional	agp
+dev/agp/agp_i810.c		optional	agp
+dev/agp/agp_intel.c		optional	agp
+dev/agp/agp_via.c		optional	agp
 dev/arcmsr/arcmsr.c		optional	arcmsr pci
 dev/asmc/asmc.c			optional	asmc isa
 dev/atkbdc/atkbd.c		optional	atkbd atkbdc

Modified: head/sys/conf/files.i386
==============================================================================
--- head/sys/conf/files.i386	Fri Jan 23 16:09:19 2009	(r187632)
+++ head/sys/conf/files.i386	Fri Jan 23 17:48:18 2009	(r187633)
@@ -118,15 +118,15 @@ crypto/via/padlock.c		optional padlock
 crypto/via/padlock_cipher.c	optional padlock
 crypto/via/padlock_hash.c	optional padlock
 dev/advansys/adv_isa.c		optional adv isa
-dev/agp/agp_ali.c			optional agp
-dev/agp/agp_amd.c			optional agp
-dev/agp/agp_amd64.c			optional agp
-dev/agp/agp_ati.c			optional agp
-dev/agp/agp_i810.c			optional agp
-dev/agp/agp_intel.c			optional agp
+dev/agp/agp_ali.c		optional agp
+dev/agp/agp_amd.c		optional agp
+dev/agp/agp_amd64.c		optional agp
+dev/agp/agp_ati.c		optional agp
+dev/agp/agp_i810.c		optional agp
+dev/agp/agp_intel.c		optional agp
 dev/agp/agp_nvidia.c		optional agp
-dev/agp/agp_sis.c			optional agp
-dev/agp/agp_via.c			optional agp
+dev/agp/agp_sis.c		optional agp
+dev/agp/agp_via.c		optional agp
 dev/aic/aic_isa.c		optional aic isa
 dev/arcmsr/arcmsr.c		optional arcmsr pci
 dev/ar/if_ar.c			optional ar

Modified: head/sys/conf/files.pc98
==============================================================================
--- head/sys/conf/files.pc98	Fri Jan 23 16:09:19 2009	(r187632)
+++ head/sys/conf/files.pc98	Fri Jan 23 17:48:18 2009	(r187633)
@@ -77,13 +77,13 @@ bf_enc.o			optional crypto | ipsec	\
 	compile-with	"${CC} -c -I$S/crypto/blowfish/arch/i386 ${ASM_CFLAGS} ${WERROR} ${.IMPSRC}" \
 	no-implicit-rule
 crypto/des/arch/i386/des_enc.S	optional crypto | ipsec | netsmb
-dev/agp/agp_ali.c			optional agp
-dev/agp/agp_amd.c			optional agp
-dev/agp/agp_i810.c			optional agp
-dev/agp/agp_intel.c			optional agp
+dev/agp/agp_ali.c		optional agp
+dev/agp/agp_amd.c		optional agp
+dev/agp/agp_i810.c		optional agp
+dev/agp/agp_intel.c		optional agp
 dev/agp/agp_nvidia.c		optional agp
-dev/agp/agp_sis.c			optional agp
-dev/agp/agp_via.c			optional agp
+dev/agp/agp_sis.c		optional agp
+dev/agp/agp_via.c		optional agp
 dev/aic/aic_cbus.c		optional aic isa
 dev/ar/if_ar.c			optional ar
 dev/ar/if_ar_pci.c		optional ar pci

Modified: head/sys/dev/agp/agp_via.c
==============================================================================
--- head/sys/dev/agp/agp_via.c	Fri Jan 23 16:09:19 2009	(r187632)
+++ head/sys/dev/agp/agp_via.c	Fri Jan 23 17:48:18 2009	(r187633)
@@ -85,8 +85,14 @@ agp_via_match(device_t dev)
 		return ("VIA 3296 (P4M800) host to PCI bridge");
 	case 0x03051106:
 		return ("VIA 82C8363 (Apollo KT133x/KM133) host to PCI bridge");
+	case 0x03141106:
+		return ("VIA 3314 (P4M800CE) host to PCI bridge");
 	case 0x03241106:
 		return ("VIA VT3324 (CX700) host to PCI bridge");
+	case 0x03271106:
+		return ("VIA 3327 (P4M890) host to PCI bridge");
+	case 0x03641106:
+		return ("VIA 3364 (P4M900) host to PCI bridge");
 	case 0x03911106:
 		return ("VIA 8371 (Apollo KX133) host to PCI bridge");
 	case 0x05011106:
@@ -168,7 +174,10 @@ agp_via_attach(device_t dev)
 	case 0x02591106:
 	case 0x02691106:
 	case 0x02961106:
+	case 0x03141106:
 	case 0x03241106:
+	case 0x03271106:
+	case 0x03641106:
 	case 0x31231106:
 	case 0x31681106:
 	case 0x31891106:

Modified: head/sys/modules/agp/Makefile
==============================================================================
--- head/sys/modules/agp/Makefile	Fri Jan 23 16:09:19 2009	(r187632)
+++ head/sys/modules/agp/Makefile	Fri Jan 23 17:48:18 2009	(r187633)
@@ -12,7 +12,7 @@ SRCS+=	agp_i810.c agp_intel.c agp_via.c 
 SRCS+=	agp_amd64.c
 .endif
 .if  ${MACHINE_ARCH} == "amd64"
-SRCS+=	agp_amd64.c agp_i810.c
+SRCS+=	agp_amd64.c agp_i810.c agp_via.c
 .endif
 SRCS+=	device_if.h bus_if.h agp_if.h pci_if.h
 SRCS+=	opt_bus.h

From owner-svn-src-head@FreeBSD.ORG  Fri Jan 23 18:15:09 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 886B61065729;
	Fri, 23 Jan 2009 18:15:09 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 761EC8FC0A;
	Fri, 23 Jan 2009 18:15:09 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0NIF9T4049518;
	Fri, 23 Jan 2009 18:15:09 GMT (envelope-from sam@svn.freebsd.org)
Received: (from sam@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0NIF93d049517;
	Fri, 23 Jan 2009 18:15:09 GMT (envelope-from sam@svn.freebsd.org)
Message-Id: <200901231815.n0NIF93d049517@svn.freebsd.org>
From: Sam Leffler 
Date: Fri, 23 Jan 2009 18:15:09 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r187634 - head/sys/net80211
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 23 Jan 2009 18:15:10 -0000

Author: sam
Date: Fri Jan 23 18:15:09 2009
New Revision: 187634
URL: http://svn.freebsd.org/changeset/base/187634

Log:
  add defines for driver-private bits to eliminate use of constants

Modified:
  head/sys/net80211/_ieee80211.h

Modified: head/sys/net80211/_ieee80211.h
==============================================================================
--- head/sys/net80211/_ieee80211.h	Fri Jan 23 17:48:18 2009	(r187633)
+++ head/sys/net80211/_ieee80211.h	Fri Jan 23 18:15:09 2009	(r187634)
@@ -143,8 +143,11 @@ struct ieee80211_channel {
 #define	IEEE80211_CHAN_ANYC \
 	((struct ieee80211_channel *) IEEE80211_CHAN_ANY)
 
-/* bits 0-3 are for private use by drivers */
 /* channel attributes */
+#define	IEEE80211_CHAN_PRIV0	0x00000001 /* driver private bit 0 */
+#define	IEEE80211_CHAN_PRIV1	0x00000002 /* driver private bit 1 */
+#define	IEEE80211_CHAN_PRIV2	0x00000004 /* driver private bit 2 */
+#define	IEEE80211_CHAN_PRIV3	0x00000008 /* driver private bit 3 */
 #define	IEEE80211_CHAN_TURBO	0x00000010 /* Turbo channel */
 #define	IEEE80211_CHAN_CCK	0x00000020 /* CCK channel */
 #define	IEEE80211_CHAN_OFDM	0x00000040 /* OFDM channel */

From owner-svn-src-head@FreeBSD.ORG  Fri Jan 23 18:16:14 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 76CE41065689;
	Fri, 23 Jan 2009 18:16:14 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 645E88FC22;
	Fri, 23 Jan 2009 18:16:14 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0NIGE4S049572;
	Fri, 23 Jan 2009 18:16:14 GMT (envelope-from sam@svn.freebsd.org)
Received: (from sam@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0NIGEUZ049571;
	Fri, 23 Jan 2009 18:16:14 GMT (envelope-from sam@svn.freebsd.org)
Message-Id: <200901231816.n0NIGEUZ049571@svn.freebsd.org>
From: Sam Leffler 
Date: Fri, 23 Jan 2009 18:16:14 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r187635 - head/sys/net80211
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 23 Jan 2009 18:16:15 -0000

Author: sam
Date: Fri Jan 23 18:16:14 2009
New Revision: 187635
URL: http://svn.freebsd.org/changeset/base/187635

Log:
  fix regulatory state check for all vaps' being down; it must be done
  before calling the ic_setregdomain callback

Modified:
  head/sys/net80211/ieee80211_regdomain.c

Modified: head/sys/net80211/ieee80211_regdomain.c
==============================================================================
--- head/sys/net80211/ieee80211_regdomain.c	Fri Jan 23 18:15:09 2009	(r187634)
+++ head/sys/net80211/ieee80211_regdomain.c	Fri Jan 23 18:16:14 2009	(r187635)
@@ -373,6 +373,13 @@ ieee80211_setregdomain(struct ieee80211v
 			c->ic_maxpower = 2*c->ic_maxregpower;
 	}
 	IEEE80211_LOCK(ic);
+	/* XXX bandaid; a running vap will likely crash */
+	if (!allvapsdown(ic)) {
+		IEEE80211_UNLOCK(ic);
+		IEEE80211_DPRINTF(vap, IEEE80211_MSG_IOCTL,
+		    "%s: reject: vaps are running\n", __func__);
+		return EBUSY;
+	}
 	error = ic->ic_setregdomain(ic, ®->rd,
 	    reg->chaninfo.ic_nchans, reg->chaninfo.ic_chans);
 	if (error != 0) {
@@ -381,13 +388,6 @@ ieee80211_setregdomain(struct ieee80211v
 		    "%s: driver rejected request, error %u\n", __func__, error);
 		return error;
 	}
-	/* XXX bandaid; a running vap will likely crash */
-	if (!allvapsdown(ic)) {
-		IEEE80211_UNLOCK(ic);
-		IEEE80211_DPRINTF(vap, IEEE80211_MSG_IOCTL,
-		    "%s: reject: vaps are running\n", __func__);
-		return EBUSY;
-	}
 	/*
 	 * Commit: copy in new channel table and reset media state.
 	 * On return the state machines will be clocked so all vaps

From owner-svn-src-head@FreeBSD.ORG  Fri Jan 23 18:23:16 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DA6FE10656DE;
	Fri, 23 Jan 2009 18:23:16 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C7F188FC0C;
	Fri, 23 Jan 2009 18:23:16 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0NINGqx049743;
	Fri, 23 Jan 2009 18:23:16 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0NINGKb049742;
	Fri, 23 Jan 2009 18:23:16 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <200901231823.n0NINGKb049742@svn.freebsd.org>
From: Warner Losh 
Date: Fri, 23 Jan 2009 18:23:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r187636 - head
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 23 Jan 2009 18:23:17 -0000

Author: imp
Date: Fri Jan 23 18:23:16 2009
New Revision: 187636
URL: http://svn.freebsd.org/changeset/base/187636

Log:
  Implement an idea from Sam Leffler:
  	make KERNFAST=blah buildkernel
  is now a short cut for
  	make KERNCONF=blah -DKERNFAST buildkernel
  
  This change works for all kernel config files not named "1".  I did
  that to make sure that
  	make -DKERNFAST buildkernel
  remains the same as
  	make -DKERNFAST KERNCONF=GENERIC buildkernel
  rather than trying to build and configure "1".  I've never seen a
  kernel config file named "1," so I think this is a good compromise.

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==============================================================================
--- head/Makefile.inc1	Fri Jan 23 18:16:14 2009	(r187635)
+++ head/Makefile.inc1	Fri Jan 23 18:23:16 2009	(r187636)
@@ -702,6 +702,10 @@ distrib-dirs distribution:
 NO_KERNELCLEAN=	t
 NO_KERNELCONFIG=	t
 NO_KERNELDEPEND=	t
+# Shortcut for KERNCONF=Blah -DKERNFAST is now KERNFAST=Blah
+.if !defined(KERNCONF) && ${KERNFAST} != "1"
+KERNCONF=${KERNFAST}
+.endif
 .endif
 .if !defined(KERNCONF) && defined(KERNEL)
 KERNCONF=	${KERNEL}

From owner-svn-src-head@FreeBSD.ORG  Fri Jan 23 18:32:32 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 400CF106566C;
	Fri, 23 Jan 2009 18:32:32 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2C7EE8FC29;
	Fri, 23 Jan 2009 18:32:32 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0NIWWwP049947;
	Fri, 23 Jan 2009 18:32:32 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0NIWWAA049946;
	Fri, 23 Jan 2009 18:32:32 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <200901231832.n0NIWWAA049946@svn.freebsd.org>
From: Warner Losh 
Date: Fri, 23 Jan 2009 18:32:32 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r187637 - head/share/man/man7
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 23 Jan 2009 18:32:33 -0000

Author: imp
Date: Fri Jan 23 18:32:31 2009
New Revision: 187637
URL: http://svn.freebsd.org/changeset/base/187637

Log:
  Document KERNCONF and KERNFAST.  Note that TARGET is usually all one
  needs to set for cross building.

Modified:
  head/share/man/man7/build.7

Modified: head/share/man/man7/build.7
==============================================================================
--- head/share/man/man7/build.7	Fri Jan 23 18:23:16 2009	(r187636)
+++ head/share/man/man7/build.7	Fri Jan 23 18:32:31 2009	(r187637)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 5, 2009
+.Dd January 23, 2009
 .Dt BUILD 7
 .Os
 .Sh NAME
@@ -370,6 +370,27 @@ defaults to the current machine architec
 .Va TARGET
 is also set, in which case it defaults to the appropriate
 value for that platform.
+Typically, one only needs to set 
+.Va TARGET .
+.It Va KERNCONF
+Overrides which kernel to build and install for the various kernel
+make targets.
+It defaults to
+.Cm GENERIC .
+.It Va KERNFAST
+If set, the build target
+.Cm buildkernel
+defaults to setting 
+.Va NO_KERNELCLEAN ,
+.Va NO_KERNELCONFIG
+and
+.Va NO_KERNELDEPEND .
+When set to a value other than
+.Cm 1
+then 
+.Va KERNCONF 
+is set to the value of 
+.Va KERNFAST .
 .El
 .Pp
 Builds under directory

From owner-svn-src-head@FreeBSD.ORG  Fri Jan 23 18:35:09 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B4FB9106568A;
	Fri, 23 Jan 2009 18:35:09 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A29378FC12;
	Fri, 23 Jan 2009 18:35:09 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0NIZ9Kw050044;
	Fri, 23 Jan 2009 18:35:09 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0NIZ9hn050043;
	Fri, 23 Jan 2009 18:35:09 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <200901231835.n0NIZ9hn050043@svn.freebsd.org>
From: Warner Losh 
Date: Fri, 23 Jan 2009 18:35:09 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r187638 - head/share/man/man7
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 23 Jan 2009 18:35:11 -0000

Author: imp
Date: Fri Jan 23 18:35:09 2009
New Revision: 187638
URL: http://svn.freebsd.org/changeset/base/187638

Log:
  Sort KERNFAST and KERNCONF into the list they are in.

Modified:
  head/share/man/man7/build.7

Modified: head/share/man/man7/build.7
==============================================================================
--- head/share/man/man7/build.7	Fri Jan 23 18:32:31 2009	(r187637)
+++ head/share/man/man7/build.7	Fri Jan 23 18:35:09 2009	(r187638)
@@ -335,6 +335,25 @@ are influenced by the following
 .Xr make 1
 variables:
 .Bl -tag -width ".Va SUBDIR_OVERRIDE"
+.It Va KERNCONF
+Overrides which kernel to build and install for the various kernel
+make targets.
+It defaults to
+.Cm GENERIC .
+.It Va KERNFAST
+If set, the build target
+.Cm buildkernel
+defaults to setting 
+.Va NO_KERNELCLEAN ,
+.Va NO_KERNELCONFIG
+and
+.Va NO_KERNELDEPEND .
+When set to a value other than
+.Cm 1
+then 
+.Va KERNCONF 
+is set to the value of 
+.Va KERNFAST .
 .It Va LOCAL_DIRS
 If set, this variable supplies a list of additional directories to
 build, relative to the root of the source tree.
@@ -372,25 +391,6 @@ is also set, in which case it defaults t
 value for that platform.
 Typically, one only needs to set 
 .Va TARGET .
-.It Va KERNCONF
-Overrides which kernel to build and install for the various kernel
-make targets.
-It defaults to
-.Cm GENERIC .
-.It Va KERNFAST
-If set, the build target
-.Cm buildkernel
-defaults to setting 
-.Va NO_KERNELCLEAN ,
-.Va NO_KERNELCONFIG
-and
-.Va NO_KERNELDEPEND .
-When set to a value other than
-.Cm 1
-then 
-.Va KERNCONF 
-is set to the value of 
-.Va KERNFAST .
 .El
 .Pp
 Builds under directory

From owner-svn-src-head@FreeBSD.ORG  Fri Jan 23 20:53:02 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 229DD106566C;
	Fri, 23 Jan 2009 20:53:02 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id EB6298FC12;
	Fri, 23 Jan 2009 20:53:01 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0NKr1lS053970;
	Fri, 23 Jan 2009 20:53:01 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0NKr1Sf053969;
	Fri, 23 Jan 2009 20:53:01 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <200901232053.n0NKr1Sf053969@svn.freebsd.org>
From: John Baldwin 
Date: Fri, 23 Jan 2009 20:53:01 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r187648 - head/sys/net
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 23 Jan 2009 20:53:02 -0000

Author: jhb
Date: Fri Jan 23 20:53:01 2009
New Revision: 187648
URL: http://svn.freebsd.org/changeset/base/187648

Log:
  Only start the if_slowtimo timer (which drives the if_watchdog methods of
  network interfaces) if we have at least one interface with an if_watchdog
  routine.
  
  MFC after:	2 weeks

Modified:
  head/sys/net/if.c

Modified: head/sys/net/if.c
==============================================================================
--- head/sys/net/if.c	Fri Jan 23 20:37:35 2009	(r187647)
+++ head/sys/net/if.c	Fri Jan 23 20:53:01 2009	(r187648)
@@ -97,6 +97,8 @@ struct vnet_net vnet_net_0;
 #endif
 #endif
 
+static int slowtimo_started;
+
 SYSCTL_NODE(_net, PF_LINK, link, CTLFLAG_RW, 0, "Link layers");
 SYSCTL_NODE(_net_link, 0, generic, CTLFLAG_RW, 0, "Generic link-management");
 
@@ -124,6 +126,7 @@ static int	ifconf(u_long, caddr_t);
 static void	if_freemulti(struct ifmultiaddr *);
 static void	if_grow(void);
 static void	if_init(void *);
+static void	if_check(void *);
 static void	if_qflush(struct ifnet *);
 static void	if_route(struct ifnet *, int flag, int fam);
 static int	if_setflag(struct ifnet *, int, int, int *, int);
@@ -185,7 +188,7 @@ VNET_MOD_DECLARE(NET, net, vnet_net_iatt
  * System initialization
  */
 SYSINIT(interfaces, SI_SUB_INIT_IF, SI_ORDER_FIRST, if_init, NULL);
-SYSINIT(interface_check, SI_SUB_PROTO_IF, SI_ORDER_FIRST, if_slowtimo, NULL);
+SYSINIT(interface_check, SI_SUB_PROTO_IF, SI_ORDER_FIRST, if_check, NULL);
 
 MALLOC_DEFINE(M_IFNET, "ifnet", "interface internals");
 MALLOC_DEFINE(M_IFADDR, "ifaddr", "interface address");
@@ -425,6 +428,18 @@ if_grow(void)
 	V_ifindex_table = e;
 }
 
+static void
+if_check(void *dummy __unused)
+{
+
+	/*
+	 * If at least one interface added during boot uses
+	 * if_watchdog then start the timer.
+	 */
+	if (slowtimo_started)
+		if_slowtimo(0);
+}
+
 /*
  * Allocate a struct ifnet and an index for an interface.  A layer 2
  * common structure will also be allocated if an allocation routine is
@@ -647,9 +662,17 @@ if_attach(struct ifnet *ifp)
 	/* Announce the interface. */
 	rt_ifannouncemsg(ifp, IFAN_ARRIVAL);
 
-	if (ifp->if_watchdog != NULL)
+	if (ifp->if_watchdog != NULL) {
 		if_printf(ifp,
 		    "WARNING: using obsoleted if_watchdog interface\n");
+	      
+		/*
+		 * Note that we need if_slowtimo().  If this happens after
+		 * boot, then call if_slowtimo() directly.
+		 */
+		if (atomic_cmpset_int(&slowtimo_started, 0, 1) && !cold)
+			if_slowtimo(0);
+	}
 	if (ifp->if_flags & IFF_NEEDSGIANT)
 		if_printf(ifp,
 		    "WARNING: using obsoleted IFF_NEEDSGIANT flag\n");

From owner-svn-src-head@FreeBSD.ORG  Fri Jan 23 21:03:59 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6DFBB1065674;
	Fri, 23 Jan 2009 21:03:59 +0000 (UTC)
	(envelope-from trasz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 5CDB58FC19;
	Fri, 23 Jan 2009 21:03:59 +0000 (UTC)
	(envelope-from trasz@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0NL3xbX054207;
	Fri, 23 Jan 2009 21:03:59 GMT (envelope-from trasz@svn.freebsd.org)
Received: (from trasz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0NL3xCj054206;
	Fri, 23 Jan 2009 21:03:59 GMT (envelope-from trasz@svn.freebsd.org)
Message-Id: <200901232103.n0NL3xCj054206@svn.freebsd.org>
From: Edward Tomasz Napierala 
Date: Fri, 23 Jan 2009 21:03:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r187649 - head/sys/cam
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 23 Jan 2009 21:03:59 -0000

Author: trasz
Date: Fri Jan 23 21:03:59 2009
New Revision: 187649
URL: http://svn.freebsd.org/changeset/base/187649

Log:
  Guard against NULL pointer dereference.
  
  Reviewed by:	scottl
  Approved by:	rwatson (mentor)
  Sponsored by:	FreeBSD Foundation
  Found with:	Coverity Prevent(tm)
  CID:		130

Modified:
  head/sys/cam/cam_periph.c

Modified: head/sys/cam/cam_periph.c
==============================================================================
--- head/sys/cam/cam_periph.c	Fri Jan 23 20:53:01 2009	(r187648)
+++ head/sys/cam/cam_periph.c	Fri Jan 23 21:03:59 2009	(r187649)
@@ -171,6 +171,10 @@ cam_periph_alloc(periph_ctor_t *periph_c
 			break;
 	}
 	xpt_unlock_buses();
+	if (p_drv == NULL) {
+		printf("cam_periph_alloc: invalid periph name '%s'\n", name);
+		return (CAM_REQ_INVALID);
+	}
 
 	sim = xpt_path_sim(path);
 	path_id = xpt_path_path_id(path);

From owner-svn-src-head@FreeBSD.ORG  Fri Jan 23 21:05:17 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 43C06106566B;
	Fri, 23 Jan 2009 21:05:17 +0000 (UTC)
	(envelope-from trasz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 32DAC8FC0C;
	Fri, 23 Jan 2009 21:05:17 +0000 (UTC)
	(envelope-from trasz@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0NL5HIb054270;
	Fri, 23 Jan 2009 21:05:17 GMT (envelope-from trasz@svn.freebsd.org)
Received: (from trasz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0NL5H7P054269;
	Fri, 23 Jan 2009 21:05:17 GMT (envelope-from trasz@svn.freebsd.org)
Message-Id: <200901232105.n0NL5H7P054269@svn.freebsd.org>
From: Edward Tomasz Napierala 
Date: Fri, 23 Jan 2009 21:05:17 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r187650 - head/sys/cam
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 23 Jan 2009 21:05:17 -0000

Author: trasz
Date: Fri Jan 23 21:05:16 2009
New Revision: 187650
URL: http://svn.freebsd.org/changeset/base/187650

Log:
  Guard against NULL pointer dereference.
  
  Reviewed by:	scottl
  Approved by:	rwatson (mentor)
  Sponsored by:	FreeBSD Foundation
  Found with:	Coverity Prevent(tm)
  CID:		1847

Modified:
  head/sys/cam/cam_xpt.c

Modified: head/sys/cam/cam_xpt.c
==============================================================================
--- head/sys/cam/cam_xpt.c	Fri Jan 23 21:03:59 2009	(r187649)
+++ head/sys/cam/cam_xpt.c	Fri Jan 23 21:05:16 2009	(r187650)
@@ -4177,7 +4177,10 @@ xpt_path_string(struct cam_path *path, c
 {
 	struct sbuf sb;
 
-	mtx_assert(path->bus->sim->mtx, MA_OWNED);
+#ifdef INVARIANTS
+	if (path != NULL && path->bus != NULL && path->bus->sim != NULL)
+		mtx_assert(path->bus->sim->mtx, MA_OWNED);
+#endif
 
 	sbuf_new(&sb, str, str_len, 0);
 

From owner-svn-src-head@FreeBSD.ORG  Fri Jan 23 21:06:16 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A0345106564A;
	Fri, 23 Jan 2009 21:06:16 +0000 (UTC)
	(envelope-from trasz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8F41E8FC20;
	Fri, 23 Jan 2009 21:06:16 +0000 (UTC)
	(envelope-from trasz@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0NL6GJo054327;
	Fri, 23 Jan 2009 21:06:16 GMT (envelope-from trasz@svn.freebsd.org)
Received: (from trasz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0NL6G70054326;
	Fri, 23 Jan 2009 21:06:16 GMT (envelope-from trasz@svn.freebsd.org)
Message-Id: <200901232106.n0NL6G70054326@svn.freebsd.org>
From: Edward Tomasz Napierala 
Date: Fri, 23 Jan 2009 21:06:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r187651 - head/sys/cam/scsi
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 23 Jan 2009 21:06:17 -0000

Author: trasz
Date: Fri Jan 23 21:06:16 2009
New Revision: 187651
URL: http://svn.freebsd.org/changeset/base/187651

Log:
  Don't leak memory when alloc fails.
  
  Reviewed by:	scottl
  Approved by:	rwatson (mentor)
  Sponsored by:	FreeBSD Foundation
  Found with:	Coverity Prevent(tm)
  CID:		2908

Modified:
  head/sys/cam/scsi/scsi_low.c

Modified: head/sys/cam/scsi/scsi_low.c
==============================================================================
--- head/sys/cam/scsi/scsi_low.c	Fri Jan 23 21:05:16 2009	(r187650)
+++ head/sys/cam/scsi/scsi_low.c	Fri Jan 23 21:06:16 2009	(r187651)
@@ -966,16 +966,16 @@ scsi_low_rescan_bus_cam(slp)
 	struct scsi_low_softc *slp;
 {
   	struct cam_path *path;
-	union ccb *ccb = xpt_alloc_ccb();
+	union ccb *ccb; 
 	cam_status status;
 
-	bzero(ccb, sizeof(union ccb));
-
 	status = xpt_create_path(&path, xpt_periph,
 				 cam_sim_path(slp->sl_si.sim), -1, 0);
 	if (status != CAM_REQ_CMP)
 		return;
 
+	ccb = xpt_alloc_ccb();
+	bzero(ccb, sizeof(union ccb));
 	xpt_setup_ccb(&ccb->ccb_h, path, 5);
 	ccb->ccb_h.func_code = XPT_SCAN_BUS;
 	ccb->ccb_h.cbfcnp = scsi_low_cam_rescan_callback;

From owner-svn-src-head@FreeBSD.ORG  Fri Jan 23 21:08:00 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D625F106566B;
	Fri, 23 Jan 2009 21:08:00 +0000 (UTC)
	(envelope-from trasz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C57718FC0C;
	Fri, 23 Jan 2009 21:08:00 +0000 (UTC)
	(envelope-from trasz@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0NL80pO054398;
	Fri, 23 Jan 2009 21:08:00 GMT (envelope-from trasz@svn.freebsd.org)
Received: (from trasz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0NL80Y6054397;
	Fri, 23 Jan 2009 21:08:00 GMT (envelope-from trasz@svn.freebsd.org)
Message-Id: <200901232108.n0NL80Y6054397@svn.freebsd.org>
From: Edward Tomasz Napierala 
Date: Fri, 23 Jan 2009 21:08:00 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r187652 - head/sys/cam
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 23 Jan 2009 21:08:01 -0000

Author: trasz
Date: Fri Jan 23 21:08:00 2009
New Revision: 187652
URL: http://svn.freebsd.org/changeset/base/187652

Log:
  Protect against NULL pointer dereference.
  
  Reviewed by:	scottl
  Approved by:	rwatson (mentor)
  Sponsored by:	FreeBSD Foundation

Modified:
  head/sys/cam/cam_xpt.c

Modified: head/sys/cam/cam_xpt.c
==============================================================================
--- head/sys/cam/cam_xpt.c	Fri Jan 23 21:06:16 2009	(r187651)
+++ head/sys/cam/cam_xpt.c	Fri Jan 23 21:08:00 2009	(r187652)
@@ -5194,6 +5194,11 @@ xpt_scan_bus(struct cam_periph *periph, 
 		/* Save some state for use while we probe for devices */
 		scan_info = (xpt_scan_bus_info *)
 		    malloc(sizeof(xpt_scan_bus_info), M_CAMXPT, M_NOWAIT);
+		if (scan_info == NULL) {
+			request_ccb->ccb_h.status = CAM_RESRC_UNAVAIL;
+			xpt_done(request_ccb);
+			return;
+		}
 		scan_info->request_ccb = request_ccb;
 		scan_info->cpi = &work_ccb->cpi;
 

From owner-svn-src-head@FreeBSD.ORG  Fri Jan 23 22:08:55 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 49E49106566B;
	Fri, 23 Jan 2009 22:08:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3998F8FC0A;
	Fri, 23 Jan 2009 22:08:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0NM8tlN055510;
	Fri, 23 Jan 2009 22:08:55 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0NM8tXk055509;
	Fri, 23 Jan 2009 22:08:55 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <200901232208.n0NM8tXk055509@svn.freebsd.org>
From: John Baldwin 
Date: Fri, 23 Jan 2009 22:08:55 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r187653 - head/sys/kern
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 23 Jan 2009 22:08:56 -0000

Author: jhb
Date: Fri Jan 23 22:08:54 2009
New Revision: 187653
URL: http://svn.freebsd.org/changeset/base/187653

Log:
  Push down Giant in the vlnru kproc main loop so that it is only acquired
  around calls to vlrureclaim() on non-MPSAFE filesystems.  Specifically,
  vnlru no longer needs Giant for the common case of waking up and deciding
  there is nothing for it to do.
  
  MFC after:	2 weeks

Modified:
  head/sys/kern/vfs_subr.c

Modified: head/sys/kern/vfs_subr.c
==============================================================================
--- head/sys/kern/vfs_subr.c	Fri Jan 23 21:08:00 2009	(r187652)
+++ head/sys/kern/vfs_subr.c	Fri Jan 23 22:08:54 2009	(r187653)
@@ -755,14 +755,12 @@ static void
 vnlru_proc(void)
 {
 	struct mount *mp, *nmp;
-	int done;
+	int done, vfslocked;
 	struct proc *p = vnlruproc;
 
 	EVENTHANDLER_REGISTER(shutdown_pre_sync, kproc_shutdown, p,
 	    SHUTDOWN_PRI_FIRST);
 
-	mtx_lock(&Giant);
-
 	for (;;) {
 		kproc_suspend_check(p);
 		mtx_lock(&vnode_free_list_mtx);
@@ -779,19 +777,13 @@ vnlru_proc(void)
 		done = 0;
 		mtx_lock(&mountlist_mtx);
 		for (mp = TAILQ_FIRST(&mountlist); mp != NULL; mp = nmp) {
-			int vfsunlocked;
 			if (vfs_busy(mp, MBF_NOWAIT | MBF_MNTLSTLOCK)) {
 				nmp = TAILQ_NEXT(mp, mnt_list);
 				continue;
 			}
-			if (!VFS_NEEDSGIANT(mp)) {
-				mtx_unlock(&Giant);
-				vfsunlocked = 1;
-			} else
-				vfsunlocked = 0;
+			vfslocked = VFS_LOCK_GIANT(mp);
 			done += vlrureclaim(mp);
-			if (vfsunlocked)
-				mtx_lock(&Giant);
+			VFS_UNLOCK_GIANT(vfslocked);
 			mtx_lock(&mountlist_mtx);
 			nmp = TAILQ_NEXT(mp, mnt_list);
 			vfs_unbusy(mp);

From owner-svn-src-head@FreeBSD.ORG  Fri Jan 23 22:13:00 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C0046106564A;
	Fri, 23 Jan 2009 22:13:00 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id AF8138FC18;
	Fri, 23 Jan 2009 22:13:00 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0NMD0CQ055625;
	Fri, 23 Jan 2009 22:13:00 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0NMD0n8055624;
	Fri, 23 Jan 2009 22:13:00 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <200901232213.n0NMD0n8055624@svn.freebsd.org>
From: John Baldwin 
Date: Fri, 23 Jan 2009 22:13:00 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r187654 - head/sys/kern
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 23 Jan 2009 22:13:01 -0000

Author: jhb
Date: Fri Jan 23 22:13:00 2009
New Revision: 187654
URL: http://svn.freebsd.org/changeset/base/187654

Log:
  Tweak the wording for vfs_mark_atime() since the I/O it is avoiding by not
  updating va_atime via VOP_SETATTR() isn't always synchronous.  For some
  filesystems it is asynchronous.
  
  Suggested by:  bde

Modified:
  head/sys/kern/vfs_subr.c

Modified: head/sys/kern/vfs_subr.c
==============================================================================
--- head/sys/kern/vfs_subr.c	Fri Jan 23 22:08:54 2009	(r187653)
+++ head/sys/kern/vfs_subr.c	Fri Jan 23 22:13:00 2009	(r187654)
@@ -4198,9 +4198,9 @@ vfs_read_dirent(struct vop_readdir_args 
 
 /*
  * Mark for update the access time of the file if the filesystem
- * supports VOP_MARKATIME.  This functionality is used by execve
- * and mmap, so we want to avoid the synchronous I/O implied by
- * directly setting va_atime for the sake of efficiency.
+ * supports VOP_MARKATIME.  This functionality is used by execve and
+ * mmap, so we want to avoid the I/O implied by directly setting
+ * va_atime for the sake of efficiency.
  */
 void
 vfs_mark_atime(struct vnode *vp, struct ucred *cred)

From owner-svn-src-head@FreeBSD.ORG  Fri Jan 23 22:13:30 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6E62D10656C9;
	Fri, 23 Jan 2009 22:13:30 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 5E1A48FC08;
	Fri, 23 Jan 2009 22:13:30 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0NMDUF9055673;
	Fri, 23 Jan 2009 22:13:30 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0NMDUID055672;
	Fri, 23 Jan 2009 22:13:30 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <200901232213.n0NMDUID055672@svn.freebsd.org>
From: John Baldwin 
Date: Fri, 23 Jan 2009 22:13:30 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r187655 - head/sys/kern
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 23 Jan 2009 22:13:30 -0000

Author: jhb
Date: Fri Jan 23 22:13:30 2009
New Revision: 187655
URL: http://svn.freebsd.org/changeset/base/187655

Log:
  Use shared vnode locks for fchdir().
  
  Submitted by:	ups

Modified:
  head/sys/kern/vfs_syscalls.c

Modified: head/sys/kern/vfs_syscalls.c
==============================================================================
--- head/sys/kern/vfs_syscalls.c	Fri Jan 23 22:13:00 2009	(r187654)
+++ head/sys/kern/vfs_syscalls.c	Fri Jan 23 22:13:30 2009	(r187655)
@@ -758,7 +758,7 @@ fchdir(td, uap)
 	VREF(vp);
 	fdrop(fp, td);
 	vfslocked = VFS_LOCK_GIANT(vp->v_mount);
-	vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
+	vn_lock(vp, LK_SHARED | LK_RETRY);
 	AUDIT_ARG(vnode, vp, ARG_VNODE1);
 	error = change_dir(vp, td);
 	while (!error && (mp = vp->v_mountedhere) != NULL) {
@@ -766,7 +766,7 @@ fchdir(td, uap)
 		if (vfs_busy(mp, 0))
 			continue;
 		tvfslocked = VFS_LOCK_GIANT(mp);
-		error = VFS_ROOT(mp, LK_EXCLUSIVE, &tdp, td);
+		error = VFS_ROOT(mp, LK_SHARED, &tdp, td);
 		vfs_unbusy(mp);
 		if (error) {
 			VFS_UNLOCK_GIANT(tvfslocked);

From owner-svn-src-head@FreeBSD.ORG  Fri Jan 23 22:40:35 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 73A5F106566C;
	Fri, 23 Jan 2009 22:40:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 633838FC1A;
	Fri, 23 Jan 2009 22:40:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0NMeZ2a056220;
	Fri, 23 Jan 2009 22:40:35 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0NMeZ04056218;
	Fri, 23 Jan 2009 22:40:35 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <200901232240.n0NMeZ04056218@svn.freebsd.org>
From: John Baldwin 
Date: Fri, 23 Jan 2009 22:40:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r187656 - in head/sys: kern sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 23 Jan 2009 22:40:35 -0000

Author: jhb
Date: Fri Jan 23 22:40:35 2009
New Revision: 187656
URL: http://svn.freebsd.org/changeset/base/187656

Log:
  Add a flag to tag individual sysctl leaf nodes as MPSAFE and thus not
  needing Giant.
  
  Submitted by:	csjp (an older version)

Modified:
  head/sys/kern/kern_sysctl.c
  head/sys/sys/sysctl.h

Modified: head/sys/kern/kern_sysctl.c
==============================================================================
--- head/sys/kern/kern_sysctl.c	Fri Jan 23 22:13:30 2009	(r187655)
+++ head/sys/kern/kern_sysctl.c	Fri Jan 23 22:40:35 2009	(r187656)
@@ -1334,11 +1334,11 @@ sysctl_root(SYSCTL_HANDLER_ARGS)
 	if (error != 0)
 		return (error);
 #endif
-
-	/* XXX: Handlers are not guaranteed to be Giant safe! */
-	mtx_lock(&Giant);
+	if (!(oid->oid_kind & CTLFLAG_MPSAFE))
+		mtx_lock(&Giant);
 	error = oid->oid_handler(oid, arg1, arg2, req);
-	mtx_unlock(&Giant);
+	if (!(oid->oid_kind & CTLFLAG_MPSAFE))
+		mtx_unlock(&Giant);
 
 	return (error);
 }

Modified: head/sys/sys/sysctl.h
==============================================================================
--- head/sys/sys/sysctl.h	Fri Jan 23 22:13:30 2009	(r187655)
+++ head/sys/sys/sysctl.h	Fri Jan 23 22:40:35 2009	(r187656)
@@ -84,6 +84,7 @@ struct ctlname {
 #define CTLFLAG_SKIP	0x01000000	/* Skip this sysctl when listing */
 #define CTLMASK_SECURE	0x00F00000	/* Secure level */
 #define CTLFLAG_TUN	0x00080000	/* Tunable variable */
+#define CTLFLAG_MPSAFE	0x00040000	/* Handler is MP safe */
 #define CTLFLAG_RDTUN	(CTLFLAG_RD|CTLFLAG_TUN)
 
 /*

From owner-svn-src-head@FreeBSD.ORG  Fri Jan 23 22:46:46 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0154B1065670;
	Fri, 23 Jan 2009 22:46:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D654B8FC1A;
	Fri, 23 Jan 2009 22:46:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0NMkjsV056361;
	Fri, 23 Jan 2009 22:46:45 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0NMkjfg056360;
	Fri, 23 Jan 2009 22:46:45 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <200901232246.n0NMkjfg056360@svn.freebsd.org>
From: John Baldwin 
Date: Fri, 23 Jan 2009 22:46:45 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r187657 - head/sys/kern
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 23 Jan 2009 22:46:47 -0000

Author: jhb
Date: Fri Jan 23 22:46:45 2009
New Revision: 187657
URL: http://svn.freebsd.org/changeset/base/187657

Log:
  - Add conditional Giant locking around the vrele() in
    sysctl_kern_proc_pathname().
  - Mark all the kern.proc.* sysctls as MPSAFE.
  
  Submitted by:	csjp (2)

Modified:
  head/sys/kern/kern_proc.c

Modified: head/sys/kern/kern_proc.c
==============================================================================
--- head/sys/kern/kern_proc.c	Fri Jan 23 22:40:35 2009	(r187656)
+++ head/sys/kern/kern_proc.c	Fri Jan 23 22:46:45 2009	(r187657)
@@ -1280,7 +1280,7 @@ sysctl_kern_proc_pathname(SYSCTL_HANDLER
 	struct proc *p;
 	struct vnode *vp;
 	char *retbuf, *freebuf;
-	int error;
+	int error, vfslocked;
 
 	if (arglen != 1)
 		return (EINVAL);
@@ -1306,7 +1306,9 @@ sysctl_kern_proc_pathname(SYSCTL_HANDLER
 	if (*pidp != -1)
 		PROC_UNLOCK(p);
 	error = vn_fullpath(req->td, vp, &retbuf, &freebuf);
+	vfslocked = VFS_LOCK_GIANT(vp->v_mount);
 	vrele(vp);
+	VFS_UNLOCK_GIANT(vfslocked);
 	if (error)
 		return (error);
 	error = SYSCTL_OUT(req, retbuf, strlen(retbuf) + 1);
@@ -1793,82 +1795,85 @@ repeat:
 
 SYSCTL_NODE(_kern, KERN_PROC, proc, CTLFLAG_RD,  0, "Process table");
 
-SYSCTL_PROC(_kern_proc, KERN_PROC_ALL, all, CTLFLAG_RD|CTLTYPE_STRUCT,
-	0, 0, sysctl_kern_proc, "S,proc", "Return entire process table");
+SYSCTL_PROC(_kern_proc, KERN_PROC_ALL, all, CTLFLAG_RD|CTLTYPE_STRUCT|
+	CTLFLAG_MPSAFE, 0, 0, sysctl_kern_proc, "S,proc",
+	"Return entire process table");
 
-static SYSCTL_NODE(_kern_proc, KERN_PROC_GID, gid, CTLFLAG_RD,
+static SYSCTL_NODE(_kern_proc, KERN_PROC_GID, gid, CTLFLAG_RD | CTLFLAG_MPSAFE,
 	sysctl_kern_proc, "Process table");
 
-static SYSCTL_NODE(_kern_proc, KERN_PROC_PGRP, pgrp, CTLFLAG_RD, 
+static SYSCTL_NODE(_kern_proc, KERN_PROC_PGRP, pgrp, CTLFLAG_RD | CTLFLAG_MPSAFE,
 	sysctl_kern_proc, "Process table");
 
-static SYSCTL_NODE(_kern_proc, KERN_PROC_RGID, rgid, CTLFLAG_RD,
+static SYSCTL_NODE(_kern_proc, KERN_PROC_RGID, rgid, CTLFLAG_RD | CTLFLAG_MPSAFE,
 	sysctl_kern_proc, "Process table");
 
-static SYSCTL_NODE(_kern_proc, KERN_PROC_SESSION, sid, CTLFLAG_RD,
-	sysctl_kern_proc, "Process table");
+static SYSCTL_NODE(_kern_proc, KERN_PROC_SESSION, sid, CTLFLAG_RD |
+	CTLFLAG_MPSAFE, sysctl_kern_proc, "Process table");
 
-static SYSCTL_NODE(_kern_proc, KERN_PROC_TTY, tty, CTLFLAG_RD, 
+static SYSCTL_NODE(_kern_proc, KERN_PROC_TTY, tty, CTLFLAG_RD | CTLFLAG_MPSAFE, 
 	sysctl_kern_proc, "Process table");
 
-static SYSCTL_NODE(_kern_proc, KERN_PROC_UID, uid, CTLFLAG_RD, 
+static SYSCTL_NODE(_kern_proc, KERN_PROC_UID, uid, CTLFLAG_RD | CTLFLAG_MPSAFE, 
 	sysctl_kern_proc, "Process table");
 
-static SYSCTL_NODE(_kern_proc, KERN_PROC_RUID, ruid, CTLFLAG_RD, 
+static SYSCTL_NODE(_kern_proc, KERN_PROC_RUID, ruid, CTLFLAG_RD | CTLFLAG_MPSAFE,
 	sysctl_kern_proc, "Process table");
 
-static SYSCTL_NODE(_kern_proc, KERN_PROC_PID, pid, CTLFLAG_RD, 
+static SYSCTL_NODE(_kern_proc, KERN_PROC_PID, pid, CTLFLAG_RD | CTLFLAG_MPSAFE,
 	sysctl_kern_proc, "Process table");
 
-static SYSCTL_NODE(_kern_proc, KERN_PROC_PROC, proc, CTLFLAG_RD,
+static SYSCTL_NODE(_kern_proc, KERN_PROC_PROC, proc, CTLFLAG_RD | CTLFLAG_MPSAFE,
 	sysctl_kern_proc, "Return process table, no threads");
 
 static SYSCTL_NODE(_kern_proc, KERN_PROC_ARGS, args,
-	CTLFLAG_RW | CTLFLAG_ANYBODY,
+	CTLFLAG_RW | CTLFLAG_ANYBODY | CTLFLAG_MPSAFE,
 	sysctl_kern_proc_args, "Process argument list");
 
-static SYSCTL_NODE(_kern_proc, KERN_PROC_PATHNAME, pathname, CTLFLAG_RD,
-	sysctl_kern_proc_pathname, "Process executable path");
+static SYSCTL_NODE(_kern_proc, KERN_PROC_PATHNAME, pathname, CTLFLAG_RD |
+	CTLFLAG_MPSAFE, sysctl_kern_proc_pathname, "Process executable path");
 
-static SYSCTL_NODE(_kern_proc, KERN_PROC_SV_NAME, sv_name, CTLFLAG_RD,
-	sysctl_kern_proc_sv_name, "Process syscall vector name (ABI type)");
+static SYSCTL_NODE(_kern_proc, KERN_PROC_SV_NAME, sv_name, CTLFLAG_RD |
+	CTLFLAG_MPSAFE, sysctl_kern_proc_sv_name,
+	"Process syscall vector name (ABI type)");
 
 static SYSCTL_NODE(_kern_proc, (KERN_PROC_GID | KERN_PROC_INC_THREAD), gid_td,
-	CTLFLAG_RD, sysctl_kern_proc, "Process table");
+	CTLFLAG_RD | CTLFLAG_MPSAFE, sysctl_kern_proc, "Process table");
 
 static SYSCTL_NODE(_kern_proc, (KERN_PROC_PGRP | KERN_PROC_INC_THREAD), pgrp_td,
-	CTLFLAG_RD, sysctl_kern_proc, "Process table");
+	CTLFLAG_RD | CTLFLAG_MPSAFE, sysctl_kern_proc, "Process table");
 
 static SYSCTL_NODE(_kern_proc, (KERN_PROC_RGID | KERN_PROC_INC_THREAD), rgid_td,
-	CTLFLAG_RD, sysctl_kern_proc, "Process table");
+	CTLFLAG_RD | CTLFLAG_MPSAFE, sysctl_kern_proc, "Process table");
 
 static SYSCTL_NODE(_kern_proc, (KERN_PROC_SESSION | KERN_PROC_INC_THREAD),
-	sid_td, CTLFLAG_RD, sysctl_kern_proc, "Process table");
+	sid_td, CTLFLAG_RD | CTLFLAG_MPSAFE, sysctl_kern_proc, "Process table");
 
 static SYSCTL_NODE(_kern_proc, (KERN_PROC_TTY | KERN_PROC_INC_THREAD), tty_td,
-	CTLFLAG_RD, sysctl_kern_proc, "Process table");
+	CTLFLAG_RD | CTLFLAG_MPSAFE, sysctl_kern_proc, "Process table");
 
 static SYSCTL_NODE(_kern_proc, (KERN_PROC_UID | KERN_PROC_INC_THREAD), uid_td,
-	CTLFLAG_RD, sysctl_kern_proc, "Process table");
+	CTLFLAG_RD | CTLFLAG_MPSAFE, sysctl_kern_proc, "Process table");
 
 static SYSCTL_NODE(_kern_proc, (KERN_PROC_RUID | KERN_PROC_INC_THREAD), ruid_td,
-	CTLFLAG_RD, sysctl_kern_proc, "Process table");
+	CTLFLAG_RD | CTLFLAG_MPSAFE, sysctl_kern_proc, "Process table");
 
 static SYSCTL_NODE(_kern_proc, (KERN_PROC_PID | KERN_PROC_INC_THREAD), pid_td,
-	CTLFLAG_RD, sysctl_kern_proc, "Process table");
+	CTLFLAG_RD | CTLFLAG_MPSAFE, sysctl_kern_proc, "Process table");
 
 static SYSCTL_NODE(_kern_proc, (KERN_PROC_PROC | KERN_PROC_INC_THREAD), proc_td,
-	CTLFLAG_RD, sysctl_kern_proc, "Return process table, no threads");
+	CTLFLAG_RD | CTLFLAG_MPSAFE, sysctl_kern_proc,
+	"Return process table, no threads");
 
 #ifdef COMPAT_FREEBSD7
-static SYSCTL_NODE(_kern_proc, KERN_PROC_OVMMAP, ovmmap, CTLFLAG_RD,
-	sysctl_kern_proc_ovmmap, "Old Process vm map entries");
+static SYSCTL_NODE(_kern_proc, KERN_PROC_OVMMAP, ovmmap, CTLFLAG_RD |
+	CTLFLAG_MPSAFE, sysctl_kern_proc_ovmmap, "Old Process vm map entries");
 #endif
 
-static SYSCTL_NODE(_kern_proc, KERN_PROC_VMMAP, vmmap, CTLFLAG_RD,
-	sysctl_kern_proc_vmmap, "Process vm map entries");
+static SYSCTL_NODE(_kern_proc, KERN_PROC_VMMAP, vmmap, CTLFLAG_RD |
+	CTLFLAG_MPSAFE, sysctl_kern_proc_vmmap, "Process vm map entries");
 
 #if defined(STACK) || defined(DDB)
-static SYSCTL_NODE(_kern_proc, KERN_PROC_KSTACK, kstack, CTLFLAG_RD,
-	sysctl_kern_proc_kstack, "Process kernel stacks");
+static SYSCTL_NODE(_kern_proc, KERN_PROC_KSTACK, kstack, CTLFLAG_RD |
+	CTLFLAG_MPSAFE, sysctl_kern_proc_kstack, "Process kernel stacks");
 #endif

From owner-svn-src-head@FreeBSD.ORG  Fri Jan 23 22:49:23 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 59881106564A;
	Fri, 23 Jan 2009 22:49:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 46CFF8FC19;
	Fri, 23 Jan 2009 22:49:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0NMnN3p056444;
	Fri, 23 Jan 2009 22:49:23 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0NMnNIr056441;
	Fri, 23 Jan 2009 22:49:23 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <200901232249.n0NMnNIr056441@svn.freebsd.org>
From: John Baldwin 
Date: Fri, 23 Jan 2009 22:49:23 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r187658 - in head/sys: kern sys vm
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 23 Jan 2009 22:49:23 -0000

Author: jhb
Date: Fri Jan 23 22:49:23 2009
New Revision: 187658
URL: http://svn.freebsd.org/changeset/base/187658

Log:
  - Mark all standalone INT/LONG/QUAD sysctl's MPSAFE.  This is done
    inside the SYSCTL() macros and thus does not need to be done for
    all of the nodes scattered across the source tree.
  - Mark the name-cache related sysctl's (including debug.hashstat.*) MPSAFE.
  - Mark vm.loadavg MPSAFE.
  - Remove GIANT_REQUIRED from vmtotal() (everything in this routine already
    has sufficient locking) and mark vm.vmtotal MPSAFE.
  - Mark the vm.stats.(sys|vm).* sysctls MPSAFE.

Modified:
  head/sys/kern/vfs_cache.c
  head/sys/sys/sysctl.h
  head/sys/vm/vm_meter.c

Modified: head/sys/kern/vfs_cache.c
==============================================================================
--- head/sys/kern/vfs_cache.c	Fri Jan 23 22:46:45 2009	(r187657)
+++ head/sys/kern/vfs_cache.c	Fri Jan 23 22:49:23 2009	(r187658)
@@ -163,8 +163,8 @@ static u_long numposhits; STATNODE(CTLFL
 static u_long numnegzaps; STATNODE(CTLFLAG_RD, numnegzaps, &numnegzaps);
 static u_long numneghits; STATNODE(CTLFLAG_RD, numneghits, &numneghits);
 
-SYSCTL_OPAQUE(_vfs_cache, OID_AUTO, nchstats, CTLFLAG_RD, &nchstats,
-	sizeof(nchstats), "LU", "VFS cache effectiveness statistics");
+SYSCTL_OPAQUE(_vfs_cache, OID_AUTO, nchstats, CTLFLAG_RD | CTLFLAG_MPSAFE,
+	&nchstats, sizeof(nchstats), "LU", "VFS cache effectiveness statistics");
 
 
 
@@ -212,8 +212,9 @@ sysctl_debug_hashstat_rawnchash(SYSCTL_H
 	}
 	return (0);
 }
-SYSCTL_PROC(_debug_hashstat, OID_AUTO, rawnchash, CTLTYPE_INT|CTLFLAG_RD,
-	0, 0, sysctl_debug_hashstat_rawnchash, "S,int", "nchash chain lengths");
+SYSCTL_PROC(_debug_hashstat, OID_AUTO, rawnchash, CTLTYPE_INT|CTLFLAG_RD|
+	CTLFLAG_MPSAFE, 0, 0, sysctl_debug_hashstat_rawnchash, "S,int",
+	"nchash chain lengths");
 
 static int
 sysctl_debug_hashstat_nchash(SYSCTL_HANDLER_ARGS)
@@ -260,8 +261,9 @@ sysctl_debug_hashstat_nchash(SYSCTL_HAND
 		return (error);
 	return (0);
 }
-SYSCTL_PROC(_debug_hashstat, OID_AUTO, nchash, CTLTYPE_INT|CTLFLAG_RD,
-	0, 0, sysctl_debug_hashstat_nchash, "I", "nchash chain lengths");
+SYSCTL_PROC(_debug_hashstat, OID_AUTO, nchash, CTLTYPE_INT|CTLFLAG_RD|
+	CTLFLAG_MPSAFE, 0, 0, sysctl_debug_hashstat_nchash, "I",
+	"nchash chain lengths");
 
 /*
  * cache_zap():

Modified: head/sys/sys/sysctl.h
==============================================================================
--- head/sys/sys/sysctl.h	Fri Jan 23 22:46:45 2009	(r187657)
+++ head/sys/sys/sysctl.h	Fri Jan 23 22:49:23 2009	(r187658)
@@ -287,7 +287,7 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_e
 
 /* Oid for an int.  If ptr is NULL, val is returned. */
 #define SYSCTL_INT(parent, nbr, name, access, ptr, val, descr) \
-	SYSCTL_OID(parent, nbr, name, CTLTYPE_INT|(access), \
+	SYSCTL_OID(parent, nbr, name, CTLTYPE_INT|CTLFLAG_MPSAFE|(access), \
 		ptr, val, sysctl_handle_int, "I", descr)
 
 #ifdef VIMAGE
@@ -297,22 +297,22 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_e
 #else
 #ifdef VIMAGE_GLOBALS
 #define	SYSCTL_V_INT(subs, mod, parent, nbr, name, access, sym, val, descr) \
-	SYSCTL_OID(parent, nbr, name, CTLTYPE_INT|(access), \
+	SYSCTL_OID(parent, nbr, name, CTLTYPE_INT|CTLFLAG_MPSAFE|(access), \
 		&sym, val, sysctl_handle_int, "I", descr)
 #else
 #define	SYSCTL_V_INT(subs, mod, parent, nbr, name, access, sym, val, descr) \
-	SYSCTL_OID(parent, nbr, name, CTLTYPE_INT|(access), \
+	SYSCTL_OID(parent, nbr, name, CTLTYPE_INT|CTLFLAG_MPSAFE|(access), \
 		& mod ## _0._ ## sym, val, sysctl_handle_int, "I", descr)
 #endif
 #endif
 
 #define SYSCTL_ADD_INT(ctx, parent, nbr, name, access, ptr, val, descr)	    \
-	sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_INT|(access),	    \
+	sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_INT|CTLFLAG_MPSAFE|(access),	    \
 	ptr, val, sysctl_handle_int, "I", __DESCR(descr))
 
 /* Oid for an unsigned int.  If ptr is NULL, val is returned. */
 #define SYSCTL_UINT(parent, nbr, name, access, ptr, val, descr) \
-	SYSCTL_OID(parent, nbr, name, CTLTYPE_UINT|(access), \
+	SYSCTL_OID(parent, nbr, name, CTLTYPE_UINT|CTLFLAG_MPSAFE|(access), \
 		ptr, val, sysctl_handle_int, "IU", descr)
 
 #ifdef VIMAGE
@@ -322,60 +322,60 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_e
 #else
 #ifdef VIMAGE_GLOBALS
 #define	SYSCTL_V_UINT(subs, mod, parent, nbr, name, access, sym, val, descr) \
-	SYSCTL_OID(parent, nbr, name, CTLTYPE_UINT|(access), \
+	SYSCTL_OID(parent, nbr, name, CTLTYPE_UINT|CTLFLAG_MPSAFE|(access), \
 		&sym, val, sysctl_handle_int, "IU", descr)
 #else
 #define	SYSCTL_V_UINT(subs, mod, parent, nbr, name, access, sym, val, descr) \
-	SYSCTL_OID(parent, nbr, name, CTLTYPE_UINT|(access), \
+	SYSCTL_OID(parent, nbr, name, CTLTYPE_UINT|CTLFLAG_MPSAFE|(access), \
 		& mod ## _0._ ## sym, val, sysctl_handle_int, "IU", descr)
 #endif
 #endif
 
 #define SYSCTL_ADD_UINT(ctx, parent, nbr, name, access, ptr, val, descr)    \
-	sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_UINT|(access),	    \
+	sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_UINT|CTLFLAG_MPSAFE|(access),	    \
 	ptr, val, sysctl_handle_int, "IU", __DESCR(descr))
 
 #define SYSCTL_XINT(parent, nbr, name, access, ptr, val, descr) \
-	SYSCTL_OID(parent, nbr, name, CTLTYPE_UINT|(access), \
+	SYSCTL_OID(parent, nbr, name, CTLTYPE_UINT|CTLFLAG_MPSAFE|(access), \
 		ptr, val, sysctl_handle_int, "IX", descr)
 
 #define SYSCTL_ADD_XINT(ctx, parent, nbr, name, access, ptr, val, descr)    \
-	sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_UINT|(access),	    \
+	sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_UINT|CTLFLAG_MPSAFE|(access),	    \
 	ptr, val, sysctl_handle_int, "IX", __DESCR(descr))
 
 /* Oid for a long.  The pointer must be non NULL. */
 #define SYSCTL_LONG(parent, nbr, name, access, ptr, val, descr) \
-	SYSCTL_OID(parent, nbr, name, CTLTYPE_LONG|(access), \
+	SYSCTL_OID(parent, nbr, name, CTLTYPE_LONG|CTLFLAG_MPSAFE|(access), \
 		ptr, val, sysctl_handle_long, "L", descr)
 
 #define SYSCTL_ADD_LONG(ctx, parent, nbr, name, access, ptr, descr)	    \
-	sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_LONG|(access),	    \
+	sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_LONG|CTLFLAG_MPSAFE|(access),	    \
 	ptr, 0, sysctl_handle_long, "L", __DESCR(descr))
 
 /* Oid for an unsigned long.  The pointer must be non NULL. */
 #define SYSCTL_ULONG(parent, nbr, name, access, ptr, val, descr) \
-	SYSCTL_OID(parent, nbr, name, CTLTYPE_ULONG|(access), \
+	SYSCTL_OID(parent, nbr, name, CTLTYPE_ULONG|CTLFLAG_MPSAFE|(access), \
 		ptr, val, sysctl_handle_long, "LU", __DESCR(descr))
 
 #define SYSCTL_ADD_ULONG(ctx, parent, nbr, name, access, ptr, descr)	    \
-	sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_ULONG|(access),	    \
+	sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_ULONG|CTLFLAG_MPSAFE|(access),	    \
 	ptr, 0, sysctl_handle_long, "LU", __DESCR(descr))
 
 #define SYSCTL_XLONG(parent, nbr, name, access, ptr, val, descr) \
-	SYSCTL_OID(parent, nbr, name, CTLTYPE_ULONG|(access), \
+	SYSCTL_OID(parent, nbr, name, CTLTYPE_ULONG|CTLFLAG_MPSAFE|(access), \
 		ptr, val, sysctl_handle_long, "LX", __DESCR(descr))
 
 #define SYSCTL_ADD_XLONG(ctx, parent, nbr, name, access, ptr, descr)	    \
-	sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_ULONG|(access),	    \
+	sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_ULONG|CTLFLAG_MPSAFE|(access),	    \
 	ptr, 0, sysctl_handle_long, "LX", __DESCR(descr))
 
 /* Oid for a quad.  The pointer must be non NULL. */
 #define SYSCTL_QUAD(parent, nbr, name, access, ptr, val, descr) \
-	SYSCTL_OID(parent, nbr, name, CTLTYPE_QUAD|(access), \
+	SYSCTL_OID(parent, nbr, name, CTLTYPE_QUAD|CTLFLAG_MPSAFE|(access), \
 		ptr, val, sysctl_handle_quad, "Q", __DESCR(descr))
 
 #define SYSCTL_ADD_QUAD(ctx, parent, nbr, name, access, ptr, descr)	    \
-	sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_QUAD|(access),	    \
+	sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_QUAD|CTLFLAG_MPSAFE|(access),	    \
 	ptr, 0, sysctl_handle_quad, "Q", __DESCR(descr))
 
 /* Oid for an opaque object.  Specified by a pointer and a length. */

Modified: head/sys/vm/vm_meter.c
==============================================================================
--- head/sys/vm/vm_meter.c	Fri Jan 23 22:46:45 2009	(r187657)
+++ head/sys/vm/vm_meter.c	Fri Jan 23 22:49:23 2009	(r187658)
@@ -90,8 +90,9 @@ sysctl_vm_loadavg(SYSCTL_HANDLER_ARGS)
 #endif
 		return SYSCTL_OUT(req, &averunnable, sizeof(averunnable));
 }
-SYSCTL_PROC(_vm, VM_LOADAVG, loadavg, CTLTYPE_STRUCT|CTLFLAG_RD, 
-    NULL, 0, sysctl_vm_loadavg, "S,loadavg", "Machine loadaverage history");
+SYSCTL_PROC(_vm, VM_LOADAVG, loadavg, CTLTYPE_STRUCT | CTLFLAG_RD |
+    CTLFLAG_MPSAFE, NULL, 0, sysctl_vm_loadavg, "S,loadavg",
+    "Machine loadaverage history");
 
 static int
 vmtotal(SYSCTL_HANDLER_ARGS)
@@ -109,7 +110,6 @@ vmtotal(SYSCTL_HANDLER_ARGS)
 	/*
 	 * Mark all objects as inactive.
 	 */
-	GIANT_REQUIRED;
 	mtx_lock(&vm_object_list_mtx);
 	TAILQ_FOREACH(object, &vm_object_list, object_list) {
 		if (!VM_OBJECT_TRYLOCK(object)) {
@@ -269,7 +269,7 @@ vcnt(SYSCTL_HANDLER_ARGS)
 	return (SYSCTL_OUT(req, &count, sizeof(int)));
 }
 
-SYSCTL_PROC(_vm, VM_TOTAL, vmtotal, CTLTYPE_OPAQUE|CTLFLAG_RD,
+SYSCTL_PROC(_vm, VM_TOTAL, vmtotal, CTLTYPE_OPAQUE|CTLFLAG_RD|CTLFLAG_MPSAFE,
     0, sizeof(struct vmtotal), vmtotal, "S,vmtotal", 
     "System virtual memory statistics");
 SYSCTL_NODE(_vm, OID_AUTO, stats, CTLFLAG_RW, 0, "VM meter stats");
@@ -279,103 +279,103 @@ static SYSCTL_NODE(_vm_stats, OID_AUTO, 
 	"VM meter vm stats");
 SYSCTL_NODE(_vm_stats, OID_AUTO, misc, CTLFLAG_RW, 0, "VM meter misc stats");
 
-SYSCTL_PROC(_vm_stats_sys, OID_AUTO, v_swtch, CTLTYPE_UINT|CTLFLAG_RD,
+SYSCTL_PROC(_vm_stats_sys, OID_AUTO, v_swtch, CTLTYPE_UINT|CTLFLAG_RD|CTLFLAG_MPSAFE,
 	&cnt.v_swtch, 0, vcnt, "IU", "Context switches");
-SYSCTL_PROC(_vm_stats_sys, OID_AUTO, v_trap, CTLTYPE_UINT|CTLFLAG_RD,
+SYSCTL_PROC(_vm_stats_sys, OID_AUTO, v_trap, CTLTYPE_UINT|CTLFLAG_RD|CTLFLAG_MPSAFE,
 	&cnt.v_trap, 0, vcnt, "IU", "Traps");
-SYSCTL_PROC(_vm_stats_sys, OID_AUTO, v_syscall, CTLTYPE_UINT|CTLFLAG_RD,
+SYSCTL_PROC(_vm_stats_sys, OID_AUTO, v_syscall, CTLTYPE_UINT|CTLFLAG_RD|CTLFLAG_MPSAFE,
 	&cnt.v_syscall, 0, vcnt, "IU", "Syscalls");
-SYSCTL_PROC(_vm_stats_sys, OID_AUTO, v_intr, CTLTYPE_UINT|CTLFLAG_RD,
+SYSCTL_PROC(_vm_stats_sys, OID_AUTO, v_intr, CTLTYPE_UINT|CTLFLAG_RD|CTLFLAG_MPSAFE,
 	&cnt.v_intr, 0, vcnt, "IU", "Hardware interrupts");
-SYSCTL_PROC(_vm_stats_sys, OID_AUTO, v_soft, CTLTYPE_UINT|CTLFLAG_RD,
+SYSCTL_PROC(_vm_stats_sys, OID_AUTO, v_soft, CTLTYPE_UINT|CTLFLAG_RD|CTLFLAG_MPSAFE,
 	&cnt.v_soft, 0, vcnt, "IU", "Software interrupts");
-SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_vm_faults, CTLTYPE_UINT|CTLFLAG_RD,
+SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_vm_faults, CTLTYPE_UINT|CTLFLAG_RD|CTLFLAG_MPSAFE,
 	&cnt.v_vm_faults, 0, vcnt, "IU", "VM faults");
-SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_cow_faults, CTLTYPE_UINT|CTLFLAG_RD,
+SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_cow_faults, CTLTYPE_UINT|CTLFLAG_RD|CTLFLAG_MPSAFE,
 	&cnt.v_cow_faults, 0, vcnt, "IU", "COW faults");
-SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_cow_optim, CTLTYPE_UINT|CTLFLAG_RD,
+SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_cow_optim, CTLTYPE_UINT|CTLFLAG_RD|CTLFLAG_MPSAFE,
 	&cnt.v_cow_optim, 0, vcnt, "IU", "Optimized COW faults");
-SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_zfod, CTLTYPE_UINT|CTLFLAG_RD,
+SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_zfod, CTLTYPE_UINT|CTLFLAG_RD|CTLFLAG_MPSAFE,
 	&cnt.v_zfod, 0, vcnt, "IU", "Zero fill");
-SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_ozfod, CTLTYPE_UINT|CTLFLAG_RD,
+SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_ozfod, CTLTYPE_UINT|CTLFLAG_RD|CTLFLAG_MPSAFE,
 	&cnt.v_ozfod, 0, vcnt, "IU", "Optimized zero fill");
-SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_swapin, CTLTYPE_UINT|CTLFLAG_RD,
+SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_swapin, CTLTYPE_UINT|CTLFLAG_RD|CTLFLAG_MPSAFE,
 	&cnt.v_swapin, 0, vcnt, "IU", "Swapin operations");
-SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_swapout, CTLTYPE_UINT|CTLFLAG_RD,
+SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_swapout, CTLTYPE_UINT|CTLFLAG_RD|CTLFLAG_MPSAFE,
 	&cnt.v_swapout, 0, vcnt, "IU", "Swapout operations");
-SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_swappgsin, CTLTYPE_UINT|CTLFLAG_RD,
+SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_swappgsin, CTLTYPE_UINT|CTLFLAG_RD|CTLFLAG_MPSAFE,
 	&cnt.v_swappgsin, 0, vcnt, "IU", "Swapin pages");
-SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_swappgsout, CTLTYPE_UINT|CTLFLAG_RD,
+SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_swappgsout, CTLTYPE_UINT|CTLFLAG_RD|CTLFLAG_MPSAFE,
 	&cnt.v_swappgsout, 0, vcnt, "IU", "Swapout pages");
-SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_vnodein, CTLTYPE_UINT|CTLFLAG_RD,
+SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_vnodein, CTLTYPE_UINT|CTLFLAG_RD|CTLFLAG_MPSAFE,
 	&cnt.v_vnodein, 0, vcnt, "IU", "Vnodein operations");
-SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_vnodeout, CTLTYPE_UINT|CTLFLAG_RD,
+SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_vnodeout, CTLTYPE_UINT|CTLFLAG_RD|CTLFLAG_MPSAFE,
 	&cnt.v_vnodeout, 0, vcnt, "IU", "Vnodeout operations");
-SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_vnodepgsin, CTLTYPE_UINT|CTLFLAG_RD,
+SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_vnodepgsin, CTLTYPE_UINT|CTLFLAG_RD|CTLFLAG_MPSAFE,
 	&cnt.v_vnodepgsin, 0, vcnt, "IU", "Vnodein pages");
-SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_vnodepgsout, CTLTYPE_UINT|CTLFLAG_RD,
+SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_vnodepgsout, CTLTYPE_UINT|CTLFLAG_RD|CTLFLAG_MPSAFE,
 	&cnt.v_vnodepgsout, 0, vcnt, "IU", "Vnodeout pages");
-SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_intrans, CTLTYPE_UINT|CTLFLAG_RD,
+SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_intrans, CTLTYPE_UINT|CTLFLAG_RD|CTLFLAG_MPSAFE,
 	&cnt.v_intrans, 0, vcnt, "IU", "In transit page blocking");
-SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_reactivated, CTLTYPE_UINT|CTLFLAG_RD,
+SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_reactivated, CTLTYPE_UINT|CTLFLAG_RD|CTLFLAG_MPSAFE,
 	&cnt.v_reactivated, 0, vcnt, "IU", "Reactivated pages");
-SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_pdwakeups, CTLTYPE_UINT|CTLFLAG_RD,
+SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_pdwakeups, CTLTYPE_UINT|CTLFLAG_RD|CTLFLAG_MPSAFE,
 	&cnt.v_pdwakeups, 0, vcnt, "IU", "Pagedaemon wakeups");
-SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_pdpages, CTLTYPE_UINT|CTLFLAG_RD,
+SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_pdpages, CTLTYPE_UINT|CTLFLAG_RD|CTLFLAG_MPSAFE,
 	&cnt.v_pdpages, 0, vcnt, "IU", "Pagedaemon page scans");
-SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_tcached, CTLTYPE_UINT|CTLFLAG_RD,
+SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_tcached, CTLTYPE_UINT|CTLFLAG_RD|CTLFLAG_MPSAFE,
 	&cnt.v_tcached, 0, vcnt, "IU", "Total pages cached");
-SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_dfree, CTLTYPE_UINT|CTLFLAG_RD,
+SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_dfree, CTLTYPE_UINT|CTLFLAG_RD|CTLFLAG_MPSAFE,
 	&cnt.v_dfree, 0, vcnt, "IU", "");
-SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_pfree, CTLTYPE_UINT|CTLFLAG_RD,
+SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_pfree, CTLTYPE_UINT|CTLFLAG_RD|CTLFLAG_MPSAFE,
 	&cnt.v_pfree, 0, vcnt, "IU", "");
-SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_tfree, CTLTYPE_UINT|CTLFLAG_RD,
+SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_tfree, CTLTYPE_UINT|CTLFLAG_RD|CTLFLAG_MPSAFE,
 	&cnt.v_tfree, 0, vcnt, "IU", "");
-SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_page_size, CTLTYPE_UINT|CTLFLAG_RD,
+SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_page_size, CTLTYPE_UINT|CTLFLAG_RD|CTLFLAG_MPSAFE,
 	&cnt.v_page_size, 0, vcnt, "IU", "");
-SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_page_count, CTLTYPE_UINT|CTLFLAG_RD,
+SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_page_count, CTLTYPE_UINT|CTLFLAG_RD|CTLFLAG_MPSAFE,
 	&cnt.v_page_count, 0, vcnt, "IU", "");
-SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_free_reserved, CTLTYPE_UINT|CTLFLAG_RD,
+SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_free_reserved, CTLTYPE_UINT|CTLFLAG_RD|CTLFLAG_MPSAFE,
 	&cnt.v_free_reserved, 0, vcnt, "IU", "");
-SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_free_target, CTLTYPE_UINT|CTLFLAG_RD,
+SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_free_target, CTLTYPE_UINT|CTLFLAG_RD|CTLFLAG_MPSAFE,
 	&cnt.v_free_target, 0, vcnt, "IU", "");
-SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_free_min, CTLTYPE_UINT|CTLFLAG_RD,
+SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_free_min, CTLTYPE_UINT|CTLFLAG_RD|CTLFLAG_MPSAFE,
 	&cnt.v_free_min, 0, vcnt, "IU", "");
-SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_free_count, CTLTYPE_UINT|CTLFLAG_RD,
+SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_free_count, CTLTYPE_UINT|CTLFLAG_RD|CTLFLAG_MPSAFE,
 	&cnt.v_free_count, 0, vcnt, "IU", "");
-SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_wire_count, CTLTYPE_UINT|CTLFLAG_RD,
+SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_wire_count, CTLTYPE_UINT|CTLFLAG_RD|CTLFLAG_MPSAFE,
 	&cnt.v_wire_count, 0, vcnt, "IU", "");
-SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_active_count, CTLTYPE_UINT|CTLFLAG_RD,
+SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_active_count, CTLTYPE_UINT|CTLFLAG_RD|CTLFLAG_MPSAFE,
 	&cnt.v_active_count, 0, vcnt, "IU", "");
-SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_inactive_target, CTLTYPE_UINT|CTLFLAG_RD,
+SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_inactive_target, CTLTYPE_UINT|CTLFLAG_RD|CTLFLAG_MPSAFE,
 	&cnt.v_inactive_target, 0, vcnt, "IU", "");
-SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_inactive_count, CTLTYPE_UINT|CTLFLAG_RD,
+SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_inactive_count, CTLTYPE_UINT|CTLFLAG_RD|CTLFLAG_MPSAFE,
 	&cnt.v_inactive_count, 0, vcnt, "IU", "");
-SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_cache_count, CTLTYPE_UINT|CTLFLAG_RD,
+SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_cache_count, CTLTYPE_UINT|CTLFLAG_RD|CTLFLAG_MPSAFE,
 	&cnt.v_cache_count, 0, vcnt, "IU", "");
-SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_cache_min, CTLTYPE_UINT|CTLFLAG_RD,
+SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_cache_min, CTLTYPE_UINT|CTLFLAG_RD|CTLFLAG_MPSAFE,
 	&cnt.v_cache_min, 0, vcnt, "IU", "");
-SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_cache_max, CTLTYPE_UINT|CTLFLAG_RD,
+SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_cache_max, CTLTYPE_UINT|CTLFLAG_RD|CTLFLAG_MPSAFE,
 	&cnt.v_cache_max, 0, vcnt, "IU", "");
-SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_pageout_free_min, CTLTYPE_UINT|CTLFLAG_RD,
+SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_pageout_free_min, CTLTYPE_UINT|CTLFLAG_RD|CTLFLAG_MPSAFE,
 	&cnt.v_pageout_free_min, 0, vcnt, "IU", "");
-SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_interrupt_free_min, CTLTYPE_UINT|CTLFLAG_RD,
+SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_interrupt_free_min, CTLTYPE_UINT|CTLFLAG_RD|CTLFLAG_MPSAFE,
 	&cnt.v_interrupt_free_min, 0, vcnt, "IU", "");
-SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_forks, CTLTYPE_UINT|CTLFLAG_RD,
+SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_forks, CTLTYPE_UINT|CTLFLAG_RD|CTLFLAG_MPSAFE,
 	&cnt.v_forks, 0, vcnt, "IU", "Number of fork() calls");
-SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_vforks, CTLTYPE_UINT|CTLFLAG_RD,
+SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_vforks, CTLTYPE_UINT|CTLFLAG_RD|CTLFLAG_MPSAFE,
 	&cnt.v_vforks, 0, vcnt, "IU", "Number of vfork() calls");
-SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_rforks, CTLTYPE_UINT|CTLFLAG_RD,
+SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_rforks, CTLTYPE_UINT|CTLFLAG_RD|CTLFLAG_MPSAFE,
 	&cnt.v_rforks, 0, vcnt, "IU", "Number of rfork() calls");
-SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_kthreads, CTLTYPE_UINT|CTLFLAG_RD,
+SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_kthreads, CTLTYPE_UINT|CTLFLAG_RD|CTLFLAG_MPSAFE,
 	&cnt.v_kthreads, 0, vcnt, "IU", "Number of fork() calls by kernel");
-SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_forkpages, CTLTYPE_UINT|CTLFLAG_RD,
+SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_forkpages, CTLTYPE_UINT|CTLFLAG_RD|CTLFLAG_MPSAFE,
 	&cnt.v_forkpages, 0, vcnt, "IU", "VM pages affected by fork()");
-SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_vforkpages, CTLTYPE_UINT|CTLFLAG_RD,
+SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_vforkpages, CTLTYPE_UINT|CTLFLAG_RD|CTLFLAG_MPSAFE,
 	&cnt.v_vforkpages, 0, vcnt, "IU", "VM pages affected by vfork()");
-SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_rforkpages, CTLTYPE_UINT|CTLFLAG_RD,
+SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_rforkpages, CTLTYPE_UINT|CTLFLAG_RD|CTLFLAG_MPSAFE,
 	&cnt.v_rforkpages, 0, vcnt, "IU", "VM pages affected by rfork()");
-SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_kthreadpages, CTLTYPE_UINT|CTLFLAG_RD,
+SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_kthreadpages, CTLTYPE_UINT|CTLFLAG_RD|CTLFLAG_MPSAFE,
 	&cnt.v_kthreadpages, 0, vcnt, "IU", "VM pages affected by fork() by kernel");
 
 SYSCTL_INT(_vm_stats_misc, OID_AUTO,

From owner-svn-src-head@FreeBSD.ORG  Sat Jan 24 01:46:48 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 42AFD106564A;
	Sat, 24 Jan 2009 01:46:47 +0000 (UTC)
	(envelope-from trhodes@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 30FF98FC18;
	Sat, 24 Jan 2009 01:46:47 +0000 (UTC)
	(envelope-from trhodes@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0O1kkKN059727;
	Sat, 24 Jan 2009 01:46:46 GMT (envelope-from trhodes@svn.freebsd.org)
Received: (from trhodes@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0O1kkoZ059726;
	Sat, 24 Jan 2009 01:46:46 GMT (envelope-from trhodes@svn.freebsd.org)
Message-Id: <200901240146.n0O1kkoZ059726@svn.freebsd.org>
From: Tom Rhodes 
Date: Sat, 24 Jan 2009 01:46:46 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r187661 - head/share/man/man7
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 24 Jan 2009 01:46:48 -0000

Author: trhodes
Date: Sat Jan 24 01:46:46 2009
New Revision: 187661
URL: http://svn.freebsd.org/changeset/base/187661

Log:
  Add a comment on kern.ipc.maxpipekva.
  
  PR:		105997
  Reviewed by:	keramida

Modified:
  head/share/man/man7/tuning.7

Modified: head/share/man/man7/tuning.7
==============================================================================
--- head/share/man/man7/tuning.7	Sat Jan 24 01:34:22 2009	(r187660)
+++ head/share/man/man7/tuning.7	Sat Jan 24 01:46:46 2009	(r187661)
@@ -23,7 +23,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 19, 2007
+.Dd January 23, 2009
 .Dt TUNING 7
 .Os
 .Sh NAME
@@ -402,6 +402,16 @@ In this document we will only cover the 
 on the system.
 .Pp
 The
+.Va kern.ipc.maxpipekva
+loader tunable is used to set a hard limit on the amount of pageable
+address space available.
+This value is auto tuned by the system, but may require manual tuning
+in a few rare cases.
+Increasing this value to a higher setting, such as `25165824' might
+improve performance on systems where pageable address space is
+quickly exhausted.
+.Pp
+The
 .Va kern.ipc.shm_use_phys
 sysctl defaults to 0 (off) and may be set to 0 (off) or 1 (on).
 Setting

From owner-svn-src-head@FreeBSD.ORG  Sat Jan 24 04:08:00 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7A430106566B;
	Sat, 24 Jan 2009 04:08:00 +0000 (UTC)
	(envelope-from trhodes@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 685E78FC20;
	Sat, 24 Jan 2009 04:08:00 +0000 (UTC)
	(envelope-from trhodes@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0O480Jw062582;
	Sat, 24 Jan 2009 04:08:00 GMT (envelope-from trhodes@svn.freebsd.org)
Received: (from trhodes@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0O480e5062580;
	Sat, 24 Jan 2009 04:08:00 GMT (envelope-from trhodes@svn.freebsd.org)
Message-Id: <200901240408.n0O480e5062580@svn.freebsd.org>
From: Tom Rhodes 
Date: Sat, 24 Jan 2009 04:08:00 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r187662 - head/share/man/man4
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 24 Jan 2009 04:08:00 -0000

Author: trhodes
Date: Sat Jan 24 04:08:00 2009
New Revision: 187662
URL: http://svn.freebsd.org/changeset/base/187662

Log:
  Update the supported device list a little bit.
  
  PR:		84538
  Submitted by:	asmodai

Modified:
  head/share/man/man4/nge.4
  head/share/man/man4/sk.4

Modified: head/share/man/man4/nge.4
==============================================================================
--- head/share/man/man4/nge.4	Sat Jan 24 01:46:46 2009	(r187661)
+++ head/share/man/man4/nge.4	Sat Jan 24 04:08:00 2009	(r187662)
@@ -31,7 +31,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 14, 2006
+.Dd January 23, 2009
 .Dt NGE 4
 .Os
 .Sh NAME
@@ -170,6 +170,8 @@ Asante FriendlyNet GigaNIX 1000TA and 10
 .It
 D-Link DGE-500T
 .It
+Linksys EG1032, revision 1
+.It
 Netgear GA621
 .It
 Netgear GA622T

Modified: head/share/man/man4/sk.4
==============================================================================
--- head/share/man/man4/sk.4	Sat Jan 24 01:46:46 2009	(r187661)
+++ head/share/man/man4/sk.4	Sat Jan 24 04:08:00 2009	(r187662)
@@ -30,7 +30,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd February 14, 2008
+.Dd January 23, 2009
 .Dt SK 4
 .Os
 .Sh NAME
@@ -82,7 +82,7 @@ second port on dual port adapters for fa
 on the primary port fails, the SysKonnect driver will automatically
 switch traffic onto the second port.
 .Pp
-Also supported is the Marvell Semiconductor 88E1000* gigabit PHY.
+Also supported is the Marvell Semiconductor 88E100* gigabit PHY.
 .Pp
 The XaQti XMAC II supports full and half duplex operation with
 autonegotiation.
@@ -173,7 +173,7 @@ Belkin F5D5005 single port, 1000baseT ad
 .It
 D-Link DGE-530T single port, 1000baseT adapter
 .It
-Linksys EG1032 single port, 1000baseT adapter
+Linksys (revision 2) single port, 1000baseT adapter
 .It
 SK-9521 SK-NET GE-T single port, 1000baseT adapter
 .It

From owner-svn-src-head@FreeBSD.ORG  Sat Jan 24 05:32:11 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 825CC1065676;
	Sat, 24 Jan 2009 05:32:11 +0000 (UTC)
	(envelope-from trhodes@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 707C08FC23;
	Sat, 24 Jan 2009 05:32:11 +0000 (UTC)
	(envelope-from trhodes@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0O5WBgD064087;
	Sat, 24 Jan 2009 05:32:11 GMT (envelope-from trhodes@svn.freebsd.org)
Received: (from trhodes@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0O5WBjf064086;
	Sat, 24 Jan 2009 05:32:11 GMT (envelope-from trhodes@svn.freebsd.org)
Message-Id: <200901240532.n0O5WBjf064086@svn.freebsd.org>
From: Tom Rhodes 
Date: Sat, 24 Jan 2009 05:32:11 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r187663 - head/usr.bin/split
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 24 Jan 2009 05:32:12 -0000

Author: trhodes
Date: Sat Jan 24 05:32:11 2009
New Revision: 187663
URL: http://svn.freebsd.org/changeset/base/187663

Log:
  When "-b" is specified, one could easily create "smaller" files
  that are much larger than expected (given the default size).
  Change "smaller files" to "split files" which is more in line
  with what "-b" actually does.
  
  PR:		119329
  Submitted by:	Julian Stacey 

Modified:
  head/usr.bin/split/split.1

Modified: head/usr.bin/split/split.1
==============================================================================
--- head/usr.bin/split/split.1	Sat Jan 24 04:08:00 2009	(r187662)
+++ head/usr.bin/split/split.1	Sat Jan 24 05:32:11 2009	(r187663)
@@ -32,7 +32,7 @@
 .\"	@(#)split.1	8.3 (Berkeley) 4/16/94
 .\" $FreeBSD$
 .\"
-.Dd March 16, 2008
+.Dd January 23, 2009
 .Dt SPLIT 1
 .Os
 .Sh NAME
@@ -88,7 +88,7 @@ letters to form the suffix of the file n
 .Cm K | k | M | m | G | g
 .Sm on
 .Oc
-Create smaller files
+Create split files
 .Ar byte_count
 bytes in length.
 If
@@ -113,7 +113,7 @@ is appended to the number, the file is s
 .Ar byte_count
 gigabyte pieces.
 .It Fl l Ar line_count
-Create smaller files
+Create split files
 .Ar line_count
 lines in length.
 .It Fl n Ar chunk_count

From owner-svn-src-head@FreeBSD.ORG  Sat Jan 24 10:22:50 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 099BB1065688;
	Sat, 24 Jan 2009 10:22:50 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id EBC7A8FC21;
	Sat, 24 Jan 2009 10:22:49 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0OAMnPB069234;
	Sat, 24 Jan 2009 10:22:49 GMT (envelope-from rwatson@svn.freebsd.org)
Received: (from rwatson@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0OAMntu069233;
	Sat, 24 Jan 2009 10:22:49 GMT (envelope-from rwatson@svn.freebsd.org)
Message-Id: <200901241022.n0OAMntu069233@svn.freebsd.org>
From: Robert Watson 
Date: Sat, 24 Jan 2009 10:22:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r187664 - head/sys/kern
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 24 Jan 2009 10:22:51 -0000

Author: rwatson
Date: Sat Jan 24 10:22:49 2009
New Revision: 187664
URL: http://svn.freebsd.org/changeset/base/187664

Log:
  Add explicit static DTrace tracing to the callout mechanism, capturing
  pointers to the callout handler just before and just after the callout
  it invoked.  I attempted to do this in a manner congruent to tracing in
  Solaris's callout mechanism, but couldn't quite use the same names due
  to convention and syntax differences.
  
  Example DTrace script to generate a distribution graph of callout
  execution times:
  
  callout_execute:::callout_start
  {
          self->cstart = timestamp;
  }
  
  callout_execute:::callout_end
  {
  
          @length = quantize(timestamp - self->cstart);
  }
  
  Reviewed by:	jb
  MFC after:	3 days

Modified:
  head/sys/kern/kern_timeout.c

Modified: head/sys/kern/kern_timeout.c
==============================================================================
--- head/sys/kern/kern_timeout.c	Sat Jan 24 05:32:11 2009	(r187663)
+++ head/sys/kern/kern_timeout.c	Sat Jan 24 10:22:49 2009	(r187664)
@@ -37,6 +37,8 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include "opt_kdtrace.h"
+
 #include 
 #include 
 #include 
@@ -49,10 +51,19 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
 
+SDT_PROVIDER_DEFINE(callout_execute);
+SDT_PROBE_DEFINE(callout_execute, kernel, , callout_start);
+SDT_PROBE_ARGTYPE(callout_execute, kernel, , callout_start, 0,
+    "struct callout *");
+SDT_PROBE_DEFINE(callout_execute, kernel, , callout_end); 
+SDT_PROBE_ARGTYPE(callout_execute, kernel, , callout_end, 0,
+    "struct callout *");
+
 static int avg_depth;
 SYSCTL_INT(_debug, OID_AUTO, to_avg_depth, CTLFLAG_RD, &avg_depth, 0,
     "Average number of items examined per softclock call. Units = 1/1000");
@@ -395,7 +406,11 @@ softclock(void *arg)
 				binuptime(&bt1);
 #endif
 				THREAD_NO_SLEEPING();
+				SDT_PROBE(callout_execute, kernel, ,
+				    callout_start, c, 0, 0, 0, 0);
 				c_func(c_arg);
+				SDT_PROBE(callout_execute, kernel, ,
+				    callout_end, c, 0, 0, 0, 0);
 				THREAD_SLEEPING_OK();
 #ifdef DIAGNOSTIC
 				binuptime(&bt2);

From owner-svn-src-head@FreeBSD.ORG  Sat Jan 24 10:30:25 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BAF1B106574B;
	Sat, 24 Jan 2009 10:30:25 +0000 (UTC)
	(envelope-from kris@FreeBSD.org)
Received: from dhcp-172-28-77-65.eur.corp.google.com (freefall.freebsd.org
	[IPv6:2001:4f8:fff6::28])
	by mx1.freebsd.org (Postfix) with ESMTP id 0ACF58FC0C;
	Sat, 24 Jan 2009 10:30:23 +0000 (UTC)
	(envelope-from kris@FreeBSD.org)
Message-ID: <497AEDBD.20603@FreeBSD.org>
Date: Sat, 24 Jan 2009 10:30:21 +0000
From: Kris Kennaway 
User-Agent: Thunderbird 2.0.0.19 (Macintosh/20081209)
MIME-Version: 1.0
To: Roman Divacky 
References: <200901201715.n0KHFCfw051198@svn.freebsd.org>
	<20090120171803.GA37717@freebsd.org>
In-Reply-To: <20090120171803.GA37717@freebsd.org>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r187475 - head/usr.bin/make
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 24 Jan 2009 10:30:26 -0000

Roman Divacky wrote:
> On Tue, Jan 20, 2009 at 05:15:12PM +0000, Roman Divacky wrote:
>> Author: rdivacky
>> Date: Tue Jan 20 17:15:12 2009
>> New Revision: 187475
>> URL: http://svn.freebsd.org/changeset/base/187475
>>
>> Log:
>>   Remove inlining of functions that are used mostly in different object files.
>>   This gets rid of gnu89 style inlining. Also silence gcc by assigning two
>>   variables NULL. This lets use to remove NO_WERROR.
> 
> does anyone know of some Makefile that is cpu intensive and not io bound?
> it might make sense to turn on -finline-functions in make but it would
> be nice to be able to measure the speedup (if any)...
> 
> do we have some funny stuff written bsd make ? (computation of PI or
> something like that)

Look at the /usr/ports/Tools/portbuild/scripts/makeparallel script. 
This generates an enormous makefile from a port INDEX, and parsing it 
takes some time.  Rerunning this with the makefile in cache might be a 
test case for make(1) performance.

Kris

From owner-svn-src-head@FreeBSD.ORG  Sat Jan 24 10:57:32 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7EFC0106566B;
	Sat, 24 Jan 2009 10:57:32 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 519F98FC17;
	Sat, 24 Jan 2009 10:57:32 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0OAvW0j069922;
	Sat, 24 Jan 2009 10:57:32 GMT (envelope-from rwatson@svn.freebsd.org)
Received: (from rwatson@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0OAvWC8069921;
	Sat, 24 Jan 2009 10:57:32 GMT (envelope-from rwatson@svn.freebsd.org)
Message-Id: <200901241057.n0OAvWC8069921@svn.freebsd.org>
From: Robert Watson 
Date: Sat, 24 Jan 2009 10:57:32 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r187666 - head/sys/security/mac
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 24 Jan 2009 10:57:33 -0000

Author: rwatson
Date: Sat Jan 24 10:57:32 2009
New Revision: 187666
URL: http://svn.freebsd.org/changeset/base/187666

Log:
  Begin to add SDT tracing of the MAC Framework: add policy modevent,
  register, and unregister hooks that give access to the mac_policy_conf
  for the policy.
  
  Obtained from:	TrustedBSD Project
  MFC after:	3 days

Modified:
  head/sys/security/mac/mac_framework.c

Modified: head/sys/security/mac/mac_framework.c
==============================================================================
--- head/sys/security/mac/mac_framework.c	Sat Jan 24 10:53:45 2009	(r187665)
+++ head/sys/security/mac/mac_framework.c	Sat Jan 24 10:57:32 2009	(r187666)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 1999-2002, 2006 Robert N. M. Watson
+ * Copyright (c) 1999-2002, 2006, 2009 Robert N. M. Watson
  * Copyright (c) 2001 Ilmar S. Habibulin
  * Copyright (c) 2001-2005 Networks Associates Technology, Inc.
  * Copyright (c) 2005-2006 SPARTA, Inc.
@@ -63,6 +63,7 @@
  * src/sys/security/mac_*.
  */
 
+#include "opt_kdtrace.h"
 #include "opt_mac.h"
 
 #include 
@@ -75,6 +76,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -83,6 +85,24 @@ __FBSDID("$FreeBSD$");
 #include 
 
 /*
+ * DTrace SDT provider for MAC.
+ */
+SDT_PROVIDER_DEFINE(mac);
+
+SDT_PROBE_DEFINE(mac, kernel, policy, modevent);
+SDT_PROBE_ARGTYPE(mac, kernel, policy, modevent, 0, "int");
+SDT_PROBE_ARGTYPE(mac, kernel, policy, modevent, 1,
+    "struct mac_policy_conf *mpc");
+
+SDT_PROBE_DEFINE(mac, kernel, policy, register);
+SDT_PROBE_ARGTYPE(mac, kernel, policy, register, 0,
+    "struct mac_policy_conf *");
+
+SDT_PROBE_DEFINE(mac, kernel, policy, unregister);
+SDT_PROBE_ARGTYPE(mac, kernel, policy, unregister, 0,
+    "struct mac_policy_conf *");
+
+/*
  * Root sysctl node for all MAC and MAC policy controls.
  */
 SYSCTL_NODE(_security, OID_AUTO, mac, CTLFLAG_RW, 0,
@@ -458,6 +478,7 @@ mac_policy_register(struct mac_policy_co
 		(*(mpc->mpc_ops->mpo_init))(mpc);
 	mac_policy_updateflags();
 
+	SDT_PROBE(mac, kernel, policy, register, mpc, 0, 0, 0, 0);
 	printf("Security policy loaded: %s (%s)\n", mpc->mpc_fullname,
 	    mpc->mpc_name);
 
@@ -505,6 +526,7 @@ mac_policy_unregister(struct mac_policy_
 
 	mac_policy_release_exclusive();
 
+	SDT_PROBE(mac, kernel, policy, unregister, mpc, 0, 0, 0, 0);
 	printf("Security policy unload: %s (%s)\n", mpc->mpc_fullname,
 	    mpc->mpc_name);
 
@@ -530,6 +552,7 @@ mac_policy_modevent(module_t mod, int ty
 	}
 #endif
 
+	SDT_PROBE(mac, kernel, policy, modevent, type, mpc, 0, 0, 0);
 	switch (type) {
 	case MOD_LOAD:
 		if (mpc->mpc_loadtime_flags & MPC_LOADTIME_FLAG_NOTLATE &&

From owner-svn-src-head@FreeBSD.ORG  Sat Jan 24 13:15:46 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 32EC1106564A;
	Sat, 24 Jan 2009 13:15:46 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1F2FF8FC0C;
	Sat, 24 Jan 2009 13:15:46 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0ODFkAd089748;
	Sat, 24 Jan 2009 13:15:46 GMT (envelope-from rwatson@svn.freebsd.org)
Received: (from rwatson@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0ODFjIa089746;
	Sat, 24 Jan 2009 13:15:45 GMT (envelope-from rwatson@svn.freebsd.org)
Message-Id: <200901241315.n0ODFjIa089746@svn.freebsd.org>
From: Robert Watson 
Date: Sat, 24 Jan 2009 13:15:45 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r187667 - head/sys/security/mac
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 24 Jan 2009 13:15:46 -0000

Author: rwatson
Date: Sat Jan 24 13:15:45 2009
New Revision: 187667
URL: http://svn.freebsd.org/changeset/base/187667

Log:
  Use __FBSDID() for $FreeBSD$ version strings in .c files.
  
  Obtained from:	TrustedBSD Project
  MFC after:	3 days

Modified:
  head/sys/security/mac/mac_audit.c
  head/sys/security/mac/mac_priv.c

Modified: head/sys/security/mac/mac_audit.c
==============================================================================
--- head/sys/security/mac/mac_audit.c	Sat Jan 24 10:57:32 2009	(r187666)
+++ head/sys/security/mac/mac_audit.c	Sat Jan 24 13:15:45 2009	(r187667)
@@ -35,10 +35,11 @@
  * 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$
  */
 
+#include 
+__FBSDID("$FreeBSD$");
+
 #include 
 #include 
 #include 

Modified: head/sys/security/mac/mac_priv.c
==============================================================================
--- head/sys/security/mac/mac_priv.c	Sat Jan 24 10:57:32 2009	(r187666)
+++ head/sys/security/mac/mac_priv.c	Sat Jan 24 13:15:45 2009	(r187667)
@@ -25,14 +25,15 @@
  * 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$
  */
 
 /*
  * MAC checks for system privileges.
  */
 
+#include "sys/cdefs.h"
+__FBSDID("$FreeBSD$");
+
 #include "opt_mac.h"
 
 #include 

From owner-svn-src-head@FreeBSD.ORG  Sat Jan 24 14:25:33 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3E8291065670;
	Sat, 24 Jan 2009 14:25:33 +0000 (UTC)
	(envelope-from kostikbel@gmail.com)
Received: from mail.terabit.net.ua (mail.terabit.net.ua [195.137.202.147])
	by mx1.freebsd.org (Postfix) with ESMTP id D424B8FC19;
	Sat, 24 Jan 2009 14:25:32 +0000 (UTC)
	(envelope-from kostikbel@gmail.com)
Received: from skuns.zoral.com.ua ([91.193.166.194] helo=mail.zoral.com.ua)
	by mail.terabit.net.ua with esmtps (TLSv1:AES256-SHA:256)
	(Exim 4.63 (FreeBSD)) (envelope-from )
	id 1LQjNd-0002VG-Ap; Sat, 24 Jan 2009 16:21:01 +0200
Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua
	[10.1.1.148])
	by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id n0ODhlQh033737
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Sat, 24 Jan 2009 15:43:47 +0200 (EET)
	(envelope-from kostikbel@gmail.com)
Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1])
	by deviant.kiev.zoral.com.ua (8.14.3/8.14.3) with ESMTP id
	n0ODhlBh008329; Sat, 24 Jan 2009 15:43:47 +0200 (EET)
	(envelope-from kostikbel@gmail.com)
Received: (from kostik@localhost)
	by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id n0ODhlaY008328; 
	Sat, 24 Jan 2009 15:43:47 +0200 (EET)
	(envelope-from kostikbel@gmail.com)
X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to
	kostikbel@gmail.com using -f
Date: Sat, 24 Jan 2009 15:43:47 +0200
From: Kostik Belousov 
To: Tom Rhodes 
Message-ID: <20090124134347.GC6834@deviant.kiev.zoral.com.ua>
References: <200901240146.n0O1kkoZ059726@svn.freebsd.org>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="4jXrM3lyYWu4nBt5"
Content-Disposition: inline
In-Reply-To: <200901240146.n0O1kkoZ059726@svn.freebsd.org>
User-Agent: Mutt/1.4.2.3i
X-Virus-Scanned: ClamAV version 0.94.2,
	clamav-milter version 0.94.2 on skuns.kiev.zoral.com.ua
X-Virus-Status: Clean
X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00
	autolearn=ham version=3.2.5
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on
	skuns.kiev.zoral.com.ua
X-Virus-Scanned: mail.terabit.net.ua 1LQjNd-0002VG-Ap
	04b2150e04b0429c89c2ea7a7ee5799a
X-Terabit: YES
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r187661 - head/share/man/man7
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 24 Jan 2009 14:25:33 -0000


--4jXrM3lyYWu4nBt5
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sat, Jan 24, 2009 at 01:46:46AM +0000, Tom Rhodes wrote:
> Author: trhodes
> Date: Sat Jan 24 01:46:46 2009
> New Revision: 187661
> URL: http://svn.freebsd.org/changeset/base/187661
>=20
> Log:
>   Add a comment on kern.ipc.maxpipekva.
>  =20
>   PR:		105997
>   Reviewed by:	keramida
>=20
> Modified:
>   head/share/man/man7/tuning.7
>=20
> Modified: head/share/man/man7/tuning.7
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/share/man/man7/tuning.7	Sat Jan 24 01:34:22 2009	(r187660)
> +++ head/share/man/man7/tuning.7	Sat Jan 24 01:46:46 2009	(r187661)
> @@ -23,7 +23,7 @@
>  .\"
>  .\" $FreeBSD$
>  .\"
> -.Dd November 19, 2007
> +.Dd January 23, 2009
>  .Dt TUNING 7
>  .Os
>  .Sh NAME
> @@ -402,6 +402,16 @@ In this document we will only cover the=20
>  on the system.
>  .Pp
>  The
> +.Va kern.ipc.maxpipekva
> +loader tunable is used to set a hard limit on the amount of pageable
> +address space available.
The formulation is very misleading. This is *the* KVA for pipe buffers
mappings, not *a* pageable KVA.
> +This value is auto tuned by the system, but may require manual tuning
> +in a few rare cases.
> +Increasing this value to a higher setting, such as `25165824' might
> +improve performance on systems where pageable address space is
> +quickly exhausted.
Again, the space for mapping of the pipe buffers. Also, you should note
that exhausting of the space is not fatal, and cause pipes to fall back
to double-copy.

> +.Pp
> +The
>  .Va kern.ipc.shm_use_phys
>  sysctl defaults to 0 (off) and may be set to 0 (off) or 1 (on).
>  Setting

--4jXrM3lyYWu4nBt5
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (FreeBSD)

iEYEARECAAYFAkl7GxMACgkQC3+MBN1Mb4ibhQCgiPu4r80BcBhsG4/ut3qCyze9
QT4An0wIBs/DfN28FxuxgTerNDXU1tZf
=Jixi
-----END PGP SIGNATURE-----

--4jXrM3lyYWu4nBt5--

From owner-svn-src-head@FreeBSD.ORG  Sat Jan 24 15:33:09 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 996CA106566C;
	Sat, 24 Jan 2009 15:33:09 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 6DA108FC23;
	Sat, 24 Jan 2009 15:33:09 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0OFX9w3092166;
	Sat, 24 Jan 2009 15:33:09 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0OFX95R092165;
	Sat, 24 Jan 2009 15:33:09 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <200901241533.n0OFX95R092165@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Sat, 24 Jan 2009 15:33:09 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r187668 - head/share/man/man5
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 24 Jan 2009 15:33:10 -0000

Author: bz
Date: Sat Jan 24 15:33:09 2009
New Revision: 187668
URL: http://svn.freebsd.org/changeset/base/187668

Log:
  Change IP addresses/prefixes to be from "Test-Net" (IPv4 documentation
  prefix 192.0.2.0/24) rather than from private-use networks.
  
  MFC after:	1 week

Modified:
  head/share/man/man5/rc.conf.5

Modified: head/share/man/man5/rc.conf.5
==============================================================================
--- head/share/man/man5/rc.conf.5	Sat Jan 24 13:15:45 2009	(r187667)
+++ head/share/man/man5/rc.conf.5	Sat Jan 24 15:33:09 2009	(r187668)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 9, 2009
+.Dd January 24, 2009
 .Dt RC.CONF 5
 .Os
 .Sh NAME
@@ -1089,9 +1089,9 @@ One can configure more than one IPv4 add
 variable.
 One or more IP addresses must be provided in Classless Inter-Domain
 Routing (CIDR) address notation, whose last byte can be a range like
-192.168.0.5-23/24.
-In this case the address 192.168.0.5 will be configured with the
-netmask /24 and the addresses 192.168.0.6 to 192.168.0.23 with
+192.0.2.5-23/24.
+In this case the address 192.0.2.5 will be configured with the
+netmask /24 and the addresses 192.0.2.6 to 192.0.2.23 with
 the non-conflicting netmask /32 as explained in the
 .Xr ifconfig 8
 alias section.
@@ -1099,7 +1099,7 @@ With the interface in question being
 .Li ed0 ,
 an example could look like:
 .Bd -literal
-ipv4_addrs_ed0="192.168.0.1/24 192.168.1.1-5/28"
+ipv4_addrs_ed0="192.0.2.129/27 192.0.2.1-5/28"
 .Ed
 .Pp
 It is also possible to add IP alias entries using
@@ -1233,7 +1233,7 @@ variable.
 It is also possible to rename interface by doing:
 .Bd -literal
 ifconfig_ed0_name="net0"
-ifconfig_net0="inet 10.0.0.1 netmask 0xffff0000"
+ifconfig_net0="inet 192.0.2.1 netmask 0xffffff00"
 .Ed
 .It Va ipv6_network_interfaces
 .Pq Vt str
@@ -3309,7 +3309,7 @@ Assuming that the jail in question was n
 you would have the following dependent variables:
 .Bd -literal
 jail_vjail_hostname="jail.example.com"
-jail_vjail_ip="192.168.1.100"
+jail_vjail_ip="192.0.2.100"
 jail_vjail_rootdir="/var/jails/vjail/root"
 .Ed
 .Pp

From owner-svn-src-head@FreeBSD.ORG  Sat Jan 24 15:53:37 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A2D3F106564A;
	Sat, 24 Jan 2009 15:53:37 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9100C8FC16;
	Sat, 24 Jan 2009 15:53:37 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0OFrbVS092530;
	Sat, 24 Jan 2009 15:53:37 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0OFrbWM092529;
	Sat, 24 Jan 2009 15:53:37 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <200901241553.n0OFrbWM092529@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Sat, 24 Jan 2009 15:53:37 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r187669 - head/usr.sbin/jail
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 24 Jan 2009 15:53:38 -0000

Author: bz
Date: Sat Jan 24 15:53:37 2009
New Revision: 187669
URL: http://svn.freebsd.org/changeset/base/187669

Log:
  Update the description of the '-h' option wrt to primary addresses
  per address family and add a reference to the ip-addresses option.
  
  MFC after:	1 week

Modified:
  head/usr.sbin/jail/jail.8

Modified: head/usr.sbin/jail/jail.8
==============================================================================
--- head/usr.sbin/jail/jail.8	Sat Jan 24 15:33:09 2009	(r187668)
+++ head/usr.sbin/jail/jail.8	Sat Jan 24 15:53:37 2009	(r187669)
@@ -33,7 +33,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 11, 2009
+.Dd January 24, 2009
 .Dt JAIL 8
 .Os
 .Sh NAME
@@ -63,9 +63,10 @@ to the list of
 for this prison.
 This may affect default address selection for outgoing IPv4 connections
 of prisons.
-The address first returned by the resolver for the IPv4 address family
-will be used as default.
-For IPv6 source address selection is done by a well defined algorithm.
+The address first returned by the resolver for each address family
+will be used as primary address. See
+.Va ip-addresses
+further down for details.
 .It Fl i
 Output the jail identifier of the newly created jail.
 .It Fl n Ar jailname

From owner-svn-src-head@FreeBSD.ORG  Sat Jan 24 15:56:44 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AA684106566B;
	Sat, 24 Jan 2009 15:56:44 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 98F9A8FC1A;
	Sat, 24 Jan 2009 15:56:44 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0OFuikv092640;
	Sat, 24 Jan 2009 15:56:44 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0OFui7o092639;
	Sat, 24 Jan 2009 15:56:44 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <200901241556.n0OFui7o092639@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Sat, 24 Jan 2009 15:56:44 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r187670 - head/usr.sbin/jail
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 24 Jan 2009 15:56:45 -0000

Author: bz
Date: Sat Jan 24 15:56:44 2009
New Revision: 187670
URL: http://svn.freebsd.org/changeset/base/187670

Log:
  New sentence starts on a new line.
  
  MFC after:	2 week

Modified:
  head/usr.sbin/jail/jail.8

Modified: head/usr.sbin/jail/jail.8
==============================================================================
--- head/usr.sbin/jail/jail.8	Sat Jan 24 15:53:37 2009	(r187669)
+++ head/usr.sbin/jail/jail.8	Sat Jan 24 15:56:44 2009	(r187670)
@@ -64,7 +64,8 @@ for this prison.
 This may affect default address selection for outgoing IPv4 connections
 of prisons.
 The address first returned by the resolver for each address family
-will be used as primary address. See
+will be used as primary address.
+See
 .Va ip-addresses
 further down for details.
 .It Fl i

From owner-svn-src-head@FreeBSD.ORG  Sat Jan 24 18:20:16 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1B79E106566B;
	Sat, 24 Jan 2009 18:20:16 +0000 (UTC) (envelope-from ed@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0A51A8FC0A;
	Sat, 24 Jan 2009 18:20:16 +0000 (UTC) (envelope-from ed@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0OIKFNN095244;
	Sat, 24 Jan 2009 18:20:15 GMT (envelope-from ed@svn.freebsd.org)
Received: (from ed@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0OIKFs9095243;
	Sat, 24 Jan 2009 18:20:15 GMT (envelope-from ed@svn.freebsd.org)
Message-Id: <200901241820.n0OIKFs9095243@svn.freebsd.org>
From: Ed Schouten 
Date: Sat, 24 Jan 2009 18:20:15 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r187671 - head/sys/kern
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 24 Jan 2009 18:20:16 -0000

Author: ed
Date: Sat Jan 24 18:20:15 2009
New Revision: 187671
URL: http://svn.freebsd.org/changeset/base/187671

Log:
  Mark kern.ttys as MPSAFE.
  
  sysctl now allows Giantless calls, so make kern.ttys use this. If it
  needs Giant, it locks the proper TTY anyway.

Modified:
  head/sys/kern/tty.c

Modified: head/sys/kern/tty.c
==============================================================================
--- head/sys/kern/tty.c	Sat Jan 24 15:56:44 2009	(r187670)
+++ head/sys/kern/tty.c	Sat Jan 24 18:20:15 2009	(r187671)
@@ -1053,7 +1053,7 @@ sysctl_kern_ttys(SYSCTL_HANDLER_ARGS)
 	return (error);
 }
 
-SYSCTL_PROC(_kern, OID_AUTO, ttys, CTLTYPE_OPAQUE|CTLFLAG_RD,
+SYSCTL_PROC(_kern, OID_AUTO, ttys, CTLTYPE_OPAQUE|CTLFLAG_RD|CTLFLAG_NOLOCK,
 	0, 0, sysctl_kern_ttys, "S,xtty", "List of TTYs");
 
 /*

From owner-svn-src-head@FreeBSD.ORG  Sat Jan 24 18:23:19 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A8B85106566B;
	Sat, 24 Jan 2009 18:23:19 +0000 (UTC) (envelope-from ed@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7D4528FC25;
	Sat, 24 Jan 2009 18:23:19 +0000 (UTC) (envelope-from ed@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0OINJjo095336;
	Sat, 24 Jan 2009 18:23:19 GMT (envelope-from ed@svn.freebsd.org)
Received: (from ed@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0OINJAD095335;
	Sat, 24 Jan 2009 18:23:19 GMT (envelope-from ed@svn.freebsd.org)
Message-Id: <200901241823.n0OINJAD095335@svn.freebsd.org>
From: Ed Schouten 
Date: Sat, 24 Jan 2009 18:23:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r187672 - head/sys/geom
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 24 Jan 2009 18:23:20 -0000

Author: ed
Date: Sat Jan 24 18:23:19 2009
New Revision: 187672
URL: http://svn.freebsd.org/changeset/base/187672

Log:
  Remove unused unrhdr from GEOM character device module.
  
  Now that make_dev() doesn't require unit numbers to be unique, there is
  no need to use an unrhdr here to generate the numbers. Remove the entire
  init-routine, because it is optional.

Modified:
  head/sys/geom/geom_dev.c

Modified: head/sys/geom/geom_dev.c
==============================================================================
--- head/sys/geom/geom_dev.c	Sat Jan 24 18:20:15 2009	(r187671)
+++ head/sys/geom/geom_dev.c	Sat Jan 24 18:23:19 2009	(r187672)
@@ -72,25 +72,14 @@ static struct cdevsw g_dev_cdevsw = {
 
 static g_taste_t g_dev_taste;
 static g_orphan_t g_dev_orphan;
-static g_init_t		g_dev_init;
 
 static struct g_class g_dev_class	= {
 	.name = "DEV",
 	.version = G_VERSION,
 	.taste = g_dev_taste,
 	.orphan = g_dev_orphan,
-	.init = g_dev_init,
 };
 
-static struct unrhdr *unithdr;	/* Locked by topology */
-
-static void
-g_dev_init(struct g_class *mp)
-{
-
-	unithdr = new_unrhdr(0, INT_MAX, NULL);
-}
-
 void
 g_dev_print(void)
 {
@@ -126,7 +115,6 @@ g_dev_taste(struct g_class *mp, struct g
 	struct g_consumer *cp;
 	int error;
 	struct cdev *dev;
-	u_int unit;
 
 	g_trace(G_T_TOPOLOGY, "dev_taste(%s,%s)", mp->name, pp->name);
 	g_topology_assert();
@@ -138,8 +126,7 @@ g_dev_taste(struct g_class *mp, struct g
 	error = g_attach(cp, pp);
 	KASSERT(error == 0,
 	    ("g_dev_taste(%s) failed to g_attach, err=%d", pp->name, error));
-	unit = alloc_unr(unithdr);
-	dev = make_dev(&g_dev_cdevsw, unit,
+	dev = make_dev(&g_dev_cdevsw, 0,
 	    UID_ROOT, GID_OPERATOR, 0640, gp->name);
 	if (pp->flags & G_PF_CANDELETE)
 		dev->si_flags |= SI_CANDELETE;
@@ -432,7 +419,6 @@ g_dev_orphan(struct g_consumer *cp)
 {
 	struct g_geom *gp;
 	struct cdev *dev;
-	u_int unit;
 
 	g_topology_assert();
 	gp = cp->geom;
@@ -444,9 +430,7 @@ g_dev_orphan(struct g_consumer *cp)
 		set_dumper(NULL);
 
 	/* Destroy the struct cdev *so we get no more requests */
-	unit = dev2unit(dev);
 	destroy_dev(dev);
-	free_unr(unithdr, unit);
 
 	/* Wait for the cows to come home */
 	while (cp->nstart != cp->nend)